Chrome 관리 Chrome 브라우저 API 코드 샘플

API 기능 개요는 Chrome Management Chrome Browsers API를 참고하세요.

이 페이지에 표시된 모든 요청은 다음 변수를 사용합니다.

  • $TOKEN - OAuth 2.0 토큰
  • $CUSTOMER - 고객 ID 또는 리터럴 my_customer

등록된 Chrome 브라우저 나열

등록된 Chrome 브라우저를 나열하려면 /chromeBrowsers 엔드포인트를 사용합니다. pageSize (최대값 및 기본값 100) 및 pageToken 파라미터를 사용하여 페이지로 나누기를 제어할 수 있습니다. orderBy을 사용하여 결과의 순서를 지정합니다. filter를 지정하여 결과를 좁힙니다. 읽기 마스크는 fields 쿼리 매개변수로 지정할 수 있습니다.

와일드 카드 (*) 일치 (접두사 prefix*, 접미사 *suffix, 하위 문자열 *substring* 또는 존재 *)는 machine_name, annotated_asset_id, browser_version 필드에서만 = 및 :와 함께 지원됩니다.

전역 텍스트 검색 (필드 이름을 지정하지 않음)은 색인이 생성된 모든 텍스트 필드에서 검색합니다. 여러 검색어가 AND 또는 공백 (예: filter=machine AND 73 또는 filter=machine 73)으로 구분된 경우 모든 검색어가 브라우저 기기의 색인이 생성된 텍스트 필드 중 하나 이상과 일치해야 합니다 (서로 다른 필드 간에도 가능). 여러 단어를 단일 따옴표 문자열 (예: filter="machine name")로 묶으면 단일 필드 내에서 정확한 연속 구문을 검색합니다.

필터 쿼리 예시

# Filter by machine name prefix (using ':' or '=')
filter=machine_name:LIX*

# Filter by annotated asset ID suffix
filter=annotated_asset_id="*1001"

# Filter by browser version substring
filter=browser_version:"*6367*"

# Global search across all indexed text fields (matches browsers containing both "machine" and "73" across any fields)
filter=machine AND 73

# Global search with implicit AND (equivalent to `machine AND 73`)
filter=machine 73

# Filter by machine name prefix and registration time range
filter=machine_name:LIX* AND last_registration_time>=2024-01-01T00:00:00Z

# Filter by Organizational Unit path
filter=org_unit_path=/Marketing

요청

  curl -X GET \
  -H "Authorization: Bearer $TOKEN" \
  "https://chromemanagement.googleapis.com/v1/customers/$CUSTOMER/chromeBrowsers?pageSize=2&orderBy=lastActivityTime+desc&filter=os_platform=WINDOWS"

응답

{
  "chromeBrowsers": [
    {
      "name": "customers/<customerId>/chromeBrowsers/<browserPermanentId1>",
      "browserPermanentId": "<browserPermanentId1>",
      "machineName": "CLIENT2024-01",
      "osPlatformType": "WINDOWS",
      "osVersion": "10.0.19045",
      "browserVersion": "124.0.6367.60",
      "annotatedUser": "user1@example.com",
      "annotatedLocation": "US-NYC",
      "annotatedAssetId": "ASSET-1001",
      "annotatedNotes": "Engineering workstation",
      "lastActivityTime": "2024-04-23T22:05:44.214362Z",
      "lastPolicySyncTime": "2024-04-23T22:00:00.000Z",
      "lastStatusReportTime": "2024-04-23T22:05:44.214362Z",
      "enrollmentDate": "2024-01-15T10:30:00.000Z",
      "orgUnitPath": "/Engineering",
      "policyCount": 15,
      "extensionCount": 8
    },
    {
      "name": "customers/<customerId>/chromeBrowsers/<browserPermanentId2>",
      "browserPermanentId": "<browserPermanentId2>",
      "machineName": "CLIENT2024-02",
      "osPlatformType": "WINDOWS",
      "osVersion": "11.0.22631",
      "browserVersion": "124.0.6367.60",
      "annotatedUser": "user2@example.com",
      "annotatedLocation": "US-MTV",
      "lastActivityTime": "2024-04-23T21:45:10.102000Z",
      "lastPolicySyncTime": "2024-04-23T21:40:00.000Z",
      "lastStatusReportTime": "2024-04-23T21:45:10.102000Z",
      "enrollmentDate": "2024-02-10T14:15:00.000Z",
      "orgUnitPath": "/Engineering",
      "policyCount": 12,
      "extensionCount": 5
    }
  ],
  "nextPageToken": "<nextPageToken>"
}

관리 Chrome 브라우저 가져오기

등록된 단일 Chrome 브라우저를 가져오려면 /chromeBrowsers/{browser_permanent_id} 엔드포인트를 사용합니다. 읽기 마스크는 fields 매개변수로 지정할 수 있습니다.

요청

  curl -X GET \
  -H "Authorization: Bearer $TOKEN" \
  "https://chromemanagement.googleapis.com/v1/customers/$CUSTOMER/chromeBrowsers/<browserPermanentId1>"

응답

{
  "name": "customers/<customerId>/chromeBrowsers/<browserPermanentId1>",
  "browserPermanentId": "<browserPermanentId1>",
  "machineName": "CLIENT2024-01",
  "osPlatformType": "WINDOWS",
  "osVersion": "10.0.19045",
  "browserVersion": "124.0.6367.60",
  "annotatedUser": "user1@example.com",
  "annotatedLocation": "US-NYC",
  "annotatedAssetId": "ASSET-1001",
  "annotatedNotes": "Engineering workstation",
  "lastActivityTime": "2024-04-23T22:05:44.214362Z",
  "lastPolicySyncTime": "2024-04-23T22:00:00.000Z",
  "lastStatusReportTime": "2024-04-23T22:05:44.214362Z",
  "enrollmentDate": "2024-01-15T10:30:00.000Z",
  "orgUnitPath": "/Engineering",
  "policyCount": 15,
  "extensionCount": 8
}

Chrome 브라우저의 주석 정보 업데이트

등록된 Chrome 브라우저의 주석이 달린 필드를 업데이트하려면 HTTP PATCH 메서드와 함께 /chromeBrowsers/{browser_permanent_id} 엔드포인트를 사용하고 업데이트할 필드를 지정하는 updateMask 쿼리 매개변수를 제공합니다.

요청

  curl -X PATCH \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  "https://chromemanagement.googleapis.com/v1/customers/$CUSTOMER/chromeBrowsers/<browserPermanentId1>?updateMask=annotatedUser,annotatedNotes" \
  -d '{
    "annotatedUser": "newuser@example.com",
    "annotatedNotes": "Updated primary workstation"
  }'

응답

{
  "name": "customers/<customerId>/chromeBrowsers/<browserPermanentId1>",
  "browserPermanentId": "<browserPermanentId1>",
  "machineName": "CLIENT2024-01",
  "osPlatformType": "WINDOWS",
  "osVersion": "10.0.19045",
  "browserVersion": "124.0.6367.60",
  "annotatedUser": "newuser@example.com",
  "annotatedLocation": "US-NYC",
  "annotatedAssetId": "ASSET-1001",
  "annotatedNotes": "Updated primary workstation",
  "lastActivityTime": "2024-04-23T22:05:44.214362Z",
  "orgUnitPath": "/Engineering"
}

Chrome 브라우저를 새 조직 단위로 이동하기

관리 Chrome 브라우저를 한 조직 단위에서 다른 조직 단위로 이동하려면 /chromeBrowsers:move 엔드포인트를 사용하세요. 요청당 최대 600개의 브라우저를 이동할 수 있습니다. 브라우저를 이동하는 중에 오류가 발생하면 지정된 브라우저가 이동되지 않습니다.

요청

  curl -X POST \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  "https://chromemanagement.googleapis.com/v1/customers/$CUSTOMER/chromeBrowsers:move" \
  -d '{
    "destinationOrgUnitId": "03ph8a2z3v",
    "resourceIds": [
      "customers/$CUSTOMER/chromeBrowsers/<browserPermanentId1>",
      "customers/$CUSTOMER/chromeBrowsers/<browserPermanentId2>"
    ]
  }'

응답

{}

Chrome 브라우저에서 수집된 데이터 삭제

관리 Chrome 브라우저에서 수집된 데이터를 삭제하려면 HTTP DELETE와 함께 /chromeBrowsers/{browser_permanent_id} 엔드포인트를 사용합니다.

요청

  curl -X DELETE \
  -H "Authorization: Bearer $TOKEN" \
  "https://chromemanagement.googleapis.com/v1/customers/$CUSTOMER/chromeBrowsers/<browserPermanentId1>"

응답

{}