blob: 8830fe160fdad17cb8a08287216b4235dfda2fe6 [file] [log] [blame]
DR695Hccff30b2017-02-17 18:44:24 -05001*** Settings ***
2Documentation The main interface for interacting with ASDC. It handles low level stuff like managing the http request library and DCAE required fields
Brian Freeman2e1d0ff2019-01-23 09:38:13 -05003Library RequestsLibrary
4Library UUID
5Library JSONUtils
DR695Hccff30b2017-02-17 18:44:24 -05006Library OperatingSystem
7Library Collections
Brian Freeman2e1d0ff2019-01-23 09:38:13 -05008Library ExtendedSelenium2Library
bdfreeman1421b2a49512018-11-25 07:32:19 -05009Library HttpLibrary.HTTP
Brian Freeman2e1d0ff2019-01-23 09:38:13 -050010Library String
11Library StringTemplater
Yang Xu7037e542018-12-28 01:19:26 -050012Library ArchiveLibrary
13Library HEATUtils
Brian Freeman15033782019-03-22 15:48:55 -050014Library DateTime
DR695Hccff30b2017-02-17 18:44:24 -050015Resource global_properties.robot
16Resource browser_setup.robot
17Resource json_templater.robot
Brian Freeman2e1d0ff2019-01-23 09:38:13 -050018
DR695Hccff30b2017-02-17 18:44:24 -050019*** Variables ***
20${ASDC_DESIGNER_USER_ID} cs0008
21${ASDC_TESTER_USER_ID} jm0007
22${ASDC_GOVERNOR_USER_ID} gv0001
23${ASDC_OPS_USER_ID} op0001
24${ASDC_HEALTH_CHECK_PATH} /sdc1/rest/healthCheck
25${ASDC_VENDOR_LICENSE_MODEL_PATH} /onboarding-api/v1.0/vendor-license-models
26${ASDC_VENDOR_SOFTWARE_PRODUCT_PATH} /onboarding-api/v1.0/vendor-software-products
27${ASDC_VENDOR_KEY_GROUP_PATH} /license-key-groups
28${ASDC_VENDOR_ENTITLEMENT_POOL_PATH} /entitlement-pools
29${ASDC_VENDOR_FEATURE_GROUP_PATH} /feature-groups
30${ASDC_VENDOR_LICENSE_AGREEMENT_PATH} /license-agreements
31${ASDC_VENDOR_ACTIONS_PATH} /actions
Jerry Floode2a48d72017-06-21 15:06:29 -040032${ASDC_VENDOR_SOFTWARE_UPLOAD_PATH} /orchestration-template-candidate
Yang Xu2ec80382018-11-01 12:30:37 -040033${ASDC_FE_CATALOG_RESOURCES_PATH} /sdc1/feProxy/rest/v1/catalog/resources
Brian Freemaneef7c6f2018-11-16 18:42:21 -050034${ASDC_FE_CATALOG_SERVICES_PATH} /sdc1/feProxy/rest/v1/catalog/services
DR695Hccff30b2017-02-17 18:44:24 -050035${ASDC_CATALOG_RESOURCES_PATH} /sdc2/rest/v1/catalog/resources
36${ASDC_CATALOG_SERVICES_PATH} /sdc2/rest/v1/catalog/services
37${ASDC_CATALOG_INACTIVE_RESOURCES_PATH} /sdc2/rest/v1/inactiveComponents/resource
Brian Freemaneef7c6f2018-11-16 18:42:21 -050038${ASDC_CATALOG_RESOURCES_QUERY_PATH} /sdc2/rest/v1/catalog/resources/resourceName
DR695Hccff30b2017-02-17 18:44:24 -050039${ASDC_CATALOG_INACTIVE_SERVICES_PATH} /sdc2/rest/v1/inactiveComponents/service
40${ASDC_CATALOG_LIFECYCLE_PATH} /lifecycleState
41${ASDC_CATALOG_SERVICE_RESOURCE_INSTANCE_PATH} /resourceInstance
Brian Freeman2e1d0ff2019-01-23 09:38:13 -050042${ASDC_CATALOG_SERVICE_RESOURCE_ARTIFACT_PATH} /artifacts
DR695Hccff30b2017-02-17 18:44:24 -050043${ASDC_CATALOG_SERVICE_DISTRIBUTION_STATE_PATH} /distribution-state
44${ASDC_CATALOG_SERVICE_DISTRIBUTION_PATH} /distribution
45${ASDC_DISTRIBUTION_STATE_APPROVE_PATH} /approve
46${ASDC_CATALOG_SERVICE_DISTRIBUTION_ACTIVATE_PATH} /distribution/PROD/activate
47${ASDC_LICENSE_MODEL_TEMPLATE} robot/assets/templates/asdc/license_model.template
48${ASDC_KEY_GROUP_TEMPLATE} robot/assets/templates/asdc/key_group.template
49${ASDC_ENTITLEMENT_POOL_TEMPLATE} robot/assets/templates/asdc/entitlement_pool.template
50${ASDC_FEATURE_GROUP_TEMPLATE} robot/assets/templates/asdc/feature_group.template
51${ASDC_LICENSE_AGREEMENT_TEMPLATE} robot/assets/templates/asdc/license_agreement.template
52${ASDC_ACTION_TEMPLATE} robot/assets/templates/asdc/action.template
53${ASDC_SOFTWARE_PRODUCT_TEMPLATE} robot/assets/templates/asdc/software_product.template
Brian Freeman2e1d0ff2019-01-23 09:38:13 -050054${ASDC_ARTIFACT_UPLOAD_TEMPLATE} robot/assets/templates/asdc/artifact_upload.template
DR695Hccff30b2017-02-17 18:44:24 -050055${ASDC_CATALOG_RESOURCE_TEMPLATE} robot/assets/templates/asdc/catalog_resource.template
56${ASDC_USER_REMARKS_TEMPLATE} robot/assets/templates/asdc/user_remarks.template
57${ASDC_CATALOG_SERVICE_TEMPLATE} robot/assets/templates/asdc/catalog_service.template
58${ASDC_RESOURCE_INSTANCE_TEMPLATE} robot/assets/templates/asdc/resource_instance.template
Yang Xu2ec80382018-11-01 12:30:37 -040059${ASDC_RESOURCE_INSTANCE_VNF_PROPERTIES_TEMPLATE} robot/assets/templates/asdc/catalog_vnf_properties.template
60${ASDC_RESOURCE_INSTANCE_VNF_INPUTS_TEMPLATE} robot/assets/templates/asdc/catalog_vnf_inputs.template
Brian Freemaneef7c6f2018-11-16 18:42:21 -050061${SDC_CATALOG_NET_RESOURCE_INPUT_TEMPLATE} robot/assets/templates/asdc/catalog_net_input_properties.template
bdfreeman1421b2a49512018-11-25 07:32:19 -050062${ASDC_ALLOTTED_RESOURCE_CATALOG_RESOURCE_TEMPLATE} robot/assets/templates/asdc/catalog_resource_alloted_resource.template
63${SDC_CATALOG_ALLOTTED_RESOURCE_PROPERTIES_TEMPLATE} robot/assets/templates/asdc/catalog_allotted_properties.template
64${SDC_CATALOG_ALLOTTED_RESOURCE_INPUTS_TEMPLATE} robot/assets/templates/asdc/catalog_allotted_inputs.template
Brian Freeman2e1d0ff2019-01-23 09:38:13 -050065${SDC_CATALOG_DEPLOYMENT_ARTIFACT_PATH} robot/assets/asdc/blueprints/
Brian Freemanf508ab22018-03-15 21:19:41 -050066${ASDC_FE_ENDPOINT} ${GLOBAL_ASDC_SERVER_PROTOCOL}://${GLOBAL_INJECTED_SDC_FE_IP_ADDR}:${GLOBAL_ASDC_FE_PORT}
67${ASDC_BE_ENDPOINT} ${GLOBAL_ASDC_SERVER_PROTOCOL}://${GLOBAL_INJECTED_SDC_BE_IP_ADDR}:${GLOBAL_ASDC_BE_PORT}
Brian Freeman44b8bb32018-05-03 21:08:42 -050068${ASDC_BE_ONBOARD_ENDPOINT} ${GLOBAL_ASDC_SERVER_PROTOCOL}://${GLOBAL_INJECTED_SDC_BE_ONBOARD_IP_ADDR}:${GLOBAL_ASDC_BE_ONBOARD_PORT}
DR695Hbf5a3a32017-06-30 13:09:57 -040069
DR695Hccff30b2017-02-17 18:44:24 -050070*** Keywords ***
71Distribute Model From ASDC
72 [Documentation] goes end to end creating all the asdc objects based ona model and distributing it to the systems. it then returns the service name, vf name and vf module name
Brian Freemaneef7c6f2018-11-16 18:42:21 -050073 [Arguments] ${model_zip_path} ${catalog_service_name}= ${cds}= ${service}=
bdfreeman1421b2a49512018-11-25 07:32:19 -050074 # For Testing use random service names
Brian Freemaneef7c6f2018-11-16 18:42:21 -050075 #${random}= Get Current Date
76 #${catalog_service_id}= Add ASDC Catalog Service ${catalog_service_name}_${random}
jf986075010a42017-02-22 16:52:54 -050077 ${catalog_service_id}= Add ASDC Catalog Service ${catalog_service_name}
DR695Hccff30b2017-02-17 18:44:24 -050078 ${catalog_resource_ids}= Create List
Jerry Flood3a169a32017-12-01 12:39:10 -050079 ${catalog_resources}= Create Dictionary
Brian Freemanee02b312019-02-04 20:36:08 -050080 ##### TODO: Support for Multiple resources of one type in a service ######
81 # The zip list is the resources - no mechanism to indicate more than 1 of the items in the zip list
82 # GLOBAL_SERVICE_VNF_MAPPING has the logical mapping but its not the same key as model_zip_path
83 # ${vnflist}= Get From Dictionary ${GLOBAL_SERVICE_VNF_MAPPING} ${service}
84 # Save the resource_id in a dictionary keyed byt the resource NAme in the zipfile name (vFWDT_vFWSNK.zip or vFWDT_vPKG.zip)
85 # Create the resources but dont immediately add resource
86 # Add Resource to Service in a separate FOR loop
87 # TODO: CHECK vCPE models to make sure they aren't broken with the split
88 ${resource_types}= Create Dictionary
89
DR695Hccff30b2017-02-17 18:44:24 -050090 : FOR ${zip} IN @{model_zip_path}
Yang Xu2ec80382018-11-01 12:30:37 -040091 \ ${loop_catalog_resource_id}= Setup ASDC Catalog Resource ${zip} ${cds}
Brian Freemanee02b312019-02-04 20:36:08 -050092 # zip can be vFW.zip or vFWDT_VFWSNK.zip
93 \ ${resource_type_match}= Get Regexp Matches ${zip} ${service}_(.*)\.zip 1
Brian Freeman12ff1842019-02-13 13:54:48 -050094 # Need to be able to distribute preload for vFWCL vFWSNK and vFWDT vFWSNK to prepend service to vnf_type
95 \ ${resource_type_string}= Set Variable If len(${resource_type_match})==0 ${service} ${service}${resource_type_match[0]}
Brian Freemanee02b312019-02-04 20:36:08 -050096 \ Set To Dictionary ${resource_types} ${resource_type_string} ${loop_catalog_resource_id}
Jerry Floode2a48d72017-06-21 15:06:29 -040097 \ Append To List ${catalog_resource_ids} ${loop_catalog_resource_id}
Brian Freemanee02b312019-02-04 20:36:08 -050098
99
100 ${vnflist}= Get From Dictionary ${GLOBAL_SERVICE_VNF_MAPPING} ${service}
101
102 # Spread the icons on the pallette starting on the left
103 ${xoffset}= Set Variable ${0}
104
105 : FOR ${vnf} IN @{vnflist}
Brian Freemanee02b312019-02-04 20:36:08 -0500106 \ ${loop_catalog_resource_resp}= Get ASDC Catalog Resource ${resource_types['${vnf}']}
107 \ Set To Dictionary ${catalog_resources} ${resource_types['${vnf}']}=${loop_catalog_resource_resp}
108 \ ${catalog_resource_unique_name}= Add ASDC Resource Instance ${catalog_service_id} ${resource_types['${vnf}']} ${loop_catalog_resource_resp['name']} ${xoffset}
109 \ ${xoffset}= Set Variable ${xoffset+100}
Brian Freemaneef7c6f2018-11-16 18:42:21 -0500110 #
111 # do this here because the loop_catalog_resource_resp is different format after adding networks
112 ${vf_module}= Find Element In Array ${loop_catalog_resource_resp['groups']} type org.openecomp.groups.VfModule
113 #
114 # do network
115 ${networklist}= Get From Dictionary ${GLOBAL_SERVICE_GEN_NEUTRON_NETWORK_MAPPING} ${service}
Brian Freemaneef7c6f2018-11-16 18:42:21 -0500116 ${generic_neutron_net_uuid}= Get Generic NeutronNet UUID
117 :FOR ${network} in @{networklist}
118 \ ${loop_catalog_resource_id}= Set Variable ${generic_neutron_net_uuid}
119 \ Append To List ${catalog_resource_ids} ${loop_catalog_resource_id}
120 \ ${loop_catalog_resource_resp}= Get ASDC Catalog Resource ${loop_catalog_resource_id}
Brian Freemaneef7c6f2018-11-16 18:42:21 -0500121 \ ${loop_catalog_resource_id}= Add ASDC Resource Instance ${catalog_service_id} ${loop_catalog_resource_id} ${network} ${xoffset} ${0}
122 \ ${nf_role}= Convert To Lowercase ${network}
123 \ Setup SDC Catalog Resource GenericNeutronNet Properties ${catalog_service_id} ${nf_role} ${loop_catalog_resource_id}
124 \ ${xoffset}= Set Variable ${xoffset+100}
125 \ Set To Dictionary ${catalog_resources} ${loop_catalog_resource_id}=${loop_catalog_resource_resp}
DR695Hccff30b2017-02-17 18:44:24 -0500126 ${catalog_service_resp}= Get ASDC Catalog Service ${catalog_service_id}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500127 #
128 # do deployment artifacts
129 #
130 ${deploymentlist}= Get From Dictionary ${GLOBAL_SERVICE_DEPLOYMENT_ARTIFACT_MAPPING} ${service}
131 :FOR ${deployment} IN @{deploymentlist}
132 \ ${loop_catalog_resource_resp}= Get ASDC Catalog Resource ${loop_catalog_resource_id}
133 \ 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 -0500134 Checkin ASDC Catalog Service ${catalog_service_id}
135 Request Certify ASDC Catalog Service ${catalog_service_id}
136 Start Certify ASDC Catalog Service ${catalog_service_id}
137 # on certify it gets a new id
138 ${catalog_service_id}= Certify ASDC Catalog Service ${catalog_service_id}
139 Approve ASDC Catalog Service ${catalog_service_id}
Brian Freeman796b9eb2018-10-08 08:23:20 -0500140 : FOR ${DIST_INDEX} IN RANGE 1
Brian Freeman18df8912018-05-25 13:27:29 -0500141 \ Log Distribution Attempt ${DIST_INDEX}
142 \ Distribute ASDC Catalog Service ${catalog_service_id}
143 \ ${catalog_service_resp}= Get ASDC Catalog Service ${catalog_service_id}
Brian Freemanf940ee92018-05-25 21:09:05 -0500144 \ ${status} ${_} = Run Keyword And Ignore Error Loop Over Check Catalog Service Distributed ${catalog_service_resp['uuid']}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500145 \ Exit For Loop If '${status}'=='PASS'
Brian Freeman8c002d52018-07-30 19:35:36 -0500146 Should Be Equal As Strings ${status} PASS
Jerry Flood3a169a32017-12-01 12:39:10 -0500147 [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 -0500148
bdfreeman1421b2a49512018-11-25 07:32:19 -0500149Distribute vCPEResCust Model From ASDC
150 [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
151 [Arguments] ${model_zip_path} ${catalog_service_name}= ${cds}= ${service}=
152 # For testing use random service name
Brian Freeman9c42ae12018-11-27 14:33:27 -0500153 #${random}= Get Current Date
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500154 ${uuid}= Generate UUID
155 ${random}= Evaluate str("${uuid}")[:4]
156 ${catalog_service_id}= Add ASDC Catalog Service ${catalog_service_name}_${random}
157 # catalog_service_name already
158 #${catalog_service_id}= Add ASDC Catalog Service ${catalog_service_name}
bdfreeman1421b2a49512018-11-25 07:32:19 -0500159 Log To Console ${\n}ServiceName: ${catalog_service_name}_${random}
160 #${catalog_service_id}= Add ASDC Catalog Service ${catalog_service_name}
161 ${catalog_resource_ids}= Create List
162 ${catalog_resources}= Create Dictionary
163 : FOR ${zip} IN @{model_zip_path}
164 \ ${loop_catalog_resource_id}= Setup ASDC Catalog Resource ${zip} ${cds}
165 \ Append To List ${catalog_resource_ids} ${loop_catalog_resource_id}
166 \ ${loop_catalog_resource_resp}= Get ASDC Catalog Resource ${loop_catalog_resource_id}
167 \ Add ASDC Resource Instance ${catalog_service_id} ${loop_catalog_resource_id} ${loop_catalog_resource_resp['name']}
168 \ Set To Dictionary ${catalog_resources} ${loop_catalog_resource_id}=${loop_catalog_resource_resp}
169 #
170 # do this here because the loop_catalog_resource_resp is different format after adding networks
171 ${vf_module}= Find Element In Array ${loop_catalog_resource_resp['groups']} type org.openecomp.groups.VfModule
172 #
173 # do allottedresource
174 ${allottedresource_list}= Create List TunnelXConn BRG
175 # Example data
176 #${tunnelxconn_dict}= Create Dictionary invariantUUID=8ac029e7-77aa-40d4-b28a-d17c02d5fd82 UUID=2ddc1b37-d7da-4aab-b645-ed7db34a5d03 node_type=org.openecomp.service.Demovcpevgmux
177 #${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 -0500178 # Create /tmp/vcpe_allotted_resource_data.json with demo vgmux and brgemu CSARs
179 Create Allotted Resource Data File
Brian Freemana8ceb692019-03-03 09:37:54 -0500180 ${vcpe_ar_data_file} OperatingSystem.Get File /tmp/vcpe_allotted_resource_data.json
bdfreeman1421b2a49512018-11-25 07:32:19 -0500181 ${tunnelxconn_invariant_uuid} Get Json Value ${vcpe_ar_data_file} /tunnelxconn/invariantUUID
182 ${tunnelxconn_uuid} Get Json Value ${vcpe_ar_data_file} /tunnelxconn/UUID
183 ${tunnelxconn_node_type} Get Json Value ${vcpe_ar_data_file} /tunnelxconn/node_type
184 ${brg_invariant_uuid} Get Json Value ${vcpe_ar_data_file} /brg/invariantUUID
185 ${brg_uuid} Get Json Value ${vcpe_ar_data_file} /brg/UUID
186 ${brg_node_type} Get Json Value ${vcpe_ar_data_file} /brg/node_type
187 ${tunnelxconn_dict}= Create Dictionary invariantUUID=${tunnelxconn_invariant_uuid} UUID=${tunnelxconn_uuid} node_type=${tunnelxconn_node_type}
188 ${brg_dict}= Create Dictionary invariantUUID=${brg_invariant_uuid} UUID=${brg_uuid} node_type=${brg_node_type}
189 ${xoffset}= Set Variable ${100}
190 ${allottedresource_uuid}= Get AllottedResource UUID
191 ${random}= Get Current Date
192 :FOR ${allottedresource} in @{allottedresource_list}
193 \ ${loop_catalog_resource_id}= Set Variable ${allottedresource_uuid}
194 \ Append To List ${catalog_resource_ids} ${loop_catalog_resource_id}
195 \ ${loop_catalog_resource_id}= Add ASDC Allotted Resource Catalog Resource 00000 ${allottedresource}_${random} ONAP ${loop_catalog_resource_id} ${allottedresource}
196 \ ${loop_catalog_resource_id2}= Add ASDC Resource Instance To Resource ${loop_catalog_resource_id} ${allottedresource_uuid} ${allottedresource} ${xoffset} ${0}
197 \ ${loop_catalog_resource_resp}= Get ASDC Catalog Resource ${loop_catalog_resource_id}
198 #
199 # Set the properties to relate to the brg and gmux
200 #
201 \ 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']}
202 \ 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']}
203 #
204 # Set the nf_role nf_type
205 #
206 \ Run Keyword If '${allottedresource}'=='TunnelXConn' Setup SDC Catalog Resource AllottedResource Inputs ${catalog_service_id} ${allottedresource} ${loop_catalog_resource_id}
207 \ 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 -0500208 \ ${loop_catalog_resource_id}= Certify ASDC Catalog Resource ${loop_catalog_resource_id} ${ASDC_DESIGNER_USER_ID}
209 \ Add ASDC Resource Instance ${catalog_service_id} ${loop_catalog_resource_id} ${loop_catalog_resource_resp['name']}
bdfreeman1421b2a49512018-11-25 07:32:19 -0500210 \ Set To Dictionary ${catalog_resources} ${loop_catalog_resource_id}=${loop_catalog_resource_resp}
211 ${catalog_service_resp}= Get ASDC Catalog Service ${catalog_service_id}
212 Checkin ASDC Catalog Service ${catalog_service_id}
213 Request Certify ASDC Catalog Service ${catalog_service_id}
214 Start Certify ASDC Catalog Service ${catalog_service_id}
215 # on certify it gets a new id
216 ${catalog_service_id}= Certify ASDC Catalog Service ${catalog_service_id}
217 Approve ASDC Catalog Service ${catalog_service_id}
218 : FOR ${DIST_INDEX} IN RANGE 1
219 \ Log Distribution Attempt ${DIST_INDEX}
220 \ Distribute ASDC Catalog Service ${catalog_service_id}
221 \ ${catalog_service_resp}= Get ASDC Catalog Service ${catalog_service_id}
222 \ ${status} ${_} = Run Keyword And Ignore Error Loop Over Check Catalog Service Distributed ${catalog_service_resp['uuid']}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500223 \ Exit For Loop If '${status}'=='PASS'
bdfreeman1421b2a49512018-11-25 07:32:19 -0500224 Should Be Equal As Strings ${status} PASS
225 [Return] ${catalog_service_resp['name']} ${loop_catalog_resource_resp['name']} ${vf_module} ${catalog_resource_ids} ${catalog_service_id} ${catalog_resources}
226
227
Yang Xu7037e542018-12-28 01:19:26 -0500228Create Allotted Resource Data File
229 [Documentation] Create alloted resource json data file
230 [Arguments]
231 ${allotted_resource}= Create Dictionary
232 ${allotted_csar_map}= Create Dictionary
233 Set To Dictionary ${allotted_csar_map} tunnelxconn=service-Demovcpevgmux-csar.csar
234 Set To Dictionary ${allotted_csar_map} brg=service-Demovcpevbrgemu-csar.csar
235 ${keys}= Get Dictionary Keys ${allotted_csar_map}
236 :for ${key} in @{keys}
237 \ ${csar}= Get From Dictionary ${allotted_csar_map} ${key}
238 \ ${dir} ${ext}= Split String From Right ${csar} - 1
239 \ Extract Zip File /tmp/csar/${csar} /tmp/csar/${dir}
240 \ ${template}= Catenate /tmp/csar/${dir}/Definitions/${dir}-template.yml
241 \ ${json_str}= Template Yaml To Json ${template}
242 \ ${json_obj}= To Json ${json_str}
243 \ ${attrs}= Create Dictionary
244 \ Set To Dictionary ${attrs} invariantUUID=${json_obj['metadata']['invariantUUID']}
245 \ Set To Dictionary ${attrs} UUID=${json_obj['metadata']['UUID']}
246 \ Set To Dictionary ${attrs} node_type=${json_obj['topology_template']['substitution_mappings']['node_type']}
247 \ Set To Dictionary ${allotted_resource} ${key}=${attrs}
248 ${result_str}= Evaluate json.dumps(${allotted_resource}, indent=2) json
249 Log To Console ${result_str}
250 Create File /tmp/vcpe_allotted_resource_data.json ${result_str}
Yang Xu7037e542018-12-28 01:19:26 -0500251
bdfreeman14211ad11d92018-11-17 18:47:37 +0000252Download CSAR
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500253 [Documentation] Download CSAR
bdfreeman14211ad11d92018-11-17 18:47:37 +0000254 [Arguments] ${catalog_service_id} ${save_directory}=/tmp/csar
255 # get meta data
256 ${resp}= Run ASDC Get Request ${ASDC_CATALOG_SERVICES_PATH}/${catalog_service_id}/filteredDataByParams?include=toscaArtifacts ${ASDC_DESIGNER_USER_ID} ${ASDC_BE_ENDPOINT}
257 ${csar_resource_id}= Set Variable ${resp.json()['toscaArtifacts']['assettoscacsar']['uniqueId']}
258 ${resp}= Run ASDC Get Request ${ASDC_CATALOG_SERVICES_PATH}/${catalog_service_id}/artifacts/${csar_resource_id}
259 ${csar_file_name}= Set Variable ${resp.json()['artifactName']}
260 ${base64Obj}= Set Variable ${resp.json()['base64Contents']}
261 ${binObj}= Evaluate base64.b64decode("${base64Obj}") modules=base64
262 Create Binary File ${save_directory}/${csar_file_name} ${binObj}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500263 Log To Console Downloaded:${csar_file_name}
bdfreeman14211ad11d92018-11-17 18:47:37 +0000264 [Return]
265
Brian Freemaneef7c6f2018-11-16 18:42:21 -0500266
267Get Generic NeutronNet UUID
268 [Documentation] Lookoup the UUID of the Generic NeutronNetwork Resource
Brian Freemaneef7c6f2018-11-16 18:42:21 -0500269 ${resp}= Run ASDC Get Request ${ASDC_CATALOG_RESOURCES_QUERY_PATH}/Generic%20NeutronNet/resourceVersion/1.0 ${ASDC_DESIGNER_USER_ID} ${ASDC_BE_ENDPOINT}
270 [Return] ${resp.json()['allVersions']['1.0']}
271
bdfreeman1421b2a49512018-11-25 07:32:19 -0500272Get AllottedResource UUID
273 [Documentation] Lookoup the UUID of the Allotted Resource
274 # if this fails then the AllottedResource template got deleted from SDC by mistake
275 ${resp}= Run ASDC Get Request ${ASDC_CATALOG_RESOURCES_QUERY_PATH}/AllottedResource/resourceVersion/1.0 ${ASDC_DESIGNER_USER_ID} ${ASDC_BE_ENDPOINT}
276 [Return] ${resp.json()['allVersions']['1.0']}
277
Brian Freeman18df8912018-05-25 13:27:29 -0500278Loop Over Check Catalog Service Distributed
Gary Wu58d58532018-07-27 16:02:51 -0700279 [Arguments] ${catalog_service_id}
Brian Freemanadaa2372018-10-24 12:25:22 -0500280 # SO watchdog timeout is 300 seconds need buffer
bdfreeman1421b2a49512018-11-25 07:32:19 -0500281 ${dist_status}= Set Variable CONTINUE
282 : FOR ${CHECK_INDEX} IN RANGE 20
Brian Freemanadaa2372018-10-24 12:25:22 -0500283 \ ${status} ${_} = Run Keyword And Ignore Error Check Catalog Service Distributed ${catalog_service_id} ${dist_status}
Gary Wu58d58532018-07-27 16:02:51 -0700284 \ Sleep 20s
Brian Freemanf940ee92018-05-25 21:09:05 -0500285 \ Return From Keyword If '${status}'=='PASS'
bdfreeman1421b2a49512018-11-25 07:32:19 -0500286 # need a way to exit the loop early on DISTRIBUTION_COMPLETE_ERROR ${dist_status} doesnt work
287 #\ Exit For Loop If '${dist_status}'=='EXIT'
288 Should Be Equal As Strings ${status} PASS
289 [Return]
Brian Freeman18df8912018-05-25 13:27:29 -0500290
DR695Hccff30b2017-02-17 18:44:24 -0500291Setup ASDC Catalog Resource
292 [Documentation] Creates all the steps a vf needs for an asdc catalog resource and returns the id
Yang Xu2ec80382018-11-01 12:30:37 -0400293 [Arguments] ${model_zip_path} ${cds}=
Brian Freemanb568e5e2018-04-05 21:03:38 -0500294 ${license_model_id} ${license_model_version_id}= Add ASDC License Model
Brian Freeman15033782019-03-22 15:48:55 -0500295
296
297 ${license_temp_date}= Get Current Date
298 ${license_start_date}= Get Current Date result_format=%m/%d/%Y
299 ${license_end_date}= Add Time To Date ${license_temp_date} 365 days result_format=%m/%d/%Y
300 ${key_group_id}= Add ASDC License Group ${license_model_id} ${license_model_version_id} ${license_start_date} ${license_end_date}
301 ${pool_id}= Add ASDC Entitlement Pool ${license_model_id} ${license_model_version_id} ${license_start_date} ${license_end_date}
302
Brian Freemanb568e5e2018-04-05 21:03:38 -0500303 ${feature_group_id}= Add ASDC Feature Group ${license_model_id} ${key_group_id} ${pool_id} ${license_model_version_id}
304 ${license_agreement_id}= Add ASDC License Agreement ${license_model_id} ${feature_group_id} ${license_model_version_id}
305 Submit ASDC License Model ${license_model_id} ${license_model_version_id}
306 ${license_model_resp}= Get ASDC License Model ${license_model_id} ${license_model_version_id}
Brian Freeman9c42ae12018-11-27 14:33:27 -0500307 ${matches}= Get Regexp Matches ${model_zip_path} temp/(.*)\.zip 1
308 ${software_product_name_prefix}= Set Variable ${matches[0]}
309 ${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 -0500310 Upload ASDC Heat Package ${software_product_id} ${model_zip_path} ${software_product_version_id}
311 Validate ASDC Software Product ${software_product_id} ${software_product_version_id}
312 Submit ASDC Software Product ${software_product_id} ${software_product_version_id}
313 Package ASDC Software Product ${software_product_id} ${software_product_version_id}
314 ${software_product_resp}= Get ASDC Software Product ${software_product_id} ${software_product_version_id}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500315 ${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 -0400316 # Check if need to set up CDS properties
317 Run Keyword If '${cds}' == 'vfwng' Setup ASDC Catalog Resource CDS Properties ${catalog_resource_id}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500318
Brian Freeman391680a2018-08-11 15:20:58 -0500319 ${catalog_resource_id}= Certify ASDC Catalog Resource ${catalog_resource_id} ${ASDC_DESIGNER_USER_ID}
DR695Hccff30b2017-02-17 18:44:24 -0500320 [Return] ${catalog_resource_id}
Brian Freemaneef7c6f2018-11-16 18:42:21 -0500321
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500322
323Setup SDC Catalog Resource Deployment Artifact Properties
324 [Documentation] Set up Deployment Artiface properties
325 [Arguments] ${catalog_service_id} ${catalog_parent_service_id} ${catalog_resource_unique_id} ${blueprint_file}
326 ${resp}= Get ASDC Catalog Resource Component Instances Properties ${catalog_service_id}
327 #${resp}= Get ASDC Catalog Resource Deployment Artifact Properties ${catalog_service_id}
Brian Freemana8ceb692019-03-03 09:37:54 -0500328 ${blueprint_data} OperatingSystem.Get File ${SDC_CATALOG_DEPLOYMENT_ARTIFACT_PATH}${blueprint_file}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500329 ${payloadData}= Evaluate base64.b64encode('''${blueprint_data}'''.encode('utf-8')) modules=base64
330 ${dict}= Create Dictionary artifactLabel=blueprint artifactName=${blueprint_file} artifactType=DCAE_INVENTORY_BLUEPRINT artifactGroupType=DEPLOYMENT description=${blueprint_file} payloadData=${payloadData}
331 ${data}= Fill JSON Template File ${ASDC_ARTIFACT_UPLOAD_TEMPLATE} ${dict}
332 # POST artifactUpload to resource
333 ${artifact_upload_path}= Catenate ${ASDC_CATALOG_SERVICES_PATH}/${catalog_service_id}/resourceInstance/${catalog_resource_unique_id}${ASDC_CATALOG_SERVICE_RESOURCE_ARTIFACT_PATH}
334 ${resp}= Run ASDC MD5 Post Request ${artifact_upload_path} ${data} ${ASDC_DESIGNER_USER_ID}
335 Should Be Equal As Strings ${resp.status_code} 200
336 [Return] ${resp}
337
338
Brian Freemaneef7c6f2018-11-16 18:42:21 -0500339Setup SDC Catalog Resource GenericNeutronNet Properties
bdfreeman1421b2a49512018-11-25 07:32:19 -0500340 [Documentation] Set up GenericNeutronNet properties and inputs
Brian Freemaneef7c6f2018-11-16 18:42:21 -0500341 [Arguments] ${catalog_service_id} ${nf_role} ${catalog_parent_service_id}
Brian Freemaneef7c6f2018-11-16 18:42:21 -0500342 ${resp}= Get ASDC Catalog Resource Component Instances Properties ${catalog_service_id}
Brian Freemaneef7c6f2018-11-16 18:42:21 -0500343 ${componentInstances} Set Variable @{resp['componentInstancesProperties']}
344 # componentInstances can have 1 or more than 1 entry
345 ${passed}= Run Keyword And Return Status Evaluate type(${componentInstances})
346 ${type}= Run Keyword If ${passed} Evaluate type(${componentInstances})
347 ${componentInstancesList}= Run Keyword If "${type}"!="<type 'list'>" Create List ${componentInstances}
348 ... ELSE Set Variable ${componentInstances}
349 :FOR ${item} IN @{componentInstancesList}
350 \ ${test} ${v}= Run Keyword and Ignore Error Should Contain ${item} ${nf_role}
351 \ Run Keyword If '${test}' == 'FAIL' Continue For Loop
352 \ ${componentInstance1}= Set Variable ${item}
353 :FOR ${comp} IN @{resp['componentInstancesProperties']["${componentInstance1}"]}
354 \ ${name} Set Variable ${comp['name']}
355 \ ${test} ${v}= Run Keyword and Ignore Error Should Contain ${name} network_role
356 \ Run Keyword If '${test}' == 'FAIL' Continue For Loop
357 \ ${description} Set Variable ${comp['description']}
358 \ ${description}= Replace String ${description} ${\n} \
359 \ ${uniqueId} Set Variable ${comp['uniqueId']}
360 \ ${parentUniqueId} Set Variable ${comp['parentUniqueId']}
361 \ ${ownerId} Set Variable ${comp['ownerId']}
362 \ ${dict}= Create Dictionary parentUniqueId=${parentUniqueId} ownerId=${ownerId} uniqueId=${uniqueId} description=${description}
363 \ Run Keyword If '${name}'=='network_role' Set To Dictionary ${dict} name=${name} value=${nf_role}
bdfreeman1421b2a49512018-11-25 07:32:19 -0500364 \ ${data}= Fill JSON Template File ${SDC_CATALOG_NET_RESOURCE_INPUT_TEMPLATE} ${dict}
Brian Freemaneef7c6f2018-11-16 18:42:21 -0500365 \ ${response}= Set ASDC Catalog Resource Component Instance Properties ${catalog_parent_service_id} ${catalog_service_id} ${data}
366 #\ Log To Console resp=${response}
367 [Return]
368
bdfreeman1421b2a49512018-11-25 07:32:19 -0500369
370Setup SDC Catalog Resource AllottedResource Properties
371 [Documentation] Set up Allotted Resource properties and inputs
372 [Arguments] ${catalog_service_id} ${nf_role} ${catalog_resource_id} ${invariantUUID} ${UUID} ${node_type}
373 # Set component instances properties
374 ${nf_role_lc}= Convert To Lowercase ${nf_role}
375 ${resp}= Get ASDC Catalog Resource Component Instances Properties For Resource ${catalog_resource_id}
376 ${componentInstances} Set Variable @{resp['componentInstancesProperties']}
377 # componentInstances can have 1 or more than 1 entry
378 ${passed}= Run Keyword And Return Status Evaluate type(${componentInstances})
379 ${type}= Run Keyword If ${passed} Evaluate type(${componentInstances})
380 ${componentInstancesList}= Run Keyword If "${type}"!="<type 'list'>" Create List ${componentInstances}
381 ... ELSE Set Variable ${componentInstances}
382 :FOR ${item} IN @{componentInstancesList}
383 \ ${test} ${v}= Run Keyword and Ignore Error Should Contain ${item} ${nf_role_lc}
384 \ Run Keyword If '${test}' == 'FAIL' Continue For Loop
385 \ ${componentInstance1}= Set Variable ${item}
386 ${dict}= Create Dictionary
387 :FOR ${comp} IN @{resp['componentInstancesProperties']["${componentInstance1}"]}
388 \ ${name} Set Variable ${comp['name']}
389 \ ${test} ${v}= Run Keyword and Ignore Error Should Contain Any ${name} network_role providing_service_invariant_uuid providing_service_uuid providing_service_name uniqueId
390 \ Run Keyword If '${test}' == 'FAIL' Continue For Loop
391 \ ${parentUniqueId} Set Variable ${comp['parentUniqueId']}
392 \ ${ownerId} Set Variable ${comp['ownerId']}
393 \ Set To Dictionary ${dict} parentUniqueId=${parentUniqueId} ownerId=${ownerId}
394 \ Run Keyword If '${name}'=='providing_service_invariant_uuid' Set To Dictionary ${dict} providing_service_invariant_uuid=${invariantUUID}
395 \ Run Keyword If '${name}'=='providing_service_uuid' Set To Dictionary ${dict} providing_service_uuid=${UUID}
396 \ Run Keyword If '${name}'=='providing_service_name' Set To Dictionary ${dict} providing_service_name=${node_type}
397 # Sets it for each loop but should be one
398 \ ${uniqueId} Set Variable ${comp['uniqueId']}
399 \ ${uniqueId} Fetch From Left ${uniqueId} .
400 \ Set To Dictionary ${dict} uniqueId=${uniqueId}
401 ${data}= Fill JSON Template File ${SDC_CATALOG_ALLOTTED_RESOURCE_PROPERTIES_TEMPLATE} ${dict}
402 ${response}= Set ASDC Catalog Resource Component Instance Properties For Resource ${catalog_resource_id} ${componentInstance1} ${data}
403 Log To Console resp=${response}
404
405
406Setup SDC Catalog Resource AllottedResource Inputs
407 [Documentation] Set up Allotted Resource inputs
408 [Arguments] ${catalog_service_id} ${nf_role} ${catalog_resource_id}
409 # Set vnf inputs
410 ${resp}= Get ASDC Catalog Resource Inputs ${catalog_resource_id}
411 ${dict}= Create Dictionary
412 :FOR ${comp} in @{resp['inputs']}
413 \ ${name} Set Variable ${comp['name']}
414 \ ${uid} Set Variable ${comp['uniqueId']}
415 \ Run Keyword If '${name}'=='nf_type' Set To Dictionary ${dict} nf_type=${nf_role} nf_type_uid=${uid}
416 \ Run Keyword If '${name}'=='nf_role' Set To Dictionary ${dict} nf_role=${nf_role} nf_role_uid=${uid}
417 ${data}= Fill JSON Template File ${SDC_CATALOG_ALLOTTED_RESOURCE_INPUTS_TEMPLATE} ${dict}
418 ${response}= Set ASDC Catalog Resource VNF Inputs ${catalog_resource_id} ${data}
419 [Return] ${response}
420
Yang Xu2ec80382018-11-01 12:30:37 -0400421Setup ASDC Catalog Resource CDS Properties
422 [Documentation] Set up vfwng VNF properties and inputs for CDS
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500423 [Arguments] ${catalog_resource_id}
Yang Xu2ec80382018-11-01 12:30:37 -0400424 # Set vnf module properties
425 ${resp}= Get ASDC Catalog Resource Component Instances ${catalog_resource_id}
426 :FOR ${comp} in @{resp['componentInstances']}
427 \ ${name} Set Variable ${comp['name']}
428 \ ${uniqueId} Set Variable ${comp['uniqueId']}
429 \ ${actualComponentUid} Set Variable ${comp['actualComponentUid']}
430 \ ${test} ${v}= Run Keyword and Ignore Error Should Contain ${name} abstract_
431 \ Run Keyword If '${test}' == 'FAIL' Continue For Loop
432 \ ${response}= Get ASDC Catalog Resource Component Instance Properties ${catalog_resource_id} ${uniqueId} ${actualComponentUid}
433 \ ${dict}= Create Dictionary parent_id=${response[6]['parentUniqueId']}
434 \ Run Keyword If '${name}'=='abstract_vfw' Set To Dictionary ${dict} nfc_function=vfw nfc_naming_policy=SDNC_Policy.ONAP_VFW_NAMING_TIMESTAMP
435 \ Run Keyword If '${name}'=='abstract_vpg' Set To Dictionary ${dict} nfc_function=vpg nfc_naming_policy=SDNC_Policy.ONAP_VPG_NAMING_TIMESTAMP
436 \ Run Keyword If '${name}'=='abstract_vsn' Set To Dictionary ${dict} nfc_function=vsn nfc_naming_policy=SDNC_Policy.ONAP_VSN_NAMING_TIMESTAMP
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500437 \ ${data}= Fill JSON Template File ${ASDC_RESOURCE_INSTANCE_VNF_PROPERTIES_TEMPLATE} ${dict}
438 \ ${response}= Set ASDC Catalog Resource Component Instance Properties ${catalog_resource_id} ${uniqueId} ${data}
Yang Xu2ec80382018-11-01 12:30:37 -0400439 \ Log To Console resp=${response}
440
441 # Set vnf inputs
442 ${resp}= Get ASDC Catalog Resource Inputs ${catalog_resource_id}
443 ${dict}= Create Dictionary
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500444 :FOR ${comp} in @{resp['inputs']}
Yang Xu2ec80382018-11-01 12:30:37 -0400445 \ ${name} Set Variable ${comp['name']}
446 \ ${uid} Set Variable ${comp['uniqueId']}
447 \ Run Keyword If '${name}'=='nf_function' Set To Dictionary ${dict} nf_function=ONAP-FIREWALL nf_function_uid=${uid}
448 \ Run Keyword If '${name}'=='nf_type' Set To Dictionary ${dict} nf_type=FIREWALL nf_type_uid=${uid}
449 \ Run Keyword If '${name}'=='nf_naming_code' Set To Dictionary ${dict} nf_naming_code=vfw nf_naming_code_uid=${uid}
450 \ Run Keyword If '${name}'=='nf_role' Set To Dictionary ${dict} nf_role=vFW nf_role_uid=${uid}
451 \ Run Keyword If '${name}'=='cloud_env' Set To Dictionary ${dict} cloud_env=openstack cloud_env_uid=${uid}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500452 ${data}= Fill JSON Template File ${ASDC_RESOURCE_INSTANCE_VNF_INPUTS_TEMPLATE} ${dict}
Yang Xu2ec80382018-11-01 12:30:37 -0400453 ${response}= Set ASDC Catalog Resource VNF Inputs ${catalog_resource_id} ${data}
454
DR695Hccff30b2017-02-17 18:44:24 -0500455Add ASDC License Model
456 [Documentation] Creates an asdc license model and returns its id
Jerry Floode2a48d72017-06-21 15:06:29 -0400457 ${uuid}= Generate UUID
458 ${shortened_uuid}= Evaluate str("${uuid}")[:23]
DR695Hccff30b2017-02-17 18:44:24 -0500459 ${map}= Create Dictionary vendor_name=${shortened_uuid}
460 ${data}= Fill JSON Template File ${ASDC_LICENSE_MODEL_TEMPLATE} ${map}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500461 ${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 -0500462 Should Be Equal As Strings ${resp.status_code} 200
Brian Freemanb568e5e2018-04-05 21:03:38 -0500463 [Return] ${resp.json()['itemId']} ${resp.json()['version']['id']}
DR695Hccff30b2017-02-17 18:44:24 -0500464Get ASDC License Model
465 [Documentation] gets an asdc license model by its id
Jerry Floode2a48d72017-06-21 15:06:29 -0400466 [Arguments] ${id} ${version_id}=0.1
Brian Freeman44b8bb32018-05-03 21:08:42 -0500467 ${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 -0400468 [Return] ${resp.json()}
469Get ASDC License Models
470 [Documentation] gets an asdc license model by its id
Brian Freeman44b8bb32018-05-03 21:08:42 -0500471 ${resp}= Run ASDC Get Request ${ASDC_VENDOR_LICENSE_MODEL_PATH} ${ASDC_DESIGNER_USER_ID} ${ASDC_BE_ONBOARD_ENDPOINT}
472
DR695Hccff30b2017-02-17 18:44:24 -0500473 [Return] ${resp.json()}
474Checkin ASDC License Model
475 [Documentation] checksin 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
478 ${data}= Fill JSON Template File ${ASDC_ACTION_TEMPLATE} ${map}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500479 ${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}
480 Should Be Equal As Strings ${resp.status_code} 200
DR695Hccff30b2017-02-17 18:44:24 -0500481 [Return] ${resp.json()}
482Submit ASDC License Model
483 [Documentation] submits an asdc license model by its id
Jerry Floode2a48d72017-06-21 15:06:29 -0400484 [Arguments] ${id} ${version_id}=0.1
DR695Hccff30b2017-02-17 18:44:24 -0500485 ${map}= Create Dictionary action=Submit
486 ${data}= Fill JSON Template File ${ASDC_ACTION_TEMPLATE} ${map}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500487 ${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 -0500488 Should Be Equal As Strings ${resp.status_code} 200
DR695Hccff30b2017-02-17 18:44:24 -0500489 [Return] ${resp.json()}
490Checkin ASDC Software Product
491 [Documentation] checksin an asdc Software Product by its id
Jerry Floode2a48d72017-06-21 15:06:29 -0400492 [Arguments] ${id} ${version_id}=0.1
DR695Hccff30b2017-02-17 18:44:24 -0500493 ${map}= Create Dictionary action=Checkin
Jerry Floode2a48d72017-06-21 15:06:29 -0400494 ${data}= Fill JSON Template File ${ASDC_ACTION_TEMPLATE} ${map}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500495 ${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 -0500496 Should Be Equal As Strings ${resp.status_code} 200
Jerry Floode2a48d72017-06-21 15:06:29 -0400497 [Return] ${resp.json()}
498Validate ASDC Software Product
499 [Documentation] checksin an asdc Software Product by its id
500 [Arguments] ${id} ${version_id}=0.1
501 ${data}= Catenate
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500502 ${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}
503 Should Be Equal As Strings ${resp.status_code} 200
DR695Hccff30b2017-02-17 18:44:24 -0500504 [Return] ${resp.json()}
505Submit ASDC Software Product
506 [Documentation] submits an asdc Software Product by its id
Jerry Floode2a48d72017-06-21 15:06:29 -0400507 [Arguments] ${id} ${version_id}=0.1
DR695Hccff30b2017-02-17 18:44:24 -0500508 ${map}= Create Dictionary action=Submit
Jerry Floode2a48d72017-06-21 15:06:29 -0400509 ${data}= Fill JSON Template File ${ASDC_ACTION_TEMPLATE} ${map}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500510 ${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}
511 Should Be Equal As Strings ${resp.status_code} 200
DR695Hccff30b2017-02-17 18:44:24 -0500512 [Return] ${resp.json()}
513Package ASDC Software Product
514 [Documentation] creates_package on an asdc Software Product by its id
Jerry Floode2a48d72017-06-21 15:06:29 -0400515 [Arguments] ${id} ${version_id}=0.1
DR695Hccff30b2017-02-17 18:44:24 -0500516 ${map}= Create Dictionary action=Create_Package
Jerry Floode2a48d72017-06-21 15:06:29 -0400517 ${data}= Fill JSON Template File ${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
Jerry Floode2a48d72017-06-21 15:06:29 -0400520 [Return] ${resp.json()}
DR695Hccff30b2017-02-17 18:44:24 -0500521Add ASDC Entitlement Pool
522 [Documentation] Creates an asdc Entitlement Pool and returns its id
Brian Freeman15033782019-03-22 15:48:55 -0500523 [Arguments] ${license_model_id} ${version_id}=0.1 ${license_start_date}="01/01/1960" ${license_end_date}="01/01/1961"
Jerry Floode2a48d72017-06-21 15:06:29 -0400524 ${uuid}= Generate UUID
525 ${shortened_uuid}= Evaluate str("${uuid}")[:23]
Brian Freeman15033782019-03-22 15:48:55 -0500526 ${map}= Create Dictionary entitlement_pool_name=${shortened_uuid} license_start_date=${license_start_date} license_end_date=${license_end_date}
Jerry Floode2a48d72017-06-21 15:06:29 -0400527 ${data}= Fill JSON Template File ${ASDC_ENTITLEMENT_POOL_TEMPLATE} ${map}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500528 ${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}
529 Should Be Equal As Strings ${resp.status_code} 200
DR695Hccff30b2017-02-17 18:44:24 -0500530 [Return] ${resp.json()['value']}
531Get ASDC Entitlement Pool
532 [Documentation] gets an asdc Entitlement Pool by its id
533 [Arguments] ${license_model_id} ${pool_id}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500534 ${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 -0500535 [Return] ${resp.json()}
536Add ASDC License Group
537 [Documentation] Creates an asdc license group and returns its id
Brian Freeman15033782019-03-22 15:48:55 -0500538 [Arguments] ${license_model_id} ${version_id}=1.0 ${license_start_date}="01/01/1960" ${license_end_date}="01/01/1961"
Jerry Floode2a48d72017-06-21 15:06:29 -0400539 ${uuid}= Generate UUID
540 ${shortened_uuid}= Evaluate str("${uuid}")[:23]
Brian Freeman15033782019-03-22 15:48:55 -0500541 ${map}= Create Dictionary key_group_name=${shortened_uuid} license_start_date=${license_start_date} license_end_date=${license_end_date}
Jerry Floode2a48d72017-06-21 15:06:29 -0400542 ${data}= Fill JSON Template File ${ASDC_KEY_GROUP_TEMPLATE} ${map}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500543 ${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}
544 Should Be Equal As Strings ${resp.status_code} 200
DR695Hccff30b2017-02-17 18:44:24 -0500545 [Return] ${resp.json()['value']}
546Get ASDC License Group
547 [Documentation] gets an asdc license group by its id
Jerry Floode2a48d72017-06-21 15:06:29 -0400548 [Arguments] ${license_model_id} ${group_id} ${version_id}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500549 ${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 -0500550 [Return] ${resp.json()}
551Add ASDC Feature Group
552 [Documentation] Creates an asdc Feature Group and returns its id
Jerry Floode2a48d72017-06-21 15:06:29 -0400553 [Arguments] ${license_model_id} ${key_group_id} ${entitlement_pool_id} ${version_id}=0.1
554 ${uuid}= Generate UUID
555 ${shortened_uuid}= Evaluate str("${uuid}")[:23]
Jerry Flood80ff9852017-08-11 06:47:14 -0400556 ${map}= Create Dictionary feature_group_name=${shortened_uuid} key_group_id=${key_group_id} entitlement_pool_id=${entitlement_pool_id} manufacturer_reference_number=mrn${shortened_uuid}
Jerry Floode2a48d72017-06-21 15:06:29 -0400557 ${data}= Fill JSON Template File ${ASDC_FEATURE_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_FEATURE_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']}
561Get ASDC Feature Group
562 [Documentation] gets an asdc Feature Group by its id
563 [Arguments] ${license_model_id} ${group_id}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500564 ${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 -0500565 [Return] ${resp.json()}
566Add ASDC License Agreement
567 [Documentation] Creates an asdc License Agreement and returns its id
Jerry Floode2a48d72017-06-21 15:06:29 -0400568 [Arguments] ${license_model_id} ${feature_group_id} ${version_id}=0.1
569 ${uuid}= Generate UUID
570 ${shortened_uuid}= Evaluate str("${uuid}")[:23]
DR695Hccff30b2017-02-17 18:44:24 -0500571 ${map}= Create Dictionary license_agreement_name=${shortened_uuid} feature_group_id=${feature_group_id}
Jerry Floode2a48d72017-06-21 15:06:29 -0400572 ${data}= Fill JSON Template File ${ASDC_LICENSE_AGREEMENT_TEMPLATE} ${map}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500573 ${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}
574 Should Be Equal As Strings ${resp.status_code} 200
DR695Hccff30b2017-02-17 18:44:24 -0500575 [Return] ${resp.json()['value']}
576Get ASDC License Agreement
577 [Documentation] gets an asdc License Agreement by its id
578 [Arguments] ${license_model_id} ${agreement_id}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500579 ${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 -0500580 [Return] ${resp.json()}
581Add ASDC Software Product
582 [Documentation] Creates an asdc Software Product and returns its id
Brian Freeman9c42ae12018-11-27 14:33:27 -0500583 [Arguments] ${license_agreement_id} ${feature_group_id} ${license_model_name} ${license_model_id} ${license_model_version_id} ${name_prefix}
Jerry Floode2a48d72017-06-21 15:06:29 -0400584 ${uuid}= Generate UUID
Brian Freeman9c42ae12018-11-27 14:33:27 -0500585 ${shortened_uuid}= Evaluate str("${uuid}")[:13]
586 ${software_product_name}= Catenate ${name_prefix} ${shortened_uuid}
587 ${map}= Create Dictionary software_product_name=${software_product_name} feature_group_id=${feature_group_id} license_agreement_id=${license_agreement_id} vendor_name=${license_model_name} vendor_id=${license_model_id} version_id=${license_model_version_id}
Jerry Floode2a48d72017-06-21 15:06:29 -0400588 ${data}= Fill JSON Template File ${ASDC_SOFTWARE_PRODUCT_TEMPLATE} ${map}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500589 ${resp}= Run ASDC Post Request ${ASDC_VENDOR_SOFTWARE_PRODUCT_PATH} ${data} ${ASDC_DESIGNER_USER_ID} ${ASDC_BE_ONBOARD_ENDPOINT}
590 Should Be Equal As Strings ${resp.status_code} 200
Brian Freemanb568e5e2018-04-05 21:03:38 -0500591 [Return] ${resp.json()['itemId']} ${resp.json()['version']['id']}
DR695Hccff30b2017-02-17 18:44:24 -0500592Get ASDC Software Product
593 [Documentation] gets an asdc Software Product by its id
Jerry Floode2a48d72017-06-21 15:06:29 -0400594 [Arguments] ${software_product_id} ${version_id}=0.1
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500595 ${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 -0500596 [Return] ${resp.json()}
bdfreeman1421b2a49512018-11-25 07:32:19 -0500597
DR695Hccff30b2017-02-17 18:44:24 -0500598Add ASDC Catalog Resource
599 [Documentation] Creates an asdc Catalog Resource and returns its id
600 [Arguments] ${license_agreement_id} ${software_product_name} ${license_model_name} ${software_product_id}
601 ${map}= Create Dictionary software_product_id=${software_product_id} software_product_name=${software_product_name} license_agreement_id=${license_agreement_id} vendor_name=${license_model_name}
Jerry Floode2a48d72017-06-21 15:06:29 -0400602 ${data}= Fill JSON Template File ${ASDC_CATALOG_RESOURCE_TEMPLATE} ${map}
bdfreeman1421b2a49512018-11-25 07:32:19 -0500603 ${resp}= Run ASDC Post Request ${ASDC_CATALOG_RESOURCES_PATH} ${data} ${ASDC_DESIGNER_USER_ID}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500604 Should Be Equal As Strings ${resp.status_code} 201
DR695Hccff30b2017-02-17 18:44:24 -0500605 [Return] ${resp.json()['uniqueId']}
bdfreeman1421b2a49512018-11-25 07:32:19 -0500606
607Add ASDC Allotted Resource Catalog Resource
608 [Documentation] Creates an asdc Allotted Resource Catalog Resource and returns its id
609 [Arguments] ${license_agreement_id} ${software_product_name} ${license_model_name} ${software_product_id} ${subcategory}
610 ${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}
611 ${data}= Fill JSON Template File ${ASDC_ALLOTTED_RESOURCE_CATALOG_RESOURCE_TEMPLATE} ${map}
612 ${resp}= Run ASDC Post Request ${ASDC_CATALOG_RESOURCES_PATH} ${data} ${ASDC_DESIGNER_USER_ID}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500613 Should Be Equal As Strings ${resp.status_code} 201
bdfreeman1421b2a49512018-11-25 07:32:19 -0500614 [Return] ${resp.json()['uniqueId']}
615
DR695Hccff30b2017-02-17 18:44:24 -0500616Mark ASDC Catalog Resource Inactive
617 [Documentation] deletes an asdc Catalog Resource
618 [Arguments] ${catalog_resource_id}
619 ${resp}= Run ASDC Delete Request ${ASDC_CATALOG_RESOURCES_PATH}/${catalog_resource_id} ${ASDC_DESIGNER_USER_ID}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500620 Should Be Equal As Strings ${resp.status_code} 204
DR695Hccff30b2017-02-17 18:44:24 -0500621 [Return] ${resp}
622Delete Inactive ASDC Catalog Resources
623 [Documentation] delete all asdc Catalog Resources that are inactive
624 ${resp}= Run ASDC Delete Request ${ASDC_CATALOG_INACTIVE_RESOURCES_PATH} ${ASDC_DESIGNER_USER_ID}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500625 Should Be Equal As Strings ${resp.status_code} 200
DR695Hccff30b2017-02-17 18:44:24 -0500626 [Return] ${resp.json()}
627Get ASDC Catalog Resource
628 [Documentation] gets an asdc Catalog Resource by its id
629 [Arguments] ${catalog_resource_id}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500630 ${resp}= Run ASDC Get Request ${ASDC_CATALOG_RESOURCES_PATH}/${catalog_resource_id} ${ASDC_DESIGNER_USER_ID}
DR695Hccff30b2017-02-17 18:44:24 -0500631 [Return] ${resp.json()}
Brian Freemaneef7c6f2018-11-16 18:42:21 -0500632
Yang Xu2ec80382018-11-01 12:30:37 -0400633Get ASDC Catalog Resource Component Instances
634 [Documentation] gets asdc Catalog Resource Component Instances by its id
635 [Arguments] ${catalog_resource_id}
636 ${resp}= Run ASDC Get Request ${ASDC_FE_CATALOG_RESOURCES_PATH}/${catalog_resource_id}/filteredDataByParams?include=componentInstances ${ASDC_DESIGNER_USER_ID} ${ASDC_FE_ENDPOINT}
637 [Return] ${resp.json()}
bdfreeman1421b2a49512018-11-25 07:32:19 -0500638
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500639Get ASDC Catalog Resource Deployment Artifact Properties
640 [Documentation] gets asdc Catalog Resource Deployment Artiface Properties by its id
641 [Arguments] ${catalog_resource_id}
642 #${resp}= Run ASDC Get Request ${ASDC_CATALOG_SERVICES_PATH}/${catalog_resource_id}/filteredDataByParams?include=componentInstances ${ASDC_DESIGNER_USER_ID} ${ASDC_FE_ENDPOINT}
643 ${resp}= Run ASDC Get Request ${ASDC_CATALOG_SERVICES_PATH}/${catalog_resource_id}/filteredDataByParams?include=deploymentArtifacts ${ASDC_DESIGNER_USER_ID} ${ASDC_FE_ENDPOINT}
644 [Return] ${resp.json()}
645
646
Brian Freemaneef7c6f2018-11-16 18:42:21 -0500647Get ASDC Catalog Resource Component Instances Properties
648 [Documentation] gets asdc Catalog Resource Component Instances Properties by its id
649 [Arguments] ${catalog_resource_id}
650 #${resp}= Run ASDC Get Request ${ASDC_FE_CATALOG_RESOURCES_PATH}/${catalog_resource_id}/filteredDataByParams?include=componentInstancesProperties ${ASDC_DESIGNER_USER_ID} ${ASDC_FE_ENDPOINT}
651 ${resp}= Run ASDC Get Request ${ASDC_CATALOG_SERVICES_PATH}/${catalog_resource_id}/filteredDataByParams?include=componentInstancesProperties ${ASDC_DESIGNER_USER_ID} ${ASDC_BE_ENDPOINT}
652 [Return] ${resp.json()}
653
bdfreeman1421b2a49512018-11-25 07:32:19 -0500654Get ASDC Catalog Resource Component Instances Properties For Resource
655 [Documentation] gets asdc Catalog Resource Component Instances Properties for a Resource (VF) by its id
656 [Arguments] ${catalog_resource_id}
657 ${resp}= Run ASDC Get Request ${ASDC_FE_CATALOG_RESOURCES_PATH}/${catalog_resource_id}/filteredDataByParams?include=componentInstancesProperties ${ASDC_DESIGNER_USER_ID} ${ASDC_FE_ENDPOINT}
658 [Return] ${resp.json()}
Brian Freemaneef7c6f2018-11-16 18:42:21 -0500659
Yang Xu2ec80382018-11-01 12:30:37 -0400660Get ASDC Catalog Resource Inputs
661 [Documentation] gets asdc Catalog Inputs by its id
662 [Arguments] ${catalog_resource_id}
663 ${resp}= Run ASDC Get Request ${ASDC_FE_CATALOG_RESOURCES_PATH}/${catalog_resource_id}/filteredDataByParams?include=inputs ${ASDC_DESIGNER_USER_ID} ${ASDC_FE_ENDPOINT}
664 [Return] ${resp.json()}
Brian Freemaneef7c6f2018-11-16 18:42:21 -0500665
Yang Xu2ec80382018-11-01 12:30:37 -0400666Get ASDC Catalog Resource Component Instance Properties
667 [Documentation] gets an asdc Catalog Resource properties by its id
668 [Arguments] ${catalog_resource_id} ${component_instance_id} ${component_id}
669 ${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}
670 [Return] ${resp.json()}
bdfreeman1421b2a49512018-11-25 07:32:19 -0500671
Yang Xu2ec80382018-11-01 12:30:37 -0400672Set ASDC Catalog Resource Component Instance Properties
673 [Documentation] sets an asdc Catalog Resource by its id
Brian Freemaneef7c6f2018-11-16 18:42:21 -0500674 [Arguments] ${catalog_resource_id} ${component_parent_service_id} ${data}
675 #${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}
676 ${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 -0500677 [Return] ${resp.json()}
678
679Set ASDC Catalog Resource Component Instance Properties For Resource
680 [Documentation] sets an asdc Catalog Resource by its id
681 [Arguments] ${catalog_parent_resource_id} ${catalog_resource_id} ${data}
682 #${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}
683 ${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}
684 [Return] ${resp.json()}
Brian Freemaneef7c6f2018-11-16 18:42:21 -0500685
Yang Xu74cfb862018-12-06 21:57:32 -0500686Set CDS Catalog Resource Component Instance Properties
687 [Documentation] sets an asdc Catalog Resource by its id
688 [Arguments] ${catalog_resource_id} ${component_instance_id} ${data}
689 ${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}
690 [Return] ${resp.json()}
691
Yang Xu2ec80382018-11-01 12:30:37 -0400692Set ASDC Catalog Resource VNF Inputs
693 [Documentation] sets an asdc Catalog Resource by its id
694 [Arguments] ${catalog_resource_id} ${data}
695 ${resp}= Run ASDC Post Request ${ASDC_FE_CATALOG_RESOURCES_PATH}/${catalog_resource_id}/update/inputs ${data} ${ASDC_DESIGNER_USER_ID} ${ASDC_FE_ENDPOINT}
696 [Return] ${resp.json()}
Brian Freeman79b00ce2018-11-01 14:57:53 -0500697Get SDC Demo Vnf Catalog Resource
698 [Documentation] gets resource id's for demonstration VNFs for instantiate
699 [Arguments] ${service_name}
700 ${resp}= Run ASDC Get Request ${ASDC_CATALOG_SERVICES_PATH}/serviceName/${service_name}/serviceVersion/1.0
701 @{ITEMS}= Copy List ${resp.json()['componentInstances']}
702 ${demo_catalog_resource}= Create Dictionary
703 :FOR ${ELEMENT} IN @{ITEMS}
704 \ Log ${ELEMENT['name']}
705 \ Log ${ELEMENT['groupInstances'][0]['groupName']}
706 \ ${vnf}= Get VNF From Group Name ${ELEMENT['groupInstances'][0]['groupName']} ${service_name}
707 \ ${vnf_data}= Create Dictionary vnf_type=${ELEMENT['name']} vf_module=${ELEMENT['groupInstances'][0]['groupName']}
708 \ LOG ${vnf_data}
709 \ Set To Dictionary ${demo_catalog_resource} ${vnf}=${vnf_data}
710 \ LOG ${demo_catalog_resource}
711 [Return] ${demo_catalog_resource}
712
713Get VNF From Group Name
714 [Documentation] looks up vnf key from service mapping for a regex on groupName and service_name
715 [Arguments] ${group_name} ${service_name}
716 ${vnf}= Set Variable If
717 ... ('${service_name}'=='demoVFWCL') and ('base_vfw' in '${group_name}') vFWSNK
718 ... ('${service_name}'=='demoVFWCL') and ('base_vpkg' in '${group_name}') vPKG
719 ... ('${service_name}'=='demoVLB') and ('base_vlb' in '${group_name}') vLB
720 [Return] ${vnf}
DR695Hccff30b2017-02-17 18:44:24 -0500721Checkin ASDC Catalog Resource
722 [Documentation] checksin an asdc Catalog Resource by its id
723 [Arguments] ${catalog_resource_id}
724 ${map}= Create Dictionary user_remarks=Robot remarks
Jerry Floode2a48d72017-06-21 15:06:29 -0400725 ${data}= Fill JSON Template File ${ASDC_USER_REMARKS_TEMPLATE} ${map}
DR695Hccff30b2017-02-17 18:44:24 -0500726 ${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 -0500727 Should Be Equal As Strings ${resp.status_code} 200
DR695Hccff30b2017-02-17 18:44:24 -0500728 [Return] ${resp.json()}
729Request Certify ASDC Catalog Resource
730 [Documentation] requests certify on an asdc Catalog Resource by its id
731 [Arguments] ${catalog_resource_id}
732 ${map}= Create Dictionary user_remarks=Robot remarks
Jerry Floode2a48d72017-06-21 15:06:29 -0400733 ${data}= Fill JSON Template File ${ASDC_USER_REMARKS_TEMPLATE} ${map}
DR695Hccff30b2017-02-17 18:44:24 -0500734 ${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 -0500735 Should Be Equal As Strings ${resp.status_code} 200
DR695Hccff30b2017-02-17 18:44:24 -0500736 [Return] ${resp.json()}
737Start Certify ASDC Catalog Resource
738 [Documentation] start certify an asdc Catalog Resource by its id
739 [Arguments] ${catalog_resource_id}
740 ${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 -0500741 Should Be Equal As Strings ${resp.status_code} 200
DR695Hccff30b2017-02-17 18:44:24 -0500742 [Return] ${resp.json()}
743Certify ASDC Catalog Resource
744 [Documentation] start certify an asdc Catalog Resource by its id and returns the new id
Brian Freemandb1e7412018-08-01 12:46:01 -0500745 [Arguments] ${catalog_resource_id} ${user_id}=${ASDC_TESTER_USER_ID}
DR695Hccff30b2017-02-17 18:44:24 -0500746 ${map}= Create Dictionary user_remarks=Robot remarks
Jerry Floode2a48d72017-06-21 15:06:29 -0400747 ${data}= Fill JSON Template File ${ASDC_USER_REMARKS_TEMPLATE} ${map}
Brian Freemandb1e7412018-08-01 12:46:01 -0500748 ${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 -0500749 Should Be Equal As Strings ${resp.status_code} 200
DR695Hccff30b2017-02-17 18:44:24 -0500750 [Return] ${resp.json()['uniqueId']}
Jerry Flood6bd1afa2017-10-09 09:59:23 -0400751
DR695Hccff30b2017-02-17 18:44:24 -0500752Upload ASDC Heat Package
Brian Freemanf508ab22018-03-15 21:19:41 -0500753 [Documentation] Creates an asdc Software Product and returns its id
754 [Arguments] ${software_product_id} ${file_path} ${version_id}=0.1
Jerry Flood6bd1afa2017-10-09 09:59:23 -0400755 ${files}= Create Dictionary
756 Create Multi Part ${files} upload ${file_path} contentType=application/zip
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500757 ${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}
758 Should Be Equal As Strings ${resp.status_code} 200
Jerry Flood6bd1afa2017-10-09 09:59:23 -0400759
DR695Hccff30b2017-02-17 18:44:24 -0500760Add ASDC Catalog Service
761 [Documentation] Creates an asdc Catalog Service and returns its id
jf986075010a42017-02-22 16:52:54 -0500762 [Arguments] ${catalog_service_name}
Jerry Floode2a48d72017-06-21 15:06:29 -0400763 ${uuid}= Generate UUID
jf986075010a42017-02-22 16:52:54 -0500764 ${shortened_uuid}= Evaluate str("${uuid}")[:23]
Jerry Floode2a48d72017-06-21 15:06:29 -0400765 ${catalog_service_name}= Set Variable If '${catalog_service_name}' =='' ${shortened_uuid} ${catalog_service_name}
jf986075010a42017-02-22 16:52:54 -0500766 ${map}= Create Dictionary service_name=${catalog_service_name}
Jerry Floode2a48d72017-06-21 15:06:29 -0400767 ${data}= Fill JSON Template File ${ASDC_CATALOG_SERVICE_TEMPLATE} ${map}
DR695Hccff30b2017-02-17 18:44:24 -0500768 ${resp}= Run ASDC Post Request ${ASDC_CATALOG_SERVICES_PATH} ${data} ${ASDC_DESIGNER_USER_ID}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500769 Should Be Equal As Strings ${resp.status_code} 201
DR695Hccff30b2017-02-17 18:44:24 -0500770 [Return] ${resp.json()['uniqueId']}
771Mark ASDC Catalog Service Inactive
772 [Documentation] Deletes an asdc Catalog Service
773 [Arguments] ${catalog_service_id}
774 ${resp}= Run ASDC Delete Request ${ASDC_CATALOG_SERVICES_PATH}/${catalog_service_id} ${ASDC_DESIGNER_USER_ID}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500775 Should Be Equal As Strings ${resp.status_code} 204
DR695Hccff30b2017-02-17 18:44:24 -0500776 [Return] ${resp}
777Delete Inactive ASDC Catalog Services
778 [Documentation] delete all asdc Catalog Serivces that are inactive
779 ${resp}= Run ASDC Delete Request ${ASDC_CATALOG_INACTIVE_SERVICES_PATH} ${ASDC_DESIGNER_USER_ID}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500780 Should Be Equal As Strings ${resp.status_code} 200
DR695Hccff30b2017-02-17 18:44:24 -0500781 [Return] ${resp.json()}
782Get ASDC Catalog Service
783 [Documentation] gets an asdc Catalog Service by its id
784 [Arguments] ${catalog_service_id}
785 ${resp}= Run ASDC Get Request ${ASDC_CATALOG_SERVICES_PATH}/${catalog_service_id} ${ASDC_DESIGNER_USER_ID}
786 [Return] ${resp.json()}
787Checkin ASDC Catalog Service
788 [Documentation] checksin an asdc Catalog Service by its id
789 [Arguments] ${catalog_service_id}
790 ${map}= Create Dictionary user_remarks=Robot remarks
Jerry Floode2a48d72017-06-21 15:06:29 -0400791 ${data}= Fill JSON Template File ${ASDC_USER_REMARKS_TEMPLATE} ${map}
DR695Hccff30b2017-02-17 18:44:24 -0500792 ${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 -0500793 Should Be Equal As Strings ${resp.status_code} 200
DR695Hccff30b2017-02-17 18:44:24 -0500794 [Return] ${resp.json()}
795Request Certify ASDC Catalog Service
796 [Documentation] requests certify on an asdc Catalog Service by its id
797 [Arguments] ${catalog_service_id}
798 ${map}= Create Dictionary user_remarks=Robot remarks
Jerry Floode2a48d72017-06-21 15:06:29 -0400799 ${data}= Fill JSON Template File ${ASDC_USER_REMARKS_TEMPLATE} ${map}
DR695Hccff30b2017-02-17 18:44:24 -0500800 ${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 -0500801 Should Be Equal As Strings ${resp.status_code} 200
DR695Hccff30b2017-02-17 18:44:24 -0500802 [Return] ${resp.json()}
803Start Certify ASDC Catalog Service
804 [Documentation] start certify an asdc Catalog Service by its id
805 [Arguments] ${catalog_service_id}
806 ${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 -0500807 Should Be Equal As Strings ${resp.status_code} 200
DR695Hccff30b2017-02-17 18:44:24 -0500808 [Return] ${resp.json()}
809Certify ASDC Catalog Service
810 [Documentation] start certify an asdc Catalog Service by its id and returns the new id
811 [Arguments] ${catalog_service_id}
812 ${map}= Create Dictionary user_remarks=Robot remarks
Jerry Floode2a48d72017-06-21 15:06:29 -0400813 ${data}= Fill JSON Template File ${ASDC_USER_REMARKS_TEMPLATE} ${map}
DR695Hccff30b2017-02-17 18:44:24 -0500814 ${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 -0500815 Should Be Equal As Strings ${resp.status_code} 200
DR695Hccff30b2017-02-17 18:44:24 -0500816 [Return] ${resp.json()['uniqueId']}
817Approve ASDC Catalog Service
818 [Documentation] approve an asdc Catalog Service by its id
819 [Arguments] ${catalog_service_id}
820 ${map}= Create Dictionary user_remarks=Robot remarks
Jerry Floode2a48d72017-06-21 15:06:29 -0400821 ${data}= Fill JSON Template File ${ASDC_USER_REMARKS_TEMPLATE} ${map}
DR695Hccff30b2017-02-17 18:44:24 -0500822 ${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 -0500823 Should Be Equal As Strings ${resp.status_code} 200
DR695Hccff30b2017-02-17 18:44:24 -0500824 [Return] ${resp.json()}
825Distribute ASDC Catalog Service
826 [Documentation] distribute an asdc Catalog Service by its id
827 [Arguments] ${catalog_service_id}
828 ${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 -0500829 Should Be Equal As Strings ${resp.status_code} 200
DR695Hccff30b2017-02-17 18:44:24 -0500830 [Return] ${resp.json()}
bdfreeman1421b2a49512018-11-25 07:32:19 -0500831
DR695Hccff30b2017-02-17 18:44:24 -0500832Add ASDC Resource Instance
833 [Documentation] Creates an asdc Resource Instance and returns its id
Brian Freemaneef7c6f2018-11-16 18:42:21 -0500834 [Arguments] ${catalog_service_id} ${catalog_resource_id} ${catalog_resource_name} ${xoffset}=${0} ${yoffset}=${0}
DR695Hccff30b2017-02-17 18:44:24 -0500835 ${milli_timestamp}= Generate MilliTimestamp UUID
Brian Freemaneef7c6f2018-11-16 18:42:21 -0500836 ${xoffset}= Set Variable ${xoffset+306}
837 ${yoffset}= Set Variable ${yoffset+248}
838 ${map}= Create Dictionary catalog_resource_id=${catalog_resource_id} catalog_resource_name=${catalog_resource_name} milli_timestamp=${milli_timestamp} posX=${xoffset} posY=${yoffset}
Jerry Floode2a48d72017-06-21 15:06:29 -0400839 ${data}= Fill JSON Template File ${ASDC_RESOURCE_INSTANCE_TEMPLATE} ${map}
DR695Hccff30b2017-02-17 18:44:24 -0500840 ${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 -0500841 Should Be Equal As Strings ${resp.status_code} 201
DR695Hccff30b2017-02-17 18:44:24 -0500842 [Return] ${resp.json()['uniqueId']}
Brian Freemaneef7c6f2018-11-16 18:42:21 -0500843
bdfreeman1421b2a49512018-11-25 07:32:19 -0500844Add ASDC Resource Instance To Resource
845 [Documentation] Creates an asdc Resource Instance in a Resource (VF) and returns its id
846 [Arguments] ${parent_catalog_resource_id} ${catalog_resource_id} ${catalog_resource_name} ${xoffset}=${0} ${yoffset}=${0}
847 ${milli_timestamp}= Generate MilliTimestamp UUID
848 ${xoffset}= Set Variable ${xoffset+306}
849 ${yoffset}= Set Variable ${yoffset+248}
850 ${map}= Create Dictionary catalog_resource_id=${catalog_resource_id} catalog_resource_name=${catalog_resource_name} milli_timestamp=${milli_timestamp} posX=${xoffset} posY=${yoffset}
851 ${data}= Fill JSON Template File ${ASDC_RESOURCE_INSTANCE_TEMPLATE} ${map}
852 ${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 -0500853 Should Be Equal As Strings ${resp.status_code} 201
bdfreeman1421b2a49512018-11-25 07:32:19 -0500854 [Return] ${resp.json()['uniqueId']}
855
DR695Hccff30b2017-02-17 18:44:24 -0500856Get Catalog Service Distribution
857 [Documentation] gets an asdc catalog Service distrbution
858 [Arguments] ${catalog_service_uuid}
859 ${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 -0500860 Should Be Equal As Strings ${resp.status_code} 200
DR695Hccff30b2017-02-17 18:44:24 -0500861 [Return] ${resp.json()}
862Check Catalog Service Distributed
863 [Documentation] gets an asdc catalog Service distrbution
Brian Freemanadaa2372018-10-24 12:25:22 -0500864 [Arguments] ${catalog_service_uuid} ${dist_status}
DR695Hccff30b2017-02-17 18:44:24 -0500865 ${dist_resp}= Get Catalog Service Distribution ${catalog_service_uuid}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500866 Should Be Equal As Strings ${dist_resp['distributionStatusOfServiceList'][0]['deployementStatus']} Distributed
DR695Hccff30b2017-02-17 18:44:24 -0500867 ${det_resp}= Get Catalog Service Distribution Details ${dist_resp['distributionStatusOfServiceList'][0]['distributionID']}
868 @{ITEMS}= Copy List ${det_resp['distributionStatusList']}
Brian Freemanf508ab22018-03-15 21:19:41 -0500869 Should Not Be Empty ${ITEMS}
Brian Freemana62644f2018-05-13 12:47:38 -0500870 ${SO_COMPLETE} Set Variable FALSE
bdfreeman1421b2a49512018-11-25 07:32:19 -0500871 ${dist_status} Set Variable CONTINUE
872 Should Not Be Empty ${ITEMS}
DR695Hccff30b2017-02-17 18:44:24 -0500873 :FOR ${ELEMENT} IN @{ITEMS}
Brian Freemanf508ab22018-03-15 21:19:41 -0500874 \ Log ${ELEMENT['omfComponentID']}
DR695Hccff30b2017-02-17 18:44:24 -0500875 \ Log ${ELEMENT['status']}
Brian Freeman41ab5e52018-08-08 14:24:23 -0500876 \ ${SO_COMPLETE} Set Variable If (('${ELEMENT['status']}' == 'DISTRIBUTION_COMPLETE_OK')) or ('${SO_COMPLETE}'=='TRUE') TRUE
Brian Freemaneca71072018-08-16 14:50:16 -0500877 \ Exit For Loop If ('${SO_COMPLETE}'=='TRUE')
878 \ Exit For Loop If ('${ELEMENT['status']}' == 'DISTRIBUTION_COMPLETE_ERROR')
Brian Freemanadaa2372018-10-24 12:25:22 -0500879 \ ${dist_status}= Set Variable If (('${ELEMENT['status']}' == 'COMPONENT_DONE_ERROR') and ('${ELEMENT['omfComponentID']}' == 'aai-ml')) EXIT
880 \ Exit For Loop If (('${ELEMENT['status']}' == 'COMPONENT_DONE_ERROR') and ('${ELEMENT['omfComponentID']}' == 'aai-ml'))
Brian Freemana62644f2018-05-13 12:47:38 -0500881 Should Be True ( '${SO_COMPLETE}'=='TRUE') SO Test
bdfreeman1421b2a49512018-11-25 07:32:19 -0500882 [Return]
883
DR695Hccff30b2017-02-17 18:44:24 -0500884Get Catalog Service Distribution Details
885 [Documentation] gets an asdc catalog Service distrbution details
886 [Arguments] ${catalog_service_distribution_id}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500887 ${resp}= Run ASDC Get Request ${ASDC_CATALOG_SERVICES_PATH}${ASDC_CATALOG_SERVICE_DISTRIBUTION_PATH}/${catalog_service_distribution_id} ${ASDC_OPS_USER_ID}
888 Should Be Equal As Strings ${resp.status_code} 200
DR695Hccff30b2017-02-17 18:44:24 -0500889 [Return] ${resp.json()}
890Run ASDC Health Check
891 [Documentation] Runs a ASDC health check
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500892 ${session}= Create Session asdc ${ASDC_FE_ENDPOINT}
DR695Hccff30b2017-02-17 18:44:24 -0500893 ${uuid}= Generate UUID
894 ${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 -0500895 ${resp}= Get Request asdc ${ASDC_HEALTH_CHECK_PATH} headers=${headers}
Brian Freemanadaa2372018-10-24 12:25:22 -0500896 # only test for HTTP 200 to determine SDC Health. SDC_DE_HEALTH is informational
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500897 Should Be Equal As Strings ${resp.status_code} 200 SDC DOWN
Brian Freeman5cf5fa62018-04-23 20:28:16 -0500898 ${SDC_DE_HEALTH}= Catenate DOWN
DR695Hccff30b2017-02-17 18:44:24 -0500899 @{ITEMS}= Copy List ${resp.json()['componentsInfo']}
900 :FOR ${ELEMENT} IN @{ITEMS}
901 \ Log ${ELEMENT['healthCheckStatus']}
Brian Freemane546f7e2018-04-19 12:17:56 -0500902 \ ${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 -0500903 Log To Console (DMaaP:${SDC_DE_HEALTH}) no_newline=true
DR695Hccff30b2017-02-17 18:44:24 -0500904Run ASDC Get Request
905 [Documentation] Runs an ASDC get request
Brian Freeman44b8bb32018-05-03 21:08:42 -0500906 [Arguments] ${data_path} ${user}=${ASDC_DESIGNER_USER_ID} ${MY_ASDC_BE_ENDPOINT}=${ASDC_BE_ENDPOINT}
DR695Hccff30b2017-02-17 18:44:24 -0500907 ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500908 Log Creating session ${MY_ASDC_BE_ENDPOINT}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500909 ${session}= Create Session asdc ${MY_ASDC_BE_ENDPOINT} auth=${auth}
DR695Hccff30b2017-02-17 18:44:24 -0500910 ${uuid}= Generate UUID
911 ${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 -0500912 ${resp}= Get Request asdc ${data_path} headers=${headers}
DR695Hccff30b2017-02-17 18:44:24 -0500913 Log Received response from asdc ${resp.text}
914 [Return] ${resp}
915Run ASDC Put Request
916 [Documentation] Runs an ASDC put request
Brian Freeman44b8bb32018-05-03 21:08:42 -0500917 [Arguments] ${data_path} ${data} ${user}=${ASDC_DESIGNER_USER_ID} ${MY_ASDC_BE_ENDPOINT}=${ASDC_BE_ENDPOINT}
DR695Hccff30b2017-02-17 18:44:24 -0500918 ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500919 Log Creating session ${MY_ASDC_BE_ENDPOINT}
920 ${session}= Create Session asdc ${MY_ASDC_BE_ENDPOINT} auth=${auth}
DR695Hccff30b2017-02-17 18:44:24 -0500921 ${uuid}= Generate UUID
922 ${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 -0500923 ${resp}= Put Request asdc ${data_path} data=${data} headers=${headers}
DR695Hccff30b2017-02-17 18:44:24 -0500924 Log Received response from asdc ${resp.text}
925 [Return] ${resp}
Jerry Flood6bd1afa2017-10-09 09:59:23 -0400926
DR695Hccff30b2017-02-17 18:44:24 -0500927Run ASDC Post Files Request
928 [Documentation] Runs an ASDC post request
Brian Freeman44b8bb32018-05-03 21:08:42 -0500929 [Arguments] ${data_path} ${files} ${user}=${ASDC_DESIGNER_USER_ID} ${MY_ASDC_BE_ENDPOINT}=${ASDC_BE_ENDPOINT}
DR695Hccff30b2017-02-17 18:44:24 -0500930 ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500931 Log Creating session ${MY_ASDC_BE_ENDPOINT}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500932 ${session}= Create Session asdc ${MY_ASDC_BE_ENDPOINT} auth=${auth}
DR695Hccff30b2017-02-17 18:44:24 -0500933 ${uuid}= Generate UUID
934 ${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 -0500935 ${resp}= Post Request asdc ${data_path} files=${files} headers=${headers}
936 Log Received response from asdc ${resp.text}
937 [Return] ${resp}
938
939Run ASDC MD5 Post Request
940 [Documentation] Runs an ASDC post request with MD5 Checksum header
941 [Arguments] ${data_path} ${data} ${user}=${ASDC_DESIGNER_USER_ID} ${MY_ASDC_BE_ENDPOINT}=${ASDC_BE_ENDPOINT}
942 ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD}
943 Log Creating session ${MY_ASDC_BE_ENDPOINT}
944 ${session}= Create Session asdc ${MY_ASDC_BE_ENDPOINT} auth=${auth}
945 ${uuid}= Generate UUID
946 ${data_string}= Evaluate json.dumps(${data}) json
947 ${md5checksum}= Evaluate md5.new('''${data_string}''').hexdigest() modules=md5
948 ${base64md5checksum}= Evaluate base64.b64encode("${md5checksum}") modules=base64
949 ${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}
950 ${resp}= Post Request asdc ${data_path} data=${data} headers=${headers}
DR695Hccff30b2017-02-17 18:44:24 -0500951 Log Received response from asdc ${resp.text}
Jerry Floode2a48d72017-06-21 15:06:29 -0400952 [Return] ${resp}
Jerry Flood6bd1afa2017-10-09 09:59:23 -0400953
DR695Hccff30b2017-02-17 18:44:24 -0500954Run ASDC Post Request
955 [Documentation] Runs an ASDC post request
Brian Freeman44b8bb32018-05-03 21:08:42 -0500956 [Arguments] ${data_path} ${data} ${user}=${ASDC_DESIGNER_USER_ID} ${MY_ASDC_BE_ENDPOINT}=${ASDC_BE_ENDPOINT}
DR695Hccff30b2017-02-17 18:44:24 -0500957 ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500958 Log Creating session ${MY_ASDC_BE_ENDPOINT}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500959 ${session}= Create Session asdc ${MY_ASDC_BE_ENDPOINT} auth=${auth}
DR695Hccff30b2017-02-17 18:44:24 -0500960 ${uuid}= Generate UUID
961 ${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 -0500962 ${resp}= Post Request asdc ${data_path} data=${data} headers=${headers}
DR695Hccff30b2017-02-17 18:44:24 -0500963 Log Received response from asdc ${resp.text}
Jerry Floode2a48d72017-06-21 15:06:29 -0400964 [Return] ${resp}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500965
DR695Hccff30b2017-02-17 18:44:24 -0500966Run ASDC Delete Request
967 [Documentation] Runs an ASDC delete request
Brian Freeman44b8bb32018-05-03 21:08:42 -0500968 [Arguments] ${data_path} ${user}=${ASDC_DESIGNER_USER_ID} ${MY_ASDC_BE_ENDPOINT}=${ASDC_BE_ENDPOINT}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500969 ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500970 Log Creating session ${MY_ASDC_BE_ENDPOINT}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500971 ${session}= Create Session asdc ${MY_ASDC_BE_ENDPOINT} auth=${auth}
DR695Hccff30b2017-02-17 18:44:24 -0500972 ${uuid}= Generate UUID
973 ${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 -0500974 ${resp}= Delete Request asdc ${data_path} headers=${headers}
DR695Hccff30b2017-02-17 18:44:24 -0500975 Log Received response from asdc ${resp.text}
Jerry Floode2a48d72017-06-21 15:06:29 -0400976 [Return] ${resp}
DR695Hccff30b2017-02-17 18:44:24 -0500977Open ASDC GUI
978 [Documentation] Logs in to ASDC GUI
979 [Arguments] ${PATH}
980 ## Setup Browever now being managed by the test case
981 ##Setup Browser
DR695Hbf5a3a32017-06-30 13:09:57 -0400982 Go To ${ASDC_FE_ENDPOINT}${PATH}
DR695Hccff30b2017-02-17 18:44:24 -0500983 Maximize Browser Window
Jerry Flood6bd1afa2017-10-09 09:59:23 -0400984
DR695Hccff30b2017-02-17 18:44:24 -0500985 Set Browser Implicit Wait ${GLOBAL_SELENIUM_BROWSER_IMPLICIT_WAIT}
DR695Hbf5a3a32017-06-30 13:09:57 -0400986 Log Logging in to ${ASDC_FE_ENDPOINT}${PATH}
DR695Hccff30b2017-02-17 18:44:24 -0500987 Title Should Be ASDC
Jerry Floode2a48d72017-06-21 15:06:29 -0400988 Wait Until Page Contains Element xpath=//div/a[text()='SDC'] ${GLOBAL_SELENIUM_BROWSER_WAIT_TIMEOUT}
DR695Hbf5a3a32017-06-30 13:09:57 -0400989 Log Logged in to ${ASDC_FE_ENDPOINT}${PATH}
Jerry Flood6bd1afa2017-10-09 09:59:23 -0400990
991
992Create Multi Part
993 [Arguments] ${addTo} ${partName} ${filePath} ${contentType}=${None}
994 ${fileData}= Get Binary File ${filePath}
995 ${fileDir} ${fileName}= Split Path ${filePath}
996 ${partData}= Create List ${fileName} ${fileData} ${contentType}
997 Set To Dictionary ${addTo} ${partName}=${partData}
Brian Freemanf940ee92018-05-25 21:09:05 -0500998