
# 批量设置流水线实例二级权限 - BatchUpdatePipelinePermission
#### 功能介绍
批量设置流水线实例二级权限
#### 调用方法
请参见[如何调用API](https://support.huaweicloud.com/api-pipeline/pipeline_03_0006.html)。
#### URI
POST /v5/{project_id}/api/pipeline-permissions/pipeline/batch-role-permission
表1路径参数 
| 参数         | 是否必选 | 参数类型   | 描述                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
|:---|:---|:---|:---|
| project_id | 是    | String | **参数解释**： 项目ID，获取方式请参见[获取项目ID](https://support.huaweicloud.com/api-pipeline/pipeline_03_0036.html)。 **约束限制**： 不涉及。 **取值范围**： 32位字符，由数字和字母组成。 **默认取值**： 不涉及。 |
   
#### 请求参数
表2请求Body参数 
| 参数                | 是否必选 | 参数类型                                                                    | 描述         |
|:---|:---|:---|:---|
| pipeline_ids      | 是    | Array of strings                                                        | 流水线ID列表    |
| is_project_switch | 是    | Boolean                                                                 | 是否开启项目权限配置 |
| roles             | 是    | Array of [roles] objects | 角色详情列表     |
   
 表3roles 
| 参数                  | 是否必选 | 参数类型    | 描述       |
|:---|:---|:---|:---|
| operation_authorize | 是    | Boolean | 编辑权限配置权限 |
| operation_delete    | 是    | Boolean | 删除权限     |
| operation_execute   | 是    | Boolean | 执行权限     |
| operation_query     | 是    | Boolean | 查询权限     |
| operation_update    | 是    | Boolean | 更新权限     |
| role_id             | 是    | Integer | 角色ID     |
   
#### 响应参数
**状态码：200**
表4响应Body参数 
| 参数     | 参数类型   | 描述                                                                                                                                                                                |
|:---|:---|:---|
| status | String | **参数解释**： 响应状态。 **取值范围**： 不涉及。 |
   
#### 请求示例
```
POST https://(endpoint)/v5/071112d87d3e4ed49130c691936202e9/api/pipeline-permissions/pipeline/batch-role-permission
{
  "pipeline_ids" : [ "53acae73a3f44b2994f9b20a710721c6", "146542db758a4dc0995b44dff13e1933" ],
  "is_project_switch" : false,
  "roles" : [ {
    "operation_authorize" : false,
    "operation_delete" : true,
    "operation_execute" : true,
    "operation_query" : true,
    "operation_update" : true,
    "role_id" : 3
  }, {
    "operation_authorize" : false,
    "operation_delete" : false,
    "operation_execute" : true,
    "operation_query" : true,
    "operation_update" : false,
    "role_id" : 4
  }, {
    "operation_authorize" : false,
    "operation_delete" : false,
    "operation_execute" : true,
    "operation_query" : true,
    "operation_update" : false,
    "role_id" : 5
  }, {
    "operation_authorize" : false,
    "operation_delete" : false,
    "operation_execute" : false,
    "operation_query" : true,
    "operation_update" : false,
    "role_id" : 6
  }, {
    "operation_authorize" : false,
    "operation_delete" : true,
    "operation_execute" : true,
    "operation_query" : true,
    "operation_update" : true,
    "role_id" : 7
  }, {
    "operation_authorize" : false,
    "operation_delete" : false,
    "operation_execute" : false,
    "operation_query" : true,
    "operation_update" : false,
    "role_id" : 8
  }, {
    "operation_authorize" : false,
    "operation_delete" : false,
    "operation_execute" : false,
    "operation_query" : true,
    "operation_update" : false,
    "role_id" : 9
  } ]
}
```
#### 响应示例
**状态码：200**
响应体
```
{
  "status" : "success"
}
```
#### 状态码
| 状态码 | 描述  |
|:---|:---|
| 200 | 响应体 |
   
#### 错误码
请参见[错误码](https://support.huaweicloud.com/api-pipeline/ErrorCode.html)。
