Interface ServerApi


public interface ServerApi
Provides synchronous access to Server.

See Also:
  • Method Details

    • list

      @Named("server:list") @POST @Path("/server/list/format/json") @Consumes("application/json") com.google.common.collect.FluentIterable<Server> list()
      Get a list of all servers on this account.
      Returns:
      an account's associated server objects.
    • get

      @Named("server:details") @POST @Path("/server/details/format/json") @Consumes("application/json") ServerDetails get(@FormParam("serverid") String id)
      Get detailed information about a server such as hostname, hardware configuration (cpu, memory and disk), ip addresses, cost, transfer, os and more.
      Parameters:
      id - id of the server
      Returns:
      server or null if not found
    • getStatus

      @Named("server:status") @POST @Path("/server/status/format/json") @Consumes("application/json") ServerStatus getStatus(@FormParam("serverid") String id, ServerStatusOptions... options)
      Get detailed information about a server status including up-time and hardware usage (cpu, disk, memory and bandwidth)
      Parameters:
      id - id of the server
      options - optional parameters
      Returns:
      the status of the server or null if not found
    • getLimits

      @Named("server:limits") @POST @Path("/server/limits/format/json") @Consumes("application/json") SortedMap<String,ServerLimit> getLimits(@FormParam("serverid") String id)
      Get detailed information about a server's limits (for OpenVZ only).

      Parameters:
      id - id of the server
      Returns:
      the requested information about the server or null if not found
    • getConsole

      @Named("server:console") @POST @Path("/server/console/format/json") @Consumes("application/json") Console getConsole(@FormParam("serverid") String id)
      Get information about how to connect to a server via VNC
      Parameters:
      id - id of the server
      Returns:
      the requested information about the server or null if not found
    • getAllowedArgumentsForCreateByPlatform

      @Named("server:allowedarguments") @GET @Path("/server/allowedarguments/format/json") @Consumes("application/json") Map<String,AllowedArgumentsForCreateServer> getAllowedArgumentsForCreateByPlatform()
      Get information about the OS templates available
      Returns:
      the set of information about each template
    • listTemplates

      @Named("server:templates") @GET @Path("/server/templates/format/json") @Consumes("application/json") com.google.common.collect.FluentIterable<OSTemplate> listTemplates()
      Get information about valid arguments to #createServer for each platform
      Returns:
      a map of argument lists, keyed on platform
    • resetLimit

      @Named("server:resetlimit") @POST @Path("/server/resetlimit/format/json") @Consumes("application/json") SortedMap<String,ServerLimit> resetLimit(@FormParam("serverid") String id, @FormParam("type") String type)
      Reset the fail count for a server limit (for OpenVZ only).
      Parameters:
      id - id of the server
      type - the type of limit to reset
    • reboot

      @Named("server:reboot") @POST @Path("/server/reboot/format/json") @Consumes("application/json") ServerDetails reboot(@FormParam("serverid") String id)
      Reboot a server
      Parameters:
      id - id of the server
    • start

      @Named("server:start") @POST @Path("/server/start/format/json") @Consumes("application/json") ServerDetails start(@FormParam("serverid") String id)
      Start a server
      Parameters:
      id - id of the server
    • stop

      @Named("server:stop") @POST @Path("/server/stop/format/json") @Consumes("application/json") ServerDetails stop(@FormParam("serverid") String id)
      Stop a server
      Parameters:
      id - id of the server
    • hardStop

      @Named("server:stop:hard") @POST @Path("/server/stop/format/json") @Consumes("application/json") ServerDetails hardStop(@FormParam("serverid") String id)
      hard stop a server
      Parameters:
      id - id of the server
    • createWithHostnameAndRootPassword

      @Named("server:create") @POST @Path("/server/create/format/json") @Consumes("application/json") ServerDetails createWithHostnameAndRootPassword(ServerSpec serverSpec, String hostname, String rootPassword, CreateServerOptions... options)
      Create a new server
      Parameters:
      hostname - the host name of the new server
      rootPassword - the root password to use
      options - optional settings ex. description
    • clone

      @Named("server:clone") @POST @Path("/server/clone/format/json") @Consumes("application/json") ServerDetails clone(@FormParam("serverid") String serverid, @FormParam("hostname") String hostname, CloneServerOptions... options)
      Clone a server
      Parameters:
      serverid - the serverId of the server to clone
      hostname - the new host name of the cloned server
      options - the settings to change
    • update

      @Named("server:edit") @POST @Path("/server/edit/format/json") @Consumes("application/json") ServerDetails update(@FormParam("serverid") String serverid, UpdateServerOptions options)
      Update the configuration of a server
      Parameters:
      serverid - the serverId of the server to edit
      options - the settings to change
    • destroy

      @Named("server:destroy") @POST @Path("/server/destroy/format/json") void destroy(@FormParam("serverid") String id, DestroyServerOptions keepIp)
      Destroy a server
      Parameters:
      id - the id of the server
      keepIp - if DestroyServerOptions.keepIp(true) the servers ip will be retained for use in your GleSYS account
    • resetPassword

      @Named("server:resetpassword") @POST @Path("/server/resetpassword/format/json") @Consumes("application/json") ServerDetails resetPassword(@FormParam("serverid") String id, @FormParam("rootpassword") String password)
      Reset the root password of a server
      Parameters:
      id - the id of the server
      password - the new password to use
    • getResourceUsage

      @Named("server:resourceusage") @POST @Path("/server/resourceusage/format/json") @Consumes("application/json") ResourceUsage getResourceUsage(@FormParam("serverid") String id, @FormParam("resource") String resource, @FormParam("resolution") String resolution)
      Return resource usage over time for server
      Parameters:
      id - the id of the server
      resource - the name of the resource to retrieve usage information for (e.g. "cpuusage")
      resolution - the time-period to extract data for (one of "minute", "hour" or "day)