Documentation ¶
Index ¶
- Constants
- Variables
- func ConvertToInstanceType(cpu, memory int) (string, error)
- func ConvertToVolumeType(volumeClass int) (string, error)
- type CpuAndMemory
- type Provider
- func (p *Provider) CheckResource(ctx context.Context, clusterWrapper *models.ClusterWrapper) error
- func (p *Provider) DescribeClusterDetails(ctx context.Context, cluster *models.ClusterWrapper) error
- func (p *Provider) DescribeRuntimeProviderZones(ctx context.Context, url, credential string) ([]string, error)
- func (p *Provider) DescribeSubnets(ctx context.Context, req *pb.DescribeSubnetsRequest) (*pb.DescribeSubnetsResponse, error)
- func (p *Provider) DescribeVpc(ctx context.Context, runtimeId, vpcId string) (*models.Vpc, error)
- func (p *Provider) HandleSubtask(ctx context.Context, task *models.Task) error
- func (p *Provider) ParseClusterConf(ctx context.Context, versionId, runtimeId, conf string, ...) error
- func (p *Provider) SplitJobIntoTasks(ctx context.Context, job *models.Job) (*models.TaskLayer, error)
- func (p *Provider) UpdateClusterStatus(ctx context.Context, job *models.Job) error
- func (p *Provider) ValidateCredential(ctx context.Context, runtimeId, url, credential, zone string) error
- func (p *Provider) WaitSubtask(ctx context.Context, task *models.Task) error
- type ProviderHandler
- func (p *ProviderHandler) AttachVolumes(task *models.Task) error
- func (p *ProviderHandler) CheckResourceQuotas(ctx context.Context, clusterWrapper *models.ClusterWrapper) error
- func (p *ProviderHandler) CreateVolumes(task *models.Task) error
- func (p *ProviderHandler) DeleteInstances(task *models.Task) error
- func (p *ProviderHandler) DeleteVolumes(task *models.Task) error
- func (p *ProviderHandler) DescribeAvailabilityZoneBySubnetId(runtimeId, subnetId string) (string, error)
- func (p *ProviderHandler) DescribeImage(runtimeId, imageName string) (string, error)
- func (p *ProviderHandler) DescribeKeyPairs(url, credential, zone string) ([]string, error)
- func (p *ProviderHandler) DescribeSubnets(ctx context.Context, req *pb.DescribeSubnetsRequest) (*pb.DescribeSubnetsResponse, error)
- func (p *ProviderHandler) DescribeVpc(runtimeId, vpcId string) (*models.Vpc, error)
- func (p *ProviderHandler) DescribeZones(url, credential string) ([]string, error)
- func (p *ProviderHandler) DetachVolumes(task *models.Task) error
- func (p *ProviderHandler) ResizeInstances(task *models.Task) error
- func (p *ProviderHandler) ResizeVolumes(task *models.Task) error
- func (p *ProviderHandler) RunInstances(task *models.Task) error
- func (p *ProviderHandler) StartInstances(task *models.Task) error
- func (p *ProviderHandler) StopInstances(task *models.Task) error
- func (p *ProviderHandler) WaitAttachVolumes(task *models.Task) error
- func (p *ProviderHandler) WaitCreateVolumes(task *models.Task) error
- func (p *ProviderHandler) WaitDeleteInstances(task *models.Task) error
- func (p *ProviderHandler) WaitDeleteVolumes(task *models.Task) error
- func (p *ProviderHandler) WaitDetachVolumes(task *models.Task) error
- func (p *ProviderHandler) WaitInstanceState(task *models.Task, state string) error
- func (p *ProviderHandler) WaitResizeInstances(task *models.Task) error
- func (p *ProviderHandler) WaitResizeVolumes(task *models.Task) error
- func (p *ProviderHandler) WaitRunInstances(task *models.Task) error
- func (p *ProviderHandler) WaitStartInstances(task *models.Task) error
- func (p *ProviderHandler) WaitStopInstances(task *models.Task) error
- func (p *ProviderHandler) WaitVolumeState(task *models.Task, state string) error
Constants ¶
View Source
const ( DefaultVolumeClass = 2 DefaultZone = "cn-shanghai" DefaultLoginPassword = "p12cHANgepwD" )
View Source
const (
G = 1024
)
Variables ¶
View Source
var DevicePattern = regexp.MustCompile("/dev/xvd(.)")
View Source
var ( InstanceTypeMap = map[CpuAndMemory]string{ {1, 1 * G}: "ecs.t5-lc1m1.small", {1, 2 * G}: "ecs.t5-lc1m2.small", {2, 4 * G}: "ecs.t5-lc1m2.large", {2, 8 * G}: "ecs.t5-lc1m4.large", {2, 2 * G}: "ecs.t5-c1m1.large", {4, 4 * G}: "ecs.t5-c1m1.xlarge", {4, 8 * G}: "ecs.t5-c1m2.xlarge", {4, 16 * G}: "ecs.t5-c1m4.xlarge", {8, 8 * G}: "ecs.t5-c1m1.2xlarge", {8, 16 * G}: "ecs.t5-c1m2.2xlarge", {8, 32 * G}: "ecs.t5-c1m4.2xlarge", {16, 16 * G}: "ecs.t5-c1m1.4xlarge", {16, 32 * G}: "ecs.t5-c1m2.4xlarge", } )
View Source
var MyProvider = constants.ProviderAliyun
Functions ¶
func ConvertToInstanceType ¶
func ConvertToVolumeType ¶
Types ¶
type CpuAndMemory ¶
type Provider ¶
type Provider struct{}
func NewProvider ¶
func NewProvider() *Provider
func (*Provider) CheckResource ¶
func (*Provider) DescribeClusterDetails ¶
func (*Provider) DescribeRuntimeProviderZones ¶
func (*Provider) DescribeSubnets ¶
func (p *Provider) DescribeSubnets(ctx context.Context, req *pb.DescribeSubnetsRequest) (*pb.DescribeSubnetsResponse, error)
func (*Provider) DescribeVpc ¶
func (*Provider) HandleSubtask ¶
func (*Provider) ParseClusterConf ¶
func (*Provider) SplitJobIntoTasks ¶
func (*Provider) UpdateClusterStatus ¶
func (*Provider) ValidateCredential ¶
type ProviderHandler ¶
type ProviderHandler struct {
vmbased.FrameHandler
}
func GetProviderHandler ¶
func GetProviderHandler(ctx context.Context) *ProviderHandler
func (*ProviderHandler) AttachVolumes ¶
func (p *ProviderHandler) AttachVolumes(task *models.Task) error
func (*ProviderHandler) CheckResourceQuotas ¶
func (p *ProviderHandler) CheckResourceQuotas(ctx context.Context, clusterWrapper *models.ClusterWrapper) error
func (*ProviderHandler) CreateVolumes ¶
func (p *ProviderHandler) CreateVolumes(task *models.Task) error
func (*ProviderHandler) DeleteInstances ¶
func (p *ProviderHandler) DeleteInstances(task *models.Task) error
func (*ProviderHandler) DeleteVolumes ¶
func (p *ProviderHandler) DeleteVolumes(task *models.Task) error
func (*ProviderHandler) DescribeAvailabilityZoneBySubnetId ¶
func (p *ProviderHandler) DescribeAvailabilityZoneBySubnetId(runtimeId, subnetId string) (string, error)
func (*ProviderHandler) DescribeImage ¶
func (p *ProviderHandler) DescribeImage(runtimeId, imageName string) (string, error)
func (*ProviderHandler) DescribeKeyPairs ¶
func (p *ProviderHandler) DescribeKeyPairs(url, credential, zone string) ([]string, error)
func (*ProviderHandler) DescribeSubnets ¶
func (p *ProviderHandler) DescribeSubnets(ctx context.Context, req *pb.DescribeSubnetsRequest) (*pb.DescribeSubnetsResponse, error)
func (*ProviderHandler) DescribeVpc ¶
func (p *ProviderHandler) DescribeVpc(runtimeId, vpcId string) (*models.Vpc, error)
func (*ProviderHandler) DescribeZones ¶
func (p *ProviderHandler) DescribeZones(url, credential string) ([]string, error)
func (*ProviderHandler) DetachVolumes ¶
func (p *ProviderHandler) DetachVolumes(task *models.Task) error
func (*ProviderHandler) ResizeInstances ¶
func (p *ProviderHandler) ResizeInstances(task *models.Task) error
func (*ProviderHandler) ResizeVolumes ¶
func (p *ProviderHandler) ResizeVolumes(task *models.Task) error
func (*ProviderHandler) RunInstances ¶
func (p *ProviderHandler) RunInstances(task *models.Task) error
func (*ProviderHandler) StartInstances ¶
func (p *ProviderHandler) StartInstances(task *models.Task) error
func (*ProviderHandler) StopInstances ¶
func (p *ProviderHandler) StopInstances(task *models.Task) error
func (*ProviderHandler) WaitAttachVolumes ¶
func (p *ProviderHandler) WaitAttachVolumes(task *models.Task) error
func (*ProviderHandler) WaitCreateVolumes ¶
func (p *ProviderHandler) WaitCreateVolumes(task *models.Task) error
func (*ProviderHandler) WaitDeleteInstances ¶
func (p *ProviderHandler) WaitDeleteInstances(task *models.Task) error
func (*ProviderHandler) WaitDeleteVolumes ¶
func (p *ProviderHandler) WaitDeleteVolumes(task *models.Task) error
func (*ProviderHandler) WaitDetachVolumes ¶
func (p *ProviderHandler) WaitDetachVolumes(task *models.Task) error
func (*ProviderHandler) WaitInstanceState ¶
func (p *ProviderHandler) WaitInstanceState(task *models.Task, state string) error
func (*ProviderHandler) WaitResizeInstances ¶
func (p *ProviderHandler) WaitResizeInstances(task *models.Task) error
func (*ProviderHandler) WaitResizeVolumes ¶
func (p *ProviderHandler) WaitResizeVolumes(task *models.Task) error
func (*ProviderHandler) WaitRunInstances ¶
func (p *ProviderHandler) WaitRunInstances(task *models.Task) error
func (*ProviderHandler) WaitStartInstances ¶
func (p *ProviderHandler) WaitStartInstances(task *models.Task) error
func (*ProviderHandler) WaitStopInstances ¶
func (p *ProviderHandler) WaitStopInstances(task *models.Task) error
func (*ProviderHandler) WaitVolumeState ¶
func (p *ProviderHandler) WaitVolumeState(task *models.Task, state string) error
Click to show internal directories.
Click to hide internal directories.