Debian 项目分发 API
- Tier: 基础版, 专业版, 旗舰版
- Offering: 私有化部署
History
- Deployed behind a feature flag, disabled by default.
这是 Debian 项目分发 API 的参考文档。该 API 位于一个默认禁用的功能标志后面。要使用此 API,您必须启用 Debian API。
此 API 处于开发阶段,不适合生产使用。
有关使用 Debian 软件包的更多信息,请参阅Debian 软件包注册表文档。
启用 Debian API
Debian API 位于一个默认禁用的功能标志后面。具有访问极狐GitLab Rails 控制台权限的极狐GitLab 管理员可以选择启用它。要启用它,请按照启用 Debian API中的说明进行操作。
认证到 Debian 分发 API
列出项目中的所有 Debian 分发
列出给定项目中的 Debian 分发。
plaintextGET /projects/:id/debian_distributions
| 属性 | 类型 | 是否必需 | 描述 |
|---|---|---|---|
| id | integer/string | 是 | 项目 ID 或项目的 URL 编码路径。 |
| codename | string | 否 | 使用特定的 codename 进行过滤。 |
| suite | string | 否 | 使用特定的 suite 进行过滤。 |
shellcurl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/5/debian_distributions"
示例响应:
json1[ 2 { 3 "id": 1, 4 "codename": "sid", 5 "suite": null, 6 "origin": null, 7 "label": null, 8 "version": null, 9 "description": null, 10 "valid_time_duration_seconds": null, 11 "components": [ 12 "main" 13 ], 14 "architectures": [ 15 "all", 16 "amd64" 17 ] 18 } 19]
单个 Debian 项目分发
获取单个 Debian 项目分发。
plaintextGET /projects/:id/debian_distributions/:codename
| 属性 | 类型 | 是否必需 | 描述 |
|---|---|---|---|
| id | integer/string | 是 | 项目 ID 或项目的 URL 编码路径。 |
| codename | string | 是 | 分发的 codename。 |
shellcurl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/5/debian_distributions/unstable"
示例响应:
json1{ 2 "id": 1, 3 "codename": "sid", 4 "suite": null, 5 "origin": null, 6 "label": null, 7 "version": null, 8 "description": null, 9 "valid_time_duration_seconds": null, 10 "components": [ 11 "main" 12 ], 13 "architectures": [ 14 "all", 15 "amd64" 16 ] 17}
单个 Debian 项目分发密钥
获取单个 Debian 项目分发密钥。
plaintextGET /projects/:id/debian_distributions/:codename/key.asc
| 属性 | 类型 | 是否必需 | 描述 |
|---|---|---|---|
| id | integer/string | 是 | 项目 ID 或项目的 URL 编码路径。 |
| codename | string | 是 | 分发的 codename。 |
shellcurl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/5/debian_distributions/unstable/key.asc"
示例响应:
plaintext1-----BEGIN PGP PUBLIC KEY BLOCK----- 2Comment: Alice's OpenPGP certificate 3Comment: https://www.ietf.org/id/draft-bre-openpgp-samples-01.html 4 5mDMEXEcE6RYJKwYBBAHaRw8BAQdArjWwk3FAqyiFbFBKT4TzXcVBqPTB3gmzlC/U 6b7O1u120JkFsaWNlIExvdmVsYWNlIDxhbGljZUBvcGVucGdwLmV4YW1wbGU+iJAE 7ExYIADgCGwMFCwkIBwIGFQoJCAsCBBYCAwECHgECF4AWIQTrhbtfozp14V6UTmPy 8MVUMT0fjjgUCXaWfOgAKCRDyMVUMT0fjjukrAPoDnHBSogOmsHOsd9qGsiZpgRnO 9dypvbm+QtXZqth9rvwD9HcDC0tC+PHAsO7OTh1S1TC9RiJsvawAfCPaQZoed8gK4 10OARcRwTpEgorBgEEAZdVAQUBAQdAQv8GIa2rSTzgqbXCpDDYMiKRVitCsy203x3s 11E9+eviIDAQgHiHgEGBYIACAWIQTrhbtfozp14V6UTmPyMVUMT0fjjgUCXEcE6QIb 12DAAKCRDyMVUMT0fjjlnQAQDFHUs6TIcxrNTtEZFjUFm1M0PJ1Dng/cDW4xN80fsn 130QEA22Kr7VkCjeAEC08VSTeV+QFsmz55/lntWkwYWhmvOgE= 14=iIGO 15-----END PGP PUBLIC KEY BLOCK-----
创建 Debian 项目分发
创建 Debian 项目分发。
plaintextPOST /projects/:id/debian_distributions
| 属性 | 类型 | 是否必需 | 描述 |
|---|---|---|---|
| id | integer/string | 是 | 项目 ID 或项目的 URL 编码路径。 |
| codename | string | 是 | Debian 分发的代号。 |
| suite | string | 否 | 新的 Debian 分发的套件。 |
| origin | string | 否 | 新的 Debian 分发的来源。 |
| label | string | 否 | 新的 Debian 分发的标签。 |
| version | string | 否 | 新的 Debian 分发的版本。 |
| description | string | 否 | 新的 Debian 分发的描述。 |
| valid_time_duration_seconds | integer | 否 | 新的 Debian 分发的有效时间(以秒为单位)。 |
| components | string array | 否 | 新的 Debian 分发的组件列表。 |
| architectures | string array | 否 | 新的 Debian 分发的架构列表。 |
shellcurl --request POST --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/5/debian_distributions?codename=sid"
示例响应:
json1{ 2 "id": 1, 3 "codename": "sid", 4 "suite": null, 5 "origin": null, 6 "label": null, 7 "version": null, 8 "description": null, 9 "valid_time_duration_seconds": null, 10 "components": [ 11 "main" 12 ], 13 "architectures": [ 14 "all", 15 "amd64" 16 ] 17}
更新 Debian 项目分发
更新 Debian 项目分发。
plaintextPUT /projects/:id/debian_distributions/:codename
| 属性 | 类型 | 是否必需 | 描述 |
|---|---|---|---|
| id | integer/string | 是 | 项目 ID 或项目的 URL 编码路径。 |
| codename | string | 是 | Debian 分发的代号。 |
| suite | string | 否 | Debian 分发的新套件。 |
| origin | string | 否 | Debian 分发的新来源。 |
| label | string | 否 | Debian 分发的新标签。 |
| version | string | 否 | Debian 分发的新版本。 |
| description | string | 否 | Debian 分发的新描述。 |
| valid_time_duration_seconds | integer | 否 | Debian 分发的新有效时间(以秒为单位)。 |
| components | string array | 否 | Debian 分发的新组件列表。 |
| architectures | string array | 否 | Debian 分发的新架构列表。 |
shellcurl --request PUT --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/5/debian_distributions/unstable?suite=new-suite&valid_time_duration_seconds=604800"
示例响应:
json1{ 2 "id": 1, 3 "codename": "sid", 4 "suite": "new-suite", 5 "origin": null, 6 "label": null, 7 "version": null, 8 "description": null, 9 "valid_time_duration_seconds": 604800, 10 "components": [ 11 "main" 12 ], 13 "architectures": [ 14 "all", 15 "amd64" 16 ] 17}
删除 Debian 项目分发
删除 Debian 项目分发。
plaintextDELETE /projects/:id/debian_distributions/:codename
| 属性 | 类型 | 是否必需 | 描述 |
|---|---|---|---|
| id | integer/string | 是 | 项目 ID 或项目的 URL 编码路径。 |
| codename | string | 是 | Debian 分发的代号。 |
shellcurl --request DELETE --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/5/debian_distributions/unstable"