openapi

package
v0.0.0-...-1b70f73 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2022 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.11.0 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 CreateInstanceJSONBody

type CreateInstanceJSONBody = CreateInstanceRequestBody

CreateInstanceJSONBody defines parameters for CreateInstance.

type CreateInstanceJSONRequestBody

type CreateInstanceJSONRequestBody = CreateInstanceJSONBody

CreateInstanceJSONRequestBody defines body for CreateInstance for application/json ContentType.

type CreateInstanceRequestBody

type CreateInstanceRequestBody struct {
	BaseImage string   `json:"base_image"`
	Cpu       int      `json:"cpu"`
	DiskSize  int      `json:"disk_size"`
	Memory    int      `json:"memory"`
	Networks  []string `json:"networks"`
	UserData  *string  `json:"user_data,omitempty"`
}

CreateInstanceRequestBody defines model for CreateInstanceRequestBody.

type CreateInstanceResponseBody

type CreateInstanceResponseBody struct {
	InstanceId string `json:"instance_id"`
	JobId      string `json:"job_id"`
}

CreateInstanceResponseBody defines model for CreateInstanceResponseBody.

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 Error

type Error struct {
	Code    int32  `json:"code"`
	Message string `json:"message"`
}

Error defines model for Error.

type Instance

type Instance struct {
	Cpu        int                `json:"cpu"`
	Interfaces []NetworkInterface `json:"interfaces"`
	Memory     int                `json:"memory"`
	Node       string             `json:"node"`
	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 (
	InstanceStateCREATING InstanceState = "CREATING"
	InstanceStateDELETED  InstanceState = "DELETED"
	InstanceStateDELETING InstanceState = "DELETING"
	InstanceStateERROR    InstanceState = "ERROR"
	InstanceStatePENDING  InstanceState = "PENDING"
	InstanceStateRUNNING  InstanceState = "RUNNING"
	InstanceStateSTOPPED  InstanceState = "STOPPED"
)

Defines values for InstanceState.

type Job

type Job struct {
	CreatedAt int64    `json:"created_at"`
	JobId     string   `json:"job_id"`
	JobType   string   `json:"job_type"`
	State     JobState `json:"state"`
	StateText string   `json:"state_text"`
}

Job defines model for Job.

type JobRef

type JobRef struct {
	JobId string `json:"job_id"`
}

JobRef defines model for JobRef.

type JobState

type JobState string

JobState defines model for Job.State.

const (
	JobStateDONE    JobState = "DONE"
	JobStateFAILED  JobState = "FAILED"
	JobStateQUEUED  JobState = "QUEUED"
	JobStateRUNNING JobState = "RUNNING"
)

Defines values for JobState.

type Network

type Network struct {
	Id string `json:"id"`
}

Network defines model for Network.

type NetworkInterface

type NetworkInterface struct {
	Addresses []string `json:"addresses"`
	Mac       string   `json:"mac"`
	Network   string   `json:"network"`
}

NetworkInterface defines model for NetworkInterface.

type ProvisioningEndpoints

type ProvisioningEndpoints struct {
	Grpc string `json:"grpc"`
	Step string `json:"step"`
}

ProvisioningEndpoints defines model for ProvisioningEndpoints.

type ProvisioningInfo

type ProvisioningInfo struct {
	CaFingerprint string                `json:"ca_fingerprint"`
	Endpoints     ProvisioningEndpoints `json:"endpoints"`
}

ProvisioningInfo defines model for ProvisioningInfo.

type ServerInterface

type ServerInterface interface {

	// (GET /.well-known/rhyzome/ca.pem)
	ProvisioningCaPem(ctx echo.Context) error

	// (GET /.well-known/rhyzome/provisioning.json)
	ProvisioningInfo(ctx echo.Context) error

	// (GET /legacyapi/v0/instance)
	ListAllInstances(ctx echo.Context) error

	// (POST /legacyapi/v0/instance)
	CreateInstance(ctx echo.Context) error

	// (DELETE /legacyapi/v0/instance/{id})
	DeleteInstance(ctx echo.Context, id string) error

	// (GET /legacyapi/v0/instance/{id})
	GetInstance(ctx echo.Context, id string) error

	// (POST /legacyapi/v0/instance/{id}/start)
	StartInstance(ctx echo.Context, id string) error

	// (POST /legacyapi/v0/instance/{id}/stop)
	StopInstance(ctx echo.Context, id string) error

	// (GET /legacyapi/v0/jobs/{id})
	GetJob(ctx echo.Context, id string) error

	// (GET /legacyapi/v0/jobs/{id}/stream)
	StreamJob(ctx echo.Context, id string) error

	// (GET /legacyapi/v0/network)
	ListAllNetworks(ctx echo.Context) error

	// (POST /legacyapi/v0/network)
	CreateNetwork(ctx echo.Context) error

	// (DELETE /legacyapi/v0/network/{id})
	DeleteNetwork(ctx echo.Context, id string) error

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

ServerInterface represents all server handlers.

type ServerInterfaceWrapper

type ServerInterfaceWrapper struct {
	Handler ServerInterface
}

ServerInterfaceWrapper converts echo contexts to parameters.

func (*ServerInterfaceWrapper) CreateInstance

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

CreateInstance converts echo context to params.

func (*ServerInterfaceWrapper) CreateNetwork

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

CreateNetwork converts echo context to params.

func (*ServerInterfaceWrapper) DeleteInstance

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

DeleteInstance converts echo context to params.

func (*ServerInterfaceWrapper) DeleteNetwork

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

DeleteNetwork converts echo context to params.

func (*ServerInterfaceWrapper) GetInstance

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

GetInstance converts echo context to params.

func (*ServerInterfaceWrapper) GetJob

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

GetJob converts echo context to params.

func (*ServerInterfaceWrapper) GetNetwork

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

GetNetwork converts echo context to params.

func (*ServerInterfaceWrapper) ListAllInstances

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

ListAllInstances converts echo context to params.

func (*ServerInterfaceWrapper) ListAllNetworks

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

ListAllNetworks converts echo context to params.

func (*ServerInterfaceWrapper) ProvisioningCaPem

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

ProvisioningCaPem converts echo context to params.

func (*ServerInterfaceWrapper) ProvisioningInfo

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

ProvisioningInfo 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) StreamJob

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

StreamJob converts echo context to params.

Jump to

Keyboard shortcuts

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