Changes the virtual private cloud (VPC) or vSwitch of an ApsaraDB for Redis instance. If the instance is deployed in the classic network, the network type of the instance is changed from the classic network to VPC.
Debugging
Authorization information
The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action
policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:
- Operation: the value that you can use in the Action element to specify the operation on a resource.
- Access level: the access level of each operation. The levels are read, write, and list.
- Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
- The required resource types are displayed in bold characters.
- If the permissions cannot be granted at the resource level,
All Resources
is used in the Resource type column of the operation.
- Condition Key: the condition key that is defined by the cloud service.
- Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
Operation | Access level | Resource type | Condition key | Associated operation |
---|---|---|---|---|
kvstore:SwitchNetwork | WRITE |
|
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
TargetNetworkType | string | No | The network type to which you want to switch. Set the value to VPC. Enumeration Value:
| VPC |
VpcId | string | Yes | The ID of the VPC to which you want to switch. You can call the DescribeVpcs operation to query VPC IDs. Note
| vpc-bp1nme44gek34slfc**** |
VSwitchId | string | Yes | The ID of the vSwitch that belongs to the VPC to which you want to switch. You can call the DescribeVpcs operation to query vSwitch IDs. Note
The vSwitch and the ApsaraDB for Redis instance must belong to the same zone.
| vsw-bp1e7clcw529l773d**** |
InstanceId | string | Yes | The ID of the instance. You can call the DescribeInstances operation to query instance IDs. | r-bp1zxszhcgatnx**** |
RetainClassic | string | No | Specifies whether to retain the original endpoint for the classic network after you switch the instance from classic network to VPC. Valid values:
Note
This parameter can be used only when the network type of the instance is classic network.
| True |
ClassicExpiredDays | string | No | The retention period of the endpoint for the classic network. Valid values: 14, 30, 60, and 120. Unit: days. Note
| 30 |
Response parameters
Examples
Sample success responses
JSON
format
{
"TaskId": "578678678",
"RequestId": "F0997EE8-F4C2-4503-9168-85177ED78C70"
}
Error codes
HTTP status code | Error code | Error message | Description |
---|---|---|---|
400 | InvalidToken.Malformed | The Specified parameter Token is not valid. | - |
400 | VpcServiceError | Invoke vpc service failed. | - |
400 | IzNotSupportVpcError | Specify iz not support vpc. | The specified iz does not support VPCs. |
400 | IzNotSupportSwitchNetworkError | Specify iz not support switch network. | The specified iz does not support network switching. |
400 | VpcVerifyError | VpcId is wrong. | - |
403 | ResourceAlreadyExists | Resource already exists. | - |
403 | InsufficientResourceCapacity | ip resource is conflict with other custins. | - |
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
2023-07-20 | API Description Update. The Error code has changed | see changesets | ||||||||
|