mirror of https://github.com/apache/jclouds.git
Add ability to use uuid to delete servers using the nova client
This commit is contained in:
parent
393c99561d
commit
ae287a97e8
|
@ -93,6 +93,15 @@ public interface NovaAsyncClient {
|
|||
@Path("/servers/{id}")
|
||||
ListenableFuture<Boolean> deleteServer(@PathParam("id") int id);
|
||||
|
||||
/**
|
||||
* @see NovaClient#deleteServer
|
||||
*/
|
||||
@DELETE
|
||||
@Consumes
|
||||
@ExceptionParser(ReturnFalseOnNotFoundOr404.class)
|
||||
@Path("/servers/{uuid}")
|
||||
ListenableFuture<Boolean> deleteServer(@PathParam("uuid") String uuid);
|
||||
|
||||
/**
|
||||
* @see NovaClient#rebootServer
|
||||
*/
|
||||
|
|
|
@ -82,7 +82,8 @@ public interface NovaClient {
|
|||
* @return false if the server is not found
|
||||
* @see Server
|
||||
*/
|
||||
boolean deleteServer(@PathParam("id") int id);
|
||||
boolean deleteServer(int id);
|
||||
boolean deleteServer(String id);
|
||||
|
||||
/**
|
||||
* The reboot function allows for either a soft or hard reboot of a server.
|
||||
|
|
|
@ -426,6 +426,21 @@ public class NovaAsyncClientTest extends RestClientTest<NovaAsyncClient> {
|
|||
checkFilters(request);
|
||||
}
|
||||
|
||||
public void testDeleteServerByUUID() throws IOException, SecurityException, NoSuchMethodException {
|
||||
Method method = NovaAsyncClient.class.getMethod("deleteServer", String.class);
|
||||
HttpRequest request = processor.createRequest(method, "db8a1ac6-0a35-11e1-a42f-2837371c69ae");
|
||||
|
||||
assertRequestLineEquals(request, "DELETE http://endpoint/vapiversion/servers/db8a1ac6-0a35-11e1-a42f-2837371c69ae HTTP/1.1");
|
||||
assertNonPayloadHeadersEqual(request, "Accept: */*\n");
|
||||
assertPayloadEquals(request, null, null, false);
|
||||
|
||||
assertResponseParserClassEquals(method, request, ReturnTrueIf2xx.class);
|
||||
assertSaxResponseParserClassEquals(method, null);
|
||||
assertExceptionParserClassEquals(method, ReturnFalseOnNotFoundOr404.class);
|
||||
|
||||
checkFilters(request);
|
||||
}
|
||||
|
||||
public void testChangeAdminPass() throws IOException, SecurityException, NoSuchMethodException {
|
||||
Method method = NovaAsyncClient.class.getMethod("changeAdminPass", int.class, String.class);
|
||||
HttpRequest request = processor.createRequest(method, 2, "foo");
|
||||
|
|
Loading…
Reference in New Issue