blob: 0297802fb0a6d6f38bfdfcb28af2d0da7f423c51 [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
9Resource global_properties.robot
10Resource browser_setup.robot
11Resource json_templater.robot
12*** Variables ***
13${ASDC_DESIGNER_USER_ID} cs0008
14${ASDC_TESTER_USER_ID} jm0007
15${ASDC_GOVERNOR_USER_ID} gv0001
16${ASDC_OPS_USER_ID} op0001
17${ASDC_HEALTH_CHECK_PATH} /sdc1/rest/healthCheck
18${ASDC_VENDOR_LICENSE_MODEL_PATH} /onboarding-api/v1.0/vendor-license-models
19${ASDC_VENDOR_SOFTWARE_PRODUCT_PATH} /onboarding-api/v1.0/vendor-software-products
20${ASDC_VENDOR_KEY_GROUP_PATH} /license-key-groups
21${ASDC_VENDOR_ENTITLEMENT_POOL_PATH} /entitlement-pools
22${ASDC_VENDOR_FEATURE_GROUP_PATH} /feature-groups
23${ASDC_VENDOR_LICENSE_AGREEMENT_PATH} /license-agreements
24${ASDC_VENDOR_ACTIONS_PATH} /actions
Jerry Floode2a48d72017-06-21 15:06:29 -040025${ASDC_VENDOR_SOFTWARE_UPLOAD_PATH} /orchestration-template-candidate
DR695Hccff30b2017-02-17 18:44:24 -050026${ASDC_CATALOG_RESOURCES_PATH} /sdc2/rest/v1/catalog/resources
27${ASDC_CATALOG_SERVICES_PATH} /sdc2/rest/v1/catalog/services
28${ASDC_CATALOG_INACTIVE_RESOURCES_PATH} /sdc2/rest/v1/inactiveComponents/resource
29${ASDC_CATALOG_INACTIVE_SERVICES_PATH} /sdc2/rest/v1/inactiveComponents/service
30${ASDC_CATALOG_LIFECYCLE_PATH} /lifecycleState
31${ASDC_CATALOG_SERVICE_RESOURCE_INSTANCE_PATH} /resourceInstance
32${ASDC_CATALOG_SERVICE_DISTRIBUTION_STATE_PATH} /distribution-state
33${ASDC_CATALOG_SERVICE_DISTRIBUTION_PATH} /distribution
34${ASDC_DISTRIBUTION_STATE_APPROVE_PATH} /approve
35${ASDC_CATALOG_SERVICE_DISTRIBUTION_ACTIVATE_PATH} /distribution/PROD/activate
36${ASDC_LICENSE_MODEL_TEMPLATE} robot/assets/templates/asdc/license_model.template
37${ASDC_KEY_GROUP_TEMPLATE} robot/assets/templates/asdc/key_group.template
38${ASDC_ENTITLEMENT_POOL_TEMPLATE} robot/assets/templates/asdc/entitlement_pool.template
39${ASDC_FEATURE_GROUP_TEMPLATE} robot/assets/templates/asdc/feature_group.template
40${ASDC_LICENSE_AGREEMENT_TEMPLATE} robot/assets/templates/asdc/license_agreement.template
41${ASDC_ACTION_TEMPLATE} robot/assets/templates/asdc/action.template
42${ASDC_SOFTWARE_PRODUCT_TEMPLATE} robot/assets/templates/asdc/software_product.template
43${ASDC_CATALOG_RESOURCE_TEMPLATE} robot/assets/templates/asdc/catalog_resource.template
44${ASDC_USER_REMARKS_TEMPLATE} robot/assets/templates/asdc/user_remarks.template
45${ASDC_CATALOG_SERVICE_TEMPLATE} robot/assets/templates/asdc/catalog_service.template
46${ASDC_RESOURCE_INSTANCE_TEMPLATE} robot/assets/templates/asdc/resource_instance.template
Brian Freemanf508ab22018-03-15 21:19:41 -050047${ASDC_FE_ENDPOINT} ${GLOBAL_ASDC_SERVER_PROTOCOL}://${GLOBAL_INJECTED_SDC_FE_IP_ADDR}:${GLOBAL_ASDC_FE_PORT}
48${ASDC_BE_ENDPOINT} ${GLOBAL_ASDC_SERVER_PROTOCOL}://${GLOBAL_INJECTED_SDC_BE_IP_ADDR}:${GLOBAL_ASDC_BE_PORT}
Brian Freeman44b8bb32018-05-03 21:08:42 -050049${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 -040050
DR695Hccff30b2017-02-17 18:44:24 -050051*** Keywords ***
52Distribute Model From ASDC
53 [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
jf986075010a42017-02-22 16:52:54 -050054 [Arguments] ${model_zip_path} ${catalog_service_name}=
55 ${catalog_service_id}= Add ASDC Catalog Service ${catalog_service_name}
DR695Hccff30b2017-02-17 18:44:24 -050056 ${catalog_resource_ids}= Create List
Jerry Flood3a169a32017-12-01 12:39:10 -050057 ${catalog_resources}= Create Dictionary
DR695Hccff30b2017-02-17 18:44:24 -050058 : FOR ${zip} IN @{model_zip_path}
59 \ ${loop_catalog_resource_id}= Setup ASDC Catalog Resource ${zip}
Jerry Floode2a48d72017-06-21 15:06:29 -040060 \ Append To List ${catalog_resource_ids} ${loop_catalog_resource_id}
DR695Hccff30b2017-02-17 18:44:24 -050061 \ ${loop_catalog_resource_resp}= Get ASDC Catalog Resource ${loop_catalog_resource_id}
62 \ Add ASDC Resource Instance ${catalog_service_id} ${loop_catalog_resource_id} ${loop_catalog_resource_resp['name']}
Jerry Flood3a169a32017-12-01 12:39:10 -050063 \ Set To Dictionary ${catalog_resources} ${loop_catalog_resource_id}=${loop_catalog_resource_resp}
DR695Hccff30b2017-02-17 18:44:24 -050064 ${catalog_service_resp}= Get ASDC Catalog Service ${catalog_service_id}
65 Checkin ASDC Catalog Service ${catalog_service_id}
66 Request Certify ASDC Catalog Service ${catalog_service_id}
67 Start Certify ASDC Catalog Service ${catalog_service_id}
68 # on certify it gets a new id
69 ${catalog_service_id}= Certify ASDC Catalog Service ${catalog_service_id}
70 Approve ASDC Catalog Service ${catalog_service_id}
Gary Wu58d58532018-07-27 16:02:51 -070071 : FOR ${DIST_INDEX} IN RANGE 3
Brian Freeman18df8912018-05-25 13:27:29 -050072 \ Log Distribution Attempt ${DIST_INDEX}
73 \ Distribute ASDC Catalog Service ${catalog_service_id}
74 \ ${catalog_service_resp}= Get ASDC Catalog Service ${catalog_service_id}
75 \ ${vf_module}= Find Element In Array ${loop_catalog_resource_resp['groups']} type org.openecomp.groups.VfModule
Brian Freemanf940ee92018-05-25 21:09:05 -050076 \ ${status} ${_} = Run Keyword And Ignore Error Loop Over Check Catalog Service Distributed ${catalog_service_resp['uuid']}
77 \ Exit For Loop If '${status}'=='PASS'
Brian Freeman8c002d52018-07-30 19:35:36 -050078 Should Be Equal As Strings ${status} PASS
Jerry Flood3a169a32017-12-01 12:39:10 -050079 [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 -050080
81Loop Over Check Catalog Service Distributed
Gary Wu58d58532018-07-27 16:02:51 -070082 [Arguments] ${catalog_service_id}
83 : FOR ${CHECK_INDEX} IN RANGE 15
84 \ ${status} ${_} = Run Keyword And Ignore Error Check Catalog Service Distributed ${catalog_service_id}
85 \ Sleep 20s
Brian Freemanf940ee92018-05-25 21:09:05 -050086 \ Return From Keyword If '${status}'=='PASS'
Brian Freeman8c002d52018-07-30 19:35:36 -050087 Should Be Equal As Strings ${status} PASS
Brian Freeman18df8912018-05-25 13:27:29 -050088
DR695Hccff30b2017-02-17 18:44:24 -050089Setup ASDC Catalog Resource
90 [Documentation] Creates all the steps a vf needs for an asdc catalog resource and returns the id
91 [Arguments] ${model_zip_path}
Brian Freemanb568e5e2018-04-05 21:03:38 -050092 ${license_model_id} ${license_model_version_id}= Add ASDC License Model
93 ${key_group_id}= Add ASDC License Group ${license_model_id} ${license_model_version_id}
94 ${pool_id}= Add ASDC Entitlement Pool ${license_model_id} ${license_model_version_id}
95 ${feature_group_id}= Add ASDC Feature Group ${license_model_id} ${key_group_id} ${pool_id} ${license_model_version_id}
96 ${license_agreement_id}= Add ASDC License Agreement ${license_model_id} ${feature_group_id} ${license_model_version_id}
97 Submit ASDC License Model ${license_model_id} ${license_model_version_id}
98 ${license_model_resp}= Get ASDC License Model ${license_model_id} ${license_model_version_id}
99 ${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}
100 Upload ASDC Heat Package ${software_product_id} ${model_zip_path} ${software_product_version_id}
101 Validate ASDC Software Product ${software_product_id} ${software_product_version_id}
102 Submit ASDC Software Product ${software_product_id} ${software_product_version_id}
103 Package ASDC Software Product ${software_product_id} ${software_product_version_id}
104 ${software_product_resp}= Get ASDC Software Product ${software_product_id} ${software_product_version_id}
105 ${catalog_resource_id}= Add ASDC Catalog Resource ${license_agreement_id} ${software_product_resp['name']} ${license_model_resp['vendorName']} ${software_product_id}
Brian Freemandb1e7412018-08-01 12:46:01 -0500106 ${catalog_resource_id}= Certify ASDC Catalog Resource ${catalog_resource_id} ${ASDC_DESIGNER_USER_ID}
DR695Hccff30b2017-02-17 18:44:24 -0500107 [Return] ${catalog_resource_id}
DR695Hccff30b2017-02-17 18:44:24 -0500108Add ASDC License Model
109 [Documentation] Creates an asdc license model and returns its id
Jerry Floode2a48d72017-06-21 15:06:29 -0400110 ${uuid}= Generate UUID
111 ${shortened_uuid}= Evaluate str("${uuid}")[:23]
DR695Hccff30b2017-02-17 18:44:24 -0500112 ${map}= Create Dictionary vendor_name=${shortened_uuid}
113 ${data}= Fill JSON Template File ${ASDC_LICENSE_MODEL_TEMPLATE} ${map}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500114 ${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 -0500115 Should Be Equal As Strings ${resp.status_code} 200
Brian Freemanb568e5e2018-04-05 21:03:38 -0500116 [Return] ${resp.json()['itemId']} ${resp.json()['version']['id']}
DR695Hccff30b2017-02-17 18:44:24 -0500117Get ASDC License Model
118 [Documentation] gets an asdc license model by its id
Jerry Floode2a48d72017-06-21 15:06:29 -0400119 [Arguments] ${id} ${version_id}=0.1
Brian Freeman44b8bb32018-05-03 21:08:42 -0500120 ${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 -0400121 [Return] ${resp.json()}
122Get ASDC License Models
123 [Documentation] gets an asdc license model by its id
Brian Freeman44b8bb32018-05-03 21:08:42 -0500124 ${resp}= Run ASDC Get Request ${ASDC_VENDOR_LICENSE_MODEL_PATH} ${ASDC_DESIGNER_USER_ID} ${ASDC_BE_ONBOARD_ENDPOINT}
125
DR695Hccff30b2017-02-17 18:44:24 -0500126 [Return] ${resp.json()}
127Checkin ASDC License Model
128 [Documentation] checksin an asdc license model by its id
Jerry Floode2a48d72017-06-21 15:06:29 -0400129 [Arguments] ${id} ${version_id}=0.1
DR695Hccff30b2017-02-17 18:44:24 -0500130 ${map}= Create Dictionary action=Checkin
131 ${data}= Fill JSON Template File ${ASDC_ACTION_TEMPLATE} ${map}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500132 ${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 -0500133 Should Be Equal As Strings ${resp.status_code} 200
134 [Return] ${resp.json()}
135Submit ASDC License Model
136 [Documentation] submits an asdc license model by its id
Jerry Floode2a48d72017-06-21 15:06:29 -0400137 [Arguments] ${id} ${version_id}=0.1
DR695Hccff30b2017-02-17 18:44:24 -0500138 ${map}= Create Dictionary action=Submit
139 ${data}= Fill JSON Template File ${ASDC_ACTION_TEMPLATE} ${map}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500140 ${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 -0500141 Should Be Equal As Strings ${resp.status_code} 200
142 [Return] ${resp.json()}
143Checkin ASDC Software Product
144 [Documentation] checksin an asdc Software Product by its id
Jerry Floode2a48d72017-06-21 15:06:29 -0400145 [Arguments] ${id} ${version_id}=0.1
DR695Hccff30b2017-02-17 18:44:24 -0500146 ${map}= Create Dictionary action=Checkin
Jerry Floode2a48d72017-06-21 15:06:29 -0400147 ${data}= Fill JSON Template File ${ASDC_ACTION_TEMPLATE} ${map}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500148 ${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 -0400149 Should Be Equal As Strings ${resp.status_code} 200
150 [Return] ${resp.json()}
151Validate ASDC Software Product
152 [Documentation] checksin an asdc Software Product by its id
153 [Arguments] ${id} ${version_id}=0.1
154 ${data}= Catenate
Brian Freeman44b8bb32018-05-03 21:08:42 -0500155 ${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 -0500156 Should Be Equal As Strings ${resp.status_code} 200
157 [Return] ${resp.json()}
158Submit ASDC Software Product
159 [Documentation] submits an asdc Software Product by its id
Jerry Floode2a48d72017-06-21 15:06:29 -0400160 [Arguments] ${id} ${version_id}=0.1
DR695Hccff30b2017-02-17 18:44:24 -0500161 ${map}= Create Dictionary action=Submit
Jerry Floode2a48d72017-06-21 15:06:29 -0400162 ${data}= Fill JSON Template File ${ASDC_ACTION_TEMPLATE} ${map}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500163 ${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 -0500164 Should Be Equal As Strings ${resp.status_code} 200
165 [Return] ${resp.json()}
166Package ASDC Software Product
167 [Documentation] creates_package on an asdc Software Product by its id
Jerry Floode2a48d72017-06-21 15:06:29 -0400168 [Arguments] ${id} ${version_id}=0.1
DR695Hccff30b2017-02-17 18:44:24 -0500169 ${map}= Create Dictionary action=Create_Package
Jerry Floode2a48d72017-06-21 15:06:29 -0400170 ${data}= Fill JSON Template File ${ASDC_ACTION_TEMPLATE} ${map}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500171 ${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 -0500172 Should Be Equal As Strings ${resp.status_code} 200
Jerry Floode2a48d72017-06-21 15:06:29 -0400173 [Return] ${resp.json()}
DR695Hccff30b2017-02-17 18:44:24 -0500174Add ASDC Entitlement Pool
175 [Documentation] Creates an asdc Entitlement Pool and returns its id
Jerry Floode2a48d72017-06-21 15:06:29 -0400176 [Arguments] ${license_model_id} ${version_id}=0.1
177 ${uuid}= Generate UUID
178 ${shortened_uuid}= Evaluate str("${uuid}")[:23]
DR695Hccff30b2017-02-17 18:44:24 -0500179 ${map}= Create Dictionary entitlement_pool_name=${shortened_uuid}
Jerry Floode2a48d72017-06-21 15:06:29 -0400180 ${data}= Fill JSON Template File ${ASDC_ENTITLEMENT_POOL_TEMPLATE} ${map}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500181 ${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 -0500182 Should Be Equal As Strings ${resp.status_code} 200
183 [Return] ${resp.json()['value']}
184Get ASDC Entitlement Pool
185 [Documentation] gets an asdc Entitlement Pool by its id
186 [Arguments] ${license_model_id} ${pool_id}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500187 ${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 -0500188 [Return] ${resp.json()}
189Add ASDC License Group
190 [Documentation] Creates an asdc license group and returns its id
Brian Freemanb568e5e2018-04-05 21:03:38 -0500191 [Arguments] ${license_model_id} ${version_id}=1.0
Jerry Floode2a48d72017-06-21 15:06:29 -0400192 ${uuid}= Generate UUID
193 ${shortened_uuid}= Evaluate str("${uuid}")[:23]
DR695Hccff30b2017-02-17 18:44:24 -0500194 ${map}= Create Dictionary key_group_name=${shortened_uuid}
Jerry Floode2a48d72017-06-21 15:06:29 -0400195 ${data}= Fill JSON Template File ${ASDC_KEY_GROUP_TEMPLATE} ${map}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500196 ${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 -0500197 Should Be Equal As Strings ${resp.status_code} 200
198 [Return] ${resp.json()['value']}
199Get ASDC License Group
200 [Documentation] gets an asdc license group by its id
Jerry Floode2a48d72017-06-21 15:06:29 -0400201 [Arguments] ${license_model_id} ${group_id} ${version_id}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500202 ${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 -0500203 [Return] ${resp.json()}
204Add ASDC Feature Group
205 [Documentation] Creates an asdc Feature Group and returns its id
Jerry Floode2a48d72017-06-21 15:06:29 -0400206 [Arguments] ${license_model_id} ${key_group_id} ${entitlement_pool_id} ${version_id}=0.1
207 ${uuid}= Generate UUID
208 ${shortened_uuid}= Evaluate str("${uuid}")[:23]
Jerry Flood80ff9852017-08-11 06:47:14 -0400209 ${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 -0400210 ${data}= Fill JSON Template File ${ASDC_FEATURE_GROUP_TEMPLATE} ${map}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500211 ${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 -0500212 Should Be Equal As Strings ${resp.status_code} 200
213 [Return] ${resp.json()['value']}
214Get ASDC Feature Group
215 [Documentation] gets an asdc Feature Group by its id
216 [Arguments] ${license_model_id} ${group_id}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500217 ${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 -0500218 [Return] ${resp.json()}
219Add ASDC License Agreement
220 [Documentation] Creates an asdc License Agreement and returns its id
Jerry Floode2a48d72017-06-21 15:06:29 -0400221 [Arguments] ${license_model_id} ${feature_group_id} ${version_id}=0.1
222 ${uuid}= Generate UUID
223 ${shortened_uuid}= Evaluate str("${uuid}")[:23]
DR695Hccff30b2017-02-17 18:44:24 -0500224 ${map}= Create Dictionary license_agreement_name=${shortened_uuid} feature_group_id=${feature_group_id}
Jerry Floode2a48d72017-06-21 15:06:29 -0400225 ${data}= Fill JSON Template File ${ASDC_LICENSE_AGREEMENT_TEMPLATE} ${map}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500226 ${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 -0500227 Should Be Equal As Strings ${resp.status_code} 200
228 [Return] ${resp.json()['value']}
229Get ASDC License Agreement
230 [Documentation] gets an asdc License Agreement by its id
231 [Arguments] ${license_model_id} ${agreement_id}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500232 ${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 -0500233 [Return] ${resp.json()}
234Add ASDC Software Product
235 [Documentation] Creates an asdc Software Product and returns its id
Brian Freemanb568e5e2018-04-05 21:03:38 -0500236 [Arguments] ${license_agreement_id} ${feature_group_id} ${license_model_name} ${license_model_id} ${license_model_version_id}
Jerry Floode2a48d72017-06-21 15:06:29 -0400237 ${uuid}= Generate UUID
238 ${shortened_uuid}= Evaluate str("${uuid}")[:23]
Brian Freemanb568e5e2018-04-05 21:03:38 -0500239 ${map}= Create Dictionary software_product_name=${shortened_uuid} 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 -0400240 ${data}= Fill JSON Template File ${ASDC_SOFTWARE_PRODUCT_TEMPLATE} ${map}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500241 ${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 -0500242 Should Be Equal As Strings ${resp.status_code} 200
Brian Freemanb568e5e2018-04-05 21:03:38 -0500243 [Return] ${resp.json()['itemId']} ${resp.json()['version']['id']}
DR695Hccff30b2017-02-17 18:44:24 -0500244Get ASDC Software Product
245 [Documentation] gets an asdc Software Product by its id
Jerry Floode2a48d72017-06-21 15:06:29 -0400246 [Arguments] ${software_product_id} ${version_id}=0.1
Brian Freeman44b8bb32018-05-03 21:08:42 -0500247 ${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 -0500248 [Return] ${resp.json()}
249Add ASDC Catalog Resource
250 [Documentation] Creates an asdc Catalog Resource and returns its id
251 [Arguments] ${license_agreement_id} ${software_product_name} ${license_model_name} ${software_product_id}
252 ${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 -0400253 ${data}= Fill JSON Template File ${ASDC_CATALOG_RESOURCE_TEMPLATE} ${map}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500254 ${resp}= Run ASDC Post Request ${ASDC_CATALOG_RESOURCES_PATH} ${data} ${ASDC_DESIGNER_USER_ID}
DR695Hccff30b2017-02-17 18:44:24 -0500255 Should Be Equal As Strings ${resp.status_code} 201
256 [Return] ${resp.json()['uniqueId']}
257Mark ASDC Catalog Resource Inactive
258 [Documentation] deletes an asdc Catalog Resource
259 [Arguments] ${catalog_resource_id}
260 ${resp}= Run ASDC Delete Request ${ASDC_CATALOG_RESOURCES_PATH}/${catalog_resource_id} ${ASDC_DESIGNER_USER_ID}
261 Should Be Equal As Strings ${resp.status_code} 204
262 [Return] ${resp}
263Delete Inactive ASDC Catalog Resources
264 [Documentation] delete all asdc Catalog Resources that are inactive
265 ${resp}= Run ASDC Delete Request ${ASDC_CATALOG_INACTIVE_RESOURCES_PATH} ${ASDC_DESIGNER_USER_ID}
266 Should Be Equal As Strings ${resp.status_code} 200
267 [Return] ${resp.json()}
268Get ASDC Catalog Resource
269 [Documentation] gets an asdc Catalog Resource by its id
270 [Arguments] ${catalog_resource_id}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500271 ${resp}= Run ASDC Get Request ${ASDC_CATALOG_RESOURCES_PATH}/${catalog_resource_id} ${ASDC_DESIGNER_USER_ID}
DR695Hccff30b2017-02-17 18:44:24 -0500272 [Return] ${resp.json()}
273Checkin ASDC Catalog Resource
274 [Documentation] checksin an asdc Catalog Resource by its id
275 [Arguments] ${catalog_resource_id}
276 ${map}= Create Dictionary user_remarks=Robot remarks
Jerry Floode2a48d72017-06-21 15:06:29 -0400277 ${data}= Fill JSON Template File ${ASDC_USER_REMARKS_TEMPLATE} ${map}
DR695Hccff30b2017-02-17 18:44:24 -0500278 ${resp}= Run ASDC Post Request ${ASDC_CATALOG_RESOURCES_PATH}/${catalog_resource_id}${ASDC_CATALOG_LIFECYCLE_PATH}/checkin ${data} ${ASDC_DESIGNER_USER_ID}
279 Should Be Equal As Strings ${resp.status_code} 200
280 [Return] ${resp.json()}
281Request Certify ASDC Catalog Resource
282 [Documentation] requests certify on an asdc Catalog Resource by its id
283 [Arguments] ${catalog_resource_id}
284 ${map}= Create Dictionary user_remarks=Robot remarks
Jerry Floode2a48d72017-06-21 15:06:29 -0400285 ${data}= Fill JSON Template File ${ASDC_USER_REMARKS_TEMPLATE} ${map}
DR695Hccff30b2017-02-17 18:44:24 -0500286 ${resp}= Run ASDC Post Request ${ASDC_CATALOG_RESOURCES_PATH}/${catalog_resource_id}${ASDC_CATALOG_LIFECYCLE_PATH}/certificationRequest ${data} ${ASDC_DESIGNER_USER_ID}
287 Should Be Equal As Strings ${resp.status_code} 200
288 [Return] ${resp.json()}
289Start Certify ASDC Catalog Resource
290 [Documentation] start certify an asdc Catalog Resource by its id
291 [Arguments] ${catalog_resource_id}
292 ${resp}= Run ASDC Post Request ${ASDC_CATALOG_RESOURCES_PATH}/${catalog_resource_id}${ASDC_CATALOG_LIFECYCLE_PATH}/startCertification ${None} ${ASDC_TESTER_USER_ID}
293 Should Be Equal As Strings ${resp.status_code} 200
294 [Return] ${resp.json()}
295Certify ASDC Catalog Resource
296 [Documentation] start certify an asdc Catalog Resource by its id and returns the new id
Brian Freemandb1e7412018-08-01 12:46:01 -0500297 [Arguments] ${catalog_resource_id} ${user_id}=${ASDC_TESTER_USER_ID}
DR695Hccff30b2017-02-17 18:44:24 -0500298 ${map}= Create Dictionary user_remarks=Robot remarks
Jerry Floode2a48d72017-06-21 15:06:29 -0400299 ${data}= Fill JSON Template File ${ASDC_USER_REMARKS_TEMPLATE} ${map}
Brian Freemandb1e7412018-08-01 12:46:01 -0500300 ${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 -0500301 Should Be Equal As Strings ${resp.status_code} 200
302 [Return] ${resp.json()['uniqueId']}
Jerry Flood6bd1afa2017-10-09 09:59:23 -0400303
DR695Hccff30b2017-02-17 18:44:24 -0500304Upload ASDC Heat Package
Brian Freemanf508ab22018-03-15 21:19:41 -0500305 [Documentation] Creates an asdc Software Product and returns its id
306 [Arguments] ${software_product_id} ${file_path} ${version_id}=0.1
Jerry Flood6bd1afa2017-10-09 09:59:23 -0400307 ${files}= Create Dictionary
308 Create Multi Part ${files} upload ${file_path} contentType=application/zip
Brian Freeman44b8bb32018-05-03 21:08:42 -0500309 ${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 -0500310 Should Be Equal As Strings ${resp.status_code} 200
Jerry Flood6bd1afa2017-10-09 09:59:23 -0400311
DR695Hccff30b2017-02-17 18:44:24 -0500312Add ASDC Catalog Service
313 [Documentation] Creates an asdc Catalog Service and returns its id
jf986075010a42017-02-22 16:52:54 -0500314 [Arguments] ${catalog_service_name}
Jerry Floode2a48d72017-06-21 15:06:29 -0400315 ${uuid}= Generate UUID
jf986075010a42017-02-22 16:52:54 -0500316 ${shortened_uuid}= Evaluate str("${uuid}")[:23]
Jerry Floode2a48d72017-06-21 15:06:29 -0400317 ${catalog_service_name}= Set Variable If '${catalog_service_name}' =='' ${shortened_uuid} ${catalog_service_name}
jf986075010a42017-02-22 16:52:54 -0500318 ${map}= Create Dictionary service_name=${catalog_service_name}
Jerry Floode2a48d72017-06-21 15:06:29 -0400319 ${data}= Fill JSON Template File ${ASDC_CATALOG_SERVICE_TEMPLATE} ${map}
DR695Hccff30b2017-02-17 18:44:24 -0500320 ${resp}= Run ASDC Post Request ${ASDC_CATALOG_SERVICES_PATH} ${data} ${ASDC_DESIGNER_USER_ID}
321 Should Be Equal As Strings ${resp.status_code} 201
322 [Return] ${resp.json()['uniqueId']}
323Mark ASDC Catalog Service Inactive
324 [Documentation] Deletes an asdc Catalog Service
325 [Arguments] ${catalog_service_id}
326 ${resp}= Run ASDC Delete Request ${ASDC_CATALOG_SERVICES_PATH}/${catalog_service_id} ${ASDC_DESIGNER_USER_ID}
327 Should Be Equal As Strings ${resp.status_code} 204
328 [Return] ${resp}
329Delete Inactive ASDC Catalog Services
330 [Documentation] delete all asdc Catalog Serivces that are inactive
331 ${resp}= Run ASDC Delete Request ${ASDC_CATALOG_INACTIVE_SERVICES_PATH} ${ASDC_DESIGNER_USER_ID}
332 Should Be Equal As Strings ${resp.status_code} 200
333 [Return] ${resp.json()}
334Get ASDC Catalog Service
335 [Documentation] gets an asdc Catalog Service by its id
336 [Arguments] ${catalog_service_id}
337 ${resp}= Run ASDC Get Request ${ASDC_CATALOG_SERVICES_PATH}/${catalog_service_id} ${ASDC_DESIGNER_USER_ID}
338 [Return] ${resp.json()}
339Checkin ASDC Catalog Service
340 [Documentation] checksin an asdc Catalog Service by its id
341 [Arguments] ${catalog_service_id}
342 ${map}= Create Dictionary user_remarks=Robot remarks
Jerry Floode2a48d72017-06-21 15:06:29 -0400343 ${data}= Fill JSON Template File ${ASDC_USER_REMARKS_TEMPLATE} ${map}
DR695Hccff30b2017-02-17 18:44:24 -0500344 ${resp}= Run ASDC Post Request ${ASDC_CATALOG_SERVICES_PATH}/${catalog_service_id}${ASDC_CATALOG_LIFECYCLE_PATH}/checkin ${data} ${ASDC_DESIGNER_USER_ID}
345 Should Be Equal As Strings ${resp.status_code} 200
346 [Return] ${resp.json()}
347Request Certify ASDC Catalog Service
348 [Documentation] requests certify on an asdc Catalog Service by its id
349 [Arguments] ${catalog_service_id}
350 ${map}= Create Dictionary user_remarks=Robot remarks
Jerry Floode2a48d72017-06-21 15:06:29 -0400351 ${data}= Fill JSON Template File ${ASDC_USER_REMARKS_TEMPLATE} ${map}
DR695Hccff30b2017-02-17 18:44:24 -0500352 ${resp}= Run ASDC Post Request ${ASDC_CATALOG_SERVICES_PATH}/${catalog_service_id}${ASDC_CATALOG_LIFECYCLE_PATH}/certificationRequest ${data} ${ASDC_DESIGNER_USER_ID}
353 Should Be Equal As Strings ${resp.status_code} 200
354 [Return] ${resp.json()}
355Start Certify ASDC Catalog Service
356 [Documentation] start certify an asdc Catalog Service by its id
357 [Arguments] ${catalog_service_id}
358 ${resp}= Run ASDC Post Request ${ASDC_CATALOG_SERVICES_PATH}/${catalog_service_id}${ASDC_CATALOG_LIFECYCLE_PATH}/startCertification ${None} ${ASDC_TESTER_USER_ID}
359 Should Be Equal As Strings ${resp.status_code} 200
360 [Return] ${resp.json()}
361Certify ASDC Catalog Service
362 [Documentation] start certify an asdc Catalog Service by its id and returns the new id
363 [Arguments] ${catalog_service_id}
364 ${map}= Create Dictionary user_remarks=Robot remarks
Jerry Floode2a48d72017-06-21 15:06:29 -0400365 ${data}= Fill JSON Template File ${ASDC_USER_REMARKS_TEMPLATE} ${map}
DR695Hccff30b2017-02-17 18:44:24 -0500366 ${resp}= Run ASDC Post Request ${ASDC_CATALOG_SERVICES_PATH}/${catalog_service_id}${ASDC_CATALOG_LIFECYCLE_PATH}/certify ${data} ${ASDC_TESTER_USER_ID}
367 Should Be Equal As Strings ${resp.status_code} 200
368 [Return] ${resp.json()['uniqueId']}
369Approve ASDC Catalog Service
370 [Documentation] approve an asdc Catalog Service by its id
371 [Arguments] ${catalog_service_id}
372 ${map}= Create Dictionary user_remarks=Robot remarks
Jerry Floode2a48d72017-06-21 15:06:29 -0400373 ${data}= Fill JSON Template File ${ASDC_USER_REMARKS_TEMPLATE} ${map}
DR695Hccff30b2017-02-17 18:44:24 -0500374 ${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}
375 Should Be Equal As Strings ${resp.status_code} 200
376 [Return] ${resp.json()}
377Distribute ASDC Catalog Service
378 [Documentation] distribute an asdc Catalog Service by its id
379 [Arguments] ${catalog_service_id}
380 ${resp}= Run ASDC Post Request ${ASDC_CATALOG_SERVICES_PATH}/${catalog_service_id}${ASDC_CATALOG_SERVICE_DISTRIBUTION_ACTIVATE_PATH} ${None} ${ASDC_OPS_USER_ID}
381 Should Be Equal As Strings ${resp.status_code} 200
382 [Return] ${resp.json()}
383Add ASDC Resource Instance
384 [Documentation] Creates an asdc Resource Instance and returns its id
385 [Arguments] ${catalog_service_id} ${catalog_resource_id} ${catalog_resource_name}
386 ${milli_timestamp}= Generate MilliTimestamp UUID
387 ${map}= Create Dictionary catalog_resource_id=${catalog_resource_id} catalog_resource_name=${catalog_resource_name} milli_timestamp=${milli_timestamp}
Jerry Floode2a48d72017-06-21 15:06:29 -0400388 ${data}= Fill JSON Template File ${ASDC_RESOURCE_INSTANCE_TEMPLATE} ${map}
DR695Hccff30b2017-02-17 18:44:24 -0500389 ${resp}= Run ASDC Post Request ${ASDC_CATALOG_SERVICES_PATH}/${catalog_service_id}${ASDC_CATALOG_SERVICE_RESOURCE_INSTANCE_PATH} ${data} ${ASDC_DESIGNER_USER_ID}
390 Should Be Equal As Strings ${resp.status_code} 201
391 [Return] ${resp.json()['uniqueId']}
392Get Catalog Service Distribution
393 [Documentation] gets an asdc catalog Service distrbution
394 [Arguments] ${catalog_service_uuid}
395 ${resp}= Run ASDC Get Request ${ASDC_CATALOG_SERVICES_PATH}/${catalog_service_uuid}${ASDC_CATALOG_SERVICE_DISTRIBUTION_PATH} ${ASDC_OPS_USER_ID}
396 Should Be Equal As Strings ${resp.status_code} 200
397 [Return] ${resp.json()}
398Check Catalog Service Distributed
399 [Documentation] gets an asdc catalog Service distrbution
400 [Arguments] ${catalog_service_uuid}
401 ${dist_resp}= Get Catalog Service Distribution ${catalog_service_uuid}
402 Should Be Equal As Strings ${dist_resp['distributionStatusOfServiceList'][0]['deployementStatus']} Distributed
403 ${det_resp}= Get Catalog Service Distribution Details ${dist_resp['distributionStatusOfServiceList'][0]['distributionID']}
404 @{ITEMS}= Copy List ${det_resp['distributionStatusList']}
Brian Freemanf508ab22018-03-15 21:19:41 -0500405 Should Not Be Empty ${ITEMS}
406 ${AAI_DEPLOY} Set Variable FALSE
407 ${SDNC_DEPLOY} Set Variable FALSE
408 ${SO_DEPLOY} Set Variable FALSE
Brian Freemana62644f2018-05-13 12:47:38 -0500409 ${SO_COMPLETE} Set Variable FALSE
DR695Hccff30b2017-02-17 18:44:24 -0500410 :FOR ${ELEMENT} IN @{ITEMS}
Brian Freemanf508ab22018-03-15 21:19:41 -0500411 \ Log ${ELEMENT['omfComponentID']}
DR695Hccff30b2017-02-17 18:44:24 -0500412 \ Log ${ELEMENT['status']}
Brian Freemanf508ab22018-03-15 21:19:41 -0500413 \ ${SDNC_DEPLOY} Set Variable If (('sdnc-docker' in '${ELEMENT['omfComponentID']}') and ('${ELEMENT['status']}' == 'DEPLOY_OK')) or ('${SDNC_DEPLOY}' == 'TRUE') TRUE
414 \ ${SO_DEPLOY} Set Variable If (('mso-docker' in '${ELEMENT['omfComponentID']}') and ('${ELEMENT['status']}' == 'DEPLOY_OK')) or ('${SO_DEPLOY}' == 'TRUE') TRUE
415 \ ${AAI_DEPLOY} Set Variable If (('aai-ml' in '${ELEMENT['omfComponentID']}') and ('${ELEMENT['status']}' == 'DEPLOY_OK')) or ('${AAI_DEPLOY}'=='TRUE') TRUE
Brian Freemana62644f2018-05-13 12:47:38 -0500416 \ ${SO_COMPLETE} Set Variable If (('mso-docker' in '${ELEMENT['omfComponentID']}') and ('${ELEMENT['status']}' == 'DISTRIBUTION_COMPLETE_OK')) or ('${SO_COMPLETE}'=='TRUE') TRUE
Brian Freemanf508ab22018-03-15 21:19:41 -0500417 Should Be True ( '${SDNC_DEPLOY}'=='TRUE') SDNC Test
Brian Freemana62644f2018-05-13 12:47:38 -0500418 Should Be True ( '${SO_DEPLOY}'=='TRUE') SO Test
Brian Freemanf508ab22018-03-15 21:19:41 -0500419 Should Be True ( '${AAI_DEPLOY}'=='TRUE') AAI Test
Brian Freemana62644f2018-05-13 12:47:38 -0500420 Should Be True ( '${SO_COMPLETE}'=='TRUE') SO Test
DR695Hccff30b2017-02-17 18:44:24 -0500421Get Catalog Service Distribution Details
422 [Documentation] gets an asdc catalog Service distrbution details
423 [Arguments] ${catalog_service_distribution_id}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500424 ${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 -0500425 Should Be Equal As Strings ${resp.status_code} 200
426 [Return] ${resp.json()}
427Run ASDC Health Check
428 [Documentation] Runs a ASDC health check
DR695Hbf5a3a32017-06-30 13:09:57 -0400429 ${session}= Create Session asdc ${ASDC_FE_ENDPOINT}
DR695Hccff30b2017-02-17 18:44:24 -0500430 ${uuid}= Generate UUID
431 ${headers}= Create Dictionary Accept=application/json Content-Type=application/json X-TransactionId=${GLOBAL_APPLICATION_ID}-${uuid} X-FromAppId=${GLOBAL_APPLICATION_ID}
432 ${resp}= Get Request asdc ${ASDC_HEALTH_CHECK_PATH} headers=${headers}
433 Should Be Equal As Strings ${resp.status_code} 200
Brian Freeman5cf5fa62018-04-23 20:28:16 -0500434 ${SDC_DE_HEALTH}= Catenate DOWN
DR695Hccff30b2017-02-17 18:44:24 -0500435 @{ITEMS}= Copy List ${resp.json()['componentsInfo']}
436 :FOR ${ELEMENT} IN @{ITEMS}
437 \ Log ${ELEMENT['healthCheckStatus']}
Brian Freemane546f7e2018-04-19 12:17:56 -0500438 \ ${SDC_DE_HEALTH} Set Variable If (('DE' in '${ELEMENT['healthCheckComponent']}') and ('${ELEMENT['healthCheckStatus']}' == 'UP')) or ('${SDC_DE_HEALTH}'=='UP') UP
439 Should Be Equal As Strings ${SDC_DE_HEALTH} UP
DR695Hccff30b2017-02-17 18:44:24 -0500440Run ASDC Get Request
441 [Documentation] Runs an ASDC get request
Brian Freeman44b8bb32018-05-03 21:08:42 -0500442 [Arguments] ${data_path} ${user}=${ASDC_DESIGNER_USER_ID} ${MY_ASDC_BE_ENDPOINT}=${ASDC_BE_ENDPOINT}
DR695Hccff30b2017-02-17 18:44:24 -0500443 ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500444 Log Creating session ${MY_ASDC_BE_ENDPOINT}
445 ${session}= Create Session asdc ${MY_ASDC_BE_ENDPOINT} auth=${auth}
DR695Hccff30b2017-02-17 18:44:24 -0500446 ${uuid}= Generate UUID
447 ${headers}= Create Dictionary Accept=application/json Content-Type=application/json USER_ID=${user} X-TransactionId=${GLOBAL_APPLICATION_ID}-${uuid} X-FromAppId=${GLOBAL_APPLICATION_ID}
448 ${resp}= Get Request asdc ${data_path} headers=${headers}
449 Log Received response from asdc ${resp.text}
450 [Return] ${resp}
451Run ASDC Put Request
452 [Documentation] Runs an ASDC put request
Brian Freeman44b8bb32018-05-03 21:08:42 -0500453 [Arguments] ${data_path} ${data} ${user}=${ASDC_DESIGNER_USER_ID} ${MY_ASDC_BE_ENDPOINT}=${ASDC_BE_ENDPOINT}
DR695Hccff30b2017-02-17 18:44:24 -0500454 ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500455 Log Creating session ${MY_ASDC_BE_ENDPOINT}
456 ${session}= Create Session asdc ${MY_ASDC_BE_ENDPOINT} auth=${auth}
DR695Hccff30b2017-02-17 18:44:24 -0500457 ${uuid}= Generate UUID
458 ${headers}= Create Dictionary Accept=application/json Content-Type=application/json USER_ID=${user} X-TransactionId=${GLOBAL_APPLICATION_ID}-${uuid} X-FromAppId=${GLOBAL_APPLICATION_ID}
459 ${resp}= Put Request asdc ${data_path} data=${data} headers=${headers}
460 Log Received response from asdc ${resp.text}
461 [Return] ${resp}
Jerry Flood6bd1afa2017-10-09 09:59:23 -0400462
DR695Hccff30b2017-02-17 18:44:24 -0500463Run ASDC Post Files Request
464 [Documentation] Runs an ASDC post request
Brian Freeman44b8bb32018-05-03 21:08:42 -0500465 [Arguments] ${data_path} ${files} ${user}=${ASDC_DESIGNER_USER_ID} ${MY_ASDC_BE_ENDPOINT}=${ASDC_BE_ENDPOINT}
DR695Hccff30b2017-02-17 18:44:24 -0500466 ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500467 Log Creating session ${MY_ASDC_BE_ENDPOINT}
468 ${session}= Create Session asdc ${MY_ASDC_BE_ENDPOINT} auth=${auth}
DR695Hccff30b2017-02-17 18:44:24 -0500469 ${uuid}= Generate UUID
470 ${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}
471 ${resp}= Post Request asdc ${data_path} files=${files} headers=${headers}
472 Log Received response from asdc ${resp.text}
Jerry Floode2a48d72017-06-21 15:06:29 -0400473 [Return] ${resp}
Jerry Flood6bd1afa2017-10-09 09:59:23 -0400474
DR695Hccff30b2017-02-17 18:44:24 -0500475Run ASDC Post Request
476 [Documentation] Runs an ASDC post request
Brian Freeman44b8bb32018-05-03 21:08:42 -0500477 [Arguments] ${data_path} ${data} ${user}=${ASDC_DESIGNER_USER_ID} ${MY_ASDC_BE_ENDPOINT}=${ASDC_BE_ENDPOINT}
DR695Hccff30b2017-02-17 18:44:24 -0500478 ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500479 Log Creating session ${MY_ASDC_BE_ENDPOINT}
480 ${session}= Create Session asdc ${MY_ASDC_BE_ENDPOINT} auth=${auth}
DR695Hccff30b2017-02-17 18:44:24 -0500481 ${uuid}= Generate UUID
482 ${headers}= Create Dictionary Accept=application/json Content-Type=application/json USER_ID=${user} X-TransactionId=${GLOBAL_APPLICATION_ID}-${uuid} X-FromAppId=${GLOBAL_APPLICATION_ID}
483 ${resp}= Post Request asdc ${data_path} data=${data} headers=${headers}
484 Log Received response from asdc ${resp.text}
Jerry Floode2a48d72017-06-21 15:06:29 -0400485 [Return] ${resp}
DR695Hccff30b2017-02-17 18:44:24 -0500486Run ASDC Delete Request
487 [Documentation] Runs an ASDC delete request
Brian Freeman44b8bb32018-05-03 21:08:42 -0500488 [Arguments] ${data_path} ${user}=${ASDC_DESIGNER_USER_ID} ${MY_ASDC_BE_ENDPOINT}=${ASDC_BE_ENDPOINT}
489 ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD}
490 Log Creating session ${MY_ASDC_BE_ENDPOINT}
491 ${session}= Create Session asdc ${MY_ASDC_BE_ENDPOINT} auth=${auth}
DR695Hccff30b2017-02-17 18:44:24 -0500492 ${uuid}= Generate UUID
493 ${headers}= Create Dictionary Accept=application/json Content-Type=application/json USER_ID=${user} X-TransactionId=${GLOBAL_APPLICATION_ID}-${uuid} X-FromAppId=${GLOBAL_APPLICATION_ID}
494 ${resp}= Delete Request asdc ${data_path} headers=${headers}
495 Log Received response from asdc ${resp.text}
Jerry Floode2a48d72017-06-21 15:06:29 -0400496 [Return] ${resp}
DR695Hccff30b2017-02-17 18:44:24 -0500497Open ASDC GUI
498 [Documentation] Logs in to ASDC GUI
499 [Arguments] ${PATH}
500 ## Setup Browever now being managed by the test case
501 ##Setup Browser
DR695Hbf5a3a32017-06-30 13:09:57 -0400502 Go To ${ASDC_FE_ENDPOINT}${PATH}
DR695Hccff30b2017-02-17 18:44:24 -0500503 Maximize Browser Window
Jerry Flood6bd1afa2017-10-09 09:59:23 -0400504
DR695Hccff30b2017-02-17 18:44:24 -0500505 Set Browser Implicit Wait ${GLOBAL_SELENIUM_BROWSER_IMPLICIT_WAIT}
DR695Hbf5a3a32017-06-30 13:09:57 -0400506 Log Logging in to ${ASDC_FE_ENDPOINT}${PATH}
DR695Hccff30b2017-02-17 18:44:24 -0500507 Title Should Be ASDC
Jerry Floode2a48d72017-06-21 15:06:29 -0400508 Wait Until Page Contains Element xpath=//div/a[text()='SDC'] ${GLOBAL_SELENIUM_BROWSER_WAIT_TIMEOUT}
DR695Hbf5a3a32017-06-30 13:09:57 -0400509 Log Logged in to ${ASDC_FE_ENDPOINT}${PATH}
Jerry Flood6bd1afa2017-10-09 09:59:23 -0400510
511
512Create Multi Part
513 [Arguments] ${addTo} ${partName} ${filePath} ${contentType}=${None}
514 ${fileData}= Get Binary File ${filePath}
515 ${fileDir} ${fileName}= Split Path ${filePath}
516 ${partData}= Create List ${fileName} ${fileData} ${contentType}
517 Set To Dictionary ${addTo} ${partName}=${partData}
Brian Freemanf940ee92018-05-25 21:09:05 -0500518