GoCloud parse Ali-cloud ‘s response competed
Ali-cloud parse response, API documentations, example documentations
Basic Information
Work
- implemented all of Ali-cloud module parsing response
- updated the way of parsing response
- unit tests
- API documentations
- example documentations
How users use Ali-cloud
when users want to create a loadbalancer
1.get (init) the Ali-cloud instance
alicloud := gocloud.AlibabaCloudProvider()
2.input paramters
create, err := aliloadbalancer.NewCreateLoadBalancerBuilder().
RegionID("cn-qingdao").
LoadBalancerName("abc").
AddressType("internet").
InternetChargeType("paybytraffic").
Build()
if err != nil {
fmt.Println(err)
return
}
3.do it
resp, err := alicloud.LoadBalancer().CreateLoadBalancer(create)
if err != nil {
fmt.Println(err)
return
}
4.parse the response
createLoadBalancerResp, err := aliloadbalancer.ParseCreateLoadBalancerResp(resp)
if err != nil {
fmt.Println(err)
return
}
5.check the status code and get the LoadBalancerId directly
if createLoadBalancerResp.StatusCode == 200 {
fmt.Println(createLoadBalancerResp.LoadBalancerId)
}
Functions implemented
- ParseCreateDiskResp()
- ParseDetachLoadBalancerResp()
- ParseAttachLoadBalancerResp()
- ParseCreateLoadBalancerResp()
- ParseListDnsResp()
- ParseCreateClusterResp()
- ParseCreateNodeResp()