If I have Softlayer master brand account's api

2019-09-15 00:01发布

问题:

So I have master brand's API username and key, so I can user the SoftLayer_Account API to get a list of accounts it owns (i.e. the customers). With the account ID of these customer accounts, I would think that I should be able to get its own users and get their API username and key, but I don't see a way. How do I get my customer account's API username and key by using SoftLayer APIs?

I've tried using SoftLayer_Account::getUsers() but it always gives this master user info and not the customer account's users. And I don't see any other APIs that I can use. Please help.

Basically what I want to do is to get a list of all billing items that are associated with all the accounts that are under this master brand account.

回答1:

Unfortunately it's not possible to retrieve the api keys through API from accounts(users) which belongs to your brand. but you can retrieve the billing items from each account using the below request:

https://$user:$apiKeyapi.softlayer.com/rest/v3/SoftLayer_Brand/$brandId/getOwnedAccounts?objectMask=mask[masterUser[username,apiAuthenticationKeys],allBillingItems]

Method: Get

Replace: $user, $apiKey and $brandId with your own information.

References:

  • SoftLayer_Brand::getOwnedAccounts