Implemented getIpAddresses for Terremark ECloud.


This commit is contained in:
Mike 2011-02-18 10:24:49 -05:00
parent 9e8e1895fa
commit e8a4c28fbc
3 changed files with 27 additions and 0 deletions

View File

@ -23,6 +23,7 @@ import static javax.ws.rs.core.MediaType.APPLICATION_XML;
import static org.jclouds.vcloud.VCloudMediaType.NETWORK_XML;
import static org.jclouds.vcloud.terremark.TerremarkECloudMediaType.INTERNETSERVICESLIST_XML;
import static org.jclouds.vcloud.terremark.TerremarkECloudMediaType.INTERNETSERVICE_XML;
import static org.jclouds.vcloud.terremark.TerremarkECloudMediaType.IPADDRESS_LIST_XML;
import static org.jclouds.vcloud.terremark.TerremarkECloudMediaType.KEYSLIST_XML;
import static org.jclouds.vcloud.terremark.TerremarkECloudMediaType.PUBLICIP_XML;
@ -50,6 +51,7 @@ import org.jclouds.vcloud.filters.SetVCloudTokenCookie;
import org.jclouds.vcloud.functions.OrgNameVDCNameResourceEntityNameToEndpoint;
import org.jclouds.vcloud.terremark.binders.BindCreateKeyToXmlPayload;
import org.jclouds.vcloud.terremark.domain.InternetService;
import org.jclouds.vcloud.terremark.domain.IpAddress;
import org.jclouds.vcloud.terremark.domain.KeyPair;
import org.jclouds.vcloud.terremark.domain.Protocol;
import org.jclouds.vcloud.terremark.domain.PublicIpAddress;
@ -61,6 +63,7 @@ import org.jclouds.vcloud.terremark.functions.VDCURIToPublicIPsEndpoint;
import org.jclouds.vcloud.terremark.options.AddInternetServiceOptions;
import org.jclouds.vcloud.terremark.xml.InternetServiceHandler;
import org.jclouds.vcloud.terremark.xml.InternetServicesHandler;
import org.jclouds.vcloud.terremark.xml.IpAddressesHandler;
import org.jclouds.vcloud.terremark.xml.KeyPairByNameHandler;
import org.jclouds.vcloud.terremark.xml.KeyPairHandler;
import org.jclouds.vcloud.terremark.xml.KeyPairsHandler;
@ -239,4 +242,13 @@ public interface TerremarkECloudAsyncClient extends TerremarkVCloudAsyncClient {
@Consumes(APPLICATION_XML)
@ExceptionParser(ReturnNullOnNotFoundOr404.class)
ListenableFuture<? extends TerremarkNetwork> getTerremarkNetwork(@EndpointParam URI network);
/**
* @see TerremarkECloudClient#getIpAddresses
*/
@GET
@Consumes(IPADDRESS_LIST_XML)
@XMLResponseParser(IpAddressesHandler.class)
@ExceptionParser(ReturnEmptySetOnNotFoundOr404.class)
ListenableFuture<? extends Set<IpAddress>> getIpAddresses(@EndpointParam URI network);
}

View File

@ -20,11 +20,13 @@
package org.jclouds.vcloud.terremark;
import java.net.URI;
import java.util.Set;
import java.util.concurrent.TimeUnit;
import javax.annotation.Nullable;
import org.jclouds.concurrent.Timeout;
import org.jclouds.vcloud.terremark.domain.IpAddress;
import org.jclouds.vcloud.terremark.domain.PublicIpAddress;
import org.jclouds.vcloud.terremark.domain.TerremarkNetwork;
import org.jclouds.vcloud.terremark.domain.TerremarkOrgNetwork;
@ -55,4 +57,6 @@ public interface TerremarkECloudClient extends TerremarkVCloudClient {
TerremarkNetwork getTerremarkNetwork(URI network);
Set<IpAddress> getIpAddresses(URI network);
}

View File

@ -67,4 +67,15 @@ public interface TerremarkECloudMediaType extends TerremarkVCloudMediaType {
* "application/vnd.tmrk.ecloud.keysList+xml"
*/
public final static MediaType KEYSLIST_XML_TYPE = new MediaType("application", "vnd.tmrk.ecloud.keysList+xml");
/**
* "application/vnd.tmrk.ecloud.ipAddressList+xml"
*/
public final static String IPADDRESS_LIST_XML = "application/vnd.tmrk.ecloud.ipAddressList+xml";
/**
* "application/vnd.tmrk.ecloud.ipAddressList+xml"
*/
public final static MediaType IPADDRESSES_LIST_XML_TYPE = new MediaType("application", "vnd.tmrk.ecloud.ipAddressList+xml");
}