Documentation ¶
Index ¶
- Constants
- func GeneratePassword(length int) string
- type Builder
- type ConfigProvider
- type ConfigProviders
- type Instance
- type Provider
- func (p *Provider) AccountAWS() error
- func (p *Provider) AccountDO() error
- func (p *Provider) AccountLN() error
- func (p *Provider) Action(actionName string, params ...interface{}) error
- func (p *Provider) BootInstance(id interface{}) (err error)
- func (p *Provider) BootInstanceLN(dropletId int) error
- func (p *Provider) BuildImage() (err error)
- func (p *Provider) ClientAWS()
- func (p *Provider) ClientDO()
- func (p *Provider) ClientLinode() error
- func (p *Provider) ConvertClientAWS() *session.Session
- func (p *Provider) ConvertClientDO() *godo.Client
- func (p *Provider) ConvertClientLinode() linodego.Client
- func (p *Provider) CreateInstance(name string) (err error)
- func (p *Provider) CreateInstanceAWS(InstanceName string) (instanctID string, err error)
- func (p *Provider) CreateInstanceDO(name string) (dropletId int, err error)
- func (p *Provider) CreateInstanceLN(name string) (dropletId int, err error)
- func (p *Provider) CreateSecurityGroup() error
- func (p *Provider) DefaultAWS()
- func (p *Provider) DefaultDO()
- func (p *Provider) DefaultLinode()
- func (p *Provider) DeleteImageAWS(id string) error
- func (p *Provider) DeleteInstance(id string) (err error)
- func (p *Provider) DeleteInstanceAWS(id string) error
- func (p *Provider) DeleteInstanceDO(id string) error
- func (p *Provider) DeleteInstanceLN(id string) error
- func (p *Provider) DeleteOldSnapshot() (err error)
- func (p *Provider) DeleteSnapShotDO(id string) error
- func (p *Provider) DeleteSnapShotLN(id string) error
- func (p *Provider) DeleteSnapshotAWS() error
- func (p *Provider) GetInstanceInfo(id interface{}) (err error)
- func (p *Provider) GetSSHKey() (err error)
- func (p *Provider) GetSSHKeyAWS() error
- func (p *Provider) GetSSHKeyDO() error
- func (p *Provider) GetSSHKeyLN() error
- func (p *Provider) InitClient() (err error)
- func (p *Provider) InitSessionAWS() (*session.Session, error)
- func (p *Provider) InstanceInfoAWS(id string) (Instance, error)
- func (p *Provider) InstanceInfoDO(id int) (Instance, error)
- func (p *Provider) InstanceInfoLN(id int) (Instance, error)
- func (p *Provider) InstanceReady(instanceID string) error
- func (p *Provider) InstanceReboot(instanceID string) error
- func (p *Provider) LinodeDiskMap()
- func (p *Provider) LinodeTest() error
- func (p *Provider) ListInstance() (err error)
- func (p *Provider) ListInstanceAWS() error
- func (p *Provider) ListInstanceDO() error
- func (p *Provider) ListInstanceLN() error
- func (p *Provider) ListSnapShot() (err error)
- func (p *Provider) ListSnapshotAWS() error
- func (p *Provider) ListSnapshotDO() error
- func (p *Provider) ListSnapshotLN() error
- func (p *Provider) MountDiskLN(dropletId int) error
- func (p *Provider) PrePareBuildData()
- func (p *Provider) Prepare()
- func (p *Provider) RunBuild() error
Constants ¶
View Source
const ( GetSSHKey = "get-sshkey" RunBuild = "run-build" ListImage = "list-image" ListInstance = "list-instance" GetInstanceInfo = "get-instance" CreateInstance = "create-instance" BootInstance = "boot-instance" )
Variables ¶
This section is empty.
Functions ¶
func GeneratePassword ¶
Types ¶
type Builder ¶
type Builder struct { BuildRepo string `yaml:"build_repo"` PublicKey string `yaml:"public_key"` SecretKey string `yaml:"secret_key"` }
Builder config for builder file
type ConfigProvider ¶
type ConfigProvider struct { // core part Name string `yaml:"name"` Token string `yaml:"token"` SecretKey string `yaml:"secret_key"` AccessKeyId string `yaml:"access_key"` Provider string `yaml:"provider"` DefaultImage string `yaml:"default_image"` Size string `yaml:"size"` Region string `yaml:"region"` Limit int `yaml:"limit"` Username string `yaml:"username"` // BaseImage string `yaml:"base"` RedactedToken string `yaml:"-"` Snapshot string `yaml:"-"` SnapshotID string `yaml:"-"` InstanceName string `yaml:"-"` PublicIP string `yaml:"-"` SshKey string `yaml:"-"` // for config ProviderFolder string `yaml:"-"` ConfigFile string `yaml:"-"` BuildFile string `yaml:"-"` BuildData map[string]string `yaml:"-"` // for building VarsFile string `yaml:"-"` RunnerFile string `yaml:"-"` BuildCommand string `yaml:"-"` BaseFolder string `yaml:"-"` RawCommand string `yaml:"-"` }
ConfigProvider cloud config file for each provider from ~/osmedeus-base/cloud/provider.yaml
type ConfigProviders ¶
type ConfigProviders struct { Builder Builder `yaml:"builder"` Clouds []ConfigProvider `yaml:"clouds"` }
ConfigProviders cloud config file
func ParseProvider ¶
func ParseProvider(cloudFile string) (ConfigProviders, error)
ParseProvider parse cloud file from ~/osmedeus-base/cloud/provider.yaml
type Provider ¶
type Provider struct { ProviderName string Token string RedactedToken string // for aws only AccessKeyId string SecretKey string SecurityGroupID string SecurityGroupName string Instances []Instance `json:"-"` InstanceLimit int Available bool HealthCheck bool // for create snapshot SnapshotID string SnapshotName string OldSnapShotID []string `json:"-"` SnapshotFound bool SSHKeyFound bool SSHPublicKey string SSHPrivateKey string SSHKeyID string SSHUser string // for create CreatedInstance Instance `json:"-"` Region string Size string SSHKeyName string // mics SwapSizeMap map[string]int `json:"-"` IsBackgroundCheck bool // for building ProviderConfig ConfigProvider `json:"-"` Opt libs.Options `json:"-"` // for retry BackOff *backoff.ExponentialBackOff `json:"-"` // client of vendor Client interface{} `json:"-"` }
func InitProvider ¶
InitProvider init provider object to easier interact with cloud provider
func InitProviderWithConfig ¶
func InitProviderWithConfig(opt libs.Options, providerConfig ConfigProvider) (Provider, error)
InitProviderWithConfig init provider object to easier interact with cloud provider
func (*Provider) AccountAWS ¶
func (*Provider) BootInstance ¶
func (*Provider) BootInstanceLN ¶
func (*Provider) BuildImage ¶
func (*Provider) ClientLinode ¶
func (*Provider) ConvertClientAWS ¶
func (*Provider) ConvertClientDO ¶
func (*Provider) ConvertClientLinode ¶
func (*Provider) CreateInstance ¶
func (*Provider) CreateInstanceAWS ¶
func (*Provider) CreateInstanceDO ¶
func (*Provider) CreateInstanceLN ¶
func (*Provider) CreateSecurityGroup ¶
func (*Provider) DefaultAWS ¶
func (p *Provider) DefaultAWS()
DefaultAWS set some default data for AWS provider
func (*Provider) DefaultDO ¶
func (p *Provider) DefaultDO()
DefaultDO set some default data for DO provider
func (*Provider) DefaultLinode ¶
func (p *Provider) DefaultLinode()
DefaultLinode set some default data for DO provider
func (*Provider) DeleteImageAWS ¶
func (*Provider) DeleteInstance ¶
func (*Provider) DeleteInstanceAWS ¶
func (*Provider) DeleteInstanceDO ¶
func (*Provider) DeleteInstanceLN ¶
func (*Provider) DeleteOldSnapshot ¶
func (*Provider) DeleteSnapShotDO ¶
func (*Provider) DeleteSnapShotLN ¶
func (*Provider) DeleteSnapshotAWS ¶
func (*Provider) GetInstanceInfo ¶
func (*Provider) GetSSHKeyAWS ¶
func (*Provider) GetSSHKeyDO ¶
func (*Provider) GetSSHKeyLN ¶
func (*Provider) InitClient ¶
func (*Provider) InstanceReady ¶
func (*Provider) InstanceReboot ¶
func (*Provider) LinodeDiskMap ¶
func (p *Provider) LinodeDiskMap()
func (*Provider) ListInstance ¶
func (*Provider) ListInstanceAWS ¶
func (*Provider) ListInstanceDO ¶
func (*Provider) ListInstanceLN ¶
func (*Provider) ListSnapShot ¶
func (*Provider) ListSnapshotAWS ¶
func (*Provider) ListSnapshotDO ¶
func (*Provider) ListSnapshotLN ¶
func (*Provider) MountDiskLN ¶
func (*Provider) PrePareBuildData ¶
func (p *Provider) PrePareBuildData()
Click to show internal directories.
Click to hide internal directories.