Directory API: 조직 단위

조직 단위 관리

Google Workspace 계정의 조직 트리는 논리적 및 계층 구조로 사용자를 관리할 수 있는 조직 단위로 구성됩니다. 이는 관리 콘솔의 '조직 및 사용자' 탭 고객의 조직 단위 계층 구조는 계층 구조의 35단계로 제한됩니다. 자세한 내용은 관리자 고객센터를 참고하세요.

  • Google Workspace 계정에는 조직 트리가 하나만 있습니다. 이 계정이 처음 구성될 때 계정 수준의 조직 단위가 있습니다. 기본 도메인과 연결된 조직입니다. 기본 도메인에 대한 자세한 내용은 API 한도 정보를 참조하세요.
  • 조직 단위의 경로 이름은 고유합니다. 조직 단위의 이름은 조직 계층 구조 내에서 고유하지 않아도 되지만 동위 조직 단위 간에는 고유한 이름입니다. 조직 단위의 이름은 대소문자를 구분하지 않습니다.
  • 조직 단위는 조직 계층 구조에서 정책을 상속합니다. 모든 조직 단위는 상속된 정책을 재정의하여 이 상위 상속 체인을 차단할 수 있습니다. 이 정책의 우선순위는 가장 가까운 조직 단위에 의해 결정됩니다. 즉, 하위 조직 단위의 정책이 상위 단위 blockInheritance 설정을 사용하면 차단 설정 상속을 조직 단위 및 하위 조직이 포함됩니다 blockInheritance는 지원 중단되었습니다. `true` 로 설정하는 것은 더 이상 지원되지 않으며 의도하지 않은 결과를 초래할 수 있습니다. 대상 상속 및 조직 구조의 사용자에 대한 자세한 내용은 관리 고객센터를 방문하세요.
  • 조직 단위는 계층 트리의 위 또는 아래로 이동할 수 있습니다. 또한 새 조직을 채우거나 사용자의 하위 집합을 한 조직 단위에서 다른 조직 단위로 이동할 때 조직의 연결된 사용자를 개별적으로 또는 일괄적으로 이동할 수 있습니다.
  • 조직 단위 속성에 보관된 데이터는 계속 변경될 수 있습니다. 요청 시 항목에 대해 반환된 속성은 항목이 검색된 시점에 일관성이 보장됩니다. 즉, '부분' 항목은 표시되지 않습니다. 업데이트. 검색 작업이 두 개 이상의 항목을 반환하는 경우 항목 간에 일관성이 보장되지 않습니다.응답이 페이지로 나누기의 여러 페이지에 걸쳐 있는 경우 특히 그렇습니다.

조직 단위 만들기

조직 단위를 만들려면 다음 POST 요청을 사용하고 요청 승인에 설명된 승인을 포함합니다.

조직 단위를 만드는 관리자인 경우 my_customer을 사용하세요.

POST https://admin.googleapis.com/admin/directory/v1/customer/my_customer/orgunits

리셀러 고객의 조직 단위를 만드는 리셀러인 경우 customerId을 사용합니다. customerId를 검색하려면 사용자 검색 작업을 사용합니다.

POST https://admin.googleapis.com/admin/directory/v1/customer/customerId/orgunits

계정의 조직 구조를 알아보려면 관리자 고객센터를 참조하세요. 요청 및 응답 속성은 API 참조를 확인하세요.

JSON 요청

다음 JSON 리셀러 예는 sales_support 조직 단위를 만드는 샘플 요청 본문을 보여줍니다. nameparentOrgUnitPath는 필수입니다.

POST https://admin.googleapis.com/admin/directory/v1/customer/C03az79cb/orgunits
{
    "name": "sales_support",
    "description": "The sales support team",
    "parentOrgUnitPath": "/corp/support",
    "blockInheritance": false
}

JSON 응답

성공 응답은 HTTP 201 상태 코드를 반환합니다. 응답은 상태 코드와 함께 새 그룹의 속성을 반환합니다.

{
    "kind": "directory#orgUnit",
    "name": "sales_support",
    "description": "The sales support team",
    "orgUnitPath": "/corp/support/sales_support",
    "parentOrgUnitPath": "/corp/support",
    "blockInheritance": false
  }

조직 단위 업데이트

조직 단위를 업데이트하려면 다음 PUT 요청을 사용하고 요청 승인에 설명된 승인을 포함합니다. 요청 및 응답 속성은 API 참조를 확인하세요.

조직 단위를 업데이트하는 관리자인 경우 my_customer을 사용하세요.

 PUT https://admin.googleapis.com/admin/directory/v1/customer/my_customer/orgunits/orgUnitPath

리셀러 고객의 조직 단위를 업데이트하는 리셀러인 경우 customerId을 사용합니다. customerId를 가져오려면 사용자 검색 작업을 사용합니다.

PUT https://admin.googleapis.com/admin/directory/v1/customer/customerId/orgunits/orgUnitPath
드림

JSON 요청

아래 예에서 조직 단위 설명이 업데이트되었습니다.

PUT https://admin.googleapis.com/admin/directory/v1/customer/my_customer/orgunits/corp/support/sales_support
{
    "description": "The BEST sales support team"
}

업데이트 요청 참고사항:

  • 요청에 업데이트된 정보만 제출하시면 됩니다. 요청에 그룹의 모든 속성을 입력할 필요는 없습니다.
  • 사용자 계정을 만들 때 사용자를 특정 조직 단위에 할당하지 않은 경우 계정은 최상위 조직 단위에 속하게 됩니다.
  • 요청에서 parentOrgUnitPath 속성을 설정하여 조직 단위를 계정 조직 구조의 다른 부분으로 이동할 수 있습니다. 조직 단위를 이동하면 이동하는 조직 단위의 사용자에 대한 서비스 및 설정이 변경될 수 있습니다.

JSON 응답

성공 응답은 HTTP 201 상태 코드를 반환합니다. 응답에는 상태 코드와 함께 업데이트된 조직 단위의 속성이 반환됩니다.

{
    "kind": "directory#orgUnit",
    "name": "sales_support",
    "description": "The BEST sales support team",
    "orgUnitPath": "/corp/support/sales_support",
    "parentOrgUnitPath": "/corp/support",
    "blockInheritance": false
}

사용자 계정을 만들 때 사용자를 특정 조직 단위에 할당하지 않은 경우 계정은 최상위 조직 단위에 속하게 됩니다. 사용자의 조직 단위에 따라 사용자가 액세스할 수 있는 Google Workspace 서비스가 결정됩니다. 사용자가 새 조직으로 이동되면 사용자의 액세스 권한이 변경됩니다. 조직 구조에 대한 자세한 내용은 관리 고객센터를 참고하세요. 사용자를 다른 조직으로 이동하는 방법에 대한 자세한 내용은 사용자 업데이트를 참고하세요.

조직 단위 가져오기

조직 단위를 검색하려면 다음 GET 요청을 사용하고 요청 승인에 설명된 승인을 포함합니다. orgUnitPath 쿼리 문자열은 이 조직 단위의 전체 경로입니다. 요청 및 응답 속성은 API 참조를 확인하세요.

조직 단위를 가져오는 관리자인 경우 my_customer을 사용하세요.

GET https://admin.googleapis.com/admin/directory/v1/customer/my_customer/orgunits/orgUnitPath

리셀러 고객의 조직 단위를 검색하는 리셀러인 경우 customerId를 사용하세요. customerId를 가져오려면 사용자 검색 작업을 사용하세요.

GET https://admin.googleapis.com/admin/directory/v1/customer/customerId/orgunits/orgUnitPath

JSON 응답

아래 예에서 'Frontline sales'은 조직 단위를 가져옵니다. '최일선+판매'에 주목하십시오. HTTP 인코딩을 호출합니다.

GET https://admin.googleapis.com/admin/directory/v1/customer/my_customer/orgunits/corp/sales/frontline+sales

성공 응답은 HTTP 200 상태 코드를 반환합니다. 응답은 상태 코드와 함께 조직 단위의 설정을 반환합니다.

{
    "kind": "directory#orgUnit",
    "name": "frontline sales",
    "description": "The frontline sales team",
    "orgUnitPath": "/corp/sales/frontline sales",
    "parentOrgUnitPath": "/corp/sales",
    "blockInheritance": false
}

조직 단위 가져오기

조직 단위의 모든 하위 조직 단위, 조직 단위의 직계 하위 조직 또는 모든 하위 조직 단위 및 지정된 조직 단위를 검색하려면 다음 GET 요청을 사용하고 요청 승인에 설명된 승인을 포함합니다. 요청 및 응답 속성은 API 참조를 확인하세요.

모든 하위 조직 단위를 검색하는 계정 관리자인 경우 my_customer을 사용하세요. 이 예시에서는 가독성을 위해 줄 반환을 사용합니다.

GET https://admin.googleapis.com/admin/directory/v1/customer/my_customer
/orgunits?orgUnitPath=full org unit path&type=all or children or all_including_parent

리셀러 고객의 조직 단위를 검색하는 리셀러인 경우 customerId를 사용하세요. customerId를 가져오려면 사용자 검색 작업을 사용합니다.

GET https://admin.googleapis.com/admin/directory/v1/customer/customerId
/orgunits?orgUnitPath=full org unit path&type=all or children or all_including_parent

get 쿼리 문자열은 orgUnitPath 아래의 하위 조직 단위 all, orgUnitPath의 직계 children 또는 all_including_parent의 모든 하위 조직 단위와 지정된 orgUnitPath를 반환합니다. 기본값은 type=children입니다.

JSON 응답

예를 들어 이 요청은 /corp 조직 단위에서 시작하는 모든 조직 단위를 반환합니다.

GET https://admin.googleapis.com/admin/directory/v1/customer/my_customer/orgunits?orgUnitPath=/corp&type=all

성공 응답은 HTTP 200 상태 코드를 반환합니다. 응답은 상태 코드와 함께 계정의 조직 단위를 반환합니다.

{
"kind": "directory#orgUnits",
    "organizationUnits": [
     {
    "kind": "directory#orgUnit",
    "name": "sales",
    "description": "The corporate sales team",
    "orgUnitPath": "/corp/sales",
    "parentOrgUnitPath": "/corp",
    "blockInheritance": false
     },
     {
    "kind": "directory#orgUnit",
    "name": "frontline sales",
    "description": "The frontline sales team",
    "orgUnitPath": "/corp/sales/frontline sales",
    "parentOrgUnitPath": "/corp/sales",
    "blockInheritance": false
     },
     {
    "kind": "directory#orgUnit",
    "name": "support",
    "description": "The corporate support team",
    "orgUnitPath": "/corp/support",
    "parentOrgUnitPath": "/corp",
    "blockInheritance": false
     },
     {
    "kind": "directory#orgUnit",
    "name": "sales_support",
    "description": "The BEST support team",
    "orgUnitPath": "/corp/support/sales_support",
    "parentOrgUnitPath": "/corp/support",
    "blockInheritance": false
     }
  ]
  }

조직 단위 삭제하기

조직 단위를 삭제하려면 다음 DELETE 요청을 사용하고 요청 승인에 설명된 승인을 포함합니다. customerId를 검색하려면 사용자 검색 작업을 사용합니다. 요청 및 응답 속성은 API 참조를 확인하세요.

조직 단위를 삭제하는 계정 관리자라면 my_customer을 사용하세요.

DELETE https://admin.googleapis.com/admin/directory/v1/customer/my_customer/orgunits/orgUnitPath

리셀러 고객의 조직 단위를 삭제하는 리셀러인 경우 customerId를 사용하세요. customerId를 가져오려면 사용자 검색 작업을 사용하세요.

DELETE https://admin.googleapis.com/admin/directory/v1/customer/customerId/orgunits/orgUnitPath
드림 예를 들어 이 리셀러 관리자의 DELETE 요청은 'backend_tests'를 삭제합니다. 조직 단위:
DELETE https://admin.googleapis.com/admin/directory/v1/customer/C03az79cb/orgunits/corp/sales/backend_tests

성공 응답은 HTTP 200 상태 코드를 반환합니다.

하위 조직 단위 또는 할당된 사용자가 없는 조직 단위만 삭제할 수 있습니다. 삭제하기 전에 사용자를 다른 조직 단위에 재할당하고 모든 하위 조직 단위를 삭제해야 합니다.