This topic describes how to query all resource specifications by using obshell-sdk-go.
Note
We recommend that you first read 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. The node address is '10.10.10.1' and the port is 2886.
client, err := services.NewClientWithPassword("10.10.10.4", 2886, "********")
if err != nil {
fmt.Print(err)
return
}
unitConfigs, err := client.V1().GetAllUnitConfigs()
if err != nil {
fmt.Print(err)
return
}
fmt.Print(unitConfigs)
}
References
For more information about the API for querying all resource specifications, see Query all resource specifications.
For more information about how to call the API by using obshell-sdk-python, see Query all resource specifications.