groups
Creates, updates, deletes, gets or lists a groups resource.
Overview​
| Name | groups |
| Type | Resource |
| Id | oci.identity.groups |
Fields​
The following fields are returned by SELECT queries:
- get
- list
The group was retrieved.
| Name | Datatype | Description |
|---|---|---|
id | string | The OCID of the group. |
name | string | The name you assign to the group during creation. The name must be unique across all groups in the tenancy and cannot be changed. |
compartmentId | string | The OCID of the tenancy containing the group. |
definedTags | object | Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags](/Content/General/Concepts/resourcetags.htm). Example: {"Operations": {"CostCenter": "42"}} |
description | string | The description you assign to the group. Does not have to be unique, and it's changeable. (For tenancies that support identity domains) You can have an empty description. |
freeformTags | object | Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see [Resource Tags](/Content/General/Concepts/resourcetags.htm). Example: {"Department": "Finance"} |
inactiveStatus | integer (int64) | The detailed status of INACTIVE lifecycleState. |
lifecycleState | string | The group's current state. After creating a group, make sure its lifecycleState changes from CREATING to ACTIVE before using it. (CREATING, ACTIVE, INACTIVE, DELETING, DELETED) |
timeCreated | string (date-time) | Date and time the group was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z |
A collection of users who all need the same type of access to a particular set of resources or compartment.<br />For conceptual information about groups and other IAM Service components, see<br />[Overview of IAM](/Content/Identity/getstarted/identity-domains.htm).<br /><br />If you're federating with an identity provider (IdP), you need to create mappings between the groups<br />defined in the IdP and groups you define in the IAM service. For more information, see<br />[Identity Providers and Federation](/Content/Identity/Concepts/federation.htm). Also see<br />[IdentityProvider](#/en/identity/20160918/IdentityProvider/) and<br />[IdpGroupMapping](#/en/identity/20160918/IdpGroupMapping/).<br /><br />To use any of the API operations, you must be authorized in an IAM policy. If you're not authorized,<br />talk to an administrator. If you're an administrator who needs to write policies to give users access,<br />see [Get Started with Policies](/Content/Identity/policiesgs/get-started-with-policies.htm).<br /><br />Warning: Oracle recommends that you avoid using any confidential information when you supply string values<br />using the API.<br />
| Name | Datatype | Description |
|---|---|---|
id | string | The OCID of the group. |
name | string | The name you assign to the group during creation. The name must be unique across all groups in the tenancy and cannot be changed. |
compartmentId | string | The OCID of the tenancy containing the group. |
definedTags | object | Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags](/Content/General/Concepts/resourcetags.htm). Example: {"Operations": {"CostCenter": "42"}} |
description | string | The description you assign to the group. Does not have to be unique, and it's changeable. (For tenancies that support identity domains) You can have an empty description. |
freeformTags | object | Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see [Resource Tags](/Content/General/Concepts/resourcetags.htm). Example: {"Department": "Finance"} |
inactiveStatus | integer (int64) | The detailed status of INACTIVE lifecycleState. |
lifecycleState | string | The group's current state. After creating a group, make sure its lifecycleState changes from CREATING to ACTIVE before using it. (CREATING, ACTIVE, INACTIVE, DELETING, DELETED) |
timeCreated | string (date-time) | Date and time the group was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z |
Methods​
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | groupId, region | Gets the specified group's information.<br /><br />This operation does not return a list of all the users in the group. To do that, use<br />[ListUserGroupMemberships](#/en/identity/20160918/UserGroupMembership/ListUserGroupMemberships) and<br />provide the group's OCID as a query parameter in the request.<br /> | |
list | select | compartmentId, region | page, limit, name, sortBy, sortOrder, lifecycleState | Lists the groups in your tenancy. You must specify your tenancy's OCID as the value for<br />the compartment ID (remember that the tenancy is simply the root compartment).<br />See [Where to Get the Tenancy's OCID and User's OCID](/Content/API/Concepts/apisigningkey.htm#five).<br /> |
create | insert | region, name, compartmentId, description | opc-retry-token | Creates a new group in your tenancy.<br /><br />You must specify your tenancy's OCID as the compartment ID in the request object (remember that the tenancy<br />is simply the root compartment). Notice that IAM resources (users, groups, compartments, and some policies)<br />reside within the tenancy itself, unlike cloud resources such as compute instances, which typically<br />reside within compartments inside the tenancy. For information about OCIDs, see<br />[Resource Identifiers](/Content/General/Concepts/identifiers.htm).<br /><br />You must also specify a name for the group, which must be unique across all groups in your tenancy and<br />cannot be changed. You can use this name or the OCID when writing policies that apply to the group. For more<br />information about policies, see [How Policies Work](/Content/Identity/policieshow/how-policies-work.htm).<br /><br />You must also specify a description for the group (although it can be an empty string). It does not<br />have to be unique, and you can change it anytime with [UpdateGroup](#/en/identity/20160918/Group/UpdateGroup).<br /><br />After you send your request, the new object's lifecycleState will temporarily be CREATING. Before using the<br />object, first make sure its lifecycleState has changed to ACTIVE.<br /><br />After creating the group, you need to put users in it and write policies for it.<br />See [AddUserToGroup](#/en/identity/20160918/UserGroupMembership/AddUserToGroup) and<br />[CreatePolicy](#/en/identity/20160918/Policy/CreatePolicy).<br /> |
update | update | groupId, region | if-match | Updates the specified group. |
delete | delete | groupId, region | if-match | Deletes the specified group. The group must be empty.<br /> |
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 |
|---|---|---|
compartmentId | string | The OCID of the compartment (remember that the tenancy is simply the root compartment). |
groupId | string | The OCID of the group. |
region | string | OCI region identifier (e.g. us-ashburn-1, ap-sydney-1); resolves from OCI_REGION when not supplied in the query. (default: us-ashburn-1, x-stackQL-envVar: OCI_REGION) |
if-match | string | For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value. |
lifecycleState | string | A filter to only return resources that match the given lifecycle state. The state value is case-insensitive. |
limit | integer | The maximum number of items to return in a paginated "List" call. |
name | string | A filter to only return resources that match the given name exactly. |
opc-retry-token | string | A token that uniquely identifies a request so it can be retried in case of a timeout or server error without risk of executing that same action again. Retry tokens expire after 24 hours, but can be invalidated before then due to conflicting operations (e.g., if a resource has been deleted and purged from the system, then a retry of the original creation request may be rejected). |
page | string | The value of the opc-next-page response header from the previous "List" call. |
sortBy | string | The field to sort by. You can provide one sort order (sortOrder). Default order for TIMECREATED is descending. Default order for NAME is ascending. The NAME sort order is case sensitive. Note: In general, some "List" operations (for example, ListInstances) let you optionally filter by Availability Domain if the scope of the resource type is within a single Availability Domain. If you call one of these "List" operations without specifying an Availability Domain, the resources are grouped by Availability Domain, then sorted. |
sortOrder | string | The sort order to use, either ascending (ASC) or descending (DESC). The NAME sort order is case sensitive. |
SELECT examples​
- get
- list
Gets the specified group's information.<br /><br />This operation does not return a list of all the users in the group. To do that, use<br />[ListUserGroupMemberships](#/en/identity/20160918/UserGroupMembership/ListUserGroupMemberships) and<br />provide the group's OCID as a query parameter in the request.<br />
SELECT
id,
name,
compartmentId,
definedTags,
description,
freeformTags,
inactiveStatus,
lifecycleState,
timeCreated
FROM oci.identity.groups
WHERE groupId = '{{ groupId }}' -- required
AND region = '{{ region }}' -- required
;
Lists the groups in your tenancy. You must specify your tenancy's OCID as the value for<br />the compartment ID (remember that the tenancy is simply the root compartment).<br />See [Where to Get the Tenancy's OCID and User's OCID](/Content/API/Concepts/apisigningkey.htm#five).<br />
SELECT
id,
name,
compartmentId,
definedTags,
description,
freeformTags,
inactiveStatus,
lifecycleState,
timeCreated
FROM oci.identity.groups
WHERE compartmentId = '{{ compartmentId }}' -- required
AND region = '{{ region }}' -- required
AND page = '{{ page }}'
AND limit = '{{ limit }}'
AND name = '{{ name }}'
AND sortBy = '{{ sortBy }}'
AND sortOrder = '{{ sortOrder }}'
AND lifecycleState = '{{ lifecycleState }}'
;
INSERT examples​
- create
- Manifest
Creates a new group in your tenancy.<br /><br />You must specify your tenancy's OCID as the compartment ID in the request object (remember that the tenancy<br />is simply the root compartment). Notice that IAM resources (users, groups, compartments, and some policies)<br />reside within the tenancy itself, unlike cloud resources such as compute instances, which typically<br />reside within compartments inside the tenancy. For information about OCIDs, see<br />[Resource Identifiers](/Content/General/Concepts/identifiers.htm).<br /><br />You must also specify a name for the group, which must be unique across all groups in your tenancy and<br />cannot be changed. You can use this name or the OCID when writing policies that apply to the group. For more<br />information about policies, see [How Policies Work](/Content/Identity/policieshow/how-policies-work.htm).<br /><br />You must also specify a description for the group (although it can be an empty string). It does not<br />have to be unique, and you can change it anytime with [UpdateGroup](#/en/identity/20160918/Group/UpdateGroup).<br /><br />After you send your request, the new object's lifecycleState will temporarily be CREATING. Before using the<br />object, first make sure its lifecycleState has changed to ACTIVE.<br /><br />After creating the group, you need to put users in it and write policies for it.<br />See [AddUserToGroup](#/en/identity/20160918/UserGroupMembership/AddUserToGroup) and<br />[CreatePolicy](#/en/identity/20160918/Policy/CreatePolicy).<br />
INSERT INTO oci.identity.groups (
compartmentId,
definedTags,
description,
freeformTags,
name,
region,
opc-retry-token
)
SELECT
'{{ compartmentId }}' /* required */,
'{{ definedTags }}',
'{{ description }}' /* required */,
'{{ freeformTags }}',
'{{ name }}' /* required */,
'{{ region }}',
'{{ opc-retry-token }}'
RETURNING
id,
name,
compartmentId,
definedTags,
description,
freeformTags,
inactiveStatus,
lifecycleState,
timeCreated
;
# Description fields are for documentation purposes
- name: groups
props:
- name: region
value: "{{ region }}"
description: Required parameter for the groups resource.
- name: compartmentId
value: "{{ compartmentId }}"
description: |
The OCID of the tenancy containing the group.
- name: definedTags
value: "{{ definedTags }}"
description: |
Defined tags for this resource. Each key is predefined and scoped to a namespace.
For more information, see [Resource Tags](/Content/General/Concepts/resourcetags.htm).
Example: `{"Operations": {"CostCenter": "42"}}`
- name: description
value: "{{ description }}"
description: |
The description you assign to the group during creation. Does not have to be unique, and it's changeable.
(For tenancies that support identity domains) You can have an empty description.
- name: freeformTags
value: "{{ freeformTags }}"
description: |
Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace.
For more information, see [Resource Tags](/Content/General/Concepts/resourcetags.htm).
Example: `{"Department": "Finance"}`
- name: name
value: "{{ name }}"
description: |
The name you assign to the group during creation. The name must be unique across all groups
in the tenancy and cannot be changed.
- name: opc-retry-token
value: "{{ opc-retry-token }}"
description: A token that uniquely identifies a request so it can be retried in case of a timeout or server error without risk of executing that same action again. Retry tokens expire after 24 hours, but can be invalidated before then due to conflicting operations (e.g., if a resource has been deleted and purged from the system, then a retry of the original creation request may be rejected).
description: A token that uniquely identifies a request so it can be retried in case of a timeout or server error without risk of executing that same action again. Retry tokens expire after 24 hours, but can be invalidated before then due to conflicting operations (e.g., if a resource has been deleted and purged from the system, then a retry of the original creation request may be rejected).
UPDATE examples​
- update
Updates the specified group.
UPDATE oci.identity.groups
SET
definedTags = '{{ definedTags }}',
description = '{{ description }}',
freeformTags = '{{ freeformTags }}'
WHERE
groupId = '{{ groupId }}' --required
AND region = '{{ region }}' --required
AND if-match = '{{ if-match}}'
RETURNING
id,
name,
compartmentId,
definedTags,
description,
freeformTags,
inactiveStatus,
lifecycleState,
timeCreated;
DELETE examples​
- delete
Deletes the specified group. The group must be empty.<br />
DELETE FROM oci.identity.groups
WHERE groupId = '{{ groupId }}' --required
AND region = '{{ region }}' --required
AND if-match = '{{ if-match }}'
;