Documentation ¶
Index ¶
- Constants
- func AddLogMsg(sb *strings.Builder, logMsg LogMsg)
- func CmdChainExecToString(title string, logContent string, err error, isVerbose bool) string
- func ExecSshForClient(sshClient *ssh.Client, cmd string) (string, string, error)
- func FileGroupUpDefsToSpecs(prj *Project, fileGroupsToUpload map[string]*FileGroupUpDef) ([]*FileUploadSpec, []*AfterFileUploadSpec, error)
- func FindOpenstackColumnValue(rows []map[string]string, fieldNameToReturn string, fieldNameToSearch string, ...) string
- func FindOpenstackFieldValue(rows []map[string]string, fieldName string) string
- func NewCopyPrivateKeysCommands(iDef *InstanceDef) ([]string, error)
- func NewCreateInstanceUsersCommands(iDef *InstanceDef) ([]string, error)
- func ParseOpenstackOutput(input string) ([]map[string]string, error)
- type AfterFileUploadSpec
- type AttachedVolumeDef
- type ExecResult
- func ExecLocal(prj *Project, cmdPath string, params []string) ExecResult
- func ExecLocalAndParseOpenstackOutput(prj *Project, cmdPath string, params []string) ([]map[string]string, ExecResult)
- func ExecSsh(sshConfig *SshConfigDef, ipAddress string, cmd string) ExecResult
- func ExecSshAndReturnLastLine(sshConfig *SshConfigDef, ipAddress string, cmd string) (string, ExecResult)
- type ExecTimeouts
- type FileDownloadSpec
- type FileGroupDownDef
- type FileGroupUpAfter
- type FileGroupUpDef
- type FileUploadSpec
- type InstanceDef
- type LogBuilder
- type LogMsg
- func AssignFloatingIp(prj *Project, instanceId string, floatingIp string, isVerbose bool) (LogMsg, error)
- func AttachVolume(prjPair *ProjectPair, iNickname string, volNickname string, isVerbose bool) (LogMsg, error)
- func CreateInstance(prjPair *ProjectPair, iNickname string, flavorId string, imageId string, ...) (LogMsg, error)
- func CreateInstanceAndWaitForCompletion(prjPair *ProjectPair, iNickname string, flavorId string, imageId string, ...) (LogMsg, error)
- func CreateNetwork(prjPair *ProjectPair, isVerbose bool) (LogMsg, error)
- func CreateNetworking(prjPair *ProjectPair, isVerbose bool) (LogMsg, error)
- func CreateRouter(prjPair *ProjectPair, isVerbose bool) (LogMsg, error)
- func CreateSecurityGroup(prjPair *ProjectPair, sgNickname string, isVerbose bool) (LogMsg, error)
- func CreateSecurityGroups(prjPair *ProjectPair, isVerbose bool) (LogMsg, error)
- func CreateSubnet(prjPair *ProjectPair, isVerbose bool) (LogMsg, error)
- func CreateVolume(prjPair *ProjectPair, volNickname string, isVerbose bool) (LogMsg, error)
- func DeleteInstance(prjPair *ProjectPair, iNickname string, isVerbose bool) (LogMsg, error)
- func DeleteNetwork(prjPair *ProjectPair, isVerbose bool) (LogMsg, error)
- func DeleteNetworking(prjPair *ProjectPair, isVerbose bool) (LogMsg, error)
- func DeleteRouter(prjPair *ProjectPair, isVerbose bool) (LogMsg, error)
- func DeleteSecurityGroup(prjPair *ProjectPair, sgNickname string, isVerbose bool) (LogMsg, error)
- func DeleteSecurityGroups(prjPair *ProjectPair, isVerbose bool) (LogMsg, error)
- func DeleteSubnet(prjPair *ProjectPair, isVerbose bool) (LogMsg, error)
- func DeleteVolume(prjPair *ProjectPair, volNickname string, isVerbose bool) (LogMsg, error)
- func DownloadFileSftp(prj *Project, ipAddress string, srcPath string, dstPath string, isVerbose bool) (LogMsg, error)
- func ExecCommandsOnInstance(sshConfig *SshConfigDef, ipAddress string, cmds []string, isVerbose bool) (LogMsg, error)
- func ExecScriptsOnInstance(sshConfig *SshConfigDef, ipAddress string, env map[string]string, ...) (LogMsg, error)
- func GetFlavorIds(prjPair *ProjectPair, flavorMap map[string]string, isVerbose bool) (LogMsg, error)
- func GetImageIds(prjPair *ProjectPair, imageMap map[string]string, isVerbose bool) (LogMsg, error)
- func ShowVolumeAttachment(prj *Project, volNickname string, iNickname string, isVerbose bool) (string, LogMsg, error)
- func UploadFileSftp(prj *Project, ipAddress string, srcPath string, dstPath string, ...) (LogMsg, error)
- func WaitForEntityToBeCreated(prj *Project, entityType string, entityName string, entityId string, ...) (LogMsg, error)
- type NetworkDef
- type PrivateKeyDef
- type Project
- type ProjectPair
- func (prjPair *ProjectPair) CleanInstance(iNickname string)
- func (prjPair *ProjectPair) CleanSecurityGroup(sgNickname string)
- func (prjPair *ProjectPair) SetAttachedVolumeDevice(iNickname string, volNickname string, device string)
- func (prjPair *ProjectPair) SetInstanceId(iNickname string, newId string)
- func (prjPair *ProjectPair) SetNetworkId(newId string)
- func (prjPair *ProjectPair) SetRouterId(newId string)
- func (prjPair *ProjectPair) SetSecurityGroupId(sgNickname string, newId string)
- func (prjPair *ProjectPair) SetSecurityGroupRuleId(sgNickname string, ruleIdx int, newId string)
- func (prjPair *ProjectPair) SetSubnetId(newId string)
- func (prjPair *ProjectPair) SetVolumeAttachmentId(iNickname string, volNickname string, newId string)
- func (prjPair *ProjectPair) SetVolumeBlockDeviceId(iNickname string, volNickname string, newId string)
- func (prjPair *ProjectPair) SetVolumeId(volNickname string, newId string)
- type RouterDef
- type RouterInterfaceInfo
- type SecurityGroupDef
- type SecurityGroupRuleDef
- type ServiceCommandsDef
- type ServiceDef
- type SshConfigDef
- type SubnetDef
- type TunneledSshClient
- type UserDef
- type VolumeDef
Constants ¶
View Source
const CopyPrivateKeyFunc string = `` /* 180-byte string literal not displayed */
View Source
const CreateInstanceUserFunc string = `` /* 593-byte string literal not displayed */
View Source
const InitVolumeAttachmentFunc string = `` /* 1289-byte string literal not displayed */
View Source
const LogColorGreen string = "\033[32m"
View Source
const LogColorRed string = "\033[31m"
View Source
const LogColorReset string = "\033[0m"
Variables ¶
This section is empty.
Functions ¶
func CmdChainExecToString ¶
func ExecSshForClient ¶
func FileGroupUpDefsToSpecs ¶
func FileGroupUpDefsToSpecs(prj *Project, fileGroupsToUpload map[string]*FileGroupUpDef) ([]*FileUploadSpec, []*AfterFileUploadSpec, error)
func FindOpenstackFieldValue ¶
func NewCopyPrivateKeysCommands ¶
func NewCopyPrivateKeysCommands(iDef *InstanceDef) ([]string, error)
func NewCreateInstanceUsersCommands ¶
func NewCreateInstanceUsersCommands(iDef *InstanceDef) ([]string, error)
Types ¶
type AfterFileUploadSpec ¶
type AttachedVolumeDef ¶
type ExecResult ¶
func ExecSsh ¶
func ExecSsh(sshConfig *SshConfigDef, ipAddress string, cmd string) ExecResult
func ExecSshAndReturnLastLine ¶
func ExecSshAndReturnLastLine(sshConfig *SshConfigDef, ipAddress string, cmd string) (string, ExecResult)
func (*ExecResult) ToString ¶
func (er *ExecResult) ToString() string
type ExecTimeouts ¶
type FileDownloadSpec ¶
func FileGroupDownDefsToSpecs ¶
func FileGroupDownDefsToSpecs(prj *Project, fileGroupsToDownload map[string]*FileGroupDownDef) ([]*FileDownloadSpec, error)
func InstanceFileGroupDownDefsToSpecs ¶
func InstanceFileGroupDownDefsToSpecs(prj *Project, ipAddress string, fgDef *FileGroupDownDef) ([]*FileDownloadSpec, error)
type FileGroupDownDef ¶
type FileGroupUpAfter ¶
type FileGroupUpDef ¶
type FileUploadSpec ¶
type InstanceDef ¶
type InstanceDef struct { HostName string `json:"host_name"` SecurityGroupNickname string `json:"security_group"` IpAddress string `json:"ip_address"` FloatingIpAddress string `json:"floating_ip_address,omitempty"` FlavorName string `json:"flavor"` ImageName string `json:"image"` AttachedVolumes map[string]*AttachedVolumeDef `json:"attached_volumes,omitempty"` Id string `json:"id"` Users []UserDef `json:"users,omitempty"` PrivateKeys []PrivateKeyDef `json:"private_keys,omitempty"` Service ServiceDef `json:"service"` ApplicableFileGroups []string `json:"applicable_file_groups,omitempty"` }
func (*InstanceDef) BestIpAddress ¶
func (iDef *InstanceDef) BestIpAddress() string
func (*InstanceDef) Clean ¶
func (iDef *InstanceDef) Clean()
type LogBuilder ¶
func NewLogBuilder ¶
func NewLogBuilder(header string, isVerbose bool) *LogBuilder
func (*LogBuilder) Add ¶
func (lb *LogBuilder) Add(content string)
type LogMsg ¶
type LogMsg string
func AssignFloatingIp ¶
func AttachVolume ¶
func CreateInstance ¶
func CreateNetwork ¶
func CreateNetwork(prjPair *ProjectPair, isVerbose bool) (LogMsg, error)
func CreateNetworking ¶
func CreateNetworking(prjPair *ProjectPair, isVerbose bool) (LogMsg, error)
func CreateRouter ¶
func CreateRouter(prjPair *ProjectPair, isVerbose bool) (LogMsg, error)
func CreateSecurityGroup ¶
func CreateSecurityGroup(prjPair *ProjectPair, sgNickname string, isVerbose bool) (LogMsg, error)
func CreateSecurityGroups ¶
func CreateSecurityGroups(prjPair *ProjectPair, isVerbose bool) (LogMsg, error)
func CreateSubnet ¶
func CreateSubnet(prjPair *ProjectPair, isVerbose bool) (LogMsg, error)
func CreateVolume ¶
func CreateVolume(prjPair *ProjectPair, volNickname string, isVerbose bool) (LogMsg, error)
func DeleteInstance ¶
func DeleteInstance(prjPair *ProjectPair, iNickname string, isVerbose bool) (LogMsg, error)
func DeleteNetwork ¶
func DeleteNetwork(prjPair *ProjectPair, isVerbose bool) (LogMsg, error)
func DeleteNetworking ¶
func DeleteNetworking(prjPair *ProjectPair, isVerbose bool) (LogMsg, error)
func DeleteRouter ¶
func DeleteRouter(prjPair *ProjectPair, isVerbose bool) (LogMsg, error)
func DeleteSecurityGroup ¶
func DeleteSecurityGroup(prjPair *ProjectPair, sgNickname string, isVerbose bool) (LogMsg, error)
func DeleteSecurityGroups ¶
func DeleteSecurityGroups(prjPair *ProjectPair, isVerbose bool) (LogMsg, error)
func DeleteSubnet ¶
func DeleteSubnet(prjPair *ProjectPair, isVerbose bool) (LogMsg, error)
func DeleteVolume ¶
func DeleteVolume(prjPair *ProjectPair, volNickname string, isVerbose bool) (LogMsg, error)
func DownloadFileSftp ¶
func ExecCommandsOnInstance ¶
func ExecScriptsOnInstance ¶
func GetFlavorIds ¶
func GetImageIds ¶
func ShowVolumeAttachment ¶
func UploadFileSftp ¶
type NetworkDef ¶
type PrivateKeyDef ¶
type Project ¶
type Project struct { DeploymentName string `json:"deployment_name"` SshConfig *SshConfigDef `json:"ssh_config"` RootKeyName string `json:"root_key_name"` AvailabilityZone string `json:"availability_zone"` Timeouts ExecTimeouts `json:"timeouts"` OpenstackEnvVariables map[string]string `json:"openstack_environment_variables"` SecurityGroups map[string]*SecurityGroupDef `json:"security_groups"` Network NetworkDef `json:"network"` Volumes map[string]*VolumeDef `json:"volumes"` FileGroupsUp map[string]*FileGroupUpDef `json:"file_groups_up"` FileGroupsDown map[string]*FileGroupDownDef `json:"file_groups_down"` Instances map[string]*InstanceDef `json:"instances"` }
func (*Project) SaveProject ¶
type ProjectPair ¶
func LoadProject ¶
func LoadProject(prjFile string, prjParamsFile string) (*ProjectPair, string, error)
func (*ProjectPair) CleanInstance ¶
func (prjPair *ProjectPair) CleanInstance(iNickname string)
func (*ProjectPair) CleanSecurityGroup ¶
func (prjPair *ProjectPair) CleanSecurityGroup(sgNickname string)
func (*ProjectPair) SetAttachedVolumeDevice ¶
func (prjPair *ProjectPair) SetAttachedVolumeDevice(iNickname string, volNickname string, device string)
func (*ProjectPair) SetInstanceId ¶
func (prjPair *ProjectPair) SetInstanceId(iNickname string, newId string)
func (*ProjectPair) SetNetworkId ¶
func (prjPair *ProjectPair) SetNetworkId(newId string)
func (*ProjectPair) SetRouterId ¶
func (prjPair *ProjectPair) SetRouterId(newId string)
func (*ProjectPair) SetSecurityGroupId ¶
func (prjPair *ProjectPair) SetSecurityGroupId(sgNickname string, newId string)
func (*ProjectPair) SetSecurityGroupRuleId ¶
func (prjPair *ProjectPair) SetSecurityGroupRuleId(sgNickname string, ruleIdx int, newId string)
func (*ProjectPair) SetSubnetId ¶
func (prjPair *ProjectPair) SetSubnetId(newId string)
func (*ProjectPair) SetVolumeAttachmentId ¶
func (prjPair *ProjectPair) SetVolumeAttachmentId(iNickname string, volNickname string, newId string)
func (*ProjectPair) SetVolumeBlockDeviceId ¶
func (prjPair *ProjectPair) SetVolumeBlockDeviceId(iNickname string, volNickname string, newId string)
func (*ProjectPair) SetVolumeId ¶
func (prjPair *ProjectPair) SetVolumeId(volNickname string, newId string)
type RouterInterfaceInfo ¶
type SecurityGroupDef ¶
type SecurityGroupDef struct { Name string `json:"name"` Id string `json:"id"` Rules []*SecurityGroupRuleDef `json:"rules"` }
func (*SecurityGroupDef) Clean ¶
func (sg *SecurityGroupDef) Clean()
type SecurityGroupRuleDef ¶
type SecurityGroupRuleDef struct { Desc string `json:"desc"` // human-readable Id string `json:"id"` // guid Protocol string `json:"protocol"` // tcp Ethertype string `json:"ethertype"` // IPv4 RemoteIp string `json:"remote_ip"` // 0.0.0.0/0 Port int `json:"port"` // 22 Direction string `json:"direction"` // ingress }
type ServiceCommandsDef ¶
type ServiceDef ¶
type ServiceDef struct { Env map[string]string `json:"env"` Cmd ServiceCommandsDef `json:"cmd"` }
type SshConfigDef ¶
type TunneledSshClient ¶
type TunneledSshClient struct { ProxySshClient *ssh.Client TunneledTcpConn net.Conn TunneledSshConn ssh.Conn SshClient *ssh.Client }
func NewTunneledSshClient ¶
func NewTunneledSshClient(sshConfig *SshConfigDef, ipAddress string) (*TunneledSshClient, error)
func (*TunneledSshClient) Close ¶
func (tsc *TunneledSshClient) Close()
Click to show internal directories.
Click to hide internal directories.