use of org.onosproject.core.Application in project onos by opennetworkinglab.
the class ApplicationManager method install.
@Override
public Application install(InputStream appDescStream) {
checkNotNull(appDescStream, "Application archive stream cannot be null");
Application app = store.create(appDescStream);
SecurityUtil.register(app.id());
return app;
}
use of org.onosproject.core.Application in project onos by opennetworkinglab.
the class ApplicationsWebResource method health.
/**
* Get application health.
*
* @param name application name
* @return 200 OK with app health in the body; 404 if app is not found
*/
@GET
@Path("{name}/health")
public Response health(@PathParam("name") String name) {
ApplicationAdminService service = get(ApplicationAdminService.class);
ApplicationId appId = service.getId(name);
nullIsNotFound(appId, APP_ID_NOT_FOUND + ": " + name);
Application app = service.getApplication(appId);
nullIsNotFound(app, APP_NOT_FOUND + ": " + appId);
ComponentsMonitorService componentsMonitorService = get(ComponentsMonitorService.class);
boolean ready = componentsMonitorService.isFullyStarted(app.features());
return Response.ok(mapper().createObjectNode().put("message", ready ? APP_READY : APP_PENDING)).build();
}
Aggregations