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 |
Brian Freeman | 2e1d0ff | 2019-01-23 09:38:13 -0500 | [diff] [blame] | 3 | Library RequestsLibrary |
| 4 | Library UUID |
| 5 | Library JSONUtils |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 6 | Library OperatingSystem |
| 7 | Library Collections |
Brian Freeman | 2e1d0ff | 2019-01-23 09:38:13 -0500 | [diff] [blame] | 8 | Library ExtendedSelenium2Library |
bdfreeman1421 | b2a4951 | 2018-11-25 07:32:19 -0500 | [diff] [blame] | 9 | Library HttpLibrary.HTTP |
Brian Freeman | 2e1d0ff | 2019-01-23 09:38:13 -0500 | [diff] [blame] | 10 | Library String |
| 11 | Library StringTemplater |
Yang Xu | 7037e54 | 2018-12-28 01:19:26 -0500 | [diff] [blame] | 12 | Library ArchiveLibrary |
| 13 | Library HEATUtils |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 14 | Resource global_properties.robot |
| 15 | Resource browser_setup.robot |
| 16 | Resource json_templater.robot |
Brian Freeman | 2e1d0ff | 2019-01-23 09:38:13 -0500 | [diff] [blame] | 17 | |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 18 | *** Variables *** |
| 19 | ${ASDC_DESIGNER_USER_ID} cs0008 |
| 20 | ${ASDC_TESTER_USER_ID} jm0007 |
| 21 | ${ASDC_GOVERNOR_USER_ID} gv0001 |
| 22 | ${ASDC_OPS_USER_ID} op0001 |
| 23 | ${ASDC_HEALTH_CHECK_PATH} /sdc1/rest/healthCheck |
| 24 | ${ASDC_VENDOR_LICENSE_MODEL_PATH} /onboarding-api/v1.0/vendor-license-models |
| 25 | ${ASDC_VENDOR_SOFTWARE_PRODUCT_PATH} /onboarding-api/v1.0/vendor-software-products |
| 26 | ${ASDC_VENDOR_KEY_GROUP_PATH} /license-key-groups |
| 27 | ${ASDC_VENDOR_ENTITLEMENT_POOL_PATH} /entitlement-pools |
| 28 | ${ASDC_VENDOR_FEATURE_GROUP_PATH} /feature-groups |
| 29 | ${ASDC_VENDOR_LICENSE_AGREEMENT_PATH} /license-agreements |
| 30 | ${ASDC_VENDOR_ACTIONS_PATH} /actions |
Jerry Flood | e2a48d7 | 2017-06-21 15:06:29 -0400 | [diff] [blame] | 31 | ${ASDC_VENDOR_SOFTWARE_UPLOAD_PATH} /orchestration-template-candidate |
Yang Xu | 2ec8038 | 2018-11-01 12:30:37 -0400 | [diff] [blame] | 32 | ${ASDC_FE_CATALOG_RESOURCES_PATH} /sdc1/feProxy/rest/v1/catalog/resources |
Brian Freeman | eef7c6f | 2018-11-16 18:42:21 -0500 | [diff] [blame] | 33 | ${ASDC_FE_CATALOG_SERVICES_PATH} /sdc1/feProxy/rest/v1/catalog/services |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 34 | ${ASDC_CATALOG_RESOURCES_PATH} /sdc2/rest/v1/catalog/resources |
| 35 | ${ASDC_CATALOG_SERVICES_PATH} /sdc2/rest/v1/catalog/services |
| 36 | ${ASDC_CATALOG_INACTIVE_RESOURCES_PATH} /sdc2/rest/v1/inactiveComponents/resource |
Brian Freeman | eef7c6f | 2018-11-16 18:42:21 -0500 | [diff] [blame] | 37 | ${ASDC_CATALOG_RESOURCES_QUERY_PATH} /sdc2/rest/v1/catalog/resources/resourceName |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 38 | ${ASDC_CATALOG_INACTIVE_SERVICES_PATH} /sdc2/rest/v1/inactiveComponents/service |
| 39 | ${ASDC_CATALOG_LIFECYCLE_PATH} /lifecycleState |
| 40 | ${ASDC_CATALOG_SERVICE_RESOURCE_INSTANCE_PATH} /resourceInstance |
Brian Freeman | 2e1d0ff | 2019-01-23 09:38:13 -0500 | [diff] [blame] | 41 | ${ASDC_CATALOG_SERVICE_RESOURCE_ARTIFACT_PATH} /artifacts |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 42 | ${ASDC_CATALOG_SERVICE_DISTRIBUTION_STATE_PATH} /distribution-state |
| 43 | ${ASDC_CATALOG_SERVICE_DISTRIBUTION_PATH} /distribution |
| 44 | ${ASDC_DISTRIBUTION_STATE_APPROVE_PATH} /approve |
| 45 | ${ASDC_CATALOG_SERVICE_DISTRIBUTION_ACTIVATE_PATH} /distribution/PROD/activate |
| 46 | ${ASDC_LICENSE_MODEL_TEMPLATE} robot/assets/templates/asdc/license_model.template |
| 47 | ${ASDC_KEY_GROUP_TEMPLATE} robot/assets/templates/asdc/key_group.template |
| 48 | ${ASDC_ENTITLEMENT_POOL_TEMPLATE} robot/assets/templates/asdc/entitlement_pool.template |
| 49 | ${ASDC_FEATURE_GROUP_TEMPLATE} robot/assets/templates/asdc/feature_group.template |
| 50 | ${ASDC_LICENSE_AGREEMENT_TEMPLATE} robot/assets/templates/asdc/license_agreement.template |
| 51 | ${ASDC_ACTION_TEMPLATE} robot/assets/templates/asdc/action.template |
| 52 | ${ASDC_SOFTWARE_PRODUCT_TEMPLATE} robot/assets/templates/asdc/software_product.template |
Brian Freeman | 2e1d0ff | 2019-01-23 09:38:13 -0500 | [diff] [blame] | 53 | ${ASDC_ARTIFACT_UPLOAD_TEMPLATE} robot/assets/templates/asdc/artifact_upload.template |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 54 | ${ASDC_CATALOG_RESOURCE_TEMPLATE} robot/assets/templates/asdc/catalog_resource.template |
| 55 | ${ASDC_USER_REMARKS_TEMPLATE} robot/assets/templates/asdc/user_remarks.template |
| 56 | ${ASDC_CATALOG_SERVICE_TEMPLATE} robot/assets/templates/asdc/catalog_service.template |
| 57 | ${ASDC_RESOURCE_INSTANCE_TEMPLATE} robot/assets/templates/asdc/resource_instance.template |
Yang Xu | 2ec8038 | 2018-11-01 12:30:37 -0400 | [diff] [blame] | 58 | ${ASDC_RESOURCE_INSTANCE_VNF_PROPERTIES_TEMPLATE} robot/assets/templates/asdc/catalog_vnf_properties.template |
| 59 | ${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] | 60 | ${SDC_CATALOG_NET_RESOURCE_INPUT_TEMPLATE} robot/assets/templates/asdc/catalog_net_input_properties.template |
bdfreeman1421 | b2a4951 | 2018-11-25 07:32:19 -0500 | [diff] [blame] | 61 | ${ASDC_ALLOTTED_RESOURCE_CATALOG_RESOURCE_TEMPLATE} robot/assets/templates/asdc/catalog_resource_alloted_resource.template |
| 62 | ${SDC_CATALOG_ALLOTTED_RESOURCE_PROPERTIES_TEMPLATE} robot/assets/templates/asdc/catalog_allotted_properties.template |
| 63 | ${SDC_CATALOG_ALLOTTED_RESOURCE_INPUTS_TEMPLATE} robot/assets/templates/asdc/catalog_allotted_inputs.template |
Brian Freeman | 2e1d0ff | 2019-01-23 09:38:13 -0500 | [diff] [blame] | 64 | ${SDC_CATALOG_DEPLOYMENT_ARTIFACT_PATH} robot/assets/asdc/blueprints/ |
Brian Freeman | f508ab2 | 2018-03-15 21:19:41 -0500 | [diff] [blame] | 65 | ${ASDC_FE_ENDPOINT} ${GLOBAL_ASDC_SERVER_PROTOCOL}://${GLOBAL_INJECTED_SDC_FE_IP_ADDR}:${GLOBAL_ASDC_FE_PORT} |
| 66 | ${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] | 67 | ${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] | 68 | |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 69 | *** Keywords *** |
| 70 | Distribute Model From ASDC |
| 71 | [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] | 72 | [Arguments] ${model_zip_path} ${catalog_service_name}= ${cds}= ${service}= |
bdfreeman1421 | b2a4951 | 2018-11-25 07:32:19 -0500 | [diff] [blame] | 73 | # For Testing use random service names |
Brian Freeman | eef7c6f | 2018-11-16 18:42:21 -0500 | [diff] [blame] | 74 | #${random}= Get Current Date |
| 75 | #${catalog_service_id}= Add ASDC Catalog Service ${catalog_service_name}_${random} |
jf9860 | 75010a4 | 2017-02-22 16:52:54 -0500 | [diff] [blame] | 76 | ${catalog_service_id}= Add ASDC Catalog Service ${catalog_service_name} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 77 | ${catalog_resource_ids}= Create List |
Jerry Flood | 3a169a3 | 2017-12-01 12:39:10 -0500 | [diff] [blame] | 78 | ${catalog_resources}= Create Dictionary |
Brian Freeman | ee02b31 | 2019-02-04 20:36:08 -0500 | [diff] [blame^] | 79 | ##### TODO: Support for Multiple resources of one type in a service ###### |
| 80 | # The zip list is the resources - no mechanism to indicate more than 1 of the items in the zip list |
| 81 | # GLOBAL_SERVICE_VNF_MAPPING has the logical mapping but its not the same key as model_zip_path |
| 82 | # ${vnflist}= Get From Dictionary ${GLOBAL_SERVICE_VNF_MAPPING} ${service} |
| 83 | # Save the resource_id in a dictionary keyed byt the resource NAme in the zipfile name (vFWDT_vFWSNK.zip or vFWDT_vPKG.zip) |
| 84 | # Create the resources but dont immediately add resource |
| 85 | # Add Resource to Service in a separate FOR loop |
| 86 | # TODO: CHECK vCPE models to make sure they aren't broken with the split |
| 87 | ${resource_types}= Create Dictionary |
| 88 | |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 89 | : FOR ${zip} IN @{model_zip_path} |
Yang Xu | 2ec8038 | 2018-11-01 12:30:37 -0400 | [diff] [blame] | 90 | \ ${loop_catalog_resource_id}= Setup ASDC Catalog Resource ${zip} ${cds} |
Brian Freeman | ee02b31 | 2019-02-04 20:36:08 -0500 | [diff] [blame^] | 91 | # zip can be vFW.zip or vFWDT_VFWSNK.zip |
| 92 | \ ${resource_type_match}= Get Regexp Matches ${zip} ${service}_(.*)\.zip 1 |
| 93 | \ ${resource_type_string}= Set Variable If '${resource_type_match}' is '[]' ${service} ${resource_type_match[0]} |
| 94 | \ Set To Dictionary ${resource_types} ${resource_type_string} ${loop_catalog_resource_id} |
Jerry Flood | e2a48d7 | 2017-06-21 15:06:29 -0400 | [diff] [blame] | 95 | \ Append To List ${catalog_resource_ids} ${loop_catalog_resource_id} |
Brian Freeman | ee02b31 | 2019-02-04 20:36:08 -0500 | [diff] [blame^] | 96 | |
| 97 | |
| 98 | ${vnflist}= Get From Dictionary ${GLOBAL_SERVICE_VNF_MAPPING} ${service} |
| 99 | |
| 100 | # Spread the icons on the pallette starting on the left |
| 101 | ${xoffset}= Set Variable ${0} |
| 102 | |
| 103 | : FOR ${vnf} IN @{vnflist} |
| 104 | #\ ${catalog_resource_unique_name}= Add ASDC Resource Instance ${catalog_service_id} ${loop_catalog_resource_id} ${loop_catalog_resource_resp['name']} |
| 105 | \ ${loop_catalog_resource_resp}= Get ASDC Catalog Resource ${resource_types['${vnf}']} |
| 106 | \ Set To Dictionary ${catalog_resources} ${resource_types['${vnf}']}=${loop_catalog_resource_resp} |
| 107 | \ ${catalog_resource_unique_name}= Add ASDC Resource Instance ${catalog_service_id} ${resource_types['${vnf}']} ${loop_catalog_resource_resp['name']} ${xoffset} |
| 108 | \ ${xoffset}= Set Variable ${xoffset+100} |
Brian Freeman | eef7c6f | 2018-11-16 18:42:21 -0500 | [diff] [blame] | 109 | # |
| 110 | # do this here because the loop_catalog_resource_resp is different format after adding networks |
| 111 | ${vf_module}= Find Element In Array ${loop_catalog_resource_resp['groups']} type org.openecomp.groups.VfModule |
| 112 | # |
| 113 | # do network |
| 114 | ${networklist}= Get From Dictionary ${GLOBAL_SERVICE_GEN_NEUTRON_NETWORK_MAPPING} ${service} |
Brian Freeman | eef7c6f | 2018-11-16 18:42:21 -0500 | [diff] [blame] | 115 | ${generic_neutron_net_uuid}= Get Generic NeutronNet UUID |
| 116 | :FOR ${network} in @{networklist} |
| 117 | \ ${loop_catalog_resource_id}= Set Variable ${generic_neutron_net_uuid} |
| 118 | \ Append To List ${catalog_resource_ids} ${loop_catalog_resource_id} |
| 119 | \ ${loop_catalog_resource_resp}= Get ASDC Catalog Resource ${loop_catalog_resource_id} |
Brian Freeman | eef7c6f | 2018-11-16 18:42:21 -0500 | [diff] [blame] | 120 | \ ${loop_catalog_resource_id}= Add ASDC Resource Instance ${catalog_service_id} ${loop_catalog_resource_id} ${network} ${xoffset} ${0} |
| 121 | \ ${nf_role}= Convert To Lowercase ${network} |
| 122 | \ Setup SDC Catalog Resource GenericNeutronNet Properties ${catalog_service_id} ${nf_role} ${loop_catalog_resource_id} |
| 123 | \ ${xoffset}= Set Variable ${xoffset+100} |
| 124 | \ Set To Dictionary ${catalog_resources} ${loop_catalog_resource_id}=${loop_catalog_resource_resp} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 125 | ${catalog_service_resp}= Get ASDC Catalog Service ${catalog_service_id} |
Brian Freeman | 2e1d0ff | 2019-01-23 09:38:13 -0500 | [diff] [blame] | 126 | # |
| 127 | # do deployment artifacts |
| 128 | # |
| 129 | ${deploymentlist}= Get From Dictionary ${GLOBAL_SERVICE_DEPLOYMENT_ARTIFACT_MAPPING} ${service} |
| 130 | :FOR ${deployment} IN @{deploymentlist} |
| 131 | \ ${loop_catalog_resource_resp}= Get ASDC Catalog Resource ${loop_catalog_resource_id} |
| 132 | \ Setup SDC Catalog Resource Deployment Artifact Properties ${catalog_service_id} ${loop_catalog_resource_resp} ${catalog_resource_unique_name} ${deployment} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 133 | Checkin ASDC Catalog Service ${catalog_service_id} |
| 134 | Request Certify ASDC Catalog Service ${catalog_service_id} |
| 135 | Start Certify ASDC Catalog Service ${catalog_service_id} |
| 136 | # on certify it gets a new id |
| 137 | ${catalog_service_id}= Certify ASDC Catalog Service ${catalog_service_id} |
| 138 | Approve ASDC Catalog Service ${catalog_service_id} |
Brian Freeman | 796b9eb | 2018-10-08 08:23:20 -0500 | [diff] [blame] | 139 | : FOR ${DIST_INDEX} IN RANGE 1 |
Brian Freeman | 18df891 | 2018-05-25 13:27:29 -0500 | [diff] [blame] | 140 | \ Log Distribution Attempt ${DIST_INDEX} |
| 141 | \ Distribute ASDC Catalog Service ${catalog_service_id} |
| 142 | \ ${catalog_service_resp}= Get ASDC Catalog Service ${catalog_service_id} |
Brian Freeman | f940ee9 | 2018-05-25 21:09:05 -0500 | [diff] [blame] | 143 | \ ${status} ${_} = Run Keyword And Ignore Error Loop Over Check Catalog Service Distributed ${catalog_service_resp['uuid']} |
Brian Freeman | 2e1d0ff | 2019-01-23 09:38:13 -0500 | [diff] [blame] | 144 | \ Exit For Loop If '${status}'=='PASS' |
Brian Freeman | 8c002d5 | 2018-07-30 19:35:36 -0500 | [diff] [blame] | 145 | Should Be Equal As Strings ${status} PASS |
Jerry Flood | 3a169a3 | 2017-12-01 12:39:10 -0500 | [diff] [blame] | 146 | [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] | 147 | |
bdfreeman1421 | b2a4951 | 2018-11-25 07:32:19 -0500 | [diff] [blame] | 148 | Distribute vCPEResCust Model From ASDC |
| 149 | [Documentation] goes end to end creating all the asdc objects for the vCPE ResCust Service model and distributing it to the systems. it then returns the service name, vf name and vf module name |
| 150 | [Arguments] ${model_zip_path} ${catalog_service_name}= ${cds}= ${service}= |
| 151 | # For testing use random service name |
Brian Freeman | 9c42ae1 | 2018-11-27 14:33:27 -0500 | [diff] [blame] | 152 | #${random}= Get Current Date |
Brian Freeman | 2e1d0ff | 2019-01-23 09:38:13 -0500 | [diff] [blame] | 153 | ${uuid}= Generate UUID |
| 154 | ${random}= Evaluate str("${uuid}")[:4] |
| 155 | ${catalog_service_id}= Add ASDC Catalog Service ${catalog_service_name}_${random} |
| 156 | # catalog_service_name already |
| 157 | #${catalog_service_id}= Add ASDC Catalog Service ${catalog_service_name} |
bdfreeman1421 | b2a4951 | 2018-11-25 07:32:19 -0500 | [diff] [blame] | 158 | Log To Console ${\n}ServiceName: ${catalog_service_name}_${random} |
| 159 | #${catalog_service_id}= Add ASDC Catalog Service ${catalog_service_name} |
| 160 | ${catalog_resource_ids}= Create List |
| 161 | ${catalog_resources}= Create Dictionary |
| 162 | : FOR ${zip} IN @{model_zip_path} |
| 163 | \ ${loop_catalog_resource_id}= Setup ASDC Catalog Resource ${zip} ${cds} |
| 164 | \ Append To List ${catalog_resource_ids} ${loop_catalog_resource_id} |
| 165 | \ ${loop_catalog_resource_resp}= Get ASDC Catalog Resource ${loop_catalog_resource_id} |
| 166 | \ Add ASDC Resource Instance ${catalog_service_id} ${loop_catalog_resource_id} ${loop_catalog_resource_resp['name']} |
| 167 | \ Set To Dictionary ${catalog_resources} ${loop_catalog_resource_id}=${loop_catalog_resource_resp} |
| 168 | # |
| 169 | # do this here because the loop_catalog_resource_resp is different format after adding networks |
| 170 | ${vf_module}= Find Element In Array ${loop_catalog_resource_resp['groups']} type org.openecomp.groups.VfModule |
| 171 | # |
| 172 | # do allottedresource |
| 173 | ${allottedresource_list}= Create List TunnelXConn BRG |
| 174 | # Example data |
| 175 | #${tunnelxconn_dict}= Create Dictionary invariantUUID=8ac029e7-77aa-40d4-b28a-d17c02d5fd82 UUID=2ddc1b37-d7da-4aab-b645-ed7db34a5d03 node_type=org.openecomp.service.Demovcpevgmux |
| 176 | #${brg_dict}= Create Dictionary invariantUUID=ff0337b9-dbe2-4d88-bb74-18bf027ae586 UUID=1b6974f1-4aed-47f4-b962-816aa1261927 node_type=org.openecomp.service.Demovcpevbrgemu |
Yang Xu | 7037e54 | 2018-12-28 01:19:26 -0500 | [diff] [blame] | 177 | # Create /tmp/vcpe_allotted_resource_data.json with demo vgmux and brgemu CSARs |
| 178 | Create Allotted Resource Data File |
bdfreeman1421 | b2a4951 | 2018-11-25 07:32:19 -0500 | [diff] [blame] | 179 | ${vcpe_ar_data_file} Get File /tmp/vcpe_allotted_resource_data.json |
| 180 | ${tunnelxconn_invariant_uuid} Get Json Value ${vcpe_ar_data_file} /tunnelxconn/invariantUUID |
| 181 | ${tunnelxconn_uuid} Get Json Value ${vcpe_ar_data_file} /tunnelxconn/UUID |
| 182 | ${tunnelxconn_node_type} Get Json Value ${vcpe_ar_data_file} /tunnelxconn/node_type |
| 183 | ${brg_invariant_uuid} Get Json Value ${vcpe_ar_data_file} /brg/invariantUUID |
| 184 | ${brg_uuid} Get Json Value ${vcpe_ar_data_file} /brg/UUID |
| 185 | ${brg_node_type} Get Json Value ${vcpe_ar_data_file} /brg/node_type |
| 186 | ${tunnelxconn_dict}= Create Dictionary invariantUUID=${tunnelxconn_invariant_uuid} UUID=${tunnelxconn_uuid} node_type=${tunnelxconn_node_type} |
| 187 | ${brg_dict}= Create Dictionary invariantUUID=${brg_invariant_uuid} UUID=${brg_uuid} node_type=${brg_node_type} |
| 188 | ${xoffset}= Set Variable ${100} |
| 189 | ${allottedresource_uuid}= Get AllottedResource UUID |
| 190 | ${random}= Get Current Date |
| 191 | :FOR ${allottedresource} in @{allottedresource_list} |
| 192 | \ ${loop_catalog_resource_id}= Set Variable ${allottedresource_uuid} |
| 193 | \ Append To List ${catalog_resource_ids} ${loop_catalog_resource_id} |
| 194 | \ ${loop_catalog_resource_id}= Add ASDC Allotted Resource Catalog Resource 00000 ${allottedresource}_${random} ONAP ${loop_catalog_resource_id} ${allottedresource} |
| 195 | \ ${loop_catalog_resource_id2}= Add ASDC Resource Instance To Resource ${loop_catalog_resource_id} ${allottedresource_uuid} ${allottedresource} ${xoffset} ${0} |
| 196 | \ ${loop_catalog_resource_resp}= Get ASDC Catalog Resource ${loop_catalog_resource_id} |
| 197 | # |
| 198 | # Set the properties to relate to the brg and gmux |
| 199 | # |
| 200 | \ Run Keyword If '${allottedresource}'=='TunnelXConn' Setup SDC Catalog Resource AllottedResource Properties ${catalog_service_id} ${allottedresource} ${loop_catalog_resource_id} ${tunnelxconn_dict['invariantUUID']} ${tunnelxconn_dict['UUID']} ${tunnelxconn_dict['node_type']} |
| 201 | \ Run Keyword If '${allottedresource}'=='BRG' Setup SDC Catalog Resource AllottedResource Properties ${catalog_service_id} ${allottedresource} ${loop_catalog_resource_id} ${brg_dict['invariantUUID']} ${brg_dict['UUID']} ${brg_dict['node_type']} |
| 202 | # |
| 203 | # Set the nf_role nf_type |
| 204 | # |
| 205 | \ Run Keyword If '${allottedresource}'=='TunnelXConn' Setup SDC Catalog Resource AllottedResource Inputs ${catalog_service_id} ${allottedresource} ${loop_catalog_resource_id} |
| 206 | \ Run Keyword If '${allottedresource}'=='BRG' Setup SDC Catalog Resource AllottedResource Inputs ${catalog_service_id} ${allottedresource} ${loop_catalog_resource_id} |
bdfreeman1421 | b2a4951 | 2018-11-25 07:32:19 -0500 | [diff] [blame] | 207 | \ ${loop_catalog_resource_id}= Certify ASDC Catalog Resource ${loop_catalog_resource_id} ${ASDC_DESIGNER_USER_ID} |
| 208 | \ Add ASDC Resource Instance ${catalog_service_id} ${loop_catalog_resource_id} ${loop_catalog_resource_resp['name']} |
bdfreeman1421 | b2a4951 | 2018-11-25 07:32:19 -0500 | [diff] [blame] | 209 | \ Set To Dictionary ${catalog_resources} ${loop_catalog_resource_id}=${loop_catalog_resource_resp} |
| 210 | ${catalog_service_resp}= Get ASDC Catalog Service ${catalog_service_id} |
| 211 | Checkin ASDC Catalog Service ${catalog_service_id} |
| 212 | Request Certify ASDC Catalog Service ${catalog_service_id} |
| 213 | Start Certify ASDC Catalog Service ${catalog_service_id} |
| 214 | # on certify it gets a new id |
| 215 | ${catalog_service_id}= Certify ASDC Catalog Service ${catalog_service_id} |
| 216 | Approve ASDC Catalog Service ${catalog_service_id} |
| 217 | : FOR ${DIST_INDEX} IN RANGE 1 |
| 218 | \ Log Distribution Attempt ${DIST_INDEX} |
| 219 | \ Distribute ASDC Catalog Service ${catalog_service_id} |
| 220 | \ ${catalog_service_resp}= Get ASDC Catalog Service ${catalog_service_id} |
| 221 | \ ${status} ${_} = Run Keyword And Ignore Error Loop Over Check Catalog Service Distributed ${catalog_service_resp['uuid']} |
Brian Freeman | 2e1d0ff | 2019-01-23 09:38:13 -0500 | [diff] [blame] | 222 | \ Exit For Loop If '${status}'=='PASS' |
bdfreeman1421 | b2a4951 | 2018-11-25 07:32:19 -0500 | [diff] [blame] | 223 | Should Be Equal As Strings ${status} PASS |
| 224 | [Return] ${catalog_service_resp['name']} ${loop_catalog_resource_resp['name']} ${vf_module} ${catalog_resource_ids} ${catalog_service_id} ${catalog_resources} |
| 225 | |
| 226 | |
Yang Xu | 7037e54 | 2018-12-28 01:19:26 -0500 | [diff] [blame] | 227 | Create Allotted Resource Data File |
| 228 | [Documentation] Create alloted resource json data file |
| 229 | [Arguments] |
| 230 | ${allotted_resource}= Create Dictionary |
| 231 | ${allotted_csar_map}= Create Dictionary |
| 232 | Set To Dictionary ${allotted_csar_map} tunnelxconn=service-Demovcpevgmux-csar.csar |
| 233 | Set To Dictionary ${allotted_csar_map} brg=service-Demovcpevbrgemu-csar.csar |
| 234 | ${keys}= Get Dictionary Keys ${allotted_csar_map} |
| 235 | :for ${key} in @{keys} |
| 236 | \ ${csar}= Get From Dictionary ${allotted_csar_map} ${key} |
| 237 | \ ${dir} ${ext}= Split String From Right ${csar} - 1 |
| 238 | \ Extract Zip File /tmp/csar/${csar} /tmp/csar/${dir} |
| 239 | \ ${template}= Catenate /tmp/csar/${dir}/Definitions/${dir}-template.yml |
| 240 | \ ${json_str}= Template Yaml To Json ${template} |
| 241 | \ ${json_obj}= To Json ${json_str} |
| 242 | \ ${attrs}= Create Dictionary |
| 243 | \ Set To Dictionary ${attrs} invariantUUID=${json_obj['metadata']['invariantUUID']} |
| 244 | \ Set To Dictionary ${attrs} UUID=${json_obj['metadata']['UUID']} |
| 245 | \ Set To Dictionary ${attrs} node_type=${json_obj['topology_template']['substitution_mappings']['node_type']} |
| 246 | \ Set To Dictionary ${allotted_resource} ${key}=${attrs} |
| 247 | ${result_str}= Evaluate json.dumps(${allotted_resource}, indent=2) json |
| 248 | Log To Console ${result_str} |
| 249 | Create File /tmp/vcpe_allotted_resource_data.json ${result_str} |
Yang Xu | 7037e54 | 2018-12-28 01:19:26 -0500 | [diff] [blame] | 250 | |
bdfreeman1421 | 1ad11d9 | 2018-11-17 18:47:37 +0000 | [diff] [blame] | 251 | Download CSAR |
Brian Freeman | 2e1d0ff | 2019-01-23 09:38:13 -0500 | [diff] [blame] | 252 | [Documentation] Download CSAR |
bdfreeman1421 | 1ad11d9 | 2018-11-17 18:47:37 +0000 | [diff] [blame] | 253 | [Arguments] ${catalog_service_id} ${save_directory}=/tmp/csar |
| 254 | # get meta data |
| 255 | ${resp}= Run ASDC Get Request ${ASDC_CATALOG_SERVICES_PATH}/${catalog_service_id}/filteredDataByParams?include=toscaArtifacts ${ASDC_DESIGNER_USER_ID} ${ASDC_BE_ENDPOINT} |
| 256 | ${csar_resource_id}= Set Variable ${resp.json()['toscaArtifacts']['assettoscacsar']['uniqueId']} |
| 257 | ${resp}= Run ASDC Get Request ${ASDC_CATALOG_SERVICES_PATH}/${catalog_service_id}/artifacts/${csar_resource_id} |
| 258 | ${csar_file_name}= Set Variable ${resp.json()['artifactName']} |
| 259 | ${base64Obj}= Set Variable ${resp.json()['base64Contents']} |
| 260 | ${binObj}= Evaluate base64.b64decode("${base64Obj}") modules=base64 |
| 261 | Create Binary File ${save_directory}/${csar_file_name} ${binObj} |
Brian Freeman | 2e1d0ff | 2019-01-23 09:38:13 -0500 | [diff] [blame] | 262 | Log To Console Downloaded:${csar_file_name} |
bdfreeman1421 | 1ad11d9 | 2018-11-17 18:47:37 +0000 | [diff] [blame] | 263 | [Return] |
| 264 | |
Brian Freeman | eef7c6f | 2018-11-16 18:42:21 -0500 | [diff] [blame] | 265 | |
| 266 | Get Generic NeutronNet UUID |
| 267 | [Documentation] Lookoup the UUID of the Generic NeutronNetwork Resource |
Brian Freeman | eef7c6f | 2018-11-16 18:42:21 -0500 | [diff] [blame] | 268 | ${resp}= Run ASDC Get Request ${ASDC_CATALOG_RESOURCES_QUERY_PATH}/Generic%20NeutronNet/resourceVersion/1.0 ${ASDC_DESIGNER_USER_ID} ${ASDC_BE_ENDPOINT} |
| 269 | [Return] ${resp.json()['allVersions']['1.0']} |
| 270 | |
bdfreeman1421 | b2a4951 | 2018-11-25 07:32:19 -0500 | [diff] [blame] | 271 | Get AllottedResource UUID |
| 272 | [Documentation] Lookoup the UUID of the Allotted Resource |
| 273 | # if this fails then the AllottedResource template got deleted from SDC by mistake |
| 274 | ${resp}= Run ASDC Get Request ${ASDC_CATALOG_RESOURCES_QUERY_PATH}/AllottedResource/resourceVersion/1.0 ${ASDC_DESIGNER_USER_ID} ${ASDC_BE_ENDPOINT} |
| 275 | [Return] ${resp.json()['allVersions']['1.0']} |
| 276 | |
Brian Freeman | 18df891 | 2018-05-25 13:27:29 -0500 | [diff] [blame] | 277 | Loop Over Check Catalog Service Distributed |
Gary Wu | 58d5853 | 2018-07-27 16:02:51 -0700 | [diff] [blame] | 278 | [Arguments] ${catalog_service_id} |
Brian Freeman | adaa237 | 2018-10-24 12:25:22 -0500 | [diff] [blame] | 279 | # SO watchdog timeout is 300 seconds need buffer |
bdfreeman1421 | b2a4951 | 2018-11-25 07:32:19 -0500 | [diff] [blame] | 280 | ${dist_status}= Set Variable CONTINUE |
| 281 | : FOR ${CHECK_INDEX} IN RANGE 20 |
Brian Freeman | adaa237 | 2018-10-24 12:25:22 -0500 | [diff] [blame] | 282 | \ ${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] | 283 | \ Sleep 20s |
Brian Freeman | f940ee9 | 2018-05-25 21:09:05 -0500 | [diff] [blame] | 284 | \ Return From Keyword If '${status}'=='PASS' |
bdfreeman1421 | b2a4951 | 2018-11-25 07:32:19 -0500 | [diff] [blame] | 285 | # need a way to exit the loop early on DISTRIBUTION_COMPLETE_ERROR ${dist_status} doesnt work |
| 286 | #\ Exit For Loop If '${dist_status}'=='EXIT' |
| 287 | Should Be Equal As Strings ${status} PASS |
| 288 | [Return] |
Brian Freeman | 18df891 | 2018-05-25 13:27:29 -0500 | [diff] [blame] | 289 | |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 290 | Setup ASDC Catalog Resource |
| 291 | [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] | 292 | [Arguments] ${model_zip_path} ${cds}= |
Brian Freeman | b568e5e | 2018-04-05 21:03:38 -0500 | [diff] [blame] | 293 | ${license_model_id} ${license_model_version_id}= Add ASDC License Model |
| 294 | ${key_group_id}= Add ASDC License Group ${license_model_id} ${license_model_version_id} |
| 295 | ${pool_id}= Add ASDC Entitlement Pool ${license_model_id} ${license_model_version_id} |
| 296 | ${feature_group_id}= Add ASDC Feature Group ${license_model_id} ${key_group_id} ${pool_id} ${license_model_version_id} |
| 297 | ${license_agreement_id}= Add ASDC License Agreement ${license_model_id} ${feature_group_id} ${license_model_version_id} |
| 298 | Submit ASDC License Model ${license_model_id} ${license_model_version_id} |
| 299 | ${license_model_resp}= Get ASDC License Model ${license_model_id} ${license_model_version_id} |
Brian Freeman | 9c42ae1 | 2018-11-27 14:33:27 -0500 | [diff] [blame] | 300 | # /var/opt/OpenECOMP_ETE/demo/heat/temp/vCPE_infra.zip |
| 301 | ${matches}= Get Regexp Matches ${model_zip_path} temp/(.*)\.zip 1 |
| 302 | ${software_product_name_prefix}= Set Variable ${matches[0]} |
| 303 | ${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} ${software_product_name_prefix} |
Brian Freeman | b568e5e | 2018-04-05 21:03:38 -0500 | [diff] [blame] | 304 | Upload ASDC Heat Package ${software_product_id} ${model_zip_path} ${software_product_version_id} |
| 305 | Validate ASDC Software Product ${software_product_id} ${software_product_version_id} |
| 306 | Submit ASDC Software Product ${software_product_id} ${software_product_version_id} |
| 307 | Package ASDC Software Product ${software_product_id} ${software_product_version_id} |
| 308 | ${software_product_resp}= Get ASDC Software Product ${software_product_id} ${software_product_version_id} |
Brian Freeman | 2e1d0ff | 2019-01-23 09:38:13 -0500 | [diff] [blame] | 309 | ${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] | 310 | # Check if need to set up CDS properties |
| 311 | Run Keyword If '${cds}' == 'vfwng' Setup ASDC Catalog Resource CDS Properties ${catalog_resource_id} |
Brian Freeman | 2e1d0ff | 2019-01-23 09:38:13 -0500 | [diff] [blame] | 312 | |
Brian Freeman | 391680a | 2018-08-11 15:20:58 -0500 | [diff] [blame] | 313 | ${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] | 314 | [Return] ${catalog_resource_id} |
Brian Freeman | eef7c6f | 2018-11-16 18:42:21 -0500 | [diff] [blame] | 315 | |
Brian Freeman | 2e1d0ff | 2019-01-23 09:38:13 -0500 | [diff] [blame] | 316 | |
| 317 | Setup SDC Catalog Resource Deployment Artifact Properties |
| 318 | [Documentation] Set up Deployment Artiface properties |
| 319 | [Arguments] ${catalog_service_id} ${catalog_parent_service_id} ${catalog_resource_unique_id} ${blueprint_file} |
| 320 | ${resp}= Get ASDC Catalog Resource Component Instances Properties ${catalog_service_id} |
| 321 | #${resp}= Get ASDC Catalog Resource Deployment Artifact Properties ${catalog_service_id} |
| 322 | ${blueprint_data} Get File ${SDC_CATALOG_DEPLOYMENT_ARTIFACT_PATH}${blueprint_file} |
| 323 | ${payloadData}= Evaluate base64.b64encode('''${blueprint_data}'''.encode('utf-8')) modules=base64 |
| 324 | ${dict}= Create Dictionary artifactLabel=blueprint artifactName=${blueprint_file} artifactType=DCAE_INVENTORY_BLUEPRINT artifactGroupType=DEPLOYMENT description=${blueprint_file} payloadData=${payloadData} |
| 325 | ${data}= Fill JSON Template File ${ASDC_ARTIFACT_UPLOAD_TEMPLATE} ${dict} |
| 326 | # POST artifactUpload to resource |
| 327 | ${artifact_upload_path}= Catenate ${ASDC_CATALOG_SERVICES_PATH}/${catalog_service_id}/resourceInstance/${catalog_resource_unique_id}${ASDC_CATALOG_SERVICE_RESOURCE_ARTIFACT_PATH} |
| 328 | ${resp}= Run ASDC MD5 Post Request ${artifact_upload_path} ${data} ${ASDC_DESIGNER_USER_ID} |
| 329 | Should Be Equal As Strings ${resp.status_code} 200 |
| 330 | [Return] ${resp} |
| 331 | |
| 332 | |
Brian Freeman | eef7c6f | 2018-11-16 18:42:21 -0500 | [diff] [blame] | 333 | Setup SDC Catalog Resource GenericNeutronNet Properties |
bdfreeman1421 | b2a4951 | 2018-11-25 07:32:19 -0500 | [diff] [blame] | 334 | [Documentation] Set up GenericNeutronNet properties and inputs |
Brian Freeman | eef7c6f | 2018-11-16 18:42:21 -0500 | [diff] [blame] | 335 | [Arguments] ${catalog_service_id} ${nf_role} ${catalog_parent_service_id} |
Brian Freeman | eef7c6f | 2018-11-16 18:42:21 -0500 | [diff] [blame] | 336 | ${resp}= Get ASDC Catalog Resource Component Instances Properties ${catalog_service_id} |
Brian Freeman | eef7c6f | 2018-11-16 18:42:21 -0500 | [diff] [blame] | 337 | ${componentInstances} Set Variable @{resp['componentInstancesProperties']} |
| 338 | # componentInstances can have 1 or more than 1 entry |
| 339 | ${passed}= Run Keyword And Return Status Evaluate type(${componentInstances}) |
| 340 | ${type}= Run Keyword If ${passed} Evaluate type(${componentInstances}) |
| 341 | ${componentInstancesList}= Run Keyword If "${type}"!="<type 'list'>" Create List ${componentInstances} |
| 342 | ... ELSE Set Variable ${componentInstances} |
| 343 | :FOR ${item} IN @{componentInstancesList} |
| 344 | \ ${test} ${v}= Run Keyword and Ignore Error Should Contain ${item} ${nf_role} |
| 345 | \ Run Keyword If '${test}' == 'FAIL' Continue For Loop |
| 346 | \ ${componentInstance1}= Set Variable ${item} |
| 347 | :FOR ${comp} IN @{resp['componentInstancesProperties']["${componentInstance1}"]} |
| 348 | \ ${name} Set Variable ${comp['name']} |
| 349 | \ ${test} ${v}= Run Keyword and Ignore Error Should Contain ${name} network_role |
| 350 | \ Run Keyword If '${test}' == 'FAIL' Continue For Loop |
| 351 | \ ${description} Set Variable ${comp['description']} |
| 352 | \ ${description}= Replace String ${description} ${\n} \ |
| 353 | \ ${uniqueId} Set Variable ${comp['uniqueId']} |
| 354 | \ ${parentUniqueId} Set Variable ${comp['parentUniqueId']} |
| 355 | \ ${ownerId} Set Variable ${comp['ownerId']} |
| 356 | \ ${dict}= Create Dictionary parentUniqueId=${parentUniqueId} ownerId=${ownerId} uniqueId=${uniqueId} description=${description} |
| 357 | \ Run Keyword If '${name}'=='network_role' Set To Dictionary ${dict} name=${name} value=${nf_role} |
bdfreeman1421 | b2a4951 | 2018-11-25 07:32:19 -0500 | [diff] [blame] | 358 | \ ${data}= Fill JSON Template File ${SDC_CATALOG_NET_RESOURCE_INPUT_TEMPLATE} ${dict} |
Brian Freeman | eef7c6f | 2018-11-16 18:42:21 -0500 | [diff] [blame] | 359 | \ ${response}= Set ASDC Catalog Resource Component Instance Properties ${catalog_parent_service_id} ${catalog_service_id} ${data} |
| 360 | #\ Log To Console resp=${response} |
| 361 | [Return] |
| 362 | |
bdfreeman1421 | b2a4951 | 2018-11-25 07:32:19 -0500 | [diff] [blame] | 363 | |
| 364 | Setup SDC Catalog Resource AllottedResource Properties |
| 365 | [Documentation] Set up Allotted Resource properties and inputs |
| 366 | [Arguments] ${catalog_service_id} ${nf_role} ${catalog_resource_id} ${invariantUUID} ${UUID} ${node_type} |
| 367 | # Set component instances properties |
| 368 | ${nf_role_lc}= Convert To Lowercase ${nf_role} |
| 369 | ${resp}= Get ASDC Catalog Resource Component Instances Properties For Resource ${catalog_resource_id} |
| 370 | ${componentInstances} Set Variable @{resp['componentInstancesProperties']} |
| 371 | # componentInstances can have 1 or more than 1 entry |
| 372 | ${passed}= Run Keyword And Return Status Evaluate type(${componentInstances}) |
| 373 | ${type}= Run Keyword If ${passed} Evaluate type(${componentInstances}) |
| 374 | ${componentInstancesList}= Run Keyword If "${type}"!="<type 'list'>" Create List ${componentInstances} |
| 375 | ... ELSE Set Variable ${componentInstances} |
| 376 | :FOR ${item} IN @{componentInstancesList} |
| 377 | \ ${test} ${v}= Run Keyword and Ignore Error Should Contain ${item} ${nf_role_lc} |
| 378 | \ Run Keyword If '${test}' == 'FAIL' Continue For Loop |
| 379 | \ ${componentInstance1}= Set Variable ${item} |
| 380 | ${dict}= Create Dictionary |
| 381 | :FOR ${comp} IN @{resp['componentInstancesProperties']["${componentInstance1}"]} |
| 382 | \ ${name} Set Variable ${comp['name']} |
| 383 | \ ${test} ${v}= Run Keyword and Ignore Error Should Contain Any ${name} network_role providing_service_invariant_uuid providing_service_uuid providing_service_name uniqueId |
| 384 | \ Run Keyword If '${test}' == 'FAIL' Continue For Loop |
| 385 | \ ${parentUniqueId} Set Variable ${comp['parentUniqueId']} |
| 386 | \ ${ownerId} Set Variable ${comp['ownerId']} |
| 387 | \ Set To Dictionary ${dict} parentUniqueId=${parentUniqueId} ownerId=${ownerId} |
| 388 | \ Run Keyword If '${name}'=='providing_service_invariant_uuid' Set To Dictionary ${dict} providing_service_invariant_uuid=${invariantUUID} |
| 389 | \ Run Keyword If '${name}'=='providing_service_uuid' Set To Dictionary ${dict} providing_service_uuid=${UUID} |
| 390 | \ Run Keyword If '${name}'=='providing_service_name' Set To Dictionary ${dict} providing_service_name=${node_type} |
| 391 | # Sets it for each loop but should be one |
| 392 | \ ${uniqueId} Set Variable ${comp['uniqueId']} |
| 393 | \ ${uniqueId} Fetch From Left ${uniqueId} . |
| 394 | \ Set To Dictionary ${dict} uniqueId=${uniqueId} |
| 395 | ${data}= Fill JSON Template File ${SDC_CATALOG_ALLOTTED_RESOURCE_PROPERTIES_TEMPLATE} ${dict} |
| 396 | ${response}= Set ASDC Catalog Resource Component Instance Properties For Resource ${catalog_resource_id} ${componentInstance1} ${data} |
| 397 | Log To Console resp=${response} |
| 398 | |
| 399 | |
| 400 | Setup SDC Catalog Resource AllottedResource Inputs |
| 401 | [Documentation] Set up Allotted Resource inputs |
| 402 | [Arguments] ${catalog_service_id} ${nf_role} ${catalog_resource_id} |
| 403 | # Set vnf inputs |
| 404 | ${resp}= Get ASDC Catalog Resource Inputs ${catalog_resource_id} |
| 405 | ${dict}= Create Dictionary |
| 406 | :FOR ${comp} in @{resp['inputs']} |
| 407 | \ ${name} Set Variable ${comp['name']} |
| 408 | \ ${uid} Set Variable ${comp['uniqueId']} |
| 409 | \ Run Keyword If '${name}'=='nf_type' Set To Dictionary ${dict} nf_type=${nf_role} nf_type_uid=${uid} |
| 410 | \ Run Keyword If '${name}'=='nf_role' Set To Dictionary ${dict} nf_role=${nf_role} nf_role_uid=${uid} |
| 411 | ${data}= Fill JSON Template File ${SDC_CATALOG_ALLOTTED_RESOURCE_INPUTS_TEMPLATE} ${dict} |
| 412 | ${response}= Set ASDC Catalog Resource VNF Inputs ${catalog_resource_id} ${data} |
| 413 | [Return] ${response} |
| 414 | |
Yang Xu | 2ec8038 | 2018-11-01 12:30:37 -0400 | [diff] [blame] | 415 | Setup ASDC Catalog Resource CDS Properties |
| 416 | [Documentation] Set up vfwng VNF properties and inputs for CDS |
Brian Freeman | 2e1d0ff | 2019-01-23 09:38:13 -0500 | [diff] [blame] | 417 | [Arguments] ${catalog_resource_id} |
Yang Xu | 2ec8038 | 2018-11-01 12:30:37 -0400 | [diff] [blame] | 418 | # Set vnf module properties |
| 419 | ${resp}= Get ASDC Catalog Resource Component Instances ${catalog_resource_id} |
| 420 | :FOR ${comp} in @{resp['componentInstances']} |
| 421 | \ ${name} Set Variable ${comp['name']} |
| 422 | \ ${uniqueId} Set Variable ${comp['uniqueId']} |
| 423 | \ ${actualComponentUid} Set Variable ${comp['actualComponentUid']} |
| 424 | \ ${test} ${v}= Run Keyword and Ignore Error Should Contain ${name} abstract_ |
| 425 | \ Run Keyword If '${test}' == 'FAIL' Continue For Loop |
| 426 | \ ${response}= Get ASDC Catalog Resource Component Instance Properties ${catalog_resource_id} ${uniqueId} ${actualComponentUid} |
| 427 | \ ${dict}= Create Dictionary parent_id=${response[6]['parentUniqueId']} |
| 428 | \ Run Keyword If '${name}'=='abstract_vfw' Set To Dictionary ${dict} nfc_function=vfw nfc_naming_policy=SDNC_Policy.ONAP_VFW_NAMING_TIMESTAMP |
| 429 | \ Run Keyword If '${name}'=='abstract_vpg' Set To Dictionary ${dict} nfc_function=vpg nfc_naming_policy=SDNC_Policy.ONAP_VPG_NAMING_TIMESTAMP |
| 430 | \ Run Keyword If '${name}'=='abstract_vsn' Set To Dictionary ${dict} nfc_function=vsn nfc_naming_policy=SDNC_Policy.ONAP_VSN_NAMING_TIMESTAMP |
Brian Freeman | 2e1d0ff | 2019-01-23 09:38:13 -0500 | [diff] [blame] | 431 | \ ${data}= Fill JSON Template File ${ASDC_RESOURCE_INSTANCE_VNF_PROPERTIES_TEMPLATE} ${dict} |
| 432 | \ ${response}= Set ASDC Catalog Resource Component Instance Properties ${catalog_resource_id} ${uniqueId} ${data} |
Yang Xu | 2ec8038 | 2018-11-01 12:30:37 -0400 | [diff] [blame] | 433 | \ Log To Console resp=${response} |
| 434 | |
| 435 | # Set vnf inputs |
| 436 | ${resp}= Get ASDC Catalog Resource Inputs ${catalog_resource_id} |
| 437 | ${dict}= Create Dictionary |
Brian Freeman | 2e1d0ff | 2019-01-23 09:38:13 -0500 | [diff] [blame] | 438 | :FOR ${comp} in @{resp['inputs']} |
Yang Xu | 2ec8038 | 2018-11-01 12:30:37 -0400 | [diff] [blame] | 439 | \ ${name} Set Variable ${comp['name']} |
| 440 | \ ${uid} Set Variable ${comp['uniqueId']} |
| 441 | \ Run Keyword If '${name}'=='nf_function' Set To Dictionary ${dict} nf_function=ONAP-FIREWALL nf_function_uid=${uid} |
| 442 | \ Run Keyword If '${name}'=='nf_type' Set To Dictionary ${dict} nf_type=FIREWALL nf_type_uid=${uid} |
| 443 | \ Run Keyword If '${name}'=='nf_naming_code' Set To Dictionary ${dict} nf_naming_code=vfw nf_naming_code_uid=${uid} |
| 444 | \ Run Keyword If '${name}'=='nf_role' Set To Dictionary ${dict} nf_role=vFW nf_role_uid=${uid} |
| 445 | \ Run Keyword If '${name}'=='cloud_env' Set To Dictionary ${dict} cloud_env=openstack cloud_env_uid=${uid} |
Brian Freeman | 2e1d0ff | 2019-01-23 09:38:13 -0500 | [diff] [blame] | 446 | ${data}= Fill JSON Template File ${ASDC_RESOURCE_INSTANCE_VNF_INPUTS_TEMPLATE} ${dict} |
Yang Xu | 2ec8038 | 2018-11-01 12:30:37 -0400 | [diff] [blame] | 447 | ${response}= Set ASDC Catalog Resource VNF Inputs ${catalog_resource_id} ${data} |
| 448 | |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 449 | Add ASDC License Model |
| 450 | [Documentation] Creates an asdc license model and returns its id |
Jerry Flood | e2a48d7 | 2017-06-21 15:06:29 -0400 | [diff] [blame] | 451 | ${uuid}= Generate UUID |
| 452 | ${shortened_uuid}= Evaluate str("${uuid}")[:23] |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 453 | ${map}= Create Dictionary vendor_name=${shortened_uuid} |
| 454 | ${data}= Fill JSON Template File ${ASDC_LICENSE_MODEL_TEMPLATE} ${map} |
Brian Freeman | 44b8bb3 | 2018-05-03 21:08:42 -0500 | [diff] [blame] | 455 | ${resp}= Run ASDC Post Request ${ASDC_VENDOR_LICENSE_MODEL_PATH} ${data} ${ASDC_DESIGNER_USER_ID} ${ASDC_BE_ONBOARD_ENDPOINT} |
Brian Freeman | 2e1d0ff | 2019-01-23 09:38:13 -0500 | [diff] [blame] | 456 | Should Be Equal As Strings ${resp.status_code} 200 |
Brian Freeman | b568e5e | 2018-04-05 21:03:38 -0500 | [diff] [blame] | 457 | [Return] ${resp.json()['itemId']} ${resp.json()['version']['id']} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 458 | Get ASDC License Model |
| 459 | [Documentation] gets an asdc license model by its id |
Jerry Flood | e2a48d7 | 2017-06-21 15:06:29 -0400 | [diff] [blame] | 460 | [Arguments] ${id} ${version_id}=0.1 |
Brian Freeman | 44b8bb3 | 2018-05-03 21:08:42 -0500 | [diff] [blame] | 461 | ${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] | 462 | [Return] ${resp.json()} |
| 463 | Get ASDC License Models |
| 464 | [Documentation] gets an asdc license model by its id |
Brian Freeman | 44b8bb3 | 2018-05-03 21:08:42 -0500 | [diff] [blame] | 465 | ${resp}= Run ASDC Get Request ${ASDC_VENDOR_LICENSE_MODEL_PATH} ${ASDC_DESIGNER_USER_ID} ${ASDC_BE_ONBOARD_ENDPOINT} |
| 466 | |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 467 | [Return] ${resp.json()} |
| 468 | Checkin ASDC License Model |
| 469 | [Documentation] checksin an asdc license model by its id |
Jerry Flood | e2a48d7 | 2017-06-21 15:06:29 -0400 | [diff] [blame] | 470 | [Arguments] ${id} ${version_id}=0.1 |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 471 | ${map}= Create Dictionary action=Checkin |
| 472 | ${data}= Fill JSON Template File ${ASDC_ACTION_TEMPLATE} ${map} |
Brian Freeman | 2e1d0ff | 2019-01-23 09:38:13 -0500 | [diff] [blame] | 473 | ${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} |
| 474 | Should Be Equal As Strings ${resp.status_code} 200 |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 475 | [Return] ${resp.json()} |
| 476 | Submit ASDC License Model |
| 477 | [Documentation] submits an asdc license model by its id |
Jerry Flood | e2a48d7 | 2017-06-21 15:06:29 -0400 | [diff] [blame] | 478 | [Arguments] ${id} ${version_id}=0.1 |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 479 | ${map}= Create Dictionary action=Submit |
| 480 | ${data}= Fill JSON Template File ${ASDC_ACTION_TEMPLATE} ${map} |
Brian Freeman | 44b8bb3 | 2018-05-03 21:08:42 -0500 | [diff] [blame] | 481 | ${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} |
Brian Freeman | 2e1d0ff | 2019-01-23 09:38:13 -0500 | [diff] [blame] | 482 | Should Be Equal As Strings ${resp.status_code} 200 |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 483 | [Return] ${resp.json()} |
| 484 | Checkin ASDC Software Product |
| 485 | [Documentation] checksin an asdc Software Product by its id |
Jerry Flood | e2a48d7 | 2017-06-21 15:06:29 -0400 | [diff] [blame] | 486 | [Arguments] ${id} ${version_id}=0.1 |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 487 | ${map}= Create Dictionary action=Checkin |
Jerry Flood | e2a48d7 | 2017-06-21 15:06:29 -0400 | [diff] [blame] | 488 | ${data}= Fill JSON Template File ${ASDC_ACTION_TEMPLATE} ${map} |
Brian Freeman | 44b8bb3 | 2018-05-03 21:08:42 -0500 | [diff] [blame] | 489 | ${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} |
Brian Freeman | 2e1d0ff | 2019-01-23 09:38:13 -0500 | [diff] [blame] | 490 | Should Be Equal As Strings ${resp.status_code} 200 |
Jerry Flood | e2a48d7 | 2017-06-21 15:06:29 -0400 | [diff] [blame] | 491 | [Return] ${resp.json()} |
| 492 | Validate ASDC Software Product |
| 493 | [Documentation] checksin an asdc Software Product by its id |
| 494 | [Arguments] ${id} ${version_id}=0.1 |
| 495 | ${data}= Catenate |
Brian Freeman | 2e1d0ff | 2019-01-23 09:38:13 -0500 | [diff] [blame] | 496 | ${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} |
| 497 | Should Be Equal As Strings ${resp.status_code} 200 |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 498 | [Return] ${resp.json()} |
| 499 | Submit ASDC Software Product |
| 500 | [Documentation] submits an asdc Software Product by its id |
Jerry Flood | e2a48d7 | 2017-06-21 15:06:29 -0400 | [diff] [blame] | 501 | [Arguments] ${id} ${version_id}=0.1 |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 502 | ${map}= Create Dictionary action=Submit |
Jerry Flood | e2a48d7 | 2017-06-21 15:06:29 -0400 | [diff] [blame] | 503 | ${data}= Fill JSON Template File ${ASDC_ACTION_TEMPLATE} ${map} |
Brian Freeman | 2e1d0ff | 2019-01-23 09:38:13 -0500 | [diff] [blame] | 504 | ${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} |
| 505 | Should Be Equal As Strings ${resp.status_code} 200 |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 506 | [Return] ${resp.json()} |
| 507 | Package ASDC Software Product |
| 508 | [Documentation] creates_package on an asdc Software Product by its id |
Jerry Flood | e2a48d7 | 2017-06-21 15:06:29 -0400 | [diff] [blame] | 509 | [Arguments] ${id} ${version_id}=0.1 |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 510 | ${map}= Create Dictionary action=Create_Package |
Jerry Flood | e2a48d7 | 2017-06-21 15:06:29 -0400 | [diff] [blame] | 511 | ${data}= Fill JSON Template File ${ASDC_ACTION_TEMPLATE} ${map} |
Brian Freeman | 2e1d0ff | 2019-01-23 09:38:13 -0500 | [diff] [blame] | 512 | ${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} |
| 513 | Should Be Equal As Strings ${resp.status_code} 200 |
Jerry Flood | e2a48d7 | 2017-06-21 15:06:29 -0400 | [diff] [blame] | 514 | [Return] ${resp.json()} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 515 | Add ASDC Entitlement Pool |
| 516 | [Documentation] Creates an asdc Entitlement Pool and returns its id |
Jerry Flood | e2a48d7 | 2017-06-21 15:06:29 -0400 | [diff] [blame] | 517 | [Arguments] ${license_model_id} ${version_id}=0.1 |
| 518 | ${uuid}= Generate UUID |
| 519 | ${shortened_uuid}= Evaluate str("${uuid}")[:23] |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 520 | ${map}= Create Dictionary entitlement_pool_name=${shortened_uuid} |
Jerry Flood | e2a48d7 | 2017-06-21 15:06:29 -0400 | [diff] [blame] | 521 | ${data}= Fill JSON Template File ${ASDC_ENTITLEMENT_POOL_TEMPLATE} ${map} |
Brian Freeman | 2e1d0ff | 2019-01-23 09:38:13 -0500 | [diff] [blame] | 522 | ${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} |
| 523 | Should Be Equal As Strings ${resp.status_code} 200 |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 524 | [Return] ${resp.json()['value']} |
| 525 | Get ASDC Entitlement Pool |
| 526 | [Documentation] gets an asdc Entitlement Pool by its id |
| 527 | [Arguments] ${license_model_id} ${pool_id} |
Brian Freeman | 2e1d0ff | 2019-01-23 09:38:13 -0500 | [diff] [blame] | 528 | ${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] | 529 | [Return] ${resp.json()} |
| 530 | Add ASDC License Group |
| 531 | [Documentation] Creates an asdc license group and returns its id |
Brian Freeman | b568e5e | 2018-04-05 21:03:38 -0500 | [diff] [blame] | 532 | [Arguments] ${license_model_id} ${version_id}=1.0 |
Jerry Flood | e2a48d7 | 2017-06-21 15:06:29 -0400 | [diff] [blame] | 533 | ${uuid}= Generate UUID |
| 534 | ${shortened_uuid}= Evaluate str("${uuid}")[:23] |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 535 | ${map}= Create Dictionary key_group_name=${shortened_uuid} |
Jerry Flood | e2a48d7 | 2017-06-21 15:06:29 -0400 | [diff] [blame] | 536 | ${data}= Fill JSON Template File ${ASDC_KEY_GROUP_TEMPLATE} ${map} |
Brian Freeman | 2e1d0ff | 2019-01-23 09:38:13 -0500 | [diff] [blame] | 537 | ${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} |
| 538 | Should Be Equal As Strings ${resp.status_code} 200 |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 539 | [Return] ${resp.json()['value']} |
| 540 | Get ASDC License Group |
| 541 | [Documentation] gets an asdc license group by its id |
Jerry Flood | e2a48d7 | 2017-06-21 15:06:29 -0400 | [diff] [blame] | 542 | [Arguments] ${license_model_id} ${group_id} ${version_id} |
Brian Freeman | 2e1d0ff | 2019-01-23 09:38:13 -0500 | [diff] [blame] | 543 | ${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] | 544 | [Return] ${resp.json()} |
| 545 | Add ASDC Feature Group |
| 546 | [Documentation] Creates an asdc Feature Group and returns its id |
Jerry Flood | e2a48d7 | 2017-06-21 15:06:29 -0400 | [diff] [blame] | 547 | [Arguments] ${license_model_id} ${key_group_id} ${entitlement_pool_id} ${version_id}=0.1 |
| 548 | ${uuid}= Generate UUID |
| 549 | ${shortened_uuid}= Evaluate str("${uuid}")[:23] |
Jerry Flood | 80ff985 | 2017-08-11 06:47:14 -0400 | [diff] [blame] | 550 | ${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] | 551 | ${data}= Fill JSON Template File ${ASDC_FEATURE_GROUP_TEMPLATE} ${map} |
Brian Freeman | 2e1d0ff | 2019-01-23 09:38:13 -0500 | [diff] [blame] | 552 | ${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} |
| 553 | Should Be Equal As Strings ${resp.status_code} 200 |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 554 | [Return] ${resp.json()['value']} |
| 555 | Get ASDC Feature Group |
| 556 | [Documentation] gets an asdc Feature Group by its id |
| 557 | [Arguments] ${license_model_id} ${group_id} |
Brian Freeman | 2e1d0ff | 2019-01-23 09:38:13 -0500 | [diff] [blame] | 558 | ${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] | 559 | [Return] ${resp.json()} |
| 560 | Add ASDC License Agreement |
| 561 | [Documentation] Creates an asdc License Agreement and returns its id |
Jerry Flood | e2a48d7 | 2017-06-21 15:06:29 -0400 | [diff] [blame] | 562 | [Arguments] ${license_model_id} ${feature_group_id} ${version_id}=0.1 |
| 563 | ${uuid}= Generate UUID |
| 564 | ${shortened_uuid}= Evaluate str("${uuid}")[:23] |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 565 | ${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] | 566 | ${data}= Fill JSON Template File ${ASDC_LICENSE_AGREEMENT_TEMPLATE} ${map} |
Brian Freeman | 2e1d0ff | 2019-01-23 09:38:13 -0500 | [diff] [blame] | 567 | ${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} |
| 568 | Should Be Equal As Strings ${resp.status_code} 200 |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 569 | [Return] ${resp.json()['value']} |
| 570 | Get ASDC License Agreement |
| 571 | [Documentation] gets an asdc License Agreement by its id |
| 572 | [Arguments] ${license_model_id} ${agreement_id} |
Brian Freeman | 2e1d0ff | 2019-01-23 09:38:13 -0500 | [diff] [blame] | 573 | ${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] | 574 | [Return] ${resp.json()} |
| 575 | Add ASDC Software Product |
| 576 | [Documentation] Creates an asdc Software Product and returns its id |
Brian Freeman | 9c42ae1 | 2018-11-27 14:33:27 -0500 | [diff] [blame] | 577 | [Arguments] ${license_agreement_id} ${feature_group_id} ${license_model_name} ${license_model_id} ${license_model_version_id} ${name_prefix} |
Jerry Flood | e2a48d7 | 2017-06-21 15:06:29 -0400 | [diff] [blame] | 578 | ${uuid}= Generate UUID |
Brian Freeman | 9c42ae1 | 2018-11-27 14:33:27 -0500 | [diff] [blame] | 579 | ${shortened_uuid}= Evaluate str("${uuid}")[:13] |
| 580 | ${software_product_name}= Catenate ${name_prefix} ${shortened_uuid} |
| 581 | ${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} |
Jerry Flood | e2a48d7 | 2017-06-21 15:06:29 -0400 | [diff] [blame] | 582 | ${data}= Fill JSON Template File ${ASDC_SOFTWARE_PRODUCT_TEMPLATE} ${map} |
Brian Freeman | 2e1d0ff | 2019-01-23 09:38:13 -0500 | [diff] [blame] | 583 | ${resp}= Run ASDC Post Request ${ASDC_VENDOR_SOFTWARE_PRODUCT_PATH} ${data} ${ASDC_DESIGNER_USER_ID} ${ASDC_BE_ONBOARD_ENDPOINT} |
| 584 | Should Be Equal As Strings ${resp.status_code} 200 |
Brian Freeman | b568e5e | 2018-04-05 21:03:38 -0500 | [diff] [blame] | 585 | [Return] ${resp.json()['itemId']} ${resp.json()['version']['id']} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 586 | Get ASDC Software Product |
| 587 | [Documentation] gets an asdc Software Product by its id |
Jerry Flood | e2a48d7 | 2017-06-21 15:06:29 -0400 | [diff] [blame] | 588 | [Arguments] ${software_product_id} ${version_id}=0.1 |
Brian Freeman | 2e1d0ff | 2019-01-23 09:38:13 -0500 | [diff] [blame] | 589 | ${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] | 590 | [Return] ${resp.json()} |
bdfreeman1421 | b2a4951 | 2018-11-25 07:32:19 -0500 | [diff] [blame] | 591 | |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 592 | Add ASDC Catalog Resource |
| 593 | [Documentation] Creates an asdc Catalog Resource and returns its id |
| 594 | [Arguments] ${license_agreement_id} ${software_product_name} ${license_model_name} ${software_product_id} |
| 595 | ${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] | 596 | ${data}= Fill JSON Template File ${ASDC_CATALOG_RESOURCE_TEMPLATE} ${map} |
bdfreeman1421 | b2a4951 | 2018-11-25 07:32:19 -0500 | [diff] [blame] | 597 | ${resp}= Run ASDC Post Request ${ASDC_CATALOG_RESOURCES_PATH} ${data} ${ASDC_DESIGNER_USER_ID} |
Brian Freeman | 2e1d0ff | 2019-01-23 09:38:13 -0500 | [diff] [blame] | 598 | Should Be Equal As Strings ${resp.status_code} 201 |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 599 | [Return] ${resp.json()['uniqueId']} |
bdfreeman1421 | b2a4951 | 2018-11-25 07:32:19 -0500 | [diff] [blame] | 600 | |
| 601 | Add ASDC Allotted Resource Catalog Resource |
| 602 | [Documentation] Creates an asdc Allotted Resource Catalog Resource and returns its id |
| 603 | [Arguments] ${license_agreement_id} ${software_product_name} ${license_model_name} ${software_product_id} ${subcategory} |
| 604 | ${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} |
| 605 | ${data}= Fill JSON Template File ${ASDC_ALLOTTED_RESOURCE_CATALOG_RESOURCE_TEMPLATE} ${map} |
| 606 | ${resp}= Run ASDC Post Request ${ASDC_CATALOG_RESOURCES_PATH} ${data} ${ASDC_DESIGNER_USER_ID} |
Brian Freeman | 2e1d0ff | 2019-01-23 09:38:13 -0500 | [diff] [blame] | 607 | Should Be Equal As Strings ${resp.status_code} 201 |
bdfreeman1421 | b2a4951 | 2018-11-25 07:32:19 -0500 | [diff] [blame] | 608 | [Return] ${resp.json()['uniqueId']} |
| 609 | |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 610 | Mark ASDC Catalog Resource Inactive |
| 611 | [Documentation] deletes an asdc Catalog Resource |
| 612 | [Arguments] ${catalog_resource_id} |
| 613 | ${resp}= Run ASDC Delete Request ${ASDC_CATALOG_RESOURCES_PATH}/${catalog_resource_id} ${ASDC_DESIGNER_USER_ID} |
Brian Freeman | 2e1d0ff | 2019-01-23 09:38:13 -0500 | [diff] [blame] | 614 | Should Be Equal As Strings ${resp.status_code} 204 |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 615 | [Return] ${resp} |
| 616 | Delete Inactive ASDC Catalog Resources |
| 617 | [Documentation] delete all asdc Catalog Resources that are inactive |
| 618 | ${resp}= Run ASDC Delete Request ${ASDC_CATALOG_INACTIVE_RESOURCES_PATH} ${ASDC_DESIGNER_USER_ID} |
Brian Freeman | 2e1d0ff | 2019-01-23 09:38:13 -0500 | [diff] [blame] | 619 | Should Be Equal As Strings ${resp.status_code} 200 |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 620 | [Return] ${resp.json()} |
| 621 | Get ASDC Catalog Resource |
| 622 | [Documentation] gets an asdc Catalog Resource by its id |
| 623 | [Arguments] ${catalog_resource_id} |
Brian Freeman | 2e1d0ff | 2019-01-23 09:38:13 -0500 | [diff] [blame] | 624 | ${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] | 625 | [Return] ${resp.json()} |
Brian Freeman | eef7c6f | 2018-11-16 18:42:21 -0500 | [diff] [blame] | 626 | |
Yang Xu | 2ec8038 | 2018-11-01 12:30:37 -0400 | [diff] [blame] | 627 | Get ASDC Catalog Resource Component Instances |
| 628 | [Documentation] gets asdc Catalog Resource Component Instances by its id |
| 629 | [Arguments] ${catalog_resource_id} |
| 630 | ${resp}= Run ASDC Get Request ${ASDC_FE_CATALOG_RESOURCES_PATH}/${catalog_resource_id}/filteredDataByParams?include=componentInstances ${ASDC_DESIGNER_USER_ID} ${ASDC_FE_ENDPOINT} |
| 631 | [Return] ${resp.json()} |
bdfreeman1421 | b2a4951 | 2018-11-25 07:32:19 -0500 | [diff] [blame] | 632 | |
Brian Freeman | 2e1d0ff | 2019-01-23 09:38:13 -0500 | [diff] [blame] | 633 | Get ASDC Catalog Resource Deployment Artifact Properties |
| 634 | [Documentation] gets asdc Catalog Resource Deployment Artiface Properties by its id |
| 635 | [Arguments] ${catalog_resource_id} |
| 636 | #${resp}= Run ASDC Get Request ${ASDC_CATALOG_SERVICES_PATH}/${catalog_resource_id}/filteredDataByParams?include=componentInstances ${ASDC_DESIGNER_USER_ID} ${ASDC_FE_ENDPOINT} |
| 637 | ${resp}= Run ASDC Get Request ${ASDC_CATALOG_SERVICES_PATH}/${catalog_resource_id}/filteredDataByParams?include=deploymentArtifacts ${ASDC_DESIGNER_USER_ID} ${ASDC_FE_ENDPOINT} |
| 638 | [Return] ${resp.json()} |
| 639 | |
| 640 | |
Brian Freeman | eef7c6f | 2018-11-16 18:42:21 -0500 | [diff] [blame] | 641 | Get ASDC Catalog Resource Component Instances Properties |
| 642 | [Documentation] gets asdc Catalog Resource Component Instances Properties by its id |
| 643 | [Arguments] ${catalog_resource_id} |
| 644 | #${resp}= Run ASDC Get Request ${ASDC_FE_CATALOG_RESOURCES_PATH}/${catalog_resource_id}/filteredDataByParams?include=componentInstancesProperties ${ASDC_DESIGNER_USER_ID} ${ASDC_FE_ENDPOINT} |
| 645 | ${resp}= Run ASDC Get Request ${ASDC_CATALOG_SERVICES_PATH}/${catalog_resource_id}/filteredDataByParams?include=componentInstancesProperties ${ASDC_DESIGNER_USER_ID} ${ASDC_BE_ENDPOINT} |
| 646 | [Return] ${resp.json()} |
| 647 | |
bdfreeman1421 | b2a4951 | 2018-11-25 07:32:19 -0500 | [diff] [blame] | 648 | Get ASDC Catalog Resource Component Instances Properties For Resource |
| 649 | [Documentation] gets asdc Catalog Resource Component Instances Properties for a Resource (VF) by its id |
| 650 | [Arguments] ${catalog_resource_id} |
| 651 | ${resp}= Run ASDC Get Request ${ASDC_FE_CATALOG_RESOURCES_PATH}/${catalog_resource_id}/filteredDataByParams?include=componentInstancesProperties ${ASDC_DESIGNER_USER_ID} ${ASDC_FE_ENDPOINT} |
| 652 | [Return] ${resp.json()} |
Brian Freeman | eef7c6f | 2018-11-16 18:42:21 -0500 | [diff] [blame] | 653 | |
Yang Xu | 2ec8038 | 2018-11-01 12:30:37 -0400 | [diff] [blame] | 654 | Get ASDC Catalog Resource Inputs |
| 655 | [Documentation] gets asdc Catalog Inputs by its id |
| 656 | [Arguments] ${catalog_resource_id} |
| 657 | ${resp}= Run ASDC Get Request ${ASDC_FE_CATALOG_RESOURCES_PATH}/${catalog_resource_id}/filteredDataByParams?include=inputs ${ASDC_DESIGNER_USER_ID} ${ASDC_FE_ENDPOINT} |
| 658 | [Return] ${resp.json()} |
Brian Freeman | eef7c6f | 2018-11-16 18:42:21 -0500 | [diff] [blame] | 659 | |
Yang Xu | 2ec8038 | 2018-11-01 12:30:37 -0400 | [diff] [blame] | 660 | Get ASDC Catalog Resource Component Instance Properties |
| 661 | [Documentation] gets an asdc Catalog Resource properties by its id |
| 662 | [Arguments] ${catalog_resource_id} ${component_instance_id} ${component_id} |
| 663 | ${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} |
| 664 | [Return] ${resp.json()} |
bdfreeman1421 | b2a4951 | 2018-11-25 07:32:19 -0500 | [diff] [blame] | 665 | |
Yang Xu | 2ec8038 | 2018-11-01 12:30:37 -0400 | [diff] [blame] | 666 | Set ASDC Catalog Resource Component Instance Properties |
| 667 | [Documentation] sets an asdc Catalog Resource by its id |
Brian Freeman | eef7c6f | 2018-11-16 18:42:21 -0500 | [diff] [blame] | 668 | [Arguments] ${catalog_resource_id} ${component_parent_service_id} ${data} |
| 669 | #${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} |
| 670 | ${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} |
bdfreeman1421 | b2a4951 | 2018-11-25 07:32:19 -0500 | [diff] [blame] | 671 | [Return] ${resp.json()} |
| 672 | |
| 673 | Set ASDC Catalog Resource Component Instance Properties For Resource |
| 674 | [Documentation] sets an asdc Catalog Resource by its id |
| 675 | [Arguments] ${catalog_parent_resource_id} ${catalog_resource_id} ${data} |
| 676 | #${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} |
| 677 | ${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} |
| 678 | [Return] ${resp.json()} |
Brian Freeman | eef7c6f | 2018-11-16 18:42:21 -0500 | [diff] [blame] | 679 | |
Yang Xu | 74cfb86 | 2018-12-06 21:57:32 -0500 | [diff] [blame] | 680 | Set CDS Catalog Resource Component Instance Properties |
| 681 | [Documentation] sets an asdc Catalog Resource by its id |
| 682 | [Arguments] ${catalog_resource_id} ${component_instance_id} ${data} |
| 683 | ${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} |
| 684 | [Return] ${resp.json()} |
| 685 | |
Yang Xu | 2ec8038 | 2018-11-01 12:30:37 -0400 | [diff] [blame] | 686 | Set ASDC Catalog Resource VNF Inputs |
| 687 | [Documentation] sets an asdc Catalog Resource by its id |
| 688 | [Arguments] ${catalog_resource_id} ${data} |
| 689 | ${resp}= Run ASDC Post Request ${ASDC_FE_CATALOG_RESOURCES_PATH}/${catalog_resource_id}/update/inputs ${data} ${ASDC_DESIGNER_USER_ID} ${ASDC_FE_ENDPOINT} |
| 690 | [Return] ${resp.json()} |
Brian Freeman | 79b00ce | 2018-11-01 14:57:53 -0500 | [diff] [blame] | 691 | Get SDC Demo Vnf Catalog Resource |
| 692 | [Documentation] gets resource id's for demonstration VNFs for instantiate |
| 693 | [Arguments] ${service_name} |
| 694 | ${resp}= Run ASDC Get Request ${ASDC_CATALOG_SERVICES_PATH}/serviceName/${service_name}/serviceVersion/1.0 |
| 695 | @{ITEMS}= Copy List ${resp.json()['componentInstances']} |
| 696 | ${demo_catalog_resource}= Create Dictionary |
| 697 | :FOR ${ELEMENT} IN @{ITEMS} |
| 698 | \ Log ${ELEMENT['name']} |
| 699 | \ Log ${ELEMENT['groupInstances'][0]['groupName']} |
| 700 | \ ${vnf}= Get VNF From Group Name ${ELEMENT['groupInstances'][0]['groupName']} ${service_name} |
| 701 | \ ${vnf_data}= Create Dictionary vnf_type=${ELEMENT['name']} vf_module=${ELEMENT['groupInstances'][0]['groupName']} |
| 702 | \ LOG ${vnf_data} |
| 703 | \ Set To Dictionary ${demo_catalog_resource} ${vnf}=${vnf_data} |
| 704 | \ LOG ${demo_catalog_resource} |
| 705 | [Return] ${demo_catalog_resource} |
| 706 | |
| 707 | Get VNF From Group Name |
| 708 | [Documentation] looks up vnf key from service mapping for a regex on groupName and service_name |
| 709 | [Arguments] ${group_name} ${service_name} |
| 710 | ${vnf}= Set Variable If |
| 711 | ... ('${service_name}'=='demoVFWCL') and ('base_vfw' in '${group_name}') vFWSNK |
| 712 | ... ('${service_name}'=='demoVFWCL') and ('base_vpkg' in '${group_name}') vPKG |
| 713 | ... ('${service_name}'=='demoVLB') and ('base_vlb' in '${group_name}') vLB |
| 714 | [Return] ${vnf} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 715 | Checkin ASDC Catalog Resource |
| 716 | [Documentation] checksin an asdc Catalog Resource by its id |
| 717 | [Arguments] ${catalog_resource_id} |
| 718 | ${map}= Create Dictionary user_remarks=Robot remarks |
Jerry Flood | e2a48d7 | 2017-06-21 15:06:29 -0400 | [diff] [blame] | 719 | ${data}= Fill JSON Template File ${ASDC_USER_REMARKS_TEMPLATE} ${map} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 720 | ${resp}= Run ASDC Post Request ${ASDC_CATALOG_RESOURCES_PATH}/${catalog_resource_id}${ASDC_CATALOG_LIFECYCLE_PATH}/checkin ${data} ${ASDC_DESIGNER_USER_ID} |
Brian Freeman | 2e1d0ff | 2019-01-23 09:38:13 -0500 | [diff] [blame] | 721 | Should Be Equal As Strings ${resp.status_code} 200 |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 722 | [Return] ${resp.json()} |
| 723 | Request Certify ASDC Catalog Resource |
| 724 | [Documentation] requests certify on an asdc Catalog Resource by its id |
| 725 | [Arguments] ${catalog_resource_id} |
| 726 | ${map}= Create Dictionary user_remarks=Robot remarks |
Jerry Flood | e2a48d7 | 2017-06-21 15:06:29 -0400 | [diff] [blame] | 727 | ${data}= Fill JSON Template File ${ASDC_USER_REMARKS_TEMPLATE} ${map} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 728 | ${resp}= Run ASDC Post Request ${ASDC_CATALOG_RESOURCES_PATH}/${catalog_resource_id}${ASDC_CATALOG_LIFECYCLE_PATH}/certificationRequest ${data} ${ASDC_DESIGNER_USER_ID} |
Brian Freeman | 2e1d0ff | 2019-01-23 09:38:13 -0500 | [diff] [blame] | 729 | Should Be Equal As Strings ${resp.status_code} 200 |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 730 | [Return] ${resp.json()} |
| 731 | Start Certify ASDC Catalog Resource |
| 732 | [Documentation] start certify an asdc Catalog Resource by its id |
| 733 | [Arguments] ${catalog_resource_id} |
| 734 | ${resp}= Run ASDC Post Request ${ASDC_CATALOG_RESOURCES_PATH}/${catalog_resource_id}${ASDC_CATALOG_LIFECYCLE_PATH}/startCertification ${None} ${ASDC_TESTER_USER_ID} |
Brian Freeman | 2e1d0ff | 2019-01-23 09:38:13 -0500 | [diff] [blame] | 735 | Should Be Equal As Strings ${resp.status_code} 200 |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 736 | [Return] ${resp.json()} |
| 737 | Certify ASDC Catalog Resource |
| 738 | [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] | 739 | [Arguments] ${catalog_resource_id} ${user_id}=${ASDC_TESTER_USER_ID} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 740 | ${map}= Create Dictionary user_remarks=Robot remarks |
Jerry Flood | e2a48d7 | 2017-06-21 15:06:29 -0400 | [diff] [blame] | 741 | ${data}= Fill JSON Template File ${ASDC_USER_REMARKS_TEMPLATE} ${map} |
Brian Freeman | db1e741 | 2018-08-01 12:46:01 -0500 | [diff] [blame] | 742 | ${resp}= Run ASDC Post Request ${ASDC_CATALOG_RESOURCES_PATH}/${catalog_resource_id}${ASDC_CATALOG_LIFECYCLE_PATH}/certify ${data} ${user_id} |
Brian Freeman | 2e1d0ff | 2019-01-23 09:38:13 -0500 | [diff] [blame] | 743 | Should Be Equal As Strings ${resp.status_code} 200 |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 744 | [Return] ${resp.json()['uniqueId']} |
Jerry Flood | 6bd1afa | 2017-10-09 09:59:23 -0400 | [diff] [blame] | 745 | |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 746 | Upload ASDC Heat Package |
Brian Freeman | f508ab2 | 2018-03-15 21:19:41 -0500 | [diff] [blame] | 747 | [Documentation] Creates an asdc Software Product and returns its id |
| 748 | [Arguments] ${software_product_id} ${file_path} ${version_id}=0.1 |
Jerry Flood | 6bd1afa | 2017-10-09 09:59:23 -0400 | [diff] [blame] | 749 | ${files}= Create Dictionary |
| 750 | Create Multi Part ${files} upload ${file_path} contentType=application/zip |
Brian Freeman | 2e1d0ff | 2019-01-23 09:38:13 -0500 | [diff] [blame] | 751 | ${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} |
| 752 | Should Be Equal As Strings ${resp.status_code} 200 |
Jerry Flood | 6bd1afa | 2017-10-09 09:59:23 -0400 | [diff] [blame] | 753 | |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 754 | Add ASDC Catalog Service |
| 755 | [Documentation] Creates an asdc Catalog Service and returns its id |
jf9860 | 75010a4 | 2017-02-22 16:52:54 -0500 | [diff] [blame] | 756 | [Arguments] ${catalog_service_name} |
Jerry Flood | e2a48d7 | 2017-06-21 15:06:29 -0400 | [diff] [blame] | 757 | ${uuid}= Generate UUID |
jf9860 | 75010a4 | 2017-02-22 16:52:54 -0500 | [diff] [blame] | 758 | ${shortened_uuid}= Evaluate str("${uuid}")[:23] |
Jerry Flood | e2a48d7 | 2017-06-21 15:06:29 -0400 | [diff] [blame] | 759 | ${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] | 760 | ${map}= Create Dictionary service_name=${catalog_service_name} |
Jerry Flood | e2a48d7 | 2017-06-21 15:06:29 -0400 | [diff] [blame] | 761 | ${data}= Fill JSON Template File ${ASDC_CATALOG_SERVICE_TEMPLATE} ${map} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 762 | ${resp}= Run ASDC Post Request ${ASDC_CATALOG_SERVICES_PATH} ${data} ${ASDC_DESIGNER_USER_ID} |
Brian Freeman | 2e1d0ff | 2019-01-23 09:38:13 -0500 | [diff] [blame] | 763 | Should Be Equal As Strings ${resp.status_code} 201 |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 764 | [Return] ${resp.json()['uniqueId']} |
| 765 | Mark ASDC Catalog Service Inactive |
| 766 | [Documentation] Deletes an asdc Catalog Service |
| 767 | [Arguments] ${catalog_service_id} |
| 768 | ${resp}= Run ASDC Delete Request ${ASDC_CATALOG_SERVICES_PATH}/${catalog_service_id} ${ASDC_DESIGNER_USER_ID} |
Brian Freeman | 2e1d0ff | 2019-01-23 09:38:13 -0500 | [diff] [blame] | 769 | Should Be Equal As Strings ${resp.status_code} 204 |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 770 | [Return] ${resp} |
| 771 | Delete Inactive ASDC Catalog Services |
| 772 | [Documentation] delete all asdc Catalog Serivces that are inactive |
| 773 | ${resp}= Run ASDC Delete Request ${ASDC_CATALOG_INACTIVE_SERVICES_PATH} ${ASDC_DESIGNER_USER_ID} |
Brian Freeman | 2e1d0ff | 2019-01-23 09:38:13 -0500 | [diff] [blame] | 774 | Should Be Equal As Strings ${resp.status_code} 200 |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 775 | [Return] ${resp.json()} |
| 776 | Get ASDC Catalog Service |
| 777 | [Documentation] gets an asdc Catalog Service by its id |
| 778 | [Arguments] ${catalog_service_id} |
| 779 | ${resp}= Run ASDC Get Request ${ASDC_CATALOG_SERVICES_PATH}/${catalog_service_id} ${ASDC_DESIGNER_USER_ID} |
| 780 | [Return] ${resp.json()} |
| 781 | Checkin ASDC Catalog Service |
| 782 | [Documentation] checksin an asdc Catalog Service by its id |
| 783 | [Arguments] ${catalog_service_id} |
| 784 | ${map}= Create Dictionary user_remarks=Robot remarks |
Jerry Flood | e2a48d7 | 2017-06-21 15:06:29 -0400 | [diff] [blame] | 785 | ${data}= Fill JSON Template File ${ASDC_USER_REMARKS_TEMPLATE} ${map} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 786 | ${resp}= Run ASDC Post Request ${ASDC_CATALOG_SERVICES_PATH}/${catalog_service_id}${ASDC_CATALOG_LIFECYCLE_PATH}/checkin ${data} ${ASDC_DESIGNER_USER_ID} |
Brian Freeman | 2e1d0ff | 2019-01-23 09:38:13 -0500 | [diff] [blame] | 787 | Should Be Equal As Strings ${resp.status_code} 200 |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 788 | [Return] ${resp.json()} |
| 789 | Request Certify ASDC Catalog Service |
| 790 | [Documentation] requests certify on an asdc Catalog Service by its id |
| 791 | [Arguments] ${catalog_service_id} |
| 792 | ${map}= Create Dictionary user_remarks=Robot remarks |
Jerry Flood | e2a48d7 | 2017-06-21 15:06:29 -0400 | [diff] [blame] | 793 | ${data}= Fill JSON Template File ${ASDC_USER_REMARKS_TEMPLATE} ${map} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 794 | ${resp}= Run ASDC Post Request ${ASDC_CATALOG_SERVICES_PATH}/${catalog_service_id}${ASDC_CATALOG_LIFECYCLE_PATH}/certificationRequest ${data} ${ASDC_DESIGNER_USER_ID} |
Brian Freeman | 2e1d0ff | 2019-01-23 09:38:13 -0500 | [diff] [blame] | 795 | Should Be Equal As Strings ${resp.status_code} 200 |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 796 | [Return] ${resp.json()} |
| 797 | Start Certify ASDC Catalog Service |
| 798 | [Documentation] start certify an asdc Catalog Service by its id |
| 799 | [Arguments] ${catalog_service_id} |
| 800 | ${resp}= Run ASDC Post Request ${ASDC_CATALOG_SERVICES_PATH}/${catalog_service_id}${ASDC_CATALOG_LIFECYCLE_PATH}/startCertification ${None} ${ASDC_TESTER_USER_ID} |
Brian Freeman | 2e1d0ff | 2019-01-23 09:38:13 -0500 | [diff] [blame] | 801 | Should Be Equal As Strings ${resp.status_code} 200 |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 802 | [Return] ${resp.json()} |
| 803 | Certify ASDC Catalog Service |
| 804 | [Documentation] start certify an asdc Catalog Service by its id and returns the new id |
| 805 | [Arguments] ${catalog_service_id} |
| 806 | ${map}= Create Dictionary user_remarks=Robot remarks |
Jerry Flood | e2a48d7 | 2017-06-21 15:06:29 -0400 | [diff] [blame] | 807 | ${data}= Fill JSON Template File ${ASDC_USER_REMARKS_TEMPLATE} ${map} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 808 | ${resp}= Run ASDC Post Request ${ASDC_CATALOG_SERVICES_PATH}/${catalog_service_id}${ASDC_CATALOG_LIFECYCLE_PATH}/certify ${data} ${ASDC_TESTER_USER_ID} |
Brian Freeman | 2e1d0ff | 2019-01-23 09:38:13 -0500 | [diff] [blame] | 809 | Should Be Equal As Strings ${resp.status_code} 200 |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 810 | [Return] ${resp.json()['uniqueId']} |
| 811 | Approve ASDC Catalog Service |
| 812 | [Documentation] approve an asdc Catalog Service by its id |
| 813 | [Arguments] ${catalog_service_id} |
| 814 | ${map}= Create Dictionary user_remarks=Robot remarks |
Jerry Flood | e2a48d7 | 2017-06-21 15:06:29 -0400 | [diff] [blame] | 815 | ${data}= Fill JSON Template File ${ASDC_USER_REMARKS_TEMPLATE} ${map} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 816 | ${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} |
Brian Freeman | 2e1d0ff | 2019-01-23 09:38:13 -0500 | [diff] [blame] | 817 | Should Be Equal As Strings ${resp.status_code} 200 |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 818 | [Return] ${resp.json()} |
| 819 | Distribute ASDC Catalog Service |
| 820 | [Documentation] distribute an asdc Catalog Service by its id |
| 821 | [Arguments] ${catalog_service_id} |
| 822 | ${resp}= Run ASDC Post Request ${ASDC_CATALOG_SERVICES_PATH}/${catalog_service_id}${ASDC_CATALOG_SERVICE_DISTRIBUTION_ACTIVATE_PATH} ${None} ${ASDC_OPS_USER_ID} |
Brian Freeman | 2e1d0ff | 2019-01-23 09:38:13 -0500 | [diff] [blame] | 823 | Should Be Equal As Strings ${resp.status_code} 200 |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 824 | [Return] ${resp.json()} |
bdfreeman1421 | b2a4951 | 2018-11-25 07:32:19 -0500 | [diff] [blame] | 825 | |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 826 | Add ASDC Resource Instance |
| 827 | [Documentation] Creates an asdc Resource Instance and returns its id |
Brian Freeman | eef7c6f | 2018-11-16 18:42:21 -0500 | [diff] [blame] | 828 | [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] | 829 | ${milli_timestamp}= Generate MilliTimestamp UUID |
Brian Freeman | eef7c6f | 2018-11-16 18:42:21 -0500 | [diff] [blame] | 830 | ${xoffset}= Set Variable ${xoffset+306} |
| 831 | ${yoffset}= Set Variable ${yoffset+248} |
| 832 | ${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] | 833 | ${data}= Fill JSON Template File ${ASDC_RESOURCE_INSTANCE_TEMPLATE} ${map} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 834 | ${resp}= Run ASDC Post Request ${ASDC_CATALOG_SERVICES_PATH}/${catalog_service_id}${ASDC_CATALOG_SERVICE_RESOURCE_INSTANCE_PATH} ${data} ${ASDC_DESIGNER_USER_ID} |
Brian Freeman | 2e1d0ff | 2019-01-23 09:38:13 -0500 | [diff] [blame] | 835 | Should Be Equal As Strings ${resp.status_code} 201 |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 836 | [Return] ${resp.json()['uniqueId']} |
Brian Freeman | eef7c6f | 2018-11-16 18:42:21 -0500 | [diff] [blame] | 837 | |
bdfreeman1421 | b2a4951 | 2018-11-25 07:32:19 -0500 | [diff] [blame] | 838 | Add ASDC Resource Instance To Resource |
| 839 | [Documentation] Creates an asdc Resource Instance in a Resource (VF) and returns its id |
| 840 | [Arguments] ${parent_catalog_resource_id} ${catalog_resource_id} ${catalog_resource_name} ${xoffset}=${0} ${yoffset}=${0} |
| 841 | ${milli_timestamp}= Generate MilliTimestamp UUID |
| 842 | ${xoffset}= Set Variable ${xoffset+306} |
| 843 | ${yoffset}= Set Variable ${yoffset+248} |
| 844 | ${map}= Create Dictionary catalog_resource_id=${catalog_resource_id} catalog_resource_name=${catalog_resource_name} milli_timestamp=${milli_timestamp} posX=${xoffset} posY=${yoffset} |
| 845 | ${data}= Fill JSON Template File ${ASDC_RESOURCE_INSTANCE_TEMPLATE} ${map} |
| 846 | ${resp}= Run ASDC Post Request ${ASDC_CATALOG_RESOURCES_PATH}/${parent_catalog_resource_id}${ASDC_CATALOG_SERVICE_RESOURCE_INSTANCE_PATH} ${data} ${ASDC_DESIGNER_USER_ID} |
Brian Freeman | 2e1d0ff | 2019-01-23 09:38:13 -0500 | [diff] [blame] | 847 | Should Be Equal As Strings ${resp.status_code} 201 |
bdfreeman1421 | b2a4951 | 2018-11-25 07:32:19 -0500 | [diff] [blame] | 848 | [Return] ${resp.json()['uniqueId']} |
| 849 | |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 850 | Get Catalog Service Distribution |
| 851 | [Documentation] gets an asdc catalog Service distrbution |
| 852 | [Arguments] ${catalog_service_uuid} |
| 853 | ${resp}= Run ASDC Get Request ${ASDC_CATALOG_SERVICES_PATH}/${catalog_service_uuid}${ASDC_CATALOG_SERVICE_DISTRIBUTION_PATH} ${ASDC_OPS_USER_ID} |
Brian Freeman | 2e1d0ff | 2019-01-23 09:38:13 -0500 | [diff] [blame] | 854 | Should Be Equal As Strings ${resp.status_code} 200 |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 855 | [Return] ${resp.json()} |
| 856 | Check Catalog Service Distributed |
| 857 | [Documentation] gets an asdc catalog Service distrbution |
Brian Freeman | adaa237 | 2018-10-24 12:25:22 -0500 | [diff] [blame] | 858 | [Arguments] ${catalog_service_uuid} ${dist_status} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 859 | ${dist_resp}= Get Catalog Service Distribution ${catalog_service_uuid} |
Brian Freeman | 2e1d0ff | 2019-01-23 09:38:13 -0500 | [diff] [blame] | 860 | Should Be Equal As Strings ${dist_resp['distributionStatusOfServiceList'][0]['deployementStatus']} Distributed |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 861 | ${det_resp}= Get Catalog Service Distribution Details ${dist_resp['distributionStatusOfServiceList'][0]['distributionID']} |
| 862 | @{ITEMS}= Copy List ${det_resp['distributionStatusList']} |
Brian Freeman | f508ab2 | 2018-03-15 21:19:41 -0500 | [diff] [blame] | 863 | Should Not Be Empty ${ITEMS} |
Brian Freeman | a62644f | 2018-05-13 12:47:38 -0500 | [diff] [blame] | 864 | ${SO_COMPLETE} Set Variable FALSE |
bdfreeman1421 | b2a4951 | 2018-11-25 07:32:19 -0500 | [diff] [blame] | 865 | ${dist_status} Set Variable CONTINUE |
| 866 | Should Not Be Empty ${ITEMS} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 867 | :FOR ${ELEMENT} IN @{ITEMS} |
Brian Freeman | f508ab2 | 2018-03-15 21:19:41 -0500 | [diff] [blame] | 868 | \ Log ${ELEMENT['omfComponentID']} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 869 | \ Log ${ELEMENT['status']} |
Brian Freeman | 41ab5e5 | 2018-08-08 14:24:23 -0500 | [diff] [blame] | 870 | \ ${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] | 871 | \ Exit For Loop If ('${SO_COMPLETE}'=='TRUE') |
| 872 | \ Exit For Loop If ('${ELEMENT['status']}' == 'DISTRIBUTION_COMPLETE_ERROR') |
Brian Freeman | adaa237 | 2018-10-24 12:25:22 -0500 | [diff] [blame] | 873 | \ ${dist_status}= Set Variable If (('${ELEMENT['status']}' == 'COMPONENT_DONE_ERROR') and ('${ELEMENT['omfComponentID']}' == 'aai-ml')) EXIT |
| 874 | \ 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] | 875 | Should Be True ( '${SO_COMPLETE}'=='TRUE') SO Test |
bdfreeman1421 | b2a4951 | 2018-11-25 07:32:19 -0500 | [diff] [blame] | 876 | [Return] |
| 877 | |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 878 | Get Catalog Service Distribution Details |
| 879 | [Documentation] gets an asdc catalog Service distrbution details |
| 880 | [Arguments] ${catalog_service_distribution_id} |
Brian Freeman | 2e1d0ff | 2019-01-23 09:38:13 -0500 | [diff] [blame] | 881 | ${resp}= Run ASDC Get Request ${ASDC_CATALOG_SERVICES_PATH}${ASDC_CATALOG_SERVICE_DISTRIBUTION_PATH}/${catalog_service_distribution_id} ${ASDC_OPS_USER_ID} |
| 882 | Should Be Equal As Strings ${resp.status_code} 200 |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 883 | [Return] ${resp.json()} |
| 884 | Run ASDC Health Check |
| 885 | [Documentation] Runs a ASDC health check |
Brian Freeman | 2e1d0ff | 2019-01-23 09:38:13 -0500 | [diff] [blame] | 886 | ${session}= Create Session asdc ${ASDC_FE_ENDPOINT} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 887 | ${uuid}= Generate UUID |
| 888 | ${headers}= Create Dictionary Accept=application/json Content-Type=application/json X-TransactionId=${GLOBAL_APPLICATION_ID}-${uuid} X-FromAppId=${GLOBAL_APPLICATION_ID} |
Brian Freeman | 2e1d0ff | 2019-01-23 09:38:13 -0500 | [diff] [blame] | 889 | ${resp}= Get Request asdc ${ASDC_HEALTH_CHECK_PATH} headers=${headers} |
Brian Freeman | adaa237 | 2018-10-24 12:25:22 -0500 | [diff] [blame] | 890 | # only test for HTTP 200 to determine SDC Health. SDC_DE_HEALTH is informational |
Brian Freeman | 2e1d0ff | 2019-01-23 09:38:13 -0500 | [diff] [blame] | 891 | Should Be Equal As Strings ${resp.status_code} 200 SDC DOWN |
Brian Freeman | 5cf5fa6 | 2018-04-23 20:28:16 -0500 | [diff] [blame] | 892 | ${SDC_DE_HEALTH}= Catenate DOWN |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 893 | @{ITEMS}= Copy List ${resp.json()['componentsInfo']} |
| 894 | :FOR ${ELEMENT} IN @{ITEMS} |
| 895 | \ Log ${ELEMENT['healthCheckStatus']} |
Brian Freeman | e546f7e | 2018-04-19 12:17:56 -0500 | [diff] [blame] | 896 | \ ${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] | 897 | Log To Console (DMaaP:${SDC_DE_HEALTH}) no_newline=true |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 898 | Run ASDC Get Request |
| 899 | [Documentation] Runs an ASDC get request |
Brian Freeman | 44b8bb3 | 2018-05-03 21:08:42 -0500 | [diff] [blame] | 900 | [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] | 901 | ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD} |
Brian Freeman | 44b8bb3 | 2018-05-03 21:08:42 -0500 | [diff] [blame] | 902 | Log Creating session ${MY_ASDC_BE_ENDPOINT} |
Brian Freeman | 2e1d0ff | 2019-01-23 09:38:13 -0500 | [diff] [blame] | 903 | ${session}= Create Session asdc ${MY_ASDC_BE_ENDPOINT} auth=${auth} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 904 | ${uuid}= Generate UUID |
| 905 | ${headers}= Create Dictionary Accept=application/json Content-Type=application/json USER_ID=${user} X-TransactionId=${GLOBAL_APPLICATION_ID}-${uuid} X-FromAppId=${GLOBAL_APPLICATION_ID} |
Brian Freeman | 2e1d0ff | 2019-01-23 09:38:13 -0500 | [diff] [blame] | 906 | ${resp}= Get Request asdc ${data_path} headers=${headers} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 907 | Log Received response from asdc ${resp.text} |
| 908 | [Return] ${resp} |
| 909 | Run ASDC Put Request |
| 910 | [Documentation] Runs an ASDC put request |
Brian Freeman | 44b8bb3 | 2018-05-03 21:08:42 -0500 | [diff] [blame] | 911 | [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] | 912 | ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD} |
Brian Freeman | 44b8bb3 | 2018-05-03 21:08:42 -0500 | [diff] [blame] | 913 | Log Creating session ${MY_ASDC_BE_ENDPOINT} |
| 914 | ${session}= Create Session asdc ${MY_ASDC_BE_ENDPOINT} auth=${auth} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 915 | ${uuid}= Generate UUID |
| 916 | ${headers}= Create Dictionary Accept=application/json Content-Type=application/json USER_ID=${user} X-TransactionId=${GLOBAL_APPLICATION_ID}-${uuid} X-FromAppId=${GLOBAL_APPLICATION_ID} |
Brian Freeman | 2e1d0ff | 2019-01-23 09:38:13 -0500 | [diff] [blame] | 917 | ${resp}= Put Request asdc ${data_path} data=${data} headers=${headers} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 918 | Log Received response from asdc ${resp.text} |
| 919 | [Return] ${resp} |
Jerry Flood | 6bd1afa | 2017-10-09 09:59:23 -0400 | [diff] [blame] | 920 | |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 921 | Run ASDC Post Files Request |
| 922 | [Documentation] Runs an ASDC post request |
Brian Freeman | 44b8bb3 | 2018-05-03 21:08:42 -0500 | [diff] [blame] | 923 | [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] | 924 | ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD} |
Brian Freeman | 44b8bb3 | 2018-05-03 21:08:42 -0500 | [diff] [blame] | 925 | Log Creating session ${MY_ASDC_BE_ENDPOINT} |
Brian Freeman | 2e1d0ff | 2019-01-23 09:38:13 -0500 | [diff] [blame] | 926 | ${session}= Create Session asdc ${MY_ASDC_BE_ENDPOINT} auth=${auth} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 927 | ${uuid}= Generate UUID |
| 928 | ${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} |
Brian Freeman | 2e1d0ff | 2019-01-23 09:38:13 -0500 | [diff] [blame] | 929 | ${resp}= Post Request asdc ${data_path} files=${files} headers=${headers} |
| 930 | Log Received response from asdc ${resp.text} |
| 931 | [Return] ${resp} |
| 932 | |
| 933 | Run ASDC MD5 Post Request |
| 934 | [Documentation] Runs an ASDC post request with MD5 Checksum header |
| 935 | [Arguments] ${data_path} ${data} ${user}=${ASDC_DESIGNER_USER_ID} ${MY_ASDC_BE_ENDPOINT}=${ASDC_BE_ENDPOINT} |
| 936 | ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD} |
| 937 | Log Creating session ${MY_ASDC_BE_ENDPOINT} |
| 938 | ${session}= Create Session asdc ${MY_ASDC_BE_ENDPOINT} auth=${auth} |
| 939 | ${uuid}= Generate UUID |
| 940 | ${data_string}= Evaluate json.dumps(${data}) json |
| 941 | ${md5checksum}= Evaluate md5.new('''${data_string}''').hexdigest() modules=md5 |
| 942 | ${base64md5checksum}= Evaluate base64.b64encode("${md5checksum}") modules=base64 |
| 943 | ${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} |
| 944 | ${resp}= Post Request asdc ${data_path} data=${data} headers=${headers} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 945 | Log Received response from asdc ${resp.text} |
Jerry Flood | e2a48d7 | 2017-06-21 15:06:29 -0400 | [diff] [blame] | 946 | [Return] ${resp} |
Jerry Flood | 6bd1afa | 2017-10-09 09:59:23 -0400 | [diff] [blame] | 947 | |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 948 | Run ASDC Post Request |
| 949 | [Documentation] Runs an ASDC post request |
Brian Freeman | 44b8bb3 | 2018-05-03 21:08:42 -0500 | [diff] [blame] | 950 | [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] | 951 | ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD} |
Brian Freeman | 44b8bb3 | 2018-05-03 21:08:42 -0500 | [diff] [blame] | 952 | Log Creating session ${MY_ASDC_BE_ENDPOINT} |
Brian Freeman | 2e1d0ff | 2019-01-23 09:38:13 -0500 | [diff] [blame] | 953 | ${session}= Create Session asdc ${MY_ASDC_BE_ENDPOINT} auth=${auth} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 954 | ${uuid}= Generate UUID |
| 955 | ${headers}= Create Dictionary Accept=application/json Content-Type=application/json USER_ID=${user} X-TransactionId=${GLOBAL_APPLICATION_ID}-${uuid} X-FromAppId=${GLOBAL_APPLICATION_ID} |
Brian Freeman | 2e1d0ff | 2019-01-23 09:38:13 -0500 | [diff] [blame] | 956 | ${resp}= Post Request asdc ${data_path} data=${data} headers=${headers} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 957 | Log Received response from asdc ${resp.text} |
Jerry Flood | e2a48d7 | 2017-06-21 15:06:29 -0400 | [diff] [blame] | 958 | [Return] ${resp} |
Brian Freeman | 2e1d0ff | 2019-01-23 09:38:13 -0500 | [diff] [blame] | 959 | |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 960 | Run ASDC Delete Request |
| 961 | [Documentation] Runs an ASDC delete request |
Brian Freeman | 44b8bb3 | 2018-05-03 21:08:42 -0500 | [diff] [blame] | 962 | [Arguments] ${data_path} ${user}=${ASDC_DESIGNER_USER_ID} ${MY_ASDC_BE_ENDPOINT}=${ASDC_BE_ENDPOINT} |
Brian Freeman | 2e1d0ff | 2019-01-23 09:38:13 -0500 | [diff] [blame] | 963 | ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD} |
Brian Freeman | 44b8bb3 | 2018-05-03 21:08:42 -0500 | [diff] [blame] | 964 | Log Creating session ${MY_ASDC_BE_ENDPOINT} |
Brian Freeman | 2e1d0ff | 2019-01-23 09:38:13 -0500 | [diff] [blame] | 965 | ${session}= Create Session asdc ${MY_ASDC_BE_ENDPOINT} auth=${auth} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 966 | ${uuid}= Generate UUID |
| 967 | ${headers}= Create Dictionary Accept=application/json Content-Type=application/json USER_ID=${user} X-TransactionId=${GLOBAL_APPLICATION_ID}-${uuid} X-FromAppId=${GLOBAL_APPLICATION_ID} |
Brian Freeman | 2e1d0ff | 2019-01-23 09:38:13 -0500 | [diff] [blame] | 968 | ${resp}= Delete Request asdc ${data_path} headers=${headers} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 969 | Log Received response from asdc ${resp.text} |
Jerry Flood | e2a48d7 | 2017-06-21 15:06:29 -0400 | [diff] [blame] | 970 | [Return] ${resp} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 971 | Open ASDC GUI |
| 972 | [Documentation] Logs in to ASDC GUI |
| 973 | [Arguments] ${PATH} |
| 974 | ## Setup Browever now being managed by the test case |
| 975 | ##Setup Browser |
DR695H | bf5a3a3 | 2017-06-30 13:09:57 -0400 | [diff] [blame] | 976 | Go To ${ASDC_FE_ENDPOINT}${PATH} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 977 | Maximize Browser Window |
Jerry Flood | 6bd1afa | 2017-10-09 09:59:23 -0400 | [diff] [blame] | 978 | |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 979 | Set Browser Implicit Wait ${GLOBAL_SELENIUM_BROWSER_IMPLICIT_WAIT} |
DR695H | bf5a3a3 | 2017-06-30 13:09:57 -0400 | [diff] [blame] | 980 | Log Logging in to ${ASDC_FE_ENDPOINT}${PATH} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 981 | Title Should Be ASDC |
Jerry Flood | e2a48d7 | 2017-06-21 15:06:29 -0400 | [diff] [blame] | 982 | 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] | 983 | Log Logged in to ${ASDC_FE_ENDPOINT}${PATH} |
Jerry Flood | 6bd1afa | 2017-10-09 09:59:23 -0400 | [diff] [blame] | 984 | |
| 985 | |
| 986 | Create Multi Part |
| 987 | [Arguments] ${addTo} ${partName} ${filePath} ${contentType}=${None} |
| 988 | ${fileData}= Get Binary File ${filePath} |
| 989 | ${fileDir} ${fileName}= Split Path ${filePath} |
| 990 | ${partData}= Create List ${fileName} ${fileData} ${contentType} |
| 991 | Set To Dictionary ${addTo} ${partName}=${partData} |
Brian Freeman | f940ee9 | 2018-05-25 21:09:05 -0500 | [diff] [blame] | 992 | |