users
Creates, updates, deletes, gets or lists a users resource.
Overview​
| Name | users |
| Type | Resource |
| Id | ovh.hosting_web.users |
Fields​
The following fields are returned by SELECT queries:
- get
- list
successful operation
| Name | Datatype | Description |
|---|---|---|
task_id | integer | The task ID working on this user (wire: taskId) |
home | string | Home directory |
is_primary_account | boolean | Is this user primary (wire: isPrimaryAccount) |
login | string | Login used to connect on FTP and SSH |
service_management_credentials | object | Credentials to manage your webhosting (wire: serviceManagementCredentials) |
ssh_state | string | User ssh status (active, none, sftponly) (wire: sshState) |
state | string | User state (off, rw) |
status | string | The user status (created, creating, deleting, updating) |
Hosting users
| Name | Datatype | Description |
|---|---|---|
task_id | integer | The task ID working on this user (wire: taskId) |
home | string | Home directory |
is_primary_account | boolean | Is this user primary (wire: isPrimaryAccount) |
login | string | Login used to connect on FTP and SSH |
service_management_credentials | object | Credentials to manage your webhosting (wire: serviceManagementCredentials) |
ssh_state | string | User ssh status (active, none, sftponly) (wire: sshState) |
state | string | User state (off, rw) |
status | string | The user status (created, creating, deleting, updating) |
Methods​
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | login, service_name | Get a user. Returns the home directory, SSH state, state and status of the user, and whether it is the primary account. | |
list | select | service_name | home, login, x_pagination_mode | List users. Returns the logins of the FTP and SSH users of the hosting. Filter them by home or login. |
create | insert | service_name, home, login, password | Create a user. Creates an FTP and SSH user with a login, a password and a home directory, and returns the task. sshState is none by default. | |
update | update | login, service_name | Update a user. Updates the home directory, SSH state or state of the user. Set state to off to disable the FTP and SSH access of the user. | |
delete | delete | login, service_name | Delete a user. Permanently deletes the user and returns the task. The files in its home folder are kept. |
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"}}) |
login | string | Login used to connect on FTP and SSH |
service_name | string | The internal name of your hosting (wire: serviceName) |
home | string | Filter the value of home property (like) |
login | string | Filter the value of login 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 home directory, SSH state, state and status of the user, and whether it is the primary account.
SELECT
task_id,
home,
is_primary_account,
login,
service_management_credentials,
ssh_state,
state,
status
FROM ovh.hosting_web.users
WHERE login = '{{ login }}' -- required
AND service_name = '{{ service_name }}' -- required
;
List users. Returns the logins of the FTP and SSH users of the hosting. Filter them by home or login.
SELECT
task_id,
home,
is_primary_account,
login,
service_management_credentials,
ssh_state,
state,
status
FROM ovh.hosting_web.users
WHERE service_name = '{{ service_name }}' -- required
AND home = '{{ home }}'
AND login = '{{ login }}'
AND x_pagination_mode = '{{ x_pagination_mode }}'
;
INSERT examples​
- create
- Manifest
Create a user. Creates an FTP and SSH user with a login, a password and a home directory, and returns the task. sshState is none by default.
INSERT INTO ovh.hosting_web.users (
home,
login,
password,
ssh_state,
service_name
)
SELECT
'{{ home }}' /* required */,
'{{ login }}' /* required */,
'{{ password }}' /* required */,
'{{ ssh_state }}',
'{{ service_name }}'
RETURNING
id,
object_id,
done_date,
function,
last_update,
object_type,
start_date,
status
;
# Description fields are for documentation purposes
- name: users
props:
- name: service_name
value: "{{ service_name }}"
description: Required parameter for the users resource.
- name: home
value: "{{ home }}"
description: |
Home directory
- name: login
value: "{{ login }}"
description: |
Login use for your new user
- name: password
value: "{{ password }}"
description: |
Password
- name: ssh_state
value: "{{ ssh_state }}"
description: |
Ssh state for this user. Default: none
valid_values: ['active', 'none', 'sftponly']
UPDATE examples​
- update
Update a user. Updates the home directory, SSH state or state of the user. Set state to off to disable the FTP and SSH access of the user.
UPDATE ovh.hosting_web.users
SET
home = '{{ home }}',
ssh_state = '{{ ssh_state }}',
state = '{{ state }}'
WHERE
login = '{{ login }}' --required
AND service_name = '{{ service_name }}' --required;
DELETE examples​
- delete
Delete a user. Permanently deletes the user and returns the task. The files in its home folder are kept.
DELETE FROM ovh.hosting_web.users
WHERE login = '{{ login }}' --required
AND service_name = '{{ service_name }}' --required
;