aboutsummaryrefslogtreecommitdiffstats
path: root/robot/resources/so/create_service_instance.robot
blob: d03a1286010eb7c2de2ba25f2157c26d7d16ff0e (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
*** Settings ***
Documentation    Creates a macro service recipe in SO Catalog DB

Library    OperatingSystem
Library    Collections
Library    ONAPLibrary.SO    WITH NAME    SO
Library    ONAPLibrary.Templating    WITH NAME    Templating
Resource    ../global_properties.robot

*** Variables ***
${CREATE_SERVICE_PATH}    /onap/so/infra/serviceInstantiation/v7/serviceInstances

${SYSTEM USER}    robot-ete
${CREATE_PNF_SERVICE_GR_API}   so/create_pnf_service_building_block.jinja

*** Keywords ***
Create PNF Service Using GR Api
    [Documentation]    Creates a PNF service using GR Api
    [Arguments]   ${arguments}
    Templating.Create Environment    so    ${GLOBAL_TEMPLATE_FOLDER}
    ${data}=    Templating.Apply Template    so    ${CREATE_PNF_SERVICE_GR_API}     ${arguments}
    ${auth}=  Create List  ${GLOBAL_SO_USERNAME}    ${GLOBAL_SO_PASSWORD}
    ${requestReferences}  SO.Run Post Request   ${GLOBAL_SO_ENDPOINT}    ${CREATE_SERVICE_PATH}   ${data}    auth=${auth}
    ${requestReferences_json}   Set Variable  ${requestReferences.json()}
    ${request_id}  Set Variable  ${requestReferences_json['requestReferences']['requestId']}
    ${service_instance_id}  Set Variable  ${requestReferences_json['requestReferences']['instanceId']}
    [Return]  ${request_id}  ${service_instance_id}