client

package
v0.0.0-...-c0b5b33 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildControlShutdownPayload

func BuildControlShutdownPayload(spinApiserverControlShutdownID string) (*spinapiserver.ControlShutdownPayload, error)

BuildControlShutdownPayload builds the payload for the spin-apiserver control_shutdown endpoint from CLI flags.

func BuildControlStartPayload

func BuildControlStartPayload(spinApiserverControlStartID string) (*spinapiserver.ControlStartPayload, error)

BuildControlStartPayload builds the payload for the spin-apiserver control_start endpoint from CLI flags.

func BuildControlStopPayload

func BuildControlStopPayload(spinApiserverControlStopID string) (*spinapiserver.ControlStopPayload, error)

BuildControlStopPayload builds the payload for the spin-apiserver control_stop endpoint from CLI flags.

func BuildVMCreatePayload

func BuildVMCreatePayload(spinApiserverVMCreateBody string) (*spinapiserver.CreateVM, error)

BuildVMCreatePayload builds the payload for the spin-apiserver vm_create endpoint from CLI flags.

func BuildVMDeletePayload

func BuildVMDeletePayload(spinApiserverVMDeleteID string) (*spinapiserver.VMDeletePayload, error)

BuildVMDeletePayload builds the payload for the spin-apiserver vm_delete endpoint from CLI flags.

func BuildVMGetPayload

func BuildVMGetPayload(spinApiserverVMGetID string) (*spinapiserver.VMGetPayload, error)

BuildVMGetPayload builds the payload for the spin-apiserver vm_get endpoint from CLI flags.

func BuildVMUpdatePayload

func BuildVMUpdatePayload(spinApiserverVMUpdateBody string, spinApiserverVMUpdateID string) (*spinapiserver.VMUpdatePayload, error)

BuildVMUpdatePayload builds the payload for the spin-apiserver vm_update endpoint from CLI flags.

func ControlShutdownSpinApiserverPath

func ControlShutdownSpinApiserverPath(id uint64) string

ControlShutdownSpinApiserverPath returns the URL path to the spin-apiserver service control_shutdown HTTP endpoint.

func ControlStartSpinApiserverPath

func ControlStartSpinApiserverPath(id uint64) string

ControlStartSpinApiserverPath returns the URL path to the spin-apiserver service control_start HTTP endpoint.

func ControlStopSpinApiserverPath

func ControlStopSpinApiserverPath(id uint64) string

ControlStopSpinApiserverPath returns the URL path to the spin-apiserver service control_stop HTTP endpoint.

func DecodeControlShutdownResponse

func DecodeControlShutdownResponse(decoder func(*http.Response) goahttp.Decoder, restoreBody bool) func(*http.Response) (interface{}, error)

DecodeControlShutdownResponse returns a decoder for responses returned by the spin-apiserver control_shutdown endpoint. restoreBody controls whether the response body should be restored after having been read.

func DecodeControlStartResponse

func DecodeControlStartResponse(decoder func(*http.Response) goahttp.Decoder, restoreBody bool) func(*http.Response) (interface{}, error)

DecodeControlStartResponse returns a decoder for responses returned by the spin-apiserver control_start endpoint. restoreBody controls whether the response body should be restored after having been read.

func DecodeControlStopResponse

func DecodeControlStopResponse(decoder func(*http.Response) goahttp.Decoder, restoreBody bool) func(*http.Response) (interface{}, error)

DecodeControlStopResponse returns a decoder for responses returned by the spin-apiserver control_stop endpoint. restoreBody controls whether the response body should be restored after having been read.

func DecodeVMCreateResponse

func DecodeVMCreateResponse(decoder func(*http.Response) goahttp.Decoder, restoreBody bool) func(*http.Response) (interface{}, error)

DecodeVMCreateResponse returns a decoder for responses returned by the spin-apiserver vm_create endpoint. restoreBody controls whether the response body should be restored after having been read.

func DecodeVMDeleteResponse

func DecodeVMDeleteResponse(decoder func(*http.Response) goahttp.Decoder, restoreBody bool) func(*http.Response) (interface{}, error)

DecodeVMDeleteResponse returns a decoder for responses returned by the spin-apiserver vm_delete endpoint. restoreBody controls whether the response body should be restored after having been read.

func DecodeVMGetResponse

func DecodeVMGetResponse(decoder func(*http.Response) goahttp.Decoder, restoreBody bool) func(*http.Response) (interface{}, error)

DecodeVMGetResponse returns a decoder for responses returned by the spin-apiserver vm_get endpoint. restoreBody controls whether the response body should be restored after having been read.

func DecodeVMListResponse

func DecodeVMListResponse(decoder func(*http.Response) goahttp.Decoder, restoreBody bool) func(*http.Response) (interface{}, error)

DecodeVMListResponse returns a decoder for responses returned by the spin-apiserver vm_list endpoint. restoreBody controls whether the response body should be restored after having been read.

func DecodeVMUpdateResponse

func DecodeVMUpdateResponse(decoder func(*http.Response) goahttp.Decoder, restoreBody bool) func(*http.Response) (interface{}, error)

DecodeVMUpdateResponse returns a decoder for responses returned by the spin-apiserver vm_update endpoint. restoreBody controls whether the response body should be restored after having been read.

func EncodeVMCreateRequest

func EncodeVMCreateRequest(encoder func(*http.Request) goahttp.Encoder) func(*http.Request, interface{}) error

EncodeVMCreateRequest returns an encoder for requests sent to the spin-apiserver vm_create server.

func EncodeVMUpdateRequest

func EncodeVMUpdateRequest(encoder func(*http.Request) goahttp.Encoder) func(*http.Request, interface{}) error

EncodeVMUpdateRequest returns an encoder for requests sent to the spin-apiserver vm_update server.

func NewVMGetUpdatedVMOK

func NewVMGetUpdatedVMOK(body *VMGetResponseBody) *spinapiserver.UpdatedVM

NewVMGetUpdatedVMOK builds a "spin-apiserver" service "vm_get" endpoint result from a HTTP "OK" response.

func VMCreateSpinApiserverPath

func VMCreateSpinApiserverPath() string

VMCreateSpinApiserverPath returns the URL path to the spin-apiserver service vm_create HTTP endpoint.

func VMDeleteSpinApiserverPath

func VMDeleteSpinApiserverPath(id uint64) string

VMDeleteSpinApiserverPath returns the URL path to the spin-apiserver service vm_delete HTTP endpoint.

func VMGetSpinApiserverPath

func VMGetSpinApiserverPath(id uint64) string

VMGetSpinApiserverPath returns the URL path to the spin-apiserver service vm_get HTTP endpoint.

func VMListSpinApiserverPath

func VMListSpinApiserverPath() string

VMListSpinApiserverPath returns the URL path to the spin-apiserver service vm_list HTTP endpoint.

func VMUpdateSpinApiserverPath

func VMUpdateSpinApiserverPath(id uint64) string

VMUpdateSpinApiserverPath returns the URL path to the spin-apiserver service vm_update HTTP endpoint.

func ValidateImageResponseBody

func ValidateImageResponseBody(body *ImageResponseBody) (err error)

ValidateImageResponseBody runs the validations defined on ImageResponseBody

func ValidateUpdatedVMRequestBody

func ValidateUpdatedVMRequestBody(body *UpdatedVMRequestBody) (err error)

ValidateUpdatedVMRequestBody runs the validations defined on UpdatedVMRequestBody

func ValidateVMGetResponseBody

func ValidateVMGetResponseBody(body *VMGetResponseBody) (err error)

ValidateVMGetResponseBody runs the validations defined on vm_get_response_body

Types

type Client

type Client struct {
	// VMCreate Doer is the HTTP client used to make requests to the vm_create
	// endpoint.
	VMCreateDoer goahttp.Doer

	// VMDelete Doer is the HTTP client used to make requests to the vm_delete
	// endpoint.
	VMDeleteDoer goahttp.Doer

	// VMList Doer is the HTTP client used to make requests to the vm_list endpoint.
	VMListDoer goahttp.Doer

	// VMGet Doer is the HTTP client used to make requests to the vm_get endpoint.
	VMGetDoer goahttp.Doer

	// VMUpdate Doer is the HTTP client used to make requests to the vm_update
	// endpoint.
	VMUpdateDoer goahttp.Doer

	// ControlStart Doer is the HTTP client used to make requests to the
	// control_start endpoint.
	ControlStartDoer goahttp.Doer

	// ControlStop Doer is the HTTP client used to make requests to the
	// control_stop endpoint.
	ControlStopDoer goahttp.Doer

	// ControlShutdown Doer is the HTTP client used to make requests to the
	// control_shutdown endpoint.
	ControlShutdownDoer goahttp.Doer

	// RestoreResponseBody controls whether the response bodies are reset after
	// decoding so they can be read again.
	RestoreResponseBody bool
	// contains filtered or unexported fields
}

Client lists the spin-apiserver service endpoint HTTP clients.

func NewClient

func NewClient(
	scheme string,
	host string,
	doer goahttp.Doer,
	enc func(*http.Request) goahttp.Encoder,
	dec func(*http.Response) goahttp.Decoder,
	restoreBody bool,
) *Client

NewClient instantiates HTTP clients for all the spin-apiserver service servers.

func (*Client) BuildControlShutdownRequest

func (c *Client) BuildControlShutdownRequest(ctx context.Context, v interface{}) (*http.Request, error)

BuildControlShutdownRequest instantiates a HTTP request object with method and path set to call the "spin-apiserver" service "control_shutdown" endpoint

func (*Client) BuildControlStartRequest

func (c *Client) BuildControlStartRequest(ctx context.Context, v interface{}) (*http.Request, error)

BuildControlStartRequest instantiates a HTTP request object with method and path set to call the "spin-apiserver" service "control_start" endpoint

func (*Client) BuildControlStopRequest

func (c *Client) BuildControlStopRequest(ctx context.Context, v interface{}) (*http.Request, error)

BuildControlStopRequest instantiates a HTTP request object with method and path set to call the "spin-apiserver" service "control_stop" endpoint

func (*Client) BuildVMCreateRequest

func (c *Client) BuildVMCreateRequest(ctx context.Context, v interface{}) (*http.Request, error)

BuildVMCreateRequest instantiates a HTTP request object with method and path set to call the "spin-apiserver" service "vm_create" endpoint

func (*Client) BuildVMDeleteRequest

func (c *Client) BuildVMDeleteRequest(ctx context.Context, v interface{}) (*http.Request, error)

BuildVMDeleteRequest instantiates a HTTP request object with method and path set to call the "spin-apiserver" service "vm_delete" endpoint

func (*Client) BuildVMGetRequest

func (c *Client) BuildVMGetRequest(ctx context.Context, v interface{}) (*http.Request, error)

BuildVMGetRequest instantiates a HTTP request object with method and path set to call the "spin-apiserver" service "vm_get" endpoint

func (*Client) BuildVMListRequest

func (c *Client) BuildVMListRequest(ctx context.Context, v interface{}) (*http.Request, error)

BuildVMListRequest instantiates a HTTP request object with method and path set to call the "spin-apiserver" service "vm_list" endpoint

func (*Client) BuildVMUpdateRequest

func (c *Client) BuildVMUpdateRequest(ctx context.Context, v interface{}) (*http.Request, error)

BuildVMUpdateRequest instantiates a HTTP request object with method and path set to call the "spin-apiserver" service "vm_update" endpoint

func (*Client) ControlShutdown

func (c *Client) ControlShutdown() goa.Endpoint

ControlShutdown returns an endpoint that makes HTTP requests to the spin-apiserver service control_shutdown server.

func (*Client) ControlStart

func (c *Client) ControlStart() goa.Endpoint

ControlStart returns an endpoint that makes HTTP requests to the spin-apiserver service control_start server.

func (*Client) ControlStop

func (c *Client) ControlStop() goa.Endpoint

ControlStop returns an endpoint that makes HTTP requests to the spin-apiserver service control_stop server.

func (*Client) VMCreate

func (c *Client) VMCreate() goa.Endpoint

VMCreate returns an endpoint that makes HTTP requests to the spin-apiserver service vm_create server.

func (*Client) VMDelete

func (c *Client) VMDelete() goa.Endpoint

VMDelete returns an endpoint that makes HTTP requests to the spin-apiserver service vm_delete server.

func (*Client) VMGet

func (c *Client) VMGet() goa.Endpoint

VMGet returns an endpoint that makes HTTP requests to the spin-apiserver service vm_get server.

func (*Client) VMList

func (c *Client) VMList() goa.Endpoint

VMList returns an endpoint that makes HTTP requests to the spin-apiserver service vm_list server.

func (*Client) VMUpdate

func (c *Client) VMUpdate() goa.Endpoint

VMUpdate returns an endpoint that makes HTTP requests to the spin-apiserver service vm_update server.

type ImageRequestBody

type ImageRequestBody struct {
	// Image path
	Path string `form:"path" json:"path" xml:"path"`
	// Is this a cdrom image?
	Cdrom bool `form:"cdrom" json:"cdrom" xml:"cdrom"`
	// Volume name
	Volume *string `form:"volume,omitempty" json:"volume,omitempty" xml:"volume,omitempty"`
}

ImageRequestBody is used to define fields on request body types.

type ImageResponseBody

type ImageResponseBody struct {
	// Image path
	Path *string `form:"path,omitempty" json:"path,omitempty" xml:"path,omitempty"`
	// Is this a cdrom image?
	Cdrom *bool `form:"cdrom,omitempty" json:"cdrom,omitempty" xml:"cdrom,omitempty"`
	// Volume name
	Volume *string `form:"volume,omitempty" json:"volume,omitempty" xml:"volume,omitempty"`
}

ImageResponseBody is used to define fields on response body types.

type StorageRequestBody

type StorageRequestBody struct {
	// Volume name; required if image is not a cdrom
	Volume *string `form:"volume,omitempty" json:"volume,omitempty" xml:"volume,omitempty"`
	// Image filename, no `/` characters
	Image string `form:"image" json:"image" xml:"image"`
	// Image size (in gigabytes); required if image is not a cdrom
	ImageSize *uint `form:"image_size,omitempty" json:"image_size,omitempty" xml:"image_size,omitempty"`
	// Is this image a cdrom?
	Cdrom bool `form:"cdrom" json:"cdrom" xml:"cdrom"`
}

StorageRequestBody is used to define fields on request body types.

type UpdatedVMRequestBody

type UpdatedVMRequestBody struct {
	// Image references
	Images []*ImageRequestBody `form:"images" json:"images" xml:"images"`
	// Name of VM; does not need to be unique
	Name string `form:"name" json:"name" xml:"name"`
	// CPU count
	Cpus uint `form:"cpus" json:"cpus" xml:"cpus"`
	// Memory (in megabytes)
	Memory uint `form:"memory" json:"memory" xml:"memory"`
}

UpdatedVMRequestBody is used to define fields on request body types.

type VMCreateRequestBody

type VMCreateRequestBody struct {
	// Storage references
	Storage []*StorageRequestBody `form:"storage" json:"storage" xml:"storage"`
	// Name of VM; does not need to be unique
	Name string `form:"name" json:"name" xml:"name"`
	// CPU count
	Cpus uint `form:"cpus" json:"cpus" xml:"cpus"`
	// Memory (in megabytes)
	Memory uint `form:"memory" json:"memory" xml:"memory"`
}

VMCreateRequestBody is the type of the "spin-apiserver" service "vm_create" endpoint HTTP request body.

func NewVMCreateRequestBody

func NewVMCreateRequestBody(p *spinapiserver.CreateVM) *VMCreateRequestBody

NewVMCreateRequestBody builds the HTTP request body from the payload of the "vm_create" endpoint of the "spin-apiserver" service.

type VMGetResponseBody

type VMGetResponseBody struct {
	// Image references
	Images []*ImageResponseBody `form:"images,omitempty" json:"images,omitempty" xml:"images,omitempty"`
	// Name of VM; does not need to be unique
	Name *string `form:"name,omitempty" json:"name,omitempty" xml:"name,omitempty"`
	// CPU count
	Cpus *uint `form:"cpus,omitempty" json:"cpus,omitempty" xml:"cpus,omitempty"`
	// Memory (in megabytes)
	Memory *uint `form:"memory,omitempty" json:"memory,omitempty" xml:"memory,omitempty"`
}

VMGetResponseBody is the type of the "spin-apiserver" service "vm_get" endpoint HTTP response body.

type VMUpdateRequestBody

type VMUpdateRequestBody struct {
	// VM Manifest to Update
	VM *UpdatedVMRequestBody `form:"vm" json:"vm" xml:"vm"`
}

VMUpdateRequestBody is the type of the "spin-apiserver" service "vm_update" endpoint HTTP request body.

func NewVMUpdateRequestBody

func NewVMUpdateRequestBody(p *spinapiserver.VMUpdatePayload) *VMUpdateRequestBody

NewVMUpdateRequestBody builds the HTTP request body from the payload of the "vm_update" endpoint of the "spin-apiserver" service.

Jump to

Keyboard shortcuts

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