All Products
Search
Document Center

BSS OpenAPI:QueryDPUtilizationDetail

Last Updated:Mar 01, 2024

Queries the usage of resource plans, including reserved instances (RIs) and storage capacity units (SCUs).

Operation description

Limits:

  • Only the usage records within the past year can be queried.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
bss:FrDeductLogQueryRequestRead
  • All Resources
    *
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
InstanceIdstringNo

The ID of the instance to query. If this parameter is not specified, the details of all used instances are returned.

oss-123123
InstanceSpecstringNo

The instance type of the instance.

Instancetyp
CommodityCodestringNo

The code of the resource, such as ecsRi and scu_bag. If this parameter is specified, the ProdCode parameter does not take effect for the request.

ecsRi
DeductedInstanceIdstringNo

The ID of the deducted instance. If this parameter is not specified, the details of all instances are returned.

oss-123123
StartTimestringYes

The beginning of the time range to query. Specify the time in the YYYY-MM-DD HH:mm:ss format.

2019-05-23 12:00:00
EndTimestringYes

The end of the time range to query. Specify the time in the YYYY-MM-DD HH:mm:ss format.

2019-05-23 12:00:00
LastTokenstringNo

The token that is used to retrieve the next page of results. For the first query, set the value to null. For subsequent queries, set the value to the token that is obtained from the NextToken parameter.

CAESF***zNTAw
LimitintegerNo

The number of entries to return on each page. Default value: 20. Maximum value: 300.

20
IncludeSharebooleanYes

Specifies whether to query the resource plan usage of linked accounts. Valid values:

  • true: queries the resource plan usage of linked accounts.
  • false: does not query the resource plan usage of linked accounts.
true
ProdCodestringNo

The code of the service. Example: ecs.

oss

Response parameters

ParameterTypeDescriptionExample
object
Codestring

The HTTP status code.

Success
Messagestring

The error message.

Successful!
RequestIdstring

The ID of the request.

DF58589C-A06C-4224-8615-7797E6474FA3
Successboolean

Indicates whether the request is successful.

true
Dataobject

The returned data.

NextTokenstring

The token that is used to retrieve the next page of results. You can set the LastToken parameter to this value in the next request. If null is returned, all results are queried.

CAESF***zNTAw
DetailListobject []

The detailed resource plan usage.

DeductedInstanceIdstring

The ID of the deducted instance.

oss-123123
InstanceIdstring

The ID of the RI.

oss-123123
DeductHoursfloat

The deduct factor. This parameter is returned only if the CommodityCode parameter is set to ecsRi.

24
ShareUidlong

The UID of the deducted instance.

  • If the deduction is shared, the value of this parameter indicates the UID of the deducted instance.
  • If the deduction is not shared, the value of this parameter is the same as that of the uid parameter.
1111111111
DeductDatestring

The deduction date.

2019/5/23 12:00
InstanceSpecstring

The instance type of the deducted instance.

rds.mysql.s3.large
DeductedCommodityCodestring

The code of the deducted service.

rds
DeductedProductDetailstring

The name of the deducted service.

ApsaraDB RDS
DeductMeasurefloat

The original measured amount.

1
Regionstring

The region in which the instance resides. This parameter can be left empty.

cn-hangzhou
DeductQuantityfloat

The computing capacity or storage capacity that is deducted in a pay-as-you-go instance.

1
DeductFactorTotalfloat

The total computing capacity or storage capacity of the RI or SCU during the deduction.

1
ResCodestring

The billable item.

PutRequest
Uidlong

The UID of the deducted instance.

1111111111

Examples

Sample success responses

JSONformat

{
  "Code": "Success",
  "Message": "Successful!",
  "RequestId": "DF58589C-A06C-4224-8615-7797E6474FA3",
  "Success": true,
  "Data": {
    "NextToken": "CAESF***zNTAw",
    "DetailList": {
      "DetailList": [
        {
          "DeductedInstanceId": "oss-123123",
          "InstanceId": "oss-123123",
          "DeductHours": 24,
          "ShareUid": 1111111111,
          "DeductDate": "2019/5/23 12:00",
          "InstanceSpec": "rds.mysql.s3.large",
          "DeductedCommodityCode": "rds",
          "DeductedProductDetail": "ApsaraDB RDS\n",
          "DeductMeasure": 1,
          "Region": "cn-hangzhou ",
          "DeductQuantity": 1,
          "DeductFactorTotal": 1,
          "ResCode": "PutRequest",
          "Uid": 1111111111
        }
      ]
    }
  }
}

Error codes

HTTP status codeError codeError message
400InternalErrorAn error occurred in the internal server.
400InvalidOwnerThe specified owner does not belong to caller.
400InvalidParameterThe specified request contains invalid parameters.
400MissingParameterThe specified request lacks essential parameters.
400NotApplicableThe specified API is not applicable for the user.
400NotAuthorizedThe user is not authorized for the specified API.
400InvalidInstanceSpecThe specified Instance specification is not valid.
400InvalidQueryTimeThe specified start time and end time are incorrect
400CommodityNotSupportedThe specified commodity is not supported.

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
No change history