API doc

Overview of the python-syncope api functions that can be used on your script(s).

python-syncope is an python wrapper for the Syncope Rest API.

class syncope.Syncope(syncope_url='', username=None, password=None, timeout=10)

Syncope Rest Interface.

create_account_policy(arguments=None)

Will create an account policy.

Parameters:arguments (JSON) – An JSON structure for creating the account policy.
Returns:False when something went wrong, or JSON data when created successfully.
Example:
>>> import syncope
>>> syn = syncope.Syncope(syncope_url="http://192.168.10.13:9080", username="admin", password="password")
>>> create_account_policy = '{"description":"My Description","type":"ACCOUNT","usedByResources":[],"usedByRoles":[],"specification":{"maxLength":0,"minLength":0,"pattern":null,"wordsNotPermitted":[],"schemasNotPermitted":["firstname","email"],"prefixesNotPermitted":[],"suffixesNotPermitted":[],"allUpperCase":false,"allLowerCase":false,"propagateSuspension":false,"permittedLoginRetries":0}}'
>>> print syn.create_account_policy(create_account_policy)
{u'usedByResources': [], u'description': u'My Description', u'specification': { <cut>
create_audit(arguments=None)

Will create an log level.

Parameters:arguments (JSON) – An JSON structure for creating the audit rule.
Returns:False when something went wrong, or True when audit rule is created.
Example:
>>> import syncope
>>> syn = syncope.Syncope(syncope_url="http://192.168.10.13:9080", username="admin", password="password")
>>> add_audit_rule = '{"type":"REST","category":"LoggerController","subcategory":null,"event":"listAudits","result":"SUCCESS"}'
>>> print syn.create_audit(add_audit_rule)
True
create_configuration(arguments=None)

Will create an configuration item.

Parameters:arguments (JSON) – An JSON structure for creating the configuration.
Returns:False when something went wrong, or True when configuration is created.
Example:
>>> import syncope
>>> syn = syncope.Syncope(syncope_url="http://192.168.10.13:9080", username="admin", password="password")
>>> add_configuration = '{"value": true, "key": "we.all.love.pizza"}'
>>> print syn.create_configuration(add_configuration)
True
create_notification(arguments=None)

Get create an notification.

Parameters:arguments (JSON) – An JSON structure for creating the notification.
Returns:False when something went wrong, or True when created successfully.
Example:
>>> import syncope
>>> syn = syncope.Syncope(syncope_url="http://192.168.10.13:9080", username="admin", password="password")
>>> create_notification = '{"events":["[REST]:[LoggerController]:[]:[deleteLog]:[SUCCESS]","[REST]:[LoggerController]:[]:[disableAudit]:[SUCCESS]"],"recipientAttrType":"Username","recipientAttrName":"Username","selfAsRecipient":true,"sender":"me@home.nl","subject":"this is something very important","template":"optin","traceLevel":"FAILURES"}'
>>> print syn.create_notification(create_notification)
True
create_or_update_log_level(arguments=None)

Will create or update an log level.

Parameters:arguments (JSON) – An JSON structure for creating or updating the log level.
Returns:False when something went wrong, or json data with all information from the just updated log level.
Example:
>>> import syncope
>>> syn = syncope.Syncope(syncope_url="http://192.168.10.13:9080", username="admin", password="password")
>>> update_loglevel = '{"name": "ROOT", "level": "INFO"}'
>>> print syn.create_or_update_log_level(update_loglevel)
{u'name': u'ROOT', u'level': u'INFO'}
create_password_policy(arguments=None)

Will create an password policy.

Parameters:arguments (JSON) – An JSON structure for creating the password policy.
Returns:False when something went wrong, or JSON data when created successfully.
Example:
>>> import syncope
>>> syn = syncope.Syncope(syncope_url="http://192.168.10.13:9080", username="admin", password="password")
>>> create_password_policy = '{"description":"My First Sync","type":"SYNC","usedByResources":[],"usedByRoles":[],"specification":{"uAltSearchSchemas":["loginDate"],"userJavaRule":null,"rAltSearchSchemas":[],"roleJavaRule":null,"conflictResolutionAction":"FIRSTMATCH"}}'
>>> print syn.create_password_policy(create_password_policy)
{u'usedByResources': [], u'description': u'My Description', u'specification': { <cut>
create_role(arguments=None)

Will create an role.

Parameters:arguments (JSON) – An JSON structure for creating the role. An example can be found in the ‘examples’ folder.
Returns:False when something went wrong, or json data with all information from the just created role.
Example:
>>> import syncope
>>> syn = syncope.Syncope(syncope_url="http://192.168.10.13:9080", username="admin", password="password")
>>> create_role = '{"attributes":[{"schema":"icon","values":[],"readonly":false},{"schema":"rderived_dx","values":[],"readonly":false},{"schema":"rderived_sx","values":[],"readonly":false},{"schema":"show","values":["false"],"readonly":false},{"schema":"title","values":["My new attribute Title."],"readonly":false}],"id":0,"derivedAttributes":[],"virtualAttributes":[],"resources":["ws-target-resource-2","ws-target-resource-1"],"propagationStatusTOs":[],"name":"my_new_role","parent":1,"userOwner":null,"roleOwner":null,"inheritOwner":true,"inheritAttributes":false,"inheritDerivedAttributes":false,"inheritVirtualAttributes":false,"inheritPasswordPolicy":false,"inheritAccountPolicy":false,"entitlements":["CONFIGURATION_CREATE","CONFIGURATION_DELETE"],"passwordPolicy":4,"accountPolicy":6}'
>>> print syn.create_role(create_role)
{u'inheritVirtualAttributes': False, u'inheritDerivedAttributes': False, u'roleOwner': None, u'name': u'my_new_role', u'parent': 1, <cut>}
create_sync_policy(arguments=None)

Will create an sync policy.

Parameters:arguments (JSON) – An JSON structure for creating the sync policy.
Returns:False when something went wrong, or JSON data when created successfully.
Example:
>>> import syncope
>>> syn = syncope.Syncope(syncope_url="http://192.168.10.13:9080", username="admin", password="password")
>>> create_sync_policy = '{"description":"My First Sync","type":"SYNC","usedByResources":[],"usedByRoles":[],"specification":{"uAltSearchSchemas":["loginDate"],"userJavaRule":null,"rAltSearchSchemas":[],"roleJavaRule":null,"conflictResolutionAction":"FIRSTMATCH"}}'
>>> print syn.create_sync_policy(create_sync_policy)
{u'usedByResources': [], u'description': u'My Description', u'specification': { <cut>
create_user(arguments)

Will create an user.

Parameters:arguments (JSON) – An JSON structure for creating the user. An example can be found in the ‘examples’ folder.
Returns:False when something went wrong, or json data with all information from the just created user.
Example:
>>> import syncope
>>> syn = syncope.Syncope(syncope_url="http://192.168.10.13:9080", username="admin", password="password")
>>> create_user = '{"attributes": [{"schema": "aLong","values": [],"readonly": false},{"schema": "activationDate","values": [""],"readonly": false},{"schema": "cool","values": ["false"],"readonly": false},{"schema": "email","values": ["werner@dj-wasabi.nl"],"readonly": false},{"schema": "firstname","values": ["Werner"],"readonly": false},{"schema": "fullname","values": ["Werner Dijkerman"],"readonly": false},{"schema": "gender","values": ["M"],"readonly": false},{"schema": "loginDate","values": [""],"readonly": false},{"schema": "makeItDouble","values": [],"readonly": false},{"schema": "surname","values": ["Dijkerman"],"readonly": false},{"schema": "type","values": ["account"],"readonly": false},{"schema": "uselessReadonly","values": [""],"readonly": true},{"schema": "userId","values": ["werner@dj-wasabi.nl"],"readonly": false}],"id": 0,"derivedAttributes": [{"schema": "cn","values": [],"readonly": false}],"virtualAttributes": [],"password": "password1234","status": null,"token": null,"tokenExpireTime": null,"username": "wedijkerman","lastLoginDate": null,"creationDate": null,"changePwdDate": null,"failedLogins": null}'
>>> print syn.create_users(create_user)
{u'status': u'active', u'username': u'wedijkerman', u'creationDate': 1444152747171, <cut>}
delete_account_policy(id=None)

Will delete an account policy.

Parameters:id (Int) – The account policy id.
Returns:False when something went wrong, or True when created successfully.
Example:
>>> import syncope
>>> syn = syncope.Syncope(syncope_url="http://192.168.10.13:9080", username="admin", password="password")
>>> print syn.delete_account_policy(1001)
True
delete_audit(arguments=None)

Will delete an audit rule.

Parameters:arguments (JSON) – An JSON structure for deleting the audit rule.
Returns:False when something went wrong, True when delete of audit rule is successful.
Example:
>>> import syncope
>>> syn = syncope.Syncope(syncope_url="http://192.168.10.13:9080", username="admin", password="password")
>>> delete_audit_rule = '{"type":"REST","category":"LoggerController","subcategory":null,"event":"listAudits","result":"SUCCESS"}'
>>> print syn.delete_audit(delete_audit_rule)
True
delete_configuration_by_key(key=None)

Will delete an configuration item..

Parameters:key (JSON) – The “key” name of the configuration item.
Returns:False when something went wrong, or True when configuration is deleted.
Example:
>>> import syncope
>>> syn = syncope.Syncope(syncope_url="http://192.168.10.13:9080", username="admin", password="password")
>>> print syn.delete_configuration_by_key("we.all.love.pizza")
True
delete_log_level_by_name(name=None)

Will delete an log level by the name.

Parameters:name (String) – The name of the log level.
Returns:False when something went wrong, or True when log level is deleted successfully.
Example:
>>> import syncope
>>> syn = syncope.Syncope(syncope_url="http://192.168.10.13:9080", username="admin", password="password")
>>> print syn.delete_log_level_by_name("SYNCOPE")
True
delete_notification_by_id(id=None)

Get information for specific log level.

Parameters:name (Int) – The id for the notification.
Returns:False when something went wrong, or True when deleted successfully.
Example:
>>> import syncope
>>> syn = syncope.Syncope(syncope_url="http://192.168.10.13:9080", username="admin", password="password")
>>> print syn.delete_notification_by_id(104)
True
delete_password_policy(id=None)

Will delete an account policy.

Parameters:id (Int) – The account policy id.
Returns:False when something went wrong, or True when created successfully.
Example:
>>> import syncope
>>> syn = syncope.Syncope(syncope_url="http://192.168.10.13:9080", username="admin", password="password")
>>> print syn.delete_password_policy(1001)
True
delete_role_by_id(id=None)

Will delete an role.

Parameters:id (int) – The id of the role to delete.
Returns:True when role is deleted, False when role don’t exists or something failed.
delete_sync_policy(id=None)

Will delete an account policy.

Parameters:id (Int) – The account policy id.
Returns:False when something went wrong, or True when created successfully.
Example:
>>> import syncope
>>> syn = syncope.Syncope(syncope_url="http://192.168.10.13:9080", username="admin", password="password")
>>> print syn.delete_sync_policy(1001)
True
delete_user_by_id(id=None)

Will delete an user.

Parameters:id (int) – The id of the user to delete.
Returns:True when user is deleted, False when user don’t exists or something failed.
enable_user_by_id(id=None)

Will activate an user.

Parameters:id (int) – The id of the user to activate.
Returns:False when something went wrong, or json data with all information from this specific user.
Example:
>>> import syncope
>>> syn = syncope.Syncope(syncope_url="http://192.168.10.13:9080", username="admin", password="password")
>>> print syn.enable_user_by_id(1)
{u'status': u'active', u'username': u'rossini', <cut>}
enable_user_by_name(username=None)

Will activate an user.

Parameters:username (string) – The username of the user to activate.
Returns:False when something went wrong, or json data with all information from this specific user.
Example:
>>> import syncope
>>> syn = syncope.Syncope(syncope_url="http://192.168.10.13:9080", username="admin", password="password")
>>> print syn.enable_user_by_name("rossini")
{u'status': u'active', u'username': u'rossini', <cut>}
get_account_policies()

Will return a list of account policies.

Returns:False when something went wrong, or json data with all account policies.
Example:
>>> import syncope
>>> syn = syncope.Syncope(syncope_url="http://192.168.10.13:9080", username="admin", password="password")
>>> print syn.get_account_policies()
[{u'usedByResources': [], u'description': u'sample account policy', <cut>
get_account_policy_by_id(id=None)

Will return information with account policy for id.

Returns:False when something went wrong, or json data with information for account policie.
Example:
>>> import syncope
>>> syn = syncope.Syncope(syncope_url="http://192.168.10.13:9080", username="admin", password="password")
>>> print syn.get_account_policy_by_id(5)
{u'usedByResources': [u'ws-target-resource-1', u'ws-target-resource-2', u'ws-target-resource-timeout', <cut>
get_audit()

Get information from all audit rules in JSON.

Returns:False when something went wrong, or json data with information from all audit rule.
get_children_role_by_id(id=None)

Will get all data for the parent of the provided role id.

Parameters:id (int) – The id of the role to get the parent information.
Returns:False when something went wrong, or json data with all information from this specific role.
Example:
>>> import syncope
>>> syn = syncope.Syncope(syncope_url="http://192.168.10.13:9080", username="admin", password="password")
>>> print syn.get_children_role_by_id(4)
[{u'inheritVirtualAttributes': False, u'inheritDerivedAttributes': False, u'roleOwner': None, u'name': u'secretary', u'parent': 4, <cut>}]
get_configuration_by_key(key=None)

Will get the info for specific configuration key.

Parameters:key (String) – The “key” name of the configuration item.
Returns:False when something went wrong, or json data with all information from the configuration.
Example:
>>> import syncope
>>> syn = syncope.Syncope(syncope_url="http://192.168.10.13:9080", username="admin", password="password")
>>> print syn.get_configuration_by_key("password.cipher.algorithm")
{u'value': u'SHA1', u'key': u'password.cipher.algorithm'}
get_configuration_mailtemplates()

Will get the info for the mailtemplates.

Returns:False when something went wrong, or json data with all information about the mailtemplates.
Example:
>>> import syncope
>>> syn = syncope.Syncope(syncope_url="http://192.168.10.13:9080", username="admin", password="password")
>>> print syn.get_configuration_mailtemplates()
[{u'name': u'optin'}]
get_configuration_stream()

Returns configuration as an downloadable content.xml database export file.

Returns:False when something went wrong, or XML data.
>>> import xml.etree.ElementTree as ET
>>> import syncope
>>> syn = syncope.Syncope(syncope_url="http://192.168.10.13:9080", username="admin", password="password")
>>> response = syn.get_configuration_stream()
>>> tree = ET.parse(response.text)
>>> root = tree.getroot()
>>> print tree
get_configuration_validators()

Will get the info for the configuration validators.

Returns:False when something went wrong, or json data with all information from the validators.
Example:
>>> import syncope
>>> syn = syncope.Syncope(syncope_url="http://192.168.10.13:9080", username="admin", password="password")
>>> print syn.get_configuration_validators()
[{u'name': u'org.apache.syncope.core.persistence.validation.attrvalue.AlwaysTrueValidator'}, <cut>
get_configurations()

Will get all configured configuration options.

Returns:False when something went wrong, or json data with all information from all configurations.
Example:
>>> import syncope
>>> syn = syncope.Syncope(syncope_url="http://192.168.10.13:9080", username="admin", password="password")
>>> print syn.get_configurations()
[{u'value': u'SHA1', u'key': u'password.cipher.algorithm'}, {u'value': u'not-existing', <cut>
get_entitlements()

Will return a list of all known entitlements.

Returns:False when something went wrong, or json data with all know entitlements.
Example:
>>> import syncope
>>> syn = syncope.Syncope(syncope_url="http://192.168.10.13:9080", username="admin", password="password")
>>> print syn.get_entitlements()
[{u'name': u'NOTIFICATION_UPDATE'}, {u'name': u'SCHEMA_CREATE'}, <cut>
get_log_level_by_name(name=None)

Get information for specific log level.

Parameters:name (String) – The name of the log level.
Returns:False when something went wrong, or json data with information of the log level.
Example:
>>> import syncope
>>> syn = syncope.Syncope(syncope_url="http://192.168.10.13:9080", username="admin", password="password")
>>> print syn.get_log_level_by_name("ROOT")
{u'name': u'ROOT', u'level': u'OFF'}
get_log_levels()

Get information from all log levels in JSON.

Returns:False when something went wrong, or json data with all information from all log levels.
get_notification_by_id(id=None)

Will return information for notification by id.

Parameters:id (Int.) – The notification ID.
Returns:False when something went wrong, or json data with all notifications.
Example:
>>> import syncope
>>> syn = syncope.Syncope(syncope_url="http://192.168.10.13:9080", username="admin", password="password")
>>> print syn.get_notification_by_id(1)
[{u'recipientAttrType': u'UserSchema', u'about': {u'membershipCond': None, <cut>
get_notifications()

Will return a list of all notifications.

Returns:False when something went wrong, or json data with all notifications.
Example:
>>> import syncope
>>> syn = syncope.Syncope(syncope_url="http://192.168.10.13:9080", username="admin", password="password")
>>> print syn.get_notifications()
[{u'recipientAttrType': u'UserSchema', u'about': {u'membershipCond': None, <cut>
get_own_entitlements()

Will return a list of all known entitlements.

Returns:False when something went wrong, or json data with all know entitlements.
Example:
>>> import syncope
>>> syn = syncope.Syncope(syncope_url="http://192.168.10.13:9080", username="admin", password="password")
>>> print syn.get_own_entitlements()
[{u'name': u'NOTIFICATION_UPDATE'}, {u'name': u'SCHEMA_CREATE'}, <cut>
get_paged_users_by_query(arguments=None, page=None, size=None)

Will search an user and will return the data by pages.

Parameters:
  • arguments (JSON) – An JSON structure. See example for more information.
  • page (int) – The page it should return.
  • size (int) – The amount of results per page.
Returns:

False when something went wrong, or json data with all information from the search request.

Example:
>>> import syncope
>>> syn = syncope.Syncope(syncope_url="http://192.168.10.13:9080", username="admin", password="password")
>>> search_req = '{"type":"LEAF","attributableCond":{"type":"EQ","schema":"status","expression":"active"}}'
>>> print syn.get_paged_users_by_query(search_user, 1, 1)
{u'status': u'active', u'username': u'rossini', <cut>}
>>> print syn.get_paged_users_by_query(search_user, 3, 1)
{u'status': u'active', u'username': u'vivaldi', <cut>}
get_parent_role_by_id(id=None)

Will get all data for the parent of the provided role id.

Parameters:id (int) – The id of the role to get the parent information.
Returns:False when something went wrong, or json data with all information from this specific role.
Example:
>>> import syncope
>>> syn = syncope.Syncope(syncope_url="http://192.168.10.13:9080", username="admin", password="password")
>>> print syn.get_parent_role_by_id(2)
{u'inheritVirtualAttributes': False, u'inheritDerivedAttributes': False, u'roleOwner': None, u'name': u'root', u'parent': 0, <cut>}
get_password_policies()

Will return a list of password policies.

Returns:False when something went wrong, or json data with all password policies.
Example:
>>> import syncope
>>> syn = syncope.Syncope(syncope_url="http://192.168.10.13:9080", username="admin", password="password")
>>> print syn.get_account_policies()
[{u'usedByResources': [u'resource-csv'], u'description': u'password policy 2' <cut>
get_password_policy_by_id(id=None)

Will return information with password policy for id.

Returns:False when something went wrong, or json data with information for password policy.
Example:
>>> import syncope
>>> syn = syncope.Syncope(syncope_url="http://192.168.10.13:9080", username="admin", password="password")
>>> print syn.get_password_policy_by_id(9)
{u'usedByResources': [u'ws-target-resource-2'], u'description': u'password policy for java rule', <cut>
get_role_by_id(id=None)

Will get all data from specific role, specified via id.

Parameters:id (int) – The id of the role to get information.
Returns:False when something went wrong, or json data with all information from this specific role.
Example:
>>> import syncope
>>> syn = syncope.Syncope(syncope_url="http://192.168.10.13:9080", username="admin", password="password")
>>> print syn.get_role_by_id(2)
{u'inheritVirtualAttributes': False, u'inheritDerivedAttributes': False, u'roleOwner': None, u'name': u'child', u'parent': 1, <cut>}
get_roles()

Get information from all roles in JSON.

Returns:False when something went wrong, or json data with all information from all roles.
get_sync_policies()

Will return a list of sync policies.

Returns:False when something went wrong, or json data with all sync policies.
Example:
>>> import syncope
>>> syn = syncope.Syncope(syncope_url="http://192.168.10.13:9080", username="admin", password="password")
>>> print syn.get_account_policies()
[{u'usedByResources': [u'resource-csv'], u'description': u'sync policy 2' <cut>
get_sync_policy_by_id(id=None)

Will return information with sync policy for id.

Returns:False when something went wrong, or json data with information for sync policy.
Example:
>>> import syncope
>>> syn = syncope.Syncope(syncope_url="http://192.168.10.13:9080", username="admin", password="password")
>>> print syn.get_sync_policy_by_id(9)
{u'usedByResources': [u'ws-target-resource-2'], u'description': u'sync policy for java rule', <cut>
get_user_by_id(id=None)

Will get all data from specific user, specified via id.

Parameters:id (int) – The id of the user to get information.
Returns:False when something went wrong, or json data with all information from this specific user.
Example:
>>> import syncope
>>> syn = syncope.Syncope(syncope_url="http://192.168.10.13:9080", username="admin", password="password")
>>> print syn.get_user_by_id(5)
{u'status': u'active', u'username': u'puccini', <cut>}
get_user_by_name(username=None)

Will get all data from specific user, specified via username.

Parameters:username (string) – The username of the user to get information.
Returns:False when something went wrong, or json data with all information from this specific user.
Example:
>>> import syncope
>>> syn = syncope.Syncope(syncope_url="http://192.168.10.13:9080", username="admin", password="password")
>>> print syn.get_user_by_name("puccini")
{u'status': u'active', u'username': u'puccini', <cut>}
get_user_count_by_query(arguments=None)

Will count the users matching the search request.

Parameters:arguments (JSON) – An JSON structure. See example for more information.
Returns:False when something went wrong, or the amount of users matching the request.
Example:
>>> import syncope
>>> syn = syncope.Syncope(syncope_url="http://192.168.10.13:9080", username="admin", password="password")
>>> search_req = '{"type":"LEAF","attributableCond":{"type":"EQ","schema":"username","expression":"vivaldi"}}'
>>> print syn.get_user_count_by_query(search_req)
5
>>> search_req = '{"type":"LEAF","resourceCond":{"resourceName":"ws-target-resource-1"}}'
>>> print syn.get_user_count_by_query(search_req)
1
get_users()

Get information from all users in JSON.

Returns:False when something went wrong, or json data with all information from all users.
get_users_by_query(arguments=None)

Will search an user. It will require an python dict to be used for the searching.

Parameters:arguments (JSON) – An JSON structure. See example for more information.
Returns:False when something went wrong, or json data with all information from the search request.
Example:
>>> import syncope
>>> syn = syncope.Syncope(syncope_url="http://192.168.10.13:9080", username="admin", password="password")
>>> search_req = '{"type":"LEAF","attributableCond":{"type":"EQ","schema":"username","expression":"vivaldi"}}'
>>> print syn.get_users_by_query(search_req)
{u'status': u'active', u'username': u'vivaldi', <cut>}
>>> search_req = '{"type":"LEAF","resourceCond":{"resourceName":"ws-target-resource-1"}}'
>>> print syn.get_users_by_query(search_req)
{u'status': u'active', u'username': u'vivaldi', <cut>}
get_users_count()

Will count all users found in Syncope and return an number.

Returns:False when something went wrong, or the amount of users.
Example:
>>> import syncope
>>> syn = syncope.Syncope(syncope_url="http://192.168.10.13:9080", username="admin", password="password")
>>> print syn.get_users_count()
5
reactivate_user_by_id(id=None)

Will reactivate an user.

Parameters:id (int) – The id of the user to reactivate.
Returns:False when something went wrong, or json data with all information from this specific user.
Example:
>>> import syncope
>>> syn = syncope.Syncope(syncope_url="http://192.168.10.13:9080", username="admin", password="password")
>>> print syn.reactivate_user_by_id(1)
{u'status': u'active', u'username': u'rossini', <cut>}
reactivate_user_by_name(username=None)

Will reactivate an user.

Parameters:username (string) – The username of the user to reactivate.
Returns:False when something went wrong, or json data with all information from this specific user.
Example:
>>> import syncope
>>> syn = syncope.Syncope(syncope_url="http://192.168.10.13:9080", username="admin", password="password")
>>> print syn.reactivate_user_by_name("rossini")
{u'status': u'active', u'username': u'rossini', <cut>}
suspend_user_by_id(id=None)

Will suspend an user.

Parameters:id (int) – The id of the user to suspend.
Returns:False when something went wrong, or json data with all information from this specific user.
Example:
>>> import syncope
>>> syn = syncope.Syncope(syncope_url="http://192.168.10.13:9080", username="admin", password="password")
>>> print syn.suspend_user_by_id(1)
{u'status': u'suspended', u'username': u'rossini', <cut>}
suspend_user_by_name(username=None)

Will suspend an user.

Parameters:username (string) – The username of the user to suspend.
Returns:False when something went wrong, or json data with all information from this specific user.
Example:
>>> import syncope
>>> syn = syncope.Syncope(syncope_url="http://192.168.10.13:9080", username="admin", password="password")
>>> print syn.suspend_user_by_("rossini")
{u'status': u'suspended', u'username': u'rossini', <cut>}
update_account_policy(arguments=None)

Will update an account policy.

Parameters:arguments (JSON) – An JSON structure for updating the account policy.
Returns:False when something went wrong, or JSON data when updated successfully.
Example:
>>> import syncope
>>> syn = syncope.Syncope(syncope_url="http://192.168.10.13:9080", username="admin", password="password")
>>> update_account_policy = '{"id":1001,"description":"My Description 2","type":"ACCOUNT","usedByResources":[],"usedByRoles":[],"specification":{"maxLength":0,"minLength":0,"pattern":null,"wordsNotPermitted":[],"schemasNotPermitted":["firstname"],"prefixesNotPermitted":[],"suffixesNotPermitted":[],"allUpperCase":false,"allLowerCase":false,"propagateSuspension":false,"permittedLoginRetries":0}}'
>>> print syn.create_account_policy(update_account_policy)
{u'usedByResources': [], u'description': u'My Description', u'specification': { <cut>
update_configuration(arguments=None)

Will update the configuration.

Parameters:arguments (JSON) – An JSON structure for updating the configuration.
Returns:False when something went wrong, or True when the configuration is updated.
Example:
>>> import syncope
>>> syn = syncope.Syncope(syncope_url="http://192.168.10.13:9080", username="admin", password="password")
>>> update_configuration = '{"value": false, "key": "we.all.love.pizza"}'
>>> print syn.update_configuration(update_configuration)
True
update_notification_by_id(arguments=None)

Get information for specific log level.

Parameters:arguments (JSON) – An JSON structure for updating the notification.
Returns:False when something went wrong, or True when updated successfully.
Example:
>>> import syncope
>>> syn = syncope.Syncope(syncope_url="http://192.168.10.13:9080", username="admin", password="password")
>>> update_notification = '{"id":104,"events":["[REST]:[LoggerController]:[]:[deleteLog]:[SUCCESS]"],"about":null,"recipients":null,"recipientAttrType":"Username","recipientAttrName":"Username","selfAsRecipient":true,"sender":"me@home.nl","subject":"this is something very important","template":"optin","traceLevel":"FAILURES"}'
>>> print syn.update_notification_by_id(update_notification)
True
update_password_policy(arguments=None)

Will update an password policy.

Parameters:arguments (JSON) – An JSON structure for updating the account policy.
Returns:False when something went wrong, or JSON data when updated successfully.
Example:
>>> import syncope
>>> syn = syncope.Syncope(syncope_url="http://192.168.10.13:9080", username="admin", password="password")
>>> update_password_policy = '{"id":1001, "description":"My First Sync","type":"SYNC","usedByResources":[],"usedByRoles":[],"specification":{"uAltSearchSchemas":["loginDate"],"userJavaRule":null,"rAltSearchSchemas":[],"roleJavaRule":null,"conflictResolutionAction":"FIRSTMATCH"}}'
>>> print syn.create_password_policy(update_password_policy)
{u'usedByResources': [], u'description': u'My Description', u'specification': { <cut>
update_role(arguments=None)

Will update an role.

Parameters:arguments (JSON) – An JSON structure for updating the role.
Returns:False when something went wrong, or json data with all information from the just updated role.
Example:
>>> import syncope
>>> syn = syncope.Syncope(syncope_url="http://192.168.10.13:9080", username="admin", password="password")
>>> update_role = '{"id":102,"attributesToBeUpdated":[{"schema":"title","valuesToBeAdded":["My next new attribute Title."],"valuesToBeRemoved":["My new attribute Title."]}],"attributesToBeRemoved":["icon","rderived_sx","title","rderived_dx"],"derivedAttributesToBeAdded":[],"derivedAttributesToBeRemoved":[],"virtualAttributesToBeUpdated":[{"schema":"rvirtualdata","valuesToBeAdded":["virtual"],"valuesToBeRemoved":[]}],"virtualAttributesToBeRemoved":[],"resourcesToBeAdded":[],"resourcesToBeRemoved":["ws-target-resource-2"],"name":null,"userOwner":{"id":null},"roleOwner":{"id":null},"inheritOwner":true,"inheritAttributes":false,"inheritDerivedAttributes":false,"inheritVirtualAttributes":false,"inheritAccountPolicy":false,"inheritPasswordPolicy":false,"entitlements":["CONFIGURATION_CREATE","CONFIGURATION_DELETE","CONNECTOR_DELETE"],"passwordPolicy":{"id":4},"accountPolicy":{"id":6}}'
>>> print syn.update_role(update_role)
{u'inheritVirtualAttributes': False, u'inheritDerivedAttributes': False, u'roleOwner': None, u'name': u'my_new_role', u'parent': 1, <cut>}
update_sync_policy(arguments=None)

Will update an sync policy.

Parameters:arguments (JSON) – An JSON structure for updating the account policy.
Returns:False when something went wrong, or JSON data when updated successfully.
Example:
>>> import syncope
>>> syn = syncope.Syncope(syncope_url="http://192.168.10.13:9080", username="admin", password="password")
>>> update_sync_policy = '{"id":1001, "description":"My First Sync","type":"SYNC","usedByResources":[],"usedByRoles":[],"specification":{"uAltSearchSchemas":["loginDate"],"userJavaRule":null,"rAltSearchSchemas":[],"roleJavaRule":null,"conflictResolutionAction":"FIRSTMATCH"}}'
>>> print syn.create_sync_policy(update_sync_policy)
{u'usedByResources': [], u'description': u'My Description', u'specification': { <cut>
update_user(arguments)

Will update an user.

Parameters:arguments (JSON) – An JSON structure for updating the user. An example can be found in the ‘examples’ folder.
Returns:False when something went wrong, or json data with all information from the just updated user.
Example:
>>> import syncope
>>> syn = syncope.Syncope(syncope_url="http://192.168.10.13:9080", username="admin", password="password")
>>> update_user = '{"id":137,"attributesToBeUpdated":[{"schema":"uselessReadonly","valuesToBeAdded":[],"valuesToBeRemoved":[]},{"schema":"loginDate","valuesToBeAdded":[],"valuesToBeRemoved":[]},{"schema":"activationDate","valuesToBeAdded":[],"valuesToBeRemoved":[]}],"attributesToBeRemoved":["aLong","makeItDouble"],"derivedAttributesToBeAdded":[],"derivedAttributesToBeRemoved":[],"virtualAttributesToBeUpdated":[],"virtualAttributesToBeRemoved":[],"resourcesToBeAdded":[],"resourcesToBeRemoved":[],"password":null,"username":"wdijkerman","membershipsToBeAdded":[],"membershipsToBeRemoved":[],"pwdPropRequest":{"resources":[],"onSyncope":false}}'
>>> print syn.update_user(update_user)
{u'status': u'active', u'username': u'wdijkerman', u'creationDate': 1444676322330, <cut>}