Help Center/ GaussDB(for MySQL)/ API Reference/ APIs (Recommended)/ Instance Management/ Querying Historical Records of Auto Scaling
Updated on 2024-09-11 GMT+08:00

Querying Historical Records of Auto Scaling

Function

This API is used to query historical records of auto scaling. Before calling this API:

URI

GET /v3/{project_id}/instances/{instance_id}/auto-scaling/history

Table 1 URI parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID of a tenant in a region.

To obtain this value, see Obtaining a Project ID.

instance_id

Yes

String

Instance ID.

Table 2 Query parameters

Parameter

Mandatory

Type

Description

limit

No

String

Number of records to be queried. The default value is 20.

offset

No

String

Index offset. If offset is set to N, the query starts from the N+1 piece of data. The value is 0 by default, indicating that the query starts from the first piece of data. The value must be a number but cannot be a negative number.

Request Parameters

Table 3 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

User token.

To obtain the value, call the API for obtaining a user token.

The value of X-Subject-Token in the response header is the token value.

Content-Type

Yes

String

Content type.

Value: application/json

X-Language

No

String

Language.

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

total_count

String

Total number of records.

records

Array of AutoScalingRecordInfo objects

Historical records of auto scaling.

Table 5 AutoScalingRecordInfo

Parameter

Type

Description

id

String

Record ID.

instance_id

String

Instance ID.

instance_name

String

Instance name.

scaling_type

String

Scaling type.

original_value

String

Original value.

target_value

String

Target value.

result

String

Scaling result.

create_at

String

Scaling time.

Status code: 400

Table 6 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

Status code: 500

Table 7 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

Example Request

Querying historical records of auto scaling

GET https://{endpoint}/v3/0483b6b16e954cb88930a360d2c4e663/instances/61a4ea66210545909d74a05c27a7179ein07/auto-scaling/history

Example Response

Status code: 200

Success.

{
  "total_count" : 1,
  "records" : [ {
    "id" : "2f5f3eeb-16c7-4b0c-bd44-4b2968275abe",
    "instance_id" : "94bb6ce031424d02a1c61019d1d2298bin07",
    "instance_name" : "gaussdbformysql-ins01",
    "scaling_type" : "ENLARGE_FLAVOR",
    "original_value" : "gaussdb.mysql.medium.x86.4",
    "target_value" : "gaussdb.mysql.large.x86.4",
    "result" : "SUCCESSFUL",
    "create_at" : "2023-04-30 16:47:40.877"
  } ]
}

Status Code

Status Code

Description

200

Success.

400

Client error.

500

Server error.

Error Code

For details, see Error Codes.