Help Center/ Distributed Cache Service/ API Reference/ API V2/ Cache Analysis/ Configuring Automatic Big Key Analysis
Updated on 2025-05-13 GMT+08:00

Configuring Automatic Big Key Analysis

Function

This API is used to configure automatic big key analysis.

Calling Method

For details, see Calling APIs.

URI

PUT /v2/{project_id}/instances/{instance_id}/bigkey/autoscan

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Parameter description:

Project ID. For details, see Obtaining a Project ID.

Constraints:

N/A

Value range:

N/A

Default value:

N/A

instance_id

Yes

String

Parameter description:

Instance ID. It can be viewed on the instance details page on the DCS console.

Constraints:

N/A

Value range:

N/A

Default value:

N/A

Request Parameters

Table 2 Request body parameters

Parameter

Mandatory

Type

Description

enable_auto_scan

Yes

Boolean

Parameter description:

Whether to enable scheduled cache analysis.

Constraints:

N/A

Value range:

  • true

  • false

Default value:

N/A

schedule_at

Yes

Array of strings

Parameter description:

UTC time of the day that cache analysis is scheduled for. Example: 21:00.

Constraints:

N/A

Value range:

N/A

Default value:

N/A

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

instance_id

String

Parameter description:

Instance ID.

Value range:

N/A

enable_auto_scan

Boolean

Parameter description:

Whether to enable scheduled cache analysis.

Value range:

  • true

  • false

schedule_at

Array of strings

Parameter description:

UTC time of the day that analysis is scheduled for. Example: 21:00.

Value range:

N/A

updated_at

String

Parameter description:

Time when the configuration is updated. The time format is 2020-06-15T02:21:18.669Z.

Value range:

N/A

Status code: 400

Table 4 Response body parameters

Parameter

Type

Description

error_msg

String

Parameter description:

Error information.

Value range:

N/A

error_code

String

Parameter description:

Error code.

Value range:

For details, see Error Codes.

error_ext_msg

String

Parameter description:

Extended error information. This parameter is not used currently and is set to null.

Value range:

N/A

Status code: 401

Table 5 Response body parameters

Parameter

Type

Description

error_msg

String

Parameter description:

Error information.

Value range:

N/A

error_code

String

Parameter description:

Error code.

Value range:

For details, see Error Codes.

error_ext_msg

String

Parameter description:

Extended error information. This parameter is not used currently and is set to null.

Value range:

N/A

Status code: 403

Table 6 Response body parameters

Parameter

Type

Description

error_msg

String

Parameter description:

Error information.

Value range:

N/A

error_code

String

Parameter description:

Error code.

Value range:

For details, see Error Codes.

error_ext_msg

String

Parameter description:

Extended error information. This parameter is not used currently and is set to null.

Value range:

N/A

Status code: 404

Table 7 Response body parameters

Parameter

Type

Description

error_msg

String

Parameter description:

Error information.

Value range:

N/A

error_code

String

Parameter description:

Error code.

Value range:

For details, see Error Codes.

error_ext_msg

String

Parameter description:

Extended error information. This parameter is not used currently and is set to null.

Value range:

N/A

Status code: 500

Table 8 Response body parameters

Parameter

Type

Description

error_msg

String

Parameter description:

Error information.

Value range:

N/A

error_code

String

Parameter description:

Error code.

Value range:

For details, see Error Codes.

error_ext_msg

String

Parameter description:

Extended error information. This parameter is not used currently and is set to null.

Value range:

N/A

Example Requests

Scheduling big key analysis tasks to start at 21:00 every day

PUT https://{dcs_endpoint}/v2/a4d31cb6-3d72-4fdc-8ec9-6e3a41e47f71/instances/5560df16-cebf-4473-95c4-d1b573c16e79/bigkey/autoscan

{
  "enable_auto_scan" : true,
  "schedule_at" : [ "21:00" ]
}

Example Responses

Status code: 200

Big key analysis task configured successfully.

{
  "instance_id" : "5f9057b5-c330-4ee2-8138-7e69896eeec3",
  "enable_auto_scan" : true,
  "schedule_at" : [ "21:00" ],
  "updated_at" : "2020-06-17T02:42:40.793Z"
}

Status code: 400

Invalid request.

{
  "error_code" : "DCS.4919",
  "error_msg" : "Does not support bigkey analyze."
}

Status Codes

Status Code

Description

200

Big key analysis task configured successfully.

400

Invalid request.

401

Invalid authentication information.

403

The request is rejected.

404

The requested resource is not found.

500

Internal service error.

Error Codes

See Error Codes.