api

package
v0.0.0-...-2c50256 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2024 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Overview

Code generated by ogen, DO NOT EDIT.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithServerURL

func WithServerURL(ctx context.Context, u *url.URL) context.Context

WithServerURL sets context key to override server URL.

Types

type Balloon

type Balloon struct {
	// Target balloon size in MiB.
	AmountMib int `json:"amount_mib"`
	// Whether the balloon should deflate when the guest has memory pressure.
	DeflateOnOom bool `json:"deflate_on_oom"`
	// Interval in seconds between refreshing statistics. A non-zero value will enable the statistics.
	// Defaults to 0.
	StatsPollingIntervalS OptInt `json:"stats_polling_interval_s"`
}

Balloon device descriptor. Ref: #/components/schemas/Balloon

func (*Balloon) Decode

func (s *Balloon) Decode(d *jx.Decoder) error

Decode decodes Balloon from json.

func (*Balloon) Encode

func (s *Balloon) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*Balloon) GetAmountMib

func (s *Balloon) GetAmountMib() int

GetAmountMib returns the value of AmountMib.

func (*Balloon) GetDeflateOnOom

func (s *Balloon) GetDeflateOnOom() bool

GetDeflateOnOom returns the value of DeflateOnOom.

func (*Balloon) GetStatsPollingIntervalS

func (s *Balloon) GetStatsPollingIntervalS() OptInt

GetStatsPollingIntervalS returns the value of StatsPollingIntervalS.

func (*Balloon) MarshalJSON

func (s *Balloon) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*Balloon) SetAmountMib

func (s *Balloon) SetAmountMib(val int)

SetAmountMib sets the value of AmountMib.

func (*Balloon) SetDeflateOnOom

func (s *Balloon) SetDeflateOnOom(val bool)

SetDeflateOnOom sets the value of DeflateOnOom.

func (*Balloon) SetFake

func (s *Balloon) SetFake()

SetFake set fake values.

func (*Balloon) SetStatsPollingIntervalS

func (s *Balloon) SetStatsPollingIntervalS(val OptInt)

SetStatsPollingIntervalS sets the value of StatsPollingIntervalS.

func (*Balloon) UnmarshalJSON

func (s *Balloon) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type BalloonStats

type BalloonStats struct {
	// Target number of pages the device aims to hold.
	TargetPages int `json:"target_pages"`
	// Actual number of pages the device is holding.
	ActualPages int `json:"actual_pages"`
	// Target amount of memory (in MiB) the device aims to hold.
	TargetMib int `json:"target_mib"`
	// Actual amount of memory (in MiB) the device is holding.
	ActualMib int `json:"actual_mib"`
	// The amount of memory that has been swapped in (in bytes).
	SwapIn OptInt64 `json:"swap_in"`
	// The amount of memory that has been swapped out to disk (in bytes).
	SwapOut OptInt64 `json:"swap_out"`
	// The number of major page faults that have occurred.
	MajorFaults OptInt64 `json:"major_faults"`
	// The number of minor page faults that have occurred.
	MinorFaults OptInt64 `json:"minor_faults"`
	// The amount of memory not being used for any purpose (in bytes).
	FreeMemory OptInt64 `json:"free_memory"`
	// The total amount of memory available (in bytes).
	TotalMemory OptInt64 `json:"total_memory"`
	// An estimate of how much memory is available (in bytes) for starting new applications, without
	// pushing the system to swap.
	AvailableMemory OptInt64 `json:"available_memory"`
	// The amount of memory, in bytes, that can be quickly reclaimed without additional I/O. Typically
	// these pages are used for caching files from disk.
	DiskCaches OptInt64 `json:"disk_caches"`
	// The number of successful hugetlb page allocations in the guest.
	HugetlbAllocations OptInt64 `json:"hugetlb_allocations"`
	// The number of failed hugetlb page allocations in the guest.
	HugetlbFailures OptInt64 `json:"hugetlb_failures"`
}

Describes the balloon device statistics. Ref: #/components/schemas/BalloonStats

func (*BalloonStats) Decode

func (s *BalloonStats) Decode(d *jx.Decoder) error

Decode decodes BalloonStats from json.

func (*BalloonStats) Encode

func (s *BalloonStats) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*BalloonStats) GetActualMib

func (s *BalloonStats) GetActualMib() int

GetActualMib returns the value of ActualMib.

func (*BalloonStats) GetActualPages

func (s *BalloonStats) GetActualPages() int

GetActualPages returns the value of ActualPages.

func (*BalloonStats) GetAvailableMemory

func (s *BalloonStats) GetAvailableMemory() OptInt64

GetAvailableMemory returns the value of AvailableMemory.

func (*BalloonStats) GetDiskCaches

func (s *BalloonStats) GetDiskCaches() OptInt64

GetDiskCaches returns the value of DiskCaches.

func (*BalloonStats) GetFreeMemory

func (s *BalloonStats) GetFreeMemory() OptInt64

GetFreeMemory returns the value of FreeMemory.

func (*BalloonStats) GetHugetlbAllocations

func (s *BalloonStats) GetHugetlbAllocations() OptInt64

GetHugetlbAllocations returns the value of HugetlbAllocations.

func (*BalloonStats) GetHugetlbFailures

func (s *BalloonStats) GetHugetlbFailures() OptInt64

GetHugetlbFailures returns the value of HugetlbFailures.

func (*BalloonStats) GetMajorFaults

func (s *BalloonStats) GetMajorFaults() OptInt64

GetMajorFaults returns the value of MajorFaults.

func (*BalloonStats) GetMinorFaults

func (s *BalloonStats) GetMinorFaults() OptInt64

GetMinorFaults returns the value of MinorFaults.

func (*BalloonStats) GetSwapIn

func (s *BalloonStats) GetSwapIn() OptInt64

GetSwapIn returns the value of SwapIn.

func (*BalloonStats) GetSwapOut

func (s *BalloonStats) GetSwapOut() OptInt64

GetSwapOut returns the value of SwapOut.

func (*BalloonStats) GetTargetMib

func (s *BalloonStats) GetTargetMib() int

GetTargetMib returns the value of TargetMib.

func (*BalloonStats) GetTargetPages

func (s *BalloonStats) GetTargetPages() int

GetTargetPages returns the value of TargetPages.

func (*BalloonStats) GetTotalMemory

func (s *BalloonStats) GetTotalMemory() OptInt64

GetTotalMemory returns the value of TotalMemory.

func (*BalloonStats) MarshalJSON

func (s *BalloonStats) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*BalloonStats) SetActualMib

func (s *BalloonStats) SetActualMib(val int)

SetActualMib sets the value of ActualMib.

func (*BalloonStats) SetActualPages

func (s *BalloonStats) SetActualPages(val int)

SetActualPages sets the value of ActualPages.

func (*BalloonStats) SetAvailableMemory

func (s *BalloonStats) SetAvailableMemory(val OptInt64)

SetAvailableMemory sets the value of AvailableMemory.

func (*BalloonStats) SetDiskCaches

func (s *BalloonStats) SetDiskCaches(val OptInt64)

SetDiskCaches sets the value of DiskCaches.

func (*BalloonStats) SetFake

func (s *BalloonStats) SetFake()

SetFake set fake values.

func (*BalloonStats) SetFreeMemory

func (s *BalloonStats) SetFreeMemory(val OptInt64)

SetFreeMemory sets the value of FreeMemory.

func (*BalloonStats) SetHugetlbAllocations

func (s *BalloonStats) SetHugetlbAllocations(val OptInt64)

SetHugetlbAllocations sets the value of HugetlbAllocations.

func (*BalloonStats) SetHugetlbFailures

func (s *BalloonStats) SetHugetlbFailures(val OptInt64)

SetHugetlbFailures sets the value of HugetlbFailures.

func (*BalloonStats) SetMajorFaults

func (s *BalloonStats) SetMajorFaults(val OptInt64)

SetMajorFaults sets the value of MajorFaults.

func (*BalloonStats) SetMinorFaults

func (s *BalloonStats) SetMinorFaults(val OptInt64)

SetMinorFaults sets the value of MinorFaults.

func (*BalloonStats) SetSwapIn

func (s *BalloonStats) SetSwapIn(val OptInt64)

SetSwapIn sets the value of SwapIn.

func (*BalloonStats) SetSwapOut

func (s *BalloonStats) SetSwapOut(val OptInt64)

SetSwapOut sets the value of SwapOut.

func (*BalloonStats) SetTargetMib

func (s *BalloonStats) SetTargetMib(val int)

SetTargetMib sets the value of TargetMib.

func (*BalloonStats) SetTargetPages

func (s *BalloonStats) SetTargetPages(val int)

SetTargetPages sets the value of TargetPages.

func (*BalloonStats) SetTotalMemory

func (s *BalloonStats) SetTotalMemory(val OptInt64)

SetTotalMemory sets the value of TotalMemory.

func (*BalloonStats) UnmarshalJSON

func (s *BalloonStats) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type BalloonStatsUpdate

type BalloonStatsUpdate struct {
	// Interval in seconds between refreshing statistics.
	StatsPollingIntervalS int `json:"stats_polling_interval_s"`
}

Update the statistics polling interval, with the first statistics update scheduled immediately. Statistics cannot be turned on/off after boot. Ref: #/components/schemas/BalloonStatsUpdate

func (*BalloonStatsUpdate) Decode

func (s *BalloonStatsUpdate) Decode(d *jx.Decoder) error

Decode decodes BalloonStatsUpdate from json.

func (*BalloonStatsUpdate) Encode

func (s *BalloonStatsUpdate) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*BalloonStatsUpdate) GetStatsPollingIntervalS

func (s *BalloonStatsUpdate) GetStatsPollingIntervalS() int

GetStatsPollingIntervalS returns the value of StatsPollingIntervalS.

func (*BalloonStatsUpdate) MarshalJSON

func (s *BalloonStatsUpdate) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*BalloonStatsUpdate) SetFake

func (s *BalloonStatsUpdate) SetFake()

SetFake set fake values.

func (*BalloonStatsUpdate) SetStatsPollingIntervalS

func (s *BalloonStatsUpdate) SetStatsPollingIntervalS(val int)

SetStatsPollingIntervalS sets the value of StatsPollingIntervalS.

func (*BalloonStatsUpdate) UnmarshalJSON

func (s *BalloonStatsUpdate) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type BalloonUpdate

type BalloonUpdate struct {
	// Target balloon size in MiB.
	AmountMib int `json:"amount_mib"`
}

Balloon device descriptor. Ref: #/components/schemas/BalloonUpdate

func (*BalloonUpdate) Decode

func (s *BalloonUpdate) Decode(d *jx.Decoder) error

Decode decodes BalloonUpdate from json.

func (*BalloonUpdate) Encode

func (s *BalloonUpdate) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*BalloonUpdate) GetAmountMib

func (s *BalloonUpdate) GetAmountMib() int

GetAmountMib returns the value of AmountMib.

func (*BalloonUpdate) MarshalJSON

func (s *BalloonUpdate) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*BalloonUpdate) SetAmountMib

func (s *BalloonUpdate) SetAmountMib(val int)

SetAmountMib sets the value of AmountMib.

func (*BalloonUpdate) SetFake

func (s *BalloonUpdate) SetFake()

SetFake set fake values.

func (*BalloonUpdate) UnmarshalJSON

func (s *BalloonUpdate) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type BootSource

type BootSource struct {
	// Kernel boot arguments.
	BootArgs OptString `json:"boot_args"`
	// Host level path to the initrd image used to boot the guest.
	InitrdPath OptString `json:"initrd_path"`
	// Host level path to the kernel image used to boot the guest.
	KernelImagePath string `json:"kernel_image_path"`
}

Boot source descriptor. Ref: #/components/schemas/BootSource

func (*BootSource) Decode

func (s *BootSource) Decode(d *jx.Decoder) error

Decode decodes BootSource from json.

func (*BootSource) Encode

func (s *BootSource) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*BootSource) GetBootArgs

func (s *BootSource) GetBootArgs() OptString

GetBootArgs returns the value of BootArgs.

func (*BootSource) GetInitrdPath

func (s *BootSource) GetInitrdPath() OptString

GetInitrdPath returns the value of InitrdPath.

func (*BootSource) GetKernelImagePath

func (s *BootSource) GetKernelImagePath() string

GetKernelImagePath returns the value of KernelImagePath.

func (*BootSource) MarshalJSON

func (s *BootSource) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*BootSource) SetBootArgs

func (s *BootSource) SetBootArgs(val OptString)

SetBootArgs sets the value of BootArgs.

func (*BootSource) SetFake

func (s *BootSource) SetFake()

SetFake set fake values.

func (*BootSource) SetInitrdPath

func (s *BootSource) SetInitrdPath(val OptString)

SetInitrdPath sets the value of InitrdPath.

func (*BootSource) SetKernelImagePath

func (s *BootSource) SetKernelImagePath(val string)

SetKernelImagePath sets the value of KernelImagePath.

func (*BootSource) UnmarshalJSON

func (s *BootSource) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client implements OAS client.

func NewClient

func NewClient(serverURL string, opts ...ClientOption) (*Client, error)

NewClient initializes new Client defined by OAS.

func (*Client) CreateSnapshot

func (c *Client) CreateSnapshot(ctx context.Context, request *SnapshotCreateParams) (CreateSnapshotRes, error)

CreateSnapshot invokes createSnapshot operation.

Creates a snapshot of the microVM state. The microVM should be in the `Paused` state.

PUT /snapshot/create

func (*Client) CreateSyncAction

func (c *Client) CreateSyncAction(ctx context.Context, request *InstanceActionInfo) (CreateSyncActionRes, error)

CreateSyncAction invokes createSyncAction operation.

Creates a synchronous action.

PUT /actions

func (*Client) DescribeBalloonConfig

func (c *Client) DescribeBalloonConfig(ctx context.Context) (DescribeBalloonConfigRes, error)

DescribeBalloonConfig invokes describeBalloonConfig operation.

Returns the current balloon device configuration.

GET /balloon

func (*Client) DescribeBalloonStats

func (c *Client) DescribeBalloonStats(ctx context.Context) (DescribeBalloonStatsRes, error)

DescribeBalloonStats invokes describeBalloonStats operation.

Returns the latest balloon device statistics, only if enabled pre-boot.

GET /balloon/statistics

func (*Client) DescribeInstance

func (c *Client) DescribeInstance(ctx context.Context) (*InstanceInfo, error)

DescribeInstance invokes describeInstance operation.

Returns general information about an instance.

GET /

func (*Client) GetExportVmConfig

func (c *Client) GetExportVmConfig(ctx context.Context) (*FullVmConfiguration, error)

GetExportVmConfig invokes getExportVmConfig operation.

Gets configuration for all VM resources.

GET /vm/config

func (*Client) GetMachineConfiguration

func (c *Client) GetMachineConfiguration(ctx context.Context) (*MachineConfiguration, error)

GetMachineConfiguration invokes getMachineConfiguration operation.

Gets the machine configuration of the VM. When called before the PUT operation, it will return the default values for the vCPU count (=1), memory size (=128 MiB). By default Hyperthreading is disabled and there is no CPU Template.

GET /machine-config

func (*Client) LoadSnapshot

func (c *Client) LoadSnapshot(ctx context.Context, request *SnapshotLoadParams) (LoadSnapshotRes, error)

LoadSnapshot invokes loadSnapshot operation.

Loads the microVM state from a snapshot. Only accepted on a fresh Firecracker process (before configuring any resource other than the Logger and Metrics).

PUT /snapshot/load

func (*Client) MmdsConfigPut

func (c *Client) MmdsConfigPut(ctx context.Context, request *MmdsConfig) (MmdsConfigPutRes, error)

MmdsConfigPut invokes PUT /mmds/config operation.

Creates MMDS configuration to be used by the MMDS network stack.

PUT /mmds/config

func (*Client) MmdsGet

func (c *Client) MmdsGet(ctx context.Context) (MmdsGetRes, error)

MmdsGet invokes GET /mmds operation.

Get the MMDS data store.

GET /mmds

func (*Client) MmdsPatch

func (c *Client) MmdsPatch(ctx context.Context, request *MmdsPatchReq) (MmdsPatchRes, error)

MmdsPatch invokes PATCH /mmds operation.

Updates the MMDS data store.

PATCH /mmds

func (*Client) MmdsPut

func (c *Client) MmdsPut(ctx context.Context, request *MmdsPutReq) (MmdsPutRes, error)

MmdsPut invokes PUT /mmds operation.

Creates a MMDS (Microvm Metadata Service) data store.

PUT /mmds

func (*Client) PatchBalloon

func (c *Client) PatchBalloon(ctx context.Context, request *BalloonUpdate) (PatchBalloonRes, error)

PatchBalloon invokes patchBalloon operation.

Updates an existing balloon device, before or after machine startup. Will fail if update is not possible.

PATCH /balloon

func (*Client) PatchBalloonStatsInterval

func (c *Client) PatchBalloonStatsInterval(ctx context.Context, request *BalloonStatsUpdate) (PatchBalloonStatsIntervalRes, error)

PatchBalloonStatsInterval invokes patchBalloonStatsInterval operation.

Updates an existing balloon device statistics interval, before or after machine startup. Will fail if update is not possible.

PATCH /balloon/statistics

func (*Client) PatchGuestDriveByID

func (c *Client) PatchGuestDriveByID(ctx context.Context, request *PartialDrive, params PatchGuestDriveByIDParams) (PatchGuestDriveByIDRes, error)

PatchGuestDriveByID invokes patchGuestDriveByID operation.

Updates the properties of the drive with the ID specified by drive_id path parameter. Will fail if update is not possible.

PATCH /drives/{drive_id}

func (*Client) PatchGuestNetworkInterfaceByID

PatchGuestNetworkInterfaceByID invokes patchGuestNetworkInterfaceByID operation.

Updates the rate limiters applied to a network interface.

PATCH /network-interfaces/{iface_id}

func (*Client) PatchMachineConfiguration

func (c *Client) PatchMachineConfiguration(ctx context.Context, request OptMachineConfiguration) (PatchMachineConfigurationRes, error)

PatchMachineConfiguration invokes patchMachineConfiguration operation.

Partially updates the Virtual Machine Configuration with the specified input. If any of the parameters has an incorrect value, the whole update fails.

PATCH /machine-config

func (*Client) PatchVm

func (c *Client) PatchVm(ctx context.Context, request *VM) (PatchVmRes, error)

PatchVm invokes patchVm operation.

Sets the desired state (Paused or Resumed) for the microVM.

PATCH /vm

func (*Client) PutBalloon

func (c *Client) PutBalloon(ctx context.Context, request *Balloon) (PutBalloonRes, error)

PutBalloon invokes putBalloon operation.

Creates a new balloon device if one does not already exist, otherwise updates it, before machine startup. This will fail after machine startup. Will fail if update is not possible.

PUT /balloon

func (*Client) PutGuestBootSource

func (c *Client) PutGuestBootSource(ctx context.Context, request *BootSource) (PutGuestBootSourceRes, error)

PutGuestBootSource invokes putGuestBootSource operation.

Creates new boot source if one does not already exist, otherwise updates it. Will fail if update is not possible.

PUT /boot-source

func (*Client) PutGuestDriveByID

func (c *Client) PutGuestDriveByID(ctx context.Context, request *Drive, params PutGuestDriveByIDParams) (PutGuestDriveByIDRes, error)

PutGuestDriveByID invokes putGuestDriveByID operation.

Creates new drive with ID specified by drive_id path parameter. If a drive with the specified ID already exists, updates its state based on new input. Will fail if update is not possible.

PUT /drives/{drive_id}

func (*Client) PutGuestNetworkInterfaceByID

func (c *Client) PutGuestNetworkInterfaceByID(ctx context.Context, request *NetworkInterface, params PutGuestNetworkInterfaceByIDParams) (PutGuestNetworkInterfaceByIDRes, error)

PutGuestNetworkInterfaceByID invokes putGuestNetworkInterfaceByID operation.

Creates new network interface with ID specified by iface_id path parameter.

PUT /network-interfaces/{iface_id}

func (*Client) PutGuestVsock

func (c *Client) PutGuestVsock(ctx context.Context, request *Vsock) (PutGuestVsockRes, error)

PutGuestVsock invokes putGuestVsock operation.

The first call creates the device with the configuration specified in body. Subsequent calls will update the device configuration. May fail if update is not possible.

PUT /vsock

func (*Client) PutLogger

func (c *Client) PutLogger(ctx context.Context, request *Logger) (PutLoggerRes, error)

PutLogger invokes putLogger operation.

Initializes the logger by specifying a named pipe or a file for the logs output.

PUT /logger

func (*Client) PutMachineConfiguration

func (c *Client) PutMachineConfiguration(ctx context.Context, request OptMachineConfiguration) (PutMachineConfigurationRes, error)

PutMachineConfiguration invokes putMachineConfiguration operation.

Updates the Virtual Machine Configuration with the specified input. Firecracker starts with default values for vCPU count (=1) and memory size (=128 MiB). With Hyperthreading enabled, the vCPU count is restricted to be 1 or an even number, otherwise there are no restrictions regarding the vCPU count. If any of the parameters has an incorrect value, the whole update fails.

PUT /machine-config

func (*Client) PutMetrics

func (c *Client) PutMetrics(ctx context.Context, request *Metrics) (PutMetricsRes, error)

PutMetrics invokes putMetrics operation.

Initializes the metrics system by specifying a named pipe or a file for the metrics output.

PUT /metrics

type ClientOption

type ClientOption interface {
	// contains filtered or unexported methods
}

ClientOption is client config option.

func WithClient

func WithClient(client ht.Client) ClientOption

WithClient specifies http client to use.

type CpuTemplate

type CpuTemplate string

The CPU Template defines a set of flags to be disabled from the microvm so that the features exposed to the guest are the same as in the selected instance type. Ref: #/components/schemas/CpuTemplate

const (
	CpuTemplateC3 CpuTemplate = "C3"
	CpuTemplateT2 CpuTemplate = "T2"
)

func (CpuTemplate) AllValues

func (CpuTemplate) AllValues() []CpuTemplate

AllValues returns all CpuTemplate values.

func (*CpuTemplate) Decode

func (s *CpuTemplate) Decode(d *jx.Decoder) error

Decode decodes CpuTemplate from json.

func (CpuTemplate) Encode

func (s CpuTemplate) Encode(e *jx.Encoder)

Encode encodes CpuTemplate as json.

func (CpuTemplate) MarshalJSON

func (s CpuTemplate) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (CpuTemplate) MarshalText

func (s CpuTemplate) MarshalText() ([]byte, error)

MarshalText implements encoding.TextMarshaler.

func (*CpuTemplate) SetFake

func (s *CpuTemplate) SetFake()

SetFake set fake values.

func (*CpuTemplate) UnmarshalJSON

func (s *CpuTemplate) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*CpuTemplate) UnmarshalText

func (s *CpuTemplate) UnmarshalText(data []byte) error

UnmarshalText implements encoding.TextUnmarshaler.

func (CpuTemplate) Validate

func (s CpuTemplate) Validate() error

type CreateSnapshotNoContent

type CreateSnapshotNoContent struct{}

CreateSnapshotNoContent is response for CreateSnapshot operation.

type CreateSnapshotRes

type CreateSnapshotRes interface {
	// contains filtered or unexported methods
}

type CreateSyncActionNoContent

type CreateSyncActionNoContent struct{}

CreateSyncActionNoContent is response for CreateSyncAction operation.

type CreateSyncActionRes

type CreateSyncActionRes interface {
	// contains filtered or unexported methods
}

type DescribeBalloonConfigRes

type DescribeBalloonConfigRes interface {
	// contains filtered or unexported methods
}

type DescribeBalloonStatsRes

type DescribeBalloonStatsRes interface {
	// contains filtered or unexported methods
}

type Drive

type Drive struct {
	DriveID string `json:"drive_id"`
	// Represents the caching strategy for the block device.
	CacheType    OptString `json:"cache_type"`
	IsReadOnly   bool      `json:"is_read_only"`
	IsRootDevice bool      `json:"is_root_device"`
	// Represents the unique id of the boot partition of this device. It is optional and it will be taken
	// into account only if the is_root_device field is true.
	Partuuid OptString `json:"partuuid"`
	// Host level path for the guest drive.
	PathOnHost  string         `json:"path_on_host"`
	RateLimiter OptRateLimiter `json:"rate_limiter"`
}

Ref: #/components/schemas/Drive

func (*Drive) Decode

func (s *Drive) Decode(d *jx.Decoder) error

Decode decodes Drive from json.

func (*Drive) Encode

func (s *Drive) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*Drive) GetCacheType

func (s *Drive) GetCacheType() OptString

GetCacheType returns the value of CacheType.

func (*Drive) GetDriveID

func (s *Drive) GetDriveID() string

GetDriveID returns the value of DriveID.

func (*Drive) GetIsReadOnly

func (s *Drive) GetIsReadOnly() bool

GetIsReadOnly returns the value of IsReadOnly.

func (*Drive) GetIsRootDevice

func (s *Drive) GetIsRootDevice() bool

GetIsRootDevice returns the value of IsRootDevice.

func (*Drive) GetPartuuid

func (s *Drive) GetPartuuid() OptString

GetPartuuid returns the value of Partuuid.

func (*Drive) GetPathOnHost

func (s *Drive) GetPathOnHost() string

GetPathOnHost returns the value of PathOnHost.

func (*Drive) GetRateLimiter

func (s *Drive) GetRateLimiter() OptRateLimiter

GetRateLimiter returns the value of RateLimiter.

func (*Drive) MarshalJSON

func (s *Drive) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*Drive) SetCacheType

func (s *Drive) SetCacheType(val OptString)

SetCacheType sets the value of CacheType.

func (*Drive) SetDriveID

func (s *Drive) SetDriveID(val string)

SetDriveID sets the value of DriveID.

func (*Drive) SetFake

func (s *Drive) SetFake()

SetFake set fake values.

func (*Drive) SetIsReadOnly

func (s *Drive) SetIsReadOnly(val bool)

SetIsReadOnly sets the value of IsReadOnly.

func (*Drive) SetIsRootDevice

func (s *Drive) SetIsRootDevice(val bool)

SetIsRootDevice sets the value of IsRootDevice.

func (*Drive) SetPartuuid

func (s *Drive) SetPartuuid(val OptString)

SetPartuuid sets the value of Partuuid.

func (*Drive) SetPathOnHost

func (s *Drive) SetPathOnHost(val string)

SetPathOnHost sets the value of PathOnHost.

func (*Drive) SetRateLimiter

func (s *Drive) SetRateLimiter(val OptRateLimiter)

SetRateLimiter sets the value of RateLimiter.

func (*Drive) UnmarshalJSON

func (s *Drive) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*Drive) Validate

func (s *Drive) Validate() error

type Error

type Error struct {
	// A description of the error condition.
	FaultMessage OptString `json:"fault_message"`
}

Ref: #/components/schemas/Error

func (*Error) Decode

func (s *Error) Decode(d *jx.Decoder) error

Decode decodes Error from json.

func (*Error) Encode

func (s *Error) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*Error) GetFaultMessage

func (s *Error) GetFaultMessage() OptString

GetFaultMessage returns the value of FaultMessage.

func (*Error) MarshalJSON

func (s *Error) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*Error) SetFake

func (s *Error) SetFake()

SetFake set fake values.

func (*Error) SetFaultMessage

func (s *Error) SetFaultMessage(val OptString)

SetFaultMessage sets the value of FaultMessage.

func (*Error) UnmarshalJSON

func (s *Error) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type ErrorHandler

type ErrorHandler = ogenerrors.ErrorHandler

ErrorHandler is error handler.

type ErrorStatusCode

type ErrorStatusCode struct {
	StatusCode int
	Response   Error
}

ErrorStatusCode wraps Error with StatusCode.

func (*ErrorStatusCode) Error

func (s *ErrorStatusCode) Error() string

func (*ErrorStatusCode) GetResponse

func (s *ErrorStatusCode) GetResponse() Error

GetResponse returns the value of Response.

func (*ErrorStatusCode) GetStatusCode

func (s *ErrorStatusCode) GetStatusCode() int

GetStatusCode returns the value of StatusCode.

func (*ErrorStatusCode) SetResponse

func (s *ErrorStatusCode) SetResponse(val Error)

SetResponse sets the value of Response.

func (*ErrorStatusCode) SetStatusCode

func (s *ErrorStatusCode) SetStatusCode(val int)

SetStatusCode sets the value of StatusCode.

type FullVmConfiguration

type FullVmConfiguration struct {
	BalloonDevice OptBalloon `json:"balloon_device"`
	// Configurations for all block devices.
	BlockDevices  []Drive                 `json:"block_devices"`
	BootSource    OptBootSource           `json:"boot_source"`
	Logger        OptLogger               `json:"logger"`
	MachineConfig OptMachineConfiguration `json:"machine_config"`
	Metrics       OptMetrics              `json:"metrics"`
	MmdsConfig    OptMmdsConfig           `json:"mmds_config"`
	// Configurations for all net devices.
	NetDevices  []NetworkInterface `json:"net_devices"`
	VsockDevice OptVsock           `json:"vsock_device"`
}

Ref: #/components/schemas/FullVmConfiguration

func (*FullVmConfiguration) Decode

func (s *FullVmConfiguration) Decode(d *jx.Decoder) error

Decode decodes FullVmConfiguration from json.

func (*FullVmConfiguration) Encode

func (s *FullVmConfiguration) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*FullVmConfiguration) GetBalloonDevice

func (s *FullVmConfiguration) GetBalloonDevice() OptBalloon

GetBalloonDevice returns the value of BalloonDevice.

func (*FullVmConfiguration) GetBlockDevices

func (s *FullVmConfiguration) GetBlockDevices() []Drive

GetBlockDevices returns the value of BlockDevices.

func (*FullVmConfiguration) GetBootSource

func (s *FullVmConfiguration) GetBootSource() OptBootSource

GetBootSource returns the value of BootSource.

func (*FullVmConfiguration) GetLogger

func (s *FullVmConfiguration) GetLogger() OptLogger

GetLogger returns the value of Logger.

func (*FullVmConfiguration) GetMachineConfig

func (s *FullVmConfiguration) GetMachineConfig() OptMachineConfiguration

GetMachineConfig returns the value of MachineConfig.

func (*FullVmConfiguration) GetMetrics

func (s *FullVmConfiguration) GetMetrics() OptMetrics

GetMetrics returns the value of Metrics.

func (*FullVmConfiguration) GetMmdsConfig

func (s *FullVmConfiguration) GetMmdsConfig() OptMmdsConfig

GetMmdsConfig returns the value of MmdsConfig.

func (*FullVmConfiguration) GetNetDevices

func (s *FullVmConfiguration) GetNetDevices() []NetworkInterface

GetNetDevices returns the value of NetDevices.

func (*FullVmConfiguration) GetVsockDevice

func (s *FullVmConfiguration) GetVsockDevice() OptVsock

GetVsockDevice returns the value of VsockDevice.

func (*FullVmConfiguration) MarshalJSON

func (s *FullVmConfiguration) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*FullVmConfiguration) SetBalloonDevice

func (s *FullVmConfiguration) SetBalloonDevice(val OptBalloon)

SetBalloonDevice sets the value of BalloonDevice.

func (*FullVmConfiguration) SetBlockDevices

func (s *FullVmConfiguration) SetBlockDevices(val []Drive)

SetBlockDevices sets the value of BlockDevices.

func (*FullVmConfiguration) SetBootSource

func (s *FullVmConfiguration) SetBootSource(val OptBootSource)

SetBootSource sets the value of BootSource.

func (*FullVmConfiguration) SetFake

func (s *FullVmConfiguration) SetFake()

SetFake set fake values.

func (*FullVmConfiguration) SetLogger

func (s *FullVmConfiguration) SetLogger(val OptLogger)

SetLogger sets the value of Logger.

func (*FullVmConfiguration) SetMachineConfig

func (s *FullVmConfiguration) SetMachineConfig(val OptMachineConfiguration)

SetMachineConfig sets the value of MachineConfig.

func (*FullVmConfiguration) SetMetrics

func (s *FullVmConfiguration) SetMetrics(val OptMetrics)

SetMetrics sets the value of Metrics.

func (*FullVmConfiguration) SetMmdsConfig

func (s *FullVmConfiguration) SetMmdsConfig(val OptMmdsConfig)

SetMmdsConfig sets the value of MmdsConfig.

func (*FullVmConfiguration) SetNetDevices

func (s *FullVmConfiguration) SetNetDevices(val []NetworkInterface)

SetNetDevices sets the value of NetDevices.

func (*FullVmConfiguration) SetVsockDevice

func (s *FullVmConfiguration) SetVsockDevice(val OptVsock)

SetVsockDevice sets the value of VsockDevice.

func (*FullVmConfiguration) UnmarshalJSON

func (s *FullVmConfiguration) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*FullVmConfiguration) Validate

func (s *FullVmConfiguration) Validate() error

type Handler

type Handler interface {
	// CreateSnapshot implements createSnapshot operation.
	//
	// Creates a snapshot of the microVM state. The microVM should be in the `Paused` state.
	//
	// PUT /snapshot/create
	CreateSnapshot(ctx context.Context, req *SnapshotCreateParams) (CreateSnapshotRes, error)
	// CreateSyncAction implements createSyncAction operation.
	//
	// Creates a synchronous action.
	//
	// PUT /actions
	CreateSyncAction(ctx context.Context, req *InstanceActionInfo) (CreateSyncActionRes, error)
	// DescribeBalloonConfig implements describeBalloonConfig operation.
	//
	// Returns the current balloon device configuration.
	//
	// GET /balloon
	DescribeBalloonConfig(ctx context.Context) (DescribeBalloonConfigRes, error)
	// DescribeBalloonStats implements describeBalloonStats operation.
	//
	// Returns the latest balloon device statistics, only if enabled pre-boot.
	//
	// GET /balloon/statistics
	DescribeBalloonStats(ctx context.Context) (DescribeBalloonStatsRes, error)
	// DescribeInstance implements describeInstance operation.
	//
	// Returns general information about an instance.
	//
	// GET /
	DescribeInstance(ctx context.Context) (*InstanceInfo, error)
	// GetExportVmConfig implements getExportVmConfig operation.
	//
	// Gets configuration for all VM resources.
	//
	// GET /vm/config
	GetExportVmConfig(ctx context.Context) (*FullVmConfiguration, error)
	// GetMachineConfiguration implements getMachineConfiguration operation.
	//
	// Gets the machine configuration of the VM. When called before the PUT operation, it will return the
	// default values for the vCPU count (=1), memory size (=128 MiB). By default Hyperthreading is
	// disabled and there is no CPU Template.
	//
	// GET /machine-config
	GetMachineConfiguration(ctx context.Context) (*MachineConfiguration, error)
	// LoadSnapshot implements loadSnapshot operation.
	//
	// Loads the microVM state from a snapshot. Only accepted on a fresh Firecracker process (before
	// configuring any resource other than the Logger and Metrics).
	//
	// PUT /snapshot/load
	LoadSnapshot(ctx context.Context, req *SnapshotLoadParams) (LoadSnapshotRes, error)
	// MmdsConfigPut implements PUT /mmds/config operation.
	//
	// Creates MMDS configuration to be used by the MMDS network stack.
	//
	// PUT /mmds/config
	MmdsConfigPut(ctx context.Context, req *MmdsConfig) (MmdsConfigPutRes, error)
	// MmdsGet implements GET /mmds operation.
	//
	// Get the MMDS data store.
	//
	// GET /mmds
	MmdsGet(ctx context.Context) (MmdsGetRes, error)
	// MmdsPatch implements PATCH /mmds operation.
	//
	// Updates the MMDS data store.
	//
	// PATCH /mmds
	MmdsPatch(ctx context.Context, req *MmdsPatchReq) (MmdsPatchRes, error)
	// MmdsPut implements PUT /mmds operation.
	//
	// Creates a MMDS (Microvm Metadata Service) data store.
	//
	// PUT /mmds
	MmdsPut(ctx context.Context, req *MmdsPutReq) (MmdsPutRes, error)
	// PatchBalloon implements patchBalloon operation.
	//
	// Updates an existing balloon device, before or after machine startup. Will fail if update is not
	// possible.
	//
	// PATCH /balloon
	PatchBalloon(ctx context.Context, req *BalloonUpdate) (PatchBalloonRes, error)
	// PatchBalloonStatsInterval implements patchBalloonStatsInterval operation.
	//
	// Updates an existing balloon device statistics interval, before or after machine startup. Will fail
	// if update is not possible.
	//
	// PATCH /balloon/statistics
	PatchBalloonStatsInterval(ctx context.Context, req *BalloonStatsUpdate) (PatchBalloonStatsIntervalRes, error)
	// PatchGuestDriveByID implements patchGuestDriveByID operation.
	//
	// Updates the properties of the drive with the ID specified by drive_id path parameter. Will fail if
	// update is not possible.
	//
	// PATCH /drives/{drive_id}
	PatchGuestDriveByID(ctx context.Context, req *PartialDrive, params PatchGuestDriveByIDParams) (PatchGuestDriveByIDRes, error)
	// PatchGuestNetworkInterfaceByID implements patchGuestNetworkInterfaceByID operation.
	//
	// Updates the rate limiters applied to a network interface.
	//
	// PATCH /network-interfaces/{iface_id}
	PatchGuestNetworkInterfaceByID(ctx context.Context, req *PartialNetworkInterface, params PatchGuestNetworkInterfaceByIDParams) (PatchGuestNetworkInterfaceByIDRes, error)
	// PatchMachineConfiguration implements patchMachineConfiguration operation.
	//
	// Partially updates the Virtual Machine Configuration with the specified input. If any of the
	// parameters has an incorrect value, the whole update fails.
	//
	// PATCH /machine-config
	PatchMachineConfiguration(ctx context.Context, req OptMachineConfiguration) (PatchMachineConfigurationRes, error)
	// PatchVm implements patchVm operation.
	//
	// Sets the desired state (Paused or Resumed) for the microVM.
	//
	// PATCH /vm
	PatchVm(ctx context.Context, req *VM) (PatchVmRes, error)
	// PutBalloon implements putBalloon operation.
	//
	// Creates a new balloon device if one does not already exist, otherwise updates it, before machine
	// startup. This will fail after machine startup. Will fail if update is not possible.
	//
	// PUT /balloon
	PutBalloon(ctx context.Context, req *Balloon) (PutBalloonRes, error)
	// PutGuestBootSource implements putGuestBootSource operation.
	//
	// Creates new boot source if one does not already exist, otherwise updates it. Will fail if update
	// is not possible.
	//
	// PUT /boot-source
	PutGuestBootSource(ctx context.Context, req *BootSource) (PutGuestBootSourceRes, error)
	// PutGuestDriveByID implements putGuestDriveByID operation.
	//
	// Creates new drive with ID specified by drive_id path parameter. If a drive with the specified ID
	// already exists, updates its state based on new input. Will fail if update is not possible.
	//
	// PUT /drives/{drive_id}
	PutGuestDriveByID(ctx context.Context, req *Drive, params PutGuestDriveByIDParams) (PutGuestDriveByIDRes, error)
	// PutGuestNetworkInterfaceByID implements putGuestNetworkInterfaceByID operation.
	//
	// Creates new network interface with ID specified by iface_id path parameter.
	//
	// PUT /network-interfaces/{iface_id}
	PutGuestNetworkInterfaceByID(ctx context.Context, req *NetworkInterface, params PutGuestNetworkInterfaceByIDParams) (PutGuestNetworkInterfaceByIDRes, error)
	// PutGuestVsock implements putGuestVsock operation.
	//
	// The first call creates the device with the configuration specified in body. Subsequent calls will
	// update the device configuration. May fail if update is not possible.
	//
	// PUT /vsock
	PutGuestVsock(ctx context.Context, req *Vsock) (PutGuestVsockRes, error)
	// PutLogger implements putLogger operation.
	//
	// Initializes the logger by specifying a named pipe or a file for the logs output.
	//
	// PUT /logger
	PutLogger(ctx context.Context, req *Logger) (PutLoggerRes, error)
	// PutMachineConfiguration implements putMachineConfiguration operation.
	//
	// Updates the Virtual Machine Configuration with the specified input. Firecracker starts with
	// default values for vCPU count (=1) and memory size (=128 MiB). With Hyperthreading enabled, the
	// vCPU count is restricted to be 1 or an even number, otherwise there are no restrictions regarding
	// the vCPU count. If any of the parameters has an incorrect value, the whole update fails.
	//
	// PUT /machine-config
	PutMachineConfiguration(ctx context.Context, req OptMachineConfiguration) (PutMachineConfigurationRes, error)
	// PutMetrics implements putMetrics operation.
	//
	// Initializes the metrics system by specifying a named pipe or a file for the metrics output.
	//
	// PUT /metrics
	PutMetrics(ctx context.Context, req *Metrics) (PutMetricsRes, error)
	// NewError creates *ErrorStatusCode from error returned by handler.
	//
	// Used for common default response.
	NewError(ctx context.Context, err error) *ErrorStatusCode
}

Handler handles operations described by OpenAPI v3 specification.

type InstanceActionInfo

type InstanceActionInfo struct {
	// Enumeration indicating what type of action is contained in the payload.
	ActionType InstanceActionInfoActionType `json:"action_type"`
}

Variant wrapper containing the real action. Ref: #/components/schemas/InstanceActionInfo

func (*InstanceActionInfo) Decode

func (s *InstanceActionInfo) Decode(d *jx.Decoder) error

Decode decodes InstanceActionInfo from json.

func (*InstanceActionInfo) Encode

func (s *InstanceActionInfo) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*InstanceActionInfo) GetActionType

GetActionType returns the value of ActionType.

func (*InstanceActionInfo) MarshalJSON

func (s *InstanceActionInfo) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*InstanceActionInfo) SetActionType

func (s *InstanceActionInfo) SetActionType(val InstanceActionInfoActionType)

SetActionType sets the value of ActionType.

func (*InstanceActionInfo) SetFake

func (s *InstanceActionInfo) SetFake()

SetFake set fake values.

func (*InstanceActionInfo) UnmarshalJSON

func (s *InstanceActionInfo) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*InstanceActionInfo) Validate

func (s *InstanceActionInfo) Validate() error

type InstanceActionInfoActionType

type InstanceActionInfoActionType string

Enumeration indicating what type of action is contained in the payload.

const (
	InstanceActionInfoActionTypeFlushMetrics   InstanceActionInfoActionType = "FlushMetrics"
	InstanceActionInfoActionTypeInstanceStart  InstanceActionInfoActionType = "InstanceStart"
	InstanceActionInfoActionTypeSendCtrlAltDel InstanceActionInfoActionType = "SendCtrlAltDel"
)

func (InstanceActionInfoActionType) AllValues

AllValues returns all InstanceActionInfoActionType values.

func (*InstanceActionInfoActionType) Decode

Decode decodes InstanceActionInfoActionType from json.

func (InstanceActionInfoActionType) Encode

Encode encodes InstanceActionInfoActionType as json.

func (InstanceActionInfoActionType) MarshalJSON

func (s InstanceActionInfoActionType) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (InstanceActionInfoActionType) MarshalText

func (s InstanceActionInfoActionType) MarshalText() ([]byte, error)

MarshalText implements encoding.TextMarshaler.

func (*InstanceActionInfoActionType) SetFake

func (s *InstanceActionInfoActionType) SetFake()

SetFake set fake values.

func (*InstanceActionInfoActionType) UnmarshalJSON

func (s *InstanceActionInfoActionType) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*InstanceActionInfoActionType) UnmarshalText

func (s *InstanceActionInfoActionType) UnmarshalText(data []byte) error

UnmarshalText implements encoding.TextUnmarshaler.

func (InstanceActionInfoActionType) Validate

func (s InstanceActionInfoActionType) Validate() error

type InstanceInfo

type InstanceInfo struct {
	// Application name.
	AppName string `json:"app_name"`
	// MicroVM / instance ID.
	ID string `json:"id"`
	// The current detailed state (Not started, Running, Paused) of the Firecracker instance. This value
	// is read-only for the control-plane.
	State InstanceInfoState `json:"state"`
	// MicroVM hypervisor build version.
	VmmVersion string `json:"vmm_version"`
}

Describes MicroVM instance information. Ref: #/components/schemas/InstanceInfo

func (*InstanceInfo) Decode

func (s *InstanceInfo) Decode(d *jx.Decoder) error

Decode decodes InstanceInfo from json.

func (*InstanceInfo) Encode

func (s *InstanceInfo) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*InstanceInfo) GetAppName

func (s *InstanceInfo) GetAppName() string

GetAppName returns the value of AppName.

func (*InstanceInfo) GetID

func (s *InstanceInfo) GetID() string

GetID returns the value of ID.

func (*InstanceInfo) GetState

func (s *InstanceInfo) GetState() InstanceInfoState

GetState returns the value of State.

func (*InstanceInfo) GetVmmVersion

func (s *InstanceInfo) GetVmmVersion() string

GetVmmVersion returns the value of VmmVersion.

func (*InstanceInfo) MarshalJSON

func (s *InstanceInfo) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*InstanceInfo) SetAppName

func (s *InstanceInfo) SetAppName(val string)

SetAppName sets the value of AppName.

func (*InstanceInfo) SetFake

func (s *InstanceInfo) SetFake()

SetFake set fake values.

func (*InstanceInfo) SetID

func (s *InstanceInfo) SetID(val string)

SetID sets the value of ID.

func (*InstanceInfo) SetState

func (s *InstanceInfo) SetState(val InstanceInfoState)

SetState sets the value of State.

func (*InstanceInfo) SetVmmVersion

func (s *InstanceInfo) SetVmmVersion(val string)

SetVmmVersion sets the value of VmmVersion.

func (*InstanceInfo) UnmarshalJSON

func (s *InstanceInfo) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*InstanceInfo) Validate

func (s *InstanceInfo) Validate() error

type InstanceInfoState

type InstanceInfoState string

The current detailed state (Not started, Running, Paused) of the Firecracker instance. This value is read-only for the control-plane.

const (
	InstanceInfoStateNotStarted InstanceInfoState = "Not started"
	InstanceInfoStateRunning    InstanceInfoState = "Running"
	InstanceInfoStatePaused     InstanceInfoState = "Paused"
)

func (InstanceInfoState) AllValues

func (InstanceInfoState) AllValues() []InstanceInfoState

AllValues returns all InstanceInfoState values.

func (*InstanceInfoState) Decode

func (s *InstanceInfoState) Decode(d *jx.Decoder) error

Decode decodes InstanceInfoState from json.

func (InstanceInfoState) Encode

func (s InstanceInfoState) Encode(e *jx.Encoder)

Encode encodes InstanceInfoState as json.

func (InstanceInfoState) MarshalJSON

func (s InstanceInfoState) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (InstanceInfoState) MarshalText

func (s InstanceInfoState) MarshalText() ([]byte, error)

MarshalText implements encoding.TextMarshaler.

func (*InstanceInfoState) SetFake

func (s *InstanceInfoState) SetFake()

SetFake set fake values.

func (*InstanceInfoState) UnmarshalJSON

func (s *InstanceInfoState) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*InstanceInfoState) UnmarshalText

func (s *InstanceInfoState) UnmarshalText(data []byte) error

UnmarshalText implements encoding.TextUnmarshaler.

func (InstanceInfoState) Validate

func (s InstanceInfoState) Validate() error

type Invoker

type Invoker interface {
	// CreateSnapshot invokes createSnapshot operation.
	//
	// Creates a snapshot of the microVM state. The microVM should be in the `Paused` state.
	//
	// PUT /snapshot/create
	CreateSnapshot(ctx context.Context, request *SnapshotCreateParams) (CreateSnapshotRes, error)
	// CreateSyncAction invokes createSyncAction operation.
	//
	// Creates a synchronous action.
	//
	// PUT /actions
	CreateSyncAction(ctx context.Context, request *InstanceActionInfo) (CreateSyncActionRes, error)
	// DescribeBalloonConfig invokes describeBalloonConfig operation.
	//
	// Returns the current balloon device configuration.
	//
	// GET /balloon
	DescribeBalloonConfig(ctx context.Context) (DescribeBalloonConfigRes, error)
	// DescribeBalloonStats invokes describeBalloonStats operation.
	//
	// Returns the latest balloon device statistics, only if enabled pre-boot.
	//
	// GET /balloon/statistics
	DescribeBalloonStats(ctx context.Context) (DescribeBalloonStatsRes, error)
	// DescribeInstance invokes describeInstance operation.
	//
	// Returns general information about an instance.
	//
	// GET /
	DescribeInstance(ctx context.Context) (*InstanceInfo, error)
	// GetExportVmConfig invokes getExportVmConfig operation.
	//
	// Gets configuration for all VM resources.
	//
	// GET /vm/config
	GetExportVmConfig(ctx context.Context) (*FullVmConfiguration, error)
	// GetMachineConfiguration invokes getMachineConfiguration operation.
	//
	// Gets the machine configuration of the VM. When called before the PUT operation, it will return the
	// default values for the vCPU count (=1), memory size (=128 MiB). By default Hyperthreading is
	// disabled and there is no CPU Template.
	//
	// GET /machine-config
	GetMachineConfiguration(ctx context.Context) (*MachineConfiguration, error)
	// LoadSnapshot invokes loadSnapshot operation.
	//
	// Loads the microVM state from a snapshot. Only accepted on a fresh Firecracker process (before
	// configuring any resource other than the Logger and Metrics).
	//
	// PUT /snapshot/load
	LoadSnapshot(ctx context.Context, request *SnapshotLoadParams) (LoadSnapshotRes, error)
	// MmdsConfigPut invokes PUT /mmds/config operation.
	//
	// Creates MMDS configuration to be used by the MMDS network stack.
	//
	// PUT /mmds/config
	MmdsConfigPut(ctx context.Context, request *MmdsConfig) (MmdsConfigPutRes, error)
	// MmdsGet invokes GET /mmds operation.
	//
	// Get the MMDS data store.
	//
	// GET /mmds
	MmdsGet(ctx context.Context) (MmdsGetRes, error)
	// MmdsPatch invokes PATCH /mmds operation.
	//
	// Updates the MMDS data store.
	//
	// PATCH /mmds
	MmdsPatch(ctx context.Context, request *MmdsPatchReq) (MmdsPatchRes, error)
	// MmdsPut invokes PUT /mmds operation.
	//
	// Creates a MMDS (Microvm Metadata Service) data store.
	//
	// PUT /mmds
	MmdsPut(ctx context.Context, request *MmdsPutReq) (MmdsPutRes, error)
	// PatchBalloon invokes patchBalloon operation.
	//
	// Updates an existing balloon device, before or after machine startup. Will fail if update is not
	// possible.
	//
	// PATCH /balloon
	PatchBalloon(ctx context.Context, request *BalloonUpdate) (PatchBalloonRes, error)
	// PatchBalloonStatsInterval invokes patchBalloonStatsInterval operation.
	//
	// Updates an existing balloon device statistics interval, before or after machine startup. Will fail
	// if update is not possible.
	//
	// PATCH /balloon/statistics
	PatchBalloonStatsInterval(ctx context.Context, request *BalloonStatsUpdate) (PatchBalloonStatsIntervalRes, error)
	// PatchGuestDriveByID invokes patchGuestDriveByID operation.
	//
	// Updates the properties of the drive with the ID specified by drive_id path parameter. Will fail if
	// update is not possible.
	//
	// PATCH /drives/{drive_id}
	PatchGuestDriveByID(ctx context.Context, request *PartialDrive, params PatchGuestDriveByIDParams) (PatchGuestDriveByIDRes, error)
	// PatchGuestNetworkInterfaceByID invokes patchGuestNetworkInterfaceByID operation.
	//
	// Updates the rate limiters applied to a network interface.
	//
	// PATCH /network-interfaces/{iface_id}
	PatchGuestNetworkInterfaceByID(ctx context.Context, request *PartialNetworkInterface, params PatchGuestNetworkInterfaceByIDParams) (PatchGuestNetworkInterfaceByIDRes, error)
	// PatchMachineConfiguration invokes patchMachineConfiguration operation.
	//
	// Partially updates the Virtual Machine Configuration with the specified input. If any of the
	// parameters has an incorrect value, the whole update fails.
	//
	// PATCH /machine-config
	PatchMachineConfiguration(ctx context.Context, request OptMachineConfiguration) (PatchMachineConfigurationRes, error)
	// PatchVm invokes patchVm operation.
	//
	// Sets the desired state (Paused or Resumed) for the microVM.
	//
	// PATCH /vm
	PatchVm(ctx context.Context, request *VM) (PatchVmRes, error)
	// PutBalloon invokes putBalloon operation.
	//
	// Creates a new balloon device if one does not already exist, otherwise updates it, before machine
	// startup. This will fail after machine startup. Will fail if update is not possible.
	//
	// PUT /balloon
	PutBalloon(ctx context.Context, request *Balloon) (PutBalloonRes, error)
	// PutGuestBootSource invokes putGuestBootSource operation.
	//
	// Creates new boot source if one does not already exist, otherwise updates it. Will fail if update
	// is not possible.
	//
	// PUT /boot-source
	PutGuestBootSource(ctx context.Context, request *BootSource) (PutGuestBootSourceRes, error)
	// PutGuestDriveByID invokes putGuestDriveByID operation.
	//
	// Creates new drive with ID specified by drive_id path parameter. If a drive with the specified ID
	// already exists, updates its state based on new input. Will fail if update is not possible.
	//
	// PUT /drives/{drive_id}
	PutGuestDriveByID(ctx context.Context, request *Drive, params PutGuestDriveByIDParams) (PutGuestDriveByIDRes, error)
	// PutGuestNetworkInterfaceByID invokes putGuestNetworkInterfaceByID operation.
	//
	// Creates new network interface with ID specified by iface_id path parameter.
	//
	// PUT /network-interfaces/{iface_id}
	PutGuestNetworkInterfaceByID(ctx context.Context, request *NetworkInterface, params PutGuestNetworkInterfaceByIDParams) (PutGuestNetworkInterfaceByIDRes, error)
	// PutGuestVsock invokes putGuestVsock operation.
	//
	// The first call creates the device with the configuration specified in body. Subsequent calls will
	// update the device configuration. May fail if update is not possible.
	//
	// PUT /vsock
	PutGuestVsock(ctx context.Context, request *Vsock) (PutGuestVsockRes, error)
	// PutLogger invokes putLogger operation.
	//
	// Initializes the logger by specifying a named pipe or a file for the logs output.
	//
	// PUT /logger
	PutLogger(ctx context.Context, request *Logger) (PutLoggerRes, error)
	// PutMachineConfiguration invokes putMachineConfiguration operation.
	//
	// Updates the Virtual Machine Configuration with the specified input. Firecracker starts with
	// default values for vCPU count (=1) and memory size (=128 MiB). With Hyperthreading enabled, the
	// vCPU count is restricted to be 1 or an even number, otherwise there are no restrictions regarding
	// the vCPU count. If any of the parameters has an incorrect value, the whole update fails.
	//
	// PUT /machine-config
	PutMachineConfiguration(ctx context.Context, request OptMachineConfiguration) (PutMachineConfigurationRes, error)
	// PutMetrics invokes putMetrics operation.
	//
	// Initializes the metrics system by specifying a named pipe or a file for the metrics output.
	//
	// PUT /metrics
	PutMetrics(ctx context.Context, request *Metrics) (PutMetricsRes, error)
}

Invoker invokes operations described by OpenAPI v3 specification.

type LoadSnapshotNoContent

type LoadSnapshotNoContent struct{}

LoadSnapshotNoContent is response for LoadSnapshot operation.

type LoadSnapshotRes

type LoadSnapshotRes interface {
	// contains filtered or unexported methods
}

type Logger

type Logger struct {
	// Set the level. The possible values are case-insensitive.
	Level OptLoggerLevel `json:"level"`
	// Path to the named pipe or file for the human readable log output.
	LogPath string `json:"log_path"`
	// Whether or not to output the level in the logs.
	ShowLevel OptBool `json:"show_level"`
	// Whether or not to include the file path and line number of the log's origin.
	ShowLogOrigin OptBool `json:"show_log_origin"`
}

Describes the configuration option for the logging capability. Ref: #/components/schemas/Logger

func (*Logger) Decode

func (s *Logger) Decode(d *jx.Decoder) error

Decode decodes Logger from json.

func (*Logger) Encode

func (s *Logger) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*Logger) GetLevel

func (s *Logger) GetLevel() OptLoggerLevel

GetLevel returns the value of Level.

func (*Logger) GetLogPath

func (s *Logger) GetLogPath() string

GetLogPath returns the value of LogPath.

func (*Logger) GetShowLevel

func (s *Logger) GetShowLevel() OptBool

GetShowLevel returns the value of ShowLevel.

func (*Logger) GetShowLogOrigin

func (s *Logger) GetShowLogOrigin() OptBool

GetShowLogOrigin returns the value of ShowLogOrigin.

func (*Logger) MarshalJSON

func (s *Logger) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*Logger) SetFake

func (s *Logger) SetFake()

SetFake set fake values.

func (*Logger) SetLevel

func (s *Logger) SetLevel(val OptLoggerLevel)

SetLevel sets the value of Level.

func (*Logger) SetLogPath

func (s *Logger) SetLogPath(val string)

SetLogPath sets the value of LogPath.

func (*Logger) SetShowLevel

func (s *Logger) SetShowLevel(val OptBool)

SetShowLevel sets the value of ShowLevel.

func (*Logger) SetShowLogOrigin

func (s *Logger) SetShowLogOrigin(val OptBool)

SetShowLogOrigin sets the value of ShowLogOrigin.

func (*Logger) UnmarshalJSON

func (s *Logger) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*Logger) Validate

func (s *Logger) Validate() error

type LoggerLevel

type LoggerLevel string

Set the level. The possible values are case-insensitive.

const (
	LoggerLevelError   LoggerLevel = "Error"
	LoggerLevelWarning LoggerLevel = "Warning"
	LoggerLevelInfo    LoggerLevel = "Info"
	LoggerLevelDebug   LoggerLevel = "Debug"
)

func (LoggerLevel) AllValues

func (LoggerLevel) AllValues() []LoggerLevel

AllValues returns all LoggerLevel values.

func (*LoggerLevel) Decode

func (s *LoggerLevel) Decode(d *jx.Decoder) error

Decode decodes LoggerLevel from json.

func (LoggerLevel) Encode

func (s LoggerLevel) Encode(e *jx.Encoder)

Encode encodes LoggerLevel as json.

func (LoggerLevel) MarshalJSON

func (s LoggerLevel) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (LoggerLevel) MarshalText

func (s LoggerLevel) MarshalText() ([]byte, error)

MarshalText implements encoding.TextMarshaler.

func (*LoggerLevel) SetFake

func (s *LoggerLevel) SetFake()

SetFake set fake values.

func (*LoggerLevel) UnmarshalJSON

func (s *LoggerLevel) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*LoggerLevel) UnmarshalText

func (s *LoggerLevel) UnmarshalText(data []byte) error

UnmarshalText implements encoding.TextUnmarshaler.

func (LoggerLevel) Validate

func (s LoggerLevel) Validate() error

type MachineConfiguration

type MachineConfiguration struct {
	CPUTemplate OptCpuTemplate `json:"cpu_template"`
	// Flag for enabling/disabling Hyperthreading.
	HtEnabled bool `json:"ht_enabled"`
	// Memory size of VM.
	MemSizeMib int `json:"mem_size_mib"`
	// Enable dirty page tracking. If this is enabled, then incremental guest memory snapshots can be
	// created. These belong to diff snapshots, which contain, besides the microVM state, only the memory
	// dirtied since a previous snapshot. Full snapshots each contain a full copy of the guest memory.
	TrackDirtyPages OptBool `json:"track_dirty_pages"`
	// Number of vCPUs (either 1 or an even number).
	VcpuCount int `json:"vcpu_count"`
}

Describes the number of vCPUs, memory size, Hyperthreading capabilities and the CPU template. Ref: #/components/schemas/MachineConfiguration

func (*MachineConfiguration) Decode

func (s *MachineConfiguration) Decode(d *jx.Decoder) error

Decode decodes MachineConfiguration from json.

func (*MachineConfiguration) Encode

func (s *MachineConfiguration) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*MachineConfiguration) GetCPUTemplate

func (s *MachineConfiguration) GetCPUTemplate() OptCpuTemplate

GetCPUTemplate returns the value of CPUTemplate.

func (*MachineConfiguration) GetHtEnabled

func (s *MachineConfiguration) GetHtEnabled() bool

GetHtEnabled returns the value of HtEnabled.

func (*MachineConfiguration) GetMemSizeMib

func (s *MachineConfiguration) GetMemSizeMib() int

GetMemSizeMib returns the value of MemSizeMib.

func (*MachineConfiguration) GetTrackDirtyPages

func (s *MachineConfiguration) GetTrackDirtyPages() OptBool

GetTrackDirtyPages returns the value of TrackDirtyPages.

func (*MachineConfiguration) GetVcpuCount

func (s *MachineConfiguration) GetVcpuCount() int

GetVcpuCount returns the value of VcpuCount.

func (*MachineConfiguration) MarshalJSON

func (s *MachineConfiguration) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*MachineConfiguration) SetCPUTemplate

func (s *MachineConfiguration) SetCPUTemplate(val OptCpuTemplate)

SetCPUTemplate sets the value of CPUTemplate.

func (*MachineConfiguration) SetFake

func (s *MachineConfiguration) SetFake()

SetFake set fake values.

func (*MachineConfiguration) SetHtEnabled

func (s *MachineConfiguration) SetHtEnabled(val bool)

SetHtEnabled sets the value of HtEnabled.

func (*MachineConfiguration) SetMemSizeMib

func (s *MachineConfiguration) SetMemSizeMib(val int)

SetMemSizeMib sets the value of MemSizeMib.

func (*MachineConfiguration) SetTrackDirtyPages

func (s *MachineConfiguration) SetTrackDirtyPages(val OptBool)

SetTrackDirtyPages sets the value of TrackDirtyPages.

func (*MachineConfiguration) SetVcpuCount

func (s *MachineConfiguration) SetVcpuCount(val int)

SetVcpuCount sets the value of VcpuCount.

func (*MachineConfiguration) UnmarshalJSON

func (s *MachineConfiguration) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*MachineConfiguration) Validate

func (s *MachineConfiguration) Validate() error

type Metrics

type Metrics struct {
	// Path to the named pipe or file where the JSON-formatted metrics are flushed.
	MetricsPath string `json:"metrics_path"`
}

Describes the configuration option for the metrics capability. Ref: #/components/schemas/Metrics

func (*Metrics) Decode

func (s *Metrics) Decode(d *jx.Decoder) error

Decode decodes Metrics from json.

func (*Metrics) Encode

func (s *Metrics) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*Metrics) GetMetricsPath

func (s *Metrics) GetMetricsPath() string

GetMetricsPath returns the value of MetricsPath.

func (*Metrics) MarshalJSON

func (s *Metrics) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*Metrics) SetFake

func (s *Metrics) SetFake()

SetFake set fake values.

func (*Metrics) SetMetricsPath

func (s *Metrics) SetMetricsPath(val string)

SetMetricsPath sets the value of MetricsPath.

func (*Metrics) UnmarshalJSON

func (s *Metrics) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type Middleware

type Middleware = middleware.Middleware

Middleware is middleware type.

type MmdsConfig

type MmdsConfig struct {
	// A valid IPv4 link-local address.
	Ipv4Address OptString `json:"ipv4_address"`
}

Defines the MMDS configuration. Ref: #/components/schemas/MmdsConfig

func (*MmdsConfig) Decode

func (s *MmdsConfig) Decode(d *jx.Decoder) error

Decode decodes MmdsConfig from json.

func (*MmdsConfig) Encode

func (s *MmdsConfig) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*MmdsConfig) GetIpv4Address

func (s *MmdsConfig) GetIpv4Address() OptString

GetIpv4Address returns the value of Ipv4Address.

func (*MmdsConfig) MarshalJSON

func (s *MmdsConfig) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*MmdsConfig) SetFake

func (s *MmdsConfig) SetFake()

SetFake set fake values.

func (*MmdsConfig) SetIpv4Address

func (s *MmdsConfig) SetIpv4Address(val OptString)

SetIpv4Address sets the value of Ipv4Address.

func (*MmdsConfig) UnmarshalJSON

func (s *MmdsConfig) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type MmdsConfigPutNoContent

type MmdsConfigPutNoContent struct{}

MmdsConfigPutNoContent is response for MmdsConfigPut operation.

type MmdsConfigPutRes

type MmdsConfigPutRes interface {
	// contains filtered or unexported methods
}

type MmdsGetOK

type MmdsGetOK struct{}

func (*MmdsGetOK) Decode

func (s *MmdsGetOK) Decode(d *jx.Decoder) error

Decode decodes MmdsGetOK from json.

func (*MmdsGetOK) Encode

func (s *MmdsGetOK) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*MmdsGetOK) MarshalJSON

func (s *MmdsGetOK) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*MmdsGetOK) SetFake

func (s *MmdsGetOK) SetFake()

SetFake set fake values.

func (*MmdsGetOK) UnmarshalJSON

func (s *MmdsGetOK) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type MmdsGetRes

type MmdsGetRes interface {
	// contains filtered or unexported methods
}

type MmdsPatchNoContent

type MmdsPatchNoContent struct{}

MmdsPatchNoContent is response for MmdsPatch operation.

type MmdsPatchReq

type MmdsPatchReq struct{}

func (*MmdsPatchReq) Decode

func (s *MmdsPatchReq) Decode(d *jx.Decoder) error

Decode decodes MmdsPatchReq from json.

func (*MmdsPatchReq) Encode

func (s *MmdsPatchReq) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*MmdsPatchReq) MarshalJSON

func (s *MmdsPatchReq) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*MmdsPatchReq) SetFake

func (s *MmdsPatchReq) SetFake()

SetFake set fake values.

func (*MmdsPatchReq) UnmarshalJSON

func (s *MmdsPatchReq) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type MmdsPatchRes

type MmdsPatchRes interface {
	// contains filtered or unexported methods
}

type MmdsPutNoContent

type MmdsPutNoContent struct{}

MmdsPutNoContent is response for MmdsPut operation.

type MmdsPutReq

type MmdsPutReq struct{}

func (*MmdsPutReq) Decode

func (s *MmdsPutReq) Decode(d *jx.Decoder) error

Decode decodes MmdsPutReq from json.

func (*MmdsPutReq) Encode

func (s *MmdsPutReq) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*MmdsPutReq) MarshalJSON

func (s *MmdsPutReq) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*MmdsPutReq) SetFake

func (s *MmdsPutReq) SetFake()

SetFake set fake values.

func (*MmdsPutReq) UnmarshalJSON

func (s *MmdsPutReq) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type MmdsPutRes

type MmdsPutRes interface {
	// contains filtered or unexported methods
}

type NetworkInterface

type NetworkInterface struct {
	// If this field is set, the device model will reply to HTTP GET requests sent to the MMDS address
	// via this interface. In this case, both ARP requests for 169.254.169.254 and TCP segments heading
	// to the same address are intercepted by the device model, and do not reach the associated TAP
	// device.
	AllowMmdsRequests OptBool   `json:"allow_mmds_requests"`
	GuestMAC          OptString `json:"guest_mac"`
	// Host level path for the guest network interface.
	HostDevName   string         `json:"host_dev_name"`
	IfaceID       string         `json:"iface_id"`
	RxRateLimiter OptRateLimiter `json:"rx_rate_limiter"`
	TxRateLimiter OptRateLimiter `json:"tx_rate_limiter"`
}

Defines a network interface. Ref: #/components/schemas/NetworkInterface

func (*NetworkInterface) Decode

func (s *NetworkInterface) Decode(d *jx.Decoder) error

Decode decodes NetworkInterface from json.

func (*NetworkInterface) Encode

func (s *NetworkInterface) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*NetworkInterface) GetAllowMmdsRequests

func (s *NetworkInterface) GetAllowMmdsRequests() OptBool

GetAllowMmdsRequests returns the value of AllowMmdsRequests.

func (*NetworkInterface) GetGuestMAC

func (s *NetworkInterface) GetGuestMAC() OptString

GetGuestMAC returns the value of GuestMAC.

func (*NetworkInterface) GetHostDevName

func (s *NetworkInterface) GetHostDevName() string

GetHostDevName returns the value of HostDevName.

func (*NetworkInterface) GetIfaceID

func (s *NetworkInterface) GetIfaceID() string

GetIfaceID returns the value of IfaceID.

func (*NetworkInterface) GetRxRateLimiter

func (s *NetworkInterface) GetRxRateLimiter() OptRateLimiter

GetRxRateLimiter returns the value of RxRateLimiter.

func (*NetworkInterface) GetTxRateLimiter

func (s *NetworkInterface) GetTxRateLimiter() OptRateLimiter

GetTxRateLimiter returns the value of TxRateLimiter.

func (*NetworkInterface) MarshalJSON

func (s *NetworkInterface) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*NetworkInterface) SetAllowMmdsRequests

func (s *NetworkInterface) SetAllowMmdsRequests(val OptBool)

SetAllowMmdsRequests sets the value of AllowMmdsRequests.

func (*NetworkInterface) SetFake

func (s *NetworkInterface) SetFake()

SetFake set fake values.

func (*NetworkInterface) SetGuestMAC

func (s *NetworkInterface) SetGuestMAC(val OptString)

SetGuestMAC sets the value of GuestMAC.

func (*NetworkInterface) SetHostDevName

func (s *NetworkInterface) SetHostDevName(val string)

SetHostDevName sets the value of HostDevName.

func (*NetworkInterface) SetIfaceID

func (s *NetworkInterface) SetIfaceID(val string)

SetIfaceID sets the value of IfaceID.

func (*NetworkInterface) SetRxRateLimiter

func (s *NetworkInterface) SetRxRateLimiter(val OptRateLimiter)

SetRxRateLimiter sets the value of RxRateLimiter.

func (*NetworkInterface) SetTxRateLimiter

func (s *NetworkInterface) SetTxRateLimiter(val OptRateLimiter)

SetTxRateLimiter sets the value of TxRateLimiter.

func (*NetworkInterface) UnmarshalJSON

func (s *NetworkInterface) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*NetworkInterface) Validate

func (s *NetworkInterface) Validate() error

type OptBalloon

type OptBalloon struct {
	Value Balloon
	Set   bool
}

OptBalloon is optional Balloon.

func NewOptBalloon

func NewOptBalloon(v Balloon) OptBalloon

NewOptBalloon returns new OptBalloon with value set to v.

func (*OptBalloon) Decode

func (o *OptBalloon) Decode(d *jx.Decoder) error

Decode decodes Balloon from json.

func (OptBalloon) Encode

func (o OptBalloon) Encode(e *jx.Encoder)

Encode encodes Balloon as json.

func (OptBalloon) Get

func (o OptBalloon) Get() (v Balloon, ok bool)

Get returns value and boolean that denotes whether value was set.

func (OptBalloon) IsSet

func (o OptBalloon) IsSet() bool

IsSet returns true if OptBalloon was set.

func (OptBalloon) MarshalJSON

func (s OptBalloon) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (OptBalloon) Or

func (o OptBalloon) Or(d Balloon) Balloon

Or returns value if set, or given parameter if does not.

func (*OptBalloon) Reset

func (o *OptBalloon) Reset()

Reset unsets value.

func (*OptBalloon) SetFake

func (s *OptBalloon) SetFake()

SetFake set fake values.

func (*OptBalloon) SetTo

func (o *OptBalloon) SetTo(v Balloon)

SetTo sets value to v.

func (*OptBalloon) UnmarshalJSON

func (s *OptBalloon) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type OptBool

type OptBool struct {
	Value bool
	Set   bool
}

OptBool is optional bool.

func NewOptBool

func NewOptBool(v bool) OptBool

NewOptBool returns new OptBool with value set to v.

func (*OptBool) Decode

func (o *OptBool) Decode(d *jx.Decoder) error

Decode decodes bool from json.

func (OptBool) Encode

func (o OptBool) Encode(e *jx.Encoder)

Encode encodes bool as json.

func (OptBool) Get

func (o OptBool) Get() (v bool, ok bool)

Get returns value and boolean that denotes whether value was set.

func (OptBool) IsSet

func (o OptBool) IsSet() bool

IsSet returns true if OptBool was set.

func (OptBool) MarshalJSON

func (s OptBool) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (OptBool) Or

func (o OptBool) Or(d bool) bool

Or returns value if set, or given parameter if does not.

func (*OptBool) Reset

func (o *OptBool) Reset()

Reset unsets value.

func (*OptBool) SetFake

func (s *OptBool) SetFake()

SetFake set fake values.

func (*OptBool) SetTo

func (o *OptBool) SetTo(v bool)

SetTo sets value to v.

func (*OptBool) UnmarshalJSON

func (s *OptBool) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type OptBootSource

type OptBootSource struct {
	Value BootSource
	Set   bool
}

OptBootSource is optional BootSource.

func NewOptBootSource

func NewOptBootSource(v BootSource) OptBootSource

NewOptBootSource returns new OptBootSource with value set to v.

func (*OptBootSource) Decode

func (o *OptBootSource) Decode(d *jx.Decoder) error

Decode decodes BootSource from json.

func (OptBootSource) Encode

func (o OptBootSource) Encode(e *jx.Encoder)

Encode encodes BootSource as json.

func (OptBootSource) Get

func (o OptBootSource) Get() (v BootSource, ok bool)

Get returns value and boolean that denotes whether value was set.

func (OptBootSource) IsSet

func (o OptBootSource) IsSet() bool

IsSet returns true if OptBootSource was set.

func (OptBootSource) MarshalJSON

func (s OptBootSource) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (OptBootSource) Or

Or returns value if set, or given parameter if does not.

func (*OptBootSource) Reset

func (o *OptBootSource) Reset()

Reset unsets value.

func (*OptBootSource) SetFake

func (s *OptBootSource) SetFake()

SetFake set fake values.

func (*OptBootSource) SetTo

func (o *OptBootSource) SetTo(v BootSource)

SetTo sets value to v.

func (*OptBootSource) UnmarshalJSON

func (s *OptBootSource) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type OptCpuTemplate

type OptCpuTemplate struct {
	Value CpuTemplate
	Set   bool
}

OptCpuTemplate is optional CpuTemplate.

func NewOptCpuTemplate

func NewOptCpuTemplate(v CpuTemplate) OptCpuTemplate

NewOptCpuTemplate returns new OptCpuTemplate with value set to v.

func (*OptCpuTemplate) Decode

func (o *OptCpuTemplate) Decode(d *jx.Decoder) error

Decode decodes CpuTemplate from json.

func (OptCpuTemplate) Encode

func (o OptCpuTemplate) Encode(e *jx.Encoder)

Encode encodes CpuTemplate as json.

func (OptCpuTemplate) Get

func (o OptCpuTemplate) Get() (v CpuTemplate, ok bool)

Get returns value and boolean that denotes whether value was set.

func (OptCpuTemplate) IsSet

func (o OptCpuTemplate) IsSet() bool

IsSet returns true if OptCpuTemplate was set.

func (OptCpuTemplate) MarshalJSON

func (s OptCpuTemplate) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (OptCpuTemplate) Or

Or returns value if set, or given parameter if does not.

func (*OptCpuTemplate) Reset

func (o *OptCpuTemplate) Reset()

Reset unsets value.

func (*OptCpuTemplate) SetFake

func (s *OptCpuTemplate) SetFake()

SetFake set fake values.

func (*OptCpuTemplate) SetTo

func (o *OptCpuTemplate) SetTo(v CpuTemplate)

SetTo sets value to v.

func (*OptCpuTemplate) UnmarshalJSON

func (s *OptCpuTemplate) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type OptInt

type OptInt struct {
	Value int
	Set   bool
}

OptInt is optional int.

func NewOptInt

func NewOptInt(v int) OptInt

NewOptInt returns new OptInt with value set to v.

func (*OptInt) Decode

func (o *OptInt) Decode(d *jx.Decoder) error

Decode decodes int from json.

func (OptInt) Encode

func (o OptInt) Encode(e *jx.Encoder)

Encode encodes int as json.

func (OptInt) Get

func (o OptInt) Get() (v int, ok bool)

Get returns value and boolean that denotes whether value was set.

func (OptInt) IsSet

func (o OptInt) IsSet() bool

IsSet returns true if OptInt was set.

func (OptInt) MarshalJSON

func (s OptInt) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (OptInt) Or

func (o OptInt) Or(d int) int

Or returns value if set, or given parameter if does not.

func (*OptInt) Reset

func (o *OptInt) Reset()

Reset unsets value.

func (*OptInt) SetFake

func (s *OptInt) SetFake()

SetFake set fake values.

func (*OptInt) SetTo

func (o *OptInt) SetTo(v int)

SetTo sets value to v.

func (*OptInt) UnmarshalJSON

func (s *OptInt) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type OptInt64

type OptInt64 struct {
	Value int64
	Set   bool
}

OptInt64 is optional int64.

func NewOptInt64

func NewOptInt64(v int64) OptInt64

NewOptInt64 returns new OptInt64 with value set to v.

func (*OptInt64) Decode

func (o *OptInt64) Decode(d *jx.Decoder) error

Decode decodes int64 from json.

func (OptInt64) Encode

func (o OptInt64) Encode(e *jx.Encoder)

Encode encodes int64 as json.

func (OptInt64) Get

func (o OptInt64) Get() (v int64, ok bool)

Get returns value and boolean that denotes whether value was set.

func (OptInt64) IsSet

func (o OptInt64) IsSet() bool

IsSet returns true if OptInt64 was set.

func (OptInt64) MarshalJSON

func (s OptInt64) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (OptInt64) Or

func (o OptInt64) Or(d int64) int64

Or returns value if set, or given parameter if does not.

func (*OptInt64) Reset

func (o *OptInt64) Reset()

Reset unsets value.

func (*OptInt64) SetFake

func (s *OptInt64) SetFake()

SetFake set fake values.

func (*OptInt64) SetTo

func (o *OptInt64) SetTo(v int64)

SetTo sets value to v.

func (*OptInt64) UnmarshalJSON

func (s *OptInt64) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type OptLogger

type OptLogger struct {
	Value Logger
	Set   bool
}

OptLogger is optional Logger.

func NewOptLogger

func NewOptLogger(v Logger) OptLogger

NewOptLogger returns new OptLogger with value set to v.

func (*OptLogger) Decode

func (o *OptLogger) Decode(d *jx.Decoder) error

Decode decodes Logger from json.

func (OptLogger) Encode

func (o OptLogger) Encode(e *jx.Encoder)

Encode encodes Logger as json.

func (OptLogger) Get

func (o OptLogger) Get() (v Logger, ok bool)

Get returns value and boolean that denotes whether value was set.

func (OptLogger) IsSet

func (o OptLogger) IsSet() bool

IsSet returns true if OptLogger was set.

func (OptLogger) MarshalJSON

func (s OptLogger) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (OptLogger) Or

func (o OptLogger) Or(d Logger) Logger

Or returns value if set, or given parameter if does not.

func (*OptLogger) Reset

func (o *OptLogger) Reset()

Reset unsets value.

func (*OptLogger) SetFake

func (s *OptLogger) SetFake()

SetFake set fake values.

func (*OptLogger) SetTo

func (o *OptLogger) SetTo(v Logger)

SetTo sets value to v.

func (*OptLogger) UnmarshalJSON

func (s *OptLogger) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type OptLoggerLevel

type OptLoggerLevel struct {
	Value LoggerLevel
	Set   bool
}

OptLoggerLevel is optional LoggerLevel.

func NewOptLoggerLevel

func NewOptLoggerLevel(v LoggerLevel) OptLoggerLevel

NewOptLoggerLevel returns new OptLoggerLevel with value set to v.

func (*OptLoggerLevel) Decode

func (o *OptLoggerLevel) Decode(d *jx.Decoder) error

Decode decodes LoggerLevel from json.

func (OptLoggerLevel) Encode

func (o OptLoggerLevel) Encode(e *jx.Encoder)

Encode encodes LoggerLevel as json.

func (OptLoggerLevel) Get

func (o OptLoggerLevel) Get() (v LoggerLevel, ok bool)

Get returns value and boolean that denotes whether value was set.

func (OptLoggerLevel) IsSet

func (o OptLoggerLevel) IsSet() bool

IsSet returns true if OptLoggerLevel was set.

func (OptLoggerLevel) MarshalJSON

func (s OptLoggerLevel) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (OptLoggerLevel) Or

Or returns value if set, or given parameter if does not.

func (*OptLoggerLevel) Reset

func (o *OptLoggerLevel) Reset()

Reset unsets value.

func (*OptLoggerLevel) SetFake

func (s *OptLoggerLevel) SetFake()

SetFake set fake values.

func (*OptLoggerLevel) SetTo

func (o *OptLoggerLevel) SetTo(v LoggerLevel)

SetTo sets value to v.

func (*OptLoggerLevel) UnmarshalJSON

func (s *OptLoggerLevel) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type OptMachineConfiguration

type OptMachineConfiguration struct {
	Value MachineConfiguration
	Set   bool
}

OptMachineConfiguration is optional MachineConfiguration.

func NewOptMachineConfiguration

func NewOptMachineConfiguration(v MachineConfiguration) OptMachineConfiguration

NewOptMachineConfiguration returns new OptMachineConfiguration with value set to v.

func (*OptMachineConfiguration) Decode

func (o *OptMachineConfiguration) Decode(d *jx.Decoder) error

Decode decodes MachineConfiguration from json.

func (OptMachineConfiguration) Encode

func (o OptMachineConfiguration) Encode(e *jx.Encoder)

Encode encodes MachineConfiguration as json.

func (OptMachineConfiguration) Get

Get returns value and boolean that denotes whether value was set.

func (OptMachineConfiguration) IsSet

func (o OptMachineConfiguration) IsSet() bool

IsSet returns true if OptMachineConfiguration was set.

func (OptMachineConfiguration) MarshalJSON

func (s OptMachineConfiguration) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (OptMachineConfiguration) Or

Or returns value if set, or given parameter if does not.

func (*OptMachineConfiguration) Reset

func (o *OptMachineConfiguration) Reset()

Reset unsets value.

func (*OptMachineConfiguration) SetFake

func (s *OptMachineConfiguration) SetFake()

SetFake set fake values.

func (*OptMachineConfiguration) SetTo

SetTo sets value to v.

func (*OptMachineConfiguration) UnmarshalJSON

func (s *OptMachineConfiguration) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type OptMetrics

type OptMetrics struct {
	Value Metrics
	Set   bool
}

OptMetrics is optional Metrics.

func NewOptMetrics

func NewOptMetrics(v Metrics) OptMetrics

NewOptMetrics returns new OptMetrics with value set to v.

func (*OptMetrics) Decode

func (o *OptMetrics) Decode(d *jx.Decoder) error

Decode decodes Metrics from json.

func (OptMetrics) Encode

func (o OptMetrics) Encode(e *jx.Encoder)

Encode encodes Metrics as json.

func (OptMetrics) Get

func (o OptMetrics) Get() (v Metrics, ok bool)

Get returns value and boolean that denotes whether value was set.

func (OptMetrics) IsSet

func (o OptMetrics) IsSet() bool

IsSet returns true if OptMetrics was set.

func (OptMetrics) MarshalJSON

func (s OptMetrics) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (OptMetrics) Or

func (o OptMetrics) Or(d Metrics) Metrics

Or returns value if set, or given parameter if does not.

func (*OptMetrics) Reset

func (o *OptMetrics) Reset()

Reset unsets value.

func (*OptMetrics) SetFake

func (s *OptMetrics) SetFake()

SetFake set fake values.

func (*OptMetrics) SetTo

func (o *OptMetrics) SetTo(v Metrics)

SetTo sets value to v.

func (*OptMetrics) UnmarshalJSON

func (s *OptMetrics) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type OptMmdsConfig

type OptMmdsConfig struct {
	Value MmdsConfig
	Set   bool
}

OptMmdsConfig is optional MmdsConfig.

func NewOptMmdsConfig

func NewOptMmdsConfig(v MmdsConfig) OptMmdsConfig

NewOptMmdsConfig returns new OptMmdsConfig with value set to v.

func (*OptMmdsConfig) Decode

func (o *OptMmdsConfig) Decode(d *jx.Decoder) error

Decode decodes MmdsConfig from json.

func (OptMmdsConfig) Encode

func (o OptMmdsConfig) Encode(e *jx.Encoder)

Encode encodes MmdsConfig as json.

func (OptMmdsConfig) Get

func (o OptMmdsConfig) Get() (v MmdsConfig, ok bool)

Get returns value and boolean that denotes whether value was set.

func (OptMmdsConfig) IsSet

func (o OptMmdsConfig) IsSet() bool

IsSet returns true if OptMmdsConfig was set.

func (OptMmdsConfig) MarshalJSON

func (s OptMmdsConfig) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (OptMmdsConfig) Or

Or returns value if set, or given parameter if does not.

func (*OptMmdsConfig) Reset

func (o *OptMmdsConfig) Reset()

Reset unsets value.

func (*OptMmdsConfig) SetFake

func (s *OptMmdsConfig) SetFake()

SetFake set fake values.

func (*OptMmdsConfig) SetTo

func (o *OptMmdsConfig) SetTo(v MmdsConfig)

SetTo sets value to v.

func (*OptMmdsConfig) UnmarshalJSON

func (s *OptMmdsConfig) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type OptRateLimiter

type OptRateLimiter struct {
	Value RateLimiter
	Set   bool
}

OptRateLimiter is optional RateLimiter.

func NewOptRateLimiter

func NewOptRateLimiter(v RateLimiter) OptRateLimiter

NewOptRateLimiter returns new OptRateLimiter with value set to v.

func (*OptRateLimiter) Decode

func (o *OptRateLimiter) Decode(d *jx.Decoder) error

Decode decodes RateLimiter from json.

func (OptRateLimiter) Encode

func (o OptRateLimiter) Encode(e *jx.Encoder)

Encode encodes RateLimiter as json.

func (OptRateLimiter) Get

func (o OptRateLimiter) Get() (v RateLimiter, ok bool)

Get returns value and boolean that denotes whether value was set.

func (OptRateLimiter) IsSet

func (o OptRateLimiter) IsSet() bool

IsSet returns true if OptRateLimiter was set.

func (OptRateLimiter) MarshalJSON

func (s OptRateLimiter) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (OptRateLimiter) Or

Or returns value if set, or given parameter if does not.

func (*OptRateLimiter) Reset

func (o *OptRateLimiter) Reset()

Reset unsets value.

func (*OptRateLimiter) SetFake

func (s *OptRateLimiter) SetFake()

SetFake set fake values.

func (*OptRateLimiter) SetTo

func (o *OptRateLimiter) SetTo(v RateLimiter)

SetTo sets value to v.

func (*OptRateLimiter) UnmarshalJSON

func (s *OptRateLimiter) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type OptSnapshotCreateParamsSnapshotType

type OptSnapshotCreateParamsSnapshotType struct {
	Value SnapshotCreateParamsSnapshotType
	Set   bool
}

OptSnapshotCreateParamsSnapshotType is optional SnapshotCreateParamsSnapshotType.

func NewOptSnapshotCreateParamsSnapshotType

func NewOptSnapshotCreateParamsSnapshotType(v SnapshotCreateParamsSnapshotType) OptSnapshotCreateParamsSnapshotType

NewOptSnapshotCreateParamsSnapshotType returns new OptSnapshotCreateParamsSnapshotType with value set to v.

func (*OptSnapshotCreateParamsSnapshotType) Decode

Decode decodes SnapshotCreateParamsSnapshotType from json.

func (OptSnapshotCreateParamsSnapshotType) Encode

Encode encodes SnapshotCreateParamsSnapshotType as json.

func (OptSnapshotCreateParamsSnapshotType) Get

Get returns value and boolean that denotes whether value was set.

func (OptSnapshotCreateParamsSnapshotType) IsSet

IsSet returns true if OptSnapshotCreateParamsSnapshotType was set.

func (OptSnapshotCreateParamsSnapshotType) MarshalJSON

func (s OptSnapshotCreateParamsSnapshotType) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (OptSnapshotCreateParamsSnapshotType) Or

Or returns value if set, or given parameter if does not.

func (*OptSnapshotCreateParamsSnapshotType) Reset

Reset unsets value.

func (*OptSnapshotCreateParamsSnapshotType) SetFake

SetFake set fake values.

func (*OptSnapshotCreateParamsSnapshotType) SetTo

SetTo sets value to v.

func (*OptSnapshotCreateParamsSnapshotType) UnmarshalJSON

func (s *OptSnapshotCreateParamsSnapshotType) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type OptString

type OptString struct {
	Value string
	Set   bool
}

OptString is optional string.

func NewOptString

func NewOptString(v string) OptString

NewOptString returns new OptString with value set to v.

func (*OptString) Decode

func (o *OptString) Decode(d *jx.Decoder) error

Decode decodes string from json.

func (OptString) Encode

func (o OptString) Encode(e *jx.Encoder)

Encode encodes string as json.

func (OptString) Get

func (o OptString) Get() (v string, ok bool)

Get returns value and boolean that denotes whether value was set.

func (OptString) IsSet

func (o OptString) IsSet() bool

IsSet returns true if OptString was set.

func (OptString) MarshalJSON

func (s OptString) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (OptString) Or

func (o OptString) Or(d string) string

Or returns value if set, or given parameter if does not.

func (*OptString) Reset

func (o *OptString) Reset()

Reset unsets value.

func (*OptString) SetFake

func (s *OptString) SetFake()

SetFake set fake values.

func (*OptString) SetTo

func (o *OptString) SetTo(v string)

SetTo sets value to v.

func (*OptString) UnmarshalJSON

func (s *OptString) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type OptTokenBucket

type OptTokenBucket struct {
	Value TokenBucket
	Set   bool
}

OptTokenBucket is optional TokenBucket.

func NewOptTokenBucket

func NewOptTokenBucket(v TokenBucket) OptTokenBucket

NewOptTokenBucket returns new OptTokenBucket with value set to v.

func (*OptTokenBucket) Decode

func (o *OptTokenBucket) Decode(d *jx.Decoder) error

Decode decodes TokenBucket from json.

func (OptTokenBucket) Encode

func (o OptTokenBucket) Encode(e *jx.Encoder)

Encode encodes TokenBucket as json.

func (OptTokenBucket) Get

func (o OptTokenBucket) Get() (v TokenBucket, ok bool)

Get returns value and boolean that denotes whether value was set.

func (OptTokenBucket) IsSet

func (o OptTokenBucket) IsSet() bool

IsSet returns true if OptTokenBucket was set.

func (OptTokenBucket) MarshalJSON

func (s OptTokenBucket) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (OptTokenBucket) Or

Or returns value if set, or given parameter if does not.

func (*OptTokenBucket) Reset

func (o *OptTokenBucket) Reset()

Reset unsets value.

func (*OptTokenBucket) SetFake

func (s *OptTokenBucket) SetFake()

SetFake set fake values.

func (*OptTokenBucket) SetTo

func (o *OptTokenBucket) SetTo(v TokenBucket)

SetTo sets value to v.

func (*OptTokenBucket) UnmarshalJSON

func (s *OptTokenBucket) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type OptVsock

type OptVsock struct {
	Value Vsock
	Set   bool
}

OptVsock is optional Vsock.

func NewOptVsock

func NewOptVsock(v Vsock) OptVsock

NewOptVsock returns new OptVsock with value set to v.

func (*OptVsock) Decode

func (o *OptVsock) Decode(d *jx.Decoder) error

Decode decodes Vsock from json.

func (OptVsock) Encode

func (o OptVsock) Encode(e *jx.Encoder)

Encode encodes Vsock as json.

func (OptVsock) Get

func (o OptVsock) Get() (v Vsock, ok bool)

Get returns value and boolean that denotes whether value was set.

func (OptVsock) IsSet

func (o OptVsock) IsSet() bool

IsSet returns true if OptVsock was set.

func (OptVsock) MarshalJSON

func (s OptVsock) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (OptVsock) Or

func (o OptVsock) Or(d Vsock) Vsock

Or returns value if set, or given parameter if does not.

func (*OptVsock) Reset

func (o *OptVsock) Reset()

Reset unsets value.

func (*OptVsock) SetFake

func (s *OptVsock) SetFake()

SetFake set fake values.

func (*OptVsock) SetTo

func (o *OptVsock) SetTo(v Vsock)

SetTo sets value to v.

func (*OptVsock) UnmarshalJSON

func (s *OptVsock) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type Option

type Option interface {
	ServerOption
	ClientOption
}

Option is config option.

func WithMeterProvider

func WithMeterProvider(provider metric.MeterProvider) Option

WithMeterProvider specifies a meter provider to use for creating a meter.

If none is specified, the otel.GetMeterProvider() is used.

func WithTracerProvider

func WithTracerProvider(provider trace.TracerProvider) Option

WithTracerProvider specifies a tracer provider to use for creating a tracer.

If none is specified, the global provider is used.

type PartialDrive

type PartialDrive struct {
	DriveID string `json:"drive_id"`
	// Host level path for the guest drive.
	PathOnHost  OptString      `json:"path_on_host"`
	RateLimiter OptRateLimiter `json:"rate_limiter"`
}

Ref: #/components/schemas/PartialDrive

func (*PartialDrive) Decode

func (s *PartialDrive) Decode(d *jx.Decoder) error

Decode decodes PartialDrive from json.

func (*PartialDrive) Encode

func (s *PartialDrive) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*PartialDrive) GetDriveID

func (s *PartialDrive) GetDriveID() string

GetDriveID returns the value of DriveID.

func (*PartialDrive) GetPathOnHost

func (s *PartialDrive) GetPathOnHost() OptString

GetPathOnHost returns the value of PathOnHost.

func (*PartialDrive) GetRateLimiter

func (s *PartialDrive) GetRateLimiter() OptRateLimiter

GetRateLimiter returns the value of RateLimiter.

func (*PartialDrive) MarshalJSON

func (s *PartialDrive) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*PartialDrive) SetDriveID

func (s *PartialDrive) SetDriveID(val string)

SetDriveID sets the value of DriveID.

func (*PartialDrive) SetFake

func (s *PartialDrive) SetFake()

SetFake set fake values.

func (*PartialDrive) SetPathOnHost

func (s *PartialDrive) SetPathOnHost(val OptString)

SetPathOnHost sets the value of PathOnHost.

func (*PartialDrive) SetRateLimiter

func (s *PartialDrive) SetRateLimiter(val OptRateLimiter)

SetRateLimiter sets the value of RateLimiter.

func (*PartialDrive) UnmarshalJSON

func (s *PartialDrive) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*PartialDrive) Validate

func (s *PartialDrive) Validate() error

type PartialNetworkInterface

type PartialNetworkInterface struct {
	IfaceID       string         `json:"iface_id"`
	RxRateLimiter OptRateLimiter `json:"rx_rate_limiter"`
	TxRateLimiter OptRateLimiter `json:"tx_rate_limiter"`
}

Defines a partial network interface structure, used to update the rate limiters for that interface,

after microvm start.

Ref: #/components/schemas/PartialNetworkInterface

func (*PartialNetworkInterface) Decode

func (s *PartialNetworkInterface) Decode(d *jx.Decoder) error

Decode decodes PartialNetworkInterface from json.

func (*PartialNetworkInterface) Encode

func (s *PartialNetworkInterface) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*PartialNetworkInterface) GetIfaceID

func (s *PartialNetworkInterface) GetIfaceID() string

GetIfaceID returns the value of IfaceID.

func (*PartialNetworkInterface) GetRxRateLimiter

func (s *PartialNetworkInterface) GetRxRateLimiter() OptRateLimiter

GetRxRateLimiter returns the value of RxRateLimiter.

func (*PartialNetworkInterface) GetTxRateLimiter

func (s *PartialNetworkInterface) GetTxRateLimiter() OptRateLimiter

GetTxRateLimiter returns the value of TxRateLimiter.

func (*PartialNetworkInterface) MarshalJSON

func (s *PartialNetworkInterface) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*PartialNetworkInterface) SetFake

func (s *PartialNetworkInterface) SetFake()

SetFake set fake values.

func (*PartialNetworkInterface) SetIfaceID

func (s *PartialNetworkInterface) SetIfaceID(val string)

SetIfaceID sets the value of IfaceID.

func (*PartialNetworkInterface) SetRxRateLimiter

func (s *PartialNetworkInterface) SetRxRateLimiter(val OptRateLimiter)

SetRxRateLimiter sets the value of RxRateLimiter.

func (*PartialNetworkInterface) SetTxRateLimiter

func (s *PartialNetworkInterface) SetTxRateLimiter(val OptRateLimiter)

SetTxRateLimiter sets the value of TxRateLimiter.

func (*PartialNetworkInterface) UnmarshalJSON

func (s *PartialNetworkInterface) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*PartialNetworkInterface) Validate

func (s *PartialNetworkInterface) Validate() error

type PatchBalloonNoContent

type PatchBalloonNoContent struct{}

PatchBalloonNoContent is response for PatchBalloon operation.

type PatchBalloonRes

type PatchBalloonRes interface {
	// contains filtered or unexported methods
}

type PatchBalloonStatsIntervalNoContent

type PatchBalloonStatsIntervalNoContent struct{}

PatchBalloonStatsIntervalNoContent is response for PatchBalloonStatsInterval operation.

type PatchBalloonStatsIntervalRes

type PatchBalloonStatsIntervalRes interface {
	// contains filtered or unexported methods
}

type PatchGuestDriveByIDNoContent

type PatchGuestDriveByIDNoContent struct{}

PatchGuestDriveByIDNoContent is response for PatchGuestDriveByID operation.

type PatchGuestDriveByIDParams

type PatchGuestDriveByIDParams struct {
	// The id of the guest drive.
	DriveID string
}

PatchGuestDriveByIDParams is parameters of patchGuestDriveByID operation.

type PatchGuestDriveByIDRes

type PatchGuestDriveByIDRes interface {
	// contains filtered or unexported methods
}

type PatchGuestNetworkInterfaceByIDNoContent

type PatchGuestNetworkInterfaceByIDNoContent struct{}

PatchGuestNetworkInterfaceByIDNoContent is response for PatchGuestNetworkInterfaceByID operation.

type PatchGuestNetworkInterfaceByIDParams

type PatchGuestNetworkInterfaceByIDParams struct {
	// The id of the guest network interface.
	IfaceID string
}

PatchGuestNetworkInterfaceByIDParams is parameters of patchGuestNetworkInterfaceByID operation.

type PatchGuestNetworkInterfaceByIDRes

type PatchGuestNetworkInterfaceByIDRes interface {
	// contains filtered or unexported methods
}

type PatchMachineConfigurationNoContent

type PatchMachineConfigurationNoContent struct{}

PatchMachineConfigurationNoContent is response for PatchMachineConfiguration operation.

type PatchMachineConfigurationRes

type PatchMachineConfigurationRes interface {
	// contains filtered or unexported methods
}

type PatchVmNoContent

type PatchVmNoContent struct{}

PatchVmNoContent is response for PatchVm operation.

type PatchVmRes

type PatchVmRes interface {
	// contains filtered or unexported methods
}

type PutBalloonNoContent

type PutBalloonNoContent struct{}

PutBalloonNoContent is response for PutBalloon operation.

type PutBalloonRes

type PutBalloonRes interface {
	// contains filtered or unexported methods
}

type PutGuestBootSourceNoContent

type PutGuestBootSourceNoContent struct{}

PutGuestBootSourceNoContent is response for PutGuestBootSource operation.

type PutGuestBootSourceRes

type PutGuestBootSourceRes interface {
	// contains filtered or unexported methods
}

type PutGuestDriveByIDNoContent

type PutGuestDriveByIDNoContent struct{}

PutGuestDriveByIDNoContent is response for PutGuestDriveByID operation.

type PutGuestDriveByIDParams

type PutGuestDriveByIDParams struct {
	// The id of the guest drive.
	DriveID string
}

PutGuestDriveByIDParams is parameters of putGuestDriveByID operation.

type PutGuestDriveByIDRes

type PutGuestDriveByIDRes interface {
	// contains filtered or unexported methods
}

type PutGuestNetworkInterfaceByIDNoContent

type PutGuestNetworkInterfaceByIDNoContent struct{}

PutGuestNetworkInterfaceByIDNoContent is response for PutGuestNetworkInterfaceByID operation.

type PutGuestNetworkInterfaceByIDParams

type PutGuestNetworkInterfaceByIDParams struct {
	// The id of the guest network interface.
	IfaceID string
}

PutGuestNetworkInterfaceByIDParams is parameters of putGuestNetworkInterfaceByID operation.

type PutGuestNetworkInterfaceByIDRes

type PutGuestNetworkInterfaceByIDRes interface {
	// contains filtered or unexported methods
}

type PutGuestVsockNoContent

type PutGuestVsockNoContent struct{}

PutGuestVsockNoContent is response for PutGuestVsock operation.

type PutGuestVsockRes

type PutGuestVsockRes interface {
	// contains filtered or unexported methods
}

type PutLoggerNoContent

type PutLoggerNoContent struct{}

PutLoggerNoContent is response for PutLogger operation.

type PutLoggerRes

type PutLoggerRes interface {
	// contains filtered or unexported methods
}

type PutMachineConfigurationNoContent

type PutMachineConfigurationNoContent struct{}

PutMachineConfigurationNoContent is response for PutMachineConfiguration operation.

type PutMachineConfigurationRes

type PutMachineConfigurationRes interface {
	// contains filtered or unexported methods
}

type PutMetricsNoContent

type PutMetricsNoContent struct{}

PutMetricsNoContent is response for PutMetrics operation.

type PutMetricsRes

type PutMetricsRes interface {
	// contains filtered or unexported methods
}

type RateLimiter

type RateLimiter struct {
	Bandwidth OptTokenBucket `json:"bandwidth"`
	Ops       OptTokenBucket `json:"ops"`
}

Defines an IO rate limiter with independent bytes/s and ops/s limits. Limits are defined by configuring each of the _bandwidth_ and _ops_ token buckets. Ref: #/components/schemas/RateLimiter

func (*RateLimiter) Decode

func (s *RateLimiter) Decode(d *jx.Decoder) error

Decode decodes RateLimiter from json.

func (*RateLimiter) Encode

func (s *RateLimiter) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*RateLimiter) GetBandwidth

func (s *RateLimiter) GetBandwidth() OptTokenBucket

GetBandwidth returns the value of Bandwidth.

func (*RateLimiter) GetOps

func (s *RateLimiter) GetOps() OptTokenBucket

GetOps returns the value of Ops.

func (*RateLimiter) MarshalJSON

func (s *RateLimiter) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*RateLimiter) SetBandwidth

func (s *RateLimiter) SetBandwidth(val OptTokenBucket)

SetBandwidth sets the value of Bandwidth.

func (*RateLimiter) SetFake

func (s *RateLimiter) SetFake()

SetFake set fake values.

func (*RateLimiter) SetOps

func (s *RateLimiter) SetOps(val OptTokenBucket)

SetOps sets the value of Ops.

func (*RateLimiter) UnmarshalJSON

func (s *RateLimiter) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*RateLimiter) Validate

func (s *RateLimiter) Validate() error

type Route

type Route struct {
	// contains filtered or unexported fields
}

Route is route object.

func (Route) Args

func (r Route) Args() []string

Args returns parsed arguments.

func (Route) Name

func (r Route) Name() string

Name returns ogen operation name.

It is guaranteed to be unique and not empty.

func (Route) OperationID

func (r Route) OperationID() string

OperationID returns OpenAPI operationId.

func (Route) PathPattern

func (r Route) PathPattern() string

PathPattern returns OpenAPI path.

func (Route) Summary

func (r Route) Summary() string

Summary returns OpenAPI summary.

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server implements http server based on OpenAPI v3 specification and calls Handler to handle requests.

func NewServer

func NewServer(h Handler, opts ...ServerOption) (*Server, error)

NewServer creates new Server.

func (*Server) FindPath

func (s *Server) FindPath(method string, u *url.URL) (r Route, _ bool)

FindPath finds Route for given method and URL.

func (*Server) FindRoute

func (s *Server) FindRoute(method, path string) (Route, bool)

FindRoute finds Route for given method and path.

Note: this method does not unescape path or handle reserved characters in path properly. Use FindPath instead.

func (*Server) ServeHTTP

func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP serves http request as defined by OpenAPI v3 specification, calling handler that matches the path or returning not found error.

type ServerOption

type ServerOption interface {
	// contains filtered or unexported methods
}

ServerOption is server config option.

func WithErrorHandler

func WithErrorHandler(h ErrorHandler) ServerOption

WithErrorHandler specifies error handler to use.

func WithMaxMultipartMemory

func WithMaxMultipartMemory(max int64) ServerOption

WithMaxMultipartMemory specifies limit of memory for storing file parts. File parts which can't be stored in memory will be stored on disk in temporary files.

func WithMethodNotAllowed

func WithMethodNotAllowed(methodNotAllowed func(w http.ResponseWriter, r *http.Request, allowed string)) ServerOption

WithMethodNotAllowed specifies Method Not Allowed handler to use.

func WithMiddleware

func WithMiddleware(m ...Middleware) ServerOption

WithMiddleware specifies middlewares to use.

func WithNotFound

func WithNotFound(notFound http.HandlerFunc) ServerOption

WithNotFound specifies Not Found handler to use.

func WithPathPrefix

func WithPathPrefix(prefix string) ServerOption

WithPathPrefix specifies server path prefix.

type SnapshotCreateParams

type SnapshotCreateParams struct {
	// Path to the file that will contain the guest memory.
	MemFilePath string `json:"mem_file_path"`
	// Path to the file that will contain the microVM state.
	SnapshotPath string `json:"snapshot_path"`
	// Type of snapshot to create. It is optional and by default, a full snapshot is created.
	SnapshotType OptSnapshotCreateParamsSnapshotType `json:"snapshot_type"`
	// The microVM version for which we want to create the snapshot. It is optional and it defaults to
	// the current version.
	Version OptString `json:"version"`
}

Ref: #/components/schemas/SnapshotCreateParams

func (*SnapshotCreateParams) Decode

func (s *SnapshotCreateParams) Decode(d *jx.Decoder) error

Decode decodes SnapshotCreateParams from json.

func (*SnapshotCreateParams) Encode

func (s *SnapshotCreateParams) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*SnapshotCreateParams) GetMemFilePath

func (s *SnapshotCreateParams) GetMemFilePath() string

GetMemFilePath returns the value of MemFilePath.

func (*SnapshotCreateParams) GetSnapshotPath

func (s *SnapshotCreateParams) GetSnapshotPath() string

GetSnapshotPath returns the value of SnapshotPath.

func (*SnapshotCreateParams) GetSnapshotType

GetSnapshotType returns the value of SnapshotType.

func (*SnapshotCreateParams) GetVersion

func (s *SnapshotCreateParams) GetVersion() OptString

GetVersion returns the value of Version.

func (*SnapshotCreateParams) MarshalJSON

func (s *SnapshotCreateParams) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*SnapshotCreateParams) SetFake

func (s *SnapshotCreateParams) SetFake()

SetFake set fake values.

func (*SnapshotCreateParams) SetMemFilePath

func (s *SnapshotCreateParams) SetMemFilePath(val string)

SetMemFilePath sets the value of MemFilePath.

func (*SnapshotCreateParams) SetSnapshotPath

func (s *SnapshotCreateParams) SetSnapshotPath(val string)

SetSnapshotPath sets the value of SnapshotPath.

func (*SnapshotCreateParams) SetSnapshotType

SetSnapshotType sets the value of SnapshotType.

func (*SnapshotCreateParams) SetVersion

func (s *SnapshotCreateParams) SetVersion(val OptString)

SetVersion sets the value of Version.

func (*SnapshotCreateParams) UnmarshalJSON

func (s *SnapshotCreateParams) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*SnapshotCreateParams) Validate

func (s *SnapshotCreateParams) Validate() error

type SnapshotCreateParamsSnapshotType

type SnapshotCreateParamsSnapshotType string

Type of snapshot to create. It is optional and by default, a full snapshot is created.

const (
	SnapshotCreateParamsSnapshotTypeFull SnapshotCreateParamsSnapshotType = "Full"
	SnapshotCreateParamsSnapshotTypeDiff SnapshotCreateParamsSnapshotType = "Diff"
)

func (SnapshotCreateParamsSnapshotType) AllValues

AllValues returns all SnapshotCreateParamsSnapshotType values.

func (*SnapshotCreateParamsSnapshotType) Decode

Decode decodes SnapshotCreateParamsSnapshotType from json.

func (SnapshotCreateParamsSnapshotType) Encode

Encode encodes SnapshotCreateParamsSnapshotType as json.

func (SnapshotCreateParamsSnapshotType) MarshalJSON

func (s SnapshotCreateParamsSnapshotType) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (SnapshotCreateParamsSnapshotType) MarshalText

func (s SnapshotCreateParamsSnapshotType) MarshalText() ([]byte, error)

MarshalText implements encoding.TextMarshaler.

func (*SnapshotCreateParamsSnapshotType) SetFake

func (s *SnapshotCreateParamsSnapshotType) SetFake()

SetFake set fake values.

func (*SnapshotCreateParamsSnapshotType) UnmarshalJSON

func (s *SnapshotCreateParamsSnapshotType) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*SnapshotCreateParamsSnapshotType) UnmarshalText

func (s *SnapshotCreateParamsSnapshotType) UnmarshalText(data []byte) error

UnmarshalText implements encoding.TextUnmarshaler.

func (SnapshotCreateParamsSnapshotType) Validate

type SnapshotLoadParams

type SnapshotLoadParams struct {
	// Enable support for incremental (diff) snapshots by tracking dirty guest pages.
	EnableDiffSnapshots OptBool `json:"enable_diff_snapshots"`
	// Path to the file that contains the guest memory to be loaded.
	MemFilePath string `json:"mem_file_path"`
	// Path to the file that contains the microVM state to be loaded.
	SnapshotPath string `json:"snapshot_path"`
	// When set to true, the vm is also resumed if the snapshot load is successful.
	ResumeVM OptBool `json:"resume_vm"`
}

Ref: #/components/schemas/SnapshotLoadParams

func (*SnapshotLoadParams) Decode

func (s *SnapshotLoadParams) Decode(d *jx.Decoder) error

Decode decodes SnapshotLoadParams from json.

func (*SnapshotLoadParams) Encode

func (s *SnapshotLoadParams) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*SnapshotLoadParams) GetEnableDiffSnapshots

func (s *SnapshotLoadParams) GetEnableDiffSnapshots() OptBool

GetEnableDiffSnapshots returns the value of EnableDiffSnapshots.

func (*SnapshotLoadParams) GetMemFilePath

func (s *SnapshotLoadParams) GetMemFilePath() string

GetMemFilePath returns the value of MemFilePath.

func (*SnapshotLoadParams) GetResumeVM

func (s *SnapshotLoadParams) GetResumeVM() OptBool

GetResumeVM returns the value of ResumeVM.

func (*SnapshotLoadParams) GetSnapshotPath

func (s *SnapshotLoadParams) GetSnapshotPath() string

GetSnapshotPath returns the value of SnapshotPath.

func (*SnapshotLoadParams) MarshalJSON

func (s *SnapshotLoadParams) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*SnapshotLoadParams) SetEnableDiffSnapshots

func (s *SnapshotLoadParams) SetEnableDiffSnapshots(val OptBool)

SetEnableDiffSnapshots sets the value of EnableDiffSnapshots.

func (*SnapshotLoadParams) SetFake

func (s *SnapshotLoadParams) SetFake()

SetFake set fake values.

func (*SnapshotLoadParams) SetMemFilePath

func (s *SnapshotLoadParams) SetMemFilePath(val string)

SetMemFilePath sets the value of MemFilePath.

func (*SnapshotLoadParams) SetResumeVM

func (s *SnapshotLoadParams) SetResumeVM(val OptBool)

SetResumeVM sets the value of ResumeVM.

func (*SnapshotLoadParams) SetSnapshotPath

func (s *SnapshotLoadParams) SetSnapshotPath(val string)

SetSnapshotPath sets the value of SnapshotPath.

func (*SnapshotLoadParams) UnmarshalJSON

func (s *SnapshotLoadParams) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type TokenBucket

type TokenBucket struct {
	// The initial size of a token bucket.
	OneTimeBurst OptInt64 `json:"one_time_burst"`
	// The amount of milliseconds it takes for the bucket to refill.
	RefillTime int64 `json:"refill_time"`
	// The total number of tokens this bucket can hold.
	Size int64 `json:"size"`
}

Defines a token bucket with a maximum capacity (size), an initial burst size (one_time_burst) and an interval for refilling purposes (refill_time). The refill-rate is derived from size and refill_time, and it is the constant rate at which the tokens replenish. The refill process only starts happening after the initial burst budget is consumed. Consumption from the token bucket is unbounded in speed which allows for bursts bound in size by the amount of tokens available. Once the token bucket is empty, consumption speed is bound by the refill_rate. Ref: #/components/schemas/TokenBucket

func (*TokenBucket) Decode

func (s *TokenBucket) Decode(d *jx.Decoder) error

Decode decodes TokenBucket from json.

func (*TokenBucket) Encode

func (s *TokenBucket) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*TokenBucket) GetOneTimeBurst

func (s *TokenBucket) GetOneTimeBurst() OptInt64

GetOneTimeBurst returns the value of OneTimeBurst.

func (*TokenBucket) GetRefillTime

func (s *TokenBucket) GetRefillTime() int64

GetRefillTime returns the value of RefillTime.

func (*TokenBucket) GetSize

func (s *TokenBucket) GetSize() int64

GetSize returns the value of Size.

func (*TokenBucket) MarshalJSON

func (s *TokenBucket) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*TokenBucket) SetFake

func (s *TokenBucket) SetFake()

SetFake set fake values.

func (*TokenBucket) SetOneTimeBurst

func (s *TokenBucket) SetOneTimeBurst(val OptInt64)

SetOneTimeBurst sets the value of OneTimeBurst.

func (*TokenBucket) SetRefillTime

func (s *TokenBucket) SetRefillTime(val int64)

SetRefillTime sets the value of RefillTime.

func (*TokenBucket) SetSize

func (s *TokenBucket) SetSize(val int64)

SetSize sets the value of Size.

func (*TokenBucket) UnmarshalJSON

func (s *TokenBucket) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*TokenBucket) Validate

func (s *TokenBucket) Validate() error

type UnimplementedHandler

type UnimplementedHandler struct{}

UnimplementedHandler is no-op Handler which returns http.ErrNotImplemented.

func (UnimplementedHandler) CreateSnapshot

CreateSnapshot implements createSnapshot operation.

Creates a snapshot of the microVM state. The microVM should be in the `Paused` state.

PUT /snapshot/create

func (UnimplementedHandler) CreateSyncAction

CreateSyncAction implements createSyncAction operation.

Creates a synchronous action.

PUT /actions

func (UnimplementedHandler) DescribeBalloonConfig

func (UnimplementedHandler) DescribeBalloonConfig(ctx context.Context) (r DescribeBalloonConfigRes, _ error)

DescribeBalloonConfig implements describeBalloonConfig operation.

Returns the current balloon device configuration.

GET /balloon

func (UnimplementedHandler) DescribeBalloonStats

func (UnimplementedHandler) DescribeBalloonStats(ctx context.Context) (r DescribeBalloonStatsRes, _ error)

DescribeBalloonStats implements describeBalloonStats operation.

Returns the latest balloon device statistics, only if enabled pre-boot.

GET /balloon/statistics

func (UnimplementedHandler) DescribeInstance

func (UnimplementedHandler) DescribeInstance(ctx context.Context) (r *InstanceInfo, _ error)

DescribeInstance implements describeInstance operation.

Returns general information about an instance.

GET /

func (UnimplementedHandler) GetExportVmConfig

func (UnimplementedHandler) GetExportVmConfig(ctx context.Context) (r *FullVmConfiguration, _ error)

GetExportVmConfig implements getExportVmConfig operation.

Gets configuration for all VM resources.

GET /vm/config

func (UnimplementedHandler) GetMachineConfiguration

func (UnimplementedHandler) GetMachineConfiguration(ctx context.Context) (r *MachineConfiguration, _ error)

GetMachineConfiguration implements getMachineConfiguration operation.

Gets the machine configuration of the VM. When called before the PUT operation, it will return the default values for the vCPU count (=1), memory size (=128 MiB). By default Hyperthreading is disabled and there is no CPU Template.

GET /machine-config

func (UnimplementedHandler) LoadSnapshot

LoadSnapshot implements loadSnapshot operation.

Loads the microVM state from a snapshot. Only accepted on a fresh Firecracker process (before configuring any resource other than the Logger and Metrics).

PUT /snapshot/load

func (UnimplementedHandler) MmdsConfigPut

func (UnimplementedHandler) MmdsConfigPut(ctx context.Context, req *MmdsConfig) (r MmdsConfigPutRes, _ error)

MmdsConfigPut implements PUT /mmds/config operation.

Creates MMDS configuration to be used by the MMDS network stack.

PUT /mmds/config

func (UnimplementedHandler) MmdsGet

func (UnimplementedHandler) MmdsGet(ctx context.Context) (r MmdsGetRes, _ error)

MmdsGet implements GET /mmds operation.

Get the MMDS data store.

GET /mmds

func (UnimplementedHandler) MmdsPatch

func (UnimplementedHandler) MmdsPatch(ctx context.Context, req *MmdsPatchReq) (r MmdsPatchRes, _ error)

MmdsPatch implements PATCH /mmds operation.

Updates the MMDS data store.

PATCH /mmds

func (UnimplementedHandler) MmdsPut

func (UnimplementedHandler) MmdsPut(ctx context.Context, req *MmdsPutReq) (r MmdsPutRes, _ error)

MmdsPut implements PUT /mmds operation.

Creates a MMDS (Microvm Metadata Service) data store.

PUT /mmds

func (UnimplementedHandler) NewError

func (UnimplementedHandler) NewError(ctx context.Context, err error) (r *ErrorStatusCode)

NewError creates *ErrorStatusCode from error returned by handler.

Used for common default response.

func (UnimplementedHandler) PatchBalloon

func (UnimplementedHandler) PatchBalloon(ctx context.Context, req *BalloonUpdate) (r PatchBalloonRes, _ error)

PatchBalloon implements patchBalloon operation.

Updates an existing balloon device, before or after machine startup. Will fail if update is not possible.

PATCH /balloon

func (UnimplementedHandler) PatchBalloonStatsInterval

func (UnimplementedHandler) PatchBalloonStatsInterval(ctx context.Context, req *BalloonStatsUpdate) (r PatchBalloonStatsIntervalRes, _ error)

PatchBalloonStatsInterval implements patchBalloonStatsInterval operation.

Updates an existing balloon device statistics interval, before or after machine startup. Will fail if update is not possible.

PATCH /balloon/statistics

func (UnimplementedHandler) PatchGuestDriveByID

PatchGuestDriveByID implements patchGuestDriveByID operation.

Updates the properties of the drive with the ID specified by drive_id path parameter. Will fail if update is not possible.

PATCH /drives/{drive_id}

func (UnimplementedHandler) PatchGuestNetworkInterfaceByID

PatchGuestNetworkInterfaceByID implements patchGuestNetworkInterfaceByID operation.

Updates the rate limiters applied to a network interface.

PATCH /network-interfaces/{iface_id}

func (UnimplementedHandler) PatchMachineConfiguration

PatchMachineConfiguration implements patchMachineConfiguration operation.

Partially updates the Virtual Machine Configuration with the specified input. If any of the parameters has an incorrect value, the whole update fails.

PATCH /machine-config

func (UnimplementedHandler) PatchVm

func (UnimplementedHandler) PatchVm(ctx context.Context, req *VM) (r PatchVmRes, _ error)

PatchVm implements patchVm operation.

Sets the desired state (Paused or Resumed) for the microVM.

PATCH /vm

func (UnimplementedHandler) PutBalloon

func (UnimplementedHandler) PutBalloon(ctx context.Context, req *Balloon) (r PutBalloonRes, _ error)

PutBalloon implements putBalloon operation.

Creates a new balloon device if one does not already exist, otherwise updates it, before machine startup. This will fail after machine startup. Will fail if update is not possible.

PUT /balloon

func (UnimplementedHandler) PutGuestBootSource

func (UnimplementedHandler) PutGuestBootSource(ctx context.Context, req *BootSource) (r PutGuestBootSourceRes, _ error)

PutGuestBootSource implements putGuestBootSource operation.

Creates new boot source if one does not already exist, otherwise updates it. Will fail if update is not possible.

PUT /boot-source

func (UnimplementedHandler) PutGuestDriveByID

func (UnimplementedHandler) PutGuestDriveByID(ctx context.Context, req *Drive, params PutGuestDriveByIDParams) (r PutGuestDriveByIDRes, _ error)

PutGuestDriveByID implements putGuestDriveByID operation.

Creates new drive with ID specified by drive_id path parameter. If a drive with the specified ID already exists, updates its state based on new input. Will fail if update is not possible.

PUT /drives/{drive_id}

func (UnimplementedHandler) PutGuestNetworkInterfaceByID

PutGuestNetworkInterfaceByID implements putGuestNetworkInterfaceByID operation.

Creates new network interface with ID specified by iface_id path parameter.

PUT /network-interfaces/{iface_id}

func (UnimplementedHandler) PutGuestVsock

func (UnimplementedHandler) PutGuestVsock(ctx context.Context, req *Vsock) (r PutGuestVsockRes, _ error)

PutGuestVsock implements putGuestVsock operation.

The first call creates the device with the configuration specified in body. Subsequent calls will update the device configuration. May fail if update is not possible.

PUT /vsock

func (UnimplementedHandler) PutLogger

func (UnimplementedHandler) PutLogger(ctx context.Context, req *Logger) (r PutLoggerRes, _ error)

PutLogger implements putLogger operation.

Initializes the logger by specifying a named pipe or a file for the logs output.

PUT /logger

func (UnimplementedHandler) PutMachineConfiguration

PutMachineConfiguration implements putMachineConfiguration operation.

Updates the Virtual Machine Configuration with the specified input. Firecracker starts with default values for vCPU count (=1) and memory size (=128 MiB). With Hyperthreading enabled, the vCPU count is restricted to be 1 or an even number, otherwise there are no restrictions regarding the vCPU count. If any of the parameters has an incorrect value, the whole update fails.

PUT /machine-config

func (UnimplementedHandler) PutMetrics

func (UnimplementedHandler) PutMetrics(ctx context.Context, req *Metrics) (r PutMetricsRes, _ error)

PutMetrics implements putMetrics operation.

Initializes the metrics system by specifying a named pipe or a file for the metrics output.

PUT /metrics

type VM

type VM struct {
	State VMState `json:"state"`
}

Defines the microVM running state. It is especially useful in the snapshotting context. Ref: #/components/schemas/Vm

func (*VM) Decode

func (s *VM) Decode(d *jx.Decoder) error

Decode decodes VM from json.

func (*VM) Encode

func (s *VM) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*VM) GetState

func (s *VM) GetState() VMState

GetState returns the value of State.

func (*VM) MarshalJSON

func (s *VM) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*VM) SetFake

func (s *VM) SetFake()

SetFake set fake values.

func (*VM) SetState

func (s *VM) SetState(val VMState)

SetState sets the value of State.

func (*VM) UnmarshalJSON

func (s *VM) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*VM) Validate

func (s *VM) Validate() error

type VMState

type VMState string
const (
	VMStatePaused  VMState = "Paused"
	VMStateResumed VMState = "Resumed"
)

func (VMState) AllValues

func (VMState) AllValues() []VMState

AllValues returns all VMState values.

func (*VMState) Decode

func (s *VMState) Decode(d *jx.Decoder) error

Decode decodes VMState from json.

func (VMState) Encode

func (s VMState) Encode(e *jx.Encoder)

Encode encodes VMState as json.

func (VMState) MarshalJSON

func (s VMState) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (VMState) MarshalText

func (s VMState) MarshalText() ([]byte, error)

MarshalText implements encoding.TextMarshaler.

func (*VMState) SetFake

func (s *VMState) SetFake()

SetFake set fake values.

func (*VMState) UnmarshalJSON

func (s *VMState) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*VMState) UnmarshalText

func (s *VMState) UnmarshalText(data []byte) error

UnmarshalText implements encoding.TextUnmarshaler.

func (VMState) Validate

func (s VMState) Validate() error

type Vsock

type Vsock struct {
	// Guest Vsock CID.
	GuestCid int `json:"guest_cid"`
	// Path to UNIX domain socket, used to proxy vsock connections.
	UdsPath string `json:"uds_path"`
	VsockID string `json:"vsock_id"`
}

Defines a vsock device, backed by a set of Unix Domain Sockets, on the host side. For host-initiated connections, Firecracker will be listening on the Unix socket identified by the path `uds_path`. Firecracker will create this socket, bind and listen on it. Host-initiated connections will be performed by connection to this socket and issuing a connection forwarding request to the desired guest-side vsock port (i.e. `CONNECT 52\n`, to connect to port 52). For guest-initiated connections, Firecracker will expect host software to be bound and listening on Unix sockets at `uds_path_<PORT>`. E.g. "/path/to/host_vsock.sock_52" for port number 52. Ref: #/components/schemas/Vsock

func (*Vsock) Decode

func (s *Vsock) Decode(d *jx.Decoder) error

Decode decodes Vsock from json.

func (*Vsock) Encode

func (s *Vsock) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*Vsock) GetGuestCid

func (s *Vsock) GetGuestCid() int

GetGuestCid returns the value of GuestCid.

func (*Vsock) GetUdsPath

func (s *Vsock) GetUdsPath() string

GetUdsPath returns the value of UdsPath.

func (*Vsock) GetVsockID

func (s *Vsock) GetVsockID() string

GetVsockID returns the value of VsockID.

func (*Vsock) MarshalJSON

func (s *Vsock) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*Vsock) SetFake

func (s *Vsock) SetFake()

SetFake set fake values.

func (*Vsock) SetGuestCid

func (s *Vsock) SetGuestCid(val int)

SetGuestCid sets the value of GuestCid.

func (*Vsock) SetUdsPath

func (s *Vsock) SetUdsPath(val string)

SetUdsPath sets the value of UdsPath.

func (*Vsock) SetVsockID

func (s *Vsock) SetVsockID(val string)

SetVsockID sets the value of VsockID.

func (*Vsock) UnmarshalJSON

func (s *Vsock) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*Vsock) Validate

func (s *Vsock) Validate() error

Jump to

Keyboard shortcuts

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