blob: f3aad2fbc8c4b939dd351770774f5d6da06b964d [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
DR695Hbfed6592019-07-11 12:02:08 -040015Library ONAPLibrary.SDC WITH NAME 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
DR695Hbfed6592019-07-11 12:02:08 -0400254 ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD}
255 ${resp}= SDC.Run Get Request ${ASDC_BE_ENDPOINT} ${ASDC_CATALOG_SERVICES_PATH}/${catalog_service_id}/filteredDataByParams?include=toscaArtifacts ${ASDC_DESIGNER_USER_ID} auth=${auth}
bdfreeman14211ad11d92018-11-17 18:47:37 +0000256 ${csar_resource_id}= Set Variable ${resp.json()['toscaArtifacts']['assettoscacsar']['uniqueId']}
DR695Hbfed6592019-07-11 12:02:08 -0400257 ${resp}= SDC.Run Get Request ${ASDC_BE_ENDPOINT} ${ASDC_CATALOG_SERVICES_PATH}/${catalog_service_id}/artifacts/${csar_resource_id} ${ASDC_DESIGNER_USER_ID} auth=${auth}
bdfreeman14211ad11d92018-11-17 18:47:37 +0000258 ${csar_file_name}= Set Variable ${resp.json()['artifactName']}
259 ${base64Obj}= Set Variable ${resp.json()['base64Contents']}
DR695H37529942019-07-01 13:47:56 -0400260 ${binObj}= Base64 Decode ${base64Obj}
bdfreeman14211ad11d92018-11-17 18:47:37 +0000261 Create Binary File ${save_directory}/${csar_file_name} ${binObj}
DR695H8e7028b2019-07-10 10:13:58 -0400262 Log ${\n}Downloaded:${csar_file_name}
bdfreeman14211ad11d92018-11-17 18:47:37 +0000263
Brian Freemaneef7c6f2018-11-16 18:42:21 -0500264
265Get Generic NeutronNet UUID
kaihlavi06fa4ee2019-05-22 19:08:14 +0300266 [Documentation] Look up the UUID of the Generic NeutronNetwork Resource
DR695Hbfed6592019-07-11 12:02:08 -0400267 ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD}
268 ${resp}= SDC.Run Get Request ${ASDC_BE_ENDPOINT} ${ASDC_CATALOG_RESOURCES_QUERY_PATH}/Generic%20NeutronNet/resourceVersion/1.0 ${ASDC_DESIGNER_USER_ID} auth=${auth}
Brian Freemaneef7c6f2018-11-16 18:42:21 -0500269 [Return] ${resp.json()['allVersions']['1.0']}
270
bdfreeman1421b2a49512018-11-25 07:32:19 -0500271Get AllottedResource UUID
kaihlavi06fa4ee2019-05-22 19:08:14 +0300272 [Documentation] Look up the UUID of the Allotted Resource
bdfreeman1421b2a49512018-11-25 07:32:19 -0500273 # if this fails then the AllottedResource template got deleted from SDC by mistake
DR695Hbfed6592019-07-11 12:02:08 -0400274 ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD}
275 ${resp}= SDC.Run Get Request ${ASDC_BE_ENDPOINT} ${ASDC_CATALOG_RESOURCES_QUERY_PATH}/AllottedResource/resourceVersion/1.0 ${ASDC_DESIGNER_USER_ID} auth=${auth}
bdfreeman1421b2a49512018-11-25 07:32:19 -0500276 [Return] ${resp.json()['allVersions']['1.0']}
277
Brian Freeman18df8912018-05-25 13:27:29 -0500278Loop Over Check Catalog Service Distributed
Gary Wu58d58532018-07-27 16:02:51 -0700279 [Arguments] ${catalog_service_id}
Brian Freemanadaa2372018-10-24 12:25:22 -0500280 # SO watchdog timeout is 300 seconds need buffer
bdfreeman1421b2a49512018-11-25 07:32:19 -0500281 ${dist_status}= Set Variable CONTINUE
DR695H910097e2019-05-08 13:55:32 -0400282 :FOR ${CHECK_INDEX} IN RANGE 20
Brian Freemanadaa2372018-10-24 12:25:22 -0500283 \ ${status} ${_} = Run Keyword And Ignore Error Check Catalog Service Distributed ${catalog_service_id} ${dist_status}
Gary Wu58d58532018-07-27 16:02:51 -0700284 \ Sleep 20s
Brian Freemanf940ee92018-05-25 21:09:05 -0500285 \ Return From Keyword If '${status}'=='PASS'
bdfreeman1421b2a49512018-11-25 07:32:19 -0500286 # need a way to exit the loop early on DISTRIBUTION_COMPLETE_ERROR ${dist_status} doesnt work
287 #\ Exit For Loop If '${dist_status}'=='EXIT'
288 Should Be Equal As Strings ${status} PASS
Brian Freeman18df8912018-05-25 13:27:29 -0500289
DR695Hccff30b2017-02-17 18:44:24 -0500290Setup ASDC Catalog Resource
kaihlavi06fa4ee2019-05-22 19:08:14 +0300291 [Documentation] Creates all the steps a VF needs for an ASDC Catalog Resource and returns the id
Yang Xu2ec80382018-11-01 12:30:37 -0400292 [Arguments] ${model_zip_path} ${cds}=
Brian Freemanb568e5e2018-04-05 21:03:38 -0500293 ${license_model_id} ${license_model_version_id}= Add ASDC License Model
Brian Freeman15033782019-03-22 15:48:55 -0500294
295
296 ${license_temp_date}= Get Current Date
297 ${license_start_date}= Get Current Date result_format=%m/%d/%Y
298 ${license_end_date}= Add Time To Date ${license_temp_date} 365 days result_format=%m/%d/%Y
299 ${key_group_id}= Add ASDC License Group ${license_model_id} ${license_model_version_id} ${license_start_date} ${license_end_date}
300 ${pool_id}= Add ASDC Entitlement Pool ${license_model_id} ${license_model_version_id} ${license_start_date} ${license_end_date}
301
Brian Freemanb568e5e2018-04-05 21:03:38 -0500302 ${feature_group_id}= Add ASDC Feature Group ${license_model_id} ${key_group_id} ${pool_id} ${license_model_version_id}
303 ${license_agreement_id}= Add ASDC License Agreement ${license_model_id} ${feature_group_id} ${license_model_version_id}
304 Submit ASDC License Model ${license_model_id} ${license_model_version_id}
305 ${license_model_resp}= Get ASDC License Model ${license_model_id} ${license_model_version_id}
Brian Freeman9c42ae12018-11-27 14:33:27 -0500306 ${matches}= Get Regexp Matches ${model_zip_path} temp/(.*)\.zip 1
307 ${software_product_name_prefix}= Set Variable ${matches[0]}
308 ${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 -0500309 Upload ASDC Heat Package ${software_product_id} ${model_zip_path} ${software_product_version_id}
310 Validate ASDC Software Product ${software_product_id} ${software_product_version_id}
311 Submit ASDC Software Product ${software_product_id} ${software_product_version_id}
312 Package ASDC Software Product ${software_product_id} ${software_product_version_id}
313 ${software_product_resp}= Get ASDC Software Product ${software_product_id} ${software_product_version_id}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500314 ${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 -0400315 # Check if need to set up CDS properties
316 Run Keyword If '${cds}' == 'vfwng' Setup ASDC Catalog Resource CDS Properties ${catalog_resource_id}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500317
Brian Freeman391680a2018-08-11 15:20:58 -0500318 ${catalog_resource_id}= Certify ASDC Catalog Resource ${catalog_resource_id} ${ASDC_DESIGNER_USER_ID}
DR695Hccff30b2017-02-17 18:44:24 -0500319 [Return] ${catalog_resource_id}
Brian Freemaneef7c6f2018-11-16 18:42:21 -0500320
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500321
322Setup SDC Catalog Resource Deployment Artifact Properties
323 [Documentation] Set up Deployment Artiface properties
324 [Arguments] ${catalog_service_id} ${catalog_parent_service_id} ${catalog_resource_unique_id} ${blueprint_file}
325 ${resp}= Get ASDC Catalog Resource Component Instances Properties ${catalog_service_id}
Brian Freemana8ceb692019-03-03 09:37:54 -0500326 ${blueprint_data} OperatingSystem.Get File ${SDC_CATALOG_DEPLOYMENT_ARTIFACT_PATH}${blueprint_file}
DR695H37529942019-07-01 13:47:56 -0400327 ${payloadData}= Base64 Encode ${blueprint_data}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500328 ${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 -0400329 Create Environment sdc ${GLOBAL_TEMPLATE_FOLDER}
330 ${data}= Apply Template sdc ${ASDC_ARTIFACT_UPLOAD_TEMPLATE} ${dict}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500331 # POST artifactUpload to resource
332 ${artifact_upload_path}= Catenate ${ASDC_CATALOG_SERVICES_PATH}/${catalog_service_id}/resourceInstance/${catalog_resource_unique_id}${ASDC_CATALOG_SERVICE_RESOURCE_ARTIFACT_PATH}
DR695Hbfed6592019-07-11 12:02:08 -0400333 ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD}
334 ${resp}= SDC.Run Post Request ${ASDC_BE_ENDPOINT} ${artifact_upload_path} ${data} ${ASDC_DESIGNER_USER_ID} auth=${auth}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500335 Should Be Equal As Strings ${resp.status_code} 200
336 [Return] ${resp}
337
338
Brian Freemaneef7c6f2018-11-16 18:42:21 -0500339Setup SDC Catalog Resource GenericNeutronNet Properties
bdfreeman1421b2a49512018-11-25 07:32:19 -0500340 [Documentation] Set up GenericNeutronNet properties and inputs
Brian Freemaneef7c6f2018-11-16 18:42:21 -0500341 [Arguments] ${catalog_service_id} ${nf_role} ${catalog_parent_service_id}
Brian Freemaneef7c6f2018-11-16 18:42:21 -0500342 ${resp}= Get ASDC Catalog Resource Component Instances Properties ${catalog_service_id}
Brian Freemaneef7c6f2018-11-16 18:42:21 -0500343 ${componentInstances} Set Variable @{resp['componentInstancesProperties']}
344 # componentInstances can have 1 or more than 1 entry
345 ${passed}= Run Keyword And Return Status Evaluate type(${componentInstances})
346 ${type}= Run Keyword If ${passed} Evaluate type(${componentInstances})
347 ${componentInstancesList}= Run Keyword If "${type}"!="<type 'list'>" Create List ${componentInstances}
348 ... ELSE Set Variable ${componentInstances}
349 :FOR ${item} IN @{componentInstancesList}
350 \ ${test} ${v}= Run Keyword and Ignore Error Should Contain ${item} ${nf_role}
351 \ Run Keyword If '${test}' == 'FAIL' Continue For Loop
352 \ ${componentInstance1}= Set Variable ${item}
353 :FOR ${comp} IN @{resp['componentInstancesProperties']["${componentInstance1}"]}
354 \ ${name} Set Variable ${comp['name']}
355 \ ${test} ${v}= Run Keyword and Ignore Error Should Contain ${name} network_role
356 \ Run Keyword If '${test}' == 'FAIL' Continue For Loop
357 \ ${description} Set Variable ${comp['description']}
358 \ ${description}= Replace String ${description} ${\n} \
359 \ ${uniqueId} Set Variable ${comp['uniqueId']}
360 \ ${parentUniqueId} Set Variable ${comp['parentUniqueId']}
361 \ ${ownerId} Set Variable ${comp['ownerId']}
362 \ ${dict}= Create Dictionary parentUniqueId=${parentUniqueId} ownerId=${ownerId} uniqueId=${uniqueId} description=${description}
363 \ Run Keyword If '${name}'=='network_role' Set To Dictionary ${dict} name=${name} value=${nf_role}
DR695H3bb6cf42019-06-20 15:04:04 -0400364 \ Create Environment sdc ${GLOBAL_TEMPLATE_FOLDER}
365 \ ${data}= Apply Template sdc ${SDC_CATALOG_NET_RESOURCE_INPUT_TEMPLATE} ${dict}
Brian Freemaneef7c6f2018-11-16 18:42:21 -0500366 \ ${response}= Set ASDC Catalog Resource Component Instance Properties ${catalog_parent_service_id} ${catalog_service_id} ${data}
Brian Freemaneef7c6f2018-11-16 18:42:21 -0500367
bdfreeman1421b2a49512018-11-25 07:32:19 -0500368
369Setup SDC Catalog Resource AllottedResource Properties
370 [Documentation] Set up Allotted Resource properties and inputs
371 [Arguments] ${catalog_service_id} ${nf_role} ${catalog_resource_id} ${invariantUUID} ${UUID} ${node_type}
372 # Set component instances properties
373 ${nf_role_lc}= Convert To Lowercase ${nf_role}
374 ${resp}= Get ASDC Catalog Resource Component Instances Properties For Resource ${catalog_resource_id}
375 ${componentInstances} Set Variable @{resp['componentInstancesProperties']}
376 # componentInstances can have 1 or more than 1 entry
377 ${passed}= Run Keyword And Return Status Evaluate type(${componentInstances})
378 ${type}= Run Keyword If ${passed} Evaluate type(${componentInstances})
379 ${componentInstancesList}= Run Keyword If "${type}"!="<type 'list'>" Create List ${componentInstances}
380 ... ELSE Set Variable ${componentInstances}
381 :FOR ${item} IN @{componentInstancesList}
382 \ ${test} ${v}= Run Keyword and Ignore Error Should Contain ${item} ${nf_role_lc}
383 \ Run Keyword If '${test}' == 'FAIL' Continue For Loop
384 \ ${componentInstance1}= Set Variable ${item}
385 ${dict}= Create Dictionary
386 :FOR ${comp} IN @{resp['componentInstancesProperties']["${componentInstance1}"]}
387 \ ${name} Set Variable ${comp['name']}
388 \ ${test} ${v}= Run Keyword and Ignore Error Should Contain Any ${name} network_role providing_service_invariant_uuid providing_service_uuid providing_service_name uniqueId
389 \ Run Keyword If '${test}' == 'FAIL' Continue For Loop
390 \ ${parentUniqueId} Set Variable ${comp['parentUniqueId']}
391 \ ${ownerId} Set Variable ${comp['ownerId']}
392 \ Set To Dictionary ${dict} parentUniqueId=${parentUniqueId} ownerId=${ownerId}
393 \ Run Keyword If '${name}'=='providing_service_invariant_uuid' Set To Dictionary ${dict} providing_service_invariant_uuid=${invariantUUID}
394 \ Run Keyword If '${name}'=='providing_service_uuid' Set To Dictionary ${dict} providing_service_uuid=${UUID}
395 \ Run Keyword If '${name}'=='providing_service_name' Set To Dictionary ${dict} providing_service_name=${node_type}
396 # Sets it for each loop but should be one
397 \ ${uniqueId} Set Variable ${comp['uniqueId']}
398 \ ${uniqueId} Fetch From Left ${uniqueId} .
399 \ Set To Dictionary ${dict} uniqueId=${uniqueId}
DR695H3bb6cf42019-06-20 15:04:04 -0400400 Create Environment sdc ${GLOBAL_TEMPLATE_FOLDER}
401 ${data}= Apply Template sdc ${SDC_CATALOG_ALLOTTED_RESOURCE_PROPERTIES_TEMPLATE} ${dict}
bdfreeman1421b2a49512018-11-25 07:32:19 -0500402 ${response}= Set ASDC Catalog Resource Component Instance Properties For Resource ${catalog_resource_id} ${componentInstance1} ${data}
DR695H8e7028b2019-07-10 10:13:58 -0400403 Log resp=${response}
bdfreeman1421b2a49512018-11-25 07:32:19 -0500404
405
406Setup SDC Catalog Resource AllottedResource Inputs
407 [Documentation] Set up Allotted Resource inputs
408 [Arguments] ${catalog_service_id} ${nf_role} ${catalog_resource_id}
409 # Set vnf inputs
410 ${resp}= Get ASDC Catalog Resource Inputs ${catalog_resource_id}
411 ${dict}= Create Dictionary
DR695H910097e2019-05-08 13:55:32 -0400412 :FOR ${comp} IN @{resp['inputs']}
bdfreeman1421b2a49512018-11-25 07:32:19 -0500413 \ ${name} Set Variable ${comp['name']}
414 \ ${uid} Set Variable ${comp['uniqueId']}
415 \ Run Keyword If '${name}'=='nf_type' Set To Dictionary ${dict} nf_type=${nf_role} nf_type_uid=${uid}
416 \ Run Keyword If '${name}'=='nf_role' Set To Dictionary ${dict} nf_role=${nf_role} nf_role_uid=${uid}
DR695H3bb6cf42019-06-20 15:04:04 -0400417 Create Environment sdc ${GLOBAL_TEMPLATE_FOLDER}
418 ${data}= Apply Template sdc ${SDC_CATALOG_ALLOTTED_RESOURCE_INPUTS_TEMPLATE} ${dict}
bdfreeman1421b2a49512018-11-25 07:32:19 -0500419 ${response}= Set ASDC Catalog Resource VNF Inputs ${catalog_resource_id} ${data}
420 [Return] ${response}
421
Yang Xu2ec80382018-11-01 12:30:37 -0400422Setup ASDC Catalog Resource CDS Properties
423 [Documentation] Set up vfwng VNF properties and inputs for CDS
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500424 [Arguments] ${catalog_resource_id}
Yang Xu2ec80382018-11-01 12:30:37 -0400425 # Set vnf module properties
426 ${resp}= Get ASDC Catalog Resource Component Instances ${catalog_resource_id}
DR695H910097e2019-05-08 13:55:32 -0400427 :FOR ${comp} IN @{resp['componentInstances']}
Yang Xu2ec80382018-11-01 12:30:37 -0400428 \ ${name} Set Variable ${comp['name']}
429 \ ${uniqueId} Set Variable ${comp['uniqueId']}
430 \ ${actualComponentUid} Set Variable ${comp['actualComponentUid']}
431 \ ${test} ${v}= Run Keyword and Ignore Error Should Contain ${name} abstract_
432 \ Run Keyword If '${test}' == 'FAIL' Continue For Loop
433 \ ${response}= Get ASDC Catalog Resource Component Instance Properties ${catalog_resource_id} ${uniqueId} ${actualComponentUid}
434 \ ${dict}= Create Dictionary parent_id=${response[6]['parentUniqueId']}
435 \ Run Keyword If '${name}'=='abstract_vfw' Set To Dictionary ${dict} nfc_function=vfw nfc_naming_policy=SDNC_Policy.ONAP_VFW_NAMING_TIMESTAMP
436 \ Run Keyword If '${name}'=='abstract_vpg' Set To Dictionary ${dict} nfc_function=vpg nfc_naming_policy=SDNC_Policy.ONAP_VPG_NAMING_TIMESTAMP
437 \ 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 -0400438 \ Create Environment sdc ${GLOBAL_TEMPLATE_FOLDER}
439 \ ${data}= Apply Template sdc ${ASDC_RESOURCE_INSTANCE_VNF_PROPERTIES_TEMPLATE} ${dict}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500440 \ ${response}= Set ASDC Catalog Resource Component Instance Properties ${catalog_resource_id} ${uniqueId} ${data}
DR695H8e7028b2019-07-10 10:13:58 -0400441 \ Log resp=${response}
Yang Xu2ec80382018-11-01 12:30:37 -0400442
443 # Set vnf inputs
444 ${resp}= Get ASDC Catalog Resource Inputs ${catalog_resource_id}
445 ${dict}= Create Dictionary
DR695H910097e2019-05-08 13:55:32 -0400446 :FOR ${comp} IN @{resp['inputs']}
Yang Xu2ec80382018-11-01 12:30:37 -0400447 \ ${name} Set Variable ${comp['name']}
448 \ ${uid} Set Variable ${comp['uniqueId']}
449 \ Run Keyword If '${name}'=='nf_function' Set To Dictionary ${dict} nf_function=ONAP-FIREWALL nf_function_uid=${uid}
450 \ Run Keyword If '${name}'=='nf_type' Set To Dictionary ${dict} nf_type=FIREWALL nf_type_uid=${uid}
451 \ Run Keyword If '${name}'=='nf_naming_code' Set To Dictionary ${dict} nf_naming_code=vfw nf_naming_code_uid=${uid}
452 \ Run Keyword If '${name}'=='nf_role' Set To Dictionary ${dict} nf_role=vFW nf_role_uid=${uid}
453 \ Run Keyword If '${name}'=='cloud_env' Set To Dictionary ${dict} cloud_env=openstack cloud_env_uid=${uid}
DR695H3bb6cf42019-06-20 15:04:04 -0400454 Create Environment sdc ${GLOBAL_TEMPLATE_FOLDER}
455 ${data}= Apply Template sdc ${ASDC_RESOURCE_INSTANCE_VNF_INPUTS_TEMPLATE} ${dict}
Yang Xu2ec80382018-11-01 12:30:37 -0400456 ${response}= Set ASDC Catalog Resource VNF Inputs ${catalog_resource_id} ${data}
457
DR695Hccff30b2017-02-17 18:44:24 -0500458Add ASDC License Model
kaihlavi06fa4ee2019-05-22 19:08:14 +0300459 [Documentation] Creates an ASDC License Model and returns its id
DR695H18872bc2019-06-13 16:16:52 -0400460 ${uuid}= Generate UUID4
Jerry Floode2a48d72017-06-21 15:06:29 -0400461 ${shortened_uuid}= Evaluate str("${uuid}")[:23]
DR695Hccff30b2017-02-17 18:44:24 -0500462 ${map}= Create Dictionary vendor_name=${shortened_uuid}
DR695H3bb6cf42019-06-20 15:04:04 -0400463 Create Environment sdc ${GLOBAL_TEMPLATE_FOLDER}
464 ${data}= Apply Template sdc ${ASDC_LICENSE_MODEL_TEMPLATE} ${map}
DR695H39a6be82019-07-10 19:08:20 -0400465 ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD}
DR695Hbfed6592019-07-11 12:02:08 -0400466 ${resp}= SDC.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 -0500467 Should Be Equal As Strings ${resp.status_code} 200
Brian Freemanb568e5e2018-04-05 21:03:38 -0500468 [Return] ${resp.json()['itemId']} ${resp.json()['version']['id']}
DR695H39a6be82019-07-10 19:08:20 -0400469
DR695Hccff30b2017-02-17 18:44:24 -0500470Get ASDC License Model
471 [Documentation] gets an asdc license model by its id
Jerry Floode2a48d72017-06-21 15:06:29 -0400472 [Arguments] ${id} ${version_id}=0.1
DR695Hbfed6592019-07-11 12:02:08 -0400473 ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD}
474 ${resp}= SDC.Run Get Request ${ASDC_BE_ONBOARD_ENDPOINT} ${ASDC_VENDOR_LICENSE_MODEL_PATH}/${id}/versions/${version_id} ${ASDC_DESIGNER_USER_ID} auth=${auth}
Jerry Floode2a48d72017-06-21 15:06:29 -0400475 [Return] ${resp.json()}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500476
kaihlavi06fa4ee2019-05-22 19:08:14 +0300477Get ASDC License Models
478 [Documentation] Gets all ASDC License Models
DR695Hbfed6592019-07-11 12:02:08 -0400479 ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD}
480 ${resp}= SDC.Run Get Request ${ASDC_BE_ONBOARD_ENDPOINT} ${ASDC_VENDOR_LICENSE_MODEL_PATH} ${ASDC_DESIGNER_USER_ID} auth=${auth}
DR695Hccff30b2017-02-17 18:44:24 -0500481 [Return] ${resp.json()}
kaihlavi06fa4ee2019-05-22 19:08:14 +0300482
DR695Hccff30b2017-02-17 18:44:24 -0500483Checkin ASDC License Model
kaihlavi06fa4ee2019-05-22 19:08:14 +0300484 [Documentation] Checks in an ASDC License Model by its id
Jerry Floode2a48d72017-06-21 15:06:29 -0400485 [Arguments] ${id} ${version_id}=0.1
DR695Hccff30b2017-02-17 18:44:24 -0500486 ${map}= Create Dictionary action=Checkin
DR695H3bb6cf42019-06-20 15:04:04 -0400487 Create Environment sdc ${GLOBAL_TEMPLATE_FOLDER}
488 ${data}= Apply Template sdc ${ASDC_ACTION_TEMPLATE} ${map}
DR695Hbfed6592019-07-11 12:02:08 -0400489 ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD}
490 ${resp}= SDC.Run Put Request ${ASDC_BE_ONBOARD_ENDPOINT} ${ASDC_VENDOR_LICENSE_MODEL_PATH}/${id}/versions/${version_id}${ASDC_VENDOR_ACTIONS_PATH} ${data} ${ASDC_DESIGNER_USER_ID} auth=${auth}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500491 Should Be Equal As Strings ${resp.status_code} 200
DR695Hccff30b2017-02-17 18:44:24 -0500492 [Return] ${resp.json()}
kaihlavi06fa4ee2019-05-22 19:08:14 +0300493
DR695Hccff30b2017-02-17 18:44:24 -0500494Submit ASDC License Model
kaihlavi06fa4ee2019-05-22 19:08:14 +0300495 [Documentation] Submits an ASDC License Model by its id
Jerry Floode2a48d72017-06-21 15:06:29 -0400496 [Arguments] ${id} ${version_id}=0.1
DR695Hccff30b2017-02-17 18:44:24 -0500497 ${map}= Create Dictionary action=Submit
DR695H3bb6cf42019-06-20 15:04:04 -0400498 Create Environment sdc ${GLOBAL_TEMPLATE_FOLDER}
499 ${data}= Apply Template sdc ${ASDC_ACTION_TEMPLATE} ${map}
DR695Hbfed6592019-07-11 12:02:08 -0400500 ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD}
501 ${resp}= SDC.Run Put Request ${ASDC_BE_ONBOARD_ENDPOINT} ${ASDC_VENDOR_LICENSE_MODEL_PATH}/${id}/versions/${version_id}${ASDC_VENDOR_ACTIONS_PATH} ${data} ${ASDC_DESIGNER_USER_ID} auth=${auth}
DR695Hccff30b2017-02-17 18:44:24 -0500502 [Return] ${resp.json()}
kaihlavi06fa4ee2019-05-22 19:08:14 +0300503
DR695Hccff30b2017-02-17 18:44:24 -0500504Checkin ASDC Software Product
kaihlavi06fa4ee2019-05-22 19:08:14 +0300505 [Documentation] Checks in an ASDC Software Product by its id
Jerry Floode2a48d72017-06-21 15:06:29 -0400506 [Arguments] ${id} ${version_id}=0.1
DR695Hccff30b2017-02-17 18:44:24 -0500507 ${map}= Create Dictionary action=Checkin
DR695H3bb6cf42019-06-20 15:04:04 -0400508 Create Environment sdc ${GLOBAL_TEMPLATE_FOLDER}
509 ${data}= Apply Template sdc ${ASDC_ACTION_TEMPLATE} ${map}
DR695Hbfed6592019-07-11 12:02:08 -0400510 ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD}
511 ${resp}= SDC.Run Put Request ${ASDC_BE_ONBOARD_ENDPOINT} ${ASDC_VENDOR_SOFTWARE_PRODUCT_PATH}/${id}/versions/${version_id}${ASDC_VENDOR_ACTIONS_PATH} ${data} ${ASDC_DESIGNER_USER_ID} auth=${auth}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500512 Should Be Equal As Strings ${resp.status_code} 200
Jerry Floode2a48d72017-06-21 15:06:29 -0400513 [Return] ${resp.json()}
kaihlavi06fa4ee2019-05-22 19:08:14 +0300514
Jerry Floode2a48d72017-06-21 15:06:29 -0400515Validate ASDC Software Product
kaihlavi06fa4ee2019-05-22 19:08:14 +0300516 [Documentation] Validates an ASDC Software Product by its id
Jerry Floode2a48d72017-06-21 15:06:29 -0400517 [Arguments] ${id} ${version_id}=0.1
518 ${data}= Catenate
DR695Hbfed6592019-07-11 12:02:08 -0400519 ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD}
520 ${resp}= SDC.Run Put Request ${ASDC_BE_ONBOARD_ENDPOINT} ${ASDC_VENDOR_SOFTWARE_PRODUCT_PATH}/${id}/versions/${version_id}/orchestration-template-candidate/process ${data} ${ASDC_DESIGNER_USER_ID} auth=${auth}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500521 Should Be Equal As Strings ${resp.status_code} 200
DR695Hccff30b2017-02-17 18:44:24 -0500522 [Return] ${resp.json()}
kaihlavi06fa4ee2019-05-22 19:08:14 +0300523
DR695Hccff30b2017-02-17 18:44:24 -0500524Submit ASDC Software Product
kaihlavi06fa4ee2019-05-22 19:08:14 +0300525 [Documentation] Submits an ASDC Software Product by its id
Jerry Floode2a48d72017-06-21 15:06:29 -0400526 [Arguments] ${id} ${version_id}=0.1
DR695Hccff30b2017-02-17 18:44:24 -0500527 ${map}= Create Dictionary action=Submit
DR695H3bb6cf42019-06-20 15:04:04 -0400528 Create Environment sdc ${GLOBAL_TEMPLATE_FOLDER}
529 ${data}= Apply Template sdc ${ASDC_ACTION_TEMPLATE} ${map}
DR695Hbfed6592019-07-11 12:02:08 -0400530 ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD}
531 ${resp}= SDC.Run Put Request ${ASDC_BE_ONBOARD_ENDPOINT} ${ASDC_VENDOR_SOFTWARE_PRODUCT_PATH}/${id}/versions/${version_id}${ASDC_VENDOR_ACTIONS_PATH} ${data} ${ASDC_DESIGNER_USER_ID} auth=${auth}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500532 Should Be Equal As Strings ${resp.status_code} 200
DR695Hccff30b2017-02-17 18:44:24 -0500533 [Return] ${resp.json()}
kaihlavi06fa4ee2019-05-22 19:08:14 +0300534
DR695Hccff30b2017-02-17 18:44:24 -0500535Package ASDC Software Product
kaihlavi06fa4ee2019-05-22 19:08:14 +0300536 [Documentation] Creates a package of an ASDC Software Product by its id
Jerry Floode2a48d72017-06-21 15:06:29 -0400537 [Arguments] ${id} ${version_id}=0.1
DR695Hccff30b2017-02-17 18:44:24 -0500538 ${map}= Create Dictionary action=Create_Package
DR695H3bb6cf42019-06-20 15:04:04 -0400539 Create Environment sdc ${GLOBAL_TEMPLATE_FOLDER}
540 ${data}= Apply Template sdc ${ASDC_ACTION_TEMPLATE} ${map}
DR695Hbfed6592019-07-11 12:02:08 -0400541 ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD}
542 ${resp}= SDC.Run Put Request ${ASDC_BE_ONBOARD_ENDPOINT} ${ASDC_VENDOR_SOFTWARE_PRODUCT_PATH}/${id}/versions/${version_id}${ASDC_VENDOR_ACTIONS_PATH} ${data} ${ASDC_DESIGNER_USER_ID} auth=${auth}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500543 Should Be Equal As Strings ${resp.status_code} 200
Jerry Floode2a48d72017-06-21 15:06:29 -0400544 [Return] ${resp.json()}
kaihlavi06fa4ee2019-05-22 19:08:14 +0300545
DR695Hccff30b2017-02-17 18:44:24 -0500546Add ASDC Entitlement Pool
kaihlavi06fa4ee2019-05-22 19:08:14 +0300547 [Documentation] Creates an ASDC Entitlement Pool and returns its id
Brian Freeman15033782019-03-22 15:48:55 -0500548 [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 -0400549 ${uuid}= Generate UUID4
Jerry Floode2a48d72017-06-21 15:06:29 -0400550 ${shortened_uuid}= Evaluate str("${uuid}")[:23]
Brian Freeman15033782019-03-22 15:48:55 -0500551 ${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 -0400552 Create Environment sdc ${GLOBAL_TEMPLATE_FOLDER}
553 ${data}= Apply Template sdc ${ASDC_ENTITLEMENT_POOL_TEMPLATE} ${map}
DR695H39a6be82019-07-10 19:08:20 -0400554 ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD}
DR695Hbfed6592019-07-11 12:02:08 -0400555 ${resp}= SDC.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 -0500556 Should Be Equal As Strings ${resp.status_code} 200
DR695Hccff30b2017-02-17 18:44:24 -0500557 [Return] ${resp.json()['value']}
kaihlavi06fa4ee2019-05-22 19:08:14 +0300558
DR695Hccff30b2017-02-17 18:44:24 -0500559Get ASDC Entitlement Pool
kaihlavi06fa4ee2019-05-22 19:08:14 +0300560 [Documentation] Gets an ASDC Entitlement Pool by its id
DR695Hccff30b2017-02-17 18:44:24 -0500561 [Arguments] ${license_model_id} ${pool_id}
DR695Hbfed6592019-07-11 12:02:08 -0400562 ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD}
563 ${resp}= SDC.Run Get Request ${ASDC_BE_ONBOARD_ENDPOINT} ${ASDC_VENDOR_LICENSE_MODEL_PATH}/${license_model_id}${ASDC_VENDOR_ENTITLEMENT_POOL_PATH}/${pool_id} ${ASDC_DESIGNER_USER_ID} auth=${auth}
DR695Hccff30b2017-02-17 18:44:24 -0500564 [Return] ${resp.json()}
kaihlavi06fa4ee2019-05-22 19:08:14 +0300565
DR695Hccff30b2017-02-17 18:44:24 -0500566Add ASDC License Group
kaihlavi06fa4ee2019-05-22 19:08:14 +0300567 [Documentation] Creates an ASDC License Group and returns its id
Brian Freeman15033782019-03-22 15:48:55 -0500568 [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 -0400569 ${uuid}= Generate UUID4
Jerry Floode2a48d72017-06-21 15:06:29 -0400570 ${shortened_uuid}= Evaluate str("${uuid}")[:23]
Brian Freeman15033782019-03-22 15:48:55 -0500571 ${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 -0400572 Create Environment sdc ${GLOBAL_TEMPLATE_FOLDER}
573 ${data}= Apply Template sdc ${ASDC_KEY_GROUP_TEMPLATE} ${map}
DR695H39a6be82019-07-10 19:08:20 -0400574 ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD}
DR695Hbfed6592019-07-11 12:02:08 -0400575 ${resp}= SDC.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 -0500576 Should Be Equal As Strings ${resp.status_code} 200
DR695Hccff30b2017-02-17 18:44:24 -0500577 [Return] ${resp.json()['value']}
kaihlavi06fa4ee2019-05-22 19:08:14 +0300578
DR695Hccff30b2017-02-17 18:44:24 -0500579Get ASDC License Group
kaihlavi06fa4ee2019-05-22 19:08:14 +0300580 [Documentation] Gets an ASDC License Group by its id
Jerry Floode2a48d72017-06-21 15:06:29 -0400581 [Arguments] ${license_model_id} ${group_id} ${version_id}
DR695Hbfed6592019-07-11 12:02:08 -0400582 ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD}
583 ${resp}= SDC.Run Get Request ${ASDC_BE_ONBOARD_ENDPOINT} ${ASDC_VENDOR_LICENSE_MODEL_PATH}/${license_model_id}/versions/${version_id}${ASDC_VENDOR_KEY_GROUP_PATH}/${group_id} ${ASDC_DESIGNER_USER_ID} auth=${auth}
DR695Hccff30b2017-02-17 18:44:24 -0500584 [Return] ${resp.json()}
kaihlavi06fa4ee2019-05-22 19:08:14 +0300585
DR695Hccff30b2017-02-17 18:44:24 -0500586Add ASDC Feature Group
kaihlavi06fa4ee2019-05-22 19:08:14 +0300587 [Documentation] Creates an ASDC Feature Group and returns its id
Jerry Floode2a48d72017-06-21 15:06:29 -0400588 [Arguments] ${license_model_id} ${key_group_id} ${entitlement_pool_id} ${version_id}=0.1
DR695H18872bc2019-06-13 16:16:52 -0400589 ${uuid}= Generate UUID4
Jerry Floode2a48d72017-06-21 15:06:29 -0400590 ${shortened_uuid}= Evaluate str("${uuid}")[:23]
Jerry Flood80ff9852017-08-11 06:47:14 -0400591 ${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 -0400592 Create Environment sdc ${GLOBAL_TEMPLATE_FOLDER}
593 ${data}= Apply Template sdc ${ASDC_FEATURE_GROUP_TEMPLATE} ${map}
DR695H39a6be82019-07-10 19:08:20 -0400594 ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD}
DR695Hbfed6592019-07-11 12:02:08 -0400595 ${resp}= SDC.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 -0500596 Should Be Equal As Strings ${resp.status_code} 200
DR695Hccff30b2017-02-17 18:44:24 -0500597 [Return] ${resp.json()['value']}
kaihlavi06fa4ee2019-05-22 19:08:14 +0300598
DR695Hccff30b2017-02-17 18:44:24 -0500599Get ASDC Feature Group
kaihlavi06fa4ee2019-05-22 19:08:14 +0300600 [Documentation] Gets an ASDC Feature Group by its id
DR695Hccff30b2017-02-17 18:44:24 -0500601 [Arguments] ${license_model_id} ${group_id}
DR695Hbfed6592019-07-11 12:02:08 -0400602 ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD}
603 ${resp}= SDC.Run Get Request ${ASDC_BE_ONBOARD_ENDPOINT} ${ASDC_VENDOR_LICENSE_MODEL_PATH}/${license_model_id}${ASDC_VENDOR_FEATURE_GROUP_PATH}/${group_id} ${ASDC_DESIGNER_USER_ID} auth=${auth}
DR695Hccff30b2017-02-17 18:44:24 -0500604 [Return] ${resp.json()}
kaihlavi06fa4ee2019-05-22 19:08:14 +0300605
DR695Hccff30b2017-02-17 18:44:24 -0500606Add ASDC License Agreement
kaihlavi06fa4ee2019-05-22 19:08:14 +0300607 [Documentation] Creates an ASDC License Agreement and returns its id
Jerry Floode2a48d72017-06-21 15:06:29 -0400608 [Arguments] ${license_model_id} ${feature_group_id} ${version_id}=0.1
DR695H18872bc2019-06-13 16:16:52 -0400609 ${uuid}= Generate UUID4
Jerry Floode2a48d72017-06-21 15:06:29 -0400610 ${shortened_uuid}= Evaluate str("${uuid}")[:23]
DR695Hccff30b2017-02-17 18:44:24 -0500611 ${map}= Create Dictionary license_agreement_name=${shortened_uuid} feature_group_id=${feature_group_id}
DR695H3bb6cf42019-06-20 15:04:04 -0400612 Create Environment sdc ${GLOBAL_TEMPLATE_FOLDER}
613 ${data}= Apply Template sdc ${ASDC_LICENSE_AGREEMENT_TEMPLATE} ${map}
DR695H39a6be82019-07-10 19:08:20 -0400614 ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD}
DR695Hbfed6592019-07-11 12:02:08 -0400615 ${resp}= SDC.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 -0500616 Should Be Equal As Strings ${resp.status_code} 200
DR695Hccff30b2017-02-17 18:44:24 -0500617 [Return] ${resp.json()['value']}
kaihlavi06fa4ee2019-05-22 19:08:14 +0300618
DR695Hccff30b2017-02-17 18:44:24 -0500619Get ASDC License Agreement
kaihlavi06fa4ee2019-05-22 19:08:14 +0300620 [Documentation] Gets an ASDC License Agreement by its id
DR695Hccff30b2017-02-17 18:44:24 -0500621 [Arguments] ${license_model_id} ${agreement_id}
DR695Hbfed6592019-07-11 12:02:08 -0400622 ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD}
623 ${resp}= SDC.Run Get Request ${ASDC_BE_ONBOARD_ENDPOINT} ${ASDC_VENDOR_LICENSE_MODEL_PATH}/${license_model_id}${ASDC_VENDOR_LICENSE_AGREEMENT_PATH}/${agreement_id} ${ASDC_DESIGNER_USER_ID} auth=${auth}
DR695Hccff30b2017-02-17 18:44:24 -0500624 [Return] ${resp.json()}
kaihlavi06fa4ee2019-05-22 19:08:14 +0300625
DR695Hccff30b2017-02-17 18:44:24 -0500626Add ASDC Software Product
kaihlavi06fa4ee2019-05-22 19:08:14 +0300627 [Documentation] Creates an ASDC Software Product and returns its id
Brian Freeman9c42ae12018-11-27 14:33:27 -0500628 [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 -0400629 ${uuid}= Generate UUID4
Brian Freeman9c42ae12018-11-27 14:33:27 -0500630 ${shortened_uuid}= Evaluate str("${uuid}")[:13]
631 ${software_product_name}= Catenate ${name_prefix} ${shortened_uuid}
632 ${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 -0400633 Create Environment sdc ${GLOBAL_TEMPLATE_FOLDER}
634 ${data}= Apply Template sdc ${ASDC_SOFTWARE_PRODUCT_TEMPLATE} ${map}
DR695H39a6be82019-07-10 19:08:20 -0400635 ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD}
DR695Hbfed6592019-07-11 12:02:08 -0400636 ${resp}= SDC.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 -0500637 Should Be Equal As Strings ${resp.status_code} 200
Brian Freemanb568e5e2018-04-05 21:03:38 -0500638 [Return] ${resp.json()['itemId']} ${resp.json()['version']['id']}
kaihlavi06fa4ee2019-05-22 19:08:14 +0300639
DR695Hccff30b2017-02-17 18:44:24 -0500640Get ASDC Software Product
kaihlavi06fa4ee2019-05-22 19:08:14 +0300641 [Documentation] Gets an ASDC Software Product by its id
Jerry Floode2a48d72017-06-21 15:06:29 -0400642 [Arguments] ${software_product_id} ${version_id}=0.1
DR695Hbfed6592019-07-11 12:02:08 -0400643 ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD}
644 ${resp}= SDC.Run Get Request ${ASDC_BE_ONBOARD_ENDPOINT} ${ASDC_VENDOR_SOFTWARE_PRODUCT_PATH}/${software_product_id}/versions/${version_id} ${ASDC_DESIGNER_USER_ID} auth=${auth}
DR695Hccff30b2017-02-17 18:44:24 -0500645 [Return] ${resp.json()}
bdfreeman1421b2a49512018-11-25 07:32:19 -0500646
DR695Hccff30b2017-02-17 18:44:24 -0500647Add ASDC Catalog Resource
kaihlavi06fa4ee2019-05-22 19:08:14 +0300648 [Documentation] Creates an ASDC Catalog Resource and returns its id
DR695Hccff30b2017-02-17 18:44:24 -0500649 [Arguments] ${license_agreement_id} ${software_product_name} ${license_model_name} ${software_product_id}
650 ${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 -0400651 Create Environment sdc ${GLOBAL_TEMPLATE_FOLDER}
652 ${data}= Apply Template sdc ${ASDC_CATALOG_RESOURCE_TEMPLATE} ${map}
DR695H39a6be82019-07-10 19:08:20 -0400653 ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD}
DR695Hbfed6592019-07-11 12:02:08 -0400654 ${resp}= SDC.Run Post Request ${ASDC_BE_ENDPOINT} ${ASDC_CATALOG_RESOURCES_PATH} ${data} ${ASDC_DESIGNER_USER_ID} auth=${auth}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500655 Should Be Equal As Strings ${resp.status_code} 201
DR695Hccff30b2017-02-17 18:44:24 -0500656 [Return] ${resp.json()['uniqueId']}
bdfreeman1421b2a49512018-11-25 07:32:19 -0500657
658Add ASDC Allotted Resource Catalog Resource
kaihlavi06fa4ee2019-05-22 19:08:14 +0300659 [Documentation] Creates an ASDC Allotted Resource Catalog Resource and returns its id
bdfreeman1421b2a49512018-11-25 07:32:19 -0500660 [Arguments] ${license_agreement_id} ${software_product_name} ${license_model_name} ${software_product_id} ${subcategory}
661 ${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 -0400662 Create Environment sdc ${GLOBAL_TEMPLATE_FOLDER}
663 ${data}= Apply Template sdc ${ASDC_ALLOTTED_RESOURCE_CATALOG_RESOURCE_TEMPLATE} ${map}
DR695H39a6be82019-07-10 19:08:20 -0400664 ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD}
DR695Hbfed6592019-07-11 12:02:08 -0400665 ${resp}= SDC.Run Post Request ${ASDC_BE_ENDPOINT} ${ASDC_CATALOG_RESOURCES_PATH} ${data} ${ASDC_DESIGNER_USER_ID} auth=${auth}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500666 Should Be Equal As Strings ${resp.status_code} 201
bdfreeman1421b2a49512018-11-25 07:32:19 -0500667 [Return] ${resp.json()['uniqueId']}
668
DR695Hccff30b2017-02-17 18:44:24 -0500669Mark ASDC Catalog Resource Inactive
kaihlavi06fa4ee2019-05-22 19:08:14 +0300670 [Documentation] Marks ASDC Catalog Resource as inactive
DR695Hccff30b2017-02-17 18:44:24 -0500671 [Arguments] ${catalog_resource_id}
DR695Hbfed6592019-07-11 12:02:08 -0400672 ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD}
673 ${resp}= SDC.Run Delete Request ${ASDC_BE_ENDPOINT} ${ASDC_CATALOG_RESOURCES_PATH}/${catalog_resource_id} ${None} ${ASDC_DESIGNER_USER_ID} auth=${auth}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500674 Should Be Equal As Strings ${resp.status_code} 204
DR695Hccff30b2017-02-17 18:44:24 -0500675 [Return] ${resp}
kaihlavi06fa4ee2019-05-22 19:08:14 +0300676
DR695Hccff30b2017-02-17 18:44:24 -0500677Delete Inactive ASDC Catalog Resources
kaihlavi06fa4ee2019-05-22 19:08:14 +0300678 [Documentation] Delete all ASDC Catalog Resources that are inactive
DR695Hbfed6592019-07-11 12:02:08 -0400679 ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD}
680 ${resp}= SDC.Run Delete Request ${ASDC_BE_ENDPOINT} ${ASDC_CATALOG_INACTIVE_RESOURCES_PATH} ${None} ${ASDC_DESIGNER_USER_ID} auth=${auth}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500681 Should Be Equal As Strings ${resp.status_code} 200
DR695Hccff30b2017-02-17 18:44:24 -0500682 [Return] ${resp.json()}
kaihlavi06fa4ee2019-05-22 19:08:14 +0300683
DR695Hccff30b2017-02-17 18:44:24 -0500684Get ASDC Catalog Resource
kaihlavi06fa4ee2019-05-22 19:08:14 +0300685 [Documentation] Gets an ASDC Catalog Resource by its id
DR695Hccff30b2017-02-17 18:44:24 -0500686 [Arguments] ${catalog_resource_id}
DR695Hbfed6592019-07-11 12:02:08 -0400687 ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD}
688 ${resp}= SDC.Run Get Request ${ASDC_BE_ENDPOINT} ${ASDC_CATALOG_RESOURCES_PATH}/${catalog_resource_id} ${ASDC_DESIGNER_USER_ID} auth=${auth}
DR695Hccff30b2017-02-17 18:44:24 -0500689 [Return] ${resp.json()}
Brian Freemaneef7c6f2018-11-16 18:42:21 -0500690
Yang Xu2ec80382018-11-01 12:30:37 -0400691Get ASDC Catalog Resource Component Instances
kaihlavi06fa4ee2019-05-22 19:08:14 +0300692 [Documentation] Gets component instances of an ASDC Catalog Resource by its id
Yang Xu2ec80382018-11-01 12:30:37 -0400693 [Arguments] ${catalog_resource_id}
DR695Hbfed6592019-07-11 12:02:08 -0400694 ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD}
695 ${resp}= SDC.Run Get Request ${ASDC_FE_ENDPOINT} ${ASDC_FE_CATALOG_RESOURCES_PATH}/${catalog_resource_id}/filteredDataByParams?include=componentInstances ${ASDC_DESIGNER_USER_ID} auth=${auth}
Yang Xu2ec80382018-11-01 12:30:37 -0400696 [Return] ${resp.json()}
bdfreeman1421b2a49512018-11-25 07:32:19 -0500697
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500698Get ASDC Catalog Resource Deployment Artifact Properties
kaihlavi06fa4ee2019-05-22 19:08:14 +0300699 [Documentation] Gets deployment artifact properties of an ASDC Catalog Resource by its id
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500700 [Arguments] ${catalog_resource_id}
DR695Hbfed6592019-07-11 12:02:08 -0400701 ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD}
702 ${resp}= SDC.Run Get Request ${ASDC_FE_ENDPOINT} ${ASDC_CATALOG_SERVICES_PATH}/${catalog_resource_id}/filteredDataByParams?include=deploymentArtifacts ${ASDC_DESIGNER_USER_ID} auth=${auth}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500703 [Return] ${resp.json()}
704
705
Brian Freemaneef7c6f2018-11-16 18:42:21 -0500706Get ASDC Catalog Resource Component Instances Properties
kaihlavi06fa4ee2019-05-22 19:08:14 +0300707 [Documentation] Gets ASDC Catalog Resource component instances properties by its id
Brian Freemaneef7c6f2018-11-16 18:42:21 -0500708 [Arguments] ${catalog_resource_id}
DR695Hbfed6592019-07-11 12:02:08 -0400709 ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD}
710 ${resp}= SDC.Run Get Request ${ASDC_BE_ENDPOINT} ${ASDC_CATALOG_SERVICES_PATH}/${catalog_resource_id}/filteredDataByParams?include=componentInstancesProperties ${ASDC_DESIGNER_USER_ID} auth=${auth}
Brian Freemaneef7c6f2018-11-16 18:42:21 -0500711 [Return] ${resp.json()}
712
bdfreeman1421b2a49512018-11-25 07:32:19 -0500713Get ASDC Catalog Resource Component Instances Properties For Resource
kaihlavi06fa4ee2019-05-22 19:08:14 +0300714 [Documentation] Gets ASDC Catalog Resource component instances properties for a Resource (VF) by its id
bdfreeman1421b2a49512018-11-25 07:32:19 -0500715 [Arguments] ${catalog_resource_id}
DR695Hbfed6592019-07-11 12:02:08 -0400716 ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD}
717 ${resp}= SDC.Run Get Request ${ASDC_FE_ENDPOINT} ${ASDC_FE_CATALOG_RESOURCES_PATH}/${catalog_resource_id}/filteredDataByParams?include=componentInstancesProperties ${ASDC_DESIGNER_USER_ID} auth=${auth}
bdfreeman1421b2a49512018-11-25 07:32:19 -0500718 [Return] ${resp.json()}
Brian Freemaneef7c6f2018-11-16 18:42:21 -0500719
Yang Xu2ec80382018-11-01 12:30:37 -0400720Get ASDC Catalog Resource Inputs
kaihlavi06fa4ee2019-05-22 19:08:14 +0300721 [Documentation] Gets ASDC Catalog Resource inputs by its id
Yang Xu2ec80382018-11-01 12:30:37 -0400722 [Arguments] ${catalog_resource_id}
DR695Hbfed6592019-07-11 12:02:08 -0400723 ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD}
724 ${resp}= SDC.Run Get Request ${ASDC_FE_ENDPOINT} ${ASDC_FE_CATALOG_RESOURCES_PATH}/${catalog_resource_id}/filteredDataByParams?include=inputs ${ASDC_DESIGNER_USER_ID} auth=${auth}
Yang Xu2ec80382018-11-01 12:30:37 -0400725 [Return] ${resp.json()}
Brian Freemaneef7c6f2018-11-16 18:42:21 -0500726
Yang Xu2ec80382018-11-01 12:30:37 -0400727Get ASDC Catalog Resource Component Instance Properties
kaihlavi06fa4ee2019-05-22 19:08:14 +0300728 [Documentation] Gets component instance properties of an ASDC Catalog Resource by their ids
Yang Xu2ec80382018-11-01 12:30:37 -0400729 [Arguments] ${catalog_resource_id} ${component_instance_id} ${component_id}
DR695Hbfed6592019-07-11 12:02:08 -0400730 ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD}
731 ${resp}= SDC.Run Get Request ${ASDC_FE_ENDPOINT} ${ASDC_FE_CATALOG_RESOURCES_PATH}/${catalog_resource_id}/componentInstances/${component_instance_id}/${component_id}/inputs ${ASDC_DESIGNER_USER_ID}auth=${auth}
Yang Xu2ec80382018-11-01 12:30:37 -0400732 [Return] ${resp.json()}
bdfreeman1421b2a49512018-11-25 07:32:19 -0500733
Yang Xu2ec80382018-11-01 12:30:37 -0400734Set ASDC Catalog Resource Component Instance Properties
kaihlavi06fa4ee2019-05-22 19:08:14 +0300735 [Documentation] Sets ASDC Catalog Resource component instance properties by ids
Brian Freemaneef7c6f2018-11-16 18:42:21 -0500736 [Arguments] ${catalog_resource_id} ${component_parent_service_id} ${data}
DR695H39a6be82019-07-10 19:08:20 -0400737 ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD}
DR695Hbfed6592019-07-11 12:02:08 -0400738 ${resp}= SDC.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 -0500739 [Return] ${resp.json()}
740
741Set ASDC Catalog Resource Component Instance Properties For Resource
kaihlavi06fa4ee2019-05-22 19:08:14 +0300742 [Documentation] Sets ASDC Resource component instance properties by ids
bdfreeman1421b2a49512018-11-25 07:32:19 -0500743 [Arguments] ${catalog_parent_resource_id} ${catalog_resource_id} ${data}
DR695H39a6be82019-07-10 19:08:20 -0400744 ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD}
DR695Hbfed6592019-07-11 12:02:08 -0400745 ${resp}= SDC.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 -0500746 [Return] ${resp.json()}
Brian Freemaneef7c6f2018-11-16 18:42:21 -0500747
Yang Xu74cfb862018-12-06 21:57:32 -0500748Set CDS Catalog Resource Component Instance Properties
kaihlavi06fa4ee2019-05-22 19:08:14 +0300749 [Documentation] Sets CDS Catalog Resource component instance properties by ids
Yang Xu74cfb862018-12-06 21:57:32 -0500750 [Arguments] ${catalog_resource_id} ${component_instance_id} ${data}
DR695H39a6be82019-07-10 19:08:20 -0400751 ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD}
DR695Hbfed6592019-07-11 12:02:08 -0400752 ${resp}= SDC.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 -0500753 [Return] ${resp.json()}
754
Yang Xu2ec80382018-11-01 12:30:37 -0400755Set ASDC Catalog Resource VNF Inputs
kaihlavi06fa4ee2019-05-22 19:08:14 +0300756 [Documentation] Sets VNF Inputs for an ASDC Catalog Resource by its id
Yang Xu2ec80382018-11-01 12:30:37 -0400757 [Arguments] ${catalog_resource_id} ${data}
DR695H39a6be82019-07-10 19:08:20 -0400758 ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD}
DR695Hbfed6592019-07-11 12:02:08 -0400759 ${resp}= SDC.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 -0400760 [Return] ${resp.json()}
kaihlavi06fa4ee2019-05-22 19:08:14 +0300761
Brian Freeman79b00ce2018-11-01 14:57:53 -0500762Get SDC Demo Vnf Catalog Resource
kaihlavi06fa4ee2019-05-22 19:08:14 +0300763 [Documentation] Gets Resource ids of demonstration VNFs for instantiation
Brian Freeman79b00ce2018-11-01 14:57:53 -0500764 [Arguments] ${service_name}
DR695Hbfed6592019-07-11 12:02:08 -0400765 ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD}
766 ${resp}= SDC.Run Get Request ${ASDC_BE_ENDPOINT} ${ASDC_CATALOG_SERVICES_PATH}/serviceName/${service_name}/serviceVersion/1.0 ${ASDC_DESIGNER_USER_ID} auth=${auth}
Brian Freeman79b00ce2018-11-01 14:57:53 -0500767 @{ITEMS}= Copy List ${resp.json()['componentInstances']}
768 ${demo_catalog_resource}= Create Dictionary
769 :FOR ${ELEMENT} IN @{ITEMS}
770 \ Log ${ELEMENT['name']}
771 \ Log ${ELEMENT['groupInstances'][0]['groupName']}
772 \ ${vnf}= Get VNF From Group Name ${ELEMENT['groupInstances'][0]['groupName']} ${service_name}
773 \ ${vnf_data}= Create Dictionary vnf_type=${ELEMENT['name']} vf_module=${ELEMENT['groupInstances'][0]['groupName']}
774 \ LOG ${vnf_data}
775 \ Set To Dictionary ${demo_catalog_resource} ${vnf}=${vnf_data}
776 \ LOG ${demo_catalog_resource}
777 [Return] ${demo_catalog_resource}
778
779Get VNF From Group Name
kaihlavi06fa4ee2019-05-22 19:08:14 +0300780 [Documentation] Looks up VNF key from service mapping for a regex on group_name and service_name
Brian Freeman79b00ce2018-11-01 14:57:53 -0500781 [Arguments] ${group_name} ${service_name}
782 ${vnf}= Set Variable If
Brian Freeman4c71b0b2019-04-26 08:08:56 -0500783 ... ('${service_name}'=='demoVFWCL') and ('base_vfw' in '${group_name}') vFWCLvFWSNK
784 ... ('${service_name}'=='demoVFWCL') and ('base_vpkg' in '${group_name}') vFWCLvPKG
Brian Freeman79b00ce2018-11-01 14:57:53 -0500785 ... ('${service_name}'=='demoVLB') and ('base_vlb' in '${group_name}') vLB
786 [Return] ${vnf}
kaihlavi06fa4ee2019-05-22 19:08:14 +0300787
DR695Hccff30b2017-02-17 18:44:24 -0500788Checkin ASDC Catalog Resource
kaihlavi06fa4ee2019-05-22 19:08:14 +0300789 [Documentation] Checks in an ASDC Catalog Resource by its id
DR695Hccff30b2017-02-17 18:44:24 -0500790 [Arguments] ${catalog_resource_id}
791 ${map}= Create Dictionary user_remarks=Robot remarks
DR695H3bb6cf42019-06-20 15:04:04 -0400792 Create Environment sdc ${GLOBAL_TEMPLATE_FOLDER}
793 ${data}= Apply Template sdc ${ASDC_USER_REMARKS_TEMPLATE} ${map}
DR695H39a6be82019-07-10 19:08:20 -0400794 ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD}
DR695Hbfed6592019-07-11 12:02:08 -0400795 ${resp}= SDC.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 -0500796 Should Be Equal As Strings ${resp.status_code} 200
DR695Hccff30b2017-02-17 18:44:24 -0500797 [Return] ${resp.json()}
kaihlavi06fa4ee2019-05-22 19:08:14 +0300798
DR695Hccff30b2017-02-17 18:44:24 -0500799Request Certify ASDC Catalog Resource
kaihlavi06fa4ee2019-05-22 19:08:14 +0300800 [Documentation] Requests certification of an ASDC Catalog Resource by its id
DR695Hccff30b2017-02-17 18:44:24 -0500801 [Arguments] ${catalog_resource_id}
802 ${map}= Create Dictionary user_remarks=Robot remarks
DR695H3bb6cf42019-06-20 15:04:04 -0400803 Create Environment sdc ${GLOBAL_TEMPLATE_FOLDER}
804 ${data}= Apply Template sdc ${ASDC_USER_REMARKS_TEMPLATE} ${map}
DR695H39a6be82019-07-10 19:08:20 -0400805 ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD}
DR695Hbfed6592019-07-11 12:02:08 -0400806 ${resp}= SDC.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 -0500807 Should Be Equal As Strings ${resp.status_code} 200
DR695Hccff30b2017-02-17 18:44:24 -0500808 [Return] ${resp.json()}
kaihlavi06fa4ee2019-05-22 19:08:14 +0300809
DR695Hccff30b2017-02-17 18:44:24 -0500810Start Certify ASDC Catalog Resource
kaihlavi06fa4ee2019-05-22 19:08:14 +0300811 [Documentation] Start certification of an ASDC Catalog Resource by its id
DR695Hccff30b2017-02-17 18:44:24 -0500812 [Arguments] ${catalog_resource_id}
DR695H39a6be82019-07-10 19:08:20 -0400813 ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD}
DR695Hbfed6592019-07-11 12:02:08 -0400814 ${resp}= SDC.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 -0500815 Should Be Equal As Strings ${resp.status_code} 200
DR695Hccff30b2017-02-17 18:44:24 -0500816 [Return] ${resp.json()}
kaihlavi06fa4ee2019-05-22 19:08:14 +0300817
DR695Hccff30b2017-02-17 18:44:24 -0500818Certify ASDC Catalog Resource
kaihlavi06fa4ee2019-05-22 19:08:14 +0300819 [Documentation] Certifies an ASDC Catalog Resource by its id and returns the new id
Brian Freemandb1e7412018-08-01 12:46:01 -0500820 [Arguments] ${catalog_resource_id} ${user_id}=${ASDC_TESTER_USER_ID}
DR695Hccff30b2017-02-17 18:44:24 -0500821 ${map}= Create Dictionary user_remarks=Robot remarks
DR695H3bb6cf42019-06-20 15:04:04 -0400822 Create Environment sdc ${GLOBAL_TEMPLATE_FOLDER}
823 ${data}= Apply Template sdc ${ASDC_USER_REMARKS_TEMPLATE} ${map}
DR695H39a6be82019-07-10 19:08:20 -0400824 ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD}
DR695Hbfed6592019-07-11 12:02:08 -0400825 ${resp}= SDC.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 -0500826 Should Be Equal As Strings ${resp.status_code} 200
DR695Hccff30b2017-02-17 18:44:24 -0500827 [Return] ${resp.json()['uniqueId']}
Jerry Flood6bd1afa2017-10-09 09:59:23 -0400828
DR695Hccff30b2017-02-17 18:44:24 -0500829Upload ASDC Heat Package
kaihlavi06fa4ee2019-05-22 19:08:14 +0300830 [Documentation] Creates an ASDC Software Product and returns its id
Brian Freemanf508ab22018-03-15 21:19:41 -0500831 [Arguments] ${software_product_id} ${file_path} ${version_id}=0.1
DR695Hbfed6592019-07-11 12:02:08 -0400832 ${files}= Create Dictionary
833 Create Multi Part ${files} upload ${file_path} contentType=application/zip
834 ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD}
835 ${resp}= SDC.Run Post Files Request ${ASDC_BE_ONBOARD_ENDPOINT} ${ASDC_VENDOR_SOFTWARE_PRODUCT_PATH}/${software_product_id}/versions/${version_id}${ASDC_VENDOR_SOFTWARE_UPLOAD_PATH} ${files} ${ASDC_DESIGNER_USER_ID} auth=${auth}
836 Should Be Equal As Strings ${resp.status_code} 200
Jerry Flood6bd1afa2017-10-09 09:59:23 -0400837
DR695Hccff30b2017-02-17 18:44:24 -0500838Add ASDC Catalog Service
kaihlavi06fa4ee2019-05-22 19:08:14 +0300839 [Documentation] Creates an ASDC Catalog Service and returns its id
jf986075010a42017-02-22 16:52:54 -0500840 [Arguments] ${catalog_service_name}
DR695H18872bc2019-06-13 16:16:52 -0400841 ${uuid}= Generate UUID4
jf986075010a42017-02-22 16:52:54 -0500842 ${shortened_uuid}= Evaluate str("${uuid}")[:23]
Jerry Floode2a48d72017-06-21 15:06:29 -0400843 ${catalog_service_name}= Set Variable If '${catalog_service_name}' =='' ${shortened_uuid} ${catalog_service_name}
jf986075010a42017-02-22 16:52:54 -0500844 ${map}= Create Dictionary service_name=${catalog_service_name}
DR695H3bb6cf42019-06-20 15:04:04 -0400845 Create Environment sdc ${GLOBAL_TEMPLATE_FOLDER}
846 ${data}= Apply Template sdc ${ASDC_CATALOG_SERVICE_TEMPLATE} ${map}
DR695H39a6be82019-07-10 19:08:20 -0400847 ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD}
DR695Hbfed6592019-07-11 12:02:08 -0400848 ${resp}= SDC.Run Post Request ${ASDC_BE_ENDPOINT} ${ASDC_CATALOG_SERVICES_PATH} ${data} ${ASDC_DESIGNER_USER_ID} auth=${auth}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500849 Should Be Equal As Strings ${resp.status_code} 201
DR695Hccff30b2017-02-17 18:44:24 -0500850 [Return] ${resp.json()['uniqueId']}
kaihlavi06fa4ee2019-05-22 19:08:14 +0300851
DR695Hccff30b2017-02-17 18:44:24 -0500852Mark ASDC Catalog Service Inactive
kaihlavi06fa4ee2019-05-22 19:08:14 +0300853 [Documentation] Deletes an ASDC Catalog Service
DR695Hccff30b2017-02-17 18:44:24 -0500854 [Arguments] ${catalog_service_id}
DR695Hbfed6592019-07-11 12:02:08 -0400855 ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD}
856 ${resp}= SDC.Run Delete Request ${ASDC_BE_ENDPOINT} ${ASDC_CATALOG_SERVICES_PATH}/${catalog_service_id} ${None} ${ASDC_DESIGNER_USER_ID} auth=${auth}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500857 Should Be Equal As Strings ${resp.status_code} 204
DR695Hccff30b2017-02-17 18:44:24 -0500858 [Return] ${resp}
kaihlavi06fa4ee2019-05-22 19:08:14 +0300859
DR695Hccff30b2017-02-17 18:44:24 -0500860Delete Inactive ASDC Catalog Services
kaihlavi06fa4ee2019-05-22 19:08:14 +0300861 [Documentation] Delete all ASDC Catalog Services that are inactive
DR695Hbfed6592019-07-11 12:02:08 -0400862 ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD}
863 ${resp}= SDC.Run Delete Request ${ASDC_BE_ENDPOINT} ${ASDC_CATALOG_INACTIVE_SERVICES_PATH} ${None} ${ASDC_DESIGNER_USER_ID} auth=${auth}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500864 Should Be Equal As Strings ${resp.status_code} 200
DR695Hccff30b2017-02-17 18:44:24 -0500865 [Return] ${resp.json()}
kaihlavi06fa4ee2019-05-22 19:08:14 +0300866
DR695Hccff30b2017-02-17 18:44:24 -0500867Get ASDC Catalog Service
kaihlavi06fa4ee2019-05-22 19:08:14 +0300868 [Documentation] Gets an ASDC Catalog Service by its id
DR695Hccff30b2017-02-17 18:44:24 -0500869 [Arguments] ${catalog_service_id}
DR695Hbfed6592019-07-11 12:02:08 -0400870 ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD}
871 ${resp}= SDC.Run Get Request ${ASDC_BE_ENDPOINT} ${ASDC_CATALOG_SERVICES_PATH}/${catalog_service_id} ${ASDC_DESIGNER_USER_ID} auth=${auth}
DR695Hccff30b2017-02-17 18:44:24 -0500872 [Return] ${resp.json()}
kaihlavi06fa4ee2019-05-22 19:08:14 +0300873
DR695Hccff30b2017-02-17 18:44:24 -0500874Checkin ASDC Catalog Service
kaihlavi06fa4ee2019-05-22 19:08:14 +0300875 [Documentation] Checks in an ASDC Catalog Service by its 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}
DR695Hbfed6592019-07-11 12:02:08 -0400881 ${resp}= SDC.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 -0500882 Should Be Equal As Strings ${resp.status_code} 200
DR695Hccff30b2017-02-17 18:44:24 -0500883 [Return] ${resp.json()}
kaihlavi06fa4ee2019-05-22 19:08:14 +0300884
DR695Hccff30b2017-02-17 18:44:24 -0500885Request Certify ASDC Catalog Service
kaihlavi06fa4ee2019-05-22 19:08:14 +0300886 [Documentation] Requests certification of 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}
DR695Hbfed6592019-07-11 12:02:08 -0400892 ${resp}= SDC.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 -0500893 Should Be Equal As Strings ${resp.status_code} 200
DR695Hccff30b2017-02-17 18:44:24 -0500894 [Return] ${resp.json()}
kaihlavi06fa4ee2019-05-22 19:08:14 +0300895
DR695Hccff30b2017-02-17 18:44:24 -0500896Start Certify ASDC Catalog Service
kaihlavi06fa4ee2019-05-22 19:08:14 +0300897 [Documentation] Start certification of an ASDC Catalog Service by its id
DR695Hccff30b2017-02-17 18:44:24 -0500898 [Arguments] ${catalog_service_id}
DR695H39a6be82019-07-10 19:08:20 -0400899 ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD}
DR695Hbfed6592019-07-11 12:02:08 -0400900 ${resp}= SDC.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 -0500901 Should Be Equal As Strings ${resp.status_code} 200
DR695Hccff30b2017-02-17 18:44:24 -0500902 [Return] ${resp.json()}
kaihlavi06fa4ee2019-05-22 19:08:14 +0300903
DR695Hccff30b2017-02-17 18:44:24 -0500904Certify ASDC Catalog Service
kaihlavi06fa4ee2019-05-22 19:08:14 +0300905 [Documentation] Certifies an ASDC Catalog Service by its id and returns the new id
DR695Hccff30b2017-02-17 18:44:24 -0500906 [Arguments] ${catalog_service_id}
907 ${map}= Create Dictionary user_remarks=Robot remarks
DR695H3bb6cf42019-06-20 15:04:04 -0400908 Create Environment sdc ${GLOBAL_TEMPLATE_FOLDER}
909 ${data}= Apply Template sdc ${ASDC_USER_REMARKS_TEMPLATE} ${map}
DR695H39a6be82019-07-10 19:08:20 -0400910 ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD}
DR695Hbfed6592019-07-11 12:02:08 -0400911 ${resp}= SDC.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 -0500912 Should Be Equal As Strings ${resp.status_code} 200
DR695Hccff30b2017-02-17 18:44:24 -0500913 [Return] ${resp.json()['uniqueId']}
kaihlavi06fa4ee2019-05-22 19:08:14 +0300914
DR695Hccff30b2017-02-17 18:44:24 -0500915Approve ASDC Catalog Service
kaihlavi06fa4ee2019-05-22 19:08:14 +0300916 [Documentation] Approves an ASDC Catalog Service by its id
DR695Hccff30b2017-02-17 18:44:24 -0500917 [Arguments] ${catalog_service_id}
918 ${map}= Create Dictionary user_remarks=Robot remarks
DR695H3bb6cf42019-06-20 15:04:04 -0400919 Create Environment sdc ${GLOBAL_TEMPLATE_FOLDER}
920 ${data}= Apply Template sdc ${ASDC_USER_REMARKS_TEMPLATE} ${map}
DR695H39a6be82019-07-10 19:08:20 -0400921 ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD}
DR695Hbfed6592019-07-11 12:02:08 -0400922 ${resp}= SDC.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 -0500923 Should Be Equal As Strings ${resp.status_code} 200
DR695Hccff30b2017-02-17 18:44:24 -0500924 [Return] ${resp.json()}
DR695H39a6be82019-07-10 19:08:20 -0400925
DR695Hccff30b2017-02-17 18:44:24 -0500926Distribute ASDC Catalog Service
927 [Documentation] distribute an asdc Catalog Service by its id
928 [Arguments] ${catalog_service_id}
DR695H39a6be82019-07-10 19:08:20 -0400929 ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD}
DR695Hbfed6592019-07-11 12:02:08 -0400930 ${resp}= SDC.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 -0500931 Should Be Equal As Strings ${resp.status_code} 200
DR695Hccff30b2017-02-17 18:44:24 -0500932 [Return] ${resp.json()}
bdfreeman1421b2a49512018-11-25 07:32:19 -0500933
DR695Hccff30b2017-02-17 18:44:24 -0500934Add ASDC Resource Instance
kaihlavi06fa4ee2019-05-22 19:08:14 +0300935 [Documentation] Creates an ASDC Resource Instance and returns its id
Yang Xufac7a632019-05-17 01:01:26 -0400936 [Arguments] ${catalog_service_id} ${catalog_resource_id} ${catalog_resource_name} ${xoffset}=${0} ${yoffset}=${0} ${resourceType}=VF
DR695H18872bc2019-06-13 16:16:52 -0400937 ${milli_timestamp}= Generate Timestamp
Brian Freemaneef7c6f2018-11-16 18:42:21 -0500938 ${xoffset}= Set Variable ${xoffset+306}
939 ${yoffset}= Set Variable ${yoffset+248}
Yang Xufac7a632019-05-17 01:01:26 -0400940 ${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 -0400941 Create Environment sdc ${GLOBAL_TEMPLATE_FOLDER}
942 ${data}= Apply Template sdc ${ASDC_RESOURCE_INSTANCE_TEMPLATE} ${map}
DR695H39a6be82019-07-10 19:08:20 -0400943 ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD}
DR695Hbfed6592019-07-11 12:02:08 -0400944 ${resp}= SDC.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 -0500945 Should Be Equal As Strings ${resp.status_code} 201
DR695Hccff30b2017-02-17 18:44:24 -0500946 [Return] ${resp.json()['uniqueId']}
Brian Freemaneef7c6f2018-11-16 18:42:21 -0500947
bdfreeman1421b2a49512018-11-25 07:32:19 -0500948Add ASDC Resource Instance To Resource
kaihlavi06fa4ee2019-05-22 19:08:14 +0300949 [Documentation] Creates an ASDC Resource Instance in a Resource (VF) and returns its id
Yang Xufac7a632019-05-17 01:01:26 -0400950 [Arguments] ${parent_catalog_resource_id} ${catalog_resource_id} ${catalog_resource_name} ${xoffset}=${0} ${yoffset}=${0} ${resourceType}=VF
DR695H18872bc2019-06-13 16:16:52 -0400951 ${milli_timestamp}= Generate Timestamp
bdfreeman1421b2a49512018-11-25 07:32:19 -0500952 ${xoffset}= Set Variable ${xoffset+306}
953 ${yoffset}= Set Variable ${yoffset+248}
Yang Xufac7a632019-05-17 01:01:26 -0400954 ${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 -0400955 Create Environment sdc ${GLOBAL_TEMPLATE_FOLDER}
956 ${data}= Apply Template sdc ${ASDC_RESOURCE_INSTANCE_TEMPLATE} ${map}
DR695H39a6be82019-07-10 19:08:20 -0400957 ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD}
DR695Hbfed6592019-07-11 12:02:08 -0400958 ${resp}= SDC.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 -0500959 Should Be Equal As Strings ${resp.status_code} 201
bdfreeman1421b2a49512018-11-25 07:32:19 -0500960 [Return] ${resp.json()['uniqueId']}
961
DR695Hccff30b2017-02-17 18:44:24 -0500962Get Catalog Service Distribution
kaihlavi06fa4ee2019-05-22 19:08:14 +0300963 [Documentation] Gets an ASDC Catalog Service distribution
DR695Hccff30b2017-02-17 18:44:24 -0500964 [Arguments] ${catalog_service_uuid}
DR695Hbfed6592019-07-11 12:02:08 -0400965 ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD}
966 ${resp}= SDC.Run Get Request ${ASDC_BE_ENDPOINT} ${ASDC_CATALOG_SERVICES_PATH}/${catalog_service_uuid}${ASDC_CATALOG_SERVICE_DISTRIBUTION_PATH} ${ASDC_OPS_USER_ID} auth=${auth}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500967 Should Be Equal As Strings ${resp.status_code} 200
DR695Hccff30b2017-02-17 18:44:24 -0500968 [Return] ${resp.json()}
kaihlavi06fa4ee2019-05-22 19:08:14 +0300969
DR695Hccff30b2017-02-17 18:44:24 -0500970Check Catalog Service Distributed
kaihlavi06fa4ee2019-05-22 19:08:14 +0300971 [Documentation] Checks if an ASDC Catalog Service is distributed
Brian Freemanadaa2372018-10-24 12:25:22 -0500972 [Arguments] ${catalog_service_uuid} ${dist_status}
DR695Hccff30b2017-02-17 18:44:24 -0500973 ${dist_resp}= Get Catalog Service Distribution ${catalog_service_uuid}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500974 Should Be Equal As Strings ${dist_resp['distributionStatusOfServiceList'][0]['deployementStatus']} Distributed
DR695Hccff30b2017-02-17 18:44:24 -0500975 ${det_resp}= Get Catalog Service Distribution Details ${dist_resp['distributionStatusOfServiceList'][0]['distributionID']}
976 @{ITEMS}= Copy List ${det_resp['distributionStatusList']}
Brian Freemanf508ab22018-03-15 21:19:41 -0500977 Should Not Be Empty ${ITEMS}
Brian Freemana62644f2018-05-13 12:47:38 -0500978 ${SO_COMPLETE} Set Variable FALSE
bdfreeman1421b2a49512018-11-25 07:32:19 -0500979 ${dist_status} Set Variable CONTINUE
980 Should Not Be Empty ${ITEMS}
DR695Hccff30b2017-02-17 18:44:24 -0500981 :FOR ${ELEMENT} IN @{ITEMS}
Brian Freemanf508ab22018-03-15 21:19:41 -0500982 \ Log ${ELEMENT['omfComponentID']}
DR695Hccff30b2017-02-17 18:44:24 -0500983 \ Log ${ELEMENT['status']}
Brian Freeman41ab5e52018-08-08 14:24:23 -0500984 \ ${SO_COMPLETE} Set Variable If (('${ELEMENT['status']}' == 'DISTRIBUTION_COMPLETE_OK')) or ('${SO_COMPLETE}'=='TRUE') TRUE
Brian Freemaneca71072018-08-16 14:50:16 -0500985 \ Exit For Loop If ('${SO_COMPLETE}'=='TRUE')
986 \ Exit For Loop If ('${ELEMENT['status']}' == 'DISTRIBUTION_COMPLETE_ERROR')
Brian Freemanadaa2372018-10-24 12:25:22 -0500987 \ ${dist_status}= Set Variable If (('${ELEMENT['status']}' == 'COMPONENT_DONE_ERROR') and ('${ELEMENT['omfComponentID']}' == 'aai-ml')) EXIT
988 \ Exit For Loop If (('${ELEMENT['status']}' == 'COMPONENT_DONE_ERROR') and ('${ELEMENT['omfComponentID']}' == 'aai-ml'))
Brian Freemana62644f2018-05-13 12:47:38 -0500989 Should Be True ( '${SO_COMPLETE}'=='TRUE') SO Test
bdfreeman1421b2a49512018-11-25 07:32:19 -0500990
DR695Hccff30b2017-02-17 18:44:24 -0500991Get Catalog Service Distribution Details
kaihlavi06fa4ee2019-05-22 19:08:14 +0300992 [Documentation] Gets ASDC Catalog Service distribution details
DR695Hccff30b2017-02-17 18:44:24 -0500993 [Arguments] ${catalog_service_distribution_id}
DR695Hbfed6592019-07-11 12:02:08 -0400994 ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD}
995 ${resp}= SDC.Run Get Request ${ASDC_BE_ENDPOINT} ${ASDC_CATALOG_SERVICES_PATH}${ASDC_CATALOG_SERVICE_DISTRIBUTION_PATH}/${catalog_service_distribution_id} ${ASDC_OPS_USER_ID} auth=${auth}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500996 Should Be Equal As Strings ${resp.status_code} 200
DR695Hccff30b2017-02-17 18:44:24 -0500997 [Return] ${resp.json()}
DR695Hbfed6592019-07-11 12:02:08 -0400998
DR695Hccff30b2017-02-17 18:44:24 -0500999Run ASDC Health Check
1000 [Documentation] Runs a ASDC health check
DR695Hbfed6592019-07-11 12:02:08 -04001001 ${resp}= SDC.Run Get Request ${ASDC_FE_ENDPOINT} ${ASDC_HEALTH_CHECK_PATH} user=${None}
Brian Freemanadaa2372018-10-24 12:25:22 -05001002 # only test for HTTP 200 to determine SDC Health. SDC_DE_HEALTH is informational
Brian Freeman2e1d0ff2019-01-23 09:38:13 -05001003 Should Be Equal As Strings ${resp.status_code} 200 SDC DOWN
Brian Freeman5cf5fa62018-04-23 20:28:16 -05001004 ${SDC_DE_HEALTH}= Catenate DOWN
DR695Hccff30b2017-02-17 18:44:24 -05001005 @{ITEMS}= Copy List ${resp.json()['componentsInfo']}
1006 :FOR ${ELEMENT} IN @{ITEMS}
1007 \ Log ${ELEMENT['healthCheckStatus']}
Brian Freemane546f7e2018-04-19 12:17:56 -05001008 \ ${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 -04001009 Log (DMaaP:${SDC_DE_HEALTH})
Jerry Flood6bd1afa2017-10-09 09:59:23 -04001010
DR695Hccff30b2017-02-17 18:44:24 -05001011Open ASDC GUI
1012 [Documentation] Logs in to ASDC GUI
1013 [Arguments] ${PATH}
1014 ## Setup Browever now being managed by the test case
1015 ##Setup Browser
DR695Hbf5a3a32017-06-30 13:09:57 -04001016 Go To ${ASDC_FE_ENDPOINT}${PATH}
DR695Hccff30b2017-02-17 18:44:24 -05001017 Maximize Browser Window
Jerry Flood6bd1afa2017-10-09 09:59:23 -04001018
DR695Hccff30b2017-02-17 18:44:24 -05001019 Set Browser Implicit Wait ${GLOBAL_SELENIUM_BROWSER_IMPLICIT_WAIT}
DR695Hbf5a3a32017-06-30 13:09:57 -04001020 Log Logging in to ${ASDC_FE_ENDPOINT}${PATH}
DR695Hccff30b2017-02-17 18:44:24 -05001021 Title Should Be ASDC
Jerry Floode2a48d72017-06-21 15:06:29 -04001022 Wait Until Page Contains Element xpath=//div/a[text()='SDC'] ${GLOBAL_SELENIUM_BROWSER_WAIT_TIMEOUT}
DR695Hbf5a3a32017-06-30 13:09:57 -04001023 Log Logged in to ${ASDC_FE_ENDPOINT}${PATH}
Jerry Flood6bd1afa2017-10-09 09:59:23 -04001024
1025
1026Create Multi Part
1027 [Arguments] ${addTo} ${partName} ${filePath} ${contentType}=${None}
1028 ${fileData}= Get Binary File ${filePath}
1029 ${fileDir} ${fileName}= Split Path ${filePath}
1030 ${partData}= Create List ${fileName} ${fileData} ${contentType}
1031 Set To Dictionary ${addTo} ${partName}=${partData}
Brian Freemanf940ee92018-05-25 21:09:05 -05001032