Updated on 2022-09-19 GMT+08:00

Listing Redis Run Logs

Function

This API is used to query the Redis run logs.

URI

GET /v2/{project_id}/instances/{instance_id}/redislog

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID.

instance_id

Yes

String

Instance ID.

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

offset

No

Integer

Offset, which is the position where the query starts. The value must be greater than or equal to 0.

limit

No

Integer

Number of items displayed on each page.

log_type

Yes

String

Log type. Currently, only Redis run logs are supported. The value is run.

Request Parameters

None

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

total_num

Integer

Total.

file_list

Array of RunlogItem objects

Run log list.

Table 4 RunlogItem

Parameter

Type

Description

id

String

Unique ID of a run log.

file_name

String

Run log file name.

group_name

String

Shard name.

replication_ip

String

IP address of the replica where the run logs are collected.

status

String

Run log status.

time

String

Date when run logs are collected. The format is yyyy-MM-dd.

Status code: 400

Table 5 Response body parameters

Parameter

Type

Description

error_msg

String

Error message.

Maximum: 1024

error_code

String

Error code.

Maximum: 9

error_ext_msg

String

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

Maximum: 1024

Status code: 401

Table 6 Response body parameters

Parameter

Type

Description

error_msg

String

Error message.

Maximum: 1024

error_code

String

Error code.

Maximum: 9

error_ext_msg

String

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

Maximum: 1024

Status code: 403

Table 7 Response body parameters

Parameter

Type

Description

error_msg

String

Error message.

Maximum: 1024

error_code

String

Error code.

Maximum: 9

error_ext_msg

String

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

Maximum: 1024

Status code: 404

Table 8 Response body parameters

Parameter

Type

Description

error_msg

String

Error message.

Maximum: 1024

error_code

String

Error code.

Maximum: 9

error_ext_msg

String

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

Maximum: 1024

Status code: 500

Table 9 Response body parameters

Parameter

Type

Description

error_msg

String

Error message.

Maximum: 1024

error_code

String

Error code.

Maximum: 9

error_ext_msg

String

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

Maximum: 1024

Example Requests

GET https://{dcs_endpoint}/v2/a4d31cb6-3d72-4fdc-8ec9-6e3a41e47f71/instances/5560df16-cebf-4473-95c4-d1b573c16e79/redislog?log_type=run&offset=1&limit=10

Example Responses

Status code: 200

Run logs queried successfully.

{
  "total_num" : 1,
  "file_list" : [ {
    "id" : "e79f2d97-e972-41f2-b51c-d18f65f39a45",
    "file_name" : "redis_192.168.0.142_2021-04-16.log",
    "status" : "succeed",
    "time" : "2021-04-16",
    "replication_ip" : "192.168.0.142",
    "group_name" : "group-0",
    "backupId" : "e79f2d97-e972-41f2-b51c-d18f65f39a45"
  } ]
}

Status code: 400

Invalid request.

{
  "error_code" : "DCS.4800",
  "error_msg" : "Invalid logType."
}

Status Codes

Status Code

Description

200

Run logs queried 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.