This topic describes how to create a resource unit configuration by using obshell-sdk-go.
Note
We recommend that you first view Get started with obshell-sdk-go to learn how to use obshell-sdk-go.
Considerations
Make sure that obshell is running.
The node corresponding to the client 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().CreateResourceUnitConfig("s1", "5G", 8); err != nil {
fmt.Print(err)
return
}
}
References
For more information about the API for creating a resource unit configuration, see Create a resource unit configuration.
For more information about how to request an API method by using obshell-sdk-python, see Create a resource unit configuration.