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

     1  // Copyright 2013, 2014 Canonical Ltd.
     2  // Licensed under the AGPLv3, see LICENCE file for details.
     3  
     4  package agent
     5  
     6  import (
     7  	"github.com/juju/errors"
     8  
     9  	"github.com/juju/juju/apiserver/common"
    10  	"github.com/juju/juju/state"
    11  )
    12  
    13  // AgentAPIV1 implements the version 1 of the API provided to an agent.
    14  type AgentAPIV1 struct {
    15  	*AgentAPIV0
    16  }
    17  
    18  // NewAgentAPIV1 returns an object implementing version 1 of the Agent API
    19  // with the given authorizer representing the currently logged in client.
    20  // The functionality is like V0, except that it also knows about the additional
    21  // JobManageNetworking.
    22  func NewAgentAPIV1(st *state.State, resources *common.Resources, auth common.Authorizer) (*AgentAPIV1, error) {
    23  	apiV0, err := NewAgentAPIV0(st, resources, auth)
    24  	if err != nil {
    25  		return nil, errors.Trace(err)
    26  	}
    27  	return &AgentAPIV1{apiV0}, nil
    28  }