class Aws::RDS::DBClusterSnapshot

Public Class Methods

new(*args) click to toggle source

@overload def initialize(cluster_id, snapshot_id, options = {})

@param [String] cluster_id
@param [String] snapshot_id
@option options [Client] :client

@overload def initialize(options = {})

@option options [required, String] :cluster_id
@option options [required, String] :snapshot_id
@option options [Client] :client
# File lib/aws-sdk-rds/db_cluster_snapshot.rb, line 24
def initialize(*args)
  options = Hash === args.last ? args.pop.dup : {}
  @cluster_id = extract_cluster_id(args, options)
  @snapshot_id = extract_snapshot_id(args, options)
  @data = options.delete(:data)
  @client = options.delete(:client) || Client.new(options)
  @waiter_block_warned = false
end

Public Instance Methods

allocated_storage() click to toggle source

Specifies the allocated storage size in gibibytes (GiB). @return [Integer]

# File lib/aws-sdk-rds/db_cluster_snapshot.rb, line 77
def allocated_storage
  data[:allocated_storage]
end
availability_zones() click to toggle source

Provides the list of Availability Zones (AZs) where instances in the DB cluster snapshot can be restored. @return [Array<String>]

# File lib/aws-sdk-rds/db_cluster_snapshot.rb, line 50
def availability_zones
  data[:availability_zones]
end
client() click to toggle source

@return [Client]

# File lib/aws-sdk-rds/db_cluster_snapshot.rb, line 191
def client
  @client
end
cluster() click to toggle source

@return [DBCluster]

# File lib/aws-sdk-rds/db_cluster_snapshot.rb, line 734
def cluster
  DBCluster.new(
    id: @cluster_id,
    client: @client
  )
end
cluster_create_time() click to toggle source

Specifies the time when the DB cluster was created, in Universal Coordinated Time (UTC). @return [Time]

# File lib/aws-sdk-rds/db_cluster_snapshot.rb, line 103
def cluster_create_time
  data[:cluster_create_time]
end
cluster_id() click to toggle source

@return [String]

# File lib/aws-sdk-rds/db_cluster_snapshot.rb, line 36
def cluster_id
  @cluster_id
end
Also aliased as: db_cluster_identifier
copy(options = {}) click to toggle source

@example Request syntax with placeholder values

dbclustersnapshot = db_cluster_snapshot.copy({
  target_db_cluster_snapshot_identifier: "String", # required
  kms_key_id: "String",
  pre_signed_url: "String",
  copy_tags: false,
  tags: [
    {
      key: "String",
      value: "String",
    },
  ],
  source_region: "String",
})

@param [Hash] options ({}) @option options [required, String] :target_db_cluster_snapshot_identifier

The identifier of the new DB cluster snapshot to create from the
source DB cluster snapshot. This parameter isn't case-sensitive.

Constraints:

* Must contain from 1 to 63 letters, numbers, or hyphens.

* First character must be a letter.

* Can't end with a hyphen or contain two consecutive hyphens.

Example: `my-cluster-snapshot2`

@option options [String] :kms_key_id

The Amazon Web Services KMS key identifier for an encrypted DB cluster
snapshot. The Amazon Web Services KMS key identifier is the key ARN,
key ID, alias ARN, or alias name for the Amazon Web Services KMS
customer master key (CMK).

If you copy an encrypted DB cluster snapshot from your Amazon Web
Services account, you can specify a value for `KmsKeyId` to encrypt
the copy with a new Amazon Web Services KMS CMK. If you don't specify
a value for `KmsKeyId`, then the copy of the DB cluster snapshot is
encrypted with the same Amazon Web Services KMS key as the source DB
cluster snapshot.

If you copy an encrypted DB cluster snapshot that is shared from
another Amazon Web Services account, then you must specify a value for
`KmsKeyId`.

To copy an encrypted DB cluster snapshot to another Amazon Web
Services Region, you must set `KmsKeyId` to the Amazon Web Services
KMS key identifier you want to use to encrypt the copy of the DB
cluster snapshot in the destination Amazon Web Services Region. Amazon
Web Services KMS CMKs are specific to the Amazon Web Services Region
that they are created in, and you can't use CMKs from one Amazon Web
Services Region in another Amazon Web Services Region.

If you copy an unencrypted DB cluster snapshot and specify a value for
the `KmsKeyId` parameter, an error is returned.

@option options [String] :pre_signed_url

The URL that contains a Signature Version 4 signed request for the
`CopyDBClusterSnapshot` API action in the Amazon Web Services Region
that contains the source DB cluster snapshot to copy. The
`PreSignedUrl` parameter must be used when copying an encrypted DB
cluster snapshot from another Amazon Web Services Region. Don't
specify `PreSignedUrl` when you are copying an encrypted DB cluster
snapshot in the same Amazon Web Services Region.

The pre-signed URL must be a valid request for the
`CopyDBClusterSnapshot` API action that can be executed in the source
Amazon Web Services Region that contains the encrypted DB cluster
snapshot to be copied. The pre-signed URL request must contain the
following parameter values:

* `KmsKeyId` - The Amazon Web Services KMS key identifier for the
  customer master key (CMK) to use to encrypt the copy of the DB
  cluster snapshot in the destination Amazon Web Services Region. This
  is the same identifier for both the `CopyDBClusterSnapshot` action
  that is called in the destination Amazon Web Services Region, and
  the action contained in the pre-signed URL.

* `DestinationRegion` - The name of the Amazon Web Services Region
  that the DB cluster snapshot is to be created in.

* `SourceDBClusterSnapshotIdentifier` - The DB cluster snapshot
  identifier for the encrypted DB cluster snapshot to be copied. This
  identifier must be in the Amazon Resource Name (ARN) format for the
  source Amazon Web Services Region. For example, if you are copying
  an encrypted DB cluster snapshot from the us-west-2 Amazon Web
  Services Region, then your `SourceDBClusterSnapshotIdentifier` looks
  like the following example:
  `arn:aws:rds:us-west-2:123456789012:cluster-snapshot:aurora-cluster1-snapshot-20161115`.

To learn how to generate a Signature Version 4 signed request, see [
Authenticating Requests: Using Query Parameters (Amazon Web Services
Signature Version 4)][1] and [ Signature Version 4 Signing
Process][2].

<note markdown="1"> If you are using an Amazon Web Services SDK tool or the CLI, you can
specify `SourceRegion` (or `--source-region` for the CLI) instead of
specifying `PreSignedUrl` manually. Specifying `SourceRegion`
autogenerates a pre-signed URL that is a valid request for the
operation that can be executed in the source Amazon Web Services
Region.

 </note>

[1]: https://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-query-string-auth.html
[2]: https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html

@option options [Boolean] :copy_tags

A value that indicates whether to copy all tags from the source DB
cluster snapshot to the target DB cluster snapshot. By default, tags
are not copied.

@option options [Array<Types::Tag>] :tags

A list of tags. For more information, see [Tagging Amazon RDS
Resources][1] in the *Amazon RDS User Guide.*

[1]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Tagging.html

@option options [String] :source_region

The source region of the snapshot. This is only needed when the
shapshot is encrypted and in a different region.

@return [DBClusterSnapshot]

# File lib/aws-sdk-rds/db_cluster_snapshot.rb, line 473
def copy(options = {})
  options = options.merge(source_db_cluster_snapshot_identifier: @snapshot_id)
  resp = @client.copy_db_cluster_snapshot(options)
  DBClusterSnapshot.new(
    cluster_id: resp.data.db_cluster_snapshot.db_cluster_identifier,
    snapshot_id: resp.data.db_cluster_snapshot.db_cluster_snapshot_identifier,
    data: resp.data.db_cluster_snapshot,
    client: @client
  )
end
create(options = {}) click to toggle source

@example Request syntax with placeholder values

dbclustersnapshot = db_cluster_snapshot.create({
  tags: [
    {
      key: "String",
      value: "String",
    },
  ],
})

@param [Hash] options ({}) @option options [Array<Types::Tag>] :tags

The tags to be assigned to the DB cluster snapshot.

@return [DBClusterSnapshot]

# File lib/aws-sdk-rds/db_cluster_snapshot.rb, line 336
def create(options = {})
  options = options.merge(
    db_cluster_identifier: @cluster_id,
    db_cluster_snapshot_identifier: @snapshot_id
  )
  resp = @client.create_db_cluster_snapshot(options)
  DBClusterSnapshot.new(
    cluster_id: resp.data.db_cluster_snapshot.db_cluster_identifier,
    snapshot_id: resp.data.db_cluster_snapshot.db_cluster_snapshot_identifier,
    data: resp.data.db_cluster_snapshot,
    client: @client
  )
end
data() click to toggle source

@return [Types::DBClusterSnapshot]

Returns the data for this {DBClusterSnapshot}. Calls
{Client#describe_db_cluster_snapshots} if {#data_loaded?} is `false`.
# File lib/aws-sdk-rds/db_cluster_snapshot.rb, line 211
def data
  load unless @data
  @data
end
data_loaded?() click to toggle source

@return [Boolean]

Returns `true` if this resource is loaded.  Accessing attributes or
{#data} on an unloaded resource will trigger a call to {#load}.
# File lib/aws-sdk-rds/db_cluster_snapshot.rb, line 219
def data_loaded?
  !!@data
end
db_cluster_identifier()
Alias for: cluster_id
db_cluster_snapshot_arn() click to toggle source

The Amazon Resource Name (ARN) for the DB cluster snapshot. @return [String]

# File lib/aws-sdk-rds/db_cluster_snapshot.rb, line 158
def db_cluster_snapshot_arn
  data[:db_cluster_snapshot_arn]
end
db_cluster_snapshot_identifier()
Alias for: snapshot_id
delete(options = {}) click to toggle source

@example Request syntax with placeholder values

db_cluster_snapshot.delete()

@param [Hash] options ({}) @return [DBClusterSnapshot]

# File lib/aws-sdk-rds/db_cluster_snapshot.rb, line 489
def delete(options = {})
  options = options.merge(db_cluster_snapshot_identifier: @snapshot_id)
  resp = @client.delete_db_cluster_snapshot(options)
  DBClusterSnapshot.new(
    cluster_id: resp.data.db_cluster_snapshot.db_cluster_identifier,
    snapshot_id: resp.data.db_cluster_snapshot.db_cluster_snapshot_identifier,
    data: resp.data.db_cluster_snapshot,
    client: @client
  )
end
engine() click to toggle source

Specifies the name of the database engine for this DB cluster snapshot. @return [String]

# File lib/aws-sdk-rds/db_cluster_snapshot.rb, line 64
def engine
  data[:engine]
end
engine_mode() click to toggle source

Provides the engine mode of the database engine for this DB cluster snapshot. @return [String]

# File lib/aws-sdk-rds/db_cluster_snapshot.rb, line 71
def engine_mode
  data[:engine_mode]
end
engine_version() click to toggle source

Provides the version of the database engine for this DB cluster snapshot. @return [String]

# File lib/aws-sdk-rds/db_cluster_snapshot.rb, line 116
def engine_version
  data[:engine_version]
end
events(options = {}) click to toggle source

@example Request syntax with placeholder values

events = db_cluster_snapshot.events({
  start_time: Time.now,
  end_time: Time.now,
  duration: 1,
  event_categories: ["String"],
  filters: [
    {
      name: "String", # required
      values: ["String"], # required
    },
  ],
})

@param [Hash] options ({}) @option options [Time,DateTime,Date,Integer,String] :start_time

The beginning of the time interval to retrieve events for, specified
in ISO 8601 format. For more information about ISO 8601, go to the
[ISO8601 Wikipedia page.][1]

Example: 2009-07-08T18:00Z

[1]: http://en.wikipedia.org/wiki/ISO_8601

@option options [Time,DateTime,Date,Integer,String] :end_time

The end of the time interval for which to retrieve events, specified
in ISO 8601 format. For more information about ISO 8601, go to the
[ISO8601 Wikipedia page.][1]

Example: 2009-07-08T18:00Z

[1]: http://en.wikipedia.org/wiki/ISO_8601

@option options [Integer] :duration

The number of minutes to retrieve events for.

Default: 60

@option options [Array<String>] :event_categories

A list of event categories that trigger notifications for a event
notification subscription.

@option options [Array<Types::Filter>] :filters

This parameter isn't currently supported.

@return [Event::Collection]

# File lib/aws-sdk-rds/db_cluster_snapshot.rb, line 786
def events(options = {})
  batches = Enumerator.new do |y|
    options = options.merge(
      source_type: "db-cluster-snapshot",
      source_identifier: @snapshot_id
    )
    resp = @client.describe_events(options)
    resp.each_page do |page|
      batch = []
      page.data.events.each do |e|
        batch << Event.new(
          source_id: e.source_identifier,
          date: e.date,
          data: e,
          client: @client
        )
      end
      y.yield(batch)
    end
  end
  Event::Collection.new(batches)
end
iam_database_authentication_enabled() click to toggle source

True if mapping of Amazon Web Services Identity and Access Management (IAM) accounts to database accounts is enabled, and otherwise false. @return [Boolean]

# File lib/aws-sdk-rds/db_cluster_snapshot.rb, line 173
def iam_database_authentication_enabled
  data[:iam_database_authentication_enabled]
end
identifiers() click to toggle source

@deprecated @api private

# File lib/aws-sdk-rds/db_cluster_snapshot.rb, line 811
def identifiers
  {
    cluster_id: @cluster_id,
    snapshot_id: @snapshot_id
  }
end
kms_key_id() click to toggle source

If `StorageEncrypted` is true, the Amazon Web Services KMS key identifier for the encrypted DB cluster snapshot.

The Amazon Web Services KMS key identifier is the key ARN, key ID, alias ARN, or alias name for the Amazon Web Services KMS customer master key (CMK). @return [String]

# File lib/aws-sdk-rds/db_cluster_snapshot.rb, line 152
def kms_key_id
  data[:kms_key_id]
end
license_model() click to toggle source

Provides the license model information for this DB cluster snapshot. @return [String]

# File lib/aws-sdk-rds/db_cluster_snapshot.rb, line 122
def license_model
  data[:license_model]
end
load() click to toggle source

Loads, or reloads {#data} for the current {DBClusterSnapshot}. Returns `self` making it possible to chain methods.

db_cluster_snapshot.reload.data

@return [self]

# File lib/aws-sdk-rds/db_cluster_snapshot.rb, line 201
def load
  resp = @client.describe_db_cluster_snapshots(db_cluster_snapshot_identifier: @snapshot_id)
  @data = resp.db_cluster_snapshots[0]
  self
end
Also aliased as: reload
master_username() click to toggle source

Provides the master username for this DB cluster snapshot. @return [String]

# File lib/aws-sdk-rds/db_cluster_snapshot.rb, line 109
def master_username
  data[:master_username]
end
percent_progress() click to toggle source

Specifies the percentage of the estimated data that has been transferred. @return [Integer]

# File lib/aws-sdk-rds/db_cluster_snapshot.rb, line 135
def percent_progress
  data[:percent_progress]
end
port() click to toggle source

Specifies the port that the DB cluster was listening on at the time of the snapshot. @return [Integer]

# File lib/aws-sdk-rds/db_cluster_snapshot.rb, line 90
def port
  data[:port]
end
reload()
Alias for: load
restore(options = {}) click to toggle source

@example Request syntax with placeholder values

dbcluster = db_cluster_snapshot.restore({
  availability_zones: ["String"],
  db_cluster_identifier: "String", # required
  engine: "String", # required
  engine_version: "String",
  port: 1,
  db_subnet_group_name: "String",
  database_name: "String",
  option_group_name: "String",
  vpc_security_group_ids: ["String"],
  tags: [
    {
      key: "String",
      value: "String",
    },
  ],
  kms_key_id: "String",
  enable_iam_database_authentication: false,
  backtrack_window: 1,
  enable_cloudwatch_logs_exports: ["String"],
  engine_mode: "String",
  scaling_configuration: {
    min_capacity: 1,
    max_capacity: 1,
    auto_pause: false,
    seconds_until_auto_pause: 1,
    timeout_action: "String",
    seconds_before_timeout: 1,
  },
  db_cluster_parameter_group_name: "String",
  deletion_protection: false,
  copy_tags_to_snapshot: false,
  domain: "String",
  domain_iam_role_name: "String",
})

@param [Hash] options ({}) @option options [Array<String>] :availability_zones

Provides the list of Availability Zones (AZs) where instances in the
restored DB cluster can be created.

@option options [required, String] :db_cluster_identifier

The name of the DB cluster to create from the DB snapshot or DB
cluster snapshot. This parameter isn't case-sensitive.

Constraints:

* Must contain from 1 to 63 letters, numbers, or hyphens

* First character must be a letter

* Can't end with a hyphen or contain two consecutive hyphens

Example: `my-snapshot-id`

@option options [required, String] :engine

The database engine to use for the new DB cluster.

Default: The same as source

Constraint: Must be compatible with the engine of the source

@option options [String] :engine_version

The version of the database engine to use for the new DB cluster.

To list all of the available engine versions for `aurora` (for MySQL
5.6-compatible Aurora), use the following command:

`aws rds describe-db-engine-versions --engine aurora --query
"DBEngineVersions[].EngineVersion"`

To list all of the available engine versions for `aurora-mysql` (for
MySQL 5.7-compatible Aurora), use the following command:

`aws rds describe-db-engine-versions --engine aurora-mysql --query
"DBEngineVersions[].EngineVersion"`

To list all of the available engine versions for `aurora-postgresql`,
use the following command:

`aws rds describe-db-engine-versions --engine aurora-postgresql
--query "DBEngineVersions[].EngineVersion"`

<note markdown="1"> If you aren't using the default engine version, then you must specify
the engine version.

 </note>

**Aurora MySQL**

Example: `5.6.10a`, `5.6.mysql_aurora.1.19.2`, `5.7.12`,
`5.7.mysql_aurora.2.04.5`

**Aurora PostgreSQL**

Example: `9.6.3`, `10.7`

@option options [Integer] :port

The port number on which the new DB cluster accepts connections.

Constraints: This value must be `1150-65535`

Default: The same port as the original DB cluster.

@option options [String] :db_subnet_group_name

The name of the DB subnet group to use for the new DB cluster.

Constraints: If supplied, must match the name of an existing DB subnet
group.

Example: `mySubnetgroup`

@option options [String] :database_name

The database name for the restored DB cluster.

@option options [String] :option_group_name

The name of the option group to use for the restored DB cluster.

@option options [Array<String>] :vpc_security_group_ids

A list of VPC security groups that the new DB cluster will belong to.

@option options [Array<Types::Tag>] :tags

The tags to be assigned to the restored DB cluster.

@option options [String] :kms_key_id

The Amazon Web Services KMS key identifier to use when restoring an
encrypted DB cluster from a DB snapshot or DB cluster snapshot.

The Amazon Web Services KMS key identifier is the key ARN, key ID,
alias ARN, or alias name for the Amazon Web Services KMS customer
master key (CMK). To use a CMK in a different Amazon Web Services
account, specify the key ARN or alias ARN.

When you don't specify a value for the `KmsKeyId` parameter, then the
following occurs:

* If the DB snapshot or DB cluster snapshot in `SnapshotIdentifier` is
  encrypted, then the restored DB cluster is encrypted using the
  Amazon Web Services KMS CMK that was used to encrypt the DB snapshot
  or DB cluster snapshot.

* If the DB snapshot or DB cluster snapshot in `SnapshotIdentifier`
  isn't encrypted, then the restored DB cluster isn't encrypted.

@option options [Boolean] :enable_iam_database_authentication

A value that indicates whether to enable mapping of Amazon Web
Services Identity and Access Management (IAM) accounts to database
accounts. By default, mapping is disabled.

For more information, see [ IAM Database Authentication][1] in the
*Amazon Aurora User Guide.*

[1]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/UsingWithRDS.IAMDBAuth.html

@option options [Integer] :backtrack_window

The target backtrack window, in seconds. To disable backtracking, set
this value to 0.

<note markdown="1"> Currently, Backtrack is only supported for Aurora MySQL DB clusters.

 </note>

Default: 0

Constraints:

* If specified, this value must be set to a number from 0 to 259,200
  (72 hours).

^

@option options [Array<String>] :enable_cloudwatch_logs_exports

The list of logs that the restored DB cluster is to export to Amazon
CloudWatch Logs. The values in the list depend on the DB engine being
used. For more information, see [Publishing Database Logs to Amazon
CloudWatch Logs ][1] in the *Amazon Aurora User Guide*.

[1]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_LogAccess.html#USER_LogAccess.Procedural.UploadtoCloudWatch

@option options [String] :engine_mode

The DB engine mode of the DB cluster, either `provisioned`,
`serverless`, `parallelquery`, `global`, or `multimaster`.

For more information, see [ CreateDBCluster][1].

[1]: https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_CreateDBCluster.html

@option options [Types::ScalingConfiguration] :scaling_configuration

For DB clusters in `serverless` DB engine mode, the scaling properties
of the DB cluster.

@option options [String] :db_cluster_parameter_group_name

The name of the DB cluster parameter group to associate with this DB
cluster. If this argument is omitted, the default DB cluster parameter
group for the specified engine is used.

Constraints:

* If supplied, must match the name of an existing default DB cluster
  parameter group.

* Must be 1 to 255 letters, numbers, or hyphens.

* First character must be a letter.

* Can't end with a hyphen or contain two consecutive hyphens.

@option options [Boolean] :deletion_protection

A value that indicates whether the DB cluster has deletion protection
enabled. The database can't be deleted when deletion protection is
enabled. By default, deletion protection is disabled.

@option options [Boolean] :copy_tags_to_snapshot

A value that indicates whether to copy all tags from the restored DB
cluster to snapshots of the restored DB cluster. The default is not to
copy them.

@option options [String] :domain

Specify the Active Directory directory ID to restore the DB cluster
in. The domain must be created prior to this operation. Currently,
only MySQL, Microsoft SQL Server, Oracle, and PostgreSQL DB instances
can be created in an Active Directory Domain.

For more information, see [ Kerberos Authentication][1] in the *Amazon
RDS User Guide*.

[1]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/kerberos-authentication.html

@option options [String] :domain_iam_role_name

Specify the name of the IAM role to be used when making API calls to
the Directory Service.

@return [DBCluster]

# File lib/aws-sdk-rds/db_cluster_snapshot.rb, line 721
def restore(options = {})
  options = options.merge(snapshot_identifier: @snapshot_id)
  resp = @client.restore_db_cluster_from_snapshot(options)
  DBCluster.new(
    id: resp.data.db_cluster.db_cluster_identifier,
    data: resp.data.db_cluster,
    client: @client
  )
end
snapshot_create_time() click to toggle source

Provides the time when the snapshot was taken, in Universal Coordinated Time (UTC). @return [Time]

# File lib/aws-sdk-rds/db_cluster_snapshot.rb, line 57
def snapshot_create_time
  data[:snapshot_create_time]
end
snapshot_id() click to toggle source

@return [String]

# File lib/aws-sdk-rds/db_cluster_snapshot.rb, line 42
def snapshot_id
  @snapshot_id
end
snapshot_type() click to toggle source

Provides the type of the DB cluster snapshot. @return [String]

# File lib/aws-sdk-rds/db_cluster_snapshot.rb, line 128
def snapshot_type
  data[:snapshot_type]
end
source_db_cluster_snapshot_arn() click to toggle source

If the DB cluster snapshot was copied from a source DB cluster snapshot, the Amazon Resource Name (ARN) for the source DB cluster snapshot, otherwise, a null value. @return [String]

# File lib/aws-sdk-rds/db_cluster_snapshot.rb, line 166
def source_db_cluster_snapshot_arn
  data[:source_db_cluster_snapshot_arn]
end
status() click to toggle source

Specifies the status of this DB cluster snapshot. @return [String]

# File lib/aws-sdk-rds/db_cluster_snapshot.rb, line 83
def status
  data[:status]
end
storage_encrypted() click to toggle source

Specifies whether the DB cluster snapshot is encrypted. @return [Boolean]

# File lib/aws-sdk-rds/db_cluster_snapshot.rb, line 141
def storage_encrypted
  data[:storage_encrypted]
end
tag_list() click to toggle source

A list of tags. For more information, see [Tagging Amazon RDS Resources] in the *Amazon RDS User Guide.*

[1]: docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Tagging.html @return [Array<Types::Tag>]

# File lib/aws-sdk-rds/db_cluster_snapshot.rb, line 184
def tag_list
  data[:tag_list]
end
vpc_id() click to toggle source

Provides the VPC ID associated with the DB cluster snapshot. @return [String]

# File lib/aws-sdk-rds/db_cluster_snapshot.rb, line 96
def vpc_id
  data[:vpc_id]
end
wait_until(options = {}, &block) click to toggle source

@deprecated Use [Aws::RDS::Client] wait_until instead

Waiter polls an API operation until a resource enters a desired state.

@note The waiting operation is performed on a copy. The original resource

remains unchanged.

## Basic Usage

Waiter will polls until it is successful, it fails by entering a terminal state, or until a maximum number of attempts are made.

# polls in a loop until condition is true
resource.wait_until(options) {|resource| condition}

## Example

instance.wait_until(max_attempts:10, delay:5) do |instance|
  instance.state.name == 'running'
end

## Configuration

You can configure the maximum number of polling attempts, and the delay (in seconds) between each polling attempt. The waiting condition is set by passing a block to {#wait_until}:

# poll for ~25 seconds
resource.wait_until(max_attempts:5,delay:5) {|resource|...}

## Callbacks

You can be notified before each polling attempt and before each delay. If you throw `:success` or `:failure` from these callbacks, it will terminate the waiter.

started_at = Time.now
# poll for 1 hour, instead of a number of attempts
proc = Proc.new do |attempts, response|
  throw :failure if Time.now - started_at > 3600
end

  # disable max attempts
instance.wait_until(before_wait:proc, max_attempts:nil) {...}

## Handling Errors

When a waiter is successful, it returns the Resource. When a waiter fails, it raises an error.

begin
  resource.wait_until(...)
rescue Aws::Waiters::Errors::WaiterFailed
  # resource did not enter the desired state in time
end

@yieldparam [Resource] resource to be used in the waiting condition.

@raise [Aws::Waiters::Errors::FailureStateError] Raised when the waiter

terminates because the waiter has entered a state that it will not
transition out of, preventing success.

yet successful.

@raise [Aws::Waiters::Errors::UnexpectedError] Raised when an error is

encountered while polling for a resource that is not expected.

@raise [NotImplementedError] Raised when the resource does not

@option options [Integer] :max_attempts (10) Maximum number of attempts @option options [Integer] :delay (10) Delay between each attempt in seconds @option options [Proc] :before_attempt (nil) Callback invoked before each attempt @option options [Proc] :before_wait (nil) Callback invoked before each wait @return [Resource] if the waiter was successful

# File lib/aws-sdk-rds/db_cluster_snapshot.rb, line 303
def wait_until(options = {}, &block)
  self_copy = self.dup
  attempts = 0
  options[:max_attempts] = 10 unless options.key?(:max_attempts)
  options[:delay] ||= 10
  options[:poller] = Proc.new do
    attempts += 1
    if block.call(self_copy)
      [:success, self_copy]
    else
      self_copy.reload unless attempts == options[:max_attempts]
      :retry
    end
  end
  Aws::Waiters::Waiter.new(options).wait({})
end

Private Instance Methods

extract_cluster_id(args, options) click to toggle source
# File lib/aws-sdk-rds/db_cluster_snapshot.rb, line 821
def extract_cluster_id(args, options)
  value = args[0] || options.delete(:cluster_id)
  case value
  when String then value
  when nil then raise ArgumentError, "missing required option :cluster_id"
  else
    msg = "expected :cluster_id to be a String, got #{value.class}"
    raise ArgumentError, msg
  end
end
extract_snapshot_id(args, options) click to toggle source
# File lib/aws-sdk-rds/db_cluster_snapshot.rb, line 832
def extract_snapshot_id(args, options)
  value = args[1] || options.delete(:snapshot_id)
  case value
  when String then value
  when nil then raise ArgumentError, "missing required option :snapshot_id"
  else
    msg = "expected :snapshot_id to be a String, got #{value.class}"
    raise ArgumentError, msg
  end
end