This topic describes how to use the API to set system variables for a specified tenant. You can set multiple system variables for a tenant at a time.
Request parameters
| Parameter | Type | Required | Example | Description |
|---|---|---|---|---|
| variables | map[string]interface{} | Yes | { "max_connections": 1000, "recyclebin": true } |
The system variables of the specified tenant. |
Request
PUT /api/v1/tenant/:name/variables
Response
| Parameter | Type | Description |
|---|---|---|
| successful | bool | Indicates whether the request is successful. |
| timestamp | time.Time | The timestamp when the server completes the request. |
| duration | int | The time (in milliseconds) 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 during the request, which contains the following information:
|
Examples
Request
PUT 10.10.10.1:2886/api/v1/tenant/t1/variables
{
"variables": {
"max_connections": 1000,
"recyclebin": true
}
}
Response
{
"successful": true,
"timestamp": "2024-10-14T11:13:36.467293708+08:00",
"duration": 74,
"status": 200,
"traceId": "39ff86cca62a9ec0"
}
References
You can also call API methods through SDKs.
For more information about how to call the API method through obshell-sdk-python, see Modify tenant system variables.
For more information about how to call the API method through obshell-sdk-go, see Modify tenant system variables.