Reference Guide
Table Of Contents
- 1 Introduction
- 2 Establishing Your Test and Development Environments
- 3 Developing Applications
- Introduction
- Authentication
- REST API
- Audit Logging
- Alert Logging
- Configuration
- High Availability
- OpenFlow
- Metrics Framework
- GUI
- SKI Framework - Overview
- SKI Framework - Navigation Tree
- SKI Framework - Hash Navigation
- SKI Framework - View Life-Cycle
- SKI Framework - Live Reference Application
- UI Extension
- Introduction
- Controller Teaming
- Distributed Coordination Service
- Persistence
- Backup and Restore
- Device Driver Framework
- 4 Application Security
- 5 Including Debian Packages with Applications
- 6 Sample Application
- Application Description
- Creating Application Development Workspace
- Application Generator (Automatic Workspace Creation)
- Creating Eclipse Projects
- Updating Project Dependencies
- Building the Application
- Installing the Application
- Application Code
- 7 Testing Applications
- 8 Built-In Applications
- Appendix A
- Appendix B
- Bibliography
Installing a debian package
The path to install the debian file is “/” and requires an action string with the action word “install”
and the name of the debian package. The REST API will return a status of 200, and the string
associated with the response is JSON structure with the current status of the contorller and Admin
services (sdnc and sdna).
. . .
uri = adminRest.uri(IpAddress.LOOPBACK_IPv4, "/");
// then we need to install it
ResponseData response = adminRest.post(adminRest.login(),
uri, installRequestBytes());
if (response.status() != Response.Status.OK.getStatusCode())
throw new IllegalStateException(E_INSTALL + response.status());
. . .
private byte[] installRequestBytes() throws UnsupportedEncodingException {
String install = "{ \”action\”: " +
“\”install\”, \”name\”: “ +
“\”” + APP_DEBIAN_FILE + “\”}";
return install.getBytes(UTF8);
}
Removing the Debian Package
The application must assume the responsibility for removing the debian package when the
application is uninstalled. An application can determine that it is being uninstalled via an
AppEventListener or by checking the current state of the application in a components deactivate
method.
An application should consider the differences between “DISABLED” and “UNINSTALLED”. When
a user disables an application, the application manager removes that application from the OSGi
runtime environment, but the physical files that constitute that application are not removed from
disk. If a user decides to “ENABLE” an application that has been disabled, then it is re-introduced
into the OSGi runtime environment. When in a “DISABLED” state there is no java code from that
application executing (at least the intent is that there is no java code executing). An application
should determine if it is proper to remove (or shutdown) the installed debian package when it is
being disabled. When an application is uninstalled, it is the responsibility of the application to
remove the installed debian.
134