This topic describes how to set the cluster-level backup configuration 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 (
"github.com/oceanbase/obshell-sdk-go/services"
)
func main() {
// Create a client instance, where the node address is '10.10.10.1' and the port is 2886.
client, err := services.NewClientWithPassword("10.10.10.1", 2886, "****")
if err != nil {
panic(err)
}
request := client.V1().NewClusterBackupConfigPostRequest("file:///data/backup")
request.SetLogArchiveConcurrency(100)
_, err = client.V1().ClusterBackupConfigSyncWithRequest(request)
if err != nil {
panic(err)
}
}
References
For more information about the API for setting the cluster-level backup configuration, see Set the cluster-level backup configuration.
For more information about how to call the API by using obshell-sdk-python, see Set the cluster-level backup configuration.