Paws XXXXIV (More Boto Fun)

So I was quickly knocking off the various S3Control actions until I ran in to 'ListJOBS' which I though would be an easy one as there is no XML content on this call. I kept on getting

InvalidRequest

The call cannot be any simpler a GET with this URL;

'https://985173205561.s3-control.us-east-1.amazonaws.com/v20180820/jobs?nextToken=dddd& jobStatuses=Active,Cancelled,Cancelling,Complete,Completing,Failed,Failing, New,Paused,Pausing,Preparing,Ready,Suspended &maxResults=5'

So I had a look on the API doc and this is what I found;

/v20180820/jobs?JobStatuses=JobStatuses&MaxResults=MaxResults&NextToken=NextToken

Hmm all upper case!. So I checked the generated class and they where all like this one;


 has NextToken => (
     is => 'ro',
     isa => 'Str', 
     query_name => 'nextToken', 
     traits => ['ParamInQuery'] );

Lower case first letter for 'query_name' trait. How about the the boto?



"NextToken":{
"shape":"NonEmptyMaxLength1024String",
...
"location":"querystring",
"locationName":"nextToken"
},

Lower case there so that at least matches up. But I wonder if this is the wrong case in this version of boto?? So I checked the latest version of boto and it was the same case.

I did a check of the API documentation again found that there is an inconstancy;

URI Request Parameters
The request requires the following URI parameters.

jobStatuses

It is Upper case in one part and lower case in another.

I raised yet another bug on boto.

https://github.com/boto/botocore/issues/1924

and a note on the documentation as well.

I really doubt we will have any turn around on either So for now I just fixed up my local boto to the correct upper case, recompiled and my test passed.

Not really happy with this and I bet if I peek about in the .py code I will find a kludge for this.

I did look at the rest of the S3Contol Boto and the same error is found on some other calls. For example this boto;


 "Priority":{
          "shape":"JobPriority",
          "documentation":"<p>The priority you want to assign to this job.</p>",
          "location":"querystring",
          "locationName":"priority"
        }
where the documentation says;

Request Syntax

POST /v20180820/jobs/id/priority?Priority=Priority HTTP/1.1
x-amz-account-id: AccountId

so maybe I will have to do a klude aver all??

I did clean up the boto code for the other few remaining S3Control actions and got them all working in less than an hour. For now I am going to leave the changes to boto in as the S3Contol actions that are defined by the present PAWS boto are only a partial set of eight of the sixteen actions that make up the API.

I did some checking and Boto 2 has all of these actions exposed as it is a long range plan of mine to get PAWS working with Boto 2 we might get lucky and have the problems with boto fixed by the time I am ready to play with it.

On to other other things.

69dac014a1bf48f01cff5107cc3ffb8f.jpg

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