Subject: | [patch] add delete_archive support |
Date: | Thu, 15 Nov 2012 15:21:19 -0800 |
To: | bug-Net-Amazon-Glacier [...] rt.cpan.org |
From: | Ted Reed <treed [...] imvu.com> |
Self-explanatory. :)
--- a/lib/Net/Amazon/Glacier.pm
+++ b/lib/Net/Amazon/Glacier.pm
@@ -162,6 +162,21 @@
}
}
+=head2 delete_archive( $vault_name, $archive_id )
+
+Issues a request to delete a file from Glacier. $archive_id is the ID you
received either when you uploaded the file originally or from an inventory.
+
+=cut
+
+sub delete_archive {
+ my ( $self, $vault_name, $archive_id ) = @_;
+ croak "no vault name given" unless $vault_name;
+ croak "no archive ID given" unless $archive_id;
+
+ my $res = $self->_send_receive( DELETE =>
"/-/vaults/$vault_name/archives/$archive_id" );
+
+ return $res->is_success;
+}
=head1 JOB OPERATIONS