Documentation ¶
Index ¶
- Variables
- type Action
- type AttachDisk
- type ConcreteFactory
- type CreateDisk
- type CreateStemcell
- type CreateVM
- type DeleteDisk
- type DeleteStemcell
- type DeleteVM
- type DetachDisk
- type DiskCID
- type DiskCloudProperties
- type Environment
- type Factory
- type GetDisks
- type HasDisk
- type HasVM
- type Network
- type NetworkCloudProperties
- type Networks
- type Rule
- type SetVMMetadata
- type StemcellCID
- type StemcellCloudProperties
- type VMCID
- type VMCloudProperties
- type VMMetadata
Constants ¶
This section is empty.
Variables ¶
var ( TIMEOUT time.Duration POLLING_INTERVAL time.Duration )
Functions ¶
This section is empty.
Types ¶
type AttachDisk ¶
type AttachDisk struct {
// contains filtered or unexported fields
}
AttachDisk action handles the attach_disk request to attach a persistent disk to a vm instance
func NewAttachDisk ¶
NewAttachDisk creates an AttachDisk instance
type ConcreteFactory ¶
type ConcreteFactory struct {
// contains filtered or unexported fields
}
ConcreteFactory creates Actions to handle CPI requests from BOSH
type CreateDisk ¶
type CreateDisk struct {
// contains filtered or unexported fields
}
CreateDisk action handles the create_disk method invocation
func NewCreateDisk ¶
func NewCreateDisk(c client.Connector, l boshlog.Logger) CreateDisk
NewCreateDisk creates a CreateDisk instance
func (CreateDisk) Run ¶
func (cd CreateDisk) Run(size int, props DiskCloudProperties) (DiskCID, error)
Run creates a block storage of the requested size and returns it's ID
type CreateStemcell ¶
type CreateStemcell struct {
// contains filtered or unexported fields
}
CreateStemcell action handles the create_stemcell method invocation
func NewCreateStemcell ¶
func NewCreateStemcell(c client.Connector, logger boshlog.Logger) CreateStemcell
NewCreateStemcell creates a CreateStemcell instance
func (CreateStemcell) Run ¶
func (cs CreateStemcell) Run(_ string, cloudProps StemcellCloudProperties) (stemcellId string, err error)
type CreateVM ¶
type CreateVM struct {
// contains filtered or unexported fields
}
CreateVM action handles the create_vm request
func NewCreateVM ¶
func NewCreateVM(c client.Connector, l boshlog.Logger, r registry.Client, u boshuuid.Generator) CreateVM
NewCreateVM creates a CreateVM instance
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
}
DeleteDisk action handles the delete_disk request
func NewDeleteDisk ¶
func NewDeleteDisk(c client.Connector, l boshlog.Logger) DeleteDisk
NewDeleteDisk creates a DeleteDisk instance
func (DeleteDisk) Run ¶
func (dd DeleteDisk) Run(diskCID DiskCID) (interface{}, error)
Run deletes a previously created persistent block storage.
type DeleteStemcell ¶
type DeleteStemcell struct {
// contains filtered or unexported fields
}
DeleteStemcell action handles the delete_stemcell method invocation
func NewDeleteStemcell ¶
func NewDeleteStemcell(connector client.Connector, logger boshlog.Logger) DeleteStemcell
NewDeleteStemcell creates a DeleteStemcell instance
func (DeleteStemcell) Run ¶
func (ds DeleteStemcell) Run(stemcellCID StemcellCID) (interface{}, error)
Run delegates the request to a StemCellDestroyer
type DeleteVM ¶
type DeleteVM struct {
// contains filtered or unexported fields
}
DeleteVM action handles the delete_vm request
func NewDeleteVM ¶
NewDeleteVM creates a DeleteVM instance
func (DeleteVM) Run ¶
Run deletes the requested VM. Prior to deleting a vm, it detaches any block volumes attached to that vm. It also deletes the vm information from he agent registry after the VM is deleted. These operations are not atomic, i.e if the registry can't be updated Run will return an error, but deleted VM is not restored.
type DetachDisk ¶
type DetachDisk struct {
// contains filtered or unexported fields
}
DetachDisk action handles the detach_disk request to detach a persistent disk from a vm instance
func NewDetachDisk ¶
NewDetachDisk creates a DetachDisk instance
func (DetachDisk) Run ¶
func (dd DetachDisk) Run(vmCID VMCID, diskCID DiskCID) (interface{}, error)
Run detaches the given disk from the the given vm. It also updates the agent registry after the detachment is completed. An error is thrown in case the disk or vm is not found, there is a failure in detachment, or if the registry can't be updated successfully.
type DiskCloudProperties ¶
type DiskCloudProperties struct {
Datacenter string `json:"datacenter,omitempty"`
}
DiskCloudProperties holds the CPI specific disk properties
type Factory ¶
type Factory interface { // Create an action for the given request method Create(method string) (Action, error) }
Factory interface for creating an Action.
type GetDisks ¶
type GetDisks struct {
// contains filtered or unexported fields
}
GetDisks action handles the get_disks request
func NewGetDisks ¶
NewGetDisks creates a GetDisks instance
type HasDisk ¶
type HasDisk struct {
// contains filtered or unexported fields
}
HasDisk action handles the has_disk request
func NewHasDisk ¶
NewHasDisk creates a HasDisk instance
type HasVM ¶
type HasVM struct {
// contains filtered or unexported fields
}
HasVM action handles the has_vm request
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"` }
Network properties
func (Network) AsRegistryNetwork ¶
func (n Network) AsRegistryNetwork(publicIp string) registry.NetworkSetting
AsRegistryNetwork converts a single network to network setting structure expected by the agent registry
type NetworkCloudProperties ¶
type NetworkCloudProperties struct { PrivateNetWorkId string `json:"private-network-id,omitempty"` OpenPorts []Rule `json:"open-ports,omitempty"` PolicyName string `json:"firewall-policy-name,omitempty"` }
NetworkCloudProperties holds the CPI specific network properties defined in cloud config
type Networks ¶
Networks configured in the environment
func (Networks) AllDynamic ¶
AllDynamic returns true if all the configured networks are dynamic, otherwise false.
func (Networks) AsNetworkConfiguration ¶
AsNetworkConfiguration converts the networks map to vm.Networks suitable for use with the vm.Creator
func (Networks) AsRegistryNetworks ¶
func (ns Networks) AsRegistryNetworks(publicIp string) registry.NetworksSettings
AsRegistryNetworks converts the networks map to network settings structure expected by the agent registry
func (Networks) FirstDynamic ¶
FirstDynamic returns the first "dynamic" network in the networks map. It returns nil if none exist.
func (Networks) FirstStatic ¶
FirstStatic returns the first "manual" network in the networks map. It returns nil if none exist.
type SetVMMetadata ¶
type SetVMMetadata struct {
// contains filtered or unexported fields
}
SetVMMetadata action handles the set_vm_metadata request
func NewSetVMMetadata ¶
func NewSetVMMetadata(c client.Connector, l boshlog.Logger) SetVMMetadata
NewSetVMMetadata creates a SetVMMetadata instance
func (SetVMMetadata) Run ¶
func (sm SetVMMetadata) Run(vmCID VMCID, metadata VMMetadata) (interface{}, error)
Run updates the display name of the VM
type StemcellCloudProperties ¶
type StemcellCloudProperties struct { Name string `json:"name,omitempty"` Version string `json:"version,omitempty"` ImageID string `json:"image-id"` ImageSourceURL string `json:"image-source-url,omitempty"` OSType string `json:"os-type,omitempty"` Architecture string `json:"architecture,omitempty"` }
StemcellCloudProperties holds the CPI specific stemcell properties defined in stemcell's manifest
type VMCloudProperties ¶
type VMCloudProperties struct { Name string `json:"name,omitempty"` Datacenter string `json:"datacenter,omitempty"` InstanceFlavor string `json:"flavor,omitempty"` Cores int `json:"cores,omitempty"` DiskSize int `json:"diskSize,omitempty"` EphemeralDisk int `json:"ephemeralDiskSize,omitempty"` Ram float32 `json:"ram,omitempty"` SSHKey string `json:"rsa_key,omitempty"` PublicIP string `json:"public_ip,omitempty"` SSHPairPath string `json:"keypair,omitempty"` Director bool `json:"director,omitempty"` LBId string `json:"lb-id,omitempty"` }
VMCloudProperties holds the CPI specific properties defined in cloud-config for creating a instance
type VMMetadata ¶
VMMetadata contains the BOSH metadata for a vm instance