Move CSIT to integration/csit repo
[integration/csit.git] / tests / usecases / 5G-bulkpm / resources / bulkpm_keywords.robot
1  *** Settings ***
2 Documentation     The main interface for interacting with VES. It handles low level stuff like managing the http request library and VES required fields
3 Library               RequestsLibrary
4 Library           ../resources/xNFLibrary.py
5 Library           OperatingSystem
6 Library           Collections
7 Library           requests
8 Library           Collections
9 Library           String
10
11 *** Variables ***
12
13 *** Keywords ***
14
15 Get Event Data From File
16     [Arguments]    ${jsonfile}
17     ${data}=    OperatingSystem.Get File    ${jsonfile}
18     #Should Not Be_Equal    ${data}    None
19     [return]    ${data}
20
21 Publish Event To VES Collector
22     [Documentation]    Send an event to VES Collector
23     [Arguments]     ${url}  ${evtpath}   ${httpheaders}    ${evtdata}
24     Log    Creating session ${url}
25     ${session}=    Create Session       dcaegen2-d1     ${url}
26     ${resp}=    Post Request    dcaegen2-d1     ${evtpath}     data=${evtdata}   headers=${httpheaders}
27     #Log    Received response from dcae ${resp.json()}
28     [return]    ${resp}
29 PostCall
30     [Arguments]    ${url}               ${data}
31     ${headers}=    Create Dictionary    Accept=application/json    Content-Type=application/json
32     ${resp}=       Evaluate    requests.post('${url}',data='${data}', headers=${headers},verify=False)    requests
33     [Return]       ${resp}
34
35 GetCall
36     [Arguments]     ${url}
37     ${resp}=            Evaluate    requests.get('${url}')    requests
38     [Return]            ${resp}