blob: 3ba4b5c23c6cd2f1c3c1cc9a898df5d93dbfcd77 [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
Brian Freemanee02b312019-02-04 20:36:08 -050079 ##### 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
DR695Hccff30b2017-02-17 18:44:24 -050089 : FOR ${zip} IN @{model_zip_path}
Yang Xu2ec80382018-11-01 12:30:37 -040090 \ ${loop_catalog_resource_id}= Setup ASDC Catalog Resource ${zip} ${cds}
Brian Freemanee02b312019-02-04 20:36:08 -050091 # zip can be vFW.zip or vFWDT_VFWSNK.zip
92 \ ${resource_type_match}= Get Regexp Matches ${zip} ${service}_(.*)\.zip 1
Brian Freeman12ff1842019-02-13 13:54:48 -050093 # Need to be able to distribute preload for vFWCL vFWSNK and vFWDT vFWSNK to prepend service to vnf_type
94 \ ${resource_type_string}= Set Variable If len(${resource_type_match})==0 ${service} ${service}${resource_type_match[0]}
Brian Freemanee02b312019-02-04 20:36:08 -050095 \ Set To Dictionary ${resource_types} ${resource_type_string} ${loop_catalog_resource_id}
Jerry Floode2a48d72017-06-21 15:06:29 -040096 \ Append To List ${catalog_resource_ids} ${loop_catalog_resource_id}
Brian Freemanee02b312019-02-04 20:36:08 -050097
98
99 ${vnflist}= Get From Dictionary ${GLOBAL_SERVICE_VNF_MAPPING} ${service}
100
101 # Spread the icons on the pallette starting on the left
102 ${xoffset}= Set Variable ${0}
103
104 : FOR ${vnf} IN @{vnflist}
Brian Freemanee02b312019-02-04 20:36:08 -0500105 \ ${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 Freemaneef7c6f2018-11-16 18:42:21 -0500109 #
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 Freemaneef7c6f2018-11-16 18:42:21 -0500115 ${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 Freemaneef7c6f2018-11-16 18:42:21 -0500120 \ ${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}
DR695Hccff30b2017-02-17 18:44:24 -0500125 ${catalog_service_resp}= Get ASDC Catalog Service ${catalog_service_id}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500126 #
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}
DR695Hccff30b2017-02-17 18:44:24 -0500133 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 Freeman796b9eb2018-10-08 08:23:20 -0500139 : FOR ${DIST_INDEX} IN RANGE 1
Brian Freeman18df8912018-05-25 13:27:29 -0500140 \ 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 Freemanf940ee92018-05-25 21:09:05 -0500143 \ ${status} ${_} = Run Keyword And Ignore Error Loop Over Check Catalog Service Distributed ${catalog_service_resp['uuid']}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500144 \ Exit For Loop If '${status}'=='PASS'
Brian Freeman8c002d52018-07-30 19:35:36 -0500145 Should Be Equal As Strings ${status} PASS
Jerry Flood3a169a32017-12-01 12:39:10 -0500146 [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 -0500147
bdfreeman1421b2a49512018-11-25 07:32:19 -0500148Distribute 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 Freeman9c42ae12018-11-27 14:33:27 -0500152 #${random}= Get Current Date
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500153 ${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}
bdfreeman1421b2a49512018-11-25 07:32:19 -0500158 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 Xu7037e542018-12-28 01:19:26 -0500177 # Create /tmp/vcpe_allotted_resource_data.json with demo vgmux and brgemu CSARs
178 Create Allotted Resource Data File
bdfreeman1421b2a49512018-11-25 07:32:19 -0500179 ${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}
bdfreeman1421b2a49512018-11-25 07:32:19 -0500207 \ ${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']}
bdfreeman1421b2a49512018-11-25 07:32:19 -0500209 \ 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 Freeman2e1d0ff2019-01-23 09:38:13 -0500222 \ Exit For Loop If '${status}'=='PASS'
bdfreeman1421b2a49512018-11-25 07:32:19 -0500223 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 Xu7037e542018-12-28 01:19:26 -0500227Create 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 Xu7037e542018-12-28 01:19:26 -0500250
bdfreeman14211ad11d92018-11-17 18:47:37 +0000251Download CSAR
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500252 [Documentation] Download CSAR
bdfreeman14211ad11d92018-11-17 18:47:37 +0000253 [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 Freeman2e1d0ff2019-01-23 09:38:13 -0500262 Log To Console Downloaded:${csar_file_name}
bdfreeman14211ad11d92018-11-17 18:47:37 +0000263 [Return]
264
Brian Freemaneef7c6f2018-11-16 18:42:21 -0500265
266Get Generic NeutronNet UUID
267 [Documentation] Lookoup the UUID of the Generic NeutronNetwork Resource
Brian Freemaneef7c6f2018-11-16 18:42:21 -0500268 ${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
bdfreeman1421b2a49512018-11-25 07:32:19 -0500271Get 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 Freeman18df8912018-05-25 13:27:29 -0500277Loop Over Check Catalog Service Distributed
Gary Wu58d58532018-07-27 16:02:51 -0700278 [Arguments] ${catalog_service_id}
Brian Freemanadaa2372018-10-24 12:25:22 -0500279 # SO watchdog timeout is 300 seconds need buffer
bdfreeman1421b2a49512018-11-25 07:32:19 -0500280 ${dist_status}= Set Variable CONTINUE
281 : FOR ${CHECK_INDEX} IN RANGE 20
Brian Freemanadaa2372018-10-24 12:25:22 -0500282 \ ${status} ${_} = Run Keyword And Ignore Error Check Catalog Service Distributed ${catalog_service_id} ${dist_status}
Gary Wu58d58532018-07-27 16:02:51 -0700283 \ Sleep 20s
Brian Freemanf940ee92018-05-25 21:09:05 -0500284 \ Return From Keyword If '${status}'=='PASS'
bdfreeman1421b2a49512018-11-25 07:32:19 -0500285 # 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 Freeman18df8912018-05-25 13:27:29 -0500289
DR695Hccff30b2017-02-17 18:44:24 -0500290Setup ASDC Catalog Resource
291 [Documentation] Creates all the steps a vf needs for an asdc catalog resource and returns the id
Yang Xu2ec80382018-11-01 12:30:37 -0400292 [Arguments] ${model_zip_path} ${cds}=
Brian Freemanb568e5e2018-04-05 21:03:38 -0500293 ${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 Freeman9c42ae12018-11-27 14:33:27 -0500300 ${matches}= Get Regexp Matches ${model_zip_path} temp/(.*)\.zip 1
301 ${software_product_name_prefix}= Set Variable ${matches[0]}
302 ${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 -0500303 Upload ASDC Heat Package ${software_product_id} ${model_zip_path} ${software_product_version_id}
304 Validate ASDC Software Product ${software_product_id} ${software_product_version_id}
305 Submit ASDC Software Product ${software_product_id} ${software_product_version_id}
306 Package ASDC Software Product ${software_product_id} ${software_product_version_id}
307 ${software_product_resp}= Get ASDC Software Product ${software_product_id} ${software_product_version_id}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500308 ${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 -0400309 # Check if need to set up CDS properties
310 Run Keyword If '${cds}' == 'vfwng' Setup ASDC Catalog Resource CDS Properties ${catalog_resource_id}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500311
Brian Freeman391680a2018-08-11 15:20:58 -0500312 ${catalog_resource_id}= Certify ASDC Catalog Resource ${catalog_resource_id} ${ASDC_DESIGNER_USER_ID}
DR695Hccff30b2017-02-17 18:44:24 -0500313 [Return] ${catalog_resource_id}
Brian Freemaneef7c6f2018-11-16 18:42:21 -0500314
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500315
316Setup SDC Catalog Resource Deployment Artifact Properties
317 [Documentation] Set up Deployment Artiface properties
318 [Arguments] ${catalog_service_id} ${catalog_parent_service_id} ${catalog_resource_unique_id} ${blueprint_file}
319 ${resp}= Get ASDC Catalog Resource Component Instances Properties ${catalog_service_id}
320 #${resp}= Get ASDC Catalog Resource Deployment Artifact Properties ${catalog_service_id}
321 ${blueprint_data} Get File ${SDC_CATALOG_DEPLOYMENT_ARTIFACT_PATH}${blueprint_file}
322 ${payloadData}= Evaluate base64.b64encode('''${blueprint_data}'''.encode('utf-8')) modules=base64
323 ${dict}= Create Dictionary artifactLabel=blueprint artifactName=${blueprint_file} artifactType=DCAE_INVENTORY_BLUEPRINT artifactGroupType=DEPLOYMENT description=${blueprint_file} payloadData=${payloadData}
324 ${data}= Fill JSON Template File ${ASDC_ARTIFACT_UPLOAD_TEMPLATE} ${dict}
325 # POST artifactUpload to resource
326 ${artifact_upload_path}= Catenate ${ASDC_CATALOG_SERVICES_PATH}/${catalog_service_id}/resourceInstance/${catalog_resource_unique_id}${ASDC_CATALOG_SERVICE_RESOURCE_ARTIFACT_PATH}
327 ${resp}= Run ASDC MD5 Post Request ${artifact_upload_path} ${data} ${ASDC_DESIGNER_USER_ID}
328 Should Be Equal As Strings ${resp.status_code} 200
329 [Return] ${resp}
330
331
Brian Freemaneef7c6f2018-11-16 18:42:21 -0500332Setup SDC Catalog Resource GenericNeutronNet Properties
bdfreeman1421b2a49512018-11-25 07:32:19 -0500333 [Documentation] Set up GenericNeutronNet properties and inputs
Brian Freemaneef7c6f2018-11-16 18:42:21 -0500334 [Arguments] ${catalog_service_id} ${nf_role} ${catalog_parent_service_id}
Brian Freemaneef7c6f2018-11-16 18:42:21 -0500335 ${resp}= Get ASDC Catalog Resource Component Instances Properties ${catalog_service_id}
Brian Freemaneef7c6f2018-11-16 18:42:21 -0500336 ${componentInstances} Set Variable @{resp['componentInstancesProperties']}
337 # componentInstances can have 1 or more than 1 entry
338 ${passed}= Run Keyword And Return Status Evaluate type(${componentInstances})
339 ${type}= Run Keyword If ${passed} Evaluate type(${componentInstances})
340 ${componentInstancesList}= Run Keyword If "${type}"!="<type 'list'>" Create List ${componentInstances}
341 ... ELSE Set Variable ${componentInstances}
342 :FOR ${item} IN @{componentInstancesList}
343 \ ${test} ${v}= Run Keyword and Ignore Error Should Contain ${item} ${nf_role}
344 \ Run Keyword If '${test}' == 'FAIL' Continue For Loop
345 \ ${componentInstance1}= Set Variable ${item}
346 :FOR ${comp} IN @{resp['componentInstancesProperties']["${componentInstance1}"]}
347 \ ${name} Set Variable ${comp['name']}
348 \ ${test} ${v}= Run Keyword and Ignore Error Should Contain ${name} network_role
349 \ Run Keyword If '${test}' == 'FAIL' Continue For Loop
350 \ ${description} Set Variable ${comp['description']}
351 \ ${description}= Replace String ${description} ${\n} \
352 \ ${uniqueId} Set Variable ${comp['uniqueId']}
353 \ ${parentUniqueId} Set Variable ${comp['parentUniqueId']}
354 \ ${ownerId} Set Variable ${comp['ownerId']}
355 \ ${dict}= Create Dictionary parentUniqueId=${parentUniqueId} ownerId=${ownerId} uniqueId=${uniqueId} description=${description}
356 \ Run Keyword If '${name}'=='network_role' Set To Dictionary ${dict} name=${name} value=${nf_role}
bdfreeman1421b2a49512018-11-25 07:32:19 -0500357 \ ${data}= Fill JSON Template File ${SDC_CATALOG_NET_RESOURCE_INPUT_TEMPLATE} ${dict}
Brian Freemaneef7c6f2018-11-16 18:42:21 -0500358 \ ${response}= Set ASDC Catalog Resource Component Instance Properties ${catalog_parent_service_id} ${catalog_service_id} ${data}
359 #\ Log To Console resp=${response}
360 [Return]
361
bdfreeman1421b2a49512018-11-25 07:32:19 -0500362
363Setup SDC Catalog Resource AllottedResource Properties
364 [Documentation] Set up Allotted Resource properties and inputs
365 [Arguments] ${catalog_service_id} ${nf_role} ${catalog_resource_id} ${invariantUUID} ${UUID} ${node_type}
366 # Set component instances properties
367 ${nf_role_lc}= Convert To Lowercase ${nf_role}
368 ${resp}= Get ASDC Catalog Resource Component Instances Properties For Resource ${catalog_resource_id}
369 ${componentInstances} Set Variable @{resp['componentInstancesProperties']}
370 # componentInstances can have 1 or more than 1 entry
371 ${passed}= Run Keyword And Return Status Evaluate type(${componentInstances})
372 ${type}= Run Keyword If ${passed} Evaluate type(${componentInstances})
373 ${componentInstancesList}= Run Keyword If "${type}"!="<type 'list'>" Create List ${componentInstances}
374 ... ELSE Set Variable ${componentInstances}
375 :FOR ${item} IN @{componentInstancesList}
376 \ ${test} ${v}= Run Keyword and Ignore Error Should Contain ${item} ${nf_role_lc}
377 \ Run Keyword If '${test}' == 'FAIL' Continue For Loop
378 \ ${componentInstance1}= Set Variable ${item}
379 ${dict}= Create Dictionary
380 :FOR ${comp} IN @{resp['componentInstancesProperties']["${componentInstance1}"]}
381 \ ${name} Set Variable ${comp['name']}
382 \ ${test} ${v}= Run Keyword and Ignore Error Should Contain Any ${name} network_role providing_service_invariant_uuid providing_service_uuid providing_service_name uniqueId
383 \ Run Keyword If '${test}' == 'FAIL' Continue For Loop
384 \ ${parentUniqueId} Set Variable ${comp['parentUniqueId']}
385 \ ${ownerId} Set Variable ${comp['ownerId']}
386 \ Set To Dictionary ${dict} parentUniqueId=${parentUniqueId} ownerId=${ownerId}
387 \ Run Keyword If '${name}'=='providing_service_invariant_uuid' Set To Dictionary ${dict} providing_service_invariant_uuid=${invariantUUID}
388 \ Run Keyword If '${name}'=='providing_service_uuid' Set To Dictionary ${dict} providing_service_uuid=${UUID}
389 \ Run Keyword If '${name}'=='providing_service_name' Set To Dictionary ${dict} providing_service_name=${node_type}
390 # Sets it for each loop but should be one
391 \ ${uniqueId} Set Variable ${comp['uniqueId']}
392 \ ${uniqueId} Fetch From Left ${uniqueId} .
393 \ Set To Dictionary ${dict} uniqueId=${uniqueId}
394 ${data}= Fill JSON Template File ${SDC_CATALOG_ALLOTTED_RESOURCE_PROPERTIES_TEMPLATE} ${dict}
395 ${response}= Set ASDC Catalog Resource Component Instance Properties For Resource ${catalog_resource_id} ${componentInstance1} ${data}
396 Log To Console resp=${response}
397
398
399Setup SDC Catalog Resource AllottedResource Inputs
400 [Documentation] Set up Allotted Resource inputs
401 [Arguments] ${catalog_service_id} ${nf_role} ${catalog_resource_id}
402 # Set vnf inputs
403 ${resp}= Get ASDC Catalog Resource Inputs ${catalog_resource_id}
404 ${dict}= Create Dictionary
405 :FOR ${comp} in @{resp['inputs']}
406 \ ${name} Set Variable ${comp['name']}
407 \ ${uid} Set Variable ${comp['uniqueId']}
408 \ Run Keyword If '${name}'=='nf_type' Set To Dictionary ${dict} nf_type=${nf_role} nf_type_uid=${uid}
409 \ Run Keyword If '${name}'=='nf_role' Set To Dictionary ${dict} nf_role=${nf_role} nf_role_uid=${uid}
410 ${data}= Fill JSON Template File ${SDC_CATALOG_ALLOTTED_RESOURCE_INPUTS_TEMPLATE} ${dict}
411 ${response}= Set ASDC Catalog Resource VNF Inputs ${catalog_resource_id} ${data}
412 [Return] ${response}
413
Yang Xu2ec80382018-11-01 12:30:37 -0400414Setup ASDC Catalog Resource CDS Properties
415 [Documentation] Set up vfwng VNF properties and inputs for CDS
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500416 [Arguments] ${catalog_resource_id}
Yang Xu2ec80382018-11-01 12:30:37 -0400417 # Set vnf module properties
418 ${resp}= Get ASDC Catalog Resource Component Instances ${catalog_resource_id}
419 :FOR ${comp} in @{resp['componentInstances']}
420 \ ${name} Set Variable ${comp['name']}
421 \ ${uniqueId} Set Variable ${comp['uniqueId']}
422 \ ${actualComponentUid} Set Variable ${comp['actualComponentUid']}
423 \ ${test} ${v}= Run Keyword and Ignore Error Should Contain ${name} abstract_
424 \ Run Keyword If '${test}' == 'FAIL' Continue For Loop
425 \ ${response}= Get ASDC Catalog Resource Component Instance Properties ${catalog_resource_id} ${uniqueId} ${actualComponentUid}
426 \ ${dict}= Create Dictionary parent_id=${response[6]['parentUniqueId']}
427 \ Run Keyword If '${name}'=='abstract_vfw' Set To Dictionary ${dict} nfc_function=vfw nfc_naming_policy=SDNC_Policy.ONAP_VFW_NAMING_TIMESTAMP
428 \ Run Keyword If '${name}'=='abstract_vpg' Set To Dictionary ${dict} nfc_function=vpg nfc_naming_policy=SDNC_Policy.ONAP_VPG_NAMING_TIMESTAMP
429 \ 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 -0500430 \ ${data}= Fill JSON Template File ${ASDC_RESOURCE_INSTANCE_VNF_PROPERTIES_TEMPLATE} ${dict}
431 \ ${response}= Set ASDC Catalog Resource Component Instance Properties ${catalog_resource_id} ${uniqueId} ${data}
Yang Xu2ec80382018-11-01 12:30:37 -0400432 \ Log To Console resp=${response}
433
434 # Set vnf inputs
435 ${resp}= Get ASDC Catalog Resource Inputs ${catalog_resource_id}
436 ${dict}= Create Dictionary
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500437 :FOR ${comp} in @{resp['inputs']}
Yang Xu2ec80382018-11-01 12:30:37 -0400438 \ ${name} Set Variable ${comp['name']}
439 \ ${uid} Set Variable ${comp['uniqueId']}
440 \ Run Keyword If '${name}'=='nf_function' Set To Dictionary ${dict} nf_function=ONAP-FIREWALL nf_function_uid=${uid}
441 \ Run Keyword If '${name}'=='nf_type' Set To Dictionary ${dict} nf_type=FIREWALL nf_type_uid=${uid}
442 \ Run Keyword If '${name}'=='nf_naming_code' Set To Dictionary ${dict} nf_naming_code=vfw nf_naming_code_uid=${uid}
443 \ Run Keyword If '${name}'=='nf_role' Set To Dictionary ${dict} nf_role=vFW nf_role_uid=${uid}
444 \ Run Keyword If '${name}'=='cloud_env' Set To Dictionary ${dict} cloud_env=openstack cloud_env_uid=${uid}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500445 ${data}= Fill JSON Template File ${ASDC_RESOURCE_INSTANCE_VNF_INPUTS_TEMPLATE} ${dict}
Yang Xu2ec80382018-11-01 12:30:37 -0400446 ${response}= Set ASDC Catalog Resource VNF Inputs ${catalog_resource_id} ${data}
447
DR695Hccff30b2017-02-17 18:44:24 -0500448Add ASDC License Model
449 [Documentation] Creates an asdc license model and returns its id
Jerry Floode2a48d72017-06-21 15:06:29 -0400450 ${uuid}= Generate UUID
451 ${shortened_uuid}= Evaluate str("${uuid}")[:23]
DR695Hccff30b2017-02-17 18:44:24 -0500452 ${map}= Create Dictionary vendor_name=${shortened_uuid}
453 ${data}= Fill JSON Template File ${ASDC_LICENSE_MODEL_TEMPLATE} ${map}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500454 ${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 -0500455 Should Be Equal As Strings ${resp.status_code} 200
Brian Freemanb568e5e2018-04-05 21:03:38 -0500456 [Return] ${resp.json()['itemId']} ${resp.json()['version']['id']}
DR695Hccff30b2017-02-17 18:44:24 -0500457Get ASDC License Model
458 [Documentation] gets an asdc license model by its id
Jerry Floode2a48d72017-06-21 15:06:29 -0400459 [Arguments] ${id} ${version_id}=0.1
Brian Freeman44b8bb32018-05-03 21:08:42 -0500460 ${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 -0400461 [Return] ${resp.json()}
462Get ASDC License Models
463 [Documentation] gets an asdc license model by its id
Brian Freeman44b8bb32018-05-03 21:08:42 -0500464 ${resp}= Run ASDC Get Request ${ASDC_VENDOR_LICENSE_MODEL_PATH} ${ASDC_DESIGNER_USER_ID} ${ASDC_BE_ONBOARD_ENDPOINT}
465
DR695Hccff30b2017-02-17 18:44:24 -0500466 [Return] ${resp.json()}
467Checkin ASDC License Model
468 [Documentation] checksin an asdc license model by its id
Jerry Floode2a48d72017-06-21 15:06:29 -0400469 [Arguments] ${id} ${version_id}=0.1
DR695Hccff30b2017-02-17 18:44:24 -0500470 ${map}= Create Dictionary action=Checkin
471 ${data}= Fill JSON Template File ${ASDC_ACTION_TEMPLATE} ${map}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500472 ${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}
473 Should Be Equal As Strings ${resp.status_code} 200
DR695Hccff30b2017-02-17 18:44:24 -0500474 [Return] ${resp.json()}
475Submit ASDC License Model
476 [Documentation] submits an asdc license model by its id
Jerry Floode2a48d72017-06-21 15:06:29 -0400477 [Arguments] ${id} ${version_id}=0.1
DR695Hccff30b2017-02-17 18:44:24 -0500478 ${map}= Create Dictionary action=Submit
479 ${data}= Fill JSON Template File ${ASDC_ACTION_TEMPLATE} ${map}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500480 ${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 -0500481 Should Be Equal As Strings ${resp.status_code} 200
DR695Hccff30b2017-02-17 18:44:24 -0500482 [Return] ${resp.json()}
483Checkin ASDC Software Product
484 [Documentation] checksin an asdc Software Product by its id
Jerry Floode2a48d72017-06-21 15:06:29 -0400485 [Arguments] ${id} ${version_id}=0.1
DR695Hccff30b2017-02-17 18:44:24 -0500486 ${map}= Create Dictionary action=Checkin
Jerry Floode2a48d72017-06-21 15:06:29 -0400487 ${data}= Fill JSON Template File ${ASDC_ACTION_TEMPLATE} ${map}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500488 ${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 -0500489 Should Be Equal As Strings ${resp.status_code} 200
Jerry Floode2a48d72017-06-21 15:06:29 -0400490 [Return] ${resp.json()}
491Validate ASDC Software Product
492 [Documentation] checksin an asdc Software Product by its id
493 [Arguments] ${id} ${version_id}=0.1
494 ${data}= Catenate
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500495 ${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}
496 Should Be Equal As Strings ${resp.status_code} 200
DR695Hccff30b2017-02-17 18:44:24 -0500497 [Return] ${resp.json()}
498Submit ASDC Software Product
499 [Documentation] submits an asdc Software Product by its id
Jerry Floode2a48d72017-06-21 15:06:29 -0400500 [Arguments] ${id} ${version_id}=0.1
DR695Hccff30b2017-02-17 18:44:24 -0500501 ${map}= Create Dictionary action=Submit
Jerry Floode2a48d72017-06-21 15:06:29 -0400502 ${data}= Fill JSON Template File ${ASDC_ACTION_TEMPLATE} ${map}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500503 ${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}
504 Should Be Equal As Strings ${resp.status_code} 200
DR695Hccff30b2017-02-17 18:44:24 -0500505 [Return] ${resp.json()}
506Package ASDC Software Product
507 [Documentation] creates_package on an asdc Software Product by its id
Jerry Floode2a48d72017-06-21 15:06:29 -0400508 [Arguments] ${id} ${version_id}=0.1
DR695Hccff30b2017-02-17 18:44:24 -0500509 ${map}= Create Dictionary action=Create_Package
Jerry Floode2a48d72017-06-21 15:06:29 -0400510 ${data}= Fill JSON Template File ${ASDC_ACTION_TEMPLATE} ${map}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500511 ${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}
512 Should Be Equal As Strings ${resp.status_code} 200
Jerry Floode2a48d72017-06-21 15:06:29 -0400513 [Return] ${resp.json()}
DR695Hccff30b2017-02-17 18:44:24 -0500514Add ASDC Entitlement Pool
515 [Documentation] Creates an asdc Entitlement Pool and returns its id
Jerry Floode2a48d72017-06-21 15:06:29 -0400516 [Arguments] ${license_model_id} ${version_id}=0.1
517 ${uuid}= Generate UUID
518 ${shortened_uuid}= Evaluate str("${uuid}")[:23]
DR695Hccff30b2017-02-17 18:44:24 -0500519 ${map}= Create Dictionary entitlement_pool_name=${shortened_uuid}
Jerry Floode2a48d72017-06-21 15:06:29 -0400520 ${data}= Fill JSON Template File ${ASDC_ENTITLEMENT_POOL_TEMPLATE} ${map}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500521 ${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}
522 Should Be Equal As Strings ${resp.status_code} 200
DR695Hccff30b2017-02-17 18:44:24 -0500523 [Return] ${resp.json()['value']}
524Get ASDC Entitlement Pool
525 [Documentation] gets an asdc Entitlement Pool by its id
526 [Arguments] ${license_model_id} ${pool_id}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500527 ${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 -0500528 [Return] ${resp.json()}
529Add ASDC License Group
530 [Documentation] Creates an asdc license group and returns its id
Brian Freemanb568e5e2018-04-05 21:03:38 -0500531 [Arguments] ${license_model_id} ${version_id}=1.0
Jerry Floode2a48d72017-06-21 15:06:29 -0400532 ${uuid}= Generate UUID
533 ${shortened_uuid}= Evaluate str("${uuid}")[:23]
DR695Hccff30b2017-02-17 18:44:24 -0500534 ${map}= Create Dictionary key_group_name=${shortened_uuid}
Jerry Floode2a48d72017-06-21 15:06:29 -0400535 ${data}= Fill JSON Template File ${ASDC_KEY_GROUP_TEMPLATE} ${map}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500536 ${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}
537 Should Be Equal As Strings ${resp.status_code} 200
DR695Hccff30b2017-02-17 18:44:24 -0500538 [Return] ${resp.json()['value']}
539Get ASDC License Group
540 [Documentation] gets an asdc license group by its id
Jerry Floode2a48d72017-06-21 15:06:29 -0400541 [Arguments] ${license_model_id} ${group_id} ${version_id}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500542 ${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 -0500543 [Return] ${resp.json()}
544Add ASDC Feature Group
545 [Documentation] Creates an asdc Feature Group and returns its id
Jerry Floode2a48d72017-06-21 15:06:29 -0400546 [Arguments] ${license_model_id} ${key_group_id} ${entitlement_pool_id} ${version_id}=0.1
547 ${uuid}= Generate UUID
548 ${shortened_uuid}= Evaluate str("${uuid}")[:23]
Jerry Flood80ff9852017-08-11 06:47:14 -0400549 ${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 -0400550 ${data}= Fill JSON Template File ${ASDC_FEATURE_GROUP_TEMPLATE} ${map}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500551 ${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}
552 Should Be Equal As Strings ${resp.status_code} 200
DR695Hccff30b2017-02-17 18:44:24 -0500553 [Return] ${resp.json()['value']}
554Get ASDC Feature Group
555 [Documentation] gets an asdc Feature Group by its id
556 [Arguments] ${license_model_id} ${group_id}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500557 ${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 -0500558 [Return] ${resp.json()}
559Add ASDC License Agreement
560 [Documentation] Creates an asdc License Agreement and returns its id
Jerry Floode2a48d72017-06-21 15:06:29 -0400561 [Arguments] ${license_model_id} ${feature_group_id} ${version_id}=0.1
562 ${uuid}= Generate UUID
563 ${shortened_uuid}= Evaluate str("${uuid}")[:23]
DR695Hccff30b2017-02-17 18:44:24 -0500564 ${map}= Create Dictionary license_agreement_name=${shortened_uuid} feature_group_id=${feature_group_id}
Jerry Floode2a48d72017-06-21 15:06:29 -0400565 ${data}= Fill JSON Template File ${ASDC_LICENSE_AGREEMENT_TEMPLATE} ${map}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500566 ${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}
567 Should Be Equal As Strings ${resp.status_code} 200
DR695Hccff30b2017-02-17 18:44:24 -0500568 [Return] ${resp.json()['value']}
569Get ASDC License Agreement
570 [Documentation] gets an asdc License Agreement by its id
571 [Arguments] ${license_model_id} ${agreement_id}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500572 ${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 -0500573 [Return] ${resp.json()}
574Add ASDC Software Product
575 [Documentation] Creates an asdc Software Product and returns its id
Brian Freeman9c42ae12018-11-27 14:33:27 -0500576 [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 -0400577 ${uuid}= Generate UUID
Brian Freeman9c42ae12018-11-27 14:33:27 -0500578 ${shortened_uuid}= Evaluate str("${uuid}")[:13]
579 ${software_product_name}= Catenate ${name_prefix} ${shortened_uuid}
580 ${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 -0400581 ${data}= Fill JSON Template File ${ASDC_SOFTWARE_PRODUCT_TEMPLATE} ${map}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500582 ${resp}= Run ASDC Post Request ${ASDC_VENDOR_SOFTWARE_PRODUCT_PATH} ${data} ${ASDC_DESIGNER_USER_ID} ${ASDC_BE_ONBOARD_ENDPOINT}
583 Should Be Equal As Strings ${resp.status_code} 200
Brian Freemanb568e5e2018-04-05 21:03:38 -0500584 [Return] ${resp.json()['itemId']} ${resp.json()['version']['id']}
DR695Hccff30b2017-02-17 18:44:24 -0500585Get ASDC Software Product
586 [Documentation] gets an asdc Software Product by its id
Jerry Floode2a48d72017-06-21 15:06:29 -0400587 [Arguments] ${software_product_id} ${version_id}=0.1
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500588 ${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 -0500589 [Return] ${resp.json()}
bdfreeman1421b2a49512018-11-25 07:32:19 -0500590
DR695Hccff30b2017-02-17 18:44:24 -0500591Add ASDC Catalog Resource
592 [Documentation] Creates an asdc Catalog Resource and returns its id
593 [Arguments] ${license_agreement_id} ${software_product_name} ${license_model_name} ${software_product_id}
594 ${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 -0400595 ${data}= Fill JSON Template File ${ASDC_CATALOG_RESOURCE_TEMPLATE} ${map}
bdfreeman1421b2a49512018-11-25 07:32:19 -0500596 ${resp}= Run ASDC Post Request ${ASDC_CATALOG_RESOURCES_PATH} ${data} ${ASDC_DESIGNER_USER_ID}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500597 Should Be Equal As Strings ${resp.status_code} 201
DR695Hccff30b2017-02-17 18:44:24 -0500598 [Return] ${resp.json()['uniqueId']}
bdfreeman1421b2a49512018-11-25 07:32:19 -0500599
600Add ASDC Allotted Resource Catalog Resource
601 [Documentation] Creates an asdc Allotted Resource Catalog Resource and returns its id
602 [Arguments] ${license_agreement_id} ${software_product_name} ${license_model_name} ${software_product_id} ${subcategory}
603 ${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}
604 ${data}= Fill JSON Template File ${ASDC_ALLOTTED_RESOURCE_CATALOG_RESOURCE_TEMPLATE} ${map}
605 ${resp}= Run ASDC Post Request ${ASDC_CATALOG_RESOURCES_PATH} ${data} ${ASDC_DESIGNER_USER_ID}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500606 Should Be Equal As Strings ${resp.status_code} 201
bdfreeman1421b2a49512018-11-25 07:32:19 -0500607 [Return] ${resp.json()['uniqueId']}
608
DR695Hccff30b2017-02-17 18:44:24 -0500609Mark ASDC Catalog Resource Inactive
610 [Documentation] deletes an asdc Catalog Resource
611 [Arguments] ${catalog_resource_id}
612 ${resp}= Run ASDC Delete Request ${ASDC_CATALOG_RESOURCES_PATH}/${catalog_resource_id} ${ASDC_DESIGNER_USER_ID}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500613 Should Be Equal As Strings ${resp.status_code} 204
DR695Hccff30b2017-02-17 18:44:24 -0500614 [Return] ${resp}
615Delete Inactive ASDC Catalog Resources
616 [Documentation] delete all asdc Catalog Resources that are inactive
617 ${resp}= Run ASDC Delete Request ${ASDC_CATALOG_INACTIVE_RESOURCES_PATH} ${ASDC_DESIGNER_USER_ID}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500618 Should Be Equal As Strings ${resp.status_code} 200
DR695Hccff30b2017-02-17 18:44:24 -0500619 [Return] ${resp.json()}
620Get ASDC Catalog Resource
621 [Documentation] gets an asdc Catalog Resource by its id
622 [Arguments] ${catalog_resource_id}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500623 ${resp}= Run ASDC Get Request ${ASDC_CATALOG_RESOURCES_PATH}/${catalog_resource_id} ${ASDC_DESIGNER_USER_ID}
DR695Hccff30b2017-02-17 18:44:24 -0500624 [Return] ${resp.json()}
Brian Freemaneef7c6f2018-11-16 18:42:21 -0500625
Yang Xu2ec80382018-11-01 12:30:37 -0400626Get ASDC Catalog Resource Component Instances
627 [Documentation] gets asdc Catalog Resource Component Instances by its id
628 [Arguments] ${catalog_resource_id}
629 ${resp}= Run ASDC Get Request ${ASDC_FE_CATALOG_RESOURCES_PATH}/${catalog_resource_id}/filteredDataByParams?include=componentInstances ${ASDC_DESIGNER_USER_ID} ${ASDC_FE_ENDPOINT}
630 [Return] ${resp.json()}
bdfreeman1421b2a49512018-11-25 07:32:19 -0500631
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500632Get ASDC Catalog Resource Deployment Artifact Properties
633 [Documentation] gets asdc Catalog Resource Deployment Artiface Properties by its id
634 [Arguments] ${catalog_resource_id}
635 #${resp}= Run ASDC Get Request ${ASDC_CATALOG_SERVICES_PATH}/${catalog_resource_id}/filteredDataByParams?include=componentInstances ${ASDC_DESIGNER_USER_ID} ${ASDC_FE_ENDPOINT}
636 ${resp}= Run ASDC Get Request ${ASDC_CATALOG_SERVICES_PATH}/${catalog_resource_id}/filteredDataByParams?include=deploymentArtifacts ${ASDC_DESIGNER_USER_ID} ${ASDC_FE_ENDPOINT}
637 [Return] ${resp.json()}
638
639
Brian Freemaneef7c6f2018-11-16 18:42:21 -0500640Get ASDC Catalog Resource Component Instances Properties
641 [Documentation] gets asdc Catalog Resource Component Instances Properties by its id
642 [Arguments] ${catalog_resource_id}
643 #${resp}= Run ASDC Get Request ${ASDC_FE_CATALOG_RESOURCES_PATH}/${catalog_resource_id}/filteredDataByParams?include=componentInstancesProperties ${ASDC_DESIGNER_USER_ID} ${ASDC_FE_ENDPOINT}
644 ${resp}= Run ASDC Get Request ${ASDC_CATALOG_SERVICES_PATH}/${catalog_resource_id}/filteredDataByParams?include=componentInstancesProperties ${ASDC_DESIGNER_USER_ID} ${ASDC_BE_ENDPOINT}
645 [Return] ${resp.json()}
646
bdfreeman1421b2a49512018-11-25 07:32:19 -0500647Get ASDC Catalog Resource Component Instances Properties For Resource
648 [Documentation] gets asdc Catalog Resource Component Instances Properties for a Resource (VF) by its id
649 [Arguments] ${catalog_resource_id}
650 ${resp}= Run ASDC Get Request ${ASDC_FE_CATALOG_RESOURCES_PATH}/${catalog_resource_id}/filteredDataByParams?include=componentInstancesProperties ${ASDC_DESIGNER_USER_ID} ${ASDC_FE_ENDPOINT}
651 [Return] ${resp.json()}
Brian Freemaneef7c6f2018-11-16 18:42:21 -0500652
Yang Xu2ec80382018-11-01 12:30:37 -0400653Get ASDC Catalog Resource Inputs
654 [Documentation] gets asdc Catalog Inputs by its id
655 [Arguments] ${catalog_resource_id}
656 ${resp}= Run ASDC Get Request ${ASDC_FE_CATALOG_RESOURCES_PATH}/${catalog_resource_id}/filteredDataByParams?include=inputs ${ASDC_DESIGNER_USER_ID} ${ASDC_FE_ENDPOINT}
657 [Return] ${resp.json()}
Brian Freemaneef7c6f2018-11-16 18:42:21 -0500658
Yang Xu2ec80382018-11-01 12:30:37 -0400659Get ASDC Catalog Resource Component Instance Properties
660 [Documentation] gets an asdc Catalog Resource properties by its id
661 [Arguments] ${catalog_resource_id} ${component_instance_id} ${component_id}
662 ${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}
663 [Return] ${resp.json()}
bdfreeman1421b2a49512018-11-25 07:32:19 -0500664
Yang Xu2ec80382018-11-01 12:30:37 -0400665Set ASDC Catalog Resource Component Instance Properties
666 [Documentation] sets an asdc Catalog Resource by its id
Brian Freemaneef7c6f2018-11-16 18:42:21 -0500667 [Arguments] ${catalog_resource_id} ${component_parent_service_id} ${data}
668 #${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}
669 ${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 -0500670 [Return] ${resp.json()}
671
672Set ASDC Catalog Resource Component Instance Properties For Resource
673 [Documentation] sets an asdc Catalog Resource by its id
674 [Arguments] ${catalog_parent_resource_id} ${catalog_resource_id} ${data}
675 #${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}
676 ${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}
677 [Return] ${resp.json()}
Brian Freemaneef7c6f2018-11-16 18:42:21 -0500678
Yang Xu74cfb862018-12-06 21:57:32 -0500679Set CDS Catalog Resource Component Instance Properties
680 [Documentation] sets an asdc Catalog Resource by its id
681 [Arguments] ${catalog_resource_id} ${component_instance_id} ${data}
682 ${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}
683 [Return] ${resp.json()}
684
Yang Xu2ec80382018-11-01 12:30:37 -0400685Set ASDC Catalog Resource VNF Inputs
686 [Documentation] sets an asdc Catalog Resource by its id
687 [Arguments] ${catalog_resource_id} ${data}
688 ${resp}= Run ASDC Post Request ${ASDC_FE_CATALOG_RESOURCES_PATH}/${catalog_resource_id}/update/inputs ${data} ${ASDC_DESIGNER_USER_ID} ${ASDC_FE_ENDPOINT}
689 [Return] ${resp.json()}
Brian Freeman79b00ce2018-11-01 14:57:53 -0500690Get SDC Demo Vnf Catalog Resource
691 [Documentation] gets resource id's for demonstration VNFs for instantiate
692 [Arguments] ${service_name}
693 ${resp}= Run ASDC Get Request ${ASDC_CATALOG_SERVICES_PATH}/serviceName/${service_name}/serviceVersion/1.0
694 @{ITEMS}= Copy List ${resp.json()['componentInstances']}
695 ${demo_catalog_resource}= Create Dictionary
696 :FOR ${ELEMENT} IN @{ITEMS}
697 \ Log ${ELEMENT['name']}
698 \ Log ${ELEMENT['groupInstances'][0]['groupName']}
699 \ ${vnf}= Get VNF From Group Name ${ELEMENT['groupInstances'][0]['groupName']} ${service_name}
700 \ ${vnf_data}= Create Dictionary vnf_type=${ELEMENT['name']} vf_module=${ELEMENT['groupInstances'][0]['groupName']}
701 \ LOG ${vnf_data}
702 \ Set To Dictionary ${demo_catalog_resource} ${vnf}=${vnf_data}
703 \ LOG ${demo_catalog_resource}
704 [Return] ${demo_catalog_resource}
705
706Get VNF From Group Name
707 [Documentation] looks up vnf key from service mapping for a regex on groupName and service_name
708 [Arguments] ${group_name} ${service_name}
709 ${vnf}= Set Variable If
710 ... ('${service_name}'=='demoVFWCL') and ('base_vfw' in '${group_name}') vFWSNK
711 ... ('${service_name}'=='demoVFWCL') and ('base_vpkg' in '${group_name}') vPKG
712 ... ('${service_name}'=='demoVLB') and ('base_vlb' in '${group_name}') vLB
713 [Return] ${vnf}
DR695Hccff30b2017-02-17 18:44:24 -0500714Checkin ASDC Catalog Resource
715 [Documentation] checksin an asdc Catalog Resource by its id
716 [Arguments] ${catalog_resource_id}
717 ${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}
DR695Hccff30b2017-02-17 18:44:24 -0500719 ${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 -0500720 Should Be Equal As Strings ${resp.status_code} 200
DR695Hccff30b2017-02-17 18:44:24 -0500721 [Return] ${resp.json()}
722Request Certify ASDC Catalog Resource
723 [Documentation] requests certify on an asdc Catalog Resource by its id
724 [Arguments] ${catalog_resource_id}
725 ${map}= Create Dictionary user_remarks=Robot remarks
Jerry Floode2a48d72017-06-21 15:06:29 -0400726 ${data}= Fill JSON Template File ${ASDC_USER_REMARKS_TEMPLATE} ${map}
DR695Hccff30b2017-02-17 18:44:24 -0500727 ${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 -0500728 Should Be Equal As Strings ${resp.status_code} 200
DR695Hccff30b2017-02-17 18:44:24 -0500729 [Return] ${resp.json()}
730Start Certify ASDC Catalog Resource
731 [Documentation] start certify an asdc Catalog Resource by its id
732 [Arguments] ${catalog_resource_id}
733 ${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 -0500734 Should Be Equal As Strings ${resp.status_code} 200
DR695Hccff30b2017-02-17 18:44:24 -0500735 [Return] ${resp.json()}
736Certify ASDC Catalog Resource
737 [Documentation] start certify an asdc Catalog Resource by its id and returns the new id
Brian Freemandb1e7412018-08-01 12:46:01 -0500738 [Arguments] ${catalog_resource_id} ${user_id}=${ASDC_TESTER_USER_ID}
DR695Hccff30b2017-02-17 18:44:24 -0500739 ${map}= Create Dictionary user_remarks=Robot remarks
Jerry Floode2a48d72017-06-21 15:06:29 -0400740 ${data}= Fill JSON Template File ${ASDC_USER_REMARKS_TEMPLATE} ${map}
Brian Freemandb1e7412018-08-01 12:46:01 -0500741 ${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 -0500742 Should Be Equal As Strings ${resp.status_code} 200
DR695Hccff30b2017-02-17 18:44:24 -0500743 [Return] ${resp.json()['uniqueId']}
Jerry Flood6bd1afa2017-10-09 09:59:23 -0400744
DR695Hccff30b2017-02-17 18:44:24 -0500745Upload ASDC Heat Package
Brian Freemanf508ab22018-03-15 21:19:41 -0500746 [Documentation] Creates an asdc Software Product and returns its id
747 [Arguments] ${software_product_id} ${file_path} ${version_id}=0.1
Jerry Flood6bd1afa2017-10-09 09:59:23 -0400748 ${files}= Create Dictionary
749 Create Multi Part ${files} upload ${file_path} contentType=application/zip
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500750 ${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}
751 Should Be Equal As Strings ${resp.status_code} 200
Jerry Flood6bd1afa2017-10-09 09:59:23 -0400752
DR695Hccff30b2017-02-17 18:44:24 -0500753Add ASDC Catalog Service
754 [Documentation] Creates an asdc Catalog Service and returns its id
jf986075010a42017-02-22 16:52:54 -0500755 [Arguments] ${catalog_service_name}
Jerry Floode2a48d72017-06-21 15:06:29 -0400756 ${uuid}= Generate UUID
jf986075010a42017-02-22 16:52:54 -0500757 ${shortened_uuid}= Evaluate str("${uuid}")[:23]
Jerry Floode2a48d72017-06-21 15:06:29 -0400758 ${catalog_service_name}= Set Variable If '${catalog_service_name}' =='' ${shortened_uuid} ${catalog_service_name}
jf986075010a42017-02-22 16:52:54 -0500759 ${map}= Create Dictionary service_name=${catalog_service_name}
Jerry Floode2a48d72017-06-21 15:06:29 -0400760 ${data}= Fill JSON Template File ${ASDC_CATALOG_SERVICE_TEMPLATE} ${map}
DR695Hccff30b2017-02-17 18:44:24 -0500761 ${resp}= Run ASDC Post Request ${ASDC_CATALOG_SERVICES_PATH} ${data} ${ASDC_DESIGNER_USER_ID}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500762 Should Be Equal As Strings ${resp.status_code} 201
DR695Hccff30b2017-02-17 18:44:24 -0500763 [Return] ${resp.json()['uniqueId']}
764Mark ASDC Catalog Service Inactive
765 [Documentation] Deletes an asdc Catalog Service
766 [Arguments] ${catalog_service_id}
767 ${resp}= Run ASDC Delete Request ${ASDC_CATALOG_SERVICES_PATH}/${catalog_service_id} ${ASDC_DESIGNER_USER_ID}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500768 Should Be Equal As Strings ${resp.status_code} 204
DR695Hccff30b2017-02-17 18:44:24 -0500769 [Return] ${resp}
770Delete Inactive ASDC Catalog Services
771 [Documentation] delete all asdc Catalog Serivces that are inactive
772 ${resp}= Run ASDC Delete Request ${ASDC_CATALOG_INACTIVE_SERVICES_PATH} ${ASDC_DESIGNER_USER_ID}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500773 Should Be Equal As Strings ${resp.status_code} 200
DR695Hccff30b2017-02-17 18:44:24 -0500774 [Return] ${resp.json()}
775Get ASDC Catalog Service
776 [Documentation] gets an asdc Catalog Service by its id
777 [Arguments] ${catalog_service_id}
778 ${resp}= Run ASDC Get Request ${ASDC_CATALOG_SERVICES_PATH}/${catalog_service_id} ${ASDC_DESIGNER_USER_ID}
779 [Return] ${resp.json()}
780Checkin ASDC Catalog Service
781 [Documentation] checksin an asdc Catalog Service by its 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}/checkin ${data} ${ASDC_DESIGNER_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()}
788Request Certify ASDC Catalog Service
789 [Documentation] requests certify on 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_LIFECYCLE_PATH}/certificationRequest ${data} ${ASDC_DESIGNER_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()}
796Start Certify ASDC Catalog Service
797 [Documentation] start certify 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_LIFECYCLE_PATH}/startCertification ${None} ${ASDC_TESTER_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()}
802Certify ASDC Catalog Service
803 [Documentation] start certify an asdc Catalog Service by its id and returns the new id
804 [Arguments] ${catalog_service_id}
805 ${map}= Create Dictionary user_remarks=Robot remarks
Jerry Floode2a48d72017-06-21 15:06:29 -0400806 ${data}= Fill JSON Template File ${ASDC_USER_REMARKS_TEMPLATE} ${map}
DR695Hccff30b2017-02-17 18:44:24 -0500807 ${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 -0500808 Should Be Equal As Strings ${resp.status_code} 200
DR695Hccff30b2017-02-17 18:44:24 -0500809 [Return] ${resp.json()['uniqueId']}
810Approve ASDC Catalog Service
811 [Documentation] approve an asdc Catalog Service by its id
812 [Arguments] ${catalog_service_id}
813 ${map}= Create Dictionary user_remarks=Robot remarks
Jerry Floode2a48d72017-06-21 15:06:29 -0400814 ${data}= Fill JSON Template File ${ASDC_USER_REMARKS_TEMPLATE} ${map}
DR695Hccff30b2017-02-17 18:44:24 -0500815 ${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 -0500816 Should Be Equal As Strings ${resp.status_code} 200
DR695Hccff30b2017-02-17 18:44:24 -0500817 [Return] ${resp.json()}
818Distribute ASDC Catalog Service
819 [Documentation] distribute an asdc Catalog Service by its id
820 [Arguments] ${catalog_service_id}
821 ${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 -0500822 Should Be Equal As Strings ${resp.status_code} 200
DR695Hccff30b2017-02-17 18:44:24 -0500823 [Return] ${resp.json()}
bdfreeman1421b2a49512018-11-25 07:32:19 -0500824
DR695Hccff30b2017-02-17 18:44:24 -0500825Add ASDC Resource Instance
826 [Documentation] Creates an asdc Resource Instance and returns its id
Brian Freemaneef7c6f2018-11-16 18:42:21 -0500827 [Arguments] ${catalog_service_id} ${catalog_resource_id} ${catalog_resource_name} ${xoffset}=${0} ${yoffset}=${0}
DR695Hccff30b2017-02-17 18:44:24 -0500828 ${milli_timestamp}= Generate MilliTimestamp UUID
Brian Freemaneef7c6f2018-11-16 18:42:21 -0500829 ${xoffset}= Set Variable ${xoffset+306}
830 ${yoffset}= Set Variable ${yoffset+248}
831 ${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 -0400832 ${data}= Fill JSON Template File ${ASDC_RESOURCE_INSTANCE_TEMPLATE} ${map}
DR695Hccff30b2017-02-17 18:44:24 -0500833 ${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 -0500834 Should Be Equal As Strings ${resp.status_code} 201
DR695Hccff30b2017-02-17 18:44:24 -0500835 [Return] ${resp.json()['uniqueId']}
Brian Freemaneef7c6f2018-11-16 18:42:21 -0500836
bdfreeman1421b2a49512018-11-25 07:32:19 -0500837Add ASDC Resource Instance To Resource
838 [Documentation] Creates an asdc Resource Instance in a Resource (VF) and returns its id
839 [Arguments] ${parent_catalog_resource_id} ${catalog_resource_id} ${catalog_resource_name} ${xoffset}=${0} ${yoffset}=${0}
840 ${milli_timestamp}= Generate MilliTimestamp UUID
841 ${xoffset}= Set Variable ${xoffset+306}
842 ${yoffset}= Set Variable ${yoffset+248}
843 ${map}= Create Dictionary catalog_resource_id=${catalog_resource_id} catalog_resource_name=${catalog_resource_name} milli_timestamp=${milli_timestamp} posX=${xoffset} posY=${yoffset}
844 ${data}= Fill JSON Template File ${ASDC_RESOURCE_INSTANCE_TEMPLATE} ${map}
845 ${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 -0500846 Should Be Equal As Strings ${resp.status_code} 201
bdfreeman1421b2a49512018-11-25 07:32:19 -0500847 [Return] ${resp.json()['uniqueId']}
848
DR695Hccff30b2017-02-17 18:44:24 -0500849Get Catalog Service Distribution
850 [Documentation] gets an asdc catalog Service distrbution
851 [Arguments] ${catalog_service_uuid}
852 ${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 -0500853 Should Be Equal As Strings ${resp.status_code} 200
DR695Hccff30b2017-02-17 18:44:24 -0500854 [Return] ${resp.json()}
855Check Catalog Service Distributed
856 [Documentation] gets an asdc catalog Service distrbution
Brian Freemanadaa2372018-10-24 12:25:22 -0500857 [Arguments] ${catalog_service_uuid} ${dist_status}
DR695Hccff30b2017-02-17 18:44:24 -0500858 ${dist_resp}= Get Catalog Service Distribution ${catalog_service_uuid}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500859 Should Be Equal As Strings ${dist_resp['distributionStatusOfServiceList'][0]['deployementStatus']} Distributed
DR695Hccff30b2017-02-17 18:44:24 -0500860 ${det_resp}= Get Catalog Service Distribution Details ${dist_resp['distributionStatusOfServiceList'][0]['distributionID']}
861 @{ITEMS}= Copy List ${det_resp['distributionStatusList']}
Brian Freemanf508ab22018-03-15 21:19:41 -0500862 Should Not Be Empty ${ITEMS}
Brian Freemana62644f2018-05-13 12:47:38 -0500863 ${SO_COMPLETE} Set Variable FALSE
bdfreeman1421b2a49512018-11-25 07:32:19 -0500864 ${dist_status} Set Variable CONTINUE
865 Should Not Be Empty ${ITEMS}
DR695Hccff30b2017-02-17 18:44:24 -0500866 :FOR ${ELEMENT} IN @{ITEMS}
Brian Freemanf508ab22018-03-15 21:19:41 -0500867 \ Log ${ELEMENT['omfComponentID']}
DR695Hccff30b2017-02-17 18:44:24 -0500868 \ Log ${ELEMENT['status']}
Brian Freeman41ab5e52018-08-08 14:24:23 -0500869 \ ${SO_COMPLETE} Set Variable If (('${ELEMENT['status']}' == 'DISTRIBUTION_COMPLETE_OK')) or ('${SO_COMPLETE}'=='TRUE') TRUE
Brian Freemaneca71072018-08-16 14:50:16 -0500870 \ Exit For Loop If ('${SO_COMPLETE}'=='TRUE')
871 \ Exit For Loop If ('${ELEMENT['status']}' == 'DISTRIBUTION_COMPLETE_ERROR')
Brian Freemanadaa2372018-10-24 12:25:22 -0500872 \ ${dist_status}= Set Variable If (('${ELEMENT['status']}' == 'COMPONENT_DONE_ERROR') and ('${ELEMENT['omfComponentID']}' == 'aai-ml')) EXIT
873 \ Exit For Loop If (('${ELEMENT['status']}' == 'COMPONENT_DONE_ERROR') and ('${ELEMENT['omfComponentID']}' == 'aai-ml'))
Brian Freemana62644f2018-05-13 12:47:38 -0500874 Should Be True ( '${SO_COMPLETE}'=='TRUE') SO Test
bdfreeman1421b2a49512018-11-25 07:32:19 -0500875 [Return]
876
DR695Hccff30b2017-02-17 18:44:24 -0500877Get Catalog Service Distribution Details
878 [Documentation] gets an asdc catalog Service distrbution details
879 [Arguments] ${catalog_service_distribution_id}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500880 ${resp}= Run ASDC Get Request ${ASDC_CATALOG_SERVICES_PATH}${ASDC_CATALOG_SERVICE_DISTRIBUTION_PATH}/${catalog_service_distribution_id} ${ASDC_OPS_USER_ID}
881 Should Be Equal As Strings ${resp.status_code} 200
DR695Hccff30b2017-02-17 18:44:24 -0500882 [Return] ${resp.json()}
883Run ASDC Health Check
884 [Documentation] Runs a ASDC health check
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500885 ${session}= Create Session asdc ${ASDC_FE_ENDPOINT}
DR695Hccff30b2017-02-17 18:44:24 -0500886 ${uuid}= Generate UUID
887 ${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 -0500888 ${resp}= Get Request asdc ${ASDC_HEALTH_CHECK_PATH} headers=${headers}
Brian Freemanadaa2372018-10-24 12:25:22 -0500889 # only test for HTTP 200 to determine SDC Health. SDC_DE_HEALTH is informational
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500890 Should Be Equal As Strings ${resp.status_code} 200 SDC DOWN
Brian Freeman5cf5fa62018-04-23 20:28:16 -0500891 ${SDC_DE_HEALTH}= Catenate DOWN
DR695Hccff30b2017-02-17 18:44:24 -0500892 @{ITEMS}= Copy List ${resp.json()['componentsInfo']}
893 :FOR ${ELEMENT} IN @{ITEMS}
894 \ Log ${ELEMENT['healthCheckStatus']}
Brian Freemane546f7e2018-04-19 12:17:56 -0500895 \ ${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 -0500896 Log To Console (DMaaP:${SDC_DE_HEALTH}) no_newline=true
DR695Hccff30b2017-02-17 18:44:24 -0500897Run ASDC Get Request
898 [Documentation] Runs an ASDC get request
Brian Freeman44b8bb32018-05-03 21:08:42 -0500899 [Arguments] ${data_path} ${user}=${ASDC_DESIGNER_USER_ID} ${MY_ASDC_BE_ENDPOINT}=${ASDC_BE_ENDPOINT}
DR695Hccff30b2017-02-17 18:44:24 -0500900 ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500901 Log Creating session ${MY_ASDC_BE_ENDPOINT}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500902 ${session}= Create Session asdc ${MY_ASDC_BE_ENDPOINT} auth=${auth}
DR695Hccff30b2017-02-17 18:44:24 -0500903 ${uuid}= Generate UUID
904 ${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 -0500905 ${resp}= Get Request asdc ${data_path} headers=${headers}
DR695Hccff30b2017-02-17 18:44:24 -0500906 Log Received response from asdc ${resp.text}
907 [Return] ${resp}
908Run ASDC Put Request
909 [Documentation] Runs an ASDC put request
Brian Freeman44b8bb32018-05-03 21:08:42 -0500910 [Arguments] ${data_path} ${data} ${user}=${ASDC_DESIGNER_USER_ID} ${MY_ASDC_BE_ENDPOINT}=${ASDC_BE_ENDPOINT}
DR695Hccff30b2017-02-17 18:44:24 -0500911 ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500912 Log Creating session ${MY_ASDC_BE_ENDPOINT}
913 ${session}= Create Session asdc ${MY_ASDC_BE_ENDPOINT} auth=${auth}
DR695Hccff30b2017-02-17 18:44:24 -0500914 ${uuid}= Generate UUID
915 ${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 -0500916 ${resp}= Put Request asdc ${data_path} data=${data} headers=${headers}
DR695Hccff30b2017-02-17 18:44:24 -0500917 Log Received response from asdc ${resp.text}
918 [Return] ${resp}
Jerry Flood6bd1afa2017-10-09 09:59:23 -0400919
DR695Hccff30b2017-02-17 18:44:24 -0500920Run ASDC Post Files Request
921 [Documentation] Runs an ASDC post request
Brian Freeman44b8bb32018-05-03 21:08:42 -0500922 [Arguments] ${data_path} ${files} ${user}=${ASDC_DESIGNER_USER_ID} ${MY_ASDC_BE_ENDPOINT}=${ASDC_BE_ENDPOINT}
DR695Hccff30b2017-02-17 18:44:24 -0500923 ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500924 Log Creating session ${MY_ASDC_BE_ENDPOINT}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500925 ${session}= Create Session asdc ${MY_ASDC_BE_ENDPOINT} auth=${auth}
DR695Hccff30b2017-02-17 18:44:24 -0500926 ${uuid}= Generate UUID
927 ${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 -0500928 ${resp}= Post Request asdc ${data_path} files=${files} headers=${headers}
929 Log Received response from asdc ${resp.text}
930 [Return] ${resp}
931
932Run ASDC MD5 Post Request
933 [Documentation] Runs an ASDC post request with MD5 Checksum header
934 [Arguments] ${data_path} ${data} ${user}=${ASDC_DESIGNER_USER_ID} ${MY_ASDC_BE_ENDPOINT}=${ASDC_BE_ENDPOINT}
935 ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD}
936 Log Creating session ${MY_ASDC_BE_ENDPOINT}
937 ${session}= Create Session asdc ${MY_ASDC_BE_ENDPOINT} auth=${auth}
938 ${uuid}= Generate UUID
939 ${data_string}= Evaluate json.dumps(${data}) json
940 ${md5checksum}= Evaluate md5.new('''${data_string}''').hexdigest() modules=md5
941 ${base64md5checksum}= Evaluate base64.b64encode("${md5checksum}") modules=base64
942 ${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}
943 ${resp}= Post Request asdc ${data_path} data=${data} headers=${headers}
DR695Hccff30b2017-02-17 18:44:24 -0500944 Log Received response from asdc ${resp.text}
Jerry Floode2a48d72017-06-21 15:06:29 -0400945 [Return] ${resp}
Jerry Flood6bd1afa2017-10-09 09:59:23 -0400946
DR695Hccff30b2017-02-17 18:44:24 -0500947Run ASDC Post Request
948 [Documentation] Runs an ASDC post request
Brian Freeman44b8bb32018-05-03 21:08:42 -0500949 [Arguments] ${data_path} ${data} ${user}=${ASDC_DESIGNER_USER_ID} ${MY_ASDC_BE_ENDPOINT}=${ASDC_BE_ENDPOINT}
DR695Hccff30b2017-02-17 18:44:24 -0500950 ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500951 Log Creating session ${MY_ASDC_BE_ENDPOINT}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500952 ${session}= Create Session asdc ${MY_ASDC_BE_ENDPOINT} auth=${auth}
DR695Hccff30b2017-02-17 18:44:24 -0500953 ${uuid}= Generate UUID
954 ${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 -0500955 ${resp}= Post Request asdc ${data_path} data=${data} headers=${headers}
DR695Hccff30b2017-02-17 18:44:24 -0500956 Log Received response from asdc ${resp.text}
Jerry Floode2a48d72017-06-21 15:06:29 -0400957 [Return] ${resp}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500958
DR695Hccff30b2017-02-17 18:44:24 -0500959Run ASDC Delete Request
960 [Documentation] Runs an ASDC delete request
Brian Freeman44b8bb32018-05-03 21:08:42 -0500961 [Arguments] ${data_path} ${user}=${ASDC_DESIGNER_USER_ID} ${MY_ASDC_BE_ENDPOINT}=${ASDC_BE_ENDPOINT}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500962 ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500963 Log Creating session ${MY_ASDC_BE_ENDPOINT}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500964 ${session}= Create Session asdc ${MY_ASDC_BE_ENDPOINT} auth=${auth}
DR695Hccff30b2017-02-17 18:44:24 -0500965 ${uuid}= Generate UUID
966 ${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 -0500967 ${resp}= Delete Request asdc ${data_path} headers=${headers}
DR695Hccff30b2017-02-17 18:44:24 -0500968 Log Received response from asdc ${resp.text}
Jerry Floode2a48d72017-06-21 15:06:29 -0400969 [Return] ${resp}
DR695Hccff30b2017-02-17 18:44:24 -0500970Open ASDC GUI
971 [Documentation] Logs in to ASDC GUI
972 [Arguments] ${PATH}
973 ## Setup Browever now being managed by the test case
974 ##Setup Browser
DR695Hbf5a3a32017-06-30 13:09:57 -0400975 Go To ${ASDC_FE_ENDPOINT}${PATH}
DR695Hccff30b2017-02-17 18:44:24 -0500976 Maximize Browser Window
Jerry Flood6bd1afa2017-10-09 09:59:23 -0400977
DR695Hccff30b2017-02-17 18:44:24 -0500978 Set Browser Implicit Wait ${GLOBAL_SELENIUM_BROWSER_IMPLICIT_WAIT}
DR695Hbf5a3a32017-06-30 13:09:57 -0400979 Log Logging in to ${ASDC_FE_ENDPOINT}${PATH}
DR695Hccff30b2017-02-17 18:44:24 -0500980 Title Should Be ASDC
Jerry Floode2a48d72017-06-21 15:06:29 -0400981 Wait Until Page Contains Element xpath=//div/a[text()='SDC'] ${GLOBAL_SELENIUM_BROWSER_WAIT_TIMEOUT}
DR695Hbf5a3a32017-06-30 13:09:57 -0400982 Log Logged in to ${ASDC_FE_ENDPOINT}${PATH}
Jerry Flood6bd1afa2017-10-09 09:59:23 -0400983
984
985Create Multi Part
986 [Arguments] ${addTo} ${partName} ${filePath} ${contentType}=${None}
987 ${fileData}= Get Binary File ${filePath}
988 ${fileDir} ${fileName}= Split Path ${filePath}
989 ${partData}= Create List ${fileName} ${fileData} ${contentType}
990 Set To Dictionary ${addTo} ${partName}=${partData}
Brian Freemanf940ee92018-05-25 21:09:05 -0500991