Mit Sammlungen den Überblick behalten
Sie können Inhalte basierend auf Ihren Einstellungen speichern und kategorisieren.
Nach Sicherheitsgruppen suchen
Auf dieser Seite wird erläutert, wie Sie alle Ihre Sicherheitsgruppen mit der Cloud Identity Groups API finden.
REST
Um nach allen Sicherheitsgruppen zu suchen, rufen Sie groups.search() mit dem Abfragestring labels:cloudidentity.googleapis.com/groups.security auf.
Python
Im folgenden Beispiel wird eine Hilfsfunktion zur Suche nach Sicherhheitsgruppen mithilfe der Python-Clientbibliothek gezeigt:
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)
[[["Leicht verständlich","easyToUnderstand","thumb-up"],["Mein Problem wurde gelöst","solvedMyProblem","thumb-up"],["Sonstiges","otherUp","thumb-up"]],[["Schwer verständlich","hardToUnderstand","thumb-down"],["Informationen oder Beispielcode falsch","incorrectInformationOrSampleCode","thumb-down"],["Benötigte Informationen/Beispiele nicht gefunden","missingTheInformationSamplesINeed","thumb-down"],["Problem mit der Übersetzung","translationIssue","thumb-down"],["Sonstiges","otherDown","thumb-down"]],["Zuletzt aktualisiert: 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)"]]