juju: github.com/juju/juju/provider/oracle/network Index | Files

package network

import "github.com/juju/juju/provider/oracle/network"

Index

Package Files

environ.go firewall.go util.go zones.go

func GetMacAndIP Uses

func GetMacAndIP(address []string) (mac string, ip string, err error)

GetMacAndIp is a helper function that returns a mac and an IP, given a list of strings containing both. This type of array is returned by the oracle API as part of instance details.

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 {
    // contains filtered or unexported fields
}

Environ implements the environs.Networking interface

func NewEnviron Uses

func NewEnviron(api NetworkingAPI, env commonProvider.OracleInstancer) *Environ

NewEnviron returns a new instance of Environ

func (Environ) AllocateContainerAddresses Uses

func (e Environ) AllocateContainerAddresses(
    ctx context.ProviderCallContext,
    hostInstanceID instance.Id,
    containerTag names.MachineTag,
    preparedInfo []network.InterfaceInfo,
) ([]network.InterfaceInfo, error)

AllocateContainerAddresses is defined on the environs.Networking interface.

func (Environ) AreSpacesRoutable Uses

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

AreSpacesRoutable is defined on the environs.NetworkingEnviron interface.

func (Environ) NetworkInterfaces Uses

func (e Environ) NetworkInterfaces(ctx context.ProviderCallContext, instId instance.Id) ([]network.InterfaceInfo, error)

NetworkInterfaces is defined on the environs.Networking interface.

func (Environ) ProviderSpaceInfo Uses

func (Environ) ProviderSpaceInfo(
    ctx context.ProviderCallContext, space *corenetwork.SpaceInfo,
) (*environs.ProviderSpaceInfo, error)

ProviderSpaceInfo is defined on the environs.NetworkingEnviron interface.

func (Environ) ReleaseContainerAddresses Uses

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

ReleaseContainerAddresses is defined on the environs.Networking interface.

func (*Environ) SSHAddresses Uses

func (*Environ) SSHAddresses(ctx context.ProviderCallContext, addresses corenetwork.SpaceAddresses) (corenetwork.SpaceAddresses, error)

SSHAddresses is defined on the environs.SSHAddresses interface.

func (Environ) Spaces Uses

func (e Environ) Spaces(ctx context.ProviderCallContext) ([]corenetwork.SpaceInfo, error)

Spaces is defined on the environs.Networking interface.

func (Environ) Subnets Uses

func (e Environ) Subnets(
    ctx context.ProviderCallContext, id instance.Id, subnets []corenetwork.Id,
) ([]corenetwork.SubnetInfo, error)

Subnets is defined on the environs.Networking interface.

func (*Environ) SuperSubnets Uses

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

SuperSubnets implements environs.SuperSubnets

func (Environ) SupportsContainerAddresses Uses

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

SupportsContainerAddresses is defined on the environs.Networking interface.

func (Environ) SupportsSpaceDiscovery Uses

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

SupportsSpaceDiscovery is defined on the environs.Networking interface.

func (Environ) SupportsSpaces Uses

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

SupportsSpaces is defined on the environs.Networking interface.

type Firewall Uses

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

Firewall implements environ.Firewaller

func NewFirewall Uses

func NewFirewall(cfg environs.ConfigGetter, client FirewallerAPI, c clock.Clock) *Firewall

NewFirewall returns a new Firewall

func (Firewall) ClosePorts Uses

func (f Firewall) ClosePorts(ctx context.ProviderCallContext, rules []network.IngressRule) error

ClosePorts is specified on the environ.Firewaller interface.

func (Firewall) ClosePortsOnInstance Uses

func (f Firewall) ClosePortsOnInstance(ctx context.ProviderCallContext, machineId string, rules []network.IngressRule) error

ClosePortsOnInstnace will close ports corresponding to the supplied rules for a given instance.

func (Firewall) CreateDefaultACLAndRules Uses

func (f Firewall) CreateDefaultACLAndRules(machineId string) (response.Acl, error)

CreateDefaultACLAndRules creates default ACL and rules for IP networks attached to units. NOTE (gsamfira): For now we apply an allow all on these ACLs. Traffic will be cloud-only between instances connected to the same ip network exchange (the equivalent of a space) There will be no public IP associated to interfaces connected to IP networks, so only instances connected to the same network, or a network managed by the same space will be able to connect. This will ensure that peers and units entering a relationship can connect to services deployed by a particular unit, without having to expose the application.

func (Firewall) CreateMachineSecLists Uses

func (f Firewall) CreateMachineSecLists(machineId string, apiPort int) ([]string, error)

CreateMachineSecLists creates a security list for the given instance. It's worth noting that this function also ensures that the default environment sec list is also present, and has the appropriate default rules. The port parameter is the API port for the state machine, for which we need to create rules.

func (Firewall) DeleteMachineSecList Uses

func (f Firewall) DeleteMachineSecList(machineId string) error

DeleteMachineSecList will delete the security list on the given machine

func (Firewall) GlobalIngressRules Uses

func (f Firewall) GlobalIngressRules(ctx context.ProviderCallContext) ([]network.IngressRule, error)

GlobalIngressRules returns the ingress rules applied to the whole environment.

func (Firewall) IngressRules Uses

func (f Firewall) IngressRules(ctx context.ProviderCallContext) ([]network.IngressRule, error)

IngressRules is specified on the environ.Firewaller interface.

func (Firewall) MachineIngressRules Uses

func (f Firewall) MachineIngressRules(ctx context.ProviderCallContext, machineId string) ([]network.IngressRule, error)

MachineIngressRules returns all ingress rules from the machine specific sec list

func (Firewall) OpenPorts Uses

func (f Firewall) OpenPorts(ctx context.ProviderCallContext, rules []network.IngressRule) error

OpenPorts is specified on the environ.Firewaller interface.

func (Firewall) OpenPortsOnInstance Uses

func (f Firewall) OpenPortsOnInstance(ctx context.ProviderCallContext, machineId string, rules []network.IngressRule) error

OpenPortsOnInstance will open ports corresponding to the supplied rules on the given instance

func (Firewall) RemoveACLAndRules Uses

func (f Firewall) RemoveACLAndRules(machineId string) error

RemoveACLAndRules will remove the ACL and any associated rules.

type Firewaller Uses

type Firewaller interface {
    environs.Firewaller

    // Return all machine ingress rules for a given machine id
    MachineIngressRules(ctx context.ProviderCallContext, id string) ([]network.IngressRule, error)

    // OpenPortsOnInstance will open ports corresponding to the supplied rules
    // on the given instance
    OpenPortsOnInstance(ctx context.ProviderCallContext, machineId string, rules []network.IngressRule) error

    // ClosePortsOnInstnace will close ports corresponding to the supplied rules
    // for a given instance.
    ClosePortsOnInstance(ctx context.ProviderCallContext, machineId string, rules []network.IngressRule) error

    // CreateMachineSecLists creates a security list for the given instance.
    // It's worth noting that this function also ensures that the default environment
    // sec list is also present, and has the appropriate default rules.
    // The port parameter is the API port for the state machine, for which we need
    // to create rules.
    CreateMachineSecLists(id string, port int) ([]string, error)

    // DeleteMachineSecList will delete the security list on the given machine
    // id
    DeleteMachineSecList(id string) error

    // CreateDefaultACLAndRules will create a default ACL and associated rules, for
    // a given machine. This ACL applies to user defined IP networks, which are attached
    // to the instance.
    CreateDefaultACLAndRules(id string) (response.Acl, error)

    // RemoveACLAndRules will remove the ACL and any associated rules.
    RemoveACLAndRules(id string) error
}

Firewaller exposes methods for managing network ports.

type FirewallerAPI Uses

type FirewallerAPI interface {
    commonProvider.Composer
    commonProvider.RulesAPI
    commonProvider.AclAPI
    commonProvider.SecIpAPI
    commonProvider.IpAddressPrefixSetAPI
    commonProvider.SecListAPI
    commonProvider.ApplicationsAPI
    commonProvider.SecRulesAPI
    commonProvider.AssociationAPI
}

FirewallerAPI defines methods necessary for interacting with the firewall feature of Oracle compute cloud

type NetworkingAPI Uses

type NetworkingAPI interface {
    commonProvider.Instancer
    commonProvider.Composer

    // AllIpNetworks fetches all IP networks matching a filter. A nil valued filter
    // will return all IP networks
    AllIpNetworks([]api.Filter) (response.AllIpNetworks, error)

    // AllAcls fetches all ACLs that match a given filter.
    AllAcls([]api.Filter) (response.AllAcls, error)
}

NetworkingAPI defines methods needed to interact with the networking features of the Oracle API

Package network imports 23 packages (graph) and is imported by 6 packages. Updated 2019-10-19. Refresh now. Tools for package owners.