Modifying a Workspace
Function
This API is used to modify a workspace.
URI
PUT /v1/{project_id}/workspaces/{workspace_id}
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| project_id | Yes | String | Project ID. For details about how to obtain the project ID, see Obtaining a Project ID. |
| workspace_id | Yes | String | Workspace ID |
Request Body
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| name | No | String | Workspace name, encoded using UTF-8. The value is a string of 4 to 64 characters consisting of Chinese characters, uppercase and lowercase letters, digits, hyphens (-), and underscores (_). In addition, default is the default workspace name reserved by the system. You cannot create a workspace named default. The name of the default workspace cannot be modified. |
| description | No | String | Workspace description. By default, this parameter is left blank. The value is a string of 0 to 256 characters. |
| auth_type | No | String | Authorization type. Default value: PUBLIC
|
| grants | No | grant array | List of authorized users. By default, this parameter is left blank. This parameter must be used together with auth_type and takes effect only when auth_type is set to INTERNAL. |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| user_id | No | String | IAM user ID. Configure either this parameter or user_name. If both of them are available, user_id is preferred. |
| user_name | No | String | IAM username. Configure either this parameter or user_id. |
Response Body
Table 4 describes the response parameters.
| Parameter | Type | Description |
|---|---|---|
| error_msg | String | Error message of a failed API call. This parameter is not included when the API call succeeds. |
| error_code | String | Error code of a failed API call. For details, see Error Code. This parameter is not included when the API call succeeds. |
| request_id | String | request_id information of a failed API call. This parameter is not included when the API call succeeds. |
| workspace_id | String | Workspace ID |
Samples
- Sample request
PUT https://{endpoint}/v1/{project_id}/workspaces/ccd05d1a553b4e188ea878e7dcb85e47 { "name": "new_name", "description": "update description", "auth_type":"INTERNAL", "grants": [ {"user_name" : "test-user1"} ] }
- Successful sample response
{ "workspace_id": "ccd05d1a553b4e188ea878e7dcb85e47" }
- Failed sample response
{ "error_msg": "Error message.", "error_code": "ModelArts.0104", "request_id": "32025f6d314647d1b4521810de139ada" }
Status Code
For details about the status code, see Table 1.
Last Article: Querying the Details About a Workspace
Next Article: Querying a Workspace Quota
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.