Documentation
¶
Index ¶
- Constants
- func DeleteImage(client *example.Client, cluster string, tenant string, ...) error
- func FindAvailableIP(instanceCIDR string) (string, error)
- func GetImage(client *example.Client, cluster string, tenant string, ...) (string, error)
- func GetImageRepository(client *example.Client, cluster string, tenant string, name string) (string, error)
- func GetTenant(client *example.Client, name string) (string, error)
- func InspectServer(c *example.Client, cluster, tenant, server string) (*iexample.EcsInspectResponse, error)
- func IsExporting(client *example.Client, cluster string, tenant string, server string) (bool, error)
- func ShutoffServer(c *example.Client, cluster, tenant, server string) error
- func SyncImage(client *example.Client, cluster string, tenant string, repository string) error
- type AccessConfig
- type Artifact
- type ImageConfig
- type SSHConfig
- type StepAuth
- type StepCreateImage
- type StepLoadComputeGroup
- type StepLoadNetwork
- type StepLoadResourcePool
- type StepLoadSpec
- type StepLoadTenant
- type StepVncConnect
Constants ¶
const (
BuilderId = "wangweihong.hci"
)
Variables ¶
This section is empty.
Functions ¶
func DeleteImage ¶
func FindAvailableIP ¶
func GetImageRepository ¶
func InspectServer ¶
func IsExporting ¶
Types ¶
type AccessConfig ¶
type AccessConfig struct { // The access key of the HCI to use. // If omitted, the HCI_ENDPOINT environment variable is used. Endpoint string `mapstructure:"endpoint" required:"true" ` // The name of tenant in which to launch the server to create the image. // If omitted, the HCI_TENANT environment variable is used. Tenant string `mapstructure:"tenant" required:"true"` // The name of tenant in which to launch the server to create the image. // If omitted, the HCI_USER environment variable is used. User string `mapstructure:"user" required:"true"` // The name of tenant in which to launch the server to create the image. // If omitted, the HCI_PASSWORD environment variable is used. Password string `mapstructure:"password" required:"true"` }
AccessConfig is for common configuration related to HCI access
func (*AccessConfig) HCIClient ¶
func (c *AccessConfig) HCIClient() (*example.Client, error)
HCIClient is the hci common client
func (*AccessConfig) Prepare ¶
func (c *AccessConfig) Prepare(ctx *interpolate.Context) []error
type Artifact ¶
type Artifact struct { Cluster string Tenant string Repo string // ImageId of built image ImageId string // BuilderIdValue is the unique ID for the builder that created this image BuilderIdValue string // client for performing API stuff. Client *example.Client }
packersdk.Artifact implementation
type ImageConfig ¶
type ImageConfig struct { // The name of the packer image. ImageName string `mapstructure:"image_name" required:"true"` // The description of the packer image. ImageDescription string `mapstructure:"image_description" required:"false"` // The type of the packer image. Available values include: // raw,qcow2, 默认为qcow2 ImageType string `mapstructure:"image_type" required:"false"` // 导出的镜像仓库, 不指定使用原仓库 ExportRepository string `mapstructure:"export_repository" required:"false"` }
ImageConfig is for common configuration related to creating Images.
func (*ImageConfig) Prepare ¶
func (c *ImageConfig) Prepare(ctx *interpolate.Context) []error
type SSHConfig ¶
type SSHConfig struct {
Comm communicator.Config `mapstructure:",squash"`
}
type StepAuth ¶
type StepAuth struct { }
This is a definition of a builder step and should implement multistep.Step
type StepCreateImage ¶
type StepCreateImage struct {
Config ImageConfig
}
func (*StepCreateImage) Cleanup ¶
func (s *StepCreateImage) Cleanup(_ multistep.StateBag)
func (*StepCreateImage) Run ¶
func (s *StepCreateImage) Run(_ context.Context, state multistep.StateBag) multistep.StepAction
Run should execute the purpose of this step
type StepLoadComputeGroup ¶
type StepLoadComputeGroup struct { }
This is a definition of a builder step and should implement multistep.Step
func (*StepLoadComputeGroup) Cleanup ¶
func (s *StepLoadComputeGroup) Cleanup(_ multistep.StateBag)
Cleanup can be used to clean up any artifact created by the step. A step's clean up always run at the end of a build, regardless of whether provisioning succeeds or fails.
func (*StepLoadComputeGroup) Run ¶
func (s *StepLoadComputeGroup) Run(_ context.Context, state multistep.StateBag) multistep.StepAction
Run should execute the purpose of this step
type StepLoadNetwork ¶
type StepLoadNetwork struct { }
func (*StepLoadNetwork) Run ¶
func (s *StepLoadNetwork) Run(_ context.Context, state multistep.StateBag) multistep.StepAction
Run should execute the purpose of this step
type StepLoadResourcePool ¶
type StepLoadResourcePool struct { }
This is a definition of a builder step and should implement multistep.Step
func (*StepLoadResourcePool) Cleanup ¶
func (s *StepLoadResourcePool) Cleanup(_ multistep.StateBag)
Cleanup can be used to clean up any artifact created by the step. A step's clean up always run at the end of a build, regardless of whether provisioning succeeds or fails.
func (*StepLoadResourcePool) Run ¶
func (s *StepLoadResourcePool) Run(_ context.Context, state multistep.StateBag) multistep.StepAction
Run should execute the purpose of this step
type StepLoadSpec ¶
type StepLoadSpec struct {
Spec string
}
This is a definition of a builder step and should implement multistep.Step
func (*StepLoadSpec) Cleanup ¶
func (s *StepLoadSpec) Cleanup(_ multistep.StateBag)
Cleanup can be used to clean up any artifact created by the step. A step's clean up always run at the end of a build, regardless of whether provisioning succeeds or fails.
func (*StepLoadSpec) Run ¶
func (s *StepLoadSpec) Run(_ context.Context, state multistep.StateBag) multistep.StepAction
Run should execute the purpose of this step
type StepLoadTenant ¶
type StepLoadTenant struct {
TargetTenant string
}
This is a definition of a builder step and should implement multistep.Step
func (*StepLoadTenant) Cleanup ¶
func (s *StepLoadTenant) Cleanup(_ multistep.StateBag)
Cleanup can be used to clean up any artifact created by the step. A step's clean up always run at the end of a build, regardless of whether provisioning succeeds or fails.
func (*StepLoadTenant) Run ¶
func (s *StepLoadTenant) Run(_ context.Context, state multistep.StateBag) multistep.StepAction
Run should execute the purpose of this step
type StepVncConnect ¶
type StepVncConnect struct { }
This is a definition of a builder step and should implement multistep.Step
func (*StepVncConnect) Cleanup ¶
func (s *StepVncConnect) Cleanup(_ multistep.StateBag)
Cleanup can be used to clean up any artifact created by the step. A step's clean up always run at the end of a build, regardless of whether provisioning succeeds or fails.
func (*StepVncConnect) ConnectVNC ¶
func (s *StepVncConnect) ConnectVNC(state multistep.StateBag) (*vnc.ClientConn, error)
func (*StepVncConnect) Run ¶
func (s *StepVncConnect) Run(_ context.Context, state multistep.StateBag) multistep.StepAction
Run should execute the purpose of this step