Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update openapi spec schema #20

Merged
merged 1 commit into from
Nov 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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/*")

Expand All @@ -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
Expand Down
77 changes: 77 additions & 0 deletions api/openapi-spec/cloudinfo.json
Original file line number Diff line number Diff line change
Expand Up @@ -651,6 +651,10 @@
"format": "double",
"x-go-name": "OnDemandPrice"
},
"series": {
"type": "string",
"x-go-name": "Series"
},
"spotPrice": {
"type": "array",
"items": {
Expand Down Expand Up @@ -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",
Expand Down
69 changes: 64 additions & 5 deletions api/openapi-spec/cloudinfo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -464,6 +464,9 @@ components:
type: number
format: double
x-go-name: OnDemandPrice
series:
type: string
x-go-name: Series
spotPrice:
type: array
items:
Expand Down Expand Up @@ -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
Expand Down