Skip to content

Commit

Permalink
adapt to metal-api:images-by-os (#69)
Browse files Browse the repository at this point in the history
  • Loading branch information
mwennrich authored Jul 26, 2021
1 parent 300588c commit 2b4a4ed
Show file tree
Hide file tree
Showing 6 changed files with 357 additions and 2 deletions.
40 changes: 40 additions & 0 deletions api/client/image/image_client.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

149 changes: 149 additions & 0 deletions api/client/image/query_images_by_id_parameters.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

114 changes: 114 additions & 0 deletions api/client/image/query_images_by_id_responses.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -869,8 +869,6 @@ github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635/go.mod h1:hkRG
github.com/tchap/go-patricia v2.2.6+incompatible/go.mod h1:bmLyhP68RS6kStMGxByiQ23RP/odRBOTVjwp2cDyi6I=
github.com/testcontainers/testcontainers-go v0.11.0/go.mod h1:HztBCODzuA+YpMXGK8amjO8j50jz2gcT0BOzSKUiYIs=
github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk=
github.com/tidwall/pretty v1.1.0 h1:K3hMW5epkdAVwibsQEfR/7Zj0Qgt4DxtNumTq/VloO8=
github.com/tidwall/pretty v1.1.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk=
github.com/tidwall/pretty v1.2.0 h1:RWIZEg2iJ8/g6fDDYzMpobmaoGh5OLl4AXtGUGPcqCs=
github.com/tidwall/pretty v1.2.0/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU=
github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U=
Expand Down
13 changes: 13 additions & 0 deletions image.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,19 @@ func (d *Driver) ImageList() (*ImageListResponse, error) {
return response, nil
}

// ImageQueryByID return all machine images
func (d *Driver) ImageQueryByID(imageID string) (*ImageListResponse, error) {
response := &ImageListResponse{}
request := image.NewQueryImagesByIDParams()
request.ID = imageID
resp, err := d.image.QueryImagesByID(request, nil)
if err != nil {
return response, err
}
response.Image = resp.Payload
return response, nil
}

// ImageGet return a image
func (d *Driver) ImageGet(imageID string) (*ImageGetResponse, error) {
response := &ImageGetResponse{}
Expand Down
41 changes: 41 additions & 0 deletions metal-api.json
Original file line number Diff line number Diff line change
Expand Up @@ -5111,6 +5111,47 @@
]
}
},
"/v1/image/{id}/query": {
"get": {
"consumes": [
"application/json"
],
"operationId": "queryImages by id",
"parameters": [
{
"description": "identifier of the image",
"in": "path",
"name": "id",
"required": true,
"type": "string"
}
],
"produces": [
"application/json"
],
"responses": {
"200": {
"description": "OK",
"schema": {
"items": {
"$ref": "#/definitions/v1.ImageResponse"
},
"type": "array"
}
},
"default": {
"description": "Error",
"schema": {
"$ref": "#/definitions/httperrors.HTTPErrorResponse"
}
}
},
"summary": "query all images which match at least id",
"tags": [
"image"
]
}
},
"/v1/ip": {
"get": {
"consumes": [
Expand Down

0 comments on commit 2b4a4ed

Please sign in to comment.