SWR API

The Software Repository for Containers Service Class

SoftWare Repository for Container (SWR) high-level interface is available through the swr member of a Connection object. The swr member will only be added if the otcextensions.sdk.register_otc_extensions(conn) method is called.

Organization Operations

class otcextensions.sdk.swr.v2._proxy.Proxy(session, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None, *args, **kwargs)
create_organization(**attrs)

Create a new organization from attributes

Parameters:

attrs (dict) – Keyword arguments which will be used to create a Organization, comprised of the properties on the Organization class.

Returns:

The results of organization creation

Return type:

Organization

get_organization(*attrs)

Get an organization

Returns:

One Organization

organizations(**query)

Retrieve a generator of organizations

Returns:

A generator of organization instances

delete_organization(namespace, ignore_missing=True)

Delete an organization

Parameters:
  • namespace – The namespace can be either the name or a Organization instance

  • ignore_missing (bool) – When set to False ResourceNotFound will be raised when the load balancer does not exist. When set to True, no exception will be set when attempting to delete a nonexistent organization.

Returns:

None

find_organization(name_or_id, ignore_missing=True)

Find a single organization

Parameters:
  • name_or_id – The name or ID of an organization

  • ignore_missing (bool) – When set to False ResourceNotFound will be raised when the organization does not exist. When set to True, no exception will be set when attempting to delete a nonexistent organization.

Returns:

None

Organization Permissions Operations

class otcextensions.sdk.swr.v2._proxy.Proxy(session, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None, *args, **kwargs)
create_organization_permissions(**attrs)

Create a new organization from attributes

Parameters:

attrs (dict) – Keyword arguments which will be used to create a Organization, comprised of the properties on the Organization class.

Returns:

The results of organization creation

Return type:

Permission

organization_permissions(namespace, **query)

Retrieve a generator of organization permissions

Returns:

A generator of organization permissions instances

delete_organization_permissions(namespace, user_ids, ignore_missing=True)

Delete an organization permissions

Parameters:
  • user_ids – Users IDs whose permissions need to be deleted.

  • namespace – The namespace can be either the name or a Permission instance

  • ignore_missing (bool) – When set to False ResourceNotFound will be raised when the load balancer does not exist. When set to True, no exception will be set when attempting to delete a nonexistent permission.

Returns:

None

update_organization_permissions(**attrs)

Update an organization permissions

Parameters:

attrs (dict) – The attributes to update on the permissions represented by permissions.

Returns:

The updated permissions.

Return type:

Permission

Repository Operations

class otcextensions.sdk.swr.v2._proxy.Proxy(session, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None, *args, **kwargs)
create_repository(**attrs)

Create a new image repository from attributes

Parameters:

attrs (dict) – Keyword arguments which will be used to create a Repository, comprised of the properties on the Repository class.

Returns:

The results of organization creation

Return type:

Repository

delete_repository(namespace, repository, ignore_missing=True)

Delete a repository

Parameters:
  • repository – Image repository name need to be deleted.

  • namespace – The namespace can be either the name or a Repository instance

  • ignore_missing (bool) – When set to False ResourceNotFound will be raised when the load balancer does not exist. When set to True, no exception will be set when attempting to delete a nonexistent repository.

Returns:

None

get_repository(namespace, repository)

Get a repository

Returns:

One Repository

repositories(**query)

Retrieve a generator of repositories

Returns:

A generator of repositories instances

update_repository(**attrs)

Update a repository

Parameters:

attrs (dict) – The attributes to update on the repository represented by repository.

Returns:

The updated repository.

Return type:

Repository

Repository Permissions Operations

class otcextensions.sdk.swr.v2._proxy.Proxy(session, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None, *args, **kwargs)
create_repository_permissions(**attrs)

Create a new repository permissions from attributes

Parameters:

attrs (dict) – Keyword arguments which will be used to create a Permission, comprised of the properties on the Permission class.

Returns:

The results of repository permission creation

Return type:

Permission

repository_permissions(namespace, repository, **query)

Retrieve a generator of repository permissions

Returns:

A generator of repository permissions instances

delete_repository_permissions(namespace, repository, user_ids, ignore_missing=True)

Delete a repository permissions

Parameters:
  • repository – The repository can be either the name or a Permission instance

  • user_ids – Users IDs whose permissions need to be deleted.

  • namespace – The namespace can be either the name or a Permission instance

  • ignore_missing (bool) – When set to False ResourceNotFound will be raised when the load balancer does not exist. When set to True, no exception will be set when attempting to delete a nonexistent permission.

Returns:

None

update_repository_permissions(**attrs)

Update a repository permissions

Parameters:

attrs (dict) – The attributes to update on the permissions represented by permissions.

Returns:

The updated permissions.

Return type:

Permission

Domain Operations

class otcextensions.sdk.swr.v2._proxy.Proxy(session, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None, *args, **kwargs)
create_domain(**attrs)

Create a new image repository from attributes

Parameters:

attrs (dict) – Keyword arguments which will be used to create a Domain, comprised of the properties on the Repository class.

Returns:

The results of organization creation

Return type:

Domain

delete_domain(namespace, repository, access_domain, ignore_missing=True)

Delete a domain

Parameters:
  • access_domain – Name of the account need to be deleted.

  • repository – Image repository name.

  • namespace – Organization name.

  • ignore_missing (bool) – When set to False ResourceNotFound will be raised when the load balancer does not exist. When set to True, no exception will be set when attempting to delete a nonexistent repository.

Returns:

None

domains(**query)

Retrieve a generator of domains

Returns:

A generator of domain instances

update_domain(**attrs)

Update a domain

Parameters:

attrs (dict) – The attributes to update on the domain represented by permissions.

Returns:

The updated domain.

Return type:

Domain

get_domain(namespace, repository, access_domain)

Get a domain

Returns:

One Domain