Results matching “PAWS”

Paws the XV (Still Some Way to Go)

In my last post I got nicely snookered by the S3 call 'GetBucketLocation' which was one of the call that had a 'todo' test.

The XML coming back from ASW is correct

<?xml version="1.0" encoding="UTF-8"?> <LocationConstraint xmlns="http://s3.amazonaws.com/doc/2006-0301/"> EU </LocationConstraint> but no matter what I tried on 'XML::Simple' I could not get it to parse just the way I want though I did get very close with this

 my $xml = XML::Simple->new(
      ForceArray    =&g…

Paws XIV (The Sun King)

Well carrying on with my quest to clean up the Paws S3 code I decided while I am waiting for my last batch of changes to be reviewed I decided to review some of the 'TODO' tests.

TODO passed: 6364, 6370, 7896, 10045, 10052, 10137

First a 'TODO' test is a stubbed in test that will most likely fail and if it does it will not effect the final Pass/Fail of test case. It is basically one of these

The first one I am going to play with is 's3-get-bucket-location.response.test.yml which looks like this

Paws XIII (The Unlucky one)

I left off in my last post with all my bits and bods to get the proper structure in my generated perl class from the Json data. Now I have to get the 'status' out of the response and then into my class.

By now I know where to start to look to in the code to apply my changes. I started in Paws::Net::RestXMLResponse' class at its 'process' sub which looks at the response 'status' and takes either the error path (>=300) or the happy path (<300). We are interested in the happy path and that takes us to the 'response_to_object' sub.

First I can see that I have the '…

Paws XII (High Noon Dog)

In my last post I was just getting the last parts of my new 'Satus' attribute in place having only one more part to create and that is a new 'trait' in '/lib/Paws/API.pm'

I was thinking af starting by coping the present package;


package Paws::API::Attribute::Trait::NameInRequest;
  use Moose::Role;
  use Moose::Util;
  Moose::Util::meta_attribute_alias('NameInRequest');
  has request_name => (is => 'ro', isa => 'Str');

and just changing the 'Request' for 'Response'. However looking at the role I see it is also adding a 'reques…

Paws XI - III (back we go)

I finally had a response to my question from this post about adding a new attribute '_status' to the auto-generated classes that Paws creates;

I'd try to avoid leaking HTTP details to the user by default. It's true that for this API call the HTTP Status is relevant to the caller, so exposing it seems legit. I'd try to limit the scope of exposing the HTTP return status by adding an attribute role like https://github.com/pplu/aws-sdk-perl/blob/master/lib/Paws/API.pm#L1 that signal the response to object routines to…

Paws X (Well not XXX)

I had my response from my question up in github.

If I am remembering correctly we are throwing an exception because at some point in time AWS has returned invalid XML on non-200 responses (the test suite tries to covers more cases). The error message was too cryptic when invalid XML came in, so we started to throw a Paws::Exception that at least gives you an indication of what went on.

Hmm ok so the test case might be valid though I do not see how that is a problem for Paws if AWS is returning inv…

Paws The IX (Not Quite X)

I am getting close to finishing off my first Paws patch.

I left off with this test failing

not ok 27 - got exception # Failed test 'got exception' # at t/11_client_exceptions.t line 104. # expecting: Paws::Exception # found: Moose::Exception::ValidationFailedForTypeConstraint (Attribute (host_id) does not pass the type constraint because: Validation failed for 'Str' with value undef at /wwwveh/lib/x86_64-linux-thread-multi/Moose/Meta/Class.pm line 275 # Moose::Meta::Class::new_object at (eval 429) line 28 # Throwable::Error::new at /home/s…

Paws The VIII (The Henry Factor)

Ok today I am going to look a the impact my changes from the last few post have had on the systems as a whole. So far I have tinkered with a few things

  1. Got my RestoreObject to work
  2. Modified the Botocore S3 json file to add in some documentation
  3. I added code to get the '="https://blogs.perl.org/users/byterock/2019/10/paws-for-fun-and-profit-the…

Paws the VII (B4 and After)

Well I left off in my last post with having 2 of the 3 tests I created failed;

ok 10210 - Got _status eq 200 from result ok 10211 - Call S3->RestoreObject from t/10_responses/s3-restore-object.3.response not ok 10212 - Got request_id eq 195AF4042CD6DF80 from result

# Failed test 'Got request_id eq 195AF4042CD6DF80 from result'
# at t/10_responses.t line 136.
# got: 'AC65B3BF8AC3AA34'
# expected: '195AF4042CD6DF80'
not ok 10213 - Got message eq Object restore is already in progress from result

# Failed test 'Go…

Paws the VI (Pardon my Error)

Now things are going good so far but I have run into a little snag with the program that is using my S3 RestoreObject code with Paws. Namely at this point my end user is trying to make the same restore request before the first restore has finished.

Right now if I capture the error with an eval {} in my call I get in the @$ is 'Conflict';

The API documentation does state that I can get as few special errors that are interesting to me;


+---------------------------------------+-------------------------------+--------+
| Message                       …
  1 2 3 4 5 6  

About byterock

user-pic Long time Perl guy, a few CPAN mods allot of work on DBD::Oracle and a few YAPC presentations