Use the following cURL command to create an OCI group:
curl -X POST <DOMAIN_URL>/admin/v1/Groups \
-H "Authorization: Bearer <ACCESS_TOKEN>" \
-H "Content-Type: application/scim+json" \
-d '{
"schemas": ["urn:ietf:params:scim:schemas:core:2.0:Group"],
"displayName": "<DISPLAY_NAME>"
}'Replace the following fields in the above CURL:
Parameter | Value |
|---|---|
<DOMAIN_URL> | The domain URL of your Oracle Cloud. |
<ACCESS_TOKEN> | The access token you got from this step: Getting an OCI access token (REST) |
<DISPLAY_NAME> | Give any display name |
Use the following cURL command to add the service user to the group:
curl -X PATCH <DOMAIN_URL>/admin/v1/Groups/<GROUP_ID> \
-H "Authorization: Bearer <ACCESS_TOKEN>" \
-H "Content-Type: application/scim+json" \
-d '{
"schemas": ["urn:ietf:params:scim:api:messages:2.0:PatchOp"],
"Operations": [{"op":"add","path":"members",
"value":[{"value":"<USER_ID>","type":"User"}]}]
}'Replace the following fields in the above cURL command:
Parameter | Value |
|---|---|
<DOMAIN_URL> | The domain URL of your Oracle Cloud. |
<ACCESS_TOKEN> | The access token you got from this step: Getting an OCI access token (REST) |
<GROUP_ID> | The ID of the group that we had created in step #1. |
<USER_ID> | The ID of the service user that we had created in this article: Creating an OCI Service User (REST). |