action

package
v29.0.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2019 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NoCPUErr = "CPU must be greater than 0"
)

Variables

Functions

This section is empty.

Types

type Accelerator

type Accelerator struct {
	AcceleratorType string `json:"type,omitempty"`
	Count           int64  `json:"count,omitempty"`
}

type Action

type Action interface {
}

type AttachDisk

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

func NewAttachDisk

func NewAttachDisk(
	diskService disk.Service,
	vmService instance.Service,
	registryClient registry.Client,
) AttachDisk

func (AttachDisk) Run

func (ad AttachDisk) Run(vmCID VMCID, diskCID DiskCID) (interface{}, error)

type CalculateVMCloudProperties

type CalculateVMCloudProperties struct{}

func NewCalculateVMCloudProperties

func NewCalculateVMCloudProperties() CalculateVMCloudProperties

func (CalculateVMCloudProperties) Run

type ConcreteFactory

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

func NewConcreteFactory

func NewConcreteFactory(
	uuidGen boshuuid.Generator,
	cfg config.Config,
	logger boshlog.Logger,
) ConcreteFactory

func (ConcreteFactory) Create

func (f ConcreteFactory) Create(method string, ctx map[string]interface{}) (Action, error)

type ConcreteFactoryOptions

type ConcreteFactoryOptions struct {
	Agent    registry.AgentOptions
	Registry registry.ClientOptions
}

func (ConcreteFactoryOptions) Validate

func (o ConcreteFactoryOptions) Validate() error

type ConfigureNetworks

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

func NewConfigureNetworks

func NewConfigureNetworks(
	vmService instance.Service,
	registryClient registry.Client,
) ConfigureNetworks

func (ConfigureNetworks) Run

func (rv ConfigureNetworks) Run(vmCID VMCID, networks Networks) (interface{}, error)

type CreateDisk

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

func NewCreateDisk

func NewCreateDisk(
	diskService disk.Service,
	diskTypeService disktype.Service,
	vmService instance.Service,
) CreateDisk

func (CreateDisk) Run

func (cd CreateDisk) Run(size int, cloudProps DiskCloudProperties, vmCID VMCID) (DiskCID, error)

type CreateStemcell

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

func NewCreateStemcell

func NewCreateStemcell(
	imageService image.Service,
) CreateStemcell

func (CreateStemcell) Run

func (cs CreateStemcell) Run(stemcellPath string, cloudProps StemcellCloudProperties) (StemcellCID, error)

type CreateVM

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

func NewCreateVM

func NewCreateVM(
	vmService instance.Service,
	diskService disk.Service,
	diskTypeService disktype.Service,
	imageService image.Service,
	machineTypeService machinetype.Service,
	acceleratorTypeService acceleratortype.Service,
	registryClient registry.Client,
	registryOptions registry.ClientOptions,
	agentOptions registry.AgentOptions,
	defaultRootDiskSizeGb int,
	defaultRootDiskType string,
) CreateVM

func (CreateVM) Run

func (cv CreateVM) Run(agentID string, stemcellCID StemcellCID, cloudProps VMCloudProperties, networks Networks, disks []DiskCID, env Environment) (VMCID, error)

type DeleteDisk

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

func NewDeleteDisk

func NewDeleteDisk(
	diskService disk.Service,
) DeleteDisk

func (DeleteDisk) Run

func (dd DeleteDisk) Run(diskCID DiskCID) (interface{}, error)

type DeleteSnapshot

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

func NewDeleteSnapshot

func NewDeleteSnapshot(
	snapshotService snapshot.Service,
) DeleteSnapshot

func (DeleteSnapshot) Run

func (ds DeleteSnapshot) Run(snapshotCID SnapshotCID) (interface{}, error)

type DeleteStemcell

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

func NewDeleteStemcell

func NewDeleteStemcell(
	imageService image.Service,
) DeleteStemcell

func (DeleteStemcell) Run

func (ds DeleteStemcell) Run(stemcellCID StemcellCID) (interface{}, error)

type DeleteVM

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

func NewDeleteVM

func NewDeleteVM(
	vmService instance.Service,
	registryClient registry.Client,
) DeleteVM

func (DeleteVM) Run

func (dv DeleteVM) Run(vmCID VMCID) (interface{}, error)

type DesiredVMSpec

type DesiredVMSpec struct {
	CPU               int `json:"cpu"`
	RAM               int `json:"ram"`
	EphemeralDiskSize int `json:"ephemeral_disk_size"`
}

type DetachDisk

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

func NewDetachDisk

func NewDetachDisk(
	vmService instance.Service,
	registryClient registry.Client,
) DetachDisk

func (DetachDisk) Run

func (dd DetachDisk) Run(vmCID VMCID, diskCID DiskCID) (interface{}, error)

type DiskCID

type DiskCID string

type DiskCloudProperties

type DiskCloudProperties struct {
	DiskType string `json:"type,omitempty"`
	Zone     string `json:"zone,omitempty"`
}

type Environment

type Environment map[string]interface{}

type Factory

type Factory interface {
	Create(method string, ctx map[string]interface{}) (Action, error)
}

type GetDisks

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

func NewGetDisks

func NewGetDisks(
	vmService instance.Service,
) GetDisks

func (GetDisks) Run

func (gd GetDisks) Run(vmCID VMCID) (disks []string, err error)

type HasDisk

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

func NewHasDisk

func NewHasDisk(
	diskService disk.Service,
) HasDisk

func (HasDisk) Run

func (hd HasDisk) Run(diskCID DiskCID) (bool, error)

type HasVM

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

func NewHasVM

func NewHasVM(
	vmService instance.Service,
) HasVM

func (HasVM) Run

func (hv HasVM) Run(vmCID VMCID) (bool, error)

type Info

type Info struct{}

func NewInfo

func NewInfo() Info

func (Info) Run

func (Info) Run() (InfoResult, error)

type InfoResult

type InfoResult struct {
	StemcellFormats []string `json:"stemcell_formats"`
}

type Network

type Network struct {
	Type            string                 `json:"type,omitempty"`
	IP              string                 `json:"ip,omitempty"`
	Gateway         string                 `json:"gateway,omitempty"`
	Netmask         string                 `json:"netmask,omitempty"`
	DNS             []string               `json:"dns,omitempty"`
	DHCP            bool                   `json:"use_dhcp,omitempty"`
	Default         []string               `json:"default,omitempty"`
	CloudProperties NetworkCloudProperties `json:"cloud_properties,omitempty"`
}

type NetworkCloudProperties

type NetworkCloudProperties struct {
	NetworkName         string        `json:"network_name,omitempty"`
	NetworkProjectID    string        `json:"xpn_host_project_id,omitempty"`
	SubnetworkName      string        `json:"subnetwork_name,omitempty"`
	Tags                instance.Tags `json:"tags,omitempty"`
	EphemeralExternalIP bool          `json:"ephemeral_external_ip,omitempty"`
	IPForwarding        bool          `json:"ip_forwarding,omitempty"`
}

type Networks

type Networks map[string]*Network

func (Networks) AsInstanceServiceNetworks

func (ns Networks) AsInstanceServiceNetworks() instance.Networks

func (Networks) AsRegistryNetworks

func (ns Networks) AsRegistryNetworks() registry.NetworksSettings

type Ping

type Ping struct{}

func NewPing

func NewPing() Ping

func (Ping) Run

func (p Ping) Run() (string, error)

type RebootVM

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

func NewRebootVM

func NewRebootVM(
	vmService instance.Service,
) RebootVM

func (RebootVM) Run

func (rv RebootVM) Run(vmCID VMCID) (interface{}, error)

type SetVMMetadata

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

func NewSetVMMetadata

func NewSetVMMetadata(
	vmService instance.Service,
) SetVMMetadata

func (SetVMMetadata) Run

func (svm SetVMMetadata) Run(vmCID VMCID, vmMetadata VMMetadata) (interface{}, error)

type SnapshotCID

type SnapshotCID string

type SnapshotDisk

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

func NewSnapshotDisk

func NewSnapshotDisk(
	snapshotService snapshot.Service,
	diskService disk.Service,
) SnapshotDisk

func (SnapshotDisk) Run

func (sd SnapshotDisk) Run(diskCID DiskCID, metadata SnapshotMetadata) (SnapshotCID, error)

type SnapshotMetadata

type SnapshotMetadata struct {
	Deployment string      `json:"deployment,omitempty"`
	Job        string      `json:"job,omitempty"`
	Index      json.Number `json:"index,omitempty"`
}

type StemcellCID

type StemcellCID string

type StemcellCloudProperties

type StemcellCloudProperties struct {
	Name           string `json:"name,omitempty"`
	Version        string `json:"version,omitempty"`
	Infrastructure string `json:"infrastructure,omitempty"`
	SourceURL      string `json:"source_url,omitempty"`

	// URL of an existing image (Image.SelfLink)
	ImageURL   string `json:"image_url,omitempty"`
	SourceSha1 string `json:"raw_disk_sha1,omitempty"`
}

type VMCID

type VMCID string

type VMCloudProperties

type VMCloudProperties struct {
	Zone                string           `json:"zone,omitempty"`
	Name                string           `json:"name,omitempty"`
	MachineType         string           `json:"machine_type,omitempty"`
	CPU                 int              `json:"cpu,omitempty"`
	RAM                 int              `json:"ram,omitempty"`
	RootDiskSizeGb      int              `json:"root_disk_size_gb,omitempty"`
	RootDiskType        string           `json:"root_disk_type,omitempty"`
	AutomaticRestart    bool             `json:"automatic_restart,omitempty"`
	OnHostMaintenance   string           `json:"on_host_maintenance,omitempty"`
	Preemptible         bool             `json:"preemptible,omitempty"`
	ServiceAccount      VMServiceAccount `json:"service_account,omitempty"`
	ServiceScopes       VMServiceScopes  `json:"service_scopes,omitempty"`
	TargetPool          string           `json:"target_pool,omitempty"`
	BackendService      interface{}      `json:"backend_service,omitempty"`
	Tags                instance.Tags    `json:"tags,omitempty"`
	Labels              instance.Labels  `json:"labels,omitempty"`
	EphemeralExternalIP *bool            `json:"ephemeral_external_ip,omitempty"`
	IPForwarding        *bool            `json:"ip_forwarding,omitempty"`
	Accelerators        []Accelerator    `json:"accelerators,omitempty"`
}

func (VMCloudProperties) Validate

func (n VMCloudProperties) Validate() error

type VMMetadata

type VMMetadata map[string]string

type VMServiceAccount

type VMServiceAccount string

type VMServiceScopes

type VMServiceScopes []string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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