<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之旅 廣告
                # Container Registry API > 原文:[https://docs.gitlab.com/ee/api/container_registry.html](https://docs.gitlab.com/ee/api/container_registry.html) * [List registry repositories](#list-registry-repositories) * [Within a project](#within-a-project) * [Within a group](#within-a-group) * [Delete registry repository](#delete-registry-repository) * [List registry repository tags](#list-registry-repository-tags) * [Within a project](#within-a-project-1) * [Get details of a registry repository tag](#get-details-of-a-registry-repository-tag) * [Delete a registry repository tag](#delete-a-registry-repository-tag) * [Delete registry repository tags in bulk](#delete-registry-repository-tags-in-bulk) # Container Registry API[](#container-registry-api "Permalink") 在 GitLab 11.8 中[引入](https://gitlab.com/gitlab-org/gitlab-foss/-/issues/55978) . 這是[GitLab 容器注冊表](../user/packages/container_registry/index.html)的 API 文檔. ## List registry repositories[](#list-registry-repositories "Permalink") ### Within a project[](#within-a-project "Permalink") 獲取項目中的注冊表存儲庫列表. ``` GET /projects/:id/registry/repositories ``` | Attribute | Type | Required | Description | | --- | --- | --- | --- | | `id` | integer/string | yes | 經過身份驗證的用戶可以訪問[的項目](README.html#namespaced-path-encoding)的 ID 或[URL 編碼路徑](README.html#namespaced-path-encoding) . | | `tags` | boolean | no | 如果參數包含為 true,則每個存儲庫在響應中都將包含一個`"tags"`數組. | | `name` | string | no | 返回名稱與值匹配的存儲庫列表. (在 GitLab 13.0 中[引入](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/29763) ). | | `tags_count` | boolean | no | 如果參數包含為 true,則每個存儲庫的響應中都將包含`"tags_count"` (在 GitLab 13.1 中[引入](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/32141) ). | ``` curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/5/registry/repositories" ``` 響應示例: ``` [ { "id": 1, "name": "", "path": "group/project", "project_id": 9, "location": "gitlab.example.com:5000/group/project", "created_at": "2019-01-10T13:38:57.391Z" }, { "id": 2, "name": "releases", "path": "group/project/releases", "project_id": 9, "location": "gitlab.example.com:5000/group/project/releases", "created_at": "2019-01-10T13:39:08.229Z" } ] ``` ### Within a group[](#within-a-group "Permalink") 獲取組中的注冊表存儲庫列表. ``` GET /groups/:id/registry/repositories ``` | Attribute | Type | Required | Description | | --- | --- | --- | --- | | `id` | integer/string | yes | 經過身份驗證的用戶可以訪問[的組](README.html#namespaced-path-encoding)的 ID 或[URL 編碼路徑](README.html#namespaced-path-encoding) . | | `tags` | boolean | no | 如果參數包含為 true,則每個存儲庫在響應中都將包含一個`"tags"`數組. | | `name` | string | no | 返回名稱與值匹配的存儲庫列表. (在 GitLab 13.0 中[引入](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/29763) ). | | `tags_count` | boolean | no | 如果參數包含為 true,則每個存儲庫的響應中都將包含`"tags_count"` (在 GitLab 13.1 中[引入](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/32141) ). | ``` curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/groups/2/registry/repositories?tags=1&tags_count=true" ``` 響應示例: ``` [ { "id": 1, "name": "", "path": "group/project", "project_id": 9, "location": "gitlab.example.com:5000/group/project", "created_at": "2019-01-10T13:38:57.391Z", "tags_count": 1, "tags": [ { "name": "0.0.1", "path": "group/project:0.0.1", "location": "gitlab.example.com:5000/group/project:0.0.1" } ] }, { "id": 2, "name": "", "path": "group/other_project", "project_id": 11, "location": "gitlab.example.com:5000/group/other_project", "created_at": "2019-01-10T13:39:08.229Z", "tags_count": 3, "tags": [ { "name": "0.0.1", "path": "group/other_project:0.0.1", "location": "gitlab.example.com:5000/group/other_project:0.0.1" }, { "name": "0.0.2", "path": "group/other_project:0.0.2", "location": "gitlab.example.com:5000/group/other_project:0.0.2" }, { "name": "latest", "path": "group/other_project:latest", "location": "gitlab.example.com:5000/group/other_project:latest" } ] } ] ``` ## Delete registry repository[](#delete-registry-repository "Permalink") 刪除注冊表中的存儲庫. 該操作是異步執行的,可能要花一些時間才能執行. ``` DELETE /projects/:id/registry/repositories/:repository_id ``` | Attribute | Type | Required | Description | | --- | --- | --- | --- | | `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.html#namespaced-path-encoding) owned by the authenticated user. | | `repository_id` | integer | yes | 注冊表存儲庫的標識. | ``` curl --request DELETE --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/5/registry/repositories/2" ``` ## List registry repository tags[](#list-registry-repository-tags "Permalink") ### Within a project[](#within-a-project-1 "Permalink") 獲取給定注冊表存儲庫的標簽列表. ``` GET /projects/:id/registry/repositories/:repository_id/tags ``` | Attribute | Type | Required | Description | | --- | --- | --- | --- | | `id` | integer/string | yes | 經過身份驗證的用戶可以訪問[的項目](README.html#namespaced-path-encoding)的 ID 或[URL 編碼路徑](README.html#namespaced-path-encoding) . | | `repository_id` | integer | yes | 注冊表存儲庫的標識. | ``` curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/5/registry/repositories/2/tags" ``` 響應示例: ``` [ { "name": "A", "path": "group/project:A", "location": "gitlab.example.com:5000/group/project:A" }, { "name": "latest", "path": "group/project:latest", "location": "gitlab.example.com:5000/group/project:latest" } ] ``` ## Get details of a registry repository tag[](#get-details-of-a-registry-repository-tag "Permalink") 獲取注冊表存儲庫標簽的詳細信息. ``` GET /projects/:id/registry/repositories/:repository_id/tags/:tag_name ``` | Attribute | Type | Required | Description | | --- | --- | --- | --- | | `id` | integer/string | yes | 經過身份驗證的用戶可以訪問[的項目](README.html#namespaced-path-encoding)的 ID 或[URL 編碼路徑](README.html#namespaced-path-encoding) . | | `repository_id` | integer | yes | 注冊表存儲庫的標識. | | `tag_name` | string | yes | 標簽名稱. | ``` curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/5/registry/repositories/2/tags/v10.0.0" ``` 響應示例: ``` { "name": "v10.0.0", "path": "group/project:latest", "location": "gitlab.example.com:5000/group/project:latest", "revision": "e9ed9d87c881d8c2fd3a31b41904d01ba0b836e7fd15240d774d811a1c248181", "short_revision": "e9ed9d87c", "digest": "sha256:c3490dcf10ffb6530c1303522a1405dfaf7daecd8f38d3e6a1ba19ea1f8a1751", "created_at": "2019-01-06T16:49:51.272+00:00", "total_size": 350224384 } ``` ## Delete a registry repository tag[](#delete-a-registry-repository-tag "Permalink") 刪除注冊表存儲庫標記. ``` DELETE /projects/:id/registry/repositories/:repository_id/tags/:tag_name ``` | Attribute | Type | Required | Description | | --- | --- | --- | --- | | `id` | integer/string | yes | 認證用戶擁有[的項目](README.html#namespaced-path-encoding)的 ID 或[URL 編碼路徑](README.html#namespaced-path-encoding) . | | `repository_id` | integer | yes | 注冊表存儲庫的標識. | | `tag_name` | string | yes | 標簽名稱. | ``` curl --request DELETE --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/5/registry/repositories/2/tags/v10.0.0" ``` 此操作不會刪除 Blob. 為了刪除它們并回收磁盤空間,請[運行垃圾回收](https://docs.gitlab.com/omnibus/maintenance/README.html) . ## Delete registry repository tags in bulk[](#delete-registry-repository-tags-in-bulk "Permalink") 根據給定的標準批量刪除注冊表存儲庫標簽. 有關概述,請參閱[利用 Container Registry API 刪除除*之外的所有標簽](https://youtu.be/Hi19bKe_xsg) . ``` DELETE /projects/:id/registry/repositories/:repository_id/tags ``` | Attribute | Type | Required | Description | | --- | --- | --- | --- | | `id` | integer/string | yes | 認證用戶擁有[的項目](README.html#namespaced-path-encoding)的 ID 或[URL 編碼路徑](README.html#namespaced-path-encoding) . | | `repository_id` | integer | yes | 注冊表存儲庫的標識. | | `name_regex` | string | no | 要刪除的名稱的[re2](https://github.com/google/re2/wiki/Syntax)正則表達式. 要刪除所有標簽,請指定`.*` . **注意:**不建議使用`name_regex`而建議使用`name_regex_delete` . 此字段已驗證. | | `name_regex_delete` | string | yes | 要刪除的名稱的[re2](https://github.com/google/re2/wiki/Syntax)正則表達式. 要刪除所有標簽,請指定`.*` . 此字段已驗證. | | `name_regex_keep` | string | no | 要保留名稱的[re2](https://github.com/google/re2/wiki/Syntax)正則表達式. 此值將覆蓋`name_regex_delete`所有匹配`name_regex_delete` . 此字段已驗證. 注意:設置為`.*`將導致無操作. | | `keep_n` | integer | no | 要保留的給定名稱的最新標簽的數量. | | `older_than` | string | no | 早于給定時間的要刪除的標簽,以人類可讀的格式`1h` , `1d` , `1month`編寫. | 此 API 調用執行以下操作: 1. 它按創建日期排序所有標簽. 創建日期是清單創建的時間,而不是標簽推送的時間. 2. 它僅刪除與給定`name_regex_delete` (或不`name_regex`使用的`name_regex` )匹配的標簽,并保留所有與`name_regex_keep`匹配的`name_regex_keep` . 3. 它絕不會取消對標簽命名`latest` . 4. 它保留 N 個最新的匹配標簽(如果指定了`keep_n` ). 5. 它僅刪除時間超過 X 時間的標簽(如果指定了`older_than` ). 6. 它安排異步作業在后臺執行. 這些操作是異步執行的,可能要花一些時間才能執行. 對于給定的容器存儲庫,您最多可以每小時運行一次. 此操作不會刪除 Blob. 為了刪除它們并回收磁盤空間,請[運行垃圾回收](https://docs.gitlab.com/omnibus/maintenance/README.html) . **注意:**從 GitLab 12.4 開始,將刪除各個標簽. 有關更多詳細信息,請參見[討論](https://gitlab.com/gitlab-org/gitlab/-/issues/15737) . Examples: 1. 刪除與正則表達式(Git SHA)匹配的標記名,始終至少保留 5 個,并刪除 2 天以上的標記名: ``` curl --request DELETE --data 'name_regex_delete=[0-9a-z]{40}' --data 'keep_n=5' --data 'older_than=2d' --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/5/registry/repositories/2/tags" ``` 2. 刪除所有標簽,但始終保留最新的 5 個標簽: ``` curl --request DELETE --data 'name_regex_delete=.*' --data 'keep_n=5' --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/5/registry/repositories/2/tags" ``` 3. 刪除所有標簽,但始終保留以`stable`開頭的標簽: ``` curl --request DELETE --data 'name_regex_delete=.*' --data 'name_regex_keep=stable.*' --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/5/registry/repositories/2/tags" ``` 4. 刪除所有超過 1 個月的標簽: ``` curl --request DELETE --data 'name_regex_delete=.*' --data 'older_than=1month' --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/5/registry/repositories/2/tags" ```
                  <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>

                              哎呀哎呀视频在线观看