blob: 6a820aeffaa61ff7e02aa9325f92798a5ba2ec51 [file] [log] [blame]
DR695Hccff30b2017-02-17 18:44:24 -05001*** Settings ***
2Documentation The main interface for interacting with ASDC. It handles low level stuff like managing the http request library and DCAE required fields
Brian Freeman2e1d0ff2019-01-23 09:38:13 -05003Library RequestsLibrary
4Library UUID
5Library JSONUtils
DR695Hccff30b2017-02-17 18:44:24 -05006Library OperatingSystem
7Library Collections
Brian Freeman2e1d0ff2019-01-23 09:38:13 -05008Library ExtendedSelenium2Library
bdfreeman1421b2a49512018-11-25 07:32:19 -05009Library HttpLibrary.HTTP
Brian Freeman2e1d0ff2019-01-23 09:38:13 -050010Library String
11Library StringTemplater
Yang Xu7037e542018-12-28 01:19:26 -050012Library ArchiveLibrary
13Library HEATUtils
DR695Hccff30b2017-02-17 18:44:24 -050014Resource global_properties.robot
15Resource browser_setup.robot
16Resource json_templater.robot
Brian Freeman2e1d0ff2019-01-23 09:38:13 -050017
DR695Hccff30b2017-02-17 18:44:24 -050018*** 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 Floode2a48d72017-06-21 15:06:29 -040031${ASDC_VENDOR_SOFTWARE_UPLOAD_PATH} /orchestration-template-candidate
Yang Xu2ec80382018-11-01 12:30:37 -040032${ASDC_FE_CATALOG_RESOURCES_PATH} /sdc1/feProxy/rest/v1/catalog/resources
Brian Freemaneef7c6f2018-11-16 18:42:21 -050033${ASDC_FE_CATALOG_SERVICES_PATH} /sdc1/feProxy/rest/v1/catalog/services
DR695Hccff30b2017-02-17 18:44:24 -050034${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 Freemaneef7c6f2018-11-16 18:42:21 -050037${ASDC_CATALOG_RESOURCES_QUERY_PATH} /sdc2/rest/v1/catalog/resources/resourceName
DR695Hccff30b2017-02-17 18:44:24 -050038${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 Freeman2e1d0ff2019-01-23 09:38:13 -050041${ASDC_CATALOG_SERVICE_RESOURCE_ARTIFACT_PATH} /artifacts
DR695Hccff30b2017-02-17 18:44:24 -050042${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 Freeman2e1d0ff2019-01-23 09:38:13 -050053${ASDC_ARTIFACT_UPLOAD_TEMPLATE} robot/assets/templates/asdc/artifact_upload.template
DR695Hccff30b2017-02-17 18:44:24 -050054${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 Xu2ec80382018-11-01 12:30:37 -040058${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 Freemaneef7c6f2018-11-16 18:42:21 -050060${SDC_CATALOG_NET_RESOURCE_INPUT_TEMPLATE} robot/assets/templates/asdc/catalog_net_input_properties.template
bdfreeman1421b2a49512018-11-25 07:32:19 -050061${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 Freeman2e1d0ff2019-01-23 09:38:13 -050064${SDC_CATALOG_DEPLOYMENT_ARTIFACT_PATH} robot/assets/asdc/blueprints/
Brian Freemanf508ab22018-03-15 21:19:41 -050065${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 Freeman44b8bb32018-05-03 21:08:42 -050067${ASDC_BE_ONBOARD_ENDPOINT} ${GLOBAL_ASDC_SERVER_PROTOCOL}://${GLOBAL_INJECTED_SDC_BE_ONBOARD_IP_ADDR}:${GLOBAL_ASDC_BE_ONBOARD_PORT}
DR695Hbf5a3a32017-06-30 13:09:57 -040068
DR695Hccff30b2017-02-17 18:44:24 -050069*** Keywords ***
70Distribute 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 Freemaneef7c6f2018-11-16 18:42:21 -050072 [Arguments] ${model_zip_path} ${catalog_service_name}= ${cds}= ${service}=
bdfreeman1421b2a49512018-11-25 07:32:19 -050073 # For Testing use random service names
Brian Freemaneef7c6f2018-11-16 18:42:21 -050074 #${random}= Get Current Date
75 #${catalog_service_id}= Add ASDC Catalog Service ${catalog_service_name}_${random}
jf986075010a42017-02-22 16:52:54 -050076 ${catalog_service_id}= Add ASDC Catalog Service ${catalog_service_name}
DR695Hccff30b2017-02-17 18:44:24 -050077 ${catalog_resource_ids}= Create List
Jerry Flood3a169a32017-12-01 12:39:10 -050078 ${catalog_resources}= Create Dictionary
DR695Hccff30b2017-02-17 18:44:24 -050079 : FOR ${zip} IN @{model_zip_path}
Yang Xu2ec80382018-11-01 12:30:37 -040080 \ ${loop_catalog_resource_id}= Setup ASDC Catalog Resource ${zip} ${cds}
Jerry Floode2a48d72017-06-21 15:06:29 -040081 \ Append To List ${catalog_resource_ids} ${loop_catalog_resource_id}
DR695Hccff30b2017-02-17 18:44:24 -050082 \ ${loop_catalog_resource_resp}= Get ASDC Catalog Resource ${loop_catalog_resource_id}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -050083 \ ${catalog_resource_unique_name}= Add ASDC Resource Instance ${catalog_service_id} ${loop_catalog_resource_id} ${loop_catalog_resource_resp['name']}
Jerry Flood3a169a32017-12-01 12:39:10 -050084 \ Set To Dictionary ${catalog_resources} ${loop_catalog_resource_id}=${loop_catalog_resource_resp}
Brian Freemaneef7c6f2018-11-16 18:42:21 -050085 #
86 # do this here because the loop_catalog_resource_resp is different format after adding networks
87 ${vf_module}= Find Element In Array ${loop_catalog_resource_resp['groups']} type org.openecomp.groups.VfModule
88 #
89 # do network
90 ${networklist}= Get From Dictionary ${GLOBAL_SERVICE_GEN_NEUTRON_NETWORK_MAPPING} ${service}
91 ${xoffset}= Set Variable ${100}
92 ${generic_neutron_net_uuid}= Get Generic NeutronNet UUID
93 :FOR ${network} in @{networklist}
94 \ ${loop_catalog_resource_id}= Set Variable ${generic_neutron_net_uuid}
95 \ Append To List ${catalog_resource_ids} ${loop_catalog_resource_id}
96 \ ${loop_catalog_resource_resp}= Get ASDC Catalog Resource ${loop_catalog_resource_id}
Brian Freemaneef7c6f2018-11-16 18:42:21 -050097 \ ${loop_catalog_resource_id}= Add ASDC Resource Instance ${catalog_service_id} ${loop_catalog_resource_id} ${network} ${xoffset} ${0}
98 \ ${nf_role}= Convert To Lowercase ${network}
99 \ Setup SDC Catalog Resource GenericNeutronNet Properties ${catalog_service_id} ${nf_role} ${loop_catalog_resource_id}
100 \ ${xoffset}= Set Variable ${xoffset+100}
101 \ Set To Dictionary ${catalog_resources} ${loop_catalog_resource_id}=${loop_catalog_resource_resp}
DR695Hccff30b2017-02-17 18:44:24 -0500102 ${catalog_service_resp}= Get ASDC Catalog Service ${catalog_service_id}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500103 #
104 # do deployment artifacts
105 #
106 ${deploymentlist}= Get From Dictionary ${GLOBAL_SERVICE_DEPLOYMENT_ARTIFACT_MAPPING} ${service}
107 :FOR ${deployment} IN @{deploymentlist}
108 \ ${loop_catalog_resource_resp}= Get ASDC Catalog Resource ${loop_catalog_resource_id}
109 \ Setup SDC Catalog Resource Deployment Artifact Properties ${catalog_service_id} ${loop_catalog_resource_resp} ${catalog_resource_unique_name} ${deployment}
DR695Hccff30b2017-02-17 18:44:24 -0500110 Checkin ASDC Catalog Service ${catalog_service_id}
111 Request Certify ASDC Catalog Service ${catalog_service_id}
112 Start Certify ASDC Catalog Service ${catalog_service_id}
113 # on certify it gets a new id
114 ${catalog_service_id}= Certify ASDC Catalog Service ${catalog_service_id}
115 Approve ASDC Catalog Service ${catalog_service_id}
Brian Freeman796b9eb2018-10-08 08:23:20 -0500116 : FOR ${DIST_INDEX} IN RANGE 1
Brian Freeman18df8912018-05-25 13:27:29 -0500117 \ Log Distribution Attempt ${DIST_INDEX}
118 \ Distribute ASDC Catalog Service ${catalog_service_id}
119 \ ${catalog_service_resp}= Get ASDC Catalog Service ${catalog_service_id}
Brian Freemanf940ee92018-05-25 21:09:05 -0500120 \ ${status} ${_} = Run Keyword And Ignore Error Loop Over Check Catalog Service Distributed ${catalog_service_resp['uuid']}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500121 \ Exit For Loop If '${status}'=='PASS'
Brian Freeman8c002d52018-07-30 19:35:36 -0500122 Should Be Equal As Strings ${status} PASS
Jerry Flood3a169a32017-12-01 12:39:10 -0500123 [Return] ${catalog_service_resp['name']} ${loop_catalog_resource_resp['name']} ${vf_module} ${catalog_resource_ids} ${catalog_service_id} ${catalog_resources}
Brian Freeman18df8912018-05-25 13:27:29 -0500124
bdfreeman1421b2a49512018-11-25 07:32:19 -0500125Distribute vCPEResCust Model From ASDC
126 [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
127 [Arguments] ${model_zip_path} ${catalog_service_name}= ${cds}= ${service}=
128 # For testing use random service name
Brian Freeman9c42ae12018-11-27 14:33:27 -0500129 #${random}= Get Current Date
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500130 ${uuid}= Generate UUID
131 ${random}= Evaluate str("${uuid}")[:4]
132 ${catalog_service_id}= Add ASDC Catalog Service ${catalog_service_name}_${random}
133 # catalog_service_name already
134 #${catalog_service_id}= Add ASDC Catalog Service ${catalog_service_name}
bdfreeman1421b2a49512018-11-25 07:32:19 -0500135 Log To Console ${\n}ServiceName: ${catalog_service_name}_${random}
136 #${catalog_service_id}= Add ASDC Catalog Service ${catalog_service_name}
137 ${catalog_resource_ids}= Create List
138 ${catalog_resources}= Create Dictionary
139 : FOR ${zip} IN @{model_zip_path}
140 \ ${loop_catalog_resource_id}= Setup ASDC Catalog Resource ${zip} ${cds}
141 \ Append To List ${catalog_resource_ids} ${loop_catalog_resource_id}
142 \ ${loop_catalog_resource_resp}= Get ASDC Catalog Resource ${loop_catalog_resource_id}
143 \ Add ASDC Resource Instance ${catalog_service_id} ${loop_catalog_resource_id} ${loop_catalog_resource_resp['name']}
144 \ Set To Dictionary ${catalog_resources} ${loop_catalog_resource_id}=${loop_catalog_resource_resp}
145 #
146 # do this here because the loop_catalog_resource_resp is different format after adding networks
147 ${vf_module}= Find Element In Array ${loop_catalog_resource_resp['groups']} type org.openecomp.groups.VfModule
148 #
149 # do allottedresource
150 ${allottedresource_list}= Create List TunnelXConn BRG
151 # Example data
152 #${tunnelxconn_dict}= Create Dictionary invariantUUID=8ac029e7-77aa-40d4-b28a-d17c02d5fd82 UUID=2ddc1b37-d7da-4aab-b645-ed7db34a5d03 node_type=org.openecomp.service.Demovcpevgmux
153 #${brg_dict}= Create Dictionary invariantUUID=ff0337b9-dbe2-4d88-bb74-18bf027ae586 UUID=1b6974f1-4aed-47f4-b962-816aa1261927 node_type=org.openecomp.service.Demovcpevbrgemu
Yang Xu7037e542018-12-28 01:19:26 -0500154 # Create /tmp/vcpe_allotted_resource_data.json with demo vgmux and brgemu CSARs
155 Create Allotted Resource Data File
bdfreeman1421b2a49512018-11-25 07:32:19 -0500156 ${vcpe_ar_data_file} Get File /tmp/vcpe_allotted_resource_data.json
157 ${tunnelxconn_invariant_uuid} Get Json Value ${vcpe_ar_data_file} /tunnelxconn/invariantUUID
158 ${tunnelxconn_uuid} Get Json Value ${vcpe_ar_data_file} /tunnelxconn/UUID
159 ${tunnelxconn_node_type} Get Json Value ${vcpe_ar_data_file} /tunnelxconn/node_type
160 ${brg_invariant_uuid} Get Json Value ${vcpe_ar_data_file} /brg/invariantUUID
161 ${brg_uuid} Get Json Value ${vcpe_ar_data_file} /brg/UUID
162 ${brg_node_type} Get Json Value ${vcpe_ar_data_file} /brg/node_type
163 ${tunnelxconn_dict}= Create Dictionary invariantUUID=${tunnelxconn_invariant_uuid} UUID=${tunnelxconn_uuid} node_type=${tunnelxconn_node_type}
164 ${brg_dict}= Create Dictionary invariantUUID=${brg_invariant_uuid} UUID=${brg_uuid} node_type=${brg_node_type}
165 ${xoffset}= Set Variable ${100}
166 ${allottedresource_uuid}= Get AllottedResource UUID
167 ${random}= Get Current Date
168 :FOR ${allottedresource} in @{allottedresource_list}
169 \ ${loop_catalog_resource_id}= Set Variable ${allottedresource_uuid}
170 \ Append To List ${catalog_resource_ids} ${loop_catalog_resource_id}
171 \ ${loop_catalog_resource_id}= Add ASDC Allotted Resource Catalog Resource 00000 ${allottedresource}_${random} ONAP ${loop_catalog_resource_id} ${allottedresource}
172 \ ${loop_catalog_resource_id2}= Add ASDC Resource Instance To Resource ${loop_catalog_resource_id} ${allottedresource_uuid} ${allottedresource} ${xoffset} ${0}
173 \ ${loop_catalog_resource_resp}= Get ASDC Catalog Resource ${loop_catalog_resource_id}
174 #
175 # Set the properties to relate to the brg and gmux
176 #
177 \ 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']}
178 \ 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']}
179 #
180 # Set the nf_role nf_type
181 #
182 \ Run Keyword If '${allottedresource}'=='TunnelXConn' Setup SDC Catalog Resource AllottedResource Inputs ${catalog_service_id} ${allottedresource} ${loop_catalog_resource_id}
183 \ Run Keyword If '${allottedresource}'=='BRG' Setup SDC Catalog Resource AllottedResource Inputs ${catalog_service_id} ${allottedresource} ${loop_catalog_resource_id}
bdfreeman1421b2a49512018-11-25 07:32:19 -0500184 \ ${loop_catalog_resource_id}= Certify ASDC Catalog Resource ${loop_catalog_resource_id} ${ASDC_DESIGNER_USER_ID}
185 \ Add ASDC Resource Instance ${catalog_service_id} ${loop_catalog_resource_id} ${loop_catalog_resource_resp['name']}
bdfreeman1421b2a49512018-11-25 07:32:19 -0500186 \ Set To Dictionary ${catalog_resources} ${loop_catalog_resource_id}=${loop_catalog_resource_resp}
187 ${catalog_service_resp}= Get ASDC Catalog Service ${catalog_service_id}
188 Checkin ASDC Catalog Service ${catalog_service_id}
189 Request Certify ASDC Catalog Service ${catalog_service_id}
190 Start Certify ASDC Catalog Service ${catalog_service_id}
191 # on certify it gets a new id
192 ${catalog_service_id}= Certify ASDC Catalog Service ${catalog_service_id}
193 Approve ASDC Catalog Service ${catalog_service_id}
194 : FOR ${DIST_INDEX} IN RANGE 1
195 \ Log Distribution Attempt ${DIST_INDEX}
196 \ Distribute ASDC Catalog Service ${catalog_service_id}
197 \ ${catalog_service_resp}= Get ASDC Catalog Service ${catalog_service_id}
198 \ ${status} ${_} = Run Keyword And Ignore Error Loop Over Check Catalog Service Distributed ${catalog_service_resp['uuid']}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500199 \ Exit For Loop If '${status}'=='PASS'
bdfreeman1421b2a49512018-11-25 07:32:19 -0500200 Should Be Equal As Strings ${status} PASS
201 [Return] ${catalog_service_resp['name']} ${loop_catalog_resource_resp['name']} ${vf_module} ${catalog_resource_ids} ${catalog_service_id} ${catalog_resources}
202
203
Yang Xu7037e542018-12-28 01:19:26 -0500204Create Allotted Resource Data File
205 [Documentation] Create alloted resource json data file
206 [Arguments]
207 ${allotted_resource}= Create Dictionary
208 ${allotted_csar_map}= Create Dictionary
209 Set To Dictionary ${allotted_csar_map} tunnelxconn=service-Demovcpevgmux-csar.csar
210 Set To Dictionary ${allotted_csar_map} brg=service-Demovcpevbrgemu-csar.csar
211 ${keys}= Get Dictionary Keys ${allotted_csar_map}
212 :for ${key} in @{keys}
213 \ ${csar}= Get From Dictionary ${allotted_csar_map} ${key}
214 \ ${dir} ${ext}= Split String From Right ${csar} - 1
215 \ Extract Zip File /tmp/csar/${csar} /tmp/csar/${dir}
216 \ ${template}= Catenate /tmp/csar/${dir}/Definitions/${dir}-template.yml
217 \ ${json_str}= Template Yaml To Json ${template}
218 \ ${json_obj}= To Json ${json_str}
219 \ ${attrs}= Create Dictionary
220 \ Set To Dictionary ${attrs} invariantUUID=${json_obj['metadata']['invariantUUID']}
221 \ Set To Dictionary ${attrs} UUID=${json_obj['metadata']['UUID']}
222 \ Set To Dictionary ${attrs} node_type=${json_obj['topology_template']['substitution_mappings']['node_type']}
223 \ Set To Dictionary ${allotted_resource} ${key}=${attrs}
224 ${result_str}= Evaluate json.dumps(${allotted_resource}, indent=2) json
225 Log To Console ${result_str}
226 Create File /tmp/vcpe_allotted_resource_data.json ${result_str}
Yang Xu7037e542018-12-28 01:19:26 -0500227
bdfreeman14211ad11d92018-11-17 18:47:37 +0000228Download CSAR
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500229 [Documentation] Download CSAR
bdfreeman14211ad11d92018-11-17 18:47:37 +0000230 [Arguments] ${catalog_service_id} ${save_directory}=/tmp/csar
231 # get meta data
232 ${resp}= Run ASDC Get Request ${ASDC_CATALOG_SERVICES_PATH}/${catalog_service_id}/filteredDataByParams?include=toscaArtifacts ${ASDC_DESIGNER_USER_ID} ${ASDC_BE_ENDPOINT}
233 ${csar_resource_id}= Set Variable ${resp.json()['toscaArtifacts']['assettoscacsar']['uniqueId']}
234 ${resp}= Run ASDC Get Request ${ASDC_CATALOG_SERVICES_PATH}/${catalog_service_id}/artifacts/${csar_resource_id}
235 ${csar_file_name}= Set Variable ${resp.json()['artifactName']}
236 ${base64Obj}= Set Variable ${resp.json()['base64Contents']}
237 ${binObj}= Evaluate base64.b64decode("${base64Obj}") modules=base64
238 Create Binary File ${save_directory}/${csar_file_name} ${binObj}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500239 Log To Console Downloaded:${csar_file_name}
bdfreeman14211ad11d92018-11-17 18:47:37 +0000240 [Return]
241
Brian Freemaneef7c6f2018-11-16 18:42:21 -0500242
243Get Generic NeutronNet UUID
244 [Documentation] Lookoup the UUID of the Generic NeutronNetwork Resource
Brian Freemaneef7c6f2018-11-16 18:42:21 -0500245 ${resp}= Run ASDC Get Request ${ASDC_CATALOG_RESOURCES_QUERY_PATH}/Generic%20NeutronNet/resourceVersion/1.0 ${ASDC_DESIGNER_USER_ID} ${ASDC_BE_ENDPOINT}
246 [Return] ${resp.json()['allVersions']['1.0']}
247
bdfreeman1421b2a49512018-11-25 07:32:19 -0500248Get AllottedResource UUID
249 [Documentation] Lookoup the UUID of the Allotted Resource
250 # if this fails then the AllottedResource template got deleted from SDC by mistake
251 ${resp}= Run ASDC Get Request ${ASDC_CATALOG_RESOURCES_QUERY_PATH}/AllottedResource/resourceVersion/1.0 ${ASDC_DESIGNER_USER_ID} ${ASDC_BE_ENDPOINT}
252 [Return] ${resp.json()['allVersions']['1.0']}
253
Brian Freeman18df8912018-05-25 13:27:29 -0500254Loop Over Check Catalog Service Distributed
Gary Wu58d58532018-07-27 16:02:51 -0700255 [Arguments] ${catalog_service_id}
Brian Freemanadaa2372018-10-24 12:25:22 -0500256 # SO watchdog timeout is 300 seconds need buffer
bdfreeman1421b2a49512018-11-25 07:32:19 -0500257 ${dist_status}= Set Variable CONTINUE
258 : FOR ${CHECK_INDEX} IN RANGE 20
Brian Freemanadaa2372018-10-24 12:25:22 -0500259 \ ${status} ${_} = Run Keyword And Ignore Error Check Catalog Service Distributed ${catalog_service_id} ${dist_status}
Gary Wu58d58532018-07-27 16:02:51 -0700260 \ Sleep 20s
Brian Freemanf940ee92018-05-25 21:09:05 -0500261 \ Return From Keyword If '${status}'=='PASS'
bdfreeman1421b2a49512018-11-25 07:32:19 -0500262 # need a way to exit the loop early on DISTRIBUTION_COMPLETE_ERROR ${dist_status} doesnt work
263 #\ Exit For Loop If '${dist_status}'=='EXIT'
264 Should Be Equal As Strings ${status} PASS
265 [Return]
Brian Freeman18df8912018-05-25 13:27:29 -0500266
DR695Hccff30b2017-02-17 18:44:24 -0500267Setup ASDC Catalog Resource
268 [Documentation] Creates all the steps a vf needs for an asdc catalog resource and returns the id
Yang Xu2ec80382018-11-01 12:30:37 -0400269 [Arguments] ${model_zip_path} ${cds}=
Brian Freemanb568e5e2018-04-05 21:03:38 -0500270 ${license_model_id} ${license_model_version_id}= Add ASDC License Model
271 ${key_group_id}= Add ASDC License Group ${license_model_id} ${license_model_version_id}
272 ${pool_id}= Add ASDC Entitlement Pool ${license_model_id} ${license_model_version_id}
273 ${feature_group_id}= Add ASDC Feature Group ${license_model_id} ${key_group_id} ${pool_id} ${license_model_version_id}
274 ${license_agreement_id}= Add ASDC License Agreement ${license_model_id} ${feature_group_id} ${license_model_version_id}
275 Submit ASDC License Model ${license_model_id} ${license_model_version_id}
276 ${license_model_resp}= Get ASDC License Model ${license_model_id} ${license_model_version_id}
Brian Freeman9c42ae12018-11-27 14:33:27 -0500277 # /var/opt/OpenECOMP_ETE/demo/heat/temp/vCPE_infra.zip
278 ${matches}= Get Regexp Matches ${model_zip_path} temp/(.*)\.zip 1
279 ${software_product_name_prefix}= Set Variable ${matches[0]}
280 ${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 Freemanb568e5e2018-04-05 21:03:38 -0500281 Upload ASDC Heat Package ${software_product_id} ${model_zip_path} ${software_product_version_id}
282 Validate ASDC Software Product ${software_product_id} ${software_product_version_id}
283 Submit ASDC Software Product ${software_product_id} ${software_product_version_id}
284 Package ASDC Software Product ${software_product_id} ${software_product_version_id}
285 ${software_product_resp}= Get ASDC Software Product ${software_product_id} ${software_product_version_id}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500286 ${catalog_resource_id}= Add ASDC Catalog Resource ${license_agreement_id} ${software_product_resp['name']} ${license_model_resp['vendorName']} ${software_product_id}
Yang Xu2ec80382018-11-01 12:30:37 -0400287 # Check if need to set up CDS properties
288 Run Keyword If '${cds}' == 'vfwng' Setup ASDC Catalog Resource CDS Properties ${catalog_resource_id}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500289
Brian Freeman391680a2018-08-11 15:20:58 -0500290 ${catalog_resource_id}= Certify ASDC Catalog Resource ${catalog_resource_id} ${ASDC_DESIGNER_USER_ID}
DR695Hccff30b2017-02-17 18:44:24 -0500291 [Return] ${catalog_resource_id}
Brian Freemaneef7c6f2018-11-16 18:42:21 -0500292
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500293
294Setup SDC Catalog Resource Deployment Artifact Properties
295 [Documentation] Set up Deployment Artiface properties
296 [Arguments] ${catalog_service_id} ${catalog_parent_service_id} ${catalog_resource_unique_id} ${blueprint_file}
297 ${resp}= Get ASDC Catalog Resource Component Instances Properties ${catalog_service_id}
298 #${resp}= Get ASDC Catalog Resource Deployment Artifact Properties ${catalog_service_id}
299 ${blueprint_data} Get File ${SDC_CATALOG_DEPLOYMENT_ARTIFACT_PATH}${blueprint_file}
300 ${payloadData}= Evaluate base64.b64encode('''${blueprint_data}'''.encode('utf-8')) modules=base64
301 ${dict}= Create Dictionary artifactLabel=blueprint artifactName=${blueprint_file} artifactType=DCAE_INVENTORY_BLUEPRINT artifactGroupType=DEPLOYMENT description=${blueprint_file} payloadData=${payloadData}
302 ${data}= Fill JSON Template File ${ASDC_ARTIFACT_UPLOAD_TEMPLATE} ${dict}
303 # POST artifactUpload to resource
304 ${artifact_upload_path}= Catenate ${ASDC_CATALOG_SERVICES_PATH}/${catalog_service_id}/resourceInstance/${catalog_resource_unique_id}${ASDC_CATALOG_SERVICE_RESOURCE_ARTIFACT_PATH}
305 ${resp}= Run ASDC MD5 Post Request ${artifact_upload_path} ${data} ${ASDC_DESIGNER_USER_ID}
306 Should Be Equal As Strings ${resp.status_code} 200
307 [Return] ${resp}
308
309
Brian Freemaneef7c6f2018-11-16 18:42:21 -0500310Setup SDC Catalog Resource GenericNeutronNet Properties
bdfreeman1421b2a49512018-11-25 07:32:19 -0500311 [Documentation] Set up GenericNeutronNet properties and inputs
Brian Freemaneef7c6f2018-11-16 18:42:21 -0500312 [Arguments] ${catalog_service_id} ${nf_role} ${catalog_parent_service_id}
Brian Freemaneef7c6f2018-11-16 18:42:21 -0500313 ${resp}= Get ASDC Catalog Resource Component Instances Properties ${catalog_service_id}
Brian Freemaneef7c6f2018-11-16 18:42:21 -0500314 ${componentInstances} Set Variable @{resp['componentInstancesProperties']}
315 # componentInstances can have 1 or more than 1 entry
316 ${passed}= Run Keyword And Return Status Evaluate type(${componentInstances})
317 ${type}= Run Keyword If ${passed} Evaluate type(${componentInstances})
318 ${componentInstancesList}= Run Keyword If "${type}"!="<type 'list'>" Create List ${componentInstances}
319 ... ELSE Set Variable ${componentInstances}
320 :FOR ${item} IN @{componentInstancesList}
321 \ ${test} ${v}= Run Keyword and Ignore Error Should Contain ${item} ${nf_role}
322 \ Run Keyword If '${test}' == 'FAIL' Continue For Loop
323 \ ${componentInstance1}= Set Variable ${item}
324 :FOR ${comp} IN @{resp['componentInstancesProperties']["${componentInstance1}"]}
325 \ ${name} Set Variable ${comp['name']}
326 \ ${test} ${v}= Run Keyword and Ignore Error Should Contain ${name} network_role
327 \ Run Keyword If '${test}' == 'FAIL' Continue For Loop
328 \ ${description} Set Variable ${comp['description']}
329 \ ${description}= Replace String ${description} ${\n} \
330 \ ${uniqueId} Set Variable ${comp['uniqueId']}
331 \ ${parentUniqueId} Set Variable ${comp['parentUniqueId']}
332 \ ${ownerId} Set Variable ${comp['ownerId']}
333 \ ${dict}= Create Dictionary parentUniqueId=${parentUniqueId} ownerId=${ownerId} uniqueId=${uniqueId} description=${description}
334 \ Run Keyword If '${name}'=='network_role' Set To Dictionary ${dict} name=${name} value=${nf_role}
bdfreeman1421b2a49512018-11-25 07:32:19 -0500335 \ ${data}= Fill JSON Template File ${SDC_CATALOG_NET_RESOURCE_INPUT_TEMPLATE} ${dict}
Brian Freemaneef7c6f2018-11-16 18:42:21 -0500336 \ ${response}= Set ASDC Catalog Resource Component Instance Properties ${catalog_parent_service_id} ${catalog_service_id} ${data}
337 #\ Log To Console resp=${response}
338 [Return]
339
bdfreeman1421b2a49512018-11-25 07:32:19 -0500340
341Setup SDC Catalog Resource AllottedResource Properties
342 [Documentation] Set up Allotted Resource properties and inputs
343 [Arguments] ${catalog_service_id} ${nf_role} ${catalog_resource_id} ${invariantUUID} ${UUID} ${node_type}
344 # Set component instances properties
345 ${nf_role_lc}= Convert To Lowercase ${nf_role}
346 ${resp}= Get ASDC Catalog Resource Component Instances Properties For Resource ${catalog_resource_id}
347 ${componentInstances} Set Variable @{resp['componentInstancesProperties']}
348 # componentInstances can have 1 or more than 1 entry
349 ${passed}= Run Keyword And Return Status Evaluate type(${componentInstances})
350 ${type}= Run Keyword If ${passed} Evaluate type(${componentInstances})
351 ${componentInstancesList}= Run Keyword If "${type}"!="<type 'list'>" Create List ${componentInstances}
352 ... ELSE Set Variable ${componentInstances}
353 :FOR ${item} IN @{componentInstancesList}
354 \ ${test} ${v}= Run Keyword and Ignore Error Should Contain ${item} ${nf_role_lc}
355 \ Run Keyword If '${test}' == 'FAIL' Continue For Loop
356 \ ${componentInstance1}= Set Variable ${item}
357 ${dict}= Create Dictionary
358 :FOR ${comp} IN @{resp['componentInstancesProperties']["${componentInstance1}"]}
359 \ ${name} Set Variable ${comp['name']}
360 \ ${test} ${v}= Run Keyword and Ignore Error Should Contain Any ${name} network_role providing_service_invariant_uuid providing_service_uuid providing_service_name uniqueId
361 \ Run Keyword If '${test}' == 'FAIL' Continue For Loop
362 \ ${parentUniqueId} Set Variable ${comp['parentUniqueId']}
363 \ ${ownerId} Set Variable ${comp['ownerId']}
364 \ Set To Dictionary ${dict} parentUniqueId=${parentUniqueId} ownerId=${ownerId}
365 \ Run Keyword If '${name}'=='providing_service_invariant_uuid' Set To Dictionary ${dict} providing_service_invariant_uuid=${invariantUUID}
366 \ Run Keyword If '${name}'=='providing_service_uuid' Set To Dictionary ${dict} providing_service_uuid=${UUID}
367 \ Run Keyword If '${name}'=='providing_service_name' Set To Dictionary ${dict} providing_service_name=${node_type}
368 # Sets it for each loop but should be one
369 \ ${uniqueId} Set Variable ${comp['uniqueId']}
370 \ ${uniqueId} Fetch From Left ${uniqueId} .
371 \ Set To Dictionary ${dict} uniqueId=${uniqueId}
372 ${data}= Fill JSON Template File ${SDC_CATALOG_ALLOTTED_RESOURCE_PROPERTIES_TEMPLATE} ${dict}
373 ${response}= Set ASDC Catalog Resource Component Instance Properties For Resource ${catalog_resource_id} ${componentInstance1} ${data}
374 Log To Console resp=${response}
375
376
377Setup SDC Catalog Resource AllottedResource Inputs
378 [Documentation] Set up Allotted Resource inputs
379 [Arguments] ${catalog_service_id} ${nf_role} ${catalog_resource_id}
380 # Set vnf inputs
381 ${resp}= Get ASDC Catalog Resource Inputs ${catalog_resource_id}
382 ${dict}= Create Dictionary
383 :FOR ${comp} in @{resp['inputs']}
384 \ ${name} Set Variable ${comp['name']}
385 \ ${uid} Set Variable ${comp['uniqueId']}
386 \ Run Keyword If '${name}'=='nf_type' Set To Dictionary ${dict} nf_type=${nf_role} nf_type_uid=${uid}
387 \ Run Keyword If '${name}'=='nf_role' Set To Dictionary ${dict} nf_role=${nf_role} nf_role_uid=${uid}
388 ${data}= Fill JSON Template File ${SDC_CATALOG_ALLOTTED_RESOURCE_INPUTS_TEMPLATE} ${dict}
389 ${response}= Set ASDC Catalog Resource VNF Inputs ${catalog_resource_id} ${data}
390 [Return] ${response}
391
Yang Xu2ec80382018-11-01 12:30:37 -0400392Setup ASDC Catalog Resource CDS Properties
393 [Documentation] Set up vfwng VNF properties and inputs for CDS
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500394 [Arguments] ${catalog_resource_id}
Yang Xu2ec80382018-11-01 12:30:37 -0400395 # Set vnf module properties
396 ${resp}= Get ASDC Catalog Resource Component Instances ${catalog_resource_id}
397 :FOR ${comp} in @{resp['componentInstances']}
398 \ ${name} Set Variable ${comp['name']}
399 \ ${uniqueId} Set Variable ${comp['uniqueId']}
400 \ ${actualComponentUid} Set Variable ${comp['actualComponentUid']}
401 \ ${test} ${v}= Run Keyword and Ignore Error Should Contain ${name} abstract_
402 \ Run Keyword If '${test}' == 'FAIL' Continue For Loop
403 \ ${response}= Get ASDC Catalog Resource Component Instance Properties ${catalog_resource_id} ${uniqueId} ${actualComponentUid}
404 \ ${dict}= Create Dictionary parent_id=${response[6]['parentUniqueId']}
405 \ Run Keyword If '${name}'=='abstract_vfw' Set To Dictionary ${dict} nfc_function=vfw nfc_naming_policy=SDNC_Policy.ONAP_VFW_NAMING_TIMESTAMP
406 \ Run Keyword If '${name}'=='abstract_vpg' Set To Dictionary ${dict} nfc_function=vpg nfc_naming_policy=SDNC_Policy.ONAP_VPG_NAMING_TIMESTAMP
407 \ Run Keyword If '${name}'=='abstract_vsn' Set To Dictionary ${dict} nfc_function=vsn nfc_naming_policy=SDNC_Policy.ONAP_VSN_NAMING_TIMESTAMP
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500408 \ ${data}= Fill JSON Template File ${ASDC_RESOURCE_INSTANCE_VNF_PROPERTIES_TEMPLATE} ${dict}
409 \ ${response}= Set ASDC Catalog Resource Component Instance Properties ${catalog_resource_id} ${uniqueId} ${data}
Yang Xu2ec80382018-11-01 12:30:37 -0400410 \ Log To Console resp=${response}
411
412 # Set vnf inputs
413 ${resp}= Get ASDC Catalog Resource Inputs ${catalog_resource_id}
414 ${dict}= Create Dictionary
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500415 :FOR ${comp} in @{resp['inputs']}
Yang Xu2ec80382018-11-01 12:30:37 -0400416 \ ${name} Set Variable ${comp['name']}
417 \ ${uid} Set Variable ${comp['uniqueId']}
418 \ Run Keyword If '${name}'=='nf_function' Set To Dictionary ${dict} nf_function=ONAP-FIREWALL nf_function_uid=${uid}
419 \ Run Keyword If '${name}'=='nf_type' Set To Dictionary ${dict} nf_type=FIREWALL nf_type_uid=${uid}
420 \ Run Keyword If '${name}'=='nf_naming_code' Set To Dictionary ${dict} nf_naming_code=vfw nf_naming_code_uid=${uid}
421 \ Run Keyword If '${name}'=='nf_role' Set To Dictionary ${dict} nf_role=vFW nf_role_uid=${uid}
422 \ Run Keyword If '${name}'=='cloud_env' Set To Dictionary ${dict} cloud_env=openstack cloud_env_uid=${uid}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500423 ${data}= Fill JSON Template File ${ASDC_RESOURCE_INSTANCE_VNF_INPUTS_TEMPLATE} ${dict}
Yang Xu2ec80382018-11-01 12:30:37 -0400424 ${response}= Set ASDC Catalog Resource VNF Inputs ${catalog_resource_id} ${data}
425
DR695Hccff30b2017-02-17 18:44:24 -0500426Add ASDC License Model
427 [Documentation] Creates an asdc license model and returns its id
Jerry Floode2a48d72017-06-21 15:06:29 -0400428 ${uuid}= Generate UUID
429 ${shortened_uuid}= Evaluate str("${uuid}")[:23]
DR695Hccff30b2017-02-17 18:44:24 -0500430 ${map}= Create Dictionary vendor_name=${shortened_uuid}
431 ${data}= Fill JSON Template File ${ASDC_LICENSE_MODEL_TEMPLATE} ${map}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500432 ${resp}= Run ASDC Post Request ${ASDC_VENDOR_LICENSE_MODEL_PATH} ${data} ${ASDC_DESIGNER_USER_ID} ${ASDC_BE_ONBOARD_ENDPOINT}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500433 Should Be Equal As Strings ${resp.status_code} 200
Brian Freemanb568e5e2018-04-05 21:03:38 -0500434 [Return] ${resp.json()['itemId']} ${resp.json()['version']['id']}
DR695Hccff30b2017-02-17 18:44:24 -0500435Get ASDC License Model
436 [Documentation] gets an asdc license model by its id
Jerry Floode2a48d72017-06-21 15:06:29 -0400437 [Arguments] ${id} ${version_id}=0.1
Brian Freeman44b8bb32018-05-03 21:08:42 -0500438 ${resp}= Run ASDC Get Request ${ASDC_VENDOR_LICENSE_MODEL_PATH}/${id}/versions/${version_id} ${ASDC_DESIGNER_USER_ID} ${ASDC_BE_ONBOARD_ENDPOINT}
Jerry Floode2a48d72017-06-21 15:06:29 -0400439 [Return] ${resp.json()}
440Get ASDC License Models
441 [Documentation] gets an asdc license model by its id
Brian Freeman44b8bb32018-05-03 21:08:42 -0500442 ${resp}= Run ASDC Get Request ${ASDC_VENDOR_LICENSE_MODEL_PATH} ${ASDC_DESIGNER_USER_ID} ${ASDC_BE_ONBOARD_ENDPOINT}
443
DR695Hccff30b2017-02-17 18:44:24 -0500444 [Return] ${resp.json()}
445Checkin ASDC License Model
446 [Documentation] checksin an asdc license model by its id
Jerry Floode2a48d72017-06-21 15:06:29 -0400447 [Arguments] ${id} ${version_id}=0.1
DR695Hccff30b2017-02-17 18:44:24 -0500448 ${map}= Create Dictionary action=Checkin
449 ${data}= Fill JSON Template File ${ASDC_ACTION_TEMPLATE} ${map}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500450 ${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}
451 Should Be Equal As Strings ${resp.status_code} 200
DR695Hccff30b2017-02-17 18:44:24 -0500452 [Return] ${resp.json()}
453Submit ASDC License Model
454 [Documentation] submits an asdc license model by its id
Jerry Floode2a48d72017-06-21 15:06:29 -0400455 [Arguments] ${id} ${version_id}=0.1
DR695Hccff30b2017-02-17 18:44:24 -0500456 ${map}= Create Dictionary action=Submit
457 ${data}= Fill JSON Template File ${ASDC_ACTION_TEMPLATE} ${map}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500458 ${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 Freeman2e1d0ff2019-01-23 09:38:13 -0500459 Should Be Equal As Strings ${resp.status_code} 200
DR695Hccff30b2017-02-17 18:44:24 -0500460 [Return] ${resp.json()}
461Checkin ASDC Software Product
462 [Documentation] checksin an asdc Software Product by its id
Jerry Floode2a48d72017-06-21 15:06:29 -0400463 [Arguments] ${id} ${version_id}=0.1
DR695Hccff30b2017-02-17 18:44:24 -0500464 ${map}= Create Dictionary action=Checkin
Jerry Floode2a48d72017-06-21 15:06:29 -0400465 ${data}= Fill JSON Template File ${ASDC_ACTION_TEMPLATE} ${map}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500466 ${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 Freeman2e1d0ff2019-01-23 09:38:13 -0500467 Should Be Equal As Strings ${resp.status_code} 200
Jerry Floode2a48d72017-06-21 15:06:29 -0400468 [Return] ${resp.json()}
469Validate ASDC Software Product
470 [Documentation] checksin an asdc Software Product by its id
471 [Arguments] ${id} ${version_id}=0.1
472 ${data}= Catenate
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500473 ${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}
474 Should Be Equal As Strings ${resp.status_code} 200
DR695Hccff30b2017-02-17 18:44:24 -0500475 [Return] ${resp.json()}
476Submit ASDC Software Product
477 [Documentation] submits an asdc Software Product by its id
Jerry Floode2a48d72017-06-21 15:06:29 -0400478 [Arguments] ${id} ${version_id}=0.1
DR695Hccff30b2017-02-17 18:44:24 -0500479 ${map}= Create Dictionary action=Submit
Jerry Floode2a48d72017-06-21 15:06:29 -0400480 ${data}= Fill JSON Template File ${ASDC_ACTION_TEMPLATE} ${map}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500481 ${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}
482 Should Be Equal As Strings ${resp.status_code} 200
DR695Hccff30b2017-02-17 18:44:24 -0500483 [Return] ${resp.json()}
484Package ASDC Software Product
485 [Documentation] creates_package on an asdc Software Product by its id
Jerry Floode2a48d72017-06-21 15:06:29 -0400486 [Arguments] ${id} ${version_id}=0.1
DR695Hccff30b2017-02-17 18:44:24 -0500487 ${map}= Create Dictionary action=Create_Package
Jerry Floode2a48d72017-06-21 15:06:29 -0400488 ${data}= Fill JSON Template File ${ASDC_ACTION_TEMPLATE} ${map}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500489 ${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}
490 Should Be Equal As Strings ${resp.status_code} 200
Jerry Floode2a48d72017-06-21 15:06:29 -0400491 [Return] ${resp.json()}
DR695Hccff30b2017-02-17 18:44:24 -0500492Add ASDC Entitlement Pool
493 [Documentation] Creates an asdc Entitlement Pool and returns its id
Jerry Floode2a48d72017-06-21 15:06:29 -0400494 [Arguments] ${license_model_id} ${version_id}=0.1
495 ${uuid}= Generate UUID
496 ${shortened_uuid}= Evaluate str("${uuid}")[:23]
DR695Hccff30b2017-02-17 18:44:24 -0500497 ${map}= Create Dictionary entitlement_pool_name=${shortened_uuid}
Jerry Floode2a48d72017-06-21 15:06:29 -0400498 ${data}= Fill JSON Template File ${ASDC_ENTITLEMENT_POOL_TEMPLATE} ${map}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500499 ${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}
500 Should Be Equal As Strings ${resp.status_code} 200
DR695Hccff30b2017-02-17 18:44:24 -0500501 [Return] ${resp.json()['value']}
502Get ASDC Entitlement Pool
503 [Documentation] gets an asdc Entitlement Pool by its id
504 [Arguments] ${license_model_id} ${pool_id}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500505 ${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}
DR695Hccff30b2017-02-17 18:44:24 -0500506 [Return] ${resp.json()}
507Add ASDC License Group
508 [Documentation] Creates an asdc license group and returns its id
Brian Freemanb568e5e2018-04-05 21:03:38 -0500509 [Arguments] ${license_model_id} ${version_id}=1.0
Jerry Floode2a48d72017-06-21 15:06:29 -0400510 ${uuid}= Generate UUID
511 ${shortened_uuid}= Evaluate str("${uuid}")[:23]
DR695Hccff30b2017-02-17 18:44:24 -0500512 ${map}= Create Dictionary key_group_name=${shortened_uuid}
Jerry Floode2a48d72017-06-21 15:06:29 -0400513 ${data}= Fill JSON Template File ${ASDC_KEY_GROUP_TEMPLATE} ${map}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500514 ${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}
515 Should Be Equal As Strings ${resp.status_code} 200
DR695Hccff30b2017-02-17 18:44:24 -0500516 [Return] ${resp.json()['value']}
517Get ASDC License Group
518 [Documentation] gets an asdc license group by its id
Jerry Floode2a48d72017-06-21 15:06:29 -0400519 [Arguments] ${license_model_id} ${group_id} ${version_id}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500520 ${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}
DR695Hccff30b2017-02-17 18:44:24 -0500521 [Return] ${resp.json()}
522Add ASDC Feature Group
523 [Documentation] Creates an asdc Feature Group and returns its id
Jerry Floode2a48d72017-06-21 15:06:29 -0400524 [Arguments] ${license_model_id} ${key_group_id} ${entitlement_pool_id} ${version_id}=0.1
525 ${uuid}= Generate UUID
526 ${shortened_uuid}= Evaluate str("${uuid}")[:23]
Jerry Flood80ff9852017-08-11 06:47:14 -0400527 ${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 Floode2a48d72017-06-21 15:06:29 -0400528 ${data}= Fill JSON Template File ${ASDC_FEATURE_GROUP_TEMPLATE} ${map}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500529 ${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}
530 Should Be Equal As Strings ${resp.status_code} 200
DR695Hccff30b2017-02-17 18:44:24 -0500531 [Return] ${resp.json()['value']}
532Get ASDC Feature Group
533 [Documentation] gets an asdc Feature Group by its id
534 [Arguments] ${license_model_id} ${group_id}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500535 ${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}
DR695Hccff30b2017-02-17 18:44:24 -0500536 [Return] ${resp.json()}
537Add ASDC License Agreement
538 [Documentation] Creates an asdc License Agreement and returns its id
Jerry Floode2a48d72017-06-21 15:06:29 -0400539 [Arguments] ${license_model_id} ${feature_group_id} ${version_id}=0.1
540 ${uuid}= Generate UUID
541 ${shortened_uuid}= Evaluate str("${uuid}")[:23]
DR695Hccff30b2017-02-17 18:44:24 -0500542 ${map}= Create Dictionary license_agreement_name=${shortened_uuid} feature_group_id=${feature_group_id}
Jerry Floode2a48d72017-06-21 15:06:29 -0400543 ${data}= Fill JSON Template File ${ASDC_LICENSE_AGREEMENT_TEMPLATE} ${map}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500544 ${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}
545 Should Be Equal As Strings ${resp.status_code} 200
DR695Hccff30b2017-02-17 18:44:24 -0500546 [Return] ${resp.json()['value']}
547Get ASDC License Agreement
548 [Documentation] gets an asdc License Agreement by its id
549 [Arguments] ${license_model_id} ${agreement_id}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500550 ${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}
DR695Hccff30b2017-02-17 18:44:24 -0500551 [Return] ${resp.json()}
552Add ASDC Software Product
553 [Documentation] Creates an asdc Software Product and returns its id
Brian Freeman9c42ae12018-11-27 14:33:27 -0500554 [Arguments] ${license_agreement_id} ${feature_group_id} ${license_model_name} ${license_model_id} ${license_model_version_id} ${name_prefix}
Jerry Floode2a48d72017-06-21 15:06:29 -0400555 ${uuid}= Generate UUID
Brian Freeman9c42ae12018-11-27 14:33:27 -0500556 ${shortened_uuid}= Evaluate str("${uuid}")[:13]
557 ${software_product_name}= Catenate ${name_prefix} ${shortened_uuid}
558 ${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 Floode2a48d72017-06-21 15:06:29 -0400559 ${data}= Fill JSON Template File ${ASDC_SOFTWARE_PRODUCT_TEMPLATE} ${map}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500560 ${resp}= Run ASDC Post Request ${ASDC_VENDOR_SOFTWARE_PRODUCT_PATH} ${data} ${ASDC_DESIGNER_USER_ID} ${ASDC_BE_ONBOARD_ENDPOINT}
561 Should Be Equal As Strings ${resp.status_code} 200
Brian Freemanb568e5e2018-04-05 21:03:38 -0500562 [Return] ${resp.json()['itemId']} ${resp.json()['version']['id']}
DR695Hccff30b2017-02-17 18:44:24 -0500563Get ASDC Software Product
564 [Documentation] gets an asdc Software Product by its id
Jerry Floode2a48d72017-06-21 15:06:29 -0400565 [Arguments] ${software_product_id} ${version_id}=0.1
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500566 ${resp}= Run ASDC Get Request ${ASDC_VENDOR_SOFTWARE_PRODUCT_PATH}/${software_product_id}/versions/${version_id} ${ASDC_DESIGNER_USER_ID} ${ASDC_BE_ONBOARD_ENDPOINT}
DR695Hccff30b2017-02-17 18:44:24 -0500567 [Return] ${resp.json()}
bdfreeman1421b2a49512018-11-25 07:32:19 -0500568
DR695Hccff30b2017-02-17 18:44:24 -0500569Add ASDC Catalog Resource
570 [Documentation] Creates an asdc Catalog Resource and returns its id
571 [Arguments] ${license_agreement_id} ${software_product_name} ${license_model_name} ${software_product_id}
572 ${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 Floode2a48d72017-06-21 15:06:29 -0400573 ${data}= Fill JSON Template File ${ASDC_CATALOG_RESOURCE_TEMPLATE} ${map}
bdfreeman1421b2a49512018-11-25 07:32:19 -0500574 ${resp}= Run ASDC Post Request ${ASDC_CATALOG_RESOURCES_PATH} ${data} ${ASDC_DESIGNER_USER_ID}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500575 Should Be Equal As Strings ${resp.status_code} 201
DR695Hccff30b2017-02-17 18:44:24 -0500576 [Return] ${resp.json()['uniqueId']}
bdfreeman1421b2a49512018-11-25 07:32:19 -0500577
578Add ASDC Allotted Resource Catalog Resource
579 [Documentation] Creates an asdc Allotted Resource Catalog Resource and returns its id
580 [Arguments] ${license_agreement_id} ${software_product_name} ${license_model_name} ${software_product_id} ${subcategory}
581 ${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}
582 ${data}= Fill JSON Template File ${ASDC_ALLOTTED_RESOURCE_CATALOG_RESOURCE_TEMPLATE} ${map}
583 ${resp}= Run ASDC Post Request ${ASDC_CATALOG_RESOURCES_PATH} ${data} ${ASDC_DESIGNER_USER_ID}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500584 Should Be Equal As Strings ${resp.status_code} 201
bdfreeman1421b2a49512018-11-25 07:32:19 -0500585 [Return] ${resp.json()['uniqueId']}
586
DR695Hccff30b2017-02-17 18:44:24 -0500587Mark ASDC Catalog Resource Inactive
588 [Documentation] deletes an asdc Catalog Resource
589 [Arguments] ${catalog_resource_id}
590 ${resp}= Run ASDC Delete Request ${ASDC_CATALOG_RESOURCES_PATH}/${catalog_resource_id} ${ASDC_DESIGNER_USER_ID}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500591 Should Be Equal As Strings ${resp.status_code} 204
DR695Hccff30b2017-02-17 18:44:24 -0500592 [Return] ${resp}
593Delete Inactive ASDC Catalog Resources
594 [Documentation] delete all asdc Catalog Resources that are inactive
595 ${resp}= Run ASDC Delete Request ${ASDC_CATALOG_INACTIVE_RESOURCES_PATH} ${ASDC_DESIGNER_USER_ID}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500596 Should Be Equal As Strings ${resp.status_code} 200
DR695Hccff30b2017-02-17 18:44:24 -0500597 [Return] ${resp.json()}
598Get ASDC Catalog Resource
599 [Documentation] gets an asdc Catalog Resource by its id
600 [Arguments] ${catalog_resource_id}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500601 ${resp}= Run ASDC Get Request ${ASDC_CATALOG_RESOURCES_PATH}/${catalog_resource_id} ${ASDC_DESIGNER_USER_ID}
DR695Hccff30b2017-02-17 18:44:24 -0500602 [Return] ${resp.json()}
Brian Freemaneef7c6f2018-11-16 18:42:21 -0500603
Yang Xu2ec80382018-11-01 12:30:37 -0400604Get ASDC Catalog Resource Component Instances
605 [Documentation] gets asdc Catalog Resource Component Instances by its id
606 [Arguments] ${catalog_resource_id}
607 ${resp}= Run ASDC Get Request ${ASDC_FE_CATALOG_RESOURCES_PATH}/${catalog_resource_id}/filteredDataByParams?include=componentInstances ${ASDC_DESIGNER_USER_ID} ${ASDC_FE_ENDPOINT}
608 [Return] ${resp.json()}
bdfreeman1421b2a49512018-11-25 07:32:19 -0500609
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500610Get ASDC Catalog Resource Deployment Artifact Properties
611 [Documentation] gets asdc Catalog Resource Deployment Artiface Properties by its id
612 [Arguments] ${catalog_resource_id}
613 #${resp}= Run ASDC Get Request ${ASDC_CATALOG_SERVICES_PATH}/${catalog_resource_id}/filteredDataByParams?include=componentInstances ${ASDC_DESIGNER_USER_ID} ${ASDC_FE_ENDPOINT}
614 ${resp}= Run ASDC Get Request ${ASDC_CATALOG_SERVICES_PATH}/${catalog_resource_id}/filteredDataByParams?include=deploymentArtifacts ${ASDC_DESIGNER_USER_ID} ${ASDC_FE_ENDPOINT}
615 [Return] ${resp.json()}
616
617
Brian Freemaneef7c6f2018-11-16 18:42:21 -0500618Get ASDC Catalog Resource Component Instances Properties
619 [Documentation] gets asdc Catalog Resource Component Instances Properties by its id
620 [Arguments] ${catalog_resource_id}
621 #${resp}= Run ASDC Get Request ${ASDC_FE_CATALOG_RESOURCES_PATH}/${catalog_resource_id}/filteredDataByParams?include=componentInstancesProperties ${ASDC_DESIGNER_USER_ID} ${ASDC_FE_ENDPOINT}
622 ${resp}= Run ASDC Get Request ${ASDC_CATALOG_SERVICES_PATH}/${catalog_resource_id}/filteredDataByParams?include=componentInstancesProperties ${ASDC_DESIGNER_USER_ID} ${ASDC_BE_ENDPOINT}
623 [Return] ${resp.json()}
624
bdfreeman1421b2a49512018-11-25 07:32:19 -0500625Get ASDC Catalog Resource Component Instances Properties For Resource
626 [Documentation] gets asdc Catalog Resource Component Instances Properties for a Resource (VF) by its id
627 [Arguments] ${catalog_resource_id}
628 ${resp}= Run ASDC Get Request ${ASDC_FE_CATALOG_RESOURCES_PATH}/${catalog_resource_id}/filteredDataByParams?include=componentInstancesProperties ${ASDC_DESIGNER_USER_ID} ${ASDC_FE_ENDPOINT}
629 [Return] ${resp.json()}
Brian Freemaneef7c6f2018-11-16 18:42:21 -0500630
Yang Xu2ec80382018-11-01 12:30:37 -0400631Get ASDC Catalog Resource Inputs
632 [Documentation] gets asdc Catalog Inputs by its id
633 [Arguments] ${catalog_resource_id}
634 ${resp}= Run ASDC Get Request ${ASDC_FE_CATALOG_RESOURCES_PATH}/${catalog_resource_id}/filteredDataByParams?include=inputs ${ASDC_DESIGNER_USER_ID} ${ASDC_FE_ENDPOINT}
635 [Return] ${resp.json()}
Brian Freemaneef7c6f2018-11-16 18:42:21 -0500636
Yang Xu2ec80382018-11-01 12:30:37 -0400637Get ASDC Catalog Resource Component Instance Properties
638 [Documentation] gets an asdc Catalog Resource properties by its id
639 [Arguments] ${catalog_resource_id} ${component_instance_id} ${component_id}
640 ${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}
641 [Return] ${resp.json()}
bdfreeman1421b2a49512018-11-25 07:32:19 -0500642
Yang Xu2ec80382018-11-01 12:30:37 -0400643Set ASDC Catalog Resource Component Instance Properties
644 [Documentation] sets an asdc Catalog Resource by its id
Brian Freemaneef7c6f2018-11-16 18:42:21 -0500645 [Arguments] ${catalog_resource_id} ${component_parent_service_id} ${data}
646 #${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}
647 ${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}
bdfreeman1421b2a49512018-11-25 07:32:19 -0500648 [Return] ${resp.json()}
649
650Set ASDC Catalog Resource Component Instance Properties For Resource
651 [Documentation] sets an asdc Catalog Resource by its id
652 [Arguments] ${catalog_parent_resource_id} ${catalog_resource_id} ${data}
653 #${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}
654 ${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}
655 [Return] ${resp.json()}
Brian Freemaneef7c6f2018-11-16 18:42:21 -0500656
Yang Xu74cfb862018-12-06 21:57:32 -0500657Set CDS Catalog Resource Component Instance Properties
658 [Documentation] sets an asdc Catalog Resource by its id
659 [Arguments] ${catalog_resource_id} ${component_instance_id} ${data}
660 ${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}
661 [Return] ${resp.json()}
662
Yang Xu2ec80382018-11-01 12:30:37 -0400663Set ASDC Catalog Resource VNF Inputs
664 [Documentation] sets an asdc Catalog Resource by its id
665 [Arguments] ${catalog_resource_id} ${data}
666 ${resp}= Run ASDC Post Request ${ASDC_FE_CATALOG_RESOURCES_PATH}/${catalog_resource_id}/update/inputs ${data} ${ASDC_DESIGNER_USER_ID} ${ASDC_FE_ENDPOINT}
667 [Return] ${resp.json()}
Brian Freeman79b00ce2018-11-01 14:57:53 -0500668Get SDC Demo Vnf Catalog Resource
669 [Documentation] gets resource id's for demonstration VNFs for instantiate
670 [Arguments] ${service_name}
671 ${resp}= Run ASDC Get Request ${ASDC_CATALOG_SERVICES_PATH}/serviceName/${service_name}/serviceVersion/1.0
672 @{ITEMS}= Copy List ${resp.json()['componentInstances']}
673 ${demo_catalog_resource}= Create Dictionary
674 :FOR ${ELEMENT} IN @{ITEMS}
675 \ Log ${ELEMENT['name']}
676 \ Log ${ELEMENT['groupInstances'][0]['groupName']}
677 \ ${vnf}= Get VNF From Group Name ${ELEMENT['groupInstances'][0]['groupName']} ${service_name}
678 \ ${vnf_data}= Create Dictionary vnf_type=${ELEMENT['name']} vf_module=${ELEMENT['groupInstances'][0]['groupName']}
679 \ LOG ${vnf_data}
680 \ Set To Dictionary ${demo_catalog_resource} ${vnf}=${vnf_data}
681 \ LOG ${demo_catalog_resource}
682 [Return] ${demo_catalog_resource}
683
684Get VNF From Group Name
685 [Documentation] looks up vnf key from service mapping for a regex on groupName and service_name
686 [Arguments] ${group_name} ${service_name}
687 ${vnf}= Set Variable If
688 ... ('${service_name}'=='demoVFWCL') and ('base_vfw' in '${group_name}') vFWSNK
689 ... ('${service_name}'=='demoVFWCL') and ('base_vpkg' in '${group_name}') vPKG
690 ... ('${service_name}'=='demoVLB') and ('base_vlb' in '${group_name}') vLB
691 [Return] ${vnf}
DR695Hccff30b2017-02-17 18:44:24 -0500692Checkin ASDC Catalog Resource
693 [Documentation] checksin an asdc Catalog Resource by its id
694 [Arguments] ${catalog_resource_id}
695 ${map}= Create Dictionary user_remarks=Robot remarks
Jerry Floode2a48d72017-06-21 15:06:29 -0400696 ${data}= Fill JSON Template File ${ASDC_USER_REMARKS_TEMPLATE} ${map}
DR695Hccff30b2017-02-17 18:44:24 -0500697 ${resp}= Run ASDC Post Request ${ASDC_CATALOG_RESOURCES_PATH}/${catalog_resource_id}${ASDC_CATALOG_LIFECYCLE_PATH}/checkin ${data} ${ASDC_DESIGNER_USER_ID}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500698 Should Be Equal As Strings ${resp.status_code} 200
DR695Hccff30b2017-02-17 18:44:24 -0500699 [Return] ${resp.json()}
700Request Certify ASDC Catalog Resource
701 [Documentation] requests certify on an asdc Catalog Resource by its id
702 [Arguments] ${catalog_resource_id}
703 ${map}= Create Dictionary user_remarks=Robot remarks
Jerry Floode2a48d72017-06-21 15:06:29 -0400704 ${data}= Fill JSON Template File ${ASDC_USER_REMARKS_TEMPLATE} ${map}
DR695Hccff30b2017-02-17 18:44:24 -0500705 ${resp}= Run ASDC Post Request ${ASDC_CATALOG_RESOURCES_PATH}/${catalog_resource_id}${ASDC_CATALOG_LIFECYCLE_PATH}/certificationRequest ${data} ${ASDC_DESIGNER_USER_ID}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500706 Should Be Equal As Strings ${resp.status_code} 200
DR695Hccff30b2017-02-17 18:44:24 -0500707 [Return] ${resp.json()}
708Start Certify ASDC Catalog Resource
709 [Documentation] start certify an asdc Catalog Resource by its id
710 [Arguments] ${catalog_resource_id}
711 ${resp}= Run ASDC Post Request ${ASDC_CATALOG_RESOURCES_PATH}/${catalog_resource_id}${ASDC_CATALOG_LIFECYCLE_PATH}/startCertification ${None} ${ASDC_TESTER_USER_ID}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500712 Should Be Equal As Strings ${resp.status_code} 200
DR695Hccff30b2017-02-17 18:44:24 -0500713 [Return] ${resp.json()}
714Certify ASDC Catalog Resource
715 [Documentation] start certify an asdc Catalog Resource by its id and returns the new id
Brian Freemandb1e7412018-08-01 12:46:01 -0500716 [Arguments] ${catalog_resource_id} ${user_id}=${ASDC_TESTER_USER_ID}
DR695Hccff30b2017-02-17 18:44:24 -0500717 ${map}= Create Dictionary user_remarks=Robot remarks
Jerry Floode2a48d72017-06-21 15:06:29 -0400718 ${data}= Fill JSON Template File ${ASDC_USER_REMARKS_TEMPLATE} ${map}
Brian Freemandb1e7412018-08-01 12:46:01 -0500719 ${resp}= Run ASDC Post Request ${ASDC_CATALOG_RESOURCES_PATH}/${catalog_resource_id}${ASDC_CATALOG_LIFECYCLE_PATH}/certify ${data} ${user_id}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500720 Should Be Equal As Strings ${resp.status_code} 200
DR695Hccff30b2017-02-17 18:44:24 -0500721 [Return] ${resp.json()['uniqueId']}
Jerry Flood6bd1afa2017-10-09 09:59:23 -0400722
DR695Hccff30b2017-02-17 18:44:24 -0500723Upload ASDC Heat Package
Brian Freemanf508ab22018-03-15 21:19:41 -0500724 [Documentation] Creates an asdc Software Product and returns its id
725 [Arguments] ${software_product_id} ${file_path} ${version_id}=0.1
Jerry Flood6bd1afa2017-10-09 09:59:23 -0400726 ${files}= Create Dictionary
727 Create Multi Part ${files} upload ${file_path} contentType=application/zip
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500728 ${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}
729 Should Be Equal As Strings ${resp.status_code} 200
Jerry Flood6bd1afa2017-10-09 09:59:23 -0400730
DR695Hccff30b2017-02-17 18:44:24 -0500731Add ASDC Catalog Service
732 [Documentation] Creates an asdc Catalog Service and returns its id
jf986075010a42017-02-22 16:52:54 -0500733 [Arguments] ${catalog_service_name}
Jerry Floode2a48d72017-06-21 15:06:29 -0400734 ${uuid}= Generate UUID
jf986075010a42017-02-22 16:52:54 -0500735 ${shortened_uuid}= Evaluate str("${uuid}")[:23]
Jerry Floode2a48d72017-06-21 15:06:29 -0400736 ${catalog_service_name}= Set Variable If '${catalog_service_name}' =='' ${shortened_uuid} ${catalog_service_name}
jf986075010a42017-02-22 16:52:54 -0500737 ${map}= Create Dictionary service_name=${catalog_service_name}
Jerry Floode2a48d72017-06-21 15:06:29 -0400738 ${data}= Fill JSON Template File ${ASDC_CATALOG_SERVICE_TEMPLATE} ${map}
DR695Hccff30b2017-02-17 18:44:24 -0500739 ${resp}= Run ASDC Post Request ${ASDC_CATALOG_SERVICES_PATH} ${data} ${ASDC_DESIGNER_USER_ID}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500740 Should Be Equal As Strings ${resp.status_code} 201
DR695Hccff30b2017-02-17 18:44:24 -0500741 [Return] ${resp.json()['uniqueId']}
742Mark ASDC Catalog Service Inactive
743 [Documentation] Deletes an asdc Catalog Service
744 [Arguments] ${catalog_service_id}
745 ${resp}= Run ASDC Delete Request ${ASDC_CATALOG_SERVICES_PATH}/${catalog_service_id} ${ASDC_DESIGNER_USER_ID}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500746 Should Be Equal As Strings ${resp.status_code} 204
DR695Hccff30b2017-02-17 18:44:24 -0500747 [Return] ${resp}
748Delete Inactive ASDC Catalog Services
749 [Documentation] delete all asdc Catalog Serivces that are inactive
750 ${resp}= Run ASDC Delete Request ${ASDC_CATALOG_INACTIVE_SERVICES_PATH} ${ASDC_DESIGNER_USER_ID}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500751 Should Be Equal As Strings ${resp.status_code} 200
DR695Hccff30b2017-02-17 18:44:24 -0500752 [Return] ${resp.json()}
753Get ASDC Catalog Service
754 [Documentation] gets an asdc Catalog Service by its id
755 [Arguments] ${catalog_service_id}
756 ${resp}= Run ASDC Get Request ${ASDC_CATALOG_SERVICES_PATH}/${catalog_service_id} ${ASDC_DESIGNER_USER_ID}
757 [Return] ${resp.json()}
758Checkin ASDC Catalog Service
759 [Documentation] checksin an asdc Catalog Service by its id
760 [Arguments] ${catalog_service_id}
761 ${map}= Create Dictionary user_remarks=Robot remarks
Jerry Floode2a48d72017-06-21 15:06:29 -0400762 ${data}= Fill JSON Template File ${ASDC_USER_REMARKS_TEMPLATE} ${map}
DR695Hccff30b2017-02-17 18:44:24 -0500763 ${resp}= Run ASDC Post Request ${ASDC_CATALOG_SERVICES_PATH}/${catalog_service_id}${ASDC_CATALOG_LIFECYCLE_PATH}/checkin ${data} ${ASDC_DESIGNER_USER_ID}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500764 Should Be Equal As Strings ${resp.status_code} 200
DR695Hccff30b2017-02-17 18:44:24 -0500765 [Return] ${resp.json()}
766Request Certify ASDC Catalog Service
767 [Documentation] requests certify on an asdc Catalog Service by its id
768 [Arguments] ${catalog_service_id}
769 ${map}= Create Dictionary user_remarks=Robot remarks
Jerry Floode2a48d72017-06-21 15:06:29 -0400770 ${data}= Fill JSON Template File ${ASDC_USER_REMARKS_TEMPLATE} ${map}
DR695Hccff30b2017-02-17 18:44:24 -0500771 ${resp}= Run ASDC Post Request ${ASDC_CATALOG_SERVICES_PATH}/${catalog_service_id}${ASDC_CATALOG_LIFECYCLE_PATH}/certificationRequest ${data} ${ASDC_DESIGNER_USER_ID}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500772 Should Be Equal As Strings ${resp.status_code} 200
DR695Hccff30b2017-02-17 18:44:24 -0500773 [Return] ${resp.json()}
774Start Certify ASDC Catalog Service
775 [Documentation] start certify an asdc Catalog Service by its id
776 [Arguments] ${catalog_service_id}
777 ${resp}= Run ASDC Post Request ${ASDC_CATALOG_SERVICES_PATH}/${catalog_service_id}${ASDC_CATALOG_LIFECYCLE_PATH}/startCertification ${None} ${ASDC_TESTER_USER_ID}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500778 Should Be Equal As Strings ${resp.status_code} 200
DR695Hccff30b2017-02-17 18:44:24 -0500779 [Return] ${resp.json()}
780Certify ASDC Catalog Service
781 [Documentation] start certify an asdc Catalog Service by its id and returns the new id
782 [Arguments] ${catalog_service_id}
783 ${map}= Create Dictionary user_remarks=Robot remarks
Jerry Floode2a48d72017-06-21 15:06:29 -0400784 ${data}= Fill JSON Template File ${ASDC_USER_REMARKS_TEMPLATE} ${map}
DR695Hccff30b2017-02-17 18:44:24 -0500785 ${resp}= Run ASDC Post Request ${ASDC_CATALOG_SERVICES_PATH}/${catalog_service_id}${ASDC_CATALOG_LIFECYCLE_PATH}/certify ${data} ${ASDC_TESTER_USER_ID}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500786 Should Be Equal As Strings ${resp.status_code} 200
DR695Hccff30b2017-02-17 18:44:24 -0500787 [Return] ${resp.json()['uniqueId']}
788Approve ASDC Catalog Service
789 [Documentation] approve an asdc Catalog Service by its id
790 [Arguments] ${catalog_service_id}
791 ${map}= Create Dictionary user_remarks=Robot remarks
Jerry Floode2a48d72017-06-21 15:06:29 -0400792 ${data}= Fill JSON Template File ${ASDC_USER_REMARKS_TEMPLATE} ${map}
DR695Hccff30b2017-02-17 18:44:24 -0500793 ${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 Freeman2e1d0ff2019-01-23 09:38:13 -0500794 Should Be Equal As Strings ${resp.status_code} 200
DR695Hccff30b2017-02-17 18:44:24 -0500795 [Return] ${resp.json()}
796Distribute ASDC Catalog Service
797 [Documentation] distribute an asdc Catalog Service by its id
798 [Arguments] ${catalog_service_id}
799 ${resp}= Run ASDC Post Request ${ASDC_CATALOG_SERVICES_PATH}/${catalog_service_id}${ASDC_CATALOG_SERVICE_DISTRIBUTION_ACTIVATE_PATH} ${None} ${ASDC_OPS_USER_ID}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500800 Should Be Equal As Strings ${resp.status_code} 200
DR695Hccff30b2017-02-17 18:44:24 -0500801 [Return] ${resp.json()}
bdfreeman1421b2a49512018-11-25 07:32:19 -0500802
DR695Hccff30b2017-02-17 18:44:24 -0500803Add ASDC Resource Instance
804 [Documentation] Creates an asdc Resource Instance and returns its id
Brian Freemaneef7c6f2018-11-16 18:42:21 -0500805 [Arguments] ${catalog_service_id} ${catalog_resource_id} ${catalog_resource_name} ${xoffset}=${0} ${yoffset}=${0}
DR695Hccff30b2017-02-17 18:44:24 -0500806 ${milli_timestamp}= Generate MilliTimestamp UUID
Brian Freemaneef7c6f2018-11-16 18:42:21 -0500807 ${xoffset}= Set Variable ${xoffset+306}
808 ${yoffset}= Set Variable ${yoffset+248}
809 ${map}= Create Dictionary catalog_resource_id=${catalog_resource_id} catalog_resource_name=${catalog_resource_name} milli_timestamp=${milli_timestamp} posX=${xoffset} posY=${yoffset}
Jerry Floode2a48d72017-06-21 15:06:29 -0400810 ${data}= Fill JSON Template File ${ASDC_RESOURCE_INSTANCE_TEMPLATE} ${map}
DR695Hccff30b2017-02-17 18:44:24 -0500811 ${resp}= Run ASDC Post Request ${ASDC_CATALOG_SERVICES_PATH}/${catalog_service_id}${ASDC_CATALOG_SERVICE_RESOURCE_INSTANCE_PATH} ${data} ${ASDC_DESIGNER_USER_ID}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500812 Should Be Equal As Strings ${resp.status_code} 201
DR695Hccff30b2017-02-17 18:44:24 -0500813 [Return] ${resp.json()['uniqueId']}
Brian Freemaneef7c6f2018-11-16 18:42:21 -0500814
bdfreeman1421b2a49512018-11-25 07:32:19 -0500815Add ASDC Resource Instance To Resource
816 [Documentation] Creates an asdc Resource Instance in a Resource (VF) and returns its id
817 [Arguments] ${parent_catalog_resource_id} ${catalog_resource_id} ${catalog_resource_name} ${xoffset}=${0} ${yoffset}=${0}
818 ${milli_timestamp}= Generate MilliTimestamp UUID
819 ${xoffset}= Set Variable ${xoffset+306}
820 ${yoffset}= Set Variable ${yoffset+248}
821 ${map}= Create Dictionary catalog_resource_id=${catalog_resource_id} catalog_resource_name=${catalog_resource_name} milli_timestamp=${milli_timestamp} posX=${xoffset} posY=${yoffset}
822 ${data}= Fill JSON Template File ${ASDC_RESOURCE_INSTANCE_TEMPLATE} ${map}
823 ${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 Freeman2e1d0ff2019-01-23 09:38:13 -0500824 Should Be Equal As Strings ${resp.status_code} 201
bdfreeman1421b2a49512018-11-25 07:32:19 -0500825 [Return] ${resp.json()['uniqueId']}
826
DR695Hccff30b2017-02-17 18:44:24 -0500827Get Catalog Service Distribution
828 [Documentation] gets an asdc catalog Service distrbution
829 [Arguments] ${catalog_service_uuid}
830 ${resp}= Run ASDC Get Request ${ASDC_CATALOG_SERVICES_PATH}/${catalog_service_uuid}${ASDC_CATALOG_SERVICE_DISTRIBUTION_PATH} ${ASDC_OPS_USER_ID}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500831 Should Be Equal As Strings ${resp.status_code} 200
DR695Hccff30b2017-02-17 18:44:24 -0500832 [Return] ${resp.json()}
833Check Catalog Service Distributed
834 [Documentation] gets an asdc catalog Service distrbution
Brian Freemanadaa2372018-10-24 12:25:22 -0500835 [Arguments] ${catalog_service_uuid} ${dist_status}
DR695Hccff30b2017-02-17 18:44:24 -0500836 ${dist_resp}= Get Catalog Service Distribution ${catalog_service_uuid}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500837 Should Be Equal As Strings ${dist_resp['distributionStatusOfServiceList'][0]['deployementStatus']} Distributed
DR695Hccff30b2017-02-17 18:44:24 -0500838 ${det_resp}= Get Catalog Service Distribution Details ${dist_resp['distributionStatusOfServiceList'][0]['distributionID']}
839 @{ITEMS}= Copy List ${det_resp['distributionStatusList']}
Brian Freemanf508ab22018-03-15 21:19:41 -0500840 Should Not Be Empty ${ITEMS}
Brian Freemana62644f2018-05-13 12:47:38 -0500841 ${SO_COMPLETE} Set Variable FALSE
bdfreeman1421b2a49512018-11-25 07:32:19 -0500842 ${dist_status} Set Variable CONTINUE
843 Should Not Be Empty ${ITEMS}
DR695Hccff30b2017-02-17 18:44:24 -0500844 :FOR ${ELEMENT} IN @{ITEMS}
Brian Freemanf508ab22018-03-15 21:19:41 -0500845 \ Log ${ELEMENT['omfComponentID']}
DR695Hccff30b2017-02-17 18:44:24 -0500846 \ Log ${ELEMENT['status']}
Brian Freeman41ab5e52018-08-08 14:24:23 -0500847 \ ${SO_COMPLETE} Set Variable If (('${ELEMENT['status']}' == 'DISTRIBUTION_COMPLETE_OK')) or ('${SO_COMPLETE}'=='TRUE') TRUE
Brian Freemaneca71072018-08-16 14:50:16 -0500848 \ Exit For Loop If ('${SO_COMPLETE}'=='TRUE')
849 \ Exit For Loop If ('${ELEMENT['status']}' == 'DISTRIBUTION_COMPLETE_ERROR')
Brian Freemanadaa2372018-10-24 12:25:22 -0500850 \ ${dist_status}= Set Variable If (('${ELEMENT['status']}' == 'COMPONENT_DONE_ERROR') and ('${ELEMENT['omfComponentID']}' == 'aai-ml')) EXIT
851 \ Exit For Loop If (('${ELEMENT['status']}' == 'COMPONENT_DONE_ERROR') and ('${ELEMENT['omfComponentID']}' == 'aai-ml'))
Brian Freemana62644f2018-05-13 12:47:38 -0500852 Should Be True ( '${SO_COMPLETE}'=='TRUE') SO Test
bdfreeman1421b2a49512018-11-25 07:32:19 -0500853 [Return]
854
DR695Hccff30b2017-02-17 18:44:24 -0500855Get Catalog Service Distribution Details
856 [Documentation] gets an asdc catalog Service distrbution details
857 [Arguments] ${catalog_service_distribution_id}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500858 ${resp}= Run ASDC Get Request ${ASDC_CATALOG_SERVICES_PATH}${ASDC_CATALOG_SERVICE_DISTRIBUTION_PATH}/${catalog_service_distribution_id} ${ASDC_OPS_USER_ID}
859 Should Be Equal As Strings ${resp.status_code} 200
DR695Hccff30b2017-02-17 18:44:24 -0500860 [Return] ${resp.json()}
861Run ASDC Health Check
862 [Documentation] Runs a ASDC health check
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500863 ${session}= Create Session asdc ${ASDC_FE_ENDPOINT}
DR695Hccff30b2017-02-17 18:44:24 -0500864 ${uuid}= Generate UUID
865 ${headers}= Create Dictionary Accept=application/json Content-Type=application/json X-TransactionId=${GLOBAL_APPLICATION_ID}-${uuid} X-FromAppId=${GLOBAL_APPLICATION_ID}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500866 ${resp}= Get Request asdc ${ASDC_HEALTH_CHECK_PATH} headers=${headers}
Brian Freemanadaa2372018-10-24 12:25:22 -0500867 # only test for HTTP 200 to determine SDC Health. SDC_DE_HEALTH is informational
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500868 Should Be Equal As Strings ${resp.status_code} 200 SDC DOWN
Brian Freeman5cf5fa62018-04-23 20:28:16 -0500869 ${SDC_DE_HEALTH}= Catenate DOWN
DR695Hccff30b2017-02-17 18:44:24 -0500870 @{ITEMS}= Copy List ${resp.json()['componentsInfo']}
871 :FOR ${ELEMENT} IN @{ITEMS}
872 \ Log ${ELEMENT['healthCheckStatus']}
Brian Freemane546f7e2018-04-19 12:17:56 -0500873 \ ${SDC_DE_HEALTH} Set Variable If (('DE' in '${ELEMENT['healthCheckComponent']}') and ('${ELEMENT['healthCheckStatus']}' == 'UP')) or ('${SDC_DE_HEALTH}'=='UP') UP
Brian Freemand5743d52018-11-05 11:05:43 -0500874 Log To Console (DMaaP:${SDC_DE_HEALTH}) no_newline=true
DR695Hccff30b2017-02-17 18:44:24 -0500875Run ASDC Get Request
876 [Documentation] Runs an ASDC get request
Brian Freeman44b8bb32018-05-03 21:08:42 -0500877 [Arguments] ${data_path} ${user}=${ASDC_DESIGNER_USER_ID} ${MY_ASDC_BE_ENDPOINT}=${ASDC_BE_ENDPOINT}
DR695Hccff30b2017-02-17 18:44:24 -0500878 ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500879 Log Creating session ${MY_ASDC_BE_ENDPOINT}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500880 ${session}= Create Session asdc ${MY_ASDC_BE_ENDPOINT} auth=${auth}
DR695Hccff30b2017-02-17 18:44:24 -0500881 ${uuid}= Generate UUID
882 ${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 Freeman2e1d0ff2019-01-23 09:38:13 -0500883 ${resp}= Get Request asdc ${data_path} headers=${headers}
DR695Hccff30b2017-02-17 18:44:24 -0500884 Log Received response from asdc ${resp.text}
885 [Return] ${resp}
886Run ASDC Put Request
887 [Documentation] Runs an ASDC put request
Brian Freeman44b8bb32018-05-03 21:08:42 -0500888 [Arguments] ${data_path} ${data} ${user}=${ASDC_DESIGNER_USER_ID} ${MY_ASDC_BE_ENDPOINT}=${ASDC_BE_ENDPOINT}
DR695Hccff30b2017-02-17 18:44:24 -0500889 ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500890 Log Creating session ${MY_ASDC_BE_ENDPOINT}
891 ${session}= Create Session asdc ${MY_ASDC_BE_ENDPOINT} auth=${auth}
DR695Hccff30b2017-02-17 18:44:24 -0500892 ${uuid}= Generate UUID
893 ${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 Freeman2e1d0ff2019-01-23 09:38:13 -0500894 ${resp}= Put Request asdc ${data_path} data=${data} headers=${headers}
DR695Hccff30b2017-02-17 18:44:24 -0500895 Log Received response from asdc ${resp.text}
896 [Return] ${resp}
Jerry Flood6bd1afa2017-10-09 09:59:23 -0400897
DR695Hccff30b2017-02-17 18:44:24 -0500898Run ASDC Post Files Request
899 [Documentation] Runs an ASDC post request
Brian Freeman44b8bb32018-05-03 21:08:42 -0500900 [Arguments] ${data_path} ${files} ${user}=${ASDC_DESIGNER_USER_ID} ${MY_ASDC_BE_ENDPOINT}=${ASDC_BE_ENDPOINT}
DR695Hccff30b2017-02-17 18:44:24 -0500901 ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500902 Log Creating session ${MY_ASDC_BE_ENDPOINT}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500903 ${session}= Create Session asdc ${MY_ASDC_BE_ENDPOINT} auth=${auth}
DR695Hccff30b2017-02-17 18:44:24 -0500904 ${uuid}= Generate UUID
905 ${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 Freeman2e1d0ff2019-01-23 09:38:13 -0500906 ${resp}= Post Request asdc ${data_path} files=${files} headers=${headers}
907 Log Received response from asdc ${resp.text}
908 [Return] ${resp}
909
910Run ASDC MD5 Post Request
911 [Documentation] Runs an ASDC post request with MD5 Checksum header
912 [Arguments] ${data_path} ${data} ${user}=${ASDC_DESIGNER_USER_ID} ${MY_ASDC_BE_ENDPOINT}=${ASDC_BE_ENDPOINT}
913 ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD}
914 Log Creating session ${MY_ASDC_BE_ENDPOINT}
915 ${session}= Create Session asdc ${MY_ASDC_BE_ENDPOINT} auth=${auth}
916 ${uuid}= Generate UUID
917 ${data_string}= Evaluate json.dumps(${data}) json
918 ${md5checksum}= Evaluate md5.new('''${data_string}''').hexdigest() modules=md5
919 ${base64md5checksum}= Evaluate base64.b64encode("${md5checksum}") modules=base64
920 ${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}
921 ${resp}= Post Request asdc ${data_path} data=${data} headers=${headers}
DR695Hccff30b2017-02-17 18:44:24 -0500922 Log Received response from asdc ${resp.text}
Jerry Floode2a48d72017-06-21 15:06:29 -0400923 [Return] ${resp}
Jerry Flood6bd1afa2017-10-09 09:59:23 -0400924
DR695Hccff30b2017-02-17 18:44:24 -0500925Run ASDC Post Request
926 [Documentation] Runs an ASDC post request
Brian Freeman44b8bb32018-05-03 21:08:42 -0500927 [Arguments] ${data_path} ${data} ${user}=${ASDC_DESIGNER_USER_ID} ${MY_ASDC_BE_ENDPOINT}=${ASDC_BE_ENDPOINT}
DR695Hccff30b2017-02-17 18:44:24 -0500928 ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500929 Log Creating session ${MY_ASDC_BE_ENDPOINT}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500930 ${session}= Create Session asdc ${MY_ASDC_BE_ENDPOINT} auth=${auth}
DR695Hccff30b2017-02-17 18:44:24 -0500931 ${uuid}= Generate UUID
932 ${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 Freeman2e1d0ff2019-01-23 09:38:13 -0500933 ${resp}= Post Request asdc ${data_path} data=${data} headers=${headers}
DR695Hccff30b2017-02-17 18:44:24 -0500934 Log Received response from asdc ${resp.text}
Jerry Floode2a48d72017-06-21 15:06:29 -0400935 [Return] ${resp}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500936
DR695Hccff30b2017-02-17 18:44:24 -0500937Run ASDC Delete Request
938 [Documentation] Runs an ASDC delete request
Brian Freeman44b8bb32018-05-03 21:08:42 -0500939 [Arguments] ${data_path} ${user}=${ASDC_DESIGNER_USER_ID} ${MY_ASDC_BE_ENDPOINT}=${ASDC_BE_ENDPOINT}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500940 ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500941 Log Creating session ${MY_ASDC_BE_ENDPOINT}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500942 ${session}= Create Session asdc ${MY_ASDC_BE_ENDPOINT} auth=${auth}
DR695Hccff30b2017-02-17 18:44:24 -0500943 ${uuid}= Generate UUID
944 ${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 Freeman2e1d0ff2019-01-23 09:38:13 -0500945 ${resp}= Delete Request asdc ${data_path} headers=${headers}
DR695Hccff30b2017-02-17 18:44:24 -0500946 Log Received response from asdc ${resp.text}
Jerry Floode2a48d72017-06-21 15:06:29 -0400947 [Return] ${resp}
DR695Hccff30b2017-02-17 18:44:24 -0500948Open ASDC GUI
949 [Documentation] Logs in to ASDC GUI
950 [Arguments] ${PATH}
951 ## Setup Browever now being managed by the test case
952 ##Setup Browser
DR695Hbf5a3a32017-06-30 13:09:57 -0400953 Go To ${ASDC_FE_ENDPOINT}${PATH}
DR695Hccff30b2017-02-17 18:44:24 -0500954 Maximize Browser Window
Jerry Flood6bd1afa2017-10-09 09:59:23 -0400955
DR695Hccff30b2017-02-17 18:44:24 -0500956 Set Browser Implicit Wait ${GLOBAL_SELENIUM_BROWSER_IMPLICIT_WAIT}
DR695Hbf5a3a32017-06-30 13:09:57 -0400957 Log Logging in to ${ASDC_FE_ENDPOINT}${PATH}
DR695Hccff30b2017-02-17 18:44:24 -0500958 Title Should Be ASDC
Jerry Floode2a48d72017-06-21 15:06:29 -0400959 Wait Until Page Contains Element xpath=//div/a[text()='SDC'] ${GLOBAL_SELENIUM_BROWSER_WAIT_TIMEOUT}
DR695Hbf5a3a32017-06-30 13:09:57 -0400960 Log Logged in to ${ASDC_FE_ENDPOINT}${PATH}
Jerry Flood6bd1afa2017-10-09 09:59:23 -0400961
962
963Create Multi Part
964 [Arguments] ${addTo} ${partName} ${filePath} ${contentType}=${None}
965 ${fileData}= Get Binary File ${filePath}
966 ${fileDir} ${fileName}= Split Path ${filePath}
967 ${partData}= Create List ${fileName} ${fileData} ${contentType}
968 Set To Dictionary ${addTo} ${partName}=${partData}
Brian Freemanf940ee92018-05-25 21:09:05 -0500969