def get_org_iam_policies(self, resource_name, org_id):
"""Get all the iam policies of an org.
Args:
resource_name (str): The resource type.
org_id (int): The org id number.
Returns:
dict: Organization IAM policy for given org_id.
https://cloud.google.com/resource-manager/reference/rest/Shared.Types/Policy
Raises:
ApiExecutionError: An error has occurred when executing the API.
"""
resource_id = 'organizations/%s' % org_id
try:
iam_policy = (
self.repository.organizations.get_iam_policy(resource_id))
return {'org_id': org_id,
'iam_policy': iam_policy}
except (errors.HttpError, HttpLib2Error) as e:
raise api_errors.ApiExecutionError(resource_name, e)
cloud_resource_manager.py 文件源码
python
阅读 24
收藏 0
点赞 0
评论 0
评论列表
文章目录