github.com/cloud-green/juju@v0.0.0-20151002100041-a00291338d3d/apiserver/environment/environment.go (about)

     1  // Copyright 2014 Canonical Ltd.
     2  // Licensed under the AGPLv3, see LICENCE file for details.
     3  
     4  package environment
     5  
     6  import (
     7  	"github.com/juju/juju/apiserver/common"
     8  	"github.com/juju/juju/state"
     9  )
    10  
    11  func init() {
    12  	common.RegisterStandardFacade("Environment", 0, NewEnvironmentAPI)
    13  }
    14  
    15  // EnvironmentAPI implements the API used by the machine environment worker.
    16  type EnvironmentAPI struct {
    17  	*common.EnvironWatcher
    18  	*EnvironTools
    19  }
    20  
    21  // NewEnvironmentAPI creates a new instance of the Environment API.
    22  func NewEnvironmentAPI(st *state.State, resources *common.Resources, authorizer common.Authorizer) (*EnvironmentAPI, error) {
    23  	return &EnvironmentAPI{
    24  		EnvironWatcher: common.NewEnvironWatcher(st, resources, authorizer),
    25  		EnvironTools:   NewEnvironTools(st, authorizer),
    26  	}, nil
    27  }