Creates a cache analysis task.

  • This operation is applicable to only the ApsaraDB for Redis (Redis) engine.
  • 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 V4.5.17.
  • The version of the SDK for Database Autonomy Service (DAS) must be V1.0.2 or later.
  • When you use the SDK to call the DAS service, you must set Region to cn-shanghai.

Request parameters

Parameter Type Required Example Description
Action String No CreateCacheAnalysisJob

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

InstanceId String No r-xxxxxx

The ID of the instance.

NodeId String No r-xxxxx-db-0

The ID of the sharded instance.

Response parameters

Parameter Type Example Description
Code String 200

The returned status code.

Data Struct

The list of detailed information.

BigKeys Array of KeyInfo

The details of the big keys.

KeyInfo
Bytes Long 12345

The number of bytes that are occupied by the keys.

Count Long 127

The number of elements in the keys.

Db Integer 0

The name of the database.

Encoding String hashtable

The data type of the keys.

ExpirationTimeMillis Long 1596256542547

The time when the keys expire. Unit: milliseconds. The value 0 indicates that the keys do not expire.

Key String task_xxxxx

The name of the key.

NodeId String r-xxxxx-db-0

The ID of the sharded instance.

Type String hash

The type of the Redis data structure.

InstanceId String r-xxxxxx

The ID of the instance.

JobId String xxxx-xxxx-xxxx-xxxx

The ID of the cache analysis task.

Message String None

The error message returned if the operation failed. The error message describes the reason why the error occurred.

NodeId String r-xxxxx-db-0

The ID of the sharded instance.

TaskState String BACKUP

The status of the cache analysis task:

  • BACKUP: The data is being backed up.
  • ANALYZING: The task is in the analyzing phase.
  • FINISHED: The analysis is complete.
  • FAILED: An error occurred.
Message String None

The returned error message that describes the reason why a taskState error occurred.

RequestId String B6D17591-B48B-4D31-9CD6-9B9796B2270A

The ID of the request.

Success String true

Indicates whether the request was successful. Valid values:

  • true: The request was successful.
  • False: The request failed.

Examples

Sample requests

http(s)://das.cn-shanghai.aliyuncs.com/? Action=CreateCacheAnalysisJob
&<Common request parameters>

Sample success responses

XML format

<CreateCacheAnalysisJobReponse>
  <RequestId> B6D17591-B48B-4D31-9CD6-9B9796B2270A</RequestId>
  <Message>None</Message>
  <Data>
        <BigKeys>
              <KeyInfo>
                    <Bytes>12345</Bytes>
                    <Type>hash</Type>
                    <NodeId>r-xxxxx-db-0</NodeId>
                    <ExpirationTimeMillis>1596256542547</ExpirationTimeMillis>
                    <Encoding>hashtable</Encoding>
                    <Count>127</Count>
                    <Key>task_xxxxx</Key>
                    <Db>0</Db>
              </KeyInfo>
        </BigKeys>
        <Message>None</Message>
        <InstanceId>r-xxxxxx</InstanceId>
        <NodeId>r-xxxxx-db-0</NodeId>
        <TaskState>BACKUP</TaskState>
        <JobId>xxxx-xxxx-xxxx-xxxx</JobId>
  </Data>
  <Code>200</Code>
  <Success>true</Success>
</CreateCacheAnalysisJobReponse>

JSON format

{"RequestId":" B6D17591-B48B-4D31-9CD6-9B9796B2270A",
"Message":"None",
"Data":{
    "BigKeys":{
        "KeyInfo":[{
            "Bytes":"12345",
            "Type":"hash",
            "NodeId":"r-xxxxx-db-0",
            "ExpirationTimeMillis":"1596256542547",
            "Encoding":"hashtable",
            "Count":"127",
            "Key":"task_xxxxx",
            "Db":"0"}]},
        "Message":"None",
        "InstanceId":"r-xxxxxx",
        "NodeId":"r-xxxxx-db-0",
        "TaskState":"BACKUP",
        "JobId":"xxxx-xxxx-xxxx-xxxx"},
"Code":"200",
"Success":"true"}

Error codes

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