機能フラグユーザーリストAPI
- プラン: Free、Premium、Ultimate
- 提供形態: GitLab.com、GitLab Self-Managed、GitLab Dedicated
このAPIを使用して、GitLabの機能フラグのユーザーリストを操作します。
前提要件:
- デベロッパーロール以上が必要です。
すべてのユーザーの機能フラグを操作するには、Feature flag APIを参照してください。
プロジェクトのすべての機能フラグユーザーリストをリスト表示します
リクエストされたプロジェクトのすべての機能フラグユーザーリストを取得します。
GET /projects/:id/feature_flags_user_lists結果のページネーションを制御するには、pageおよびper_page ページネーションパラメータを使用します。
| 属性 | 型 | 必須 | 説明 |
|---|---|---|---|
id | 整数または文字列 | はい | プロジェクトのIDまたはURLエンコードされたパス。 |
search | 文字列 | いいえ | 検索条件に一致するユーザーリストを返します。 |
curl --header "PRIVATE-TOKEN: <your_access_token>" \
--url "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 | 整数または文字列 | はい | プロジェクトのIDまたはURLエンコードされたパス。 |
name | 文字列 | はい | リストの名前。 |
user_xids | 文字列 | はい | 外部ユーザーIDのカンマ区切りリスト。 |
curl --request POST \
--header "PRIVATE-TOKEN: <your_access_token>" \
--header "Content-type: application/json" \
--url "https://gitlab.example.com/api/v4/projects/1/feature_flags_user_lists" \
--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結果のページネーションを制御するには、pageおよびper_page ページネーションパラメータを使用します。
| 属性 | 型 | 必須 | 説明 |
|---|---|---|---|
id | 整数または文字列 | はい | プロジェクトのIDまたはURLエンコードされたパス。 |
iid | 整数または文字列 | はい | プロジェクトの機能フラグユーザーリストの内部ID。 |
curl --header "PRIVATE-TOKEN: <your_access_token>" \
--url "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 | 整数または文字列 | はい | プロジェクトのIDまたはURLエンコードされたパス。 |
iid | 整数または文字列 | はい | プロジェクトの機能フラグユーザーリストの内部ID。 |
name | 文字列 | いいえ | リストの名前。 |
user_xids | 文字列 | いいえ | 外部ユーザーIDのカンマ区切りリスト。 |
curl --request PUT \
--header "PRIVATE-TOKEN: <your_access_token>" \
--header "Content-type: application/json" \
--url "https://gitlab.example.com/api/v4/projects/1/feature_flags_user_lists/1" \
--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 | 整数または文字列 | はい | プロジェクトのIDまたはURLエンコードされたパス。 |
iid | 整数または文字列 | はい | プロジェクトの機能フラグユーザーリストの内部ID |
curl --request DELETE \
--header "PRIVATE-TOKEN: <your_access_token>" \
--url "https://gitlab.example.com/api/v4/projects/1/feature_flags_user_lists/1"