arc

package
v0.0.0-...-be40240 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2022 License: BSD-2-Clause Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Help

func Help()

Help provides the command line help for the arc command.

func New

func New(cfg *config.Arc) (*arc, error)

New is the constructor for an arc object. It returns a non-nil error upon failure.

func RegisterClusterFactory

func RegisterClusterFactory(name string, f ClusterFactory)

func RegisterInstanceFactory

func RegisterInstanceFactory(name string, f InstanceFactory)

func RegisterPodFactory

func RegisterPodFactory(name string, f PodFactory)

Types

type Cluster

type Cluster struct {
	*resource.Resources
	*config.Cluster
	// contains filtered or unexported fields
}

func NewDefaultCluster

func NewDefaultCluster(compute resource.Compute, prov provider.DataCenter, cfg *config.Cluster) (*Cluster, error)

newDefaultCluster is the default cluster contructor.

func (*Cluster) Audit

func (c *Cluster) Audit(flags ...string) error

func (*Cluster) Compute

func (c *Cluster) Compute() resource.Compute

Compute provides access to Cluster's parent. Compute satisfies the resource.Cluster interface.

func (*Cluster) Create

func (c *Cluster) Create(req *route.Request) route.Response

func (*Cluster) Derived

func (c *Cluster) Derived() resource.Cluster

func (*Cluster) Destroy

func (c *Cluster) Destroy(req *route.Request) route.Response

func (*Cluster) FindInstance

func (c *Cluster) FindInstance(name string) resource.Instance

FindInstance finds an instance from this cluster by name. Instances must be uniquely named. The instance name convention is "<pod name>-<instance number>". FindInstance satisfies the resource.Cluster interface.

func (*Cluster) FindInstanceByIP

func (c *Cluster) FindInstanceByIP(ip string) resource.Instance

FindInstanceByIP find and instance from this cluster by ip address. FindInstaneByIP satisfies the resource.Cluster interface.

func (*Cluster) FindPod

func (c *Cluster) FindPod(name string) resource.Pod

Find pod by name. This implies pods are named uniquely. FindPod satisfies the resource.Cluster interface.

func (*Cluster) MidAudit

func (c *Cluster) MidAudit(flags ...string) error

func (*Cluster) Pods

func (c *Cluster) Pods() resource.Pods

Pods provides access to Compute's child pods. Pods satisfies the resource.Cluster interface.

func (*Cluster) PostAudit

func (c *Cluster) PostAudit(flags ...string) error

func (*Cluster) PostCreate

func (c *Cluster) PostCreate(req *route.Request) route.Response

func (*Cluster) PostDestroy

func (c *Cluster) PostDestroy(req *route.Request) route.Response

func (*Cluster) PostProvision

func (c *Cluster) PostProvision(req *route.Request) route.Response

func (*Cluster) PostReplace

func (c *Cluster) PostReplace(req *route.Request) route.Response

func (*Cluster) PostRestart

func (c *Cluster) PostRestart(req *route.Request) route.Response

func (*Cluster) PostStart

func (c *Cluster) PostStart(req *route.Request) route.Response

func (*Cluster) PostStop

func (c *Cluster) PostStop(req *route.Request) route.Response

func (*Cluster) PreAudit

func (c *Cluster) PreAudit(flags ...string) error

func (*Cluster) PreCreate

func (c *Cluster) PreCreate(req *route.Request) route.Response

func (*Cluster) PreDestroy

func (c *Cluster) PreDestroy(req *route.Request) route.Response

func (*Cluster) PreProvision

func (c *Cluster) PreProvision(req *route.Request) route.Response

func (*Cluster) PreReplace

func (c *Cluster) PreReplace(req *route.Request) route.Response

func (*Cluster) PreRestart

func (c *Cluster) PreRestart(req *route.Request) route.Response

func (*Cluster) PreStart

func (c *Cluster) PreStart(req *route.Request) route.Response

func (*Cluster) PreStop

func (c *Cluster) PreStop(req *route.Request) route.Response

func (*Cluster) Provision

func (c *Cluster) Provision(req *route.Request) route.Response

func (*Cluster) Replace

func (c *Cluster) Replace(req *route.Request) route.Response

func (*Cluster) Restart

func (c *Cluster) Restart(req *route.Request) route.Response

func (*Cluster) Route

func (c *Cluster) Route(req *route.Request) route.Response

Route satisfies the embedded resource.Resource interface in resource.Cluster. Cluster handles load, create, destroy, start, stop, replace, help, config and info requests in order to manage the cluster. All other commands are routed to the cluster's pods.

func (*Cluster) SetDerived

func (c *Cluster) SetDerived(d resource.Cluster)

func (*Cluster) Start

func (c *Cluster) Start(req *route.Request) route.Response

func (*Cluster) Stop

func (c *Cluster) Stop(req *route.Request) route.Response

type Instance

type Instance struct {
	*config.Instance
	// contains filtered or unexported fields
}

func NewDefaultInstance

func NewDefaultInstance(
	pod resource.Pod, subnet resource.Subnet, keypair resource.KeyPair,
	prov provider.DataCenter, cfg *config.Instance,
) (*Instance, error)

newDefaultInstance is the default instance contructor.

func (*Instance) Audit

func (i *Instance) Audit(flags ...string) error

func (*Instance) Create

func (i *Instance) Create(req *route.Request) route.Response

func (*Instance) Created

func (i *Instance) Created() bool

Created returns true is the instance has been created in the provider. This satisfies the resource.Resource interface.

func (*Instance) Derived

func (i *Instance) Derived() resource.Instance

func (*Instance) Destroy

func (i *Instance) Destroy(req *route.Request) route.Response

func (*Instance) Destroyed

func (i *Instance) Destroyed() bool

Destroyed returns true is the instance has not been created in the provider. This satisfies the resource.Resource interface.

func (*Instance) Dns

func (i *Instance) Dns() resource.Dns

Dns provides access to the dns associated with the datacenter.

func (*Instance) FQDNMatch

func (i *Instance) FQDNMatch(fqdns []string) bool

FQDNMatch returns true if the given list of fqdns contains a match to either the private or public fqdn.

func (*Instance) Id

func (i *Instance) Id() string

func (*Instance) ImageId

func (i *Instance) ImageId() string

func (*Instance) KeyName

func (i *Instance) KeyName() string

func (*Instance) KeyPair

func (i *Instance) KeyPair() resource.KeyPair

KeyPair provides access to the keypair that will be assigned to this instance.

func (*Instance) MidAudit

func (i *Instance) MidAudit(flags ...string) error

func (*Instance) Network

func (i *Instance) Network() resource.Network

Network provides access to the network to which instance is associated.

func (*Instance) Pod

func (i *Instance) Pod() resource.Pod

Pod provides access to Instance's parent. Pod satisfies the resource.Instance interface.

func (*Instance) PostAudit

func (i *Instance) PostAudit(flags ...string) error

func (*Instance) PostCreate

func (i *Instance) PostCreate(req *route.Request) route.Response

func (*Instance) PostDestroy

func (i *Instance) PostDestroy(req *route.Request) route.Response

func (*Instance) PostProvision

func (i *Instance) PostProvision(req *route.Request) route.Response

func (*Instance) PostReplace

func (i *Instance) PostReplace(req *route.Request) route.Response

func (*Instance) PostRestart

func (i *Instance) PostRestart(req *route.Request) route.Response

func (*Instance) PostStart

func (i *Instance) PostStart(req *route.Request) route.Response

func (*Instance) PostStop

func (i *Instance) PostStop(req *route.Request) route.Response

func (*Instance) PreAudit

func (i *Instance) PreAudit(flags ...string) error

func (*Instance) PreCreate

func (i *Instance) PreCreate(req *route.Request) route.Response

func (*Instance) PreDestroy

func (i *Instance) PreDestroy(req *route.Request) route.Response

func (*Instance) PreProvision

func (i *Instance) PreProvision(req *route.Request) route.Response

func (*Instance) PreReplace

func (i *Instance) PreReplace(req *route.Request) route.Response

func (*Instance) PreRestart

func (i *Instance) PreRestart(req *route.Request) route.Response

func (*Instance) PreStart

func (i *Instance) PreStart(req *route.Request) route.Response

func (*Instance) PreStop

func (i *Instance) PreStop(req *route.Request) route.Response

func (*Instance) PrivateDnsARecord

func (i *Instance) PrivateDnsARecord() resource.DnsRecord

PrivateDnsARecord returns the dns a record associated with this instance.

func (*Instance) PrivateFQDN

func (i *Instance) PrivateFQDN() string

PrivateFQDN returns the FQDN associated with the private ip address of the instance.

func (*Instance) PrivateHostname

func (i *Instance) PrivateHostname() string

PrivateHostname returns the hostname (without the domain name) associated with the private ip address of the instance.

func (*Instance) PrivateIPAddress

func (i *Instance) PrivateIPAddress() string

func (*Instance) ProviderRoleIdentifier

func (i *Instance) ProviderRoleIdentifier() resource.ProviderRoleIdentifier

func (*Instance) ProviderVolumes

func (i *Instance) ProviderVolumes() []resource.ProviderVolume

func (*Instance) Provision

func (i *Instance) Provision(req *route.Request) route.Response

func (*Instance) PublicDnsARecord

func (i *Instance) PublicDnsARecord() resource.DnsRecord

PublicDnsARecord return the dns a record associated with the public ip address of this instance. If this instance doesn't have a public ip address (most don't) this will return nil.

func (*Instance) PublicFQDN

func (i *Instance) PublicFQDN() string

PublicFQDN returns the FQDN associated with the public ip address of the instance. If this instance doesn't have a public ip address (most don't) this will return an empty string "".

func (*Instance) PublicHostname

func (i *Instance) PublicHostname() string

PublicHostname returns the hostname (without the domain name) associated with the public ip address of the instance.

func (*Instance) PublicIPAddress

func (i *Instance) PublicIPAddress() string

func (*Instance) Replace

func (i *Instance) Replace(req *route.Request) route.Response

func (*Instance) Restart

func (i *Instance) Restart(req *route.Request) route.Response

func (*Instance) RootUser

func (i *Instance) RootUser() string

func (*Instance) Route

func (i *Instance) Route(req *route.Request) route.Response

func (*Instance) SecurityGroups

func (i *Instance) SecurityGroups() []resource.SecurityGroup

SecurityGroups provides access to the security groups to which instance is associated.

func (*Instance) SetDerived

func (i *Instance) SetDerived(d resource.Instance)

func (*Instance) SetTags

func (i *Instance) SetTags(t map[string]string) error

func (*Instance) Start

func (i *Instance) Start(req *route.Request) route.Response

func (*Instance) StartPaging

func (i *Instance) StartPaging(req *route.Request) route.Response

func (*Instance) Started

func (i *Instance) Started() bool

func (*Instance) State

func (i *Instance) State() string

func (*Instance) Stop

func (i *Instance) Stop(req *route.Request) route.Response

func (*Instance) StopPaging

func (i *Instance) StopPaging(req *route.Request) route.Response

func (*Instance) Stopped

func (i *Instance) Stopped() bool

func (*Instance) Subnet

func (i *Instance) Subnet() resource.Subnet

Subnet provides access to the subnet to which instance is allocated.

func (*Instance) UserUpdate

func (i *Instance) UserUpdate(req *route.Request) route.Response

type Pod

type Pod struct {
	*resource.Resources
	*config.Pod
	// contains filtered or unexported fields
}

func NewDefaultPod

func NewDefaultPod(cluster resource.Cluster, prov provider.DataCenter, cfg *config.Pod) (*Pod, error)

newDefaultPod is the default pod contructor.

func (*Pod) Audit

func (p *Pod) Audit(flags ...string) error

func (*Pod) Cluster

func (p *Pod) Cluster() resource.Cluster

Cluster provides access to Pod's parent. Cluster satisfies the resource.Pod interface.

func (*Pod) Create

func (p *Pod) Create(req *route.Request) route.Response

func (*Pod) Derived

func (p *Pod) Derived() resource.Pod

func (*Pod) Destroy

func (p *Pod) Destroy(req *route.Request) route.Response

func (*Pod) DnsCNameRecords

func (p *Pod) DnsCNameRecords() []resource.DnsRecord

DnsCNameRecord returns the configred dns cname record associated with this pod. If this pod doesn't have configured cname record, this will return nil.

func (*Pod) FindInstance

func (p *Pod) FindInstance(name string) resource.Instance

FindInstance finds the instance in this pod by name. This implies instances are named uniquely. The name takes the form "<pod name>-<instance number>". Find instance satisfies the resource.Pod interface.

func (*Pod) FindInstanceByIP

func (p *Pod) FindInstanceByIP(ip string) resource.Instance

FindInstanceByIP finds the instance in this pod by ip address. Find instance satisfies the resource.Pod interface.

func (*Pod) Instances

func (p *Pod) Instances() resource.Instances

Instances provides access to Pod's child instances. Instances satisfies the resource.Pod interface.

func (*Pod) MidAudit

func (p *Pod) MidAudit(flags ...string) error

func (*Pod) PkgName

func (p *Pod) PkgName() string

PkgName returns the name of the servertype rpm or deb associated with this pod.

func (*Pod) PostAudit

func (p *Pod) PostAudit(flags ...string) error

func (*Pod) PostCreate

func (p *Pod) PostCreate(req *route.Request) route.Response

func (*Pod) PostDestroy

func (p *Pod) PostDestroy(req *route.Request) route.Response

func (*Pod) PostProvision

func (p *Pod) PostProvision(req *route.Request) route.Response

func (*Pod) PostReplace

func (p *Pod) PostReplace(req *route.Request) route.Response

func (*Pod) PostRestart

func (p *Pod) PostRestart(req *route.Request) route.Response

func (*Pod) PostStart

func (p *Pod) PostStart(req *route.Request) route.Response

func (*Pod) PostStop

func (p *Pod) PostStop(req *route.Request) route.Response

func (*Pod) PreAudit

func (p *Pod) PreAudit(flags ...string) error

func (*Pod) PreCreate

func (p *Pod) PreCreate(req *route.Request) route.Response

func (*Pod) PreDestroy

func (p *Pod) PreDestroy(req *route.Request) route.Response

func (*Pod) PreProvision

func (p *Pod) PreProvision(req *route.Request) route.Response

func (*Pod) PreReplace

func (p *Pod) PreReplace(req *route.Request) route.Response

func (*Pod) PreRestart

func (p *Pod) PreRestart(req *route.Request) route.Response

func (*Pod) PreStart

func (p *Pod) PreStart(req *route.Request) route.Response

func (*Pod) PreStop

func (p *Pod) PreStop(req *route.Request) route.Response

func (*Pod) PrimaryCname

func (p *Pod) PrimaryCname() resource.DnsRecord

func (*Pod) PrimaryInstance

func (p *Pod) PrimaryInstance() resource.Instance

PrimaryInstance returns the instance associated with the cname record for this pod. If this pod doesn't have a configured cname record or cannot find a primary instance this will return nil.

func (*Pod) Provision

func (p *Pod) Provision(req *route.Request) route.Response

func (*Pod) Replace

func (p *Pod) Replace(req *route.Request) route.Response

func (*Pod) Restart

func (p *Pod) Restart(req *route.Request) route.Response

func (*Pod) Route

func (p *Pod) Route(req *route.Request) route.Response

Route satisfies the embedded resource.Resource interface in resource.Pod. Pod handles load, create, destroy, start, stop, replace, help, config and info requests in order to manage the pod. All other commands are routed to the pod's instances.

func (*Pod) SecondaryInstances

func (p *Pod) SecondaryInstances() []resource.Instance

SecondaryInstances return the instances not associated with the cname record for this pod. If this pod doesn't have a configured cname record or cannot find a primary instance this will return nil.

func (*Pod) SetDerived

func (p *Pod) SetDerived(d resource.Pod)

func (*Pod) Start

func (p *Pod) Start(req *route.Request) route.Response

func (*Pod) Stop

func (p *Pod) Stop(req *route.Request) route.Response

Jump to

Keyboard shortcuts

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