Documentation ¶
Index ¶
- Constants
- type AvailabilityZone
- type Environ
- func (e *Environ) AdoptResources(ctx envcontext.ProviderCallContext, controllerUUID string, ...) error
- func (e *Environ) AllInstances(ctx envcontext.ProviderCallContext) ([]instances.Instance, error)
- func (e *Environ) AllocateContainerAddresses(ctx envcontext.ProviderCallContext, hostInstanceID instance.Id, ...) ([]network.InterfaceInfo, error)
- func (e *Environ) AreSpacesRoutable(ctx envcontext.ProviderCallContext, space1, space2 *environs.ProviderSpaceInfo) (bool, error)
- func (e *Environ) AvailabilityZones(ctx envcontext.ProviderCallContext) ([]common.AvailabilityZone, error)
- func (e *Environ) Bootstrap(ctx environs.BootstrapContext, callCtx envcontext.ProviderCallContext, ...) (*environs.BootstrapResult, error)
- func (e *Environ) ClosePorts(ctx context.ProviderCallContext, rules []network.IngressRule) error
- func (e *Environ) Config() *config.Config
- func (e *Environ) ConstraintsValidator(ctx envcontext.ProviderCallContext) (constraints.Validator, error)
- func (e *Environ) ControllerInstances(ctx envcontext.ProviderCallContext, controllerUUID string) ([]instance.Id, error)
- func (e *Environ) Create(ctx envcontext.ProviderCallContext, params environs.CreateParams) error
- func (e *Environ) DeriveAvailabilityZones(ctx envcontext.ProviderCallContext, args environs.StartInstanceParams) ([]string, error)
- func (e *Environ) Destroy(ctx envcontext.ProviderCallContext) error
- func (e *Environ) DestroyController(ctx envcontext.ProviderCallContext, controllerUUID string) error
- func (e *Environ) IngressRules(ctx context.ProviderCallContext) ([]network.IngressRule, error)
- func (e *Environ) InstanceAvailabilityZoneNames(ctx envcontext.ProviderCallContext, ids []instance.Id) ([]string, error)
- func (e *Environ) InstanceTypes(envcontext.ProviderCallContext, constraints.Value) (instances.InstanceTypesWithCostMetadata, error)
- func (e *Environ) Instances(ctx envcontext.ProviderCallContext, ids []instance.Id) ([]instances.Instance, error)
- func (e *Environ) MaintainInstance(ctx envcontext.ProviderCallContext, args environs.StartInstanceParams) error
- func (e *Environ) NetworkInterfaces(ctx envcontext.ProviderCallContext, instId instance.Id) ([]network.InterfaceInfo, error)
- func (e *Environ) OpenPorts(ctx context.ProviderCallContext, rules []network.IngressRule) error
- func (e *Environ) PrecheckInstance(envcontext.ProviderCallContext, environs.PrecheckInstanceParams) error
- func (e *Environ) PrepareForBootstrap(ctx environs.BootstrapContext) error
- func (e *Environ) Provider() environs.EnvironProvider
- func (e *Environ) ProviderSpaceInfo(ctx envcontext.ProviderCallContext, space *network.SpaceInfo) (*environs.ProviderSpaceInfo, error)
- func (e *Environ) ReleaseContainerAddresses(ctx envcontext.ProviderCallContext, interfaces []network.ProviderInterfaceInfo) error
- func (e *Environ) SSHAddresses(ctx envcontext.ProviderCallContext, addresses []network.Address) ([]network.Address, error)
- func (e *Environ) SetConfig(cfg *config.Config) error
- func (e *Environ) Spaces(ctx envcontext.ProviderCallContext) ([]network.SpaceInfo, error)
- func (e *Environ) StartInstance(ctx envcontext.ProviderCallContext, args environs.StartInstanceParams) (*environs.StartInstanceResult, error)
- func (e *Environ) StopInstances(ctx envcontext.ProviderCallContext, ids ...instance.Id) error
- func (e *Environ) StorageProvider(t storage.ProviderType) (storage.Provider, error)
- func (e *Environ) StorageProviderTypes() ([]storage.ProviderType, error)
- func (e *Environ) Subnets(ctx envcontext.ProviderCallContext, id instance.Id, subnets []network.Id) ([]network.SubnetInfo, error)
- func (e *Environ) SuperSubnets(ctx envcontext.ProviderCallContext) ([]string, error)
- func (e *Environ) SupportsContainerAddresses(ctx envcontext.ProviderCallContext) (bool, error)
- func (e *Environ) SupportsSpaceDiscovery(ctx envcontext.ProviderCallContext) (bool, error)
- func (e *Environ) SupportsSpaces(ctx envcontext.ProviderCallContext) (bool, error)
- type EnvironProvider
- func (e EnvironProvider) CloudSchema() *jsonschema.Schema
- func (o *EnvironProvider) ConfigDefaults() schema.Defaults
- func (o *EnvironProvider) ConfigSchema() schema.Fields
- func (e EnvironProvider) CredentialSchemas() map[cloud.AuthType]cloud.CredentialSchema
- func (e EnvironProvider) DetectCredentials() (*cloud.CloudCredential, error)
- func (e EnvironProvider) FinalizeCredential(ctx environs.FinalizeCredentialContext, ...) (*cloud.Credential, error)
- func (e *EnvironProvider) Open(params environs.OpenParams) (environs.Environ, error)
- func (e *EnvironProvider) Ping(ctx context.ProviderCallContext, endpoint string) error
- func (e EnvironProvider) PrepareConfig(args environs.PrepareConfigParams) (*config.Config, error)
- func (o *EnvironProvider) Schema() environschema.Fields
- func (e EnvironProvider) Validate(cfg, old *config.Config) (valid *config.Config, err error)
- func (e EnvironProvider) Version() int
- type ImageCache
- func (i *ImageCache) ImageMap() map[string][]InstanceImage
- func (i ImageCache) ImageMetadata(series string, defaultVirtType string) []*imagemetadata.ImageMetadata
- func (i *ImageCache) SetImages(images map[string][]InstanceImage)
- func (i *ImageCache) SetLastRefresh(t time.Time)
- func (i ImageCache) SupportedShapes(series string) []instances.InstanceType
- type ImageType
- type ImageVersion
- type InstanceImage
- type InstanceType
- type OCIRenderer
- type ShapeSpec
- type StorageAPI
Constants ¶
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 = "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) AllocateContainerAddresses ¶
func (e *Environ) AllocateContainerAddresses( ctx envcontext.ProviderCallContext, hostInstanceID instance.Id, containerTag names.MachineTag, preparedInfo []network.InterfaceInfo) ([]network.InterfaceInfo, error)
func (*Environ) AreSpacesRoutable ¶
func (e *Environ) AreSpacesRoutable(ctx envcontext.ProviderCallContext, space1, space2 *environs.ProviderSpaceInfo) (bool, error)
func (*Environ) AvailabilityZones ¶
func (e *Environ) AvailabilityZones(ctx envcontext.ProviderCallContext) ([]common.AvailabilityZone, error)
AvailabilityZones is defined in the common.ZonedEnviron interface
func (*Environ) Bootstrap ¶
func (e *Environ) Bootstrap(ctx environs.BootstrapContext, callCtx envcontext.ProviderCallContext, params environs.BootstrapParams) (*environs.BootstrapResult, error)
Bootstrap implements environs.Environ.
func (*Environ) ClosePorts ¶
func (e *Environ) ClosePorts(ctx context.ProviderCallContext, rules []network.IngressRule) error
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 ¶
func (e *Environ) Create(ctx envcontext.ProviderCallContext, params environs.CreateParams) error
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 (e *Environ) IngressRules(ctx context.ProviderCallContext) ([]network.IngressRule, error)
func (*Environ) InstanceAvailabilityZoneNames ¶
func (e *Environ) InstanceAvailabilityZoneNames(ctx envcontext.ProviderCallContext, ids []instance.Id) ([]string, error)
InstanceAvailabilityZoneNames implements common.ZonedEnviron.
func (*Environ) InstanceTypes ¶
func (e *Environ) InstanceTypes(envcontext.ProviderCallContext, constraints.Value) (instances.InstanceTypesWithCostMetadata, error)
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) MaintainInstance ¶
func (e *Environ) MaintainInstance(ctx envcontext.ProviderCallContext, args environs.StartInstanceParams) error
MaintainInstance implements environs.InstanceBroker.
func (*Environ) NetworkInterfaces ¶
func (e *Environ) NetworkInterfaces(ctx envcontext.ProviderCallContext, instId instance.Id) ([]network.InterfaceInfo, error)
func (*Environ) OpenPorts ¶
func (e *Environ) OpenPorts(ctx context.ProviderCallContext, rules []network.IngressRule) error
func (*Environ) PrecheckInstance ¶
func (e *Environ) PrecheckInstance(envcontext.ProviderCallContext, environs.PrecheckInstanceParams) error
PrecheckInstance implements environs.InstancePrechecker.
func (*Environ) PrepareForBootstrap ¶
func (e *Environ) PrepareForBootstrap(ctx environs.BootstrapContext) 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 (e *Environ) SSHAddresses(ctx envcontext.ProviderCallContext, addresses []network.Address) ([]network.Address, error)
func (*Environ) Spaces ¶
func (e *Environ) Spaces(ctx envcontext.ProviderCallContext) ([]network.SpaceInfo, error)
func (*Environ) StartInstance ¶
func (e *Environ) StartInstance(ctx envcontext.ProviderCallContext, args environs.StartInstanceParams) (*environs.StartInstanceResult, error)
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 ¶
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 ¶
func (e EnvironProvider) FinalizeCredential( ctx environs.FinalizeCredentialContext, params environs.FinalizeCredentialParams) (*cloud.Credential, error)
FinalizeCredential implements environs.ProviderCredentials.
func (*EnvironProvider) Open ¶
func (e *EnvironProvider) Open(params environs.OpenParams) (environs.Environ, error)
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) 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 ImageVersion ¶
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{}