Modifying a Workspace Quota
Function
This API is used to update the resource quota of a specified workspace.
This API is used when you need to adjust the resource quota of a workspace, for example, increase or decrease the quota of compute, storage, or network resources. Before using this API, ensure that the workspace exists and you have the permission to modify the workspace quota. After the modification is complete, the API returns the updated quota information, including the new quotas of compute, storage, and network resources. If the workspace does not exist or you do not have the operation permission, the API will return an error message.
Debugging
You can debug this API through automatic authentication in API Explorer or use the SDK sample code generated by API Explorer.
URI
PUT /v1/{project_id}/workspaces/{workspace_id}/quotas
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
project_id |
Yes |
String |
Definition: User project ID. For details, see Obtaining a Project ID and Name. Constraints: N/A Range: N/A Default Value: N/A |
|
workspace_id |
Yes |
String |
Definition: Workspace ID. If no workspaces are available, the default value is 0. If a workspace is created and used, use the actual value. Constraints: N/A Range: N/A Default Value: N/A |
Request Parameters
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
X-Auth-Token |
Yes |
String |
Definition: User token. It can be obtained by calling the IAM API. The token is the value of X-Subject-Token in the response header. Constraints: N/A Range: N/A Default Value: N/A |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
quotas |
Yes |
Array of quotas objects |
Definition: Workspace quota data. Constraints: N/A |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
resource |
Yes |
String |
Definition: Resource identifier. Constraints: N/A Range: N/A Default Value: N/A |
|
quota |
Yes |
Integer |
Definition: Quota value to be changed. The quota value is a positive integer or -1. Value -1 indicates that the quota is not limited. The quota cannot exceed the maximum and minimum value. You can call the API to query the maximum quota. Constraints: N/A Range: N/A Default Value: N/A |
Response Parameters
Status code: 200
|
Parameter |
Type |
Description |
|---|---|---|
|
quotas |
Array of WorkspaceQuotasUpdateResponse objects |
Definition: Workspace quota data. |
|
Parameter |
Type |
Description |
|---|---|---|
|
max_quota |
Integer |
Definition: Maximum quota value. Range: N/A |
|
update_time |
Integer |
Definition: Last modification time (UTC). If the resource quota has not been modified, the default value is the time when a workspace was created. Range: N/A |
|
resource |
String |
Definition: Unique ID of a resource. Range: N/A |
|
quota |
Integer |
Definition: Current quota value. Value -1 indicates that the quota is not limited. Range: N/A |
|
min_quota |
Integer |
Definition: Minimum quota value. Range: N/A |
|
name_cn |
String |
Definition: Quota name (Chinese). Range: N/A |
|
unit_cn |
String |
Definition: Quantity unit (Chinese). Range: N/A |
|
name_en |
String |
Definition: Quota name (English). Range: N/A |
|
unit_en |
String |
Definition: Quantity unit (English). Range: N/A |
Example Requests
PUT https://{endpoint}/v1/{project_id}/workspaces/ccd05d1a553b4e188ea878e7dcb85e47/quotas
{
"quotas" : [ {
"resource" : "exemlProject.gpu_duration",
"quota" : 10
} ]
}
Example Responses
Status code: 200
Response parameter indicating that a workspace quota is modified
{
"quotas" : [ {
"max_quota" : 60000,
"update_time" : 1574339372000,
"resource" : "exemlProject.gpu_duration",
"quota" : 20,
"min_quota" : -1,
"name_cn" : "ExeML Training Duration (Image Classification, Object Detection, and Sound Classification)",
"unit_cn" : "Minute",
"name_en" : "ExeML training duration (image classification, object detection, and sound classification)",
"unit_en" : "minute"
} ]
}
Status Codes
|
Status Code |
Description |
|---|---|
|
200 |
Response parameter indicating that a workspace quota is modified |
Error Codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot