This topic describes how to download the required RPM packages by using obshell-sdk-python.
Note
Before you proceed, we recommend that you read Quick Start to learn how to use obshell-sdk-python.
Sample code
Download the latest RPM package
from obshell import download_package # Download the latest obshell package of the same architecture and system as the local machine to the specified directory. def download_same_arch(): dest = download_package("/root/download", "obshell") print (dest)Download an RPM package of a specified version
from obshell import download_package # Download the community edition of OceanBase Database of the specified version of the same architecture and system as the local machine. def download_same_arch_version(): dest = download_package("/root/download", "oceanbase-ce", version="4.3.5.0") print (dest)
Download the latest RPM package
from obshell.mirror import BASE_COMMUNITY_MIRROR, EL8, AARCH64 # Download the latest obshell package of a different architecture. def download_diff_arch(): # Specify the architecture and system as aarch64 and el8, respectively. mirror = BASE_COMMUNITY_MIRROR.get_mirror(EL8, AARCH64) dest = mirror.download("/root/download", "obshell") print (dest)Download an RPM package of a specified version
from obshell.mirror import BASE_COMMUNITY_MIRROR, EL8, AARCH64 # Download an obshell package of a specified version of a different architecture. def download_diff_arch_version(): # Specify the architecture and system as aarch64 and el8, respectively. mirror = BASE_COMMUNITY_MIRROR.get_mirror(EL8, AARCH64) dest = mirror.download("/root/download", "obshell", version="4.2.4.0") print (dest)
References
For more information about how to request an API method by using the obshell-sdk-go SDK, see Download an RPM package.