This topic describes how to modify the access whitelist of a specified tenant by using the API.
Call procedure
If a password is set, you must authenticate. For more information, see API hybrid encryption.
Request path
PUT /api/v1/tenant/:name/whitelist
Request parameters
| Parameter | Type | Required | Example | Description |
|---|---|---|---|---|
| whitelist | string | Yes | % | The access whitelist of the tenant. |
Return results
| 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 ms) required 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 generated by the request, which contains the following information:
|
Examples
Request example
PUT 10.10.10.1:2886/api/v1/tenant/t1/whitelist
{
"whitelist": "%"
}
Response example
{
"successful": true,
"timestamp": "2024-10-14T11:42:12.873282458+08:00",
"duration": 91,
"status": 200,
"traceId": "e425830225b2b611"
}
References
You can also call the API by using the SDK.
For more information about how to call the API by using obshell-sdk-python, see Modify the access whitelist of a tenant.
For more information about how to call the API by using obshell-sdk-go, see Modify the access whitelist of a tenant.