From 76b9c78a6ccfd70137614465246f98a1ac0a977d Mon Sep 17 00:00:00 2001 From: schutzbot Date: Mon, 16 Sep 2024 06:21:41 +0000 Subject: [PATCH] internal: update api specs --- .../content_sources/content-sources.v1.json | 95 ++++++++++++++++++- .../clients/content_sources/openapi.v1.gen.go | 12 +++ 2 files changed, 104 insertions(+), 3 deletions(-) diff --git a/internal/clients/content_sources/content-sources.v1.json b/internal/clients/content_sources/content-sources.v1.json index b84fd5734..0cbb4a422 100644 --- a/internal/clients/content_sources/content-sources.v1.json +++ b/internal/clients/content_sources/content-sources.v1.json @@ -976,10 +976,18 @@ "description": "Count of each content type", "type": "object" }, + "repository_name": { + "description": "Name of repository the snapshot belongs to", + "type": "string" + }, "repository_path": { "description": "Path to repository snapshot contents", "type": "string" }, + "repository_uuid": { + "description": "UUID of the repository the snapshot belongs to", + "type": "string" + }, "url": { "description": "URL to the snapshot's content", "type": "string" @@ -2344,8 +2352,8 @@ } }, "required": [ - "sha256", - "file" + "file", + "sha256" ], "type": "object" } @@ -3253,7 +3261,7 @@ "/repositories/{uuid}/snapshots/": { "get": { "description": "List snapshots of a repository.", - "operationId": "listSnapshots", + "operationId": "listSnapshotsForRepo", "parameters": [ { "description": "Repository ID.", @@ -5369,6 +5377,87 @@ "rpms" ] } + }, + "/templates/{uuid}/snapshots/": { + "get": { + "description": "List snapshots for a template.", + "operationId": "listSnapshotsForTemplate", + "parameters": [ + { + "description": "Template ID.", + "in": "path", + "name": "uuid", + "required": true, + "schema": { + "type": "string" + } + }, + { + "description": "Search through snapshots by repository name.", + "in": "query", + "name": "repository_search", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/api.SnapshotCollectionResponse" + } + } + }, + "description": "OK" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors.ErrorResponse" + } + } + }, + "description": "Bad Request" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors.ErrorResponse" + } + } + }, + "description": "Unauthorized" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors.ErrorResponse" + } + } + }, + "description": "Not Found" + }, + "500": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors.ErrorResponse" + } + } + }, + "description": "Internal Server Error" + } + }, + "summary": "List snapshots for a template", + "tags": [ + "snapshots" + ] + } } }, "servers": [ diff --git a/internal/clients/content_sources/openapi.v1.gen.go b/internal/clients/content_sources/openapi.v1.gen.go index 15675f321..ddcb767c9 100644 --- a/internal/clients/content_sources/openapi.v1.gen.go +++ b/internal/clients/content_sources/openapi.v1.gen.go @@ -592,9 +592,15 @@ type ApiSnapshotResponse struct { // RemovedCounts Count of each content type RemovedCounts *map[string]int `json:"removed_counts,omitempty"` + // RepositoryName Name of repository the snapshot belongs to + RepositoryName *string `json:"repository_name,omitempty"` + // RepositoryPath Path to repository snapshot contents RepositoryPath *string `json:"repository_path,omitempty"` + // RepositoryUuid UUID of the repository the snapshot belongs to + RepositoryUuid *string `json:"repository_uuid,omitempty"` + // Url URL to the snapshot's content Url *string `json:"url,omitempty"` Uuid *string `json:"uuid,omitempty"` @@ -1112,6 +1118,12 @@ type ListTemplateRpmsParams struct { Search *string `form:"search,omitempty" json:"search,omitempty"` } +// ListSnapshotsForTemplateParams defines parameters for ListSnapshotsForTemplate. +type ListSnapshotsForTemplateParams struct { + // RepositorySearch Search through snapshots by repository name. + RepositorySearch *string `form:"repository_search,omitempty" json:"repository_search,omitempty"` +} + // SearchEnvironmentsJSONRequestBody defines body for SearchEnvironments for application/json ContentType. type SearchEnvironmentsJSONRequestBody = ApiContentUnitSearchRequest