Queries cache analysis tasks.

Before you call this operation, make sure that the following conditions are met:

  • This operation is applicable only to ApsaraDB for Redis.
  • When you use an Alibaba Cloud SDK, make sure that the aliyun-sdk-core version is later than V4.3.3. We recommend that you use the latest version.
  • The version of Database Autonomy Service (DAS) SDK must be V1.0.2 or later.
  • When you call this operation to use DAS, you must specify cn-shanghai as the region.

Request parameters

Parameter Type Required Example Description
Action String No DescribeCacheAnalysisJobs

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

InstanceId String No r-bp18ff4a195d****

The ID of the instance.

StartTime String No 1596177993000

The beginning of the time range to query. Specify the time in the UNIX timestamp format. Unit: milliseconds.

EndTime String No 1596177993001

The end of the time range to query. Specify the time in the UNIX timestamp format. Unit: milliseconds.

Note The end time must be later than the start time.
PageNo String No 1

The number of the page to return. The value must be a positive integer that does not exceed the maximum value of the INTEGER data type. Default value: 1.

PageSize String No 10

The maximum number of entries to return on each page. Default value: 10.

Response parameters

Parameter Type Example Description
Message String Successful

The message returned for the request.

Note If the request is successful, Successful is returned. If the request fails, an error message such as an error code is returned.
RequestId String B6D17591-B48B-4D31-9CD6-9B9796B2****

The ID of the request.

Data Object

The detailed information about the instance.

List Array of CacheAnalysisJob

The details about the cache analysis tasks.

CacheAnalysisJob
TaskState String BACKUP

The status of the cache analysis task. Valid values:

  • BACKUP: The data is being backed up.
  • ANALYZING: The data is being analyzed.
  • FINISHED: The data is analyzed.
  • FAILED: An error occurred.
JobId String sf79-sd99-sa37-****

The ID of the cache analysis task.

Message String Successful

The message returned for the request.

Note If the request is successful, Successful is returned. If the request fails, an error message such as an error code is returned.
BigKeys Array of KeyInfo

The details about the big keys.

KeyInfo
Type String hash

The type of the ApsaraDB for Redis data structure.

Db Integer 0

The name of the database.

ExpirationTimeMillis Long 1596256542547

The timestamp when the key expires. Unit: milliseconds. The value 0 indicates that the key does not expire.

Key String task_*****

The name of the key.

Encoding String hashtable

The data type of the key.

Bytes Long 12345

The number of bytes that are occupied by the key.

NodeId String r-****-db-0

The ID of the data node on the instance.

Count Long 127

The number of elements in the key.

InstanceId String r-bp18ff4a195d****

The ID of the instance.

NodeId String r-x****-db-0

The ID of the data node on the instance.

PageNo Long 1

The page number of the returned page. This value is a positive integer that does not exceed the maximum value of the INTEGER data type. Default value: 1.

PageSize Long 10

The maximum number of entries returned per page. Default value: 10.

Extra String None

A hidden parameter.

Total Long 4

The total number of cache analysis tasks.

Code String 200

The returned status code.

Success String true

Indicates whether the request is successful. Valid values:

  • true: The request is successful.
  • false: The request failed.

Examples

Sample requests

http(s)://das.cn-shanghai.aliyuncs.com/?Action=DescribeCacheAnalysisJobs
&InstanceId=r-bp18ff4a195d****
&StartTime=1596177993000
&EndTime=1596177993001
&PageNo=1
&PageSize=10
&<Common request parameters>

Sample success responses

XML format

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

<DescribeCacheAnalysisJobsResponse>
    <Message>Successful</Message>
    <RequestId>B6D17591-B48B-4D31-9CD6-9B9796B2****</RequestId>
    <Data>
        <List>
            <TaskState>BACKUP</TaskState>
            <JobId>sf79-sd99-sa37-****</JobId>
            <Message>Successful</Message>
            <BigKeys>
                <Type>hash</Type>
                <Db>0</Db>
                <ExpirationTimeMillis>1596256542547</ExpirationTimeMillis>
                <Key>task_*****</Key>
                <Encoding>hashtable</Encoding>
                <Bytes>12345</Bytes>
                <NodeId>r-****-db-0</NodeId>
                <Count>127</Count>
            </BigKeys>
            <InstanceId>r-bp18ff4a195d****</InstanceId>
            <NodeId>r-x****-db-0</NodeId>
        </List>
        <PageNo>1</PageNo>
        <PageSize>10</PageSize>
        <Extra>None</Extra>
        <Total>4</Total>
    </Data>
    <Code>200</Code>
    <Success>true</Success>
</DescribeCacheAnalysisJobsResponse>

JSON format

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

{
  "Message" : "Successful",
  "RequestId" : "B6D17591-B48B-4D31-9CD6-9B9796B2****",
  "Data" : {
    "List" : [ {
      "TaskState" : "BACKUP",
      "JobId" : "sf79-sd99-sa37-****",
      "Message" : "Successful",
      "BigKeys" : [ {
        "Type" : "hash",
        "Db" : 0,
        "ExpirationTimeMillis" : 1596256542547,
        "Key" : "task_*****",
        "Encoding" : "hashtable",
        "Bytes" : 12345,
        "NodeId" : "r-****-db-0",
        "Count" : 127
      } ],
      "InstanceId" : "r-bp18ff4a195d****",
      "NodeId" : "r-x****-db-0"
    } ],
    "PageNo" : 1,
    "PageSize" : 10,
    "Extra" : "None",
    "Total" : 4
  },
  "Code" : "200",
  "Success" : "true"
}

Error codes

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