UsersResource


Create a user in an enterprise


When creating a user, provide the password as plain text. You are not allowed to use this method when the platform is using directory services, such as LDAP.

POST https://example.com/api/admin/enterprises/{enterprise}/users

Roles : [ROLE_USERS_MANAGE_USERS, ROLE_USERS_MANAGE_OTHER_ENTERPRISES]

Content-Type : user Accept : user

Error Codes

  • EN-0 - The requested enterprise does not exist
  • ROLE-8 - Not enough privileges to manage this role
  • SCOPE-1 - The requested scope does not exist
  • USER 11 - The user password is required
  • USER-20 - User must have a role from their enterprise or a global role
  • USER-21 - The field surname is required
  • USER-26 - The user email is required
  • VDC-0 - The requested virtual datacenter does not exist

Example

List users links of an enterprise


Get the users of an enterprise as links

GET https://example.com/api/admin/enterprises/{enterprise}/users

Roles : [ROLE_AUTHENTICATED, ROLE_USERS_VIEW, ROLE_USERS_MANAGE_USERS, ROLE_USERS_MANAGE_OTHER_ENTERPRISES]

Parameter Type Default Value Description
startwith Integer 0 The first element to be retrieved of the filtered search
by String name Order by
has String If present filter to apply in the search.
asc Boolean true If the value of the 'by' parameter must be sorted in ascending order (true) or descending order (false)
limit Integer 25 The number of entities to retrieve
connected boolean If true, only returns currently connected users
activated Boolean If true, only returns activated users

Accept : links

Example

List users of an enterprise


Get the users of an enterprise

GET https://example.com/api/admin/enterprises/{enterprise}/users

Roles : [ROLE_AUTHENTICATED, ROLE_USERS_VIEW, ROLE_USERS_MANAGE_USERS, ROLE_USERS_MANAGE_OTHER_ENTERPRISES]

Parameter Type Default Value Description
startwith Integer 0 The first element to be retrieved of the filtered search
by String name Order by
has String If present filter to apply in the search.
asc Boolean true If the value of the 'by' parameter must be sorted in ascending order (true) or descending order (false)
limit Integer 25 The number of entities to retrieve
connected boolean If true, only returns currently connected users
activated Boolean If true, only returns activated users

Accept : users

Error Codes

  • EN-0 - The requested enterprise does not exist
  • GEN-4 - Not enough permissions to perform this action

Example

List users of an enterprise with roles


Get the users of an enterprise including their roles

GET https://example.com/api/admin/enterprises/{enterprise}/users

Roles : [ROLE_AUTHENTICATED, ROLE_USERS_VIEW, ROLE_USERS_MANAGE_USERS, ROLE_USERS_MANAGE_OTHER_ENTERPRISES]

Parameter Type Default Value Description
startwith Integer 0 The first element to be retrieved of the filtered search
by String name Order by
has String If present filter to apply in the search.
asc Boolean true If the value of the 'by' parameter must be sorted in ascending order (true) or descending order (false)
limit Integer 25 The number of entities to retrieve
connected boolean If true, only returns currently connected users
activated Boolean If true, only returns activated users

Accept : userswithroles

Example

Delete a user from an enterprise


Deletes a user from an enterprise.

DELETE https://example.com/api/admin/enterprises/{enterprise}/users/{user}

Roles : [ROLE_USERS_MANAGE_USERS]

Example

Get a user of an enterprise


When retrieving an enterprise, you can use a '_' (wildcard) in the path parameter if the enterprise is not known

GET https://example.com/api/admin/enterprises/{enterprise}/users/{user}

Roles : [ROLE_AUTHENTICATED, ROLE_USERS_VIEW, ROLE_PHYS_DC_RETRIEVE_DETAILS]

Parameter Type Default Value Description
name Boolean false If true, only returns the user name

Accept : user

Error Codes

  • EN-0 - The requested enterprise does not exist
  • GEN-4 - Not enough permissions to perform this action
  • USER-0 - The user is not assigned to the enterprise
  • USER-3 - The requested user does not exist

Example

Update a user of an enterprise


When updating a user, the password field can be omitted if you do not want to change it. The enterprise path parameter can be a '_' (wildcard) if the enterprise is not known

PUT https://example.com/api/admin/enterprises/{enterprise}/users/{user}

Roles : [ROLE_AUTHENTICATED, ROLE_USERS_MANAGE_USERS, ROLE_ENTERPRISE_ADMINISTER_ALL]

Content-Type : user Accept : user

Error Codes

  • CONSTR-LENGTH - The property 'publicSshKey' length must be between 1 and 2048.
  • EN-0 - The requested enterprise does not exist
  • SCOPE-1 - The requested scope does not exist
  • USER 10 - Cannot change the user nick (username)
  • USER-0 - The user is not assigned to the enterprise
  • USER-17 - Cannot move user with local role to another enterprise
  • USER-20 - User must have a role from their enterprise or a global role
  • USER-22 - The role of the user is locked. Only users with the same role can modify users with locked roles
  • USER-25 - Cannot modify the user's role because this is the last user with the cloud admin role
  • USER-26 - The user email is required
  • USER-3 - The requested user does not exist
  • USER-5 - The email is not valid

Example

Disable two factor authentication for a user


Disable 2FA for the given user

POST https://example.com/api/admin/enterprises/{enterprise}/users/{user}/action/disable2fa

Roles : [ROLE_AUTHENTICATED, ROLE_USERS_MANAGE_USERS, ROLE_ENTERPRISE_ADMINISTER_ALL]

Example

Enable two factor authentication for a user


Enable 2FA for given user

POST https://example.com/api/admin/enterprises/{enterprise}/users/{user}/action/enable2fa

Roles : [ROLE_AUTHENTICATED, ROLE_USERS_MANAGE_USERS, ROLE_ENTERPRISE_ADMINISTER_ALL]

Error Codes

  • 2FA-1 - Two-factor authentication is already enabled for the current user
  • 2FA-2 - The given two-factor authentication provider is not supported
  • 2FA-3 - The platform is not configured to use two factor authentication
  • 2FA-4 - Cannot enable two-factor authentication for another user
  • 2FA-5 - Cannot enable two-factor authentication. Email is required.

Example

List pending tasks on workflow tool


Retrieves all tasks that are in state QUEUEING.
This means that workflow integration is enabled and that Abiquo is still waiting for the workflow tool to get back and either start or cancel the task.

GET https://example.com/api/admin/enterprises/{enterprise}/users/{user}/action/pendingtasks

Roles : [ROLE_AUTHENTICATED]

Parameter Type Default Value Description
startwith Integer 0 The first element to be retrieved of the filtered search
has String If present filter to apply in the search.
limit Integer The number of entities to retrieve

Accept : tasks

Error Codes

  • CONSTR-MIN - Parameter 'limit' must be greater than or equal to 1 but value '0' was found
  • QUERY-2 - Invalid range: 'startwith' parameter must be less than 'limit' parameter
  • USER-3 - The requested user does not exist

Example

List async tasks by user


Returns the async tasks that belong to the given user

GET https://example.com/api/admin/enterprises/{enterprise}/users/{user}/asynctasks

Roles : [ROLE_AUTHENTICATED]

Parameter Type Default Value Description
startwith Integer 0 The first element to be retrieved of the filtered search
has String Only used to order by 'creation_date'
limit Integer 25 The number of entities to retrieve
asc Boolean false If the value of the 'by' parameter must be sorted in ascending order (true) or descending order (false)
state String Filter by async task state. Possible values: 'all', 'in_progress' or 'finished'
from Long Filter async tasks created after the specified timestamp. Expressed in milliseconds.
to Long Filter async tasks created before the specified timestamp. Expressed in milliseconds

Accept : asynctasks

Example

List virtual machines that belong to a user


Retrieve VMs that belong to a user

GET https://example.com/api/admin/enterprises/{enterprise}/users/{user}/action/virtualmachines

Roles : [ROLE_VAPP_CUSTOMISE_SETTINGS]

Accept : virtualmachines

Example