Documentation
¶
Index ¶
- Constants
- Variables
- func ActionFromError(err error) string
- func CheckMetadataVersion(svc iaas.Service) (string, fail.Error)
- func FilterBondsByKind(bonds map[string]*propertiesv1.SecurityGroupBond, ...) []*propertiesv1.SecurityGroupBond
- func FreeCIDRForSingleHost(network resources.Network, index uint) fail.Error
- func ListFeatures(svc iaas.Service, suitableFor string) (_ []interface{}, xerr fail.Error)
- func ListSubnets(ctx context.Context, svc iaas.Service, networkID string, all bool) (_ []*abstract.Subnet, xerr fail.Error)
- func LoadBucket(svc iaas.Service, name string) (b resources.Bucket, xerr fail.Error)
- func LoadCluster(ctx context.Context, svc iaas.Service, name string) (_ resources.Cluster, outerr fail.Error)
- func LoadHost(svc iaas.Service, ref string, options ...data.ImmutableKeyValue) (_ resources.Host, xerr fail.Error)
- func LoadNetwork(svc iaas.Service, ref string) (networkInstance resources.Network, ferr fail.Error)
- func LoadShare(svc iaas.Service, ref string) (rs resources.Share, ferr fail.Error)
- func LoadVolume(svc iaas.Service, ref string) (rv resources.Volume, ferr fail.Error)
- func NewBucket(svc iaas.Service) (resources.Bucket, fail.Error)
- func NewEmbeddedFeature(svc iaas.Service, name string) (_ resources.Feature, xerr fail.Error)
- func NewFeature(svc iaas.Service, name string) (_ resources.Feature, xerr fail.Error)
- func NewNetwork(svc iaas.Service) (resources.Network, fail.Error)
- func NewShare(svc iaas.Service) (resources.Share, fail.Error)
- func NewVolume(svc iaas.Service) (_ resources.Volume, xerr fail.Error)
- func ReserveCIDRForSingleHost(networkInstance resources.Network) (_ string, _ uint, ferr fail.Error)
- func SetCurrentTenant(tenantName string) error
- func VolumeNullValue() *volume
- type Cluster
- func (instance *Cluster) AddFeature(ctx context.Context, name string, vars data.Map, ...) (resources.Results, fail.Error)
- func (instance *Cluster) AddNodes(ctx context.Context, count uint, def abstract.HostSizingRequirements, ...) (_ []resources.Host, ferr fail.Error)
- func (instance *Cluster) Browse(ctx context.Context, callback func(*abstract.ClusterIdentity) fail.Error) (xerr fail.Error)
- func (instance *Cluster) CheckFeature(ctx context.Context, name string, vars data.Map, ...) (resources.Results, fail.Error)
- func (instance *Cluster) ComplementFeatureParameters(ctx context.Context, v data.Map) fail.Error
- func (instance *Cluster) CountNodes(ctx context.Context) (count uint, xerr fail.Error)
- func (instance *Cluster) Create(ctx context.Context, req abstract.ClusterRequest) (xerr fail.Error)
- func (instance *Cluster) Delete(ctx context.Context, force bool) (ferr fail.Error)
- func (instance *Cluster) DeleteSpecificNode(ctx context.Context, hostID string, selectedMasterID string) (xerr fail.Error)
- func (instance *Cluster) Deserialize(buf []byte) (xerr fail.Error)
- func (instance *Cluster) ExecuteScript(ctx context.Context, tmplName string, variables data.Map, host resources.Host) (_ int, _ string, _ string, ferr fail.Error)
- func (instance *Cluster) FindAvailableMaster(ctx context.Context) (master resources.Host, xerr fail.Error)
- func (instance *Cluster) FindAvailableNode(ctx context.Context) (node resources.Host, xerr fail.Error)
- func (instance *Cluster) GetAdminPassword() (adminPassword string, xerr fail.Error)
- func (instance *Cluster) GetComplexity() (_ clustercomplexity.Enum, xerr fail.Error)
- func (instance *Cluster) GetFlavor() (flavor clusterflavor.Enum, xerr fail.Error)
- func (instance *Cluster) GetIdentity() (clusterIdentity abstract.ClusterIdentity, xerr fail.Error)
- func (instance *Cluster) GetKeyPair() (keyPair abstract.KeyPair, xerr fail.Error)
- func (instance *Cluster) GetNetworkConfig() (config *propertiesv3.ClusterNetwork, xerr fail.Error)
- func (instance *Cluster) GetNodeByID(ctx context.Context, hostID string) (hostInstance resources.Host, xerr fail.Error)
- func (instance *Cluster) GetState() (state clusterstate.Enum, xerr fail.Error)
- func (instance *Cluster) InstallMethods() map[uint8]installmethod.Enum
- func (instance *Cluster) InstalledFeatures() []string
- func (instance *Cluster) IsFeatureInstalled(ctx context.Context, name string) (found bool, xerr fail.Error)
- func (instance *Cluster) IsNull() bool
- func (instance *Cluster) ListInstalledFeatures(ctx context.Context) (_ []resources.Feature, ferr fail.Error)
- func (instance *Cluster) ListMasterIDs(ctx context.Context) (list data.IndexedListOfStrings, xerr fail.Error)
- func (instance *Cluster) ListMasterIPs(ctx context.Context) (list data.IndexedListOfStrings, xerr fail.Error)
- func (instance *Cluster) ListMasterNames(ctx context.Context) (list data.IndexedListOfStrings, xerr fail.Error)
- func (instance *Cluster) ListMasters(ctx context.Context) (list resources.IndexedListOfClusterNodes, xerr fail.Error)
- func (instance *Cluster) ListNodeIDs(ctx context.Context) (list data.IndexedListOfStrings, xerr fail.Error)
- func (instance *Cluster) ListNodeIPs(ctx context.Context) (list data.IndexedListOfStrings, xerr fail.Error)
- func (instance *Cluster) ListNodeNames(ctx context.Context) (list data.IndexedListOfStrings, xerr fail.Error)
- func (instance *Cluster) ListNodes(ctx context.Context) (list resources.IndexedListOfClusterNodes, xerr fail.Error)
- func (instance *Cluster) LookupNode(ctx context.Context, ref string) (found bool, xerr fail.Error)
- func (instance *Cluster) RegisterFeature(feat resources.Feature, requiredBy resources.Feature, _ bool) (ferr fail.Error)
- func (instance *Cluster) Released()
- func (instance *Cluster) RemoveFeature(ctx context.Context, name string, vars data.Map, ...) (resources.Results, fail.Error)
- func (instance *Cluster) Serialize() (_ []byte, xerr fail.Error)
- func (instance *Cluster) Shrink(ctx context.Context, count uint) (_ []*propertiesv3.ClusterNode, ferr fail.Error)
- func (instance *Cluster) Start(ctx context.Context) (xerr fail.Error)
- func (instance *Cluster) Stop(ctx context.Context) (xerr fail.Error)
- func (instance *Cluster) TargetType() featuretargettype.Enum
- func (instance *Cluster) ToProtocol() (_ *protocol.ClusterResponse, xerr fail.Error)
- func (instance *Cluster) UnregisterFeature(feat string) (ferr fail.Error)
- type Feature
- func (f *Feature) Add(ctx context.Context, target resources.Targetable, v data.Map, ...) (_ resources.Results, ferr fail.Error)
- func (f *Feature) Applyable(t resources.Targetable) bool
- func (f *Feature) Check(ctx context.Context, target resources.Targetable, v data.Map, ...) (_ resources.Results, xerr fail.Error)
- func (f *Feature) Clone() data.Clonable
- func (f *Feature) GetDisplayFilename() string
- func (f *Feature) GetFilename() string
- func (f *Feature) GetID() string
- func (f *Feature) GetName() string
- func (f *Feature) GetRequirements() (map[string]struct{}, fail.Error)
- func (f *Feature) IsNull() bool
- func (f *Feature) Remove(ctx context.Context, target resources.Targetable, v data.Map, ...) (_ resources.Results, xerr fail.Error)
- func (f *Feature) Replace(p data.Clonable) data.Clonable
- func (f *Feature) Specs() *viper.Viper
- func (f Feature) ToProtocol() *protocol.FeatureResponse
- type Host
- func (instance *Host) AddFeature(ctx context.Context, name string, vars data.Map, ...) (outcomes resources.Results, xerr fail.Error)
- func (instance *Host) BindSecurityGroup(ctx context.Context, sgInstance resources.SecurityGroup, ...) (xerr fail.Error)
- func (instance *Host) Browse(ctx context.Context, callback func(*abstract.HostCore) fail.Error) (xerr fail.Error)
- func (instance *Host) CheckFeature(ctx context.Context, name string, vars data.Map, ...) (_ resources.Results, xerr fail.Error)
- func (instance *Host) ComplementFeatureParameters(_ context.Context, v data.Map) (xerr fail.Error)
- func (instance *Host) Create(ctx context.Context, hostReq abstract.HostRequest, ...) (_ *userdata.Content, ferr fail.Error)
- func (instance *Host) Delete(ctx context.Context) (xerr fail.Error)
- func (instance *Host) DeleteFeature(ctx context.Context, name string, vars data.Map, ...) (_ resources.Results, xerr fail.Error)
- func (instance *Host) DisableSecurityGroup(ctx context.Context, sgInstance resources.SecurityGroup) (xerr fail.Error)
- func (instance *Host) EnableSecurityGroup(ctx context.Context, sg resources.SecurityGroup) (xerr fail.Error)
- func (instance *Host) ForceGetState(ctx context.Context) (state hoststate.Enum, ferr fail.Error)
- func (instance *Host) GetAccessIP() (ip string, xerr fail.Error)
- func (instance *Host) GetDefaultSubnet() (rs resources.Subnet, xerr fail.Error)
- func (instance *Host) GetMounts() (mounts *propertiesv1.HostMounts, xerr fail.Error)
- func (instance *Host) GetPrivateIP() (_ string, xerr fail.Error)
- func (instance *Host) GetPrivateIPOnSubnet(subnetID string) (ip string, xerr fail.Error)
- func (instance *Host) GetPublicIP() (ip string, xerr fail.Error)
- func (instance *Host) GetSSHConfig() (_ *system.SSHConfig, xerr fail.Error)
- func (instance *Host) GetShare(shareRef string) (_ *propertiesv1.HostShare, xerr fail.Error)
- func (instance *Host) GetShares() (shares *propertiesv1.HostShares, xerr fail.Error)
- func (instance *Host) GetState() (state hoststate.Enum)
- func (instance *Host) GetVolumes() (_ *propertiesv1.HostVolumes, xerr fail.Error)
- func (instance *Host) InstallMethods() map[uint8]installmethod.Enum
- func (instance *Host) InstalledFeatures() []string
- func (instance *Host) IsClusterMember() (yes bool, xerr fail.Error)
- func (instance *Host) IsFeatureInstalled(name string) (found bool, xerr fail.Error)
- func (instance *Host) IsGateway() (_ bool, xerr fail.Error)
- func (instance *Host) IsNull() bool
- func (instance *Host) IsSingle() (_ bool, xerr fail.Error)
- func (instance *Host) ListSecurityGroups(state securitygroupstate.Enum) (list []*propertiesv1.SecurityGroupBond, xerr fail.Error)
- func (instance *Host) Pull(ctx context.Context, target, source string, timeout time.Duration) (_ int, _ string, _ string, xerr fail.Error)
- func (instance *Host) Push(ctx context.Context, source, target, owner, mode string, timeout time.Duration) (_ int, _ string, _ string, xerr fail.Error)
- func (instance *Host) PushStringToFile(ctx context.Context, content string, filename string) (xerr fail.Error)
- func (instance *Host) PushStringToFileWithOwnership(ctx context.Context, content string, filename string, owner, mode string) (xerr fail.Error)
- func (instance *Host) Reboot(ctx context.Context, soft bool) (ferr fail.Error)
- func (instance *Host) RegisterFeature(feat resources.Feature, requiredBy resources.Feature, clusterContext bool) (xerr fail.Error)
- func (instance *Host) RelaxedDeleteHost(ctx context.Context) (xerr fail.Error)
- func (instance *Host) Reload() (xerr fail.Error)
- func (instance *Host) Resize(ctx context.Context, hostSize abstract.HostSizingRequirements) (xerr fail.Error)
- func (instance *Host) Run(ctx context.Context, cmd string, outs outputs.Enum, ...) (_ int, _ string, _ string, xerr fail.Error)
- func (instance *Host) Start(ctx context.Context) (xerr fail.Error)
- func (instance *Host) Stop(ctx context.Context) (xerr fail.Error)
- func (instance *Host) TargetType() featuretargettype.Enum
- func (instance *Host) ToProtocol() (ph *protocol.Host, xerr fail.Error)
- func (instance *Host) UnbindSecurityGroup(ctx context.Context, sgInstance resources.SecurityGroup) (xerr fail.Error)
- func (instance *Host) UnregisterFeature(feat string) (xerr fail.Error)
- func (instance *Host) WaitSSHReady(ctx context.Context, timeout time.Duration) (_ string, xerr fail.Error)
- type Installer
- type Item
- type KongController
- type MetadataCore
- func (c *MetadataCore) AddObserver(o observer.Observer) error
- func (c *MetadataCore) Alter(callback resources.Callback, options ...data.ImmutableKeyValue) (xerr fail.Error)
- func (c *MetadataCore) BrowseFolder(callback func(buf []byte) fail.Error) (xerr fail.Error)
- func (c *MetadataCore) Carry(clonable data.Clonable) (xerr fail.Error)
- func (c *MetadataCore) Delete() (xerr fail.Error)
- func (c *MetadataCore) Deserialize(buf []byte) (xerr fail.Error)
- func (c *MetadataCore) Destroyed()
- func (c *MetadataCore) GetID() string
- func (c *MetadataCore) GetKind() string
- func (c *MetadataCore) GetName() string
- func (c *MetadataCore) GetService() iaas.Service
- func (c *MetadataCore) Inspect(callback resources.Callback) (xerr fail.Error)
- func (c *MetadataCore) IsNull() bool
- func (c *MetadataCore) NotifyObservers() error
- func (c *MetadataCore) Read(ref string) (xerr fail.Error)
- func (c *MetadataCore) ReadByID(id string) (xerr fail.Error)
- func (c *MetadataCore) Released()
- func (c *MetadataCore) Reload() (xerr fail.Error)
- func (c *MetadataCore) RemoveObserver(name string) error
- func (c *MetadataCore) Review(callback resources.Callback) (xerr fail.Error)
- func (c *MetadataCore) Serialize() (_ []byte, xerr fail.Error)
- type MetadataFolder
- func (f MetadataFolder) Browse(path string, callback folderDecoderCallback) fail.Error
- func (f MetadataFolder) Delete(path string, name string) fail.Error
- func (f MetadataFolder) GetBucket() (abstract.ObjectStorageBucket, fail.Error)
- func (f MetadataFolder) GetService() iaas.Service
- func (f *MetadataFolder) IsNull() bool
- func (f MetadataFolder) Lookup(path string, name string) fail.Error
- func (f MetadataFolder) Path() string
- func (f MetadataFolder) Read(path string, name string, callback func([]byte) fail.Error, ...) fail.Error
- func (f MetadataFolder) Write(path string, name string, content []byte, options ...datadef.ImmutableKeyValue) fail.Error
- type Network
- func (instance *Network) AbandonSubnet(ctx context.Context, subnetID string) (xerr fail.Error)
- func (instance *Network) AdoptSubnet(ctx context.Context, subnet resources.Subnet) (xerr fail.Error)
- func (instance *Network) Browse(ctx context.Context, callback func(*abstract.Network) fail.Error) (xerr fail.Error)
- func (instance *Network) Create(ctx context.Context, req abstract.NetworkRequest) (ferr fail.Error)
- func (instance *Network) Delete(ctx context.Context) (xerr fail.Error)
- func (instance *Network) GetCIDR() (cidr string, xerr fail.Error)
- func (instance *Network) Import(ctx context.Context, ref string) (xerr fail.Error)
- func (instance *Network) InspectSubnet(ref string) (_ resources.Subnet, xerr fail.Error)
- func (instance *Network) IsNull() bool
- func (instance *Network) ToProtocol() (_ *protocol.Network, xerr fail.Error)
- type RemoteFilesHandler
- type SecurityGroup
- func (instance *SecurityGroup) AddRule(ctx context.Context, rule *abstract.SecurityGroupRule) (xerr fail.Error)
- func (instance *SecurityGroup) AddRules(ctx context.Context, rules abstract.SecurityGroupRules) (xerr fail.Error)
- func (instance *SecurityGroup) BindToHost(ctx context.Context, hostInstance resources.Host, ...) (xerr fail.Error)
- func (instance *SecurityGroup) BindToSubnet(ctx context.Context, subnetInstance resources.Subnet, ...) (xerr fail.Error)
- func (instance *SecurityGroup) Browse(ctx context.Context, callback func(*abstract.SecurityGroup) fail.Error) (xerr fail.Error)
- func (instance *SecurityGroup) CheckConsistency(_ context.Context) fail.Error
- func (instance *SecurityGroup) Clear(ctx context.Context) (xerr fail.Error)
- func (instance *SecurityGroup) Create(ctx context.Context, networkID, name, description string, ...) (ferr fail.Error)
- func (instance *SecurityGroup) Delete(ctx context.Context, force bool) (xerr fail.Error)
- func (instance *SecurityGroup) DeleteRule(ctx context.Context, rule *abstract.SecurityGroupRule) (xerr fail.Error)
- func (instance *SecurityGroup) GetBoundHosts(ctx context.Context) (_ []*propertiesv1.SecurityGroupBond, xerr fail.Error)
- func (instance *SecurityGroup) GetBoundSubnets(ctx context.Context) (list []*propertiesv1.SecurityGroupBond, xerr fail.Error)
- func (instance *SecurityGroup) IsNull() bool
- func (instance *SecurityGroup) Reset(ctx context.Context) (xerr fail.Error)
- func (instance *SecurityGroup) ToProtocol() (_ *protocol.SecurityGroupResponse, xerr fail.Error)
- func (instance *SecurityGroup) UnbindFromHost(ctx context.Context, hostInstance resources.Host) (xerr fail.Error)
- func (instance *SecurityGroup) UnbindFromHostByReference(ctx context.Context, hostRef string) (xerr fail.Error)
- func (instance *SecurityGroup) UnbindFromSubnet(ctx context.Context, subnetInstance resources.Subnet) (xerr fail.Error)
- func (instance *SecurityGroup) UnbindFromSubnetByReference(ctx context.Context, subnetRef string) (xerr fail.Error)
- type Share
- func (instance *Share) Browse(ctx context.Context, callback func(string, string) fail.Error) (xerr fail.Error)
- func (instance *Share) Create(ctx context.Context, shareName string, server resources.Host, path string, ...) (ferr fail.Error)
- func (instance *Share) Delete(ctx context.Context) (xerr fail.Error)
- func (instance *Share) GetServer() (_ resources.Host, xerr fail.Error)
- func (instance *Share) IsNull() bool
- func (instance *Share) Mount(ctx context.Context, target resources.Host, path string, withCache bool) (_ *propertiesv1.HostRemoteMount, ferr fail.Error)
- func (instance *Share) ToProtocol() (_ *protocol.ShareMountList, xerr fail.Error)
- func (instance *Share) Unmount(ctx context.Context, target resources.Host) (xerr fail.Error)
- type ShareIdentity
- func (si ShareIdentity) Clone() data.Clonable
- func (si *ShareIdentity) Deserialize(buf []byte) (xerr fail.Error)
- func (si ShareIdentity) GetID() string
- func (si ShareIdentity) GetName() string
- func (si *ShareIdentity) IsNull() bool
- func (si *ShareIdentity) Replace(p data.Clonable) data.Clonable
- func (si ShareIdentity) Serialize() ([]byte, fail.Error)
- type Subnet
- func (instance *Subnet) AttachHost(ctx context.Context, host resources.Host) (xerr fail.Error)
- func (instance *Subnet) BindSecurityGroup(ctx context.Context, sgInstance resources.SecurityGroup, ...) (xerr fail.Error)
- func (instance *Subnet) Browse(ctx context.Context, callback func(*abstract.Subnet) fail.Error) (xerr fail.Error)
- func (instance *Subnet) Carry(clonable data.Clonable) (ferr fail.Error)
- func (instance *Subnet) Create(ctx context.Context, req abstract.SubnetRequest, gwname string, ...) (ferr fail.Error)
- func (instance *Subnet) CreateSecurityGroups(ctx context.Context, networkInstance resources.Network, keepOnFailure bool) (subnetGWSG, subnetInternalSG, subnetPublicIPSG resources.SecurityGroup, ...)
- func (instance *Subnet) CreateSubnetWithoutGateway(ctx context.Context, req abstract.SubnetRequest) (xerr fail.Error)
- func (instance *Subnet) Delete(ctx context.Context) (xerr fail.Error)
- func (instance *Subnet) DetachHost(ctx context.Context, hostID string) (xerr fail.Error)
- func (instance *Subnet) DisableSecurityGroup(ctx context.Context, sgInstance resources.SecurityGroup) (xerr fail.Error)
- func (instance *Subnet) EnableSecurityGroup(ctx context.Context, sgInstance resources.SecurityGroup) (xerr fail.Error)
- func (instance *Subnet) GetCIDR() (cidr string, xerr fail.Error)
- func (instance *Subnet) GetDefaultRouteIP() (ip string, xerr fail.Error)
- func (instance *Subnet) GetEndpointIP() (ip string, xerr fail.Error)
- func (instance *Subnet) GetGatewayPublicIP(primary bool) (_ string, xerr fail.Error)
- func (instance *Subnet) GetGatewayPublicIPs() (_ []string, xerr fail.Error)
- func (instance *Subnet) GetState() (state subnetstate.Enum, xerr fail.Error)
- func (instance *Subnet) GetVirtualIP() (vip *abstract.VirtualIP, xerr fail.Error)
- func (instance *Subnet) HasVirtualIP() (bool, fail.Error)
- func (instance *Subnet) InspectGateway(primary bool) (_ resources.Host, xerr fail.Error)
- func (instance *Subnet) InspectGatewaySecurityGroup() (sgInstance resources.SecurityGroup, xerr fail.Error)
- func (instance *Subnet) InspectInternalSecurityGroup() (sg resources.SecurityGroup, xerr fail.Error)
- func (instance *Subnet) InspectNetwork() (rn resources.Network, xerr fail.Error)
- func (instance *Subnet) InspectPublicIPSecurityGroup() (sg resources.SecurityGroup, xerr fail.Error)
- func (instance *Subnet) IsNull() bool
- func (instance *Subnet) ListHosts(ctx context.Context) (_ []resources.Host, xerr fail.Error)
- func (instance *Subnet) ListSecurityGroups(ctx context.Context, state securitygroupstate.Enum) (list []*propertiesv1.SecurityGroupBond, xerr fail.Error)
- func (instance *Subnet) Released()
- func (instance *Subnet) ToProtocol() (_ *protocol.Subnet, xerr fail.Error)
- func (instance *Subnet) UnbindSecurityGroup(ctx context.Context, sgInstance resources.SecurityGroup) (xerr fail.Error)
- type Tenant
Constants ¶
const ( // MinimumMetadataVersion defines the version of the metadata recognized by the release // Must be incremented each time a new release requires upgrade of metadata (hopefully not for all new releases) // By convention, it corresponds to the SafeScale release that introduced the new format MinimumMetadataVersion = "v21.05.0" // FirstMetadataVersion corresponds to the first metadata format version FirstMetadataVersion = "v20.06.0" // MustUpgradeMessage = "the current version of SafeScale binaries cannot use safely the current tenant metadata; you should consider upgrading the metadata using the command 'safescale tenant metadata upgrade %s'. Note that previous version of binaries would not be able to read safely the newly upgraded metadata and should be upgraded everywhere to at least version %s." MustUpgradeMessage = "" /* 189-byte string literal not displayed */ MustUpgradeBinaries = "" /* 129-byte string literal not displayed */ )
const ( NullMetadataKind = "nil" NullMetadataName = "<NullCore>" NullMetadataID = NullMetadataName )
Variables ¶
var ( // HostLightOption is used as option to LoadHost() to disable external information caching (that may lead to deadlock sometimes) HostLightOption = data.NewImmutableKeyValue(hostOptionLightKeyword, true) // HostFullOption is used as option to LoadHost() to enable external information caching (that may lead to deadlock sometimes) (default if neither "light" nor "full" is used) HostFullOption = data.NewImmutableKeyValue(hostOptionLightKeyword, false) )
var ( CurrentNetworkAbstractContextKey = "current_network_abstract" CurrentNetworkPropertiesContextKey = "current_network_properties" )
Functions ¶
func ActionFromError ¶
func CheckMetadataVersion ¶
CheckMetadataVersion checks if the content of /version in metadata bucket is equal to MetadataVersion
func FilterBondsByKind ¶
func FilterBondsByKind(bonds map[string]*propertiesv1.SecurityGroupBond, state securitygroupstate.Enum) []*propertiesv1.SecurityGroupBond
func FreeCIDRForSingleHost ¶
FreeCIDRForSingleHost frees the CIDR index inside the Network 'Network'
func ListFeatures ¶
ListFeatures lists all features suitable for hosts or clusters
func ListSubnets ¶
func ListSubnets(ctx context.Context, svc iaas.Service, networkID string, all bool) (_ []*abstract.Subnet, xerr fail.Error)
ListSubnets returns a list of available subnets
func LoadBucket ¶
LoadBucket instantiates a bucket struct and fill it with Provider metadata of Object Storage ObjectStorageBucket
func LoadCluster ¶
func LoadCluster(ctx context.Context, svc iaas.Service, name string) (_ resources.Cluster, outerr fail.Error)
LoadCluster loads cluster information from metadata
func LoadHost ¶
func LoadHost(svc iaas.Service, ref string, options ...data.ImmutableKeyValue) (_ resources.Host, xerr fail.Error)
LoadHost ...
func LoadNetwork ¶
LoadNetwork loads the metadata of a subnet
func LoadShare ¶
LoadShare returns the name of the host owing the Share 'ref', read from Object Storage logic: try to read until success.
If error is fail.ErrNotFound return this error In case of any other error, abort the retry to propagate the error If retry times out, return fail.ErrTimeout
func LoadVolume ¶
LoadVolume loads the metadata of a subnet
func NewEmbeddedFeature ¶
NewEmbeddedFeature searches for an embedded featured named 'name' and initializes a new Feature object with its content
func NewFeature ¶
NewFeature searches for a spec file name 'name' and initializes a new Feature object with its content error contains :
- fail.ErrNotFound if no Feature is found by its name
- fail.ErrSyntax if Feature found contains syntax error
func NewNetwork ¶
NewNetwork creates an instance of Networking
func ReserveCIDRForSingleHost ¶
func ReserveCIDRForSingleHost(networkInstance resources.Network) (_ string, _ uint, ferr fail.Error)
ReserveCIDRForSingleHost returns the first available CIDR and its index inside the Network 'network'
func SetCurrentTenant ¶
SetCurrentTenant sets the tenant to use for upcoming commands
func VolumeNullValue ¶
func VolumeNullValue() *volume
VolumeNullValue returns an instance of share corresponding to its null value. The idea is to avoid nil pointer using VolumeNullValue()
Types ¶
type Cluster ¶
type Cluster struct {
*MetadataCore
// contains filtered or unexported fields
}
Cluster is the implementation of resources.Cluster interface
func NewCluster ¶
NewCluster is the constructor of resources.Cluster struct
func (*Cluster) AddFeature ¶
func (instance *Cluster) AddFeature(ctx context.Context, name string, vars data.Map, settings resources.FeatureSettings) (resources.Results, fail.Error)
AddFeature installs a feature on the Cluster
func (*Cluster) AddNodes ¶
func (instance *Cluster) AddNodes(ctx context.Context, count uint, def abstract.HostSizingRequirements, keepOnFailure bool) (_ []resources.Host, ferr fail.Error)
AddNodes adds several nodes
func (*Cluster) Browse ¶
func (instance *Cluster) Browse(ctx context.Context, callback func(*abstract.ClusterIdentity) fail.Error) (xerr fail.Error)
Browse walks through Cluster MetadataFolder and executes a callback for each entry FIXME: adds a Cluster status check to prevent operations on removed clusters
func (*Cluster) CheckFeature ¶
func (instance *Cluster) CheckFeature(ctx context.Context, name string, vars data.Map, settings resources.FeatureSettings) (resources.Results, fail.Error)
CheckFeature tells if a feature is installed on the Cluster
func (*Cluster) ComplementFeatureParameters ¶
ComplementFeatureParameters configures parameters that are implicitly defined, based on target satisfies interface resources.Targetable
func (*Cluster) CountNodes ¶
CountNodes counts the nodes of the Cluster
func (*Cluster) DeleteSpecificNode ¶
func (instance *Cluster) DeleteSpecificNode(ctx context.Context, hostID string, selectedMasterID string) (xerr fail.Error)
DeleteSpecificNode deletes a node identified by its ID
func (*Cluster) Deserialize ¶
Deserialize reads json code and recreates Cluster metadata
func (*Cluster) ExecuteScript ¶
func (instance *Cluster) ExecuteScript(ctx context.Context, tmplName string, variables data.Map, host resources.Host) (_ int, _ string, _ string, ferr fail.Error)
ExecuteScript executes the script template with the parameters on target Host
func (*Cluster) FindAvailableMaster ¶
func (instance *Cluster) FindAvailableMaster(ctx context.Context) (master resources.Host, xerr fail.Error)
FindAvailableMaster returns ID of the first master available to execute order satisfies interface Cluster.Cluster.Controller
func (*Cluster) FindAvailableNode ¶
func (instance *Cluster) FindAvailableNode(ctx context.Context) (node resources.Host, xerr fail.Error)
FindAvailableNode returns node instance of the first node available to execute order
func (*Cluster) GetAdminPassword ¶
GetAdminPassword returns the password of the Cluster admin account satisfies interface Cluster.Controller
func (*Cluster) GetComplexity ¶
func (instance *Cluster) GetComplexity() (_ clustercomplexity.Enum, xerr fail.Error)
GetComplexity returns the complexity of the Cluster
func (*Cluster) GetFlavor ¶
func (instance *Cluster) GetFlavor() (flavor clusterflavor.Enum, xerr fail.Error)
GetFlavor returns the flavor of the Cluster
func (*Cluster) GetIdentity ¶
func (instance *Cluster) GetIdentity() (clusterIdentity abstract.ClusterIdentity, xerr fail.Error)
GetIdentity returns the identity of the Cluster
func (*Cluster) GetKeyPair ¶
GetKeyPair returns the key pair used in the Cluster
func (*Cluster) GetNetworkConfig ¶
func (instance *Cluster) GetNetworkConfig() (config *propertiesv3.ClusterNetwork, xerr fail.Error)
GetNetworkConfig returns subnet configuration of the Cluster
func (*Cluster) GetNodeByID ¶
func (instance *Cluster) GetNodeByID(ctx context.Context, hostID string) (hostInstance resources.Host, xerr fail.Error)
GetNodeByID returns a node based on its ID
func (*Cluster) GetState ¶
func (instance *Cluster) GetState() (state clusterstate.Enum, xerr fail.Error)
GetState returns the current state of the Cluster Uses the "maker" ForceGetState
func (*Cluster) InstallMethods ¶
func (instance *Cluster) InstallMethods() map[uint8]installmethod.Enum
InstallMethods returns a list of installation methods usable on the target, ordered from upper to lower preference (1 = the highest preference) satisfies resources.Targetable interface
func (*Cluster) InstalledFeatures ¶
InstalledFeatures returns a list of installed features
func (*Cluster) IsFeatureInstalled ¶
func (instance *Cluster) IsFeatureInstalled(ctx context.Context, name string) (found bool, xerr fail.Error)
IsFeatureInstalled tells if a Feature identified by name is installed on Cluster, using only metadata
func (*Cluster) ListInstalledFeatures ¶
func (instance *Cluster) ListInstalledFeatures(ctx context.Context) (_ []resources.Feature, ferr fail.Error)
ListInstalledFeatures returns a slice of installed features
func (*Cluster) ListMasterIDs ¶
func (instance *Cluster) ListMasterIDs(ctx context.Context) (list data.IndexedListOfStrings, xerr fail.Error)
ListMasterIDs lists the IDs of masters (if there is such masters in the flavor...)
func (*Cluster) ListMasterIPs ¶
func (instance *Cluster) ListMasterIPs(ctx context.Context) (list data.IndexedListOfStrings, xerr fail.Error)
ListMasterIPs lists the IPs of masters (if there is such masters in the flavor...)
func (*Cluster) ListMasterNames ¶
func (instance *Cluster) ListMasterNames(ctx context.Context) (list data.IndexedListOfStrings, xerr fail.Error)
ListMasterNames lists the names of the master nodes in the Cluster
func (*Cluster) ListMasters ¶
func (instance *Cluster) ListMasters(ctx context.Context) (list resources.IndexedListOfClusterNodes, xerr fail.Error)
ListMasters lists the node instances corresponding to masters (if there is such masters in the flavor...)
func (*Cluster) ListNodeIDs ¶
func (instance *Cluster) ListNodeIDs(ctx context.Context) (list data.IndexedListOfStrings, xerr fail.Error)
ListNodeIDs lists IDs of the nodes in the Cluster
func (*Cluster) ListNodeIPs ¶
func (instance *Cluster) ListNodeIPs(ctx context.Context) (list data.IndexedListOfStrings, xerr fail.Error)
ListNodeIPs lists the IPs of the nodes in the Cluster
func (*Cluster) ListNodeNames ¶
func (instance *Cluster) ListNodeNames(ctx context.Context) (list data.IndexedListOfStrings, xerr fail.Error)
ListNodeNames lists the names of the nodes in the Cluster
func (*Cluster) ListNodes ¶
func (instance *Cluster) ListNodes(ctx context.Context) (list resources.IndexedListOfClusterNodes, xerr fail.Error)
ListNodes lists node instances corresponding to the nodes in the Cluster satisfies interface Cluster.Controller
func (*Cluster) LookupNode ¶
LookupNode tells if the ID of the master passed as parameter is a node
func (*Cluster) RegisterFeature ¶
func (instance *Cluster) RegisterFeature(feat resources.Feature, requiredBy resources.Feature, _ bool) (ferr fail.Error)
RegisterFeature registers an installed Feature in metadata of a Cluster satisfies interface resources.Targetable
func (*Cluster) Released ¶
func (instance *Cluster) Released()
Released tells cache handler the instance is no more used, giving a chance to free this instance from cache
func (*Cluster) RemoveFeature ¶
func (instance *Cluster) RemoveFeature(ctx context.Context, name string, vars data.Map, settings resources.FeatureSettings) (resources.Results, fail.Error)
RemoveFeature uninstalls a feature from the Cluster
func (*Cluster) Shrink ¶
func (instance *Cluster) Shrink(ctx context.Context, count uint) (_ []*propertiesv3.ClusterNode, ferr fail.Error)
Shrink reduces cluster size by 'count' nodes
func (*Cluster) TargetType ¶
func (instance *Cluster) TargetType() featuretargettype.Enum
TargetType returns the type of the target
satisfies resources.Targetable interface
func (*Cluster) ToProtocol ¶
func (instance *Cluster) ToProtocol() (_ *protocol.ClusterResponse, xerr fail.Error)
ToProtocol converts instance to protocol.ClusterResponse message
type Feature ¶
type Feature struct {
// contains filtered or unexported fields
}
Feature contains the information about an installable Feature
func FeatureNullValue ¶
func FeatureNullValue() *Feature
FeatureNullValue returns a *Feature corresponding to a null value
func (*Feature) Add ¶
func (f *Feature) Add(ctx context.Context, target resources.Targetable, v data.Map, s resources.FeatureSettings) (_ resources.Results, ferr fail.Error)
Add installs the Feature on the target Installs succeeds if error == nil and Results.Successful() is true
func (*Feature) Applyable ¶
func (f *Feature) Applyable(t resources.Targetable) bool
Applyable tells if the Feature is installable on the target
func (*Feature) Check ¶
func (f *Feature) Check(ctx context.Context, target resources.Targetable, v data.Map, s resources.FeatureSettings) (_ resources.Results, xerr fail.Error)
Check if Feature is installed on target Check is ok if error is nil and Results.Successful() is true
func (*Feature) GetDisplayFilename ¶
GetDisplayFilename returns the filename of the Feature definition, beautifulled, with error handling
func (*Feature) GetFilename ¶
GetFilename returns the filename of the Feature definition, with error handling
func (*Feature) GetRequirements ¶
GetRequirements returns a list of features needed as requirements
func (*Feature) Remove ¶
func (f *Feature) Remove(ctx context.Context, target resources.Targetable, v data.Map, s resources.FeatureSettings) (_ resources.Results, xerr fail.Error)
Remove uninstalls the Feature from the target
func (*Feature) Specs ¶
Specs returns a copy of the spec file (we don't want external use to modify Feature.specs)
func (Feature) ToProtocol ¶
func (f Feature) ToProtocol() *protocol.FeatureResponse
ToProtocol converts a Feature to *protocol.FeatureResponse
type Host ¶
type Host struct {
*MetadataCore
// contains filtered or unexported fields
}
Host ... follows interface resources.Host
func HostNullValue ¶
func HostNullValue() *Host
HostNullValue returns a *host corresponding to ShareNullValue
func (*Host) AddFeature ¶
func (instance *Host) AddFeature(ctx context.Context, name string, vars data.Map, settings resources.FeatureSettings) (outcomes resources.Results, xerr fail.Error)
AddFeature handles 'safescale host feature add <host name or id> <feature name>'
func (*Host) BindSecurityGroup ¶
func (instance *Host) BindSecurityGroup( ctx context.Context, sgInstance resources.SecurityGroup, enable resources.SecurityGroupActivation, ) (xerr fail.Error)
BindSecurityGroup binds a security group to the Host; if enabled is true, apply it immediately
func (*Host) Browse ¶
func (instance *Host) Browse(ctx context.Context, callback func(*abstract.HostCore) fail.Error) (xerr fail.Error)
Browse walks through Host MetadataFolder and executes a callback for each entry
func (*Host) CheckFeature ¶
func (instance *Host) CheckFeature(ctx context.Context, name string, vars data.Map, settings resources.FeatureSettings) (_ resources.Results, xerr fail.Error)
CheckFeature ...
func (*Host) ComplementFeatureParameters ¶
ComplementFeatureParameters configures parameters that are appropriate for the target satisfies interface install.Targetable
func (*Host) Create ¶
func (instance *Host) Create( ctx context.Context, hostReq abstract.HostRequest, hostDef abstract.HostSizingRequirements, ) (_ *userdata.Content, ferr fail.Error)
Create creates a new Host and its metadata If the metadata is already carrying a Host, returns fail.ErrNotAvailable In case of error occurring after Host resource creation, 'instance' still contains ID of the Host created. This can be used to defer Host deletion in case of error
func (*Host) DeleteFeature ¶
func (instance *Host) DeleteFeature(ctx context.Context, name string, vars data.Map, settings resources.FeatureSettings) (_ resources.Results, xerr fail.Error)
DeleteFeature handles 'safescale host delete-feature <host name> <feature name>'
func (*Host) DisableSecurityGroup ¶
func (instance *Host) DisableSecurityGroup(ctx context.Context, sgInstance resources.SecurityGroup) (xerr fail.Error)
DisableSecurityGroup disables a bound security group to Host
func (*Host) EnableSecurityGroup ¶
func (instance *Host) EnableSecurityGroup(ctx context.Context, sg resources.SecurityGroup) (xerr fail.Error)
EnableSecurityGroup enables a bound security group to Host by applying its rules
func (*Host) ForceGetState ¶
ForceGetState returns the current state of the provider Host then alter metadata
func (*Host) GetAccessIP ¶
GetAccessIP returns the IP to reach the Host
func (*Host) GetDefaultSubnet ¶
GetDefaultSubnet returns the Networking instance corresponding to Host default subnet
func (*Host) GetMounts ¶
func (instance *Host) GetMounts() (mounts *propertiesv1.HostMounts, xerr fail.Error)
GetMounts returns the information abouts the mounts of the Host
func (*Host) GetPrivateIP ¶
GetPrivateIP returns the private IP of the Host on its default Networking
func (*Host) GetPrivateIPOnSubnet ¶
GetPrivateIPOnSubnet returns the private IP of the Host on its default Subnet
func (*Host) GetPublicIP ¶
GetPublicIP returns the public IP address of the Host
func (*Host) GetSSHConfig ¶
GetSSHConfig loads SSH configuration for Host from metadata
func (*Host) GetShare ¶
GetShare returns a clone of the propertiesv1.HostShare corresponding to share 'shareRef'
func (*Host) GetShares ¶
func (instance *Host) GetShares() (shares *propertiesv1.HostShares, xerr fail.Error)
GetShares returns the information about the shares hosted by the Host
func (*Host) GetVolumes ¶
func (instance *Host) GetVolumes() (_ *propertiesv1.HostVolumes, xerr fail.Error)
GetVolumes returns information about volumes attached to the Host
func (*Host) InstallMethods ¶
func (instance *Host) InstallMethods() map[uint8]installmethod.Enum
InstallMethods returns a list of installation methods useable on the target, ordered from upper to lower preference (1 = highest preference) satisfies interface install.Targetable
func (*Host) InstalledFeatures ¶
InstalledFeatures returns a list of installed features satisfies interface install.Targetable
func (*Host) IsClusterMember ¶
IsClusterMember returns true if the Host is member of a cluster
func (*Host) IsFeatureInstalled ¶
IsFeatureInstalled ...
func (*Host) ListSecurityGroups ¶
func (instance *Host) ListSecurityGroups(state securitygroupstate.Enum) (list []*propertiesv1.SecurityGroupBond, xerr fail.Error)
ListSecurityGroups returns a slice of security groups binded to Host
func (*Host) Pull ¶
func (instance *Host) Pull( ctx context.Context, target, source string, timeout time.Duration, ) (_ int, _ string, _ string, xerr fail.Error)
Pull downloads a file from Host
func (*Host) Push ¶
func (instance *Host) Push( ctx context.Context, source, target, owner, mode string, timeout time.Duration, ) (_ int, _ string, _ string, xerr fail.Error)
Push uploads a file to Host
func (*Host) PushStringToFile ¶
func (instance *Host) PushStringToFile(ctx context.Context, content string, filename string) (xerr fail.Error)
PushStringToFile creates a file 'filename' on remote 'Host' with the content 'content'
func (*Host) PushStringToFileWithOwnership ¶
func (instance *Host) PushStringToFileWithOwnership( ctx context.Context, content string, filename string, owner, mode string, ) (xerr fail.Error)
PushStringToFileWithOwnership creates a file 'filename' on remote 'Host' with the content 'content', and apply ownership
func (*Host) RegisterFeature ¶
func (instance *Host) RegisterFeature(feat resources.Feature, requiredBy resources.Feature, clusterContext bool) (xerr fail.Error)
RegisterFeature registers an installed Feature in metadata of Host
func (*Host) RelaxedDeleteHost ¶
RelaxedDeleteHost is the method that really deletes a host, being a gateway or not
func (*Host) Resize ¶
func (instance *Host) Resize(ctx context.Context, hostSize abstract.HostSizingRequirements) (xerr fail.Error)
Resize ... not yet implemented
func (*Host) Run ¶
func (instance *Host) Run( ctx context.Context, cmd string, outs outputs.Enum, connectionTimeout, executionTimeout time.Duration, ) (_ int, _ string, _ string, xerr fail.Error)
Run tries to execute command 'cmd' on the Host
func (*Host) TargetType ¶
func (instance *Host) TargetType() featuretargettype.Enum
TargetType returns the type of the target. satisfies install.Targetable interface.
func (*Host) ToProtocol ¶
ToProtocol convert a resources.Host to protocol.Host
func (*Host) UnbindSecurityGroup ¶
func (instance *Host) UnbindSecurityGroup(ctx context.Context, sgInstance resources.SecurityGroup) (xerr fail.Error)
UnbindSecurityGroup unbinds a security group from the Host
func (*Host) UnregisterFeature ¶
UnregisterFeature unregisters a Feature from Cluster metadata
type Installer ¶
type Installer interface {
Check(context.Context, resources.Feature, resources.Targetable, data.Map, resources.FeatureSettings) (resources.Results, fail.Error) // checks if a Feature is installed
Add(context.Context, resources.Feature, resources.Targetable, data.Map, resources.FeatureSettings) (resources.Results, fail.Error) // executes installation of Feature
Remove(context.Context, resources.Feature, resources.Targetable, data.Map, resources.FeatureSettings) (resources.Results, fail.Error) // executes deletion of Feature
}
Installer defines the API of an Installer
func NewAptInstaller ¶
func NewAptInstaller() Installer
NewAptInstaller creates a new instance of Installer using script
func NewDnfInstaller ¶
func NewDnfInstaller() Installer
NewDnfInstaller creates a new instance of Installer using script
func NewYumInstaller ¶
func NewYumInstaller() Installer
NewYumInstaller creates a new instance of Installer using script
type Item ¶
Item is a helper struct to ease the copy of local files to remote
func (Item) RemoveRemote ¶
RemoveRemote deletes the remote file from host
type KongController ¶
type KongController struct {
// contains filtered or unexported fields
}
KongController allows to control Kong, installed on a host
func NewKongController ¶
func NewKongController(ctx context.Context, svc iaas.Service, subnet resources.Subnet, addressPrimaryGateway bool) (*KongController, fail.Error)
NewKongController creates a controller for Kong
func (*KongController) Apply ¶
func (k *KongController) Apply(ctx context.Context, rule map[interface{}]interface{}, values *data.Map) (string, fail.Error)
Apply applies the rule to Kong proxy Currently, support rule types 'service', 'route' and 'upstream' Returns rule name and error
func (*KongController) GetHostname ¶
func (k *KongController) GetHostname() string
GetHostname returns the name of the Host that corresponds to this instance
type MetadataCore ¶
type MetadataCore struct {
// contains filtered or unexported fields
}
MetadataCore contains the core functions of a persistent object
func NewCore ¶
func NewCore(svc iaas.Service, kind string, path string, instance data.Clonable) (_ *MetadataCore, xerr fail.Error)
NewCore creates an instance of MetadataCore
func NullCore ¶
func NullCore() *MetadataCore
func (*MetadataCore) AddObserver ¶
func (c *MetadataCore) AddObserver(o observer.Observer) error
AddObserver ... satisfies interface data.Observable
func (*MetadataCore) Alter ¶
func (c *MetadataCore) Alter(callback resources.Callback, options ...data.ImmutableKeyValue) (xerr fail.Error)
Alter protects the data for exclusive write Valid keyvalues for options are : - "Reload": bool = allow to disable reloading from Object Storage if set to false (default is true)
func (*MetadataCore) BrowseFolder ¶
BrowseFolder walks through MetadataFolder and executes a callback for each entry
func (*MetadataCore) Carry ¶
func (c *MetadataCore) Carry(clonable data.Clonable) (xerr fail.Error)
Carry links metadata with real data If c is already carrying a shielded data, returns fail.NotAvailableError
errors returned : - fail.ErrInvalidInstance - fail.ErrInvalidParameter - fail.ErrNotAvailable if the MetadataCore instance already carries a data
func (*MetadataCore) Delete ¶
func (c *MetadataCore) Delete() (xerr fail.Error)
Delete deletes the metadata
func (*MetadataCore) Deserialize ¶
func (c *MetadataCore) Deserialize(buf []byte) (xerr fail.Error)
Deserialize reads json code and reinstantiates
func (*MetadataCore) Destroyed ¶
func (c *MetadataCore) Destroyed()
Destroyed is used to tell cache that the instance has been deleted and MUST be removed from cache. Note: Does nothing for now, prepared for future use satisfies interface data.Cacheable
func (*MetadataCore) GetID ¶
func (c *MetadataCore) GetID() string
GetID returns the id of the data protected satisfies interface data.Identifiable
func (*MetadataCore) GetKind ¶
func (c *MetadataCore) GetKind() string
GetKind returns the kind of object served
func (*MetadataCore) GetName ¶
func (c *MetadataCore) GetName() string
GetName returns the name of the data protected satisfies interface data.Identifiable
func (*MetadataCore) GetService ¶
func (c *MetadataCore) GetService() iaas.Service
GetService returns the iaas.GetService used to create/load the persistent object
func (*MetadataCore) Inspect ¶
func (c *MetadataCore) Inspect(callback resources.Callback) (xerr fail.Error)
Inspect protects the data for shared read
func (*MetadataCore) IsNull ¶
func (c *MetadataCore) IsNull() bool
IsNull returns true if the MetadataCore instance represents the null value for MetadataCore
func (*MetadataCore) NotifyObservers ¶
func (c *MetadataCore) NotifyObservers() error
NotifyObservers sends a signal to all registered Observers to notify change Satisfies interface data.Observable
func (*MetadataCore) Read ¶
func (c *MetadataCore) Read(ref string) (xerr fail.Error)
Read gets the data from Object Storage
func (*MetadataCore) ReadByID ¶
func (c *MetadataCore) ReadByID(id string) (xerr fail.Error)
ReadByID reads a metadata identified by ID from Object Storage
func (*MetadataCore) Released ¶
func (c *MetadataCore) Released()
Released is used to tell cache that the instance has been used and will not be anymore. Helps the cache handler to know when a cached item can be removed from cache (if needed) Note: Does nothing for now, prepared for future use satisfies interface data.Cacheable
func (*MetadataCore) Reload ¶
func (c *MetadataCore) Reload() (xerr fail.Error)
Reload reloads the content from the Object Storage
func (*MetadataCore) RemoveObserver ¶
func (c *MetadataCore) RemoveObserver(name string) error
RemoveObserver ...
func (*MetadataCore) Review ¶
func (c *MetadataCore) Review(callback resources.Callback) (xerr fail.Error)
Review allows to access data contained in the instance, without reloading from the Object Storage; it's intended to speed up operations that accept data is not up-to-date (for example, SSH configuration to access host should not change thru time).
type MetadataFolder ¶
type MetadataFolder struct {
// contains filtered or unexported fields
}
MetadataFolder describes a metadata MetadataFolder
func NewMetadataFolder ¶
NewMetadataFolder creates a new Metadata MetadataFolder object, ready to help access the metadata inside it
func (MetadataFolder) Browse ¶
func (f MetadataFolder) Browse(path string, callback folderDecoderCallback) fail.Error
Browse browses the content of a specific path in Metadata and executes 'callback' on each entry
func (MetadataFolder) Delete ¶
func (f MetadataFolder) Delete(path string, name string) fail.Error
Delete removes metadata passed as parameter
func (MetadataFolder) GetBucket ¶
func (f MetadataFolder) GetBucket() (abstract.ObjectStorageBucket, fail.Error)
GetBucket returns the bucket used by the MetadataFolder to store Object Storage
func (MetadataFolder) GetService ¶
func (f MetadataFolder) GetService() iaas.Service
GetService returns the service used by the MetadataFolder
func (*MetadataFolder) IsNull ¶
func (f *MetadataFolder) IsNull() bool
IsNull tells if the MetadataFolder instance should be considered as a null value
func (MetadataFolder) Lookup ¶
func (f MetadataFolder) Lookup(path string, name string) fail.Error
Lookup tells if the object named 'name' is inside the ObjectStorage MetadataFolder
func (MetadataFolder) Path ¶
func (f MetadataFolder) Path() string
Path returns the base path of the MetadataFolder
func (MetadataFolder) Read ¶
func (f MetadataFolder) Read(path string, name string, callback func([]byte) fail.Error, options ...datadef.ImmutableKeyValue) fail.Error
Read loads the content of the object stored in metadata bucket returns true, nil if the object has been found returns false, fail.Error if an error occurred (including object not found) The callback function has to know how to decode it and where to store the result
func (MetadataFolder) Write ¶
func (f MetadataFolder) Write(path string, name string, content []byte, options ...datadef.ImmutableKeyValue) fail.Error
Write writes the content in Object Storage, and check the write is committed. Returns nil on success (with assurance the write has been committed on remote side) May return fail.ErrTimeout if the read-after-write operation timed out. Return any other errors that can occur from the remote side
type Network ¶
type Network struct {
*MetadataCore
// contains filtered or unexported fields
}
Network links Object Storage MetadataFolder and Networking
func (*Network) AbandonSubnet ¶
AbandonSubnet unregisters a Subnet from the Network (does not imply the Subnet is deleted)
func (*Network) AdoptSubnet ¶
func (instance *Network) AdoptSubnet(ctx context.Context, subnet resources.Subnet) (xerr fail.Error)
AdoptSubnet registers a Subnet to the Network metadata
func (*Network) Browse ¶
func (instance *Network) Browse(ctx context.Context, callback func(*abstract.Network) fail.Error) (xerr fail.Error)
Browse walks through all the metadata objects in subnet
func (*Network) InspectSubnet ¶
InspectSubnet returns the instance of resources.Subnet corresponding to the subnet referenced by 'ref' attached to the subnet
type RemoteFilesHandler ¶
type RemoteFilesHandler struct {
// contains filtered or unexported fields
}
RemoteFilesHandler handles the copy of files and cleanup
func (*RemoteFilesHandler) Add ¶
func (rfh *RemoteFilesHandler) Add(file *Item)
Add adds an Item in the handler
func (*RemoteFilesHandler) Cleanup ¶
Cleanup executes the removal of remote files. NOTE: Removal of local files is the responsibility of the caller, not the RemoteFilesHandler. TODO: allow to cleanup on many hosts
func (*RemoteFilesHandler) Count ¶
func (rfh *RemoteFilesHandler) Count() uint
Count returns the number of files in the handler
type SecurityGroup ¶
type SecurityGroup struct {
*MetadataCore
// contains filtered or unexported fields
}
SecurityGroup ... follows interface resources.SecurityGroup
func LoadSecurityGroup ¶
LoadSecurityGroup ...
func NewSecurityGroup ¶
func NewSecurityGroup(svc iaas.Service) (*SecurityGroup, fail.Error)
NewSecurityGroup ...
func SecurityGroupNullValue ¶
func SecurityGroupNullValue() *SecurityGroup
SecurityGroupNullValue returns a *SecurityGroup corresponding to ShareNullValue
func (*SecurityGroup) AddRule ¶
func (instance *SecurityGroup) AddRule(ctx context.Context, rule *abstract.SecurityGroupRule) (xerr fail.Error)
AddRule adds a rule to a security group
func (*SecurityGroup) AddRules ¶
func (instance *SecurityGroup) AddRules(ctx context.Context, rules abstract.SecurityGroupRules) (xerr fail.Error)
AddRules adds rules to a Security Group
func (*SecurityGroup) BindToHost ¶
func (instance *SecurityGroup) BindToHost(ctx context.Context, hostInstance resources.Host, enable resources.SecurityGroupActivation, mark resources.SecurityGroupMark) (xerr fail.Error)
BindToHost binds the security group to a host.
func (*SecurityGroup) BindToSubnet ¶
func (instance *SecurityGroup) BindToSubnet(ctx context.Context, subnetInstance resources.Subnet, enable resources.SecurityGroupActivation, mark resources.SecurityGroupMark) (xerr fail.Error)
BindToSubnet binds the security group to a host This method assumes the Subnet is not called while the Subnet is currently locked (otherwise will deadlock...)
func (*SecurityGroup) Browse ¶
func (instance *SecurityGroup) Browse(ctx context.Context, callback func(*abstract.SecurityGroup) fail.Error) (xerr fail.Error)
Browse walks through SecurityGroup MetadataFolder and executes a callback for each entries
func (*SecurityGroup) CheckConsistency ¶
func (instance *SecurityGroup) CheckConsistency(_ context.Context) fail.Error
CheckConsistency checks the rules in the security group on provider side are identical to the ones registered in metadata
func (*SecurityGroup) Clear ¶
func (instance *SecurityGroup) Clear(ctx context.Context) (xerr fail.Error)
Clear removes all rules from a security group
func (*SecurityGroup) Create ¶
func (instance *SecurityGroup) Create(ctx context.Context, networkID, name, description string, rules abstract.SecurityGroupRules) (ferr fail.Error)
Create creates a new SecurityGroup and its metadata. If needed by Cloud Provider, the Security Group will be attached to Network identified by 'networkID' (otherwise this parameter is ignored) If the metadata is already carrying a SecurityGroup, returns fail.ErrNotAvailable
func (*SecurityGroup) DeleteRule ¶
func (instance *SecurityGroup) DeleteRule(ctx context.Context, rule *abstract.SecurityGroupRule) (xerr fail.Error)
DeleteRule deletes a rule identified by its ID from a security group If rule is not in the security group, returns *fail.ErrNotFound
func (*SecurityGroup) GetBoundHosts ¶
func (instance *SecurityGroup) GetBoundHosts(ctx context.Context) (_ []*propertiesv1.SecurityGroupBond, xerr fail.Error)
GetBoundHosts returns the list of ID of hosts bound to the security group
func (*SecurityGroup) GetBoundSubnets ¶
func (instance *SecurityGroup) GetBoundSubnets(ctx context.Context) (list []*propertiesv1.SecurityGroupBond, xerr fail.Error)
GetBoundSubnets returns the subnet bound to the security group
func (*SecurityGroup) IsNull ¶
func (instance *SecurityGroup) IsNull() bool
IsNull tests if instance is nil or empty
func (*SecurityGroup) Reset ¶
func (instance *SecurityGroup) Reset(ctx context.Context) (xerr fail.Error)
Reset clears a security group and re-adds associated rules as stored in metadata
func (*SecurityGroup) ToProtocol ¶
func (instance *SecurityGroup) ToProtocol() (_ *protocol.SecurityGroupResponse, xerr fail.Error)
ToProtocol converts a Security Group to protobuf message
func (*SecurityGroup) UnbindFromHost ¶
func (instance *SecurityGroup) UnbindFromHost(ctx context.Context, hostInstance resources.Host) (xerr fail.Error)
UnbindFromHost unbinds the security group from a host
func (*SecurityGroup) UnbindFromHostByReference ¶
func (instance *SecurityGroup) UnbindFromHostByReference(ctx context.Context, hostRef string) (xerr fail.Error)
UnbindFromHostByReference unbinds the security group from a host identified by reference (id or name)
func (*SecurityGroup) UnbindFromSubnet ¶
func (instance *SecurityGroup) UnbindFromSubnet(ctx context.Context, subnetInstance resources.Subnet) (xerr fail.Error)
UnbindFromSubnet unbinds the security group from a subnet
func (*SecurityGroup) UnbindFromSubnetByReference ¶
func (instance *SecurityGroup) UnbindFromSubnetByReference(ctx context.Context, subnetRef string) (xerr fail.Error)
UnbindFromSubnetByReference unbinds the security group from a subnet
type Share ¶
type Share struct {
// contains filtered or unexported fields
}
Share contains information to maintain in Object Storage a list of shared folders
func ShareNullValue ¶
func ShareNullValue() *Share
ShareNullValue returns a *Share representing a null value
func (*Share) Browse ¶
func (instance *Share) Browse(ctx context.Context, callback func(string, string) fail.Error) (xerr fail.Error)
Browse walks through shares MetadataFolder and executes a callback for each entry
func (*Share) Create ¶
func (instance *Share) Create( ctx context.Context, shareName string, server resources.Host, path string, options string, ) (ferr fail.Error)
Create creates a Share on host
func (*Share) GetServer ¶
GetServer returns the Host acting as Share server, with error handling Note: do not forget to call .Released() on returned host when you do not use it anymore
func (*Share) Mount ¶
func (instance *Share) Mount(ctx context.Context, target resources.Host, path string, withCache bool) (_ *propertiesv1.HostRemoteMount, ferr fail.Error)
Mount mounts a Share on a local directory of a host returns a clone of the propertiesv1.HostRemoteMount created on success
func (*Share) ToProtocol ¶
func (instance *Share) ToProtocol() (_ *protocol.ShareMountList, xerr fail.Error)
type ShareIdentity ¶
type ShareIdentity struct {
}
ShareIdentity contains information about a Share
func (ShareIdentity) Clone ¶
func (si ShareIdentity) Clone() data.Clonable
Clone ... satisfies interface data.Clonable
func (*ShareIdentity) Deserialize ¶
func (si *ShareIdentity) Deserialize(buf []byte) (xerr fail.Error)
Deserialize ... satisfies interface data.Serializable
func (ShareIdentity) GetID ¶
func (si ShareIdentity) GetID() string
GetID returns the ID of the Share satisfies interface data.Identifiable
func (ShareIdentity) GetName ¶
func (si ShareIdentity) GetName() string
GetName returns the name of the Share satisfies interface data.Identifiable
func (*ShareIdentity) IsNull ¶
func (si *ShareIdentity) IsNull() bool
IsNull ... satisfies interface data.Clonable
type Subnet ¶
type Subnet struct {
*MetadataCore
// contains filtered or unexported fields
}
Subnet links Object Storage MetadataFolder and Subnet
func LoadSubnet ¶
func LoadSubnet(svc iaas.Service, networkRef, subnetRef string) (subnetInstance *Subnet, ferr fail.Error)
LoadSubnet loads the metadata of a Subnet
func (*Subnet) AttachHost ¶
AttachHost links Host to the Subnet
func (*Subnet) BindSecurityGroup ¶
func (instance *Subnet) BindSecurityGroup(ctx context.Context, sgInstance resources.SecurityGroup, enabled resources.SecurityGroupActivation) (xerr fail.Error)
BindSecurityGroup binds a security group to the Subnet; if enabled is true, apply it immediately
func (*Subnet) Browse ¶
func (instance *Subnet) Browse(ctx context.Context, callback func(*abstract.Subnet) fail.Error) (xerr fail.Error)
Browse walks through all the metadata objects in Subnet
func (*Subnet) Create ¶
func (instance *Subnet) Create(ctx context.Context, req abstract.SubnetRequest, gwname string, gwSizing *abstract.HostSizingRequirements) (ferr fail.Error)
Create creates a Subnet FIXME: split up this function for readability
func (*Subnet) CreateSecurityGroups ¶
func (*Subnet) CreateSubnetWithoutGateway ¶
func (instance *Subnet) CreateSubnetWithoutGateway(ctx context.Context, req abstract.SubnetRequest) (xerr fail.Error)
CreateSubnetWithoutGateway creates a Subnet named like 'singleHostName', without gateway
func (*Subnet) DetachHost ¶
DetachHost unlinks host ID from Subnet
func (*Subnet) DisableSecurityGroup ¶
func (instance *Subnet) DisableSecurityGroup(ctx context.Context, sgInstance resources.SecurityGroup) (xerr fail.Error)
DisableSecurityGroup disables an already binded security group on Subnet
func (*Subnet) EnableSecurityGroup ¶
func (instance *Subnet) EnableSecurityGroup(ctx context.Context, sgInstance resources.SecurityGroup) (xerr fail.Error)
EnableSecurityGroup enables a binded security group to Subnet
func (*Subnet) GetDefaultRouteIP ¶
GetDefaultRouteIP returns the IP of the LAN default route
func (*Subnet) GetEndpointIP ¶
GetEndpointIP returns the internet (public) IP to reach the Subnet
func (*Subnet) GetGatewayPublicIP ¶
GetGatewayPublicIP returns the Public IP of a particular gateway
func (*Subnet) GetGatewayPublicIPs ¶
GetGatewayPublicIPs returns a slice of public IP of gateways
func (*Subnet) GetState ¶
func (instance *Subnet) GetState() (state subnetstate.Enum, xerr fail.Error)
GetState returns the current state of the Subnet
func (*Subnet) GetVirtualIP ¶
GetVirtualIP returns an abstract.VirtualIP used by gateway HA
func (*Subnet) HasVirtualIP ¶
HasVirtualIP tells if the Subnet uses a VIP a default route
func (*Subnet) InspectGateway ¶
InspectGateway returns the gateway related to Subnet
func (*Subnet) InspectGatewaySecurityGroup ¶
func (instance *Subnet) InspectGatewaySecurityGroup() (sgInstance resources.SecurityGroup, xerr fail.Error)
InspectGatewaySecurityGroup returns the instance of SecurityGroup in Subnet related to external access on gateways
func (*Subnet) InspectInternalSecurityGroup ¶
func (instance *Subnet) InspectInternalSecurityGroup() (sg resources.SecurityGroup, xerr fail.Error)
InspectInternalSecurityGroup returns the instance of SecurityGroup for internal security inside the Subnet
func (*Subnet) InspectNetwork ¶
InspectNetwork returns the Network instance owning the Subnet
func (*Subnet) InspectPublicIPSecurityGroup ¶
func (instance *Subnet) InspectPublicIPSecurityGroup() (sg resources.SecurityGroup, xerr fail.Error)
InspectPublicIPSecurityGroup returns the instance of SecurityGroup in Subnet for Hosts with Public IP (which does not apply on gateways)
func (*Subnet) ListHosts ¶
ListHosts returns the list of Hosts attached to the Subnet (excluding gateway)
func (*Subnet) ListSecurityGroups ¶
func (instance *Subnet) ListSecurityGroups(ctx context.Context, state securitygroupstate.Enum) (list []*propertiesv1.SecurityGroupBond, xerr fail.Error)
ListSecurityGroups returns a slice of security groups bound to Subnet
func (*Subnet) Released ¶
func (instance *Subnet) Released()
Released overloads core.Released() to release the parent Network instance
func (*Subnet) ToProtocol ¶
ToProtocol converts resources.Network to protocol.Network
func (*Subnet) UnbindSecurityGroup ¶
func (instance *Subnet) UnbindSecurityGroup(ctx context.Context, sgInstance resources.SecurityGroup) (xerr fail.Error)
UnbindSecurityGroup unbinds a security group from the host
type Tenant ¶
Tenant structure to handle name and GetService for a tenant
func CurrentTenant ¶
func CurrentTenant() *Tenant
CurrentTenant returns the tenant used for commands or, if not set, set the tenant to use if it is the only one registered
Source Files
¶
- bucket.go
- cluster.go
- clusterinstall.go
- clustertasks.go
- clusterunsafe.go
- debug.go
- embeddedfeatures.go
- error.go
- feature.go
- featureresults.go
- host.go
- hostinstall.go
- hostunsafe.go
- installbybash.go
- installbynone.go
- installbyospkg.go
- installer.go
- installstep.go
- installworker.go
- kongctl.go
- metadata.go
- metadatacore.go
- metadatafolder.go
- network.go
- remotefile.go
- securitygroup.go
- securitygrouptasks.go
- securitygroupunsafe.go
- share.go
- subnet.go
- subnettasks.go
- subnetunsafe.go
- tenant.go
- volume.go
- volumeunsafe.go