@Consumes(value="application/json")
@Path(value="/servers")
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) |
Set<PortInterface> |
listPortInterfaces(String id)
Lists port interfaces that are attached to a server.
|
Set<SecurityGroup> |
listSecurityGroupForServer(String id)
Lists Security Groups for a server.
|
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") @GET PagedIterable<Resource> list()
@Named(value="server:list") @GET PaginatedCollection<Resource> list(PaginationOptions options)
@Named(value="server:list") @GET @Path(value="/detail") PagedIterable<Server> listInDetail()
@Named(value="server:list") @GET @Path(value="/detail") PaginatedCollection<Server> listInDetail(PaginationOptions options)
@Named(value="server:get") @GET @Path(value="/{id}") @Nullable Server get(@PathParam(value="id") String id)
id
- id of the server@Named(value="server:create") @POST 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") @DELETE @Path(value="/{id}") boolean delete(@PathParam(value="id") String id)
id
- id of the server@Named(value="server:start") @POST @Path(value="/{id}/action") @Produces(value="application/json") void start(@PathParam(value="id") String id)
id
- id of the server@Named(value="server:stop") @POST @Path(value="/{id}/action") @Produces(value="application/json") void stop(@PathParam(value="id") String id)
id
- id of the server@Named(value="server:reboot") @POST @Path(value="/{id}/action") @Produces(value="application/json") void reboot(@PathParam(value="id") String id, RebootType rebootType)
id
- id of the serverrebootType
- The type of reboot to perform (Hard/Soft)@Named(value="server:resize") @POST @Path(value="/{id}/action") @Produces(value="application/json") void resize(@PathParam(value="id") String id, String flavorId)
id
- id of the serverflavorId
- id of the new flavor to use@Named(value="server:confirmResize") @POST @Path(value="/{id}/action") @Produces(value="application/json") void confirmResize(@PathParam(value="id") String id)
id
- id of the server@Named(value="server:revertResize") @POST @Path(value="/{id}/action") @Produces(value="application/json") void revertResize(@PathParam(value="id") String id)
id
- id of the server@Named(value="server:rebuild") @POST @Path(value="/{id}/action") void rebuild(@PathParam(value="id") String id, RebuildServerOptions... options)
id
- id of the serveroptions
- Optional parameters to the rebuilding operation.@Named(value="server:changeAdminPass") @POST @Path(value="/{id}/action") @Produces(value="application/json") void changeAdminPass(@PathParam(value="id") String id, String adminPass)
id
- id of the serveradminPass
- The new administrative password to use@Named(value="server:rename") @PUT @Path(value="/{id}") @Produces(value="application/json") void rename(@PathParam(value="id") String id, String newName)
id
- id of the servernewName
- The new name for the server@Named(value="server:createImageFromServer") @POST @Path(value="/{id}/action") @Produces(value="application/json") String createImageFromServer(String name, @PathParam(value="id") String id)
name
- The name of the new imageid
- id of the server@Named(value="server:getMetadata") @GET @Path(value="/{id}/metadata") Map<String,String> getMetadata(@PathParam(value="id") String id)
id
- id of the server@Named(value="server:setMetadata") @PUT @Path(value="/{id}/metadata") @Produces(value="application/json") Map<String,String> setMetadata(@PathParam(value="id") String id, Map<String,String> metadata)
id
- id of the servermetadata
- a Map containing the metadata@Named(value="server:updateMetadata") @POST @Path(value="/{id}/metadata") @Produces(value="application/json") Map<String,String> updateMetadata(@PathParam(value="id") String id, Map<String,String> metadata)
id
- id of the servermetadata
- a Map containing the metadata@Named(value="server:getMetadata") @GET @Path(value="/{id}/metadata/{key}") @Nullable String getMetadata(@PathParam(value="id") String id, @PathParam(value="key") String key)
id
- id of the imagekey
- a key containing the metadata@Named(value="server:updateMetadata") @PUT @Path(value="/{id}/metadata/{key}") @Produces(value="application/json") String updateMetadata(@PathParam(value="id") String id, @PathParam(value="key") String key, @PathParam(value="value") String value)
id
- id of the imagekey
- the name of the metadata itemvalue
- the value of the metadata item@Named(value="server:deleteMetadata") @DELETE @Path(value="/{id}/metadata/{key}") void deleteMetadata(@PathParam(value="id") String id, @PathParam(value="key") String key)
id
- id of the imagekey
- the name of the metadata item@Named(value="server:getDiagnostics") @GET @Path(value="/{id}/diagnostics") com.google.common.base.Optional<Map<String,String>> getDiagnostics(@PathParam(value="id") String id)
id
- id of the server@Named(value="server:getSecurityGroups") @GET @Path(value="/{id}/os-security-groups") Set<SecurityGroup> listSecurityGroupForServer(@PathParam(value="id") String id)
id
- id of the server@Named(value="server:getPortInterfaces") @GET @Path(value="/{id}/os-interface") Set<PortInterface> listPortInterfaces(@PathParam(value="id") String id)
id
- id of the serverCopyright © 2009-2018 The Apache Software Foundation. All Rights Reserved.