kafka_users
Creates, updates, deletes, gets or lists a kafka_users resource.
Overview​
| Name | kafka_users |
| Type | Resource |
| Id | ovh.cloud_database.kafka_users |
Fields​
The following fields are returned by SELECT queries:
- get
- list
successful operation
| Name | Datatype | Description |
|---|---|---|
id | string (uuid) | User ID |
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) |
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 |
User definition
| Name | Datatype | Description |
|---|---|---|
id | string (uuid) | User ID |
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) |
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 kafka users | |
list | select | cluster_id, service_name | x_pagination_mode | List users of the kafka |
create | insert | cluster_id, service_name | Create a new user on the kafka cluster | |
delete | delete | cluster_id, user_id, service_name | Delete a kafka 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 kafka users
SELECT
id,
created_at,
is_admin,
status,
username
FROM ovh.cloud_database.kafka_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 kafka
SELECT
id,
created_at,
is_admin,
status,
username
FROM ovh.cloud_database.kafka_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 kafka cluster
INSERT INTO ovh.cloud_database.kafka_users (
name,
cluster_id,
service_name
)
SELECT
'{{ name }}',
'{{ cluster_id }}',
'{{ service_name }}'
RETURNING
id,
created_at,
is_admin,
password,
status,
username
;
# Description fields are for documentation purposes
- name: kafka_users
props:
- name: cluster_id
value: "{{ cluster_id }}"
description: Required parameter for the kafka_users resource.
- name: service_name
value: "{{ service_name }}"
description: Required parameter for the kafka_users resource.
- name: name
value: "{{ name }}"
description: |
Name of the user
DELETE examples​
- delete
Delete a kafka user
DELETE FROM ovh.cloud_database.kafka_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.kafka_users.credentials_reset
@clusterId='{{ clusterId }}' --required,
@userId='{{ userId }}' --required,
@service_name='{{ service_name }}' --required unless OVH_CLOUD_PROJECT_SERVICE is set
;