mirror of
https://github.com/aljazceru/kata-containers.git
synced 2025-12-31 21:14:25 +01:00
Merge pull request #1813 from mcastelino/topic/fc_0_17_0
Firecracker: Upgrade to 0.17.0
This commit is contained in:
14
Gopkg.lock
generated
14
Gopkg.lock
generated
@@ -205,17 +205,6 @@
|
||||
revision = "47565b4f722fb6ceae66b95f853feed578a4a51c"
|
||||
version = "v0.3.3"
|
||||
|
||||
[[projects]]
|
||||
digest = "1:351337e3b022de09e72306f1f9711314cc4bd407c15e8d328e218c655fd55731"
|
||||
name = "github.com/firecracker-microvm/firecracker-go-sdk"
|
||||
packages = [
|
||||
"client",
|
||||
"client/models",
|
||||
"client/operations",
|
||||
]
|
||||
pruneopts = "NUT"
|
||||
revision = "961461227bddf7e40a1d690634e866c343910f86"
|
||||
|
||||
[[projects]]
|
||||
branch = "master"
|
||||
digest = "1:ce0cdcf4a121add67d3c6f7cc08e6233275d0f417852f025b790d35da88fab10"
|
||||
@@ -716,9 +705,6 @@
|
||||
"github.com/cri-o/cri-o/pkg/annotations",
|
||||
"github.com/dlespiau/covertool/pkg/cover",
|
||||
"github.com/docker/go-units",
|
||||
"github.com/firecracker-microvm/firecracker-go-sdk/client",
|
||||
"github.com/firecracker-microvm/firecracker-go-sdk/client/models",
|
||||
"github.com/firecracker-microvm/firecracker-go-sdk/client/operations",
|
||||
"github.com/go-ini/ini",
|
||||
"github.com/go-openapi/runtime/client",
|
||||
"github.com/go-openapi/strfmt",
|
||||
|
||||
@@ -66,10 +66,6 @@
|
||||
name = "github.com/containerd/containerd"
|
||||
revision = "f05672357f56f26751a521175c5a96fc21fa8603"
|
||||
|
||||
[[constraint]]
|
||||
name = "github.com/firecracker-microvm/firecracker-go-sdk"
|
||||
revision = "961461227bddf7e40a1d690634e866c343910f86"
|
||||
|
||||
[[constraint]]
|
||||
name = "github.com/gogo/protobuf"
|
||||
revision = "342cbe0a04158f6dcb03ca0079991a51a4248c02"
|
||||
|
||||
12
vendor/github.com/firecracker-microvm/firecracker-go-sdk/COPYRIGHT_HEADER
generated
vendored
12
vendor/github.com/firecracker-microvm/firecracker-go-sdk/COPYRIGHT_HEADER
generated
vendored
@@ -1,12 +0,0 @@
|
||||
Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License"). You may
|
||||
not use this file except in compliance with the License. A copy of the
|
||||
License is located at
|
||||
|
||||
http://aws.amazon.com/apache2.0/
|
||||
|
||||
or in the "license" file accompanying this file. This file is distributed
|
||||
on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
|
||||
express or implied. See the License for the specific language governing
|
||||
permissions and limitations under the License.
|
||||
202
vendor/github.com/firecracker-microvm/firecracker-go-sdk/LICENSE
generated
vendored
202
vendor/github.com/firecracker-microvm/firecracker-go-sdk/LICENSE
generated
vendored
@@ -1,202 +0,0 @@
|
||||
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
2
vendor/github.com/firecracker-microvm/firecracker-go-sdk/NOTICE
generated
vendored
2
vendor/github.com/firecracker-microvm/firecracker-go-sdk/NOTICE
generated
vendored
@@ -1,2 +0,0 @@
|
||||
Go Firecracker SDK
|
||||
Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
@@ -1,127 +0,0 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License"). You may
|
||||
// not use this file except in compliance with the License. A copy of the
|
||||
// License is located at
|
||||
//
|
||||
// http://aws.amazon.com/apache2.0/
|
||||
//
|
||||
// or in the "license" file accompanying this file. This file is distributed
|
||||
// on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
|
||||
// express or implied. See the License for the specific language governing
|
||||
// permissions and limitations under the License.
|
||||
|
||||
package operations
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"golang.org/x/net/context"
|
||||
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/runtime"
|
||||
cr "github.com/go-openapi/runtime/client"
|
||||
|
||||
strfmt "github.com/go-openapi/strfmt"
|
||||
)
|
||||
|
||||
// NewGetMachineConfigParams creates a new GetMachineConfigParams object
|
||||
// with the default values initialized.
|
||||
func NewGetMachineConfigParams() *GetMachineConfigParams {
|
||||
|
||||
return &GetMachineConfigParams{
|
||||
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetMachineConfigParamsWithTimeout creates a new GetMachineConfigParams object
|
||||
// with the default values initialized, and the ability to set a timeout on a request
|
||||
func NewGetMachineConfigParamsWithTimeout(timeout time.Duration) *GetMachineConfigParams {
|
||||
|
||||
return &GetMachineConfigParams{
|
||||
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetMachineConfigParamsWithContext creates a new GetMachineConfigParams object
|
||||
// with the default values initialized, and the ability to set a context for a request
|
||||
func NewGetMachineConfigParamsWithContext(ctx context.Context) *GetMachineConfigParams {
|
||||
|
||||
return &GetMachineConfigParams{
|
||||
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetMachineConfigParamsWithHTTPClient creates a new GetMachineConfigParams object
|
||||
// with the default values initialized, and the ability to set a custom HTTPClient for a request
|
||||
func NewGetMachineConfigParamsWithHTTPClient(client *http.Client) *GetMachineConfigParams {
|
||||
|
||||
return &GetMachineConfigParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*GetMachineConfigParams contains all the parameters to send to the API endpoint
|
||||
for the get machine config operation typically these are written to a http.Request
|
||||
*/
|
||||
type GetMachineConfigParams struct {
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the get machine config params
|
||||
func (o *GetMachineConfigParams) WithTimeout(timeout time.Duration) *GetMachineConfigParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the get machine config params
|
||||
func (o *GetMachineConfigParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the get machine config params
|
||||
func (o *GetMachineConfigParams) WithContext(ctx context.Context) *GetMachineConfigParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the get machine config params
|
||||
func (o *GetMachineConfigParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the get machine config params
|
||||
func (o *GetMachineConfigParams) WithHTTPClient(client *http.Client) *GetMachineConfigParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the get machine config params
|
||||
func (o *GetMachineConfigParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
func (o *GetMachineConfigParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||
|
||||
if err := r.SetTimeout(o.timeout); err != nil {
|
||||
return err
|
||||
}
|
||||
var res []error
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
@@ -1,125 +0,0 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License"). You may
|
||||
// not use this file except in compliance with the License. A copy of the
|
||||
// License is located at
|
||||
//
|
||||
// http://aws.amazon.com/apache2.0/
|
||||
//
|
||||
// or in the "license" file accompanying this file. This file is distributed
|
||||
// on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
|
||||
// express or implied. See the License for the specific language governing
|
||||
// permissions and limitations under the License.
|
||||
|
||||
package operations
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
|
||||
"github.com/go-openapi/runtime"
|
||||
|
||||
strfmt "github.com/go-openapi/strfmt"
|
||||
|
||||
client_models "github.com/firecracker-microvm/firecracker-go-sdk/client/models"
|
||||
)
|
||||
|
||||
// GetMachineConfigReader is a Reader for the GetMachineConfig structure.
|
||||
type GetMachineConfigReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *GetMachineConfigReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
|
||||
case 200:
|
||||
result := NewGetMachineConfigOK()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return result, nil
|
||||
|
||||
default:
|
||||
result := NewGetMachineConfigDefault(response.Code())
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if response.Code()/100 == 2 {
|
||||
return result, nil
|
||||
}
|
||||
return nil, result
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetMachineConfigOK creates a GetMachineConfigOK with default headers values
|
||||
func NewGetMachineConfigOK() *GetMachineConfigOK {
|
||||
return &GetMachineConfigOK{}
|
||||
}
|
||||
|
||||
/*GetMachineConfigOK handles this case with default header values.
|
||||
|
||||
OK
|
||||
*/
|
||||
type GetMachineConfigOK struct {
|
||||
Payload *client_models.MachineConfiguration
|
||||
}
|
||||
|
||||
func (o *GetMachineConfigOK) Error() string {
|
||||
return fmt.Sprintf("[GET /machine-config][%d] getMachineConfigOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetMachineConfigOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(client_models.MachineConfiguration)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewGetMachineConfigDefault creates a GetMachineConfigDefault with default headers values
|
||||
func NewGetMachineConfigDefault(code int) *GetMachineConfigDefault {
|
||||
return &GetMachineConfigDefault{
|
||||
_statusCode: code,
|
||||
}
|
||||
}
|
||||
|
||||
/*GetMachineConfigDefault handles this case with default header values.
|
||||
|
||||
Internal server error
|
||||
*/
|
||||
type GetMachineConfigDefault struct {
|
||||
_statusCode int
|
||||
|
||||
Payload *client_models.Error
|
||||
}
|
||||
|
||||
// Code gets the status code for the get machine config default response
|
||||
func (o *GetMachineConfigDefault) Code() int {
|
||||
return o._statusCode
|
||||
}
|
||||
|
||||
func (o *GetMachineConfigDefault) Error() string {
|
||||
return fmt.Sprintf("[GET /machine-config][%d] GetMachineConfig default %+v", o._statusCode, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetMachineConfigDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(client_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
@@ -76,7 +76,7 @@ assets:
|
||||
uscan-url: >-
|
||||
https://github.com/firecracker-microvm/firecracker/tags
|
||||
.*/v?(\d\S+)\.tar\.gz
|
||||
version: "v0.16.0"
|
||||
version: "v0.17.0"
|
||||
|
||||
nemu:
|
||||
description: "Reduced-emulation VMM that uses KVM"
|
||||
|
||||
@@ -19,11 +19,11 @@ import (
|
||||
"syscall"
|
||||
"time"
|
||||
|
||||
"github.com/firecracker-microvm/firecracker-go-sdk/client"
|
||||
models "github.com/firecracker-microvm/firecracker-go-sdk/client/models"
|
||||
ops "github.com/firecracker-microvm/firecracker-go-sdk/client/operations"
|
||||
httptransport "github.com/go-openapi/runtime/client"
|
||||
"github.com/go-openapi/strfmt"
|
||||
"github.com/kata-containers/runtime/virtcontainers/pkg/firecracker/client"
|
||||
models "github.com/kata-containers/runtime/virtcontainers/pkg/firecracker/client/models"
|
||||
ops "github.com/kata-containers/runtime/virtcontainers/pkg/firecracker/client/operations"
|
||||
opentracing "github.com/opentracing/opentracing-go"
|
||||
"github.com/pkg/errors"
|
||||
"github.com/sirupsen/logrus"
|
||||
@@ -195,7 +195,7 @@ func (fc *firecracker) vmRunning() bool {
|
||||
}
|
||||
|
||||
// Be explicit
|
||||
switch resp.Payload.State {
|
||||
switch *resp.Payload.State {
|
||||
case models.InstanceInfoStateStarting:
|
||||
// Unsure what we should do here
|
||||
fc.Logger().WithField("unexpected-state", models.InstanceInfoStateStarting).Debug("vmRunning")
|
||||
@@ -370,9 +370,9 @@ func (fc *firecracker) fcSetVMBaseConfig(mem int64, vcpus int64, htEnabled bool)
|
||||
|
||||
param := ops.NewPutMachineConfigurationParams()
|
||||
cfg := &models.MachineConfiguration{
|
||||
HtEnabled: htEnabled,
|
||||
MemSizeMib: mem,
|
||||
VcpuCount: vcpus,
|
||||
HtEnabled: &htEnabled,
|
||||
MemSizeMib: &mem,
|
||||
VcpuCount: &vcpus,
|
||||
}
|
||||
param.SetBody(cfg)
|
||||
_, err := fc.client().Operations.PutMachineConfiguration(param)
|
||||
@@ -389,8 +389,9 @@ func (fc *firecracker) fcStartVM() error {
|
||||
fc.fcClient = fc.newFireClient()
|
||||
|
||||
actionParams := ops.NewCreateSyncActionParams()
|
||||
actionType := "InstanceStart"
|
||||
actionInfo := &models.InstanceActionInfo{
|
||||
ActionType: "InstanceStart",
|
||||
ActionType: &actionType,
|
||||
}
|
||||
actionParams.SetInfo(actionInfo)
|
||||
_, err := fc.client().Operations.CreateSyncAction(actionParams)
|
||||
@@ -535,8 +536,9 @@ func (fc *firecracker) fcAddVsock(vs kataVSOCK) error {
|
||||
|
||||
vsockParams := ops.NewPutGuestVsockByIDParams()
|
||||
vsockID := "root"
|
||||
ctxID := int64(vs.contextID)
|
||||
vsock := &models.Vsock{
|
||||
GuestCid: int64(vs.contextID),
|
||||
GuestCid: &ctxID,
|
||||
ID: &vsockID,
|
||||
}
|
||||
vsockParams.SetID(vsockID)
|
||||
@@ -562,7 +564,7 @@ func (fc *firecracker) fcAddNetDevice(endpoint Endpoint) error {
|
||||
AllowMmdsRequests: false,
|
||||
GuestMac: endpoint.HardwareAddr(),
|
||||
IfaceID: &ifaceID,
|
||||
HostDevName: endpoint.NetworkPair().TapInterface.TAPIface.Name,
|
||||
HostDevName: &endpoint.NetworkPair().TapInterface.TAPIface.Name,
|
||||
}
|
||||
cfg.SetBody(ifaceCfg)
|
||||
cfg.SetIfaceID(ifaceID)
|
||||
@@ -614,8 +616,9 @@ func (fc *firecracker) fcUpdateBlockDrive(drive config.BlockDrive) error {
|
||||
// Rescan needs to used only if the VM is running
|
||||
if fc.vmRunning() {
|
||||
actionParams := ops.NewCreateSyncActionParams()
|
||||
actionType := "BlockDeviceRescan"
|
||||
actionInfo := &models.InstanceActionInfo{
|
||||
ActionType: "BlockDeviceRescan",
|
||||
ActionType: &actionType,
|
||||
Payload: driveID,
|
||||
}
|
||||
actionParams.SetInfo(actionInfo)
|
||||
|
||||
17
virtcontainers/pkg/firecracker/README
Normal file
17
virtcontainers/pkg/firecracker/README
Normal file
@@ -0,0 +1,17 @@
|
||||
This directory and sub directories contain generated code.
|
||||
|
||||
The code is generated via go-swagger
|
||||
|
||||
https://github.com/go-swagger/go-swagger#licensing
|
||||
|
||||
```
|
||||
swagger generate model -f ./firecracker-experimental.yaml --model-package=client/models --client-package=client
|
||||
swagger generate client -f ./firecracker-experimental.yaml --model-package=client/models --client-package=client
|
||||
```
|
||||
|
||||
```
|
||||
The toolkit itself is licensed as Apache Software License 2.0. Just like swagger, this does not cover code generated by the toolkit.
|
||||
That code is entirely yours to license however you see fit.
|
||||
```
|
||||
|
||||
The generated code is also licensed under Apache Software License 2.0
|
||||
@@ -1,18 +1,5 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License"). You may
|
||||
// not use this file except in compliance with the License. A copy of the
|
||||
// License is located at
|
||||
//
|
||||
// http://aws.amazon.com/apache2.0/
|
||||
//
|
||||
// or in the "license" file accompanying this file. This file is distributed
|
||||
// on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
|
||||
// express or implied. See the License for the specific language governing
|
||||
// permissions and limitations under the License.
|
||||
|
||||
package client
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
@@ -24,7 +11,7 @@ import (
|
||||
|
||||
strfmt "github.com/go-openapi/strfmt"
|
||||
|
||||
"github.com/firecracker-microvm/firecracker-go-sdk/client/operations"
|
||||
"github.com/kata-containers/runtime/virtcontainers/pkg/firecracker/client/operations"
|
||||
)
|
||||
|
||||
// Default firecracker HTTP client.
|
||||
@@ -1,19 +1,6 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License"). You may
|
||||
// not use this file except in compliance with the License. A copy of the
|
||||
// License is located at
|
||||
//
|
||||
// http://aws.amazon.com/apache2.0/
|
||||
//
|
||||
// or in the "license" file accompanying this file. This file is distributed
|
||||
// on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
|
||||
// express or implied. See the License for the specific language governing
|
||||
// permissions and limitations under the License.
|
||||
|
||||
package client_models
|
||||
package models
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
@@ -1,19 +1,6 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License"). You may
|
||||
// not use this file except in compliance with the License. A copy of the
|
||||
// License is located at
|
||||
//
|
||||
// http://aws.amazon.com/apache2.0/
|
||||
//
|
||||
// or in the "license" file accompanying this file. This file is distributed
|
||||
// on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
|
||||
// express or implied. See the License for the specific language governing
|
||||
// permissions and limitations under the License.
|
||||
|
||||
package client_models
|
||||
package models
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
@@ -1,19 +1,6 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License"). You may
|
||||
// not use this file except in compliance with the License. A copy of the
|
||||
// License is located at
|
||||
//
|
||||
// http://aws.amazon.com/apache2.0/
|
||||
//
|
||||
// or in the "license" file accompanying this file. This file is distributed
|
||||
// on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
|
||||
// express or implied. See the License for the specific language governing
|
||||
// permissions and limitations under the License.
|
||||
|
||||
package client_models
|
||||
package models
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
@@ -1,19 +1,6 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License"). You may
|
||||
// not use this file except in compliance with the License. A copy of the
|
||||
// License is located at
|
||||
//
|
||||
// http://aws.amazon.com/apache2.0/
|
||||
//
|
||||
// or in the "license" file accompanying this file. This file is distributed
|
||||
// on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
|
||||
// express or implied. See the License for the specific language governing
|
||||
// permissions and limitations under the License.
|
||||
|
||||
package client_models
|
||||
package models
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
@@ -29,6 +16,7 @@ import (
|
||||
type Error struct {
|
||||
|
||||
// A description of the error condition
|
||||
// Read Only: true
|
||||
FaultMessage string `json:"fault_message,omitempty"`
|
||||
}
|
||||
|
||||
@@ -1,19 +1,6 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License"). You may
|
||||
// not use this file except in compliance with the License. A copy of the
|
||||
// License is located at
|
||||
//
|
||||
// http://aws.amazon.com/apache2.0/
|
||||
//
|
||||
// or in the "license" file accompanying this file. This file is distributed
|
||||
// on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
|
||||
// express or implied. See the License for the specific language governing
|
||||
// permissions and limitations under the License.
|
||||
|
||||
package client_models
|
||||
package models
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
@@ -33,8 +20,9 @@ import (
|
||||
type InstanceActionInfo struct {
|
||||
|
||||
// Enumeration indicating what type of action is contained in the payload
|
||||
// Enum: [BlockDeviceRescan InstanceStart InstanceHalt]
|
||||
ActionType string `json:"action_type,omitempty"`
|
||||
// Required: true
|
||||
// Enum: [BlockDeviceRescan FlushMetrics InstanceStart SendCtrlAltDel]
|
||||
ActionType *string `json:"action_type"`
|
||||
|
||||
// payload
|
||||
Payload string `json:"payload,omitempty"`
|
||||
@@ -58,7 +46,7 @@ var instanceActionInfoTypeActionTypePropEnum []interface{}
|
||||
|
||||
func init() {
|
||||
var res []string
|
||||
if err := json.Unmarshal([]byte(`["BlockDeviceRescan","InstanceStart","InstanceHalt"]`), &res); err != nil {
|
||||
if err := json.Unmarshal([]byte(`["BlockDeviceRescan","FlushMetrics","InstanceStart","SendCtrlAltDel"]`), &res); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
for _, v := range res {
|
||||
@@ -71,11 +59,14 @@ const (
|
||||
// InstanceActionInfoActionTypeBlockDeviceRescan captures enum value "BlockDeviceRescan"
|
||||
InstanceActionInfoActionTypeBlockDeviceRescan string = "BlockDeviceRescan"
|
||||
|
||||
// InstanceActionInfoActionTypeFlushMetrics captures enum value "FlushMetrics"
|
||||
InstanceActionInfoActionTypeFlushMetrics string = "FlushMetrics"
|
||||
|
||||
// InstanceActionInfoActionTypeInstanceStart captures enum value "InstanceStart"
|
||||
InstanceActionInfoActionTypeInstanceStart string = "InstanceStart"
|
||||
|
||||
// InstanceActionInfoActionTypeInstanceHalt captures enum value "InstanceHalt"
|
||||
InstanceActionInfoActionTypeInstanceHalt string = "InstanceHalt"
|
||||
// InstanceActionInfoActionTypeSendCtrlAltDel captures enum value "SendCtrlAltDel"
|
||||
InstanceActionInfoActionTypeSendCtrlAltDel string = "SendCtrlAltDel"
|
||||
)
|
||||
|
||||
// prop value enum
|
||||
@@ -88,12 +79,12 @@ func (m *InstanceActionInfo) validateActionTypeEnum(path, location string, value
|
||||
|
||||
func (m *InstanceActionInfo) validateActionType(formats strfmt.Registry) error {
|
||||
|
||||
if swag.IsZero(m.ActionType) { // not required
|
||||
return nil
|
||||
if err := validate.Required("action_type", "body", m.ActionType); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// value enum
|
||||
if err := m.validateActionTypeEnum("action_type", "body", m.ActionType); err != nil {
|
||||
if err := m.validateActionTypeEnum("action_type", "body", *m.ActionType); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -1,19 +1,6 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License"). You may
|
||||
// not use this file except in compliance with the License. A copy of the
|
||||
// License is located at
|
||||
//
|
||||
// http://aws.amazon.com/apache2.0/
|
||||
//
|
||||
// or in the "license" file accompanying this file. This file is distributed
|
||||
// on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
|
||||
// express or implied. See the License for the specific language governing
|
||||
// permissions and limitations under the License.
|
||||
|
||||
package client_models
|
||||
package models
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
@@ -28,32 +15,55 @@ import (
|
||||
"github.com/go-openapi/validate"
|
||||
)
|
||||
|
||||
// InstanceInfo instance info
|
||||
// InstanceInfo Describes MicroVM instance information.
|
||||
// swagger:model InstanceInfo
|
||||
type InstanceInfo struct {
|
||||
|
||||
// MicroVM / instance ID.
|
||||
ID string `json:"id,omitempty"`
|
||||
// Required: true
|
||||
ID *string `json:"id"`
|
||||
|
||||
// The current detailed state of the Firecracker instance. This value is read-only for the control-plane.
|
||||
// Required: true
|
||||
// Enum: [Uninitialized Starting Running Halting Halted]
|
||||
State string `json:"state,omitempty"`
|
||||
State *string `json:"state"`
|
||||
|
||||
// MicroVM hypervisor build version.
|
||||
// Required: true
|
||||
VmmVersion *string `json:"vmm_version"`
|
||||
}
|
||||
|
||||
// Validate validates this instance info
|
||||
func (m *InstanceInfo) Validate(formats strfmt.Registry) error {
|
||||
var res []error
|
||||
|
||||
if err := m.validateID(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if err := m.validateState(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if err := m.validateVmmVersion(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *InstanceInfo) validateID(formats strfmt.Registry) error {
|
||||
|
||||
if err := validate.Required("id", "body", m.ID); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
var instanceInfoTypeStatePropEnum []interface{}
|
||||
|
||||
func init() {
|
||||
@@ -94,12 +104,21 @@ func (m *InstanceInfo) validateStateEnum(path, location string, value string) er
|
||||
|
||||
func (m *InstanceInfo) validateState(formats strfmt.Registry) error {
|
||||
|
||||
if swag.IsZero(m.State) { // not required
|
||||
return nil
|
||||
if err := validate.Required("state", "body", m.State); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// value enum
|
||||
if err := m.validateStateEnum("state", "body", m.State); err != nil {
|
||||
if err := m.validateStateEnum("state", "body", *m.State); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *InstanceInfo) validateVmmVersion(formats strfmt.Registry) error {
|
||||
|
||||
if err := validate.Required("vmm_version", "body", m.VmmVersion); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -1,19 +1,6 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License"). You may
|
||||
// not use this file except in compliance with the License. A copy of the
|
||||
// License is located at
|
||||
//
|
||||
// http://aws.amazon.com/apache2.0/
|
||||
//
|
||||
// or in the "license" file accompanying this file. This file is distributed
|
||||
// on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
|
||||
// express or implied. See the License for the specific language governing
|
||||
// permissions and limitations under the License.
|
||||
|
||||
package client_models
|
||||
package models
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
@@ -34,22 +21,24 @@ type Logger struct {
|
||||
|
||||
// Set the level.
|
||||
// Enum: [Error Warning Info Debug]
|
||||
Level string `json:"level,omitempty"`
|
||||
Level *string `json:"level,omitempty"`
|
||||
|
||||
// The named pipe for the human readable log output.
|
||||
LogFifo string `json:"log_fifo,omitempty"`
|
||||
// Required: true
|
||||
LogFifo *string `json:"log_fifo"`
|
||||
|
||||
// The named pipe where the JSON-formatted metrics will be flushed.
|
||||
MetricsFifo string `json:"metrics_fifo,omitempty"`
|
||||
// Required: true
|
||||
MetricsFifo *string `json:"metrics_fifo"`
|
||||
|
||||
// Additional logging options. Only "LogDirtyPages" is supported.
|
||||
Options []string `json:"options"`
|
||||
|
||||
// Whether or not to output the level in the logs.
|
||||
ShowLevel bool `json:"show_level,omitempty"`
|
||||
ShowLevel *bool `json:"show_level,omitempty"`
|
||||
|
||||
// Whether or not to include the file path and line number of the log's origin.
|
||||
ShowLogOrigin bool `json:"show_log_origin,omitempty"`
|
||||
ShowLogOrigin *bool `json:"show_log_origin,omitempty"`
|
||||
}
|
||||
|
||||
// Validate validates this logger
|
||||
@@ -60,6 +49,14 @@ func (m *Logger) Validate(formats strfmt.Registry) error {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if err := m.validateLogFifo(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if err := m.validateMetricsFifo(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
@@ -108,7 +105,25 @@ func (m *Logger) validateLevel(formats strfmt.Registry) error {
|
||||
}
|
||||
|
||||
// value enum
|
||||
if err := m.validateLevelEnum("level", "body", m.Level); err != nil {
|
||||
if err := m.validateLevelEnum("level", "body", *m.Level); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *Logger) validateLogFifo(formats strfmt.Registry) error {
|
||||
|
||||
if err := validate.Required("log_fifo", "body", m.LogFifo); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *Logger) validateMetricsFifo(formats strfmt.Registry) error {
|
||||
|
||||
if err := validate.Required("metrics_fifo", "body", m.MetricsFifo); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -1,19 +1,6 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License"). You may
|
||||
// not use this file except in compliance with the License. A copy of the
|
||||
// License is located at
|
||||
//
|
||||
// http://aws.amazon.com/apache2.0/
|
||||
//
|
||||
// or in the "license" file accompanying this file. This file is distributed
|
||||
// on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
|
||||
// express or implied. See the License for the specific language governing
|
||||
// permissions and limitations under the License.
|
||||
|
||||
package client_models
|
||||
package models
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
@@ -23,6 +10,7 @@ import (
|
||||
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/swag"
|
||||
"github.com/go-openapi/validate"
|
||||
)
|
||||
|
||||
// MachineConfiguration Describes the number of vCPUs, memory size, Hyperthreading capabilities and the CPU template.
|
||||
@@ -33,13 +21,18 @@ type MachineConfiguration struct {
|
||||
CPUTemplate CPUTemplate `json:"cpu_template,omitempty"`
|
||||
|
||||
// Flag for enabling/disabling Hyperthreading
|
||||
HtEnabled bool `json:"ht_enabled,omitempty"`
|
||||
// Required: true
|
||||
HtEnabled *bool `json:"ht_enabled"`
|
||||
|
||||
// Memory size of VM
|
||||
MemSizeMib int64 `json:"mem_size_mib,omitempty"`
|
||||
// Required: true
|
||||
MemSizeMib *int64 `json:"mem_size_mib"`
|
||||
|
||||
// Number of vCPUs (either 1 or an even number)
|
||||
VcpuCount int64 `json:"vcpu_count,omitempty"`
|
||||
// Required: true
|
||||
// Maximum: 32
|
||||
// Minimum: 1
|
||||
VcpuCount *int64 `json:"vcpu_count"`
|
||||
}
|
||||
|
||||
// Validate validates this machine configuration
|
||||
@@ -50,6 +43,18 @@ func (m *MachineConfiguration) Validate(formats strfmt.Registry) error {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if err := m.validateHtEnabled(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if err := m.validateMemSizeMib(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if err := m.validateVcpuCount(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
@@ -72,6 +77,41 @@ func (m *MachineConfiguration) validateCPUTemplate(formats strfmt.Registry) erro
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *MachineConfiguration) validateHtEnabled(formats strfmt.Registry) error {
|
||||
|
||||
if err := validate.Required("ht_enabled", "body", m.HtEnabled); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *MachineConfiguration) validateMemSizeMib(formats strfmt.Registry) error {
|
||||
|
||||
if err := validate.Required("mem_size_mib", "body", m.MemSizeMib); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *MachineConfiguration) validateVcpuCount(formats strfmt.Registry) error {
|
||||
|
||||
if err := validate.Required("vcpu_count", "body", m.VcpuCount); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if err := validate.MinimumInt("vcpu_count", "body", int64(*m.VcpuCount), 1, false); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if err := validate.MaximumInt("vcpu_count", "body", int64(*m.VcpuCount), 32, false); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalBinary interface implementation
|
||||
func (m *MachineConfiguration) MarshalBinary() ([]byte, error) {
|
||||
if m == nil {
|
||||
@@ -1,19 +1,6 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License"). You may
|
||||
// not use this file except in compliance with the License. A copy of the
|
||||
// License is located at
|
||||
//
|
||||
// http://aws.amazon.com/apache2.0/
|
||||
//
|
||||
// or in the "license" file accompanying this file. This file is distributed
|
||||
// on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
|
||||
// express or implied. See the License for the specific language governing
|
||||
// permissions and limitations under the License.
|
||||
|
||||
package client_models
|
||||
package models
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
@@ -37,7 +24,8 @@ type NetworkInterface struct {
|
||||
GuestMac string `json:"guest_mac,omitempty"`
|
||||
|
||||
// Host level path for the guest network interface
|
||||
HostDevName string `json:"host_dev_name,omitempty"`
|
||||
// Required: true
|
||||
HostDevName *string `json:"host_dev_name"`
|
||||
|
||||
// iface id
|
||||
// Required: true
|
||||
@@ -54,6 +42,10 @@ type NetworkInterface struct {
|
||||
func (m *NetworkInterface) Validate(formats strfmt.Registry) error {
|
||||
var res []error
|
||||
|
||||
if err := m.validateHostDevName(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if err := m.validateIfaceID(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
@@ -72,6 +64,15 @@ func (m *NetworkInterface) Validate(formats strfmt.Registry) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *NetworkInterface) validateHostDevName(formats strfmt.Registry) error {
|
||||
|
||||
if err := validate.Required("host_dev_name", "body", m.HostDevName); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *NetworkInterface) validateIfaceID(formats strfmt.Registry) error {
|
||||
|
||||
if err := validate.Required("iface_id", "body", m.IfaceID); err != nil {
|
||||
@@ -1,19 +1,6 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License"). You may
|
||||
// not use this file except in compliance with the License. A copy of the
|
||||
// License is located at
|
||||
//
|
||||
// http://aws.amazon.com/apache2.0/
|
||||
//
|
||||
// or in the "license" file accompanying this file. This file is distributed
|
||||
// on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
|
||||
// express or implied. See the License for the specific language governing
|
||||
// permissions and limitations under the License.
|
||||
|
||||
package client_models
|
||||
package models
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
@@ -0,0 +1,114 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package models
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
strfmt "github.com/go-openapi/strfmt"
|
||||
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/swag"
|
||||
"github.com/go-openapi/validate"
|
||||
)
|
||||
|
||||
// PartialNetworkInterface Defines a partial network interface structure, used to update the rate limiters for that interface, after microvm start.
|
||||
// swagger:model PartialNetworkInterface
|
||||
type PartialNetworkInterface struct {
|
||||
|
||||
// iface id
|
||||
// Required: true
|
||||
IfaceID *string `json:"iface_id"`
|
||||
|
||||
// rx rate limiter
|
||||
RxRateLimiter *RateLimiter `json:"rx_rate_limiter,omitempty"`
|
||||
|
||||
// tx rate limiter
|
||||
TxRateLimiter *RateLimiter `json:"tx_rate_limiter,omitempty"`
|
||||
}
|
||||
|
||||
// Validate validates this partial network interface
|
||||
func (m *PartialNetworkInterface) Validate(formats strfmt.Registry) error {
|
||||
var res []error
|
||||
|
||||
if err := m.validateIfaceID(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if err := m.validateRxRateLimiter(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if err := m.validateTxRateLimiter(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *PartialNetworkInterface) validateIfaceID(formats strfmt.Registry) error {
|
||||
|
||||
if err := validate.Required("iface_id", "body", m.IfaceID); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *PartialNetworkInterface) validateRxRateLimiter(formats strfmt.Registry) error {
|
||||
|
||||
if swag.IsZero(m.RxRateLimiter) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if m.RxRateLimiter != nil {
|
||||
if err := m.RxRateLimiter.Validate(formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("rx_rate_limiter")
|
||||
}
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *PartialNetworkInterface) validateTxRateLimiter(formats strfmt.Registry) error {
|
||||
|
||||
if swag.IsZero(m.TxRateLimiter) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if m.TxRateLimiter != nil {
|
||||
if err := m.TxRateLimiter.Validate(formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("tx_rate_limiter")
|
||||
}
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalBinary interface implementation
|
||||
func (m *PartialNetworkInterface) MarshalBinary() ([]byte, error) {
|
||||
if m == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return swag.WriteJSON(m)
|
||||
}
|
||||
|
||||
// UnmarshalBinary interface implementation
|
||||
func (m *PartialNetworkInterface) UnmarshalBinary(b []byte) error {
|
||||
var res PartialNetworkInterface
|
||||
if err := swag.ReadJSON(b, &res); err != nil {
|
||||
return err
|
||||
}
|
||||
*m = res
|
||||
return nil
|
||||
}
|
||||
@@ -1,19 +1,6 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License"). You may
|
||||
// not use this file except in compliance with the License. A copy of the
|
||||
// License is located at
|
||||
//
|
||||
// http://aws.amazon.com/apache2.0/
|
||||
//
|
||||
// or in the "license" file accompanying this file. This file is distributed
|
||||
// on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
|
||||
// express or implied. See the License for the specific language governing
|
||||
// permissions and limitations under the License.
|
||||
|
||||
package client_models
|
||||
package models
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
@@ -1,19 +1,6 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License"). You may
|
||||
// not use this file except in compliance with the License. A copy of the
|
||||
// License is located at
|
||||
//
|
||||
// http://aws.amazon.com/apache2.0/
|
||||
//
|
||||
// or in the "license" file accompanying this file. This file is distributed
|
||||
// on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
|
||||
// express or implied. See the License for the specific language governing
|
||||
// permissions and limitations under the License.
|
||||
|
||||
package client_models
|
||||
package models
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
@@ -35,12 +22,14 @@ type TokenBucket struct {
|
||||
OneTimeBurst *int64 `json:"one_time_burst,omitempty"`
|
||||
|
||||
// The amount of milliseconds it takes for the bucket to refill.
|
||||
// Required: true
|
||||
// Minimum: 0
|
||||
RefillTime *int64 `json:"refill_time,omitempty"`
|
||||
RefillTime *int64 `json:"refill_time"`
|
||||
|
||||
// The total number of tokens this bucket can hold.
|
||||
// Required: true
|
||||
// Minimum: 0
|
||||
Size *int64 `json:"size,omitempty"`
|
||||
Size *int64 `json:"size"`
|
||||
}
|
||||
|
||||
// Validate validates this token bucket
|
||||
@@ -80,8 +69,8 @@ func (m *TokenBucket) validateOneTimeBurst(formats strfmt.Registry) error {
|
||||
|
||||
func (m *TokenBucket) validateRefillTime(formats strfmt.Registry) error {
|
||||
|
||||
if swag.IsZero(m.RefillTime) { // not required
|
||||
return nil
|
||||
if err := validate.Required("refill_time", "body", m.RefillTime); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if err := validate.MinimumInt("refill_time", "body", int64(*m.RefillTime), 0, false); err != nil {
|
||||
@@ -93,8 +82,8 @@ func (m *TokenBucket) validateRefillTime(formats strfmt.Registry) error {
|
||||
|
||||
func (m *TokenBucket) validateSize(formats strfmt.Registry) error {
|
||||
|
||||
if swag.IsZero(m.Size) { // not required
|
||||
return nil
|
||||
if err := validate.Required("size", "body", m.Size); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if err := validate.MinimumInt("size", "body", int64(*m.Size), 0, false); err != nil {
|
||||
@@ -1,19 +1,6 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License"). You may
|
||||
// not use this file except in compliance with the License. A copy of the
|
||||
// License is located at
|
||||
//
|
||||
// http://aws.amazon.com/apache2.0/
|
||||
//
|
||||
// or in the "license" file accompanying this file. This file is distributed
|
||||
// on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
|
||||
// express or implied. See the License for the specific language governing
|
||||
// permissions and limitations under the License.
|
||||
|
||||
package client_models
|
||||
package models
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
@@ -31,8 +18,9 @@ import (
|
||||
type Vsock struct {
|
||||
|
||||
// Guest Vsock CID
|
||||
// Required: true
|
||||
// Minimum: 3
|
||||
GuestCid int64 `json:"guest_cid,omitempty"`
|
||||
GuestCid *int64 `json:"guest_cid"`
|
||||
|
||||
// id
|
||||
// Required: true
|
||||
@@ -59,11 +47,11 @@ func (m *Vsock) Validate(formats strfmt.Registry) error {
|
||||
|
||||
func (m *Vsock) validateGuestCid(formats strfmt.Registry) error {
|
||||
|
||||
if swag.IsZero(m.GuestCid) { // not required
|
||||
return nil
|
||||
if err := validate.Required("guest_cid", "body", m.GuestCid); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if err := validate.MinimumInt("guest_cid", "body", int64(m.GuestCid), 3, false); err != nil {
|
||||
if err := validate.MinimumInt("guest_cid", "body", int64(*m.GuestCid), 3, false); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -1,36 +1,22 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License"). You may
|
||||
// not use this file except in compliance with the License. A copy of the
|
||||
// License is located at
|
||||
//
|
||||
// http://aws.amazon.com/apache2.0/
|
||||
//
|
||||
// or in the "license" file accompanying this file. This file is distributed
|
||||
// on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
|
||||
// express or implied. See the License for the specific language governing
|
||||
// permissions and limitations under the License.
|
||||
|
||||
package operations
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"golang.org/x/net/context"
|
||||
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/runtime"
|
||||
cr "github.com/go-openapi/runtime/client"
|
||||
|
||||
strfmt "github.com/go-openapi/strfmt"
|
||||
|
||||
client_models "github.com/firecracker-microvm/firecracker-go-sdk/client/models"
|
||||
models "github.com/kata-containers/runtime/virtcontainers/pkg/firecracker/client/models"
|
||||
)
|
||||
|
||||
// NewCreateSyncActionParams creates a new CreateSyncActionParams object
|
||||
@@ -78,7 +64,7 @@ for the create sync action operation typically these are written to a http.Reque
|
||||
type CreateSyncActionParams struct {
|
||||
|
||||
/*Info*/
|
||||
Info *client_models.InstanceActionInfo
|
||||
Info *models.InstanceActionInfo
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
@@ -119,13 +105,13 @@ func (o *CreateSyncActionParams) SetHTTPClient(client *http.Client) {
|
||||
}
|
||||
|
||||
// WithInfo adds the info to the create sync action params
|
||||
func (o *CreateSyncActionParams) WithInfo(info *client_models.InstanceActionInfo) *CreateSyncActionParams {
|
||||
func (o *CreateSyncActionParams) WithInfo(info *models.InstanceActionInfo) *CreateSyncActionParams {
|
||||
o.SetInfo(info)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetInfo adds the info to the create sync action params
|
||||
func (o *CreateSyncActionParams) SetInfo(info *client_models.InstanceActionInfo) {
|
||||
func (o *CreateSyncActionParams) SetInfo(info *models.InstanceActionInfo) {
|
||||
o.Info = info
|
||||
}
|
||||
|
||||
@@ -1,18 +1,5 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License"). You may
|
||||
// not use this file except in compliance with the License. A copy of the
|
||||
// License is located at
|
||||
//
|
||||
// http://aws.amazon.com/apache2.0/
|
||||
//
|
||||
// or in the "license" file accompanying this file. This file is distributed
|
||||
// on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
|
||||
// express or implied. See the License for the specific language governing
|
||||
// permissions and limitations under the License.
|
||||
|
||||
package operations
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
@@ -26,7 +13,7 @@ import (
|
||||
|
||||
strfmt "github.com/go-openapi/strfmt"
|
||||
|
||||
client_models "github.com/firecracker-microvm/firecracker-go-sdk/client/models"
|
||||
models "github.com/kata-containers/runtime/virtcontainers/pkg/firecracker/client/models"
|
||||
)
|
||||
|
||||
// CreateSyncActionReader is a Reader for the CreateSyncAction structure.
|
||||
@@ -95,7 +82,7 @@ func NewCreateSyncActionBadRequest() *CreateSyncActionBadRequest {
|
||||
The action cannot be executed due to bad input
|
||||
*/
|
||||
type CreateSyncActionBadRequest struct {
|
||||
Payload *client_models.Error
|
||||
Payload *models.Error
|
||||
}
|
||||
|
||||
func (o *CreateSyncActionBadRequest) Error() string {
|
||||
@@ -104,7 +91,7 @@ func (o *CreateSyncActionBadRequest) Error() string {
|
||||
|
||||
func (o *CreateSyncActionBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(client_models.Error)
|
||||
o.Payload = new(models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
@@ -128,7 +115,7 @@ Internal Server Error
|
||||
type CreateSyncActionDefault struct {
|
||||
_statusCode int
|
||||
|
||||
Payload *client_models.Error
|
||||
Payload *models.Error
|
||||
}
|
||||
|
||||
// Code gets the status code for the create sync action default response
|
||||
@@ -142,7 +129,7 @@ func (o *CreateSyncActionDefault) Error() string {
|
||||
|
||||
func (o *CreateSyncActionDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(client_models.Error)
|
||||
o.Payload = new(models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
@@ -1,29 +1,15 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License"). You may
|
||||
// not use this file except in compliance with the License. A copy of the
|
||||
// License is located at
|
||||
//
|
||||
// http://aws.amazon.com/apache2.0/
|
||||
//
|
||||
// or in the "license" file accompanying this file. This file is distributed
|
||||
// on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
|
||||
// express or implied. See the License for the specific language governing
|
||||
// permissions and limitations under the License.
|
||||
|
||||
package operations
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"golang.org/x/net/context"
|
||||
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/runtime"
|
||||
cr "github.com/go-openapi/runtime/client"
|
||||
@@ -1,18 +1,5 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License"). You may
|
||||
// not use this file except in compliance with the License. A copy of the
|
||||
// License is located at
|
||||
//
|
||||
// http://aws.amazon.com/apache2.0/
|
||||
//
|
||||
// or in the "license" file accompanying this file. This file is distributed
|
||||
// on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
|
||||
// express or implied. See the License for the specific language governing
|
||||
// permissions and limitations under the License.
|
||||
|
||||
package operations
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
@@ -26,7 +13,7 @@ import (
|
||||
|
||||
strfmt "github.com/go-openapi/strfmt"
|
||||
|
||||
client_models "github.com/firecracker-microvm/firecracker-go-sdk/client/models"
|
||||
models "github.com/kata-containers/runtime/virtcontainers/pkg/firecracker/client/models"
|
||||
)
|
||||
|
||||
// DescribeInstanceReader is a Reader for the DescribeInstance structure.
|
||||
@@ -67,7 +54,7 @@ func NewDescribeInstanceOK() *DescribeInstanceOK {
|
||||
The instance information
|
||||
*/
|
||||
type DescribeInstanceOK struct {
|
||||
Payload *client_models.InstanceInfo
|
||||
Payload *models.InstanceInfo
|
||||
}
|
||||
|
||||
func (o *DescribeInstanceOK) Error() string {
|
||||
@@ -76,7 +63,7 @@ func (o *DescribeInstanceOK) Error() string {
|
||||
|
||||
func (o *DescribeInstanceOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(client_models.InstanceInfo)
|
||||
o.Payload = new(models.InstanceInfo)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
@@ -100,7 +87,7 @@ Internal Server Error
|
||||
type DescribeInstanceDefault struct {
|
||||
_statusCode int
|
||||
|
||||
Payload *client_models.Error
|
||||
Payload *models.Error
|
||||
}
|
||||
|
||||
// Code gets the status code for the describe instance default response
|
||||
@@ -114,7 +101,7 @@ func (o *DescribeInstanceDefault) Error() string {
|
||||
|
||||
func (o *DescribeInstanceDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(client_models.Error)
|
||||
o.Payload = new(models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
@@ -0,0 +1,113 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package operations
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/runtime"
|
||||
cr "github.com/go-openapi/runtime/client"
|
||||
|
||||
strfmt "github.com/go-openapi/strfmt"
|
||||
)
|
||||
|
||||
// NewGetMachineConfigurationParams creates a new GetMachineConfigurationParams object
|
||||
// with the default values initialized.
|
||||
func NewGetMachineConfigurationParams() *GetMachineConfigurationParams {
|
||||
|
||||
return &GetMachineConfigurationParams{
|
||||
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetMachineConfigurationParamsWithTimeout creates a new GetMachineConfigurationParams object
|
||||
// with the default values initialized, and the ability to set a timeout on a request
|
||||
func NewGetMachineConfigurationParamsWithTimeout(timeout time.Duration) *GetMachineConfigurationParams {
|
||||
|
||||
return &GetMachineConfigurationParams{
|
||||
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetMachineConfigurationParamsWithContext creates a new GetMachineConfigurationParams object
|
||||
// with the default values initialized, and the ability to set a context for a request
|
||||
func NewGetMachineConfigurationParamsWithContext(ctx context.Context) *GetMachineConfigurationParams {
|
||||
|
||||
return &GetMachineConfigurationParams{
|
||||
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetMachineConfigurationParamsWithHTTPClient creates a new GetMachineConfigurationParams object
|
||||
// with the default values initialized, and the ability to set a custom HTTPClient for a request
|
||||
func NewGetMachineConfigurationParamsWithHTTPClient(client *http.Client) *GetMachineConfigurationParams {
|
||||
|
||||
return &GetMachineConfigurationParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*GetMachineConfigurationParams contains all the parameters to send to the API endpoint
|
||||
for the get machine configuration operation typically these are written to a http.Request
|
||||
*/
|
||||
type GetMachineConfigurationParams struct {
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the get machine configuration params
|
||||
func (o *GetMachineConfigurationParams) WithTimeout(timeout time.Duration) *GetMachineConfigurationParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the get machine configuration params
|
||||
func (o *GetMachineConfigurationParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the get machine configuration params
|
||||
func (o *GetMachineConfigurationParams) WithContext(ctx context.Context) *GetMachineConfigurationParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the get machine configuration params
|
||||
func (o *GetMachineConfigurationParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the get machine configuration params
|
||||
func (o *GetMachineConfigurationParams) WithHTTPClient(client *http.Client) *GetMachineConfigurationParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the get machine configuration params
|
||||
func (o *GetMachineConfigurationParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
func (o *GetMachineConfigurationParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||
|
||||
if err := r.SetTimeout(o.timeout); err != nil {
|
||||
return err
|
||||
}
|
||||
var res []error
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
@@ -0,0 +1,112 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package operations
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
|
||||
"github.com/go-openapi/runtime"
|
||||
|
||||
strfmt "github.com/go-openapi/strfmt"
|
||||
|
||||
models "github.com/kata-containers/runtime/virtcontainers/pkg/firecracker/client/models"
|
||||
)
|
||||
|
||||
// GetMachineConfigurationReader is a Reader for the GetMachineConfiguration structure.
|
||||
type GetMachineConfigurationReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *GetMachineConfigurationReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
|
||||
case 200:
|
||||
result := NewGetMachineConfigurationOK()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return result, nil
|
||||
|
||||
default:
|
||||
result := NewGetMachineConfigurationDefault(response.Code())
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if response.Code()/100 == 2 {
|
||||
return result, nil
|
||||
}
|
||||
return nil, result
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetMachineConfigurationOK creates a GetMachineConfigurationOK with default headers values
|
||||
func NewGetMachineConfigurationOK() *GetMachineConfigurationOK {
|
||||
return &GetMachineConfigurationOK{}
|
||||
}
|
||||
|
||||
/*GetMachineConfigurationOK handles this case with default header values.
|
||||
|
||||
OK
|
||||
*/
|
||||
type GetMachineConfigurationOK struct {
|
||||
Payload *models.MachineConfiguration
|
||||
}
|
||||
|
||||
func (o *GetMachineConfigurationOK) Error() string {
|
||||
return fmt.Sprintf("[GET /machine-config][%d] getMachineConfigurationOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetMachineConfigurationOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(models.MachineConfiguration)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewGetMachineConfigurationDefault creates a GetMachineConfigurationDefault with default headers values
|
||||
func NewGetMachineConfigurationDefault(code int) *GetMachineConfigurationDefault {
|
||||
return &GetMachineConfigurationDefault{
|
||||
_statusCode: code,
|
||||
}
|
||||
}
|
||||
|
||||
/*GetMachineConfigurationDefault handles this case with default header values.
|
||||
|
||||
Internal server error
|
||||
*/
|
||||
type GetMachineConfigurationDefault struct {
|
||||
_statusCode int
|
||||
|
||||
Payload *models.Error
|
||||
}
|
||||
|
||||
// Code gets the status code for the get machine configuration default response
|
||||
func (o *GetMachineConfigurationDefault) Code() int {
|
||||
return o._statusCode
|
||||
}
|
||||
|
||||
func (o *GetMachineConfigurationDefault) Error() string {
|
||||
return fmt.Sprintf("[GET /machine-config][%d] getMachineConfiguration default %+v", o._statusCode, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetMachineConfigurationDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
@@ -1,29 +1,15 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License"). You may
|
||||
// not use this file except in compliance with the License. A copy of the
|
||||
// License is located at
|
||||
//
|
||||
// http://aws.amazon.com/apache2.0/
|
||||
//
|
||||
// or in the "license" file accompanying this file. This file is distributed
|
||||
// on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
|
||||
// express or implied. See the License for the specific language governing
|
||||
// permissions and limitations under the License.
|
||||
|
||||
package operations
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"golang.org/x/net/context"
|
||||
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/runtime"
|
||||
cr "github.com/go-openapi/runtime/client"
|
||||
@@ -1,18 +1,5 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License"). You may
|
||||
// not use this file except in compliance with the License. A copy of the
|
||||
// License is located at
|
||||
//
|
||||
// http://aws.amazon.com/apache2.0/
|
||||
//
|
||||
// or in the "license" file accompanying this file. This file is distributed
|
||||
// on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
|
||||
// express or implied. See the License for the specific language governing
|
||||
// permissions and limitations under the License.
|
||||
|
||||
package operations
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
@@ -26,7 +13,7 @@ import (
|
||||
|
||||
strfmt "github.com/go-openapi/strfmt"
|
||||
|
||||
client_models "github.com/firecracker-microvm/firecracker-go-sdk/client/models"
|
||||
models "github.com/kata-containers/runtime/virtcontainers/pkg/firecracker/client/models"
|
||||
)
|
||||
|
||||
// GetMmdsReader is a Reader for the GetMmds structure.
|
||||
@@ -101,7 +88,7 @@ func NewGetMmdsBadRequest() *GetMmdsBadRequest {
|
||||
Cannot get the MMDS data store due to bad input.
|
||||
*/
|
||||
type GetMmdsBadRequest struct {
|
||||
Payload *client_models.Error
|
||||
Payload *models.Error
|
||||
}
|
||||
|
||||
func (o *GetMmdsBadRequest) Error() string {
|
||||
@@ -110,7 +97,7 @@ func (o *GetMmdsBadRequest) Error() string {
|
||||
|
||||
func (o *GetMmdsBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(client_models.Error)
|
||||
o.Payload = new(models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
@@ -134,7 +121,7 @@ Internal server error
|
||||
type GetMmdsDefault struct {
|
||||
_statusCode int
|
||||
|
||||
Payload *client_models.Error
|
||||
Payload *models.Error
|
||||
}
|
||||
|
||||
// Code gets the status code for the get mmds default response
|
||||
@@ -148,7 +135,7 @@ func (o *GetMmdsDefault) Error() string {
|
||||
|
||||
func (o *GetMmdsDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(client_models.Error)
|
||||
o.Payload = new(models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
@@ -1,18 +1,5 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License"). You may
|
||||
// not use this file except in compliance with the License. A copy of the
|
||||
// License is located at
|
||||
//
|
||||
// http://aws.amazon.com/apache2.0/
|
||||
//
|
||||
// or in the "license" file accompanying this file. This file is distributed
|
||||
// on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
|
||||
// express or implied. See the License for the specific language governing
|
||||
// permissions and limitations under the License.
|
||||
|
||||
package operations
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
@@ -37,36 +24,6 @@ type Client struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
/*
|
||||
GetMachineConfig gets the machine configuration of the VM
|
||||
|
||||
Gets the machine configuration of the VM. When called before the PUT operation, it will return the default values for the vCPU count (=1), memory size (=128 MiB). By default Hyperthreading is disabled and there is no CPU Template.
|
||||
*/
|
||||
func (a *Client) GetMachineConfig(params *GetMachineConfigParams) (*GetMachineConfigOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewGetMachineConfigParams()
|
||||
}
|
||||
|
||||
result, err := a.transport.Submit(&runtime.ClientOperation{
|
||||
ID: "GetMachineConfig",
|
||||
Method: "GET",
|
||||
PathPattern: "/machine-config",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &GetMachineConfigReader{formats: a.formats},
|
||||
Context: params.Context,
|
||||
Client: params.HTTPClient,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return result.(*GetMachineConfigOK), nil
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
GetMmds gets the m m d s data store
|
||||
*/
|
||||
@@ -207,6 +164,36 @@ func (a *Client) DescribeInstance(params *DescribeInstanceParams) (*DescribeInst
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
GetMachineConfiguration gets the machine configuration of the VM
|
||||
|
||||
Gets the machine configuration of the VM. When called before the PUT operation, it will return the default values for the vCPU count (=1), memory size (=128 MiB). By default Hyperthreading is disabled and there is no CPU Template.
|
||||
*/
|
||||
func (a *Client) GetMachineConfiguration(params *GetMachineConfigurationParams) (*GetMachineConfigurationOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewGetMachineConfigurationParams()
|
||||
}
|
||||
|
||||
result, err := a.transport.Submit(&runtime.ClientOperation{
|
||||
ID: "getMachineConfiguration",
|
||||
Method: "GET",
|
||||
PathPattern: "/machine-config",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &GetMachineConfigurationReader{formats: a.formats},
|
||||
Context: params.Context,
|
||||
Client: params.HTTPClient,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return result.(*GetMachineConfigurationOK), nil
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
PatchGuestDriveByID updates the properties of a drive
|
||||
|
||||
@@ -237,6 +224,66 @@ func (a *Client) PatchGuestDriveByID(params *PatchGuestDriveByIDParams) (*PatchG
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
PatchGuestNetworkInterfaceByID updates the rate limiters applied to a network interface
|
||||
|
||||
Updates the rate limiters applied to a network interface.
|
||||
*/
|
||||
func (a *Client) PatchGuestNetworkInterfaceByID(params *PatchGuestNetworkInterfaceByIDParams) (*PatchGuestNetworkInterfaceByIDNoContent, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewPatchGuestNetworkInterfaceByIDParams()
|
||||
}
|
||||
|
||||
result, err := a.transport.Submit(&runtime.ClientOperation{
|
||||
ID: "patchGuestNetworkInterfaceByID",
|
||||
Method: "PATCH",
|
||||
PathPattern: "/network-interfaces/{iface_id}",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &PatchGuestNetworkInterfaceByIDReader{formats: a.formats},
|
||||
Context: params.Context,
|
||||
Client: params.HTTPClient,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return result.(*PatchGuestNetworkInterfaceByIDNoContent), nil
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
PatchMachineConfiguration partiallies updates the machine configuration of the VM
|
||||
|
||||
Partially updates the Virtual Machine Configuration with the specified input. If any of the parameters has an incorrect value, the whole update fails.
|
||||
*/
|
||||
func (a *Client) PatchMachineConfiguration(params *PatchMachineConfigurationParams) (*PatchMachineConfigurationNoContent, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewPatchMachineConfigurationParams()
|
||||
}
|
||||
|
||||
result, err := a.transport.Submit(&runtime.ClientOperation{
|
||||
ID: "patchMachineConfiguration",
|
||||
Method: "PATCH",
|
||||
PathPattern: "/machine-config",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &PatchMachineConfigurationReader{formats: a.formats},
|
||||
Context: params.Context,
|
||||
Client: params.HTTPClient,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return result.(*PatchMachineConfigurationNoContent), nil
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
PutGuestBootSource creates or updates the boot source
|
||||
|
||||
@@ -300,7 +347,7 @@ func (a *Client) PutGuestDriveByID(params *PutGuestDriveByIDParams) (*PutGuestDr
|
||||
/*
|
||||
PutGuestNetworkInterfaceByID creates a network interface
|
||||
|
||||
Creates new network interface with ID specified by iface_id path parameter. Updating existing interfaces is currently not allowed.
|
||||
Creates new network interface with ID specified by iface_id path parameter.
|
||||
*/
|
||||
func (a *Client) PutGuestNetworkInterfaceByID(params *PutGuestNetworkInterfaceByIDParams) (*PutGuestNetworkInterfaceByIDNoContent, error) {
|
||||
// TODO: Validate the params before sending
|
||||
@@ -1,36 +1,22 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License"). You may
|
||||
// not use this file except in compliance with the License. A copy of the
|
||||
// License is located at
|
||||
//
|
||||
// http://aws.amazon.com/apache2.0/
|
||||
//
|
||||
// or in the "license" file accompanying this file. This file is distributed
|
||||
// on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
|
||||
// express or implied. See the License for the specific language governing
|
||||
// permissions and limitations under the License.
|
||||
|
||||
package operations
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"golang.org/x/net/context"
|
||||
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/runtime"
|
||||
cr "github.com/go-openapi/runtime/client"
|
||||
|
||||
strfmt "github.com/go-openapi/strfmt"
|
||||
|
||||
client_models "github.com/firecracker-microvm/firecracker-go-sdk/client/models"
|
||||
models "github.com/kata-containers/runtime/virtcontainers/pkg/firecracker/client/models"
|
||||
)
|
||||
|
||||
// NewPatchGuestDriveByIDParams creates a new PatchGuestDriveByIDParams object
|
||||
@@ -81,7 +67,7 @@ type PatchGuestDriveByIDParams struct {
|
||||
Guest drive properties
|
||||
|
||||
*/
|
||||
Body *client_models.PartialDrive
|
||||
Body *models.PartialDrive
|
||||
/*DriveID
|
||||
The id of the guest drive
|
||||
|
||||
@@ -127,13 +113,13 @@ func (o *PatchGuestDriveByIDParams) SetHTTPClient(client *http.Client) {
|
||||
}
|
||||
|
||||
// WithBody adds the body to the patch guest drive by ID params
|
||||
func (o *PatchGuestDriveByIDParams) WithBody(body *client_models.PartialDrive) *PatchGuestDriveByIDParams {
|
||||
func (o *PatchGuestDriveByIDParams) WithBody(body *models.PartialDrive) *PatchGuestDriveByIDParams {
|
||||
o.SetBody(body)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetBody adds the body to the patch guest drive by ID params
|
||||
func (o *PatchGuestDriveByIDParams) SetBody(body *client_models.PartialDrive) {
|
||||
func (o *PatchGuestDriveByIDParams) SetBody(body *models.PartialDrive) {
|
||||
o.Body = body
|
||||
}
|
||||
|
||||
@@ -1,18 +1,5 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License"). You may
|
||||
// not use this file except in compliance with the License. A copy of the
|
||||
// License is located at
|
||||
//
|
||||
// http://aws.amazon.com/apache2.0/
|
||||
//
|
||||
// or in the "license" file accompanying this file. This file is distributed
|
||||
// on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
|
||||
// express or implied. See the License for the specific language governing
|
||||
// permissions and limitations under the License.
|
||||
|
||||
package operations
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
@@ -26,7 +13,7 @@ import (
|
||||
|
||||
strfmt "github.com/go-openapi/strfmt"
|
||||
|
||||
client_models "github.com/firecracker-microvm/firecracker-go-sdk/client/models"
|
||||
models "github.com/kata-containers/runtime/virtcontainers/pkg/firecracker/client/models"
|
||||
)
|
||||
|
||||
// PatchGuestDriveByIDReader is a Reader for the PatchGuestDriveByID structure.
|
||||
@@ -95,7 +82,7 @@ func NewPatchGuestDriveByIDBadRequest() *PatchGuestDriveByIDBadRequest {
|
||||
Drive cannot be updated due to bad input
|
||||
*/
|
||||
type PatchGuestDriveByIDBadRequest struct {
|
||||
Payload *client_models.Error
|
||||
Payload *models.Error
|
||||
}
|
||||
|
||||
func (o *PatchGuestDriveByIDBadRequest) Error() string {
|
||||
@@ -104,7 +91,7 @@ func (o *PatchGuestDriveByIDBadRequest) Error() string {
|
||||
|
||||
func (o *PatchGuestDriveByIDBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(client_models.Error)
|
||||
o.Payload = new(models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
@@ -128,7 +115,7 @@ Internal server error.
|
||||
type PatchGuestDriveByIDDefault struct {
|
||||
_statusCode int
|
||||
|
||||
Payload *client_models.Error
|
||||
Payload *models.Error
|
||||
}
|
||||
|
||||
// Code gets the status code for the patch guest drive by ID default response
|
||||
@@ -142,7 +129,7 @@ func (o *PatchGuestDriveByIDDefault) Error() string {
|
||||
|
||||
func (o *PatchGuestDriveByIDDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(client_models.Error)
|
||||
o.Payload = new(models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
@@ -0,0 +1,160 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package operations
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/runtime"
|
||||
cr "github.com/go-openapi/runtime/client"
|
||||
|
||||
strfmt "github.com/go-openapi/strfmt"
|
||||
|
||||
models "github.com/kata-containers/runtime/virtcontainers/pkg/firecracker/client/models"
|
||||
)
|
||||
|
||||
// NewPatchGuestNetworkInterfaceByIDParams creates a new PatchGuestNetworkInterfaceByIDParams object
|
||||
// with the default values initialized.
|
||||
func NewPatchGuestNetworkInterfaceByIDParams() *PatchGuestNetworkInterfaceByIDParams {
|
||||
var ()
|
||||
return &PatchGuestNetworkInterfaceByIDParams{
|
||||
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPatchGuestNetworkInterfaceByIDParamsWithTimeout creates a new PatchGuestNetworkInterfaceByIDParams object
|
||||
// with the default values initialized, and the ability to set a timeout on a request
|
||||
func NewPatchGuestNetworkInterfaceByIDParamsWithTimeout(timeout time.Duration) *PatchGuestNetworkInterfaceByIDParams {
|
||||
var ()
|
||||
return &PatchGuestNetworkInterfaceByIDParams{
|
||||
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPatchGuestNetworkInterfaceByIDParamsWithContext creates a new PatchGuestNetworkInterfaceByIDParams object
|
||||
// with the default values initialized, and the ability to set a context for a request
|
||||
func NewPatchGuestNetworkInterfaceByIDParamsWithContext(ctx context.Context) *PatchGuestNetworkInterfaceByIDParams {
|
||||
var ()
|
||||
return &PatchGuestNetworkInterfaceByIDParams{
|
||||
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPatchGuestNetworkInterfaceByIDParamsWithHTTPClient creates a new PatchGuestNetworkInterfaceByIDParams object
|
||||
// with the default values initialized, and the ability to set a custom HTTPClient for a request
|
||||
func NewPatchGuestNetworkInterfaceByIDParamsWithHTTPClient(client *http.Client) *PatchGuestNetworkInterfaceByIDParams {
|
||||
var ()
|
||||
return &PatchGuestNetworkInterfaceByIDParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*PatchGuestNetworkInterfaceByIDParams contains all the parameters to send to the API endpoint
|
||||
for the patch guest network interface by ID operation typically these are written to a http.Request
|
||||
*/
|
||||
type PatchGuestNetworkInterfaceByIDParams struct {
|
||||
|
||||
/*Body
|
||||
A subset of the guest network interface properties
|
||||
|
||||
*/
|
||||
Body *models.PartialNetworkInterface
|
||||
/*IfaceID
|
||||
The id of the guest network interface
|
||||
|
||||
*/
|
||||
IfaceID string
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the patch guest network interface by ID params
|
||||
func (o *PatchGuestNetworkInterfaceByIDParams) WithTimeout(timeout time.Duration) *PatchGuestNetworkInterfaceByIDParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the patch guest network interface by ID params
|
||||
func (o *PatchGuestNetworkInterfaceByIDParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the patch guest network interface by ID params
|
||||
func (o *PatchGuestNetworkInterfaceByIDParams) WithContext(ctx context.Context) *PatchGuestNetworkInterfaceByIDParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the patch guest network interface by ID params
|
||||
func (o *PatchGuestNetworkInterfaceByIDParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the patch guest network interface by ID params
|
||||
func (o *PatchGuestNetworkInterfaceByIDParams) WithHTTPClient(client *http.Client) *PatchGuestNetworkInterfaceByIDParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the patch guest network interface by ID params
|
||||
func (o *PatchGuestNetworkInterfaceByIDParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithBody adds the body to the patch guest network interface by ID params
|
||||
func (o *PatchGuestNetworkInterfaceByIDParams) WithBody(body *models.PartialNetworkInterface) *PatchGuestNetworkInterfaceByIDParams {
|
||||
o.SetBody(body)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetBody adds the body to the patch guest network interface by ID params
|
||||
func (o *PatchGuestNetworkInterfaceByIDParams) SetBody(body *models.PartialNetworkInterface) {
|
||||
o.Body = body
|
||||
}
|
||||
|
||||
// WithIfaceID adds the ifaceID to the patch guest network interface by ID params
|
||||
func (o *PatchGuestNetworkInterfaceByIDParams) WithIfaceID(ifaceID string) *PatchGuestNetworkInterfaceByIDParams {
|
||||
o.SetIfaceID(ifaceID)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetIfaceID adds the ifaceId to the patch guest network interface by ID params
|
||||
func (o *PatchGuestNetworkInterfaceByIDParams) SetIfaceID(ifaceID string) {
|
||||
o.IfaceID = ifaceID
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
func (o *PatchGuestNetworkInterfaceByIDParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||
|
||||
if err := r.SetTimeout(o.timeout); err != nil {
|
||||
return err
|
||||
}
|
||||
var res []error
|
||||
|
||||
if o.Body != nil {
|
||||
if err := r.SetBodyParam(o.Body); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
// path param iface_id
|
||||
if err := r.SetPathParam("iface_id", o.IfaceID); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
@@ -0,0 +1,140 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package operations
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
|
||||
"github.com/go-openapi/runtime"
|
||||
|
||||
strfmt "github.com/go-openapi/strfmt"
|
||||
|
||||
models "github.com/kata-containers/runtime/virtcontainers/pkg/firecracker/client/models"
|
||||
)
|
||||
|
||||
// PatchGuestNetworkInterfaceByIDReader is a Reader for the PatchGuestNetworkInterfaceByID structure.
|
||||
type PatchGuestNetworkInterfaceByIDReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *PatchGuestNetworkInterfaceByIDReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
|
||||
case 204:
|
||||
result := NewPatchGuestNetworkInterfaceByIDNoContent()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return result, nil
|
||||
|
||||
case 400:
|
||||
result := NewPatchGuestNetworkInterfaceByIDBadRequest()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
|
||||
default:
|
||||
result := NewPatchGuestNetworkInterfaceByIDDefault(response.Code())
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if response.Code()/100 == 2 {
|
||||
return result, nil
|
||||
}
|
||||
return nil, result
|
||||
}
|
||||
}
|
||||
|
||||
// NewPatchGuestNetworkInterfaceByIDNoContent creates a PatchGuestNetworkInterfaceByIDNoContent with default headers values
|
||||
func NewPatchGuestNetworkInterfaceByIDNoContent() *PatchGuestNetworkInterfaceByIDNoContent {
|
||||
return &PatchGuestNetworkInterfaceByIDNoContent{}
|
||||
}
|
||||
|
||||
/*PatchGuestNetworkInterfaceByIDNoContent handles this case with default header values.
|
||||
|
||||
Network interface updated
|
||||
*/
|
||||
type PatchGuestNetworkInterfaceByIDNoContent struct {
|
||||
}
|
||||
|
||||
func (o *PatchGuestNetworkInterfaceByIDNoContent) Error() string {
|
||||
return fmt.Sprintf("[PATCH /network-interfaces/{iface_id}][%d] patchGuestNetworkInterfaceByIdNoContent ", 204)
|
||||
}
|
||||
|
||||
func (o *PatchGuestNetworkInterfaceByIDNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewPatchGuestNetworkInterfaceByIDBadRequest creates a PatchGuestNetworkInterfaceByIDBadRequest with default headers values
|
||||
func NewPatchGuestNetworkInterfaceByIDBadRequest() *PatchGuestNetworkInterfaceByIDBadRequest {
|
||||
return &PatchGuestNetworkInterfaceByIDBadRequest{}
|
||||
}
|
||||
|
||||
/*PatchGuestNetworkInterfaceByIDBadRequest handles this case with default header values.
|
||||
|
||||
Network interface cannot be updated due to bad input
|
||||
*/
|
||||
type PatchGuestNetworkInterfaceByIDBadRequest struct {
|
||||
Payload *models.Error
|
||||
}
|
||||
|
||||
func (o *PatchGuestNetworkInterfaceByIDBadRequest) Error() string {
|
||||
return fmt.Sprintf("[PATCH /network-interfaces/{iface_id}][%d] patchGuestNetworkInterfaceByIdBadRequest %+v", 400, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PatchGuestNetworkInterfaceByIDBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewPatchGuestNetworkInterfaceByIDDefault creates a PatchGuestNetworkInterfaceByIDDefault with default headers values
|
||||
func NewPatchGuestNetworkInterfaceByIDDefault(code int) *PatchGuestNetworkInterfaceByIDDefault {
|
||||
return &PatchGuestNetworkInterfaceByIDDefault{
|
||||
_statusCode: code,
|
||||
}
|
||||
}
|
||||
|
||||
/*PatchGuestNetworkInterfaceByIDDefault handles this case with default header values.
|
||||
|
||||
Internal server error
|
||||
*/
|
||||
type PatchGuestNetworkInterfaceByIDDefault struct {
|
||||
_statusCode int
|
||||
|
||||
Payload *models.Error
|
||||
}
|
||||
|
||||
// Code gets the status code for the patch guest network interface by ID default response
|
||||
func (o *PatchGuestNetworkInterfaceByIDDefault) Code() int {
|
||||
return o._statusCode
|
||||
}
|
||||
|
||||
func (o *PatchGuestNetworkInterfaceByIDDefault) Error() string {
|
||||
return fmt.Sprintf("[PATCH /network-interfaces/{iface_id}][%d] patchGuestNetworkInterfaceByID default %+v", o._statusCode, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PatchGuestNetworkInterfaceByIDDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
@@ -0,0 +1,139 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package operations
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/runtime"
|
||||
cr "github.com/go-openapi/runtime/client"
|
||||
|
||||
strfmt "github.com/go-openapi/strfmt"
|
||||
|
||||
models "github.com/kata-containers/runtime/virtcontainers/pkg/firecracker/client/models"
|
||||
)
|
||||
|
||||
// NewPatchMachineConfigurationParams creates a new PatchMachineConfigurationParams object
|
||||
// with the default values initialized.
|
||||
func NewPatchMachineConfigurationParams() *PatchMachineConfigurationParams {
|
||||
var ()
|
||||
return &PatchMachineConfigurationParams{
|
||||
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPatchMachineConfigurationParamsWithTimeout creates a new PatchMachineConfigurationParams object
|
||||
// with the default values initialized, and the ability to set a timeout on a request
|
||||
func NewPatchMachineConfigurationParamsWithTimeout(timeout time.Duration) *PatchMachineConfigurationParams {
|
||||
var ()
|
||||
return &PatchMachineConfigurationParams{
|
||||
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPatchMachineConfigurationParamsWithContext creates a new PatchMachineConfigurationParams object
|
||||
// with the default values initialized, and the ability to set a context for a request
|
||||
func NewPatchMachineConfigurationParamsWithContext(ctx context.Context) *PatchMachineConfigurationParams {
|
||||
var ()
|
||||
return &PatchMachineConfigurationParams{
|
||||
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPatchMachineConfigurationParamsWithHTTPClient creates a new PatchMachineConfigurationParams object
|
||||
// with the default values initialized, and the ability to set a custom HTTPClient for a request
|
||||
func NewPatchMachineConfigurationParamsWithHTTPClient(client *http.Client) *PatchMachineConfigurationParams {
|
||||
var ()
|
||||
return &PatchMachineConfigurationParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*PatchMachineConfigurationParams contains all the parameters to send to the API endpoint
|
||||
for the patch machine configuration operation typically these are written to a http.Request
|
||||
*/
|
||||
type PatchMachineConfigurationParams struct {
|
||||
|
||||
/*Body
|
||||
A subset of Machine Configuration Parameters
|
||||
|
||||
*/
|
||||
Body *models.MachineConfiguration
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the patch machine configuration params
|
||||
func (o *PatchMachineConfigurationParams) WithTimeout(timeout time.Duration) *PatchMachineConfigurationParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the patch machine configuration params
|
||||
func (o *PatchMachineConfigurationParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the patch machine configuration params
|
||||
func (o *PatchMachineConfigurationParams) WithContext(ctx context.Context) *PatchMachineConfigurationParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the patch machine configuration params
|
||||
func (o *PatchMachineConfigurationParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the patch machine configuration params
|
||||
func (o *PatchMachineConfigurationParams) WithHTTPClient(client *http.Client) *PatchMachineConfigurationParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the patch machine configuration params
|
||||
func (o *PatchMachineConfigurationParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithBody adds the body to the patch machine configuration params
|
||||
func (o *PatchMachineConfigurationParams) WithBody(body *models.MachineConfiguration) *PatchMachineConfigurationParams {
|
||||
o.SetBody(body)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetBody adds the body to the patch machine configuration params
|
||||
func (o *PatchMachineConfigurationParams) SetBody(body *models.MachineConfiguration) {
|
||||
o.Body = body
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
func (o *PatchMachineConfigurationParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||
|
||||
if err := r.SetTimeout(o.timeout); err != nil {
|
||||
return err
|
||||
}
|
||||
var res []error
|
||||
|
||||
if o.Body != nil {
|
||||
if err := r.SetBodyParam(o.Body); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
@@ -0,0 +1,140 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package operations
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
|
||||
"github.com/go-openapi/runtime"
|
||||
|
||||
strfmt "github.com/go-openapi/strfmt"
|
||||
|
||||
models "github.com/kata-containers/runtime/virtcontainers/pkg/firecracker/client/models"
|
||||
)
|
||||
|
||||
// PatchMachineConfigurationReader is a Reader for the PatchMachineConfiguration structure.
|
||||
type PatchMachineConfigurationReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *PatchMachineConfigurationReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
|
||||
case 204:
|
||||
result := NewPatchMachineConfigurationNoContent()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return result, nil
|
||||
|
||||
case 400:
|
||||
result := NewPatchMachineConfigurationBadRequest()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
|
||||
default:
|
||||
result := NewPatchMachineConfigurationDefault(response.Code())
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if response.Code()/100 == 2 {
|
||||
return result, nil
|
||||
}
|
||||
return nil, result
|
||||
}
|
||||
}
|
||||
|
||||
// NewPatchMachineConfigurationNoContent creates a PatchMachineConfigurationNoContent with default headers values
|
||||
func NewPatchMachineConfigurationNoContent() *PatchMachineConfigurationNoContent {
|
||||
return &PatchMachineConfigurationNoContent{}
|
||||
}
|
||||
|
||||
/*PatchMachineConfigurationNoContent handles this case with default header values.
|
||||
|
||||
Machine Configuration created/updated
|
||||
*/
|
||||
type PatchMachineConfigurationNoContent struct {
|
||||
}
|
||||
|
||||
func (o *PatchMachineConfigurationNoContent) Error() string {
|
||||
return fmt.Sprintf("[PATCH /machine-config][%d] patchMachineConfigurationNoContent ", 204)
|
||||
}
|
||||
|
||||
func (o *PatchMachineConfigurationNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewPatchMachineConfigurationBadRequest creates a PatchMachineConfigurationBadRequest with default headers values
|
||||
func NewPatchMachineConfigurationBadRequest() *PatchMachineConfigurationBadRequest {
|
||||
return &PatchMachineConfigurationBadRequest{}
|
||||
}
|
||||
|
||||
/*PatchMachineConfigurationBadRequest handles this case with default header values.
|
||||
|
||||
Machine Configuration cannot be updated due to bad input
|
||||
*/
|
||||
type PatchMachineConfigurationBadRequest struct {
|
||||
Payload *models.Error
|
||||
}
|
||||
|
||||
func (o *PatchMachineConfigurationBadRequest) Error() string {
|
||||
return fmt.Sprintf("[PATCH /machine-config][%d] patchMachineConfigurationBadRequest %+v", 400, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PatchMachineConfigurationBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewPatchMachineConfigurationDefault creates a PatchMachineConfigurationDefault with default headers values
|
||||
func NewPatchMachineConfigurationDefault(code int) *PatchMachineConfigurationDefault {
|
||||
return &PatchMachineConfigurationDefault{
|
||||
_statusCode: code,
|
||||
}
|
||||
}
|
||||
|
||||
/*PatchMachineConfigurationDefault handles this case with default header values.
|
||||
|
||||
Internal server error
|
||||
*/
|
||||
type PatchMachineConfigurationDefault struct {
|
||||
_statusCode int
|
||||
|
||||
Payload *models.Error
|
||||
}
|
||||
|
||||
// Code gets the status code for the patch machine configuration default response
|
||||
func (o *PatchMachineConfigurationDefault) Code() int {
|
||||
return o._statusCode
|
||||
}
|
||||
|
||||
func (o *PatchMachineConfigurationDefault) Error() string {
|
||||
return fmt.Sprintf("[PATCH /machine-config][%d] patchMachineConfiguration default %+v", o._statusCode, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PatchMachineConfigurationDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
@@ -1,29 +1,15 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License"). You may
|
||||
// not use this file except in compliance with the License. A copy of the
|
||||
// License is located at
|
||||
//
|
||||
// http://aws.amazon.com/apache2.0/
|
||||
//
|
||||
// or in the "license" file accompanying this file. This file is distributed
|
||||
// on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
|
||||
// express or implied. See the License for the specific language governing
|
||||
// permissions and limitations under the License.
|
||||
|
||||
package operations
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"golang.org/x/net/context"
|
||||
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/runtime"
|
||||
cr "github.com/go-openapi/runtime/client"
|
||||
@@ -1,18 +1,5 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License"). You may
|
||||
// not use this file except in compliance with the License. A copy of the
|
||||
// License is located at
|
||||
//
|
||||
// http://aws.amazon.com/apache2.0/
|
||||
//
|
||||
// or in the "license" file accompanying this file. This file is distributed
|
||||
// on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
|
||||
// express or implied. See the License for the specific language governing
|
||||
// permissions and limitations under the License.
|
||||
|
||||
package operations
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
@@ -26,7 +13,7 @@ import (
|
||||
|
||||
strfmt "github.com/go-openapi/strfmt"
|
||||
|
||||
client_models "github.com/firecracker-microvm/firecracker-go-sdk/client/models"
|
||||
models "github.com/kata-containers/runtime/virtcontainers/pkg/firecracker/client/models"
|
||||
)
|
||||
|
||||
// PatchMmdsReader is a Reader for the PatchMmds structure.
|
||||
@@ -95,7 +82,7 @@ func NewPatchMmdsBadRequest() *PatchMmdsBadRequest {
|
||||
MMDS data store cannot be updated due to bad input.
|
||||
*/
|
||||
type PatchMmdsBadRequest struct {
|
||||
Payload *client_models.Error
|
||||
Payload *models.Error
|
||||
}
|
||||
|
||||
func (o *PatchMmdsBadRequest) Error() string {
|
||||
@@ -104,7 +91,7 @@ func (o *PatchMmdsBadRequest) Error() string {
|
||||
|
||||
func (o *PatchMmdsBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(client_models.Error)
|
||||
o.Payload = new(models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
@@ -128,7 +115,7 @@ Internal server error
|
||||
type PatchMmdsDefault struct {
|
||||
_statusCode int
|
||||
|
||||
Payload *client_models.Error
|
||||
Payload *models.Error
|
||||
}
|
||||
|
||||
// Code gets the status code for the patch mmds default response
|
||||
@@ -142,7 +129,7 @@ func (o *PatchMmdsDefault) Error() string {
|
||||
|
||||
func (o *PatchMmdsDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(client_models.Error)
|
||||
o.Payload = new(models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
@@ -1,36 +1,22 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License"). You may
|
||||
// not use this file except in compliance with the License. A copy of the
|
||||
// License is located at
|
||||
//
|
||||
// http://aws.amazon.com/apache2.0/
|
||||
//
|
||||
// or in the "license" file accompanying this file. This file is distributed
|
||||
// on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
|
||||
// express or implied. See the License for the specific language governing
|
||||
// permissions and limitations under the License.
|
||||
|
||||
package operations
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"golang.org/x/net/context"
|
||||
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/runtime"
|
||||
cr "github.com/go-openapi/runtime/client"
|
||||
|
||||
strfmt "github.com/go-openapi/strfmt"
|
||||
|
||||
client_models "github.com/firecracker-microvm/firecracker-go-sdk/client/models"
|
||||
models "github.com/kata-containers/runtime/virtcontainers/pkg/firecracker/client/models"
|
||||
)
|
||||
|
||||
// NewPutGuestBootSourceParams creates a new PutGuestBootSourceParams object
|
||||
@@ -81,7 +67,7 @@ type PutGuestBootSourceParams struct {
|
||||
Guest boot source properties
|
||||
|
||||
*/
|
||||
Body *client_models.BootSource
|
||||
Body *models.BootSource
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
@@ -122,13 +108,13 @@ func (o *PutGuestBootSourceParams) SetHTTPClient(client *http.Client) {
|
||||
}
|
||||
|
||||
// WithBody adds the body to the put guest boot source params
|
||||
func (o *PutGuestBootSourceParams) WithBody(body *client_models.BootSource) *PutGuestBootSourceParams {
|
||||
func (o *PutGuestBootSourceParams) WithBody(body *models.BootSource) *PutGuestBootSourceParams {
|
||||
o.SetBody(body)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetBody adds the body to the put guest boot source params
|
||||
func (o *PutGuestBootSourceParams) SetBody(body *client_models.BootSource) {
|
||||
func (o *PutGuestBootSourceParams) SetBody(body *models.BootSource) {
|
||||
o.Body = body
|
||||
}
|
||||
|
||||
@@ -1,18 +1,5 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License"). You may
|
||||
// not use this file except in compliance with the License. A copy of the
|
||||
// License is located at
|
||||
//
|
||||
// http://aws.amazon.com/apache2.0/
|
||||
//
|
||||
// or in the "license" file accompanying this file. This file is distributed
|
||||
// on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
|
||||
// express or implied. See the License for the specific language governing
|
||||
// permissions and limitations under the License.
|
||||
|
||||
package operations
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
@@ -26,7 +13,7 @@ import (
|
||||
|
||||
strfmt "github.com/go-openapi/strfmt"
|
||||
|
||||
client_models "github.com/firecracker-microvm/firecracker-go-sdk/client/models"
|
||||
models "github.com/kata-containers/runtime/virtcontainers/pkg/firecracker/client/models"
|
||||
)
|
||||
|
||||
// PutGuestBootSourceReader is a Reader for the PutGuestBootSource structure.
|
||||
@@ -95,7 +82,7 @@ func NewPutGuestBootSourceBadRequest() *PutGuestBootSourceBadRequest {
|
||||
Boot source cannot be created due to bad input
|
||||
*/
|
||||
type PutGuestBootSourceBadRequest struct {
|
||||
Payload *client_models.Error
|
||||
Payload *models.Error
|
||||
}
|
||||
|
||||
func (o *PutGuestBootSourceBadRequest) Error() string {
|
||||
@@ -104,7 +91,7 @@ func (o *PutGuestBootSourceBadRequest) Error() string {
|
||||
|
||||
func (o *PutGuestBootSourceBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(client_models.Error)
|
||||
o.Payload = new(models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
@@ -128,7 +115,7 @@ Internal server error
|
||||
type PutGuestBootSourceDefault struct {
|
||||
_statusCode int
|
||||
|
||||
Payload *client_models.Error
|
||||
Payload *models.Error
|
||||
}
|
||||
|
||||
// Code gets the status code for the put guest boot source default response
|
||||
@@ -142,7 +129,7 @@ func (o *PutGuestBootSourceDefault) Error() string {
|
||||
|
||||
func (o *PutGuestBootSourceDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(client_models.Error)
|
||||
o.Payload = new(models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
@@ -1,36 +1,22 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License"). You may
|
||||
// not use this file except in compliance with the License. A copy of the
|
||||
// License is located at
|
||||
//
|
||||
// http://aws.amazon.com/apache2.0/
|
||||
//
|
||||
// or in the "license" file accompanying this file. This file is distributed
|
||||
// on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
|
||||
// express or implied. See the License for the specific language governing
|
||||
// permissions and limitations under the License.
|
||||
|
||||
package operations
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"golang.org/x/net/context"
|
||||
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/runtime"
|
||||
cr "github.com/go-openapi/runtime/client"
|
||||
|
||||
strfmt "github.com/go-openapi/strfmt"
|
||||
|
||||
client_models "github.com/firecracker-microvm/firecracker-go-sdk/client/models"
|
||||
models "github.com/kata-containers/runtime/virtcontainers/pkg/firecracker/client/models"
|
||||
)
|
||||
|
||||
// NewPutGuestDriveByIDParams creates a new PutGuestDriveByIDParams object
|
||||
@@ -81,7 +67,7 @@ type PutGuestDriveByIDParams struct {
|
||||
Guest drive properties
|
||||
|
||||
*/
|
||||
Body *client_models.Drive
|
||||
Body *models.Drive
|
||||
/*DriveID
|
||||
The id of the guest drive
|
||||
|
||||
@@ -127,13 +113,13 @@ func (o *PutGuestDriveByIDParams) SetHTTPClient(client *http.Client) {
|
||||
}
|
||||
|
||||
// WithBody adds the body to the put guest drive by ID params
|
||||
func (o *PutGuestDriveByIDParams) WithBody(body *client_models.Drive) *PutGuestDriveByIDParams {
|
||||
func (o *PutGuestDriveByIDParams) WithBody(body *models.Drive) *PutGuestDriveByIDParams {
|
||||
o.SetBody(body)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetBody adds the body to the put guest drive by ID params
|
||||
func (o *PutGuestDriveByIDParams) SetBody(body *client_models.Drive) {
|
||||
func (o *PutGuestDriveByIDParams) SetBody(body *models.Drive) {
|
||||
o.Body = body
|
||||
}
|
||||
|
||||
@@ -1,18 +1,5 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License"). You may
|
||||
// not use this file except in compliance with the License. A copy of the
|
||||
// License is located at
|
||||
//
|
||||
// http://aws.amazon.com/apache2.0/
|
||||
//
|
||||
// or in the "license" file accompanying this file. This file is distributed
|
||||
// on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
|
||||
// express or implied. See the License for the specific language governing
|
||||
// permissions and limitations under the License.
|
||||
|
||||
package operations
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
@@ -26,7 +13,7 @@ import (
|
||||
|
||||
strfmt "github.com/go-openapi/strfmt"
|
||||
|
||||
client_models "github.com/firecracker-microvm/firecracker-go-sdk/client/models"
|
||||
models "github.com/kata-containers/runtime/virtcontainers/pkg/firecracker/client/models"
|
||||
)
|
||||
|
||||
// PutGuestDriveByIDReader is a Reader for the PutGuestDriveByID structure.
|
||||
@@ -95,7 +82,7 @@ func NewPutGuestDriveByIDBadRequest() *PutGuestDriveByIDBadRequest {
|
||||
Drive cannot be created/updated due to bad input
|
||||
*/
|
||||
type PutGuestDriveByIDBadRequest struct {
|
||||
Payload *client_models.Error
|
||||
Payload *models.Error
|
||||
}
|
||||
|
||||
func (o *PutGuestDriveByIDBadRequest) Error() string {
|
||||
@@ -104,7 +91,7 @@ func (o *PutGuestDriveByIDBadRequest) Error() string {
|
||||
|
||||
func (o *PutGuestDriveByIDBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(client_models.Error)
|
||||
o.Payload = new(models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
@@ -128,7 +115,7 @@ Internal server error.
|
||||
type PutGuestDriveByIDDefault struct {
|
||||
_statusCode int
|
||||
|
||||
Payload *client_models.Error
|
||||
Payload *models.Error
|
||||
}
|
||||
|
||||
// Code gets the status code for the put guest drive by ID default response
|
||||
@@ -142,7 +129,7 @@ func (o *PutGuestDriveByIDDefault) Error() string {
|
||||
|
||||
func (o *PutGuestDriveByIDDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(client_models.Error)
|
||||
o.Payload = new(models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
@@ -1,36 +1,22 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License"). You may
|
||||
// not use this file except in compliance with the License. A copy of the
|
||||
// License is located at
|
||||
//
|
||||
// http://aws.amazon.com/apache2.0/
|
||||
//
|
||||
// or in the "license" file accompanying this file. This file is distributed
|
||||
// on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
|
||||
// express or implied. See the License for the specific language governing
|
||||
// permissions and limitations under the License.
|
||||
|
||||
package operations
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"golang.org/x/net/context"
|
||||
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/runtime"
|
||||
cr "github.com/go-openapi/runtime/client"
|
||||
|
||||
strfmt "github.com/go-openapi/strfmt"
|
||||
|
||||
client_models "github.com/firecracker-microvm/firecracker-go-sdk/client/models"
|
||||
models "github.com/kata-containers/runtime/virtcontainers/pkg/firecracker/client/models"
|
||||
)
|
||||
|
||||
// NewPutGuestNetworkInterfaceByIDParams creates a new PutGuestNetworkInterfaceByIDParams object
|
||||
@@ -81,7 +67,7 @@ type PutGuestNetworkInterfaceByIDParams struct {
|
||||
Guest network interface properties
|
||||
|
||||
*/
|
||||
Body *client_models.NetworkInterface
|
||||
Body *models.NetworkInterface
|
||||
/*IfaceID
|
||||
The id of the guest network interface
|
||||
|
||||
@@ -127,13 +113,13 @@ func (o *PutGuestNetworkInterfaceByIDParams) SetHTTPClient(client *http.Client)
|
||||
}
|
||||
|
||||
// WithBody adds the body to the put guest network interface by ID params
|
||||
func (o *PutGuestNetworkInterfaceByIDParams) WithBody(body *client_models.NetworkInterface) *PutGuestNetworkInterfaceByIDParams {
|
||||
func (o *PutGuestNetworkInterfaceByIDParams) WithBody(body *models.NetworkInterface) *PutGuestNetworkInterfaceByIDParams {
|
||||
o.SetBody(body)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetBody adds the body to the put guest network interface by ID params
|
||||
func (o *PutGuestNetworkInterfaceByIDParams) SetBody(body *client_models.NetworkInterface) {
|
||||
func (o *PutGuestNetworkInterfaceByIDParams) SetBody(body *models.NetworkInterface) {
|
||||
o.Body = body
|
||||
}
|
||||
|
||||
@@ -1,18 +1,5 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License"). You may
|
||||
// not use this file except in compliance with the License. A copy of the
|
||||
// License is located at
|
||||
//
|
||||
// http://aws.amazon.com/apache2.0/
|
||||
//
|
||||
// or in the "license" file accompanying this file. This file is distributed
|
||||
// on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
|
||||
// express or implied. See the License for the specific language governing
|
||||
// permissions and limitations under the License.
|
||||
|
||||
package operations
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
@@ -26,7 +13,7 @@ import (
|
||||
|
||||
strfmt "github.com/go-openapi/strfmt"
|
||||
|
||||
client_models "github.com/firecracker-microvm/firecracker-go-sdk/client/models"
|
||||
models "github.com/kata-containers/runtime/virtcontainers/pkg/firecracker/client/models"
|
||||
)
|
||||
|
||||
// PutGuestNetworkInterfaceByIDReader is a Reader for the PutGuestNetworkInterfaceByID structure.
|
||||
@@ -95,7 +82,7 @@ func NewPutGuestNetworkInterfaceByIDBadRequest() *PutGuestNetworkInterfaceByIDBa
|
||||
Network interface cannot be created due to bad input
|
||||
*/
|
||||
type PutGuestNetworkInterfaceByIDBadRequest struct {
|
||||
Payload *client_models.Error
|
||||
Payload *models.Error
|
||||
}
|
||||
|
||||
func (o *PutGuestNetworkInterfaceByIDBadRequest) Error() string {
|
||||
@@ -104,7 +91,7 @@ func (o *PutGuestNetworkInterfaceByIDBadRequest) Error() string {
|
||||
|
||||
func (o *PutGuestNetworkInterfaceByIDBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(client_models.Error)
|
||||
o.Payload = new(models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
@@ -128,7 +115,7 @@ Internal server error
|
||||
type PutGuestNetworkInterfaceByIDDefault struct {
|
||||
_statusCode int
|
||||
|
||||
Payload *client_models.Error
|
||||
Payload *models.Error
|
||||
}
|
||||
|
||||
// Code gets the status code for the put guest network interface by ID default response
|
||||
@@ -142,7 +129,7 @@ func (o *PutGuestNetworkInterfaceByIDDefault) Error() string {
|
||||
|
||||
func (o *PutGuestNetworkInterfaceByIDDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(client_models.Error)
|
||||
o.Payload = new(models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
@@ -1,36 +1,22 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License"). You may
|
||||
// not use this file except in compliance with the License. A copy of the
|
||||
// License is located at
|
||||
//
|
||||
// http://aws.amazon.com/apache2.0/
|
||||
//
|
||||
// or in the "license" file accompanying this file. This file is distributed
|
||||
// on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
|
||||
// express or implied. See the License for the specific language governing
|
||||
// permissions and limitations under the License.
|
||||
|
||||
package operations
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"golang.org/x/net/context"
|
||||
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/runtime"
|
||||
cr "github.com/go-openapi/runtime/client"
|
||||
|
||||
strfmt "github.com/go-openapi/strfmt"
|
||||
|
||||
client_models "github.com/firecracker-microvm/firecracker-go-sdk/client/models"
|
||||
models "github.com/kata-containers/runtime/virtcontainers/pkg/firecracker/client/models"
|
||||
)
|
||||
|
||||
// NewPutGuestVsockByIDParams creates a new PutGuestVsockByIDParams object
|
||||
@@ -81,7 +67,7 @@ type PutGuestVsockByIDParams struct {
|
||||
Guest vsock properties
|
||||
|
||||
*/
|
||||
Body *client_models.Vsock
|
||||
Body *models.Vsock
|
||||
/*ID
|
||||
The id of the vsock device
|
||||
|
||||
@@ -127,13 +113,13 @@ func (o *PutGuestVsockByIDParams) SetHTTPClient(client *http.Client) {
|
||||
}
|
||||
|
||||
// WithBody adds the body to the put guest vsock by ID params
|
||||
func (o *PutGuestVsockByIDParams) WithBody(body *client_models.Vsock) *PutGuestVsockByIDParams {
|
||||
func (o *PutGuestVsockByIDParams) WithBody(body *models.Vsock) *PutGuestVsockByIDParams {
|
||||
o.SetBody(body)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetBody adds the body to the put guest vsock by ID params
|
||||
func (o *PutGuestVsockByIDParams) SetBody(body *client_models.Vsock) {
|
||||
func (o *PutGuestVsockByIDParams) SetBody(body *models.Vsock) {
|
||||
o.Body = body
|
||||
}
|
||||
|
||||
@@ -1,18 +1,5 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License"). You may
|
||||
// not use this file except in compliance with the License. A copy of the
|
||||
// License is located at
|
||||
//
|
||||
// http://aws.amazon.com/apache2.0/
|
||||
//
|
||||
// or in the "license" file accompanying this file. This file is distributed
|
||||
// on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
|
||||
// express or implied. See the License for the specific language governing
|
||||
// permissions and limitations under the License.
|
||||
|
||||
package operations
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
@@ -26,7 +13,7 @@ import (
|
||||
|
||||
strfmt "github.com/go-openapi/strfmt"
|
||||
|
||||
client_models "github.com/firecracker-microvm/firecracker-go-sdk/client/models"
|
||||
models "github.com/kata-containers/runtime/virtcontainers/pkg/firecracker/client/models"
|
||||
)
|
||||
|
||||
// PutGuestVsockByIDReader is a Reader for the PutGuestVsockByID structure.
|
||||
@@ -123,7 +110,7 @@ func NewPutGuestVsockByIDBadRequest() *PutGuestVsockByIDBadRequest {
|
||||
Vsock cannot be created due to bad input
|
||||
*/
|
||||
type PutGuestVsockByIDBadRequest struct {
|
||||
Payload *client_models.Error
|
||||
Payload *models.Error
|
||||
}
|
||||
|
||||
func (o *PutGuestVsockByIDBadRequest) Error() string {
|
||||
@@ -132,7 +119,7 @@ func (o *PutGuestVsockByIDBadRequest) Error() string {
|
||||
|
||||
func (o *PutGuestVsockByIDBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(client_models.Error)
|
||||
o.Payload = new(models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
@@ -156,7 +143,7 @@ Internal server error
|
||||
type PutGuestVsockByIDDefault struct {
|
||||
_statusCode int
|
||||
|
||||
Payload *client_models.Error
|
||||
Payload *models.Error
|
||||
}
|
||||
|
||||
// Code gets the status code for the put guest vsock by ID default response
|
||||
@@ -170,7 +157,7 @@ func (o *PutGuestVsockByIDDefault) Error() string {
|
||||
|
||||
func (o *PutGuestVsockByIDDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(client_models.Error)
|
||||
o.Payload = new(models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
@@ -1,36 +1,22 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License"). You may
|
||||
// not use this file except in compliance with the License. A copy of the
|
||||
// License is located at
|
||||
//
|
||||
// http://aws.amazon.com/apache2.0/
|
||||
//
|
||||
// or in the "license" file accompanying this file. This file is distributed
|
||||
// on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
|
||||
// express or implied. See the License for the specific language governing
|
||||
// permissions and limitations under the License.
|
||||
|
||||
package operations
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"golang.org/x/net/context"
|
||||
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/runtime"
|
||||
cr "github.com/go-openapi/runtime/client"
|
||||
|
||||
strfmt "github.com/go-openapi/strfmt"
|
||||
|
||||
client_models "github.com/firecracker-microvm/firecracker-go-sdk/client/models"
|
||||
models "github.com/kata-containers/runtime/virtcontainers/pkg/firecracker/client/models"
|
||||
)
|
||||
|
||||
// NewPutLoggerParams creates a new PutLoggerParams object
|
||||
@@ -81,7 +67,7 @@ type PutLoggerParams struct {
|
||||
Logging system description
|
||||
|
||||
*/
|
||||
Body *client_models.Logger
|
||||
Body *models.Logger
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
@@ -122,13 +108,13 @@ func (o *PutLoggerParams) SetHTTPClient(client *http.Client) {
|
||||
}
|
||||
|
||||
// WithBody adds the body to the put logger params
|
||||
func (o *PutLoggerParams) WithBody(body *client_models.Logger) *PutLoggerParams {
|
||||
func (o *PutLoggerParams) WithBody(body *models.Logger) *PutLoggerParams {
|
||||
o.SetBody(body)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetBody adds the body to the put logger params
|
||||
func (o *PutLoggerParams) SetBody(body *client_models.Logger) {
|
||||
func (o *PutLoggerParams) SetBody(body *models.Logger) {
|
||||
o.Body = body
|
||||
}
|
||||
|
||||
@@ -1,18 +1,5 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License"). You may
|
||||
// not use this file except in compliance with the License. A copy of the
|
||||
// License is located at
|
||||
//
|
||||
// http://aws.amazon.com/apache2.0/
|
||||
//
|
||||
// or in the "license" file accompanying this file. This file is distributed
|
||||
// on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
|
||||
// express or implied. See the License for the specific language governing
|
||||
// permissions and limitations under the License.
|
||||
|
||||
package operations
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
@@ -26,7 +13,7 @@ import (
|
||||
|
||||
strfmt "github.com/go-openapi/strfmt"
|
||||
|
||||
client_models "github.com/firecracker-microvm/firecracker-go-sdk/client/models"
|
||||
models "github.com/kata-containers/runtime/virtcontainers/pkg/firecracker/client/models"
|
||||
)
|
||||
|
||||
// PutLoggerReader is a Reader for the PutLogger structure.
|
||||
@@ -95,7 +82,7 @@ func NewPutLoggerBadRequest() *PutLoggerBadRequest {
|
||||
Logger cannot be initialized due to bad input.
|
||||
*/
|
||||
type PutLoggerBadRequest struct {
|
||||
Payload *client_models.Error
|
||||
Payload *models.Error
|
||||
}
|
||||
|
||||
func (o *PutLoggerBadRequest) Error() string {
|
||||
@@ -104,7 +91,7 @@ func (o *PutLoggerBadRequest) Error() string {
|
||||
|
||||
func (o *PutLoggerBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(client_models.Error)
|
||||
o.Payload = new(models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
@@ -128,7 +115,7 @@ Internal server error.
|
||||
type PutLoggerDefault struct {
|
||||
_statusCode int
|
||||
|
||||
Payload *client_models.Error
|
||||
Payload *models.Error
|
||||
}
|
||||
|
||||
// Code gets the status code for the put logger default response
|
||||
@@ -142,7 +129,7 @@ func (o *PutLoggerDefault) Error() string {
|
||||
|
||||
func (o *PutLoggerDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(client_models.Error)
|
||||
o.Payload = new(models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
@@ -1,36 +1,22 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License"). You may
|
||||
// not use this file except in compliance with the License. A copy of the
|
||||
// License is located at
|
||||
//
|
||||
// http://aws.amazon.com/apache2.0/
|
||||
//
|
||||
// or in the "license" file accompanying this file. This file is distributed
|
||||
// on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
|
||||
// express or implied. See the License for the specific language governing
|
||||
// permissions and limitations under the License.
|
||||
|
||||
package operations
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"golang.org/x/net/context"
|
||||
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/runtime"
|
||||
cr "github.com/go-openapi/runtime/client"
|
||||
|
||||
strfmt "github.com/go-openapi/strfmt"
|
||||
|
||||
client_models "github.com/firecracker-microvm/firecracker-go-sdk/client/models"
|
||||
models "github.com/kata-containers/runtime/virtcontainers/pkg/firecracker/client/models"
|
||||
)
|
||||
|
||||
// NewPutMachineConfigurationParams creates a new PutMachineConfigurationParams object
|
||||
@@ -81,7 +67,7 @@ type PutMachineConfigurationParams struct {
|
||||
Machine Configuration Parameters
|
||||
|
||||
*/
|
||||
Body *client_models.MachineConfiguration
|
||||
Body *models.MachineConfiguration
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
@@ -122,13 +108,13 @@ func (o *PutMachineConfigurationParams) SetHTTPClient(client *http.Client) {
|
||||
}
|
||||
|
||||
// WithBody adds the body to the put machine configuration params
|
||||
func (o *PutMachineConfigurationParams) WithBody(body *client_models.MachineConfiguration) *PutMachineConfigurationParams {
|
||||
func (o *PutMachineConfigurationParams) WithBody(body *models.MachineConfiguration) *PutMachineConfigurationParams {
|
||||
o.SetBody(body)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetBody adds the body to the put machine configuration params
|
||||
func (o *PutMachineConfigurationParams) SetBody(body *client_models.MachineConfiguration) {
|
||||
func (o *PutMachineConfigurationParams) SetBody(body *models.MachineConfiguration) {
|
||||
o.Body = body
|
||||
}
|
||||
|
||||
@@ -1,18 +1,5 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License"). You may
|
||||
// not use this file except in compliance with the License. A copy of the
|
||||
// License is located at
|
||||
//
|
||||
// http://aws.amazon.com/apache2.0/
|
||||
//
|
||||
// or in the "license" file accompanying this file. This file is distributed
|
||||
// on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
|
||||
// express or implied. See the License for the specific language governing
|
||||
// permissions and limitations under the License.
|
||||
|
||||
package operations
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
@@ -26,7 +13,7 @@ import (
|
||||
|
||||
strfmt "github.com/go-openapi/strfmt"
|
||||
|
||||
client_models "github.com/firecracker-microvm/firecracker-go-sdk/client/models"
|
||||
models "github.com/kata-containers/runtime/virtcontainers/pkg/firecracker/client/models"
|
||||
)
|
||||
|
||||
// PutMachineConfigurationReader is a Reader for the PutMachineConfiguration structure.
|
||||
@@ -95,7 +82,7 @@ func NewPutMachineConfigurationBadRequest() *PutMachineConfigurationBadRequest {
|
||||
Machine Configuration cannot be updated due to bad input
|
||||
*/
|
||||
type PutMachineConfigurationBadRequest struct {
|
||||
Payload *client_models.Error
|
||||
Payload *models.Error
|
||||
}
|
||||
|
||||
func (o *PutMachineConfigurationBadRequest) Error() string {
|
||||
@@ -104,7 +91,7 @@ func (o *PutMachineConfigurationBadRequest) Error() string {
|
||||
|
||||
func (o *PutMachineConfigurationBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(client_models.Error)
|
||||
o.Payload = new(models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
@@ -128,7 +115,7 @@ Internal server error
|
||||
type PutMachineConfigurationDefault struct {
|
||||
_statusCode int
|
||||
|
||||
Payload *client_models.Error
|
||||
Payload *models.Error
|
||||
}
|
||||
|
||||
// Code gets the status code for the put machine configuration default response
|
||||
@@ -142,7 +129,7 @@ func (o *PutMachineConfigurationDefault) Error() string {
|
||||
|
||||
func (o *PutMachineConfigurationDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(client_models.Error)
|
||||
o.Payload = new(models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
@@ -1,29 +1,15 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License"). You may
|
||||
// not use this file except in compliance with the License. A copy of the
|
||||
// License is located at
|
||||
//
|
||||
// http://aws.amazon.com/apache2.0/
|
||||
//
|
||||
// or in the "license" file accompanying this file. This file is distributed
|
||||
// on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
|
||||
// express or implied. See the License for the specific language governing
|
||||
// permissions and limitations under the License.
|
||||
|
||||
package operations
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"golang.org/x/net/context"
|
||||
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/runtime"
|
||||
cr "github.com/go-openapi/runtime/client"
|
||||
@@ -1,18 +1,5 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License"). You may
|
||||
// not use this file except in compliance with the License. A copy of the
|
||||
// License is located at
|
||||
//
|
||||
// http://aws.amazon.com/apache2.0/
|
||||
//
|
||||
// or in the "license" file accompanying this file. This file is distributed
|
||||
// on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
|
||||
// express or implied. See the License for the specific language governing
|
||||
// permissions and limitations under the License.
|
||||
|
||||
package operations
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
@@ -26,7 +13,7 @@ import (
|
||||
|
||||
strfmt "github.com/go-openapi/strfmt"
|
||||
|
||||
client_models "github.com/firecracker-microvm/firecracker-go-sdk/client/models"
|
||||
models "github.com/kata-containers/runtime/virtcontainers/pkg/firecracker/client/models"
|
||||
)
|
||||
|
||||
// PutMmdsReader is a Reader for the PutMmds structure.
|
||||
@@ -95,7 +82,7 @@ func NewPutMmdsBadRequest() *PutMmdsBadRequest {
|
||||
MMDS data store cannot be created due to bad input.
|
||||
*/
|
||||
type PutMmdsBadRequest struct {
|
||||
Payload *client_models.Error
|
||||
Payload *models.Error
|
||||
}
|
||||
|
||||
func (o *PutMmdsBadRequest) Error() string {
|
||||
@@ -104,7 +91,7 @@ func (o *PutMmdsBadRequest) Error() string {
|
||||
|
||||
func (o *PutMmdsBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(client_models.Error)
|
||||
o.Payload = new(models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
@@ -128,7 +115,7 @@ Internal server error
|
||||
type PutMmdsDefault struct {
|
||||
_statusCode int
|
||||
|
||||
Payload *client_models.Error
|
||||
Payload *models.Error
|
||||
}
|
||||
|
||||
// Code gets the status code for the put mmds default response
|
||||
@@ -142,7 +129,7 @@ func (o *PutMmdsDefault) Error() string {
|
||||
|
||||
func (o *PutMmdsDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(client_models.Error)
|
||||
o.Payload = new(models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
661
virtcontainers/pkg/firecracker/firecracker-experimental.yaml
Normal file
661
virtcontainers/pkg/firecracker/firecracker-experimental.yaml
Normal file
@@ -0,0 +1,661 @@
|
||||
swagger: "2.0"
|
||||
info:
|
||||
title: Firecracker API
|
||||
description: RESTful public-facing API.
|
||||
The API is accessible through HTTP calls on specific URLs
|
||||
carrying JSON modeled data.
|
||||
The transport medium is a Unix Domain Socket.
|
||||
This API has definitions for experimental features like vsock.
|
||||
version: 0.17.0
|
||||
termsOfService: ""
|
||||
contact:
|
||||
email: "compute-capsule@amazon.com"
|
||||
license:
|
||||
name: "Apache 2.0"
|
||||
url: "http://www.apache.org/licenses/LICENSE-2.0.html"
|
||||
|
||||
host: "localhost"
|
||||
basePath: "/"
|
||||
|
||||
schemes:
|
||||
- http
|
||||
consumes:
|
||||
- application/json
|
||||
produces:
|
||||
- application/json
|
||||
|
||||
paths:
|
||||
/:
|
||||
get:
|
||||
summary: Returns general information about an instance.
|
||||
operationId: describeInstance
|
||||
responses:
|
||||
200:
|
||||
description: The instance information
|
||||
schema:
|
||||
$ref: "#/definitions/InstanceInfo"
|
||||
default:
|
||||
description: Internal Server Error
|
||||
schema:
|
||||
$ref: "#/definitions/Error"
|
||||
|
||||
/actions:
|
||||
put:
|
||||
summary: Creates a synchronous action.
|
||||
operationId: createSyncAction
|
||||
parameters:
|
||||
- name: info
|
||||
in: body
|
||||
required: true
|
||||
schema:
|
||||
$ref: "#/definitions/InstanceActionInfo"
|
||||
responses:
|
||||
204:
|
||||
description: The update was successful
|
||||
400:
|
||||
description: The action cannot be executed due to bad input
|
||||
schema:
|
||||
$ref: "#/definitions/Error"
|
||||
default:
|
||||
description: Internal Server Error
|
||||
schema:
|
||||
$ref: "#/definitions/Error"
|
||||
|
||||
/boot-source:
|
||||
put:
|
||||
summary: Creates or updates the boot source.
|
||||
description:
|
||||
Creates new boot source if one does not already exist, otherwise updates it.
|
||||
Will fail if update is not possible.
|
||||
Note that the only currently supported boot source is LocalImage.
|
||||
operationId: putGuestBootSource
|
||||
parameters:
|
||||
- name: body
|
||||
in: body
|
||||
description: Guest boot source properties
|
||||
required: true
|
||||
schema:
|
||||
$ref: "#/definitions/BootSource"
|
||||
responses:
|
||||
204:
|
||||
description: Boot source created/updated
|
||||
400:
|
||||
description: Boot source cannot be created due to bad input
|
||||
schema:
|
||||
$ref: "#/definitions/Error"
|
||||
default:
|
||||
description: Internal server error
|
||||
schema:
|
||||
$ref: "#/definitions/Error"
|
||||
|
||||
/drives/{drive_id}:
|
||||
put:
|
||||
summary: Creates or updates a drive.
|
||||
description:
|
||||
Creates new drive with ID specified by drive_id path parameter.
|
||||
If a drive with the specified ID already exists, updates its state based on new input.
|
||||
Will fail if update is not possible.
|
||||
operationId: putGuestDriveByID
|
||||
parameters:
|
||||
- name: drive_id
|
||||
in: path
|
||||
description: The id of the guest drive
|
||||
required: true
|
||||
type: string
|
||||
- name: body
|
||||
in: body
|
||||
description: Guest drive properties
|
||||
required: true
|
||||
schema:
|
||||
$ref: "#/definitions/Drive"
|
||||
responses:
|
||||
204:
|
||||
description: Drive created/updated
|
||||
400:
|
||||
description: Drive cannot be created/updated due to bad input
|
||||
schema:
|
||||
$ref: "#/definitions/Error"
|
||||
default:
|
||||
description: Internal server error.
|
||||
schema:
|
||||
$ref: "#/definitions/Error"
|
||||
patch:
|
||||
summary: Updates the properties of a drive.
|
||||
description:
|
||||
Updates the properties of the drive with the ID specified by drive_id path parameter.
|
||||
Will fail if update is not possible.
|
||||
operationId: patchGuestDriveByID
|
||||
parameters:
|
||||
- name: drive_id
|
||||
in: path
|
||||
description: The id of the guest drive
|
||||
required: true
|
||||
type: string
|
||||
- name: body
|
||||
in: body
|
||||
description: Guest drive properties
|
||||
required: true
|
||||
schema:
|
||||
$ref: "#/definitions/PartialDrive"
|
||||
responses:
|
||||
204:
|
||||
description: Drive updated
|
||||
400:
|
||||
description: Drive cannot be updated due to bad input
|
||||
schema:
|
||||
$ref: "#/definitions/Error"
|
||||
default:
|
||||
description: Internal server error.
|
||||
schema:
|
||||
$ref: "#/definitions/Error"
|
||||
|
||||
/logger:
|
||||
put:
|
||||
summary: Initializes the logger by specifying two named pipes (i.e. for the logs and metrics output).
|
||||
operationId: putLogger
|
||||
parameters:
|
||||
- name: body
|
||||
in: body
|
||||
description: Logging system description
|
||||
required: true
|
||||
schema:
|
||||
$ref: "#/definitions/Logger"
|
||||
responses:
|
||||
204:
|
||||
description: Logger created.
|
||||
400:
|
||||
description: Logger cannot be initialized due to bad input.
|
||||
schema:
|
||||
$ref: "#/definitions/Error"
|
||||
default:
|
||||
description: Internal server error.
|
||||
schema:
|
||||
$ref: "#/definitions/Error"
|
||||
|
||||
/machine-config:
|
||||
get:
|
||||
summary: Gets the machine configuration of the VM.
|
||||
description:
|
||||
Gets the machine configuration of the VM. When called before the PUT operation, it
|
||||
will return the default values for the vCPU count (=1), memory size (=128 MiB).
|
||||
By default Hyperthreading is disabled and there is no CPU Template.
|
||||
operationId: getMachineConfiguration
|
||||
responses:
|
||||
200:
|
||||
description: OK
|
||||
schema:
|
||||
$ref: "#/definitions/MachineConfiguration"
|
||||
default:
|
||||
description: Internal server error
|
||||
schema:
|
||||
$ref: "#/definitions/Error"
|
||||
|
||||
put:
|
||||
summary: Updates the Machine Configuration of the VM.
|
||||
description:
|
||||
Updates the Virtual Machine Configuration with the specified input.
|
||||
Firecracker starts with default values for vCPU count (=1) and memory size (=128 MiB).
|
||||
With Hyperthreading enabled, the vCPU count is restricted to be 1 or an even number,
|
||||
otherwise there are no restrictions regarding the vCPU count.
|
||||
If any of the parameters has an incorrect value, the whole update fails.
|
||||
operationId: putMachineConfiguration
|
||||
parameters:
|
||||
- name: body
|
||||
in: body
|
||||
description: Machine Configuration Parameters
|
||||
schema:
|
||||
$ref: "#/definitions/MachineConfiguration"
|
||||
responses:
|
||||
204:
|
||||
description: Machine Configuration created/updated
|
||||
400:
|
||||
description: Machine Configuration cannot be updated due to bad input
|
||||
schema:
|
||||
$ref: "#/definitions/Error"
|
||||
default:
|
||||
description: Internal server error
|
||||
schema:
|
||||
$ref: "#/definitions/Error"
|
||||
|
||||
patch:
|
||||
summary: Partially updates the Machine Configuration of the VM.
|
||||
description:
|
||||
Partially updates the Virtual Machine Configuration with the specified input.
|
||||
If any of the parameters has an incorrect value, the whole update fails.
|
||||
operationId: patchMachineConfiguration
|
||||
parameters:
|
||||
- name: body
|
||||
in: body
|
||||
description: A subset of Machine Configuration Parameters
|
||||
schema:
|
||||
$ref: "#/definitions/MachineConfiguration"
|
||||
responses:
|
||||
204:
|
||||
description: Machine Configuration created/updated
|
||||
400:
|
||||
description: Machine Configuration cannot be updated due to bad input
|
||||
schema:
|
||||
$ref: "#/definitions/Error"
|
||||
default:
|
||||
description: Internal server error
|
||||
schema:
|
||||
$ref: "#/definitions/Error"
|
||||
|
||||
/mmds:
|
||||
put:
|
||||
summary: Creates a MMDS (Microvm Metadata Service) data store.
|
||||
parameters:
|
||||
- name: body
|
||||
in: body
|
||||
description: The MMDS data store as JSON.
|
||||
schema:
|
||||
type: object
|
||||
responses:
|
||||
204:
|
||||
description: MMDS data store created/updated.
|
||||
400:
|
||||
description: MMDS data store cannot be created due to bad input.
|
||||
schema:
|
||||
$ref: "#/definitions/Error"
|
||||
default:
|
||||
description: Internal server error
|
||||
schema:
|
||||
$ref: "#/definitions/Error"
|
||||
patch:
|
||||
summary: Updates the MMDS data store.
|
||||
parameters:
|
||||
- name: body
|
||||
in: body
|
||||
description: The MMDS data store patch JSON.
|
||||
schema:
|
||||
type: object
|
||||
responses:
|
||||
204:
|
||||
description: MMDS data store updated.
|
||||
400:
|
||||
description: MMDS data store cannot be updated due to bad input.
|
||||
schema:
|
||||
$ref: "#/definitions/Error"
|
||||
default:
|
||||
description: Internal server error
|
||||
schema:
|
||||
$ref: "#/definitions/Error"
|
||||
get:
|
||||
summary: Get the MMDS data store.
|
||||
responses:
|
||||
200:
|
||||
description: The MMDS data store JSON.
|
||||
schema:
|
||||
type: object
|
||||
400:
|
||||
description: Cannot get the MMDS data store due to bad input.
|
||||
schema:
|
||||
$ref: "#/definitions/Error"
|
||||
default:
|
||||
description: Internal server error
|
||||
schema:
|
||||
$ref: "#/definitions/Error"
|
||||
|
||||
/network-interfaces/{iface_id}:
|
||||
put:
|
||||
summary: Creates a network interface.
|
||||
description:
|
||||
Creates new network interface with ID specified by iface_id path parameter.
|
||||
operationId: putGuestNetworkInterfaceByID
|
||||
parameters:
|
||||
- name: iface_id
|
||||
in: path
|
||||
description: The id of the guest network interface
|
||||
required: true
|
||||
type: string
|
||||
- name: body
|
||||
in: body
|
||||
description: Guest network interface properties
|
||||
required: true
|
||||
schema:
|
||||
$ref: "#/definitions/NetworkInterface"
|
||||
responses:
|
||||
204:
|
||||
description: Network interface created/updated
|
||||
400:
|
||||
description: Network interface cannot be created due to bad input
|
||||
schema:
|
||||
$ref: "#/definitions/Error"
|
||||
default:
|
||||
description: Internal server error
|
||||
schema:
|
||||
$ref: "#/definitions/Error"
|
||||
patch:
|
||||
summary: Updates the rate limiters applied to a network interface.
|
||||
description:
|
||||
Updates the rate limiters applied to a network interface.
|
||||
operationId: patchGuestNetworkInterfaceByID
|
||||
parameters:
|
||||
- name: iface_id
|
||||
in: path
|
||||
description: The id of the guest network interface
|
||||
required: true
|
||||
type: string
|
||||
- name: body
|
||||
in: body
|
||||
description: A subset of the guest network interface properties
|
||||
required: true
|
||||
schema:
|
||||
$ref: "#/definitions/PartialNetworkInterface"
|
||||
responses:
|
||||
204:
|
||||
description: Network interface updated
|
||||
400:
|
||||
description: Network interface cannot be updated due to bad input
|
||||
schema:
|
||||
$ref: "#/definitions/Error"
|
||||
default:
|
||||
description: Internal server error
|
||||
schema:
|
||||
$ref: "#/definitions/Error"
|
||||
|
||||
/vsocks/{id}:
|
||||
put:
|
||||
summary: Creates new vsock with ID specified by the id parameter.
|
||||
description:
|
||||
If the vsock device with the specified ID already exists, its body will
|
||||
be updated based on the new input. May fail if update is not possible.
|
||||
operationId: putGuestVsockByID
|
||||
parameters:
|
||||
- name: id
|
||||
in: path
|
||||
description: The id of the vsock device
|
||||
required: true
|
||||
type: string
|
||||
- name: body
|
||||
in: body
|
||||
description: Guest vsock properties
|
||||
required: true
|
||||
schema:
|
||||
$ref: "#/definitions/Vsock"
|
||||
responses:
|
||||
201:
|
||||
description: Vsock created
|
||||
204:
|
||||
description: Vsock updated
|
||||
400:
|
||||
description: Vsock cannot be created due to bad input
|
||||
schema:
|
||||
$ref: "#/definitions/Error"
|
||||
default:
|
||||
description: Internal server error
|
||||
schema:
|
||||
$ref: "#/definitions/Error"
|
||||
|
||||
definitions:
|
||||
BootSource:
|
||||
type: object
|
||||
required:
|
||||
- kernel_image_path
|
||||
description:
|
||||
Boot source descriptor.
|
||||
properties:
|
||||
kernel_image_path:
|
||||
type: string
|
||||
description: Host level path to the kernel image used to boot the guest
|
||||
boot_args:
|
||||
type: string
|
||||
description: Kernel boot arguments
|
||||
|
||||
CpuTemplate:
|
||||
type: string
|
||||
description:
|
||||
The CPU Template defines a set of flags to be disabled from the microvm so that
|
||||
the features exposed to the guest are the same as in the selected instance type.
|
||||
enum:
|
||||
- C3
|
||||
- T2
|
||||
|
||||
Drive:
|
||||
type: object
|
||||
required:
|
||||
- drive_id
|
||||
- path_on_host
|
||||
- is_root_device
|
||||
- is_read_only
|
||||
properties:
|
||||
drive_id:
|
||||
type: string
|
||||
path_on_host:
|
||||
type: string
|
||||
description: Host level path for the guest drive
|
||||
is_root_device:
|
||||
type: boolean
|
||||
partuuid:
|
||||
type: string
|
||||
description:
|
||||
Represents the unique id of the boot partition of this device. It is
|
||||
optional and it will be taken into account only if the is_root_device
|
||||
field is true.
|
||||
is_read_only:
|
||||
type: boolean
|
||||
rate_limiter:
|
||||
$ref: "#/definitions/RateLimiter"
|
||||
|
||||
Error:
|
||||
type: object
|
||||
properties:
|
||||
fault_message:
|
||||
type: string
|
||||
description: A description of the error condition
|
||||
readOnly: true
|
||||
|
||||
InstanceActionInfo:
|
||||
type: object
|
||||
description:
|
||||
Variant wrapper containing the real action.
|
||||
required:
|
||||
- action_type
|
||||
properties:
|
||||
action_type:
|
||||
description: Enumeration indicating what type of action is contained in the payload
|
||||
type: string
|
||||
enum:
|
||||
- BlockDeviceRescan
|
||||
- FlushMetrics
|
||||
- InstanceStart
|
||||
- SendCtrlAltDel
|
||||
payload:
|
||||
type: string
|
||||
|
||||
InstanceInfo:
|
||||
type: object
|
||||
description:
|
||||
Describes MicroVM instance information.
|
||||
required:
|
||||
- id
|
||||
- state
|
||||
- vmm_version
|
||||
properties:
|
||||
id:
|
||||
description: MicroVM / instance ID.
|
||||
type: string
|
||||
state:
|
||||
description:
|
||||
The current detailed state of the Firecracker instance.
|
||||
This value is read-only for the control-plane.
|
||||
type: string
|
||||
enum:
|
||||
- Uninitialized
|
||||
- Starting
|
||||
- Running
|
||||
- Halting
|
||||
- Halted
|
||||
vmm_version:
|
||||
description: MicroVM hypervisor build version.
|
||||
type: string
|
||||
|
||||
Logger:
|
||||
type: object
|
||||
description:
|
||||
Describes the configuration option for the logging capability.
|
||||
required:
|
||||
- log_fifo
|
||||
- metrics_fifo
|
||||
properties:
|
||||
log_fifo:
|
||||
type: string
|
||||
description: The named pipe for the human readable log output.
|
||||
metrics_fifo:
|
||||
type: string
|
||||
description: The named pipe where the JSON-formatted metrics will be flushed.
|
||||
level:
|
||||
type: string
|
||||
description: Set the level.
|
||||
enum: [Error, Warning, Info, Debug]
|
||||
default: Warning
|
||||
show_level:
|
||||
type: boolean
|
||||
description: Whether or not to output the level in the logs.
|
||||
default: false
|
||||
show_log_origin:
|
||||
type: boolean
|
||||
description: Whether or not to include the file path and line number of the log's origin.
|
||||
default: false
|
||||
options:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
description: Additional logging options. Only "LogDirtyPages" is supported.
|
||||
default: []
|
||||
|
||||
MachineConfiguration:
|
||||
type: object
|
||||
description:
|
||||
Describes the number of vCPUs, memory size, Hyperthreading capabilities and
|
||||
the CPU template.
|
||||
required:
|
||||
- vcpu_count
|
||||
- mem_size_mib
|
||||
- ht_enabled
|
||||
properties:
|
||||
vcpu_count:
|
||||
type: integer
|
||||
minimum: 1
|
||||
maximum: 32
|
||||
description: Number of vCPUs (either 1 or an even number)
|
||||
mem_size_mib:
|
||||
type: integer
|
||||
description: Memory size of VM
|
||||
ht_enabled:
|
||||
type: boolean
|
||||
description: Flag for enabling/disabling Hyperthreading
|
||||
cpu_template:
|
||||
$ref: "#/definitions/CpuTemplate"
|
||||
|
||||
NetworkInterface:
|
||||
type: object
|
||||
description:
|
||||
Defines a network interface.
|
||||
required:
|
||||
- iface_id
|
||||
- host_dev_name
|
||||
properties:
|
||||
iface_id:
|
||||
type: string
|
||||
guest_mac:
|
||||
type: string
|
||||
host_dev_name:
|
||||
type: string
|
||||
description: Host level path for the guest network interface
|
||||
allow_mmds_requests:
|
||||
type: boolean
|
||||
description:
|
||||
If this field is set, the device model will reply to HTTP GET
|
||||
requests sent to the MMDS address via this interface. In this case,
|
||||
both ARP requests for 169.254.169.254 and TCP segments heading to the
|
||||
same address are intercepted by the device model, and do not reach
|
||||
the associated TAP device.
|
||||
rx_rate_limiter:
|
||||
$ref: "#/definitions/RateLimiter"
|
||||
tx_rate_limiter:
|
||||
$ref: "#/definitions/RateLimiter"
|
||||
|
||||
PartialDrive:
|
||||
type: object
|
||||
required:
|
||||
- drive_id
|
||||
- path_on_host
|
||||
properties:
|
||||
drive_id:
|
||||
type: string
|
||||
path_on_host:
|
||||
type: string
|
||||
description: Host level path for the guest drive
|
||||
|
||||
PartialNetworkInterface:
|
||||
type: object
|
||||
description:
|
||||
Defines a partial network interface structure, used to update the rate limiters
|
||||
for that interface, after microvm start.
|
||||
required:
|
||||
- iface_id
|
||||
properties:
|
||||
iface_id:
|
||||
type: string
|
||||
rx_rate_limiter:
|
||||
$ref: "#/definitions/RateLimiter"
|
||||
tx_rate_limiter:
|
||||
$ref: "#/definitions/RateLimiter"
|
||||
|
||||
RateLimiter:
|
||||
type: object
|
||||
description:
|
||||
Defines an IO rate limiter with independent bytes/s and ops/s limits.
|
||||
Limits are defined by configuring each of the _bandwidth_ and _ops_ token buckets.
|
||||
properties:
|
||||
bandwidth:
|
||||
$ref: "#/definitions/TokenBucket"
|
||||
description: Token bucket with bytes as tokens
|
||||
ops:
|
||||
$ref: "#/definitions/TokenBucket"
|
||||
description: Token bucket with operations as tokens
|
||||
|
||||
TokenBucket:
|
||||
type: object
|
||||
description:
|
||||
Defines a token bucket with a maximum capacity (size), an initial burst size
|
||||
(one_time_burst) and an interval for refilling purposes (refill_time).
|
||||
The refill-rate is derived from size and refill_time, and it is the constant
|
||||
rate at which the tokens replenish. The refill process only starts happening after
|
||||
the initial burst budget is consumed.
|
||||
Consumption from the token bucket is unbounded in speed which allows for bursts
|
||||
bound in size by the amount of tokens available.
|
||||
Once the token bucket is empty, consumption speed is bound by the refill_rate.
|
||||
required:
|
||||
- size
|
||||
- refill_time
|
||||
properties:
|
||||
size:
|
||||
type: integer
|
||||
format: int64
|
||||
description: The total number of tokens this bucket can hold.
|
||||
minimum: 0
|
||||
one_time_burst:
|
||||
type: integer
|
||||
format: int64
|
||||
description: The initial size of a token bucket.
|
||||
minimum: 0
|
||||
refill_time:
|
||||
type: integer
|
||||
format: int64
|
||||
description: The amount of milliseconds it takes for the bucket to refill.
|
||||
minimum: 0
|
||||
|
||||
Vsock:
|
||||
type: object
|
||||
required:
|
||||
- id
|
||||
- guest_cid
|
||||
properties:
|
||||
id:
|
||||
type: string
|
||||
guest_cid:
|
||||
type: integer
|
||||
minimum: 3
|
||||
description: Guest Vsock CID
|
||||
BIN
virtcontainers/pkg/firecracker/swagger_linux_amd64
Executable file
BIN
virtcontainers/pkg/firecracker/swagger_linux_amd64
Executable file
Binary file not shown.
Reference in New Issue
Block a user