通过 API 检索 Softlayer 用户的权限
Retrieve a Softlayer user's permission via API
我想通过 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 调用设置 header,但我找不到解释如何设置 header 的来源在 Python API.
我也试过打电话 this Account service method。哪个成功了,但是 returns 帐户下的用户列表而不是我期望的信息。
您可以在此处查看有关 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)
此致
我想通过 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 调用设置 header,但我找不到解释如何设置 header 的来源在 Python API.
我也试过打电话 this Account service method。哪个成功了,但是 returns 帐户下的用户列表而不是我期望的信息。
您可以在此处查看有关 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)
此致