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

Compare with Current View Page History

« Previous Version 8 Next »

Mission statement: automate everything, experiment often, drive POC

This page lists any development peripheral to ONAP that aide in exercising API or testing out integration ideas - they are primarily for ad-hoc experimentation.

Root Project Utilities

For developers wishing to build the entire ONAP - Project containing the root pom.xml and scripts to clone/pull all repositories.


We may add this to an existing/proposed common project

COMMON-18 - Getting issue details... STATUS

COMMON-17 - Getting issue details... STATUS

Amazon AWS Integration

On or all of EC2, Beanstalk, Docker based ECS service and the pure event driven Lambda service - definitely future work.

Northbound Rest OSS Client

Exercise ONAP programmatically via M2M (Rest client) calls.  See the existing VID and proposed VID project and the associated vm1-robot VM.

Experimental

Spring Boot REST Endpoint for JAX-RS 2.0 Client

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

Purpose: Experiment with JAX-RS 2.0 clients as OSS demonstrations.

Client

package org.onap.demo.oss;
import javax.ws.rs.client.Client;
import javax.ws.rs.client.ClientBuilder;
import javax.ws.rs.client.WebTarget;

public class OSSRestClient {
private static final String IP = "104.239.99.99";
private static final String HTTP_PORT = "88";

private void robotHealthCheck() {
Client client = ClientBuilder.newClient();
client.register(new Authenticator("test","test"));
WebTarget rootTarget = client.target("http://" + IP + ":" + HTTP_PORT);
WebTarget latestTarget = rootTarget.path("/");
try {
System.out.println(latestTarget.request().get(String.class));
} catch (Exception e) { e.printStackTrace();
} finally { client.close(); }
}

public static void main(String[] args) {
OSSRestClient client = new OSSRestClient();
client.robotHealthCheck();
}
}
package org.onap.demo.oss;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import javax.ws.rs.core.MultivaluedMap;
import javax.ws.rs.client.ClientRequestContext;
import javax.ws.rs.client.ClientRequestFilter;

import javax.xml.bind.DatatypeConverter;

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);
}
}



Backend


References

https://spring.io/guides/gs/actuator-service/



  • No labels