This topic describes how to unlock a tenant by using obshell-sdk-go.
Note
For more information about obshell-sdk-go, see Get started with 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 for 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 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().UnlockTenant("t1"); err != nil {
fmt.Print(err)
return
}
}
References
For more information about the API for unlocking a tenant, see Unlock a tenant.
For more information about how to call an API method by using obshell-sdk-python, see Unlock a tenant.