public interface ServerApi
Modifier and Type | Method and Description |
---|---|
void |
changeAdminPass(String id,
String adminPass)
Change the administrative password to a server.
|
void |
confirmResize(String id)
Confirm a resize operation.
|
ServerCreated |
create(String name,
String imageRef,
String flavorRef,
CreateServerOptions... options)
Create a new server
|
String |
createImageFromServer(String name,
String id)
Create an image from a server.
|
boolean |
delete(String id)
Terminate and delete a server.
|
void |
deleteMetadata(String id,
String key)
Delete a metadata item from a server.
|
Server |
get(String id)
List details of the specified server
|
com.google.common.base.Optional<Map<String,String>> |
getDiagnostics(String id)
Get usage information about the server such as CPU usage, Memory and IO.
|
Map<String,String> |
getMetadata(String id)
List all metadata for a server.
|
String |
getMetadata(String id,
String key)
Update the metadata for a server.
|
PagedIterable<Resource> |
list()
List all servers (IDs, names, links)
|
PaginatedCollection<Resource> |
list(PaginationOptions options) |
PagedIterable<Server> |
listInDetail()
List all servers (all details)
|
PaginatedCollection<Server> |
listInDetail(PaginationOptions options) |
void |
reboot(String id,
RebootType rebootType)
Reboot a server.
|
void |
rebuild(String id,
RebuildServerOptions... options)
Rebuild a server.
|
void |
rename(String id,
String newName)
Rename a server.
|
void |
resize(String id,
String flavorId)
Resize a server to a new flavor size.
|
void |
revertResize(String id)
Revert a resize operation.
|
Map<String,String> |
setMetadata(String id,
Map<String,String> metadata)
Set the metadata for a server.
|
void |
start(String id)
Start a server
|
void |
stop(String id)
Stop a server
|
Map<String,String> |
updateMetadata(String id,
Map<String,String> metadata)
Update the metadata for a server.
|
String |
updateMetadata(String id,
String key,
String value)
Set a metadata item for a server.
|
@Named(value="server:list") PagedIterable<Resource> list()
@Named(value="server:list") PaginatedCollection<Resource> list(PaginationOptions options)
@Named(value="server:list") PagedIterable<Server> listInDetail()
@Named(value="server:list") PaginatedCollection<Server> listInDetail(PaginationOptions options)
@Named(value="server:get") @Nullable Server get(String id)
id
- id of the server@Named(value="server:create") ServerCreated create(String name, String imageRef, String flavorRef, CreateServerOptions... options)
name
- name of the server to createimageRef
- reference to the image for the server to useflavorRef
- reference to the flavor to use when creating the serveroptions
- optional parameters to be passed into the server creation
request@Named(value="server:delete") boolean delete(String id)
id
- id of the server@Named(value="server:start") void start(String id)
id
- id of the server@Named(value="server:stop") void stop(String id)
id
- id of the server@Named(value="server:reboot") void reboot(String id, RebootType rebootType)
id
- id of the serverrebootType
- The type of reboot to perform (Hard/Soft)@Named(value="server:resize") void resize(String id, String flavorId)
id
- id of the serverflavorId
- id of the new flavor to use@Named(value="server:confirmResize") void confirmResize(String id)
id
- id of the server@Named(value="server:revertResize") void revertResize(String id)
id
- id of the server@Named(value="server:rebuild") void rebuild(String id, RebuildServerOptions... options)
id
- id of the serveroptions
- Optional parameters to the rebuilding operation.@Named(value="server:changeAdminPass") void changeAdminPass(String id, String adminPass)
id
- id of the serveradminPass
- The new administrative password to use@Named(value="server:rename") void rename(String id, String newName)
id
- id of the servernewName
- The new name for the server@Named(value="server:createImageFromServer") String createImageFromServer(String name, String id)
name
- The name of the new imageid
- id of the server@Named(value="server:getMetadata") Map<String,String> getMetadata(String id)
id
- id of the server@Named(value="server:setMetadata") Map<String,String> setMetadata(String id, Map<String,String> metadata)
id
- id of the servermetadata
- a Map containing the metadata@Named(value="server:updateMetadata") Map<String,String> updateMetadata(String id, Map<String,String> metadata)
id
- id of the servermetadata
- a Map containing the metadata@Named(value="server:getMetadata") @Nullable String getMetadata(String id, String key)
id
- id of the imagemetadata
- a Map containing the metadata@Named(value="server:updateMetadata") String updateMetadata(String id, String key, String value)
id
- id of the imagekey
- the name of the metadata itemvalue
- the value of the metadata item@Named(value="server:deleteMetadata") void deleteMetadata(String id, String key)
id
- id of the imagekey
- the name of the metadata item@Named(value="server:getDiagnostics") com.google.common.base.Optional<Map<String,String>> getDiagnostics(String id)
id
- id of the serverCopyright © 2009-2016 The Apache Software Foundation. All Rights Reserved.