Interface GlacierClient

All Superinterfaces:
AutoCloseable, Closeable

public interface GlacierClient extends Closeable
Provides access to Amazon Glacier resources via their REST API.
  • Method Details

    • createVault

      @Named("CreateVault") @PUT @Path("/-/vaults/{vault}") URI createVault(@PathParam("vault") String vaultName)
      Creates a new vault to store archives. An account can only create up to 1,000 vaults per region, but each vault can contain an unlimited number of archives.
      Parameters:
      vaultName - A name for the Vault being created.
      Returns:
      A reference to an URI pointing to the resource created.
    • deleteVault

      @Named("DeleteVault") @DELETE @Path("/-/vaults/{vault}") boolean deleteVault(@PathParam("vault") String vaultName)
      Deletes a vault. Vaults can only be deleted if there are no archives in the vault in the last inventory computed by Amazon, and there are no new uploads after it. This is very important, as Amazon only updates inventories once every 24 hours.
      Parameters:
      vaultName - Name of the Vault being deleted.
      Returns:
      False if the vault was not empty and therefore not deleted, true otherwise.
    • describeVault

      @Named("DescribeVault") @GET @Path("/-/vaults/{vault}") VaultMetadata describeVault(@PathParam("vault") String vaultName)
      Retrieves the metadata for a vault. The response include information like the vault ARN, the creation data, the number of archives contained within the vault and total size of these archives. The number of archives and the total size is based on the last inventory computed by amazon and the information may be outdated.
      Parameters:
      vaultName - Name of the Vault being described.
      Returns:
      A VaultMetadata object containing all the information relevant to the vault if the vault exists, null otherwise.
    • listVaults

      @Named("ListVaults") @GET @Path("/-/vaults") PaginatedVaultCollection listVaults(PaginationOptions options)
      Lists vaults according to specified options. By default this operation returns up to 1,000 vaults.
      Parameters:
      options - Options used for pagination.
      Returns:
      A PaginatedVaultCollection object containing the list of vaults.
    • listVaults

      @Named("ListVaults") @GET @Path("/-/vaults") PaginatedVaultCollection listVaults()
      See Also:
    • uploadArchive

      @Named("UploadArchive") @POST @Path("/-/vaults/{vault}/archives") String uploadArchive(@PathParam("vault") String vaultName, Payload payload, String description)
      Stores an archive in a vault. Archives up to 4GB in size can be uploaded using this operation. Once the archive is uploaded it is immutable, this means that archive or its description cannot be modified. Except for the optional description Glacier does not support additional metadata.
      Parameters:
      vaultName - Name of the Vault where the archive is being stored.
      payload - Payload to be uploaded.
      description - Description for the archive.
      Returns:
      A String containing the Archive identifier in Amazon Glacier.
    • uploadArchive

      @Named("UploadArchive") @POST @Path("/-/vaults/{vault}/archives") String uploadArchive(@PathParam("vault") String vaultName, Payload payload)
      See Also:
    • deleteArchive

      @Named("DeleteArchive") @DELETE @Path("/-/vaults/{vault}/archives/{archive}") boolean deleteArchive(@PathParam("vault") String vaultName, @PathParam("archive") String archiveId)
      Deletes an archive from a vault. Be aware that after deleting an archive it may still be listed in the inventories until amazon compute a new inventory.
      Parameters:
      vaultName - Name of the Vault where the archive is stored.
      archiveId - Amazon Glacier archive identifier.
      Returns:
      False if the archive was not deleted, true otherwise.
    • initiateMultipartUpload

      @Named("InitiateMultipartUpload") @POST @Path("/-/vaults/{vault}/multipart-uploads") String initiateMultipartUpload(@PathParam("vault") String vaultName, long partSizeInMB, String description)
      Starts a new multipart upload. Using a multipart upload you can upload archives up to 40,000GB (10,000 parts, 4GB each). The part size must be a megabyte multiplied by a power of 2 and every part must be the same size except the last one, which can have a smaller size. In addition, you don't need to know the archive size to initiate a multipart upload.
      Parameters:
      vaultName - Name of the Vault where the archive is going to be stored.
      partSizeInMB - Content size for each part.
      description - The archive description.
      Returns:
      The Multipart Upload Id.
    • initiateMultipartUpload

      @Named("InitiateMultipartUpload") @POST @Path("/-/vaults/{vault}/multipart-uploads") String initiateMultipartUpload(@PathParam("vault") String vaultName, long partSizeInMB)
      See Also:
    • uploadPart

      @Named("UploadPart") @PUT @Path("/-/vaults/{vault}/multipart-uploads/{uploadId}") com.google.common.hash.HashCode uploadPart(@PathParam("vault") String vaultName, @PathParam("uploadId") String uploadId, ContentRange range, Payload payload)
      Uploads one of the multipart upload parts. The part size has to match the one specified in the multipart upload request, and the range needs to be aligned. In addition, to ensure that the data is not corrupted, the tree hash and the linear hash are checked by Glacier.
      Parameters:
      vaultName - Name of the Vault where the archive is going to be stored.
      uploadId - Multipart upload identifier.
      range - The content range that this part is uploading.
      payload - Content for this part.
      Returns:
      Tree-hash of the payload calculated by Amazon. This hash needs to be stored to complete the multipart upload.
    • completeMultipartUpload

      @Named("CompleteMultipartUpload") @POST @Path("/-/vaults/{vault}/multipart-uploads/{uploadId}") String completeMultipartUpload(@PathParam("vault") String vaultName, @PathParam("uploadId") String uploadId, Map<Integer,com.google.common.hash.HashCode> hashes, long archiveSize)
      Completes the multipart upload. After uploading all the parts this operation should be called to inform Glacier. Again, the checksum and the ranges of the whole archive will be computed to verify the data.
      Parameters:
      vaultName - Name of the Vault where the archive is going to be stored.
      uploadId - Multipart upload identifier.
      hashes - Map containing the pairs partnumber-treehash of each uploaded part.
      archiveSize - Size of the complete archive.
      Returns:
      A String containing the Archive identifier in Amazon Glacier.
    • abortMultipartUpload

      @Named("AbortMultipartUpload") @DELETE @Path("/-/vaults/{vault}/multipart-uploads/{uploadId}") boolean abortMultipartUpload(@PathParam("vault") String vaultName, @PathParam("uploadId") String uploadId)
      Aborts the multipart upload. Once aborted, you cannot upload any more parts to it.
      Parameters:
      vaultName - Name of the Vault where the archive was going to be stored.
      uploadId - Multipart upload identifier.
      Returns:
      True if the multipart upload was aborted, false otherwise.
    • listParts

      @Named("ListParts") @GET @Path("/-/vaults/{vault}/multipart-uploads/{uploadId}") MultipartUploadMetadata listParts(@PathParam("vault") String vaultName, @PathParam("uploadId") String uploadId, PaginationOptions options)
      Lists the multipart upload parts. You can list the parts of an ongoing multipart upload at any time. By default it returns up to 1,000 uploaded parts, but you can control this using the request options.
      Parameters:
      vaultName - Name of the Vault where the archive is going to be stored.
      uploadId - Multipart upload identifier.
      options - Options used for pagination.
      Returns:
      A MultipartUploadMetadata, containing an iterable part list with a marker.
    • listParts

      @Named("ListParts") @GET @Path("/-/vaults/{vault}/multipart-uploads/{uploadId}") MultipartUploadMetadata listParts(@PathParam("vault") String vaultName, @PathParam("uploadId") String uploadId)
      See Also:
    • listMultipartUploads

      @Named("ListMultipartUploads") @GET @Path("/-/vaults/{vault}/multipart-uploads") PaginatedMultipartUploadCollection listMultipartUploads(@PathParam("vault") String vaultName, PaginationOptions options)
      Lists the ongoing multipart uploads in a vault. By default, this operation returns up to 1,000 multipart uploads. You can control this using the request options.
      Parameters:
      vaultName - Name of the Vault where the archive is going to be stored.
      options - Options used for pagination.
      Returns:
      A PaginatedMultipartUploadCollection, containing an iterable multipart upload list with a marker.
    • listMultipartUploads

      @Named("ListMultipartUploads") @GET @Path("/-/vaults/{vault}/multipart-uploads") PaginatedMultipartUploadCollection listMultipartUploads(@PathParam("vault") String vaultName)
      See Also:
    • initiateJob

      @Named("InitiateJob") @POST @Path("/-/vaults/{vault}/jobs") String initiateJob(@PathParam("vault") String vaultName, JobRequest job)
      Initiates a job. The job can be an inventory retrieval or an archive retrieval. Once the job is started the estimated time to complete it is ~4 hours.
      Parameters:
      vaultName - Name of the target Vault for the job.
      job - JobRequest instance with the concrete request.
      Returns:
      The job identifier.
    • describeJob

      @Named("DescribeJob") @GET @Path("/-/vaults/{vault}/jobs/{job}") JobMetadata describeJob(@PathParam("vault") String vaultName, @PathParam("job") String jobId)
      Retrieves information about an ongoing job. Among the information you will find the initiation date, the user who initiated the job or the status message.
      Parameters:
      vaultName - Name of the target Vault for the job.
      jobId - Job identifier.
      Returns:
      The job metadata if the job exists in the vault, null otherwise.
    • listJobs

      @Named("ListJobs") @GET @Path("/-/vaults/{vault}/jobs") PaginatedJobCollection listJobs(@PathParam("vault") String vaultName, PaginationOptions options)
      Lists the ongoing jobs and the recently finished jobs for a vault. By default this operation returns up to 1,000 jobs in the response, but you can control this using the request options. Note that this operation also returns the recently finished jobs and you can still download their output.
      Parameters:
      vaultName - Name of the target Vault.
      options - Options used for pagination
      Returns:
      A PaginatedJobCollection, containing an iterable job list with a marker.
    • listJobs

      @Named("ListJobs") @GET @Path("/-/vaults/{vault}/jobs") PaginatedJobCollection listJobs(@PathParam("vault") String vaultName)
      Lists jobs.
    • getJobOutput

      @Named("GetJobOutput") @GET @Path("/-/vaults/{vault}/jobs/{job}/output") Payload getJobOutput(@PathParam("vault") String vaultName, @PathParam("job") String jobId, ContentRange range)
      Gets the raw job output of any kind of job. You can download the job output within the 24 hour period after Glacier comlpetes a job.
      Parameters:
      vaultName - Name of the target Vault for the job.
      jobId - Job identifier.
      range - The range of bytes to retrieve from the output.
      Returns:
      The content data.
    • getJobOutput

      @Named("GetJobOutput") @GET @Path("/-/vaults/{vault}/jobs/{job}/output") Payload getJobOutput(@PathParam("vault") String vaultName, @PathParam("job") String jobId)
      Downloads the output of an archive retrieval job.
      Parameters:
      vaultName - Name of the target Vault for the job.
      jobId - Job identifier.
      Returns:
      The content data.
    • getInventoryRetrievalOutput

      @Named("GetInventoryRetrievalOutput") @GET @Path("/-/vaults/{vault}/jobs/{job}/output") ArchiveMetadataCollection getInventoryRetrievalOutput(@PathParam("vault") String vaultName, @PathParam("job") String jobId)
      Gets the job output for the given job ID. The job must be an inventory retrieval, otherwise this operation will fail. This operation will parse the job output and build a collection of ArchiveMetadata.
      Parameters:
      vaultName - Name of the target Vault for the job.
      jobId - Job identifier.
      Returns:
      The ArchiveMetadata collection