功能标志用户列表 API
- Tier: 基础版, 专业版, 旗舰版
- Offering: JihuLab.com, 私有化部署
History
- 引入于极狐GitLab 专业版 12.10。
- 在极狐GitLab 13.5 中移动至基础版。
用于访问极狐GitLab 功能标记用户列表的 API。
具有至少 开发者 角色 的用户可以访问功能标记用户列表 API。
`GET` 请求一次返回二十个结果,因为 API 结果是[分页的](rest/_index.md#pagination)。您可以更改此值。
列出项目的所有功能标记用户列表
获取请求项目的所有功能标记用户列表。
plaintextGET /projects/:id/feature_flags_user_lists
| 属性 | 类型 | 必需 | 描述 |
|---|---|---|---|
| id | integer/string | 是 | 项目的 ID 或URL 编码路径。 |
| search | string | 否 | 返回符合搜索条件的用户列表。 |
shellcurl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/1/feature_flags_user_lists"
示例响应:
json1[ 2 { 3 "name": "user_list", 4 "user_xids": "user1,user2", 5 "id": 1, 6 "iid": 1, 7 "project_id": 1, 8 "created_at": "2020-02-04T08:13:51.423Z", 9 "updated_at": "2020-02-04T08:13:51.423Z" 10 }, 11 { 12 "name": "test_users", 13 "user_xids": "user3,user4,user5", 14 "id": 2, 15 "iid": 2, 16 "project_id": 1, 17 "created_at": "2020-02-04T08:13:10.507Z", 18 "updated_at": "2020-02-04T08:13:10.507Z" 19 } 20]
创建功能标记用户列表
创建一个功能标记用户列表。
plaintextPOST /projects/:id/feature_flags_user_lists
| 属性 | 类型 | 必需 | 描述 |
|---|---|---|---|
| id | integer/string | 是 | 项目的 ID 或URL 编码路径。 |
| name | string | 是 | 列表的名称。 |
| user_xids | string | 是 | 逗号分隔的外部用户 ID 列表。 |
shell1curl "https://gitlab.example.com/api/v4/projects/1/feature_flags_user_lists" \ 2 --header "PRIVATE-TOKEN: <your_access_token>" \ 3 --header "Content-type: application/json" \ 4 --data @- << EOF 5{ 6 "name": "my_user_list", 7 "user_xids": "user1,user2,user3" 8} 9EOF
示例响应:
json1{ 2 "name": "my_user_list", 3 "user_xids": "user1,user2,user3", 4 "id": 1, 5 "iid": 1, 6 "project_id": 1, 7 "created_at": "2020-02-04T08:32:27.288Z", 8 "updated_at": "2020-02-04T08:32:27.288Z" 9}
获取功能标记用户列表
获取一个功能标记用户列表。
plaintextGET /projects/:id/feature_flags_user_lists/:iid
| 属性 | 类型 | 必需 | 描述 |
|---|---|---|---|
| id | integer/string | 是 | 项目的 ID 或URL 编码路径。 |
| iid | integer/string | 是 | 项目功能标记用户列表的内部 ID。 |
shellcurl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/1/feature_flags_user_lists/1"
示例响应:
json1{ 2 "name": "my_user_list", 3 "user_xids": "123,456", 4 "id": 1, 5 "iid": 1, 6 "project_id": 1, 7 "created_at": "2020-02-04T08:13:10.507Z", 8 "updated_at": "2020-02-04T08:13:10.507Z" 9}
更新功能标记用户列表
更新一个功能标记用户列表。
plaintextPUT /projects/:id/feature_flags_user_lists/:iid
| 属性 | 类型 | 必需 | 描述 |
|---|---|---|---|
| id | integer/string | 是 | 项目的 ID 或URL 编码路径。 |
| iid | integer/string | 是 | 项目功能标记用户列表的内部 ID。 |
| name | string | 否 | 列表的名称。 |
| user_xids | string | 否 | 逗号分隔的外部用户 ID 列表。 |
shell1curl "https://gitlab.example.com/api/v4/projects/1/feature_flags_user_lists/1" \ 2 --header "PRIVATE-TOKEN: <your_access_token>" \ 3 --header "Content-type: application/json" \ 4 --request PUT \ 5 --data @- << EOF 6{ 7 "user_xids": "user2,user3,user4" 8} 9EOF
示例响应:
json1{ 2 "name": "my_user_list", 3 "user_xids": "user2,user3,user4", 4 "id": 1, 5 "iid": 1, 6 "project_id": 1, 7 "created_at": "2020-02-04T08:32:27.288Z", 8 "updated_at": "2020-02-05T09:33:17.179Z" 9}
删除功能标记用户列表
删除一个功能标记用户列表。
plaintextDELETE /projects/:id/feature_flags_user_lists/:iid
| 属性 | 类型 | 必需 | 描述 |
|---|---|---|---|
| id | integer/string | 是 | 项目的 ID 或URL 编码路径。 |
| iid | integer/string | 是 | 项目功能标记用户列表的内部 ID。 |
shellcurl --header "PRIVATE-TOKEN: <your_access_token>" --request DELETE "https://gitlab.example.com/api/v4/projects/1/feature_flags_user_lists/1"