Method: projects.locations.collections.engines.assistants.agents.setIamPolicy

为代理资源设置访问权限控制政策。如果资源不存在,则返回 NOT_FOUND 错误。

政策只能包含 roles/discoveryengine.agentUserroles/discoveryengine.agentViewerroles/discoveryengine.agentEditor 角色。

HTTP 请求

POST https://discoveryengine.googleapis.com/v1alpha/{resource=projects/*/locations/*/collections/*/engines/*/assistants/*/agents/*}:setIamPolicy

网址采用 gRPC 转码语法。

路径参数

参数
resource

string

必需:要为其指定政策的资源。如需了解此字段的适当值,请参阅资源名称

请求正文

请求正文中包含结构如下的数据:

JSON 表示法
{
  "policy": {
    object (Policy)
  }
}
字段
policy

object (Policy)

必需:要应用于 resource 的完整政策。政策的大小限制为几十 KB。空政策是有效的政策,但可能被某些 Google Cloud 服务(例如项目)拒绝。

响应正文

如果成功,则响应正文包含一个 Policy 实例。

授权范围

需要以下 OAuth 范围之一:

  • https://www.googleapis.com/auth/cloud-platform
  • https://www.googleapis.com/auth/discoveryengine.readwrite
  • https://www.googleapis.com/auth/discoveryengine.assist.readwrite

如需了解详情,请参阅 Authentication Overview