Documentation
¶
Index ¶
- func NewObjectStore(c *gc.C, modelUUID string, metadataService internalobjectstore.MetadataService, ...) objectstore.ObjectStore
- type ApplicationParams
- type CharmParams
- type Factory
- func (factory *Factory) MakeApplication(c *gc.C, params *ApplicationParams) *state.Application
- func (factory *Factory) MakeApplicationReturningPassword(c *gc.C, params *ApplicationParams) (*state.Application, string)
- func (factory *Factory) MakeCAASModel(c *gc.C, params *ModelParams) *state.State
- func (factory *Factory) MakeCharm(c *gc.C, params *CharmParams) state.CharmRefFull
- func (factory *Factory) MakeMachine(c *gc.C, params *MachineParams) *state.Machine
- func (factory *Factory) MakeMachineNested(c *gc.C, parentId string, params *MachineParams) *state.Machine
- func (factory *Factory) MakeMachineReturningPassword(c *gc.C, params *MachineParams) (*state.Machine, string)
- func (factory *Factory) MakeModel(c *gc.C, params *ModelParams) *state.State
- func (factory *Factory) MakeRelation(c *gc.C, params *RelationParams) *state.Relation
- func (factory *Factory) MakeUnit(c *gc.C, params *UnitParams) *state.Unit
- func (factory *Factory) MakeUnitReturningPassword(c *gc.C, params *UnitParams) (*state.Unit, string)
- func (factory *Factory) MakeUnprovisionedMachineReturningPassword(c *gc.C, params *MachineParams) (*state.Machine, string)
- func (*Factory) RandomSuffix(prefix string) string
- func (f *Factory) WithApplicationService(s *applicationservice.WatchableService) *Factory
- type MachineParams
- type ModelParams
- type RelationParams
- type SpaceParams
- type UnitParams
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewObjectStore ¶
func NewObjectStore(c *gc.C, modelUUID string, metadataService internalobjectstore.MetadataService, claimer internalobjectstore.Claimer) objectstore.ObjectStore
Types ¶
type ApplicationParams ¶
type ApplicationParams struct { Name string Charm state.CharmRefFull CharmURL string CharmOrigin *state.CharmOrigin Status *status.StatusInfo ApplicationConfig map[string]interface{} ApplicationConfigFields configschema.Fields CharmConfig map[string]interface{} Storage map[string]state.StorageConstraints Constraints constraints.Value EndpointBindings map[string]string Password string Placement []*instance.Placement DesiredScale int }
ApplicationParams is used when specifying parameters for a new application.
type CharmParams ¶
type CharmParams struct { Name string Series string Revision string Architecture string URL string }
CharmParams defines the parameters for creating a charm.
type Factory ¶
type Factory struct {
// contains filtered or unexported fields
}
func NewFactory ¶
func (*Factory) MakeApplication ¶
func (factory *Factory) MakeApplication(c *gc.C, params *ApplicationParams) *state.Application
MakeApplication creates an application with the specified parameters, substituting sane defaults for missing values. If params is not specified, defaults are used.
func (*Factory) MakeApplicationReturningPassword ¶
func (factory *Factory) MakeApplicationReturningPassword(c *gc.C, params *ApplicationParams) (*state.Application, string)
MakeApplicationReturningPassword creates an application with the specified parameters, substituting sane defaults for missing values. If params is not specified, defaults are used. It returns the application and its password.
func (*Factory) MakeCAASModel ¶
MakeCAASModel creates a CAAS model with specified params, filling in sane defaults for missing values. If params is nil, defaults are used for all values.
func (*Factory) MakeCharm ¶
func (factory *Factory) MakeCharm(c *gc.C, params *CharmParams) state.CharmRefFull
MakeCharm creates a charm with the values specified in params. Sensible default values are substituted for missing ones. Supported charms depend on the charm/testing package. Currently supported charms:
all-hooks, category, dummy, logging, monitoring, mysql, mysql-alternative, riak, terracotta, upgrade1, upgrade2, varnish, varnish-alternative, wordpress.
If params is not specified, defaults are used.
func (*Factory) MakeMachine ¶
MakeMachine will add a machine with values defined in params. For some values in params, if they are missing, some meaningful empty values will be set. If params is not specified, defaults are used.
func (*Factory) MakeMachineNested ¶
func (factory *Factory) MakeMachineNested(c *gc.C, parentId string, params *MachineParams) *state.Machine
MakeMachineNested will make a machine nested in the machine with ID given.
func (*Factory) MakeMachineReturningPassword ¶
func (factory *Factory) MakeMachineReturningPassword(c *gc.C, params *MachineParams) (*state.Machine, string)
MakeMachineReturningPassword will add a machine with values defined in params. For some values in params, if they are missing, some meaningful empty values will be set. If params is not specified, defaults are used. The machine and its password are returned.
func (*Factory) MakeModel ¶
MakeModel creates an model with specified params, filling in sane defaults for missing values. If params is nil, defaults are used for all values.
By default the new model shares the same owner as the calling Factory's model. TODO(ericclaudejones) MakeModel should return the model itself rather than the state.
func (*Factory) MakeRelation ¶
MakeRelation create a relation with specified params, filling in sane defaults for missing values. If params is not specified, defaults are used.
func (*Factory) MakeUnit ¶
MakeUnit creates an application unit with specified params, filling in sane defaults for missing values. If params is not specified, defaults are used.
If the unit is being added to an IAAS model, then it will be assigned to a machine.
func (*Factory) MakeUnitReturningPassword ¶
func (factory *Factory) MakeUnitReturningPassword(c *gc.C, params *UnitParams) (*state.Unit, string)
MakeUnitReturningPassword creates an application unit with specified params, filling in sane defaults for missing values. If params is not specified, defaults are used. The unit and its password are returned.
If the unit is being added to an IAAS model, then it will be assigned to a machine.
func (*Factory) MakeUnprovisionedMachineReturningPassword ¶
func (factory *Factory) MakeUnprovisionedMachineReturningPassword(c *gc.C, params *MachineParams) (*state.Machine, string)
MakeUnprovisionedMachineReturningPassword will add a machine with values defined in params. For some values in params, if they are missing, some meaningful empty values will be set. If params is not specified, defaults are used. The machine and its password are returned; the machine will not be provisioned.
func (*Factory) RandomSuffix ¶
RandomSuffix adds a random 5 character suffix to the presented string.
func (*Factory) WithApplicationService ¶
func (f *Factory) WithApplicationService(s *applicationservice.WatchableService) *Factory
WithApplicationService configures the factory to use the specified application service.
type MachineParams ¶
type MachineParams struct { Base state.Base Jobs []state.MachineJob Password string Nonce string Constraints constraints.Value InstanceId instance.Id DisplayName string Characteristics *instance.HardwareCharacteristics Addresses network.SpaceAddresses Volumes []state.HostVolumeParams Filesystems []state.HostFilesystemParams }
MachineParams are for creating a machine.
type ModelParams ¶
type RelationParams ¶
RelationParams are used to create relations.
type UnitParams ¶
type UnitParams struct { Application *state.Application Machine *state.Machine Password string SetCharmURL bool Status *status.StatusInfo Constraints constraints.Value }
UnitParams are used to create units.