Queries the details about a cache analysis task.

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 DescribeCacheAnalysisJob

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

InstanceId String No r-bp18ff4a195d****

The ID of the instance.

JobId String No sf79-sd99-sa37-****

The ID of the cache analysis task. You can call the CreateCacheAnalysisJob operation to query the ID. The JobId response parameter indicates the ID of the specified task.

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 details about the cache analysis task.

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.

Note This parameter can be used to query a specified cache analysis task. When you call the DescribeCacheAnalysisJob operation, it takes some time to create a cache analysis task. As a result, the analysis results cannot be immediately returned. You can specify this parameter in the DescribeCacheAnalysisJob operation to query the analysis results of the specified cache analysis task.
KeyPrefixes Array of Prefix

The prefixes of the keys.

Prefix
KeyNum Long 123

The number of keys with the prefix.

Type String hash

The type of the ApsaraDB for Redis data structure.

Bytes Long 12345

The number of bytes that are occupied by the key.

Prefix String task_

The prefix of the key.

Count Long 127

The number of elements in the key.

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_x****

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-x****-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.

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=DescribeCacheAnalysisJob
&InstanceId=r-bp18ff4a195d****
&JobId=sf79-sd99-sa37-****
&<Common request parameters>

Sample success responses

XML format

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

<DescribeCacheAnalysisJobResponse>
    <Message>Successful</Message>
    <RequestId>B6D17591-B48B-4D31-9CD6-9B9796B2****</RequestId>
    <Data>
        <TaskState>BACKUP</TaskState>
        <JobId>sf79-sd99-sa37-****</JobId>
        <KeyPrefixes>
            <KeyNum>123</KeyNum>
            <Type>hash</Type>
            <Bytes>12345</Bytes>
            <Prefix>task_</Prefix>
            <Count>127</Count>
        </KeyPrefixes>
        <Message>Successful</Message>
        <BigKeys>
            <Type>hash</Type>
            <Db>0</Db>
            <ExpirationTimeMillis>1596256542547</ExpirationTimeMillis>
            <Key>task_x****</Key>
            <Encoding>hashtable</Encoding>
            <Bytes>12345</Bytes>
            <NodeId>r-x****-db-0</NodeId>
            <Count>127</Count>
        </BigKeys>
        <InstanceId>r-bp18ff4a195d****</InstanceId>
        <NodeId>r-x****-db-0</NodeId>
    </Data>
    <Code>200</Code>
    <Success>true</Success>
</DescribeCacheAnalysisJobResponse>

JSON format

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

{
  "Message" : "Successful",
  "RequestId" : "B6D17591-B48B-4D31-9CD6-9B9796B2****",
  "Data" : {
    "TaskState" : "BACKUP",
    "JobId" : "sf79-sd99-sa37-****",
    "KeyPrefixes" : [ {
      "KeyNum" : 123,
      "Type" : "hash",
      "Bytes" : 12345,
      "Prefix" : "task_",
      "Count" : 127
    } ],
    "Message" : "Successful",
    "BigKeys" : [ {
      "Type" : "hash",
      "Db" : 0,
      "ExpirationTimeMillis" : 1596256542547,
      "Key" : "task_x****",
      "Encoding" : "hashtable",
      "Bytes" : 12345,
      "NodeId" : "r-x****-db-0",
      "Count" : 127
    } ],
    "InstanceId" : "r-bp18ff4a195d****",
    "NodeId" : "r-x****-db-0"
  },
  "Code" : "200",
  "Success" : "true"
}

Error codes

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