garm/client/controller_info/controller_info_responses.go
Gabriel Adrian Samfira 99539edde7 Add controller info
This change adds a new controller info endpoint and associated client and
CLI command. The controller info endpoint returns information about controller
status and configuration.

Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2023-08-12 22:47:50 +00:00

174 lines
5 KiB
Go

// Code generated by go-swagger; DO NOT EDIT.
package controller_info
// 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"
"github.com/go-openapi/strfmt"
apiserver_params "github.com/cloudbase/garm/apiserver/params"
garm_params "github.com/cloudbase/garm/params"
)
// ControllerInfoReader is a Reader for the ControllerInfo structure.
type ControllerInfoReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *ControllerInfoReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewControllerInfoOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 409:
result := NewControllerInfoConflict()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
default:
return nil, runtime.NewAPIError("[GET /controller-info] ControllerInfo", response, response.Code())
}
}
// NewControllerInfoOK creates a ControllerInfoOK with default headers values
func NewControllerInfoOK() *ControllerInfoOK {
return &ControllerInfoOK{}
}
/*
ControllerInfoOK describes a response with status code 200, with default header values.
ControllerInfo
*/
type ControllerInfoOK struct {
Payload garm_params.ControllerInfo
}
// IsSuccess returns true when this controller info o k response has a 2xx status code
func (o *ControllerInfoOK) IsSuccess() bool {
return true
}
// IsRedirect returns true when this controller info o k response has a 3xx status code
func (o *ControllerInfoOK) IsRedirect() bool {
return false
}
// IsClientError returns true when this controller info o k response has a 4xx status code
func (o *ControllerInfoOK) IsClientError() bool {
return false
}
// IsServerError returns true when this controller info o k response has a 5xx status code
func (o *ControllerInfoOK) IsServerError() bool {
return false
}
// IsCode returns true when this controller info o k response a status code equal to that given
func (o *ControllerInfoOK) IsCode(code int) bool {
return code == 200
}
// Code gets the status code for the controller info o k response
func (o *ControllerInfoOK) Code() int {
return 200
}
func (o *ControllerInfoOK) Error() string {
return fmt.Sprintf("[GET /controller-info][%d] controllerInfoOK %+v", 200, o.Payload)
}
func (o *ControllerInfoOK) String() string {
return fmt.Sprintf("[GET /controller-info][%d] controllerInfoOK %+v", 200, o.Payload)
}
func (o *ControllerInfoOK) GetPayload() garm_params.ControllerInfo {
return o.Payload
}
func (o *ControllerInfoOK) 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
}
// NewControllerInfoConflict creates a ControllerInfoConflict with default headers values
func NewControllerInfoConflict() *ControllerInfoConflict {
return &ControllerInfoConflict{}
}
/*
ControllerInfoConflict describes a response with status code 409, with default header values.
APIErrorResponse
*/
type ControllerInfoConflict struct {
Payload apiserver_params.APIErrorResponse
}
// IsSuccess returns true when this controller info conflict response has a 2xx status code
func (o *ControllerInfoConflict) IsSuccess() bool {
return false
}
// IsRedirect returns true when this controller info conflict response has a 3xx status code
func (o *ControllerInfoConflict) IsRedirect() bool {
return false
}
// IsClientError returns true when this controller info conflict response has a 4xx status code
func (o *ControllerInfoConflict) IsClientError() bool {
return true
}
// IsServerError returns true when this controller info conflict response has a 5xx status code
func (o *ControllerInfoConflict) IsServerError() bool {
return false
}
// IsCode returns true when this controller info conflict response a status code equal to that given
func (o *ControllerInfoConflict) IsCode(code int) bool {
return code == 409
}
// Code gets the status code for the controller info conflict response
func (o *ControllerInfoConflict) Code() int {
return 409
}
func (o *ControllerInfoConflict) Error() string {
return fmt.Sprintf("[GET /controller-info][%d] controllerInfoConflict %+v", 409, o.Payload)
}
func (o *ControllerInfoConflict) String() string {
return fmt.Sprintf("[GET /controller-info][%d] controllerInfoConflict %+v", 409, o.Payload)
}
func (o *ControllerInfoConflict) GetPayload() apiserver_params.APIErrorResponse {
return o.Payload
}
func (o *ControllerInfoConflict) 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
}