Overview
You can call this API to query the available zones of a read-only replica.
API details
Constraints
The caller must have an AccessKey for accessing the APIs. For information about how to obtain the AccessKey ID and AccessKey secret, see Manage AccessKeys.
Request path
GET api/v2/instances/{instanceId}/availableRoZones
Request parameters
Path
| Parameter | Type | Required | Description | Example value |
|---|---|---|---|---|
| instanceId | String | Yes | The ID of the instance. | obxxx |
Response parameters
| Parameter | Type | Description | Example value |
|---|---|---|---|
| data | Object | The returned data. | - |
| AvailableRoZones | arrayList | The list of available read-only replicas. | - |
| LogicalZone | String | The logical zone of the replica. | cn-hangzhou-i-ro-z0 |
| ReadOnlyReplicaType | String | The type of the read-only replica. Valid values:
|
ROW_STORE |
| ReadOnlyZoneOperations | Object | The operations supported by the read-only replica. | - |
| Permitted | Boolean | Indicates whether the operation is supported. | true |
| Deletable | Object | The delete operation. | For more information, see the table below. |
| Up | Object | The upgrade operation. | - |
| Down | Object | The downgrade operation. | - |
| ReplicaAliasName | String | The alias of the replica. | I-1 |
| ZoneCopyId | Integer | The replica ID. | 1 |
| ZoneId | String | The zone ID. | cn-hangzhou-i |
| ZoneReplicaType | String | The replica type. | READONLY |
| readonlyInstanceId | String | The ID of the read-only instance. | obroxxx |
| requestId | String | The ID of the request. | e4f17bc5-faad-42b8-b6e0-ca1e4e2a485a |
| success | Boolean | Indicates whether the operation was successful. | true |
Examples
Request example
curl --digest -u 'ak:sk' \
-X PUT \
'https://api-cloud.oceanbase.com/api/v2/instances/{instanceId}/availablerozones' \
--data '{
}'
Response example
JSON format
{
"data":{
"AvailableRoZones":[
{
"LogicalZone":"cn-hangzhou-i-ro-z0",
"ReadOnlyReplicaType":"ROW_STORE",
"ReadOnlyZoneOperations":{
//Delete operation
"Deletable":{
"Permitted":true,
"Reason":"NULL"
},
//Downgrade operation
"Down":{
//Storage space reduction for read-only replica
"RoDisksize":{
"Message":"The disk size has reached the minimum limit and cannot be reduced further.",
"Permitted":false,
"Reason":"READONLY_NODE_DISK_SIZE_IS_ALREADY_MIN"
},
//Node deletion for read-only replica
"RoNodenum":{
"Message":"The number of read-only replica nodes has reached the minimum limit.",
"Permitted":false,
"Reason":"READONLY_NODE_NUM_IS_ALREADY_MIN"
},
//Spec downgrade for read-only replica
"RoSpec":{
"Message":"No smaller specification is available for downgrade.",
"Permitted":false,
"Reason":"NO_MORE_SMALLER_SPEC"
}
},
"Permitted":true,
//Upgrade operation
"Up":{
//Storage space expansion for read-only replica
"RoDisksize":{
"Message":"The disk size has reached the maximum limit and cannot be expanded further.",
"Permitted":false,
"Reason":"READONLY_NODE_DISK_SIZE_IS_ALREADY_MAX"
},
//Node addition for read-only replica
"RoNodenum":{
"Message":"The number of read-only replica nodes has reached the maximum limit.",
"Permitted":false,
"Reason":"READONLY_NODE_NUM_IS_ALREADY_MAX"
},
//Spec upgrade for read-only replica
"RoSpec":{
"Permitted":true,
"Reason":"NULL"
}
}
},
//Name of the read-only replica
"ReplicaAliasName":"I-1",
"ZoneCopyId":1,
"ZoneId":"cn-hangzhou-i",
"ZoneReplicaType":"READONLY",
"readonlyInstanceId":"obxxx"
},
]
},
"requestId":"e4f17bc5-faad-42b8-b6e0-ca1e4e2a485a",
"success":true
}