diff --git a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/features/InternetServiceAsyncClient.java b/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/features/InternetServiceAsyncClient.java index 91329c89cd..a5f0b8a6c3 100644 --- a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/features/InternetServiceAsyncClient.java +++ b/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/features/InternetServiceAsyncClient.java @@ -73,5 +73,15 @@ public interface InternetServiceAsyncClient { @Consumes("application/vnd.tmrk.cloud.internetService") @JAXBResponseParser @ExceptionParser(ReturnNullOnNotFoundOr404.class) - InternetService createInternetService(@EndpointParam URI uri, @BinderParam(BindCreateInternetServiceToXmlPayload.class)InternetService data); + ListenableFuture createInternetService(@EndpointParam URI uri, @BinderParam(BindCreateInternetServiceToXmlPayload.class)InternetService data); + + /** + * @see org.jclouds.tmrk.enterprisecloud.features.InternetServiceClient#removeInternetService + */ + @DELETE + @Consumes("application/vnd.tmrk.cloud.task") + @JAXBResponseParser + @ExceptionParser(ReturnNullOnNotFoundOr404.class) + ListenableFuture removeInternetService(@EndpointParam URI uri); + } diff --git a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/features/InternetServiceClient.java b/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/features/InternetServiceClient.java index d2e6ced76e..9b04cce4fc 100644 --- a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/features/InternetServiceClient.java +++ b/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/features/InternetServiceClient.java @@ -40,7 +40,7 @@ public interface InternetServiceClient { /** - * getInternetService call returns information regarding a specified Internet service defined in an environment. + * The getInternetService call returns information regarding a specified Internet service defined in an environment. * @param uri the uri of the internet service * e.g. /cloudapi/ecloud/internetservices/{internet service id} * @return the internet service @@ -98,4 +98,14 @@ public interface InternetServiceClient { * @return */ InternetService createInternetService(URI uri, InternetService data); + + /** + * The removeInternetService call removes an Internet service from an environment. + * If successful, the call returns the task that removed the Internet service. + * Note: The Internet service must have no node services associated to remove. + * @param uri the uri of the call based on the internet service + * e.g. /cloudapi/ecloud/internetServices/{internet service identifier} + * @return + */ + Task removeInternetService(URI uri); } diff --git a/sandbox-providers/tmrk-enterprisecloud/src/test/java/org/jclouds/tmrk/enterprisecloud/features/InternetServiceAsyncClientTest.java b/sandbox-providers/tmrk-enterprisecloud/src/test/java/org/jclouds/tmrk/enterprisecloud/features/InternetServiceAsyncClientTest.java index b1ec6b888f..92703ab909 100644 --- a/sandbox-providers/tmrk-enterprisecloud/src/test/java/org/jclouds/tmrk/enterprisecloud/features/InternetServiceAsyncClientTest.java +++ b/sandbox-providers/tmrk-enterprisecloud/src/test/java/org/jclouds/tmrk/enterprisecloud/features/InternetServiceAsyncClientTest.java @@ -113,6 +113,25 @@ public class InternetServiceAsyncClientTest extends BaseTerremarkEnterpriseCloud checkFilters(httpRequest); } + + public void testRemoveInternetService() throws SecurityException, NoSuchMethodException, IOException, URISyntaxException { + Method method = InternetServiceAsyncClient.class.getMethod("removeInternetService", URI.class); + + URI uri = URI.create("/cloudapi/ecloud/internetServices/123"); + + HttpRequest httpRequest = processor.createRequest(method, uri); + + String requestLine = "DELETE https://services-beta.enterprisecloud.terremark.com/cloudapi/ecloud/internetServices/123 HTTP/1.1"; + assertRequestLineEquals(httpRequest, requestLine); + assertNonPayloadHeadersEqual(httpRequest, + "Accept: application/vnd.tmrk.cloud.task\nx-tmrk-version: 2011-07-01\n"); + assertPayloadEquals(httpRequest, null, null, false); + + assertResponseParserClassEquals(method, httpRequest, ParseXMLWithJAXB.class); + assertExceptionParserClassEquals(method, ReturnNullOnNotFoundOr404.class); + + checkFilters(httpRequest); + } @Override protected TypeLiteral> createTypeLiteral() {