This topic describes how to restore a single tenant by using obshell-sdk-python.
Note
We recommend that you first read Get started with obshell-sdk-python to learn how to use obshell-sdk-python.
Considerations
Make sure that obshell is running.
The node corresponding to the client must be in an initialized cluster.
Sample code
The following example shows how to perform a task synchronously:
from obshell import ClientSet
from obshell.auth import PasswordAuth
# Create a client instance with the node address '10.10.10.1' and port 2886.
client = ClientSet("10.10.10.1", 2886, PassswordAuth("****"))
client.v1.post_tenant_restore_sync(
data_backup_uri="file:///data/backup/data",
tenant_name="rt2",
zone_list=[
tenant.ZoneParam("zone1", "unit1",1),
],
archive_log_uri="file:///data/backup/archive",
)
References
For more information about the API for initiating a tenant restore, see Initiate a tenant restore.
For more information about how to request API methods by using obshell-sdk-go, see Restore a single tenant.