Documentation ¶
Index ¶
- 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 Info
- type Network
- type NetworkCloudProperties
- type Networks
- type SetVMMetadata
- type StemcellCID
- type StemcellCloudProperties
- type StemcellInfo
- type VMCID
- type VMCloudProperties
- type VMMetadata
Constants ¶
This section is empty.
Variables ¶
This section is empty.
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, _ DiskCloudProperties, vmCID VMCID) (DiskCID, error)
Run creates a persistent block volume 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) (StemcellCID, error)
Run extracts the image URL from the properties and delegates to StemcellCreator for creating an image
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, _ []DiskCID, env Environment) (VMCID, error)
Run creates an instance for the given configuration in OCI.
If the instance is configured to be created in a manual network it assigns the given private IP to that instance.
For dynamic network where the instance is not assigned an IP, it queries the IPs assigned to the new instance. In addition, if a SSHTunnel is configured it creates a forward tunnel to the public IP of that instance.
Finally, it updates the agent registry with details of the new instance
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 volume.
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 { }
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 Info ¶
type Info struct{}
Info action handles the info() request
func (Info) Run ¶
func (i Info) Run() (StemcellInfo, error)
Run returns information about the stemcell(s) supported by this CPI.
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() registry.NetworkSetting
AsRegistryNetwork converts a single network to network setting structure expected by the agent registry
type NetworkCloudProperties ¶
type NetworkCloudProperties struct { VcnName string `json:"vcn,omitempty"` SubnetName string `json:"subnet_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() 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"` // Deprecated: Light stemcells with image-ocid attribute are deprecated and // will be removed prior to GA. Use stemcells with image-source-url attribute // instead. ImageOCID string `json:"image-ocid,omitempty"` ImageSourceURL string `json:"image-source-url,omitempty"` }
StemcellCloudProperties holds the CPI specific stemcell properties defined in stemcell's manifest
type StemcellInfo ¶
type StemcellInfo struct {
Formats []string `json:"stemcell_formats"`
}
StemcellInfo contains info about stemcells supported by this CPI
type VMCloudProperties ¶
type VMCloudProperties struct { Name string `json:"name,omitempty"` Shape string `json:"instance_shape"` AvailabilityDomain string `json:"availability_domain"` }
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
Source Files ¶
- action_interface.go
- attach_disk.go
- cids.go
- cloud_properties.go
- concrete_factory.go
- create_disk.go
- create_stemcell.go
- create_vm.go
- delete_disk.go
- delete_stemcell.go
- delete_vm.go
- detach_disk.go
- factory_interface.go
- get_disks.go
- has_disk.go
- has_vm.go
- info.go
- networks.go
- oci_api_hooks.go
- set_vm_metadata.go