Points de terminaison d’API REST pour les packages
Utilisez l’API REST pour interagir avec GitHub Packages.
À propos de GitHub Packages
GitHub Packages prend en charge une plage de gestionnaires de packages pour la publication de packages. Pour plus d’informations, consultez « Introduction aux packages GitHub ».
Après publication d’un package, vous pouvez utiliser l’API REST pour gérer les packages dans vos référentiels et organisations GitHub. Pour plus d’informations, consultez « Suppression et restauration d'un package ».
Pour utiliser l’API REST afin de gérer GitHub Packages, vous devez vous authentifier avec un personal access token (classic).
- Pour accéder aux métadonnées de package, votre jeton doit avoir l’étendue
read:packages
. - Pour supprimer des packages et des versions de package, votre jeton doit avoir les étendues
read:packages
etdelete:packages
. - Pour restaurer des packages et des versions de package, votre jeton doit avoir les étendues
read:packages
etwrite:packages
.
Si votre package se trouve dans un registre qui prend en charge les autorisations granulaires, votre jeton n’a pas besoin de l’étendue repo
pour accéder ou gérer ce package. Si votre package se trouve dans un registre qui prend en charge uniquement les autorisations limitées au dépôt, votre jeton doit aussi inclure l’étendue repo
dans la mesure où votre package hérite des autorisations d’un dépôt GitHub. Pour obtenir la liste des registres qui prennent en charge uniquement les autorisations limitées au référentiel, consultez À propos des autorisations pour les packages GitHub.
Get list of conflicting packages during Docker migration for organization
Lists all packages that are in a specific organization, are readable by the requesting user, and that encountered a conflict during a Docker migration.
OAuth app tokens and personal access tokens (classic) need the read:packages
scope to use this endpoint.
Jetons d’accès affinés pour « Get list of conflicting packages during Docker migration for organization »
Ce point de terminaison fonctionne avec les types de jetons précis suivants:
- Jetons d’accès utilisateur d’application GitHub
- Jetons d’accès d’installation d’application GitHub
- Jetons d’accès personnel affiné
Le jeton précis ne nécessite aucune autorisation.
Ce point de terminaison peut être utilisé sans authentification ou si seules les ressources publiques sont demandées.
Paramètres pour « Get list of conflicting packages during Docker migration for organization »
Nom, Type, Description |
---|
accept string Setting to |
Nom, Type, Description |
---|
org string ObligatoireThe organization name. The name is not case sensitive. |
Codes d’état de la réponse HTTP pour « Get list of conflicting packages during Docker migration for organization »
Code d’état | Description |
---|---|
200 | OK |
401 | Requires authentication |
403 | Forbidden |
Exemples de code pour « Get list of conflicting packages during Docker migration for organization »
Exemple de requête
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
http(s)://HOSTNAME/api/v3/orgs/ORG/docker/conflicts
Response
Status: 200
[
{
"id": 197,
"name": "hello_docker",
"package_type": "container",
"owner": {
"login": "github",
"id": 9919,
"node_id": "MDEyOk9yZ2FuaXphdGlvbjk5MTk=",
"avatar_url": "https://avatars.githubusercontent.com/u/9919?v=4",
"gravatar_id": "",
"url": "https://HOSTNAME/users/github",
"html_url": "https://github.com/github",
"followers_url": "https://HOSTNAME/users/github/followers",
"following_url": "https://HOSTNAME/users/github/following{/other_user}",
"gists_url": "https://HOSTNAME/users/github/gists{/gist_id}",
"starred_url": "https://HOSTNAME/users/github/starred{/owner}{/repo}",
"subscriptions_url": "https://HOSTNAME/users/github/subscriptions",
"organizations_url": "https://HOSTNAME/users/github/orgs",
"repos_url": "https://HOSTNAME/users/github/repos",
"events_url": "https://HOSTNAME/users/github/events{/privacy}",
"received_events_url": "https://HOSTNAME/users/github/received_events",
"type": "Organization",
"site_admin": false
},
"version_count": 1,
"visibility": "private",
"url": "https://HOSTNAME/orgs/github/packages/container/hello_docker",
"created_at": "2020-05-19T22:19:11Z",
"updated_at": "2020-05-19T22:19:11Z",
"html_url": "https://github.com/orgs/github/packages/container/package/hello_docker"
},
{
"id": 198,
"name": "goodbye_docker",
"package_type": "container",
"owner": {
"login": "github",
"id": 9919,
"node_id": "MDEyOk9yZ2FuaXphdGlvbjk5MTk=",
"avatar_url": "https://avatars.githubusercontent.com/u/9919?v=4",
"gravatar_id": "",
"url": "https://HOSTNAME/users/github",
"html_url": "https://github.com/github",
"followers_url": "https://HOSTNAME/users/github/followers",
"following_url": "https://HOSTNAME/users/github/following{/other_user}",
"gists_url": "https://HOSTNAME/users/github/gists{/gist_id}",
"starred_url": "https://HOSTNAME/users/github/starred{/owner}{/repo}",
"subscriptions_url": "https://HOSTNAME/users/github/subscriptions",
"organizations_url": "https://HOSTNAME/users/github/orgs",
"repos_url": "https://HOSTNAME/users/github/repos",
"events_url": "https://HOSTNAME/users/github/events{/privacy}",
"received_events_url": "https://HOSTNAME/users/github/received_events",
"type": "Organization",
"site_admin": false
},
"version_count": 2,
"visibility": "private",
"url": "https://HOSTNAME/orgs/github/packages/container/goodbye_docker",
"created_at": "2020-05-20T22:19:11Z",
"updated_at": "2020-05-20T22:19:11Z",
"html_url": "https://github.com/orgs/github/packages/container/package/goodbye_docker"
}
]
List packages for an organization
Lists packages in an organization readable by the user.
OAuth app tokens and personal access tokens (classic) need the read:packages
scope to use this endpoint. For more information, see "About permissions for GitHub Packages."
Jetons d’accès affinés pour « List packages for an organization »
Ce point de terminaison fonctionne avec les types de jetons précis suivants:
Le jeton précis ne nécessite aucune autorisation.
Paramètres pour « List packages for an organization »
Nom, Type, Description |
---|
accept string Setting to |
Nom, Type, Description |
---|
org string ObligatoireThe organization name. The name is not case sensitive. |
Nom, Type, Description |
---|
package_type string ObligatoireThe type of supported package. Packages in GitHub's Gradle registry have the type Peut être: |
visibility string The selected visibility of the packages. This parameter is optional and only filters an existing result set. The Peut être: |
page integer The page number of the results to fetch. For more information, see "Using pagination in the REST API." Default: |
per_page integer The number of results per page (max 100). For more information, see "Using pagination in the REST API." Default: |
Codes d’état de la réponse HTTP pour « List packages for an organization »
Code d’état | Description |
---|---|
200 | OK |
400 | The value of |
401 | Requires authentication |
403 | Forbidden |
Exemples de code pour « List packages for an organization »
Exemple de requête
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
"http(s)://HOSTNAME/api/v3/orgs/ORG/packages?package_type=container"
Response
Status: 200
[
{
"id": 197,
"name": "hello_docker",
"package_type": "container",
"owner": {
"login": "github",
"id": 9919,
"node_id": "MDEyOk9yZ2FuaXphdGlvbjk5MTk=",
"avatar_url": "https://avatars.githubusercontent.com/u/9919?v=4",
"gravatar_id": "",
"url": "https://HOSTNAME/users/github",
"html_url": "https://github.com/github",
"followers_url": "https://HOSTNAME/users/github/followers",
"following_url": "https://HOSTNAME/users/github/following{/other_user}",
"gists_url": "https://HOSTNAME/users/github/gists{/gist_id}",
"starred_url": "https://HOSTNAME/users/github/starred{/owner}{/repo}",
"subscriptions_url": "https://HOSTNAME/users/github/subscriptions",
"organizations_url": "https://HOSTNAME/users/github/orgs",
"repos_url": "https://HOSTNAME/users/github/repos",
"events_url": "https://HOSTNAME/users/github/events{/privacy}",
"received_events_url": "https://HOSTNAME/users/github/received_events",
"type": "Organization",
"site_admin": false
},
"version_count": 1,
"visibility": "private",
"url": "https://HOSTNAME/orgs/github/packages/container/hello_docker",
"created_at": "2020-05-19T22:19:11Z",
"updated_at": "2020-05-19T22:19:11Z",
"html_url": "https://github.com/orgs/github/packages/container/package/hello_docker"
},
{
"id": 198,
"name": "goodbye_docker",
"package_type": "container",
"owner": {
"login": "github",
"id": 9919,
"node_id": "MDEyOk9yZ2FuaXphdGlvbjk5MTk=",
"avatar_url": "https://avatars.githubusercontent.com/u/9919?v=4",
"gravatar_id": "",
"url": "https://HOSTNAME/users/github",
"html_url": "https://github.com/github",
"followers_url": "https://HOSTNAME/users/github/followers",
"following_url": "https://HOSTNAME/users/github/following{/other_user}",
"gists_url": "https://HOSTNAME/users/github/gists{/gist_id}",
"starred_url": "https://HOSTNAME/users/github/starred{/owner}{/repo}",
"subscriptions_url": "https://HOSTNAME/users/github/subscriptions",
"organizations_url": "https://HOSTNAME/users/github/orgs",
"repos_url": "https://HOSTNAME/users/github/repos",
"events_url": "https://HOSTNAME/users/github/events{/privacy}",
"received_events_url": "https://HOSTNAME/users/github/received_events",
"type": "Organization",
"site_admin": false
},
"version_count": 2,
"visibility": "private",
"url": "https://HOSTNAME/orgs/github/packages/container/goodbye_docker",
"created_at": "2020-05-20T22:19:11Z",
"updated_at": "2020-05-20T22:19:11Z",
"html_url": "https://github.com/orgs/github/packages/container/package/goodbye_docker"
}
]
Get a package for an organization
Gets a specific package in an organization.
OAuth app tokens and personal access tokens (classic) need the read:packages
scope to use this endpoint. For more information, see "About permissions for GitHub Packages."
Jetons d’accès affinés pour « Get a package for an organization »
Ce point de terminaison fonctionne avec les types de jetons précis suivants:
Le jeton précis ne nécessite aucune autorisation.
Paramètres pour « Get a package for an organization »
Nom, Type, Description |
---|
accept string Setting to |
Nom, Type, Description |
---|
package_type string ObligatoireThe type of supported package. Packages in GitHub's Gradle registry have the type Peut être: |
package_name string ObligatoireThe name of the package. |
org string ObligatoireThe organization name. The name is not case sensitive. |
Codes d’état de la réponse HTTP pour « Get a package for an organization »
Code d’état | Description |
---|---|
200 | OK |
Exemples de code pour « Get a package for an organization »
Exemple de requête
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
http(s)://HOSTNAME/api/v3/orgs/ORG/packages/PACKAGE_TYPE/PACKAGE_NAME
Response
Status: 200
{
"id": 197,
"name": "hello_docker",
"package_type": "container",
"owner": {
"login": "github",
"id": 9919,
"node_id": "MDEyOk9yZ2FuaXphdGlvbjk5MTk=",
"avatar_url": "https://avatars.githubusercontent.com/u/9919?v=4",
"gravatar_id": "",
"url": "https://HOSTNAME/users/github",
"html_url": "https://github.com/github",
"followers_url": "https://HOSTNAME/users/github/followers",
"following_url": "https://HOSTNAME/users/github/following{/other_user}",
"gists_url": "https://HOSTNAME/users/github/gists{/gist_id}",
"starred_url": "https://HOSTNAME/users/github/starred{/owner}{/repo}",
"subscriptions_url": "https://HOSTNAME/users/github/subscriptions",
"organizations_url": "https://HOSTNAME/users/github/orgs",
"repos_url": "https://HOSTNAME/users/github/repos",
"events_url": "https://HOSTNAME/users/github/events{/privacy}",
"received_events_url": "https://HOSTNAME/users/github/received_events",
"type": "Organization",
"site_admin": false
},
"version_count": 1,
"visibility": "private",
"url": "https://HOSTNAME/orgs/github/packages/container/hello_docker",
"created_at": "2020-05-19T22:19:11Z",
"updated_at": "2020-05-19T22:19:11Z",
"html_url": "https://github.com/orgs/github/packages/container/package/hello_docker"
}
Delete a package for an organization
Deletes an entire package in an organization. You cannot delete a public package if any version of the package has more than 5,000 downloads. In this scenario, contact GitHub support for further assistance.
The authenticated user must have admin permissions in the organization to use this endpoint. If the package_type
belongs to a GitHub Packages registry that supports granular permissions, the authenticated user must also have admin permissions to the package. For the list of these registries, see "About permissions for GitHub Packages."
OAuth app tokens and personal access tokens (classic) need the read:packages
and delete:packages
scopes to use this endpoint. For more information, see "About permissions for GitHub Packages."
Jetons d’accès affinés pour « Delete a package for an organization »
Ce point de terminaison fonctionne avec les types de jetons précis suivants:
Le jeton précis ne nécessite aucune autorisation.
Paramètres pour « Delete a package for an organization »
Nom, Type, Description |
---|
accept string Setting to |
Nom, Type, Description |
---|
package_type string ObligatoireThe type of supported package. Packages in GitHub's Gradle registry have the type Peut être: |
package_name string ObligatoireThe name of the package. |
org string ObligatoireThe organization name. The name is not case sensitive. |
Codes d’état de la réponse HTTP pour « Delete a package for an organization »
Code d’état | Description |
---|---|
204 | No Content |
401 | Requires authentication |
403 | Forbidden |
404 | Resource not found |
Exemples de code pour « Delete a package for an organization »
Exemple de requête
curl -L \
-X DELETE \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
http(s)://HOSTNAME/api/v3/orgs/ORG/packages/PACKAGE_TYPE/PACKAGE_NAME
Response
Status: 204
Restore a package for an organization
Restores an entire package in an organization.
You can restore a deleted package under the following conditions:
- The package was deleted within the last 30 days.
- The same package namespace and version is still available and not reused for a new package. If the same package namespace is not available, you will not be able to restore your package. In this scenario, to restore the deleted package, you must delete the new package that uses the deleted package's namespace first.
The authenticated user must have admin permissions in the organization to use this endpoint. If the package_type
belongs to a GitHub Packages registry that supports granular permissions, the authenticated user must also have admin permissions to the package. For the list of these registries, see "About permissions for GitHub Packages."
OAuth app tokens and personal access tokens (classic) need the read:packages
and write:packages
scopes to use this endpoint. For more information, see "About permissions for GitHub Packages."
Jetons d’accès affinés pour « Restore a package for an organization »
Ce point de terminaison fonctionne avec les types de jetons précis suivants:
Le jeton précis ne nécessite aucune autorisation.
Paramètres pour « Restore a package for an organization »
Nom, Type, Description |
---|
accept string Setting to |
Nom, Type, Description |
---|
package_type string ObligatoireThe type of supported package. Packages in GitHub's Gradle registry have the type Peut être: |
package_name string ObligatoireThe name of the package. |
org string ObligatoireThe organization name. The name is not case sensitive. |
Nom, Type, Description |
---|
token string package token |
Codes d’état de la réponse HTTP pour « Restore a package for an organization »
Code d’état | Description |
---|---|
204 | No Content |
401 | Requires authentication |
403 | Forbidden |
404 | Resource not found |
Exemples de code pour « Restore a package for an organization »
Exemple de requête
curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
http(s)://HOSTNAME/api/v3/orgs/ORG/packages/PACKAGE_TYPE/PACKAGE_NAME/restore
Response
Status: 204
List package versions for a package owned by an organization
Lists package versions for a package owned by an organization.
OAuth app tokens and personal access tokens (classic) need the read:packages
scope to use this endpoint. For more information, see "About permissions for GitHub Packages."
Jetons d’accès affinés pour « List package versions for a package owned by an organization »
Ce point de terminaison fonctionne avec les types de jetons précis suivants:
Le jeton précis ne nécessite aucune autorisation.
Paramètres pour « List package versions for a package owned by an organization »
Nom, Type, Description |
---|
accept string Setting to |
Nom, Type, Description |
---|
package_type string ObligatoireThe type of supported package. Packages in GitHub's Gradle registry have the type Peut être: |
package_name string ObligatoireThe name of the package. |
org string ObligatoireThe organization name. The name is not case sensitive. |
Nom, Type, Description |
---|
page integer The page number of the results to fetch. For more information, see "Using pagination in the REST API." Default: |
per_page integer The number of results per page (max 100). For more information, see "Using pagination in the REST API." Default: |
state string The state of the package, either active or deleted. Default: Peut être: |
Codes d’état de la réponse HTTP pour « List package versions for a package owned by an organization »
Code d’état | Description |
---|---|
200 | OK |
401 | Requires authentication |
403 | Forbidden |
404 | Resource not found |
Exemples de code pour « List package versions for a package owned by an organization »
Exemple de requête
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
http(s)://HOSTNAME/api/v3/orgs/ORG/packages/PACKAGE_TYPE/PACKAGE_NAME/versions
Response
Status: 200
[
{
"id": 245301,
"name": "1.0.4",
"url": "https://HOSTNAME/orgs/octo-org/packages/npm/hello-world-npm/versions/245301",
"package_html_url": "https://github.com/octo-org/hello-world-npm/packages/43752",
"created_at": "2019-11-05T22:49:04Z",
"updated_at": "2019-11-05T22:49:04Z",
"html_url": "https://github.com/octo-org/hello-world-npm/packages/43752?version=1.0.4",
"metadata": {
"package_type": "npm"
}
},
{
"id": 209672,
"name": "1.0.3",
"url": "https://HOSTNAME/orgs/octo-org/packages/npm/hello-world-npm/versions/209672",
"package_html_url": "https://github.com/octo-org/hello-world-npm/packages/43752",
"created_at": "2019-10-29T15:42:11Z",
"updated_at": "2019-10-29T15:42:12Z",
"html_url": "https://github.com/octo-org/hello-world-npm/packages/43752?version=1.0.3",
"metadata": {
"package_type": "npm"
}
}
]
Get a package version for an organization
Gets a specific package version in an organization.
OAuth app tokens and personal access tokens (classic) need the read:packages
scope to use this endpoint. For more information, see "About permissions for GitHub Packages."
Jetons d’accès affinés pour « Get a package version for an organization »
Ce point de terminaison fonctionne avec les types de jetons précis suivants:
Le jeton précis ne nécessite aucune autorisation.
Paramètres pour « Get a package version for an organization »
Nom, Type, Description |
---|
accept string Setting to |
Nom, Type, Description |
---|
package_type string ObligatoireThe type of supported package. Packages in GitHub's Gradle registry have the type Peut être: |
package_name string ObligatoireThe name of the package. |
org string ObligatoireThe organization name. The name is not case sensitive. |
package_version_id integer ObligatoireUnique identifier of the package version. |
Codes d’état de la réponse HTTP pour « Get a package version for an organization »
Code d’état | Description |
---|---|
200 | OK |
Exemples de code pour « Get a package version for an organization »
Exemple de requête
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
http(s)://HOSTNAME/api/v3/orgs/ORG/packages/PACKAGE_TYPE/PACKAGE_NAME/versions/PACKAGE_VERSION_ID
Response
Status: 200
{
"id": 836,
"name": "sha256:b3d3e366b55f9a54599220198b3db5da8f53592acbbb7dc7e4e9878762fc5344",
"url": "https://HOSTNAME/orgs/github/packages/container/hello_docker/versions/836",
"package_html_url": "https://github.com/orgs/github/packages/container/package/hello_docker",
"created_at": "2020-05-19T22:19:11Z",
"updated_at": "2020-05-19T22:19:11Z",
"html_url": "https://github.com/orgs/github/packages/container/hello_docker/836",
"metadata": {
"package_type": "container",
"container": {
"tags": [
"latest"
]
}
}
}
Delete package version for an organization
Deletes a specific package version in an organization. If the package is public and the package version has more than 5,000 downloads, you cannot delete the package version. In this scenario, contact GitHub support for further assistance.
The authenticated user must have admin permissions in the organization to use this endpoint. If the package_type
belongs to a GitHub Packages registry that supports granular permissions, the authenticated user must also have admin permissions to the package. For the list of these registries, see "About permissions for GitHub Packages."
OAuth app tokens and personal access tokens (classic) need the read:packages
and delete:packages
scopes to use this endpoint. For more information, see "About permissions for GitHub Packages."
Jetons d’accès affinés pour « Delete package version for an organization »
Ce point de terminaison fonctionne avec les types de jetons précis suivants:
Le jeton précis ne nécessite aucune autorisation.
Paramètres pour « Delete package version for an organization »
Nom, Type, Description |
---|
accept string Setting to |
Nom, Type, Description |
---|
package_type string ObligatoireThe type of supported package. Packages in GitHub's Gradle registry have the type Peut être: |
package_name string ObligatoireThe name of the package. |
org string ObligatoireThe organization name. The name is not case sensitive. |
package_version_id integer ObligatoireUnique identifier of the package version. |
Codes d’état de la réponse HTTP pour « Delete package version for an organization »
Code d’état | Description |
---|---|
204 | No Content |
401 | Requires authentication |
403 | Forbidden |
404 | Resource not found |
Exemples de code pour « Delete package version for an organization »
Exemple de requête
curl -L \
-X DELETE \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
http(s)://HOSTNAME/api/v3/orgs/ORG/packages/PACKAGE_TYPE/PACKAGE_NAME/versions/PACKAGE_VERSION_ID
Response
Status: 204
Restore package version for an organization
Restores a specific package version in an organization.
You can restore a deleted package under the following conditions:
- The package was deleted within the last 30 days.
- The same package namespace and version is still available and not reused for a new package. If the same package namespace is not available, you will not be able to restore your package. In this scenario, to restore the deleted package, you must delete the new package that uses the deleted package's namespace first.
The authenticated user must have admin permissions in the organization to use this endpoint. If the package_type
belongs to a GitHub Packages registry that supports granular permissions, the authenticated user must also have admin permissions to the package. For the list of these registries, see "About permissions for GitHub Packages."
OAuth app tokens and personal access tokens (classic) need the read:packages
and write:packages
scopes to use this endpoint. For more information, see "About permissions for GitHub Packages."
Jetons d’accès affinés pour « Restore package version for an organization »
Ce point de terminaison fonctionne avec les types de jetons précis suivants:
Le jeton précis ne nécessite aucune autorisation.
Paramètres pour « Restore package version for an organization »
Nom, Type, Description |
---|
accept string Setting to |
Nom, Type, Description |
---|
package_type string ObligatoireThe type of supported package. Packages in GitHub's Gradle registry have the type Peut être: |
package_name string ObligatoireThe name of the package. |
org string ObligatoireThe organization name. The name is not case sensitive. |
package_version_id integer ObligatoireUnique identifier of the package version. |
Codes d’état de la réponse HTTP pour « Restore package version for an organization »
Code d’état | Description |
---|---|
204 | No Content |
401 | Requires authentication |
403 | Forbidden |
404 | Resource not found |
Exemples de code pour « Restore package version for an organization »
Exemple de requête
curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
http(s)://HOSTNAME/api/v3/orgs/ORG/packages/PACKAGE_TYPE/PACKAGE_NAME/versions/PACKAGE_VERSION_ID/restore
Response
Status: 204
Get list of conflicting packages during Docker migration for authenticated-user
Lists all packages that are owned by the authenticated user within the user's namespace, and that encountered a conflict during a Docker migration.
OAuth app tokens and personal access tokens (classic) need the read:packages
scope to use this endpoint.
Jetons d’accès affinés pour « Get list of conflicting packages during Docker migration for authenticated-user »
Ce point de terminaison fonctionne avec les types de jetons précis suivants:
Le jeton précis ne nécessite aucune autorisation.
Codes d’état de la réponse HTTP pour « Get list of conflicting packages during Docker migration for authenticated-user »
Code d’état | Description |
---|---|
200 | OK |
Exemples de code pour « Get list of conflicting packages during Docker migration for authenticated-user »
Exemple de requête
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
http(s)://HOSTNAME/api/v3/user/docker/conflicts
Response
Status: 200
[
{
"id": 197,
"name": "hello_docker",
"package_type": "container",
"owner": {
"login": "octocat",
"id": 9919,
"node_id": "MDEyOk9yZ2FuaXphdGlvbjk5MTk=",
"avatar_url": "https://avatars.octocatusercontent.com/u/9919?v=4",
"gravatar_id": "",
"url": "https://HOSTNAME/users/octocat",
"html_url": "https://github.com/github",
"followers_url": "https://HOSTNAME/users/github/followers",
"following_url": "https://HOSTNAME/users/github/following{/other_user}",
"gists_url": "https://HOSTNAME/users/github/gists{/gist_id}",
"starred_url": "https://HOSTNAME/users/github/starred{/owner}{/repo}",
"subscriptions_url": "https://HOSTNAME/users/github/subscriptions",
"organizations_url": "https://HOSTNAME/users/github/orgs",
"repos_url": "https://HOSTNAME/users/github/repos",
"events_url": "https://HOSTNAME/users/github/events{/privacy}",
"received_events_url": "https://HOSTNAME/users/github/received_events",
"type": "User",
"site_admin": false
},
"version_count": 1,
"visibility": "private",
"url": "https://HOSTNAME/orgs/github/packages/container/hello_docker",
"created_at": "2020-05-19T22:19:11Z",
"updated_at": "2020-05-19T22:19:11Z",
"html_url": "https://github.com/orgs/github/packages/container/package/hello_docker"
},
{
"id": 198,
"name": "goodbye_docker",
"package_type": "container",
"owner": {
"login": "github",
"id": 9919,
"node_id": "MDEyOk9yZ2FuaXphdGlvbjk5MTk=",
"avatar_url": "https://avatars.githubusercontent.com/u/9919?v=4",
"gravatar_id": "",
"url": "https://HOSTNAME/users/octocat",
"html_url": "https://github.com/github",
"followers_url": "https://HOSTNAME/users/github/followers",
"following_url": "https://HOSTNAME/users/github/following{/other_user}",
"gists_url": "https://HOSTNAME/users/github/gists{/gist_id}",
"starred_url": "https://HOSTNAME/users/github/starred{/owner}{/repo}",
"subscriptions_url": "https://HOSTNAME/users/github/subscriptions",
"organizations_url": "https://HOSTNAME/users/github/orgs",
"repos_url": "https://HOSTNAME/users/github/repos",
"events_url": "https://HOSTNAME/users/github/events{/privacy}",
"received_events_url": "https://HOSTNAME/users/github/received_events",
"type": "User",
"site_admin": false
},
"version_count": 2,
"visibility": "private",
"url": "https://HOSTNAME/user/octocat/packages/container/goodbye_docker",
"created_at": "2020-05-20T22:19:11Z",
"updated_at": "2020-05-20T22:19:11Z",
"html_url": "https://github.com/user/octocat/packages/container/package/goodbye_docker"
}
]
List packages for the authenticated user's namespace
Lists packages owned by the authenticated user within the user's namespace.
OAuth app tokens and personal access tokens (classic) need the read:packages
scope to use this endpoint. For more information, see "About permissions for GitHub Packages."
Jetons d’accès affinés pour « List packages for the authenticated user's namespace »
Ce point de terminaison fonctionne avec les types de jetons précis suivants:
Le jeton précis ne nécessite aucune autorisation.
Paramètres pour « List packages for the authenticated user's namespace »
Nom, Type, Description |
---|
accept string Setting to |
Nom, Type, Description |
---|
package_type string ObligatoireThe type of supported package. Packages in GitHub's Gradle registry have the type Peut être: |
visibility string The selected visibility of the packages. This parameter is optional and only filters an existing result set. The Peut être: |
page integer The page number of the results to fetch. For more information, see "Using pagination in the REST API." Default: |
per_page integer The number of results per page (max 100). For more information, see "Using pagination in the REST API." Default: |
Codes d’état de la réponse HTTP pour « List packages for the authenticated user's namespace »
Code d’état | Description |
---|---|
200 | OK |
400 | The value of |
Exemples de code pour « List packages for the authenticated user's namespace »
Exemple de requête
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
"http(s)://HOSTNAME/api/v3/user/packages?package_type=container"
Response
Status: 200
[
{
"id": 197,
"name": "hello_docker",
"package_type": "container",
"owner": {
"login": "octocat",
"id": 9919,
"node_id": "MDEyOk9yZ2FuaXphdGlvbjk5MTk=",
"avatar_url": "https://avatars.octocatusercontent.com/u/9919?v=4",
"gravatar_id": "",
"url": "https://HOSTNAME/users/octocat",
"html_url": "https://github.com/github",
"followers_url": "https://HOSTNAME/users/github/followers",
"following_url": "https://HOSTNAME/users/github/following{/other_user}",
"gists_url": "https://HOSTNAME/users/github/gists{/gist_id}",
"starred_url": "https://HOSTNAME/users/github/starred{/owner}{/repo}",
"subscriptions_url": "https://HOSTNAME/users/github/subscriptions",
"organizations_url": "https://HOSTNAME/users/github/orgs",
"repos_url": "https://HOSTNAME/users/github/repos",
"events_url": "https://HOSTNAME/users/github/events{/privacy}",
"received_events_url": "https://HOSTNAME/users/github/received_events",
"type": "User",
"site_admin": false
},
"version_count": 1,
"visibility": "private",
"url": "https://HOSTNAME/orgs/github/packages/container/hello_docker",
"created_at": "2020-05-19T22:19:11Z",
"updated_at": "2020-05-19T22:19:11Z",
"html_url": "https://github.com/orgs/github/packages/container/package/hello_docker"
},
{
"id": 198,
"name": "goodbye_docker",
"package_type": "container",
"owner": {
"login": "github",
"id": 9919,
"node_id": "MDEyOk9yZ2FuaXphdGlvbjk5MTk=",
"avatar_url": "https://avatars.githubusercontent.com/u/9919?v=4",
"gravatar_id": "",
"url": "https://HOSTNAME/users/octocat",
"html_url": "https://github.com/github",
"followers_url": "https://HOSTNAME/users/github/followers",
"following_url": "https://HOSTNAME/users/github/following{/other_user}",
"gists_url": "https://HOSTNAME/users/github/gists{/gist_id}",
"starred_url": "https://HOSTNAME/users/github/starred{/owner}{/repo}",
"subscriptions_url": "https://HOSTNAME/users/github/subscriptions",
"organizations_url": "https://HOSTNAME/users/github/orgs",
"repos_url": "https://HOSTNAME/users/github/repos",
"events_url": "https://HOSTNAME/users/github/events{/privacy}",
"received_events_url": "https://HOSTNAME/users/github/received_events",
"type": "User",
"site_admin": false
},
"version_count": 2,
"visibility": "private",
"url": "https://HOSTNAME/user/octocat/packages/container/goodbye_docker",
"created_at": "2020-05-20T22:19:11Z",
"updated_at": "2020-05-20T22:19:11Z",
"html_url": "https://github.com/user/octocat/packages/container/package/goodbye_docker"
}
]
Get a package for the authenticated user
Gets a specific package for a package owned by the authenticated user.
OAuth app tokens and personal access tokens (classic) need the read:packages
scope to use this endpoint. For more information, see "About permissions for GitHub Packages."
Jetons d’accès affinés pour « Get a package for the authenticated user »
Ce point de terminaison fonctionne avec les types de jetons précis suivants:
Le jeton précis ne nécessite aucune autorisation.
Paramètres pour « Get a package for the authenticated user »
Nom, Type, Description |
---|
accept string Setting to |
Nom, Type, Description |
---|
package_type string ObligatoireThe type of supported package. Packages in GitHub's Gradle registry have the type Peut être: |
package_name string ObligatoireThe name of the package. |
Codes d’état de la réponse HTTP pour « Get a package for the authenticated user »
Code d’état | Description |
---|---|
200 | OK |
Exemples de code pour « Get a package for the authenticated user »
Exemple de requête
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
http(s)://HOSTNAME/api/v3/user/packages/PACKAGE_TYPE/PACKAGE_NAME
Response
Status: 200
{
"id": 40201,
"name": "octo-name",
"package_type": "rubygems",
"owner": {
"login": "octocat",
"id": 209477,
"node_id": "MDQ6VXNlcjIwOTQ3Nw==",
"avatar_url": "https://avatars.githubusercontent.com/u/209477?v=4",
"gravatar_id": "",
"url": "https://HOSTNAME/users/octocat",
"html_url": "https://github.com/octocat",
"followers_url": "https://HOSTNAME/users/octocat/followers",
"following_url": "https://HOSTNAME/users/octocat/following{/other_user}",
"gists_url": "https://HOSTNAME/users/octocat/gists{/gist_id}",
"starred_url": "https://HOSTNAME/users/octocat/starred{/owner}{/repo}",
"subscriptions_url": "https://HOSTNAME/users/octocat/subscriptions",
"organizations_url": "https://HOSTNAME/users/octocat/orgs",
"repos_url": "https://HOSTNAME/users/octocat/repos",
"events_url": "https://HOSTNAME/users/octocat/events{/privacy}",
"received_events_url": "https://HOSTNAME/users/octocat/received_events",
"type": "User",
"site_admin": true
},
"version_count": 3,
"visibility": "public",
"url": "https://HOSTNAME/users/octocat/packages/rubygems/octo-name",
"created_at": "2019-10-20T14:17:14Z",
"updated_at": "2019-10-20T14:17:14Z",
"repository": {
"id": 216219492,
"node_id": "MDEwOlJlcG9zaXRvcnkyMTYyMTk0OTI=",
"name": "octo-name-repo",
"full_name": "octocat/octo-name-repo",
"private": false,
"owner": {
"login": "octocat",
"id": 209477,
"node_id": "MDQ6VXNlcjIwOTQ3Nw==",
"avatar_url": "https://avatars.githubusercontent.com/u/209477?v=4",
"gravatar_id": "",
"url": "https://HOSTNAME/users/octocat",
"html_url": "https://github.com/octocat",
"followers_url": "https://HOSTNAME/users/octocat/followers",
"following_url": "https://HOSTNAME/users/octocat/following{/other_user}",
"gists_url": "https://HOSTNAME/users/octocat/gists{/gist_id}",
"starred_url": "https://HOSTNAME/users/octocat/starred{/owner}{/repo}",
"subscriptions_url": "https://HOSTNAME/users/octocat/subscriptions",
"organizations_url": "https://HOSTNAME/users/octocat/orgs",
"repos_url": "https://HOSTNAME/users/octocat/repos",
"events_url": "https://HOSTNAME/users/octocat/events{/privacy}",
"received_events_url": "https://HOSTNAME/users/octocat/received_events",
"type": "User",
"site_admin": true
},
"html_url": "https://github.com/octocat/octo-name-repo",
"description": "Project for octocats",
"fork": false,
"url": "https://HOSTNAME/repos/octocat/octo-name-repo",
"forks_url": "https://HOSTNAME/repos/octocat/octo-name-repo/forks",
"keys_url": "https://HOSTNAME/repos/octocat/octo-name-repo/keys{/key_id}",
"collaborators_url": "https://HOSTNAME/repos/octocat/octo-name-repo/collaborators{/collaborator}",
"teams_url": "https://HOSTNAME/repos/octocat/octo-name-repo/teams",
"hooks_url": "https://HOSTNAME/repos/octocat/octo-name-repo/hooks",
"issue_events_url": "https://HOSTNAME/repos/octocat/octo-name-repo/issues/events{/number}",
"events_url": "https://HOSTNAME/repos/octocat/octo-name-repo/events",
"assignees_url": "https://HOSTNAME/repos/octocat/octo-name-repo/assignees{/user}",
"branches_url": "https://HOSTNAME/repos/octocat/octo-name-repo/branches{/branch}",
"tags_url": "https://HOSTNAME/repos/octocat/octo-name-repo/tags",
"blobs_url": "https://HOSTNAME/repos/octocat/octo-name-repo/git/blobs{/sha}",
"git_tags_url": "https://HOSTNAME/repos/octocat/octo-name-repo/git/tags{/sha}",
"git_refs_url": "https://HOSTNAME/repos/octocat/octo-name-repo/git/refs{/sha}",
"trees_url": "https://HOSTNAME/repos/octocat/octo-name-repo/git/trees{/sha}",
"statuses_url": "https://HOSTNAME/repos/octocat/octo-name-repo/statuses/{sha}",
"languages_url": "https://HOSTNAME/repos/octocat/octo-name-repo/languages",
"stargazers_url": "https://HOSTNAME/repos/octocat/octo-name-repo/stargazers",
"contributors_url": "https://HOSTNAME/repos/octocat/octo-name-repo/contributors",
"subscribers_url": "https://HOSTNAME/repos/octocat/octo-name-repo/subscribers",
"subscription_url": "https://HOSTNAME/repos/octocat/octo-name-repo/subscription",
"commits_url": "https://HOSTNAME/repos/octocat/octo-name-repo/commits{/sha}",
"git_commits_url": "https://HOSTNAME/repos/octocat/octo-name-repo/git/commits{/sha}",
"comments_url": "https://HOSTNAME/repos/octocat/octo-name-repo/comments{/number}",
"issue_comment_url": "https://HOSTNAME/repos/octocat/octo-name-repo/issues/comments{/number}",
"contents_url": "https://HOSTNAME/repos/octocat/octo-name-repo/contents/{+path}",
"compare_url": "https://HOSTNAME/repos/octocat/octo-name-repo/compare/{base}...{head}",
"merges_url": "https://HOSTNAME/repos/octocat/octo-name-repo/merges",
"archive_url": "https://HOSTNAME/repos/octocat/octo-name-repo/{archive_format}{/ref}",
"downloads_url": "https://HOSTNAME/repos/octocat/octo-name-repo/downloads",
"issues_url": "https://HOSTNAME/repos/octocat/octo-name-repo/issues{/number}",
"pulls_url": "https://HOSTNAME/repos/octocat/octo-name-repo/pulls{/number}",
"milestones_url": "https://HOSTNAME/repos/octocat/octo-name-repo/milestones{/number}",
"notifications_url": "https://HOSTNAME/repos/octocat/octo-name-repo/notifications{?since,all,participating}",
"labels_url": "https://HOSTNAME/repos/octocat/octo-name-repo/labels{/name}",
"releases_url": "https://HOSTNAME/repos/octocat/octo-name-repo/releases{/id}",
"deployments_url": "https://HOSTNAME/repos/octocat/octo-name-repo/deployments"
},
"html_url": "https://github.com/octocat/octo-name-repo/packages/40201"
}
Delete a package for the authenticated user
Deletes a package owned by the authenticated user. You cannot delete a public package if any version of the package has more than 5,000 downloads. In this scenario, contact GitHub support for further assistance.
OAuth app tokens and personal access tokens (classic) need the read:packages
and delete:packages
scopes to use this endpoint. For more information, see "About permissions for GitHub Packages."
Jetons d’accès affinés pour « Delete a package for the authenticated user »
Ce point de terminaison fonctionne avec les types de jetons précis suivants:
Le jeton précis ne nécessite aucune autorisation.
Paramètres pour « Delete a package for the authenticated user »
Nom, Type, Description |
---|
accept string Setting to |
Nom, Type, Description |
---|
package_type string ObligatoireThe type of supported package. Packages in GitHub's Gradle registry have the type Peut être: |
package_name string ObligatoireThe name of the package. |
Codes d’état de la réponse HTTP pour « Delete a package for the authenticated user »
Code d’état | Description |
---|---|
204 | No Content |
401 | Requires authentication |
403 | Forbidden |
404 | Resource not found |
Exemples de code pour « Delete a package for the authenticated user »
Exemple de requête
curl -L \
-X DELETE \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
http(s)://HOSTNAME/api/v3/user/packages/PACKAGE_TYPE/PACKAGE_NAME
Response
Status: 204
Restore a package for the authenticated user
Restores a package owned by the authenticated user.
You can restore a deleted package under the following conditions:
- The package was deleted within the last 30 days.
- The same package namespace and version is still available and not reused for a new package. If the same package namespace is not available, you will not be able to restore your package. In this scenario, to restore the deleted package, you must delete the new package that uses the deleted package's namespace first.
OAuth app tokens and personal access tokens (classic) need the read:packages
and write:packages
scopes to use this endpoint. For more information, see "About permissions for GitHub Packages."
Jetons d’accès affinés pour « Restore a package for the authenticated user »
Ce point de terminaison fonctionne avec les types de jetons précis suivants:
Le jeton précis ne nécessite aucune autorisation.
Paramètres pour « Restore a package for the authenticated user »
Nom, Type, Description |
---|
accept string Setting to |
Nom, Type, Description |
---|
package_type string ObligatoireThe type of supported package. Packages in GitHub's Gradle registry have the type Peut être: |
package_name string ObligatoireThe name of the package. |
Nom, Type, Description |
---|
token string package token |
Codes d’état de la réponse HTTP pour « Restore a package for the authenticated user »
Code d’état | Description |
---|---|
204 | No Content |
401 | Requires authentication |
403 | Forbidden |
404 | Resource not found |
Exemples de code pour « Restore a package for the authenticated user »
Exemple de requête
curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
http(s)://HOSTNAME/api/v3/user/packages/PACKAGE_TYPE/PACKAGE_NAME/restore
Response
Status: 204
List package versions for a package owned by the authenticated user
Lists package versions for a package owned by the authenticated user.
OAuth app tokens and personal access tokens (classic) need the read:packages
scope to use this endpoint. For more information, see "About permissions for GitHub Packages."
Jetons d’accès affinés pour « List package versions for a package owned by the authenticated user »
Ce point de terminaison fonctionne avec les types de jetons précis suivants:
Le jeton précis ne nécessite aucune autorisation.
Paramètres pour « List package versions for a package owned by the authenticated user »
Nom, Type, Description |
---|
accept string Setting to |
Nom, Type, Description |
---|
package_type string ObligatoireThe type of supported package. Packages in GitHub's Gradle registry have the type Peut être: |
package_name string ObligatoireThe name of the package. |
Nom, Type, Description |
---|
page integer The page number of the results to fetch. For more information, see "Using pagination in the REST API." Default: |
per_page integer The number of results per page (max 100). For more information, see "Using pagination in the REST API." Default: |
state string The state of the package, either active or deleted. Default: Peut être: |
Codes d’état de la réponse HTTP pour « List package versions for a package owned by the authenticated user »
Code d’état | Description |
---|---|
200 | OK |
401 | Requires authentication |
403 | Forbidden |
404 | Resource not found |
Exemples de code pour « List package versions for a package owned by the authenticated user »
Exemple de requête
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
http(s)://HOSTNAME/api/v3/user/packages/PACKAGE_TYPE/PACKAGE_NAME/versions
Response
Status: 200
[
{
"id": 45763,
"name": "sha256:08a44bab0bddaddd8837a8b381aebc2e4b933768b981685a9e088360af0d3dd9",
"url": "https://HOSTNAME/users/octocat/packages/container/hello_docker/versions/45763",
"package_html_url": "https://github.com/users/octocat/packages/container/package/hello_docker",
"created_at": "2020-09-11T21:56:40Z",
"updated_at": "2021-02-05T21:32:32Z",
"html_url": "https://github.com/users/octocat/packages/container/hello_docker/45763",
"metadata": {
"package_type": "container",
"container": {
"tags": [
"latest"
]
}
}
},
{
"id": 881,
"name": "sha256:b3d3e366b55f9a54599220198b3db5da8f53592acbbb7dc7e4e9878762fc5344",
"url": "https://HOSTNAME/users/octocat/packages/container/hello_docker/versions/881",
"package_html_url": "https://github.com/users/octocat/packages/container/package/hello_docker",
"created_at": "2020-05-21T22:22:20Z",
"updated_at": "2021-02-05T21:32:32Z",
"html_url": "https://github.com/users/octocat/packages/container/hello_docker/881",
"metadata": {
"package_type": "container",
"container": {
"tags": []
}
}
}
]
Get a package version for the authenticated user
Gets a specific package version for a package owned by the authenticated user.
OAuth app tokens and personal access tokens (classic) need the read:packages
scope to use this endpoint. For more information, see "About permissions for GitHub Packages."
Jetons d’accès affinés pour « Get a package version for the authenticated user »
Ce point de terminaison fonctionne avec les types de jetons précis suivants:
Le jeton précis ne nécessite aucune autorisation.
Paramètres pour « Get a package version for the authenticated user »
Nom, Type, Description |
---|
accept string Setting to |
Nom, Type, Description |
---|
package_type string ObligatoireThe type of supported package. Packages in GitHub's Gradle registry have the type Peut être: |
package_name string ObligatoireThe name of the package. |
package_version_id integer ObligatoireUnique identifier of the package version. |
Codes d’état de la réponse HTTP pour « Get a package version for the authenticated user »
Code d’état | Description |
---|---|
200 | OK |
Exemples de code pour « Get a package version for the authenticated user »
Exemple de requête
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
http(s)://HOSTNAME/api/v3/user/packages/PACKAGE_TYPE/PACKAGE_NAME/versions/PACKAGE_VERSION_ID
Response
Status: 200
{
"id": 214,
"name": "sha256:3561f0cff06caccddb99c93bd26e712fcc56a811de0f8ea7a17bb865f30b176a",
"url": "https://HOSTNAME/users/octocat/packages/container/hello_docker/versions/214",
"package_html_url": "https://github.com/users/octocat/packages/container/package/hello_docker",
"created_at": "2020-05-15T03:46:45Z",
"updated_at": "2020-05-15T03:46:45Z",
"html_url": "https://github.com/users/octocat/packages/container/hello_docker/214",
"metadata": {
"package_type": "container",
"container": {
"tags": [
"1.13.6"
]
}
}
}
Delete a package version for the authenticated user
Deletes a specific package version for a package owned by the authenticated user. If the package is public and the package version has more than 5,000 downloads, you cannot delete the package version. In this scenario, contact GitHub support for further assistance.
The authenticated user must have admin permissions in the organization to use this endpoint.
OAuth app tokens and personal access tokens (classic) need the read:packages
and delete:packages
scopes to use this endpoint. For more information, see "About permissions for GitHub Packages."
Jetons d’accès affinés pour « Delete a package version for the authenticated user »
Ce point de terminaison fonctionne avec les types de jetons précis suivants:
Le jeton précis ne nécessite aucune autorisation.
Paramètres pour « Delete a package version for the authenticated user »
Nom, Type, Description |
---|
accept string Setting to |
Nom, Type, Description |
---|
package_type string ObligatoireThe type of supported package. Packages in GitHub's Gradle registry have the type Peut être: |
package_name string ObligatoireThe name of the package. |
package_version_id integer ObligatoireUnique identifier of the package version. |
Codes d’état de la réponse HTTP pour « Delete a package version for the authenticated user »
Code d’état | Description |
---|---|
204 | No Content |
401 | Requires authentication |
403 | Forbidden |
404 | Resource not found |
Exemples de code pour « Delete a package version for the authenticated user »
Exemple de requête
curl -L \
-X DELETE \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
http(s)://HOSTNAME/api/v3/user/packages/PACKAGE_TYPE/PACKAGE_NAME/versions/PACKAGE_VERSION_ID
Response
Status: 204
Restore a package version for the authenticated user
Restores a package version owned by the authenticated user.
You can restore a deleted package version under the following conditions:
- The package was deleted within the last 30 days.
- The same package namespace and version is still available and not reused for a new package. If the same package namespace is not available, you will not be able to restore your package. In this scenario, to restore the deleted package, you must delete the new package that uses the deleted package's namespace first.
OAuth app tokens and personal access tokens (classic) need the read:packages
and write:packages
scopes to use this endpoint. For more information, see "About permissions for GitHub Packages."
Jetons d’accès affinés pour « Restore a package version for the authenticated user »
Ce point de terminaison fonctionne avec les types de jetons précis suivants:
Le jeton précis ne nécessite aucune autorisation.
Paramètres pour « Restore a package version for the authenticated user »
Nom, Type, Description |
---|
accept string Setting to |
Nom, Type, Description |
---|
package_type string ObligatoireThe type of supported package. Packages in GitHub's Gradle registry have the type Peut être: |
package_name string ObligatoireThe name of the package. |
package_version_id integer ObligatoireUnique identifier of the package version. |
Codes d’état de la réponse HTTP pour « Restore a package version for the authenticated user »
Code d’état | Description |
---|---|
204 | No Content |
401 | Requires authentication |
403 | Forbidden |
404 | Resource not found |
Exemples de code pour « Restore a package version for the authenticated user »
Exemple de requête
curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
http(s)://HOSTNAME/api/v3/user/packages/PACKAGE_TYPE/PACKAGE_NAME/versions/PACKAGE_VERSION_ID/restore
Response
Status: 204
Get list of conflicting packages during Docker migration for user
Lists all packages that are in a specific user's namespace, that the requesting user has access to, and that encountered a conflict during Docker migration.
OAuth app tokens and personal access tokens (classic) need the read:packages
scope to use this endpoint.
Jetons d’accès affinés pour « Get list of conflicting packages during Docker migration for user »
Ce point de terminaison fonctionne avec les types de jetons précis suivants:
- Jetons d’accès utilisateur d’application GitHub
- Jetons d’accès d’installation d’application GitHub
- Jetons d’accès personnel affiné
Le jeton précis ne nécessite aucune autorisation.
Ce point de terminaison peut être utilisé sans authentification ou si seules les ressources publiques sont demandées.
Paramètres pour « Get list of conflicting packages during Docker migration for user »
Nom, Type, Description |
---|
accept string Setting to |
Nom, Type, Description |
---|
username string ObligatoireThe handle for the GitHub user account. |
Codes d’état de la réponse HTTP pour « Get list of conflicting packages during Docker migration for user »
Code d’état | Description |
---|---|
200 | OK |
401 | Requires authentication |
403 | Forbidden |
Exemples de code pour « Get list of conflicting packages during Docker migration for user »
Exemple de requête
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
http(s)://HOSTNAME/api/v3/users/USERNAME/docker/conflicts
Response
Status: 200
[
{
"id": 197,
"name": "hello_docker",
"package_type": "container",
"owner": {
"login": "octocat",
"id": 9919,
"node_id": "MDEyOk9yZ2FuaXphdGlvbjk5MTk=",
"avatar_url": "https://avatars.octocatusercontent.com/u/9919?v=4",
"gravatar_id": "",
"url": "https://HOSTNAME/users/octocat",
"html_url": "https://github.com/github",
"followers_url": "https://HOSTNAME/users/github/followers",
"following_url": "https://HOSTNAME/users/github/following{/other_user}",
"gists_url": "https://HOSTNAME/users/github/gists{/gist_id}",
"starred_url": "https://HOSTNAME/users/github/starred{/owner}{/repo}",
"subscriptions_url": "https://HOSTNAME/users/github/subscriptions",
"organizations_url": "https://HOSTNAME/users/github/orgs",
"repos_url": "https://HOSTNAME/users/github/repos",
"events_url": "https://HOSTNAME/users/github/events{/privacy}",
"received_events_url": "https://HOSTNAME/users/github/received_events",
"type": "User",
"site_admin": false
},
"version_count": 1,
"visibility": "private",
"url": "https://HOSTNAME/orgs/github/packages/container/hello_docker",
"created_at": "2020-05-19T22:19:11Z",
"updated_at": "2020-05-19T22:19:11Z",
"html_url": "https://github.com/orgs/github/packages/container/package/hello_docker"
},
{
"id": 198,
"name": "goodbye_docker",
"package_type": "container",
"owner": {
"login": "github",
"id": 9919,
"node_id": "MDEyOk9yZ2FuaXphdGlvbjk5MTk=",
"avatar_url": "https://avatars.githubusercontent.com/u/9919?v=4",
"gravatar_id": "",
"url": "https://HOSTNAME/users/octocat",
"html_url": "https://github.com/github",
"followers_url": "https://HOSTNAME/users/github/followers",
"following_url": "https://HOSTNAME/users/github/following{/other_user}",
"gists_url": "https://HOSTNAME/users/github/gists{/gist_id}",
"starred_url": "https://HOSTNAME/users/github/starred{/owner}{/repo}",
"subscriptions_url": "https://HOSTNAME/users/github/subscriptions",
"organizations_url": "https://HOSTNAME/users/github/orgs",
"repos_url": "https://HOSTNAME/users/github/repos",
"events_url": "https://HOSTNAME/users/github/events{/privacy}",
"received_events_url": "https://HOSTNAME/users/github/received_events",
"type": "User",
"site_admin": false
},
"version_count": 2,
"visibility": "private",
"url": "https://HOSTNAME/user/octocat/packages/container/goodbye_docker",
"created_at": "2020-05-20T22:19:11Z",
"updated_at": "2020-05-20T22:19:11Z",
"html_url": "https://github.com/user/octocat/packages/container/package/goodbye_docker"
}
]
List packages for a user
Lists all packages in a user's namespace for which the requesting user has access.
OAuth app tokens and personal access tokens (classic) need the read:packages
scope to use this endpoint. For more information, see "About permissions for GitHub Packages."
Jetons d’accès affinés pour « List packages for a user »
Ce point de terminaison fonctionne avec les types de jetons précis suivants:
Le jeton précis ne nécessite aucune autorisation.
Paramètres pour « List packages for a user »
Nom, Type, Description |
---|
accept string Setting to |
Nom, Type, Description |
---|
username string ObligatoireThe handle for the GitHub user account. |
Nom, Type, Description |
---|
package_type string ObligatoireThe type of supported package. Packages in GitHub's Gradle registry have the type Peut être: |
visibility string The selected visibility of the packages. This parameter is optional and only filters an existing result set. The Peut être: |
page integer The page number of the results to fetch. For more information, see "Using pagination in the REST API." Default: |
per_page integer The number of results per page (max 100). For more information, see "Using pagination in the REST API." Default: |
Codes d’état de la réponse HTTP pour « List packages for a user »
Code d’état | Description |
---|---|
200 | OK |
400 | The value of |
401 | Requires authentication |
403 | Forbidden |
Exemples de code pour « List packages for a user »
Exemple de requête
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
"http(s)://HOSTNAME/api/v3/users/USERNAME/packages?package_type=container"
Response
Status: 200
[
{
"id": 197,
"name": "hello_docker",
"package_type": "container",
"owner": {
"login": "octocat",
"id": 9919,
"node_id": "MDEyOk9yZ2FuaXphdGlvbjk5MTk=",
"avatar_url": "https://avatars.octocatusercontent.com/u/9919?v=4",
"gravatar_id": "",
"url": "https://HOSTNAME/users/octocat",
"html_url": "https://github.com/github",
"followers_url": "https://HOSTNAME/users/github/followers",
"following_url": "https://HOSTNAME/users/github/following{/other_user}",
"gists_url": "https://HOSTNAME/users/github/gists{/gist_id}",
"starred_url": "https://HOSTNAME/users/github/starred{/owner}{/repo}",
"subscriptions_url": "https://HOSTNAME/users/github/subscriptions",
"organizations_url": "https://HOSTNAME/users/github/orgs",
"repos_url": "https://HOSTNAME/users/github/repos",
"events_url": "https://HOSTNAME/users/github/events{/privacy}",
"received_events_url": "https://HOSTNAME/users/github/received_events",
"type": "User",
"site_admin": false
},
"version_count": 1,
"visibility": "private",
"url": "https://HOSTNAME/orgs/github/packages/container/hello_docker",
"created_at": "2020-05-19T22:19:11Z",
"updated_at": "2020-05-19T22:19:11Z",
"html_url": "https://github.com/orgs/github/packages/container/package/hello_docker"
},
{
"id": 198,
"name": "goodbye_docker",
"package_type": "container",
"owner": {
"login": "github",
"id": 9919,
"node_id": "MDEyOk9yZ2FuaXphdGlvbjk5MTk=",
"avatar_url": "https://avatars.githubusercontent.com/u/9919?v=4",
"gravatar_id": "",
"url": "https://HOSTNAME/users/octocat",
"html_url": "https://github.com/github",
"followers_url": "https://HOSTNAME/users/github/followers",
"following_url": "https://HOSTNAME/users/github/following{/other_user}",
"gists_url": "https://HOSTNAME/users/github/gists{/gist_id}",
"starred_url": "https://HOSTNAME/users/github/starred{/owner}{/repo}",
"subscriptions_url": "https://HOSTNAME/users/github/subscriptions",
"organizations_url": "https://HOSTNAME/users/github/orgs",
"repos_url": "https://HOSTNAME/users/github/repos",
"events_url": "https://HOSTNAME/users/github/events{/privacy}",
"received_events_url": "https://HOSTNAME/users/github/received_events",
"type": "User",
"site_admin": false
},
"version_count": 2,
"visibility": "private",
"url": "https://HOSTNAME/user/octocat/packages/container/goodbye_docker",
"created_at": "2020-05-20T22:19:11Z",
"updated_at": "2020-05-20T22:19:11Z",
"html_url": "https://github.com/user/octocat/packages/container/package/goodbye_docker"
}
]
Get a package for a user
Gets a specific package metadata for a public package owned by a user.
OAuth app tokens and personal access tokens (classic) need the read:packages
scope to use this endpoint. For more information, see "About permissions for GitHub Packages."
Jetons d’accès affinés pour « Get a package for a user »
Ce point de terminaison fonctionne avec les types de jetons précis suivants:
Le jeton précis ne nécessite aucune autorisation.
Paramètres pour « Get a package for a user »
Nom, Type, Description |
---|
accept string Setting to |
Nom, Type, Description |
---|
package_type string ObligatoireThe type of supported package. Packages in GitHub's Gradle registry have the type Peut être: |
package_name string ObligatoireThe name of the package. |
username string ObligatoireThe handle for the GitHub user account. |
Codes d’état de la réponse HTTP pour « Get a package for a user »
Code d’état | Description |
---|---|
200 | OK |
Exemples de code pour « Get a package for a user »
Exemple de requête
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
http(s)://HOSTNAME/api/v3/users/USERNAME/packages/PACKAGE_TYPE/PACKAGE_NAME
Response
Status: 200
{
"id": 40201,
"name": "octo-name",
"package_type": "rubygems",
"owner": {
"login": "octocat",
"id": 209477,
"node_id": "MDQ6VXNlcjIwOTQ3Nw==",
"avatar_url": "https://avatars.githubusercontent.com/u/209477?v=4",
"gravatar_id": "",
"url": "https://HOSTNAME/users/octocat",
"html_url": "https://github.com/octocat",
"followers_url": "https://HOSTNAME/users/octocat/followers",
"following_url": "https://HOSTNAME/users/octocat/following{/other_user}",
"gists_url": "https://HOSTNAME/users/octocat/gists{/gist_id}",
"starred_url": "https://HOSTNAME/users/octocat/starred{/owner}{/repo}",
"subscriptions_url": "https://HOSTNAME/users/octocat/subscriptions",
"organizations_url": "https://HOSTNAME/users/octocat/orgs",
"repos_url": "https://HOSTNAME/users/octocat/repos",
"events_url": "https://HOSTNAME/users/octocat/events{/privacy}",
"received_events_url": "https://HOSTNAME/users/octocat/received_events",
"type": "User",
"site_admin": true
},
"version_count": 3,
"visibility": "public",
"url": "https://HOSTNAME/users/octocat/packages/rubygems/octo-name",
"created_at": "2019-10-20T14:17:14Z",
"updated_at": "2019-10-20T14:17:14Z",
"repository": {
"id": 216219492,
"node_id": "MDEwOlJlcG9zaXRvcnkyMTYyMTk0OTI=",
"name": "octo-name-repo",
"full_name": "octocat/octo-name-repo",
"private": false,
"owner": {
"login": "octocat",
"id": 209477,
"node_id": "MDQ6VXNlcjIwOTQ3Nw==",
"avatar_url": "https://avatars.githubusercontent.com/u/209477?v=4",
"gravatar_id": "",
"url": "https://HOSTNAME/users/octocat",
"html_url": "https://github.com/octocat",
"followers_url": "https://HOSTNAME/users/octocat/followers",
"following_url": "https://HOSTNAME/users/octocat/following{/other_user}",
"gists_url": "https://HOSTNAME/users/octocat/gists{/gist_id}",
"starred_url": "https://HOSTNAME/users/octocat/starred{/owner}{/repo}",
"subscriptions_url": "https://HOSTNAME/users/octocat/subscriptions",
"organizations_url": "https://HOSTNAME/users/octocat/orgs",
"repos_url": "https://HOSTNAME/users/octocat/repos",
"events_url": "https://HOSTNAME/users/octocat/events{/privacy}",
"received_events_url": "https://HOSTNAME/users/octocat/received_events",
"type": "User",
"site_admin": true
},
"html_url": "https://github.com/octocat/octo-name-repo",
"description": "Project for octocats",
"fork": false,
"url": "https://HOSTNAME/repos/octocat/octo-name-repo",
"forks_url": "https://HOSTNAME/repos/octocat/octo-name-repo/forks",
"keys_url": "https://HOSTNAME/repos/octocat/octo-name-repo/keys{/key_id}",
"collaborators_url": "https://HOSTNAME/repos/octocat/octo-name-repo/collaborators{/collaborator}",
"teams_url": "https://HOSTNAME/repos/octocat/octo-name-repo/teams",
"hooks_url": "https://HOSTNAME/repos/octocat/octo-name-repo/hooks",
"issue_events_url": "https://HOSTNAME/repos/octocat/octo-name-repo/issues/events{/number}",
"events_url": "https://HOSTNAME/repos/octocat/octo-name-repo/events",
"assignees_url": "https://HOSTNAME/repos/octocat/octo-name-repo/assignees{/user}",
"branches_url": "https://HOSTNAME/repos/octocat/octo-name-repo/branches{/branch}",
"tags_url": "https://HOSTNAME/repos/octocat/octo-name-repo/tags",
"blobs_url": "https://HOSTNAME/repos/octocat/octo-name-repo/git/blobs{/sha}",
"git_tags_url": "https://HOSTNAME/repos/octocat/octo-name-repo/git/tags{/sha}",
"git_refs_url": "https://HOSTNAME/repos/octocat/octo-name-repo/git/refs{/sha}",
"trees_url": "https://HOSTNAME/repos/octocat/octo-name-repo/git/trees{/sha}",
"statuses_url": "https://HOSTNAME/repos/octocat/octo-name-repo/statuses/{sha}",
"languages_url": "https://HOSTNAME/repos/octocat/octo-name-repo/languages",
"stargazers_url": "https://HOSTNAME/repos/octocat/octo-name-repo/stargazers",
"contributors_url": "https://HOSTNAME/repos/octocat/octo-name-repo/contributors",
"subscribers_url": "https://HOSTNAME/repos/octocat/octo-name-repo/subscribers",
"subscription_url": "https://HOSTNAME/repos/octocat/octo-name-repo/subscription",
"commits_url": "https://HOSTNAME/repos/octocat/octo-name-repo/commits{/sha}",
"git_commits_url": "https://HOSTNAME/repos/octocat/octo-name-repo/git/commits{/sha}",
"comments_url": "https://HOSTNAME/repos/octocat/octo-name-repo/comments{/number}",
"issue_comment_url": "https://HOSTNAME/repos/octocat/octo-name-repo/issues/comments{/number}",
"contents_url": "https://HOSTNAME/repos/octocat/octo-name-repo/contents/{+path}",
"compare_url": "https://HOSTNAME/repos/octocat/octo-name-repo/compare/{base}...{head}",
"merges_url": "https://HOSTNAME/repos/octocat/octo-name-repo/merges",
"archive_url": "https://HOSTNAME/repos/octocat/octo-name-repo/{archive_format}{/ref}",
"downloads_url": "https://HOSTNAME/repos/octocat/octo-name-repo/downloads",
"issues_url": "https://HOSTNAME/repos/octocat/octo-name-repo/issues{/number}",
"pulls_url": "https://HOSTNAME/repos/octocat/octo-name-repo/pulls{/number}",
"milestones_url": "https://HOSTNAME/repos/octocat/octo-name-repo/milestones{/number}",
"notifications_url": "https://HOSTNAME/repos/octocat/octo-name-repo/notifications{?since,all,participating}",
"labels_url": "https://HOSTNAME/repos/octocat/octo-name-repo/labels{/name}",
"releases_url": "https://HOSTNAME/repos/octocat/octo-name-repo/releases{/id}",
"deployments_url": "https://HOSTNAME/repos/octocat/octo-name-repo/deployments"
},
"html_url": "https://github.com/octocat/octo-name-repo/packages/40201"
}
Delete a package for a user
Deletes an entire package for a user. You cannot delete a public package if any version of the package has more than 5,000 downloads. In this scenario, contact GitHub support for further assistance.
If the package_type
belongs to a GitHub Packages registry that supports granular permissions, the authenticated user must have admin permissions to the package. For the list of these registries, see "About permissions for GitHub Packages."
OAuth app tokens and personal access tokens (classic) need the read:packages
and delete:packages
scopes to use this endpoint. For more information, see "About permissions for GitHub Packages."
Jetons d’accès affinés pour « Delete a package for a user »
Ce point de terminaison fonctionne avec les types de jetons précis suivants:
Le jeton précis ne nécessite aucune autorisation.
Paramètres pour « Delete a package for a user »
Nom, Type, Description |
---|
accept string Setting to |
Nom, Type, Description |
---|
package_type string ObligatoireThe type of supported package. Packages in GitHub's Gradle registry have the type Peut être: |
package_name string ObligatoireThe name of the package. |
username string ObligatoireThe handle for the GitHub user account. |
Codes d’état de la réponse HTTP pour « Delete a package for a user »
Code d’état | Description |
---|---|
204 | No Content |
401 | Requires authentication |
403 | Forbidden |
404 | Resource not found |
Exemples de code pour « Delete a package for a user »
Exemple de requête
curl -L \
-X DELETE \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
http(s)://HOSTNAME/api/v3/users/USERNAME/packages/PACKAGE_TYPE/PACKAGE_NAME
Response
Status: 204
Restore a package for a user
Restores an entire package for a user.
You can restore a deleted package under the following conditions:
- The package was deleted within the last 30 days.
- The same package namespace and version is still available and not reused for a new package. If the same package namespace is not available, you will not be able to restore your package. In this scenario, to restore the deleted package, you must delete the new package that uses the deleted package's namespace first.
If the package_type
belongs to a GitHub Packages registry that supports granular permissions, the authenticated user must have admin permissions to the package. For the list of these registries, see "About permissions for GitHub Packages."
OAuth app tokens and personal access tokens (classic) need the read:packages
and write:packages
scopes to use this endpoint. For more information, see "About permissions for GitHub Packages."
Jetons d’accès affinés pour « Restore a package for a user »
Ce point de terminaison fonctionne avec les types de jetons précis suivants:
Le jeton précis ne nécessite aucune autorisation.
Paramètres pour « Restore a package for a user »
Nom, Type, Description |
---|
accept string Setting to |
Nom, Type, Description |
---|
package_type string ObligatoireThe type of supported package. Packages in GitHub's Gradle registry have the type Peut être: |
package_name string ObligatoireThe name of the package. |
username string ObligatoireThe handle for the GitHub user account. |
Nom, Type, Description |
---|
token string package token |
Codes d’état de la réponse HTTP pour « Restore a package for a user »
Code d’état | Description |
---|---|
204 | No Content |
401 | Requires authentication |
403 | Forbidden |
404 | Resource not found |
Exemples de code pour « Restore a package for a user »
Exemple de requête
curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
http(s)://HOSTNAME/api/v3/users/USERNAME/packages/PACKAGE_TYPE/PACKAGE_NAME/restore
Response
Status: 204
List package versions for a package owned by a user
Lists package versions for a public package owned by a specified user.
OAuth app tokens and personal access tokens (classic) need the read:packages
scope to use this endpoint. For more information, see "About permissions for GitHub Packages."
Jetons d’accès affinés pour « List package versions for a package owned by a user »
Ce point de terminaison fonctionne avec les types de jetons précis suivants:
Le jeton précis ne nécessite aucune autorisation.
Paramètres pour « List package versions for a package owned by a user »
Nom, Type, Description |
---|
accept string Setting to |
Nom, Type, Description |
---|
package_type string ObligatoireThe type of supported package. Packages in GitHub's Gradle registry have the type Peut être: |
package_name string ObligatoireThe name of the package. |
username string ObligatoireThe handle for the GitHub user account. |
Codes d’état de la réponse HTTP pour « List package versions for a package owned by a user »
Code d’état | Description |
---|---|
200 | OK |
401 | Requires authentication |
403 | Forbidden |
404 | Resource not found |
Exemples de code pour « List package versions for a package owned by a user »
Exemple de requête
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
http(s)://HOSTNAME/api/v3/users/USERNAME/packages/PACKAGE_TYPE/PACKAGE_NAME/versions
Response
Status: 200
[
{
"id": 3497268,
"name": "0.3.0",
"url": "https://HOSTNAME/users/octocat/packages/rubygems/octo-name/versions/3497268",
"package_html_url": "https://github.com/octocat/octo-name-repo/packages/40201",
"license": "MIT",
"created_at": "2020-08-31T15:22:11Z",
"updated_at": "2020-08-31T15:22:12Z",
"description": "Project for octocats",
"html_url": "https://github.com/octocat/octo-name-repo/packages/40201?version=0.3.0",
"metadata": {
"package_type": "rubygems"
}
},
{
"id": 387039,
"name": "0.2.0",
"url": "https://HOSTNAME/users/octocat/packages/rubygems/octo-name/versions/387039",
"package_html_url": "https://github.com/octocat/octo-name-repo/packages/40201",
"license": "MIT",
"created_at": "2019-12-01T20:49:29Z",
"updated_at": "2019-12-01T20:49:30Z",
"description": "Project for octocats",
"html_url": "https://github.com/octocat/octo-name-repo/packages/40201?version=0.2.0",
"metadata": {
"package_type": "rubygems"
}
},
{
"id": 169770,
"name": "0.1.0",
"url": "https://HOSTNAME/users/octocat/packages/rubygems/octo-name/versions/169770",
"package_html_url": "https://github.com/octocat/octo-name-repo/packages/40201",
"license": "MIT",
"created_at": "2019-10-20T14:17:14Z",
"updated_at": "2019-10-20T14:17:15Z",
"html_url": "https://github.com/octocat/octo-name-repo/packages/40201?version=0.1.0",
"metadata": {
"package_type": "rubygems"
}
}
]
Get a package version for a user
Gets a specific package version for a public package owned by a specified user.
OAuth app tokens and personal access tokens (classic) need the read:packages
scope to use this endpoint. For more information, see "About permissions for GitHub Packages."
Jetons d’accès affinés pour « Get a package version for a user »
Ce point de terminaison fonctionne avec les types de jetons précis suivants:
Le jeton précis ne nécessite aucune autorisation.
Paramètres pour « Get a package version for a user »
Nom, Type, Description |
---|
accept string Setting to |
Nom, Type, Description |
---|
package_type string ObligatoireThe type of supported package. Packages in GitHub's Gradle registry have the type Peut être: |
package_name string ObligatoireThe name of the package. |
package_version_id integer ObligatoireUnique identifier of the package version. |
username string ObligatoireThe handle for the GitHub user account. |
Codes d’état de la réponse HTTP pour « Get a package version for a user »
Code d’état | Description |
---|---|
200 | OK |
Exemples de code pour « Get a package version for a user »
Exemple de requête
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
http(s)://HOSTNAME/api/v3/users/USERNAME/packages/PACKAGE_TYPE/PACKAGE_NAME/versions/PACKAGE_VERSION_ID
Response
Status: 200
{
"id": 387039,
"name": "0.2.0",
"url": "https://HOSTNAME/users/octocat/packages/rubygems/octo-name/versions/387039",
"package_html_url": "https://github.com/octocat/octo-name-repo/packages/40201",
"license": "MIT",
"created_at": "2019-12-01T20:49:29Z",
"updated_at": "2019-12-01T20:49:30Z",
"description": "Octo-name client for Ruby",
"html_url": "https://github.com/octocat/octo-name-repo/packages/40201?version=0.2.0",
"metadata": {
"package_type": "rubygems"
}
}
Delete package version for a user
Deletes a specific package version for a user. If the package is public and the package version has more than 5,000 downloads, you cannot delete the package version. In this scenario, contact GitHub support for further assistance.
If the package_type
belongs to a GitHub Packages registry that supports granular permissions, the authenticated user must have admin permissions to the package. For the list of these registries, see "About permissions for GitHub Packages."
OAuth app tokens and personal access tokens (classic) need the read:packages
and delete:packages
scopes to use this endpoint. For more information, see "About permissions for GitHub Packages."
Jetons d’accès affinés pour « Delete package version for a user »
Ce point de terminaison fonctionne avec les types de jetons précis suivants:
Le jeton précis ne nécessite aucune autorisation.
Paramètres pour « Delete package version for a user »
Nom, Type, Description |
---|
accept string Setting to |
Nom, Type, Description |
---|
package_type string ObligatoireThe type of supported package. Packages in GitHub's Gradle registry have the type Peut être: |
package_name string ObligatoireThe name of the package. |
username string ObligatoireThe handle for the GitHub user account. |
package_version_id integer ObligatoireUnique identifier of the package version. |
Codes d’état de la réponse HTTP pour « Delete package version for a user »
Code d’état | Description |
---|---|
204 | No Content |
401 | Requires authentication |
403 | Forbidden |
404 | Resource not found |
Exemples de code pour « Delete package version for a user »
Exemple de requête
curl -L \
-X DELETE \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
http(s)://HOSTNAME/api/v3/users/USERNAME/packages/PACKAGE_TYPE/PACKAGE_NAME/versions/PACKAGE_VERSION_ID
Response
Status: 204
Restore package version for a user
Restores a specific package version for a user.
You can restore a deleted package under the following conditions:
- The package was deleted within the last 30 days.
- The same package namespace and version is still available and not reused for a new package. If the same package namespace is not available, you will not be able to restore your package. In this scenario, to restore the deleted package, you must delete the new package that uses the deleted package's namespace first.
If the package_type
belongs to a GitHub Packages registry that supports granular permissions, the authenticated user must have admin permissions to the package. For the list of these registries, see "About permissions for GitHub Packages."
OAuth app tokens and personal access tokens (classic) need the read:packages
and write:packages
scopes to use this endpoint. For more information, see "About permissions for GitHub Packages."
Jetons d’accès affinés pour « Restore package version for a user »
Ce point de terminaison fonctionne avec les types de jetons précis suivants:
Le jeton précis ne nécessite aucune autorisation.
Paramètres pour « Restore package version for a user »
Nom, Type, Description |
---|
accept string Setting to |
Nom, Type, Description |
---|
package_type string ObligatoireThe type of supported package. Packages in GitHub's Gradle registry have the type Peut être: |
package_name string ObligatoireThe name of the package. |
username string ObligatoireThe handle for the GitHub user account. |
package_version_id integer ObligatoireUnique identifier of the package version. |
Codes d’état de la réponse HTTP pour « Restore package version for a user »
Code d’état | Description |
---|---|
204 | No Content |
401 | Requires authentication |
403 | Forbidden |
404 | Resource not found |
Exemples de code pour « Restore package version for a user »
Exemple de requête
curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
http(s)://HOSTNAME/api/v3/users/USERNAME/packages/PACKAGE_TYPE/PACKAGE_NAME/versions/PACKAGE_VERSION_ID/restore
Response
Status: 204