DeH API

The Dedicated Host Service Class

The dehs high-level interface is available through the deh member of a Connection object. The deh member will only be added if the otcextensions.sdk.register_otc_extensions(conn) method is called.

Host Operations

class otcextensions.sdk.deh.v1._proxy.Proxy(session: session.Session, *, service_type: str | None = None, service_name: str | None = None, interface: str | None = None, region_name: str | None = None, endpoint_override: str | None = None, version: str | None = None, auth: plugin.BaseAuthPlugin | None = None, user_agent: str | None = None, connect_retries: int | None = None, logger: logging.Logger | None = None, allow: dict[str, ty.Any] | None = None, additional_headers: collections.abc.MutableMapping[str, str] | None = None, client_name: str | None = None, client_version: str | None = None, allow_version_hack: bool | None = None, global_request_id: str | None = None, min_version: str | None = None, max_version: str | None = None, default_microversion: str | None = None, status_code_retries: int | None = None, retriable_status_codes: list[int] | None = None, raise_exc: bool | None = None, rate_limit: float | None = None, concurrency: int | None = None, connect_retry_delay: float | None = None, status_code_retry_delay: float | None = None, statsd_client: statsd_client.StatsClient | None = None, statsd_prefix: str | None = None, prometheus_counter: prometheus_client.Counter | None = None, prometheus_histogram: prometheus_client.Histogram | None = None, influxdb_config: dict[str, ty.Any] | None = None, influxdb_client: influxdb_client.InfluxDBClient | None = None)
hosts(**query)

Retrieve a generator of hosts

Parameters:

query (dict) –

Optional query parameters to be sent to limit the resources being returned.

  • marker: pagination marker.

  • limit: pagination limit.

  • id: Specifies DeH ID.

  • name: Specifies the DeH name.

  • host_type: Specifes the DeH type.

  • host_type_name: Specifes the DeH name of type.

  • flavor: Specifies flavor ID.

  • state: Specifies the DeH status.

    The value can be available, fault or released.

  • tenant: The value can be Tenant ID or all.

    Permits administrator.

  • availability_host: Specifies the AZ to which the DeH belongs.

  • changes_since: Filters the response by a date and time

    stamp when the DeH last changed status (CCYY-MM-DDThh:mm:ss+hh:mm).

  • tags: Specifies tags to use as a filter.

Returns:

A generator of host Host instances

create_host(**attrs)

Create (allocate) a new host from attributes

Parameters:

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

Returns:

The results of host creation

Return type:

Host

get_host(host)

Get a host

Parameters:

host – The value can be the ID of a host or a Host instance.

Returns:

Host instance

Return type:

Host

delete_host(host, ignore_missing=True)

Delete (release) a host

Parameters:
  • host – The value can be the ID of a host or a Host instance.

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

Returns:

host been deleted

Return type:

Host

update_host(host, **attrs)

Update host attributes

Parameters:
  • host – The id or an instance of Host

  • attrs (dict) – attributes for update on Host

Return type:

Host

find_host(name_or_id, ignore_missing=True)

Find a single host

Parameters:
  • name_or_id – The name or ID of a host

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

Returns:

None

servers(host, **query)

Retrieve a generator of servers

Parameters:
  • host – The name or ID of a host

  • query (dict) – Optional query parameters to be sent to limit the resources being returned. * marker: pagination marker * limit: pagination limit

Returns:

A generator of host Server instances

host_types(az)

Retrieve a generator of host types in AZ

Parameters:

az – The availability zone

Returns:

A generator of host HostType instances