This topic describes how to rename a tenant by using the API.
Request parameters
| Parameter | Type | Required | Example | Description |
|---|---|---|---|---|
| new_name | string | Yes | t2 | The new name of the tenant. |
Request path
PUT /api/v1/tenant/:name/name
Request parameters
| Parameter | Type | Required | Example | Description |
|---|---|---|---|---|
| new_name | string | Yes | t2 | The new name of the tenant. |
Response parameters
| Parameter | Type | Description |
|---|---|---|
| successful | bool | Whether the request is successful. |
| timestamp | time.Time | The timestamp when the server received the request. |
| duration | int | The time (in milliseconds) taken by the server to process the request. |
| status | int | The HTTP status code. |
| traceId | string | The Trace ID of the request. |
| error | ApiError | The error information returned by the request, including the following fields:
|
Examples
Request example
PUT 10.10.10.1:2886/api/v1/tenant/t1/name
{
"new_name": "t2"
}
Response example
{
"successful": true,
"timestamp": "2024-10-14T14:35:22.228258964+08:00",
"duration": 79,
"status": 200,
"traceId": "9495a4d5fff255ce"
}
References
You can also call API methods by using SDKs.
For more information about how to call the API method by using obshell-sdk-python, see Rename a tenant.
For more information about how to call the API method by using obshell-sdk-go, see Rename a tenant.