[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-08-18。"],[],[],null,["# Limiting target types\n\nIn some situations it might be preferable to limit the job target type. To do\nthis, administrators who have the [Organization Policy Administrator](/iam/docs/understanding-roles#organization-policy-roles)\nrole can configure a [policy](/resource-manager/docs/organization-policy/overview#organization_policy)\nto control what kind of job targets (HTTP, Pub/Sub, and/or App Engine HTTP) can\nbe created in their organization. \n\n### Console\n\n1. Visit the **Organization policies** page of the **IAM \\& Admin** section.\n\n [IAM \\& Admin](https://console.cloud.google.com/iam-admin/orgpolicies/list)\n2. From the top left dropdown, select the resource (organization or project)\n to which you wish to apply the constraint.\n\n3. Select **Allowed target types for jobs** from the list of **Organization\n Policies**.\n\n4. On the policy page, click the **Edit** button.\n\n5. Under **Rules** , open **Add Rule**\n\n 1. Select **Custom** for **Policy values**.\n\n 2. Select **Allow** for **Policy type**.\n\n 3. Add the type (PUBSUB, HTTP, or APPENGINE) to allowlist.\n\n 4. Click on **New Policy Value** to add multiple job types.\n\n 5. **Save** to enforce the policy.\n\n### Gcloud\n\n- To see the value of the constraint in an existing policy:\n\n ```\n gcloud resource-manager org-policies describe cloudscheduler.allowedTargetTypes --RESOURCE_TYPE=RESOURCE_ID\n \n ```\n\n \u003cbr /\u003e\n\n Where RESOURCE_TYPE is either `project`, `folder`, or `organization`,\n depending on where in the hierarchy the policy is attached.\n\n Which should return something like this: \n\n ```\n constraint: constraints/cloudscheduler.allowedTargetTypes\n etag: ETAG_VALUE\n listPolicy:\n allowedValues:\n - PUBSUB\n updateTime: '2021-09-04T15:30:45.313018Z'\n ```\n Make a note of the ETAG_VALUE for the next step.\n\n \u003cbr /\u003e\n\n- To create a `policy.yaml` file with the constraint:\n\n ```\n cat \u003epolicy.yaml\n constraint: constraints/cloudscheduler.allowedTargetTypes --RESOURCE_TYPE=RESOURCE_ID\n etag: ETAG_VALUE\n listPolicy:\n allowedValues:\n - PUBSUB\n ```\n\n \u003cbr /\u003e\n\n- To set the policy:\n\n \u003cbr /\u003e\n\n ```\n gcloud resource-manager org-policies set-policy --RESOURCE_TYPE=RESOURCE_ID policy.yaml\n ```\n\n \u003cbr /\u003e\n\n- To delete the constraint:\n\n \u003cbr /\u003e\n\n ```\n gcloud resource-manager org-policies delete --RESOURCE_TYPE=RESOURCE_ID\n constraints/cloudscheduler.allowedTargetTypes\n ```\n\n \u003cbr /\u003e"]]