Softlayer API来获取虚拟客户所有者

时间:2016-02-29 09:01:58

标签: ibm-cloud-infrastructure

是否有任何API可以获取虚拟客户的所有者(已配置虚拟客户的用户)? 我只能看到有权访问虚拟来宾API的用户。

由于

3 个答案:

答案 0 :(得分:1)

请使用过滤器尝试以下请求:

https://[username]:[apikey]@api.softlayer.com/rest/v3/SoftLayer_Account/getVirtualGuests?objectFilter={   "virtualGuests": {     "billingItem": {       "orderItem": {         "order": {           "userRecord": {             "username": {               "operation": "myUserName"             }           }         }       }     }   } }&objectMask=mask[id,fullyQualifiedDomainName,billingItem.orderItem.order.userRecord.username]

Method: GET

修改

此外,要获得与“username”相关的裸机服务器,请执行:

https://[username]:[apikey]@api.softlayer.com/rest/v3/SoftLayer_Account/getHardware?objectFilter={   "hardware": {     "billingItem": {       "orderItem": {         "order": {           "userRecord": {             "username": {               "operation": "myUsername"             }           }         }       }     }   } }&objectMask=mask[id,fullyQualifiedDomainName,billingItem.orderItem.order.userRecord.username]
Method: GET

如果你知道server Id,请使用“object masks”获取比默认情况更多的信息,例如:

虚拟访客:

https://[username]:[apikey]@api.softlayer.com/rest/v3/SoftLayer_Virtual_Guest/[virtual_guest_Id]/getObject?objectMask=mask[id,fullyQualifiedDomainName,billingItem[id,orderItem[id,order[userRecord[id,username]]]]]
Method: GET

<强>设备:

https://[usrename]:[apikey]@api.softlayer.com/rest/v3/SoftLayer_Hardware/[hardware_id]/getObject?objectMask=mask[id,fullyQualifiedDomainName,billingItem[id,orderItem[id,order[userRecord[id,username]]]]]
Method: GET

一些参考文献:

REST

Object Filters

Time for a REST, Everyone

答案 1 :(得分:0)

SoftLayer_User_Customer:getVirtualGuests提供我有权访问的所有虚拟客户,而不是我实际配置的虚拟客户。

答案 2 :(得分:0)

请尝试这种方法:

SoftLayer_Account::getVirtualGuests