diff --git a/ChangeLog.txt b/ChangeLog.txt index 4dab43704..80fba8c0c 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -1,3 +1,7 @@ +2024-10-16 Version: v1.63.30 +- Generated 2024-04-15 for `Gwlb`. +- Gwlb Open API released. + 2024-10-16 Version: v1.63.29 - Generated 2024-07-12 for `IQS`. undefined diff --git a/services/gwlb/add_servers_to_server_group.go b/services/gwlb/add_servers_to_server_group.go new file mode 100644 index 000000000..0dd0f993e --- /dev/null +++ b/services/gwlb/add_servers_to_server_group.go @@ -0,0 +1,110 @@ +package gwlb + +//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" +) + +// AddServersToServerGroup invokes the gwlb.AddServersToServerGroup API synchronously +func (client *Client) AddServersToServerGroup(request *AddServersToServerGroupRequest) (response *AddServersToServerGroupResponse, err error) { + response = CreateAddServersToServerGroupResponse() + err = client.DoAction(request, response) + return +} + +// AddServersToServerGroupWithChan invokes the gwlb.AddServersToServerGroup API asynchronously +func (client *Client) AddServersToServerGroupWithChan(request *AddServersToServerGroupRequest) (<-chan *AddServersToServerGroupResponse, <-chan error) { + responseChan := make(chan *AddServersToServerGroupResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.AddServersToServerGroup(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// AddServersToServerGroupWithCallback invokes the gwlb.AddServersToServerGroup API asynchronously +func (client *Client) AddServersToServerGroupWithCallback(request *AddServersToServerGroupRequest, callback func(response *AddServersToServerGroupResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *AddServersToServerGroupResponse + var err error + defer close(result) + response, err = client.AddServersToServerGroup(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// AddServersToServerGroupRequest is the request struct for api AddServersToServerGroup +type AddServersToServerGroupRequest struct { + *requests.RpcRequest + ClientToken string `position:"Body" name:"ClientToken"` + ServerGroupId string `position:"Body" name:"ServerGroupId"` + Servers *[]AddServersToServerGroupServers `position:"Body" name:"Servers" type:"Repeated"` + DryRun requests.Boolean `position:"Body" name:"DryRun"` +} + +// AddServersToServerGroupServers is a repeated param struct in AddServersToServerGroupRequest +type AddServersToServerGroupServers struct { + Port string `name:"Port"` + ServerId string `name:"ServerId"` + ServerIp string `name:"ServerIp"` + ServerType string `name:"ServerType"` +} + +// AddServersToServerGroupResponse is the response struct for api AddServersToServerGroup +type AddServersToServerGroupResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateAddServersToServerGroupRequest creates a request to invoke AddServersToServerGroup API +func CreateAddServersToServerGroupRequest() (request *AddServersToServerGroupRequest) { + request = &AddServersToServerGroupRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Gwlb", "2024-04-15", "AddServersToServerGroup", "", "") + request.Method = requests.POST + return +} + +// CreateAddServersToServerGroupResponse creates a response to parse from AddServersToServerGroup response +func CreateAddServersToServerGroupResponse() (response *AddServersToServerGroupResponse) { + response = &AddServersToServerGroupResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/services/gwlb/client.go b/services/gwlb/client.go new file mode 100644 index 000000000..59bbf2d5f --- /dev/null +++ b/services/gwlb/client.go @@ -0,0 +1,104 @@ +package gwlb + +//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" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/provider" +) + +// Client is the sdk client struct, each func corresponds to an OpenAPI +type Client struct { + sdk.Client +} + +// NewClient creates a sdk client with environment variables +func NewClient() (client *Client, err error) { + client = &Client{} + err = client.Init() + return +} + +// NewClientWithProvider creates a sdk client with providers +// usage: https://github.com/aliyun/alibaba-cloud-sdk-go/blob/master/docs/2-Client-EN.md +func NewClientWithProvider(regionId string, providers ...provider.Provider) (client *Client, err error) { + client = &Client{} + var pc provider.Provider + if len(providers) == 0 { + pc = provider.DefaultChain + } else { + pc = provider.NewProviderChain(providers) + } + err = client.InitWithProviderChain(regionId, pc) + return +} + +// NewClientWithOptions creates a sdk client with regionId/sdkConfig/credential +// this is the common api to create a sdk client +func NewClientWithOptions(regionId string, config *sdk.Config, credential auth.Credential) (client *Client, err error) { + client = &Client{} + err = client.InitWithOptions(regionId, config, credential) + return +} + +// NewClientWithAccessKey is a shortcut to create sdk client with accesskey +// usage: https://github.com/aliyun/alibaba-cloud-sdk-go/blob/master/docs/2-Client-EN.md +func NewClientWithAccessKey(regionId, accessKeyId, accessKeySecret string) (client *Client, err error) { + client = &Client{} + err = client.InitWithAccessKey(regionId, accessKeyId, accessKeySecret) + return +} + +// NewClientWithStsToken is a shortcut to create sdk client with sts token +// usage: https://github.com/aliyun/alibaba-cloud-sdk-go/blob/master/docs/2-Client-EN.md +func NewClientWithStsToken(regionId, stsAccessKeyId, stsAccessKeySecret, stsToken string) (client *Client, err error) { + client = &Client{} + err = client.InitWithStsToken(regionId, stsAccessKeyId, stsAccessKeySecret, stsToken) + return +} + +// NewClientWithRamRoleArn is a shortcut to create sdk client with ram roleArn +// usage: https://github.com/aliyun/alibaba-cloud-sdk-go/blob/master/docs/2-Client-EN.md +func NewClientWithRamRoleArn(regionId string, accessKeyId, accessKeySecret, roleArn, roleSessionName string) (client *Client, err error) { + client = &Client{} + err = client.InitWithRamRoleArn(regionId, accessKeyId, accessKeySecret, roleArn, roleSessionName) + return +} + +// NewClientWithRamRoleArn is a shortcut to create sdk client with ram roleArn and policy +// usage: https://github.com/aliyun/alibaba-cloud-sdk-go/blob/master/docs/2-Client-EN.md +func NewClientWithRamRoleArnAndPolicy(regionId string, accessKeyId, accessKeySecret, roleArn, roleSessionName, policy string) (client *Client, err error) { + client = &Client{} + err = client.InitWithRamRoleArnAndPolicy(regionId, accessKeyId, accessKeySecret, roleArn, roleSessionName, policy) + return +} + +// NewClientWithEcsRamRole is a shortcut to create sdk client with ecs ram role +// usage: https://github.com/aliyun/alibaba-cloud-sdk-go/blob/master/docs/2-Client-EN.md +func NewClientWithEcsRamRole(regionId string, roleName string) (client *Client, err error) { + client = &Client{} + err = client.InitWithEcsRamRole(regionId, roleName) + return +} + +// NewClientWithRsaKeyPair is a shortcut to create sdk client with rsa key pair +// usage: https://github.com/aliyun/alibaba-cloud-sdk-go/blob/master/docs/2-Client-EN.md +func NewClientWithRsaKeyPair(regionId string, publicKeyId, privateKey string, sessionExpiration int) (client *Client, err error) { + client = &Client{} + err = client.InitWithRsaKeyPair(regionId, publicKeyId, privateKey, sessionExpiration) + return +} diff --git a/services/gwlb/create_listener.go b/services/gwlb/create_listener.go new file mode 100644 index 000000000..e05da0bbb --- /dev/null +++ b/services/gwlb/create_listener.go @@ -0,0 +1,111 @@ +package gwlb + +//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" +) + +// CreateListener invokes the gwlb.CreateListener API synchronously +func (client *Client) CreateListener(request *CreateListenerRequest) (response *CreateListenerResponse, err error) { + response = CreateCreateListenerResponse() + err = client.DoAction(request, response) + return +} + +// CreateListenerWithChan invokes the gwlb.CreateListener API asynchronously +func (client *Client) CreateListenerWithChan(request *CreateListenerRequest) (<-chan *CreateListenerResponse, <-chan error) { + responseChan := make(chan *CreateListenerResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.CreateListener(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// CreateListenerWithCallback invokes the gwlb.CreateListener API asynchronously +func (client *Client) CreateListenerWithCallback(request *CreateListenerRequest, callback func(response *CreateListenerResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *CreateListenerResponse + var err error + defer close(result) + response, err = client.CreateListener(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// CreateListenerRequest is the request struct for api CreateListener +type CreateListenerRequest struct { + *requests.RpcRequest + ClientToken string `position:"Body" name:"ClientToken"` + ServerGroupId string `position:"Body" name:"ServerGroupId"` + Tag *[]CreateListenerTag `position:"Body" name:"Tag" type:"Repeated"` + DryRun requests.Boolean `position:"Body" name:"DryRun"` + LoadBalancerId string `position:"Body" name:"LoadBalancerId"` + ListenerDescription string `position:"Body" name:"ListenerDescription"` +} + +// CreateListenerTag is a repeated param struct in CreateListenerRequest +type CreateListenerTag struct { + Key string `name:"Key"` + Value string `name:"Value"` +} + +// CreateListenerResponse is the response struct for api CreateListener +type CreateListenerResponse struct { + *responses.BaseResponse + ListenerId string `json:"ListenerId" xml:"ListenerId"` + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateCreateListenerRequest creates a request to invoke CreateListener API +func CreateCreateListenerRequest() (request *CreateListenerRequest) { + request = &CreateListenerRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Gwlb", "2024-04-15", "CreateListener", "", "") + request.Method = requests.POST + return +} + +// CreateCreateListenerResponse creates a response to parse from CreateListener response +func CreateCreateListenerResponse() (response *CreateListenerResponse) { + response = &CreateListenerResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/services/gwlb/create_load_balancer.go b/services/gwlb/create_load_balancer.go new file mode 100644 index 000000000..e11f24242 --- /dev/null +++ b/services/gwlb/create_load_balancer.go @@ -0,0 +1,120 @@ +package gwlb + +//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" +) + +// CreateLoadBalancer invokes the gwlb.CreateLoadBalancer API synchronously +func (client *Client) CreateLoadBalancer(request *CreateLoadBalancerRequest) (response *CreateLoadBalancerResponse, err error) { + response = CreateCreateLoadBalancerResponse() + err = client.DoAction(request, response) + return +} + +// CreateLoadBalancerWithChan invokes the gwlb.CreateLoadBalancer API asynchronously +func (client *Client) CreateLoadBalancerWithChan(request *CreateLoadBalancerRequest) (<-chan *CreateLoadBalancerResponse, <-chan error) { + responseChan := make(chan *CreateLoadBalancerResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.CreateLoadBalancer(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// CreateLoadBalancerWithCallback invokes the gwlb.CreateLoadBalancer API asynchronously +func (client *Client) CreateLoadBalancerWithCallback(request *CreateLoadBalancerRequest, callback func(response *CreateLoadBalancerResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *CreateLoadBalancerResponse + var err error + defer close(result) + response, err = client.CreateLoadBalancer(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// CreateLoadBalancerRequest is the request struct for api CreateLoadBalancer +type CreateLoadBalancerRequest struct { + *requests.RpcRequest + CrossZoneEnabled requests.Boolean `position:"Body" name:"CrossZoneEnabled"` + ClientToken string `position:"Body" name:"ClientToken"` + AddressIpVersion string `position:"Body" name:"AddressIpVersion"` + ResourceGroupId string `position:"Body" name:"ResourceGroupId"` + LoadBalancerName string `position:"Body" name:"LoadBalancerName"` + Tag *[]CreateLoadBalancerTag `position:"Body" name:"Tag" type:"Repeated"` + DryRun requests.Boolean `position:"Body" name:"DryRun"` + ZoneMappings *[]CreateLoadBalancerZoneMappings `position:"Body" name:"ZoneMappings" type:"Repeated"` + VpcId string `position:"Body" name:"VpcId"` +} + +// CreateLoadBalancerTag is a repeated param struct in CreateLoadBalancerRequest +type CreateLoadBalancerTag struct { + Key string `name:"Key"` + Value string `name:"Value"` +} + +// CreateLoadBalancerZoneMappings is a repeated param struct in CreateLoadBalancerRequest +type CreateLoadBalancerZoneMappings struct { + VSwitchId string `name:"VSwitchId"` + ZoneId string `name:"ZoneId"` +} + +// CreateLoadBalancerResponse is the response struct for api CreateLoadBalancer +type CreateLoadBalancerResponse struct { + *responses.BaseResponse + LoadBalancerId string `json:"LoadBalancerId" xml:"LoadBalancerId"` + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateCreateLoadBalancerRequest creates a request to invoke CreateLoadBalancer API +func CreateCreateLoadBalancerRequest() (request *CreateLoadBalancerRequest) { + request = &CreateLoadBalancerRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Gwlb", "2024-04-15", "CreateLoadBalancer", "", "") + request.Method = requests.POST + return +} + +// CreateCreateLoadBalancerResponse creates a response to parse from CreateLoadBalancer response +func CreateCreateLoadBalancerResponse() (response *CreateLoadBalancerResponse) { + response = &CreateLoadBalancerResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/services/gwlb/create_server_group.go b/services/gwlb/create_server_group.go new file mode 100644 index 000000000..4a19e1626 --- /dev/null +++ b/services/gwlb/create_server_group.go @@ -0,0 +1,136 @@ +package gwlb + +//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" +) + +// CreateServerGroup invokes the gwlb.CreateServerGroup API synchronously +func (client *Client) CreateServerGroup(request *CreateServerGroupRequest) (response *CreateServerGroupResponse, err error) { + response = CreateCreateServerGroupResponse() + err = client.DoAction(request, response) + return +} + +// CreateServerGroupWithChan invokes the gwlb.CreateServerGroup API asynchronously +func (client *Client) CreateServerGroupWithChan(request *CreateServerGroupRequest) (<-chan *CreateServerGroupResponse, <-chan error) { + responseChan := make(chan *CreateServerGroupResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.CreateServerGroup(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// CreateServerGroupWithCallback invokes the gwlb.CreateServerGroup API asynchronously +func (client *Client) CreateServerGroupWithCallback(request *CreateServerGroupRequest, callback func(response *CreateServerGroupResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *CreateServerGroupResponse + var err error + defer close(result) + response, err = client.CreateServerGroup(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// CreateServerGroupRequest is the request struct for api CreateServerGroup +type CreateServerGroupRequest struct { + *requests.RpcRequest + ServerGroupName string `position:"Body" name:"ServerGroupName"` + ClientToken string `position:"Body" name:"ClientToken"` + HealthCheckConfig CreateServerGroupHealthCheckConfig `position:"Body" name:"HealthCheckConfig" type:"Struct"` + Scheduler string `position:"Body" name:"Scheduler"` + ResourceGroupId string `position:"Body" name:"ResourceGroupId"` + Protocol string `position:"Body" name:"Protocol"` + Tag *[]CreateServerGroupTag `position:"Body" name:"Tag" type:"Repeated"` + DryRun requests.Boolean `position:"Body" name:"DryRun"` + ConnectionDrainConfig CreateServerGroupConnectionDrainConfig `position:"Body" name:"ConnectionDrainConfig" type:"Struct"` + ServerGroupType string `position:"Body" name:"ServerGroupType"` + VpcId string `position:"Body" name:"VpcId"` +} + +// CreateServerGroupTag is a repeated param struct in CreateServerGroupRequest +type CreateServerGroupTag struct { + Key string `name:"Key"` + Value string `name:"Value"` +} + +// CreateServerGroupHealthCheckConfig is a repeated param struct in CreateServerGroupRequest +type CreateServerGroupHealthCheckConfig struct { + HealthCheckConnectPort string `name:"HealthCheckConnectPort"` + HealthCheckConnectTimeout string `name:"HealthCheckConnectTimeout"` + HealthCheckDomain string `name:"HealthCheckDomain"` + HealthCheckEnabled string `name:"HealthCheckEnabled"` + HealthCheckHttpCode *[]string `name:"HealthCheckHttpCode" type:"Repeated"` + HealthCheckInterval string `name:"HealthCheckInterval"` + HealthCheckPath string `name:"HealthCheckPath"` + HealthCheckProtocol string `name:"HealthCheckProtocol"` + HealthyThreshold string `name:"HealthyThreshold"` + UnhealthyThreshold string `name:"UnhealthyThreshold"` +} + +// CreateServerGroupConnectionDrainConfig is a repeated param struct in CreateServerGroupRequest +type CreateServerGroupConnectionDrainConfig struct { + ConnectionDrainEnabled string `name:"ConnectionDrainEnabled"` + ConnectionDrainTimeout string `name:"ConnectionDrainTimeout"` +} + +// CreateServerGroupResponse is the response struct for api CreateServerGroup +type CreateServerGroupResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + ServerGroupId string `json:"ServerGroupId" xml:"ServerGroupId"` +} + +// CreateCreateServerGroupRequest creates a request to invoke CreateServerGroup API +func CreateCreateServerGroupRequest() (request *CreateServerGroupRequest) { + request = &CreateServerGroupRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Gwlb", "2024-04-15", "CreateServerGroup", "", "") + request.Method = requests.POST + return +} + +// CreateCreateServerGroupResponse creates a response to parse from CreateServerGroup response +func CreateCreateServerGroupResponse() (response *CreateServerGroupResponse) { + response = &CreateServerGroupResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/services/gwlb/delete_listener.go b/services/gwlb/delete_listener.go new file mode 100644 index 000000000..cf62721cc --- /dev/null +++ b/services/gwlb/delete_listener.go @@ -0,0 +1,101 @@ +package gwlb + +//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" +) + +// DeleteListener invokes the gwlb.DeleteListener API synchronously +func (client *Client) DeleteListener(request *DeleteListenerRequest) (response *DeleteListenerResponse, err error) { + response = CreateDeleteListenerResponse() + err = client.DoAction(request, response) + return +} + +// DeleteListenerWithChan invokes the gwlb.DeleteListener API asynchronously +func (client *Client) DeleteListenerWithChan(request *DeleteListenerRequest) (<-chan *DeleteListenerResponse, <-chan error) { + responseChan := make(chan *DeleteListenerResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DeleteListener(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DeleteListenerWithCallback invokes the gwlb.DeleteListener API asynchronously +func (client *Client) DeleteListenerWithCallback(request *DeleteListenerRequest, callback func(response *DeleteListenerResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DeleteListenerResponse + var err error + defer close(result) + response, err = client.DeleteListener(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DeleteListenerRequest is the request struct for api DeleteListener +type DeleteListenerRequest struct { + *requests.RpcRequest + ClientToken string `position:"Body" name:"ClientToken"` + ListenerId string `position:"Body" name:"ListenerId"` + DryRun requests.Boolean `position:"Body" name:"DryRun"` +} + +// DeleteListenerResponse is the response struct for api DeleteListener +type DeleteListenerResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateDeleteListenerRequest creates a request to invoke DeleteListener API +func CreateDeleteListenerRequest() (request *DeleteListenerRequest) { + request = &DeleteListenerRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Gwlb", "2024-04-15", "DeleteListener", "", "") + request.Method = requests.POST + return +} + +// CreateDeleteListenerResponse creates a response to parse from DeleteListener response +func CreateDeleteListenerResponse() (response *DeleteListenerResponse) { + response = &DeleteListenerResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/services/gwlb/delete_load_balancer.go b/services/gwlb/delete_load_balancer.go new file mode 100644 index 000000000..ca5fd0a2e --- /dev/null +++ b/services/gwlb/delete_load_balancer.go @@ -0,0 +1,101 @@ +package gwlb + +//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" +) + +// DeleteLoadBalancer invokes the gwlb.DeleteLoadBalancer API synchronously +func (client *Client) DeleteLoadBalancer(request *DeleteLoadBalancerRequest) (response *DeleteLoadBalancerResponse, err error) { + response = CreateDeleteLoadBalancerResponse() + err = client.DoAction(request, response) + return +} + +// DeleteLoadBalancerWithChan invokes the gwlb.DeleteLoadBalancer API asynchronously +func (client *Client) DeleteLoadBalancerWithChan(request *DeleteLoadBalancerRequest) (<-chan *DeleteLoadBalancerResponse, <-chan error) { + responseChan := make(chan *DeleteLoadBalancerResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DeleteLoadBalancer(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DeleteLoadBalancerWithCallback invokes the gwlb.DeleteLoadBalancer API asynchronously +func (client *Client) DeleteLoadBalancerWithCallback(request *DeleteLoadBalancerRequest, callback func(response *DeleteLoadBalancerResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DeleteLoadBalancerResponse + var err error + defer close(result) + response, err = client.DeleteLoadBalancer(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DeleteLoadBalancerRequest is the request struct for api DeleteLoadBalancer +type DeleteLoadBalancerRequest struct { + *requests.RpcRequest + ClientToken string `position:"Body" name:"ClientToken"` + DryRun requests.Boolean `position:"Body" name:"DryRun"` + LoadBalancerId string `position:"Body" name:"LoadBalancerId"` +} + +// DeleteLoadBalancerResponse is the response struct for api DeleteLoadBalancer +type DeleteLoadBalancerResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateDeleteLoadBalancerRequest creates a request to invoke DeleteLoadBalancer API +func CreateDeleteLoadBalancerRequest() (request *DeleteLoadBalancerRequest) { + request = &DeleteLoadBalancerRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Gwlb", "2024-04-15", "DeleteLoadBalancer", "", "") + request.Method = requests.POST + return +} + +// CreateDeleteLoadBalancerResponse creates a response to parse from DeleteLoadBalancer response +func CreateDeleteLoadBalancerResponse() (response *DeleteLoadBalancerResponse) { + response = &DeleteLoadBalancerResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/services/gwlb/delete_server_group.go b/services/gwlb/delete_server_group.go new file mode 100644 index 000000000..b300f19f6 --- /dev/null +++ b/services/gwlb/delete_server_group.go @@ -0,0 +1,101 @@ +package gwlb + +//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" +) + +// DeleteServerGroup invokes the gwlb.DeleteServerGroup API synchronously +func (client *Client) DeleteServerGroup(request *DeleteServerGroupRequest) (response *DeleteServerGroupResponse, err error) { + response = CreateDeleteServerGroupResponse() + err = client.DoAction(request, response) + return +} + +// DeleteServerGroupWithChan invokes the gwlb.DeleteServerGroup API asynchronously +func (client *Client) DeleteServerGroupWithChan(request *DeleteServerGroupRequest) (<-chan *DeleteServerGroupResponse, <-chan error) { + responseChan := make(chan *DeleteServerGroupResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DeleteServerGroup(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DeleteServerGroupWithCallback invokes the gwlb.DeleteServerGroup API asynchronously +func (client *Client) DeleteServerGroupWithCallback(request *DeleteServerGroupRequest, callback func(response *DeleteServerGroupResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DeleteServerGroupResponse + var err error + defer close(result) + response, err = client.DeleteServerGroup(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DeleteServerGroupRequest is the request struct for api DeleteServerGroup +type DeleteServerGroupRequest struct { + *requests.RpcRequest + ClientToken string `position:"Body" name:"ClientToken"` + ServerGroupId string `position:"Body" name:"ServerGroupId"` + DryRun requests.Boolean `position:"Body" name:"DryRun"` +} + +// DeleteServerGroupResponse is the response struct for api DeleteServerGroup +type DeleteServerGroupResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateDeleteServerGroupRequest creates a request to invoke DeleteServerGroup API +func CreateDeleteServerGroupRequest() (request *DeleteServerGroupRequest) { + request = &DeleteServerGroupRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Gwlb", "2024-04-15", "DeleteServerGroup", "", "") + request.Method = requests.POST + return +} + +// CreateDeleteServerGroupResponse creates a response to parse from DeleteServerGroup response +func CreateDeleteServerGroupResponse() (response *DeleteServerGroupResponse) { + response = &DeleteServerGroupResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/services/gwlb/describe_regions.go b/services/gwlb/describe_regions.go new file mode 100644 index 000000000..1974f3e27 --- /dev/null +++ b/services/gwlb/describe_regions.go @@ -0,0 +1,100 @@ +package gwlb + +//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" +) + +// DescribeRegions invokes the gwlb.DescribeRegions API synchronously +func (client *Client) DescribeRegions(request *DescribeRegionsRequest) (response *DescribeRegionsResponse, err error) { + response = CreateDescribeRegionsResponse() + err = client.DoAction(request, response) + return +} + +// DescribeRegionsWithChan invokes the gwlb.DescribeRegions API asynchronously +func (client *Client) DescribeRegionsWithChan(request *DescribeRegionsRequest) (<-chan *DescribeRegionsResponse, <-chan error) { + responseChan := make(chan *DescribeRegionsResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DescribeRegions(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DescribeRegionsWithCallback invokes the gwlb.DescribeRegions API asynchronously +func (client *Client) DescribeRegionsWithCallback(request *DescribeRegionsRequest, callback func(response *DescribeRegionsResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DescribeRegionsResponse + var err error + defer close(result) + response, err = client.DescribeRegions(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DescribeRegionsRequest is the request struct for api DescribeRegions +type DescribeRegionsRequest struct { + *requests.RpcRequest + AcceptLanguage string `position:"Body" name:"AcceptLanguage"` +} + +// DescribeRegionsResponse is the response struct for api DescribeRegions +type DescribeRegionsResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + Regions []Data `json:"Regions" xml:"Regions"` +} + +// CreateDescribeRegionsRequest creates a request to invoke DescribeRegions API +func CreateDescribeRegionsRequest() (request *DescribeRegionsRequest) { + request = &DescribeRegionsRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Gwlb", "2024-04-15", "DescribeRegions", "", "") + request.Method = requests.POST + return +} + +// CreateDescribeRegionsResponse creates a response to parse from DescribeRegions response +func CreateDescribeRegionsResponse() (response *DescribeRegionsResponse) { + response = &DescribeRegionsResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/services/gwlb/describe_zones.go b/services/gwlb/describe_zones.go new file mode 100644 index 000000000..1038f608c --- /dev/null +++ b/services/gwlb/describe_zones.go @@ -0,0 +1,100 @@ +package gwlb + +//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" +) + +// DescribeZones invokes the gwlb.DescribeZones API synchronously +func (client *Client) DescribeZones(request *DescribeZonesRequest) (response *DescribeZonesResponse, err error) { + response = CreateDescribeZonesResponse() + err = client.DoAction(request, response) + return +} + +// DescribeZonesWithChan invokes the gwlb.DescribeZones API asynchronously +func (client *Client) DescribeZonesWithChan(request *DescribeZonesRequest) (<-chan *DescribeZonesResponse, <-chan error) { + responseChan := make(chan *DescribeZonesResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DescribeZones(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DescribeZonesWithCallback invokes the gwlb.DescribeZones API asynchronously +func (client *Client) DescribeZonesWithCallback(request *DescribeZonesRequest, callback func(response *DescribeZonesResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DescribeZonesResponse + var err error + defer close(result) + response, err = client.DescribeZones(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DescribeZonesRequest is the request struct for api DescribeZones +type DescribeZonesRequest struct { + *requests.RpcRequest + AcceptLanguage string `position:"Body" name:"AcceptLanguage"` +} + +// DescribeZonesResponse is the response struct for api DescribeZones +type DescribeZonesResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + Zones []Data `json:"Zones" xml:"Zones"` +} + +// CreateDescribeZonesRequest creates a request to invoke DescribeZones API +func CreateDescribeZonesRequest() (request *DescribeZonesRequest) { + request = &DescribeZonesRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Gwlb", "2024-04-15", "DescribeZones", "", "") + request.Method = requests.POST + return +} + +// CreateDescribeZonesResponse creates a response to parse from DescribeZones response +func CreateDescribeZonesResponse() (response *DescribeZonesResponse) { + response = &DescribeZonesResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/services/gwlb/get_listener_attribute.go b/services/gwlb/get_listener_attribute.go new file mode 100644 index 000000000..865d245b5 --- /dev/null +++ b/services/gwlb/get_listener_attribute.go @@ -0,0 +1,106 @@ +package gwlb + +//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" +) + +// GetListenerAttribute invokes the gwlb.GetListenerAttribute API synchronously +func (client *Client) GetListenerAttribute(request *GetListenerAttributeRequest) (response *GetListenerAttributeResponse, err error) { + response = CreateGetListenerAttributeResponse() + err = client.DoAction(request, response) + return +} + +// GetListenerAttributeWithChan invokes the gwlb.GetListenerAttribute API asynchronously +func (client *Client) GetListenerAttributeWithChan(request *GetListenerAttributeRequest) (<-chan *GetListenerAttributeResponse, <-chan error) { + responseChan := make(chan *GetListenerAttributeResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.GetListenerAttribute(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// GetListenerAttributeWithCallback invokes the gwlb.GetListenerAttribute API asynchronously +func (client *Client) GetListenerAttributeWithCallback(request *GetListenerAttributeRequest, callback func(response *GetListenerAttributeResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *GetListenerAttributeResponse + var err error + defer close(result) + response, err = client.GetListenerAttribute(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// GetListenerAttributeRequest is the request struct for api GetListenerAttribute +type GetListenerAttributeRequest struct { + *requests.RpcRequest + ListenerId string `position:"Body" name:"ListenerId"` +} + +// GetListenerAttributeResponse is the response struct for api GetListenerAttribute +type GetListenerAttributeResponse struct { + *responses.BaseResponse + ListenerDescription string `json:"ListenerDescription" xml:"ListenerDescription"` + ListenerId string `json:"ListenerId" xml:"ListenerId"` + ListenerStatus string `json:"ListenerStatus" xml:"ListenerStatus"` + LoadBalancerId string `json:"LoadBalancerId" xml:"LoadBalancerId"` + RegionId string `json:"RegionId" xml:"RegionId"` + RequestId string `json:"RequestId" xml:"RequestId"` + ServerGroupId string `json:"ServerGroupId" xml:"ServerGroupId"` + Tags []TagModel `json:"Tags" xml:"Tags"` +} + +// CreateGetListenerAttributeRequest creates a request to invoke GetListenerAttribute API +func CreateGetListenerAttributeRequest() (request *GetListenerAttributeRequest) { + request = &GetListenerAttributeRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Gwlb", "2024-04-15", "GetListenerAttribute", "", "") + request.Method = requests.POST + return +} + +// CreateGetListenerAttributeResponse creates a response to parse from GetListenerAttribute response +func CreateGetListenerAttributeResponse() (response *GetListenerAttributeResponse) { + response = &GetListenerAttributeResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/services/gwlb/get_listener_health_status.go b/services/gwlb/get_listener_health_status.go new file mode 100644 index 000000000..3af7221c6 --- /dev/null +++ b/services/gwlb/get_listener_health_status.go @@ -0,0 +1,113 @@ +package gwlb + +//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" +) + +// GetListenerHealthStatus invokes the gwlb.GetListenerHealthStatus API synchronously +func (client *Client) GetListenerHealthStatus(request *GetListenerHealthStatusRequest) (response *GetListenerHealthStatusResponse, err error) { + response = CreateGetListenerHealthStatusResponse() + err = client.DoAction(request, response) + return +} + +// GetListenerHealthStatusWithChan invokes the gwlb.GetListenerHealthStatus API asynchronously +func (client *Client) GetListenerHealthStatusWithChan(request *GetListenerHealthStatusRequest) (<-chan *GetListenerHealthStatusResponse, <-chan error) { + responseChan := make(chan *GetListenerHealthStatusResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.GetListenerHealthStatus(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// GetListenerHealthStatusWithCallback invokes the gwlb.GetListenerHealthStatus API asynchronously +func (client *Client) GetListenerHealthStatusWithCallback(request *GetListenerHealthStatusRequest, callback func(response *GetListenerHealthStatusResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *GetListenerHealthStatusResponse + var err error + defer close(result) + response, err = client.GetListenerHealthStatus(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// GetListenerHealthStatusRequest is the request struct for api GetListenerHealthStatus +type GetListenerHealthStatusRequest struct { + *requests.RpcRequest + Skip requests.Integer `position:"Body" name:"Skip"` + ListenerId string `position:"Body" name:"ListenerId"` + NextToken string `position:"Body" name:"NextToken"` + Filter *[]GetListenerHealthStatusFilter `position:"Body" name:"Filter" type:"Repeated"` + MaxResults requests.Integer `position:"Body" name:"MaxResults"` +} + +// GetListenerHealthStatusFilter is a repeated param struct in GetListenerHealthStatusRequest +type GetListenerHealthStatusFilter struct { + Name string `name:"Name"` + Values *[]string `name:"Values" type:"Repeated"` +} + +// GetListenerHealthStatusResponse is the response struct for api GetListenerHealthStatus +type GetListenerHealthStatusResponse struct { + *responses.BaseResponse + MaxResults int `json:"MaxResults" xml:"MaxResults"` + NextToken string `json:"NextToken" xml:"NextToken"` + RequestId string `json:"RequestId" xml:"RequestId"` + TotalCount int `json:"TotalCount" xml:"TotalCount"` + ListenerHealthStatus []ListenerHealthStatusItem `json:"ListenerHealthStatus" xml:"ListenerHealthStatus"` +} + +// CreateGetListenerHealthStatusRequest creates a request to invoke GetListenerHealthStatus API +func CreateGetListenerHealthStatusRequest() (request *GetListenerHealthStatusRequest) { + request = &GetListenerHealthStatusRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Gwlb", "2024-04-15", "GetListenerHealthStatus", "", "") + request.Method = requests.POST + return +} + +// CreateGetListenerHealthStatusResponse creates a response to parse from GetListenerHealthStatus response +func CreateGetListenerHealthStatusResponse() (response *GetListenerHealthStatusResponse) { + response = &GetListenerHealthStatusResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/services/gwlb/get_load_balancer_attribute.go b/services/gwlb/get_load_balancer_attribute.go new file mode 100644 index 000000000..63d3ee02c --- /dev/null +++ b/services/gwlb/get_load_balancer_attribute.go @@ -0,0 +1,110 @@ +package gwlb + +//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" +) + +// GetLoadBalancerAttribute invokes the gwlb.GetLoadBalancerAttribute API synchronously +func (client *Client) GetLoadBalancerAttribute(request *GetLoadBalancerAttributeRequest) (response *GetLoadBalancerAttributeResponse, err error) { + response = CreateGetLoadBalancerAttributeResponse() + err = client.DoAction(request, response) + return +} + +// GetLoadBalancerAttributeWithChan invokes the gwlb.GetLoadBalancerAttribute API asynchronously +func (client *Client) GetLoadBalancerAttributeWithChan(request *GetLoadBalancerAttributeRequest) (<-chan *GetLoadBalancerAttributeResponse, <-chan error) { + responseChan := make(chan *GetLoadBalancerAttributeResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.GetLoadBalancerAttribute(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// GetLoadBalancerAttributeWithCallback invokes the gwlb.GetLoadBalancerAttribute API asynchronously +func (client *Client) GetLoadBalancerAttributeWithCallback(request *GetLoadBalancerAttributeRequest, callback func(response *GetLoadBalancerAttributeResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *GetLoadBalancerAttributeResponse + var err error + defer close(result) + response, err = client.GetLoadBalancerAttribute(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// GetLoadBalancerAttributeRequest is the request struct for api GetLoadBalancerAttribute +type GetLoadBalancerAttributeRequest struct { + *requests.RpcRequest + LoadBalancerId string `position:"Body" name:"LoadBalancerId"` +} + +// GetLoadBalancerAttributeResponse is the response struct for api GetLoadBalancerAttribute +type GetLoadBalancerAttributeResponse struct { + *responses.BaseResponse + AddressIpVersion string `json:"AddressIpVersion" xml:"AddressIpVersion"` + CreateTime string `json:"CreateTime" xml:"CreateTime"` + CrossZoneEnabled bool `json:"CrossZoneEnabled" xml:"CrossZoneEnabled"` + LoadBalancerBusinessStatus string `json:"LoadBalancerBusinessStatus" xml:"LoadBalancerBusinessStatus"` + LoadBalancerId string `json:"LoadBalancerId" xml:"LoadBalancerId"` + LoadBalancerName string `json:"LoadBalancerName" xml:"LoadBalancerName"` + LoadBalancerStatus string `json:"LoadBalancerStatus" xml:"LoadBalancerStatus"` + RequestId string `json:"RequestId" xml:"RequestId"` + ResourceGroupId string `json:"ResourceGroupId" xml:"ResourceGroupId"` + VpcId string `json:"VpcId" xml:"VpcId"` + Tags []TagModel `json:"Tags" xml:"Tags"` + ZoneMappings []ZoneEniModel `json:"ZoneMappings" xml:"ZoneMappings"` +} + +// CreateGetLoadBalancerAttributeRequest creates a request to invoke GetLoadBalancerAttribute API +func CreateGetLoadBalancerAttributeRequest() (request *GetLoadBalancerAttributeRequest) { + request = &GetLoadBalancerAttributeRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Gwlb", "2024-04-15", "GetLoadBalancerAttribute", "", "") + request.Method = requests.POST + return +} + +// CreateGetLoadBalancerAttributeResponse creates a response to parse from GetLoadBalancerAttribute response +func CreateGetLoadBalancerAttributeResponse() (response *GetLoadBalancerAttributeResponse) { + response = &GetLoadBalancerAttributeResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/services/gwlb/list_listeners.go b/services/gwlb/list_listeners.go new file mode 100644 index 000000000..e564d570b --- /dev/null +++ b/services/gwlb/list_listeners.go @@ -0,0 +1,114 @@ +package gwlb + +//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" +) + +// ListListeners invokes the gwlb.ListListeners API synchronously +func (client *Client) ListListeners(request *ListListenersRequest) (response *ListListenersResponse, err error) { + response = CreateListListenersResponse() + err = client.DoAction(request, response) + return +} + +// ListListenersWithChan invokes the gwlb.ListListeners API asynchronously +func (client *Client) ListListenersWithChan(request *ListListenersRequest) (<-chan *ListListenersResponse, <-chan error) { + responseChan := make(chan *ListListenersResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.ListListeners(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// ListListenersWithCallback invokes the gwlb.ListListeners API asynchronously +func (client *Client) ListListenersWithCallback(request *ListListenersRequest, callback func(response *ListListenersResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *ListListenersResponse + var err error + defer close(result) + response, err = client.ListListeners(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// ListListenersRequest is the request struct for api ListListeners +type ListListenersRequest struct { + *requests.RpcRequest + LoadBalancerIds *[]string `position:"Body" name:"LoadBalancerIds" type:"Repeated"` + Skip requests.Integer `position:"Body" name:"Skip"` + NextToken string `position:"Body" name:"NextToken"` + Tag *[]ListListenersTag `position:"Body" name:"Tag" type:"Repeated"` + ListenerIds *[]string `position:"Body" name:"ListenerIds" type:"Repeated"` + MaxResults requests.Integer `position:"Body" name:"MaxResults"` +} + +// ListListenersTag is a repeated param struct in ListListenersRequest +type ListListenersTag struct { + Key string `name:"Key"` + Value string `name:"Value"` +} + +// ListListenersResponse is the response struct for api ListListeners +type ListListenersResponse struct { + *responses.BaseResponse + MaxResults int `json:"MaxResults" xml:"MaxResults"` + NextToken string `json:"NextToken" xml:"NextToken"` + RequestId string `json:"RequestId" xml:"RequestId"` + TotalCount int `json:"TotalCount" xml:"TotalCount"` + Listeners []Listener `json:"Listeners" xml:"Listeners"` +} + +// CreateListListenersRequest creates a request to invoke ListListeners API +func CreateListListenersRequest() (request *ListListenersRequest) { + request = &ListListenersRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Gwlb", "2024-04-15", "ListListeners", "", "") + request.Method = requests.POST + return +} + +// CreateListListenersResponse creates a response to parse from ListListeners response +func CreateListListenersResponse() (response *ListListenersResponse) { + response = &ListListenersResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/services/gwlb/list_load_balancers.go b/services/gwlb/list_load_balancers.go new file mode 100644 index 000000000..c6fbe9981 --- /dev/null +++ b/services/gwlb/list_load_balancers.go @@ -0,0 +1,120 @@ +package gwlb + +//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" +) + +// ListLoadBalancers invokes the gwlb.ListLoadBalancers API synchronously +func (client *Client) ListLoadBalancers(request *ListLoadBalancersRequest) (response *ListLoadBalancersResponse, err error) { + response = CreateListLoadBalancersResponse() + err = client.DoAction(request, response) + return +} + +// ListLoadBalancersWithChan invokes the gwlb.ListLoadBalancers API asynchronously +func (client *Client) ListLoadBalancersWithChan(request *ListLoadBalancersRequest) (<-chan *ListLoadBalancersResponse, <-chan error) { + responseChan := make(chan *ListLoadBalancersResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.ListLoadBalancers(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// ListLoadBalancersWithCallback invokes the gwlb.ListLoadBalancers API asynchronously +func (client *Client) ListLoadBalancersWithCallback(request *ListLoadBalancersRequest, callback func(response *ListLoadBalancersResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *ListLoadBalancersResponse + var err error + defer close(result) + response, err = client.ListLoadBalancers(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// ListLoadBalancersRequest is the request struct for api ListLoadBalancers +type ListLoadBalancersRequest struct { + *requests.RpcRequest + LoadBalancerNames *[]string `position:"Body" name:"LoadBalancerNames" type:"Repeated"` + LoadBalancerIds *[]string `position:"Body" name:"LoadBalancerIds" type:"Repeated"` + Skip requests.Integer `position:"Body" name:"Skip"` + AddressIpVersion string `position:"Body" name:"AddressIpVersion"` + ResourceGroupId string `position:"Body" name:"ResourceGroupId"` + ZoneIds *[]string `position:"Body" name:"ZoneIds" type:"Repeated"` + NextToken string `position:"Body" name:"NextToken"` + VpcIds *[]string `position:"Body" name:"VpcIds" type:"Repeated"` + Tag *[]ListLoadBalancersTag `position:"Body" name:"Tag" type:"Repeated"` + LoadBalancerBusinessStatus string `position:"Body" name:"LoadBalancerBusinessStatus"` + LoadBalancerStatus string `position:"Body" name:"LoadBalancerStatus"` + MaxResults requests.Integer `position:"Body" name:"MaxResults"` +} + +// ListLoadBalancersTag is a repeated param struct in ListLoadBalancersRequest +type ListLoadBalancersTag struct { + Key string `name:"Key"` + Value string `name:"Value"` +} + +// ListLoadBalancersResponse is the response struct for api ListLoadBalancers +type ListLoadBalancersResponse struct { + *responses.BaseResponse + MaxResults int `json:"MaxResults" xml:"MaxResults"` + NextToken string `json:"NextToken" xml:"NextToken"` + RequestId string `json:"RequestId" xml:"RequestId"` + TotalCount int `json:"TotalCount" xml:"TotalCount"` + LoadBalancers []Data `json:"LoadBalancers" xml:"LoadBalancers"` +} + +// CreateListLoadBalancersRequest creates a request to invoke ListLoadBalancers API +func CreateListLoadBalancersRequest() (request *ListLoadBalancersRequest) { + request = &ListLoadBalancersRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Gwlb", "2024-04-15", "ListLoadBalancers", "", "") + request.Method = requests.POST + return +} + +// CreateListLoadBalancersResponse creates a response to parse from ListLoadBalancers response +func CreateListLoadBalancersResponse() (response *ListLoadBalancersResponse) { + response = &ListLoadBalancersResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/services/gwlb/list_server_group_servers.go b/services/gwlb/list_server_group_servers.go new file mode 100644 index 000000000..6b58539cd --- /dev/null +++ b/services/gwlb/list_server_group_servers.go @@ -0,0 +1,108 @@ +package gwlb + +//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" +) + +// ListServerGroupServers invokes the gwlb.ListServerGroupServers API synchronously +func (client *Client) ListServerGroupServers(request *ListServerGroupServersRequest) (response *ListServerGroupServersResponse, err error) { + response = CreateListServerGroupServersResponse() + err = client.DoAction(request, response) + return +} + +// ListServerGroupServersWithChan invokes the gwlb.ListServerGroupServers API asynchronously +func (client *Client) ListServerGroupServersWithChan(request *ListServerGroupServersRequest) (<-chan *ListServerGroupServersResponse, <-chan error) { + responseChan := make(chan *ListServerGroupServersResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.ListServerGroupServers(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// ListServerGroupServersWithCallback invokes the gwlb.ListServerGroupServers API asynchronously +func (client *Client) ListServerGroupServersWithCallback(request *ListServerGroupServersRequest, callback func(response *ListServerGroupServersResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *ListServerGroupServersResponse + var err error + defer close(result) + response, err = client.ListServerGroupServers(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// ListServerGroupServersRequest is the request struct for api ListServerGroupServers +type ListServerGroupServersRequest struct { + *requests.RpcRequest + Skip requests.Integer `position:"Body" name:"Skip"` + ServerGroupId string `position:"Body" name:"ServerGroupId"` + NextToken string `position:"Body" name:"NextToken"` + ServerIds *[]string `position:"Body" name:"ServerIds" type:"Repeated"` + ServerIps *[]string `position:"Body" name:"ServerIps" type:"Repeated"` + MaxResults requests.Integer `position:"Body" name:"MaxResults"` +} + +// ListServerGroupServersResponse is the response struct for api ListServerGroupServers +type ListServerGroupServersResponse struct { + *responses.BaseResponse + MaxResults int `json:"MaxResults" xml:"MaxResults"` + NextToken string `json:"NextToken" xml:"NextToken"` + RequestId string `json:"RequestId" xml:"RequestId"` + TotalCount int `json:"TotalCount" xml:"TotalCount"` + Servers []Server `json:"Servers" xml:"Servers"` +} + +// CreateListServerGroupServersRequest creates a request to invoke ListServerGroupServers API +func CreateListServerGroupServersRequest() (request *ListServerGroupServersRequest) { + request = &ListServerGroupServersRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Gwlb", "2024-04-15", "ListServerGroupServers", "", "") + request.Method = requests.POST + return +} + +// CreateListServerGroupServersResponse creates a response to parse from ListServerGroupServers response +func CreateListServerGroupServersResponse() (response *ListServerGroupServersResponse) { + response = &ListServerGroupServersResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/services/gwlb/list_server_groups.go b/services/gwlb/list_server_groups.go new file mode 100644 index 000000000..458d32156 --- /dev/null +++ b/services/gwlb/list_server_groups.go @@ -0,0 +1,117 @@ +package gwlb + +//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" +) + +// ListServerGroups invokes the gwlb.ListServerGroups API synchronously +func (client *Client) ListServerGroups(request *ListServerGroupsRequest) (response *ListServerGroupsResponse, err error) { + response = CreateListServerGroupsResponse() + err = client.DoAction(request, response) + return +} + +// ListServerGroupsWithChan invokes the gwlb.ListServerGroups API asynchronously +func (client *Client) ListServerGroupsWithChan(request *ListServerGroupsRequest) (<-chan *ListServerGroupsResponse, <-chan error) { + responseChan := make(chan *ListServerGroupsResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.ListServerGroups(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// ListServerGroupsWithCallback invokes the gwlb.ListServerGroups API asynchronously +func (client *Client) ListServerGroupsWithCallback(request *ListServerGroupsRequest, callback func(response *ListServerGroupsResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *ListServerGroupsResponse + var err error + defer close(result) + response, err = client.ListServerGroups(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// ListServerGroupsRequest is the request struct for api ListServerGroups +type ListServerGroupsRequest struct { + *requests.RpcRequest + ServerGroupNames *[]string `position:"Body" name:"ServerGroupNames" type:"Repeated"` + Skip requests.Integer `position:"Body" name:"Skip"` + ResourceGroupId string `position:"Body" name:"ResourceGroupId"` + NextToken string `position:"Body" name:"NextToken"` + Tag *[]ListServerGroupsTag `position:"Body" name:"Tag" type:"Repeated"` + ServerGroupIds *[]string `position:"Body" name:"ServerGroupIds" type:"Repeated"` + ServerGroupType string `position:"Body" name:"ServerGroupType"` + VpcId string `position:"Body" name:"VpcId"` + MaxResults requests.Integer `position:"Body" name:"MaxResults"` +} + +// ListServerGroupsTag is a repeated param struct in ListServerGroupsRequest +type ListServerGroupsTag struct { + Key string `name:"Key"` + Value string `name:"Value"` +} + +// ListServerGroupsResponse is the response struct for api ListServerGroups +type ListServerGroupsResponse struct { + *responses.BaseResponse + MaxResults int `json:"MaxResults" xml:"MaxResults"` + NextToken string `json:"NextToken" xml:"NextToken"` + RequestId string `json:"RequestId" xml:"RequestId"` + TotalCount int `json:"TotalCount" xml:"TotalCount"` + ServerGroups []ServerGroup `json:"ServerGroups" xml:"ServerGroups"` +} + +// CreateListServerGroupsRequest creates a request to invoke ListServerGroups API +func CreateListServerGroupsRequest() (request *ListServerGroupsRequest) { + request = &ListServerGroupsRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Gwlb", "2024-04-15", "ListServerGroups", "", "") + request.Method = requests.POST + return +} + +// CreateListServerGroupsResponse creates a response to parse from ListServerGroups response +func CreateListServerGroupsResponse() (response *ListServerGroupsResponse) { + response = &ListServerGroupsResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/services/gwlb/list_tag_resources.go b/services/gwlb/list_tag_resources.go new file mode 100644 index 000000000..95c9592a6 --- /dev/null +++ b/services/gwlb/list_tag_resources.go @@ -0,0 +1,111 @@ +package gwlb + +//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" +) + +// ListTagResources invokes the gwlb.ListTagResources API synchronously +func (client *Client) ListTagResources(request *ListTagResourcesRequest) (response *ListTagResourcesResponse, err error) { + response = CreateListTagResourcesResponse() + err = client.DoAction(request, response) + return +} + +// ListTagResourcesWithChan invokes the gwlb.ListTagResources API asynchronously +func (client *Client) ListTagResourcesWithChan(request *ListTagResourcesRequest) (<-chan *ListTagResourcesResponse, <-chan error) { + responseChan := make(chan *ListTagResourcesResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.ListTagResources(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// ListTagResourcesWithCallback invokes the gwlb.ListTagResources API asynchronously +func (client *Client) ListTagResourcesWithCallback(request *ListTagResourcesRequest, callback func(response *ListTagResourcesResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *ListTagResourcesResponse + var err error + defer close(result) + response, err = client.ListTagResources(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// ListTagResourcesRequest is the request struct for api ListTagResources +type ListTagResourcesRequest struct { + *requests.RpcRequest + NextToken string `position:"Body" name:"NextToken"` + Tag *[]ListTagResourcesTag `position:"Body" name:"Tag" type:"Repeated"` + ResourceId *[]string `position:"Body" name:"ResourceId" type:"Repeated"` + ResourceType string `position:"Body" name:"ResourceType"` + MaxResults requests.Integer `position:"Body" name:"MaxResults"` +} + +// ListTagResourcesTag is a repeated param struct in ListTagResourcesRequest +type ListTagResourcesTag struct { + Key string `name:"Key"` + Value string `name:"Value"` +} + +// ListTagResourcesResponse is the response struct for api ListTagResources +type ListTagResourcesResponse struct { + *responses.BaseResponse + NextToken string `json:"NextToken" xml:"NextToken"` + RequestId string `json:"RequestId" xml:"RequestId"` + TagResources []TagResource `json:"TagResources" xml:"TagResources"` +} + +// CreateListTagResourcesRequest creates a request to invoke ListTagResources API +func CreateListTagResourcesRequest() (request *ListTagResourcesRequest) { + request = &ListTagResourcesRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Gwlb", "2024-04-15", "ListTagResources", "", "") + request.Method = requests.POST + return +} + +// CreateListTagResourcesResponse creates a response to parse from ListTagResources response +func CreateListTagResourcesResponse() (response *ListTagResourcesResponse) { + response = &ListTagResourcesResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/services/gwlb/move_resource_group.go b/services/gwlb/move_resource_group.go new file mode 100644 index 000000000..3a4729144 --- /dev/null +++ b/services/gwlb/move_resource_group.go @@ -0,0 +1,103 @@ +package gwlb + +//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" +) + +// MoveResourceGroup invokes the gwlb.MoveResourceGroup API synchronously +func (client *Client) MoveResourceGroup(request *MoveResourceGroupRequest) (response *MoveResourceGroupResponse, err error) { + response = CreateMoveResourceGroupResponse() + err = client.DoAction(request, response) + return +} + +// MoveResourceGroupWithChan invokes the gwlb.MoveResourceGroup API asynchronously +func (client *Client) MoveResourceGroupWithChan(request *MoveResourceGroupRequest) (<-chan *MoveResourceGroupResponse, <-chan error) { + responseChan := make(chan *MoveResourceGroupResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.MoveResourceGroup(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// MoveResourceGroupWithCallback invokes the gwlb.MoveResourceGroup API asynchronously +func (client *Client) MoveResourceGroupWithCallback(request *MoveResourceGroupRequest, callback func(response *MoveResourceGroupResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *MoveResourceGroupResponse + var err error + defer close(result) + response, err = client.MoveResourceGroup(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// MoveResourceGroupRequest is the request struct for api MoveResourceGroup +type MoveResourceGroupRequest struct { + *requests.RpcRequest + ClientToken string `position:"Body" name:"ClientToken"` + ResourceId string `position:"Body" name:"ResourceId"` + DryRun requests.Boolean `position:"Body" name:"DryRun"` + ResourceType string `position:"Body" name:"ResourceType"` + NewResourceGroupId string `position:"Body" name:"NewResourceGroupId"` +} + +// MoveResourceGroupResponse is the response struct for api MoveResourceGroup +type MoveResourceGroupResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateMoveResourceGroupRequest creates a request to invoke MoveResourceGroup API +func CreateMoveResourceGroupRequest() (request *MoveResourceGroupRequest) { + request = &MoveResourceGroupRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Gwlb", "2024-04-15", "MoveResourceGroup", "", "") + request.Method = requests.POST + return +} + +// CreateMoveResourceGroupResponse creates a response to parse from MoveResourceGroup response +func CreateMoveResourceGroupResponse() (response *MoveResourceGroupResponse) { + response = &MoveResourceGroupResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/services/gwlb/remove_servers_from_server_group.go b/services/gwlb/remove_servers_from_server_group.go new file mode 100644 index 000000000..d0cb13b7b --- /dev/null +++ b/services/gwlb/remove_servers_from_server_group.go @@ -0,0 +1,110 @@ +package gwlb + +//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" +) + +// RemoveServersFromServerGroup invokes the gwlb.RemoveServersFromServerGroup API synchronously +func (client *Client) RemoveServersFromServerGroup(request *RemoveServersFromServerGroupRequest) (response *RemoveServersFromServerGroupResponse, err error) { + response = CreateRemoveServersFromServerGroupResponse() + err = client.DoAction(request, response) + return +} + +// RemoveServersFromServerGroupWithChan invokes the gwlb.RemoveServersFromServerGroup API asynchronously +func (client *Client) RemoveServersFromServerGroupWithChan(request *RemoveServersFromServerGroupRequest) (<-chan *RemoveServersFromServerGroupResponse, <-chan error) { + responseChan := make(chan *RemoveServersFromServerGroupResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.RemoveServersFromServerGroup(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// RemoveServersFromServerGroupWithCallback invokes the gwlb.RemoveServersFromServerGroup API asynchronously +func (client *Client) RemoveServersFromServerGroupWithCallback(request *RemoveServersFromServerGroupRequest, callback func(response *RemoveServersFromServerGroupResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *RemoveServersFromServerGroupResponse + var err error + defer close(result) + response, err = client.RemoveServersFromServerGroup(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// RemoveServersFromServerGroupRequest is the request struct for api RemoveServersFromServerGroup +type RemoveServersFromServerGroupRequest struct { + *requests.RpcRequest + ClientToken string `position:"Body" name:"ClientToken"` + ServerGroupId string `position:"Body" name:"ServerGroupId"` + Servers *[]RemoveServersFromServerGroupServers `position:"Body" name:"Servers" type:"Repeated"` + DryRun requests.Boolean `position:"Body" name:"DryRun"` +} + +// RemoveServersFromServerGroupServers is a repeated param struct in RemoveServersFromServerGroupRequest +type RemoveServersFromServerGroupServers struct { + Port string `name:"Port"` + ServerId string `name:"ServerId"` + ServerIp string `name:"ServerIp"` + ServerType string `name:"ServerType"` +} + +// RemoveServersFromServerGroupResponse is the response struct for api RemoveServersFromServerGroup +type RemoveServersFromServerGroupResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateRemoveServersFromServerGroupRequest creates a request to invoke RemoveServersFromServerGroup API +func CreateRemoveServersFromServerGroupRequest() (request *RemoveServersFromServerGroupRequest) { + request = &RemoveServersFromServerGroupRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Gwlb", "2024-04-15", "RemoveServersFromServerGroup", "", "") + request.Method = requests.POST + return +} + +// CreateRemoveServersFromServerGroupResponse creates a response to parse from RemoveServersFromServerGroup response +func CreateRemoveServersFromServerGroupResponse() (response *RemoveServersFromServerGroupResponse) { + response = &RemoveServersFromServerGroupResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/services/gwlb/struct_connection_drain_config.go b/services/gwlb/struct_connection_drain_config.go new file mode 100644 index 000000000..a04ba9761 --- /dev/null +++ b/services/gwlb/struct_connection_drain_config.go @@ -0,0 +1,22 @@ +package gwlb + +//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. + +// ConnectionDrainConfig is a nested struct in gwlb response +type ConnectionDrainConfig struct { + ConnectionDrainEnabled bool `json:"ConnectionDrainEnabled" xml:"ConnectionDrainEnabled"` + ConnectionDrainTimeout int `json:"ConnectionDrainTimeout" xml:"ConnectionDrainTimeout"` +} diff --git a/services/gwlb/struct_data.go b/services/gwlb/struct_data.go new file mode 100644 index 000000000..9410b367a --- /dev/null +++ b/services/gwlb/struct_data.go @@ -0,0 +1,35 @@ +package gwlb + +//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. + +// Data is a nested struct in gwlb response +type Data struct { + LoadBalancerStatus string `json:"LoadBalancerStatus" xml:"LoadBalancerStatus"` + LocalName string `json:"LocalName" xml:"LocalName"` + CreateTime string `json:"CreateTime" xml:"CreateTime"` + LoadBalancerId string `json:"LoadBalancerId" xml:"LoadBalancerId"` + CrossZoneEnabled bool `json:"CrossZoneEnabled" xml:"CrossZoneEnabled"` + RegionId string `json:"RegionId" xml:"RegionId"` + ZoneId string `json:"ZoneId" xml:"ZoneId"` + ResourceGroupId string `json:"ResourceGroupId" xml:"ResourceGroupId"` + LoadBalancerName string `json:"LoadBalancerName" xml:"LoadBalancerName"` + LoadBalancerBusinessStatus string `json:"LoadBalancerBusinessStatus" xml:"LoadBalancerBusinessStatus"` + VpcId string `json:"VpcId" xml:"VpcId"` + RegionEndpoint string `json:"RegionEndpoint" xml:"RegionEndpoint"` + AddressIpVersion string `json:"AddressIpVersion" xml:"AddressIpVersion"` + ZoneMappings []ZoneEniModel `json:"ZoneMappings" xml:"ZoneMappings"` + Tags []TagModel `json:"Tags" xml:"Tags"` +} diff --git a/services/gwlb/struct_eni_models.go b/services/gwlb/struct_eni_models.go new file mode 100644 index 000000000..f42ccfa18 --- /dev/null +++ b/services/gwlb/struct_eni_models.go @@ -0,0 +1,22 @@ +package gwlb + +//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. + +// EniModels is a nested struct in gwlb response +type EniModels struct { + PrivateIpv4Address string `json:"PrivateIpv4Address" xml:"PrivateIpv4Address"` + EniId string `json:"EniId" xml:"EniId"` +} diff --git a/services/gwlb/struct_health_check_config.go b/services/gwlb/struct_health_check_config.go new file mode 100644 index 000000000..ca5fc1430 --- /dev/null +++ b/services/gwlb/struct_health_check_config.go @@ -0,0 +1,30 @@ +package gwlb + +//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. + +// HealthCheckConfig is a nested struct in gwlb response +type HealthCheckConfig struct { + HealthCheckConnectPort int `json:"HealthCheckConnectPort" xml:"HealthCheckConnectPort"` + HealthCheckConnectTimeout int `json:"HealthCheckConnectTimeout" xml:"HealthCheckConnectTimeout"` + HealthCheckDomain string `json:"HealthCheckDomain" xml:"HealthCheckDomain"` + HealthCheckEnabled bool `json:"HealthCheckEnabled" xml:"HealthCheckEnabled"` + HealthCheckInterval int `json:"HealthCheckInterval" xml:"HealthCheckInterval"` + HealthCheckPath string `json:"HealthCheckPath" xml:"HealthCheckPath"` + HealthCheckProtocol string `json:"HealthCheckProtocol" xml:"HealthCheckProtocol"` + HealthyThreshold int `json:"HealthyThreshold" xml:"HealthyThreshold"` + UnhealthyThreshold int `json:"UnhealthyThreshold" xml:"UnhealthyThreshold"` + HealthCheckHttpCode []string `json:"HealthCheckHttpCode" xml:"HealthCheckHttpCode"` +} diff --git a/services/gwlb/struct_health_check_http_code.go b/services/gwlb/struct_health_check_http_code.go new file mode 100644 index 000000000..7c8600f27 --- /dev/null +++ b/services/gwlb/struct_health_check_http_code.go @@ -0,0 +1,21 @@ +package gwlb + +//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. + +// HealthCheckHttpCode is a nested struct in gwlb response +type HealthCheckHttpCode struct { + HealthCheckHttpCode []string `json:"HealthCheckHttpCode" xml:"HealthCheckHttpCode"` +} diff --git a/services/gwlb/struct_listener.go b/services/gwlb/struct_listener.go new file mode 100644 index 000000000..8315ee4eb --- /dev/null +++ b/services/gwlb/struct_listener.go @@ -0,0 +1,26 @@ +package gwlb + +//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. + +// Listener is a nested struct in gwlb response +type Listener struct { + ListenerDescription string `json:"ListenerDescription" xml:"ListenerDescription"` + ListenerId string `json:"ListenerId" xml:"ListenerId"` + ListenerStatus string `json:"ListenerStatus" xml:"ListenerStatus"` + LoadBalancerId string `json:"LoadBalancerId" xml:"LoadBalancerId"` + ServerGroupId string `json:"ServerGroupId" xml:"ServerGroupId"` + Tags []TagModel `json:"Tags" xml:"Tags"` +} diff --git a/services/gwlb/struct_listener_health_status.go b/services/gwlb/struct_listener_health_status.go new file mode 100644 index 000000000..08dd58739 --- /dev/null +++ b/services/gwlb/struct_listener_health_status.go @@ -0,0 +1,21 @@ +package gwlb + +//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. + +// ListenerHealthStatus is a nested struct in gwlb response +type ListenerHealthStatus struct { + ListenerHealthStatusItem []ListenerHealthStatusItem `json:"listenerHealthStatus" xml:"listenerHealthStatus"` +} diff --git a/services/gwlb/struct_listener_health_status_item.go b/services/gwlb/struct_listener_health_status_item.go new file mode 100644 index 000000000..6a534a018 --- /dev/null +++ b/services/gwlb/struct_listener_health_status_item.go @@ -0,0 +1,22 @@ +package gwlb + +//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. + +// ListenerHealthStatusItem is a nested struct in gwlb response +type ListenerHealthStatusItem struct { + ListenerId string `json:"ListenerId" xml:"ListenerId"` + ServerGroupInfos []ServerGroupInfo `json:"ServerGroupInfos" xml:"ServerGroupInfos"` +} diff --git a/services/gwlb/struct_listeners.go b/services/gwlb/struct_listeners.go new file mode 100644 index 000000000..c8f2f9eff --- /dev/null +++ b/services/gwlb/struct_listeners.go @@ -0,0 +1,21 @@ +package gwlb + +//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. + +// Listeners is a nested struct in gwlb response +type Listeners struct { + Listener []Listener `json:"listener" xml:"listener"` +} diff --git a/services/gwlb/struct_load_balancer_addresses_in_get_load_balancer_attribute.go b/services/gwlb/struct_load_balancer_addresses_in_get_load_balancer_attribute.go new file mode 100644 index 000000000..083754058 --- /dev/null +++ b/services/gwlb/struct_load_balancer_addresses_in_get_load_balancer_attribute.go @@ -0,0 +1,21 @@ +package gwlb + +//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. + +// LoadBalancerAddressesInGetLoadBalancerAttribute is a nested struct in gwlb response +type LoadBalancerAddressesInGetLoadBalancerAttribute struct { + EniModels []EniModels `json:"EniModels" xml:"EniModels"` +} diff --git a/services/gwlb/struct_load_balancer_addresses_in_list_load_balancers.go b/services/gwlb/struct_load_balancer_addresses_in_list_load_balancers.go new file mode 100644 index 000000000..be1f88803 --- /dev/null +++ b/services/gwlb/struct_load_balancer_addresses_in_list_load_balancers.go @@ -0,0 +1,21 @@ +package gwlb + +//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. + +// LoadBalancerAddressesInListLoadBalancers is a nested struct in gwlb response +type LoadBalancerAddressesInListLoadBalancers struct { + EniModels []EniModels `json:"EniModels" xml:"EniModels"` +} diff --git a/services/gwlb/struct_load_balancers.go b/services/gwlb/struct_load_balancers.go new file mode 100644 index 000000000..04c3f8718 --- /dev/null +++ b/services/gwlb/struct_load_balancers.go @@ -0,0 +1,21 @@ +package gwlb + +//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. + +// LoadBalancers is a nested struct in gwlb response +type LoadBalancers struct { + Data []Data `json:"Data" xml:"Data"` +} diff --git a/services/gwlb/struct_reason.go b/services/gwlb/struct_reason.go new file mode 100644 index 000000000..24a55f91b --- /dev/null +++ b/services/gwlb/struct_reason.go @@ -0,0 +1,21 @@ +package gwlb + +//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. + +// Reason is a nested struct in gwlb response +type Reason struct { + ReasonCode string `json:"ReasonCode" xml:"ReasonCode"` +} diff --git a/services/gwlb/struct_regions.go b/services/gwlb/struct_regions.go new file mode 100644 index 000000000..b81a218f5 --- /dev/null +++ b/services/gwlb/struct_regions.go @@ -0,0 +1,21 @@ +package gwlb + +//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. + +// Regions is a nested struct in gwlb response +type Regions struct { + Data []Data `json:"Data" xml:"Data"` +} diff --git a/services/gwlb/struct_related_load_balancer_ids.go b/services/gwlb/struct_related_load_balancer_ids.go new file mode 100644 index 000000000..08c4c556a --- /dev/null +++ b/services/gwlb/struct_related_load_balancer_ids.go @@ -0,0 +1,21 @@ +package gwlb + +//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. + +// RelatedLoadBalancerIds is a nested struct in gwlb response +type RelatedLoadBalancerIds struct { + LoadBalancerId []string `json:"LoadBalancerId" xml:"LoadBalancerId"` +} diff --git a/services/gwlb/struct_server.go b/services/gwlb/struct_server.go new file mode 100644 index 000000000..8aaf1812f --- /dev/null +++ b/services/gwlb/struct_server.go @@ -0,0 +1,27 @@ +package gwlb + +//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. + +// Server is a nested struct in gwlb response +type Server struct { + Port int `json:"Port" xml:"Port"` + ServerGroupId string `json:"ServerGroupId" xml:"ServerGroupId"` + ServerIp string `json:"ServerIp" xml:"ServerIp"` + ServerId string `json:"ServerId" xml:"ServerId"` + Status string `json:"Status" xml:"Status"` + ServerType string `json:"ServerType" xml:"ServerType"` + Reason Reason `json:"Reason" xml:"Reason"` +} diff --git a/services/gwlb/struct_server_group.go b/services/gwlb/struct_server_group.go new file mode 100644 index 000000000..7e4af794a --- /dev/null +++ b/services/gwlb/struct_server_group.go @@ -0,0 +1,34 @@ +package gwlb + +//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. + +// ServerGroup is a nested struct in gwlb response +type ServerGroup struct { + CreateTime string `json:"CreateTime" xml:"CreateTime"` + Protocol string `json:"Protocol" xml:"Protocol"` + ResourceGroupId string `json:"ResourceGroupId" xml:"ResourceGroupId"` + Scheduler string `json:"Scheduler" xml:"Scheduler"` + ServerCount int `json:"ServerCount" xml:"ServerCount"` + ServerGroupId string `json:"ServerGroupId" xml:"ServerGroupId"` + ServerGroupName string `json:"ServerGroupName" xml:"ServerGroupName"` + ServerGroupStatus string `json:"ServerGroupStatus" xml:"ServerGroupStatus"` + ServerGroupType string `json:"ServerGroupType" xml:"ServerGroupType"` + VpcId string `json:"VpcId" xml:"VpcId"` + RelatedLoadBalancerIds []string `json:"RelatedLoadBalancerIds" xml:"RelatedLoadBalancerIds"` + ConnectionDrainConfig ConnectionDrainConfig `json:"ConnectionDrainConfig" xml:"ConnectionDrainConfig"` + HealthCheckConfig HealthCheckConfig `json:"HealthCheckConfig" xml:"HealthCheckConfig"` + Tags []TagModel `json:"Tags" xml:"Tags"` +} diff --git a/services/gwlb/struct_server_group_info.go b/services/gwlb/struct_server_group_info.go new file mode 100644 index 000000000..6a9843a21 --- /dev/null +++ b/services/gwlb/struct_server_group_info.go @@ -0,0 +1,23 @@ +package gwlb + +//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. + +// ServerGroupInfo is a nested struct in gwlb response +type ServerGroupInfo struct { + HealthCheckEnabled bool `json:"HealthCheckEnabled" xml:"HealthCheckEnabled"` + ServerGroupId string `json:"ServerGroupId" xml:"ServerGroupId"` + Servers []Server `json:"Servers" xml:"Servers"` +} diff --git a/services/gwlb/struct_server_group_infos.go b/services/gwlb/struct_server_group_infos.go new file mode 100644 index 000000000..b91f6186b --- /dev/null +++ b/services/gwlb/struct_server_group_infos.go @@ -0,0 +1,21 @@ +package gwlb + +//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. + +// ServerGroupInfos is a nested struct in gwlb response +type ServerGroupInfos struct { + ServerGroupInfo []ServerGroupInfo `json:"ServerGroupInfo" xml:"ServerGroupInfo"` +} diff --git a/services/gwlb/struct_server_groups.go b/services/gwlb/struct_server_groups.go new file mode 100644 index 000000000..26fbdf3a4 --- /dev/null +++ b/services/gwlb/struct_server_groups.go @@ -0,0 +1,21 @@ +package gwlb + +//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. + +// ServerGroups is a nested struct in gwlb response +type ServerGroups struct { + ServerGroup []ServerGroup `json:"serverGroup" xml:"serverGroup"` +} diff --git a/services/gwlb/struct_servers_in_get_listener_health_status.go b/services/gwlb/struct_servers_in_get_listener_health_status.go new file mode 100644 index 000000000..c3d67c8d5 --- /dev/null +++ b/services/gwlb/struct_servers_in_get_listener_health_status.go @@ -0,0 +1,21 @@ +package gwlb + +//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. + +// ServersInGetListenerHealthStatus is a nested struct in gwlb response +type ServersInGetListenerHealthStatus struct { + Server []Server `json:"server" xml:"server"` +} diff --git a/services/gwlb/struct_servers_in_list_server_group_servers.go b/services/gwlb/struct_servers_in_list_server_group_servers.go new file mode 100644 index 000000000..617f558c5 --- /dev/null +++ b/services/gwlb/struct_servers_in_list_server_group_servers.go @@ -0,0 +1,21 @@ +package gwlb + +//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. + +// ServersInListServerGroupServers is a nested struct in gwlb response +type ServersInListServerGroupServers struct { + Server []Server `json:"Server" xml:"Server"` +} diff --git a/services/gwlb/struct_tag_model.go b/services/gwlb/struct_tag_model.go new file mode 100644 index 000000000..68aa242a4 --- /dev/null +++ b/services/gwlb/struct_tag_model.go @@ -0,0 +1,22 @@ +package gwlb + +//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. + +// TagModel is a nested struct in gwlb response +type TagModel struct { + Key string `json:"Key" xml:"Key"` + Value string `json:"Value" xml:"Value"` +} diff --git a/services/gwlb/struct_tag_resource.go b/services/gwlb/struct_tag_resource.go new file mode 100644 index 000000000..8438e2ec2 --- /dev/null +++ b/services/gwlb/struct_tag_resource.go @@ -0,0 +1,24 @@ +package gwlb + +//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. + +// TagResource is a nested struct in gwlb response +type TagResource struct { + ResourceId string `json:"ResourceId" xml:"ResourceId"` + ResourceType string `json:"ResourceType" xml:"ResourceType"` + TagKey string `json:"TagKey" xml:"TagKey"` + TagValue string `json:"TagValue" xml:"TagValue"` +} diff --git a/services/gwlb/struct_tag_resources.go b/services/gwlb/struct_tag_resources.go new file mode 100644 index 000000000..e0f963785 --- /dev/null +++ b/services/gwlb/struct_tag_resources.go @@ -0,0 +1,21 @@ +package gwlb + +//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. + +// TagResources is a nested struct in gwlb response +type TagResources struct { + TagResource []TagResource `json:"tagResource" xml:"tagResource"` +} diff --git a/services/gwlb/struct_tags_in_get_listener_attribute.go b/services/gwlb/struct_tags_in_get_listener_attribute.go new file mode 100644 index 000000000..9e0b97251 --- /dev/null +++ b/services/gwlb/struct_tags_in_get_listener_attribute.go @@ -0,0 +1,21 @@ +package gwlb + +//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. + +// TagsInGetListenerAttribute is a nested struct in gwlb response +type TagsInGetListenerAttribute struct { + TagModel []TagModel `json:"TagModel" xml:"TagModel"` +} diff --git a/services/gwlb/struct_tags_in_get_load_balancer_attribute.go b/services/gwlb/struct_tags_in_get_load_balancer_attribute.go new file mode 100644 index 000000000..48e04a2f7 --- /dev/null +++ b/services/gwlb/struct_tags_in_get_load_balancer_attribute.go @@ -0,0 +1,21 @@ +package gwlb + +//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. + +// TagsInGetLoadBalancerAttribute is a nested struct in gwlb response +type TagsInGetLoadBalancerAttribute struct { + TagModel []TagModel `json:"TagModel" xml:"TagModel"` +} diff --git a/services/gwlb/struct_tags_in_list_listeners.go b/services/gwlb/struct_tags_in_list_listeners.go new file mode 100644 index 000000000..e88f1a449 --- /dev/null +++ b/services/gwlb/struct_tags_in_list_listeners.go @@ -0,0 +1,21 @@ +package gwlb + +//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. + +// TagsInListListeners is a nested struct in gwlb response +type TagsInListListeners struct { + TagModel []TagModel `json:"TagModel" xml:"TagModel"` +} diff --git a/services/gwlb/struct_tags_in_list_load_balancers.go b/services/gwlb/struct_tags_in_list_load_balancers.go new file mode 100644 index 000000000..6b60f8406 --- /dev/null +++ b/services/gwlb/struct_tags_in_list_load_balancers.go @@ -0,0 +1,21 @@ +package gwlb + +//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. + +// TagsInListLoadBalancers is a nested struct in gwlb response +type TagsInListLoadBalancers struct { + TagModel []TagModel `json:"TagModel" xml:"TagModel"` +} diff --git a/services/gwlb/struct_tags_in_list_server_groups.go b/services/gwlb/struct_tags_in_list_server_groups.go new file mode 100644 index 000000000..0d74cf465 --- /dev/null +++ b/services/gwlb/struct_tags_in_list_server_groups.go @@ -0,0 +1,21 @@ +package gwlb + +//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. + +// TagsInListServerGroups is a nested struct in gwlb response +type TagsInListServerGroups struct { + TagModel []TagModel `json:"TagModel" xml:"TagModel"` +} diff --git a/services/gwlb/struct_zone_eni_model.go b/services/gwlb/struct_zone_eni_model.go new file mode 100644 index 000000000..5143ffc0b --- /dev/null +++ b/services/gwlb/struct_zone_eni_model.go @@ -0,0 +1,23 @@ +package gwlb + +//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. + +// ZoneEniModel is a nested struct in gwlb response +type ZoneEniModel struct { + ZoneId string `json:"ZoneId" xml:"ZoneId"` + VSwitchId string `json:"VSwitchId" xml:"VSwitchId"` + LoadBalancerAddresses []EniModels `json:"LoadBalancerAddresses" xml:"LoadBalancerAddresses"` +} diff --git a/services/gwlb/struct_zone_mappings_in_get_load_balancer_attribute.go b/services/gwlb/struct_zone_mappings_in_get_load_balancer_attribute.go new file mode 100644 index 000000000..f7144a8c2 --- /dev/null +++ b/services/gwlb/struct_zone_mappings_in_get_load_balancer_attribute.go @@ -0,0 +1,21 @@ +package gwlb + +//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. + +// ZoneMappingsInGetLoadBalancerAttribute is a nested struct in gwlb response +type ZoneMappingsInGetLoadBalancerAttribute struct { + ZoneEniModel []ZoneEniModel `json:"ZoneEniModel" xml:"ZoneEniModel"` +} diff --git a/services/gwlb/struct_zone_mappings_in_list_load_balancers.go b/services/gwlb/struct_zone_mappings_in_list_load_balancers.go new file mode 100644 index 000000000..d4b657886 --- /dev/null +++ b/services/gwlb/struct_zone_mappings_in_list_load_balancers.go @@ -0,0 +1,21 @@ +package gwlb + +//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. + +// ZoneMappingsInListLoadBalancers is a nested struct in gwlb response +type ZoneMappingsInListLoadBalancers struct { + ZoneEniModel []ZoneEniModel `json:"ZoneEniModel" xml:"ZoneEniModel"` +} diff --git a/services/gwlb/struct_zones.go b/services/gwlb/struct_zones.go new file mode 100644 index 000000000..b9b0eb20a --- /dev/null +++ b/services/gwlb/struct_zones.go @@ -0,0 +1,21 @@ +package gwlb + +//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. + +// Zones is a nested struct in gwlb response +type Zones struct { + Data []Data `json:"Data" xml:"Data"` +} diff --git a/services/gwlb/tag_resources.go b/services/gwlb/tag_resources.go new file mode 100644 index 000000000..2a097544b --- /dev/null +++ b/services/gwlb/tag_resources.go @@ -0,0 +1,109 @@ +package gwlb + +//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" +) + +// TagResources invokes the gwlb.TagResources API synchronously +func (client *Client) TagResources(request *TagResourcesRequest) (response *TagResourcesResponse, err error) { + response = CreateTagResourcesResponse() + err = client.DoAction(request, response) + return +} + +// TagResourcesWithChan invokes the gwlb.TagResources API asynchronously +func (client *Client) TagResourcesWithChan(request *TagResourcesRequest) (<-chan *TagResourcesResponse, <-chan error) { + responseChan := make(chan *TagResourcesResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.TagResources(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// TagResourcesWithCallback invokes the gwlb.TagResources API asynchronously +func (client *Client) TagResourcesWithCallback(request *TagResourcesRequest, callback func(response *TagResourcesResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *TagResourcesResponse + var err error + defer close(result) + response, err = client.TagResources(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// TagResourcesRequest is the request struct for api TagResources +type TagResourcesRequest struct { + *requests.RpcRequest + ClientToken string `position:"Body" name:"ClientToken"` + Tag *[]TagResourcesTag `position:"Body" name:"Tag" type:"Repeated"` + ResourceId *[]string `position:"Body" name:"ResourceId" type:"Repeated"` + DryRun requests.Boolean `position:"Body" name:"DryRun"` + ResourceType string `position:"Body" name:"ResourceType"` +} + +// TagResourcesTag is a repeated param struct in TagResourcesRequest +type TagResourcesTag struct { + Key string `name:"Key"` + Value string `name:"Value"` +} + +// TagResourcesResponse is the response struct for api TagResources +type TagResourcesResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateTagResourcesRequest creates a request to invoke TagResources API +func CreateTagResourcesRequest() (request *TagResourcesRequest) { + request = &TagResourcesRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Gwlb", "2024-04-15", "TagResources", "", "") + request.Method = requests.POST + return +} + +// CreateTagResourcesResponse creates a response to parse from TagResources response +func CreateTagResourcesResponse() (response *TagResourcesResponse) { + response = &TagResourcesResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/services/gwlb/untag_resources.go b/services/gwlb/untag_resources.go new file mode 100644 index 000000000..98c2a9699 --- /dev/null +++ b/services/gwlb/untag_resources.go @@ -0,0 +1,104 @@ +package gwlb + +//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" +) + +// UntagResources invokes the gwlb.UntagResources API synchronously +func (client *Client) UntagResources(request *UntagResourcesRequest) (response *UntagResourcesResponse, err error) { + response = CreateUntagResourcesResponse() + err = client.DoAction(request, response) + return +} + +// UntagResourcesWithChan invokes the gwlb.UntagResources API asynchronously +func (client *Client) UntagResourcesWithChan(request *UntagResourcesRequest) (<-chan *UntagResourcesResponse, <-chan error) { + responseChan := make(chan *UntagResourcesResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.UntagResources(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// UntagResourcesWithCallback invokes the gwlb.UntagResources API asynchronously +func (client *Client) UntagResourcesWithCallback(request *UntagResourcesRequest, callback func(response *UntagResourcesResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *UntagResourcesResponse + var err error + defer close(result) + response, err = client.UntagResources(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// UntagResourcesRequest is the request struct for api UntagResources +type UntagResourcesRequest struct { + *requests.RpcRequest + ClientToken string `position:"Body" name:"ClientToken"` + All requests.Boolean `position:"Body" name:"All"` + ResourceId *[]string `position:"Body" name:"ResourceId" type:"Repeated"` + DryRun requests.Boolean `position:"Body" name:"DryRun"` + ResourceType string `position:"Body" name:"ResourceType"` + TagKey *[]string `position:"Body" name:"TagKey" type:"Repeated"` +} + +// UntagResourcesResponse is the response struct for api UntagResources +type UntagResourcesResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateUntagResourcesRequest creates a request to invoke UntagResources API +func CreateUntagResourcesRequest() (request *UntagResourcesRequest) { + request = &UntagResourcesRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Gwlb", "2024-04-15", "UntagResources", "", "") + request.Method = requests.POST + return +} + +// CreateUntagResourcesResponse creates a response to parse from UntagResources response +func CreateUntagResourcesResponse() (response *UntagResourcesResponse) { + response = &UntagResourcesResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/services/gwlb/update_listener_attribute.go b/services/gwlb/update_listener_attribute.go new file mode 100644 index 000000000..295aa5b32 --- /dev/null +++ b/services/gwlb/update_listener_attribute.go @@ -0,0 +1,103 @@ +package gwlb + +//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" +) + +// UpdateListenerAttribute invokes the gwlb.UpdateListenerAttribute API synchronously +func (client *Client) UpdateListenerAttribute(request *UpdateListenerAttributeRequest) (response *UpdateListenerAttributeResponse, err error) { + response = CreateUpdateListenerAttributeResponse() + err = client.DoAction(request, response) + return +} + +// UpdateListenerAttributeWithChan invokes the gwlb.UpdateListenerAttribute API asynchronously +func (client *Client) UpdateListenerAttributeWithChan(request *UpdateListenerAttributeRequest) (<-chan *UpdateListenerAttributeResponse, <-chan error) { + responseChan := make(chan *UpdateListenerAttributeResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.UpdateListenerAttribute(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// UpdateListenerAttributeWithCallback invokes the gwlb.UpdateListenerAttribute API asynchronously +func (client *Client) UpdateListenerAttributeWithCallback(request *UpdateListenerAttributeRequest, callback func(response *UpdateListenerAttributeResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *UpdateListenerAttributeResponse + var err error + defer close(result) + response, err = client.UpdateListenerAttribute(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// UpdateListenerAttributeRequest is the request struct for api UpdateListenerAttribute +type UpdateListenerAttributeRequest struct { + *requests.RpcRequest + ClientToken string `position:"Body" name:"ClientToken"` + ServerGroupId string `position:"Body" name:"ServerGroupId"` + ListenerId string `position:"Body" name:"ListenerId"` + DryRun requests.Boolean `position:"Body" name:"DryRun"` + ListenerDescription string `position:"Body" name:"ListenerDescription"` +} + +// UpdateListenerAttributeResponse is the response struct for api UpdateListenerAttribute +type UpdateListenerAttributeResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateUpdateListenerAttributeRequest creates a request to invoke UpdateListenerAttribute API +func CreateUpdateListenerAttributeRequest() (request *UpdateListenerAttributeRequest) { + request = &UpdateListenerAttributeRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Gwlb", "2024-04-15", "UpdateListenerAttribute", "", "") + request.Method = requests.POST + return +} + +// CreateUpdateListenerAttributeResponse creates a response to parse from UpdateListenerAttribute response +func CreateUpdateListenerAttributeResponse() (response *UpdateListenerAttributeResponse) { + response = &UpdateListenerAttributeResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/services/gwlb/update_load_balancer_attribute.go b/services/gwlb/update_load_balancer_attribute.go new file mode 100644 index 000000000..2046790b4 --- /dev/null +++ b/services/gwlb/update_load_balancer_attribute.go @@ -0,0 +1,103 @@ +package gwlb + +//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" +) + +// UpdateLoadBalancerAttribute invokes the gwlb.UpdateLoadBalancerAttribute API synchronously +func (client *Client) UpdateLoadBalancerAttribute(request *UpdateLoadBalancerAttributeRequest) (response *UpdateLoadBalancerAttributeResponse, err error) { + response = CreateUpdateLoadBalancerAttributeResponse() + err = client.DoAction(request, response) + return +} + +// UpdateLoadBalancerAttributeWithChan invokes the gwlb.UpdateLoadBalancerAttribute API asynchronously +func (client *Client) UpdateLoadBalancerAttributeWithChan(request *UpdateLoadBalancerAttributeRequest) (<-chan *UpdateLoadBalancerAttributeResponse, <-chan error) { + responseChan := make(chan *UpdateLoadBalancerAttributeResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.UpdateLoadBalancerAttribute(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// UpdateLoadBalancerAttributeWithCallback invokes the gwlb.UpdateLoadBalancerAttribute API asynchronously +func (client *Client) UpdateLoadBalancerAttributeWithCallback(request *UpdateLoadBalancerAttributeRequest, callback func(response *UpdateLoadBalancerAttributeResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *UpdateLoadBalancerAttributeResponse + var err error + defer close(result) + response, err = client.UpdateLoadBalancerAttribute(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// UpdateLoadBalancerAttributeRequest is the request struct for api UpdateLoadBalancerAttribute +type UpdateLoadBalancerAttributeRequest struct { + *requests.RpcRequest + CrossZoneEnabled requests.Boolean `position:"Body" name:"CrossZoneEnabled"` + ClientToken string `position:"Body" name:"ClientToken"` + LoadBalancerName string `position:"Body" name:"LoadBalancerName"` + DryRun requests.Boolean `position:"Body" name:"DryRun"` + LoadBalancerId string `position:"Body" name:"LoadBalancerId"` +} + +// UpdateLoadBalancerAttributeResponse is the response struct for api UpdateLoadBalancerAttribute +type UpdateLoadBalancerAttributeResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateUpdateLoadBalancerAttributeRequest creates a request to invoke UpdateLoadBalancerAttribute API +func CreateUpdateLoadBalancerAttributeRequest() (request *UpdateLoadBalancerAttributeRequest) { + request = &UpdateLoadBalancerAttributeRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Gwlb", "2024-04-15", "UpdateLoadBalancerAttribute", "", "") + request.Method = requests.POST + return +} + +// CreateUpdateLoadBalancerAttributeResponse creates a response to parse from UpdateLoadBalancerAttribute response +func CreateUpdateLoadBalancerAttributeResponse() (response *UpdateLoadBalancerAttributeResponse) { + response = &UpdateLoadBalancerAttributeResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/services/gwlb/update_load_balancer_zones.go b/services/gwlb/update_load_balancer_zones.go new file mode 100644 index 000000000..29a15dde3 --- /dev/null +++ b/services/gwlb/update_load_balancer_zones.go @@ -0,0 +1,108 @@ +package gwlb + +//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" +) + +// UpdateLoadBalancerZones invokes the gwlb.UpdateLoadBalancerZones API synchronously +func (client *Client) UpdateLoadBalancerZones(request *UpdateLoadBalancerZonesRequest) (response *UpdateLoadBalancerZonesResponse, err error) { + response = CreateUpdateLoadBalancerZonesResponse() + err = client.DoAction(request, response) + return +} + +// UpdateLoadBalancerZonesWithChan invokes the gwlb.UpdateLoadBalancerZones API asynchronously +func (client *Client) UpdateLoadBalancerZonesWithChan(request *UpdateLoadBalancerZonesRequest) (<-chan *UpdateLoadBalancerZonesResponse, <-chan error) { + responseChan := make(chan *UpdateLoadBalancerZonesResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.UpdateLoadBalancerZones(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// UpdateLoadBalancerZonesWithCallback invokes the gwlb.UpdateLoadBalancerZones API asynchronously +func (client *Client) UpdateLoadBalancerZonesWithCallback(request *UpdateLoadBalancerZonesRequest, callback func(response *UpdateLoadBalancerZonesResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *UpdateLoadBalancerZonesResponse + var err error + defer close(result) + response, err = client.UpdateLoadBalancerZones(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// UpdateLoadBalancerZonesRequest is the request struct for api UpdateLoadBalancerZones +type UpdateLoadBalancerZonesRequest struct { + *requests.RpcRequest + ClientToken string `position:"Body" name:"ClientToken"` + DryRun requests.Boolean `position:"Body" name:"DryRun"` + ZoneMappings *[]UpdateLoadBalancerZonesZoneMappings `position:"Body" name:"ZoneMappings" type:"Repeated"` + LoadBalancerId string `position:"Body" name:"LoadBalancerId"` +} + +// UpdateLoadBalancerZonesZoneMappings is a repeated param struct in UpdateLoadBalancerZonesRequest +type UpdateLoadBalancerZonesZoneMappings struct { + VSwitchId string `name:"VSwitchId"` + ZoneId string `name:"ZoneId"` +} + +// UpdateLoadBalancerZonesResponse is the response struct for api UpdateLoadBalancerZones +type UpdateLoadBalancerZonesResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateUpdateLoadBalancerZonesRequest creates a request to invoke UpdateLoadBalancerZones API +func CreateUpdateLoadBalancerZonesRequest() (request *UpdateLoadBalancerZonesRequest) { + request = &UpdateLoadBalancerZonesRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Gwlb", "2024-04-15", "UpdateLoadBalancerZones", "", "") + request.Method = requests.POST + return +} + +// CreateUpdateLoadBalancerZonesResponse creates a response to parse from UpdateLoadBalancerZones response +func CreateUpdateLoadBalancerZonesResponse() (response *UpdateLoadBalancerZonesResponse) { + response = &UpdateLoadBalancerZonesResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/services/gwlb/update_server_group_attribute.go b/services/gwlb/update_server_group_attribute.go new file mode 100644 index 000000000..5c31dbab5 --- /dev/null +++ b/services/gwlb/update_server_group_attribute.go @@ -0,0 +1,125 @@ +package gwlb + +//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" +) + +// UpdateServerGroupAttribute invokes the gwlb.UpdateServerGroupAttribute API synchronously +func (client *Client) UpdateServerGroupAttribute(request *UpdateServerGroupAttributeRequest) (response *UpdateServerGroupAttributeResponse, err error) { + response = CreateUpdateServerGroupAttributeResponse() + err = client.DoAction(request, response) + return +} + +// UpdateServerGroupAttributeWithChan invokes the gwlb.UpdateServerGroupAttribute API asynchronously +func (client *Client) UpdateServerGroupAttributeWithChan(request *UpdateServerGroupAttributeRequest) (<-chan *UpdateServerGroupAttributeResponse, <-chan error) { + responseChan := make(chan *UpdateServerGroupAttributeResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.UpdateServerGroupAttribute(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// UpdateServerGroupAttributeWithCallback invokes the gwlb.UpdateServerGroupAttribute API asynchronously +func (client *Client) UpdateServerGroupAttributeWithCallback(request *UpdateServerGroupAttributeRequest, callback func(response *UpdateServerGroupAttributeResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *UpdateServerGroupAttributeResponse + var err error + defer close(result) + response, err = client.UpdateServerGroupAttribute(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// UpdateServerGroupAttributeRequest is the request struct for api UpdateServerGroupAttribute +type UpdateServerGroupAttributeRequest struct { + *requests.RpcRequest + ServerGroupName string `position:"Body" name:"ServerGroupName"` + ClientToken string `position:"Body" name:"ClientToken"` + HealthCheckConfig UpdateServerGroupAttributeHealthCheckConfig `position:"Body" name:"HealthCheckConfig" type:"Struct"` + ServerGroupId string `position:"Body" name:"ServerGroupId"` + Scheduler string `position:"Body" name:"Scheduler"` + DryRun requests.Boolean `position:"Body" name:"DryRun"` + ConnectionDrainConfig UpdateServerGroupAttributeConnectionDrainConfig `position:"Body" name:"ConnectionDrainConfig" type:"Struct"` +} + +// UpdateServerGroupAttributeHealthCheckConfig is a repeated param struct in UpdateServerGroupAttributeRequest +type UpdateServerGroupAttributeHealthCheckConfig struct { + HealthCheckConnectPort string `name:"HealthCheckConnectPort"` + HealthCheckConnectTimeout string `name:"HealthCheckConnectTimeout"` + HealthCheckDomain string `name:"HealthCheckDomain"` + HealthCheckEnabled string `name:"HealthCheckEnabled"` + HealthCheckHttpCode *[]string `name:"HealthCheckHttpCode" type:"Repeated"` + HealthCheckInterval string `name:"HealthCheckInterval"` + HealthCheckPath string `name:"HealthCheckPath"` + HealthCheckProtocol string `name:"HealthCheckProtocol"` + HealthyThreshold string `name:"HealthyThreshold"` + UnhealthyThreshold string `name:"UnhealthyThreshold"` +} + +// UpdateServerGroupAttributeConnectionDrainConfig is a repeated param struct in UpdateServerGroupAttributeRequest +type UpdateServerGroupAttributeConnectionDrainConfig struct { + ConnectionDrainEnabled string `name:"ConnectionDrainEnabled"` + ConnectionDrainTimeout string `name:"ConnectionDrainTimeout"` +} + +// UpdateServerGroupAttributeResponse is the response struct for api UpdateServerGroupAttribute +type UpdateServerGroupAttributeResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateUpdateServerGroupAttributeRequest creates a request to invoke UpdateServerGroupAttribute API +func CreateUpdateServerGroupAttributeRequest() (request *UpdateServerGroupAttributeRequest) { + request = &UpdateServerGroupAttributeRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Gwlb", "2024-04-15", "UpdateServerGroupAttribute", "", "") + request.Method = requests.POST + return +} + +// CreateUpdateServerGroupAttributeResponse creates a response to parse from UpdateServerGroupAttribute response +func CreateUpdateServerGroupAttributeResponse() (response *UpdateServerGroupAttributeResponse) { + response = &UpdateServerGroupAttributeResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +}