@Path(value="/") public class CloudPoolRestApiImpl extends Object implements CloudPoolRestApi
| Modifier and Type | Field and Description |
|---|---|
static String |
DEFAULT_CONFIG_FILE_NAME
Default file name (within the storage directory) in which
CloudPool configuration is stored. |
| Constructor and Description |
|---|
CloudPoolRestApiImpl(CloudPool cloudPool,
String storageDir)
Creates a
CloudPoolRestApiImpl that will store set
CloudPool configurations under a given storage directory with the
DEFAULT_CONFIG_FILE_NAME. |
CloudPoolRestApiImpl(CloudPool cloudPool,
String storageDir,
String configFileName)
Creates a
CloudPoolRestApiImpl that will store set
CloudPool configurations under a given storage directory with a
given file name. |
| Modifier and Type | Method and Description |
|---|---|
javax.ws.rs.core.Response |
attachMachine(String machineId)
Attaches an already running machine instance to the pool, growing the
pool with a new member.
|
javax.ws.rs.core.Response |
detachMachine(String machineId,
DetachMachineRequest request)
Removes a member from the pool without terminating it.
|
Path |
getCloudPoolConfigPath()
Returns the file system path where the
CloudPoolRestApiImpl
stores received CloudPool configurations. |
javax.ws.rs.core.Response |
getConfig()
Retrieves the configuration currently set for the
CloudPool. |
javax.ws.rs.core.Response |
getPool()
Retrieves the current machine pool members.
|
javax.ws.rs.core.Response |
getPoolSize()
Returns the current size of the machine pool -- both in terms of the
desired size and the actual size (as these may differ at any time).
|
javax.ws.rs.core.Response |
getStatus()
Retrieves the execution status for the cloud pool.
|
javax.ws.rs.core.Response |
setConfig(com.google.gson.JsonObject configuration)
Sets the configuration for the
CloudPool. |
javax.ws.rs.core.Response |
setDesiredSize(SetDesiredSizeRequest request)
Sets the desired number of machines in the machine pool.
|
javax.ws.rs.core.Response |
setMembershipStatus(String machineId,
SetMembershipStatusRequest request)
Sets the membership status of a given pool member.
|
javax.ws.rs.core.Response |
setServiceState(String machineId,
SetServiceStateRequest request)
Sets the service state of a given machine pool member.
|
javax.ws.rs.core.Response |
start()
Starts the cloud pool.
|
javax.ws.rs.core.Response |
stop()
Stops the cloud pool.
|
void |
storeConfig(com.google.gson.JsonObject configuration)
Stores a configuration in the
storageDir, to allow it to be
restored when the CloudPool is restarted. |
javax.ws.rs.core.Response |
terminateMachine(String machineId,
TerminateMachineRequest request)
Terminates a particular machine pool member.
|
public static final String DEFAULT_CONFIG_FILE_NAME
CloudPool configuration is stored.public CloudPoolRestApiImpl(CloudPool cloudPool, String storageDir)
CloudPoolRestApiImpl that will store set
CloudPool configurations under a given storage directory with the
DEFAULT_CONFIG_FILE_NAME.cloudPool - The back-end CloudPool that is being managed.storageDir - The directory path where runtime state for the
CloudPool is stored. The CloudPoolRestApiImpl
will use this directory to store every set configuration so
that it can be restored on restart. The directory will be
created if it does not exist.public CloudPoolRestApiImpl(CloudPool cloudPool, String storageDir, String configFileName)
CloudPoolRestApiImpl that will store set
CloudPool configurations under a given storage directory with a
given file name.cloudPool - The back-end CloudPool that is being managed.storageDir - The directory path where runtime state for the
CloudPool is stored. The CloudPoolRestApiImpl
will use this directory to store every set configuration so
that it can be restored on restart. The directory will be
created if it does not exist.configFileName - The file name, within the storageDir, in which
CloudPool configuration is stored.public javax.ws.rs.core.Response getConfig()
CloudPoolRestApiCloudPool.
More details can be found in the official API
documentation.getConfig in interface CloudPoolRestApipublic javax.ws.rs.core.Response setConfig(com.google.gson.JsonObject configuration)
CloudPoolRestApiCloudPool.
More details can be found in the official API
documentation.setConfig in interface CloudPoolRestApiconfiguration - The (JSON) configuration document to set.public javax.ws.rs.core.Response start()
CloudPoolRestApistart in interface CloudPoolRestApipublic javax.ws.rs.core.Response stop()
CloudPoolRestApistop in interface CloudPoolRestApipublic javax.ws.rs.core.Response getStatus()
CloudPoolRestApigetStatus in interface CloudPoolRestApipublic void storeConfig(com.google.gson.JsonObject configuration)
throws IOException
storageDir, to allow it to be
restored when the CloudPool is restarted.configuration - IOException - If the configuration could not be stored.public Path getCloudPoolConfigPath()
CloudPoolRestApiImpl
stores received CloudPool configurations.storageDir - public javax.ws.rs.core.Response getPool()
CloudPoolRestApigetPool in interface CloudPoolRestApipublic javax.ws.rs.core.Response setDesiredSize(SetDesiredSizeRequest request)
CloudPoolRestApisetDesiredSize in interface CloudPoolRestApirequest - A SetDesiredSizeRequest.public javax.ws.rs.core.Response getPoolSize()
CloudPoolRestApigetPoolSize in interface CloudPoolRestApipublic javax.ws.rs.core.Response terminateMachine(String machineId, TerminateMachineRequest request)
CloudPoolRestApiterminateMachine in interface CloudPoolRestApimachineId - The identifier of the machine to terminate.request - A TerminateMachineRequest.public javax.ws.rs.core.Response detachMachine(String machineId, DetachMachineRequest request)
CloudPoolRestApidetachMachine in interface CloudPoolRestApimachineId - The identifier of the machine to detach from the pool.request - A DetachMachineRequest.public javax.ws.rs.core.Response attachMachine(String machineId)
CloudPoolRestApiattachMachine in interface CloudPoolRestApimachineId - The identifier of the machine to attach to the pool.public javax.ws.rs.core.Response setServiceState(String machineId, SetServiceStateRequest request)
CloudPoolRestApisetServiceState in interface CloudPoolRestApimachineId - The machine whose service state is to be set.request - A SetServiceStateRequest.public javax.ws.rs.core.Response setMembershipStatus(String machineId, SetMembershipStatusRequest request)
CloudPoolRestApisetMembershipStatus in interface CloudPoolRestApimachineId - The machine whose service state is to be set.request - A SetMembershipStatusRequest.Copyright © 2011–2017 Elastisys. All rights reserved.