diff --git a/CHANGELOG.md b/CHANGELOG.md index 2db46df..f8fc381 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file. and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [0.9.7] - 2024-10-16 + + + ## [0.9.6] - 2024-09-19 ### Fixed diff --git a/VERSION b/VERSION index 85b7c69..c81aa44 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.9.6 +0.9.7 diff --git a/docs/_posts/2024-10-16-v0.9.7.markdown b/docs/_posts/2024-10-16-v0.9.7.markdown new file mode 100644 index 0000000..c8e7d8c --- /dev/null +++ b/docs/_posts/2024-10-16-v0.9.7.markdown @@ -0,0 +1,12 @@ +--- +layout: post +title: "Release 0.9.7" +date: 2024-10-16 00:00:00 +0000 +categories: release notes +--- + +# Whats New + + + + diff --git a/docs/charts/index.yaml b/docs/charts/index.yaml index 84bf884..a43aca4 100644 --- a/docs/charts/index.yaml +++ b/docs/charts/index.yaml @@ -1,9 +1,19 @@ apiVersion: v1 entries: parallels-devops-service: + - apiVersion: v2 + appVersion: 0.9.7 + created: "2024-10-16T08:24:59.803645445Z" + description: Parallels Desktop DevOps Service + digest: 396312f141385223901192f2f13f72395ea30a944d72f0ce9c2a6c59facd8ba7 + name: parallels-devops-service + type: application + urls: + - https://parallels.github.io/prl-devops-service/charts/parallels-devops-service-0.9.7.tgz + version: 0.9.7 - apiVersion: v2 appVersion: 0.9.6 - created: "2024-09-19T15:44:10.39121467Z" + created: "2024-10-16T08:24:59.803165179Z" description: Parallels Desktop DevOps Service digest: 4e2fc1874fa739c7102cbf4af826d4cd2fbcd47064f9af612740b37d357e4ee8 name: parallels-devops-service @@ -13,7 +23,7 @@ entries: version: 0.9.6 - apiVersion: v2 appVersion: 0.9.5 - created: "2024-09-19T15:44:10.390739336Z" + created: "2024-10-16T08:24:59.802705973Z" description: Parallels Desktop DevOps Service digest: 180c122e46f302d9b147cf5a00013c07e691622b31d8c90ab94a509930b80912 name: parallels-devops-service @@ -23,7 +33,7 @@ entries: version: 0.9.5 - apiVersion: v2 appVersion: 0.9.4 - created: "2024-09-19T15:44:10.390287125Z" + created: "2024-10-16T08:24:59.802248189Z" description: Parallels Desktop DevOps Service digest: f91734acdde18ba59ac6951d65b893d629e3a72b8a781213e83ca7859d151fcc name: parallels-devops-service @@ -33,7 +43,7 @@ entries: version: 0.9.4 - apiVersion: v2 appVersion: 0.9.3 - created: "2024-09-19T15:44:10.389806451Z" + created: "2024-10-16T08:24:59.801789594Z" description: Parallels Desktop DevOps Service digest: acdff683cf5424839d19e79981c51faab23b41a49c9f08d040dbcc6e4d36e211 name: parallels-devops-service @@ -43,7 +53,7 @@ entries: version: 0.9.3 - apiVersion: v2 appVersion: 0.9.2 - created: "2024-09-19T15:44:10.389340445Z" + created: "2024-10-16T08:24:59.801323835Z" description: Parallels Desktop DevOps Service digest: a4af67f14b31814afb94a9b73897b5be917c2899c9ed13a25529394602c059ed name: parallels-devops-service @@ -53,7 +63,7 @@ entries: version: 0.9.2 - apiVersion: v2 appVersion: 0.9.1 - created: "2024-09-19T15:44:10.388826578Z" + created: "2024-10-16T08:24:59.800850111Z" description: Parallels Desktop DevOps Service digest: 2d667bdb44556fa0bdfb44f2d3478e21fcd4c5a4517cb267110e63983a1349e3 name: parallels-devops-service @@ -63,7 +73,7 @@ entries: version: 0.9.1 - apiVersion: v2 appVersion: 0.9.0 - created: "2024-09-19T15:44:10.387607066Z" + created: "2024-10-16T08:24:59.800338908Z" description: Parallels Desktop DevOps Service digest: ae9d8d8653c4984a3a0356e00c29e05b0feaa1dbbd02ca29859f23e56b2cdfb2 name: parallels-devops-service @@ -73,7 +83,7 @@ entries: version: 0.9.0 - apiVersion: v2 appVersion: 0.8.8 - created: "2024-09-19T15:44:10.387131111Z" + created: "2024-10-16T08:24:59.794922581Z" description: Parallels Desktop DevOps Service digest: 5ca196b55adda87d355e32858312e5b5f69c4852eb8e379100eda1c994a0b68a name: parallels-devops-service @@ -83,7 +93,7 @@ entries: version: 0.8.8 - apiVersion: v2 appVersion: 0.8.7 - created: "2024-09-19T15:44:10.386668821Z" + created: "2024-10-16T08:24:59.794440863Z" description: Parallels Desktop DevOps Service digest: bf903453bc8c261c699518200304a6fb1774c83c22f4e18ec27fb6ea9b189597 name: parallels-devops-service @@ -93,7 +103,7 @@ entries: version: 0.8.7 - apiVersion: v2 appVersion: 0.8.6 - created: "2024-09-19T15:44:10.3862537Z" + created: "2024-10-16T08:24:59.794017263Z" description: Parallels Desktop DevOps Service digest: 49ebd0f2a07d40e7fcc1e2c480ded7c33a2701bdbc306b9ecb4fe26b3bfbfd0a name: parallels-devops-service @@ -103,7 +113,7 @@ entries: version: 0.8.6 - apiVersion: v2 appVersion: 0.8.5 - created: "2024-09-19T15:44:10.385809785Z" + created: "2024-10-16T08:24:59.793583223Z" description: Parallels Desktop DevOps Service digest: da5b419934de020af1dc77a83e7ef2614aa09cb71598fa76dcf23b0868d447e2 name: parallels-devops-service @@ -113,7 +123,7 @@ entries: version: 0.8.5 - apiVersion: v2 appVersion: 0.8.4 - created: "2024-09-19T15:44:10.385396999Z" + created: "2024-10-16T08:24:59.793133454Z" description: Parallels Desktop DevOps Service digest: 9ec0f77ebfa1cd0caac2853a9e1ba20b58128bb5115cda32b6136d0475393a6f name: parallels-devops-service @@ -123,7 +133,7 @@ entries: version: 0.8.4 - apiVersion: v2 appVersion: 0.8.3 - created: "2024-09-19T15:44:10.38492443Z" + created: "2024-10-16T08:24:59.792694395Z" description: Parallels Desktop DevOps Service digest: 6b8d93c7857ad5e66cdf09f5247f67f2593cff526c364b027666b1b2ecda396c name: parallels-devops-service @@ -133,7 +143,7 @@ entries: version: 0.8.3 - apiVersion: v2 appVersion: 0.8.2 - created: "2024-09-19T15:44:10.384445389Z" + created: "2024-10-16T08:24:59.792248734Z" description: Parallels Desktop DevOps Service digest: 3db74c9beb62a456dd442f21e52e46bf5e88744af947360c7e95f11ba084a26b name: parallels-devops-service @@ -143,7 +153,7 @@ entries: version: 0.8.2 - apiVersion: v2 appVersion: 0.8.1 - created: "2024-09-19T15:44:10.383907236Z" + created: "2024-10-16T08:24:59.791787824Z" description: Parallels Desktop DevOps Service digest: 94d87635c30adfb14f1e2a402d8f3e5a36c8b65a1e3ec3ed73b9eab87fdc3f69 name: parallels-devops-service @@ -153,7 +163,7 @@ entries: version: 0.8.1 - apiVersion: v2 appVersion: 0.5.4 - created: "2024-09-19T15:44:10.383413358Z" + created: "2024-10-16T08:24:59.791290667Z" description: Parallels Desktop DevOps Service digest: c2bc464c67821348b07472a34d54c7dea01cbd503942628e4342df3b699a3f62 name: parallels-devops-service @@ -161,4 +171,4 @@ entries: urls: - https://parallels.github.io/prl-devops-service/charts/parallels-devops-service-0.5.4.tgz version: 0.5.4 -generated: "2024-09-19T15:44:10.382700076Z" +generated: "2024-10-16T08:24:59.790642047Z" diff --git a/docs/charts/parallels-devops-service-0.9.7.tgz b/docs/charts/parallels-devops-service-0.9.7.tgz new file mode 100644 index 0000000..8d93796 Binary files /dev/null and b/docs/charts/parallels-devops-service-0.9.7.tgz differ diff --git a/helm/Chart.yaml b/helm/Chart.yaml index ae71198..3b6c070 100644 --- a/helm/Chart.yaml +++ b/helm/Chart.yaml @@ -15,5 +15,5 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: "0.9.6" -appVersion: "0.9.6" +version: "0.9.7" +appVersion: "0.9.7" diff --git a/src/controllers/catalog.go b/src/controllers/catalog.go index 5dadf77..25da7be 100644 --- a/src/controllers/catalog.go +++ b/src/controllers/catalog.go @@ -235,16 +235,16 @@ func registerCatalogManifestHandlers(ctx basecontext.ApiContext, version string) Register() } -// @Summary Gets all the remote catalogs -// @Description This endpoint returns all the remote catalogs -// @Tags Catalogs -// @Produce json -// @Success 200 {object} []map[string][]models.CatalogManifest -// @Failure 400 {object} models.ApiErrorResponse -// @Failure 401 {object} models.OAuthErrorResponse -// @Security ApiKeyAuth -// @Security BearerAuth -// @Router /v1/catalog [get] +// @Summary Gets all the remote catalogs +// @Description This endpoint returns all the remote catalogs +// @Tags Catalogs +// @Produce json +// @Success 200 {object} []map[string][]models.CatalogManifest +// @Failure 400 {object} models.ApiErrorResponse +// @Failure 401 {object} models.OAuthErrorResponse +// @Security ApiKeyAuth +// @Security BearerAuth +// @Router /v1/catalog [get] func GetCatalogManifestsHandler() restapi.ControllerHandler { return func(w http.ResponseWriter, r *http.Request) { defer r.Body.Close() @@ -300,17 +300,17 @@ func GetCatalogManifestsHandler() restapi.ControllerHandler { } } -// @Summary Gets all the remote catalogs -// @Description This endpoint returns all the remote catalogs -// @Tags Catalogs -// @Produce json -// @Param catalogId path string true "Catalog ID" -// @Success 200 {object} []models.CatalogManifest -// @Failure 400 {object} models.ApiErrorResponse -// @Failure 401 {object} models.OAuthErrorResponse -// @Security ApiKeyAuth -// @Security BearerAuth -// @Router /v1/catalog/{catalogId} [get] +// @Summary Gets all the remote catalogs +// @Description This endpoint returns all the remote catalogs +// @Tags Catalogs +// @Produce json +// @Param catalogId path string true "Catalog ID" +// @Success 200 {object} []models.CatalogManifest +// @Failure 400 {object} models.ApiErrorResponse +// @Failure 401 {object} models.OAuthErrorResponse +// @Security ApiKeyAuth +// @Security BearerAuth +// @Router /v1/catalog/{catalogId} [get] func GetCatalogManifestHandler() restapi.ControllerHandler { return func(w http.ResponseWriter, r *http.Request) { defer r.Body.Close() @@ -347,18 +347,18 @@ func GetCatalogManifestHandler() restapi.ControllerHandler { } } -// @Summary Gets a catalog manifest version -// @Description This endpoint returns a catalog manifest version -// @Tags Catalogs -// @Produce json -// @Param catalogId path string true "Catalog ID" -// @Param version path string true "Version" -// @Success 200 {object} models.CatalogManifest -// @Failure 400 {object} models.ApiErrorResponse -// @Failure 401 {object} models.OAuthErrorResponse -// @Security ApiKeyAuth -// @Security BearerAuth -// @Router /v1/catalog/{catalogId}/{version} [get] +// @Summary Gets a catalog manifest version +// @Description This endpoint returns a catalog manifest version +// @Tags Catalogs +// @Produce json +// @Param catalogId path string true "Catalog ID" +// @Param version path string true "Version" +// @Success 200 {object} models.CatalogManifest +// @Failure 400 {object} models.ApiErrorResponse +// @Failure 401 {object} models.OAuthErrorResponse +// @Security ApiKeyAuth +// @Security BearerAuth +// @Router /v1/catalog/{catalogId}/{version} [get] func GetCatalogManifestVersionHandler() restapi.ControllerHandler { return func(w http.ResponseWriter, r *http.Request) { defer r.Body.Close() @@ -388,19 +388,19 @@ func GetCatalogManifestVersionHandler() restapi.ControllerHandler { } } -// @Summary Gets a catalog manifest version architecture -// @Description This endpoint returns a catalog manifest version -// @Tags Catalogs -// @Produce json -// @Param catalogId path string true "Catalog ID" -// @Param version path string true "Version" -// @Param architecture path string true "Architecture" -// @Success 200 {object} models.CatalogManifest -// @Failure 400 {object} models.ApiErrorResponse -// @Failure 401 {object} models.OAuthErrorResponse -// @Security ApiKeyAuth -// @Security BearerAuth -// @Router /v1/catalog/{catalogId}/{version}/{architecture} [get] +// @Summary Gets a catalog manifest version architecture +// @Description This endpoint returns a catalog manifest version +// @Tags Catalogs +// @Produce json +// @Param catalogId path string true "Catalog ID" +// @Param version path string true "Version" +// @Param architecture path string true "Architecture" +// @Success 200 {object} models.CatalogManifest +// @Failure 400 {object} models.ApiErrorResponse +// @Failure 401 {object} models.OAuthErrorResponse +// @Security ApiKeyAuth +// @Security BearerAuth +// @Router /v1/catalog/{catalogId}/{version}/{architecture} [get] func GetCatalogManifestVersionArchitectureHandler() restapi.ControllerHandler { return func(w http.ResponseWriter, r *http.Request) { defer r.Body.Close() @@ -431,19 +431,19 @@ func GetCatalogManifestVersionArchitectureHandler() restapi.ControllerHandler { } } -// @Summary Downloads a catalog manifest version -// @Description This endpoint downloads a catalog manifest version -// @Tags Catalogs -// @Produce json -// @Param catalogId path string true "Catalog ID" -// @Param version path string true "Version" -// @Param architecture path string true "Architecture" -// @Success 200 {object} models.CatalogManifest -// @Failure 400 {object} models.ApiErrorResponse -// @Failure 401 {object} models.OAuthErrorResponse -// @Security ApiKeyAuth -// @Security BearerAuth -// @Router /v1/catalog/{catalogId}/{version}/{architecture}/download [get] +// @Summary Downloads a catalog manifest version +// @Description This endpoint downloads a catalog manifest version +// @Tags Catalogs +// @Produce json +// @Param catalogId path string true "Catalog ID" +// @Param version path string true "Version" +// @Param architecture path string true "Architecture" +// @Success 200 {object} models.CatalogManifest +// @Failure 400 {object} models.ApiErrorResponse +// @Failure 401 {object} models.OAuthErrorResponse +// @Security ApiKeyAuth +// @Security BearerAuth +// @Router /v1/catalog/{catalogId}/{version}/{architecture}/download [get] func DownloadCatalogManifestVersionHandler() restapi.ControllerHandler { return func(w http.ResponseWriter, r *http.Request) { defer r.Body.Close() @@ -495,19 +495,19 @@ func DownloadCatalogManifestVersionHandler() restapi.ControllerHandler { } } -// @Summary Taints a catalog manifest version -// @Description This endpoint Taints a catalog manifest version -// @Tags Catalogs -// @Produce json -// @Param catalogId path string true "Catalog ID" -// @Param version path string true "Version" -// @Param architecture path string true "Architecture" -// @Success 200 {object} models.CatalogManifest -// @Failure 400 {object} models.ApiErrorResponse -// @Failure 401 {object} models.OAuthErrorResponse -// @Security ApiKeyAuth -// @Security BearerAuth -// @Router /v1/catalog/{catalogId}/{version}/{architecture}/taint [patch] +// @Summary Taints a catalog manifest version +// @Description This endpoint Taints a catalog manifest version +// @Tags Catalogs +// @Produce json +// @Param catalogId path string true "Catalog ID" +// @Param version path string true "Version" +// @Param architecture path string true "Architecture" +// @Success 200 {object} models.CatalogManifest +// @Failure 400 {object} models.ApiErrorResponse +// @Failure 401 {object} models.OAuthErrorResponse +// @Security ApiKeyAuth +// @Security BearerAuth +// @Router /v1/catalog/{catalogId}/{version}/{architecture}/taint [patch] func TaintCatalogManifestVersionHandler() restapi.ControllerHandler { return func(w http.ResponseWriter, r *http.Request) { defer r.Body.Close() @@ -560,19 +560,19 @@ func TaintCatalogManifestVersionHandler() restapi.ControllerHandler { } } -// @Summary UnTaints a catalog manifest version -// @Description This endpoint UnTaints a catalog manifest version -// @Tags Catalogs -// @Produce json -// @Param catalogId path string true "Catalog ID" -// @Param version path string true "Version" -// @Param architecture path string true "Architecture" -// @Success 200 {object} models.CatalogManifest -// @Failure 400 {object} models.ApiErrorResponse -// @Failure 401 {object} models.OAuthErrorResponse -// @Security ApiKeyAuth -// @Security BearerAuth -// @Router /v1/catalog/{catalogId}/{version}/{architecture}/untaint [patch] +// @Summary UnTaints a catalog manifest version +// @Description This endpoint UnTaints a catalog manifest version +// @Tags Catalogs +// @Produce json +// @Param catalogId path string true "Catalog ID" +// @Param version path string true "Version" +// @Param architecture path string true "Architecture" +// @Success 200 {object} models.CatalogManifest +// @Failure 400 {object} models.ApiErrorResponse +// @Failure 401 {object} models.OAuthErrorResponse +// @Security ApiKeyAuth +// @Security BearerAuth +// @Router /v1/catalog/{catalogId}/{version}/{architecture}/untaint [patch] func UnTaintCatalogManifestVersionHandler() restapi.ControllerHandler { return func(w http.ResponseWriter, r *http.Request) { defer r.Body.Close() @@ -625,19 +625,19 @@ func UnTaintCatalogManifestVersionHandler() restapi.ControllerHandler { } } -// @Summary UnTaints a catalog manifest version -// @Description This endpoint UnTaints a catalog manifest version -// @Tags Catalogs -// @Produce json -// @Param catalogId path string true "Catalog ID" -// @Param version path string true "Version" -// @Param architecture path string true "Architecture" -// @Success 200 {object} models.CatalogManifest -// @Failure 400 {object} models.ApiErrorResponse -// @Failure 401 {object} models.OAuthErrorResponse -// @Security ApiKeyAuth -// @Security BearerAuth -// @Router /v1/catalog/{catalogId}/{version}/{architecture}/revoke [patch] +// @Summary UnTaints a catalog manifest version +// @Description This endpoint UnTaints a catalog manifest version +// @Tags Catalogs +// @Produce json +// @Param catalogId path string true "Catalog ID" +// @Param version path string true "Version" +// @Param architecture path string true "Architecture" +// @Success 200 {object} models.CatalogManifest +// @Failure 400 {object} models.ApiErrorResponse +// @Failure 401 {object} models.OAuthErrorResponse +// @Security ApiKeyAuth +// @Security BearerAuth +// @Router /v1/catalog/{catalogId}/{version}/{architecture}/revoke [patch] func RevokeCatalogManifestVersionHandler() restapi.ControllerHandler { return func(w http.ResponseWriter, r *http.Request) { defer r.Body.Close() @@ -682,20 +682,20 @@ func RevokeCatalogManifestVersionHandler() restapi.ControllerHandler { } } -// @Summary Adds claims to a catalog manifest version -// @Description This endpoint adds claims to a catalog manifest version -// @Tags Catalogs -// @Produce json -// @Param catalogId path string true "Catalog ID" -// @Param version path string true "Version" -// @Param architecture path string true "Architecture" -// @Param request body models.VirtualMachineCatalogManifestPatch true "Body" -// @Success 200 {object} models.CatalogManifest -// @Failure 400 {object} models.ApiErrorResponse -// @Failure 401 {object} models.OAuthErrorResponse -// @Security ApiKeyAuth -// @Security BearerAuth -// @Router /v1/catalog/{catalogId}/{version}/{architecture}/claims [patch] +// @Summary Adds claims to a catalog manifest version +// @Description This endpoint adds claims to a catalog manifest version +// @Tags Catalogs +// @Produce json +// @Param catalogId path string true "Catalog ID" +// @Param version path string true "Version" +// @Param architecture path string true "Architecture" +// @Param request body models.VirtualMachineCatalogManifestPatch true "Body" +// @Success 200 {object} models.CatalogManifest +// @Failure 400 {object} models.ApiErrorResponse +// @Failure 401 {object} models.OAuthErrorResponse +// @Security ApiKeyAuth +// @Security BearerAuth +// @Router /v1/catalog/{catalogId}/{version}/{architecture}/claims [patch] func AddClaimsToCatalogManifestHandler() restapi.ControllerHandler { return func(w http.ResponseWriter, r *http.Request) { defer r.Body.Close() @@ -775,20 +775,20 @@ func AddClaimsToCatalogManifestHandler() restapi.ControllerHandler { } } -// @Summary Removes claims from a catalog manifest version -// @Description This endpoint removes claims from a catalog manifest version -// @Tags Catalogs -// @Produce json -// @Param catalogId path string true "Catalog ID" -// @Param version path string true "Version" -// @Param architecture path string true "Architecture" -// @Param request body models.VirtualMachineCatalogManifestPatch true "Body" -// @Success 200 {object} models.CatalogManifest -// @Failure 400 {object} models.ApiErrorResponse -// @Failure 401 {object} models.OAuthErrorResponse -// @Security ApiKeyAuth -// @Security BearerAuth -// @Router /v1/catalog/{catalogId}/{version}/{architecture}/claims [delete] +// @Summary Removes claims from a catalog manifest version +// @Description This endpoint removes claims from a catalog manifest version +// @Tags Catalogs +// @Produce json +// @Param catalogId path string true "Catalog ID" +// @Param version path string true "Version" +// @Param architecture path string true "Architecture" +// @Param request body models.VirtualMachineCatalogManifestPatch true "Body" +// @Success 200 {object} models.CatalogManifest +// @Failure 400 {object} models.ApiErrorResponse +// @Failure 401 {object} models.OAuthErrorResponse +// @Security ApiKeyAuth +// @Security BearerAuth +// @Router /v1/catalog/{catalogId}/{version}/{architecture}/claims [delete] func RemoveClaimsToCatalogManifestHandler() restapi.ControllerHandler { return func(w http.ResponseWriter, r *http.Request) { defer r.Body.Close() @@ -868,20 +868,20 @@ func RemoveClaimsToCatalogManifestHandler() restapi.ControllerHandler { } } -// @Summary Adds roles to a catalog manifest version -// @Description This endpoint adds roles to a catalog manifest version -// @Tags Catalogs -// @Produce json -// @Param catalogId path string true "Catalog ID" -// @Param version path string true "Version" -// @Param architecture path string true "Architecture" -// @Param request body models.VirtualMachineCatalogManifestPatch true "Body" -// @Success 200 {object} models.CatalogManifest -// @Failure 400 {object} models.ApiErrorResponse -// @Failure 401 {object} models.OAuthErrorResponse -// @Security ApiKeyAuth -// @Security BearerAuth -// @Router /v1/catalog/{catalogId}/{version}/{architecture}/roles [patch] +// @Summary Adds roles to a catalog manifest version +// @Description This endpoint adds roles to a catalog manifest version +// @Tags Catalogs +// @Produce json +// @Param catalogId path string true "Catalog ID" +// @Param version path string true "Version" +// @Param architecture path string true "Architecture" +// @Param request body models.VirtualMachineCatalogManifestPatch true "Body" +// @Success 200 {object} models.CatalogManifest +// @Failure 400 {object} models.ApiErrorResponse +// @Failure 401 {object} models.OAuthErrorResponse +// @Security ApiKeyAuth +// @Security BearerAuth +// @Router /v1/catalog/{catalogId}/{version}/{architecture}/roles [patch] func AddRolesToCatalogManifestHandler() restapi.ControllerHandler { return func(w http.ResponseWriter, r *http.Request) { defer r.Body.Close() @@ -961,20 +961,20 @@ func AddRolesToCatalogManifestHandler() restapi.ControllerHandler { } } -// @Summary Removes roles from a catalog manifest version -// @Description This endpoint removes roles from a catalog manifest version -// @Tags Catalogs -// @Produce json -// @Param catalogId path string true "Catalog ID" -// @Param version path string true "Version" -// @Param architecture path string true "Architecture" -// @Param request body models.VirtualMachineCatalogManifestPatch true "Body" -// @Success 200 {object} models.CatalogManifest -// @Failure 400 {object} models.ApiErrorResponse -// @Failure 401 {object} models.OAuthErrorResponse -// @Security ApiKeyAuth -// @Security BearerAuth -// @Router /v1/catalog/{catalogId}/{version}/{architecture}/roles [delete] +// @Summary Removes roles from a catalog manifest version +// @Description This endpoint removes roles from a catalog manifest version +// @Tags Catalogs +// @Produce json +// @Param catalogId path string true "Catalog ID" +// @Param version path string true "Version" +// @Param architecture path string true "Architecture" +// @Param request body models.VirtualMachineCatalogManifestPatch true "Body" +// @Success 200 {object} models.CatalogManifest +// @Failure 400 {object} models.ApiErrorResponse +// @Failure 401 {object} models.OAuthErrorResponse +// @Security ApiKeyAuth +// @Security BearerAuth +// @Router /v1/catalog/{catalogId}/{version}/{architecture}/roles [delete] func RemoveRolesToCatalogManifestHandler() restapi.ControllerHandler { return func(w http.ResponseWriter, r *http.Request) { defer r.Body.Close() @@ -1054,20 +1054,20 @@ func RemoveRolesToCatalogManifestHandler() restapi.ControllerHandler { } } -// @Summary Adds tags to a catalog manifest version -// @Description This endpoint adds tags to a catalog manifest version -// @Tags Catalogs -// @Produce json -// @Param catalogId path string true "Catalog ID" -// @Param version path string true "Version" -// @Param architecture path string true "Architecture" -// @Param request body models.VirtualMachineCatalogManifestPatch true "Body" -// @Success 200 {object} models.CatalogManifest -// @Failure 400 {object} models.ApiErrorResponse -// @Failure 401 {object} models.OAuthErrorResponse -// @Security ApiKeyAuth -// @Security BearerAuth -// @Router /v1/catalog/{catalogId}/{version}/{architecture}/tags [patch] +// @Summary Adds tags to a catalog manifest version +// @Description This endpoint adds tags to a catalog manifest version +// @Tags Catalogs +// @Produce json +// @Param catalogId path string true "Catalog ID" +// @Param version path string true "Version" +// @Param architecture path string true "Architecture" +// @Param request body models.VirtualMachineCatalogManifestPatch true "Body" +// @Success 200 {object} models.CatalogManifest +// @Failure 400 {object} models.ApiErrorResponse +// @Failure 401 {object} models.OAuthErrorResponse +// @Security ApiKeyAuth +// @Security BearerAuth +// @Router /v1/catalog/{catalogId}/{version}/{architecture}/tags [patch] func AddTagsToCatalogManifestHandler() restapi.ControllerHandler { return func(w http.ResponseWriter, r *http.Request) { defer r.Body.Close() @@ -1147,20 +1147,20 @@ func AddTagsToCatalogManifestHandler() restapi.ControllerHandler { } } -// @Summary Removes tags from a catalog manifest version -// @Description This endpoint removes tags from a catalog manifest version -// @Tags Catalogs -// @Produce json -// @Param catalogId path string true "Catalog ID" -// @Param version path string true "Version" -// @Param architecture path string true "Architecture" -// @Param request body models.VirtualMachineCatalogManifestPatch true "Body" -// @Success 200 {object} models.CatalogManifest -// @Failure 400 {object} models.ApiErrorResponse -// @Failure 401 {object} models.OAuthErrorResponse -// @Security ApiKeyAuth -// @Security BearerAuth -// @Router /v1/catalog/{catalogId}/{version}/{architecture}/tags [delete] +// @Summary Removes tags from a catalog manifest version +// @Description This endpoint removes tags from a catalog manifest version +// @Tags Catalogs +// @Produce json +// @Param catalogId path string true "Catalog ID" +// @Param version path string true "Version" +// @Param architecture path string true "Architecture" +// @Param request body models.VirtualMachineCatalogManifestPatch true "Body" +// @Success 200 {object} models.CatalogManifest +// @Failure 400 {object} models.ApiErrorResponse +// @Failure 401 {object} models.OAuthErrorResponse +// @Security ApiKeyAuth +// @Security BearerAuth +// @Router /v1/catalog/{catalogId}/{version}/{architecture}/tags [delete] func RemoveTagsToCatalogManifestHandler() restapi.ControllerHandler { return func(w http.ResponseWriter, r *http.Request) { defer r.Body.Close() @@ -1282,17 +1282,17 @@ func CreateCatalogManifestHandler() restapi.ControllerHandler { } } -// @Summary Deletes a catalog manifest and all its versions -// @Description This endpoint deletes a catalog manifest and all its versions -// @Tags Catalogs -// @Produce json -// @Param catalogId path string true "Catalog ID" -// @Success 200 -// @Failure 400 {object} models.ApiErrorResponse -// @Failure 401 {object} models.OAuthErrorResponse -// @Security ApiKeyAuth -// @Security BearerAuth -// @Router /v1/catalog/{catalogId} [delete] +// @Summary Deletes a catalog manifest and all its versions +// @Description This endpoint deletes a catalog manifest and all its versions +// @Tags Catalogs +// @Produce json +// @Param catalogId path string true "Catalog ID" +// @Success 200 +// @Failure 400 {object} models.ApiErrorResponse +// @Failure 401 {object} models.OAuthErrorResponse +// @Security ApiKeyAuth +// @Security BearerAuth +// @Router /v1/catalog/{catalogId} [delete] func DeleteCatalogManifestHandler() restapi.ControllerHandler { return func(w http.ResponseWriter, r *http.Request) { defer r.Body.Close() @@ -1349,18 +1349,18 @@ func DeleteCatalogManifestHandler() restapi.ControllerHandler { } } -// @Summary Deletes a catalog manifest version -// @Description This endpoint deletes a catalog manifest version -// @Tags Catalogs -// @Produce json -// @Param catalogId path string true "Catalog ID" -// @Param version path string true "Version" -// @Success 202 -// @Failure 400 {object} models.ApiErrorResponse -// @Failure 401 {object} models.OAuthErrorResponse -// @Security ApiKeyAuth -// @Security BearerAuth -// @Router /v1/catalog/{catalogId}/{version} [delete] +// @Summary Deletes a catalog manifest version +// @Description This endpoint deletes a catalog manifest version +// @Tags Catalogs +// @Produce json +// @Param catalogId path string true "Catalog ID" +// @Param version path string true "Version" +// @Success 202 +// @Failure 400 {object} models.ApiErrorResponse +// @Failure 401 {object} models.OAuthErrorResponse +// @Security ApiKeyAuth +// @Security BearerAuth +// @Router /v1/catalog/{catalogId}/{version} [delete] func DeleteCatalogManifestVersionHandler() restapi.ControllerHandler { return func(w http.ResponseWriter, r *http.Request) { defer r.Body.Close() @@ -1418,19 +1418,19 @@ func DeleteCatalogManifestVersionHandler() restapi.ControllerHandler { } } -// @Summary Deletes a catalog manifest version architecture -// @Description This endpoint deletes a catalog manifest version -// @Tags Catalogs -// @Produce json -// @Param catalogId path string true "Catalog ID" -// @Param version path string true "Version" -// @Param architecture path string true "Architecture" -// @Success 202 -// @Failure 400 {object} models.ApiErrorResponse -// @Failure 401 {object} models.OAuthErrorResponse -// @Security ApiKeyAuth -// @Security BearerAuth -// @Router /v1/catalog/{catalogId}/{version}/{architecture} [delete] +// @Summary Deletes a catalog manifest version architecture +// @Description This endpoint deletes a catalog manifest version +// @Tags Catalogs +// @Produce json +// @Param catalogId path string true "Catalog ID" +// @Param version path string true "Version" +// @Param architecture path string true "Architecture" +// @Success 202 +// @Failure 400 {object} models.ApiErrorResponse +// @Failure 401 {object} models.OAuthErrorResponse +// @Security ApiKeyAuth +// @Security BearerAuth +// @Router /v1/catalog/{catalogId}/{version}/{architecture} [delete] func DeleteCatalogManifestVersionArchitectureHandler() restapi.ControllerHandler { return func(w http.ResponseWriter, r *http.Request) { defer r.Body.Close() @@ -1489,17 +1489,17 @@ func DeleteCatalogManifestVersionArchitectureHandler() restapi.ControllerHandler } } -// @Summary Pushes a catalog manifest to the catalog inventory -// @Description This endpoint pushes a catalog manifest to the catalog inventory -// @Tags Catalogs -// @Produce json -// @Param pushRequest body catalog_models.PushCatalogManifestRequest true "Push request" -// @Success 200 {object} models.CatalogManifest -// @Failure 400 {object} models.ApiErrorResponse -// @Failure 401 {object} models.OAuthErrorResponse -// @Security ApiKeyAuth -// @Security BearerAuth -// @Router /v1/catalog/push [post] +// @Summary Pushes a catalog manifest to the catalog inventory +// @Description This endpoint pushes a catalog manifest to the catalog inventory +// @Tags Catalogs +// @Produce json +// @Param pushRequest body catalog_models.PushCatalogManifestRequest true "Push request" +// @Success 200 {object} models.CatalogManifest +// @Failure 400 {object} models.ApiErrorResponse +// @Failure 401 {object} models.OAuthErrorResponse +// @Security ApiKeyAuth +// @Security BearerAuth +// @Router /v1/catalog/push [post] func PushCatalogManifestHandler() restapi.ControllerHandler { return func(w http.ResponseWriter, r *http.Request) { defer r.Body.Close() @@ -1543,17 +1543,17 @@ func PushCatalogManifestHandler() restapi.ControllerHandler { } } -// @Summary Pull a remote catalog manifest -// @Description This endpoint pulls a remote catalog manifest -// @Tags Catalogs -// @Produce json -// @Param pullRequest body catalog_models.PullCatalogManifestRequest true "Pull request" -// @Success 200 {object} models.PullCatalogManifestResponse -// @Failure 400 {object} models.ApiErrorResponse -// @Failure 401 {object} models.OAuthErrorResponse -// @Security ApiKeyAuth -// @Security BearerAuth -// @Router /v1/catalog/pull [put] +// @Summary Pull a remote catalog manifest +// @Description This endpoint pulls a remote catalog manifest +// @Tags Catalogs +// @Produce json +// @Param pullRequest body catalog_models.PullCatalogManifestRequest true "Pull request" +// @Success 200 {object} models.PullCatalogManifestResponse +// @Failure 400 {object} models.ApiErrorResponse +// @Failure 401 {object} models.OAuthErrorResponse +// @Security ApiKeyAuth +// @Security BearerAuth +// @Router /v1/catalog/pull [put] func PullCatalogManifestHandler() restapi.ControllerHandler { return func(w http.ResponseWriter, r *http.Request) { defer r.Body.Close() @@ -1637,17 +1637,17 @@ func PullCatalogManifestHandler() restapi.ControllerHandler { } } -// @Summary Imports a remote catalog manifest metadata into the catalog inventory -// @Description This endpoint imports a remote catalog manifest metadata into the catalog inventory -// @Tags Catalogs -// @Produce json -// @Param importRequest body catalog_models.ImportCatalogManifestRequest true "Pull request" -// @Success 200 {object} models.ImportCatalogManifestResponse -// @Failure 400 {object} models.ApiErrorResponse -// @Failure 401 {object} models.OAuthErrorResponse -// @Security ApiKeyAuth -// @Security BearerAuth -// @Router /v1/catalog/import [put] +// @Summary Imports a remote catalog manifest metadata into the catalog inventory +// @Description This endpoint imports a remote catalog manifest metadata into the catalog inventory +// @Tags Catalogs +// @Produce json +// @Param importRequest body catalog_models.ImportCatalogManifestRequest true "Pull request" +// @Success 200 {object} models.ImportCatalogManifestResponse +// @Failure 400 {object} models.ApiErrorResponse +// @Failure 401 {object} models.OAuthErrorResponse +// @Security ApiKeyAuth +// @Security BearerAuth +// @Router /v1/catalog/import [put] func ImportCatalogManifestHandler() restapi.ControllerHandler { return func(w http.ResponseWriter, r *http.Request) { defer r.Body.Close() @@ -1691,17 +1691,17 @@ func ImportCatalogManifestHandler() restapi.ControllerHandler { } } -// @Summary Imports a vm into the catalog inventory generating the metadata for it -// @Description This endpoint imports a virtual machine in pvm or macvm format into the catalog inventory generating the metadata for it -// @Tags Catalogs -// @Produce json -// @Param importRequest body catalog_models.ImportVmRequest true "Vm Impoty request" -// @Success 200 {object} models.ImportVmResponse -// @Failure 400 {object} models.ApiErrorResponse -// @Failure 401 {object} models.OAuthErrorResponse -// @Security ApiKeyAuth -// @Security BearerAuth -// @Router /v1/catalog/import-vm [put] +// @Summary Imports a vm into the catalog inventory generating the metadata for it +// @Description This endpoint imports a virtual machine in pvm or macvm format into the catalog inventory generating the metadata for it +// @Tags Catalogs +// @Produce json +// @Param importRequest body catalog_models.ImportVmRequest true "Vm Impoty request" +// @Success 200 {object} models.ImportVmResponse +// @Failure 400 {object} models.ApiErrorResponse +// @Failure 401 {object} models.OAuthErrorResponse +// @Security ApiKeyAuth +// @Security BearerAuth +// @Router /v1/catalog/import-vm [put] func ImportVmHandler() restapi.ControllerHandler { return func(w http.ResponseWriter, r *http.Request) { defer r.Body.Close() @@ -1744,18 +1744,18 @@ func ImportVmHandler() restapi.ControllerHandler { } } -// @Summary Updates a catalog -// @Description This endpoint adds claims to a catalog manifest version -// @Tags Catalogs -// @Produce json -// @Param catalogId path string true "Catalog ID" -// @Param request body models.VirtualMachineCatalogManifestPatch true "Body" -// @Success 200 {object} models.CatalogManifest -// @Failure 400 {object} models.ApiErrorResponse -// @Failure 401 {object} models.OAuthErrorResponse -// @Security ApiKeyAuth -// @Security BearerAuth -// @Router /v1/catalog/{catalogId}/{version}/{architecture}/claims [patch] +// @Summary Updates a catalog +// @Description This endpoint adds claims to a catalog manifest version +// @Tags Catalogs +// @Produce json +// @Param catalogId path string true "Catalog ID" +// @Param request body models.VirtualMachineCatalogManifestPatch true "Body" +// @Success 200 {object} models.CatalogManifest +// @Failure 400 {object} models.ApiErrorResponse +// @Failure 401 {object} models.OAuthErrorResponse +// @Security ApiKeyAuth +// @Security BearerAuth +// @Router /v1/catalog/{catalogId}/{version}/{architecture}/claims [patch] func UpdateCatalogManifestProviderHandler() restapi.ControllerHandler { return func(w http.ResponseWriter, r *http.Request) { defer r.Body.Close() @@ -1840,16 +1840,16 @@ func UpdateCatalogManifestProviderHandler() restapi.ControllerHandler { } } -// @Summary Gets catalog cache -// @Description This endpoint returns all the remote catalog cache if any -// @Tags Catalogs -// @Produce json -// @Success 200 {object} []models.CatalogManifest -// @Failure 400 {object} models.ApiErrorResponse -// @Failure 401 {object} models.OAuthErrorResponse -// @Security ApiKeyAuth -// @Security BearerAuth -// @Router /v1/catalog/cache [get] +// @Summary Gets catalog cache +// @Description This endpoint returns all the remote catalog cache if any +// @Tags Catalogs +// @Produce json +// @Success 200 {object} []models.CatalogManifest +// @Failure 400 {object} models.ApiErrorResponse +// @Failure 401 {object} models.OAuthErrorResponse +// @Security ApiKeyAuth +// @Security BearerAuth +// @Router /v1/catalog/cache [get] func GetCatalogCacheHandler() restapi.ControllerHandler { return func(w http.ResponseWriter, r *http.Request) { defer r.Body.Close() @@ -1871,17 +1871,17 @@ func GetCatalogCacheHandler() restapi.ControllerHandler { } } -// @Summary Deletes all catalog cache -// @Description This endpoint returns all the remote catalog cache if any -// @Tags Catalogs -// @Produce json -// @Param catalogId path string true "Catalog ID" -// @Success 202 -// @Failure 400 {object} models.ApiErrorResponse -// @Failure 401 {object} models.OAuthErrorResponse -// @Security ApiKeyAuth -// @Security BearerAuth -// @Router /v1/catalog/cache [delete] +// @Summary Deletes all catalog cache +// @Description This endpoint returns all the remote catalog cache if any +// @Tags Catalogs +// @Produce json +// @Param catalogId path string true "Catalog ID" +// @Success 202 +// @Failure 400 {object} models.ApiErrorResponse +// @Failure 401 {object} models.OAuthErrorResponse +// @Security ApiKeyAuth +// @Security BearerAuth +// @Router /v1/catalog/cache [delete] func DeleteCatalogCacheHandler() restapi.ControllerHandler { return func(w http.ResponseWriter, r *http.Request) { defer r.Body.Close() @@ -1902,17 +1902,17 @@ func DeleteCatalogCacheHandler() restapi.ControllerHandler { } } -// @Summary Deletes catalog cache item -// @Description This endpoint returns all the remote catalog cache if any -// @Tags Catalogs -// @Produce json -// @Param catalogId path string true "Catalog ID" -// @Success 202 -// @Failure 400 {object} models.ApiErrorResponse -// @Failure 401 {object} models.OAuthErrorResponse -// @Security ApiKeyAuth -// @Security BearerAuth -// @Router /v1/catalog/cache/{catalogId} [delete] +// @Summary Deletes catalog cache item +// @Description This endpoint returns all the remote catalog cache if any +// @Tags Catalogs +// @Produce json +// @Param catalogId path string true "Catalog ID" +// @Success 202 +// @Failure 400 {object} models.ApiErrorResponse +// @Failure 401 {object} models.OAuthErrorResponse +// @Security ApiKeyAuth +// @Security BearerAuth +// @Router /v1/catalog/cache/{catalogId} [delete] func DeleteCatalogCacheItemHandler() restapi.ControllerHandler { return func(w http.ResponseWriter, r *http.Request) { defer r.Body.Close() diff --git a/src/docs/docs.go b/src/docs/docs.go index 9968524..f1b06aa 100644 --- a/src/docs/docs.go +++ b/src/docs/docs.go @@ -1381,6 +1381,139 @@ const docTemplate = `{ } } }, + "/v1/catalog/cache": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + }, + { + "BearerAuth": [] + } + ], + "description": "This endpoint returns all the remote catalog cache if any", + "produces": [ + "application/json" + ], + "tags": [ + "Catalogs" + ], + "summary": "Gets catalog cache", + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/github_com_Parallels_prl-devops-service_models.CatalogManifest" + } + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/models.ApiErrorResponse" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/models.OAuthErrorResponse" + } + } + } + }, + "delete": { + "security": [ + { + "ApiKeyAuth": [] + }, + { + "BearerAuth": [] + } + ], + "description": "This endpoint returns all the remote catalog cache if any", + "produces": [ + "application/json" + ], + "tags": [ + "Catalogs" + ], + "summary": "Deletes all catalog cache", + "parameters": [ + { + "type": "string", + "description": "Catalog ID", + "name": "catalogId", + "in": "path", + "required": true + } + ], + "responses": { + "202": { + "description": "Accepted" + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/models.ApiErrorResponse" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/models.OAuthErrorResponse" + } + } + } + } + }, + "/v1/catalog/cache/{catalogId}": { + "delete": { + "security": [ + { + "ApiKeyAuth": [] + }, + { + "BearerAuth": [] + } + ], + "description": "This endpoint returns all the remote catalog cache if any", + "produces": [ + "application/json" + ], + "tags": [ + "Catalogs" + ], + "summary": "Deletes catalog cache item", + "parameters": [ + { + "type": "string", + "description": "Catalog ID", + "name": "catalogId", + "in": "path", + "required": true + } + ], + "responses": { + "202": { + "description": "Accepted" + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/models.ApiErrorResponse" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/models.OAuthErrorResponse" + } + } + } + } + }, "/v1/catalog/import": { "put": { "security": [ @@ -1432,6 +1565,57 @@ const docTemplate = `{ } } }, + "/v1/catalog/import-vm": { + "put": { + "security": [ + { + "ApiKeyAuth": [] + }, + { + "BearerAuth": [] + } + ], + "description": "This endpoint imports a virtual machine in pvm or macvm format into the catalog inventory generating the metadata for it", + "produces": [ + "application/json" + ], + "tags": [ + "Catalogs" + ], + "summary": "Imports a vm into the catalog inventory generating the metadata for it", + "parameters": [ + { + "description": "Vm Impoty request", + "name": "importRequest", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/models.ImportVmRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/github_com_Parallels_prl-devops-service_models.ImportVmResponse" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/models.ApiErrorResponse" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/models.OAuthErrorResponse" + } + } + } + } + }, "/v1/catalog/pull": { "put": { "security": [ @@ -1945,7 +2129,7 @@ const docTemplate = `{ "tags": [ "Catalogs" ], - "summary": "Adds claims to a catalog manifest version", + "summary": "Updates a catalog", "parameters": [ { "type": "string", @@ -1954,20 +2138,6 @@ const docTemplate = `{ "in": "path", "required": true }, - { - "type": "string", - "description": "Version", - "name": "version", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "Architecture", - "name": "architecture", - "in": "path", - "required": true - }, { "description": "Body", "name": "request", @@ -5562,6 +5732,9 @@ const docTemplate = `{ "id": { "type": "string" }, + "is_compressed": { + "type": "boolean" + }, "last_downloaded_at": { "type": "string" }, @@ -5586,6 +5759,9 @@ const docTemplate = `{ "pack_filename": { "type": "string" }, + "pack_relative_path": { + "type": "string" + }, "pack_size": { "type": "integer" }, @@ -5815,6 +5991,14 @@ const docTemplate = `{ } } }, + "github_com_Parallels_prl-devops-service_models.ImportVmResponse": { + "type": "object", + "properties": { + "id": { + "type": "string" + } + } + }, "github_com_Parallels_prl-devops-service_models.Memory": { "type": "object", "properties": { @@ -6725,6 +6909,62 @@ const docTemplate = `{ } } }, + "models.ImportVmRequest": { + "type": "object", + "properties": { + "architecture": { + "type": "string" + }, + "catalog_id": { + "type": "string" + }, + "connection": { + "type": "string" + }, + "description": { + "type": "string" + }, + "force": { + "type": "boolean" + }, + "is_compressed": { + "type": "boolean" + }, + "machine_remote_path": { + "type": "string" + }, + "provider_metadata": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "required_claims": { + "type": "array", + "items": { + "type": "string" + } + }, + "required_roles": { + "type": "array", + "items": { + "type": "string" + } + }, + "tags": { + "type": "array", + "items": { + "type": "string" + } + }, + "type": { + "type": "string" + }, + "version": { + "type": "string" + } + } + }, "models.InstallToolsRequest": { "type": "object", "properties": { @@ -7431,6 +7671,9 @@ const docTemplate = `{ "models.VirtualMachineCatalogManifestPatch": { "type": "object", "properties": { + "connection": { + "type": "string" + }, "required_claims": { "type": "array", "items": { @@ -7628,7 +7871,7 @@ const docTemplate = `{ // SwaggerInfo holds exported Swagger Info so clients can modify it var SwaggerInfo = &swag.Spec{ - Version: "0.9.6", + Version: "0.9.7", Host: "", BasePath: "/api", Schemes: []string{}, diff --git a/src/docs/swagger.json b/src/docs/swagger.json index 82675bc..226cc74 100644 --- a/src/docs/swagger.json +++ b/src/docs/swagger.json @@ -13,7 +13,7 @@ "name": "Apache 2.0", "url": "http://www.apache.org/licenses/LICENSE-2.0.html" }, - "version": "0.9.6" + "version": "0.9.7" }, "basePath": "/api", "paths": { @@ -1374,6 +1374,139 @@ } } }, + "/v1/catalog/cache": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + }, + { + "BearerAuth": [] + } + ], + "description": "This endpoint returns all the remote catalog cache if any", + "produces": [ + "application/json" + ], + "tags": [ + "Catalogs" + ], + "summary": "Gets catalog cache", + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/github_com_Parallels_prl-devops-service_models.CatalogManifest" + } + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/models.ApiErrorResponse" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/models.OAuthErrorResponse" + } + } + } + }, + "delete": { + "security": [ + { + "ApiKeyAuth": [] + }, + { + "BearerAuth": [] + } + ], + "description": "This endpoint returns all the remote catalog cache if any", + "produces": [ + "application/json" + ], + "tags": [ + "Catalogs" + ], + "summary": "Deletes all catalog cache", + "parameters": [ + { + "type": "string", + "description": "Catalog ID", + "name": "catalogId", + "in": "path", + "required": true + } + ], + "responses": { + "202": { + "description": "Accepted" + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/models.ApiErrorResponse" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/models.OAuthErrorResponse" + } + } + } + } + }, + "/v1/catalog/cache/{catalogId}": { + "delete": { + "security": [ + { + "ApiKeyAuth": [] + }, + { + "BearerAuth": [] + } + ], + "description": "This endpoint returns all the remote catalog cache if any", + "produces": [ + "application/json" + ], + "tags": [ + "Catalogs" + ], + "summary": "Deletes catalog cache item", + "parameters": [ + { + "type": "string", + "description": "Catalog ID", + "name": "catalogId", + "in": "path", + "required": true + } + ], + "responses": { + "202": { + "description": "Accepted" + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/models.ApiErrorResponse" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/models.OAuthErrorResponse" + } + } + } + } + }, "/v1/catalog/import": { "put": { "security": [ @@ -1425,6 +1558,57 @@ } } }, + "/v1/catalog/import-vm": { + "put": { + "security": [ + { + "ApiKeyAuth": [] + }, + { + "BearerAuth": [] + } + ], + "description": "This endpoint imports a virtual machine in pvm or macvm format into the catalog inventory generating the metadata for it", + "produces": [ + "application/json" + ], + "tags": [ + "Catalogs" + ], + "summary": "Imports a vm into the catalog inventory generating the metadata for it", + "parameters": [ + { + "description": "Vm Impoty request", + "name": "importRequest", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/models.ImportVmRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/github_com_Parallels_prl-devops-service_models.ImportVmResponse" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/models.ApiErrorResponse" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/models.OAuthErrorResponse" + } + } + } + } + }, "/v1/catalog/pull": { "put": { "security": [ @@ -1938,7 +2122,7 @@ "tags": [ "Catalogs" ], - "summary": "Adds claims to a catalog manifest version", + "summary": "Updates a catalog", "parameters": [ { "type": "string", @@ -1947,20 +2131,6 @@ "in": "path", "required": true }, - { - "type": "string", - "description": "Version", - "name": "version", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "Architecture", - "name": "architecture", - "in": "path", - "required": true - }, { "description": "Body", "name": "request", @@ -5555,6 +5725,9 @@ "id": { "type": "string" }, + "is_compressed": { + "type": "boolean" + }, "last_downloaded_at": { "type": "string" }, @@ -5579,6 +5752,9 @@ "pack_filename": { "type": "string" }, + "pack_relative_path": { + "type": "string" + }, "pack_size": { "type": "integer" }, @@ -5808,6 +5984,14 @@ } } }, + "github_com_Parallels_prl-devops-service_models.ImportVmResponse": { + "type": "object", + "properties": { + "id": { + "type": "string" + } + } + }, "github_com_Parallels_prl-devops-service_models.Memory": { "type": "object", "properties": { @@ -6718,6 +6902,62 @@ } } }, + "models.ImportVmRequest": { + "type": "object", + "properties": { + "architecture": { + "type": "string" + }, + "catalog_id": { + "type": "string" + }, + "connection": { + "type": "string" + }, + "description": { + "type": "string" + }, + "force": { + "type": "boolean" + }, + "is_compressed": { + "type": "boolean" + }, + "machine_remote_path": { + "type": "string" + }, + "provider_metadata": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "required_claims": { + "type": "array", + "items": { + "type": "string" + } + }, + "required_roles": { + "type": "array", + "items": { + "type": "string" + } + }, + "tags": { + "type": "array", + "items": { + "type": "string" + } + }, + "type": { + "type": "string" + }, + "version": { + "type": "string" + } + } + }, "models.InstallToolsRequest": { "type": "object", "properties": { @@ -7424,6 +7664,9 @@ "models.VirtualMachineCatalogManifestPatch": { "type": "object", "properties": { + "connection": { + "type": "string" + }, "required_claims": { "type": "array", "items": { diff --git a/src/docs/swagger.yaml b/src/docs/swagger.yaml index 547321a..1fba5e4 100644 --- a/src/docs/swagger.yaml +++ b/src/docs/swagger.yaml @@ -55,6 +55,8 @@ definitions: type: integer id: type: string + is_compressed: + type: boolean last_downloaded_at: type: string last_downloaded_user: @@ -71,6 +73,8 @@ definitions: type: array pack_filename: type: string + pack_relative_path: + type: string pack_size: type: integer path: @@ -220,6 +224,11 @@ definitions: id: type: string type: object + github_com_Parallels_prl-devops-service_models.ImportVmResponse: + properties: + id: + type: string + type: object github_com_Parallels_prl-devops-service_models.Memory: properties: auto: @@ -815,6 +824,43 @@ definitions: version: type: string type: object + models.ImportVmRequest: + properties: + architecture: + type: string + catalog_id: + type: string + connection: + type: string + description: + type: string + force: + type: boolean + is_compressed: + type: boolean + machine_remote_path: + type: string + provider_metadata: + additionalProperties: + type: string + type: object + required_claims: + items: + type: string + type: array + required_roles: + items: + type: string + type: array + tags: + items: + type: string + type: array + type: + type: string + version: + type: string + type: object models.InstallToolsRequest: properties: all: @@ -1284,6 +1330,8 @@ definitions: type: object models.VirtualMachineCatalogManifestPatch: properties: + connection: + type: string required_claims: items: type: string @@ -1410,7 +1458,7 @@ info: url: http://www.apache.org/licenses/LICENSE-2.0.html termsOfService: http://swagger.io/terms/ title: Parallels Desktop DevOps Service - version: 0.9.6 + version: 0.9.7 paths: /health/probe: get: @@ -2505,16 +2553,6 @@ paths: name: catalogId required: true type: string - - description: Version - in: path - name: version - required: true - type: string - - description: Architecture - in: path - name: architecture - required: true - type: string - description: Body in: body name: request @@ -2539,7 +2577,7 @@ paths: security: - ApiKeyAuth: [] - BearerAuth: [] - summary: Adds claims to a catalog manifest version + summary: Updates a catalog tags: - Catalogs /v1/catalog/{catalogId}/{version}/{architecture}/download: @@ -2884,6 +2922,87 @@ paths: summary: UnTaints a catalog manifest version tags: - Catalogs + /v1/catalog/cache: + delete: + description: This endpoint returns all the remote catalog cache if any + parameters: + - description: Catalog ID + in: path + name: catalogId + required: true + type: string + produces: + - application/json + responses: + "202": + description: Accepted + "400": + description: Bad Request + schema: + $ref: '#/definitions/models.ApiErrorResponse' + "401": + description: Unauthorized + schema: + $ref: '#/definitions/models.OAuthErrorResponse' + security: + - ApiKeyAuth: [] + - BearerAuth: [] + summary: Deletes all catalog cache + tags: + - Catalogs + get: + description: This endpoint returns all the remote catalog cache if any + produces: + - application/json + responses: + "200": + description: OK + schema: + items: + $ref: '#/definitions/github_com_Parallels_prl-devops-service_models.CatalogManifest' + type: array + "400": + description: Bad Request + schema: + $ref: '#/definitions/models.ApiErrorResponse' + "401": + description: Unauthorized + schema: + $ref: '#/definitions/models.OAuthErrorResponse' + security: + - ApiKeyAuth: [] + - BearerAuth: [] + summary: Gets catalog cache + tags: + - Catalogs + /v1/catalog/cache/{catalogId}: + delete: + description: This endpoint returns all the remote catalog cache if any + parameters: + - description: Catalog ID + in: path + name: catalogId + required: true + type: string + produces: + - application/json + responses: + "202": + description: Accepted + "400": + description: Bad Request + schema: + $ref: '#/definitions/models.ApiErrorResponse' + "401": + description: Unauthorized + schema: + $ref: '#/definitions/models.OAuthErrorResponse' + security: + - ApiKeyAuth: [] + - BearerAuth: [] + summary: Deletes catalog cache item + tags: + - Catalogs /v1/catalog/import: put: description: This endpoint imports a remote catalog manifest metadata into the @@ -2916,6 +3035,39 @@ paths: summary: Imports a remote catalog manifest metadata into the catalog inventory tags: - Catalogs + /v1/catalog/import-vm: + put: + description: This endpoint imports a virtual machine in pvm or macvm format + into the catalog inventory generating the metadata for it + parameters: + - description: Vm Impoty request + in: body + name: importRequest + required: true + schema: + $ref: '#/definitions/models.ImportVmRequest' + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/github_com_Parallels_prl-devops-service_models.ImportVmResponse' + "400": + description: Bad Request + schema: + $ref: '#/definitions/models.ApiErrorResponse' + "401": + description: Unauthorized + schema: + $ref: '#/definitions/models.OAuthErrorResponse' + security: + - ApiKeyAuth: [] + - BearerAuth: [] + summary: Imports a vm into the catalog inventory generating the metadata for + it + tags: + - Catalogs /v1/catalog/pull: put: description: This endpoint pulls a remote catalog manifest diff --git a/src/go.sum b/src/go.sum index ef85b46..ef16a29 100644 --- a/src/go.sum +++ b/src/go.sum @@ -32,8 +32,6 @@ github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be h1:9AeTilPcZAjCFI github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be/go.mod h1:ySMOLuWl6zY27l47sB3qLNK6tF2fkHG55UZxx8oIVo4= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= -github.com/aws/aws-sdk-go v1.50.15 h1:wEMnPfEQQFaoIJwuO18zq/vtG4Ft7NxQ3r9xlEi/8zg= -github.com/aws/aws-sdk-go v1.50.15/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= github.com/aws/aws-sdk-go v1.55.5 h1:KKUZBfBoyqy5d3swXyiC7Q76ic40rYcbqH7qjh59kzU= github.com/aws/aws-sdk-go v1.55.5/go.mod h1:eRwEWoyTWFMVYVQzKMNHWP5/RV4xIUGMQfXQHfHkpNU= github.com/bradleyjkemp/cupaloy/v2 v2.8.0 h1:any4BmKE+jGIaMpnU8YgH/I2LPiLBufr6oMMlVBbn9M= diff --git a/src/main.go b/src/main.go index b10d566..37776a4 100644 --- a/src/main.go +++ b/src/main.go @@ -20,10 +20,10 @@ import ( "github.com/cjlapao/common-go/version" ) -var ver = "0.9.6.1" +var ver = "0.9.7" // @title Parallels Desktop DevOps Service -// @version 0.9.6 +// @version 0.9.7 // @description Parallels Desktop DevOps Service // @termsOfService http://swagger.io/terms/ @@ -39,10 +39,10 @@ var ver = "0.9.6.1" // @in header // @name X-Api-Key -// @securityDefinitions.apikey BearerAuth -// @description Type "Bearer" followed by a space and JWT token. -// @in header -// @name Authorization +// @securityDefinitions.apikey BearerAuth +// @description Type "Bearer" followed by a space and JWT token. +// @in header +// @name Authorization func main() { // catching all of the exceptions defer func() {