This topic describes how to use obshell-sdk-python to query information about a specified resource unit.
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 query information about a specified resource unit:
from obshell import ClientSet
from obshell.auth import PasswordAuth
# Create a client instance. The node address is '10.10.10.1' and the port is 2886.
client = ClientSet("10.10.10.1", 2886, PassswordAuth("****"))
unit_config = client.v1.get_resource_unit_config("s1")
References
For more information about the API used to query information about a specified resource unit, see Query information about a specified resource unit.
For more information about how to use obshell-sdk-go to call the API, see Query information about a specified resource unit.