blob: 65cf6372e1e034eafbd234f6d2fbffebf427aeca [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}
DR695Hccff30b2017-02-17 18:44:24 -0500106 Checkin ASDC Catalog Resource ${catalog_resource_id}
107 Request Certify ASDC Catalog Resource ${catalog_resource_id}
108 Start Certify ASDC Catalog Resource ${catalog_resource_id}
109 # on certify it gets a new id
110 [Return] ${catalog_resource_id}
111 ${catalog_resource_id}= Certify ASDC Catalog Resource ${catalog_resource_id}
112Add ASDC License Model
113 [Documentation] Creates an asdc license model and returns its id
Jerry Floode2a48d72017-06-21 15:06:29 -0400114 ${uuid}= Generate UUID
115 ${shortened_uuid}= Evaluate str("${uuid}")[:23]
DR695Hccff30b2017-02-17 18:44:24 -0500116 ${map}= Create Dictionary vendor_name=${shortened_uuid}
117 ${data}= Fill JSON Template File ${ASDC_LICENSE_MODEL_TEMPLATE} ${map}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500118 ${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 -0500119 Should Be Equal As Strings ${resp.status_code} 200
Brian Freemanb568e5e2018-04-05 21:03:38 -0500120 [Return] ${resp.json()['itemId']} ${resp.json()['version']['id']}
DR695Hccff30b2017-02-17 18:44:24 -0500121Get ASDC License Model
122 [Documentation] gets an asdc license model by its id
Jerry Floode2a48d72017-06-21 15:06:29 -0400123 [Arguments] ${id} ${version_id}=0.1
Brian Freeman44b8bb32018-05-03 21:08:42 -0500124 ${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 -0400125 [Return] ${resp.json()}
126Get ASDC License Models
127 [Documentation] gets an asdc license model by its id
Brian Freeman44b8bb32018-05-03 21:08:42 -0500128 ${resp}= Run ASDC Get Request ${ASDC_VENDOR_LICENSE_MODEL_PATH} ${ASDC_DESIGNER_USER_ID} ${ASDC_BE_ONBOARD_ENDPOINT}
129
DR695Hccff30b2017-02-17 18:44:24 -0500130 [Return] ${resp.json()}
131Checkin ASDC License Model
132 [Documentation] checksin an asdc license model by its id
Jerry Floode2a48d72017-06-21 15:06:29 -0400133 [Arguments] ${id} ${version_id}=0.1
DR695Hccff30b2017-02-17 18:44:24 -0500134 ${map}= Create Dictionary action=Checkin
135 ${data}= Fill JSON Template File ${ASDC_ACTION_TEMPLATE} ${map}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500136 ${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 -0500137 Should Be Equal As Strings ${resp.status_code} 200
138 [Return] ${resp.json()}
139Submit ASDC License Model
140 [Documentation] submits an asdc license model by its id
Jerry Floode2a48d72017-06-21 15:06:29 -0400141 [Arguments] ${id} ${version_id}=0.1
DR695Hccff30b2017-02-17 18:44:24 -0500142 ${map}= Create Dictionary action=Submit
143 ${data}= Fill JSON Template File ${ASDC_ACTION_TEMPLATE} ${map}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500144 ${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 -0500145 Should Be Equal As Strings ${resp.status_code} 200
146 [Return] ${resp.json()}
147Checkin ASDC Software Product
148 [Documentation] checksin an asdc Software Product by its id
Jerry Floode2a48d72017-06-21 15:06:29 -0400149 [Arguments] ${id} ${version_id}=0.1
DR695Hccff30b2017-02-17 18:44:24 -0500150 ${map}= Create Dictionary action=Checkin
Jerry Floode2a48d72017-06-21 15:06:29 -0400151 ${data}= Fill JSON Template File ${ASDC_ACTION_TEMPLATE} ${map}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500152 ${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 -0400153 Should Be Equal As Strings ${resp.status_code} 200
154 [Return] ${resp.json()}
155Validate ASDC Software Product
156 [Documentation] checksin an asdc Software Product by its id
157 [Arguments] ${id} ${version_id}=0.1
158 ${data}= Catenate
Brian Freeman44b8bb32018-05-03 21:08:42 -0500159 ${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 -0500160 Should Be Equal As Strings ${resp.status_code} 200
161 [Return] ${resp.json()}
162Submit ASDC Software Product
163 [Documentation] submits an asdc Software Product by its id
Jerry Floode2a48d72017-06-21 15:06:29 -0400164 [Arguments] ${id} ${version_id}=0.1
DR695Hccff30b2017-02-17 18:44:24 -0500165 ${map}= Create Dictionary action=Submit
Jerry Floode2a48d72017-06-21 15:06:29 -0400166 ${data}= Fill JSON Template File ${ASDC_ACTION_TEMPLATE} ${map}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500167 ${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 -0500168 Should Be Equal As Strings ${resp.status_code} 200
169 [Return] ${resp.json()}
170Package ASDC Software Product
171 [Documentation] creates_package on an asdc Software Product by its id
Jerry Floode2a48d72017-06-21 15:06:29 -0400172 [Arguments] ${id} ${version_id}=0.1
DR695Hccff30b2017-02-17 18:44:24 -0500173 ${map}= Create Dictionary action=Create_Package
Jerry Floode2a48d72017-06-21 15:06:29 -0400174 ${data}= Fill JSON Template File ${ASDC_ACTION_TEMPLATE} ${map}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500175 ${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 -0500176 Should Be Equal As Strings ${resp.status_code} 200
Jerry Floode2a48d72017-06-21 15:06:29 -0400177 [Return] ${resp.json()}
DR695Hccff30b2017-02-17 18:44:24 -0500178Add ASDC Entitlement Pool
179 [Documentation] Creates an asdc Entitlement Pool and returns its id
Jerry Floode2a48d72017-06-21 15:06:29 -0400180 [Arguments] ${license_model_id} ${version_id}=0.1
181 ${uuid}= Generate UUID
182 ${shortened_uuid}= Evaluate str("${uuid}")[:23]
DR695Hccff30b2017-02-17 18:44:24 -0500183 ${map}= Create Dictionary entitlement_pool_name=${shortened_uuid}
Jerry Floode2a48d72017-06-21 15:06:29 -0400184 ${data}= Fill JSON Template File ${ASDC_ENTITLEMENT_POOL_TEMPLATE} ${map}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500185 ${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 -0500186 Should Be Equal As Strings ${resp.status_code} 200
187 [Return] ${resp.json()['value']}
188Get ASDC Entitlement Pool
189 [Documentation] gets an asdc Entitlement Pool by its id
190 [Arguments] ${license_model_id} ${pool_id}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500191 ${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 -0500192 [Return] ${resp.json()}
193Add ASDC License Group
194 [Documentation] Creates an asdc license group and returns its id
Brian Freemanb568e5e2018-04-05 21:03:38 -0500195 [Arguments] ${license_model_id} ${version_id}=1.0
Jerry Floode2a48d72017-06-21 15:06:29 -0400196 ${uuid}= Generate UUID
197 ${shortened_uuid}= Evaluate str("${uuid}")[:23]
DR695Hccff30b2017-02-17 18:44:24 -0500198 ${map}= Create Dictionary key_group_name=${shortened_uuid}
Jerry Floode2a48d72017-06-21 15:06:29 -0400199 ${data}= Fill JSON Template File ${ASDC_KEY_GROUP_TEMPLATE} ${map}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500200 ${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 -0500201 Should Be Equal As Strings ${resp.status_code} 200
202 [Return] ${resp.json()['value']}
203Get ASDC License Group
204 [Documentation] gets an asdc license group by its id
Jerry Floode2a48d72017-06-21 15:06:29 -0400205 [Arguments] ${license_model_id} ${group_id} ${version_id}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500206 ${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 -0500207 [Return] ${resp.json()}
208Add ASDC Feature Group
209 [Documentation] Creates an asdc Feature Group and returns its id
Jerry Floode2a48d72017-06-21 15:06:29 -0400210 [Arguments] ${license_model_id} ${key_group_id} ${entitlement_pool_id} ${version_id}=0.1
211 ${uuid}= Generate UUID
212 ${shortened_uuid}= Evaluate str("${uuid}")[:23]
Jerry Flood80ff9852017-08-11 06:47:14 -0400213 ${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 -0400214 ${data}= Fill JSON Template File ${ASDC_FEATURE_GROUP_TEMPLATE} ${map}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500215 ${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 -0500216 Should Be Equal As Strings ${resp.status_code} 200
217 [Return] ${resp.json()['value']}
218Get ASDC Feature Group
219 [Documentation] gets an asdc Feature Group by its id
220 [Arguments] ${license_model_id} ${group_id}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500221 ${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 -0500222 [Return] ${resp.json()}
223Add ASDC License Agreement
224 [Documentation] Creates an asdc License Agreement and returns its id
Jerry Floode2a48d72017-06-21 15:06:29 -0400225 [Arguments] ${license_model_id} ${feature_group_id} ${version_id}=0.1
226 ${uuid}= Generate UUID
227 ${shortened_uuid}= Evaluate str("${uuid}")[:23]
DR695Hccff30b2017-02-17 18:44:24 -0500228 ${map}= Create Dictionary license_agreement_name=${shortened_uuid} feature_group_id=${feature_group_id}
Jerry Floode2a48d72017-06-21 15:06:29 -0400229 ${data}= Fill JSON Template File ${ASDC_LICENSE_AGREEMENT_TEMPLATE} ${map}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500230 ${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 -0500231 Should Be Equal As Strings ${resp.status_code} 200
232 [Return] ${resp.json()['value']}
233Get ASDC License Agreement
234 [Documentation] gets an asdc License Agreement by its id
235 [Arguments] ${license_model_id} ${agreement_id}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500236 ${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 -0500237 [Return] ${resp.json()}
238Add ASDC Software Product
239 [Documentation] Creates an asdc Software Product and returns its id
Brian Freemanb568e5e2018-04-05 21:03:38 -0500240 [Arguments] ${license_agreement_id} ${feature_group_id} ${license_model_name} ${license_model_id} ${license_model_version_id}
Jerry Floode2a48d72017-06-21 15:06:29 -0400241 ${uuid}= Generate UUID
242 ${shortened_uuid}= Evaluate str("${uuid}")[:23]
Brian Freemanb568e5e2018-04-05 21:03:38 -0500243 ${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 -0400244 ${data}= Fill JSON Template File ${ASDC_SOFTWARE_PRODUCT_TEMPLATE} ${map}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500245 ${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 -0500246 Should Be Equal As Strings ${resp.status_code} 200
Brian Freemanb568e5e2018-04-05 21:03:38 -0500247 [Return] ${resp.json()['itemId']} ${resp.json()['version']['id']}
DR695Hccff30b2017-02-17 18:44:24 -0500248Get ASDC Software Product
249 [Documentation] gets an asdc Software Product by its id
Jerry Floode2a48d72017-06-21 15:06:29 -0400250 [Arguments] ${software_product_id} ${version_id}=0.1
Brian Freeman44b8bb32018-05-03 21:08:42 -0500251 ${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 -0500252 [Return] ${resp.json()}
253Add ASDC Catalog Resource
254 [Documentation] Creates an asdc Catalog Resource and returns its id
255 [Arguments] ${license_agreement_id} ${software_product_name} ${license_model_name} ${software_product_id}
256 ${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 -0400257 ${data}= Fill JSON Template File ${ASDC_CATALOG_RESOURCE_TEMPLATE} ${map}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500258 ${resp}= Run ASDC Post Request ${ASDC_CATALOG_RESOURCES_PATH} ${data} ${ASDC_DESIGNER_USER_ID}
DR695Hccff30b2017-02-17 18:44:24 -0500259 Should Be Equal As Strings ${resp.status_code} 201
260 [Return] ${resp.json()['uniqueId']}
261Mark ASDC Catalog Resource Inactive
262 [Documentation] deletes an asdc Catalog Resource
263 [Arguments] ${catalog_resource_id}
264 ${resp}= Run ASDC Delete Request ${ASDC_CATALOG_RESOURCES_PATH}/${catalog_resource_id} ${ASDC_DESIGNER_USER_ID}
265 Should Be Equal As Strings ${resp.status_code} 204
266 [Return] ${resp}
267Delete Inactive ASDC Catalog Resources
268 [Documentation] delete all asdc Catalog Resources that are inactive
269 ${resp}= Run ASDC Delete Request ${ASDC_CATALOG_INACTIVE_RESOURCES_PATH} ${ASDC_DESIGNER_USER_ID}
270 Should Be Equal As Strings ${resp.status_code} 200
271 [Return] ${resp.json()}
272Get ASDC Catalog Resource
273 [Documentation] gets an asdc Catalog Resource by its id
274 [Arguments] ${catalog_resource_id}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500275 ${resp}= Run ASDC Get Request ${ASDC_CATALOG_RESOURCES_PATH}/${catalog_resource_id} ${ASDC_DESIGNER_USER_ID}
DR695Hccff30b2017-02-17 18:44:24 -0500276 [Return] ${resp.json()}
277Checkin ASDC Catalog Resource
278 [Documentation] checksin an asdc Catalog Resource by its id
279 [Arguments] ${catalog_resource_id}
280 ${map}= Create Dictionary user_remarks=Robot remarks
Jerry Floode2a48d72017-06-21 15:06:29 -0400281 ${data}= Fill JSON Template File ${ASDC_USER_REMARKS_TEMPLATE} ${map}
DR695Hccff30b2017-02-17 18:44:24 -0500282 ${resp}= Run ASDC Post Request ${ASDC_CATALOG_RESOURCES_PATH}/${catalog_resource_id}${ASDC_CATALOG_LIFECYCLE_PATH}/checkin ${data} ${ASDC_DESIGNER_USER_ID}
283 Should Be Equal As Strings ${resp.status_code} 200
284 [Return] ${resp.json()}
285Request Certify ASDC Catalog Resource
286 [Documentation] requests certify on an asdc Catalog Resource by its id
287 [Arguments] ${catalog_resource_id}
288 ${map}= Create Dictionary user_remarks=Robot remarks
Jerry Floode2a48d72017-06-21 15:06:29 -0400289 ${data}= Fill JSON Template File ${ASDC_USER_REMARKS_TEMPLATE} ${map}
DR695Hccff30b2017-02-17 18:44:24 -0500290 ${resp}= Run ASDC Post Request ${ASDC_CATALOG_RESOURCES_PATH}/${catalog_resource_id}${ASDC_CATALOG_LIFECYCLE_PATH}/certificationRequest ${data} ${ASDC_DESIGNER_USER_ID}
291 Should Be Equal As Strings ${resp.status_code} 200
292 [Return] ${resp.json()}
293Start Certify ASDC Catalog Resource
294 [Documentation] start certify an asdc Catalog Resource by its id
295 [Arguments] ${catalog_resource_id}
296 ${resp}= Run ASDC Post Request ${ASDC_CATALOG_RESOURCES_PATH}/${catalog_resource_id}${ASDC_CATALOG_LIFECYCLE_PATH}/startCertification ${None} ${ASDC_TESTER_USER_ID}
297 Should Be Equal As Strings ${resp.status_code} 200
298 [Return] ${resp.json()}
299Certify ASDC Catalog Resource
300 [Documentation] start certify an asdc Catalog Resource by its id and returns the new id
301 [Arguments] ${catalog_resource_id}
302 ${map}= Create Dictionary user_remarks=Robot remarks
Jerry Floode2a48d72017-06-21 15:06:29 -0400303 ${data}= Fill JSON Template File ${ASDC_USER_REMARKS_TEMPLATE} ${map}
DR695Hccff30b2017-02-17 18:44:24 -0500304 ${resp}= Run ASDC Post Request ${ASDC_CATALOG_RESOURCES_PATH}/${catalog_resource_id}${ASDC_CATALOG_LIFECYCLE_PATH}/certify ${data} ${ASDC_TESTER_USER_ID}
305 Should Be Equal As Strings ${resp.status_code} 200
306 [Return] ${resp.json()['uniqueId']}
Jerry Flood6bd1afa2017-10-09 09:59:23 -0400307
DR695Hccff30b2017-02-17 18:44:24 -0500308Upload ASDC Heat Package
Brian Freemanf508ab22018-03-15 21:19:41 -0500309 [Documentation] Creates an asdc Software Product and returns its id
310 [Arguments] ${software_product_id} ${file_path} ${version_id}=0.1
Jerry Flood6bd1afa2017-10-09 09:59:23 -0400311 ${files}= Create Dictionary
312 Create Multi Part ${files} upload ${file_path} contentType=application/zip
Brian Freeman44b8bb32018-05-03 21:08:42 -0500313 ${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 -0500314 Should Be Equal As Strings ${resp.status_code} 200
Jerry Flood6bd1afa2017-10-09 09:59:23 -0400315
DR695Hccff30b2017-02-17 18:44:24 -0500316Add ASDC Catalog Service
317 [Documentation] Creates an asdc Catalog Service and returns its id
jf986075010a42017-02-22 16:52:54 -0500318 [Arguments] ${catalog_service_name}
Jerry Floode2a48d72017-06-21 15:06:29 -0400319 ${uuid}= Generate UUID
jf986075010a42017-02-22 16:52:54 -0500320 ${shortened_uuid}= Evaluate str("${uuid}")[:23]
Jerry Floode2a48d72017-06-21 15:06:29 -0400321 ${catalog_service_name}= Set Variable If '${catalog_service_name}' =='' ${shortened_uuid} ${catalog_service_name}
jf986075010a42017-02-22 16:52:54 -0500322 ${map}= Create Dictionary service_name=${catalog_service_name}
Jerry Floode2a48d72017-06-21 15:06:29 -0400323 ${data}= Fill JSON Template File ${ASDC_CATALOG_SERVICE_TEMPLATE} ${map}
DR695Hccff30b2017-02-17 18:44:24 -0500324 ${resp}= Run ASDC Post Request ${ASDC_CATALOG_SERVICES_PATH} ${data} ${ASDC_DESIGNER_USER_ID}
325 Should Be Equal As Strings ${resp.status_code} 201
326 [Return] ${resp.json()['uniqueId']}
327Mark ASDC Catalog Service Inactive
328 [Documentation] Deletes an asdc Catalog Service
329 [Arguments] ${catalog_service_id}
330 ${resp}= Run ASDC Delete Request ${ASDC_CATALOG_SERVICES_PATH}/${catalog_service_id} ${ASDC_DESIGNER_USER_ID}
331 Should Be Equal As Strings ${resp.status_code} 204
332 [Return] ${resp}
333Delete Inactive ASDC Catalog Services
334 [Documentation] delete all asdc Catalog Serivces that are inactive
335 ${resp}= Run ASDC Delete Request ${ASDC_CATALOG_INACTIVE_SERVICES_PATH} ${ASDC_DESIGNER_USER_ID}
336 Should Be Equal As Strings ${resp.status_code} 200
337 [Return] ${resp.json()}
338Get ASDC Catalog Service
339 [Documentation] gets an asdc Catalog Service by its id
340 [Arguments] ${catalog_service_id}
341 ${resp}= Run ASDC Get Request ${ASDC_CATALOG_SERVICES_PATH}/${catalog_service_id} ${ASDC_DESIGNER_USER_ID}
342 [Return] ${resp.json()}
343Checkin ASDC Catalog Service
344 [Documentation] checksin an asdc Catalog Service by its id
345 [Arguments] ${catalog_service_id}
346 ${map}= Create Dictionary user_remarks=Robot remarks
Jerry Floode2a48d72017-06-21 15:06:29 -0400347 ${data}= Fill JSON Template File ${ASDC_USER_REMARKS_TEMPLATE} ${map}
DR695Hccff30b2017-02-17 18:44:24 -0500348 ${resp}= Run ASDC Post Request ${ASDC_CATALOG_SERVICES_PATH}/${catalog_service_id}${ASDC_CATALOG_LIFECYCLE_PATH}/checkin ${data} ${ASDC_DESIGNER_USER_ID}
349 Should Be Equal As Strings ${resp.status_code} 200
350 [Return] ${resp.json()}
351Request Certify ASDC Catalog Service
352 [Documentation] requests certify on an asdc Catalog Service by its id
353 [Arguments] ${catalog_service_id}
354 ${map}= Create Dictionary user_remarks=Robot remarks
Jerry Floode2a48d72017-06-21 15:06:29 -0400355 ${data}= Fill JSON Template File ${ASDC_USER_REMARKS_TEMPLATE} ${map}
DR695Hccff30b2017-02-17 18:44:24 -0500356 ${resp}= Run ASDC Post Request ${ASDC_CATALOG_SERVICES_PATH}/${catalog_service_id}${ASDC_CATALOG_LIFECYCLE_PATH}/certificationRequest ${data} ${ASDC_DESIGNER_USER_ID}
357 Should Be Equal As Strings ${resp.status_code} 200
358 [Return] ${resp.json()}
359Start Certify ASDC Catalog Service
360 [Documentation] start certify an asdc Catalog Service by its id
361 [Arguments] ${catalog_service_id}
362 ${resp}= Run ASDC Post Request ${ASDC_CATALOG_SERVICES_PATH}/${catalog_service_id}${ASDC_CATALOG_LIFECYCLE_PATH}/startCertification ${None} ${ASDC_TESTER_USER_ID}
363 Should Be Equal As Strings ${resp.status_code} 200
364 [Return] ${resp.json()}
365Certify ASDC Catalog Service
366 [Documentation] start certify an asdc Catalog Service by its id and returns the new id
367 [Arguments] ${catalog_service_id}
368 ${map}= Create Dictionary user_remarks=Robot remarks
Jerry Floode2a48d72017-06-21 15:06:29 -0400369 ${data}= Fill JSON Template File ${ASDC_USER_REMARKS_TEMPLATE} ${map}
DR695Hccff30b2017-02-17 18:44:24 -0500370 ${resp}= Run ASDC Post Request ${ASDC_CATALOG_SERVICES_PATH}/${catalog_service_id}${ASDC_CATALOG_LIFECYCLE_PATH}/certify ${data} ${ASDC_TESTER_USER_ID}
371 Should Be Equal As Strings ${resp.status_code} 200
372 [Return] ${resp.json()['uniqueId']}
373Approve ASDC Catalog Service
374 [Documentation] approve an asdc Catalog Service by its id
375 [Arguments] ${catalog_service_id}
376 ${map}= Create Dictionary user_remarks=Robot remarks
Jerry Floode2a48d72017-06-21 15:06:29 -0400377 ${data}= Fill JSON Template File ${ASDC_USER_REMARKS_TEMPLATE} ${map}
DR695Hccff30b2017-02-17 18:44:24 -0500378 ${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}
379 Should Be Equal As Strings ${resp.status_code} 200
380 [Return] ${resp.json()}
381Distribute ASDC Catalog Service
382 [Documentation] distribute an asdc Catalog Service by its id
383 [Arguments] ${catalog_service_id}
384 ${resp}= Run ASDC Post Request ${ASDC_CATALOG_SERVICES_PATH}/${catalog_service_id}${ASDC_CATALOG_SERVICE_DISTRIBUTION_ACTIVATE_PATH} ${None} ${ASDC_OPS_USER_ID}
385 Should Be Equal As Strings ${resp.status_code} 200
386 [Return] ${resp.json()}
387Add ASDC Resource Instance
388 [Documentation] Creates an asdc Resource Instance and returns its id
389 [Arguments] ${catalog_service_id} ${catalog_resource_id} ${catalog_resource_name}
390 ${milli_timestamp}= Generate MilliTimestamp UUID
391 ${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 -0400392 ${data}= Fill JSON Template File ${ASDC_RESOURCE_INSTANCE_TEMPLATE} ${map}
DR695Hccff30b2017-02-17 18:44:24 -0500393 ${resp}= Run ASDC Post Request ${ASDC_CATALOG_SERVICES_PATH}/${catalog_service_id}${ASDC_CATALOG_SERVICE_RESOURCE_INSTANCE_PATH} ${data} ${ASDC_DESIGNER_USER_ID}
394 Should Be Equal As Strings ${resp.status_code} 201
395 [Return] ${resp.json()['uniqueId']}
396Get Catalog Service Distribution
397 [Documentation] gets an asdc catalog Service distrbution
398 [Arguments] ${catalog_service_uuid}
399 ${resp}= Run ASDC Get Request ${ASDC_CATALOG_SERVICES_PATH}/${catalog_service_uuid}${ASDC_CATALOG_SERVICE_DISTRIBUTION_PATH} ${ASDC_OPS_USER_ID}
400 Should Be Equal As Strings ${resp.status_code} 200
401 [Return] ${resp.json()}
402Check Catalog Service Distributed
403 [Documentation] gets an asdc catalog Service distrbution
404 [Arguments] ${catalog_service_uuid}
405 ${dist_resp}= Get Catalog Service Distribution ${catalog_service_uuid}
406 Should Be Equal As Strings ${dist_resp['distributionStatusOfServiceList'][0]['deployementStatus']} Distributed
407 ${det_resp}= Get Catalog Service Distribution Details ${dist_resp['distributionStatusOfServiceList'][0]['distributionID']}
408 @{ITEMS}= Copy List ${det_resp['distributionStatusList']}
Brian Freemanf508ab22018-03-15 21:19:41 -0500409 Should Not Be Empty ${ITEMS}
410 ${AAI_DEPLOY} Set Variable FALSE
411 ${SDNC_DEPLOY} Set Variable FALSE
412 ${SO_DEPLOY} Set Variable FALSE
Brian Freemana62644f2018-05-13 12:47:38 -0500413 ${SO_COMPLETE} Set Variable FALSE
DR695Hccff30b2017-02-17 18:44:24 -0500414 :FOR ${ELEMENT} IN @{ITEMS}
Brian Freemanf508ab22018-03-15 21:19:41 -0500415 \ Log ${ELEMENT['omfComponentID']}
DR695Hccff30b2017-02-17 18:44:24 -0500416 \ Log ${ELEMENT['status']}
Brian Freemanf508ab22018-03-15 21:19:41 -0500417 \ ${SDNC_DEPLOY} Set Variable If (('sdnc-docker' in '${ELEMENT['omfComponentID']}') and ('${ELEMENT['status']}' == 'DEPLOY_OK')) or ('${SDNC_DEPLOY}' == 'TRUE') TRUE
418 \ ${SO_DEPLOY} Set Variable If (('mso-docker' in '${ELEMENT['omfComponentID']}') and ('${ELEMENT['status']}' == 'DEPLOY_OK')) or ('${SO_DEPLOY}' == 'TRUE') TRUE
419 \ ${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 -0500420 \ ${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 -0500421 Should Be True ( '${SDNC_DEPLOY}'=='TRUE') SDNC Test
Brian Freemana62644f2018-05-13 12:47:38 -0500422 Should Be True ( '${SO_DEPLOY}'=='TRUE') SO Test
Brian Freemanf508ab22018-03-15 21:19:41 -0500423 Should Be True ( '${AAI_DEPLOY}'=='TRUE') AAI Test
Brian Freemana62644f2018-05-13 12:47:38 -0500424 Should Be True ( '${SO_COMPLETE}'=='TRUE') SO Test
DR695Hccff30b2017-02-17 18:44:24 -0500425Get Catalog Service Distribution Details
426 [Documentation] gets an asdc catalog Service distrbution details
427 [Arguments] ${catalog_service_distribution_id}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500428 ${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 -0500429 Should Be Equal As Strings ${resp.status_code} 200
430 [Return] ${resp.json()}
431Run ASDC Health Check
432 [Documentation] Runs a ASDC health check
DR695Hbf5a3a32017-06-30 13:09:57 -0400433 ${session}= Create Session asdc ${ASDC_FE_ENDPOINT}
DR695Hccff30b2017-02-17 18:44:24 -0500434 ${uuid}= Generate UUID
435 ${headers}= Create Dictionary Accept=application/json Content-Type=application/json X-TransactionId=${GLOBAL_APPLICATION_ID}-${uuid} X-FromAppId=${GLOBAL_APPLICATION_ID}
436 ${resp}= Get Request asdc ${ASDC_HEALTH_CHECK_PATH} headers=${headers}
437 Should Be Equal As Strings ${resp.status_code} 200
Brian Freeman5cf5fa62018-04-23 20:28:16 -0500438 ${SDC_DE_HEALTH}= Catenate DOWN
DR695Hccff30b2017-02-17 18:44:24 -0500439 @{ITEMS}= Copy List ${resp.json()['componentsInfo']}
440 :FOR ${ELEMENT} IN @{ITEMS}
441 \ Log ${ELEMENT['healthCheckStatus']}
Brian Freemane546f7e2018-04-19 12:17:56 -0500442 \ ${SDC_DE_HEALTH} Set Variable If (('DE' in '${ELEMENT['healthCheckComponent']}') and ('${ELEMENT['healthCheckStatus']}' == 'UP')) or ('${SDC_DE_HEALTH}'=='UP') UP
443 Should Be Equal As Strings ${SDC_DE_HEALTH} UP
DR695Hccff30b2017-02-17 18:44:24 -0500444Run ASDC Get Request
445 [Documentation] Runs an ASDC get request
Brian Freeman44b8bb32018-05-03 21:08:42 -0500446 [Arguments] ${data_path} ${user}=${ASDC_DESIGNER_USER_ID} ${MY_ASDC_BE_ENDPOINT}=${ASDC_BE_ENDPOINT}
DR695Hccff30b2017-02-17 18:44:24 -0500447 ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500448 Log Creating session ${MY_ASDC_BE_ENDPOINT}
449 ${session}= Create Session asdc ${MY_ASDC_BE_ENDPOINT} auth=${auth}
DR695Hccff30b2017-02-17 18:44:24 -0500450 ${uuid}= Generate UUID
451 ${headers}= Create Dictionary Accept=application/json Content-Type=application/json USER_ID=${user} X-TransactionId=${GLOBAL_APPLICATION_ID}-${uuid} X-FromAppId=${GLOBAL_APPLICATION_ID}
452 ${resp}= Get Request asdc ${data_path} headers=${headers}
453 Log Received response from asdc ${resp.text}
454 [Return] ${resp}
455Run ASDC Put Request
456 [Documentation] Runs an ASDC put request
Brian Freeman44b8bb32018-05-03 21:08:42 -0500457 [Arguments] ${data_path} ${data} ${user}=${ASDC_DESIGNER_USER_ID} ${MY_ASDC_BE_ENDPOINT}=${ASDC_BE_ENDPOINT}
DR695Hccff30b2017-02-17 18:44:24 -0500458 ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500459 Log Creating session ${MY_ASDC_BE_ENDPOINT}
460 ${session}= Create Session asdc ${MY_ASDC_BE_ENDPOINT} auth=${auth}
DR695Hccff30b2017-02-17 18:44:24 -0500461 ${uuid}= Generate UUID
462 ${headers}= Create Dictionary Accept=application/json Content-Type=application/json USER_ID=${user} X-TransactionId=${GLOBAL_APPLICATION_ID}-${uuid} X-FromAppId=${GLOBAL_APPLICATION_ID}
463 ${resp}= Put Request asdc ${data_path} data=${data} headers=${headers}
464 Log Received response from asdc ${resp.text}
465 [Return] ${resp}
Jerry Flood6bd1afa2017-10-09 09:59:23 -0400466
DR695Hccff30b2017-02-17 18:44:24 -0500467Run ASDC Post Files Request
468 [Documentation] Runs an ASDC post request
Brian Freeman44b8bb32018-05-03 21:08:42 -0500469 [Arguments] ${data_path} ${files} ${user}=${ASDC_DESIGNER_USER_ID} ${MY_ASDC_BE_ENDPOINT}=${ASDC_BE_ENDPOINT}
DR695Hccff30b2017-02-17 18:44:24 -0500470 ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500471 Log Creating session ${MY_ASDC_BE_ENDPOINT}
472 ${session}= Create Session asdc ${MY_ASDC_BE_ENDPOINT} auth=${auth}
DR695Hccff30b2017-02-17 18:44:24 -0500473 ${uuid}= Generate UUID
474 ${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}
475 ${resp}= Post Request asdc ${data_path} files=${files} headers=${headers}
476 Log Received response from asdc ${resp.text}
Jerry Floode2a48d72017-06-21 15:06:29 -0400477 [Return] ${resp}
Jerry Flood6bd1afa2017-10-09 09:59:23 -0400478
DR695Hccff30b2017-02-17 18:44:24 -0500479Run ASDC Post Request
480 [Documentation] Runs an ASDC post request
Brian Freeman44b8bb32018-05-03 21:08:42 -0500481 [Arguments] ${data_path} ${data} ${user}=${ASDC_DESIGNER_USER_ID} ${MY_ASDC_BE_ENDPOINT}=${ASDC_BE_ENDPOINT}
DR695Hccff30b2017-02-17 18:44:24 -0500482 ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500483 Log Creating session ${MY_ASDC_BE_ENDPOINT}
484 ${session}= Create Session asdc ${MY_ASDC_BE_ENDPOINT} auth=${auth}
DR695Hccff30b2017-02-17 18:44:24 -0500485 ${uuid}= Generate UUID
486 ${headers}= Create Dictionary Accept=application/json Content-Type=application/json USER_ID=${user} X-TransactionId=${GLOBAL_APPLICATION_ID}-${uuid} X-FromAppId=${GLOBAL_APPLICATION_ID}
487 ${resp}= Post Request asdc ${data_path} data=${data} headers=${headers}
488 Log Received response from asdc ${resp.text}
Jerry Floode2a48d72017-06-21 15:06:29 -0400489 [Return] ${resp}
DR695Hccff30b2017-02-17 18:44:24 -0500490Run ASDC Delete Request
491 [Documentation] Runs an ASDC delete request
Brian Freeman44b8bb32018-05-03 21:08:42 -0500492 [Arguments] ${data_path} ${user}=${ASDC_DESIGNER_USER_ID} ${MY_ASDC_BE_ENDPOINT}=${ASDC_BE_ENDPOINT}
493 ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD}
494 Log Creating session ${MY_ASDC_BE_ENDPOINT}
495 ${session}= Create Session asdc ${MY_ASDC_BE_ENDPOINT} auth=${auth}
DR695Hccff30b2017-02-17 18:44:24 -0500496 ${uuid}= Generate UUID
497 ${headers}= Create Dictionary Accept=application/json Content-Type=application/json USER_ID=${user} X-TransactionId=${GLOBAL_APPLICATION_ID}-${uuid} X-FromAppId=${GLOBAL_APPLICATION_ID}
498 ${resp}= Delete Request asdc ${data_path} headers=${headers}
499 Log Received response from asdc ${resp.text}
Jerry Floode2a48d72017-06-21 15:06:29 -0400500 [Return] ${resp}
DR695Hccff30b2017-02-17 18:44:24 -0500501Open ASDC GUI
502 [Documentation] Logs in to ASDC GUI
503 [Arguments] ${PATH}
504 ## Setup Browever now being managed by the test case
505 ##Setup Browser
DR695Hbf5a3a32017-06-30 13:09:57 -0400506 Go To ${ASDC_FE_ENDPOINT}${PATH}
DR695Hccff30b2017-02-17 18:44:24 -0500507 Maximize Browser Window
Jerry Flood6bd1afa2017-10-09 09:59:23 -0400508
DR695Hccff30b2017-02-17 18:44:24 -0500509 Set Browser Implicit Wait ${GLOBAL_SELENIUM_BROWSER_IMPLICIT_WAIT}
DR695Hbf5a3a32017-06-30 13:09:57 -0400510 Log Logging in to ${ASDC_FE_ENDPOINT}${PATH}
DR695Hccff30b2017-02-17 18:44:24 -0500511 Title Should Be ASDC
Jerry Floode2a48d72017-06-21 15:06:29 -0400512 Wait Until Page Contains Element xpath=//div/a[text()='SDC'] ${GLOBAL_SELENIUM_BROWSER_WAIT_TIMEOUT}
DR695Hbf5a3a32017-06-30 13:09:57 -0400513 Log Logged in to ${ASDC_FE_ENDPOINT}${PATH}
Jerry Flood6bd1afa2017-10-09 09:59:23 -0400514
515
516Create Multi Part
517 [Arguments] ${addTo} ${partName} ${filePath} ${contentType}=${None}
518 ${fileData}= Get Binary File ${filePath}
519 ${fileDir} ${fileName}= Split Path ${filePath}
520 ${partData}= Create List ${fileName} ${fileData} ${contentType}
521 Set To Dictionary ${addTo} ${partName}=${partData}
Brian Freemanf940ee92018-05-25 21:09:05 -0500522