Send feedback
Stay organized with collections
Save and categorize content based on your preferences.
Searching for security groups
This page explains how to find all of your security groups with the
Cloud Identity Groups API.
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').
REST To search for all security groups, call
groups.search()
with a query string of labels:cloudidentity.googleapis.com/groups.security
.
Python The following example shows a helper function to search for security groups
using the Python client library:
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)
Send feedback
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License , and code samples are licensed under the Apache 2.0 License . For details, see the Google Developers Site Policies . Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-10-30 UTC.
Need to tell us more?
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-10-30 UTC."],[],[]]