為使用者建立新群組
POST /accounts/{account_id}/core/v1/users/{user_id}/groups
指示要建立的 Group API 資源所需的值。
參數
| Name | 類型 | 在 | 必要 | 說明 |
|---|---|---|---|---|
account_id |
字串 |
路徑 |
True |
包含帳戶資源的 ID
|
user_id |
字串 |
路徑 |
True |
包含使用者資源的 ID |
請求本文
指示要建立的 Group API 資源所需的值。
| Name | 類型 | 必要 | 說明 |
|---|---|---|---|
類型 |
字串 |
True |
資源的媒體類型。定義的值為:
|
版本 |
字串 |
True |
資源版本。定義的值為:
|
姓名 |
字串 |
錯誤 |
群組資源的名稱。如果在建立時未指定,則該值將設定為
|
authProvider |
字串 |
True |
群組資源的驗證提供者。定義的值為:
|
authID |
字串 |
True |
LDAP 群組的辨別名稱(DN)。定義的值為:
|
中繼資料 |
錯誤 |
與資源相關聯的用戶端和服務指定中繼資料。定義的值為:
|
範例請求
{
"type": "application/astra-group",
"version": "1.0",
"name": "engineering-group",
"authProvider": "ldap",
"authID": "CN=Engineering,CN=Groups,DC=example,DC=com"
}
回應
Status: 201, Returns the newly created group resource in the JSON response body.
| Name | 類型 | 必要 | 說明 |
|---|---|---|---|
類型 |
字串 |
True |
資源的媒體類型。定義的值為:
|
版本 |
字串 |
True |
資源版本。定義的值為:
|
ID |
字串 |
True |
資源的全域唯一識別碼。定義的值為:
|
姓名 |
字串 |
True |
群組資源的名稱。如果在建立時未指定,則該值將設定為
|
authProvider |
字串 |
True |
群組資源的驗證提供者。定義的值為:
|
authID |
字串 |
True |
LDAP 群組的辨別名稱(DN)。定義的值為:
|
中繼資料 |
True |
與資源相關聯的用戶端和服務指定中繼資料。定義的值為:
|
範例回應
{
"type": "application/astra-group",
"version": "1.0",
"id": "d8560bb2-7c87-5331-a78d-4e870b22e9a9",
"name": "engineering-group",
"authProvider": "ldap",
"authID": "CN=Engineering,CN=Groups,DC=example,DC=com",
"metadata": {
"labels": [],
"creationTimestamp": "2022-10-06T20:58:16.305662Z",
"modificationTimestamp": "2022-10-06T20:58:16.305662Z",
"createdBy": "8f84cf09-8036-51e4-b579-bd30cb07b269"
}
}
回應
Status: 409, Conflict
| Name | 類型 | 必要 | 說明 |
|---|---|---|---|
類型 |
字串 |
True |
|
標題 |
字串 |
True |
|
詳細資料 |
字串 |
True |
|
狀態 |
字串 |
True |
|
correlationID |
字串 |
錯誤 |
|
invalidFields |
陣列["invalidFields"] |
錯誤 |
無效請求本文欄位清單 |
範例回應
{
"type": "https://astra.netapp.io/problems/10",
"title": "JSON resource conflict",
"detail": "The request body JSON contains a field that conflicts with an idempotent value.",
"status": "409"
}
回應
Status: 403, Forbidden
| Name | 類型 | 必要 | 說明 |
|---|---|---|---|
類型 |
字串 |
True |
|
標題 |
字串 |
True |
|
詳細資料 |
字串 |
True |
|
狀態 |
字串 |
True |
|
correlationID |
字串 |
錯誤 |
範例回應
{
"type": "https://astra.netapp.io/problems/14",
"title": "Unauthorized access",
"detail": "The user isn't enabled.",
"status": "403"
}
回應
Status: 406, Not acceptable
| Name | 類型 | 必要 | 說明 |
|---|---|---|---|
類型 |
字串 |
True |
|
標題 |
字串 |
True |
|
詳細資料 |
字串 |
True |
|
狀態 |
字串 |
True |
|
correlationID |
字串 |
錯誤 |
範例回應
{
"type": "https://astra.netapp.io/problems/32",
"title": "Unsupported content type",
"detail": "The response can't be returned in the requested format.",
"status": "406"
}
回應
Status: 500, Internal server error
| Name | 類型 | 必要 | 說明 |
|---|---|---|---|
類型 |
字串 |
True |
|
標題 |
字串 |
True |
|
詳細資料 |
字串 |
True |
|
狀態 |
字串 |
True |
|
correlationID |
字串 |
錯誤 |
範例回應
{
"type": "https://astra.netapp.io/problems/34",
"title": "Internal server error",
"detail": "The server was unable to process this request.",
"status": "500"
}
錯誤
Status: 400, Bad request
| Name | 類型 | 必要 | 說明 |
|---|---|---|---|
類型 |
字串 |
True |
|
標題 |
字串 |
True |
|
詳細資料 |
字串 |
True |
|
狀態 |
字串 |
True |
|
correlationID |
字串 |
錯誤 |
|
invalidParams |
陣列["invalidParams"] |
錯誤 |
無效查詢參數清單 |
範例錯誤回應
{
"type": "https://astra.netapp.io/problems/7",
"title": "Invalid JSON payload",
"detail": "The request body is not valid JSON.",
"status": "400"
}
定義
請參閱定義
type_astra_label
| Name | 類型 | 必要 | 說明 |
|---|---|---|---|
姓名 |
字串 |
True |
|
值 |
字串 |
True |
type_astra_metadata_update
與資源相關聯的用戶端和服務指定中繼資料。定義的值為:
-
符合 Astra Metadata Schema。如果在建立時未指定、則會建立沒有標籤的中繼資料物件。如果在更新時未指定,元資料物件的標籤、creationTimestamp 和 createdBy 將保持不變。
| Name | 類型 | 必要 | 說明 |
|---|---|---|---|
標籤 |
錯誤 |
||
建立時間戳記 |
字串 |
錯誤 |
|
修改時間戳記 |
字串 |
錯誤 |
|
建立者 |
字串 |
錯誤 |
|
modifiedBy |
字串 |
錯誤 |
invalidParams
| Name | 類型 | 必要 | 說明 |
|---|---|---|---|
姓名 |
字串 |
True |
無效查詢參數的名稱 |
原因 |
字串 |
True |
查詢參數無效的原因 |
invalidFields
| Name | 類型 | 必要 | 說明 |
|---|---|---|---|
姓名 |
字串 |
True |
無效請求內文欄位的名稱 |
原因 |
字串 |
True |
請求本文欄位無效的原因 |