diff --git a/Makefile b/Makefile index 46b7a0441..6e104e443 100644 --- a/Makefile +++ b/Makefile @@ -35,7 +35,7 @@ LICENSEI_VERSION = 0.3.1 OPENAPI_GENERATOR_VERSION = v4.1.3 GOLANG_VERSION = 1.14 -SWAGGER_VERSION = 0.21.0 +SWAGGER_VERSION = 0.27.0 GOFILES_NOVENDOR = $(shell find . -type f -name '*.go' -not -path "./vendor/*" -not -path "./client/*") @@ -54,9 +54,9 @@ endif bin/swagger: bin/swagger-${SWAGGER_VERSION} @ln -sf swagger-${SWAGGER_VERSION} bin/swagger -bin/swagger-${SWAGGER_VERSION}: bin/gobin +bin/swagger-${SWAGGER_VERSION}: @mkdir -p bin - GOBIN=bin/ bin/gobin github.com/go-swagger/go-swagger/cmd/swagger@v${SWAGGER_VERSION} + GOBIN=$$PWD/bin go install github.com/go-swagger/go-swagger/cmd/swagger@v${SWAGGER_VERSION} @mv bin/swagger bin/swagger-${SWAGGER_VERSION} .PHONY: swagger diff --git a/api/openapi-spec/cloudinfo.json b/api/openapi-spec/cloudinfo.json index 2daef9b9f..8291b59c4 100644 --- a/api/openapi-spec/cloudinfo.json +++ b/api/openapi-spec/cloudinfo.json @@ -651,6 +651,10 @@ "format": "double", "x-go-name": "OnDemandPrice" }, + "series": { + "type": "string", + "x-go-name": "Series" + }, "spotPrice": { "type": "array", "items": { @@ -797,6 +801,79 @@ }, "x-go-package": "github.com/banzaicloud/cloudinfo/internal/app/cloudinfo/api" }, + "VMInfo": { + "description": "VMInfo representation of a virtual machine", + "type": "object", + "properties": { + "attributes": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-go-name": "Attributes" + }, + "category": { + "type": "string", + "x-go-name": "Category" + }, + "cpusPerVm": { + "type": "number", + "format": "double", + "x-go-name": "Cpus" + }, + "currentGen": { + "description": "CurrentGen signals whether the instance type generation is the current one. Only applies for amazon", + "type": "boolean", + "x-go-name": "CurrentGen" + }, + "gpusPerVm": { + "type": "number", + "format": "double", + "x-go-name": "Gpus" + }, + "memPerVm": { + "type": "number", + "format": "double", + "x-go-name": "Mem" + }, + "ntwPerf": { + "type": "string", + "x-go-name": "NtwPerf" + }, + "ntwPerfCategory": { + "type": "string", + "x-go-name": "NtwPerfCat" + }, + "onDemandPrice": { + "type": "number", + "format": "double", + "x-go-name": "OnDemandPrice" + }, + "series": { + "type": "string", + "x-go-name": "Series" + }, + "spotPrice": { + "type": "array", + "items": { + "$ref": "#/definitions/ZonePrice" + }, + "x-go-name": "SpotPrice" + }, + "type": { + "type": "string", + "x-go-name": "Type" + }, + "zones": { + "type": "array", + "items": { + "type": "string" + }, + "x-go-name": "Zones" + } + }, + "x-go-package": "github.com/banzaicloud/cloudinfo/internal/cloudinfo/types" + }, "VersionsResponse": { "description": "VersionsResponse holds the list of available versions", "type": "array", diff --git a/api/openapi-spec/cloudinfo.yaml b/api/openapi-spec/cloudinfo.yaml index 8af593403..11c8a3785 100644 --- a/api/openapi-spec/cloudinfo.yaml +++ b/api/openapi-spec/cloudinfo.yaml @@ -12,7 +12,7 @@ info: license: name: Apache 2.0 url: http://www.apache.org/licenses/LICENSE-2.0.html - version: 0.0.1 + version: 0.6.0 paths: /continents: get: @@ -82,8 +82,8 @@ paths: $ref: "#/components/schemas/ServicesResponse" "/providers/{provider}/services/{service}": get: - description: Provides service details for the given service on the provider in the - given region + description: Provides service details for the given service on the provider in + the given region tags: - service operationId: getService @@ -360,8 +360,8 @@ components: type: string x-go-package: github.com/banzaicloud/cloudinfo/internal/app/cloudinfo/api GetRegionResp: - description: GetRegionResp holds the detailed description of a specific region of a - cloud provider + description: GetRegionResp holds the detailed description of a specific region + of a cloud provider type: object properties: id: @@ -464,6 +464,9 @@ components: type: number format: double x-go-name: OnDemandPrice + series: + type: string + x-go-name: Series spotPrice: type: array items: @@ -571,6 +574,62 @@ components: $ref: "#/components/schemas/Service" x-go-name: Services x-go-package: github.com/banzaicloud/cloudinfo/internal/app/cloudinfo/api + VMInfo: + description: VMInfo representation of a virtual machine + type: object + properties: + attributes: + type: object + additionalProperties: + type: string + x-go-name: Attributes + category: + type: string + x-go-name: Category + cpusPerVm: + type: number + format: double + x-go-name: Cpus + currentGen: + description: CurrentGen signals whether the instance type generation is the + current one. Only applies for amazon + type: boolean + x-go-name: CurrentGen + gpusPerVm: + type: number + format: double + x-go-name: Gpus + memPerVm: + type: number + format: double + x-go-name: Mem + ntwPerf: + type: string + x-go-name: NtwPerf + ntwPerfCategory: + type: string + x-go-name: NtwPerfCat + onDemandPrice: + type: number + format: double + x-go-name: OnDemandPrice + series: + type: string + x-go-name: Series + spotPrice: + type: array + items: + $ref: "#/components/schemas/ZonePrice" + x-go-name: SpotPrice + type: + type: string + x-go-name: Type + zones: + type: array + items: + type: string + x-go-name: Zones + x-go-package: github.com/banzaicloud/cloudinfo/internal/cloudinfo/types VersionsResponse: description: VersionsResponse holds the list of available versions type: array