http://localhost:8081/service/rest/beta/search?repository=yum-hosted&format=yum&name=hello
{
"items": [
{
"id": "eXVtLWhvc3RlZDoyMTAzMWRmYWY0NWU1YjU4MzYxNTRiYWEwZGMyMWYwYw",
"repository": "yum-hosted",
"format": "yum",
"group": null,
"name": "hello",
"version": "0.3-1.el7.centos",
"assets": [
{
"downloadUrl": "http://localhost:8081/repository/yum-hosted/packages/hello-0.3-1.el7.centos.x86_64.rpm",
"path": "packages/hello-0.3-1.el7.centos.x86_64.rpm",
"id": "eXVtLWhvc3RlZDpkNmU0YTUwYWJhM2M4YTE5ZmU3NjQ1OTFhMDlkOTY0YQ",
"repository": "yum-hosted",
"format": "yum",
"checksum": {
"sha1": "7f6eb40c02462fe1b633ecbbf86f981670cb4b16",
"sha512": "a49126e4c4a834fc17f653fb7e2124618ce3be28f67195fc28f88652f25522e9bb0b456e5bad0bd08a89ab1693d52bf81ec7bc0ff59f00c71a3cee8c9726d5f9",
"sha256": "aaff8223090388abc9a3216f2aecf3448098c6f373beee919698995bab67d12d",
"md5": "86231c84a1d4c3ab837fde7fd42c6d9b"
}
}
],
"tags": []
}
],
"continuationToken": null
}
http://localhost:8081/service/rest/beta/components/eXVtLWhvc3RlZDoyMTAzMWRmYWY0NWU1YjU4MzYxNTRiYWEwZGMyMWYwYw
http://localhost:8081/service/rest/beta/search?repository=yum-hosted&format=yum&name=hello
{
"items": [],
"continuationToken": null
}
Hi Sverre,You are able to DELETE using the REST API.I would suggest to firstly use the search endpoint, for example:http://localhost:8081/service/rest/beta/search?repository=yum-hosted&format=yum&name=hellothis should respond with:{
"items": [
{
"id": "eXVtLWhvc3RlZDoyMTAzMWRmYWY0NWU1YjU4MzYxNTRiYWEwZGMyMWYwYw",
"repository": "yum-hosted",
"format": "yum",
"group": null,
"name": "hello",
"version": "0.3-1.el7.centos",
"assets": [
{
"downloadUrl": "http://localhost:8081/repository/yum-hosted/packages/hello-0.3-1.el7.centos.x86_64.rpm",
"path": "packages/hello-0.3-1.el7.centos.x86_64.rpm",
"id": "eXVtLWhvc3RlZDpkNmU0YTUwYWJhM2M4YTE5ZmU3NjQ1OTFhMDlkOTY0YQ",
then use the "id" value as highlighted in the example above to delete the component:http://localhost:8081/service/rest/beta/components/eXVtLWhvc3RlZDoyMTAzMWRmYWY0NWU1YjU4MzYxNTRiYWEwZGMyMWYwYw
http://localhost:8081/service/rest/beta/search?repository=yum-hosted&format=yum&name=bakefile&version=0.2.8-3.el6.centos
returns the following (note two assets of different architectures are present for the same rpm):
{
"items": [
{
"id": "eXVtLWhvc3RlZDpkMDY0ODA0YThlZDVhZDZlNjhmZGU5MWNmM2NiZTgzMw",
"repository": "yum-hosted",
"format": "yum",
"group": null,
"name": "bakefile",
"version": "0.2.8-3.el6.centos",
"assets": [
{
"downloadUrl": "http://localhost:8081/repository/yum-hosted/Packages/bakefile-0.2.8-3.el6.centos.i686.rpm",
"path": "Packages/bakefile-0.2.8-3.el6.centos.i686.rpm",
"id": "eXVtLWhvc3RlZDoyZmZmNTA5YTdjMmE5ZWJlMjI1MmIxNTY5OWI3MzdjYg",
"repository": "yum-hosted",
"format": "yum",
"checksum": {
"sha1": "998b85a31cf312a606d60f8bdd39ba4e0a8a6c48",
"sha512": "1d46970a27058884860da581cd569a75c7266e31c7512f9eced9613e663bd9796ea0b117eea442fe69950d37cc6d2b4c6ed07dfd14ef1e847a719b4fd1817c78",
"sha256": "4dbabf0c42761b478cd64379d46ed903567e655ca1d345f16e17c5ffb122563b",
"md5": "0b59132945f9d60ec000e21c480d864a"
}
},
{
"downloadUrl": "http://localhost:8081/repository/yum-hosted/Packages/bakefile-0.2.8-3.el6.centos.x86_64.rpm",
"path": "Packages/bakefile-0.2.8-3.el6.centos.x86_64.rpm",
"id": "eXVtLWhvc3RlZDoyNGMxZmUzMzVkMjY2NTJmODdmYTdhNzQ5ZWI0YTUwYQ",
"repository": "yum-hosted",
"format": "yum",
"checksum": {
"sha1": "24ec6ddf8bbcdf0eefaed3daeac705747f025eb9",
"sha512": "6d2f131fac7fb69073c88bfbe7f689b54b0e1d943292483e8a455d80764fd8183f2cbdbf05cb4c9071a36ca3897bd61c4fabbf204c276b73df0f7cac195c32b3",
"sha256": "261f2006a15aae21008181b687878d8b81081b52a1df74f82e8cc326c40c78c3",
"md5": "71c01c1f9a0f155650e517609ecc065a"
}
}
],
"tags": []
}
],
"continuationToken": null
then issuing:
http://localhost:8081/service/rest/beta/assets/eXVtLWhvc3RlZDoyZmZmNTA5YTdjMmE5ZWJlMjI1MmIxNTY5OWI3MzdjYg
Hi Sverre,
Hope that helpsMark
Hi Sverre,
Currently the REST API is assumed to have a 1-1 relationship between asset and component. So, deleting a component will delete all assets that are associated with the component and deleting an asset will in turn delete its associated component which will then iterate through all the remaining assets.
In the case of yum the same RPMs that have different architectures will be associated with the same component.
{
"items" : [ {
"id" : "cmVsZWFzZXJlcG86NzZkN2Q3ZTQxODZhMzkwZjdhODQ5ODE0OGUxZDkxYjc",
"repository" : "releaserepo",
"format" : "yum",
"group" : null,
"name" : "my-package",
"version" : "1.1.0-master.c245a45",
"assets" : [ {
"downloadUrl" : "https://nexus.company.com:8443/repository/releaserepo/master/opensuse42.3/x86_64/my-package-1.1.0-master.c245a45.x86_64.rpm",
"path" : "master/opensuse42.3/x86_64/my-package-1.1.0-master.c245a45.x86_64.rpm",
"id" : "cmVsZWFzZXJlcG86MGFiODBhNzQzOTIxZTQyNjkxOWQ4ZGZkNDZiMWE3NmU",
"repository" : "releaserepo",
"format" : "yum",
"checksum" : {
"sha1" : "b009716ea836c5556b5176ea37ffe799074be3db",
"sha512" : "880770918d95855c60dda52270140933ac6df23617b91d5ca9aabda80dad7455dc9ebe174578a67b7461ce0596bbbc8ff171d9cad8cf6ca89ee73cf4ea458c17",
"sha256" : "27c8d51f52cde2c0c4ed3295a491110494e3db218202de2925c60e79a1ad6e05",
"md5" : "d82c460890456e6b5cd06645b97941c1"
}
}, {
"downloadUrl" : "https://nexus.company.com:8443/repository/releaserepo/master/sles12.3/x86_64/my-package-1.1.0-master.c245a45.x86_64.rpm",
"path" : "master/sles12.3/x86_64/my-package-1.1.0-master.c245a45.x86_64.rpm",
"id" : "cmVsZWFzZXJlcG86ZDQ4MTE3NTQxZGNiODllYzg0MGIzMjIxN2Q5YjNhNTM",
"repository" : "releaserepo",
"format" : "yum",
"checksum" : {
"sha1" : "1c46b06a3a48ede07cddcc941db0019eddf16caa",
"sha512" : "72df390912eb01d3f27f3abb40382c0330d0e5930c402556a2e8ab39b05e2f28fc19abd1089d0f1fc01d66cde134fc3a711d85459bd5e97e9716fee7f21976a2",
"sha256" : "f190bb23842cad4602682c4408651d71c8bee3d7dba20545a81f769d294e67a4",
"md5" : "76c3b1e33c0af35da2622228fd211d43"
}
} ]
}, {
"id" : "cmVsZWFzZXJlcG86ZGZiZWYwOWVmZTE2NDRlYTE3ZmQzNTMyNjk0ZWYyMjA",
"repository" : "releaserepo",
"format" : "yum",
"group" : null,
"name" : "my-package",
"version" : "1.0.0-ReleaseA.a45bc3a",
"assets" : [ {
"downloadUrl" : "https://nexus.company.com:8443/repository/releaserepo/ReleaseA/opensuse42.3/x86_64/my-package-1.0.0-ReleaseA.a45bc3a.x86_64.rpm",
"path" : "ReleaseA/opensuse42.3/x86_64/my-package-1.0.0-ReleaseA.a45bc3a.x86_64.rpm",
"id" : "cmVsZWFzZXJlcG86ZDQ4MTE3NTQxZGNiODllY2E3MzBlYTczYTNkNTBlNmI",
"repository" : "releaserepo",
"format" : "yum",
"checksum" : {
"sha1" : "f74859c1707dd6e32f9e61ce5cb830e359c267ea",
"sha512" : "03c907b61653e84d5efa4e85ed7c3939f6dc6bd3c7f1cc1c449e9c9eaaad51d006533b6b842e6b675ab26deb906e3eb26e8a6b9be4fcb1563a60bd7124c6ebac",
"sha256" : "3b4df734513af567f877f29f35e79c6f61961a3e47ba1e9cb7f5f920579d1664",
"md5" : "844a3c484b5cf4b4c1c2effafd385df4"
}
}, {
"downloadUrl" : "https://nexus.company.com:8443/repository/releaserepo/ReleaseA/sles12.3/x86_64/my-package-1.0.0-ReleaseA.a45bc3a.x86_64.rpm",
"path" : "ReleaseA/sles12.3/x86_64/my-package-1.0.0-ReleaseA.a45bc3a.x86_64.rpm",
"id" : "cmVsZWFzZXJlcG86MTNiMjllNDQ5ZjBlM2I4ZDY4OGI2ZWQ3YzdjODk2MzI",
"repository" : "releaserepo",
"format" : "yum",
"checksum" : {
"sha1" : "9c7c3c0a09e2d7d43f58e0146c7f915eeb569468",
"sha512" : "e31a13e75278939237baaa2f249ff526bf52782f6419695bdfe826fe49ff28d04a7705b54be6a7a7ef4d8b39925efec51197b1b3e0c8913745ffb2a69e562e0a",
"sha256" : "f75bb7007cadfd473e1581c621fd3fc8c588a8f7302e561192276fb95c512415",
"md5" : "c296e7523fda85e9b66594932f6bda25"
}
} ]
} ],
"continuationToken" : null
}