blob: c9edfae39439e1cf012849f55c0cbf3f25e9d614 [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
Yang Xu2ec80382018-11-01 12:30:37 -040026${ASDC_FE_CATALOG_RESOURCES_PATH} /sdc1/feProxy/rest/v1/catalog/resources
DR695Hccff30b2017-02-17 18:44:24 -050027${ASDC_CATALOG_RESOURCES_PATH} /sdc2/rest/v1/catalog/resources
28${ASDC_CATALOG_SERVICES_PATH} /sdc2/rest/v1/catalog/services
29${ASDC_CATALOG_INACTIVE_RESOURCES_PATH} /sdc2/rest/v1/inactiveComponents/resource
30${ASDC_CATALOG_INACTIVE_SERVICES_PATH} /sdc2/rest/v1/inactiveComponents/service
31${ASDC_CATALOG_LIFECYCLE_PATH} /lifecycleState
32${ASDC_CATALOG_SERVICE_RESOURCE_INSTANCE_PATH} /resourceInstance
33${ASDC_CATALOG_SERVICE_DISTRIBUTION_STATE_PATH} /distribution-state
34${ASDC_CATALOG_SERVICE_DISTRIBUTION_PATH} /distribution
35${ASDC_DISTRIBUTION_STATE_APPROVE_PATH} /approve
36${ASDC_CATALOG_SERVICE_DISTRIBUTION_ACTIVATE_PATH} /distribution/PROD/activate
37${ASDC_LICENSE_MODEL_TEMPLATE} robot/assets/templates/asdc/license_model.template
38${ASDC_KEY_GROUP_TEMPLATE} robot/assets/templates/asdc/key_group.template
39${ASDC_ENTITLEMENT_POOL_TEMPLATE} robot/assets/templates/asdc/entitlement_pool.template
40${ASDC_FEATURE_GROUP_TEMPLATE} robot/assets/templates/asdc/feature_group.template
41${ASDC_LICENSE_AGREEMENT_TEMPLATE} robot/assets/templates/asdc/license_agreement.template
42${ASDC_ACTION_TEMPLATE} robot/assets/templates/asdc/action.template
43${ASDC_SOFTWARE_PRODUCT_TEMPLATE} robot/assets/templates/asdc/software_product.template
44${ASDC_CATALOG_RESOURCE_TEMPLATE} robot/assets/templates/asdc/catalog_resource.template
45${ASDC_USER_REMARKS_TEMPLATE} robot/assets/templates/asdc/user_remarks.template
46${ASDC_CATALOG_SERVICE_TEMPLATE} robot/assets/templates/asdc/catalog_service.template
47${ASDC_RESOURCE_INSTANCE_TEMPLATE} robot/assets/templates/asdc/resource_instance.template
Yang Xu2ec80382018-11-01 12:30:37 -040048${ASDC_RESOURCE_INSTANCE_VNF_PROPERTIES_TEMPLATE} robot/assets/templates/asdc/catalog_vnf_properties.template
49${ASDC_RESOURCE_INSTANCE_VNF_INPUTS_TEMPLATE} robot/assets/templates/asdc/catalog_vnf_inputs.template
Brian Freemanf508ab22018-03-15 21:19:41 -050050${ASDC_FE_ENDPOINT} ${GLOBAL_ASDC_SERVER_PROTOCOL}://${GLOBAL_INJECTED_SDC_FE_IP_ADDR}:${GLOBAL_ASDC_FE_PORT}
51${ASDC_BE_ENDPOINT} ${GLOBAL_ASDC_SERVER_PROTOCOL}://${GLOBAL_INJECTED_SDC_BE_IP_ADDR}:${GLOBAL_ASDC_BE_PORT}
Brian Freeman44b8bb32018-05-03 21:08:42 -050052${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 -040053
DR695Hccff30b2017-02-17 18:44:24 -050054*** Keywords ***
55Distribute Model From ASDC
56 [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
Yang Xu2ec80382018-11-01 12:30:37 -040057 [Arguments] ${model_zip_path} ${catalog_service_name}= ${cds}=
jf986075010a42017-02-22 16:52:54 -050058 ${catalog_service_id}= Add ASDC Catalog Service ${catalog_service_name}
DR695Hccff30b2017-02-17 18:44:24 -050059 ${catalog_resource_ids}= Create List
Jerry Flood3a169a32017-12-01 12:39:10 -050060 ${catalog_resources}= Create Dictionary
DR695Hccff30b2017-02-17 18:44:24 -050061 : FOR ${zip} IN @{model_zip_path}
Yang Xu2ec80382018-11-01 12:30:37 -040062 \ ${loop_catalog_resource_id}= Setup ASDC Catalog Resource ${zip} ${cds}
Jerry Floode2a48d72017-06-21 15:06:29 -040063 \ Append To List ${catalog_resource_ids} ${loop_catalog_resource_id}
DR695Hccff30b2017-02-17 18:44:24 -050064 \ ${loop_catalog_resource_resp}= Get ASDC Catalog Resource ${loop_catalog_resource_id}
65 \ Add ASDC Resource Instance ${catalog_service_id} ${loop_catalog_resource_id} ${loop_catalog_resource_resp['name']}
Jerry Flood3a169a32017-12-01 12:39:10 -050066 \ Set To Dictionary ${catalog_resources} ${loop_catalog_resource_id}=${loop_catalog_resource_resp}
DR695Hccff30b2017-02-17 18:44:24 -050067 ${catalog_service_resp}= Get ASDC Catalog Service ${catalog_service_id}
68 Checkin ASDC Catalog Service ${catalog_service_id}
69 Request Certify ASDC Catalog Service ${catalog_service_id}
70 Start Certify ASDC Catalog Service ${catalog_service_id}
71 # on certify it gets a new id
72 ${catalog_service_id}= Certify ASDC Catalog Service ${catalog_service_id}
73 Approve ASDC Catalog Service ${catalog_service_id}
Brian Freeman796b9eb2018-10-08 08:23:20 -050074 : FOR ${DIST_INDEX} IN RANGE 1
Brian Freeman18df8912018-05-25 13:27:29 -050075 \ Log Distribution Attempt ${DIST_INDEX}
76 \ Distribute ASDC Catalog Service ${catalog_service_id}
77 \ ${catalog_service_resp}= Get ASDC Catalog Service ${catalog_service_id}
78 \ ${vf_module}= Find Element In Array ${loop_catalog_resource_resp['groups']} type org.openecomp.groups.VfModule
Brian Freemanf940ee92018-05-25 21:09:05 -050079 \ ${status} ${_} = Run Keyword And Ignore Error Loop Over Check Catalog Service Distributed ${catalog_service_resp['uuid']}
80 \ Exit For Loop If '${status}'=='PASS'
Brian Freeman8c002d52018-07-30 19:35:36 -050081 Should Be Equal As Strings ${status} PASS
Jerry Flood3a169a32017-12-01 12:39:10 -050082 [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 -050083
84Loop Over Check Catalog Service Distributed
Gary Wu58d58532018-07-27 16:02:51 -070085 [Arguments] ${catalog_service_id}
Brian Freemanadaa2372018-10-24 12:25:22 -050086 # SO watchdog timeout is 300 seconds need buffer
87 ${dist_status}= Set Variable FAIL
88 : FOR ${CHECK_INDEX} IN RANGE 20
89 \ ${status} ${_} = Run Keyword And Ignore Error Check Catalog Service Distributed ${catalog_service_id} ${dist_status}
Gary Wu58d58532018-07-27 16:02:51 -070090 \ Sleep 20s
Brian Freemanf940ee92018-05-25 21:09:05 -050091 \ Return From Keyword If '${status}'=='PASS'
Brian Freemanadaa2372018-10-24 12:25:22 -050092 \ Exit For Loop If '${dist_status}'=='EXIT'
Brian Freeman8c002d52018-07-30 19:35:36 -050093 Should Be Equal As Strings ${status} PASS
Brian Freeman18df8912018-05-25 13:27:29 -050094
DR695Hccff30b2017-02-17 18:44:24 -050095Setup ASDC Catalog Resource
96 [Documentation] Creates all the steps a vf needs for an asdc catalog resource and returns the id
Yang Xu2ec80382018-11-01 12:30:37 -040097 [Arguments] ${model_zip_path} ${cds}=
Brian Freemanb568e5e2018-04-05 21:03:38 -050098 ${license_model_id} ${license_model_version_id}= Add ASDC License Model
99 ${key_group_id}= Add ASDC License Group ${license_model_id} ${license_model_version_id}
100 ${pool_id}= Add ASDC Entitlement Pool ${license_model_id} ${license_model_version_id}
101 ${feature_group_id}= Add ASDC Feature Group ${license_model_id} ${key_group_id} ${pool_id} ${license_model_version_id}
102 ${license_agreement_id}= Add ASDC License Agreement ${license_model_id} ${feature_group_id} ${license_model_version_id}
103 Submit ASDC License Model ${license_model_id} ${license_model_version_id}
104 ${license_model_resp}= Get ASDC License Model ${license_model_id} ${license_model_version_id}
105 ${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}
106 Upload ASDC Heat Package ${software_product_id} ${model_zip_path} ${software_product_version_id}
107 Validate ASDC Software Product ${software_product_id} ${software_product_version_id}
108 Submit ASDC Software Product ${software_product_id} ${software_product_version_id}
109 Package ASDC Software Product ${software_product_id} ${software_product_version_id}
110 ${software_product_resp}= Get ASDC Software Product ${software_product_id} ${software_product_version_id}
111 ${catalog_resource_id}= Add ASDC Catalog Resource ${license_agreement_id} ${software_product_resp['name']} ${license_model_resp['vendorName']} ${software_product_id}
Yang Xu2ec80382018-11-01 12:30:37 -0400112 # Check if need to set up CDS properties
113 Run Keyword If '${cds}' == 'vfwng' Setup ASDC Catalog Resource CDS Properties ${catalog_resource_id}
114
Brian Freeman391680a2018-08-11 15:20:58 -0500115 ${catalog_resource_id}= Certify ASDC Catalog Resource ${catalog_resource_id} ${ASDC_DESIGNER_USER_ID}
DR695Hccff30b2017-02-17 18:44:24 -0500116 [Return] ${catalog_resource_id}
Yang Xu2ec80382018-11-01 12:30:37 -0400117Setup ASDC Catalog Resource CDS Properties
118 [Documentation] Set up vfwng VNF properties and inputs for CDS
119 [Arguments] ${catalog_resource_id}
120 # Set vnf module properties
121 ${resp}= Get ASDC Catalog Resource Component Instances ${catalog_resource_id}
122 :FOR ${comp} in @{resp['componentInstances']}
123 \ ${name} Set Variable ${comp['name']}
124 \ ${uniqueId} Set Variable ${comp['uniqueId']}
125 \ ${actualComponentUid} Set Variable ${comp['actualComponentUid']}
126 \ ${test} ${v}= Run Keyword and Ignore Error Should Contain ${name} abstract_
127 \ Run Keyword If '${test}' == 'FAIL' Continue For Loop
128 \ ${response}= Get ASDC Catalog Resource Component Instance Properties ${catalog_resource_id} ${uniqueId} ${actualComponentUid}
129 \ ${dict}= Create Dictionary parent_id=${response[6]['parentUniqueId']}
130 \ Run Keyword If '${name}'=='abstract_vfw' Set To Dictionary ${dict} nfc_function=vfw nfc_naming_policy=SDNC_Policy.ONAP_VFW_NAMING_TIMESTAMP
131 \ Run Keyword If '${name}'=='abstract_vpg' Set To Dictionary ${dict} nfc_function=vpg nfc_naming_policy=SDNC_Policy.ONAP_VPG_NAMING_TIMESTAMP
132 \ Run Keyword If '${name}'=='abstract_vsn' Set To Dictionary ${dict} nfc_function=vsn nfc_naming_policy=SDNC_Policy.ONAP_VSN_NAMING_TIMESTAMP
133 \ ${data}= Fill JSON Template File ${ASDC_RESOURCE_INSTANCE_VNF_PROPERTIES_TEMPLATE} ${dict}
134 \ ${response}= Set ASDC Catalog Resource Component Instance Properties ${catalog_resource_id} ${uniqueId} ${data}
135 \ Log To Console resp=${response}
136
137 # Set vnf inputs
138 ${resp}= Get ASDC Catalog Resource Inputs ${catalog_resource_id}
139 ${dict}= Create Dictionary
140 :FOR ${comp} in @{resp['inputs']}
141 \ ${name} Set Variable ${comp['name']}
142 \ ${uid} Set Variable ${comp['uniqueId']}
143 \ Run Keyword If '${name}'=='nf_function' Set To Dictionary ${dict} nf_function=ONAP-FIREWALL nf_function_uid=${uid}
144 \ Run Keyword If '${name}'=='nf_type' Set To Dictionary ${dict} nf_type=FIREWALL nf_type_uid=${uid}
145 \ Run Keyword If '${name}'=='nf_naming_code' Set To Dictionary ${dict} nf_naming_code=vfw nf_naming_code_uid=${uid}
146 \ Run Keyword If '${name}'=='nf_role' Set To Dictionary ${dict} nf_role=vFW nf_role_uid=${uid}
147 \ Run Keyword If '${name}'=='cloud_env' Set To Dictionary ${dict} cloud_env=openstack cloud_env_uid=${uid}
148 ${data}= Fill JSON Template File ${ASDC_RESOURCE_INSTANCE_VNF_INPUTS_TEMPLATE} ${dict}
149 ${response}= Set ASDC Catalog Resource VNF Inputs ${catalog_resource_id} ${data}
150
DR695Hccff30b2017-02-17 18:44:24 -0500151Add ASDC License Model
152 [Documentation] Creates an asdc license model and returns its id
Jerry Floode2a48d72017-06-21 15:06:29 -0400153 ${uuid}= Generate UUID
154 ${shortened_uuid}= Evaluate str("${uuid}")[:23]
DR695Hccff30b2017-02-17 18:44:24 -0500155 ${map}= Create Dictionary vendor_name=${shortened_uuid}
156 ${data}= Fill JSON Template File ${ASDC_LICENSE_MODEL_TEMPLATE} ${map}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500157 ${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 -0500158 Should Be Equal As Strings ${resp.status_code} 200
Brian Freemanb568e5e2018-04-05 21:03:38 -0500159 [Return] ${resp.json()['itemId']} ${resp.json()['version']['id']}
DR695Hccff30b2017-02-17 18:44:24 -0500160Get ASDC License Model
161 [Documentation] gets an asdc license model by its id
Jerry Floode2a48d72017-06-21 15:06:29 -0400162 [Arguments] ${id} ${version_id}=0.1
Brian Freeman44b8bb32018-05-03 21:08:42 -0500163 ${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 -0400164 [Return] ${resp.json()}
165Get ASDC License Models
166 [Documentation] gets an asdc license model by its id
Brian Freeman44b8bb32018-05-03 21:08:42 -0500167 ${resp}= Run ASDC Get Request ${ASDC_VENDOR_LICENSE_MODEL_PATH} ${ASDC_DESIGNER_USER_ID} ${ASDC_BE_ONBOARD_ENDPOINT}
168
DR695Hccff30b2017-02-17 18:44:24 -0500169 [Return] ${resp.json()}
170Checkin ASDC License Model
171 [Documentation] checksin an asdc license model 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=Checkin
174 ${data}= Fill JSON Template File ${ASDC_ACTION_TEMPLATE} ${map}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500175 ${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 -0500176 Should Be Equal As Strings ${resp.status_code} 200
177 [Return] ${resp.json()}
178Submit ASDC License Model
179 [Documentation] submits an asdc license model by its id
Jerry Floode2a48d72017-06-21 15:06:29 -0400180 [Arguments] ${id} ${version_id}=0.1
DR695Hccff30b2017-02-17 18:44:24 -0500181 ${map}= Create Dictionary action=Submit
182 ${data}= Fill JSON Template File ${ASDC_ACTION_TEMPLATE} ${map}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500183 ${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 -0500184 Should Be Equal As Strings ${resp.status_code} 200
185 [Return] ${resp.json()}
186Checkin ASDC Software Product
187 [Documentation] checksin an asdc Software Product by its id
Jerry Floode2a48d72017-06-21 15:06:29 -0400188 [Arguments] ${id} ${version_id}=0.1
DR695Hccff30b2017-02-17 18:44:24 -0500189 ${map}= Create Dictionary action=Checkin
Jerry Floode2a48d72017-06-21 15:06:29 -0400190 ${data}= Fill JSON Template File ${ASDC_ACTION_TEMPLATE} ${map}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500191 ${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 -0400192 Should Be Equal As Strings ${resp.status_code} 200
193 [Return] ${resp.json()}
194Validate ASDC Software Product
195 [Documentation] checksin an asdc Software Product by its id
196 [Arguments] ${id} ${version_id}=0.1
197 ${data}= Catenate
Brian Freeman44b8bb32018-05-03 21:08:42 -0500198 ${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 -0500199 Should Be Equal As Strings ${resp.status_code} 200
200 [Return] ${resp.json()}
201Submit ASDC Software Product
202 [Documentation] submits an asdc Software Product by its id
Jerry Floode2a48d72017-06-21 15:06:29 -0400203 [Arguments] ${id} ${version_id}=0.1
DR695Hccff30b2017-02-17 18:44:24 -0500204 ${map}= Create Dictionary action=Submit
Jerry Floode2a48d72017-06-21 15:06:29 -0400205 ${data}= Fill JSON Template File ${ASDC_ACTION_TEMPLATE} ${map}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500206 ${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 -0500207 Should Be Equal As Strings ${resp.status_code} 200
208 [Return] ${resp.json()}
209Package ASDC Software Product
210 [Documentation] creates_package on an asdc Software Product by its id
Jerry Floode2a48d72017-06-21 15:06:29 -0400211 [Arguments] ${id} ${version_id}=0.1
DR695Hccff30b2017-02-17 18:44:24 -0500212 ${map}= Create Dictionary action=Create_Package
Jerry Floode2a48d72017-06-21 15:06:29 -0400213 ${data}= Fill JSON Template File ${ASDC_ACTION_TEMPLATE} ${map}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500214 ${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 -0500215 Should Be Equal As Strings ${resp.status_code} 200
Jerry Floode2a48d72017-06-21 15:06:29 -0400216 [Return] ${resp.json()}
DR695Hccff30b2017-02-17 18:44:24 -0500217Add ASDC Entitlement Pool
218 [Documentation] Creates an asdc Entitlement Pool and returns its id
Jerry Floode2a48d72017-06-21 15:06:29 -0400219 [Arguments] ${license_model_id} ${version_id}=0.1
220 ${uuid}= Generate UUID
221 ${shortened_uuid}= Evaluate str("${uuid}")[:23]
DR695Hccff30b2017-02-17 18:44:24 -0500222 ${map}= Create Dictionary entitlement_pool_name=${shortened_uuid}
Jerry Floode2a48d72017-06-21 15:06:29 -0400223 ${data}= Fill JSON Template File ${ASDC_ENTITLEMENT_POOL_TEMPLATE} ${map}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500224 ${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 -0500225 Should Be Equal As Strings ${resp.status_code} 200
226 [Return] ${resp.json()['value']}
227Get ASDC Entitlement Pool
228 [Documentation] gets an asdc Entitlement Pool by its id
229 [Arguments] ${license_model_id} ${pool_id}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500230 ${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 -0500231 [Return] ${resp.json()}
232Add ASDC License Group
233 [Documentation] Creates an asdc license group and returns its id
Brian Freemanb568e5e2018-04-05 21:03:38 -0500234 [Arguments] ${license_model_id} ${version_id}=1.0
Jerry Floode2a48d72017-06-21 15:06:29 -0400235 ${uuid}= Generate UUID
236 ${shortened_uuid}= Evaluate str("${uuid}")[:23]
DR695Hccff30b2017-02-17 18:44:24 -0500237 ${map}= Create Dictionary key_group_name=${shortened_uuid}
Jerry Floode2a48d72017-06-21 15:06:29 -0400238 ${data}= Fill JSON Template File ${ASDC_KEY_GROUP_TEMPLATE} ${map}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500239 ${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 -0500240 Should Be Equal As Strings ${resp.status_code} 200
241 [Return] ${resp.json()['value']}
242Get ASDC License Group
243 [Documentation] gets an asdc license group by its id
Jerry Floode2a48d72017-06-21 15:06:29 -0400244 [Arguments] ${license_model_id} ${group_id} ${version_id}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500245 ${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 -0500246 [Return] ${resp.json()}
247Add ASDC Feature Group
248 [Documentation] Creates an asdc Feature Group and returns its id
Jerry Floode2a48d72017-06-21 15:06:29 -0400249 [Arguments] ${license_model_id} ${key_group_id} ${entitlement_pool_id} ${version_id}=0.1
250 ${uuid}= Generate UUID
251 ${shortened_uuid}= Evaluate str("${uuid}")[:23]
Jerry Flood80ff9852017-08-11 06:47:14 -0400252 ${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 -0400253 ${data}= Fill JSON Template File ${ASDC_FEATURE_GROUP_TEMPLATE} ${map}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500254 ${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 -0500255 Should Be Equal As Strings ${resp.status_code} 200
256 [Return] ${resp.json()['value']}
257Get ASDC Feature Group
258 [Documentation] gets an asdc Feature Group by its id
259 [Arguments] ${license_model_id} ${group_id}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500260 ${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 -0500261 [Return] ${resp.json()}
262Add ASDC License Agreement
263 [Documentation] Creates an asdc License Agreement and returns its id
Jerry Floode2a48d72017-06-21 15:06:29 -0400264 [Arguments] ${license_model_id} ${feature_group_id} ${version_id}=0.1
265 ${uuid}= Generate UUID
266 ${shortened_uuid}= Evaluate str("${uuid}")[:23]
DR695Hccff30b2017-02-17 18:44:24 -0500267 ${map}= Create Dictionary license_agreement_name=${shortened_uuid} feature_group_id=${feature_group_id}
Jerry Floode2a48d72017-06-21 15:06:29 -0400268 ${data}= Fill JSON Template File ${ASDC_LICENSE_AGREEMENT_TEMPLATE} ${map}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500269 ${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 -0500270 Should Be Equal As Strings ${resp.status_code} 200
271 [Return] ${resp.json()['value']}
272Get ASDC License Agreement
273 [Documentation] gets an asdc License Agreement by its id
274 [Arguments] ${license_model_id} ${agreement_id}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500275 ${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 -0500276 [Return] ${resp.json()}
277Add ASDC Software Product
278 [Documentation] Creates an asdc Software Product and returns its id
Brian Freemanb568e5e2018-04-05 21:03:38 -0500279 [Arguments] ${license_agreement_id} ${feature_group_id} ${license_model_name} ${license_model_id} ${license_model_version_id}
Jerry Floode2a48d72017-06-21 15:06:29 -0400280 ${uuid}= Generate UUID
281 ${shortened_uuid}= Evaluate str("${uuid}")[:23]
Brian Freemanb568e5e2018-04-05 21:03:38 -0500282 ${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 -0400283 ${data}= Fill JSON Template File ${ASDC_SOFTWARE_PRODUCT_TEMPLATE} ${map}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500284 ${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 -0500285 Should Be Equal As Strings ${resp.status_code} 200
Brian Freemanb568e5e2018-04-05 21:03:38 -0500286 [Return] ${resp.json()['itemId']} ${resp.json()['version']['id']}
DR695Hccff30b2017-02-17 18:44:24 -0500287Get ASDC Software Product
288 [Documentation] gets an asdc Software Product by its id
Jerry Floode2a48d72017-06-21 15:06:29 -0400289 [Arguments] ${software_product_id} ${version_id}=0.1
Brian Freeman44b8bb32018-05-03 21:08:42 -0500290 ${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 -0500291 [Return] ${resp.json()}
292Add ASDC Catalog Resource
293 [Documentation] Creates an asdc Catalog Resource and returns its id
294 [Arguments] ${license_agreement_id} ${software_product_name} ${license_model_name} ${software_product_id}
295 ${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 -0400296 ${data}= Fill JSON Template File ${ASDC_CATALOG_RESOURCE_TEMPLATE} ${map}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500297 ${resp}= Run ASDC Post Request ${ASDC_CATALOG_RESOURCES_PATH} ${data} ${ASDC_DESIGNER_USER_ID}
DR695Hccff30b2017-02-17 18:44:24 -0500298 Should Be Equal As Strings ${resp.status_code} 201
299 [Return] ${resp.json()['uniqueId']}
300Mark ASDC Catalog Resource Inactive
301 [Documentation] deletes an asdc Catalog Resource
302 [Arguments] ${catalog_resource_id}
303 ${resp}= Run ASDC Delete Request ${ASDC_CATALOG_RESOURCES_PATH}/${catalog_resource_id} ${ASDC_DESIGNER_USER_ID}
304 Should Be Equal As Strings ${resp.status_code} 204
305 [Return] ${resp}
306Delete Inactive ASDC Catalog Resources
307 [Documentation] delete all asdc Catalog Resources that are inactive
308 ${resp}= Run ASDC Delete Request ${ASDC_CATALOG_INACTIVE_RESOURCES_PATH} ${ASDC_DESIGNER_USER_ID}
309 Should Be Equal As Strings ${resp.status_code} 200
310 [Return] ${resp.json()}
311Get ASDC Catalog Resource
312 [Documentation] gets an asdc Catalog Resource by its id
313 [Arguments] ${catalog_resource_id}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500314 ${resp}= Run ASDC Get Request ${ASDC_CATALOG_RESOURCES_PATH}/${catalog_resource_id} ${ASDC_DESIGNER_USER_ID}
DR695Hccff30b2017-02-17 18:44:24 -0500315 [Return] ${resp.json()}
Yang Xu2ec80382018-11-01 12:30:37 -0400316Get ASDC Catalog Resource Component Instances
317 [Documentation] gets asdc Catalog Resource Component Instances by its id
318 [Arguments] ${catalog_resource_id}
319 ${resp}= Run ASDC Get Request ${ASDC_FE_CATALOG_RESOURCES_PATH}/${catalog_resource_id}/filteredDataByParams?include=componentInstances ${ASDC_DESIGNER_USER_ID} ${ASDC_FE_ENDPOINT}
320 [Return] ${resp.json()}
321Get ASDC Catalog Resource Inputs
322 [Documentation] gets asdc Catalog Inputs by its id
323 [Arguments] ${catalog_resource_id}
324 ${resp}= Run ASDC Get Request ${ASDC_FE_CATALOG_RESOURCES_PATH}/${catalog_resource_id}/filteredDataByParams?include=inputs ${ASDC_DESIGNER_USER_ID} ${ASDC_FE_ENDPOINT}
325 [Return] ${resp.json()}
326Get ASDC Catalog Resource Component Instance Properties
327 [Documentation] gets an asdc Catalog Resource properties by its id
328 [Arguments] ${catalog_resource_id} ${component_instance_id} ${component_id}
329 ${resp}= Run ASDC Get Request ${ASDC_FE_CATALOG_RESOURCES_PATH}/${catalog_resource_id}/componentInstances/${component_instance_id}/${component_id}/inputs ${ASDC_DESIGNER_USER_ID} ${ASDC_FE_ENDPOINT}
330 [Return] ${resp.json()}
331Set ASDC Catalog Resource Component Instance Properties
332 [Documentation] sets an asdc Catalog Resource by its id
333 [Arguments] ${catalog_resource_id} ${component_instance_id} ${data}
334 ${resp}= Run ASDC Post Request ${ASDC_FE_CATALOG_RESOURCES_PATH}/${catalog_resource_id}/resourceInstance/${component_instance_id}/inputs ${data} ${ASDC_DESIGNER_USER_ID} ${ASDC_FE_ENDPOINT}
335 [Return] ${resp.json()}
336Set ASDC Catalog Resource VNF Inputs
337 [Documentation] sets an asdc Catalog Resource by its id
338 [Arguments] ${catalog_resource_id} ${data}
339 ${resp}= Run ASDC Post Request ${ASDC_FE_CATALOG_RESOURCES_PATH}/${catalog_resource_id}/update/inputs ${data} ${ASDC_DESIGNER_USER_ID} ${ASDC_FE_ENDPOINT}
340 [Return] ${resp.json()}
Brian Freeman79b00ce2018-11-01 14:57:53 -0500341Get SDC Demo Vnf Catalog Resource
342 [Documentation] gets resource id's for demonstration VNFs for instantiate
343 [Arguments] ${service_name}
344 ${resp}= Run ASDC Get Request ${ASDC_CATALOG_SERVICES_PATH}/serviceName/${service_name}/serviceVersion/1.0
345 @{ITEMS}= Copy List ${resp.json()['componentInstances']}
346 ${demo_catalog_resource}= Create Dictionary
347 :FOR ${ELEMENT} IN @{ITEMS}
348 \ Log ${ELEMENT['name']}
349 \ Log ${ELEMENT['groupInstances'][0]['groupName']}
350 \ ${vnf}= Get VNF From Group Name ${ELEMENT['groupInstances'][0]['groupName']} ${service_name}
351 \ ${vnf_data}= Create Dictionary vnf_type=${ELEMENT['name']} vf_module=${ELEMENT['groupInstances'][0]['groupName']}
352 \ LOG ${vnf_data}
353 \ Set To Dictionary ${demo_catalog_resource} ${vnf}=${vnf_data}
354 \ LOG ${demo_catalog_resource}
355 [Return] ${demo_catalog_resource}
356
357Get VNF From Group Name
358 [Documentation] looks up vnf key from service mapping for a regex on groupName and service_name
359 [Arguments] ${group_name} ${service_name}
360 ${vnf}= Set Variable If
361 ... ('${service_name}'=='demoVFWCL') and ('base_vfw' in '${group_name}') vFWSNK
362 ... ('${service_name}'=='demoVFWCL') and ('base_vpkg' in '${group_name}') vPKG
363 ... ('${service_name}'=='demoVLB') and ('base_vlb' in '${group_name}') vLB
364 [Return] ${vnf}
DR695Hccff30b2017-02-17 18:44:24 -0500365Checkin ASDC Catalog Resource
366 [Documentation] checksin an asdc Catalog Resource by its id
367 [Arguments] ${catalog_resource_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_RESOURCES_PATH}/${catalog_resource_id}${ASDC_CATALOG_LIFECYCLE_PATH}/checkin ${data} ${ASDC_DESIGNER_USER_ID}
371 Should Be Equal As Strings ${resp.status_code} 200
372 [Return] ${resp.json()}
373Request Certify ASDC Catalog Resource
374 [Documentation] requests certify on an asdc Catalog Resource by its id
375 [Arguments] ${catalog_resource_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_RESOURCES_PATH}/${catalog_resource_id}${ASDC_CATALOG_LIFECYCLE_PATH}/certificationRequest ${data} ${ASDC_DESIGNER_USER_ID}
379 Should Be Equal As Strings ${resp.status_code} 200
380 [Return] ${resp.json()}
381Start Certify ASDC Catalog Resource
382 [Documentation] start certify an asdc Catalog Resource by its id
383 [Arguments] ${catalog_resource_id}
384 ${resp}= Run ASDC Post Request ${ASDC_CATALOG_RESOURCES_PATH}/${catalog_resource_id}${ASDC_CATALOG_LIFECYCLE_PATH}/startCertification ${None} ${ASDC_TESTER_USER_ID}
385 Should Be Equal As Strings ${resp.status_code} 200
386 [Return] ${resp.json()}
387Certify ASDC Catalog Resource
388 [Documentation] start certify an asdc Catalog Resource by its id and returns the new id
Brian Freemandb1e7412018-08-01 12:46:01 -0500389 [Arguments] ${catalog_resource_id} ${user_id}=${ASDC_TESTER_USER_ID}
DR695Hccff30b2017-02-17 18:44:24 -0500390 ${map}= Create Dictionary user_remarks=Robot remarks
Jerry Floode2a48d72017-06-21 15:06:29 -0400391 ${data}= Fill JSON Template File ${ASDC_USER_REMARKS_TEMPLATE} ${map}
Brian Freemandb1e7412018-08-01 12:46:01 -0500392 ${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 -0500393 Should Be Equal As Strings ${resp.status_code} 200
394 [Return] ${resp.json()['uniqueId']}
Jerry Flood6bd1afa2017-10-09 09:59:23 -0400395
DR695Hccff30b2017-02-17 18:44:24 -0500396Upload ASDC Heat Package
Brian Freemanf508ab22018-03-15 21:19:41 -0500397 [Documentation] Creates an asdc Software Product and returns its id
398 [Arguments] ${software_product_id} ${file_path} ${version_id}=0.1
Jerry Flood6bd1afa2017-10-09 09:59:23 -0400399 ${files}= Create Dictionary
400 Create Multi Part ${files} upload ${file_path} contentType=application/zip
Brian Freeman44b8bb32018-05-03 21:08:42 -0500401 ${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 -0500402 Should Be Equal As Strings ${resp.status_code} 200
Jerry Flood6bd1afa2017-10-09 09:59:23 -0400403
DR695Hccff30b2017-02-17 18:44:24 -0500404Add ASDC Catalog Service
405 [Documentation] Creates an asdc Catalog Service and returns its id
jf986075010a42017-02-22 16:52:54 -0500406 [Arguments] ${catalog_service_name}
Jerry Floode2a48d72017-06-21 15:06:29 -0400407 ${uuid}= Generate UUID
jf986075010a42017-02-22 16:52:54 -0500408 ${shortened_uuid}= Evaluate str("${uuid}")[:23]
Jerry Floode2a48d72017-06-21 15:06:29 -0400409 ${catalog_service_name}= Set Variable If '${catalog_service_name}' =='' ${shortened_uuid} ${catalog_service_name}
jf986075010a42017-02-22 16:52:54 -0500410 ${map}= Create Dictionary service_name=${catalog_service_name}
Jerry Floode2a48d72017-06-21 15:06:29 -0400411 ${data}= Fill JSON Template File ${ASDC_CATALOG_SERVICE_TEMPLATE} ${map}
DR695Hccff30b2017-02-17 18:44:24 -0500412 ${resp}= Run ASDC Post Request ${ASDC_CATALOG_SERVICES_PATH} ${data} ${ASDC_DESIGNER_USER_ID}
413 Should Be Equal As Strings ${resp.status_code} 201
414 [Return] ${resp.json()['uniqueId']}
415Mark ASDC Catalog Service Inactive
416 [Documentation] Deletes an asdc Catalog Service
417 [Arguments] ${catalog_service_id}
418 ${resp}= Run ASDC Delete Request ${ASDC_CATALOG_SERVICES_PATH}/${catalog_service_id} ${ASDC_DESIGNER_USER_ID}
419 Should Be Equal As Strings ${resp.status_code} 204
420 [Return] ${resp}
421Delete Inactive ASDC Catalog Services
422 [Documentation] delete all asdc Catalog Serivces that are inactive
423 ${resp}= Run ASDC Delete Request ${ASDC_CATALOG_INACTIVE_SERVICES_PATH} ${ASDC_DESIGNER_USER_ID}
424 Should Be Equal As Strings ${resp.status_code} 200
425 [Return] ${resp.json()}
426Get ASDC Catalog Service
427 [Documentation] gets an asdc Catalog Service by its id
428 [Arguments] ${catalog_service_id}
429 ${resp}= Run ASDC Get Request ${ASDC_CATALOG_SERVICES_PATH}/${catalog_service_id} ${ASDC_DESIGNER_USER_ID}
430 [Return] ${resp.json()}
431Checkin ASDC Catalog Service
432 [Documentation] checksin an asdc Catalog Service by its id
433 [Arguments] ${catalog_service_id}
434 ${map}= Create Dictionary user_remarks=Robot remarks
Jerry Floode2a48d72017-06-21 15:06:29 -0400435 ${data}= Fill JSON Template File ${ASDC_USER_REMARKS_TEMPLATE} ${map}
DR695Hccff30b2017-02-17 18:44:24 -0500436 ${resp}= Run ASDC Post Request ${ASDC_CATALOG_SERVICES_PATH}/${catalog_service_id}${ASDC_CATALOG_LIFECYCLE_PATH}/checkin ${data} ${ASDC_DESIGNER_USER_ID}
437 Should Be Equal As Strings ${resp.status_code} 200
438 [Return] ${resp.json()}
439Request Certify ASDC Catalog Service
440 [Documentation] requests certify on an asdc Catalog Service by its id
441 [Arguments] ${catalog_service_id}
442 ${map}= Create Dictionary user_remarks=Robot remarks
Jerry Floode2a48d72017-06-21 15:06:29 -0400443 ${data}= Fill JSON Template File ${ASDC_USER_REMARKS_TEMPLATE} ${map}
DR695Hccff30b2017-02-17 18:44:24 -0500444 ${resp}= Run ASDC Post Request ${ASDC_CATALOG_SERVICES_PATH}/${catalog_service_id}${ASDC_CATALOG_LIFECYCLE_PATH}/certificationRequest ${data} ${ASDC_DESIGNER_USER_ID}
445 Should Be Equal As Strings ${resp.status_code} 200
446 [Return] ${resp.json()}
447Start Certify ASDC Catalog Service
448 [Documentation] start certify an asdc Catalog Service by its id
449 [Arguments] ${catalog_service_id}
450 ${resp}= Run ASDC Post Request ${ASDC_CATALOG_SERVICES_PATH}/${catalog_service_id}${ASDC_CATALOG_LIFECYCLE_PATH}/startCertification ${None} ${ASDC_TESTER_USER_ID}
451 Should Be Equal As Strings ${resp.status_code} 200
452 [Return] ${resp.json()}
453Certify ASDC Catalog Service
454 [Documentation] start certify an asdc Catalog Service by its id and returns the new id
455 [Arguments] ${catalog_service_id}
456 ${map}= Create Dictionary user_remarks=Robot remarks
Jerry Floode2a48d72017-06-21 15:06:29 -0400457 ${data}= Fill JSON Template File ${ASDC_USER_REMARKS_TEMPLATE} ${map}
DR695Hccff30b2017-02-17 18:44:24 -0500458 ${resp}= Run ASDC Post Request ${ASDC_CATALOG_SERVICES_PATH}/${catalog_service_id}${ASDC_CATALOG_LIFECYCLE_PATH}/certify ${data} ${ASDC_TESTER_USER_ID}
459 Should Be Equal As Strings ${resp.status_code} 200
460 [Return] ${resp.json()['uniqueId']}
461Approve ASDC Catalog Service
462 [Documentation] approve an asdc Catalog Service by its id
463 [Arguments] ${catalog_service_id}
464 ${map}= Create Dictionary user_remarks=Robot remarks
Jerry Floode2a48d72017-06-21 15:06:29 -0400465 ${data}= Fill JSON Template File ${ASDC_USER_REMARKS_TEMPLATE} ${map}
DR695Hccff30b2017-02-17 18:44:24 -0500466 ${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}
467 Should Be Equal As Strings ${resp.status_code} 200
468 [Return] ${resp.json()}
469Distribute ASDC Catalog Service
470 [Documentation] distribute an asdc Catalog Service by its id
471 [Arguments] ${catalog_service_id}
472 ${resp}= Run ASDC Post Request ${ASDC_CATALOG_SERVICES_PATH}/${catalog_service_id}${ASDC_CATALOG_SERVICE_DISTRIBUTION_ACTIVATE_PATH} ${None} ${ASDC_OPS_USER_ID}
473 Should Be Equal As Strings ${resp.status_code} 200
474 [Return] ${resp.json()}
475Add ASDC Resource Instance
476 [Documentation] Creates an asdc Resource Instance and returns its id
477 [Arguments] ${catalog_service_id} ${catalog_resource_id} ${catalog_resource_name}
478 ${milli_timestamp}= Generate MilliTimestamp UUID
479 ${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 -0400480 ${data}= Fill JSON Template File ${ASDC_RESOURCE_INSTANCE_TEMPLATE} ${map}
DR695Hccff30b2017-02-17 18:44:24 -0500481 ${resp}= Run ASDC Post Request ${ASDC_CATALOG_SERVICES_PATH}/${catalog_service_id}${ASDC_CATALOG_SERVICE_RESOURCE_INSTANCE_PATH} ${data} ${ASDC_DESIGNER_USER_ID}
482 Should Be Equal As Strings ${resp.status_code} 201
483 [Return] ${resp.json()['uniqueId']}
484Get Catalog Service Distribution
485 [Documentation] gets an asdc catalog Service distrbution
486 [Arguments] ${catalog_service_uuid}
487 ${resp}= Run ASDC Get Request ${ASDC_CATALOG_SERVICES_PATH}/${catalog_service_uuid}${ASDC_CATALOG_SERVICE_DISTRIBUTION_PATH} ${ASDC_OPS_USER_ID}
488 Should Be Equal As Strings ${resp.status_code} 200
489 [Return] ${resp.json()}
490Check Catalog Service Distributed
491 [Documentation] gets an asdc catalog Service distrbution
Brian Freemanadaa2372018-10-24 12:25:22 -0500492 [Arguments] ${catalog_service_uuid} ${dist_status}
DR695Hccff30b2017-02-17 18:44:24 -0500493 ${dist_resp}= Get Catalog Service Distribution ${catalog_service_uuid}
494 Should Be Equal As Strings ${dist_resp['distributionStatusOfServiceList'][0]['deployementStatus']} Distributed
495 ${det_resp}= Get Catalog Service Distribution Details ${dist_resp['distributionStatusOfServiceList'][0]['distributionID']}
496 @{ITEMS}= Copy List ${det_resp['distributionStatusList']}
Brian Freemanf508ab22018-03-15 21:19:41 -0500497 Should Not Be Empty ${ITEMS}
Brian Freemana62644f2018-05-13 12:47:38 -0500498 ${SO_COMPLETE} Set Variable FALSE
DR695Hccff30b2017-02-17 18:44:24 -0500499 :FOR ${ELEMENT} IN @{ITEMS}
Brian Freemanf508ab22018-03-15 21:19:41 -0500500 \ Log ${ELEMENT['omfComponentID']}
DR695Hccff30b2017-02-17 18:44:24 -0500501 \ Log ${ELEMENT['status']}
Brian Freeman41ab5e52018-08-08 14:24:23 -0500502 \ ${SO_COMPLETE} Set Variable If (('${ELEMENT['status']}' == 'DISTRIBUTION_COMPLETE_OK')) or ('${SO_COMPLETE}'=='TRUE') TRUE
Brian Freemaneca71072018-08-16 14:50:16 -0500503 \ Exit For Loop If ('${SO_COMPLETE}'=='TRUE')
504 \ Exit For Loop If ('${ELEMENT['status']}' == 'DISTRIBUTION_COMPLETE_ERROR')
Brian Freemanadaa2372018-10-24 12:25:22 -0500505 \ ${dist_status}= Set Variable If (('${ELEMENT['status']}' == 'COMPONENT_DONE_ERROR') and ('${ELEMENT['omfComponentID']}' == 'aai-ml')) EXIT
506 \ Exit For Loop If (('${ELEMENT['status']}' == 'COMPONENT_DONE_ERROR') and ('${ELEMENT['omfComponentID']}' == 'aai-ml'))
Brian Freemana62644f2018-05-13 12:47:38 -0500507 Should Be True ( '${SO_COMPLETE}'=='TRUE') SO Test
DR695Hccff30b2017-02-17 18:44:24 -0500508Get Catalog Service Distribution Details
509 [Documentation] gets an asdc catalog Service distrbution details
510 [Arguments] ${catalog_service_distribution_id}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500511 ${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 -0500512 Should Be Equal As Strings ${resp.status_code} 200
513 [Return] ${resp.json()}
514Run ASDC Health Check
515 [Documentation] Runs a ASDC health check
DR695Hbf5a3a32017-06-30 13:09:57 -0400516 ${session}= Create Session asdc ${ASDC_FE_ENDPOINT}
DR695Hccff30b2017-02-17 18:44:24 -0500517 ${uuid}= Generate UUID
518 ${headers}= Create Dictionary Accept=application/json Content-Type=application/json X-TransactionId=${GLOBAL_APPLICATION_ID}-${uuid} X-FromAppId=${GLOBAL_APPLICATION_ID}
519 ${resp}= Get Request asdc ${ASDC_HEALTH_CHECK_PATH} headers=${headers}
Brian Freemanadaa2372018-10-24 12:25:22 -0500520 # only test for HTTP 200 to determine SDC Health. SDC_DE_HEALTH is informational
Brian Freeman00f125e2018-09-05 13:03:48 -0500521 Should Be Equal As Strings ${resp.status_code} 200 SDC DOWN
Brian Freeman5cf5fa62018-04-23 20:28:16 -0500522 ${SDC_DE_HEALTH}= Catenate DOWN
DR695Hccff30b2017-02-17 18:44:24 -0500523 @{ITEMS}= Copy List ${resp.json()['componentsInfo']}
524 :FOR ${ELEMENT} IN @{ITEMS}
525 \ Log ${ELEMENT['healthCheckStatus']}
Brian Freemane546f7e2018-04-19 12:17:56 -0500526 \ ${SDC_DE_HEALTH} Set Variable If (('DE' in '${ELEMENT['healthCheckComponent']}') and ('${ELEMENT['healthCheckStatus']}' == 'UP')) or ('${SDC_DE_HEALTH}'=='UP') UP
Gary Wu03f549f2018-10-24 14:02:23 -0700527 Log To Console SDC DMaaP Interface Health: ${SDC_DE_HEALTH}
DR695Hccff30b2017-02-17 18:44:24 -0500528Run ASDC Get Request
529 [Documentation] Runs an ASDC get request
Brian Freeman44b8bb32018-05-03 21:08:42 -0500530 [Arguments] ${data_path} ${user}=${ASDC_DESIGNER_USER_ID} ${MY_ASDC_BE_ENDPOINT}=${ASDC_BE_ENDPOINT}
DR695Hccff30b2017-02-17 18:44:24 -0500531 ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500532 Log Creating session ${MY_ASDC_BE_ENDPOINT}
533 ${session}= Create Session asdc ${MY_ASDC_BE_ENDPOINT} auth=${auth}
DR695Hccff30b2017-02-17 18:44:24 -0500534 ${uuid}= Generate UUID
535 ${headers}= Create Dictionary Accept=application/json Content-Type=application/json USER_ID=${user} X-TransactionId=${GLOBAL_APPLICATION_ID}-${uuid} X-FromAppId=${GLOBAL_APPLICATION_ID}
536 ${resp}= Get Request asdc ${data_path} headers=${headers}
537 Log Received response from asdc ${resp.text}
538 [Return] ${resp}
539Run ASDC Put Request
540 [Documentation] Runs an ASDC put request
Brian Freeman44b8bb32018-05-03 21:08:42 -0500541 [Arguments] ${data_path} ${data} ${user}=${ASDC_DESIGNER_USER_ID} ${MY_ASDC_BE_ENDPOINT}=${ASDC_BE_ENDPOINT}
DR695Hccff30b2017-02-17 18:44:24 -0500542 ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500543 Log Creating session ${MY_ASDC_BE_ENDPOINT}
544 ${session}= Create Session asdc ${MY_ASDC_BE_ENDPOINT} auth=${auth}
DR695Hccff30b2017-02-17 18:44:24 -0500545 ${uuid}= Generate UUID
546 ${headers}= Create Dictionary Accept=application/json Content-Type=application/json USER_ID=${user} X-TransactionId=${GLOBAL_APPLICATION_ID}-${uuid} X-FromAppId=${GLOBAL_APPLICATION_ID}
547 ${resp}= Put Request asdc ${data_path} data=${data} headers=${headers}
548 Log Received response from asdc ${resp.text}
549 [Return] ${resp}
Jerry Flood6bd1afa2017-10-09 09:59:23 -0400550
DR695Hccff30b2017-02-17 18:44:24 -0500551Run ASDC Post Files Request
552 [Documentation] Runs an ASDC post request
Brian Freeman44b8bb32018-05-03 21:08:42 -0500553 [Arguments] ${data_path} ${files} ${user}=${ASDC_DESIGNER_USER_ID} ${MY_ASDC_BE_ENDPOINT}=${ASDC_BE_ENDPOINT}
DR695Hccff30b2017-02-17 18:44:24 -0500554 ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500555 Log Creating session ${MY_ASDC_BE_ENDPOINT}
556 ${session}= Create Session asdc ${MY_ASDC_BE_ENDPOINT} auth=${auth}
DR695Hccff30b2017-02-17 18:44:24 -0500557 ${uuid}= Generate UUID
558 ${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}
559 ${resp}= Post Request asdc ${data_path} files=${files} headers=${headers}
560 Log Received response from asdc ${resp.text}
Jerry Floode2a48d72017-06-21 15:06:29 -0400561 [Return] ${resp}
Jerry Flood6bd1afa2017-10-09 09:59:23 -0400562
DR695Hccff30b2017-02-17 18:44:24 -0500563Run ASDC Post Request
564 [Documentation] Runs an ASDC post request
Brian Freeman44b8bb32018-05-03 21:08:42 -0500565 [Arguments] ${data_path} ${data} ${user}=${ASDC_DESIGNER_USER_ID} ${MY_ASDC_BE_ENDPOINT}=${ASDC_BE_ENDPOINT}
DR695Hccff30b2017-02-17 18:44:24 -0500566 ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD}
Brian Freeman44b8bb32018-05-03 21:08:42 -0500567 Log Creating session ${MY_ASDC_BE_ENDPOINT}
568 ${session}= Create Session asdc ${MY_ASDC_BE_ENDPOINT} auth=${auth}
DR695Hccff30b2017-02-17 18:44:24 -0500569 ${uuid}= Generate UUID
570 ${headers}= Create Dictionary Accept=application/json Content-Type=application/json USER_ID=${user} X-TransactionId=${GLOBAL_APPLICATION_ID}-${uuid} X-FromAppId=${GLOBAL_APPLICATION_ID}
571 ${resp}= Post Request asdc ${data_path} data=${data} headers=${headers}
572 Log Received response from asdc ${resp.text}
Jerry Floode2a48d72017-06-21 15:06:29 -0400573 [Return] ${resp}
DR695Hccff30b2017-02-17 18:44:24 -0500574Run ASDC Delete Request
575 [Documentation] Runs an ASDC delete request
Brian Freeman44b8bb32018-05-03 21:08:42 -0500576 [Arguments] ${data_path} ${user}=${ASDC_DESIGNER_USER_ID} ${MY_ASDC_BE_ENDPOINT}=${ASDC_BE_ENDPOINT}
577 ${auth}= Create List ${GLOBAL_ASDC_BE_USERNAME} ${GLOBAL_ASDC_BE_PASSWORD}
578 Log Creating session ${MY_ASDC_BE_ENDPOINT}
579 ${session}= Create Session asdc ${MY_ASDC_BE_ENDPOINT} auth=${auth}
DR695Hccff30b2017-02-17 18:44:24 -0500580 ${uuid}= Generate UUID
581 ${headers}= Create Dictionary Accept=application/json Content-Type=application/json USER_ID=${user} X-TransactionId=${GLOBAL_APPLICATION_ID}-${uuid} X-FromAppId=${GLOBAL_APPLICATION_ID}
582 ${resp}= Delete Request asdc ${data_path} headers=${headers}
583 Log Received response from asdc ${resp.text}
Jerry Floode2a48d72017-06-21 15:06:29 -0400584 [Return] ${resp}
DR695Hccff30b2017-02-17 18:44:24 -0500585Open ASDC GUI
586 [Documentation] Logs in to ASDC GUI
587 [Arguments] ${PATH}
588 ## Setup Browever now being managed by the test case
589 ##Setup Browser
DR695Hbf5a3a32017-06-30 13:09:57 -0400590 Go To ${ASDC_FE_ENDPOINT}${PATH}
DR695Hccff30b2017-02-17 18:44:24 -0500591 Maximize Browser Window
Jerry Flood6bd1afa2017-10-09 09:59:23 -0400592
DR695Hccff30b2017-02-17 18:44:24 -0500593 Set Browser Implicit Wait ${GLOBAL_SELENIUM_BROWSER_IMPLICIT_WAIT}
DR695Hbf5a3a32017-06-30 13:09:57 -0400594 Log Logging in to ${ASDC_FE_ENDPOINT}${PATH}
DR695Hccff30b2017-02-17 18:44:24 -0500595 Title Should Be ASDC
Jerry Floode2a48d72017-06-21 15:06:29 -0400596 Wait Until Page Contains Element xpath=//div/a[text()='SDC'] ${GLOBAL_SELENIUM_BROWSER_WAIT_TIMEOUT}
DR695Hbf5a3a32017-06-30 13:09:57 -0400597 Log Logged in to ${ASDC_FE_ENDPOINT}${PATH}
Jerry Flood6bd1afa2017-10-09 09:59:23 -0400598
599
600Create Multi Part
601 [Arguments] ${addTo} ${partName} ${filePath} ${contentType}=${None}
602 ${fileData}= Get Binary File ${filePath}
603 ${fileDir} ${fileName}= Split Path ${filePath}
604 ${partData}= Create List ${fileName} ${fileData} ${contentType}
605 Set To Dictionary ${addTo} ${partName}=${partData}
Brian Freemanf940ee92018-05-25 21:09:05 -0500606