Skip to main content

mongodb_roles

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

Overview​

Namemongodb_roles
TypeResource
Idovh.public_cloud_database.mongodb_roles

Fields​

The following fields are returned by SELECT queries:

successful operation

NameDatatypeDescription
idstring (uuid)Unique identifier of the role
namestringName of the role
checksumstringHash of the resource used for concurrency control
created_atstring (date-time)Date at which the resource was created (wire: createdAt)
updated_atstring (date-time)Date of the last update to the resource (wire: updatedAt)

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectrole_id, service_id, project_idReturns a role that can be assigned to users. (Beta version)
listselectservice_id, project_idx_pagination_cursor, x_pagination_sizeReturns the roles that can be assigned to users. (Beta version)

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"}})
project_idstringThe Public Cloud project ID. Resolved from OVH_CLOUD_PROJECT_SERVICE when set.
role_idstring (uuid)Role ID (wire: roleId)
service_idstring (uuid)Service ID (wire: serviceId)
x_pagination_cursorstringPagination cursor (wire: X-Pagination-Cursor)
x_pagination_sizeintegerPagination size (wire: X-Pagination-Size)

SELECT examples​

Returns a role that can be assigned to users. (Beta version)

SELECT
id,
name,
checksum,
created_at,
updated_at
FROM ovh.public_cloud_database.mongodb_roles
WHERE role_id = '{{ role_id }}' -- required
AND service_id = '{{ service_id }}' -- required
AND project_id = '{{ project_id }}' -- required unless OVH_CLOUD_PROJECT_SERVICE is set
;