diff options
author | 2017-10-15 01:38:44 +0300 | |
---|---|---|
committer | 2017-10-14 22:41:31 +0000 | |
commit | e2f2060cbb7d14aeb1aff7fbca1408fe54aedbb1 (patch) | |
tree | 5f637d5076d0f0a87c4a24bd315395e0ab3adf23 /app/api/responders/resource/environment_configs.py | |
parent | 3c9696e010451484fabb143a542c8364a4538669 (diff) |
added schemes to support new ui link options + fix api per new schemes
Change-Id: I768233f13749d01d436c24c764cb903ca19d3d2a
Signed-off-by: Koren Lev <korenlev@gmail.com>
(cherry picked from commit 41ac4c4e9a6112d8c98472a1be60e4869814f549)
Diffstat (limited to 'app/api/responders/resource/environment_configs.py')
-rw-r--r-- | app/api/responders/resource/environment_configs.py | 41 |
1 files changed, 23 insertions, 18 deletions
diff --git a/app/api/responders/resource/environment_configs.py b/app/api/responders/resource/environment_configs.py index f54bea7..c24aec8 100644 --- a/app/api/responders/resource/environment_configs.py +++ b/app/api/responders/resource/environment_configs.py @@ -17,22 +17,22 @@ from utils.inventory_mgr import InventoryMgr class EnvironmentConfigs(ResponderBase): - def __init__(self): - super(EnvironmentConfigs, self).__init__() - self.inv = InventoryMgr() - self.ID = "name" - self.PROJECTION = { - self.ID: True, - "_id": False, - "name": True, - "distribution": True - } - self.COLLECTION = "environments_config" - self.CONFIGURATIONS_NAMES = ["mysql", "OpenStack", - "CLI", "AMQP", "Monitoring", + + COLLECTION = "environments_config" + ID = "name" + PROJECTION = { + ID: True, + "_id": False, + "name": True, + "distribution": True + } + CONFIGURATIONS_NAMES = ["mysql", "OpenStack", "CLI", "AMQP", + "Monitoring", "NFV_provider", "ACI"] + OPTIONAL_CONFIGURATIONS_NAMES = ["AMQP", "Monitoring", "NFV_provider", "ACI"] - self.OPTIONAL_CONFIGURATIONS_NAMES = ["AMQP", "Monitoring", - "NFV_provider", "ACI"] + + def __init__(self): + super().__init__() self.provision_types = self.\ get_constants_by_name("environment_provision_types") @@ -41,6 +41,8 @@ class EnvironmentConfigs(ResponderBase): get_constants_by_name("environment_monitoring_types") self.distributions = self.\ get_constants_by_name("distributions") + self.distribution_versions = self.\ + get_constants_by_name("distribution_versions") self.mechanism_drivers = self.\ get_constants_by_name("mechanism_drivers") self.operational_values = self.\ @@ -183,6 +185,9 @@ class EnvironmentConfigs(ResponderBase): "distribution": self.require(str, validate=DataValidate.LIST, requirement=self.distributions), + "distribution_version": self.require(str, + validate=DataValidate.LIST, + requirement=self.distribution_versions), "mechanism_drivers": self.require([str, list], validate=DataValidate.LIST, requirement=self.mechanism_drivers), @@ -216,9 +221,9 @@ class EnvironmentConfigs(ResponderBase): def build_query(self, filters): query = {} - filters_keys = ["name", "distribution", "type_drivers", "user", - "listen", "monitoring_setup_done", "scanned", - "operational"] + filters_keys = ["name", "distribution", "distribution_version", + "type_drivers", "user", "listen", + "monitoring_setup_done", "scanned", "operational"] self.update_query_with_filters(filters, filters_keys, query) mechanism_drivers = filters.get("mechanism_drivers") if mechanism_drivers: |