Documentation ¶
Overview ¶
The description package defines the structure and representation and serialisation of models to facilitate the import and export of models from different controllers.
Index ¶
- Constants
- func Serialize(model Model) ([]byte, error)
- type Action
- type ActionArgs
- type ActionMessage
- type Address
- type AddressArgs
- type AgentTools
- type AgentToolsArgs
- type Annotations_
- type Application
- type ApplicationArgs
- type ApplicationOffer
- type ApplicationOfferArgs
- type BlockDevice
- type BlockDeviceArgs
- type ByName
- type CharmAction
- type CharmActions
- type CharmActionsArgs
- type CharmConfig
- type CharmConfigs
- type CharmConfigsArgs
- type CharmManifest
- type CharmManifestArgs
- type CharmManifestBase
- type CharmMetadata
- type CharmMetadataArgs
- type CharmMetadataContainer
- type CharmMetadataContainerMount
- type CharmMetadataDevice
- type CharmMetadataPayload
- type CharmMetadataRelation
- type CharmMetadataResource
- type CharmMetadataStorage
- type CharmOrigin
- type CharmOriginArgs
- type CloudContainer
- type CloudContainerArgs
- type CloudCredential
- type CloudCredentialArgs
- type CloudImageMetadata
- type CloudImageMetadataArgs
- type CloudInstance
- type CloudInstanceArgs
- type CloudService
- type CloudServiceArgs
- type Constraints
- type ConstraintsArgs
- type Endpoint
- type EndpointArgs
- type ExposedEndpoint
- type ExposedEndpointArgs
- type ExternalController
- type ExternalControllerArgs
- type Filesystem
- type FilesystemArgs
- type FilesystemAttachment
- type FilesystemAttachmentArgs
- type FirewallRule
- type FirewallRuleArgs
- type HasAnnotations
- type HasConstraints
- type HasModificationStatus
- type HasOperatorStatus
- type HasStatus
- type HasStatusHistory
- type IPAddress
- type IPAddressArgs
- type LinkLayerDevice
- type LinkLayerDeviceArgs
- type Machine
- type MachineArgs
- type MeterStatus
- type Model
- type ModelArgs
- type OfferConnection
- type OfferConnectionArgs
- type OpenedPortRangeArgs
- type OpenedPorts
- type OpenedPortsArgs
- type Operation
- type OperationArgs
- type Payload
- type PayloadArgs
- type PortRange
- type PortRangeArgs
- type PortRanges
- type ProvisioningState
- type ProvisioningStateArgs
- type Relation
- type RelationArgs
- type RelationNetwork
- type RelationNetworkArgs
- type RemoteApplication
- type RemoteApplicationArgs
- type RemoteEndpoint
- type RemoteEndpointArgs
- type RemoteEntity
- type RemoteEntityArgs
- type RemoteSecret
- type RemoteSecretArgs
- type RemoteSpace
- type RemoteSpaceArgs
- type Resource
- type ResourceArgs
- type ResourceRevision
- type ResourceRevisionArgs
- type SLA
- type SSHHostKey
- type SSHHostKeyArgs
- type Secret
- type SecretAccess
- type SecretAccessArgs
- type SecretArgs
- type SecretConsumer
- type SecretConsumerArgs
- type SecretRemoteConsumer
- type SecretRemoteConsumerArgs
- type SecretRevision
- type SecretRevisionArgs
- type SecretValueRef
- type SecretValueRefArgs
- type Space
- type SpaceArgs
- type Status
- type StatusArgs
- type StatusHistory_
- type StatusPoint_
- type Storage
- type StorageArgs
- type StorageDirective
- type StorageDirectiveArgs
- type StorageInstanceConstraints
- type StoragePool
- type StoragePoolArgs
- type Subnet
- type SubnetArgs
- type Unit
- type UnitArgs
- type UnitPortRange
- type UnitPortRanges
- type UnitResource
- type UnitResourceArgs
- type UnitStateGetSetter
- type User
- type UserArgs
- type UserAuthorizedKeys
- type UserAuthorizedKeysArgs
- type Volume
- type VolumeArgs
- type VolumeAttachment
- type VolumeAttachmentArgs
- type VolumeAttachmentPlan
- type VolumeAttachmentPlanArgs
- type VolumePlanInfo
Constants ¶
const ( // IAAS is the type for IAAS models. IAAS = "iaas" // CAAS is the type for CAAS models. CAAS = "caas" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Action ¶
type Action interface { Id() string Receiver() string Name() string Operation() string Parameters() map[string]interface{} Parallel() bool ExecutionGroup() string Enqueued() time.Time Started() time.Time Completed() time.Time Results() map[string]interface{} Status() string Message() string Logs() []ActionMessage }
Action represents an action.
type ActionArgs ¶
type ActionArgs struct { Id string Receiver string Name string Operation string Parameters map[string]interface{} Parallel bool ExecutionGroup string Enqueued time.Time Started time.Time Completed time.Time Status string Message string Results map[string]interface{} Messages []ActionMessage }
ActionArgs is an argument struct used to create a new internal action type that supports the Action interface.
type ActionMessage ¶
ActionMessage represents an action log message.
type Address ¶
type Address interface { Value() string Type() string Scope() string Origin() string SpaceID() string }
Address represents an IP Address of some form.
type AddressArgs ¶
AddressArgs is an argument struct used to create a new internal address type that supports the Address interface.
type AgentTools ¶
AgentTools represent the version and related binary file that the machine and unit agents are using.
type AgentToolsArgs ¶
AgentToolsArgs is an argument struct used to add information about the tools the agent is using to a Machine.
type Annotations_ ¶
Instead of copy / pasting the Annotations, SetAnnotations, and the import three lines into every entity that has annotations, the Annotations_ helper type is provided for use in composition. This type is composed without a name so the methods get promoted so they satisfy the HasAnnotations interface.
NOTE(mjs) - The type is exported due to a limitation with go-yaml under 1.6. Once that's fixed it should be possible to make it private again.
NOTE(mjs) - The trailing underscore on the type name is to avoid collisions between the type name and the Annotations method. The underscore can go once the type becomes private again (revert to "annotations").
func (*Annotations_) Annotations ¶
func (a *Annotations_) Annotations() map[string]string
Annotations implements HasAnnotations.
func (*Annotations_) SetAnnotations ¶
func (a *Annotations_) SetAnnotations(annotations map[string]string)
SetAnnotations implements HasAnnotations.
type Application ¶
type Application interface { HasAnnotations HasConstraints HasOperatorStatus HasStatus HasStatusHistory Tag() names.ApplicationTag Name() string Type() string Subordinate() bool CharmURL() string Channel() string CharmModifiedVersion() int ForceCharm() bool MinUnits() int Exposed() bool ExposedEndpoints() map[string]ExposedEndpoint PasswordHash() string PodSpec() string DesiredScale() int Placement() string HasResources() bool CloudService() CloudService SetCloudService(CloudServiceArgs) EndpointBindings() map[string]string CharmConfig() map[string]interface{} ApplicationConfig() map[string]interface{} Leader() string LeadershipSettings() map[string]interface{} MetricsCredentials() []byte StorageDirectives() map[string]StorageDirective Resources() []Resource AddResource(ResourceArgs) Resource Units() []Unit AddUnit(UnitArgs) Unit CharmOrigin() CharmOrigin SetCharmOrigin(CharmOriginArgs) CharmMetadata() CharmMetadata SetCharmMetadata(CharmMetadataArgs) CharmManifest() CharmManifest SetCharmManifest(CharmManifestArgs) CharmActions() CharmActions SetCharmActions(CharmActionsArgs) CharmConfigs() CharmConfigs SetCharmConfigs(CharmConfigsArgs) Tools() AgentTools SetTools(AgentToolsArgs) Offers() []ApplicationOffer AddOffer(ApplicationOfferArgs) ApplicationOffer Validate() error OpenedPortRanges() PortRanges AddOpenedPortRange(OpenedPortRangeArgs) ProvisioningState() ProvisioningState }
Application represents a deployed charm in a model.
type ApplicationArgs ¶
type ApplicationArgs struct { Tag names.ApplicationTag Type string // Series obsolete from v9. Retained for tests. Series string Subordinate bool CharmURL string Channel string CharmModifiedVersion int ForceCharm bool PasswordHash string PodSpec string Placement string HasResources bool DesiredScale int CloudService *CloudServiceArgs MinUnits int Exposed bool ExposedEndpoints map[string]ExposedEndpointArgs EndpointBindings map[string]string ApplicationConfig map[string]interface{} CharmConfig map[string]interface{} Leader string LeadershipSettings map[string]interface{} StorageDirectives map[string]StorageDirectiveArgs MetricsCredentials []byte ProvisioningState *ProvisioningStateArgs }
ApplicationArgs is an argument struct used to add an application to the Model.
type ApplicationOffer ¶
type ApplicationOffer interface { OfferUUID() string OfferName() string Endpoints() map[string]string ACL() map[string]string ApplicationName() string ApplicationDescription() string }
ApplicationOffer represents an offer for a an application's endpoints.
type ApplicationOfferArgs ¶
type ApplicationOfferArgs struct { OfferUUID string OfferName string Endpoints map[string]string ACL map[string]string ApplicationName string ApplicationDescription string }
ApplicationOfferArgs is an argument struct used to instanciate a new applicationOffer instance that implements ApplicationOffer.
type BlockDevice ¶
type BlockDevice interface { Name() string Links() []string Label() string UUID() string HardwareID() string SerialID() string WWN() string BusAddress() string Size() uint64 FilesystemType() string InUse() bool MountPoint() string }
BlockDevice represents a block device on a machine.
type BlockDeviceArgs ¶
type BlockDeviceArgs struct { Name string Links []string Label string UUID string HardwareID string WWN string BusAddress string SerialID string Size uint64 FilesystemType string InUse bool MountPoint string }
BlockDeviceArgs is an argument struct used to add a block device to a Machine.
type ByName ¶
type ByName []User
ByName is a sorting implementation over the UserTag lexicographically, which aligns to sort.Interface
type CharmAction ¶
type CharmAction interface { Description() string Parallel() bool ExecutionGroup() string Parameters() map[string]interface{} }
CharmAction represents an action in the metadata of a charm.
type CharmActions ¶
type CharmActions interface {
Actions() map[string]CharmAction
}
CharmActions represents the actions of a charm.
type CharmActionsArgs ¶
type CharmActionsArgs struct {
Actions map[string]CharmAction
}
type CharmConfig ¶
CharmConfig represents the configuration of a charm.
type CharmConfigs ¶
type CharmConfigs interface {
Configs() map[string]CharmConfig
}
CharmConfigs represents the configuration of a charm.
type CharmConfigsArgs ¶
type CharmConfigsArgs struct {
Configs map[string]CharmConfig
}
type CharmManifest ¶
type CharmManifest interface {
Bases() []CharmManifestBase
}
CharmManifest represents the manifest of a charm.
type CharmManifestArgs ¶
type CharmManifestArgs struct {
Bases []CharmManifestBase
}
CharmManifestArgs is an argument struct used to create a new CharmManifest.
type CharmManifestBase ¶
CharmManifestBase represents the metadata of a charm base.
type CharmMetadata ¶
type CharmMetadata interface { Name() string Summary() string Description() string Subordinate() bool MinJujuVersion() string RunAs() string Assumes() string Provides() map[string]CharmMetadataRelation Requires() map[string]CharmMetadataRelation Peers() map[string]CharmMetadataRelation ExtraBindings() map[string]string Categories() []string Tags() []string Storage() map[string]CharmMetadataStorage Devices() map[string]CharmMetadataDevice Payloads() map[string]CharmMetadataPayload Resources() map[string]CharmMetadataResource Terms() []string Containers() map[string]CharmMetadataContainer LXDProfile() string }
CharmMetadata represents the metadata of a charm.
type CharmMetadataArgs ¶
type CharmMetadataArgs struct { Name string Summary string Description string Subordinate bool MinJujuVersion string RunAs string Assumes string Provides map[string]CharmMetadataRelation Peers map[string]CharmMetadataRelation Requires map[string]CharmMetadataRelation ExtraBindings map[string]string Categories []string Tags []string Storage map[string]CharmMetadataStorage Devices map[string]CharmMetadataDevice Payloads map[string]CharmMetadataPayload Resources map[string]CharmMetadataResource Terms []string Containers map[string]CharmMetadataContainer LXDProfile string }
CharmMetadataArgs is an argument struct used to create a new CharmMetadata.
type CharmMetadataContainer ¶
type CharmMetadataContainer interface { Resource() string Mounts() []CharmMetadataContainerMount Uid() *int Gid() *int }
CharmMetadataContainer represents a container in the metadata of a charm.
type CharmMetadataContainerMount ¶
CharmMetadataContainerMount represents a mount in the metadata of a charm container.
type CharmMetadataDevice ¶
type CharmMetadataDevice interface { Name() string Description() string Type() string CountMin() int CountMax() int }
CharmMetadataDevice represents a device in the metadata of a charm.
type CharmMetadataPayload ¶
CharmMetadataPayload represents a payload in the metadata of a charm.
type CharmMetadataRelation ¶
type CharmMetadataRelation interface { Name() string Role() string Interface() string Optional() bool Limit() int Scope() string }
CharmMetadataRelation represents a relation in the metadata of a charm.
type CharmMetadataResource ¶
type CharmMetadataResource interface { Name() string Type() string Path() string Description() string }
CharmMetadataResource represents a resource in the metadata of a charm.
type CharmMetadataStorage ¶
type CharmMetadataStorage interface { Name() string Description() string Type() string Readonly() bool CountMin() int CountMax() int MinimumSize() int Location() string Properties() []string }
CharmMetadataStorage represents a storage in the metadata of a charm.
type CharmOrigin ¶
type CharmOrigin interface { Source() string ID() string Hash() string Revision() int Channel() string Platform() string }
CharmOrigin represents a charm source, where the charm originates from to help support multiple store locations.
type CharmOriginArgs ¶
type CharmOriginArgs struct { Source string ID string Hash string Revision int Channel string Platform string }
CharmOriginArgs is an argument struct used to add information about the charm origin.
type CloudContainer ¶
CloudContainer represents the state of a CAAS container, eg pod.
type CloudContainerArgs ¶
type CloudContainerArgs struct { ProviderId string Address AddressArgs Ports []string }
CloudContainerArgs is an argument struct used to create a new internal cloudContainer type that supports the CloudContainer interface.
type CloudCredential ¶
type CloudCredential interface { Owner() string Cloud() string Name() string AuthType() string Attributes() map[string]string }
CloudCredential represents the current cloud credential for the model.
type CloudCredentialArgs ¶
type CloudCredentialArgs struct { Owner names.UserTag Cloud names.CloudTag Name string AuthType string Attributes map[string]string }
CloudCredentialArgs is an argument struct used to create a new internal cloudCredential type that supports the CloudCredential interface.
type CloudImageMetadata ¶
type CloudImageMetadata interface { Stream() string Region() string Version() string Arch() string VirtType() string RootStorageType() string RootStorageSize() (uint64, bool) DateCreated() int64 Source() string Priority() int ImageId() string ExpireAt() *time.Time }
CloudImageMetadata represents an IP cloudimagemetadata.
type CloudImageMetadataArgs ¶
type CloudImageMetadataArgs struct { Stream string Region string Version string Arch string VirtType string RootStorageType string RootStorageSize *uint64 DateCreated int64 Source string Priority int ImageId string ExpireAt *time.Time }
CloudImageMetadataArgs is an argument struct used to create a new internal cloudimagemetadata type that supports the CloudImageMetadata interface.
type CloudInstance ¶
type CloudInstance interface { HasStatus HasStatusHistory HasModificationStatus InstanceId() string DisplayName() string Architecture() string Memory() uint64 RootDisk() uint64 RootDiskSource() string CpuCores() uint64 CpuPower() uint64 Tags() []string AvailabilityZone() string VirtType() string CharmProfiles() []string Validate() error }
CloudInstance holds information particular to a machine instance in a cloud.
type CloudInstanceArgs ¶
type CloudInstanceArgs struct { InstanceId string DisplayName string Architecture string Memory uint64 RootDisk uint64 RootDiskSource string CpuCores uint64 CpuPower uint64 Tags []string AvailabilityZone string VirtType string CharmProfiles []string }
CloudInstanceArgs is an argument struct used to add information about the cloud instance to a Machine.
type CloudService ¶
type CloudService interface { ProviderId() string Addresses() []Address SetAddresses(addresses []AddressArgs) }
CloudService represents the state of a CAAS service.
type CloudServiceArgs ¶
type CloudServiceArgs struct { ProviderId string Addresses []AddressArgs }
CloudServiceArgs is an argument struct used to create a new internal cloudService type that supports the cloudService interface.
type Constraints ¶
type Constraints interface { AllocatePublicIP() bool Architecture() string Container() string CpuCores() uint64 CpuPower() uint64 ImageID() string InstanceType() string Memory() uint64 RootDisk() uint64 RootDiskSource() string Spaces() []string Tags() []string Zones() []string VirtType() string }
Constraints holds information about particular deployment constraints for entities.
type ConstraintsArgs ¶
type ConstraintsArgs struct { AllocatePublicIP bool Architecture string Container string CpuCores uint64 CpuPower uint64 ImageID string InstanceType string Memory uint64 RootDisk uint64 RootDiskSource string Spaces []string Tags []string Zones []string VirtType string }
ConstraintsArgs is an argument struct to construct Constraints.
type Endpoint ¶
type Endpoint interface { ApplicationName() string Name() string // Role, Interface, Optional, Limit, and Scope should all be available // through the Charm associated with the Application. There is no real need // for this information to be denormalised like this. However, for now, // since the import may well take place before the charms have been loaded // into the model, we'll send this information over. Role() string Interface() string Optional() bool Limit() int Scope() string // UnitCount returns the number of units the endpoint has settings for. UnitCount() int AllSettings() map[string]map[string]interface{} Settings(unitName string) map[string]interface{} SetUnitSettings(unitName string, settings map[string]interface{}) ApplicationSettings() map[string]interface{} SetApplicationSettings(settings map[string]interface{}) }
Endpoint represents one end of a relation. A named endpoint provided by the charm that is deployed for the application.
type EndpointArgs ¶
type EndpointArgs struct { ApplicationName string Name string Role string Interface string Optional bool Limit int Scope string }
EndpointArgs is an argument struct used to specify a relation.
type ExposedEndpoint ¶
ExposedEndpoint encapsulates the details about the CIDRs and/or spaces that should be able to access ports opened by the application for a particular endpoint once the application is exposed.
type ExposedEndpointArgs ¶
ExposedEndpointArgs is an argument struct used to create a new internal exposedEndpoint type that supports the ExposedEndpoint interface.
type ExternalController ¶
type ExternalController interface { ID() names.ControllerTag Alias() string Addrs() []string CACert() string Models() []string }
ExternalController represents the state of a controller hosting other models.
type ExternalControllerArgs ¶
type ExternalControllerArgs struct { Tag names.ControllerTag Alias string Addrs []string CACert string Models []string }
ExternalControllerArgs is an argument struct used to add a external controller to a model.
type Filesystem ¶
type Filesystem interface { HasStatus HasStatusHistory Tag() names.FilesystemTag Volume() names.VolumeTag Storage() names.StorageTag Provisioned() bool Size() uint64 Pool() string FilesystemID() string Attachments() []FilesystemAttachment AddAttachment(FilesystemAttachmentArgs) FilesystemAttachment }
Filesystem represents a filesystem in the model.
type FilesystemArgs ¶
type FilesystemArgs struct { Tag names.FilesystemTag Storage names.StorageTag Volume names.VolumeTag Provisioned bool Size uint64 Pool string FilesystemID string }
FilesystemArgs is an argument struct used to add a filesystem to the Model.
type FilesystemAttachment ¶
type FilesystemAttachment interface { Host() names.Tag Provisioned() bool MountPoint() string ReadOnly() bool }
FilesystemAttachment represents a filesystem attached to a machine.
type FilesystemAttachmentArgs ¶
type FilesystemAttachmentArgs struct { Host names.Tag Provisioned bool ReadOnly bool MountPoint string }
FilesystemAttachmentArgs is an argument struct used to add information about the cloud instance to a Filesystem.
type FirewallRule ¶
FirewallRule represents a firewall ruleset for a known service type, with whitelist CIDRs.
type FirewallRuleArgs ¶
FirewallRuleArgs is an argument struct used to add a firewall rule.
type HasAnnotations ¶
HasAnnotations defines the common methods for setting and getting annotations for the various entities.
type HasConstraints ¶
type HasConstraints interface { Constraints() Constraints SetConstraints(ConstraintsArgs) }
HasConstraints defines the common methods for setting and getting constraints for the various entities.
type HasModificationStatus ¶
type HasModificationStatus interface { ModificationStatus() Status // SetModificationStatus allows the changing of the modification status, of // a type, which is meant to highlight the changing to a machine instance // after it's been provisioned. SetModificationStatus(StatusArgs) }
HasModificationStatus defines the comment methods for setting and getting status entries for the various entities that are modified by actions. The modification changes, are changes that can alter the machine instance and setting the status can then be surfaced to the operator using the status. This is different from agent-status or machine-status, where the statuses tend to imply how the machine health is during a provisioning cycle or hook integration. Statuses that are expected: Applied, Error.
type HasOperatorStatus ¶
type HasOperatorStatus interface { SetOperatorStatus(StatusArgs) OperatorStatus() Status }
type HasStatus ¶
type HasStatus interface { Status() Status SetStatus(StatusArgs) }
HasStatus defines the common methods for setting and getting status entries for the various entities.
type HasStatusHistory ¶
type HasStatusHistory interface { StatusHistory() []Status SetStatusHistory([]StatusArgs) }
HasStatusHistory defines the common methods for setting and getting historical status entries for the various entities.
type IPAddress ¶
type IPAddress interface { ProviderID() string DeviceName() string MachineID() string SubnetCIDR() string ConfigMethod() string Value() string DNSServers() []string DNSSearchDomains() []string GatewayAddress() string IsDefaultGateway() bool ProviderNetworkID() string ProviderSubnetID() string Origin() string IsShadow() bool IsSecondary() bool }
IPAddress represents an IP address.
type IPAddressArgs ¶
type IPAddressArgs struct { ProviderID string DeviceName string MachineID string SubnetCIDR string ConfigMethod string Value string DNSServers []string DNSSearchDomains []string GatewayAddress string IsDefaultGateway bool ProviderNetworkID string ProviderSubnetID string Origin string IsShadow bool IsSecondary bool }
IPAddressArgs is an argument struct used to create a new internal ipaddress type that supports the IPAddress interface.
type LinkLayerDevice ¶
type LinkLayerDevice interface { Name() string MTU() uint ProviderID() string MachineID() string Type() string MACAddress() string IsAutoStart() bool IsUp() bool ParentName() string VirtualPortType() string }
LinkLayerDevice represents a link layer device.
type LinkLayerDeviceArgs ¶
type LinkLayerDeviceArgs struct { Name string MTU uint ProviderID string MachineID string Type string MACAddress string IsAutoStart bool IsUp bool ParentName string VirtualPortType string }
LinkLayerDeviceArgs is an argument struct used to create a new internal linklayerdevice type that supports the LinkLayerDevice interface.
type Machine ¶
type Machine interface { HasAnnotations HasConstraints HasStatus HasStatusHistory Id() string Tag() names.MachineTag Nonce() string PasswordHash() string Placement() string Base() string ContainerType() string Jobs() []string SupportedContainers() ([]string, bool) Instance() CloudInstance SetInstance(CloudInstanceArgs) // Life() string -- only transmit alive things? ProviderAddresses() []Address MachineAddresses() []Address SetAddresses(machine []AddressArgs, provider []AddressArgs) PreferredPublicAddress() Address PreferredPrivateAddress() Address SetPreferredAddresses(public AddressArgs, private AddressArgs) Tools() AgentTools SetTools(AgentToolsArgs) Containers() []Machine AddContainer(MachineArgs) Machine BlockDevices() []BlockDevice AddBlockDevice(BlockDeviceArgs) BlockDevice OpenedPortRanges() PortRanges AddOpenedPortRange(OpenedPortRangeArgs) Validate() error }
Machine represents an existing live machine or container running in the model.
type MachineArgs ¶
type MachineArgs struct { Id names.MachineTag Nonce string PasswordHash string Placement string Series string Base string ContainerType string Jobs []string // A null value means that we don't yet know which containers // are supported. An empty slice means 'no containers are supported'. SupportedContainers *[]string }
MachineArgs is an argument struct used to add a machine to the Model.
type MeterStatus ¶
type MeterStatus interface { // Code returns the traffic light colour code of meter status. Code() string // Info returns extra information corresponding to the traffic light colour. Info() string }
MeterStatus represents the meter status of the model.
type Model ¶
type Model interface { HasAnnotations HasConstraints // AgentVersion returns the version currently in use by the model. AgentVersion() string Type() string Cloud() string CloudRegion() string CloudCredential() CloudCredential SetCloudCredential(CloudCredentialArgs) Tag() names.ModelTag Owner() names.UserTag Config() map[string]interface{} LatestToolsVersion() version.Number EnvironVersion() int // UpdateConfig overwrites existing config values with those specified. UpdateConfig(map[string]interface{}) // Blocks represent a way to block certain operations on the model. // The map contains the normalized block name and the reason for the block. // The block names should be normalized to the following: // // - destroy-model // - remove-object // - all-changes // Blocks() map[string]string SetBlocks(map[string]string) Users() []User AddUser(UserArgs) Machines() []Machine AddMachine(MachineArgs) Machine Applications() []Application AddApplication(ApplicationArgs) Application Relations() []Relation AddRelation(RelationArgs) Relation RemoteEntities() []RemoteEntity AddRemoteEntity(RemoteEntityArgs) RemoteEntity RelationNetworks() []RelationNetwork AddRelationNetwork(RelationNetworkArgs) RelationNetwork Spaces() []Space AddSpace(SpaceArgs) Space LinkLayerDevices() []LinkLayerDevice AddLinkLayerDevice(LinkLayerDeviceArgs) LinkLayerDevice Subnets() []Subnet AddSubnet(SubnetArgs) Subnet IPAddresses() []IPAddress AddIPAddress(IPAddressArgs) IPAddress // AuthorizedKeys returns all the users and their authorized keys for this // model. AuthorizedKeys() []UserAuthorizedKeys // AddAuthorizedKeys adds a user and their authorized keys that are on this // model. AddAuthorizedKeys(UserAuthorizedKeysArgs) UserAuthorizedKeys SSHHostKeys() []SSHHostKey AddSSHHostKey(SSHHostKeyArgs) SSHHostKey CloudImageMetadata() []CloudImageMetadata AddCloudImageMetadata(CloudImageMetadataArgs) CloudImageMetadata Actions() []Action AddAction(ActionArgs) Action Operations() []Operation AddOperation(OperationArgs) Operation Sequences() map[string]int SetSequence(name string, value int) Volumes() []Volume AddVolume(VolumeArgs) Volume FirewallRules() []FirewallRule AddFirewallRule(FirewallRuleArgs) FirewallRule Filesystems() []Filesystem AddFilesystem(FilesystemArgs) Filesystem Storages() []Storage AddStorage(StorageArgs) Storage StoragePools() []StoragePool AddStoragePool(StoragePoolArgs) StoragePool SecretBackendID() string Secrets() []Secret AddSecret(args SecretArgs) Secret RemoteSecrets() []RemoteSecret AddRemoteSecret(args RemoteSecretArgs) RemoteSecret RemoteApplications() []RemoteApplication AddRemoteApplication(RemoteApplicationArgs) RemoteApplication OfferConnections() []OfferConnection AddOfferConnection(OfferConnectionArgs) OfferConnection ExternalControllers() []ExternalController AddExternalController(ExternalControllerArgs) ExternalController Validate() error SetSLA(level, owner, credentials string) SLA SLA() SLA SetMeterStatus(code, info string) MeterStatus MeterStatus() MeterStatus PasswordHash() string AddBlockDevice(string, BlockDeviceArgs) error // SetEnvironVersion sets the environment version to the specified value. // // The environVersion represents the version of the environ provider that // the Juju model is currently using. SetEnvironVersion(environVersion int) }
Model is a database agnostic representation of an existing model.
func Deserialize ¶
Deserialize constructs a Model from a serialized YAML byte stream. The normal use for this is to construct the Model representation after getting the byte stream from an API connection or read from a file.
type ModelArgs ¶
type ModelArgs struct { // AgentVersion defines the current version in use by the model. AgentVersion string Type string Owner names.UserTag Config map[string]interface{} LatestToolsVersion version.Number EnvironVersion int Blocks map[string]string Cloud string CloudRegion string PasswordHash string SecretBackendID string }
ModelArgs represent the bare minimum information that is needed to represent a model.
type OfferConnection ¶
type OfferConnection interface { OfferUUID() string RelationID() int RelationKey() string UserName() string SourceModelUUID() string }
OfferConnection represents an offer connection for a an application's endpoints.
type OfferConnectionArgs ¶
type OfferConnectionArgs struct { OfferUUID string RelationID int RelationKey string UserName string SourceModelUUID string }
OfferConnectionArgs is an argument struct used to add a offer connection to the model.
type OpenedPortRangeArgs ¶
type OpenedPortRangeArgs struct { UnitName string EndpointName string FromPort int ToPort int Protocol string }
OpenedPortRangeArgs is an argument struct used to add a new port range to a machine.
type OpenedPorts ¶
OpenedPorts represents a collection of port ranges that are open on a particular subnet. OpenedPorts are always associated with a Machine.
This type is deprecated and retained for backwards-compatibility purposes. The PortRange interface should be used instead.
type OpenedPortsArgs ¶
type OpenedPortsArgs struct { SubnetID string OpenedPorts []PortRangeArgs }
OpenedPortsArgs is an argument struct used to add a set of opened port ranges to a machine.
type Operation ¶
type Operation interface { Id() string Summary() string Fail() string Enqueued() time.Time Started() time.Time Completed() time.Time Status() string CompleteTaskCount() int SpawnedTaskCount() int }
Operation represents an operation.
type OperationArgs ¶
type OperationArgs struct { Id string Summary string Enqueued time.Time Started time.Time Completed time.Time Status string Fail string CompleteTaskCount int SpawnedTaskCount int }
OperationArgs is an argument struct used to create a new internal operation type that supports the Operation interface.
type Payload ¶
type Payload interface { Name() string Type() string RawID() string State() string Labels() []string }
Payload represents a charm payload for a unit.
type PayloadArgs ¶
PayloadArgs is an argument struct used to create a new internal payload type that supports the Payload interface.
type PortRange ¶
PortRange represents one or more contiguous ports opened by a particular Unit.
This type is deprecated and retained for backwards-compatibility purposes. The UnitPortRange interface should be used instead.
type PortRangeArgs ¶
PortRangeArgs is an argument struct used to create a PortRange. This is only done as part of creating OpenedPorts for a Machine.
type PortRanges ¶
type PortRanges interface {
ByUnit() map[string]UnitPortRanges
}
PortRanges represents a collection of port ranges that are open.
type ProvisioningState ¶
type ProvisioningStateArgs ¶
ProvisioningStateArgs is an argument struct used to create a new internal provisioningState type that supports the ProvisioningState interface.
type Relation ¶
type Relation interface { HasStatus Id() int Key() string Suspended() bool SuspendedReason() string Endpoints() []Endpoint AddEndpoint(EndpointArgs) Endpoint }
Relation represents a relationship between two applications, or a peer relation between different instances of an application.
type RelationArgs ¶
RelationArgs is an argument struct used to specify a relation.
type RelationNetwork ¶
RelationNetwork instances describe the ingress or egress networks required for a cross model relation.
type RelationNetworkArgs ¶
RelationNetworkArgs is an argument struct used to add a relation network to a model.
type RemoteApplication ¶
type RemoteApplication interface { HasStatus Tag() names.ApplicationTag Name() string OfferUUID() string URL() string SourceModelTag() names.ModelTag IsConsumerProxy() bool ConsumeVersion() int Macaroon() string Endpoints() []RemoteEndpoint AddEndpoint(RemoteEndpointArgs) RemoteEndpoint Spaces() []RemoteSpace AddSpace(RemoteSpaceArgs) RemoteSpace Bindings() map[string]string }
RemoteApplication represents an application in another model that can participate in a relation in this model.
type RemoteApplicationArgs ¶
type RemoteApplicationArgs struct { Tag names.ApplicationTag OfferUUID string URL string SourceModel names.ModelTag IsConsumerProxy bool ConsumeVersion int Macaroon string Bindings map[string]string }
RemoteApplicationArgs is an argument struct used to add a remote application to the Model.
type RemoteEndpoint ¶
RemoteEndpoint represents a connection point that can be related to another application.
type RemoteEndpointArgs ¶
RemoteEndpointArgs is an argument struct used to add a remote endpoint to a remote application.
type RemoteEntity ¶
RemoteEntity represents the internal state of a remote entity. Remote entities may be exported local entities, or imported remote entities
type RemoteEntityArgs ¶
RemoteEntityArgs is an argument struct used to add a remote entity.
type RemoteSecret ¶
type RemoteSecret interface { ID() string SourceUUID() string Consumer() (names.Tag, error) Label() string CurrentRevision() int LatestRevision() int Validate() error }
RemoteSecret represents consumer info for a remote secret.
type RemoteSecretArgs ¶
type RemoteSecretArgs struct { ID string SourceUUID string Consumer names.Tag Label string CurrentRevision int LatestRevision int }
RemoteSecretArgs is an argument struct used to create a new internal remote secret type that supports the remote secret interface.
type RemoteSpace ¶
type RemoteSpace interface { CloudType() string Name() string ProviderId() string ProviderAttributes() map[string]interface{} Subnets() []Subnet AddSubnet(SubnetArgs) Subnet }
RemoteSpace represents a network space that endpoints of remote applications might be connected to.
type RemoteSpaceArgs ¶
type RemoteSpaceArgs struct { CloudType string Name string ProviderId string ProviderAttributes map[string]interface{} }
RemoteSpaceArgs is an argument struct used to add a remote space to a remote application.
type Resource ¶
type Resource interface { // Name returns the name of the resource. Name() string // SetApplicationRevision sets the application revision of the // resource. SetApplicationRevision(ResourceRevisionArgs) ResourceRevision // ApplicationRevision returns the revision of the resource as set // on the application. May return nil if SetApplicationRevision // hasn't been called yet. ApplicationRevision() ResourceRevision // SetCharmStoreRevision sets the application revision of the // resource. SetCharmStoreRevision(ResourceRevisionArgs) ResourceRevision // CharmStoreRevision returns the revision the charmstore has, as // seen at the last poll. May return nil if SetCharmStoreRevision // hasn't been called yet. CharmStoreRevision() ResourceRevision // Validate checks the consistency of the resource and its // revisions. Validate() error }
Resource represents an application resource.
type ResourceArgs ¶
type ResourceArgs struct {
Name string
}
ResourceArgs is an argument struct used to create a new internal resource type that supports the Resource interface.
type ResourceRevision ¶
type ResourceRevision interface { Revision() int Type() string Path() string Description() string Origin() string FingerprintHex() string Size() int64 Timestamp() time.Time Username() string }
ResourceRevision represents a revision of an application resource.
type ResourceRevisionArgs ¶
type ResourceRevisionArgs struct { Revision int Type string Path string Description string Origin string FingerprintHex string Size int64 Timestamp time.Time Username string }
ResourceRevisionArgs is an argument struct used to add a new internal resource revision to a Resource.
type SLA ¶
type SLA interface { // Level returns the level of the sla. Level() string // Owner returns the owner of the sla. Owner() string // Credentials returns the credentials of the sla. Credentials() string }
SLA represents the sla for the model.
type SSHHostKey ¶
SSHHostKey represents an ssh host key.
type SSHHostKeyArgs ¶
SSHHostKeyArgs is an argument struct used to create a new internal sshHostKey type that supports the SSHHostKey interface.
type Secret ¶
type Secret interface { Id() string Version() int Description() string Label() string RotatePolicy() string AutoPrune() bool Owner() (names.Tag, error) Created() time.Time Updated() time.Time NextRotateTime() *time.Time ACL() map[string]SecretAccess Consumers() []SecretConsumer RemoteConsumers() []SecretRemoteConsumer Revisions() []SecretRevision LatestRevision() int LatestRevisionChecksum() string LatestExpireTime() *time.Time Validate() error }
Secret represents a secret.
type SecretAccess ¶
SecretAccess represents a secret ACL entry.
type SecretAccessArgs ¶
SecretAccessArgs is an argument struct used to create a new internal secret access type that supports the secret access interface.
type SecretArgs ¶
type SecretArgs struct { ID string Version int Description string Label string RotatePolicy string Owner names.Tag Created time.Time Updated time.Time Revisions []SecretRevisionArgs ACL map[string]SecretAccessArgs Consumers []SecretConsumerArgs RemoteConsumers []SecretRemoteConsumerArgs NextRotateTime *time.Time LatestRevisionChecksum string AutoPrune bool }
SecretArgs is an argument struct used to create a new internal secret type that supports the secret interface.
type SecretConsumer ¶
type SecretConsumer interface { Consumer() (names.Tag, error) Label() string CurrentRevision() int LatestRevision() int }
SecretConsumer represents a secret consumer.
type SecretConsumerArgs ¶
SecretConsumerArgs is an argument struct used to create a new internal secret consumer type that supports the secret consumer interface.
type SecretRemoteConsumer ¶
type SecretRemoteConsumer interface { ID() string Consumer() (names.Tag, error) CurrentRevision() int LatestRevision() int }
SecretRemoteConsumer represents consumer info for a secret remote consumer.
type SecretRemoteConsumerArgs ¶
SecretRemoteConsumerArgs is an argument struct used to create a new internal remote secret type that supports the secret remote consumer interface.
type SecretRevision ¶
type SecretRevision interface { Number() int Created() time.Time Updated() time.Time Obsolete() bool PendingDelete() bool ExpireTime() *time.Time ValueRef() SecretValueRef Content() map[string]string }
SecretRevision represents a secret revision.
type SecretRevisionArgs ¶
type SecretRevisionArgs struct { Number int Created time.Time Updated time.Time Obsolete bool PendingDelete bool Content map[string]string ValueRef *SecretValueRefArgs ExpireTime *time.Time }
SecretRevisionArgs is an argument struct used to create a new internal secret revision type that supports the secret revision interface.
type SecretValueRef ¶
SecretValueRef represents an external secret revision.
type SecretValueRefArgs ¶
SecretValueRefArgs is an argument struct used to create a new internal secret value reference type.
type SpaceArgs ¶
SpaceArgs is an argument struct used to create a new internal space type that supports the Space interface.
type Status ¶
type Status interface { Value() string Message() string Data() map[string]interface{} Updated() time.Time NeverSet() bool }
Status represents an agent, application, or workload status.
type StatusArgs ¶
type StatusArgs struct { Value string Message string Data map[string]interface{} Updated time.Time NeverSet bool }
StatusArgs is an argument struct used to set the agent, application, or workload status.
type StatusHistory_ ¶
type StatusHistory_ struct { Version int `yaml:"version"` History []*StatusPoint_ `yaml:"history"` }
func (*StatusHistory_) SetStatusHistory ¶
func (s *StatusHistory_) SetStatusHistory(args []StatusArgs)
SetStatusHistory implements HasStatusHistory.
func (*StatusHistory_) StatusHistory ¶
func (s *StatusHistory_) StatusHistory() []Status
StatusHistory implements HasStatusHistory.
type StatusPoint_ ¶
type StatusPoint_ struct { Value_ string `yaml:"value"` Message_ string `yaml:"message,omitempty"` Data_ map[string]interface{} `yaml:"data,omitempty"` Updated_ time.Time `yaml:"updated"` NeverSet_ bool `yaml:"neverset"` }
StatusPoint_ implements Status, and represents the status of an entity at a point in time. Used in the serialization of both status and StatusHistory_.
func (*StatusPoint_) Data ¶
func (a *StatusPoint_) Data() map[string]interface{}
Data implements Status.
func (*StatusPoint_) Updated ¶
func (a *StatusPoint_) Updated() time.Time
Updated implements Status.
type Storage ¶
type Storage interface { Tag() names.StorageTag Kind() string // Owner returns the tag of the application or unit that owns this storage // instance. Owner() (names.Tag, error) Name() string Attachments() []names.UnitTag // Constraints returns the storage instance constraints, and a boolean // reporting whether there are any. Constraints() (StorageInstanceConstraints, bool) Validate() error }
Storage represents the state of a unit or application-wide storage instance in the model.
type StorageArgs ¶
type StorageArgs struct { Tag names.StorageTag Kind string Owner names.Tag Name string Attachments []names.UnitTag Constraints *StorageInstanceConstraints }
StorageArgs is an argument struct used to add a storage to the Model.
type StorageDirective ¶
type StorageDirective interface { // Pool is the name of the storage pool from which to provision the // storage instances. Pool() string // Size is the required size of the storage instances, in MiB. Size() uint64 // Count is the required number of storage instances. Count() uint64 }
StorageDirective represents the user-specified storage directive for provisioning storage instances for an application unit.
type StorageDirectiveArgs ¶
StorageDirectiveArgs is an argument struct used to create a new internal storageDirective type that supports the StorageDirective interface.
type StorageInstanceConstraints ¶
StorageInstanceConstraints represents the user-specified constraints for provisioning a single storage instance for an application unit.
type StoragePool ¶
StoragePool represents a named storage pool and its settings.
type StoragePoolArgs ¶
StoragePoolArgs is an argument struct used to add a storage pool to the Model.
type Subnet ¶
type Subnet interface { ID() string UUID() string ProviderId() string ProviderNetworkId() string ProviderSpaceId() string CIDR() string VLANTag() int AvailabilityZones() []string IsPublic() bool SpaceID() string SpaceUUID() string SpaceName() string FanLocalUnderlay() string FanOverlay() string }
Subnet represents a network subnet.
type SubnetArgs ¶
type SubnetArgs struct { ID string UUID string ProviderId string ProviderNetworkId string ProviderSpaceId string CIDR string VLANTag int AvailabilityZones []string IsPublic bool // SpaceName is now deprecated and not used past version 4. SpaceName string SpaceID string SpaceUUID string FanLocalUnderlay string FanOverlay string }
SubnetArgs is an argument struct used to create a new internal subnet type that supports the Subnet interface.
type Unit ¶
type Unit interface { HasAnnotations HasConstraints UnitStateGetSetter Tag() names.UnitTag Name() string Type() string Machine() names.MachineTag PasswordHash() string Principal() names.UnitTag Subordinates() []names.UnitTag MeterStatusCode() string MeterStatusInfo() string Tools() AgentTools SetTools(AgentToolsArgs) WorkloadStatus() Status SetWorkloadStatus(StatusArgs) WorkloadStatusHistory() []Status SetWorkloadStatusHistory([]StatusArgs) WorkloadVersion() string WorkloadVersionHistory() []Status SetWorkloadVersionHistory([]StatusArgs) AgentStatus() Status SetAgentStatus(StatusArgs) AgentStatusHistory() []Status SetAgentStatusHistory([]StatusArgs) AddResource(UnitResourceArgs) UnitResource Resources() []UnitResource AddPayload(PayloadArgs) Payload Payloads() []Payload CloudContainer() CloudContainer SetCloudContainer(CloudContainerArgs) Validate() error }
Unit represents an instance of a unit in a model.
type UnitArgs ¶
type UnitArgs struct { Tag names.UnitTag Type string Machine names.MachineTag PasswordHash string Principal names.UnitTag Subordinates []names.UnitTag WorkloadVersion string MeterStatusCode string MeterStatusInfo string CloudContainer *CloudContainerArgs CharmState map[string]string RelationState map[int]string UniterState string StorageState string MeterStatusState string }
UnitArgs is an argument struct used to add a Unit to a Application in the Model.
type UnitPortRange ¶
UnitPortRange represents a contiguous port range opened by a unit.
type UnitPortRanges ¶
type UnitPortRanges interface {
ByEndpoint() map[string][]UnitPortRange
}
UnitPortRanges represents the of port ranges opened by a particular Unit for one or more endpoints.
type UnitResource ¶
type UnitResource interface { // Name returns the name of the resource. Name() string // Revision returns the revision of the resource as used by a // particular unit. Revision() ResourceRevision }
UnitResource represents the revision of a resource used by a unit.
type UnitResourceArgs ¶
type UnitResourceArgs struct { Name string RevisionArgs ResourceRevisionArgs }
UnitResourceArgs is an argument struct used to specify the revision of a resource used by a unit.
type UnitStateGetSetter ¶
type UnitStateGetSetter interface { CharmState() map[string]string SetCharmState(map[string]string) RelationState() map[int]string SetRelationState(map[int]string) UniterState() string SetUniterState(string) StorageState() string SetStorageState(string) MeterStatusState() string SetMeterStatusState(string) }
UnitStateGetSetter describes the state-related operations that can be performed against an instance of a unit in a model.
type User ¶
type User interface { Name() names.UserTag DisplayName() string CreatedBy() names.UserTag DateCreated() time.Time LastConnection() time.Time Access() string }
User represents a user of the model. Users are able to connect to, and depending on the read only flag, modify the model.
type UserAuthorizedKeys ¶
type UserAuthorizedKeys interface { // Username returns the username of the model user for which the authorized // keys belong to. Username() string // AuthorizedKeys returns the set of authorized keys allowed on the model // for the user. AuthorizedKeys() []string }
UserAuthorizedKeys represents the authorized keys that are in a model for a given user.
type UserAuthorizedKeysArgs ¶
type UserAuthorizedKeysArgs struct { // Username is the username of the user on the model that owns the // authorized keys. Username string // AuthorizedKeys is the set of authorized keys for the user on the model. AuthorizedKeys []string }
UserAuthorizedKeysArgs is the arguments struct used for adding new authorized keys to the model.
type Volume ¶
type Volume interface { HasStatus HasStatusHistory Tag() names.VolumeTag Storage() names.StorageTag Provisioned() bool Size() uint64 Pool() string HardwareID() string WWN() string VolumeID() string Persistent() bool Attachments() []VolumeAttachment AttachmentPlans() []VolumeAttachmentPlan AddAttachment(VolumeAttachmentArgs) VolumeAttachment AddAttachmentPlan(VolumeAttachmentPlanArgs) VolumeAttachmentPlan }
Volume represents a volume (disk, logical volume, etc.) in the model.
type VolumeArgs ¶
type VolumeArgs struct { Tag names.VolumeTag Storage names.StorageTag Provisioned bool Size uint64 Pool string HardwareID string WWN string VolumeID string Persistent bool }
VolumeArgs is an argument struct used to add a volume to the Model.
type VolumeAttachment ¶
type VolumeAttachment interface { Host() names.Tag Provisioned() bool ReadOnly() bool DeviceName() string DeviceLink() string BusAddress() string VolumePlanInfo() VolumePlanInfo }
VolumeAttachment represents a volume attached to a machine.
type VolumeAttachmentArgs ¶
type VolumeAttachmentArgs struct { Host names.Tag Provisioned bool ReadOnly bool DeviceName string DeviceLink string BusAddress string DeviceType string DeviceAttributes map[string]string }
VolumeAttachmentArgs is an argument struct used to add information about the cloud instance to a Volume.
type VolumeAttachmentPlan ¶
type VolumeAttachmentPlan interface { Machine() names.MachineTag BlockDevice() BlockDevice VolumePlanInfo() VolumePlanInfo }
type VolumeAttachmentPlanArgs ¶
type VolumeAttachmentPlanArgs struct { Machine names.MachineTag DeviceName string DeviceLinks []string Label string UUID string HardwareId string WWN string BusAddress string Size uint64 FilesystemType string InUse bool MountPoint string DeviceType string DeviceAttributes map[string]string }
VolumeAttachmentPlanArgs is an argument struct used to add information about a volume attached to an instance.
type VolumePlanInfo ¶
Source Files ¶
- action.go
- address.go
- annotations.go
- application.go
- applicationoffer.go
- authorizedkeys.go
- blockdevice.go
- charmactions.go
- charmconfigs.go
- charmmanifest.go
- charmmetadata.go
- charmorigin.go
- cloudcontainer.go
- cloudcredential.go
- cloudimagemetadata.go
- cloudinstance.go
- cloudservice.go
- common.go
- constraints.go
- doc.go
- endpoint.go
- exposed_endpoint.go
- externalcontroller.go
- filesystem.go
- firewallrule.go
- interfaces.go
- ipaddress.go
- linklayerdevice.go
- machine.go
- meter-status.go
- model.go
- offerconnections.go
- operation.go
- payload.go
- port_ranges.go
- ports.go
- provisioningstate.go
- relation.go
- relationnetworks.go
- remoteapplication.go
- remoteendpoint.go
- remoteentity.go
- remotesecrets.go
- remotespace.go
- resource.go
- secretremoteconsumers.go
- secrets.go
- serialization.go
- sla.go
- space.go
- sshhostkey.go
- status.go
- storage.go
- storagedirective.go
- storagepool.go
- subnet.go
- unit.go
- unitresources.go
- user.go
- volume.go