Skip to main content

users

Creates, updates, deletes, gets or lists a users resource.

Overview​

Nameusers
TypeResource
Idovh.dedicated_cloud.users

Fields​

The following fields are returned by SELECT queries:

successful operation

NameDatatypeDescription
namestringName of the user
active_directory_idintegerDeprecated - Linked Federation Active Directory (if any) (wire: activeDirectoryId)
identity_provider_idintegerLinked Identity Provider (if any), can be Federation Active Directory or IAM (wire: identityProviderId)
user_idinteger (wire: userId)
first_namestringFirst name of the user (wire: firstName)
last_namestringLast name of the user (wire: lastName)
activation_statestringActivation state of the user account (disabled, disabling, enabled, enabling, toDisable, toEnable) (wire: activationState)
active_directory_typestringDeprecated - Federation Active Directory User type (if any) (group, user) (wire: activeDirectoryType)
can_manage_ip_fail_oversbooleanDefines if the user can manage ip failovers (wire: canManageIpFailOvers)
can_manage_networkbooleanDefines if the user can manage the network (wire: canManageNetwork)
can_manage_rightsbooleanDefines if the user can manage users rights (wire: canManageRights)
emailstringEmail address of the user
encryption_rightbooleanDefines if the user can manage encryption / KMS configuration (wire: encryptionRight)
full_admin_robooleanDefines if the user is a full admin in readonly (wire: fullAdminRo)
identity_provider_typestringLinked Identity Provider type (if any), can be Federation Active Directory or IAM (federation, iam) (wire: identityProviderType)
is_enable_manageablebooleanCheck if the given VMware on OVHcloud user can be enabled or disabled ? (wire: isEnableManageable)
is_token_validatorbooleanDefines if the user can confirm security tokens (if a compatible option is enabled) (wire: isTokenValidator)
loginstringLogin of the user
nsx_rightbooleanIs this User able to access nsx interface (requires NSX option) (wire: nsxRight)
phone_numberstringMobile phone number of the user (wire: phoneNumber)
receive_alertsbooleanDefines if the user receives technical alerts (wire: receiveAlerts)
statestringState of the user account (creating, deleting, delivered, error)
typestringUser type (if any) (group, user)

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectservice_name, user_idGet a user. Returns the user: login, contact details, activation state, permissions and identity provider.
listselectservice_namename, x_pagination_modeList users
createinsertservice_name, nameCreate a user. Creates a user. Its right applies to all datacenters and is disabled by default. Without a password, a random one is generated and sent by email.
deletedeleteservice_name, user_idDelete a user
change_passwordexecserviceName, userIdChange a user password. Sets a new password that follows the password policy. Without a password, a random one is generated and sent by email. Returns a task to track progress.
change_propertiesexecserviceName, userIdUpdate a user. Updates the name, email address, phone number and permissions of the user. Returns a task to track progress.
confirm_phone_numberexecserviceName, userId, tokenConfirm a user phone number. Confirms the phone number with the token sent by SMS. Returns a task to track progress.
disableexecserviceName, userIdDisable a user. Disables the user account. Check isEnableManageable on the user first. Returns a task to track progress.
enableexecserviceName, userIdEnable a user. Enables the user account. Check isEnableManageable on the user first. Returns a task to track progress.

Parameters​

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
api_hoststringThe OVHcloud API host. Selected by OVH_ENDPOINT (ovh-eu, ovh-ca or ovh-us; default ovh-eu). (default: api.eu.ovhcloud.com, x-stackQL-envVarSelector: {"envVar":"OVH_ENDPOINT","default":"ovh-eu","values":{"ovh-eu":"api.eu.ovhcloud.com","ovh-ca":"api.ca.ovhcloud.com","ovh-us":"api.us.ovhcloud.com"}})
serviceNamestringDomain of the service
service_namestringDomain of the service (wire: serviceName)
userIdinteger
user_idinteger (wire: userId)
namestringFilter the value of name property (like)
x_pagination_modestringSent as CachedObjectList-Pages by default so the list returns the full objects rather than their identifiers. (wire: X-Pagination-Mode)

SELECT examples​

Get a user. Returns the user: login, contact details, activation state, permissions and identity provider.

SELECT
name,
active_directory_id,
identity_provider_id,
user_id,
first_name,
last_name,
activation_state,
active_directory_type,
can_manage_ip_fail_overs,
can_manage_network,
can_manage_rights,
email,
encryption_right,
full_admin_ro,
identity_provider_type,
is_enable_manageable,
is_token_validator,
login,
nsx_right,
phone_number,
receive_alerts,
state,
type
FROM ovh.dedicated_cloud.users
WHERE service_name = '{{ service_name }}' -- required
AND user_id = '{{ user_id }}' -- required
;

INSERT examples​

Create a user. Creates a user. Its right applies to all datacenters and is disabled by default. Without a password, a random one is generated and sent by email.

INSERT INTO ovh.dedicated_cloud.users (
can_add_ressource,
can_manage_rights,
email,
encryption_right,
expiration_date,
first_name,
last_name,
name,
network_role,
nsx_right,
password,
phone_number,
receive_alerts,
right,
token_validator,
vm_network_role,
service_name
)
SELECT
{{ can_add_ressource }},
{{ can_manage_rights }},
'{{ email }}',
{{ encryption_right }},
'{{ expiration_date }}',
'{{ first_name }}',
'{{ last_name }}',
'{{ name }}' /* required */,
'{{ network_role }}',
{{ nsx_right }},
'{{ password }}',
'{{ phone_number }}',
{{ receive_alerts }},
'{{ right }}',
{{ token_validator }},
'{{ vm_network_role }}',
'{{ service_name }}'
RETURNING
name,
datacenter_id,
filer_id,
host_id,
network_access_id,
order_id,
parent_task_id,
task_id,
user_id,
vlan_id,
created_by,
created_from,
description,
end_date,
execution_date,
last_modification_date,
maintenance_date_from,
maintenance_date_to,
network,
progress,
state,
type
;

DELETE examples​

Delete a user

DELETE FROM ovh.dedicated_cloud.users
WHERE service_name = '{{ service_name }}' --required
AND user_id = '{{ user_id }}' --required
;

Lifecycle Methods​

EXEC variables use wire (API) names.

Change a user password. Sets a new password that follows the password policy. Without a password, a random one is generated and sent by email. Returns a task to track progress.

EXEC ovh.dedicated_cloud.users.change_password
@serviceName='{{ serviceName }}' --required,
@userId='{{ userId }}' --required
@@json=
'{
"password": "{{ password }}"
}'
;