Documentation
¶
Overview ¶
Package tencent ... this file rewrap existing methods to implement the cloudsvr.Handler interface
Index ¶
- Variables
- type Config
- type SDK
- func (sdk *SDK) APIEndPoint() string
- func (sdk *SDK) APIHost() string
- func (sdk *SDK) AccessID() string
- func (sdk *SDK) AccessKey() string
- func (sdk *SDK) InspectEcs(region, ecsID string) (*cvm.Instance, error)
- func (sdk *SDK) InspectNode(id, regionOrZone string) (interface{}, error)
- func (sdk *SDK) ListCloudRegions() ([]*cloudsvr.CloudRegion, error)
- func (sdk *SDK) ListCloudTypes(region string) ([]*cloudsvr.CloudNodeType, error)
- func (sdk *SDK) ListEcses(region string, lbs map[string]string) ([]*cvm.Instance, error)
- func (sdk *SDK) ListInstanceTypes(minCPU, maxCPU, minMem, maxMem int) ([]*cvm.InstanceTypeConfig, error)
- func (sdk *SDK) ListNodes() ([]*cloudsvr.CloudNode, error)
- func (sdk *SDK) ListRegions() ([]*cvm.RegionInfo, error)
- func (sdk *SDK) ListZones(region string) ([]*cvm.ZoneInfo, error)
- func (sdk *SDK) NewEcs(region string, req *cvm.RunInstancesRequest) (string, error)
- func (sdk *SDK) NewNode(prefer *cloudsvr.PreferAttrs) (*cloudsvr.CloudNode, *cloudsvr.PreferAttrs, error)
- func (sdk *SDK) PickupZone(region string) string
- func (sdk *SDK) Ping() error
- func (sdk *SDK) RemoveEcs(region, ecsID string) error
- func (sdk *SDK) RemoveNode(node *cloudsvr.CloudNode) error
- func (sdk *SDK) Type() string
- func (sdk *SDK) Verify() error
- func (sdk *SDK) WaitEcs(region, ecsID, expectStatus string, maxWait time.Duration) error
Constants ¶
This section is empty.
Variables ¶
var ( // OsImage is exported to make pass golint OsImage = "img-dkwyg6sr" // NodeName is exported to make pass golint NodeName = "inf-agent-tencent-node" // NodeLabels is exported to make pass golint NodeLabels = map[string]string{cloudsvr.CLOUDFLAGKEY: CloudType} )
var (
// CloudType is exported
CloudType = "tencent"
)
var (
// DefaultAPIEndPoint is exported
DefaultAPIEndPoint = "https://cvm.tencentcloudapi.com"
)
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { EndPoint string `json:"endpoint,omitempty"` AccessID string `json:"access_id"` AccessKey string `json:"access_key"` }
Config is exported
type SDK ¶
type SDK struct {
// contains filtered or unexported fields
}
SDK is an implement of CloudSvr
func (*SDK) InspectEcs ¶
InspectEcs show details of a given ecs instance
func (*SDK) InspectNode ¶
InspectNode show details of one given ecs instance
func (*SDK) ListCloudRegions ¶
func (sdk *SDK) ListCloudRegions() ([]*cloudsvr.CloudRegion, error)
ListCloudRegions implement cloudsvr.Handler
func (*SDK) ListCloudTypes ¶
func (sdk *SDK) ListCloudTypes(region string) ([]*cloudsvr.CloudNodeType, error)
ListCloudTypes implement cloudsvr.Handler
func (*SDK) ListEcses ¶
ListEcses show all of ecs instances for a specified region (regionID parameter set) or all of regions (regionID parameter empty)
func (*SDK) ListInstanceTypes ¶
func (sdk *SDK) ListInstanceTypes(minCPU, maxCPU, minMem, maxMem int) ([]*cvm.InstanceTypeConfig, error)
ListInstanceTypes show all of instance types tencent supported support cpu / memory minimal/maximize filter parameters
func (*SDK) ListNodes ¶
ListNodes list all tencent ecs instances with labels key: CLOUDFLAGKEY the nodes listed does NOT have any auth fields `User` `Password`
func (*SDK) ListRegions ¶
func (sdk *SDK) ListRegions() ([]*cvm.RegionInfo, error)
ListRegions show all of regions tencent supported
func (*SDK) NewNode ¶
func (sdk *SDK) NewNode(prefer *cloudsvr.PreferAttrs) (*cloudsvr.CloudNode, *cloudsvr.PreferAttrs, error)
NewNode create tencent ecs instance, try to use prefered attributes firstly Note: only 20-30 `POSTPAID_BY_HOUR` cvm instances could be bought per-zone / per-month / per-user See: https://cloud.tencent.com/document/product/213/2664
func (*SDK) PickupZone ¶
PickupZone pick up the first avaliable zone under a specified region
func (*SDK) RemoveNode ¶
RemoveNode remove tencent ecs instance