Beispiel #1
0
// NewClient returns a new HighAvailability client.
func NewClient(caller base.APICallCloser) *Client {
	modelTag, err := caller.ModelTag()
	if err != nil {
		logger.Errorf("ignoring invalid model tag: %v", err)
	}
	frontend, backend := base.NewClientFacade(caller, "HighAvailability")
	return &Client{ClientFacade: frontend, facade: backend, modelTag: modelTag}
}
Beispiel #2
0
// NewClient creates a new `Client` based on an existing authenticated API
// connection.
func NewClient(st base.APICallCloser) *Client {
	frontend, backend := base.NewClientFacade(st, "Controller")
	return &Client{
		ClientFacade:        frontend,
		facade:              backend,
		ControllerConfigAPI: common.NewControllerConfig(backend),
		CloudSpecAPI:        cloudspec.NewCloudSpecAPI(backend),
	}
}
Beispiel #3
0
// NewAPI creates a new client-side Subnets facade.
func NewAPI(caller base.APICallCloser) *API {
	if caller == nil {
		panic("caller is nil")
	}
	clientFacade, facadeCaller := base.NewClientFacade(caller, subnetsFacade)
	return &API{
		ClientFacade: clientFacade,
		facade:       facadeCaller,
	}
}
Beispiel #4
0
// NewClient returns a new backups API client.
func NewClient(st apiState) *Client {
	publicAddress := strings.SplitN(st.Addr(), ":", 2)[0]
	frontend, backend := base.NewClientFacade(st, "Backups")
	return &Client{
		ClientFacade:  frontend,
		facade:        backend,
		http:          st,
		publicAddress: publicAddress,
	}
}
Beispiel #5
0
// NewClient returns a new backups API client.
func NewClient(st base.APICallCloser) (*Client, error) {
	frontend, backend := base.NewClientFacade(st, "Backups")
	client, err := st.HTTPClient()
	if err != nil {
		return nil, errors.Trace(err)
	}
	return &Client{
		ClientFacade: frontend,
		facade:       backend,
		client:       client,
	}, nil
}
Beispiel #6
0
// NewClient creates a new client for accessing the service api.
func NewClient(st api.Connection) *Client {
	frontend, backend := base.NewClientFacade(st, "Service")
	return &Client{ClientFacade: frontend, st: st, facade: backend}
}
Beispiel #7
0
// NewClient creates a new client for accessing the metricsmanager api
func NewClient(st *api.State) *Client {
	frontend, backend := base.NewClientFacade(st, "MetricsManager")
	return &Client{ClientFacade: frontend, st: st, facade: backend}
}
Beispiel #8
0
// NewClient creates a new client for accessing the storage API.
func NewClient(st base.APICallCloser) *Client {
	frontend, backend := base.NewClientFacade(st, "Storage")
	return &Client{ClientFacade: frontend, facade: backend}
}
Beispiel #9
0
// NewClient creates a new client for accessing the metricsdebug api
func NewClient(st base.APICallCloser) *Client {
	frontend, backend := base.NewClientFacade(st, "MetricsDebug")
	return &Client{ClientFacade: frontend, facade: backend}
}
Beispiel #10
0
// Client returns an object that can be used
// to access client-specific functionality.
func (st *State) Client() *Client {
	frontend, backend := base.NewClientFacade(st, "Client")
	return &Client{ClientFacade: frontend, facade: backend, st: st}
}
Beispiel #11
0
// NewClient creates a new client for accessing the undertaker API.
func NewClient(st base.APICallCloser) *Client {
	frontend, backend := base.NewClientFacade(st, "Undertaker")
	return &Client{ClientFacade: frontend, st: st, facade: backend}
}
Beispiel #12
0
// NewClient returns a new HighAvailability client.
func NewClient(caller base.APICallCloser) *Client {
	frontend, backend := base.NewClientFacade(caller, "HighAvailability")
	return &Client{ClientFacade: frontend, facade: backend}
}
Beispiel #13
0
// NewClient creates a new `Client` based on an existing authenticated API
// connection.
func NewClient(st base.APICallCloser) *Client {
	frontend, backend := base.NewClientFacade(st, "SystemManager")
	logger.Tracef("%#v", frontend)
	return &Client{ClientFacade: frontend, facade: backend}
}
Beispiel #14
0
// NewClient returns a new HighAvailability client.
func NewClient(caller base.APICallCloser) *Client {
	modelTag, _ := caller.ModelTag()
	frontend, backend := base.NewClientFacade(caller, "HighAvailability")
	return &Client{ClientFacade: frontend, facade: backend, modelTag: modelTag}
}
Beispiel #15
0
// NewClient returns a new machinemanager client.
func NewClient(st base.APICallCloser) *Client {
	frontend, backend := base.NewClientFacade(st, machineManagerFacade)
	return &Client{ClientFacade: frontend, facade: backend}
}
Beispiel #16
0
// NewClient creates a new client for accessing the metricsmanager api
func NewClient(st api.Connection) *Client {
	frontend, backend := base.NewClientFacade(st, "MetricsManager")
	return &Client{ClientFacade: frontend, st: st, facade: backend}
}
// NewClient creates a new `Client` based on an existing authenticated API
// connection.
func NewClient(st base.APICallCloser) *Client {
	frontend, backend := base.NewClientFacade(st, "EnvironmentManager")
	logger.Debugf("%#v", frontend)
	return &Client{ClientFacade: frontend, facade: backend}
}
Beispiel #18
0
// NewClient creates a new client for accessing the service api.
func NewClient(st *api.State) *Client {
	frontend, backend := base.NewClientFacade(st, "Service")
	return &Client{ClientFacade: frontend, st: st, facade: backend}
}
Beispiel #19
0
// NewClient creates a new client for accessing the block API.
func NewClient(st base.APICallCloser) *Client {
	frontend, backend := base.NewClientFacade(st, "Block")
	logger.Debugf("\nSTORAGE FRONT-END: %#v", frontend)
	logger.Debugf("\nSTORAGE BACK-END: %#v", backend)
	return &Client{ClientFacade: frontend, facade: backend}
}