aliyun / alibabacloud-go-sdk

https://next.api.aliyun.com/
31 stars 8 forks source link

eci-20180808 不支持回调来订阅容器实例状态变更事件 #59

Closed sgkokocool1 closed 5 months ago

sgkokocool1 commented 1 year ago

v1版本"github.com/aliyun/alibaba-cloud-sdk-go/services/eci // CreateContainerGroupWithChan invokes the eci.CreateContainerGroup API asynchronously // api document: https://help.aliyun.com/api/eci/createcontainergroup.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client Client) CreateContainerGroupWithChan(request CreateContainerGroupRequest) (<-chan CreateContainerGroupResponse, <-chan error) { responseChan := make(chan CreateContainerGroupResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.CreateContainerGroup(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan }

// CreateContainerGroupWithCallback invokes the eci.CreateContainerGroup API asynchronously // api document: https://help.aliyun.com/api/eci/createcontainergroup.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client Client) CreateContainerGroupWithCallback(request CreateContainerGroupRequest, callback func(response CreateContainerGroupResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response CreateContainerGroupResponse var err error defer close(result) response, err = client.CreateContainerGroup(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result }

image
TsinghuaDream commented 5 months ago

eci目前不可使用这一版的SDK,请参考产品文档自行选择SDK。 https://help.aliyun.com/document_detail/91328.html

TsinghuaDream commented 5 months ago

eci目前不可使用这一版的SDK,请参考产品文档自行选择SDK。 https://help.aliyun.com/document_detail/91328.html