tencent cloud

Feedback

DescribeDosageCosDetailByDate

Last updated: 2024-05-16 15:10:24

    1. API Description

    Domain name for API request: billing.tencentcloudapi.com.

    This API is used to query COS usage details.

    A maximum of 5 requests can be initiated per second for this API.

    We recommend you to use API Explorer
    Try it
    API Explorer provides a range of capabilities, including online call, signature authentication, SDK code generation, and API quick search. It enables you to view the request, response, and auto-generated examples.

    2. Input Parameters

    The following request parameter list only provides API request parameters and some common parameters. For the complete common parameter list, see Common Request Parameters.

    Parameter Name Required Type Description
    Action Yes String Common Params. The value used for this API: DescribeDosageCosDetailByDate.
    Version Yes String Common Params. The value used for this API: 2018-07-09.
    Region No String Common Params. This parameter is not required.
    StartDate Yes String The start date of the usage query, such as 2020-09-01.
    EndDate Yes String The end date of the usage query (end date must be in the same month as the start date), such as 2020-09-30.
    BucketName Yes String Bucket name. You can use Get Service to query the list of all buckets under a requester account. For details, see GET Service (List Buckets).

    3. Output Parameters

    Parameter Name Type Description
    DetailSets Array of CosDetailSets Array of usage
    RequestId String The unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem.

    4. Example

    Example1 Querying COS usage details by bucket name

    This example shows you how to query COS usage details.

    Input Example

    POST / HTTP/1.1
    Host: billing.tencentcloudapi.com
    Content-Type: application/json
    X-TC-Action: DescribeDosageCosDetailByDate
    <Common request parameters>
    
    {
        "StartDate": "2020-09-01",
        "EndDate": "2020-09-30",
        "BucketName": "systemcover-xxxx"
    }
    

    Output Example

    {
        "Response": {
            "DetailSets": [
                {
                    "DosageValue": "0.00976562",
                    "DosageBeginTime": "2020-09-01 00:00:00",
                    "DosageEndTime": "2020-09-01 23:59:59",
                    "BucketName": "systemcover-xxxx",
                    "SubProductCodeName": "COS STANDARD storage",
                    "BillingItemCodeName": "COS STANDARD storage capacity",
                    "Unit": "(GB)"
                },
                {
                    "DosageValue": "0.00976562",
                    "DosageBeginTime": "2020-09-02 00:00:00",
                    "DosageEndTime": "2020-09-02 23:59:59",
                    "BucketName": "systemcover-xxxx",
                    "SubProductCodeName": "COS STANDARD storage",
                    "BillingItemCodeName": "COS STANDARD storage capacity",
                    "Unit": "(GB)"
                }
            ],
            "RequestId": "4c714162-6ffb-4666-afc7-33b2585b86ab"
        }
    }
    

    5. Developer Resources

    SDK

    TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.

    Command Line Interface

    6. Error Code

    The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.

    Error Code Description
    InternalError.GatewayError Gateway error.