Paws XXXIX (The Paws is Dead. Long Live the Paws)

S3 is a wrap was quite the journey since September.

The end result

  • All non depreciated S3 actions on API work
  • A new test case 09_requests.t and test for each action was created
  • All none deprecated action now have a 10_response test as well
  • A new Caller that generates both 09 and 10 test case
  • NO changes needed to BOTO

The most important aspect of my changes in my opinion is figuring out how to handle the botocode correctly to cover all the use cases. It was a slow iterative process and what really saved my but was creating the test cases as I went along as I quickly found out if a change that fixed one thing broke something.

There was a combination of changes to the class templates to get the the correct perl class out of the Boto JSON, a number of changes to convert those classes into the correct request XML content and a few changes to how the URL and URI where generated.

For example the present Paws code (.42) generates this class;

package Paws::S3::AccessControlPolicy;
use Moose;
has Grants => (is => 'ro', isa => 'ArrayRef[Paws::S3::Grant]', request_name => 'Grant', request_name => 'AccessControlList', traits => ['NameInRequest','NameInRequest']);
has Owner => (is => 'ro', isa => 'Paws::S3::Owner');

From the Grant JSON;


Obviously you cannot have the same trait twice so I had to create a new Moose trait 'ListNameInRequest', change the templates a little to add in this trait and then in the XML generation sub of RestXMLCaller to handle the new train and now I get ;

package Paws::S3::AccessControlPolicy;
  use Moose;
  has Grants => (is => 'ro', isa => 'ArrayRef[Paws::S3::Grant]', request_name => 'Grant', list_request_name => 'AccessControlList'  , traits => ['N
ameInRequest','ListNameInRequest']  );
  has Owner => (is => 'ro', isa => 'Paws::S3::Owner'  );

There where number of other odd things from JSON being returned from a XML AIP, Mistakes is the AIP documentation that where carried over to the JSON, a required MDN5 being expressed by the API but not reflected by the docs and some inconstancy between the docs and the API in capitalization of some params.

Long story short I am finished for S3 and going to move onto the next part of the project and get S3Control working.

Hopefully with all the changes I have made for S3, my new test generator caller and my complete test suite it will be a little easier.

Now I wonder when all of this is going to get into PAWS!!


Leave a comment

About byterock

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