This topic describes how to restore a tenant from the recycle bin 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 with the node address set to '10.10.10.1' and the port set to 2886.
client, err := services.NewClientWithPassword("10.10.10.1", 2886, "****")
if err != nil {
fmt.Print(err)
return
}
if err := client.V1().FlashbackRecyclebinTenant("t1"); err != nil {
fmt.Print(err)
return
}
}
References
For more information about the API for restoring a tenant from the recycle bin, see Restore a tenant from the recycle bin.
For more information about how to call the API by using obshell-sdk-python, see Restore a tenant from the recycle bin.