All Products
Search
Document Center

Database Autonomy Service:CreateCacheAnalysisJob

Last Updated:Jan 26, 2024

Creates a cache analysis task.

Operation description

Before you call this operation, take note of the following items:

  • If you use an Alibaba Cloud SDK or a Database Autonomy Service (DAS) SDK to call this operation, we recommend that you use the latest version of the SDK.
  • If you use an SDK to call DAS, you must set the region to cn-shanghai.
  • This operation is applicable only to ApsaraDB for Redis Community Edition instances and performance-enhanced instances of the ApsaraDB for Redis Enhanced Edition (Tair).
Note Redis 7.0 is not supported. You are not allowed to use custom modules.

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

Request parameters

ParameterTypeRequiredDescriptionExample
InstanceIdstringYes

The ID of the ApsaraDB for Redis instance.

r-bp18ff4a195d****
NodeIdstringNo

The ID of the data node on the instance. You can specify this parameter to query the monitoring information about the specified node.

Note If you specify the BackupSetId parameter, the system ignores the NodeId parameter. You can call the DescribeLogicInstanceTopology operation to query the node ID.
r-x****-db-0
BackupSetIdstringNo

The ID of the backup file. You can call the DescribeBackups operation to query the ID.

  • If you need to specify multiple backup file IDs, separate them with commas (,). For example, you can set this parameter to 12345,67890.
  • If you do not specify this parameter, the system automatically backs up the task and performs cache analysis on the backup file.
12345
SeparatorsstringNo

The delimiters used to identify the prefixes of keys. You do not need to specify this parameter if one or more of the following default delimiters are used: : ; , _ - + @ = | #

&

Response parameters

ParameterTypeDescriptionExample
object
Messagestring

The returned message.

Note If the request was successful, Successful is returned. If the request failed, an error message such as an error code is returned.
Successful
RequestIdstring

The request ID.

B6D17591-B48B-4D31-9CD6-9B9796B2****
Dataobject

The detailed information.

TaskStatestring

The state 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.
BACKUP
JobIdstring

The ID of the cache analysis task.

Note This parameter can be used to query a specific cache analysis task. When you call the CreateCacheAnalysisJob operation, it takes some time to create a cache analysis task. As a result, the analysis results cannot be immediately returned. You can call the DescribeCacheAnalysisJob operation to query the analysis results of the specified cache analysis task.
sf79-sd99-sa37-****
Messagestring

The returned message.

Note If the request was successful, Successful is returned. If the request failed, an error message such as an error code is returned.
Successful
BigKeysobject []

The number of elements in the key.

Typestring

The data type of the ApsaraDB for Redis instance.

hash
Dbinteger

The name of the database.

0
ExpirationTimeMillislong

The expiration period of the key. Unit: milliseconds. A value of 0 indicates that the key does not expire.

1596256542547
Keystring

The name of the key.

task_x****
Encodingstring

The data type of the key.

hashtable
Byteslong

The number of bytes that are occupied by the key.

12345
NodeIdstring

The ID of the data node on the instance.

r-x****-db-0
Countlong

The number of elements in the key.

127
InstanceIdstring

The instance ID.

r-bp18ff4a195d****
NodeIdstring

The ID of the data node on the instance.

r-x****-db-0
Codestring

The HTTP status code returned.

200
Successstring

Indicates whether the request was successful. Valid values:

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

Examples

Sample success responses

JSONformat

{
  "Message": "Successful",
  "RequestId": "B6D17591-B48B-4D31-9CD6-9B9796B2****",
  "Data": {
    "TaskState": "BACKUP",
    "JobId": "sf79-sd99-sa37-****",
    "Message": "Successful",
    "BigKeys": {
      "KeyInfo": [
        {
          "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

HTTP status codeError codeError message
400InvalidParamsThe request parameters are invalid.
403NoPermissionYou are not authorized to do this action.

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

Change history

Change timeSummary of changesOperation
2023-07-06The Error code has changed. The request parameters of the API has changedsee changesets
Change itemChange content
Error CodesThe Error code has changed.
    Added Error Codes: 400
    Added Error Codes: 403
Input ParametersThe request parameters of the API has changed.
    Added Input Parameters: Separators