vavavr00m / boto

Automatically exported from code.google.com/p/boto
1 stars 0 forks source link

Issue Getting All Information from iam.getAccountSummary #558

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Instantantiate an IAM connection (iam = boto.connect_iam(...))
2. Call the GetAccountSummary method from Amazon (not implemented directly in 
boto right now, so do 'iam.get_response("GetAccountSummary", {})
3.

What is the expected output? What do you see instead?

As per 
http://docs.amazonwebservices.com/IAM/latest/APIReference/index.html?API_GetAcco
untSummary.html you should receive back a response with about 11 different 
key/value pairs

What I get instead is:
{u'get_account_summary_response': {u'get_account_summary_result': 
{u'summary_map': {u'entry': {u'key': u'ServerCertificatesQuota',
     u'value': u'100'}}},
  u'response_metadata': {u'request_id': u'1fe28bfb-f426-11e0-8116-87b33030103f'}}}

Notice there's only one key/value pair ('SeverCertificatesQuota').  

What version of the product are you using? On what operating system?

Version 2.0, on RHEL 5.5

Please provide any additional information below.

I suspect the issue here is that the XML returned by Amazon uses exactly one 
node name:

<GetAccountSummaryResponse xmlns="https://iam.amazonaws.com/doc/2010-05-08/">
  <GetAccountSummaryResult>
    <SummaryMap>
      <entry>
        <key>Groups</key>
        <value>23</value>
      </entry>
      <entry>
        <key>GroupsQuota</key>
        <value>100</value>
      </entry>
      <entry>
        <key>UsersQuota</key>
        <value>5000</value>
      </entry>
      <entry>
        <key>Users</key>
        <value>16</value>
      </entry>
      <entry>
        <key>GroupPolicySizeQuota</key>
        <value>5120</value>
      </entry>
      <entry>
        <key>AccessKeysPerUserQuota</key>
        <value>2</value>
      </entry>
      <entry>
        <key>GroupsPerUserQuota</key>
        <value>10</value>
      </entry>
      <entry>
        <key>UserPolicySizeQuota</key>
        <value>2048</value>
      </entry>
      <entry>
        <key>SigningCertificatesPerUserQuota</key>
        <value>2</value>
      </entry>
      <entry>
        <key>ServerCertificates</key>
        <value>49</value>
      </entry>
      <entry>
        <key>ServerCertificatesQuota</key>
        <value>100</value>
      </entry>
    </SummaryMap>
  </GetAccountSummaryResult>
  <ResponseMetadata>
    <RequestId>1fe28bfb-f426-11e0-8116-87b33030103f</RequestId>
  </ResponseMetadata>
</GetAccountSummaryResponse>

You'll see all entries are in an <entry> tag.  It appears that -- I'm guessing 
-- the fact it's using the same name for all these nodes means you end up 
keeping just the last <entry> k/v pair.  

Original issue reported on code.google.com by royrapop...@gmail.com on 11 Oct 2011 at 4:38

GoogleCodeExporter commented 9 years ago
I'll add official support for GetAccountSummary.  See 
https://github.com/boto/boto/issues/364 for tracking.

Original comment by Mitch.Ga...@gmail.com on 11 Oct 2011 at 4:51

GoogleCodeExporter commented 9 years ago

Original comment by Mitch.Ga...@gmail.com on 11 Oct 2011 at 5:34