想知道是否可以让被允许访问/登录特定设备的用户
对我来说获取所有服务器的信息没有用。我想知道一些特定的设备
请咨询
答案 0 :(得分:1)
https://$user:$apiKey@api.softlayer.com/rest/v3/SoftLayer_Account/getVirtualGuests?objectFilter={"virtualGuests":{"hostname":{"operation":"in","options":[{"name":"data","value":["vsi1","vsi2"]}]}}}&objectMask=mask[users]
替换:$ username,$ apiKey vsi和vsi2与vsi的主机名
https://$user:$apiKey@api.softlayer.com/rest/v3/SoftLayer_Account/getHardware?objectFilter={"hardware":{"hostname":{"operation":"in","options":[{"name":"data","value":["server1","server2","server3"]}]}}}&objectMask=users
我可以推荐使用rest的其他替代方法,但是你只能获得在 fullyQualifiedDomainName 中有特定文本的设备(bms / vsi),在这个例子中,我尝试使用“”的服务器testName “,根据您的要求替换它
https://$username:$apiKey@api.softlayer.com/rest/v3.1/SoftLayer_Search/advancedSearch?objectMask=mask[resource(SoftLayer_Hardware_Server)[id,datacenter,fullyQualifiedDomainName,users.id,users.username],resource(SoftLayer_Virtual_Guest)[id,datacenter,fullyQualifiedDomainName,users.id,users.username]]
Method: Post
{"parameters":["fullyQualifiedDomainName:testName _objectType:SoftLayer_Virtual_Guest,SoftLayer_Hardware _sort:[fullyQualifiedDomainName:asc]"]}
我希望它有所帮助,如果您需要进一步的帮助或任何疑问,请告诉我
<强>参考文献:强>