org.jclouds.googlecomputeengine.features
Interface DiskApi


public interface DiskApi

Provides access to Disks via their REST API.

See Also:

Method Summary
 Operation createFromImageInZone(String sourceImage, String diskName, String zone)
          Creates a persistent disk resource from the specified image, in the specified project, with the default disk size.
 Operation createFromImageWithSizeInZone(String sourceImage, String diskName, int sizeGb, String zone)
          Creates a persistent disk resource from the specified image, in the specified project, specifying the size of the disk.
 Operation createInZone(String diskName, int sizeGb, String zone)
          Creates a persistent disk resource in the specified project specifying the size of the disk.
 Operation createSnapshotInZone(String zone, String diskName, String snapshotName)
          Create a snapshot of a given disk in a zone.
 Operation deleteInZone(String zone, String diskName)
          Deletes the specified persistent disk resource.
 Disk getInZone(String zone, String diskName)
          Returns the specified persistent disk resource.
 ListPage<Disk> listAtMarkerInZone(String zone, String marker)
           
 ListPage<Disk> listAtMarkerInZone(String zone, String marker, ListOptions listOptions)
          Retrieves the listPage of persistent disk resources contained within the specified project and zone.
 ListPage<Disk> listFirstPageInZone(String zone)
           
 org.jclouds.collect.PagedIterable<Disk> listInZone(String zone)
          A paged version of DiskApi#listPageInZone(String)
 org.jclouds.collect.PagedIterable<Disk> listInZone(String zone, ListOptions options)
           
 

Method Detail

getInZone

@Named(value="Disks:get")
@Nullable
Disk getInZone(String zone,
                              String diskName)
Returns the specified persistent disk resource.

Parameters:
zone - Name of the zone the disk is in.
diskName - name of the persistent disk resource to return.
Returns:
a Disk resource.

createInZone

@Named(value="Disks:insert")
Operation createInZone(String diskName,
                             int sizeGb,
                             String zone)
Creates a persistent disk resource in the specified project specifying the size of the disk.

Parameters:
diskName - the name of disk.
sizeGb - the size of the disk
zone - the name of the zone where the disk is 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.

createFromImageWithSizeInZone

@Named(value="Disks:insert")
Operation createFromImageWithSizeInZone(String sourceImage,
                                              String diskName,
                                              int sizeGb,
                                              String zone)
Creates a persistent disk resource from the specified image, in the specified project, specifying the size of the disk.

Parameters:
sourceImage - fully qualified URL for the image to be copied.
diskName - the name of disk.
sizeGb - the size of the disk
zone - the name of the zone where the disk is 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.

createFromImageInZone

@Named(value="Disks:insert")
Operation createFromImageInZone(String sourceImage,
                                      String diskName,
                                      String zone)
Creates a persistent disk resource from the specified image, in the specified project, with the default disk size.

Parameters:
sourceImage - fully qualified URL for the image to be copied.
diskName - the name of disk.
zone - the name of the zone where the disk is 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.

deleteInZone

@Named(value="Disks:delete")
@Nullable
Operation deleteInZone(String zone,
                                      String diskName)
Deletes the specified persistent disk resource.

Parameters:
zone - the zone the disk is in.
diskName - name of the persistent disk resource to delete.
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.

listFirstPageInZone

@Named(value="Disks:list")
ListPage<Disk> listFirstPageInZone(String zone)
See Also:
listAtMarkerInZone(String, String, org.jclouds.googlecomputeengine.options.ListOptions)

listAtMarkerInZone

@Named(value="Disks:list")
ListPage<Disk> listAtMarkerInZone(String zone,
                                        @Nullable
                                        String marker)
See Also:
listAtMarkerInZone(String, String, org.jclouds.googlecomputeengine.options.ListOptions)

listAtMarkerInZone

@Named(value="Disks:list")
ListPage<Disk> listAtMarkerInZone(String zone,
                                        @Nullable
                                        String marker,
                                        ListOptions listOptions)
Retrieves the listPage of persistent disk resources contained within the specified project and zone. By default the listPage as a maximum size of 100, if no options are provided or ListOptions#getMaxResults() has not been set.

Parameters:
zone - the zone to search in
marker - marks the beginning of the next list page
listOptions - listing options
Returns:
a page of the listPage
See Also:
ListOptions, ListPage

listInZone

@Named(value="Disks:list")
org.jclouds.collect.PagedIterable<Disk> listInZone(String zone)
A paged version of DiskApi#listPageInZone(String)

Parameters:
zone - the zone to list in
Returns:
a Paged, Fluent Iterable that is able to fetch additional pages when required
See Also:
PagedIterable, listAtMarkerInZone(String, String, org.jclouds.googlecomputeengine.options.ListOptions)

listInZone

@Named(value="Disks:list")
org.jclouds.collect.PagedIterable<Disk> listInZone(String zone,
                                                         ListOptions options)

createSnapshotInZone

@Named(value="Disks:createSnapshot")
@Nullable
Operation createSnapshotInZone(String zone,
                                              String diskName,
                                              String snapshotName)
Create a snapshot of a given disk in a zone.

Parameters:
zone - the zone the disk is in.
diskName - the name of the disk.
snapshotName - the name for the snapshot to be craeted.
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.


Copyright © 2009-2014 The Apache Software Foundation. All Rights Reserved.