sites.sdk package

Note

In order to install the python3 client, using pip, just run the command:

pip install sites-toolkit –user -U -i https://get.ecmwf.int/repository/pypi-all/simple

Or just configure your /etc/pip.conf with the following global settings:

And then, just run the command:

pip install -U sites-toolkit

Subpackages

Submodules

sites.sdk.api_urls module

class sites.sdk.api_urls.ApiUrls[source]

Utility class that holds all Version 1 Sites API URLs

CUSTOM_FORMATTER = <sites.sdk.api_urls.ApiUrls.CustomKwargsFormatter object>
class CustomKwargsFormatter[source]

This Formatter allows the use of kwargs

get_value(key, args, kwargs)[source]
class Hub[source]

Holds all Hub Version 1 API Urls

static health_url(**kwargs)[source]
static sites_health_url(**kwargs)[source]
static sites_publish(**kwargs)[source]
static sites_space_name_toggle_url(**kwargs)[source]
static sites_space_name_url(**kwargs)[source]
static sites_url(**kwargs)[source]
static whoami_url(**kwargs)[source]
class Site[source]

Hold all Site Version 1 API Urls

static files_url(**kwargs)[source]
static health_url(**kwargs)[source]
static signed_urls_url(**kwargs)[source]
static token_decode_url(**kwargs)[source]
static token_history_backup_url(**kwargs)[source]
static token_history_restore_url(**kwargs)[source]
static token_history_url(**kwargs)[source]
static token_url(**kwargs)[source]
static verify_signed_urls_url(**kwargs)[source]
static version_url(**kwargs)[source]

sites.sdk.client module

class sites.sdk.client.SitesClient(authenticator: AuthorizationBuilder | None = None, config: Configuration = <sites.sdk.common.configuration.Configuration object>)[source]

SitesClient to streamline Sites API calls.

Arguments to instantiate a SitesClient:

Parameters:
  • authenticatorAuthorizationBuilder - the authenticator to be used by default

  • configConfiguration - optional - optionally a new configuration object

content(site: Site, authenticator: AuthorizationBuilder | None = None) SiteContentManagement[source]

Creates a SiteContentManagement to manage the content for a specific site.

Parameters:
  • siteSite - the site to create the content manager

  • authenticatorAuthenticator - optional - optionally the authenticator for this specific site

Returns:

SiteContentManagement - the content manager for this site

create_site(site: Site) Dict[str, Any][source]

Create a new site using the provided payload and synchronize the local instance.

Parameters:

site – the Site to create

delete_site(site: Site) Dict[str, Any][source]

Remove the specified site from the platform.

health() Dict[str, Any][source]

Get the aggregated health status of the Sites platform.

list(owner: str | None = None, name: str | None = None, space: str | None = None, site_type: SiteType | None = None, query: str | None = None, enabled_only: bool = False) Dict[str, Any][source]

Fetch a list of sites filtered by ownership, name, space, type, search query, or status.

list_walk(owner: str | None = None, name: str | None = None, space: str | None = None, site_type: SiteType | None = None, enabled_only: bool = False) Iterator[Dict[str, Any]][source]

Yield sites lazily while preserving the filter options of list().

sites_health() Dict[str, Any][source]

Fetch health information specific to the Sites service layer.

toggle_site(site: Site) Dict[str, Any][source]

Enable or disable the given site depending on its current state.

update_site(space: str, name: str, site: Site) Dict[str, Any][source]

Update a remote site identified by space/name and refresh the local representation.

whoami() Dict[str, Any][source]

Return the authenticated user’s profile metadata.