@GET @Path("/current-state") @ApiOperation(value = "Fetch config key values in batch", notes="Returns a map of config name to value") public Map<String, Object> batchConfigRead( @ApiParam(value = "Application ID or name", required = true) @PathParam("application") String application, @ApiParam(value = "Entity ID or name", required = true) @PathParam("entity") String entityToken, @ApiParam(value = "Policy ID or name", required = true) @PathParam("policy") String policyToken) ;
@GET @Path("/current-state") @ApiOperation(value = "Fetch sensor values in batch", notes="Returns a map of sensor name to value") public Map<String, Object> batchSensorRead( @ApiParam(value = "Application ID or name", required = true) @PathParam("application") final String application, @ApiParam(value = "Entity ID or name", required = true) @PathParam("entity") final String entityToken ) ;
@GET @Path("/current-state") @ApiOperation(value = "Fetch policy states in batch", notes="Returns a map of policy ID to whether it is active") public Map<String, Boolean> batchConfigRead( @ApiParam(value = "Application ID or name", required = true) @PathParam("application") String application, @ApiParam(value = "Entity ID or name", required = true) @PathParam("entity") String entityToken) ;
@GET @Path("/policies") @ApiOperation(value = "List available policies optionally matching a query", responseClass = "CatalogItemSummary", multiValueResponse = true) public List<CatalogItemSummary> listPolicies( @ApiParam(name = "regex", value = "Regular expression to search for") final @QueryParam("regex") @DefaultValue("") String regex, @ApiParam(name = "fragment", value = "Substring case-insensitive to search for") final @QueryParam("fragment") @DefaultValue("") String fragment ) ;
@GET @Path("/entities") @ApiOperation(value = "List available entity types optionally matching a query", responseClass = "CatalogItemSummary", multiValueResponse = true) public List<CatalogItemSummary> listEntities( @ApiParam(name = "regex", value = "Regular expression to search for") final @QueryParam("regex") @DefaultValue("") String regex, @ApiParam(name = "fragment", value = "Substring case-insensitive to search for") final @QueryParam("fragment") @DefaultValue("") String fragment ) { return getCatalogItemSummariesMatchingRegexFragment(CatalogPredicates.IS_ENTITY, regex, fragment); }
@DELETE @Path("/{locationId}") @ApiOperation(value = "Delete a location object by id") public void delete( @ApiParam(value = "Location id to delete", required = true) @PathParam("locationId") String locationId) ;
@POST @ApiOperation(value = "Add a new entity or policy type by uploading a Groovy script", responseClass = "String") public Response create( @ApiParam(name = "groovyCode", value = "Groovy code for the entity or policy", required = true) @Valid String groovyCode ) ;
@POST @Path("/groovy") @Consumes("application/text") @ApiOperation(value = "Execute a groovy script", responseClass = "brooklyn.rest.domain.SensorSummary") public ScriptExecutionSummary groovy( @Context HttpServletRequest request, @ApiParam(name = "script", value = "Groovy script to execute", required = true) String script ) ;
@POST @Path("/locationProvisioningAllowed") @ApiOperation(value = "Sets whether location provisioning is permitted (beta feature)") public Response locationProvisioningAllowed( @ApiParam(name = "allowed", value = "Whether allowed or not", required = true) @QueryParam("allowed") boolean allowed); }
@GET @Path("/applications") @ApiOperation(value = "Fetch a list of application templates optionally matching a query", responseClass = "CatalogItemSummary", multiValueResponse = true) public List<CatalogItemSummary> listApplications( @ApiParam(name = "regex", value = "Regular expression to search for") final @QueryParam("regex") @DefaultValue("") String regex, @ApiParam(name = "fragment", value = "Substring case-insensitive to search for") final @QueryParam("fragment") @DefaultValue("") String fragment ) { return getCatalogItemSummariesMatchingRegexFragment(CatalogPredicates.IS_TEMPLATE, regex, fragment); }
@GET @Path("/{task}/stream/{streamId}") @ApiOperation(value = "Return the contents of the given stream") @ApiErrors(value = { @ApiError(code = 404, reason = "Could not find task or stream") }) public String stream( @ApiParam(value = "Task ID", required = true) @PathParam("task") String taskId, @ApiParam(value = "Stream ID", required = true) @PathParam("streamId") String streamId);
@GET @ApiOperation(value = "Fetch the config keys for a specific application entity", responseClass = "brooklyn.rest.domain.ConfigSummary", multiValueResponse = true) @ApiErrors(value = { @ApiError(code = 404, reason = "Could not find application or entity") }) public List<EntityConfigSummary> list( @ApiParam(value = "Application ID or name", required = true) @PathParam("application") final String application, @ApiParam(value = "Entity ID or name", required = true) @PathParam("entity") final String entityToken ) ;
@GET @ApiOperation(value = "Fetch the list of effectors", responseClass = "brooklyn.rest.domain.EffectorSummary", multiValueResponse = true) @ApiErrors(value = { @ApiError(code = 404, reason = "Could not find application or entity") }) public List<EffectorSummary> list( @ApiParam(name = "application", value = "Application name", required = true) @PathParam("application") final String application, @ApiParam(name = "entity", value = "Entity name", required = true) @PathParam("entity") final String entityToken ) ;
@GET @Path("/icon/{itemId}") @ApiOperation(value = "Return the icon for a given catalog entry (application/image or HTTP redirect)") @ApiErrors(value = { @ApiError(code = 404, reason = "Item not found") }) @Produces("application/image") public Response getIcon( @ApiParam(name = "itemId", value = "ID of catalog item (application, entity, policy)") final @PathParam("itemId") @DefaultValue("") String itemId ) ;
@GET @Path("/entities/{entityId}") @ApiOperation(value = "Fetch an entity's definition from the catalog", responseClass = "CatalogEntitySummary", multiValueResponse = true) @ApiErrors(value = { @ApiError(code = 404, reason = "Entity not found") }) public CatalogEntitySummary getEntity( @ApiParam(name = "entityId", value = "The ID of the entity or template to retrieve", required = true) @PathParam("entityId") String entityId) throws Exception ;
@GET @Path("/policies/{policyId}") @ApiOperation(value = "Fetch a policy's definition from the catalog", responseClass = "CatalogItemSummary", multiValueResponse = true) @ApiErrors(value = { @ApiError(code = 404, reason = "Entity not found") }) public CatalogItemSummary getPolicy( @ApiParam(name = "policyId", value = "The ID of the policy to retrieve", required = true) @PathParam("policyId") String policyId) throws Exception ;
@GET @ApiOperation(value = "Fetch the list of entities for a given application", responseClass = "brooklyn.rest.domain.EntitySummary", multiValueResponse = true) @ApiErrors(value = { @ApiError(code = 404, reason = "Application not found") }) public List<EntitySummary> list( @ApiParam(value = "Application ID or name", required = true) @PathParam("application") final String application) ;
@DELETE @Path("/{locationId}") @ApiOperation(value = "Delete a location object by id") public void delete( @ApiParam(value = "Location id to delete", required = true) @PathParam("locationId") String locationId) { brooklyn().getLocationRegistry().removeDefinedLocation(locationId); }
@POST @ApiOperation(value = "Add a new entity or policy type to the catalog by uploading a Groovy script from browser using multipart/form-data", responseClass = "String") @Consumes(MediaType.MULTIPART_FORM_DATA) public Response createFromMultipart( @ApiParam(name = "groovyCode", value = "multipart/form-data file input field") @FormDataParam("groovyCode") InputStream uploadedInputStream, @FormDataParam("groovyCode") FormDataContentDisposition fileDetail) throws IOException { return brooklyn().createCatalogEntryFromGroovyCode(CharStreams.toString(new InputStreamReader(uploadedInputStream, Charsets.UTF_8))); }
@GET @ApiOperation(value = "Fetch the list of entities for a given application", responseClass = "brooklyn.rest.domain.EntitySummary", multiValueResponse = true) @ApiErrors(value = { @ApiError(code = 404, reason = "Application not found") }) public List<EntitySummary> list( @ApiParam(value = "Application ID or name", required = true) @PathParam("application") final String application) { return summaryForChildrenEntities(brooklyn().getApplication(application)); }