DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 1 | *** Settings *** |
| 2 | Documentation The main interface for interacting with ASDC. It handles low level stuff like managing the http request library and DCAE required fields |
| 3 | Library RequestsLibrary |
Jerry Flood | e2a48d7 | 2017-06-21 15:06:29 -0400 | [diff] [blame] | 4 | Library UUID |
| 5 | Library JSONUtils |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 6 | Library OperatingSystem |
| 7 | Library Collections |
| 8 | Library ExtendedSelenium2Library |
| 9 | Resource global_properties.robot |
| 10 | Resource browser_setup.robot |
| 11 | Resource json_templater.robot |
| 12 | *** Variables *** |
| 13 | ${ASDC_DESIGNER_USER_ID} cs0008 |
| 14 | ${ASDC_TESTER_USER_ID} jm0007 |
| 15 | ${ASDC_GOVERNOR_USER_ID} gv0001 |
| 16 | ${ASDC_OPS_USER_ID} op0001 |
| 17 | ${ASDC_HEALTH_CHECK_PATH} /sdc1/rest/healthCheck |
| 18 | ${ASDC_VENDOR_LICENSE_MODEL_PATH} /onboarding-api/v1.0/vendor-license-models |
| 19 | ${ASDC_VENDOR_SOFTWARE_PRODUCT_PATH} /onboarding-api/v1.0/vendor-software-products |
| 20 | ${ASDC_VENDOR_KEY_GROUP_PATH} /license-key-groups |
| 21 | ${ASDC_VENDOR_ENTITLEMENT_POOL_PATH} /entitlement-pools |
| 22 | ${ASDC_VENDOR_FEATURE_GROUP_PATH} /feature-groups |
| 23 | ${ASDC_VENDOR_LICENSE_AGREEMENT_PATH} /license-agreements |
| 24 | ${ASDC_VENDOR_ACTIONS_PATH} /actions |
Jerry Flood | e2a48d7 | 2017-06-21 15:06:29 -0400 | [diff] [blame] | 25 | ${ASDC_VENDOR_SOFTWARE_UPLOAD_PATH} /orchestration-template-candidate |
Yang Xu | 2ec8038 | 2018-11-01 12:30:37 -0400 | [diff] [blame] | 26 | ${ASDC_FE_CATALOG_RESOURCES_PATH} /sdc1/feProxy/rest/v1/catalog/resources |
Brian Freeman | eef7c6f | 2018-11-16 18:42:21 -0500 | [diff] [blame] | 27 | ${ASDC_FE_CATALOG_SERVICES_PATH} /sdc1/feProxy/rest/v1/catalog/services |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 28 | ${ASDC_CATALOG_RESOURCES_PATH} /sdc2/rest/v1/catalog/resources |
| 29 | ${ASDC_CATALOG_SERVICES_PATH} /sdc2/rest/v1/catalog/services |
| 30 | ${ASDC_CATALOG_INACTIVE_RESOURCES_PATH} /sdc2/rest/v1/inactiveComponents/resource |
Brian Freeman | eef7c6f | 2018-11-16 18:42:21 -0500 | [diff] [blame] | 31 | ${ASDC_CATALOG_RESOURCES_QUERY_PATH} /sdc2/rest/v1/catalog/resources/resourceName |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 32 | ${ASDC_CATALOG_INACTIVE_SERVICES_PATH} /sdc2/rest/v1/inactiveComponents/service |
| 33 | ${ASDC_CATALOG_LIFECYCLE_PATH} /lifecycleState |
| 34 | ${ASDC_CATALOG_SERVICE_RESOURCE_INSTANCE_PATH} /resourceInstance |
| 35 | ${ASDC_CATALOG_SERVICE_DISTRIBUTION_STATE_PATH} /distribution-state |
| 36 | ${ASDC_CATALOG_SERVICE_DISTRIBUTION_PATH} /distribution |
| 37 | ${ASDC_DISTRIBUTION_STATE_APPROVE_PATH} /approve |
| 38 | ${ASDC_CATALOG_SERVICE_DISTRIBUTION_ACTIVATE_PATH} /distribution/PROD/activate |
| 39 | ${ASDC_LICENSE_MODEL_TEMPLATE} robot/assets/templates/asdc/license_model.template |
| 40 | ${ASDC_KEY_GROUP_TEMPLATE} robot/assets/templates/asdc/key_group.template |
| 41 | ${ASDC_ENTITLEMENT_POOL_TEMPLATE} robot/assets/templates/asdc/entitlement_pool.template |
| 42 | ${ASDC_FEATURE_GROUP_TEMPLATE} robot/assets/templates/asdc/feature_group.template |
| 43 | ${ASDC_LICENSE_AGREEMENT_TEMPLATE} robot/assets/templates/asdc/license_agreement.template |
| 44 | ${ASDC_ACTION_TEMPLATE} robot/assets/templates/asdc/action.template |
| 45 | ${ASDC_SOFTWARE_PRODUCT_TEMPLATE} robot/assets/templates/asdc/software_product.template |
| 46 | ${ASDC_CATALOG_RESOURCE_TEMPLATE} robot/assets/templates/asdc/catalog_resource.template |
| 47 | ${ASDC_USER_REMARKS_TEMPLATE} robot/assets/templates/asdc/user_remarks.template |
| 48 | ${ASDC_CATALOG_SERVICE_TEMPLATE} robot/assets/templates/asdc/catalog_service.template |
| 49 | ${ASDC_RESOURCE_INSTANCE_TEMPLATE} robot/assets/templates/asdc/resource_instance.template |
Yang Xu | 2ec8038 | 2018-11-01 12:30:37 -0400 | [diff] [blame] | 50 | ${ASDC_RESOURCE_INSTANCE_VNF_PROPERTIES_TEMPLATE} robot/assets/templates/asdc/catalog_vnf_properties.template |
| 51 | ${ASDC_RESOURCE_INSTANCE_VNF_INPUTS_TEMPLATE} robot/assets/templates/asdc/catalog_vnf_inputs.template |
Brian Freeman | eef7c6f | 2018-11-16 18:42:21 -0500 | [diff] [blame] | 52 | ${SDC_CATALOG_NET_RESOURCE_INPUT_TEMPLATE} robot/assets/templates/asdc/catalog_net_input_properties.template |
Brian Freeman | f508ab2 | 2018-03-15 21:19:41 -0500 | [diff] [blame] | 53 | ${ASDC_FE_ENDPOINT} ${GLOBAL_ASDC_SERVER_PROTOCOL}://${GLOBAL_INJECTED_SDC_FE_IP_ADDR}:${GLOBAL_ASDC_FE_PORT} |
| 54 | ${ASDC_BE_ENDPOINT} ${GLOBAL_ASDC_SERVER_PROTOCOL}://${GLOBAL_INJECTED_SDC_BE_IP_ADDR}:${GLOBAL_ASDC_BE_PORT} |
Brian Freeman | 44b8bb3 | 2018-05-03 21:08:42 -0500 | [diff] [blame] | 55 | ${ASDC_BE_ONBOARD_ENDPOINT} ${GLOBAL_ASDC_SERVER_PROTOCOL}://${GLOBAL_INJECTED_SDC_BE_ONBOARD_IP_ADDR}:${GLOBAL_ASDC_BE_ONBOARD_PORT} |
DR695H | bf5a3a3 | 2017-06-30 13:09:57 -0400 | [diff] [blame] | 56 | |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 57 | *** Keywords *** |
| 58 | Distribute Model From ASDC |
| 59 | [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 |
Brian Freeman | eef7c6f | 2018-11-16 18:42:21 -0500 | [diff] [blame] | 60 | [Arguments] ${model_zip_path} ${catalog_service_name}= ${cds}= ${service}= |
| 61 | #${random}= Get Current Date |
| 62 | #${catalog_service_id}= Add ASDC Catalog Service ${catalog_service_name}_${random} |
jf9860 | 75010a4 | 2017-02-22 16:52:54 -0500 | [diff] [blame] | 63 | ${catalog_service_id}= Add ASDC Catalog Service ${catalog_service_name} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 64 | ${catalog_resource_ids}= Create List |
Jerry Flood | 3a169a3 | 2017-12-01 12:39:10 -0500 | [diff] [blame] | 65 | ${catalog_resources}= Create Dictionary |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 66 | : FOR ${zip} IN @{model_zip_path} |
Yang Xu | 2ec8038 | 2018-11-01 12:30:37 -0400 | [diff] [blame] | 67 | \ ${loop_catalog_resource_id}= Setup ASDC Catalog Resource ${zip} ${cds} |
Jerry Flood | e2a48d7 | 2017-06-21 15:06:29 -0400 | [diff] [blame] | 68 | \ Append To List ${catalog_resource_ids} ${loop_catalog_resource_id} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 69 | \ ${loop_catalog_resource_resp}= Get ASDC Catalog Resource ${loop_catalog_resource_id} |
| 70 | \ Add ASDC Resource Instance ${catalog_service_id} ${loop_catalog_resource_id} ${loop_catalog_resource_resp['name']} |
Jerry Flood | 3a169a3 | 2017-12-01 12:39:10 -0500 | [diff] [blame] | 71 | \ Set To Dictionary ${catalog_resources} ${loop_catalog_resource_id}=${loop_catalog_resource_resp} |
Brian Freeman | eef7c6f | 2018-11-16 18:42:21 -0500 | [diff] [blame] | 72 | # |
| 73 | # do this here because the loop_catalog_resource_resp is different format after adding networks |
| 74 | ${vf_module}= Find Element In Array ${loop_catalog_resource_resp['groups']} type org.openecomp.groups.VfModule |
| 75 | # |
| 76 | # do network |
| 77 | ${networklist}= Get From Dictionary ${GLOBAL_SERVICE_GEN_NEUTRON_NETWORK_MAPPING} ${service} |
| 78 | ${xoffset}= Set Variable ${100} |
| 79 | ${generic_neutron_net_uuid}= Get Generic NeutronNet UUID |
| 80 | :FOR ${network} in @{networklist} |
| 81 | \ ${loop_catalog_resource_id}= Set Variable ${generic_neutron_net_uuid} |
| 82 | \ Append To List ${catalog_resource_ids} ${loop_catalog_resource_id} |
| 83 | \ ${loop_catalog_resource_resp}= Get ASDC Catalog Resource ${loop_catalog_resource_id} |
| 84 | # |
| 85 | \ ${loop_catalog_resource_id}= Add ASDC Resource Instance ${catalog_service_id} ${loop_catalog_resource_id} ${network} ${xoffset} ${0} |
| 86 | \ ${nf_role}= Convert To Lowercase ${network} |
| 87 | \ Setup SDC Catalog Resource GenericNeutronNet Properties ${catalog_service_id} ${nf_role} ${loop_catalog_resource_id} |
| 88 | \ ${xoffset}= Set Variable ${xoffset+100} |
| 89 | \ Set To Dictionary ${catalog_resources} ${loop_catalog_resource_id}=${loop_catalog_resource_resp} |
| 90 | # |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 91 | ${catalog_service_resp}= Get ASDC Catalog Service ${catalog_service_id} |
| 92 | Checkin ASDC Catalog Service ${catalog_service_id} |
| 93 | Request Certify ASDC Catalog Service ${catalog_service_id} |
| 94 | Start Certify ASDC Catalog Service ${catalog_service_id} |
| 95 | # on certify it gets a new id |
| 96 | ${catalog_service_id}= Certify ASDC Catalog Service ${catalog_service_id} |
| 97 | Approve ASDC Catalog Service ${catalog_service_id} |
Brian Freeman | 796b9eb | 2018-10-08 08:23:20 -0500 | [diff] [blame] | 98 | : FOR ${DIST_INDEX} IN RANGE 1 |
Brian Freeman | 18df891 | 2018-05-25 13:27:29 -0500 | [diff] [blame] | 99 | \ Log Distribution Attempt ${DIST_INDEX} |
| 100 | \ Distribute ASDC Catalog Service ${catalog_service_id} |
| 101 | \ ${catalog_service_resp}= Get ASDC Catalog Service ${catalog_service_id} |
Brian Freeman | f940ee9 | 2018-05-25 21:09:05 -0500 | [diff] [blame] | 102 | \ ${status} ${_} = Run Keyword And Ignore Error Loop Over Check Catalog Service Distributed ${catalog_service_resp['uuid']} |
| 103 | \ Exit For Loop If '${status}'=='PASS' |
Brian Freeman | 8c002d5 | 2018-07-30 19:35:36 -0500 | [diff] [blame] | 104 | Should Be Equal As Strings ${status} PASS |
Jerry Flood | 3a169a3 | 2017-12-01 12:39:10 -0500 | [diff] [blame] | 105 | [Return] ${catalog_service_resp['name']} ${loop_catalog_resource_resp['name']} ${vf_module} ${catalog_resource_ids} ${catalog_service_id} ${catalog_resources} |
Brian Freeman | 18df891 | 2018-05-25 13:27:29 -0500 | [diff] [blame] | 106 | |
bdfreeman1421 | 1ad11d9 | 2018-11-17 18:47:37 +0000 | [diff] [blame] | 107 | Download CSAR |
| 108 | [Documentation] Download CSAR |
| 109 | [Arguments] ${catalog_service_id} ${save_directory}=/tmp/csar |
| 110 | # get meta data |
| 111 | ${resp}= Run ASDC Get Request ${ASDC_CATALOG_SERVICES_PATH}/${catalog_service_id}/filteredDataByParams?include=toscaArtifacts ${ASDC_DESIGNER_USER_ID} ${ASDC_BE_ENDPOINT} |
| 112 | ${csar_resource_id}= Set Variable ${resp.json()['toscaArtifacts']['assettoscacsar']['uniqueId']} |
| 113 | ${resp}= Run ASDC Get Request ${ASDC_CATALOG_SERVICES_PATH}/${catalog_service_id}/artifacts/${csar_resource_id} |
| 114 | ${csar_file_name}= Set Variable ${resp.json()['artifactName']} |
| 115 | ${base64Obj}= Set Variable ${resp.json()['base64Contents']} |
| 116 | ${binObj}= Evaluate base64.b64decode("${base64Obj}") modules=base64 |
| 117 | Create Binary File ${save_directory}/${csar_file_name} ${binObj} |
| 118 | Log To Console Downloaded:${csar_file_name} |
| 119 | [Return] |
| 120 | |
Brian Freeman | eef7c6f | 2018-11-16 18:42:21 -0500 | [diff] [blame] | 121 | |
| 122 | Get Generic NeutronNet UUID |
| 123 | [Documentation] Lookoup the UUID of the Generic NeutronNetwork Resource |
| 124 | # http://137.117.87.170:30205/sdc2/rest/v1/catalog/resources/resourceName/Generic%20NeutronNet/resourceVersion/1.0 |
| 125 | # 411edcfd-c290-41dc-bd2c-5600f9f0af05 |
| 126 | ${resp}= Run ASDC Get Request ${ASDC_CATALOG_RESOURCES_QUERY_PATH}/Generic%20NeutronNet/resourceVersion/1.0 ${ASDC_DESIGNER_USER_ID} ${ASDC_BE_ENDPOINT} |
| 127 | [Return] ${resp.json()['allVersions']['1.0']} |
| 128 | |
Brian Freeman | 18df891 | 2018-05-25 13:27:29 -0500 | [diff] [blame] | 129 | Loop Over Check Catalog Service Distributed |
Gary Wu | 58d5853 | 2018-07-27 16:02:51 -0700 | [diff] [blame] | 130 | [Arguments] ${catalog_service_id} |
Brian Freeman | adaa237 | 2018-10-24 12:25:22 -0500 | [diff] [blame] | 131 | # SO watchdog timeout is 300 seconds need buffer |
| 132 | ${dist_status}= Set Variable FAIL |
| 133 | : FOR ${CHECK_INDEX} IN RANGE 20 |
| 134 | \ ${status} ${_} = Run Keyword And Ignore Error Check Catalog Service Distributed ${catalog_service_id} ${dist_status} |
Gary Wu | 58d5853 | 2018-07-27 16:02:51 -0700 | [diff] [blame] | 135 | \ Sleep 20s |
Brian Freeman | f940ee9 | 2018-05-25 21:09:05 -0500 | [diff] [blame] | 136 | \ Return From Keyword If '${status}'=='PASS' |
Brian Freeman | adaa237 | 2018-10-24 12:25:22 -0500 | [diff] [blame] | 137 | \ Exit For Loop If '${dist_status}'=='EXIT' |
Brian Freeman | 8c002d5 | 2018-07-30 19:35:36 -0500 | [diff] [blame] | 138 | Should Be Equal As Strings ${status} PASS |
Brian Freeman | 18df891 | 2018-05-25 13:27:29 -0500 | [diff] [blame] | 139 | |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 140 | Setup ASDC Catalog Resource |
| 141 | [Documentation] Creates all the steps a vf needs for an asdc catalog resource and returns the id |
Yang Xu | 2ec8038 | 2018-11-01 12:30:37 -0400 | [diff] [blame] | 142 | [Arguments] ${model_zip_path} ${cds}= |
Brian Freeman | b568e5e | 2018-04-05 21:03:38 -0500 | [diff] [blame] | 143 | ${license_model_id} ${license_model_version_id}= Add ASDC License Model |
| 144 | ${key_group_id}= Add ASDC License Group ${license_model_id} ${license_model_version_id} |
| 145 | ${pool_id}= Add ASDC Entitlement Pool ${license_model_id} ${license_model_version_id} |
| 146 | ${feature_group_id}= Add ASDC Feature Group ${license_model_id} ${key_group_id} ${pool_id} ${license_model_version_id} |
| 147 | ${license_agreement_id}= Add ASDC License Agreement ${license_model_id} ${feature_group_id} ${license_model_version_id} |
| 148 | Submit ASDC License Model ${license_model_id} ${license_model_version_id} |
| 149 | ${license_model_resp}= Get ASDC License Model ${license_model_id} ${license_model_version_id} |
| 150 | ${software_product_id} ${software_product_version_id}= Add ASDC Software Product ${license_agreement_id} ${feature_group_id} ${license_model_resp['vendorName']} ${license_model_id} ${license_model_version_id} |
| 151 | Upload ASDC Heat Package ${software_product_id} ${model_zip_path} ${software_product_version_id} |
| 152 | Validate ASDC Software Product ${software_product_id} ${software_product_version_id} |
| 153 | Submit ASDC Software Product ${software_product_id} ${software_product_version_id} |
| 154 | Package ASDC Software Product ${software_product_id} ${software_product_version_id} |
| 155 | ${software_product_resp}= Get ASDC Software Product ${software_product_id} ${software_product_version_id} |
| 156 | ${catalog_resource_id}= Add ASDC Catalog Resource ${license_agreement_id} ${software_product_resp['name']} ${license_model_resp['vendorName']} ${software_product_id} |
Yang Xu | 2ec8038 | 2018-11-01 12:30:37 -0400 | [diff] [blame] | 157 | # Check if need to set up CDS properties |
| 158 | Run Keyword If '${cds}' == 'vfwng' Setup ASDC Catalog Resource CDS Properties ${catalog_resource_id} |
| 159 | |
Brian Freeman | 391680a | 2018-08-11 15:20:58 -0500 | [diff] [blame] | 160 | ${catalog_resource_id}= Certify ASDC Catalog Resource ${catalog_resource_id} ${ASDC_DESIGNER_USER_ID} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 161 | [Return] ${catalog_resource_id} |
Brian Freeman | eef7c6f | 2018-11-16 18:42:21 -0500 | [diff] [blame] | 162 | |
| 163 | Setup SDC Catalog Resource GenericNeutronNet Properties |
| 164 | [Documentation] Set up GenericNeutronNet properties and inputs |
| 165 | [Arguments] ${catalog_service_id} ${nf_role} ${catalog_parent_service_id} |
| 166 | # Set component instances properties |
| 167 | ${resp}= Get ASDC Catalog Resource Component Instances Properties ${catalog_service_id} |
| 168 | #${resp}= Get ASDC Catalog Resource Component Instances ${catalog_service_id} |
| 169 | ${componentInstances} Set Variable @{resp['componentInstancesProperties']} |
| 170 | # componentInstances can have 1 or more than 1 entry |
| 171 | ${passed}= Run Keyword And Return Status Evaluate type(${componentInstances}) |
| 172 | ${type}= Run Keyword If ${passed} Evaluate type(${componentInstances}) |
| 173 | ${componentInstancesList}= Run Keyword If "${type}"!="<type 'list'>" Create List ${componentInstances} |
| 174 | ... ELSE Set Variable ${componentInstances} |
| 175 | :FOR ${item} IN @{componentInstancesList} |
| 176 | \ ${test} ${v}= Run Keyword and Ignore Error Should Contain ${item} ${nf_role} |
| 177 | \ Run Keyword If '${test}' == 'FAIL' Continue For Loop |
| 178 | \ ${componentInstance1}= Set Variable ${item} |
| 179 | :FOR ${comp} IN @{resp['componentInstancesProperties']["${componentInstance1}"]} |
| 180 | \ ${name} Set Variable ${comp['name']} |
| 181 | \ ${test} ${v}= Run Keyword and Ignore Error Should Contain ${name} network_role |
| 182 | \ Run Keyword If '${test}' == 'FAIL' Continue For Loop |
| 183 | \ ${description} Set Variable ${comp['description']} |
| 184 | \ ${description}= Replace String ${description} ${\n} \ |
| 185 | \ ${uniqueId} Set Variable ${comp['uniqueId']} |
| 186 | \ ${parentUniqueId} Set Variable ${comp['parentUniqueId']} |
| 187 | \ ${ownerId} Set Variable ${comp['ownerId']} |
| 188 | \ ${dict}= Create Dictionary parentUniqueId=${parentUniqueId} ownerId=${ownerId} uniqueId=${uniqueId} description=${description} |
| 189 | \ Run Keyword If '${name}'=='network_role' Set To Dictionary ${dict} name=${name} value=${nf_role} |
| 190 | \ ${data}= Fill JSON Template File ${SDC_CATALOG_NET_RESOURCE_INPUT_TEMPLATE} ${dict} |
| 191 | \ ${response}= Set ASDC Catalog Resource Component Instance Properties ${catalog_parent_service_id} ${catalog_service_id} ${data} |
| 192 | #\ Log To Console resp=${response} |
| 193 | [Return] |
| 194 | |
Yang Xu | 2ec8038 | 2018-11-01 12:30:37 -0400 | [diff] [blame] | 195 | Setup ASDC Catalog Resource CDS Properties |
| 196 | [Documentation] Set up vfwng VNF properties and inputs for CDS |
| 197 | [Arguments] ${catalog_resource_id} |
| 198 | # Set vnf module properties |
| 199 | ${resp}= Get ASDC Catalog Resource Component Instances ${catalog_resource_id} |
| 200 | :FOR ${comp} in @{resp['componentInstances']} |
| 201 | \ ${name} Set Variable ${comp['name']} |
| 202 | \ ${uniqueId} Set Variable ${comp['uniqueId']} |
| 203 | \ ${actualComponentUid} Set Variable ${comp['actualComponentUid']} |
| 204 | \ ${test} ${v}= Run Keyword and Ignore Error Should Contain ${name} abstract_ |
| 205 | \ Run Keyword If '${test}' == 'FAIL' Continue For Loop |
| 206 | \ ${response}= Get ASDC Catalog Resource Component Instance Properties ${catalog_resource_id} ${uniqueId} ${actualComponentUid} |
| 207 | \ ${dict}= Create Dictionary parent_id=${response[6]['parentUniqueId']} |
| 208 | \ Run Keyword If '${name}'=='abstract_vfw' Set To Dictionary ${dict} nfc_function=vfw nfc_naming_policy=SDNC_Policy.ONAP_VFW_NAMING_TIMESTAMP |
| 209 | \ Run Keyword If '${name}'=='abstract_vpg' Set To Dictionary ${dict} nfc_function=vpg nfc_naming_policy=SDNC_Policy.ONAP_VPG_NAMING_TIMESTAMP |
| 210 | \ Run Keyword If '${name}'=='abstract_vsn' Set To Dictionary ${dict} nfc_function=vsn nfc_naming_policy=SDNC_Policy.ONAP_VSN_NAMING_TIMESTAMP |
| 211 | \ ${data}= Fill JSON Template File ${ASDC_RESOURCE_INSTANCE_VNF_PROPERTIES_TEMPLATE} ${dict} |
| 212 | \ ${response}= Set ASDC Catalog Resource Component Instance Properties ${catalog_resource_id} ${uniqueId} ${data} |
| 213 | \ Log To Console resp=${response} |
| 214 | |
| 215 | # Set vnf inputs |
| 216 | ${resp}= Get ASDC Catalog Resource Inputs ${catalog_resource_id} |
| 217 | ${dict}= Create Dictionary |
| 218 | :FOR ${comp} in @{resp['inputs']} |
| 219 | \ ${name} Set Variable ${comp['name']} |
| 220 | \ ${uid} Set Variable ${comp['uniqueId']} |
| 221 | \ Run Keyword If '${name}'=='nf_function' Set To Dictionary ${dict} nf_function=ONAP-FIREWALL nf_function_uid=${uid} |
| 222 | \ Run Keyword If '${name}'=='nf_type' Set To Dictionary ${dict} nf_type=FIREWALL nf_type_uid=${uid} |
| 223 | \ Run Keyword If '${name}'=='nf_naming_code' Set To Dictionary ${dict} nf_naming_code=vfw nf_naming_code_uid=${uid} |
| 224 | \ Run Keyword If '${name}'=='nf_role' Set To Dictionary ${dict} nf_role=vFW nf_role_uid=${uid} |
| 225 | \ Run Keyword If '${name}'=='cloud_env' Set To Dictionary ${dict} cloud_env=openstack cloud_env_uid=${uid} |
| 226 | ${data}= Fill JSON Template File ${ASDC_RESOURCE_INSTANCE_VNF_INPUTS_TEMPLATE} ${dict} |
| 227 | ${response}= Set ASDC Catalog Resource VNF Inputs ${catalog_resource_id} ${data} |
| 228 | |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 229 | Add ASDC License Model |
| 230 | [Documentation] Creates an asdc license model and returns its id |
Jerry Flood | e2a48d7 | 2017-06-21 15:06:29 -0400 | [diff] [blame] | 231 | ${uuid}= Generate UUID |
| 232 | ${shortened_uuid}= Evaluate str("${uuid}")[:23] |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 233 | ${map}= Create Dictionary vendor_name=${shortened_uuid} |
| 234 | ${data}= Fill JSON Template File ${ASDC_LICENSE_MODEL_TEMPLATE} ${map} |
Brian Freeman | 44b8bb3 | 2018-05-03 21:08:42 -0500 | [diff] [blame] | 235 | ${resp}= Run ASDC Post Request ${ASDC_VENDOR_LICENSE_MODEL_PATH} ${data} ${ASDC_DESIGNER_USER_ID} ${ASDC_BE_ONBOARD_ENDPOINT} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 236 | Should Be Equal As Strings ${resp.status_code} 200 |
Brian Freeman | b568e5e | 2018-04-05 21:03:38 -0500 | [diff] [blame] | 237 | [Return] ${resp.json()['itemId']} ${resp.json()['version']['id']} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 238 | Get ASDC License Model |
| 239 | [Documentation] gets an asdc license model by its id |
Jerry Flood | e2a48d7 | 2017-06-21 15:06:29 -0400 | [diff] [blame] | 240 | [Arguments] ${id} ${version_id}=0.1 |
Brian Freeman | 44b8bb3 | 2018-05-03 21:08:42 -0500 | [diff] [blame] | 241 | ${resp}= Run ASDC Get Request ${ASDC_VENDOR_LICENSE_MODEL_PATH}/${id}/versions/${version_id} ${ASDC_DESIGNER_USER_ID} ${ASDC_BE_ONBOARD_ENDPOINT} |
Jerry Flood | e2a48d7 | 2017-06-21 15:06:29 -0400 | [diff] [blame] | 242 | [Return] ${resp.json()} |
| 243 | Get ASDC License Models |
| 244 | [Documentation] gets an asdc license model by its id |
Brian Freeman | 44b8bb3 | 2018-05-03 21:08:42 -0500 | [diff] [blame] | 245 | ${resp}= Run ASDC Get Request ${ASDC_VENDOR_LICENSE_MODEL_PATH} ${ASDC_DESIGNER_USER_ID} ${ASDC_BE_ONBOARD_ENDPOINT} |
| 246 | |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 247 | [Return] ${resp.json()} |
| 248 | Checkin ASDC License Model |
| 249 | [Documentation] checksin an asdc license model by its id |
Jerry Flood | e2a48d7 | 2017-06-21 15:06:29 -0400 | [diff] [blame] | 250 | [Arguments] ${id} ${version_id}=0.1 |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 251 | ${map}= Create Dictionary action=Checkin |
| 252 | ${data}= Fill JSON Template File ${ASDC_ACTION_TEMPLATE} ${map} |
Brian Freeman | 44b8bb3 | 2018-05-03 21:08:42 -0500 | [diff] [blame] | 253 | ${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} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 254 | Should Be Equal As Strings ${resp.status_code} 200 |
| 255 | [Return] ${resp.json()} |
| 256 | Submit ASDC License Model |
| 257 | [Documentation] submits an asdc license model by its id |
Jerry Flood | e2a48d7 | 2017-06-21 15:06:29 -0400 | [diff] [blame] | 258 | [Arguments] ${id} ${version_id}=0.1 |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 259 | ${map}= Create Dictionary action=Submit |
| 260 | ${data}= Fill JSON Template File ${ASDC_ACTION_TEMPLATE} ${map} |
Brian Freeman | 44b8bb3 | 2018-05-03 21:08:42 -0500 | [diff] [blame] | 261 | ${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} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 262 | Should Be Equal As Strings ${resp.status_code} 200 |
| 263 | [Return] ${resp.json()} |
| 264 | Checkin ASDC Software Product |
| 265 | [Documentation] checksin an asdc Software Product by its id |
Jerry Flood | e2a48d7 | 2017-06-21 15:06:29 -0400 | [diff] [blame] | 266 | [Arguments] ${id} ${version_id}=0.1 |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 267 | ${map}= Create Dictionary action=Checkin |
Jerry Flood | e2a48d7 | 2017-06-21 15:06:29 -0400 | [diff] [blame] | 268 | ${data}= Fill JSON Template File ${ASDC_ACTION_TEMPLATE} ${map} |
Brian Freeman | 44b8bb3 | 2018-05-03 21:08:42 -0500 | [diff] [blame] | 269 | ${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} |
Jerry Flood | e2a48d7 | 2017-06-21 15:06:29 -0400 | [diff] [blame] | 270 | Should Be Equal As Strings ${resp.status_code} 200 |
| 271 | [Return] ${resp.json()} |
| 272 | Validate ASDC Software Product |
| 273 | [Documentation] checksin an asdc Software Product by its id |
| 274 | [Arguments] ${id} ${version_id}=0.1 |
| 275 | ${data}= Catenate |
Brian Freeman | 44b8bb3 | 2018-05-03 21:08:42 -0500 | [diff] [blame] | 276 | ${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} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 277 | Should Be Equal As Strings ${resp.status_code} 200 |
| 278 | [Return] ${resp.json()} |
| 279 | Submit ASDC Software Product |
| 280 | [Documentation] submits an asdc Software Product by its id |
Jerry Flood | e2a48d7 | 2017-06-21 15:06:29 -0400 | [diff] [blame] | 281 | [Arguments] ${id} ${version_id}=0.1 |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 282 | ${map}= Create Dictionary action=Submit |
Jerry Flood | e2a48d7 | 2017-06-21 15:06:29 -0400 | [diff] [blame] | 283 | ${data}= Fill JSON Template File ${ASDC_ACTION_TEMPLATE} ${map} |
Brian Freeman | 44b8bb3 | 2018-05-03 21:08:42 -0500 | [diff] [blame] | 284 | ${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} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 285 | Should Be Equal As Strings ${resp.status_code} 200 |
| 286 | [Return] ${resp.json()} |
| 287 | Package ASDC Software Product |
| 288 | [Documentation] creates_package on an asdc Software Product by its id |
Jerry Flood | e2a48d7 | 2017-06-21 15:06:29 -0400 | [diff] [blame] | 289 | [Arguments] ${id} ${version_id}=0.1 |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 290 | ${map}= Create Dictionary action=Create_Package |
Jerry Flood | e2a48d7 | 2017-06-21 15:06:29 -0400 | [diff] [blame] | 291 | ${data}= Fill JSON Template File ${ASDC_ACTION_TEMPLATE} ${map} |
Brian Freeman | 44b8bb3 | 2018-05-03 21:08:42 -0500 | [diff] [blame] | 292 | ${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} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 293 | Should Be Equal As Strings ${resp.status_code} 200 |
Jerry Flood | e2a48d7 | 2017-06-21 15:06:29 -0400 | [diff] [blame] | 294 | [Return] ${resp.json()} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 295 | Add ASDC Entitlement Pool |
| 296 | [Documentation] Creates an asdc Entitlement Pool and returns its id |
Jerry Flood | e2a48d7 | 2017-06-21 15:06:29 -0400 | [diff] [blame] | 297 | [Arguments] ${license_model_id} ${version_id}=0.1 |
| 298 | ${uuid}= Generate UUID |
| 299 | ${shortened_uuid}= Evaluate str("${uuid}")[:23] |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 300 | ${map}= Create Dictionary entitlement_pool_name=${shortened_uuid} |
Jerry Flood | e2a48d7 | 2017-06-21 15:06:29 -0400 | [diff] [blame] | 301 | ${data}= Fill JSON Template File ${ASDC_ENTITLEMENT_POOL_TEMPLATE} ${map} |
Brian Freeman | 44b8bb3 | 2018-05-03 21:08:42 -0500 | [diff] [blame] | 302 | ${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} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 303 | Should Be Equal As Strings ${resp.status_code} 200 |
| 304 | [Return] ${resp.json()['value']} |
| 305 | Get ASDC Entitlement Pool |
| 306 | [Documentation] gets an asdc Entitlement Pool by its id |
| 307 | [Arguments] ${license_model_id} ${pool_id} |
Brian Freeman | 44b8bb3 | 2018-05-03 21:08:42 -0500 | [diff] [blame] | 308 | ${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} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 309 | [Return] ${resp.json()} |
| 310 | Add ASDC License Group |
| 311 | [Documentation] Creates an asdc license group and returns its id |
Brian Freeman | b568e5e | 2018-04-05 21:03:38 -0500 | [diff] [blame] | 312 | [Arguments] ${license_model_id} ${version_id}=1.0 |
Jerry Flood | e2a48d7 | 2017-06-21 15:06:29 -0400 | [diff] [blame] | 313 | ${uuid}= Generate UUID |
| 314 | ${shortened_uuid}= Evaluate str("${uuid}")[:23] |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 315 | ${map}= Create Dictionary key_group_name=${shortened_uuid} |
Jerry Flood | e2a48d7 | 2017-06-21 15:06:29 -0400 | [diff] [blame] | 316 | ${data}= Fill JSON Template File ${ASDC_KEY_GROUP_TEMPLATE} ${map} |
Brian Freeman | 44b8bb3 | 2018-05-03 21:08:42 -0500 | [diff] [blame] | 317 | ${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} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 318 | Should Be Equal As Strings ${resp.status_code} 200 |
| 319 | [Return] ${resp.json()['value']} |
| 320 | Get ASDC License Group |
| 321 | [Documentation] gets an asdc license group by its id |
Jerry Flood | e2a48d7 | 2017-06-21 15:06:29 -0400 | [diff] [blame] | 322 | [Arguments] ${license_model_id} ${group_id} ${version_id} |
Brian Freeman | 44b8bb3 | 2018-05-03 21:08:42 -0500 | [diff] [blame] | 323 | ${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} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 324 | [Return] ${resp.json()} |
| 325 | Add ASDC Feature Group |
| 326 | [Documentation] Creates an asdc Feature Group and returns its id |
Jerry Flood | e2a48d7 | 2017-06-21 15:06:29 -0400 | [diff] [blame] | 327 | [Arguments] ${license_model_id} ${key_group_id} ${entitlement_pool_id} ${version_id}=0.1 |
| 328 | ${uuid}= Generate UUID |
| 329 | ${shortened_uuid}= Evaluate str("${uuid}")[:23] |
Jerry Flood | 80ff985 | 2017-08-11 06:47:14 -0400 | [diff] [blame] | 330 | ${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} |
Jerry Flood | e2a48d7 | 2017-06-21 15:06:29 -0400 | [diff] [blame] | 331 | ${data}= Fill JSON Template File ${ASDC_FEATURE_GROUP_TEMPLATE} ${map} |
Brian Freeman | 44b8bb3 | 2018-05-03 21:08:42 -0500 | [diff] [blame] | 332 | ${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} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 333 | Should Be Equal As Strings ${resp.status_code} 200 |
| 334 | [Return] ${resp.json()['value']} |
| 335 | Get ASDC Feature Group |
| 336 | [Documentation] gets an asdc Feature Group by its id |
| 337 | [Arguments] ${license_model_id} ${group_id} |
Brian Freeman | 44b8bb3 | 2018-05-03 21:08:42 -0500 | [diff] [blame] | 338 | ${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} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 339 | [Return] ${resp.json()} |
| 340 | Add ASDC License Agreement |
| 341 | [Documentation] Creates an asdc License Agreement and returns its id |
Jerry Flood | e2a48d7 | 2017-06-21 15:06:29 -0400 | [diff] [blame] | 342 | [Arguments] ${license_model_id} ${feature_group_id} ${version_id}=0.1 |
| 343 | ${uuid}= Generate UUID |
| 344 | ${shortened_uuid}= Evaluate str("${uuid}")[:23] |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 345 | ${map}= Create Dictionary license_agreement_name=${shortened_uuid} feature_group_id=${feature_group_id} |
Jerry Flood | e2a48d7 | 2017-06-21 15:06:29 -0400 | [diff] [blame] | 346 | ${data}= Fill JSON Template File ${ASDC_LICENSE_AGREEMENT_TEMPLATE} ${map} |
Brian Freeman | 44b8bb3 | 2018-05-03 21:08:42 -0500 | [diff] [blame] | 347 | ${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} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 348 | Should Be Equal As Strings ${resp.status_code} 200 |
| 349 | [Return] ${resp.json()['value']} |
| 350 | Get ASDC License Agreement |
| 351 | [Documentation] gets an asdc License Agreement by its id |
| 352 | [Arguments] ${license_model_id} ${agreement_id} |
Brian Freeman | 44b8bb3 | 2018-05-03 21:08:42 -0500 | [diff] [blame] | 353 | ${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} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 354 | [Return] ${resp.json()} |
| 355 | Add ASDC Software Product |
| 356 | [Documentation] Creates an asdc Software Product and returns its id |
Brian Freeman | b568e5e | 2018-04-05 21:03:38 -0500 | [diff] [blame] | 357 | [Arguments] ${license_agreement_id} ${feature_group_id} ${license_model_name} ${license_model_id} ${license_model_version_id} |
Jerry Flood | e2a48d7 | 2017-06-21 15:06:29 -0400 | [diff] [blame] | 358 | ${uuid}= Generate UUID |
| 359 | ${shortened_uuid}= Evaluate str("${uuid}")[:23] |
Brian Freeman | b568e5e | 2018-04-05 21:03:38 -0500 | [diff] [blame] | 360 | ${map}= Create Dictionary software_product_name=${shortened_uuid} 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} |
Jerry Flood | e2a48d7 | 2017-06-21 15:06:29 -0400 | [diff] [blame] | 361 | ${data}= Fill JSON Template File ${ASDC_SOFTWARE_PRODUCT_TEMPLATE} ${map} |
Brian Freeman | 44b8bb3 | 2018-05-03 21:08:42 -0500 | [diff] [blame] | 362 | ${resp}= Run ASDC Post Request ${ASDC_VENDOR_SOFTWARE_PRODUCT_PATH} ${data} ${ASDC_DESIGNER_USER_ID} ${ASDC_BE_ONBOARD_ENDPOINT} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 363 | Should Be Equal As Strings ${resp.status_code} 200 |
Brian Freeman | b568e5e | 2018-04-05 21:03:38 -0500 | [diff] [blame] | 364 | [Return] ${resp.json()['itemId']} ${resp.json()['version']['id']} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 365 | Get ASDC Software Product |
| 366 | [Documentation] gets an asdc Software Product by its id |
Jerry Flood | e2a48d7 | 2017-06-21 15:06:29 -0400 | [diff] [blame] | 367 | [Arguments] ${software_product_id} ${version_id}=0.1 |
Brian Freeman | 44b8bb3 | 2018-05-03 21:08:42 -0500 | [diff] [blame] | 368 | ${resp}= Run ASDC Get Request ${ASDC_VENDOR_SOFTWARE_PRODUCT_PATH}/${software_product_id}/versions/${version_id} ${ASDC_DESIGNER_USER_ID} ${ASDC_BE_ONBOARD_ENDPOINT} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 369 | [Return] ${resp.json()} |
| 370 | Add ASDC Catalog Resource |
| 371 | [Documentation] Creates an asdc Catalog Resource and returns its id |
| 372 | [Arguments] ${license_agreement_id} ${software_product_name} ${license_model_name} ${software_product_id} |
| 373 | ${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} |
Jerry Flood | e2a48d7 | 2017-06-21 15:06:29 -0400 | [diff] [blame] | 374 | ${data}= Fill JSON Template File ${ASDC_CATALOG_RESOURCE_TEMPLATE} ${map} |
Brian Freeman | 44b8bb3 | 2018-05-03 21:08:42 -0500 | [diff] [blame] | 375 | ${resp}= Run ASDC Post Request ${ASDC_CATALOG_RESOURCES_PATH} ${data} ${ASDC_DESIGNER_USER_ID} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 376 | Should Be Equal As Strings ${resp.status_code} 201 |
| 377 | [Return] ${resp.json()['uniqueId']} |
| 378 | Mark ASDC Catalog Resource Inactive |
| 379 | [Documentation] deletes an asdc Catalog Resource |
| 380 | [Arguments] ${catalog_resource_id} |
| 381 | ${resp}= Run ASDC Delete Request ${ASDC_CATALOG_RESOURCES_PATH}/${catalog_resource_id} ${ASDC_DESIGNER_USER_ID} |
| 382 | Should Be Equal As Strings ${resp.status_code} 204 |
| 383 | [Return] ${resp} |
| 384 | Delete Inactive ASDC Catalog Resources |
| 385 | [Documentation] delete all asdc Catalog Resources that are inactive |
| 386 | ${resp}= Run ASDC Delete Request ${ASDC_CATALOG_INACTIVE_RESOURCES_PATH} ${ASDC_DESIGNER_USER_ID} |
| 387 | Should Be Equal As Strings ${resp.status_code} 200 |
| 388 | [Return] ${resp.json()} |
| 389 | Get ASDC Catalog Resource |
| 390 | [Documentation] gets an asdc Catalog Resource by its id |
| 391 | [Arguments] ${catalog_resource_id} |
Brian Freeman | 44b8bb3 | 2018-05-03 21:08:42 -0500 | [diff] [blame] | 392 | ${resp}= Run ASDC Get Request ${ASDC_CATALOG_RESOURCES_PATH}/${catalog_resource_id} ${ASDC_DESIGNER_USER_ID} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 393 | [Return] ${resp.json()} |
Brian Freeman | eef7c6f | 2018-11-16 18:42:21 -0500 | [diff] [blame] | 394 | |
Yang Xu | 2ec8038 | 2018-11-01 12:30:37 -0400 | [diff] [blame] | 395 | Get ASDC Catalog Resource Component Instances |
| 396 | [Documentation] gets asdc Catalog Resource Component Instances by its id |
| 397 | [Arguments] ${catalog_resource_id} |
| 398 | ${resp}= Run ASDC Get Request ${ASDC_FE_CATALOG_RESOURCES_PATH}/${catalog_resource_id}/filteredDataByParams?include=componentInstances ${ASDC_DESIGNER_USER_ID} ${ASDC_FE_ENDPOINT} |
| 399 | [Return] ${resp.json()} |
Brian Freeman | eef7c6f | 2018-11-16 18:42:21 -0500 | [diff] [blame] | 400 | Get ASDC Catalog Resource Component Instances Properties |
| 401 | [Documentation] gets asdc Catalog Resource Component Instances Properties by its id |
| 402 | [Arguments] ${catalog_resource_id} |
| 403 | #${resp}= Run ASDC Get Request ${ASDC_FE_CATALOG_RESOURCES_PATH}/${catalog_resource_id}/filteredDataByParams?include=componentInstancesProperties ${ASDC_DESIGNER_USER_ID} ${ASDC_FE_ENDPOINT} |
| 404 | ${resp}= Run ASDC Get Request ${ASDC_CATALOG_SERVICES_PATH}/${catalog_resource_id}/filteredDataByParams?include=componentInstancesProperties ${ASDC_DESIGNER_USER_ID} ${ASDC_BE_ENDPOINT} |
| 405 | [Return] ${resp.json()} |
| 406 | |
| 407 | |
Yang Xu | 2ec8038 | 2018-11-01 12:30:37 -0400 | [diff] [blame] | 408 | Get ASDC Catalog Resource Inputs |
| 409 | [Documentation] gets asdc Catalog Inputs by its id |
| 410 | [Arguments] ${catalog_resource_id} |
| 411 | ${resp}= Run ASDC Get Request ${ASDC_FE_CATALOG_RESOURCES_PATH}/${catalog_resource_id}/filteredDataByParams?include=inputs ${ASDC_DESIGNER_USER_ID} ${ASDC_FE_ENDPOINT} |
| 412 | [Return] ${resp.json()} |
Brian Freeman | eef7c6f | 2018-11-16 18:42:21 -0500 | [diff] [blame] | 413 | |
Yang Xu | 2ec8038 | 2018-11-01 12:30:37 -0400 | [diff] [blame] | 414 | Get ASDC Catalog Resource Component Instance Properties |
| 415 | [Documentation] gets an asdc Catalog Resource properties by its id |
| 416 | [Arguments] ${catalog_resource_id} ${component_instance_id} ${component_id} |
| 417 | ${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} |
| 418 | [Return] ${resp.json()} |
| 419 | Set ASDC Catalog Resource Component Instance Properties |
| 420 | [Documentation] sets an asdc Catalog Resource by its id |
Brian Freeman | eef7c6f | 2018-11-16 18:42:21 -0500 | [diff] [blame] | 421 | [Arguments] ${catalog_resource_id} ${component_parent_service_id} ${data} |
| 422 | #${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} |
| 423 | ${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} |
Yang Xu | 2ec8038 | 2018-11-01 12:30:37 -0400 | [diff] [blame] | 424 | [Return] ${resp.json()} |
Brian Freeman | eef7c6f | 2018-11-16 18:42:21 -0500 | [diff] [blame] | 425 | |
Yang Xu | 2ec8038 | 2018-11-01 12:30:37 -0400 | [diff] [blame] | 426 | Set ASDC Catalog Resource VNF Inputs |
| 427 | [Documentation] sets an asdc Catalog Resource by its id |
| 428 | [Arguments] ${catalog_resource_id} ${data} |
| 429 | ${resp}= Run ASDC Post Request ${ASDC_FE_CATALOG_RESOURCES_PATH}/${catalog_resource_id}/update/inputs ${data} ${ASDC_DESIGNER_USER_ID} ${ASDC_FE_ENDPOINT} |
| 430 | [Return] ${resp.json()} |
Brian Freeman | 79b00ce | 2018-11-01 14:57:53 -0500 | [diff] [blame] | 431 | Get SDC Demo Vnf Catalog Resource |
| 432 | [Documentation] gets resource id's for demonstration VNFs for instantiate |
| 433 | [Arguments] ${service_name} |
| 434 | ${resp}= Run ASDC Get Request ${ASDC_CATALOG_SERVICES_PATH}/serviceName/${service_name}/serviceVersion/1.0 |
| 435 | @{ITEMS}= Copy List ${resp.json()['componentInstances']} |
| 436 | ${demo_catalog_resource}= Create Dictionary |
| 437 | :FOR ${ELEMENT} IN @{ITEMS} |
| 438 | \ Log ${ELEMENT['name']} |
| 439 | \ Log ${ELEMENT['groupInstances'][0]['groupName']} |
| 440 | \ ${vnf}= Get VNF From Group Name ${ELEMENT['groupInstances'][0]['groupName']} ${service_name} |
| 441 | \ ${vnf_data}= Create Dictionary vnf_type=${ELEMENT['name']} vf_module=${ELEMENT['groupInstances'][0]['groupName']} |
| 442 | \ LOG ${vnf_data} |
| 443 | \ Set To Dictionary ${demo_catalog_resource} ${vnf}=${vnf_data} |
| 444 | \ LOG ${demo_catalog_resource} |
| 445 | [Return] ${demo_catalog_resource} |
| 446 | |
| 447 | Get VNF From Group Name |
| 448 | [Documentation] looks up vnf key from service mapping for a regex on groupName and service_name |
| 449 | [Arguments] ${group_name} ${service_name} |
| 450 | ${vnf}= Set Variable If |
| 451 | ... ('${service_name}'=='demoVFWCL') and ('base_vfw' in '${group_name}') vFWSNK |
| 452 | ... ('${service_name}'=='demoVFWCL') and ('base_vpkg' in '${group_name}') vPKG |
| 453 | ... ('${service_name}'=='demoVLB') and ('base_vlb' in '${group_name}') vLB |
| 454 | [Return] ${vnf} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 455 | Checkin ASDC Catalog Resource |
| 456 | [Documentation] checksin an asdc Catalog Resource by its id |
| 457 | [Arguments] ${catalog_resource_id} |
| 458 | ${map}= Create Dictionary user_remarks=Robot remarks |
Jerry Flood | e2a48d7 | 2017-06-21 15:06:29 -0400 | [diff] [blame] | 459 | ${data}= Fill JSON Template File ${ASDC_USER_REMARKS_TEMPLATE} ${map} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 460 | ${resp}= Run ASDC Post Request ${ASDC_CATALOG_RESOURCES_PATH}/${catalog_resource_id}${ASDC_CATALOG_LIFECYCLE_PATH}/checkin ${data} ${ASDC_DESIGNER_USER_ID} |
| 461 | Should Be Equal As Strings ${resp.status_code} 200 |
| 462 | [Return] ${resp.json()} |
| 463 | Request Certify ASDC Catalog Resource |
| 464 | [Documentation] requests certify on an asdc Catalog Resource by its id |
| 465 | [Arguments] ${catalog_resource_id} |
| 466 | ${map}= Create Dictionary user_remarks=Robot remarks |
Jerry Flood | e2a48d7 | 2017-06-21 15:06:29 -0400 | [diff] [blame] | 467 | ${data}= Fill JSON Template File ${ASDC_USER_REMARKS_TEMPLATE} ${map} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 468 | ${resp}= Run ASDC Post Request ${ASDC_CATALOG_RESOURCES_PATH}/${catalog_resource_id}${ASDC_CATALOG_LIFECYCLE_PATH}/certificationRequest ${data} ${ASDC_DESIGNER_USER_ID} |
| 469 | Should Be Equal As Strings ${resp.status_code} 200 |
| 470 | [Return] ${resp.json()} |
| 471 | Start Certify ASDC Catalog Resource |
| 472 | [Documentation] start certify an asdc Catalog Resource by its id |
| 473 | [Arguments] ${catalog_resource_id} |
| 474 | ${resp}= Run ASDC Post Request ${ASDC_CATALOG_RESOURCES_PATH}/${catalog_resource_id}${ASDC_CATALOG_LIFECYCLE_PATH}/startCertification ${None} ${ASDC_TESTER_USER_ID} |
| 475 | Should Be Equal As Strings ${resp.status_code} 200 |
| 476 | [Return] ${resp.json()} |
| 477 | Certify ASDC Catalog Resource |
| 478 | [Documentation] start certify an asdc Catalog Resource by its id and returns the new id |
Brian Freeman | db1e741 | 2018-08-01 12:46:01 -0500 | [diff] [blame] | 479 | [Arguments] ${catalog_resource_id} ${user_id}=${ASDC_TESTER_USER_ID} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 480 | ${map}= Create Dictionary user_remarks=Robot remarks |
Jerry Flood | e2a48d7 | 2017-06-21 15:06:29 -0400 | [diff] [blame] | 481 | ${data}= Fill JSON Template File ${ASDC_USER_REMARKS_TEMPLATE} ${map} |
Brian Freeman | db1e741 | 2018-08-01 12:46:01 -0500 | [diff] [blame] | 482 | ${resp}= Run ASDC Post Request ${ASDC_CATALOG_RESOURCES_PATH}/${catalog_resource_id}${ASDC_CATALOG_LIFECYCLE_PATH}/certify ${data} ${user_id} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 483 | Should Be Equal As Strings ${resp.status_code} 200 |
| 484 | [Return] ${resp.json()['uniqueId']} |
Jerry Flood | 6bd1afa | 2017-10-09 09:59:23 -0400 | [diff] [blame] | 485 | |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 486 | Upload ASDC Heat Package |
Brian Freeman | f508ab2 | 2018-03-15 21:19:41 -0500 | [diff] [blame] | 487 | [Documentation] Creates an asdc Software Product and returns its id |
| 488 | [Arguments] ${software_product_id} ${file_path} ${version_id}=0.1 |
Jerry Flood | 6bd1afa | 2017-10-09 09:59:23 -0400 | [diff] [blame] | 489 | ${files}= Create Dictionary |
| 490 | Create Multi Part ${files} upload ${file_path} contentType=application/zip |
Brian Freeman | 44b8bb3 | 2018-05-03 21:08:42 -0500 | [diff] [blame] | 491 | ${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} |
Brian Freeman | f508ab2 | 2018-03-15 21:19:41 -0500 | [diff] [blame] | 492 | Should Be Equal As Strings ${resp.status_code} 200 |
Jerry Flood | 6bd1afa | 2017-10-09 09:59:23 -0400 | [diff] [blame] | 493 | |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 494 | Add ASDC Catalog Service |
| 495 | [Documentation] Creates an asdc Catalog Service and returns its id |
jf9860 | 75010a4 | 2017-02-22 16:52:54 -0500 | [diff] [blame] | 496 | [Arguments] ${catalog_service_name} |
Jerry Flood | e2a48d7 | 2017-06-21 15:06:29 -0400 | [diff] [blame] | 497 | ${uuid}= Generate UUID |
jf9860 | 75010a4 | 2017-02-22 16:52:54 -0500 | [diff] [blame] | 498 | ${shortened_uuid}= Evaluate str("${uuid}")[:23] |
Jerry Flood | e2a48d7 | 2017-06-21 15:06:29 -0400 | [diff] [blame] | 499 | ${catalog_service_name}= Set Variable If '${catalog_service_name}' =='' ${shortened_uuid} ${catalog_service_name} |
jf9860 | 75010a4 | 2017-02-22 16:52:54 -0500 | [diff] [blame] | 500 | ${map}= Create Dictionary service_name=${catalog_service_name} |
Jerry Flood | e2a48d7 | 2017-06-21 15:06:29 -0400 | [diff] [blame] | 501 | ${data}= Fill JSON Template File ${ASDC_CATALOG_SERVICE_TEMPLATE} ${map} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 502 | ${resp}= Run ASDC Post Request ${ASDC_CATALOG_SERVICES_PATH} ${data} ${ASDC_DESIGNER_USER_ID} |
| 503 | Should Be Equal As Strings ${resp.status_code} 201 |
| 504 | [Return] ${resp.json()['uniqueId']} |
| 505 | Mark ASDC Catalog Service Inactive |
| 506 | [Documentation] Deletes an asdc Catalog Service |
| 507 | [Arguments] ${catalog_service_id} |
| 508 | ${resp}= Run ASDC Delete Request ${ASDC_CATALOG_SERVICES_PATH}/${catalog_service_id} ${ASDC_DESIGNER_USER_ID} |
| 509 | Should Be Equal As Strings ${resp.status_code} 204 |
| 510 | [Return] ${resp} |
| 511 | Delete Inactive ASDC Catalog Services |
| 512 | [Documentation] delete all asdc Catalog Serivces that are inactive |
| 513 | ${resp}= Run ASDC Delete Request ${ASDC_CATALOG_INACTIVE_SERVICES_PATH} ${ASDC_DESIGNER_USER_ID} |
| 514 | Should Be Equal As Strings ${resp.status_code} 200 |
| 515 | [Return] ${resp.json()} |
| 516 | Get ASDC Catalog Service |
| 517 | [Documentation] gets an asdc Catalog Service by its id |
| 518 | [Arguments] ${catalog_service_id} |
| 519 | ${resp}= Run ASDC Get Request ${ASDC_CATALOG_SERVICES_PATH}/${catalog_service_id} ${ASDC_DESIGNER_USER_ID} |
| 520 | [Return] ${resp.json()} |
| 521 | Checkin ASDC Catalog Service |
| 522 | [Documentation] checksin an asdc Catalog Service by its id |
| 523 | [Arguments] ${catalog_service_id} |
| 524 | ${map}= Create Dictionary user_remarks=Robot remarks |
Jerry Flood | e2a48d7 | 2017-06-21 15:06:29 -0400 | [diff] [blame] | 525 | ${data}= Fill JSON Template File ${ASDC_USER_REMARKS_TEMPLATE} ${map} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 526 | ${resp}= Run ASDC Post Request ${ASDC_CATALOG_SERVICES_PATH}/${catalog_service_id}${ASDC_CATALOG_LIFECYCLE_PATH}/checkin ${data} ${ASDC_DESIGNER_USER_ID} |
| 527 | Should Be Equal As Strings ${resp.status_code} 200 |
| 528 | [Return] ${resp.json()} |
| 529 | Request Certify ASDC Catalog Service |
| 530 | [Documentation] requests certify on an asdc Catalog Service by its id |
| 531 | [Arguments] ${catalog_service_id} |
| 532 | ${map}= Create Dictionary user_remarks=Robot remarks |
Jerry Flood | e2a48d7 | 2017-06-21 15:06:29 -0400 | [diff] [blame] | 533 | ${data}= Fill JSON Template File ${ASDC_USER_REMARKS_TEMPLATE} ${map} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 534 | ${resp}= Run ASDC Post Request ${ASDC_CATALOG_SERVICES_PATH}/${catalog_service_id}${ASDC_CATALOG_LIFECYCLE_PATH}/certificationRequest ${data} ${ASDC_DESIGNER_USER_ID} |
| 535 | Should Be Equal As Strings ${resp.status_code} 200 |
| 536 | [Return] ${resp.json()} |
| 537 | Start Certify ASDC Catalog Service |
| 538 | [Documentation] start certify an asdc Catalog Service by its id |
| 539 | [Arguments] ${catalog_service_id} |
| 540 | ${resp}= Run ASDC Post Request ${ASDC_CATALOG_SERVICES_PATH}/${catalog_service_id}${ASDC_CATALOG_LIFECYCLE_PATH}/startCertification ${None} ${ASDC_TESTER_USER_ID} |
| 541 | Should Be Equal As Strings ${resp.status_code} 200 |
| 542 | [Return] ${resp.json()} |
| 543 | Certify ASDC Catalog Service |
| 544 | [Documentation] start certify an asdc Catalog Service by its id and returns the new id |
| 545 | [Arguments] ${catalog_service_id} |
| 546 | ${map}= Create Dictionary user_remarks=Robot remarks |
Jerry Flood | e2a48d7 | 2017-06-21 15:06:29 -0400 | [diff] [blame] | 547 | ${data}= Fill JSON Template File ${ASDC_USER_REMARKS_TEMPLATE} ${map} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 548 | ${resp}= Run ASDC Post Request ${ASDC_CATALOG_SERVICES_PATH}/${catalog_service_id}${ASDC_CATALOG_LIFECYCLE_PATH}/certify ${data} ${ASDC_TESTER_USER_ID} |
| 549 | Should Be Equal As Strings ${resp.status_code} 200 |
| 550 | [Return] ${resp.json()['uniqueId']} |
| 551 | Approve ASDC Catalog Service |
| 552 | [Documentation] approve an asdc Catalog Service by its id |
| 553 | [Arguments] ${catalog_service_id} |
| 554 | ${map}= Create Dictionary user_remarks=Robot remarks |
Jerry Flood | e2a48d7 | 2017-06-21 15:06:29 -0400 | [diff] [blame] | 555 | ${data}= Fill JSON Template File ${ASDC_USER_REMARKS_TEMPLATE} ${map} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 556 | ${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} |
| 557 | Should Be Equal As Strings ${resp.status_code} 200 |
| 558 | [Return] ${resp.json()} |
| 559 | Distribute ASDC Catalog Service |
| 560 | [Documentation] distribute an asdc Catalog Service by its id |
| 561 | [Arguments] ${catalog_service_id} |
| 562 | ${resp}= Run ASDC Post Request ${ASDC_CATALOG_SERVICES_PATH}/${catalog_service_id}${ASDC_CATALOG_SERVICE_DISTRIBUTION_ACTIVATE_PATH} ${None} ${ASDC_OPS_USER_ID} |
| 563 | Should Be Equal As Strings ${resp.status_code} 200 |
| 564 | [Return] ${resp.json()} |
| 565 | Add ASDC Resource Instance |
| 566 | [Documentation] Creates an asdc Resource Instance and returns its id |
Brian Freeman | eef7c6f | 2018-11-16 18:42:21 -0500 | [diff] [blame] | 567 | [Arguments] ${catalog_service_id} ${catalog_resource_id} ${catalog_resource_name} ${xoffset}=${0} ${yoffset}=${0} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 568 | ${milli_timestamp}= Generate MilliTimestamp UUID |
Brian Freeman | eef7c6f | 2018-11-16 18:42:21 -0500 | [diff] [blame] | 569 | ${xoffset}= Set Variable ${xoffset+306} |
| 570 | ${yoffset}= Set Variable ${yoffset+248} |
| 571 | ${map}= Create Dictionary catalog_resource_id=${catalog_resource_id} catalog_resource_name=${catalog_resource_name} milli_timestamp=${milli_timestamp} posX=${xoffset} posY=${yoffset} |
Jerry Flood | e2a48d7 | 2017-06-21 15:06:29 -0400 | [diff] [blame] | 572 | ${data}= Fill JSON Template File ${ASDC_RESOURCE_INSTANCE_TEMPLATE} ${map} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 573 | ${resp}= Run ASDC Post Request ${ASDC_CATALOG_SERVICES_PATH}/${catalog_service_id}${ASDC_CATALOG_SERVICE_RESOURCE_INSTANCE_PATH} ${data} ${ASDC_DESIGNER_USER_ID} |
| 574 | Should Be Equal As Strings ${resp.status_code} 201 |
| 575 | [Return] ${resp.json()['uniqueId']} |
Brian Freeman | eef7c6f | 2018-11-16 18:42:21 -0500 | [diff] [blame] | 576 | |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 577 | Get Catalog Service Distribution |
| 578 | [Documentation] gets an asdc catalog Service distrbution |
| 579 | [Arguments] ${catalog_service_uuid} |
| 580 | ${resp}= Run ASDC Get Request ${ASDC_CATALOG_SERVICES_PATH}/${catalog_service_uuid}${ASDC_CATALOG_SERVICE_DISTRIBUTION_PATH} ${ASDC_OPS_USER_ID} |
| 581 | Should Be Equal As Strings ${resp.status_code} 200 |
| 582 | [Return] ${resp.json()} |
| 583 | Check Catalog Service Distributed |
| 584 | [Documentation] gets an asdc catalog Service distrbution |
Brian Freeman | adaa237 | 2018-10-24 12:25:22 -0500 | [diff] [blame] | 585 | [Arguments] ${catalog_service_uuid} ${dist_status} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 586 | ${dist_resp}= Get Catalog Service Distribution ${catalog_service_uuid} |
| 587 | Should Be Equal As Strings ${dist_resp['distributionStatusOfServiceList'][0]['deployementStatus']} Distributed |
| 588 | ${det_resp}= Get Catalog Service Distribution Details ${dist_resp['distributionStatusOfServiceList'][0]['distributionID']} |
| 589 | @{ITEMS}= Copy List ${det_resp['distributionStatusList']} |
Brian Freeman | f508ab2 | 2018-03-15 21:19:41 -0500 | [diff] [blame] | 590 | Should Not Be Empty ${ITEMS} |
Brian Freeman | a62644f | 2018-05-13 12:47:38 -0500 | [diff] [blame] | 591 | ${SO_COMPLETE} Set Variable FALSE |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 592 | :FOR ${ELEMENT} IN @{ITEMS} |
Brian Freeman | f508ab2 | 2018-03-15 21:19:41 -0500 | [diff] [blame] | 593 | \ Log ${ELEMENT['omfComponentID']} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 594 | \ Log ${ELEMENT['status']} |
Brian Freeman | 41ab5e5 | 2018-08-08 14:24:23 -0500 | [diff] [blame] | 595 | \ ${SO_COMPLETE} Set Variable If (('${ELEMENT['status']}' == 'DISTRIBUTION_COMPLETE_OK')) or ('${SO_COMPLETE}'=='TRUE') TRUE |
Brian Freeman | eca7107 | 2018-08-16 14:50:16 -0500 | [diff] [blame] | 596 | \ Exit For Loop If ('${SO_COMPLETE}'=='TRUE') |
| 597 | \ Exit For Loop If ('${ELEMENT['status']}' == 'DISTRIBUTION_COMPLETE_ERROR') |
Brian Freeman | adaa237 | 2018-10-24 12:25:22 -0500 | [diff] [blame] | 598 | \ ${dist_status}= Set Variable If (('${ELEMENT['status']}' == 'COMPONENT_DONE_ERROR') and ('${ELEMENT['omfComponentID']}' == 'aai-ml')) EXIT |
| 599 | \ Exit For Loop If (('${ELEMENT['status']}' == 'COMPONENT_DONE_ERROR') and ('${ELEMENT['omfComponentID']}' == 'aai-ml')) |
Brian Freeman | a62644f | 2018-05-13 12:47:38 -0500 | [diff] [blame] | 600 | Should Be True ( '${SO_COMPLETE}'=='TRUE') SO Test |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 601 | Get Catalog Service Distribution Details |
| 602 | [Documentation] gets an asdc catalog Service distrbution details |
| 603 | [Arguments] ${catalog_service_distribution_id} |
Brian Freeman | 44b8bb3 | 2018-05-03 21:08:42 -0500 | [diff] [blame] | 604 | ${resp}= Run ASDC Get Request ${ASDC_CATALOG_SERVICES_PATH}${ASDC_CATALOG_SERVICE_DISTRIBUTION_PATH}/${catalog_service_distribution_id} ${ASDC_OPS_USER_ID} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 605 | Should Be Equal As Strings ${resp.status_code} 200 |
| 606 | [Return] ${resp.json()} |
| 607 | Run ASDC Health Check |
| 608 | [Documentation] Runs a ASDC health check |
DR695H | bf5a3a3 | 2017-06-30 13:09:57 -0400 | [diff] [blame] | 609 | ${session}= Create Session asdc ${ASDC_FE_ENDPOINT} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 610 | ${uuid}= Generate UUID |
| 611 | ${headers}= Create Dictionary Accept=application/json Content-Type=application/json X-TransactionId=${GLOBAL_APPLICATION_ID}-${uuid} X-FromAppId=${GLOBAL_APPLICATION_ID} |
| 612 | ${resp}= Get Request asdc ${ASDC_HEALTH_CHECK_PATH} headers=${headers} |
Brian Freeman | adaa237 | 2018-10-24 12:25:22 -0500 | [diff] [blame] | 613 | # only test for HTTP 200 to determine SDC Health. SDC_DE_HEALTH is informational |
Brian Freeman | 00f125e | 2018-09-05 13:03:48 -0500 | [diff] [blame] | 614 | Should Be Equal As Strings ${resp.status_code} 200 SDC DOWN |
Brian Freeman | 5cf5fa6 | 2018-04-23 20:28:16 -0500 | [diff] [blame] | 615 | ${SDC_DE_HEALTH}= Catenate DOWN |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 616 | @{ITEMS}= Copy List ${resp.json()['componentsInfo']} |
| 617 | :FOR ${ELEMENT} IN @{ITEMS} |
| 618 | \ Log ${ELEMENT['healthCheckStatus']} |
Brian Freeman | e546f7e | 2018-04-19 12:17:56 -0500 | [diff] [blame] | 619 | \ ${SDC_DE_HEALTH} Set Variable If (('DE' in '${ELEMENT['healthCheckComponent']}') and ('${ELEMENT['healthCheckStatus']}' == 'UP')) or ('${SDC_DE_HEALTH}'=='UP') UP |
Brian Freeman | d5743d5 | 2018-11-05 11:05:43 -0500 | [diff] [blame] | 620 | Log To Console (DMaaP:${SDC_DE_HEALTH}) no_newline=true |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 621 | Run ASDC Get Request |
| 622 | [Documentation] Runs an ASDC get request |
Brian Freeman | 44b8bb3 | 2018-05-03 21:08:42 -0500 | [diff] [blame] | 623 | [Arguments] ${data_path} ${user}=${ASDC_DESIGNER_USER_ID} ${MY_ASDC_BE_ENDPOINT}=${ASDC_BE_ENDPOINT} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 624 | ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD} |
Brian Freeman | 44b8bb3 | 2018-05-03 21:08:42 -0500 | [diff] [blame] | 625 | Log Creating session ${MY_ASDC_BE_ENDPOINT} |
| 626 | ${session}= Create Session asdc ${MY_ASDC_BE_ENDPOINT} auth=${auth} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 627 | ${uuid}= Generate UUID |
| 628 | ${headers}= Create Dictionary Accept=application/json Content-Type=application/json USER_ID=${user} X-TransactionId=${GLOBAL_APPLICATION_ID}-${uuid} X-FromAppId=${GLOBAL_APPLICATION_ID} |
| 629 | ${resp}= Get Request asdc ${data_path} headers=${headers} |
| 630 | Log Received response from asdc ${resp.text} |
| 631 | [Return] ${resp} |
| 632 | Run ASDC Put Request |
| 633 | [Documentation] Runs an ASDC put request |
Brian Freeman | 44b8bb3 | 2018-05-03 21:08:42 -0500 | [diff] [blame] | 634 | [Arguments] ${data_path} ${data} ${user}=${ASDC_DESIGNER_USER_ID} ${MY_ASDC_BE_ENDPOINT}=${ASDC_BE_ENDPOINT} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 635 | ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD} |
Brian Freeman | 44b8bb3 | 2018-05-03 21:08:42 -0500 | [diff] [blame] | 636 | Log Creating session ${MY_ASDC_BE_ENDPOINT} |
| 637 | ${session}= Create Session asdc ${MY_ASDC_BE_ENDPOINT} auth=${auth} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 638 | ${uuid}= Generate UUID |
| 639 | ${headers}= Create Dictionary Accept=application/json Content-Type=application/json USER_ID=${user} X-TransactionId=${GLOBAL_APPLICATION_ID}-${uuid} X-FromAppId=${GLOBAL_APPLICATION_ID} |
| 640 | ${resp}= Put Request asdc ${data_path} data=${data} headers=${headers} |
| 641 | Log Received response from asdc ${resp.text} |
| 642 | [Return] ${resp} |
Jerry Flood | 6bd1afa | 2017-10-09 09:59:23 -0400 | [diff] [blame] | 643 | |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 644 | Run ASDC Post Files Request |
| 645 | [Documentation] Runs an ASDC post request |
Brian Freeman | 44b8bb3 | 2018-05-03 21:08:42 -0500 | [diff] [blame] | 646 | [Arguments] ${data_path} ${files} ${user}=${ASDC_DESIGNER_USER_ID} ${MY_ASDC_BE_ENDPOINT}=${ASDC_BE_ENDPOINT} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 647 | ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD} |
Brian Freeman | 44b8bb3 | 2018-05-03 21:08:42 -0500 | [diff] [blame] | 648 | Log Creating session ${MY_ASDC_BE_ENDPOINT} |
| 649 | ${session}= Create Session asdc ${MY_ASDC_BE_ENDPOINT} auth=${auth} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 650 | ${uuid}= Generate UUID |
| 651 | ${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} |
| 652 | ${resp}= Post Request asdc ${data_path} files=${files} headers=${headers} |
| 653 | Log Received response from asdc ${resp.text} |
Jerry Flood | e2a48d7 | 2017-06-21 15:06:29 -0400 | [diff] [blame] | 654 | [Return] ${resp} |
Jerry Flood | 6bd1afa | 2017-10-09 09:59:23 -0400 | [diff] [blame] | 655 | |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 656 | Run ASDC Post Request |
| 657 | [Documentation] Runs an ASDC post request |
Brian Freeman | 44b8bb3 | 2018-05-03 21:08:42 -0500 | [diff] [blame] | 658 | [Arguments] ${data_path} ${data} ${user}=${ASDC_DESIGNER_USER_ID} ${MY_ASDC_BE_ENDPOINT}=${ASDC_BE_ENDPOINT} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 659 | ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD} |
Brian Freeman | 44b8bb3 | 2018-05-03 21:08:42 -0500 | [diff] [blame] | 660 | Log Creating session ${MY_ASDC_BE_ENDPOINT} |
| 661 | ${session}= Create Session asdc ${MY_ASDC_BE_ENDPOINT} auth=${auth} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 662 | ${uuid}= Generate UUID |
| 663 | ${headers}= Create Dictionary Accept=application/json Content-Type=application/json USER_ID=${user} X-TransactionId=${GLOBAL_APPLICATION_ID}-${uuid} X-FromAppId=${GLOBAL_APPLICATION_ID} |
| 664 | ${resp}= Post Request asdc ${data_path} data=${data} headers=${headers} |
| 665 | Log Received response from asdc ${resp.text} |
Jerry Flood | e2a48d7 | 2017-06-21 15:06:29 -0400 | [diff] [blame] | 666 | [Return] ${resp} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 667 | Run ASDC Delete Request |
| 668 | [Documentation] Runs an ASDC delete request |
Brian Freeman | 44b8bb3 | 2018-05-03 21:08:42 -0500 | [diff] [blame] | 669 | [Arguments] ${data_path} ${user}=${ASDC_DESIGNER_USER_ID} ${MY_ASDC_BE_ENDPOINT}=${ASDC_BE_ENDPOINT} |
| 670 | ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD} |
| 671 | Log Creating session ${MY_ASDC_BE_ENDPOINT} |
| 672 | ${session}= Create Session asdc ${MY_ASDC_BE_ENDPOINT} auth=${auth} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 673 | ${uuid}= Generate UUID |
| 674 | ${headers}= Create Dictionary Accept=application/json Content-Type=application/json USER_ID=${user} X-TransactionId=${GLOBAL_APPLICATION_ID}-${uuid} X-FromAppId=${GLOBAL_APPLICATION_ID} |
| 675 | ${resp}= Delete Request asdc ${data_path} headers=${headers} |
| 676 | Log Received response from asdc ${resp.text} |
Jerry Flood | e2a48d7 | 2017-06-21 15:06:29 -0400 | [diff] [blame] | 677 | [Return] ${resp} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 678 | Open ASDC GUI |
| 679 | [Documentation] Logs in to ASDC GUI |
| 680 | [Arguments] ${PATH} |
| 681 | ## Setup Browever now being managed by the test case |
| 682 | ##Setup Browser |
DR695H | bf5a3a3 | 2017-06-30 13:09:57 -0400 | [diff] [blame] | 683 | Go To ${ASDC_FE_ENDPOINT}${PATH} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 684 | Maximize Browser Window |
Jerry Flood | 6bd1afa | 2017-10-09 09:59:23 -0400 | [diff] [blame] | 685 | |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 686 | Set Browser Implicit Wait ${GLOBAL_SELENIUM_BROWSER_IMPLICIT_WAIT} |
DR695H | bf5a3a3 | 2017-06-30 13:09:57 -0400 | [diff] [blame] | 687 | Log Logging in to ${ASDC_FE_ENDPOINT}${PATH} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 688 | Title Should Be ASDC |
Jerry Flood | e2a48d7 | 2017-06-21 15:06:29 -0400 | [diff] [blame] | 689 | Wait Until Page Contains Element xpath=//div/a[text()='SDC'] ${GLOBAL_SELENIUM_BROWSER_WAIT_TIMEOUT} |
DR695H | bf5a3a3 | 2017-06-30 13:09:57 -0400 | [diff] [blame] | 690 | Log Logged in to ${ASDC_FE_ENDPOINT}${PATH} |
Jerry Flood | 6bd1afa | 2017-10-09 09:59:23 -0400 | [diff] [blame] | 691 | |
| 692 | |
| 693 | Create Multi Part |
| 694 | [Arguments] ${addTo} ${partName} ${filePath} ${contentType}=${None} |
| 695 | ${fileData}= Get Binary File ${filePath} |
| 696 | ${fileDir} ${fileName}= Split Path ${filePath} |
| 697 | ${partData}= Create List ${fileName} ${fileData} ${contentType} |
| 698 | Set To Dictionary ${addTo} ${partName}=${partData} |
Brian Freeman | f940ee9 | 2018-05-25 21:09:05 -0500 | [diff] [blame] | 699 | |