openapi

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 22, 2023 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Overview

Package openapi provides primitives to interact with the openapi HTTP API.

Code generated by github.com/deepmap/oapi-codegen version v1.12.4 DO NOT EDIT.

Index

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 AddHostBody

type AddHostBody struct {
	Id       string `json:"id"`
	Instance string `json:"instance"`
	Mac      string `json:"mac"`

	// UserData base64-encoded user data
	UserData string `json:"user_data"`
}

AddHostBody defines model for AddHostBody.

type AddHostJSONRequestBody

type AddHostJSONRequestBody = AddHostBody

AddHostJSONRequestBody defines body for AddHost for application/json ContentType.

type AddPortForward

type AddPortForward struct {
	Host       string `json:"host"`
	HostPort   int    `json:"host_port"`
	PublicIp   string `json:"public_ip"`
	PublicPort int    `json:"public_port"`
}

AddPortForward defines model for AddPortForward.

type AddPortForwardJSONRequestBody

type AddPortForwardJSONRequestBody = AddPortForward

AddPortForwardJSONRequestBody defines body for AddPortForward for application/json ContentType.

type AddPublicIPBody

type AddPublicIPBody struct {
	Address string `json:"address"`
	Router  string `json:"router"`
}

AddPublicIPBody defines model for AddPublicIPBody.

type AddPublicIpJSONRequestBody

type AddPublicIpJSONRequestBody = AddPublicIPBody

AddPublicIpJSONRequestBody defines body for AddPublicIp for application/json ContentType.

type AddPublicSubnetBody

type AddPublicSubnetBody struct {
	Subnet string `json:"subnet"`
}

AddPublicSubnetBody defines model for AddPublicSubnetBody.

type AddPublicSubnetJSONRequestBody

type AddPublicSubnetJSONRequestBody = AddPublicSubnetBody

AddPublicSubnetJSONRequestBody defines body for AddPublicSubnet for application/json ContentType.

type CreateNetworkBody

type CreateNetworkBody struct {
	// SubnetSize the size of the subnet, as it would appear in CIDR notation. Default is 24, for a subnet of 255 addresses
	SubnetSize *int `json:"subnet_size,omitempty"`
}

CreateNetworkBody defines model for CreateNetworkBody.

type CreateNetworkJSONRequestBody

type CreateNetworkJSONRequestBody = CreateNetworkBody

CreateNetworkJSONRequestBody defines body for CreateNetwork for application/json ContentType.

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 GenerateRouterBootDataJSONRequestBody

type GenerateRouterBootDataJSONRequestBody = RouterBootDataRequest

GenerateRouterBootDataJSONRequestBody defines body for GenerateRouterBootData for application/json ContentType.

type GetPortForwardsParams

type GetPortForwardsParams struct {
	// Ip only return port forwards for this IP
	Ip *string `form:"ip,omitempty" json:"ip,omitempty"`

	// Host only return port forwards for this host
	Host *string `form:"host,omitempty" json:"host,omitempty"`
}

GetPortForwardsParams defines parameters for GetPortForwards.

type Host

type Host struct {
	Addresses []string `json:"addresses"`
	Id        string   `json:"id"`
	Instance  string   `json:"instance"`
	Mac       string   `json:"mac"`
	Network   string   `json:"network"`
}

Host defines model for Host.

type Network

type Network struct {
	Id     string `json:"id"`
	Subnet string `json:"subnet"`
	Vlan   *int   `json:"vlan,omitempty"`
}

Network defines model for Network.

type NewHostDetails

type NewHostDetails struct {
	Addresses []string `json:"addresses"`
	Vlan      int      `json:"vlan"`
}

NewHostDetails defines model for NewHostDetails.

type NewRouterBootData

type NewRouterBootData struct {
	Biosdata string `json:"biosdata"`
}

NewRouterBootData defines model for NewRouterBootData.

type PortForward

type PortForward struct {
	Host       string `json:"host"`
	HostPort   int    `json:"host_port"`
	Id         string `json:"id"`
	PublicIp   string `json:"public_ip"`
	PublicPort int    `json:"public_port"`
}

PortForward defines model for PortForward.

type PublicIP

type PublicIP struct {
	Address string `json:"address"`
	Router  string `json:"router"`
	Subnet  string `json:"subnet"`
}

PublicIP defines model for PublicIP.

type PublicSubnet

type PublicSubnet struct {
	Id     string `json:"id"`
	Subnet string `json:"subnet"`
}

PublicSubnet defines model for PublicSubnet.

type Router

type Router struct {
	Id       string `json:"id"`
	Instance string `json:"instance"`
}

Router defines model for Router.

type RouterBootDataRequest

type RouterBootDataRequest struct {
	Hostname string `json:"hostname"`
}

RouterBootDataRequest defines model for RouterBootDataRequest.

type ServerInterface

type ServerInterface interface {

	// (GET /networks/v0/network/{id})
	GetNetwork(ctx echo.Context, id string) error

	// (GET /networks/v0/network/{id}/hosts)
	GetHostsByNetwork(ctx echo.Context, id string) error

	// (POST /networks/v0/network/{id}/hosts)
	AddHost(ctx echo.Context, id string) error

	// (GET /networks/v0/networks)
	ListAllNetworks(ctx echo.Context) error

	// (POST /networks/v0/networks)
	CreateNetwork(ctx echo.Context) error

	// (GET /networks/v0/port-forwards)
	GetPortForwards(ctx echo.Context, params GetPortForwardsParams) error

	// (POST /networks/v0/port-forwards)
	AddPortForward(ctx echo.Context) error

	// (DELETE /networks/v0/port-forwards/{id})
	DeletePortForward(ctx echo.Context, id string) error

	// (GET /networks/v0/public-subnets)
	ListPublicSubnets(ctx echo.Context) error

	// (POST /networks/v0/public-subnets)
	AddPublicSubnet(ctx echo.Context) error

	// (GET /networks/v0/public-subnets/{subnet})
	GetPublicSubnet(ctx echo.Context, subnet string) error

	// (GET /networks/v0/public-subnets/{subnet}/ips)
	GetPublicIps(ctx echo.Context, subnet string) error

	// (POST /networks/v0/public-subnets/{subnet}/ips)
	AddPublicIp(ctx echo.Context, subnet string) error

	// (GET /networks/v0/routers)
	GetRouters(ctx echo.Context) error

	// (POST /networks/v0/routers)
	AddRouter(ctx echo.Context) error

	// (POST /networks/v0/routers/boot-data)
	GenerateRouterBootData(ctx echo.Context) error
}

ServerInterface represents all server handlers.

type ServerInterfaceWrapper

type ServerInterfaceWrapper struct {
	Handler ServerInterface
}

ServerInterfaceWrapper converts echo contexts to parameters.

func (*ServerInterfaceWrapper) AddHost

func (w *ServerInterfaceWrapper) AddHost(ctx echo.Context) error

AddHost converts echo context to params.

func (*ServerInterfaceWrapper) AddPortForward

func (w *ServerInterfaceWrapper) AddPortForward(ctx echo.Context) error

AddPortForward converts echo context to params.

func (*ServerInterfaceWrapper) AddPublicIp

func (w *ServerInterfaceWrapper) AddPublicIp(ctx echo.Context) error

AddPublicIp converts echo context to params.

func (*ServerInterfaceWrapper) AddPublicSubnet

func (w *ServerInterfaceWrapper) AddPublicSubnet(ctx echo.Context) error

AddPublicSubnet converts echo context to params.

func (*ServerInterfaceWrapper) AddRouter

func (w *ServerInterfaceWrapper) AddRouter(ctx echo.Context) error

AddRouter converts echo context to params.

func (*ServerInterfaceWrapper) CreateNetwork

func (w *ServerInterfaceWrapper) CreateNetwork(ctx echo.Context) error

CreateNetwork converts echo context to params.

func (*ServerInterfaceWrapper) DeletePortForward

func (w *ServerInterfaceWrapper) DeletePortForward(ctx echo.Context) error

DeletePortForward converts echo context to params.

func (*ServerInterfaceWrapper) GenerateRouterBootData

func (w *ServerInterfaceWrapper) GenerateRouterBootData(ctx echo.Context) error

GenerateRouterBootData converts echo context to params.

func (*ServerInterfaceWrapper) GetHostsByNetwork

func (w *ServerInterfaceWrapper) GetHostsByNetwork(ctx echo.Context) error

GetHostsByNetwork converts echo context to params.

func (*ServerInterfaceWrapper) GetNetwork

func (w *ServerInterfaceWrapper) GetNetwork(ctx echo.Context) error

GetNetwork converts echo context to params.

func (*ServerInterfaceWrapper) GetPortForwards

func (w *ServerInterfaceWrapper) GetPortForwards(ctx echo.Context) error

GetPortForwards converts echo context to params.

func (*ServerInterfaceWrapper) GetPublicIps

func (w *ServerInterfaceWrapper) GetPublicIps(ctx echo.Context) error

GetPublicIps converts echo context to params.

func (*ServerInterfaceWrapper) GetPublicSubnet

func (w *ServerInterfaceWrapper) GetPublicSubnet(ctx echo.Context) error

GetPublicSubnet converts echo context to params.

func (*ServerInterfaceWrapper) GetRouters

func (w *ServerInterfaceWrapper) GetRouters(ctx echo.Context) error

GetRouters converts echo context to params.

func (*ServerInterfaceWrapper) ListAllNetworks

func (w *ServerInterfaceWrapper) ListAllNetworks(ctx echo.Context) error

ListAllNetworks converts echo context to params.

func (*ServerInterfaceWrapper) ListPublicSubnets

func (w *ServerInterfaceWrapper) ListPublicSubnets(ctx echo.Context) error

ListPublicSubnets converts echo context to params.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL