セキュリティ グループの検索
このページでは、Cloud Identity Groups API を使用してすべてのセキュリティ グループを見つける方法について説明します。
REST
すべてのセキュリティ グループを検索するには、groups.search()
を呼び出してlabels:cloudidentity.googleapis.com/groups.security
のクエリ文字列を指定します。
Python
Python クライアント ライブラリを使用してセキュリティ グループを検索するヘルパー関数を、次の例に示します。
def search_security_groups(service, identity_source_id, pageSize, view):
# Set the label to search for all Google groups
searchQuery = "&query=parent=='customers/{customer_id}'&&labels:cloudidentity.googleapis.com/groups.security" \
+ "&pageSize=" + pageSize + "&view=" + view
try:
searchGroupsRequest = service.groups().search()
searchGroupsRequest.uri += searchQuery
response = searchGroupsRequest.execute()
print(response)
except Exception as e:
print(e)