|
Brooklyn | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectbrooklyn.rest.resources.AbstractBrooklynRestResource
brooklyn.rest.resources.PolicyResource
@Path("/v1/applications/{application}/entities/{entity}/policies") @Apidoc("Entity policies") @Produces("application/json") public class PolicyResource extends AbstractBrooklynRestResource
Method Summary | |
---|---|
java.lang.String
|
addPolicy(java.lang.String application, java.lang.String entityToken, java.lang.String policyTypeName, java.util.Map config)
|
java.util.Map
|
batchConfigRead(java.lang.String application, java.lang.String entityToken)
|
Response
|
destroy(java.lang.String application, java.lang.String entityToken, java.lang.String policyToken)
|
Lifecycle
|
getStatus(java.lang.String application, java.lang.String entityToken, java.lang.String policyId)
|
java.util.List
|
list(java.lang.String application, java.lang.String entityToken)
|
Response
|
start(java.lang.String application, java.lang.String entityToken, java.lang.String policyId)
|
Response
|
stop(java.lang.String application, java.lang.String entityToken, java.lang.String policyId)
|
Methods inherited from class AbstractBrooklynRestResource | |
---|---|
brooklyn, injectManagementContext, mgmt |
Method Detail |
---|
@POST @ApiOperation(value = "Add a policy", notes="Returns ID of policy added; policy type must have no-arg constructor " + "and setConfig(Map) method should be available if non-empty config is supplied") @ApiErrors(value = { @ApiError(code = 404, reason = "Could not find application, entity or policy") }) public java.lang.String addPolicy(@ApiParam(name = "application", value = "Application ID or name", required = true) @PathParam("application") java.lang.String application, @ApiParam(name = "entity", value = "Entity ID or name", required = true) @PathParam("entity") java.lang.String entityToken, @ApiParam(name = "policyType", value = "Class of policy to add", required = true) @QueryParam("type") java.lang.String policyTypeName, @ApiParam(name = "config", value = "Configuration for the policy (as key value pairs)", required = true) java.util.Map config)
@GET @Path("/current-state") @ApiOperation(value = "Fetch policy states in batch", notes="Returns a map of policy ID to whether it is active") public java.util.Map batchConfigRead(@ApiParam(value = "Application ID or name", required = true) @PathParam("application") java.lang.String application, @ApiParam(value = "Entity ID or name", required = true) @PathParam("entity") java.lang.String entityToken)
@POST @Path("/{policy}/destroy") @ApiOperation(value = "Destroy a policy", notes="Removes a policy from being associated with the entity and destroys it (stopping first if running)") @ApiErrors(value = { @ApiError(code = 404, reason = "Could not find application, entity or policy") }) public Response destroy(@ApiParam(name = "application", value = "Application ID or name", required = true) @PathParam("application") java.lang.String application, @ApiParam(name = "entity", value = "Entity ID or name", required = true) @PathParam("entity") java.lang.String entityToken, @ApiParam(name = "policy", value = "Policy ID or name", required = true) @PathParam("policy") java.lang.String policyToken)
@GET @Path("/{policy}") @ApiOperation(value = "Gets status of a policy (RUNNING / SUSPENDED)") @ApiErrors(value = { @ApiError(code = 404, reason = "Could not find application, entity or policy") }) public Lifecycle getStatus(@ApiParam(name = "application", value = "Application ID or name", required = true) @PathParam("application") java.lang.String application, @ApiParam(name = "entity", value = "Entity ID or name", required = true) @PathParam("entity") java.lang.String entityToken, @ApiParam(name = "policy", value = "Policy ID or name", required = true) @PathParam("policy") java.lang.String policyId)
@GET @ApiOperation(value = "Fetch the policies attached to a specific application entity", responseClass = "brooklyn.rest.domain.PolicySummary", multiValueResponse = true) @ApiErrors(value = { @ApiError(code = 404, reason = "Could not find application or entity") }) public java.util.List list(@ApiParam(value = "Application ID or name", required = true) @PathParam("application") java.lang.String application, @ApiParam(value = "Entity ID or name", required = true) @PathParam("entity") java.lang.String entityToken)
@POST @Path("/{policy}/start") @ApiOperation(value = "Start or resume a policy") @ApiErrors(value = { @ApiError(code = 404, reason = "Could not find application, entity or policy") }) public Response start(@ApiParam(name = "application", value = "Application ID or name", required = true) @PathParam("application") java.lang.String application, @ApiParam(name = "entity", value = "Entity ID or name", required = true) @PathParam("entity") java.lang.String entityToken, @ApiParam(name = "policy", value = "Policy ID or name", required = true) @PathParam("policy") java.lang.String policyId)
@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") java.lang.String application, @ApiParam(name = "entity", value = "Entity ID or name", required = true) @PathParam("entity") java.lang.String entityToken, @ApiParam(name = "policy", value = "Policy ID or name", required = true) @PathParam("policy") java.lang.String policyId)
Brooklyn Multi-Cloud Application Management Platform
brooklyncentral.github.com. Apache License. © 2012.