aboutsummaryrefslogtreecommitdiffstats
path: root/onap-client/onap_client/sdc/catalog/vnf_catalog.py
diff options
context:
space:
mode:
Diffstat (limited to 'onap-client/onap_client/sdc/catalog/vnf_catalog.py')
-rw-r--r--onap-client/onap_client/sdc/catalog/vnf_catalog.py133
1 files changed, 133 insertions, 0 deletions
diff --git a/onap-client/onap_client/sdc/catalog/vnf_catalog.py b/onap-client/onap_client/sdc/catalog/vnf_catalog.py
index c4fd3da..cd08dad 100644
--- a/onap-client/onap_client/sdc/catalog/vnf_catalog.py
+++ b/onap-client/onap_client/sdc/catalog/vnf_catalog.py
@@ -142,6 +142,52 @@ CATALOG_RESOURCES = {
sdc_properties.GLOBAL_SDC_PASSWORD,
),
},
+ "UPDATE_CATALOG_RESOURCE": {
+ "verb": "PUT",
+ "description": "Creates a new version of a VF resource",
+ "uri": partial(
+ "{endpoint}{service_path}/{catalog_resource_id}".format,
+ endpoint=sdc_properties.SDC_BE_ENDPOINT,
+ service_path=sdc_properties.SDC_CATALOG_RESOURCES_PATH,
+ ),
+ "uri-parameters": ["catalog_resource_id"],
+ "success_code": 200,
+ "payload": "{}/generic_payload.jinja".format(PAYLOADS_DIR),
+ "payload-parameters": ["payload_data"],
+ "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,
+ ),
+ },
+ "CHECKOUT_CATALOG_RESOURCE": {
+ "verb": "POST",
+ "description": "Checks out a VF from the catalog",
+ "uri": partial(
+ "{endpoint}{service_path}/{catalog_resource_id}/lifecycleState/CHECKOUT".format,
+ endpoint=sdc_properties.SDC_BE_ENDPOINT,
+ service_path=sdc_properties.SDC_CATALOG_RESOURCES_PATH,
+ ),
+ "uri-parameters": ["catalog_resource_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,
+ ),
+ },
"ADD_CATALOG_RESOURCE_PROPERTY": {
"verb": "POST",
"description": "Adds an property value for a VNF",
@@ -174,6 +220,38 @@ CATALOG_RESOURCES = {
sdc_properties.GLOBAL_SDC_PASSWORD,
),
},
+ "ADD_CATALOG_RESOURCE_PROPERTY_NON_VF": {
+ "verb": "POST",
+ "description": "Adds an property value for a VNF",
+ "uri": partial(
+ "{endpoint}{service_path}/{catalog_resource_id}/resourceInstance/{catalog_resource_instance_id}/properties".format,
+ endpoint=sdc_properties.SDC_BE_ENDPOINT,
+ service_path=sdc_properties.SDC_CATALOG_RESOURCES_PATH,
+ ),
+ "payload": "{}/catalog_vnf_property.jinja".format(PAYLOADS_DIR),
+ "payload-parameters": [
+ "unique_id",
+ "parent_unique_id",
+ "owner_id",
+ "property_name",
+ "property_default_value",
+ "schema_type",
+ "property_type",
+ ],
+ "uri-parameters": ["catalog_resource_id", "catalog_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,
+ ),
+ },
"ADD_CATALOG_RESOURCE_POLICY": {
"verb": "POST",
"description": "Adds an policy resource to a VNF",
@@ -362,6 +440,39 @@ CATALOG_RESOURCES = {
sdc_properties.GLOBAL_SDC_PASSWORD,
),
},
+ "ADD_RESOURCE_RELATIONSHIP": {
+ "verb": "POST",
+ "description": "Creates a relationship between two resources in a VF",
+ "uri": partial(
+ "{endpoint}{service_path}/{catalog_resource_id}/resourceInstance/associate".format,
+ endpoint=sdc_properties.SDC_BE_ENDPOINT,
+ service_path=sdc_properties.SDC_CATALOG_RESOURCES_PATH,
+ ),
+ "uri-parameters": ["catalog_resource_id"],
+ "payload": "{}/add_resource_relationship.jinja".format(PAYLOADS_DIR),
+ "payload-parameters": [
+ "from_node_resource_id",
+ "to_node_resource_id",
+ "relationship_type",
+ "capability_name",
+ "capability_owner_id",
+ "capability_id",
+ "requirement_name",
+ "requirement_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_CATALOG_RESOURCE": {
"verb": "GET",
"description": "Gets a VNF in the SDC catalog",
@@ -385,6 +496,28 @@ CATALOG_RESOURCES = {
sdc_properties.GLOBAL_SDC_PASSWORD,
),
},
+ "GET_CATALOG_RESOURCE_METADATA": {
+ "verb": "GET",
+ "description": "Gets metadata for a VNF in the SDC catalog",
+ "uri": partial(
+ "{endpoint}{service_path}/{catalog_resource_id}/filteredDataByParams?include=metadata".format,
+ endpoint=sdc_properties.SDC_BE_ENDPOINT,
+ service_path=sdc_properties.SDC_CATALOG_RESOURCES_PATH,
+ ),
+ "uri-parameters": ["catalog_resource_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_RESOURCES": {
"verb": "GET",
"description": "Get all resources in the SDC catalog",