This topic describes how to query the specifications of a specified resource 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 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
}
unitConfig, err := client.V1().GetUnitConfig("s1")
if err != nil {
fmt.Print(err)
return
}
fmt.Print(unitConfig)
}
References
For more information about the API for querying the specifications of a specified resource, see Query the specifications of a specified resource.
For more information about how to request API methods by using obshell-sdk-python, see Query the specifications of a specified resource.