Hi Lukasz,

If you are only interested in how to retrieve information about PNFs and their 
relationships (i.e. to ServiceInstances) explicitely from AAI via REST I'd 
recommend you check out the swagger documentation: 
https://nexus.onap.org/service/local/repositories/releases/archive/org/onap/aai/aai-common/aai-schema/1.3.0/aai-schema-1.3.0.jar/!/onap/aai_swagger_html/aai_swagger_v14.html#operation--network-pnfs-pnf--pnf-name--get

Here are some example curl calls you can execute in your environment (generated 
by postman) to fetch PNFs:
Note: The credentials used here for Basic Auth are: AAI/AAI.
Hope this helps. If you need anything else and would like to know how this is 
implemented in SO as a part of the PNF workflow, let us know.

1. Fetching all PNFs:

curl -X GET \
https://<HOST>:8443/aai/v14/network/pnfs \
  -H 'authorization: Basic QUFJOkFBSQ==' \
  -H 'cache-control: no-cache' \
  -H 'content-type: application/json' \
  -H 'postman-token: 353393bc-effb-9b07-8624-6b9f5848342e' \
  -H 'x-fromappid: postman' \
  -H 'x-transactionid: testaai'


2. Fetching single PNF:

Remember to substitute <HOST> and {pnf-name}
As of now the pnf-name is used as the main pnf identifier, instead of pnf-id. 
This is about to change in Dublin as part of the 
https://jira.onap.org/browse/AAI-2148.
Jimmy Forsyth has explained this upcoming change in an onap-discuss message 
#aai [aai] Breaking change in AAI's PNF API.

curl -X GET \
  https://<HOST>:8443/aai/v14/network/pnfs/pnf/{pnf-name} \
  -H 'authorization: Basic QUFJOkFBSQ==' \
  -H 'cache-control: no-cache' \
  -H 'content-type: application/json' \
  -H 'postman-token: ae95189b-4258-df1a-c8e6-621656978a1f' \
  -H 'x-fromappid: postman' \
  -H 'x-transactionid: testaai'


Sample output:

The response will be XML by default unless you add 'accept: application/json' 
header in the requests.
If an existing PNF has a proper relationship with a service instance you should 
receive a similar response as shown below -> relationship data is part of the 
pnf response. Ignore the dummy test values:) Ids should be UUIDs, etc.

<?xml version="1.0" encoding="UTF-8"?>
<pnfs xmlns="http://org.onap.aai.inventory/v14";>
    <pnf>
        <pnf-name>mypnfik</pnf-name>
        <pnf-id>6669</pnf-id>
        <in-maint>false</in-maint>
        <resource-version>1545306318526</resource-version>
        <relationship-list>
            <relationship>
                <related-to>service-instance</related-to>
                
<relationship-label>org.onap.relationships.inventory.ComposedOf</relationship-label>
                
<related-link>/aai/v14/business/customers/customer/CustId/service-subscriptions/service-subscription/vCPE/service-instances/service-instance/69</related-link>
                <relationship-data>
                    
<relationship-key>customer.global-customer-id</relationship-key>
                    <relationship-value>CustId</relationship-value>
                </relationship-data>
                <relationship-data>
                    
<relationship-key>service-subscription.service-type</relationship-key>
                    <relationship-value>vCPE</relationship-value>
                </relationship-data>
                <relationship-data>
                    
<relationship-key>service-instance.service-instance-id</relationship-key>
                    <relationship-value>69</relationship-value>
                </relationship-data>
                <related-to-property>
                    
<property-key>service-instance.service-instance-name</property-key>
                    <property-value>cool_service_instance</property-value>
                </related-to-property>
            </relationship>
        </relationship-list>
    </pnf>
</pnfs>


Best Regards,
Michal

-----------------------------------------------------------------

Michal Kabaj
Technical Leader
MN MANO RD&Pz ONAP-UI-ML DEVOPS WRO 1 SG
Nokia, Wrocław Poland
Contact number: +48784031778

________________________________
From: [email protected] <[email protected]> on behalf of 
Steve Smokowski <[email protected]>
Sent: Wednesday, February 27, 2019 6:10 PM
To: [email protected]; [email protected]
Subject: Re: [onap-discuss] Modelling of PNF in A&AI


You asking generically or from SO?  I think we have lots of samples using our 
client in SO.



Thanks



-Steve





From: <[email protected]> on behalf of Lukasz Rajewski 
<[email protected]>
Reply-To: "[email protected]" <[email protected]>, 
"[email protected]" <[email protected]>
Date: Wednesday, February 27, 2019 at 11:34 AM
To: "[email protected]" <[email protected]>
Subject: [onap-discuss] Modelling of PNF in A&AI



Hi,



could you guide me which A&AI requests should be used to retrieve some 
information about PNF, its relation with service instance and generic-vnfs 
belonging to this service? If you would have also some exemplary output of this 
requests it would be very helpful. Thank you in advance.



Regards,



[Logo Orange]


Łukasz Rajewski, R&D Expert
Orange Labs Poland, Advanced Network Systems Agency
Mob.: +48 519 310 854
Orange Polska, Obrzeżna 7, 02-691 Warsaw
www.orange.pl<https://urldefense.proofpoint.com/v2/url?u=http-3A__www.orange.pl_&d=DwMFBA&c=LFYZ-o9_HUMeMTSQicvjIg&r=shs6nPzThSiGJml9VXN0Eg&m=CLwSEHQ8HFTjtTM_S3DQi2BLpS037zfG-oHC2ECDgA4&s=FOm3i5N8nDhzZ8z5H2gbsmOIOVYgyaWBuXsi2pug4jw&e=>








-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#15778): https://lists.onap.org/g/onap-discuss/message/15778
Mute This Topic: https://lists.onap.org/mt/30153741/21656
Group Owner: [email protected]
Unsubscribe: https://lists.onap.org/g/onap-discuss/unsub  
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to