Documentation ¶
Overview ¶
Package openapi provides primitives to interact with the openapi HTTP API.
Code generated by github.com/deepmap/oapi-codegen version v1.12.5-0.20230314231417-0cfaaa77a7d2 DO NOT EDIT.
Index ¶
- func RegisterHandlers(router EchoRouter, si ServerInterface)
- func RegisterHandlersWithBaseURL(router EchoRouter, si ServerInterface, baseURL string)
- type AttachNicJSONBody
- type AttachNicJSONRequestBody
- type CreateInstanceJSONRequestBody
- type CreateInstanceRequestBody
- type EchoRouter
- type Instance
- type InstanceState
- type NetworkInterface
- type ServerInterface
- type ServerInterfaceWrapper
- func (w *ServerInterfaceWrapper) AttachNic(ctx echo.Context) error
- func (w *ServerInterfaceWrapper) BootstrapComplete(ctx echo.Context) error
- func (w *ServerInterfaceWrapper) BootstrapSystemNetworkReady(ctx echo.Context) error
- func (w *ServerInterfaceWrapper) CreateInstance(ctx echo.Context) error
- func (w *ServerInterfaceWrapper) DeleteInstance(ctx echo.Context) error
- func (w *ServerInterfaceWrapper) GetInstance(ctx echo.Context) error
- func (w *ServerInterfaceWrapper) ListAllInstances(ctx echo.Context) error
- func (w *ServerInterfaceWrapper) RemoveNic(ctx echo.Context) error
- func (w *ServerInterfaceWrapper) StartInstance(ctx echo.Context) error
- func (w *ServerInterfaceWrapper) StopInstance(ctx echo.Context) error
- func (w *ServerInterfaceWrapper) TrunkNicAddNetwork(ctx echo.Context) error
- type TrunkNicAddNetworkJSONBody
- type TrunkNicAddNetworkJSONRequestBody
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterHandlers ¶
func RegisterHandlers(router EchoRouter, si ServerInterface)
RegisterHandlers adds each server route to the EchoRouter.
func RegisterHandlersWithBaseURL ¶
func RegisterHandlersWithBaseURL(router EchoRouter, si ServerInterface, baseURL string)
Registers handlers, and prepends BaseURL to the paths, so that the paths can be served under a prefix.
Types ¶
type AttachNicJSONBody ¶
type AttachNicJSONBody = string
AttachNicJSONBody defines parameters for AttachNic.
type AttachNicJSONRequestBody ¶
type AttachNicJSONRequestBody = AttachNicJSONBody
AttachNicJSONRequestBody defines body for AttachNic for application/json ContentType.
type CreateInstanceJSONRequestBody ¶
type CreateInstanceJSONRequestBody = CreateInstanceRequestBody
CreateInstanceJSONRequestBody defines body for CreateInstance for application/json ContentType.
type CreateInstanceRequestBody ¶
type CreateInstanceRequestBody struct { // BaseImage URL will be downloaded and written to the root disk if the system does not use qcow2 storage BaseImage string `json:"base_image"` // BaseImageQcow2 URL will be downloaded and written to the root disk if the system uses qcow2 storage BaseImageQcow2 string `json:"base_image_qcow2"` // Cpu number of CPU cores to allocate to the new instance Cpu int `json:"cpu"` // DiskSize the size of the root disk, in gigabytes DiskSize int `json:"disk_size"` // Memory memory (in MB) to allocate to the new instance Memory int `json:"memory"` // Networks a list of networks to connect the new instance to. a NIC will be added for each network. Networks []string `json:"networks"` // SpecialCases a list of special cases to apply to the new instance SpecialCases *[]string `json:"special_cases,omitempty"` // UserData arbitrary data that will be available to the VM UserData *string `json:"user_data,omitempty"` }
CreateInstanceRequestBody defines model for CreateInstanceRequestBody.
type EchoRouter ¶
type EchoRouter interface { CONNECT(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route DELETE(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route GET(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route HEAD(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route OPTIONS(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route PATCH(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route POST(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route PUT(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route TRACE(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route }
This is a simple interface which specifies echo.Route addition functions which are present on both echo.Echo and echo.Group, since we want to allow using either of them for path registration
type Instance ¶
type Instance struct { Cpu int `json:"cpu"` Interfaces []NetworkInterface `json:"interfaces"` Memory int `json:"memory"` Node *string `json:"node,omitempty"` ResourceId string `json:"resource_id"` RootVolume string `json:"root_volume"` State InstanceState `json:"state"` UserData *string `json:"user_data,omitempty"` }
Instance defines model for Instance.
type InstanceState ¶
type InstanceState string
InstanceState defines model for Instance.State.
const ( CREATING InstanceState = "CREATING" DELETED InstanceState = "DELETED" DELETING InstanceState = "DELETING" ERROR InstanceState = "ERROR" PENDING InstanceState = "PENDING" RUNNING InstanceState = "RUNNING" STARTING InstanceState = "STARTING" STOPPED InstanceState = "STOPPED" STOPPING InstanceState = "STOPPING" )
Defines values for InstanceState.
type NetworkInterface ¶
type NetworkInterface struct { Addresses []string `json:"addresses"` Id string `json:"id"` Mac string `json:"mac"` Network string `json:"network"` // Trunk indicates this port NIC will receive vlan-tagged traffic Trunk *bool `json:"trunk,omitempty"` }
NetworkInterface defines model for NetworkInterface.
type ServerInterface ¶
type ServerInterface interface { // (POST /instances/v0/bootstrap-complete) BootstrapComplete(ctx echo.Context) error // (POST /instances/v0/bootstrap-system-network-ready) BootstrapSystemNetworkReady(ctx echo.Context) error // (GET /instances/v0/instance) ListAllInstances(ctx echo.Context) error // (POST /instances/v0/instance) CreateInstance(ctx echo.Context) error // (DELETE /instances/v0/instance/{id}) DeleteInstance(ctx echo.Context, id string) error // (GET /instances/v0/instance/{id}) GetInstance(ctx echo.Context, id string) error // (DELETE /instances/v0/instance/{id}/nic/{nic}) RemoveNic(ctx echo.Context, id string, nic string) error // (POST /instances/v0/instance/{id}/nic/{nic}/add-trunk-vlan) TrunkNicAddNetwork(ctx echo.Context, id string, nic string) error // (POST /instances/v0/instance/{id}/start) StartInstance(ctx echo.Context, id string) error // (POST /instances/v0/instance/{id}/stop) StopInstance(ctx echo.Context, id string) error // (POST /instances/v0/instance/{instance}/nic) AttachNic(ctx echo.Context, instance string) error }
ServerInterface represents all server handlers.
type ServerInterfaceWrapper ¶
type ServerInterfaceWrapper struct {
Handler ServerInterface
}
ServerInterfaceWrapper converts echo contexts to parameters.
func (*ServerInterfaceWrapper) AttachNic ¶
func (w *ServerInterfaceWrapper) AttachNic(ctx echo.Context) error
AttachNic converts echo context to params.
func (*ServerInterfaceWrapper) BootstrapComplete ¶
func (w *ServerInterfaceWrapper) BootstrapComplete(ctx echo.Context) error
BootstrapComplete converts echo context to params.
func (*ServerInterfaceWrapper) BootstrapSystemNetworkReady ¶
func (w *ServerInterfaceWrapper) BootstrapSystemNetworkReady(ctx echo.Context) error
BootstrapSystemNetworkReady converts echo context to params.
func (*ServerInterfaceWrapper) CreateInstance ¶
func (w *ServerInterfaceWrapper) CreateInstance(ctx echo.Context) error
CreateInstance converts echo context to params.
func (*ServerInterfaceWrapper) DeleteInstance ¶
func (w *ServerInterfaceWrapper) DeleteInstance(ctx echo.Context) error
DeleteInstance converts echo context to params.
func (*ServerInterfaceWrapper) GetInstance ¶
func (w *ServerInterfaceWrapper) GetInstance(ctx echo.Context) error
GetInstance converts echo context to params.
func (*ServerInterfaceWrapper) ListAllInstances ¶
func (w *ServerInterfaceWrapper) ListAllInstances(ctx echo.Context) error
ListAllInstances converts echo context to params.
func (*ServerInterfaceWrapper) RemoveNic ¶
func (w *ServerInterfaceWrapper) RemoveNic(ctx echo.Context) error
RemoveNic converts echo context to params.
func (*ServerInterfaceWrapper) StartInstance ¶
func (w *ServerInterfaceWrapper) StartInstance(ctx echo.Context) error
StartInstance converts echo context to params.
func (*ServerInterfaceWrapper) StopInstance ¶
func (w *ServerInterfaceWrapper) StopInstance(ctx echo.Context) error
StopInstance converts echo context to params.
func (*ServerInterfaceWrapper) TrunkNicAddNetwork ¶
func (w *ServerInterfaceWrapper) TrunkNicAddNetwork(ctx echo.Context) error
TrunkNicAddNetwork converts echo context to params.
type TrunkNicAddNetworkJSONBody ¶
type TrunkNicAddNetworkJSONBody = string
TrunkNicAddNetworkJSONBody defines parameters for TrunkNicAddNetwork.
type TrunkNicAddNetworkJSONRequestBody ¶
type TrunkNicAddNetworkJSONRequestBody = TrunkNicAddNetworkJSONBody
TrunkNicAddNetworkJSONRequestBody defines body for TrunkNicAddNetwork for application/json ContentType.