diff options
Diffstat (limited to 'onap-client/onap_client/aai/catalog')
-rw-r--r-- | onap-client/onap_client/aai/catalog/business_catalog.py | 30 | ||||
-rw-r--r-- | onap-client/onap_client/aai/catalog/cloud_infrastructure_catalog.py | 31 |
2 files changed, 35 insertions, 26 deletions
diff --git a/onap-client/onap_client/aai/catalog/business_catalog.py b/onap-client/onap_client/aai/catalog/business_catalog.py index 283521c..51c2409 100644 --- a/onap-client/onap_client/aai/catalog/business_catalog.py +++ b/onap-client/onap_client/aai/catalog/business_catalog.py @@ -37,12 +37,8 @@ import uuid from functools import partial -from onap_client import config from onap_client.aai.client import AAIClient -PAYLOADS_DIR = config.PAYLOADS_DIR -application_id = config.APPLICATION_ID - class BusinessClient(AAIClient): @property @@ -66,7 +62,7 @@ class BusinessClient(AAIClient): "Accept": "application/json", "Content-Type": "application/json", "X-TransactionId": str(uuid.uuid4()), - "X-FromAppId": application_id, + "X-FromAppId": self.config.application_id, }, "auth": (self.config.aai.AAI_USERNAME, self.config.aai.AAI_PASSWORD,), }, @@ -83,7 +79,7 @@ class BusinessClient(AAIClient): "Accept": "application/json", "Content-Type": "application/json", "X-TransactionId": str(uuid.uuid4()), - "X-FromAppId": application_id, + "X-FromAppId": self.config.application_id, }, "auth": (self.config.aai.AAI_USERNAME, self.config.aai.AAI_PASSWORD,), }, @@ -101,7 +97,7 @@ class BusinessClient(AAIClient): "Accept": "application/json", "Content-Type": "application/json", "X-TransactionId": str(uuid.uuid4()), - "X-FromAppId": application_id, + "X-FromAppId": self.config.application_id, }, "auth": (self.config.aai.AAI_USERNAME, self.config.aai.AAI_PASSWORD,), }, @@ -118,7 +114,7 @@ class BusinessClient(AAIClient): "Accept": "application/json", "Content-Type": "application/json", "X-TransactionId": str(uuid.uuid4()), - "X-FromAppId": application_id, + "X-FromAppId": self.config.application_id, }, "auth": (self.config.aai.AAI_USERNAME, self.config.aai.AAI_PASSWORD,), }, @@ -136,7 +132,7 @@ class BusinessClient(AAIClient): "Accept": "application/json", "Content-Type": "application/json", "X-TransactionId": str(uuid.uuid4()), - "X-FromAppId": application_id, + "X-FromAppId": self.config.application_id, }, "auth": (self.config.aai.AAI_USERNAME, self.config.aai.AAI_PASSWORD,), }, @@ -153,7 +149,7 @@ class BusinessClient(AAIClient): "Accept": "application/json", "Content-Type": "application/json", "X-TransactionId": str(uuid.uuid4()), - "X-FromAppId": application_id, + "X-FromAppId": self.config.application_id, }, "auth": (self.config.aai.AAI_USERNAME, self.config.aai.AAI_PASSWORD,), }, @@ -171,7 +167,7 @@ class BusinessClient(AAIClient): "Accept": "application/json", "Content-Type": "application/json", "X-TransactionId": str(uuid.uuid4()), - "X-FromAppId": application_id, + "X-FromAppId": self.config.application_id, }, "auth": (self.config.aai.AAI_USERNAME, self.config.aai.AAI_PASSWORD,), }, @@ -188,7 +184,7 @@ class BusinessClient(AAIClient): "Accept": "application/json", "Content-Type": "application/json", "X-TransactionId": str(uuid.uuid4()), - "X-FromAppId": application_id, + "X-FromAppId": self.config.application_id, }, "auth": (self.config.aai.AAI_USERNAME, self.config.aai.AAI_PASSWORD,), }, @@ -205,7 +201,7 @@ class BusinessClient(AAIClient): "Accept": "application/json", "Content-Type": "application/json", "X-TransactionId": str(uuid.uuid4()), - "X-FromAppId": application_id, + "X-FromAppId": self.config.application_id, }, "auth": (self.config.aai.AAI_USERNAME, self.config.aai.AAI_PASSWORD,), }, @@ -219,13 +215,13 @@ class BusinessClient(AAIClient): ), "uri-parameters": ["customer_name"], "payload-parameters": ["customer_name", "subscriber_name"], - "payload": "{}/aai_create_customer.jinja".format(PAYLOADS_DIR), + "payload": "{}/aai_create_customer.jinja".format(self.config.payload_directory), "success_code": 201, "headers": { "Accept": "application/json", "Content-Type": "application/json", "X-TransactionId": str(uuid.uuid4()), - "X-FromAppId": application_id, + "X-FromAppId": self.config.application_id, }, "auth": (self.config.aai.AAI_USERNAME, self.config.aai.AAI_PASSWORD,), }, @@ -243,7 +239,7 @@ class BusinessClient(AAIClient): "Accept": "application/json", "Content-Type": "application/json", "X-TransactionId": str(uuid.uuid4()), - "X-FromAppId": application_id, + "X-FromAppId": self.config.application_id, }, "auth": (self.config.aai.AAI_USERNAME, self.config.aai.AAI_PASSWORD,), }, @@ -261,7 +257,7 @@ class BusinessClient(AAIClient): "Accept": "application/json", "Content-Type": "application/json", "X-TransactionId": str(uuid.uuid4()), - "X-FromAppId": application_id, + "X-FromAppId": self.config.application_id, }, "auth": (self.config.aai.AAI_USERNAME, self.config.aai.AAI_PASSWORD,), }, diff --git a/onap-client/onap_client/aai/catalog/cloud_infrastructure_catalog.py b/onap-client/onap_client/aai/catalog/cloud_infrastructure_catalog.py index 4ebe34a..d22ab0e 100644 --- a/onap-client/onap_client/aai/catalog/cloud_infrastructure_catalog.py +++ b/onap-client/onap_client/aai/catalog/cloud_infrastructure_catalog.py @@ -34,16 +34,11 @@ # limitations under the License. # # ============LICENSE_END============================================ - import uuid from functools import partial -from onap_client import config from onap_client.aai.client import AAIClient -PAYLOADS_DIR = config.PAYLOADS_DIR -application_id = config.APPLICATION_ID - class CloudInfrastructureClient(AAIClient): @property @@ -66,7 +61,7 @@ class CloudInfrastructureClient(AAIClient): "Accept": "application/json", "Content-Type": "application/json", "X-TransactionId": str(uuid.uuid4()), - "X-FromAppId": application_id, + "X-FromAppId": self.config.application_id, }, "auth": (self.config.aai.AAI_USERNAME, self.config.aai.AAI_PASSWORD,), }, @@ -84,7 +79,7 @@ class CloudInfrastructureClient(AAIClient): "Accept": "application/json", "Content-Type": "application/json", "X-TransactionId": str(uuid.uuid4()), - "X-FromAppId": application_id, + "X-FromAppId": self.config.application_id, }, "auth": (self.config.aai.AAI_USERNAME, self.config.aai.AAI_PASSWORD,), }, @@ -102,7 +97,7 @@ class CloudInfrastructureClient(AAIClient): "Accept": "application/json", "Content-Type": "application/json", "X-TransactionId": str(uuid.uuid4()), - "X-FromAppId": application_id, + "X-FromAppId": self.config.application_id, }, "auth": (self.config.aai.AAI_USERNAME, self.config.aai.AAI_PASSWORD,), }, @@ -120,7 +115,25 @@ class CloudInfrastructureClient(AAIClient): "Accept": "application/json", "Content-Type": "application/json", "X-TransactionId": str(uuid.uuid4()), - "X-FromAppId": application_id, + "X-FromAppId": self.config.application_id, + }, + "auth": (self.config.aai.AAI_USERNAME, self.config.aai.AAI_PASSWORD,), + }, + "GET_VOLUME_GROUPS": { + "verb": "GET", + "description": "Queries AAI for the list of volume groups", + "uri": partial( + "{endpoint}{service_path}/cloud-regions/cloud-region/{cloud_owner}/{cloud_region}/volume-groups".format, + endpoint=self.config.aai.AAI_BE_ENDPOINT, + service_path=self.config.aai.AAI_CLOUD_INFRASTRUCTURE_PATH, + ), + "uri-parameters": ["cloud_region", "cloud_owner"], + "success_code": 200, + "headers": { + "Accept": "application/json", + "Content-Type": "application/json", + "X-TransactionId": str(uuid.uuid4()), + "X-FromAppId": self.config.application_id, }, "auth": (self.config.aai.AAI_USERNAME, self.config.aai.AAI_PASSWORD,), }, |