virtcontainers/firecracker: update API

update firecracker API to 0.19.0

Signed-off-by: Julio Montes <julio.montes@intel.com>
This commit is contained in:
Julio Montes 2019-11-11 22:18:05 +00:00
parent 8c7a83b936
commit 0def9b01de
22 changed files with 367 additions and 556 deletions

View File

@ -5,8 +5,8 @@ The code is generated via go-swagger
https://github.com/go-swagger/go-swagger#licensing
```
swagger generate model -f ./firecracker-experimental.yaml --model-package=client/models --client-package=client
swagger generate client -f ./firecracker-experimental.yaml --model-package=client/models --client-package=client
swagger generate model -f ./firecracker.yaml --model-package=client/models --client-package=client
swagger generate client -f ./firecracker.yaml --model-package=client/models --client-package=client
```
```

View File

@ -25,7 +25,7 @@ type InstanceInfo struct {
// The current detailed state of the Firecracker instance. This value is read-only for the control-plane.
// Required: true
// Enum: [Uninitialized Starting Running Halting Halted]
// Enum: [Uninitialized Starting Running]
State *string `json:"state"`
// MicroVM hypervisor build version.
@ -68,7 +68,7 @@ var instanceInfoTypeStatePropEnum []interface{}
func init() {
var res []string
if err := json.Unmarshal([]byte(`["Uninitialized","Starting","Running","Halting","Halted"]`), &res); err != nil {
if err := json.Unmarshal([]byte(`["Uninitialized","Starting","Running"]`), &res); err != nil {
panic(err)
}
for _, v := range res {
@ -86,12 +86,6 @@ const (
// 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

View File

@ -24,18 +24,21 @@ type CreateSyncActionReader struct {
// 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 {
@ -86,10 +89,6 @@ func (o *CreateSyncActionBadRequest) Error() string {
return fmt.Sprintf("[PUT /actions][%d] createSyncActionBadRequest %+v", 400, o.Payload)
}
func (o *CreateSyncActionBadRequest) GetPayload() *models.Error {
return o.Payload
}
func (o *CreateSyncActionBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(models.Error)
@ -128,10 +127,6 @@ func (o *CreateSyncActionDefault) Error() string {
return fmt.Sprintf("[PUT /actions][%d] createSyncAction default %+v", o._statusCode, o.Payload)
}
func (o *CreateSyncActionDefault) GetPayload() *models.Error {
return o.Payload
}
func (o *CreateSyncActionDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(models.Error)

View File

@ -24,12 +24,14 @@ type DescribeInstanceReader struct {
// 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 {
@ -59,10 +61,6 @@ func (o *DescribeInstanceOK) Error() string {
return fmt.Sprintf("[GET /][%d] describeInstanceOK %+v", 200, o.Payload)
}
func (o *DescribeInstanceOK) GetPayload() *models.InstanceInfo {
return o.Payload
}
func (o *DescribeInstanceOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(models.InstanceInfo)
@ -101,10 +99,6 @@ func (o *DescribeInstanceDefault) Error() string {
return fmt.Sprintf("[GET /][%d] describeInstance default %+v", o._statusCode, o.Payload)
}
func (o *DescribeInstanceDefault) GetPayload() *models.Error {
return o.Payload
}
func (o *DescribeInstanceDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(models.Error)

View File

@ -24,12 +24,14 @@ type GetMachineConfigurationReader struct {
// ReadResponse reads a server response into the received o.
func (o *GetMachineConfigurationReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewGetMachineConfigurationOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
default:
result := NewGetMachineConfigurationDefault(response.Code())
if err := result.readResponse(response, consumer, o.formats); err != nil {
@ -59,10 +61,6 @@ func (o *GetMachineConfigurationOK) Error() string {
return fmt.Sprintf("[GET /machine-config][%d] getMachineConfigurationOK %+v", 200, o.Payload)
}
func (o *GetMachineConfigurationOK) GetPayload() *models.MachineConfiguration {
return o.Payload
}
func (o *GetMachineConfigurationOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(models.MachineConfiguration)
@ -101,10 +99,6 @@ func (o *GetMachineConfigurationDefault) Error() string {
return fmt.Sprintf("[GET /machine-config][%d] getMachineConfiguration default %+v", o._statusCode, o.Payload)
}
func (o *GetMachineConfigurationDefault) GetPayload() *models.Error {
return o.Payload
}
func (o *GetMachineConfigurationDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(models.Error)

View File

@ -24,18 +24,21 @@ type GetMmdsReader struct {
// 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 {
@ -65,10 +68,6 @@ func (o *GetMmdsOK) Error() string {
return fmt.Sprintf("[GET /mmds][%d] getMmdsOK %+v", 200, o.Payload)
}
func (o *GetMmdsOK) GetPayload() interface{} {
return o.Payload
}
func (o *GetMmdsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// response payload
@ -96,10 +95,6 @@ func (o *GetMmdsBadRequest) Error() string {
return fmt.Sprintf("[GET /mmds][%d] getMmdsBadRequest %+v", 400, o.Payload)
}
func (o *GetMmdsBadRequest) GetPayload() *models.Error {
return o.Payload
}
func (o *GetMmdsBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(models.Error)
@ -138,10 +133,6 @@ func (o *GetMmdsDefault) Error() string {
return fmt.Sprintf("[GET /mmds][%d] GetMmds default %+v", o._statusCode, o.Payload)
}
func (o *GetMmdsDefault) GetPayload() *models.Error {
return o.Payload
}
func (o *GetMmdsDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(models.Error)

View File

@ -48,13 +48,8 @@ func (a *Client) GetMmds(params *GetMmdsParams) (*GetMmdsOK, error) {
if err != nil {
return nil, err
}
success, ok := result.(*GetMmdsOK)
if ok {
return success, nil
}
// unexpected success response
unexpectedSuccess := result.(*GetMmdsDefault)
return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code())
return result.(*GetMmdsOK), nil
}
/*
@ -81,13 +76,8 @@ func (a *Client) PatchMmds(params *PatchMmdsParams) (*PatchMmdsNoContent, error)
if err != nil {
return nil, err
}
success, ok := result.(*PatchMmdsNoContent)
if ok {
return success, nil
}
// unexpected success response
unexpectedSuccess := result.(*PatchMmdsDefault)
return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code())
return result.(*PatchMmdsNoContent), nil
}
/*
@ -114,13 +104,8 @@ func (a *Client) PutMmds(params *PutMmdsParams) (*PutMmdsNoContent, error) {
if err != nil {
return nil, err
}
success, ok := result.(*PutMmdsNoContent)
if ok {
return success, nil
}
// unexpected success response
unexpectedSuccess := result.(*PutMmdsDefault)
return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code())
return result.(*PutMmdsNoContent), nil
}
/*
@ -147,13 +132,8 @@ func (a *Client) CreateSyncAction(params *CreateSyncActionParams) (*CreateSyncAc
if err != nil {
return nil, err
}
success, ok := result.(*CreateSyncActionNoContent)
if ok {
return success, nil
}
// unexpected success response
unexpectedSuccess := result.(*CreateSyncActionDefault)
return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code())
return result.(*CreateSyncActionNoContent), nil
}
/*
@ -180,13 +160,8 @@ func (a *Client) DescribeInstance(params *DescribeInstanceParams) (*DescribeInst
if err != nil {
return nil, err
}
success, ok := result.(*DescribeInstanceOK)
if ok {
return success, nil
}
// unexpected success response
unexpectedSuccess := result.(*DescribeInstanceDefault)
return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code())
return result.(*DescribeInstanceOK), nil
}
/*
@ -215,13 +190,8 @@ func (a *Client) GetMachineConfiguration(params *GetMachineConfigurationParams)
if err != nil {
return nil, err
}
success, ok := result.(*GetMachineConfigurationOK)
if ok {
return success, nil
}
// unexpected success response
unexpectedSuccess := result.(*GetMachineConfigurationDefault)
return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code())
return result.(*GetMachineConfigurationOK), nil
}
/*
@ -250,13 +220,8 @@ func (a *Client) PatchGuestDriveByID(params *PatchGuestDriveByIDParams) (*PatchG
if err != nil {
return nil, err
}
success, ok := result.(*PatchGuestDriveByIDNoContent)
if ok {
return success, nil
}
// unexpected success response
unexpectedSuccess := result.(*PatchGuestDriveByIDDefault)
return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code())
return result.(*PatchGuestDriveByIDNoContent), nil
}
/*
@ -285,13 +250,8 @@ func (a *Client) PatchGuestNetworkInterfaceByID(params *PatchGuestNetworkInterfa
if err != nil {
return nil, err
}
success, ok := result.(*PatchGuestNetworkInterfaceByIDNoContent)
if ok {
return success, nil
}
// unexpected success response
unexpectedSuccess := result.(*PatchGuestNetworkInterfaceByIDDefault)
return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code())
return result.(*PatchGuestNetworkInterfaceByIDNoContent), nil
}
/*
@ -320,13 +280,8 @@ func (a *Client) PatchMachineConfiguration(params *PatchMachineConfigurationPara
if err != nil {
return nil, err
}
success, ok := result.(*PatchMachineConfigurationNoContent)
if ok {
return success, nil
}
// unexpected success response
unexpectedSuccess := result.(*PatchMachineConfigurationDefault)
return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code())
return result.(*PatchMachineConfigurationNoContent), nil
}
/*
@ -355,13 +310,8 @@ func (a *Client) PutGuestBootSource(params *PutGuestBootSourceParams) (*PutGuest
if err != nil {
return nil, err
}
success, ok := result.(*PutGuestBootSourceNoContent)
if ok {
return success, nil
}
// unexpected success response
unexpectedSuccess := result.(*PutGuestBootSourceDefault)
return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code())
return result.(*PutGuestBootSourceNoContent), nil
}
/*
@ -390,13 +340,8 @@ func (a *Client) PutGuestDriveByID(params *PutGuestDriveByIDParams) (*PutGuestDr
if err != nil {
return nil, err
}
success, ok := result.(*PutGuestDriveByIDNoContent)
if ok {
return success, nil
}
// unexpected success response
unexpectedSuccess := result.(*PutGuestDriveByIDDefault)
return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code())
return result.(*PutGuestDriveByIDNoContent), nil
}
/*
@ -425,48 +370,38 @@ func (a *Client) PutGuestNetworkInterfaceByID(params *PutGuestNetworkInterfaceBy
if err != nil {
return nil, err
}
success, ok := result.(*PutGuestNetworkInterfaceByIDNoContent)
if ok {
return success, nil
}
// unexpected success response
unexpectedSuccess := result.(*PutGuestNetworkInterfaceByIDDefault)
return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code())
return result.(*PutGuestNetworkInterfaceByIDNoContent), nil
}
/*
PutGuestVsockByID creates new vsock with ID specified by the id parameter
PutGuestVsock creates updates a vsock device
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.
The first call creates the device with the configuration specified in body. Subsequent calls will update the device configuration. May fail if update is not possible.
*/
func (a *Client) PutGuestVsockByID(params *PutGuestVsockByIDParams) (*PutGuestVsockByIDNoContent, error) {
func (a *Client) PutGuestVsock(params *PutGuestVsockParams) (*PutGuestVsockNoContent, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewPutGuestVsockByIDParams()
params = NewPutGuestVsockParams()
}
result, err := a.transport.Submit(&runtime.ClientOperation{
ID: "putGuestVsockByID",
ID: "putGuestVsock",
Method: "PUT",
PathPattern: "/vsocks/{id}",
PathPattern: "/vsock",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http"},
Params: params,
Reader: &PutGuestVsockByIDReader{formats: a.formats},
Reader: &PutGuestVsockReader{formats: a.formats},
Context: params.Context,
Client: params.HTTPClient,
})
if err != nil {
return nil, err
}
success, ok := result.(*PutGuestVsockByIDNoContent)
if ok {
return success, nil
}
// unexpected success response
unexpectedSuccess := result.(*PutGuestVsockByIDDefault)
return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code())
return result.(*PutGuestVsockNoContent), nil
}
/*
@ -493,13 +428,8 @@ func (a *Client) PutLogger(params *PutLoggerParams) (*PutLoggerNoContent, error)
if err != nil {
return nil, err
}
success, ok := result.(*PutLoggerNoContent)
if ok {
return success, nil
}
// unexpected success response
unexpectedSuccess := result.(*PutLoggerDefault)
return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code())
return result.(*PutLoggerNoContent), nil
}
/*
@ -528,13 +458,8 @@ func (a *Client) PutMachineConfiguration(params *PutMachineConfigurationParams)
if err != nil {
return nil, err
}
success, ok := result.(*PutMachineConfigurationNoContent)
if ok {
return success, nil
}
// unexpected success response
unexpectedSuccess := result.(*PutMachineConfigurationDefault)
return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code())
return result.(*PutMachineConfigurationNoContent), nil
}
// SetTransport changes the transport on the client

View File

@ -24,18 +24,21 @@ type PatchGuestDriveByIDReader struct {
// 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 {
@ -86,10 +89,6 @@ func (o *PatchGuestDriveByIDBadRequest) Error() string {
return fmt.Sprintf("[PATCH /drives/{drive_id}][%d] patchGuestDriveByIdBadRequest %+v", 400, o.Payload)
}
func (o *PatchGuestDriveByIDBadRequest) GetPayload() *models.Error {
return o.Payload
}
func (o *PatchGuestDriveByIDBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(models.Error)
@ -128,10 +127,6 @@ func (o *PatchGuestDriveByIDDefault) Error() string {
return fmt.Sprintf("[PATCH /drives/{drive_id}][%d] patchGuestDriveByID default %+v", o._statusCode, o.Payload)
}
func (o *PatchGuestDriveByIDDefault) GetPayload() *models.Error {
return o.Payload
}
func (o *PatchGuestDriveByIDDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(models.Error)

View File

@ -24,18 +24,21 @@ type PatchGuestNetworkInterfaceByIDReader struct {
// ReadResponse reads a server response into the received o.
func (o *PatchGuestNetworkInterfaceByIDReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 204:
result := NewPatchGuestNetworkInterfaceByIDNoContent()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 400:
result := NewPatchGuestNetworkInterfaceByIDBadRequest()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
default:
result := NewPatchGuestNetworkInterfaceByIDDefault(response.Code())
if err := result.readResponse(response, consumer, o.formats); err != nil {
@ -86,10 +89,6 @@ func (o *PatchGuestNetworkInterfaceByIDBadRequest) Error() string {
return fmt.Sprintf("[PATCH /network-interfaces/{iface_id}][%d] patchGuestNetworkInterfaceByIdBadRequest %+v", 400, o.Payload)
}
func (o *PatchGuestNetworkInterfaceByIDBadRequest) GetPayload() *models.Error {
return o.Payload
}
func (o *PatchGuestNetworkInterfaceByIDBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(models.Error)
@ -128,10 +127,6 @@ func (o *PatchGuestNetworkInterfaceByIDDefault) Error() string {
return fmt.Sprintf("[PATCH /network-interfaces/{iface_id}][%d] patchGuestNetworkInterfaceByID default %+v", o._statusCode, o.Payload)
}
func (o *PatchGuestNetworkInterfaceByIDDefault) GetPayload() *models.Error {
return o.Payload
}
func (o *PatchGuestNetworkInterfaceByIDDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(models.Error)

View File

@ -24,18 +24,21 @@ type PatchMachineConfigurationReader struct {
// ReadResponse reads a server response into the received o.
func (o *PatchMachineConfigurationReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 204:
result := NewPatchMachineConfigurationNoContent()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 400:
result := NewPatchMachineConfigurationBadRequest()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
default:
result := NewPatchMachineConfigurationDefault(response.Code())
if err := result.readResponse(response, consumer, o.formats); err != nil {
@ -86,10 +89,6 @@ func (o *PatchMachineConfigurationBadRequest) Error() string {
return fmt.Sprintf("[PATCH /machine-config][%d] patchMachineConfigurationBadRequest %+v", 400, o.Payload)
}
func (o *PatchMachineConfigurationBadRequest) GetPayload() *models.Error {
return o.Payload
}
func (o *PatchMachineConfigurationBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(models.Error)
@ -128,10 +127,6 @@ func (o *PatchMachineConfigurationDefault) Error() string {
return fmt.Sprintf("[PATCH /machine-config][%d] patchMachineConfiguration default %+v", o._statusCode, o.Payload)
}
func (o *PatchMachineConfigurationDefault) GetPayload() *models.Error {
return o.Payload
}
func (o *PatchMachineConfigurationDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(models.Error)

View File

@ -24,18 +24,21 @@ type PatchMmdsReader struct {
// 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 {
@ -86,10 +89,6 @@ func (o *PatchMmdsBadRequest) Error() string {
return fmt.Sprintf("[PATCH /mmds][%d] patchMmdsBadRequest %+v", 400, o.Payload)
}
func (o *PatchMmdsBadRequest) GetPayload() *models.Error {
return o.Payload
}
func (o *PatchMmdsBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(models.Error)
@ -128,10 +127,6 @@ func (o *PatchMmdsDefault) Error() string {
return fmt.Sprintf("[PATCH /mmds][%d] PatchMmds default %+v", o._statusCode, o.Payload)
}
func (o *PatchMmdsDefault) GetPayload() *models.Error {
return o.Payload
}
func (o *PatchMmdsDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(models.Error)

View File

@ -24,18 +24,21 @@ type PutGuestBootSourceReader struct {
// 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 {
@ -86,10 +89,6 @@ func (o *PutGuestBootSourceBadRequest) Error() string {
return fmt.Sprintf("[PUT /boot-source][%d] putGuestBootSourceBadRequest %+v", 400, o.Payload)
}
func (o *PutGuestBootSourceBadRequest) GetPayload() *models.Error {
return o.Payload
}
func (o *PutGuestBootSourceBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(models.Error)
@ -128,10 +127,6 @@ func (o *PutGuestBootSourceDefault) Error() string {
return fmt.Sprintf("[PUT /boot-source][%d] putGuestBootSource default %+v", o._statusCode, o.Payload)
}
func (o *PutGuestBootSourceDefault) GetPayload() *models.Error {
return o.Payload
}
func (o *PutGuestBootSourceDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(models.Error)

View File

@ -24,18 +24,21 @@ type PutGuestDriveByIDReader struct {
// 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 {
@ -86,10 +89,6 @@ func (o *PutGuestDriveByIDBadRequest) Error() string {
return fmt.Sprintf("[PUT /drives/{drive_id}][%d] putGuestDriveByIdBadRequest %+v", 400, o.Payload)
}
func (o *PutGuestDriveByIDBadRequest) GetPayload() *models.Error {
return o.Payload
}
func (o *PutGuestDriveByIDBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(models.Error)
@ -128,10 +127,6 @@ func (o *PutGuestDriveByIDDefault) Error() string {
return fmt.Sprintf("[PUT /drives/{drive_id}][%d] putGuestDriveByID default %+v", o._statusCode, o.Payload)
}
func (o *PutGuestDriveByIDDefault) GetPayload() *models.Error {
return o.Payload
}
func (o *PutGuestDriveByIDDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(models.Error)

View File

@ -24,18 +24,21 @@ type PutGuestNetworkInterfaceByIDReader struct {
// 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 {
@ -86,10 +89,6 @@ func (o *PutGuestNetworkInterfaceByIDBadRequest) Error() string {
return fmt.Sprintf("[PUT /network-interfaces/{iface_id}][%d] putGuestNetworkInterfaceByIdBadRequest %+v", 400, o.Payload)
}
func (o *PutGuestNetworkInterfaceByIDBadRequest) GetPayload() *models.Error {
return o.Payload
}
func (o *PutGuestNetworkInterfaceByIDBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(models.Error)
@ -128,10 +127,6 @@ func (o *PutGuestNetworkInterfaceByIDDefault) Error() string {
return fmt.Sprintf("[PUT /network-interfaces/{iface_id}][%d] putGuestNetworkInterfaceByID default %+v", o._statusCode, o.Payload)
}
func (o *PutGuestNetworkInterfaceByIDDefault) GetPayload() *models.Error {
return o.Payload
}
func (o *PutGuestNetworkInterfaceByIDDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(models.Error)

View File

@ -1,160 +0,0 @@
// Code generated by go-swagger; DO NOT EDIT.
package operations
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"net/http"
"time"
"github.com/go-openapi/errors"
"github.com/go-openapi/runtime"
cr "github.com/go-openapi/runtime/client"
strfmt "github.com/go-openapi/strfmt"
models "github.com/kata-containers/runtime/virtcontainers/pkg/firecracker/client/models"
)
// 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 *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 *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 *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,145 +0,0 @@
// Code generated by go-swagger; DO NOT EDIT.
package operations
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"fmt"
"io"
"github.com/go-openapi/runtime"
strfmt "github.com/go-openapi/strfmt"
models "github.com/kata-containers/runtime/virtcontainers/pkg/firecracker/client/models"
)
// 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 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
}
}
// NewPutGuestVsockByIDNoContent creates a PutGuestVsockByIDNoContent with default headers values
func NewPutGuestVsockByIDNoContent() *PutGuestVsockByIDNoContent {
return &PutGuestVsockByIDNoContent{}
}
/*PutGuestVsockByIDNoContent handles this case with default header values.
Vsock created/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 *models.Error
}
func (o *PutGuestVsockByIDBadRequest) Error() string {
return fmt.Sprintf("[PUT /vsocks/{id}][%d] putGuestVsockByIdBadRequest %+v", 400, o.Payload)
}
func (o *PutGuestVsockByIDBadRequest) GetPayload() *models.Error {
return o.Payload
}
func (o *PutGuestVsockByIDBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// 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 *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) GetPayload() *models.Error {
return o.Payload
}
func (o *PutGuestVsockByIDDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}

View File

@ -0,0 +1,139 @@
// Code generated by go-swagger; DO NOT EDIT.
package operations
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"net/http"
"time"
"github.com/go-openapi/errors"
"github.com/go-openapi/runtime"
cr "github.com/go-openapi/runtime/client"
strfmt "github.com/go-openapi/strfmt"
models "github.com/kata-containers/runtime/virtcontainers/pkg/firecracker/client/models"
)
// NewPutGuestVsockParams creates a new PutGuestVsockParams object
// with the default values initialized.
func NewPutGuestVsockParams() *PutGuestVsockParams {
var ()
return &PutGuestVsockParams{
timeout: cr.DefaultTimeout,
}
}
// NewPutGuestVsockParamsWithTimeout creates a new PutGuestVsockParams object
// with the default values initialized, and the ability to set a timeout on a request
func NewPutGuestVsockParamsWithTimeout(timeout time.Duration) *PutGuestVsockParams {
var ()
return &PutGuestVsockParams{
timeout: timeout,
}
}
// NewPutGuestVsockParamsWithContext creates a new PutGuestVsockParams object
// with the default values initialized, and the ability to set a context for a request
func NewPutGuestVsockParamsWithContext(ctx context.Context) *PutGuestVsockParams {
var ()
return &PutGuestVsockParams{
Context: ctx,
}
}
// NewPutGuestVsockParamsWithHTTPClient creates a new PutGuestVsockParams object
// with the default values initialized, and the ability to set a custom HTTPClient for a request
func NewPutGuestVsockParamsWithHTTPClient(client *http.Client) *PutGuestVsockParams {
var ()
return &PutGuestVsockParams{
HTTPClient: client,
}
}
/*PutGuestVsockParams contains all the parameters to send to the API endpoint
for the put guest vsock operation typically these are written to a http.Request
*/
type PutGuestVsockParams struct {
/*Body
Guest vsock properties
*/
Body *models.Vsock
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// WithTimeout adds the timeout to the put guest vsock params
func (o *PutGuestVsockParams) WithTimeout(timeout time.Duration) *PutGuestVsockParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the put guest vsock params
func (o *PutGuestVsockParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the put guest vsock params
func (o *PutGuestVsockParams) WithContext(ctx context.Context) *PutGuestVsockParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the put guest vsock params
func (o *PutGuestVsockParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the put guest vsock params
func (o *PutGuestVsockParams) WithHTTPClient(client *http.Client) *PutGuestVsockParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the put guest vsock params
func (o *PutGuestVsockParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithBody adds the body to the put guest vsock params
func (o *PutGuestVsockParams) WithBody(body *models.Vsock) *PutGuestVsockParams {
o.SetBody(body)
return o
}
// SetBody adds the body to the put guest vsock params
func (o *PutGuestVsockParams) SetBody(body *models.Vsock) {
o.Body = body
}
// WriteToRequest writes these params to a swagger request
func (o *PutGuestVsockParams) 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

@ -0,0 +1,140 @@
// Code generated by go-swagger; DO NOT EDIT.
package operations
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"fmt"
"io"
"github.com/go-openapi/runtime"
strfmt "github.com/go-openapi/strfmt"
models "github.com/kata-containers/runtime/virtcontainers/pkg/firecracker/client/models"
)
// PutGuestVsockReader is a Reader for the PutGuestVsock structure.
type PutGuestVsockReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *PutGuestVsockReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 204:
result := NewPutGuestVsockNoContent()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 400:
result := NewPutGuestVsockBadRequest()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
default:
result := NewPutGuestVsockDefault(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
}
}
// NewPutGuestVsockNoContent creates a PutGuestVsockNoContent with default headers values
func NewPutGuestVsockNoContent() *PutGuestVsockNoContent {
return &PutGuestVsockNoContent{}
}
/*PutGuestVsockNoContent handles this case with default header values.
Vsock created/updated
*/
type PutGuestVsockNoContent struct {
}
func (o *PutGuestVsockNoContent) Error() string {
return fmt.Sprintf("[PUT /vsock][%d] putGuestVsockNoContent ", 204)
}
func (o *PutGuestVsockNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
return nil
}
// NewPutGuestVsockBadRequest creates a PutGuestVsockBadRequest with default headers values
func NewPutGuestVsockBadRequest() *PutGuestVsockBadRequest {
return &PutGuestVsockBadRequest{}
}
/*PutGuestVsockBadRequest handles this case with default header values.
Vsock cannot be created due to bad input
*/
type PutGuestVsockBadRequest struct {
Payload *models.Error
}
func (o *PutGuestVsockBadRequest) Error() string {
return fmt.Sprintf("[PUT /vsock][%d] putGuestVsockBadRequest %+v", 400, o.Payload)
}
func (o *PutGuestVsockBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewPutGuestVsockDefault creates a PutGuestVsockDefault with default headers values
func NewPutGuestVsockDefault(code int) *PutGuestVsockDefault {
return &PutGuestVsockDefault{
_statusCode: code,
}
}
/*PutGuestVsockDefault handles this case with default header values.
Internal server error
*/
type PutGuestVsockDefault struct {
_statusCode int
Payload *models.Error
}
// Code gets the status code for the put guest vsock default response
func (o *PutGuestVsockDefault) Code() int {
return o._statusCode
}
func (o *PutGuestVsockDefault) Error() string {
return fmt.Sprintf("[PUT /vsock][%d] putGuestVsock default %+v", o._statusCode, o.Payload)
}
func (o *PutGuestVsockDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}

View File

@ -24,18 +24,21 @@ type PutLoggerReader struct {
// 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 {
@ -86,10 +89,6 @@ func (o *PutLoggerBadRequest) Error() string {
return fmt.Sprintf("[PUT /logger][%d] putLoggerBadRequest %+v", 400, o.Payload)
}
func (o *PutLoggerBadRequest) GetPayload() *models.Error {
return o.Payload
}
func (o *PutLoggerBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(models.Error)
@ -128,10 +127,6 @@ func (o *PutLoggerDefault) Error() string {
return fmt.Sprintf("[PUT /logger][%d] putLogger default %+v", o._statusCode, o.Payload)
}
func (o *PutLoggerDefault) GetPayload() *models.Error {
return o.Payload
}
func (o *PutLoggerDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(models.Error)

View File

@ -24,18 +24,21 @@ type PutMachineConfigurationReader struct {
// 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 {
@ -86,10 +89,6 @@ func (o *PutMachineConfigurationBadRequest) Error() string {
return fmt.Sprintf("[PUT /machine-config][%d] putMachineConfigurationBadRequest %+v", 400, o.Payload)
}
func (o *PutMachineConfigurationBadRequest) GetPayload() *models.Error {
return o.Payload
}
func (o *PutMachineConfigurationBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(models.Error)
@ -128,10 +127,6 @@ func (o *PutMachineConfigurationDefault) Error() string {
return fmt.Sprintf("[PUT /machine-config][%d] putMachineConfiguration default %+v", o._statusCode, o.Payload)
}
func (o *PutMachineConfigurationDefault) GetPayload() *models.Error {
return o.Payload
}
func (o *PutMachineConfigurationDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(models.Error)

View File

@ -24,18 +24,21 @@ type PutMmdsReader struct {
// 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 {
@ -86,10 +89,6 @@ func (o *PutMmdsBadRequest) Error() string {
return fmt.Sprintf("[PUT /mmds][%d] putMmdsBadRequest %+v", 400, o.Payload)
}
func (o *PutMmdsBadRequest) GetPayload() *models.Error {
return o.Payload
}
func (o *PutMmdsBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(models.Error)
@ -128,10 +127,6 @@ func (o *PutMmdsDefault) Error() string {
return fmt.Sprintf("[PUT /mmds][%d] PutMmds default %+v", o._statusCode, o.Payload)
}
func (o *PutMmdsDefault) GetPayload() *models.Error {
return o.Payload
}
func (o *PutMmdsDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(models.Error)

View File

@ -5,7 +5,7 @@ info:
The API is accessible through HTTP calls on specific URLs
carrying JSON modeled data.
The transport medium is a Unix Domain Socket.
version: 0.18.0
version: 0.19.0
termsOfService: ""
contact:
email: "compute-capsule@amazon.com"
@ -353,19 +353,15 @@ paths:
schema:
$ref: "#/definitions/Error"
/vsocks/{id}:
/vsock:
put:
summary: Creates new vsock with ID specified by the id parameter.
summary: Creates/updates a vsock device.
description:
If the vsock device with the specified ID already exists, its body will
be updated based on the new input. May fail if update is not possible.
operationId: putGuestVsockByID
The first call creates the device with the configuration specified
in body. Subsequent calls will update the device configuration.
May fail if update is not possible.
operationId: putGuestVsock
parameters:
- name: id
in: path
description: The id of the vsock device
required: true
type: string
- name: body
in: body
description: Guest vsock properties
@ -481,8 +477,6 @@ definitions:
- Uninitialized
- Starting
- Running
- Halting
- Halted
vmm_version:
description: MicroVM hypervisor build version.
type: string