bundlechanges

package module
v0.0.0-...-6791af0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 20, 2016 License: LGPL-3.0 Imports: 5 Imported by: 0

README

Juju Bundle Changes

A Go library to generate the list of changes required to deploy a bundle.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddApplicationChange

type AddApplicationChange struct {

	// Params holds parameters for adding an application.
	Params AddApplicationParams
	// contains filtered or unexported fields
}

AddApplicationChange holds a change for deploying a Juju application.

func (*AddApplicationChange) GUIArgs

func (ch *AddApplicationChange) GUIArgs() []interface{}

GUIArgs implements Change.GUIArgs.

func (*AddApplicationChange) Id

func (ch *AddApplicationChange) Id() string

Id implements Change.Id.

func (*AddApplicationChange) Method

func (ch *AddApplicationChange) Method() string

Method implements Change.Method.

func (*AddApplicationChange) Requires

func (ch *AddApplicationChange) Requires() []string

Requires implements Change.Requires.

type AddApplicationParams

type AddApplicationParams struct {
	// Charm holds the URL of the charm to be used to deploy this application.
	Charm string
	// Series holds the series of the application to be deployed
	// if the charm default is not sufficient.
	Series string
	// Application holds the application name.
	Application string
	// Options holds application options.
	Options map[string]interface{}
	// Constraints holds the optional application constraints.
	Constraints string
	// Storage holds the optional storage constraints.
	Storage map[string]string
	// EndpointBindings holds the optional endpoint bindings
	EndpointBindings map[string]string
	// Resources identifies the revision to use for each resource
	// of the application's charm.
	Resources map[string]int
}

AddApplicationParams holds parameters for deploying a Juju application.

type AddCharmChange

type AddCharmChange struct {

	// Params holds parameters for adding a charm.
	Params AddCharmParams
	// contains filtered or unexported fields
}

AddCharmChange holds a change for adding a charm to the environment.

func (*AddCharmChange) GUIArgs

func (ch *AddCharmChange) GUIArgs() []interface{}

GUIArgs implements Change.GUIArgs.

func (*AddCharmChange) Id

func (ch *AddCharmChange) Id() string

Id implements Change.Id.

func (*AddCharmChange) Method

func (ch *AddCharmChange) Method() string

Method implements Change.Method.

func (*AddCharmChange) Requires

func (ch *AddCharmChange) Requires() []string

Requires implements Change.Requires.

type AddCharmParams

type AddCharmParams struct {
	// Charm holds the URL of the charm to be added.
	Charm string
	// Series holds the series of the charm to be added
	// if the charm default is not sufficient.
	Series string
}

AddCharmParams holds parameters for adding a charm to the environment.

type AddMachineChange

type AddMachineChange struct {

	// Params holds parameters for adding a machine.
	Params AddMachineParams
	// contains filtered or unexported fields
}

AddMachineChange holds a change for adding a machine or container.

func (*AddMachineChange) GUIArgs

func (ch *AddMachineChange) GUIArgs() []interface{}

GUIArgs implements Change.GUIArgs.

func (*AddMachineChange) Id

func (ch *AddMachineChange) Id() string

Id implements Change.Id.

func (*AddMachineChange) Method

func (ch *AddMachineChange) Method() string

Method implements Change.Method.

func (*AddMachineChange) Requires

func (ch *AddMachineChange) Requires() []string

Requires implements Change.Requires.

type AddMachineOptions

type AddMachineOptions struct {
	// Series holds the machine OS series.
	Series string `json:"series,omitempty"`
	// Constraints holds the machine constraints.
	Constraints string `json:"constraints,omitempty"`
	// ContainerType holds the machine container type (like "lxc" or "kvm").
	ContainerType string `json:"containerType,omitempty"`
	// ParentId holds the id of the parent machine.
	ParentId string `json:"parentId,omitempty"`
}

AddMachineOptions holds GUI options for adding a machine or container.

type AddMachineParams

type AddMachineParams struct {
	// Series holds the optional machine OS series.
	Series string
	// Constraints holds the optional machine constraints.
	Constraints string
	// ContainerType optionally holds the type of the container (for instance
	// ""lxc" or kvm"). It is not specified for top level machines.
	ContainerType string
	// ParentId optionally holds a placeholder pointing to another machine
	// change or to a unit change. This value is only specified in the case
	// this machine is a container, in which case also ContainerType is set.
	ParentId string
}

AddMachineParams holds parameters for adding a machine or container.

type AddRelationChange

type AddRelationChange struct {

	// Params holds parameters for adding a relation.
	Params AddRelationParams
	// contains filtered or unexported fields
}

AddRelationChange holds a change for adding a relation between two applications.

func (*AddRelationChange) GUIArgs

func (ch *AddRelationChange) GUIArgs() []interface{}

GUIArgs implements Change.GUIArgs.

func (*AddRelationChange) Id

func (ch *AddRelationChange) Id() string

Id implements Change.Id.

func (*AddRelationChange) Method

func (ch *AddRelationChange) Method() string

Method implements Change.Method.

func (*AddRelationChange) Requires

func (ch *AddRelationChange) Requires() []string

Requires implements Change.Requires.

type AddRelationParams

type AddRelationParams struct {
	// Endpoint1 and Endpoint2 hold relation endpoints in the
	// "application:interface" form, where the application is always a placeholder
	// pointing to an application change, and the interface is optional. Examples
	// are "$deploy-42:web" or just "$deploy-42".
	Endpoint1 string
	Endpoint2 string
}

AddRelationParams holds parameters for adding a relation between two applications.

type AddUnitChange

type AddUnitChange struct {

	// Params holds parameters for adding a unit.
	Params AddUnitParams
	// contains filtered or unexported fields
}

AddUnitChange holds a change for adding an application unit.

func (*AddUnitChange) GUIArgs

func (ch *AddUnitChange) GUIArgs() []interface{}

GUIArgs implements Change.GUIArgs.

func (*AddUnitChange) Id

func (ch *AddUnitChange) Id() string

Id implements Change.Id.

func (*AddUnitChange) Method

func (ch *AddUnitChange) Method() string

Method implements Change.Method.

func (*AddUnitChange) Requires

func (ch *AddUnitChange) Requires() []string

Requires implements Change.Requires.

type AddUnitParams

type AddUnitParams struct {
	// Application holds the application placeholder name for which a unit is added.
	Application string
	// To holds the optional location where to add the unit, as a placeholder
	// pointing to another unit change or to a machine change.
	To string
}

AddUnitParams holds parameters for adding an application unit.

type Change

type Change interface {
	// Id returns the unique identifier for this change.
	Id() string
	// Requires returns the ids of all the changes that must
	// be applied before this one.
	Requires() []string
	// Method returns the action to be performed to apply this change.
	Method() string
	// GUIArgs returns positional arguments to pass to the method, suitable for
	// being JSON-serialized and sent to the Juju GUI.
	GUIArgs() []interface{}
	// contains filtered or unexported methods
}

Change holds a single change required to deploy a bundle.

func FromData

func FromData(data *charm.BundleData) []Change

FromData generates and returns the list of changes required to deploy the given bundle data. The changes are sorted by requirements, so that they can be applied in order. The bundle data is assumed to be already verified.

type EntityType

type EntityType string

EntityType holds entity types ("application" or "machine").

const (
	ApplicationType EntityType = "application"
	MachineType     EntityType = "machine"
)

type ExposeChange

type ExposeChange struct {

	// Params holds parameters for exposing an application.
	Params ExposeParams
	// contains filtered or unexported fields
}

ExposeChange holds a change for exposing an application.

func (*ExposeChange) GUIArgs

func (ch *ExposeChange) GUIArgs() []interface{}

GUIArgs implements Change.GUIArgs.

func (*ExposeChange) Id

func (ch *ExposeChange) Id() string

Id implements Change.Id.

func (*ExposeChange) Method

func (ch *ExposeChange) Method() string

Method implements Change.Method.

func (*ExposeChange) Requires

func (ch *ExposeChange) Requires() []string

Requires implements Change.Requires.

type ExposeParams

type ExposeParams struct {
	// Application holds the placeholder name of the application that must be exposed.
	Application string
}

ExposeParams holds parameters for exposing an application.

type SetAnnotationsChange

type SetAnnotationsChange struct {

	// Params holds parameters for setting annotations.
	Params SetAnnotationsParams
	// contains filtered or unexported fields
}

SetAnnotationsChange holds a change for setting application and machine annotations.

func (*SetAnnotationsChange) GUIArgs

func (ch *SetAnnotationsChange) GUIArgs() []interface{}

GUIArgs implements Change.GUIArgs.

func (*SetAnnotationsChange) Id

func (ch *SetAnnotationsChange) Id() string

Id implements Change.Id.

func (*SetAnnotationsChange) Method

func (ch *SetAnnotationsChange) Method() string

Method implements Change.Method.

func (*SetAnnotationsChange) Requires

func (ch *SetAnnotationsChange) Requires() []string

Requires implements Change.Requires.

type SetAnnotationsParams

type SetAnnotationsParams struct {
	// Id is the placeholder for the application or machine change corresponding to
	// the entity to be annotated.
	Id string
	// EntityType holds the type of the entity, "application" or "machine".
	EntityType EntityType
	// Annotations holds the annotations as key/value pairs.
	Annotations map[string]string
}

SetAnnotationsParams holds parameters for setting annotations.

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL