pulp / pulp_container

Pulp Container Registry
https://docs.pulpproject.org/pulp_container/
GNU General Public License v2.0
23 stars 45 forks source link

Add a new serializer related field pointing to the PRN #1793

Open git-hyagi opened 1 month ago

git-hyagi commented 1 month ago

Is your feature request related to a problem? Please describe. Now that the support to PRN has been released, we could add some serialized related fields to "point" to the corresponding PRN value too.

Describe the solution you'd like For example, when I retrieve the list of blobs, artifact will output the pulp_href from the artifact:

$ pulp container content -tblob list
[{
    "pulp_href": "/pulp/api/v3/content/container/blobs/01927297-4d46-70da-afda-b31f1096674e/",
    "prn": "prn:container.blob:01927297-4d46-70da-afda-b31f1096674e",
    "pulp_created": "2024-10-09T18:42:51.335387Z",
    "pulp_last_updated": "2024-10-09T18:42:51.335416Z",
    "artifact": "/pulp/api/v3/artifacts/01927297-4cfc-705d-b421-2a4475250f19/",    <-------------    
    "digest": "sha256:8a42acc72d918655d404d0b043616b95198b234fdd608fb177cb96cd18713721"
},

an idea of output (artifact_prn):

[{
    "pulp_href": "/pulp/api/v3/content/container/blobs/01927297-4d46-70da-afda-b31f1096674e/",
    "prn": "prn:container.blob:01927297-4d46-70da-afda-b31f1096674e",
    "pulp_created": "2024-10-09T18:42:51.335387Z",
    "pulp_last_updated": "2024-10-09T18:42:51.335416Z",
    "artifact": "/pulp/api/v3/artifacts/01927297-4cfc-705d-b421-2a4475250f19/",
    "artifact_prn": "prn:core.artifact:01927297-4cfc-705d-b421-2a4475250f19",   <----------- new serialized field
    "digest": "sha256:8a42acc72d918655d404d0b043616b95198b234fdd608fb177cb96cd18713721"
},

another example is for tagged_manifest in the tag list:

$ pulp container content -ttag list
[
  {
    "pulp_href": "/pulp/api/v3/content/container/tags/01927297-4ded-7c39-a2a7-7b1b00dc6466/",
    "prn": "prn:container.tag:01927297-4ded-7c39-a2a7-7b1b00dc6466",
    "pulp_created": "2024-10-09T18:42:51.502500Z",
    "pulp_last_updated": "2024-10-09T18:42:51.502534Z",
    "name": "sha256-b5632cfdad13519406ab9bf454996cc4ed698b0938217bec4dca1a10c6cf5102.sig",
    "tagged_manifest": "/pulp/api/v3/content/container/manifests/01927297-4dd4-7c99-9224-671bca9ae8e6/"    <-----------
  },

with the "new" tagged_manifest_prn field:

$ pulp container content -ttag list
[
  {
    "pulp_href": "/pulp/api/v3/content/container/tags/01927297-4ded-7c39-a2a7-7b1b00dc6466/",
    "prn": "prn:container.tag:01927297-4ded-7c39-a2a7-7b1b00dc6466",
    "pulp_created": "2024-10-09T18:42:51.502500Z",
    "pulp_last_updated": "2024-10-09T18:42:51.502534Z",
    "name": "sha256-b5632cfdad13519406ab9bf454996cc4ed698b0938217bec4dca1a10c6cf5102.sig",
    "tagged_manifest": "/pulp/api/v3/content/container/manifests/01927297-4dd4-7c99-9224-671bca9ae8e6/",
    "tagged_manifest_prn": "prn:container.manifest:01927297-4dd4-7c99-9224-671bca9ae8e6" <----------- new serialized field
  },