Querying a Workspace Quota
Function
This API is used to obtain the resource quota of a specified workspace.
This API is used when you need to know the resource usage and quota limits of a workspace. Before using this API, ensure that the workspace exists and you have the permission to view the workspace quota. After the query, the API returns the quota information of the workspace, including the quotas and used amounts 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
GET /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 |
Response Parameters
Status code: 200
|
Parameter |
Type |
Description |
|---|---|---|
|
quotas |
Array of WorkspaceQuotasResponse 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 |
|
used_quota |
Integer |
Definition: Used quota. If the value of quota is -1 (indicating that the quota is not limited), the value of used_quota is null. Range: N/A |
Example Requests
GET https://{endpoint}/v1/{project_id}/workspaces/ccd05d1a553b4e188ea878e7dcb85e47/quotas
Example Responses
Status code: 200
Response parameter indicating that a workspace quota is queried
{
"quotas" : [ {
"max_quota" : 60000,
"update_time" : 1470000020000,
"resource" : "exemlProject.gpu_duration",
"used_quota" : 5,
"quota" : 10,
"min_quota" : -1,
"name_cn" : "ExeML Training Duration (Image Classification, Object Detection, and Sound Classification)",
"unit_cn" : "Minute",
"name_en" : "ExeMLtraining duration (image classification, object detection, and soundclassification)",
"unit_en" : "minute"
} ]
}
Status Codes
|
Status Code |
Description |
|---|---|
|
200 |
Response parameter indicating that a workspace quota is queried |
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