Modifying Details of a DCS Instance
Function
This API is used to modify the information about a DCS instance, including the instance name, description, port, backup policy, start and end time of the maintenance window, and security group.
URI
PUT /v2/{project_id}/instances/{instance_id}
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
project_id |
Yes |
String |
Definition: Project ID. For details, see Obtaining a Project ID. Constraints: N/A Range: N/A Default Value: N/A |
|
instance_id |
Yes |
String |
Definition: Instance ID. It can be viewed on the instance details page on the DCS console. Constraints: N/A Range: N/A Default Value: N/A |
Request Parameters
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
name |
No |
String |
Definition: Instance name. Constraints: An instance name can contain 4 to 64 characters, including letters, digits, underscores (_), and hyphens (-), and must start with a letter. Range: N/A Default Value: N/A |
|
description |
No |
String |
Definition: Description of an instance. Constraints: 0–1,024 characters
NOTE:
The backslash () and quotation mark (") are special characters for JSON messages. When using these characters in a parameter value, add the escape character () before the characters, for example, \ and ".
Range: N/A Default Value: N/A |
|
port |
No |
Integer |
Definition: Port customization. Constraints: which is supported only by Redis 4.0 and later instances Memcached instances do not support port customization. If this parameter is not sent or is left empty when you create a Redis instance, the default port 6379 will be used. To customize a port, specify a port number in the range from 1 to 65535. Range: 1–65535 Default Value: 6379 |
|
rename_commands |
No |
RenameCommandRuqest object |
Definition: Command renaming list. |
|
maintain_begin |
No |
String |
Definition Start time of the maintenance time window. Constraints The value must be a UTC time in the format of HH:mm:ss. - The start time and end time of the maintenance time window must indicate the time segment of a supported maintenance time window. For details, see [Listing Maintenance Time Windows] (ListMaintenanceWindows.xml).
Range N/A Default Value 18:00:00 |
|
maintain_end |
No |
String |
Definition End time of the maintenance time window. Constraints The value must be a UTC time in the format of HH:mm:ss. - The start time and end time of the maintenance time window must indicate the time segment of a supported maintenance time window. For details, see [Listing Maintenance Time Windows] (ListMaintenanceWindows.xml).
Range N/A Default Value 19:00:00 |
|
security_group_id |
No |
String |
Definition Security group to which the instance belongs. This parameter is optional when the engine is Redis and the version is 4.0 or later. DCS Redis 4.0 and later instances do not support security groups (default value securityGroupId will be used). They support only whitelist-based access control. To obtain the value:
Constraints N/A Range N/A Default Value N/A |
|
instance_backup_policy |
No |
BackupPolicy object |
Definition: Backup policy. This parameter is supported when the instance type is master/standby or cluster. |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
command |
No |
String |
Definition: Command that can be renamed. Constraints: N/A Range: N/A Default Value: N/A |
|
flushall |
No |
String |
Definition: Command FLUSHALL that can be renamed. Constraints: N/A Range: N/A Default Value: N/A |
|
flushdb |
No |
String |
Definition: Command FLUSHDB that can be renamed. Constraints: N/A Range: N/A Default Value: N/A |
|
hgetall |
No |
String |
Definition: Command HGETALL that can be renamed. Constraints: N/A Range: N/A Default Value: N/A |
|
keys |
No |
String |
Definition: Command HGETALL that can be renamed. Constraints: N/A Range: N/A Default Value: N/A |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
backup_type |
Yes |
String |
Definition: Backup type. Constraints: N/A Range:
Default Value: N/A |
|
save_days |
No |
Integer |
Definition: This parameter is mandatory when backup_type is set to manual. Retention period, in days. The value ranges from 1 to 7. The automatic backup policy is retained when automatic backup is switched to manual backup. Constraints: N/A Range: N/A Default Value: N/A |
|
periodical_backup_plan |
No |
BackupPlanRequst object |
Definition: Backup plan. Constraints: This parameter is mandatory when backup_type is set to manual. The automatic backup policy is retained when automatic backup is switched to manual backup. |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
timezone_offset |
No |
String |
Definition: Time zone of the backup. This parameter is no longer used. Constraints: N/A Range: N/A Default Value: N/A |
|
backup_at |
Yes |
Array of integers |
Definition: Day on which the backup starts every week. The automatic backup policy is retained when automatic backup is switched to manual backup. 1–7: Monday to Sunday Constraints: N/A |
|
period_type |
Yes |
String |
Definition: Interval at which backup is performed, which supports only weekly currently. The automatic backup policy is retained when automatic backup is switched to manual backup. Constraints: N/A Range: N/A Default Value: N/A |
|
begin_at |
Yes |
String |
Definition: UTC time when the backup starts. For example, 00:00–01:00 indicates that the backup starts at 00:00 (UTC time). The value must be on the hour. The backup interval is 1 hour. The automatic backup policy is retained when automatic backup is switched to manual backup. Constraints: N/A Range: N/A Default Value: N/A |
Response Parameters
Status code: 204
DCS instance modified successfully.
None
Example Requests
Changing the name of a specified instance to dcs002 and port to 6379, and configuring an auto backup policy
PUT https://{dcs_endpoint}/v2/{project_id}/instances/{instance_id}
{
"name" : "dcs002",
"description" : "instance description",
"port" : 6379,
"maintain_begin" : "18:00:00",
"maintain_end" : "19:00:00",
"security_group_id" : "18e9309f-f81a-4749-bb21-f74576292162",
"instance_backup_policy" : {
"backup_type" : "auto",
"save_days" : 1,
"periodical_backup_plan" : {
"backup_at" : [ "1", "2", "3", "4", "6", "7" ],
"period_type" : "weekly",
"begin_at" : "00:00-01:00"
}
}
}
Example Responses
None
Status Codes
|
Status Code |
Description |
|---|---|
|
204 |
DCS instance modified successfully. |
|
400 |
Invalid request. |
|
500 |
Internal service error. |
Error Codes
See Error Codes.
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