Skip to main content

resource_groups

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

Overview​

Nameresource_groups
TypeResource
Idovh.iam.resource_groups

Fields​

The following fields are returned by SELECT queries:

successful operation

NameDatatypeDescription
idstring (uuid)Unique identifier of the group
namestringName of the group
created_atstring (date-time)Creation time (wire: createdAt)
ownerstringOwner of the group
read_onlybooleanWhether you can add or remove resources (wire: readOnly)
resourcesarrayResources included in the group
updated_atstring (date-time)Last update time (wire: updatedAt)
urnstringUnique resource name used in policies

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectgroup_iddetailsReturns the name and the resources of the group. Set details to true to expand resource information.
listselectx_pagination_cursor, x_pagination_size, detailsReturns the resource groups of the account. Set details to true to expand resource information.
createinsertnameCreates a group of resources that policies can target as a single entity.
updateupdategroup_id, name, resourcesReplaces the name and the list of resources of the group.
deletedeletegroup_idDeletes the resource group. The resources it contains are not deleted.

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"}})
group_idstring (uuid)Group ID (wire: groupId)
detailsbooleanAdd extra information about resources in output
x_pagination_cursorstringPagination cursor (wire: X-Pagination-Cursor)
x_pagination_sizeintegerPagination size (wire: X-Pagination-Size)

SELECT examples​

Returns the name and the resources of the group. Set details to true to expand resource information.

SELECT
id,
name,
created_at,
owner,
read_only,
resources,
updated_at,
urn
FROM ovh.iam.resource_groups
WHERE group_id = '{{ group_id }}' -- required
AND details = '{{ details }}'
;

INSERT examples​

Creates a group of resources that policies can target as a single entity.

INSERT INTO ovh.iam.resource_groups (
name,
resources
)
SELECT
'{{ name }}' /* required */,
'{{ resources }}'
RETURNING
id,
name,
created_at,
owner,
read_only,
resources,
updated_at,
urn
;

UPDATE examples​

Replaces the name and the list of resources of the group.

UPDATE ovh.iam.resource_groups
SET
name = '{{ name }}',
resources = '{{ resources }}'
WHERE
group_id = '{{ group_id }}' --required
AND name = '{{ name }}' --required
AND resources = '{{ resources }}' --required
RETURNING
id,
name,
created_at,
owner,
read_only,
resources,
updated_at,
urn;

DELETE examples​

Deletes the resource group. The resources it contains are not deleted.

DELETE FROM ovh.iam.resource_groups
WHERE group_id = '{{ group_id }}' --required
;