<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                企業??AI智能體構建引擎,智能編排和調試,一鍵部署,支持知識庫和私有化部署方案 廣告
                # Feature Flags API > 原文:[https://docs.gitlab.com/ee/api/feature_flags.html](https://docs.gitlab.com/ee/api/feature_flags.html) * [Feature Flags pagination](#feature-flags-pagination) * [List feature flags for a project](#list-feature-flags-for-a-project) * [Get a single feature flag](#get-a-single-feature-flag) * [Create a feature flag](#create-a-feature-flag) * [Update a feature flag](#update-a-feature-flag) * [Delete a feature flag](#delete-a-feature-flag) # Feature Flags API[](#feature-flags-api-premium "Permalink") [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/9566) in [GitLab Premium](https://about.gitlab.com/pricing/) 12.5. **注意:**此 API 位于[功能標志的](../operations/feature_flags.html#enable-or-disable-feature-flag-strategies)后面. 如果您的環境中未啟用此標志,則可以使用[舊功能標志 API](feature_flags_legacy.html) . 用于訪問[GitLab 功能標記](../operations/feature_flags.html)資源的 API. 具有開發者或更高[權限的用戶](../user/permissions.html)可以訪問功能標記 API. ## Feature Flags pagination[](#feature-flags-pagination "Permalink") 默認情況下,因為 API 結果是[分頁的](README.html#pagination) ,所以`GET`請求一次返回 20 個結果. ## List feature flags for a project[](#list-feature-flags-for-a-project "Permalink") 獲取所請求項目的所有功能標志. ``` GET /projects/:id/feature_flags ``` | Attribute | Type | Required | Description | | --- | --- | --- | --- | | `id` | integer/string | yes | 項目的 ID 或[URL 編碼的路徑](README.html#namespaced-path-encoding) . | | `scope` | string | no | 功能標志的條件,其中之一: `enabled` , `disabled` . | ``` curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/1/feature_flags" ``` 響應示例: ``` [ { "name":"merge_train", "description":"This feature is about merge train", "version": "new_version_flag", "created_at":"2019-11-04T08:13:51.423Z", "updated_at":"2019-11-04T08:13:51.423Z", "scopes":[], "strategies": [ { "id": 1, "name": "userWithId", "parameters": { "userIds": "user1" }, "scopes": [ { "id": 1, "environment_scope": "production" } ] } ] }, { "name":"new_live_trace", "description":"This is a new live trace feature", "version": "new_version_flag", "created_at":"2019-11-04T08:13:10.507Z", "updated_at":"2019-11-04T08:13:10.507Z", "scopes":[] "strategies": [ { "id": 2, "name": "default", "parameters": {}, "scopes": [ { "id": 2, "environment_scope": "staging" } ] } ] } ] ``` ## Get a single feature flag[](#get-a-single-feature-flag "Permalink") 獲取單個功能標志. ``` GET /projects/:id/feature_flags/:name ``` | Attribute | Type | Required | Description | | --- | --- | --- | --- | | `id` | integer/string | yes | 項目的 ID 或[URL 編碼的路徑](README.html#namespaced-path-encoding) . | | `name` | string | yes | The name of the feature flag. | ``` curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/1/feature_flags/awesome_feature ``` 響應示例: ``` { "name": "awesome_feature", "description": null, "version": "new_version_flag", "created_at": "2020-05-13T19:56:33.119Z", "updated_at": "2020-05-13T19:56:33.119Z", "scopes": [], "strategies": [ { "id": 36, "name": "default", "parameters": {}, "scopes": [ { "id": 37, "environment_scope": "production" } ] } ] } ``` ## Create a feature flag[](#create-a-feature-flag "Permalink") 創建一個新的功能標志. ``` POST /projects/:id/feature_flags ``` | Attribute | Type | Required | Description | | --- | --- | --- | --- | | `id` | integer/string | yes | 項目的 ID 或[URL 編碼的路徑](README.html#namespaced-path-encoding) . | | `name` | string | yes | 功能標志的名稱. | | `version` | string | yes | 功能標志的版本. 必須是`new_version_flag` . 省略或設置為`legacy_flag`即可創建[舊版功能標志](feature_flags_legacy.html) . | | `description` | string | no | 功能標志的描述. | | `strategies` | JSON | no | 特征標志[策略](../operations/feature_flags.html#feature-flag-strategies) . | | `strategies:name` | JSON | no | 策略名稱. | | `strategies:parameters` | JSON | no | 策略參數. | | `strategies:scopes` | JSON | no | 策略的范圍. | | `strategies:scopes:environment_scope` | string | no | 范圍的環境規格. | ``` curl "https://gitlab.example.com/api/v4/projects/1/feature_flags" \ --header "PRIVATE-TOKEN: <your_access_token>" \ --header "Content-type: application/json" \ --data @- << EOF { "name": "awesome_feature", "version": "new_version_flag", "strategies": [{ "name": "default", "parameters": {}, "scopes": [{ "environment_scope": "production" }] }] } EOF ``` 響應示例: ``` { "name": "awesome_feature", "description": null, "version": "new_version_flag", "created_at": "2020-05-13T19:56:33.119Z", "updated_at": "2020-05-13T19:56:33.119Z", "scopes": [], "strategies": [ { "id": 36, "name": "default", "parameters": {}, "scopes": [ { "id": 37, "environment_scope": "production" } ] } ] } ``` ## Update a feature flag[](#update-a-feature-flag "Permalink") 更新功能標志. ``` PUT /projects/:id/feature_flags/:name ``` | Attribute | Type | Required | Description | | --- | --- | --- | --- | | `id` | integer/string | yes | 項目的 ID 或[URL 編碼的路徑](README.html#namespaced-path-encoding) . | | `name` | string | yes | 功能標志的名稱. | | `description` | string | no | 功能標志的描述. | | `strategies` | JSON | no | 特征標志[策略](../operations/feature_flags.html#feature-flag-strategies) . | | `strategies:id` | JSON | no | 功能標記策略 ID. | | `strategies:name` | JSON | no | 策略名稱. | | `strategies:parameters` | JSON | no | 策略參數. | | `strategies:scopes` | JSON | no | 策略的范圍. | | `strategies:scopes:id` | JSON | no | 范圍 ID. | | `strategies:scopes:environment_scope` | string | no | 范圍的環境規格. | ``` curl "https://gitlab.example.com/api/v4/projects/1/feature_flags/awesome_feature" \ --header "PRIVATE-TOKEN: <your_access_token>" \ --header "Content-type: application/json" \ --data @- << EOF { "strategies": [{ "name": "gradualRolloutUserId", "parameters": { "groupId": "default", "percentage": "25" }, "scopes": [{ "environment_scope": "staging" }] }] } EOF ``` 響應示例: ``` { "name": "awesome_feature", "description": null, "version": "new_version_flag", "created_at": "2020-05-13T20:10:32.891Z", "updated_at": "2020-05-13T20:10:32.891Z", "scopes": [], "strategies": [ { "id": 38, "name": "gradualRolloutUserId", "parameters": { "groupId": "default", "percentage": "25" }, "scopes": [ { "id": 40, "environment_scope": "staging" } ] }, { "id": 37, "name": "default", "parameters": {}, "scopes": [ { "id": 39, "environment_scope": "production" } ] } ] } ``` ## Delete a feature flag[](#delete-a-feature-flag "Permalink") 刪除功能標志. ``` DELETE /projects/:id/feature_flags/:name ``` | Attribute | Type | Required | Description | | --- | --- | --- | --- | | `id` | integer/string | yes | 項目的 ID 或[URL 編碼的路徑](README.html#namespaced-path-encoding) . | | `name` | string | yes | 功能標志的名稱. | ``` curl --header "PRIVATE-TOKEN: <your_access_token>" --request DELETE "https://gitlab.example.com/api/v4/projects/1/feature_flags/awesome_feature" ```
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看