blob: 8a5aa3f52513da784dbf7f02b0810412565a61a0 [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 Freeman796b9eb2018-10-08 08:23:20 -050083 # SO watchdog timeout is 300 seconds
Gary Wu58d58532018-07-27 16:02:51 -070084 : FOR ${CHECK_INDEX} IN RANGE 15
85 \ ${status} ${_} = Run Keyword And Ignore Error Check Catalog Service Distributed ${catalog_service_id}
86 \ Sleep 20s
Brian Freemanf940ee92018-05-25 21:09:05 -050087 \ Return From Keyword If '${status}'=='PASS'
Brian Freeman8c002d52018-07-30 19:35:36 -050088 Should Be Equal As Strings ${status} PASS
Brian Freeman18df8912018-05-25 13:27:29 -050089
DR695Hccff30b2017-02-17 18:44:24 -050090Setup ASDC Catalog Resource
91 [Documentation] Creates all the steps a vf needs for an asdc catalog resource and returns the id
92 [Arguments] ${model_zip_path}
Brian Freemanb568e5e2018-04-05 21:03:38 -050093 ${license_model_id} ${license_model_version_id}= Add ASDC License Model
94 ${key_group_id}= Add ASDC License Group ${license_model_id} ${license_model_version_id}
95 ${pool_id}= Add ASDC Entitlement Pool ${license_model_id} ${license_model_version_id}
96 ${feature_group_id}= Add ASDC Feature Group ${license_model_id} ${key_group_id} ${pool_id} ${license_model_version_id}
97 ${license_agreement_id}= Add ASDC License Agreement ${license_model_id} ${feature_group_id} ${license_model_version_id}
98 Submit ASDC License Model ${license_model_id} ${license_model_version_id}
99 ${license_model_resp}= Get ASDC License Model ${license_model_id} ${license_model_version_id}
100 ${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}
101 Upload ASDC Heat Package ${software_product_id} ${model_zip_path} ${software_product_version_id}
102 Validate ASDC Software Product ${software_product_id} ${software_product_version_id}
103 Submit ASDC Software Product ${software_product_id} ${software_product_version_id}
104 Package ASDC Software Product ${software_product_id} ${software_product_version_id}
105 ${software_product_resp}= Get ASDC Software Product ${software_product_id} ${software_product_version_id}
106 ${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 -0500107 ${catalog_resource_id}= Certify ASDC Catalog Resource ${catalog_resource_id} ${ASDC_DESIGNER_USER_ID}
DR695Hccff30b2017-02-17 18:44:24 -0500108 [Return] ${catalog_resource_id}
DR695Hccff30b2017-02-17 18:44:24 -0500109Add ASDC License Model
110 [Documentation] Creates an asdc license model and returns its id
Jerry Floode2a48d72017-06-21 15:06:29 -0400111 ${uuid}= Generate UUID
112 ${shortened_uuid}= Evaluate str("${uuid}")[:23]
DR695Hccff30b2017-02-17 18:44:24 -0500113 ${map}= Create Dictionary vendor_name=${shortened_uuid}
114 ${data}= Fill JSON Template File ${ASDC_LICENSE_MODEL_TEMPLATE} ${map}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500115 ${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 -0500116 Should Be Equal As Strings ${resp.status_code} 200
Brian Freemanb568e5e2018-04-05 21:03:38 -0500117 [Return] ${resp.json()['itemId']} ${resp.json()['version']['id']}
DR695Hccff30b2017-02-17 18:44:24 -0500118Get ASDC License Model
119 [Documentation] gets an asdc license model by its id
Jerry Floode2a48d72017-06-21 15:06:29 -0400120 [Arguments] ${id} ${version_id}=0.1
Brian Freeman44b8bb32018-05-03 21:08:42 -0500121 ${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 -0400122 [Return] ${resp.json()}
123Get ASDC License Models
124 [Documentation] gets an asdc license model by its id
Brian Freeman44b8bb32018-05-03 21:08:42 -0500125 ${resp}= Run ASDC Get Request ${ASDC_VENDOR_LICENSE_MODEL_PATH} ${ASDC_DESIGNER_USER_ID} ${ASDC_BE_ONBOARD_ENDPOINT}
126
DR695Hccff30b2017-02-17 18:44:24 -0500127 [Return] ${resp.json()}
128Checkin ASDC License Model
129 [Documentation] checksin an asdc license model by its id
Jerry Floode2a48d72017-06-21 15:06:29 -0400130 [Arguments] ${id} ${version_id}=0.1
DR695Hccff30b2017-02-17 18:44:24 -0500131 ${map}= Create Dictionary action=Checkin
132 ${data}= Fill JSON Template File ${ASDC_ACTION_TEMPLATE} ${map}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500133 ${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 -0500134 Should Be Equal As Strings ${resp.status_code} 200
135 [Return] ${resp.json()}
136Submit ASDC License Model
137 [Documentation] submits an asdc license model by its id
Jerry Floode2a48d72017-06-21 15:06:29 -0400138 [Arguments] ${id} ${version_id}=0.1
DR695Hccff30b2017-02-17 18:44:24 -0500139 ${map}= Create Dictionary action=Submit
140 ${data}= Fill JSON Template File ${ASDC_ACTION_TEMPLATE} ${map}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500141 ${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 -0500142 Should Be Equal As Strings ${resp.status_code} 200
143 [Return] ${resp.json()}
144Checkin ASDC Software Product
145 [Documentation] checksin an asdc Software Product by its id
Jerry Floode2a48d72017-06-21 15:06:29 -0400146 [Arguments] ${id} ${version_id}=0.1
DR695Hccff30b2017-02-17 18:44:24 -0500147 ${map}= Create Dictionary action=Checkin
Jerry Floode2a48d72017-06-21 15:06:29 -0400148 ${data}= Fill JSON Template File ${ASDC_ACTION_TEMPLATE} ${map}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500149 ${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 -0400150 Should Be Equal As Strings ${resp.status_code} 200
151 [Return] ${resp.json()}
152Validate ASDC Software Product
153 [Documentation] checksin an asdc Software Product by its id
154 [Arguments] ${id} ${version_id}=0.1
155 ${data}= Catenate
Brian Freeman44b8bb32018-05-03 21:08:42 -0500156 ${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 -0500157 Should Be Equal As Strings ${resp.status_code} 200
158 [Return] ${resp.json()}
159Submit ASDC Software Product
160 [Documentation] submits an asdc Software Product by its id
Jerry Floode2a48d72017-06-21 15:06:29 -0400161 [Arguments] ${id} ${version_id}=0.1
DR695Hccff30b2017-02-17 18:44:24 -0500162 ${map}= Create Dictionary action=Submit
Jerry Floode2a48d72017-06-21 15:06:29 -0400163 ${data}= Fill JSON Template File ${ASDC_ACTION_TEMPLATE} ${map}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500164 ${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 -0500165 Should Be Equal As Strings ${resp.status_code} 200
166 [Return] ${resp.json()}
167Package ASDC Software Product
168 [Documentation] creates_package on an asdc Software Product by its id
Jerry Floode2a48d72017-06-21 15:06:29 -0400169 [Arguments] ${id} ${version_id}=0.1
DR695Hccff30b2017-02-17 18:44:24 -0500170 ${map}= Create Dictionary action=Create_Package
Jerry Floode2a48d72017-06-21 15:06:29 -0400171 ${data}= Fill JSON Template File ${ASDC_ACTION_TEMPLATE} ${map}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500172 ${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 -0500173 Should Be Equal As Strings ${resp.status_code} 200
Jerry Floode2a48d72017-06-21 15:06:29 -0400174 [Return] ${resp.json()}
DR695Hccff30b2017-02-17 18:44:24 -0500175Add ASDC Entitlement Pool
176 [Documentation] Creates an asdc Entitlement Pool and returns its id
Jerry Floode2a48d72017-06-21 15:06:29 -0400177 [Arguments] ${license_model_id} ${version_id}=0.1
178 ${uuid}= Generate UUID
179 ${shortened_uuid}= Evaluate str("${uuid}")[:23]
DR695Hccff30b2017-02-17 18:44:24 -0500180 ${map}= Create Dictionary entitlement_pool_name=${shortened_uuid}
Jerry Floode2a48d72017-06-21 15:06:29 -0400181 ${data}= Fill JSON Template File ${ASDC_ENTITLEMENT_POOL_TEMPLATE} ${map}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500182 ${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 -0500183 Should Be Equal As Strings ${resp.status_code} 200
184 [Return] ${resp.json()['value']}
185Get ASDC Entitlement Pool
186 [Documentation] gets an asdc Entitlement Pool by its id
187 [Arguments] ${license_model_id} ${pool_id}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500188 ${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 -0500189 [Return] ${resp.json()}
190Add ASDC License Group
191 [Documentation] Creates an asdc license group and returns its id
Brian Freemanb568e5e2018-04-05 21:03:38 -0500192 [Arguments] ${license_model_id} ${version_id}=1.0
Jerry Floode2a48d72017-06-21 15:06:29 -0400193 ${uuid}= Generate UUID
194 ${shortened_uuid}= Evaluate str("${uuid}")[:23]
DR695Hccff30b2017-02-17 18:44:24 -0500195 ${map}= Create Dictionary key_group_name=${shortened_uuid}
Jerry Floode2a48d72017-06-21 15:06:29 -0400196 ${data}= Fill JSON Template File ${ASDC_KEY_GROUP_TEMPLATE} ${map}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500197 ${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 -0500198 Should Be Equal As Strings ${resp.status_code} 200
199 [Return] ${resp.json()['value']}
200Get ASDC License Group
201 [Documentation] gets an asdc license group by its id
Jerry Floode2a48d72017-06-21 15:06:29 -0400202 [Arguments] ${license_model_id} ${group_id} ${version_id}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500203 ${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 -0500204 [Return] ${resp.json()}
205Add ASDC Feature Group
206 [Documentation] Creates an asdc Feature Group and returns its id
Jerry Floode2a48d72017-06-21 15:06:29 -0400207 [Arguments] ${license_model_id} ${key_group_id} ${entitlement_pool_id} ${version_id}=0.1
208 ${uuid}= Generate UUID
209 ${shortened_uuid}= Evaluate str("${uuid}")[:23]
Jerry Flood80ff9852017-08-11 06:47:14 -0400210 ${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 -0400211 ${data}= Fill JSON Template File ${ASDC_FEATURE_GROUP_TEMPLATE} ${map}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500212 ${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 -0500213 Should Be Equal As Strings ${resp.status_code} 200
214 [Return] ${resp.json()['value']}
215Get ASDC Feature Group
216 [Documentation] gets an asdc Feature Group by its id
217 [Arguments] ${license_model_id} ${group_id}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500218 ${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 -0500219 [Return] ${resp.json()}
220Add ASDC License Agreement
221 [Documentation] Creates an asdc License Agreement and returns its id
Jerry Floode2a48d72017-06-21 15:06:29 -0400222 [Arguments] ${license_model_id} ${feature_group_id} ${version_id}=0.1
223 ${uuid}= Generate UUID
224 ${shortened_uuid}= Evaluate str("${uuid}")[:23]
DR695Hccff30b2017-02-17 18:44:24 -0500225 ${map}= Create Dictionary license_agreement_name=${shortened_uuid} feature_group_id=${feature_group_id}
Jerry Floode2a48d72017-06-21 15:06:29 -0400226 ${data}= Fill JSON Template File ${ASDC_LICENSE_AGREEMENT_TEMPLATE} ${map}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500227 ${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 -0500228 Should Be Equal As Strings ${resp.status_code} 200
229 [Return] ${resp.json()['value']}
230Get ASDC License Agreement
231 [Documentation] gets an asdc License Agreement by its id
232 [Arguments] ${license_model_id} ${agreement_id}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500233 ${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 -0500234 [Return] ${resp.json()}
235Add ASDC Software Product
236 [Documentation] Creates an asdc Software Product and returns its id
Brian Freemanb568e5e2018-04-05 21:03:38 -0500237 [Arguments] ${license_agreement_id} ${feature_group_id} ${license_model_name} ${license_model_id} ${license_model_version_id}
Jerry Floode2a48d72017-06-21 15:06:29 -0400238 ${uuid}= Generate UUID
239 ${shortened_uuid}= Evaluate str("${uuid}")[:23]
Brian Freemanb568e5e2018-04-05 21:03:38 -0500240 ${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 -0400241 ${data}= Fill JSON Template File ${ASDC_SOFTWARE_PRODUCT_TEMPLATE} ${map}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500242 ${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 -0500243 Should Be Equal As Strings ${resp.status_code} 200
Brian Freemanb568e5e2018-04-05 21:03:38 -0500244 [Return] ${resp.json()['itemId']} ${resp.json()['version']['id']}
DR695Hccff30b2017-02-17 18:44:24 -0500245Get ASDC Software Product
246 [Documentation] gets an asdc Software Product by its id
Jerry Floode2a48d72017-06-21 15:06:29 -0400247 [Arguments] ${software_product_id} ${version_id}=0.1
Brian Freeman44b8bb32018-05-03 21:08:42 -0500248 ${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 -0500249 [Return] ${resp.json()}
250Add ASDC Catalog Resource
251 [Documentation] Creates an asdc Catalog Resource and returns its id
252 [Arguments] ${license_agreement_id} ${software_product_name} ${license_model_name} ${software_product_id}
253 ${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 -0400254 ${data}= Fill JSON Template File ${ASDC_CATALOG_RESOURCE_TEMPLATE} ${map}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500255 ${resp}= Run ASDC Post Request ${ASDC_CATALOG_RESOURCES_PATH} ${data} ${ASDC_DESIGNER_USER_ID}
DR695Hccff30b2017-02-17 18:44:24 -0500256 Should Be Equal As Strings ${resp.status_code} 201
257 [Return] ${resp.json()['uniqueId']}
258Mark ASDC Catalog Resource Inactive
259 [Documentation] deletes an asdc Catalog Resource
260 [Arguments] ${catalog_resource_id}
261 ${resp}= Run ASDC Delete Request ${ASDC_CATALOG_RESOURCES_PATH}/${catalog_resource_id} ${ASDC_DESIGNER_USER_ID}
262 Should Be Equal As Strings ${resp.status_code} 204
263 [Return] ${resp}
264Delete Inactive ASDC Catalog Resources
265 [Documentation] delete all asdc Catalog Resources that are inactive
266 ${resp}= Run ASDC Delete Request ${ASDC_CATALOG_INACTIVE_RESOURCES_PATH} ${ASDC_DESIGNER_USER_ID}
267 Should Be Equal As Strings ${resp.status_code} 200
268 [Return] ${resp.json()}
269Get ASDC Catalog Resource
270 [Documentation] gets an asdc Catalog Resource by its id
271 [Arguments] ${catalog_resource_id}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500272 ${resp}= Run ASDC Get Request ${ASDC_CATALOG_RESOURCES_PATH}/${catalog_resource_id} ${ASDC_DESIGNER_USER_ID}
DR695Hccff30b2017-02-17 18:44:24 -0500273 [Return] ${resp.json()}
274Checkin ASDC Catalog Resource
275 [Documentation] checksin an asdc Catalog Resource by its id
276 [Arguments] ${catalog_resource_id}
277 ${map}= Create Dictionary user_remarks=Robot remarks
Jerry Floode2a48d72017-06-21 15:06:29 -0400278 ${data}= Fill JSON Template File ${ASDC_USER_REMARKS_TEMPLATE} ${map}
DR695Hccff30b2017-02-17 18:44:24 -0500279 ${resp}= Run ASDC Post Request ${ASDC_CATALOG_RESOURCES_PATH}/${catalog_resource_id}${ASDC_CATALOG_LIFECYCLE_PATH}/checkin ${data} ${ASDC_DESIGNER_USER_ID}
280 Should Be Equal As Strings ${resp.status_code} 200
281 [Return] ${resp.json()}
282Request Certify ASDC Catalog Resource
283 [Documentation] requests certify on an asdc Catalog Resource by its id
284 [Arguments] ${catalog_resource_id}
285 ${map}= Create Dictionary user_remarks=Robot remarks
Jerry Floode2a48d72017-06-21 15:06:29 -0400286 ${data}= Fill JSON Template File ${ASDC_USER_REMARKS_TEMPLATE} ${map}
DR695Hccff30b2017-02-17 18:44:24 -0500287 ${resp}= Run ASDC Post Request ${ASDC_CATALOG_RESOURCES_PATH}/${catalog_resource_id}${ASDC_CATALOG_LIFECYCLE_PATH}/certificationRequest ${data} ${ASDC_DESIGNER_USER_ID}
288 Should Be Equal As Strings ${resp.status_code} 200
289 [Return] ${resp.json()}
290Start Certify ASDC Catalog Resource
291 [Documentation] start certify an asdc Catalog Resource by its id
292 [Arguments] ${catalog_resource_id}
293 ${resp}= Run ASDC Post Request ${ASDC_CATALOG_RESOURCES_PATH}/${catalog_resource_id}${ASDC_CATALOG_LIFECYCLE_PATH}/startCertification ${None} ${ASDC_TESTER_USER_ID}
294 Should Be Equal As Strings ${resp.status_code} 200
295 [Return] ${resp.json()}
296Certify ASDC Catalog Resource
297 [Documentation] start certify an asdc Catalog Resource by its id and returns the new id
Brian Freemandb1e7412018-08-01 12:46:01 -0500298 [Arguments] ${catalog_resource_id} ${user_id}=${ASDC_TESTER_USER_ID}
DR695Hccff30b2017-02-17 18:44:24 -0500299 ${map}= Create Dictionary user_remarks=Robot remarks
Jerry Floode2a48d72017-06-21 15:06:29 -0400300 ${data}= Fill JSON Template File ${ASDC_USER_REMARKS_TEMPLATE} ${map}
Brian Freemandb1e7412018-08-01 12:46:01 -0500301 ${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 -0500302 Should Be Equal As Strings ${resp.status_code} 200
303 [Return] ${resp.json()['uniqueId']}
Jerry Flood6bd1afa2017-10-09 09:59:23 -0400304
DR695Hccff30b2017-02-17 18:44:24 -0500305Upload ASDC Heat Package
Brian Freemanf508ab22018-03-15 21:19:41 -0500306 [Documentation] Creates an asdc Software Product and returns its id
307 [Arguments] ${software_product_id} ${file_path} ${version_id}=0.1
Jerry Flood6bd1afa2017-10-09 09:59:23 -0400308 ${files}= Create Dictionary
309 Create Multi Part ${files} upload ${file_path} contentType=application/zip
Brian Freeman44b8bb32018-05-03 21:08:42 -0500310 ${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 -0500311 Should Be Equal As Strings ${resp.status_code} 200
Jerry Flood6bd1afa2017-10-09 09:59:23 -0400312
DR695Hccff30b2017-02-17 18:44:24 -0500313Add ASDC Catalog Service
314 [Documentation] Creates an asdc Catalog Service and returns its id
jf986075010a42017-02-22 16:52:54 -0500315 [Arguments] ${catalog_service_name}
Jerry Floode2a48d72017-06-21 15:06:29 -0400316 ${uuid}= Generate UUID
jf986075010a42017-02-22 16:52:54 -0500317 ${shortened_uuid}= Evaluate str("${uuid}")[:23]
Jerry Floode2a48d72017-06-21 15:06:29 -0400318 ${catalog_service_name}= Set Variable If '${catalog_service_name}' =='' ${shortened_uuid} ${catalog_service_name}
jf986075010a42017-02-22 16:52:54 -0500319 ${map}= Create Dictionary service_name=${catalog_service_name}
Jerry Floode2a48d72017-06-21 15:06:29 -0400320 ${data}= Fill JSON Template File ${ASDC_CATALOG_SERVICE_TEMPLATE} ${map}
DR695Hccff30b2017-02-17 18:44:24 -0500321 ${resp}= Run ASDC Post Request ${ASDC_CATALOG_SERVICES_PATH} ${data} ${ASDC_DESIGNER_USER_ID}
322 Should Be Equal As Strings ${resp.status_code} 201
323 [Return] ${resp.json()['uniqueId']}
324Mark ASDC Catalog Service Inactive
325 [Documentation] Deletes an asdc Catalog Service
326 [Arguments] ${catalog_service_id}
327 ${resp}= Run ASDC Delete Request ${ASDC_CATALOG_SERVICES_PATH}/${catalog_service_id} ${ASDC_DESIGNER_USER_ID}
328 Should Be Equal As Strings ${resp.status_code} 204
329 [Return] ${resp}
330Delete Inactive ASDC Catalog Services
331 [Documentation] delete all asdc Catalog Serivces that are inactive
332 ${resp}= Run ASDC Delete Request ${ASDC_CATALOG_INACTIVE_SERVICES_PATH} ${ASDC_DESIGNER_USER_ID}
333 Should Be Equal As Strings ${resp.status_code} 200
334 [Return] ${resp.json()}
335Get ASDC Catalog Service
336 [Documentation] gets an asdc Catalog Service by its id
337 [Arguments] ${catalog_service_id}
338 ${resp}= Run ASDC Get Request ${ASDC_CATALOG_SERVICES_PATH}/${catalog_service_id} ${ASDC_DESIGNER_USER_ID}
339 [Return] ${resp.json()}
340Checkin ASDC Catalog Service
341 [Documentation] checksin an asdc Catalog Service by its id
342 [Arguments] ${catalog_service_id}
343 ${map}= Create Dictionary user_remarks=Robot remarks
Jerry Floode2a48d72017-06-21 15:06:29 -0400344 ${data}= Fill JSON Template File ${ASDC_USER_REMARKS_TEMPLATE} ${map}
DR695Hccff30b2017-02-17 18:44:24 -0500345 ${resp}= Run ASDC Post Request ${ASDC_CATALOG_SERVICES_PATH}/${catalog_service_id}${ASDC_CATALOG_LIFECYCLE_PATH}/checkin ${data} ${ASDC_DESIGNER_USER_ID}
346 Should Be Equal As Strings ${resp.status_code} 200
347 [Return] ${resp.json()}
348Request Certify ASDC Catalog Service
349 [Documentation] requests certify on an asdc Catalog Service by its id
350 [Arguments] ${catalog_service_id}
351 ${map}= Create Dictionary user_remarks=Robot remarks
Jerry Floode2a48d72017-06-21 15:06:29 -0400352 ${data}= Fill JSON Template File ${ASDC_USER_REMARKS_TEMPLATE} ${map}
DR695Hccff30b2017-02-17 18:44:24 -0500353 ${resp}= Run ASDC Post Request ${ASDC_CATALOG_SERVICES_PATH}/${catalog_service_id}${ASDC_CATALOG_LIFECYCLE_PATH}/certificationRequest ${data} ${ASDC_DESIGNER_USER_ID}
354 Should Be Equal As Strings ${resp.status_code} 200
355 [Return] ${resp.json()}
356Start Certify ASDC Catalog Service
357 [Documentation] start certify an asdc Catalog Service by its id
358 [Arguments] ${catalog_service_id}
359 ${resp}= Run ASDC Post Request ${ASDC_CATALOG_SERVICES_PATH}/${catalog_service_id}${ASDC_CATALOG_LIFECYCLE_PATH}/startCertification ${None} ${ASDC_TESTER_USER_ID}
360 Should Be Equal As Strings ${resp.status_code} 200
361 [Return] ${resp.json()}
362Certify ASDC Catalog Service
363 [Documentation] start certify an asdc Catalog Service by its id and returns the new id
364 [Arguments] ${catalog_service_id}
365 ${map}= Create Dictionary user_remarks=Robot remarks
Jerry Floode2a48d72017-06-21 15:06:29 -0400366 ${data}= Fill JSON Template File ${ASDC_USER_REMARKS_TEMPLATE} ${map}
DR695Hccff30b2017-02-17 18:44:24 -0500367 ${resp}= Run ASDC Post Request ${ASDC_CATALOG_SERVICES_PATH}/${catalog_service_id}${ASDC_CATALOG_LIFECYCLE_PATH}/certify ${data} ${ASDC_TESTER_USER_ID}
368 Should Be Equal As Strings ${resp.status_code} 200
369 [Return] ${resp.json()['uniqueId']}
370Approve ASDC Catalog Service
371 [Documentation] approve an asdc Catalog Service by its id
372 [Arguments] ${catalog_service_id}
373 ${map}= Create Dictionary user_remarks=Robot remarks
Jerry Floode2a48d72017-06-21 15:06:29 -0400374 ${data}= Fill JSON Template File ${ASDC_USER_REMARKS_TEMPLATE} ${map}
DR695Hccff30b2017-02-17 18:44:24 -0500375 ${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}
376 Should Be Equal As Strings ${resp.status_code} 200
377 [Return] ${resp.json()}
378Distribute ASDC Catalog Service
379 [Documentation] distribute an asdc Catalog Service by its id
380 [Arguments] ${catalog_service_id}
381 ${resp}= Run ASDC Post Request ${ASDC_CATALOG_SERVICES_PATH}/${catalog_service_id}${ASDC_CATALOG_SERVICE_DISTRIBUTION_ACTIVATE_PATH} ${None} ${ASDC_OPS_USER_ID}
382 Should Be Equal As Strings ${resp.status_code} 200
383 [Return] ${resp.json()}
384Add ASDC Resource Instance
385 [Documentation] Creates an asdc Resource Instance and returns its id
386 [Arguments] ${catalog_service_id} ${catalog_resource_id} ${catalog_resource_name}
387 ${milli_timestamp}= Generate MilliTimestamp UUID
388 ${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 -0400389 ${data}= Fill JSON Template File ${ASDC_RESOURCE_INSTANCE_TEMPLATE} ${map}
DR695Hccff30b2017-02-17 18:44:24 -0500390 ${resp}= Run ASDC Post Request ${ASDC_CATALOG_SERVICES_PATH}/${catalog_service_id}${ASDC_CATALOG_SERVICE_RESOURCE_INSTANCE_PATH} ${data} ${ASDC_DESIGNER_USER_ID}
391 Should Be Equal As Strings ${resp.status_code} 201
392 [Return] ${resp.json()['uniqueId']}
393Get Catalog Service Distribution
394 [Documentation] gets an asdc catalog Service distrbution
395 [Arguments] ${catalog_service_uuid}
396 ${resp}= Run ASDC Get Request ${ASDC_CATALOG_SERVICES_PATH}/${catalog_service_uuid}${ASDC_CATALOG_SERVICE_DISTRIBUTION_PATH} ${ASDC_OPS_USER_ID}
397 Should Be Equal As Strings ${resp.status_code} 200
398 [Return] ${resp.json()}
399Check Catalog Service Distributed
400 [Documentation] gets an asdc catalog Service distrbution
401 [Arguments] ${catalog_service_uuid}
402 ${dist_resp}= Get Catalog Service Distribution ${catalog_service_uuid}
403 Should Be Equal As Strings ${dist_resp['distributionStatusOfServiceList'][0]['deployementStatus']} Distributed
404 ${det_resp}= Get Catalog Service Distribution Details ${dist_resp['distributionStatusOfServiceList'][0]['distributionID']}
405 @{ITEMS}= Copy List ${det_resp['distributionStatusList']}
Brian Freemanf508ab22018-03-15 21:19:41 -0500406 Should Not Be Empty ${ITEMS}
Brian Freemana62644f2018-05-13 12:47:38 -0500407 ${SO_COMPLETE} Set Variable FALSE
DR695Hccff30b2017-02-17 18:44:24 -0500408 :FOR ${ELEMENT} IN @{ITEMS}
Brian Freemanf508ab22018-03-15 21:19:41 -0500409 \ Log ${ELEMENT['omfComponentID']}
DR695Hccff30b2017-02-17 18:44:24 -0500410 \ Log ${ELEMENT['status']}
Brian Freeman41ab5e52018-08-08 14:24:23 -0500411 \ ${SO_COMPLETE} Set Variable If (('${ELEMENT['status']}' == 'DISTRIBUTION_COMPLETE_OK')) or ('${SO_COMPLETE}'=='TRUE') TRUE
Brian Freemaneca71072018-08-16 14:50:16 -0500412 \ Exit For Loop If ('${SO_COMPLETE}'=='TRUE')
413 \ Exit For Loop If ('${ELEMENT['status']}' == 'DISTRIBUTION_COMPLETE_ERROR')
Brian Freemana62644f2018-05-13 12:47:38 -0500414 Should Be True ( '${SO_COMPLETE}'=='TRUE') SO Test
DR695Hccff30b2017-02-17 18:44:24 -0500415Get Catalog Service Distribution Details
416 [Documentation] gets an asdc catalog Service distrbution details
417 [Arguments] ${catalog_service_distribution_id}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500418 ${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 -0500419 Should Be Equal As Strings ${resp.status_code} 200
420 [Return] ${resp.json()}
421Run ASDC Health Check
422 [Documentation] Runs a ASDC health check
DR695Hbf5a3a32017-06-30 13:09:57 -0400423 ${session}= Create Session asdc ${ASDC_FE_ENDPOINT}
DR695Hccff30b2017-02-17 18:44:24 -0500424 ${uuid}= Generate UUID
425 ${headers}= Create Dictionary Accept=application/json Content-Type=application/json X-TransactionId=${GLOBAL_APPLICATION_ID}-${uuid} X-FromAppId=${GLOBAL_APPLICATION_ID}
426 ${resp}= Get Request asdc ${ASDC_HEALTH_CHECK_PATH} headers=${headers}
Brian Freeman00f125e2018-09-05 13:03:48 -0500427 Should Be Equal As Strings ${resp.status_code} 200 SDC DOWN
Brian Freeman5cf5fa62018-04-23 20:28:16 -0500428 ${SDC_DE_HEALTH}= Catenate DOWN
DR695Hccff30b2017-02-17 18:44:24 -0500429 @{ITEMS}= Copy List ${resp.json()['componentsInfo']}
430 :FOR ${ELEMENT} IN @{ITEMS}
431 \ Log ${ELEMENT['healthCheckStatus']}
Brian Freemane546f7e2018-04-19 12:17:56 -0500432 \ ${SDC_DE_HEALTH} Set Variable If (('DE' in '${ELEMENT['healthCheckComponent']}') and ('${ELEMENT['healthCheckStatus']}' == 'UP')) or ('${SDC_DE_HEALTH}'=='UP') UP
Brian Freeman00f125e2018-09-05 13:03:48 -0500433 Should Be Equal As Strings ${SDC_DE_HEALTH} UP SDC_DE DOWN
DR695Hccff30b2017-02-17 18:44:24 -0500434Run ASDC Get Request
435 [Documentation] Runs an ASDC get request
Brian Freeman44b8bb32018-05-03 21:08:42 -0500436 [Arguments] ${data_path} ${user}=${ASDC_DESIGNER_USER_ID} ${MY_ASDC_BE_ENDPOINT}=${ASDC_BE_ENDPOINT}
DR695Hccff30b2017-02-17 18:44:24 -0500437 ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500438 Log Creating session ${MY_ASDC_BE_ENDPOINT}
439 ${session}= Create Session asdc ${MY_ASDC_BE_ENDPOINT} auth=${auth}
DR695Hccff30b2017-02-17 18:44:24 -0500440 ${uuid}= Generate UUID
441 ${headers}= Create Dictionary Accept=application/json Content-Type=application/json USER_ID=${user} X-TransactionId=${GLOBAL_APPLICATION_ID}-${uuid} X-FromAppId=${GLOBAL_APPLICATION_ID}
442 ${resp}= Get Request asdc ${data_path} headers=${headers}
443 Log Received response from asdc ${resp.text}
444 [Return] ${resp}
445Run ASDC Put Request
446 [Documentation] Runs an ASDC put request
Brian Freeman44b8bb32018-05-03 21:08:42 -0500447 [Arguments] ${data_path} ${data} ${user}=${ASDC_DESIGNER_USER_ID} ${MY_ASDC_BE_ENDPOINT}=${ASDC_BE_ENDPOINT}
DR695Hccff30b2017-02-17 18:44:24 -0500448 ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500449 Log Creating session ${MY_ASDC_BE_ENDPOINT}
450 ${session}= Create Session asdc ${MY_ASDC_BE_ENDPOINT} auth=${auth}
DR695Hccff30b2017-02-17 18:44:24 -0500451 ${uuid}= Generate UUID
452 ${headers}= Create Dictionary Accept=application/json Content-Type=application/json USER_ID=${user} X-TransactionId=${GLOBAL_APPLICATION_ID}-${uuid} X-FromAppId=${GLOBAL_APPLICATION_ID}
453 ${resp}= Put Request asdc ${data_path} data=${data} headers=${headers}
454 Log Received response from asdc ${resp.text}
455 [Return] ${resp}
Jerry Flood6bd1afa2017-10-09 09:59:23 -0400456
DR695Hccff30b2017-02-17 18:44:24 -0500457Run ASDC Post Files Request
458 [Documentation] Runs an ASDC post request
Brian Freeman44b8bb32018-05-03 21:08:42 -0500459 [Arguments] ${data_path} ${files} ${user}=${ASDC_DESIGNER_USER_ID} ${MY_ASDC_BE_ENDPOINT}=${ASDC_BE_ENDPOINT}
DR695Hccff30b2017-02-17 18:44:24 -0500460 ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500461 Log Creating session ${MY_ASDC_BE_ENDPOINT}
462 ${session}= Create Session asdc ${MY_ASDC_BE_ENDPOINT} auth=${auth}
DR695Hccff30b2017-02-17 18:44:24 -0500463 ${uuid}= Generate UUID
464 ${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}
465 ${resp}= Post Request asdc ${data_path} files=${files} headers=${headers}
466 Log Received response from asdc ${resp.text}
Jerry Floode2a48d72017-06-21 15:06:29 -0400467 [Return] ${resp}
Jerry Flood6bd1afa2017-10-09 09:59:23 -0400468
DR695Hccff30b2017-02-17 18:44:24 -0500469Run ASDC Post Request
470 [Documentation] Runs an ASDC post request
Brian Freeman44b8bb32018-05-03 21:08:42 -0500471 [Arguments] ${data_path} ${data} ${user}=${ASDC_DESIGNER_USER_ID} ${MY_ASDC_BE_ENDPOINT}=${ASDC_BE_ENDPOINT}
DR695Hccff30b2017-02-17 18:44:24 -0500472 ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500473 Log Creating session ${MY_ASDC_BE_ENDPOINT}
474 ${session}= Create Session asdc ${MY_ASDC_BE_ENDPOINT} auth=${auth}
DR695Hccff30b2017-02-17 18:44:24 -0500475 ${uuid}= Generate UUID
476 ${headers}= Create Dictionary Accept=application/json Content-Type=application/json USER_ID=${user} X-TransactionId=${GLOBAL_APPLICATION_ID}-${uuid} X-FromAppId=${GLOBAL_APPLICATION_ID}
477 ${resp}= Post Request asdc ${data_path} data=${data} headers=${headers}
478 Log Received response from asdc ${resp.text}
Jerry Floode2a48d72017-06-21 15:06:29 -0400479 [Return] ${resp}
DR695Hccff30b2017-02-17 18:44:24 -0500480Run ASDC Delete Request
481 [Documentation] Runs an ASDC delete request
Brian Freeman44b8bb32018-05-03 21:08:42 -0500482 [Arguments] ${data_path} ${user}=${ASDC_DESIGNER_USER_ID} ${MY_ASDC_BE_ENDPOINT}=${ASDC_BE_ENDPOINT}
483 ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD}
484 Log Creating session ${MY_ASDC_BE_ENDPOINT}
485 ${session}= Create Session asdc ${MY_ASDC_BE_ENDPOINT} auth=${auth}
DR695Hccff30b2017-02-17 18:44:24 -0500486 ${uuid}= Generate UUID
487 ${headers}= Create Dictionary Accept=application/json Content-Type=application/json USER_ID=${user} X-TransactionId=${GLOBAL_APPLICATION_ID}-${uuid} X-FromAppId=${GLOBAL_APPLICATION_ID}
488 ${resp}= Delete Request asdc ${data_path} headers=${headers}
489 Log Received response from asdc ${resp.text}
Jerry Floode2a48d72017-06-21 15:06:29 -0400490 [Return] ${resp}
DR695Hccff30b2017-02-17 18:44:24 -0500491Open ASDC GUI
492 [Documentation] Logs in to ASDC GUI
493 [Arguments] ${PATH}
494 ## Setup Browever now being managed by the test case
495 ##Setup Browser
DR695Hbf5a3a32017-06-30 13:09:57 -0400496 Go To ${ASDC_FE_ENDPOINT}${PATH}
DR695Hccff30b2017-02-17 18:44:24 -0500497 Maximize Browser Window
Jerry Flood6bd1afa2017-10-09 09:59:23 -0400498
DR695Hccff30b2017-02-17 18:44:24 -0500499 Set Browser Implicit Wait ${GLOBAL_SELENIUM_BROWSER_IMPLICIT_WAIT}
DR695Hbf5a3a32017-06-30 13:09:57 -0400500 Log Logging in to ${ASDC_FE_ENDPOINT}${PATH}
DR695Hccff30b2017-02-17 18:44:24 -0500501 Title Should Be ASDC
Jerry Floode2a48d72017-06-21 15:06:29 -0400502 Wait Until Page Contains Element xpath=//div/a[text()='SDC'] ${GLOBAL_SELENIUM_BROWSER_WAIT_TIMEOUT}
DR695Hbf5a3a32017-06-30 13:09:57 -0400503 Log Logged in to ${ASDC_FE_ENDPOINT}${PATH}
Jerry Flood6bd1afa2017-10-09 09:59:23 -0400504
505
506Create Multi Part
507 [Arguments] ${addTo} ${partName} ${filePath} ${contentType}=${None}
508 ${fileData}= Get Binary File ${filePath}
509 ${fileDir} ${fileName}= Split Path ${filePath}
510 ${partData}= Create List ${fileName} ${fileData} ${contentType}
511 Set To Dictionary ${addTo} ${partName}=${partData}
Brian Freemanf940ee92018-05-25 21:09:05 -0500512