Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 6 Next »


Analysis

vFirewall Demo Sequence of Events

All the events during a VF creation so we can understand all the orchestration steps at a granular REST level.

Prerequisites 

SeqNameSourceTargetActorREST writeREST read





















Config

SeqNameSourceTargetActorREST writeREST read

create customerrobotaai./demo.sh init
https://{{aai_ip}}:8443/aai/v8/business/customers/customer

{ "global-customer-id": "Demonstration","subscriber-name": "Demonstration",


create service modelrobotaai./demo.sh init

https://{{aai_ip}}:8443/aai/v8/service-design-and-creation/models

"model-name-version-id": "dcb40136-9cec-45be-b080-2a36b31c2f06",
"model-type": "service", "model-name": "vfservice",
"model-id": "43d59b70-8829-4a50-a3f7-d261b220ceef",









Service Deployment

SeqNameSourceTargetActorREST writeREST read

deploy service modelvid
demo user


create service instancevid
demo user

https://{{aai_ip}}:8443/aai/v8/business/customers/customer/Demonstration/service-subscriptions/service-subscription/vFW/service-instances/

{ "service-instance": [{
"service-instance-id": "c54316d8-464e-4967-bece-8c2b2f458b66",
"service-instance-name": "DemoInstance",
"persona-model-id": "2a01ef12-9bb1-4205-9941-a506cbae99c9",








VNF Creation

SeqNameSourceTargetActorREST writeREST read


robot
./demo.sh init















VFModule Preload

SeqNameSourceTargetActorREST writeREST read

preload vnfrobot
./demo.sh preload <DemoVNF> <DemoModule>















VFModule Creation

SeqNameSourceTargetActorREST writeREST read

create vf module <DemoModule>vid
demo user















Closed Loop

SeqNameSourceTargetActorREST writeREST read

appcrobot
./demo.sh appc <DemoModule>















see also

Design Issues

DI 1: 20170712: AAI Cert required for HTTPS REST calls

Use postman for adhoc rest calls - but if you want to code up call chains or hammer an endpoint use Spring RestController or the Rest client in JAX-RS 2.0

Calls to AAI such as the following require both the authentication header and an imported certificate.  When running Postman - because it is a Chrome app - this is a simple case of loading a REST url in the browser and importing the certificate after an authentication challenge (AAI:AAI).  However for a java client like a JAX-RS 2.0 client we need the certificate in a keystore (the default or a specially defined one).

Below we import the cert into the default keystore.  Where did I get the cert? by extracting it from Firefox - however it is in the code base - looking it up


obrienbiometrics:onap michaelobrien$ ls $JAVA_HOME/jre/lib/security/cacerts

/Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home/jre/lib/security/cacerts

sudo keytool -import -trustcacerts -alias aai -file /Users/michaelobrien/Dropbox/_amdocs/config/certs/aai/aaiapisimpledemoopenecomporg.cer -keystore $JAVA_HOME/jre/lib/security/cacerts

Running an https rest target using this certificate - if the cert is in a default keystore - you dont need to define it.


// require: cert, username, password, headers(X-FromAppId,Accept), Authenticator
public String run(boolean isSSL, String url, String port, String path) {
  String record = null;
Client client = null;
WebTarget latestTarget = null;
WebTarget rootTarget = null;
if(isSSL) {
SslConfigurator sslConfig = SslConfigurator.newInstance();
SSLContext sslContext = sslConfig.createSSLContext();
HostnameVerifier verifier = new HostnameVerifier() {
public boolean verify(String hostname, SSLSession sslSession) {
return true; // TODO: security breach
}};
client = ClientBuilder.newBuilder().sslContext(sslContext).hostnameVerifier(verifier).build();
client.register(new Authenticator("AAI","AAI"));
} else {
      client = ClientBuilder.newClient();
}
rootTarget = client.target(url);
latestTarget = rootTarget.path(path);
try {
try { Thread.sleep(1); } catch (InterruptedException ie) { Thread.currentThread().interrupt(); }
record = finalTarget.request()
.header("X-FromAppId", "AAI").header("Accept", "application/json")
.get(String.class);
public class Authenticator implements ClientRequestFilter {
private final String user;
private final String pass;

public Authenticator(String user, String password) {
this.user = user; this.pass = password;
}

public void filter(ClientRequestContext requestContext) throws IOException {
MultivaluedMap<String, Object> headMap = requestContext.getHeaders();
String basicAuth = null;
try {
String aToken = user + ":" + pass;
basicAuth = "BASIC " + DatatypeConverter.printBase64Binary(aToken.getBytes("UTF-8"));
} catch (UnsupportedEncodingException uee) { throw new IllegalStateException("Encoding with UTF-8 failed", uee);}
headMap.add("Authorization", basicAuth);
}
}

DI 2: 20170712: Spring Boot Backend Framework

Instead of using a full Tomcat deployment server - we will use an embedded Jetty container.

pom.xml 

  <parent><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-parent</artifactId><version>1.5.3.RELEASE</version></parent>

    <dependencies>
<dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-web</artifactId></dependency>       

        <!-- avoid restarts --><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-devtools</artifactId><optional>true</optional></dependency>

        <dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-actuator</artifactId></dependency>
<dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-test</artifactId><scope>test</scope></dependency>
    </dependencies>

    <build><plugins><plugin><groupId>org.springframework.boot</groupId><artifactId>spring-boot-maven-plugin</artifactId>
                <!-- may not be required --><configuration><addResources>true</addResources> </configuration></plugin></plugins></build>

DI 3: 20170712: JAX-RS 2.0 API Framework

DI 4: 20170712: 3D Framework: Three js OpenGL 3D wrapper on Canvas

Di 5: 20170712: Javascript Timer Framework

DI 6: 20170712: Three js Listener

DI 7: 20170712: Three js Edges between Nodes

DI 8: 20170712: Three js Click Context

DI 9: 20170712: AJAX JAX-RS Channel

DI 10: 20170712: WebSocket Channel

DI 11: 20170712: React.js Framework

DI 12: 20170712: Three js Text

DI 20: 20170721: Rest API Chaining



  • No labels