juju: github.com/wallyworld/juju/resource/api/client Index | Files

package client

import "github.com/wallyworld/juju/resource/api/client"


Package Files


type AddPendingResourcesArgs Uses

type AddPendingResourcesArgs struct {
    // ApplicationID identifies the application being deployed.
    ApplicationID string

    // CharmID identifies the application's charm.
    CharmID charmstore.CharmID

    // CharmStoreMacaroon is the macaroon to use for the charm when
    // interacting with the charm store.
    CharmStoreMacaroon *macaroon.Macaroon

    // Resources holds the charm store info for each of the resources
    // that should be added/updated on the controller.
    Resources []charmresource.Resource

AddPendingResourcesArgs holds the arguments to AddPendingResources().

type Client Uses

type Client struct {
    // contains filtered or unexported fields

Client is the public client for the resources API facade.

func NewClient Uses

func NewClient(ctx context.Context, caller FacadeCaller, doer Doer, closer io.Closer) *Client

NewClient returns a new Client for the given raw API caller.

func (Client) AddPendingResources Uses

func (c Client) AddPendingResources(args AddPendingResourcesArgs) (pendingIDs []string, err error)

AddPendingResources sends the provided resource info up to Juju without making it available yet.

func (Client) ListResources Uses

func (c Client) ListResources(applications []string) ([]resource.ApplicationResources, error)

ListResources calls the ListResources API server method with the given application names.

func (Client) Upload Uses

func (c Client) Upload(application, name, filename string, reader io.ReadSeeker) error

Upload sends the provided resource blob up to Juju.

func (Client) UploadPendingResource Uses

func (c Client) UploadPendingResource(applicationID string, res charmresource.Resource, filename string, reader io.ReadSeeker) (pendingID string, err error)

UploadPendingResource sends the provided resource blob up to Juju and makes it available.

type Doer Uses

type Doer interface {
    Do(ctx context.Context, req *http.Request, resp interface{}) error


type FacadeCaller Uses

type FacadeCaller interface {
    FacadeCall(request string, params, response interface{}) error

FacadeCaller has the api/base.FacadeCaller methods needed for the component.

Package client imports 13 packages (graph). Updated 2020-08-06. Refresh now. Tools for package owners.