This topic describes how to upload an RPM package to an OceanBase cluster by using obshell-sdk-python.
Note
We recommend that you read Quick start for a better understanding of how to use obshell-sdk-python.
Considerations
Make sure that OceanBase Shell (obshell) runs normally.
Make sure that the node corresponding to the client instance that you use belongs to the cluster.
Sample code
from obshell import ClientSet
from obshell.auth import PasswordAuth
# Create a client instance, with the IP address of "10.10.10.1" and the port number of 2886.
# Enter the root@sys password "****" for the cluster.
client = ClientSet("10.10.10.1", 2886, PasswordAuth("****"))
# Upload an RPM package to the cluster.
client.v1.upload_pkg("data/upgrade/obshell-4.2.2.0-xxx.el7.x86_64.rpm")
References
For more information about the API operation, see UploadPkg.
For more information about how to call the API operation by using obshell-sdk-go, see Upload an RPM package.