use of org.onosproject.core.ApplicationId in project onos by opennetworkinglab.
the class ApplicationsWebResource method activateApp.
/**
* Activate application.
* Activates the specified application.
*
* @param name application name
* @return 200 OK; 404; 401
*/
@POST
@Produces(MediaType.APPLICATION_JSON)
@Path("{name}/active")
public Response activateApp(@PathParam("name") String name) {
ApplicationAdminService service = get(ApplicationAdminService.class);
ApplicationId appId = nullIsNotFound(service.getId(name), APP_NOT_FOUND + ": " + name);
service.activate(appId);
return response(service, appId);
}
use of org.onosproject.core.ApplicationId in project onos by opennetworkinglab.
the class ApplicationsWebResource method uninstallApp.
/**
* Uninstall application.
* Uninstalls the specified application deactivating it first if necessary.
*
* @param name application name
* @return 204 NO CONTENT
*/
@DELETE
@Path("{name}")
public Response uninstallApp(@PathParam("name") String name) {
ApplicationAdminService service = get(ApplicationAdminService.class);
ApplicationId appId = service.getId(name);
if (appId != null) {
service.uninstall(appId);
}
return Response.noContent().build();
}
use of org.onosproject.core.ApplicationId in project onos by opennetworkinglab.
the class ApplicationsWebResource method getAppBits.
/**
* Get application OAR/JAR file.
* Returns the OAR/JAR file used to install the specified application.
*
* @param name application name
* @return 200 OK; 404; 401
*/
@GET
@Produces(MediaType.APPLICATION_OCTET_STREAM)
@Path("{name}/bits")
public Response getAppBits(@PathParam("name") String name) {
ApplicationAdminService service = get(ApplicationAdminService.class);
ApplicationId appId = nullIsNotFound(service.getId(name), APP_ID_NOT_FOUND + ": " + name);
InputStream bits = service.getApplicationArchive(appId);
return ok(bits).build();
}
use of org.onosproject.core.ApplicationId in project onos by opennetworkinglab.
the class ApplicationsWebResource method registerAppId.
/**
* Registers an on or off platform application.
*
* @param name application name
* @return 200 OK; 404; 401
* @onos.rsModel ApplicationId
*/
@POST
@Produces(MediaType.APPLICATION_JSON)
@Path("{name}/register")
public Response registerAppId(@PathParam("name") String name) {
CoreService service = get(CoreService.class);
ApplicationId appId = service.registerApplication(name);
return response(appId);
}
use of org.onosproject.core.ApplicationId in project onos by opennetworkinglab.
the class ConnectivityIntentCommand method appId.
@Override
protected ApplicationId appId() {
ApplicationId appIdForIntent;
if (appId == null) {
appIdForIntent = super.appId();
} else {
CoreService service = get(CoreService.class);
appIdForIntent = service.getAppId(appId);
}
return appIdForIntent;
}
Aggregations