Interface DiskApi


  • @Path("/disks")
    @Consumes("application/json")
    public interface DiskApi
    • 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 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.
      • 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.
      • 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 page
        listOptions - listing options
        Returns:
        a page of the list