org.jclouds.gogrid.services
Interface GridServerClient


public interface GridServerClient

Provides synchronous access to GoGrid.

Author:
Adrian Cole, Oleksiy Yarmula
See Also:
GridServerAsyncClient,

Method Summary
 Server addServer(String name, String image, String ram, String ip, AddServerOptions... addServerOptions)
          Adds a server with specified attributes
 Server deleteById(long id)
          Deletes the server by Id
 Server deleteByName(String name)
          Deletes the server by name; NOTE: Using this parameter may generate an error if one or more servers share a non-unique name.
 Server editServerDescription(long id, String newDescription)
          Edits an existing server
 Server editServerRam(long id, String idOrNameOfRam)
          Edits an existing server
 Server editServerType(long id, String idOrNameOfType)
          Edits an existing server
 Set<Option> getDatacenters()
          Retrieves the list of supported Datacenters to launch servers into.
 Set<Option> getRamSizes()
          Retrieves the list of supported RAM configurations.
 Credentials getServerCredentials(long id)
           
 Map<String,Credentials> getServerCredentialsList()
          Returns a map of running servers' names to the log in credentials.
 Set<Server> getServerList(GetServerListOptions... getServerListOptions)
          Returns the list of all servers.
 Set<Server> getServersById(long... ids)
          Returns the server(s) by unique id(s).
 Set<Server> getServersByName(String... names)
          Returns the server(s) by unique name(s).
 Set<Option> getTypes()
          Retrieves the list of supported server types, for example Web/App Server and Database Server.
 Server power(String idOrName, PowerCommand power)
          Changes the server's state according to PowerCommand
 

Method Detail

getServerList

Set<Server> getServerList(GetServerListOptions... getServerListOptions)
Returns the list of all servers. The result can be narrowed down by providing the options.

Parameters:
getServerListOptions - options to narrow down the result
Returns:
servers found by the request

getServersByName

Set<Server> getServersByName(String... names)
Returns the server(s) by unique name(s). Given a name or a set of names, finds one or multiple servers.

Parameters:
names - to get the servers
Returns:
server(s) matching the name(s)

getServersById

Set<Server> getServersById(long... ids)
Returns the server(s) by unique id(s). Given an id or a set of ids, finds one or multiple servers.

Parameters:
ids - to get the servers
Returns:
server(s) matching the ids

getServerCredentialsList

Map<String,Credentials> getServerCredentialsList()
Returns a map of running servers' names to the log in credentials.

Returns:
map Credentials>

getServerCredentials

Credentials getServerCredentials(long id)
Returns:
the login user and password of a server, or null if none found

addServer

Server addServer(String name,
                 String image,
                 String ram,
                 String ip,
                 AddServerOptions... addServerOptions)
Adds a server with specified attributes

Parameters:
name - name of the server
image - image (id or name)
ram - ram type (id or name)
ip - ip address
addServerOptions - options to make it a sandbox instance or/and description
Returns:
created server

power

Server power(String idOrName,
             PowerCommand power)
Changes the server's state according to PowerCommand

Parameters:
idOrName - id or name of the server to apply the command
power - new desired state
Returns:
server immediately after applying the command

deleteById

Server deleteById(long id)
Deletes the server by Id

Parameters:
id - id of the server to delete
Returns:
server before the command is executed

deleteByName

Server deleteByName(String name)
Deletes the server by name; NOTE: Using this parameter may generate an error if one or more servers share a non-unique name.

Parameters:
name - name of the server to be deleted
Returns:
server before the command is executed

editServerDescription

Server editServerDescription(long id,
                             String newDescription)
Edits an existing server

Parameters:
id - id of the existing server
newDescription - description to replace the current one
Returns:
edited server

editServerType

Server editServerType(long id,
                      String idOrNameOfType)
Edits an existing server

Parameters:
id - id of the existing server
idOrNameOfType - type to replace the current one
Returns:
edited server

editServerRam

Server editServerRam(long id,
                     String idOrNameOfRam)
Edits an existing server

Parameters:
id - id of the existing server
idOrNameOfRam - ram to replace the current one
Returns:
edited server

getRamSizes

Set<Option> getRamSizes()
Retrieves the list of supported RAM configurations. The objects will have RAM ID, name and description. In most cases, id or name will be used for addServer(java.lang.String, java.lang.String, java.lang.String, java.lang.String, org.jclouds.gogrid.options.AddServerOptions...). To see how RAM maps to CPU and disk space (as of March 2010), see GoGridComputeServiceContextModule.provideSizeToRam() .

Returns:
supported ram sizes

getTypes

Set<Option> getTypes()
Retrieves the list of supported server types, for example Web/App Server and Database Server. In most cases, id or name will be used for editServerType(long, java.lang.String).

Returns:
supported server types

getDatacenters

Set<Option> getDatacenters()
Retrieves the list of supported Datacenters to launch servers into. The objects will have datacenter ID, name and description. In most cases, id or name will be used for addServer(java.lang.String, java.lang.String, java.lang.String, java.lang.String, org.jclouds.gogrid.options.AddServerOptions...).

Returns:
supported datacenters


Copyright © 2009-2012 jclouds. All Rights Reserved.