The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

VM::EC2::BlockDevice::Attachment - Object describing the attachment of an EBS volume to an instance

SYNOPSIS

  use VM::EC2;

  $ec2         = VM::EC2->new(...);
  $volume      = $ec2->describe_volumes(-volume_id=>'vol-12345');
  $attachment  = $ec2->attachment;

  $volId       = $attachment->volumeId;
  $instanceId  = $attachment->instanceId;
  $status      = $attachment->status;
  $time        = $attachment->attachTime;
  $delete      = $attachment->deleteOnTermination;

DESCRIPTION

This object is used to describe the attachment of an Amazon EBS volume to an instance. It is returned by VM::EC2::Volume->attachment().

METHODS

The following object methods are supported:

 volumeId         -- ID of the volume.
 instanceId       -- ID of the instance
 status           -- Attachment state, one of "attaching", "attached",
                     "detaching", "detached".
 attachTime       -- Timestamp for when volume was attached
 deleteOnTermination -- True if the EBS volume will be deleted when its
                     attached instance terminates. Note that this is a
                     Perl true, and not the string "true".

In addition, this class provides several convenience functions:

$instance = $attachment->instance

Returns the VM::EC2::Instance corresponding to this attachment.

$volume = $attachment->volume

Returns the VM::EC2::Volume object corresponding to this attachment.

$status = $attachment->current_status

Refreshes the information in the object and returns status().

$attachment->refresh

Calls AWS to refresh the attachment information.

STRING OVERLOADING

When used in a string context, this object will interpolate into a string of the format "volumeId=>instanceId".

SEE ALSO

VM::EC2 VM::EC2::Generic VM::EC2::Instance VM::EC2::Volume

AUTHOR

Lincoln Stein <lincoln.stein@gmail.com>.

Copyright (c) 2011 Ontario Institute for Cancer Research

This package and its accompanying libraries is free software; you can redistribute it and/or modify it under the terms of the GPL (either version 1, or at your option, any later version) or the Artistic License 2.0. Refer to LICENSE for the full license text. In addition, please see DISCLAIMER.txt for disclaimers of warranty.