Unvendor: Unvendor firecracker-go-sdk

We only use the swagger generated code from the firecracker-go-sdk.
Now that vsock support is directly available in the upstream
firecracker swagger definition unvendor and generate the
firecracker API directly from the upstream yaml definition.

Previosly vsock was not available in the upstream definition.
It is now provided as an experimental feature.

https://github.com/firecracker-microvm/firecracker/blob/master/api_server/swagger/firecracker-experimental.yaml

Signed-off-by: Manohar Castelino <manohar.r.castelino@intel.com>
This commit is contained in:
Manohar Castelino 2019-06-18 16:33:14 -07:00
parent dca1f529a2
commit da2a52a3f2
46 changed files with 0 additions and 6143 deletions

14
Gopkg.lock generated
View File

@ -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",

View File

@ -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"

View File

@ -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.

View File

@ -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.

View File

@ -1,2 +0,0 @@
Go Firecracker SDK
Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.

View File

@ -1,130 +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 client
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"github.com/go-openapi/runtime"
httptransport "github.com/go-openapi/runtime/client"
strfmt "github.com/go-openapi/strfmt"
"github.com/firecracker-microvm/firecracker-go-sdk/client/operations"
)
// Default firecracker HTTP client.
var Default = NewHTTPClient(nil)
const (
// DefaultHost is the default Host
// found in Meta (info) section of spec file
DefaultHost string = "localhost"
// DefaultBasePath is the default BasePath
// found in Meta (info) section of spec file
DefaultBasePath string = "/"
)
// DefaultSchemes are the default schemes found in Meta (info) section of spec file
var DefaultSchemes = []string{"http"}
// NewHTTPClient creates a new firecracker HTTP client.
func NewHTTPClient(formats strfmt.Registry) *Firecracker {
return NewHTTPClientWithConfig(formats, nil)
}
// NewHTTPClientWithConfig creates a new firecracker HTTP client,
// using a customizable transport config.
func NewHTTPClientWithConfig(formats strfmt.Registry, cfg *TransportConfig) *Firecracker {
// ensure nullable parameters have default
if cfg == nil {
cfg = DefaultTransportConfig()
}
// create transport and client
transport := httptransport.New(cfg.Host, cfg.BasePath, cfg.Schemes)
return New(transport, formats)
}
// New creates a new firecracker client
func New(transport runtime.ClientTransport, formats strfmt.Registry) *Firecracker {
// ensure nullable parameters have default
if formats == nil {
formats = strfmt.Default
}
cli := new(Firecracker)
cli.Transport = transport
cli.Operations = operations.New(transport, formats)
return cli
}
// DefaultTransportConfig creates a TransportConfig with the
// default settings taken from the meta section of the spec file.
func DefaultTransportConfig() *TransportConfig {
return &TransportConfig{
Host: DefaultHost,
BasePath: DefaultBasePath,
Schemes: DefaultSchemes,
}
}
// TransportConfig contains the transport related info,
// found in the meta section of the spec file.
type TransportConfig struct {
Host string
BasePath string
Schemes []string
}
// WithHost overrides the default host,
// provided by the meta section of the spec file.
func (cfg *TransportConfig) WithHost(host string) *TransportConfig {
cfg.Host = host
return cfg
}
// WithBasePath overrides the default basePath,
// provided by the meta section of the spec file.
func (cfg *TransportConfig) WithBasePath(basePath string) *TransportConfig {
cfg.BasePath = basePath
return cfg
}
// WithSchemes overrides the default schemes,
// provided by the meta section of the spec file.
func (cfg *TransportConfig) WithSchemes(schemes []string) *TransportConfig {
cfg.Schemes = schemes
return cfg
}
// Firecracker is a client for firecracker
type Firecracker struct {
Operations *operations.Client
Transport runtime.ClientTransport
}
// SetTransport changes the transport on the client and all its subresources
func (c *Firecracker) SetTransport(transport runtime.ClientTransport) {
c.Transport = transport
c.Operations.SetTransport(transport)
}

View File

@ -1,80 +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 client_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"
)
// BootSource Boot source descriptor.
// swagger:model BootSource
type BootSource struct {
// Kernel boot arguments
BootArgs string `json:"boot_args,omitempty"`
// Host level path to the kernel image used to boot the guest
// Required: true
KernelImagePath *string `json:"kernel_image_path"`
}
// Validate validates this boot source
func (m *BootSource) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateKernelImagePath(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *BootSource) validateKernelImagePath(formats strfmt.Registry) error {
if err := validate.Required("kernel_image_path", "body", m.KernelImagePath); err != nil {
return err
}
return nil
}
// MarshalBinary interface implementation
func (m *BootSource) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *BootSource) UnmarshalBinary(b []byte) error {
var res BootSource
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@ -1,76 +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 client_models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"encoding/json"
strfmt "github.com/go-openapi/strfmt"
"github.com/go-openapi/errors"
"github.com/go-openapi/validate"
)
// CPUTemplate 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.
// swagger:model CpuTemplate
type CPUTemplate string
const (
// CPUTemplateC3 captures enum value "C3"
CPUTemplateC3 CPUTemplate = "C3"
// CPUTemplateT2 captures enum value "T2"
CPUTemplateT2 CPUTemplate = "T2"
)
// for schema
var cpuTemplateEnum []interface{}
func init() {
var res []CPUTemplate
if err := json.Unmarshal([]byte(`["C3","T2"]`), &res); err != nil {
panic(err)
}
for _, v := range res {
cpuTemplateEnum = append(cpuTemplateEnum, v)
}
}
func (m CPUTemplate) validateCPUTemplateEnum(path, location string, value CPUTemplate) error {
if err := validate.Enum(path, location, value, cpuTemplateEnum); err != nil {
return err
}
return nil
}
// Validate validates this Cpu template
func (m CPUTemplate) Validate(formats strfmt.Registry) error {
var res []error
// value enum
if err := m.validateCPUTemplateEnum("", "body", m); err != nil {
return err
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}

View File

@ -1,156 +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 client_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"
)
// Drive drive
// swagger:model Drive
type Drive struct {
// drive id
// Required: true
DriveID *string `json:"drive_id"`
// is read only
// Required: true
IsReadOnly *bool `json:"is_read_only"`
// is root device
// Required: true
IsRootDevice *bool `json:"is_root_device"`
// 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.
Partuuid string `json:"partuuid,omitempty"`
// Host level path for the guest drive
// Required: true
PathOnHost *string `json:"path_on_host"`
// rate limiter
RateLimiter *RateLimiter `json:"rate_limiter,omitempty"`
}
// Validate validates this drive
func (m *Drive) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateDriveID(formats); err != nil {
res = append(res, err)
}
if err := m.validateIsReadOnly(formats); err != nil {
res = append(res, err)
}
if err := m.validateIsRootDevice(formats); err != nil {
res = append(res, err)
}
if err := m.validatePathOnHost(formats); err != nil {
res = append(res, err)
}
if err := m.validateRateLimiter(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *Drive) validateDriveID(formats strfmt.Registry) error {
if err := validate.Required("drive_id", "body", m.DriveID); err != nil {
return err
}
return nil
}
func (m *Drive) validateIsReadOnly(formats strfmt.Registry) error {
if err := validate.Required("is_read_only", "body", m.IsReadOnly); err != nil {
return err
}
return nil
}
func (m *Drive) validateIsRootDevice(formats strfmt.Registry) error {
if err := validate.Required("is_root_device", "body", m.IsRootDevice); err != nil {
return err
}
return nil
}
func (m *Drive) validatePathOnHost(formats strfmt.Registry) error {
if err := validate.Required("path_on_host", "body", m.PathOnHost); err != nil {
return err
}
return nil
}
func (m *Drive) validateRateLimiter(formats strfmt.Registry) error {
if swag.IsZero(m.RateLimiter) { // not required
return nil
}
if m.RateLimiter != nil {
if err := m.RateLimiter.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("rate_limiter")
}
return err
}
}
return nil
}
// MarshalBinary interface implementation
func (m *Drive) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *Drive) UnmarshalBinary(b []byte) error {
var res Drive
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@ -1,56 +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 client_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/swag"
)
// Error error
// swagger:model Error
type Error struct {
// A description of the error condition
FaultMessage string `json:"fault_message,omitempty"`
}
// Validate validates this error
func (m *Error) Validate(formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *Error) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *Error) UnmarshalBinary(b []byte) error {
var res Error
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@ -1,119 +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 client_models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"encoding/json"
strfmt "github.com/go-openapi/strfmt"
"github.com/go-openapi/errors"
"github.com/go-openapi/swag"
"github.com/go-openapi/validate"
)
// InstanceActionInfo Variant wrapper containing the real action.
// swagger:model InstanceActionInfo
type InstanceActionInfo struct {
// Enumeration indicating what type of action is contained in the payload
// Enum: [BlockDeviceRescan InstanceStart InstanceHalt]
ActionType string `json:"action_type,omitempty"`
// payload
Payload string `json:"payload,omitempty"`
}
// Validate validates this instance action info
func (m *InstanceActionInfo) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateActionType(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
var instanceActionInfoTypeActionTypePropEnum []interface{}
func init() {
var res []string
if err := json.Unmarshal([]byte(`["BlockDeviceRescan","InstanceStart","InstanceHalt"]`), &res); err != nil {
panic(err)
}
for _, v := range res {
instanceActionInfoTypeActionTypePropEnum = append(instanceActionInfoTypeActionTypePropEnum, v)
}
}
const (
// InstanceActionInfoActionTypeBlockDeviceRescan captures enum value "BlockDeviceRescan"
InstanceActionInfoActionTypeBlockDeviceRescan string = "BlockDeviceRescan"
// InstanceActionInfoActionTypeInstanceStart captures enum value "InstanceStart"
InstanceActionInfoActionTypeInstanceStart string = "InstanceStart"
// InstanceActionInfoActionTypeInstanceHalt captures enum value "InstanceHalt"
InstanceActionInfoActionTypeInstanceHalt string = "InstanceHalt"
)
// prop value enum
func (m *InstanceActionInfo) validateActionTypeEnum(path, location string, value string) error {
if err := validate.Enum(path, location, value, instanceActionInfoTypeActionTypePropEnum); err != nil {
return err
}
return nil
}
func (m *InstanceActionInfo) validateActionType(formats strfmt.Registry) error {
if swag.IsZero(m.ActionType) { // not required
return nil
}
// value enum
if err := m.validateActionTypeEnum("action_type", "body", m.ActionType); err != nil {
return err
}
return nil
}
// MarshalBinary interface implementation
func (m *InstanceActionInfo) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *InstanceActionInfo) UnmarshalBinary(b []byte) error {
var res InstanceActionInfo
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@ -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 client_models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"encoding/json"
strfmt "github.com/go-openapi/strfmt"
"github.com/go-openapi/errors"
"github.com/go-openapi/swag"
"github.com/go-openapi/validate"
)
// InstanceInfo instance info
// swagger:model InstanceInfo
type InstanceInfo struct {
// MicroVM / instance ID.
ID string `json:"id,omitempty"`
// The current detailed state of the Firecracker instance. This value is read-only for the control-plane.
// Enum: [Uninitialized Starting Running Halting Halted]
State string `json:"state,omitempty"`
}
// Validate validates this instance info
func (m *InstanceInfo) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateState(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
var instanceInfoTypeStatePropEnum []interface{}
func init() {
var res []string
if err := json.Unmarshal([]byte(`["Uninitialized","Starting","Running","Halting","Halted"]`), &res); err != nil {
panic(err)
}
for _, v := range res {
instanceInfoTypeStatePropEnum = append(instanceInfoTypeStatePropEnum, v)
}
}
const (
// InstanceInfoStateUninitialized captures enum value "Uninitialized"
InstanceInfoStateUninitialized string = "Uninitialized"
// InstanceInfoStateStarting captures enum value "Starting"
InstanceInfoStateStarting string = "Starting"
// InstanceInfoStateRunning captures enum value "Running"
InstanceInfoStateRunning string = "Running"
// InstanceInfoStateHalting captures enum value "Halting"
InstanceInfoStateHalting string = "Halting"
// InstanceInfoStateHalted captures enum value "Halted"
InstanceInfoStateHalted string = "Halted"
)
// prop value enum
func (m *InstanceInfo) validateStateEnum(path, location string, value string) error {
if err := validate.Enum(path, location, value, instanceInfoTypeStatePropEnum); err != nil {
return err
}
return nil
}
func (m *InstanceInfo) validateState(formats strfmt.Registry) error {
if swag.IsZero(m.State) { // not required
return nil
}
// value enum
if err := m.validateStateEnum("state", "body", m.State); err != nil {
return err
}
return nil
}
// MarshalBinary interface implementation
func (m *InstanceInfo) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *InstanceInfo) UnmarshalBinary(b []byte) error {
var res InstanceInfo
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@ -1,134 +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 client_models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"encoding/json"
strfmt "github.com/go-openapi/strfmt"
"github.com/go-openapi/errors"
"github.com/go-openapi/swag"
"github.com/go-openapi/validate"
)
// Logger Describes the configuration option for the logging capability.
// swagger:model Logger
type Logger struct {
// Set the level.
// Enum: [Error Warning Info Debug]
Level string `json:"level,omitempty"`
// The named pipe for the human readable log output.
LogFifo string `json:"log_fifo,omitempty"`
// The named pipe where the JSON-formatted metrics will be flushed.
MetricsFifo string `json:"metrics_fifo,omitempty"`
// 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"`
// Whether or not to include the file path and line number of the log's origin.
ShowLogOrigin bool `json:"show_log_origin,omitempty"`
}
// Validate validates this logger
func (m *Logger) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateLevel(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
var loggerTypeLevelPropEnum []interface{}
func init() {
var res []string
if err := json.Unmarshal([]byte(`["Error","Warning","Info","Debug"]`), &res); err != nil {
panic(err)
}
for _, v := range res {
loggerTypeLevelPropEnum = append(loggerTypeLevelPropEnum, v)
}
}
const (
// LoggerLevelError captures enum value "Error"
LoggerLevelError string = "Error"
// LoggerLevelWarning captures enum value "Warning"
LoggerLevelWarning string = "Warning"
// LoggerLevelInfo captures enum value "Info"
LoggerLevelInfo string = "Info"
// LoggerLevelDebug captures enum value "Debug"
LoggerLevelDebug string = "Debug"
)
// prop value enum
func (m *Logger) validateLevelEnum(path, location string, value string) error {
if err := validate.Enum(path, location, value, loggerTypeLevelPropEnum); err != nil {
return err
}
return nil
}
func (m *Logger) validateLevel(formats strfmt.Registry) error {
if swag.IsZero(m.Level) { // not required
return nil
}
// value enum
if err := m.validateLevelEnum("level", "body", m.Level); err != nil {
return err
}
return nil
}
// MarshalBinary interface implementation
func (m *Logger) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *Logger) UnmarshalBinary(b []byte) error {
var res Logger
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@ -1,91 +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 client_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"
)
// MachineConfiguration Describes the number of vCPUs, memory size, Hyperthreading capabilities and the CPU template.
// swagger:model MachineConfiguration
type MachineConfiguration struct {
// cpu template
CPUTemplate CPUTemplate `json:"cpu_template,omitempty"`
// Flag for enabling/disabling Hyperthreading
HtEnabled bool `json:"ht_enabled,omitempty"`
// Memory size of VM
MemSizeMib int64 `json:"mem_size_mib,omitempty"`
// Number of vCPUs (either 1 or an even number)
VcpuCount int64 `json:"vcpu_count,omitempty"`
}
// Validate validates this machine configuration
func (m *MachineConfiguration) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateCPUTemplate(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *MachineConfiguration) validateCPUTemplate(formats strfmt.Registry) error {
if swag.IsZero(m.CPUTemplate) { // not required
return nil
}
if err := m.CPUTemplate.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("cpu_template")
}
return err
}
return nil
}
// MarshalBinary interface implementation
func (m *MachineConfiguration) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *MachineConfiguration) UnmarshalBinary(b []byte) error {
var res MachineConfiguration
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@ -1,136 +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 client_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"
)
// NetworkInterface Defines a network interface.
// swagger:model NetworkInterface
type NetworkInterface struct {
// 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.
AllowMmdsRequests bool `json:"allow_mmds_requests,omitempty"`
// guest mac
GuestMac string `json:"guest_mac,omitempty"`
// Host level path for the guest network interface
HostDevName string `json:"host_dev_name,omitempty"`
// 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 network interface
func (m *NetworkInterface) 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 *NetworkInterface) validateIfaceID(formats strfmt.Registry) error {
if err := validate.Required("iface_id", "body", m.IfaceID); err != nil {
return err
}
return nil
}
func (m *NetworkInterface) 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 *NetworkInterface) 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 *NetworkInterface) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *NetworkInterface) UnmarshalBinary(b []byte) error {
var res NetworkInterface
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@ -1,94 +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 client_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"
)
// PartialDrive partial drive
// swagger:model PartialDrive
type PartialDrive struct {
// drive id
// Required: true
DriveID *string `json:"drive_id"`
// Host level path for the guest drive
// Required: true
PathOnHost *string `json:"path_on_host"`
}
// Validate validates this partial drive
func (m *PartialDrive) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateDriveID(formats); err != nil {
res = append(res, err)
}
if err := m.validatePathOnHost(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *PartialDrive) validateDriveID(formats strfmt.Registry) error {
if err := validate.Required("drive_id", "body", m.DriveID); err != nil {
return err
}
return nil
}
func (m *PartialDrive) validatePathOnHost(formats strfmt.Registry) error {
if err := validate.Required("path_on_host", "body", m.PathOnHost); err != nil {
return err
}
return nil
}
// MarshalBinary interface implementation
func (m *PartialDrive) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *PartialDrive) UnmarshalBinary(b []byte) error {
var res PartialDrive
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@ -1,109 +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 client_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"
)
// RateLimiter 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.
// swagger:model RateLimiter
type RateLimiter struct {
// Token bucket with bytes as tokens
Bandwidth *TokenBucket `json:"bandwidth,omitempty"`
// Token bucket with operations as tokens
Ops *TokenBucket `json:"ops,omitempty"`
}
// Validate validates this rate limiter
func (m *RateLimiter) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateBandwidth(formats); err != nil {
res = append(res, err)
}
if err := m.validateOps(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *RateLimiter) validateBandwidth(formats strfmt.Registry) error {
if swag.IsZero(m.Bandwidth) { // not required
return nil
}
if m.Bandwidth != nil {
if err := m.Bandwidth.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("bandwidth")
}
return err
}
}
return nil
}
func (m *RateLimiter) validateOps(formats strfmt.Registry) error {
if swag.IsZero(m.Ops) { // not required
return nil
}
if m.Ops != nil {
if err := m.Ops.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("ops")
}
return err
}
}
return nil
}
// MarshalBinary interface implementation
func (m *RateLimiter) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *RateLimiter) UnmarshalBinary(b []byte) error {
var res RateLimiter
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@ -1,123 +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 client_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"
)
// TokenBucket 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.
// swagger:model TokenBucket
type TokenBucket struct {
// The initial size of a token bucket.
// Minimum: 0
OneTimeBurst *int64 `json:"one_time_burst,omitempty"`
// The amount of milliseconds it takes for the bucket to refill.
// Minimum: 0
RefillTime *int64 `json:"refill_time,omitempty"`
// The total number of tokens this bucket can hold.
// Minimum: 0
Size *int64 `json:"size,omitempty"`
}
// Validate validates this token bucket
func (m *TokenBucket) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateOneTimeBurst(formats); err != nil {
res = append(res, err)
}
if err := m.validateRefillTime(formats); err != nil {
res = append(res, err)
}
if err := m.validateSize(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *TokenBucket) validateOneTimeBurst(formats strfmt.Registry) error {
if swag.IsZero(m.OneTimeBurst) { // not required
return nil
}
if err := validate.MinimumInt("one_time_burst", "body", int64(*m.OneTimeBurst), 0, false); err != nil {
return err
}
return nil
}
func (m *TokenBucket) validateRefillTime(formats strfmt.Registry) error {
if swag.IsZero(m.RefillTime) { // not required
return nil
}
if err := validate.MinimumInt("refill_time", "body", int64(*m.RefillTime), 0, false); err != nil {
return err
}
return nil
}
func (m *TokenBucket) validateSize(formats strfmt.Registry) error {
if swag.IsZero(m.Size) { // not required
return nil
}
if err := validate.MinimumInt("size", "body", int64(*m.Size), 0, false); err != nil {
return err
}
return nil
}
// MarshalBinary interface implementation
func (m *TokenBucket) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *TokenBucket) UnmarshalBinary(b []byte) error {
var res TokenBucket
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@ -1,98 +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 client_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"
)
// Vsock vsock
// swagger:model Vsock
type Vsock struct {
// Guest Vsock CID
// Minimum: 3
GuestCid int64 `json:"guest_cid,omitempty"`
// id
// Required: true
ID *string `json:"id"`
}
// Validate validates this vsock
func (m *Vsock) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateGuestCid(formats); err != nil {
res = append(res, err)
}
if err := m.validateID(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *Vsock) validateGuestCid(formats strfmt.Registry) error {
if swag.IsZero(m.GuestCid) { // not required
return nil
}
if err := validate.MinimumInt("guest_cid", "body", int64(m.GuestCid), 3, false); err != nil {
return err
}
return nil
}
func (m *Vsock) validateID(formats strfmt.Registry) error {
if err := validate.Required("id", "body", m.ID); err != nil {
return err
}
return nil
}
// MarshalBinary interface implementation
func (m *Vsock) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *Vsock) UnmarshalBinary(b []byte) error {
var res Vsock
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@ -1,150 +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"
client_models "github.com/firecracker-microvm/firecracker-go-sdk/client/models"
)
// NewCreateSyncActionParams creates a new CreateSyncActionParams object
// with the default values initialized.
func NewCreateSyncActionParams() *CreateSyncActionParams {
var ()
return &CreateSyncActionParams{
timeout: cr.DefaultTimeout,
}
}
// NewCreateSyncActionParamsWithTimeout creates a new CreateSyncActionParams object
// with the default values initialized, and the ability to set a timeout on a request
func NewCreateSyncActionParamsWithTimeout(timeout time.Duration) *CreateSyncActionParams {
var ()
return &CreateSyncActionParams{
timeout: timeout,
}
}
// NewCreateSyncActionParamsWithContext creates a new CreateSyncActionParams object
// with the default values initialized, and the ability to set a context for a request
func NewCreateSyncActionParamsWithContext(ctx context.Context) *CreateSyncActionParams {
var ()
return &CreateSyncActionParams{
Context: ctx,
}
}
// NewCreateSyncActionParamsWithHTTPClient creates a new CreateSyncActionParams object
// with the default values initialized, and the ability to set a custom HTTPClient for a request
func NewCreateSyncActionParamsWithHTTPClient(client *http.Client) *CreateSyncActionParams {
var ()
return &CreateSyncActionParams{
HTTPClient: client,
}
}
/*CreateSyncActionParams contains all the parameters to send to the API endpoint
for the create sync action operation typically these are written to a http.Request
*/
type CreateSyncActionParams struct {
/*Info*/
Info *client_models.InstanceActionInfo
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// WithTimeout adds the timeout to the create sync action params
func (o *CreateSyncActionParams) WithTimeout(timeout time.Duration) *CreateSyncActionParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the create sync action params
func (o *CreateSyncActionParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the create sync action params
func (o *CreateSyncActionParams) WithContext(ctx context.Context) *CreateSyncActionParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the create sync action params
func (o *CreateSyncActionParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the create sync action params
func (o *CreateSyncActionParams) WithHTTPClient(client *http.Client) *CreateSyncActionParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the create sync action params
func (o *CreateSyncActionParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithInfo adds the info to the create sync action params
func (o *CreateSyncActionParams) WithInfo(info *client_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) {
o.Info = info
}
// WriteToRequest writes these params to a swagger request
func (o *CreateSyncActionParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.timeout); err != nil {
return err
}
var res []error
if o.Info != nil {
if err := r.SetBodyParam(o.Info); err != nil {
return err
}
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}

View File

@ -1,153 +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"
)
// CreateSyncActionReader is a Reader for the CreateSyncAction structure.
type CreateSyncActionReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *CreateSyncActionReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 204:
result := NewCreateSyncActionNoContent()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 400:
result := NewCreateSyncActionBadRequest()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
default:
result := NewCreateSyncActionDefault(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
}
}
// NewCreateSyncActionNoContent creates a CreateSyncActionNoContent with default headers values
func NewCreateSyncActionNoContent() *CreateSyncActionNoContent {
return &CreateSyncActionNoContent{}
}
/*CreateSyncActionNoContent handles this case with default header values.
The update was successful
*/
type CreateSyncActionNoContent struct {
}
func (o *CreateSyncActionNoContent) Error() string {
return fmt.Sprintf("[PUT /actions][%d] createSyncActionNoContent ", 204)
}
func (o *CreateSyncActionNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
return nil
}
// NewCreateSyncActionBadRequest creates a CreateSyncActionBadRequest with default headers values
func NewCreateSyncActionBadRequest() *CreateSyncActionBadRequest {
return &CreateSyncActionBadRequest{}
}
/*CreateSyncActionBadRequest handles this case with default header values.
The action cannot be executed due to bad input
*/
type CreateSyncActionBadRequest struct {
Payload *client_models.Error
}
func (o *CreateSyncActionBadRequest) Error() string {
return fmt.Sprintf("[PUT /actions][%d] createSyncActionBadRequest %+v", 400, o.Payload)
}
func (o *CreateSyncActionBadRequest) 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
}
// NewCreateSyncActionDefault creates a CreateSyncActionDefault with default headers values
func NewCreateSyncActionDefault(code int) *CreateSyncActionDefault {
return &CreateSyncActionDefault{
_statusCode: code,
}
}
/*CreateSyncActionDefault handles this case with default header values.
Internal Server Error
*/
type CreateSyncActionDefault struct {
_statusCode int
Payload *client_models.Error
}
// Code gets the status code for the create sync action default response
func (o *CreateSyncActionDefault) Code() int {
return o._statusCode
}
func (o *CreateSyncActionDefault) Error() string {
return fmt.Sprintf("[PUT /actions][%d] createSyncAction default %+v", o._statusCode, o.Payload)
}
func (o *CreateSyncActionDefault) 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
}

View File

@ -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"
)
// NewDescribeInstanceParams creates a new DescribeInstanceParams object
// with the default values initialized.
func NewDescribeInstanceParams() *DescribeInstanceParams {
return &DescribeInstanceParams{
timeout: cr.DefaultTimeout,
}
}
// NewDescribeInstanceParamsWithTimeout creates a new DescribeInstanceParams object
// with the default values initialized, and the ability to set a timeout on a request
func NewDescribeInstanceParamsWithTimeout(timeout time.Duration) *DescribeInstanceParams {
return &DescribeInstanceParams{
timeout: timeout,
}
}
// NewDescribeInstanceParamsWithContext creates a new DescribeInstanceParams object
// with the default values initialized, and the ability to set a context for a request
func NewDescribeInstanceParamsWithContext(ctx context.Context) *DescribeInstanceParams {
return &DescribeInstanceParams{
Context: ctx,
}
}
// NewDescribeInstanceParamsWithHTTPClient creates a new DescribeInstanceParams object
// with the default values initialized, and the ability to set a custom HTTPClient for a request
func NewDescribeInstanceParamsWithHTTPClient(client *http.Client) *DescribeInstanceParams {
return &DescribeInstanceParams{
HTTPClient: client,
}
}
/*DescribeInstanceParams contains all the parameters to send to the API endpoint
for the describe instance operation typically these are written to a http.Request
*/
type DescribeInstanceParams struct {
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// WithTimeout adds the timeout to the describe instance params
func (o *DescribeInstanceParams) WithTimeout(timeout time.Duration) *DescribeInstanceParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the describe instance params
func (o *DescribeInstanceParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the describe instance params
func (o *DescribeInstanceParams) WithContext(ctx context.Context) *DescribeInstanceParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the describe instance params
func (o *DescribeInstanceParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the describe instance params
func (o *DescribeInstanceParams) WithHTTPClient(client *http.Client) *DescribeInstanceParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the describe instance params
func (o *DescribeInstanceParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WriteToRequest writes these params to a swagger request
func (o *DescribeInstanceParams) 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
}

View File

@ -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"
)
// DescribeInstanceReader is a Reader for the DescribeInstance structure.
type DescribeInstanceReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *DescribeInstanceReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewDescribeInstanceOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
default:
result := NewDescribeInstanceDefault(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
}
}
// NewDescribeInstanceOK creates a DescribeInstanceOK with default headers values
func NewDescribeInstanceOK() *DescribeInstanceOK {
return &DescribeInstanceOK{}
}
/*DescribeInstanceOK handles this case with default header values.
The instance information
*/
type DescribeInstanceOK struct {
Payload *client_models.InstanceInfo
}
func (o *DescribeInstanceOK) Error() string {
return fmt.Sprintf("[GET /][%d] describeInstanceOK %+v", 200, o.Payload)
}
func (o *DescribeInstanceOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(client_models.InstanceInfo)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewDescribeInstanceDefault creates a DescribeInstanceDefault with default headers values
func NewDescribeInstanceDefault(code int) *DescribeInstanceDefault {
return &DescribeInstanceDefault{
_statusCode: code,
}
}
/*DescribeInstanceDefault handles this case with default header values.
Internal Server Error
*/
type DescribeInstanceDefault struct {
_statusCode int
Payload *client_models.Error
}
// Code gets the status code for the describe instance default response
func (o *DescribeInstanceDefault) Code() int {
return o._statusCode
}
func (o *DescribeInstanceDefault) Error() string {
return fmt.Sprintf("[GET /][%d] describeInstance default %+v", o._statusCode, o.Payload)
}
func (o *DescribeInstanceDefault) 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
}

View File

@ -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
}

View File

@ -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
}

View File

@ -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"
)
// NewGetMmdsParams creates a new GetMmdsParams object
// with the default values initialized.
func NewGetMmdsParams() *GetMmdsParams {
return &GetMmdsParams{
timeout: cr.DefaultTimeout,
}
}
// NewGetMmdsParamsWithTimeout creates a new GetMmdsParams object
// with the default values initialized, and the ability to set a timeout on a request
func NewGetMmdsParamsWithTimeout(timeout time.Duration) *GetMmdsParams {
return &GetMmdsParams{
timeout: timeout,
}
}
// NewGetMmdsParamsWithContext creates a new GetMmdsParams object
// with the default values initialized, and the ability to set a context for a request
func NewGetMmdsParamsWithContext(ctx context.Context) *GetMmdsParams {
return &GetMmdsParams{
Context: ctx,
}
}
// NewGetMmdsParamsWithHTTPClient creates a new GetMmdsParams object
// with the default values initialized, and the ability to set a custom HTTPClient for a request
func NewGetMmdsParamsWithHTTPClient(client *http.Client) *GetMmdsParams {
return &GetMmdsParams{
HTTPClient: client,
}
}
/*GetMmdsParams contains all the parameters to send to the API endpoint
for the get mmds operation typically these are written to a http.Request
*/
type GetMmdsParams struct {
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// WithTimeout adds the timeout to the get mmds params
func (o *GetMmdsParams) WithTimeout(timeout time.Duration) *GetMmdsParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the get mmds params
func (o *GetMmdsParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the get mmds params
func (o *GetMmdsParams) WithContext(ctx context.Context) *GetMmdsParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the get mmds params
func (o *GetMmdsParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the get mmds params
func (o *GetMmdsParams) WithHTTPClient(client *http.Client) *GetMmdsParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the get mmds params
func (o *GetMmdsParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WriteToRequest writes these params to a swagger request
func (o *GetMmdsParams) 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
}

View File

@ -1,159 +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"
)
// GetMmdsReader is a Reader for the GetMmds structure.
type GetMmdsReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *GetMmdsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewGetMmdsOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 400:
result := NewGetMmdsBadRequest()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
default:
result := NewGetMmdsDefault(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
}
}
// NewGetMmdsOK creates a GetMmdsOK with default headers values
func NewGetMmdsOK() *GetMmdsOK {
return &GetMmdsOK{}
}
/*GetMmdsOK handles this case with default header values.
The MMDS data store JSON.
*/
type GetMmdsOK struct {
Payload interface{}
}
func (o *GetMmdsOK) Error() string {
return fmt.Sprintf("[GET /mmds][%d] getMmdsOK %+v", 200, o.Payload)
}
func (o *GetMmdsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// response payload
if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewGetMmdsBadRequest creates a GetMmdsBadRequest with default headers values
func NewGetMmdsBadRequest() *GetMmdsBadRequest {
return &GetMmdsBadRequest{}
}
/*GetMmdsBadRequest handles this case with default header values.
Cannot get the MMDS data store due to bad input.
*/
type GetMmdsBadRequest struct {
Payload *client_models.Error
}
func (o *GetMmdsBadRequest) Error() string {
return fmt.Sprintf("[GET /mmds][%d] getMmdsBadRequest %+v", 400, o.Payload)
}
func (o *GetMmdsBadRequest) 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
}
// NewGetMmdsDefault creates a GetMmdsDefault with default headers values
func NewGetMmdsDefault(code int) *GetMmdsDefault {
return &GetMmdsDefault{
_statusCode: code,
}
}
/*GetMmdsDefault handles this case with default header values.
Internal server error
*/
type GetMmdsDefault struct {
_statusCode int
Payload *client_models.Error
}
// Code gets the status code for the get mmds default response
func (o *GetMmdsDefault) Code() int {
return o._statusCode
}
func (o *GetMmdsDefault) Error() string {
return fmt.Sprintf("[GET /mmds][%d] GetMmds default %+v", o._statusCode, o.Payload)
}
func (o *GetMmdsDefault) 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
}

View File

@ -1,427 +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 (
"github.com/go-openapi/runtime"
strfmt "github.com/go-openapi/strfmt"
)
// New creates a new operations API client.
func New(transport runtime.ClientTransport, formats strfmt.Registry) *Client {
return &Client{transport: transport, formats: formats}
}
/*
Client for operations API
*/
type Client struct {
transport runtime.ClientTransport
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
*/
func (a *Client) GetMmds(params *GetMmdsParams) (*GetMmdsOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewGetMmdsParams()
}
result, err := a.transport.Submit(&runtime.ClientOperation{
ID: "GetMmds",
Method: "GET",
PathPattern: "/mmds",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http"},
Params: params,
Reader: &GetMmdsReader{formats: a.formats},
Context: params.Context,
Client: params.HTTPClient,
})
if err != nil {
return nil, err
}
return result.(*GetMmdsOK), nil
}
/*
PatchMmds updates the m m d s data store
*/
func (a *Client) PatchMmds(params *PatchMmdsParams) (*PatchMmdsNoContent, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewPatchMmdsParams()
}
result, err := a.transport.Submit(&runtime.ClientOperation{
ID: "PatchMmds",
Method: "PATCH",
PathPattern: "/mmds",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http"},
Params: params,
Reader: &PatchMmdsReader{formats: a.formats},
Context: params.Context,
Client: params.HTTPClient,
})
if err != nil {
return nil, err
}
return result.(*PatchMmdsNoContent), nil
}
/*
PutMmds creates a m m d s microvm metadata service data store
*/
func (a *Client) PutMmds(params *PutMmdsParams) (*PutMmdsNoContent, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewPutMmdsParams()
}
result, err := a.transport.Submit(&runtime.ClientOperation{
ID: "PutMmds",
Method: "PUT",
PathPattern: "/mmds",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http"},
Params: params,
Reader: &PutMmdsReader{formats: a.formats},
Context: params.Context,
Client: params.HTTPClient,
})
if err != nil {
return nil, err
}
return result.(*PutMmdsNoContent), nil
}
/*
CreateSyncAction creates a synchronous action
*/
func (a *Client) CreateSyncAction(params *CreateSyncActionParams) (*CreateSyncActionNoContent, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewCreateSyncActionParams()
}
result, err := a.transport.Submit(&runtime.ClientOperation{
ID: "createSyncAction",
Method: "PUT",
PathPattern: "/actions",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http"},
Params: params,
Reader: &CreateSyncActionReader{formats: a.formats},
Context: params.Context,
Client: params.HTTPClient,
})
if err != nil {
return nil, err
}
return result.(*CreateSyncActionNoContent), nil
}
/*
DescribeInstance returns general information about an instance
*/
func (a *Client) DescribeInstance(params *DescribeInstanceParams) (*DescribeInstanceOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewDescribeInstanceParams()
}
result, err := a.transport.Submit(&runtime.ClientOperation{
ID: "describeInstance",
Method: "GET",
PathPattern: "/",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http"},
Params: params,
Reader: &DescribeInstanceReader{formats: a.formats},
Context: params.Context,
Client: params.HTTPClient,
})
if err != nil {
return nil, err
}
return result.(*DescribeInstanceOK), nil
}
/*
PatchGuestDriveByID updates the properties of a drive
Updates the properties of the drive with the ID specified by drive_id path parameter. Will fail if update is not possible.
*/
func (a *Client) PatchGuestDriveByID(params *PatchGuestDriveByIDParams) (*PatchGuestDriveByIDNoContent, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewPatchGuestDriveByIDParams()
}
result, err := a.transport.Submit(&runtime.ClientOperation{
ID: "patchGuestDriveByID",
Method: "PATCH",
PathPattern: "/drives/{drive_id}",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http"},
Params: params,
Reader: &PatchGuestDriveByIDReader{formats: a.formats},
Context: params.Context,
Client: params.HTTPClient,
})
if err != nil {
return nil, err
}
return result.(*PatchGuestDriveByIDNoContent), nil
}
/*
PutGuestBootSource creates or updates the boot source
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.
*/
func (a *Client) PutGuestBootSource(params *PutGuestBootSourceParams) (*PutGuestBootSourceNoContent, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewPutGuestBootSourceParams()
}
result, err := a.transport.Submit(&runtime.ClientOperation{
ID: "putGuestBootSource",
Method: "PUT",
PathPattern: "/boot-source",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http"},
Params: params,
Reader: &PutGuestBootSourceReader{formats: a.formats},
Context: params.Context,
Client: params.HTTPClient,
})
if err != nil {
return nil, err
}
return result.(*PutGuestBootSourceNoContent), nil
}
/*
PutGuestDriveByID creates or updates a drive
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.
*/
func (a *Client) PutGuestDriveByID(params *PutGuestDriveByIDParams) (*PutGuestDriveByIDNoContent, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewPutGuestDriveByIDParams()
}
result, err := a.transport.Submit(&runtime.ClientOperation{
ID: "putGuestDriveByID",
Method: "PUT",
PathPattern: "/drives/{drive_id}",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http"},
Params: params,
Reader: &PutGuestDriveByIDReader{formats: a.formats},
Context: params.Context,
Client: params.HTTPClient,
})
if err != nil {
return nil, err
}
return result.(*PutGuestDriveByIDNoContent), nil
}
/*
PutGuestNetworkInterfaceByID creates a network interface
Creates new network interface with ID specified by iface_id path parameter. Updating existing interfaces is currently not allowed.
*/
func (a *Client) PutGuestNetworkInterfaceByID(params *PutGuestNetworkInterfaceByIDParams) (*PutGuestNetworkInterfaceByIDNoContent, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewPutGuestNetworkInterfaceByIDParams()
}
result, err := a.transport.Submit(&runtime.ClientOperation{
ID: "putGuestNetworkInterfaceByID",
Method: "PUT",
PathPattern: "/network-interfaces/{iface_id}",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http"},
Params: params,
Reader: &PutGuestNetworkInterfaceByIDReader{formats: a.formats},
Context: params.Context,
Client: params.HTTPClient,
})
if err != nil {
return nil, err
}
return result.(*PutGuestNetworkInterfaceByIDNoContent), nil
}
/*
PutGuestVsockByID creates new vsock with ID specified by the id parameter
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.
*/
func (a *Client) PutGuestVsockByID(params *PutGuestVsockByIDParams) (*PutGuestVsockByIDCreated, *PutGuestVsockByIDNoContent, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewPutGuestVsockByIDParams()
}
result, err := a.transport.Submit(&runtime.ClientOperation{
ID: "putGuestVsockByID",
Method: "PUT",
PathPattern: "/vsocks/{id}",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http"},
Params: params,
Reader: &PutGuestVsockByIDReader{formats: a.formats},
Context: params.Context,
Client: params.HTTPClient,
})
if err != nil {
return nil, nil, err
}
switch value := result.(type) {
case *PutGuestVsockByIDCreated:
return value, nil, nil
case *PutGuestVsockByIDNoContent:
return nil, value, nil
}
return nil, nil, nil
}
/*
PutLogger initializes the logger by specifying two named pipes i e for the logs and metrics output
*/
func (a *Client) PutLogger(params *PutLoggerParams) (*PutLoggerNoContent, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewPutLoggerParams()
}
result, err := a.transport.Submit(&runtime.ClientOperation{
ID: "putLogger",
Method: "PUT",
PathPattern: "/logger",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http"},
Params: params,
Reader: &PutLoggerReader{formats: a.formats},
Context: params.Context,
Client: params.HTTPClient,
})
if err != nil {
return nil, err
}
return result.(*PutLoggerNoContent), nil
}
/*
PutMachineConfiguration updates the machine configuration of the VM
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.
*/
func (a *Client) PutMachineConfiguration(params *PutMachineConfigurationParams) (*PutMachineConfigurationNoContent, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewPutMachineConfigurationParams()
}
result, err := a.transport.Submit(&runtime.ClientOperation{
ID: "putMachineConfiguration",
Method: "PUT",
PathPattern: "/machine-config",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http"},
Params: params,
Reader: &PutMachineConfigurationReader{formats: a.formats},
Context: params.Context,
Client: params.HTTPClient,
})
if err != nil {
return nil, err
}
return result.(*PutMachineConfigurationNoContent), nil
}
// SetTransport changes the transport on the client
func (a *Client) SetTransport(transport runtime.ClientTransport) {
a.transport = transport
}

View File

@ -1,174 +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"
client_models "github.com/firecracker-microvm/firecracker-go-sdk/client/models"
)
// NewPatchGuestDriveByIDParams creates a new PatchGuestDriveByIDParams object
// with the default values initialized.
func NewPatchGuestDriveByIDParams() *PatchGuestDriveByIDParams {
var ()
return &PatchGuestDriveByIDParams{
timeout: cr.DefaultTimeout,
}
}
// NewPatchGuestDriveByIDParamsWithTimeout creates a new PatchGuestDriveByIDParams object
// with the default values initialized, and the ability to set a timeout on a request
func NewPatchGuestDriveByIDParamsWithTimeout(timeout time.Duration) *PatchGuestDriveByIDParams {
var ()
return &PatchGuestDriveByIDParams{
timeout: timeout,
}
}
// NewPatchGuestDriveByIDParamsWithContext creates a new PatchGuestDriveByIDParams object
// with the default values initialized, and the ability to set a context for a request
func NewPatchGuestDriveByIDParamsWithContext(ctx context.Context) *PatchGuestDriveByIDParams {
var ()
return &PatchGuestDriveByIDParams{
Context: ctx,
}
}
// NewPatchGuestDriveByIDParamsWithHTTPClient creates a new PatchGuestDriveByIDParams object
// with the default values initialized, and the ability to set a custom HTTPClient for a request
func NewPatchGuestDriveByIDParamsWithHTTPClient(client *http.Client) *PatchGuestDriveByIDParams {
var ()
return &PatchGuestDriveByIDParams{
HTTPClient: client,
}
}
/*PatchGuestDriveByIDParams contains all the parameters to send to the API endpoint
for the patch guest drive by ID operation typically these are written to a http.Request
*/
type PatchGuestDriveByIDParams struct {
/*Body
Guest drive properties
*/
Body *client_models.PartialDrive
/*DriveID
The id of the guest drive
*/
DriveID string
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// WithTimeout adds the timeout to the patch guest drive by ID params
func (o *PatchGuestDriveByIDParams) WithTimeout(timeout time.Duration) *PatchGuestDriveByIDParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the patch guest drive by ID params
func (o *PatchGuestDriveByIDParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the patch guest drive by ID params
func (o *PatchGuestDriveByIDParams) WithContext(ctx context.Context) *PatchGuestDriveByIDParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the patch guest drive by ID params
func (o *PatchGuestDriveByIDParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the patch guest drive by ID params
func (o *PatchGuestDriveByIDParams) WithHTTPClient(client *http.Client) *PatchGuestDriveByIDParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the patch guest drive by ID params
func (o *PatchGuestDriveByIDParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithBody adds the body to the patch guest drive by ID params
func (o *PatchGuestDriveByIDParams) WithBody(body *client_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) {
o.Body = body
}
// WithDriveID adds the driveID to the patch guest drive by ID params
func (o *PatchGuestDriveByIDParams) WithDriveID(driveID string) *PatchGuestDriveByIDParams {
o.SetDriveID(driveID)
return o
}
// SetDriveID adds the driveId to the patch guest drive by ID params
func (o *PatchGuestDriveByIDParams) SetDriveID(driveID string) {
o.DriveID = driveID
}
// WriteToRequest writes these params to a swagger request
func (o *PatchGuestDriveByIDParams) 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 drive_id
if err := r.SetPathParam("drive_id", o.DriveID); err != nil {
return err
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}

View File

@ -1,153 +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"
)
// PatchGuestDriveByIDReader is a Reader for the PatchGuestDriveByID structure.
type PatchGuestDriveByIDReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *PatchGuestDriveByIDReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 204:
result := NewPatchGuestDriveByIDNoContent()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 400:
result := NewPatchGuestDriveByIDBadRequest()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
default:
result := NewPatchGuestDriveByIDDefault(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
}
}
// NewPatchGuestDriveByIDNoContent creates a PatchGuestDriveByIDNoContent with default headers values
func NewPatchGuestDriveByIDNoContent() *PatchGuestDriveByIDNoContent {
return &PatchGuestDriveByIDNoContent{}
}
/*PatchGuestDriveByIDNoContent handles this case with default header values.
Drive updated
*/
type PatchGuestDriveByIDNoContent struct {
}
func (o *PatchGuestDriveByIDNoContent) Error() string {
return fmt.Sprintf("[PATCH /drives/{drive_id}][%d] patchGuestDriveByIdNoContent ", 204)
}
func (o *PatchGuestDriveByIDNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
return nil
}
// NewPatchGuestDriveByIDBadRequest creates a PatchGuestDriveByIDBadRequest with default headers values
func NewPatchGuestDriveByIDBadRequest() *PatchGuestDriveByIDBadRequest {
return &PatchGuestDriveByIDBadRequest{}
}
/*PatchGuestDriveByIDBadRequest handles this case with default header values.
Drive cannot be updated due to bad input
*/
type PatchGuestDriveByIDBadRequest struct {
Payload *client_models.Error
}
func (o *PatchGuestDriveByIDBadRequest) Error() string {
return fmt.Sprintf("[PATCH /drives/{drive_id}][%d] patchGuestDriveByIdBadRequest %+v", 400, o.Payload)
}
func (o *PatchGuestDriveByIDBadRequest) 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
}
// NewPatchGuestDriveByIDDefault creates a PatchGuestDriveByIDDefault with default headers values
func NewPatchGuestDriveByIDDefault(code int) *PatchGuestDriveByIDDefault {
return &PatchGuestDriveByIDDefault{
_statusCode: code,
}
}
/*PatchGuestDriveByIDDefault handles this case with default header values.
Internal server error.
*/
type PatchGuestDriveByIDDefault struct {
_statusCode int
Payload *client_models.Error
}
// Code gets the status code for the patch guest drive by ID default response
func (o *PatchGuestDriveByIDDefault) Code() int {
return o._statusCode
}
func (o *PatchGuestDriveByIDDefault) Error() string {
return fmt.Sprintf("[PATCH /drives/{drive_id}][%d] patchGuestDriveByID default %+v", o._statusCode, o.Payload)
}
func (o *PatchGuestDriveByIDDefault) 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
}

View File

@ -1,151 +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"
)
// NewPatchMmdsParams creates a new PatchMmdsParams object
// with the default values initialized.
func NewPatchMmdsParams() *PatchMmdsParams {
var ()
return &PatchMmdsParams{
timeout: cr.DefaultTimeout,
}
}
// NewPatchMmdsParamsWithTimeout creates a new PatchMmdsParams object
// with the default values initialized, and the ability to set a timeout on a request
func NewPatchMmdsParamsWithTimeout(timeout time.Duration) *PatchMmdsParams {
var ()
return &PatchMmdsParams{
timeout: timeout,
}
}
// NewPatchMmdsParamsWithContext creates a new PatchMmdsParams object
// with the default values initialized, and the ability to set a context for a request
func NewPatchMmdsParamsWithContext(ctx context.Context) *PatchMmdsParams {
var ()
return &PatchMmdsParams{
Context: ctx,
}
}
// NewPatchMmdsParamsWithHTTPClient creates a new PatchMmdsParams object
// with the default values initialized, and the ability to set a custom HTTPClient for a request
func NewPatchMmdsParamsWithHTTPClient(client *http.Client) *PatchMmdsParams {
var ()
return &PatchMmdsParams{
HTTPClient: client,
}
}
/*PatchMmdsParams contains all the parameters to send to the API endpoint
for the patch mmds operation typically these are written to a http.Request
*/
type PatchMmdsParams struct {
/*Body
The MMDS data store patch JSON.
*/
Body interface{}
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// WithTimeout adds the timeout to the patch mmds params
func (o *PatchMmdsParams) WithTimeout(timeout time.Duration) *PatchMmdsParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the patch mmds params
func (o *PatchMmdsParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the patch mmds params
func (o *PatchMmdsParams) WithContext(ctx context.Context) *PatchMmdsParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the patch mmds params
func (o *PatchMmdsParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the patch mmds params
func (o *PatchMmdsParams) WithHTTPClient(client *http.Client) *PatchMmdsParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the patch mmds params
func (o *PatchMmdsParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithBody adds the body to the patch mmds params
func (o *PatchMmdsParams) WithBody(body interface{}) *PatchMmdsParams {
o.SetBody(body)
return o
}
// SetBody adds the body to the patch mmds params
func (o *PatchMmdsParams) SetBody(body interface{}) {
o.Body = body
}
// WriteToRequest writes these params to a swagger request
func (o *PatchMmdsParams) 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
}

View File

@ -1,153 +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"
)
// PatchMmdsReader is a Reader for the PatchMmds structure.
type PatchMmdsReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *PatchMmdsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 204:
result := NewPatchMmdsNoContent()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 400:
result := NewPatchMmdsBadRequest()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
default:
result := NewPatchMmdsDefault(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
}
}
// NewPatchMmdsNoContent creates a PatchMmdsNoContent with default headers values
func NewPatchMmdsNoContent() *PatchMmdsNoContent {
return &PatchMmdsNoContent{}
}
/*PatchMmdsNoContent handles this case with default header values.
MMDS data store updated.
*/
type PatchMmdsNoContent struct {
}
func (o *PatchMmdsNoContent) Error() string {
return fmt.Sprintf("[PATCH /mmds][%d] patchMmdsNoContent ", 204)
}
func (o *PatchMmdsNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
return nil
}
// NewPatchMmdsBadRequest creates a PatchMmdsBadRequest with default headers values
func NewPatchMmdsBadRequest() *PatchMmdsBadRequest {
return &PatchMmdsBadRequest{}
}
/*PatchMmdsBadRequest handles this case with default header values.
MMDS data store cannot be updated due to bad input.
*/
type PatchMmdsBadRequest struct {
Payload *client_models.Error
}
func (o *PatchMmdsBadRequest) Error() string {
return fmt.Sprintf("[PATCH /mmds][%d] patchMmdsBadRequest %+v", 400, o.Payload)
}
func (o *PatchMmdsBadRequest) 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
}
// NewPatchMmdsDefault creates a PatchMmdsDefault with default headers values
func NewPatchMmdsDefault(code int) *PatchMmdsDefault {
return &PatchMmdsDefault{
_statusCode: code,
}
}
/*PatchMmdsDefault handles this case with default header values.
Internal server error
*/
type PatchMmdsDefault struct {
_statusCode int
Payload *client_models.Error
}
// Code gets the status code for the patch mmds default response
func (o *PatchMmdsDefault) Code() int {
return o._statusCode
}
func (o *PatchMmdsDefault) Error() string {
return fmt.Sprintf("[PATCH /mmds][%d] PatchMmds default %+v", o._statusCode, o.Payload)
}
func (o *PatchMmdsDefault) 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
}

View File

@ -1,153 +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"
client_models "github.com/firecracker-microvm/firecracker-go-sdk/client/models"
)
// NewPutGuestBootSourceParams creates a new PutGuestBootSourceParams object
// with the default values initialized.
func NewPutGuestBootSourceParams() *PutGuestBootSourceParams {
var ()
return &PutGuestBootSourceParams{
timeout: cr.DefaultTimeout,
}
}
// NewPutGuestBootSourceParamsWithTimeout creates a new PutGuestBootSourceParams object
// with the default values initialized, and the ability to set a timeout on a request
func NewPutGuestBootSourceParamsWithTimeout(timeout time.Duration) *PutGuestBootSourceParams {
var ()
return &PutGuestBootSourceParams{
timeout: timeout,
}
}
// NewPutGuestBootSourceParamsWithContext creates a new PutGuestBootSourceParams object
// with the default values initialized, and the ability to set a context for a request
func NewPutGuestBootSourceParamsWithContext(ctx context.Context) *PutGuestBootSourceParams {
var ()
return &PutGuestBootSourceParams{
Context: ctx,
}
}
// NewPutGuestBootSourceParamsWithHTTPClient creates a new PutGuestBootSourceParams object
// with the default values initialized, and the ability to set a custom HTTPClient for a request
func NewPutGuestBootSourceParamsWithHTTPClient(client *http.Client) *PutGuestBootSourceParams {
var ()
return &PutGuestBootSourceParams{
HTTPClient: client,
}
}
/*PutGuestBootSourceParams contains all the parameters to send to the API endpoint
for the put guest boot source operation typically these are written to a http.Request
*/
type PutGuestBootSourceParams struct {
/*Body
Guest boot source properties
*/
Body *client_models.BootSource
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// WithTimeout adds the timeout to the put guest boot source params
func (o *PutGuestBootSourceParams) WithTimeout(timeout time.Duration) *PutGuestBootSourceParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the put guest boot source params
func (o *PutGuestBootSourceParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the put guest boot source params
func (o *PutGuestBootSourceParams) WithContext(ctx context.Context) *PutGuestBootSourceParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the put guest boot source params
func (o *PutGuestBootSourceParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the put guest boot source params
func (o *PutGuestBootSourceParams) WithHTTPClient(client *http.Client) *PutGuestBootSourceParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the put guest boot source params
func (o *PutGuestBootSourceParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithBody adds the body to the put guest boot source params
func (o *PutGuestBootSourceParams) WithBody(body *client_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) {
o.Body = body
}
// WriteToRequest writes these params to a swagger request
func (o *PutGuestBootSourceParams) 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
}

View File

@ -1,153 +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"
)
// PutGuestBootSourceReader is a Reader for the PutGuestBootSource structure.
type PutGuestBootSourceReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *PutGuestBootSourceReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 204:
result := NewPutGuestBootSourceNoContent()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 400:
result := NewPutGuestBootSourceBadRequest()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
default:
result := NewPutGuestBootSourceDefault(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
}
}
// NewPutGuestBootSourceNoContent creates a PutGuestBootSourceNoContent with default headers values
func NewPutGuestBootSourceNoContent() *PutGuestBootSourceNoContent {
return &PutGuestBootSourceNoContent{}
}
/*PutGuestBootSourceNoContent handles this case with default header values.
Boot source created/updated
*/
type PutGuestBootSourceNoContent struct {
}
func (o *PutGuestBootSourceNoContent) Error() string {
return fmt.Sprintf("[PUT /boot-source][%d] putGuestBootSourceNoContent ", 204)
}
func (o *PutGuestBootSourceNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
return nil
}
// NewPutGuestBootSourceBadRequest creates a PutGuestBootSourceBadRequest with default headers values
func NewPutGuestBootSourceBadRequest() *PutGuestBootSourceBadRequest {
return &PutGuestBootSourceBadRequest{}
}
/*PutGuestBootSourceBadRequest handles this case with default header values.
Boot source cannot be created due to bad input
*/
type PutGuestBootSourceBadRequest struct {
Payload *client_models.Error
}
func (o *PutGuestBootSourceBadRequest) Error() string {
return fmt.Sprintf("[PUT /boot-source][%d] putGuestBootSourceBadRequest %+v", 400, o.Payload)
}
func (o *PutGuestBootSourceBadRequest) 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
}
// NewPutGuestBootSourceDefault creates a PutGuestBootSourceDefault with default headers values
func NewPutGuestBootSourceDefault(code int) *PutGuestBootSourceDefault {
return &PutGuestBootSourceDefault{
_statusCode: code,
}
}
/*PutGuestBootSourceDefault handles this case with default header values.
Internal server error
*/
type PutGuestBootSourceDefault struct {
_statusCode int
Payload *client_models.Error
}
// Code gets the status code for the put guest boot source default response
func (o *PutGuestBootSourceDefault) Code() int {
return o._statusCode
}
func (o *PutGuestBootSourceDefault) Error() string {
return fmt.Sprintf("[PUT /boot-source][%d] putGuestBootSource default %+v", o._statusCode, o.Payload)
}
func (o *PutGuestBootSourceDefault) 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
}

View File

@ -1,174 +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"
client_models "github.com/firecracker-microvm/firecracker-go-sdk/client/models"
)
// NewPutGuestDriveByIDParams creates a new PutGuestDriveByIDParams object
// with the default values initialized.
func NewPutGuestDriveByIDParams() *PutGuestDriveByIDParams {
var ()
return &PutGuestDriveByIDParams{
timeout: cr.DefaultTimeout,
}
}
// NewPutGuestDriveByIDParamsWithTimeout creates a new PutGuestDriveByIDParams object
// with the default values initialized, and the ability to set a timeout on a request
func NewPutGuestDriveByIDParamsWithTimeout(timeout time.Duration) *PutGuestDriveByIDParams {
var ()
return &PutGuestDriveByIDParams{
timeout: timeout,
}
}
// NewPutGuestDriveByIDParamsWithContext creates a new PutGuestDriveByIDParams object
// with the default values initialized, and the ability to set a context for a request
func NewPutGuestDriveByIDParamsWithContext(ctx context.Context) *PutGuestDriveByIDParams {
var ()
return &PutGuestDriveByIDParams{
Context: ctx,
}
}
// NewPutGuestDriveByIDParamsWithHTTPClient creates a new PutGuestDriveByIDParams object
// with the default values initialized, and the ability to set a custom HTTPClient for a request
func NewPutGuestDriveByIDParamsWithHTTPClient(client *http.Client) *PutGuestDriveByIDParams {
var ()
return &PutGuestDriveByIDParams{
HTTPClient: client,
}
}
/*PutGuestDriveByIDParams contains all the parameters to send to the API endpoint
for the put guest drive by ID operation typically these are written to a http.Request
*/
type PutGuestDriveByIDParams struct {
/*Body
Guest drive properties
*/
Body *client_models.Drive
/*DriveID
The id of the guest drive
*/
DriveID string
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// WithTimeout adds the timeout to the put guest drive by ID params
func (o *PutGuestDriveByIDParams) WithTimeout(timeout time.Duration) *PutGuestDriveByIDParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the put guest drive by ID params
func (o *PutGuestDriveByIDParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the put guest drive by ID params
func (o *PutGuestDriveByIDParams) WithContext(ctx context.Context) *PutGuestDriveByIDParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the put guest drive by ID params
func (o *PutGuestDriveByIDParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the put guest drive by ID params
func (o *PutGuestDriveByIDParams) WithHTTPClient(client *http.Client) *PutGuestDriveByIDParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the put guest drive by ID params
func (o *PutGuestDriveByIDParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithBody adds the body to the put guest drive by ID params
func (o *PutGuestDriveByIDParams) WithBody(body *client_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) {
o.Body = body
}
// WithDriveID adds the driveID to the put guest drive by ID params
func (o *PutGuestDriveByIDParams) WithDriveID(driveID string) *PutGuestDriveByIDParams {
o.SetDriveID(driveID)
return o
}
// SetDriveID adds the driveId to the put guest drive by ID params
func (o *PutGuestDriveByIDParams) SetDriveID(driveID string) {
o.DriveID = driveID
}
// WriteToRequest writes these params to a swagger request
func (o *PutGuestDriveByIDParams) 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 drive_id
if err := r.SetPathParam("drive_id", o.DriveID); err != nil {
return err
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}

View File

@ -1,153 +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"
)
// PutGuestDriveByIDReader is a Reader for the PutGuestDriveByID structure.
type PutGuestDriveByIDReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *PutGuestDriveByIDReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 204:
result := NewPutGuestDriveByIDNoContent()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 400:
result := NewPutGuestDriveByIDBadRequest()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
default:
result := NewPutGuestDriveByIDDefault(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
}
}
// NewPutGuestDriveByIDNoContent creates a PutGuestDriveByIDNoContent with default headers values
func NewPutGuestDriveByIDNoContent() *PutGuestDriveByIDNoContent {
return &PutGuestDriveByIDNoContent{}
}
/*PutGuestDriveByIDNoContent handles this case with default header values.
Drive created/updated
*/
type PutGuestDriveByIDNoContent struct {
}
func (o *PutGuestDriveByIDNoContent) Error() string {
return fmt.Sprintf("[PUT /drives/{drive_id}][%d] putGuestDriveByIdNoContent ", 204)
}
func (o *PutGuestDriveByIDNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
return nil
}
// NewPutGuestDriveByIDBadRequest creates a PutGuestDriveByIDBadRequest with default headers values
func NewPutGuestDriveByIDBadRequest() *PutGuestDriveByIDBadRequest {
return &PutGuestDriveByIDBadRequest{}
}
/*PutGuestDriveByIDBadRequest handles this case with default header values.
Drive cannot be created/updated due to bad input
*/
type PutGuestDriveByIDBadRequest struct {
Payload *client_models.Error
}
func (o *PutGuestDriveByIDBadRequest) Error() string {
return fmt.Sprintf("[PUT /drives/{drive_id}][%d] putGuestDriveByIdBadRequest %+v", 400, o.Payload)
}
func (o *PutGuestDriveByIDBadRequest) 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
}
// NewPutGuestDriveByIDDefault creates a PutGuestDriveByIDDefault with default headers values
func NewPutGuestDriveByIDDefault(code int) *PutGuestDriveByIDDefault {
return &PutGuestDriveByIDDefault{
_statusCode: code,
}
}
/*PutGuestDriveByIDDefault handles this case with default header values.
Internal server error.
*/
type PutGuestDriveByIDDefault struct {
_statusCode int
Payload *client_models.Error
}
// Code gets the status code for the put guest drive by ID default response
func (o *PutGuestDriveByIDDefault) Code() int {
return o._statusCode
}
func (o *PutGuestDriveByIDDefault) Error() string {
return fmt.Sprintf("[PUT /drives/{drive_id}][%d] putGuestDriveByID default %+v", o._statusCode, o.Payload)
}
func (o *PutGuestDriveByIDDefault) 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
}

View File

@ -1,174 +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"
client_models "github.com/firecracker-microvm/firecracker-go-sdk/client/models"
)
// NewPutGuestNetworkInterfaceByIDParams creates a new PutGuestNetworkInterfaceByIDParams object
// with the default values initialized.
func NewPutGuestNetworkInterfaceByIDParams() *PutGuestNetworkInterfaceByIDParams {
var ()
return &PutGuestNetworkInterfaceByIDParams{
timeout: cr.DefaultTimeout,
}
}
// NewPutGuestNetworkInterfaceByIDParamsWithTimeout creates a new PutGuestNetworkInterfaceByIDParams object
// with the default values initialized, and the ability to set a timeout on a request
func NewPutGuestNetworkInterfaceByIDParamsWithTimeout(timeout time.Duration) *PutGuestNetworkInterfaceByIDParams {
var ()
return &PutGuestNetworkInterfaceByIDParams{
timeout: timeout,
}
}
// NewPutGuestNetworkInterfaceByIDParamsWithContext creates a new PutGuestNetworkInterfaceByIDParams object
// with the default values initialized, and the ability to set a context for a request
func NewPutGuestNetworkInterfaceByIDParamsWithContext(ctx context.Context) *PutGuestNetworkInterfaceByIDParams {
var ()
return &PutGuestNetworkInterfaceByIDParams{
Context: ctx,
}
}
// NewPutGuestNetworkInterfaceByIDParamsWithHTTPClient creates a new PutGuestNetworkInterfaceByIDParams object
// with the default values initialized, and the ability to set a custom HTTPClient for a request
func NewPutGuestNetworkInterfaceByIDParamsWithHTTPClient(client *http.Client) *PutGuestNetworkInterfaceByIDParams {
var ()
return &PutGuestNetworkInterfaceByIDParams{
HTTPClient: client,
}
}
/*PutGuestNetworkInterfaceByIDParams contains all the parameters to send to the API endpoint
for the put guest network interface by ID operation typically these are written to a http.Request
*/
type PutGuestNetworkInterfaceByIDParams struct {
/*Body
Guest network interface properties
*/
Body *client_models.NetworkInterface
/*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 put guest network interface by ID params
func (o *PutGuestNetworkInterfaceByIDParams) WithTimeout(timeout time.Duration) *PutGuestNetworkInterfaceByIDParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the put guest network interface by ID params
func (o *PutGuestNetworkInterfaceByIDParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the put guest network interface by ID params
func (o *PutGuestNetworkInterfaceByIDParams) WithContext(ctx context.Context) *PutGuestNetworkInterfaceByIDParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the put guest network interface by ID params
func (o *PutGuestNetworkInterfaceByIDParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the put guest network interface by ID params
func (o *PutGuestNetworkInterfaceByIDParams) WithHTTPClient(client *http.Client) *PutGuestNetworkInterfaceByIDParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the put guest network interface by ID params
func (o *PutGuestNetworkInterfaceByIDParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithBody adds the body to the put guest network interface by ID params
func (o *PutGuestNetworkInterfaceByIDParams) WithBody(body *client_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) {
o.Body = body
}
// WithIfaceID adds the ifaceID to the put guest network interface by ID params
func (o *PutGuestNetworkInterfaceByIDParams) WithIfaceID(ifaceID string) *PutGuestNetworkInterfaceByIDParams {
o.SetIfaceID(ifaceID)
return o
}
// SetIfaceID adds the ifaceId to the put guest network interface by ID params
func (o *PutGuestNetworkInterfaceByIDParams) SetIfaceID(ifaceID string) {
o.IfaceID = ifaceID
}
// WriteToRequest writes these params to a swagger request
func (o *PutGuestNetworkInterfaceByIDParams) 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
}

View File

@ -1,153 +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"
)
// PutGuestNetworkInterfaceByIDReader is a Reader for the PutGuestNetworkInterfaceByID structure.
type PutGuestNetworkInterfaceByIDReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *PutGuestNetworkInterfaceByIDReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 204:
result := NewPutGuestNetworkInterfaceByIDNoContent()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 400:
result := NewPutGuestNetworkInterfaceByIDBadRequest()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
default:
result := NewPutGuestNetworkInterfaceByIDDefault(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
}
}
// NewPutGuestNetworkInterfaceByIDNoContent creates a PutGuestNetworkInterfaceByIDNoContent with default headers values
func NewPutGuestNetworkInterfaceByIDNoContent() *PutGuestNetworkInterfaceByIDNoContent {
return &PutGuestNetworkInterfaceByIDNoContent{}
}
/*PutGuestNetworkInterfaceByIDNoContent handles this case with default header values.
Network interface created/updated
*/
type PutGuestNetworkInterfaceByIDNoContent struct {
}
func (o *PutGuestNetworkInterfaceByIDNoContent) Error() string {
return fmt.Sprintf("[PUT /network-interfaces/{iface_id}][%d] putGuestNetworkInterfaceByIdNoContent ", 204)
}
func (o *PutGuestNetworkInterfaceByIDNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
return nil
}
// NewPutGuestNetworkInterfaceByIDBadRequest creates a PutGuestNetworkInterfaceByIDBadRequest with default headers values
func NewPutGuestNetworkInterfaceByIDBadRequest() *PutGuestNetworkInterfaceByIDBadRequest {
return &PutGuestNetworkInterfaceByIDBadRequest{}
}
/*PutGuestNetworkInterfaceByIDBadRequest handles this case with default header values.
Network interface cannot be created due to bad input
*/
type PutGuestNetworkInterfaceByIDBadRequest struct {
Payload *client_models.Error
}
func (o *PutGuestNetworkInterfaceByIDBadRequest) Error() string {
return fmt.Sprintf("[PUT /network-interfaces/{iface_id}][%d] putGuestNetworkInterfaceByIdBadRequest %+v", 400, o.Payload)
}
func (o *PutGuestNetworkInterfaceByIDBadRequest) 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
}
// NewPutGuestNetworkInterfaceByIDDefault creates a PutGuestNetworkInterfaceByIDDefault with default headers values
func NewPutGuestNetworkInterfaceByIDDefault(code int) *PutGuestNetworkInterfaceByIDDefault {
return &PutGuestNetworkInterfaceByIDDefault{
_statusCode: code,
}
}
/*PutGuestNetworkInterfaceByIDDefault handles this case with default header values.
Internal server error
*/
type PutGuestNetworkInterfaceByIDDefault struct {
_statusCode int
Payload *client_models.Error
}
// Code gets the status code for the put guest network interface by ID default response
func (o *PutGuestNetworkInterfaceByIDDefault) Code() int {
return o._statusCode
}
func (o *PutGuestNetworkInterfaceByIDDefault) Error() string {
return fmt.Sprintf("[PUT /network-interfaces/{iface_id}][%d] putGuestNetworkInterfaceByID default %+v", o._statusCode, o.Payload)
}
func (o *PutGuestNetworkInterfaceByIDDefault) 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
}

View File

@ -1,174 +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"
client_models "github.com/firecracker-microvm/firecracker-go-sdk/client/models"
)
// NewPutGuestVsockByIDParams creates a new PutGuestVsockByIDParams object
// with the default values initialized.
func NewPutGuestVsockByIDParams() *PutGuestVsockByIDParams {
var ()
return &PutGuestVsockByIDParams{
timeout: cr.DefaultTimeout,
}
}
// NewPutGuestVsockByIDParamsWithTimeout creates a new PutGuestVsockByIDParams object
// with the default values initialized, and the ability to set a timeout on a request
func NewPutGuestVsockByIDParamsWithTimeout(timeout time.Duration) *PutGuestVsockByIDParams {
var ()
return &PutGuestVsockByIDParams{
timeout: timeout,
}
}
// NewPutGuestVsockByIDParamsWithContext creates a new PutGuestVsockByIDParams object
// with the default values initialized, and the ability to set a context for a request
func NewPutGuestVsockByIDParamsWithContext(ctx context.Context) *PutGuestVsockByIDParams {
var ()
return &PutGuestVsockByIDParams{
Context: ctx,
}
}
// NewPutGuestVsockByIDParamsWithHTTPClient creates a new PutGuestVsockByIDParams object
// with the default values initialized, and the ability to set a custom HTTPClient for a request
func NewPutGuestVsockByIDParamsWithHTTPClient(client *http.Client) *PutGuestVsockByIDParams {
var ()
return &PutGuestVsockByIDParams{
HTTPClient: client,
}
}
/*PutGuestVsockByIDParams contains all the parameters to send to the API endpoint
for the put guest vsock by ID operation typically these are written to a http.Request
*/
type PutGuestVsockByIDParams struct {
/*Body
Guest vsock properties
*/
Body *client_models.Vsock
/*ID
The id of the vsock device
*/
ID string
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// WithTimeout adds the timeout to the put guest vsock by ID params
func (o *PutGuestVsockByIDParams) WithTimeout(timeout time.Duration) *PutGuestVsockByIDParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the put guest vsock by ID params
func (o *PutGuestVsockByIDParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the put guest vsock by ID params
func (o *PutGuestVsockByIDParams) WithContext(ctx context.Context) *PutGuestVsockByIDParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the put guest vsock by ID params
func (o *PutGuestVsockByIDParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the put guest vsock by ID params
func (o *PutGuestVsockByIDParams) WithHTTPClient(client *http.Client) *PutGuestVsockByIDParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the put guest vsock by ID params
func (o *PutGuestVsockByIDParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithBody adds the body to the put guest vsock by ID params
func (o *PutGuestVsockByIDParams) WithBody(body *client_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) {
o.Body = body
}
// WithID adds the id to the put guest vsock by ID params
func (o *PutGuestVsockByIDParams) WithID(id string) *PutGuestVsockByIDParams {
o.SetID(id)
return o
}
// SetID adds the id to the put guest vsock by ID params
func (o *PutGuestVsockByIDParams) SetID(id string) {
o.ID = id
}
// WriteToRequest writes these params to a swagger request
func (o *PutGuestVsockByIDParams) 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 id
if err := r.SetPathParam("id", o.ID); err != nil {
return err
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}

View File

@ -1,181 +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"
)
// PutGuestVsockByIDReader is a Reader for the PutGuestVsockByID structure.
type PutGuestVsockByIDReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *PutGuestVsockByIDReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 201:
result := NewPutGuestVsockByIDCreated()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 204:
result := NewPutGuestVsockByIDNoContent()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 400:
result := NewPutGuestVsockByIDBadRequest()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
default:
result := NewPutGuestVsockByIDDefault(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
}
}
// NewPutGuestVsockByIDCreated creates a PutGuestVsockByIDCreated with default headers values
func NewPutGuestVsockByIDCreated() *PutGuestVsockByIDCreated {
return &PutGuestVsockByIDCreated{}
}
/*PutGuestVsockByIDCreated handles this case with default header values.
Vsock created
*/
type PutGuestVsockByIDCreated struct {
}
func (o *PutGuestVsockByIDCreated) Error() string {
return fmt.Sprintf("[PUT /vsocks/{id}][%d] putGuestVsockByIdCreated ", 201)
}
func (o *PutGuestVsockByIDCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
return nil
}
// NewPutGuestVsockByIDNoContent creates a PutGuestVsockByIDNoContent with default headers values
func NewPutGuestVsockByIDNoContent() *PutGuestVsockByIDNoContent {
return &PutGuestVsockByIDNoContent{}
}
/*PutGuestVsockByIDNoContent handles this case with default header values.
Vsock updated
*/
type PutGuestVsockByIDNoContent struct {
}
func (o *PutGuestVsockByIDNoContent) Error() string {
return fmt.Sprintf("[PUT /vsocks/{id}][%d] putGuestVsockByIdNoContent ", 204)
}
func (o *PutGuestVsockByIDNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
return nil
}
// NewPutGuestVsockByIDBadRequest creates a PutGuestVsockByIDBadRequest with default headers values
func NewPutGuestVsockByIDBadRequest() *PutGuestVsockByIDBadRequest {
return &PutGuestVsockByIDBadRequest{}
}
/*PutGuestVsockByIDBadRequest handles this case with default header values.
Vsock cannot be created due to bad input
*/
type PutGuestVsockByIDBadRequest struct {
Payload *client_models.Error
}
func (o *PutGuestVsockByIDBadRequest) Error() string {
return fmt.Sprintf("[PUT /vsocks/{id}][%d] putGuestVsockByIdBadRequest %+v", 400, o.Payload)
}
func (o *PutGuestVsockByIDBadRequest) 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
}
// NewPutGuestVsockByIDDefault creates a PutGuestVsockByIDDefault with default headers values
func NewPutGuestVsockByIDDefault(code int) *PutGuestVsockByIDDefault {
return &PutGuestVsockByIDDefault{
_statusCode: code,
}
}
/*PutGuestVsockByIDDefault handles this case with default header values.
Internal server error
*/
type PutGuestVsockByIDDefault struct {
_statusCode int
Payload *client_models.Error
}
// Code gets the status code for the put guest vsock by ID default response
func (o *PutGuestVsockByIDDefault) Code() int {
return o._statusCode
}
func (o *PutGuestVsockByIDDefault) Error() string {
return fmt.Sprintf("[PUT /vsocks/{id}][%d] putGuestVsockByID default %+v", o._statusCode, o.Payload)
}
func (o *PutGuestVsockByIDDefault) 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
}

View File

@ -1,153 +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"
client_models "github.com/firecracker-microvm/firecracker-go-sdk/client/models"
)
// NewPutLoggerParams creates a new PutLoggerParams object
// with the default values initialized.
func NewPutLoggerParams() *PutLoggerParams {
var ()
return &PutLoggerParams{
timeout: cr.DefaultTimeout,
}
}
// NewPutLoggerParamsWithTimeout creates a new PutLoggerParams object
// with the default values initialized, and the ability to set a timeout on a request
func NewPutLoggerParamsWithTimeout(timeout time.Duration) *PutLoggerParams {
var ()
return &PutLoggerParams{
timeout: timeout,
}
}
// NewPutLoggerParamsWithContext creates a new PutLoggerParams object
// with the default values initialized, and the ability to set a context for a request
func NewPutLoggerParamsWithContext(ctx context.Context) *PutLoggerParams {
var ()
return &PutLoggerParams{
Context: ctx,
}
}
// NewPutLoggerParamsWithHTTPClient creates a new PutLoggerParams object
// with the default values initialized, and the ability to set a custom HTTPClient for a request
func NewPutLoggerParamsWithHTTPClient(client *http.Client) *PutLoggerParams {
var ()
return &PutLoggerParams{
HTTPClient: client,
}
}
/*PutLoggerParams contains all the parameters to send to the API endpoint
for the put logger operation typically these are written to a http.Request
*/
type PutLoggerParams struct {
/*Body
Logging system description
*/
Body *client_models.Logger
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// WithTimeout adds the timeout to the put logger params
func (o *PutLoggerParams) WithTimeout(timeout time.Duration) *PutLoggerParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the put logger params
func (o *PutLoggerParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the put logger params
func (o *PutLoggerParams) WithContext(ctx context.Context) *PutLoggerParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the put logger params
func (o *PutLoggerParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the put logger params
func (o *PutLoggerParams) WithHTTPClient(client *http.Client) *PutLoggerParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the put logger params
func (o *PutLoggerParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithBody adds the body to the put logger params
func (o *PutLoggerParams) WithBody(body *client_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) {
o.Body = body
}
// WriteToRequest writes these params to a swagger request
func (o *PutLoggerParams) 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
}

View File

@ -1,153 +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"
)
// PutLoggerReader is a Reader for the PutLogger structure.
type PutLoggerReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *PutLoggerReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 204:
result := NewPutLoggerNoContent()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 400:
result := NewPutLoggerBadRequest()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
default:
result := NewPutLoggerDefault(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
}
}
// NewPutLoggerNoContent creates a PutLoggerNoContent with default headers values
func NewPutLoggerNoContent() *PutLoggerNoContent {
return &PutLoggerNoContent{}
}
/*PutLoggerNoContent handles this case with default header values.
Logger created.
*/
type PutLoggerNoContent struct {
}
func (o *PutLoggerNoContent) Error() string {
return fmt.Sprintf("[PUT /logger][%d] putLoggerNoContent ", 204)
}
func (o *PutLoggerNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
return nil
}
// NewPutLoggerBadRequest creates a PutLoggerBadRequest with default headers values
func NewPutLoggerBadRequest() *PutLoggerBadRequest {
return &PutLoggerBadRequest{}
}
/*PutLoggerBadRequest handles this case with default header values.
Logger cannot be initialized due to bad input.
*/
type PutLoggerBadRequest struct {
Payload *client_models.Error
}
func (o *PutLoggerBadRequest) Error() string {
return fmt.Sprintf("[PUT /logger][%d] putLoggerBadRequest %+v", 400, o.Payload)
}
func (o *PutLoggerBadRequest) 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
}
// NewPutLoggerDefault creates a PutLoggerDefault with default headers values
func NewPutLoggerDefault(code int) *PutLoggerDefault {
return &PutLoggerDefault{
_statusCode: code,
}
}
/*PutLoggerDefault handles this case with default header values.
Internal server error.
*/
type PutLoggerDefault struct {
_statusCode int
Payload *client_models.Error
}
// Code gets the status code for the put logger default response
func (o *PutLoggerDefault) Code() int {
return o._statusCode
}
func (o *PutLoggerDefault) Error() string {
return fmt.Sprintf("[PUT /logger][%d] putLogger default %+v", o._statusCode, o.Payload)
}
func (o *PutLoggerDefault) 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
}

View File

@ -1,153 +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"
client_models "github.com/firecracker-microvm/firecracker-go-sdk/client/models"
)
// NewPutMachineConfigurationParams creates a new PutMachineConfigurationParams object
// with the default values initialized.
func NewPutMachineConfigurationParams() *PutMachineConfigurationParams {
var ()
return &PutMachineConfigurationParams{
timeout: cr.DefaultTimeout,
}
}
// NewPutMachineConfigurationParamsWithTimeout creates a new PutMachineConfigurationParams object
// with the default values initialized, and the ability to set a timeout on a request
func NewPutMachineConfigurationParamsWithTimeout(timeout time.Duration) *PutMachineConfigurationParams {
var ()
return &PutMachineConfigurationParams{
timeout: timeout,
}
}
// NewPutMachineConfigurationParamsWithContext creates a new PutMachineConfigurationParams object
// with the default values initialized, and the ability to set a context for a request
func NewPutMachineConfigurationParamsWithContext(ctx context.Context) *PutMachineConfigurationParams {
var ()
return &PutMachineConfigurationParams{
Context: ctx,
}
}
// NewPutMachineConfigurationParamsWithHTTPClient creates a new PutMachineConfigurationParams object
// with the default values initialized, and the ability to set a custom HTTPClient for a request
func NewPutMachineConfigurationParamsWithHTTPClient(client *http.Client) *PutMachineConfigurationParams {
var ()
return &PutMachineConfigurationParams{
HTTPClient: client,
}
}
/*PutMachineConfigurationParams contains all the parameters to send to the API endpoint
for the put machine configuration operation typically these are written to a http.Request
*/
type PutMachineConfigurationParams struct {
/*Body
Machine Configuration Parameters
*/
Body *client_models.MachineConfiguration
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// WithTimeout adds the timeout to the put machine configuration params
func (o *PutMachineConfigurationParams) WithTimeout(timeout time.Duration) *PutMachineConfigurationParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the put machine configuration params
func (o *PutMachineConfigurationParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the put machine configuration params
func (o *PutMachineConfigurationParams) WithContext(ctx context.Context) *PutMachineConfigurationParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the put machine configuration params
func (o *PutMachineConfigurationParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the put machine configuration params
func (o *PutMachineConfigurationParams) WithHTTPClient(client *http.Client) *PutMachineConfigurationParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the put machine configuration params
func (o *PutMachineConfigurationParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithBody adds the body to the put machine configuration params
func (o *PutMachineConfigurationParams) WithBody(body *client_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) {
o.Body = body
}
// WriteToRequest writes these params to a swagger request
func (o *PutMachineConfigurationParams) 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
}

View File

@ -1,153 +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"
)
// PutMachineConfigurationReader is a Reader for the PutMachineConfiguration structure.
type PutMachineConfigurationReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *PutMachineConfigurationReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 204:
result := NewPutMachineConfigurationNoContent()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 400:
result := NewPutMachineConfigurationBadRequest()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
default:
result := NewPutMachineConfigurationDefault(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
}
}
// NewPutMachineConfigurationNoContent creates a PutMachineConfigurationNoContent with default headers values
func NewPutMachineConfigurationNoContent() *PutMachineConfigurationNoContent {
return &PutMachineConfigurationNoContent{}
}
/*PutMachineConfigurationNoContent handles this case with default header values.
Machine Configuration created/updated
*/
type PutMachineConfigurationNoContent struct {
}
func (o *PutMachineConfigurationNoContent) Error() string {
return fmt.Sprintf("[PUT /machine-config][%d] putMachineConfigurationNoContent ", 204)
}
func (o *PutMachineConfigurationNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
return nil
}
// NewPutMachineConfigurationBadRequest creates a PutMachineConfigurationBadRequest with default headers values
func NewPutMachineConfigurationBadRequest() *PutMachineConfigurationBadRequest {
return &PutMachineConfigurationBadRequest{}
}
/*PutMachineConfigurationBadRequest handles this case with default header values.
Machine Configuration cannot be updated due to bad input
*/
type PutMachineConfigurationBadRequest struct {
Payload *client_models.Error
}
func (o *PutMachineConfigurationBadRequest) Error() string {
return fmt.Sprintf("[PUT /machine-config][%d] putMachineConfigurationBadRequest %+v", 400, o.Payload)
}
func (o *PutMachineConfigurationBadRequest) 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
}
// NewPutMachineConfigurationDefault creates a PutMachineConfigurationDefault with default headers values
func NewPutMachineConfigurationDefault(code int) *PutMachineConfigurationDefault {
return &PutMachineConfigurationDefault{
_statusCode: code,
}
}
/*PutMachineConfigurationDefault handles this case with default header values.
Internal server error
*/
type PutMachineConfigurationDefault struct {
_statusCode int
Payload *client_models.Error
}
// Code gets the status code for the put machine configuration default response
func (o *PutMachineConfigurationDefault) Code() int {
return o._statusCode
}
func (o *PutMachineConfigurationDefault) Error() string {
return fmt.Sprintf("[PUT /machine-config][%d] putMachineConfiguration default %+v", o._statusCode, o.Payload)
}
func (o *PutMachineConfigurationDefault) 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
}

View File

@ -1,151 +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"
)
// NewPutMmdsParams creates a new PutMmdsParams object
// with the default values initialized.
func NewPutMmdsParams() *PutMmdsParams {
var ()
return &PutMmdsParams{
timeout: cr.DefaultTimeout,
}
}
// NewPutMmdsParamsWithTimeout creates a new PutMmdsParams object
// with the default values initialized, and the ability to set a timeout on a request
func NewPutMmdsParamsWithTimeout(timeout time.Duration) *PutMmdsParams {
var ()
return &PutMmdsParams{
timeout: timeout,
}
}
// NewPutMmdsParamsWithContext creates a new PutMmdsParams object
// with the default values initialized, and the ability to set a context for a request
func NewPutMmdsParamsWithContext(ctx context.Context) *PutMmdsParams {
var ()
return &PutMmdsParams{
Context: ctx,
}
}
// NewPutMmdsParamsWithHTTPClient creates a new PutMmdsParams object
// with the default values initialized, and the ability to set a custom HTTPClient for a request
func NewPutMmdsParamsWithHTTPClient(client *http.Client) *PutMmdsParams {
var ()
return &PutMmdsParams{
HTTPClient: client,
}
}
/*PutMmdsParams contains all the parameters to send to the API endpoint
for the put mmds operation typically these are written to a http.Request
*/
type PutMmdsParams struct {
/*Body
The MMDS data store as JSON.
*/
Body interface{}
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// WithTimeout adds the timeout to the put mmds params
func (o *PutMmdsParams) WithTimeout(timeout time.Duration) *PutMmdsParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the put mmds params
func (o *PutMmdsParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the put mmds params
func (o *PutMmdsParams) WithContext(ctx context.Context) *PutMmdsParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the put mmds params
func (o *PutMmdsParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the put mmds params
func (o *PutMmdsParams) WithHTTPClient(client *http.Client) *PutMmdsParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the put mmds params
func (o *PutMmdsParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithBody adds the body to the put mmds params
func (o *PutMmdsParams) WithBody(body interface{}) *PutMmdsParams {
o.SetBody(body)
return o
}
// SetBody adds the body to the put mmds params
func (o *PutMmdsParams) SetBody(body interface{}) {
o.Body = body
}
// WriteToRequest writes these params to a swagger request
func (o *PutMmdsParams) 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
}

View File

@ -1,153 +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"
)
// PutMmdsReader is a Reader for the PutMmds structure.
type PutMmdsReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *PutMmdsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 204:
result := NewPutMmdsNoContent()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 400:
result := NewPutMmdsBadRequest()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
default:
result := NewPutMmdsDefault(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
}
}
// NewPutMmdsNoContent creates a PutMmdsNoContent with default headers values
func NewPutMmdsNoContent() *PutMmdsNoContent {
return &PutMmdsNoContent{}
}
/*PutMmdsNoContent handles this case with default header values.
MMDS data store created/updated.
*/
type PutMmdsNoContent struct {
}
func (o *PutMmdsNoContent) Error() string {
return fmt.Sprintf("[PUT /mmds][%d] putMmdsNoContent ", 204)
}
func (o *PutMmdsNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
return nil
}
// NewPutMmdsBadRequest creates a PutMmdsBadRequest with default headers values
func NewPutMmdsBadRequest() *PutMmdsBadRequest {
return &PutMmdsBadRequest{}
}
/*PutMmdsBadRequest handles this case with default header values.
MMDS data store cannot be created due to bad input.
*/
type PutMmdsBadRequest struct {
Payload *client_models.Error
}
func (o *PutMmdsBadRequest) Error() string {
return fmt.Sprintf("[PUT /mmds][%d] putMmdsBadRequest %+v", 400, o.Payload)
}
func (o *PutMmdsBadRequest) 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
}
// NewPutMmdsDefault creates a PutMmdsDefault with default headers values
func NewPutMmdsDefault(code int) *PutMmdsDefault {
return &PutMmdsDefault{
_statusCode: code,
}
}
/*PutMmdsDefault handles this case with default header values.
Internal server error
*/
type PutMmdsDefault struct {
_statusCode int
Payload *client_models.Error
}
// Code gets the status code for the put mmds default response
func (o *PutMmdsDefault) Code() int {
return o._statusCode
}
func (o *PutMmdsDefault) Error() string {
return fmt.Sprintf("[PUT /mmds][%d] PutMmds default %+v", o._statusCode, o.Payload)
}
func (o *PutMmdsDefault) 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
}