mirror of https://github.com/apache/jclouds.git
add startServer and stopServer
This commit is contained in:
parent
493de01cfa
commit
3e710c1c7f
|
@ -60,7 +60,7 @@ public class Server extends Resource {
|
|||
*/
|
||||
public static enum Status {
|
||||
|
||||
ACTIVE, BUILD, REBUILD, SUSPENDED, PAUSED, RESIZE, VERIFY_RESIZE, REVERT_RESIZE, PASSWORD, REBOOT, HARD_REBOOT, DELETED, UNKNOWN, ERROR, UNRECOGNIZED;
|
||||
ACTIVE, BUILD, REBUILD, SUSPENDED, PAUSED, RESIZE, VERIFY_RESIZE, REVERT_RESIZE, PASSWORD, REBOOT, HARD_REBOOT, DELETED, UNKNOWN, ERROR, STOPPED, UNRECOGNIZED;
|
||||
|
||||
public String value() {
|
||||
return name();
|
||||
|
|
|
@ -107,6 +107,26 @@ public interface ServerAsyncClient {
|
|||
@Path("/servers/{id}")
|
||||
ListenableFuture<Boolean> deleteServer(@PathParam("id") String id);
|
||||
|
||||
/**
|
||||
* @see ServerClient#startServer
|
||||
*/
|
||||
@POST
|
||||
@Path("/servers/{id}/action")
|
||||
@Consumes
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
@Payload("{\"os-start\":null}")
|
||||
ListenableFuture<Void> startServer(@PathParam("id") String id);
|
||||
|
||||
/**
|
||||
* @see ServerClient#stopServer
|
||||
*/
|
||||
@POST
|
||||
@Path("/servers/{id}/action")
|
||||
@Consumes
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
@Payload("{\"os-stop\":null}")
|
||||
ListenableFuture<Void> stopServer(@PathParam("id") String id);
|
||||
|
||||
/**
|
||||
* @see ServerClient#rebootServer
|
||||
*/
|
||||
|
|
|
@ -92,6 +92,22 @@ public interface ServerClient {
|
|||
*/
|
||||
Boolean deleteServer(String id);
|
||||
|
||||
/**
|
||||
* Start a server
|
||||
*
|
||||
* @param id
|
||||
* id of the server
|
||||
*/
|
||||
void startServer(String id);
|
||||
|
||||
/**
|
||||
* Stop a server
|
||||
*
|
||||
* @param id
|
||||
* id of the server
|
||||
*/
|
||||
void stopServer(String id);
|
||||
|
||||
/**
|
||||
* Reboot a server.
|
||||
*
|
||||
|
|
Loading…
Reference in New Issue