-
Task
-
Resolution: Done
-
Undefined
-
None
Goal:
Return the full url to a snapshot along with each snapshot json.
Acceptance Criteria:
Today a snapshot returned contains the repository_path, but not the full url.
we should add a new attribute 'url' that contains the full url to the snapshot. This url will be made up of 3 pieces of information:
a) the content server: https://somehostname/
b) the path prefix: /pulp/content
c) the path to the repo version /abcd/efgh-ijkl/mnopq-srtvu/
a & b can come from the pulp status call:
"content_settings":
{ "content_origin": "http://pulp_content:24816", "content_path_prefix": "/pulp/content/" },
we will need to fetch that (and cache it in redis, can have a long life (hour)).
c) already exists today on the snapshots model
- In addition, lets add uuid to the snapshot response as well
Also, add a new api endpoint:
/api/content-sources/v1.0/repositories/$UUID/snapshots/$UUID/config.repo
Thils would generate a repo config that looks like this:
[$REPO_ID]
name=$REPO_NAME
baseurl=$SNAPSHOT_URL
gpgcheck=0
repo_gpgcheck=0
enabled=1
The $REPO_ID here needs to conform to yum repo id standard, we may have to do a name.replace(" ", "_") or something to make it work on a client
- This api should still be documented via our openapi schema, you can use @produce plain to dictate the type of content being returned: https://github.com/swaggo/swag#general-api-info https://github.com/swaggo/swag#mime-types