resource_groups
Creates, updates, deletes, gets or lists a resource_groups resource.
Overview​
| Name | resource_groups |
| Type | Resource |
| Id | ovh.iam.resource_groups |
Fields​
The following fields are returned by SELECT queries:
- get
- list
successful operation
| Name | Datatype | Description |
|---|---|---|
id | string (uuid) | Unique identifier of the group |
name | string | Name of the group |
created_at | string (date-time) | Creation time (wire: createdAt) |
owner | string | Owner of the group |
read_only | boolean | Whether you can add or remove resources (wire: readOnly) |
resources | array | Resources included in the group |
updated_at | string (date-time) | Last update time (wire: updatedAt) |
urn | string | Unique resource name used in policies |
Group defines a set of resources
| Name | Datatype | Description |
|---|---|---|
id | string (uuid) | Unique identifier of the group |
name | string | Name of the group |
created_at | string (date-time) | Creation time (wire: createdAt) |
owner | string | Owner of the group |
read_only | boolean | Whether you can add or remove resources (wire: readOnly) |
resources | array | Resources included in the group |
updated_at | string (date-time) | Last update time (wire: updatedAt) |
urn | string | Unique resource name used in policies |
Methods​
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | group_id | details | Returns the name and the resources of the group. Set details to true to expand resource information. |
list | select | x_pagination_cursor, x_pagination_size, details | Returns the resource groups of the account. Set details to true to expand resource information. | |
create | insert | name | Creates a group of resources that policies can target as a single entity. | |
update | update | group_id, name, resources | Replaces the name and the list of resources of the group. | |
delete | delete | group_id | Deletes 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.
| 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"}}) |
group_id | string (uuid) | Group ID (wire: groupId) |
details | boolean | Add extra information about resources in output |
x_pagination_cursor | string | Pagination cursor (wire: X-Pagination-Cursor) |
x_pagination_size | integer | Pagination size (wire: X-Pagination-Size) |
SELECT examples​
- get
- list
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 }}'
;
Returns the resource groups of the account. 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 x_pagination_cursor = '{{ x_pagination_cursor }}'
AND x_pagination_size = '{{ x_pagination_size }}'
AND details = '{{ details }}'
;
INSERT examples​
- create
- Manifest
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
;
# Description fields are for documentation purposes
- name: resource_groups
props:
- name: name
value: "{{ name }}"
description: |
Name of the group
- name: resources
description: |
Resources to add in the created group
value:
- displayName: "{{ displayName }}"
id: "{{ id }}"
name: "{{ name }}"
owner: "{{ owner }}"
tags: "{{ tags }}"
type: "{{ type }}"
urn: "{{ urn }}"
UPDATE examples​
- update
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​
- delete
Deletes the resource group. The resources it contains are not deleted.
DELETE FROM ovh.iam.resource_groups
WHERE group_id = '{{ group_id }}' --required
;