Queries the number of accesses to one or all tables within an AnalyticDB for MySQL cluster for a specified date.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes DescribeTableAccessCount

The operation that you want to perform. Set the value to DescribeTableAccessCount.

DBClusterId String Yes am-****************

The ID of the cluster.

Note You can call the DescribeDBClusters operation to query the details of all AnalyticDB for MySQL clusters within a specified region, including cluster IDs.
TableName String No CUSTOMER

The name of the specific table.

Note If this parameter is not specified, the number of accesses to all tables within the specified cluster for a specified date is returned.
StartTime String Yes 2021-08-30

The date to query. Specify the time in the yyyy-MM-dd format. The time must be in UTC.

Note Only data for the last 30 days can be queried.
Order String No [{"Field":"TableSchema","Type":"Asc"}]

The order by which to sort query results. Specify the parameter value in the JSON string format. Example: [{"Field":"TableSchema","Type":"Asc"}].

  • Field indicates the field that is used to sort the retrieved entries. Valid values:
    • TableSchema: the name of the database to which the table belongs.
    • TableName: the name of the table.
    • AccessCount: the number of accesses to the table.
  • Type indicates the sorting method. Valid values:
    • Asc: ascending order.
    • Desc: descending order.
Note If this parameter is not specified, query results are sorted in ascending order of the database to which a specific table belongs.
PageNumber Integer No 1

The number of the page to return. The value must be an integer that is greater than 0. Default value: 1.

PageSize Integer No 30

The number of entries to return on each page. The value must be a positive integer. Default value: 30.

RegionId String Yes cn-hangzhou

The ID of the region.

Note You can call the DescribeRegions operation to query the regions and zones supported by AnalyticDB for MySQL, including region IDs.

Response parameters

Parameter Type Example Description
RequestId String C242707A-01D1-54DA-A5F6-671557******

The ID of the request.

PageNumber Integer 1

The page number of the returned page.

PageSize Integer 30

The number of entries returned on the current page.

TotalCount Integer 1

The total number of entries.

Items Array of Items

Details about the table usage.

ReportDate String 2021-08-30

The date when the table was used.

TableSchema String tpch

The database to which the table belongs.

AccessCount String 6

The number of accesses to the table.

TableName String CUSTOMER

The name of the table.

InstanceName String am-****************

The ID of the cluster to which the table belongs.

Examples

Sample requests

http(s)://adb.aliyuncs.com/?Action=DescribeTableAccessCount
&DBClusterId=am-****************
&StartTime=2021-08-30
&RegionId=cn-hangzhou
&<Common request parameters>

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<DescribeTableAccessCountResponse>
    <TotalCount>1</TotalCount>
    <RequestId>C242707A-01D1-54DA-A5F6-671557******</RequestId>
    <PageSize>30</PageSize>
    <PageNumber>1</PageNumber>
    <Items>
        <InstanceName>am-****************</InstanceName>
        <TableName>CUSTOMER</TableName>
        <TableSchema>tpch</TableSchema>
        <ReportDate>2021-08-30</ReportDate>
        <AccessCount>6</AccessCount>
    </Items>
</DescribeTableAccessCountResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "TotalCount" : 1,
  "RequestId" : "C242707A-01D1-54DA-A5F6-671557******",
  "PageSize" : 30,
  "PageNumber" : 1,
  "Items" : [ {
    "InstanceName" : "am-****************",
    "TableName" : "CUSTOMER",
    "TableSchema" : "tpch",
    "ReportDate" : "2021-08-30",
    "AccessCount" : 6
  } ]
}

Error codes

For a list of error codes, visit the API Error Center.