Viewing Tenant Resource Usage
Function
Queries the one-off and yearly/monthly resource usage of a tenant.
Calling Method
For details, see Calling APIs.
Authorization Information
Each account has all the permissions required to call all APIs, but IAM users must be assigned the required permissions. For details about the required permissions, see Permissions Policies and Supported Actions.
URI
GET /v1/{project_id}/tenants/resources-usage
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
project_id |
Yes |
String |
Project ID. For details about how to obtain the project ID, see Obtaining a Project ID. |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
resource |
No |
String |
Resource type. You can enter multiple resource types and separate them with commas (,). For details, see Resource Type. |
|
business |
No |
String |
Service type. You can enter multiple service types and separate them with commas (,). |
Request Parameters
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
X-Auth-Token |
No |
String |
User token. This parameter is mandatory when token authentication is used. You can obtain the token by calling the IAM API used to obtain a user token. Value of X-Subject-Token in the response header. |
|
Authorization |
No |
String |
Authentication information. This parameter is mandatory for AK/SK authentication. |
|
X-Sdk-Date |
No |
String |
Time when the request is sent. This parameter is mandatory for AK/SK authentication. The format is YYYYMMDD'T'HHMMSS'Z'. |
|
X-Project-Id |
No |
String |
Project ID. This parameter is mandatory for AK/SK authentication. |
Response Parameters
Status code: 200
|
Parameter |
Type |
Description |
|---|---|---|
|
X-Request-Id |
String |
Request ID. |
|
Parameter |
Type |
Description |
|---|---|---|
|
resources |
Array of ResourceUsageInfo objects |
Resource usage list |
|
Parameter |
Type |
Description |
|---|---|---|
|
resource_type |
String |
Resource type. For details, see Resource Type. |
|
business_type |
String |
Service type. |
|
sub_resource_type |
String |
Sub-resource type. Currently, this field is available only for Flexus packages. |
|
is_sub_resource |
Boolean |
Whether the resource is a sub-resource. If yes, the quantity and unit of the sub-resource are described. Default value: false |
|
charging_mode |
String |
Billing mode. |
|
resource_source |
String |
Resource source. |
|
amount |
Float |
Total quantity Value range: 0~1000000 |
|
usage |
Float |
Usage Value range: 0~1000000 |
|
unit |
String |
Unit. |
Status code: 400
|
Parameter |
Type |
Description |
|---|---|---|
|
error_code |
String |
Error code. |
|
error_msg |
String |
Error description. |
Example Requests
GET https://{endpoint}/v1/f488337c31c8e4622f1590735b134c65/tenants/resources-usage
Example Responses
Status code: 200
Views tenant information.
{
"resources" : [ {
"resource_type" : "video",
"charging_mode" : "ONE_TIME",
"amount" : 6000,
"usage" : 100.5,
"unit" : "MIN"
} ]
}
Status code: 400
Parameters error, including the error code and its description.
{
"error_code" : "MSS.00000003",
"error_msg" : "Invalid parameter"
}
Status Codes
|
Status Code |
Description |
|---|---|
|
200 |
Views tenant information. |
|
400 |
Parameters error, including the error code and its description. |
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
