Documentation ¶
Index ¶
- Constants
- Variables
- func GetClientError(err error) error
- func GetClientErrorFromString(str string) error
- type BusinessInfo
- type Client
- func (client *Client) DescribeEndpoint(args *DescribeEndpointArgs) (*DescribeEndpointResponse, error)
- func (client *Client) DescribeOpenAPIEndpoint(region Region, serviceCode string) string
- func (client *Client) GenerateClientToken() string
- func (client *Client) Init(endpoint, version, accessKeyId, accessKeySecret string)
- func (client *Client) Invoke(action string, args interface{}, response interface{}) error
- func (client *Client) InvokeByAnyMethod(method, action, path string, args interface{}, response interface{}) error
- func (client *Client) InvokeByFlattenMethod(action string, args interface{}, response interface{}) error
- func (client *Client) NewInit(endpoint, version, accessKeyId, accessKeySecret, serviceCode string, ...)
- func (client *Client) SetAccessKeyId(id string)
- func (client *Client) SetAccessKeySecret(secret string)
- func (client *Client) SetBusinessInfo(businessInfo string)
- func (client *Client) SetDebug(debug bool)
- func (client *Client) SetEndpoint(endpoint string)
- func (client *Client) SetEndpointByLocation(region Region, serviceCode, accessKeyId, accessKeySecret string)
- func (client *Client) SetRegionID(regionID Region)
- func (client *Client) SetServiceCode(serviceCode string)
- func (client *Client) SetVersion(version string)
- type DescribeEndpointArgs
- type DescribeEndpointResponse
- type Endpoint
- type EndpointItem
- type Endpoints
- type Error
- type ErrorResponse
- type FlattenArray
- type InstanceChargeType
- type InternetChargeType
- type NetType
- type NetworkType
- type Pagination
- type PaginationResult
- type Product
- type Products
- type Region
- type RegionIds
- type Request
- type Response
- type SyncMap
- type TimeType
- type UnderlineString
Constants ¶
const ( HTTP_PROTOCOL = "http" HTTPS_PROTOCOL = "https" )
const ( Hangzhou = Region("cn-hangzhou") Qingdao = Region("cn-qingdao") Beijing = Region("cn-beijing") Hongkong = Region("cn-hongkong") Shenzhen = Region("cn-shenzhen") Shanghai = Region("cn-shanghai") Zhangjiakou = Region("cn-zhangjiakou") APSouthEast1 = Region("ap-southeast-1") APNorthEast1 = Region("ap-northeast-1") APSouthEast2 = Region("ap-southeast-2") USWest1 = Region("us-west-1") USEast1 = Region("us-east-1") MEEast1 = Region("me-east-1") EUCentral1 = Region("eu-central-1") )
Constants of region definition
const ( SignatureVersion = "1.0" SignatureMethod = "HMAC-SHA1" JSONResponseFormat = "JSON" XMLResponseFormat = "XML" ECSRequestMethod = "GET" )
Constants for Aliyun API requests
const ( PayByBandwidth = InternetChargeType("PayByBandwidth") PayByTraffic = InternetChargeType("PayByTraffic") )
const ( PrePaid = InstanceChargeType("PrePaid") PostPaid = InstanceChargeType("PostPaid") )
const ( Internet = NetType("Internet") Intranet = NetType("Intranet") )
const ( Hour = TimeType("Hour") Day = TimeType("Day") Month = TimeType("Month") Year = TimeType("Year") )
const ( Classic = NetworkType("Classic") VPC = NetworkType("VPC") )
const Version = "0.1"
Variables ¶
var ValidRegions = []Region{ Hangzhou, Qingdao, Beijing, Shenzhen, Hongkong, Shanghai, Zhangjiakou, USWest1, USEast1, APNorthEast1, APSouthEast1, APSouthEast2, MEEast1, EUCentral1, }
Functions ¶
func GetClientError ¶
Types ¶
type BusinessInfo ¶
type Client ¶
type Client struct { AccessKeyId string //Access Key Id AccessKeySecret string //Access Key Secret // contains filtered or unexported fields }
A Client represents a client of ECS services
func NewLocationClient ¶
func (*Client) DescribeEndpoint ¶
func (client *Client) DescribeEndpoint(args *DescribeEndpointArgs) (*DescribeEndpointResponse, error)
func (*Client) DescribeOpenAPIEndpoint ¶
func (*Client) GenerateClientToken ¶
GenerateClientToken generates the Client Token with random string
func (*Client) InvokeByAnyMethod ¶
func (client *Client) InvokeByAnyMethod(method, action, path string, args interface{}, response interface{}) error
Invoke sends the raw HTTP request for ECS services 改进了一下上面那个方法,可以使用各种Http方法 2017.1.30 增加了一个path参数,用来拓展访问的地址
func (*Client) InvokeByFlattenMethod ¶
func (client *Client) InvokeByFlattenMethod(action string, args interface{}, response interface{}) error
Invoke sends the raw HTTP request for ECS services
func (*Client) SetAccessKeyId ¶
SetAccessKeyId sets new AccessKeyId
func (*Client) SetAccessKeySecret ¶
SetAccessKeySecret sets new AccessKeySecret
func (*Client) SetBusinessInfo ¶
SetBusinessInfo sets business info to log the request/response message
func (*Client) SetEndpoint ¶
SetEndpoint sets custom endpoint
func (*Client) SetEndpointByLocation ¶
func (client *Client) SetEndpointByLocation(region Region, serviceCode, accessKeyId, accessKeySecret string)
SetEndpointByLocation NewClient using location service
func (*Client) SetRegionID ¶
func (*Client) SetServiceCode ¶
SetServiceCode sets serviceCode
func (*Client) SetVersion ¶
SetEndpoint sets custom version
type DescribeEndpointArgs ¶
type DescribeEndpointResponse ¶
type DescribeEndpointResponse struct { Response EndpointItem }
type EndpointItem ¶
type Error ¶
type Error struct { ErrorResponse StatusCode int //Status Code of HTTP Response }
An Error represents a custom error for Aliyun API failure response
type ErrorResponse ¶
type FlattenArray ¶
type FlattenArray []string
RemovalPolicy.N add index to array item RemovalPolicy=["a", "b"] => RemovalPolicy.1="a" RemovalPolicy.2="b"
type InstanceChargeType ¶
type InstanceChargeType string
type InternetChargeType ¶
type InternetChargeType string
type NetworkType ¶
type NetworkType string
type Pagination ¶
func (*Pagination) SetPageSize ¶
func (p *Pagination) SetPageSize(size int)
func (*Pagination) Validate ¶
func (p *Pagination) Validate()
type PaginationResult ¶
A PaginationResponse represents a response with pagination information
func (*PaginationResult) NextPage ¶
func (r *PaginationResult) NextPage() *Pagination
NextPage gets the next page of the result set
type UnderlineString ¶
type UnderlineString string
string contains underline which will be replaced with dot SystemDisk_Category => SystemDisk.Category