ironic_python_agent.mdns module¶
Multicast DNS implementation for API discovery.
This implementation follows RFC 6763 as clarified by the API SIG guideline https://review.opendev.org/651222.
- class ironic_python_agent.mdns.Zeroconf[source]¶
Bases:
object
Multicast DNS implementation client and server.
Uses threading internally, so there is no start method. It starts automatically on creation.
Warning
The underlying library does not yet support IPv6.
- close()[source]¶
Shut down mDNS and unregister services.
Note
If another server is running for the same services, it will re-register them immediately.
- get_endpoint(service_type, skip_loopback=True, skip_link_local=False)[source]¶
Get an endpoint and its properties from mDNS.
If the requested endpoint is already in the built-in server cache, and its TTL is not exceeded, the cached value is returned.
- Parameters:
service_type – OpenStack service type.
skip_loopback – Whether to ignore loopback addresses.
skip_link_local – Whether to ignore link local V6 addresses.
- Returns:
tuple (endpoint URL, properties as a dict).
- Raises:
ServiceLookupFailure
if the service cannot be found.
- ironic_python_agent.mdns.get_endpoint(service_type)[source]¶
Get an endpoint and its properties from mDNS.
If the requested endpoint is already in the built-in server cache, and its TTL is not exceeded, the cached value is returned.
- Parameters:
service_type – OpenStack service type.
- Returns:
tuple (endpoint URL, properties as a dict).
- Raises:
ServiceLookupFailure
if the service cannot be found.