Package org.jclouds.gogrid.features
Interface GridServerApi
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Server
addServer(String name, String image, String ram, String ip, AddServerOptions... addServerOptions)
Adds a server with specified attributesServer
deleteById(long id)
Deletes the server by IdServer
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 serverServer
editServerRam(long id, String ram)
Edits an existing serverServer
editServerType(long id, String newType)
Edits an existing serverSet<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 toPowerCommand
-
-
-
Method Detail
-
getServerList
@GET @Path("/grid/server/list") 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
@GET @Path("/grid/server/get") 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
@GET @Path("/grid/server/get") 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
@GET @Path("/support/password/list") Map<String,Credentials> getServerCredentialsList()
Returns a map of running servers' names to the log in credentials.- Returns:
- map
Credentials>
-
getServerCredentials
@GET @Path("/support/grid/password/get") Credentials getServerCredentials(@QueryParam("id") long id)
- Returns:
- the login user and password of a server, or null if none found
-
addServer
@GET @Path("/grid/server/add") Server addServer(@QueryParam("name") String name, @QueryParam("image") String image, @QueryParam("server.ram") String ram, @QueryParam("ip") String ip, AddServerOptions... addServerOptions)
Adds a server with specified attributes- Parameters:
name
- name of the serverimage
- image (id or name)ram
- ram type (id or name)ip
- ip addressaddServerOptions
- options to make it a sandbox instance or/and description- Returns:
- created server
-
power
@GET @Path("/grid/server/power") Server power(@QueryParam("server") String idOrName, @QueryParam("power") PowerCommand power)
Changes the server's state according toPowerCommand
- Parameters:
idOrName
- id or name of the server to apply the commandpower
- new desired state- Returns:
- server immediately after applying the command
-
deleteById
@GET @Path("/grid/server/delete") Server deleteById(@QueryParam("id") long id)
Deletes the server by Id- Parameters:
id
- id of the server to delete- Returns:
- server before the command is executed
-
deleteByName
@GET @Path("/grid/server/delete") Server deleteByName(@QueryParam("name") 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
-
getRamSizes
@GET @Path("/common/lookup/list") 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 foraddServer(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), seeGoGridComputeServiceContextModule.provideSizeToRam()
.- Returns:
- supported ram sizes
-
getTypes
@GET @Path("/common/lookup/list") 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 foreditServerType(long, java.lang.String)
.- Returns:
- supported server types
-
getDatacenters
@GET @Path("/common/lookup/list") 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 foraddServer(java.lang.String, java.lang.String, java.lang.String, java.lang.String, org.jclouds.gogrid.options.AddServerOptions...)
.- Returns:
- supported datacenters
-
editServerDescription
@GET @Path("/grid/server/edit") Server editServerDescription(@QueryParam("id") long id, @QueryParam("description") String newDescription)
Edits an existing server- Parameters:
id
- id of the existing servernewDescription
- description to replace the current one- Returns:
- edited server
-
editServerRam
@GET @Path("/grid/server/edit") Server editServerRam(@QueryParam("id") long id, @QueryParam("server.ram") String ram)
Edits an existing server- Parameters:
id
- id of the existing serverram
- ram to replace the current one- Returns:
- edited server
-
-