blob: 6ffc17e1b07126321462bbf580fbafd93e86da7a [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
DR695H910097e2019-05-08 13:55:32 -04008Library SeleniumLibrary
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
DR695H910097e2019-05-08 13:55:32 -040090 :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
DR695H910097e2019-05-08 13:55:32 -0400105 :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
DR695H910097e2019-05-08 13:55:32 -0400117 :FOR ${network} IN @{networklist}
Brian Freemaneef7c6f2018-11-16 18:42:21 -0500118 \ ${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}
DR695H910097e2019-05-08 13:55:32 -0400140 :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
DR695H910097e2019-05-08 13:55:32 -0400163 :FOR ${zip} IN @{model_zip_path}
bdfreeman1421b2a49512018-11-25 07:32:19 -0500164 \ ${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
DR695H910097e2019-05-08 13:55:32 -0400192 :FOR ${allottedresource} IN @{allottedresource_list}
bdfreeman1421b2a49512018-11-25 07:32:19 -0500193 \ ${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}
DR695H910097e2019-05-08 13:55:32 -0400218 :FOR ${DIST_INDEX} IN RANGE 1
bdfreeman1421b2a49512018-11-25 07:32:19 -0500219 \ 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
Yang Xu7037e542018-12-28 01:19:26 -0500230 ${allotted_resource}= Create Dictionary
231 ${allotted_csar_map}= Create Dictionary
232 Set To Dictionary ${allotted_csar_map} tunnelxconn=service-Demovcpevgmux-csar.csar
233 Set To Dictionary ${allotted_csar_map} brg=service-Demovcpevbrgemu-csar.csar
234 ${keys}= Get Dictionary Keys ${allotted_csar_map}
DR695H910097e2019-05-08 13:55:32 -0400235 :FOR ${key} IN @{keys}
Yang Xu7037e542018-12-28 01:19:26 -0500236 \ ${csar}= Get From Dictionary ${allotted_csar_map} ${key}
237 \ ${dir} ${ext}= Split String From Right ${csar} - 1
238 \ Extract Zip File /tmp/csar/${csar} /tmp/csar/${dir}
239 \ ${template}= Catenate /tmp/csar/${dir}/Definitions/${dir}-template.yml
240 \ ${json_str}= Template Yaml To Json ${template}
241 \ ${json_obj}= To Json ${json_str}
242 \ ${attrs}= Create Dictionary
243 \ Set To Dictionary ${attrs} invariantUUID=${json_obj['metadata']['invariantUUID']}
244 \ Set To Dictionary ${attrs} UUID=${json_obj['metadata']['UUID']}
245 \ Set To Dictionary ${attrs} node_type=${json_obj['topology_template']['substitution_mappings']['node_type']}
246 \ Set To Dictionary ${allotted_resource} ${key}=${attrs}
247 ${result_str}= Evaluate json.dumps(${allotted_resource}, indent=2) json
248 Log To Console ${result_str}
249 Create File /tmp/vcpe_allotted_resource_data.json ${result_str}
Yang Xu7037e542018-12-28 01:19:26 -0500250
bdfreeman14211ad11d92018-11-17 18:47:37 +0000251Download CSAR
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500252 [Documentation] Download CSAR
bdfreeman14211ad11d92018-11-17 18:47:37 +0000253 [Arguments] ${catalog_service_id} ${save_directory}=/tmp/csar
254 # get meta data
255 ${resp}= Run ASDC Get Request ${ASDC_CATALOG_SERVICES_PATH}/${catalog_service_id}/filteredDataByParams?include=toscaArtifacts ${ASDC_DESIGNER_USER_ID} ${ASDC_BE_ENDPOINT}
256 ${csar_resource_id}= Set Variable ${resp.json()['toscaArtifacts']['assettoscacsar']['uniqueId']}
257 ${resp}= Run ASDC Get Request ${ASDC_CATALOG_SERVICES_PATH}/${catalog_service_id}/artifacts/${csar_resource_id}
258 ${csar_file_name}= Set Variable ${resp.json()['artifactName']}
259 ${base64Obj}= Set Variable ${resp.json()['base64Contents']}
260 ${binObj}= Evaluate base64.b64decode("${base64Obj}") modules=base64
261 Create Binary File ${save_directory}/${csar_file_name} ${binObj}
Brian Freemane14d2572019-04-29 16:20:21 -0500262 Log To Console ${\n}Downloaded:${csar_file_name}
bdfreeman14211ad11d92018-11-17 18:47:37 +0000263
Brian Freemaneef7c6f2018-11-16 18:42:21 -0500264
265Get Generic NeutronNet UUID
266 [Documentation] Lookoup the UUID of the Generic NeutronNetwork Resource
Brian Freemaneef7c6f2018-11-16 18:42:21 -0500267 ${resp}= Run ASDC Get Request ${ASDC_CATALOG_RESOURCES_QUERY_PATH}/Generic%20NeutronNet/resourceVersion/1.0 ${ASDC_DESIGNER_USER_ID} ${ASDC_BE_ENDPOINT}
268 [Return] ${resp.json()['allVersions']['1.0']}
269
bdfreeman1421b2a49512018-11-25 07:32:19 -0500270Get AllottedResource UUID
271 [Documentation] Lookoup the UUID of the Allotted Resource
272 # if this fails then the AllottedResource template got deleted from SDC by mistake
273 ${resp}= Run ASDC Get Request ${ASDC_CATALOG_RESOURCES_QUERY_PATH}/AllottedResource/resourceVersion/1.0 ${ASDC_DESIGNER_USER_ID} ${ASDC_BE_ENDPOINT}
274 [Return] ${resp.json()['allVersions']['1.0']}
275
Brian Freeman18df8912018-05-25 13:27:29 -0500276Loop Over Check Catalog Service Distributed
Gary Wu58d58532018-07-27 16:02:51 -0700277 [Arguments] ${catalog_service_id}
Brian Freemanadaa2372018-10-24 12:25:22 -0500278 # SO watchdog timeout is 300 seconds need buffer
bdfreeman1421b2a49512018-11-25 07:32:19 -0500279 ${dist_status}= Set Variable CONTINUE
DR695H910097e2019-05-08 13:55:32 -0400280 :FOR ${CHECK_INDEX} IN RANGE 20
Brian Freemanadaa2372018-10-24 12:25:22 -0500281 \ ${status} ${_} = Run Keyword And Ignore Error Check Catalog Service Distributed ${catalog_service_id} ${dist_status}
Gary Wu58d58532018-07-27 16:02:51 -0700282 \ Sleep 20s
Brian Freemanf940ee92018-05-25 21:09:05 -0500283 \ Return From Keyword If '${status}'=='PASS'
bdfreeman1421b2a49512018-11-25 07:32:19 -0500284 # need a way to exit the loop early on DISTRIBUTION_COMPLETE_ERROR ${dist_status} doesnt work
285 #\ Exit For Loop If '${dist_status}'=='EXIT'
286 Should Be Equal As Strings ${status} PASS
Brian Freeman18df8912018-05-25 13:27:29 -0500287
DR695Hccff30b2017-02-17 18:44:24 -0500288Setup ASDC Catalog Resource
289 [Documentation] Creates all the steps a vf needs for an asdc catalog resource and returns the id
Yang Xu2ec80382018-11-01 12:30:37 -0400290 [Arguments] ${model_zip_path} ${cds}=
Brian Freemanb568e5e2018-04-05 21:03:38 -0500291 ${license_model_id} ${license_model_version_id}= Add ASDC License Model
Brian Freeman15033782019-03-22 15:48:55 -0500292
293
294 ${license_temp_date}= Get Current Date
295 ${license_start_date}= Get Current Date result_format=%m/%d/%Y
296 ${license_end_date}= Add Time To Date ${license_temp_date} 365 days result_format=%m/%d/%Y
297 ${key_group_id}= Add ASDC License Group ${license_model_id} ${license_model_version_id} ${license_start_date} ${license_end_date}
298 ${pool_id}= Add ASDC Entitlement Pool ${license_model_id} ${license_model_version_id} ${license_start_date} ${license_end_date}
299
Brian Freemanb568e5e2018-04-05 21:03:38 -0500300 ${feature_group_id}= Add ASDC Feature Group ${license_model_id} ${key_group_id} ${pool_id} ${license_model_version_id}
301 ${license_agreement_id}= Add ASDC License Agreement ${license_model_id} ${feature_group_id} ${license_model_version_id}
302 Submit ASDC License Model ${license_model_id} ${license_model_version_id}
303 ${license_model_resp}= Get ASDC License Model ${license_model_id} ${license_model_version_id}
Brian Freeman9c42ae12018-11-27 14:33:27 -0500304 ${matches}= Get Regexp Matches ${model_zip_path} temp/(.*)\.zip 1
305 ${software_product_name_prefix}= Set Variable ${matches[0]}
306 ${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 -0500307 Upload ASDC Heat Package ${software_product_id} ${model_zip_path} ${software_product_version_id}
308 Validate ASDC Software Product ${software_product_id} ${software_product_version_id}
309 Submit ASDC Software Product ${software_product_id} ${software_product_version_id}
310 Package ASDC Software Product ${software_product_id} ${software_product_version_id}
311 ${software_product_resp}= Get ASDC Software Product ${software_product_id} ${software_product_version_id}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500312 ${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 -0400313 # Check if need to set up CDS properties
314 Run Keyword If '${cds}' == 'vfwng' Setup ASDC Catalog Resource CDS Properties ${catalog_resource_id}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500315
Brian Freeman391680a2018-08-11 15:20:58 -0500316 ${catalog_resource_id}= Certify ASDC Catalog Resource ${catalog_resource_id} ${ASDC_DESIGNER_USER_ID}
DR695Hccff30b2017-02-17 18:44:24 -0500317 [Return] ${catalog_resource_id}
Brian Freemaneef7c6f2018-11-16 18:42:21 -0500318
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500319
320Setup SDC Catalog Resource Deployment Artifact Properties
321 [Documentation] Set up Deployment Artiface properties
322 [Arguments] ${catalog_service_id} ${catalog_parent_service_id} ${catalog_resource_unique_id} ${blueprint_file}
323 ${resp}= Get ASDC Catalog Resource Component Instances Properties ${catalog_service_id}
324 #${resp}= Get ASDC Catalog Resource Deployment Artifact Properties ${catalog_service_id}
Brian Freemana8ceb692019-03-03 09:37:54 -0500325 ${blueprint_data} OperatingSystem.Get File ${SDC_CATALOG_DEPLOYMENT_ARTIFACT_PATH}${blueprint_file}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500326 ${payloadData}= Evaluate base64.b64encode('''${blueprint_data}'''.encode('utf-8')) modules=base64
327 ${dict}= Create Dictionary artifactLabel=blueprint artifactName=${blueprint_file} artifactType=DCAE_INVENTORY_BLUEPRINT artifactGroupType=DEPLOYMENT description=${blueprint_file} payloadData=${payloadData}
328 ${data}= Fill JSON Template File ${ASDC_ARTIFACT_UPLOAD_TEMPLATE} ${dict}
329 # POST artifactUpload to resource
330 ${artifact_upload_path}= Catenate ${ASDC_CATALOG_SERVICES_PATH}/${catalog_service_id}/resourceInstance/${catalog_resource_unique_id}${ASDC_CATALOG_SERVICE_RESOURCE_ARTIFACT_PATH}
331 ${resp}= Run ASDC MD5 Post Request ${artifact_upload_path} ${data} ${ASDC_DESIGNER_USER_ID}
332 Should Be Equal As Strings ${resp.status_code} 200
333 [Return] ${resp}
334
335
Brian Freemaneef7c6f2018-11-16 18:42:21 -0500336Setup SDC Catalog Resource GenericNeutronNet Properties
bdfreeman1421b2a49512018-11-25 07:32:19 -0500337 [Documentation] Set up GenericNeutronNet properties and inputs
Brian Freemaneef7c6f2018-11-16 18:42:21 -0500338 [Arguments] ${catalog_service_id} ${nf_role} ${catalog_parent_service_id}
Brian Freemaneef7c6f2018-11-16 18:42:21 -0500339 ${resp}= Get ASDC Catalog Resource Component Instances Properties ${catalog_service_id}
Brian Freemaneef7c6f2018-11-16 18:42:21 -0500340 ${componentInstances} Set Variable @{resp['componentInstancesProperties']}
341 # componentInstances can have 1 or more than 1 entry
342 ${passed}= Run Keyword And Return Status Evaluate type(${componentInstances})
343 ${type}= Run Keyword If ${passed} Evaluate type(${componentInstances})
344 ${componentInstancesList}= Run Keyword If "${type}"!="<type 'list'>" Create List ${componentInstances}
345 ... ELSE Set Variable ${componentInstances}
346 :FOR ${item} IN @{componentInstancesList}
347 \ ${test} ${v}= Run Keyword and Ignore Error Should Contain ${item} ${nf_role}
348 \ Run Keyword If '${test}' == 'FAIL' Continue For Loop
349 \ ${componentInstance1}= Set Variable ${item}
350 :FOR ${comp} IN @{resp['componentInstancesProperties']["${componentInstance1}"]}
351 \ ${name} Set Variable ${comp['name']}
352 \ ${test} ${v}= Run Keyword and Ignore Error Should Contain ${name} network_role
353 \ Run Keyword If '${test}' == 'FAIL' Continue For Loop
354 \ ${description} Set Variable ${comp['description']}
355 \ ${description}= Replace String ${description} ${\n} \
356 \ ${uniqueId} Set Variable ${comp['uniqueId']}
357 \ ${parentUniqueId} Set Variable ${comp['parentUniqueId']}
358 \ ${ownerId} Set Variable ${comp['ownerId']}
359 \ ${dict}= Create Dictionary parentUniqueId=${parentUniqueId} ownerId=${ownerId} uniqueId=${uniqueId} description=${description}
360 \ Run Keyword If '${name}'=='network_role' Set To Dictionary ${dict} name=${name} value=${nf_role}
bdfreeman1421b2a49512018-11-25 07:32:19 -0500361 \ ${data}= Fill JSON Template File ${SDC_CATALOG_NET_RESOURCE_INPUT_TEMPLATE} ${dict}
Brian Freemaneef7c6f2018-11-16 18:42:21 -0500362 \ ${response}= Set ASDC Catalog Resource Component Instance Properties ${catalog_parent_service_id} ${catalog_service_id} ${data}
Brian Freemaneef7c6f2018-11-16 18:42:21 -0500363
bdfreeman1421b2a49512018-11-25 07:32:19 -0500364
365Setup SDC Catalog Resource AllottedResource Properties
366 [Documentation] Set up Allotted Resource properties and inputs
367 [Arguments] ${catalog_service_id} ${nf_role} ${catalog_resource_id} ${invariantUUID} ${UUID} ${node_type}
368 # Set component instances properties
369 ${nf_role_lc}= Convert To Lowercase ${nf_role}
370 ${resp}= Get ASDC Catalog Resource Component Instances Properties For Resource ${catalog_resource_id}
371 ${componentInstances} Set Variable @{resp['componentInstancesProperties']}
372 # componentInstances can have 1 or more than 1 entry
373 ${passed}= Run Keyword And Return Status Evaluate type(${componentInstances})
374 ${type}= Run Keyword If ${passed} Evaluate type(${componentInstances})
375 ${componentInstancesList}= Run Keyword If "${type}"!="<type 'list'>" Create List ${componentInstances}
376 ... ELSE Set Variable ${componentInstances}
377 :FOR ${item} IN @{componentInstancesList}
378 \ ${test} ${v}= Run Keyword and Ignore Error Should Contain ${item} ${nf_role_lc}
379 \ Run Keyword If '${test}' == 'FAIL' Continue For Loop
380 \ ${componentInstance1}= Set Variable ${item}
381 ${dict}= Create Dictionary
382 :FOR ${comp} IN @{resp['componentInstancesProperties']["${componentInstance1}"]}
383 \ ${name} Set Variable ${comp['name']}
384 \ ${test} ${v}= Run Keyword and Ignore Error Should Contain Any ${name} network_role providing_service_invariant_uuid providing_service_uuid providing_service_name uniqueId
385 \ Run Keyword If '${test}' == 'FAIL' Continue For Loop
386 \ ${parentUniqueId} Set Variable ${comp['parentUniqueId']}
387 \ ${ownerId} Set Variable ${comp['ownerId']}
388 \ Set To Dictionary ${dict} parentUniqueId=${parentUniqueId} ownerId=${ownerId}
389 \ Run Keyword If '${name}'=='providing_service_invariant_uuid' Set To Dictionary ${dict} providing_service_invariant_uuid=${invariantUUID}
390 \ Run Keyword If '${name}'=='providing_service_uuid' Set To Dictionary ${dict} providing_service_uuid=${UUID}
391 \ Run Keyword If '${name}'=='providing_service_name' Set To Dictionary ${dict} providing_service_name=${node_type}
392 # Sets it for each loop but should be one
393 \ ${uniqueId} Set Variable ${comp['uniqueId']}
394 \ ${uniqueId} Fetch From Left ${uniqueId} .
395 \ Set To Dictionary ${dict} uniqueId=${uniqueId}
396 ${data}= Fill JSON Template File ${SDC_CATALOG_ALLOTTED_RESOURCE_PROPERTIES_TEMPLATE} ${dict}
397 ${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}
412 ${data}= Fill JSON Template File ${SDC_CATALOG_ALLOTTED_RESOURCE_INPUTS_TEMPLATE} ${dict}
413 ${response}= Set ASDC Catalog Resource VNF Inputs ${catalog_resource_id} ${data}
414 [Return] ${response}
415
Yang Xu2ec80382018-11-01 12:30:37 -0400416Setup ASDC Catalog Resource CDS Properties
417 [Documentation] Set up vfwng VNF properties and inputs for CDS
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500418 [Arguments] ${catalog_resource_id}
Yang Xu2ec80382018-11-01 12:30:37 -0400419 # Set vnf module properties
420 ${resp}= Get ASDC Catalog Resource Component Instances ${catalog_resource_id}
DR695H910097e2019-05-08 13:55:32 -0400421 :FOR ${comp} IN @{resp['componentInstances']}
Yang Xu2ec80382018-11-01 12:30:37 -0400422 \ ${name} Set Variable ${comp['name']}
423 \ ${uniqueId} Set Variable ${comp['uniqueId']}
424 \ ${actualComponentUid} Set Variable ${comp['actualComponentUid']}
425 \ ${test} ${v}= Run Keyword and Ignore Error Should Contain ${name} abstract_
426 \ Run Keyword If '${test}' == 'FAIL' Continue For Loop
427 \ ${response}= Get ASDC Catalog Resource Component Instance Properties ${catalog_resource_id} ${uniqueId} ${actualComponentUid}
428 \ ${dict}= Create Dictionary parent_id=${response[6]['parentUniqueId']}
429 \ Run Keyword If '${name}'=='abstract_vfw' Set To Dictionary ${dict} nfc_function=vfw nfc_naming_policy=SDNC_Policy.ONAP_VFW_NAMING_TIMESTAMP
430 \ Run Keyword If '${name}'=='abstract_vpg' Set To Dictionary ${dict} nfc_function=vpg nfc_naming_policy=SDNC_Policy.ONAP_VPG_NAMING_TIMESTAMP
431 \ 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 -0500432 \ ${data}= Fill JSON Template File ${ASDC_RESOURCE_INSTANCE_VNF_PROPERTIES_TEMPLATE} ${dict}
433 \ ${response}= Set ASDC Catalog Resource Component Instance Properties ${catalog_resource_id} ${uniqueId} ${data}
Yang Xu2ec80382018-11-01 12:30:37 -0400434 \ Log To Console resp=${response}
435
436 # Set vnf inputs
437 ${resp}= Get ASDC Catalog Resource Inputs ${catalog_resource_id}
438 ${dict}= Create Dictionary
DR695H910097e2019-05-08 13:55:32 -0400439 :FOR ${comp} IN @{resp['inputs']}
Yang Xu2ec80382018-11-01 12:30:37 -0400440 \ ${name} Set Variable ${comp['name']}
441 \ ${uid} Set Variable ${comp['uniqueId']}
442 \ Run Keyword If '${name}'=='nf_function' Set To Dictionary ${dict} nf_function=ONAP-FIREWALL nf_function_uid=${uid}
443 \ Run Keyword If '${name}'=='nf_type' Set To Dictionary ${dict} nf_type=FIREWALL nf_type_uid=${uid}
444 \ Run Keyword If '${name}'=='nf_naming_code' Set To Dictionary ${dict} nf_naming_code=vfw nf_naming_code_uid=${uid}
445 \ Run Keyword If '${name}'=='nf_role' Set To Dictionary ${dict} nf_role=vFW nf_role_uid=${uid}
446 \ Run Keyword If '${name}'=='cloud_env' Set To Dictionary ${dict} cloud_env=openstack cloud_env_uid=${uid}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500447 ${data}= Fill JSON Template File ${ASDC_RESOURCE_INSTANCE_VNF_INPUTS_TEMPLATE} ${dict}
Yang Xu2ec80382018-11-01 12:30:37 -0400448 ${response}= Set ASDC Catalog Resource VNF Inputs ${catalog_resource_id} ${data}
449
DR695Hccff30b2017-02-17 18:44:24 -0500450Add ASDC License Model
451 [Documentation] Creates an asdc license model and returns its id
Jerry Floode2a48d72017-06-21 15:06:29 -0400452 ${uuid}= Generate UUID
453 ${shortened_uuid}= Evaluate str("${uuid}")[:23]
DR695Hccff30b2017-02-17 18:44:24 -0500454 ${map}= Create Dictionary vendor_name=${shortened_uuid}
455 ${data}= Fill JSON Template File ${ASDC_LICENSE_MODEL_TEMPLATE} ${map}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500456 ${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 -0500457 Should Be Equal As Strings ${resp.status_code} 200
Brian Freemanb568e5e2018-04-05 21:03:38 -0500458 [Return] ${resp.json()['itemId']} ${resp.json()['version']['id']}
DR695Hccff30b2017-02-17 18:44:24 -0500459Get ASDC License Model
460 [Documentation] gets an asdc license model by its id
Jerry Floode2a48d72017-06-21 15:06:29 -0400461 [Arguments] ${id} ${version_id}=0.1
Brian Freeman44b8bb32018-05-03 21:08:42 -0500462 ${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 -0400463 [Return] ${resp.json()}
464Get ASDC License Models
465 [Documentation] gets an asdc license model by its id
Brian Freeman44b8bb32018-05-03 21:08:42 -0500466 ${resp}= Run ASDC Get Request ${ASDC_VENDOR_LICENSE_MODEL_PATH} ${ASDC_DESIGNER_USER_ID} ${ASDC_BE_ONBOARD_ENDPOINT}
467
DR695Hccff30b2017-02-17 18:44:24 -0500468 [Return] ${resp.json()}
469Checkin ASDC License Model
470 [Documentation] checksin an asdc license model by its id
Jerry Floode2a48d72017-06-21 15:06:29 -0400471 [Arguments] ${id} ${version_id}=0.1
DR695Hccff30b2017-02-17 18:44:24 -0500472 ${map}= Create Dictionary action=Checkin
473 ${data}= Fill JSON Template File ${ASDC_ACTION_TEMPLATE} ${map}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500474 ${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}
475 Should Be Equal As Strings ${resp.status_code} 200
DR695Hccff30b2017-02-17 18:44:24 -0500476 [Return] ${resp.json()}
477Submit ASDC License Model
478 [Documentation] submits an asdc license model by its id
Jerry Floode2a48d72017-06-21 15:06:29 -0400479 [Arguments] ${id} ${version_id}=0.1
DR695Hccff30b2017-02-17 18:44:24 -0500480 ${map}= Create Dictionary action=Submit
481 ${data}= Fill JSON Template File ${ASDC_ACTION_TEMPLATE} ${map}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500482 ${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 -0500483 Should Be Equal As Strings ${resp.status_code} 200
DR695Hccff30b2017-02-17 18:44:24 -0500484 [Return] ${resp.json()}
485Checkin ASDC Software Product
486 [Documentation] checksin an asdc Software Product by its id
Jerry Floode2a48d72017-06-21 15:06:29 -0400487 [Arguments] ${id} ${version_id}=0.1
DR695Hccff30b2017-02-17 18:44:24 -0500488 ${map}= Create Dictionary action=Checkin
Jerry Floode2a48d72017-06-21 15:06:29 -0400489 ${data}= Fill JSON Template File ${ASDC_ACTION_TEMPLATE} ${map}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500490 ${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 -0500491 Should Be Equal As Strings ${resp.status_code} 200
Jerry Floode2a48d72017-06-21 15:06:29 -0400492 [Return] ${resp.json()}
493Validate ASDC Software Product
494 [Documentation] checksin an asdc Software Product by its id
495 [Arguments] ${id} ${version_id}=0.1
496 ${data}= Catenate
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500497 ${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}
498 Should Be Equal As Strings ${resp.status_code} 200
DR695Hccff30b2017-02-17 18:44:24 -0500499 [Return] ${resp.json()}
500Submit ASDC Software Product
501 [Documentation] submits an asdc Software Product by its id
Jerry Floode2a48d72017-06-21 15:06:29 -0400502 [Arguments] ${id} ${version_id}=0.1
DR695Hccff30b2017-02-17 18:44:24 -0500503 ${map}= Create Dictionary action=Submit
Jerry Floode2a48d72017-06-21 15:06:29 -0400504 ${data}= Fill JSON Template File ${ASDC_ACTION_TEMPLATE} ${map}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500505 ${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}
506 Should Be Equal As Strings ${resp.status_code} 200
DR695Hccff30b2017-02-17 18:44:24 -0500507 [Return] ${resp.json()}
508Package ASDC Software Product
509 [Documentation] creates_package on an asdc Software Product by its id
Jerry Floode2a48d72017-06-21 15:06:29 -0400510 [Arguments] ${id} ${version_id}=0.1
DR695Hccff30b2017-02-17 18:44:24 -0500511 ${map}= Create Dictionary action=Create_Package
Jerry Floode2a48d72017-06-21 15:06:29 -0400512 ${data}= Fill JSON Template File ${ASDC_ACTION_TEMPLATE} ${map}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500513 ${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}
514 Should Be Equal As Strings ${resp.status_code} 200
Jerry Floode2a48d72017-06-21 15:06:29 -0400515 [Return] ${resp.json()}
DR695Hccff30b2017-02-17 18:44:24 -0500516Add ASDC Entitlement Pool
517 [Documentation] Creates an asdc Entitlement Pool and returns its id
Brian Freeman15033782019-03-22 15:48:55 -0500518 [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 -0400519 ${uuid}= Generate UUID
520 ${shortened_uuid}= Evaluate str("${uuid}")[:23]
Brian Freeman15033782019-03-22 15:48:55 -0500521 ${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 -0400522 ${data}= Fill JSON Template File ${ASDC_ENTITLEMENT_POOL_TEMPLATE} ${map}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500523 ${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}
524 Should Be Equal As Strings ${resp.status_code} 200
DR695Hccff30b2017-02-17 18:44:24 -0500525 [Return] ${resp.json()['value']}
526Get ASDC Entitlement Pool
527 [Documentation] gets an asdc Entitlement Pool by its id
528 [Arguments] ${license_model_id} ${pool_id}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500529 ${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 -0500530 [Return] ${resp.json()}
531Add ASDC License Group
532 [Documentation] Creates an asdc license group and returns its id
Brian Freeman15033782019-03-22 15:48:55 -0500533 [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 -0400534 ${uuid}= Generate UUID
535 ${shortened_uuid}= Evaluate str("${uuid}")[:23]
Brian Freeman15033782019-03-22 15:48:55 -0500536 ${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 -0400537 ${data}= Fill JSON Template File ${ASDC_KEY_GROUP_TEMPLATE} ${map}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500538 ${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}
539 Should Be Equal As Strings ${resp.status_code} 200
DR695Hccff30b2017-02-17 18:44:24 -0500540 [Return] ${resp.json()['value']}
541Get ASDC License Group
542 [Documentation] gets an asdc license group by its id
Jerry Floode2a48d72017-06-21 15:06:29 -0400543 [Arguments] ${license_model_id} ${group_id} ${version_id}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500544 ${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 -0500545 [Return] ${resp.json()}
546Add ASDC Feature Group
547 [Documentation] Creates an asdc Feature Group and returns its id
Jerry Floode2a48d72017-06-21 15:06:29 -0400548 [Arguments] ${license_model_id} ${key_group_id} ${entitlement_pool_id} ${version_id}=0.1
549 ${uuid}= Generate UUID
550 ${shortened_uuid}= Evaluate str("${uuid}")[:23]
Jerry Flood80ff9852017-08-11 06:47:14 -0400551 ${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 -0400552 ${data}= Fill JSON Template File ${ASDC_FEATURE_GROUP_TEMPLATE} ${map}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500553 ${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}
554 Should Be Equal As Strings ${resp.status_code} 200
DR695Hccff30b2017-02-17 18:44:24 -0500555 [Return] ${resp.json()['value']}
556Get ASDC Feature Group
557 [Documentation] gets an asdc Feature Group by its id
558 [Arguments] ${license_model_id} ${group_id}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500559 ${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 -0500560 [Return] ${resp.json()}
561Add ASDC License Agreement
562 [Documentation] Creates an asdc License Agreement and returns its id
Jerry Floode2a48d72017-06-21 15:06:29 -0400563 [Arguments] ${license_model_id} ${feature_group_id} ${version_id}=0.1
564 ${uuid}= Generate UUID
565 ${shortened_uuid}= Evaluate str("${uuid}")[:23]
DR695Hccff30b2017-02-17 18:44:24 -0500566 ${map}= Create Dictionary license_agreement_name=${shortened_uuid} feature_group_id=${feature_group_id}
Jerry Floode2a48d72017-06-21 15:06:29 -0400567 ${data}= Fill JSON Template File ${ASDC_LICENSE_AGREEMENT_TEMPLATE} ${map}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500568 ${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}
569 Should Be Equal As Strings ${resp.status_code} 200
DR695Hccff30b2017-02-17 18:44:24 -0500570 [Return] ${resp.json()['value']}
571Get ASDC License Agreement
572 [Documentation] gets an asdc License Agreement by its id
573 [Arguments] ${license_model_id} ${agreement_id}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500574 ${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 -0500575 [Return] ${resp.json()}
576Add ASDC Software Product
577 [Documentation] Creates an asdc Software Product and returns its id
Brian Freeman9c42ae12018-11-27 14:33:27 -0500578 [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 -0400579 ${uuid}= Generate UUID
Brian Freeman9c42ae12018-11-27 14:33:27 -0500580 ${shortened_uuid}= Evaluate str("${uuid}")[:13]
581 ${software_product_name}= Catenate ${name_prefix} ${shortened_uuid}
582 ${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 -0400583 ${data}= Fill JSON Template File ${ASDC_SOFTWARE_PRODUCT_TEMPLATE} ${map}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500584 ${resp}= Run ASDC Post Request ${ASDC_VENDOR_SOFTWARE_PRODUCT_PATH} ${data} ${ASDC_DESIGNER_USER_ID} ${ASDC_BE_ONBOARD_ENDPOINT}
585 Should Be Equal As Strings ${resp.status_code} 200
Brian Freemanb568e5e2018-04-05 21:03:38 -0500586 [Return] ${resp.json()['itemId']} ${resp.json()['version']['id']}
DR695Hccff30b2017-02-17 18:44:24 -0500587Get ASDC Software Product
588 [Documentation] gets an asdc Software Product by its id
Jerry Floode2a48d72017-06-21 15:06:29 -0400589 [Arguments] ${software_product_id} ${version_id}=0.1
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500590 ${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 -0500591 [Return] ${resp.json()}
bdfreeman1421b2a49512018-11-25 07:32:19 -0500592
DR695Hccff30b2017-02-17 18:44:24 -0500593Add ASDC Catalog Resource
594 [Documentation] Creates an asdc Catalog Resource and returns its id
595 [Arguments] ${license_agreement_id} ${software_product_name} ${license_model_name} ${software_product_id}
596 ${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 -0400597 ${data}= Fill JSON Template File ${ASDC_CATALOG_RESOURCE_TEMPLATE} ${map}
bdfreeman1421b2a49512018-11-25 07:32:19 -0500598 ${resp}= Run ASDC Post Request ${ASDC_CATALOG_RESOURCES_PATH} ${data} ${ASDC_DESIGNER_USER_ID}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500599 Should Be Equal As Strings ${resp.status_code} 201
DR695Hccff30b2017-02-17 18:44:24 -0500600 [Return] ${resp.json()['uniqueId']}
bdfreeman1421b2a49512018-11-25 07:32:19 -0500601
602Add ASDC Allotted Resource Catalog Resource
603 [Documentation] Creates an asdc Allotted Resource Catalog Resource and returns its id
604 [Arguments] ${license_agreement_id} ${software_product_name} ${license_model_name} ${software_product_id} ${subcategory}
605 ${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}
606 ${data}= Fill JSON Template File ${ASDC_ALLOTTED_RESOURCE_CATALOG_RESOURCE_TEMPLATE} ${map}
607 ${resp}= Run ASDC Post Request ${ASDC_CATALOG_RESOURCES_PATH} ${data} ${ASDC_DESIGNER_USER_ID}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500608 Should Be Equal As Strings ${resp.status_code} 201
bdfreeman1421b2a49512018-11-25 07:32:19 -0500609 [Return] ${resp.json()['uniqueId']}
610
DR695Hccff30b2017-02-17 18:44:24 -0500611Mark ASDC Catalog Resource Inactive
612 [Documentation] deletes an asdc Catalog Resource
613 [Arguments] ${catalog_resource_id}
614 ${resp}= Run ASDC Delete Request ${ASDC_CATALOG_RESOURCES_PATH}/${catalog_resource_id} ${ASDC_DESIGNER_USER_ID}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500615 Should Be Equal As Strings ${resp.status_code} 204
DR695Hccff30b2017-02-17 18:44:24 -0500616 [Return] ${resp}
617Delete Inactive ASDC Catalog Resources
618 [Documentation] delete all asdc Catalog Resources that are inactive
619 ${resp}= Run ASDC Delete Request ${ASDC_CATALOG_INACTIVE_RESOURCES_PATH} ${ASDC_DESIGNER_USER_ID}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500620 Should Be Equal As Strings ${resp.status_code} 200
DR695Hccff30b2017-02-17 18:44:24 -0500621 [Return] ${resp.json()}
622Get ASDC Catalog Resource
623 [Documentation] gets an asdc Catalog Resource by its id
624 [Arguments] ${catalog_resource_id}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500625 ${resp}= Run ASDC Get Request ${ASDC_CATALOG_RESOURCES_PATH}/${catalog_resource_id} ${ASDC_DESIGNER_USER_ID}
DR695Hccff30b2017-02-17 18:44:24 -0500626 [Return] ${resp.json()}
Brian Freemaneef7c6f2018-11-16 18:42:21 -0500627
Yang Xu2ec80382018-11-01 12:30:37 -0400628Get ASDC Catalog Resource Component Instances
629 [Documentation] gets asdc Catalog Resource Component Instances by its id
630 [Arguments] ${catalog_resource_id}
631 ${resp}= Run ASDC Get Request ${ASDC_FE_CATALOG_RESOURCES_PATH}/${catalog_resource_id}/filteredDataByParams?include=componentInstances ${ASDC_DESIGNER_USER_ID} ${ASDC_FE_ENDPOINT}
632 [Return] ${resp.json()}
bdfreeman1421b2a49512018-11-25 07:32:19 -0500633
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500634Get ASDC Catalog Resource Deployment Artifact Properties
635 [Documentation] gets asdc Catalog Resource Deployment Artiface Properties by its id
636 [Arguments] ${catalog_resource_id}
637 #${resp}= Run ASDC Get Request ${ASDC_CATALOG_SERVICES_PATH}/${catalog_resource_id}/filteredDataByParams?include=componentInstances ${ASDC_DESIGNER_USER_ID} ${ASDC_FE_ENDPOINT}
638 ${resp}= Run ASDC Get Request ${ASDC_CATALOG_SERVICES_PATH}/${catalog_resource_id}/filteredDataByParams?include=deploymentArtifacts ${ASDC_DESIGNER_USER_ID} ${ASDC_FE_ENDPOINT}
639 [Return] ${resp.json()}
640
641
Brian Freemaneef7c6f2018-11-16 18:42:21 -0500642Get ASDC Catalog Resource Component Instances Properties
643 [Documentation] gets asdc Catalog Resource Component Instances Properties by its id
644 [Arguments] ${catalog_resource_id}
645 #${resp}= Run ASDC Get Request ${ASDC_FE_CATALOG_RESOURCES_PATH}/${catalog_resource_id}/filteredDataByParams?include=componentInstancesProperties ${ASDC_DESIGNER_USER_ID} ${ASDC_FE_ENDPOINT}
646 ${resp}= Run ASDC Get Request ${ASDC_CATALOG_SERVICES_PATH}/${catalog_resource_id}/filteredDataByParams?include=componentInstancesProperties ${ASDC_DESIGNER_USER_ID} ${ASDC_BE_ENDPOINT}
647 [Return] ${resp.json()}
648
bdfreeman1421b2a49512018-11-25 07:32:19 -0500649Get ASDC Catalog Resource Component Instances Properties For Resource
650 [Documentation] gets asdc Catalog Resource Component Instances Properties for a Resource (VF) by its id
651 [Arguments] ${catalog_resource_id}
652 ${resp}= Run ASDC Get Request ${ASDC_FE_CATALOG_RESOURCES_PATH}/${catalog_resource_id}/filteredDataByParams?include=componentInstancesProperties ${ASDC_DESIGNER_USER_ID} ${ASDC_FE_ENDPOINT}
653 [Return] ${resp.json()}
Brian Freemaneef7c6f2018-11-16 18:42:21 -0500654
Yang Xu2ec80382018-11-01 12:30:37 -0400655Get ASDC Catalog Resource Inputs
656 [Documentation] gets asdc Catalog Inputs by its id
657 [Arguments] ${catalog_resource_id}
658 ${resp}= Run ASDC Get Request ${ASDC_FE_CATALOG_RESOURCES_PATH}/${catalog_resource_id}/filteredDataByParams?include=inputs ${ASDC_DESIGNER_USER_ID} ${ASDC_FE_ENDPOINT}
659 [Return] ${resp.json()}
Brian Freemaneef7c6f2018-11-16 18:42:21 -0500660
Yang Xu2ec80382018-11-01 12:30:37 -0400661Get ASDC Catalog Resource Component Instance Properties
662 [Documentation] gets an asdc Catalog Resource properties by its id
663 [Arguments] ${catalog_resource_id} ${component_instance_id} ${component_id}
664 ${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}
665 [Return] ${resp.json()}
bdfreeman1421b2a49512018-11-25 07:32:19 -0500666
Yang Xu2ec80382018-11-01 12:30:37 -0400667Set ASDC Catalog Resource Component Instance Properties
668 [Documentation] sets an asdc Catalog Resource by its id
Brian Freemaneef7c6f2018-11-16 18:42:21 -0500669 [Arguments] ${catalog_resource_id} ${component_parent_service_id} ${data}
670 #${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}
671 ${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 -0500672 [Return] ${resp.json()}
673
674Set ASDC Catalog Resource Component Instance Properties For Resource
675 [Documentation] sets an asdc Catalog Resource by its id
676 [Arguments] ${catalog_parent_resource_id} ${catalog_resource_id} ${data}
677 #${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}
678 ${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}
679 [Return] ${resp.json()}
Brian Freemaneef7c6f2018-11-16 18:42:21 -0500680
Yang Xu74cfb862018-12-06 21:57:32 -0500681Set CDS Catalog Resource Component Instance Properties
682 [Documentation] sets an asdc Catalog Resource by its id
683 [Arguments] ${catalog_resource_id} ${component_instance_id} ${data}
684 ${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}
685 [Return] ${resp.json()}
686
Yang Xu2ec80382018-11-01 12:30:37 -0400687Set ASDC Catalog Resource VNF Inputs
688 [Documentation] sets an asdc Catalog Resource by its id
689 [Arguments] ${catalog_resource_id} ${data}
690 ${resp}= Run ASDC Post Request ${ASDC_FE_CATALOG_RESOURCES_PATH}/${catalog_resource_id}/update/inputs ${data} ${ASDC_DESIGNER_USER_ID} ${ASDC_FE_ENDPOINT}
691 [Return] ${resp.json()}
Brian Freeman79b00ce2018-11-01 14:57:53 -0500692Get SDC Demo Vnf Catalog Resource
693 [Documentation] gets resource id's for demonstration VNFs for instantiate
694 [Arguments] ${service_name}
695 ${resp}= Run ASDC Get Request ${ASDC_CATALOG_SERVICES_PATH}/serviceName/${service_name}/serviceVersion/1.0
696 @{ITEMS}= Copy List ${resp.json()['componentInstances']}
697 ${demo_catalog_resource}= Create Dictionary
698 :FOR ${ELEMENT} IN @{ITEMS}
699 \ Log ${ELEMENT['name']}
700 \ Log ${ELEMENT['groupInstances'][0]['groupName']}
701 \ ${vnf}= Get VNF From Group Name ${ELEMENT['groupInstances'][0]['groupName']} ${service_name}
702 \ ${vnf_data}= Create Dictionary vnf_type=${ELEMENT['name']} vf_module=${ELEMENT['groupInstances'][0]['groupName']}
703 \ LOG ${vnf_data}
704 \ Set To Dictionary ${demo_catalog_resource} ${vnf}=${vnf_data}
705 \ LOG ${demo_catalog_resource}
706 [Return] ${demo_catalog_resource}
707
708Get VNF From Group Name
709 [Documentation] looks up vnf key from service mapping for a regex on groupName and service_name
710 [Arguments] ${group_name} ${service_name}
711 ${vnf}= Set Variable If
Brian Freeman4c71b0b2019-04-26 08:08:56 -0500712 ... ('${service_name}'=='demoVFWCL') and ('base_vfw' in '${group_name}') vFWCLvFWSNK
713 ... ('${service_name}'=='demoVFWCL') and ('base_vpkg' in '${group_name}') vFWCLvPKG
Brian Freeman79b00ce2018-11-01 14:57:53 -0500714 ... ('${service_name}'=='demoVLB') and ('base_vlb' in '${group_name}') vLB
715 [Return] ${vnf}
DR695Hccff30b2017-02-17 18:44:24 -0500716Checkin ASDC Catalog Resource
717 [Documentation] checksin an asdc Catalog Resource by its id
718 [Arguments] ${catalog_resource_id}
719 ${map}= Create Dictionary user_remarks=Robot remarks
Jerry Floode2a48d72017-06-21 15:06:29 -0400720 ${data}= Fill JSON Template File ${ASDC_USER_REMARKS_TEMPLATE} ${map}
DR695Hccff30b2017-02-17 18:44:24 -0500721 ${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 -0500722 Should Be Equal As Strings ${resp.status_code} 200
DR695Hccff30b2017-02-17 18:44:24 -0500723 [Return] ${resp.json()}
724Request Certify ASDC Catalog Resource
725 [Documentation] requests certify on an asdc Catalog Resource by its id
726 [Arguments] ${catalog_resource_id}
727 ${map}= Create Dictionary user_remarks=Robot remarks
Jerry Floode2a48d72017-06-21 15:06:29 -0400728 ${data}= Fill JSON Template File ${ASDC_USER_REMARKS_TEMPLATE} ${map}
DR695Hccff30b2017-02-17 18:44:24 -0500729 ${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 -0500730 Should Be Equal As Strings ${resp.status_code} 200
DR695Hccff30b2017-02-17 18:44:24 -0500731 [Return] ${resp.json()}
732Start Certify ASDC Catalog Resource
733 [Documentation] start certify an asdc Catalog Resource by its id
734 [Arguments] ${catalog_resource_id}
735 ${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 -0500736 Should Be Equal As Strings ${resp.status_code} 200
DR695Hccff30b2017-02-17 18:44:24 -0500737 [Return] ${resp.json()}
738Certify ASDC Catalog Resource
739 [Documentation] start certify an asdc Catalog Resource by its id and returns the new id
Brian Freemandb1e7412018-08-01 12:46:01 -0500740 [Arguments] ${catalog_resource_id} ${user_id}=${ASDC_TESTER_USER_ID}
DR695Hccff30b2017-02-17 18:44:24 -0500741 ${map}= Create Dictionary user_remarks=Robot remarks
Jerry Floode2a48d72017-06-21 15:06:29 -0400742 ${data}= Fill JSON Template File ${ASDC_USER_REMARKS_TEMPLATE} ${map}
Brian Freemandb1e7412018-08-01 12:46:01 -0500743 ${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 -0500744 Should Be Equal As Strings ${resp.status_code} 200
DR695Hccff30b2017-02-17 18:44:24 -0500745 [Return] ${resp.json()['uniqueId']}
Jerry Flood6bd1afa2017-10-09 09:59:23 -0400746
DR695Hccff30b2017-02-17 18:44:24 -0500747Upload ASDC Heat Package
Brian Freemanf508ab22018-03-15 21:19:41 -0500748 [Documentation] Creates an asdc Software Product and returns its id
749 [Arguments] ${software_product_id} ${file_path} ${version_id}=0.1
Jerry Flood6bd1afa2017-10-09 09:59:23 -0400750 ${files}= Create Dictionary
751 Create Multi Part ${files} upload ${file_path} contentType=application/zip
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500752 ${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}
753 Should Be Equal As Strings ${resp.status_code} 200
Jerry Flood6bd1afa2017-10-09 09:59:23 -0400754
DR695Hccff30b2017-02-17 18:44:24 -0500755Add ASDC Catalog Service
756 [Documentation] Creates an asdc Catalog Service and returns its id
jf986075010a42017-02-22 16:52:54 -0500757 [Arguments] ${catalog_service_name}
Jerry Floode2a48d72017-06-21 15:06:29 -0400758 ${uuid}= Generate UUID
jf986075010a42017-02-22 16:52:54 -0500759 ${shortened_uuid}= Evaluate str("${uuid}")[:23]
Jerry Floode2a48d72017-06-21 15:06:29 -0400760 ${catalog_service_name}= Set Variable If '${catalog_service_name}' =='' ${shortened_uuid} ${catalog_service_name}
jf986075010a42017-02-22 16:52:54 -0500761 ${map}= Create Dictionary service_name=${catalog_service_name}
Jerry Floode2a48d72017-06-21 15:06:29 -0400762 ${data}= Fill JSON Template File ${ASDC_CATALOG_SERVICE_TEMPLATE} ${map}
DR695Hccff30b2017-02-17 18:44:24 -0500763 ${resp}= Run ASDC Post Request ${ASDC_CATALOG_SERVICES_PATH} ${data} ${ASDC_DESIGNER_USER_ID}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500764 Should Be Equal As Strings ${resp.status_code} 201
DR695Hccff30b2017-02-17 18:44:24 -0500765 [Return] ${resp.json()['uniqueId']}
766Mark ASDC Catalog Service Inactive
767 [Documentation] Deletes an asdc Catalog Service
768 [Arguments] ${catalog_service_id}
769 ${resp}= Run ASDC Delete Request ${ASDC_CATALOG_SERVICES_PATH}/${catalog_service_id} ${ASDC_DESIGNER_USER_ID}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500770 Should Be Equal As Strings ${resp.status_code} 204
DR695Hccff30b2017-02-17 18:44:24 -0500771 [Return] ${resp}
772Delete Inactive ASDC Catalog Services
773 [Documentation] delete all asdc Catalog Serivces that are inactive
774 ${resp}= Run ASDC Delete Request ${ASDC_CATALOG_INACTIVE_SERVICES_PATH} ${ASDC_DESIGNER_USER_ID}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500775 Should Be Equal As Strings ${resp.status_code} 200
DR695Hccff30b2017-02-17 18:44:24 -0500776 [Return] ${resp.json()}
777Get ASDC Catalog Service
778 [Documentation] gets an asdc Catalog Service by its id
779 [Arguments] ${catalog_service_id}
780 ${resp}= Run ASDC Get Request ${ASDC_CATALOG_SERVICES_PATH}/${catalog_service_id} ${ASDC_DESIGNER_USER_ID}
781 [Return] ${resp.json()}
782Checkin ASDC Catalog Service
783 [Documentation] checksin an asdc Catalog Service by its id
784 [Arguments] ${catalog_service_id}
785 ${map}= Create Dictionary user_remarks=Robot remarks
Jerry Floode2a48d72017-06-21 15:06:29 -0400786 ${data}= Fill JSON Template File ${ASDC_USER_REMARKS_TEMPLATE} ${map}
DR695Hccff30b2017-02-17 18:44:24 -0500787 ${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 -0500788 Should Be Equal As Strings ${resp.status_code} 200
DR695Hccff30b2017-02-17 18:44:24 -0500789 [Return] ${resp.json()}
790Request Certify ASDC Catalog Service
791 [Documentation] requests certify on an asdc Catalog Service by its id
792 [Arguments] ${catalog_service_id}
793 ${map}= Create Dictionary user_remarks=Robot remarks
Jerry Floode2a48d72017-06-21 15:06:29 -0400794 ${data}= Fill JSON Template File ${ASDC_USER_REMARKS_TEMPLATE} ${map}
DR695Hccff30b2017-02-17 18:44:24 -0500795 ${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 -0500796 Should Be Equal As Strings ${resp.status_code} 200
DR695Hccff30b2017-02-17 18:44:24 -0500797 [Return] ${resp.json()}
798Start Certify ASDC Catalog Service
799 [Documentation] start certify an asdc Catalog Service by its id
800 [Arguments] ${catalog_service_id}
801 ${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 -0500802 Should Be Equal As Strings ${resp.status_code} 200
DR695Hccff30b2017-02-17 18:44:24 -0500803 [Return] ${resp.json()}
804Certify ASDC Catalog Service
805 [Documentation] start certify an asdc Catalog Service by its id and returns the new id
806 [Arguments] ${catalog_service_id}
807 ${map}= Create Dictionary user_remarks=Robot remarks
Jerry Floode2a48d72017-06-21 15:06:29 -0400808 ${data}= Fill JSON Template File ${ASDC_USER_REMARKS_TEMPLATE} ${map}
DR695Hccff30b2017-02-17 18:44:24 -0500809 ${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 -0500810 Should Be Equal As Strings ${resp.status_code} 200
DR695Hccff30b2017-02-17 18:44:24 -0500811 [Return] ${resp.json()['uniqueId']}
812Approve ASDC Catalog Service
813 [Documentation] approve an asdc Catalog Service by its id
814 [Arguments] ${catalog_service_id}
815 ${map}= Create Dictionary user_remarks=Robot remarks
Jerry Floode2a48d72017-06-21 15:06:29 -0400816 ${data}= Fill JSON Template File ${ASDC_USER_REMARKS_TEMPLATE} ${map}
DR695Hccff30b2017-02-17 18:44:24 -0500817 ${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 -0500818 Should Be Equal As Strings ${resp.status_code} 200
DR695Hccff30b2017-02-17 18:44:24 -0500819 [Return] ${resp.json()}
820Distribute ASDC Catalog Service
821 [Documentation] distribute an asdc Catalog Service by its id
822 [Arguments] ${catalog_service_id}
823 ${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 -0500824 Should Be Equal As Strings ${resp.status_code} 200
DR695Hccff30b2017-02-17 18:44:24 -0500825 [Return] ${resp.json()}
bdfreeman1421b2a49512018-11-25 07:32:19 -0500826
DR695Hccff30b2017-02-17 18:44:24 -0500827Add ASDC Resource Instance
828 [Documentation] Creates an asdc Resource Instance and returns its id
Brian Freemaneef7c6f2018-11-16 18:42:21 -0500829 [Arguments] ${catalog_service_id} ${catalog_resource_id} ${catalog_resource_name} ${xoffset}=${0} ${yoffset}=${0}
DR695Hccff30b2017-02-17 18:44:24 -0500830 ${milli_timestamp}= Generate MilliTimestamp UUID
Brian Freemaneef7c6f2018-11-16 18:42:21 -0500831 ${xoffset}= Set Variable ${xoffset+306}
832 ${yoffset}= Set Variable ${yoffset+248}
833 ${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 -0400834 ${data}= Fill JSON Template File ${ASDC_RESOURCE_INSTANCE_TEMPLATE} ${map}
DR695Hccff30b2017-02-17 18:44:24 -0500835 ${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 -0500836 Should Be Equal As Strings ${resp.status_code} 201
DR695Hccff30b2017-02-17 18:44:24 -0500837 [Return] ${resp.json()['uniqueId']}
Brian Freemaneef7c6f2018-11-16 18:42:21 -0500838
bdfreeman1421b2a49512018-11-25 07:32:19 -0500839Add ASDC Resource Instance To Resource
840 [Documentation] Creates an asdc Resource Instance in a Resource (VF) and returns its id
841 [Arguments] ${parent_catalog_resource_id} ${catalog_resource_id} ${catalog_resource_name} ${xoffset}=${0} ${yoffset}=${0}
842 ${milli_timestamp}= Generate MilliTimestamp UUID
843 ${xoffset}= Set Variable ${xoffset+306}
844 ${yoffset}= Set Variable ${yoffset+248}
845 ${map}= Create Dictionary catalog_resource_id=${catalog_resource_id} catalog_resource_name=${catalog_resource_name} milli_timestamp=${milli_timestamp} posX=${xoffset} posY=${yoffset}
846 ${data}= Fill JSON Template File ${ASDC_RESOURCE_INSTANCE_TEMPLATE} ${map}
847 ${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 -0500848 Should Be Equal As Strings ${resp.status_code} 201
bdfreeman1421b2a49512018-11-25 07:32:19 -0500849 [Return] ${resp.json()['uniqueId']}
850
DR695Hccff30b2017-02-17 18:44:24 -0500851Get Catalog Service Distribution
852 [Documentation] gets an asdc catalog Service distrbution
853 [Arguments] ${catalog_service_uuid}
854 ${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 -0500855 Should Be Equal As Strings ${resp.status_code} 200
DR695Hccff30b2017-02-17 18:44:24 -0500856 [Return] ${resp.json()}
857Check Catalog Service Distributed
858 [Documentation] gets an asdc catalog Service distrbution
Brian Freemanadaa2372018-10-24 12:25:22 -0500859 [Arguments] ${catalog_service_uuid} ${dist_status}
DR695Hccff30b2017-02-17 18:44:24 -0500860 ${dist_resp}= Get Catalog Service Distribution ${catalog_service_uuid}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500861 Should Be Equal As Strings ${dist_resp['distributionStatusOfServiceList'][0]['deployementStatus']} Distributed
DR695Hccff30b2017-02-17 18:44:24 -0500862 ${det_resp}= Get Catalog Service Distribution Details ${dist_resp['distributionStatusOfServiceList'][0]['distributionID']}
863 @{ITEMS}= Copy List ${det_resp['distributionStatusList']}
Brian Freemanf508ab22018-03-15 21:19:41 -0500864 Should Not Be Empty ${ITEMS}
Brian Freemana62644f2018-05-13 12:47:38 -0500865 ${SO_COMPLETE} Set Variable FALSE
bdfreeman1421b2a49512018-11-25 07:32:19 -0500866 ${dist_status} Set Variable CONTINUE
867 Should Not Be Empty ${ITEMS}
DR695Hccff30b2017-02-17 18:44:24 -0500868 :FOR ${ELEMENT} IN @{ITEMS}
Brian Freemanf508ab22018-03-15 21:19:41 -0500869 \ Log ${ELEMENT['omfComponentID']}
DR695Hccff30b2017-02-17 18:44:24 -0500870 \ Log ${ELEMENT['status']}
Brian Freeman41ab5e52018-08-08 14:24:23 -0500871 \ ${SO_COMPLETE} Set Variable If (('${ELEMENT['status']}' == 'DISTRIBUTION_COMPLETE_OK')) or ('${SO_COMPLETE}'=='TRUE') TRUE
Brian Freemaneca71072018-08-16 14:50:16 -0500872 \ Exit For Loop If ('${SO_COMPLETE}'=='TRUE')
873 \ Exit For Loop If ('${ELEMENT['status']}' == 'DISTRIBUTION_COMPLETE_ERROR')
Brian Freemanadaa2372018-10-24 12:25:22 -0500874 \ ${dist_status}= Set Variable If (('${ELEMENT['status']}' == 'COMPONENT_DONE_ERROR') and ('${ELEMENT['omfComponentID']}' == 'aai-ml')) EXIT
875 \ Exit For Loop If (('${ELEMENT['status']}' == 'COMPONENT_DONE_ERROR') and ('${ELEMENT['omfComponentID']}' == 'aai-ml'))
Brian Freemana62644f2018-05-13 12:47:38 -0500876 Should Be True ( '${SO_COMPLETE}'=='TRUE') SO Test
bdfreeman1421b2a49512018-11-25 07:32:19 -0500877
DR695Hccff30b2017-02-17 18:44:24 -0500878Get Catalog Service Distribution Details
879 [Documentation] gets an asdc catalog Service distrbution details
880 [Arguments] ${catalog_service_distribution_id}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500881 ${resp}= Run ASDC Get Request ${ASDC_CATALOG_SERVICES_PATH}${ASDC_CATALOG_SERVICE_DISTRIBUTION_PATH}/${catalog_service_distribution_id} ${ASDC_OPS_USER_ID}
882 Should Be Equal As Strings ${resp.status_code} 200
DR695Hccff30b2017-02-17 18:44:24 -0500883 [Return] ${resp.json()}
884Run ASDC Health Check
885 [Documentation] Runs a ASDC health check
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500886 ${session}= Create Session asdc ${ASDC_FE_ENDPOINT}
DR695Hccff30b2017-02-17 18:44:24 -0500887 ${uuid}= Generate UUID
888 ${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 -0500889 ${resp}= Get Request asdc ${ASDC_HEALTH_CHECK_PATH} headers=${headers}
Brian Freemanadaa2372018-10-24 12:25:22 -0500890 # only test for HTTP 200 to determine SDC Health. SDC_DE_HEALTH is informational
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500891 Should Be Equal As Strings ${resp.status_code} 200 SDC DOWN
Brian Freeman5cf5fa62018-04-23 20:28:16 -0500892 ${SDC_DE_HEALTH}= Catenate DOWN
DR695Hccff30b2017-02-17 18:44:24 -0500893 @{ITEMS}= Copy List ${resp.json()['componentsInfo']}
894 :FOR ${ELEMENT} IN @{ITEMS}
895 \ Log ${ELEMENT['healthCheckStatus']}
Brian Freemane546f7e2018-04-19 12:17:56 -0500896 \ ${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 -0500897 Log To Console (DMaaP:${SDC_DE_HEALTH}) no_newline=true
DR695Hccff30b2017-02-17 18:44:24 -0500898Run ASDC Get Request
899 [Documentation] Runs an ASDC get request
Brian Freeman44b8bb32018-05-03 21:08:42 -0500900 [Arguments] ${data_path} ${user}=${ASDC_DESIGNER_USER_ID} ${MY_ASDC_BE_ENDPOINT}=${ASDC_BE_ENDPOINT}
DR695Hccff30b2017-02-17 18:44:24 -0500901 ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500902 Log Creating session ${MY_ASDC_BE_ENDPOINT}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500903 ${session}= Create Session asdc ${MY_ASDC_BE_ENDPOINT} auth=${auth}
DR695Hccff30b2017-02-17 18:44:24 -0500904 ${uuid}= Generate UUID
905 ${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 -0500906 ${resp}= Get Request asdc ${data_path} headers=${headers}
DR695Hccff30b2017-02-17 18:44:24 -0500907 Log Received response from asdc ${resp.text}
908 [Return] ${resp}
909Run ASDC Put Request
910 [Documentation] Runs an ASDC put request
Brian Freeman44b8bb32018-05-03 21:08:42 -0500911 [Arguments] ${data_path} ${data} ${user}=${ASDC_DESIGNER_USER_ID} ${MY_ASDC_BE_ENDPOINT}=${ASDC_BE_ENDPOINT}
DR695Hccff30b2017-02-17 18:44:24 -0500912 ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500913 Log Creating session ${MY_ASDC_BE_ENDPOINT}
914 ${session}= Create Session asdc ${MY_ASDC_BE_ENDPOINT} auth=${auth}
DR695Hccff30b2017-02-17 18:44:24 -0500915 ${uuid}= Generate UUID
916 ${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 -0500917 ${resp}= Put Request asdc ${data_path} data=${data} headers=${headers}
DR695Hccff30b2017-02-17 18:44:24 -0500918 Log Received response from asdc ${resp.text}
919 [Return] ${resp}
Jerry Flood6bd1afa2017-10-09 09:59:23 -0400920
DR695Hccff30b2017-02-17 18:44:24 -0500921Run ASDC Post Files Request
922 [Documentation] Runs an ASDC post request
Brian Freeman44b8bb32018-05-03 21:08:42 -0500923 [Arguments] ${data_path} ${files} ${user}=${ASDC_DESIGNER_USER_ID} ${MY_ASDC_BE_ENDPOINT}=${ASDC_BE_ENDPOINT}
DR695Hccff30b2017-02-17 18:44:24 -0500924 ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500925 Log Creating session ${MY_ASDC_BE_ENDPOINT}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500926 ${session}= Create Session asdc ${MY_ASDC_BE_ENDPOINT} auth=${auth}
DR695Hccff30b2017-02-17 18:44:24 -0500927 ${uuid}= Generate UUID
928 ${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 -0500929 ${resp}= Post Request asdc ${data_path} files=${files} headers=${headers}
930 Log Received response from asdc ${resp.text}
931 [Return] ${resp}
932
933Run ASDC MD5 Post Request
934 [Documentation] Runs an ASDC post request with MD5 Checksum header
935 [Arguments] ${data_path} ${data} ${user}=${ASDC_DESIGNER_USER_ID} ${MY_ASDC_BE_ENDPOINT}=${ASDC_BE_ENDPOINT}
936 ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD}
937 Log Creating session ${MY_ASDC_BE_ENDPOINT}
938 ${session}= Create Session asdc ${MY_ASDC_BE_ENDPOINT} auth=${auth}
939 ${uuid}= Generate UUID
940 ${data_string}= Evaluate json.dumps(${data}) json
941 ${md5checksum}= Evaluate md5.new('''${data_string}''').hexdigest() modules=md5
942 ${base64md5checksum}= Evaluate base64.b64encode("${md5checksum}") modules=base64
943 ${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}
944 ${resp}= Post Request asdc ${data_path} data=${data} headers=${headers}
DR695Hccff30b2017-02-17 18:44:24 -0500945 Log Received response from asdc ${resp.text}
Jerry Floode2a48d72017-06-21 15:06:29 -0400946 [Return] ${resp}
Jerry Flood6bd1afa2017-10-09 09:59:23 -0400947
DR695Hccff30b2017-02-17 18:44:24 -0500948Run ASDC Post Request
949 [Documentation] Runs an ASDC post request
Brian Freeman44b8bb32018-05-03 21:08:42 -0500950 [Arguments] ${data_path} ${data} ${user}=${ASDC_DESIGNER_USER_ID} ${MY_ASDC_BE_ENDPOINT}=${ASDC_BE_ENDPOINT}
DR695Hccff30b2017-02-17 18:44:24 -0500951 ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500952 Log Creating session ${MY_ASDC_BE_ENDPOINT}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500953 ${session}= Create Session asdc ${MY_ASDC_BE_ENDPOINT} auth=${auth}
DR695Hccff30b2017-02-17 18:44:24 -0500954 ${uuid}= Generate UUID
955 ${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 -0500956 ${resp}= Post Request asdc ${data_path} data=${data} headers=${headers}
DR695Hccff30b2017-02-17 18:44:24 -0500957 Log Received response from asdc ${resp.text}
Jerry Floode2a48d72017-06-21 15:06:29 -0400958 [Return] ${resp}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500959
DR695Hccff30b2017-02-17 18:44:24 -0500960Run ASDC Delete Request
961 [Documentation] Runs an ASDC delete request
Brian Freeman44b8bb32018-05-03 21:08:42 -0500962 [Arguments] ${data_path} ${user}=${ASDC_DESIGNER_USER_ID} ${MY_ASDC_BE_ENDPOINT}=${ASDC_BE_ENDPOINT}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500963 ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500964 Log Creating session ${MY_ASDC_BE_ENDPOINT}
Brian Freeman2e1d0ff2019-01-23 09:38:13 -0500965 ${session}= Create Session asdc ${MY_ASDC_BE_ENDPOINT} auth=${auth}
DR695Hccff30b2017-02-17 18:44:24 -0500966 ${uuid}= Generate UUID
967 ${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 -0500968 ${resp}= Delete Request asdc ${data_path} headers=${headers}
DR695Hccff30b2017-02-17 18:44:24 -0500969 Log Received response from asdc ${resp.text}
Jerry Floode2a48d72017-06-21 15:06:29 -0400970 [Return] ${resp}
DR695Hccff30b2017-02-17 18:44:24 -0500971Open ASDC GUI
972 [Documentation] Logs in to ASDC GUI
973 [Arguments] ${PATH}
974 ## Setup Browever now being managed by the test case
975 ##Setup Browser
DR695Hbf5a3a32017-06-30 13:09:57 -0400976 Go To ${ASDC_FE_ENDPOINT}${PATH}
DR695Hccff30b2017-02-17 18:44:24 -0500977 Maximize Browser Window
Jerry Flood6bd1afa2017-10-09 09:59:23 -0400978
DR695Hccff30b2017-02-17 18:44:24 -0500979 Set Browser Implicit Wait ${GLOBAL_SELENIUM_BROWSER_IMPLICIT_WAIT}
DR695Hbf5a3a32017-06-30 13:09:57 -0400980 Log Logging in to ${ASDC_FE_ENDPOINT}${PATH}
DR695Hccff30b2017-02-17 18:44:24 -0500981 Title Should Be ASDC
Jerry Floode2a48d72017-06-21 15:06:29 -0400982 Wait Until Page Contains Element xpath=//div/a[text()='SDC'] ${GLOBAL_SELENIUM_BROWSER_WAIT_TIMEOUT}
DR695Hbf5a3a32017-06-30 13:09:57 -0400983 Log Logged in to ${ASDC_FE_ENDPOINT}${PATH}
Jerry Flood6bd1afa2017-10-09 09:59:23 -0400984
985
986Create Multi Part
987 [Arguments] ${addTo} ${partName} ${filePath} ${contentType}=${None}
988 ${fileData}= Get Binary File ${filePath}
989 ${fileDir} ${fileName}= Split Path ${filePath}
990 ${partData}= Create List ${fileName} ${fileData} ${contentType}
991 Set To Dictionary ${addTo} ${partName}=${partData}
Brian Freemanf940ee92018-05-25 21:09:05 -0500992