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, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None, *args, **kwargs)
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