ID 매핑 그룹 만들기 및 검색

이 페이지에서는 ID 매핑 그룹을 만들고 검색하는 방법을 설명합니다. ID 매핑 그룹은 Active Directory 그룹과 같은 외부 ID 소스의 그룹을 미러링하는 그룹 유형입니다. ID 매핑 그룹은 Google Cloud Search용 ID 커넥터를 만들 때 사용됩니다.

ID 매핑 그룹에 대한 자세한 내용은 그룹스 API 개요를 참조하세요.

다음 섹션에서는 ID 매핑 그룹을 관리하는 방법을 보여줍니다.

시작하기 전에

이 페이지의 정보를 계속 진행하기 전에 다음 작업을 수행하세요.

ID 매핑 그룹 만들기

REST

ID 매핑 그룹을 만들려면 새 그룹의 인스턴스로 groups.create()를 호출합니다. 그룹 인스턴스에는 system/groups/external로 설정된 groupKey, Parent, label이 포함되어야 합니다. groupKey는 그룹을 고유하게 식별하는 namespacegroupId의 조합입니다.

Python

다음 예시에서는 Python 클라이언트 라이브러리를 사용하여 ID 그룹을 만드는 도우미 함수를 보여줍니다. Google 관리 콘솔에서 ID 소스를 만들 때 가져온 ID 소스 ID를 사용하여 도우미 함수를 호출하고 그룹을 만듭니다.

def create_identity_group(service, identity_source_id, group_id, group_display_name,
  group_description):
  namespace = "identitysources/" + identity_source_id
  group_key = {"id": group_id, "namespace": namespace}
  group = {
    "parent": namespace,
    "description": group_description,
    "displayName": group_display_name,
    "groupKey": group_key,
    "labels": {
      # Set the label to specify creation of an identity group.
      "system/groups/external": ""
    }
  }

  try:
    response = service.groups().create(body=group).execute()
    print response
  except Exception, e:
    print e

  myNewGroup = create_identity_group(
    idSvc,
    "ABC1234",
    "zebra",
    "Zebra external group",
    "The Zebra group is an identity group representing the Zooland
      external identity"
  )

네임스페이스를 제공하면 이름 충돌이 발생하지 않으며 동일한 외부 ID 소스에서 다른 그룹의 적절한 컨텍스트에 ID 매핑 그룹을 배치할 수 있습니다.

ID 매핑 그룹 검색

REST

ID 매핑 그룹을 검색하려면 쿼리 문자열로 groups.search()를 호출합니다. 모든 그룹을 검색하려면 system/groups/external 라벨만 제공하면 됩니다.

Python

다음 예시에서는 Python 클라이언트 라이브러리를 사용하여 ID 매핑 그룹을 검색하는 데 사용되는 도우미 함수를 보여줍니다.

def search_identity_groups(service, identity_source_id, pageSize, view):
  # Set the label to search for all identity groups
  searchQuery = "&query=namespace=identitysources/" + identity_source_id \
    + "%20AND%20" + "labels:system/groups/external" \
    + "&pageSize=" + pageSize + "&view=" + view
  try:
    searchGroupsRequest = service.groups().search()
    searchGroupsRequest.uri += searchQuery
    response = searchGroupsRequest.execute()
    print response
  except Exception, e:
    print e

다음 단계

그룹이 존재하면 그룹의 멤버십을 만들 수 있습니다. ID 매핑 그룹의 멤버십을 만들려면 ID 매핑 그룹 멤버십 관리를 참조하세요.