Skip to content

Commit

Permalink
update openapi spec schema (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
Utsav Krishnan authored Nov 15, 2021
1 parent 86e0a3c commit fbbc2fb
Show file tree
Hide file tree
Showing 3 changed files with 144 additions and 8 deletions.
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

0 comments on commit fbbc2fb

Please sign in to comment.