users
Creates, updates, deletes, gets or lists a users resource.
Overview​
| Name | users |
| Type | Resource |
| Id | ovh.dedicated_cloud.users |
Fields​
The following fields are returned by SELECT queries:
- get
- list
successful operation
| Name | Datatype | Description |
|---|---|---|
name | string | Name of the user |
active_directory_id | integer | Deprecated - Linked Federation Active Directory (if any) (wire: activeDirectoryId) |
identity_provider_id | integer | Linked Identity Provider (if any), can be Federation Active Directory or IAM (wire: identityProviderId) |
user_id | integer | (wire: userId) |
first_name | string | First name of the user (wire: firstName) |
last_name | string | Last name of the user (wire: lastName) |
activation_state | string | Activation state of the user account (disabled, disabling, enabled, enabling, toDisable, toEnable) (wire: activationState) |
active_directory_type | string | Deprecated - Federation Active Directory User type (if any) (group, user) (wire: activeDirectoryType) |
can_manage_ip_fail_overs | boolean | Defines if the user can manage ip failovers (wire: canManageIpFailOvers) |
can_manage_network | boolean | Defines if the user can manage the network (wire: canManageNetwork) |
can_manage_rights | boolean | Defines if the user can manage users rights (wire: canManageRights) |
email | string | Email address of the user |
encryption_right | boolean | Defines if the user can manage encryption / KMS configuration (wire: encryptionRight) |
full_admin_ro | boolean | Defines if the user is a full admin in readonly (wire: fullAdminRo) |
identity_provider_type | string | Linked Identity Provider type (if any), can be Federation Active Directory or IAM (federation, iam) (wire: identityProviderType) |
is_enable_manageable | boolean | Check if the given VMware on OVHcloud user can be enabled or disabled ? (wire: isEnableManageable) |
is_token_validator | boolean | Defines if the user can confirm security tokens (if a compatible option is enabled) (wire: isTokenValidator) |
login | string | Login of the user |
nsx_right | boolean | Is this User able to access nsx interface (requires NSX option) (wire: nsxRight) |
phone_number | string | Mobile phone number of the user (wire: phoneNumber) |
receive_alerts | boolean | Defines if the user receives technical alerts (wire: receiveAlerts) |
state | string | State of the user account (creating, deleting, delivered, error) |
type | string | User type (if any) (group, user) |
User
| Name | Datatype | Description |
|---|---|---|
name | string | Name of the user |
active_directory_id | integer | Deprecated - Linked Federation Active Directory (if any) (wire: activeDirectoryId) |
identity_provider_id | integer | Linked Identity Provider (if any), can be Federation Active Directory or IAM (wire: identityProviderId) |
user_id | integer | (wire: userId) |
first_name | string | First name of the user (wire: firstName) |
last_name | string | Last name of the user (wire: lastName) |
activation_state | string | Activation state of the user account (disabled, disabling, enabled, enabling, toDisable, toEnable) (wire: activationState) |
active_directory_type | string | Deprecated - Federation Active Directory User type (if any) (group, user) (wire: activeDirectoryType) |
can_manage_ip_fail_overs | boolean | Defines if the user can manage ip failovers (wire: canManageIpFailOvers) |
can_manage_network | boolean | Defines if the user can manage the network (wire: canManageNetwork) |
can_manage_rights | boolean | Defines if the user can manage users rights (wire: canManageRights) |
email | string | Email address of the user |
encryption_right | boolean | Defines if the user can manage encryption / KMS configuration (wire: encryptionRight) |
full_admin_ro | boolean | Defines if the user is a full admin in readonly (wire: fullAdminRo) |
identity_provider_type | string | Linked Identity Provider type (if any), can be Federation Active Directory or IAM (federation, iam) (wire: identityProviderType) |
is_enable_manageable | boolean | Check if the given VMware on OVHcloud user can be enabled or disabled ? (wire: isEnableManageable) |
is_token_validator | boolean | Defines if the user can confirm security tokens (if a compatible option is enabled) (wire: isTokenValidator) |
login | string | Login of the user |
nsx_right | boolean | Is this User able to access nsx interface (requires NSX option) (wire: nsxRight) |
phone_number | string | Mobile phone number of the user (wire: phoneNumber) |
receive_alerts | boolean | Defines if the user receives technical alerts (wire: receiveAlerts) |
state | string | State of the user account (creating, deleting, delivered, error) |
type | string | User type (if any) (group, user) |
Methods​
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | service_name, user_id | Get a user. Returns the user: login, contact details, activation state, permissions and identity provider. | |
list | select | service_name | name, x_pagination_mode | List users |
create | insert | service_name, name | 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. | |
delete | delete | service_name, user_id | Delete a user | |
change_password | exec | serviceName, userId | 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. | |
change_properties | exec | serviceName, userId | Update a user. Updates the name, email address, phone number and permissions of the user. Returns a task to track progress. | |
confirm_phone_number | exec | serviceName, userId, token | Confirm a user phone number. Confirms the phone number with the token sent by SMS. Returns a task to track progress. | |
disable | exec | serviceName, userId | Disable a user. Disables the user account. Check isEnableManageable on the user first. Returns a task to track progress. | |
enable | exec | serviceName, userId | Enable 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.
| Name | Datatype | Description |
|---|---|---|
api_host | string | The 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"}}) |
serviceName | string | Domain of the service |
service_name | string | Domain of the service (wire: serviceName) |
userId | integer | |
user_id | integer | (wire: userId) |
name | string | Filter the value of name property (like) |
x_pagination_mode | string | Sent as CachedObjectList-Pages by default so the list returns the full objects rather than their identifiers. (wire: X-Pagination-Mode) |
SELECT examples​
- get
- list
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
;
List users
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 name = '{{ name }}'
AND x_pagination_mode = '{{ x_pagination_mode }}'
;
INSERT examples​
- create
- Manifest
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
;
# Description fields are for documentation purposes
- name: users
props:
- name: service_name
value: "{{ service_name }}"
description: Required parameter for the users resource.
- name: can_add_ressource
value: {{ can_add_ressource }}
description: |
Is this User able to add ressources in the Datacenter he has access ? (default is no right to add ressource)
- name: can_manage_rights
value: {{ can_manage_rights }}
description: |
Is this user able to manage the users rights
- name: email
value: "{{ email }}"
description: |
The user email. If this field is empty, user informations will be sent to the dedicatedCloud administrator contact.
- name: encryption_right
value: {{ encryption_right }}
description: |
Defines if the user can manage encryption / KMS configuration
- name: expiration_date
value: "{{ expiration_date }}"
description: |
Date of removal of the user.
- name: first_name
value: "{{ first_name }}"
description: |
First name of the user
- name: last_name
value: "{{ last_name }}"
description: |
Last name of the user
- name: name
value: "{{ name }}"
description: |
Name of the user (login)
- name: network_role
value: "{{ network_role }}"
description: |
Determine how this user can act on the Dedicated Cloud vLans or vxLans
valid_values: ['admin', 'manager', 'noAccess', 'readonly']
- name: nsx_right
value: {{ nsx_right }}
description: |
Is this User able to access nsx interface (requires NSX option)
- name: password
value: "{{ password }}"
description: |
The user password. It must fits your VMware on OVHcloud password policy. If this field is empty, a random password will be generated and sent by email.
- name: phone_number
value: "{{ phone_number }}"
description: |
Mobile phone number of the user
- name: receive_alerts
value: {{ receive_alerts }}
description: |
Defines if the user receives technical alerts
- name: right
value: "{{ right }}"
description: |
Determine what kind of access the User will have in all Datacenters of your VMware on OVHcloud (default is disabled)
valid_values: ['admin', 'disabled', 'readonly', 'readwrite']
- name: token_validator
value: {{ token_validator }}
description: |
Defines if the user can confirm security tokens (if a compatible option is enabled)
- name: vm_network_role
value: "{{ vm_network_role }}"
description: |
Determine how this user will be able to act on this VMware on OVHcloud VM Network
valid_values: ['admin', 'noAccess', 'readonly']
DELETE examples​
- delete
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_password
- change_properties
- confirm_phone_number
- disable
- enable
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 }}"
}'
;
Update a user. Updates the name, email address, phone number and permissions of the user. Returns a task to track progress.
EXEC ovh.dedicated_cloud.users.change_properties
@serviceName='{{ serviceName }}' --required,
@userId='{{ userId }}' --required
@@json=
'{
"canManageIpFailOvers": {{ canManageIpFailOvers }},
"canManageNetwork": {{ canManageNetwork }},
"canManageRights": {{ canManageRights }},
"email": "{{ email }}",
"encryptionRight": {{ encryptionRight }},
"firstName": "{{ firstName }}",
"fullAdminRo": {{ fullAdminRo }},
"lastName": "{{ lastName }}",
"nsxRight": {{ nsxRight }},
"phoneNumber": "{{ phoneNumber }}",
"receiveAlerts": {{ receiveAlerts }},
"tokenValidator": {{ tokenValidator }}
}'
;
Confirm a user phone number. Confirms the phone number with the token sent by SMS. Returns a task to track progress.
EXEC ovh.dedicated_cloud.users.confirm_phone_number
@serviceName='{{ serviceName }}' --required,
@userId='{{ userId }}' --required
@@json=
'{
"token": "{{ token }}"
}'
;
Disable a user. Disables the user account. Check isEnableManageable on the user first. Returns a task to track progress.
EXEC ovh.dedicated_cloud.users.disable
@serviceName='{{ serviceName }}' --required,
@userId='{{ userId }}' --required
;
Enable a user. Enables the user account. Check isEnableManageable on the user first. Returns a task to track progress.
EXEC ovh.dedicated_cloud.users.enable
@serviceName='{{ serviceName }}' --required,
@userId='{{ userId }}' --required
;