Subject: | improper HTTP method in get_vault_notifications |
The get_vault_notifications should use GET, instead of PUT (https://docs.aws.amazon.com/amazonglacier/latest/dev/api-vault-notifications-get.html)
The attached patch fixes this as well as some minor typos in croak messages.
Subject: | 1-get_vault_notifications.patch |
Fix misguiding croak messages.
Fix HTTP method in get_vault_notifications (must be GET)
Index: Net-Amazon-Glacier-0.15/lib/Net/Amazon/Glacier.pm
--- Net-Amazon-Glacier-0.15-orig/lib/Net/Amazon/Glacier.pm 2014-08-05 21:34:59.000000000 +0200
+++ Net-Amazon-Glacier-0.15/lib/Net/Amazon/Glacier.pm 2018-12-15 15:01:13.148498597 +0100
@@ -125,7 +125,7 @@ sub create_vault {
my $res = $self->_send_receive( PUT => "/-/vaults/$vault_name" );
# updated error severity
- croak 'describe_vault failed with error ' . $res->status_line
+ croak 'create_vault failed with error ' . $res->status_line
unless $res->is_success;
return 1;
@@ -247,7 +247,7 @@ sub set_vault_notifications {
encode_json($content_raw),
);
# updated error severity
- croak 'get_vault_notifications failed with error ' . $res->status_line
+ croak 'set_vault_notifications failed with error ' . $res->status_line
unless $res->is_success;
return 1;
@@ -270,7 +270,7 @@ sub get_vault_notifications {
croak "no vault name given" unless $vault_name;
my $res = $self->_send_receive(
- PUT => "/-/vaults/$vault_name/notification-configuration",
+ GET => "/-/vaults/$vault_name/notification-configuration",
);
# updated error severity
croak 'get_vault_notifications failed with error ' . $res->status_line