*** Settings *** Documentation The main interface for interacting with ASDC. It handles low level stuff like managing the http request library and DCAE required fields Library RequestsLibrary Library UUID Library JSONUtils Library OperatingSystem Library Collections Library ExtendedSelenium2Library Library HttpLibrary.HTTP Library String Library StringTemplater Library ArchiveLibrary Library HEATUtils Resource global_properties.robot Resource browser_setup.robot Resource json_templater.robot *** Variables *** ${ASDC_DESIGNER_USER_ID} cs0008 ${ASDC_TESTER_USER_ID} jm0007 ${ASDC_GOVERNOR_USER_ID} gv0001 ${ASDC_OPS_USER_ID} op0001 ${ASDC_HEALTH_CHECK_PATH} /sdc1/rest/healthCheck ${ASDC_VENDOR_LICENSE_MODEL_PATH} /onboarding-api/v1.0/vendor-license-models ${ASDC_VENDOR_SOFTWARE_PRODUCT_PATH} /onboarding-api/v1.0/vendor-software-products ${ASDC_VENDOR_KEY_GROUP_PATH} /license-key-groups ${ASDC_VENDOR_ENTITLEMENT_POOL_PATH} /entitlement-pools ${ASDC_VENDOR_FEATURE_GROUP_PATH} /feature-groups ${ASDC_VENDOR_LICENSE_AGREEMENT_PATH} /license-agreements ${ASDC_VENDOR_ACTIONS_PATH} /actions ${ASDC_VENDOR_SOFTWARE_UPLOAD_PATH} /orchestration-template-candidate ${ASDC_FE_CATALOG_RESOURCES_PATH} /sdc1/feProxy/rest/v1/catalog/resources ${ASDC_FE_CATALOG_SERVICES_PATH} /sdc1/feProxy/rest/v1/catalog/services ${ASDC_CATALOG_RESOURCES_PATH} /sdc2/rest/v1/catalog/resources ${ASDC_CATALOG_SERVICES_PATH} /sdc2/rest/v1/catalog/services ${ASDC_CATALOG_INACTIVE_RESOURCES_PATH} /sdc2/rest/v1/inactiveComponents/resource ${ASDC_CATALOG_RESOURCES_QUERY_PATH} /sdc2/rest/v1/catalog/resources/resourceName ${ASDC_CATALOG_INACTIVE_SERVICES_PATH} /sdc2/rest/v1/inactiveComponents/service ${ASDC_CATALOG_LIFECYCLE_PATH} /lifecycleState ${ASDC_CATALOG_SERVICE_RESOURCE_INSTANCE_PATH} /resourceInstance ${ASDC_CATALOG_SERVICE_RESOURCE_ARTIFACT_PATH} /artifacts ${ASDC_CATALOG_SERVICE_DISTRIBUTION_STATE_PATH} /distribution-state ${ASDC_CATALOG_SERVICE_DISTRIBUTION_PATH} /distribution ${ASDC_DISTRIBUTION_STATE_APPROVE_PATH} /approve ${ASDC_CATALOG_SERVICE_DISTRIBUTION_ACTIVATE_PATH} /distribution/PROD/activate ${ASDC_LICENSE_MODEL_TEMPLATE} robot/assets/templates/asdc/license_model.template ${ASDC_KEY_GROUP_TEMPLATE} robot/assets/templates/asdc/key_group.template ${ASDC_ENTITLEMENT_POOL_TEMPLATE} robot/assets/templates/asdc/entitlement_pool.template ${ASDC_FEATURE_GROUP_TEMPLATE} robot/assets/templates/asdc/feature_group.template ${ASDC_LICENSE_AGREEMENT_TEMPLATE} robot/assets/templates/asdc/license_agreement.template ${ASDC_ACTION_TEMPLATE} robot/assets/templates/asdc/action.template ${ASDC_SOFTWARE_PRODUCT_TEMPLATE} robot/assets/templates/asdc/software_product.template ${ASDC_ARTIFACT_UPLOAD_TEMPLATE} robot/assets/templates/asdc/artifact_upload.template ${ASDC_CATALOG_RESOURCE_TEMPLATE} robot/assets/templates/asdc/catalog_resource.template ${ASDC_USER_REMARKS_TEMPLATE} robot/assets/templates/asdc/user_remarks.template ${ASDC_CATALOG_SERVICE_TEMPLATE} robot/assets/templates/asdc/catalog_service.template ${ASDC_RESOURCE_INSTANCE_TEMPLATE} robot/assets/templates/asdc/resource_instance.template ${ASDC_RESOURCE_INSTANCE_VNF_PROPERTIES_TEMPLATE} robot/assets/templates/asdc/catalog_vnf_properties.template ${ASDC_RESOURCE_INSTANCE_VNF_INPUTS_TEMPLATE} robot/assets/templates/asdc/catalog_vnf_inputs.template ${SDC_CATALOG_NET_RESOURCE_INPUT_TEMPLATE} robot/assets/templates/asdc/catalog_net_input_properties.template ${ASDC_ALLOTTED_RESOURCE_CATALOG_RESOURCE_TEMPLATE} robot/assets/templates/asdc/catalog_resource_alloted_resource.template ${SDC_CATALOG_ALLOTTED_RESOURCE_PROPERTIES_TEMPLATE} robot/assets/templates/asdc/catalog_allotted_properties.template ${SDC_CATALOG_ALLOTTED_RESOURCE_INPUTS_TEMPLATE} robot/assets/templates/asdc/catalog_allotted_inputs.template ${SDC_CATALOG_DEPLOYMENT_ARTIFACT_PATH} robot/assets/asdc/blueprints/ ${ASDC_FE_ENDPOINT} ${GLOBAL_ASDC_SERVER_PROTOCOL}://${GLOBAL_INJECTED_SDC_FE_IP_ADDR}:${GLOBAL_ASDC_FE_PORT} ${ASDC_BE_ENDPOINT} ${GLOBAL_ASDC_SERVER_PROTOCOL}://${GLOBAL_INJECTED_SDC_BE_IP_ADDR}:${GLOBAL_ASDC_BE_PORT} ${ASDC_BE_ONBOARD_ENDPOINT} ${GLOBAL_ASDC_SERVER_PROTOCOL}://${GLOBAL_INJECTED_SDC_BE_ONBOARD_IP_ADDR}:${GLOBAL_ASDC_BE_ONBOARD_PORT} *** Keywords *** Distribute Model From ASDC [Documentation] goes end to end creating all the asdc objects based ona model and distributing it to the systems. it then returns the service name, vf name and vf module name [Arguments] ${model_zip_path} ${catalog_service_name}= ${cds}= ${service}= # For Testing use random service names #${random}= Get Current Date #${catalog_service_id}= Add ASDC Catalog Service ${catalog_service_name}_${random} ${catalog_service_id}= Add ASDC Catalog Service ${catalog_service_name} ${catalog_resource_ids}= Create List ${catalog_resources}= Create Dictionary ##### TODO: Support for Multiple resources of one type in a service ###### # The zip list is the resources - no mechanism to indicate more than 1 of the items in the zip list # GLOBAL_SERVICE_VNF_MAPPING has the logical mapping but its not the same key as model_zip_path # ${vnflist}= Get From Dictionary ${GLOBAL_SERVICE_VNF_MAPPING} ${service} # Save the resource_id in a dictionary keyed byt the resource NAme in the zipfile name (vFWDT_vFWSNK.zip or vFWDT_vPKG.zip) # Create the resources but dont immediately add resource # Add Resource to Service in a separate FOR loop # TODO: CHECK vCPE models to make sure they aren't broken with the split ${resource_types}= Create Dictionary : FOR ${zip} IN @{model_zip_path} \ ${loop_catalog_resource_id}= Setup ASDC Catalog Resource ${zip} ${cds} # zip can be vFW.zip or vFWDT_VFWSNK.zip \ ${resource_type_match}= Get Regexp Matches ${zip} ${service}_(.*)\.zip 1 # Need to be able to distribute preload for vFWCL vFWSNK and vFWDT vFWSNK to prepend service to vnf_type \ ${resource_type_string}= Set Variable If len(${resource_type_match})==0 ${service} ${service}${resource_type_match[0]} \ Set To Dictionary ${resource_types} ${resource_type_string} ${loop_catalog_resource_id} \ Append To List ${catalog_resource_ids} ${loop_catalog_resource_id} ${vnflist}= Get From Dictionary ${GLOBAL_SERVICE_VNF_MAPPING} ${service} # Spread the icons on the pallette starting on the left ${xoffset}= Set
#!/usr/bin/env sh
#
# ============LICENSE_START=======================================================
#  Copyright (C) 2018 Ericsson. All rights reserved.
#  Modifications Copyright (C) 2019-2022 Nordix Foundation.
#  Modifications Copyright (C) 2020-2021 AT&T.
# ================================================================================
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
# ============LICENSE_END=========================================================
#

KEYSTORE="${KEYSTORE:-$POLICY_HOME/etc/ssl/policy-keystore}"
TRUSTSTORE="${TRUSTSTORE:-$POLICY_HOME/etc/ssl/policy-truststore}"
KEYSTORE_PASSWD="${KEYSTORE_PASSWD:-Pol1cy_0nap}"
TRUSTSTORE_PASSWD="${TRUSTSTORE_PASSWD:-Pol1cy_0nap}"

if [ "$#" -eq 1 ]; then
    CONFIG_FILE=$1
else
    CONFIG_FILE=${CONFIG_FILE}
fi

if [ -z "$CONFIG_FILE" ]; then
    CONFIG_FILE="${POLICY_HOME}/etc/defaultConfig.json"
fi

if [ -f "${POLICY_HOME}/etc/mounted/policy-truststore" ]; then
    echo "overriding policy-truststore"
    cp -f "${POLICY_HOME}"/etc/mounted/policy-truststore "${TRUSTSTORE}"
fi

if [ -f "${POLICY_HOME}/etc/mounted/policy-keystore" ]; then
    echo "overriding policy-keystore"
    cp -f "${POLICY_HOME}"/etc/mounted/policy-keystore "${KEYSTORE}"
fi

if [ -f "${POLICY_HOME}/etc/mounted/logback.xml" ]; then
    echo "overriding logback.xml"
    cp -f "${POLICY_HOME}"/etc/mounted/logback.xml "${POLICY_HOME}"/etc/
fi

echo "Policy distribution config file: $CONFIG_FILE"

$JAVA_HOME/bin/java -cp "${POLICY_HOME}/etc:${POLICY_HOME}/lib/*" -Dlogback.configurationFile="${POLICY_HOME}/etc/logback.xml" -Djavax.net.ssl.keyStore="${KEYSTORE}" -Djavax.net.ssl.keyStorePassword="${KEYSTORE_PASSWD}" -Djavax.net.ssl.trustStore="${TRUSTSTORE}" -Djavax.net.ssl.trustStorePassword="${TRUSTSTORE_PASSWD}" org.onap.policy.distribution.main.startstop.Main -c "${CONFIG_FILE}"
urn] ${resp} Setup SDC Catalog Resource GenericNeutronNet Properties [Documentation] Set up GenericNeutronNet properties and inputs [Arguments] ${catalog_service_id} ${nf_role} ${catalog_parent_service_id} ${resp}= Get ASDC Catalog Resource Component Instances Properties ${catalog_service_id} ${componentInstances} Set Variable @{resp['componentInstancesProperties']} # componentInstances can have 1 or more than 1 entry ${passed}= Run Keyword And Return Status Evaluate type(${componentInstances}) ${type}= Run Keyword If ${passed} Evaluate type(${componentInstances}) ${componentInstancesList}= Run Keyword If "${type}"!="" Create List ${componentInstances} ... ELSE Set Variable ${componentInstances} :FOR ${item} IN @{componentInstancesList} \ ${test} ${v}= Run Keyword and Ignore Error Should Contain ${item} ${nf_role} \ Run Keyword If '${test}' == 'FAIL' Continue For Loop \ ${componentInstance1}= Set Variable ${item} :FOR ${comp} IN @{resp['componentInstancesProperties']["${componentInstance1}"]} \ ${name} Set Variable ${comp['name']} \ ${test} ${v}= Run Keyword and Ignore Error Should Contain ${name} network_role \ Run Keyword If '${test}' == 'FAIL' Continue For Loop \ ${description} Set Variable ${comp['description']} \ ${description}= Replace String ${description} ${\n} \ \ ${uniqueId} Set Variable ${comp['uniqueId']} \ ${parentUniqueId} Set Variable ${comp['parentUniqueId']} \ ${ownerId} Set Variable ${comp['ownerId']} \ ${dict}= Create Dictionary parentUniqueId=${parentUniqueId} ownerId=${ownerId} uniqueId=${uniqueId} description=${description} \ Run Keyword If '${name}'=='network_role' Set To Dictionary ${dict} name=${name} value=${nf_role} \ ${data}= Fill JSON Template File ${SDC_CATALOG_NET_RESOURCE_INPUT_TEMPLATE} ${dict} \ ${response}= Set ASDC Catalog Resource Component Instance Properties ${catalog_parent_service_id} ${catalog_service_id} ${data} #\ Log To Console resp=${response} [Return] Setup SDC Catalog Resource AllottedResource Properties [Documentation] Set up Allotted Resource properties and inputs [Arguments] ${catalog_service_id} ${nf_role} ${catalog_resource_id} ${invariantUUID} ${UUID} ${node_type} # Set component instances properties ${nf_role_lc}= Convert To Lowercase ${nf_role} ${resp}= Get ASDC Catalog Resource Component Instances Properties For Resource ${catalog_resource_id} ${componentInstances} Set Variable @{resp['componentInstancesProperties']} # componentInstances can have 1 or more than 1 entry ${passed}= Run Keyword And Return Status Evaluate type(${componentInstances}) ${type}= Run Keyword If ${passed} Evaluate type(${componentInstances}) ${componentInstancesList}= Run Keyword If "${type}"!="" Create List ${componentInstances} ... ELSE Set Variable ${componentInstances} :FOR ${item} IN @{componentInstancesList} \ ${test} ${v}= Run Keyword and Ignore Error Should Contain ${item} ${nf_role_lc} \ Run Keyword If '${test}' == 'FAIL' Continue For Loop \ ${componentInstance1}= Set Variable ${item} ${dict}= Create Dictionary :FOR ${comp} IN @{resp['componentInstancesProperties']["${componentInstance1}"]} \ ${name} Set Variable ${comp['name']} \ ${test} ${v}= Run Keyword and Ignore Error Should Contain Any ${name} network_role providing_service_invariant_uuid providing_service_uuid providing_service_name uniqueId \ Run Keyword If '${test}' == 'FAIL' Continue For Loop \ ${parentUniqueId} Set Variable ${comp['parentUniqueId']} \ ${ownerId} Set Variable ${comp['ownerId']} \ Set To Dictionary ${dict} parentUniqueId=${parentUniqueId} ownerId=${ownerId} \ Run Keyword If '${name}'=='providing_service_invariant_uuid' Set To Dictionary ${dict} providing_service_invariant_uuid=${invariantUUID} \ Run Keyword If '${name}'=='providing_service_uuid' Set To Dictionary ${dict} providing_service_uuid=${UUID} \ Run Keyword If '${name}'=='providing_service_name' Set To Dictionary ${dict} providing_service_name=${node_type} # Sets it for each loop but should be one \ ${uniqueId} Set Variable ${comp['uniqueId']} \ ${uniqueId} Fetch From Left ${uniqueId} . \ Set To Dictionary ${dict} uniqueId=${uniqueId} ${data}= Fill JSON Template File ${SDC_CATALOG_ALLOTTED_RESOURCE_PROPERTIES_TEMPLATE} ${dict} ${response}= Set ASDC Catalog Resource Component Instance Properties For Resource ${catalog_resource_id} ${componentInstance1} ${data} Log To Console resp=${response} Setup SDC Catalog Resource AllottedResource Inputs [Documentation] Set up Allotted Resource inputs [Arguments] ${catalog_service_id} ${nf_role} ${catalog_resource_id} # Set vnf inputs ${resp}= Get ASDC Catalog Resource Inputs ${catalog_resource_id} ${dict}= Create Dictionary :FOR ${comp} in @{resp['inputs']} \ ${name} Set Variable ${comp['name']} \ ${uid} Set Variable ${comp['uniqueId']} \ Run Keyword If '${name}'=='nf_type' Set To Dictionary ${dict} nf_type=${nf_role} nf_type_uid=${uid} \ Run Keyword If '${name}'=='nf_role' Set To Dictionary ${dict} nf_role=${nf_role} nf_role_uid=${uid} ${data}= Fill JSON Template File ${SDC_CATALOG_ALLOTTED_RESOURCE_INPUTS_TEMPLATE} ${dict} ${response}= Set ASDC Catalog Resource VNF Inputs ${catalog_resource_id} ${data} [Return] ${response} Setup ASDC Catalog Resource CDS Properties [Documentation] Set up vfwng VNF properties and inputs for CDS [Arguments] ${catalog_resource_id} # Set vnf module properties ${resp}= Get ASDC Catalog Resource Component Instances ${catalog_resource_id} :FOR ${comp} in @{resp['componentInstances']} \ ${name} Set Variable ${comp['name']} \ ${uniqueId} Set Variable ${comp['uniqueId']} \ ${actualComponentUid} Set Variable ${comp['actualComponentUid']} \ ${test} ${v}= Run Keyword and Ignore Error Should Contain ${name} abstract_ \ Run Keyword If '${test}' == 'FAIL' Continue For Loop \ ${response}= Get ASDC Catalog Resource Component Instance Properties ${catalog_resource_id} ${uniqueId} ${actualComponentUid} \ ${dict}= Create Dictionary parent_id=${response[6]['parentUniqueId']} \ Run Keyword If '${name}'=='abstract_vfw' Set To Dictionary ${dict} nfc_function=vfw nfc_naming_policy=SDNC_Policy.ONAP_VFW_NAMING_TIMESTAMP \ Run Keyword If '${name}'=='abstract_vpg' Set To Dictionary ${dict} nfc_function=vpg nfc_naming_policy=SDNC_Policy.ONAP_VPG_NAMING_TIMESTAMP \ Run Keyword If '${name}'=='abstract_vsn' Set To Dictionary ${dict} nfc_function=vsn nfc_naming_policy=SDNC_Policy.ONAP_VSN_NAMING_TIMESTAMP \ ${data}= Fill JSON Template File ${ASDC_RESOURCE_INSTANCE_VNF_PROPERTIES_TEMPLATE} ${dict} \ ${response}= Set ASDC Catalog Resource Component Instance Properties ${catalog_resource_id} ${uniqueId} ${data} \ Log To Console resp=${response} # Set vnf inputs ${resp}= Get ASDC Catalog Resource Inputs ${catalog_resource_id} ${dict}= Create Dictionary :FOR ${comp} in @{resp['inputs']} \ ${name} Set Variable ${comp['name']} \ ${uid} Set Variable ${comp['uniqueId']} \ Run Keyword If '${name}'=='nf_function' Set To Dictionary ${dict} nf_function=ONAP-FIREWALL nf_function_uid=${uid} \ Run Keyword If '${name}'=='nf_type' Set To Dictionary ${dict} nf_type=FIREWALL nf_type_uid=${uid} \ Run Keyword If '${name}'=='nf_naming_code' Set To Dictionary ${dict} nf_naming_code=vfw nf_naming_code_uid=${uid} \ Run Keyword If '${name}'=='nf_role' Set To Dictionary ${dict} nf_role=vFW nf_role_uid=${uid} \ Run Keyword If '${name}'=='cloud_env' Set To Dictionary ${dict} cloud_env=openstack cloud_env_uid=${uid} ${data}= Fill JSON Template File ${ASDC_RESOURCE_INSTANCE_VNF_INPUTS_TEMPLATE} ${dict} ${response}= Set ASDC Catalog Resource VNF Inputs ${catalog_resource_id} ${data} Add ASDC License Model [Documentation] Creates an asdc license model and returns its id ${uuid}= Generate UUID ${shortened_uuid}= Evaluate str("${uuid}")[:23] ${map}= Create Dictionary vendor_name=${shortened_uuid} ${data}= Fill JSON Template File ${ASDC_LICENSE_MODEL_TEMPLATE} ${map} ${resp}= Run ASDC Post Request ${ASDC_VENDOR_LICENSE_MODEL_PATH} ${data} ${ASDC_DESIGNER_USER_ID} ${ASDC_BE_ONBOARD_ENDPOINT} Should Be Equal As Strings ${resp.status_code} 200 [Return] ${resp.json()['itemId']} ${resp.json()['version']['id']} Get ASDC License Model [Documentation] gets an asdc license model by its id [Arguments] ${id} ${version_id}=0.1 ${resp}= Run ASDC Get Request ${ASDC_VENDOR_LICENSE_MODEL_PATH}/${id}/versions/${version_id} ${ASDC_DESIGNER_USER_ID} ${ASDC_BE_ONBOARD_ENDPOINT} [Return] ${resp.json()} Get ASDC License Models [Documentation] gets an asdc license model by its id ${resp}= Run ASDC Get Request ${ASDC_VENDOR_LICENSE_MODEL_PATH} ${ASDC_DESIGNER_USER_ID} ${ASDC_BE_ONBOARD_ENDPOINT} [Return] ${resp.json()} Checkin ASDC License Model [Documentation] checksin an asdc license model by its id [Arguments] ${id} ${version_id}=0.1 ${map}= Create Dictionary action=Checkin ${data}= Fill JSON Template File ${ASDC_ACTION_TEMPLATE} ${map} ${resp}= Run ASDC Put Request ${ASDC_VENDOR_LICENSE_MODEL_PATH}/${id}/versions/${version_id}${ASDC_VENDOR_ACTIONS_PATH} ${data} ${ASDC_DESIGNER_USER_ID} ${ASDC_BE_ONBOARD_ENDPOINT} Should Be Equal As Strings ${resp.status_code} 200 [Return] ${resp.json()} Submit ASDC License Model [Documentation] submits an asdc license model by its id [Arguments] ${id} ${version_id}=0.1 ${map}= Create Dictionary action=Submit ${data}= Fill JSON Template File ${ASDC_ACTION_TEMPLATE} ${map} ${resp}= Run ASDC Put Request ${ASDC_VENDOR_LICENSE_MODEL_PATH}/${id}/versions/${version_id}${ASDC_VENDOR_ACTIONS_PATH} ${data} ${ASDC_DESIGNER_USER_ID} ${ASDC_BE_ONBOARD_ENDPOINT} Should Be Equal As Strings ${resp.status_code} 200 [Return] ${resp.json()} Checkin ASDC Software Product [Documentation] checksin an asdc Software Product by its id [Arguments] ${id} ${version_id}=0.1 ${map}= Create Dictionary action=Checkin ${data}= Fill JSON Template File ${ASDC_ACTION_TEMPLATE} ${map} ${resp}= Run ASDC Put Request ${ASDC_VENDOR_SOFTWARE_PRODUCT_PATH}/${id}/versions/${version_id}${ASDC_VENDOR_ACTIONS_PATH} ${data} ${ASDC_DESIGNER_USER_ID} ${ASDC_BE_ONBOARD_ENDPOINT} Should Be Equal As Strings ${resp.status_code} 200 [Return] ${resp.json()} Validate ASDC Software Product [Documentation] checksin an asdc Software Product by its id [Arguments] ${id} ${version_id}=0.1 ${data}= Catenate ${resp}= Run ASDC Put Request ${ASDC_VENDOR_SOFTWARE_PRODUCT_PATH}/${id}/versions/${version_id}/orchestration-template-candidate/process ${data} ${ASDC_DESIGNER_USER_ID} ${ASDC_BE_ONBOARD_ENDPOINT} Should Be Equal As Strings ${resp.status_code} 200 [Return] ${resp.json()} Submit ASDC Software Product [Documentation] submits an asdc Software Product by its id [Arguments] ${id} ${version_id}=0.1 ${map}= Create Dictionary action=Submit ${data}= Fill JSON Template File ${ASDC_ACTION_TEMPLATE} ${map} ${resp}= Run ASDC Put Request ${ASDC_VENDOR_SOFTWARE_PRODUCT_PATH}/${id}/versions/${version_id}${ASDC_VENDOR_ACTIONS_PATH} ${data} ${ASDC_DESIGNER_USER_ID} ${ASDC_BE_ONBOARD_ENDPOINT} Should Be Equal As Strings ${resp.status_code} 200 [Return] ${resp.json()} Package ASDC Software Product [Documentation] creates_package on an asdc Software Product by its id [Arguments] ${id} ${version_id}=0.1 ${map}= Create Dictionary action=Create_Package ${data}= Fill JSON Template File ${ASDC_ACTION_TEMPLATE} ${map} ${resp}= Run ASDC Put Request ${ASDC_VENDOR_SOFTWARE_PRODUCT_PATH}/${id}/versions/${version_id}${ASDC_VENDOR_ACTIONS_PATH} ${data} ${ASDC_DESIGNER_USER_ID} ${ASDC_BE_ONBOARD_ENDPOINT} Should Be Equal As Strings ${resp.status_code} 200 [Return] ${resp.json()} Add ASDC Entitlement Pool [Documentation] Creates an asdc Entitlement Pool and returns its id [Arguments] ${license_model_id} ${version_id}=0.1 ${uuid}= Generate UUID ${shortened_uuid}= Evaluate str("${uuid}")[:23] ${map}= Create Dictionary entitlement_pool_name=${shortened_uuid} ${data}= Fill JSON Template File ${ASDC_ENTITLEMENT_POOL_TEMPLATE} ${map} ${resp}= Run ASDC Post Request ${ASDC_VENDOR_LICENSE_MODEL_PATH}/${license_model_id}/versions/${version_id}${ASDC_VENDOR_ENTITLEMENT_POOL_PATH} ${data} ${ASDC_DESIGNER_USER_ID} ${ASDC_BE_ONBOARD_ENDPOINT} Should Be Equal As Strings ${resp.status_code} 200 [Return] ${resp.json()['value']} Get ASDC Entitlement Pool [Documentation] gets an asdc Entitlement Pool by its id [Arguments] ${license_model_id} ${pool_id} ${resp}= Run ASDC Get Request ${ASDC_VENDOR_LICENSE_MODEL_PATH}/${license_model_id}${ASDC_VENDOR_ENTITLEMENT_POOL_PATH}/${pool_id} ${ASDC_DESIGNER_USER_ID} ${ASDC_BE_ONBOARD_ENDPOINT} [Return] ${resp.json()} Add ASDC License Group [Documentation] Creates an asdc license group and returns its id [Arguments] ${license_model_id} ${version_id}=1.0 ${uuid}= Generate UUID ${shortened_uuid}= Evaluate str("${uuid}")[:23] ${map}= Create Dictionary key_group_name=${shortened_uuid} ${data}= Fill JSON Template File ${ASDC_KEY_GROUP_TEMPLATE} ${map} ${resp}= Run ASDC Post Request ${ASDC_VENDOR_LICENSE_MODEL_PATH}/${license_model_id}/versions/${version_id}${ASDC_VENDOR_KEY_GROUP_PATH} ${data} ${ASDC_DESIGNER_USER_ID} ${ASDC_BE_ONBOARD_ENDPOINT} Should Be Equal As Strings ${resp.status_code} 200 [Return] ${resp.json()['value']} Get ASDC License Group [Documentation] gets an asdc license group by its id [Arguments] ${license_model_id} ${group_id} ${version_id} ${resp}= Run ASDC Get Request ${ASDC_VENDOR_LICENSE_MODEL_PATH}/${license_model_id}/versions/${version_id}${ASDC_VENDOR_KEY_GROUP_PATH}/${group_id} ${ASDC_DESIGNER_USER_ID} ${ASDC_BE_ONBOARD_ENDPOINT} [Return] ${resp.json()} Add ASDC Feature Group [Documentation] Creates an asdc Feature Group and returns its id [Arguments] ${license_model_id} ${key_group_id} ${entitlement_pool_id} ${version_id}=0.1 ${uuid}= Generate UUID ${shortened_uuid}= Evaluate str("${uuid}")[:23] ${map}= Create Dictionary feature_group_name=${shortened_uuid} key_group_id=${key_group_id} entitlement_pool_id=${entitlement_pool_id} manufacturer_reference_number=mrn${shortened_uuid} ${data}= Fill JSON Template File ${ASDC_FEATURE_GROUP_TEMPLATE} ${map} ${resp}= Run ASDC Post Request ${ASDC_VENDOR_LICENSE_MODEL_PATH}/${license_model_id}/versions/${version_id}${ASDC_VENDOR_FEATURE_GROUP_PATH} ${data} ${ASDC_DESIGNER_USER_ID} ${ASDC_BE_ONBOARD_ENDPOINT} Should Be Equal As Strings ${resp.status_code} 200 [Return] ${resp.json()['value']} Get ASDC Feature Group [Documentation] gets an asdc Feature Group by its id [Arguments] ${license_model_id} ${group_id} ${resp}= Run ASDC Get Request ${ASDC_VENDOR_LICENSE_MODEL_PATH}/${license_model_id}${ASDC_VENDOR_FEATURE_GROUP_PATH}/${group_id} ${ASDC_DESIGNER_USER_ID} ${ASDC_BE_ONBOARD_ENDPOINT} [Return] ${resp.json()} Add ASDC License Agreement [Documentation] Creates an asdc License Agreement and returns its id [Arguments] ${license_model_id} ${feature_group_id} ${version_id}=0.1 ${uuid}= Generate UUID ${shortened_uuid}= Evaluate str("${uuid}")[:23] ${map}= Create Dictionary license_agreement_name=${shortened_uuid} feature_group_id=${feature_group_id} ${data}= Fill JSON Template File ${ASDC_LICENSE_AGREEMENT_TEMPLATE} ${map} ${resp}= Run ASDC Post Request ${ASDC_VENDOR_LICENSE_MODEL_PATH}/${license_model_id}/versions/${version_id}${ASDC_VENDOR_LICENSE_AGREEMENT_PATH} ${data} ${ASDC_DESIGNER_USER_ID} ${ASDC_BE_ONBOARD_ENDPOINT} Should Be Equal As Strings ${resp.status_code} 200 [Return] ${resp.json()['value']} Get ASDC License Agreement [Documentation] gets an asdc License Agreement by its id [Arguments] ${license_model_id} ${agreement_id} ${resp}= Run ASDC Get Request ${ASDC_VENDOR_LICENSE_MODEL_PATH}/${license_model_id}${ASDC_VENDOR_LICENSE_AGREEMENT_PATH}/${agreement_id} ${ASDC_DESIGNER_USER_ID} ${ASDC_BE_ONBOARD_ENDPOINT} [Return] ${resp.json()} Add ASDC Software Product [Documentation] Creates an asdc Software Product and returns its id [Arguments] ${license_agreement_id} ${feature_group_id} ${license_model_name} ${license_model_id} ${license_model_version_id} ${name_prefix} ${uuid}= Generate UUID ${shortened_uuid}= Evaluate str("${uuid}")[:13] ${software_product_name}= Catenate ${name_prefix} ${shortened_uuid} ${map}= Create Dictionary software_product_name=${software_product_name} feature_group_id=${feature_group_id} license_agreement_id=${license_agreement_id} vendor_name=${license_model_name} vendor_id=${license_model_id} version_id=${license_model_version_id} ${data}= Fill JSON Template File ${ASDC_SOFTWARE_PRODUCT_TEMPLATE} ${map} ${resp}= Run ASDC Post Request ${ASDC_VENDOR_SOFTWARE_PRODUCT_PATH} ${data} ${ASDC_DESIGNER_USER_ID} ${ASDC_BE_ONBOARD_ENDPOINT} Should Be Equal As Strings ${resp.status_code} 200 [Return] ${resp.json()['itemId']} ${resp.json()['version']['id']} Get ASDC Software Product [Documentation] gets an asdc Software Product by its id [Arguments] ${software_product_id} ${version_id}=0.1 ${resp}= Run ASDC Get Request ${ASDC_VENDOR_SOFTWARE_PRODUCT_PATH}/${software_product_id}/versions/${version_id} ${ASDC_DESIGNER_USER_ID} ${ASDC_BE_ONBOARD_ENDPOINT} [Return] ${resp.json()} Add ASDC Catalog Resource [Documentation] Creates an asdc Catalog Resource and returns its id [Arguments] ${license_agreement_id} ${software_product_name} ${license_model_name} ${software_product_id} ${map}= Create Dictionary software_product_id=${software_product_id} software_product_name=${software_product_name} license_agreement_id=${license_agreement_id} vendor_name=${license_model_name} ${data}= Fill JSON Template File ${ASDC_CATALOG_RESOURCE_TEMPLATE} ${map} ${resp}= Run ASDC Post Request ${ASDC_CATALOG_RESOURCES_PATH} ${data} ${ASDC_DESIGNER_USER_ID} Should Be Equal As Strings ${resp.status_code} 201 [Return] ${resp.json()['uniqueId']} Add ASDC Allotted Resource Catalog Resource [Documentation] Creates an asdc Allotted Resource Catalog Resource and returns its id [Arguments] ${license_agreement_id} ${software_product_name} ${license_model_name} ${software_product_id} ${subcategory} ${map}= Create Dictionary software_product_id=${software_product_id} software_product_name=${software_product_name} license_agreement_id=${license_agreement_id} vendor_name=${license_model_name} subcategory=${subcategory} ${data}= Fill JSON Template File ${ASDC_ALLOTTED_RESOURCE_CATALOG_RESOURCE_TEMPLATE} ${map} ${resp}= Run ASDC Post Request ${ASDC_CATALOG_RESOURCES_PATH} ${data} ${ASDC_DESIGNER_USER_ID} Should Be Equal As Strings ${resp.status_code} 201 [Return] ${resp.json()['uniqueId']} Mark ASDC Catalog Resource Inactive [Documentation] deletes an asdc Catalog Resource [Arguments] ${catalog_resource_id} ${resp}= Run ASDC Delete Request ${ASDC_CATALOG_RESOURCES_PATH}/${catalog_resource_id} ${ASDC_DESIGNER_USER_ID} Should Be Equal As Strings ${resp.status_code} 204 [Return] ${resp} Delete Inactive ASDC Catalog Resources [Documentation] delete all asdc Catalog Resources that are inactive ${resp}= Run ASDC Delete Request ${ASDC_CATALOG_INACTIVE_RESOURCES_PATH} ${ASDC_DESIGNER_USER_ID} Should Be Equal As Strings ${resp.status_code} 200 [Return] ${resp.json()} Get ASDC Catalog Resource [Documentation] gets an asdc Catalog Resource by its id [Arguments] ${catalog_resource_id} ${resp}= Run ASDC Get Request ${ASDC_CATALOG_RESOURCES_PATH}/${catalog_resource_id} ${ASDC_DESIGNER_USER_ID} [Return] ${resp.json()} Get ASDC Catalog Resource Component Instances [Documentation] gets asdc Catalog Resource Component Instances by its id [Arguments] ${catalog_resource_id} ${resp}= Run ASDC Get Request ${ASDC_FE_CATALOG_RESOURCES_PATH}/${catalog_resource_id}/filteredDataByParams?include=componentInstances ${ASDC_DESIGNER_USER_ID} ${ASDC_FE_ENDPOINT} [Return] ${resp.json()} Get ASDC Catalog Resource Deployment Artifact Properties [Documentation] gets asdc Catalog Resource Deployment Artiface Properties by its id [Arguments] ${catalog_resource_id} #${resp}= Run ASDC Get Request ${ASDC_CATALOG_SERVICES_PATH}/${catalog_resource_id}/filteredDataByParams?include=componentInstances ${ASDC_DESIGNER_USER_ID} ${ASDC_FE_ENDPOINT} ${resp}= Run ASDC Get Request ${ASDC_CATALOG_SERVICES_PATH}/${catalog_resource_id}/filteredDataByParams?include=deploymentArtifacts ${ASDC_DESIGNER_USER_ID} ${ASDC_FE_ENDPOINT} [Return] ${resp.json()} Get ASDC Catalog Resource Component Instances Properties [Documentation] gets asdc Catalog Resource Component Instances Properties by its id [Arguments] ${catalog_resource_id} #${resp}= Run ASDC Get Request ${ASDC_FE_CATALOG_RESOURCES_PATH}/${catalog_resource_id}/filteredDataByParams?include=componentInstancesProperties ${ASDC_DESIGNER_USER_ID} ${ASDC_FE_ENDPOINT} ${resp}= Run ASDC Get Request ${ASDC_CATALOG_SERVICES_PATH}/${catalog_resource_id}/filteredDataByParams?include=componentInstancesProperties ${ASDC_DESIGNER_USER_ID} ${ASDC_BE_ENDPOINT} [Return] ${resp.json()} Get ASDC Catalog Resource Component Instances Properties For Resource [Documentation] gets asdc Catalog Resource Component Instances Properties for a Resource (VF) by its id [Arguments] ${catalog_resource_id} ${resp}= Run ASDC Get Request ${ASDC_FE_CATALOG_RESOURCES_PATH}/${catalog_resource_id}/filteredDataByParams?include=componentInstancesProperties ${ASDC_DESIGNER_USER_ID} ${ASDC_FE_ENDPOINT} [Return] ${resp.json()} Get ASDC Catalog Resource Inputs [Documentation] gets asdc Catalog Inputs by its id [Arguments] ${catalog_resource_id} ${resp}= Run ASDC Get Request ${ASDC_FE_CATALOG_RESOURCES_PATH}/${catalog_resource_id}/filteredDataByParams?include=inputs ${ASDC_DESIGNER_USER_ID} ${ASDC_FE_ENDPOINT} [Return] ${resp.json()} Get ASDC Catalog Resource Component Instance Properties [Documentation] gets an asdc Catalog Resource properties by its id [Arguments] ${catalog_resource_id} ${component_instance_id} ${component_id} ${resp}= Run ASDC Get Request ${ASDC_FE_CATALOG_RESOURCES_PATH}/${catalog_resource_id}/componentInstances/${component_instance_id}/${component_id}/inputs ${ASDC_DESIGNER_USER_ID} ${ASDC_FE_ENDPOINT} [Return] ${resp.json()} Set ASDC Catalog Resource Component Instance Properties [Documentation] sets an asdc Catalog Resource by its id [Arguments] ${catalog_resource_id} ${component_parent_service_id} ${data} #${resp}= Run ASDC Post Request ${ASDC_FE_CATALOG_RESOURCES_PATH}/${component_parent_service_id}/resourceInstance/${catalog_resource_id}/inputs ${data} ${ASDC_DESIGNER_USER_ID} ${ASDC_FE_ENDPOINT} ${resp}= Run ASDC Post Request ${ASDC_FE_CATALOG_SERVICES_PATH}/${component_parent_service_id}/resourceInstance/${catalog_resource_id}/properties ${data} ${ASDC_DESIGNER_USER_ID} ${ASDC_FE_ENDPOINT} [Return] ${resp.json()} Set ASDC Catalog Resource Component Instance Properties For Resource [Documentation] sets an asdc Catalog Resource by its id [Arguments] ${catalog_parent_resource_id} ${catalog_resource_id} ${data} #${resp}= Run ASDC Post Request ${ASDC_FE_CATALOG_RESOURCES_PATH}/${catalog_parent_resource_id}/resourceInstance/${catalog_resource_id}/inputs ${data} ${ASDC_DESIGNER_USER_ID} ${ASDC_FE_ENDPOINT} ${resp}= Run ASDC Post Request ${ASDC_FE_CATALOG_RESOURCES_PATH}/${catalog_parent_resource_id}/resourceInstance/${catalog_resource_id}/properties ${data} ${ASDC_DESIGNER_USER_ID} ${ASDC_FE_ENDPOINT} [Return] ${resp.json()} Set CDS Catalog Resource Component Instance Properties [Documentation] sets an asdc Catalog Resource by its id [Arguments] ${catalog_resource_id} ${component_instance_id} ${data} ${resp}= Run ASDC Post Request ${ASDC_FE_CATALOG_RESOURCES_PATH}/${catalog_resource_id}/resourceInstance/${component_instance_id}/inputs ${data} ${ASDC_DESIGNER_USER_ID} ${ASDC_FE_ENDPOINT} [Return] ${resp.json()} Set ASDC Catalog Resource VNF Inputs [Documentation] sets an asdc Catalog Resource by its id [Arguments] ${catalog_resource_id} ${data} ${resp}= Run ASDC Post Request ${ASDC_FE_CATALOG_RESOURCES_PATH}/${catalog_resource_id}/update/inputs ${data} ${ASDC_DESIGNER_USER_ID} ${ASDC_FE_ENDPOINT} [Return] ${resp.json()} Get SDC Demo Vnf Catalog Resource [Documentation] gets resource id's for demonstration VNFs for instantiate [Arguments] ${service_name} ${resp}= Run ASDC Get Request ${ASDC_CATALOG_SERVICES_PATH}/serviceName/${service_name}/serviceVersion/1.0 @{ITEMS}= Copy List ${resp.json()['componentInstances']} ${demo_catalog_resource}= Create Dictionary :FOR ${ELEMENT} IN @{ITEMS} \ Log ${ELEMENT['name']} \ Log ${ELEMENT['groupInstances'][0]['groupName']} \ ${vnf}= Get VNF From Group Name ${ELEMENT['groupInstances'][0]['groupName']} ${service_name} \ ${vnf_data}= Create Dictionary vnf_type=${ELEMENT['name']} vf_module=${ELEMENT['groupInstances'][0]['groupName']} \ LOG ${vnf_data} \ Set To Dictionary ${demo_catalog_resource} ${vnf}=${vnf_data} \ LOG ${demo_catalog_resource} [Return] ${demo_catalog_resource} Get VNF From Group Name [Documentation] looks up vnf key from service mapping for a regex on groupName and service_name [Arguments] ${group_name} ${service_name} ${vnf}= Set Variable If ... ('${service_name}'=='demoVFWCL') and ('base_vfw' in '${group_name}') vFWSNK ... ('${service_name}'=='demoVFWCL') and ('base_vpkg' in '${group_name}') vPKG ... ('${service_name}'=='demoVLB') and ('base_vlb' in '${group_name}') vLB [Return] ${vnf} Checkin ASDC Catalog Resource [Documentation] checksin an asdc Catalog Resource by its id [Arguments] ${catalog_resource_id} ${map}= Create Dictionary user_remarks=Robot remarks ${data}= Fill JSON Template File ${ASDC_USER_REMARKS_TEMPLATE} ${map} ${resp}= Run ASDC Post Request ${ASDC_CATALOG_RESOURCES_PATH}/${catalog_resource_id}${ASDC_CATALOG_LIFECYCLE_PATH}/checkin ${data} ${ASDC_DESIGNER_USER_ID} Should Be Equal As Strings ${resp.status_code} 200 [Return] ${resp.json()} Request Certify ASDC Catalog Resource [Documentation] requests certify on an asdc Catalog Resource by its id [Arguments] ${catalog_resource_id} ${map}= Create Dictionary user_remarks=Robot remarks ${data}= Fill JSON Template File ${ASDC_USER_REMARKS_TEMPLATE} ${map} ${resp}= Run ASDC Post Request ${ASDC_CATALOG_RESOURCES_PATH}/${catalog_resource_id}${ASDC_CATALOG_LIFECYCLE_PATH}/certificationRequest ${data} ${ASDC_DESIGNER_USER_ID} Should Be Equal As Strings ${resp.status_code} 200 [Return] ${resp.json()} Start Certify ASDC Catalog Resource [Documentation] start certify an asdc Catalog Resource by its id [Arguments] ${catalog_resource_id} ${resp}= Run ASDC Post Request ${ASDC_CATALOG_RESOURCES_PATH}/${catalog_resource_id}${ASDC_CATALOG_LIFECYCLE_PATH}/startCertification ${None} ${ASDC_TESTER_USER_ID} Should Be Equal As Strings ${resp.status_code} 200 [Return] ${resp.json()} Certify ASDC Catalog Resource [Documentation] start certify an asdc Catalog Resource by its id and returns the new id [Arguments] ${catalog_resource_id} ${user_id}=${ASDC_TESTER_USER_ID} ${map}= Create Dictionary user_remarks=Robot remarks ${data}= Fill JSON Template File ${ASDC_USER_REMARKS_TEMPLATE} ${map} ${resp}= Run ASDC Post Request ${ASDC_CATALOG_RESOURCES_PATH}/${catalog_resource_id}${ASDC_CATALOG_LIFECYCLE_PATH}/certify ${data} ${user_id} Should Be Equal As Strings ${resp.status_code} 200 [Return] ${resp.json()['uniqueId']} Upload ASDC Heat Package [Documentation] Creates an asdc Software Product and returns its id [Arguments] ${software_product_id} ${file_path} ${version_id}=0.1 ${files}= Create Dictionary Create Multi Part ${files} upload ${file_path} contentType=application/zip ${resp}= Run ASDC Post Files Request ${ASDC_VENDOR_SOFTWARE_PRODUCT_PATH}/${software_product_id}/versions/${version_id}${ASDC_VENDOR_SOFTWARE_UPLOAD_PATH} ${files} ${ASDC_DESIGNER_USER_ID} ${ASDC_BE_ONBOARD_ENDPOINT} Should Be Equal As Strings ${resp.status_code} 200 Add ASDC Catalog Service [Documentation] Creates an asdc Catalog Service and returns its id [Arguments] ${catalog_service_name} ${uuid}= Generate UUID ${shortened_uuid}= Evaluate str("${uuid}")[:23] ${catalog_service_name}= Set Variable If '${catalog_service_name}' =='' ${shortened_uuid} ${catalog_service_name} ${map}= Create Dictionary service_name=${catalog_service_name} ${data}= Fill JSON Template File ${ASDC_CATALOG_SERVICE_TEMPLATE} ${map} ${resp}= Run ASDC Post Request ${ASDC_CATALOG_SERVICES_PATH} ${data} ${ASDC_DESIGNER_USER_ID} Should Be Equal As Strings ${resp.status_code} 201 [Return] ${resp.json()['uniqueId']} Mark ASDC Catalog Service Inactive [Documentation] Deletes an asdc Catalog Service [Arguments] ${catalog_service_id} ${resp}= Run ASDC Delete Request ${ASDC_CATALOG_SERVICES_PATH}/${catalog_service_id} ${ASDC_DESIGNER_USER_ID} Should Be Equal As Strings ${resp.status_code} 204 [Return] ${resp} Delete Inactive ASDC Catalog Services [Documentation] delete all asdc Catalog Serivces that are inactive ${resp}= Run ASDC Delete Request ${ASDC_CATALOG_INACTIVE_SERVICES_PATH} ${ASDC_DESIGNER_USER_ID} Should Be Equal As Strings ${resp.status_code} 200 [Return] ${resp.json()} Get ASDC Catalog Service [Documentation] gets an asdc Catalog Service by its id [Arguments] ${catalog_service_id} ${resp}= Run ASDC Get Request ${ASDC_CATALOG_SERVICES_PATH}/${catalog_service_id} ${ASDC_DESIGNER_USER_ID} [Return] ${resp.json()} Checkin ASDC Catalog Service [Documentation] checksin an asdc Catalog Service by its id [Arguments] ${catalog_service_id} ${map}= Create Dictionary user_remarks=Robot remarks ${data}= Fill JSON Template File ${ASDC_USER_REMARKS_TEMPLATE} ${map} ${resp}= Run ASDC Post Request ${ASDC_CATALOG_SERVICES_PATH}/${catalog_service_id}${ASDC_CATALOG_LIFECYCLE_PATH}/checkin ${data} ${ASDC_DESIGNER_USER_ID} Should Be Equal As Strings ${resp.status_code} 200 [Return] ${resp.json()} Request Certify ASDC Catalog Service [Documentation] requests certify on an asdc Catalog Service by its id [Arguments] ${catalog_service_id} ${map}= Create Dictionary user_remarks=Robot remarks ${data}= Fill JSON Template File ${ASDC_USER_REMARKS_TEMPLATE} ${map} ${resp}= Run ASDC Post Request ${ASDC_CATALOG_SERVICES_PATH}/${catalog_service_id}${ASDC_CATALOG_LIFECYCLE_PATH}/certificationRequest ${data} ${ASDC_DESIGNER_USER_ID} Should Be Equal As Strings ${resp.status_code} 200 [Return] ${resp.json()} Start Certify ASDC Catalog Service [Documentation] start certify an asdc Catalog Service by its id [Arguments] ${catalog_service_id} ${resp}= Run ASDC Post Request ${ASDC_CATALOG_SERVICES_PATH}/${catalog_service_id}${ASDC_CATALOG_LIFECYCLE_PATH}/startCertification ${None} ${ASDC_TESTER_USER_ID} Should Be Equal As Strings ${resp.status_code} 200 [Return] ${resp.json()} Certify ASDC Catalog Service [Documentation] start certify an asdc Catalog Service by its id and returns the new id [Arguments] ${catalog_service_id} ${map}= Create Dictionary user_remarks=Robot remarks ${data}= Fill JSON Template File ${ASDC_USER_REMARKS_TEMPLATE} ${map} ${resp}= Run ASDC Post Request ${ASDC_CATALOG_SERVICES_PATH}/${catalog_service_id}${ASDC_CATALOG_LIFECYCLE_PATH}/certify ${data} ${ASDC_TESTER_USER_ID} Should Be Equal As Strings ${resp.status_code} 200 [Return] ${resp.json()['uniqueId']} Approve ASDC Catalog Service [Documentation] approve an asdc Catalog Service by its id [Arguments] ${catalog_service_id} ${map}= Create Dictionary user_remarks=Robot remarks ${data}= Fill JSON Template File ${ASDC_USER_REMARKS_TEMPLATE} ${map} ${resp}= Run ASDC Post Request ${ASDC_CATALOG_SERVICES_PATH}/${catalog_service_id}${ASDC_CATALOG_SERVICE_DISTRIBUTION_STATE_PATH}${ASDC_DISTRIBUTION_STATE_APPROVE_PATH} ${data} ${ASDC_GOVERNOR_USER_ID} Should Be Equal As Strings ${resp.status_code} 200 [Return] ${resp.json()} Distribute ASDC Catalog Service [Documentation] distribute an asdc Catalog Service by its id [Arguments] ${catalog_service_id} ${resp}= Run ASDC Post Request ${ASDC_CATALOG_SERVICES_PATH}/${catalog_service_id}${ASDC_CATALOG_SERVICE_DISTRIBUTION_ACTIVATE_PATH} ${None} ${ASDC_OPS_USER_ID} Should Be Equal As Strings ${resp.status_code} 200 [Return] ${resp.json()} Add ASDC Resource Instance [Documentation] Creates an asdc Resource Instance and returns its id [Arguments] ${catalog_service_id} ${catalog_resource_id} ${catalog_resource_name} ${xoffset}=${0} ${yoffset}=${0} ${milli_timestamp}= Generate MilliTimestamp UUID ${xoffset}= Set Variable ${xoffset+306} ${yoffset}= Set Variable ${yoffset+248} ${map}= Create Dictionary catalog_resource_id=${catalog_resource_id} catalog_resource_name=${catalog_resource_name} milli_timestamp=${milli_timestamp} posX=${xoffset} posY=${yoffset} ${data}= Fill JSON Template File ${ASDC_RESOURCE_INSTANCE_TEMPLATE} ${map} ${resp}= Run ASDC Post Request ${ASDC_CATALOG_SERVICES_PATH}/${catalog_service_id}${ASDC_CATALOG_SERVICE_RESOURCE_INSTANCE_PATH} ${data} ${ASDC_DESIGNER_USER_ID} Should Be Equal As Strings ${resp.status_code} 201 [Return] ${resp.json()['uniqueId']} Add ASDC Resource Instance To Resource [Documentation] Creates an asdc Resource Instance in a Resource (VF) and returns its id [Arguments] ${parent_catalog_resource_id} ${catalog_resource_id} ${catalog_resource_name} ${xoffset}=${0} ${yoffset}=${0} ${milli_timestamp}= Generate MilliTimestamp UUID ${xoffset}= Set Variable ${xoffset+306} ${yoffset}= Set Variable ${yoffset+248} ${map}= Create Dictionary catalog_resource_id=${catalog_resource_id} catalog_resource_name=${catalog_resource_name} milli_timestamp=${milli_timestamp} posX=${xoffset} posY=${yoffset} ${data}= Fill JSON Template File ${ASDC_RESOURCE_INSTANCE_TEMPLATE} ${map} ${resp}= Run ASDC Post Request ${ASDC_CATALOG_RESOURCES_PATH}/${parent_catalog_resource_id}${ASDC_CATALOG_SERVICE_RESOURCE_INSTANCE_PATH} ${data} ${ASDC_DESIGNER_USER_ID} Should Be Equal As Strings ${resp.status_code} 201 [Return] ${resp.json()['uniqueId']} Get Catalog Service Distribution [Documentation] gets an asdc catalog Service distrbution [Arguments] ${catalog_service_uuid} ${resp}= Run ASDC Get Request ${ASDC_CATALOG_SERVICES_PATH}/${catalog_service_uuid}${ASDC_CATALOG_SERVICE_DISTRIBUTION_PATH} ${ASDC_OPS_USER_ID} Should Be Equal As Strings ${resp.status_code} 200 [Return] ${resp.json()} Check Catalog Service Distributed [Documentation] gets an asdc catalog Service distrbution [Arguments] ${catalog_service_uuid} ${dist_status} ${dist_resp}= Get Catalog Service Distribution ${catalog_service_uuid} Should Be Equal As Strings ${dist_resp['distributionStatusOfServiceList'][0]['deployementStatus']} Distributed ${det_resp}= Get Catalog Service Distribution Details ${dist_resp['distributionStatusOfServiceList'][0]['distributionID']} @{ITEMS}= Copy List ${det_resp['distributionStatusList']} Should Not Be Empty ${ITEMS} ${SO_COMPLETE} Set Variable FALSE ${dist_status} Set Variable CONTINUE Should Not Be Empty ${ITEMS} :FOR ${ELEMENT} IN @{ITEMS} \ Log ${ELEMENT['omfComponentID']} \ Log ${ELEMENT['status']} \ ${SO_COMPLETE} Set Variable If (('${ELEMENT['status']}' == 'DISTRIBUTION_COMPLETE_OK')) or ('${SO_COMPLETE}'=='TRUE') TRUE \ Exit For Loop If ('${SO_COMPLETE}'=='TRUE') \ Exit For Loop If ('${ELEMENT['status']}' == 'DISTRIBUTION_COMPLETE_ERROR') \ ${dist_status}= Set Variable If (('${ELEMENT['status']}' == 'COMPONENT_DONE_ERROR') and ('${ELEMENT['omfComponentID']}' == 'aai-ml')) EXIT \ Exit For Loop If (('${ELEMENT['status']}' == 'COMPONENT_DONE_ERROR') and ('${ELEMENT['omfComponentID']}' == 'aai-ml')) Should Be True ( '${SO_COMPLETE}'=='TRUE') SO Test [Return] Get Catalog Service Distribution Details [Documentation] gets an asdc catalog Service distrbution details [Arguments] ${catalog_service_distribution_id} ${resp}= Run ASDC Get Request ${ASDC_CATALOG_SERVICES_PATH}${ASDC_CATALOG_SERVICE_DISTRIBUTION_PATH}/${catalog_service_distribution_id} ${ASDC_OPS_USER_ID} Should Be Equal As Strings ${resp.status_code} 200 [Return] ${resp.json()} Run ASDC Health Check [Documentation] Runs a ASDC health check ${session}= Create Session asdc ${ASDC_FE_ENDPOINT} ${uuid}= Generate UUID ${headers}= Create Dictionary Accept=application/json Content-Type=application/json X-TransactionId=${GLOBAL_APPLICATION_ID}-${uuid} X-FromAppId=${GLOBAL_APPLICATION_ID} ${resp}= Get Request asdc ${ASDC_HEALTH_CHECK_PATH} headers=${headers} # only test for HTTP 200 to determine SDC Health. SDC_DE_HEALTH is informational Should Be Equal As Strings ${resp.status_code} 200 SDC DOWN ${SDC_DE_HEALTH}= Catenate DOWN @{ITEMS}= Copy List ${resp.json()['componentsInfo']} :FOR ${ELEMENT} IN @{ITEMS} \ Log ${ELEMENT['healthCheckStatus']} \ ${SDC_DE_HEALTH} Set Variable If (('DE' in '${ELEMENT['healthCheckComponent']}') and ('${ELEMENT['healthCheckStatus']}' == 'UP')) or ('${SDC_DE_HEALTH}'=='UP') UP Log To Console (DMaaP:${SDC_DE_HEALTH}) no_newline=true Run ASDC Get Request [Documentation] Runs an ASDC get request [Arguments] ${data_path} ${user}=${ASDC_DESIGNER_USER_ID} ${MY_ASDC_BE_ENDPOINT}=${ASDC_BE_ENDPOINT} ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD} Log Creating session ${MY_ASDC_BE_ENDPOINT} ${session}= Create Session asdc ${MY_ASDC_BE_ENDPOINT} auth=${auth} ${uuid}= Generate UUID ${headers}= Create Dictionary Accept=application/json Content-Type=application/json USER_ID=${user} X-TransactionId=${GLOBAL_APPLICATION_ID}-${uuid} X-FromAppId=${GLOBAL_APPLICATION_ID} ${resp}= Get Request asdc ${data_path} headers=${headers} Log Received response from asdc ${resp.text} [Return] ${resp} Run ASDC Put Request [Documentation] Runs an ASDC put request [Arguments] ${data_path} ${data} ${user}=${ASDC_DESIGNER_USER_ID} ${MY_ASDC_BE_ENDPOINT}=${ASDC_BE_ENDPOINT} ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD} Log Creating session ${MY_ASDC_BE_ENDPOINT} ${session}= Create Session asdc ${MY_ASDC_BE_ENDPOINT} auth=${auth} ${uuid}= Generate UUID ${headers}= Create Dictionary Accept=application/json Content-Type=application/json USER_ID=${user} X-TransactionId=${GLOBAL_APPLICATION_ID}-${uuid} X-FromAppId=${GLOBAL_APPLICATION_ID} ${resp}= Put Request asdc ${data_path} data=${data} headers=${headers} Log Received response from asdc ${resp.text} [Return] ${resp} Run ASDC Post Files Request [Documentation] Runs an ASDC post request [Arguments] ${data_path} ${files} ${user}=${ASDC_DESIGNER_USER_ID} ${MY_ASDC_BE_ENDPOINT}=${ASDC_BE_ENDPOINT} ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD} Log Creating session ${MY_ASDC_BE_ENDPOINT} ${session}= Create Session asdc ${MY_ASDC_BE_ENDPOINT} auth=${auth} ${uuid}= Generate UUID ${headers}= Create Dictionary Accept=application/json Content-Type=multipart/form-data USER_ID=${user} X-TransactionId=${GLOBAL_APPLICATION_ID}-${uuid} X-FromAppId=${GLOBAL_APPLICATION_ID} ${resp}= Post Request asdc ${data_path} files=${files} headers=${headers} Log Received response from asdc ${resp.text} [Return] ${resp} Run ASDC MD5 Post Request [Documentation] Runs an ASDC post request with MD5 Checksum header [Arguments] ${data_path} ${data} ${user}=${ASDC_DESIGNER_USER_ID} ${MY_ASDC_BE_ENDPOINT}=${ASDC_BE_ENDPOINT} ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD} Log Creating session ${MY_ASDC_BE_ENDPOINT} ${session}= Create Session asdc ${MY_ASDC_BE_ENDPOINT} auth=${auth} ${uuid}= Generate UUID ${data_string}= Evaluate json.dumps(${data}) json ${md5checksum}= Evaluate md5.new('''${data_string}''').hexdigest() modules=md5 ${base64md5checksum}= Evaluate base64.b64encode("${md5checksum}") modules=base64 ${headers}= Create Dictionary Accept=application/json Content-Type=application/json USER_ID=${user} X-TransactionId=${GLOBAL_APPLICATION_ID}-${uuid} X-FromAppId=${GLOBAL_APPLICATION_ID} Content-MD5=${base64md5checksum} ${resp}= Post Request asdc ${data_path} data=${data} headers=${headers} Log Received response from asdc ${resp.text} [Return] ${resp} Run ASDC Post Request [Documentation] Runs an ASDC post request [Arguments] ${data_path} ${data} ${user}=${ASDC_DESIGNER_USER_ID} ${MY_ASDC_BE_ENDPOINT}=${ASDC_BE_ENDPOINT} ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD} Log Creating session ${MY_ASDC_BE_ENDPOINT} ${session}= Create Session asdc ${MY_ASDC_BE_ENDPOINT} auth=${auth} ${uuid}= Generate UUID ${headers}= Create Dictionary Accept=application/json Content-Type=application/json USER_ID=${user} X-TransactionId=${GLOBAL_APPLICATION_ID}-${uuid} X-FromAppId=${GLOBAL_APPLICATION_ID} ${resp}= Post Request asdc ${data_path} data=${data} headers=${headers} Log Received response from asdc ${resp.text} [Return] ${resp} Run ASDC Delete Request [Documentation] Runs an ASDC delete request [Arguments] ${data_path} ${user}=${ASDC_DESIGNER_USER_ID} ${MY_ASDC_BE_ENDPOINT}=${ASDC_BE_ENDPOINT} ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD} Log Creating session ${MY_ASDC_BE_ENDPOINT} ${session}= Create Session asdc ${MY_ASDC_BE_ENDPOINT} auth=${auth} ${uuid}= Generate UUID ${headers}= Create Dictionary Accept=application/json Content-Type=application/json USER_ID=${user} X-TransactionId=${GLOBAL_APPLICATION_ID}-${uuid} X-FromAppId=${GLOBAL_APPLICATION_ID} ${resp}= Delete Request asdc ${data_path} headers=${headers} Log Received response from asdc ${resp.text} [Return] ${resp} Open ASDC GUI [Documentation] Logs in to ASDC GUI [Arguments] ${PATH} ## Setup Browever now being managed by the test case ##Setup Browser Go To ${ASDC_FE_ENDPOINT}${PATH} Maximize Browser Window Set Browser Implicit Wait ${GLOBAL_SELENIUM_BROWSER_IMPLICIT_WAIT} Log Logging in to ${ASDC_FE_ENDPOINT}${PATH} Title Should Be ASDC Wait Until Page Contains Element xpath=//div/a[text()='SDC'] ${GLOBAL_SELENIUM_BROWSER_WAIT_TIMEOUT} Log Logged in to ${ASDC_FE_ENDPOINT}${PATH} Create Multi Part [Arguments] ${addTo} ${partName} ${filePath} ${contentType}=${None} ${fileData}= Get Binary File ${filePath} ${fileDir} ${fileName}= Split Path ${filePath} ${partData}= Create List ${fileName} ${fileData} ${contentType} Set To Dictionary ${addTo} ${partName}=${partData}