juju: github.com/wallyworld/juju/provider/oci Index | Files | Directories

package oci

import "github.com/wallyworld/juju/provider/oci"


Package Files

credentials.go environ.go firewall.go images.go init.go instance.go networking.go provider.go shapespecs.go storage.go storage_volumes.go userdata.go zones.go


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"
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"
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
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 = ""
    AllowAllPrefix      = ""

    SubnetPrefixLength = "24"

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

type AvailabilityZone Uses

type AvailabilityZone struct {
    // contains filtered or unexported fields

AvailabilityZone implements common.AvailabilityZone

func NewAvailabilityZone Uses

func NewAvailabilityZone(name string) AvailabilityZone

NewAvailabilityZone returns a new availability zone

func (AvailabilityZone) Available Uses

func (a AvailabilityZone) Available() bool

Available is specified on the common.AvailabilityZone interface

func (AvailabilityZone) Name Uses

func (a AvailabilityZone) Name() string

Name is specified on the common.AvailabilityZone interface

type Environ Uses

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 Uses

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

AdoptResources implements environs.Environ.

func (*Environ) AllInstances Uses

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

AllInstances implements environs.InstanceBroker.

func (*Environ) AllRunningInstances Uses

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

AllRunningInstances implements environs.InstanceBroker.

func (*Environ) AllocateContainerAddresses Uses

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

func (*Environ) AreSpacesRoutable Uses

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

func (*Environ) AvailabilityZones Uses

func (e *Environ) AvailabilityZones(ctx envcontext.ProviderCallContext) (network.AvailabilityZones, error)

AvailabilityZones is defined in the common.ZonedEnviron interface

func (*Environ) Bootstrap Uses

func (e *Environ) Bootstrap(ctx environs.BootstrapContext, callCtx envcontext.ProviderCallContext, params environs.BootstrapParams) (*environs.BootstrapResult, error)

Bootstrap implements environs.Environ.

func (*Environ) ClosePorts Uses

func (e *Environ) ClosePorts(ctx context.ProviderCallContext, rules []network.IngressRule) error

func (*Environ) Config Uses

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

Config implements environs.ConfigGetter.

func (*Environ) ConstraintsValidator Uses

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

ConstraintsValidator implements environs.Environ.

func (*Environ) ControllerInstances Uses

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

ControllerInstances implements environs.Environ.

func (*Environ) Create Uses

func (e *Environ) Create(ctx envcontext.ProviderCallContext, params environs.CreateParams) error

Create implements environs.Environ.

func (*Environ) DeriveAvailabilityZones Uses

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

DeriveAvailabilityZones implements common.ZonedEnviron.

func (*Environ) Destroy Uses

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

Destroy implements environs.Environ.

func (*Environ) DestroyController Uses

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

DestroyController implements environs.Environ.

func (*Environ) IngressRules Uses

func (e *Environ) IngressRules(ctx context.ProviderCallContext) ([]network.IngressRule, error)

func (*Environ) InstanceAvailabilityZoneNames Uses

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

InstanceAvailabilityZoneNames implements common.ZonedEnviron.

func (*Environ) InstanceTypes Uses

func (e *Environ) InstanceTypes(envcontext.ProviderCallContext, constraints.Value) (instances.InstanceTypesWithCostMetadata, error)

InstanceTypes implements environs.InstancePrechecker.

func (*Environ) Instances Uses

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

Instances implements environs.Environ.

func (*Environ) MaintainInstance Uses

func (e *Environ) MaintainInstance(ctx envcontext.ProviderCallContext, args environs.StartInstanceParams) error

MaintainInstance implements environs.InstanceBroker.

func (*Environ) NetworkInterfaces Uses

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

func (*Environ) OpenPorts Uses

func (e *Environ) OpenPorts(ctx context.ProviderCallContext, rules []network.IngressRule) error

func (*Environ) PrecheckInstance Uses

func (e *Environ) PrecheckInstance(envcontext.ProviderCallContext, environs.PrecheckInstanceParams) error

PrecheckInstance implements environs.InstancePrechecker.

func (*Environ) PrepareForBootstrap Uses

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

PrepareForBootstrap implements environs.Environ.

func (*Environ) Provider Uses

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

Provider implements environs.Environ.

func (*Environ) ProviderSpaceInfo Uses

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

func (*Environ) ReleaseContainerAddresses Uses

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

func (*Environ) SSHAddresses Uses

func (e *Environ) SSHAddresses(ctx envcontext.ProviderCallContext, addresses network.SpaceAddresses) (network.SpaceAddresses, error)

func (*Environ) SetConfig Uses

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

SetConfig implements environs.Environ.

func (*Environ) Spaces Uses

func (e *Environ) Spaces(ctx envcontext.ProviderCallContext) ([]network.SpaceInfo, error)

func (*Environ) StartInstance Uses

func (e *Environ) StartInstance(ctx envcontext.ProviderCallContext, args environs.StartInstanceParams) (*environs.StartInstanceResult, error)

StartInstance implements environs.InstanceBroker.

func (*Environ) StopInstances Uses

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

StopInstances implements environs.InstanceBroker.

func (*Environ) StorageProvider Uses

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

StorageProvider implements storage.ProviderRegistry.

func (*Environ) StorageProviderTypes Uses

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

StorageProviderTypes implements storage.ProviderRegistry.

func (*Environ) Subnets Uses

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 Uses

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

func (*Environ) SupportsContainerAddresses Uses

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

func (*Environ) SupportsSpaceDiscovery Uses

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

func (*Environ) SupportsSpaces Uses

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

type EnvironProvider Uses

type EnvironProvider struct{}

EnvironProvider type implements environs.EnvironProvider interface

func (EnvironProvider) CloudSchema Uses

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

CloudSchema implements environs.EnvironProvider.

func (*EnvironProvider) ConfigDefaults Uses

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

ConfigDefaults implements config.ConfigSchemaSource

func (*EnvironProvider) ConfigSchema Uses

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

ConfigSchema implements config.ConfigSchemaSource

func (EnvironProvider) CredentialSchemas Uses

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

CredentialSchemas implements environs.ProviderCredentials.

func (EnvironProvider) DetectCredentials Uses

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 Uses

func (e EnvironProvider) FinalizeCredential(
    ctx environs.FinalizeCredentialContext,
    params environs.FinalizeCredentialParams) (*cloud.Credential, error)

FinalizeCredential implements environs.ProviderCredentials.

func (*EnvironProvider) Open Uses

func (e *EnvironProvider) Open(params environs.OpenParams) (environs.Environ, error)

Open implements environs.EnvironProvider.

func (*EnvironProvider) Ping Uses

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

Ping implements environs.EnvironProvider.

func (EnvironProvider) PrepareConfig Uses

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

PrepareConfig implements environs.EnvironProvider.

func (*EnvironProvider) Schema Uses

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

Schema implements environs.ProviderSchema

func (EnvironProvider) Validate Uses

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

Validate implements config.Validator.

func (EnvironProvider) Version Uses

func (e EnvironProvider) Version() int

Version implements environs.EnvironProvider.

type ImageCache Uses

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 Uses

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

func (ImageCache) ImageMetadata Uses

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 Uses

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

func (*ImageCache) SetLastRefresh Uses

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

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

func (ImageCache) SupportedShapes Uses

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

SupportedShapes returns the InstanceTypes available for images matching the supplied series

type ImageType Uses

type ImageType string

type ImageVersion Uses

type ImageVersion struct {
    TimeStamp time.Time
    Revision  int

func NewImageVersion Uses

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

type InstanceImage Uses

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 Uses

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

func (*InstanceImage) SetInstanceTypes Uses

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

type InstanceType Uses

type InstanceType string

type OCIRenderer Uses

type OCIRenderer struct{}

OCIRenderer implements the renderers.ProviderRenderer interface

func (OCIRenderer) Render Uses

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

Renderer is defined in the renderers.ProviderRenderer interface

type ShapeSpec Uses

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 Uses

type StorageAPI interface{}


testingPackage testing is a generated GoMock package.

Package oci imports 52 packages (graph). Updated 2020-08-11. Refresh now. Tools for package owners.