12345678910111213141516171819202122232425262728293031323334353637 |
- package ecs
- import (
- "github.com/denverdino/aliyungo/common"
- "os"
- )
- const DefaultWaitForInterval = 5
- const DefaultTimeout = 60
- type Client struct {
- common.Client
- }
- const (
-
- ECSDefaultEndpoint = "https://ecs-cn-hangzhou.aliyuncs.com"
- ECSAPIVersion = "2014-05-26"
- )
- func NewClient(accessKeyId, accessKeySecret string) *Client {
- endpoint := os.Getenv("ECS_ENDPOINT")
- if endpoint == "" {
- endpoint = ECSDefaultEndpoint
- }
- return NewClientWithEndpoint(endpoint, accessKeyId, accessKeySecret)
- }
- func NewClientWithEndpoint(endpoint string, accessKeyId, accessKeySecret string) *Client {
- client := &Client{}
- client.Init(endpoint, ECSAPIVersion, accessKeyId, accessKeySecret)
- return client
- }
|