Jira Legacy |
---|
server | System Jira |
---|
columns | key,summary,type,created,updated,due,assignee,reporter,priority,status,resolution |
---|
serverId | 4733707d-2057-3a0f-ae5e-4fd8aff50176 |
---|
key | CPS-392 |
---|
|
Investigate A&AI Interface, especially how to retrieve inventory, current list of xNF functions
Consider som PoC Code
Documentation:
How to retrieve current list of xNF functions from A&AI:
Send Get request to this endpoint

Example curl command you can use to retrieve inventory from anywhere within the cluster in which AAI is deployed to.
Code Block |
---|
title | Example curl command |
---|
|
curl 'http://aai:8443/aai/v23/network/pnfs' |
PoC code:
Write code to show that it is possible to retrieve the current list of xNF functions.
Code Block |
---|
language | java |
---|
title | PoC code |
---|
collapse | true |
---|
|
import java.io.IOException;
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class InventoryRetriever {
public void getXnfsFromAai(){
String nfData;
try{
HttpClient client = HttpClient.newHttpClient();
String aaiNetworkEndPoint = getAaiServiceUrl();
var request = HttpRequest.newBuilder(URI.create(aaiNetworkEndPoint))
.headers("Authorization", "Basic QUFJOkFBSQ==", "accept", "application/json",
"content-type", "application/json", "x-fromappid", "cps-ncmp",
"X-TransactionId", "get_aai_subscr")
.build();
var response = client.send(request, HttpResponse.BodyHandlers.ofString());
if (response.statusCode() == 200){
nfData = response.body();
System.out.println(nfData);
}
} catch (IOException | InterruptedException e) {
e.printStackTrace();
}
}
private String getAaiServiceUrl(){
String version = "v23";
return "http://aai:8443/aai/"+ version + "/network/pnfs";
}
}
|