public class BrooklynApiUtil
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static void |
attemptStop(BrooklynApi api,
java.lang.String application,
Duration timeout)
Use the
effector API to invoke the stop effector on the given application. |
static TaskSummary |
deployBlueprint(BrooklynApi api,
java.lang.String blueprint)
Deploys the blueprint and returns the task summary.
|
static java.lang.String |
getTaskResult(BrooklynApi api,
java.lang.String taskId) |
static boolean |
isUnhealthyResponse(javax.ws.rs.core.Response response) |
static Status |
waitForAppStatus(BrooklynApi api,
java.lang.String application,
Status desiredStatus,
Duration timeout,
Duration pollPeriod)
Polls Brooklyn until the given application has the given status.
|
static void |
waitForRunningAndThrowOtherwise(BrooklynApi api,
java.lang.String applicationId,
java.lang.String taskId)
Waits for the application with the given ID to be running.
|
static void |
waitForRunningAndThrowOtherwise(BrooklynApi api,
java.lang.String applicationId,
java.lang.String taskId,
Duration timeout)
Waits for the application with the given ID to be running.
|
public static TaskSummary deployBlueprint(BrooklynApi api, java.lang.String blueprint) throws java.lang.Exception
java.lang.Exception
- If the response from the server when deploying was unhealthy
.public static void waitForRunningAndThrowOtherwise(BrooklynApi api, java.lang.String applicationId, java.lang.String taskId) throws java.lang.IllegalStateException
java.lang.IllegalStateException
- If the application was not running after DEFAULT_TIMEOUT
.public static void waitForRunningAndThrowOtherwise(BrooklynApi api, java.lang.String applicationId, java.lang.String taskId, Duration timeout) throws java.lang.IllegalStateException
java.lang.IllegalStateException
- If the application was not running after the given timeout.public static Status waitForAppStatus(BrooklynApi api, java.lang.String application, Status desiredStatus, Duration timeout, Duration pollPeriod)
Status.ERROR
or
Status.UNKNOWN
and desiredStatus is something else.public static void attemptStop(BrooklynApi api, java.lang.String application, Duration timeout)
effector API
to invoke the stop effector on the given application.public static java.lang.String getTaskResult(BrooklynApi api, java.lang.String taskId)
public static boolean isUnhealthyResponse(javax.ws.rs.core.Response response)