보안 그룹 검색
이 페이지에서는 Cloud Identity Groups API를 사용하여 모든 보안 그룹을 찾는 방법을 설명합니다.
REST
모든 보안 그룹을 검색하려면 labels:cloudidentity.googleapis.com/groups.security
쿼리 문자열을 사용하여 groups.search()
를 호출합니다.
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)