This topic describes how to use obshell-sdk-go to modify tenant system variables. You can modify multiple variables at a time.
Note
We recommend that you first read obshell-sdk-go quick start to learn how to use obshell-sdk-go.
Considerations
Make sure that obshell is running.
Make sure that the tenant exists and is in the NORMAL state.
The node corresponding to the client in the request must be in an initialized cluster.
Sample code
package main
import (
"fmt"
"github.com/oceanbase/obshell-sdk-go/services"
)
func main() {
// Create a client instance, where the node address is '10.10.10.1' and the port is 2886.
client, err := services.NewClientWithPassword("10.10.10.1", 2886, "****")
if err != nil {
fmt.Print(err)
return
}
if err := client.V1().SetTenantVariables("t1", map[string]interface{}{
"max_connections": 1000,
"recyclebin": true,
}); err != nil {
fmt.Print(err)
return
}
}
References
For more information about the API for modifying tenant system variables, see Modify tenant system variables.
For more information about how to request API methods by using obshell-sdk-python, see Modify tenant system variables.