oci

package
v0.0.0-...-7d729b0 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2024 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
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 NewProvider

func NewProvider() *Provider

NewProvider OCI

func NewProviderWithClients

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

func (p *Provider) AttachVolume(ctx *lepton.Context, image, name string, attachID int) (err error)

AttachVolume attaches a volume to an oci instance

func (*Provider) BuildImage

func (p *Provider) BuildImage(ctx *lepton.Context) (string, error)

BuildImage creates local image

func (*Provider) BuildImageWithPackage

func (p *Provider) BuildImageWithPackage(ctx *lepton.Context, pkgpath string) (string, error)

BuildImageWithPackage creates local image using package image

func (*Provider) CreateImage

func (p *Provider) CreateImage(ctx *lepton.Context, imagePath string) (err error)

CreateImage creates a storage object and upload image

func (*Provider) CreateInstance

func (p *Provider) CreateInstance(ctx *lepton.Context) error

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

func (p *Provider) CustomizeImage(ctx *lepton.Context) (string, error)

CustomizeImage is a stub

func (*Provider) DeleteImage

func (p *Provider) DeleteImage(ctx *lepton.Context, imagename string) (err error)

DeleteImage removes oci image

func (*Provider) DeleteInstance

func (p *Provider) DeleteInstance(ctx *lepton.Context, instancename string) error

DeleteInstance removes an instance

func (*Provider) DeleteVolume

func (p *Provider) DeleteVolume(ctx *lepton.Context, name string) (err error)

DeleteVolume removes an oci volume

func (*Provider) DetachVolume

func (p *Provider) DetachVolume(ctx *lepton.Context, image, name string) (err error)

DetachVolume detaches a volume from an oci instance

func (*Provider) GetAllVolumes

func (p *Provider) GetAllVolumes(ctx *lepton.Context) (vols *[]lepton.NanosVolume, err error)

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

func (p *Provider) GetInstanceLogs(ctx *lepton.Context, instancename string) (string, error)

GetInstanceLogs returns instance log

func (*Provider) GetInstances

func (p *Provider) GetInstances(ctx *lepton.Context) (instances []lepton.CloudInstance, err error)

GetInstances returns the list of servers managed by upcloud

func (*Provider) GetSubnet

func (p *Provider) GetSubnet(ctx *lepton.Context) (subnet *core.Subnet, err error)

GetSubnet returns a public subnet

func (*Provider) Initialize

func (p *Provider) Initialize(providerConfig *types.ProviderConfig) (err error)

Initialize checks conditions to use oci

func (*Provider) InstanceStats

func (p *Provider) InstanceStats(ctx *lepton.Context, instancename string, watch bool) error

InstanceStats show metrics for instances on provider.

func (*Provider) ListImages

func (p *Provider) ListImages(ctx *lepton.Context, filter string) error

ListImages prints oci images in table format

func (*Provider) ListInstances

func (p *Provider) ListInstances(ctx *lepton.Context) (err error)

ListInstances prints servers list managed by oci in table

func (*Provider) PrintInstanceLogs

func (p *Provider) PrintInstanceLogs(ctx *lepton.Context, instancename string, watch bool) error

PrintInstanceLogs prints instances logs on console

func (*Provider) RebootInstance

func (p *Provider) RebootInstance(ctx *lepton.Context, instanceName string) error

RebootInstance reboots the instance.

func (*Provider) ResizeImage

func (p *Provider) ResizeImage(ctx *lepton.Context, imagename string, hbytes string) error

ResizeImage is a stub

func (*Provider) StartInstance

func (p *Provider) StartInstance(ctx *lepton.Context, instancename string) error

StartInstance starts an instance

func (*Provider) StopInstance

func (p *Provider) StopInstance(ctx *lepton.Context, instancename string) error

StopInstance stops an instance

func (*Provider) SyncImage

func (p *Provider) SyncImage(config *types.Config, target lepton.Provider, imagename string) error

SyncImage is a stub

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

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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