This topic describes how to modify the primary zone of a tenant through an API.
Request parameters
| Parameter | Type | Required | Example | Description |
|---|---|---|---|---|
| primary_zone | string | Yes | RANDOM | The priority of the zone where the tenant provides read and write services. For example, primary_zone ='zone1;zone2,zone3' indicates that the tenant is provided with read and write services by zone1 first, followed by zone2 and zone3, which are at the same priority. |
Request example
PUT 10.10.10.1:2886/api/v1/tenant/t1/primary-zone
{
"primary_zone": "random"
}
Response example
{
"successful": true,
"timestamp": "2024-10-14T11:47:56.785867645+08:00",
"duration": 140,
"status": 200,
"traceId": "aaef4804b636d263",
"data": {
"id": "16",
"dag_id": 6,
"name": "Modify tenant primary zone",
"stage": 1,
"max_stage": 1,
"state": "READY",
"operator": "RUN",
"start_time": "0001-01-01T00:00:00Z",
"end_time": "0001-01-01T00:00:00Z",
"additional_data": null,
"nodes": null
}
}
References
You can also call the API through SDKs.
For more information about how to call the API through obshell-sdk-python, see Modify the primary zone of a tenant.
For more information about how to call the API through obshell-sdk-go, see Modify the primary zone of a tenant.