<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國際加速解決方案。 廣告
                # Packages API > 原文:[https://docs.gitlab.com/ee/api/packages.html](https://docs.gitlab.com/ee/api/packages.html) * [List packages](#list-packages) * [Within a project](#within-a-project) * [Within a group](#within-a-group) * [Get a project package](#get-a-project-package) * [List package files](#list-package-files) * [Delete a project package](#delete-a-project-package) # Packages API[](#packages-api-premium "Permalink") 這是[GitLab 軟件包](../administration/packages/index.html)的 API 文檔. ## List packages[](#list-packages "Permalink") ### Within a project[](#within-a-project "Permalink") 在 GitLab 11.8 中[引入](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/9259) . 獲取項目包列表. 結果中包括所有包裝類型. 在未經身份驗證的情況下訪問時,僅返回公共項目的軟件包. ``` GET /projects/:id/packages ``` | Attribute | Type | Required | Description | | --- | --- | --- | --- | | `id` | integer/string | yes | 項目的 ID 或[URL 編碼的路徑](README.html#namespaced-path-encoding) | | `order_by` | string | no | 用作訂單的字段. `created_at` (默認), `name` , `version`或`type` . | | `sort` | string | no | 順序的方向, `asc` (默認)或`desc` (降序). | | `package_type` | string | no | 按類型過濾返回的軟件包. `conan` , `maven` , `npm` , `pypi` , `composer`或`nuget` . ( *在 GitLab 12.9 中引入* ) | | `package_name` | string | no | 按名稱用模糊搜索過濾項目包. ( *在 GitLab 12.9 中引入* ) | ``` curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/:id/packages" ``` 響應示例: ``` [ { "id": 1, "name": "com/mycompany/my-app", "version": "1.0-SNAPSHOT", "package_type": "maven", "created_at": "2019-11-27T03:37:38.711Z" }, { "id": 2, "name": "@foo/bar", "version": "1.0.3", "package_type": "npm", "created_at": "2019-11-27T03:37:38.711Z" } ] ``` 默認情況下,由于 API 是[分頁的](README.html#pagination) ,因此`GET`請求將返回 20 個結果. ### Within a group[](#within-a-group "Permalink") 在 GitLab 12.5 中[引入](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/18871) . 獲取組級別的項目包列表. 在未經身份驗證的情況下訪問時,僅返回公共項目的軟件包. ``` GET /groups/:id/packages ``` | Attribute | Type | Required | Description | | --- | --- | --- | --- | | `id` | integer/string | yes | [群組的](README.html#namespaced-path-encoding) ID 或[URL 編碼路徑](README.html#namespaced-path-encoding) . | | `exclude_subgroups` | boolean | false | 如果參數包含為 true,則不列出子組中項目的軟件包. 默認值為`false` . | | `order_by` | string | no | 用作訂單的字段. `created_at` (默認), `name` , `version` , `type`或`project_path` . | | `sort` | string | no | 順序的方向, `asc` (默認)或`desc` (降序). | | `package_type` | string | no | 按類型過濾返回的軟件包. `conan` , `maven` , `npm` , `pypi` , `composer`或`nuget` . ( *在 GitLab 12.9 中引入* ) | | `package_name` | string | no | 按名稱用模糊搜索過濾項目包. ( *在 GitLab 13.0 中[引入](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/30980)* ) | ``` curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/groups/:id/packages?exclude_subgroups=true" ``` **棄用:>**的`build_info`在響應屬性贊成不贊成`pipeline` . >引入了[GitLab 12.10](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/28040) . 響應示例: ``` [ { "id": 1, "name": "com/mycompany/my-app", "version": "1.0-SNAPSHOT", "package_type": "maven", "_links": { "web_path": "/namespace1/project1/-/packages/1", "delete_api_path": "/namespace1/project1/-/packages/1" }, "created_at": "2019-11-27T03:37:38.711Z", "pipeline": { "id": 123, "status": "pending", "ref": "new-pipeline", "sha": "a91957a858320c0e17f3a0eca7cfacbff50ea29a", "web_url": "https://example.com/foo/bar/pipelines/47", "created_at": "2016-08-11T11:28:34.085Z", "updated_at": "2016-08-11T11:32:35.169Z", "user": { "name": "Administrator", "avatar_url": "https://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon" } } }, { "id": 2, "name": "@foo/bar", "version": "1.0.3", "package_type": "npm", "_links": { "web_path": "/namespace1/project1/-/packages/1", "delete_api_path": "/namespace1/project1/-/packages/1" }, "created_at": "2019-11-27T03:37:38.711Z", "pipeline": { "id": 123, "status": "pending", "ref": "new-pipeline", "sha": "a91957a858320c0e17f3a0eca7cfacbff50ea29a", "web_url": "https://example.com/foo/bar/pipelines/47", "created_at": "2016-08-11T11:28:34.085Z", "updated_at": "2016-08-11T11:32:35.169Z", "user": { "name": "Administrator", "avatar_url": "https://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon" } } } ] ``` 默認情況下,由于 API 是[分頁的](README.html#pagination) ,因此`GET`請求將返回 20 個結果. `_links`對象包含以下屬性: * `web_path` :您可以在 GitLab 中訪問并查看軟件包詳細信息的路徑. * `delete_api_path` :刪除程序包的 API 路徑. 僅在請求用戶有權執行此操作時可用. ## Get a project package[](#get-a-project-package "Permalink") 在 GitLab 11.9 中[引入](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/9667) . 獲得一個項目包. ``` GET /projects/:id/packages/:package_id ``` | Attribute | Type | Required | Description | | --- | --- | --- | --- | | `id` | integer/string | yes | 項目的 ID 或[URL 編碼路徑](README.html#namespaced-path-encoding) . | | `package_id` | integer | yes | 包裹的 ID. | ``` curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/:id/packages/:package_id" ``` **棄用:>**的`build_info`在響應屬性贊成不贊成`pipeline` . >引入了[GitLab 12.10](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/28040) . Example response: ``` { "id": 1, "name": "com/mycompany/my-app", "version": "1.0-SNAPSHOT", "package_type": "maven", "_links": { "web_path": "/namespace1/project1/-/packages/1", "delete_api_path": "/namespace1/project1/-/packages/1" }, "created_at": "2019-11-27T03:37:38.711Z", "pipeline": { "id": 123, "status": "pending", "ref": "new-pipeline", "sha": "a91957a858320c0e17f3a0eca7cfacbff50ea29a", "web_url": "https://example.com/foo/bar/pipelines/47", "created_at": "2016-08-11T11:28:34.085Z", "updated_at": "2016-08-11T11:32:35.169Z", "user": { "name": "Administrator", "avatar_url": "https://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon" } }, "versions": [ { "id":2, "version":"2.0-SNAPSHOT", "created_at":"2020-04-28T04:42:11.573Z", "pipeline": { "id": 234, "status": "pending", "ref": "new-pipeline", "sha": "a91957a858320c0e17f3a0eca7cfacbff50ea29a", "web_url": "https://example.com/foo/bar/pipelines/58", "created_at": "2016-08-11T11:28:34.085Z", "updated_at": "2016-08-11T11:32:35.169Z", "user": { "name": "Administrator", "avatar_url": "https://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon" } } } ] } ``` `_links`對象包含以下屬性: * `web_path` :您可以在 GitLab 中訪問并查看軟件包詳細信息的路徑. * `delete_api_path` :刪除程序包的 API 路徑. 僅在請求用戶有權執行此操作時可用. ## List package files[](#list-package-files "Permalink") 在 GitLab 11.8 中[引入](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/9305) . 獲取單個軟件包的軟件包文件列表. ``` GET /projects/:id/packages/:package_id/package_files ``` | Attribute | Type | Required | Description | | --- | --- | --- | --- | | `id` | integer/string | yes | 項目的 ID 或[URL 編碼的路徑](README.html#namespaced-path-encoding) | | `package_id` | integer | yes | 包裹的 ID. | ``` curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/1/packages/4/package_files" ``` 響應示例: ``` [ { "id": 25, "package_id": 4, "created_at": "2018-11-07T15:25:52.199Z", "file_name": "my-app-1.5-20181107.152550-1.jar", "size": 2421, "file_md5": "58e6a45a629910c6ff99145a688971ac", "file_sha1": "ebd193463d3915d7e22219f52740056dfd26cbfe" }, { "id": 26, "package_id": 4, "created_at": "2018-11-07T15:25:56.776Z", "file_name": "my-app-1.5-20181107.152550-1.pom", "size": 1122, "file_md5": "d90f11d851e17c5513586b4a7e98f1b2", "file_sha1": "9608d068fe88aff85781811a42f32d97feb440b5" }, { "id": 27, "package_id": 4, "created_at": "2018-11-07T15:26:00.556Z", "file_name": "maven-metadata.xml", "size": 767, "file_md5": "6dfd0cce1203145a927fef5e3a1c650c", "file_sha1": "d25932de56052d320a8ac156f745ece73f6a8cd2" } ] ``` 默認情況下,由于 API 是[分頁的](README.html#pagination) ,因此`GET`請求將返回 20 個結果. ## Delete a project package[](#delete-a-project-package "Permalink") 在 GitLab 11.9 中[引入](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/9623) . 刪除項目包. ``` DELETE /projects/:id/packages/:package_id ``` | Attribute | Type | Required | Description | | --- | --- | --- | --- | | `id` | integer/string | yes | 項目的 ID 或[URL 編碼的路徑](README.html#namespaced-path-encoding) | | `package_id` | integer | yes | 包裹的 ID. | ``` curl --request DELETE --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/:id/packages/:package_id" ``` 可以返回以下狀態碼: * `204 No Content` ,如果軟件包已成功刪除. * `404 Not Found` ,如果`404 Not Found`包.
                  <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>

                              哎呀哎呀视频在线观看