Add API to support link package to repository and unlink it (#33481)

Fix #21062

---------

Co-authored-by: Zettat123 <zettat123@gmail.com>
This commit is contained in:
Lunny Xiao 2025-02-16 19:18:00 -08:00 committed by GitHub
parent 50a5d6bf5d
commit 5df9fd3e9c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 337 additions and 15 deletions

View file

@ -3339,6 +3339,93 @@
}
}
},
"/packages/{owner}/{type}/{name}/-/link/{repo_name}": {
"post": {
"tags": [
"package"
],
"summary": "Link a package to a repository",
"operationId": "linkPackage",
"parameters": [
{
"type": "string",
"description": "owner of the package",
"name": "owner",
"in": "path",
"required": true
},
{
"type": "string",
"description": "type of the package",
"name": "type",
"in": "path",
"required": true
},
{
"type": "string",
"description": "name of the package",
"name": "name",
"in": "path",
"required": true
},
{
"type": "string",
"description": "name of the repository to link.",
"name": "repo_name",
"in": "path",
"required": true
}
],
"responses": {
"201": {
"$ref": "#/responses/empty"
},
"404": {
"$ref": "#/responses/notFound"
}
}
}
},
"/packages/{owner}/{type}/{name}/-/unlink": {
"post": {
"tags": [
"package"
],
"summary": "Unlink a package from a repository",
"operationId": "unlinkPackage",
"parameters": [
{
"type": "string",
"description": "owner of the package",
"name": "owner",
"in": "path",
"required": true
},
{
"type": "string",
"description": "type of the package",
"name": "type",
"in": "path",
"required": true
},
{
"type": "string",
"description": "name of the package",
"name": "name",
"in": "path",
"required": true
}
],
"responses": {
"201": {
"$ref": "#/responses/empty"
},
"404": {
"$ref": "#/responses/notFound"
}
}
}
},
"/packages/{owner}/{type}/{name}/{version}": {
"get": {
"produces": [