aboutsummaryrefslogtreecommitdiffstats
path: root/onap-client/onap_client/sdc/catalog/service_catalog.py
diff options
context:
space:
mode:
Diffstat (limited to 'onap-client/onap_client/sdc/catalog/service_catalog.py')
-rw-r--r--onap-client/onap_client/sdc/catalog/service_catalog.py931
1 files changed, 463 insertions, 468 deletions
diff --git a/onap-client/onap_client/sdc/catalog/service_catalog.py b/onap-client/onap_client/sdc/catalog/service_catalog.py
index c40306f..229f2b5 100644
--- a/onap-client/onap_client/sdc/catalog/service_catalog.py
+++ b/onap-client/onap_client/sdc/catalog/service_catalog.py
@@ -38,483 +38,478 @@
import uuid
from functools import partial
-from onap_client import sdc
from onap_client import config
from onap_client.sdc.client import SDCClient
PAYLOADS_DIR = config.PAYLOADS_DIR
-sdc_properties = sdc.SDC_PROPERTIES
application_id = config.APPLICATION_ID
class ServiceCatalog(SDCClient):
@property
- def catalog_resources(self):
- return CATALOG_RESOURCES
-
- @property
def namespace(self):
return "service"
-
-CATALOG_RESOURCES = {
- "ADD_CATALOG_SERVICE": {
- "verb": "POST",
- "description": "Creates a Service in the SDC catalog",
- "uri": partial(
- "{endpoint}{service_path}".format,
- endpoint=sdc_properties.SDC_BE_ENDPOINT,
- service_path=sdc_properties.SDC_CATALOG_SERVICES_PATH,
- ),
- "payload": "{}/catalog_service.jinja".format(PAYLOADS_DIR),
- "payload-parameters": [
- "service_name",
- "instantiation_type",
- "contact_id",
- "category_name",
- "category_id",
- "category_name_lower",
- "category_name_icon",
- "tag",
- "project_code",
- "environment_context",
- "ecomp_generated_naming",
- "description",
- "service_type",
- "service_role",
- "naming_policy",
- ],
- "success_code": 201,
- "headers": {
- "Accept": "application/json",
- "Content-Type": "application/json",
- "USER_ID": sdc_properties.SDC_DESIGNER_USER_ID,
- "X-TransactionId": str(uuid.uuid4()),
- "X-FromAppId": application_id,
- },
- "return_data": {"catalog_service_id": ("uniqueId",)},
- "auth": (
- sdc_properties.GLOBAL_SDC_USERNAME,
- sdc_properties.GLOBAL_SDC_PASSWORD,
- ),
- },
- "CHECKOUT_CATALOG_SERVICE": {
- "verb": "POST",
- "description": "Creates a new version of a Service in the SDC catalog",
- "uri": partial(
- "{endpoint}{service_path}/{catalog_service_id}/lifecycleState/CHECKOUT".format,
- endpoint=sdc_properties.SDC_BE_ENDPOINT,
- service_path=sdc_properties.SDC_CATALOG_SERVICES_PATH,
- ),
- "uri-parameters": ["catalog_service_id"],
- "success_code": 200,
- "headers": {
- "Accept": "application/json",
- "Content-Type": "application/json",
- "USER_ID": sdc_properties.SDC_DESIGNER_USER_ID,
- "X-TransactionId": str(uuid.uuid4()),
- "X-FromAppId": application_id,
- },
- "return_data": {"catalog_service_id": ("uniqueId",)},
- "auth": (
- sdc_properties.GLOBAL_SDC_USERNAME,
- sdc_properties.GLOBAL_SDC_PASSWORD,
- ),
- },
- "ADD_RESOURCE_INSTANCE": {
- "verb": "POST",
- "description": "Attaches a Resource to a Service",
- "uri": partial(
- "{endpoint}{service_path}/{catalog_service_id}/resourceInstance".format,
- endpoint=sdc_properties.SDC_BE_ENDPOINT,
- service_path=sdc_properties.SDC_CATALOG_SERVICES_PATH,
- ),
- "uri-parameters": ["catalog_service_id"],
- "payload": "{}/resource_instance.jinja".format(PAYLOADS_DIR),
- "payload-parameters": [
- "milli_timestamp",
- "catalog_resource_id",
- "catalog_resource_name",
- "originType",
- "posX",
- "posY",
- ],
- "success_code": 201,
- "headers": {
- "Accept": "application/json",
- "Content-Type": "application/json",
- "USER_ID": sdc_properties.SDC_DESIGNER_USER_ID,
- "X-TransactionId": str(uuid.uuid4()),
- "X-FromAppId": application_id,
- },
- "return_data": {"catalog_resource_instance_id": ("uniqueId",)},
- "auth": (
- sdc_properties.GLOBAL_SDC_USERNAME,
- sdc_properties.GLOBAL_SDC_PASSWORD,
- ),
- },
- "DELETE_RESOURCE_FROM_SERVICE": {
- "verb": "DELETE",
- "description": "Deletes a resource from a service.",
- "uri": partial(
- "{endpoint}{service_path}/{catalog_service_id}/resourceInstance/{resource_instance_id}".format,
- endpoint=sdc_properties.SDC_BE_ENDPOINT,
- service_path=sdc_properties.SDC_CATALOG_SERVICES_PATH,
- ),
- "uri-parameters": ["catalog_service_id", "resource_instance_id"],
- "success_code": 200,
- "headers": {
- "Accept": "application/json",
- "Content-Type": "application/json",
- "USER_ID": sdc_properties.SDC_DESIGNER_USER_ID,
- "X-TransactionId": str(uuid.uuid4()),
- "X-FromAppId": application_id,
- },
- "auth": (
- sdc_properties.GLOBAL_SDC_USERNAME,
- sdc_properties.GLOBAL_SDC_PASSWORD,
- ),
- },
- "UPDATE_RESOURCE_VERSION": {
- "verb": "POST",
- "description": "Updates a component version in a service",
- "uri": partial(
- "{endpoint}{service_path}/{catalog_service_id}/resourceInstance/{component_name}/changeVersion".format,
- endpoint=sdc_properties.SDC_BE_ENDPOINT,
- service_path=sdc_properties.SDC_CATALOG_SERVICES_PATH,
- ),
- "uri-parameters": ["catalog_service_id", "component_name"],
- "payload": "{}/update_resource_instance.jinja".format(PAYLOADS_DIR),
- "payload-parameters": [
- "component_id",
- ],
- "success_code": 200,
- "headers": {
- "Accept": "application/json",
- "Content-Type": "application/json",
- "USER_ID": sdc_properties.SDC_DESIGNER_USER_ID,
- "X-TransactionId": str(uuid.uuid4()),
- "X-FromAppId": application_id,
- },
- "auth": (
- sdc_properties.GLOBAL_SDC_USERNAME,
- sdc_properties.GLOBAL_SDC_PASSWORD,
- ),
- },
- "CHECKIN_SERVICE": {
- "verb": "POST",
- "description": "Checks a service into the SDC Catalog",
- "uri": partial(
- "{endpoint}{service_path}/{catalog_service_id}/lifecycleState/checkin".format,
- endpoint=sdc_properties.SDC_BE_ENDPOINT,
- service_path=sdc_properties.SDC_CATALOG_SERVICES_PATH,
- ),
- "uri-parameters": ["catalog_service_id"],
- "payload": "{}/user_remarks.jinja".format(PAYLOADS_DIR),
- "payload-parameters": ["user_remarks"],
- "success_code": 200,
- "headers": {
- "Accept": "application/json",
- "Content-Type": "application/json",
- "USER_ID": sdc_properties.SDC_DESIGNER_USER_ID,
- "X-TransactionId": str(uuid.uuid4()),
- "X-FromAppId": application_id,
- },
- "auth": (
- sdc_properties.GLOBAL_SDC_USERNAME,
- sdc_properties.GLOBAL_SDC_PASSWORD,
- ),
- },
- "REQUEST_SERVICE_CERTIFICATION": {
- "verb": "POST",
- "description": "Requests certification of a service into the SDC Catalog",
- "uri": partial(
- "{endpoint}{service_path}/{catalog_service_id}/lifecycleState/certificationRequest".format,
- endpoint=sdc_properties.SDC_BE_ENDPOINT,
- service_path=sdc_properties.SDC_CATALOG_SERVICES_PATH,
- ),
- "uri-parameters": ["catalog_service_id"],
- "payload": "{}/user_remarks.jinja".format(PAYLOADS_DIR),
- "payload-parameters": ["user_remarks"],
- "success_code": 200,
- "headers": {
- "Accept": "application/json",
- "Content-Type": "application/json",
- "USER_ID": sdc_properties.SDC_DESIGNER_USER_ID,
- "X-TransactionId": str(uuid.uuid4()),
- "X-FromAppId": application_id,
- },
- "auth": (
- sdc_properties.GLOBAL_SDC_USERNAME,
- sdc_properties.GLOBAL_SDC_PASSWORD,
- ),
- },
- "START_SERVICE_CERTIFICATION": {
- "verb": "POST",
- "description": "Starts certification of a service into the SDC Catalog",
- "uri": partial(
- "{endpoint}{service_path}/{catalog_service_id}/lifecycleState/startCertification".format,
- endpoint=sdc_properties.SDC_BE_ENDPOINT,
- service_path=sdc_properties.SDC_CATALOG_SERVICES_PATH,
- ),
- "uri-parameters": ["catalog_service_id"],
- "payload": "{}/user_remarks.jinja".format(PAYLOADS_DIR),
- "payload-parameters": ["user_remarks"],
- "success_code": 200,
- "headers": {
- "Accept": "application/json",
- "Content-Type": "application/json",
- "USER_ID": sdc_properties.SDC_TESTER_USER_ID,
- "X-TransactionId": str(uuid.uuid4()),
- "X-FromAppId": application_id,
- },
- "auth": (
- sdc_properties.GLOBAL_SDC_USERNAME,
- sdc_properties.GLOBAL_SDC_PASSWORD,
- ),
- },
- "FINISH_SERVICE_CERTIFICATION": {
- "verb": "POST",
- "description": "Finishes certification of a service from the SDC Catalog",
- "uri": partial(
- "{endpoint}{service_path}/{catalog_service_id}/lifecycleState/certify".format,
- endpoint=sdc_properties.SDC_BE_ENDPOINT,
- service_path=sdc_properties.SDC_CATALOG_SERVICES_PATH,
- ),
- "uri-parameters": ["catalog_service_id"],
- "payload": "{}/user_remarks.jinja".format(PAYLOADS_DIR),
- "payload-parameters": ["user_remarks"],
- "success_code": 200,
- "headers": {
- "Accept": "application/json",
- "Content-Type": "application/json",
- "USER_ID": sdc_properties.SDC_TESTER_USER_ID,
- "X-TransactionId": str(uuid.uuid4()),
- "X-FromAppId": application_id,
- },
- "return_data": {"catalog_service_id": ("uniqueId",)},
- "auth": (
- sdc_properties.GLOBAL_SDC_USERNAME,
- sdc_properties.GLOBAL_SDC_PASSWORD,
- ),
- },
- "APPROVE_SERVICE_CERTIFICATION": {
- "verb": "POST",
- "description": "Approves a service from the SDC Catalog",
- "uri": partial(
- "{endpoint}{service_path}/{catalog_service_id}/distribution-state/approve".format,
- endpoint=sdc_properties.SDC_BE_ENDPOINT,
- service_path=sdc_properties.SDC_CATALOG_SERVICES_PATH,
- ),
- "uri-parameters": ["catalog_service_id"],
- "payload": "{}/user_remarks.jinja".format(PAYLOADS_DIR),
- "payload-parameters": ["user_remarks"],
- "success_code": 200,
- "headers": {
- "Accept": "application/json",
- "Content-Type": "application/json",
- "USER_ID": sdc_properties.SDC_GOVERNOR_USER_ID,
- "X-TransactionId": str(uuid.uuid4()),
- "X-FromAppId": application_id,
- },
- "auth": (
- sdc_properties.GLOBAL_SDC_USERNAME,
- sdc_properties.GLOBAL_SDC_PASSWORD,
- ),
- },
- "DISTRIBUTE_SDC_SERVICE": {
- "verb": "POST",
- "description": "Distributes a service from the SDC Catalog",
- "uri": partial(
- "{endpoint}{service_path}/{catalog_service_id}/distribution/PROD/activate".format,
- endpoint=sdc_properties.SDC_BE_ENDPOINT,
- service_path=sdc_properties.SDC_CATALOG_SERVICES_PATH,
- ),
- "uri-parameters": ["catalog_service_id"],
- "success_code": 200,
- "header-parameters": ["X-TransactionId"],
- "headers": {
- "Accept": "application/json",
- "Content-Type": "application/json",
- "USER_ID": sdc_properties.SDC_OPS_USER_ID,
- # "X-TransactionId": str(uuid.uuid4()),
- "X-FromAppId": application_id,
- },
- "auth": (
- sdc_properties.GLOBAL_SDC_USERNAME,
- sdc_properties.GLOBAL_SDC_PASSWORD,
- ),
- },
- "ADD_CATALOG_SERVICE_PROPERTY": {
- "verb": "POST",
- "description": "Add a property value for a VF in a Service",
- "uri": partial(
- "{endpoint}{service_path}/{catalog_service_id}/resourceInstance/{catalog_resource_instance_id}/properties".format,
- endpoint=sdc_properties.SDC_BE_ENDPOINT,
- service_path=sdc_properties.SDC_CATALOG_RESOURCES_PATH,
- ),
- "uri-parameters": ["catalog_service_id", "catalog_resource_instance_id"],
- "payload": "{}/catalog_service_property.jinja".format(PAYLOADS_DIR),
- "payload-parameters": [
- "unique_id",
- "parent_unique_id",
- "owner_id",
- "input_name",
- "input_value",
- "schema_type",
- "property_type",
- ],
- "success_code": 200,
- "headers": {
- "Accept": "application/json",
- "Content-Type": "application/json",
- "USER_ID": sdc_properties.SDC_DESIGNER_USER_ID,
- "X-TransactionId": str(uuid.uuid4()),
- "X-FromAppId": application_id,
- },
- "auth": (
- sdc_properties.GLOBAL_SDC_USERNAME,
- sdc_properties.GLOBAL_SDC_PASSWORD,
- ),
- },
- "ADD_CATALOG_SERVICE_INPUT": {
- "verb": "POST",
- "description": "Add an input value for a VF in a Service",
- "uri": partial(
- "{endpoint}{service_path}/{catalog_service_id}/resourceInstance/{catalog_resource_instance_id}/inputs".format,
- endpoint=sdc_properties.SDC_BE_ENDPOINT,
- service_path=sdc_properties.SDC_CATALOG_RESOURCES_PATH,
- ),
- "uri-parameters": ["catalog_service_id", "catalog_resource_instance_id"],
- "payload": "{}/catalog_service_property.jinja".format(PAYLOADS_DIR),
- "payload-parameters": [
- "unique_id",
- "parent_unique_id",
- "owner_id",
- "input_name",
- "input_value",
- ],
- "success_code": 200,
- "headers": {
- "Accept": "application/json",
- "Content-Type": "application/json",
- "USER_ID": sdc_properties.SDC_DESIGNER_USER_ID,
- "X-TransactionId": str(uuid.uuid4()),
- "X-FromAppId": application_id,
- },
- "auth": (
- sdc_properties.GLOBAL_SDC_USERNAME,
- sdc_properties.GLOBAL_SDC_PASSWORD,
- ),
- },
- "GET_SDC_SERVICE": {
- "verb": "GET",
- "description": "Gets a service from the SDC Catalog",
- "uri": partial(
- "{endpoint}{service_path}/{catalog_service_id}".format,
- endpoint=sdc_properties.SDC_BE_ENDPOINT,
- service_path=sdc_properties.SDC_CATALOG_SERVICES_PATH,
- ),
- "uri-parameters": ["catalog_service_id"],
- "success_code": 200,
- "headers": {
- "Accept": "application/json",
- "Content-Type": "application/json",
- "USER_ID": sdc_properties.SDC_DESIGNER_USER_ID,
- "X-TransactionId": str(uuid.uuid4()),
- "X-FromAppId": application_id,
- },
- "auth": (
- sdc_properties.GLOBAL_SDC_USERNAME,
- sdc_properties.GLOBAL_SDC_PASSWORD,
- ),
- },
- "GET_SERVICES": {
- "verb": "GET",
- "description": "Get all services in the SDC catalog",
- "uri": partial(
- "{endpoint}{service_path}".format,
- endpoint=sdc_properties.SDC_BE_ENDPOINT,
- service_path=sdc_properties.SDC_SCREEN_PATH,
- ),
- "success_code": 200,
- "headers": {
- "Accept": "application/json",
- "Content-Type": "application/json",
- "USER_ID": sdc_properties.SDC_DESIGNER_USER_ID,
- "X-TransactionId": str(uuid.uuid4()),
- "X-FromAppId": application_id,
- },
- "return_data": {"services": ("services",)},
- "auth": (
- sdc_properties.GLOBAL_SDC_USERNAME,
- sdc_properties.GLOBAL_SDC_PASSWORD,
- ),
- },
- "GET_SERVICE_DISTRIBUTION": {
- "verb": "GET",
- "description": "Gets the distribution for a service from the SDC Catalog",
- "uri": partial(
- "{endpoint}{service_path}/{distribution_service_id}/distribution".format,
- endpoint=sdc_properties.SDC_BE_ENDPOINT,
- service_path=sdc_properties.SDC_CATALOG_SERVICES_PATH,
- ),
- "uri-parameters": ["distribution_service_id"],
- "success_code": 200,
- "headers": {
- "Accept": "application/json",
- "Content-Type": "application/json",
- "USER_ID": sdc_properties.SDC_DESIGNER_USER_ID,
- "X-TransactionId": str(uuid.uuid4()),
- "X-FromAppId": application_id,
- },
- "auth": (
- sdc_properties.GLOBAL_SDC_USERNAME,
- sdc_properties.GLOBAL_SDC_PASSWORD,
- ),
- },
- "GET_SERVICE_DISTRIBUTION_DETAILS": {
- "verb": "GET",
- "description": "Gets the distribution details for a service from the SDC Catalog",
- "uri": partial(
- "{endpoint}{service_path}/distribution/{distribution_id}".format,
- endpoint=sdc_properties.SDC_BE_ENDPOINT,
- service_path=sdc_properties.SDC_CATALOG_SERVICES_PATH,
- ),
- "uri-parameters": ["distribution_id"],
- "success_code": 200,
- "headers": {
- "Accept": "application/json",
- "Content-Type": "application/json",
- "USER_ID": sdc_properties.SDC_DESIGNER_USER_ID,
- "X-TransactionId": str(uuid.uuid4()),
- "X-FromAppId": application_id,
- },
- "auth": (
- sdc_properties.GLOBAL_SDC_USERNAME,
- sdc_properties.GLOBAL_SDC_PASSWORD,
- ),
- },
- "GET_SDC_CSAR": {
- "verb": "GET",
- "description": "Returns the CSAR for a service.",
- "uri": partial(
- "{endpoint}{service_path}/{catalog_service_id}/artifacts/{csar_artifact_id}".format,
- endpoint=sdc_properties.SDC_BE_ENDPOINT,
- service_path=sdc_properties.SDC_CATALOG_SERVICES_PATH,
- ),
- "uri-parameters": ["catalog_service_id", "csar_artifact_id"],
- "success_code": 200,
- "headers": {
- "Accept": "application/json",
- "Content-Type": "application/json",
- "USER_ID": sdc_properties.SDC_DESIGNER_USER_ID,
- "X-TransactionId": str(uuid.uuid4()),
- "X-FromAppId": application_id,
- },
- "auth": (
- sdc_properties.GLOBAL_SDC_USERNAME,
- sdc_properties.GLOBAL_SDC_PASSWORD,
- ),
- },
-}
+ @property
+ def catalog_resources(self):
+ return {
+ "ADD_CATALOG_SERVICE": {
+ "verb": "POST",
+ "description": "Creates a Service in the SDC catalog",
+ "uri": partial(
+ "{endpoint}{service_path}".format,
+ endpoint=self.config.sdc.SDC_BE_ENDPOINT,
+ service_path=self.config.sdc.SDC_CATALOG_SERVICES_PATH,
+ ),
+ "payload": "{}/catalog_service.jinja".format(PAYLOADS_DIR),
+ "payload-parameters": [
+ "service_name",
+ "instantiation_type",
+ "contact_id",
+ "category_name",
+ "category_id",
+ "category_name_lower",
+ "category_name_icon",
+ "tag",
+ "project_code",
+ "environment_context",
+ "ecomp_generated_naming",
+ "description",
+ "service_type",
+ "service_role",
+ "naming_policy",
+ ],
+ "success_code": 201,
+ "headers": {
+ "Accept": "application/json",
+ "Content-Type": "application/json",
+ "USER_ID": self.config.sdc.SDC_DESIGNER_USER_ID,
+ "X-TransactionId": str(uuid.uuid4()),
+ "X-FromAppId": application_id,
+ },
+ "return_data": {"catalog_service_id": ("uniqueId",)},
+ "auth": (
+ self.config.sdc.GLOBAL_SDC_USERNAME,
+ self.config.sdc.GLOBAL_SDC_PASSWORD,
+ ),
+ },
+ "CHECKOUT_CATALOG_SERVICE": {
+ "verb": "POST",
+ "description": "Creates a new version of a Service in the SDC catalog",
+ "uri": partial(
+ "{endpoint}{service_path}/{catalog_service_id}/lifecycleState/CHECKOUT".format,
+ endpoint=self.config.sdc.SDC_BE_ENDPOINT,
+ service_path=self.config.sdc.SDC_CATALOG_SERVICES_PATH,
+ ),
+ "uri-parameters": ["catalog_service_id"],
+ "success_code": 200,
+ "headers": {
+ "Accept": "application/json",
+ "Content-Type": "application/json",
+ "USER_ID": self.config.sdc.SDC_DESIGNER_USER_ID,
+ "X-TransactionId": str(uuid.uuid4()),
+ "X-FromAppId": application_id,
+ },
+ "return_data": {"catalog_service_id": ("uniqueId",)},
+ "auth": (
+ self.config.sdc.GLOBAL_SDC_USERNAME,
+ self.config.sdc.GLOBAL_SDC_PASSWORD,
+ ),
+ },
+ "ADD_RESOURCE_INSTANCE": {
+ "verb": "POST",
+ "description": "Attaches a Resource to a Service",
+ "uri": partial(
+ "{endpoint}{service_path}/{catalog_service_id}/resourceInstance".format,
+ endpoint=self.config.sdc.SDC_BE_ENDPOINT,
+ service_path=self.config.sdc.SDC_CATALOG_SERVICES_PATH,
+ ),
+ "uri-parameters": ["catalog_service_id"],
+ "payload": "{}/resource_instance.jinja".format(PAYLOADS_DIR),
+ "payload-parameters": [
+ "milli_timestamp",
+ "catalog_resource_id",
+ "catalog_resource_name",
+ "originType",
+ "posX",
+ "posY",
+ ],
+ "success_code": 201,
+ "headers": {
+ "Accept": "application/json",
+ "Content-Type": "application/json",
+ "USER_ID": self.config.sdc.SDC_DESIGNER_USER_ID,
+ "X-TransactionId": str(uuid.uuid4()),
+ "X-FromAppId": application_id,
+ },
+ "return_data": {"catalog_resource_instance_id": ("uniqueId",)},
+ "auth": (
+ self.config.sdc.GLOBAL_SDC_USERNAME,
+ self.config.sdc.GLOBAL_SDC_PASSWORD,
+ ),
+ },
+ "DELETE_RESOURCE_FROM_SERVICE": {
+ "verb": "DELETE",
+ "description": "Deletes a resource from a service.",
+ "uri": partial(
+ "{endpoint}{service_path}/{catalog_service_id}/resourceInstance/{resource_instance_id}".format,
+ endpoint=self.config.sdc.SDC_BE_ENDPOINT,
+ service_path=self.config.sdc.SDC_CATALOG_SERVICES_PATH,
+ ),
+ "uri-parameters": ["catalog_service_id", "resource_instance_id"],
+ "success_code": 200,
+ "headers": {
+ "Accept": "application/json",
+ "Content-Type": "application/json",
+ "USER_ID": self.config.sdc.SDC_DESIGNER_USER_ID,
+ "X-TransactionId": str(uuid.uuid4()),
+ "X-FromAppId": application_id,
+ },
+ "auth": (
+ self.config.sdc.GLOBAL_SDC_USERNAME,
+ self.config.sdc.GLOBAL_SDC_PASSWORD,
+ ),
+ },
+ "UPDATE_RESOURCE_VERSION": {
+ "verb": "POST",
+ "description": "Updates a component version in a service",
+ "uri": partial(
+ "{endpoint}{service_path}/{catalog_service_id}/resourceInstance/{component_name}/changeVersion".format,
+ endpoint=self.config.sdc.SDC_BE_ENDPOINT,
+ service_path=self.config.sdc.SDC_CATALOG_SERVICES_PATH,
+ ),
+ "uri-parameters": ["catalog_service_id", "component_name"],
+ "payload": "{}/update_resource_instance.jinja".format(PAYLOADS_DIR),
+ "payload-parameters": [
+ "component_id",
+ ],
+ "success_code": 200,
+ "headers": {
+ "Accept": "application/json",
+ "Content-Type": "application/json",
+ "USER_ID": self.config.sdc.SDC_DESIGNER_USER_ID,
+ "X-TransactionId": str(uuid.uuid4()),
+ "X-FromAppId": application_id,
+ },
+ "auth": (
+ self.config.sdc.GLOBAL_SDC_USERNAME,
+ self.config.sdc.GLOBAL_SDC_PASSWORD,
+ ),
+ },
+ "CHECKIN_SERVICE": {
+ "verb": "POST",
+ "description": "Checks a service into the SDC Catalog",
+ "uri": partial(
+ "{endpoint}{service_path}/{catalog_service_id}/lifecycleState/checkin".format,
+ endpoint=self.config.sdc.SDC_BE_ENDPOINT,
+ service_path=self.config.sdc.SDC_CATALOG_SERVICES_PATH,
+ ),
+ "uri-parameters": ["catalog_service_id"],
+ "payload": "{}/user_remarks.jinja".format(PAYLOADS_DIR),
+ "payload-parameters": ["user_remarks"],
+ "success_code": 200,
+ "headers": {
+ "Accept": "application/json",
+ "Content-Type": "application/json",
+ "USER_ID": self.config.sdc.SDC_DESIGNER_USER_ID,
+ "X-TransactionId": str(uuid.uuid4()),
+ "X-FromAppId": application_id,
+ },
+ "auth": (
+ self.config.sdc.GLOBAL_SDC_USERNAME,
+ self.config.sdc.GLOBAL_SDC_PASSWORD,
+ ),
+ },
+ "REQUEST_SERVICE_CERTIFICATION": {
+ "verb": "POST",
+ "description": "Requests certification of a service into the SDC Catalog",
+ "uri": partial(
+ "{endpoint}{service_path}/{catalog_service_id}/lifecycleState/certificationRequest".format,
+ endpoint=self.config.sdc.SDC_BE_ENDPOINT,
+ service_path=self.config.sdc.SDC_CATALOG_SERVICES_PATH,
+ ),
+ "uri-parameters": ["catalog_service_id"],
+ "payload": "{}/user_remarks.jinja".format(PAYLOADS_DIR),
+ "payload-parameters": ["user_remarks"],
+ "success_code": 200,
+ "headers": {
+ "Accept": "application/json",
+ "Content-Type": "application/json",
+ "USER_ID": self.config.sdc.SDC_DESIGNER_USER_ID,
+ "X-TransactionId": str(uuid.uuid4()),
+ "X-FromAppId": application_id,
+ },
+ "auth": (
+ self.config.sdc.GLOBAL_SDC_USERNAME,
+ self.config.sdc.GLOBAL_SDC_PASSWORD,
+ ),
+ },
+ "START_SERVICE_CERTIFICATION": {
+ "verb": "POST",
+ "description": "Starts certification of a service into the SDC Catalog",
+ "uri": partial(
+ "{endpoint}{service_path}/{catalog_service_id}/lifecycleState/startCertification".format,
+ endpoint=self.config.sdc.SDC_BE_ENDPOINT,
+ service_path=self.config.sdc.SDC_CATALOG_SERVICES_PATH,
+ ),
+ "uri-parameters": ["catalog_service_id"],
+ "payload": "{}/user_remarks.jinja".format(PAYLOADS_DIR),
+ "payload-parameters": ["user_remarks"],
+ "success_code": 200,
+ "headers": {
+ "Accept": "application/json",
+ "Content-Type": "application/json",
+ "USER_ID": self.config.sdc.SDC_TESTER_USER_ID,
+ "X-TransactionId": str(uuid.uuid4()),
+ "X-FromAppId": application_id,
+ },
+ "auth": (
+ self.config.sdc.GLOBAL_SDC_USERNAME,
+ self.config.sdc.GLOBAL_SDC_PASSWORD,
+ ),
+ },
+ "FINISH_SERVICE_CERTIFICATION": {
+ "verb": "POST",
+ "description": "Finishes certification of a service from the SDC Catalog",
+ "uri": partial(
+ "{endpoint}{service_path}/{catalog_service_id}/lifecycleState/certify".format,
+ endpoint=self.config.sdc.SDC_BE_ENDPOINT,
+ service_path=self.config.sdc.SDC_CATALOG_SERVICES_PATH,
+ ),
+ "uri-parameters": ["catalog_service_id"],
+ "payload": "{}/user_remarks.jinja".format(PAYLOADS_DIR),
+ "payload-parameters": ["user_remarks"],
+ "success_code": 200,
+ "headers": {
+ "Accept": "application/json",
+ "Content-Type": "application/json",
+ "USER_ID": self.config.sdc.SDC_TESTER_USER_ID,
+ "X-TransactionId": str(uuid.uuid4()),
+ "X-FromAppId": application_id,
+ },
+ "return_data": {"catalog_service_id": ("uniqueId",)},
+ "auth": (
+ self.config.sdc.GLOBAL_SDC_USERNAME,
+ self.config.sdc.GLOBAL_SDC_PASSWORD,
+ ),
+ },
+ "APPROVE_SERVICE_CERTIFICATION": {
+ "verb": "POST",
+ "description": "Approves a service from the SDC Catalog",
+ "uri": partial(
+ "{endpoint}{service_path}/{catalog_service_id}/distribution-state/approve".format,
+ endpoint=self.config.sdc.SDC_BE_ENDPOINT,
+ service_path=self.config.sdc.SDC_CATALOG_SERVICES_PATH,
+ ),
+ "uri-parameters": ["catalog_service_id"],
+ "payload": "{}/user_remarks.jinja".format(PAYLOADS_DIR),
+ "payload-parameters": ["user_remarks"],
+ "success_code": 200,
+ "headers": {
+ "Accept": "application/json",
+ "Content-Type": "application/json",
+ "USER_ID": self.config.sdc.SDC_GOVERNOR_USER_ID,
+ "X-TransactionId": str(uuid.uuid4()),
+ "X-FromAppId": application_id,
+ },
+ "auth": (
+ self.config.sdc.GLOBAL_SDC_USERNAME,
+ self.config.sdc.GLOBAL_SDC_PASSWORD,
+ ),
+ },
+ "DISTRIBUTE_SDC_SERVICE": {
+ "verb": "POST",
+ "description": "Distributes a service from the SDC Catalog",
+ "uri": partial(
+ "{endpoint}{service_path}/{catalog_service_id}/distribution/PROD/activate".format,
+ endpoint=self.config.sdc.SDC_BE_ENDPOINT,
+ service_path=self.config.sdc.SDC_CATALOG_SERVICES_PATH,
+ ),
+ "uri-parameters": ["catalog_service_id"],
+ "success_code": 200,
+ "header-parameters": ["X-TransactionId"],
+ "headers": {
+ "Accept": "application/json",
+ "Content-Type": "application/json",
+ "USER_ID": self.config.sdc.SDC_OPS_USER_ID,
+ # "X-TransactionId": str(uuid.uuid4()),
+ "X-FromAppId": application_id,
+ },
+ "auth": (
+ self.config.sdc.GLOBAL_SDC_USERNAME,
+ self.config.sdc.GLOBAL_SDC_PASSWORD,
+ ),
+ },
+ "ADD_CATALOG_SERVICE_PROPERTY": {
+ "verb": "POST",
+ "description": "Add a property value for a VF in a Service",
+ "uri": partial(
+ "{endpoint}{service_path}/{catalog_service_id}/resourceInstance/{catalog_resource_instance_id}/properties".format,
+ endpoint=self.config.sdc.SDC_BE_ENDPOINT,
+ service_path=self.config.sdc.SDC_CATALOG_RESOURCES_PATH,
+ ),
+ "uri-parameters": ["catalog_service_id", "catalog_resource_instance_id"],
+ "payload": "{}/catalog_service_property.jinja".format(PAYLOADS_DIR),
+ "payload-parameters": [
+ "unique_id",
+ "parent_unique_id",
+ "owner_id",
+ "input_name",
+ "input_value",
+ "schema_type",
+ "property_type",
+ ],
+ "success_code": 200,
+ "headers": {
+ "Accept": "application/json",
+ "Content-Type": "application/json",
+ "USER_ID": self.config.sdc.SDC_DESIGNER_USER_ID,
+ "X-TransactionId": str(uuid.uuid4()),
+ "X-FromAppId": application_id,
+ },
+ "auth": (
+ self.config.sdc.GLOBAL_SDC_USERNAME,
+ self.config.sdc.GLOBAL_SDC_PASSWORD,
+ ),
+ },
+ "ADD_CATALOG_SERVICE_INPUT": {
+ "verb": "POST",
+ "description": "Add an input value for a VF in a Service",
+ "uri": partial(
+ "{endpoint}{service_path}/{catalog_service_id}/resourceInstance/{catalog_resource_instance_id}/inputs".format,
+ endpoint=self.config.sdc.SDC_BE_ENDPOINT,
+ service_path=self.config.sdc.SDC_CATALOG_RESOURCES_PATH,
+ ),
+ "uri-parameters": ["catalog_service_id", "catalog_resource_instance_id"],
+ "payload": "{}/catalog_service_property.jinja".format(PAYLOADS_DIR),
+ "payload-parameters": [
+ "unique_id",
+ "parent_unique_id",
+ "owner_id",
+ "input_name",
+ "input_value",
+ ],
+ "success_code": 200,
+ "headers": {
+ "Accept": "application/json",
+ "Content-Type": "application/json",
+ "USER_ID": self.config.sdc.SDC_DESIGNER_USER_ID,
+ "X-TransactionId": str(uuid.uuid4()),
+ "X-FromAppId": application_id,
+ },
+ "auth": (
+ self.config.sdc.GLOBAL_SDC_USERNAME,
+ self.config.sdc.GLOBAL_SDC_PASSWORD,
+ ),
+ },
+ "GET_SDC_SERVICE": {
+ "verb": "GET",
+ "description": "Gets a service from the SDC Catalog",
+ "uri": partial(
+ "{endpoint}{service_path}/{catalog_service_id}".format,
+ endpoint=self.config.sdc.SDC_BE_ENDPOINT,
+ service_path=self.config.sdc.SDC_CATALOG_SERVICES_PATH,
+ ),
+ "uri-parameters": ["catalog_service_id"],
+ "success_code": 200,
+ "headers": {
+ "Accept": "application/json",
+ "Content-Type": "application/json",
+ "USER_ID": self.config.sdc.SDC_DESIGNER_USER_ID,
+ "X-TransactionId": str(uuid.uuid4()),
+ "X-FromAppId": application_id,
+ },
+ "auth": (
+ self.config.sdc.GLOBAL_SDC_USERNAME,
+ self.config.sdc.GLOBAL_SDC_PASSWORD,
+ ),
+ },
+ "GET_SERVICES": {
+ "verb": "GET",
+ "description": "Get all services in the SDC catalog",
+ "uri": partial(
+ "{endpoint}{service_path}".format,
+ endpoint=self.config.sdc.SDC_BE_ENDPOINT,
+ service_path=self.config.sdc.SDC_SCREEN_PATH,
+ ),
+ "success_code": 200,
+ "headers": {
+ "Accept": "application/json",
+ "Content-Type": "application/json",
+ "USER_ID": self.config.sdc.SDC_DESIGNER_USER_ID,
+ "X-TransactionId": str(uuid.uuid4()),
+ "X-FromAppId": application_id,
+ },
+ "return_data": {"services": ("services",)},
+ "auth": (
+ self.config.sdc.GLOBAL_SDC_USERNAME,
+ self.config.sdc.GLOBAL_SDC_PASSWORD,
+ ),
+ },
+ "GET_SERVICE_DISTRIBUTION": {
+ "verb": "GET",
+ "description": "Gets the distribution for a service from the SDC Catalog",
+ "uri": partial(
+ "{endpoint}{service_path}/{distribution_service_id}/distribution".format,
+ endpoint=self.config.sdc.SDC_BE_ENDPOINT,
+ service_path=self.config.sdc.SDC_CATALOG_SERVICES_PATH,
+ ),
+ "uri-parameters": ["distribution_service_id"],
+ "success_code": 200,
+ "headers": {
+ "Accept": "application/json",
+ "Content-Type": "application/json",
+ "USER_ID": self.config.sdc.SDC_DESIGNER_USER_ID,
+ "X-TransactionId": str(uuid.uuid4()),
+ "X-FromAppId": application_id,
+ },
+ "auth": (
+ self.config.sdc.GLOBAL_SDC_USERNAME,
+ self.config.sdc.GLOBAL_SDC_PASSWORD,
+ ),
+ },
+ "GET_SERVICE_DISTRIBUTION_DETAILS": {
+ "verb": "GET",
+ "description": "Gets the distribution details for a service from the SDC Catalog",
+ "uri": partial(
+ "{endpoint}{service_path}/distribution/{distribution_id}".format,
+ endpoint=self.config.sdc.SDC_BE_ENDPOINT,
+ service_path=self.config.sdc.SDC_CATALOG_SERVICES_PATH,
+ ),
+ "uri-parameters": ["distribution_id"],
+ "success_code": 200,
+ "headers": {
+ "Accept": "application/json",
+ "Content-Type": "application/json",
+ "USER_ID": self.config.sdc.SDC_DESIGNER_USER_ID,
+ "X-TransactionId": str(uuid.uuid4()),
+ "X-FromAppId": application_id,
+ },
+ "auth": (
+ self.config.sdc.GLOBAL_SDC_USERNAME,
+ self.config.sdc.GLOBAL_SDC_PASSWORD,
+ ),
+ },
+ "GET_SDC_CSAR": {
+ "verb": "GET",
+ "description": "Returns the CSAR for a service.",
+ "uri": partial(
+ "{endpoint}{service_path}/{catalog_service_id}/artifacts/{csar_artifact_id}".format,
+ endpoint=self.config.sdc.SDC_BE_ENDPOINT,
+ service_path=self.config.sdc.SDC_CATALOG_SERVICES_PATH,
+ ),
+ "uri-parameters": ["catalog_service_id", "csar_artifact_id"],
+ "success_code": 200,
+ "headers": {
+ "Accept": "application/json",
+ "Content-Type": "application/json",
+ "USER_ID": self.config.sdc.SDC_DESIGNER_USER_ID,
+ "X-TransactionId": str(uuid.uuid4()),
+ "X-FromAppId": application_id,
+ },
+ "auth": (
+ self.config.sdc.GLOBAL_SDC_USERNAME,
+ self.config.sdc.GLOBAL_SDC_PASSWORD,
+ ),
+ },
+ }