<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>

                ??一站式輕松地調用各大LLM模型接口,支持GPT4、智譜、豆包、星火、月之暗面及文生圖、文生視頻 廣告
                # Project-level Variables API > 原文:[https://docs.gitlab.com/ee/api/project_level_variables.html](https://docs.gitlab.com/ee/api/project_level_variables.html) * [List project variables](#list-project-variables) * [Show variable details](#show-variable-details) * [Create variable](#create-variable) * [Update variable](#update-variable) * [Remove variable](#remove-variable) * [The `filter` parameter](#the-filter-parameter) * [Enable or disable](#enable-or-disable) # Project-level Variables API[](#project-level-variables-api "Permalink") ## List project variables[](#list-project-variables "Permalink") 獲取項目變量的列表. ``` GET /projects/:id/variables ``` | Attribute | Type | required | Description | | --- | --- | --- | --- | | `id` | integer/string | yes | 一個項目的 ID 或經過身份驗證的用戶擁有[的該項目的 Urlencoded NAMESPACE / PROJECT_NAME](README.html#namespaced-path-encoding) | ``` curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/1/variables" ``` ``` [ { "key": "TEST_VARIABLE_1", "variable_type": "env_var", "value": "TEST_1" }, { "key": "TEST_VARIABLE_2", "variable_type": "env_var", "value": "TEST_2" } ] ``` ## Show variable details[](#show-variable-details "Permalink") 獲取項目特定變量的詳細信息. ``` GET /projects/:id/variables/:key ``` | Attribute | Type | required | Description | | --- | --- | --- | --- | | `id` | integer/string | yes | 一個項目的 ID 或經過身份驗證的用戶擁有[的該項目的 Urlencoded NAMESPACE / PROJECT_NAME](README.html#namespaced-path-encoding) | | `key` | string | yes | 變量的`key` | | `filter` | hash | no | 可用的過濾器: `[environment_scope]` . 請參閱[`filter`參數詳細信息](#the-filter-parameter) . | ``` curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/1/variables/TEST_VARIABLE_1" ``` ``` { "key": "TEST_VARIABLE_1", "variable_type": "env_var", "value": "TEST_1", "protected": false, "masked": true } ``` ## Create variable[](#create-variable "Permalink") 創建一個新變量. ``` POST /projects/:id/variables ``` | Attribute | Type | required | Description | | --- | --- | --- | --- | | `id` | integer/string | yes | 一個項目的 ID 或經過身份驗證的用戶擁有[的該項目的 Urlencoded NAMESPACE / PROJECT_NAME](README.html#namespaced-path-encoding) | | `key` | string | yes | The `key` of a variable; must have no more than 255 characters; only `A-Z`, `a-z`, `0-9`, and `_` are allowed | | `value` | string | yes | 變量的`value` | | `variable_type` | string | no | 變量的類型. 可用類型為: `env_var` (默認)和`file` | | `protected` | boolean | no | 變量是否受保護 | | `masked` | boolean | no | 變量是否被屏蔽 | | `environment_scope` | string | no | 變量的`environment_scope` | ``` curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/1/variables" --form "key=NEW_VARIABLE" --form "value=new value" ``` ``` { "key": "NEW_VARIABLE", "value": "new value", "protected": false, "variable_type": "env_var", "masked": false, "environment_scope": "*" } ``` ## Update variable[](#update-variable "Permalink") 更新項目的變量. ``` PUT /projects/:id/variables/:key ``` | Attribute | Type | required | Description | | --- | --- | --- | --- | | `id` | integer/string | yes | 一個項目的 ID 或經過身份驗證的用戶擁有[的該項目的 Urlencoded NAMESPACE / PROJECT_NAME](README.html#namespaced-path-encoding) | | `key` | string | yes | 變量的`key` | | `value` | string | yes | 變量的`value` | | `variable_type` | string | no | 變量的類型. 可用類型為: `env_var` (默認)和`file` | | `protected` | boolean | no | 變量是否受保護 | | `masked` | boolean | no | 變量是否被屏蔽 | | `environment_scope` | string | no | 變量的`environment_scope` | | `filter` | hash | no | 可用的過濾器: `[environment_scope]` . 請參閱[`filter`參數詳細信息](#the-filter-parameter) . | ``` curl --request PUT --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/1/variables/NEW_VARIABLE" --form "value=updated value" ``` ``` { "key": "NEW_VARIABLE", "value": "updated value", "variable_type": "env_var", "protected": true, "masked": false, "environment_scope": "*" } ``` ## Remove variable[](#remove-variable "Permalink") 刪除項目的變量. ``` DELETE /projects/:id/variables/:key ``` | Attribute | Type | required | Description | | --- | --- | --- | --- | | `id` | integer/string | yes | 一個項目的 ID 或經過身份驗證的用戶擁有[的該項目的 Urlencoded NAMESPACE / PROJECT_NAME](README.html#namespaced-path-encoding) | | `key` | string | yes | 變量的`key` | | `filter` | hash | no | 可用的過濾器: `[environment_scope]` . 請參閱[`filter`參數詳細信息](#the-filter-parameter) . | ``` curl --request DELETE --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/1/variables/VARIABLE_1" ``` ## The `filter` parameter[](#the-filter-parameter "Permalink") 版本歷史 * 在 GitLab 13.2 中[引入](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/34490) . * 它部署在功能標記后面,默認情況下處于禁用狀態. * 在 GitLab.com 上已禁用. * 要在 GitLab 自管實例中使用它,請讓 GitLab 管理員啟用它. 此參數用于按屬性(例如`environment_scope`進行過濾. 用法示例: ``` curl --request DELETE --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/1/variables/VARIABLE_1?filter[environment_scope]=production" ``` ### Enable or disable[](#enable-or-disable "Permalink") [有權訪問 GitLab Rails 控制臺的 GitLab 管理員](../administration/feature_flags.html)可以為您的實例啟用它. 要啟用它: ``` Feature.enable(:ci_variables_api_filter_environment_scope) ``` 禁用它: ``` Feature.disable(:ci_variables_api_filter_environment_scope) ```
                  <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>

                              哎呀哎呀视频在线观看