Highlighted
cblackuk
1 Copper

Listing all objects on ECS via Atmos API returns <Code>1002</Code><Message>One or more arguments in the request were invalid.</Message>

Hi All,

I am struggling to get /rest/objects working on ECS via Atmos API.

When I run the following code on Atmos via Atmos API it works fine, it lists all the objects; however, when I run the same query against ECS I get the following error:

<ns2:Error xmlns:ns2="http://www.emc.com/cos/"><Code>1002</Code><Message>One or more arguments in the request were invalid.</Message></ns2:Error>

The script I am using is modified version of the one here:

Error 1032 while executing REST API Calls

I can get all the other commands working fine like /rest/objects?listabletags etc... it is only /rest/objects that does not work.

Also I have tried a similar shell script and results are the same

Perl Code:

#!/usr/bin/perl

use strict;

use Time::Local;

use MIME::Base64;

use Digest::SHA qw(hmac_sha1);

sub _MyUTCTime(){

my @Time=split(" ",scalar gmtime());

my ($Wkday,$Mon,$Day,$time,$year) = @Time;

my $UTCTime = $Wkday . ", " . $Day . " $Mon" . " $year " . $time . " GMT";

return $UTCTime;

}

my $UserID='<subtenantid>/<uid>';

my $SharedSecret = 'xxxx';

my $Subtenantid='xxxxxxx';

my $HostName='https://xxxxxx:443';

my $url_atmos_path='/rest/objects';

my $combinestring = $HostName . $url_atmos_path;

print "$combinestring\n";

my $HTTPRequestMethod = 'GET';

my $ContentType = "application/octet-stream";

my $Range = "";

my $Date= _MyUTCTime;

my $CanonicalizedResource = '/rest/objects';

my $CanonicalizedEMCHeaders = 'x-emc-date:'.$Date."\n".'x-emc-subtenant-id:'.$Subtenantid."\n".'x-emc-uid:'.$UserID;

my $HashString = $HTTPRequestMethod . "\n" . $ContentType . "\n" . $Range . "\n". "\n".$CanonicalizedResource . "\n" . $CanonicalizedEMCHeaders;

print "StringToSign:\n$HashString\n";

my $DecodedSharedSecret = decode_base64($SharedSecret);

my $digest=hmac_sha1($HashString,$DecodedSharedSecret);

my $EMCSignature= encode_base64($digest, "");

my $cmd =  `curl -k -s -v -H "Content-Type:$ContentType" -H "x-emc-date:$Date" -H "x-emc-subtenant-id:$Subtenantid" -H "x-emc-uid:$UserID" -H "x-emc-signature:$EMCSignature" -X GET $combinestring`;

print "$cmd\n";

print "$CanonicalizedEMCHeaders\n";

print "$HashString\n";

Just to clarify, on ECS I am using 9023 port so that will be the "only" difference. Also, I have tried with and without subtenant-id in the header and same 1002 error occurs in both cases.

In addition, I just tested /rest/namespace query on its own and on Atmos it works fine but on ECS it returns:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?><ns2:Error xmlns:ns2="http://www.emc.com/cos/"><Code>1001</Code><Message>The server encountered an internal error. Please try again.</Message></ns2:E

Same caveats apply i.e. tried with x-emc-subtenant-id header and without... no change.

Tags (5)
0 Kudos
4 Replies
8 Krypton

Re: Listing all objects on ECS via Atmos API returns <Code>1002</Code><Message>One or more arguments in the request were invalid.</Message>

You're missing the header "x-emc-tags".  This selects which listable tag you want to enumerate.  See page 102 of the programmer's guide:

https://support.emc.com/docu68370_Atmos-2.4-Programmer's-Guide.pdf?language=en_US

0 Kudos
cblackuk
1 Copper

Re: Listing all objects on ECS via Atmos API returns <Code>1002</Code><Message>One or more arguments in the request were invalid.</Message>

Hi Jason,

Thank you very much for getting back to me.

I was going to add that it works fine if I add x-emc-tags but I do not need to do it on Atmos for it to list all the objects. Therefore I assumed it is not working as intended. Even that API guide does not explicitly say you need to specify a tag... and again for Atmos it works fine.

Having said that, if this is the only way, is there a way to display all items by using a wildcard tag of sorts? If this is the only way ECS will actually display objects, there needs to be a way surely to list them without having to specify all the tags? Especially given the fact that both /namespace and /objects in Atmos list all items fine... Additionally, how would you list objects that are not tagged?

Update:

I managed to get /namespace to work... the 1001 error is returned when you just put /rest/namespace but if you put /rest/namespace/

Making yet another difference between Atmos and ECS as for Atmos both /rest/namespace and /rest/namespace/ return all the namesapces without an issue.

0 Kudos
8 Krypton

Re: Listing all objects on ECS via Atmos API returns <Code>1002</Code><Message>One or more arguments in the request were invalid.</Message>

cblackuk,

I'm curious how you discovered that it was possible to pass x-emc-subtenant-id header in the GET request to list all objects as I've never tried nor knew this call was available.  It does in fact work on real Atmos for me too.  However, the same call is failing on ECS via Atmos protocol.  I've opened an internal JIRA for this inconsistency and will post back to this thread as I hear updates.

Ben

0 Kudos
cblackuk
1 Copper

Re: Listing all objects on ECS via Atmos API returns <Code>1002</Code><Message>One or more arguments in the request were invalid.</Message>

Hi Ben,

I took the "inspiration" from

https://community.emc.com/docs/DOC-27822 - Creating Subtenants on ECS

Then basically trial and error and I got it working on Atmos but I cannot get it working on ECS...

So originally, I was working with this Bash/Python script and made it work but I then I found the aforementioned PERL script and I can get Atmos to work with both and ECS with neither...

0 Kudos