SoftLayer API:一个用户可以访问多个帐户吗?
SoftLayer API: can a user access multiple accounts?
用户能否通过 SoftLayer REST 访问多个帐户API?
如果是这样,下面的要求是否正确?我以为我上周提交了这个带有无效 accountID 的请求并收到了一个空的响应(如预期的那样)。今天,无论我是否输入有效的 accountId,我所有的虚拟客人都会被退回。
https://api.softlayer.com/rest/v3/SoftLayer_Account/<accountId>/VirtualGuests
谢谢,
您可以在请求中指定 SoftLayer 用户名和 API 信息。例如,我使用导出取决于我是在处理我的个人项目还是工作项目。
工作
curl -s https://$SOFTLAYER_USERNAME:$SOFTLAYER_API_KEY@api.softlayer.com/rest/v3/SoftLayer_Account/getVirtualGuests
个人
curl -s https://$PERSONAL_USERNAME:$PERSONAL_API_KEY@api.softlayer.com/rest/v3/SoftLayer_Account/getVirtualGuests
API 将根据您指定的用户名和 API 密钥知道您从中获取信息的帐户。
如果您在两个帐户中链接了一个 IBMid(我相信您指的是这个),您将生成两个用户名,每个帐户一个,带有 api 密钥(如果您使用 API).例如在我的例子中:
mail: test@softlayer.com
Account 1
- Account: 111222
- username: 111222_test@softlayer.com
- apiKey: Generated
Account 2
- Account: 111333
- username: 111333_test@softlayer.com
- apiKey: Generated
因此,您需要为要从中检索 VSI 的帐户使用正确的凭据
休息请求:
https://api.softlayer.com/rest/v3/SoftLayer_Account/getVirtualGuests
Method: Get
用户能否通过 SoftLayer REST 访问多个帐户API?
如果是这样,下面的要求是否正确?我以为我上周提交了这个带有无效 accountID 的请求并收到了一个空的响应(如预期的那样)。今天,无论我是否输入有效的 accountId,我所有的虚拟客人都会被退回。
https://api.softlayer.com/rest/v3/SoftLayer_Account/<accountId>/VirtualGuests
谢谢,
您可以在请求中指定 SoftLayer 用户名和 API 信息。例如,我使用导出取决于我是在处理我的个人项目还是工作项目。
工作
curl -s https://$SOFTLAYER_USERNAME:$SOFTLAYER_API_KEY@api.softlayer.com/rest/v3/SoftLayer_Account/getVirtualGuests
个人
curl -s https://$PERSONAL_USERNAME:$PERSONAL_API_KEY@api.softlayer.com/rest/v3/SoftLayer_Account/getVirtualGuests
API 将根据您指定的用户名和 API 密钥知道您从中获取信息的帐户。
如果您在两个帐户中链接了一个 IBMid(我相信您指的是这个),您将生成两个用户名,每个帐户一个,带有 api 密钥(如果您使用 API).例如在我的例子中:
mail: test@softlayer.com
Account 1
- Account: 111222
- username: 111222_test@softlayer.com
- apiKey: Generated
Account 2
- Account: 111333
- username: 111333_test@softlayer.com
- apiKey: Generated
因此,您需要为要从中检索 VSI 的帐户使用正确的凭据
休息请求:
https://api.softlayer.com/rest/v3/SoftLayer_Account/getVirtualGuests
Method: Get