All Products
Search
Document Center

BSS OpenAPI:QueryUserOmsData

Last Updated:Mar 01, 2024

Queries the usage data of an Alibaba Cloud service.

Operation description

You can call this operation to query the usage data of an Alibaba Cloud service. Take note of the following items:

  • The service code that you specify for querying the usage data of a specific Alibaba Cloud service must be valid. You can query the usage data by hour or by day.

  • The time that you specify must follow the ISO8601 standard in the yyyy-MM-ddTHH:mm:ssZ format.

    • Latency exists in data pushes. Therefore, if you set the DataType parameter to Hour, the integrity of usage data recorded in the last 24 hours can be ensured. If you set the DataType parameter to Day, the integrity of usage data recorded in the last two days can be ensured.
    • You can query the usage data that is recorded in the last quarter.

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

Request parameters

ParameterTypeRequiredDescriptionExample
TablestringYes

The service whose usage data you want to query and the details of the usage data. The parameter value is usually set to the code of a service. Various usage models are provided for different services.

rds
DataTypestringYes

The time type of the usage data. Set the parameter based on the description in the documentation of the specified service. Valid values:

  • Raw
  • Hour
  • Day
  • Month
Hour
StartTimestringYes

The beginning of the time range to query.

Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.

2020-02-20T12:00:00Z
EndTimestringYes

The end of the time range to query.

Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.

2020-02-21T12:00:00Z
MarkerstringNo

The name of the record from which the usage data starts to return. The usage data records whose names are alphabetically after the value of the Marker parameter are returned. By default, the usage data starts to return from the earliest record.

NextToken
PageSizeintegerNo

The number of entries to return on each page. Valid values: 1 to 200. Default value: 100.

1

Response parameters

ParameterTypeDescriptionExample
object
Codestring

The status code returned.

Success
Messagestring

The message returned.

Successful!
RequestIdstring

The ID of the request.

6000EE23-274B-4E07-A697-FF2E999520A4
Successboolean

Indicates whether the request is successful.

true
Dataobject

The data returned.

Markerstring

Indicates that the returned usage data starts from the next page. If no value is returned for this parameter or this parameter is not returned, no data can be queried.

NextToken
HostIdstring

The ID of the host.

cn
OmsDataobject []
object

The usage data returned.

[{ "SyncIn": "0", "Bucket": "quota_for_get_service_", "NetworkIn": "0", "PutRequest": "1", "NetworkOut": "0", "GetRequest": "0", "ProcessImgSize": "0", "SyncOut": "0", "Storage": "0", "Region": "ap-northeast-1", "ProviderId": "26842", "CdnIn": "0", "EndTime": "2019-09-03T16:00:00Z", "StartTime": "2019-09-02T16:00:00Z", "StorageType": "standard", "CdnOut": "0"}]

Examples

Sample success responses

JSONformat

{
  "Code": "Success",
  "Message": "Successful!",
  "RequestId": "6000EE23-274B-4E07-A697-FF2E999520A4",
  "Success": true,
  "Data": {
    "Marker": "NextToken",
    "HostId": "cn",
    "OmsData": [
      [
        {
          "SyncIn": "0",
          "Bucket": "quota_for_get_service_",
          "NetworkIn": "0",
          "PutRequest": "1",
          "NetworkOut": "0",
          "GetRequest": "0",
          "ProcessImgSize": "0",
          "SyncOut": "0",
          "Storage": "0",
          "Region": "ap-northeast-1",
          "ProviderId": "26842",
          "CdnIn": "0",
          "EndTime": "2019-09-03T16:00:00Z",
          "StartTime": "2019-09-02T16:00:00Z",
          "StorageType": "standard",
          "CdnOut": "0"
        }
      ]
    ]
  }
}

Error codes

HTTP status codeError codeError messageDescription
400NotApplicableThis API is not applicable for caller.-
400NotAuthorizedThis API is not authorized for caller.-
400InvalidOwnerThe specified owner doesn't belong to caller.Invalid user identity.
500InternalErrorThe request processing has failed due to some unknown error.-

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