Updated on 2024-08-23 GMT+08:00

Modifying Database Parameters

Function

This API is to modify database parameters.

Constraints

  • This API can be called only for MySQL migration and MySQL DR.
  • This API can be called only when job_direction is set to up and the task status is CONFIGURATION.
  • This API can be called only after the API in Obtaining Database Parameters in Batches is successfully called.
  • In the dual-active DR scenario, the parent task cannot call the API.

URI

POST /v3/{project_id}/jobs/{job_id}/params

Table 1 Path parameters

Parameter

Mandatory

Type

Description

job_id

Yes

String

Task ID.

project_id

Yes

String

Project ID of a tenant in a region

For details about how to obtain the project ID, see Obtaining a Project ID.

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

Content-Type

Yes

String

The content type.

The default value is application/json.

X-Auth-Token

Yes

String

User token obtained from IAM.

X-Language

No

String

Request language type

Default value: en-us

Values:

  • en-us
  • zh-cn
Table 3 Request body parameters

Parameter

Mandatory

Type

Description

group

Yes

String

Parameter Groups Values:

  • common
  • performance

params

Yes

Array of objects

Information about the parameters to be modified.

For details, see Table 4.

Table 4 Data structure description of field params

Parameter

Mandatory

Type

Description

key

Yes

String

Database parameter name.

target_value

Yes

String

Parameter value of the destination database.

Response Parameters

Status code: 202

Table 5 Response body parameters

Parameter

Type

Description

success

Boolean

Whether the parameters are modified.

should_restart

String

Whether the instance needs to be restarted. Values:

  • true
  • false

error_code

String

Error code.

error_msg

String

Error message.

Example Request

Changing the value of binlog_stmt_cache_size to 32678 and bulk_insert_buffer_size to 8388608

https://{endpoint}/v3/054ba152d480d55b2f5dc0069e7ddef0/jobs/140b5236-88ad-43c8-811c-1268453jb101/params

{
  "group" : "performance",
  "params" : [ {
    "key" : "binlog_stmt_cache_size",
    "target_value" : "32678"
  }, {
    "key" : "bulk_insert_buffer_size",
    "target_value" : "8388608"
  } ]
}

Example Response

Status code: 202

Accepted

{
  "success" : true,
  "should_restart" : "false"
}

Status Code

Status Code

Description

202

Accepted

400

Bad Request

Error Code

For details, see Error Code.