Tenancies Class
Tenancies interface
Access to the tenancies endpoint.
The user is not expected to use this class directly. It is an attribute of the
Archivist
class.
For example instantiate an Archivist instance and execute the methods of the class:
with open(".auth_token", mode="r", encoding="utf-8") as tokenfile:
authtoken = tokenfile.read().strip()
# Initialize connection to Archivist
arch = Archivist(
"https://app.datatrails.ai",
authtoken,
)
tenancy = arch.tenancies.read(...)
- class archivist.tenancies._TenanciesClient(archivist_instance: Archivist)[source]
TenanciesClient
Access to tenants entities using CRUD interface. This class is usually accessed as an attribute of the Archivist class.
- Parameters:
archivist (Archivist) --
Archivist
instance
- publicinfo(identity: str) Tenant [source]
Read Tenant public info
Reads Tenant public info
- Parameters:
identity (str) -- tenancies identity e.g. tenancies/xxxxxxxxxxxxxxxxxxxxxxx or tenant/xxxxxxxxxxxxxxxxxxxxxxx
The tenant identity returned by most endpoints has the prefix 'tenant/'. However the tenancies endpoint expects 'tenancies/'. This is a wart in the archivist API and will be fixed at some future date.
- Returns:
Tenant
instance