This topic describes how to use obshell-sdk-go to modify the status of cluster-level log archiving.
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 with the node address as '10.10.10.1' and the port as 2886.
client, err := services.NewClientWithPassword("10.10.10.1", 2886, "****")
if err != nil {
panic(err)
}
request := client.V1().NewClusterLogStatusPatchRequest()
request.SetStatus("stop")
err = client.V1().ClusterLogStatusWithPatchRequest(request)
if err != nil {
panic(err)
}
}
References
For more information about the API for modifying the status of cluster-level log archiving, see Modify the status of cluster-level log archiving.
For more information about how to request API methods by using obshell-sdk-python, see Modify the status of cluster-level log archiving.