This topic describes how to initiate a cluster-level backup by using obshell-sdk-go.
Note
We recommend that you first check out obshell-sdk-go quick start to learn how to use obshell-sdk-go.
Considerations
Make sure that obshell is running properly.
The node corresponding to the client must be in an initialized cluster.
Sample code
package main
import (
"github.com/oceanbase/obshell-sdk-go/services"
)
func main() {
// Create a client instance with the node address of '10.10.10.1' and port 2886.
client, err := services.NewClientWithPassword("10.10.10.1", 2886, "****")
if err != nil {
panic(err)
}
request := client.V1().NewClusterBackupRequest()
request.SetBackupMode("full")
_, err = client.V1().ClusterBackupWithRequest(request)
if err != nil {
panic(err)
}
}
References
For more information about the API for initiating a cluster-level backup, see Initiate a cluster-level backup.
For more information about how to request an API by using obshell-sdk-python, see Initiate a cluster-level backup.