Interface DiskApi
-
@Path("/disks") @Consumes("application/json") public interface DiskApi
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
DiskApi.DiskPages
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Operation
create(String diskName, String sourceImage, DiskCreationOptions options)
Creates a persistent disk resource, in the specified project, specifying the size of the disk and other options.Operation
create(String diskName, DiskCreationOptions options)
Creates a persistent disk resource, in the specified project, specifying the size of the disk and other options.Operation
createSnapshot(String diskName, String snapshotName)
Create a snapshot of a given disk in a zone.Operation
createSnapshot(String diskName, String snapshotName, String description)
Operation
delete(String disk)
Deletes a persistent disk by name and returns the operation in progress, or null if not found.Disk
get(String disk)
Returns a persistent disk by name or null if not found.Iterator<ListPage<Disk>>
list()
Iterator<ListPage<Disk>>
list(ListOptions options)
ListPage<Disk>
listPage(String pageToken, ListOptions listOptions)
Retrieves the list of persistent disk resources available to the specified project.
-
-
-
Method Detail
-
get
@Named("Disks:get") @GET @Path("/{disk}") @Nullable Disk get(@PathParam("disk") String disk)
Returns a persistent disk by name or null if not found.
-
create
@Named("Disks:insert") @POST @Produces("application/json") Operation create(String diskName, DiskCreationOptions options)
Creates a persistent disk resource, in the specified project, specifying the size of the disk and other options.- Parameters:
diskName
- the name of disk.sizeGb
- the size of the diskoptions
- the options of the disk to create.- Returns:
- an Operation resource. To check on the status of an operation, poll the Operations resource returned to you, and look for the status field.
-
create
@Named("Disks:insert") @POST @Produces("application/json") Operation create(String diskName, @QueryParam("sourceImage") String sourceImage, DiskCreationOptions options)
Creates a persistent disk resource, in the specified project, specifying the size of the disk and other options.- Parameters:
diskName
- the name of disk.sourceImage
- Fully-qualified URL of the source image to apply to the disk.options
- the options of the disk to create.- Returns:
- an Operation resource. To check on the status of an operation, poll the Operations resource returned to you, and look for the status field.
-
delete
@Named("Disks:delete") @DELETE @Path("/{disk}") @Nullable Operation delete(@PathParam("disk") String disk)
Deletes a persistent disk by name and returns the operation in progress, or null if not found.
-
createSnapshot
@Named("Disks:createSnapshot") @POST @Path("/{disk}/createSnapshot") Operation createSnapshot(@PathParam("disk") String diskName, String snapshotName)
Create a snapshot of a given disk in a zone.- Parameters:
diskName
- the name of the disk.snapshotName
- the name for the snapshot to be created.- Returns:
- an Operation resource. To check on the status of an operation, poll the Operations resource returned to you, and look for the status field.
-
createSnapshot
@Named("Disks:createSnapshot") @POST @Path("/{disk}/createSnapshot") Operation createSnapshot(@PathParam("disk") String diskName, String snapshotName, String description)
- See Also:
createSnapshot(String, String)
-
listPage
@Named("Disks:list") @GET ListPage<Disk> listPage(@Nullable @QueryParam("pageToken") String pageToken, ListOptions listOptions)
Retrieves the list of persistent disk resources available to the specified project. By default the list as a maximum size of 100, if no options are provided or ListOptions#getMaxResults() has not been set.- Parameters:
pageToken
- marks the beginning of the next list pagelistOptions
- listing options- Returns:
- a page of the list
-
list
@Named("Disks:list") @GET Iterator<ListPage<Disk>> list()
- See Also:
listPage(String, ListOptions)
-
list
@Named("Disks:list") @GET Iterator<ListPage<Disk>> list(ListOptions options)
- See Also:
listPage(String, ListOptions)
-
-