Method: policies.set
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
设置对指定资源的访问权限控制政策。替换任何现有政策。
HTTP 请求
POST https://sasportal.googleapis.com/v1alpha1/policies:set
网址采用 gRPC 转码语法。
请求正文
请求正文中包含结构如下的数据:
JSON 表示法 |
{
"resource": string,
"policy": {
object (Policy )
},
"disableNotification": boolean
} |
字段 |
resource |
string
必需。要为其指定政策的资源。此政策会替换任何现有政策。
|
policy |
object (Policy )
必需。要应用于 resource 的政策。
|
disableNotification |
boolean
可选。将该字段设置为 true 可停用初始配置通知。
|
响应正文
如果成功,则响应正文包含一个 Policy
实例。
授权作用域
需要以下 OAuth 范围:
https://www.googleapis.com/auth/sasportal
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-25。
[null,null,["最后更新时间 (UTC):2025-07-25。"],[[["\u003cp\u003eSets the access control policy on a specified resource, replacing any existing policy.\u003c/p\u003e\n"],["\u003cp\u003eThe request body requires the resource, the policy to be applied, and optionally allows disabling onboarding notifications.\u003c/p\u003e\n"],["\u003cp\u003eA successful response returns the applied policy.\u003c/p\u003e\n"],["\u003cp\u003eUtilizes the \u003ccode\u003ehttps://www.googleapis.com/auth/sasportal\u003c/code\u003e OAuth scope for authorization.\u003c/p\u003e\n"]]],["The core function is to set an access control policy on a resource via a `POST` HTTP request to `https://sasportal.googleapis.com/v1alpha1/policies:set`. The request body, in JSON format, requires a `resource` string and a `policy` object. Optionally, `disableNotification` can be set to `true`. A successful request returns a `Policy` instance. This process requires the `https://www.googleapis.com/auth/sasportal` OAuth scope. Existing policies are replaced.\n"],null,["# Method: policies.set\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Request body](#body.request_body)\n - [JSON representation](#body.request_body.SCHEMA_REPRESENTATION)\n- [Response body](#body.response_body)\n- [Authorization Scopes](#body.aspect)\n\nSets the access control policy on the specified resource. Replaces any existing policy.\n\n### HTTP request\n\n`POST https://sasportal.googleapis.com/v1alpha1/policies:set`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Request body\n\nThe request body contains data with the following structure:\n\n| JSON representation |\n|-----------------------------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"resource\": string, \"policy\": { object (/spectrum-access-system/reference/rest/v1alpha1/Policy) }, \"disableNotification\": boolean } ``` |\n\n| Fields ||\n|-----------------------|-------------------------------------------------------------------------------------------------------------------------------------|\n| `resource` | `string` Required. The resource for which the policy is being specified. This policy replaces any existing policy. |\n| `policy` | `object (`[Policy](/spectrum-access-system/reference/rest/v1alpha1/Policy)`)` Required. The policy to be applied to the `resource`. |\n| `disableNotification` | `boolean` Optional. Set the field as `true` to disable the onboarding notification. |\n\n### Response body\n\nIf successful, the response body contains an instance of [Policy](/spectrum-access-system/reference/rest/v1alpha1/Policy).\n\n### Authorization Scopes\n\nRequires the following OAuth scope:\n\n- `https://www.googleapis.com/auth/sasportal`"]]