blob: 98e02519c6e5c2a1178a4e9e18d008109b044c77 [file] [log] [blame]
kaihlavid1a1fb72019-06-13 16:11:48 +03001*** Settings ***
2Library json
kaihlavid1a1fb72019-06-13 16:11:48 +03003Library ONAPLibrary.Utilities
kaihlavia1f1a4e2019-08-08 12:46:13 +03004Library ONAPLibrary.SDC WITH NAME SDC
kaihlavi22bc9232019-07-31 19:54:49 +03005Library ONAPLibrary.Templating WITH NAME Templating
kaihlavid1a1fb72019-06-13 16:11:48 +03006Resource common.robot
7
8*** Variables ***
9${DCAE_PATH} /dcae
10${DCAE_CREATE_BLUEPRINT_PATH} /SERVICE/createBluePrint
kaihlavi22bc9232019-07-31 19:54:49 +030011${DCAE_VFCMT_TEMPLATE} create_vfcmt.jinja
12${DCAE_COMPOSITION_TEMPLATE} dcae_composition.jinja
13${DCAE_MONITORING_CONFIGURATION_TEMPLATE} dcae_monitoring_configuration.jinja
Petr Ospalýb86853b2019-09-23 17:01:09 +020014${DCAE_BE_ENDPOINT} https://localhost:8444
kaihlavid1a1fb72019-06-13 16:11:48 +030015
16*** Keywords ***
kaihlavif7f3bf32019-08-21 17:42:11 +030017Create Monitoring Template
18 [Documentation] Create a new monitoring template containing the DCAE VF, certify it and return the uuid
19 [Arguments] ${vfcmt_name} ${vf_uuid}
20 ${vfcmt_uuid} Add VFCMT To DCAE-DS ${vfcmt_name}
21 Save Composition ${vfcmt_uuid} ${vf_uuid}
22 # Note that certification is not instructed in
23 # https://wiki.onap.org/display/DW/How+to+Create+a+Service+with+a+Monitoring+Configuration+using+SDC
24 # due to limitations of GUI so this test case goes beyond the instructions at this certification step
25 ${cert_vfcmt_uuid} Certify VFCMT ${vfcmt_uuid}
26 [return] ${cert_vfcmt_uuid}
kaihlavid1a1fb72019-06-13 16:11:48 +030027
28Add VFCMT To DCAE-DS
29 [Documentation] Create VFCMT with the given name and return its uuid
30 [Arguments] ${vfcmt_name}
31 ${map}= Create Dictionary vfcmtName=${vfcmt_name} description=VFCMT created by robot
kaihlavi22bc9232019-07-31 19:54:49 +030032 Create Environment create_vfcmt ${ASSETS_DIR}
33 ${data}= Apply Template create_vfcmt ${DCAE_VFCMT_TEMPLATE} ${map}
kaihlavif7f3bf32019-08-21 17:42:11 +030034 ${resp}= SDC.Run Post Request ${DCAE_BE_ENDPOINT} ${DCAE_PATH}/createVFCMT ${data} ${SDC_DESIGNER_USER_ID}
kaihlavid1a1fb72019-06-13 16:11:48 +030035 Should Be Equal As Strings ${resp.status_code} 200
36 [Return] ${resp.json()['uuid']}
37
kaihlavid1a1fb72019-06-13 16:11:48 +030038Save Composition
39 [Arguments] ${vfcmt_uuid} ${vf_uuid}
40 ${map}= Create Dictionary cid=${vfcmt_uuid} vf_id=${vf_uuid}
kaihlavi22bc9232019-07-31 19:54:49 +030041 Create Environment dcae_composition ${ASSETS_DIR}
42 ${data}= Apply Template dcae_composition ${DCAE_COMPOSITION_TEMPLATE} ${map}
kaihlavif7f3bf32019-08-21 17:42:11 +030043 ${resp}= SDC.Run Post Request ${DCAE_BE_ENDPOINT} ${DCAE_PATH}/saveComposition/${vfcmt_uuid} ${data} ${SDC_DESIGNER_USER_ID}
kaihlavid1a1fb72019-06-13 16:11:48 +030044 Should Be Equal As Strings ${resp.status_code} 200
45
46Certify VFCMT
47 [Arguments] ${vfcmt_uuid}
kaihlavif7f3bf32019-08-21 17:42:11 +030048 ${resp}= SDC.Run Put Request ${DCAE_BE_ENDPOINT} ${DCAE_PATH}/certify/vfcmt/${vfcmt_uuid} ${None} ${SDC_DESIGNER_USER_ID}
kaihlavid1a1fb72019-06-13 16:11:48 +030049 Should Be Equal As Strings ${resp.status_code} 200
50 [Return] ${resp.json()['uuid']}
51
kaihlavif7f3bf32019-08-21 17:42:11 +030052Create Monitoring Configuration To DCAE-DS
53 [Documentation] Create a monitoring configuration to DCAE-DS using SDC Catalog Service uuid,
54 ... VFMCT uuid and instance name and monitoring configuration name
55 [Arguments] ${vfcmt_uuid} ${cs_uuid} ${vfi_name} ${mc_name}
56 ${mc_uuid} Add Monitoring Configuration To DCAE-DS ${vfcmt_uuid} ${cs_uuid} ${vfi_name} ${mc_name}
57 Submit Monitoring Configuration To DCAE-DS ${mc_uuid} ${cs_uuid} ${vfi_name}
58
kaihlavid1a1fb72019-06-13 16:11:48 +030059Add Monitoring Configuration To DCAE-DS
60 [Arguments] ${vfcmt_uuid} ${cs_uuid} ${vfi_name} ${mc_name}
61 ${map}= Create Dictionary template_uuid=${vfcmt_uuid} service_uuid=${cs_uuid} vfi_name=${vfi_name} name=${mc_name}
kaihlavi22bc9232019-07-31 19:54:49 +030062 Create Environment dcae_monitoring_configuration ${ASSETS_DIR}
63 ${data}= Apply Template dcae_monitoring_configuration ${DCAE_MONITORING_CONFIGURATION_TEMPLATE} ${map}
kaihlavif7f3bf32019-08-21 17:42:11 +030064 ${resp}= SDC.Run Post Request ${DCAE_BE_ENDPOINT} ${DCAE_PATH}/importMC ${data} ${SDC_DESIGNER_USER_ID}
kaihlavid1a1fb72019-06-13 16:11:48 +030065 Should Be Equal As Strings ${resp.status_code} 200
66 [Return] ${resp.json()['vfcmt']['uuid']}
67
68Submit Monitoring Configuration To DCAE-DS
69 [Arguments] ${mc_uuid} ${cs_uuid} ${vfi_name}
kaihlavidc396842019-06-26 15:09:37 +030070 ${url_vfi_name} url_encode_string ${vfi_name}
kaihlavif7f3bf32019-08-21 17:42:11 +030071 ${resp}= SDC.Run Post Request ${DCAE_BE_ENDPOINT} ${DCAE_PATH}${DCAE_CREATE_BLUEPRINT_PATH}/${mc_uuid}/${cs_uuid}/${url_vfi_name} ${None} ${SDC_DESIGNER_USER_ID}
kaihlavid1a1fb72019-06-13 16:11:48 +030072 Should Be Equal As Strings ${resp.status_code} 200
73