github.com/makyo/juju@v0.0.0-20160425123129-2608902037e9/provider/gce/export_test.go (about)

     1  // Copyright 2014 Canonical Ltd.
     2  // Licensed under the AGPLv3, see LICENCE file for details.
     3  
     4  package gce
     5  
     6  import (
     7  	"github.com/juju/juju/environs"
     8  	"github.com/juju/juju/environs/imagemetadata"
     9  	"github.com/juju/juju/environs/instances"
    10  	"github.com/juju/juju/instance"
    11  	"github.com/juju/juju/provider/gce/google"
    12  	"github.com/juju/juju/storage"
    13  )
    14  
    15  var (
    16  	Provider                 environs.EnvironProvider = providerInstance
    17  	NewInstance                                       = newInstance
    18  	CheckInstanceType                                 = checkInstanceType
    19  	GetMetadata                                       = getMetadata
    20  	GetDisks                                          = getDisks
    21  	ConfigImmutable                                   = configImmutableFields
    22  	UbuntuImageBasePath                               = ubuntuImageBasePath
    23  	UbuntuDailyImageBasePath                          = ubuntuDailyImageBasePath
    24  	WindowsImageBasePath                              = windowsImageBasePath
    25  )
    26  
    27  func ExposeInstBase(inst *environInstance) *google.Instance {
    28  	return inst.base
    29  }
    30  
    31  func ExposeInstEnv(inst *environInstance) *environ {
    32  	return inst.env
    33  }
    34  
    35  func ParseAvailabilityZones(env *environ, args environs.StartInstanceParams) ([]string, error) {
    36  	return env.parseAvailabilityZones(args)
    37  }
    38  
    39  func UnsetEnvConfig(env *environ) {
    40  	env.ecfg = nil
    41  }
    42  
    43  func ExposeEnvConfig(env *environ) *environConfig {
    44  	return env.ecfg
    45  }
    46  
    47  func ExposeEnvConnection(env *environ) gceConnection {
    48  	return env.gce
    49  }
    50  
    51  func GlobalFirewallName(env *environ) string {
    52  	return env.globalFirewallName()
    53  }
    54  
    55  func ParsePlacement(env *environ, placement string) (*instPlacement, error) {
    56  	return env.parsePlacement(placement)
    57  }
    58  
    59  func FinishInstanceConfig(env *environ, args environs.StartInstanceParams, spec *instances.InstanceSpec) error {
    60  	return env.finishInstanceConfig(args, spec)
    61  }
    62  
    63  func FindInstanceSpec(
    64  	env *environ,
    65  	ic *instances.InstanceConstraint,
    66  	imageMetadata []*imagemetadata.ImageMetadata,
    67  ) (*instances.InstanceSpec, error) {
    68  	return env.findInstanceSpec(ic, imageMetadata)
    69  }
    70  
    71  func BuildInstanceSpec(env *environ, args environs.StartInstanceParams) (*instances.InstanceSpec, error) {
    72  	return env.buildInstanceSpec(args)
    73  }
    74  
    75  func NewRawInstance(env *environ, args environs.StartInstanceParams, spec *instances.InstanceSpec) (*google.Instance, error) {
    76  	return env.newRawInstance(args, spec)
    77  }
    78  
    79  func GetHardwareCharacteristics(env *environ, spec *instances.InstanceSpec, inst *environInstance) *instance.HardwareCharacteristics {
    80  	return env.getHardwareCharacteristics(spec, inst)
    81  }
    82  
    83  func GetInstances(env *environ) ([]instance.Instance, error) {
    84  	return env.instances()
    85  }
    86  
    87  // Storage
    88  func GCEStorageProvider() storage.Provider {
    89  	return &storageProvider{}
    90  }