이 페이지에서는 Cloud Identity Groups API를 사용하여 모든 보안 그룹을 찾는 방법을 설명합니다.
REST
모든 보안 그룹을 검색하려면 labels:cloudidentity.googleapis.com/groups.security 쿼리 문자열을 사용하여 groups.search()를 호출합니다.
Python
다음 예시에서는 Python 클라이언트 라이브러리를 사용하여 보안 그룹을 검색하기 위한 도우미 함수를 보여줍니다.
defsearch_security_groups(service,identity_source_id,pageSize,view):# Set the label to search for all Google groupssearchQuery="&query=parent=='customers/{customer_id}'&&labels:cloudidentity.googleapis.com/groups.security" \
+"&pageSize="+pageSize+"&view="+viewtry:searchGroupsRequest=service.groups().search()searchGroupsRequest.uri+=searchQueryresponse=searchGroupsRequest.execute()print(response)exceptExceptionase:print(e)
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["이해하기 어려움","hardToUnderstand","thumb-down"],["잘못된 정보 또는 샘플 코드","incorrectInformationOrSampleCode","thumb-down"],["필요한 정보/샘플이 없음","missingTheInformationSamplesINeed","thumb-down"],["번역 문제","translationIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-09-04(UTC)"],[[["\u003cp\u003eThis page outlines the process of finding all security groups using the Cloud Identity Groups API.\u003c/p\u003e\n"],["\u003cp\u003eUtilize the \u003ccode\u003egroups.search()\u003c/code\u003e method in the API with the query string \u003ccode\u003elabels:cloudidentity.googleapis.com/groups.security\u003c/code\u003e to search for security groups.\u003c/p\u003e\n"],["\u003cp\u003eWhen using methods that require the \u003ccode\u003ecustomer_id\u003c/code\u003e, ensure it is prepended with "C", like in the example 'C046psxkn'.\u003c/p\u003e\n"],["\u003cp\u003eThe Python example demonstrates a helper function that can be used to search for all security groups, specifying a customer ID and security label.\u003c/p\u003e\n"]]],[],null,["# Searching for security groups\n=============================\n\nThis page explains how to find all of your security groups with the\nCloud Identity Groups API.\n**Note:** When a method requires the `customer_id`, you must prepend a \"C\" to the ID that you can view in the Google Admin console (for example, 'C046psxkn'). \n\n### REST\n\nTo search for all security groups, call\n[`groups.search()`](/identity/docs/reference/rest/v1/groups/search)\nwith a query string of `labels:cloudidentity.googleapis.com/groups.security`.\n\n### Python\n\nThe following example shows a helper function to search for security groups\nusing the Python client library: \n\n def search_security_groups(service, identity_source_id, pageSize, view):\n # Set the label to search for all Google groups\n searchQuery = \"&query=parent=='customers/{customer_id}'&&labels:cloudidentity.googleapis.com/groups.security\" \\\n + \"&pageSize=\" + pageSize + \"&view=\" + view\n try:\n searchGroupsRequest = service.groups().search()\n searchGroupsRequest.uri += searchQuery\n response = searchGroupsRequest.execute()\n print(response)\n except Exception as e:\n print(e)"]]