{{< details >}}
- Tier: 基础版, 专业版, 旗舰版
- Offering: JihuLab.com, 私有化部署
{{< /details >}}
{{< history >}}
- 引入于极狐GitLab 专业版 12.10。
- 在极狐GitLab 13.5 中移动至基础版。
{{< /history >}}
用于访问极狐GitLab 功能标记用户列表的 API。
具有至少 开发者 角色 的用户可以访问功能标记用户列表 API。
{{< alert type=”note” >}}
GET
请求一次返回二十个结果,因为 API 结果是分页的。您可以更改此值。
{{< /alert >}}
列出项目的所有功能标记用户列表
获取请求项目的所有功能标记用户列表。
GET /projects/:id/feature_flags_user_lists
属性 | 类型 | 必需 | 描述 |
---|---|---|---|
id |
integer/string | 是 | 项目的 ID 或URL 编码路径。 |
search |
string | 否 | 返回符合搜索条件的用户列表。 |
curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/1/feature_flags_user_lists"
示例响应:
[
{
"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"
}
]
创建功能标记用户列表
创建一个功能标记用户列表。
POST /projects/:id/feature_flags_user_lists
属性 | 类型 | 必需 | 描述 |
---|---|---|---|
id |
integer/string | 是 | 项目的 ID 或URL 编码路径。 |
name |
string | 是 | 列表的名称。 |
user_xids |
string | 是 | 逗号分隔的外部用户 ID 列表。 |
curl "https://gitlab.example.com/api/v4/projects/1/feature_flags_user_lists" \
--header "PRIVATE-TOKEN: <your_access_token>" \
--header "Content-type: application/json" \
--data @- << EOF
{
"name": "my_user_list",
"user_xids": "user1,user2,user3"
}
EOF
示例响应:
{
"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 /projects/:id/feature_flags_user_lists/:iid
属性 | 类型 | 必需 | 描述 |
---|---|---|---|
id |
integer/string | 是 | 项目的 ID 或URL 编码路径。 |
iid |
integer/string | 是 | 项目功能标记用户列表的内部 ID。 |
curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/1/feature_flags_user_lists/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"
}
更新功能标记用户列表
更新一个功能标记用户列表。
PUT /projects/:id/feature_flags_user_lists/:iid
属性 | 类型 | 必需 | 描述 |
---|---|---|---|
id |
integer/string | 是 | 项目的 ID 或URL 编码路径。 |
iid |
integer/string | 是 | 项目功能标记用户列表的内部 ID。 |
name |
string | 否 | 列表的名称。 |
user_xids |
string | 否 | 逗号分隔的外部用户 ID 列表。 |
curl "https://gitlab.example.com/api/v4/projects/1/feature_flags_user_lists/1" \
--header "PRIVATE-TOKEN: <your_access_token>" \
--header "Content-type: application/json" \
--request PUT \
--data @- << EOF
{
"user_xids": "user2,user3,user4"
}
EOF
示例响应:
{
"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 /projects/:id/feature_flags_user_lists/:iid
属性 | 类型 | 必需 | 描述 |
---|---|---|---|
id |
integer/string | 是 | 项目的 ID 或URL 编码路径。 |
iid |
integer/string | 是 | 项目功能标记用户列表的内部 ID。 |
curl --header "PRIVATE-TOKEN: <your_access_token>" --request DELETE "https://gitlab.example.com/api/v4/projects/1/feature_flags_user_lists/1"