blob: 118b655adc13873df145cbcc5c983ea5c1486e5b [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
3Library RequestsLibrary
Jerry Floode2a48d72017-06-21 15:06:29 -04004Library UUID
5Library JSONUtils
DR695Hccff30b2017-02-17 18:44:24 -05006Library OperatingSystem
7Library Collections
8Library ExtendedSelenium2Library
bdfreeman1421b2a49512018-11-25 07:32:19 -05009Library HttpLibrary.HTTP
DR695Hccff30b2017-02-17 18:44:24 -050010Resource global_properties.robot
11Resource browser_setup.robot
12Resource json_templater.robot
13*** Variables ***
14${ASDC_DESIGNER_USER_ID} cs0008
15${ASDC_TESTER_USER_ID} jm0007
16${ASDC_GOVERNOR_USER_ID} gv0001
17${ASDC_OPS_USER_ID} op0001
18${ASDC_HEALTH_CHECK_PATH} /sdc1/rest/healthCheck
19${ASDC_VENDOR_LICENSE_MODEL_PATH} /onboarding-api/v1.0/vendor-license-models
20${ASDC_VENDOR_SOFTWARE_PRODUCT_PATH} /onboarding-api/v1.0/vendor-software-products
21${ASDC_VENDOR_KEY_GROUP_PATH} /license-key-groups
22${ASDC_VENDOR_ENTITLEMENT_POOL_PATH} /entitlement-pools
23${ASDC_VENDOR_FEATURE_GROUP_PATH} /feature-groups
24${ASDC_VENDOR_LICENSE_AGREEMENT_PATH} /license-agreements
25${ASDC_VENDOR_ACTIONS_PATH} /actions
Jerry Floode2a48d72017-06-21 15:06:29 -040026${ASDC_VENDOR_SOFTWARE_UPLOAD_PATH} /orchestration-template-candidate
Yang Xu2ec80382018-11-01 12:30:37 -040027${ASDC_FE_CATALOG_RESOURCES_PATH} /sdc1/feProxy/rest/v1/catalog/resources
Brian Freemaneef7c6f2018-11-16 18:42:21 -050028${ASDC_FE_CATALOG_SERVICES_PATH} /sdc1/feProxy/rest/v1/catalog/services
DR695Hccff30b2017-02-17 18:44:24 -050029${ASDC_CATALOG_RESOURCES_PATH} /sdc2/rest/v1/catalog/resources
30${ASDC_CATALOG_SERVICES_PATH} /sdc2/rest/v1/catalog/services
31${ASDC_CATALOG_INACTIVE_RESOURCES_PATH} /sdc2/rest/v1/inactiveComponents/resource
Brian Freemaneef7c6f2018-11-16 18:42:21 -050032${ASDC_CATALOG_RESOURCES_QUERY_PATH} /sdc2/rest/v1/catalog/resources/resourceName
DR695Hccff30b2017-02-17 18:44:24 -050033${ASDC_CATALOG_INACTIVE_SERVICES_PATH} /sdc2/rest/v1/inactiveComponents/service
34${ASDC_CATALOG_LIFECYCLE_PATH} /lifecycleState
35${ASDC_CATALOG_SERVICE_RESOURCE_INSTANCE_PATH} /resourceInstance
36${ASDC_CATALOG_SERVICE_DISTRIBUTION_STATE_PATH} /distribution-state
37${ASDC_CATALOG_SERVICE_DISTRIBUTION_PATH} /distribution
38${ASDC_DISTRIBUTION_STATE_APPROVE_PATH} /approve
39${ASDC_CATALOG_SERVICE_DISTRIBUTION_ACTIVATE_PATH} /distribution/PROD/activate
40${ASDC_LICENSE_MODEL_TEMPLATE} robot/assets/templates/asdc/license_model.template
41${ASDC_KEY_GROUP_TEMPLATE} robot/assets/templates/asdc/key_group.template
42${ASDC_ENTITLEMENT_POOL_TEMPLATE} robot/assets/templates/asdc/entitlement_pool.template
43${ASDC_FEATURE_GROUP_TEMPLATE} robot/assets/templates/asdc/feature_group.template
44${ASDC_LICENSE_AGREEMENT_TEMPLATE} robot/assets/templates/asdc/license_agreement.template
45${ASDC_ACTION_TEMPLATE} robot/assets/templates/asdc/action.template
46${ASDC_SOFTWARE_PRODUCT_TEMPLATE} robot/assets/templates/asdc/software_product.template
47${ASDC_CATALOG_RESOURCE_TEMPLATE} robot/assets/templates/asdc/catalog_resource.template
48${ASDC_USER_REMARKS_TEMPLATE} robot/assets/templates/asdc/user_remarks.template
49${ASDC_CATALOG_SERVICE_TEMPLATE} robot/assets/templates/asdc/catalog_service.template
50${ASDC_RESOURCE_INSTANCE_TEMPLATE} robot/assets/templates/asdc/resource_instance.template
Yang Xu2ec80382018-11-01 12:30:37 -040051${ASDC_RESOURCE_INSTANCE_VNF_PROPERTIES_TEMPLATE} robot/assets/templates/asdc/catalog_vnf_properties.template
52${ASDC_RESOURCE_INSTANCE_VNF_INPUTS_TEMPLATE} robot/assets/templates/asdc/catalog_vnf_inputs.template
Brian Freemaneef7c6f2018-11-16 18:42:21 -050053${SDC_CATALOG_NET_RESOURCE_INPUT_TEMPLATE} robot/assets/templates/asdc/catalog_net_input_properties.template
bdfreeman1421b2a49512018-11-25 07:32:19 -050054${ASDC_ALLOTTED_RESOURCE_CATALOG_RESOURCE_TEMPLATE} robot/assets/templates/asdc/catalog_resource_alloted_resource.template
55${SDC_CATALOG_ALLOTTED_RESOURCE_PROPERTIES_TEMPLATE} robot/assets/templates/asdc/catalog_allotted_properties.template
56${SDC_CATALOG_ALLOTTED_RESOURCE_INPUTS_TEMPLATE} robot/assets/templates/asdc/catalog_allotted_inputs.template
Brian Freemanf508ab22018-03-15 21:19:41 -050057${ASDC_FE_ENDPOINT} ${GLOBAL_ASDC_SERVER_PROTOCOL}://${GLOBAL_INJECTED_SDC_FE_IP_ADDR}:${GLOBAL_ASDC_FE_PORT}
58${ASDC_BE_ENDPOINT} ${GLOBAL_ASDC_SERVER_PROTOCOL}://${GLOBAL_INJECTED_SDC_BE_IP_ADDR}:${GLOBAL_ASDC_BE_PORT}
Brian Freeman44b8bb32018-05-03 21:08:42 -050059${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 -040060
DR695Hccff30b2017-02-17 18:44:24 -050061*** Keywords ***
62Distribute Model From ASDC
63 [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 -050064 [Arguments] ${model_zip_path} ${catalog_service_name}= ${cds}= ${service}=
bdfreeman1421b2a49512018-11-25 07:32:19 -050065 # For Testing use random service names
Brian Freemaneef7c6f2018-11-16 18:42:21 -050066 #${random}= Get Current Date
67 #${catalog_service_id}= Add ASDC Catalog Service ${catalog_service_name}_${random}
jf986075010a42017-02-22 16:52:54 -050068 ${catalog_service_id}= Add ASDC Catalog Service ${catalog_service_name}
DR695Hccff30b2017-02-17 18:44:24 -050069 ${catalog_resource_ids}= Create List
Jerry Flood3a169a32017-12-01 12:39:10 -050070 ${catalog_resources}= Create Dictionary
DR695Hccff30b2017-02-17 18:44:24 -050071 : FOR ${zip} IN @{model_zip_path}
Yang Xu2ec80382018-11-01 12:30:37 -040072 \ ${loop_catalog_resource_id}= Setup ASDC Catalog Resource ${zip} ${cds}
Jerry Floode2a48d72017-06-21 15:06:29 -040073 \ Append To List ${catalog_resource_ids} ${loop_catalog_resource_id}
DR695Hccff30b2017-02-17 18:44:24 -050074 \ ${loop_catalog_resource_resp}= Get ASDC Catalog Resource ${loop_catalog_resource_id}
75 \ Add ASDC Resource Instance ${catalog_service_id} ${loop_catalog_resource_id} ${loop_catalog_resource_resp['name']}
Jerry Flood3a169a32017-12-01 12:39:10 -050076 \ Set To Dictionary ${catalog_resources} ${loop_catalog_resource_id}=${loop_catalog_resource_resp}
Brian Freemaneef7c6f2018-11-16 18:42:21 -050077 #
78 # do this here because the loop_catalog_resource_resp is different format after adding networks
79 ${vf_module}= Find Element In Array ${loop_catalog_resource_resp['groups']} type org.openecomp.groups.VfModule
80 #
81 # do network
82 ${networklist}= Get From Dictionary ${GLOBAL_SERVICE_GEN_NEUTRON_NETWORK_MAPPING} ${service}
83 ${xoffset}= Set Variable ${100}
84 ${generic_neutron_net_uuid}= Get Generic NeutronNet UUID
85 :FOR ${network} in @{networklist}
86 \ ${loop_catalog_resource_id}= Set Variable ${generic_neutron_net_uuid}
87 \ Append To List ${catalog_resource_ids} ${loop_catalog_resource_id}
88 \ ${loop_catalog_resource_resp}= Get ASDC Catalog Resource ${loop_catalog_resource_id}
Brian Freemaneef7c6f2018-11-16 18:42:21 -050089 \ ${loop_catalog_resource_id}= Add ASDC Resource Instance ${catalog_service_id} ${loop_catalog_resource_id} ${network} ${xoffset} ${0}
90 \ ${nf_role}= Convert To Lowercase ${network}
91 \ Setup SDC Catalog Resource GenericNeutronNet Properties ${catalog_service_id} ${nf_role} ${loop_catalog_resource_id}
92 \ ${xoffset}= Set Variable ${xoffset+100}
93 \ Set To Dictionary ${catalog_resources} ${loop_catalog_resource_id}=${loop_catalog_resource_resp}
DR695Hccff30b2017-02-17 18:44:24 -050094 ${catalog_service_resp}= Get ASDC Catalog Service ${catalog_service_id}
95 Checkin ASDC Catalog Service ${catalog_service_id}
96 Request Certify ASDC Catalog Service ${catalog_service_id}
97 Start Certify ASDC Catalog Service ${catalog_service_id}
98 # on certify it gets a new id
99 ${catalog_service_id}= Certify ASDC Catalog Service ${catalog_service_id}
100 Approve ASDC Catalog Service ${catalog_service_id}
Brian Freeman796b9eb2018-10-08 08:23:20 -0500101 : FOR ${DIST_INDEX} IN RANGE 1
Brian Freeman18df8912018-05-25 13:27:29 -0500102 \ Log Distribution Attempt ${DIST_INDEX}
103 \ Distribute ASDC Catalog Service ${catalog_service_id}
104 \ ${catalog_service_resp}= Get ASDC Catalog Service ${catalog_service_id}
Brian Freemanf940ee92018-05-25 21:09:05 -0500105 \ ${status} ${_} = Run Keyword And Ignore Error Loop Over Check Catalog Service Distributed ${catalog_service_resp['uuid']}
106 \ Exit For Loop If '${status}'=='PASS'
Brian Freeman8c002d52018-07-30 19:35:36 -0500107 Should Be Equal As Strings ${status} PASS
Jerry Flood3a169a32017-12-01 12:39:10 -0500108 [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 -0500109
bdfreeman1421b2a49512018-11-25 07:32:19 -0500110Distribute vCPEResCust Model From ASDC
111 [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
112 [Arguments] ${model_zip_path} ${catalog_service_name}= ${cds}= ${service}=
113 # For testing use random service name
Brian Freeman9c42ae12018-11-27 14:33:27 -0500114 #${random}= Get Current Date
115 #${catalog_service_id}= Add ASDC Catalog Service ${catalog_service_name}_${random}
116 # catalog_service_name already
117 ${catalog_service_id}= Add ASDC Catalog Service ${catalog_service_name}
bdfreeman1421b2a49512018-11-25 07:32:19 -0500118 Log To Console ${\n}ServiceName: ${catalog_service_name}_${random}
119 #${catalog_service_id}= Add ASDC Catalog Service ${catalog_service_name}
120 ${catalog_resource_ids}= Create List
121 ${catalog_resources}= Create Dictionary
122 : FOR ${zip} IN @{model_zip_path}
123 \ ${loop_catalog_resource_id}= Setup ASDC Catalog Resource ${zip} ${cds}
124 \ Append To List ${catalog_resource_ids} ${loop_catalog_resource_id}
125 \ ${loop_catalog_resource_resp}= Get ASDC Catalog Resource ${loop_catalog_resource_id}
126 \ Add ASDC Resource Instance ${catalog_service_id} ${loop_catalog_resource_id} ${loop_catalog_resource_resp['name']}
127 \ Set To Dictionary ${catalog_resources} ${loop_catalog_resource_id}=${loop_catalog_resource_resp}
128 #
129 # do this here because the loop_catalog_resource_resp is different format after adding networks
130 ${vf_module}= Find Element In Array ${loop_catalog_resource_resp['groups']} type org.openecomp.groups.VfModule
131 #
132 # do allottedresource
133 ${allottedresource_list}= Create List TunnelXConn BRG
134 # Example data
135 #${tunnelxconn_dict}= Create Dictionary invariantUUID=8ac029e7-77aa-40d4-b28a-d17c02d5fd82 UUID=2ddc1b37-d7da-4aab-b645-ed7db34a5d03 node_type=org.openecomp.service.Demovcpevgmux
136 #${brg_dict}= Create Dictionary invariantUUID=ff0337b9-dbe2-4d88-bb74-18bf027ae586 UUID=1b6974f1-4aed-47f4-b962-816aa1261927 node_type=org.openecomp.service.Demovcpevbrgemu
137 ${vcpe_ar_data_file} Get File /tmp/vcpe_allotted_resource_data.json
138 ${tunnelxconn_invariant_uuid} Get Json Value ${vcpe_ar_data_file} /tunnelxconn/invariantUUID
139 ${tunnelxconn_uuid} Get Json Value ${vcpe_ar_data_file} /tunnelxconn/UUID
140 ${tunnelxconn_node_type} Get Json Value ${vcpe_ar_data_file} /tunnelxconn/node_type
141 ${brg_invariant_uuid} Get Json Value ${vcpe_ar_data_file} /brg/invariantUUID
142 ${brg_uuid} Get Json Value ${vcpe_ar_data_file} /brg/UUID
143 ${brg_node_type} Get Json Value ${vcpe_ar_data_file} /brg/node_type
144 ${tunnelxconn_dict}= Create Dictionary invariantUUID=${tunnelxconn_invariant_uuid} UUID=${tunnelxconn_uuid} node_type=${tunnelxconn_node_type}
145 ${brg_dict}= Create Dictionary invariantUUID=${brg_invariant_uuid} UUID=${brg_uuid} node_type=${brg_node_type}
146 ${xoffset}= Set Variable ${100}
147 ${allottedresource_uuid}= Get AllottedResource UUID
148 ${random}= Get Current Date
149 :FOR ${allottedresource} in @{allottedresource_list}
150 \ ${loop_catalog_resource_id}= Set Variable ${allottedresource_uuid}
151 \ Append To List ${catalog_resource_ids} ${loop_catalog_resource_id}
152 \ ${loop_catalog_resource_id}= Add ASDC Allotted Resource Catalog Resource 00000 ${allottedresource}_${random} ONAP ${loop_catalog_resource_id} ${allottedresource}
153 \ ${loop_catalog_resource_id2}= Add ASDC Resource Instance To Resource ${loop_catalog_resource_id} ${allottedresource_uuid} ${allottedresource} ${xoffset} ${0}
154 \ ${loop_catalog_resource_resp}= Get ASDC Catalog Resource ${loop_catalog_resource_id}
155 #
156 # Set the properties to relate to the brg and gmux
157 #
158 \ 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']}
159 \ 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']}
160 #
161 # Set the nf_role nf_type
162 #
163 \ Run Keyword If '${allottedresource}'=='TunnelXConn' Setup SDC Catalog Resource AllottedResource Inputs ${catalog_service_id} ${allottedresource} ${loop_catalog_resource_id}
164 \ Run Keyword If '${allottedresource}'=='BRG' Setup SDC Catalog Resource AllottedResource Inputs ${catalog_service_id} ${allottedresource} ${loop_catalog_resource_id}
165
166 \ ${loop_catalog_resource_id}= Certify ASDC Catalog Resource ${loop_catalog_resource_id} ${ASDC_DESIGNER_USER_ID}
167 \ Add ASDC Resource Instance ${catalog_service_id} ${loop_catalog_resource_id} ${loop_catalog_resource_resp['name']}
168
169
170
171
172
173 \ Set To Dictionary ${catalog_resources} ${loop_catalog_resource_id}=${loop_catalog_resource_resp}
174 ${catalog_service_resp}= Get ASDC Catalog Service ${catalog_service_id}
175 Checkin ASDC Catalog Service ${catalog_service_id}
176 Request Certify ASDC Catalog Service ${catalog_service_id}
177 Start Certify ASDC Catalog Service ${catalog_service_id}
178 # on certify it gets a new id
179 ${catalog_service_id}= Certify ASDC Catalog Service ${catalog_service_id}
180 Approve ASDC Catalog Service ${catalog_service_id}
181 : FOR ${DIST_INDEX} IN RANGE 1
182 \ Log Distribution Attempt ${DIST_INDEX}
183 \ Distribute ASDC Catalog Service ${catalog_service_id}
184 \ ${catalog_service_resp}= Get ASDC Catalog Service ${catalog_service_id}
185 \ ${status} ${_} = Run Keyword And Ignore Error Loop Over Check Catalog Service Distributed ${catalog_service_resp['uuid']}
186 \ Exit For Loop If '${status}'=='PASS'
187 #\ Exit For Loop If '${dist_status}'=='EXIT'
188 Should Be Equal As Strings ${status} PASS
189 [Return] ${catalog_service_resp['name']} ${loop_catalog_resource_resp['name']} ${vf_module} ${catalog_resource_ids} ${catalog_service_id} ${catalog_resources}
190
191
bdfreeman14211ad11d92018-11-17 18:47:37 +0000192Download CSAR
193 [Documentation] Download CSAR
194 [Arguments] ${catalog_service_id} ${save_directory}=/tmp/csar
195 # get meta data
196 ${resp}= Run ASDC Get Request ${ASDC_CATALOG_SERVICES_PATH}/${catalog_service_id}/filteredDataByParams?include=toscaArtifacts ${ASDC_DESIGNER_USER_ID} ${ASDC_BE_ENDPOINT}
197 ${csar_resource_id}= Set Variable ${resp.json()['toscaArtifacts']['assettoscacsar']['uniqueId']}
198 ${resp}= Run ASDC Get Request ${ASDC_CATALOG_SERVICES_PATH}/${catalog_service_id}/artifacts/${csar_resource_id}
199 ${csar_file_name}= Set Variable ${resp.json()['artifactName']}
200 ${base64Obj}= Set Variable ${resp.json()['base64Contents']}
201 ${binObj}= Evaluate base64.b64decode("${base64Obj}") modules=base64
202 Create Binary File ${save_directory}/${csar_file_name} ${binObj}
203 Log To Console Downloaded:${csar_file_name}
204 [Return]
205
Brian Freemaneef7c6f2018-11-16 18:42:21 -0500206
207Get Generic NeutronNet UUID
208 [Documentation] Lookoup the UUID of the Generic NeutronNetwork Resource
Brian Freemaneef7c6f2018-11-16 18:42:21 -0500209 ${resp}= Run ASDC Get Request ${ASDC_CATALOG_RESOURCES_QUERY_PATH}/Generic%20NeutronNet/resourceVersion/1.0 ${ASDC_DESIGNER_USER_ID} ${ASDC_BE_ENDPOINT}
210 [Return] ${resp.json()['allVersions']['1.0']}
211
bdfreeman1421b2a49512018-11-25 07:32:19 -0500212Get AllottedResource UUID
213 [Documentation] Lookoup the UUID of the Allotted Resource
214 # if this fails then the AllottedResource template got deleted from SDC by mistake
215 ${resp}= Run ASDC Get Request ${ASDC_CATALOG_RESOURCES_QUERY_PATH}/AllottedResource/resourceVersion/1.0 ${ASDC_DESIGNER_USER_ID} ${ASDC_BE_ENDPOINT}
216 [Return] ${resp.json()['allVersions']['1.0']}
217
Brian Freeman18df8912018-05-25 13:27:29 -0500218Loop Over Check Catalog Service Distributed
Gary Wu58d58532018-07-27 16:02:51 -0700219 [Arguments] ${catalog_service_id}
Brian Freemanadaa2372018-10-24 12:25:22 -0500220 # SO watchdog timeout is 300 seconds need buffer
bdfreeman1421b2a49512018-11-25 07:32:19 -0500221 ${dist_status}= Set Variable CONTINUE
222 : FOR ${CHECK_INDEX} IN RANGE 20
Brian Freemanadaa2372018-10-24 12:25:22 -0500223 \ ${status} ${_} = Run Keyword And Ignore Error Check Catalog Service Distributed ${catalog_service_id} ${dist_status}
Gary Wu58d58532018-07-27 16:02:51 -0700224 \ Sleep 20s
Brian Freemanf940ee92018-05-25 21:09:05 -0500225 \ Return From Keyword If '${status}'=='PASS'
bdfreeman1421b2a49512018-11-25 07:32:19 -0500226 # need a way to exit the loop early on DISTRIBUTION_COMPLETE_ERROR ${dist_status} doesnt work
227 #\ Exit For Loop If '${dist_status}'=='EXIT'
228 Should Be Equal As Strings ${status} PASS
229 [Return]
Brian Freeman18df8912018-05-25 13:27:29 -0500230
DR695Hccff30b2017-02-17 18:44:24 -0500231Setup ASDC Catalog Resource
232 [Documentation] Creates all the steps a vf needs for an asdc catalog resource and returns the id
Yang Xu2ec80382018-11-01 12:30:37 -0400233 [Arguments] ${model_zip_path} ${cds}=
Brian Freemanb568e5e2018-04-05 21:03:38 -0500234 ${license_model_id} ${license_model_version_id}= Add ASDC License Model
235 ${key_group_id}= Add ASDC License Group ${license_model_id} ${license_model_version_id}
236 ${pool_id}= Add ASDC Entitlement Pool ${license_model_id} ${license_model_version_id}
237 ${feature_group_id}= Add ASDC Feature Group ${license_model_id} ${key_group_id} ${pool_id} ${license_model_version_id}
238 ${license_agreement_id}= Add ASDC License Agreement ${license_model_id} ${feature_group_id} ${license_model_version_id}
239 Submit ASDC License Model ${license_model_id} ${license_model_version_id}
240 ${license_model_resp}= Get ASDC License Model ${license_model_id} ${license_model_version_id}
Brian Freeman9c42ae12018-11-27 14:33:27 -0500241 # /var/opt/OpenECOMP_ETE/demo/heat/temp/vCPE_infra.zip
242 ${matches}= Get Regexp Matches ${model_zip_path} temp/(.*)\.zip 1
243 ${software_product_name_prefix}= Set Variable ${matches[0]}
244 ${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 -0500245 Upload ASDC Heat Package ${software_product_id} ${model_zip_path} ${software_product_version_id}
246 Validate ASDC Software Product ${software_product_id} ${software_product_version_id}
247 Submit ASDC Software Product ${software_product_id} ${software_product_version_id}
248 Package ASDC Software Product ${software_product_id} ${software_product_version_id}
249 ${software_product_resp}= Get ASDC Software Product ${software_product_id} ${software_product_version_id}
250 ${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 -0400251 # Check if need to set up CDS properties
252 Run Keyword If '${cds}' == 'vfwng' Setup ASDC Catalog Resource CDS Properties ${catalog_resource_id}
253
Brian Freeman391680a2018-08-11 15:20:58 -0500254 ${catalog_resource_id}= Certify ASDC Catalog Resource ${catalog_resource_id} ${ASDC_DESIGNER_USER_ID}
DR695Hccff30b2017-02-17 18:44:24 -0500255 [Return] ${catalog_resource_id}
Brian Freemaneef7c6f2018-11-16 18:42:21 -0500256
257Setup SDC Catalog Resource GenericNeutronNet Properties
bdfreeman1421b2a49512018-11-25 07:32:19 -0500258 [Documentation] Set up GenericNeutronNet properties and inputs
Brian Freemaneef7c6f2018-11-16 18:42:21 -0500259 [Arguments] ${catalog_service_id} ${nf_role} ${catalog_parent_service_id}
Brian Freemaneef7c6f2018-11-16 18:42:21 -0500260 ${resp}= Get ASDC Catalog Resource Component Instances Properties ${catalog_service_id}
Brian Freemaneef7c6f2018-11-16 18:42:21 -0500261 ${componentInstances} Set Variable @{resp['componentInstancesProperties']}
262 # componentInstances can have 1 or more than 1 entry
263 ${passed}= Run Keyword And Return Status Evaluate type(${componentInstances})
264 ${type}= Run Keyword If ${passed} Evaluate type(${componentInstances})
265 ${componentInstancesList}= Run Keyword If "${type}"!="<type 'list'>" Create List ${componentInstances}
266 ... ELSE Set Variable ${componentInstances}
267 :FOR ${item} IN @{componentInstancesList}
268 \ ${test} ${v}= Run Keyword and Ignore Error Should Contain ${item} ${nf_role}
269 \ Run Keyword If '${test}' == 'FAIL' Continue For Loop
270 \ ${componentInstance1}= Set Variable ${item}
271 :FOR ${comp} IN @{resp['componentInstancesProperties']["${componentInstance1}"]}
272 \ ${name} Set Variable ${comp['name']}
273 \ ${test} ${v}= Run Keyword and Ignore Error Should Contain ${name} network_role
274 \ Run Keyword If '${test}' == 'FAIL' Continue For Loop
275 \ ${description} Set Variable ${comp['description']}
276 \ ${description}= Replace String ${description} ${\n} \
277 \ ${uniqueId} Set Variable ${comp['uniqueId']}
278 \ ${parentUniqueId} Set Variable ${comp['parentUniqueId']}
279 \ ${ownerId} Set Variable ${comp['ownerId']}
280 \ ${dict}= Create Dictionary parentUniqueId=${parentUniqueId} ownerId=${ownerId} uniqueId=${uniqueId} description=${description}
281 \ Run Keyword If '${name}'=='network_role' Set To Dictionary ${dict} name=${name} value=${nf_role}
bdfreeman1421b2a49512018-11-25 07:32:19 -0500282 \ ${data}= Fill JSON Template File ${SDC_CATALOG_NET_RESOURCE_INPUT_TEMPLATE} ${dict}
Brian Freemaneef7c6f2018-11-16 18:42:21 -0500283 \ ${response}= Set ASDC Catalog Resource Component Instance Properties ${catalog_parent_service_id} ${catalog_service_id} ${data}
284 #\ Log To Console resp=${response}
285 [Return]
286
bdfreeman1421b2a49512018-11-25 07:32:19 -0500287
288Setup SDC Catalog Resource AllottedResource Properties
289 [Documentation] Set up Allotted Resource properties and inputs
290 [Arguments] ${catalog_service_id} ${nf_role} ${catalog_resource_id} ${invariantUUID} ${UUID} ${node_type}
291 # Set component instances properties
292 ${nf_role_lc}= Convert To Lowercase ${nf_role}
293 ${resp}= Get ASDC Catalog Resource Component Instances Properties For Resource ${catalog_resource_id}
294 ${componentInstances} Set Variable @{resp['componentInstancesProperties']}
295 # componentInstances can have 1 or more than 1 entry
296 ${passed}= Run Keyword And Return Status Evaluate type(${componentInstances})
297 ${type}= Run Keyword If ${passed} Evaluate type(${componentInstances})
298 ${componentInstancesList}= Run Keyword If "${type}"!="<type 'list'>" Create List ${componentInstances}
299 ... ELSE Set Variable ${componentInstances}
300 :FOR ${item} IN @{componentInstancesList}
301 \ ${test} ${v}= Run Keyword and Ignore Error Should Contain ${item} ${nf_role_lc}
302 \ Run Keyword If '${test}' == 'FAIL' Continue For Loop
303 \ ${componentInstance1}= Set Variable ${item}
304 ${dict}= Create Dictionary
305 :FOR ${comp} IN @{resp['componentInstancesProperties']["${componentInstance1}"]}
306 \ ${name} Set Variable ${comp['name']}
307 \ ${test} ${v}= Run Keyword and Ignore Error Should Contain Any ${name} network_role providing_service_invariant_uuid providing_service_uuid providing_service_name uniqueId
308 \ Run Keyword If '${test}' == 'FAIL' Continue For Loop
309 \ ${parentUniqueId} Set Variable ${comp['parentUniqueId']}
310 \ ${ownerId} Set Variable ${comp['ownerId']}
311 \ Set To Dictionary ${dict} parentUniqueId=${parentUniqueId} ownerId=${ownerId}
312 \ Run Keyword If '${name}'=='providing_service_invariant_uuid' Set To Dictionary ${dict} providing_service_invariant_uuid=${invariantUUID}
313 \ Run Keyword If '${name}'=='providing_service_uuid' Set To Dictionary ${dict} providing_service_uuid=${UUID}
314 \ Run Keyword If '${name}'=='providing_service_name' Set To Dictionary ${dict} providing_service_name=${node_type}
315 # Sets it for each loop but should be one
316 \ ${uniqueId} Set Variable ${comp['uniqueId']}
317 \ ${uniqueId} Fetch From Left ${uniqueId} .
318 \ Set To Dictionary ${dict} uniqueId=${uniqueId}
319 ${data}= Fill JSON Template File ${SDC_CATALOG_ALLOTTED_RESOURCE_PROPERTIES_TEMPLATE} ${dict}
320 ${response}= Set ASDC Catalog Resource Component Instance Properties For Resource ${catalog_resource_id} ${componentInstance1} ${data}
321 Log To Console resp=${response}
322
323
324Setup SDC Catalog Resource AllottedResource Inputs
325 [Documentation] Set up Allotted Resource inputs
326 [Arguments] ${catalog_service_id} ${nf_role} ${catalog_resource_id}
327 # Set vnf inputs
328 ${resp}= Get ASDC Catalog Resource Inputs ${catalog_resource_id}
329 ${dict}= Create Dictionary
330 :FOR ${comp} in @{resp['inputs']}
331 \ ${name} Set Variable ${comp['name']}
332 \ ${uid} Set Variable ${comp['uniqueId']}
333 \ Run Keyword If '${name}'=='nf_type' Set To Dictionary ${dict} nf_type=${nf_role} nf_type_uid=${uid}
334 \ Run Keyword If '${name}'=='nf_role' Set To Dictionary ${dict} nf_role=${nf_role} nf_role_uid=${uid}
335 ${data}= Fill JSON Template File ${SDC_CATALOG_ALLOTTED_RESOURCE_INPUTS_TEMPLATE} ${dict}
336 ${response}= Set ASDC Catalog Resource VNF Inputs ${catalog_resource_id} ${data}
337 [Return] ${response}
338
Yang Xu2ec80382018-11-01 12:30:37 -0400339Setup ASDC Catalog Resource CDS Properties
340 [Documentation] Set up vfwng VNF properties and inputs for CDS
341 [Arguments] ${catalog_resource_id}
342 # Set vnf module properties
343 ${resp}= Get ASDC Catalog Resource Component Instances ${catalog_resource_id}
344 :FOR ${comp} in @{resp['componentInstances']}
345 \ ${name} Set Variable ${comp['name']}
346 \ ${uniqueId} Set Variable ${comp['uniqueId']}
347 \ ${actualComponentUid} Set Variable ${comp['actualComponentUid']}
348 \ ${test} ${v}= Run Keyword and Ignore Error Should Contain ${name} abstract_
349 \ Run Keyword If '${test}' == 'FAIL' Continue For Loop
350 \ ${response}= Get ASDC Catalog Resource Component Instance Properties ${catalog_resource_id} ${uniqueId} ${actualComponentUid}
351 \ ${dict}= Create Dictionary parent_id=${response[6]['parentUniqueId']}
352 \ Run Keyword If '${name}'=='abstract_vfw' Set To Dictionary ${dict} nfc_function=vfw nfc_naming_policy=SDNC_Policy.ONAP_VFW_NAMING_TIMESTAMP
353 \ Run Keyword If '${name}'=='abstract_vpg' Set To Dictionary ${dict} nfc_function=vpg nfc_naming_policy=SDNC_Policy.ONAP_VPG_NAMING_TIMESTAMP
354 \ Run Keyword If '${name}'=='abstract_vsn' Set To Dictionary ${dict} nfc_function=vsn nfc_naming_policy=SDNC_Policy.ONAP_VSN_NAMING_TIMESTAMP
355 \ ${data}= Fill JSON Template File ${ASDC_RESOURCE_INSTANCE_VNF_PROPERTIES_TEMPLATE} ${dict}
356 \ ${response}= Set ASDC Catalog Resource Component Instance Properties ${catalog_resource_id} ${uniqueId} ${data}
357 \ Log To Console resp=${response}
358
359 # Set vnf inputs
360 ${resp}= Get ASDC Catalog Resource Inputs ${catalog_resource_id}
361 ${dict}= Create Dictionary
362 :FOR ${comp} in @{resp['inputs']}
363 \ ${name} Set Variable ${comp['name']}
364 \ ${uid} Set Variable ${comp['uniqueId']}
365 \ Run Keyword If '${name}'=='nf_function' Set To Dictionary ${dict} nf_function=ONAP-FIREWALL nf_function_uid=${uid}
366 \ Run Keyword If '${name}'=='nf_type' Set To Dictionary ${dict} nf_type=FIREWALL nf_type_uid=${uid}
367 \ Run Keyword If '${name}'=='nf_naming_code' Set To Dictionary ${dict} nf_naming_code=vfw nf_naming_code_uid=${uid}
368 \ Run Keyword If '${name}'=='nf_role' Set To Dictionary ${dict} nf_role=vFW nf_role_uid=${uid}
369 \ Run Keyword If '${name}'=='cloud_env' Set To Dictionary ${dict} cloud_env=openstack cloud_env_uid=${uid}
370 ${data}= Fill JSON Template File ${ASDC_RESOURCE_INSTANCE_VNF_INPUTS_TEMPLATE} ${dict}
371 ${response}= Set ASDC Catalog Resource VNF Inputs ${catalog_resource_id} ${data}
372
DR695Hccff30b2017-02-17 18:44:24 -0500373Add ASDC License Model
374 [Documentation] Creates an asdc license model and returns its id
Jerry Floode2a48d72017-06-21 15:06:29 -0400375 ${uuid}= Generate UUID
376 ${shortened_uuid}= Evaluate str("${uuid}")[:23]
DR695Hccff30b2017-02-17 18:44:24 -0500377 ${map}= Create Dictionary vendor_name=${shortened_uuid}
378 ${data}= Fill JSON Template File ${ASDC_LICENSE_MODEL_TEMPLATE} ${map}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500379 ${resp}= Run ASDC Post Request ${ASDC_VENDOR_LICENSE_MODEL_PATH} ${data} ${ASDC_DESIGNER_USER_ID} ${ASDC_BE_ONBOARD_ENDPOINT}
DR695Hccff30b2017-02-17 18:44:24 -0500380 Should Be Equal As Strings ${resp.status_code} 200
Brian Freemanb568e5e2018-04-05 21:03:38 -0500381 [Return] ${resp.json()['itemId']} ${resp.json()['version']['id']}
DR695Hccff30b2017-02-17 18:44:24 -0500382Get ASDC License Model
383 [Documentation] gets an asdc license model by its id
Jerry Floode2a48d72017-06-21 15:06:29 -0400384 [Arguments] ${id} ${version_id}=0.1
Brian Freeman44b8bb32018-05-03 21:08:42 -0500385 ${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 -0400386 [Return] ${resp.json()}
387Get ASDC License Models
388 [Documentation] gets an asdc license model by its id
Brian Freeman44b8bb32018-05-03 21:08:42 -0500389 ${resp}= Run ASDC Get Request ${ASDC_VENDOR_LICENSE_MODEL_PATH} ${ASDC_DESIGNER_USER_ID} ${ASDC_BE_ONBOARD_ENDPOINT}
390
DR695Hccff30b2017-02-17 18:44:24 -0500391 [Return] ${resp.json()}
392Checkin ASDC License Model
393 [Documentation] checksin an asdc license model by its id
Jerry Floode2a48d72017-06-21 15:06:29 -0400394 [Arguments] ${id} ${version_id}=0.1
DR695Hccff30b2017-02-17 18:44:24 -0500395 ${map}= Create Dictionary action=Checkin
396 ${data}= Fill JSON Template File ${ASDC_ACTION_TEMPLATE} ${map}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500397 ${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}
DR695Hccff30b2017-02-17 18:44:24 -0500398 Should Be Equal As Strings ${resp.status_code} 200
399 [Return] ${resp.json()}
400Submit ASDC License Model
401 [Documentation] submits an asdc license model by its id
Jerry Floode2a48d72017-06-21 15:06:29 -0400402 [Arguments] ${id} ${version_id}=0.1
DR695Hccff30b2017-02-17 18:44:24 -0500403 ${map}= Create Dictionary action=Submit
404 ${data}= Fill JSON Template File ${ASDC_ACTION_TEMPLATE} ${map}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500405 ${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}
DR695Hccff30b2017-02-17 18:44:24 -0500406 Should Be Equal As Strings ${resp.status_code} 200
407 [Return] ${resp.json()}
408Checkin ASDC Software Product
409 [Documentation] checksin an asdc Software Product by its id
Jerry Floode2a48d72017-06-21 15:06:29 -0400410 [Arguments] ${id} ${version_id}=0.1
DR695Hccff30b2017-02-17 18:44:24 -0500411 ${map}= Create Dictionary action=Checkin
Jerry Floode2a48d72017-06-21 15:06:29 -0400412 ${data}= Fill JSON Template File ${ASDC_ACTION_TEMPLATE} ${map}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500413 ${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}
Jerry Floode2a48d72017-06-21 15:06:29 -0400414 Should Be Equal As Strings ${resp.status_code} 200
415 [Return] ${resp.json()}
416Validate ASDC Software Product
417 [Documentation] checksin an asdc Software Product by its id
418 [Arguments] ${id} ${version_id}=0.1
419 ${data}= Catenate
Brian Freeman44b8bb32018-05-03 21:08:42 -0500420 ${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}
DR695Hccff30b2017-02-17 18:44:24 -0500421 Should Be Equal As Strings ${resp.status_code} 200
422 [Return] ${resp.json()}
423Submit ASDC Software Product
424 [Documentation] submits an asdc Software Product by its id
Jerry Floode2a48d72017-06-21 15:06:29 -0400425 [Arguments] ${id} ${version_id}=0.1
DR695Hccff30b2017-02-17 18:44:24 -0500426 ${map}= Create Dictionary action=Submit
Jerry Floode2a48d72017-06-21 15:06:29 -0400427 ${data}= Fill JSON Template File ${ASDC_ACTION_TEMPLATE} ${map}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500428 ${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}
DR695Hccff30b2017-02-17 18:44:24 -0500429 Should Be Equal As Strings ${resp.status_code} 200
430 [Return] ${resp.json()}
431Package ASDC Software Product
432 [Documentation] creates_package on an asdc Software Product by its id
Jerry Floode2a48d72017-06-21 15:06:29 -0400433 [Arguments] ${id} ${version_id}=0.1
DR695Hccff30b2017-02-17 18:44:24 -0500434 ${map}= Create Dictionary action=Create_Package
Jerry Floode2a48d72017-06-21 15:06:29 -0400435 ${data}= Fill JSON Template File ${ASDC_ACTION_TEMPLATE} ${map}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500436 ${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}
DR695Hccff30b2017-02-17 18:44:24 -0500437 Should Be Equal As Strings ${resp.status_code} 200
Jerry Floode2a48d72017-06-21 15:06:29 -0400438 [Return] ${resp.json()}
DR695Hccff30b2017-02-17 18:44:24 -0500439Add ASDC Entitlement Pool
440 [Documentation] Creates an asdc Entitlement Pool and returns its id
Jerry Floode2a48d72017-06-21 15:06:29 -0400441 [Arguments] ${license_model_id} ${version_id}=0.1
442 ${uuid}= Generate UUID
443 ${shortened_uuid}= Evaluate str("${uuid}")[:23]
DR695Hccff30b2017-02-17 18:44:24 -0500444 ${map}= Create Dictionary entitlement_pool_name=${shortened_uuid}
Jerry Floode2a48d72017-06-21 15:06:29 -0400445 ${data}= Fill JSON Template File ${ASDC_ENTITLEMENT_POOL_TEMPLATE} ${map}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500446 ${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}
DR695Hccff30b2017-02-17 18:44:24 -0500447 Should Be Equal As Strings ${resp.status_code} 200
448 [Return] ${resp.json()['value']}
449Get ASDC Entitlement Pool
450 [Documentation] gets an asdc Entitlement Pool by its id
451 [Arguments] ${license_model_id} ${pool_id}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500452 ${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 -0500453 [Return] ${resp.json()}
454Add ASDC License Group
455 [Documentation] Creates an asdc license group and returns its id
Brian Freemanb568e5e2018-04-05 21:03:38 -0500456 [Arguments] ${license_model_id} ${version_id}=1.0
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 key_group_name=${shortened_uuid}
Jerry Floode2a48d72017-06-21 15:06:29 -0400460 ${data}= Fill JSON Template File ${ASDC_KEY_GROUP_TEMPLATE} ${map}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500461 ${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}
DR695Hccff30b2017-02-17 18:44:24 -0500462 Should Be Equal As Strings ${resp.status_code} 200
463 [Return] ${resp.json()['value']}
464Get ASDC License Group
465 [Documentation] gets an asdc license group by its id
Jerry Floode2a48d72017-06-21 15:06:29 -0400466 [Arguments] ${license_model_id} ${group_id} ${version_id}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500467 ${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 -0500468 [Return] ${resp.json()}
469Add ASDC Feature Group
470 [Documentation] Creates an asdc Feature Group and returns its id
Jerry Floode2a48d72017-06-21 15:06:29 -0400471 [Arguments] ${license_model_id} ${key_group_id} ${entitlement_pool_id} ${version_id}=0.1
472 ${uuid}= Generate UUID
473 ${shortened_uuid}= Evaluate str("${uuid}")[:23]
Jerry Flood80ff9852017-08-11 06:47:14 -0400474 ${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 -0400475 ${data}= Fill JSON Template File ${ASDC_FEATURE_GROUP_TEMPLATE} ${map}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500476 ${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}
DR695Hccff30b2017-02-17 18:44:24 -0500477 Should Be Equal As Strings ${resp.status_code} 200
478 [Return] ${resp.json()['value']}
479Get ASDC Feature Group
480 [Documentation] gets an asdc Feature Group by its id
481 [Arguments] ${license_model_id} ${group_id}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500482 ${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 -0500483 [Return] ${resp.json()}
484Add ASDC License Agreement
485 [Documentation] Creates an asdc License Agreement and returns its id
Jerry Floode2a48d72017-06-21 15:06:29 -0400486 [Arguments] ${license_model_id} ${feature_group_id} ${version_id}=0.1
487 ${uuid}= Generate UUID
488 ${shortened_uuid}= Evaluate str("${uuid}")[:23]
DR695Hccff30b2017-02-17 18:44:24 -0500489 ${map}= Create Dictionary license_agreement_name=${shortened_uuid} feature_group_id=${feature_group_id}
Jerry Floode2a48d72017-06-21 15:06:29 -0400490 ${data}= Fill JSON Template File ${ASDC_LICENSE_AGREEMENT_TEMPLATE} ${map}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500491 ${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}
DR695Hccff30b2017-02-17 18:44:24 -0500492 Should Be Equal As Strings ${resp.status_code} 200
493 [Return] ${resp.json()['value']}
494Get ASDC License Agreement
495 [Documentation] gets an asdc License Agreement by its id
496 [Arguments] ${license_model_id} ${agreement_id}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500497 ${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 -0500498 [Return] ${resp.json()}
499Add ASDC Software Product
500 [Documentation] Creates an asdc Software Product and returns its id
Brian Freeman9c42ae12018-11-27 14:33:27 -0500501 [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 -0400502 ${uuid}= Generate UUID
Brian Freeman9c42ae12018-11-27 14:33:27 -0500503 ${shortened_uuid}= Evaluate str("${uuid}")[:13]
504 ${software_product_name}= Catenate ${name_prefix} ${shortened_uuid}
505 ${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 -0400506 ${data}= Fill JSON Template File ${ASDC_SOFTWARE_PRODUCT_TEMPLATE} ${map}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500507 ${resp}= Run ASDC Post Request ${ASDC_VENDOR_SOFTWARE_PRODUCT_PATH} ${data} ${ASDC_DESIGNER_USER_ID} ${ASDC_BE_ONBOARD_ENDPOINT}
DR695Hccff30b2017-02-17 18:44:24 -0500508 Should Be Equal As Strings ${resp.status_code} 200
Brian Freemanb568e5e2018-04-05 21:03:38 -0500509 [Return] ${resp.json()['itemId']} ${resp.json()['version']['id']}
DR695Hccff30b2017-02-17 18:44:24 -0500510Get ASDC Software Product
511 [Documentation] gets an asdc Software Product by its id
Jerry Floode2a48d72017-06-21 15:06:29 -0400512 [Arguments] ${software_product_id} ${version_id}=0.1
Brian Freeman44b8bb32018-05-03 21:08:42 -0500513 ${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 -0500514 [Return] ${resp.json()}
bdfreeman1421b2a49512018-11-25 07:32:19 -0500515
DR695Hccff30b2017-02-17 18:44:24 -0500516Add ASDC Catalog Resource
517 [Documentation] Creates an asdc Catalog Resource and returns its id
518 [Arguments] ${license_agreement_id} ${software_product_name} ${license_model_name} ${software_product_id}
519 ${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 -0400520 ${data}= Fill JSON Template File ${ASDC_CATALOG_RESOURCE_TEMPLATE} ${map}
bdfreeman1421b2a49512018-11-25 07:32:19 -0500521 ${resp}= Run ASDC Post Request ${ASDC_CATALOG_RESOURCES_PATH} ${data} ${ASDC_DESIGNER_USER_ID}
DR695Hccff30b2017-02-17 18:44:24 -0500522 Should Be Equal As Strings ${resp.status_code} 201
523 [Return] ${resp.json()['uniqueId']}
bdfreeman1421b2a49512018-11-25 07:32:19 -0500524
525Add ASDC Allotted Resource Catalog Resource
526 [Documentation] Creates an asdc Allotted Resource Catalog Resource and returns its id
527 [Arguments] ${license_agreement_id} ${software_product_name} ${license_model_name} ${software_product_id} ${subcategory}
528 ${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}
529 ${data}= Fill JSON Template File ${ASDC_ALLOTTED_RESOURCE_CATALOG_RESOURCE_TEMPLATE} ${map}
530 ${resp}= Run ASDC Post Request ${ASDC_CATALOG_RESOURCES_PATH} ${data} ${ASDC_DESIGNER_USER_ID}
531 Should Be Equal As Strings ${resp.status_code} 201
532 [Return] ${resp.json()['uniqueId']}
533
DR695Hccff30b2017-02-17 18:44:24 -0500534Mark ASDC Catalog Resource Inactive
535 [Documentation] deletes an asdc Catalog Resource
536 [Arguments] ${catalog_resource_id}
537 ${resp}= Run ASDC Delete Request ${ASDC_CATALOG_RESOURCES_PATH}/${catalog_resource_id} ${ASDC_DESIGNER_USER_ID}
538 Should Be Equal As Strings ${resp.status_code} 204
539 [Return] ${resp}
540Delete Inactive ASDC Catalog Resources
541 [Documentation] delete all asdc Catalog Resources that are inactive
542 ${resp}= Run ASDC Delete Request ${ASDC_CATALOG_INACTIVE_RESOURCES_PATH} ${ASDC_DESIGNER_USER_ID}
543 Should Be Equal As Strings ${resp.status_code} 200
544 [Return] ${resp.json()}
545Get ASDC Catalog Resource
546 [Documentation] gets an asdc Catalog Resource by its id
547 [Arguments] ${catalog_resource_id}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500548 ${resp}= Run ASDC Get Request ${ASDC_CATALOG_RESOURCES_PATH}/${catalog_resource_id} ${ASDC_DESIGNER_USER_ID}
DR695Hccff30b2017-02-17 18:44:24 -0500549 [Return] ${resp.json()}
Brian Freemaneef7c6f2018-11-16 18:42:21 -0500550
Yang Xu2ec80382018-11-01 12:30:37 -0400551Get ASDC Catalog Resource Component Instances
552 [Documentation] gets asdc Catalog Resource Component Instances by its id
553 [Arguments] ${catalog_resource_id}
554 ${resp}= Run ASDC Get Request ${ASDC_FE_CATALOG_RESOURCES_PATH}/${catalog_resource_id}/filteredDataByParams?include=componentInstances ${ASDC_DESIGNER_USER_ID} ${ASDC_FE_ENDPOINT}
555 [Return] ${resp.json()}
bdfreeman1421b2a49512018-11-25 07:32:19 -0500556
Brian Freemaneef7c6f2018-11-16 18:42:21 -0500557Get ASDC Catalog Resource Component Instances Properties
558 [Documentation] gets asdc Catalog Resource Component Instances Properties by its id
559 [Arguments] ${catalog_resource_id}
560 #${resp}= Run ASDC Get Request ${ASDC_FE_CATALOG_RESOURCES_PATH}/${catalog_resource_id}/filteredDataByParams?include=componentInstancesProperties ${ASDC_DESIGNER_USER_ID} ${ASDC_FE_ENDPOINT}
561 ${resp}= Run ASDC Get Request ${ASDC_CATALOG_SERVICES_PATH}/${catalog_resource_id}/filteredDataByParams?include=componentInstancesProperties ${ASDC_DESIGNER_USER_ID} ${ASDC_BE_ENDPOINT}
562 [Return] ${resp.json()}
563
bdfreeman1421b2a49512018-11-25 07:32:19 -0500564Get ASDC Catalog Resource Component Instances Properties For Resource
565 [Documentation] gets asdc Catalog Resource Component Instances Properties for a Resource (VF) by its id
566 [Arguments] ${catalog_resource_id}
567 ${resp}= Run ASDC Get Request ${ASDC_FE_CATALOG_RESOURCES_PATH}/${catalog_resource_id}/filteredDataByParams?include=componentInstancesProperties ${ASDC_DESIGNER_USER_ID} ${ASDC_FE_ENDPOINT}
568 [Return] ${resp.json()}
Brian Freemaneef7c6f2018-11-16 18:42:21 -0500569
Yang Xu2ec80382018-11-01 12:30:37 -0400570Get ASDC Catalog Resource Inputs
571 [Documentation] gets asdc Catalog Inputs by its id
572 [Arguments] ${catalog_resource_id}
573 ${resp}= Run ASDC Get Request ${ASDC_FE_CATALOG_RESOURCES_PATH}/${catalog_resource_id}/filteredDataByParams?include=inputs ${ASDC_DESIGNER_USER_ID} ${ASDC_FE_ENDPOINT}
574 [Return] ${resp.json()}
Brian Freemaneef7c6f2018-11-16 18:42:21 -0500575
Yang Xu2ec80382018-11-01 12:30:37 -0400576Get ASDC Catalog Resource Component Instance Properties
577 [Documentation] gets an asdc Catalog Resource properties by its id
578 [Arguments] ${catalog_resource_id} ${component_instance_id} ${component_id}
579 ${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}
580 [Return] ${resp.json()}
bdfreeman1421b2a49512018-11-25 07:32:19 -0500581
Yang Xu2ec80382018-11-01 12:30:37 -0400582Set ASDC Catalog Resource Component Instance Properties
583 [Documentation] sets an asdc Catalog Resource by its id
Brian Freemaneef7c6f2018-11-16 18:42:21 -0500584 [Arguments] ${catalog_resource_id} ${component_parent_service_id} ${data}
585 #${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}
586 ${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 -0500587 [Return] ${resp.json()}
588
589Set ASDC Catalog Resource Component Instance Properties For Resource
590 [Documentation] sets an asdc Catalog Resource by its id
591 [Arguments] ${catalog_parent_resource_id} ${catalog_resource_id} ${data}
592 #${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}
593 ${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}
594 [Return] ${resp.json()}
Brian Freemaneef7c6f2018-11-16 18:42:21 -0500595
Yang Xu2ec80382018-11-01 12:30:37 -0400596Set ASDC Catalog Resource VNF Inputs
597 [Documentation] sets an asdc Catalog Resource by its id
598 [Arguments] ${catalog_resource_id} ${data}
599 ${resp}= Run ASDC Post Request ${ASDC_FE_CATALOG_RESOURCES_PATH}/${catalog_resource_id}/update/inputs ${data} ${ASDC_DESIGNER_USER_ID} ${ASDC_FE_ENDPOINT}
600 [Return] ${resp.json()}
Brian Freeman79b00ce2018-11-01 14:57:53 -0500601Get SDC Demo Vnf Catalog Resource
602 [Documentation] gets resource id's for demonstration VNFs for instantiate
603 [Arguments] ${service_name}
604 ${resp}= Run ASDC Get Request ${ASDC_CATALOG_SERVICES_PATH}/serviceName/${service_name}/serviceVersion/1.0
605 @{ITEMS}= Copy List ${resp.json()['componentInstances']}
606 ${demo_catalog_resource}= Create Dictionary
607 :FOR ${ELEMENT} IN @{ITEMS}
608 \ Log ${ELEMENT['name']}
609 \ Log ${ELEMENT['groupInstances'][0]['groupName']}
610 \ ${vnf}= Get VNF From Group Name ${ELEMENT['groupInstances'][0]['groupName']} ${service_name}
611 \ ${vnf_data}= Create Dictionary vnf_type=${ELEMENT['name']} vf_module=${ELEMENT['groupInstances'][0]['groupName']}
612 \ LOG ${vnf_data}
613 \ Set To Dictionary ${demo_catalog_resource} ${vnf}=${vnf_data}
614 \ LOG ${demo_catalog_resource}
615 [Return] ${demo_catalog_resource}
616
617Get VNF From Group Name
618 [Documentation] looks up vnf key from service mapping for a regex on groupName and service_name
619 [Arguments] ${group_name} ${service_name}
620 ${vnf}= Set Variable If
621 ... ('${service_name}'=='demoVFWCL') and ('base_vfw' in '${group_name}') vFWSNK
622 ... ('${service_name}'=='demoVFWCL') and ('base_vpkg' in '${group_name}') vPKG
623 ... ('${service_name}'=='demoVLB') and ('base_vlb' in '${group_name}') vLB
624 [Return] ${vnf}
DR695Hccff30b2017-02-17 18:44:24 -0500625Checkin ASDC Catalog Resource
626 [Documentation] checksin an asdc Catalog Resource by its id
627 [Arguments] ${catalog_resource_id}
628 ${map}= Create Dictionary user_remarks=Robot remarks
Jerry Floode2a48d72017-06-21 15:06:29 -0400629 ${data}= Fill JSON Template File ${ASDC_USER_REMARKS_TEMPLATE} ${map}
DR695Hccff30b2017-02-17 18:44:24 -0500630 ${resp}= Run ASDC Post Request ${ASDC_CATALOG_RESOURCES_PATH}/${catalog_resource_id}${ASDC_CATALOG_LIFECYCLE_PATH}/checkin ${data} ${ASDC_DESIGNER_USER_ID}
631 Should Be Equal As Strings ${resp.status_code} 200
632 [Return] ${resp.json()}
633Request Certify ASDC Catalog Resource
634 [Documentation] requests certify on an asdc Catalog Resource by its id
635 [Arguments] ${catalog_resource_id}
636 ${map}= Create Dictionary user_remarks=Robot remarks
Jerry Floode2a48d72017-06-21 15:06:29 -0400637 ${data}= Fill JSON Template File ${ASDC_USER_REMARKS_TEMPLATE} ${map}
DR695Hccff30b2017-02-17 18:44:24 -0500638 ${resp}= Run ASDC Post Request ${ASDC_CATALOG_RESOURCES_PATH}/${catalog_resource_id}${ASDC_CATALOG_LIFECYCLE_PATH}/certificationRequest ${data} ${ASDC_DESIGNER_USER_ID}
639 Should Be Equal As Strings ${resp.status_code} 200
640 [Return] ${resp.json()}
641Start Certify ASDC Catalog Resource
642 [Documentation] start certify an asdc Catalog Resource by its id
643 [Arguments] ${catalog_resource_id}
644 ${resp}= Run ASDC Post Request ${ASDC_CATALOG_RESOURCES_PATH}/${catalog_resource_id}${ASDC_CATALOG_LIFECYCLE_PATH}/startCertification ${None} ${ASDC_TESTER_USER_ID}
645 Should Be Equal As Strings ${resp.status_code} 200
646 [Return] ${resp.json()}
647Certify ASDC Catalog Resource
648 [Documentation] start certify an asdc Catalog Resource by its id and returns the new id
Brian Freemandb1e7412018-08-01 12:46:01 -0500649 [Arguments] ${catalog_resource_id} ${user_id}=${ASDC_TESTER_USER_ID}
DR695Hccff30b2017-02-17 18:44:24 -0500650 ${map}= Create Dictionary user_remarks=Robot remarks
Jerry Floode2a48d72017-06-21 15:06:29 -0400651 ${data}= Fill JSON Template File ${ASDC_USER_REMARKS_TEMPLATE} ${map}
Brian Freemandb1e7412018-08-01 12:46:01 -0500652 ${resp}= Run ASDC Post Request ${ASDC_CATALOG_RESOURCES_PATH}/${catalog_resource_id}${ASDC_CATALOG_LIFECYCLE_PATH}/certify ${data} ${user_id}
DR695Hccff30b2017-02-17 18:44:24 -0500653 Should Be Equal As Strings ${resp.status_code} 200
654 [Return] ${resp.json()['uniqueId']}
Jerry Flood6bd1afa2017-10-09 09:59:23 -0400655
DR695Hccff30b2017-02-17 18:44:24 -0500656Upload ASDC Heat Package
Brian Freemanf508ab22018-03-15 21:19:41 -0500657 [Documentation] Creates an asdc Software Product and returns its id
658 [Arguments] ${software_product_id} ${file_path} ${version_id}=0.1
Jerry Flood6bd1afa2017-10-09 09:59:23 -0400659 ${files}= Create Dictionary
660 Create Multi Part ${files} upload ${file_path} contentType=application/zip
Brian Freeman44b8bb32018-05-03 21:08:42 -0500661 ${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}
Brian Freemanf508ab22018-03-15 21:19:41 -0500662 Should Be Equal As Strings ${resp.status_code} 200
Jerry Flood6bd1afa2017-10-09 09:59:23 -0400663
DR695Hccff30b2017-02-17 18:44:24 -0500664Add ASDC Catalog Service
665 [Documentation] Creates an asdc Catalog Service and returns its id
jf986075010a42017-02-22 16:52:54 -0500666 [Arguments] ${catalog_service_name}
Jerry Floode2a48d72017-06-21 15:06:29 -0400667 ${uuid}= Generate UUID
jf986075010a42017-02-22 16:52:54 -0500668 ${shortened_uuid}= Evaluate str("${uuid}")[:23]
Jerry Floode2a48d72017-06-21 15:06:29 -0400669 ${catalog_service_name}= Set Variable If '${catalog_service_name}' =='' ${shortened_uuid} ${catalog_service_name}
jf986075010a42017-02-22 16:52:54 -0500670 ${map}= Create Dictionary service_name=${catalog_service_name}
Jerry Floode2a48d72017-06-21 15:06:29 -0400671 ${data}= Fill JSON Template File ${ASDC_CATALOG_SERVICE_TEMPLATE} ${map}
DR695Hccff30b2017-02-17 18:44:24 -0500672 ${resp}= Run ASDC Post Request ${ASDC_CATALOG_SERVICES_PATH} ${data} ${ASDC_DESIGNER_USER_ID}
673 Should Be Equal As Strings ${resp.status_code} 201
674 [Return] ${resp.json()['uniqueId']}
675Mark ASDC Catalog Service Inactive
676 [Documentation] Deletes an asdc Catalog Service
677 [Arguments] ${catalog_service_id}
678 ${resp}= Run ASDC Delete Request ${ASDC_CATALOG_SERVICES_PATH}/${catalog_service_id} ${ASDC_DESIGNER_USER_ID}
679 Should Be Equal As Strings ${resp.status_code} 204
680 [Return] ${resp}
681Delete Inactive ASDC Catalog Services
682 [Documentation] delete all asdc Catalog Serivces that are inactive
683 ${resp}= Run ASDC Delete Request ${ASDC_CATALOG_INACTIVE_SERVICES_PATH} ${ASDC_DESIGNER_USER_ID}
684 Should Be Equal As Strings ${resp.status_code} 200
685 [Return] ${resp.json()}
686Get ASDC Catalog Service
687 [Documentation] gets an asdc Catalog Service by its id
688 [Arguments] ${catalog_service_id}
689 ${resp}= Run ASDC Get Request ${ASDC_CATALOG_SERVICES_PATH}/${catalog_service_id} ${ASDC_DESIGNER_USER_ID}
690 [Return] ${resp.json()}
691Checkin ASDC Catalog Service
692 [Documentation] checksin an asdc Catalog Service by its id
693 [Arguments] ${catalog_service_id}
694 ${map}= Create Dictionary user_remarks=Robot remarks
Jerry Floode2a48d72017-06-21 15:06:29 -0400695 ${data}= Fill JSON Template File ${ASDC_USER_REMARKS_TEMPLATE} ${map}
DR695Hccff30b2017-02-17 18:44:24 -0500696 ${resp}= Run ASDC Post Request ${ASDC_CATALOG_SERVICES_PATH}/${catalog_service_id}${ASDC_CATALOG_LIFECYCLE_PATH}/checkin ${data} ${ASDC_DESIGNER_USER_ID}
697 Should Be Equal As Strings ${resp.status_code} 200
698 [Return] ${resp.json()}
699Request Certify ASDC Catalog Service
700 [Documentation] requests certify on an asdc Catalog Service by its id
701 [Arguments] ${catalog_service_id}
702 ${map}= Create Dictionary user_remarks=Robot remarks
Jerry Floode2a48d72017-06-21 15:06:29 -0400703 ${data}= Fill JSON Template File ${ASDC_USER_REMARKS_TEMPLATE} ${map}
DR695Hccff30b2017-02-17 18:44:24 -0500704 ${resp}= Run ASDC Post Request ${ASDC_CATALOG_SERVICES_PATH}/${catalog_service_id}${ASDC_CATALOG_LIFECYCLE_PATH}/certificationRequest ${data} ${ASDC_DESIGNER_USER_ID}
705 Should Be Equal As Strings ${resp.status_code} 200
706 [Return] ${resp.json()}
707Start Certify ASDC Catalog Service
708 [Documentation] start certify an asdc Catalog Service by its id
709 [Arguments] ${catalog_service_id}
710 ${resp}= Run ASDC Post Request ${ASDC_CATALOG_SERVICES_PATH}/${catalog_service_id}${ASDC_CATALOG_LIFECYCLE_PATH}/startCertification ${None} ${ASDC_TESTER_USER_ID}
711 Should Be Equal As Strings ${resp.status_code} 200
712 [Return] ${resp.json()}
713Certify ASDC Catalog Service
714 [Documentation] start certify an asdc Catalog Service by its id and returns the new id
715 [Arguments] ${catalog_service_id}
716 ${map}= Create Dictionary user_remarks=Robot remarks
Jerry Floode2a48d72017-06-21 15:06:29 -0400717 ${data}= Fill JSON Template File ${ASDC_USER_REMARKS_TEMPLATE} ${map}
DR695Hccff30b2017-02-17 18:44:24 -0500718 ${resp}= Run ASDC Post Request ${ASDC_CATALOG_SERVICES_PATH}/${catalog_service_id}${ASDC_CATALOG_LIFECYCLE_PATH}/certify ${data} ${ASDC_TESTER_USER_ID}
719 Should Be Equal As Strings ${resp.status_code} 200
720 [Return] ${resp.json()['uniqueId']}
721Approve ASDC Catalog Service
722 [Documentation] approve an asdc Catalog Service by its id
723 [Arguments] ${catalog_service_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_SERVICES_PATH}/${catalog_service_id}${ASDC_CATALOG_SERVICE_DISTRIBUTION_STATE_PATH}${ASDC_DISTRIBUTION_STATE_APPROVE_PATH} ${data} ${ASDC_GOVERNOR_USER_ID}
727 Should Be Equal As Strings ${resp.status_code} 200
728 [Return] ${resp.json()}
729Distribute ASDC Catalog Service
730 [Documentation] distribute an asdc Catalog Service by its id
731 [Arguments] ${catalog_service_id}
732 ${resp}= Run ASDC Post Request ${ASDC_CATALOG_SERVICES_PATH}/${catalog_service_id}${ASDC_CATALOG_SERVICE_DISTRIBUTION_ACTIVATE_PATH} ${None} ${ASDC_OPS_USER_ID}
733 Should Be Equal As Strings ${resp.status_code} 200
734 [Return] ${resp.json()}
bdfreeman1421b2a49512018-11-25 07:32:19 -0500735
DR695Hccff30b2017-02-17 18:44:24 -0500736Add ASDC Resource Instance
737 [Documentation] Creates an asdc Resource Instance and returns its id
Brian Freemaneef7c6f2018-11-16 18:42:21 -0500738 [Arguments] ${catalog_service_id} ${catalog_resource_id} ${catalog_resource_name} ${xoffset}=${0} ${yoffset}=${0}
DR695Hccff30b2017-02-17 18:44:24 -0500739 ${milli_timestamp}= Generate MilliTimestamp UUID
Brian Freemaneef7c6f2018-11-16 18:42:21 -0500740 ${xoffset}= Set Variable ${xoffset+306}
741 ${yoffset}= Set Variable ${yoffset+248}
742 ${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 -0400743 ${data}= Fill JSON Template File ${ASDC_RESOURCE_INSTANCE_TEMPLATE} ${map}
DR695Hccff30b2017-02-17 18:44:24 -0500744 ${resp}= Run ASDC Post Request ${ASDC_CATALOG_SERVICES_PATH}/${catalog_service_id}${ASDC_CATALOG_SERVICE_RESOURCE_INSTANCE_PATH} ${data} ${ASDC_DESIGNER_USER_ID}
745 Should Be Equal As Strings ${resp.status_code} 201
746 [Return] ${resp.json()['uniqueId']}
Brian Freemaneef7c6f2018-11-16 18:42:21 -0500747
bdfreeman1421b2a49512018-11-25 07:32:19 -0500748Add ASDC Resource Instance To Resource
749 [Documentation] Creates an asdc Resource Instance in a Resource (VF) and returns its id
750 [Arguments] ${parent_catalog_resource_id} ${catalog_resource_id} ${catalog_resource_name} ${xoffset}=${0} ${yoffset}=${0}
751 ${milli_timestamp}= Generate MilliTimestamp UUID
752 ${xoffset}= Set Variable ${xoffset+306}
753 ${yoffset}= Set Variable ${yoffset+248}
754 ${map}= Create Dictionary catalog_resource_id=${catalog_resource_id} catalog_resource_name=${catalog_resource_name} milli_timestamp=${milli_timestamp} posX=${xoffset} posY=${yoffset}
755 ${data}= Fill JSON Template File ${ASDC_RESOURCE_INSTANCE_TEMPLATE} ${map}
756 ${resp}= Run ASDC Post Request ${ASDC_CATALOG_RESOURCES_PATH}/${parent_catalog_resource_id}${ASDC_CATALOG_SERVICE_RESOURCE_INSTANCE_PATH} ${data} ${ASDC_DESIGNER_USER_ID}
757 Should Be Equal As Strings ${resp.status_code} 201
758 [Return] ${resp.json()['uniqueId']}
759
DR695Hccff30b2017-02-17 18:44:24 -0500760Get Catalog Service Distribution
761 [Documentation] gets an asdc catalog Service distrbution
762 [Arguments] ${catalog_service_uuid}
763 ${resp}= Run ASDC Get Request ${ASDC_CATALOG_SERVICES_PATH}/${catalog_service_uuid}${ASDC_CATALOG_SERVICE_DISTRIBUTION_PATH} ${ASDC_OPS_USER_ID}
764 Should Be Equal As Strings ${resp.status_code} 200
765 [Return] ${resp.json()}
766Check Catalog Service Distributed
767 [Documentation] gets an asdc catalog Service distrbution
Brian Freemanadaa2372018-10-24 12:25:22 -0500768 [Arguments] ${catalog_service_uuid} ${dist_status}
DR695Hccff30b2017-02-17 18:44:24 -0500769 ${dist_resp}= Get Catalog Service Distribution ${catalog_service_uuid}
770 Should Be Equal As Strings ${dist_resp['distributionStatusOfServiceList'][0]['deployementStatus']} Distributed
771 ${det_resp}= Get Catalog Service Distribution Details ${dist_resp['distributionStatusOfServiceList'][0]['distributionID']}
772 @{ITEMS}= Copy List ${det_resp['distributionStatusList']}
Brian Freemanf508ab22018-03-15 21:19:41 -0500773 Should Not Be Empty ${ITEMS}
Brian Freemana62644f2018-05-13 12:47:38 -0500774 ${SO_COMPLETE} Set Variable FALSE
bdfreeman1421b2a49512018-11-25 07:32:19 -0500775 ${dist_status} Set Variable CONTINUE
776 Should Not Be Empty ${ITEMS}
DR695Hccff30b2017-02-17 18:44:24 -0500777 :FOR ${ELEMENT} IN @{ITEMS}
Brian Freemanf508ab22018-03-15 21:19:41 -0500778 \ Log ${ELEMENT['omfComponentID']}
DR695Hccff30b2017-02-17 18:44:24 -0500779 \ Log ${ELEMENT['status']}
Brian Freeman41ab5e52018-08-08 14:24:23 -0500780 \ ${SO_COMPLETE} Set Variable If (('${ELEMENT['status']}' == 'DISTRIBUTION_COMPLETE_OK')) or ('${SO_COMPLETE}'=='TRUE') TRUE
Brian Freemaneca71072018-08-16 14:50:16 -0500781 \ Exit For Loop If ('${SO_COMPLETE}'=='TRUE')
782 \ Exit For Loop If ('${ELEMENT['status']}' == 'DISTRIBUTION_COMPLETE_ERROR')
Brian Freemanadaa2372018-10-24 12:25:22 -0500783 \ ${dist_status}= Set Variable If (('${ELEMENT['status']}' == 'COMPONENT_DONE_ERROR') and ('${ELEMENT['omfComponentID']}' == 'aai-ml')) EXIT
784 \ Exit For Loop If (('${ELEMENT['status']}' == 'COMPONENT_DONE_ERROR') and ('${ELEMENT['omfComponentID']}' == 'aai-ml'))
Brian Freemana62644f2018-05-13 12:47:38 -0500785 Should Be True ( '${SO_COMPLETE}'=='TRUE') SO Test
bdfreeman1421b2a49512018-11-25 07:32:19 -0500786 [Return]
787
DR695Hccff30b2017-02-17 18:44:24 -0500788Get Catalog Service Distribution Details
789 [Documentation] gets an asdc catalog Service distrbution details
790 [Arguments] ${catalog_service_distribution_id}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500791 ${resp}= Run ASDC Get Request ${ASDC_CATALOG_SERVICES_PATH}${ASDC_CATALOG_SERVICE_DISTRIBUTION_PATH}/${catalog_service_distribution_id} ${ASDC_OPS_USER_ID}
DR695Hccff30b2017-02-17 18:44:24 -0500792 Should Be Equal As Strings ${resp.status_code} 200
793 [Return] ${resp.json()}
794Run ASDC Health Check
795 [Documentation] Runs a ASDC health check
DR695Hbf5a3a32017-06-30 13:09:57 -0400796 ${session}= Create Session asdc ${ASDC_FE_ENDPOINT}
DR695Hccff30b2017-02-17 18:44:24 -0500797 ${uuid}= Generate UUID
798 ${headers}= Create Dictionary Accept=application/json Content-Type=application/json X-TransactionId=${GLOBAL_APPLICATION_ID}-${uuid} X-FromAppId=${GLOBAL_APPLICATION_ID}
799 ${resp}= Get Request asdc ${ASDC_HEALTH_CHECK_PATH} headers=${headers}
Brian Freemanadaa2372018-10-24 12:25:22 -0500800 # only test for HTTP 200 to determine SDC Health. SDC_DE_HEALTH is informational
Brian Freeman00f125e2018-09-05 13:03:48 -0500801 Should Be Equal As Strings ${resp.status_code} 200 SDC DOWN
Brian Freeman5cf5fa62018-04-23 20:28:16 -0500802 ${SDC_DE_HEALTH}= Catenate DOWN
DR695Hccff30b2017-02-17 18:44:24 -0500803 @{ITEMS}= Copy List ${resp.json()['componentsInfo']}
804 :FOR ${ELEMENT} IN @{ITEMS}
805 \ Log ${ELEMENT['healthCheckStatus']}
Brian Freemane546f7e2018-04-19 12:17:56 -0500806 \ ${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 -0500807 Log To Console (DMaaP:${SDC_DE_HEALTH}) no_newline=true
DR695Hccff30b2017-02-17 18:44:24 -0500808Run ASDC Get Request
809 [Documentation] Runs an ASDC get request
Brian Freeman44b8bb32018-05-03 21:08:42 -0500810 [Arguments] ${data_path} ${user}=${ASDC_DESIGNER_USER_ID} ${MY_ASDC_BE_ENDPOINT}=${ASDC_BE_ENDPOINT}
DR695Hccff30b2017-02-17 18:44:24 -0500811 ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500812 Log Creating session ${MY_ASDC_BE_ENDPOINT}
813 ${session}= Create Session asdc ${MY_ASDC_BE_ENDPOINT} auth=${auth}
DR695Hccff30b2017-02-17 18:44:24 -0500814 ${uuid}= Generate UUID
815 ${headers}= Create Dictionary Accept=application/json Content-Type=application/json USER_ID=${user} X-TransactionId=${GLOBAL_APPLICATION_ID}-${uuid} X-FromAppId=${GLOBAL_APPLICATION_ID}
816 ${resp}= Get Request asdc ${data_path} headers=${headers}
817 Log Received response from asdc ${resp.text}
818 [Return] ${resp}
819Run ASDC Put Request
820 [Documentation] Runs an ASDC put request
Brian Freeman44b8bb32018-05-03 21:08:42 -0500821 [Arguments] ${data_path} ${data} ${user}=${ASDC_DESIGNER_USER_ID} ${MY_ASDC_BE_ENDPOINT}=${ASDC_BE_ENDPOINT}
DR695Hccff30b2017-02-17 18:44:24 -0500822 ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500823 Log Creating session ${MY_ASDC_BE_ENDPOINT}
824 ${session}= Create Session asdc ${MY_ASDC_BE_ENDPOINT} auth=${auth}
DR695Hccff30b2017-02-17 18:44:24 -0500825 ${uuid}= Generate UUID
826 ${headers}= Create Dictionary Accept=application/json Content-Type=application/json USER_ID=${user} X-TransactionId=${GLOBAL_APPLICATION_ID}-${uuid} X-FromAppId=${GLOBAL_APPLICATION_ID}
827 ${resp}= Put Request asdc ${data_path} data=${data} headers=${headers}
828 Log Received response from asdc ${resp.text}
829 [Return] ${resp}
Jerry Flood6bd1afa2017-10-09 09:59:23 -0400830
DR695Hccff30b2017-02-17 18:44:24 -0500831Run ASDC Post Files Request
832 [Documentation] Runs an ASDC post request
Brian Freeman44b8bb32018-05-03 21:08:42 -0500833 [Arguments] ${data_path} ${files} ${user}=${ASDC_DESIGNER_USER_ID} ${MY_ASDC_BE_ENDPOINT}=${ASDC_BE_ENDPOINT}
DR695Hccff30b2017-02-17 18:44:24 -0500834 ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500835 Log Creating session ${MY_ASDC_BE_ENDPOINT}
836 ${session}= Create Session asdc ${MY_ASDC_BE_ENDPOINT} auth=${auth}
DR695Hccff30b2017-02-17 18:44:24 -0500837 ${uuid}= Generate UUID
838 ${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}
839 ${resp}= Post Request asdc ${data_path} files=${files} headers=${headers}
840 Log Received response from asdc ${resp.text}
Jerry Floode2a48d72017-06-21 15:06:29 -0400841 [Return] ${resp}
Jerry Flood6bd1afa2017-10-09 09:59:23 -0400842
DR695Hccff30b2017-02-17 18:44:24 -0500843Run ASDC Post Request
844 [Documentation] Runs an ASDC post request
Brian Freeman44b8bb32018-05-03 21:08:42 -0500845 [Arguments] ${data_path} ${data} ${user}=${ASDC_DESIGNER_USER_ID} ${MY_ASDC_BE_ENDPOINT}=${ASDC_BE_ENDPOINT}
DR695Hccff30b2017-02-17 18:44:24 -0500846 ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500847 Log Creating session ${MY_ASDC_BE_ENDPOINT}
848 ${session}= Create Session asdc ${MY_ASDC_BE_ENDPOINT} auth=${auth}
DR695Hccff30b2017-02-17 18:44:24 -0500849 ${uuid}= Generate UUID
850 ${headers}= Create Dictionary Accept=application/json Content-Type=application/json USER_ID=${user} X-TransactionId=${GLOBAL_APPLICATION_ID}-${uuid} X-FromAppId=${GLOBAL_APPLICATION_ID}
851 ${resp}= Post Request asdc ${data_path} data=${data} headers=${headers}
852 Log Received response from asdc ${resp.text}
Jerry Floode2a48d72017-06-21 15:06:29 -0400853 [Return] ${resp}
DR695Hccff30b2017-02-17 18:44:24 -0500854Run ASDC Delete Request
855 [Documentation] Runs an ASDC delete request
Brian Freeman44b8bb32018-05-03 21:08:42 -0500856 [Arguments] ${data_path} ${user}=${ASDC_DESIGNER_USER_ID} ${MY_ASDC_BE_ENDPOINT}=${ASDC_BE_ENDPOINT}
857 ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD}
858 Log Creating session ${MY_ASDC_BE_ENDPOINT}
859 ${session}= Create Session asdc ${MY_ASDC_BE_ENDPOINT} auth=${auth}
DR695Hccff30b2017-02-17 18:44:24 -0500860 ${uuid}= Generate UUID
861 ${headers}= Create Dictionary Accept=application/json Content-Type=application/json USER_ID=${user} X-TransactionId=${GLOBAL_APPLICATION_ID}-${uuid} X-FromAppId=${GLOBAL_APPLICATION_ID}
862 ${resp}= Delete Request asdc ${data_path} headers=${headers}
863 Log Received response from asdc ${resp.text}
Jerry Floode2a48d72017-06-21 15:06:29 -0400864 [Return] ${resp}
DR695Hccff30b2017-02-17 18:44:24 -0500865Open ASDC GUI
866 [Documentation] Logs in to ASDC GUI
867 [Arguments] ${PATH}
868 ## Setup Browever now being managed by the test case
869 ##Setup Browser
DR695Hbf5a3a32017-06-30 13:09:57 -0400870 Go To ${ASDC_FE_ENDPOINT}${PATH}
DR695Hccff30b2017-02-17 18:44:24 -0500871 Maximize Browser Window
Jerry Flood6bd1afa2017-10-09 09:59:23 -0400872
DR695Hccff30b2017-02-17 18:44:24 -0500873 Set Browser Implicit Wait ${GLOBAL_SELENIUM_BROWSER_IMPLICIT_WAIT}
DR695Hbf5a3a32017-06-30 13:09:57 -0400874 Log Logging in to ${ASDC_FE_ENDPOINT}${PATH}
DR695Hccff30b2017-02-17 18:44:24 -0500875 Title Should Be ASDC
Jerry Floode2a48d72017-06-21 15:06:29 -0400876 Wait Until Page Contains Element xpath=//div/a[text()='SDC'] ${GLOBAL_SELENIUM_BROWSER_WAIT_TIMEOUT}
DR695Hbf5a3a32017-06-30 13:09:57 -0400877 Log Logged in to ${ASDC_FE_ENDPOINT}${PATH}
Jerry Flood6bd1afa2017-10-09 09:59:23 -0400878
879
880Create Multi Part
881 [Arguments] ${addTo} ${partName} ${filePath} ${contentType}=${None}
882 ${fileData}= Get Binary File ${filePath}
883 ${fileDir} ${fileName}= Split Path ${filePath}
884 ${partData}= Create List ${fileName} ${fileData} ${contentType}
885 Set To Dictionary ${addTo} ${partName}=${partData}
Brian Freemanf940ee92018-05-25 21:09:05 -0500886