All Products
Search
Document Center

BSS OpenAPI:QuerySavingsPlansDeductLog

Last Updated:Mar 01, 2024

Queries the deduction details of savings plans.

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
bssapi:QuerySavingsPlansDeductLogRead
  • All Resources
    *
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
InstanceTypestringNo

The type of the instance ID based on which the data is queried. Valid values:

  • spn: queries data based on the ID of the savings plan instance.
  • product: queries data based on the ID of the cloud service instance.
spn
PageSizeintegerNo

The number of entries to return on each page.

20
LocalestringNo

The language of the return data. Valid values:

  • ZH: Chinese
  • EN: English
ZH
PageNumintegerNo

The number of the page to return.

1
InstanceIdstringNo

The ID of the instance.

spn-XXXXXXX
StartTimestringNo

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

2022-01-01 00:00:00
EndTimestringNo

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

2022-01-05 00:00:00

Response parameters

ParameterTypeDescriptionExample
object
Codestring

The error code.

PARAM_ERROR
Messagestring

The message returned.

RequestIdstring

The ID of the request.

61293E7A-3406-4447-8620-EC88B0AA66AD
Successboolean

Indicates whether the operation was successful.

true
Dataobject

The return data.

PageNuminteger

The page number of the returned page.

1
PageSizeinteger

The number of entries returned per page.

20
TotalCountinteger

The total number of entries.

20
Itemsobject []

The deduction details.

EndTimestring

The end of the billing cycle for which the fee is deducted.

2020-12-01 01:00:00
StartTimestring

The beginning of the billing cycle for which the fee is deducted. The time is in the format of yyyy-MM-dd HH:mm:ss.

2020-12-01 00:00:00
SavingsTypestring

The type of the savings plan. Valid values:

  • universal: general-purpose
  • ecs: ECS compute
ecs
UserIdlong

The ID of the user.

1906589291020438
DiscountRatestring

The discount used for the current deduction.

0.069
BillModulestring

The billable item for which the fee is deducted.

InstanceIdstring

The ID of the savings plan instance.

spn-xxxxxxx
DeductInstanceIdstring

The ID of the instance for which the fee is deducted.

i-XXXXXXXXX
DeductCommoditystring

The service for which the fee is deducted.

DeductRatestring

The deduction rate.

1.0
DeductFeestring

The deducted amount.

0.52

Examples

Sample success responses

JSONformat

{
  "Code": "PARAM_ERROR",
  "Message": "",
  "RequestId": "61293E7A-3406-4447-8620-EC88B0AA66AD",
  "Success": true,
  "Data": {
    "PageNum": 1,
    "PageSize": 20,
    "TotalCount": 20,
    "Items": [
      {
        "EndTime": "2020-12-01 01:00:00",
        "StartTime": "2020-12-01 00:00:00",
        "SavingsType": "ecs",
        "UserId": 1906589291020438,
        "DiscountRate": "0.069",
        "BillModule": "",
        "InstanceId": "spn-xxxxxxx",
        "DeductInstanceId": "i-XXXXXXXXX",
        "DeductCommodity": "",
        "DeductRate": "1.0",
        "DeductFee": "0.52",
        "OwnerId": 1906589291020438
      }
    ]
  }
}

Error codes

HTTP status codeError codeError message
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.
400NotApplicableYou are not authorized to call the API operation. Please check whether the caller site matches the API domain regionId.
400NotAuthorizedThe user is not authorized for the specified API.
400NotAuthorizedYou are not authorized to call the API operation. Please check whether RAM user has the permission or check whether ownerId and callerId have been given the appropriate permission.
500InternalErrorAn error occurred in the internal server.

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

Change history

Change timeSummary of changesOperation
2023-12-07API Description Update. The Error code has changed. The response structure of the API has changedsee changesets
Change itemChange content
API DescriptionAPI Description Update.
Error CodesThe Error code has changed.
    delete Error Codes: 400
    delete Error Codes: 500
Output ParametersThe response structure of the API has changed.
2022-06-28The Error code has changed. The response structure of the API has changedsee changesets
Change itemChange content
Error CodesThe Error code has changed.
    delete Error Codes: 400
    delete Error Codes: 500
Output ParametersThe response structure of the API has changed.