github.com/axw/juju@v0.0.0-20161005053422-4bd6544d08d4/provider/vsphere/environ_network.go (about) 1 // Copyright 2015 Canonical Ltd. 2 // Licensed under the AGPLv3, see LICENCE file for details. 3 4 // +build !gccgo 5 6 package vsphere 7 8 import ( 9 "github.com/juju/errors" 10 "gopkg.in/juju/names.v2" 11 12 "github.com/juju/juju/instance" 13 "github.com/juju/juju/network" 14 ) 15 16 // SupportsSpaces is specified on environs.Networking. 17 func (env *environ) SupportsSpaces() (bool, error) { 18 return false, errors.NotSupportedf("spaces") 19 } 20 21 // SupportsSpaceDiscovery implements environs.Networking. 22 func (env *environ) SupportsSpaceDiscovery() (bool, error) { 23 return false, errors.NotSupportedf("spaces") 24 } 25 26 // Spaces implements environs.Networking. 27 func (env *environ) Spaces() ([]network.SpaceInfo, error) { 28 return nil, errors.NotSupportedf("spaces") 29 } 30 31 // Subnets implements environs.Networking. 32 func (env *environ) Subnets(inst instance.Id, ids []network.Id) ([]network.SubnetInfo, error) { 33 return env.client.Subnets(inst, ids) 34 } 35 36 // NetworkInterfaces implements environs.Networking. 37 func (env *environ) NetworkInterfaces(inst instance.Id) ([]network.InterfaceInfo, error) { 38 return env.client.GetNetworkInterfaces(inst, env.ecfg) 39 } 40 41 // OpenPorts opens the given port ranges for the whole environment. 42 // Must only be used if the environment was setup with the 43 // FwGlobal firewall mode. 44 func (env *environ) OpenPorts(ports []network.PortRange) error { 45 return errors.Trace(errors.NotSupportedf("ClosePorts")) 46 } 47 48 // ClosePorts closes the given port ranges for the whole environment. 49 // Must only be used if the environment was setup with the 50 // FwGlobal firewall mode. 51 func (env *environ) ClosePorts(ports []network.PortRange) error { 52 return errors.Trace(errors.NotSupportedf("ClosePorts")) 53 } 54 55 // Ports returns the port ranges opened for the whole environment. 56 // Must only be used if the environment was setup with the 57 // FwGlobal firewall mode. 58 func (env *environ) Ports() ([]network.PortRange, error) { 59 return nil, errors.Trace(errors.NotSupportedf("Ports")) 60 } 61 62 // AllocateContainerAddresses implements environs.Networking. 63 func (e *environ) AllocateContainerAddresses(hostInstanceID instance.Id, containerTag names.MachineTag, preparedInfo []network.InterfaceInfo) ([]network.InterfaceInfo, error) { 64 return nil, errors.NotSupportedf("container address allocation") 65 } 66 67 // ReleaseContainerAddresses implements environs.Networking. 68 func (e *environ) ReleaseContainerAddresses(interfaces []network.ProviderInterfaceInfo) error { 69 return errors.NotSupportedf("container address allocation") 70 }