blob: c49f942e07e6e1734360b2d93610d1b5b3ca3793 [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}
Brian Freeman796b9eb2018-10-08 08:23:20 -050071 : FOR ${DIST_INDEX} IN RANGE 1
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}
Brian Freemanadaa2372018-10-24 12:25:22 -050083 # SO watchdog timeout is 300 seconds need buffer
84 ${dist_status}= Set Variable FAIL
85 : FOR ${CHECK_INDEX} IN RANGE 20
86 \ ${status} ${_} = Run Keyword And Ignore Error Check Catalog Service Distributed ${catalog_service_id} ${dist_status}
Gary Wu58d58532018-07-27 16:02:51 -070087 \ Sleep 20s
Brian Freemanf940ee92018-05-25 21:09:05 -050088 \ Return From Keyword If '${status}'=='PASS'
Brian Freemanadaa2372018-10-24 12:25:22 -050089 \ Exit For Loop If '${dist_status}'=='EXIT'
Brian Freeman8c002d52018-07-30 19:35:36 -050090 Should Be Equal As Strings ${status} PASS
Brian Freeman18df8912018-05-25 13:27:29 -050091
DR695Hccff30b2017-02-17 18:44:24 -050092Setup ASDC Catalog Resource
93 [Documentation] Creates all the steps a vf needs for an asdc catalog resource and returns the id
94 [Arguments] ${model_zip_path}
Brian Freemanb568e5e2018-04-05 21:03:38 -050095 ${license_model_id} ${license_model_version_id}= Add ASDC License Model
96 ${key_group_id}= Add ASDC License Group ${license_model_id} ${license_model_version_id}
97 ${pool_id}= Add ASDC Entitlement Pool ${license_model_id} ${license_model_version_id}
98 ${feature_group_id}= Add ASDC Feature Group ${license_model_id} ${key_group_id} ${pool_id} ${license_model_version_id}
99 ${license_agreement_id}= Add ASDC License Agreement ${license_model_id} ${feature_group_id} ${license_model_version_id}
100 Submit ASDC License Model ${license_model_id} ${license_model_version_id}
101 ${license_model_resp}= Get ASDC License Model ${license_model_id} ${license_model_version_id}
102 ${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}
103 Upload ASDC Heat Package ${software_product_id} ${model_zip_path} ${software_product_version_id}
104 Validate ASDC Software Product ${software_product_id} ${software_product_version_id}
105 Submit ASDC Software Product ${software_product_id} ${software_product_version_id}
106 Package ASDC Software Product ${software_product_id} ${software_product_version_id}
107 ${software_product_resp}= Get ASDC Software Product ${software_product_id} ${software_product_version_id}
108 ${catalog_resource_id}= Add ASDC Catalog Resource ${license_agreement_id} ${software_product_resp['name']} ${license_model_resp['vendorName']} ${software_product_id}
Brian Freeman391680a2018-08-11 15:20:58 -0500109 ${catalog_resource_id}= Certify ASDC Catalog Resource ${catalog_resource_id} ${ASDC_DESIGNER_USER_ID}
DR695Hccff30b2017-02-17 18:44:24 -0500110 [Return] ${catalog_resource_id}
DR695Hccff30b2017-02-17 18:44:24 -0500111Add ASDC License Model
112 [Documentation] Creates an asdc license model and returns its id
Jerry Floode2a48d72017-06-21 15:06:29 -0400113 ${uuid}= Generate UUID
114 ${shortened_uuid}= Evaluate str("${uuid}")[:23]
DR695Hccff30b2017-02-17 18:44:24 -0500115 ${map}= Create Dictionary vendor_name=${shortened_uuid}
116 ${data}= Fill JSON Template File ${ASDC_LICENSE_MODEL_TEMPLATE} ${map}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500117 ${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 -0500118 Should Be Equal As Strings ${resp.status_code} 200
Brian Freemanb568e5e2018-04-05 21:03:38 -0500119 [Return] ${resp.json()['itemId']} ${resp.json()['version']['id']}
DR695Hccff30b2017-02-17 18:44:24 -0500120Get ASDC License Model
121 [Documentation] gets an asdc license model by its id
Jerry Floode2a48d72017-06-21 15:06:29 -0400122 [Arguments] ${id} ${version_id}=0.1
Brian Freeman44b8bb32018-05-03 21:08:42 -0500123 ${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 -0400124 [Return] ${resp.json()}
125Get ASDC License Models
126 [Documentation] gets an asdc license model by its id
Brian Freeman44b8bb32018-05-03 21:08:42 -0500127 ${resp}= Run ASDC Get Request ${ASDC_VENDOR_LICENSE_MODEL_PATH} ${ASDC_DESIGNER_USER_ID} ${ASDC_BE_ONBOARD_ENDPOINT}
128
DR695Hccff30b2017-02-17 18:44:24 -0500129 [Return] ${resp.json()}
130Checkin ASDC License Model
131 [Documentation] checksin an asdc license model by its id
Jerry Floode2a48d72017-06-21 15:06:29 -0400132 [Arguments] ${id} ${version_id}=0.1
DR695Hccff30b2017-02-17 18:44:24 -0500133 ${map}= Create Dictionary action=Checkin
134 ${data}= Fill JSON Template File ${ASDC_ACTION_TEMPLATE} ${map}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500135 ${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 -0500136 Should Be Equal As Strings ${resp.status_code} 200
137 [Return] ${resp.json()}
138Submit ASDC License Model
139 [Documentation] submits an asdc license model by its id
Jerry Floode2a48d72017-06-21 15:06:29 -0400140 [Arguments] ${id} ${version_id}=0.1
DR695Hccff30b2017-02-17 18:44:24 -0500141 ${map}= Create Dictionary action=Submit
142 ${data}= Fill JSON Template File ${ASDC_ACTION_TEMPLATE} ${map}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500143 ${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 -0500144 Should Be Equal As Strings ${resp.status_code} 200
145 [Return] ${resp.json()}
146Checkin ASDC Software Product
147 [Documentation] checksin an asdc Software Product by its id
Jerry Floode2a48d72017-06-21 15:06:29 -0400148 [Arguments] ${id} ${version_id}=0.1
DR695Hccff30b2017-02-17 18:44:24 -0500149 ${map}= Create Dictionary action=Checkin
Jerry Floode2a48d72017-06-21 15:06:29 -0400150 ${data}= Fill JSON Template File ${ASDC_ACTION_TEMPLATE} ${map}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500151 ${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 -0400152 Should Be Equal As Strings ${resp.status_code} 200
153 [Return] ${resp.json()}
154Validate ASDC Software Product
155 [Documentation] checksin an asdc Software Product by its id
156 [Arguments] ${id} ${version_id}=0.1
157 ${data}= Catenate
Brian Freeman44b8bb32018-05-03 21:08:42 -0500158 ${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 -0500159 Should Be Equal As Strings ${resp.status_code} 200
160 [Return] ${resp.json()}
161Submit ASDC Software Product
162 [Documentation] submits an asdc Software Product by its id
Jerry Floode2a48d72017-06-21 15:06:29 -0400163 [Arguments] ${id} ${version_id}=0.1
DR695Hccff30b2017-02-17 18:44:24 -0500164 ${map}= Create Dictionary action=Submit
Jerry Floode2a48d72017-06-21 15:06:29 -0400165 ${data}= Fill JSON Template File ${ASDC_ACTION_TEMPLATE} ${map}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500166 ${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 -0500167 Should Be Equal As Strings ${resp.status_code} 200
168 [Return] ${resp.json()}
169Package ASDC Software Product
170 [Documentation] creates_package on an asdc Software Product by its id
Jerry Floode2a48d72017-06-21 15:06:29 -0400171 [Arguments] ${id} ${version_id}=0.1
DR695Hccff30b2017-02-17 18:44:24 -0500172 ${map}= Create Dictionary action=Create_Package
Jerry Floode2a48d72017-06-21 15:06:29 -0400173 ${data}= Fill JSON Template File ${ASDC_ACTION_TEMPLATE} ${map}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500174 ${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 -0500175 Should Be Equal As Strings ${resp.status_code} 200
Jerry Floode2a48d72017-06-21 15:06:29 -0400176 [Return] ${resp.json()}
DR695Hccff30b2017-02-17 18:44:24 -0500177Add ASDC Entitlement Pool
178 [Documentation] Creates an asdc Entitlement Pool and returns its id
Jerry Floode2a48d72017-06-21 15:06:29 -0400179 [Arguments] ${license_model_id} ${version_id}=0.1
180 ${uuid}= Generate UUID
181 ${shortened_uuid}= Evaluate str("${uuid}")[:23]
DR695Hccff30b2017-02-17 18:44:24 -0500182 ${map}= Create Dictionary entitlement_pool_name=${shortened_uuid}
Jerry Floode2a48d72017-06-21 15:06:29 -0400183 ${data}= Fill JSON Template File ${ASDC_ENTITLEMENT_POOL_TEMPLATE} ${map}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500184 ${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 -0500185 Should Be Equal As Strings ${resp.status_code} 200
186 [Return] ${resp.json()['value']}
187Get ASDC Entitlement Pool
188 [Documentation] gets an asdc Entitlement Pool by its id
189 [Arguments] ${license_model_id} ${pool_id}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500190 ${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 -0500191 [Return] ${resp.json()}
192Add ASDC License Group
193 [Documentation] Creates an asdc license group and returns its id
Brian Freemanb568e5e2018-04-05 21:03:38 -0500194 [Arguments] ${license_model_id} ${version_id}=1.0
Jerry Floode2a48d72017-06-21 15:06:29 -0400195 ${uuid}= Generate UUID
196 ${shortened_uuid}= Evaluate str("${uuid}")[:23]
DR695Hccff30b2017-02-17 18:44:24 -0500197 ${map}= Create Dictionary key_group_name=${shortened_uuid}
Jerry Floode2a48d72017-06-21 15:06:29 -0400198 ${data}= Fill JSON Template File ${ASDC_KEY_GROUP_TEMPLATE} ${map}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500199 ${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 -0500200 Should Be Equal As Strings ${resp.status_code} 200
201 [Return] ${resp.json()['value']}
202Get ASDC License Group
203 [Documentation] gets an asdc license group by its id
Jerry Floode2a48d72017-06-21 15:06:29 -0400204 [Arguments] ${license_model_id} ${group_id} ${version_id}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500205 ${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 -0500206 [Return] ${resp.json()}
207Add ASDC Feature Group
208 [Documentation] Creates an asdc Feature Group and returns its id
Jerry Floode2a48d72017-06-21 15:06:29 -0400209 [Arguments] ${license_model_id} ${key_group_id} ${entitlement_pool_id} ${version_id}=0.1
210 ${uuid}= Generate UUID
211 ${shortened_uuid}= Evaluate str("${uuid}")[:23]
Jerry Flood80ff9852017-08-11 06:47:14 -0400212 ${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 -0400213 ${data}= Fill JSON Template File ${ASDC_FEATURE_GROUP_TEMPLATE} ${map}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500214 ${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 -0500215 Should Be Equal As Strings ${resp.status_code} 200
216 [Return] ${resp.json()['value']}
217Get ASDC Feature Group
218 [Documentation] gets an asdc Feature Group by its id
219 [Arguments] ${license_model_id} ${group_id}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500220 ${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 -0500221 [Return] ${resp.json()}
222Add ASDC License Agreement
223 [Documentation] Creates an asdc License Agreement and returns its id
Jerry Floode2a48d72017-06-21 15:06:29 -0400224 [Arguments] ${license_model_id} ${feature_group_id} ${version_id}=0.1
225 ${uuid}= Generate UUID
226 ${shortened_uuid}= Evaluate str("${uuid}")[:23]
DR695Hccff30b2017-02-17 18:44:24 -0500227 ${map}= Create Dictionary license_agreement_name=${shortened_uuid} feature_group_id=${feature_group_id}
Jerry Floode2a48d72017-06-21 15:06:29 -0400228 ${data}= Fill JSON Template File ${ASDC_LICENSE_AGREEMENT_TEMPLATE} ${map}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500229 ${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 -0500230 Should Be Equal As Strings ${resp.status_code} 200
231 [Return] ${resp.json()['value']}
232Get ASDC License Agreement
233 [Documentation] gets an asdc License Agreement by its id
234 [Arguments] ${license_model_id} ${agreement_id}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500235 ${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 -0500236 [Return] ${resp.json()}
237Add ASDC Software Product
238 [Documentation] Creates an asdc Software Product and returns its id
Brian Freemanb568e5e2018-04-05 21:03:38 -0500239 [Arguments] ${license_agreement_id} ${feature_group_id} ${license_model_name} ${license_model_id} ${license_model_version_id}
Jerry Floode2a48d72017-06-21 15:06:29 -0400240 ${uuid}= Generate UUID
241 ${shortened_uuid}= Evaluate str("${uuid}")[:23]
Brian Freemanb568e5e2018-04-05 21:03:38 -0500242 ${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 -0400243 ${data}= Fill JSON Template File ${ASDC_SOFTWARE_PRODUCT_TEMPLATE} ${map}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500244 ${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 -0500245 Should Be Equal As Strings ${resp.status_code} 200
Brian Freemanb568e5e2018-04-05 21:03:38 -0500246 [Return] ${resp.json()['itemId']} ${resp.json()['version']['id']}
DR695Hccff30b2017-02-17 18:44:24 -0500247Get ASDC Software Product
248 [Documentation] gets an asdc Software Product by its id
Jerry Floode2a48d72017-06-21 15:06:29 -0400249 [Arguments] ${software_product_id} ${version_id}=0.1
Brian Freeman44b8bb32018-05-03 21:08:42 -0500250 ${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 -0500251 [Return] ${resp.json()}
252Add ASDC Catalog Resource
253 [Documentation] Creates an asdc Catalog Resource and returns its id
254 [Arguments] ${license_agreement_id} ${software_product_name} ${license_model_name} ${software_product_id}
255 ${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 -0400256 ${data}= Fill JSON Template File ${ASDC_CATALOG_RESOURCE_TEMPLATE} ${map}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500257 ${resp}= Run ASDC Post Request ${ASDC_CATALOG_RESOURCES_PATH} ${data} ${ASDC_DESIGNER_USER_ID}
DR695Hccff30b2017-02-17 18:44:24 -0500258 Should Be Equal As Strings ${resp.status_code} 201
259 [Return] ${resp.json()['uniqueId']}
260Mark ASDC Catalog Resource Inactive
261 [Documentation] deletes an asdc Catalog Resource
262 [Arguments] ${catalog_resource_id}
263 ${resp}= Run ASDC Delete Request ${ASDC_CATALOG_RESOURCES_PATH}/${catalog_resource_id} ${ASDC_DESIGNER_USER_ID}
264 Should Be Equal As Strings ${resp.status_code} 204
265 [Return] ${resp}
266Delete Inactive ASDC Catalog Resources
267 [Documentation] delete all asdc Catalog Resources that are inactive
268 ${resp}= Run ASDC Delete Request ${ASDC_CATALOG_INACTIVE_RESOURCES_PATH} ${ASDC_DESIGNER_USER_ID}
269 Should Be Equal As Strings ${resp.status_code} 200
270 [Return] ${resp.json()}
271Get ASDC Catalog Resource
272 [Documentation] gets an asdc Catalog Resource by its id
273 [Arguments] ${catalog_resource_id}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500274 ${resp}= Run ASDC Get Request ${ASDC_CATALOG_RESOURCES_PATH}/${catalog_resource_id} ${ASDC_DESIGNER_USER_ID}
DR695Hccff30b2017-02-17 18:44:24 -0500275 [Return] ${resp.json()}
276Checkin ASDC Catalog Resource
277 [Documentation] checksin an asdc Catalog Resource by its id
278 [Arguments] ${catalog_resource_id}
279 ${map}= Create Dictionary user_remarks=Robot remarks
Jerry Floode2a48d72017-06-21 15:06:29 -0400280 ${data}= Fill JSON Template File ${ASDC_USER_REMARKS_TEMPLATE} ${map}
DR695Hccff30b2017-02-17 18:44:24 -0500281 ${resp}= Run ASDC Post Request ${ASDC_CATALOG_RESOURCES_PATH}/${catalog_resource_id}${ASDC_CATALOG_LIFECYCLE_PATH}/checkin ${data} ${ASDC_DESIGNER_USER_ID}
282 Should Be Equal As Strings ${resp.status_code} 200
283 [Return] ${resp.json()}
284Request Certify ASDC Catalog Resource
285 [Documentation] requests certify on an asdc Catalog Resource by its id
286 [Arguments] ${catalog_resource_id}
287 ${map}= Create Dictionary user_remarks=Robot remarks
Jerry Floode2a48d72017-06-21 15:06:29 -0400288 ${data}= Fill JSON Template File ${ASDC_USER_REMARKS_TEMPLATE} ${map}
DR695Hccff30b2017-02-17 18:44:24 -0500289 ${resp}= Run ASDC Post Request ${ASDC_CATALOG_RESOURCES_PATH}/${catalog_resource_id}${ASDC_CATALOG_LIFECYCLE_PATH}/certificationRequest ${data} ${ASDC_DESIGNER_USER_ID}
290 Should Be Equal As Strings ${resp.status_code} 200
291 [Return] ${resp.json()}
292Start Certify ASDC Catalog Resource
293 [Documentation] start certify an asdc Catalog Resource by its id
294 [Arguments] ${catalog_resource_id}
295 ${resp}= Run ASDC Post Request ${ASDC_CATALOG_RESOURCES_PATH}/${catalog_resource_id}${ASDC_CATALOG_LIFECYCLE_PATH}/startCertification ${None} ${ASDC_TESTER_USER_ID}
296 Should Be Equal As Strings ${resp.status_code} 200
297 [Return] ${resp.json()}
298Certify ASDC Catalog Resource
299 [Documentation] start certify an asdc Catalog Resource by its id and returns the new id
Brian Freemandb1e7412018-08-01 12:46:01 -0500300 [Arguments] ${catalog_resource_id} ${user_id}=${ASDC_TESTER_USER_ID}
DR695Hccff30b2017-02-17 18:44:24 -0500301 ${map}= Create Dictionary user_remarks=Robot remarks
Jerry Floode2a48d72017-06-21 15:06:29 -0400302 ${data}= Fill JSON Template File ${ASDC_USER_REMARKS_TEMPLATE} ${map}
Brian Freemandb1e7412018-08-01 12:46:01 -0500303 ${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 -0500304 Should Be Equal As Strings ${resp.status_code} 200
305 [Return] ${resp.json()['uniqueId']}
Jerry Flood6bd1afa2017-10-09 09:59:23 -0400306
DR695Hccff30b2017-02-17 18:44:24 -0500307Upload ASDC Heat Package
Brian Freemanf508ab22018-03-15 21:19:41 -0500308 [Documentation] Creates an asdc Software Product and returns its id
309 [Arguments] ${software_product_id} ${file_path} ${version_id}=0.1
Jerry Flood6bd1afa2017-10-09 09:59:23 -0400310 ${files}= Create Dictionary
311 Create Multi Part ${files} upload ${file_path} contentType=application/zip
Brian Freeman44b8bb32018-05-03 21:08:42 -0500312 ${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 -0500313 Should Be Equal As Strings ${resp.status_code} 200
Jerry Flood6bd1afa2017-10-09 09:59:23 -0400314
DR695Hccff30b2017-02-17 18:44:24 -0500315Add ASDC Catalog Service
316 [Documentation] Creates an asdc Catalog Service and returns its id
jf986075010a42017-02-22 16:52:54 -0500317 [Arguments] ${catalog_service_name}
Jerry Floode2a48d72017-06-21 15:06:29 -0400318 ${uuid}= Generate UUID
jf986075010a42017-02-22 16:52:54 -0500319 ${shortened_uuid}= Evaluate str("${uuid}")[:23]
Jerry Floode2a48d72017-06-21 15:06:29 -0400320 ${catalog_service_name}= Set Variable If '${catalog_service_name}' =='' ${shortened_uuid} ${catalog_service_name}
jf986075010a42017-02-22 16:52:54 -0500321 ${map}= Create Dictionary service_name=${catalog_service_name}
Jerry Floode2a48d72017-06-21 15:06:29 -0400322 ${data}= Fill JSON Template File ${ASDC_CATALOG_SERVICE_TEMPLATE} ${map}
DR695Hccff30b2017-02-17 18:44:24 -0500323 ${resp}= Run ASDC Post Request ${ASDC_CATALOG_SERVICES_PATH} ${data} ${ASDC_DESIGNER_USER_ID}
324 Should Be Equal As Strings ${resp.status_code} 201
325 [Return] ${resp.json()['uniqueId']}
326Mark ASDC Catalog Service Inactive
327 [Documentation] Deletes an asdc Catalog Service
328 [Arguments] ${catalog_service_id}
329 ${resp}= Run ASDC Delete Request ${ASDC_CATALOG_SERVICES_PATH}/${catalog_service_id} ${ASDC_DESIGNER_USER_ID}
330 Should Be Equal As Strings ${resp.status_code} 204
331 [Return] ${resp}
332Delete Inactive ASDC Catalog Services
333 [Documentation] delete all asdc Catalog Serivces that are inactive
334 ${resp}= Run ASDC Delete Request ${ASDC_CATALOG_INACTIVE_SERVICES_PATH} ${ASDC_DESIGNER_USER_ID}
335 Should Be Equal As Strings ${resp.status_code} 200
336 [Return] ${resp.json()}
337Get ASDC Catalog Service
338 [Documentation] gets an asdc Catalog Service by its id
339 [Arguments] ${catalog_service_id}
340 ${resp}= Run ASDC Get Request ${ASDC_CATALOG_SERVICES_PATH}/${catalog_service_id} ${ASDC_DESIGNER_USER_ID}
341 [Return] ${resp.json()}
342Checkin ASDC Catalog Service
343 [Documentation] checksin an asdc Catalog Service by its id
344 [Arguments] ${catalog_service_id}
345 ${map}= Create Dictionary user_remarks=Robot remarks
Jerry Floode2a48d72017-06-21 15:06:29 -0400346 ${data}= Fill JSON Template File ${ASDC_USER_REMARKS_TEMPLATE} ${map}
DR695Hccff30b2017-02-17 18:44:24 -0500347 ${resp}= Run ASDC Post Request ${ASDC_CATALOG_SERVICES_PATH}/${catalog_service_id}${ASDC_CATALOG_LIFECYCLE_PATH}/checkin ${data} ${ASDC_DESIGNER_USER_ID}
348 Should Be Equal As Strings ${resp.status_code} 200
349 [Return] ${resp.json()}
350Request Certify ASDC Catalog Service
351 [Documentation] requests certify on an asdc Catalog Service by its id
352 [Arguments] ${catalog_service_id}
353 ${map}= Create Dictionary user_remarks=Robot remarks
Jerry Floode2a48d72017-06-21 15:06:29 -0400354 ${data}= Fill JSON Template File ${ASDC_USER_REMARKS_TEMPLATE} ${map}
DR695Hccff30b2017-02-17 18:44:24 -0500355 ${resp}= Run ASDC Post Request ${ASDC_CATALOG_SERVICES_PATH}/${catalog_service_id}${ASDC_CATALOG_LIFECYCLE_PATH}/certificationRequest ${data} ${ASDC_DESIGNER_USER_ID}
356 Should Be Equal As Strings ${resp.status_code} 200
357 [Return] ${resp.json()}
358Start Certify ASDC Catalog Service
359 [Documentation] start certify an asdc Catalog Service by its id
360 [Arguments] ${catalog_service_id}
361 ${resp}= Run ASDC Post Request ${ASDC_CATALOG_SERVICES_PATH}/${catalog_service_id}${ASDC_CATALOG_LIFECYCLE_PATH}/startCertification ${None} ${ASDC_TESTER_USER_ID}
362 Should Be Equal As Strings ${resp.status_code} 200
363 [Return] ${resp.json()}
364Certify ASDC Catalog Service
365 [Documentation] start certify an asdc Catalog Service by its id and returns the new id
366 [Arguments] ${catalog_service_id}
367 ${map}= Create Dictionary user_remarks=Robot remarks
Jerry Floode2a48d72017-06-21 15:06:29 -0400368 ${data}= Fill JSON Template File ${ASDC_USER_REMARKS_TEMPLATE} ${map}
DR695Hccff30b2017-02-17 18:44:24 -0500369 ${resp}= Run ASDC Post Request ${ASDC_CATALOG_SERVICES_PATH}/${catalog_service_id}${ASDC_CATALOG_LIFECYCLE_PATH}/certify ${data} ${ASDC_TESTER_USER_ID}
370 Should Be Equal As Strings ${resp.status_code} 200
371 [Return] ${resp.json()['uniqueId']}
372Approve ASDC Catalog Service
373 [Documentation] approve an asdc Catalog Service by its id
374 [Arguments] ${catalog_service_id}
375 ${map}= Create Dictionary user_remarks=Robot remarks
Jerry Floode2a48d72017-06-21 15:06:29 -0400376 ${data}= Fill JSON Template File ${ASDC_USER_REMARKS_TEMPLATE} ${map}
DR695Hccff30b2017-02-17 18:44:24 -0500377 ${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}
378 Should Be Equal As Strings ${resp.status_code} 200
379 [Return] ${resp.json()}
380Distribute ASDC Catalog Service
381 [Documentation] distribute an asdc Catalog Service by its id
382 [Arguments] ${catalog_service_id}
383 ${resp}= Run ASDC Post Request ${ASDC_CATALOG_SERVICES_PATH}/${catalog_service_id}${ASDC_CATALOG_SERVICE_DISTRIBUTION_ACTIVATE_PATH} ${None} ${ASDC_OPS_USER_ID}
384 Should Be Equal As Strings ${resp.status_code} 200
385 [Return] ${resp.json()}
386Add ASDC Resource Instance
387 [Documentation] Creates an asdc Resource Instance and returns its id
388 [Arguments] ${catalog_service_id} ${catalog_resource_id} ${catalog_resource_name}
389 ${milli_timestamp}= Generate MilliTimestamp UUID
390 ${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 -0400391 ${data}= Fill JSON Template File ${ASDC_RESOURCE_INSTANCE_TEMPLATE} ${map}
DR695Hccff30b2017-02-17 18:44:24 -0500392 ${resp}= Run ASDC Post Request ${ASDC_CATALOG_SERVICES_PATH}/${catalog_service_id}${ASDC_CATALOG_SERVICE_RESOURCE_INSTANCE_PATH} ${data} ${ASDC_DESIGNER_USER_ID}
393 Should Be Equal As Strings ${resp.status_code} 201
394 [Return] ${resp.json()['uniqueId']}
395Get Catalog Service Distribution
396 [Documentation] gets an asdc catalog Service distrbution
397 [Arguments] ${catalog_service_uuid}
398 ${resp}= Run ASDC Get Request ${ASDC_CATALOG_SERVICES_PATH}/${catalog_service_uuid}${ASDC_CATALOG_SERVICE_DISTRIBUTION_PATH} ${ASDC_OPS_USER_ID}
399 Should Be Equal As Strings ${resp.status_code} 200
400 [Return] ${resp.json()}
401Check Catalog Service Distributed
402 [Documentation] gets an asdc catalog Service distrbution
Brian Freemanadaa2372018-10-24 12:25:22 -0500403 [Arguments] ${catalog_service_uuid} ${dist_status}
DR695Hccff30b2017-02-17 18:44:24 -0500404 ${dist_resp}= Get Catalog Service Distribution ${catalog_service_uuid}
405 Should Be Equal As Strings ${dist_resp['distributionStatusOfServiceList'][0]['deployementStatus']} Distributed
406 ${det_resp}= Get Catalog Service Distribution Details ${dist_resp['distributionStatusOfServiceList'][0]['distributionID']}
407 @{ITEMS}= Copy List ${det_resp['distributionStatusList']}
Brian Freemanf508ab22018-03-15 21:19:41 -0500408 Should Not Be Empty ${ITEMS}
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 Freeman41ab5e52018-08-08 14:24:23 -0500413 \ ${SO_COMPLETE} Set Variable If (('${ELEMENT['status']}' == 'DISTRIBUTION_COMPLETE_OK')) or ('${SO_COMPLETE}'=='TRUE') TRUE
Brian Freemaneca71072018-08-16 14:50:16 -0500414 \ Exit For Loop If ('${SO_COMPLETE}'=='TRUE')
415 \ Exit For Loop If ('${ELEMENT['status']}' == 'DISTRIBUTION_COMPLETE_ERROR')
Brian Freemanadaa2372018-10-24 12:25:22 -0500416 \ ${dist_status}= Set Variable If (('${ELEMENT['status']}' == 'COMPONENT_DONE_ERROR') and ('${ELEMENT['omfComponentID']}' == 'aai-ml')) EXIT
417 \ Exit For Loop If (('${ELEMENT['status']}' == 'COMPONENT_DONE_ERROR') and ('${ELEMENT['omfComponentID']}' == 'aai-ml'))
Brian Freemana62644f2018-05-13 12:47:38 -0500418 Should Be True ( '${SO_COMPLETE}'=='TRUE') SO Test
DR695Hccff30b2017-02-17 18:44:24 -0500419Get Catalog Service Distribution Details
420 [Documentation] gets an asdc catalog Service distrbution details
421 [Arguments] ${catalog_service_distribution_id}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500422 ${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 -0500423 Should Be Equal As Strings ${resp.status_code} 200
424 [Return] ${resp.json()}
425Run ASDC Health Check
426 [Documentation] Runs a ASDC health check
DR695Hbf5a3a32017-06-30 13:09:57 -0400427 ${session}= Create Session asdc ${ASDC_FE_ENDPOINT}
DR695Hccff30b2017-02-17 18:44:24 -0500428 ${uuid}= Generate UUID
429 ${headers}= Create Dictionary Accept=application/json Content-Type=application/json X-TransactionId=${GLOBAL_APPLICATION_ID}-${uuid} X-FromAppId=${GLOBAL_APPLICATION_ID}
430 ${resp}= Get Request asdc ${ASDC_HEALTH_CHECK_PATH} headers=${headers}
Brian Freemanadaa2372018-10-24 12:25:22 -0500431 # only test for HTTP 200 to determine SDC Health. SDC_DE_HEALTH is informational
Brian Freeman00f125e2018-09-05 13:03:48 -0500432 Should Be Equal As Strings ${resp.status_code} 200 SDC DOWN
Brian Freeman5cf5fa62018-04-23 20:28:16 -0500433 ${SDC_DE_HEALTH}= Catenate DOWN
DR695Hccff30b2017-02-17 18:44:24 -0500434 @{ITEMS}= Copy List ${resp.json()['componentsInfo']}
435 :FOR ${ELEMENT} IN @{ITEMS}
436 \ Log ${ELEMENT['healthCheckStatus']}
Brian Freemane546f7e2018-04-19 12:17:56 -0500437 \ ${SDC_DE_HEALTH} Set Variable If (('DE' in '${ELEMENT['healthCheckComponent']}') and ('${ELEMENT['healthCheckStatus']}' == 'UP')) or ('${SDC_DE_HEALTH}'=='UP') UP
Brian Freemanadaa2372018-10-24 12:25:22 -0500438 Log Console SDC DMaaP Interface Health: ${SDC_DE_HEALTH}
DR695Hccff30b2017-02-17 18:44:24 -0500439Run ASDC Get Request
440 [Documentation] Runs an ASDC get request
Brian Freeman44b8bb32018-05-03 21:08:42 -0500441 [Arguments] ${data_path} ${user}=${ASDC_DESIGNER_USER_ID} ${MY_ASDC_BE_ENDPOINT}=${ASDC_BE_ENDPOINT}
DR695Hccff30b2017-02-17 18:44:24 -0500442 ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500443 Log Creating session ${MY_ASDC_BE_ENDPOINT}
444 ${session}= Create Session asdc ${MY_ASDC_BE_ENDPOINT} auth=${auth}
DR695Hccff30b2017-02-17 18:44:24 -0500445 ${uuid}= Generate UUID
446 ${headers}= Create Dictionary Accept=application/json Content-Type=application/json USER_ID=${user} X-TransactionId=${GLOBAL_APPLICATION_ID}-${uuid} X-FromAppId=${GLOBAL_APPLICATION_ID}
447 ${resp}= Get Request asdc ${data_path} headers=${headers}
448 Log Received response from asdc ${resp.text}
449 [Return] ${resp}
450Run ASDC Put Request
451 [Documentation] Runs an ASDC put request
Brian Freeman44b8bb32018-05-03 21:08:42 -0500452 [Arguments] ${data_path} ${data} ${user}=${ASDC_DESIGNER_USER_ID} ${MY_ASDC_BE_ENDPOINT}=${ASDC_BE_ENDPOINT}
DR695Hccff30b2017-02-17 18:44:24 -0500453 ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500454 Log Creating session ${MY_ASDC_BE_ENDPOINT}
455 ${session}= Create Session asdc ${MY_ASDC_BE_ENDPOINT} auth=${auth}
DR695Hccff30b2017-02-17 18:44:24 -0500456 ${uuid}= Generate UUID
457 ${headers}= Create Dictionary Accept=application/json Content-Type=application/json USER_ID=${user} X-TransactionId=${GLOBAL_APPLICATION_ID}-${uuid} X-FromAppId=${GLOBAL_APPLICATION_ID}
458 ${resp}= Put Request asdc ${data_path} data=${data} headers=${headers}
459 Log Received response from asdc ${resp.text}
460 [Return] ${resp}
Jerry Flood6bd1afa2017-10-09 09:59:23 -0400461
DR695Hccff30b2017-02-17 18:44:24 -0500462Run ASDC Post Files Request
463 [Documentation] Runs an ASDC post request
Brian Freeman44b8bb32018-05-03 21:08:42 -0500464 [Arguments] ${data_path} ${files} ${user}=${ASDC_DESIGNER_USER_ID} ${MY_ASDC_BE_ENDPOINT}=${ASDC_BE_ENDPOINT}
DR695Hccff30b2017-02-17 18:44:24 -0500465 ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500466 Log Creating session ${MY_ASDC_BE_ENDPOINT}
467 ${session}= Create Session asdc ${MY_ASDC_BE_ENDPOINT} auth=${auth}
DR695Hccff30b2017-02-17 18:44:24 -0500468 ${uuid}= Generate UUID
469 ${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}
470 ${resp}= Post Request asdc ${data_path} files=${files} headers=${headers}
471 Log Received response from asdc ${resp.text}
Jerry Floode2a48d72017-06-21 15:06:29 -0400472 [Return] ${resp}
Jerry Flood6bd1afa2017-10-09 09:59:23 -0400473
DR695Hccff30b2017-02-17 18:44:24 -0500474Run ASDC Post Request
475 [Documentation] Runs an ASDC post request
Brian Freeman44b8bb32018-05-03 21:08:42 -0500476 [Arguments] ${data_path} ${data} ${user}=${ASDC_DESIGNER_USER_ID} ${MY_ASDC_BE_ENDPOINT}=${ASDC_BE_ENDPOINT}
DR695Hccff30b2017-02-17 18:44:24 -0500477 ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500478 Log Creating session ${MY_ASDC_BE_ENDPOINT}
479 ${session}= Create Session asdc ${MY_ASDC_BE_ENDPOINT} auth=${auth}
DR695Hccff30b2017-02-17 18:44:24 -0500480 ${uuid}= Generate UUID
481 ${headers}= Create Dictionary Accept=application/json Content-Type=application/json USER_ID=${user} X-TransactionId=${GLOBAL_APPLICATION_ID}-${uuid} X-FromAppId=${GLOBAL_APPLICATION_ID}
482 ${resp}= Post Request asdc ${data_path} data=${data} headers=${headers}
483 Log Received response from asdc ${resp.text}
Jerry Floode2a48d72017-06-21 15:06:29 -0400484 [Return] ${resp}
DR695Hccff30b2017-02-17 18:44:24 -0500485Run ASDC Delete Request
486 [Documentation] Runs an ASDC delete request
Brian Freeman44b8bb32018-05-03 21:08:42 -0500487 [Arguments] ${data_path} ${user}=${ASDC_DESIGNER_USER_ID} ${MY_ASDC_BE_ENDPOINT}=${ASDC_BE_ENDPOINT}
488 ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD}
489 Log Creating session ${MY_ASDC_BE_ENDPOINT}
490 ${session}= Create Session asdc ${MY_ASDC_BE_ENDPOINT} auth=${auth}
DR695Hccff30b2017-02-17 18:44:24 -0500491 ${uuid}= Generate UUID
492 ${headers}= Create Dictionary Accept=application/json Content-Type=application/json USER_ID=${user} X-TransactionId=${GLOBAL_APPLICATION_ID}-${uuid} X-FromAppId=${GLOBAL_APPLICATION_ID}
493 ${resp}= Delete Request asdc ${data_path} headers=${headers}
494 Log Received response from asdc ${resp.text}
Jerry Floode2a48d72017-06-21 15:06:29 -0400495 [Return] ${resp}
DR695Hccff30b2017-02-17 18:44:24 -0500496Open ASDC GUI
497 [Documentation] Logs in to ASDC GUI
498 [Arguments] ${PATH}
499 ## Setup Browever now being managed by the test case
500 ##Setup Browser
DR695Hbf5a3a32017-06-30 13:09:57 -0400501 Go To ${ASDC_FE_ENDPOINT}${PATH}
DR695Hccff30b2017-02-17 18:44:24 -0500502 Maximize Browser Window
Jerry Flood6bd1afa2017-10-09 09:59:23 -0400503
DR695Hccff30b2017-02-17 18:44:24 -0500504 Set Browser Implicit Wait ${GLOBAL_SELENIUM_BROWSER_IMPLICIT_WAIT}
DR695Hbf5a3a32017-06-30 13:09:57 -0400505 Log Logging in to ${ASDC_FE_ENDPOINT}${PATH}
DR695Hccff30b2017-02-17 18:44:24 -0500506 Title Should Be ASDC
Jerry Floode2a48d72017-06-21 15:06:29 -0400507 Wait Until Page Contains Element xpath=//div/a[text()='SDC'] ${GLOBAL_SELENIUM_BROWSER_WAIT_TIMEOUT}
DR695Hbf5a3a32017-06-30 13:09:57 -0400508 Log Logged in to ${ASDC_FE_ENDPOINT}${PATH}
Jerry Flood6bd1afa2017-10-09 09:59:23 -0400509
510
511Create Multi Part
512 [Arguments] ${addTo} ${partName} ${filePath} ${contentType}=${None}
513 ${fileData}= Get Binary File ${filePath}
514 ${fileDir} ${fileName}= Split Path ${filePath}
515 ${partData}= Create List ${fileName} ${fileData} ${contentType}
516 Set To Dictionary ${addTo} ${partName}=${partData}
Brian Freemanf940ee92018-05-25 21:09:05 -0500517