This topic describes how to modify tenant parameters in batches using obshell-sdk-go.
Note
We recommend that you first read through the Quick start section of obshell-sdk-go to understand how to use it.
Considerations
Ensure that obshell is running normally.
Ensure the tenant already exists and its status is NORMAL.
The node corresponding to the requesting client must be within the initialized cluster.
Sample code
package main
import (
"fmt"
"github.com/oceanbase/obshell-sdk-go/services"
)
func main() {
// Create a client instance with the node address '10.10.10.1' and port 2886.
client, err := services.NewClientWithPassword("10.10.10.1", 2886, "****")
if err != nil {
fmt.Print(err)
return
}
if err := client.V1().SetTenantParameters("t1", map[string]interface{}{
"backup_data_file_size": "2G",
"arbitration_timeout": "10s",
}); err != nil {
fmt.Print(err)
return
}
}
References
For more information about the API for modifying tenant parameters, see Modify tenant parameters.
For more information about how to request the API method using obshell-sdk-python, see Modify tenant parameters.
