blob: 481210d14269456b8959e195dc9c2e9a647973dd [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
kaihlavid1a1fb72019-06-13 16:11:48 +030014${DCAE_BE_ENDPOINT} http://localhost:8082
15
16*** Keywords ***
17
18Add VFCMT To DCAE-DS
19 [Documentation] Create VFCMT with the given name and return its uuid
20 [Arguments] ${vfcmt_name}
21 ${map}= Create Dictionary vfcmtName=${vfcmt_name} description=VFCMT created by robot
kaihlavi22bc9232019-07-31 19:54:49 +030022 Create Environment create_vfcmt ${ASSETS_DIR}
23 ${data}= Apply Template create_vfcmt ${DCAE_VFCMT_TEMPLATE} ${map}
kaihlavia1f1a4e2019-08-08 12:46:13 +030024 ${resp}= SDC.Run Post Request ${DCAE_BE_ENDPOINT} ${DCAE_PATH}/createVFCMT ${data} ${ASDC_DESIGNER_USER_ID}
kaihlavid1a1fb72019-06-13 16:11:48 +030025 Should Be Equal As Strings ${resp.status_code} 200
26 [Return] ${resp.json()['uuid']}
27
kaihlavid1a1fb72019-06-13 16:11:48 +030028Save Composition
29 [Arguments] ${vfcmt_uuid} ${vf_uuid}
30 ${map}= Create Dictionary cid=${vfcmt_uuid} vf_id=${vf_uuid}
kaihlavi22bc9232019-07-31 19:54:49 +030031 Create Environment dcae_composition ${ASSETS_DIR}
32 ${data}= Apply Template dcae_composition ${DCAE_COMPOSITION_TEMPLATE} ${map}
kaihlavia1f1a4e2019-08-08 12:46:13 +030033 ${resp}= SDC.Run Post Request ${DCAE_BE_ENDPOINT} ${DCAE_PATH}/saveComposition/${vfcmt_uuid} ${data} ${ASDC_DESIGNER_USER_ID}
kaihlavid1a1fb72019-06-13 16:11:48 +030034 Should Be Equal As Strings ${resp.status_code} 200
35
36Certify VFCMT
37 [Arguments] ${vfcmt_uuid}
kaihlavia1f1a4e2019-08-08 12:46:13 +030038 ${resp}= SDC.Run Put Request ${DCAE_BE_ENDPOINT} ${DCAE_PATH}/certify/vfcmt/${vfcmt_uuid} ${None} ${ASDC_DESIGNER_USER_ID}
kaihlavid1a1fb72019-06-13 16:11:48 +030039 Should Be Equal As Strings ${resp.status_code} 200
40 [Return] ${resp.json()['uuid']}
41
42Add Monitoring Configuration To DCAE-DS
43 [Arguments] ${vfcmt_uuid} ${cs_uuid} ${vfi_name} ${mc_name}
44 ${map}= Create Dictionary template_uuid=${vfcmt_uuid} service_uuid=${cs_uuid} vfi_name=${vfi_name} name=${mc_name}
kaihlavi22bc9232019-07-31 19:54:49 +030045 Create Environment dcae_monitoring_configuration ${ASSETS_DIR}
46 ${data}= Apply Template dcae_monitoring_configuration ${DCAE_MONITORING_CONFIGURATION_TEMPLATE} ${map}
kaihlavia1f1a4e2019-08-08 12:46:13 +030047 ${resp}= SDC.Run Post Request ${DCAE_BE_ENDPOINT} ${DCAE_PATH}/importMC ${data} ${ASDC_DESIGNER_USER_ID}
kaihlavid1a1fb72019-06-13 16:11:48 +030048 Should Be Equal As Strings ${resp.status_code} 200
49 [Return] ${resp.json()['vfcmt']['uuid']}
50
51Submit Monitoring Configuration To DCAE-DS
52 [Arguments] ${mc_uuid} ${cs_uuid} ${vfi_name}
kaihlavidc396842019-06-26 15:09:37 +030053 ${url_vfi_name} url_encode_string ${vfi_name}
kaihlavia1f1a4e2019-08-08 12:46:13 +030054 ${resp}= SDC.Run Post Request ${DCAE_BE_ENDPOINT} ${DCAE_PATH}${DCAE_CREATE_BLUEPRINT_PATH}/${mc_uuid}/${cs_uuid}/${url_vfi_name} ${None} ${ASDC_DESIGNER_USER_ID}
kaihlavid1a1fb72019-06-13 16:11:48 +030055 Should Be Equal As Strings ${resp.status_code} 200
56