action

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

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

Go to latest
Published: Sep 1, 2020 License: Apache-2.0, Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NetworkTypeManual string = "manual"
)

Variables

This section is empty.

Functions

func IsPrivateSubnet

func IsPrivateSubnet(ipAddress net.IP) bool

func NewConcreteFactory

func NewConcreteFactory(
	softlayerClient client.Client,
	uuidGen boshuuid.Generator,
	cfg config.Config,
	logger logger.Logger,
) concreteFactory

Types

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 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,
	vmService instance.Service,
) CreateDisk

func (CreateDisk) Run

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

type CreateStemcellAction

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

func NewCreateStemcell

func NewCreateStemcell(
	stemcellFinder stemcell.Service,
) (action CreateStemcellAction)

func (CreateStemcellAction) Run

func (a CreateStemcellAction) Run(imagePath string, cloudProps StemcellCloudProperties) (string, error)

type CreateVM

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

func NewCreateVM

func NewCreateVM(
	stemcellService stemcell.Service,
	virtualGuestService instance.Service,
	registryClient registry.Client,
	registryOptions registry.ClientOptions,
	agentOptions registry.AgentOptions,
	softlayerOptions boslconfig.Config,
	localDNSConfigurationFile string,
) (action CreateVM)

func (CreateVM) Run

func (cv CreateVM) Run(agentID string, stemcellCID StemcellCID, cloudProps VMCloudProperties, networks Networks, diskIDs []DiskCID, env Environment) (string, 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 DeleteStemcellAction

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

func NewDeleteStemcell

func NewDeleteStemcell(
	stemcellService stemcell_service.Service,
) (action DeleteStemcellAction)

func (DeleteStemcellAction) Run

func (a DeleteStemcellAction) Run(stemcellCID StemcellCID) (interface{}, error)

type DeleteVMAction

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

func NewDeleteVM

func NewDeleteVM(
	vmDeleterProvider vgs.Service,
	registryClient registry.Client,
	softlayerOptions boslconfig.Config,
) (action DeleteVMAction)

func (DeleteVMAction) Run

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

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 int

func (DiskCID) Int

func (diskCID DiskCID) Int() int

func (DiskCID) MarshalJSON

func (diskCID DiskCID) MarshalJSON() ([]byte, error)

func (DiskCID) String

func (diskCID DiskCID) String() string

func (*DiskCID) UnmarshalJSON

func (diskCID *DiskCID) UnmarshalJSON(data []byte) error

type DiskCloudProperties

type DiskCloudProperties struct {
	DiskType      string `json:"type,omitempty"`
	DataCenter    string `json:"datacenter,omitempty"`
	Iops          int    `json:"iops,omitempty"`
	SnapshotSpace int    `json:"snapshot_space,omitempty"`
}

type DiskMetadata

type DiskMetadata map[string]interface{}

type Environment

type Environment map[string]interface{}

type Factory

type Factory interface {
	Create(method string) (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"`
	MAC             string                 `json:"mac,omitempty"`
	Alias           string                 `json:"alias,omitempty"`
	Routes          registry.Routes        `json:"routes,omitempty"`
	CloudProperties NetworkCloudProperties `json:"cloud_properties,omitempty"`
}

type NetworkCloudProperties

type NetworkCloudProperties struct {
	SubnetIds           []int `json:"subnet_ids,omitempty"`
	VlanIds             []int `json:"vlan_ids,omitempty"`
	SourcePolicyRouting bool  `json:"source_policy_routing,omitempty"`
}

type Networks

type Networks map[string]Network

func (Networks) AsInstanceServiceNetworks

func (ns Networks) AsInstanceServiceNetworks(publicNetworkVlan *datatypes.Network_Vlan) instance.Networks

func (Networks) HasManualNetwork

func (ns Networks) HasManualNetwork() bool

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 SetDiskMetadata

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

func NewSetDiskMetadata

func NewSetDiskMetadata(
	diskService disk.Service,
) SetDiskMetadata

func (SetDiskMetadata) Run

func (sdm SetDiskMetadata) Run(DiskCID DiskCID, diskMetadata DiskMetadata) (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 int

func (SnapshotCID) Int

func (snapshotCID SnapshotCID) Int() int

func (SnapshotCID) MarshalJSON

func (snapshotCID SnapshotCID) MarshalJSON() ([]byte, error)

func (SnapshotCID) String

func (snapshotCID SnapshotCID) String() string

func (*SnapshotCID) UnmarshalJSON

func (snapshotCID *SnapshotCID) UnmarshalJSON(data []byte) error

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) (string, 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 int

func (StemcellCID) Int

func (stemcellCID StemcellCID) Int() int

func (StemcellCID) MarshalJSON

func (stemcellCID StemcellCID) MarshalJSON() ([]byte, error)

func (StemcellCID) String

func (stemcellCID StemcellCID) String() string

func (*StemcellCID) UnmarshalJSON

func (stemcellCID *StemcellCID) UnmarshalJSON(data []byte) error

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"`

	Id   int    `json:"virtual-disk-image-id"`
	Uuid string `json:"virtual-disk-image-uuid"`

	DatacenterName string `json:"datacenter-name"`
	OsCode         string `json:"os-code"`
}

type VMCID

type VMCID int

func (VMCID) Int

func (vmCID VMCID) Int() int

func (VMCID) MarshalJSON

func (vmCID VMCID) MarshalJSON() ([]byte, error)

func (VMCID) String

func (vmCID VMCID) String() string

func (*VMCID) UnmarshalJSON

func (vmCID *VMCID) UnmarshalJSON(data []byte) error

type VMCloudProperties

type VMCloudProperties struct {
	HostnamePrefix    string `json:"hostname_prefix,omitempty"`
	Hostname          string `json:"hostname,omitempty"`
	Domain            string `json:"domain,omitempty"`
	FlavorKeyName     string `json:"flavor_key_name,omitempty"`
	Cpu               int    `json:"cpu,omitempty"`
	Memory            int    `json:"memory,omitempty"`
	Datacenter        string `json:"datacenter"`
	EphemeralDiskSize int    `json:"ephemeral_disk_size,omitempty"`
	SshKey            int    `json:"ssh_key,omitempty"`

	HourlyBillingFlag            bool `json:"hourly_billing_flag,omitempty"`
	LocalDiskFlag                bool `json:"local_disk_flag,omitempty"`
	DedicatedAccountHostOnlyFlag bool `json:"dedicated_account_host_only_flag,omitempty"`
	DedicatedHostId              int  `json:"dedicated_host_id,omitempty"`

	DeployedByBoshCLI bool `json:"deployed_by_boshcli,omitempty"`

	MaxNetworkSpeed int `json:"max_network_speed,omitempty"`
}

func (*VMCloudProperties) AsInstanceProperties

func (vmProps *VMCloudProperties) AsInstanceProperties() *VMCloudProperties

func (*VMCloudProperties) Validate

func (vmProps *VMCloudProperties) Validate() error

type VMMetadata

type VMMetadata map[string]interface{}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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