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
-
get_host
(host) Get a 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 toTrue
, no exception will be set when attempting to delete a nonexistent host.
- Returns
host been deleted
- Return type
-
update_host
(host, **attrs) Update host attributes
-
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 toTrue
, 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
-