Restarting a DB Instance
Function
This API is used to restart a DB instance.
The DDS DB instance will be unavailable during the restart process. Exercise caution when performing this operation.
Constraints
If the instance status is not normal, the instance cannot be restarted.
Authorization Information
Each account has all the permissions required to call all APIs, but IAM users must be assigned the required permissions.
- If you are using role/policy-based authorization, see Permissions Policies and Supported Actions for details on the required permissions.
- If you are using identity policy-based authorization, the following identity policy-based permissions are required.
Action
Access Level
Resource Type (*: required)
Condition Key
Alias
Dependencies
dds:instance:restart
write
instance
dds:instance:reboot
-
|
Name |
Mandatory |
Type |
IN |
Description |
|---|---|---|---|---|
|
project_id |
Yes |
string |
path |
Definition Project ID of a tenant in a region. To obtain the project ID, see Obtaining a Project ID. Constraints N/A Range N/A Default Value N/A |
|
instance_id |
Yes |
string |
path |
Definition Instance ID, which can be obtained by calling the API described in Querying Instances and Details. If you do not have an instance, call the API described in Creating a DB Instance to create one. Constraints N/A Range N/A Default Value N/A |
Request Parameters
|
Name |
Mandatory |
Type |
IN |
Description |
|---|---|---|---|---|
|
X-Auth-Token |
Yes |
string |
header |
Definition User token obtained from IAM. For details, see Authentication. Constraints N/A Range N/A Default Value N/A |
|
Name |
Mandatory |
Type |
Description |
|---|---|---|---|
|
target_type |
No |
String |
Definition The type of the object to restart. Constraints This parameter is mandatory when you restart one or more nodes of a cluster instance.
Range
Default Value N/A |
|
target_id |
Yes |
String |
Definition The ID of the object to be restarted, which can be obtained by calling the API for querying instances. If you do not have an instance, you can call the API used for creating an instance. Constraints You cannot restart the primary node when the node in the Available state. Range
Default Value N/A |
|
is_serial |
No |
Boolean |
Definition Whether to restart nodes one by one. Constraints This API applies only to replica set instances. Range
Default Value false |
|
is_force |
No |
Boolean |
Definition Whether to forcibly restart the instance. Constraints Only nodes in the abnormal state can be forcibly restarted. Read replicas cannot be forcibly restarted. Range
Default Value false |
Response Parameters
|
Name |
Mandatory |
Type |
Description |
|---|---|---|---|
|
job_id |
Yes |
String |
Definition The workflow ID. Range N/A |
Example Request
- Restarting a DB instance based on the value of target_id
{ "target_id":"9136fd2a9fcd405ea4674276ce36dae8in02" } - Restarting a shard group based on the values of target_type and target_id
{ "target_type":"shard", "target_id":"84e7c96b82aa4fedb3b00f98edd71ba4gr02" } - Restarting a config group based on the values of target_type and target_id
{ "target_type":"config", "target_id":"06439baa35c146d3a8965af59d370908gr02" } - Restarting a mongos node based on the values of target_type and target_id
{ "target_type":"mongos", "target_id":"bd4dccbd53ae48d5bd3046bebf715079no02" }
- Restarting nodes one by one
POST https://{endpoint}/v3/054e292c9880d4992f02c0196d3ea468/instances/837f47dd0fa34219b1f5ce3f05cb5541in02/restart { "target_id" : "837f47dd0fa34219b1f5ce3f05cb5541in02", "is_serial" : false }
Example Response
{
"job_id": "3711e2ad-5787-49bc-a47f-3f0b066af9f5"
}
SDK
Click Document Database Service DDS SDK to download the SDK or view the SDK document. To learn how to install and authenticate an SDK, read the Usage section.
Status Code
For more information, see Status Code.
Error Code
For more information, see Error Code.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot