Documentation

Index

Constants

View Source
const (
	// DefaultConfigFolder is the default folder in which the OCI cli will
	// store its config files and keys
	DefaultConfigFolder = ".oci"

	// FallbackConfigFolder is the fallback config folder. Users that installed
	// an earlier version of the oracle CLI tool will have this folder instead of
	// ~/.oci
	FallbackConfigFolder = ".oraclebmc"
)
View Source
const (
	BareMetal      InstanceType = "metal"
	VirtualMachine InstanceType = "vm"
	GPUMachine     InstanceType = "gpu"

	// ImageTypeVM should be run on a virtual instance
	ImageTypeVM ImageType = "vm"
	// ImageTypeBM should be run on bare metal
	ImageTypeBM ImageType = "metal"
	// ImageTypeGPU should be run on an instance with attached GPUs
	ImageTypeGPU ImageType = "gpu"
	// ImageTypeGeneric should work on any type of instance (bare metal or virtual)
	ImageTypeGeneric ImageType = "generic"
)
View Source
const (
	// MinVolumeSizeMB is the minimum size in MB for a volume or boot disk
	MinVolumeSizeMB = 51200

	// MaxVolumeSizeMB is the maximum size in MB for a volume or boot disk
	MaxVolumeSizeMB = 16777216
)
View Source
const (
	// DefaultAddressSpace is the subnet to use for the default juju VCN
	// An individual subnet will be created from this class, for each
	// availability domain.
	DefaultAddressSpace = "10.0.0.0/16"
	AllowAllPrefix      = "0.0.0.0/0"

	SubnetPrefixLength = "24"

	VcnNamePrefix         = "juju-vcn"
	SecListNamePrefix     = "juju-seclist"
	SubnetNamePrefix      = "juju-subnet"
	InternetGatewayPrefix = "juju-ig"
	RouteTablePrefix      = "juju-rt"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AvailabilityZone

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

AvailabilityZone implements common.AvailabilityZone

func NewAvailabilityZone

func NewAvailabilityZone(name string) AvailabilityZone

NewAvailabilityZone returns a new availability zone

func (AvailabilityZone) Available

func (a AvailabilityZone) Available() bool

Available is specified on the common.AvailabilityZone interface

func (AvailabilityZone) Name

func (a AvailabilityZone) Name() string

Name is specified on the common.AvailabilityZone interface

type Environ

type Environ struct {
	Compute    providerCommon.OCIComputeClient
	Networking providerCommon.OCINetworkingClient
	Storage    providerCommon.OCIStorageClient
	Firewall   providerCommon.OCIFirewallClient
	Identity   providerCommon.OCIIdentityClient
	// contains filtered or unexported fields
}

func (*Environ) AdoptResources

func (e *Environ) AdoptResources(ctx envcontext.ProviderCallContext, controllerUUID string, fromVersion version.Number) error

AdoptResources implements environs.Environ.

func (*Environ) AllInstances

func (e *Environ) AllInstances(ctx envcontext.ProviderCallContext) ([]instances.Instance, error)

AllInstances implements environs.InstanceBroker.

func (*Environ) AllRunningInstances

func (e *Environ) AllRunningInstances(ctx envcontext.ProviderCallContext) ([]instances.Instance, error)

AllRunningInstances implements environs.InstanceBroker.

func (*Environ) AllocateContainerAddresses

func (e *Environ) AllocateContainerAddresses(
	ctx envcontext.ProviderCallContext,
	hostInstanceID instance.Id,
	containerTag names.MachineTag,
	preparedInfo network.InterfaceInfos,
) (network.InterfaceInfos, error)

func (*Environ) AreSpacesRoutable

func (e *Environ) AreSpacesRoutable(ctx envcontext.ProviderCallContext, space1, space2 *environs.ProviderSpaceInfo) (bool, error)

func (*Environ) AvailabilityZones

AvailabilityZones is defined in the common.ZonedEnviron interface

func (*Environ) Bootstrap

Bootstrap implements environs.Environ.

func (*Environ) ClosePorts

func (e *Environ) ClosePorts(ctx context.ProviderCallContext, rules firewall.IngressRules) error

func (*Environ) Config

func (e *Environ) Config() *config.Config

Config implements environs.ConfigGetter.

func (*Environ) ConstraintsValidator

func (e *Environ) ConstraintsValidator(ctx envcontext.ProviderCallContext) (constraints.Validator, error)

ConstraintsValidator implements environs.Environ.

func (*Environ) ControllerInstances

func (e *Environ) ControllerInstances(ctx envcontext.ProviderCallContext, controllerUUID string) ([]instance.Id, error)

ControllerInstances implements environs.Environ.

func (*Environ) Create

Create implements environs.Environ.

func (*Environ) DeriveAvailabilityZones

func (e *Environ) DeriveAvailabilityZones(ctx envcontext.ProviderCallContext, args environs.StartInstanceParams) ([]string, error)

DeriveAvailabilityZones implements common.ZonedEnviron.

func (*Environ) Destroy

func (e *Environ) Destroy(ctx envcontext.ProviderCallContext) error

Destroy implements environs.Environ.

func (*Environ) DestroyController

func (e *Environ) DestroyController(ctx envcontext.ProviderCallContext, controllerUUID string) error

DestroyController implements environs.Environ.

func (*Environ) IngressRules

func (*Environ) InstanceAvailabilityZoneNames

func (e *Environ) InstanceAvailabilityZoneNames(ctx envcontext.ProviderCallContext, ids []instance.Id) ([]string, error)

InstanceAvailabilityZoneNames implements common.ZonedEnviron.

func (*Environ) InstanceTypes

InstanceTypes implements environs.InstancePrechecker.

func (*Environ) Instances

func (e *Environ) Instances(ctx envcontext.ProviderCallContext, ids []instance.Id) ([]instances.Instance, error)

Instances implements environs.Environ.

func (*Environ) NetworkInterfaces

func (e *Environ) NetworkInterfaces(ctx envcontext.ProviderCallContext, ids []instance.Id) ([]network.InterfaceInfos, error)

func (*Environ) OpenPorts

func (e *Environ) OpenPorts(ctx context.ProviderCallContext, rules firewall.IngressRules) error

func (*Environ) PrecheckInstance

PrecheckInstance implements environs.InstancePrechecker.

func (*Environ) PrepareForBootstrap

func (e *Environ) PrepareForBootstrap(ctx environs.BootstrapContext, controllerName string) error

PrepareForBootstrap implements environs.Environ.

func (*Environ) Provider

func (e *Environ) Provider() environs.EnvironProvider

Provider implements environs.Environ.

func (*Environ) ProviderSpaceInfo

func (e *Environ) ProviderSpaceInfo(
	ctx envcontext.ProviderCallContext, space *network.SpaceInfo,
) (*environs.ProviderSpaceInfo, error)

func (*Environ) ReleaseContainerAddresses

func (e *Environ) ReleaseContainerAddresses(ctx envcontext.ProviderCallContext, interfaces []network.ProviderInterfaceInfo) error

func (*Environ) SSHAddresses

func (*Environ) SetConfig

func (e *Environ) SetConfig(cfg *config.Config) error

SetConfig implements environs.Environ.

func (*Environ) Spaces

func (*Environ) StartInstance

StartInstance implements environs.InstanceBroker.

func (*Environ) StopInstances

func (e *Environ) StopInstances(ctx envcontext.ProviderCallContext, ids ...instance.Id) error

StopInstances implements environs.InstanceBroker.

func (*Environ) StorageProvider

func (e *Environ) StorageProvider(t storage.ProviderType) (storage.Provider, error)

StorageProvider implements storage.ProviderRegistry.

func (*Environ) StorageProviderTypes

func (e *Environ) StorageProviderTypes() ([]storage.ProviderType, error)

StorageProviderTypes implements storage.ProviderRegistry.

func (*Environ) Subnets

func (e *Environ) Subnets(
	ctx envcontext.ProviderCallContext, id instance.Id, subnets []network.Id,
) ([]network.SubnetInfo, error)

Subnets is defined on the environs.Networking interface.

func (*Environ) SuperSubnets

func (e *Environ) SuperSubnets(ctx envcontext.ProviderCallContext) ([]string, error)

func (*Environ) SupportsContainerAddresses

func (e *Environ) SupportsContainerAddresses(ctx envcontext.ProviderCallContext) (bool, error)

func (*Environ) SupportsSpaceDiscovery

func (e *Environ) SupportsSpaceDiscovery(ctx envcontext.ProviderCallContext) (bool, error)

func (*Environ) SupportsSpaces

func (e *Environ) SupportsSpaces(ctx envcontext.ProviderCallContext) (bool, error)

type EnvironProvider

type EnvironProvider struct{}

EnvironProvider type implements environs.EnvironProvider interface

func (EnvironProvider) CloudSchema

func (e EnvironProvider) CloudSchema() *jsonschema.Schema

CloudSchema implements environs.EnvironProvider.

func (*EnvironProvider) ConfigDefaults

func (o *EnvironProvider) ConfigDefaults() schema.Defaults

ConfigDefaults implements config.ConfigSchemaSource

func (*EnvironProvider) ConfigSchema

func (o *EnvironProvider) ConfigSchema() schema.Fields

ConfigSchema implements config.ConfigSchemaSource

func (EnvironProvider) CredentialSchemas

func (e EnvironProvider) CredentialSchemas() map[cloud.AuthType]cloud.CredentialSchema

CredentialSchemas implements environs.ProviderCredentials.

func (EnvironProvider) DetectCredentials

func (e EnvironProvider) DetectCredentials() (*cloud.CloudCredential, error)

DetectCredentials implements environs.ProviderCredentials. Configuration options for the OCI SDK are detailed here: https://docs.us-phoenix-1.oraclecloud.com/Content/API/Concepts/sdkconfig.htm

func (EnvironProvider) FinalizeCredential

FinalizeCredential implements environs.ProviderCredentials.

func (*EnvironProvider) Open

Open implements environs.EnvironProvider.

func (*EnvironProvider) Ping

func (e *EnvironProvider) Ping(ctx context.ProviderCallContext, endpoint string) error

Ping implements environs.EnvironProvider.

func (EnvironProvider) PrepareConfig

func (e EnvironProvider) PrepareConfig(args environs.PrepareConfigParams) (*config.Config, error)

PrepareConfig implements environs.EnvironProvider.

func (*EnvironProvider) Schema

func (o *EnvironProvider) Schema() environschema.Fields

Schema implements environs.ProviderSchema

func (EnvironProvider) Validate

func (e EnvironProvider) Validate(cfg, old *config.Config) (valid *config.Config, err error)

Validate implements config.Validator.

func (EnvironProvider) Version

func (e EnvironProvider) Version() int

Version implements environs.EnvironProvider.

type ImageCache

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

ImageCache holds a cache of all provider images for a fixed amount of time before it becomes stale

func (*ImageCache) ImageMap

func (i *ImageCache) ImageMap() map[string][]InstanceImage

func (ImageCache) ImageMetadata

func (i ImageCache) ImageMetadata(series string, defaultVirtType string) []*imagemetadata.ImageMetadata

ImageMetadata returns an array of imagemetadata.ImageMetadata for all images that are currently in cache, matching the provided series If defaultVirtType is specified, all generic images will inherit the value of defaultVirtType.

func (*ImageCache) SetImages

func (i *ImageCache) SetImages(images map[string][]InstanceImage)

func (*ImageCache) SetLastRefresh

func (i *ImageCache) SetLastRefresh(t time.Time)

SetLastRefresh sets the lastRefresh attribute of ImageCache This is used mostly for testing purposes

func (ImageCache) SupportedShapes

func (i ImageCache) SupportedShapes(series string) []instances.InstanceType

SupportedShapes returns the InstanceTypes available for images matching the supplied series

type ImageType

type ImageType string

type ImageVersion

type ImageVersion struct {
	TimeStamp time.Time
	Revision  int
}

func NewImageVersion

func NewImageVersion(img ociCore.Image) (ImageVersion, error)

type InstanceImage

type InstanceImage struct {
	// ImageType determines which type of image this is. Valid values are:
	// vm, baremetal and generic
	ImageType ImageType
	// Id is the provider ID of the image
	Id string
	// Series is the series as known by juju
	Series string
	// Version is the version of the image
	Version ImageVersion
	// Raw stores the core.Image object
	Raw ociCore.Image

	// CompartmentId is the compartment Id where this image is available
	CompartmentId *string

	// InstanceTypes holds a list of shapes compatible with this image
	InstanceTypes []instances.InstanceType
}

InstanceImage aggregates information pertinent to provider supplied images (eg: shapes it ca run on, type of instance it can run on, etc)

func NewInstanceImage

func NewInstanceImage(img ociCore.Image, compartmentID *string) (imgType InstanceImage, err error)

func (*InstanceImage) SetInstanceTypes

func (i *InstanceImage) SetInstanceTypes(types []instances.InstanceType)

type InstanceType

type InstanceType string

type OCIRenderer

type OCIRenderer struct{}

OCIRenderer implements the renderers.ProviderRenderer interface

func (OCIRenderer) Render

func (OCIRenderer) Render(cfg cloudinit.CloudConfig, os jujuos.OSType) ([]byte, error)

Renderer is defined in the renderers.ProviderRenderer interface

type ShapeSpec

type ShapeSpec struct {
	// Cpus is the number of CPU cores available to the instance
	Cpus int
	// Gpus is the number of GPUs available to this instance
	Gpus int
	// Memory is the amount of RAM available to the instance in MB
	Memory int
	// Bandwidth is the network bandwidth in Gbps. Where there are multiple physical NICs, the speed of the fastest is used.
	Bandwidth float32
	Type      InstanceType
	Tags      []string
}

ShapeSpec holds information about a shapes resource allocation

type StorageAPI

type StorageAPI interface{}

Directories

Path Synopsis
common
testing Package testing is a generated GoMock package.