코드 샘플

아래 요청은 Policy API를 사용한 정책 관리를 보여줍니다. 시작하기 전에 Chrome Policy API 개요에서 이 API의 기능에 대한 간략한 요약을 확인하세요.

아래에 표시된 모든 요청은 다음 변수를 사용합니다.

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

프린터 정책의 스키마 나열

프린터 정책과 관련된 스키마의 목록을 표시하기 위해 filter 매개변수를 스키마 서비스 목록 요청에 적용합니다. pageSizepageToken 매개변수를 사용하여 결과의 페이지로 나누기를 제어할 수 있습니다.

요청

  curl -X GET \
  -H "Authorization: Bearer $TOKEN" \
  "https://chromepolicy.googleapis.com/v1/customers/$CUSTOMER/policySchemas?filter=chrome.printers&pageSize=2"

응답

{
  "policySchemas": [
    {
      "name": "customers/C0202nabg/policySchemas/chrome.printers.AllowForUsers",
      "policyDescription": "Allows a printer for users in a given organization.",
      "additionalTargetKeyNames": [
        {
          "key": "printer_id",
          "keyDescription": "Id of printer as visible in Admin SDK printers API."
        }
      ],
      "definition": {
        "messageType": [
          {
            "name": "AllowForUsers",
            "field": [
              {
                "name": "allowForUsers",
                "number": 1,
                "label": "LABEL_OPTIONAL",
                "type": "TYPE_BOOL"
              }
            ]
          }
        ]
      },
      "fieldDescriptions": [
        {
          "field": "allowForUsers",
          "description": "Controls whether a printer is allowed for users in a given organization."
        }
      ],
      "schemaName": "chrome.printers.AllowForUsers"
    },
    {
      "name": "customers/C0202nabg/policySchemas/chrome.printers.AllowForDevices",
      "policyDescription": "Allows a printer for devices in a given organization.",
      "additionalTargetKeyNames": [
        {
          "key": "printer_id",
          "keyDescription": "Id of printer as visible in Admin SDK printers API."
        }
      ],
      "definition": {
        "messageType": [
          {
            "name": "AllowForDevices",
            "field": [
              {
                "name": "allowForDevices",
                "number": 1,
                "label": "LABEL_OPTIONAL",
                "type": "TYPE_BOOL"
              }
            ]
          }
        ]
      },
      "fieldDescriptions": [
        {
          "field": "allowForDevices",
          "description": "Controls whether a printer is allowed for devices in a given organization."
        }
      ],
      "schemaName": "chrome.printers.AllowForDevices"
    }
  ],
  "nextPageToken": "AEbDN_obE8A98T8YhIeU9VCIZhEBylLBwZRQpGu_DUug-mU4bnzcDx30UnO2xMuuImvfVpmeuXRF6VhJ4OmZpZ4H6EaRvu2qMOPxVN_u"
}

스키마 검색

스키마 서비스 목록 요청에 filter= 매개변수를 사용하여 복잡한 검색어를 만들 수도 있습니다. 예를 들어 이름에 'printer'라는 단어와 설명에 'devices'라는 단어가 포함된 스키마를 검색하려면 name=printers AND description=devices 필터에 다음 값을 적용하면 됩니다.

정책 스키마를 나열하는 방법 알아보기

요청

  curl -X GET \
  -H "Authorization: Bearer $TOKEN" \
  "https://chromepolicy.googleapis.com/v1/customers/$CUSTOMER/policySchemas?filter=name=printers%20AND%20description=devices"

응답

{
  "policySchemas": [
    {
      "name": "customers/C0202nabg/policySchemas/chrome.printers.AllowForDevices",
      "policyDescription": "Allows a printer for devices in a given organization.",
      "additionalTargetKeyNames": [
        {
          "key": "printer_id",
          "keyDescription": "Id of printer as visible in Admin SDK printers API."
        }
      ],
      "definition": {
        "messageType": [
          {
            "name": "AllowForDevices",
            "field": [
              {
                "name": "allowForDevices",
                "number": 1,
                "label": "LABEL_OPTIONAL",
                "type": "TYPE_BOOL"
              }
            ]
          }
        ]
      },
      "fieldDescriptions": [
        {
          "field": "allowForDevices",
          "description": "Controls whether a printer is allowed for devices in a given organization."
        }
      ],
      "schemaName": "chrome.printers.AllowForDevices"
    }
  ]
}

특정 스키마 가져오기

위 결과에는 지원되는 정책 스키마 목록이 표시됩니다. 각 스키마에는 스키마를 식별하는 name 필드가 있습니다. 나중에 스키마 이름을 알면 요청 URL의 스키마 이름을 참조하여 특정 스키마를 직접 읽을 수 있습니다.

chrome.printers.AllowForUsers 스키마의 예를 살펴보겠습니다.

요청

  curl -X GET \
  -H "Authorization: Bearer $TOKEN" \
  "https://chromepolicy.googleapis.com/v1/customers/$CUSTOMER/policySchemas/chrome.printers.AllowForUsers"

응답

{
  "name": "customers/C0202nabg/policySchemas/chrome.printers.AllowForUsers",
  "policyDescription": "Allows a printer for users in a given organization.",
  "additionalTargetKeyNames": [
    {
      "key": "printer_id",
      "keyDescription": "Id of printer as visible in Admin SDK printers API."
    }
  ],
  "definition": {
    "messageType": [
      {
        "name": "AllowForUsers",
        "field": [
          {
            "name": "allowForUsers",
            "number": 1,
            "label": "LABEL_OPTIONAL",
            "type": "TYPE_BOOL"
          }
        ]
      }
    ]
  },
  "fieldDescriptions": [
    {
      "field": "allowForUsers",
      "description": "Controls whether a printer is allowed for users in a given organization."
    }
  ],
  "schemaName": "chrome.printers.AllowForUsers"
}

위 정책 스키마 응답은 chrome.printers.AllowForUsers 정책의 스키마를 설명합니다. 알림 필드는 additionalTargetKeyNames입니다. 이 필드는 이 정책을 처리할 때 추가 키/값을 제공해야 함을 설명합니다. 특히 이 정책의 경우 항상 프린터의 식별자를 제공해야 합니다.

정책 값 읽기

특정 프린터에 적용되는 chrome.printers.AllowForUsers 정책을 읽어보겠습니다. additionalTargetKeys 필드를 사용하여 요청에서 프린터 ID를 지정합니다.

조직 단위 또는 그룹에서 정책을 읽을 수 있습니다.

응답에서 정책 값을 가져오는 조직 단위 또는 그룹을 지정하는 sourceKey 필드를 확인합니다. 조직 단위에는 다음과 같은 가능성이 있습니다.

  • 소스 조직 단위가 요청에 지정된 조직 단위와 동일한 경우 정책이 이 조직 단위에 로컬로 적용된다는 의미입니다.
  • 소스 조직 단위가 요청에 지정된 조직 단위와 다르면 정책이 소스 조직 단위에서 상속된다는 의미입니다.
  • sourceKey가 없거나 응답이 비어 있으면 고객에 대해 정책이 설정되지 않았으며 기본 시스템 값이 있음을 의미합니다.

그룹의 경우 sourceKey는 항상 요청에 지정된 그룹과 동일합니다.

다음은 조직 단위를 위한 예시입니다. 그룹 요청은 id 앞에 'orgunits/' 대신 'groups/'가 있는 targetResource를 제외하고 동일합니다.

요청

  curl -X POST \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $TOKEN" \
  -d '{
        policyTargetKey: {
          targetResource: "orgunits/04fatzly4jbjho9",
          additionalTargetKeys: {"printer_id":"0gjdgxs208tpef"}
        },
        policySchemaFilter: "chrome.printers.AllowForDevices"
    }' \
  "https://chromepolicy.googleapis.com/v1/customers/$CUSTOMER/policies:resolve"

응답

{
  "resolvedPolicies": [
    {
      "targetKey": {
        "targetResource": "orgunits/03ph8a2z1xdnme9"
        "additionalTargetKeys": {"printer_id":"0gjdgxs208tpef"}
      },
      "value": {
        "policySchema": "chrome.users.AllowForDevices",
        "value": {
          "allowForDevices": true
        }
      },
      "sourceKey": {
        "targetResource": "orgunits/03ph8a2z3qhz81k"
      }
    }
  ]
}

요청에서 additionalTargetKeys를 생략하여 대상 리소스의 모든 항목을 가져올 수 있습니다. 예를 들어 위 요청에서 additionalTargetKeys를 생략하면 지정된 대상 리소스의 모든 프린터가 반환됩니다.

여러 정책 읽기

별표를 사용하여 스키마 네임스페이스를 제공하면 (예: chrome.printers.*)를 사용하면 특정 조직 단위 또는 그룹에서 이 네임스페이스에 있는 모든 정책의 값을 읽을 수 있습니다. 정책 스키마에 대해 자세히 알아보세요.

다음은 조직 단위를 위한 예시입니다. 그룹 요청은 id 앞에 'orgunits/' 대신 'groups/'가 있는 targetResource를 제외하고 동일합니다.

요청

  curl -X POST \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $TOKEN" \
  -d '{
        policyTargetKey: {
          targetResource: "orgunits/04fatzly4jbjho9",
        },
        policySchemaFilter: "chrome.printers.*"
    }' \
  "https://chromepolicy.googleapis.com/v1/customers/$CUSTOMER/policies:resolve"

응답

{
  "resolvedPolicies": [
    {
      "targetKey": {
        "targetResource": "orgunits/04fatzly4jbjho9",
        "additionalTargetKeys": {
          "printer_id": "0gjdgxs0xd59y1"
        }
      },
      "value": {
        "policySchema": "chrome.printers.AllowForUsers",
        "value": {
          "allowForUsers": false
        }
      }
    },
    {
      "targetKey": {
        "targetResource": "orgunits/04fatzly4jbjho9",
        "additionalTargetKeys": {
          "printer_id": "0gjdgxs0xd59y1"
        }
      },
      "value": {
        "policySchema": "chrome.printers.AllowForDevices",
        "value": {
          "allowForDevices": false
        }
      }
    },
    //...
  ],
  "nextPageToken": "AEbDN_pFvDeGSbQDkvMxr4UA0Ew7UEUw8aJyw95VPs2en6YxMmFcWQ9OQQEIeSkjnWFCQNyz5GGoOKQGEd50e2z6WqvM2w7sQz6TMxVOBD_4NmEHRWtIJCYymeYXWHIrNH29Ezl1wkeyYBAOKnE="
}

정책 값 수정

정책 스키마 응답에 표시된 것처럼 chrome.printers.AllowForUsers 정책에는 allowForUsers이라는 필드가 하나 있습니다. 이 필드는 불리언 유형입니다. 정책 값의 예시로는 {allowForUsers: false} 또는 {allowForUsers: true}가 있습니다. 이 경우에는 필드가 하나뿐이지만 다른 정책에는 여러 필드가 포함될 수 있습니다.

수정 요청에서 updateMask를 지정해야 합니다. 업데이트 마스크에는 수정하려는 모든 필드가 나열됩니다. 정책이 이미 조직 단위에 로컬로 적용된 경우 업데이트 마스크를 통해 나열되지 않는 필드는 그대로 유지됩니다. 정책이 아직 조직 단위에 로컬로 적용되지 않았고 업데이트 마스크를 통해 나열되지 않은 모든 필드가 적절한 경우 상위 조직 단위의 값을 복사하고 전체 정책이 로컬로 적용됩니다.

다음은 조직 단위에 적용되는 예입니다. 그룹 요청은 id 앞에 'orgunits/' 대신 'groups/'가 있는 targetResource를 제외하면 동일합니다. 여기서는 조직 단위 ID 04fatzly4jbjho9의 사용자에게 프린터 0gjdgxs208tpef을 허용하지 않습니다.

요청

curl -X POST \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $TOKEN" \
  -d '{
        requests: [{
                policyTargetKey: {
                        targetResource: "orgunits/04fatzly4jbjho9",
                        additionalTargetKeys: {"printer_id":"0gjdgxs208tpef"}
                        },
                policyValue: {
                        policySchema: "chrome.printers.AllowForUsers",
                        value: {allowForUsers: false}
                        },
                updateMask: {paths: "allowForUsers"}
                }]
      }' \
  "https://chromepolicy.googleapis.com/v1/customers/$CUSTOMER/policies/orgunits:batchModify"

응답

성공 응답은 비어 있습니다.

{}

목록 또는 배열과 같은 다중 값 필드는 'LABEL_REPEATED' 라벨로 표시됩니다. 여러 값 필드를 채우려면 [value1, value2, value3, ...] JSON 배열 형식을 사용합니다.

예를 들어 앱 및 확장 프로그램 패키지의 소스 URL을 'test1.com', 'test2.com', 'test3.com'으로 설정하려면 다음과 같은 요청을 전송해야 합니다.

요청

curl -X POST \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $TOKEN" \
  -d "{
        requests: [
          {
            policy_target_key: {
              target_resource: 'orgunits/03ph8a2z28rz85a'
            },
            updateMask: {
              paths: ['extensionInstallSources']
            },
            policy_value: {
              policy_schema: 'chrome.users.appsconfig.AppExtensionInstallSources', 
              value: {
                extensionInstallSources: ['test1.com', 'test2.com', 'test3.com']
              }
            }
          }
        ]
      }" \
  "https://chromepolicy.googleapis.com/v1/customers/$CUSTOMER/policies/orgunits:batchModify"

응답

성공 응답은 비어 있습니다.

{}

NullableDuration 필드가 포함된 모든 정책에는 두 가지 버전이 있습니다. 원래 버전은 문자열만 NullableDuration의 입력으로 허용하며 지금은 지원 중단되었습니다. 기간 유형을 숫자 입력으로 대체하는 V2 버전을 사용하세요. 예를 들어 최대 사용자 세션 길이를 10분으로 설정하려면 다음 요청을 전송해야 합니다.

요청

curl -X POST \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $TOKEN" \
  -d "{
        requests: [
          {
            policy_target_key: {
              target_resource: 'orgunits/03ph8a2z28rz85a'
            },
            updateMask: {
              paths: ['sessionDurationLimit']
            },
            policy_value: {
              policy_schema: 'chrome.users.SessionLengthV2',
              value: {
                sessionDurationLimit: {
                  duration: 10
                }
              }
            }
          }
        ]
      }" \
  "https://chromepolicy.googleapis.com/v1/customers/$CUSTOMER/policies/orgunits:batchModify"

응답

성공 응답은 비어 있습니다.

{}

한 번에 여러 정책 수정하기

batchModify 메서드를 사용하면 여러 정책 수정사항을 동시에 전송할 수 있습니다. 하지만 모든 정책을 일괄 처리할 수 있는 것은 아닙니다. 자세한 내용은 일괄 업데이트 정책을 참고하세요.

이 예에서는 동일한 요청에서 동일한 프린터에 관한 두 개의 다른 정책 (chrome.printers.AllowForDeviceschrome.printers.AllowForUsers)을 수정합니다.

다음은 조직 단위를 위한 예시입니다. 그룹 요청은 id 앞에 'orgunits/' 대신 'groups/'가 있는 targetResource를 제외하고 동일합니다.

요청

curl -X POST \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $TOKEN" \
  -d '{
        requests: [{
                policyTargetKey: {
                        targetResource: "orgunits/04fatzly4jbjho9",
                        additionalTargetKeys: {"printer_id":"0gjdgxs208tpef"}
                        },
                policyValue: {
                        policySchema: "chrome.printers.AllowForDevices",
                        value: {allowForDevices: true}
                        },
                updateMask: {paths: "allowForDevices"}
                },
                {
                policyTargetKey: {
                        targetResource: "orgunits/04fatzly4jbjho9",
                        additionalTargetKeys: {"printer_id":"0gjdgxs208tpef"}
                        },
                policyValue: {
                        policySchema: "chrome.printers.AllowForUsers",
                        value: {allowForUsers: true}
                        },
                updateMask: {paths: "allowForUsers"}
                }]
      }' \
  "https://chromepolicy.googleapis.com/v1/customers/C0202nabg/policies/orgunits:batchModify"

응답

성공 응답은 비어 있습니다.

{}

조직 단위의 정책 값 상속

batchInherit 메서드를 사용하면 조직 단위의 정책 상태를 '로컬 단위로 적용됨'에서 '상속됨'으로 수정할 수 있습니다. 로컬 값이 삭제되고 정책이 적용되는 경우 상위 조직 단위의 값을 상속합니다.

batchInherit 메서드를 사용하면 여러 정책 상속 요청을 동시에 보낼 수도 있습니다. 하지만 모든 정책을 일괄 처리할 수 있는 것은 아닙니다. 자세한 내용은 일괄 업데이트 정책을 참고하세요.

요청

curl -X POST \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $TOKEN" \
  -d '{
        requests: [{
                policyTargetKey: {
                        targetResource: "orgunits/04fatzly12wd3ox",
                        additionalTargetKeys: {"printer_id":"0gjdgxs208tpef"}
                        },
                policySchema: "chrome.printers.AllowForUsers"
                }]
      }' \
  "https://chromepolicy.googleapis.com/v1/customers/$CUSTOMER/policies/orgunits:batchInherit"

응답

성공 응답은 비어 있습니다.

{}

그룹에서 정책 값 삭제

batchDelete 메서드를 사용하면 그룹에서 정책을 삭제할 수 있습니다. 로컬 값이 삭제됩니다.

batchDelete 메서드를 사용하면 여러 정책 삭제 요청을 동시에 보낼 수도 있습니다. 하지만 모든 정책을 일괄 처리할 수 있는 것은 아닙니다. 자세한 내용은 일괄 업데이트 정책을 참고하세요.

요청

curl -X POST \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $TOKEN" \
  -d '{
        requests: [{
                policyTargetKey: {
                        targetResource: "groups/04fatzly12wd3ox",
                        additionalTargetKeys: {"printer_id":"0gjdgxs208tpef"}
                        },
                policySchema: "chrome.printers.AllowForUsers"
                }]
      }' \
  "https://chromepolicy.googleapis.com/v1/customers/$CUSTOMER/policies/groups:batchDelete"

응답

성공 응답은 비어 있습니다.

{}

그룹의 우선순위 순서 나열

listGroupPriorityOrdering 메서드를 사용하면 앱에 그룹스의 우선순위 순서를 나열할 수 있습니다.

반환되는 그룹 ID의 순서는 앱에 설정이 적용되는 우선순위를 나타냅니다. 이후의 ID 정책은 목록 맨 위에 있는 ID의 정책에 의해 재정의됩니다.

그룹 우선순위는 조직 단위의 우선순위보다 높습니다.

이 요청에서는 'exampleapp' Chrome 사용자 앱의 우선순위 순서를 반환합니다.

요청

curl -X POST \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $TOKEN" \
  -d '{
        policyTargetKey: {
                additionalTargetKeys: {"app_id":"chrome:exampleapp"}
                },
        policyNamespace: 'chrome.users.apps'
      }' \
  "https://chromepolicy.googleapis.com/v1/customers/$CUSTOMER/policies/groups:listGroupPriorityOrdering"

응답

{
  "policyTargetKey": {
    "additionalTargetKeys": {
      "app_id": "chrome:exampleapp"
    }
  },
  "policyNamespace": "chrome.users.apps",
  "groupIds": [
    "03ep43zb2k1nodu",
    "01t3h5sf2k52kol",
    "03q5sasy2ihwnlz"
  ]
}

그룹의 우선순위 순서 업데이트

updateGroupPriorityOrdering 메서드를 사용하면 앱의 그룹스 우선순위 순서를 업데이트할 수 있습니다.

요청에서 그룹 ID의 순서는 앱에 설정이 적용되는 우선순위를 나타냅니다. 이후의 ID 정책은 목록의 앞부분에 있는 정책에 의해 재정의됩니다. 요청에는 현재 앱에 적용된 모든 그룹 ID가 포함되어야 합니다.

그룹 우선순위는 조직 단위의 우선순위보다 높습니다.

이 요청에서는 'exampleapp' Chrome 사용자 앱의 우선순위 순서를 설정합니다.

요청

curl -X POST \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $TOKEN" \
  -d '{
        policyTargetKey: {
                additionalTargetKeys: {"app_id":"chrome:exampleapp"}
                },
        policyNamespace: 'chrome.users.apps',
        groupIds: ['03ep43zb2k1nodu', '01t3h5sf2k52kol', '03q5sasy2ihwnlz']
      }' \
  "https://chromepolicy.googleapis.com/v1/customers/$CUSTOMER/policies/groups:updateGroupPriorityOrdering"

응답

성공 응답은 비어 있습니다.

{}

확인이 필요한 정책 처리

일부 정책 스키마는 확인이 필요한 특정 필드의 특정 값에 '알림'을 지정합니다.

chrome.users.PluginVmAllowd 정책의 예:

{
  "name": "customers/C0202nabg/policySchemas/chrome.users.PluginVmAllowed",
  "policyDescription": "Parallels Desktop.",
  # ...
  "fieldDescriptions": [
    {
      "field": "pluginVmAllowed",
      "description": "N/A",
      "knownValueDescriptions": [
        {
          "value": "true",
          "description": "Allow users to use Parallels Desktop."
        },
        {
          "value": "false",
          "description": "Do not allow users to use Parallels Desktop."
        }
      ]
    },
    {
      "field": "ackNoticeForPluginVmAllowedSetToTrue",
      "description": "This field must be set to true to acknowledge the notice message associated with the field 'plugin_vm_allowed' set to value 'true'. Please see the notices listed with this policy for more information."
    }
  ],
  "notices": [
    {
      "field": "pluginVmAllowed",
      "noticeValue": "true",
      "noticeMessage": "By enabling Parallels Desktop, you agree to the Parallels End-User License Agreement specified at https://www.parallels.com/about/legal/eula/. Warning: Device identifiers may be shared with Parallels. Please see privacy policy for more details at https://www.parallels.com/about/legal/privacy/. The minimum recommended configuration includes an i5 processor, 16 GB RAM, and 128 GB storage: https://support.google.com/chrome/a/answer/10044480.",
      "acknowledgementRequired": true
    }
  ],
  "supportUri": "...",
  "schemaName": "chrome.users.PluginVmAllowed"
}

위의 예에서 pluginVmAllowed 필드의 값을 true로 설정하면 acknowledgementRequired가 포함된 알림과 연결됩니다. 이 필드 값을 true로 올바르게 설정하려면 확인 필드 ackNoticeForPluginVmAllowedSetToTruetrue로 지정하는 요청을 전송해야 합니다. 그렇지 않으면 요청에 오류가 발생합니다.

이 예에서는 다음과 같은 일괄 수정 요청을 전송해야 합니다.

curl -X POST \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $TOKEN" \
  -d "{
  'requests': [
    {
      'policyTargetKey': {
        'targetResource': 'orgunits/03ph8a2z10ybbh2'
      },
      'policyValue': {
        'policySchema': 'chrome.users.PluginVmAllowed',
        'value': {
          'pluginVmAllowed': true,
          'ackNoticeForPluginVmAllowedSetToTrue': true
        }
      },
      'updateMask': {
        'paths': [
          'pluginVmAllowed',
          'ackNoticeForPluginVmAllowedSetToTrue'
        ]
      }
    }
  ]
}" \
"https://chromepolicy.googleapis.com/v1/customers/$CUSTOMER/policies/orgunits:batchModify"

파일 정책 설정

일부 정책에는 UploadedFile 유형의 필드가 있습니다. BatchModify 요청에 사용할 URL을 얻으려면 해당 정책의 값으로 설정할 파일을 API 서버에 업로드해야 합니다.

이 예에서는 JPEG 파일을 업로드하여 chrome.users.Wallpaper를 설정합니다.

파일 업로드

요청

curl -X POST \
  -H "Content-Type: image/jpeg" \
  -H "Authorization: Bearer $TOKEN" \
  -T "/path/to/the/file" \
  "https://chromepolicy.googleapis.com/upload/v1/customers/$CUSTOMER/policies/files:uploadPolicyFile?policy_field=chrome.users.Wallpaper.wallpaperImage"

응답

성공 응답에는 파일에 액세스할 수 있는 URL이 포함되어야 합니다.

{
  "downloadUri": "https://storage.googleapis.com/chromeos-mgmt/0gjdgxs370bkl6/ChromeOsWallpaper/32ac50ab-b5ae-4bba-afa8-b6b443912897"
}

파일 정책 설정

요청

curl -X POST \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $TOKEN" \
  -d '{
        requests: [{
                policyTargetKey: {
                        targetResource: "orgunits/04fatzly4jbjho9",
                        },
                policyValue: {
                        policySchema: "chrome.users.Wallpaper",
                        value: {
                          wallpaperImage: {downloadUri: "https://storage.googleapis.com/chromeos-mgmt/0gjdgxs370bkl6/ChromeOsWallpaper/32ac50ab-b5ae-4bba-afa8-b6b443912897"}
                          }
                        },
                updateMask: {paths: "wallpaperImage"}
                }]
      }' \
  "https://chromepolicy.googleapis.com/v1/customers/$CUSTOMER/policies/orgunits:batchModify"

응답

성공 응답은 비어 있어야 합니다.

{}