Set PROV with Heatbridge 45/48545/1
authorBrian Freeman <bf1936@att.com>
Tue, 22 May 2018 18:13:05 +0000 (13:13 -0500)
committerBrian Freeman <bf1936@att.com>
Tue, 22 May 2018 18:31:14 +0000 (13:31 -0500)
Issue-ID: TEST-94
Change-Id: I9b29fae3b8b95131f68df7deea5131e431d70629
Signed-off-by: Brian Freeman <bf1936@att.com>
robot/assets/service_mappings.py
robot/resources/heatbridge.robot

index 52f1ca1..2cdc0d5 100644 (file)
@@ -42,6 +42,11 @@ GLOBAL_VALIDATE_NAME_MAPPING = {"vFW" : 'vfw_name_0',
                                  "vLB" : 'vlb_name_0',
                                  "vVG" : '',
                                  "vCPE" : 'vgw_name_0',
+                                 "vCPEvGW" : 'vgw_name_0',
+                                 "vCPEvDNS" : 'vdns_name_0',
+                                 "vCPEvAAA" : 'vaaa_name_0',
+                                 "vCPEvWEB" : 'vweb_name_0',
+                                 "vCPEvDHCP" : 'vdhcp_name_0',
                                  "vFWSNK" : 'vfw_name_0',
                                  "vPKG" : 'vpg_name_0',
                                  }
index 515ae39..d77e9fb 100644 (file)
@@ -38,6 +38,7 @@ Execute Heatbridge
     ${stack_id}=    Get From Dictionary    ${stack_info}    id
     ${tenant_id}=   Get From Dictionary    ${stack_info}    OS::project_id
     ${vnf_id}=    Get From Dictionary    ${stack_info}    vnf_id
+    Run Set VNF ProvStatus  ${vnf_id}  PROV
     ${url}   ${path}=   Get Keystone Url And Path
     ${openstack_identity_url}=    Catenate    ${url}${path}
     ${region}=   Get Openstack Region
@@ -45,7 +46,7 @@ Execute Heatbridge
     Init Bridge    ${openstack_identity_url}    ${user}    ${pass}    ${tenant_id}    ${region}   ${GLOBAL_AAI_CLOUD_OWNER}
     ${request}=    Bridge Data    ${stack_id}
     Log    ${request}
-    ${resp}=    Run A&AI Put Request    ${VERSIONED_INDEX_PATH}${MULTIPART_PATH}    ${request}
+    ${resp}=    Run A&AI Put Request    ${VERSIONED_INDEX_PATH}${MULTIPART_PATH}    ${request}  
     ${status_string}=    Convert To String    ${resp.status_code}
     Should Match Regexp    ${status_string}    ^(201|200)$
     ${reverse_heatbridge}=   Generate Reverse Heatbridge From Stack Info   ${stack_info}
@@ -71,6 +72,27 @@ Run Vserver Query
     Should Be Equal As Strings    ${resp.status_code}    200
 
 
+Run Set VNF ProvStatus 
+    [Documentation]  Run A&A GET and PUT to set prov-status
+    [Arguments]   ${vnf_id}   ${prov_status}=PROV
+    ${payload}=  Run Get Generic VNF by VnfId   ${vnf_id}
+
+    #${payload_json}=    evaluate    json.loads('''${payload}''')    json
+    set to dictionary    ${payload}    prov-status    ${prov_status}
+    ${payload_string}=    evaluate    json.dumps(${payload})    json
+
+    ${put_resp}=    Run A&AI Put Request      ${VERSIONED_INDEX_PATH}/network/generic-vnfs/generic-vnf/${vnf_id}    ${payload_string}
+    ${status_string}=    Convert To String    ${put_resp.status_code}
+    Should Match Regexp    ${status_string}    ^(200|201)$
+    Log To Console    Set VNF ProvStatus: ${vnf_id} to ${prov_status}
+
+Run Get Generic VNF By VnfId
+    [Documentation]  Get VNF GET Payload with resource ID
+    [Arguments]   ${vnf_id}
+    ${resp}=    Run A&AI Get Request      ${AAI_INDEX PATH}/network/generic-vnfs/generic-vnf?vnf-id=${vnf_id}
+    Should Be Equal As Strings  ${resp.status_code}     200
+    [Return]   ${resp.json()}
+
 Execute Reverse Heatbridge
     [Documentation]   VID has already torn down the stack, reverse HB
     Return From Keyword If   len(${REVERSE_HEATBRIDGE}) == 0