Feature flag user lists API

原文:https://docs.gitlab.com/ee/api/feature_flag_user_lists.html

Feature flag user lists API

Introduced in GitLab Premium 12.10.

用于访问 GitLab 功能标志用户列表的 API.

具有开发者或更高权限的用户可以访问功能标志用户列表 API.

注意: GET请求一次返回 20 个结果,因为 API 结果是分页的 . 您可以更改此值.

List all feature flag user lists for a project

获取所请求项目的所有功能标志用户列表.

  1. GET /projects/:id/feature_flags_user_lists
Attribute Type Required Description
id integer/string yes 项目的 ID 或URL 编码的路径 .
  1. curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/1/feature_flags_user_lists"

响应示例:

  1. [ { "name": "user_list", "user_xids": "user1,user2", "id": 1, "iid": 1, "project_id": 1, "created_at": "2020-02-04T08:13:51.423Z", "updated_at": "2020-02-04T08:13:51.423Z" }, { "name": "test_users", "user_xids": "user3,user4,user5", "id": 2, "iid": 2, "project_id": 1, "created_at": "2020-02-04T08:13:10.507Z", "updated_at": "2020-02-04T08:13:10.507Z" } ]

Create a feature flag user list

创建功能标记用户列表.

  1. POST /projects/:id/feature_flags_user_lists
Attribute Type Required Description
id integer/string yes 项目的 ID 或URL 编码的路径 .
name string yes 功能标志的名称.
user_xids string yes 以逗号分隔的用户 ID 列表.
  1. curl "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. "name": "my_user_list",
  6. "user_xids": "user1,user2,user3"
  7. } EOF

响应示例:

  1. { "name": "my_user_list", "user_xids": "user1,user2,user3", "id": 1, "iid": 1, "project_id": 1, "created_at": "2020-02-04T08:32:27.288Z", "updated_at": "2020-02-04T08:32:27.288Z" }

Get a feature flag user list

获取功能标志用户列表.

  1. GET /projects/:id/feature_flags_user_lists/:iid
Attribute Type Required Description
id integer/string yes 项目的 ID 或URL 编码的路径 .
iid integer/string yes 项目的功能标志用户列表的内部 ID.
  1. curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/1/feature_flags_user_lists/1"

响应示例:

  1. { "name": "my_user_list", "user_xids": "123,456", "id": 1, "iid": 1, "project_id": 1, "created_at": "2020-02-04T08:13:10.507Z", "updated_at": "2020-02-04T08:13:10.507Z", }

Update a feature flag user list

更新功能标志用户列表.

  1. PUT /projects/:id/feature_flags_user_lists/:iid
Attribute Type Required Description
id integer/string yes 项目的 ID 或URL 编码的路径 .
iid integer/string yes 项目的功能标志用户列表的内部 ID.
name string no 功能标志的名称.
user_xids string no 以逗号分隔的用户 ID 列表.
  1. curl "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. "user_xids": "user2,user3,user4"
  7. } EOF

响应示例:

  1. { "name": "my_user_list", "user_xids": "user2,user3,user4", "id": 1, "iid": 1, "project_id": 1, "created_at": "2020-02-04T08:32:27.288Z", "updated_at": "2020-02-05T09:33:17.179Z" }

Delete feature flag user list

删除功能标志用户列表.

  1. DELETE /projects/:id/feature_flags_user_lists/:iid
Attribute Type Required Description
id integer/string yes 项目的 ID 或URL 编码的路径 .
iid integer/string yes 项目的功能标志用户列表的内部 ID
  1. curl --header "PRIVATE-TOKEN: <your_access_token>" --request DELETE "https://gitlab.example.com/api/v4/projects/1/feature_flags_user_lists/1"