Documentation ¶
Index ¶
- Constants
- type BlockstorageService
- type ComputeService
- type NetworkService
- type Provider
- func (p *Provider) AddInstancesNetworkDetails(ctx *lepton.Context, instances *[]lepton.CloudInstance) (err error)
- func (p *Provider) AttachVolume(ctx *lepton.Context, image, name string, attachID int) (err error)
- func (p *Provider) BuildImage(ctx *lepton.Context) (string, error)
- func (p *Provider) BuildImageWithPackage(ctx *lepton.Context, pkgpath string) (string, error)
- func (p *Provider) CreateImage(ctx *lepton.Context, imagePath string) (err error)
- func (p *Provider) CreateInstance(ctx *lepton.Context) error
- func (p *Provider) CreateNetworkSecurityGroup(ctx *lepton.Context, vcnID string) (sg *core.NetworkSecurityGroup, err error)
- func (p *Provider) CreateVolume(ctx *lepton.Context, cv types.CloudVolume, data string, provider string) (lepton.NanosVolume, error)
- func (p *Provider) CustomizeImage(ctx *lepton.Context) (string, error)
- func (p *Provider) DeleteImage(ctx *lepton.Context, imagename string) (err error)
- func (p *Provider) DeleteInstance(ctx *lepton.Context, instancename string) error
- func (p *Provider) DeleteVolume(ctx *lepton.Context, name string) (err error)
- func (p *Provider) DetachVolume(ctx *lepton.Context, image, name string) (err error)
- func (p *Provider) GetAllVolumes(ctx *lepton.Context) (vols *[]lepton.NanosVolume, err error)
- func (p *Provider) GetImages(ctx *lepton.Context, filter string) (images []lepton.CloudImage, err error)
- func (p *Provider) GetInstanceByName(ctx *lepton.Context, name string) (instance *lepton.CloudInstance, err error)
- func (p *Provider) GetInstanceLogs(ctx *lepton.Context, instancename string) (string, error)
- func (p *Provider) GetInstances(ctx *lepton.Context) (instances []lepton.CloudInstance, err error)
- func (p *Provider) GetSubnet(ctx *lepton.Context) (subnet *core.Subnet, err error)
- func (p *Provider) Initialize(providerConfig *types.ProviderConfig) (err error)
- func (p *Provider) InstanceStats(ctx *lepton.Context, instancename string, watch bool) error
- func (p *Provider) ListImages(ctx *lepton.Context, filter string) error
- func (p *Provider) ListInstances(ctx *lepton.Context) (err error)
- func (p *Provider) PrintInstanceLogs(ctx *lepton.Context, instancename string, watch bool) error
- func (p *Provider) RebootInstance(ctx *lepton.Context, instanceName string) error
- func (p *Provider) ResizeImage(ctx *lepton.Context, imagename string, hbytes string) error
- func (p *Provider) StartInstance(ctx *lepton.Context, instancename string) error
- func (p *Provider) StopInstance(ctx *lepton.Context, instancename string) error
- func (p *Provider) SyncImage(config *types.Config, target lepton.Provider, imagename string) error
- type StorageService
- type WorkRequestService
Constants ¶
const ProviderName = "oci"
ProviderName of the cloud platform provider
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BlockstorageService ¶
type BlockstorageService interface { CreateVolume(ctx context.Context, request core.CreateVolumeRequest) (response core.CreateVolumeResponse, err error) ListVolumes(ctx context.Context, request core.ListVolumesRequest) (response core.ListVolumesResponse, err error) DeleteVolume(ctx context.Context, request core.DeleteVolumeRequest) (response core.DeleteVolumeResponse, err error) }
BlockstorageService has OCI client methods to manage volumes
type ComputeService ¶
type ComputeService interface { CreateImage(ctx context.Context, request core.CreateImageRequest) (response core.CreateImageResponse, err error) ListImages(ctx context.Context, request core.ListImagesRequest) (response core.ListImagesResponse, err error) DeleteImage(ctx context.Context, request core.DeleteImageRequest) (response core.DeleteImageResponse, err error) ListInstances(ctx context.Context, request core.ListInstancesRequest) (response core.ListInstancesResponse, err error) LaunchInstance(ctx context.Context, request core.LaunchInstanceRequest) (response core.LaunchInstanceResponse, err error) TerminateInstance(ctx context.Context, request core.TerminateInstanceRequest) (response core.TerminateInstanceResponse, err error) InstanceAction(ctx context.Context, request core.InstanceActionRequest) (response core.InstanceActionResponse, err error) AttachVolume(ctx context.Context, request core.AttachVolumeRequest) (response core.AttachVolumeResponse, err error) DetachVolume(ctx context.Context, request core.DetachVolumeRequest) (response core.DetachVolumeResponse, err error) ListVnicAttachments(ctx context.Context, request core.ListVnicAttachmentsRequest) (response core.ListVnicAttachmentsResponse, err error) }
ComputeService has OCI client methods to manage images and instances listing
type NetworkService ¶
type NetworkService interface { ListVcns(ctx context.Context, request core.ListVcnsRequest) (response core.ListVcnsResponse, err error) ListSubnets(ctx context.Context, request core.ListSubnetsRequest) (response core.ListSubnetsResponse, err error) GetVnic(ctx context.Context, request core.GetVnicRequest) (response core.GetVnicResponse, err error) CreateNetworkSecurityGroup(ctx context.Context, request core.CreateNetworkSecurityGroupRequest) (response core.CreateNetworkSecurityGroupResponse, err error) AddNetworkSecurityGroupSecurityRules(ctx context.Context, request core.AddNetworkSecurityGroupSecurityRulesRequest) (response core.AddNetworkSecurityGroupSecurityRulesResponse, err error) }
NetworkService has OCI client methods to manage network instances
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
Provider to interact with Oracle Cloud Infrastructure
func NewProviderWithClients ¶
func NewProviderWithClients(c ComputeService, s StorageService, w WorkRequestService, n NetworkService, b BlockstorageService, f afero.Fs) *Provider
NewProviderWithClients returns an instance of OCI Provider with required clients initialized
func (*Provider) AddInstancesNetworkDetails ¶
func (p *Provider) AddInstancesNetworkDetails(ctx *lepton.Context, instances *[]lepton.CloudInstance) (err error)
AddInstancesNetworkDetails append public IPs and private IPs to instances passed in argumetn
func (*Provider) AttachVolume ¶
AttachVolume attaches a volume to an oci instance
func (*Provider) BuildImage ¶
BuildImage creates local image
func (*Provider) BuildImageWithPackage ¶
BuildImageWithPackage creates local image using package image
func (*Provider) CreateImage ¶
CreateImage creates a storage object and upload image
func (*Provider) CreateInstance ¶
CreateInstance launch a server in oci using an existing image
func (*Provider) CreateNetworkSecurityGroup ¶
func (p *Provider) CreateNetworkSecurityGroup(ctx *lepton.Context, vcnID string) (sg *core.NetworkSecurityGroup, err error)
CreateNetworkSecurityGroup creates a network security group with firewall rules
func (*Provider) CreateVolume ¶
func (p *Provider) CreateVolume(ctx *lepton.Context, cv types.CloudVolume, data string, provider string) (lepton.NanosVolume, error)
CreateVolume creates a local volume and uploads the volume to oci
func (*Provider) CustomizeImage ¶
CustomizeImage is a stub
func (*Provider) DeleteImage ¶
DeleteImage removes oci image
func (*Provider) DeleteInstance ¶
DeleteInstance removes an instance
func (*Provider) DeleteVolume ¶
DeleteVolume removes an oci volume
func (*Provider) DetachVolume ¶
DetachVolume detaches a volume from an oci instance
func (*Provider) GetAllVolumes ¶
GetAllVolumes returns a list of oci volumes
func (*Provider) GetImages ¶
func (p *Provider) GetImages(ctx *lepton.Context, filter string) (images []lepton.CloudImage, err error)
GetImages returns the list of images
func (*Provider) GetInstanceByName ¶
func (p *Provider) GetInstanceByName(ctx *lepton.Context, name string) (instance *lepton.CloudInstance, err error)
GetInstanceByName returns oci instance with given name
func (*Provider) GetInstanceLogs ¶
GetInstanceLogs returns instance log
func (*Provider) GetInstances ¶
GetInstances returns the list of servers managed by upcloud
func (*Provider) Initialize ¶
func (p *Provider) Initialize(providerConfig *types.ProviderConfig) (err error)
Initialize checks conditions to use oci
func (*Provider) InstanceStats ¶
InstanceStats show metrics for instances on provider.
func (*Provider) ListImages ¶
ListImages prints oci images in table format
func (*Provider) ListInstances ¶
ListInstances prints servers list managed by oci in table
func (*Provider) PrintInstanceLogs ¶
PrintInstanceLogs prints instances logs on console
func (*Provider) RebootInstance ¶
RebootInstance reboots the instance.
func (*Provider) ResizeImage ¶
ResizeImage is a stub
func (*Provider) StartInstance ¶
StartInstance starts an instance
func (*Provider) StopInstance ¶
StopInstance stops an instance
type StorageService ¶
type StorageService interface {
PutObject(ctx context.Context, request objectstorage.PutObjectRequest) (response objectstorage.PutObjectResponse, err error)
}
StorageService has OCI client methods to manage storage block, required to upload images
type WorkRequestService ¶
type WorkRequestService interface {
GetWorkRequest(ctx context.Context, request workrequests.GetWorkRequestRequest) (response workrequests.GetWorkRequestResponse, err error)
}
WorkRequestService has OCI client methods to get work request status