provider

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2024 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CmdDeploymentCreate                  string = "deployment_create"
	CmdDeploymentCreateImages            string = "deployment_create_images"
	CmdDeploymentRestoreInstances        string = "deployment_restore_instances"
	CmdDeploymentDeleteImages            string = "deployment_delete_images"
	CmdDeploymentDelete                  string = "deployment_delete"
	CmdListDeployments                   string = "list_deployments"
	CmdListDeploymentResources           string = "list_deployment_resources"
	CmdCreateFloatingIps                 string = "create_floating_ips"
	CmdDeleteFloatingIps                 string = "delete_floating_ips"
	CmdCreateSecurityGroups              string = "create_security_groups"
	CmdDeleteSecurityGroups              string = "delete_security_groups"
	CmdCreateNetworking                  string = "create_networking"
	CmdDeleteNetworking                  string = "delete_networking"
	CmdCreateVolumes                     string = "create_volumes"
	CmdDeleteVolumes                     string = "delete_volumes"
	CmdCreateInstances                   string = "create_instances"
	CmdDeleteInstances                   string = "delete_instances"
	CmdAttachVolumes                     string = "attach_volumes"
	CmdDetachVolumes                     string = "detach_volumes"
	CmdUploadFiles                       string = "upload_files"
	CmdDownloadFiles                     string = "download_files"
	CmdInstallServices                   string = "install_services"
	CmdConfigServices                    string = "config_services"
	CmdStartServices                     string = "start_services"
	CmdStopServices                      string = "stop_services"
	CmdPingInstances                     string = "ping_instances"
	CmdCreateSnapshotImages              string = "create_snapshot_images"
	CmdCreateInstancesFromSnapshotImages string = "create_instances_from_snapshot_images"
	CmdDeleteSnapshotImages              string = "delete_snapshot_images"
	CmdCheckCassStatus                   string = "check_cassandra_status"
)
View Source
const MaxWorkerThreads int = 50

Variables

This section is empty.

Functions

func IsCmdRequiresNicknames added in v0.0.3

func IsCmdRequiresNicknames(cmd string) bool

Types

type AssumeRoleConfig

type AssumeRoleConfig struct {
	// AWS members:
	RoleArn    string `json:"role_arn"`
	ExternalId string `json:"external_id"`
}

type AwsCtx

type AwsCtx struct {
	Config        aws.Config
	Ec2Client     *ec2.Client
	TaggingClient *resourcegroupstaggingapi.Client
}

type AwsDeployProvider

type AwsDeployProvider struct {
	DeployCtx *DeployCtx
}

func (*AwsDeployProvider) AttachVolume

func (p *AwsDeployProvider) AttachVolume(iNickname string, volNickname string) (l.LogMsg, error)

func (*AwsDeployProvider) CheckCassStatus added in v0.0.3

func (p *AwsDeployProvider) CheckCassStatus() (l.LogMsg, error)

func (*AwsDeployProvider) CreateFloatingIps

func (p *AwsDeployProvider) CreateFloatingIps() (l.LogMsg, error)

func (*AwsDeployProvider) CreateInstanceAndWaitForCompletion

func (p *AwsDeployProvider) CreateInstanceAndWaitForCompletion(iNickname string, flavorId string, imageId string) (l.LogMsg, error)

func (*AwsDeployProvider) CreateInstanceFromSnapshotImageAndWaitForCompletion

func (p *AwsDeployProvider) CreateInstanceFromSnapshotImageAndWaitForCompletion(iNickname string, flavorId string) (l.LogMsg, error)

aws ec2 run-instances --region "us-east-1" --image-id ami-0bfdcfac85eb09d46 --count 1 --instance-type c7g.large --key-name $CAPIDEPLOY_AWS_SSH_ROOT_KEYPAIR_NAME --subnet-id subnet-09e2ba71bb1a5df94 --security-group-id sg-090b9d1ef7a1d1914 --private-ip-address 10.5.1.10 aws ec2 associate-address --instance-id i-0c4b32d20a1671b1e --public-ip 54.86.220.208

func (*AwsDeployProvider) CreateNetworking

func (p *AwsDeployProvider) CreateNetworking() (l.LogMsg, error)

func (*AwsDeployProvider) CreateSecurityGroups

func (p *AwsDeployProvider) CreateSecurityGroups() (l.LogMsg, error)

func (*AwsDeployProvider) CreateSnapshotImage

func (p *AwsDeployProvider) CreateSnapshotImage(iNickname string) (l.LogMsg, error)

func (*AwsDeployProvider) CreateVolume

func (p *AwsDeployProvider) CreateVolume(iNickname string, volNickname string) (l.LogMsg, error)

func (*AwsDeployProvider) DeleteFloatingIps

func (p *AwsDeployProvider) DeleteFloatingIps() (l.LogMsg, error)

func (*AwsDeployProvider) DeleteInstance

func (p *AwsDeployProvider) DeleteInstance(iNickname string, ignoreAttachedVolumes bool) (l.LogMsg, error)

func (*AwsDeployProvider) DeleteNetworking

func (p *AwsDeployProvider) DeleteNetworking() (l.LogMsg, error)

func (*AwsDeployProvider) DeleteSecurityGroups

func (p *AwsDeployProvider) DeleteSecurityGroups() (l.LogMsg, error)

func (*AwsDeployProvider) DeleteSnapshotImage

func (p *AwsDeployProvider) DeleteSnapshotImage(iNickname string) (l.LogMsg, error)

func (*AwsDeployProvider) DeleteVolume

func (p *AwsDeployProvider) DeleteVolume(iNickname string, volNickname string) (l.LogMsg, error)

func (*AwsDeployProvider) DetachVolume

func (p *AwsDeployProvider) DetachVolume(iNickname string, volNickname string) (l.LogMsg, error)

func (*AwsDeployProvider) ExecCmdWithNoResult added in v0.0.3

func (p *AwsDeployProvider) ExecCmdWithNoResult(cmd string, nicknames string, execArgs *ExecArgs, cOut chan<- string, cErr chan<- string) error

func (*AwsDeployProvider) HarvestImageIds

func (p *AwsDeployProvider) HarvestImageIds(imageMap map[string]bool) (l.LogMsg, error)

func (*AwsDeployProvider) HarvestInstanceTypesByFlavorNames

func (p *AwsDeployProvider) HarvestInstanceTypesByFlavorNames(flavorMap map[string]string) (l.LogMsg, error)

func (*AwsDeployProvider) ListDeploymentResources

func (p *AwsDeployProvider) ListDeploymentResources(cOut chan<- string, cErr chan<- string) ([]*cld.Resource, error)

func (*AwsDeployProvider) ListDeployments

func (p *AwsDeployProvider) ListDeployments(cOut chan<- string, cErr chan<- string) (map[string]int, error)

func (*AwsDeployProvider) PopulateInstanceExternalAddressByName

func (p *AwsDeployProvider) PopulateInstanceExternalAddressByName() (l.LogMsg, error)

func (*AwsDeployProvider) VerifyKeypairs

func (p *AwsDeployProvider) VerifyKeypairs(keypairMap map[string]struct{}) (l.LogMsg, error)

type CombinedCmdCall added in v0.0.3

type CombinedCmdCall struct {
	Cmd       string
	Nicknames string
	OnFail    StopOnFailType
}

type DeployCtx

type DeployCtx struct {
	Project   *prj.Project
	GoCtx     context.Context
	IsVerbose bool
	Tags      map[string]string
	// AWS members:
	Aws *AwsCtx
}

type DeployProvider

type DeployProvider interface {
	ListDeployments(cOut chan<- string, cErr chan<- string) (map[string]int, error)
	ListDeploymentResources(cOut chan<- string, cErr chan<- string) ([]*cld.Resource, error)
	ExecCmdWithNoResult(cmd string, nicknames string, execArgs *ExecArgs, cOut chan<- string, cErr chan<- string) error
}

func DeployProviderFactory

func DeployProviderFactory(project *prj.Project, goCtx context.Context, assumeRoleCfg *AssumeRoleConfig, isVerbose bool, cOut chan<- string, cErr chan<- string) (DeployProvider, error)

type ExecArgs added in v0.0.3

type ExecArgs struct {
	IgnoreAttachedVolumes bool
	Verbosity             bool
	NumberOfRepetitions   int
	ShowProjectDetails    bool
}

type SingleThreadCmdHandler added in v0.0.3

type SingleThreadCmdHandler func() (l.LogMsg, error)

type StopOnFailType added in v0.0.3

type StopOnFailType int
const (
	StopOnFail StopOnFailType = iota
	IgnoreFail
)

Jump to

Keyboard shortcuts

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