valkey_users
Creates, updates, deletes, gets or lists a valkey_users resource.
Overview​
| Name | valkey_users |
| Type | Resource |
| Id | ovh.cloud_database.valkey_users |
Fields​
The following fields are returned by SELECT queries:
- get
- list
successful operation
| Name | Datatype | Description |
|---|---|---|
id | string (uuid) | User ID |
categories | array | Categories of the user |
channels | array | Channels of the user |
commands | array | Commands of the user |
created_at | string (date-time) | Date of the creation of the user (wire: createdAt) |
is_admin | boolean | Whether the user is the administrator user created with the service (wire: isAdmin) |
keys | array | Keys of the user |
status | string | Current status of the user (CREATING, DELETING, DRAINED, ERROR, LOCKED, LOCKED_PENDING, LOCKED_UPDATING, PENDING, READY, SHELVED, TO_DRAIN, UPDATING) |
username | string | Name of the user |
Valkey user definition
| Name | Datatype | Description |
|---|---|---|
id | string (uuid) | User ID |
categories | array | Categories of the user |
channels | array | Channels of the user |
commands | array | Commands of the user |
created_at | string (date-time) | Date of the creation of the user (wire: createdAt) |
is_admin | boolean | Whether the user is the administrator user created with the service (wire: isAdmin) |
keys | array | Keys of the user |
status | string | Current status of the user (CREATING, DELETING, DRAINED, ERROR, LOCKED, LOCKED_PENDING, LOCKED_UPDATING, PENDING, READY, SHELVED, TO_DRAIN, UPDATING) |
username | string | Name of the user |
Methods​
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | cluster_id, user_id, service_name | Get valkey users | |
list | select | cluster_id, service_name | x_pagination_mode | List users of the valkey |
create | insert | cluster_id, service_name, name | Create a new user on the valkey cluster | |
update | update | cluster_id, user_id, service_name | Update a user on the valkey cluster | |
delete | delete | cluster_id, user_id, service_name | Delete a valkey user | |
credentials_reset | exec | clusterId, userId, service_name | Reset the password of a user |
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"}}) |
clusterId | string (uuid) | Cluster ID |
cluster_id | string (uuid) | Cluster ID (wire: clusterId) |
service_name | string | The Public Cloud project ID. Resolved from OVH_CLOUD_PROJECT_SERVICE when set. |
userId | string (uuid) | User ID |
user_id | string (uuid) | User ID (wire: userId) |
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 valkey users
SELECT
id,
categories,
channels,
commands,
created_at,
is_admin,
keys,
status,
username
FROM ovh.cloud_database.valkey_users
WHERE cluster_id = '{{ cluster_id }}' -- required
AND user_id = '{{ user_id }}' -- required
AND service_name = '{{ service_name }}' -- required unless OVH_CLOUD_PROJECT_SERVICE is set
;
List users of the valkey
SELECT
id,
categories,
channels,
commands,
created_at,
is_admin,
keys,
status,
username
FROM ovh.cloud_database.valkey_users
WHERE cluster_id = '{{ cluster_id }}' -- required
AND service_name = '{{ service_name }}' -- required unless OVH_CLOUD_PROJECT_SERVICE is set
AND x_pagination_mode = '{{ x_pagination_mode }}'
;
INSERT examples​
- create
- Manifest
Create a new user on the valkey cluster
INSERT INTO ovh.cloud_database.valkey_users (
categories,
channels,
commands,
keys,
name,
cluster_id,
service_name
)
SELECT
'{{ categories }}',
'{{ channels }}',
'{{ commands }}',
'{{ keys }}',
'{{ name }}' /* required */,
'{{ cluster_id }}',
'{{ service_name }}'
RETURNING
id,
categories,
channels,
commands,
created_at,
is_admin,
keys,
password,
status,
username
;
# Description fields are for documentation purposes
- name: valkey_users
props:
- name: cluster_id
value: "{{ cluster_id }}"
description: Required parameter for the valkey_users resource.
- name: service_name
value: "{{ service_name }}"
description: Required parameter for the valkey_users resource.
- name: categories
value:
- "{{ categories }}"
description: |
Categories of the user
- name: channels
value:
- "{{ channels }}"
description: |
Channels of the user
- name: commands
value:
- "{{ commands }}"
description: |
Commands of the user
- name: keys
value:
- "{{ keys }}"
description: |
Keys of the user
- name: name
value: "{{ name }}"
description: |
Name of the user
UPDATE examples​
- update
Update a user on the valkey cluster
UPDATE ovh.cloud_database.valkey_users
SET
categories = '{{ categories }}',
channels = '{{ channels }}',
commands = '{{ commands }}',
keys = '{{ keys }}'
WHERE
cluster_id = '{{ cluster_id }}' --required
AND user_id = '{{ user_id }}' --required
AND service_name = '{{ service_name }}' --required unless OVH_CLOUD_PROJECT_SERVICE is set
RETURNING
id,
categories,
channels,
commands,
created_at,
is_admin,
keys,
status,
username;
DELETE examples​
- delete
Delete a valkey user
DELETE FROM ovh.cloud_database.valkey_users
WHERE cluster_id = '{{ cluster_id }}' --required
AND user_id = '{{ user_id }}' --required
AND service_name = '{{ service_name }}' --required unless OVH_CLOUD_PROJECT_SERVICE is set
;
Lifecycle Methods​
EXEC variables use wire (API) names.
- credentials_reset
Reset the password of a user
EXEC ovh.cloud_database.valkey_users.credentials_reset
@clusterId='{{ clusterId }}' --required,
@userId='{{ userId }}' --required,
@service_name='{{ service_name }}' --required unless OVH_CLOUD_PROJECT_SERVICE is set
;