package vpc //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) func (client *Client) DescribeBgpPeers(request *DescribeBgpPeersRequest) (response *DescribeBgpPeersResponse, err error) { response = CreateDescribeBgpPeersResponse() err = client.DoAction(request, response) return } func (client *Client) DescribeBgpPeersWithChan(request *DescribeBgpPeersRequest) (<-chan *DescribeBgpPeersResponse, <-chan error) { responseChan := make(chan *DescribeBgpPeersResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.DescribeBgpPeers(request) responseChan <- response errChan <- err }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } func (client *Client) DescribeBgpPeersWithCallback(request *DescribeBgpPeersRequest, callback func(response *DescribeBgpPeersResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *DescribeBgpPeersResponse var err error defer close(result) response, err = client.DescribeBgpPeers(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } type DescribeBgpPeersRequest struct { *requests.RpcRequest PageSize requests.Integer `position:"Query" name:"PageSize"` IsDefault requests.Boolean `position:"Query" name:"IsDefault"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` PageNumber requests.Integer `position:"Query" name:"PageNumber"` RouterId string `position:"Query" name:"RouterId"` BgpGroupId string `position:"Query" name:"BgpGroupId"` ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` OwnerAccount string `position:"Query" name:"OwnerAccount"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` BgpPeerId string `position:"Query" name:"BgpPeerId"` } type DescribeBgpPeersResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` TotalCount int `json:"TotalCount" xml:"TotalCount"` PageNumber int `json:"PageNumber" xml:"PageNumber"` PageSize int `json:"PageSize" xml:"PageSize"` BgpPeers struct { BgpPeer []struct { Name string `json:"Name" xml:"Name"` Description string `json:"Description" xml:"Description"` BgpPeerId string `json:"BgpPeerId" xml:"BgpPeerId"` BgpGroupId string `json:"BgpGroupId" xml:"BgpGroupId"` PeerIpAddress string `json:"PeerIpAddress" xml:"PeerIpAddress"` PeerAsn string `json:"PeerAsn" xml:"PeerAsn"` AuthKey string `json:"AuthKey" xml:"AuthKey"` RouterId string `json:"RouterId" xml:"RouterId"` BgpStatus string `json:"BgpStatus" xml:"BgpStatus"` Status string `json:"Status" xml:"Status"` Keepalive string `json:"Keepalive" xml:"Keepalive"` LocalAsn string `json:"LocalAsn" xml:"LocalAsn"` Hold string `json:"Hold" xml:"Hold"` IsFake string `json:"IsFake" xml:"IsFake"` RouteLimit string `json:"RouteLimit" xml:"RouteLimit"` RegionId string `json:"RegionId" xml:"RegionId"` } `json:"BgpPeer" xml:"BgpPeer"` } `json:"BgpPeers" xml:"BgpPeers"` } func CreateDescribeBgpPeersRequest() (request *DescribeBgpPeersRequest) { request = &DescribeBgpPeersRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Vpc", "2016-04-28", "DescribeBgpPeers", "vpc", "openAPI") return } func CreateDescribeBgpPeersResponse() (response *DescribeBgpPeersResponse) { response = &DescribeBgpPeersResponse{ BaseResponse: &responses.BaseResponse{}, } return }