You are viewing documentation for version 2 of the AWS SDK for Ruby. Version 3 documentation can be found here.

Class: Aws::Glacier::Vault

Inherits:
Resources::Resource show all
Defined in:
(unknown)

Instance Attribute Summary collapse

Attributes inherited from Resources::Resource

#client, #identifiers

Instance Method Summary collapse

Methods inherited from Resources::Resource

add_data_attribute, add_identifier, #data, data_attributes, #data_loaded?, identifiers, #load, #wait_until

Methods included from Resources::OperationMethods

#add_batch_operation, #add_operation, #batch_operation, #batch_operation_names, #batch_operations, #operation, #operation_names, #operations

Constructor Details

#initialize(account_id, name, options = {}) ⇒ Object #initialize(options = {}) ⇒ Object

Overloads:

  • #initialize(account_id, name, options = {}) ⇒ Object

    Parameters:

    • account_id (String)
    • name (String)

    Options Hash (options):

    • :client (Client)

      When `:client is not given, the options hash is used to construct a new Client object.

  • #initialize(options = {}) ⇒ Object

    Options Hash (options):

    • :account_id (required, String)
    • :name (required, String)
    • :client (Client)

      When `:client is not given, the options hash is used to construct a new Client object.

Instance Attribute Details

#account_idString (readonly)

Returns:

  • (String)

#creation_dateTime (readonly)

Returns:

  • (Time)

#last_inventory_dateTime (readonly)

Returns:

  • (Time)

#nameString (readonly)

Returns:

  • (String)

#number_of_archivesInteger (readonly)

The number of archives in the vault as of the last inventory date. This field will return null if an inventory has not yet run on the vault, for example if you just created the vault.

Returns:

  • (Integer)

    The number of archives in the vault as of the last inventory date.

#size_in_bytesInteger (readonly)

Total size, in bytes, of the archives in the vault as of the last inventory date. This field will return null if an inventory has not yet run on the vault, for example if you just created the vault.

Returns:

  • (Integer)

    Total size, in bytes, of the archives in the vault as of the last inventory date.

#vault_arnString (readonly)

The Amazon Resource Name (ARN) of the vault.

Returns:

  • (String)

    The Amazon Resource Name (ARN) of the vault.

#vault_nameString (readonly)

The name of the vault.

Returns:

  • (String)

    The name of the vault.

Instance Method Details

#accountAccount

Returns:

#archive(id) ⇒ Archive

Parameters:

Returns:

See Also:

#completed_jobs(options = {}) ⇒ Collection<Job>

Returns a Collection of Job resources. No API requests are made until you call an enumerable method on the collection. Client#list_jobs will be called multiple times until every Job has been yielded.

Examples:

Request syntax example with placeholder values


vault.completed_jobs({
  limit: 1,
  marker: "string",
  statuscode: "string",
})

Enumerating Job resources.

vault.completed_jobs.each do |job|
  # yields each job
end

Enumerating Job resources with a limit.

vault.completed_jobs.limit(10).each do |job|
  # yields at most 10 completed_jobs
end

Options Hash (options):

  • :limit (Integer)
  • :marker (String)

    An opaque string used for pagination. This value specifies the job at which the listing of jobs should begin. Get the marker value from a previous List Jobs response. You only need to include the marker if you are continuing the pagination of results started in a previous List Jobs request.

  • :statuscode (String)

    The type of job status to return. You can specify the following values: InProgress, Succeeded, or Failed.

Returns:

  • (Collection<Job>)

See Also:

#createTypes::CreateVaultOutput

This operation creates a new vault with the specified name. The name of the vault must be unique within a region for an AWS account. You can create up to 1,000 vaults per account. If you need to create more vaults, contact Amazon S3 Glacier.

You must use the following guidelines when naming a vault.

  • Names can be between 1 and 255 characters long.

  • Allowed characters are a-z, A-Z, 0-9, '_' (underscore), '-' (hyphen), and '.' (period).

This operation is idempotent.

An AWS account has full permission to perform all operations (actions). However, AWS Identity and Access Management (IAM) users don't have any permissions by default. You must grant them explicit permission to perform specific actions. For more information, see Access Control Using AWS Identity and Access Management (IAM).

For conceptual information and underlying REST API, see Creating a Vault in Amazon Glacier and Create Vault in the Amazon Glacier Developer Guide.

Examples:

Request syntax example with placeholder values


vault.create()

Returns:

See Also:

#deleteStruct

This operation deletes a vault. Amazon S3 Glacier will delete a vault only if there are no archives in the vault as of the last inventory and there have been no writes to the vault since the last inventory. If either of these conditions is not satisfied, the vault deletion fails (that is, the vault is not removed) and Amazon S3 Glacier returns an error. You can use DescribeVault to return the number of archives in a vault, and you can use Initiate a Job (POST jobs) to initiate a new inventory retrieval for a vault. The inventory contains the archive IDs you use to delete archives using Delete Archive (DELETE archive).

This operation is idempotent.

An AWS account has full permission to perform all operations (actions). However, AWS Identity and Access Management (IAM) users don't have any permissions by default. You must grant them explicit permission to perform specific actions. For more information, see Access Control Using AWS Identity and Access Management (IAM).

For conceptual information and underlying REST API, see Deleting a Vault in Amazon Glacier and Delete Vault in the Amazon S3 Glacier Developer Guide.

Examples:

Request syntax example with placeholder values


vault.delete()

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#failed_jobs(options = {}) ⇒ Collection<Job>

Returns a Collection of Job resources. No API requests are made until you call an enumerable method on the collection. Client#list_jobs will be called multiple times until every Job has been yielded.

Examples:

Request syntax example with placeholder values


vault.failed_jobs({
  limit: 1,
  marker: "string",
  completed: "string",
})

Enumerating Job resources.

vault.failed_jobs.each do |job|
  # yields each job
end

Enumerating Job resources with a limit.

vault.failed_jobs.limit(10).each do |job|
  # yields at most 10 failed_jobs
end

Options Hash (options):

  • :limit (Integer)
  • :marker (String)

    An opaque string used for pagination. This value specifies the job at which the listing of jobs should begin. Get the marker value from a previous List Jobs response. You only need to include the marker if you are continuing the pagination of results started in a previous List Jobs request.

  • :completed (String)

    The state of the jobs to return. You can specify true or false.

Returns:

  • (Collection<Job>)

See Also:

#initiate_inventory_retrievalJob

Examples:

Request syntax example with placeholder values


vault.initiate_inventory_retrieval()

Basic usage

job = vault.initiate_inventory_retrieval(options)
job.id
#=> "job-id"

Returns:

See Also:

#initiate_multipart_upload(options = {}) ⇒ MultipartUpload

Examples:

Request syntax example with placeholder values


vault.initiate_multipart_upload({
  archive_description: "string",
  part_size: 1,
})

Basic usage

multipartupload = vault.initiate_multipart_upload(options)
multipartupload.id
#=> "multipartupload-id"

Options Hash (options):

  • :archive_description (String)

    The archive description that you are uploading in parts.

    The part size must be a megabyte (1024 KB) multiplied by a power of 2, for example 1048576 (1 MB), 2097152 (2 MB), 4194304 (4 MB), 8388608 (8 MB), and so on. The minimum allowable part size is 1 MB, and the maximum is 4 GB (4096 MB).

  • :part_size (Integer)

Returns:

See Also:

#job(id) ⇒ Job

Parameters:

  • id (String)

    The Job#id identifier.

Returns:

See Also:

#jobs(options = {}) ⇒ Collection<Job>

Returns a Collection of Job resources. No API requests are made until you call an enumerable method on the collection. Client#list_jobs will be called multiple times until every Job has been yielded.

Examples:

Request syntax example with placeholder values


vault.jobs({
  limit: 1,
  marker: "string",
  statuscode: "string",
  completed: "string",
})

Enumerating Job resources.

vault.jobs.each do |job|
  # yields each job
end

Enumerating Job resources with a limit.

vault.jobs.limit(10).each do |job|
  # yields at most 10 jobs
end

Options Hash (options):

  • :limit (Integer)
  • :marker (String)

    An opaque string used for pagination. This value specifies the job at which the listing of jobs should begin. Get the marker value from a previous List Jobs response. You only need to include the marker if you are continuing the pagination of results started in a previous List Jobs request.

  • :statuscode (String)

    The type of job status to return. You can specify the following values: InProgress, Succeeded, or Failed.

  • :completed (String)

    The state of the jobs to return. You can specify true or false.

Returns:

  • (Collection<Job>)

See Also:

#jobs_in_progress(options = {}) ⇒ Collection<Job>

Returns a Collection of Job resources. No API requests are made until you call an enumerable method on the collection. Client#list_jobs will be called multiple times until every Job has been yielded.

Examples:

Request syntax example with placeholder values


vault.jobs_in_progress({
  limit: 1,
  marker: "string",
  completed: "string",
})

Enumerating Job resources.

vault.jobs_in_progress.each do |job|
  # yields each job
end

Enumerating Job resources with a limit.

vault.jobs_in_progress.limit(10).each do |job|
  # yields at most 10 jobs_in_progress
end

Options Hash (options):

  • :limit (Integer)
  • :marker (String)

    An opaque string used for pagination. This value specifies the job at which the listing of jobs should begin. Get the marker value from a previous List Jobs response. You only need to include the marker if you are continuing the pagination of results started in a previous List Jobs request.

  • :completed (String)

    The state of the jobs to return. You can specify true or false.

Returns:

  • (Collection<Job>)

See Also:

#multipart_uplaods(options = {}) ⇒ Collection<MultipartUpload>

Returns a Collection of MultipartUpload resources. No API requests are made until you call an enumerable method on the collection. Client#list_multipart_uploads will be called multiple times until every MultipartUpload has been yielded.

Examples:

Request syntax example with placeholder values


vault.multipart_uplaods({
  marker: "string",
  limit: 1,
})

Enumerating MultipartUpload resources.

vault.multipart_uplaods.each do |multipartupload|
  # yields each multipartupload
end

Enumerating MultipartUpload resources with a limit.

vault.multipart_uplaods.limit(10).each do |multipartupload|
  # yields at most 10 multipart_uplaods
end

Options Hash (options):

  • :marker (String)

    An opaque string used for pagination. This value specifies the upload at which the listing of uploads should begin. Get the marker value from a previous List Uploads response. You need only include the marker if you are continuing the pagination of results started in a previous List Uploads request.

  • :limit (Integer)

Returns:

See Also:

#multipart_upload(id) ⇒ MultipartUpload

Parameters:

Returns:

See Also:

#notificationNotification

Returns:

#succeeded_jobs(options = {}) ⇒ Collection<Job>

Returns a Collection of Job resources. No API requests are made until you call an enumerable method on the collection. Client#list_jobs will be called multiple times until every Job has been yielded.

Examples:

Request syntax example with placeholder values


vault.succeeded_jobs({
  limit: 1,
  marker: "string",
  completed: "string",
})

Enumerating Job resources.

vault.succeeded_jobs.each do |job|
  # yields each job
end

Enumerating Job resources with a limit.

vault.succeeded_jobs.limit(10).each do |job|
  # yields at most 10 succeeded_jobs
end

Options Hash (options):

  • :limit (Integer)
  • :marker (String)

    An opaque string used for pagination. This value specifies the job at which the listing of jobs should begin. Get the marker value from a previous List Jobs response. You only need to include the marker if you are continuing the pagination of results started in a previous List Jobs request.

  • :completed (String)

    The state of the jobs to return. You can specify true or false.

Returns:

  • (Collection<Job>)

See Also:

#upload_archive(options = {}) ⇒ Archive

Examples:

Request syntax example with placeholder values


vault.upload_archive({
  archive_description: "string",
  checksum: "string",
  body: source_file, # file/IO object, or string data
})

Basic usage

archive = vault.upload_archive(options)
archive.id
#=> "archive-id"

Options Hash (options):

  • :archive_description (String)

    The optional description of the archive you are uploading.

  • :checksum (String)

    The SHA256 tree hash of the data being uploaded.

  • :body (IO, String)

    The data to upload.

Returns:

See Also: