Documentation ¶
Overview ¶
Package api defines the plan management API.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HTTPClient ¶
func HTTPClient(c httpClient) func(h *client) error
HTTPClient returns a function that sets the http client used by the API (e.g. if we want to use TLS).
func NewPlanClient ¶
func NewPlanClient(url string, options ...ClientOption) (*client, error)
NewPlanClient returns a new client for plan management.
Types ¶
type ClientOption ¶
type ClientOption func(h *client) error
ClientOption defines a function which configures a Client.
type PlanClient ¶
type PlanClient interface { // Save uploads a new plan to the plans service. Save(planURL, definition string) (*wireformat.Plan, error) // AddCharm associates a charm with the specified plan. AddCharm(planURL string, charmURL string, isDefault bool) error // Get returns a slice of Plans that match the stated criteria, namely // the plan URL, owner of the plan or an associated charm url. Get(planURL string) ([]wireformat.Plan, error) // GetDefaultPlan returns the default plan associated with the charm. GetDefaultPlan(charmURL string) (*wireformat.Plan, error) // GetPlansForCharm returns the plans associated with the charm. GetPlansForCharm(charmURL string) ([]wireformat.Plan, error) // Suspend suspends the plan for specified charms. Suspend(planURL string, all bool, charmURLs ...string) error // Resume resumes the plan for specified charms. Resume(planURL string, all bool, charmURLs ...string) error // Release releases the specified plan. Release(planURL string) (*wireformat.Plan, error) // GetPlanDetails returns detailed information about a plan. GetPlanDetails(planURL string) (*wireformat.PlanDetails, error) // GetPlanRevisions returns all revision of a plan. GetPlanRevisions(planURL string) ([]wireformat.Plan, error) // Authorize returns the authorization macaroon for the specified environment, charm url and service name. Authorize(environmentUUID, charmURL, serviceName, plan string) (*macaroon.Macaroon, error) // AuthorizeReseller returns the reseller authorization macaroon for the specified application. AuthorizeReseller(plan, charm, application, applicationOwner, applicationUser string) (*macaroon.Macaroon, error) // GetAuthorizations returns a slice of Authorizations that match the // criteria specified in the query. GetAuthorizations(query wireformat.AuthorizationQuery) ([]wireformat.Authorization, error) // GetResellerAuthorizations retuns a slice of reseller Authorizations. GetResellerAuthorizations(query wireformat.ResellerAuthorizationQuery) ([]wireformat.ResellerAuthorization, error) }
PlanClient defines the interface available to clients of the plan api.
Directories ¶
Path | Synopsis |
---|---|
wireformat package contains wireformat structs intended for plan management API.
|
wireformat package contains wireformat structs intended for plan management API. |
Click to show internal directories.
Click to hide internal directories.