修改实例信息
功能介绍
修改缓存实例的信息,可修改信息包括实例名称、描述、端口号、备份策略、维护时间窗开始和结束时间以及安全组。
调用方法
请参见如何调用API。
URI
PUT /v2/{project_id}/instances/{instance_id}
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
project_id |
是 |
String |
参数解释: 项目ID。获取方法请参见获取项目ID。 约束限制: 不涉及。 取值范围: 不涉及。 默认取值: 不涉及。 |
instance_id |
是 |
String |
参数解释: 实例ID。可通过DCS控制台进入实例详情界面查看。 约束限制: 不涉及。 取值范围: 不涉及。 默认取值: 不涉及。 |
请求参数
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
name |
否 |
String |
参数解释: 实例名称。 约束限制: 由英文字符开头,只能由英文字母、数字、中划线和下划线组成,名称长度为4到64位的字符串。 取值范围: 不涉及。 默认取值: 不涉及。 |
description |
否 |
String |
参数解释: 实例的描述信息。 约束限制: 长度不超过1024的字符串。 \与"在json报文中属于特殊字符,如果参数值中需要显示\或者"字符,请在字符前增加转义字符\,比如\或者"。 取值范围: 不涉及。 默认取值: 不涉及。 |
port |
否 |
Integer |
参数解释: 实例自定义端口。 约束限制: 只有创建Redis4.0及以上版本的基础版实例才支持自定义端口,企业版实例不支持自定义端口,默认端口为6379。 创建Redis实例时,如果没发送该参数或该参数为空,表示实例使用默认端口6379。如果自定义端口,端口范围为1~65535的任意数字。 取值范围: 1~65535 默认取值: 6379 |
rename_commands |
否 |
RenameCommandResp object |
参数解释: 命令重命名列表。 |
maintain_begin |
否 |
String |
参数解释: 维护时间窗开始时间。 约束限制: 必须是UTC时间,格式为HH:mm:ss
取值范围: 不涉及。 默认取值: 18:00:00。 |
maintain_end |
否 |
String |
参数解释: 维护时间窗结束时间。 约束限制: 必须是UTC时间,格式为HH:mm:ss
取值范围: 不涉及。 默认取值: 19:00:00。 |
security_group_id |
否 |
String |
参数解释: 指定实例所属的安全组。 当engine为Redis且engine_version为4.0及以上版本基础版实例时,该参数为可选。Redis4.0及以上版本基础版实例不支持安全组控制访问(会设置为默认参数值securityGroupId),只支持白名单控制。 获取方法如下:
约束限制: 不涉及。 取值范围: 不涉及。 默认取值: 不涉及。 |
instance_backup_policy |
否 |
BackupPolicy object |
参数解释: 备份策略,实例类型为主备和集群时支持。 |
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
command |
否 |
String |
参数解释: 可命令重命名的命令command。 取值范围: 不涉及。 |
flushall |
否 |
String |
参数解释: 可命令重命名的命令flushall。 取值范围: 不涉及。 |
flushdb |
否 |
String |
参数解释: 可命令重命名的命令flushdb。 取值范围: 不涉及。 |
hgetall |
否 |
String |
参数解释: 可命令重命名的命令hgetall。 取值范围: 不涉及。 |
keys |
否 |
String |
参数解释: 可命令重命名的命令keys。 取值范围: 不涉及。 |
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
backup_type |
是 |
String |
参数解释: 备份类型。 约束限制: 不涉及。 取值范围: 默认取值: 不涉及。 |
save_days |
否 |
Integer |
参数解释: 当backup_type设置为auto时,该参数为必填。 保留天数,单位:天,取值范围:1-7。由自动切换为手动时,保留自动备份策略信息。 约束限制: 不涉及。 取值范围: 不涉及。 默认取值: 不涉及。 |
periodical_backup_plan |
否 |
BackupPlan object |
参数解释: 备份计划。 约束限制: 当backup_type设置为auto时,该参数为必填。由自动切换为手动时,保留自动备份策略信息。 |
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
timezone_offset |
否 |
String |
参数解释: 备份的时区。该参数已废弃,没有实际作用。 取值范围: 不涉及。 |
backup_at |
是 |
Array of integers |
参数解释: 每周的周几开始备份。由自动切换为手动时,保留自动备份策略信息。 取值范围: 1-7,分别表示星期一到星期日。 |
period_type |
是 |
String |
参数解释: 备份周期类型,目前支持“weekly”。由自动切换为手动时,保留自动备份策略信息。 取值范围: 不涉及。 |
begin_at |
是 |
String |
参数解释: 备份开始执行时间,该时间为UTC时间,例如“00:00-01:00”代表UTC时间0点开始执行备份。只能是整点时间段,间隔时间限定为一个小时。由自动切换为手动时,保留自动备份策略信息。 取值范围: 不涉及。 |
响应参数
状态码:204
修改缓存实例成功。
无
请求示例
修改指定实例的信息,修改实例名称为dcs002,端口为6379,设置自动备份策略。
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"
}
}
}
响应示例
无
SDK代码示例
SDK代码示例如下。
修改指定实例的信息,修改实例名称为dcs002,端口为6379,设置自动备份策略。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 |
package com.huaweicloud.sdk.test;
import com.huaweicloud.sdk.core.auth.ICredential;
import com.huaweicloud.sdk.core.auth.BasicCredentials;
import com.huaweicloud.sdk.core.exception.ConnectionException;
import com.huaweicloud.sdk.core.exception.RequestTimeoutException;
import com.huaweicloud.sdk.core.exception.ServiceResponseException;
import com.huaweicloud.sdk.dcs.v2.region.DcsRegion;
import com.huaweicloud.sdk.dcs.v2.*;
import com.huaweicloud.sdk.dcs.v2.model.*;
import java.util.List;
import java.util.ArrayList;
public class UpdateInstanceSolution {
public static void main(String[] args) {
// The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security.
// In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment
String ak = System.getenv("CLOUD_SDK_AK");
String sk = System.getenv("CLOUD_SDK_SK");
String projectId = "{project_id}";
ICredential auth = new BasicCredentials()
.withProjectId(projectId)
.withAk(ak)
.withSk(sk);
DcsClient client = DcsClient.newBuilder()
.withCredential(auth)
.withRegion(DcsRegion.valueOf("<YOUR REGION>"))
.build();
UpdateInstanceRequest request = new UpdateInstanceRequest();
request.withInstanceId("{instance_id}");
ModifyInstanceBody body = new ModifyInstanceBody();
List<Integer> listPeriodicalBackupPlanBackupAt = new ArrayList<>();
listPeriodicalBackupPlanBackupAt.add(1);
listPeriodicalBackupPlanBackupAt.add(2);
listPeriodicalBackupPlanBackupAt.add(3);
listPeriodicalBackupPlanBackupAt.add(4);
listPeriodicalBackupPlanBackupAt.add(6);
listPeriodicalBackupPlanBackupAt.add(7);
BackupPlan periodicalBackupPlanInstanceBackupPolicy = new BackupPlan();
periodicalBackupPlanInstanceBackupPolicy.withBackupAt(listPeriodicalBackupPlanBackupAt)
.withPeriodType("weekly")
.withBeginAt("00:00-01:00");
BackupPolicy instanceBackupPolicybody = new BackupPolicy();
instanceBackupPolicybody.withBackupType("auto")
.withSaveDays(1)
.withPeriodicalBackupPlan(periodicalBackupPlanInstanceBackupPolicy);
body.withInstanceBackupPolicy(instanceBackupPolicybody);
body.withSecurityGroupId("18e9309f-f81a-4749-bb21-f74576292162");
body.withMaintainEnd("19:00:00");
body.withMaintainBegin("18:00:00");
body.withPort(6379);
body.withDescription("instance description");
body.withName("dcs002");
request.withBody(body);
try {
UpdateInstanceResponse response = client.updateInstance(request);
System.out.println(response.toString());
} catch (ConnectionException e) {
e.printStackTrace();
} catch (RequestTimeoutException e) {
e.printStackTrace();
} catch (ServiceResponseException e) {
e.printStackTrace();
System.out.println(e.getHttpStatusCode());
System.out.println(e.getRequestId());
System.out.println(e.getErrorCode());
System.out.println(e.getErrorMsg());
}
}
}
|
修改指定实例的信息,修改实例名称为dcs002,端口为6379,设置自动备份策略。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
# coding: utf-8
import os
from huaweicloudsdkcore.auth.credentials import BasicCredentials
from huaweicloudsdkdcs.v2.region.dcs_region import DcsRegion
from huaweicloudsdkcore.exceptions import exceptions
from huaweicloudsdkdcs.v2 import *
if __name__ == "__main__":
# The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security.
# In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment
ak = os.environ["CLOUD_SDK_AK"]
sk = os.environ["CLOUD_SDK_SK"]
projectId = "{project_id}"
credentials = BasicCredentials(ak, sk, projectId)
client = DcsClient.new_builder() \
.with_credentials(credentials) \
.with_region(DcsRegion.value_of("<YOUR REGION>")) \
.build()
try:
request = UpdateInstanceRequest()
request.instance_id = "{instance_id}"
listBackupAtPeriodicalBackupPlan = [
1,
2,
3,
4,
6,
7
]
periodicalBackupPlanInstanceBackupPolicy = BackupPlan(
backup_at=listBackupAtPeriodicalBackupPlan,
period_type="weekly",
begin_at="00:00-01:00"
)
instanceBackupPolicybody = BackupPolicy(
backup_type="auto",
save_days=1,
periodical_backup_plan=periodicalBackupPlanInstanceBackupPolicy
)
request.body = ModifyInstanceBody(
instance_backup_policy=instanceBackupPolicybody,
security_group_id="18e9309f-f81a-4749-bb21-f74576292162",
maintain_end="19:00:00",
maintain_begin="18:00:00",
port=6379,
description="instance description",
name="dcs002"
)
response = client.update_instance(request)
print(response)
except exceptions.ClientRequestException as e:
print(e.status_code)
print(e.request_id)
print(e.error_code)
print(e.error_msg)
|
修改指定实例的信息,修改实例名称为dcs002,端口为6379,设置自动备份策略。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 |
package main
import (
"fmt"
"github.com/huaweicloud/huaweicloud-sdk-go-v3/core/auth/basic"
dcs "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/dcs/v2"
"github.com/huaweicloud/huaweicloud-sdk-go-v3/services/dcs/v2/model"
region "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/dcs/v2/region"
)
func main() {
// The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security.
// In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment
ak := os.Getenv("CLOUD_SDK_AK")
sk := os.Getenv("CLOUD_SDK_SK")
projectId := "{project_id}"
auth := basic.NewCredentialsBuilder().
WithAk(ak).
WithSk(sk).
WithProjectId(projectId).
Build()
client := dcs.NewDcsClient(
dcs.DcsClientBuilder().
WithRegion(region.ValueOf("<YOUR REGION>")).
WithCredential(auth).
Build())
request := &model.UpdateInstanceRequest{}
request.InstanceId = "{instance_id}"
var listBackupAtPeriodicalBackupPlan = []int32{
int32(1),
int32(2),
int32(3),
int32(4),
int32(6),
int32(7),
}
periodicalBackupPlanInstanceBackupPolicy := &model.BackupPlan{
BackupAt: listBackupAtPeriodicalBackupPlan,
PeriodType: "weekly",
BeginAt: "00:00-01:00",
}
saveDaysInstanceBackupPolicy:= int32(1)
instanceBackupPolicybody := &model.BackupPolicy{
BackupType: "auto",
SaveDays: &saveDaysInstanceBackupPolicy,
PeriodicalBackupPlan: periodicalBackupPlanInstanceBackupPolicy,
}
securityGroupIdModifyInstanceBody:= "18e9309f-f81a-4749-bb21-f74576292162"
maintainEndModifyInstanceBody:= "19:00:00"
maintainBeginModifyInstanceBody:= "18:00:00"
portModifyInstanceBody:= int32(6379)
descriptionModifyInstanceBody:= "instance description"
nameModifyInstanceBody:= "dcs002"
request.Body = &model.ModifyInstanceBody{
InstanceBackupPolicy: instanceBackupPolicybody,
SecurityGroupId: &securityGroupIdModifyInstanceBody,
MaintainEnd: &maintainEndModifyInstanceBody,
MaintainBegin: &maintainBeginModifyInstanceBody,
Port: &portModifyInstanceBody,
Description: &descriptionModifyInstanceBody,
Name: &nameModifyInstanceBody,
}
response, err := client.UpdateInstance(request)
if err == nil {
fmt.Printf("%+v\n", response)
} else {
fmt.Println(err)
}
}
|
更多编程语言的SDK代码示例,请参见API Explorer的代码示例页签,可生成自动对应的SDK代码示例。
修改指定实例的信息,修改实例名称为dcs002,端口为6379,设置自动备份策略。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 |
package com.huaweicloud.sdk.test;
import com.huaweicloud.sdk.core.auth.ICredential;
import com.huaweicloud.sdk.core.auth.BasicCredentials;
import com.huaweicloud.sdk.core.exception.ConnectionException;
import com.huaweicloud.sdk.core.exception.RequestTimeoutException;
import com.huaweicloud.sdk.core.exception.ServiceResponseException;
import com.huaweicloud.sdk.dcs.v2.region.DcsRegion;
import com.huaweicloud.sdk.dcs.v2.*;
import com.huaweicloud.sdk.dcs.v2.model.*;
import java.util.List;
import java.util.ArrayList;
public class UpdateInstanceSolution {
public static void main(String[] args) {
// The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security.
// In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment
String ak = System.getenv("CLOUD_SDK_AK");
String sk = System.getenv("CLOUD_SDK_SK");
String projectId = "{project_id}";
ICredential auth = new BasicCredentials()
.withProjectId(projectId)
.withAk(ak)
.withSk(sk);
DcsClient client = DcsClient.newBuilder()
.withCredential(auth)
.withRegion(DcsRegion.valueOf("<YOUR REGION>"))
.build();
UpdateInstanceRequest request = new UpdateInstanceRequest();
request.withInstanceId("{instance_id}");
ModifyInstanceBody body = new ModifyInstanceBody();
List<Integer> listPeriodicalBackupPlanBackupAt = new ArrayList<>();
listPeriodicalBackupPlanBackupAt.add(1);
listPeriodicalBackupPlanBackupAt.add(2);
listPeriodicalBackupPlanBackupAt.add(3);
listPeriodicalBackupPlanBackupAt.add(4);
listPeriodicalBackupPlanBackupAt.add(6);
listPeriodicalBackupPlanBackupAt.add(7);
BackupPlan periodicalBackupPlanInstanceBackupPolicy = new BackupPlan();
periodicalBackupPlanInstanceBackupPolicy.withBackupAt(listPeriodicalBackupPlanBackupAt)
.withPeriodType("weekly")
.withBeginAt("00:00-01:00");
BackupPolicy instanceBackupPolicybody = new BackupPolicy();
instanceBackupPolicybody.withBackupType("auto")
.withSaveDays(1)
.withPeriodicalBackupPlan(periodicalBackupPlanInstanceBackupPolicy);
body.withInstanceBackupPolicy(instanceBackupPolicybody);
body.withSecurityGroupId("18e9309f-f81a-4749-bb21-f74576292162");
body.withMaintainEnd("19:00:00");
body.withMaintainBegin("18:00:00");
body.withPort(6379);
body.withDescription("instance description");
body.withName("dcs002");
request.withBody(body);
try {
UpdateInstanceResponse response = client.updateInstance(request);
System.out.println(response.toString());
} catch (ConnectionException e) {
e.printStackTrace();
} catch (RequestTimeoutException e) {
e.printStackTrace();
} catch (ServiceResponseException e) {
e.printStackTrace();
System.out.println(e.getHttpStatusCode());
System.out.println(e.getRequestId());
System.out.println(e.getErrorCode());
System.out.println(e.getErrorMsg());
}
}
}
|
修改指定实例的信息,修改实例名称为dcs002,端口为6379,设置自动备份策略。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
# coding: utf-8
import os
from huaweicloudsdkcore.auth.credentials import BasicCredentials
from huaweicloudsdkdcs.v2.region.dcs_region import DcsRegion
from huaweicloudsdkcore.exceptions import exceptions
from huaweicloudsdkdcs.v2 import *
if __name__ == "__main__":
# The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security.
# In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment
ak = os.environ["CLOUD_SDK_AK"]
sk = os.environ["CLOUD_SDK_SK"]
projectId = "{project_id}"
credentials = BasicCredentials(ak, sk, projectId)
client = DcsClient.new_builder() \
.with_credentials(credentials) \
.with_region(DcsRegion.value_of("<YOUR REGION>")) \
.build()
try:
request = UpdateInstanceRequest()
request.instance_id = "{instance_id}"
listBackupAtPeriodicalBackupPlan = [
1,
2,
3,
4,
6,
7
]
periodicalBackupPlanInstanceBackupPolicy = BackupPlan(
backup_at=listBackupAtPeriodicalBackupPlan,
period_type="weekly",
begin_at="00:00-01:00"
)
instanceBackupPolicybody = BackupPolicy(
backup_type="auto",
save_days=1,
periodical_backup_plan=periodicalBackupPlanInstanceBackupPolicy
)
request.body = ModifyInstanceBody(
instance_backup_policy=instanceBackupPolicybody,
security_group_id="18e9309f-f81a-4749-bb21-f74576292162",
maintain_end="19:00:00",
maintain_begin="18:00:00",
port=6379,
description="instance description",
name="dcs002"
)
response = client.update_instance(request)
print(response)
except exceptions.ClientRequestException as e:
print(e.status_code)
print(e.request_id)
print(e.error_code)
print(e.error_msg)
|
修改指定实例的信息,修改实例名称为dcs002,端口为6379,设置自动备份策略。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 |
package main
import (
"fmt"
"github.com/huaweicloud/huaweicloud-sdk-go-v3/core/auth/basic"
dcs "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/dcs/v2"
"github.com/huaweicloud/huaweicloud-sdk-go-v3/services/dcs/v2/model"
region "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/dcs/v2/region"
)
func main() {
// The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security.
// In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment
ak := os.Getenv("CLOUD_SDK_AK")
sk := os.Getenv("CLOUD_SDK_SK")
projectId := "{project_id}"
auth := basic.NewCredentialsBuilder().
WithAk(ak).
WithSk(sk).
WithProjectId(projectId).
Build()
client := dcs.NewDcsClient(
dcs.DcsClientBuilder().
WithRegion(region.ValueOf("<YOUR REGION>")).
WithCredential(auth).
Build())
request := &model.UpdateInstanceRequest{}
request.InstanceId = "{instance_id}"
var listBackupAtPeriodicalBackupPlan = []int32{
int32(1),
int32(2),
int32(3),
int32(4),
int32(6),
int32(7),
}
periodicalBackupPlanInstanceBackupPolicy := &model.BackupPlan{
BackupAt: listBackupAtPeriodicalBackupPlan,
PeriodType: "weekly",
BeginAt: "00:00-01:00",
}
saveDaysInstanceBackupPolicy:= int32(1)
instanceBackupPolicybody := &model.BackupPolicy{
BackupType: "auto",
SaveDays: &saveDaysInstanceBackupPolicy,
PeriodicalBackupPlan: periodicalBackupPlanInstanceBackupPolicy,
}
securityGroupIdModifyInstanceBody:= "18e9309f-f81a-4749-bb21-f74576292162"
maintainEndModifyInstanceBody:= "19:00:00"
maintainBeginModifyInstanceBody:= "18:00:00"
portModifyInstanceBody:= int32(6379)
descriptionModifyInstanceBody:= "instance description"
nameModifyInstanceBody:= "dcs002"
request.Body = &model.ModifyInstanceBody{
InstanceBackupPolicy: instanceBackupPolicybody,
SecurityGroupId: &securityGroupIdModifyInstanceBody,
MaintainEnd: &maintainEndModifyInstanceBody,
MaintainBegin: &maintainBeginModifyInstanceBody,
Port: &portModifyInstanceBody,
Description: &descriptionModifyInstanceBody,
Name: &nameModifyInstanceBody,
}
response, err := client.UpdateInstance(request)
if err == nil {
fmt.Printf("%+v\n", response)
} else {
fmt.Println(err)
}
}
|
更多编程语言的SDK代码示例,请参见API Explorer的代码示例页签,可生成自动对应的SDK代码示例。
状态码
状态码 |
描述 |
---|---|
204 |
修改缓存实例成功。 |
400 |
非法请求。 |
500 |
内部服务错误。 |
错误码
请参见错误码。