DNS API¶
For details on how to use dns, see Using OpenStack DNS
The DNS Class¶
The dns high-level interface is available through the dns
member of a Connection
object. The
dns
member will only be added if the service is detected.
DNS Zone Operations¶
- class openstack.dns.v2._proxy.Proxy(session, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None, *args, **kwargs)
- zones(**query)
Retrieve a generator of zones
- Parameters:
query (dict) –
Optional query parameters to be sent to limit the resources being returned.
name: Zone Name field.
type: Zone Type field.
email: Zone email field.
status: Status of the zone.
ttl: TTL field filter.abs
description: Zone description field filter.
- Returns:
A generator of zone
Zone
instances.
- create_zone(**attrs)
Create a new zone from attributes
- get_zone(zone)
Get a zone
- delete_zone(zone, ignore_missing=True, delete_shares=False)
Delete a zone
- Parameters:
zone – The value can be the ID of a zone or a
Zone
instance.ignore_missing (bool) – When set to
False
NotFoundException
will be raised when the zone does not exist. When set toTrue
, no exception will be set when attempting to delete a nonexistent zone.delete_shares (bool) – When True, delete the zone shares along with the zone.
- Returns:
Zone been deleted
- Return type:
- find_zone(name_or_id, ignore_missing=True)
Find a single zone
- Parameters:
name_or_id – The name or ID of a zone
ignore_missing (bool) – When set to
False
NotFoundException
will be raised when the zone does not exist. When set toTrue
, no exception will be set when attempting to delete a nonexistent zone.
- Returns:
- abandon_zone(zone, **attrs)
Abandon Zone
- Parameters:
zone – The value can be the ID of a zone to be abandoned or a
ZoneExport
instance.- Returns:
None
- xfr_zone(zone, **attrs)
Trigger update of secondary Zone
- Parameters:
zone – The value can be the ID of a zone to be abandoned or a
ZoneExport
instance.- Returns:
None
Recordset Operations¶
- class openstack.dns.v2._proxy.Proxy(session, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None, *args, **kwargs)
- recordsets(zone=None, **query)
Retrieve a generator of recordsets
- Parameters:
zone – The optional value can be the ID of a zone or a
Zone
instance. If it is not given all recordsets for all zones of the tenant would be retrievedquery (dict) –
Optional query parameters to be sent to limit the resources being returned.
name: Recordset Name field.
type: Type field.
status: Status of the recordset.
ttl: TTL field filter.
description: Recordset description field filter.
- Returns:
A generator of zone (
Recordset
) instances
- create_recordset(zone, **attrs)
Create a new recordset in the zone
- update_recordset(recordset, **attrs)
Update Recordset attributes
- get_recordset(recordset, zone)
Get a recordset
- delete_recordset(recordset, zone=None, ignore_missing=True)
Delete a zone
- Parameters:
recordset – The value can be the ID of a recordset or a
Recordset
instance.zone – The value can be the ID of a zone or a
Zone
instance.ignore_missing (bool) – When set to
False
NotFoundException
will be raised when the zone does not exist. When set toTrue
, no exception will be set when attempting to delete a nonexistent zone.
- Returns:
Recordset instance been deleted
- Return type:
Zone Import Operations¶
- class openstack.dns.v2._proxy.Proxy(session, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None, *args, **kwargs)
- zone_imports(**query)
Retrieve a generator of zone imports
- Parameters:
query (dict) –
Optional query parameters to be sent to limit the resources being returned.
zone_id: Zone I field.
message: Message field.
status: Status of the zone import record.
- Returns:
A generator of zone
ZoneImport
instances.
- create_zone_import(**attrs)
Create a new zone import from attributes
- Parameters:
attrs (dict) – Keyword arguments which will be used to create a
ZoneImport
, comprised of the properties on the ZoneImport class.- Returns:
The results of zone creation.
- Return type:
- get_zone_import(zone_import)
Get a zone import record
- Parameters:
zone – The value can be the ID of a zone import or a
ZoneImport
instance.- Returns:
ZoneImport instance.
- Return type:
- delete_zone_import(zone_import, ignore_missing=True)
Delete a zone import
- Parameters:
zone_import – The value can be the ID of a zone import or a
ZoneImport
instance.ignore_missing (bool) – When set to
False
NotFoundException
will be raised when the zone does not exist. When set toTrue
, no exception will be set when attempting to delete a nonexistent zone.
- Returns:
None
Zone Export Operations¶
- class openstack.dns.v2._proxy.Proxy(session, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None, *args, **kwargs)
- zone_exports(**query)
Retrieve a generator of zone exports
- Parameters:
query (dict) –
Optional query parameters to be sent to limit the resources being returned.
zone_id: Zone I field.
message: Message field.
status: Status of the zone import record.
- Returns:
A generator of zone
ZoneExport
instances.
- create_zone_export(zone, **attrs)
Create a new zone export from attributes
- Parameters:
zone – The value can be the ID of a zone to be exported or a
ZoneExport
instance.attrs (dict) – Keyword arguments which will be used to create a
ZoneExport
, comprised of the properties on the ZoneExport class.
- Returns:
The results of zone creation.
- Return type:
- get_zone_export(zone_export)
Get a zone export record
- Parameters:
zone – The value can be the ID of a zone import or a
ZoneExport
instance.- Returns:
ZoneExport instance.
- Return type:
- get_zone_export_text(zone_export)
Get a zone export record as text
- Parameters:
zone – The value can be the ID of a zone import or a
ZoneExport
instance.- Returns:
ZoneExport instance.
- Return type:
- delete_zone_export(zone_export, ignore_missing=True)
Delete a zone export
- Parameters:
zone_export – The value can be the ID of a zone import or a
ZoneExport
instance.ignore_missing (bool) – When set to
False
NotFoundException
will be raised when the zone does not exist. When set toTrue
, no exception will be set when attempting to delete a nonexistent zone.
- Returns:
None
FloatingIP Operations¶
- class openstack.dns.v2._proxy.Proxy(session, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None, *args, **kwargs)
- floating_ips(**query)
Retrieve a generator of recordsets
- Parameters:
query (dict) –
Optional query parameters to be sent to limit the resources being returned.
name: Recordset Name field.
type: Type field.
status: Status of the recordset.
ttl: TTL field filter.
description: Recordset description field filter.
- Returns:
A generator of floatingips (
FloatingIP
) instances
- get_floating_ip(floating_ip)
Get a Floating IP
- Parameters:
floating_ip – The value can be the ID of a floating ip or a
FloatingIP
instance. The ID is in format “region_name:floatingip_id”- Returns:
FloatingIP instance.
- Return type:
- update_floating_ip(floating_ip, **attrs)
Update floating ip attributes
- Parameters:
floating_ip – The id or an instance of
FloatingIP
.attrs (dict) – attributes for update on
FloatingIP
.
- Return type:
FloatingIP
Zone Transfer Operations¶
- class openstack.dns.v2._proxy.Proxy(session, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None, *args, **kwargs)
- zone_transfer_requests(**query)
Retrieve a generator of zone transfer requests
- Parameters:
query (dict) –
Optional query parameters to be sent to limit the resources being returned.
status: Status of the recordset.
- Returns:
A generator of transfer requests (
ZoneTransferRequest
) instances
- get_zone_transfer_request(request)
Get a ZoneTransfer Request info
- Parameters:
request – The value can be the ID of a transfer request or a
ZoneTransferRequest
instance.- Returns:
Zone transfer request instance.
- Return type:
- create_zone_transfer_request(zone, **attrs)
Create a new ZoneTransfer Request from attributes
- Parameters:
zone – The value can be the ID of a zone to be transferred or a
ZoneExport
instance.attrs (dict) – Keyword arguments which will be used to create a
ZoneTransferRequest
, comprised of the properties on the ZoneTransferRequest class.
- Returns:
The results of zone transfer request creation.
- Return type:
- update_zone_transfer_request(request, **attrs)
Update ZoneTransfer Request attributes
- Parameters:
floating_ip – The id or an instance of
ZoneTransferRequest
.attrs (dict) – attributes for update on
ZoneTransferRequest
.
- Return type:
- delete_zone_transfer_request(request, ignore_missing=True)
Delete a ZoneTransfer Request
- Parameters:
request – The value can be the ID of a zone transfer request or a
ZoneTransferRequest
instance.ignore_missing (bool) – When set to
False
NotFoundException
will be raised when the zone does not exist. When set toTrue
, no exception will be set when attempting to delete a nonexistent zone.
- Returns:
None
- zone_transfer_accepts(**query)
Retrieve a generator of zone transfer accepts
- Parameters:
query (dict) –
Optional query parameters to be sent to limit the resources being returned.
status: Status of the recordset.
- Returns:
A generator of transfer accepts (
ZoneTransferAccept
) instances
- get_zone_transfer_accept(accept)
Get a ZoneTransfer Accept info
- Parameters:
request – The value can be the ID of a transfer accept or a
ZoneTransferAccept
instance.- Returns:
Zone transfer request instance.
- Return type:
- create_zone_transfer_accept(**attrs)
Create a new ZoneTransfer Accept from attributes
- Parameters:
attrs (dict) – Keyword arguments which will be used to create a
ZoneTransferAccept
, comprised of the properties on the ZoneTransferAccept class.- Returns:
The results of zone transfer request creation.
- Return type: