Interface InstanceApi
-
public interface InstanceApi
This API is for creating, listing, and deleting an Instance, and allows enabling a root user.- See Also:
Instance
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Instance
create(int flavor, int volumeSize, String name)
Same ascreate(String, int, String)
but accept an integer Flavor ID.Instance
create(String flavor, int volumeSize, String name)
Create a database instance by flavor type and volume size.boolean
delete(String instanceId)
Deletes an Instance by id.String
enableRoot(String instanceId)
Enables root for an instance.Instance
get(String instanceId)
Returns an Instance by id.boolean
isRooted(String instanceId)
Checks to see if root is enabled for an instance.com.google.common.collect.FluentIterable<Instance>
list()
Returns a summary list of Instances.
-
-
-
Method Detail
-
create
@Named("instance:create") @POST @Path("/instances") @Consumes("application/json") Instance create(int flavor, int volumeSize, String name)
Same ascreate(String, int, String)
but accept an integer Flavor ID.- Parameters:
flavor
- The flavor ID.volumeSize
- The size in GB of the instance volume.name
- The name of the instance.- Returns:
- The instance created.
- See Also:
create(String, int, String)
-
create
@Named("instance:create") @POST @Path("/instances") @Consumes("application/json") Instance create(String flavor, int volumeSize, String name)
Create a database instance by flavor type and volume size.- Parameters:
flavor
- The flavor URL or flavor id as string.volumeSize
- The size in GB of the instance volume.name
- The name of the instance.- Returns:
- The instance created.
-
delete
@Named("instances:delete/{id}") @DELETE @Path("/instances/{id}") @Consumes("application/json") boolean delete(@PathParam("id") String instanceId)
Deletes an Instance by id.- Parameters:
instanceId
- The instance id.- Returns:
- true if successful.
-
enableRoot
@Named("instances/{id}/root") @POST @Path("/instances/{id}/root") @Consumes("application/json") String enableRoot(@PathParam("id") String instanceId)
Enables root for an instance.- Parameters:
instanceId
- The instance id.- Returns:
- String The password for the root user.
-
isRooted
@Named("instances/{id}/root") @GET @Path("/instances/{id}/root") @Consumes("application/json") boolean isRooted(@PathParam("id") String instanceId)
Checks to see if root is enabled for an instance.- Parameters:
instanceId
- The instance id.- Returns:
- boolean True if root is enabled.
- Throws:
ResourceNotFoundException
-
list
@Named("instance:list") @GET @Path("/instances") @Consumes("application/json") com.google.common.collect.FluentIterable<Instance> list()
Returns a summary list of Instances.- Returns:
- The list of Instances.
-
-