@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("/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) ;
@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 ) ;
@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("/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 ) ;
@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("/{entity}/activities/{task}") @ApiOperation(value = "Fetch task details", responseClass = "brooklyn.rest.domain.TaskSummary") @ApiErrors(value = { @ApiError(code = 404, reason = "Could not find application, entity or task") }) @Produces("text/json") public TaskSummary getTask( @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, @ApiParam(value = "Task ID", required = true) @PathParam("task") String taskId );
@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("/{locationId}") @ApiOperation(value = "Fetch details about a location", responseClass = "brooklyn.rest.domain.LocationSummary", multiValueResponse = true) public LocationSummary get( @ApiParam(value = "Location id to fetch", required = true) @PathParam("locationId") String locationId) ;
@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 ) { return getCatalogItemSummariesMatchingRegexFragment(CatalogPredicates.IS_POLICY, regex, fragment); }
@GET @Path("/fetch") @ApiOperation( value = "Fetch display details for all applications and optionally selected additional entities" ) public JsonNode fetch( @ApiParam(value="Selected additional entity ID's to include, comma-separated", required=false) @DefaultValue("") @QueryParam("items") String items);
@POST @ApiOperation(value = "Create a new location", responseClass = "String") public Response create( @ApiParam(name = "locationSpec", value = "Location specification object", required = true) @Valid LocationSpec locationSpec) ;
@POST @Path("/{policy}/stop") @ApiOperation(value = "Suspends a policy") @ApiErrors(value = { @ApiError(code = 404, reason = "Could not find application, entity or policy") }) public Response stop( @ApiParam(name = "application", value = "Application ID or name", required = true) @PathParam("application") String application, @ApiParam(name = "entity", value = "Entity ID or name", required = true) @PathParam("entity") String entityToken, @ApiParam(name = "policy", value = "Policy ID or name", required = true) @PathParam("policy") String policyId ) ;
@GET @Path("/{config}") @ApiOperation(value = "Fetch config value", responseClass = "Object") @ApiErrors(value = { @ApiError(code = 404, reason = "Could not find application, entity or config key") }) public String get( @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 = "Config key ID", required = true) @PathParam("config") String configKeyName ) ; }