Interface IpApi


  • public interface IpApi
    Provides synchronous access to IP Addresses.

    See Also:
    • Method Detail

      • listFree

        @Named("ip:listfree")
        @GET
        @Path("/ip/listfree/ipversion/{ipversion}/datacenter/{datacenter}/platform/{platform}/format/json")
        @Consumes("application/json")
        com.google.common.collect.FluentIterable<String> listFree​(@PathParam("ipversion")
                                                                  int ipVersion,
                                                                  @PathParam("datacenter")
                                                                  String datacenter,
                                                                  @PathParam("platform")
                                                                  String platform)
        Get a set of all IP addresses that are available and not used on any account or server.
        Parameters:
        ipVersion - 4 or 6, for IPV4 or IPV6, respectively
        datacenter - the datacenter
        platform - the platform
        Returns:
        a set of free IP addresses
      • take

        @Named("ip:take")
        @POST
        @Path("/ip/take/format/json")
        @Consumes("application/json")
        IpDetails take​(@FormParam("ipaddress")
                       String ipAddress)
        Take a free IP address and add it to this account. You can list free IP addresses with the function listFree(). Once your free IP on this account you can add it to a server with the add() function.
        Parameters:
        ipAddress - the IP address to be add to this account (reserve)
      • release

        @Named("ip:release")
        @POST
        @Path("/ip/release/format/json")
        @Consumes("application/json")
        IpDetails release​(@FormParam("ipaddress")
                          String ipAddress)
        Return an unused IP address to the pool of free ips. If the IP address is allocated to a server, it must first be removed by calling remove(ipAddress) before it can be released.
        Parameters:
        ipAddress - the IP address to be released
      • list

        @Named("ip:listown")
        @GET
        @Path("/ip/listown/format/json")
        @Consumes("application/json")
        com.google.common.collect.FluentIterable<IpDetails> list​(ListIpOptions... options)
        Get IP addresses associated with your account (reserved, assigned to servers, etc)
        Parameters:
        options - options to filter the results (by IPV4/6, serverId, etc)
        Returns:
        the set of IP addresses
      • get

        @Named("ip:details")
        @GET
        @Path("/ip/details/ipaddress/{ipaddress}/format/json")
        @Consumes("application/json")
        IpDetails get​(@PathParam("ipaddress")
                      String ipAddress)
        Get details about the given IP address such as gateway and netmask. Different details are available on different platforms.
        Parameters:
        ipAddress - the ip address
        Returns:
        details about the given IP address
      • addToServer

        @Named("ip:add")
        @POST
        @Path("/ip/add/format/json")
        @Consumes("application/json")
        IpDetails addToServer​(@FormParam("ipaddress")
                              String ipAddress,
                              @FormParam("serverid")
                              String serverId)
        Add an IP address to an server. The IP has to be free, but reserved to this account. You are able to list such addresses with listOwn() and reserve an address for this account by using take(). To find free ips you can use ip/listfree ip to an Xen-server you have to configure the server yourself, unless the ip was added during the c server (server/create). You can get detailed information such as gateway and netmask using the ip
        Parameters:
        ipAddress - the IP address to remove
        serverId - the server to add the IP address to
      • removeFromServer

        @Named("ip:remove")
        @POST
        @Path("/ip/remove/format/json")
        @Consumes("application/json")
        IpDetails removeFromServer​(@FormParam("ipaddress")
                                   String ipAddress,
                                   @FormParam("serverid")
                                   String serverId)
        Remove an IP address from a server. This does not release it back to GleSYS pool of free ips. The address will be kept on the account so that you can use it for other servers or the same server at a later time. To completely remove the IP address from this account, use removeFromServerAndRelease to do so
        Parameters:
        ipAddress - the IP address to remove
        serverId - the server to remove the IP address from
        See Also:
        removeFromServerAndRelease(java.lang.String, java.lang.String)
      • removeFromServerAndRelease

        @Named("ip:remove:release")
        @POST
        @Path("/ip/remove/format/json")
        @Consumes("application/json")
        IpDetails removeFromServerAndRelease​(@FormParam("ipaddress")
                                             String ipAddress,
                                             @FormParam("serverid")
                                             String serverId)
        Remove an IP address from a server and release it back to GleSYS pool of free ips.
        Parameters:
        ipAddress - the IP address to remove
        serverId - the server to remove the IP address from
        See Also:
        removeFromServer(java.lang.String, java.lang.String)
      • setPtr

        @Named("ip:setptr")
        @POST
        @Path("/ip/setptr/format/json")
        @Consumes("application/json")
        IpDetails setPtr​(@FormParam("ipaddress")
                         String ipAddress,
                         @FormParam("data")
                         String ptr)
        Sets PTR data for an IP. Use ip/listown or ip/details to get current PTR data
      • resetPtr

        @Named("ip:resetptr")
        @POST
        @Path("/ip/resetptr/format/json")
        @Consumes("application/json")
        IpDetails resetPtr​(@FormParam("ipaddress")
                           String ipAddress)
        Resets PTR data for an IP back to the default value