blob: 4e016bb1c42e33bdc8bb396beff3aff2916d3d28 [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
DR695H18872bc2019-06-13 16:16:52 -04004Library ONAPLibrary.Utilities
DR695H7aca1a42019-06-03 17:08:34 -04005Library ONAPLibrary.JSON
DR695Hccff30b2017-02-17 18:44:24 -05006Library OperatingSystem
7Library Collections
DR695H910097e2019-05-08 13:55:32 -04008Library SeleniumLibrary
Brian Freeman2e1d0ff2019-01-23 09:38:13 -05009Library String
Yang Xu7037e542018-12-28 01:19:26 -050010Library ArchiveLibrary
DR695Hd92b0072019-06-17 17:23:14 -040011Library ONAPLibrary.Openstack
Brian Freeman15033782019-03-22 15:48:55 -050012Library DateTime
DR695Hfcb0ee82019-05-22 17:21:38 -040013Library ONAPLibrary.ServiceMapping
DR695H3bb6cf42019-06-20 15:04:04 -040014Library ONAPLibrary.Templating
DR695H39a6be82019-07-10 19:08:20 -040015Library ONAPLibrary.SDC
DR695Hccff30b2017-02-17 18:44:24 -050016Resource global_properties.robot
17Resource browser_setup.robot
Brian Freeman2e1d0ff2019-01-23 09:38:13 -050018
DR695Hccff30b2017-02-17 18:44:24 -050019*** Variables ***
20${ASDC_DESIGNER_USER_ID} cs0008
21${ASDC_TESTER_USER_ID} jm0007
22${ASDC_GOVERNOR_USER_ID} gv0001
23${ASDC_OPS_USER_ID} op0001
24${ASDC_HEALTH_CHECK_PATH} /sdc1/rest/healthCheck
25${ASDC_VENDOR_LICENSE_MODEL_PATH} /onboarding-api/v1.0/vendor-license-models
26${ASDC_VENDOR_SOFTWARE_PRODUCT_PATH} /onboarding-api/v1.0/vendor-software-products
27${ASDC_VENDOR_KEY_GROUP_PATH} /license-key-groups
28${ASDC_VENDOR_ENTITLEMENT_POOL_PATH} /entitlement-pools
29${ASDC_VENDOR_FEATURE_GROUP_PATH} /feature-groups
30${ASDC_VENDOR_LICENSE_AGREEMENT_PATH} /license-agreements
31${ASDC_VENDOR_ACTIONS_PATH} /actions
Jerry Floode2a48d72017-06-21 15:06:29 -040032${ASDC_VENDOR_SOFTWARE_UPLOAD_PATH} /orchestration-template-candidate
Yang Xu2ec80382018-11-01 12:30:37 -040033${ASDC_FE_CATALOG_RESOURCES_PATH} /sdc1/feProxy/rest/v1/catalog/resources
Brian Freemaneef7c6f2018-11-16 18:42:21 -050034${ASDC_FE_CATALOG_SERVICES_PATH} /sdc1/feProxy/rest/v1/catalog/services
DR695Hccff30b2017-02-17 18:44:24 -050035${ASDC_CATALOG_RESOURCES_PATH} /sdc2/rest/v1/catalog/resources
36${ASDC_CATALOG_SERVICES_PATH} /sdc2/rest/v1/catalog/services
37${ASDC_CATALOG_INACTIVE_RESOURCES_PATH} /sdc2/rest/v1/inactiveComponents/resource
Brian Freemaneef7c6f2018-11-16 18:42:21 -050038${ASDC_CATALOG_RESOURCES_QUERY_PATH} /sdc2/rest/v1/catalog/resources/resourceName
DR695Hccff30b2017-02-17 18:44:24 -050039${ASDC_CATALOG_INACTIVE_SERVICES_PATH} /sdc2/rest/v1/inactiveComponents/service
40${ASDC_CATALOG_LIFECYCLE_PATH} /lifecycleState
41${ASDC_CATALOG_SERVICE_RESOURCE_INSTANCE_PATH} /resourceInstance
Brian Freeman2e1d0ff2019-01-23 09:38:13 -050042${ASDC_CATALOG_SERVICE_RESOURCE_ARTIFACT_PATH} /artifacts
DR695Hccff30b2017-02-17 18:44:24 -050043${ASDC_CATALOG_SERVICE_DISTRIBUTION_STATE_PATH} /distribution-state
44${ASDC_CATALOG_SERVICE_DISTRIBUTION_PATH} /distribution
45${ASDC_DISTRIBUTION_STATE_APPROVE_PATH} /approve
46${ASDC_CATALOG_SERVICE_DISTRIBUTION_ACTIVATE_PATH} /distribution/PROD/activate
DR695H3bb6cf42019-06-20 15:04:04 -040047${ASDC_LICENSE_MODEL_TEMPLATE} asdc/license_model.jinja
48${ASDC_KEY_GROUP_TEMPLATE} asdc/key_group.jinja
49${ASDC_ENTITLEMENT_POOL_TEMPLATE} asdc/entitlement_pool.jinja
50${ASDC_FEATURE_GROUP_TEMPLATE} asdc/feature_group.jinja
51${ASDC_LICENSE_AGREEMENT_TEMPLATE} asdc/license_agreement.jinja
52${ASDC_ACTION_TEMPLATE} asdc/action.jinja
53${ASDC_SOFTWARE_PRODUCT_TEMPLATE} asdc/software_product.jinja
54${ASDC_ARTIFACT_UPLOAD_TEMPLATE} asdc/artifact_upload.jinja
55${ASDC_CATALOG_RESOURCE_TEMPLATE} asdc/catalog_resource.jinja
56${ASDC_USER_REMARKS_TEMPLATE} asdc/user_remarks.jinja
57${ASDC_CATALOG_SERVICE_TEMPLATE} asdc/catalog_service.jinja
58${ASDC_RESOURCE_INSTANCE_TEMPLATE} asdc/resource_instance.jinja
59${ASDC_RESOURCE_INSTANCE_VNF_PROPERTIES_TEMPLATE} asdc/catalog_vnf_properties.jinja
60${ASDC_RESOURCE_INSTANCE_VNF_INPUTS_TEMPLATE} asdc/catalog_vnf_inputs.jinja
61${SDC_CATALOG_NET_RESOURCE_INPUT_TEMPLATE} asdc/catalog_net_input_properties.jinja
62${ASDC_ALLOTTED_RESOURCE_CATALOG_RESOURCE_TEMPLATE} asdc/catalog_resource_alloted_resource.jinja
63${SDC_CATALOG_ALLOTTED_RESOURCE_PROPERTIES_TEMPLATE} asdc/catalog_allotted_properties.jinja
64${SDC_CATALOG_ALLOTTED_RESOURCE_INPUTS_TEMPLATE} asdc/catalog_allotted_inputs.jinja
Brian Freeman2e1d0ff2019-01-23 09:38:13 -050065${SDC_CATALOG_DEPLOYMENT_ARTIFACT_PATH} robot/assets/asdc/blueprints/
Brian Freemanf508ab22018-03-15 21:19:41 -050066${ASDC_FE_ENDPOINT} ${GLOBAL_ASDC_SERVER_PROTOCOL}://${GLOBAL_INJECTED_SDC_FE_IP_ADDR}:${GLOBAL_ASDC_FE_PORT}
67${ASDC_BE_ENDPOINT} ${GLOBAL_ASDC_SERVER_PROTOCOL}://${GLOBAL_INJECTED_SDC_BE_IP_ADDR}:${GLOBAL_ASDC_BE_PORT}
Brian Freeman44b8bb32018-05-03 21:08:42 -050068${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 -040069
DR695Hccff30b2017-02-17 18:44:24 -050070*** Keywords ***
71Distribute Model From ASDC
kaihlavi06fa4ee2019-05-22 19:08:14 +030072 [Documentation] Goes end to end creating all the ASDC objects based ONAP 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 -050073 [Arguments] ${model_zip_path} ${catalog_service_name}= ${cds}= ${service}=
bdfreeman1421b2a49512018-11-25 07:32:19 -050074 # For Testing use random service names
Brian Freemaneef7c6f2018-11-16 18:42:21 -050075 #${random}= Get Current Date
76 #${catalog_service_id}= Add ASDC Catalog Service ${catalog_service_name}_${random}
jf986075010a42017-02-22 16:52:54 -050077 ${catalog_service_id}= Add ASDC Catalog Service ${catalog_service_name}
DR695Hccff30b2017-02-17 18:44:24 -050078 ${catalog_resource_ids}= Create List
Jerry Flood3a169a32017-12-01 12:39:10 -050079 ${catalog_resources}= Create Dictionary
Brian Freemanee02b312019-02-04 20:36:08 -050080 ##### TODO: Support for Multiple resources of one type in a service ######
81 # The zip list is the resources - no mechanism to indicate more than 1 of the items in the zip list
DR695Hfcb0ee82019-05-22 17:21:38 -040082 # Get Service Vnf Mapping has the logical mapping but it is not the same key as model_zip_path
83 # ${vnflist}= Get Service Vnf Mapping alias ${service}
kaihlavi06fa4ee2019-05-22 19:08:14 +030084 # Save the resource_id in a dictionary keyed by the resource name in the zipfile name (vFWDT_vFWSNK.zip or vFWDT_vPKG.zip)
85 # Create the resources but do not immediately add resource
Brian Freemanee02b312019-02-04 20:36:08 -050086 # Add Resource to Service in a separate FOR loop
Brian Freemanee02b312019-02-04 20:36:08 -050087 ${resource_types}= Create Dictionary
88
DR695H910097e2019-05-08 13:55:32 -040089 :FOR ${zip} IN @{model_zip_path}
Yang Xu2ec80382018-11-01 12:30:37 -040090 \ ${loop_catalog_resource_id}= Setup ASDC Catalog Resource ${zip} ${cds}
kaihlavi06fa4ee2019-05-22 19:08:14 +030091 # zip can be vFW.zip or vFWDT_VFWSNK.zip
Brian Freemanee02b312019-02-04 20:36:08 -050092 \ ${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
DR695Hfcb0ee82019-05-22 17:21:38 -040098 Set Directory default ./demo/service_mapping
99 ${vnflist}= Get Service Vnf Mapping default ${service}
Brian Freemanee02b312019-02-04 20:36:08 -0500100
101 # Spread the icons on the pallette starting on the left
kaihlavi06fa4ee2019-05-22 19:08:14 +0300102 ${xoffset}= Set Variable ${0}
Brian Freemanee02b312019-02-04 20:36:08 -0500103
DR695H910097e2019-05-08 13:55:32 -0400104 :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
DR695Hfcb0ee82019-05-22 17:21:38 -0400114 ${networklist}= Get Service Neutron Mapping default ${service}
Brian Freemaneef7c6f2018-11-16 18:42:21 -0500115 ${generic_neutron_net_uuid}= Get Generic NeutronNet UUID
DR695H910097e2019-05-08 13:55:32 -0400116 :FOR ${network} IN @{networklist}
Brian Freemaneef7c6f2018-11-16 18:42:21 -0500117 \ ${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}
Yang Xufac7a632019-05-17 01:01:26 -0400120 \ ${loop_catalog_resource_id}= Add ASDC Resource Instance ${catalog_service_id} ${loop_catalog_resource_id} ${network} ${xoffset} ${0} VL
Brian Freemaneef7c6f2018-11-16 18:42:21 -0500121 \ ${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 #
DR695Hfcb0ee82019-05-22 17:21:38 -0400129 ${deploymentlist}= Get Service Deployment Artifact Mapping default ${service}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500130 :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}
DR695Hf4b64d42019-06-25 10:52:00 -0400134 Wait Until Keyword Succeeds 600s 15s Request Certify ASDC Catalog Service ${catalog_service_id}
DR695Hccff30b2017-02-17 18:44:24 -0500135 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}
DR695H910097e2019-05-08 13:55:32 -0400139 :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
kaihlavi06fa4ee2019-05-22 19:08:14 +0300149 [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
bdfreeman1421b2a49512018-11-25 07:32:19 -0500150 [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
DR695H18872bc2019-06-13 16:16:52 -0400153 ${uuid}= Generate UUID4
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500154 ${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}
DR695H8e7028b2019-07-10 10:13:58 -0400158 Log ${\n}ServiceName: ${catalog_service_name}_${random}
bdfreeman1421b2a49512018-11-25 07:32:19 -0500159 #${catalog_service_id}= Add ASDC Catalog Service ${catalog_service_name}
160 ${catalog_resource_ids}= Create List
161 ${catalog_resources}= Create Dictionary
DR695H910097e2019-05-08 13:55:32 -0400162 :FOR ${zip} IN @{model_zip_path}
bdfreeman1421b2a49512018-11-25 07:32:19 -0500163 \ ${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
Brian Freemana8ceb692019-03-03 09:37:54 -0500179 ${vcpe_ar_data_file} OperatingSystem.Get File /tmp/vcpe_allotted_resource_data.json
DR695H0ca56d12019-05-14 11:48:20 -0400180 ${tunnelxconn_invariant_uuid}= Catenate ${vcpe_ar_data_file.json()['tunnelxconn']['invariantUUID']}
181 ${tunnelxconn_uuid}= Catenate ${vcpe_ar_data_file.json()['tunnelxconn']['UUID']}
182 ${tunnelxconn_node_type}= Catenate ${vcpe_ar_data_file.json()['tunnelxconn']['node_type']}
183 ${brg_invariant_uuid}= Catenate ${vcpe_ar_data_file.json()['brg']['invariantUUID']}
184 ${brg_uuid}= Catenate ${vcpe_ar_data_file.json()['brg']['UUID']}
185 ${brg_node_type}= Catenate ${vcpe_ar_data_file.json()['brg']['node_type']}
bdfreeman1421b2a49512018-11-25 07:32:19 -0500186 ${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
DR695H910097e2019-05-08 13:55:32 -0400191 :FOR ${allottedresource} IN @{allottedresource_list}
bdfreeman1421b2a49512018-11-25 07:32:19 -0500192 \ ${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}
DR695H910097e2019-05-08 13:55:32 -0400217 :FOR ${DIST_INDEX} IN RANGE 1
bdfreeman1421b2a49512018-11-25 07:32:19 -0500218 \ 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
kaihlavi06fa4ee2019-05-22 19:08:14 +0300228 [Documentation] Create Allotted Resource json data file
Yang Xu7037e542018-12-28 01:19:26 -0500229 ${allotted_resource}= Create Dictionary
230 ${allotted_csar_map}= Create Dictionary
231 Set To Dictionary ${allotted_csar_map} tunnelxconn=service-Demovcpevgmux-csar.csar
232 Set To Dictionary ${allotted_csar_map} brg=service-Demovcpevbrgemu-csar.csar
233 ${keys}= Get Dictionary Keys ${allotted_csar_map}
DR695H910097e2019-05-08 13:55:32 -0400234 :FOR ${key} IN @{keys}
Yang Xu7037e542018-12-28 01:19:26 -0500235 \ ${csar}= Get From Dictionary ${allotted_csar_map} ${key}
236 \ ${dir} ${ext}= Split String From Right ${csar} - 1
237 \ Extract Zip File /tmp/csar/${csar} /tmp/csar/${dir}
238 \ ${template}= Catenate /tmp/csar/${dir}/Definitions/${dir}-template.yml
239 \ ${json_str}= Template Yaml To Json ${template}
240 \ ${json_obj}= To Json ${json_str}
241 \ ${attrs}= Create Dictionary
242 \ Set To Dictionary ${attrs} invariantUUID=${json_obj['metadata']['invariantUUID']}
243 \ Set To Dictionary ${attrs} UUID=${json_obj['metadata']['UUID']}
244 \ Set To Dictionary ${attrs} node_type=${json_obj['topology_template']['substitution_mappings']['node_type']}
245 \ Set To Dictionary ${allotted_resource} ${key}=${attrs}
246 ${result_str}= Evaluate json.dumps(${allotted_resource}, indent=2) json
DR695H8e7028b2019-07-10 10:13:58 -0400247 Log ${result_str}
Yang Xu7037e542018-12-28 01:19:26 -0500248 Create File /tmp/vcpe_allotted_resource_data.json ${result_str}
Yang Xu7037e542018-12-28 01:19:26 -0500249
bdfreeman14211ad11d92018-11-17 18:47:37 +0000250Download CSAR
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500251 [Documentation] Download CSAR
bdfreeman14211ad11d92018-11-17 18:47:37 +0000252 [Arguments] ${catalog_service_id} ${save_directory}=/tmp/csar
253 # get meta data
254 ${resp}= Run ASDC Get Request ${ASDC_CATALOG_SERVICES_PATH}/${catalog_service_id}/filteredDataByParams?include=toscaArtifacts ${ASDC_DESIGNER_USER_ID} ${ASDC_BE_ENDPOINT}
255 ${csar_resource_id}= Set Variable ${resp.json()['toscaArtifacts']['assettoscacsar']['uniqueId']}
256 ${resp}= Run ASDC Get Request ${ASDC_CATALOG_SERVICES_PATH}/${catalog_service_id}/artifacts/${csar_resource_id}
257 ${csar_file_name}= Set Variable ${resp.json()['artifactName']}
258 ${base64Obj}= Set Variable ${resp.json()['base64Contents']}
DR695H37529942019-07-01 13:47:56 -0400259 ${binObj}= Base64 Decode ${base64Obj}
bdfreeman14211ad11d92018-11-17 18:47:37 +0000260 Create Binary File ${save_directory}/${csar_file_name} ${binObj}
DR695H8e7028b2019-07-10 10:13:58 -0400261 Log ${\n}Downloaded:${csar_file_name}
bdfreeman14211ad11d92018-11-17 18:47:37 +0000262
Brian Freemaneef7c6f2018-11-16 18:42:21 -0500263
264Get Generic NeutronNet UUID
kaihlavi06fa4ee2019-05-22 19:08:14 +0300265 [Documentation] Look up the UUID of the Generic NeutronNetwork Resource
Brian Freemaneef7c6f2018-11-16 18:42:21 -0500266 ${resp}= Run ASDC Get Request ${ASDC_CATALOG_RESOURCES_QUERY_PATH}/Generic%20NeutronNet/resourceVersion/1.0 ${ASDC_DESIGNER_USER_ID} ${ASDC_BE_ENDPOINT}
267 [Return] ${resp.json()['allVersions']['1.0']}
268
bdfreeman1421b2a49512018-11-25 07:32:19 -0500269Get AllottedResource UUID
kaihlavi06fa4ee2019-05-22 19:08:14 +0300270 [Documentation] Look up the UUID of the Allotted Resource
bdfreeman1421b2a49512018-11-25 07:32:19 -0500271 # if this fails then the AllottedResource template got deleted from SDC by mistake
272 ${resp}= Run ASDC Get Request ${ASDC_CATALOG_RESOURCES_QUERY_PATH}/AllottedResource/resourceVersion/1.0 ${ASDC_DESIGNER_USER_ID} ${ASDC_BE_ENDPOINT}
273 [Return] ${resp.json()['allVersions']['1.0']}
274
Brian Freeman18df8912018-05-25 13:27:29 -0500275Loop Over Check Catalog Service Distributed
Gary Wu58d58532018-07-27 16:02:51 -0700276 [Arguments] ${catalog_service_id}
Brian Freemanadaa2372018-10-24 12:25:22 -0500277 # SO watchdog timeout is 300 seconds need buffer
bdfreeman1421b2a49512018-11-25 07:32:19 -0500278 ${dist_status}= Set Variable CONTINUE
DR695H910097e2019-05-08 13:55:32 -0400279 :FOR ${CHECK_INDEX} IN RANGE 20
Brian Freemanadaa2372018-10-24 12:25:22 -0500280 \ ${status} ${_} = Run Keyword And Ignore Error Check Catalog Service Distributed ${catalog_service_id} ${dist_status}
Gary Wu58d58532018-07-27 16:02:51 -0700281 \ Sleep 20s
Brian Freemanf940ee92018-05-25 21:09:05 -0500282 \ Return From Keyword If '${status}'=='PASS'
bdfreeman1421b2a49512018-11-25 07:32:19 -0500283 # need a way to exit the loop early on DISTRIBUTION_COMPLETE_ERROR ${dist_status} doesnt work
284 #\ Exit For Loop If '${dist_status}'=='EXIT'
285 Should Be Equal As Strings ${status} PASS
Brian Freeman18df8912018-05-25 13:27:29 -0500286
DR695Hccff30b2017-02-17 18:44:24 -0500287Setup ASDC Catalog Resource
kaihlavi06fa4ee2019-05-22 19:08:14 +0300288 [Documentation] Creates all the steps a VF needs for an ASDC Catalog Resource and returns the id
Yang Xu2ec80382018-11-01 12:30:37 -0400289 [Arguments] ${model_zip_path} ${cds}=
Brian Freemanb568e5e2018-04-05 21:03:38 -0500290 ${license_model_id} ${license_model_version_id}= Add ASDC License Model
Brian Freeman15033782019-03-22 15:48:55 -0500291
292
293 ${license_temp_date}= Get Current Date
294 ${license_start_date}= Get Current Date result_format=%m/%d/%Y
295 ${license_end_date}= Add Time To Date ${license_temp_date} 365 days result_format=%m/%d/%Y
296 ${key_group_id}= Add ASDC License Group ${license_model_id} ${license_model_version_id} ${license_start_date} ${license_end_date}
297 ${pool_id}= Add ASDC Entitlement Pool ${license_model_id} ${license_model_version_id} ${license_start_date} ${license_end_date}
298
Brian Freemanb568e5e2018-04-05 21:03:38 -0500299 ${feature_group_id}= Add ASDC Feature Group ${license_model_id} ${key_group_id} ${pool_id} ${license_model_version_id}
300 ${license_agreement_id}= Add ASDC License Agreement ${license_model_id} ${feature_group_id} ${license_model_version_id}
301 Submit ASDC License Model ${license_model_id} ${license_model_version_id}
302 ${license_model_resp}= Get ASDC License Model ${license_model_id} ${license_model_version_id}
Brian Freeman9c42ae12018-11-27 14:33:27 -0500303 ${matches}= Get Regexp Matches ${model_zip_path} temp/(.*)\.zip 1
304 ${software_product_name_prefix}= Set Variable ${matches[0]}
305 ${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 -0500306 Upload ASDC Heat Package ${software_product_id} ${model_zip_path} ${software_product_version_id}
307 Validate ASDC Software Product ${software_product_id} ${software_product_version_id}
308 Submit ASDC Software Product ${software_product_id} ${software_product_version_id}
309 Package ASDC Software Product ${software_product_id} ${software_product_version_id}
310 ${software_product_resp}= Get ASDC Software Product ${software_product_id} ${software_product_version_id}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500311 ${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 -0400312 # Check if need to set up CDS properties
313 Run Keyword If '${cds}' == 'vfwng' Setup ASDC Catalog Resource CDS Properties ${catalog_resource_id}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500314
Brian Freeman391680a2018-08-11 15:20:58 -0500315 ${catalog_resource_id}= Certify ASDC Catalog Resource ${catalog_resource_id} ${ASDC_DESIGNER_USER_ID}
DR695Hccff30b2017-02-17 18:44:24 -0500316 [Return] ${catalog_resource_id}
Brian Freemaneef7c6f2018-11-16 18:42:21 -0500317
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500318
319Setup SDC Catalog Resource Deployment Artifact Properties
320 [Documentation] Set up Deployment Artiface properties
321 [Arguments] ${catalog_service_id} ${catalog_parent_service_id} ${catalog_resource_unique_id} ${blueprint_file}
322 ${resp}= Get ASDC Catalog Resource Component Instances Properties ${catalog_service_id}
Brian Freemana8ceb692019-03-03 09:37:54 -0500323 ${blueprint_data} OperatingSystem.Get File ${SDC_CATALOG_DEPLOYMENT_ARTIFACT_PATH}${blueprint_file}
DR695H37529942019-07-01 13:47:56 -0400324 ${payloadData}= Base64 Encode ${blueprint_data}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500325 ${dict}= Create Dictionary artifactLabel=blueprint artifactName=${blueprint_file} artifactType=DCAE_INVENTORY_BLUEPRINT artifactGroupType=DEPLOYMENT description=${blueprint_file} payloadData=${payloadData}
DR695H3bb6cf42019-06-20 15:04:04 -0400326 Create Environment sdc ${GLOBAL_TEMPLATE_FOLDER}
327 ${data}= Apply Template sdc ${ASDC_ARTIFACT_UPLOAD_TEMPLATE} ${dict}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500328 # POST artifactUpload to resource
329 ${artifact_upload_path}= Catenate ${ASDC_CATALOG_SERVICES_PATH}/${catalog_service_id}/resourceInstance/${catalog_resource_unique_id}${ASDC_CATALOG_SERVICE_RESOURCE_ARTIFACT_PATH}
330 ${resp}= Run ASDC MD5 Post Request ${artifact_upload_path} ${data} ${ASDC_DESIGNER_USER_ID}
331 Should Be Equal As Strings ${resp.status_code} 200
332 [Return] ${resp}
333
334
Brian Freemaneef7c6f2018-11-16 18:42:21 -0500335Setup SDC Catalog Resource GenericNeutronNet Properties
bdfreeman1421b2a49512018-11-25 07:32:19 -0500336 [Documentation] Set up GenericNeutronNet properties and inputs
Brian Freemaneef7c6f2018-11-16 18:42:21 -0500337 [Arguments] ${catalog_service_id} ${nf_role} ${catalog_parent_service_id}
Brian Freemaneef7c6f2018-11-16 18:42:21 -0500338 ${resp}= Get ASDC Catalog Resource Component Instances Properties ${catalog_service_id}
Brian Freemaneef7c6f2018-11-16 18:42:21 -0500339 ${componentInstances} Set Variable @{resp['componentInstancesProperties']}
340 # componentInstances can have 1 or more than 1 entry
341 ${passed}= Run Keyword And Return Status Evaluate type(${componentInstances})
342 ${type}= Run Keyword If ${passed} Evaluate type(${componentInstances})
343 ${componentInstancesList}= Run Keyword If "${type}"!="<type 'list'>" Create List ${componentInstances}
344 ... ELSE Set Variable ${componentInstances}
345 :FOR ${item} IN @{componentInstancesList}
346 \ ${test} ${v}= Run Keyword and Ignore Error Should Contain ${item} ${nf_role}
347 \ Run Keyword If '${test}' == 'FAIL' Continue For Loop
348 \ ${componentInstance1}= Set Variable ${item}
349 :FOR ${comp} IN @{resp['componentInstancesProperties']["${componentInstance1}"]}
350 \ ${name} Set Variable ${comp['name']}
351 \ ${test} ${v}= Run Keyword and Ignore Error Should Contain ${name} network_role
352 \ Run Keyword If '${test}' == 'FAIL' Continue For Loop
353 \ ${description} Set Variable ${comp['description']}
354 \ ${description}= Replace String ${description} ${\n} \
355 \ ${uniqueId} Set Variable ${comp['uniqueId']}
356 \ ${parentUniqueId} Set Variable ${comp['parentUniqueId']}
357 \ ${ownerId} Set Variable ${comp['ownerId']}
358 \ ${dict}= Create Dictionary parentUniqueId=${parentUniqueId} ownerId=${ownerId} uniqueId=${uniqueId} description=${description}
359 \ Run Keyword If '${name}'=='network_role' Set To Dictionary ${dict} name=${name} value=${nf_role}
DR695H3bb6cf42019-06-20 15:04:04 -0400360 \ Create Environment sdc ${GLOBAL_TEMPLATE_FOLDER}
361 \ ${data}= Apply Template sdc ${SDC_CATALOG_NET_RESOURCE_INPUT_TEMPLATE} ${dict}
Brian Freemaneef7c6f2018-11-16 18:42:21 -0500362 \ ${response}= Set ASDC Catalog Resource Component Instance Properties ${catalog_parent_service_id} ${catalog_service_id} ${data}
Brian Freemaneef7c6f2018-11-16 18:42:21 -0500363
bdfreeman1421b2a49512018-11-25 07:32:19 -0500364
365Setup SDC Catalog Resource AllottedResource Properties
366 [Documentation] Set up Allotted Resource properties and inputs
367 [Arguments] ${catalog_service_id} ${nf_role} ${catalog_resource_id} ${invariantUUID} ${UUID} ${node_type}
368 # Set component instances properties
369 ${nf_role_lc}= Convert To Lowercase ${nf_role}
370 ${resp}= Get ASDC Catalog Resource Component Instances Properties For Resource ${catalog_resource_id}
371 ${componentInstances} Set Variable @{resp['componentInstancesProperties']}
372 # componentInstances can have 1 or more than 1 entry
373 ${passed}= Run Keyword And Return Status Evaluate type(${componentInstances})
374 ${type}= Run Keyword If ${passed} Evaluate type(${componentInstances})
375 ${componentInstancesList}= Run Keyword If "${type}"!="<type 'list'>" Create List ${componentInstances}
376 ... ELSE Set Variable ${componentInstances}
377 :FOR ${item} IN @{componentInstancesList}
378 \ ${test} ${v}= Run Keyword and Ignore Error Should Contain ${item} ${nf_role_lc}
379 \ Run Keyword If '${test}' == 'FAIL' Continue For Loop
380 \ ${componentInstance1}= Set Variable ${item}
381 ${dict}= Create Dictionary
382 :FOR ${comp} IN @{resp['componentInstancesProperties']["${componentInstance1}"]}
383 \ ${name} Set Variable ${comp['name']}
384 \ ${test} ${v}= Run Keyword and Ignore Error Should Contain Any ${name} network_role providing_service_invariant_uuid providing_service_uuid providing_service_name uniqueId
385 \ Run Keyword If '${test}' == 'FAIL' Continue For Loop
386 \ ${parentUniqueId} Set Variable ${comp['parentUniqueId']}
387 \ ${ownerId} Set Variable ${comp['ownerId']}
388 \ Set To Dictionary ${dict} parentUniqueId=${parentUniqueId} ownerId=${ownerId}
389 \ Run Keyword If '${name}'=='providing_service_invariant_uuid' Set To Dictionary ${dict} providing_service_invariant_uuid=${invariantUUID}
390 \ Run Keyword If '${name}'=='providing_service_uuid' Set To Dictionary ${dict} providing_service_uuid=${UUID}
391 \ Run Keyword If '${name}'=='providing_service_name' Set To Dictionary ${dict} providing_service_name=${node_type}
392 # Sets it for each loop but should be one
393 \ ${uniqueId} Set Variable ${comp['uniqueId']}
394 \ ${uniqueId} Fetch From Left ${uniqueId} .
395 \ Set To Dictionary ${dict} uniqueId=${uniqueId}
DR695H3bb6cf42019-06-20 15:04:04 -0400396 Create Environment sdc ${GLOBAL_TEMPLATE_FOLDER}
397 ${data}= Apply Template sdc ${SDC_CATALOG_ALLOTTED_RESOURCE_PROPERTIES_TEMPLATE} ${dict}
bdfreeman1421b2a49512018-11-25 07:32:19 -0500398 ${response}= Set ASDC Catalog Resource Component Instance Properties For Resource ${catalog_resource_id} ${componentInstance1} ${data}
DR695H8e7028b2019-07-10 10:13:58 -0400399 Log resp=${response}
bdfreeman1421b2a49512018-11-25 07:32:19 -0500400
401
402Setup SDC Catalog Resource AllottedResource Inputs
403 [Documentation] Set up Allotted Resource inputs
404 [Arguments] ${catalog_service_id} ${nf_role} ${catalog_resource_id}
405 # Set vnf inputs
406 ${resp}= Get ASDC Catalog Resource Inputs ${catalog_resource_id}
407 ${dict}= Create Dictionary
DR695H910097e2019-05-08 13:55:32 -0400408 :FOR ${comp} IN @{resp['inputs']}
bdfreeman1421b2a49512018-11-25 07:32:19 -0500409 \ ${name} Set Variable ${comp['name']}
410 \ ${uid} Set Variable ${comp['uniqueId']}
411 \ Run Keyword If '${name}'=='nf_type' Set To Dictionary ${dict} nf_type=${nf_role} nf_type_uid=${uid}
412 \ Run Keyword If '${name}'=='nf_role' Set To Dictionary ${dict} nf_role=${nf_role} nf_role_uid=${uid}
DR695H3bb6cf42019-06-20 15:04:04 -0400413 Create Environment sdc ${GLOBAL_TEMPLATE_FOLDER}
414 ${data}= Apply Template sdc ${SDC_CATALOG_ALLOTTED_RESOURCE_INPUTS_TEMPLATE} ${dict}
bdfreeman1421b2a49512018-11-25 07:32:19 -0500415 ${response}= Set ASDC Catalog Resource VNF Inputs ${catalog_resource_id} ${data}
416 [Return] ${response}
417
Yang Xu2ec80382018-11-01 12:30:37 -0400418Setup ASDC Catalog Resource CDS Properties
419 [Documentation] Set up vfwng VNF properties and inputs for CDS
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500420 [Arguments] ${catalog_resource_id}
Yang Xu2ec80382018-11-01 12:30:37 -0400421 # Set vnf module properties
422 ${resp}= Get ASDC Catalog Resource Component Instances ${catalog_resource_id}
DR695H910097e2019-05-08 13:55:32 -0400423 :FOR ${comp} IN @{resp['componentInstances']}
Yang Xu2ec80382018-11-01 12:30:37 -0400424 \ ${name} Set Variable ${comp['name']}
425 \ ${uniqueId} Set Variable ${comp['uniqueId']}
426 \ ${actualComponentUid} Set Variable ${comp['actualComponentUid']}
427 \ ${test} ${v}= Run Keyword and Ignore Error Should Contain ${name} abstract_
428 \ Run Keyword If '${test}' == 'FAIL' Continue For Loop
429 \ ${response}= Get ASDC Catalog Resource Component Instance Properties ${catalog_resource_id} ${uniqueId} ${actualComponentUid}
430 \ ${dict}= Create Dictionary parent_id=${response[6]['parentUniqueId']}
431 \ Run Keyword If '${name}'=='abstract_vfw' Set To Dictionary ${dict} nfc_function=vfw nfc_naming_policy=SDNC_Policy.ONAP_VFW_NAMING_TIMESTAMP
432 \ Run Keyword If '${name}'=='abstract_vpg' Set To Dictionary ${dict} nfc_function=vpg nfc_naming_policy=SDNC_Policy.ONAP_VPG_NAMING_TIMESTAMP
433 \ Run Keyword If '${name}'=='abstract_vsn' Set To Dictionary ${dict} nfc_function=vsn nfc_naming_policy=SDNC_Policy.ONAP_VSN_NAMING_TIMESTAMP
DR695H3bb6cf42019-06-20 15:04:04 -0400434 \ Create Environment sdc ${GLOBAL_TEMPLATE_FOLDER}
435 \ ${data}= Apply Template sdc ${ASDC_RESOURCE_INSTANCE_VNF_PROPERTIES_TEMPLATE} ${dict}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500436 \ ${response}= Set ASDC Catalog Resource Component Instance Properties ${catalog_resource_id} ${uniqueId} ${data}
DR695H8e7028b2019-07-10 10:13:58 -0400437 \ Log resp=${response}
Yang Xu2ec80382018-11-01 12:30:37 -0400438
439 # Set vnf inputs
440 ${resp}= Get ASDC Catalog Resource Inputs ${catalog_resource_id}
441 ${dict}= Create Dictionary
DR695H910097e2019-05-08 13:55:32 -0400442 :FOR ${comp} IN @{resp['inputs']}
Yang Xu2ec80382018-11-01 12:30:37 -0400443 \ ${name} Set Variable ${comp['name']}
444 \ ${uid} Set Variable ${comp['uniqueId']}
445 \ Run Keyword If '${name}'=='nf_function' Set To Dictionary ${dict} nf_function=ONAP-FIREWALL nf_function_uid=${uid}
446 \ Run Keyword If '${name}'=='nf_type' Set To Dictionary ${dict} nf_type=FIREWALL nf_type_uid=${uid}
447 \ Run Keyword If '${name}'=='nf_naming_code' Set To Dictionary ${dict} nf_naming_code=vfw nf_naming_code_uid=${uid}
448 \ Run Keyword If '${name}'=='nf_role' Set To Dictionary ${dict} nf_role=vFW nf_role_uid=${uid}
449 \ Run Keyword If '${name}'=='cloud_env' Set To Dictionary ${dict} cloud_env=openstack cloud_env_uid=${uid}
DR695H3bb6cf42019-06-20 15:04:04 -0400450 Create Environment sdc ${GLOBAL_TEMPLATE_FOLDER}
451 ${data}= Apply Template sdc ${ASDC_RESOURCE_INSTANCE_VNF_INPUTS_TEMPLATE} ${dict}
Yang Xu2ec80382018-11-01 12:30:37 -0400452 ${response}= Set ASDC Catalog Resource VNF Inputs ${catalog_resource_id} ${data}
453
DR695Hccff30b2017-02-17 18:44:24 -0500454Add ASDC License Model
kaihlavi06fa4ee2019-05-22 19:08:14 +0300455 [Documentation] Creates an ASDC License Model and returns its id
DR695H18872bc2019-06-13 16:16:52 -0400456 ${uuid}= Generate UUID4
Jerry Floode2a48d72017-06-21 15:06:29 -0400457 ${shortened_uuid}= Evaluate str("${uuid}")[:23]
DR695Hccff30b2017-02-17 18:44:24 -0500458 ${map}= Create Dictionary vendor_name=${shortened_uuid}
DR695H3bb6cf42019-06-20 15:04:04 -0400459 Create Environment sdc ${GLOBAL_TEMPLATE_FOLDER}
460 ${data}= Apply Template sdc ${ASDC_LICENSE_MODEL_TEMPLATE} ${map}
DR695H39a6be82019-07-10 19:08:20 -0400461 ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD}
462 ${resp}= Run Post Request ${ASDC_BE_ONBOARD_ENDPOINT} ${ASDC_VENDOR_LICENSE_MODEL_PATH} ${data} ${ASDC_DESIGNER_USER_ID} auth=${auth}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500463 Should Be Equal As Strings ${resp.status_code} 200
Brian Freemanb568e5e2018-04-05 21:03:38 -0500464 [Return] ${resp.json()['itemId']} ${resp.json()['version']['id']}
DR695H39a6be82019-07-10 19:08:20 -0400465
DR695Hccff30b2017-02-17 18:44:24 -0500466Get ASDC License Model
467 [Documentation] gets an asdc license model by its id
Jerry Floode2a48d72017-06-21 15:06:29 -0400468 [Arguments] ${id} ${version_id}=0.1
Brian Freeman44b8bb32018-05-03 21:08:42 -0500469 ${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 -0400470 [Return] ${resp.json()}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500471
kaihlavi06fa4ee2019-05-22 19:08:14 +0300472Get ASDC License Models
473 [Documentation] Gets all ASDC License Models
474 ${resp}= Run ASDC Get Request ${ASDC_VENDOR_LICENSE_MODEL_PATH} ${ASDC_DESIGNER_USER_ID} ${ASDC_BE_ONBOARD_ENDPOINT}
DR695Hccff30b2017-02-17 18:44:24 -0500475 [Return] ${resp.json()}
kaihlavi06fa4ee2019-05-22 19:08:14 +0300476
DR695Hccff30b2017-02-17 18:44:24 -0500477Checkin ASDC License Model
kaihlavi06fa4ee2019-05-22 19:08:14 +0300478 [Documentation] Checks in an ASDC License Model by its id
Jerry Floode2a48d72017-06-21 15:06:29 -0400479 [Arguments] ${id} ${version_id}=0.1
DR695Hccff30b2017-02-17 18:44:24 -0500480 ${map}= Create Dictionary action=Checkin
DR695H3bb6cf42019-06-20 15:04:04 -0400481 Create Environment sdc ${GLOBAL_TEMPLATE_FOLDER}
482 ${data}= Apply Template sdc ${ASDC_ACTION_TEMPLATE} ${map}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500483 ${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}
484 Should Be Equal As Strings ${resp.status_code} 200
DR695Hccff30b2017-02-17 18:44:24 -0500485 [Return] ${resp.json()}
kaihlavi06fa4ee2019-05-22 19:08:14 +0300486
DR695Hccff30b2017-02-17 18:44:24 -0500487Submit ASDC License Model
kaihlavi06fa4ee2019-05-22 19:08:14 +0300488 [Documentation] Submits an ASDC License Model by its id
Jerry Floode2a48d72017-06-21 15:06:29 -0400489 [Arguments] ${id} ${version_id}=0.1
DR695Hccff30b2017-02-17 18:44:24 -0500490 ${map}= Create Dictionary action=Submit
DR695H3bb6cf42019-06-20 15:04:04 -0400491 Create Environment sdc ${GLOBAL_TEMPLATE_FOLDER}
492 ${data}= Apply Template sdc ${ASDC_ACTION_TEMPLATE} ${map}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500493 ${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 -0500494 Should Be Equal As Strings ${resp.status_code} 200
DR695Hccff30b2017-02-17 18:44:24 -0500495 [Return] ${resp.json()}
kaihlavi06fa4ee2019-05-22 19:08:14 +0300496
DR695Hccff30b2017-02-17 18:44:24 -0500497Checkin ASDC Software Product
kaihlavi06fa4ee2019-05-22 19:08:14 +0300498 [Documentation] Checks in an ASDC Software Product by its id
Jerry Floode2a48d72017-06-21 15:06:29 -0400499 [Arguments] ${id} ${version_id}=0.1
DR695Hccff30b2017-02-17 18:44:24 -0500500 ${map}= Create Dictionary action=Checkin
DR695H3bb6cf42019-06-20 15:04:04 -0400501 Create Environment sdc ${GLOBAL_TEMPLATE_FOLDER}
502 ${data}= Apply Template sdc ${ASDC_ACTION_TEMPLATE} ${map}
Brian Freeman44b8bb32018-05-03 21:08:42 -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}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500504 Should Be Equal As Strings ${resp.status_code} 200
Jerry Floode2a48d72017-06-21 15:06:29 -0400505 [Return] ${resp.json()}
kaihlavi06fa4ee2019-05-22 19:08:14 +0300506
Jerry Floode2a48d72017-06-21 15:06:29 -0400507Validate ASDC Software Product
kaihlavi06fa4ee2019-05-22 19:08:14 +0300508 [Documentation] Validates an ASDC Software Product by its id
Jerry Floode2a48d72017-06-21 15:06:29 -0400509 [Arguments] ${id} ${version_id}=0.1
510 ${data}= Catenate
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500511 ${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}
512 Should Be Equal As Strings ${resp.status_code} 200
DR695Hccff30b2017-02-17 18:44:24 -0500513 [Return] ${resp.json()}
kaihlavi06fa4ee2019-05-22 19:08:14 +0300514
DR695Hccff30b2017-02-17 18:44:24 -0500515Submit ASDC Software Product
kaihlavi06fa4ee2019-05-22 19:08:14 +0300516 [Documentation] Submits an ASDC Software Product by its id
Jerry Floode2a48d72017-06-21 15:06:29 -0400517 [Arguments] ${id} ${version_id}=0.1
DR695Hccff30b2017-02-17 18:44:24 -0500518 ${map}= Create Dictionary action=Submit
DR695H3bb6cf42019-06-20 15:04:04 -0400519 Create Environment sdc ${GLOBAL_TEMPLATE_FOLDER}
520 ${data}= Apply Template sdc ${ASDC_ACTION_TEMPLATE} ${map}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500521 ${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}
522 Should Be Equal As Strings ${resp.status_code} 200
DR695Hccff30b2017-02-17 18:44:24 -0500523 [Return] ${resp.json()}
kaihlavi06fa4ee2019-05-22 19:08:14 +0300524
DR695Hccff30b2017-02-17 18:44:24 -0500525Package ASDC Software Product
kaihlavi06fa4ee2019-05-22 19:08:14 +0300526 [Documentation] Creates a package of an ASDC Software Product by its id
Jerry Floode2a48d72017-06-21 15:06:29 -0400527 [Arguments] ${id} ${version_id}=0.1
DR695Hccff30b2017-02-17 18:44:24 -0500528 ${map}= Create Dictionary action=Create_Package
DR695H3bb6cf42019-06-20 15:04:04 -0400529 Create Environment sdc ${GLOBAL_TEMPLATE_FOLDER}
530 ${data}= Apply Template sdc ${ASDC_ACTION_TEMPLATE} ${map}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500531 ${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}
532 Should Be Equal As Strings ${resp.status_code} 200
Jerry Floode2a48d72017-06-21 15:06:29 -0400533 [Return] ${resp.json()}
kaihlavi06fa4ee2019-05-22 19:08:14 +0300534
DR695Hccff30b2017-02-17 18:44:24 -0500535Add ASDC Entitlement Pool
kaihlavi06fa4ee2019-05-22 19:08:14 +0300536 [Documentation] Creates an ASDC Entitlement Pool and returns its id
Brian Freeman15033782019-03-22 15:48:55 -0500537 [Arguments] ${license_model_id} ${version_id}=0.1 ${license_start_date}="01/01/1960" ${license_end_date}="01/01/1961"
DR695H18872bc2019-06-13 16:16:52 -0400538 ${uuid}= Generate UUID4
Jerry Floode2a48d72017-06-21 15:06:29 -0400539 ${shortened_uuid}= Evaluate str("${uuid}")[:23]
Brian Freeman15033782019-03-22 15:48:55 -0500540 ${map}= Create Dictionary entitlement_pool_name=${shortened_uuid} license_start_date=${license_start_date} license_end_date=${license_end_date}
DR695H3bb6cf42019-06-20 15:04:04 -0400541 Create Environment sdc ${GLOBAL_TEMPLATE_FOLDER}
542 ${data}= Apply Template sdc ${ASDC_ENTITLEMENT_POOL_TEMPLATE} ${map}
DR695H39a6be82019-07-10 19:08:20 -0400543 ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD}
544 ${resp}= Run Post Request ${ASDC_BE_ONBOARD_ENDPOINT} ${ASDC_VENDOR_LICENSE_MODEL_PATH}/${license_model_id}/versions/${version_id}${ASDC_VENDOR_ENTITLEMENT_POOL_PATH} ${data} ${ASDC_DESIGNER_USER_ID} auth=${auth}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500545 Should Be Equal As Strings ${resp.status_code} 200
DR695Hccff30b2017-02-17 18:44:24 -0500546 [Return] ${resp.json()['value']}
kaihlavi06fa4ee2019-05-22 19:08:14 +0300547
DR695Hccff30b2017-02-17 18:44:24 -0500548Get ASDC Entitlement Pool
kaihlavi06fa4ee2019-05-22 19:08:14 +0300549 [Documentation] Gets an ASDC Entitlement Pool by its id
DR695Hccff30b2017-02-17 18:44:24 -0500550 [Arguments] ${license_model_id} ${pool_id}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500551 ${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 -0500552 [Return] ${resp.json()}
kaihlavi06fa4ee2019-05-22 19:08:14 +0300553
DR695Hccff30b2017-02-17 18:44:24 -0500554Add ASDC License Group
kaihlavi06fa4ee2019-05-22 19:08:14 +0300555 [Documentation] Creates an ASDC License Group and returns its id
Brian Freeman15033782019-03-22 15:48:55 -0500556 [Arguments] ${license_model_id} ${version_id}=1.0 ${license_start_date}="01/01/1960" ${license_end_date}="01/01/1961"
DR695H18872bc2019-06-13 16:16:52 -0400557 ${uuid}= Generate UUID4
Jerry Floode2a48d72017-06-21 15:06:29 -0400558 ${shortened_uuid}= Evaluate str("${uuid}")[:23]
Brian Freeman15033782019-03-22 15:48:55 -0500559 ${map}= Create Dictionary key_group_name=${shortened_uuid} license_start_date=${license_start_date} license_end_date=${license_end_date}
DR695H3bb6cf42019-06-20 15:04:04 -0400560 Create Environment sdc ${GLOBAL_TEMPLATE_FOLDER}
561 ${data}= Apply Template sdc ${ASDC_KEY_GROUP_TEMPLATE} ${map}
DR695H39a6be82019-07-10 19:08:20 -0400562 ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD}
563 ${resp}= Run Post Request ${ASDC_BE_ONBOARD_ENDPOINT} ${ASDC_VENDOR_LICENSE_MODEL_PATH}/${license_model_id}/versions/${version_id}${ASDC_VENDOR_KEY_GROUP_PATH} ${data} ${ASDC_DESIGNER_USER_ID} auth=${auth}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500564 Should Be Equal As Strings ${resp.status_code} 200
DR695Hccff30b2017-02-17 18:44:24 -0500565 [Return] ${resp.json()['value']}
kaihlavi06fa4ee2019-05-22 19:08:14 +0300566
DR695Hccff30b2017-02-17 18:44:24 -0500567Get ASDC License Group
kaihlavi06fa4ee2019-05-22 19:08:14 +0300568 [Documentation] Gets an ASDC License Group by its id
Jerry Floode2a48d72017-06-21 15:06:29 -0400569 [Arguments] ${license_model_id} ${group_id} ${version_id}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500570 ${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 -0500571 [Return] ${resp.json()}
kaihlavi06fa4ee2019-05-22 19:08:14 +0300572
DR695Hccff30b2017-02-17 18:44:24 -0500573Add ASDC Feature Group
kaihlavi06fa4ee2019-05-22 19:08:14 +0300574 [Documentation] Creates an ASDC Feature Group and returns its id
Jerry Floode2a48d72017-06-21 15:06:29 -0400575 [Arguments] ${license_model_id} ${key_group_id} ${entitlement_pool_id} ${version_id}=0.1
DR695H18872bc2019-06-13 16:16:52 -0400576 ${uuid}= Generate UUID4
Jerry Floode2a48d72017-06-21 15:06:29 -0400577 ${shortened_uuid}= Evaluate str("${uuid}")[:23]
Jerry Flood80ff9852017-08-11 06:47:14 -0400578 ${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}
DR695H3bb6cf42019-06-20 15:04:04 -0400579 Create Environment sdc ${GLOBAL_TEMPLATE_FOLDER}
580 ${data}= Apply Template sdc ${ASDC_FEATURE_GROUP_TEMPLATE} ${map}
DR695H39a6be82019-07-10 19:08:20 -0400581 ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD}
582 ${resp}= Run Post Request ${ASDC_BE_ONBOARD_ENDPOINT} ${ASDC_VENDOR_LICENSE_MODEL_PATH}/${license_model_id}/versions/${version_id}${ASDC_VENDOR_FEATURE_GROUP_PATH} ${data} ${ASDC_DESIGNER_USER_ID} auth=${auth}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500583 Should Be Equal As Strings ${resp.status_code} 200
DR695Hccff30b2017-02-17 18:44:24 -0500584 [Return] ${resp.json()['value']}
kaihlavi06fa4ee2019-05-22 19:08:14 +0300585
DR695Hccff30b2017-02-17 18:44:24 -0500586Get ASDC Feature Group
kaihlavi06fa4ee2019-05-22 19:08:14 +0300587 [Documentation] Gets an ASDC Feature Group by its id
DR695Hccff30b2017-02-17 18:44:24 -0500588 [Arguments] ${license_model_id} ${group_id}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500589 ${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 -0500590 [Return] ${resp.json()}
kaihlavi06fa4ee2019-05-22 19:08:14 +0300591
DR695Hccff30b2017-02-17 18:44:24 -0500592Add ASDC License Agreement
kaihlavi06fa4ee2019-05-22 19:08:14 +0300593 [Documentation] Creates an ASDC License Agreement and returns its id
Jerry Floode2a48d72017-06-21 15:06:29 -0400594 [Arguments] ${license_model_id} ${feature_group_id} ${version_id}=0.1
DR695H18872bc2019-06-13 16:16:52 -0400595 ${uuid}= Generate UUID4
Jerry Floode2a48d72017-06-21 15:06:29 -0400596 ${shortened_uuid}= Evaluate str("${uuid}")[:23]
DR695Hccff30b2017-02-17 18:44:24 -0500597 ${map}= Create Dictionary license_agreement_name=${shortened_uuid} feature_group_id=${feature_group_id}
DR695H3bb6cf42019-06-20 15:04:04 -0400598 Create Environment sdc ${GLOBAL_TEMPLATE_FOLDER}
599 ${data}= Apply Template sdc ${ASDC_LICENSE_AGREEMENT_TEMPLATE} ${map}
DR695H39a6be82019-07-10 19:08:20 -0400600 ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD}
601 ${resp}= Run Post Request ${ASDC_BE_ONBOARD_ENDPOINT} ${ASDC_VENDOR_LICENSE_MODEL_PATH}/${license_model_id}/versions/${version_id}${ASDC_VENDOR_LICENSE_AGREEMENT_PATH} ${data} ${ASDC_DESIGNER_USER_ID} auth=${auth}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500602 Should Be Equal As Strings ${resp.status_code} 200
DR695Hccff30b2017-02-17 18:44:24 -0500603 [Return] ${resp.json()['value']}
kaihlavi06fa4ee2019-05-22 19:08:14 +0300604
DR695Hccff30b2017-02-17 18:44:24 -0500605Get ASDC License Agreement
kaihlavi06fa4ee2019-05-22 19:08:14 +0300606 [Documentation] Gets an ASDC License Agreement by its id
DR695Hccff30b2017-02-17 18:44:24 -0500607 [Arguments] ${license_model_id} ${agreement_id}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500608 ${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 -0500609 [Return] ${resp.json()}
kaihlavi06fa4ee2019-05-22 19:08:14 +0300610
DR695Hccff30b2017-02-17 18:44:24 -0500611Add ASDC Software Product
kaihlavi06fa4ee2019-05-22 19:08:14 +0300612 [Documentation] Creates an ASDC Software Product and returns its id
Brian Freeman9c42ae12018-11-27 14:33:27 -0500613 [Arguments] ${license_agreement_id} ${feature_group_id} ${license_model_name} ${license_model_id} ${license_model_version_id} ${name_prefix}
DR695H18872bc2019-06-13 16:16:52 -0400614 ${uuid}= Generate UUID4
Brian Freeman9c42ae12018-11-27 14:33:27 -0500615 ${shortened_uuid}= Evaluate str("${uuid}")[:13]
616 ${software_product_name}= Catenate ${name_prefix} ${shortened_uuid}
617 ${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}
DR695H3bb6cf42019-06-20 15:04:04 -0400618 Create Environment sdc ${GLOBAL_TEMPLATE_FOLDER}
619 ${data}= Apply Template sdc ${ASDC_SOFTWARE_PRODUCT_TEMPLATE} ${map}
DR695H39a6be82019-07-10 19:08:20 -0400620 ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD}
621 ${resp}= Run Post Request ${ASDC_BE_ONBOARD_ENDPOINT} ${ASDC_VENDOR_SOFTWARE_PRODUCT_PATH} ${data} ${ASDC_DESIGNER_USER_ID} auth=${auth}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500622 Should Be Equal As Strings ${resp.status_code} 200
Brian Freemanb568e5e2018-04-05 21:03:38 -0500623 [Return] ${resp.json()['itemId']} ${resp.json()['version']['id']}
kaihlavi06fa4ee2019-05-22 19:08:14 +0300624
DR695Hccff30b2017-02-17 18:44:24 -0500625Get ASDC Software Product
kaihlavi06fa4ee2019-05-22 19:08:14 +0300626 [Documentation] Gets an ASDC Software Product by its id
Jerry Floode2a48d72017-06-21 15:06:29 -0400627 [Arguments] ${software_product_id} ${version_id}=0.1
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500628 ${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 -0500629 [Return] ${resp.json()}
bdfreeman1421b2a49512018-11-25 07:32:19 -0500630
DR695Hccff30b2017-02-17 18:44:24 -0500631Add ASDC Catalog Resource
kaihlavi06fa4ee2019-05-22 19:08:14 +0300632 [Documentation] Creates an ASDC Catalog Resource and returns its id
DR695Hccff30b2017-02-17 18:44:24 -0500633 [Arguments] ${license_agreement_id} ${software_product_name} ${license_model_name} ${software_product_id}
634 ${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}
DR695H3bb6cf42019-06-20 15:04:04 -0400635 Create Environment sdc ${GLOBAL_TEMPLATE_FOLDER}
636 ${data}= Apply Template sdc ${ASDC_CATALOG_RESOURCE_TEMPLATE} ${map}
DR695H39a6be82019-07-10 19:08:20 -0400637 ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD}
638 ${resp}= Run Post Request ${ASDC_BE_ENDPOINT} ${ASDC_CATALOG_RESOURCES_PATH} ${data} ${ASDC_DESIGNER_USER_ID} auth=${auth}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500639 Should Be Equal As Strings ${resp.status_code} 201
DR695Hccff30b2017-02-17 18:44:24 -0500640 [Return] ${resp.json()['uniqueId']}
bdfreeman1421b2a49512018-11-25 07:32:19 -0500641
642Add ASDC Allotted Resource Catalog Resource
kaihlavi06fa4ee2019-05-22 19:08:14 +0300643 [Documentation] Creates an ASDC Allotted Resource Catalog Resource and returns its id
bdfreeman1421b2a49512018-11-25 07:32:19 -0500644 [Arguments] ${license_agreement_id} ${software_product_name} ${license_model_name} ${software_product_id} ${subcategory}
645 ${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}
DR695H3bb6cf42019-06-20 15:04:04 -0400646 Create Environment sdc ${GLOBAL_TEMPLATE_FOLDER}
647 ${data}= Apply Template sdc ${ASDC_ALLOTTED_RESOURCE_CATALOG_RESOURCE_TEMPLATE} ${map}
DR695H39a6be82019-07-10 19:08:20 -0400648 ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD}
649 ${resp}= Run Post Request ${ASDC_BE_ENDPOINT} ${ASDC_CATALOG_RESOURCES_PATH} ${data} ${ASDC_DESIGNER_USER_ID} auth=${auth}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500650 Should Be Equal As Strings ${resp.status_code} 201
bdfreeman1421b2a49512018-11-25 07:32:19 -0500651 [Return] ${resp.json()['uniqueId']}
652
DR695Hccff30b2017-02-17 18:44:24 -0500653Mark ASDC Catalog Resource Inactive
kaihlavi06fa4ee2019-05-22 19:08:14 +0300654 [Documentation] Marks ASDC Catalog Resource as inactive
DR695Hccff30b2017-02-17 18:44:24 -0500655 [Arguments] ${catalog_resource_id}
656 ${resp}= Run ASDC Delete Request ${ASDC_CATALOG_RESOURCES_PATH}/${catalog_resource_id} ${ASDC_DESIGNER_USER_ID}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500657 Should Be Equal As Strings ${resp.status_code} 204
DR695Hccff30b2017-02-17 18:44:24 -0500658 [Return] ${resp}
kaihlavi06fa4ee2019-05-22 19:08:14 +0300659
DR695Hccff30b2017-02-17 18:44:24 -0500660Delete Inactive ASDC Catalog Resources
kaihlavi06fa4ee2019-05-22 19:08:14 +0300661 [Documentation] Delete all ASDC Catalog Resources that are inactive
DR695Hccff30b2017-02-17 18:44:24 -0500662 ${resp}= Run ASDC Delete Request ${ASDC_CATALOG_INACTIVE_RESOURCES_PATH} ${ASDC_DESIGNER_USER_ID}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500663 Should Be Equal As Strings ${resp.status_code} 200
DR695Hccff30b2017-02-17 18:44:24 -0500664 [Return] ${resp.json()}
kaihlavi06fa4ee2019-05-22 19:08:14 +0300665
DR695Hccff30b2017-02-17 18:44:24 -0500666Get ASDC Catalog Resource
kaihlavi06fa4ee2019-05-22 19:08:14 +0300667 [Documentation] Gets an ASDC Catalog Resource by its id
DR695Hccff30b2017-02-17 18:44:24 -0500668 [Arguments] ${catalog_resource_id}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500669 ${resp}= Run ASDC Get Request ${ASDC_CATALOG_RESOURCES_PATH}/${catalog_resource_id} ${ASDC_DESIGNER_USER_ID}
DR695Hccff30b2017-02-17 18:44:24 -0500670 [Return] ${resp.json()}
Brian Freemaneef7c6f2018-11-16 18:42:21 -0500671
Yang Xu2ec80382018-11-01 12:30:37 -0400672Get ASDC Catalog Resource Component Instances
kaihlavi06fa4ee2019-05-22 19:08:14 +0300673 [Documentation] Gets component instances of an ASDC Catalog Resource by its id
Yang Xu2ec80382018-11-01 12:30:37 -0400674 [Arguments] ${catalog_resource_id}
675 ${resp}= Run ASDC Get Request ${ASDC_FE_CATALOG_RESOURCES_PATH}/${catalog_resource_id}/filteredDataByParams?include=componentInstances ${ASDC_DESIGNER_USER_ID} ${ASDC_FE_ENDPOINT}
676 [Return] ${resp.json()}
bdfreeman1421b2a49512018-11-25 07:32:19 -0500677
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500678Get ASDC Catalog Resource Deployment Artifact Properties
kaihlavi06fa4ee2019-05-22 19:08:14 +0300679 [Documentation] Gets deployment artifact properties of an ASDC Catalog Resource by its id
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500680 [Arguments] ${catalog_resource_id}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500681 ${resp}= Run ASDC Get Request ${ASDC_CATALOG_SERVICES_PATH}/${catalog_resource_id}/filteredDataByParams?include=deploymentArtifacts ${ASDC_DESIGNER_USER_ID} ${ASDC_FE_ENDPOINT}
682 [Return] ${resp.json()}
683
684
Brian Freemaneef7c6f2018-11-16 18:42:21 -0500685Get ASDC Catalog Resource Component Instances Properties
kaihlavi06fa4ee2019-05-22 19:08:14 +0300686 [Documentation] Gets ASDC Catalog Resource component instances properties by its id
Brian Freemaneef7c6f2018-11-16 18:42:21 -0500687 [Arguments] ${catalog_resource_id}
Brian Freemaneef7c6f2018-11-16 18:42:21 -0500688 ${resp}= Run ASDC Get Request ${ASDC_CATALOG_SERVICES_PATH}/${catalog_resource_id}/filteredDataByParams?include=componentInstancesProperties ${ASDC_DESIGNER_USER_ID} ${ASDC_BE_ENDPOINT}
689 [Return] ${resp.json()}
690
bdfreeman1421b2a49512018-11-25 07:32:19 -0500691Get ASDC Catalog Resource Component Instances Properties For Resource
kaihlavi06fa4ee2019-05-22 19:08:14 +0300692 [Documentation] Gets ASDC Catalog Resource component instances properties for a Resource (VF) by its id
bdfreeman1421b2a49512018-11-25 07:32:19 -0500693 [Arguments] ${catalog_resource_id}
694 ${resp}= Run ASDC Get Request ${ASDC_FE_CATALOG_RESOURCES_PATH}/${catalog_resource_id}/filteredDataByParams?include=componentInstancesProperties ${ASDC_DESIGNER_USER_ID} ${ASDC_FE_ENDPOINT}
695 [Return] ${resp.json()}
Brian Freemaneef7c6f2018-11-16 18:42:21 -0500696
Yang Xu2ec80382018-11-01 12:30:37 -0400697Get ASDC Catalog Resource Inputs
kaihlavi06fa4ee2019-05-22 19:08:14 +0300698 [Documentation] Gets ASDC Catalog Resource inputs by its id
Yang Xu2ec80382018-11-01 12:30:37 -0400699 [Arguments] ${catalog_resource_id}
700 ${resp}= Run ASDC Get Request ${ASDC_FE_CATALOG_RESOURCES_PATH}/${catalog_resource_id}/filteredDataByParams?include=inputs ${ASDC_DESIGNER_USER_ID} ${ASDC_FE_ENDPOINT}
701 [Return] ${resp.json()}
Brian Freemaneef7c6f2018-11-16 18:42:21 -0500702
Yang Xu2ec80382018-11-01 12:30:37 -0400703Get ASDC Catalog Resource Component Instance Properties
kaihlavi06fa4ee2019-05-22 19:08:14 +0300704 [Documentation] Gets component instance properties of an ASDC Catalog Resource by their ids
Yang Xu2ec80382018-11-01 12:30:37 -0400705 [Arguments] ${catalog_resource_id} ${component_instance_id} ${component_id}
706 ${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}
707 [Return] ${resp.json()}
bdfreeman1421b2a49512018-11-25 07:32:19 -0500708
Yang Xu2ec80382018-11-01 12:30:37 -0400709Set ASDC Catalog Resource Component Instance Properties
kaihlavi06fa4ee2019-05-22 19:08:14 +0300710 [Documentation] Sets ASDC Catalog Resource component instance properties by ids
Brian Freemaneef7c6f2018-11-16 18:42:21 -0500711 [Arguments] ${catalog_resource_id} ${component_parent_service_id} ${data}
DR695H39a6be82019-07-10 19:08:20 -0400712 ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD}
713 ${resp}= Run Post Request ${ASDC_FE_ENDPOINT} ${ASDC_FE_CATALOG_SERVICES_PATH}/${component_parent_service_id}/resourceInstance/${catalog_resource_id}/properties ${data} ${ASDC_DESIGNER_USER_ID} auth=${auth}
bdfreeman1421b2a49512018-11-25 07:32:19 -0500714 [Return] ${resp.json()}
715
716Set ASDC Catalog Resource Component Instance Properties For Resource
kaihlavi06fa4ee2019-05-22 19:08:14 +0300717 [Documentation] Sets ASDC Resource component instance properties by ids
bdfreeman1421b2a49512018-11-25 07:32:19 -0500718 [Arguments] ${catalog_parent_resource_id} ${catalog_resource_id} ${data}
DR695H39a6be82019-07-10 19:08:20 -0400719 ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD}
720 ${resp}= Run Post Request ${ASDC_FE_ENDPOINT} ${ASDC_FE_CATALOG_RESOURCES_PATH}/${catalog_parent_resource_id}/resourceInstance/${catalog_resource_id}/properties ${data} ${ASDC_DESIGNER_USER_ID} auth=${auth}
bdfreeman1421b2a49512018-11-25 07:32:19 -0500721 [Return] ${resp.json()}
Brian Freemaneef7c6f2018-11-16 18:42:21 -0500722
Yang Xu74cfb862018-12-06 21:57:32 -0500723Set CDS Catalog Resource Component Instance Properties
kaihlavi06fa4ee2019-05-22 19:08:14 +0300724 [Documentation] Sets CDS Catalog Resource component instance properties by ids
Yang Xu74cfb862018-12-06 21:57:32 -0500725 [Arguments] ${catalog_resource_id} ${component_instance_id} ${data}
DR695H39a6be82019-07-10 19:08:20 -0400726 ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD}
727 ${resp}= Run Post Request ${ASDC_FE_ENDPOINT} ${ASDC_FE_CATALOG_RESOURCES_PATH}/${catalog_resource_id}/resourceInstance/${component_instance_id}/inputs ${data} ${ASDC_DESIGNER_USER_ID} auth=${auth}
Yang Xu74cfb862018-12-06 21:57:32 -0500728 [Return] ${resp.json()}
729
Yang Xu2ec80382018-11-01 12:30:37 -0400730Set ASDC Catalog Resource VNF Inputs
kaihlavi06fa4ee2019-05-22 19:08:14 +0300731 [Documentation] Sets VNF Inputs for an ASDC Catalog Resource by its id
Yang Xu2ec80382018-11-01 12:30:37 -0400732 [Arguments] ${catalog_resource_id} ${data}
DR695H39a6be82019-07-10 19:08:20 -0400733 ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD}
734 ${resp}= Run Post Request ${ASDC_FE_ENDPOINT} ${ASDC_FE_CATALOG_RESOURCES_PATH}/${catalog_resource_id}/update/inputs ${data} ${ASDC_DESIGNER_USER_ID} auth=${auth}
Yang Xu2ec80382018-11-01 12:30:37 -0400735 [Return] ${resp.json()}
kaihlavi06fa4ee2019-05-22 19:08:14 +0300736
Brian Freeman79b00ce2018-11-01 14:57:53 -0500737Get SDC Demo Vnf Catalog Resource
kaihlavi06fa4ee2019-05-22 19:08:14 +0300738 [Documentation] Gets Resource ids of demonstration VNFs for instantiation
Brian Freeman79b00ce2018-11-01 14:57:53 -0500739 [Arguments] ${service_name}
740 ${resp}= Run ASDC Get Request ${ASDC_CATALOG_SERVICES_PATH}/serviceName/${service_name}/serviceVersion/1.0
741 @{ITEMS}= Copy List ${resp.json()['componentInstances']}
742 ${demo_catalog_resource}= Create Dictionary
743 :FOR ${ELEMENT} IN @{ITEMS}
744 \ Log ${ELEMENT['name']}
745 \ Log ${ELEMENT['groupInstances'][0]['groupName']}
746 \ ${vnf}= Get VNF From Group Name ${ELEMENT['groupInstances'][0]['groupName']} ${service_name}
747 \ ${vnf_data}= Create Dictionary vnf_type=${ELEMENT['name']} vf_module=${ELEMENT['groupInstances'][0]['groupName']}
748 \ LOG ${vnf_data}
749 \ Set To Dictionary ${demo_catalog_resource} ${vnf}=${vnf_data}
750 \ LOG ${demo_catalog_resource}
751 [Return] ${demo_catalog_resource}
752
753Get VNF From Group Name
kaihlavi06fa4ee2019-05-22 19:08:14 +0300754 [Documentation] Looks up VNF key from service mapping for a regex on group_name and service_name
Brian Freeman79b00ce2018-11-01 14:57:53 -0500755 [Arguments] ${group_name} ${service_name}
756 ${vnf}= Set Variable If
Brian Freeman4c71b0b2019-04-26 08:08:56 -0500757 ... ('${service_name}'=='demoVFWCL') and ('base_vfw' in '${group_name}') vFWCLvFWSNK
758 ... ('${service_name}'=='demoVFWCL') and ('base_vpkg' in '${group_name}') vFWCLvPKG
Brian Freeman79b00ce2018-11-01 14:57:53 -0500759 ... ('${service_name}'=='demoVLB') and ('base_vlb' in '${group_name}') vLB
760 [Return] ${vnf}
kaihlavi06fa4ee2019-05-22 19:08:14 +0300761
DR695Hccff30b2017-02-17 18:44:24 -0500762Checkin ASDC Catalog Resource
kaihlavi06fa4ee2019-05-22 19:08:14 +0300763 [Documentation] Checks in an ASDC Catalog Resource by its id
DR695Hccff30b2017-02-17 18:44:24 -0500764 [Arguments] ${catalog_resource_id}
765 ${map}= Create Dictionary user_remarks=Robot remarks
DR695H3bb6cf42019-06-20 15:04:04 -0400766 Create Environment sdc ${GLOBAL_TEMPLATE_FOLDER}
767 ${data}= Apply Template sdc ${ASDC_USER_REMARKS_TEMPLATE} ${map}
DR695H39a6be82019-07-10 19:08:20 -0400768 ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD}
769 ${resp}= Run Post Request ${ASDC_BE_ENDPOINT} ${ASDC_DESIGNER_USER_ID} ${ASDC_CATALOG_RESOURCES_PATH}/${catalog_resource_id}${ASDC_CATALOG_LIFECYCLE_PATH}/checkin ${data} auth=${auth}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500770 Should Be Equal As Strings ${resp.status_code} 200
DR695Hccff30b2017-02-17 18:44:24 -0500771 [Return] ${resp.json()}
kaihlavi06fa4ee2019-05-22 19:08:14 +0300772
DR695Hccff30b2017-02-17 18:44:24 -0500773Request Certify ASDC Catalog Resource
kaihlavi06fa4ee2019-05-22 19:08:14 +0300774 [Documentation] Requests certification of an ASDC Catalog Resource by its id
DR695Hccff30b2017-02-17 18:44:24 -0500775 [Arguments] ${catalog_resource_id}
776 ${map}= Create Dictionary user_remarks=Robot remarks
DR695H3bb6cf42019-06-20 15:04:04 -0400777 Create Environment sdc ${GLOBAL_TEMPLATE_FOLDER}
778 ${data}= Apply Template sdc ${ASDC_USER_REMARKS_TEMPLATE} ${map}
DR695H39a6be82019-07-10 19:08:20 -0400779 ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD}
780 ${resp}= Run Post Request ${ASDC_BE_ENDPOINT} ${ASDC_CATALOG_RESOURCES_PATH}/${catalog_resource_id}${ASDC_CATALOG_LIFECYCLE_PATH}/certificationRequest ${data} ${ASDC_DESIGNER_USER_ID} auth=${auth}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500781 Should Be Equal As Strings ${resp.status_code} 200
DR695Hccff30b2017-02-17 18:44:24 -0500782 [Return] ${resp.json()}
kaihlavi06fa4ee2019-05-22 19:08:14 +0300783
DR695Hccff30b2017-02-17 18:44:24 -0500784Start Certify ASDC Catalog Resource
kaihlavi06fa4ee2019-05-22 19:08:14 +0300785 [Documentation] Start certification of an ASDC Catalog Resource by its id
DR695Hccff30b2017-02-17 18:44:24 -0500786 [Arguments] ${catalog_resource_id}
DR695H39a6be82019-07-10 19:08:20 -0400787 ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD}
788 ${resp}= Run Post Request ${ASDC_BE_ENDPOINT} ${ASDC_CATALOG_RESOURCES_PATH}/${catalog_resource_id}${ASDC_CATALOG_LIFECYCLE_PATH}/startCertification ${None} ${ASDC_TESTER_USER_ID} auth=${auth}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500789 Should Be Equal As Strings ${resp.status_code} 200
DR695Hccff30b2017-02-17 18:44:24 -0500790 [Return] ${resp.json()}
kaihlavi06fa4ee2019-05-22 19:08:14 +0300791
DR695Hccff30b2017-02-17 18:44:24 -0500792Certify ASDC Catalog Resource
kaihlavi06fa4ee2019-05-22 19:08:14 +0300793 [Documentation] Certifies an ASDC Catalog Resource by its id and returns the new id
Brian Freemandb1e7412018-08-01 12:46:01 -0500794 [Arguments] ${catalog_resource_id} ${user_id}=${ASDC_TESTER_USER_ID}
DR695Hccff30b2017-02-17 18:44:24 -0500795 ${map}= Create Dictionary user_remarks=Robot remarks
DR695H3bb6cf42019-06-20 15:04:04 -0400796 Create Environment sdc ${GLOBAL_TEMPLATE_FOLDER}
797 ${data}= Apply Template sdc ${ASDC_USER_REMARKS_TEMPLATE} ${map}
DR695H39a6be82019-07-10 19:08:20 -0400798 ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD}
799 ${resp}= Run Post Request ${ASDC_BE_ENDPOINT} ${ASDC_CATALOG_RESOURCES_PATH}/${catalog_resource_id}${ASDC_CATALOG_LIFECYCLE_PATH}/certify ${data} ${user_id} auth=${auth}
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()['uniqueId']}
Jerry Flood6bd1afa2017-10-09 09:59:23 -0400802
DR695Hccff30b2017-02-17 18:44:24 -0500803Upload ASDC Heat Package
kaihlavi06fa4ee2019-05-22 19:08:14 +0300804 [Documentation] Creates an ASDC Software Product and returns its id
Brian Freemanf508ab22018-03-15 21:19:41 -0500805 [Arguments] ${software_product_id} ${file_path} ${version_id}=0.1
Jerry Flood6bd1afa2017-10-09 09:59:23 -0400806 ${files}= Create Dictionary
807 Create Multi Part ${files} upload ${file_path} contentType=application/zip
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500808 ${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}
809 Should Be Equal As Strings ${resp.status_code} 200
Jerry Flood6bd1afa2017-10-09 09:59:23 -0400810
DR695Hccff30b2017-02-17 18:44:24 -0500811Add ASDC Catalog Service
kaihlavi06fa4ee2019-05-22 19:08:14 +0300812 [Documentation] Creates an ASDC Catalog Service and returns its id
jf986075010a42017-02-22 16:52:54 -0500813 [Arguments] ${catalog_service_name}
DR695H18872bc2019-06-13 16:16:52 -0400814 ${uuid}= Generate UUID4
jf986075010a42017-02-22 16:52:54 -0500815 ${shortened_uuid}= Evaluate str("${uuid}")[:23]
Jerry Floode2a48d72017-06-21 15:06:29 -0400816 ${catalog_service_name}= Set Variable If '${catalog_service_name}' =='' ${shortened_uuid} ${catalog_service_name}
jf986075010a42017-02-22 16:52:54 -0500817 ${map}= Create Dictionary service_name=${catalog_service_name}
DR695H3bb6cf42019-06-20 15:04:04 -0400818 Create Environment sdc ${GLOBAL_TEMPLATE_FOLDER}
819 ${data}= Apply Template sdc ${ASDC_CATALOG_SERVICE_TEMPLATE} ${map}
DR695H39a6be82019-07-10 19:08:20 -0400820 ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD}
821 ${resp}= Run Post Request ${ASDC_BE_ENDPOINT} ${ASDC_CATALOG_SERVICES_PATH} ${data} ${ASDC_DESIGNER_USER_ID} auth=${auth}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500822 Should Be Equal As Strings ${resp.status_code} 201
DR695Hccff30b2017-02-17 18:44:24 -0500823 [Return] ${resp.json()['uniqueId']}
kaihlavi06fa4ee2019-05-22 19:08:14 +0300824
DR695Hccff30b2017-02-17 18:44:24 -0500825Mark ASDC Catalog Service Inactive
kaihlavi06fa4ee2019-05-22 19:08:14 +0300826 [Documentation] Deletes an ASDC Catalog Service
DR695Hccff30b2017-02-17 18:44:24 -0500827 [Arguments] ${catalog_service_id}
828 ${resp}= Run ASDC Delete Request ${ASDC_CATALOG_SERVICES_PATH}/${catalog_service_id} ${ASDC_DESIGNER_USER_ID}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500829 Should Be Equal As Strings ${resp.status_code} 204
DR695Hccff30b2017-02-17 18:44:24 -0500830 [Return] ${resp}
kaihlavi06fa4ee2019-05-22 19:08:14 +0300831
DR695Hccff30b2017-02-17 18:44:24 -0500832Delete Inactive ASDC Catalog Services
kaihlavi06fa4ee2019-05-22 19:08:14 +0300833 [Documentation] Delete all ASDC Catalog Services that are inactive
DR695Hccff30b2017-02-17 18:44:24 -0500834 ${resp}= Run ASDC Delete Request ${ASDC_CATALOG_INACTIVE_SERVICES_PATH} ${ASDC_DESIGNER_USER_ID}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500835 Should Be Equal As Strings ${resp.status_code} 200
DR695Hccff30b2017-02-17 18:44:24 -0500836 [Return] ${resp.json()}
kaihlavi06fa4ee2019-05-22 19:08:14 +0300837
DR695Hccff30b2017-02-17 18:44:24 -0500838Get ASDC Catalog Service
kaihlavi06fa4ee2019-05-22 19:08:14 +0300839 [Documentation] Gets an ASDC Catalog Service by its id
DR695Hccff30b2017-02-17 18:44:24 -0500840 [Arguments] ${catalog_service_id}
841 ${resp}= Run ASDC Get Request ${ASDC_CATALOG_SERVICES_PATH}/${catalog_service_id} ${ASDC_DESIGNER_USER_ID}
842 [Return] ${resp.json()}
kaihlavi06fa4ee2019-05-22 19:08:14 +0300843
DR695Hccff30b2017-02-17 18:44:24 -0500844Checkin ASDC Catalog Service
kaihlavi06fa4ee2019-05-22 19:08:14 +0300845 [Documentation] Checks in an ASDC Catalog Service by its id
DR695Hccff30b2017-02-17 18:44:24 -0500846 [Arguments] ${catalog_service_id}
847 ${map}= Create Dictionary user_remarks=Robot remarks
DR695H3bb6cf42019-06-20 15:04:04 -0400848 Create Environment sdc ${GLOBAL_TEMPLATE_FOLDER}
849 ${data}= Apply Template sdc ${ASDC_USER_REMARKS_TEMPLATE} ${map}
DR695H39a6be82019-07-10 19:08:20 -0400850 ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD}
851 ${resp}= Run Post Request ${ASDC_BE_ENDPOINT} ${ASDC_CATALOG_SERVICES_PATH}/${catalog_service_id}${ASDC_CATALOG_LIFECYCLE_PATH}/checkin ${data} ${ASDC_DESIGNER_USER_ID} auth=${auth}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500852 Should Be Equal As Strings ${resp.status_code} 200
DR695Hccff30b2017-02-17 18:44:24 -0500853 [Return] ${resp.json()}
kaihlavi06fa4ee2019-05-22 19:08:14 +0300854
DR695Hccff30b2017-02-17 18:44:24 -0500855Request Certify ASDC Catalog Service
kaihlavi06fa4ee2019-05-22 19:08:14 +0300856 [Documentation] Requests certification of an ASDC Catalog Service by its id
DR695Hccff30b2017-02-17 18:44:24 -0500857 [Arguments] ${catalog_service_id}
858 ${map}= Create Dictionary user_remarks=Robot remarks
DR695H3bb6cf42019-06-20 15:04:04 -0400859 Create Environment sdc ${GLOBAL_TEMPLATE_FOLDER}
860 ${data}= Apply Template sdc ${ASDC_USER_REMARKS_TEMPLATE} ${map}
DR695H39a6be82019-07-10 19:08:20 -0400861 ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD}
862 ${resp}= Run Post Request ${ASDC_BE_ENDPOINT} ${ASDC_CATALOG_SERVICES_PATH}/${catalog_service_id}${ASDC_CATALOG_LIFECYCLE_PATH}/certificationRequest ${data} ${ASDC_DESIGNER_USER_ID} auth=${auth}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500863 Should Be Equal As Strings ${resp.status_code} 200
DR695Hccff30b2017-02-17 18:44:24 -0500864 [Return] ${resp.json()}
kaihlavi06fa4ee2019-05-22 19:08:14 +0300865
DR695Hccff30b2017-02-17 18:44:24 -0500866Start Certify ASDC Catalog Service
kaihlavi06fa4ee2019-05-22 19:08:14 +0300867 [Documentation] Start certification of an ASDC Catalog Service by its id
DR695Hccff30b2017-02-17 18:44:24 -0500868 [Arguments] ${catalog_service_id}
DR695H39a6be82019-07-10 19:08:20 -0400869 ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD}
870 ${resp}= Run Post Request ${ASDC_BE_ENDPOINT} ${ASDC_CATALOG_SERVICES_PATH}/${catalog_service_id}${ASDC_CATALOG_LIFECYCLE_PATH}/startCertification ${None} ${ASDC_TESTER_USER_ID} auth=${auth}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500871 Should Be Equal As Strings ${resp.status_code} 200
DR695Hccff30b2017-02-17 18:44:24 -0500872 [Return] ${resp.json()}
kaihlavi06fa4ee2019-05-22 19:08:14 +0300873
DR695Hccff30b2017-02-17 18:44:24 -0500874Certify ASDC Catalog Service
kaihlavi06fa4ee2019-05-22 19:08:14 +0300875 [Documentation] Certifies an ASDC Catalog Service by its id and returns the new id
DR695Hccff30b2017-02-17 18:44:24 -0500876 [Arguments] ${catalog_service_id}
877 ${map}= Create Dictionary user_remarks=Robot remarks
DR695H3bb6cf42019-06-20 15:04:04 -0400878 Create Environment sdc ${GLOBAL_TEMPLATE_FOLDER}
879 ${data}= Apply Template sdc ${ASDC_USER_REMARKS_TEMPLATE} ${map}
DR695H39a6be82019-07-10 19:08:20 -0400880 ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD}
881 ${resp}= Run Post Request ${ASDC_BE_ENDPOINT} ${ASDC_CATALOG_SERVICES_PATH}/${catalog_service_id}${ASDC_CATALOG_LIFECYCLE_PATH}/certify ${data} ${ASDC_TESTER_USER_ID} auth=${auth}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500882 Should Be Equal As Strings ${resp.status_code} 200
DR695Hccff30b2017-02-17 18:44:24 -0500883 [Return] ${resp.json()['uniqueId']}
kaihlavi06fa4ee2019-05-22 19:08:14 +0300884
DR695Hccff30b2017-02-17 18:44:24 -0500885Approve ASDC Catalog Service
kaihlavi06fa4ee2019-05-22 19:08:14 +0300886 [Documentation] Approves an ASDC Catalog Service by its id
DR695Hccff30b2017-02-17 18:44:24 -0500887 [Arguments] ${catalog_service_id}
888 ${map}= Create Dictionary user_remarks=Robot remarks
DR695H3bb6cf42019-06-20 15:04:04 -0400889 Create Environment sdc ${GLOBAL_TEMPLATE_FOLDER}
890 ${data}= Apply Template sdc ${ASDC_USER_REMARKS_TEMPLATE} ${map}
DR695H39a6be82019-07-10 19:08:20 -0400891 ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD}
892 ${resp}= Run Post Request ${ASDC_BE_ENDPOINT} ${ASDC_CATALOG_SERVICES_PATH}/${catalog_service_id}${ASDC_CATALOG_SERVICE_DISTRIBUTION_STATE_PATH}${ASDC_DISTRIBUTION_STATE_APPROVE_PATH} ${data} ${ASDC_GOVERNOR_USER_ID} auth=${auth}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500893 Should Be Equal As Strings ${resp.status_code} 200
DR695Hccff30b2017-02-17 18:44:24 -0500894 [Return] ${resp.json()}
DR695H39a6be82019-07-10 19:08:20 -0400895
DR695Hccff30b2017-02-17 18:44:24 -0500896Distribute ASDC Catalog Service
897 [Documentation] distribute an asdc Catalog Service by its id
898 [Arguments] ${catalog_service_id}
DR695H39a6be82019-07-10 19:08:20 -0400899 ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD}
900 ${resp}= Run Post Request ${ASDC_BE_ENDPOINT} ${ASDC_CATALOG_SERVICES_PATH}/${catalog_service_id}${ASDC_CATALOG_SERVICE_DISTRIBUTION_ACTIVATE_PATH} ${None} ${ASDC_OPS_USER_ID} auth=${auth}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500901 Should Be Equal As Strings ${resp.status_code} 200
DR695Hccff30b2017-02-17 18:44:24 -0500902 [Return] ${resp.json()}
bdfreeman1421b2a49512018-11-25 07:32:19 -0500903
DR695Hccff30b2017-02-17 18:44:24 -0500904Add ASDC Resource Instance
kaihlavi06fa4ee2019-05-22 19:08:14 +0300905 [Documentation] Creates an ASDC Resource Instance and returns its id
Yang Xufac7a632019-05-17 01:01:26 -0400906 [Arguments] ${catalog_service_id} ${catalog_resource_id} ${catalog_resource_name} ${xoffset}=${0} ${yoffset}=${0} ${resourceType}=VF
DR695H18872bc2019-06-13 16:16:52 -0400907 ${milli_timestamp}= Generate Timestamp
Brian Freemaneef7c6f2018-11-16 18:42:21 -0500908 ${xoffset}= Set Variable ${xoffset+306}
909 ${yoffset}= Set Variable ${yoffset+248}
Yang Xufac7a632019-05-17 01:01:26 -0400910 ${map}= Create Dictionary catalog_resource_id=${catalog_resource_id} catalog_resource_name=${catalog_resource_name} milli_timestamp=${milli_timestamp} posX=${xoffset} posY=${yoffset} originType=${resourceType}
DR695H3bb6cf42019-06-20 15:04:04 -0400911 Create Environment sdc ${GLOBAL_TEMPLATE_FOLDER}
912 ${data}= Apply Template sdc ${ASDC_RESOURCE_INSTANCE_TEMPLATE} ${map}
DR695H39a6be82019-07-10 19:08:20 -0400913 ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD}
914 ${resp}= Run Post Request ${ASDC_BE_ENDPOINT} ${ASDC_CATALOG_SERVICES_PATH}/${catalog_service_id}${ASDC_CATALOG_SERVICE_RESOURCE_INSTANCE_PATH} ${data} ${ASDC_DESIGNER_USER_ID} auth=${auth}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500915 Should Be Equal As Strings ${resp.status_code} 201
DR695Hccff30b2017-02-17 18:44:24 -0500916 [Return] ${resp.json()['uniqueId']}
Brian Freemaneef7c6f2018-11-16 18:42:21 -0500917
bdfreeman1421b2a49512018-11-25 07:32:19 -0500918Add ASDC Resource Instance To Resource
kaihlavi06fa4ee2019-05-22 19:08:14 +0300919 [Documentation] Creates an ASDC Resource Instance in a Resource (VF) and returns its id
Yang Xufac7a632019-05-17 01:01:26 -0400920 [Arguments] ${parent_catalog_resource_id} ${catalog_resource_id} ${catalog_resource_name} ${xoffset}=${0} ${yoffset}=${0} ${resourceType}=VF
DR695H18872bc2019-06-13 16:16:52 -0400921 ${milli_timestamp}= Generate Timestamp
bdfreeman1421b2a49512018-11-25 07:32:19 -0500922 ${xoffset}= Set Variable ${xoffset+306}
923 ${yoffset}= Set Variable ${yoffset+248}
Yang Xufac7a632019-05-17 01:01:26 -0400924 ${map}= Create Dictionary catalog_resource_id=${catalog_resource_id} catalog_resource_name=${catalog_resource_name} milli_timestamp=${milli_timestamp} posX=${xoffset} posY=${yoffset} originType=${resourceType}
DR695H3bb6cf42019-06-20 15:04:04 -0400925 Create Environment sdc ${GLOBAL_TEMPLATE_FOLDER}
926 ${data}= Apply Template sdc ${ASDC_RESOURCE_INSTANCE_TEMPLATE} ${map}
DR695H39a6be82019-07-10 19:08:20 -0400927 ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD}
928 ${resp}= Run Post Request ${ASDC_BE_ENDPOINT} ${ASDC_CATALOG_RESOURCES_PATH}/${parent_catalog_resource_id}${ASDC_CATALOG_SERVICE_RESOURCE_INSTANCE_PATH} ${data} ${ASDC_DESIGNER_USER_ID} auth=${auth}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500929 Should Be Equal As Strings ${resp.status_code} 201
bdfreeman1421b2a49512018-11-25 07:32:19 -0500930 [Return] ${resp.json()['uniqueId']}
931
DR695Hccff30b2017-02-17 18:44:24 -0500932Get Catalog Service Distribution
kaihlavi06fa4ee2019-05-22 19:08:14 +0300933 [Documentation] Gets an ASDC Catalog Service distribution
DR695Hccff30b2017-02-17 18:44:24 -0500934 [Arguments] ${catalog_service_uuid}
935 ${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 -0500936 Should Be Equal As Strings ${resp.status_code} 200
DR695Hccff30b2017-02-17 18:44:24 -0500937 [Return] ${resp.json()}
kaihlavi06fa4ee2019-05-22 19:08:14 +0300938
DR695Hccff30b2017-02-17 18:44:24 -0500939Check Catalog Service Distributed
kaihlavi06fa4ee2019-05-22 19:08:14 +0300940 [Documentation] Checks if an ASDC Catalog Service is distributed
Brian Freemanadaa2372018-10-24 12:25:22 -0500941 [Arguments] ${catalog_service_uuid} ${dist_status}
DR695Hccff30b2017-02-17 18:44:24 -0500942 ${dist_resp}= Get Catalog Service Distribution ${catalog_service_uuid}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500943 Should Be Equal As Strings ${dist_resp['distributionStatusOfServiceList'][0]['deployementStatus']} Distributed
DR695Hccff30b2017-02-17 18:44:24 -0500944 ${det_resp}= Get Catalog Service Distribution Details ${dist_resp['distributionStatusOfServiceList'][0]['distributionID']}
945 @{ITEMS}= Copy List ${det_resp['distributionStatusList']}
Brian Freemanf508ab22018-03-15 21:19:41 -0500946 Should Not Be Empty ${ITEMS}
Brian Freemana62644f2018-05-13 12:47:38 -0500947 ${SO_COMPLETE} Set Variable FALSE
bdfreeman1421b2a49512018-11-25 07:32:19 -0500948 ${dist_status} Set Variable CONTINUE
949 Should Not Be Empty ${ITEMS}
DR695Hccff30b2017-02-17 18:44:24 -0500950 :FOR ${ELEMENT} IN @{ITEMS}
Brian Freemanf508ab22018-03-15 21:19:41 -0500951 \ Log ${ELEMENT['omfComponentID']}
DR695Hccff30b2017-02-17 18:44:24 -0500952 \ Log ${ELEMENT['status']}
Brian Freeman41ab5e52018-08-08 14:24:23 -0500953 \ ${SO_COMPLETE} Set Variable If (('${ELEMENT['status']}' == 'DISTRIBUTION_COMPLETE_OK')) or ('${SO_COMPLETE}'=='TRUE') TRUE
Brian Freemaneca71072018-08-16 14:50:16 -0500954 \ Exit For Loop If ('${SO_COMPLETE}'=='TRUE')
955 \ Exit For Loop If ('${ELEMENT['status']}' == 'DISTRIBUTION_COMPLETE_ERROR')
Brian Freemanadaa2372018-10-24 12:25:22 -0500956 \ ${dist_status}= Set Variable If (('${ELEMENT['status']}' == 'COMPONENT_DONE_ERROR') and ('${ELEMENT['omfComponentID']}' == 'aai-ml')) EXIT
957 \ Exit For Loop If (('${ELEMENT['status']}' == 'COMPONENT_DONE_ERROR') and ('${ELEMENT['omfComponentID']}' == 'aai-ml'))
Brian Freemana62644f2018-05-13 12:47:38 -0500958 Should Be True ( '${SO_COMPLETE}'=='TRUE') SO Test
bdfreeman1421b2a49512018-11-25 07:32:19 -0500959
DR695Hccff30b2017-02-17 18:44:24 -0500960Get Catalog Service Distribution Details
kaihlavi06fa4ee2019-05-22 19:08:14 +0300961 [Documentation] Gets ASDC Catalog Service distribution details
DR695Hccff30b2017-02-17 18:44:24 -0500962 [Arguments] ${catalog_service_distribution_id}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500963 ${resp}= Run ASDC Get Request ${ASDC_CATALOG_SERVICES_PATH}${ASDC_CATALOG_SERVICE_DISTRIBUTION_PATH}/${catalog_service_distribution_id} ${ASDC_OPS_USER_ID}
964 Should Be Equal As Strings ${resp.status_code} 200
DR695Hccff30b2017-02-17 18:44:24 -0500965 [Return] ${resp.json()}
966Run ASDC Health Check
967 [Documentation] Runs a ASDC health check
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500968 ${session}= Create Session asdc ${ASDC_FE_ENDPOINT}
DR695H18872bc2019-06-13 16:16:52 -0400969 ${uuid}= Generate UUID4
DR695Hccff30b2017-02-17 18:44:24 -0500970 ${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 -0500971 ${resp}= Get Request asdc ${ASDC_HEALTH_CHECK_PATH} headers=${headers}
Brian Freemanadaa2372018-10-24 12:25:22 -0500972 # only test for HTTP 200 to determine SDC Health. SDC_DE_HEALTH is informational
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500973 Should Be Equal As Strings ${resp.status_code} 200 SDC DOWN
Brian Freeman5cf5fa62018-04-23 20:28:16 -0500974 ${SDC_DE_HEALTH}= Catenate DOWN
DR695Hccff30b2017-02-17 18:44:24 -0500975 @{ITEMS}= Copy List ${resp.json()['componentsInfo']}
976 :FOR ${ELEMENT} IN @{ITEMS}
977 \ Log ${ELEMENT['healthCheckStatus']}
Brian Freemane546f7e2018-04-19 12:17:56 -0500978 \ ${SDC_DE_HEALTH} Set Variable If (('DE' in '${ELEMENT['healthCheckComponent']}') and ('${ELEMENT['healthCheckStatus']}' == 'UP')) or ('${SDC_DE_HEALTH}'=='UP') UP
DR695H8e7028b2019-07-10 10:13:58 -0400979 Log (DMaaP:${SDC_DE_HEALTH})
DR695Hccff30b2017-02-17 18:44:24 -0500980Run ASDC Get Request
981 [Documentation] Runs an ASDC get request
Brian Freeman44b8bb32018-05-03 21:08:42 -0500982 [Arguments] ${data_path} ${user}=${ASDC_DESIGNER_USER_ID} ${MY_ASDC_BE_ENDPOINT}=${ASDC_BE_ENDPOINT}
DR695Hccff30b2017-02-17 18:44:24 -0500983 ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500984 Log Creating session ${MY_ASDC_BE_ENDPOINT}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500985 ${session}= Create Session asdc ${MY_ASDC_BE_ENDPOINT} auth=${auth}
DR695H18872bc2019-06-13 16:16:52 -0400986 ${uuid}= Generate UUID4
DR695Hccff30b2017-02-17 18:44:24 -0500987 ${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 -0500988 ${resp}= Get Request asdc ${data_path} headers=${headers}
DR695Hccff30b2017-02-17 18:44:24 -0500989 Log Received response from asdc ${resp.text}
990 [Return] ${resp}
991Run ASDC Put Request
992 [Documentation] Runs an ASDC put request
Brian Freeman44b8bb32018-05-03 21:08:42 -0500993 [Arguments] ${data_path} ${data} ${user}=${ASDC_DESIGNER_USER_ID} ${MY_ASDC_BE_ENDPOINT}=${ASDC_BE_ENDPOINT}
DR695Hccff30b2017-02-17 18:44:24 -0500994 ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500995 Log Creating session ${MY_ASDC_BE_ENDPOINT}
996 ${session}= Create Session asdc ${MY_ASDC_BE_ENDPOINT} auth=${auth}
DR695H18872bc2019-06-13 16:16:52 -0400997 ${uuid}= Generate UUID4
DR695Hccff30b2017-02-17 18:44:24 -0500998 ${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 -0500999 ${resp}= Put Request asdc ${data_path} data=${data} headers=${headers}
DR695Hccff30b2017-02-17 18:44:24 -05001000 Log Received response from asdc ${resp.text}
1001 [Return] ${resp}
Jerry Flood6bd1afa2017-10-09 09:59:23 -04001002
DR695Hccff30b2017-02-17 18:44:24 -05001003Run ASDC Post Files Request
1004 [Documentation] Runs an ASDC post request
Brian Freeman44b8bb32018-05-03 21:08:42 -05001005 [Arguments] ${data_path} ${files} ${user}=${ASDC_DESIGNER_USER_ID} ${MY_ASDC_BE_ENDPOINT}=${ASDC_BE_ENDPOINT}
DR695Hccff30b2017-02-17 18:44:24 -05001006 ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD}
Brian Freeman44b8bb32018-05-03 21:08:42 -05001007 Log Creating session ${MY_ASDC_BE_ENDPOINT}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -05001008 ${session}= Create Session asdc ${MY_ASDC_BE_ENDPOINT} auth=${auth}
DR695H18872bc2019-06-13 16:16:52 -04001009 ${uuid}= Generate UUID4
DR695Hccff30b2017-02-17 18:44:24 -05001010 ${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 -05001011 ${resp}= Post Request asdc ${data_path} files=${files} headers=${headers}
1012 Log Received response from asdc ${resp.text}
1013 [Return] ${resp}
1014
1015Run ASDC MD5 Post Request
1016 [Documentation] Runs an ASDC post request with MD5 Checksum header
1017 [Arguments] ${data_path} ${data} ${user}=${ASDC_DESIGNER_USER_ID} ${MY_ASDC_BE_ENDPOINT}=${ASDC_BE_ENDPOINT}
1018 ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD}
1019 Log Creating session ${MY_ASDC_BE_ENDPOINT}
1020 ${session}= Create Session asdc ${MY_ASDC_BE_ENDPOINT} auth=${auth}
DR695H18872bc2019-06-13 16:16:52 -04001021 ${uuid}= Generate UUID4
Brian Freeman2e1d0ff2019-01-23 09:38:13 -05001022 ${data_string}= Evaluate json.dumps(${data}) json
1023 ${md5checksum}= Evaluate md5.new('''${data_string}''').hexdigest() modules=md5
DR695H37529942019-07-01 13:47:56 -04001024 ${base64md5checksum}= Base64 Encode ${md5checksum}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -05001025 ${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}
1026 ${resp}= Post Request asdc ${data_path} data=${data} headers=${headers}
DR695Hccff30b2017-02-17 18:44:24 -05001027 Log Received response from asdc ${resp.text}
Jerry Floode2a48d72017-06-21 15:06:29 -04001028 [Return] ${resp}
Jerry Flood6bd1afa2017-10-09 09:59:23 -04001029
DR695Hccff30b2017-02-17 18:44:24 -05001030Run ASDC Delete Request
1031 [Documentation] Runs an ASDC delete request
Brian Freeman44b8bb32018-05-03 21:08:42 -05001032 [Arguments] ${data_path} ${user}=${ASDC_DESIGNER_USER_ID} ${MY_ASDC_BE_ENDPOINT}=${ASDC_BE_ENDPOINT}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -05001033 ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD}
Brian Freeman44b8bb32018-05-03 21:08:42 -05001034 Log Creating session ${MY_ASDC_BE_ENDPOINT}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -05001035 ${session}= Create Session asdc ${MY_ASDC_BE_ENDPOINT} auth=${auth}
DR695H18872bc2019-06-13 16:16:52 -04001036 ${uuid}= Generate UUID4
DR695Hccff30b2017-02-17 18:44:24 -05001037 ${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 -05001038 ${resp}= Delete Request asdc ${data_path} headers=${headers}
DR695Hccff30b2017-02-17 18:44:24 -05001039 Log Received response from asdc ${resp.text}
Jerry Floode2a48d72017-06-21 15:06:29 -04001040 [Return] ${resp}
DR695H39a6be82019-07-10 19:08:20 -04001041
DR695Hccff30b2017-02-17 18:44:24 -05001042Open ASDC GUI
1043 [Documentation] Logs in to ASDC GUI
1044 [Arguments] ${PATH}
1045 ## Setup Browever now being managed by the test case
1046 ##Setup Browser
DR695Hbf5a3a32017-06-30 13:09:57 -04001047 Go To ${ASDC_FE_ENDPOINT}${PATH}
DR695Hccff30b2017-02-17 18:44:24 -05001048 Maximize Browser Window
Jerry Flood6bd1afa2017-10-09 09:59:23 -04001049
DR695Hccff30b2017-02-17 18:44:24 -05001050 Set Browser Implicit Wait ${GLOBAL_SELENIUM_BROWSER_IMPLICIT_WAIT}
DR695Hbf5a3a32017-06-30 13:09:57 -04001051 Log Logging in to ${ASDC_FE_ENDPOINT}${PATH}
DR695Hccff30b2017-02-17 18:44:24 -05001052 Title Should Be ASDC
Jerry Floode2a48d72017-06-21 15:06:29 -04001053 Wait Until Page Contains Element xpath=//div/a[text()='SDC'] ${GLOBAL_SELENIUM_BROWSER_WAIT_TIMEOUT}
DR695Hbf5a3a32017-06-30 13:09:57 -04001054 Log Logged in to ${ASDC_FE_ENDPOINT}${PATH}
Jerry Flood6bd1afa2017-10-09 09:59:23 -04001055
1056
1057Create Multi Part
1058 [Arguments] ${addTo} ${partName} ${filePath} ${contentType}=${None}
1059 ${fileData}= Get Binary File ${filePath}
1060 ${fileDir} ${fileName}= Split Path ${filePath}
1061 ${partData}= Create List ${fileName} ${fileData} ${contentType}
1062 Set To Dictionary ${addTo} ${partName}=${partData}
Brian Freemanf940ee92018-05-25 21:09:05 -05001063