Add designate modules and states
Add basic work with zones via designate RESTful API
Change-Id: Ib8dca42fc00c96756f4137acdc57aeb81e95c06c
Related-Issue: PROD-24588
diff --git a/_modules/designatev2/__init__.py b/_modules/designatev2/__init__.py
new file mode 100644
index 0000000..0becffe
--- /dev/null
+++ b/_modules/designatev2/__init__.py
@@ -0,0 +1,29 @@
+try:
+ import os_client_config # noqa
+ from keystoneauth1 import exceptions as ka_exceptions # noqa
+ REQUIREMENTS_MET = True
+except ImportError:
+ REQUIREMENTS_MET = False
+
+from designatev2 import lists
+from designatev2 import zones
+
+zone_list = lists.zone_list
+zone_create = zones.zone_create
+zone_get_details = zones.zone_get_details
+zone_get_name_servers = zones.zone_get_name_servers
+zone_update = zones.zone_update
+zone_delete = zones.zone_delete
+
+
+__all__ = ('zone_list', 'zone_create', 'zone_delete', 'zone_update',
+ 'zone_get_details', 'zone_get_name_servers',)
+
+
+def __virtual__():
+ """Only load designatev2 if requirements are available."""
+ if REQUIREMENTS_MET:
+ return 'designatev2'
+ else:
+ return False, ("The designatev2 execution module cannot be loaded: "
+ "os_client_config or keystoneauth are unavailable.")
\ No newline at end of file