blob: bef19b8c5d6be16ebb33936bea01672e58fede09 [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
DR695Hccff30b2017-02-17 18:44:24 -050015Resource global_properties.robot
16Resource browser_setup.robot
Brian Freeman2e1d0ff2019-01-23 09:38:13 -050017
DR695Hccff30b2017-02-17 18:44:24 -050018*** Variables ***
19${ASDC_DESIGNER_USER_ID} cs0008
20${ASDC_TESTER_USER_ID} jm0007
21${ASDC_GOVERNOR_USER_ID} gv0001
22${ASDC_OPS_USER_ID} op0001
23${ASDC_HEALTH_CHECK_PATH} /sdc1/rest/healthCheck
24${ASDC_VENDOR_LICENSE_MODEL_PATH} /onboarding-api/v1.0/vendor-license-models
25${ASDC_VENDOR_SOFTWARE_PRODUCT_PATH} /onboarding-api/v1.0/vendor-software-products
26${ASDC_VENDOR_KEY_GROUP_PATH} /license-key-groups
27${ASDC_VENDOR_ENTITLEMENT_POOL_PATH} /entitlement-pools
28${ASDC_VENDOR_FEATURE_GROUP_PATH} /feature-groups
29${ASDC_VENDOR_LICENSE_AGREEMENT_PATH} /license-agreements
30${ASDC_VENDOR_ACTIONS_PATH} /actions
Jerry Floode2a48d72017-06-21 15:06:29 -040031${ASDC_VENDOR_SOFTWARE_UPLOAD_PATH} /orchestration-template-candidate
Yang Xu2ec80382018-11-01 12:30:37 -040032${ASDC_FE_CATALOG_RESOURCES_PATH} /sdc1/feProxy/rest/v1/catalog/resources
Brian Freemaneef7c6f2018-11-16 18:42:21 -050033${ASDC_FE_CATALOG_SERVICES_PATH} /sdc1/feProxy/rest/v1/catalog/services
DR695Hccff30b2017-02-17 18:44:24 -050034${ASDC_CATALOG_RESOURCES_PATH} /sdc2/rest/v1/catalog/resources
35${ASDC_CATALOG_SERVICES_PATH} /sdc2/rest/v1/catalog/services
36${ASDC_CATALOG_INACTIVE_RESOURCES_PATH} /sdc2/rest/v1/inactiveComponents/resource
Brian Freemaneef7c6f2018-11-16 18:42:21 -050037${ASDC_CATALOG_RESOURCES_QUERY_PATH} /sdc2/rest/v1/catalog/resources/resourceName
DR695Hccff30b2017-02-17 18:44:24 -050038${ASDC_CATALOG_INACTIVE_SERVICES_PATH} /sdc2/rest/v1/inactiveComponents/service
39${ASDC_CATALOG_LIFECYCLE_PATH} /lifecycleState
40${ASDC_CATALOG_SERVICE_RESOURCE_INSTANCE_PATH} /resourceInstance
Brian Freeman2e1d0ff2019-01-23 09:38:13 -050041${ASDC_CATALOG_SERVICE_RESOURCE_ARTIFACT_PATH} /artifacts
DR695Hccff30b2017-02-17 18:44:24 -050042${ASDC_CATALOG_SERVICE_DISTRIBUTION_STATE_PATH} /distribution-state
43${ASDC_CATALOG_SERVICE_DISTRIBUTION_PATH} /distribution
44${ASDC_DISTRIBUTION_STATE_APPROVE_PATH} /approve
45${ASDC_CATALOG_SERVICE_DISTRIBUTION_ACTIVATE_PATH} /distribution/PROD/activate
DR695H3bb6cf42019-06-20 15:04:04 -040046${ASDC_LICENSE_MODEL_TEMPLATE} asdc/license_model.jinja
47${ASDC_KEY_GROUP_TEMPLATE} asdc/key_group.jinja
48${ASDC_ENTITLEMENT_POOL_TEMPLATE} asdc/entitlement_pool.jinja
49${ASDC_FEATURE_GROUP_TEMPLATE} asdc/feature_group.jinja
50${ASDC_LICENSE_AGREEMENT_TEMPLATE} asdc/license_agreement.jinja
51${ASDC_ACTION_TEMPLATE} asdc/action.jinja
52${ASDC_SOFTWARE_PRODUCT_TEMPLATE} asdc/software_product.jinja
53${ASDC_ARTIFACT_UPLOAD_TEMPLATE} asdc/artifact_upload.jinja
54${ASDC_CATALOG_RESOURCE_TEMPLATE} asdc/catalog_resource.jinja
55${ASDC_USER_REMARKS_TEMPLATE} asdc/user_remarks.jinja
56${ASDC_CATALOG_SERVICE_TEMPLATE} asdc/catalog_service.jinja
57${ASDC_RESOURCE_INSTANCE_TEMPLATE} asdc/resource_instance.jinja
58${ASDC_RESOURCE_INSTANCE_VNF_PROPERTIES_TEMPLATE} asdc/catalog_vnf_properties.jinja
59${ASDC_RESOURCE_INSTANCE_VNF_INPUTS_TEMPLATE} asdc/catalog_vnf_inputs.jinja
60${SDC_CATALOG_NET_RESOURCE_INPUT_TEMPLATE} asdc/catalog_net_input_properties.jinja
61${ASDC_ALLOTTED_RESOURCE_CATALOG_RESOURCE_TEMPLATE} asdc/catalog_resource_alloted_resource.jinja
62${SDC_CATALOG_ALLOTTED_RESOURCE_PROPERTIES_TEMPLATE} asdc/catalog_allotted_properties.jinja
63${SDC_CATALOG_ALLOTTED_RESOURCE_INPUTS_TEMPLATE} asdc/catalog_allotted_inputs.jinja
Brian Freeman2e1d0ff2019-01-23 09:38:13 -050064${SDC_CATALOG_DEPLOYMENT_ARTIFACT_PATH} robot/assets/asdc/blueprints/
Brian Freemanf508ab22018-03-15 21:19:41 -050065${ASDC_FE_ENDPOINT} ${GLOBAL_ASDC_SERVER_PROTOCOL}://${GLOBAL_INJECTED_SDC_FE_IP_ADDR}:${GLOBAL_ASDC_FE_PORT}
66${ASDC_BE_ENDPOINT} ${GLOBAL_ASDC_SERVER_PROTOCOL}://${GLOBAL_INJECTED_SDC_BE_IP_ADDR}:${GLOBAL_ASDC_BE_PORT}
Brian Freeman44b8bb32018-05-03 21:08:42 -050067${ASDC_BE_ONBOARD_ENDPOINT} ${GLOBAL_ASDC_SERVER_PROTOCOL}://${GLOBAL_INJECTED_SDC_BE_ONBOARD_IP_ADDR}:${GLOBAL_ASDC_BE_ONBOARD_PORT}
DR695Hbf5a3a32017-06-30 13:09:57 -040068
DR695Hccff30b2017-02-17 18:44:24 -050069*** Keywords ***
70Distribute Model From ASDC
kaihlavi06fa4ee2019-05-22 19:08:14 +030071 [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 -050072 [Arguments] ${model_zip_path} ${catalog_service_name}= ${cds}= ${service}=
bdfreeman1421b2a49512018-11-25 07:32:19 -050073 # For Testing use random service names
Brian Freemaneef7c6f2018-11-16 18:42:21 -050074 #${random}= Get Current Date
75 #${catalog_service_id}= Add ASDC Catalog Service ${catalog_service_name}_${random}
jf986075010a42017-02-22 16:52:54 -050076 ${catalog_service_id}= Add ASDC Catalog Service ${catalog_service_name}
DR695Hccff30b2017-02-17 18:44:24 -050077 ${catalog_resource_ids}= Create List
Jerry Flood3a169a32017-12-01 12:39:10 -050078 ${catalog_resources}= Create Dictionary
Brian Freemanee02b312019-02-04 20:36:08 -050079 ##### TODO: Support for Multiple resources of one type in a service ######
80 # The zip list is the resources - no mechanism to indicate more than 1 of the items in the zip list
DR695Hfcb0ee82019-05-22 17:21:38 -040081 # Get Service Vnf Mapping has the logical mapping but it is not the same key as model_zip_path
82 # ${vnflist}= Get Service Vnf Mapping alias ${service}
kaihlavi06fa4ee2019-05-22 19:08:14 +030083 # Save the resource_id in a dictionary keyed by the resource name in the zipfile name (vFWDT_vFWSNK.zip or vFWDT_vPKG.zip)
84 # Create the resources but do not immediately add resource
Brian Freemanee02b312019-02-04 20:36:08 -050085 # Add Resource to Service in a separate FOR loop
Brian Freemanee02b312019-02-04 20:36:08 -050086 ${resource_types}= Create Dictionary
87
DR695H910097e2019-05-08 13:55:32 -040088 :FOR ${zip} IN @{model_zip_path}
Yang Xu2ec80382018-11-01 12:30:37 -040089 \ ${loop_catalog_resource_id}= Setup ASDC Catalog Resource ${zip} ${cds}
kaihlavi06fa4ee2019-05-22 19:08:14 +030090 # zip can be vFW.zip or vFWDT_VFWSNK.zip
Brian Freemanee02b312019-02-04 20:36:08 -050091 \ ${resource_type_match}= Get Regexp Matches ${zip} ${service}_(.*)\.zip 1
Brian Freeman12ff1842019-02-13 13:54:48 -050092 # Need to be able to distribute preload for vFWCL vFWSNK and vFWDT vFWSNK to prepend service to vnf_type
93 \ ${resource_type_string}= Set Variable If len(${resource_type_match})==0 ${service} ${service}${resource_type_match[0]}
Brian Freemanee02b312019-02-04 20:36:08 -050094 \ Set To Dictionary ${resource_types} ${resource_type_string} ${loop_catalog_resource_id}
Jerry Floode2a48d72017-06-21 15:06:29 -040095 \ Append To List ${catalog_resource_ids} ${loop_catalog_resource_id}
Brian Freemanee02b312019-02-04 20:36:08 -050096
DR695Hfcb0ee82019-05-22 17:21:38 -040097 Set Directory default ./demo/service_mapping
98 ${vnflist}= Get Service Vnf Mapping default ${service}
Brian Freemanee02b312019-02-04 20:36:08 -050099
100 # Spread the icons on the pallette starting on the left
kaihlavi06fa4ee2019-05-22 19:08:14 +0300101 ${xoffset}= Set Variable ${0}
Brian Freemanee02b312019-02-04 20:36:08 -0500102
DR695H910097e2019-05-08 13:55:32 -0400103 :FOR ${vnf} IN @{vnflist}
Brian Freemanee02b312019-02-04 20:36:08 -0500104 \ ${loop_catalog_resource_resp}= Get ASDC Catalog Resource ${resource_types['${vnf}']}
105 \ Set To Dictionary ${catalog_resources} ${resource_types['${vnf}']}=${loop_catalog_resource_resp}
106 \ ${catalog_resource_unique_name}= Add ASDC Resource Instance ${catalog_service_id} ${resource_types['${vnf}']} ${loop_catalog_resource_resp['name']} ${xoffset}
107 \ ${xoffset}= Set Variable ${xoffset+100}
Brian Freemaneef7c6f2018-11-16 18:42:21 -0500108 #
109 # do this here because the loop_catalog_resource_resp is different format after adding networks
110 ${vf_module}= Find Element In Array ${loop_catalog_resource_resp['groups']} type org.openecomp.groups.VfModule
111 #
112 # do network
DR695Hfcb0ee82019-05-22 17:21:38 -0400113 ${networklist}= Get Service Neutron Mapping default ${service}
Brian Freemaneef7c6f2018-11-16 18:42:21 -0500114 ${generic_neutron_net_uuid}= Get Generic NeutronNet UUID
DR695H910097e2019-05-08 13:55:32 -0400115 :FOR ${network} IN @{networklist}
Brian Freemaneef7c6f2018-11-16 18:42:21 -0500116 \ ${loop_catalog_resource_id}= Set Variable ${generic_neutron_net_uuid}
117 \ Append To List ${catalog_resource_ids} ${loop_catalog_resource_id}
118 \ ${loop_catalog_resource_resp}= Get ASDC Catalog Resource ${loop_catalog_resource_id}
Yang Xufac7a632019-05-17 01:01:26 -0400119 \ ${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 -0500120 \ ${nf_role}= Convert To Lowercase ${network}
121 \ Setup SDC Catalog Resource GenericNeutronNet Properties ${catalog_service_id} ${nf_role} ${loop_catalog_resource_id}
122 \ ${xoffset}= Set Variable ${xoffset+100}
123 \ Set To Dictionary ${catalog_resources} ${loop_catalog_resource_id}=${loop_catalog_resource_resp}
DR695Hccff30b2017-02-17 18:44:24 -0500124 ${catalog_service_resp}= Get ASDC Catalog Service ${catalog_service_id}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500125 #
126 # do deployment artifacts
127 #
DR695Hfcb0ee82019-05-22 17:21:38 -0400128 ${deploymentlist}= Get Service Deployment Artifact Mapping default ${service}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500129 :FOR ${deployment} IN @{deploymentlist}
130 \ ${loop_catalog_resource_resp}= Get ASDC Catalog Resource ${loop_catalog_resource_id}
131 \ 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 -0500132 Checkin ASDC Catalog Service ${catalog_service_id}
DR695Hf4b64d42019-06-25 10:52:00 -0400133 Wait Until Keyword Succeeds 600s 15s Request Certify ASDC Catalog Service ${catalog_service_id}
DR695Hccff30b2017-02-17 18:44:24 -0500134 Start Certify ASDC Catalog Service ${catalog_service_id}
135 # on certify it gets a new id
136 ${catalog_service_id}= Certify ASDC Catalog Service ${catalog_service_id}
137 Approve ASDC Catalog Service ${catalog_service_id}
DR695H910097e2019-05-08 13:55:32 -0400138 :FOR ${DIST_INDEX} IN RANGE 1
Brian Freeman18df8912018-05-25 13:27:29 -0500139 \ Log Distribution Attempt ${DIST_INDEX}
140 \ Distribute ASDC Catalog Service ${catalog_service_id}
141 \ ${catalog_service_resp}= Get ASDC Catalog Service ${catalog_service_id}
Brian Freemanf940ee92018-05-25 21:09:05 -0500142 \ ${status} ${_} = Run Keyword And Ignore Error Loop Over Check Catalog Service Distributed ${catalog_service_resp['uuid']}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500143 \ Exit For Loop If '${status}'=='PASS'
Brian Freeman8c002d52018-07-30 19:35:36 -0500144 Should Be Equal As Strings ${status} PASS
Jerry Flood3a169a32017-12-01 12:39:10 -0500145 [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 -0500146
bdfreeman1421b2a49512018-11-25 07:32:19 -0500147Distribute vCPEResCust Model From ASDC
kaihlavi06fa4ee2019-05-22 19:08:14 +0300148 [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 -0500149 [Arguments] ${model_zip_path} ${catalog_service_name}= ${cds}= ${service}=
150 # For testing use random service name
Brian Freeman9c42ae12018-11-27 14:33:27 -0500151 #${random}= Get Current Date
DR695H18872bc2019-06-13 16:16:52 -0400152 ${uuid}= Generate UUID4
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500153 ${random}= Evaluate str("${uuid}")[:4]
154 ${catalog_service_id}= Add ASDC Catalog Service ${catalog_service_name}_${random}
155 # catalog_service_name already
156 #${catalog_service_id}= Add ASDC Catalog Service ${catalog_service_name}
bdfreeman1421b2a49512018-11-25 07:32:19 -0500157 Log To Console ${\n}ServiceName: ${catalog_service_name}_${random}
158 #${catalog_service_id}= Add ASDC Catalog Service ${catalog_service_name}
159 ${catalog_resource_ids}= Create List
160 ${catalog_resources}= Create Dictionary
DR695H910097e2019-05-08 13:55:32 -0400161 :FOR ${zip} IN @{model_zip_path}
bdfreeman1421b2a49512018-11-25 07:32:19 -0500162 \ ${loop_catalog_resource_id}= Setup ASDC Catalog Resource ${zip} ${cds}
163 \ Append To List ${catalog_resource_ids} ${loop_catalog_resource_id}
164 \ ${loop_catalog_resource_resp}= Get ASDC Catalog Resource ${loop_catalog_resource_id}
165 \ Add ASDC Resource Instance ${catalog_service_id} ${loop_catalog_resource_id} ${loop_catalog_resource_resp['name']}
166 \ Set To Dictionary ${catalog_resources} ${loop_catalog_resource_id}=${loop_catalog_resource_resp}
167 #
168 # do this here because the loop_catalog_resource_resp is different format after adding networks
169 ${vf_module}= Find Element In Array ${loop_catalog_resource_resp['groups']} type org.openecomp.groups.VfModule
170 #
171 # do allottedresource
172 ${allottedresource_list}= Create List TunnelXConn BRG
173 # Example data
174 #${tunnelxconn_dict}= Create Dictionary invariantUUID=8ac029e7-77aa-40d4-b28a-d17c02d5fd82 UUID=2ddc1b37-d7da-4aab-b645-ed7db34a5d03 node_type=org.openecomp.service.Demovcpevgmux
175 #${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 -0500176 # Create /tmp/vcpe_allotted_resource_data.json with demo vgmux and brgemu CSARs
177 Create Allotted Resource Data File
Brian Freemana8ceb692019-03-03 09:37:54 -0500178 ${vcpe_ar_data_file} OperatingSystem.Get File /tmp/vcpe_allotted_resource_data.json
DR695H0ca56d12019-05-14 11:48:20 -0400179 ${tunnelxconn_invariant_uuid}= Catenate ${vcpe_ar_data_file.json()['tunnelxconn']['invariantUUID']}
180 ${tunnelxconn_uuid}= Catenate ${vcpe_ar_data_file.json()['tunnelxconn']['UUID']}
181 ${tunnelxconn_node_type}= Catenate ${vcpe_ar_data_file.json()['tunnelxconn']['node_type']}
182 ${brg_invariant_uuid}= Catenate ${vcpe_ar_data_file.json()['brg']['invariantUUID']}
183 ${brg_uuid}= Catenate ${vcpe_ar_data_file.json()['brg']['UUID']}
184 ${brg_node_type}= Catenate ${vcpe_ar_data_file.json()['brg']['node_type']}
bdfreeman1421b2a49512018-11-25 07:32:19 -0500185 ${tunnelxconn_dict}= Create Dictionary invariantUUID=${tunnelxconn_invariant_uuid} UUID=${tunnelxconn_uuid} node_type=${tunnelxconn_node_type}
186 ${brg_dict}= Create Dictionary invariantUUID=${brg_invariant_uuid} UUID=${brg_uuid} node_type=${brg_node_type}
187 ${xoffset}= Set Variable ${100}
188 ${allottedresource_uuid}= Get AllottedResource UUID
189 ${random}= Get Current Date
DR695H910097e2019-05-08 13:55:32 -0400190 :FOR ${allottedresource} IN @{allottedresource_list}
bdfreeman1421b2a49512018-11-25 07:32:19 -0500191 \ ${loop_catalog_resource_id}= Set Variable ${allottedresource_uuid}
192 \ Append To List ${catalog_resource_ids} ${loop_catalog_resource_id}
193 \ ${loop_catalog_resource_id}= Add ASDC Allotted Resource Catalog Resource 00000 ${allottedresource}_${random} ONAP ${loop_catalog_resource_id} ${allottedresource}
194 \ ${loop_catalog_resource_id2}= Add ASDC Resource Instance To Resource ${loop_catalog_resource_id} ${allottedresource_uuid} ${allottedresource} ${xoffset} ${0}
195 \ ${loop_catalog_resource_resp}= Get ASDC Catalog Resource ${loop_catalog_resource_id}
196 #
197 # Set the properties to relate to the brg and gmux
198 #
199 \ 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']}
200 \ 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']}
201 #
202 # Set the nf_role nf_type
203 #
204 \ Run Keyword If '${allottedresource}'=='TunnelXConn' Setup SDC Catalog Resource AllottedResource Inputs ${catalog_service_id} ${allottedresource} ${loop_catalog_resource_id}
205 \ 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 -0500206 \ ${loop_catalog_resource_id}= Certify ASDC Catalog Resource ${loop_catalog_resource_id} ${ASDC_DESIGNER_USER_ID}
207 \ Add ASDC Resource Instance ${catalog_service_id} ${loop_catalog_resource_id} ${loop_catalog_resource_resp['name']}
bdfreeman1421b2a49512018-11-25 07:32:19 -0500208 \ Set To Dictionary ${catalog_resources} ${loop_catalog_resource_id}=${loop_catalog_resource_resp}
209 ${catalog_service_resp}= Get ASDC Catalog Service ${catalog_service_id}
210 Checkin ASDC Catalog Service ${catalog_service_id}
211 Request Certify ASDC Catalog Service ${catalog_service_id}
212 Start Certify ASDC Catalog Service ${catalog_service_id}
213 # on certify it gets a new id
214 ${catalog_service_id}= Certify ASDC Catalog Service ${catalog_service_id}
215 Approve ASDC Catalog Service ${catalog_service_id}
DR695H910097e2019-05-08 13:55:32 -0400216 :FOR ${DIST_INDEX} IN RANGE 1
bdfreeman1421b2a49512018-11-25 07:32:19 -0500217 \ Log Distribution Attempt ${DIST_INDEX}
218 \ Distribute ASDC Catalog Service ${catalog_service_id}
219 \ ${catalog_service_resp}= Get ASDC Catalog Service ${catalog_service_id}
220 \ ${status} ${_} = Run Keyword And Ignore Error Loop Over Check Catalog Service Distributed ${catalog_service_resp['uuid']}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500221 \ Exit For Loop If '${status}'=='PASS'
bdfreeman1421b2a49512018-11-25 07:32:19 -0500222 Should Be Equal As Strings ${status} PASS
223 [Return] ${catalog_service_resp['name']} ${loop_catalog_resource_resp['name']} ${vf_module} ${catalog_resource_ids} ${catalog_service_id} ${catalog_resources}
224
225
Yang Xu7037e542018-12-28 01:19:26 -0500226Create Allotted Resource Data File
kaihlavi06fa4ee2019-05-22 19:08:14 +0300227 [Documentation] Create Allotted Resource json data file
Yang Xu7037e542018-12-28 01:19:26 -0500228 ${allotted_resource}= Create Dictionary
229 ${allotted_csar_map}= Create Dictionary
230 Set To Dictionary ${allotted_csar_map} tunnelxconn=service-Demovcpevgmux-csar.csar
231 Set To Dictionary ${allotted_csar_map} brg=service-Demovcpevbrgemu-csar.csar
232 ${keys}= Get Dictionary Keys ${allotted_csar_map}
DR695H910097e2019-05-08 13:55:32 -0400233 :FOR ${key} IN @{keys}
Yang Xu7037e542018-12-28 01:19:26 -0500234 \ ${csar}= Get From Dictionary ${allotted_csar_map} ${key}
235 \ ${dir} ${ext}= Split String From Right ${csar} - 1
236 \ Extract Zip File /tmp/csar/${csar} /tmp/csar/${dir}
237 \ ${template}= Catenate /tmp/csar/${dir}/Definitions/${dir}-template.yml
238 \ ${json_str}= Template Yaml To Json ${template}
239 \ ${json_obj}= To Json ${json_str}
240 \ ${attrs}= Create Dictionary
241 \ Set To Dictionary ${attrs} invariantUUID=${json_obj['metadata']['invariantUUID']}
242 \ Set To Dictionary ${attrs} UUID=${json_obj['metadata']['UUID']}
243 \ Set To Dictionary ${attrs} node_type=${json_obj['topology_template']['substitution_mappings']['node_type']}
244 \ Set To Dictionary ${allotted_resource} ${key}=${attrs}
245 ${result_str}= Evaluate json.dumps(${allotted_resource}, indent=2) json
246 Log To Console ${result_str}
247 Create File /tmp/vcpe_allotted_resource_data.json ${result_str}
Yang Xu7037e542018-12-28 01:19:26 -0500248
bdfreeman14211ad11d92018-11-17 18:47:37 +0000249Download CSAR
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500250 [Documentation] Download CSAR
bdfreeman14211ad11d92018-11-17 18:47:37 +0000251 [Arguments] ${catalog_service_id} ${save_directory}=/tmp/csar
252 # get meta data
253 ${resp}= Run ASDC Get Request ${ASDC_CATALOG_SERVICES_PATH}/${catalog_service_id}/filteredDataByParams?include=toscaArtifacts ${ASDC_DESIGNER_USER_ID} ${ASDC_BE_ENDPOINT}
254 ${csar_resource_id}= Set Variable ${resp.json()['toscaArtifacts']['assettoscacsar']['uniqueId']}
255 ${resp}= Run ASDC Get Request ${ASDC_CATALOG_SERVICES_PATH}/${catalog_service_id}/artifacts/${csar_resource_id}
256 ${csar_file_name}= Set Variable ${resp.json()['artifactName']}
257 ${base64Obj}= Set Variable ${resp.json()['base64Contents']}
258 ${binObj}= Evaluate base64.b64decode("${base64Obj}") modules=base64
259 Create Binary File ${save_directory}/${csar_file_name} ${binObj}
Brian Freemane14d2572019-04-29 16:20:21 -0500260 Log To Console ${\n}Downloaded:${csar_file_name}
bdfreeman14211ad11d92018-11-17 18:47:37 +0000261
Brian Freemaneef7c6f2018-11-16 18:42:21 -0500262
263Get Generic NeutronNet UUID
kaihlavi06fa4ee2019-05-22 19:08:14 +0300264 [Documentation] Look up the UUID of the Generic NeutronNetwork Resource
Brian Freemaneef7c6f2018-11-16 18:42:21 -0500265 ${resp}= Run ASDC Get Request ${ASDC_CATALOG_RESOURCES_QUERY_PATH}/Generic%20NeutronNet/resourceVersion/1.0 ${ASDC_DESIGNER_USER_ID} ${ASDC_BE_ENDPOINT}
266 [Return] ${resp.json()['allVersions']['1.0']}
267
bdfreeman1421b2a49512018-11-25 07:32:19 -0500268Get AllottedResource UUID
kaihlavi06fa4ee2019-05-22 19:08:14 +0300269 [Documentation] Look up the UUID of the Allotted Resource
bdfreeman1421b2a49512018-11-25 07:32:19 -0500270 # if this fails then the AllottedResource template got deleted from SDC by mistake
271 ${resp}= Run ASDC Get Request ${ASDC_CATALOG_RESOURCES_QUERY_PATH}/AllottedResource/resourceVersion/1.0 ${ASDC_DESIGNER_USER_ID} ${ASDC_BE_ENDPOINT}
272 [Return] ${resp.json()['allVersions']['1.0']}
273
Brian Freeman18df8912018-05-25 13:27:29 -0500274Loop Over Check Catalog Service Distributed
Gary Wu58d58532018-07-27 16:02:51 -0700275 [Arguments] ${catalog_service_id}
Brian Freemanadaa2372018-10-24 12:25:22 -0500276 # SO watchdog timeout is 300 seconds need buffer
bdfreeman1421b2a49512018-11-25 07:32:19 -0500277 ${dist_status}= Set Variable CONTINUE
DR695H910097e2019-05-08 13:55:32 -0400278 :FOR ${CHECK_INDEX} IN RANGE 20
Brian Freemanadaa2372018-10-24 12:25:22 -0500279 \ ${status} ${_} = Run Keyword And Ignore Error Check Catalog Service Distributed ${catalog_service_id} ${dist_status}
Gary Wu58d58532018-07-27 16:02:51 -0700280 \ Sleep 20s
Brian Freemanf940ee92018-05-25 21:09:05 -0500281 \ Return From Keyword If '${status}'=='PASS'
bdfreeman1421b2a49512018-11-25 07:32:19 -0500282 # need a way to exit the loop early on DISTRIBUTION_COMPLETE_ERROR ${dist_status} doesnt work
283 #\ Exit For Loop If '${dist_status}'=='EXIT'
284 Should Be Equal As Strings ${status} PASS
Brian Freeman18df8912018-05-25 13:27:29 -0500285
DR695Hccff30b2017-02-17 18:44:24 -0500286Setup ASDC Catalog Resource
kaihlavi06fa4ee2019-05-22 19:08:14 +0300287 [Documentation] Creates all the steps a VF needs for an ASDC Catalog Resource and returns the id
Yang Xu2ec80382018-11-01 12:30:37 -0400288 [Arguments] ${model_zip_path} ${cds}=
Brian Freemanb568e5e2018-04-05 21:03:38 -0500289 ${license_model_id} ${license_model_version_id}= Add ASDC License Model
Brian Freeman15033782019-03-22 15:48:55 -0500290
291
292 ${license_temp_date}= Get Current Date
293 ${license_start_date}= Get Current Date result_format=%m/%d/%Y
294 ${license_end_date}= Add Time To Date ${license_temp_date} 365 days result_format=%m/%d/%Y
295 ${key_group_id}= Add ASDC License Group ${license_model_id} ${license_model_version_id} ${license_start_date} ${license_end_date}
296 ${pool_id}= Add ASDC Entitlement Pool ${license_model_id} ${license_model_version_id} ${license_start_date} ${license_end_date}
297
Brian Freemanb568e5e2018-04-05 21:03:38 -0500298 ${feature_group_id}= Add ASDC Feature Group ${license_model_id} ${key_group_id} ${pool_id} ${license_model_version_id}
299 ${license_agreement_id}= Add ASDC License Agreement ${license_model_id} ${feature_group_id} ${license_model_version_id}
300 Submit ASDC License Model ${license_model_id} ${license_model_version_id}
301 ${license_model_resp}= Get ASDC License Model ${license_model_id} ${license_model_version_id}
Brian Freeman9c42ae12018-11-27 14:33:27 -0500302 ${matches}= Get Regexp Matches ${model_zip_path} temp/(.*)\.zip 1
303 ${software_product_name_prefix}= Set Variable ${matches[0]}
304 ${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 -0500305 Upload ASDC Heat Package ${software_product_id} ${model_zip_path} ${software_product_version_id}
306 Validate ASDC Software Product ${software_product_id} ${software_product_version_id}
307 Submit ASDC Software Product ${software_product_id} ${software_product_version_id}
308 Package ASDC Software Product ${software_product_id} ${software_product_version_id}
309 ${software_product_resp}= Get ASDC Software Product ${software_product_id} ${software_product_version_id}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500310 ${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 -0400311 # Check if need to set up CDS properties
312 Run Keyword If '${cds}' == 'vfwng' Setup ASDC Catalog Resource CDS Properties ${catalog_resource_id}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500313
Brian Freeman391680a2018-08-11 15:20:58 -0500314 ${catalog_resource_id}= Certify ASDC Catalog Resource ${catalog_resource_id} ${ASDC_DESIGNER_USER_ID}
DR695Hccff30b2017-02-17 18:44:24 -0500315 [Return] ${catalog_resource_id}
Brian Freemaneef7c6f2018-11-16 18:42:21 -0500316
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500317
318Setup SDC Catalog Resource Deployment Artifact Properties
319 [Documentation] Set up Deployment Artiface properties
320 [Arguments] ${catalog_service_id} ${catalog_parent_service_id} ${catalog_resource_unique_id} ${blueprint_file}
321 ${resp}= Get ASDC Catalog Resource Component Instances Properties ${catalog_service_id}
Brian Freemana8ceb692019-03-03 09:37:54 -0500322 ${blueprint_data} OperatingSystem.Get File ${SDC_CATALOG_DEPLOYMENT_ARTIFACT_PATH}${blueprint_file}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500323 ${payloadData}= Evaluate base64.b64encode('''${blueprint_data}'''.encode('utf-8')) modules=base64
324 ${dict}= Create Dictionary artifactLabel=blueprint artifactName=${blueprint_file} artifactType=DCAE_INVENTORY_BLUEPRINT artifactGroupType=DEPLOYMENT description=${blueprint_file} payloadData=${payloadData}
DR695H3bb6cf42019-06-20 15:04:04 -0400325 Create Environment sdc ${GLOBAL_TEMPLATE_FOLDER}
326 ${data}= Apply Template sdc ${ASDC_ARTIFACT_UPLOAD_TEMPLATE} ${dict}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500327 # POST artifactUpload to resource
328 ${artifact_upload_path}= Catenate ${ASDC_CATALOG_SERVICES_PATH}/${catalog_service_id}/resourceInstance/${catalog_resource_unique_id}${ASDC_CATALOG_SERVICE_RESOURCE_ARTIFACT_PATH}
329 ${resp}= Run ASDC MD5 Post Request ${artifact_upload_path} ${data} ${ASDC_DESIGNER_USER_ID}
330 Should Be Equal As Strings ${resp.status_code} 200
331 [Return] ${resp}
332
333
Brian Freemaneef7c6f2018-11-16 18:42:21 -0500334Setup SDC Catalog Resource GenericNeutronNet Properties
bdfreeman1421b2a49512018-11-25 07:32:19 -0500335 [Documentation] Set up GenericNeutronNet properties and inputs
Brian Freemaneef7c6f2018-11-16 18:42:21 -0500336 [Arguments] ${catalog_service_id} ${nf_role} ${catalog_parent_service_id}
Brian Freemaneef7c6f2018-11-16 18:42:21 -0500337 ${resp}= Get ASDC Catalog Resource Component Instances Properties ${catalog_service_id}
Brian Freemaneef7c6f2018-11-16 18:42:21 -0500338 ${componentInstances} Set Variable @{resp['componentInstancesProperties']}
339 # componentInstances can have 1 or more than 1 entry
340 ${passed}= Run Keyword And Return Status Evaluate type(${componentInstances})
341 ${type}= Run Keyword If ${passed} Evaluate type(${componentInstances})
342 ${componentInstancesList}= Run Keyword If "${type}"!="<type 'list'>" Create List ${componentInstances}
343 ... ELSE Set Variable ${componentInstances}
344 :FOR ${item} IN @{componentInstancesList}
345 \ ${test} ${v}= Run Keyword and Ignore Error Should Contain ${item} ${nf_role}
346 \ Run Keyword If '${test}' == 'FAIL' Continue For Loop
347 \ ${componentInstance1}= Set Variable ${item}
348 :FOR ${comp} IN @{resp['componentInstancesProperties']["${componentInstance1}"]}
349 \ ${name} Set Variable ${comp['name']}
350 \ ${test} ${v}= Run Keyword and Ignore Error Should Contain ${name} network_role
351 \ Run Keyword If '${test}' == 'FAIL' Continue For Loop
352 \ ${description} Set Variable ${comp['description']}
353 \ ${description}= Replace String ${description} ${\n} \
354 \ ${uniqueId} Set Variable ${comp['uniqueId']}
355 \ ${parentUniqueId} Set Variable ${comp['parentUniqueId']}
356 \ ${ownerId} Set Variable ${comp['ownerId']}
357 \ ${dict}= Create Dictionary parentUniqueId=${parentUniqueId} ownerId=${ownerId} uniqueId=${uniqueId} description=${description}
358 \ Run Keyword If '${name}'=='network_role' Set To Dictionary ${dict} name=${name} value=${nf_role}
DR695H3bb6cf42019-06-20 15:04:04 -0400359 \ Create Environment sdc ${GLOBAL_TEMPLATE_FOLDER}
360 \ ${data}= Apply Template sdc ${SDC_CATALOG_NET_RESOURCE_INPUT_TEMPLATE} ${dict}
Brian Freemaneef7c6f2018-11-16 18:42:21 -0500361 \ ${response}= Set ASDC Catalog Resource Component Instance Properties ${catalog_parent_service_id} ${catalog_service_id} ${data}
Brian Freemaneef7c6f2018-11-16 18:42:21 -0500362
bdfreeman1421b2a49512018-11-25 07:32:19 -0500363
364Setup SDC Catalog Resource AllottedResource Properties
365 [Documentation] Set up Allotted Resource properties and inputs
366 [Arguments] ${catalog_service_id} ${nf_role} ${catalog_resource_id} ${invariantUUID} ${UUID} ${node_type}
367 # Set component instances properties
368 ${nf_role_lc}= Convert To Lowercase ${nf_role}
369 ${resp}= Get ASDC Catalog Resource Component Instances Properties For Resource ${catalog_resource_id}
370 ${componentInstances} Set Variable @{resp['componentInstancesProperties']}
371 # componentInstances can have 1 or more than 1 entry
372 ${passed}= Run Keyword And Return Status Evaluate type(${componentInstances})
373 ${type}= Run Keyword If ${passed} Evaluate type(${componentInstances})
374 ${componentInstancesList}= Run Keyword If "${type}"!="<type 'list'>" Create List ${componentInstances}
375 ... ELSE Set Variable ${componentInstances}
376 :FOR ${item} IN @{componentInstancesList}
377 \ ${test} ${v}= Run Keyword and Ignore Error Should Contain ${item} ${nf_role_lc}
378 \ Run Keyword If '${test}' == 'FAIL' Continue For Loop
379 \ ${componentInstance1}= Set Variable ${item}
380 ${dict}= Create Dictionary
381 :FOR ${comp} IN @{resp['componentInstancesProperties']["${componentInstance1}"]}
382 \ ${name} Set Variable ${comp['name']}
383 \ ${test} ${v}= Run Keyword and Ignore Error Should Contain Any ${name} network_role providing_service_invariant_uuid providing_service_uuid providing_service_name uniqueId
384 \ Run Keyword If '${test}' == 'FAIL' Continue For Loop
385 \ ${parentUniqueId} Set Variable ${comp['parentUniqueId']}
386 \ ${ownerId} Set Variable ${comp['ownerId']}
387 \ Set To Dictionary ${dict} parentUniqueId=${parentUniqueId} ownerId=${ownerId}
388 \ Run Keyword If '${name}'=='providing_service_invariant_uuid' Set To Dictionary ${dict} providing_service_invariant_uuid=${invariantUUID}
389 \ Run Keyword If '${name}'=='providing_service_uuid' Set To Dictionary ${dict} providing_service_uuid=${UUID}
390 \ Run Keyword If '${name}'=='providing_service_name' Set To Dictionary ${dict} providing_service_name=${node_type}
391 # Sets it for each loop but should be one
392 \ ${uniqueId} Set Variable ${comp['uniqueId']}
393 \ ${uniqueId} Fetch From Left ${uniqueId} .
394 \ Set To Dictionary ${dict} uniqueId=${uniqueId}
DR695H3bb6cf42019-06-20 15:04:04 -0400395 Create Environment sdc ${GLOBAL_TEMPLATE_FOLDER}
396 ${data}= Apply Template sdc ${SDC_CATALOG_ALLOTTED_RESOURCE_PROPERTIES_TEMPLATE} ${dict}
bdfreeman1421b2a49512018-11-25 07:32:19 -0500397 ${response}= Set ASDC Catalog Resource Component Instance Properties For Resource ${catalog_resource_id} ${componentInstance1} ${data}
398 Log To Console resp=${response}
399
400
401Setup SDC Catalog Resource AllottedResource Inputs
402 [Documentation] Set up Allotted Resource inputs
403 [Arguments] ${catalog_service_id} ${nf_role} ${catalog_resource_id}
404 # Set vnf inputs
405 ${resp}= Get ASDC Catalog Resource Inputs ${catalog_resource_id}
406 ${dict}= Create Dictionary
DR695H910097e2019-05-08 13:55:32 -0400407 :FOR ${comp} IN @{resp['inputs']}
bdfreeman1421b2a49512018-11-25 07:32:19 -0500408 \ ${name} Set Variable ${comp['name']}
409 \ ${uid} Set Variable ${comp['uniqueId']}
410 \ Run Keyword If '${name}'=='nf_type' Set To Dictionary ${dict} nf_type=${nf_role} nf_type_uid=${uid}
411 \ Run Keyword If '${name}'=='nf_role' Set To Dictionary ${dict} nf_role=${nf_role} nf_role_uid=${uid}
DR695H3bb6cf42019-06-20 15:04:04 -0400412 Create Environment sdc ${GLOBAL_TEMPLATE_FOLDER}
413 ${data}= Apply Template sdc ${SDC_CATALOG_ALLOTTED_RESOURCE_INPUTS_TEMPLATE} ${dict}
bdfreeman1421b2a49512018-11-25 07:32:19 -0500414 ${response}= Set ASDC Catalog Resource VNF Inputs ${catalog_resource_id} ${data}
415 [Return] ${response}
416
Yang Xu2ec80382018-11-01 12:30:37 -0400417Setup ASDC Catalog Resource CDS Properties
418 [Documentation] Set up vfwng VNF properties and inputs for CDS
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500419 [Arguments] ${catalog_resource_id}
Yang Xu2ec80382018-11-01 12:30:37 -0400420 # Set vnf module properties
421 ${resp}= Get ASDC Catalog Resource Component Instances ${catalog_resource_id}
DR695H910097e2019-05-08 13:55:32 -0400422 :FOR ${comp} IN @{resp['componentInstances']}
Yang Xu2ec80382018-11-01 12:30:37 -0400423 \ ${name} Set Variable ${comp['name']}
424 \ ${uniqueId} Set Variable ${comp['uniqueId']}
425 \ ${actualComponentUid} Set Variable ${comp['actualComponentUid']}
426 \ ${test} ${v}= Run Keyword and Ignore Error Should Contain ${name} abstract_
427 \ Run Keyword If '${test}' == 'FAIL' Continue For Loop
428 \ ${response}= Get ASDC Catalog Resource Component Instance Properties ${catalog_resource_id} ${uniqueId} ${actualComponentUid}
429 \ ${dict}= Create Dictionary parent_id=${response[6]['parentUniqueId']}
430 \ Run Keyword If '${name}'=='abstract_vfw' Set To Dictionary ${dict} nfc_function=vfw nfc_naming_policy=SDNC_Policy.ONAP_VFW_NAMING_TIMESTAMP
431 \ Run Keyword If '${name}'=='abstract_vpg' Set To Dictionary ${dict} nfc_function=vpg nfc_naming_policy=SDNC_Policy.ONAP_VPG_NAMING_TIMESTAMP
432 \ 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 -0400433 \ Create Environment sdc ${GLOBAL_TEMPLATE_FOLDER}
434 \ ${data}= Apply Template sdc ${ASDC_RESOURCE_INSTANCE_VNF_PROPERTIES_TEMPLATE} ${dict}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500435 \ ${response}= Set ASDC Catalog Resource Component Instance Properties ${catalog_resource_id} ${uniqueId} ${data}
Yang Xu2ec80382018-11-01 12:30:37 -0400436 \ Log To Console resp=${response}
437
438 # Set vnf inputs
439 ${resp}= Get ASDC Catalog Resource Inputs ${catalog_resource_id}
440 ${dict}= Create Dictionary
DR695H910097e2019-05-08 13:55:32 -0400441 :FOR ${comp} IN @{resp['inputs']}
Yang Xu2ec80382018-11-01 12:30:37 -0400442 \ ${name} Set Variable ${comp['name']}
443 \ ${uid} Set Variable ${comp['uniqueId']}
444 \ Run Keyword If '${name}'=='nf_function' Set To Dictionary ${dict} nf_function=ONAP-FIREWALL nf_function_uid=${uid}
445 \ Run Keyword If '${name}'=='nf_type' Set To Dictionary ${dict} nf_type=FIREWALL nf_type_uid=${uid}
446 \ Run Keyword If '${name}'=='nf_naming_code' Set To Dictionary ${dict} nf_naming_code=vfw nf_naming_code_uid=${uid}
447 \ Run Keyword If '${name}'=='nf_role' Set To Dictionary ${dict} nf_role=vFW nf_role_uid=${uid}
448 \ Run Keyword If '${name}'=='cloud_env' Set To Dictionary ${dict} cloud_env=openstack cloud_env_uid=${uid}
DR695H3bb6cf42019-06-20 15:04:04 -0400449 Create Environment sdc ${GLOBAL_TEMPLATE_FOLDER}
450 ${data}= Apply Template sdc ${ASDC_RESOURCE_INSTANCE_VNF_INPUTS_TEMPLATE} ${dict}
Yang Xu2ec80382018-11-01 12:30:37 -0400451 ${response}= Set ASDC Catalog Resource VNF Inputs ${catalog_resource_id} ${data}
452
DR695Hccff30b2017-02-17 18:44:24 -0500453Add ASDC License Model
kaihlavi06fa4ee2019-05-22 19:08:14 +0300454 [Documentation] Creates an ASDC License Model and returns its id
DR695H18872bc2019-06-13 16:16:52 -0400455 ${uuid}= Generate UUID4
Jerry Floode2a48d72017-06-21 15:06:29 -0400456 ${shortened_uuid}= Evaluate str("${uuid}")[:23]
DR695Hccff30b2017-02-17 18:44:24 -0500457 ${map}= Create Dictionary vendor_name=${shortened_uuid}
DR695H3bb6cf42019-06-20 15:04:04 -0400458 Create Environment sdc ${GLOBAL_TEMPLATE_FOLDER}
459 ${data}= Apply Template sdc ${ASDC_LICENSE_MODEL_TEMPLATE} ${map}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500460 ${resp}= Run ASDC Post Request ${ASDC_VENDOR_LICENSE_MODEL_PATH} ${data} ${ASDC_DESIGNER_USER_ID} ${ASDC_BE_ONBOARD_ENDPOINT}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500461 Should Be Equal As Strings ${resp.status_code} 200
Brian Freemanb568e5e2018-04-05 21:03:38 -0500462 [Return] ${resp.json()['itemId']} ${resp.json()['version']['id']}
DR695Hccff30b2017-02-17 18:44:24 -0500463Get ASDC License Model
464 [Documentation] gets an asdc license model by its id
Jerry Floode2a48d72017-06-21 15:06:29 -0400465 [Arguments] ${id} ${version_id}=0.1
Brian Freeman44b8bb32018-05-03 21:08:42 -0500466 ${resp}= Run ASDC Get Request ${ASDC_VENDOR_LICENSE_MODEL_PATH}/${id}/versions/${version_id} ${ASDC_DESIGNER_USER_ID} ${ASDC_BE_ONBOARD_ENDPOINT}
Jerry Floode2a48d72017-06-21 15:06:29 -0400467 [Return] ${resp.json()}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500468
kaihlavi06fa4ee2019-05-22 19:08:14 +0300469Get ASDC License Models
470 [Documentation] Gets all ASDC License Models
471 ${resp}= Run ASDC Get Request ${ASDC_VENDOR_LICENSE_MODEL_PATH} ${ASDC_DESIGNER_USER_ID} ${ASDC_BE_ONBOARD_ENDPOINT}
DR695Hccff30b2017-02-17 18:44:24 -0500472 [Return] ${resp.json()}
kaihlavi06fa4ee2019-05-22 19:08:14 +0300473
DR695Hccff30b2017-02-17 18:44:24 -0500474Checkin ASDC License Model
kaihlavi06fa4ee2019-05-22 19:08:14 +0300475 [Documentation] Checks in an ASDC License Model by its id
Jerry Floode2a48d72017-06-21 15:06:29 -0400476 [Arguments] ${id} ${version_id}=0.1
DR695Hccff30b2017-02-17 18:44:24 -0500477 ${map}= Create Dictionary action=Checkin
DR695H3bb6cf42019-06-20 15:04:04 -0400478 Create Environment sdc ${GLOBAL_TEMPLATE_FOLDER}
479 ${data}= Apply Template sdc ${ASDC_ACTION_TEMPLATE} ${map}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500480 ${resp}= Run ASDC Put Request ${ASDC_VENDOR_LICENSE_MODEL_PATH}/${id}/versions/${version_id}${ASDC_VENDOR_ACTIONS_PATH} ${data} ${ASDC_DESIGNER_USER_ID} ${ASDC_BE_ONBOARD_ENDPOINT}
481 Should Be Equal As Strings ${resp.status_code} 200
DR695Hccff30b2017-02-17 18:44:24 -0500482 [Return] ${resp.json()}
kaihlavi06fa4ee2019-05-22 19:08:14 +0300483
DR695Hccff30b2017-02-17 18:44:24 -0500484Submit ASDC License Model
kaihlavi06fa4ee2019-05-22 19:08:14 +0300485 [Documentation] Submits an ASDC License Model by its id
Jerry Floode2a48d72017-06-21 15:06:29 -0400486 [Arguments] ${id} ${version_id}=0.1
DR695Hccff30b2017-02-17 18:44:24 -0500487 ${map}= Create Dictionary action=Submit
DR695H3bb6cf42019-06-20 15:04:04 -0400488 Create Environment sdc ${GLOBAL_TEMPLATE_FOLDER}
489 ${data}= Apply Template sdc ${ASDC_ACTION_TEMPLATE} ${map}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500490 ${resp}= Run ASDC Put Request ${ASDC_VENDOR_LICENSE_MODEL_PATH}/${id}/versions/${version_id}${ASDC_VENDOR_ACTIONS_PATH} ${data} ${ASDC_DESIGNER_USER_ID} ${ASDC_BE_ONBOARD_ENDPOINT}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -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 -0500494Checkin ASDC Software Product
kaihlavi06fa4ee2019-05-22 19:08:14 +0300495 [Documentation] Checks in an ASDC Software Product 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=Checkin
DR695H3bb6cf42019-06-20 15:04:04 -0400498 Create Environment sdc ${GLOBAL_TEMPLATE_FOLDER}
499 ${data}= Apply Template sdc ${ASDC_ACTION_TEMPLATE} ${map}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500500 ${resp}= Run ASDC Put Request ${ASDC_VENDOR_SOFTWARE_PRODUCT_PATH}/${id}/versions/${version_id}${ASDC_VENDOR_ACTIONS_PATH} ${data} ${ASDC_DESIGNER_USER_ID} ${ASDC_BE_ONBOARD_ENDPOINT}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500501 Should Be Equal As Strings ${resp.status_code} 200
Jerry Floode2a48d72017-06-21 15:06:29 -0400502 [Return] ${resp.json()}
kaihlavi06fa4ee2019-05-22 19:08:14 +0300503
Jerry Floode2a48d72017-06-21 15:06:29 -0400504Validate ASDC Software Product
kaihlavi06fa4ee2019-05-22 19:08:14 +0300505 [Documentation] Validates an ASDC Software Product by its id
Jerry Floode2a48d72017-06-21 15:06:29 -0400506 [Arguments] ${id} ${version_id}=0.1
507 ${data}= Catenate
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500508 ${resp}= Run ASDC Put Request ${ASDC_VENDOR_SOFTWARE_PRODUCT_PATH}/${id}/versions/${version_id}/orchestration-template-candidate/process ${data} ${ASDC_DESIGNER_USER_ID} ${ASDC_BE_ONBOARD_ENDPOINT}
509 Should Be Equal As Strings ${resp.status_code} 200
DR695Hccff30b2017-02-17 18:44:24 -0500510 [Return] ${resp.json()}
kaihlavi06fa4ee2019-05-22 19:08:14 +0300511
DR695Hccff30b2017-02-17 18:44:24 -0500512Submit ASDC Software Product
kaihlavi06fa4ee2019-05-22 19:08:14 +0300513 [Documentation] Submits an ASDC Software Product by its id
Jerry Floode2a48d72017-06-21 15:06:29 -0400514 [Arguments] ${id} ${version_id}=0.1
DR695Hccff30b2017-02-17 18:44:24 -0500515 ${map}= Create Dictionary action=Submit
DR695H3bb6cf42019-06-20 15:04:04 -0400516 Create Environment sdc ${GLOBAL_TEMPLATE_FOLDER}
517 ${data}= Apply Template sdc ${ASDC_ACTION_TEMPLATE} ${map}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500518 ${resp}= Run ASDC Put Request ${ASDC_VENDOR_SOFTWARE_PRODUCT_PATH}/${id}/versions/${version_id}${ASDC_VENDOR_ACTIONS_PATH} ${data} ${ASDC_DESIGNER_USER_ID} ${ASDC_BE_ONBOARD_ENDPOINT}
519 Should Be Equal As Strings ${resp.status_code} 200
DR695Hccff30b2017-02-17 18:44:24 -0500520 [Return] ${resp.json()}
kaihlavi06fa4ee2019-05-22 19:08:14 +0300521
DR695Hccff30b2017-02-17 18:44:24 -0500522Package ASDC Software Product
kaihlavi06fa4ee2019-05-22 19:08:14 +0300523 [Documentation] Creates a package of an ASDC Software Product by its id
Jerry Floode2a48d72017-06-21 15:06:29 -0400524 [Arguments] ${id} ${version_id}=0.1
DR695Hccff30b2017-02-17 18:44:24 -0500525 ${map}= Create Dictionary action=Create_Package
DR695H3bb6cf42019-06-20 15:04:04 -0400526 Create Environment sdc ${GLOBAL_TEMPLATE_FOLDER}
527 ${data}= Apply Template sdc ${ASDC_ACTION_TEMPLATE} ${map}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500528 ${resp}= Run ASDC Put Request ${ASDC_VENDOR_SOFTWARE_PRODUCT_PATH}/${id}/versions/${version_id}${ASDC_VENDOR_ACTIONS_PATH} ${data} ${ASDC_DESIGNER_USER_ID} ${ASDC_BE_ONBOARD_ENDPOINT}
529 Should Be Equal As Strings ${resp.status_code} 200
Jerry Floode2a48d72017-06-21 15:06:29 -0400530 [Return] ${resp.json()}
kaihlavi06fa4ee2019-05-22 19:08:14 +0300531
DR695Hccff30b2017-02-17 18:44:24 -0500532Add ASDC Entitlement Pool
kaihlavi06fa4ee2019-05-22 19:08:14 +0300533 [Documentation] Creates an ASDC Entitlement Pool and returns its id
Brian Freeman15033782019-03-22 15:48:55 -0500534 [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 -0400535 ${uuid}= Generate UUID4
Jerry Floode2a48d72017-06-21 15:06:29 -0400536 ${shortened_uuid}= Evaluate str("${uuid}")[:23]
Brian Freeman15033782019-03-22 15:48:55 -0500537 ${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 -0400538 Create Environment sdc ${GLOBAL_TEMPLATE_FOLDER}
539 ${data}= Apply Template sdc ${ASDC_ENTITLEMENT_POOL_TEMPLATE} ${map}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500540 ${resp}= Run ASDC Post Request ${ASDC_VENDOR_LICENSE_MODEL_PATH}/${license_model_id}/versions/${version_id}${ASDC_VENDOR_ENTITLEMENT_POOL_PATH} ${data} ${ASDC_DESIGNER_USER_ID} ${ASDC_BE_ONBOARD_ENDPOINT}
541 Should Be Equal As Strings ${resp.status_code} 200
DR695Hccff30b2017-02-17 18:44:24 -0500542 [Return] ${resp.json()['value']}
kaihlavi06fa4ee2019-05-22 19:08:14 +0300543
DR695Hccff30b2017-02-17 18:44:24 -0500544Get ASDC Entitlement Pool
kaihlavi06fa4ee2019-05-22 19:08:14 +0300545 [Documentation] Gets an ASDC Entitlement Pool by its id
DR695Hccff30b2017-02-17 18:44:24 -0500546 [Arguments] ${license_model_id} ${pool_id}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500547 ${resp}= Run ASDC Get Request ${ASDC_VENDOR_LICENSE_MODEL_PATH}/${license_model_id}${ASDC_VENDOR_ENTITLEMENT_POOL_PATH}/${pool_id} ${ASDC_DESIGNER_USER_ID} ${ASDC_BE_ONBOARD_ENDPOINT}
DR695Hccff30b2017-02-17 18:44:24 -0500548 [Return] ${resp.json()}
kaihlavi06fa4ee2019-05-22 19:08:14 +0300549
DR695Hccff30b2017-02-17 18:44:24 -0500550Add ASDC License Group
kaihlavi06fa4ee2019-05-22 19:08:14 +0300551 [Documentation] Creates an ASDC License Group and returns its id
Brian Freeman15033782019-03-22 15:48:55 -0500552 [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 -0400553 ${uuid}= Generate UUID4
Jerry Floode2a48d72017-06-21 15:06:29 -0400554 ${shortened_uuid}= Evaluate str("${uuid}")[:23]
Brian Freeman15033782019-03-22 15:48:55 -0500555 ${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 -0400556 Create Environment sdc ${GLOBAL_TEMPLATE_FOLDER}
557 ${data}= Apply Template sdc ${ASDC_KEY_GROUP_TEMPLATE} ${map}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500558 ${resp}= Run ASDC Post Request ${ASDC_VENDOR_LICENSE_MODEL_PATH}/${license_model_id}/versions/${version_id}${ASDC_VENDOR_KEY_GROUP_PATH} ${data} ${ASDC_DESIGNER_USER_ID} ${ASDC_BE_ONBOARD_ENDPOINT}
559 Should Be Equal As Strings ${resp.status_code} 200
DR695Hccff30b2017-02-17 18:44:24 -0500560 [Return] ${resp.json()['value']}
kaihlavi06fa4ee2019-05-22 19:08:14 +0300561
DR695Hccff30b2017-02-17 18:44:24 -0500562Get ASDC License Group
kaihlavi06fa4ee2019-05-22 19:08:14 +0300563 [Documentation] Gets an ASDC License Group by its id
Jerry Floode2a48d72017-06-21 15:06:29 -0400564 [Arguments] ${license_model_id} ${group_id} ${version_id}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500565 ${resp}= Run ASDC Get Request ${ASDC_VENDOR_LICENSE_MODEL_PATH}/${license_model_id}/versions/${version_id}${ASDC_VENDOR_KEY_GROUP_PATH}/${group_id} ${ASDC_DESIGNER_USER_ID} ${ASDC_BE_ONBOARD_ENDPOINT}
DR695Hccff30b2017-02-17 18:44:24 -0500566 [Return] ${resp.json()}
kaihlavi06fa4ee2019-05-22 19:08:14 +0300567
DR695Hccff30b2017-02-17 18:44:24 -0500568Add ASDC Feature Group
kaihlavi06fa4ee2019-05-22 19:08:14 +0300569 [Documentation] Creates an ASDC Feature Group and returns its id
Jerry Floode2a48d72017-06-21 15:06:29 -0400570 [Arguments] ${license_model_id} ${key_group_id} ${entitlement_pool_id} ${version_id}=0.1
DR695H18872bc2019-06-13 16:16:52 -0400571 ${uuid}= Generate UUID4
Jerry Floode2a48d72017-06-21 15:06:29 -0400572 ${shortened_uuid}= Evaluate str("${uuid}")[:23]
Jerry Flood80ff9852017-08-11 06:47:14 -0400573 ${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 -0400574 Create Environment sdc ${GLOBAL_TEMPLATE_FOLDER}
575 ${data}= Apply Template sdc ${ASDC_FEATURE_GROUP_TEMPLATE} ${map}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500576 ${resp}= Run ASDC Post Request ${ASDC_VENDOR_LICENSE_MODEL_PATH}/${license_model_id}/versions/${version_id}${ASDC_VENDOR_FEATURE_GROUP_PATH} ${data} ${ASDC_DESIGNER_USER_ID} ${ASDC_BE_ONBOARD_ENDPOINT}
577 Should Be Equal As Strings ${resp.status_code} 200
DR695Hccff30b2017-02-17 18:44:24 -0500578 [Return] ${resp.json()['value']}
kaihlavi06fa4ee2019-05-22 19:08:14 +0300579
DR695Hccff30b2017-02-17 18:44:24 -0500580Get ASDC Feature Group
kaihlavi06fa4ee2019-05-22 19:08:14 +0300581 [Documentation] Gets an ASDC Feature Group by its id
DR695Hccff30b2017-02-17 18:44:24 -0500582 [Arguments] ${license_model_id} ${group_id}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500583 ${resp}= Run ASDC Get Request ${ASDC_VENDOR_LICENSE_MODEL_PATH}/${license_model_id}${ASDC_VENDOR_FEATURE_GROUP_PATH}/${group_id} ${ASDC_DESIGNER_USER_ID} ${ASDC_BE_ONBOARD_ENDPOINT}
DR695Hccff30b2017-02-17 18:44:24 -0500584 [Return] ${resp.json()}
kaihlavi06fa4ee2019-05-22 19:08:14 +0300585
DR695Hccff30b2017-02-17 18:44:24 -0500586Add ASDC License Agreement
kaihlavi06fa4ee2019-05-22 19:08:14 +0300587 [Documentation] Creates an ASDC License Agreement and returns its id
Jerry Floode2a48d72017-06-21 15:06:29 -0400588 [Arguments] ${license_model_id} ${feature_group_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]
DR695Hccff30b2017-02-17 18:44:24 -0500591 ${map}= Create Dictionary license_agreement_name=${shortened_uuid} feature_group_id=${feature_group_id}
DR695H3bb6cf42019-06-20 15:04:04 -0400592 Create Environment sdc ${GLOBAL_TEMPLATE_FOLDER}
593 ${data}= Apply Template sdc ${ASDC_LICENSE_AGREEMENT_TEMPLATE} ${map}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500594 ${resp}= Run ASDC Post Request ${ASDC_VENDOR_LICENSE_MODEL_PATH}/${license_model_id}/versions/${version_id}${ASDC_VENDOR_LICENSE_AGREEMENT_PATH} ${data} ${ASDC_DESIGNER_USER_ID} ${ASDC_BE_ONBOARD_ENDPOINT}
595 Should Be Equal As Strings ${resp.status_code} 200
DR695Hccff30b2017-02-17 18:44:24 -0500596 [Return] ${resp.json()['value']}
kaihlavi06fa4ee2019-05-22 19:08:14 +0300597
DR695Hccff30b2017-02-17 18:44:24 -0500598Get ASDC License Agreement
kaihlavi06fa4ee2019-05-22 19:08:14 +0300599 [Documentation] Gets an ASDC License Agreement by its id
DR695Hccff30b2017-02-17 18:44:24 -0500600 [Arguments] ${license_model_id} ${agreement_id}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500601 ${resp}= Run ASDC Get Request ${ASDC_VENDOR_LICENSE_MODEL_PATH}/${license_model_id}${ASDC_VENDOR_LICENSE_AGREEMENT_PATH}/${agreement_id} ${ASDC_DESIGNER_USER_ID} ${ASDC_BE_ONBOARD_ENDPOINT}
DR695Hccff30b2017-02-17 18:44:24 -0500602 [Return] ${resp.json()}
kaihlavi06fa4ee2019-05-22 19:08:14 +0300603
DR695Hccff30b2017-02-17 18:44:24 -0500604Add ASDC Software Product
kaihlavi06fa4ee2019-05-22 19:08:14 +0300605 [Documentation] Creates an ASDC Software Product and returns its id
Brian Freeman9c42ae12018-11-27 14:33:27 -0500606 [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 -0400607 ${uuid}= Generate UUID4
Brian Freeman9c42ae12018-11-27 14:33:27 -0500608 ${shortened_uuid}= Evaluate str("${uuid}")[:13]
609 ${software_product_name}= Catenate ${name_prefix} ${shortened_uuid}
610 ${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 -0400611 Create Environment sdc ${GLOBAL_TEMPLATE_FOLDER}
612 ${data}= Apply Template sdc ${ASDC_SOFTWARE_PRODUCT_TEMPLATE} ${map}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500613 ${resp}= Run ASDC Post Request ${ASDC_VENDOR_SOFTWARE_PRODUCT_PATH} ${data} ${ASDC_DESIGNER_USER_ID} ${ASDC_BE_ONBOARD_ENDPOINT}
614 Should Be Equal As Strings ${resp.status_code} 200
Brian Freemanb568e5e2018-04-05 21:03:38 -0500615 [Return] ${resp.json()['itemId']} ${resp.json()['version']['id']}
kaihlavi06fa4ee2019-05-22 19:08:14 +0300616
DR695Hccff30b2017-02-17 18:44:24 -0500617Get ASDC Software Product
kaihlavi06fa4ee2019-05-22 19:08:14 +0300618 [Documentation] Gets an ASDC Software Product by its id
Jerry Floode2a48d72017-06-21 15:06:29 -0400619 [Arguments] ${software_product_id} ${version_id}=0.1
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500620 ${resp}= Run ASDC Get Request ${ASDC_VENDOR_SOFTWARE_PRODUCT_PATH}/${software_product_id}/versions/${version_id} ${ASDC_DESIGNER_USER_ID} ${ASDC_BE_ONBOARD_ENDPOINT}
DR695Hccff30b2017-02-17 18:44:24 -0500621 [Return] ${resp.json()}
bdfreeman1421b2a49512018-11-25 07:32:19 -0500622
DR695Hccff30b2017-02-17 18:44:24 -0500623Add ASDC Catalog Resource
kaihlavi06fa4ee2019-05-22 19:08:14 +0300624 [Documentation] Creates an ASDC Catalog Resource and returns its id
DR695Hccff30b2017-02-17 18:44:24 -0500625 [Arguments] ${license_agreement_id} ${software_product_name} ${license_model_name} ${software_product_id}
626 ${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 -0400627 Create Environment sdc ${GLOBAL_TEMPLATE_FOLDER}
628 ${data}= Apply Template sdc ${ASDC_CATALOG_RESOURCE_TEMPLATE} ${map}
bdfreeman1421b2a49512018-11-25 07:32:19 -0500629 ${resp}= Run ASDC Post Request ${ASDC_CATALOG_RESOURCES_PATH} ${data} ${ASDC_DESIGNER_USER_ID}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500630 Should Be Equal As Strings ${resp.status_code} 201
DR695Hccff30b2017-02-17 18:44:24 -0500631 [Return] ${resp.json()['uniqueId']}
bdfreeman1421b2a49512018-11-25 07:32:19 -0500632
633Add ASDC Allotted Resource Catalog Resource
kaihlavi06fa4ee2019-05-22 19:08:14 +0300634 [Documentation] Creates an ASDC Allotted Resource Catalog Resource and returns its id
bdfreeman1421b2a49512018-11-25 07:32:19 -0500635 [Arguments] ${license_agreement_id} ${software_product_name} ${license_model_name} ${software_product_id} ${subcategory}
636 ${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 -0400637 Create Environment sdc ${GLOBAL_TEMPLATE_FOLDER}
638 ${data}= Apply Template sdc ${ASDC_ALLOTTED_RESOURCE_CATALOG_RESOURCE_TEMPLATE} ${map}
bdfreeman1421b2a49512018-11-25 07:32:19 -0500639 ${resp}= Run ASDC Post Request ${ASDC_CATALOG_RESOURCES_PATH} ${data} ${ASDC_DESIGNER_USER_ID}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500640 Should Be Equal As Strings ${resp.status_code} 201
bdfreeman1421b2a49512018-11-25 07:32:19 -0500641 [Return] ${resp.json()['uniqueId']}
642
DR695Hccff30b2017-02-17 18:44:24 -0500643Mark ASDC Catalog Resource Inactive
kaihlavi06fa4ee2019-05-22 19:08:14 +0300644 [Documentation] Marks ASDC Catalog Resource as inactive
DR695Hccff30b2017-02-17 18:44:24 -0500645 [Arguments] ${catalog_resource_id}
646 ${resp}= Run ASDC Delete Request ${ASDC_CATALOG_RESOURCES_PATH}/${catalog_resource_id} ${ASDC_DESIGNER_USER_ID}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500647 Should Be Equal As Strings ${resp.status_code} 204
DR695Hccff30b2017-02-17 18:44:24 -0500648 [Return] ${resp}
kaihlavi06fa4ee2019-05-22 19:08:14 +0300649
DR695Hccff30b2017-02-17 18:44:24 -0500650Delete Inactive ASDC Catalog Resources
kaihlavi06fa4ee2019-05-22 19:08:14 +0300651 [Documentation] Delete all ASDC Catalog Resources that are inactive
DR695Hccff30b2017-02-17 18:44:24 -0500652 ${resp}= Run ASDC Delete Request ${ASDC_CATALOG_INACTIVE_RESOURCES_PATH} ${ASDC_DESIGNER_USER_ID}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500653 Should Be Equal As Strings ${resp.status_code} 200
DR695Hccff30b2017-02-17 18:44:24 -0500654 [Return] ${resp.json()}
kaihlavi06fa4ee2019-05-22 19:08:14 +0300655
DR695Hccff30b2017-02-17 18:44:24 -0500656Get ASDC Catalog Resource
kaihlavi06fa4ee2019-05-22 19:08:14 +0300657 [Documentation] Gets an ASDC Catalog Resource by its id
DR695Hccff30b2017-02-17 18:44:24 -0500658 [Arguments] ${catalog_resource_id}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500659 ${resp}= Run ASDC Get Request ${ASDC_CATALOG_RESOURCES_PATH}/${catalog_resource_id} ${ASDC_DESIGNER_USER_ID}
DR695Hccff30b2017-02-17 18:44:24 -0500660 [Return] ${resp.json()}
Brian Freemaneef7c6f2018-11-16 18:42:21 -0500661
Yang Xu2ec80382018-11-01 12:30:37 -0400662Get ASDC Catalog Resource Component Instances
kaihlavi06fa4ee2019-05-22 19:08:14 +0300663 [Documentation] Gets component instances of an ASDC Catalog Resource by its id
Yang Xu2ec80382018-11-01 12:30:37 -0400664 [Arguments] ${catalog_resource_id}
665 ${resp}= Run ASDC Get Request ${ASDC_FE_CATALOG_RESOURCES_PATH}/${catalog_resource_id}/filteredDataByParams?include=componentInstances ${ASDC_DESIGNER_USER_ID} ${ASDC_FE_ENDPOINT}
666 [Return] ${resp.json()}
bdfreeman1421b2a49512018-11-25 07:32:19 -0500667
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500668Get ASDC Catalog Resource Deployment Artifact Properties
kaihlavi06fa4ee2019-05-22 19:08:14 +0300669 [Documentation] Gets deployment artifact properties of an ASDC Catalog Resource by its id
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500670 [Arguments] ${catalog_resource_id}
671 #${resp}= Run ASDC Get Request ${ASDC_CATALOG_SERVICES_PATH}/${catalog_resource_id}/filteredDataByParams?include=componentInstances ${ASDC_DESIGNER_USER_ID} ${ASDC_FE_ENDPOINT}
672 ${resp}= Run ASDC Get Request ${ASDC_CATALOG_SERVICES_PATH}/${catalog_resource_id}/filteredDataByParams?include=deploymentArtifacts ${ASDC_DESIGNER_USER_ID} ${ASDC_FE_ENDPOINT}
673 [Return] ${resp.json()}
674
675
Brian Freemaneef7c6f2018-11-16 18:42:21 -0500676Get ASDC Catalog Resource Component Instances Properties
kaihlavi06fa4ee2019-05-22 19:08:14 +0300677 [Documentation] Gets ASDC Catalog Resource component instances properties by its id
Brian Freemaneef7c6f2018-11-16 18:42:21 -0500678 [Arguments] ${catalog_resource_id}
679 #${resp}= Run ASDC Get Request ${ASDC_FE_CATALOG_RESOURCES_PATH}/${catalog_resource_id}/filteredDataByParams?include=componentInstancesProperties ${ASDC_DESIGNER_USER_ID} ${ASDC_FE_ENDPOINT}
680 ${resp}= Run ASDC Get Request ${ASDC_CATALOG_SERVICES_PATH}/${catalog_resource_id}/filteredDataByParams?include=componentInstancesProperties ${ASDC_DESIGNER_USER_ID} ${ASDC_BE_ENDPOINT}
681 [Return] ${resp.json()}
682
bdfreeman1421b2a49512018-11-25 07:32:19 -0500683Get ASDC Catalog Resource Component Instances Properties For Resource
kaihlavi06fa4ee2019-05-22 19:08:14 +0300684 [Documentation] Gets ASDC Catalog Resource component instances properties for a Resource (VF) by its id
bdfreeman1421b2a49512018-11-25 07:32:19 -0500685 [Arguments] ${catalog_resource_id}
686 ${resp}= Run ASDC Get Request ${ASDC_FE_CATALOG_RESOURCES_PATH}/${catalog_resource_id}/filteredDataByParams?include=componentInstancesProperties ${ASDC_DESIGNER_USER_ID} ${ASDC_FE_ENDPOINT}
687 [Return] ${resp.json()}
Brian Freemaneef7c6f2018-11-16 18:42:21 -0500688
Yang Xu2ec80382018-11-01 12:30:37 -0400689Get ASDC Catalog Resource Inputs
kaihlavi06fa4ee2019-05-22 19:08:14 +0300690 [Documentation] Gets ASDC Catalog Resource inputs by its id
Yang Xu2ec80382018-11-01 12:30:37 -0400691 [Arguments] ${catalog_resource_id}
692 ${resp}= Run ASDC Get Request ${ASDC_FE_CATALOG_RESOURCES_PATH}/${catalog_resource_id}/filteredDataByParams?include=inputs ${ASDC_DESIGNER_USER_ID} ${ASDC_FE_ENDPOINT}
693 [Return] ${resp.json()}
Brian Freemaneef7c6f2018-11-16 18:42:21 -0500694
Yang Xu2ec80382018-11-01 12:30:37 -0400695Get ASDC Catalog Resource Component Instance Properties
kaihlavi06fa4ee2019-05-22 19:08:14 +0300696 [Documentation] Gets component instance properties of an ASDC Catalog Resource by their ids
Yang Xu2ec80382018-11-01 12:30:37 -0400697 [Arguments] ${catalog_resource_id} ${component_instance_id} ${component_id}
698 ${resp}= Run ASDC Get Request ${ASDC_FE_CATALOG_RESOURCES_PATH}/${catalog_resource_id}/componentInstances/${component_instance_id}/${component_id}/inputs ${ASDC_DESIGNER_USER_ID} ${ASDC_FE_ENDPOINT}
699 [Return] ${resp.json()}
bdfreeman1421b2a49512018-11-25 07:32:19 -0500700
Yang Xu2ec80382018-11-01 12:30:37 -0400701Set ASDC Catalog Resource Component Instance Properties
kaihlavi06fa4ee2019-05-22 19:08:14 +0300702 [Documentation] Sets ASDC Catalog Resource component instance properties by ids
Brian Freemaneef7c6f2018-11-16 18:42:21 -0500703 [Arguments] ${catalog_resource_id} ${component_parent_service_id} ${data}
704 #${resp}= Run ASDC Post Request ${ASDC_FE_CATALOG_RESOURCES_PATH}/${component_parent_service_id}/resourceInstance/${catalog_resource_id}/inputs ${data} ${ASDC_DESIGNER_USER_ID} ${ASDC_FE_ENDPOINT}
705 ${resp}= Run ASDC Post Request ${ASDC_FE_CATALOG_SERVICES_PATH}/${component_parent_service_id}/resourceInstance/${catalog_resource_id}/properties ${data} ${ASDC_DESIGNER_USER_ID} ${ASDC_FE_ENDPOINT}
bdfreeman1421b2a49512018-11-25 07:32:19 -0500706 [Return] ${resp.json()}
707
708Set ASDC Catalog Resource Component Instance Properties For Resource
kaihlavi06fa4ee2019-05-22 19:08:14 +0300709 [Documentation] Sets ASDC Resource component instance properties by ids
bdfreeman1421b2a49512018-11-25 07:32:19 -0500710 [Arguments] ${catalog_parent_resource_id} ${catalog_resource_id} ${data}
711 #${resp}= Run ASDC Post Request ${ASDC_FE_CATALOG_RESOURCES_PATH}/${catalog_parent_resource_id}/resourceInstance/${catalog_resource_id}/inputs ${data} ${ASDC_DESIGNER_USER_ID} ${ASDC_FE_ENDPOINT}
712 ${resp}= Run ASDC Post Request ${ASDC_FE_CATALOG_RESOURCES_PATH}/${catalog_parent_resource_id}/resourceInstance/${catalog_resource_id}/properties ${data} ${ASDC_DESIGNER_USER_ID} ${ASDC_FE_ENDPOINT}
713 [Return] ${resp.json()}
Brian Freemaneef7c6f2018-11-16 18:42:21 -0500714
Yang Xu74cfb862018-12-06 21:57:32 -0500715Set CDS Catalog Resource Component Instance Properties
kaihlavi06fa4ee2019-05-22 19:08:14 +0300716 [Documentation] Sets CDS Catalog Resource component instance properties by ids
Yang Xu74cfb862018-12-06 21:57:32 -0500717 [Arguments] ${catalog_resource_id} ${component_instance_id} ${data}
718 ${resp}= Run ASDC Post Request ${ASDC_FE_CATALOG_RESOURCES_PATH}/${catalog_resource_id}/resourceInstance/${component_instance_id}/inputs ${data} ${ASDC_DESIGNER_USER_ID} ${ASDC_FE_ENDPOINT}
719 [Return] ${resp.json()}
720
Yang Xu2ec80382018-11-01 12:30:37 -0400721Set ASDC Catalog Resource VNF Inputs
kaihlavi06fa4ee2019-05-22 19:08:14 +0300722 [Documentation] Sets VNF Inputs for an ASDC Catalog Resource by its id
Yang Xu2ec80382018-11-01 12:30:37 -0400723 [Arguments] ${catalog_resource_id} ${data}
724 ${resp}= Run ASDC Post Request ${ASDC_FE_CATALOG_RESOURCES_PATH}/${catalog_resource_id}/update/inputs ${data} ${ASDC_DESIGNER_USER_ID} ${ASDC_FE_ENDPOINT}
725 [Return] ${resp.json()}
kaihlavi06fa4ee2019-05-22 19:08:14 +0300726
Brian Freeman79b00ce2018-11-01 14:57:53 -0500727Get SDC Demo Vnf Catalog Resource
kaihlavi06fa4ee2019-05-22 19:08:14 +0300728 [Documentation] Gets Resource ids of demonstration VNFs for instantiation
Brian Freeman79b00ce2018-11-01 14:57:53 -0500729 [Arguments] ${service_name}
730 ${resp}= Run ASDC Get Request ${ASDC_CATALOG_SERVICES_PATH}/serviceName/${service_name}/serviceVersion/1.0
731 @{ITEMS}= Copy List ${resp.json()['componentInstances']}
732 ${demo_catalog_resource}= Create Dictionary
733 :FOR ${ELEMENT} IN @{ITEMS}
734 \ Log ${ELEMENT['name']}
735 \ Log ${ELEMENT['groupInstances'][0]['groupName']}
736 \ ${vnf}= Get VNF From Group Name ${ELEMENT['groupInstances'][0]['groupName']} ${service_name}
737 \ ${vnf_data}= Create Dictionary vnf_type=${ELEMENT['name']} vf_module=${ELEMENT['groupInstances'][0]['groupName']}
738 \ LOG ${vnf_data}
739 \ Set To Dictionary ${demo_catalog_resource} ${vnf}=${vnf_data}
740 \ LOG ${demo_catalog_resource}
741 [Return] ${demo_catalog_resource}
742
743Get VNF From Group Name
kaihlavi06fa4ee2019-05-22 19:08:14 +0300744 [Documentation] Looks up VNF key from service mapping for a regex on group_name and service_name
Brian Freeman79b00ce2018-11-01 14:57:53 -0500745 [Arguments] ${group_name} ${service_name}
746 ${vnf}= Set Variable If
Brian Freeman4c71b0b2019-04-26 08:08:56 -0500747 ... ('${service_name}'=='demoVFWCL') and ('base_vfw' in '${group_name}') vFWCLvFWSNK
748 ... ('${service_name}'=='demoVFWCL') and ('base_vpkg' in '${group_name}') vFWCLvPKG
Brian Freeman79b00ce2018-11-01 14:57:53 -0500749 ... ('${service_name}'=='demoVLB') and ('base_vlb' in '${group_name}') vLB
750 [Return] ${vnf}
kaihlavi06fa4ee2019-05-22 19:08:14 +0300751
DR695Hccff30b2017-02-17 18:44:24 -0500752Checkin ASDC Catalog Resource
kaihlavi06fa4ee2019-05-22 19:08:14 +0300753 [Documentation] Checks in an ASDC Catalog Resource by its id
DR695Hccff30b2017-02-17 18:44:24 -0500754 [Arguments] ${catalog_resource_id}
755 ${map}= Create Dictionary user_remarks=Robot remarks
DR695H3bb6cf42019-06-20 15:04:04 -0400756 Create Environment sdc ${GLOBAL_TEMPLATE_FOLDER}
757 ${data}= Apply Template sdc ${ASDC_USER_REMARKS_TEMPLATE} ${map}
DR695Hccff30b2017-02-17 18:44:24 -0500758 ${resp}= Run ASDC Post Request ${ASDC_CATALOG_RESOURCES_PATH}/${catalog_resource_id}${ASDC_CATALOG_LIFECYCLE_PATH}/checkin ${data} ${ASDC_DESIGNER_USER_ID}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500759 Should Be Equal As Strings ${resp.status_code} 200
DR695Hccff30b2017-02-17 18:44:24 -0500760 [Return] ${resp.json()}
kaihlavi06fa4ee2019-05-22 19:08:14 +0300761
DR695Hccff30b2017-02-17 18:44:24 -0500762Request Certify ASDC Catalog Resource
kaihlavi06fa4ee2019-05-22 19:08:14 +0300763 [Documentation] Requests certification of an ASDC Catalog Resource by its id
DR695Hccff30b2017-02-17 18:44:24 -0500764 [Arguments] ${catalog_resource_id}
765 ${map}= Create Dictionary user_remarks=Robot remarks
DR695H3bb6cf42019-06-20 15:04:04 -0400766 Create Environment sdc ${GLOBAL_TEMPLATE_FOLDER}
767 ${data}= Apply Template sdc ${ASDC_USER_REMARKS_TEMPLATE} ${map}
DR695Hccff30b2017-02-17 18:44:24 -0500768 ${resp}= Run ASDC Post Request ${ASDC_CATALOG_RESOURCES_PATH}/${catalog_resource_id}${ASDC_CATALOG_LIFECYCLE_PATH}/certificationRequest ${data} ${ASDC_DESIGNER_USER_ID}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500769 Should Be Equal As Strings ${resp.status_code} 200
DR695Hccff30b2017-02-17 18:44:24 -0500770 [Return] ${resp.json()}
kaihlavi06fa4ee2019-05-22 19:08:14 +0300771
DR695Hccff30b2017-02-17 18:44:24 -0500772Start Certify ASDC Catalog Resource
kaihlavi06fa4ee2019-05-22 19:08:14 +0300773 [Documentation] Start certification of an ASDC Catalog Resource by its id
DR695Hccff30b2017-02-17 18:44:24 -0500774 [Arguments] ${catalog_resource_id}
775 ${resp}= Run ASDC Post Request ${ASDC_CATALOG_RESOURCES_PATH}/${catalog_resource_id}${ASDC_CATALOG_LIFECYCLE_PATH}/startCertification ${None} ${ASDC_TESTER_USER_ID}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500776 Should Be Equal As Strings ${resp.status_code} 200
DR695Hccff30b2017-02-17 18:44:24 -0500777 [Return] ${resp.json()}
kaihlavi06fa4ee2019-05-22 19:08:14 +0300778
DR695Hccff30b2017-02-17 18:44:24 -0500779Certify ASDC Catalog Resource
kaihlavi06fa4ee2019-05-22 19:08:14 +0300780 [Documentation] Certifies an ASDC Catalog Resource by its id and returns the new id
Brian Freemandb1e7412018-08-01 12:46:01 -0500781 [Arguments] ${catalog_resource_id} ${user_id}=${ASDC_TESTER_USER_ID}
DR695Hccff30b2017-02-17 18:44:24 -0500782 ${map}= Create Dictionary user_remarks=Robot remarks
DR695H3bb6cf42019-06-20 15:04:04 -0400783 Create Environment sdc ${GLOBAL_TEMPLATE_FOLDER}
784 ${data}= Apply Template sdc ${ASDC_USER_REMARKS_TEMPLATE} ${map}
Brian Freemandb1e7412018-08-01 12:46:01 -0500785 ${resp}= Run ASDC Post Request ${ASDC_CATALOG_RESOURCES_PATH}/${catalog_resource_id}${ASDC_CATALOG_LIFECYCLE_PATH}/certify ${data} ${user_id}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500786 Should Be Equal As Strings ${resp.status_code} 200
DR695Hccff30b2017-02-17 18:44:24 -0500787 [Return] ${resp.json()['uniqueId']}
Jerry Flood6bd1afa2017-10-09 09:59:23 -0400788
DR695Hccff30b2017-02-17 18:44:24 -0500789Upload ASDC Heat Package
kaihlavi06fa4ee2019-05-22 19:08:14 +0300790 [Documentation] Creates an ASDC Software Product and returns its id
Brian Freemanf508ab22018-03-15 21:19:41 -0500791 [Arguments] ${software_product_id} ${file_path} ${version_id}=0.1
Jerry Flood6bd1afa2017-10-09 09:59:23 -0400792 ${files}= Create Dictionary
793 Create Multi Part ${files} upload ${file_path} contentType=application/zip
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500794 ${resp}= Run ASDC Post Files Request ${ASDC_VENDOR_SOFTWARE_PRODUCT_PATH}/${software_product_id}/versions/${version_id}${ASDC_VENDOR_SOFTWARE_UPLOAD_PATH} ${files} ${ASDC_DESIGNER_USER_ID} ${ASDC_BE_ONBOARD_ENDPOINT}
795 Should Be Equal As Strings ${resp.status_code} 200
Jerry Flood6bd1afa2017-10-09 09:59:23 -0400796
DR695Hccff30b2017-02-17 18:44:24 -0500797Add ASDC Catalog Service
kaihlavi06fa4ee2019-05-22 19:08:14 +0300798 [Documentation] Creates an ASDC Catalog Service and returns its id
jf986075010a42017-02-22 16:52:54 -0500799 [Arguments] ${catalog_service_name}
DR695H18872bc2019-06-13 16:16:52 -0400800 ${uuid}= Generate UUID4
jf986075010a42017-02-22 16:52:54 -0500801 ${shortened_uuid}= Evaluate str("${uuid}")[:23]
Jerry Floode2a48d72017-06-21 15:06:29 -0400802 ${catalog_service_name}= Set Variable If '${catalog_service_name}' =='' ${shortened_uuid} ${catalog_service_name}
jf986075010a42017-02-22 16:52:54 -0500803 ${map}= Create Dictionary service_name=${catalog_service_name}
DR695H3bb6cf42019-06-20 15:04:04 -0400804 Create Environment sdc ${GLOBAL_TEMPLATE_FOLDER}
805 ${data}= Apply Template sdc ${ASDC_CATALOG_SERVICE_TEMPLATE} ${map}
DR695Hccff30b2017-02-17 18:44:24 -0500806 ${resp}= Run ASDC Post Request ${ASDC_CATALOG_SERVICES_PATH} ${data} ${ASDC_DESIGNER_USER_ID}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500807 Should Be Equal As Strings ${resp.status_code} 201
DR695Hccff30b2017-02-17 18:44:24 -0500808 [Return] ${resp.json()['uniqueId']}
kaihlavi06fa4ee2019-05-22 19:08:14 +0300809
DR695Hccff30b2017-02-17 18:44:24 -0500810Mark ASDC Catalog Service Inactive
kaihlavi06fa4ee2019-05-22 19:08:14 +0300811 [Documentation] Deletes an ASDC Catalog Service
DR695Hccff30b2017-02-17 18:44:24 -0500812 [Arguments] ${catalog_service_id}
813 ${resp}= Run ASDC Delete Request ${ASDC_CATALOG_SERVICES_PATH}/${catalog_service_id} ${ASDC_DESIGNER_USER_ID}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500814 Should Be Equal As Strings ${resp.status_code} 204
DR695Hccff30b2017-02-17 18:44:24 -0500815 [Return] ${resp}
kaihlavi06fa4ee2019-05-22 19:08:14 +0300816
DR695Hccff30b2017-02-17 18:44:24 -0500817Delete Inactive ASDC Catalog Services
kaihlavi06fa4ee2019-05-22 19:08:14 +0300818 [Documentation] Delete all ASDC Catalog Services that are inactive
DR695Hccff30b2017-02-17 18:44:24 -0500819 ${resp}= Run ASDC Delete Request ${ASDC_CATALOG_INACTIVE_SERVICES_PATH} ${ASDC_DESIGNER_USER_ID}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500820 Should Be Equal As Strings ${resp.status_code} 200
DR695Hccff30b2017-02-17 18:44:24 -0500821 [Return] ${resp.json()}
kaihlavi06fa4ee2019-05-22 19:08:14 +0300822
DR695Hccff30b2017-02-17 18:44:24 -0500823Get ASDC Catalog Service
kaihlavi06fa4ee2019-05-22 19:08:14 +0300824 [Documentation] Gets an ASDC Catalog Service by its id
DR695Hccff30b2017-02-17 18:44:24 -0500825 [Arguments] ${catalog_service_id}
826 ${resp}= Run ASDC Get Request ${ASDC_CATALOG_SERVICES_PATH}/${catalog_service_id} ${ASDC_DESIGNER_USER_ID}
827 [Return] ${resp.json()}
kaihlavi06fa4ee2019-05-22 19:08:14 +0300828
DR695Hccff30b2017-02-17 18:44:24 -0500829Checkin ASDC Catalog Service
kaihlavi06fa4ee2019-05-22 19:08:14 +0300830 [Documentation] Checks in an ASDC Catalog Service by its id
DR695Hccff30b2017-02-17 18:44:24 -0500831 [Arguments] ${catalog_service_id}
832 ${map}= Create Dictionary user_remarks=Robot remarks
DR695H3bb6cf42019-06-20 15:04:04 -0400833 Create Environment sdc ${GLOBAL_TEMPLATE_FOLDER}
834 ${data}= Apply Template sdc ${ASDC_USER_REMARKS_TEMPLATE} ${map}
DR695Hccff30b2017-02-17 18:44:24 -0500835 ${resp}= Run ASDC Post Request ${ASDC_CATALOG_SERVICES_PATH}/${catalog_service_id}${ASDC_CATALOG_LIFECYCLE_PATH}/checkin ${data} ${ASDC_DESIGNER_USER_ID}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500836 Should Be Equal As Strings ${resp.status_code} 200
DR695Hccff30b2017-02-17 18:44:24 -0500837 [Return] ${resp.json()}
kaihlavi06fa4ee2019-05-22 19:08:14 +0300838
DR695Hccff30b2017-02-17 18:44:24 -0500839Request Certify ASDC Catalog Service
kaihlavi06fa4ee2019-05-22 19:08:14 +0300840 [Documentation] Requests certification of an ASDC Catalog Service by its id
DR695Hccff30b2017-02-17 18:44:24 -0500841 [Arguments] ${catalog_service_id}
842 ${map}= Create Dictionary user_remarks=Robot remarks
DR695H3bb6cf42019-06-20 15:04:04 -0400843 Create Environment sdc ${GLOBAL_TEMPLATE_FOLDER}
844 ${data}= Apply Template sdc ${ASDC_USER_REMARKS_TEMPLATE} ${map}
DR695Hccff30b2017-02-17 18:44:24 -0500845 ${resp}= Run ASDC Post Request ${ASDC_CATALOG_SERVICES_PATH}/${catalog_service_id}${ASDC_CATALOG_LIFECYCLE_PATH}/certificationRequest ${data} ${ASDC_DESIGNER_USER_ID}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500846 Should Be Equal As Strings ${resp.status_code} 200
DR695Hccff30b2017-02-17 18:44:24 -0500847 [Return] ${resp.json()}
kaihlavi06fa4ee2019-05-22 19:08:14 +0300848
DR695Hccff30b2017-02-17 18:44:24 -0500849Start Certify ASDC Catalog Service
kaihlavi06fa4ee2019-05-22 19:08:14 +0300850 [Documentation] Start certification of an ASDC Catalog Service by its id
DR695Hccff30b2017-02-17 18:44:24 -0500851 [Arguments] ${catalog_service_id}
852 ${resp}= Run ASDC Post Request ${ASDC_CATALOG_SERVICES_PATH}/${catalog_service_id}${ASDC_CATALOG_LIFECYCLE_PATH}/startCertification ${None} ${ASDC_TESTER_USER_ID}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500853 Should Be Equal As Strings ${resp.status_code} 200
DR695Hccff30b2017-02-17 18:44:24 -0500854 [Return] ${resp.json()}
kaihlavi06fa4ee2019-05-22 19:08:14 +0300855
DR695Hccff30b2017-02-17 18:44:24 -0500856Certify ASDC Catalog Service
kaihlavi06fa4ee2019-05-22 19:08:14 +0300857 [Documentation] Certifies an ASDC Catalog Service by its id and returns the new id
DR695Hccff30b2017-02-17 18:44:24 -0500858 [Arguments] ${catalog_service_id}
859 ${map}= Create Dictionary user_remarks=Robot remarks
DR695H3bb6cf42019-06-20 15:04:04 -0400860 Create Environment sdc ${GLOBAL_TEMPLATE_FOLDER}
861 ${data}= Apply Template sdc ${ASDC_USER_REMARKS_TEMPLATE} ${map}
DR695Hccff30b2017-02-17 18:44:24 -0500862 ${resp}= Run ASDC Post Request ${ASDC_CATALOG_SERVICES_PATH}/${catalog_service_id}${ASDC_CATALOG_LIFECYCLE_PATH}/certify ${data} ${ASDC_TESTER_USER_ID}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500863 Should Be Equal As Strings ${resp.status_code} 200
DR695Hccff30b2017-02-17 18:44:24 -0500864 [Return] ${resp.json()['uniqueId']}
kaihlavi06fa4ee2019-05-22 19:08:14 +0300865
DR695Hccff30b2017-02-17 18:44:24 -0500866Approve ASDC Catalog Service
kaihlavi06fa4ee2019-05-22 19:08:14 +0300867 [Documentation] Approves an ASDC Catalog Service by its id
DR695Hccff30b2017-02-17 18:44:24 -0500868 [Arguments] ${catalog_service_id}
869 ${map}= Create Dictionary user_remarks=Robot remarks
DR695H3bb6cf42019-06-20 15:04:04 -0400870 Create Environment sdc ${GLOBAL_TEMPLATE_FOLDER}
871 ${data}= Apply Template sdc ${ASDC_USER_REMARKS_TEMPLATE} ${map}
DR695Hccff30b2017-02-17 18:44:24 -0500872 ${resp}= Run ASDC Post Request ${ASDC_CATALOG_SERVICES_PATH}/${catalog_service_id}${ASDC_CATALOG_SERVICE_DISTRIBUTION_STATE_PATH}${ASDC_DISTRIBUTION_STATE_APPROVE_PATH} ${data} ${ASDC_GOVERNOR_USER_ID}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500873 Should Be Equal As Strings ${resp.status_code} 200
DR695Hccff30b2017-02-17 18:44:24 -0500874 [Return] ${resp.json()}
875Distribute ASDC Catalog Service
876 [Documentation] distribute an asdc Catalog Service by its id
877 [Arguments] ${catalog_service_id}
878 ${resp}= Run ASDC Post Request ${ASDC_CATALOG_SERVICES_PATH}/${catalog_service_id}${ASDC_CATALOG_SERVICE_DISTRIBUTION_ACTIVATE_PATH} ${None} ${ASDC_OPS_USER_ID}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500879 Should Be Equal As Strings ${resp.status_code} 200
DR695Hccff30b2017-02-17 18:44:24 -0500880 [Return] ${resp.json()}
bdfreeman1421b2a49512018-11-25 07:32:19 -0500881
DR695Hccff30b2017-02-17 18:44:24 -0500882Add ASDC Resource Instance
kaihlavi06fa4ee2019-05-22 19:08:14 +0300883 [Documentation] Creates an ASDC Resource Instance and returns its id
Yang Xufac7a632019-05-17 01:01:26 -0400884 [Arguments] ${catalog_service_id} ${catalog_resource_id} ${catalog_resource_name} ${xoffset}=${0} ${yoffset}=${0} ${resourceType}=VF
DR695H18872bc2019-06-13 16:16:52 -0400885 ${milli_timestamp}= Generate Timestamp
Brian Freemaneef7c6f2018-11-16 18:42:21 -0500886 ${xoffset}= Set Variable ${xoffset+306}
887 ${yoffset}= Set Variable ${yoffset+248}
Yang Xufac7a632019-05-17 01:01:26 -0400888 ${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 -0400889 Create Environment sdc ${GLOBAL_TEMPLATE_FOLDER}
890 ${data}= Apply Template sdc ${ASDC_RESOURCE_INSTANCE_TEMPLATE} ${map}
DR695Hccff30b2017-02-17 18:44:24 -0500891 ${resp}= Run ASDC Post Request ${ASDC_CATALOG_SERVICES_PATH}/${catalog_service_id}${ASDC_CATALOG_SERVICE_RESOURCE_INSTANCE_PATH} ${data} ${ASDC_DESIGNER_USER_ID}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500892 Should Be Equal As Strings ${resp.status_code} 201
DR695Hccff30b2017-02-17 18:44:24 -0500893 [Return] ${resp.json()['uniqueId']}
Brian Freemaneef7c6f2018-11-16 18:42:21 -0500894
bdfreeman1421b2a49512018-11-25 07:32:19 -0500895Add ASDC Resource Instance To Resource
kaihlavi06fa4ee2019-05-22 19:08:14 +0300896 [Documentation] Creates an ASDC Resource Instance in a Resource (VF) and returns its id
Yang Xufac7a632019-05-17 01:01:26 -0400897 [Arguments] ${parent_catalog_resource_id} ${catalog_resource_id} ${catalog_resource_name} ${xoffset}=${0} ${yoffset}=${0} ${resourceType}=VF
DR695H18872bc2019-06-13 16:16:52 -0400898 ${milli_timestamp}= Generate Timestamp
bdfreeman1421b2a49512018-11-25 07:32:19 -0500899 ${xoffset}= Set Variable ${xoffset+306}
900 ${yoffset}= Set Variable ${yoffset+248}
Yang Xufac7a632019-05-17 01:01:26 -0400901 ${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 -0400902 Create Environment sdc ${GLOBAL_TEMPLATE_FOLDER}
903 ${data}= Apply Template sdc ${ASDC_RESOURCE_INSTANCE_TEMPLATE} ${map}
bdfreeman1421b2a49512018-11-25 07:32:19 -0500904 ${resp}= Run ASDC Post Request ${ASDC_CATALOG_RESOURCES_PATH}/${parent_catalog_resource_id}${ASDC_CATALOG_SERVICE_RESOURCE_INSTANCE_PATH} ${data} ${ASDC_DESIGNER_USER_ID}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500905 Should Be Equal As Strings ${resp.status_code} 201
bdfreeman1421b2a49512018-11-25 07:32:19 -0500906 [Return] ${resp.json()['uniqueId']}
907
DR695Hccff30b2017-02-17 18:44:24 -0500908Get Catalog Service Distribution
kaihlavi06fa4ee2019-05-22 19:08:14 +0300909 [Documentation] Gets an ASDC Catalog Service distribution
DR695Hccff30b2017-02-17 18:44:24 -0500910 [Arguments] ${catalog_service_uuid}
911 ${resp}= Run ASDC Get Request ${ASDC_CATALOG_SERVICES_PATH}/${catalog_service_uuid}${ASDC_CATALOG_SERVICE_DISTRIBUTION_PATH} ${ASDC_OPS_USER_ID}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500912 Should Be Equal As Strings ${resp.status_code} 200
DR695Hccff30b2017-02-17 18:44:24 -0500913 [Return] ${resp.json()}
kaihlavi06fa4ee2019-05-22 19:08:14 +0300914
DR695Hccff30b2017-02-17 18:44:24 -0500915Check Catalog Service Distributed
kaihlavi06fa4ee2019-05-22 19:08:14 +0300916 [Documentation] Checks if an ASDC Catalog Service is distributed
Brian Freemanadaa2372018-10-24 12:25:22 -0500917 [Arguments] ${catalog_service_uuid} ${dist_status}
DR695Hccff30b2017-02-17 18:44:24 -0500918 ${dist_resp}= Get Catalog Service Distribution ${catalog_service_uuid}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500919 Should Be Equal As Strings ${dist_resp['distributionStatusOfServiceList'][0]['deployementStatus']} Distributed
DR695Hccff30b2017-02-17 18:44:24 -0500920 ${det_resp}= Get Catalog Service Distribution Details ${dist_resp['distributionStatusOfServiceList'][0]['distributionID']}
921 @{ITEMS}= Copy List ${det_resp['distributionStatusList']}
Brian Freemanf508ab22018-03-15 21:19:41 -0500922 Should Not Be Empty ${ITEMS}
Brian Freemana62644f2018-05-13 12:47:38 -0500923 ${SO_COMPLETE} Set Variable FALSE
bdfreeman1421b2a49512018-11-25 07:32:19 -0500924 ${dist_status} Set Variable CONTINUE
925 Should Not Be Empty ${ITEMS}
DR695Hccff30b2017-02-17 18:44:24 -0500926 :FOR ${ELEMENT} IN @{ITEMS}
Brian Freemanf508ab22018-03-15 21:19:41 -0500927 \ Log ${ELEMENT['omfComponentID']}
DR695Hccff30b2017-02-17 18:44:24 -0500928 \ Log ${ELEMENT['status']}
Brian Freeman41ab5e52018-08-08 14:24:23 -0500929 \ ${SO_COMPLETE} Set Variable If (('${ELEMENT['status']}' == 'DISTRIBUTION_COMPLETE_OK')) or ('${SO_COMPLETE}'=='TRUE') TRUE
Brian Freemaneca71072018-08-16 14:50:16 -0500930 \ Exit For Loop If ('${SO_COMPLETE}'=='TRUE')
931 \ Exit For Loop If ('${ELEMENT['status']}' == 'DISTRIBUTION_COMPLETE_ERROR')
Brian Freemanadaa2372018-10-24 12:25:22 -0500932 \ ${dist_status}= Set Variable If (('${ELEMENT['status']}' == 'COMPONENT_DONE_ERROR') and ('${ELEMENT['omfComponentID']}' == 'aai-ml')) EXIT
933 \ Exit For Loop If (('${ELEMENT['status']}' == 'COMPONENT_DONE_ERROR') and ('${ELEMENT['omfComponentID']}' == 'aai-ml'))
Brian Freemana62644f2018-05-13 12:47:38 -0500934 Should Be True ( '${SO_COMPLETE}'=='TRUE') SO Test
bdfreeman1421b2a49512018-11-25 07:32:19 -0500935
DR695Hccff30b2017-02-17 18:44:24 -0500936Get Catalog Service Distribution Details
kaihlavi06fa4ee2019-05-22 19:08:14 +0300937 [Documentation] Gets ASDC Catalog Service distribution details
DR695Hccff30b2017-02-17 18:44:24 -0500938 [Arguments] ${catalog_service_distribution_id}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500939 ${resp}= Run ASDC Get Request ${ASDC_CATALOG_SERVICES_PATH}${ASDC_CATALOG_SERVICE_DISTRIBUTION_PATH}/${catalog_service_distribution_id} ${ASDC_OPS_USER_ID}
940 Should Be Equal As Strings ${resp.status_code} 200
DR695Hccff30b2017-02-17 18:44:24 -0500941 [Return] ${resp.json()}
942Run ASDC Health Check
943 [Documentation] Runs a ASDC health check
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500944 ${session}= Create Session asdc ${ASDC_FE_ENDPOINT}
DR695H18872bc2019-06-13 16:16:52 -0400945 ${uuid}= Generate UUID4
DR695Hccff30b2017-02-17 18:44:24 -0500946 ${headers}= Create Dictionary Accept=application/json Content-Type=application/json X-TransactionId=${GLOBAL_APPLICATION_ID}-${uuid} X-FromAppId=${GLOBAL_APPLICATION_ID}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500947 ${resp}= Get Request asdc ${ASDC_HEALTH_CHECK_PATH} headers=${headers}
Brian Freemanadaa2372018-10-24 12:25:22 -0500948 # only test for HTTP 200 to determine SDC Health. SDC_DE_HEALTH is informational
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500949 Should Be Equal As Strings ${resp.status_code} 200 SDC DOWN
Brian Freeman5cf5fa62018-04-23 20:28:16 -0500950 ${SDC_DE_HEALTH}= Catenate DOWN
DR695Hccff30b2017-02-17 18:44:24 -0500951 @{ITEMS}= Copy List ${resp.json()['componentsInfo']}
952 :FOR ${ELEMENT} IN @{ITEMS}
953 \ Log ${ELEMENT['healthCheckStatus']}
Brian Freemane546f7e2018-04-19 12:17:56 -0500954 \ ${SDC_DE_HEALTH} Set Variable If (('DE' in '${ELEMENT['healthCheckComponent']}') and ('${ELEMENT['healthCheckStatus']}' == 'UP')) or ('${SDC_DE_HEALTH}'=='UP') UP
Brian Freemand5743d52018-11-05 11:05:43 -0500955 Log To Console (DMaaP:${SDC_DE_HEALTH}) no_newline=true
DR695Hccff30b2017-02-17 18:44:24 -0500956Run ASDC Get Request
957 [Documentation] Runs an ASDC get request
Brian Freeman44b8bb32018-05-03 21:08:42 -0500958 [Arguments] ${data_path} ${user}=${ASDC_DESIGNER_USER_ID} ${MY_ASDC_BE_ENDPOINT}=${ASDC_BE_ENDPOINT}
DR695Hccff30b2017-02-17 18:44:24 -0500959 ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500960 Log Creating session ${MY_ASDC_BE_ENDPOINT}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500961 ${session}= Create Session asdc ${MY_ASDC_BE_ENDPOINT} auth=${auth}
DR695H18872bc2019-06-13 16:16:52 -0400962 ${uuid}= Generate UUID4
DR695Hccff30b2017-02-17 18:44:24 -0500963 ${headers}= Create Dictionary Accept=application/json Content-Type=application/json USER_ID=${user} X-TransactionId=${GLOBAL_APPLICATION_ID}-${uuid} X-FromAppId=${GLOBAL_APPLICATION_ID}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500964 ${resp}= Get Request asdc ${data_path} headers=${headers}
DR695Hccff30b2017-02-17 18:44:24 -0500965 Log Received response from asdc ${resp.text}
966 [Return] ${resp}
967Run ASDC Put Request
968 [Documentation] Runs an ASDC put request
Brian Freeman44b8bb32018-05-03 21:08:42 -0500969 [Arguments] ${data_path} ${data} ${user}=${ASDC_DESIGNER_USER_ID} ${MY_ASDC_BE_ENDPOINT}=${ASDC_BE_ENDPOINT}
DR695Hccff30b2017-02-17 18:44:24 -0500970 ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500971 Log Creating session ${MY_ASDC_BE_ENDPOINT}
972 ${session}= Create Session asdc ${MY_ASDC_BE_ENDPOINT} auth=${auth}
DR695H18872bc2019-06-13 16:16:52 -0400973 ${uuid}= Generate UUID4
DR695Hccff30b2017-02-17 18:44:24 -0500974 ${headers}= Create Dictionary Accept=application/json Content-Type=application/json USER_ID=${user} X-TransactionId=${GLOBAL_APPLICATION_ID}-${uuid} X-FromAppId=${GLOBAL_APPLICATION_ID}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500975 ${resp}= Put Request asdc ${data_path} data=${data} headers=${headers}
DR695Hccff30b2017-02-17 18:44:24 -0500976 Log Received response from asdc ${resp.text}
977 [Return] ${resp}
Jerry Flood6bd1afa2017-10-09 09:59:23 -0400978
DR695Hccff30b2017-02-17 18:44:24 -0500979Run ASDC Post Files Request
980 [Documentation] Runs an ASDC post request
Brian Freeman44b8bb32018-05-03 21:08:42 -0500981 [Arguments] ${data_path} ${files} ${user}=${ASDC_DESIGNER_USER_ID} ${MY_ASDC_BE_ENDPOINT}=${ASDC_BE_ENDPOINT}
DR695Hccff30b2017-02-17 18:44:24 -0500982 ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500983 Log Creating session ${MY_ASDC_BE_ENDPOINT}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500984 ${session}= Create Session asdc ${MY_ASDC_BE_ENDPOINT} auth=${auth}
DR695H18872bc2019-06-13 16:16:52 -0400985 ${uuid}= Generate UUID4
DR695Hccff30b2017-02-17 18:44:24 -0500986 ${headers}= Create Dictionary Accept=application/json Content-Type=multipart/form-data USER_ID=${user} X-TransactionId=${GLOBAL_APPLICATION_ID}-${uuid} X-FromAppId=${GLOBAL_APPLICATION_ID}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500987 ${resp}= Post Request asdc ${data_path} files=${files} headers=${headers}
988 Log Received response from asdc ${resp.text}
989 [Return] ${resp}
990
991Run ASDC MD5 Post Request
992 [Documentation] Runs an ASDC post request with MD5 Checksum header
993 [Arguments] ${data_path} ${data} ${user}=${ASDC_DESIGNER_USER_ID} ${MY_ASDC_BE_ENDPOINT}=${ASDC_BE_ENDPOINT}
994 ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD}
995 Log Creating session ${MY_ASDC_BE_ENDPOINT}
996 ${session}= Create Session asdc ${MY_ASDC_BE_ENDPOINT} auth=${auth}
DR695H18872bc2019-06-13 16:16:52 -0400997 ${uuid}= Generate UUID4
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500998 ${data_string}= Evaluate json.dumps(${data}) json
999 ${md5checksum}= Evaluate md5.new('''${data_string}''').hexdigest() modules=md5
1000 ${base64md5checksum}= Evaluate base64.b64encode("${md5checksum}") modules=base64
1001 ${headers}= Create Dictionary Accept=application/json Content-Type=application/json USER_ID=${user} X-TransactionId=${GLOBAL_APPLICATION_ID}-${uuid} X-FromAppId=${GLOBAL_APPLICATION_ID} Content-MD5=${base64md5checksum}
1002 ${resp}= Post Request asdc ${data_path} data=${data} headers=${headers}
DR695Hccff30b2017-02-17 18:44:24 -05001003 Log Received response from asdc ${resp.text}
Jerry Floode2a48d72017-06-21 15:06:29 -04001004 [Return] ${resp}
Jerry Flood6bd1afa2017-10-09 09:59:23 -04001005
DR695Hccff30b2017-02-17 18:44:24 -05001006Run ASDC Post Request
1007 [Documentation] Runs an ASDC post request
Brian Freeman44b8bb32018-05-03 21:08:42 -05001008 [Arguments] ${data_path} ${data} ${user}=${ASDC_DESIGNER_USER_ID} ${MY_ASDC_BE_ENDPOINT}=${ASDC_BE_ENDPOINT}
DR695Hccff30b2017-02-17 18:44:24 -05001009 ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD}
Brian Freeman44b8bb32018-05-03 21:08:42 -05001010 Log Creating session ${MY_ASDC_BE_ENDPOINT}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -05001011 ${session}= Create Session asdc ${MY_ASDC_BE_ENDPOINT} auth=${auth}
DR695H18872bc2019-06-13 16:16:52 -04001012 ${uuid}= Generate UUID4
DR695Hccff30b2017-02-17 18:44:24 -05001013 ${headers}= Create Dictionary Accept=application/json Content-Type=application/json USER_ID=${user} X-TransactionId=${GLOBAL_APPLICATION_ID}-${uuid} X-FromAppId=${GLOBAL_APPLICATION_ID}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -05001014 ${resp}= Post Request asdc ${data_path} data=${data} headers=${headers}
DR695Hccff30b2017-02-17 18:44:24 -05001015 Log Received response from asdc ${resp.text}
Jerry Floode2a48d72017-06-21 15:06:29 -04001016 [Return] ${resp}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -05001017
DR695Hccff30b2017-02-17 18:44:24 -05001018Run ASDC Delete Request
1019 [Documentation] Runs an ASDC delete request
Brian Freeman44b8bb32018-05-03 21:08:42 -05001020 [Arguments] ${data_path} ${user}=${ASDC_DESIGNER_USER_ID} ${MY_ASDC_BE_ENDPOINT}=${ASDC_BE_ENDPOINT}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -05001021 ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD}
Brian Freeman44b8bb32018-05-03 21:08:42 -05001022 Log Creating session ${MY_ASDC_BE_ENDPOINT}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -05001023 ${session}= Create Session asdc ${MY_ASDC_BE_ENDPOINT} auth=${auth}
DR695H18872bc2019-06-13 16:16:52 -04001024 ${uuid}= Generate UUID4
DR695Hccff30b2017-02-17 18:44:24 -05001025 ${headers}= Create Dictionary Accept=application/json Content-Type=application/json USER_ID=${user} X-TransactionId=${GLOBAL_APPLICATION_ID}-${uuid} X-FromAppId=${GLOBAL_APPLICATION_ID}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -05001026 ${resp}= Delete Request asdc ${data_path} headers=${headers}
DR695Hccff30b2017-02-17 18:44:24 -05001027 Log Received response from asdc ${resp.text}
Jerry Floode2a48d72017-06-21 15:06:29 -04001028 [Return] ${resp}
DR695Hccff30b2017-02-17 18:44:24 -05001029Open ASDC GUI
1030 [Documentation] Logs in to ASDC GUI
1031 [Arguments] ${PATH}
1032 ## Setup Browever now being managed by the test case
1033 ##Setup Browser
DR695Hbf5a3a32017-06-30 13:09:57 -04001034 Go To ${ASDC_FE_ENDPOINT}${PATH}
DR695Hccff30b2017-02-17 18:44:24 -05001035 Maximize Browser Window
Jerry Flood6bd1afa2017-10-09 09:59:23 -04001036
DR695Hccff30b2017-02-17 18:44:24 -05001037 Set Browser Implicit Wait ${GLOBAL_SELENIUM_BROWSER_IMPLICIT_WAIT}
DR695Hbf5a3a32017-06-30 13:09:57 -04001038 Log Logging in to ${ASDC_FE_ENDPOINT}${PATH}
DR695Hccff30b2017-02-17 18:44:24 -05001039 Title Should Be ASDC
Jerry Floode2a48d72017-06-21 15:06:29 -04001040 Wait Until Page Contains Element xpath=//div/a[text()='SDC'] ${GLOBAL_SELENIUM_BROWSER_WAIT_TIMEOUT}
DR695Hbf5a3a32017-06-30 13:09:57 -04001041 Log Logged in to ${ASDC_FE_ENDPOINT}${PATH}
Jerry Flood6bd1afa2017-10-09 09:59:23 -04001042
1043
1044Create Multi Part
1045 [Arguments] ${addTo} ${partName} ${filePath} ${contentType}=${None}
1046 ${fileData}= Get Binary File ${filePath}
1047 ${fileDir} ${fileName}= Split Path ${filePath}
1048 ${partData}= Create List ${fileName} ${fileData} ${contentType}
1049 Set To Dictionary ${addTo} ${partName}=${partData}
Brian Freemanf940ee92018-05-25 21:09:05 -05001050