This topic describes how to modify the access whitelist of a 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.
Make sure that the tenant exists and is in the NORMAL state.
The node corresponding to the client in the request must be in an initialized cluster.
The default value is
127.0.0.1.
Sample code
The following sample code shows how to synchronize a task:
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.set_tenant_whitelist("t1", "%")
References
For more information about the API for modifying the access whitelist of a tenant, see Modify the access whitelist of a tenant.
For more information about how to call the API method by using obshell-sdk-go, see Modify the access whitelist of a tenant.