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

                ThinkChat2.0新版上線,更智能更精彩,支持會話、畫圖、視頻、閱讀、搜索等,送10W Token,即刻開啟你的AI之旅 廣告
                # Group clusters API > 原文:[https://docs.gitlab.com/ee/api/group_clusters.html](https://docs.gitlab.com/ee/api/group_clusters.html) * [List group clusters](#list-group-clusters) * [Get a single group cluster](#get-a-single-group-cluster) * [Add existing cluster to group](#add-existing-cluster-to-group) * [Edit group cluster](#edit-group-cluster) * [Delete group cluster](#delete-group-cluster) # Group clusters API[](#group-clusters-api "Permalink") 在 GitLab 12.1 中[引入](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/30213) . **注意:組**將至少需要用戶具有維護者訪問權限才能使用這些端點. ## List group clusters[](#list-group-clusters "Permalink") 返回組集群的列表. ``` GET /groups/:id/clusters ``` Parameters: | Attribute | Type | Required | Description | | --- | --- | --- | --- | | `id` | integer/string | yes | 組的 ID 或[URL 編碼的路徑](README.html#namespaced-path-encoding) | 請求示例: ``` curl --header "Private-Token: <your_access_token>" "https://gitlab.example.com/api/v4/groups/26/clusters" ``` 響應示例: ``` [ { "id":18, "name":"cluster-1", "domain":"example.com", "created_at":"2019-01-02T20:18:12.563Z", "provider_type":"user", "platform_type":"kubernetes", "environment_scope":"*", "cluster_type":"group_type", "user": { "id":1, "name":"Administrator", "username":"root", "state":"active", "avatar_url":"https://www.gravatar.com/avatar/4249f4df72b..", "web_url":"https://gitlab.example.com/root" }, "platform_kubernetes": { "api_url":"https://104.197.68.152", "authorization_type":"rbac", "ca_cert":"-----BEGIN CERTIFICATE-----\r\nhFiK1L61owwDQYJKoZIhvcNAQELBQAw\r\nLzEtMCsGA1UEAxMkZDA1YzQ1YjctNzdiMS00NDY0LThjNmEtMTQ0ZDJkZjM4ZDBj\r\nMB4XDTE4MTIyNzIwMDM1MVoXDTIzMTIyNjIxMDM1MVowLzEtMCsGA1UEAxMkZDA1\r\nYzQ1YjctNzdiMS00NDY0LThjNmEtMTQ0ZDJkZjM.......-----END CERTIFICATE-----" }, "management_project": { "id":2, "description":null, "name":"project2", "name_with_namespace":"John Doe8 / project2", "path":"project2", "path_with_namespace":"namespace2/project2", "created_at":"2019-10-11T02:55:54.138Z" } }, { "id":19, "name":"cluster-2", ... } ] ``` ## Get a single group cluster[](#get-a-single-group-cluster "Permalink") 獲取單個組集群. ``` GET /groups/:id/clusters/:cluster_id ``` Parameters: | Attribute | Type | Required | Description | | --- | --- | --- | --- | | `id` | integer/string | yes | 組的 ID 或[URL 編碼的路徑](README.html#namespaced-path-encoding) | | `cluster_id` | integer | yes | 集群的 ID | 請求示例: ``` curl --header "Private-Token: <your_access_token>" "https://gitlab.example.com/api/v4/groups/26/clusters/18" ``` 響應示例: ``` { "id":18, "name":"cluster-1", "domain":"example.com", "created_at":"2019-01-02T20:18:12.563Z", "provider_type":"user", "platform_type":"kubernetes", "environment_scope":"*", "cluster_type":"group_type", "user": { "id":1, "name":"Administrator", "username":"root", "state":"active", "avatar_url":"https://www.gravatar.com/avatar/4249f4df72b..", "web_url":"https://gitlab.example.com/root" }, "platform_kubernetes": { "api_url":"https://104.197.68.152", "authorization_type":"rbac", "ca_cert":"-----BEGIN CERTIFICATE-----\r\nhFiK1L61owwDQYJKoZIhvcNAQELBQAw\r\nLzEtMCsGA1UEAxMkZDA1YzQ1YjctNzdiMS00NDY0LThjNmEtMTQ0ZDJkZjM4ZDBj\r\nMB4XDTE4MTIyNzIwMDM1MVoXDTIzMTIyNjIxMDM1MVowLzEtMCsGA1UEAxMkZDA1\r\nYzQ1YjctNzdiMS00NDY0LThjNmEtMTQ0ZDJkZjM.......-----END CERTIFICATE-----" }, "management_project": { "id":2, "description":null, "name":"project2", "name_with_namespace":"John Doe8 / project2", "path":"project2", "path_with_namespace":"namespace2/project2", "created_at":"2019-10-11T02:55:54.138Z" }, "group": { "id":26, "name":"group-with-clusters-api", "web_url":"https://gitlab.example.com/group-with-clusters-api" } } ``` ## Add existing cluster to group[](#add-existing-cluster-to-group "Permalink") 將現有的 Kubernetes 集群添加到組中. ``` POST /groups/:id/clusters/user ``` Parameters: | Attribute | Type | Required | Description | | --- | --- | --- | --- | | `id` | integer/string | yes | 組的 ID 或[URL 編碼的路徑](README.html#namespaced-path-encoding) | | `name` | string | yes | 集群名稱 | | `domain` | string | no | 集群的[基礎域](../user/group/clusters/index.html#base-domain) | | `management_project_id` | integer | no | 集群[管理項目](../user/clusters/management_project.html)的 ID | | `enabled` | boolean | no | 確定集群是否處于活動狀態,默認為 true | | `managed` | boolean | no | 確定 GitLab 是否將管理該集群的名稱空間和服務帳戶,默認為 true | | `platform_kubernetes_attributes[api_url]` | string | yes | 訪問 Kubernetes API 的 URL | | `platform_kubernetes_attributes[token]` | string | yes | 針對 Kubernetes 進行身份驗證的令牌 | | `platform_kubernetes_attributes[ca_cert]` | string | no | TLS 證書. 如果 API 使用自簽名 TLS 證書,則為必填. | | `platform_kubernetes_attributes[authorization_type]` | string | no | 集群授權類型: `rbac` , `abac`或`unknown_authorization` . 默認為`rbac` . | | `environment_scope` | string | no | 集群的關聯環境. 默認為`*` | 請求示例: ``` curl --header "Private-Token: <your_access_token>" "https://gitlab.example.com/api/v4/groups/26/clusters/user" \ -H "Accept: application/json" \ -H "Content-Type:application/json" \ --request POST --data '{"name":"cluster-5", "platform_kubernetes_attributes":{"api_url":"https://35.111.51.20","token":"12345","ca_cert":"-----BEGIN CERTIFICATE-----\r\nhFiK1L61owwDQYJKoZIhvcNAQELBQAw\r\nLzEtMCsGA1UEAxMkZDA1YzQ1YjctNzdiMS00NDY0LThjNmEtMTQ0ZDJkZjM4ZDBj\r\nMB4XDTE4MTIyNzIwMDM1MVoXDTIzMTIyNjIxMDM1MVowLzEtMCsGA1UEAxMkZDA1\r\nYzQ1YjctNzdiMS00NDY0LThjNmEtMTQ0ZDJkZjM.......-----END CERTIFICATE-----"}}' ``` 響應示例: ``` { "id":24, "name":"cluster-5", "created_at":"2019-01-03T21:53:40.610Z", "provider_type":"user", "platform_type":"kubernetes", "environment_scope":"*", "cluster_type":"group_type", "user": { "id":1, "name":"Administrator", "username":"root", "state":"active", "avatar_url":"https://www.gravatar.com/avatar/4249f4df72b..", "web_url":"https://gitlab.example.com/root" }, "platform_kubernetes": { "api_url":"https://35.111.51.20", "authorization_type":"rbac", "ca_cert":"-----BEGIN CERTIFICATE-----\r\nhFiK1L61owwDQYJKoZIhvcNAQELBQAw\r\nLzEtMCsGA1UEAxMkZDA1YzQ1YjctNzdiMS00NDY0LThjNmEtMTQ0ZDJkZjM4ZDBj\r\nMB4XDTE4MTIyNzIwMDM1MVoXDTIzMTIyNjIxMDM1MVowLzEtMCsGA1UEAxMkZDA1\r\nYzQ1YjctNzdiMS00NDY0LThjNmEtMTQ0ZDJkZjM.......-----END CERTIFICATE-----" }, "management_project":null, "group": { "id":26, "name":"group-with-clusters-api", "web_url":"https://gitlab.example.com/root/group-with-clusters-api" } } ``` ## Edit group cluster[](#edit-group-cluster "Permalink") 更新現有的組群集. ``` PUT /groups/:id/clusters/:cluster_id ``` Parameters: | Attribute | Type | Required | Description | | --- | --- | --- | --- | | `id` | integer/string | yes | 組的 ID 或[URL 編碼的路徑](README.html#namespaced-path-encoding) | | `cluster_id` | integer | yes | 集群的 ID | | `name` | string | no | 集群名稱 | | `domain` | string | no | 集群的[基礎域](../user/group/clusters/index.html#base-domain) | | `management_project_id` | integer | no | 集群[管理項目](../user/clusters/management_project.html)的 ID | | `platform_kubernetes_attributes[api_url]` | string | no | 訪問 Kubernetes API 的 URL | | `platform_kubernetes_attributes[token]` | string | no | 針對 Kubernetes 進行身份驗證的令牌 | | `platform_kubernetes_attributes[ca_cert]` | string | no | TLS 證書. 如果 API 使用自簽名 TLS 證書,則為必填. | | `environment_scope` | string | no | 集群的關聯環境 | **注意:**僅通過["添加現有 Kubernetes 群集"](../user/project/clusters/add_remove_clusters.html#add-existing-cluster)選項或通過["將現有群集添加到組"](#add-existing-cluster-to-group)端點[添加群集時,](#add-existing-cluster-to-group)才能更新`name` , `api_url` , `ca_cert`和`token` . 請求示例: ``` curl --header "Private-Token: <your_access_token>" "https://gitlab.example.com/api/v4/groups/26/clusters/24" \ -H "Content-Type:application/json" \ --request PUT --data '{"name":"new-cluster-name","domain":"new-domain.com","api_url":"https://new-api-url.com"}' ``` 響應示例: ``` { "id":24, "name":"new-cluster-name", "domain":"new-domain.com", "created_at":"2019-01-03T21:53:40.610Z", "provider_type":"user", "platform_type":"kubernetes", "environment_scope":"*", "cluster_type":"group_type", "user": { "id":1, "name":"Administrator", "username":"root", "state":"active", "avatar_url":"https://www.gravatar.com/avatar/4249f4df72b..", "web_url":"https://gitlab.example.com/root" }, "platform_kubernetes": { "api_url":"https://new-api-url.com", "authorization_type":"rbac", "ca_cert":null }, "management_project": { "id":2, "description":null, "name":"project2", "name_with_namespace":"John Doe8 / project2", "path":"project2", "path_with_namespace":"namespace2/project2", "created_at":"2019-10-11T02:55:54.138Z" }, "group": { "id":26, "name":"group-with-clusters-api", "web_url":"https://gitlab.example.com/group-with-clusters-api" } } ``` ## Delete group cluster[](#delete-group-cluster "Permalink") 刪除現有的組群集. ``` DELETE /groups/:id/clusters/:cluster_id ``` Parameters: | Attribute | Type | Required | Description | | --- | --- | --- | --- | | `id` | integer/string | yes | 組的 ID 或[URL 編碼的路徑](README.html#namespaced-path-encoding) | | `cluster_id` | integer | yes | 集群的 ID | 請求示例: ``` curl --request DELETE --header "Private-Token: <your_access_token>" "https://gitlab.example.com/api/v4/groups/26/clusters/23" ```
                  <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>

                              哎呀哎呀视频在线观看