2016-12-03 09:42:26 +00:00
|
|
|
// +-------------------------------------------------------------------------
|
|
|
|
// | Copyright (C) 2016 Yunify, Inc.
|
|
|
|
// +-------------------------------------------------------------------------
|
|
|
|
// | Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
// | you may not use this work except in compliance with the License.
|
|
|
|
// | You may obtain a copy of the License in the LICENSE file, or 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.
|
|
|
|
// +-------------------------------------------------------------------------
|
|
|
|
|
2016-12-08 13:02:38 +00:00
|
|
|
package service
|
2016-12-03 09:42:26 +00:00
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
"time"
|
|
|
|
|
|
|
|
"github.com/yunify/qingcloud-sdk-go/config"
|
|
|
|
"github.com/yunify/qingcloud-sdk-go/request"
|
|
|
|
"github.com/yunify/qingcloud-sdk-go/request/data"
|
2017-01-05 14:03:55 +00:00
|
|
|
"github.com/yunify/qingcloud-sdk-go/request/errors"
|
2016-12-03 09:42:26 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
var _ fmt.State
|
|
|
|
var _ time.Time
|
|
|
|
|
|
|
|
type LoadBalancerService struct {
|
|
|
|
Config *config.Config
|
|
|
|
Properties *LoadBalancerServiceProperties
|
|
|
|
}
|
|
|
|
|
|
|
|
type LoadBalancerServiceProperties struct {
|
|
|
|
// QingCloud Zone ID
|
2017-01-05 14:03:55 +00:00
|
|
|
Zone *string `json:"zone" name:"zone"` // Required
|
2016-12-03 09:42:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (s *QingCloudService) LoadBalancer(zone string) (*LoadBalancerService, error) {
|
|
|
|
properties := &LoadBalancerServiceProperties{
|
2017-01-05 14:03:55 +00:00
|
|
|
Zone: &zone,
|
2016-12-03 09:42:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return &LoadBalancerService{Config: s.Config, Properties: properties}, nil
|
|
|
|
}
|
|
|
|
|
|
|
|
// Documentation URL: https://docs.qingcloud.com/api/lb/add_loadbalancer_backends.html
|
|
|
|
func (s *LoadBalancerService) AddLoadBalancerBackends(i *AddLoadBalancerBackendsInput) (*AddLoadBalancerBackendsOutput, error) {
|
|
|
|
if i == nil {
|
|
|
|
i = &AddLoadBalancerBackendsInput{}
|
|
|
|
}
|
|
|
|
o := &data.Operation{
|
|
|
|
Config: s.Config,
|
|
|
|
Properties: s.Properties,
|
|
|
|
APIName: "AddLoadBalancerBackends",
|
|
|
|
RequestMethod: "GET",
|
|
|
|
}
|
|
|
|
|
|
|
|
x := &AddLoadBalancerBackendsOutput{}
|
|
|
|
r, err := request.New(o, i, x)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
|
|
|
|
err = r.Send()
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
|
|
|
|
return x, err
|
|
|
|
}
|
|
|
|
|
|
|
|
type AddLoadBalancerBackendsInput struct {
|
2017-01-09 11:41:42 +00:00
|
|
|
Backends []*LoadBalancerBackend `json:"backends" name:"backends" location:"params"` // Required
|
|
|
|
LoadBalancerListener *string `json:"loadbalancer_listener" name:"loadbalancer_listener" location:"params"` // Required
|
2016-12-03 09:42:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (v *AddLoadBalancerBackendsInput) Validate() error {
|
|
|
|
|
|
|
|
if len(v.Backends) == 0 {
|
2017-01-05 14:03:55 +00:00
|
|
|
return errors.ParameterRequiredError{
|
2016-12-03 09:42:26 +00:00
|
|
|
ParameterName: "Backends",
|
|
|
|
ParentName: "AddLoadBalancerBackendsInput",
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if len(v.Backends) > 0 {
|
|
|
|
for _, property := range v.Backends {
|
|
|
|
if err := property.Validate(); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-01-05 14:03:55 +00:00
|
|
|
if v.LoadBalancerListener == nil {
|
|
|
|
return errors.ParameterRequiredError{
|
2016-12-03 09:42:26 +00:00
|
|
|
ParameterName: "LoadBalancerListener",
|
|
|
|
ParentName: "AddLoadBalancerBackendsInput",
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
type AddLoadBalancerBackendsOutput struct {
|
2017-01-05 14:03:55 +00:00
|
|
|
Message *string `json:"message" name:"message"`
|
|
|
|
Action *string `json:"action" name:"action" location:"elements"`
|
|
|
|
LoadBalancerBackends []*string `json:"loadbalancer_backends" name:"loadbalancer_backends" location:"elements"`
|
|
|
|
RetCode *int `json:"ret_code" name:"ret_code" location:"elements"`
|
2016-12-03 09:42:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Documentation URL: https://docs.qingcloud.com/api/lb/add_loadbalancer_listeners.html
|
|
|
|
func (s *LoadBalancerService) AddLoadBalancerListeners(i *AddLoadBalancerListenersInput) (*AddLoadBalancerListenersOutput, error) {
|
|
|
|
if i == nil {
|
|
|
|
i = &AddLoadBalancerListenersInput{}
|
|
|
|
}
|
|
|
|
o := &data.Operation{
|
|
|
|
Config: s.Config,
|
|
|
|
Properties: s.Properties,
|
|
|
|
APIName: "AddLoadBalancerListeners",
|
|
|
|
RequestMethod: "GET",
|
|
|
|
}
|
|
|
|
|
|
|
|
x := &AddLoadBalancerListenersOutput{}
|
|
|
|
r, err := request.New(o, i, x)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
|
|
|
|
err = r.Send()
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
|
|
|
|
return x, err
|
|
|
|
}
|
|
|
|
|
|
|
|
type AddLoadBalancerListenersInput struct {
|
|
|
|
Listeners []*LoadBalancerListener `json:"listeners" name:"listeners" location:"params"`
|
2017-01-05 14:03:55 +00:00
|
|
|
LoadBalancer *string `json:"loadbalancer" name:"loadbalancer" location:"params"`
|
2016-12-03 09:42:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (v *AddLoadBalancerListenersInput) Validate() error {
|
|
|
|
|
|
|
|
if len(v.Listeners) > 0 {
|
|
|
|
for _, property := range v.Listeners {
|
|
|
|
if err := property.Validate(); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
type AddLoadBalancerListenersOutput struct {
|
2017-01-05 14:03:55 +00:00
|
|
|
Message *string `json:"message" name:"message"`
|
|
|
|
Action *string `json:"action" name:"action" location:"elements"`
|
|
|
|
LoadBalancerListeners []*string `json:"loadbalancer_listeners" name:"loadbalancer_listeners" location:"elements"`
|
|
|
|
RetCode *int `json:"ret_code" name:"ret_code" location:"elements"`
|
2016-12-03 09:42:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Documentation URL: https://docs.qingcloud.com/api/lb/add_loadbalancer_policy_rules.html
|
|
|
|
func (s *LoadBalancerService) AddLoadBalancerPolicyRules(i *AddLoadBalancerPolicyRulesInput) (*AddLoadBalancerPolicyRulesOutput, error) {
|
|
|
|
if i == nil {
|
|
|
|
i = &AddLoadBalancerPolicyRulesInput{}
|
|
|
|
}
|
|
|
|
o := &data.Operation{
|
|
|
|
Config: s.Config,
|
|
|
|
Properties: s.Properties,
|
|
|
|
APIName: "AddLoadBalancerPolicyRules",
|
|
|
|
RequestMethod: "GET",
|
|
|
|
}
|
|
|
|
|
|
|
|
x := &AddLoadBalancerPolicyRulesOutput{}
|
|
|
|
r, err := request.New(o, i, x)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
|
|
|
|
err = r.Send()
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
|
|
|
|
return x, err
|
|
|
|
}
|
|
|
|
|
|
|
|
type AddLoadBalancerPolicyRulesInput struct {
|
2017-01-05 14:03:55 +00:00
|
|
|
LoadBalancerPolicy *string `json:"loadbalancer_policy" name:"loadbalancer_policy" location:"params"`
|
2016-12-03 09:42:26 +00:00
|
|
|
Rules []*LoadBalancerPolicyRule `json:"rules" name:"rules" location:"params"`
|
|
|
|
}
|
|
|
|
|
|
|
|
func (v *AddLoadBalancerPolicyRulesInput) Validate() error {
|
|
|
|
|
|
|
|
if len(v.Rules) > 0 {
|
|
|
|
for _, property := range v.Rules {
|
|
|
|
if err := property.Validate(); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
type AddLoadBalancerPolicyRulesOutput struct {
|
2017-01-05 14:03:55 +00:00
|
|
|
Message *string `json:"message" name:"message"`
|
|
|
|
Action *string `json:"action" name:"action" location:"elements"`
|
|
|
|
LoadBalancerPolicyRules []*string `json:"loadbalancer_policy_rules" name:"loadbalancer_policy_rules" location:"elements"`
|
|
|
|
RetCode *int `json:"ret_code" name:"ret_code" location:"elements"`
|
2016-12-03 09:42:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Documentation URL: https://docs.qingcloud.com/api/lb/apply_loadbalancer_policy.html
|
|
|
|
func (s *LoadBalancerService) ApplyLoadBalancerPolicy(i *ApplyLoadBalancerPolicyInput) (*ApplyLoadBalancerPolicyOutput, error) {
|
|
|
|
if i == nil {
|
|
|
|
i = &ApplyLoadBalancerPolicyInput{}
|
|
|
|
}
|
|
|
|
o := &data.Operation{
|
|
|
|
Config: s.Config,
|
|
|
|
Properties: s.Properties,
|
|
|
|
APIName: "ApplyLoadBalancerPolicy",
|
|
|
|
RequestMethod: "GET",
|
|
|
|
}
|
|
|
|
|
|
|
|
x := &ApplyLoadBalancerPolicyOutput{}
|
|
|
|
r, err := request.New(o, i, x)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
|
|
|
|
err = r.Send()
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
|
|
|
|
return x, err
|
|
|
|
}
|
|
|
|
|
|
|
|
type ApplyLoadBalancerPolicyInput struct {
|
2017-01-05 14:03:55 +00:00
|
|
|
LoadBalancerPolicy *string `json:"loadbalancer_policy" name:"loadbalancer_policy" location:"params"` // Required
|
2016-12-03 09:42:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (v *ApplyLoadBalancerPolicyInput) Validate() error {
|
|
|
|
|
2017-01-05 14:03:55 +00:00
|
|
|
if v.LoadBalancerPolicy == nil {
|
|
|
|
return errors.ParameterRequiredError{
|
2016-12-03 09:42:26 +00:00
|
|
|
ParameterName: "LoadBalancerPolicy",
|
|
|
|
ParentName: "ApplyLoadBalancerPolicyInput",
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
type ApplyLoadBalancerPolicyOutput struct {
|
2017-01-05 14:03:55 +00:00
|
|
|
Message *string `json:"message" name:"message"`
|
|
|
|
Action *string `json:"action" name:"action" location:"elements"`
|
|
|
|
JobID *string `json:"job_id" name:"job_id" location:"elements"`
|
|
|
|
RetCode *int `json:"ret_code" name:"ret_code" location:"elements"`
|
2016-12-03 09:42:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Documentation URL: https://docs.qingcloud.com/api/lb/associate_eips_to_loadbalancer.html
|
|
|
|
func (s *LoadBalancerService) AssociateEIPsToLoadBalancer(i *AssociateEIPsToLoadBalancerInput) (*AssociateEIPsToLoadBalancerOutput, error) {
|
|
|
|
if i == nil {
|
|
|
|
i = &AssociateEIPsToLoadBalancerInput{}
|
|
|
|
}
|
|
|
|
o := &data.Operation{
|
|
|
|
Config: s.Config,
|
|
|
|
Properties: s.Properties,
|
|
|
|
APIName: "AssociateEipsToLoadBalancer",
|
|
|
|
RequestMethod: "GET",
|
|
|
|
}
|
|
|
|
|
|
|
|
x := &AssociateEIPsToLoadBalancerOutput{}
|
|
|
|
r, err := request.New(o, i, x)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
|
|
|
|
err = r.Send()
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
|
|
|
|
return x, err
|
|
|
|
}
|
|
|
|
|
|
|
|
type AssociateEIPsToLoadBalancerInput struct {
|
2017-01-05 14:03:55 +00:00
|
|
|
EIPs []*string `json:"eips" name:"eips" location:"params"` // Required
|
|
|
|
LoadBalancer *string `json:"loadbalancer" name:"loadbalancer" location:"params"` // Required
|
2016-12-03 09:42:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (v *AssociateEIPsToLoadBalancerInput) Validate() error {
|
|
|
|
|
|
|
|
if len(v.EIPs) == 0 {
|
2017-01-05 14:03:55 +00:00
|
|
|
return errors.ParameterRequiredError{
|
2016-12-03 09:42:26 +00:00
|
|
|
ParameterName: "EIPs",
|
|
|
|
ParentName: "AssociateEIPsToLoadBalancerInput",
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-01-05 14:03:55 +00:00
|
|
|
if v.LoadBalancer == nil {
|
|
|
|
return errors.ParameterRequiredError{
|
2016-12-03 09:42:26 +00:00
|
|
|
ParameterName: "LoadBalancer",
|
|
|
|
ParentName: "AssociateEIPsToLoadBalancerInput",
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
type AssociateEIPsToLoadBalancerOutput struct {
|
2017-01-05 14:03:55 +00:00
|
|
|
Message *string `json:"message" name:"message"`
|
|
|
|
Action *string `json:"action" name:"action" location:"elements"`
|
|
|
|
JobID *string `json:"job_id" name:"job_id" location:"elements"`
|
|
|
|
RetCode *int `json:"ret_code" name:"ret_code" location:"elements"`
|
2016-12-03 09:42:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Documentation URL: https://docs.qingcloud.com/api/lb/create_loadbalancer.html
|
|
|
|
func (s *LoadBalancerService) CreateLoadBalancer(i *CreateLoadBalancerInput) (*CreateLoadBalancerOutput, error) {
|
|
|
|
if i == nil {
|
|
|
|
i = &CreateLoadBalancerInput{}
|
|
|
|
}
|
|
|
|
o := &data.Operation{
|
|
|
|
Config: s.Config,
|
|
|
|
Properties: s.Properties,
|
|
|
|
APIName: "CreateLoadBalancer",
|
|
|
|
RequestMethod: "GET",
|
|
|
|
}
|
|
|
|
|
|
|
|
x := &CreateLoadBalancerOutput{}
|
|
|
|
r, err := request.New(o, i, x)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
|
|
|
|
err = r.Send()
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
|
|
|
|
return x, err
|
|
|
|
}
|
|
|
|
|
|
|
|
type CreateLoadBalancerInput struct {
|
2019-12-24 15:01:11 +00:00
|
|
|
|
|
|
|
// ClusterMode's available values: 0, 1
|
|
|
|
ClusterMode *int `json:"cluster_mode" name:"cluster_mode" default:"0" location:"params"`
|
2017-01-05 14:03:55 +00:00
|
|
|
EIPs []*string `json:"eips" name:"eips" location:"params"`
|
2017-12-14 09:45:07 +00:00
|
|
|
HTTPHeaderSize *int `json:"http_header_size" name:"http_header_size" location:"params"`
|
2017-01-05 14:03:55 +00:00
|
|
|
LoadBalancerName *string `json:"loadbalancer_name" name:"loadbalancer_name" location:"params"`
|
2016-12-03 09:42:26 +00:00
|
|
|
// LoadBalancerType's available values: 0, 1, 2, 3, 4, 5
|
2019-12-24 15:01:11 +00:00
|
|
|
LoadBalancerType *int `json:"loadbalancer_type" name:"loadbalancer_type" default:"0" location:"params"`
|
|
|
|
// Mode's available values: 0, 1
|
|
|
|
Mode *int `json:"mode" name:"mode" default:"0" location:"params"`
|
|
|
|
NodeCount *int `json:"node_count" name:"node_count" location:"params"`
|
|
|
|
PrivateIP *string `json:"private_ip" name:"private_ip" location:"params"`
|
|
|
|
ProjectID *string `json:"project_id" name:"project_id" location:"params"`
|
|
|
|
SecurityGroup *string `json:"security_group" name:"security_group" location:"params"`
|
|
|
|
VxNet *string `json:"vxnet" name:"vxnet" location:"params"`
|
2016-12-03 09:42:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (v *CreateLoadBalancerInput) Validate() error {
|
|
|
|
|
2019-12-24 15:01:11 +00:00
|
|
|
if v.ClusterMode != nil {
|
|
|
|
clusterModeValidValues := []string{"0", "1"}
|
|
|
|
clusterModeParameterValue := fmt.Sprint(*v.ClusterMode)
|
|
|
|
|
|
|
|
clusterModeIsValid := false
|
|
|
|
for _, value := range clusterModeValidValues {
|
|
|
|
if value == clusterModeParameterValue {
|
|
|
|
clusterModeIsValid = true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if !clusterModeIsValid {
|
|
|
|
return errors.ParameterValueNotAllowedError{
|
|
|
|
ParameterName: "ClusterMode",
|
|
|
|
ParameterValue: clusterModeParameterValue,
|
|
|
|
AllowedValues: clusterModeValidValues,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-01-05 14:03:55 +00:00
|
|
|
if v.LoadBalancerType != nil {
|
2016-12-03 09:42:26 +00:00
|
|
|
loadBalancerTypeValidValues := []string{"0", "1", "2", "3", "4", "5"}
|
2017-01-05 14:03:55 +00:00
|
|
|
loadBalancerTypeParameterValue := fmt.Sprint(*v.LoadBalancerType)
|
2016-12-03 09:42:26 +00:00
|
|
|
|
|
|
|
loadBalancerTypeIsValid := false
|
|
|
|
for _, value := range loadBalancerTypeValidValues {
|
|
|
|
if value == loadBalancerTypeParameterValue {
|
|
|
|
loadBalancerTypeIsValid = true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if !loadBalancerTypeIsValid {
|
2017-01-05 14:03:55 +00:00
|
|
|
return errors.ParameterValueNotAllowedError{
|
2016-12-03 09:42:26 +00:00
|
|
|
ParameterName: "LoadBalancerType",
|
|
|
|
ParameterValue: loadBalancerTypeParameterValue,
|
|
|
|
AllowedValues: loadBalancerTypeValidValues,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-12-24 15:01:11 +00:00
|
|
|
if v.Mode != nil {
|
|
|
|
modeValidValues := []string{"0", "1"}
|
|
|
|
modeParameterValue := fmt.Sprint(*v.Mode)
|
|
|
|
|
|
|
|
modeIsValid := false
|
|
|
|
for _, value := range modeValidValues {
|
|
|
|
if value == modeParameterValue {
|
|
|
|
modeIsValid = true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if !modeIsValid {
|
|
|
|
return errors.ParameterValueNotAllowedError{
|
|
|
|
ParameterName: "Mode",
|
|
|
|
ParameterValue: modeParameterValue,
|
|
|
|
AllowedValues: modeValidValues,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-12-03 09:42:26 +00:00
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
type CreateLoadBalancerOutput struct {
|
2017-01-05 14:03:55 +00:00
|
|
|
Message *string `json:"message" name:"message"`
|
|
|
|
Action *string `json:"action" name:"action" location:"elements"`
|
|
|
|
JobID *string `json:"job_id" name:"job_id" location:"elements"`
|
|
|
|
LoadBalancerID *string `json:"loadbalancer_id" name:"loadbalancer_id" location:"elements"`
|
|
|
|
RetCode *int `json:"ret_code" name:"ret_code" location:"elements"`
|
2016-12-03 09:42:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Documentation URL: https://docs.qingcloud.com/api/lb/create_loadbalancer_policy.html
|
|
|
|
func (s *LoadBalancerService) CreateLoadBalancerPolicy(i *CreateLoadBalancerPolicyInput) (*CreateLoadBalancerPolicyOutput, error) {
|
|
|
|
if i == nil {
|
|
|
|
i = &CreateLoadBalancerPolicyInput{}
|
|
|
|
}
|
|
|
|
o := &data.Operation{
|
|
|
|
Config: s.Config,
|
|
|
|
Properties: s.Properties,
|
|
|
|
APIName: "CreateLoadBalancerPolicy",
|
|
|
|
RequestMethod: "GET",
|
|
|
|
}
|
|
|
|
|
|
|
|
x := &CreateLoadBalancerPolicyOutput{}
|
|
|
|
r, err := request.New(o, i, x)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
|
|
|
|
err = r.Send()
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
|
|
|
|
return x, err
|
|
|
|
}
|
|
|
|
|
|
|
|
type CreateLoadBalancerPolicyInput struct {
|
2017-01-05 14:03:55 +00:00
|
|
|
LoadBalancerPolicyName *string `json:"loadbalancer_policy_name" name:"loadbalancer_policy_name" location:"params"` // Required
|
2016-12-03 09:42:26 +00:00
|
|
|
// Operator's available values: or, and
|
2017-01-05 14:03:55 +00:00
|
|
|
Operator *string `json:"operator" name:"operator" default:"or" location:"params"`
|
2016-12-03 09:42:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (v *CreateLoadBalancerPolicyInput) Validate() error {
|
|
|
|
|
2017-01-05 14:03:55 +00:00
|
|
|
if v.LoadBalancerPolicyName == nil {
|
|
|
|
return errors.ParameterRequiredError{
|
2016-12-03 09:42:26 +00:00
|
|
|
ParameterName: "LoadBalancerPolicyName",
|
|
|
|
ParentName: "CreateLoadBalancerPolicyInput",
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-01-05 14:03:55 +00:00
|
|
|
if v.Operator != nil {
|
2016-12-03 09:42:26 +00:00
|
|
|
operatorValidValues := []string{"or", "and"}
|
2017-01-05 14:03:55 +00:00
|
|
|
operatorParameterValue := fmt.Sprint(*v.Operator)
|
2016-12-03 09:42:26 +00:00
|
|
|
|
|
|
|
operatorIsValid := false
|
|
|
|
for _, value := range operatorValidValues {
|
|
|
|
if value == operatorParameterValue {
|
|
|
|
operatorIsValid = true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if !operatorIsValid {
|
2017-01-05 14:03:55 +00:00
|
|
|
return errors.ParameterValueNotAllowedError{
|
2016-12-03 09:42:26 +00:00
|
|
|
ParameterName: "Operator",
|
|
|
|
ParameterValue: operatorParameterValue,
|
|
|
|
AllowedValues: operatorValidValues,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
type CreateLoadBalancerPolicyOutput struct {
|
2017-01-05 14:03:55 +00:00
|
|
|
Message *string `json:"message" name:"message"`
|
|
|
|
Action *string `json:"action" name:"action" location:"elements"`
|
|
|
|
LoadBalancerPolicyID *string `json:"loadbalancer_policy_id" name:"loadbalancer_policy_id" location:"elements"`
|
|
|
|
RetCode *int `json:"ret_code" name:"ret_code" location:"elements"`
|
2016-12-03 09:42:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Documentation URL: https://docs.qingcloud.com/api/lb/create_server_certificate.html
|
|
|
|
func (s *LoadBalancerService) CreateServerCertificate(i *CreateServerCertificateInput) (*CreateServerCertificateOutput, error) {
|
|
|
|
if i == nil {
|
|
|
|
i = &CreateServerCertificateInput{}
|
|
|
|
}
|
|
|
|
o := &data.Operation{
|
|
|
|
Config: s.Config,
|
|
|
|
Properties: s.Properties,
|
|
|
|
APIName: "CreateServerCertificate",
|
2017-12-22 09:31:01 +00:00
|
|
|
RequestMethod: "POST",
|
2016-12-03 09:42:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
x := &CreateServerCertificateOutput{}
|
|
|
|
r, err := request.New(o, i, x)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
|
|
|
|
err = r.Send()
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
|
|
|
|
return x, err
|
|
|
|
}
|
|
|
|
|
|
|
|
type CreateServerCertificateInput struct {
|
2017-01-05 14:03:55 +00:00
|
|
|
CertificateContent *string `json:"certificate_content" name:"certificate_content" location:"params"` // Required
|
|
|
|
PrivateKey *string `json:"private_key" name:"private_key" location:"params"` // Required
|
|
|
|
ServerCertificateName *string `json:"server_certificate_name" name:"server_certificate_name" location:"params"`
|
2016-12-03 09:42:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (v *CreateServerCertificateInput) Validate() error {
|
|
|
|
|
2017-01-05 14:03:55 +00:00
|
|
|
if v.CertificateContent == nil {
|
|
|
|
return errors.ParameterRequiredError{
|
2016-12-03 09:42:26 +00:00
|
|
|
ParameterName: "CertificateContent",
|
|
|
|
ParentName: "CreateServerCertificateInput",
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-01-05 14:03:55 +00:00
|
|
|
if v.PrivateKey == nil {
|
|
|
|
return errors.ParameterRequiredError{
|
2016-12-03 09:42:26 +00:00
|
|
|
ParameterName: "PrivateKey",
|
|
|
|
ParentName: "CreateServerCertificateInput",
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
type CreateServerCertificateOutput struct {
|
2017-01-05 14:03:55 +00:00
|
|
|
Message *string `json:"message" name:"message"`
|
|
|
|
Action *string `json:"action" name:"action" location:"elements"`
|
|
|
|
RetCode *int `json:"ret_code" name:"ret_code" location:"elements"`
|
|
|
|
ServerCertificateID *string `json:"server_certificate_id" name:"server_certificate_id" location:"elements"`
|
2016-12-03 09:42:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Documentation URL: https://docs.qingcloud.com/api/lb/delete_loadbalancer_backends.html
|
|
|
|
func (s *LoadBalancerService) DeleteLoadBalancerBackends(i *DeleteLoadBalancerBackendsInput) (*DeleteLoadBalancerBackendsOutput, error) {
|
|
|
|
if i == nil {
|
|
|
|
i = &DeleteLoadBalancerBackendsInput{}
|
|
|
|
}
|
|
|
|
o := &data.Operation{
|
|
|
|
Config: s.Config,
|
|
|
|
Properties: s.Properties,
|
|
|
|
APIName: "DeleteLoadBalancerBackends",
|
|
|
|
RequestMethod: "GET",
|
|
|
|
}
|
|
|
|
|
|
|
|
x := &DeleteLoadBalancerBackendsOutput{}
|
|
|
|
r, err := request.New(o, i, x)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
|
|
|
|
err = r.Send()
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
|
|
|
|
return x, err
|
|
|
|
}
|
|
|
|
|
|
|
|
type DeleteLoadBalancerBackendsInput struct {
|
2017-01-05 14:03:55 +00:00
|
|
|
LoadBalancerBackends []*string `json:"loadbalancer_backends" name:"loadbalancer_backends" location:"params"` // Required
|
2016-12-03 09:42:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (v *DeleteLoadBalancerBackendsInput) Validate() error {
|
|
|
|
|
|
|
|
if len(v.LoadBalancerBackends) == 0 {
|
2017-01-05 14:03:55 +00:00
|
|
|
return errors.ParameterRequiredError{
|
2016-12-03 09:42:26 +00:00
|
|
|
ParameterName: "LoadBalancerBackends",
|
|
|
|
ParentName: "DeleteLoadBalancerBackendsInput",
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
type DeleteLoadBalancerBackendsOutput struct {
|
2017-07-09 15:46:04 +00:00
|
|
|
Message *string `json:"message" name:"message"`
|
|
|
|
Action *string `json:"action" name:"action" location:"elements"`
|
|
|
|
LoadBalancerBackends []*string `json:"loadbalancer_backends" name:"loadbalancer_backends" location:"elements"`
|
|
|
|
RetCode *int `json:"ret_code" name:"ret_code" location:"elements"`
|
2016-12-03 09:42:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Documentation URL: https://docs.qingcloud.com/api/lb/delete_loadbalancer_listeners.html
|
|
|
|
func (s *LoadBalancerService) DeleteLoadBalancerListeners(i *DeleteLoadBalancerListenersInput) (*DeleteLoadBalancerListenersOutput, error) {
|
|
|
|
if i == nil {
|
|
|
|
i = &DeleteLoadBalancerListenersInput{}
|
|
|
|
}
|
|
|
|
o := &data.Operation{
|
|
|
|
Config: s.Config,
|
|
|
|
Properties: s.Properties,
|
|
|
|
APIName: "DeleteLoadBalancerListeners",
|
|
|
|
RequestMethod: "GET",
|
|
|
|
}
|
|
|
|
|
|
|
|
x := &DeleteLoadBalancerListenersOutput{}
|
|
|
|
r, err := request.New(o, i, x)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
|
|
|
|
err = r.Send()
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
|
|
|
|
return x, err
|
|
|
|
}
|
|
|
|
|
|
|
|
type DeleteLoadBalancerListenersInput struct {
|
2017-01-05 14:03:55 +00:00
|
|
|
LoadBalancerListeners []*string `json:"loadbalancer_listeners" name:"loadbalancer_listeners" location:"params"` // Required
|
2016-12-03 09:42:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (v *DeleteLoadBalancerListenersInput) Validate() error {
|
|
|
|
|
|
|
|
if len(v.LoadBalancerListeners) == 0 {
|
2017-01-05 14:03:55 +00:00
|
|
|
return errors.ParameterRequiredError{
|
2016-12-03 09:42:26 +00:00
|
|
|
ParameterName: "LoadBalancerListeners",
|
|
|
|
ParentName: "DeleteLoadBalancerListenersInput",
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
type DeleteLoadBalancerListenersOutput struct {
|
2017-01-05 14:03:55 +00:00
|
|
|
Message *string `json:"message" name:"message"`
|
|
|
|
Action *string `json:"action" name:"action" location:"elements"`
|
|
|
|
LoadBalancerListeners []*string `json:"loadbalancer_listeners" name:"loadbalancer_listeners" location:"elements"`
|
|
|
|
RetCode *int `json:"ret_code" name:"ret_code" location:"elements"`
|
2016-12-03 09:42:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Documentation URL: https://docs.qingcloud.com/api/lb/delete_loadbalancer_policies.html
|
|
|
|
func (s *LoadBalancerService) DeleteLoadBalancerPolicies(i *DeleteLoadBalancerPoliciesInput) (*DeleteLoadBalancerPoliciesOutput, error) {
|
|
|
|
if i == nil {
|
|
|
|
i = &DeleteLoadBalancerPoliciesInput{}
|
|
|
|
}
|
|
|
|
o := &data.Operation{
|
|
|
|
Config: s.Config,
|
|
|
|
Properties: s.Properties,
|
|
|
|
APIName: "DeleteLoadBalancerPolicies",
|
|
|
|
RequestMethod: "GET",
|
|
|
|
}
|
|
|
|
|
|
|
|
x := &DeleteLoadBalancerPoliciesOutput{}
|
|
|
|
r, err := request.New(o, i, x)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
|
|
|
|
err = r.Send()
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
|
|
|
|
return x, err
|
|
|
|
}
|
|
|
|
|
|
|
|
type DeleteLoadBalancerPoliciesInput struct {
|
2017-01-05 14:03:55 +00:00
|
|
|
LoadBalancerPolicies []*string `json:"loadbalancer_policies" name:"loadbalancer_policies" location:"params"` // Required
|
2016-12-03 09:42:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (v *DeleteLoadBalancerPoliciesInput) Validate() error {
|
|
|
|
|
|
|
|
if len(v.LoadBalancerPolicies) == 0 {
|
2017-01-05 14:03:55 +00:00
|
|
|
return errors.ParameterRequiredError{
|
2016-12-03 09:42:26 +00:00
|
|
|
ParameterName: "LoadBalancerPolicies",
|
|
|
|
ParentName: "DeleteLoadBalancerPoliciesInput",
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
type DeleteLoadBalancerPoliciesOutput struct {
|
2017-01-05 14:03:55 +00:00
|
|
|
Message *string `json:"message" name:"message"`
|
|
|
|
Action *string `json:"action" name:"action" location:"elements"`
|
|
|
|
LoadBalancerPolicies []*string `json:"loadbalancer_policies" name:"loadbalancer_policies" location:"elements"`
|
|
|
|
RetCode *int `json:"ret_code" name:"ret_code" location:"elements"`
|
2016-12-03 09:42:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Documentation URL: https://docs.qingcloud.com/api/lb/delete_loadbalancer_policy_rules.html
|
|
|
|
func (s *LoadBalancerService) DeleteLoadBalancerPolicyRules(i *DeleteLoadBalancerPolicyRulesInput) (*DeleteLoadBalancerPolicyRulesOutput, error) {
|
|
|
|
if i == nil {
|
|
|
|
i = &DeleteLoadBalancerPolicyRulesInput{}
|
|
|
|
}
|
|
|
|
o := &data.Operation{
|
|
|
|
Config: s.Config,
|
|
|
|
Properties: s.Properties,
|
|
|
|
APIName: "DeleteLoadBalancerPolicyRules",
|
|
|
|
RequestMethod: "GET",
|
|
|
|
}
|
|
|
|
|
|
|
|
x := &DeleteLoadBalancerPolicyRulesOutput{}
|
|
|
|
r, err := request.New(o, i, x)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
|
|
|
|
err = r.Send()
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
|
|
|
|
return x, err
|
|
|
|
}
|
|
|
|
|
|
|
|
type DeleteLoadBalancerPolicyRulesInput struct {
|
2017-01-05 14:03:55 +00:00
|
|
|
LoadBalancerPolicyRules []*string `json:"loadbalancer_policy_rules" name:"loadbalancer_policy_rules" location:"params"` // Required
|
2016-12-03 09:42:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (v *DeleteLoadBalancerPolicyRulesInput) Validate() error {
|
|
|
|
|
|
|
|
if len(v.LoadBalancerPolicyRules) == 0 {
|
2017-01-05 14:03:55 +00:00
|
|
|
return errors.ParameterRequiredError{
|
2016-12-03 09:42:26 +00:00
|
|
|
ParameterName: "LoadBalancerPolicyRules",
|
|
|
|
ParentName: "DeleteLoadBalancerPolicyRulesInput",
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
type DeleteLoadBalancerPolicyRulesOutput struct {
|
2017-01-05 14:03:55 +00:00
|
|
|
Message *string `json:"message" name:"message"`
|
|
|
|
Action *string `json:"action" name:"action" location:"elements"`
|
|
|
|
LoadBalancerPolicyRules []*string `json:"loadbalancer_policy_rules" name:"loadbalancer_policy_rules" location:"elements"`
|
|
|
|
RetCode *int `json:"ret_code" name:"ret_code" location:"elements"`
|
2016-12-03 09:42:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Documentation URL: https://docs.qingcloud.com/api/lb/delete_loadbalancers.html
|
|
|
|
func (s *LoadBalancerService) DeleteLoadBalancers(i *DeleteLoadBalancersInput) (*DeleteLoadBalancersOutput, error) {
|
|
|
|
if i == nil {
|
|
|
|
i = &DeleteLoadBalancersInput{}
|
|
|
|
}
|
|
|
|
o := &data.Operation{
|
|
|
|
Config: s.Config,
|
|
|
|
Properties: s.Properties,
|
|
|
|
APIName: "DeleteLoadBalancers",
|
|
|
|
RequestMethod: "GET",
|
|
|
|
}
|
|
|
|
|
|
|
|
x := &DeleteLoadBalancersOutput{}
|
|
|
|
r, err := request.New(o, i, x)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
|
|
|
|
err = r.Send()
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
|
|
|
|
return x, err
|
|
|
|
}
|
|
|
|
|
|
|
|
type DeleteLoadBalancersInput struct {
|
2017-01-05 14:03:55 +00:00
|
|
|
LoadBalancers []*string `json:"loadbalancers" name:"loadbalancers" location:"params"` // Required
|
2016-12-03 09:42:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (v *DeleteLoadBalancersInput) Validate() error {
|
|
|
|
|
|
|
|
if len(v.LoadBalancers) == 0 {
|
2017-01-05 14:03:55 +00:00
|
|
|
return errors.ParameterRequiredError{
|
2016-12-03 09:42:26 +00:00
|
|
|
ParameterName: "LoadBalancers",
|
|
|
|
ParentName: "DeleteLoadBalancersInput",
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
type DeleteLoadBalancersOutput struct {
|
2017-01-05 14:03:55 +00:00
|
|
|
Message *string `json:"message" name:"message"`
|
|
|
|
Action *string `json:"action" name:"action" location:"elements"`
|
|
|
|
JobID *string `json:"job_id" name:"job_id" location:"elements"`
|
|
|
|
LoadBalancers []*string `json:"loadbalancers" name:"loadbalancers" location:"elements"`
|
|
|
|
RetCode *int `json:"ret_code" name:"ret_code" location:"elements"`
|
2016-12-03 09:42:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Documentation URL: https://docs.qingcloud.com/api/lb/delete_server_certificates.html
|
|
|
|
func (s *LoadBalancerService) DeleteServerCertificates(i *DeleteServerCertificatesInput) (*DeleteServerCertificatesOutput, error) {
|
|
|
|
if i == nil {
|
|
|
|
i = &DeleteServerCertificatesInput{}
|
|
|
|
}
|
|
|
|
o := &data.Operation{
|
|
|
|
Config: s.Config,
|
|
|
|
Properties: s.Properties,
|
|
|
|
APIName: "DeleteServerCertificates",
|
|
|
|
RequestMethod: "GET",
|
|
|
|
}
|
|
|
|
|
|
|
|
x := &DeleteServerCertificatesOutput{}
|
|
|
|
r, err := request.New(o, i, x)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
|
|
|
|
err = r.Send()
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
|
|
|
|
return x, err
|
|
|
|
}
|
|
|
|
|
|
|
|
type DeleteServerCertificatesInput struct {
|
2017-01-05 14:03:55 +00:00
|
|
|
ServerCertificates []*string `json:"server_certificates" name:"server_certificates" location:"params"` // Required
|
2016-12-03 09:42:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (v *DeleteServerCertificatesInput) Validate() error {
|
|
|
|
|
|
|
|
if len(v.ServerCertificates) == 0 {
|
2017-01-05 14:03:55 +00:00
|
|
|
return errors.ParameterRequiredError{
|
2016-12-03 09:42:26 +00:00
|
|
|
ParameterName: "ServerCertificates",
|
|
|
|
ParentName: "DeleteServerCertificatesInput",
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
type DeleteServerCertificatesOutput struct {
|
2017-01-05 14:03:55 +00:00
|
|
|
Message *string `json:"message" name:"message"`
|
|
|
|
Action *string `json:"action" name:"action" location:"elements"`
|
|
|
|
RetCode *int `json:"ret_code" name:"ret_code" location:"elements"`
|
|
|
|
ServerCertificates []*string `json:"server_certificates" name:"server_certificates" location:"elements"`
|
2016-12-03 09:42:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Documentation URL: https://docs.qingcloud.com/api/lb/describe_loadbalancer_backends.html
|
|
|
|
func (s *LoadBalancerService) DescribeLoadBalancerBackends(i *DescribeLoadBalancerBackendsInput) (*DescribeLoadBalancerBackendsOutput, error) {
|
|
|
|
if i == nil {
|
|
|
|
i = &DescribeLoadBalancerBackendsInput{}
|
|
|
|
}
|
|
|
|
o := &data.Operation{
|
|
|
|
Config: s.Config,
|
|
|
|
Properties: s.Properties,
|
|
|
|
APIName: "DescribeLoadBalancerBackends",
|
|
|
|
RequestMethod: "GET",
|
|
|
|
}
|
|
|
|
|
|
|
|
x := &DescribeLoadBalancerBackendsOutput{}
|
|
|
|
r, err := request.New(o, i, x)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
|
|
|
|
err = r.Send()
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
|
|
|
|
return x, err
|
|
|
|
}
|
|
|
|
|
|
|
|
type DescribeLoadBalancerBackendsInput struct {
|
2018-01-08 08:23:50 +00:00
|
|
|
Limit *int `json:"limit" name:"limit" default:"20" location:"params"`
|
|
|
|
LoadBalancer *string `json:"loadbalancer" name:"loadbalancer" location:"params"`
|
|
|
|
LoadBalancerBackends []*string `json:"loadbalancer_backends" name:"loadbalancer_backends" location:"params"`
|
|
|
|
LoadBalancerListener *string `json:"loadbalancer_listener" name:"loadbalancer_listener" location:"params"`
|
|
|
|
Offset *int `json:"offset" name:"offset" default:"0" location:"params"`
|
2018-08-16 08:13:35 +00:00
|
|
|
Owner *string `json:"owner" name:"owner" location:"params"`
|
2018-01-08 08:23:50 +00:00
|
|
|
Verbose *int `json:"verbose" name:"verbose" location:"params"`
|
2016-12-03 09:42:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (v *DescribeLoadBalancerBackendsInput) Validate() error {
|
|
|
|
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
type DescribeLoadBalancerBackendsOutput struct {
|
2017-01-05 14:03:55 +00:00
|
|
|
Message *string `json:"message" name:"message"`
|
|
|
|
Action *string `json:"action" name:"action" location:"elements"`
|
2016-12-03 09:42:26 +00:00
|
|
|
LoadBalancerBackendSet []*LoadBalancerBackend `json:"loadbalancer_backend_set" name:"loadbalancer_backend_set" location:"elements"`
|
2017-01-05 14:03:55 +00:00
|
|
|
RetCode *int `json:"ret_code" name:"ret_code" location:"elements"`
|
2016-12-03 09:42:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Documentation URL: https://docs.qingcloud.com/api/lb/describe_loadbalancer_listeners.html
|
|
|
|
func (s *LoadBalancerService) DescribeLoadBalancerListeners(i *DescribeLoadBalancerListenersInput) (*DescribeLoadBalancerListenersOutput, error) {
|
|
|
|
if i == nil {
|
|
|
|
i = &DescribeLoadBalancerListenersInput{}
|
|
|
|
}
|
|
|
|
o := &data.Operation{
|
|
|
|
Config: s.Config,
|
|
|
|
Properties: s.Properties,
|
|
|
|
APIName: "DescribeLoadBalancerListeners",
|
|
|
|
RequestMethod: "GET",
|
|
|
|
}
|
|
|
|
|
|
|
|
x := &DescribeLoadBalancerListenersOutput{}
|
|
|
|
r, err := request.New(o, i, x)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
|
|
|
|
err = r.Send()
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
|
|
|
|
return x, err
|
|
|
|
}
|
|
|
|
|
|
|
|
type DescribeLoadBalancerListenersInput struct {
|
2017-01-05 14:03:55 +00:00
|
|
|
Limit *int `json:"limit" name:"limit" default:"20" location:"params"`
|
|
|
|
LoadBalancer *string `json:"loadbalancer" name:"loadbalancer" location:"params"`
|
|
|
|
LoadBalancerListeners []*string `json:"loadbalancer_listeners" name:"loadbalancer_listeners" location:"params"`
|
|
|
|
Offset *int `json:"offset" name:"offset" default:"0" location:"params"`
|
2018-08-16 08:13:35 +00:00
|
|
|
Owner *string `json:"owner" name:"owner" location:"params"`
|
2017-01-05 14:03:55 +00:00
|
|
|
Verbose *int `json:"verbose" name:"verbose" location:"params"`
|
2016-12-03 09:42:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (v *DescribeLoadBalancerListenersInput) Validate() error {
|
|
|
|
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
type DescribeLoadBalancerListenersOutput struct {
|
2017-01-05 14:03:55 +00:00
|
|
|
Message *string `json:"message" name:"message"`
|
|
|
|
Action *string `json:"action" name:"action" location:"elements"`
|
2016-12-03 09:42:26 +00:00
|
|
|
LoadBalancerListenerSet []*LoadBalancerListener `json:"loadbalancer_listener_set" name:"loadbalancer_listener_set" location:"elements"`
|
2017-01-05 14:03:55 +00:00
|
|
|
RetCode *int `json:"ret_code" name:"ret_code" location:"elements"`
|
|
|
|
TotalCount *int `json:"total_count" name:"total_count" location:"elements"`
|
2016-12-03 09:42:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Documentation URL: https://docs.qingcloud.com/api/lb/describe_loadbalancer_policies.html
|
|
|
|
func (s *LoadBalancerService) DescribeLoadBalancerPolicies(i *DescribeLoadBalancerPoliciesInput) (*DescribeLoadBalancerPoliciesOutput, error) {
|
|
|
|
if i == nil {
|
|
|
|
i = &DescribeLoadBalancerPoliciesInput{}
|
|
|
|
}
|
|
|
|
o := &data.Operation{
|
|
|
|
Config: s.Config,
|
|
|
|
Properties: s.Properties,
|
|
|
|
APIName: "DescribeLoadBalancerPolicies",
|
|
|
|
RequestMethod: "GET",
|
|
|
|
}
|
|
|
|
|
|
|
|
x := &DescribeLoadBalancerPoliciesOutput{}
|
|
|
|
r, err := request.New(o, i, x)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
|
|
|
|
err = r.Send()
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
|
|
|
|
return x, err
|
|
|
|
}
|
|
|
|
|
|
|
|
type DescribeLoadBalancerPoliciesInput struct {
|
2017-01-05 14:03:55 +00:00
|
|
|
Limit *int `json:"limit" name:"limit" default:"20" location:"params"`
|
|
|
|
LoadBalancerPolicies []*string `json:"loadbalancer_policies" name:"loadbalancer_policies" location:"params"`
|
|
|
|
Offset *int `json:"offset" name:"offset" default:"0" location:"params"`
|
2018-08-16 08:13:35 +00:00
|
|
|
Owner *string `json:"owner" name:"owner" location:"params"`
|
2017-01-05 14:03:55 +00:00
|
|
|
Verbose *int `json:"verbose" name:"verbose" location:"params"`
|
2016-12-03 09:42:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (v *DescribeLoadBalancerPoliciesInput) Validate() error {
|
|
|
|
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
type DescribeLoadBalancerPoliciesOutput struct {
|
2017-01-05 14:03:55 +00:00
|
|
|
Message *string `json:"message" name:"message"`
|
|
|
|
Action *string `json:"action" name:"action" location:"elements"`
|
2016-12-03 09:42:26 +00:00
|
|
|
LoadBalancerPolicySet []*LoadBalancerPolicy `json:"loadbalancer_policy_set" name:"loadbalancer_policy_set" location:"elements"`
|
2017-01-05 14:03:55 +00:00
|
|
|
RetCode *int `json:"ret_code" name:"ret_code" location:"elements"`
|
|
|
|
TotalCount *int `json:"total_count" name:"total_count" location:"elements"`
|
2016-12-03 09:42:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Documentation URL: https://docs.qingcloud.com/api/lb/describe_loadbalancer_policy_rules.html
|
|
|
|
func (s *LoadBalancerService) DescribeLoadBalancerPolicyRules(i *DescribeLoadBalancerPolicyRulesInput) (*DescribeLoadBalancerPolicyRulesOutput, error) {
|
|
|
|
if i == nil {
|
|
|
|
i = &DescribeLoadBalancerPolicyRulesInput{}
|
|
|
|
}
|
|
|
|
o := &data.Operation{
|
|
|
|
Config: s.Config,
|
|
|
|
Properties: s.Properties,
|
|
|
|
APIName: "DescribeLoadBalancerPolicyRules",
|
|
|
|
RequestMethod: "GET",
|
|
|
|
}
|
|
|
|
|
|
|
|
x := &DescribeLoadBalancerPolicyRulesOutput{}
|
|
|
|
r, err := request.New(o, i, x)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
|
|
|
|
err = r.Send()
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
|
|
|
|
return x, err
|
|
|
|
}
|
|
|
|
|
|
|
|
type DescribeLoadBalancerPolicyRulesInput struct {
|
2017-01-05 14:03:55 +00:00
|
|
|
Limit *int `json:"limit" name:"limit" default:"20" location:"params"`
|
|
|
|
LoadBalancerPolicy *string `json:"loadbalancer_policy" name:"loadbalancer_policy" location:"params"`
|
|
|
|
LoadBalancerPolicyRules []*string `json:"loadbalancer_policy_rules" name:"loadbalancer_policy_rules" location:"params"`
|
|
|
|
Offset *int `json:"offset" name:"offset" default:"0" location:"params"`
|
2018-08-16 08:13:35 +00:00
|
|
|
Owner *string `json:"owner" name:"owner" location:"params"`
|
2016-12-03 09:42:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (v *DescribeLoadBalancerPolicyRulesInput) Validate() error {
|
|
|
|
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
type DescribeLoadBalancerPolicyRulesOutput struct {
|
2017-01-05 14:03:55 +00:00
|
|
|
Message *string `json:"message" name:"message"`
|
|
|
|
Action *string `json:"action" name:"action" location:"elements"`
|
2016-12-03 09:42:26 +00:00
|
|
|
LoadBalancerPolicyRuleSet []*LoadBalancerPolicyRule `json:"loadbalancer_policy_rule_set" name:"loadbalancer_policy_rule_set" location:"elements"`
|
2017-01-05 14:03:55 +00:00
|
|
|
RetCode *int `json:"ret_code" name:"ret_code" location:"elements"`
|
|
|
|
TotalCount *int `json:"total_count" name:"total_count" location:"elements"`
|
2016-12-03 09:42:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Documentation URL: https://docs.qingcloud.com/api/lb/describe_loadbalancers.html
|
|
|
|
func (s *LoadBalancerService) DescribeLoadBalancers(i *DescribeLoadBalancersInput) (*DescribeLoadBalancersOutput, error) {
|
|
|
|
if i == nil {
|
|
|
|
i = &DescribeLoadBalancersInput{}
|
|
|
|
}
|
|
|
|
o := &data.Operation{
|
|
|
|
Config: s.Config,
|
|
|
|
Properties: s.Properties,
|
|
|
|
APIName: "DescribeLoadBalancers",
|
|
|
|
RequestMethod: "GET",
|
|
|
|
}
|
|
|
|
|
|
|
|
x := &DescribeLoadBalancersOutput{}
|
|
|
|
r, err := request.New(o, i, x)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
|
|
|
|
err = r.Send()
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
|
|
|
|
return x, err
|
|
|
|
}
|
|
|
|
|
|
|
|
type DescribeLoadBalancersInput struct {
|
2017-01-05 14:03:55 +00:00
|
|
|
Limit *int `json:"limit" name:"limit" default:"20" location:"params"`
|
|
|
|
LoadBalancers []*string `json:"loadbalancers" name:"loadbalancers" location:"params"`
|
|
|
|
Offset *int `json:"offset" name:"offset" default:"0" location:"params"`
|
2018-08-16 08:13:35 +00:00
|
|
|
Owner *string `json:"owner" name:"owner" location:"params"`
|
2017-01-05 14:03:55 +00:00
|
|
|
SearchWord *string `json:"search_word" name:"search_word" location:"params"`
|
|
|
|
Status []*string `json:"status" name:"status" location:"params"`
|
|
|
|
Tags []*string `json:"tags" name:"tags" location:"params"`
|
|
|
|
Verbose *int `json:"verbose" name:"verbose" default:"0" location:"params"`
|
2016-12-03 09:42:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (v *DescribeLoadBalancersInput) Validate() error {
|
|
|
|
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
type DescribeLoadBalancersOutput struct {
|
2017-01-05 14:03:55 +00:00
|
|
|
Message *string `json:"message" name:"message"`
|
|
|
|
Action *string `json:"action" name:"action" location:"elements"`
|
2016-12-03 09:42:26 +00:00
|
|
|
LoadBalancerSet []*LoadBalancer `json:"loadbalancer_set" name:"loadbalancer_set" location:"elements"`
|
2017-01-05 14:03:55 +00:00
|
|
|
RetCode *int `json:"ret_code" name:"ret_code" location:"elements"`
|
2016-12-03 09:42:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Documentation URL: https://docs.qingcloud.com/api/lb/describe_server_certificates.html
|
|
|
|
func (s *LoadBalancerService) DescribeServerCertificates(i *DescribeServerCertificatesInput) (*DescribeServerCertificatesOutput, error) {
|
|
|
|
if i == nil {
|
|
|
|
i = &DescribeServerCertificatesInput{}
|
|
|
|
}
|
|
|
|
o := &data.Operation{
|
|
|
|
Config: s.Config,
|
|
|
|
Properties: s.Properties,
|
|
|
|
APIName: "DescribeServerCertificates",
|
|
|
|
RequestMethod: "GET",
|
|
|
|
}
|
|
|
|
|
|
|
|
x := &DescribeServerCertificatesOutput{}
|
|
|
|
r, err := request.New(o, i, x)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
|
|
|
|
err = r.Send()
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
|
|
|
|
return x, err
|
|
|
|
}
|
|
|
|
|
|
|
|
type DescribeServerCertificatesInput struct {
|
2017-12-23 15:05:05 +00:00
|
|
|
Limit *int `json:"limit" name:"limit" default:"20" location:"params"`
|
|
|
|
Offset *int `json:"offset" name:"offset" default:"0" location:"params"`
|
2018-08-16 08:13:35 +00:00
|
|
|
Owner *string `json:"owner" name:"owner" location:"params"`
|
2017-12-23 15:05:05 +00:00
|
|
|
SearchWord *string `json:"search_word" name:"search_word" location:"params"`
|
|
|
|
ServerCertificates []*string `json:"server_certificates" name:"server_certificates" location:"params"`
|
|
|
|
Verbose *int `json:"verbose" name:"verbose" default:"0" location:"params"`
|
2016-12-03 09:42:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (v *DescribeServerCertificatesInput) Validate() error {
|
|
|
|
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
type DescribeServerCertificatesOutput struct {
|
2017-01-05 14:03:55 +00:00
|
|
|
Message *string `json:"message" name:"message"`
|
|
|
|
Action *string `json:"action" name:"action" location:"elements"`
|
|
|
|
RetCode *int `json:"ret_code" name:"ret_code" location:"elements"`
|
2016-12-03 09:42:26 +00:00
|
|
|
ServerCertificateSet []*ServerCertificate `json:"server_certificate_set" name:"server_certificate_set" location:"elements"`
|
2017-01-05 14:03:55 +00:00
|
|
|
TotalCount *int `json:"total_count" name:"total_count" location:"elements"`
|
2016-12-03 09:42:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Documentation URL: https://docs.qingcloud.com/api/lb/dissociate_eips_from_loadbalancer.html
|
|
|
|
func (s *LoadBalancerService) DissociateEIPsFromLoadBalancer(i *DissociateEIPsFromLoadBalancerInput) (*DissociateEIPsFromLoadBalancerOutput, error) {
|
|
|
|
if i == nil {
|
|
|
|
i = &DissociateEIPsFromLoadBalancerInput{}
|
|
|
|
}
|
|
|
|
o := &data.Operation{
|
|
|
|
Config: s.Config,
|
|
|
|
Properties: s.Properties,
|
|
|
|
APIName: "DissociateEipsFromLoadBalancer",
|
|
|
|
RequestMethod: "GET",
|
|
|
|
}
|
|
|
|
|
|
|
|
x := &DissociateEIPsFromLoadBalancerOutput{}
|
|
|
|
r, err := request.New(o, i, x)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
|
|
|
|
err = r.Send()
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
|
|
|
|
return x, err
|
|
|
|
}
|
|
|
|
|
|
|
|
type DissociateEIPsFromLoadBalancerInput struct {
|
2017-01-05 14:03:55 +00:00
|
|
|
EIPs []*string `json:"eips" name:"eips" location:"params"` // Required
|
|
|
|
LoadBalancer *string `json:"loadbalancer" name:"loadbalancer" location:"params"` // Required
|
2016-12-03 09:42:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (v *DissociateEIPsFromLoadBalancerInput) Validate() error {
|
|
|
|
|
|
|
|
if len(v.EIPs) == 0 {
|
2017-01-05 14:03:55 +00:00
|
|
|
return errors.ParameterRequiredError{
|
2016-12-03 09:42:26 +00:00
|
|
|
ParameterName: "EIPs",
|
|
|
|
ParentName: "DissociateEIPsFromLoadBalancerInput",
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-01-05 14:03:55 +00:00
|
|
|
if v.LoadBalancer == nil {
|
|
|
|
return errors.ParameterRequiredError{
|
2016-12-03 09:42:26 +00:00
|
|
|
ParameterName: "LoadBalancer",
|
|
|
|
ParentName: "DissociateEIPsFromLoadBalancerInput",
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
type DissociateEIPsFromLoadBalancerOutput struct {
|
2017-01-05 14:03:55 +00:00
|
|
|
Message *string `json:"message" name:"message"`
|
|
|
|
Action *string `json:"action" name:"action" location:"elements"`
|
|
|
|
JobID *string `json:"job_id" name:"job_id" location:"elements"`
|
|
|
|
RetCode *int `json:"ret_code" name:"ret_code" location:"elements"`
|
2016-12-03 09:42:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Documentation URL: https://docs.qingcloud.com/api/monitor/get_loadbalancer_monitor.html
|
|
|
|
func (s *LoadBalancerService) GetLoadBalancerMonitor(i *GetLoadBalancerMonitorInput) (*GetLoadBalancerMonitorOutput, error) {
|
|
|
|
if i == nil {
|
|
|
|
i = &GetLoadBalancerMonitorInput{}
|
|
|
|
}
|
|
|
|
o := &data.Operation{
|
|
|
|
Config: s.Config,
|
|
|
|
Properties: s.Properties,
|
|
|
|
APIName: "GetLoadBalancerMonitor",
|
|
|
|
RequestMethod: "GET",
|
|
|
|
}
|
|
|
|
|
|
|
|
x := &GetLoadBalancerMonitorOutput{}
|
|
|
|
r, err := request.New(o, i, x)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
|
|
|
|
err = r.Send()
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
|
|
|
|
return x, err
|
|
|
|
}
|
|
|
|
|
|
|
|
type GetLoadBalancerMonitorInput struct {
|
2017-01-05 14:03:55 +00:00
|
|
|
EndTime *time.Time `json:"end_time" name:"end_time" format:"ISO 8601" location:"params"` // Required
|
|
|
|
Meters []*string `json:"meters" name:"meters" location:"params"` // Required
|
|
|
|
Resource *string `json:"resource" name:"resource" location:"params"` // Required
|
|
|
|
ResourceType *string `json:"resource_type" name:"resource_type" default:"loadbalancer" location:"params"`
|
|
|
|
StartTime *time.Time `json:"start_time" name:"start_time" format:"ISO 8601" location:"params"` // Required
|
2016-12-03 09:42:26 +00:00
|
|
|
// Step's available values: 5m, 15m, 2h, 1d
|
2017-01-05 14:03:55 +00:00
|
|
|
Step *string `json:"step" name:"step" location:"params"` // Required
|
2016-12-03 09:42:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (v *GetLoadBalancerMonitorInput) Validate() error {
|
|
|
|
|
|
|
|
if len(v.Meters) == 0 {
|
2017-01-05 14:03:55 +00:00
|
|
|
return errors.ParameterRequiredError{
|
2016-12-03 09:42:26 +00:00
|
|
|
ParameterName: "Meters",
|
|
|
|
ParentName: "GetLoadBalancerMonitorInput",
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-01-05 14:03:55 +00:00
|
|
|
if v.Resource == nil {
|
|
|
|
return errors.ParameterRequiredError{
|
2016-12-03 09:42:26 +00:00
|
|
|
ParameterName: "Resource",
|
|
|
|
ParentName: "GetLoadBalancerMonitorInput",
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-01-05 14:03:55 +00:00
|
|
|
if v.Step == nil {
|
|
|
|
return errors.ParameterRequiredError{
|
2016-12-03 09:42:26 +00:00
|
|
|
ParameterName: "Step",
|
|
|
|
ParentName: "GetLoadBalancerMonitorInput",
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-01-05 14:03:55 +00:00
|
|
|
if v.Step != nil {
|
2016-12-03 09:42:26 +00:00
|
|
|
stepValidValues := []string{"5m", "15m", "2h", "1d"}
|
2017-01-05 14:03:55 +00:00
|
|
|
stepParameterValue := fmt.Sprint(*v.Step)
|
2016-12-03 09:42:26 +00:00
|
|
|
|
|
|
|
stepIsValid := false
|
|
|
|
for _, value := range stepValidValues {
|
|
|
|
if value == stepParameterValue {
|
|
|
|
stepIsValid = true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if !stepIsValid {
|
2017-01-05 14:03:55 +00:00
|
|
|
return errors.ParameterValueNotAllowedError{
|
2016-12-03 09:42:26 +00:00
|
|
|
ParameterName: "Step",
|
|
|
|
ParameterValue: stepParameterValue,
|
|
|
|
AllowedValues: stepValidValues,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
type GetLoadBalancerMonitorOutput struct {
|
2017-01-05 14:03:55 +00:00
|
|
|
Message *string `json:"message" name:"message"`
|
|
|
|
Action *string `json:"action" name:"action" location:"elements"`
|
2016-12-03 09:42:26 +00:00
|
|
|
MeterSet []*Meter `json:"meter_set" name:"meter_set" location:"elements"`
|
2017-01-05 14:03:55 +00:00
|
|
|
ResourceID *string `json:"resource_id" name:"resource_id" location:"elements"`
|
|
|
|
RetCode *int `json:"ret_code" name:"ret_code" location:"elements"`
|
2016-12-03 09:42:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Documentation URL: https://docs.qingcloud.com/api/lb/modify_loadbalancer_attributes.html
|
|
|
|
func (s *LoadBalancerService) ModifyLoadBalancerAttributes(i *ModifyLoadBalancerAttributesInput) (*ModifyLoadBalancerAttributesOutput, error) {
|
|
|
|
if i == nil {
|
|
|
|
i = &ModifyLoadBalancerAttributesInput{}
|
|
|
|
}
|
|
|
|
o := &data.Operation{
|
|
|
|
Config: s.Config,
|
|
|
|
Properties: s.Properties,
|
|
|
|
APIName: "ModifyLoadBalancerAttributes",
|
|
|
|
RequestMethod: "GET",
|
|
|
|
}
|
|
|
|
|
|
|
|
x := &ModifyLoadBalancerAttributesOutput{}
|
|
|
|
r, err := request.New(o, i, x)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
|
|
|
|
err = r.Send()
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
|
|
|
|
return x, err
|
|
|
|
}
|
|
|
|
|
|
|
|
type ModifyLoadBalancerAttributesInput struct {
|
2017-01-05 14:03:55 +00:00
|
|
|
Description *string `json:"description" name:"description" location:"params"`
|
2017-12-15 02:52:11 +00:00
|
|
|
HTTPHeaderSize *int `json:"http_header_size" name:"http_header_size" location:"params"`
|
2017-01-05 14:03:55 +00:00
|
|
|
LoadBalancer *string `json:"loadbalancer" name:"loadbalancer" location:"params"` // Required
|
|
|
|
LoadBalancerName *string `json:"loadbalancer_name" name:"loadbalancer_name" location:"params"`
|
2017-12-13 08:55:15 +00:00
|
|
|
NodeCount *int `json:"node_count" name:"node_count" location:"params"`
|
2017-01-05 14:03:55 +00:00
|
|
|
PrivateIP *string `json:"private_ip" name:"private_ip" location:"params"`
|
|
|
|
SecurityGroup *string `json:"security_group" name:"security_group" location:"params"`
|
2016-12-03 09:42:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (v *ModifyLoadBalancerAttributesInput) Validate() error {
|
|
|
|
|
2017-01-05 14:03:55 +00:00
|
|
|
if v.LoadBalancer == nil {
|
|
|
|
return errors.ParameterRequiredError{
|
2016-12-03 09:42:26 +00:00
|
|
|
ParameterName: "LoadBalancer",
|
|
|
|
ParentName: "ModifyLoadBalancerAttributesInput",
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
type ModifyLoadBalancerAttributesOutput struct {
|
2017-01-05 14:03:55 +00:00
|
|
|
Message *string `json:"message" name:"message"`
|
|
|
|
Action *string `json:"action" name:"action" location:"elements"`
|
|
|
|
RetCode *int `json:"ret_code" name:"ret_code" location:"elements"`
|
2016-12-03 09:42:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Documentation URL: https://docs.qingcloud.com/api/lb/modify_loadbalancer_backend_attributes.html
|
|
|
|
func (s *LoadBalancerService) ModifyLoadBalancerBackendAttributes(i *ModifyLoadBalancerBackendAttributesInput) (*ModifyLoadBalancerBackendAttributesOutput, error) {
|
|
|
|
if i == nil {
|
|
|
|
i = &ModifyLoadBalancerBackendAttributesInput{}
|
|
|
|
}
|
|
|
|
o := &data.Operation{
|
|
|
|
Config: s.Config,
|
|
|
|
Properties: s.Properties,
|
|
|
|
APIName: "ModifyLoadBalancerBackendAttributes",
|
|
|
|
RequestMethod: "GET",
|
|
|
|
}
|
|
|
|
|
|
|
|
x := &ModifyLoadBalancerBackendAttributesOutput{}
|
|
|
|
r, err := request.New(o, i, x)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
|
|
|
|
err = r.Send()
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
|
|
|
|
return x, err
|
|
|
|
}
|
|
|
|
|
|
|
|
type ModifyLoadBalancerBackendAttributesInput struct {
|
|
|
|
|
|
|
|
// Disabled's available values: 0, 1
|
2017-01-05 14:03:55 +00:00
|
|
|
Disabled *int `json:"disabled" name:"disabled" location:"params"`
|
|
|
|
LoadBalancerBackend *string `json:"loadbalancer_backend" name:"loadbalancer_backend" location:"params"`
|
|
|
|
LoadBalancerBackendName *string `json:"loadbalancer_backend_name" name:"loadbalancer_backend_name" location:"params"`
|
|
|
|
LoadBalancerPolicyID *string `json:"loadbalancer_policy_id" name:"loadbalancer_policy_id" location:"params"`
|
2018-01-08 06:35:03 +00:00
|
|
|
Port *int `json:"port" name:"port" location:"params"`
|
|
|
|
Weight *int `json:"weight" name:"weight" location:"params"`
|
2016-12-03 09:42:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (v *ModifyLoadBalancerBackendAttributesInput) Validate() error {
|
|
|
|
|
2017-01-05 14:03:55 +00:00
|
|
|
if v.Disabled != nil {
|
2016-12-03 09:42:26 +00:00
|
|
|
disabledValidValues := []string{"0", "1"}
|
2017-01-05 14:03:55 +00:00
|
|
|
disabledParameterValue := fmt.Sprint(*v.Disabled)
|
2016-12-03 09:42:26 +00:00
|
|
|
|
|
|
|
disabledIsValid := false
|
|
|
|
for _, value := range disabledValidValues {
|
|
|
|
if value == disabledParameterValue {
|
|
|
|
disabledIsValid = true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if !disabledIsValid {
|
2017-01-05 14:03:55 +00:00
|
|
|
return errors.ParameterValueNotAllowedError{
|
2016-12-03 09:42:26 +00:00
|
|
|
ParameterName: "Disabled",
|
|
|
|
ParameterValue: disabledParameterValue,
|
|
|
|
AllowedValues: disabledValidValues,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
type ModifyLoadBalancerBackendAttributesOutput struct {
|
2017-01-05 14:03:55 +00:00
|
|
|
Message *string `json:"message" name:"message"`
|
|
|
|
Action *string `json:"action" name:"action" location:"elements"`
|
|
|
|
RetCode *int `json:"ret_code" name:"ret_code" location:"elements"`
|
2016-12-03 09:42:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Documentation URL: https://docs.qingcloud.com/api/lb/modify_loadbalancer_listener_attributes.html
|
|
|
|
func (s *LoadBalancerService) ModifyLoadBalancerListenerAttributes(i *ModifyLoadBalancerListenerAttributesInput) (*ModifyLoadBalancerListenerAttributesOutput, error) {
|
|
|
|
if i == nil {
|
|
|
|
i = &ModifyLoadBalancerListenerAttributesInput{}
|
|
|
|
}
|
|
|
|
o := &data.Operation{
|
|
|
|
Config: s.Config,
|
|
|
|
Properties: s.Properties,
|
|
|
|
APIName: "ModifyLoadBalancerListenerAttributes",
|
|
|
|
RequestMethod: "GET",
|
|
|
|
}
|
|
|
|
|
|
|
|
x := &ModifyLoadBalancerListenerAttributesOutput{}
|
|
|
|
r, err := request.New(o, i, x)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
|
|
|
|
err = r.Send()
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
|
|
|
|
return x, err
|
|
|
|
}
|
|
|
|
|
|
|
|
type ModifyLoadBalancerListenerAttributesInput struct {
|
2018-06-25 10:17:26 +00:00
|
|
|
BalanceMode *string `json:"balance_mode" name:"balance_mode" location:"params"`
|
|
|
|
Forwardfor *int `json:"forwardfor" name:"forwardfor" location:"params"`
|
|
|
|
HealthyCheckMethod *string `json:"healthy_check_method" name:"healthy_check_method" location:"params"`
|
|
|
|
HealthyCheckOption *string `json:"healthy_check_option" name:"healthy_check_option" location:"params"`
|
|
|
|
ListenerOption *int `json:"listener_option" name:"listener_option" location:"params"`
|
|
|
|
LoadBalancerListener *string `json:"loadbalancer_listener" name:"loadbalancer_listener" location:"params"` // Required
|
|
|
|
LoadBalancerListenerName *string `json:"loadbalancer_listener_name" name:"loadbalancer_listener_name" location:"params"`
|
|
|
|
ServerCertificateID []*string `json:"server_certificate_id" name:"server_certificate_id" location:"params"`
|
|
|
|
SessionSticky *string `json:"session_sticky" name:"session_sticky" location:"params"`
|
|
|
|
Timeout *int `json:"timeout" name:"timeout" location:"params"`
|
2016-12-03 09:42:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (v *ModifyLoadBalancerListenerAttributesInput) Validate() error {
|
|
|
|
|
2017-01-05 14:03:55 +00:00
|
|
|
if v.LoadBalancerListener == nil {
|
|
|
|
return errors.ParameterRequiredError{
|
2016-12-03 09:42:26 +00:00
|
|
|
ParameterName: "LoadBalancerListener",
|
|
|
|
ParentName: "ModifyLoadBalancerListenerAttributesInput",
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
type ModifyLoadBalancerListenerAttributesOutput struct {
|
2017-01-05 14:03:55 +00:00
|
|
|
Message *string `json:"message" name:"message"`
|
|
|
|
Action *string `json:"action" name:"action" location:"elements"`
|
|
|
|
RetCode *int `json:"ret_code" name:"ret_code" location:"elements"`
|
2016-12-03 09:42:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Documentation URL: https://docs.qingcloud.com/api/lb/modify_loadbalancer_policy_attributes.html
|
|
|
|
func (s *LoadBalancerService) ModifyLoadBalancerPolicyAttributes(i *ModifyLoadBalancerPolicyAttributesInput) (*ModifyLoadBalancerPolicyAttributesOutput, error) {
|
|
|
|
if i == nil {
|
|
|
|
i = &ModifyLoadBalancerPolicyAttributesInput{}
|
|
|
|
}
|
|
|
|
o := &data.Operation{
|
|
|
|
Config: s.Config,
|
|
|
|
Properties: s.Properties,
|
|
|
|
APIName: "ModifyLoadBalancerPolicyAttributes",
|
|
|
|
RequestMethod: "GET",
|
|
|
|
}
|
|
|
|
|
|
|
|
x := &ModifyLoadBalancerPolicyAttributesOutput{}
|
|
|
|
r, err := request.New(o, i, x)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
|
|
|
|
err = r.Send()
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
|
|
|
|
return x, err
|
|
|
|
}
|
|
|
|
|
|
|
|
type ModifyLoadBalancerPolicyAttributesInput struct {
|
2017-01-05 14:03:55 +00:00
|
|
|
LoadBalancerPolicy *string `json:"loadbalancer_policy" name:"loadbalancer_policy" location:"params"` // Required
|
|
|
|
LoadBalancerPolicyName *string `json:"loadbalancer_policy_name" name:"loadbalancer_policy_name" location:"params"`
|
|
|
|
Operator *string `json:"operator" name:"operator" location:"params"`
|
2016-12-03 09:42:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (v *ModifyLoadBalancerPolicyAttributesInput) Validate() error {
|
|
|
|
|
2017-01-05 14:03:55 +00:00
|
|
|
if v.LoadBalancerPolicy == nil {
|
|
|
|
return errors.ParameterRequiredError{
|
2016-12-03 09:42:26 +00:00
|
|
|
ParameterName: "LoadBalancerPolicy",
|
|
|
|
ParentName: "ModifyLoadBalancerPolicyAttributesInput",
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
type ModifyLoadBalancerPolicyAttributesOutput struct {
|
2017-01-05 14:03:55 +00:00
|
|
|
Message *string `json:"message" name:"message"`
|
|
|
|
Action *string `json:"action" name:"action" location:"elements"`
|
|
|
|
LoadBalancerPolicyID *string `json:"loadbalancer_policy_id" name:"loadbalancer_policy_id" location:"elements"`
|
|
|
|
RetCode *int `json:"ret_code" name:"ret_code" location:"elements"`
|
2016-12-03 09:42:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Documentation URL: https://docs.qingcloud.com/api/lb/modify_loadbalancer_policy_rule_attributes.html
|
|
|
|
func (s *LoadBalancerService) ModifyLoadBalancerPolicyRuleAttributes(i *ModifyLoadBalancerPolicyRuleAttributesInput) (*ModifyLoadBalancerPolicyRuleAttributesOutput, error) {
|
|
|
|
if i == nil {
|
|
|
|
i = &ModifyLoadBalancerPolicyRuleAttributesInput{}
|
|
|
|
}
|
|
|
|
o := &data.Operation{
|
|
|
|
Config: s.Config,
|
|
|
|
Properties: s.Properties,
|
|
|
|
APIName: "ModifyLoadBalancerPolicyRuleAttributes",
|
|
|
|
RequestMethod: "GET",
|
|
|
|
}
|
|
|
|
|
|
|
|
x := &ModifyLoadBalancerPolicyRuleAttributesOutput{}
|
|
|
|
r, err := request.New(o, i, x)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
|
|
|
|
err = r.Send()
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
|
|
|
|
return x, err
|
|
|
|
}
|
|
|
|
|
|
|
|
type ModifyLoadBalancerPolicyRuleAttributesInput struct {
|
2017-01-05 14:03:55 +00:00
|
|
|
LoadBalancerPolicyRule *string `json:"loadbalancer_policy_rule" name:"loadbalancer_policy_rule" location:"params"` // Required
|
|
|
|
LoadBalancerPolicyRuleName *string `json:"loadbalancer_policy_rule_name" name:"loadbalancer_policy_rule_name" location:"params"`
|
|
|
|
Val *string `json:"val" name:"val" location:"params"`
|
2016-12-03 09:42:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (v *ModifyLoadBalancerPolicyRuleAttributesInput) Validate() error {
|
|
|
|
|
2017-01-05 14:03:55 +00:00
|
|
|
if v.LoadBalancerPolicyRule == nil {
|
|
|
|
return errors.ParameterRequiredError{
|
2016-12-03 09:42:26 +00:00
|
|
|
ParameterName: "LoadBalancerPolicyRule",
|
|
|
|
ParentName: "ModifyLoadBalancerPolicyRuleAttributesInput",
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
type ModifyLoadBalancerPolicyRuleAttributesOutput struct {
|
2017-01-05 14:03:55 +00:00
|
|
|
Message *string `json:"message" name:"message"`
|
|
|
|
Action *string `json:"action" name:"action" location:"elements"`
|
|
|
|
LoadBalancerPolicyRuleID *string `json:"loadbalancer_policy_rule_id" name:"loadbalancer_policy_rule_id" location:"elements"`
|
|
|
|
RetCode *int `json:"ret_code" name:"ret_code" location:"elements"`
|
2016-12-03 09:42:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Documentation URL: https://docs.qingcloud.com/api/lb/modify_server_certificate_attributes.html
|
|
|
|
func (s *LoadBalancerService) ModifyServerCertificateAttributes(i *ModifyServerCertificateAttributesInput) (*ModifyServerCertificateAttributesOutput, error) {
|
|
|
|
if i == nil {
|
|
|
|
i = &ModifyServerCertificateAttributesInput{}
|
|
|
|
}
|
|
|
|
o := &data.Operation{
|
|
|
|
Config: s.Config,
|
|
|
|
Properties: s.Properties,
|
|
|
|
APIName: "ModifyServerCertificateAttributes",
|
|
|
|
RequestMethod: "GET",
|
|
|
|
}
|
|
|
|
|
|
|
|
x := &ModifyServerCertificateAttributesOutput{}
|
|
|
|
r, err := request.New(o, i, x)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
|
|
|
|
err = r.Send()
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
|
|
|
|
return x, err
|
|
|
|
}
|
|
|
|
|
|
|
|
type ModifyServerCertificateAttributesInput struct {
|
2017-01-05 14:03:55 +00:00
|
|
|
Description *string `json:"description" name:"description" location:"params"`
|
|
|
|
ServerCertificate *string `json:"server_certificate" name:"server_certificate" location:"params"` // Required
|
|
|
|
ServerCertificateName *string `json:"server_certificate_name" name:"server_certificate_name" location:"params"`
|
2016-12-03 09:42:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (v *ModifyServerCertificateAttributesInput) Validate() error {
|
|
|
|
|
2017-01-05 14:03:55 +00:00
|
|
|
if v.ServerCertificate == nil {
|
|
|
|
return errors.ParameterRequiredError{
|
2016-12-03 09:42:26 +00:00
|
|
|
ParameterName: "ServerCertificate",
|
|
|
|
ParentName: "ModifyServerCertificateAttributesInput",
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
type ModifyServerCertificateAttributesOutput struct {
|
2017-01-05 14:03:55 +00:00
|
|
|
Message *string `json:"message" name:"message"`
|
|
|
|
Action *string `json:"action" name:"action" location:"elements"`
|
|
|
|
RetCode *int `json:"ret_code" name:"ret_code" location:"elements"`
|
2016-12-03 09:42:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Documentation URL: https://docs.qingcloud.com/api/lb/resize_loadbalancers.html
|
|
|
|
func (s *LoadBalancerService) ResizeLoadBalancers(i *ResizeLoadBalancersInput) (*ResizeLoadBalancersOutput, error) {
|
|
|
|
if i == nil {
|
|
|
|
i = &ResizeLoadBalancersInput{}
|
|
|
|
}
|
|
|
|
o := &data.Operation{
|
|
|
|
Config: s.Config,
|
|
|
|
Properties: s.Properties,
|
|
|
|
APIName: "ResizeLoadBalancers",
|
|
|
|
RequestMethod: "GET",
|
|
|
|
}
|
|
|
|
|
|
|
|
x := &ResizeLoadBalancersOutput{}
|
|
|
|
r, err := request.New(o, i, x)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
|
|
|
|
err = r.Send()
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
|
|
|
|
return x, err
|
|
|
|
}
|
|
|
|
|
|
|
|
type ResizeLoadBalancersInput struct {
|
|
|
|
|
|
|
|
// LoadBalancerType's available values: 0, 1, 2, 3, 4, 5
|
2017-01-05 14:03:55 +00:00
|
|
|
LoadBalancerType *int `json:"loadbalancer_type" name:"loadbalancer_type" location:"params"`
|
|
|
|
LoadBalancers []*string `json:"loadbalancers" name:"loadbalancers" location:"params"`
|
2016-12-03 09:42:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (v *ResizeLoadBalancersInput) Validate() error {
|
|
|
|
|
2017-01-05 14:03:55 +00:00
|
|
|
if v.LoadBalancerType != nil {
|
2016-12-03 09:42:26 +00:00
|
|
|
loadBalancerTypeValidValues := []string{"0", "1", "2", "3", "4", "5"}
|
2017-01-05 14:03:55 +00:00
|
|
|
loadBalancerTypeParameterValue := fmt.Sprint(*v.LoadBalancerType)
|
2016-12-03 09:42:26 +00:00
|
|
|
|
|
|
|
loadBalancerTypeIsValid := false
|
|
|
|
for _, value := range loadBalancerTypeValidValues {
|
|
|
|
if value == loadBalancerTypeParameterValue {
|
|
|
|
loadBalancerTypeIsValid = true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if !loadBalancerTypeIsValid {
|
2017-01-05 14:03:55 +00:00
|
|
|
return errors.ParameterValueNotAllowedError{
|
2016-12-03 09:42:26 +00:00
|
|
|
ParameterName: "LoadBalancerType",
|
|
|
|
ParameterValue: loadBalancerTypeParameterValue,
|
|
|
|
AllowedValues: loadBalancerTypeValidValues,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
type ResizeLoadBalancersOutput struct {
|
2017-01-05 14:03:55 +00:00
|
|
|
Message *string `json:"message" name:"message"`
|
|
|
|
Action *string `json:"action" name:"action" location:"elements"`
|
|
|
|
JobID *string `json:"job_id" name:"job_id" location:"elements"`
|
|
|
|
RetCode *int `json:"ret_code" name:"ret_code" location:"elements"`
|
2016-12-03 09:42:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Documentation URL: https://docs.qingcloud.com/api/lb/start_loadbalancers.html
|
|
|
|
func (s *LoadBalancerService) StartLoadBalancers(i *StartLoadBalancersInput) (*StartLoadBalancersOutput, error) {
|
|
|
|
if i == nil {
|
|
|
|
i = &StartLoadBalancersInput{}
|
|
|
|
}
|
|
|
|
o := &data.Operation{
|
|
|
|
Config: s.Config,
|
|
|
|
Properties: s.Properties,
|
|
|
|
APIName: "StartLoadBalancers",
|
|
|
|
RequestMethod: "GET",
|
|
|
|
}
|
|
|
|
|
|
|
|
x := &StartLoadBalancersOutput{}
|
|
|
|
r, err := request.New(o, i, x)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
|
|
|
|
err = r.Send()
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
|
|
|
|
return x, err
|
|
|
|
}
|
|
|
|
|
|
|
|
type StartLoadBalancersInput struct {
|
2017-01-05 14:03:55 +00:00
|
|
|
LoadBalancers []*string `json:"loadbalancers" name:"loadbalancers" location:"params"` // Required
|
2016-12-03 09:42:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (v *StartLoadBalancersInput) Validate() error {
|
|
|
|
|
|
|
|
if len(v.LoadBalancers) == 0 {
|
2017-01-05 14:03:55 +00:00
|
|
|
return errors.ParameterRequiredError{
|
2016-12-03 09:42:26 +00:00
|
|
|
ParameterName: "LoadBalancers",
|
|
|
|
ParentName: "StartLoadBalancersInput",
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
type StartLoadBalancersOutput struct {
|
2017-01-05 14:03:55 +00:00
|
|
|
Message *string `json:"message" name:"message"`
|
|
|
|
Action *string `json:"action" name:"action" location:"elements"`
|
|
|
|
JobID *string `json:"job_id" name:"job_id" location:"elements"`
|
|
|
|
RetCode *int `json:"ret_code" name:"ret_code" location:"elements"`
|
2016-12-03 09:42:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Documentation URL: https://docs.qingcloud.com/api/lb/stop_loadbalancers.html
|
|
|
|
func (s *LoadBalancerService) StopLoadBalancers(i *StopLoadBalancersInput) (*StopLoadBalancersOutput, error) {
|
|
|
|
if i == nil {
|
|
|
|
i = &StopLoadBalancersInput{}
|
|
|
|
}
|
|
|
|
o := &data.Operation{
|
|
|
|
Config: s.Config,
|
|
|
|
Properties: s.Properties,
|
|
|
|
APIName: "StopLoadBalancers",
|
|
|
|
RequestMethod: "GET",
|
|
|
|
}
|
|
|
|
|
|
|
|
x := &StopLoadBalancersOutput{}
|
|
|
|
r, err := request.New(o, i, x)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
|
|
|
|
err = r.Send()
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
|
|
|
|
return x, err
|
|
|
|
}
|
|
|
|
|
|
|
|
type StopLoadBalancersInput struct {
|
2017-08-28 04:17:56 +00:00
|
|
|
LoadBalancers []*string `json:"loadbalancers" name:"loadbalancers" location:"params"` // Required
|
2016-12-03 09:42:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (v *StopLoadBalancersInput) Validate() error {
|
|
|
|
|
2017-08-28 04:17:56 +00:00
|
|
|
if len(v.LoadBalancers) == 0 {
|
2017-01-05 14:03:55 +00:00
|
|
|
return errors.ParameterRequiredError{
|
2016-12-03 09:42:26 +00:00
|
|
|
ParameterName: "LoadBalancers",
|
|
|
|
ParentName: "StopLoadBalancersInput",
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
type StopLoadBalancersOutput struct {
|
2017-01-05 14:03:55 +00:00
|
|
|
Message *string `json:"message" name:"message"`
|
|
|
|
Action *string `json:"action" name:"action" location:"elements"`
|
2017-08-28 06:59:30 +00:00
|
|
|
JobID *string `json:"job_id" name:"job_id" location:"elements"`
|
2017-01-05 14:03:55 +00:00
|
|
|
RetCode *int `json:"ret_code" name:"ret_code" location:"elements"`
|
2016-12-03 09:42:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Documentation URL: https://docs.qingcloud.com/api/lb/update_loadbalancers.html
|
|
|
|
func (s *LoadBalancerService) UpdateLoadBalancers(i *UpdateLoadBalancersInput) (*UpdateLoadBalancersOutput, error) {
|
|
|
|
if i == nil {
|
|
|
|
i = &UpdateLoadBalancersInput{}
|
|
|
|
}
|
|
|
|
o := &data.Operation{
|
|
|
|
Config: s.Config,
|
|
|
|
Properties: s.Properties,
|
|
|
|
APIName: "UpdateLoadBalancers",
|
|
|
|
RequestMethod: "GET",
|
|
|
|
}
|
|
|
|
|
|
|
|
x := &UpdateLoadBalancersOutput{}
|
|
|
|
r, err := request.New(o, i, x)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
|
|
|
|
err = r.Send()
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
|
|
|
|
return x, err
|
|
|
|
}
|
|
|
|
|
|
|
|
type UpdateLoadBalancersInput struct {
|
2017-01-10 09:53:21 +00:00
|
|
|
LoadBalancers []*string `json:"loadbalancers" name:"loadbalancers" location:"params"` // Required
|
2016-12-03 09:42:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (v *UpdateLoadBalancersInput) Validate() error {
|
|
|
|
|
2017-01-10 09:53:21 +00:00
|
|
|
if len(v.LoadBalancers) == 0 {
|
2017-01-05 14:03:55 +00:00
|
|
|
return errors.ParameterRequiredError{
|
2016-12-03 09:42:26 +00:00
|
|
|
ParameterName: "LoadBalancers",
|
|
|
|
ParentName: "UpdateLoadBalancersInput",
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
type UpdateLoadBalancersOutput struct {
|
2017-01-05 14:03:55 +00:00
|
|
|
Message *string `json:"message" name:"message"`
|
|
|
|
Action *string `json:"action" name:"action" location:"elements"`
|
2017-01-10 10:12:37 +00:00
|
|
|
JobID *string `json:"job_id" name:"job_id" location:"elements"`
|
2017-01-05 14:03:55 +00:00
|
|
|
RetCode *int `json:"ret_code" name:"ret_code" location:"elements"`
|
2016-12-03 09:42:26 +00:00
|
|
|
}
|