Skip to main content
Operations Management/Billing Management Operations
PUTBilling Management OperationsSince 0.6SynchronousAuth Required

CalculateAccountSpending

CalculateAccountSpending

Execution Availability

Try It Out

Submit a mock request using the current auth context and example-driven inputs.

Request Inputs

Body Fields

  • calculateaccountspendingObjectRequired

    calculateaccountspending request body object.

    • accountUuidStringRequired

      The account UUID.

    • dateStartLong

      Optional. The start date.

    • dateEndLong

      Optional. The end date.

  • systemTagsList

    Optional. The system tags.

  • userTagsList

    Optional. The user tags.

Responses

200 OK

On success, this API returns the following response structure.

  • totaldoubleRequired

    The total amount.

  • successbooleanRequired

    Whether the API succeeds.

  • errorErrorCodeRequired

    The error code. If not null, the operation fails, or vice versa. For more information, see error.

    • codeStringRequired

      The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001.

    • descriptionStringRequired

      The brief description of the error.

    • detailsStringRequired

      The details about the error.

      • resourceUuidStringRequired

        The resource UUID.

      • resourceNameStringRequired

        The resource name.

      • spendingdoubleRequired

        The spending.

        • spendingTypeStringRequired

          The spending type.

        • spendingdoubleRequired

          The total spending.

        • dateStartLongRequired

          The billing start date.

        • dateEndLongRequired

          The billing end date.

        • detailsListRequired

          See details.

      • typeStringRequired

        The type.

    • elaborationStringRequired

      The reserved field. Default value: null.

    • opaqueLinkedHashMapRequired

      The reserved field. Default value: null.

    • causeErrorCodeRequired

      The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null.

  • spendingListRequired

    See spending.

    • spendingTypeStringRequired

      The spending type.

    • spendingdoubleRequired

      The total spending.

    • dateStartLongRequired

      The billing start date.

    • dateEndLongRequired

      The billing end date.

    • detailsListRequired

      See details.

      • resourceUuidStringRequired

        The resource UUID.

      • resourceNameStringRequired

        The resource name.

      • spendingdoubleRequired

        The spending.

      • typeStringRequired

        The type.

  • errorErrorCodeRequired

    See error.

    • codeStringRequired

      The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001.

    • descriptionStringRequired

      The brief description of the error.

    • detailsStringRequired

      The details about the error.

      • resourceUuidStringRequired

        The resource UUID.

      • resourceNameStringRequired

        The resource name.

      • spendingdoubleRequired

        The spending.

        • spendingTypeStringRequired

          The spending type.

        • spendingdoubleRequired

          The total spending.

        • dateStartLongRequired

          The billing start date.

        • dateEndLongRequired

          The billing end date.

        • detailsListRequired

          See details.

      • typeStringRequired

        The type.

    • elaborationStringRequired

      The reserved field. Default value: null.

    • opaqueLinkedHashMapRequired

      The reserved field. Default value: null.

    • causeErrorCodeRequired

      The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null.

Endpoint

PUT/zstack/v1/billings/accounts/{accountUuid}/actions

/zstack/v1/billings/accounts/{accountUuid}/actions

Operation ID

CalculateAccountSpending

Permalink

Request Example

curl -X PUT 'http://{host}/zstack/v1/billings/accounts/{accountUuid}/actions' -H 'Authorization: OAuth {sessionUuid}' -H 'Content-Type: application/json;charset=UTF-8' -d '{"calculateaccountspending":{"accountUuid":"<accountUuid>","dateStart":1,"dateEnd":1},"systemTags":["<systemTags>"],"userTags":["<userTags>"]}'

Response Example

200
{ "total": 200.0, "spending": [ { "spending": 0.0, "details": [] } ] }

Change History

This API has no change history records yet.

View all change history