ecs

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2021 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Copyright 2021 cuisongliu@qq.com.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

View Source
const (
	ALIRegionId                = "cn-hongkong"
	ALIZoneId                  = "cn-hongkong-c"
	ALIImageId                 = "centos_7_04_64_20G_alibase_201701015.vhd"
	ALIInstanceType            = "ecs.c5.xlarge"
	ALIInternetChargeType      = "PayByTraffic"
	ALIInternetMaxBandwidthIn  = "100"
	ALIInternetMaxBandwidthOut = "100"
	ALIInstanceChargeType      = "PostPaid"
	ALISpotStrategy            = "SpotAsPriceGo"
	HWZone                     = "ap-southeast-1a"
	HWIpType                   = "5_bgp"
	HWImageId                  = "04678140-fcc1-465d-ba36-3a2b19d155f9"
	HWFlavorRef                = "kc1.large.2"
)

Variables

View Source
var (
	HWProjectID string
	HWSubnetId  string
	HWVpcId     string
)

HW 代表华为参数 ALI 代表阿里参数

View Source
var (
	ALISecurityGroupId string
	ALIVSwitchId       string
)

Functions

This section is empty.

Types

type AliyunEcs

type AliyunEcs struct {
	// contains filtered or unexported fields
}

func (*AliyunEcs) Delete

func (a *AliyunEcs) Delete(instanceId []string, maxCount int)

func (*AliyunEcs) Describe

func (a *AliyunEcs) Describe(instanceId string) (*CloudInstanceResponse, error)

func (*AliyunEcs) Healthy

func (a *AliyunEcs) Healthy() error

func (*AliyunEcs) New

func (a *AliyunEcs) New(amount int, dryRun bool, bandwidthOut bool) []string

type Cloud

type Cloud interface {
	New(amount int, dryRun bool, bandwidthOut bool) []string
	Delete(instanceId []string, maxCount int)
	Describe(instanceId string) (*CloudInstanceResponse, error)
	Healthy() error
}

func NewCloud

func NewCloud() Cloud

type CloudInstanceResponse

type CloudInstanceResponse struct {
	IsOk      bool
	PrivateIP string
	PublicIP  string
}

type HClient added in v0.0.2

type HClient struct {
	Zone      string
	EcsClient *ecs.EcsClient
	EipClient *eip.EipClient
}

func NewClientWithAccessKey added in v0.0.2

func NewClientWithAccessKey(ak, sk string) *HClient

func (*HClient) DeleteInstances added in v0.0.2

func (h *HClient) DeleteInstances(serverId []string, delPublicIp bool) (*model.DeleteServersResponse, error)

func (*HClient) Describe added in v0.0.2

func (h *HClient) Describe(serverId string) (*model.ShowServerResponse, error)

func (*HClient) RunInstances added in v0.0.2

func (h *HClient) RunInstances(amount int, dryRun bool, bandwidthOut bool) ([]string, error)

type HuaweiEcs

type HuaweiEcs struct {
	// contains filtered or unexported fields
}

func (*HuaweiEcs) Delete

func (a *HuaweiEcs) Delete(instanceId []string, maxCount int)

func (*HuaweiEcs) Describe

func (a *HuaweiEcs) Describe(instanceId string) (*CloudInstanceResponse, error)

func (*HuaweiEcs) Healthy

func (a *HuaweiEcs) Healthy() error

func (*HuaweiEcs) New

func (a *HuaweiEcs) New(amount int, dryRun bool, bandwidthOut bool) []string

Jump to

Keyboard shortcuts

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