aboutsummaryrefslogtreecommitdiffstats
path: root/tests/usecases-5G-bulkpm/5G-bulkpm/resources/bulkpm_keywords.robot
blob: 9ef56c83fe957ea81ed067be96bb0da660731a8c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
 *** Settings ***
Documentation     The main interface for interacting with VES. It handles low level stuff like managing the http request library and VES required fields
Library         RequestsLibrary
Library           ../resources/xNFLibrary.py
Library           ../resources/JsonValidatorLibrary.py
Library           OperatingSystem
Library           Collections
Library           requests
Library           Collections
Library           String

*** Variables ***

*** Keywords ***

Get Event Data From File
    [Arguments]    ${jsonfile}
    ${data}=    OperatingSystem.Get File    ${jsonfile}
    #Should Not Be_Equal    ${data}    None
    [return]    ${data}

Publish Event To VES Collector
    [Documentation]    Send an event to VES Collector
    [Arguments]     ${url}  ${evtpath}   ${httpheaders}    ${evtdata}
    Log    Creating session ${url}
    ${session}=    Create Session   dcaegen2-d1   ${url}
    ${resp}=  Post Request  dcaegen2-d1   ${evtpath}     data=${evtdata}   headers=${httpheaders}
    #Log    Received response from dcae ${resp.json()}
    [return]  ${resp}
PostCall
    [Arguments]    ${url}       ${data}
    ${headers}=    Create Dictionary    Accept=application/json    Content-Type=application/json
    ${resp}=       Evaluate    requests.post('${url}',data='${data}', headers=${headers},verify=False)    requests
    [Return]       ${resp}

GetCall
    [Arguments]     ${url}
    ${resp}=      Evaluate    requests.get('${url}')    requests
    [Return]      ${resp}