Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Investigate A&AI Interface, especially how to retrieve inventory, current list of xNF functions.

Documentation:

AAI REST API Documentation - Honolulu

How to retrieve current list of xNF functions from A&AI

...

?

Send Get GET request to this endpoint

Example curl command you can use to retrieve inventory from any pod within the cluster in which AAI is deployed to.

Code Block
titleExample curl command
curl 'https://aai:8443{serverRoot}/aai/v23/network/pnfs'

The above command returns a list of all the pnfs 

...

the pnfs. 

Example of the data that is returned by the curl command.

JSON Viewer
width500
height380
{"pnf":[{"pnf-name":"dummyTest15","pnf-name2":"dummypnf-1597953056126","pnf-id":"927b2580-36d9-4f13-8421-3c9d43b7a75e","equip-type":"example-equip-type-val-20348","equip-vendor":"example-equip-vendor-val-52182","equip-model":"example-equip-model-val-8370","management-option":"example-management-option-val-72881","orchestration-status":"Active","ipaddress-v4-oam":"100.10.20.20","in-maint":false,"ipaddress-v6-oam":"","spare-equipment-indicator":false,"resource-version":"1622041203064"}]}


Proof of Concept code:

The below is Proof Of Concept code and it is not production ready. With this code, we are able to retrieve list of network functions from A&AI.

...

To write production ready code, the following things will need to be done.1) User

  •  User Story to implement One way SSL communication needed to make Https calls.

...

    • Currently the project is not set up to make HTTPS calls. For the POC the following code was added to workaround this issue.
Code Block
languagejava
themeEclipse
firstline1
titleWorkaround Code for making HTTPS calls
linenumberstrue
collapsetrue
        final TrustManager[] trustAllCerts = new TrustManager[] {
		  new X509TrustManager() {
            public java.security.cert.X509Certificate[] getAcceptedIssuers() {
                return new ArrayList<X509Certificate>().toArray(new X509Certificate[0]);
            }

            public void checkClientTrusted(final X509Certificate[] certs, final String authType) {
            }

            public void checkServerTrusted(final X509Certificate[] certs, final String authType) {
            }
          }
        };

        final SSLContext sc = SSLContext.getInstance("SSL");
        sc.init(null, trustAllCerts, new java.security.SecureRandom());
        HttpsURLConnection.setDefaultSSLSocketFactory(sc.getSocketFactory());

        final HostnameVerifier allHostsValid = new HostnameVerifier() {
            public boolean verify(final String hostname, final SSLSession session) {
                return true;
            }
        };

...

  • User story to implement retrieving of the current list of xNF functions 
    • Part of the PoC code which does can be seen below
Code Block
languagejava
themeEclipse
firstline1
titleCode to retrieve xNF functions from A&AI
linenumberstrue
collapsetrue
		String nfData = "";
        final String aaiNetworkEndPoint = getAaiServiceUrlHttps();
        final URL url;
        try {
            url = new URL(aaiNetworkEndPoint);
            final HttpsURLConnection conn = (HttpsURLConnection) url.openConnection();
            conn.setRequestProperty("Authorization", "Basic QUFJOkFBSQ==");
            conn.setRequestProperty("accept", "application/json");
            conn.setRequestProperty("conntent-type", "application/json");
            conn.setRequestProperty("x-fromappid", "cps-ncmp");
            conn.setRequestProperty("X-TransactionId", "get_aai_subscr");
            conn.connect();
            nfData = responseReader(conn);

        } catch (final IOException e) {
            e.printStackTrace();
        }

Spike Presentation to the Team:

View file
nameCPS-392 A&AI Inventory List Spike Review-20210527_163153-Meeting Recording.mp4
height250