runzero.api.sites
¶
Management of an organization’s sites.
Module Contents¶
Classes¶
|
|
Management of runZero sites. |
- class runzero.api.sites.Sites(client: runzero.client.Client)[source]¶
Management of runZero sites.
Assets, tasks, and other objects are contained within or associated with Sites.
- Parameters:
client (runzero.client.Client) – A handle to the
runzero.Client
client which manages interactions with the runZero server.
Constructor method
- create(org_id: uuid.UUID, site_options: runzero.types.SiteOptions) runzero.types.Site | None [source]¶
Creates a new site in the given org.
- Parameters:
org_id (uuid.UUID) – The ID of the organization to operate against
site_options (runzero.types.SiteOptions) – Description of site to create
- Returns:
Site created or None
- Raises:
AuthError, ClientError, ServerError
- Return type:
Optional[runzero.types.Site]
- get(org_id: uuid.UUID, name: str | None = None, site_id: uuid.UUID | None = None) runzero.types.Site | None [source]¶
Retrieves the runZero Site with the provided name or id, if it exists in your account
- Parameters:
- Returns:
site requested or None
- Raises:
AuthError, ClientError, ServerError, ValueError if neither site_id nor name are provided.
- Return type:
Optional[runzero.types.Site]
- get_all(org_id: uuid.UUID) List[runzero.types.Site] [source]¶
Retrieves all runZero Sites available within the given organization
- Parameters:
org_id (uuid.UUID) – The ID of the organization to operate against
- Returns:
a list of all Sites available within the given organization
- Raises:
AuthError, ClientError, ServerError
- Return type:
List[runzero.types.Site]
- update(org_id: uuid.UUID, site_id: uuid.UUID, site_options: runzero.types.SiteOptions) runzero.types.Site | None [source]¶
Updates a site associated with your organization.
- Parameters:
- Returns:
Site updated or None
- Raises:
AuthError, ClientError, ServerError
- Return type:
Optional[runzero.types.Site]