我想通过Softlayer的Python API检索用户的当前权限,理想情况下是包含在用户门户上看到的权限的列表。
我尝试了under User_Customer service方法,它返回以下错误:
SoftLayer.exceptions.SoftLayerAPIError: SoftLayerAPIError(SoftLayer_Exception): Object does not exist to execute method on. (SoftLayer_User_Customer::getPermissions)
我知道可能需要为特定的API调用设置标头,但我找不到解释如何在Python API中设置标头的来源。
我也试过给this Account service method打电话。这会成功,但会返回帐户下的用户列表,而不是我期望的信息。
发布于 2017-03-10 21:40:34
在这里,您可以看到有关使用python客户端的示例:
https://softlayer.github.io/python/
有关与用户关联的权限的详细信息,您可以查看此示例:
https://softlayer.github.io/python/set_permission/
permissions = self.client['User_Customer'].getPermissions(id=user_id)
print("=== OLD PERMISSIONS ===")
self.printPermissions(permissions)
问候
https://stackoverflow.com/questions/42719709
复制相似问题