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

                合規國際互聯網加速 OSASE為企業客戶提供高速穩定SD-WAN國際加速解決方案。 廣告
                # Group badges API > 原文:[https://docs.gitlab.com/ee/api/group_badges.html](https://docs.gitlab.com/ee/api/group_badges.html) * [Placeholder tokens](#placeholder-tokens) * [List all badges of a group](#list-all-badges-of-a-group) * [Get a badge of a group](#get-a-badge-of-a-group) * [Add a badge to a group](#add-a-badge-to-a-group) * [Edit a badge of a group](#edit-a-badge-of-a-group) * [Remove a badge from a group](#remove-a-badge-from-a-group) * [Preview a badge from a group](#preview-a-badge-from-a-group) # Group badges API[](#group-badges-api "Permalink") 在 GitLab 10.6 中[引入](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/17082) . ## Placeholder tokens[](#placeholder-tokens "Permalink") 徽章支持占位符,這些占位符將在鏈接和圖像 URL 中被實時替換. 允許的占位符為: * **%{project_path}** :將被項目路徑替換. * **%{project_id}** :將被項目 ID 取代. * **%{default_branch}** :將被項目默認分支替換. * **%{commit_sha}** :將由上一個項目的提交 SHA 替換. 由于這些端點不在項目上下文中,因此用于替換占位符的信息將在創建日期之前來自第一組項目. 如果該組沒有任何項目,則將返回帶有占位符的原始 URL. ## List all badges of a group[](#list-all-badges-of-a-group "Permalink") 獲取小組徽章的列表. ``` GET /groups/:id/badges ``` | Attribute | Type | Required | Description | | --- | --- | --- | --- | | `id` | integer/string | yes | 認證用戶擁有[的組](README.html#namespaced-path-encoding)的 ID 或[URL 編碼路徑](README.html#namespaced-path-encoding) | | `name` | string | no | 要返回的徽章名稱(區分大小寫). | ``` curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/groups/:id/badges?name=Coverage" ``` 響應示例: ``` [ { "name": "Coverage", "id": 1, "link_url": "http://example.com/ci_status.svg?project=%{project_path}&ref=%{default_branch}", "image_url": "https://shields.io/my/badge", "rendered_link_url": "http://example.com/ci_status.svg?project=example-org/example-project&ref=master", "rendered_image_url": "https://shields.io/my/badge", "kind": "group" } ] ``` ## Get a badge of a group[](#get-a-badge-of-a-group "Permalink") 獲取組的徽章. ``` GET /groups/:id/badges/:badge_id ``` | Attribute | Type | Required | Description | | --- | --- | --- | --- | | `id` | integer/string | yes | 認證用戶擁有[的組](README.html#namespaced-path-encoding)的 ID 或[URL 編碼路徑](README.html#namespaced-path-encoding) | | `badge_id` | integer | yes | 徽章 ID | ``` curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/groups/:id/badges/:badge_id" ``` 響應示例: ``` { "id": 1, "link_url": "http://example.com/ci_status.svg?project=%{project_path}&ref=%{default_branch}", "image_url": "https://shields.io/my/badge", "rendered_link_url": "http://example.com/ci_status.svg?project=example-org/example-project&ref=master", "rendered_image_url": "https://shields.io/my/badge", "kind": "group" } ``` ## Add a badge to a group[](#add-a-badge-to-a-group "Permalink") 將徽章添加到組. ``` POST /groups/:id/badges ``` | Attribute | Type | Required | Description | | --- | --- | --- | --- | | `id` | integer/string | yes | 認證用戶擁有[的組](README.html#namespaced-path-encoding)的 ID 或[URL 編碼路徑](README.html#namespaced-path-encoding) | | `link_url` | string | yes | 徽章鏈接的 URL | | `image_url` | string | yes | 徽章圖片的網址 | ``` curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" --data "link_url=https://gitlab.com/gitlab-org/gitlab-foss/commits/master&image_url=https://shields.io/my/badge1&position=0" "https://gitlab.example.com/api/v4/groups/:id/badges" ``` 響應示例: ``` { "id": 1, "link_url": "https://gitlab.com/gitlab-org/gitlab-foss/commits/master", "image_url": "https://shields.io/my/badge1", "rendered_link_url": "https://gitlab.com/gitlab-org/gitlab-foss/commits/master", "rendered_image_url": "https://shields.io/my/badge1", "kind": "group" } ``` ## Edit a badge of a group[](#edit-a-badge-of-a-group "Permalink") Updates a badge of a group. ``` PUT /groups/:id/badges/:badge_id ``` | Attribute | Type | Required | Description | | --- | --- | --- | --- | | `id` | integer/string | yes | 認證用戶擁有[的組](README.html#namespaced-path-encoding)的 ID 或[URL 編碼路徑](README.html#namespaced-path-encoding) | | `badge_id` | integer | yes | 徽章 ID | | `link_url` | string | no | 徽章鏈接的 URL | | `image_url` | string | no | 徽章圖片的網址 | ``` curl --request PUT --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/groups/:id/badges/:badge_id" ``` 響應示例: ``` { "id": 1, "link_url": "https://gitlab.com/gitlab-org/gitlab-foss/commits/master", "image_url": "https://shields.io/my/badge", "rendered_link_url": "https://gitlab.com/gitlab-org/gitlab-foss/commits/master", "rendered_image_url": "https://shields.io/my/badge", "kind": "group" } ``` ## Remove a badge from a group[](#remove-a-badge-from-a-group "Permalink") 從組中刪除徽章. ``` DELETE /groups/:id/badges/:badge_id ``` | Attribute | Type | Required | Description | | --- | --- | --- | --- | | `id` | integer/string | yes | 認證用戶擁有[的組](README.html#namespaced-path-encoding)的 ID 或[URL 編碼路徑](README.html#namespaced-path-encoding) | | `badge_id` | integer | yes | 徽章 ID | ``` curl --request DELETE --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/groups/:id/badges/:badge_id" ``` ## Preview a badge from a group[](#preview-a-badge-from-a-group "Permalink") 返回解析占位符插值后的`link_url`和`image_url`最終 URL. ``` GET /groups/:id/badges/render ``` | Attribute | Type | Required | Description | | --- | --- | --- | --- | | `id` | integer/string | yes | 認證用戶擁有[的組](README.html#namespaced-path-encoding)的 ID 或[URL 編碼路徑](README.html#namespaced-path-encoding) | | `link_url` | string | yes | 徽章鏈接的 URL | | `image_url` | string | yes | 徽章圖片的網址 | ``` curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/groups/:id/badges/render?link_url=http%3A%2F%2Fexample.com%2Fci_status.svg%3Fproject%3D%25%7Bproject_path%7D%26ref%3D%25%7Bdefault_branch%7D&image_url=https%3A%2F%2Fshields.io%2Fmy%2Fbadge" ``` 響應示例: ``` { "link_url": "http://example.com/ci_status.svg?project=%{project_path}&ref=%{default_branch}", "image_url": "https://shields.io/my/badge", "rendered_link_url": "http://example.com/ci_status.svg?project=example-org/example-project&ref=master", "rendered_image_url": "https://shields.io/my/badge", } ```
                  <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>

                              哎呀哎呀视频在线观看