Interface VolumeAttachmentApi


  • @Consumes("application/json")
    @Path("/servers")
    public interface VolumeAttachmentApi
    Provides access to the OpenStack Compute (Nova) Volume Attachments Extension API. This API strictly handles attaching Volumes to Servers. To create and manage Volumes you need to use the Cinder API.
    See Also:
    VolumeApi
    • Method Detail

      • listAttachmentsOnServer

        @Named("volumeAttachment:list")
        @GET
        @Path("/{serverId}/os-volume_attachments")
        com.google.common.collect.FluentIterable<VolumeAttachment> listAttachmentsOnServer​(@PathParam("serverId")
                                                                                           String serverId)
        Lists Volume Attachments for a given Server.
        Parameters:
        serverId - The ID of the Server
        Returns:
        All VolumeAttachments for the Server
      • getAttachmentForVolumeOnServer

        @Named("volumeAttachment:get")
        @GET
        @Path("/{serverId}/os-volume_attachments/{id}")
        @Nullable
        VolumeAttachment getAttachmentForVolumeOnServer​(@PathParam("id")
                                                        String volumeId,
                                                        @PathParam("serverId")
                                                        String serverId)
        Gets a specific Volume Attachment for a Volume and Server.
        Parameters:
        volumeId - The ID of the Volume
        serverId - The ID of the Server
        Returns:
        The Volume Attachment.
      • attachVolumeToServerAsDevice

        @Named("volumeAttachment:attach")
        @POST
        @Path("/{serverId}/os-volume_attachments")
        @Produces("application/json")
        VolumeAttachment attachVolumeToServerAsDevice​(String volumeId,
                                                      @PathParam("serverId")
                                                      String serverId,
                                                      String device)
        Attaches a Volume to a Server. Note: If you are using KVM as your hypervisor then the actual device name in the Server will be different than the one specified. When the Server sees a new device, it picks the next available name (which in most cases is /dev/vdc) and the disk shows up there on the Server.
        Parameters:
        serverId - The ID of the Server
        volumeId - The ID of the Volume
        device - The name of the device this Volume will be identified as in the Server (e.g. /dev/vdc)
        Returns:
        The Volume Attachment.
      • detachVolumeFromServer

        @Named("volumeAttachment:detach")
        @DELETE
        @Path("/{serverId}/os-volume_attachments/{id}")
        boolean detachVolumeFromServer​(@PathParam("id")
                                       String volumeId,
                                       @PathParam("serverId")
                                       String serverId)
        Detaches a Volume from a server. Note: Make sure you've unmounted the volume first. Failure to do so could result in failure or data loss.
        Parameters:
        volumeId - The ID of the Volume
        serverId - The ID of the Server
        Returns:
        true if successful