From 98c35cd22068bf1791c8762a1cdfef4db64e2d8c Mon Sep 17 00:00:00 2001 From: Xiaoyu Zhong Date: Mon, 6 Jan 2020 17:48:25 +0800 Subject: [PATCH 1/4] Rename accessKeyId to accessKeyID --- protokube/pkg/protokube/ali_volume.go | 6 +++--- upup/pkg/fi/cloudup/aliup/ali_cloud.go | 14 +++++++------- util/pkg/vfs/osscontext.go | 12 ++++++------ 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/protokube/pkg/protokube/ali_volume.go b/protokube/pkg/protokube/ali_volume.go index 692015cf02..988db24240 100644 --- a/protokube/pkg/protokube/ali_volume.go +++ b/protokube/pkg/protokube/ali_volume.go @@ -47,8 +47,8 @@ type ALIVolumes struct { var _ Volumes = &ALIVolumes{} func NewALIVolumes() (*ALIVolumes, error) { - accessKeyId := os.Getenv("ALIYUN_ACCESS_KEY_ID") - if accessKeyId == "" { + accessKeyID := os.Getenv("ALIYUN_ACCESS_KEY_ID") + if accessKeyID == "" { return nil, fmt.Errorf("error initialing ALIVolumes: ALIYUN_ACCESS_KEY_ID cannot be empty") } accessKeySecret := os.Getenv("ALIYUN_ACCESS_KEY_SECRET") @@ -61,7 +61,7 @@ func NewALIVolumes() (*ALIVolumes, error) { ecsEndpoint = ecs.ECSDefaultEndpoint } - client := ecs.NewClientWithEndpoint(ecsEndpoint, accessKeyId, accessKeySecret) + client := ecs.NewClientWithEndpoint(ecsEndpoint, accessKeyID, accessKeySecret) a := &ALIVolumes{ client: client, } diff --git a/upup/pkg/fi/cloudup/aliup/ali_cloud.go b/upup/pkg/fi/cloudup/aliup/ali_cloud.go index 7db1760ada..10b86a7cb5 100644 --- a/upup/pkg/fi/cloudup/aliup/ali_cloud.go +++ b/upup/pkg/fi/cloudup/aliup/ali_cloud.go @@ -84,8 +84,8 @@ func NewALICloud(region string, tags map[string]string) (ALICloud, error) { c := &aliCloudImplementation{region: region} - accessKeyId := os.Getenv("ALIYUN_ACCESS_KEY_ID") - if accessKeyId == "" { + accessKeyID := os.Getenv("ALIYUN_ACCESS_KEY_ID") + if accessKeyID == "" { return nil, errors.New("ALIYUN_ACCESS_KEY_ID is required") } accessKeySecret := os.Getenv("ALIYUN_ACCESS_KEY_SECRET") @@ -93,13 +93,13 @@ func NewALICloud(region string, tags map[string]string) (ALICloud, error) { return nil, errors.New("ALIYUN_ACCESS_KEY_SECRET is required") } - c.ecsClient = ecs.NewClient(accessKeyId, accessKeySecret) + c.ecsClient = ecs.NewClient(accessKeyID, accessKeySecret) c.ecsClient.SetUserAgent(KubernetesKopsIdentity) - c.slbClient = slb.NewClient(accessKeyId, accessKeySecret) - ramclient := ram.NewClient(accessKeyId, accessKeySecret) + c.slbClient = slb.NewClient(accessKeyID, accessKeySecret) + ramclient := ram.NewClient(accessKeyID, accessKeySecret) c.ramClient = ramclient.(*ram.RamClient) - c.essClient = ess.NewClient(accessKeyId, accessKeySecret) - c.vpcClient = ecs.NewVPCClient(accessKeyId, accessKeySecret, common.Region(region)) + c.essClient = ess.NewClient(accessKeyID, accessKeySecret) + c.vpcClient = ecs.NewVPCClient(accessKeyID, accessKeySecret, common.Region(region)) c.tags = tags diff --git a/util/pkg/vfs/osscontext.go b/util/pkg/vfs/osscontext.go index cbc9d19484..ac897d3a99 100644 --- a/util/pkg/vfs/osscontext.go +++ b/util/pkg/vfs/osscontext.go @@ -28,7 +28,7 @@ import ( type aliyunOSSConfig struct { region oss.Region internal bool - accessKeyId string + accessKeyID string accessKeySecret string securityToken string secure bool @@ -53,10 +53,10 @@ func NewAliOSSClient() (*oss.Client, error) { } if c.securityToken != "" { - return oss.NewOSSClientForAssumeRole(c.region, c.internal, c.accessKeyId, c.accessKeySecret, c.securityToken, c.secure), nil + return oss.NewOSSClientForAssumeRole(c.region, c.internal, c.accessKeyID, c.accessKeySecret, c.securityToken, c.secure), nil } - return oss.NewOSSClient(c.region, c.internal, c.accessKeyId, c.accessKeySecret, c.secure), nil + return oss.NewOSSClient(c.region, c.internal, c.accessKeyID, c.accessKeySecret, c.secure), nil } func (c *aliyunOSSConfig) loadConfig() error { @@ -71,8 +71,8 @@ func (c *aliyunOSSConfig) loadConfig() error { c.region = oss.Region(fmt.Sprintf("oss-%s", region)) } - c.accessKeyId = os.Getenv("ALIYUN_ACCESS_KEY_ID") - if c.accessKeyId != "" { + c.accessKeyID = os.Getenv("ALIYUN_ACCESS_KEY_ID") + if c.accessKeyID != "" { c.accessKeySecret = os.Getenv("ALIYUN_ACCESS_KEY_SECRET") if c.accessKeySecret == "" { return fmt.Errorf("ALIYUN_ACCESS_KEY_SECRET cannot be empty") @@ -87,7 +87,7 @@ func (c *aliyunOSSConfig) loadConfig() error { if err != nil { return fmt.Errorf("Can't get role token: %s", err) } - c.accessKeyId = roleAuth.AccessKeyId + c.accessKeyID = roleAuth.AccessKeyId c.accessKeySecret = roleAuth.AccessKeySecret c.securityToken = roleAuth.SecurityToken } From 074af1c9622e9b97fa8527e57ff98f09ad527c7f Mon Sep 17 00:00:00 2001 From: Xiaoyu Zhong Date: Fri, 10 Jan 2020 14:21:01 +0800 Subject: [PATCH 2/4] Add new SLB() for ALICloud with official SDK --- upup/pkg/fi/cloudup/aliup/ali_cloud.go | 28 +++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/upup/pkg/fi/cloudup/aliup/ali_cloud.go b/upup/pkg/fi/cloudup/aliup/ali_cloud.go index 10b86a7cb5..4f6cc3eb9e 100644 --- a/upup/pkg/fi/cloudup/aliup/ali_cloud.go +++ b/upup/pkg/fi/cloudup/aliup/ali_cloud.go @@ -24,6 +24,9 @@ import ( "k8s.io/klog" + alicloud "github.com/aliyun/alibaba-cloud-sdk-go/sdk" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials" + slbnew "github.com/aliyun/alibaba-cloud-sdk-go/services/slb" "github.com/denverdino/aliyungo/common" "github.com/denverdino/aliyungo/ecs" "github.com/denverdino/aliyungo/ess" @@ -50,6 +53,12 @@ var KubernetesKopsIdentity = fmt.Sprintf("Kubernetes.Kops/%s", prj.Version) type ALICloud interface { fi.Cloud + // Clients that use official Alicloud go sdk + SLB() *slbnew.Client + + // Since package github.com/denverdino/aliyungo is not actively maintained, + // clients that use github.com/denverdino/aliyungo, will be deprecated after + // the above official SDK clients covers all of them EcsClient() *ecs.Client SlbClient() *slb.Client RamClient() *ram.RamClient @@ -66,6 +75,8 @@ type ALICloud interface { } type aliCloudImplementation struct { + slb *slbnew.Client + ecsClient *ecs.Client slbClient *slb.Client ramClient *ram.RamClient @@ -100,12 +111,27 @@ func NewALICloud(region string, tags map[string]string) (ALICloud, error) { c.ramClient = ramclient.(*ram.RamClient) c.essClient = ess.NewClient(accessKeyID, accessKeySecret) c.vpcClient = ecs.NewVPCClient(accessKeyID, accessKeySecret, common.Region(region)) - c.tags = tags + // With Alicloud official go SDK + var err error + + config := alicloud.NewConfig() + credential := credentials.NewAccessKeyCredential(accessKeyID, accessKeySecret) + + c.slb, err = slbnew.NewClientWithOptions(region, config, credential) + if err != nil { + return nil, fmt.Errorf("error creating slb sdk client: %v", err) + } + return c, nil } +func (c *aliCloudImplementation) SLB() *slbnew.Client { + return c.slb +} + +// Clients as below are with github.com/denverdino/aliyungo func (c *aliCloudImplementation) EcsClient() *ecs.Client { return c.ecsClient } From 709e7ef33cecd82748ab97ad658c824d63241fc3 Mon Sep 17 00:00:00 2001 From: Xiaoyu Zhong Date: Fri, 10 Jan 2020 14:20:04 +0800 Subject: [PATCH 3/4] Refactor Alicloud LoadBalancerWhiteList to LoadBalancerACL --- pkg/model/alimodel/api_loadbalancer.go | 29 +- .../fi/cloudup/alitasks/loadbalanceracl.go | 272 ++++++++++++++++++ ...st_fitask.go => loadbalanceracl_fitask.go} | 26 +- .../cloudup/alitasks/loadbalancerwhitelist.go | 145 ---------- upup/pkg/fi/cloudup/apply_cluster.go | 26 +- 5 files changed, 312 insertions(+), 186 deletions(-) create mode 100644 upup/pkg/fi/cloudup/alitasks/loadbalanceracl.go rename upup/pkg/fi/cloudup/alitasks/{loadbalancerwhitelist_fitask.go => loadbalanceracl_fitask.go} (69%) delete mode 100644 upup/pkg/fi/cloudup/alitasks/loadbalancerwhitelist.go diff --git a/pkg/model/alimodel/api_loadbalancer.go b/pkg/model/alimodel/api_loadbalancer.go index 35784c3962..189099f390 100644 --- a/pkg/model/alimodel/api_loadbalancer.go +++ b/pkg/model/alimodel/api_loadbalancer.go @@ -19,7 +19,6 @@ package alimodel import ( "errors" "fmt" - "strings" "k8s.io/kops/pkg/apis/kops" "k8s.io/kops/pkg/dns" @@ -106,28 +105,28 @@ func (b *APILoadBalancerModelBuilder) Build(c *fi.ModelBuilderContext) error { c.AddTask(loadbalancerlistener) } - // Create LoadBalancerWhiteList for API ELB - var loadbalancerwhiteList *alitasks.LoadBalancerWhiteList + // Allow traffic into the SLB from KubernetesAPIAccess CIDRs + var loadBalancerACL *alitasks.LoadBalancerACL { - sourceItems := "" - var cidrs []string + var cidrs []*string for _, cidr := range b.Cluster.Spec.KubernetesAPIAccess { if cidr != "0.0.0.0" && cidr != "0.0.0.0/0" { - cidrs = append(cidrs, cidr) + cc := cidr + cidrs = append(cidrs, &cc) } } - sourceItems = strings.Join(cidrs, ",") - loadbalancerwhiteList = &alitasks.LoadBalancerWhiteList{ - Name: s("api." + b.ClusterName()), - Lifecycle: b.Lifecycle, - LoadBalancer: loadbalancer, - LoadBalancerListener: loadbalancerlistener, - SourceItems: s(sourceItems), + if len(cidrs) != 0 { + loadBalancerACL = &alitasks.LoadBalancerACL{ + Name: s("api." + b.ClusterName()), + Lifecycle: b.Lifecycle, + LoadBalancer: loadbalancer, + LoadBalancerListener: loadbalancerlistener, + SourceItems: cidrs, + } + c.AddTask(loadBalancerACL) } - c.AddTask(loadbalancerwhiteList) - } // Temporarily do not know the role of the following function diff --git a/upup/pkg/fi/cloudup/alitasks/loadbalanceracl.go b/upup/pkg/fi/cloudup/alitasks/loadbalanceracl.go new file mode 100644 index 0000000000..8f783c3f36 --- /dev/null +++ b/upup/pkg/fi/cloudup/alitasks/loadbalanceracl.go @@ -0,0 +1,272 @@ +/* +Copyright 2019 The Kubernetes Authors. + +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. +*/ + +package alitasks + +import ( + "encoding/json" + "fmt" + "sort" + + "k8s.io/klog" + + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + slbnew "github.com/aliyun/alibaba-cloud-sdk-go/services/slb" + "k8s.io/kops/upup/pkg/fi" + "k8s.io/kops/upup/pkg/fi/cloudup/aliup" + "k8s.io/kops/upup/pkg/fi/cloudup/terraform" +) + +type LoadBalancerACL struct { + ID *string + Name *string + LoadBalancer *LoadBalancer + LoadBalancerListener *LoadBalancerListener + SourceItems []*string + Lifecycle *fi.Lifecycle +} + +type AclEntry struct { + Entry string `json:"entry"` + Comment string `json:"comment"` +} + +var _ fi.CompareWithID = &LoadBalancerACL{} + +func (l *LoadBalancerACL) CompareWithID() *string { + return l.Name +} + +func (l *LoadBalancerACL) Find(c *fi.Context) (*LoadBalancerACL, error) { + if l.LoadBalancer == nil || l.LoadBalancer.LoadbalancerId == nil { + klog.V(4).Infof("LoadBalancer / LoadbalancerId not found for %s, skipping Find", fi.StringValue(l.Name)) + return nil, nil + } + if l.LoadBalancerListener == nil || l.LoadBalancerListener.ListenerPort == nil { + klog.V(4).Infof("LoadBalancerListener / LoadbalancerListenerPort not found for %s, skipping Find", fi.StringValue(l.Name)) + return nil, nil + } + + cloud := c.Cloud.(aliup.ALICloud) + + describeAclReq := slbnew.CreateDescribeAccessControlListsRequest() + describeAclReq.AclName = fi.StringValue(l.Name) + + describeAclResp, err := cloud.SLB().DescribeAccessControlLists(describeAclReq) + if err != nil { + return nil, fmt.Errorf("error listing LoadBalancerAccessControlList: %v", err) + } + acls := describeAclResp.Acls.Acl + if len(acls) == 0 { + return nil, nil + } + + if len(acls) > 1 { + return nil, fmt.Errorf("found multiple LoadBalancerAccessControlList with name %s", fi.StringValue(l.Name)) + } + + acl := acls[0] + + klog.V(2).Infof("found matching LoadBalancerAccessControlList: %s", acl.AclId) + + describeAclAttrReq := slbnew.CreateDescribeAccessControlListAttributeRequest() + describeAclAttrReq.AclId = acl.AclId + + describeAclAttrResp, err := cloud.SLB().DescribeAccessControlListAttribute(describeAclAttrReq) + if err != nil { + return nil, fmt.Errorf("error describing LoadBalancerAccessControlListAttribute: %v", err) + } + + var sourceItems []*string + + for _, entry := range describeAclAttrResp.AclEntrys.AclEntry { + ip := entry.AclEntryIP + sourceItems = append(sourceItems, &ip) + } + + actual := &LoadBalancerACL{ + ID: fi.String(acl.AclId), + Name: fi.String(describeAclAttrResp.AclName), + SourceItems: sourceItems, + } + + listeners := describeAclAttrResp.RelatedListeners.RelatedListener + + if len(listeners) != 1 { + actual.LoadBalancerListener = nil + actual.LoadBalancer = nil + } else { + listener := listeners[0] + lb := &LoadBalancer{LoadbalancerId: fi.String(listener.LoadBalancerId)} + actual.LoadBalancer = lb + actual.LoadBalancerListener = &LoadBalancerListener{ + LoadBalancer: lb, + ListenerPort: fi.Int(listener.ListenerPort), + } + } + + // Ignore "system" fields + l.ID = actual.ID + actual.Lifecycle = l.Lifecycle + + return actual, nil +} + +func (l *LoadBalancerACL) Run(c *fi.Context) error { + l.Normalize() + return fi.DefaultDeltaRunMethod(l, c) +} + +func (l *LoadBalancerACL) Normalize() { + // We need to sort our arrays consistently, so we don't get spurious changes + sort.Stable(StringPointers(l.SourceItems)) +} + +// StringPointers implements sort.Interface for []*string +type StringPointers []*string + +func (s StringPointers) Len() int { return len(s) } +func (s StringPointers) Swap(i, j int) { s[i], s[j] = s[j], s[i] } +func (s StringPointers) Less(i, j int) bool { + return fi.StringValue(s[i]) < fi.StringValue(s[j]) +} + +func (_ *LoadBalancerACL) CheckChanges(a, e, changes *LoadBalancerACL) error { + if a == nil { + if e.Name == nil { + return fi.RequiredField("Name") + } + } + return nil +} + +func (_ *LoadBalancerACL) RenderALI(t *aliup.ALIAPITarget, a, e, changes *LoadBalancerACL) error { + if a == nil { + klog.V(2).Infof("Creating LoadBalancerAccessControlList with name: %q for SLB %q", *e.Name, *e.LoadBalancer.LoadbalancerId) + if err := createAcl(t.Cloud, e); err != nil { + return err + } + return e.on(t.Cloud) + } else { + if changes.SourceItems != nil { + klog.V(2).Info("Turning off LoadBalancerACL for SLB") + if err := e.off(t.Cloud); err != nil { + return err + } + + klog.V(2).Infof("Deleting LoadBalancerAccessControlList %q", *a.Name) + err := deleteAcl(t.Cloud, a) + if err != nil { + return fmt.Errorf("error deleting LoadBalancerAccessControlList: %v", err) + } + + klog.V(2).Infof("Creating LoadBalancerAccessControlList with name: %q for SLB %q", *e.Name, *e.LoadBalancer.LoadbalancerId) + if err := createAcl(t.Cloud, e); err != nil { + return err + } + + return e.on(t.Cloud) + } + + if changes.LoadBalancer != nil || changes.LoadBalancerListener != nil { + klog.V(2).Info("Turning on LoadBalancerACL for SLB") + return e.on(t.Cloud) + } + } + + return nil +} + +func (l *LoadBalancerACL) on(alicloud aliup.ALICloud) error { + setLBTCPlistenerAttrReq := slbnew.CreateSetLoadBalancerTCPListenerAttributeRequest() + setLBTCPlistenerAttrReq.AclId = fi.StringValue(l.ID) + setLBTCPlistenerAttrReq.AclType = "white" + setLBTCPlistenerAttrReq.AclStatus = "on" + setLBTCPlistenerAttrReq.LoadBalancerId = fi.StringValue(l.LoadBalancer.LoadbalancerId) + setLBTCPlistenerAttrReq.ListenerPort = requests.NewInteger(fi.IntValue(l.LoadBalancerListener.ListenerPort)) + + _, err := alicloud.SLB().SetLoadBalancerTCPListenerAttribute(setLBTCPlistenerAttrReq) + if err != nil { + return fmt.Errorf("error turning on LoadBalancerACL %v", err) + } + + return nil +} + +func (l *LoadBalancerACL) off(alicloud aliup.ALICloud) error { + setLBTCPlistenerAttrReq := slbnew.CreateSetLoadBalancerTCPListenerAttributeRequest() + setLBTCPlistenerAttrReq.AclStatus = "off" + setLBTCPlistenerAttrReq.LoadBalancerId = fi.StringValue(l.LoadBalancer.LoadbalancerId) + setLBTCPlistenerAttrReq.ListenerPort = requests.NewInteger(fi.IntValue(l.LoadBalancerListener.ListenerPort)) + + _, err := alicloud.SLB().SetLoadBalancerTCPListenerAttribute(setLBTCPlistenerAttrReq) + if err != nil { + return fmt.Errorf("error turning off LoadBalancerACL %v", err) + } + + return nil +} + +func createAcl(alicloud aliup.ALICloud, acl *LoadBalancerACL) error { + createAclReq := slbnew.CreateCreateAccessControlListRequest() + createAclReq.AclName = fi.StringValue(acl.Name) + + resp, err := alicloud.SLB().CreateAccessControlList(createAclReq) + if err != nil { + return fmt.Errorf("error creating LoadBalancerAccessControlList: %v", err) + } + + aclID := resp.AclId + acl.ID = fi.String(aclID) + + var aclEntries []AclEntry + for _, each := range acl.SourceItems { + aclEntries = append(aclEntries, AclEntry{Entry: *each}) + } + + aclEntriesBytes, err := json.Marshal(aclEntries) + if err != nil { + return fmt.Errorf("error marshalling %v : %v", aclEntries, err) + } + + addAclEntryReq := slbnew.CreateAddAccessControlListEntryRequest() + addAclEntryReq.AclId = aclID + addAclEntryReq.AclEntrys = string(aclEntriesBytes) + + _, err = alicloud.SLB().AddAccessControlListEntry(addAclEntryReq) + if err != nil { + return fmt.Errorf("error adding AclEntries %v: %v", addAclEntryReq, err) + } + + return nil +} + +func deleteAcl(alicloud aliup.ALICloud, acl *LoadBalancerACL) error { + deleteAclReq := slbnew.CreateDeleteAccessControlListRequest() + deleteAclReq.AclId = fi.StringValue(acl.ID) + + _, err := alicloud.SLB().DeleteAccessControlList(deleteAclReq) + if err != nil { + return fmt.Errorf("error deleting LoadBalancerAccessControlList %q, %v", fi.StringValue(acl.ID), err) + } + + return nil +} + +func (_ *LoadBalancerACL) RenderTerraform(t *terraform.TerraformTarget, a, e, changes *LoadBalancerACL) error { + klog.Warningf("terraform does not support LoadBalancerAccessControlList on ALI cloud") + return nil +} diff --git a/upup/pkg/fi/cloudup/alitasks/loadbalancerwhitelist_fitask.go b/upup/pkg/fi/cloudup/alitasks/loadbalanceracl_fitask.go similarity index 69% rename from upup/pkg/fi/cloudup/alitasks/loadbalancerwhitelist_fitask.go rename to upup/pkg/fi/cloudup/alitasks/loadbalanceracl_fitask.go index 5872f2b837..c34299fe12 100644 --- a/upup/pkg/fi/cloudup/alitasks/loadbalancerwhitelist_fitask.go +++ b/upup/pkg/fi/cloudup/alitasks/loadbalanceracl_fitask.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// Code generated by ""fitask" -type=LoadBalancerWhiteList"; DO NOT EDIT +// Code generated by ""fitask" -type=LoadBalancerACL"; DO NOT EDIT package alitasks @@ -24,52 +24,52 @@ import ( "k8s.io/kops/upup/pkg/fi" ) -// LoadBalancerWhiteList +// LoadBalancerACL // JSON marshaling boilerplate -type realLoadBalancerWhiteList LoadBalancerWhiteList +type realLoadBalancerACL LoadBalancerACL // UnmarshalJSON implements conversion to JSON, supporting an alternate specification of the object as a string -func (o *LoadBalancerWhiteList) UnmarshalJSON(data []byte) error { +func (o *LoadBalancerACL) UnmarshalJSON(data []byte) error { var jsonName string if err := json.Unmarshal(data, &jsonName); err == nil { o.Name = &jsonName return nil } - var r realLoadBalancerWhiteList + var r realLoadBalancerACL if err := json.Unmarshal(data, &r); err != nil { return err } - *o = LoadBalancerWhiteList(r) + *o = LoadBalancerACL(r) return nil } -var _ fi.HasLifecycle = &LoadBalancerWhiteList{} +var _ fi.HasLifecycle = &LoadBalancerACL{} // GetLifecycle returns the Lifecycle of the object, implementing fi.HasLifecycle -func (o *LoadBalancerWhiteList) GetLifecycle() *fi.Lifecycle { +func (o *LoadBalancerACL) GetLifecycle() *fi.Lifecycle { return o.Lifecycle } // SetLifecycle sets the Lifecycle of the object, implementing fi.SetLifecycle -func (o *LoadBalancerWhiteList) SetLifecycle(lifecycle fi.Lifecycle) { +func (o *LoadBalancerACL) SetLifecycle(lifecycle fi.Lifecycle) { o.Lifecycle = &lifecycle } -var _ fi.HasName = &LoadBalancerWhiteList{} +var _ fi.HasName = &LoadBalancerACL{} // GetName returns the Name of the object, implementing fi.HasName -func (o *LoadBalancerWhiteList) GetName() *string { +func (o *LoadBalancerACL) GetName() *string { return o.Name } // SetName sets the Name of the object, implementing fi.SetName -func (o *LoadBalancerWhiteList) SetName(name string) { +func (o *LoadBalancerACL) SetName(name string) { o.Name = &name } // String is the stringer function for the task, producing readable output using fi.TaskAsString -func (o *LoadBalancerWhiteList) String() string { +func (o *LoadBalancerACL) String() string { return fi.TaskAsString(o) } diff --git a/upup/pkg/fi/cloudup/alitasks/loadbalancerwhitelist.go b/upup/pkg/fi/cloudup/alitasks/loadbalancerwhitelist.go deleted file mode 100644 index be59d30f51..0000000000 --- a/upup/pkg/fi/cloudup/alitasks/loadbalancerwhitelist.go +++ /dev/null @@ -1,145 +0,0 @@ -/* -Copyright 2019 The Kubernetes Authors. - -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. -*/ - -package alitasks - -import ( - "fmt" - "strings" - - "k8s.io/klog" - - "k8s.io/kops/upup/pkg/fi" - "k8s.io/kops/upup/pkg/fi/cloudup/aliup" - "k8s.io/kops/upup/pkg/fi/cloudup/terraform" -) - -//go:generate fitask -type=LoadBalancerWhiteList -type LoadBalancerWhiteList struct { - LoadBalancer *LoadBalancer - LoadBalancerListener *LoadBalancerListener - Name *string - SourceItems *string - Lifecycle *fi.Lifecycle -} - -var _ fi.CompareWithID = &LoadBalancerWhiteList{} - -func (l *LoadBalancerWhiteList) CompareWithID() *string { - return l.Name -} - -func (l *LoadBalancerWhiteList) Find(c *fi.Context) (*LoadBalancerWhiteList, error) { - if l.LoadBalancer == nil || l.LoadBalancer.LoadbalancerId == nil { - klog.V(4).Infof("LoadBalancer / LoadbalancerId not found for %s, skipping Find", fi.StringValue(l.Name)) - return nil, nil - } - if l.LoadBalancerListener == nil || l.LoadBalancerListener.ListenerPort == nil { - klog.V(4).Infof("LoadBalancerListener / LoadbalancerListenerPort not found for %s, skipping Find", fi.StringValue(l.Name)) - return nil, nil - } - - cloud := c.Cloud.(aliup.ALICloud) - loadBalancerId := fi.StringValue(l.LoadBalancer.LoadbalancerId) - listenertPort := fi.IntValue(l.LoadBalancerListener.ListenerPort) - - response, err := cloud.SlbClient().DescribeListenerAccessControlAttribute(loadBalancerId, listenertPort) - if err != nil { - return nil, fmt.Errorf("error finding LoadBalancerWhiteList: %v", err) - } - - if response.SourceItems == "" { - klog.V(2).Infof("can't find matching LoadBalancerWhiteList of ListenerPort: %v", listenertPort) - return nil, nil - } - - klog.V(2).Infof("found matching LoadBalancerWhiteList of ListenerPort: %v", listenertPort) - actual := &LoadBalancerWhiteList{} - actual.SourceItems = fi.String(response.SourceItems) - - // Ignore "system" fields - actual.Name = l.Name - actual.LoadBalancer = l.LoadBalancer - actual.LoadBalancerListener = l.LoadBalancerListener - actual.Lifecycle = l.Lifecycle - - return actual, nil -} - -func (l *LoadBalancerWhiteList) Run(c *fi.Context) error { - return fi.DefaultDeltaRunMethod(l, c) -} - -func (_ *LoadBalancerWhiteList) CheckChanges(a, e, changes *LoadBalancerWhiteList) error { - if a == nil { - if e.Name == nil { - return fi.RequiredField("Name") - } - } - return nil -} - -func (_ *LoadBalancerWhiteList) RenderALI(t *aliup.ALIAPITarget, a, e, changes *LoadBalancerWhiteList) error { - - klog.V(2).Infof("Updating LoadBalancerWhiteList of ListenerPort: %q", *e.LoadBalancerListener.ListenerPort) - - loadBalancerId := fi.StringValue(e.LoadBalancer.LoadbalancerId) - listenertPort := fi.IntValue(e.LoadBalancerListener.ListenerPort) - sourceItems := fi.StringValue(e.SourceItems) - if sourceItems != "" { - err := t.Cloud.SlbClient().AddListenerWhiteListItem(loadBalancerId, listenertPort, sourceItems) - if err != nil { - return fmt.Errorf("error adding LoadBalancerWhiteListItems: %v", err) - } - } - - if a != nil && changes.SourceItems != nil { - itemsToDelete := e.getWhiteItemsToDelete(fi.StringValue(a.SourceItems)) - if itemsToDelete != "" { - err := t.Cloud.SlbClient().RemoveListenerWhiteListItem(loadBalancerId, listenertPort, itemsToDelete) - if err != nil { - return fmt.Errorf("error removing LoadBalancerWhiteListItems: %v", err) - } - } - } - return nil -} - -func (l *LoadBalancerWhiteList) getWhiteItemsToDelete(currentWhiteItems string) string { - currentWhiteItemsList := strings.Split(currentWhiteItems, ",") - expectedWhiteItemsList := strings.Split(fi.StringValue(l.SourceItems), ",") - itemsToDelete := "" - for _, currentItem := range currentWhiteItemsList { - expected := false - if currentItem == "" { - continue - } - for _, expectedItem := range expectedWhiteItemsList { - if currentItem == expectedItem { - expected = true - } - } - if !expected { - itemsToDelete = itemsToDelete + "," + currentItem - } - } - return itemsToDelete -} - -func (_ *LoadBalancerWhiteList) RenderTerraform(t *terraform.TerraformTarget, a, e, changes *LoadBalancerWhiteList) error { - klog.Warningf("terraform does not support LoadBalancerWhiteList on ALI cloud") - return nil -} diff --git a/upup/pkg/fi/cloudup/apply_cluster.go b/upup/pkg/fi/cloudup/apply_cluster.go index 13140191cd..f77c319ef0 100644 --- a/upup/pkg/fi/cloudup/apply_cluster.go +++ b/upup/pkg/fi/cloudup/apply_cluster.go @@ -468,19 +468,19 @@ func (c *ApplyClusterCmd) Run(ctx context.Context) error { aliCloud := cloud.(aliup.ALICloud) region = aliCloud.Region() l.AddTypes(map[string]interface{}{ - "Vpc": &alitasks.VPC{}, - "VSwitch": &alitasks.VSwitch{}, - "Disk": &alitasks.Disk{}, - "SecurityGroup": &alitasks.SecurityGroup{}, - "SecurityGroupRule": &alitasks.SecurityGroupRule{}, - "LoadBalancer": &alitasks.LoadBalancer{}, - "LoadBalancerListener": &alitasks.LoadBalancerListener{}, - "LoadBalancerWhiteList": &alitasks.LoadBalancerWhiteList{}, - "AutoscalingGroup": &alitasks.ScalingGroup{}, - "LaunchConfiguration": &alitasks.LaunchConfiguration{}, - "RAMPolicy": &alitasks.RAMPolicy{}, - "RAMRole": &alitasks.RAMRole{}, - "SSHKey": &alitasks.SSHKey{}, + "Vpc": &alitasks.VPC{}, + "VSwitch": &alitasks.VSwitch{}, + "Disk": &alitasks.Disk{}, + "SecurityGroup": &alitasks.SecurityGroup{}, + "SecurityGroupRule": &alitasks.SecurityGroupRule{}, + "LoadBalancer": &alitasks.LoadBalancer{}, + "LoadBalancerListener": &alitasks.LoadBalancerListener{}, + "LoadBalancerACL": &alitasks.LoadBalancerACL{}, + "AutoscalingGroup": &alitasks.ScalingGroup{}, + "LaunchConfiguration": &alitasks.LaunchConfiguration{}, + "RAMPolicy": &alitasks.RAMPolicy{}, + "RAMRole": &alitasks.RAMRole{}, + "SSHKey": &alitasks.SSHKey{}, }) if len(sshPublicKeys) == 0 { From 27718c97b90834b1951a018d931ce95163eb594e Mon Sep 17 00:00:00 2001 From: Xiaoyu Zhong Date: Mon, 22 Jun 2020 09:37:16 +0800 Subject: [PATCH 4/4] Run `make gomod` --- go.mod | 1 + go.sum | 5 + upup/pkg/fi/cloudup/alitasks/BUILD.bazel | 6 +- upup/pkg/fi/cloudup/aliup/BUILD.bazel | 3 + .../aliyun/alibaba-cloud-sdk-go/LICENSE | 201 + .../alibaba-cloud-sdk-go/sdk/BUILD.bazel | 24 + .../alibaba-cloud-sdk-go/sdk/api_timeout.go | 249 + .../alibaba-cloud-sdk-go/sdk/auth/BUILD.bazel | 22 + .../sdk/auth/credential.go | 18 + .../sdk/auth/credentials/BUILD.bazel | 16 + .../auth/credentials/access_key_credential.go | 34 + .../credentials/bearer_token_credential.go | 12 + .../sdk/auth/credentials/ecs_ram_role.go | 29 + .../sdk/auth/credentials/provider/BUILD.bazel | 20 + .../sdk/auth/credentials/provider/env.go | 30 + .../provider/instance_credentials.go | 92 + .../provider/profile_credentials.go | 159 + .../sdk/auth/credentials/provider/provider.go | 19 + .../credentials/provider/provider_chain.go | 34 + .../credentials/rsa_key_pair_credential.go | 15 + .../sdk/auth/credentials/sts_credential.go | 15 + .../credentials/sts_role_arn_credential.go | 61 + .../sdk/auth/roa_signature_composer.go | 138 + .../sdk/auth/rpc_signature_composer.go | 94 + .../alibaba-cloud-sdk-go/sdk/auth/signer.go | 98 + .../sdk/auth/signers/BUILD.bazel | 27 + .../sdk/auth/signers/algorithms.go | 57 + .../sdk/auth/signers/credential_updater.go | 54 + .../sdk/auth/signers/session_credential.go | 7 + .../sdk/auth/signers/signer_access_key.go | 54 + .../sdk/auth/signers/signer_bearer_token.go | 35 + .../sdk/auth/signers/signer_ecs_ram_role.go | 167 + .../sdk/auth/signers/signer_key_pair.go | 148 + .../sdk/auth/signers/signer_ram_role_arn.go | 175 + .../sdk/auth/signers/signer_sts_token.go | 54 + .../sdk/auth/signers/signer_v2.go | 54 + .../aliyun/alibaba-cloud-sdk-go/sdk/client.go | 823 ++++ .../aliyun/alibaba-cloud-sdk-go/sdk/config.go | 92 + .../sdk/endpoints/BUILD.bazel | 23 + .../sdk/endpoints/endpoints_config.go | 4126 +++++++++++++++++ .../sdk/endpoints/local_global_resolver.go | 43 + .../sdk/endpoints/local_regional_resolver.go | 48 + .../sdk/endpoints/location_resolver.go | 176 + .../sdk/endpoints/mapping_resolver.go | 49 + .../sdk/endpoints/resolver.go | 96 + .../sdk/errors/BUILD.bazel | 18 + .../sdk/errors/client_error.go | 92 + .../alibaba-cloud-sdk-go/sdk/errors/error.go | 23 + .../sdk/errors/server_error.go | 123 + .../signature_does_not_match_wrapper.go | 45 + .../aliyun/alibaba-cloud-sdk-go/sdk/logger.go | 116 + .../sdk/requests/BUILD.bazel | 19 + .../sdk/requests/acs_request.go | 443 ++ .../sdk/requests/common_request.go | 108 + .../sdk/requests/roa_request.go | 144 + .../sdk/requests/rpc_request.go | 79 + .../sdk/requests/types.go | 53 + .../sdk/responses/BUILD.bazel | 17 + .../sdk/responses/json_parser.go | 333 ++ .../sdk/responses/response.go | 144 + .../sdk/utils/BUILD.bazel | 12 + .../alibaba-cloud-sdk-go/sdk/utils/debug.go | 36 + .../alibaba-cloud-sdk-go/sdk/utils/utils.go | 141 + .../services/slb/BUILD.bazel | 183 + .../slb/add_access_control_list_entry.go | 110 + .../services/slb/add_backend_servers.go | 112 + .../slb/add_listener_white_list_item.go | 112 + .../services/slb/add_tags.go | 109 + .../slb/add_v_server_group_backend_servers.go | 112 + .../services/slb/client.go | 129 + .../slb/create_access_control_list.go | 112 + .../services/slb/create_domain_extension.go | 114 + .../services/slb/create_load_balancer.go | 139 + .../slb/create_load_balancer_http_listener.go | 145 + .../create_load_balancer_https_listener.go | 148 + .../slb/create_load_balancer_tcp_listener.go | 142 + .../slb/create_load_balancer_udp_listener.go | 138 + .../slb/create_master_slave_server_group.go | 113 + .../services/slb/create_rules.go | 113 + .../services/slb/create_v_server_group.go | 113 + .../slb/delete_access_control_list.go | 109 + .../services/slb/delete_ca_certificate.go | 108 + .../services/slb/delete_domain_extension.go | 109 + .../services/slb/delete_load_balancer.go | 109 + .../slb/delete_load_balancer_listener.go | 111 + .../slb/delete_master_slave_server_group.go | 109 + .../services/slb/delete_rules.go | 109 + .../services/slb/delete_server_certificate.go | 109 + .../services/slb/delete_v_server_group.go | 109 + .../describe_access_control_list_attribute.go | 116 + .../slb/describe_access_control_lists.go | 125 + .../slb/describe_available_resource.go | 110 + .../services/slb/describe_ca_certificates.go | 117 + .../describe_domain_extension_attribute.go | 114 + .../slb/describe_domain_extensions.go | 112 + .../services/slb/describe_health_status.go | 112 + ...cribe_listener_access_control_attribute.go | 113 + .../slb/describe_load_balancer_attribute.go | 154 + ...e_load_balancer_http_listener_attribute.go | 150 + ..._load_balancer_https_listener_attribute.go | 154 + ...be_load_balancer_tcp_listener_attribute.go | 141 + ...be_load_balancer_udp_listener_attribute.go | 136 + .../services/slb/describe_load_balancers.go | 139 + ...ibe_master_slave_server_group_attribute.go | 113 + .../describe_master_slave_server_groups.go | 111 + .../services/slb/describe_regions.go | 110 + .../services/slb/describe_rule_attribute.go | 131 + .../services/slb/describe_rules.go | 112 + .../slb/describe_server_certificates.go | 118 + .../services/slb/describe_tags.go | 116 + .../slb/describe_v_server_group_attribute.go | 113 + .../services/slb/describe_v_server_groups.go | 112 + .../services/slb/describe_zones.go | 109 + .../services/slb/endpoint.go | 63 + .../services/slb/list_tag_resources.go | 119 + .../slb/modify_load_balancer_instance_spec.go | 112 + .../slb/modify_load_balancer_internet_spec.go | 114 + .../slb/modify_load_balancer_pay_type.go | 114 + .../modify_v_server_group_backend_servers.go | 113 + .../slb/remove_access_control_list_entry.go | 110 + .../services/slb/remove_backend_servers.go | 112 + .../slb/remove_listener_white_list_item.go | 112 + .../services/slb/remove_tags.go | 109 + .../remove_v_server_group_backend_servers.go | 112 + .../slb/set_access_control_list_attribute.go | 111 + .../services/slb/set_backend_servers.go | 112 + .../services/slb/set_ca_certificate_name.go | 109 + .../slb/set_domain_extension_attribute.go | 110 + .../slb/set_listener_access_control_status.go | 112 + .../set_load_balancer_delete_protection.go | 110 + ...t_load_balancer_http_listener_attribute.go | 142 + ..._load_balancer_https_listener_attribute.go | 147 + .../services/slb/set_load_balancer_name.go | 110 + .../services/slb/set_load_balancer_status.go | 110 + ...et_load_balancer_tcp_listener_attribute.go | 144 + ...et_load_balancer_udp_listener_attribute.go | 139 + .../services/slb/set_rule.go | 126 + .../slb/set_server_certificate_name.go | 110 + .../slb/set_v_server_group_attribute.go | 114 + .../slb/start_load_balancer_listener.go | 111 + .../slb/stop_load_balancer_listener.go | 111 + .../services/slb/struct_acl.go | 25 + .../services/slb/struct_acl_entry.go | 22 + .../services/slb/struct_acl_entrys.go | 21 + ...e_load_balancer_http_listener_attribute.go | 21 + ..._load_balancer_https_listener_attribute.go | 21 + ...be_load_balancer_tcp_listener_attribute.go | 21 + ...be_load_balancer_udp_listener_attribute.go | 21 + .../services/slb/struct_acls.go | 21 + .../services/slb/struct_associated_objects.go | 22 + .../services/slb/struct_available_resource.go | 23 + .../slb/struct_available_resources.go | 21 + .../services/slb/struct_backend_server.go | 31 + ...r_in_add_v_server_group_backend_servers.go | 29 + ...backend_server_in_create_v_server_group.go | 29 + ...ver_in_describe_load_balancer_attribute.go | 26 + ...er_in_describe_v_server_group_attribute.go | 29 + ...n_modify_v_server_group_backend_servers.go | 29 + ...ackend_server_in_remove_backend_servers.go | 26 + ...n_remove_v_server_group_backend_servers.go | 29 + ..._server_in_set_v_server_group_attribute.go | 29 + ..._backend_servers_in_add_backend_servers.go | 21 + ...s_in_add_v_server_group_backend_servers.go | 21 + ...ackend_servers_in_create_v_server_group.go | 21 + ...ckend_servers_in_describe_health_status.go | 21 + ...ers_in_describe_load_balancer_attribute.go | 21 + ...rs_in_describe_v_server_group_attribute.go | 21 + ...n_modify_v_server_group_backend_servers.go | 21 + ...ckend_servers_in_remove_backend_servers.go | 21 + ...n_remove_v_server_group_backend_servers.go | 21 + ..._backend_servers_in_set_backend_servers.go | 21 + ...servers_in_set_v_server_group_attribute.go | 21 + .../services/slb/struct_ca_certificate.go | 31 + .../services/slb/struct_ca_certificates.go | 21 + .../services/slb/struct_domain_extension.go | 23 + ...xtensions_in_describe_domain_extensions.go | 21 + ..._load_balancer_https_listener_attribute.go | 21 + .../services/slb/struct_listener.go | 22 + .../slb/struct_listener_port_and_protocal.go | 22 + .../slb/struct_listener_port_and_protocol.go | 25 + .../services/slb/struct_listener_ports.go | 21 + .../slb/struct_listener_ports_and_protocal.go | 21 + .../slb/struct_listener_ports_and_protocol.go | 21 + ..._in_describe_master_slave_server_groups.go | 21 + ...t_listeners_in_describe_v_server_groups.go | 21 + .../services/slb/struct_load_balancer.go | 39 + .../services/slb/struct_load_balancers.go | 21 + .../slb/struct_master_slave_backend_server.go | 28 + ...ers_in_create_master_slave_server_group.go | 21 + ...ibe_master_slave_server_group_attribute.go | 21 + .../slb/struct_master_slave_server_group.go | 23 + .../slb/struct_master_slave_server_groups.go | 21 + .../services/slb/struct_port_range.go | 22 + ...be_load_balancer_tcp_listener_attribute.go | 21 + ...be_load_balancer_udp_listener_attribute.go | 21 + .../services/slb/struct_region.go | 23 + .../services/slb/struct_regions.go | 21 + .../services/slb/struct_related_listener.go | 24 + .../services/slb/struct_related_listeners.go | 21 + .../services/slb/struct_rule.go | 40 + .../slb/struct_rules_in_create_rules.go | 21 + ...e_load_balancer_http_listener_attribute.go | 21 + ..._load_balancer_https_listener_attribute.go | 21 + .../slb/struct_rules_in_describe_rules.go | 21 + ...truct_rules_in_describe_v_server_groups.go | 21 + .../services/slb/struct_server_certificate.go | 36 + .../slb/struct_server_certificates.go | 21 + .../services/slb/struct_slave_zone.go | 22 + .../services/slb/struct_slave_zones.go | 21 + ...e_names_in_describe_server_certificates.go | 21 + ...tive_names_in_upload_server_certificate.go | 21 + .../services/slb/struct_support_resource.go | 22 + .../services/slb/struct_support_resources.go | 21 + .../services/slb/struct_tag.go | 22 + .../services/slb/struct_tag_resource.go | 24 + .../services/slb/struct_tag_resources.go | 21 + .../services/slb/struct_tag_set.go | 23 + .../services/slb/struct_tag_sets.go | 21 + ...t_tags_in_describe_access_control_lists.go | 21 + ...struct_tags_in_describe_ca_certificates.go | 21 + .../struct_tags_in_describe_load_balancers.go | 21 + ...ct_tags_in_describe_server_certificates.go | 21 + .../services/slb/struct_v_server_group.go | 23 + .../services/slb/struct_v_server_groups.go | 21 + .../services/slb/struct_zone.go | 23 + .../services/slb/struct_zones.go | 21 + .../services/slb/tag_resources.go | 116 + .../services/slb/untag_resources.go | 111 + .../services/slb/upload_ca_certificate.go | 119 + .../services/slb/upload_server_certificate.go | 130 + vendor/gopkg.in/ini.v1/.gitignore | 6 + vendor/gopkg.in/ini.v1/.travis.yml | 20 + vendor/gopkg.in/ini.v1/BUILD.bazel | 20 + vendor/gopkg.in/ini.v1/LICENSE | 191 + vendor/gopkg.in/ini.v1/Makefile | 15 + vendor/gopkg.in/ini.v1/README.md | 39 + vendor/gopkg.in/ini.v1/data_source.go | 74 + vendor/gopkg.in/ini.v1/deprecated.go | 25 + vendor/gopkg.in/ini.v1/error.go | 34 + vendor/gopkg.in/ini.v1/file.go | 418 ++ vendor/gopkg.in/ini.v1/helper.go | 24 + vendor/gopkg.in/ini.v1/ini.go | 166 + vendor/gopkg.in/ini.v1/key.go | 801 ++++ vendor/gopkg.in/ini.v1/parser.go | 526 +++ vendor/gopkg.in/ini.v1/section.go | 256 + vendor/gopkg.in/ini.v1/struct.go | 603 +++ vendor/modules.txt | 14 + 247 files changed, 24595 insertions(+), 2 deletions(-) create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/LICENSE create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/BUILD.bazel create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/api_timeout.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/BUILD.bazel create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credential.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/BUILD.bazel create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/access_key_credential.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/bearer_token_credential.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/ecs_ram_role.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/provider/BUILD.bazel create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/provider/env.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/provider/instance_credentials.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/provider/profile_credentials.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/provider/provider.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/provider/provider_chain.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/rsa_key_pair_credential.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/sts_credential.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/sts_role_arn_credential.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/roa_signature_composer.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/rpc_signature_composer.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signer.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers/BUILD.bazel create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers/algorithms.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers/credential_updater.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers/session_credential.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers/signer_access_key.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers/signer_bearer_token.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers/signer_ecs_ram_role.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers/signer_key_pair.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers/signer_ram_role_arn.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers/signer_sts_token.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers/signer_v2.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/client.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/config.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/endpoints/BUILD.bazel create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/endpoints/endpoints_config.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/endpoints/local_global_resolver.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/endpoints/local_regional_resolver.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/endpoints/location_resolver.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/endpoints/mapping_resolver.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/endpoints/resolver.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/errors/BUILD.bazel create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/errors/client_error.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/errors/error.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/errors/server_error.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/errors/signature_does_not_match_wrapper.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/logger.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests/BUILD.bazel create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests/acs_request.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests/common_request.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests/roa_request.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests/rpc_request.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests/types.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses/BUILD.bazel create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses/json_parser.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses/response.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/utils/BUILD.bazel create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/utils/debug.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/utils/utils.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/BUILD.bazel create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/add_access_control_list_entry.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/add_backend_servers.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/add_listener_white_list_item.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/add_tags.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/add_v_server_group_backend_servers.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/client.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/create_access_control_list.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/create_domain_extension.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/create_load_balancer.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/create_load_balancer_http_listener.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/create_load_balancer_https_listener.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/create_load_balancer_tcp_listener.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/create_load_balancer_udp_listener.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/create_master_slave_server_group.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/create_rules.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/create_v_server_group.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/delete_access_control_list.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/delete_ca_certificate.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/delete_domain_extension.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/delete_load_balancer.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/delete_load_balancer_listener.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/delete_master_slave_server_group.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/delete_rules.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/delete_server_certificate.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/delete_v_server_group.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/describe_access_control_list_attribute.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/describe_access_control_lists.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/describe_available_resource.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/describe_ca_certificates.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/describe_domain_extension_attribute.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/describe_domain_extensions.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/describe_health_status.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/describe_listener_access_control_attribute.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/describe_load_balancer_attribute.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/describe_load_balancer_http_listener_attribute.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/describe_load_balancer_https_listener_attribute.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/describe_load_balancer_tcp_listener_attribute.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/describe_load_balancer_udp_listener_attribute.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/describe_load_balancers.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/describe_master_slave_server_group_attribute.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/describe_master_slave_server_groups.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/describe_regions.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/describe_rule_attribute.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/describe_rules.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/describe_server_certificates.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/describe_tags.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/describe_v_server_group_attribute.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/describe_v_server_groups.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/describe_zones.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/endpoint.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/list_tag_resources.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/modify_load_balancer_instance_spec.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/modify_load_balancer_internet_spec.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/modify_load_balancer_pay_type.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/modify_v_server_group_backend_servers.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/remove_access_control_list_entry.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/remove_backend_servers.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/remove_listener_white_list_item.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/remove_tags.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/remove_v_server_group_backend_servers.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/set_access_control_list_attribute.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/set_backend_servers.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/set_ca_certificate_name.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/set_domain_extension_attribute.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/set_listener_access_control_status.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/set_load_balancer_delete_protection.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/set_load_balancer_http_listener_attribute.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/set_load_balancer_https_listener_attribute.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/set_load_balancer_name.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/set_load_balancer_status.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/set_load_balancer_tcp_listener_attribute.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/set_load_balancer_udp_listener_attribute.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/set_rule.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/set_server_certificate_name.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/set_v_server_group_attribute.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/start_load_balancer_listener.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/stop_load_balancer_listener.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_acl.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_acl_entry.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_acl_entrys.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_acl_ids_in_describe_load_balancer_http_listener_attribute.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_acl_ids_in_describe_load_balancer_https_listener_attribute.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_acl_ids_in_describe_load_balancer_tcp_listener_attribute.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_acl_ids_in_describe_load_balancer_udp_listener_attribute.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_acls.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_associated_objects.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_available_resource.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_available_resources.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_backend_server.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_backend_server_in_add_v_server_group_backend_servers.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_backend_server_in_create_v_server_group.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_backend_server_in_describe_load_balancer_attribute.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_backend_server_in_describe_v_server_group_attribute.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_backend_server_in_modify_v_server_group_backend_servers.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_backend_server_in_remove_backend_servers.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_backend_server_in_remove_v_server_group_backend_servers.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_backend_server_in_set_v_server_group_attribute.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_backend_servers_in_add_backend_servers.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_backend_servers_in_add_v_server_group_backend_servers.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_backend_servers_in_create_v_server_group.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_backend_servers_in_describe_health_status.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_backend_servers_in_describe_load_balancer_attribute.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_backend_servers_in_describe_v_server_group_attribute.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_backend_servers_in_modify_v_server_group_backend_servers.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_backend_servers_in_remove_backend_servers.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_backend_servers_in_remove_v_server_group_backend_servers.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_backend_servers_in_set_backend_servers.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_backend_servers_in_set_v_server_group_attribute.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_ca_certificate.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_ca_certificates.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_domain_extension.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_domain_extensions_in_describe_domain_extensions.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_domain_extensions_in_describe_load_balancer_https_listener_attribute.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_listener.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_listener_port_and_protocal.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_listener_port_and_protocol.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_listener_ports.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_listener_ports_and_protocal.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_listener_ports_and_protocol.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_listeners_in_describe_master_slave_server_groups.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_listeners_in_describe_v_server_groups.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_load_balancer.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_load_balancers.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_master_slave_backend_server.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_master_slave_backend_servers_in_create_master_slave_server_group.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_master_slave_backend_servers_in_describe_master_slave_server_group_attribute.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_master_slave_server_group.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_master_slave_server_groups.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_port_range.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_port_ranges_in_describe_load_balancer_tcp_listener_attribute.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_port_ranges_in_describe_load_balancer_udp_listener_attribute.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_region.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_regions.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_related_listener.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_related_listeners.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_rule.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_rules_in_create_rules.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_rules_in_describe_load_balancer_http_listener_attribute.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_rules_in_describe_load_balancer_https_listener_attribute.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_rules_in_describe_rules.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_rules_in_describe_v_server_groups.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_server_certificate.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_server_certificates.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_slave_zone.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_slave_zones.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_subject_alternative_names_in_describe_server_certificates.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_subject_alternative_names_in_upload_server_certificate.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_support_resource.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_support_resources.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_tag.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_tag_resource.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_tag_resources.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_tag_set.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_tag_sets.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_tags_in_describe_access_control_lists.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_tags_in_describe_ca_certificates.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_tags_in_describe_load_balancers.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_tags_in_describe_server_certificates.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_v_server_group.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_v_server_groups.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_zone.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_zones.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/tag_resources.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/untag_resources.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/upload_ca_certificate.go create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/upload_server_certificate.go create mode 100644 vendor/gopkg.in/ini.v1/.gitignore create mode 100644 vendor/gopkg.in/ini.v1/.travis.yml create mode 100644 vendor/gopkg.in/ini.v1/BUILD.bazel create mode 100644 vendor/gopkg.in/ini.v1/LICENSE create mode 100644 vendor/gopkg.in/ini.v1/Makefile create mode 100644 vendor/gopkg.in/ini.v1/README.md create mode 100644 vendor/gopkg.in/ini.v1/data_source.go create mode 100644 vendor/gopkg.in/ini.v1/deprecated.go create mode 100644 vendor/gopkg.in/ini.v1/error.go create mode 100644 vendor/gopkg.in/ini.v1/file.go create mode 100644 vendor/gopkg.in/ini.v1/helper.go create mode 100644 vendor/gopkg.in/ini.v1/ini.go create mode 100644 vendor/gopkg.in/ini.v1/key.go create mode 100644 vendor/gopkg.in/ini.v1/parser.go create mode 100644 vendor/gopkg.in/ini.v1/section.go create mode 100644 vendor/gopkg.in/ini.v1/struct.go diff --git a/go.mod b/go.mod index a5297ddf3b..19f83c75d0 100644 --- a/go.mod +++ b/go.mod @@ -54,6 +54,7 @@ require ( github.com/Masterminds/semver v1.3.1 // indirect github.com/Masterminds/sprig v2.17.1+incompatible github.com/Microsoft/go-winio v0.4.14 // indirect + github.com/aliyun/alibaba-cloud-sdk-go v1.61.264 github.com/aokoli/goutils v1.0.1 // indirect github.com/aws/aws-sdk-go v1.30.16 github.com/bazelbuild/bazel-gazelle v0.19.1 diff --git a/go.sum b/go.sum index 29de7e54f1..5741251dae 100644 --- a/go.sum +++ b/go.sum @@ -58,6 +58,8 @@ github.com/agext/levenshtein v1.2.1/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki github.com/agnivade/levenshtein v1.0.1/go.mod h1:CURSv5d9Uaml+FovSIICkLbAUZ9S4RqaHDIsdSBg7lM= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= +github.com/aliyun/alibaba-cloud-sdk-go v1.61.264 h1:5o7dIWOmKWEujFfzD3XV8EmpnCbqekpTqdEsBlfNp6c= +github.com/aliyun/alibaba-cloud-sdk-go v1.61.264/go.mod h1:pUKYbK5JQ+1Dfxk80P0qxGqe5dkxDoabbZS7zOcouyA= github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8= github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYUyUczH0OGQWaF5ceTx0UBShxjsH6f8oGKYe2c= github.com/aokoli/goutils v1.0.1 h1:7fpzNGoJ3VA8qcrm++XEE1QUe0mIwNeLa02Nwq7RDkg= @@ -316,6 +318,7 @@ github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d h1:3PaI8p3seN09Vjb github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= github.com/gogo/protobuf v1.3.1 h1:DqDEcV5aeaTmdFBePNpYsp3FlcVH/2ISVVM9Qf8PSls= github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= +github.com/goji/httpauth v0.0.0-20160601135302-2da839ab0f4d/go.mod h1:nnjvkQ9ptGaCkuDUx6wNykzzlUixGxvkme+H/lnzb+A= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903 h1:LbsanbbD6LieFkXbj9YNNBupiGHJgFeLpO0j0Fza1h8= @@ -492,6 +495,7 @@ github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22 github.com/jpillora/backoff v0.0.0-20170918002102-8eab2debe79d h1:ix3WmphUvN0GDd0DO9MH0v6/5xTv+Xm1bPN+1UJn58k= github.com/jpillora/backoff v0.0.0-20170918002102-8eab2debe79d/go.mod h1:2iMrUgbbvHEiQClaW2NsSzMyGHqN+rDFqY705q49KG0= github.com/json-iterator/go v0.0.0-20180612202835-f2b4162afba3/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= +github.com/json-iterator/go v1.1.5/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.7 h1:KfgG9LzI+pYjr4xvmz/5H4FXjokeP+rlHLhv3iH62Fo= github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= @@ -1058,6 +1062,7 @@ gopkg.in/gcfg.v1 v1.2.3/go.mod h1:yesOnuUOFQAhST5vPY4nbZsb/huCgGGXlipJsBn0b3o= gopkg.in/gemnasium/logrus-airbrake-hook.v2 v2.1.2/go.mod h1:Xk6kEKp8OKb+X14hQBKWaSkCsqBpgog8nAV2xsGOxlo= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= +gopkg.in/ini.v1 v1.42.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/ini.v1 v1.51.0 h1:AQvPpx3LzTDM0AjnIRlVFwFFGC+npRopjZxLJj6gdno= gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/mcuadros/go-syslog.v2 v2.2.1/go.mod h1:l5LPIyOOyIdQquNg+oU6Z3524YwrcqEm0aKH+5zpt2U= diff --git a/upup/pkg/fi/cloudup/alitasks/BUILD.bazel b/upup/pkg/fi/cloudup/alitasks/BUILD.bazel index 149bc608e2..ca21850b26 100644 --- a/upup/pkg/fi/cloudup/alitasks/BUILD.bazel +++ b/upup/pkg/fi/cloudup/alitasks/BUILD.bazel @@ -11,10 +11,10 @@ go_library( "launchconfiguration_fitask.go", "loadbalancer.go", "loadbalancer_fitask.go", + "loadbalanceracl.go", + "loadbalanceracl_fitask.go", "loadbalancerlistener.go", "loadbalancerlistener_fitask.go", - "loadbalancerwhitelist.go", - "loadbalancerwhitelist_fitask.go", "natgateway.go", "natgateway_fitask.go", "rampolicy.go", @@ -44,6 +44,8 @@ go_library( "//upup/pkg/fi:go_default_library", "//upup/pkg/fi/cloudup/aliup:go_default_library", "//upup/pkg/fi/cloudup/terraform:go_default_library", + "//vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests:go_default_library", + "//vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb:go_default_library", "//vendor/github.com/denverdino/aliyungo/common:go_default_library", "//vendor/github.com/denverdino/aliyungo/ecs:go_default_library", "//vendor/github.com/denverdino/aliyungo/ess:go_default_library", diff --git a/upup/pkg/fi/cloudup/aliup/BUILD.bazel b/upup/pkg/fi/cloudup/aliup/BUILD.bazel index e83bc9f22a..09542f75fa 100644 --- a/upup/pkg/fi/cloudup/aliup/BUILD.bazel +++ b/upup/pkg/fi/cloudup/aliup/BUILD.bazel @@ -17,6 +17,9 @@ go_library( "//pkg/cloudinstances:go_default_library", "//protokube/pkg/etcd:go_default_library", "//upup/pkg/fi:go_default_library", + "//vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk:go_default_library", + "//vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials:go_default_library", + "//vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb:go_default_library", "//vendor/github.com/denverdino/aliyungo/common:go_default_library", "//vendor/github.com/denverdino/aliyungo/ecs:go_default_library", "//vendor/github.com/denverdino/aliyungo/ess:go_default_library", diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/LICENSE b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/LICENSE new file mode 100644 index 0000000000..0c44dcefe3 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright (c) 2009-present, Alibaba Cloud All rights reserved. + + 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. diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/BUILD.bazel b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/BUILD.bazel new file mode 100644 index 0000000000..a865b160c7 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/BUILD.bazel @@ -0,0 +1,24 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "go_default_library", + srcs = [ + "api_timeout.go", + "client.go", + "config.go", + "logger.go", + ], + importmap = "k8s.io/kops/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk", + importpath = "github.com/aliyun/alibaba-cloud-sdk-go/sdk", + visibility = ["//visibility:public"], + deps = [ + "//vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth:go_default_library", + "//vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials:go_default_library", + "//vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/provider:go_default_library", + "//vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/endpoints:go_default_library", + "//vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/errors:go_default_library", + "//vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests:go_default_library", + "//vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses:go_default_library", + "//vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/utils:go_default_library", + ], +) diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/api_timeout.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/api_timeout.go new file mode 100644 index 0000000000..d7968dab70 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/api_timeout.go @@ -0,0 +1,249 @@ +package sdk + +import ( + "encoding/json" + "strings" + "time" +) + +var apiTimeouts = `{ + "ecs": { + "ActivateRouterInterface": 10, + "AddTags": 61, + "AllocateDedicatedHosts": 10, + "AllocateEipAddress": 17, + "AllocatePublicIpAddress": 36, + "ApplyAutoSnapshotPolicy": 10, + "AssignIpv6Addresses": 10, + "AssignPrivateIpAddresses": 10, + "AssociateEipAddress": 17, + "AttachClassicLinkVpc": 14, + "AttachDisk": 36, + "AttachInstanceRamRole": 11, + "AttachKeyPair": 16, + "AttachNetworkInterface": 16, + "AuthorizeSecurityGroupEgress": 16, + "AuthorizeSecurityGroup": 16, + "CancelAutoSnapshotPolicy": 10, + "CancelCopyImage": 10, + "CancelPhysicalConnection": 10, + "CancelSimulatedSystemEvents": 10, + "CancelTask": 10, + "ConnectRouterInterface": 10, + "ConvertNatPublicIpToEip": 12, + "CopyImage": 10, + "CreateAutoSnapshotPolicy": 10, + "CreateCommand": 16, + "CreateDeploymentSet": 16, + "CreateDisk": 36, + "CreateHpcCluster": 10, + "CreateImage": 36, + "CreateInstance": 86, + "CreateKeyPair": 10, + "CreateLaunchTemplate": 10, + "CreateLaunchTemplateVersion": 10, + "CreateNatGateway": 36, + "CreateNetworkInterfacePermission": 13, + "CreateNetworkInterface": 16, + "CreatePhysicalConnection": 10, + "CreateRouteEntry": 17, + "CreateRouterInterface": 10, + "CreateSecurityGroup": 86, + "CreateSimulatedSystemEvents": 10, + "CreateSnapshot": 86, + "CreateVirtualBorderRouter": 10, + "CreateVpc": 16, + "CreateVSwitch": 17, + "DeactivateRouterInterface": 10, + "DeleteAutoSnapshotPolicy": 10, + "DeleteBandwidthPackage": 10, + "DeleteCommand": 16, + "DeleteDeploymentSet": 12, + "DeleteDisk": 16, + "DeleteHpcCluster": 10, + "DeleteImage": 36, + "DeleteInstance": 66, + "DeleteKeyPairs": 10, + "DeleteLaunchTemplate": 10, + "DeleteLaunchTemplateVersion": 10, + "DeleteNatGateway": 10, + "DeleteNetworkInterfacePermission": 10, + "DeleteNetworkInterface": 16, + "DeletePhysicalConnection": 10, + "DeleteRouteEntry": 16, + "DeleteRouterInterface": 10, + "DeleteSecurityGroup": 87, + "DeleteSnapshot": 17, + "DeleteVirtualBorderRouter": 10, + "DeleteVpc": 17, + "DeleteVSwitch": 17, + "DescribeAccessPoints": 10, + "DescribeAccountAttributes": 10, + "DescribeAutoSnapshotPolicyEx": 16, + "DescribeAvailableResource": 10, + "DescribeBandwidthLimitation": 16, + "DescribeBandwidthPackages": 10, + "DescribeClassicLinkInstances": 15, + "DescribeCloudAssistantStatus": 16, + "DescribeClusters": 10, + "DescribeCommands": 16, + "DescribeDedicatedHosts": 10, + "DescribeDedicatedHostTypes": 10, + "DescribeDeploymentSets": 26, + "DescribeDiskMonitorData": 16, + "DescribeDisksFullStatus": 14, + "DescribeDisks": 19, + "DescribeEipAddresses": 16, + "DescribeEipMonitorData": 16, + "DescribeEniMonitorData": 10, + "DescribeHaVips": 10, + "DescribeHpcClusters": 16, + "DescribeImageSharePermission": 10, + "DescribeImages": 38, + "DescribeImageSupportInstanceTypes": 16, + "DescribeInstanceAttribute": 36, + "DescribeInstanceAutoRenewAttribute": 17, + "DescribeInstanceHistoryEvents": 19, + "DescribeInstanceMonitorData": 19, + "DescribeInstancePhysicalAttribute": 10, + "DescribeInstanceRamRole": 11, + "DescribeInstancesFullStatus": 14, + "DescribeInstances": 10, + "DescribeInstanceStatus": 26, + "DescribeInstanceTopology": 12, + "DescribeInstanceTypeFamilies": 17, + "DescribeInstanceTypes": 17, + "DescribeInstanceVncPasswd": 10, + "DescribeInstanceVncUrl": 36, + "DescribeInvocationResults": 16, + "DescribeInvocations": 16, + "DescribeKeyPairs": 12, + "DescribeLaunchTemplates": 16, + "DescribeLaunchTemplateVersions": 16, + "DescribeLimitation": 36, + "DescribeNatGateways": 10, + "DescribeNetworkInterfacePermissions": 13, + "DescribeNetworkInterfaces": 16, + "DescribeNewProjectEipMonitorData": 16, + "DescribePhysicalConnections": 10, + "DescribePrice": 16, + "DescribeRecommendInstanceType": 10, + "DescribeRegions": 19, + "DescribeRenewalPrice": 16, + "DescribeResourceByTags": 10, + "DescribeResourcesModification": 17, + "DescribeRouterInterfaces": 10, + "DescribeRouteTables": 17, + "DescribeSecurityGroupAttribute": 133, + "DescribeSecurityGroupReferences": 16, + "DescribeSecurityGroups": 25, + "DescribeSnapshotLinks": 17, + "DescribeSnapshotMonitorData": 12, + "DescribeSnapshotPackage": 10, + "DescribeSnapshots": 26, + "DescribeSnapshotsUsage": 26, + "DescribeSpotPriceHistory": 22, + "DescribeTags": 17, + "DescribeTaskAttribute": 10, + "DescribeTasks": 11, + "DescribeUserBusinessBehavior": 13, + "DescribeUserData": 10, + "DescribeVirtualBorderRoutersForPhysicalConnection": 10, + "DescribeVirtualBorderRouters": 10, + "DescribeVpcs": 41, + "DescribeVRouters": 17, + "DescribeVSwitches": 17, + "DescribeZones": 103, + "DetachClassicLinkVpc": 14, + "DetachDisk": 17, + "DetachInstanceRamRole": 10, + "DetachKeyPair": 10, + "DetachNetworkInterface": 16, + "EipFillParams": 19, + "EipFillProduct": 13, + "EipNotifyPaid": 10, + "EnablePhysicalConnection": 10, + "ExportImage": 10, + "GetInstanceConsoleOutput": 14, + "GetInstanceScreenshot": 14, + "ImportImage": 29, + "ImportKeyPair": 10, + "InstallCloudAssistant": 10, + "InvokeCommand": 16, + "JoinResourceGroup": 10, + "JoinSecurityGroup": 66, + "LeaveSecurityGroup": 66, + "ModifyAutoSnapshotPolicyEx": 10, + "ModifyBandwidthPackageSpec": 11, + "ModifyCommand": 10, + "ModifyDeploymentSetAttribute": 10, + "ModifyDiskAttribute": 16, + "ModifyDiskChargeType": 13, + "ModifyEipAddressAttribute": 14, + "ModifyImageAttribute": 10, + "ModifyImageSharePermission": 16, + "ModifyInstanceAttribute": 22, + "ModifyInstanceAutoReleaseTime": 15, + "ModifyInstanceAutoRenewAttribute": 16, + "ModifyInstanceChargeType": 22, + "ModifyInstanceDeployment": 10, + "ModifyInstanceNetworkSpec": 36, + "ModifyInstanceSpec": 62, + "ModifyInstanceVncPasswd": 35, + "ModifyInstanceVpcAttribute": 15, + "ModifyLaunchTemplateDefaultVersion": 10, + "ModifyNetworkInterfaceAttribute": 10, + "ModifyPhysicalConnectionAttribute": 10, + "ModifyPrepayInstanceSpec": 13, + "ModifyRouterInterfaceAttribute": 10, + "ModifySecurityGroupAttribute": 10, + "ModifySecurityGroupEgressRule": 10, + "ModifySecurityGroupPolicy": 10, + "ModifySecurityGroupRule": 16, + "ModifySnapshotAttribute": 10, + "ModifyUserBusinessBehavior": 10, + "ModifyVirtualBorderRouterAttribute": 10, + "ModifyVpcAttribute": 10, + "ModifyVRouterAttribute": 10, + "ModifyVSwitchAttribute": 10, + "ReActivateInstances": 10, + "RebootInstance": 27, + "RedeployInstance": 14, + "ReInitDisk": 16, + "ReleaseDedicatedHost": 10, + "ReleaseEipAddress": 16, + "ReleasePublicIpAddress": 10, + "RemoveTags": 10, + "RenewInstance": 19, + "ReplaceSystemDisk": 36, + "ResetDisk": 36, + "ResizeDisk": 11, + "RevokeSecurityGroupEgress": 13, + "RevokeSecurityGroup": 16, + "RunInstances": 86, + "StartInstance": 46, + "StopInstance": 27, + "StopInvocation": 10, + "TerminatePhysicalConnection": 10, + "TerminateVirtualBorderRouter": 10, + "UnassignIpv6Addresses": 10, + "UnassignPrivateIpAddresses": 10, + "UnassociateEipAddress": 16 + } +} +` + +func getAPIMaxTimeout(product, actionName string) (time.Duration, bool) { + timeout := make(map[string]map[string]int) + err := json.Unmarshal([]byte(apiTimeouts), &timeout) + if err != nil { + return 0 * time.Millisecond, false + } + + obj := timeout[strings.ToLower(product)] + if obj != nil && obj[actionName] != 0 { + return time.Duration(obj[actionName]) * time.Second, true + } + + return 0 * time.Millisecond, false +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/BUILD.bazel b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/BUILD.bazel new file mode 100644 index 0000000000..0fe8bf472d --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/BUILD.bazel @@ -0,0 +1,22 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "go_default_library", + srcs = [ + "credential.go", + "roa_signature_composer.go", + "rpc_signature_composer.go", + "signer.go", + ], + importmap = "k8s.io/kops/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth", + importpath = "github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth", + visibility = ["//visibility:public"], + deps = [ + "//vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials:go_default_library", + "//vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers:go_default_library", + "//vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/errors:go_default_library", + "//vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests:go_default_library", + "//vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses:go_default_library", + "//vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/utils:go_default_library", + ], +) diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credential.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credential.go new file mode 100644 index 0000000000..7f20b7a40c --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credential.go @@ -0,0 +1,18 @@ +/* + * 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. + */ + +package auth + +type Credential interface { +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/BUILD.bazel b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/BUILD.bazel new file mode 100644 index 0000000000..5b64a41d3d --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/BUILD.bazel @@ -0,0 +1,16 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "go_default_library", + srcs = [ + "access_key_credential.go", + "bearer_token_credential.go", + "ecs_ram_role.go", + "rsa_key_pair_credential.go", + "sts_credential.go", + "sts_role_arn_credential.go", + ], + importmap = "k8s.io/kops/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials", + importpath = "github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials", + visibility = ["//visibility:public"], +) diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/access_key_credential.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/access_key_credential.go new file mode 100644 index 0000000000..68f8226330 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/access_key_credential.go @@ -0,0 +1,34 @@ +package credentials + +// Deprecated: Use AccessKeyCredential in this package instead. +type BaseCredential struct { + AccessKeyId string + AccessKeySecret string +} + +type AccessKeyCredential struct { + AccessKeyId string + AccessKeySecret string +} + +// Deprecated: Use NewAccessKeyCredential in this package instead. +func NewBaseCredential(accessKeyId, accessKeySecret string) *BaseCredential { + return &BaseCredential{ + AccessKeyId: accessKeyId, + AccessKeySecret: accessKeySecret, + } +} + +func (baseCred *BaseCredential) ToAccessKeyCredential() *AccessKeyCredential { + return &AccessKeyCredential{ + AccessKeyId: baseCred.AccessKeyId, + AccessKeySecret: baseCred.AccessKeySecret, + } +} + +func NewAccessKeyCredential(accessKeyId, accessKeySecret string) *AccessKeyCredential { + return &AccessKeyCredential{ + AccessKeyId: accessKeyId, + AccessKeySecret: accessKeySecret, + } +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/bearer_token_credential.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/bearer_token_credential.go new file mode 100644 index 0000000000..6d4763e663 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/bearer_token_credential.go @@ -0,0 +1,12 @@ +package credentials + +type BearerTokenCredential struct { + BearerToken string +} + +// NewBearerTokenCredential return a BearerTokenCredential object +func NewBearerTokenCredential(token string) *BearerTokenCredential { + return &BearerTokenCredential{ + BearerToken: token, + } +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/ecs_ram_role.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/ecs_ram_role.go new file mode 100644 index 0000000000..55a5c2da03 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/ecs_ram_role.go @@ -0,0 +1,29 @@ +package credentials + +func (oldCred *StsRoleNameOnEcsCredential) ToEcsRamRoleCredential() *EcsRamRoleCredential { + return &EcsRamRoleCredential{ + RoleName: oldCred.RoleName, + } +} + +type EcsRamRoleCredential struct { + RoleName string +} + +func NewEcsRamRoleCredential(roleName string) *EcsRamRoleCredential { + return &EcsRamRoleCredential{ + RoleName: roleName, + } +} + +// Deprecated: Use EcsRamRoleCredential in this package instead. +type StsRoleNameOnEcsCredential struct { + RoleName string +} + +// Deprecated: Use NewEcsRamRoleCredential in this package instead. +func NewStsRoleNameOnEcsCredential(roleName string) *StsRoleNameOnEcsCredential { + return &StsRoleNameOnEcsCredential{ + RoleName: roleName, + } +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/provider/BUILD.bazel b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/provider/BUILD.bazel new file mode 100644 index 0000000000..2426a4e68d --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/provider/BUILD.bazel @@ -0,0 +1,20 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "go_default_library", + srcs = [ + "env.go", + "instance_credentials.go", + "profile_credentials.go", + "provider.go", + "provider_chain.go", + ], + importmap = "k8s.io/kops/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/provider", + importpath = "github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/provider", + visibility = ["//visibility:public"], + deps = [ + "//vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth:go_default_library", + "//vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials:go_default_library", + "//vendor/gopkg.in/ini.v1:go_default_library", + ], +) diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/provider/env.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/provider/env.go new file mode 100644 index 0000000000..3cd0d020a7 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/provider/env.go @@ -0,0 +1,30 @@ +package provider + +import ( + "errors" + "os" + + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials" + + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth" +) + +type EnvProvider struct{} + +var ProviderEnv = new(EnvProvider) + +func NewEnvProvider() Provider { + return &EnvProvider{} +} + +func (p *EnvProvider) Resolve() (auth.Credential, error) { + accessKeyID, ok1 := os.LookupEnv(ENVAccessKeyID) + accessKeySecret, ok2 := os.LookupEnv(ENVAccessKeySecret) + if !ok1 || !ok2 { + return nil, nil + } + if accessKeyID == "" || accessKeySecret == "" { + return nil, errors.New("Environmental variable (ALIBABACLOUD_ACCESS_KEY_ID or ALIBABACLOUD_ACCESS_KEY_SECRET) is empty") + } + return credentials.NewAccessKeyCredential(accessKeyID, accessKeySecret), nil +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/provider/instance_credentials.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/provider/instance_credentials.go new file mode 100644 index 0000000000..074f6350b2 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/provider/instance_credentials.go @@ -0,0 +1,92 @@ +package provider + +import ( + "encoding/json" + "errors" + "fmt" + "io/ioutil" + "net/http" + "os" + "time" + + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials" +) + +var securityCredURL = "http://100.100.100.200/latest/meta-data/ram/security-credentials/" + +type InstanceCredentialsProvider struct{} + +var ProviderInstance = new(InstanceCredentialsProvider) + +var HookGet = func(fn func(string) (int, []byte, error)) func(string) (int, []byte, error) { + return fn +} + +func NewInstanceCredentialsProvider() Provider { + return &InstanceCredentialsProvider{} +} + +func (p *InstanceCredentialsProvider) Resolve() (auth.Credential, error) { + roleName, ok := os.LookupEnv(ENVEcsMetadata) + if !ok { + return nil, nil + } + if roleName == "" { + return nil, errors.New("Environmental variable 'ALIBABA_CLOUD_ECS_METADATA' are empty") + } + status, content, err := HookGet(get)(securityCredURL + roleName) + if err != nil { + return nil, err + } + if status != 200 { + if status == 404 { + return nil, fmt.Errorf("The role was not found in the instance") + } + return nil, fmt.Errorf("Received %d when getting security credentials for %s", status, roleName) + } + body := make(map[string]interface{}) + + if err := json.Unmarshal(content, &body); err != nil { + return nil, err + } + + accessKeyID, err := extractString(body, "AccessKeyId") + if err != nil { + return nil, err + } + accessKeySecret, err := extractString(body, "AccessKeySecret") + if err != nil { + return nil, err + } + securityToken, err := extractString(body, "SecurityToken") + if err != nil { + return nil, err + } + + return credentials.NewStsTokenCredential(accessKeyID, accessKeySecret, securityToken), nil +} + +func get(url string) (status int, content []byte, err error) { + httpClient := http.DefaultClient + httpClient.Timeout = 1 * time.Second + resp, err := httpClient.Get(url) + if err != nil { + return + } + defer resp.Body.Close() + content, err = ioutil.ReadAll(resp.Body) + return resp.StatusCode, content, err +} + +func extractString(m map[string]interface{}, key string) (string, error) { + raw, ok := m[key] + if !ok { + return "", fmt.Errorf("%s not in map", key) + } + str, ok := raw.(string) + if !ok { + return "", fmt.Errorf("%s is not a string in map", key) + } + return str, nil +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/provider/profile_credentials.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/provider/profile_credentials.go new file mode 100644 index 0000000000..146b97945b --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/provider/profile_credentials.go @@ -0,0 +1,159 @@ +package provider + +import ( + "bufio" + "errors" + "os" + "runtime" + "strings" + + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials" + + ini "gopkg.in/ini.v1" +) + +type ProfileProvider struct { + Profile string +} + +var ProviderProfile = NewProfileProvider() + +// NewProfileProvider receive zero or more parameters, +// when length of name is 0, the value of field Profile will be "default", +// and when there are multiple inputs, the function will take the +// first one and discard the other values. +func NewProfileProvider(name ...string) Provider { + p := new(ProfileProvider) + if len(name) == 0 { + p.Profile = "default" + } else { + p.Profile = name[0] + } + return p +} + +// Resolve implements the Provider interface +// when credential type is rsa_key_pair, the content of private_key file +// must be able to be parsed directly into the required string +// that NewRsaKeyPairCredential function needed +func (p *ProfileProvider) Resolve() (auth.Credential, error) { + path, ok := os.LookupEnv(ENVCredentialFile) + if !ok { + var err error + path, err = checkDefaultPath() + if err != nil { + return nil, err + } + if path == "" { + return nil, nil + } + } else if path == "" { + return nil, errors.New("Environment variable '" + ENVCredentialFile + "' cannot be empty") + } + + ini, err := ini.Load(path) + if err != nil { + return nil, errors.New("ERROR: Can not open file" + err.Error()) + } + + section, err := ini.GetSection(p.Profile) + if err != nil { + return nil, errors.New("ERROR: Can not load section" + err.Error()) + } + + value, err := section.GetKey("type") + if err != nil { + return nil, errors.New("ERROR: Can not find credential type" + err.Error()) + } + + switch value.String() { + case "access_key": + value1, err1 := section.GetKey("access_key_id") + value2, err2 := section.GetKey("access_key_secret") + if err1 != nil || err2 != nil { + return nil, errors.New("ERROR: Failed to get value") + } + if value1.String() == "" || value2.String() == "" { + return nil, errors.New("ERROR: Value can't be empty") + } + return credentials.NewAccessKeyCredential(value1.String(), value2.String()), nil + case "ecs_ram_role": + value1, err1 := section.GetKey("role_name") + if err1 != nil { + return nil, errors.New("ERROR: Failed to get value") + } + if value1.String() == "" { + return nil, errors.New("ERROR: Value can't be empty") + } + return credentials.NewEcsRamRoleCredential(value1.String()), nil + case "ram_role_arn": + value1, err1 := section.GetKey("access_key_id") + value2, err2 := section.GetKey("access_key_secret") + value3, err3 := section.GetKey("role_arn") + value4, err4 := section.GetKey("role_session_name") + if err1 != nil || err2 != nil || err3 != nil || err4 != nil { + return nil, errors.New("ERROR: Failed to get value") + } + if value1.String() == "" || value2.String() == "" || value3.String() == "" || value4.String() == "" { + return nil, errors.New("ERROR: Value can't be empty") + } + return credentials.NewRamRoleArnCredential(value1.String(), value2.String(), value3.String(), value4.String(), 3600), nil + case "rsa_key_pair": + value1, err1 := section.GetKey("public_key_id") + value2, err2 := section.GetKey("private_key_file") + if err1 != nil || err2 != nil { + return nil, errors.New("ERROR: Failed to get value") + } + if value1.String() == "" || value2.String() == "" { + return nil, errors.New("ERROR: Value can't be empty") + } + file, err := os.Open(value2.String()) + if err != nil { + return nil, errors.New("ERROR: Can not get private_key") + } + defer file.Close() + var privateKey string + scan := bufio.NewScanner(file) + var data string + for scan.Scan() { + if strings.HasPrefix(scan.Text(), "----") { + continue + } + data += scan.Text() + "\n" + } + return credentials.NewRsaKeyPairCredential(privateKey, value1.String(), 3600), nil + default: + return nil, errors.New("ERROR: Failed to get credential") + } +} + +// GetHomePath return home directory according to the system. +// if the environmental virables does not exist, will return empty +func GetHomePath() string { + if runtime.GOOS == "windows" { + path, ok := os.LookupEnv("USERPROFILE") + if !ok { + return "" + } + return path + } + path, ok := os.LookupEnv("HOME") + if !ok { + return "" + } + return path +} + +func checkDefaultPath() (path string, err error) { + path = GetHomePath() + if path == "" { + return "", errors.New("The default credential file path is invalid") + } + path = strings.Replace("~/.alibabacloud/credentials", "~", path, 1) + _, err = os.Stat(path) + if err != nil { + return "", nil + } + return path, nil +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/provider/provider.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/provider/provider.go new file mode 100644 index 0000000000..ae4e168eb1 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/provider/provider.go @@ -0,0 +1,19 @@ +package provider + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth" +) + +//Environmental virables that may be used by the provider +const ( + ENVAccessKeyID = "ALIBABA_CLOUD_ACCESS_KEY_ID" + ENVAccessKeySecret = "ALIBABA_CLOUD_ACCESS_KEY_SECRET" + ENVCredentialFile = "ALIBABA_CLOUD_CREDENTIALS_FILE" + ENVEcsMetadata = "ALIBABA_CLOUD_ECS_METADATA" + PATHCredentialFile = "~/.alibabacloud/credentials" +) + +// When you want to customize the provider, you only need to implement the method of the interface. +type Provider interface { + Resolve() (auth.Credential, error) +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/provider/provider_chain.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/provider/provider_chain.go new file mode 100644 index 0000000000..3f9315d138 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/provider/provider_chain.go @@ -0,0 +1,34 @@ +package provider + +import ( + "errors" + + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth" +) + +type ProviderChain struct { + Providers []Provider +} + +var defaultproviders = []Provider{ProviderEnv, ProviderProfile, ProviderInstance} +var DefaultChain = NewProviderChain(defaultproviders) + +func NewProviderChain(providers []Provider) Provider { + return &ProviderChain{ + Providers: providers, + } +} + +func (p *ProviderChain) Resolve() (auth.Credential, error) { + for _, provider := range p.Providers { + creds, err := provider.Resolve() + if err != nil { + return nil, err + } else if err == nil && creds == nil { + continue + } + return creds, err + } + return nil, errors.New("No credential found") + +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/rsa_key_pair_credential.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/rsa_key_pair_credential.go new file mode 100644 index 0000000000..00d688eb8d --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/rsa_key_pair_credential.go @@ -0,0 +1,15 @@ +package credentials + +type RsaKeyPairCredential struct { + PrivateKey string + PublicKeyId string + SessionExpiration int +} + +func NewRsaKeyPairCredential(privateKey, publicKeyId string, sessionExpiration int) *RsaKeyPairCredential { + return &RsaKeyPairCredential{ + PrivateKey: privateKey, + PublicKeyId: publicKeyId, + SessionExpiration: sessionExpiration, + } +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/sts_credential.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/sts_credential.go new file mode 100644 index 0000000000..554431ff0b --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/sts_credential.go @@ -0,0 +1,15 @@ +package credentials + +type StsTokenCredential struct { + AccessKeyId string + AccessKeySecret string + AccessKeyStsToken string +} + +func NewStsTokenCredential(accessKeyId, accessKeySecret, accessKeyStsToken string) *StsTokenCredential { + return &StsTokenCredential{ + AccessKeyId: accessKeyId, + AccessKeySecret: accessKeySecret, + AccessKeyStsToken: accessKeyStsToken, + } +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/sts_role_arn_credential.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/sts_role_arn_credential.go new file mode 100644 index 0000000000..27602fd749 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/sts_role_arn_credential.go @@ -0,0 +1,61 @@ +package credentials + +// Deprecated: Use RamRoleArnCredential in this package instead. +type StsRoleArnCredential struct { + AccessKeyId string + AccessKeySecret string + RoleArn string + RoleSessionName string + RoleSessionExpiration int +} + +type RamRoleArnCredential struct { + AccessKeyId string + AccessKeySecret string + RoleArn string + RoleSessionName string + RoleSessionExpiration int + Policy string +} + +// Deprecated: Use RamRoleArnCredential in this package instead. +func NewStsRoleArnCredential(accessKeyId, accessKeySecret, roleArn, roleSessionName string, roleSessionExpiration int) *StsRoleArnCredential { + return &StsRoleArnCredential{ + AccessKeyId: accessKeyId, + AccessKeySecret: accessKeySecret, + RoleArn: roleArn, + RoleSessionName: roleSessionName, + RoleSessionExpiration: roleSessionExpiration, + } +} + +func (oldCred *StsRoleArnCredential) ToRamRoleArnCredential() *RamRoleArnCredential { + return &RamRoleArnCredential{ + AccessKeyId: oldCred.AccessKeyId, + AccessKeySecret: oldCred.AccessKeySecret, + RoleArn: oldCred.RoleArn, + RoleSessionName: oldCred.RoleSessionName, + RoleSessionExpiration: oldCred.RoleSessionExpiration, + } +} + +func NewRamRoleArnCredential(accessKeyId, accessKeySecret, roleArn, roleSessionName string, roleSessionExpiration int) *RamRoleArnCredential { + return &RamRoleArnCredential{ + AccessKeyId: accessKeyId, + AccessKeySecret: accessKeySecret, + RoleArn: roleArn, + RoleSessionName: roleSessionName, + RoleSessionExpiration: roleSessionExpiration, + } +} + +func NewRamRoleArnWithPolicyCredential(accessKeyId, accessKeySecret, roleArn, roleSessionName, policy string, roleSessionExpiration int) *RamRoleArnCredential { + return &RamRoleArnCredential{ + AccessKeyId: accessKeyId, + AccessKeySecret: accessKeySecret, + RoleArn: roleArn, + RoleSessionName: roleSessionName, + RoleSessionExpiration: roleSessionExpiration, + Policy: policy, + } +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/roa_signature_composer.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/roa_signature_composer.go new file mode 100644 index 0000000000..2a962617f3 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/roa_signature_composer.go @@ -0,0 +1,138 @@ +/* + * 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. + */ + +package auth + +import ( + "bytes" + "sort" + "strings" + + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/utils" +) + +var debug utils.Debug + +var hookGetDate = func(fn func() string) string { + return fn() +} + +func init() { + debug = utils.Init("sdk") +} + +func signRoaRequest(request requests.AcsRequest, signer Signer, regionId string) (err error) { + completeROASignParams(request, signer, regionId) + stringToSign := buildRoaStringToSign(request) + request.SetStringToSign(stringToSign) + accessKeyId, err := signer.GetAccessKeyId() + if err != nil { + return err + } + + signature := signer.Sign(stringToSign, "") + request.GetHeaders()["Authorization"] = "acs " + accessKeyId + ":" + signature + + return +} + +func completeROASignParams(request requests.AcsRequest, signer Signer, regionId string) { + headerParams := request.GetHeaders() + + // complete query params + queryParams := request.GetQueryParams() + //if _, ok := queryParams["RegionId"]; !ok { + // queryParams["RegionId"] = regionId + //} + if extraParam := signer.GetExtraParam(); extraParam != nil { + for key, value := range extraParam { + if key == "SecurityToken" { + headerParams["x-acs-security-token"] = value + continue + } + if key == "BearerToken" { + headerParams["x-acs-bearer-token"] = value + continue + } + queryParams[key] = value + } + } + + // complete header params + headerParams["Date"] = hookGetDate(utils.GetTimeInFormatRFC2616) + headerParams["x-acs-signature-method"] = signer.GetName() + headerParams["x-acs-signature-version"] = signer.GetVersion() + if request.GetFormParams() != nil && len(request.GetFormParams()) > 0 { + formString := utils.GetUrlFormedMap(request.GetFormParams()) + request.SetContent([]byte(formString)) + if headerParams["Content-Type"] == "" { + headerParams["Content-Type"] = requests.Form + } + } + contentMD5 := utils.GetMD5Base64(request.GetContent()) + headerParams["Content-MD5"] = contentMD5 + if _, contains := headerParams["Content-Type"]; !contains { + headerParams["Content-Type"] = requests.Raw + } + switch format := request.GetAcceptFormat(); format { + case "JSON": + headerParams["Accept"] = requests.Json + case "XML": + headerParams["Accept"] = requests.Xml + default: + headerParams["Accept"] = requests.Raw + } +} + +func buildRoaStringToSign(request requests.AcsRequest) (stringToSign string) { + + headers := request.GetHeaders() + + stringToSignBuilder := bytes.Buffer{} + stringToSignBuilder.WriteString(request.GetMethod()) + stringToSignBuilder.WriteString(requests.HeaderSeparator) + + // append header keys for sign + appendIfContain(headers, &stringToSignBuilder, "Accept", requests.HeaderSeparator) + appendIfContain(headers, &stringToSignBuilder, "Content-MD5", requests.HeaderSeparator) + appendIfContain(headers, &stringToSignBuilder, "Content-Type", requests.HeaderSeparator) + appendIfContain(headers, &stringToSignBuilder, "Date", requests.HeaderSeparator) + + // sort and append headers witch starts with 'x-acs-' + var acsHeaders []string + for key := range headers { + if strings.HasPrefix(key, "x-acs-") { + acsHeaders = append(acsHeaders, key) + } + } + sort.Strings(acsHeaders) + for _, key := range acsHeaders { + stringToSignBuilder.WriteString(key + ":" + headers[key]) + stringToSignBuilder.WriteString(requests.HeaderSeparator) + } + + // append query params + stringToSignBuilder.WriteString(request.BuildQueries()) + stringToSign = stringToSignBuilder.String() + debug("stringToSign: %s", stringToSign) + return +} + +func appendIfContain(sourceMap map[string]string, target *bytes.Buffer, key, separator string) { + if value, contain := sourceMap[key]; contain && len(value) > 0 { + target.WriteString(sourceMap[key]) + target.WriteString(separator) + } +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/rpc_signature_composer.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/rpc_signature_composer.go new file mode 100644 index 0000000000..33967b9efb --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/rpc_signature_composer.go @@ -0,0 +1,94 @@ +/* + * 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. + */ + +package auth + +import ( + "net/url" + "strings" + + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/utils" +) + +var hookGetNonce = func(fn func() string) string { + return fn() +} + +func signRpcRequest(request requests.AcsRequest, signer Signer, regionId string) (err error) { + err = completeRpcSignParams(request, signer, regionId) + if err != nil { + return + } + // remove while retry + if _, containsSign := request.GetQueryParams()["Signature"]; containsSign { + delete(request.GetQueryParams(), "Signature") + } + stringToSign := buildRpcStringToSign(request) + request.SetStringToSign(stringToSign) + signature := signer.Sign(stringToSign, "&") + request.GetQueryParams()["Signature"] = signature + + return +} + +func completeRpcSignParams(request requests.AcsRequest, signer Signer, regionId string) (err error) { + queryParams := request.GetQueryParams() + queryParams["Version"] = request.GetVersion() + queryParams["Action"] = request.GetActionName() + queryParams["Format"] = request.GetAcceptFormat() + queryParams["Timestamp"] = hookGetDate(utils.GetTimeInFormatISO8601) + queryParams["SignatureMethod"] = signer.GetName() + queryParams["SignatureType"] = signer.GetType() + queryParams["SignatureVersion"] = signer.GetVersion() + queryParams["SignatureNonce"] = hookGetNonce(utils.GetUUID) + queryParams["AccessKeyId"], err = signer.GetAccessKeyId() + + if err != nil { + return + } + + if _, contains := queryParams["RegionId"]; !contains { + queryParams["RegionId"] = regionId + } + if extraParam := signer.GetExtraParam(); extraParam != nil { + for key, value := range extraParam { + queryParams[key] = value + } + } + + request.GetHeaders()["Content-Type"] = requests.Form + formString := utils.GetUrlFormedMap(request.GetFormParams()) + request.SetContent([]byte(formString)) + + return +} + +func buildRpcStringToSign(request requests.AcsRequest) (stringToSign string) { + signParams := make(map[string]string) + for key, value := range request.GetQueryParams() { + signParams[key] = value + } + for key, value := range request.GetFormParams() { + signParams[key] = value + } + + stringToSign = utils.GetUrlFormedMap(signParams) + stringToSign = strings.Replace(stringToSign, "+", "%20", -1) + stringToSign = strings.Replace(stringToSign, "*", "%2A", -1) + stringToSign = strings.Replace(stringToSign, "%7E", "~", -1) + stringToSign = url.QueryEscape(stringToSign) + stringToSign = request.GetMethod() + "&%2F&" + stringToSign + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signer.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signer.go new file mode 100644 index 0000000000..cbbc3cef7d --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signer.go @@ -0,0 +1,98 @@ +/* + * 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. + */ + +package auth + +import ( + "fmt" + "reflect" + + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/errors" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +type Signer interface { + GetName() string + GetType() string + GetVersion() string + GetAccessKeyId() (string, error) + GetExtraParam() map[string]string + Sign(stringToSign, secretSuffix string) string +} + +func NewSignerWithCredential(credential Credential, commonApi func(request *requests.CommonRequest, signer interface{}) (response *responses.CommonResponse, err error)) (signer Signer, err error) { + switch instance := credential.(type) { + case *credentials.AccessKeyCredential: + { + signer = signers.NewAccessKeySigner(instance) + } + case *credentials.StsTokenCredential: + { + signer = signers.NewStsTokenSigner(instance) + } + case *credentials.BearerTokenCredential: + { + signer = signers.NewBearerTokenSigner(instance) + } + case *credentials.RamRoleArnCredential: + { + signer, err = signers.NewRamRoleArnSigner(instance, commonApi) + } + case *credentials.RsaKeyPairCredential: + { + signer, err = signers.NewSignerKeyPair(instance, commonApi) + } + case *credentials.EcsRamRoleCredential: + { + signer = signers.NewEcsRamRoleSigner(instance, commonApi) + } + case *credentials.BaseCredential: // deprecated user interface + { + signer = signers.NewAccessKeySigner(instance.ToAccessKeyCredential()) + } + case *credentials.StsRoleArnCredential: // deprecated user interface + { + signer, err = signers.NewRamRoleArnSigner(instance.ToRamRoleArnCredential(), commonApi) + } + case *credentials.StsRoleNameOnEcsCredential: // deprecated user interface + { + signer = signers.NewEcsRamRoleSigner(instance.ToEcsRamRoleCredential(), commonApi) + } + default: + message := fmt.Sprintf(errors.UnsupportedCredentialErrorMessage, reflect.TypeOf(credential)) + err = errors.NewClientError(errors.UnsupportedCredentialErrorCode, message, nil) + } + return +} + +func Sign(request requests.AcsRequest, signer Signer, regionId string) (err error) { + switch request.GetStyle() { + case requests.ROA: + { + err = signRoaRequest(request, signer, regionId) + } + case requests.RPC: + { + err = signRpcRequest(request, signer, regionId) + } + default: + message := fmt.Sprintf(errors.UnknownRequestTypeErrorMessage, reflect.TypeOf(request)) + err = errors.NewClientError(errors.UnknownRequestTypeErrorCode, message, nil) + } + + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers/BUILD.bazel b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers/BUILD.bazel new file mode 100644 index 0000000000..a2d151616f --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers/BUILD.bazel @@ -0,0 +1,27 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "go_default_library", + srcs = [ + "algorithms.go", + "credential_updater.go", + "session_credential.go", + "signer_access_key.go", + "signer_bearer_token.go", + "signer_ecs_ram_role.go", + "signer_key_pair.go", + "signer_ram_role_arn.go", + "signer_sts_token.go", + "signer_v2.go", + ], + importmap = "k8s.io/kops/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers", + importpath = "github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers", + visibility = ["//visibility:public"], + deps = [ + "//vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials:go_default_library", + "//vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/errors:go_default_library", + "//vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests:go_default_library", + "//vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses:go_default_library", + "//vendor/github.com/jmespath/go-jmespath:go_default_library", + ], +) diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers/algorithms.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers/algorithms.go new file mode 100644 index 0000000000..887f502094 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers/algorithms.go @@ -0,0 +1,57 @@ +/* + * 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. + */ + +package signers + +import ( + "crypto" + "crypto/hmac" + "crypto/rand" + "crypto/rsa" + "crypto/sha1" + "crypto/x509" + "encoding/base64" +) + +func ShaHmac1(source, secret string) string { + key := []byte(secret) + hmac := hmac.New(sha1.New, key) + hmac.Write([]byte(source)) + signedBytes := hmac.Sum(nil) + signedString := base64.StdEncoding.EncodeToString(signedBytes) + return signedString +} + +func Sha256WithRsa(source, secret string) string { + // block, _ := pem.Decode([]byte(secret)) + decodeString, err := base64.StdEncoding.DecodeString(secret) + if err != nil { + panic(err) + } + private, err := x509.ParsePKCS8PrivateKey(decodeString) + if err != nil { + panic(err) + } + + h := crypto.Hash.New(crypto.SHA256) + h.Write([]byte(source)) + hashed := h.Sum(nil) + signature, err := rsa.SignPKCS1v15(rand.Reader, private.(*rsa.PrivateKey), + crypto.SHA256, hashed) + if err != nil { + panic(err) + } + + return base64.StdEncoding.EncodeToString(signature) +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers/credential_updater.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers/credential_updater.go new file mode 100644 index 0000000000..ba291a41e8 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers/credential_updater.go @@ -0,0 +1,54 @@ +/* + * 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. + */ + +package signers + +import ( + "time" + + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +const defaultInAdvanceScale = 0.95 + +type credentialUpdater struct { + credentialExpiration int + lastUpdateTimestamp int64 + inAdvanceScale float64 + buildRequestMethod func() (*requests.CommonRequest, error) + responseCallBack func(response *responses.CommonResponse) error + refreshApi func(request *requests.CommonRequest) (response *responses.CommonResponse, err error) +} + +func (updater *credentialUpdater) needUpdateCredential() (result bool) { + if updater.inAdvanceScale == 0 { + updater.inAdvanceScale = defaultInAdvanceScale + } + return time.Now().Unix()-updater.lastUpdateTimestamp >= int64(float64(updater.credentialExpiration)*updater.inAdvanceScale) +} + +func (updater *credentialUpdater) updateCredential() (err error) { + request, err := updater.buildRequestMethod() + if err != nil { + return + } + response, err := updater.refreshApi(request) + if err != nil { + return + } + updater.lastUpdateTimestamp = time.Now().Unix() + err = updater.responseCallBack(response) + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers/session_credential.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers/session_credential.go new file mode 100644 index 0000000000..99c624c880 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers/session_credential.go @@ -0,0 +1,7 @@ +package signers + +type SessionCredential struct { + AccessKeyId string + AccessKeySecret string + StsToken string +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers/signer_access_key.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers/signer_access_key.go new file mode 100644 index 0000000000..bc4f35b856 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers/signer_access_key.go @@ -0,0 +1,54 @@ +/* + * 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. + */ + +package signers + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials" +) + +type AccessKeySigner struct { + credential *credentials.AccessKeyCredential +} + +func (signer *AccessKeySigner) GetExtraParam() map[string]string { + return nil +} + +func NewAccessKeySigner(credential *credentials.AccessKeyCredential) *AccessKeySigner { + return &AccessKeySigner{ + credential: credential, + } +} + +func (*AccessKeySigner) GetName() string { + return "HMAC-SHA1" +} + +func (*AccessKeySigner) GetType() string { + return "" +} + +func (*AccessKeySigner) GetVersion() string { + return "1.0" +} + +func (signer *AccessKeySigner) GetAccessKeyId() (accessKeyId string, err error) { + return signer.credential.AccessKeyId, nil +} + +func (signer *AccessKeySigner) Sign(stringToSign, secretSuffix string) string { + secret := signer.credential.AccessKeySecret + secretSuffix + return ShaHmac1(stringToSign, secret) +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers/signer_bearer_token.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers/signer_bearer_token.go new file mode 100644 index 0000000000..75b78433ad --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers/signer_bearer_token.go @@ -0,0 +1,35 @@ +package signers + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials" +) + +type BearerTokenSigner struct { + credential *credentials.BearerTokenCredential +} + +func NewBearerTokenSigner(credential *credentials.BearerTokenCredential) *BearerTokenSigner { + return &BearerTokenSigner{ + credential: credential, + } +} + +func (signer *BearerTokenSigner) GetExtraParam() map[string]string { + return map[string]string{"BearerToken": signer.credential.BearerToken} +} + +func (*BearerTokenSigner) GetName() string { + return "" +} +func (*BearerTokenSigner) GetType() string { + return "BEARERTOKEN" +} +func (*BearerTokenSigner) GetVersion() string { + return "1.0" +} +func (signer *BearerTokenSigner) GetAccessKeyId() (accessKeyId string, err error) { + return "", nil +} +func (signer *BearerTokenSigner) Sign(stringToSign, secretSuffix string) string { + return "" +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers/signer_ecs_ram_role.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers/signer_ecs_ram_role.go new file mode 100644 index 0000000000..73788429e9 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers/signer_ecs_ram_role.go @@ -0,0 +1,167 @@ +/* + * 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. + */ + +package signers + +import ( + "encoding/json" + "fmt" + "net/http" + "strings" + "time" + + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" + jmespath "github.com/jmespath/go-jmespath" +) + +var securityCredURL = "http://100.100.100.200/latest/meta-data/ram/security-credentials/" + +type EcsRamRoleSigner struct { + *credentialUpdater + sessionCredential *SessionCredential + credential *credentials.EcsRamRoleCredential + commonApi func(request *requests.CommonRequest, signer interface{}) (response *responses.CommonResponse, err error) +} + +func NewEcsRamRoleSigner(credential *credentials.EcsRamRoleCredential, commonApi func(*requests.CommonRequest, interface{}) (response *responses.CommonResponse, err error)) (signer *EcsRamRoleSigner) { + signer = &EcsRamRoleSigner{ + credential: credential, + commonApi: commonApi, + } + + signer.credentialUpdater = &credentialUpdater{ + credentialExpiration: defaultDurationSeconds / 60, + buildRequestMethod: signer.buildCommonRequest, + responseCallBack: signer.refreshCredential, + refreshApi: signer.refreshApi, + } + + return signer +} + +func (*EcsRamRoleSigner) GetName() string { + return "HMAC-SHA1" +} + +func (*EcsRamRoleSigner) GetType() string { + return "" +} + +func (*EcsRamRoleSigner) GetVersion() string { + return "1.0" +} + +func (signer *EcsRamRoleSigner) GetAccessKeyId() (accessKeyId string, err error) { + if signer.sessionCredential == nil || signer.needUpdateCredential() { + err = signer.updateCredential() + if err != nil { + return + } + } + if signer.sessionCredential == nil || len(signer.sessionCredential.AccessKeyId) <= 0 { + return "", nil + } + return signer.sessionCredential.AccessKeyId, nil +} + +func (signer *EcsRamRoleSigner) GetExtraParam() map[string]string { + if signer.sessionCredential == nil { + return make(map[string]string) + } + if len(signer.sessionCredential.StsToken) <= 0 { + return make(map[string]string) + } + return map[string]string{"SecurityToken": signer.sessionCredential.StsToken} +} + +func (signer *EcsRamRoleSigner) Sign(stringToSign, secretSuffix string) string { + secret := signer.sessionCredential.AccessKeySecret + secretSuffix + return ShaHmac1(stringToSign, secret) +} + +func (signer *EcsRamRoleSigner) buildCommonRequest() (request *requests.CommonRequest, err error) { + return +} + +func (signer *EcsRamRoleSigner) refreshApi(request *requests.CommonRequest) (response *responses.CommonResponse, err error) { + requestUrl := securityCredURL + signer.credential.RoleName + httpRequest, err := http.NewRequest(requests.GET, requestUrl, strings.NewReader("")) + if err != nil { + err = fmt.Errorf("refresh Ecs sts token err: %s", err.Error()) + return + } + httpClient := &http.Client{} + httpResponse, err := httpClient.Do(httpRequest) + if err != nil { + err = fmt.Errorf("refresh Ecs sts token err: %s", err.Error()) + return + } + + response = responses.NewCommonResponse() + err = responses.Unmarshal(response, httpResponse, "") + return +} + +func (signer *EcsRamRoleSigner) refreshCredential(response *responses.CommonResponse) (err error) { + if response.GetHttpStatus() != http.StatusOK { + return fmt.Errorf("refresh Ecs sts token err, httpStatus: %d, message = %s", response.GetHttpStatus(), response.GetHttpContentString()) + } + var data interface{} + err = json.Unmarshal(response.GetHttpContentBytes(), &data) + if err != nil { + return fmt.Errorf("refresh Ecs sts token err, json.Unmarshal fail: %s", err.Error()) + } + code, err := jmespath.Search("Code", data) + if err != nil { + return fmt.Errorf("refresh Ecs sts token err, fail to get Code: %s", err.Error()) + } + if code.(string) != "Success" { + return fmt.Errorf("refresh Ecs sts token err, Code is not Success") + } + accessKeyId, err := jmespath.Search("AccessKeyId", data) + if err != nil { + return fmt.Errorf("refresh Ecs sts token err, fail to get AccessKeyId: %s", err.Error()) + } + accessKeySecret, err := jmespath.Search("AccessKeySecret", data) + if err != nil { + return fmt.Errorf("refresh Ecs sts token err, fail to get AccessKeySecret: %s", err.Error()) + } + securityToken, err := jmespath.Search("SecurityToken", data) + if err != nil { + return fmt.Errorf("refresh Ecs sts token err, fail to get SecurityToken: %s", err.Error()) + } + expiration, err := jmespath.Search("Expiration", data) + if err != nil { + return fmt.Errorf("refresh Ecs sts token err, fail to get Expiration: %s", err.Error()) + } + if accessKeyId == nil || accessKeySecret == nil || securityToken == nil || expiration == nil { + return + } + + expirationTime, err := time.Parse("2006-01-02T15:04:05Z", expiration.(string)) + signer.credentialExpiration = int(expirationTime.Unix() - time.Now().Unix()) + signer.sessionCredential = &SessionCredential{ + AccessKeyId: accessKeyId.(string), + AccessKeySecret: accessKeySecret.(string), + StsToken: securityToken.(string), + } + + return +} + +func (signer *EcsRamRoleSigner) GetSessionCredential() *SessionCredential { + return signer.sessionCredential +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers/signer_key_pair.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers/signer_key_pair.go new file mode 100644 index 0000000000..19273d5a69 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers/signer_key_pair.go @@ -0,0 +1,148 @@ +/* + * 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. + */ + +package signers + +import ( + "encoding/json" + "fmt" + "net/http" + "strconv" + + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/errors" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" + jmespath "github.com/jmespath/go-jmespath" +) + +type SignerKeyPair struct { + *credentialUpdater + sessionCredential *SessionCredential + credential *credentials.RsaKeyPairCredential + commonApi func(request *requests.CommonRequest, signer interface{}) (response *responses.CommonResponse, err error) +} + +func NewSignerKeyPair(credential *credentials.RsaKeyPairCredential, commonApi func(*requests.CommonRequest, interface{}) (response *responses.CommonResponse, err error)) (signer *SignerKeyPair, err error) { + signer = &SignerKeyPair{ + credential: credential, + commonApi: commonApi, + } + + signer.credentialUpdater = &credentialUpdater{ + credentialExpiration: credential.SessionExpiration, + buildRequestMethod: signer.buildCommonRequest, + responseCallBack: signer.refreshCredential, + refreshApi: signer.refreshApi, + } + + if credential.SessionExpiration > 0 { + if credential.SessionExpiration >= 900 && credential.SessionExpiration <= 3600 { + signer.credentialExpiration = credential.SessionExpiration + } else { + err = errors.NewClientError(errors.InvalidParamErrorCode, "Key Pair session duration should be in the range of 15min - 1Hr", nil) + } + } else { + signer.credentialExpiration = defaultDurationSeconds + } + return +} + +func (*SignerKeyPair) GetName() string { + return "HMAC-SHA1" +} + +func (*SignerKeyPair) GetType() string { + return "" +} + +func (*SignerKeyPair) GetVersion() string { + return "1.0" +} + +func (signer *SignerKeyPair) ensureCredential() error { + if signer.sessionCredential == nil || signer.needUpdateCredential() { + return signer.updateCredential() + } + return nil +} + +func (signer *SignerKeyPair) GetAccessKeyId() (accessKeyId string, err error) { + err = signer.ensureCredential() + if err != nil { + return + } + if signer.sessionCredential == nil || len(signer.sessionCredential.AccessKeyId) <= 0 { + accessKeyId = "" + return + } + + accessKeyId = signer.sessionCredential.AccessKeyId + return +} + +func (signer *SignerKeyPair) GetExtraParam() map[string]string { + return make(map[string]string) +} + +func (signer *SignerKeyPair) Sign(stringToSign, secretSuffix string) string { + secret := signer.sessionCredential.AccessKeySecret + secretSuffix + return ShaHmac1(stringToSign, secret) +} + +func (signer *SignerKeyPair) buildCommonRequest() (request *requests.CommonRequest, err error) { + request = requests.NewCommonRequest() + request.Product = "Sts" + request.Version = "2015-04-01" + request.ApiName = "GenerateSessionAccessKey" + request.Scheme = requests.HTTPS + request.SetDomain("sts.ap-northeast-1.aliyuncs.com") + request.QueryParams["PublicKeyId"] = signer.credential.PublicKeyId + request.QueryParams["DurationSeconds"] = strconv.Itoa(signer.credentialExpiration) + return +} + +func (signer *SignerKeyPair) refreshApi(request *requests.CommonRequest) (response *responses.CommonResponse, err error) { + signerV2 := NewSignerV2(signer.credential) + return signer.commonApi(request, signerV2) +} + +func (signer *SignerKeyPair) refreshCredential(response *responses.CommonResponse) (err error) { + if response.GetHttpStatus() != http.StatusOK { + message := "refresh session AccessKey failed" + err = errors.NewServerError(response.GetHttpStatus(), response.GetHttpContentString(), message) + return + } + var data interface{} + err = json.Unmarshal(response.GetHttpContentBytes(), &data) + if err != nil { + return fmt.Errorf("refresh KeyPair err, json.Unmarshal fail: %s", err.Error()) + } + accessKeyId, err := jmespath.Search("SessionAccessKey.SessionAccessKeyId", data) + if err != nil { + return fmt.Errorf("refresh KeyPair err, fail to get SessionAccessKeyId: %s", err.Error()) + } + accessKeySecret, err := jmespath.Search("SessionAccessKey.SessionAccessKeySecret", data) + if err != nil { + return fmt.Errorf("refresh KeyPair err, fail to get SessionAccessKeySecret: %s", err.Error()) + } + if accessKeyId == nil || accessKeySecret == nil { + return + } + signer.sessionCredential = &SessionCredential{ + AccessKeyId: accessKeyId.(string), + AccessKeySecret: accessKeySecret.(string), + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers/signer_ram_role_arn.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers/signer_ram_role_arn.go new file mode 100644 index 0000000000..c945c8aeb3 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers/signer_ram_role_arn.go @@ -0,0 +1,175 @@ +/* + * 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. + */ + +package signers + +import ( + "encoding/json" + "fmt" + "net/http" + "strconv" + "time" + + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/errors" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" + jmespath "github.com/jmespath/go-jmespath" +) + +const ( + defaultDurationSeconds = 3600 +) + +type RamRoleArnSigner struct { + *credentialUpdater + roleSessionName string + sessionCredential *SessionCredential + credential *credentials.RamRoleArnCredential + commonApi func(request *requests.CommonRequest, signer interface{}) (response *responses.CommonResponse, err error) +} + +func NewRamRoleArnSigner(credential *credentials.RamRoleArnCredential, commonApi func(request *requests.CommonRequest, signer interface{}) (response *responses.CommonResponse, err error)) (signer *RamRoleArnSigner, err error) { + signer = &RamRoleArnSigner{ + credential: credential, + commonApi: commonApi, + } + + signer.credentialUpdater = &credentialUpdater{ + credentialExpiration: credential.RoleSessionExpiration, + buildRequestMethod: signer.buildCommonRequest, + responseCallBack: signer.refreshCredential, + refreshApi: signer.refreshApi, + } + + if len(credential.RoleSessionName) > 0 { + signer.roleSessionName = credential.RoleSessionName + } else { + signer.roleSessionName = "aliyun-go-sdk-" + strconv.FormatInt(time.Now().UnixNano()/1000, 10) + } + if credential.RoleSessionExpiration > 0 { + if credential.RoleSessionExpiration >= 900 && credential.RoleSessionExpiration <= 3600 { + signer.credentialExpiration = credential.RoleSessionExpiration + } else { + err = errors.NewClientError(errors.InvalidParamErrorCode, "Assume Role session duration should be in the range of 15min - 1Hr", nil) + } + } else { + signer.credentialExpiration = defaultDurationSeconds + } + return +} + +func (*RamRoleArnSigner) GetName() string { + return "HMAC-SHA1" +} + +func (*RamRoleArnSigner) GetType() string { + return "" +} + +func (*RamRoleArnSigner) GetVersion() string { + return "1.0" +} + +func (signer *RamRoleArnSigner) GetAccessKeyId() (accessKeyId string, err error) { + if signer.sessionCredential == nil || signer.needUpdateCredential() { + err = signer.updateCredential() + if err != nil { + return + } + } + + if signer.sessionCredential == nil || len(signer.sessionCredential.AccessKeyId) <= 0 { + return "", err + } + + return signer.sessionCredential.AccessKeyId, nil +} + +func (signer *RamRoleArnSigner) GetExtraParam() map[string]string { + if signer.sessionCredential == nil || signer.needUpdateCredential() { + signer.updateCredential() + } + if signer.sessionCredential == nil || len(signer.sessionCredential.StsToken) <= 0 { + return make(map[string]string) + } + return map[string]string{"SecurityToken": signer.sessionCredential.StsToken} +} + +func (signer *RamRoleArnSigner) Sign(stringToSign, secretSuffix string) string { + secret := signer.sessionCredential.AccessKeySecret + secretSuffix + return ShaHmac1(stringToSign, secret) +} + +func (signer *RamRoleArnSigner) buildCommonRequest() (request *requests.CommonRequest, err error) { + request = requests.NewCommonRequest() + request.Product = "Sts" + request.Version = "2015-04-01" + request.ApiName = "AssumeRole" + request.Scheme = requests.HTTPS + request.QueryParams["RoleArn"] = signer.credential.RoleArn + if signer.credential.Policy != "" { + request.QueryParams["Policy"] = signer.credential.Policy + } + request.QueryParams["RoleSessionName"] = signer.credential.RoleSessionName + request.QueryParams["DurationSeconds"] = strconv.Itoa(signer.credentialExpiration) + return +} + +func (signer *RamRoleArnSigner) refreshApi(request *requests.CommonRequest) (response *responses.CommonResponse, err error) { + credential := &credentials.AccessKeyCredential{ + AccessKeyId: signer.credential.AccessKeyId, + AccessKeySecret: signer.credential.AccessKeySecret, + } + signerV1 := NewAccessKeySigner(credential) + return signer.commonApi(request, signerV1) +} + +func (signer *RamRoleArnSigner) refreshCredential(response *responses.CommonResponse) (err error) { + if response.GetHttpStatus() != http.StatusOK { + message := "refresh session token failed" + err = errors.NewServerError(response.GetHttpStatus(), response.GetHttpContentString(), message) + return + } + var data interface{} + err = json.Unmarshal(response.GetHttpContentBytes(), &data) + if err != nil { + return fmt.Errorf("refresh RoleArn sts token err, json.Unmarshal fail: %s", err.Error()) + } + accessKeyId, err := jmespath.Search("Credentials.AccessKeyId", data) + if err != nil { + return fmt.Errorf("refresh RoleArn sts token err, fail to get AccessKeyId: %s", err.Error()) + } + accessKeySecret, err := jmespath.Search("Credentials.AccessKeySecret", data) + if err != nil { + return fmt.Errorf("refresh RoleArn sts token err, fail to get AccessKeySecret: %s", err.Error()) + } + securityToken, err := jmespath.Search("Credentials.SecurityToken", data) + if err != nil { + return fmt.Errorf("refresh RoleArn sts token err, fail to get SecurityToken: %s", err.Error()) + } + if accessKeyId == nil || accessKeySecret == nil || securityToken == nil { + return + } + signer.sessionCredential = &SessionCredential{ + AccessKeyId: accessKeyId.(string), + AccessKeySecret: accessKeySecret.(string), + StsToken: securityToken.(string), + } + return +} + +func (signer *RamRoleArnSigner) GetSessionCredential() *SessionCredential { + return signer.sessionCredential +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers/signer_sts_token.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers/signer_sts_token.go new file mode 100644 index 0000000000..d0ce36c38d --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers/signer_sts_token.go @@ -0,0 +1,54 @@ +/* + * 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. + */ + +package signers + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials" +) + +type StsTokenSigner struct { + credential *credentials.StsTokenCredential +} + +func NewStsTokenSigner(credential *credentials.StsTokenCredential) *StsTokenSigner { + return &StsTokenSigner{ + credential: credential, + } +} + +func (*StsTokenSigner) GetName() string { + return "HMAC-SHA1" +} + +func (*StsTokenSigner) GetType() string { + return "" +} + +func (*StsTokenSigner) GetVersion() string { + return "1.0" +} + +func (signer *StsTokenSigner) GetAccessKeyId() (accessKeyId string, err error) { + return signer.credential.AccessKeyId, nil +} + +func (signer *StsTokenSigner) GetExtraParam() map[string]string { + return map[string]string{"SecurityToken": signer.credential.AccessKeyStsToken} +} + +func (signer *StsTokenSigner) Sign(stringToSign, secretSuffix string) string { + secret := signer.credential.AccessKeySecret + secretSuffix + return ShaHmac1(stringToSign, secret) +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers/signer_v2.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers/signer_v2.go new file mode 100644 index 0000000000..9734852982 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers/signer_v2.go @@ -0,0 +1,54 @@ +/* + * 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. + */ + +package signers + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials" +) + +type SignerV2 struct { + credential *credentials.RsaKeyPairCredential +} + +func (signer *SignerV2) GetExtraParam() map[string]string { + return nil +} + +func NewSignerV2(credential *credentials.RsaKeyPairCredential) *SignerV2 { + return &SignerV2{ + credential: credential, + } +} + +func (*SignerV2) GetName() string { + return "SHA256withRSA" +} + +func (*SignerV2) GetType() string { + return "PRIVATEKEY" +} + +func (*SignerV2) GetVersion() string { + return "1.0" +} + +func (signer *SignerV2) GetAccessKeyId() (accessKeyId string, err error) { + return signer.credential.PublicKeyId, err +} + +func (signer *SignerV2) Sign(stringToSign, secretSuffix string) string { + secret := signer.credential.PrivateKey + return Sha256WithRsa(stringToSign, secret) +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/client.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/client.go new file mode 100644 index 0000000000..4834068d78 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/client.go @@ -0,0 +1,823 @@ +/* + * 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. + */ + +package sdk + +import ( + "context" + "crypto/tls" + "fmt" + "net" + "net/http" + "net/url" + "os" + "runtime" + "strconv" + "strings" + "sync" + "time" + "regexp" + + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/provider" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/endpoints" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/errors" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/utils" +) + +var debug utils.Debug + +func init() { + debug = utils.Init("sdk") +} + +// Version this value will be replaced while build: -ldflags="-X sdk.version=x.x.x" +var Version = "0.0.1" +var defaultConnectTimeout = 5 * time.Second +var defaultReadTimeout = 10 * time.Second + +var DefaultUserAgent = fmt.Sprintf("AlibabaCloud (%s; %s) Golang/%s Core/%s", runtime.GOOS, runtime.GOARCH, strings.Trim(runtime.Version(), "go"), Version) + +var hookDo = func(fn func(req *http.Request) (*http.Response, error)) func(req *http.Request) (*http.Response, error) { + return fn +} + +// Client the type Client +type Client struct { + isInsecure bool + regionId string + config *Config + httpProxy string + httpsProxy string + noProxy string + logger *Logger + userAgent map[string]string + signer auth.Signer + httpClient *http.Client + asyncTaskQueue chan func() + readTimeout time.Duration + connectTimeout time.Duration + EndpointMap map[string]string + EndpointType string + Network string + Domain string + + debug bool + isRunning bool + // void "panic(write to close channel)" cause of addAsync() after Shutdown() + asyncChanLock *sync.RWMutex +} + +func (client *Client) Init() (err error) { + panic("not support yet") +} + +func (client *Client) SetEndpointRules(endpointMap map[string]string, endpointType string, netWork string) { + client.EndpointMap = endpointMap + client.Network = netWork + client.EndpointType = endpointType +} + +func (client *Client) SetHTTPSInsecure(isInsecure bool) { + client.isInsecure = isInsecure +} + +func (client *Client) GetHTTPSInsecure() bool { + return client.isInsecure +} + +func (client *Client) SetHttpsProxy(httpsProxy string) { + client.httpsProxy = httpsProxy +} + +func (client *Client) GetHttpsProxy() string { + return client.httpsProxy +} + +func (client *Client) SetHttpProxy(httpProxy string) { + client.httpProxy = httpProxy +} + +func (client *Client) GetHttpProxy() string { + return client.httpProxy +} + +func (client *Client) SetNoProxy(noProxy string) { + client.noProxy = noProxy +} + +func (client *Client) GetNoProxy() string { + return client.noProxy +} + +func (client *Client) SetTransport(transport http.RoundTripper) { + if client.httpClient == nil { + client.httpClient = &http.Client{} + } + client.httpClient.Transport = transport +} + +// InitWithProviderChain will get credential from the providerChain, +// the RsaKeyPairCredential Only applicable to regionID `ap-northeast-1`, +// if your providerChain may return a credential type with RsaKeyPairCredential, +// please ensure your regionID is `ap-northeast-1`. +func (client *Client) InitWithProviderChain(regionId string, provider provider.Provider) (err error) { + config := client.InitClientConfig() + credential, err := provider.Resolve() + if err != nil { + return + } + return client.InitWithOptions(regionId, config, credential) +} + +func (client *Client) InitWithOptions(regionId string, config *Config, credential auth.Credential) (err error) { + client.isRunning = true + client.asyncChanLock = new(sync.RWMutex) + client.regionId = regionId + client.config = config + client.httpClient = &http.Client{} + + if config.Transport != nil { + client.httpClient.Transport = config.Transport + } else if config.HttpTransport != nil { + client.httpClient.Transport = config.HttpTransport + } + + if config.Timeout > 0 { + client.httpClient.Timeout = config.Timeout + } + + if config.EnableAsync { + client.EnableAsync(config.GoRoutinePoolSize, config.MaxTaskQueueSize) + } + + client.signer, err = auth.NewSignerWithCredential(credential, client.ProcessCommonRequestWithSigner) + + return +} + +func (client *Client) SetReadTimeout(readTimeout time.Duration) { + client.readTimeout = readTimeout +} + +func (client *Client) SetConnectTimeout(connectTimeout time.Duration) { + client.connectTimeout = connectTimeout +} + +func (client *Client) GetReadTimeout() time.Duration { + return client.readTimeout +} + +func (client *Client) GetConnectTimeout() time.Duration { + return client.connectTimeout +} + +func (client *Client) getHttpProxy(scheme string) (proxy *url.URL, err error) { + if scheme == "https" { + if client.GetHttpsProxy() != "" { + proxy, err = url.Parse(client.httpsProxy) + } else if rawurl := os.Getenv("HTTPS_PROXY"); rawurl != "" { + proxy, err = url.Parse(rawurl) + } else if rawurl := os.Getenv("https_proxy"); rawurl != "" { + proxy, err = url.Parse(rawurl) + } + } else { + if client.GetHttpProxy() != "" { + proxy, err = url.Parse(client.httpProxy) + } else if rawurl := os.Getenv("HTTP_PROXY"); rawurl != "" { + proxy, err = url.Parse(rawurl) + } else if rawurl := os.Getenv("http_proxy"); rawurl != "" { + proxy, err = url.Parse(rawurl) + } + } + + return proxy, err +} + +func (client *Client) getNoProxy(scheme string) []string { + var urls []string + if client.GetNoProxy() != "" { + urls = strings.Split(client.noProxy, ",") + } else if rawurl := os.Getenv("NO_PROXY"); rawurl != "" { + urls = strings.Split(rawurl, ",") + } else if rawurl := os.Getenv("no_proxy"); rawurl != "" { + urls = strings.Split(rawurl, ",") + } + + return urls +} + +// EnableAsync enable the async task queue +func (client *Client) EnableAsync(routinePoolSize, maxTaskQueueSize int) { + client.asyncTaskQueue = make(chan func(), maxTaskQueueSize) + for i := 0; i < routinePoolSize; i++ { + go func() { + for client.isRunning { + select { + case task, notClosed := <-client.asyncTaskQueue: + if notClosed { + task() + } + } + } + }() + } +} + +func (client *Client) InitWithAccessKey(regionId, accessKeyId, accessKeySecret string) (err error) { + config := client.InitClientConfig() + credential := &credentials.BaseCredential{ + AccessKeyId: accessKeyId, + AccessKeySecret: accessKeySecret, + } + return client.InitWithOptions(regionId, config, credential) +} + +func (client *Client) InitWithStsToken(regionId, accessKeyId, accessKeySecret, securityToken string) (err error) { + config := client.InitClientConfig() + credential := &credentials.StsTokenCredential{ + AccessKeyId: accessKeyId, + AccessKeySecret: accessKeySecret, + AccessKeyStsToken: securityToken, + } + return client.InitWithOptions(regionId, config, credential) +} + +func (client *Client) InitWithRamRoleArn(regionId, accessKeyId, accessKeySecret, roleArn, roleSessionName string) (err error) { + config := client.InitClientConfig() + credential := &credentials.RamRoleArnCredential{ + AccessKeyId: accessKeyId, + AccessKeySecret: accessKeySecret, + RoleArn: roleArn, + RoleSessionName: roleSessionName, + } + return client.InitWithOptions(regionId, config, credential) +} + +func (client *Client) InitWithRamRoleArnAndPolicy(regionId, accessKeyId, accessKeySecret, roleArn, roleSessionName, policy string) (err error) { + config := client.InitClientConfig() + credential := &credentials.RamRoleArnCredential{ + AccessKeyId: accessKeyId, + AccessKeySecret: accessKeySecret, + RoleArn: roleArn, + RoleSessionName: roleSessionName, + Policy: policy, + } + return client.InitWithOptions(regionId, config, credential) +} + +func (client *Client) InitWithRsaKeyPair(regionId, publicKeyId, privateKey string, sessionExpiration int) (err error) { + config := client.InitClientConfig() + credential := &credentials.RsaKeyPairCredential{ + PrivateKey: privateKey, + PublicKeyId: publicKeyId, + SessionExpiration: sessionExpiration, + } + return client.InitWithOptions(regionId, config, credential) +} + +func (client *Client) InitWithEcsRamRole(regionId, roleName string) (err error) { + config := client.InitClientConfig() + credential := &credentials.EcsRamRoleCredential{ + RoleName: roleName, + } + return client.InitWithOptions(regionId, config, credential) +} + +func (client *Client) InitWithBearerToken(regionId, bearerToken string) (err error) { + config := client.InitClientConfig() + credential := &credentials.BearerTokenCredential{ + BearerToken: bearerToken, + } + return client.InitWithOptions(regionId, config, credential) +} + +func (client *Client) InitClientConfig() (config *Config) { + if client.config != nil { + return client.config + } else { + return NewConfig() + } +} + +func (client *Client) DoAction(request requests.AcsRequest, response responses.AcsResponse) (err error) { + return client.DoActionWithSigner(request, response, nil) +} + +func (client *Client) GetEndpointRules(regionId string, product string) (endpointRaw string, err error) { + if client.EndpointType == "regional" { + if regionId == "" { + err = fmt.Errorf("RegionId is empty, please set a valid RegionId.") + return "", err + } + endpointRaw = strings.Replace("..aliyuncs.com", "", regionId, 1) + } else { + endpointRaw = ".aliyuncs.com" + } + endpointRaw = strings.Replace(endpointRaw, "", strings.ToLower(product), 1) + if client.Network == "" || client.Network == "public" { + endpointRaw = strings.Replace(endpointRaw, "", "", 1) + } else { + endpointRaw = strings.Replace(endpointRaw, "", "-"+client.Network, 1) + } + return endpointRaw, nil +} + +func (client *Client) buildRequestWithSigner(request requests.AcsRequest, signer auth.Signer) (httpRequest *http.Request, err error) { + // add clientVersion + request.GetHeaders()["x-sdk-core-version"] = Version + + regionId := client.regionId + if len(request.GetRegionId()) > 0 { + regionId = request.GetRegionId() + } + + // resolve endpoint + endpoint := request.GetDomain() + + if endpoint == "" && client.Domain != "" { + endpoint = client.Domain + } + + if endpoint == "" { + endpoint = endpoints.GetEndpointFromMap(regionId, request.GetProduct()) + } + + if endpoint == "" && client.EndpointType != "" && request.GetProduct() != "Sts" { + if client.EndpointMap != nil && client.Network == "" || client.Network == "public" { + endpoint = client.EndpointMap[regionId] + } + + if endpoint == "" { + endpoint, err = client.GetEndpointRules(regionId, request.GetProduct()) + if err != nil { + return + } + } + } + + if endpoint == "" { + resolveParam := &endpoints.ResolveParam{ + Domain: request.GetDomain(), + Product: request.GetProduct(), + RegionId: regionId, + LocationProduct: request.GetLocationServiceCode(), + LocationEndpointType: request.GetLocationEndpointType(), + CommonApi: client.ProcessCommonRequest, + } + endpoint, err = endpoints.Resolve(resolveParam) + if err != nil { + return + } + } + + request.SetDomain(endpoint) + if request.GetScheme() == "" { + request.SetScheme(client.config.Scheme) + } + // init request params + err = requests.InitParams(request) + if err != nil { + return + } + + // signature + var finalSigner auth.Signer + if signer != nil { + finalSigner = signer + } else { + finalSigner = client.signer + } + httpRequest, err = buildHttpRequest(request, finalSigner, regionId) + if err == nil { + userAgent := DefaultUserAgent + getSendUserAgent(client.config.UserAgent, client.userAgent, request.GetUserAgent()) + httpRequest.Header.Set("User-Agent", userAgent) + } + + return +} + +func getSendUserAgent(configUserAgent string, clientUserAgent, requestUserAgent map[string]string) string { + realUserAgent := "" + for key1, value1 := range clientUserAgent { + for key2, _ := range requestUserAgent { + if key1 == key2 { + key1 = "" + } + } + if key1 != "" { + realUserAgent += fmt.Sprintf(" %s/%s", key1, value1) + + } + } + for key, value := range requestUserAgent { + realUserAgent += fmt.Sprintf(" %s/%s", key, value) + } + if configUserAgent != "" { + return realUserAgent + fmt.Sprintf(" Extra/%s", configUserAgent) + } + return realUserAgent +} + +func (client *Client) AppendUserAgent(key, value string) { + newkey := true + + if client.userAgent == nil { + client.userAgent = make(map[string]string) + } + if strings.ToLower(key) != "core" && strings.ToLower(key) != "go" { + for tag, _ := range client.userAgent { + if tag == key { + client.userAgent[tag] = value + newkey = false + } + } + if newkey { + client.userAgent[key] = value + } + } +} + +func (client *Client) BuildRequestWithSigner(request requests.AcsRequest, signer auth.Signer) (err error) { + _, err = client.buildRequestWithSigner(request, signer) + return +} + +func (client *Client) getTimeout(request requests.AcsRequest) (time.Duration, time.Duration) { + readTimeout := defaultReadTimeout + connectTimeout := defaultConnectTimeout + + reqReadTimeout := request.GetReadTimeout() + reqConnectTimeout := request.GetConnectTimeout() + if reqReadTimeout != 0*time.Millisecond { + readTimeout = reqReadTimeout + } else if client.readTimeout != 0*time.Millisecond { + readTimeout = client.readTimeout + } else if client.httpClient.Timeout != 0 { + readTimeout = client.httpClient.Timeout + } else if timeout, ok := getAPIMaxTimeout(request.GetProduct(), request.GetActionName()); ok { + readTimeout = timeout + } + + if reqConnectTimeout != 0*time.Millisecond { + connectTimeout = reqConnectTimeout + } else if client.connectTimeout != 0*time.Millisecond { + connectTimeout = client.connectTimeout + } + return readTimeout, connectTimeout +} + +func Timeout(connectTimeout time.Duration) func(cxt context.Context, net, addr string) (c net.Conn, err error) { + return func(ctx context.Context, network, address string) (net.Conn, error) { + return (&net.Dialer{ + Timeout: connectTimeout, + DualStack: true, + }).DialContext(ctx, network, address) + } +} + +func (client *Client) setTimeout(request requests.AcsRequest) { + readTimeout, connectTimeout := client.getTimeout(request) + client.httpClient.Timeout = readTimeout + if trans, ok := client.httpClient.Transport.(*http.Transport); ok && trans != nil { + trans.DialContext = Timeout(connectTimeout) + client.httpClient.Transport = trans + } else if client.httpClient.Transport == nil { + client.httpClient.Transport = &http.Transport{ + DialContext: Timeout(connectTimeout), + } + } +} + +func (client *Client) getHTTPSInsecure(request requests.AcsRequest) (insecure bool) { + if request.GetHTTPSInsecure() != nil { + insecure = *request.GetHTTPSInsecure() + } else { + insecure = client.GetHTTPSInsecure() + } + return insecure +} + +func (client *Client) DoActionWithSigner(request requests.AcsRequest, response responses.AcsResponse, signer auth.Signer) (err error) { + + fieldMap := make(map[string]string) + initLogMsg(fieldMap) + defer func() { + client.printLog(fieldMap, err) + }() + httpRequest, err := client.buildRequestWithSigner(request, signer) + if err != nil { + return + } + + client.setTimeout(request) + proxy, err := client.getHttpProxy(httpRequest.URL.Scheme) + if err != nil { + return err + } + + noProxy := client.getNoProxy(httpRequest.URL.Scheme) + + var flag bool + for _, value := range noProxy { + if strings.HasPrefix(value, "*") { + value = fmt.Sprintf(".%s", value) + } + noProxyReg, err := regexp.Compile(value) + if err != nil { + return err + } + if noProxyReg.MatchString(httpRequest.Host){ + flag = true + break + } + } + + // Set whether to ignore certificate validation. + // Default InsecureSkipVerify is false. + if trans, ok := client.httpClient.Transport.(*http.Transport); ok && trans != nil { + if trans.TLSClientConfig != nil { + trans.TLSClientConfig.InsecureSkipVerify = client.getHTTPSInsecure(request) + } else { + trans.TLSClientConfig = &tls.Config{ + InsecureSkipVerify: client.getHTTPSInsecure(request), + } + } + if proxy != nil && !flag { + trans.Proxy = http.ProxyURL(proxy) + } + client.httpClient.Transport = trans + } + + var httpResponse *http.Response + for retryTimes := 0; retryTimes <= client.config.MaxRetryTime; retryTimes++ { + if proxy != nil && proxy.User != nil { + if password, passwordSet := proxy.User.Password(); passwordSet { + httpRequest.SetBasicAuth(proxy.User.Username(), password) + } + } + if retryTimes > 0 { + client.printLog(fieldMap, err) + initLogMsg(fieldMap) + } + putMsgToMap(fieldMap, httpRequest) + debug("> %s %s %s", httpRequest.Method, httpRequest.URL.RequestURI(), httpRequest.Proto) + debug("> Host: %s", httpRequest.Host) + for key, value := range httpRequest.Header { + debug("> %s: %v", key, strings.Join(value, "")) + } + debug(">") + debug(" Retry Times: %d.", retryTimes) + + startTime := time.Now() + fieldMap["{start_time}"] = startTime.Format("2006-01-02 15:04:05") + httpResponse, err = hookDo(client.httpClient.Do)(httpRequest) + fieldMap["{cost}"] = time.Now().Sub(startTime).String() + if err == nil { + fieldMap["{code}"] = strconv.Itoa(httpResponse.StatusCode) + fieldMap["{res_headers}"] = TransToString(httpResponse.Header) + debug("< %s %s", httpResponse.Proto, httpResponse.Status) + for key, value := range httpResponse.Header { + debug("< %s: %v", key, strings.Join(value, "")) + } + } + debug("<") + // receive error + if err != nil { + debug(" Error: %s.", err.Error()) + if !client.config.AutoRetry { + return + } else if retryTimes >= client.config.MaxRetryTime { + // timeout but reached the max retry times, return + times := strconv.Itoa(retryTimes + 1) + timeoutErrorMsg := fmt.Sprintf(errors.TimeoutErrorMessage, times, times) + if strings.Contains(err.Error(), "Client.Timeout") { + timeoutErrorMsg += " Read timeout. Please set a valid ReadTimeout." + } else { + timeoutErrorMsg += " Connect timeout. Please set a valid ConnectTimeout." + } + err = errors.NewClientError(errors.TimeoutErrorCode, timeoutErrorMsg, err) + return + } + } + if isCertificateError(err) { + return + } + + // if status code >= 500 or timeout, will trigger retry + if client.config.AutoRetry && (err != nil || isServerError(httpResponse)) { + client.setTimeout(request) + // rewrite signatureNonce and signature + httpRequest, err = client.buildRequestWithSigner(request, signer) + // buildHttpRequest(request, finalSigner, regionId) + if err != nil { + return + } + continue + } + break + } + + err = responses.Unmarshal(response, httpResponse, request.GetAcceptFormat()) + fieldMap["{res_body}"] = response.GetHttpContentString() + debug("%s", response.GetHttpContentString()) + // wrap server errors + if serverErr, ok := err.(*errors.ServerError); ok { + var wrapInfo = map[string]string{} + wrapInfo["StringToSign"] = request.GetStringToSign() + err = errors.WrapServerError(serverErr, wrapInfo) + } + return +} + +func isCertificateError(err error) bool { + if err != nil && strings.Contains(err.Error(), "x509: certificate signed by unknown authority") { + return true + } + return false +} + +func putMsgToMap(fieldMap map[string]string, request *http.Request) { + fieldMap["{host}"] = request.Host + fieldMap["{method}"] = request.Method + fieldMap["{uri}"] = request.URL.RequestURI() + fieldMap["{pid}"] = strconv.Itoa(os.Getpid()) + fieldMap["{version}"] = strings.Split(request.Proto, "/")[1] + hostname, _ := os.Hostname() + fieldMap["{hostname}"] = hostname + fieldMap["{req_headers}"] = TransToString(request.Header) + fieldMap["{target}"] = request.URL.Path + request.URL.RawQuery +} + +func buildHttpRequest(request requests.AcsRequest, singer auth.Signer, regionId string) (httpRequest *http.Request, err error) { + err = auth.Sign(request, singer, regionId) + if err != nil { + return + } + requestMethod := request.GetMethod() + requestUrl := request.BuildUrl() + body := request.GetBodyReader() + httpRequest, err = http.NewRequest(requestMethod, requestUrl, body) + if err != nil { + return + } + for key, value := range request.GetHeaders() { + httpRequest.Header[key] = []string{value} + } + // host is a special case + if host, containsHost := request.GetHeaders()["Host"]; containsHost { + httpRequest.Host = host + } + return +} + +func isServerError(httpResponse *http.Response) bool { + return httpResponse.StatusCode >= http.StatusInternalServerError +} + +/** +only block when any one of the following occurs: +1. the asyncTaskQueue is full, increase the queue size to avoid this +2. Shutdown() in progressing, the client is being closed +**/ +func (client *Client) AddAsyncTask(task func()) (err error) { + if client.asyncTaskQueue != nil { + client.asyncChanLock.RLock() + defer client.asyncChanLock.RUnlock() + if client.isRunning { + client.asyncTaskQueue <- task + } + } else { + err = errors.NewClientError(errors.AsyncFunctionNotEnabledCode, errors.AsyncFunctionNotEnabledMessage, nil) + } + return +} + +func (client *Client) GetConfig() *Config { + return client.config +} + +func (client *Client) GetSigner() auth.Signer { + return client.signer +} + +func (client *Client) SetSigner(signer auth.Signer) { + client.signer = signer +} + +func NewClient() (client *Client, err error) { + client = &Client{} + err = client.Init() + return +} + +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 +} + +func NewClientWithOptions(regionId string, config *Config, credential auth.Credential) (client *Client, err error) { + client = &Client{} + err = client.InitWithOptions(regionId, config, credential) + return +} + +func NewClientWithAccessKey(regionId, accessKeyId, accessKeySecret string) (client *Client, err error) { + client = &Client{} + err = client.InitWithAccessKey(regionId, accessKeyId, accessKeySecret) + return +} + +func NewClientWithStsToken(regionId, stsAccessKeyId, stsAccessKeySecret, stsToken string) (client *Client, err error) { + client = &Client{} + err = client.InitWithStsToken(regionId, stsAccessKeyId, stsAccessKeySecret, stsToken) + return +} + +func NewClientWithRamRoleArn(regionId string, accessKeyId, accessKeySecret, roleArn, roleSessionName string) (client *Client, err error) { + client = &Client{} + err = client.InitWithRamRoleArn(regionId, accessKeyId, accessKeySecret, roleArn, roleSessionName) + return +} + +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 +} + +func NewClientWithEcsRamRole(regionId string, roleName string) (client *Client, err error) { + client = &Client{} + err = client.InitWithEcsRamRole(regionId, roleName) + return +} + +func NewClientWithRsaKeyPair(regionId string, publicKeyId, privateKey string, sessionExpiration int) (client *Client, err error) { + client = &Client{} + err = client.InitWithRsaKeyPair(regionId, publicKeyId, privateKey, sessionExpiration) + return +} + +func NewClientWithBearerToken(regionId, bearerToken string) (client *Client, err error) { + client = &Client{} + err = client.InitWithBearerToken(regionId, bearerToken) + return +} + +func (client *Client) ProcessCommonRequest(request *requests.CommonRequest) (response *responses.CommonResponse, err error) { + request.TransToAcsRequest() + response = responses.NewCommonResponse() + err = client.DoAction(request, response) + return +} + +func (client *Client) ProcessCommonRequestWithSigner(request *requests.CommonRequest, signerInterface interface{}) (response *responses.CommonResponse, err error) { + if signer, isSigner := signerInterface.(auth.Signer); isSigner { + request.TransToAcsRequest() + response = responses.NewCommonResponse() + err = client.DoActionWithSigner(request, response, signer) + return + } + panic("should not be here") +} + +func (client *Client) Shutdown() { + // lock the addAsync() + client.asyncChanLock.Lock() + defer client.asyncChanLock.Unlock() + if client.asyncTaskQueue != nil { + close(client.asyncTaskQueue) + } + client.isRunning = false +} + +// Deprecated: Use NewClientWithRamRoleArn in this package instead. +func NewClientWithStsRoleArn(regionId string, accessKeyId, accessKeySecret, roleArn, roleSessionName string) (client *Client, err error) { + return NewClientWithRamRoleArn(regionId, accessKeyId, accessKeySecret, roleArn, roleSessionName) +} + +// Deprecated: Use NewClientWithEcsRamRole in this package instead. +func NewClientWithStsRoleNameOnEcs(regionId string, roleName string) (client *Client, err error) { + return NewClientWithEcsRamRole(regionId, roleName) +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/config.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/config.go new file mode 100644 index 0000000000..6609896841 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/config.go @@ -0,0 +1,92 @@ +/* + * 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. + */ + +package sdk + +import ( + "net/http" + "time" + + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/utils" +) + +type Config struct { + AutoRetry bool `default:"true"` + MaxRetryTime int `default:"3"` + UserAgent string `default:""` + Debug bool `default:"false"` + HttpTransport *http.Transport `default:""` + Transport http.RoundTripper `default:""` + EnableAsync bool `default:"false"` + MaxTaskQueueSize int `default:"1000"` + GoRoutinePoolSize int `default:"5"` + Scheme string `default:"HTTP"` + Timeout time.Duration +} + +func NewConfig() (config *Config) { + config = &Config{} + utils.InitStructWithDefaultTag(config) + return +} + +func (c *Config) WithAutoRetry(isAutoRetry bool) *Config { + c.AutoRetry = isAutoRetry + return c +} + +func (c *Config) WithMaxRetryTime(maxRetryTime int) *Config { + c.MaxRetryTime = maxRetryTime + return c +} + +func (c *Config) WithUserAgent(userAgent string) *Config { + c.UserAgent = userAgent + return c +} + +func (c *Config) WithDebug(isDebug bool) *Config { + c.Debug = isDebug + return c +} + +func (c *Config) WithTimeout(timeout time.Duration) *Config { + c.Timeout = timeout + return c +} + +func (c *Config) WithHttpTransport(httpTransport *http.Transport) *Config { + c.HttpTransport = httpTransport + return c +} + +func (c *Config) WithEnableAsync(isEnableAsync bool) *Config { + c.EnableAsync = isEnableAsync + return c +} + +func (c *Config) WithMaxTaskQueueSize(maxTaskQueueSize int) *Config { + c.MaxTaskQueueSize = maxTaskQueueSize + return c +} + +func (c *Config) WithGoRoutinePoolSize(goRoutinePoolSize int) *Config { + c.GoRoutinePoolSize = goRoutinePoolSize + return c +} + +func (c *Config) WithScheme(scheme string) *Config { + c.Scheme = scheme + return c +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/endpoints/BUILD.bazel b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/endpoints/BUILD.bazel new file mode 100644 index 0000000000..f1e0921ca2 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/endpoints/BUILD.bazel @@ -0,0 +1,23 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "go_default_library", + srcs = [ + "endpoints_config.go", + "local_global_resolver.go", + "local_regional_resolver.go", + "location_resolver.go", + "mapping_resolver.go", + "resolver.go", + ], + importmap = "k8s.io/kops/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/endpoints", + importpath = "github.com/aliyun/alibaba-cloud-sdk-go/sdk/endpoints", + visibility = ["//visibility:public"], + deps = [ + "//vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/errors:go_default_library", + "//vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests:go_default_library", + "//vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses:go_default_library", + "//vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/utils:go_default_library", + "//vendor/github.com/jmespath/go-jmespath:go_default_library", + ], +) diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/endpoints/endpoints_config.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/endpoints/endpoints_config.go new file mode 100644 index 0000000000..a4fc47098d --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/endpoints/endpoints_config.go @@ -0,0 +1,4126 @@ + +package endpoints + +import ( + "encoding/json" + "fmt" + "sync" +) + +const endpointsJson =`{ + "products": [ + { + "code": "emr", + "document_id": "28140", + "location_service_code": "emr", + "regional_endpoints": [ + { + "region": "cn-qingdao", + "endpoint": "emr.cn-qingdao.aliyuncs.com" + }, + { + "region": "cn-beijing", + "endpoint": "emr.aliyuncs.com" + }, + { + "region": "cn-shenzhen", + "endpoint": "emr.aliyuncs.com" + }, + { + "region": "eu-west-1", + "endpoint": "emr.eu-west-1.aliyuncs.com" + }, + { + "region": "us-west-1", + "endpoint": "emr.aliyuncs.com" + }, + { + "region": "me-east-1", + "endpoint": "emr.me-east-1.aliyuncs.com" + }, + { + "region": "ap-northeast-1", + "endpoint": "emr.ap-northeast-1.aliyuncs.com" + }, + { + "region": "eu-central-1", + "endpoint": "emr.eu-central-1.aliyuncs.com" + }, + { + "region": "cn-huhehaote", + "endpoint": "emr.cn-huhehaote.aliyuncs.com" + }, + { + "region": "ap-south-1", + "endpoint": "emr.ap-south-1.aliyuncs.com" + }, + { + "region": "us-east-1", + "endpoint": "emr.us-east-1.aliyuncs.com" + }, + { + "region": "cn-hangzhou", + "endpoint": "emr.aliyuncs.com" + }, + { + "region": "cn-hongkong", + "endpoint": "emr.cn-hongkong.aliyuncs.com" + }, + { + "region": "ap-southeast-1", + "endpoint": "emr.aliyuncs.com" + }, + { + "region": "ap-southeast-2", + "endpoint": "emr.ap-southeast-2.aliyuncs.com" + }, + { + "region": "ap-southeast-3", + "endpoint": "emr.ap-southeast-3.aliyuncs.com" + }, + { + "region": "cn-zhangjiakou", + "endpoint": "emr.cn-zhangjiakou.aliyuncs.com" + }, + { + "region": "ap-southeast-5", + "endpoint": "emr.ap-southeast-5.aliyuncs.com" + }, + { + "region": "cn-shanghai", + "endpoint": "emr.aliyuncs.com" + } + ], + "global_endpoint": "emr.aliyuncs.com", + "regional_endpoint_pattern": "emr.[RegionId].aliyuncs.com" + }, + { + "code": "petadata", + "document_id": "", + "location_service_code": "petadata", + "regional_endpoints": [ + { + "region": "cn-hangzhou", + "endpoint": "petadata.aliyuncs.com" + }, + { + "region": "cn-shenzhen", + "endpoint": "petadata.aliyuncs.com" + }, + { + "region": "ap-southeast-1", + "endpoint": "petadata.aliyuncs.com" + }, + { + "region": "us-east-1", + "endpoint": "petadata.aliyuncs.com" + }, + { + "region": "me-east-1", + "endpoint": "petadata.me-east-1.aliyuncs.com" + }, + { + "region": "ap-southeast-2", + "endpoint": "petadata.ap-southeast-2.aliyuncs.com" + }, + { + "region": "eu-central-1", + "endpoint": "petadata.eu-central-1.aliyuncs.com" + }, + { + "region": "cn-beijing", + "endpoint": "petadata.aliyuncs.com" + }, + { + "region": "cn-hongkong", + "endpoint": "petadata.aliyuncs.com" + }, + { + "region": "ap-southeast-5", + "endpoint": "petadata.ap-southeast-5.aliyuncs.com" + }, + { + "region": "us-west-1", + "endpoint": "petadata.aliyuncs.com" + }, + { + "region": "cn-huhehaote", + "endpoint": "petadata.cn-huhehaote.aliyuncs.com" + }, + { + "region": "cn-zhangjiakou", + "endpoint": "petadata.cn-zhangjiakou.aliyuncs.com" + }, + { + "region": "cn-qingdao", + "endpoint": "petadata.aliyuncs.com" + }, + { + "region": "cn-shanghai", + "endpoint": "petadata.aliyuncs.com" + } + ], + "global_endpoint": "petadata.aliyuncs.com", + "regional_endpoint_pattern": "" + }, + { + "code": "dbs", + "document_id": "", + "location_service_code": "dbs", + "regional_endpoints": [ + { + "region": "cn-shenzhen", + "endpoint": "dbs-api.cn-hangzhou.aliyuncs.com" + }, + { + "region": "cn-hongkong", + "endpoint": "dbs-api.cn-hangzhou.aliyuncs.com" + }, + { + "region": "ap-southeast-1", + "endpoint": "dbs-api.ap-southeast-1.aliyuncs.com" + }, + { + "region": "ap-northeast-1", + "endpoint": "dbs-api.ap-northeast-1.aliyuncs.com" + }, + { + "region": "cn-hangzhou", + "endpoint": "dbs-api.cn-hangzhou.aliyuncs.com" + }, + { + "region": "cn-shanghai", + "endpoint": "dbs-api.cn-hangzhou.aliyuncs.com" + }, + { + "region": "cn-qingdao", + "endpoint": "dbs-api.cn-hangzhou.aliyuncs.com" + }, + { + "region": "cn-beijing", + "endpoint": "dbs-api.cn-hangzhou.aliyuncs.com" + } + ], + "global_endpoint": "", + "regional_endpoint_pattern": "" + }, + { + "code": "alidnsgtm", + "document_id": "", + "location_service_code": "alidnsgtm", + "regional_endpoints": [ + { + "region": "cn-hangzhou", + "endpoint": "alidns.aliyuncs.com" + }, + { + "region": "ap-southeast-1", + "endpoint": "alidns.aliyuncs.com" + } + ], + "global_endpoint": "", + "regional_endpoint_pattern": "" + }, + { + "code": "elasticsearch", + "document_id": "", + "location_service_code": "elasticsearch", + "regional_endpoints": [ + { + "region": "cn-hangzhou", + "endpoint": "elasticsearch.cn-hangzhou.aliyuncs.com" + }, + { + "region": "cn-shenzhen", + "endpoint": "elasticsearch.cn-shenzhen.aliyuncs.com" + }, + { + "region": "ap-southeast-1", + "endpoint": "elasticsearch.ap-southeast-1.aliyuncs.com" + }, + { + "region": "cn-beijing", + "endpoint": "elasticsearch.cn-beijing.aliyuncs.com" + }, + { + "region": "cn-hongkong", + "endpoint": "elasticsearch.cn-hongkong.aliyuncs.com" + }, + { + "region": "ap-southeast-3", + "endpoint": "elasticsearch.ap-southeast-3.aliyuncs.com" + }, + { + "region": "us-west-1", + "endpoint": "elasticsearch.us-west-1.aliyuncs.com" + }, + { + "region": "ap-southeast-2", + "endpoint": "elasticsearch.ap-southeast-2.aliyuncs.com" + }, + { + "region": "ap-southeast-5", + "endpoint": "elasticsearch.ap-southeast-5.aliyuncs.com" + }, + { + "region": "eu-central-1", + "endpoint": "elasticsearch.eu-central-1.aliyuncs.com" + }, + { + "region": "ap-south-1", + "endpoint": "elasticsearch.ap-south-1.aliyuncs.com" + }, + { + "region": "cn-shanghai", + "endpoint": "elasticsearch.cn-shanghai.aliyuncs.com" + }, + { + "region": "cn-qingdao", + "endpoint": "elasticsearch.cn-qingdao.aliyuncs.com" + }, + { + "region": "cn-zhangjiakou", + "endpoint": "elasticsearch.cn-zhangjiakou.aliyuncs.com" + }, + { + "region": "ap-northeast-1", + "endpoint": "elasticsearch.ap-northeast-1.aliyuncs.com" + } + ], + "global_endpoint": "", + "regional_endpoint_pattern": "" + }, + { + "code": "baas", + "document_id": "", + "location_service_code": "baas", + "regional_endpoints": [ + { + "region": "cn-hangzhou", + "endpoint": "baas.cn-hangzhou.aliyuncs.com" + }, + { + "region": "ap-northeast-1", + "endpoint": "baas.ap-northeast-1.aliyuncs.com" + }, + { + "region": "ap-southeast-1", + "endpoint": "baas.ap-southeast-1.aliyuncs.com" + }, + { + "region": "cn-beijing", + "endpoint": "baas.aliyuncs.com" + }, + { + "region": "cn-shanghai", + "endpoint": "baas.aliyuncs.com" + }, + { + "region": "cn-shenzhen", + "endpoint": "baas.aliyuncs.com" + } + ], + "global_endpoint": "", + "regional_endpoint_pattern": "" + }, + { + "code": "cr", + "document_id": "60716", + "location_service_code": "cr", + "regional_endpoints": null, + "global_endpoint": "cr.aliyuncs.com", + "regional_endpoint_pattern": "" + }, + { + "code": "cloudap", + "document_id": "", + "location_service_code": "cloudap", + "regional_endpoints": [ + { + "region": "cn-hangzhou", + "endpoint": "cloudwf.aliyuncs.com" + } + ], + "global_endpoint": "", + "regional_endpoint_pattern": "" + }, + { + "code": "imagesearch", + "document_id": "", + "location_service_code": "imagesearch", + "regional_endpoints": [ + { + "region": "ap-southeast-2", + "endpoint": "imagesearch.ap-southeast-2.aliyuncs.com" + }, + { + "region": "cn-shanghai", + "endpoint": "imagesearch.cn-shanghai.aliyuncs.com" + }, + { + "region": "ap-northeast-1", + "endpoint": "imagesearch.ap-northeast-1.aliyuncs.com" + }, + { + "region": "ap-southeast-1", + "endpoint": "imagesearch.ap-southeast-1.aliyuncs.com" + } + ], + "global_endpoint": "", + "regional_endpoint_pattern": "" + }, + { + "code": "pts", + "document_id": "", + "location_service_code": "pts", + "regional_endpoints": [ + { + "region": "cn-hangzhou", + "endpoint": "pts.aliyuncs.com" + } + ], + "global_endpoint": "", + "regional_endpoint_pattern": "" + }, + { + "code": "ehs", + "document_id": "", + "location_service_code": "ehs", + "regional_endpoints": [ + { + "region": "cn-beijing", + "endpoint": "ehpc.cn-beijing.aliyuncs.com" + }, + { + "region": "cn-hongkong", + "endpoint": "ehpc.cn-hongkong.aliyuncs.com" + }, + { + "region": "ap-southeast-1", + "endpoint": "ehpc.ap-southeast-1.aliyuncs.com" + }, + { + "region": "cn-qingdao", + "endpoint": "ehpc.cn-qingdao.aliyuncs.com" + }, + { + "region": "eu-central-1", + "endpoint": "ehpc.eu-central-1.aliyuncs.com" + }, + { + "region": "cn-zhangjiakou", + "endpoint": "ehpc.cn-zhangjiakou.aliyuncs.com" + }, + { + "region": "cn-huhehaote", + "endpoint": "ehpc.cn-huhehaote.aliyuncs.com" + }, + { + "region": "cn-hangzhou", + "endpoint": "ehpc.cn-hangzhou.aliyuncs.com" + }, + { + "region": "cn-shanghai", + "endpoint": "ehpc.cn-shanghai.aliyuncs.com" + }, + { + "region": "cn-shenzhen", + "endpoint": "ehpc.cn-shenzhen.aliyuncs.com" + }, + { + "region": "ap-southeast-2", + "endpoint": "ehpc.ap-southeast-2.aliyuncs.com" + } + ], + "global_endpoint": "", + "regional_endpoint_pattern": "" + }, + { + "code": "polardb", + "document_id": "58764", + "location_service_code": "polardb", + "regional_endpoints": [ + { + "region": "ap-south-1", + "endpoint": "polardb.ap-south-1.aliyuncs.com" + }, + { + "region": "cn-hongkong", + "endpoint": "polardb.aliyuncs.com" + }, + { + "region": "cn-huhehaote", + "endpoint": "polardb.cn-huhehaote.aliyuncs.com" + }, + { + "region": "cn-qingdao", + "endpoint": "polardb.aliyuncs.com" + }, + { + "region": "cn-shanghai", + "endpoint": "polardb.aliyuncs.com" + }, + { + "region": "cn-shenzhen", + "endpoint": "polardb.aliyuncs.com" + }, + { + "region": "cn-beijing", + "endpoint": "polardb.aliyuncs.com" + }, + { + "region": "cn-hangzhou", + "endpoint": "polardb.aliyuncs.com" + }, + { + "region": "ap-southeast-5", + "endpoint": "polardb.ap-southeast-5.aliyuncs.com" + } + ], + "global_endpoint": "", + "regional_endpoint_pattern": "polardb.aliyuncs.com" + }, + { + "code": "r-kvstore", + "document_id": "60831", + "location_service_code": "redisa", + "regional_endpoints": [ + { + "region": "cn-shenzhen", + "endpoint": "r-kvstore.aliyuncs.com" + }, + { + "region": "cn-huhehaote", + "endpoint": "r-kvstore.cn-huhehaote.aliyuncs.com" + }, + { + "region": "ap-southeast-3", + "endpoint": "r-kvstore.ap-southeast-3.aliyuncs.com" + }, + { + "region": "ap-southeast-2", + "endpoint": "r-kvstore.ap-southeast-2.aliyuncs.com" + }, + { + "region": "cn-zhangjiakou", + "endpoint": "r-kvstore.cn-zhangjiakou.aliyuncs.com" + }, + { + "region": "eu-central-1", + "endpoint": "r-kvstore.eu-central-1.aliyuncs.com" + }, + { + "region": "cn-shanghai", + "endpoint": "r-kvstore.aliyuncs.com" + }, + { + "region": "us-west-1", + "endpoint": "r-kvstore.aliyuncs.com" + }, + { + "region": "cn-hongkong", + "endpoint": "r-kvstore.cn-hongkong.aliyuncs.com" + }, + { + "region": "ap-southeast-1", + "endpoint": "r-kvstore.ap-southeast-1.aliyuncs.com" + }, + { + "region": "ap-south-1", + "endpoint": "r-kvstore.ap-south-1.aliyuncs.com" + }, + { + "region": "cn-qingdao", + "endpoint": "r-kvstore.aliyuncs.com" + }, + { + "region": "cn-beijing", + "endpoint": "r-kvstore.aliyuncs.com" + }, + { + "region": "cn-hangzhou", + "endpoint": "r-kvstore.aliyuncs.com" + }, + { + "region": "eu-west-1", + "endpoint": "r-kvstore.eu-west-1.aliyuncs.com" + }, + { + "region": "us-east-1", + "endpoint": "r-kvstore.aliyuncs.com" + }, + { + "region": "me-east-1", + "endpoint": "r-kvstore.me-east-1.aliyuncs.com" + }, + { + "region": "ap-northeast-1", + "endpoint": "r-kvstore.ap-northeast-1.aliyuncs.com" + }, + { + "region": "ap-southeast-5", + "endpoint": "r-kvstore.ap-southeast-5.aliyuncs.com" + } + ], + "global_endpoint": "r-kvstore.aliyuncs.com", + "regional_endpoint_pattern": "" + }, + { + "code": "xianzhi", + "document_id": "", + "location_service_code": "xianzhi", + "regional_endpoints": [ + { + "region": "cn-hangzhou", + "endpoint": "xianzhi.aliyuncs.com" + } + ], + "global_endpoint": "", + "regional_endpoint_pattern": "" + }, + { + "code": "pcdn", + "document_id": "", + "location_service_code": "pcdn", + "regional_endpoints": [ + { + "region": "cn-hangzhou", + "endpoint": "pcdn.aliyuncs.com" + } + ], + "global_endpoint": "", + "regional_endpoint_pattern": "" + }, + { + "code": "cdn", + "document_id": "27148", + "location_service_code": "cdn", + "regional_endpoints": [ + { + "region": "cn-hangzhou", + "endpoint": "cdn.aliyuncs.com" + } + ], + "global_endpoint": "cdn.aliyuncs.com", + "regional_endpoint_pattern": "" + }, + { + "code": "cloudauth", + "document_id": "60687", + "location_service_code": "cloudauth", + "regional_endpoints": [ + { + "region": "cn-hangzhou", + "endpoint": "cloudauth.aliyuncs.com" + } + ], + "global_endpoint": "cloudauth.aliyuncs.com", + "regional_endpoint_pattern": "" + }, + { + "code": "nas", + "document_id": "62598", + "location_service_code": "nas", + "regional_endpoints": [ + { + "region": "ap-southeast-2", + "endpoint": "nas.ap-southeast-2.aliyuncs.com" + }, + { + "region": "ap-south-1", + "endpoint": "nas.ap-south-1.aliyuncs.com" + }, + { + "region": "eu-central-1", + "endpoint": "nas.eu-central-1.aliyuncs.com" + }, + { + "region": "us-west-1", + "endpoint": "nas.us-west-1.aliyuncs.com" + }, + { + "region": "cn-huhehaote", + "endpoint": "nas.cn-huhehaote.aliyuncs.com" + }, + { + "region": "cn-qingdao", + "endpoint": "nas.cn-qingdao.aliyuncs.com" + }, + { + "region": "ap-southeast-1", + "endpoint": "nas.ap-southeast-1.aliyuncs.com" + }, + { + "region": "cn-beijing", + "endpoint": "nas.cn-beijing.aliyuncs.com" + }, + { + "region": "cn-shanghai", + "endpoint": "nas.cn-shanghai.aliyuncs.com" + }, + { + "region": "cn-hangzhou", + "endpoint": "nas.cn-hangzhou.aliyuncs.com" + }, + { + "region": "cn-zhangjiakou", + "endpoint": "nas.cn-zhangjiakou.aliyuncs.com" + }, + { + "region": "ap-northeast-1", + "endpoint": "nas.ap-northeast-1.aliyuncs.com" + }, + { + "region": "us-east-1", + "endpoint": "nas.us-east-1.aliyuncs.com" + }, + { + "region": "cn-shenzhen", + "endpoint": "nas.cn-shenzhen.aliyuncs.com" + }, + { + "region": "ap-southeast-5", + "endpoint": "nas.ap-southeast-5.aliyuncs.com" + }, + { + "region": "cn-hongkong", + "endpoint": "nas.cn-hongkong.aliyuncs.com" + }, + { + "region": "ap-southeast-3", + "endpoint": "nas.ap-southeast-3.aliyuncs.com" + } + ], + "global_endpoint": "", + "regional_endpoint_pattern": "" + }, + { + "code": "alidns", + "document_id": "29739", + "location_service_code": "alidns", + "regional_endpoints": [ + { + "region": "cn-hangzhou", + "endpoint": "alidns.aliyuncs.com" + } + ], + "global_endpoint": "alidns.aliyuncs.com", + "regional_endpoint_pattern": "" + }, + { + "code": "dts", + "document_id": "", + "location_service_code": "dts", + "regional_endpoints": [ + { + "region": "cn-beijing", + "endpoint": "dts.aliyuncs.com" + }, + { + "region": "cn-zhangjiakou", + "endpoint": "dts.aliyuncs.com" + }, + { + "region": "cn-hangzhou", + "endpoint": "dts.aliyuncs.com" + }, + { + "region": "cn-shanghai", + "endpoint": "dts.aliyuncs.com" + }, + { + "region": "cn-hongkong", + "endpoint": "dts.aliyuncs.com" + }, + { + "region": "cn-qingdao", + "endpoint": "dts.aliyuncs.com" + }, + { + "region": "cn-huhehaote", + "endpoint": "dts.aliyuncs.com" + }, + { + "region": "cn-shenzhen", + "endpoint": "dts.aliyuncs.com" + }, + { + "region": "ap-southeast-1", + "endpoint": "dts.aliyuncs.com" + } + ], + "global_endpoint": "", + "regional_endpoint_pattern": "" + }, + { + "code": "emas", + "document_id": "", + "location_service_code": "emas", + "regional_endpoints": [ + { + "region": "cn-shanghai", + "endpoint": "mhub.cn-shanghai.aliyuncs.com" + }, + { + "region": "cn-hangzhou", + "endpoint": "mhub.cn-hangzhou.aliyuncs.com" + } + ], + "global_endpoint": "", + "regional_endpoint_pattern": "" + }, + { + "code": "dysmsapi", + "document_id": "", + "location_service_code": "dysmsapi", + "regional_endpoints": [ + { + "region": "ap-southeast-3", + "endpoint": "dysmsapi.ap-southeast-1.aliyuncs.com" + }, + { + "region": "cn-qingdao", + "endpoint": "dysmsapi.aliyuncs.com" + }, + { + "region": "cn-chengdu", + "endpoint": "dysmsapi.aliyuncs.com" + }, + { + "region": "me-east-1", + "endpoint": "dysmsapi.ap-southeast-1.aliyuncs.com" + }, + { + "region": "ap-southeast-5", + "endpoint": "dysmsapi.ap-southeast-1.aliyuncs.com" + }, + { + "region": "ap-southeast-2", + "endpoint": "dysmsapi.ap-southeast-1.aliyuncs.com" + }, + { + "region": "cn-zhangjiakou", + "endpoint": "dysmsapi.aliyuncs.com" + }, + { + "region": "cn-hongkong", + "endpoint": "dysmsapi.ap-southeast-1.aliyuncs.com" + }, + { + "region": "us-east-1", + "endpoint": "dysmsapi.ap-southeast-1.aliyuncs.com" + }, + { + "region": "cn-beijing", + "endpoint": "dysmsapi.aliyuncs.com" + }, + { + "region": "cn-hangzhou", + "endpoint": "dysmsapi.aliyuncs.com" + }, + { + "region": "ap-northeast-1", + "endpoint": "dysmsapi.ap-southeast-1.aliyuncs.com" + }, + { + "region": "ap-south-1", + "endpoint": "dysmsapi.ap-southeast-1.aliyuncs.com" + }, + { + "region": "ap-southeast-1", + "endpoint": "dysmsapi.ap-southeast-1.aliyuncs.com" + }, + { + "region": "us-west-1", + "endpoint": "dysmsapi.ap-southeast-1.aliyuncs.com" + }, + { + "region": "eu-central-1", + "endpoint": "dysmsapi.ap-southeast-1.aliyuncs.com" + }, + { + "region": "cn-shenzhen", + "endpoint": "dysmsapi.aliyuncs.com" + }, + { + "region": "cn-huhehaote", + "endpoint": "dysmsapi.aliyuncs.com" + }, + { + "region": "cn-shanghai", + "endpoint": "dysmsapi.aliyuncs.com" + } + ], + "global_endpoint": "", + "regional_endpoint_pattern": "" + }, + { + "code": "cloudwf", + "document_id": "58111", + "location_service_code": "cloudwf", + "regional_endpoints": null, + "global_endpoint": "cloudwf.aliyuncs.com", + "regional_endpoint_pattern": "" + }, + { + "code": "fc", + "document_id": "", + "location_service_code": "fc", + "regional_endpoints": [ + { + "region": "cn-beijing", + "endpoint": "cn-beijing.fc.aliyuncs.com" + }, + { + "region": "ap-southeast-2", + "endpoint": "ap-southeast-2.fc.aliyuncs.com" + }, + { + "region": "cn-huhehaote", + "endpoint": "cn-huhehaote.fc.aliyuncs.com" + }, + { + "region": "cn-shanghai", + "endpoint": "cn-shanghai.fc.aliyuncs.com" + }, + { + "region": "cn-hangzhou", + "endpoint": "cn-hangzhou.fc.aliyuncs.com" + }, + { + "region": "cn-shenzhen", + "endpoint": "cn-shenzhen.fc.aliyuncs.com" + } + ], + "global_endpoint": "", + "regional_endpoint_pattern": "" + }, + { + "code": "saf", + "document_id": "", + "location_service_code": "saf", + "regional_endpoints": [ + { + "region": "cn-hangzhou", + "endpoint": "saf.cn-shanghai.aliyuncs.com" + }, + { + "region": "cn-shanghai", + "endpoint": "saf.cn-shanghai.aliyuncs.com" + }, + { + "region": "cn-shenzhen", + "endpoint": "saf.cn-shenzhen.aliyuncs.com" + } + ], + "global_endpoint": "", + "regional_endpoint_pattern": "" + }, + { + "code": "rds", + "document_id": "26223", + "location_service_code": "rds", + "regional_endpoints": [ + { + "region": "ap-northeast-1", + "endpoint": "rds.ap-northeast-1.aliyuncs.com" + }, + { + "region": "ap-south-1", + "endpoint": "rds.ap-south-1.aliyuncs.com" + }, + { + "region": "cn-zhangjiakou", + "endpoint": "rds.cn-zhangjiakou.aliyuncs.com" + }, + { + "region": "cn-beijing", + "endpoint": "rds.aliyuncs.com" + }, + { + "region": "cn-hongkong", + "endpoint": "rds.aliyuncs.com" + }, + { + "region": "ap-southeast-1", + "endpoint": "rds.aliyuncs.com" + }, + { + "region": "eu-west-1", + "endpoint": "rds.eu-west-1.aliyuncs.com" + }, + { + "region": "us-east-1", + "endpoint": "rds.aliyuncs.com" + }, + { + "region": "ap-southeast-3", + "endpoint": "rds.ap-southeast-3.aliyuncs.com" + }, + { + "region": "ap-southeast-2", + "endpoint": "rds.ap-southeast-2.aliyuncs.com" + }, + { + "region": "cn-shanghai", + "endpoint": "rds.aliyuncs.com" + }, + { + "region": "cn-huhehaote", + "endpoint": "rds.cn-huhehaote.aliyuncs.com" + }, + { + "region": "ap-southeast-5", + "endpoint": "rds.ap-southeast-5.aliyuncs.com" + }, + { + "region": "eu-central-1", + "endpoint": "rds.eu-central-1.aliyuncs.com" + }, + { + "region": "cn-qingdao", + "endpoint": "rds.aliyuncs.com" + }, + { + "region": "me-east-1", + "endpoint": "rds.me-east-1.aliyuncs.com" + }, + { + "region": "cn-hangzhou", + "endpoint": "rds.aliyuncs.com" + }, + { + "region": "cn-shenzhen", + "endpoint": "rds.aliyuncs.com" + }, + { + "region": "us-west-1", + "endpoint": "rds.aliyuncs.com" + } + ], + "global_endpoint": "rds.aliyuncs.com", + "regional_endpoint_pattern": "" + }, + { + "code": "vpc", + "document_id": "34962", + "location_service_code": "vpc", + "regional_endpoints": [ + { + "region": "ap-south-1", + "endpoint": "vpc.ap-south-1.aliyuncs.com" + }, + { + "region": "cn-beijing", + "endpoint": "vpc.aliyuncs.com" + }, + { + "region": "cn-shanghai", + "endpoint": "vpc.aliyuncs.com" + }, + { + "region": "cn-shenzhen", + "endpoint": "vpc.aliyuncs.com" + }, + { + "region": "ap-southeast-1", + "endpoint": "vpc.aliyuncs.com" + }, + { + "region": "ap-southeast-2", + "endpoint": "vpc.ap-southeast-2.aliyuncs.com" + }, + { + "region": "ap-northeast-1", + "endpoint": "vpc.ap-northeast-1.aliyuncs.com" + }, + { + "region": "cn-qingdao", + "endpoint": "vpc.aliyuncs.com" + }, + { + "region": "cn-hangzhou", + "endpoint": "vpc.aliyuncs.com" + }, + { + "region": "cn-hongkong", + "endpoint": "vpc.aliyuncs.com" + }, + { + "region": "cn-huhehaote", + "endpoint": "vpc.cn-huhehaote.aliyuncs.com" + }, + { + "region": "me-east-1", + "endpoint": "vpc.me-east-1.aliyuncs.com" + }, + { + "region": "ap-southeast-5", + "endpoint": "vpc.ap-southeast-5.aliyuncs.com" + }, + { + "region": "ap-southeast-3", + "endpoint": "vpc.ap-southeast-3.aliyuncs.com" + }, + { + "region": "eu-central-1", + "endpoint": "vpc.eu-central-1.aliyuncs.com" + }, + { + "region": "cn-zhangjiakou", + "endpoint": "vpc.cn-zhangjiakou.aliyuncs.com" + }, + { + "region": "eu-west-1", + "endpoint": "vpc.eu-west-1.aliyuncs.com" + }, + { + "region": "us-west-1", + "endpoint": "vpc.aliyuncs.com" + }, + { + "region": "us-east-1", + "endpoint": "vpc.aliyuncs.com" + } + ], + "global_endpoint": "vpc.aliyuncs.com", + "regional_endpoint_pattern": "" + }, + { + "code": "gpdb", + "document_id": "", + "location_service_code": "gpdb", + "regional_endpoints": [ + { + "region": "ap-southeast-3", + "endpoint": "gpdb.ap-southeast-3.aliyuncs.com" + }, + { + "region": "cn-shanghai", + "endpoint": "gpdb.aliyuncs.com" + }, + { + "region": "ap-southeast-1", + "endpoint": "gpdb.aliyuncs.com" + }, + { + "region": "us-west-1", + "endpoint": "gpdb.aliyuncs.com" + }, + { + "region": "cn-huhehaote", + "endpoint": "gpdb.cn-huhehaote.aliyuncs.com" + }, + { + "region": "cn-shenzhen", + "endpoint": "gpdb.aliyuncs.com" + }, + { + "region": "cn-hangzhou", + "endpoint": "gpdb.aliyuncs.com" + }, + { + "region": "us-east-1", + "endpoint": "gpdb.aliyuncs.com" + }, + { + "region": "ap-southeast-5", + "endpoint": "gpdb.ap-southeast-5.aliyuncs.com" + }, + { + "region": "ap-southeast-2", + "endpoint": "gpdb.ap-southeast-2.aliyuncs.com" + }, + { + "region": "eu-central-1", + "endpoint": "gpdb.eu-central-1.aliyuncs.com" + }, + { + "region": "cn-zhangjiakou", + "endpoint": "gpdb.cn-zhangjiakou.aliyuncs.com" + }, + { + "region": "cn-beijing", + "endpoint": "gpdb.aliyuncs.com" + }, + { + "region": "ap-northeast-1", + "endpoint": "gpdb.ap-northeast-1.aliyuncs.com" + }, + { + "region": "eu-west-1", + "endpoint": "gpdb.eu-west-1.aliyuncs.com" + }, + { + "region": "ap-south-1", + "endpoint": "gpdb.ap-south-1.aliyuncs.com" + } + ], + "global_endpoint": "gpdb.aliyuncs.com", + "regional_endpoint_pattern": "" + }, + { + "code": "yunmarket", + "document_id": "", + "location_service_code": "yunmarket", + "regional_endpoints": [ + { + "region": "cn-hangzhou", + "endpoint": "market.aliyuncs.com" + } + ], + "global_endpoint": "", + "regional_endpoint_pattern": "" + }, + { + "code": "pvtz", + "document_id": "", + "location_service_code": "pvtz", + "regional_endpoints": [ + { + "region": "ap-southeast-1", + "endpoint": "pvtz.aliyuncs.com" + }, + { + "region": "cn-hangzhou", + "endpoint": "pvtz.aliyuncs.com" + } + ], + "global_endpoint": "", + "regional_endpoint_pattern": "" + }, + { + "code": "oss", + "document_id": "", + "location_service_code": "oss", + "regional_endpoints": [ + { + "region": "cn-beijing", + "endpoint": "oss-cn-beijing.aliyuncs.com" + }, + { + "region": "cn-hangzhou", + "endpoint": "oss-cn-hangzhou.aliyuncs.com" + }, + { + "region": "cn-shanghai", + "endpoint": "oss-cn-shanghai.aliyuncs.com" + }, + { + "region": "cn-hongkong", + "endpoint": "oss-cn-hongkong.aliyuncs.com" + }, + { + "region": "cn-shenzhen", + "endpoint": "oss-cn-shenzhen.aliyuncs.com" + }, + { + "region": "ap-southeast-1", + "endpoint": "oss-ap-southeast-1.aliyuncs.com" + }, + { + "region": "us-west-1", + "endpoint": "oss-us-west-1.aliyuncs.com" + }, + { + "region": "cn-qingdao", + "endpoint": "oss-cn-qingdao.aliyuncs.com" + } + ], + "global_endpoint": "", + "regional_endpoint_pattern": "" + }, + { + "code": "foas", + "document_id": "", + "location_service_code": "foas", + "regional_endpoints": [ + { + "region": "cn-qingdao", + "endpoint": "foas.cn-qingdao.aliyuncs.com" + }, + { + "region": "cn-beijing", + "endpoint": "foas.cn-beijing.aliyuncs.com" + }, + { + "region": "cn-zhangjiakou", + "endpoint": "foas.cn-zhangjiakou.aliyuncs.com" + }, + { + "region": "cn-hangzhou", + "endpoint": "foas.cn-hangzhou.aliyuncs.com" + }, + { + "region": "cn-shanghai", + "endpoint": "foas.cn-shanghai.aliyuncs.com" + }, + { + "region": "cn-shenzhen", + "endpoint": "foas.cn-shenzhen.aliyuncs.com" + }, + { + "region": "ap-northeast-1", + "endpoint": "foas.ap-northeast-1.aliyuncs.com" + } + ], + "global_endpoint": "", + "regional_endpoint_pattern": "" + }, + { + "code": "ddos", + "document_id": "", + "location_service_code": "ddos", + "regional_endpoints": [ + { + "region": "cn-hangzhou", + "endpoint": "ddospro.cn-hangzhou.aliyuncs.com" + }, + { + "region": "cn-hongkong", + "endpoint": "ddospro.cn-hongkong.aliyuncs.com" + } + ], + "global_endpoint": "", + "regional_endpoint_pattern": "" + }, + { + "code": "cbn", + "document_id": "", + "location_service_code": "cbn", + "regional_endpoints": [ + { + "region": "ap-southeast-1", + "endpoint": "cbn.aliyuncs.com" + }, + { + "region": "ap-northeast-1", + "endpoint": "cbn.aliyuncs.com" + }, + { + "region": "cn-qingdao", + "endpoint": "cbn.aliyuncs.com" + }, + { + "region": "cn-hongkong", + "endpoint": "cbn.aliyuncs.com" + }, + { + "region": "ap-southeast-2", + "endpoint": "cbn.aliyuncs.com" + }, + { + "region": "us-west-1", + "endpoint": "cbn.aliyuncs.com" + }, + { + "region": "cn-beijing", + "endpoint": "cbn.aliyuncs.com" + }, + { + "region": "cn-shenzhen", + "endpoint": "cbn.aliyuncs.com" + }, + { + "region": "ap-southeast-3", + "endpoint": "cbn.aliyuncs.com" + }, + { + "region": "ap-southeast-5", + "endpoint": "cbn.aliyuncs.com" + }, + { + "region": "eu-west-1", + "endpoint": "cbn.aliyuncs.com" + }, + { + "region": "cn-hangzhou", + "endpoint": "cbn.aliyuncs.com" + }, + { + "region": "cn-huhehaote", + "endpoint": "cbn.aliyuncs.com" + }, + { + "region": "cn-shanghai", + "endpoint": "cbn.aliyuncs.com" + }, + { + "region": "us-east-1", + "endpoint": "cbn.aliyuncs.com" + }, + { + "region": "eu-central-1", + "endpoint": "cbn.aliyuncs.com" + }, + { + "region": "me-east-1", + "endpoint": "cbn.aliyuncs.com" + }, + { + "region": "ap-south-1", + "endpoint": "cbn.aliyuncs.com" + }, + { + "region": "cn-zhangjiakou", + "endpoint": "cbn.aliyuncs.com" + } + ], + "global_endpoint": "cbn.aliyuncs.com", + "regional_endpoint_pattern": "" + }, + { + "code": "nlp", + "document_id": "", + "location_service_code": "nlp", + "regional_endpoints": [ + { + "region": "cn-shanghai", + "endpoint": "nlp.cn-shanghai.aliyuncs.com" + } + ], + "global_endpoint": "", + "regional_endpoint_pattern": "" + }, + { + "code": "hsm", + "document_id": "", + "location_service_code": "hsm", + "regional_endpoints": [ + { + "region": "cn-beijing", + "endpoint": "hsm.aliyuncs.com" + }, + { + "region": "cn-hangzhou", + "endpoint": "hsm.aliyuncs.com" + }, + { + "region": "cn-shanghai", + "endpoint": "hsm.aliyuncs.com" + }, + { + "region": "cn-hongkong", + "endpoint": "hsm.aliyuncs.com" + }, + { + "region": "cn-shenzhen", + "endpoint": "hsm.aliyuncs.com" + }, + { + "region": "ap-southeast-1", + "endpoint": "hsm.aliyuncs.com" + } + ], + "global_endpoint": "", + "regional_endpoint_pattern": "" + }, + { + "code": "ons", + "document_id": "44416", + "location_service_code": "ons", + "regional_endpoints": [ + { + "region": "ap-southeast-1", + "endpoint": "ons.ap-southeast-1.aliyuncs.com" + }, + { + "region": "cn-huhehaote", + "endpoint": "ons.cn-huhehaote.aliyuncs.com" + }, + { + "region": "us-east-1", + "endpoint": "ons.us-east-1.aliyuncs.com" + }, + { + "region": "cn-hongkong", + "endpoint": "ons.cn-hongkong.aliyuncs.com" + }, + { + "region": "cn-shenzhen", + "endpoint": "ons.cn-shenzhen.aliyuncs.com" + }, + { + "region": "ap-southeast-3", + "endpoint": "ons.ap-southeast-3.aliyuncs.com" + }, + { + "region": "cn-hangzhou", + "endpoint": "ons.cn-hangzhou.aliyuncs.com" + }, + { + "region": "cn-qingdao", + "endpoint": "ons.cn-qingdao.aliyuncs.com" + }, + { + "region": "cn-zhangjiakou", + "endpoint": "ons.cn-zhangjiakou.aliyuncs.com" + }, + { + "region": "me-east-1", + "endpoint": "ons.me-east-1.aliyuncs.com" + }, + { + "region": "ap-northeast-1", + "endpoint": "ons.ap-northeast-1.aliyuncs.com" + }, + { + "region": "ap-southeast-2", + "endpoint": "ons.ap-southeast-2.aliyuncs.com" + }, + { + "region": "ap-south-1", + "endpoint": "ons.cn-hangzhou.aliyuncs.com" + }, + { + "region": "eu-central-1", + "endpoint": "ons.eu-central-1.aliyuncs.com" + }, + { + "region": "eu-west-1", + "endpoint": "ons.eu-west-1.aliyuncs.com" + }, + { + "region": "us-west-1", + "endpoint": "ons.us-west-1.aliyuncs.com" + }, + { + "region": "cn-beijing", + "endpoint": "ons.cn-beijing.aliyuncs.com" + }, + { + "region": "cn-shanghai", + "endpoint": "ons.cn-shanghai.aliyuncs.com" + } + ], + "global_endpoint": "", + "regional_endpoint_pattern": "" + }, + { + "code": "kms", + "document_id": "", + "location_service_code": "kms", + "regional_endpoints": [ + { + "region": "cn-hongkong", + "endpoint": "kms.cn-hongkong.aliyuncs.com" + }, + { + "region": "cn-hangzhou", + "endpoint": "kms.cn-hangzhou.aliyuncs.com" + }, + { + "region": "ap-south-1", + "endpoint": "kms.ap-south-1.aliyuncs.com" + }, + { + "region": "cn-qingdao", + "endpoint": "kms.cn-qingdao.aliyuncs.com" + }, + { + "region": "eu-west-1", + "endpoint": "kms.eu-west-1.aliyuncs.com" + }, + { + "region": "us-east-1", + "endpoint": "kms.us-east-1.aliyuncs.com" + }, + { + "region": "cn-beijing", + "endpoint": "kms.cn-beijing.aliyuncs.com" + }, + { + "region": "cn-zhangjiakou", + "endpoint": "kms.cn-zhangjiakou.aliyuncs.com" + }, + { + "region": "cn-shanghai", + "endpoint": "kms.cn-shanghai.aliyuncs.com" + }, + { + "region": "ap-southeast-5", + "endpoint": "kms.ap-southeast-5.aliyuncs.com" + }, + { + "region": "cn-huhehaote", + "endpoint": "kms.cn-huhehaote.aliyuncs.com" + }, + { + "region": "me-east-1", + "endpoint": "kms.me-east-1.aliyuncs.com" + }, + { + "region": "cn-shenzhen", + "endpoint": "kms.cn-shenzhen.aliyuncs.com" + }, + { + "region": "ap-southeast-3", + "endpoint": "kms.ap-southeast-3.aliyuncs.com" + }, + { + "region": "us-west-1", + "endpoint": "kms.us-west-1.aliyuncs.com" + }, + { + "region": "ap-southeast-2", + "endpoint": "kms.ap-southeast-2.aliyuncs.com" + }, + { + "region": "ap-southeast-1", + "endpoint": "kms.ap-southeast-1.aliyuncs.com" + }, + { + "region": "eu-central-1", + "endpoint": "kms.eu-central-1.aliyuncs.com" + }, + { + "region": "ap-northeast-1", + "endpoint": "kms.ap-northeast-1.aliyuncs.com" + } + ], + "global_endpoint": "", + "regional_endpoint_pattern": "" + }, + { + "code": "cps", + "document_id": "", + "location_service_code": "cps", + "regional_endpoints": [ + { + "region": "cn-hangzhou", + "endpoint": "cloudpush.aliyuncs.com" + } + ], + "global_endpoint": "", + "regional_endpoint_pattern": "" + }, + { + "code": "ensdisk", + "document_id": "", + "location_service_code": "ensdisk", + "regional_endpoints": [ + { + "region": "cn-hangzhou", + "endpoint": "ens.aliyuncs.com" + } + ], + "global_endpoint": "", + "regional_endpoint_pattern": "" + }, + { + "code": "cloudapi", + "document_id": "43590", + "location_service_code": "apigateway", + "regional_endpoints": [ + { + "region": "ap-southeast-2", + "endpoint": "apigateway.ap-southeast-2.aliyuncs.com" + }, + { + "region": "ap-south-1", + "endpoint": "apigateway.ap-south-1.aliyuncs.com" + }, + { + "region": "us-east-1", + "endpoint": "apigateway.us-east-1.aliyuncs.com" + }, + { + "region": "me-east-1", + "endpoint": "apigateway.me-east-1.aliyuncs.com" + }, + { + "region": "cn-qingdao", + "endpoint": "apigateway.cn-qingdao.aliyuncs.com" + }, + { + "region": "cn-beijing", + "endpoint": "apigateway.cn-beijing.aliyuncs.com" + }, + { + "region": "ap-southeast-5", + "endpoint": "apigateway.ap-southeast-5.aliyuncs.com" + }, + { + "region": "ap-southeast-3", + "endpoint": "apigateway.ap-southeast-3.aliyuncs.com" + }, + { + "region": "cn-zhangjiakou", + "endpoint": "apigateway.cn-zhangjiakou.aliyuncs.com" + }, + { + "region": "cn-huhehaote", + "endpoint": "apigateway.cn-huhehaote.aliyuncs.com" + }, + { + "region": "ap-southeast-1", + "endpoint": "apigateway.ap-southeast-1.aliyuncs.com" + }, + { + "region": "eu-central-1", + "endpoint": "apigateway.eu-central-1.aliyuncs.com" + }, + { + "region": "cn-hangzhou", + "endpoint": "apigateway.cn-hangzhou.aliyuncs.com" + }, + { + "region": "us-west-1", + "endpoint": "apigateway.us-west-1.aliyuncs.com" + }, + { + "region": "cn-shenzhen", + "endpoint": "apigateway.cn-shenzhen.aliyuncs.com" + }, + { + "region": "eu-west-1", + "endpoint": "apigateway.eu-west-1.aliyuncs.com" + }, + { + "region": "cn-shanghai", + "endpoint": "apigateway.cn-shanghai.aliyuncs.com" + }, + { + "region": "ap-northeast-1", + "endpoint": "apigateway.ap-northeast-1.aliyuncs.com" + }, + { + "region": "cn-hongkong", + "endpoint": "apigateway.cn-hongkong.aliyuncs.com" + } + ], + "global_endpoint": "", + "regional_endpoint_pattern": "apigateway.[RegionId].aliyuncs.com" + }, + { + "code": "eci", + "document_id": "", + "location_service_code": "eci", + "regional_endpoints": [ + { + "region": "cn-shanghai", + "endpoint": "eci.aliyuncs.com" + }, + { + "region": "cn-hangzhou", + "endpoint": "eci.aliyuncs.com" + }, + { + "region": "us-west-1", + "endpoint": "eci.aliyuncs.com" + }, + { + "region": "cn-beijing", + "endpoint": "eci.aliyuncs.com" + }, + { + "region": "cn-shenzhen", + "endpoint": "eci.aliyuncs.com" + }, + { + "region": "ap-southeast-1", + "endpoint": "eci.aliyuncs.com" + } + ], + "global_endpoint": "", + "regional_endpoint_pattern": "" + }, + { + "code": "onsvip", + "document_id": "", + "location_service_code": "onsvip", + "regional_endpoints": [ + { + "region": "cn-beijing", + "endpoint": "ons.cn-beijing.aliyuncs.com" + }, + { + "region": "cn-hangzhou", + "endpoint": "ons.cn-hangzhou.aliyuncs.com" + }, + { + "region": "cn-shanghai", + "endpoint": "ons.cn-shanghai.aliyuncs.com" + }, + { + "region": "cn-shenzhen", + "endpoint": "ons.cn-shenzhen.aliyuncs.com" + }, + { + "region": "ap-southeast-1", + "endpoint": "ons.ap-southeast-1.aliyuncs.com" + }, + { + "region": "cn-qingdao", + "endpoint": "ons.cn-qingdao.aliyuncs.com" + } + ], + "global_endpoint": "", + "regional_endpoint_pattern": "" + }, + { + "code": "linkwan", + "document_id": "", + "location_service_code": "linkwan", + "regional_endpoints": [ + { + "region": "cn-hangzhou", + "endpoint": "linkwan.cn-hangzhou.aliyuncs.com" + }, + { + "region": "cn-shanghai", + "endpoint": "linkwan.cn-shanghai.aliyuncs.com" + } + ], + "global_endpoint": "", + "regional_endpoint_pattern": "" + }, + { + "code": "ddosdip", + "document_id": "", + "location_service_code": "ddosdip", + "regional_endpoints": [ + { + "region": "ap-southeast-1", + "endpoint": "ddosdip.ap-southeast-1.aliyuncs.com" + } + ], + "global_endpoint": "", + "regional_endpoint_pattern": "" + }, + { + "code": "batchcompute", + "document_id": "44717", + "location_service_code": "batchcompute", + "regional_endpoints": [ + { + "region": "us-west-1", + "endpoint": "batchcompute.us-west-1.aliyuncs.com" + }, + { + "region": "cn-qingdao", + "endpoint": "batchcompute.cn-qingdao.aliyuncs.com" + }, + { + "region": "cn-zhangjiakou", + "endpoint": "batchcompute.cn-zhangjiakou.aliyuncs.com" + }, + { + "region": "cn-shenzhen", + "endpoint": "batchcompute.cn-shenzhen.aliyuncs.com" + }, + { + "region": "cn-huhehaote", + "endpoint": "batchcompute.cn-huhehaote.aliyuncs.com" + }, + { + "region": "cn-beijing", + "endpoint": "batchcompute.cn-beijing.aliyuncs.com" + }, + { + "region": "cn-hangzhou", + "endpoint": "batchcompute.cn-hangzhou.aliyuncs.com" + }, + { + "region": "cn-shanghai", + "endpoint": "batchcompute.cn-shanghai.aliyuncs.com" + }, + { + "region": "ap-southeast-1", + "endpoint": "batchcompute.ap-southeast-1.aliyuncs.com" + } + ], + "global_endpoint": "", + "regional_endpoint_pattern": "batchcompute.[RegionId].aliyuncs.com" + }, + { + "code": "aegis", + "document_id": "28449", + "location_service_code": "vipaegis", + "regional_endpoints": [ + { + "region": "cn-hangzhou", + "endpoint": "aegis.cn-hangzhou.aliyuncs.com" + }, + { + "region": "ap-southeast-3", + "endpoint": "aegis.ap-southeast-3.aliyuncs.com" + } + ], + "global_endpoint": "aegis.cn-hangzhou.aliyuncs.com", + "regional_endpoint_pattern": "" + }, + { + "code": "arms", + "document_id": "42924", + "location_service_code": "arms", + "regional_endpoints": [ + { + "region": "cn-hongkong", + "endpoint": "arms.cn-hongkong.aliyuncs.com" + }, + { + "region": "ap-southeast-1", + "endpoint": "arms.ap-southeast-1.aliyuncs.com" + }, + { + "region": "cn-shenzhen", + "endpoint": "arms.cn-shenzhen.aliyuncs.com" + }, + { + "region": "cn-qingdao", + "endpoint": "arms.cn-qingdao.aliyuncs.com" + }, + { + "region": "cn-beijing", + "endpoint": "arms.cn-beijing.aliyuncs.com" + }, + { + "region": "cn-hangzhou", + "endpoint": "arms.cn-hangzhou.aliyuncs.com" + }, + { + "region": "cn-shanghai", + "endpoint": "arms.cn-shanghai.aliyuncs.com" + } + ], + "global_endpoint": "", + "regional_endpoint_pattern": "arms.[RegionId].aliyuncs.com" + }, + { + "code": "live", + "document_id": "48207", + "location_service_code": "live", + "regional_endpoints": [ + { + "region": "cn-hangzhou", + "endpoint": "live.aliyuncs.com" + }, + { + "region": "ap-northeast-1", + "endpoint": "live.aliyuncs.com" + }, + { + "region": "cn-shanghai", + "endpoint": "live.aliyuncs.com" + }, + { + "region": "ap-southeast-1", + "endpoint": "live.aliyuncs.com" + }, + { + "region": "eu-central-1", + "endpoint": "live.aliyuncs.com" + }, + { + "region": "cn-shenzhen", + "endpoint": "live.aliyuncs.com" + }, + { + "region": "cn-beijing", + "endpoint": "live.aliyuncs.com" + } + ], + "global_endpoint": "live.aliyuncs.com", + "regional_endpoint_pattern": "" + }, + { + "code": "alimt", + "document_id": "", + "location_service_code": "alimt", + "regional_endpoints": [ + { + "region": "cn-hangzhou", + "endpoint": "mt.cn-hangzhou.aliyuncs.com" + } + ], + "global_endpoint": "", + "regional_endpoint_pattern": "" + }, + { + "code": "actiontrail", + "document_id": "", + "location_service_code": "actiontrail", + "regional_endpoints": [ + { + "region": "cn-shanghai", + "endpoint": "actiontrail.cn-shanghai.aliyuncs.com" + }, + { + "region": "cn-qingdao", + "endpoint": "actiontrail.cn-qingdao.aliyuncs.com" + }, + { + "region": "us-east-1", + "endpoint": "actiontrail.us-east-1.aliyuncs.com" + }, + { + "region": "ap-southeast-2", + "endpoint": "actiontrail.ap-southeast-2.aliyuncs.com" + }, + { + "region": "ap-southeast-3", + "endpoint": "actiontrail.ap-southeast-3.aliyuncs.com" + }, + { + "region": "ap-southeast-5", + "endpoint": "actiontrail.ap-southeast-5.aliyuncs.com" + }, + { + "region": "ap-south-1", + "endpoint": "actiontrail.ap-south-1.aliyuncs.com" + }, + { + "region": "me-east-1", + "endpoint": "actiontrail.me-east-1.aliyuncs.com" + }, + { + "region": "cn-hongkong", + "endpoint": "actiontrail.cn-hongkong.aliyuncs.com" + }, + { + "region": "cn-shenzhen", + "endpoint": "actiontrail.cn-shenzhen.aliyuncs.com" + }, + { + "region": "cn-hangzhou", + "endpoint": "actiontrail.cn-hangzhou.aliyuncs.com" + }, + { + "region": "eu-west-1", + "endpoint": "actiontrail.eu-west-1.aliyuncs.com" + }, + { + "region": "cn-huhehaote", + "endpoint": "actiontrail.cn-huhehaote.aliyuncs.com" + }, + { + "region": "ap-northeast-1", + "endpoint": "actiontrail.ap-northeast-1.aliyuncs.com" + }, + { + "region": "us-west-1", + "endpoint": "actiontrail.us-west-1.aliyuncs.com" + }, + { + "region": "eu-central-1", + "endpoint": "actiontrail.eu-central-1.aliyuncs.com" + }, + { + "region": "cn-zhangjiakou", + "endpoint": "actiontrail.cn-zhangjiakou.aliyuncs.com" + }, + { + "region": "cn-beijing", + "endpoint": "actiontrail.cn-beijing.aliyuncs.com" + }, + { + "region": "ap-southeast-1", + "endpoint": "actiontrail.ap-southeast-1.aliyuncs.com" + } + ], + "global_endpoint": "", + "regional_endpoint_pattern": "" + }, + { + "code": "smartag", + "document_id": "", + "location_service_code": "smartag", + "regional_endpoints": [ + { + "region": "ap-southeast-3", + "endpoint": "smartag.ap-southeast-3.aliyuncs.com" + }, + { + "region": "ap-southeast-5", + "endpoint": "smartag.ap-southeast-5.aliyuncs.com" + }, + { + "region": "eu-central-1", + "endpoint": "smartag.eu-central-1.aliyuncs.com" + }, + { + "region": "cn-shanghai", + "endpoint": "smartag.cn-shanghai.aliyuncs.com" + }, + { + "region": "cn-hongkong", + "endpoint": "smartag.cn-hongkong.aliyuncs.com" + }, + { + "region": "ap-southeast-1", + "endpoint": "smartag.ap-southeast-1.aliyuncs.com" + }, + { + "region": "ap-southeast-2", + "endpoint": "smartag.ap-southeast-2.aliyuncs.com" + } + ], + "global_endpoint": "", + "regional_endpoint_pattern": "" + }, + { + "code": "vod", + "document_id": "60574", + "location_service_code": "vod", + "regional_endpoints": [ + { + "region": "cn-shanghai", + "endpoint": "vod.cn-shanghai.aliyuncs.com" + }, + { + "region": "cn-hangzhou", + "endpoint": "vod.cn-shanghai.aliyuncs.com" + }, + { + "region": "cn-shenzhen", + "endpoint": "vod.cn-shanghai.aliyuncs.com" + }, + { + "region": "cn-beijing", + "endpoint": "vod.cn-shanghai.aliyuncs.com" + }, + { + "region": "ap-southeast-1", + "endpoint": "vod.ap-southeast-1.aliyuncs.com" + }, + { + "region": "eu-central-1", + "endpoint": "vod.eu-central-1.aliyuncs.com" + } + ], + "global_endpoint": "", + "regional_endpoint_pattern": "" + }, + { + "code": "domain", + "document_id": "42875", + "location_service_code": "domain", + "regional_endpoints": [ + { + "region": "ap-southeast-1", + "endpoint": "domain-intl.aliyuncs.com" + }, + { + "region": "cn-hangzhou", + "endpoint": "domain.aliyuncs.com" + } + ], + "global_endpoint": "domain.aliyuncs.com", + "regional_endpoint_pattern": "domain.aliyuncs.com" + }, + { + "code": "ros", + "document_id": "28899", + "location_service_code": "ros", + "regional_endpoints": [ + { + "region": "cn-hangzhou", + "endpoint": "ros.aliyuncs.com" + } + ], + "global_endpoint": "ros.aliyuncs.com", + "regional_endpoint_pattern": "" + }, + { + "code": "cloudphoto", + "document_id": "59902", + "location_service_code": "cloudphoto", + "regional_endpoints": [ + { + "region": "cn-shanghai", + "endpoint": "cloudphoto.cn-shanghai.aliyuncs.com" + } + ], + "global_endpoint": "", + "regional_endpoint_pattern": "cloudphoto.[RegionId].aliyuncs.com" + }, + { + "code": "rtc", + "document_id": "", + "location_service_code": "rtc", + "regional_endpoints": [ + { + "region": "cn-hangzhou", + "endpoint": "rtc.aliyuncs.com" + } + ], + "global_endpoint": "", + "regional_endpoint_pattern": "" + }, + { + "code": "odpsmayi", + "document_id": "", + "location_service_code": "odpsmayi", + "regional_endpoints": [ + { + "region": "cn-shanghai", + "endpoint": "bsb.cloud.alipay.com" + }, + { + "region": "ap-southeast-1", + "endpoint": "bsb.cloud.alipay.com" + } + ], + "global_endpoint": "", + "regional_endpoint_pattern": "" + }, + { + "code": "ims", + "document_id": "", + "location_service_code": "ims", + "regional_endpoints": [ + { + "region": "cn-hangzhou", + "endpoint": "ims.aliyuncs.com" + } + ], + "global_endpoint": "", + "regional_endpoint_pattern": "" + }, + { + "code": "csb", + "document_id": "64837", + "location_service_code": "csb", + "regional_endpoints": [ + { + "region": "cn-hangzhou", + "endpoint": "csb.cn-hangzhou.aliyuncs.com" + }, + { + "region": "cn-beijing", + "endpoint": "csb.cn-beijing.aliyuncs.com" + } + ], + "global_endpoint": "", + "regional_endpoint_pattern": "csb.[RegionId].aliyuncs.com" + }, + { + "code": "cds", + "document_id": "62887", + "location_service_code": "codepipeline", + "regional_endpoints": [ + { + "region": "cn-beijing", + "endpoint": "cds.cn-beijing.aliyuncs.com" + } + ], + "global_endpoint": "cds.cn-beijing.aliyuncs.com", + "regional_endpoint_pattern": "" + }, + { + "code": "ddosbgp", + "document_id": "", + "location_service_code": "ddosbgp", + "regional_endpoints": [ + { + "region": "cn-huhehaote", + "endpoint": "ddosbgp.cn-hangzhou.aliyuncs.com" + }, + { + "region": "cn-beijing", + "endpoint": "ddosbgp.cn-hangzhou.aliyuncs.com" + }, + { + "region": "cn-zhangjiakou", + "endpoint": "ddosbgp.cn-hangzhou.aliyuncs.com" + }, + { + "region": "cn-hongkong", + "endpoint": "ddosbgp.cn-hongkong.aliyuncs.com" + }, + { + "region": "cn-shenzhen", + "endpoint": "ddosbgp.cn-hangzhou.aliyuncs.com" + }, + { + "region": "us-west-1", + "endpoint": "ddosbgp.us-west-1.aliyuncs.com" + }, + { + "region": "cn-qingdao", + "endpoint": "ddosbgp.cn-hangzhou.aliyuncs.com" + }, + { + "region": "cn-hangzhou", + "endpoint": "ddosbgp.cn-hangzhou.aliyuncs.com" + }, + { + "region": "cn-shanghai", + "endpoint": "ddosbgp.cn-hangzhou.aliyuncs.com" + } + ], + "global_endpoint": "", + "regional_endpoint_pattern": "" + }, + { + "code": "dybaseapi", + "document_id": "", + "location_service_code": "dybaseapi", + "regional_endpoints": [ + { + "region": "cn-beijing", + "endpoint": "dybaseapi.aliyuncs.com" + }, + { + "region": "cn-chengdu", + "endpoint": "dybaseapi.aliyuncs.com" + }, + { + "region": "ap-southeast-3", + "endpoint": "dybaseapi.ap-southeast-1.aliyuncs.com" + }, + { + "region": "ap-southeast-1", + "endpoint": "dybaseapi.ap-southeast-1.aliyuncs.com" + }, + { + "region": "us-west-1", + "endpoint": "dybaseapi.ap-southeast-1.aliyuncs.com" + }, + { + "region": "cn-hangzhou", + "endpoint": "dybaseapi.aliyuncs.com" + }, + { + "region": "cn-zhangjiakou", + "endpoint": "dybaseapi.aliyuncs.com" + }, + { + "region": "me-east-1", + "endpoint": "dybaseapi.ap-southeast-1.aliyuncs.com" + }, + { + "region": "us-east-1", + "endpoint": "dybaseapi.ap-southeast-1.aliyuncs.com" + }, + { + "region": "ap-northeast-1", + "endpoint": "dybaseapi.ap-southeast-1.aliyuncs.com" + }, + { + "region": "ap-southeast-5", + "endpoint": "dybaseapi.ap-southeast-1.aliyuncs.com" + }, + { + "region": "cn-shenzhen", + "endpoint": "dybaseapi.aliyuncs.com" + }, + { + "region": "cn-huhehaote", + "endpoint": "dybaseapi.aliyuncs.com" + }, + { + "region": "cn-shanghai", + "endpoint": "dybaseapi.aliyuncs.com" + }, + { + "region": "eu-central-1", + "endpoint": "dybaseapi.ap-southeast-1.aliyuncs.com" + }, + { + "region": "cn-qingdao", + "endpoint": "dybaseapi.aliyuncs.com" + }, + { + "region": "cn-hongkong", + "endpoint": "dybaseapi.ap-southeast-1.aliyuncs.com" + }, + { + "region": "ap-southeast-2", + "endpoint": "dybaseapi.ap-southeast-1.aliyuncs.com" + }, + { + "region": "ap-south-1", + "endpoint": "dybaseapi.ap-southeast-1.aliyuncs.com" + } + ], + "global_endpoint": "", + "regional_endpoint_pattern": "" + }, + { + "code": "ecs", + "document_id": "25484", + "location_service_code": "ecs", + "regional_endpoints": [ + { + "region": "cn-huhehaote", + "endpoint": "ecs.cn-huhehaote.aliyuncs.com" + }, + { + "region": "ap-northeast-1", + "endpoint": "ecs.ap-northeast-1.aliyuncs.com" + }, + { + "region": "ap-southeast-2", + "endpoint": "ecs.ap-southeast-2.aliyuncs.com" + }, + { + "region": "ap-south-1", + "endpoint": "ecs.ap-south-1.aliyuncs.com" + }, + { + "region": "cn-hangzhou", + "endpoint": "ecs-cn-hangzhou.aliyuncs.com" + }, + { + "region": "cn-shenzhen", + "endpoint": "ecs-cn-hangzhou.aliyuncs.com" + }, + { + "region": "ap-southeast-3", + "endpoint": "ecs.ap-southeast-3.aliyuncs.com" + }, + { + "region": "eu-central-1", + "endpoint": "ecs.eu-central-1.aliyuncs.com" + }, + { + "region": "cn-zhangjiakou", + "endpoint": "ecs.cn-zhangjiakou.aliyuncs.com" + }, + { + "region": "cn-hongkong", + "endpoint": "ecs-cn-hangzhou.aliyuncs.com" + }, + { + "region": "eu-west-1", + "endpoint": "ecs.eu-west-1.aliyuncs.com" + }, + { + "region": "me-east-1", + "endpoint": "ecs.me-east-1.aliyuncs.com" + }, + { + "region": "cn-qingdao", + "endpoint": "ecs-cn-hangzhou.aliyuncs.com" + }, + { + "region": "cn-shanghai", + "endpoint": "ecs-cn-hangzhou.aliyuncs.com" + }, + { + "region": "us-west-1", + "endpoint": "ecs-cn-hangzhou.aliyuncs.com" + }, + { + "region": "us-east-1", + "endpoint": "ecs-cn-hangzhou.aliyuncs.com" + }, + { + "region": "ap-southeast-5", + "endpoint": "ecs.ap-southeast-5.aliyuncs.com" + }, + { + "region": "cn-beijing", + "endpoint": "ecs-cn-hangzhou.aliyuncs.com" + }, + { + "region": "ap-southeast-1", + "endpoint": "ecs-cn-hangzhou.aliyuncs.com" + } + ], + "global_endpoint": "ecs-cn-hangzhou.aliyuncs.com", + "regional_endpoint_pattern": "" + }, + { + "code": "ccc", + "document_id": "63027", + "location_service_code": "ccc", + "regional_endpoints": [ + { + "region": "cn-hangzhou", + "endpoint": "ccc.cn-hangzhou.aliyuncs.com" + }, + { + "region": "cn-shanghai", + "endpoint": "ccc.cn-shanghai.aliyuncs.com" + } + ], + "global_endpoint": "", + "regional_endpoint_pattern": "ccc.[RegionId].aliyuncs.com" + }, + { + "code": "cs", + "document_id": "26043", + "location_service_code": "cs", + "regional_endpoints": null, + "global_endpoint": "cs.aliyuncs.com", + "regional_endpoint_pattern": "" + }, + { + "code": "drdspre", + "document_id": "", + "location_service_code": "drdspre", + "regional_endpoints": [ + { + "region": "cn-hangzhou", + "endpoint": "drds.cn-hangzhou.aliyuncs.com" + }, + { + "region": "cn-shanghai", + "endpoint": "drds.cn-shanghai.aliyuncs.com" + }, + { + "region": "cn-shenzhen", + "endpoint": "drds.cn-shenzhen.aliyuncs.com" + }, + { + "region": "cn-hongkong", + "endpoint": "drds.cn-hangzhou.aliyuncs.com" + }, + { + "region": "ap-southeast-1", + "endpoint": "drds.ap-southeast-1.aliyuncs.com" + }, + { + "region": "cn-qingdao", + "endpoint": "drds.cn-qingdao.aliyuncs.com" + }, + { + "region": "cn-beijing", + "endpoint": "drds.cn-beijing.aliyuncs.com" + } + ], + "global_endpoint": "", + "regional_endpoint_pattern": "" + }, + { + "code": "dcdn", + "document_id": "", + "location_service_code": "dcdn", + "regional_endpoints": [ + { + "region": "cn-hangzhou", + "endpoint": "dcdn.aliyuncs.com" + }, + { + "region": "ap-southeast-1", + "endpoint": "dcdn.aliyuncs.com" + } + ], + "global_endpoint": "", + "regional_endpoint_pattern": "" + }, + { + "code": "linkedmall", + "document_id": "", + "location_service_code": "linkedmall", + "regional_endpoints": [ + { + "region": "cn-hangzhou", + "endpoint": "linkedmall.aliyuncs.com" + }, + { + "region": "cn-shanghai", + "endpoint": "linkedmall.aliyuncs.com" + } + ], + "global_endpoint": "", + "regional_endpoint_pattern": "" + }, + { + "code": "trademark", + "document_id": "", + "location_service_code": "trademark", + "regional_endpoints": [ + { + "region": "cn-hangzhou", + "endpoint": "trademark.aliyuncs.com" + } + ], + "global_endpoint": "", + "regional_endpoint_pattern": "" + }, + { + "code": "openanalytics", + "document_id": "", + "location_service_code": "openanalytics", + "regional_endpoints": [ + { + "region": "cn-shenzhen", + "endpoint": "openanalytics.cn-shenzhen.aliyuncs.com" + }, + { + "region": "eu-west-1", + "endpoint": "openanalytics.eu-west-1.aliyuncs.com" + }, + { + "region": "cn-beijing", + "endpoint": "openanalytics.cn-beijing.aliyuncs.com" + }, + { + "region": "cn-hangzhou", + "endpoint": "openanalytics.cn-hangzhou.aliyuncs.com" + }, + { + "region": "cn-shanghai", + "endpoint": "openanalytics.cn-shanghai.aliyuncs.com" + }, + { + "region": "ap-southeast-1", + "endpoint": "openanalytics.ap-southeast-1.aliyuncs.com" + }, + { + "region": "ap-southeast-3", + "endpoint": "openanalytics.ap-southeast-3.aliyuncs.com" + }, + { + "region": "cn-zhangjiakou", + "endpoint": "openanalytics.cn-zhangjiakou.aliyuncs.com" + } + ], + "global_endpoint": "", + "regional_endpoint_pattern": "" + }, + { + "code": "sts", + "document_id": "28756", + "location_service_code": "sts", + "regional_endpoints": null, + "global_endpoint": "sts.aliyuncs.com", + "regional_endpoint_pattern": "" + }, + { + "code": "waf", + "document_id": "62847", + "location_service_code": "waf", + "regional_endpoints": [ + { + "region": "cn-hangzhou", + "endpoint": "wafopenapi.cn-hangzhou.aliyuncs.com" + } + ], + "global_endpoint": "", + "regional_endpoint_pattern": "" + }, + { + "code": "ots", + "document_id": "", + "location_service_code": "ots", + "regional_endpoints": [ + { + "region": "me-east-1", + "endpoint": "ots.me-east-1.aliyuncs.com" + }, + { + "region": "ap-southeast-5", + "endpoint": "ots.ap-southeast-5.aliyuncs.com" + }, + { + "region": "eu-west-1", + "endpoint": "ots.eu-west-1.aliyuncs.com" + }, + { + "region": "cn-huhehaote", + "endpoint": "ots.cn-huhehaote.aliyuncs.com" + }, + { + "region": "cn-beijing", + "endpoint": "ots.cn-beijing.aliyuncs.com" + }, + { + "region": "ap-southeast-2", + "endpoint": "ots.ap-southeast-2.aliyuncs.com" + }, + { + "region": "us-west-1", + "endpoint": "ots.us-west-1.aliyuncs.com" + }, + { + "region": "us-east-1", + "endpoint": "ots.us-east-1.aliyuncs.com" + }, + { + "region": "ap-south-1", + "endpoint": "ots.ap-south-1.aliyuncs.com" + }, + { + "region": "eu-central-1", + "endpoint": "ots.eu-central-1.aliyuncs.com" + }, + { + "region": "cn-zhangjiakou", + "endpoint": "ots.cn-zhangjiakou.aliyuncs.com" + }, + { + "region": "cn-hangzhou", + "endpoint": "ots.cn-hangzhou.aliyuncs.com" + }, + { + "region": "ap-northeast-1", + "endpoint": "ots.ap-northeast-1.aliyuncs.com" + }, + { + "region": "cn-shanghai", + "endpoint": "ots.cn-shanghai.aliyuncs.com" + }, + { + "region": "ap-southeast-1", + "endpoint": "ots.ap-southeast-1.aliyuncs.com" + }, + { + "region": "ap-southeast-3", + "endpoint": "ots.ap-southeast-3.aliyuncs.com" + } + ], + "global_endpoint": "", + "regional_endpoint_pattern": "" + }, + { + "code": "cloudfirewall", + "document_id": "", + "location_service_code": "cloudfirewall", + "regional_endpoints": [ + { + "region": "cn-hangzhou", + "endpoint": "cloudfw.cn-hangzhou.aliyuncs.com" + } + ], + "global_endpoint": "", + "regional_endpoint_pattern": "" + }, + { + "code": "dm", + "document_id": "29434", + "location_service_code": "dm", + "regional_endpoints": [ + { + "region": "ap-southeast-2", + "endpoint": "dm.ap-southeast-2.aliyuncs.com" + } + ], + "global_endpoint": "dm.aliyuncs.com", + "regional_endpoint_pattern": "dm.[RegionId].aliyuncs.com" + }, + { + "code": "oas", + "document_id": "", + "location_service_code": "oas", + "regional_endpoints": [ + { + "region": "cn-shenzhen", + "endpoint": "cn-shenzhen.oas.aliyuncs.com" + }, + { + "region": "cn-beijing", + "endpoint": "cn-beijing.oas.aliyuncs.com" + }, + { + "region": "cn-hangzhou", + "endpoint": "cn-hangzhou.oas.aliyuncs.com" + } + ], + "global_endpoint": "", + "regional_endpoint_pattern": "" + }, + { + "code": "ddoscoo", + "document_id": "", + "location_service_code": "ddoscoo", + "regional_endpoints": [ + { + "region": "cn-hangzhou", + "endpoint": "ddoscoo.cn-hangzhou.aliyuncs.com" + } + ], + "global_endpoint": "", + "regional_endpoint_pattern": "" + }, + { + "code": "jaq", + "document_id": "35037", + "location_service_code": "jaq", + "regional_endpoints": null, + "global_endpoint": "jaq.aliyuncs.com", + "regional_endpoint_pattern": "" + }, + { + "code": "iovcc", + "document_id": "", + "location_service_code": "iovcc", + "regional_endpoints": [ + { + "region": "cn-shanghai", + "endpoint": "iovcc.cn-shanghai.aliyuncs.com" + } + ], + "global_endpoint": "", + "regional_endpoint_pattern": "" + }, + { + "code": "sas-api", + "document_id": "28498", + "location_service_code": "sas", + "regional_endpoints": [ + { + "region": "cn-hangzhou", + "endpoint": "sas.aliyuncs.com" + } + ], + "global_endpoint": "", + "regional_endpoint_pattern": "" + }, + { + "code": "chatbot", + "document_id": "60760", + "location_service_code": "beebot", + "regional_endpoints": [ + { + "region": "cn-shanghai", + "endpoint": "chatbot.cn-shanghai.aliyuncs.com" + }, + { + "region": "cn-hangzhou", + "endpoint": "chatbot.cn-hangzhou.aliyuncs.com" + } + ], + "global_endpoint": "", + "regional_endpoint_pattern": "chatbot.[RegionId].aliyuncs.com" + }, + { + "code": "airec", + "document_id": "", + "location_service_code": "airec", + "regional_endpoints": [ + { + "region": "cn-beijing", + "endpoint": "airec.cn-beijing.aliyuncs.com" + }, + { + "region": "cn-hangzhou", + "endpoint": "airec.cn-hangzhou.aliyuncs.com" + }, + { + "region": "cn-shanghai", + "endpoint": "airec.cn-shanghai.aliyuncs.com" + } + ], + "global_endpoint": "", + "regional_endpoint_pattern": "" + }, + { + "code": "dmsenterprise", + "document_id": "", + "location_service_code": "dmsenterprise", + "regional_endpoints": [ + { + "region": "cn-shanghai", + "endpoint": "dms-enterprise.aliyuncs.com" + }, + { + "region": "cn-shenzhen", + "endpoint": "dms-enterprise.aliyuncs.com" + }, + { + "region": "ap-northeast-1", + "endpoint": "dms-enterprise.aliyuncs.com" + }, + { + "region": "cn-qingdao", + "endpoint": "dms-enterprise.aliyuncs.com" + }, + { + "region": "cn-beijing", + "endpoint": "dms-enterprise.aliyuncs.com" + }, + { + "region": "cn-hangzhou", + "endpoint": "dms-enterprise.aliyuncs.com" + } + ], + "global_endpoint": "", + "regional_endpoint_pattern": "" + }, + { + "code": "ivision", + "document_id": "", + "location_service_code": "ivision", + "regional_endpoints": [ + { + "region": "cn-hangzhou", + "endpoint": "ivision.cn-hangzhou.aliyuncs.com" + }, + { + "region": "cn-beijing", + "endpoint": "ivision.cn-beijing.aliyuncs.com" + } + ], + "global_endpoint": "", + "regional_endpoint_pattern": "" + }, + { + "code": "odpsplusmayi", + "document_id": "", + "location_service_code": "odpsplusmayi", + "regional_endpoints": [ + { + "region": "cn-shanghai", + "endpoint": "bsb.cloud.alipay.com" + }, + { + "region": "cn-hangzhou", + "endpoint": "bsb.cloud.alipay.com" + }, + { + "region": "ap-southeast-1", + "endpoint": "bsb.cloud.alipay.com" + } + ], + "global_endpoint": "", + "regional_endpoint_pattern": "" + }, + { + "code": "gameshield", + "document_id": "", + "location_service_code": "gameshield", + "regional_endpoints": [ + { + "region": "cn-hangzhou", + "endpoint": "gameshield.aliyuncs.com" + }, + { + "region": "cn-zhangjiakou", + "endpoint": "gameshield.cn-zhangjiakou.aliyuncs.com" + } + ], + "global_endpoint": "", + "regional_endpoint_pattern": "" + }, + { + "code": "scdn", + "document_id": "", + "location_service_code": "scdn", + "regional_endpoints": [ + { + "region": "cn-hangzhou", + "endpoint": "scdn.aliyuncs.com" + } + ], + "global_endpoint": "", + "regional_endpoint_pattern": "" + }, + { + "code": "hitsdb", + "document_id": "", + "location_service_code": "hitsdb", + "regional_endpoints": [ + { + "region": "cn-hangzhou", + "endpoint": "hitsdb.aliyuncs.com" + } + ], + "global_endpoint": "", + "regional_endpoint_pattern": "" + }, + { + "code": "hdm", + "document_id": "", + "location_service_code": "hdm", + "regional_endpoints": [ + { + "region": "cn-shanghai", + "endpoint": "hdm-api.aliyuncs.com" + } + ], + "global_endpoint": "", + "regional_endpoint_pattern": "" + }, + { + "code": "slb", + "document_id": "27565", + "location_service_code": "slb", + "regional_endpoints": [ + { + "region": "cn-shenzhen", + "endpoint": "slb.aliyuncs.com" + }, + { + "region": "eu-west-1", + "endpoint": "slb.eu-west-1.aliyuncs.com" + }, + { + "region": "ap-northeast-1", + "endpoint": "slb.ap-northeast-1.aliyuncs.com" + }, + { + "region": "ap-southeast-2", + "endpoint": "slb.ap-southeast-2.aliyuncs.com" + }, + { + "region": "cn-qingdao", + "endpoint": "slb.aliyuncs.com" + }, + { + "region": "cn-hongkong", + "endpoint": "slb.aliyuncs.com" + }, + { + "region": "cn-huhehaote", + "endpoint": "slb.cn-huhehaote.aliyuncs.com" + }, + { + "region": "ap-south-1", + "endpoint": "slb.ap-south-1.aliyuncs.com" + }, + { + "region": "eu-central-1", + "endpoint": "slb.eu-central-1.aliyuncs.com" + }, + { + "region": "cn-beijing", + "endpoint": "slb.aliyuncs.com" + }, + { + "region": "cn-shanghai", + "endpoint": "slb.aliyuncs.com" + }, + { + "region": "ap-southeast-1", + "endpoint": "slb.aliyuncs.com" + }, + { + "region": "us-west-1", + "endpoint": "slb.aliyuncs.com" + }, + { + "region": "ap-southeast-5", + "endpoint": "slb.ap-southeast-5.aliyuncs.com" + }, + { + "region": "ap-southeast-3", + "endpoint": "slb.ap-southeast-3.aliyuncs.com" + }, + { + "region": "cn-hangzhou", + "endpoint": "slb.aliyuncs.com" + }, + { + "region": "us-east-1", + "endpoint": "slb.aliyuncs.com" + }, + { + "region": "me-east-1", + "endpoint": "slb.me-east-1.aliyuncs.com" + }, + { + "region": "cn-zhangjiakou", + "endpoint": "slb.cn-zhangjiakou.aliyuncs.com" + } + ], + "global_endpoint": "slb.aliyuncs.com", + "regional_endpoint_pattern": "" + }, + { + "code": "green", + "document_id": "28427", + "location_service_code": "green", + "regional_endpoints": [ + { + "region": "cn-beijing", + "endpoint": "green.cn-beijing.aliyuncs.com" + }, + { + "region": "ap-southeast-1", + "endpoint": "green.ap-southeast-1.aliyuncs.com" + }, + { + "region": "cn-shanghai", + "endpoint": "green.cn-shanghai.aliyuncs.com" + }, + { + "region": "cn-hangzhou", + "endpoint": "green.cn-hangzhou.aliyuncs.com" + }, + { + "region": "us-west-1", + "endpoint": "green.us-west-1.aliyuncs.com" + } + ], + "global_endpoint": "green.aliyuncs.com", + "regional_endpoint_pattern": "" + }, + { + "code": "cccvn", + "document_id": "", + "location_service_code": "cccvn", + "regional_endpoints": [ + { + "region": "cn-shanghai", + "endpoint": "voicenavigator.cn-shanghai.aliyuncs.com" + } + ], + "global_endpoint": "", + "regional_endpoint_pattern": "" + }, + { + "code": "ddosrewards", + "document_id": "", + "location_service_code": "ddosrewards", + "regional_endpoints": [ + { + "region": "cn-hangzhou", + "endpoint": "ddosright.cn-hangzhou.aliyuncs.com" + } + ], + "global_endpoint": "", + "regional_endpoint_pattern": "" + }, + { + "code": "iot", + "document_id": "30557", + "location_service_code": "iot", + "regional_endpoints": [ + { + "region": "us-east-1", + "endpoint": "iot.us-east-1.aliyuncs.com" + }, + { + "region": "ap-northeast-1", + "endpoint": "iot.ap-northeast-1.aliyuncs.com" + }, + { + "region": "us-west-1", + "endpoint": "iot.us-west-1.aliyuncs.com" + }, + { + "region": "eu-central-1", + "endpoint": "iot.eu-central-1.aliyuncs.com" + }, + { + "region": "cn-shanghai", + "endpoint": "iot.cn-shanghai.aliyuncs.com" + }, + { + "region": "ap-southeast-1", + "endpoint": "iot.ap-southeast-1.aliyuncs.com" + } + ], + "global_endpoint": "", + "regional_endpoint_pattern": "iot.[RegionId].aliyuncs.com" + }, + { + "code": "bssopenapi", + "document_id": "", + "location_service_code": "bssopenapi", + "regional_endpoints": [ + { + "region": "cn-shanghai", + "endpoint": "business.aliyuncs.com" + }, + { + "region": "cn-hongkong", + "endpoint": "business.aliyuncs.com" + }, + { + "region": "ap-southeast-2", + "endpoint": "business.ap-southeast-1.aliyuncs.com" + }, + { + "region": "ap-southeast-3", + "endpoint": "business.ap-southeast-1.aliyuncs.com" + }, + { + "region": "ap-northeast-1", + "endpoint": "business.ap-southeast-1.aliyuncs.com" + }, + { + "region": "eu-central-1", + "endpoint": "business.ap-southeast-1.aliyuncs.com" + }, + { + "region": "me-east-1", + "endpoint": "business.ap-southeast-1.aliyuncs.com" + }, + { + "region": "cn-zhangjiakou", + "endpoint": "business.aliyuncs.com" + }, + { + "region": "cn-hangzhou", + "endpoint": "business.aliyuncs.com" + }, + { + "region": "ap-southeast-5", + "endpoint": "business.ap-southeast-1.aliyuncs.com" + }, + { + "region": "us-east-1", + "endpoint": "business.ap-southeast-1.aliyuncs.com" + }, + { + "region": "cn-qingdao", + "endpoint": "business.aliyuncs.com" + }, + { + "region": "ap-southeast-1", + "endpoint": "business.ap-southeast-1.aliyuncs.com" + }, + { + "region": "cn-beijing", + "endpoint": "business.aliyuncs.com" + }, + { + "region": "cn-huhehaote", + "endpoint": "business.aliyuncs.com" + }, + { + "region": "cn-shenzhen", + "endpoint": "business.aliyuncs.com" + }, + { + "region": "us-west-1", + "endpoint": "business.ap-southeast-1.aliyuncs.com" + }, + { + "region": "eu-west-1", + "endpoint": "business.ap-southeast-1.aliyuncs.com" + }, + { + "region": "ap-south-1", + "endpoint": "business.ap-southeast-1.aliyuncs.com" + } + ], + "global_endpoint": "", + "regional_endpoint_pattern": "" + }, + { + "code": "sca", + "document_id": "", + "location_service_code": "sca", + "regional_endpoints": [ + { + "region": "cn-hangzhou", + "endpoint": "qualitycheck.cn-hangzhou.aliyuncs.com" + } + ], + "global_endpoint": "", + "regional_endpoint_pattern": "" + }, + { + "code": "luban", + "document_id": "", + "location_service_code": "luban", + "regional_endpoints": [ + { + "region": "cn-hangzhou", + "endpoint": "luban.cn-hangzhou.aliyuncs.com" + }, + { + "region": "cn-shanghai", + "endpoint": "luban.cn-shanghai.aliyuncs.com" + } + ], + "global_endpoint": "", + "regional_endpoint_pattern": "" + }, + { + "code": "drdspost", + "document_id": "", + "location_service_code": "drdspost", + "regional_endpoints": [ + { + "region": "cn-shanghai", + "endpoint": "drds.cn-shanghai.aliyuncs.com" + }, + { + "region": "cn-hongkong", + "endpoint": "drds.cn-hangzhou.aliyuncs.com" + }, + { + "region": "ap-southeast-1", + "endpoint": "drds.ap-southeast-1.aliyuncs.com" + } + ], + "global_endpoint": "", + "regional_endpoint_pattern": "" + }, + { + "code": "drds", + "document_id": "51111", + "location_service_code": "drds", + "regional_endpoints": [ + { + "region": "ap-southeast-1", + "endpoint": "drds.ap-southeast-1.aliyuncs.com" + }, + { + "region": "cn-hangzhou", + "endpoint": "drds.cn-hangzhou.aliyuncs.com" + } + ], + "global_endpoint": "drds.aliyuncs.com", + "regional_endpoint_pattern": "drds.aliyuncs.com" + }, + { + "code": "httpdns", + "document_id": "52679", + "location_service_code": "httpdns", + "regional_endpoints": null, + "global_endpoint": "httpdns-api.aliyuncs.com", + "regional_endpoint_pattern": "" + }, + { + "code": "cas", + "document_id": "", + "location_service_code": "cas", + "regional_endpoints": [ + { + "region": "cn-hangzhou", + "endpoint": "cas.aliyuncs.com" + }, + { + "region": "ap-southeast-2", + "endpoint": "cas.ap-southeast-2.aliyuncs.com" + }, + { + "region": "ap-northeast-1", + "endpoint": "cas.ap-northeast-1.aliyuncs.com" + }, + { + "region": "eu-central-1", + "endpoint": "cas.eu-central-1.aliyuncs.com" + }, + { + "region": "me-east-1", + "endpoint": "cas.me-east-1.aliyuncs.com" + } + ], + "global_endpoint": "", + "regional_endpoint_pattern": "" + }, + { + "code": "hpc", + "document_id": "35201", + "location_service_code": "hpc", + "regional_endpoints": [ + { + "region": "cn-beijing", + "endpoint": "hpc.aliyuncs.com" + }, + { + "region": "cn-hangzhou", + "endpoint": "hpc.aliyuncs.com" + } + ], + "global_endpoint": "hpc.aliyuncs.com", + "regional_endpoint_pattern": "" + }, + { + "code": "ddosbasic", + "document_id": "", + "location_service_code": "ddosbasic", + "regional_endpoints": [ + { + "region": "ap-south-1", + "endpoint": "antiddos-openapi.ap-south-1.aliyuncs.com" + }, + { + "region": "cn-zhangjiakou", + "endpoint": "antiddos-openapi.cn-zhangjiakou.aliyuncs.com" + }, + { + "region": "cn-shanghai", + "endpoint": "antiddos.aliyuncs.com" + }, + { + "region": "us-east-1", + "endpoint": "antiddos.aliyuncs.com" + }, + { + "region": "ap-southeast-3", + "endpoint": "antiddos-openapi.ap-southeast-3.aliyuncs.com" + }, + { + "region": "me-east-1", + "endpoint": "antiddos-openapi.me-east-1.aliyuncs.com" + }, + { + "region": "ap-southeast-5", + "endpoint": "antiddos-openapi.ap-southeast-5.aliyuncs.com" + }, + { + "region": "ap-southeast-2", + "endpoint": "antiddos-openapi.ap-southeast-2.aliyuncs.com" + }, + { + "region": "cn-shenzhen", + "endpoint": "antiddos.aliyuncs.com" + }, + { + "region": "cn-hongkong", + "endpoint": "antiddos.aliyuncs.com" + }, + { + "region": "ap-southeast-1", + "endpoint": "antiddos.aliyuncs.com" + }, + { + "region": "eu-west-1", + "endpoint": "antiddos-openapi.eu-west-1.aliyuncs.com" + }, + { + "region": "cn-huhehaote", + "endpoint": "antiddos-openapi.cn-huhehaote.aliyuncs.com" + }, + { + "region": "cn-beijing", + "endpoint": "antiddos.aliyuncs.com" + }, + { + "region": "cn-hangzhou", + "endpoint": "antiddos.aliyuncs.com" + }, + { + "region": "us-west-1", + "endpoint": "antiddos.aliyuncs.com" + }, + { + "region": "eu-central-1", + "endpoint": "antiddos-openapi.eu-central-1.aliyuncs.com" + }, + { + "region": "cn-qingdao", + "endpoint": "antiddos.aliyuncs.com" + }, + { + "region": "ap-northeast-1", + "endpoint": "antiddos-openapi.ap-northeast-1.aliyuncs.com" + } + ], + "global_endpoint": "antiddos.aliyuncs.com", + "regional_endpoint_pattern": "" + }, + { + "code": "clouddesktop", + "document_id": "", + "location_service_code": "clouddesktop", + "regional_endpoints": [ + { + "region": "cn-beijing", + "endpoint": "clouddesktop.cn-beijing.aliyuncs.com" + }, + { + "region": "cn-shanghai", + "endpoint": "clouddesktop.cn-shanghai.aliyuncs.com" + }, + { + "region": "cn-hangzhou", + "endpoint": "clouddesktop.cn-hangzhou.aliyuncs.com" + }, + { + "region": "cn-shenzhen", + "endpoint": "clouddesktop.cn-shenzhen.aliyuncs.com" + } + ], + "global_endpoint": "", + "regional_endpoint_pattern": "" + }, + { + "code": "uis", + "document_id": "", + "location_service_code": "uis", + "regional_endpoints": [ + { + "region": "cn-hangzhou", + "endpoint": "uis.cn-hangzhou.aliyuncs.com" + } + ], + "global_endpoint": "", + "regional_endpoint_pattern": "" + }, + { + "code": "imm", + "document_id": "", + "location_service_code": "imm", + "regional_endpoints": [ + { + "region": "cn-beijing", + "endpoint": "imm.cn-beijing.aliyuncs.com" + }, + { + "region": "ap-southeast-1", + "endpoint": "imm.ap-southeast-1.aliyuncs.com" + }, + { + "region": "cn-zhangjiakou", + "endpoint": "imm.cn-zhangjiakou.aliyuncs.com" + }, + { + "region": "cn-shanghai", + "endpoint": "imm.cn-shanghai.aliyuncs.com" + }, + { + "region": "cn-hangzhou", + "endpoint": "imm.cn-hangzhou.aliyuncs.com" + }, + { + "region": "cn-shenzhen", + "endpoint": "imm.cn-shenzhen.aliyuncs.com" + } + ], + "global_endpoint": "", + "regional_endpoint_pattern": "" + }, + { + "code": "ens", + "document_id": "", + "location_service_code": "ens", + "regional_endpoints": [ + { + "region": "cn-hangzhou", + "endpoint": "ens.aliyuncs.com" + } + ], + "global_endpoint": "", + "regional_endpoint_pattern": "" + }, + { + "code": "ram", + "document_id": "28672", + "location_service_code": "ram", + "regional_endpoints": null, + "global_endpoint": "ram.aliyuncs.com", + "regional_endpoint_pattern": "" + }, + { + "code": "hcs_mgw", + "document_id": "", + "location_service_code": "hcs_mgw", + "regional_endpoints": [ + { + "region": "cn-hangzhou", + "endpoint": "mgw.cn-hangzhou.aliyuncs.com" + }, + { + "region": "ap-southeast-1", + "endpoint": "mgw.ap-southeast-1.aliyuncs.com" + }, + { + "region": "cn-shanghai", + "endpoint": "mgw.cn-shanghai.aliyuncs.com" + } + ], + "global_endpoint": "", + "regional_endpoint_pattern": "" + }, + { + "code": "itaas", + "document_id": "55759", + "location_service_code": "itaas", + "regional_endpoints": null, + "global_endpoint": "itaas.aliyuncs.com", + "regional_endpoint_pattern": "" + }, + { + "code": "qualitycheck", + "document_id": "50807", + "location_service_code": "qualitycheck", + "regional_endpoints": [ + { + "region": "cn-hangzhou", + "endpoint": "qualitycheck.cn-hangzhou.aliyuncs.com" + } + ], + "global_endpoint": "", + "regional_endpoint_pattern": "" + }, + { + "code": "alikafka", + "document_id": "", + "location_service_code": "alikafka", + "regional_endpoints": [ + { + "region": "cn-beijing", + "endpoint": "alikafka.cn-beijing.aliyuncs.com" + }, + { + "region": "cn-zhangjiakou", + "endpoint": "alikafka.cn-zhangjiakou.aliyuncs.com" + }, + { + "region": "cn-huhehaote", + "endpoint": "alikafka.cn-huhehaote.aliyuncs.com" + }, + { + "region": "cn-hangzhou", + "endpoint": "alikafka.cn-hangzhou.aliyuncs.com" + }, + { + "region": "cn-shanghai", + "endpoint": "alikafka.cn-shanghai.aliyuncs.com" + }, + { + "region": "cn-shenzhen", + "endpoint": "alikafka.cn-shenzhen.aliyuncs.com" + }, + { + "region": "cn-hongkong", + "endpoint": "alikafka.cn-hongkong.aliyuncs.com" + }, + { + "region": "cn-qingdao", + "endpoint": "alikafka.cn-qingdao.aliyuncs.com" + } + ], + "global_endpoint": "", + "regional_endpoint_pattern": "" + }, + { + "code": "faas", + "document_id": "", + "location_service_code": "faas", + "regional_endpoints": [ + { + "region": "cn-hangzhou", + "endpoint": "faas.cn-hangzhou.aliyuncs.com" + }, + { + "region": "cn-shenzhen", + "endpoint": "faas.cn-shenzhen.aliyuncs.com" + }, + { + "region": "cn-shanghai", + "endpoint": "faas.cn-shanghai.aliyuncs.com" + }, + { + "region": "cn-beijing", + "endpoint": "faas.cn-beijing.aliyuncs.com" + } + ], + "global_endpoint": "", + "regional_endpoint_pattern": "" + }, + { + "code": "alidfs", + "document_id": "", + "location_service_code": "alidfs", + "regional_endpoints": [ + { + "region": "cn-beijing", + "endpoint": "dfs.cn-beijing.aliyuncs.com" + }, + { + "region": "cn-shanghai", + "endpoint": "dfs.cn-shanghai.aliyuncs.com" + } + ], + "global_endpoint": "", + "regional_endpoint_pattern": "" + }, + { + "code": "cms", + "document_id": "28615", + "location_service_code": "cms", + "regional_endpoints": [ + { + "region": "ap-southeast-3", + "endpoint": "metrics.ap-southeast-3.aliyuncs.com" + }, + { + "region": "cn-hongkong", + "endpoint": "metrics.cn-hangzhou.aliyuncs.com" + }, + { + "region": "ap-southeast-5", + "endpoint": "metrics.ap-southeast-5.aliyuncs.com" + }, + { + "region": "ap-south-1", + "endpoint": "metrics.ap-south-1.aliyuncs.com" + }, + { + "region": "cn-hangzhou", + "endpoint": "metrics.cn-hangzhou.aliyuncs.com" + }, + { + "region": "eu-west-1", + "endpoint": "metrics.eu-west-1.aliyuncs.com" + }, + { + "region": "cn-huhehaote", + "endpoint": "metrics.cn-huhehaote.aliyuncs.com" + }, + { + "region": "cn-shanghai", + "endpoint": "metrics.cn-hangzhou.aliyuncs.com" + }, + { + "region": "cn-shenzhen", + "endpoint": "metrics.cn-hangzhou.aliyuncs.com" + }, + { + "region": "ap-southeast-1", + "endpoint": "metrics.cn-hangzhou.aliyuncs.com" + }, + { + "region": "us-west-1", + "endpoint": "metrics.cn-hangzhou.aliyuncs.com" + }, + { + "region": "us-east-1", + "endpoint": "metrics.cn-hangzhou.aliyuncs.com" + }, + { + "region": "ap-northeast-1", + "endpoint": "metrics.ap-northeast-1.aliyuncs.com" + }, + { + "region": "cn-qingdao", + "endpoint": "metrics.cn-hangzhou.aliyuncs.com" + }, + { + "region": "cn-beijing", + "endpoint": "metrics.cn-hangzhou.aliyuncs.com" + }, + { + "region": "cn-zhangjiakou", + "endpoint": "metrics.cn-hangzhou.aliyuncs.com" + }, + { + "region": "ap-southeast-2", + "endpoint": "metrics.cn-hangzhou.aliyuncs.com" + }, + { + "region": "eu-central-1", + "endpoint": "metrics.cn-hangzhou.aliyuncs.com" + }, + { + "region": "me-east-1", + "endpoint": "metrics.cn-hangzhou.aliyuncs.com" + } + ], + "global_endpoint": "metrics.cn-hangzhou.aliyuncs.com", + "regional_endpoint_pattern": "" + }, + { + "code": "domain-intl", + "document_id": "", + "location_service_code": "domain-intl", + "regional_endpoints": null, + "global_endpoint": "domain-intl.aliyuncs.com", + "regional_endpoint_pattern": "domain-intl.aliyuncs.com" + }, + { + "code": "kvstore", + "document_id": "", + "location_service_code": "kvstore", + "regional_endpoints": [ + { + "region": "ap-northeast-1", + "endpoint": "r-kvstore.ap-northeast-1.aliyuncs.com" + } + ], + "global_endpoint": "", + "regional_endpoint_pattern": "" + }, + { + "code": "ccs", + "document_id": "", + "location_service_code": "ccs", + "regional_endpoints": [ + { + "region": "cn-hangzhou", + "endpoint": "ccs.aliyuncs.com" + } + ], + "global_endpoint": "", + "regional_endpoint_pattern": "" + }, + { + "code": "ess", + "document_id": "25925", + "location_service_code": "ess", + "regional_endpoints": [ + { + "region": "cn-huhehaote", + "endpoint": "ess.cn-huhehaote.aliyuncs.com" + }, + { + "region": "ap-southeast-2", + "endpoint": "ess.ap-southeast-2.aliyuncs.com" + }, + { + "region": "cn-hangzhou", + "endpoint": "ess.aliyuncs.com" + }, + { + "region": "cn-hongkong", + "endpoint": "ess.aliyuncs.com" + }, + { + "region": "eu-west-1", + "endpoint": "ess.eu-west-1.aliyuncs.com" + }, + { + "region": "ap-southeast-1", + "endpoint": "ess.aliyuncs.com" + }, + { + "region": "us-west-1", + "endpoint": "ess.aliyuncs.com" + }, + { + "region": "ap-southeast-5", + "endpoint": "ess.ap-southeast-5.aliyuncs.com" + }, + { + "region": "ap-southeast-3", + "endpoint": "ess.ap-southeast-3.aliyuncs.com" + }, + { + "region": "cn-zhangjiakou", + "endpoint": "ess.cn-zhangjiakou.aliyuncs.com" + }, + { + "region": "cn-beijing", + "endpoint": "ess.aliyuncs.com" + }, + { + "region": "cn-shenzhen", + "endpoint": "ess.aliyuncs.com" + }, + { + "region": "me-east-1", + "endpoint": "ess.me-east-1.aliyuncs.com" + }, + { + "region": "ap-northeast-1", + "endpoint": "ess.ap-northeast-1.aliyuncs.com" + }, + { + "region": "ap-south-1", + "endpoint": "ess.ap-south-1.aliyuncs.com" + }, + { + "region": "cn-shanghai", + "endpoint": "ess.aliyuncs.com" + }, + { + "region": "eu-central-1", + "endpoint": "ess.eu-central-1.aliyuncs.com" + }, + { + "region": "cn-qingdao", + "endpoint": "ess.aliyuncs.com" + }, + { + "region": "us-east-1", + "endpoint": "ess.aliyuncs.com" + } + ], + "global_endpoint": "ess.aliyuncs.com", + "regional_endpoint_pattern": "ess.[RegionId].aliyuncs.com" + }, + { + "code": "dds", + "document_id": "61715", + "location_service_code": "dds", + "regional_endpoints": [ + { + "region": "me-east-1", + "endpoint": "mongodb.me-east-1.aliyuncs.com" + }, + { + "region": "ap-southeast-3", + "endpoint": "mongodb.ap-southeast-3.aliyuncs.com" + }, + { + "region": "ap-southeast-5", + "endpoint": "mongodb.ap-southeast-5.aliyuncs.com" + }, + { + "region": "cn-hongkong", + "endpoint": "mongodb.aliyuncs.com" + }, + { + "region": "ap-northeast-1", + "endpoint": "mongodb.ap-northeast-1.aliyuncs.com" + }, + { + "region": "eu-central-1", + "endpoint": "mongodb.eu-central-1.aliyuncs.com" + }, + { + "region": "cn-beijing", + "endpoint": "mongodb.aliyuncs.com" + }, + { + "region": "cn-shenzhen", + "endpoint": "mongodb.aliyuncs.com" + }, + { + "region": "ap-southeast-1", + "endpoint": "mongodb.aliyuncs.com" + }, + { + "region": "eu-west-1", + "endpoint": "mongodb.eu-west-1.aliyuncs.com" + }, + { + "region": "us-east-1", + "endpoint": "mongodb.aliyuncs.com" + }, + { + "region": "cn-huhehaote", + "endpoint": "mongodb.cn-huhehaote.aliyuncs.com" + }, + { + "region": "cn-qingdao", + "endpoint": "mongodb.aliyuncs.com" + }, + { + "region": "cn-hangzhou", + "endpoint": "mongodb.aliyuncs.com" + }, + { + "region": "cn-shanghai", + "endpoint": "mongodb.aliyuncs.com" + }, + { + "region": "ap-southeast-2", + "endpoint": "mongodb.ap-southeast-2.aliyuncs.com" + }, + { + "region": "cn-zhangjiakou", + "endpoint": "mongodb.cn-zhangjiakou.aliyuncs.com" + }, + { + "region": "ap-south-1", + "endpoint": "mongodb.ap-south-1.aliyuncs.com" + }, + { + "region": "us-west-1", + "endpoint": "mongodb.aliyuncs.com" + } + ], + "global_endpoint": "mongodb.aliyuncs.com", + "regional_endpoint_pattern": "mongodb.[RegionId].aliyuncs.com" + }, + { + "code": "mts", + "document_id": "29212", + "location_service_code": "mts", + "regional_endpoints": [ + { + "region": "cn-beijing", + "endpoint": "mts.cn-beijing.aliyuncs.com" + }, + { + "region": "ap-northeast-1", + "endpoint": "mts.ap-northeast-1.aliyuncs.com" + }, + { + "region": "cn-hongkong", + "endpoint": "mts.cn-hongkong.aliyuncs.com" + }, + { + "region": "cn-shenzhen", + "endpoint": "mts.cn-shenzhen.aliyuncs.com" + }, + { + "region": "cn-zhangjiakou", + "endpoint": "mts.cn-zhangjiakou.aliyuncs.com" + }, + { + "region": "ap-south-1", + "endpoint": "mts.ap-south-1.aliyuncs.com" + }, + { + "region": "cn-shanghai", + "endpoint": "mts.cn-shanghai.aliyuncs.com" + }, + { + "region": "ap-southeast-1", + "endpoint": "mts.ap-southeast-1.aliyuncs.com" + }, + { + "region": "us-west-1", + "endpoint": "mts.us-west-1.aliyuncs.com" + }, + { + "region": "eu-central-1", + "endpoint": "mts.eu-central-1.aliyuncs.com" + }, + { + "region": "eu-west-1", + "endpoint": "mts.eu-west-1.aliyuncs.com" + }, + { + "region": "cn-hangzhou", + "endpoint": "mts.cn-hangzhou.aliyuncs.com" + } + ], + "global_endpoint": "", + "regional_endpoint_pattern": "" + }, + { + "code": "push", + "document_id": "30074", + "location_service_code": "push", + "regional_endpoints": null, + "global_endpoint": "cloudpush.aliyuncs.com", + "regional_endpoint_pattern": "" + }, + { + "code": "hcs_sgw", + "document_id": "", + "location_service_code": "hcs_sgw", + "regional_endpoints": [ + { + "region": "eu-central-1", + "endpoint": "sgw.eu-central-1.aliyuncs.com" + }, + { + "region": "cn-hangzhou", + "endpoint": "sgw.cn-shanghai.aliyuncs.com" + }, + { + "region": "cn-zhangjiakou", + "endpoint": "sgw.cn-shanghai.aliyuncs.com" + }, + { + "region": "ap-southeast-1", + "endpoint": "sgw.ap-southeast-1.aliyuncs.com" + }, + { + "region": "cn-shenzhen", + "endpoint": "sgw.cn-shanghai.aliyuncs.com" + }, + { + "region": "cn-hongkong", + "endpoint": "sgw.cn-shanghai.aliyuncs.com" + }, + { + "region": "ap-southeast-2", + "endpoint": "sgw.ap-southeast-2.aliyuncs.com" + }, + { + "region": "cn-shanghai", + "endpoint": "sgw.cn-shanghai.aliyuncs.com" + }, + { + "region": "cn-qingdao", + "endpoint": "sgw.cn-shanghai.aliyuncs.com" + }, + { + "region": "cn-beijing", + "endpoint": "sgw.cn-shanghai.aliyuncs.com" + } + ], + "global_endpoint": "", + "regional_endpoint_pattern": "" + }, + { + "code": "hbase", + "document_id": "", + "location_service_code": "hbase", + "regional_endpoints": [ + { + "region": "cn-huhehaote", + "endpoint": "hbase.cn-huhehaote.aliyuncs.com" + }, + { + "region": "ap-south-1", + "endpoint": "hbase.ap-south-1.aliyuncs.com" + }, + { + "region": "us-west-1", + "endpoint": "hbase.aliyuncs.com" + }, + { + "region": "me-east-1", + "endpoint": "hbase.me-east-1.aliyuncs.com" + }, + { + "region": "eu-central-1", + "endpoint": "hbase.eu-central-1.aliyuncs.com" + }, + { + "region": "cn-qingdao", + "endpoint": "hbase.aliyuncs.com" + }, + { + "region": "cn-shanghai", + "endpoint": "hbase.aliyuncs.com" + }, + { + "region": "cn-shenzhen", + "endpoint": "hbase.aliyuncs.com" + }, + { + "region": "ap-southeast-2", + "endpoint": "hbase.ap-southeast-2.aliyuncs.com" + }, + { + "region": "ap-southeast-3", + "endpoint": "hbase.ap-southeast-3.aliyuncs.com" + }, + { + "region": "cn-hangzhou", + "endpoint": "hbase.aliyuncs.com" + }, + { + "region": "us-east-1", + "endpoint": "hbase.aliyuncs.com" + }, + { + "region": "ap-southeast-5", + "endpoint": "hbase.ap-southeast-5.aliyuncs.com" + }, + { + "region": "cn-beijing", + "endpoint": "hbase.aliyuncs.com" + }, + { + "region": "ap-southeast-1", + "endpoint": "hbase.aliyuncs.com" + } + ], + "global_endpoint": "hbase.aliyuncs.com", + "regional_endpoint_pattern": "" + }, + { + "code": "bastionhost", + "document_id": "", + "location_service_code": "bastionhost", + "regional_endpoints": [ + { + "region": "cn-hangzhou", + "endpoint": "yundun-bastionhost.aliyuncs.com" + } + ], + "global_endpoint": "", + "regional_endpoint_pattern": "" + }, + { + "code": "vs", + "document_id": "", + "location_service_code": "vs", + "regional_endpoints": [ + { + "region": "cn-hangzhou", + "endpoint": "vs.cn-hangzhou.aliyuncs.com" + }, + { + "region": "cn-shanghai", + "endpoint": "vs.cn-shanghai.aliyuncs.com" + } + ], + "global_endpoint": "", + "regional_endpoint_pattern": "" + } + ] +}` +var initOnce sync.Once +var data interface{} + +func getEndpointConfigData() interface{} { + initOnce.Do(func() { + err := json.Unmarshal([]byte(endpointsJson), &data) + if err != nil { + panic(fmt.Sprintf("init endpoint config data failed. %s", err)) + } + }) + return data +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/endpoints/local_global_resolver.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/endpoints/local_global_resolver.go new file mode 100644 index 0000000000..160e62cb64 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/endpoints/local_global_resolver.go @@ -0,0 +1,43 @@ +/* + * 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. + */ + +package endpoints + +import ( + "fmt" + "strings" + + "github.com/jmespath/go-jmespath" +) + +type LocalGlobalResolver struct { +} + +func (resolver *LocalGlobalResolver) GetName() (name string) { + name = "local global resolver" + return +} + +func (resolver *LocalGlobalResolver) TryResolve(param *ResolveParam) (endpoint string, support bool, err error) { + // get the global endpoints configs + endpointExpression := fmt.Sprintf("products[?code=='%s'].global_endpoint", strings.ToLower(param.Product)) + endpointData, err := jmespath.Search(endpointExpression, getEndpointConfigData()) + if err == nil && endpointData != nil && len(endpointData.([]interface{})) > 0 { + endpoint = endpointData.([]interface{})[0].(string) + support = len(endpoint) > 0 + return + } + support = false + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/endpoints/local_regional_resolver.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/endpoints/local_regional_resolver.go new file mode 100644 index 0000000000..7fee64d42a --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/endpoints/local_regional_resolver.go @@ -0,0 +1,48 @@ +/* + * 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. + */ + +package endpoints + +import ( + "fmt" + "strings" + + "github.com/jmespath/go-jmespath" +) + +type LocalRegionalResolver struct { +} + +func (resolver *LocalRegionalResolver) GetName() (name string) { + name = "local regional resolver" + return +} + +func (resolver *LocalRegionalResolver) TryResolve(param *ResolveParam) (endpoint string, support bool, err error) { + // get the regional endpoints configs + regionalExpression := fmt.Sprintf("products[?code=='%s'].regional_endpoints", strings.ToLower(param.Product)) + regionalData, err := jmespath.Search(regionalExpression, getEndpointConfigData()) + if err == nil && regionalData != nil && len(regionalData.([]interface{})) > 0 { + endpointExpression := fmt.Sprintf("[0][?region=='%s'].endpoint", strings.ToLower(param.RegionId)) + var endpointData interface{} + endpointData, err = jmespath.Search(endpointExpression, regionalData) + if err == nil && endpointData != nil && len(endpointData.([]interface{})) > 0 { + endpoint = endpointData.([]interface{})[0].(string) + support = len(endpoint) > 0 + return + } + } + support = false + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/endpoints/location_resolver.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/endpoints/location_resolver.go new file mode 100644 index 0000000000..cc354cc4d9 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/endpoints/location_resolver.go @@ -0,0 +1,176 @@ +/* + * 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. + */ +package endpoints + +import ( + "encoding/json" + "sync" + "time" + + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" +) + +const ( + // EndpointCacheExpireTime ... + EndpointCacheExpireTime = 3600 //Seconds +) + +// Cache caches endpoint for specific product and region +type Cache struct { + sync.RWMutex + cache map[string]interface{} +} + +// Get ... +func (c *Cache) Get(k string) (v interface{}) { + c.RLock() + v = c.cache[k] + c.RUnlock() + return +} + +// Set ... +func (c *Cache) Set(k string, v interface{}) { + c.Lock() + c.cache[k] = v + c.Unlock() +} + +var lastClearTimePerProduct = &Cache{cache: make(map[string]interface{})} +var endpointCache = &Cache{cache: make(map[string]interface{})} + +// LocationResolver ... +type LocationResolver struct { +} + +func (resolver *LocationResolver) GetName() (name string) { + name = "location resolver" + return +} + +// TryResolve resolves endpoint giving product and region +func (resolver *LocationResolver) TryResolve(param *ResolveParam) (endpoint string, support bool, err error) { + if len(param.LocationProduct) <= 0 { + support = false + return + } + + //get from cache + cacheKey := param.Product + "#" + param.RegionId + var ok bool + endpoint, ok = endpointCache.Get(cacheKey).(string) + + if ok && len(endpoint) > 0 && !CheckCacheIsExpire(cacheKey) { + support = true + return + } + + //get from remote + getEndpointRequest := requests.NewCommonRequest() + + getEndpointRequest.Product = "Location" + getEndpointRequest.Version = "2015-06-12" + getEndpointRequest.ApiName = "DescribeEndpoints" + getEndpointRequest.Domain = "location-readonly.aliyuncs.com" + getEndpointRequest.Method = "GET" + getEndpointRequest.Scheme = requests.HTTPS + + getEndpointRequest.QueryParams["Id"] = param.RegionId + getEndpointRequest.QueryParams["ServiceCode"] = param.LocationProduct + if len(param.LocationEndpointType) > 0 { + getEndpointRequest.QueryParams["Type"] = param.LocationEndpointType + } else { + getEndpointRequest.QueryParams["Type"] = "openAPI" + } + + response, err := param.CommonApi(getEndpointRequest) + if err != nil { + support = false + return + } + + if !response.IsSuccess() { + support = false + return + } + + var getEndpointResponse GetEndpointResponse + err = json.Unmarshal([]byte(response.GetHttpContentString()), &getEndpointResponse) + if err != nil { + support = false + return + } + + if !getEndpointResponse.Success || getEndpointResponse.Endpoints == nil { + support = false + return + } + if len(getEndpointResponse.Endpoints.Endpoint) <= 0 { + support = false + return + } + if len(getEndpointResponse.Endpoints.Endpoint[0].Endpoint) > 0 { + endpoint = getEndpointResponse.Endpoints.Endpoint[0].Endpoint + endpointCache.Set(cacheKey, endpoint) + lastClearTimePerProduct.Set(cacheKey, time.Now().Unix()) + support = true + return + } + + support = false + return +} + +// CheckCacheIsExpire ... +func CheckCacheIsExpire(cacheKey string) bool { + lastClearTime, ok := lastClearTimePerProduct.Get(cacheKey).(int64) + if !ok { + return true + } + + if lastClearTime <= 0 { + lastClearTime = time.Now().Unix() + lastClearTimePerProduct.Set(cacheKey, lastClearTime) + } + + now := time.Now().Unix() + elapsedTime := now - lastClearTime + if elapsedTime > EndpointCacheExpireTime { + return true + } + + return false +} + +// GetEndpointResponse ... +type GetEndpointResponse struct { + Endpoints *EndpointsObj + RequestId string + Success bool +} + +// EndpointsObj ... +type EndpointsObj struct { + Endpoint []EndpointObj +} + +// EndpointObj ... +type EndpointObj struct { + // Protocols map[string]string + Type string + Namespace string + Id string + SerivceCode string + Endpoint string +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/endpoints/mapping_resolver.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/endpoints/mapping_resolver.go new file mode 100644 index 0000000000..a415a169a3 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/endpoints/mapping_resolver.go @@ -0,0 +1,49 @@ +/* + * 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. + */ + +package endpoints + +import ( + "fmt" + "strings" + "sync" +) + +const keyFormatter = "%s::%s" + +type EndpointMapping struct { + sync.RWMutex + endpoint map[string]string +} + +var endpointMapping = EndpointMapping{endpoint: make(map[string]string)} + +// AddEndpointMapping use productId and regionId as key to store the endpoint into inner map +// when using the same productId and regionId as key, the endpoint will be covered. +func AddEndpointMapping(regionId, productId, endpoint string) (err error) { + key := fmt.Sprintf(keyFormatter, strings.ToLower(regionId), strings.ToLower(productId)) + endpointMapping.Lock() + endpointMapping.endpoint[key] = endpoint + endpointMapping.Unlock() + return nil +} + +// GetEndpointFromMap use Product and RegionId as key to find endpoint from inner map +func GetEndpointFromMap(regionId, productId string) string { + key := fmt.Sprintf(keyFormatter, strings.ToLower(regionId), strings.ToLower(productId)) + endpointMapping.RLock() + endpoint := endpointMapping.endpoint[key] + endpointMapping.RUnlock() + return endpoint +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/endpoints/resolver.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/endpoints/resolver.go new file mode 100644 index 0000000000..a73b8b137a --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/endpoints/resolver.go @@ -0,0 +1,96 @@ +/* + * 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. + */ + +package endpoints + +import ( + "encoding/json" + "fmt" + "sync" + + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/errors" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/utils" +) + +var debug utils.Debug + +func init() { + debug = utils.Init("sdk") +} + +const ( + ResolveEndpointUserGuideLink = "" +) + +var once sync.Once +var resolvers []Resolver + +type Resolver interface { + TryResolve(param *ResolveParam) (endpoint string, support bool, err error) + GetName() (name string) +} + +// Resolve resolve endpoint with params +// It will resolve with each supported resolver until anyone resolved +func Resolve(param *ResolveParam) (endpoint string, err error) { + supportedResolvers := getAllResolvers() + var lastErr error + for _, resolver := range supportedResolvers { + endpoint, supported, resolveErr := resolver.TryResolve(param) + if resolveErr != nil { + lastErr = resolveErr + } + + if supported { + debug("resolve endpoint with %s\n", param) + debug("\t%s by resolver(%s)\n", endpoint, resolver.GetName()) + return endpoint, nil + } + } + + // not support + errorMsg := fmt.Sprintf(errors.CanNotResolveEndpointErrorMessage, param, ResolveEndpointUserGuideLink) + err = errors.NewClientError(errors.CanNotResolveEndpointErrorCode, errorMsg, lastErr) + return +} + +func getAllResolvers() []Resolver { + once.Do(func() { + resolvers = []Resolver{ + &LocationResolver{}, + &LocalRegionalResolver{}, + &LocalGlobalResolver{}, + } + }) + return resolvers +} + +type ResolveParam struct { + Domain string + Product string + RegionId string + LocationProduct string + LocationEndpointType string + CommonApi func(request *requests.CommonRequest) (response *responses.CommonResponse, err error) `json:"-"` +} + +func (param *ResolveParam) String() string { + jsonBytes, err := json.Marshal(param) + if err != nil { + return fmt.Sprint("ResolveParam.String() process error:", err) + } + return string(jsonBytes) +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/errors/BUILD.bazel b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/errors/BUILD.bazel new file mode 100644 index 0000000000..080b5c8fa1 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/errors/BUILD.bazel @@ -0,0 +1,18 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "go_default_library", + srcs = [ + "client_error.go", + "error.go", + "server_error.go", + "signature_does_not_match_wrapper.go", + ], + importmap = "k8s.io/kops/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/errors", + importpath = "github.com/aliyun/alibaba-cloud-sdk-go/sdk/errors", + visibility = ["//visibility:public"], + deps = [ + "//vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/utils:go_default_library", + "//vendor/github.com/jmespath/go-jmespath:go_default_library", + ], +) diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/errors/client_error.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/errors/client_error.go new file mode 100644 index 0000000000..1e2d9c0040 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/errors/client_error.go @@ -0,0 +1,92 @@ +/* + * 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. + */ + +package errors + +import "fmt" + +const ( + DefaultClientErrorStatus = 400 + DefaultClientErrorCode = "SDK.ClientError" + + UnsupportedCredentialErrorCode = "SDK.UnsupportedCredential" + UnsupportedCredentialErrorMessage = "Specified credential (type = %s) is not supported, please check" + + CanNotResolveEndpointErrorCode = "SDK.CanNotResolveEndpoint" + CanNotResolveEndpointErrorMessage = "Can not resolve endpoint(param = %s), please check your accessKey with secret, and read the user guide\n %s" + + UnsupportedParamPositionErrorCode = "SDK.UnsupportedParamPosition" + UnsupportedParamPositionErrorMessage = "Specified param position (%s) is not supported, please upgrade sdk and retry" + + AsyncFunctionNotEnabledCode = "SDK.AsyncFunctionNotEnabled" + AsyncFunctionNotEnabledMessage = "Async function is not enabled in client, please invoke 'client.EnableAsync' function" + + UnknownRequestTypeErrorCode = "SDK.UnknownRequestType" + UnknownRequestTypeErrorMessage = "Unknown Request Type: %s" + + MissingParamErrorCode = "SDK.MissingParam" + InvalidParamErrorCode = "SDK.InvalidParam" + + JsonUnmarshalErrorCode = "SDK.JsonUnmarshalError" + JsonUnmarshalErrorMessage = "Failed to unmarshal response, but you can get the data via response.GetHttpStatusCode() and response.GetHttpContentString()" + + TimeoutErrorCode = "SDK.TimeoutError" + TimeoutErrorMessage = "The request timed out %s times(%s for retry), perhaps we should have the threshold raised a little?" +) + +type ClientError struct { + errorCode string + message string + originError error +} + +func NewClientError(errorCode, message string, originErr error) Error { + return &ClientError{ + errorCode: errorCode, + message: message, + originError: originErr, + } +} + +func (err *ClientError) Error() string { + clientErrMsg := fmt.Sprintf("[%s] %s", err.ErrorCode(), err.message) + if err.originError != nil { + return clientErrMsg + "\ncaused by:\n" + err.originError.Error() + } + return clientErrMsg +} + +func (err *ClientError) OriginError() error { + return err.originError +} + +func (*ClientError) HttpStatus() int { + return DefaultClientErrorStatus +} + +func (err *ClientError) ErrorCode() string { + if err.errorCode == "" { + return DefaultClientErrorCode + } else { + return err.errorCode + } +} + +func (err *ClientError) Message() string { + return err.message +} + +func (err *ClientError) String() string { + return err.Error() +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/errors/error.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/errors/error.go new file mode 100644 index 0000000000..49962f3b5e --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/errors/error.go @@ -0,0 +1,23 @@ +/* + * 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. + */ + +package errors + +type Error interface { + error + HttpStatus() int + ErrorCode() string + Message() string + OriginError() error +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/errors/server_error.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/errors/server_error.go new file mode 100644 index 0000000000..1b7810414a --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/errors/server_error.go @@ -0,0 +1,123 @@ +/* + * 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. + */ + +package errors + +import ( + "encoding/json" + "fmt" + + "github.com/jmespath/go-jmespath" +) + +var wrapperList = []ServerErrorWrapper{ + &SignatureDostNotMatchWrapper{}, +} + +type ServerError struct { + httpStatus int + requestId string + hostId string + errorCode string + recommend string + message string + comment string +} + +type ServerErrorWrapper interface { + tryWrap(error *ServerError, wrapInfo map[string]string) bool +} + +func (err *ServerError) Error() string { + return fmt.Sprintf("SDK.ServerError\nErrorCode: %s\nRecommend: %s\nRequestId: %s\nMessage: %s", + err.errorCode, err.comment+err.recommend, err.requestId, err.message) +} + +func NewServerError(httpStatus int, responseContent, comment string) Error { + result := &ServerError{ + httpStatus: httpStatus, + message: responseContent, + comment: comment, + } + + var data interface{} + err := json.Unmarshal([]byte(responseContent), &data) + if err == nil { + requestId, _ := jmespath.Search("RequestId", data) + hostId, _ := jmespath.Search("HostId", data) + errorCode, _ := jmespath.Search("Code", data) + recommend, _ := jmespath.Search("Recommend", data) + message, _ := jmespath.Search("Message", data) + + if requestId != nil { + result.requestId = requestId.(string) + } + if hostId != nil { + result.hostId = hostId.(string) + } + if errorCode != nil { + result.errorCode = errorCode.(string) + } + if recommend != nil { + result.recommend = recommend.(string) + } + if message != nil { + result.message = message.(string) + } + } + + return result +} + +func WrapServerError(originError *ServerError, wrapInfo map[string]string) *ServerError { + for _, wrapper := range wrapperList { + ok := wrapper.tryWrap(originError, wrapInfo) + if ok { + return originError + } + } + return originError +} + +func (err *ServerError) HttpStatus() int { + return err.httpStatus +} + +func (err *ServerError) ErrorCode() string { + return err.errorCode +} + +func (err *ServerError) Message() string { + return err.message +} + +func (err *ServerError) OriginError() error { + return nil +} + +func (err *ServerError) HostId() string { + return err.hostId +} + +func (err *ServerError) RequestId() string { + return err.requestId +} + +func (err *ServerError) Recommend() string { + return err.recommend +} + +func (err *ServerError) Comment() string { + return err.comment +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/errors/signature_does_not_match_wrapper.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/errors/signature_does_not_match_wrapper.go new file mode 100644 index 0000000000..4b09d7d71c --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/errors/signature_does_not_match_wrapper.go @@ -0,0 +1,45 @@ +package errors + +import ( + "strings" + + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/utils" +) + +const SignatureDostNotMatchErrorCode = "SignatureDoesNotMatch" +const IncompleteSignatureErrorCode = "IncompleteSignature" +const MessageContain = "server string to sign is:" + +var debug utils.Debug + +func init() { + debug = utils.Init("sdk") +} + +type SignatureDostNotMatchWrapper struct { +} + +func (*SignatureDostNotMatchWrapper) tryWrap(error *ServerError, wrapInfo map[string]string) (ok bool) { + clientStringToSign := wrapInfo["StringToSign"] + if (error.errorCode == SignatureDostNotMatchErrorCode || error.errorCode == IncompleteSignatureErrorCode) && clientStringToSign != "" { + message := error.message + if strings.Contains(message, MessageContain) { + str := strings.Split(message, MessageContain) + serverStringToSign := str[1] + + if clientStringToSign == serverStringToSign { + // user secret is error + error.recommend = "InvalidAccessKeySecret: Please check you AccessKeySecret" + } else { + debug("Client StringToSign: %s", clientStringToSign) + debug("Server StringToSign: %s", serverStringToSign) + error.recommend = "This may be a bug with the SDK and we hope you can submit this question in the " + + "github issue(https://github.com/aliyun/alibaba-cloud-sdk-go/issues), thanks very much" + } + } + ok = true + return + } + ok = false + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/logger.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/logger.go new file mode 100644 index 0000000000..a01a7bbc98 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/logger.go @@ -0,0 +1,116 @@ +package sdk + +import ( + "encoding/json" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/utils" + "io" + "log" + "os" + "strings" + "time" +) + +var logChannel string +var defaultChannel = "AlibabaCloud" + +type Logger struct { + *log.Logger + formatTemplate string + isOpen bool + lastLogMsg string +} + +var defaultLoggerTemplate = `{time} {channel}: "{method} {uri} HTTP/{version}" {code} {cost} {hostname}` +var loggerParam = []string{"{time}", "{start_time}", "{ts}", "{channel}", "{pid}", "{host}", "{method}", "{uri}", "{version}", "{target}", "{hostname}", "{code}", "{error}", "{req_headers}", "{res_body}", "{res_headers}", "{cost}"} + +func initLogMsg(fieldMap map[string]string) { + for _, value := range loggerParam { + fieldMap[value] = "" + } +} + +func (client *Client) GetLogger() *Logger { + return client.logger +} + +func (client *Client) GetLoggerMsg() string { + if client.logger == nil { + client.SetLogger("", "", os.Stdout, "") + } + return client.logger.lastLogMsg +} + +func (client *Client) SetLogger(level string, channel string, out io.Writer, template string) { + if level == "" { + level = "info" + } + + logChannel = "AlibabaCloud" + if channel != "" { + logChannel = channel + } + log := log.New(out, "["+strings.ToUpper(level)+"]", log.Lshortfile) + if template == "" { + template = defaultLoggerTemplate + } + + client.logger = &Logger{ + Logger: log, + formatTemplate: template, + isOpen: true, + } +} + +func (client *Client) OpenLogger() { + if client.logger == nil { + client.SetLogger("", "", os.Stdout, "") + } + client.logger.isOpen = true +} + +func (client *Client) CloseLogger() { + if client.logger != nil { + client.logger.isOpen = false + } +} + +func (client *Client) SetTemplate(template string) { + if client.logger == nil { + client.SetLogger("", "", os.Stdout, "") + } + client.logger.formatTemplate = template +} + +func (client *Client) GetTemplate() string { + if client.logger == nil { + client.SetLogger("", "", os.Stdout, "") + } + return client.logger.formatTemplate +} + +func TransToString(object interface{}) string { + byt, err := json.Marshal(object) + if err != nil { + return "" + } + return string(byt) +} + +func (client *Client) printLog(fieldMap map[string]string, err error) { + if err != nil { + fieldMap["{error}"] = err.Error() + } + fieldMap["{time}"] = time.Now().Format("2006-01-02 15:04:05") + fieldMap["{ts}"] = utils.GetTimeInFormatISO8601() + fieldMap["{channel}"] = logChannel + if client.logger != nil { + logMsg := client.logger.formatTemplate + for key, value := range fieldMap { + logMsg = strings.Replace(logMsg, key, value, -1) + } + client.logger.lastLogMsg = logMsg + if client.logger.isOpen == true { + client.logger.Output(2, logMsg) + } + } +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests/BUILD.bazel b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests/BUILD.bazel new file mode 100644 index 0000000000..2fcc2b6064 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests/BUILD.bazel @@ -0,0 +1,19 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "go_default_library", + srcs = [ + "acs_request.go", + "common_request.go", + "roa_request.go", + "rpc_request.go", + "types.go", + ], + importmap = "k8s.io/kops/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests", + importpath = "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests", + visibility = ["//visibility:public"], + deps = [ + "//vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/errors:go_default_library", + "//vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/utils:go_default_library", + ], +) diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests/acs_request.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests/acs_request.go new file mode 100644 index 0000000000..5cd7cd1a6f --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests/acs_request.go @@ -0,0 +1,443 @@ +/* + * 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. + */ + +package requests + +import ( + "encoding/json" + "fmt" + "io" + "reflect" + "strconv" + "strings" + "time" + + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/errors" +) + +const ( + RPC = "RPC" + ROA = "ROA" + + HTTP = "HTTP" + HTTPS = "HTTPS" + + DefaultHttpPort = "80" + + GET = "GET" + PUT = "PUT" + POST = "POST" + DELETE = "DELETE" + PATCH = "PATCH" + HEAD = "HEAD" + OPTIONS = "OPTIONS" + + Json = "application/json" + Xml = "application/xml" + Raw = "application/octet-stream" + Form = "application/x-www-form-urlencoded" + + Header = "Header" + Query = "Query" + Body = "Body" + Path = "Path" + + HeaderSeparator = "\n" +) + +// interface +type AcsRequest interface { + GetScheme() string + GetMethod() string + GetDomain() string + GetPort() string + GetRegionId() string + GetHeaders() map[string]string + GetQueryParams() map[string]string + GetFormParams() map[string]string + GetContent() []byte + GetBodyReader() io.Reader + GetStyle() string + GetProduct() string + GetVersion() string + SetVersion(version string) + GetActionName() string + GetAcceptFormat() string + GetLocationServiceCode() string + GetLocationEndpointType() string + GetReadTimeout() time.Duration + GetConnectTimeout() time.Duration + SetReadTimeout(readTimeout time.Duration) + SetConnectTimeout(connectTimeout time.Duration) + SetHTTPSInsecure(isInsecure bool) + GetHTTPSInsecure() *bool + + GetUserAgent() map[string]string + + SetStringToSign(stringToSign string) + GetStringToSign() string + + SetDomain(domain string) + SetContent(content []byte) + SetScheme(scheme string) + BuildUrl() string + BuildQueries() string + + addHeaderParam(key, value string) + addQueryParam(key, value string) + addFormParam(key, value string) + addPathParam(key, value string) +} + +// base class +type baseRequest struct { + Scheme string + Method string + Domain string + Port string + RegionId string + ReadTimeout time.Duration + ConnectTimeout time.Duration + isInsecure *bool + + userAgent map[string]string + product string + version string + + actionName string + + AcceptFormat string + + QueryParams map[string]string + Headers map[string]string + FormParams map[string]string + Content []byte + + locationServiceCode string + locationEndpointType string + + queries string + + stringToSign string +} + +func (request *baseRequest) GetQueryParams() map[string]string { + return request.QueryParams +} + +func (request *baseRequest) GetFormParams() map[string]string { + return request.FormParams +} + +func (request *baseRequest) GetReadTimeout() time.Duration { + return request.ReadTimeout +} + +func (request *baseRequest) GetConnectTimeout() time.Duration { + return request.ConnectTimeout +} + +func (request *baseRequest) SetReadTimeout(readTimeout time.Duration) { + request.ReadTimeout = readTimeout +} + +func (request *baseRequest) SetConnectTimeout(connectTimeout time.Duration) { + request.ConnectTimeout = connectTimeout +} + +func (request *baseRequest) GetHTTPSInsecure() *bool { + return request.isInsecure +} + +func (request *baseRequest) SetHTTPSInsecure(isInsecure bool) { + request.isInsecure = &isInsecure +} + +func (request *baseRequest) GetContent() []byte { + return request.Content +} + +func (request *baseRequest) SetVersion(version string) { + request.version = version +} + +func (request *baseRequest) GetVersion() string { + return request.version +} + +func (request *baseRequest) GetActionName() string { + return request.actionName +} + +func (request *baseRequest) SetContent(content []byte) { + request.Content = content +} + +func (request *baseRequest) GetUserAgent() map[string]string { + return request.userAgent +} + +func (request *baseRequest) AppendUserAgent(key, value string) { + newkey := true + if request.userAgent == nil { + request.userAgent = make(map[string]string) + } + if strings.ToLower(key) != "core" && strings.ToLower(key) != "go" { + for tag, _ := range request.userAgent { + if tag == key { + request.userAgent[tag] = value + newkey = false + } + } + if newkey { + request.userAgent[key] = value + } + } +} + +func (request *baseRequest) addHeaderParam(key, value string) { + request.Headers[key] = value +} + +func (request *baseRequest) addQueryParam(key, value string) { + request.QueryParams[key] = value +} + +func (request *baseRequest) addFormParam(key, value string) { + request.FormParams[key] = value +} + +func (request *baseRequest) GetAcceptFormat() string { + return request.AcceptFormat +} + +func (request *baseRequest) GetLocationServiceCode() string { + return request.locationServiceCode +} + +func (request *baseRequest) GetLocationEndpointType() string { + return request.locationEndpointType +} + +func (request *baseRequest) GetProduct() string { + return request.product +} + +func (request *baseRequest) GetScheme() string { + return request.Scheme +} + +func (request *baseRequest) SetScheme(scheme string) { + request.Scheme = scheme +} + +func (request *baseRequest) GetMethod() string { + return request.Method +} + +func (request *baseRequest) GetDomain() string { + return request.Domain +} + +func (request *baseRequest) SetDomain(host string) { + request.Domain = host +} + +func (request *baseRequest) GetPort() string { + return request.Port +} + +func (request *baseRequest) GetRegionId() string { + return request.RegionId +} + +func (request *baseRequest) GetHeaders() map[string]string { + return request.Headers +} + +func (request *baseRequest) SetContentType(contentType string) { + request.addHeaderParam("Content-Type", contentType) +} + +func (request *baseRequest) GetContentType() (contentType string, contains bool) { + contentType, contains = request.Headers["Content-Type"] + return +} + +func (request *baseRequest) SetStringToSign(stringToSign string) { + request.stringToSign = stringToSign +} + +func (request *baseRequest) GetStringToSign() string { + return request.stringToSign +} + +func defaultBaseRequest() (request *baseRequest) { + request = &baseRequest{ + Scheme: "", + AcceptFormat: "JSON", + Method: GET, + QueryParams: make(map[string]string), + Headers: map[string]string{ + "x-sdk-client": "golang/1.0.0", + "x-sdk-invoke-type": "normal", + "Accept-Encoding": "identity", + }, + FormParams: make(map[string]string), + } + return +} + +func InitParams(request AcsRequest) (err error) { + requestValue := reflect.ValueOf(request).Elem() + err = flatRepeatedList(requestValue, request, "", "") + return +} + +func flatRepeatedList(dataValue reflect.Value, request AcsRequest, position, prefix string) (err error) { + dataType := dataValue.Type() + for i := 0; i < dataType.NumField(); i++ { + field := dataType.Field(i) + name, containsNameTag := field.Tag.Lookup("name") + fieldPosition := position + if fieldPosition == "" { + fieldPosition, _ = field.Tag.Lookup("position") + } + typeTag, containsTypeTag := field.Tag.Lookup("type") + if containsNameTag { + if !containsTypeTag { + // simple param + key := prefix + name + value := dataValue.Field(i).String() + if dataValue.Field(i).Kind().String() == "map" { + byt, _ := json.Marshal(dataValue.Field(i).Interface()) + value = string(byt) + if value == "null" { + value = "" + } + } + err = addParam(request, fieldPosition, key, value) + if err != nil { + return + } + } else if typeTag == "Repeated" { + // repeated param + err = handleRepeatedParams(request, dataValue, prefix, name, fieldPosition, i) + if err != nil { + return + } + } else if typeTag == "Struct" { + err = handleStruct(request, dataValue, prefix, name, fieldPosition, i) + if err != nil { + return + } + } + } + } + return +} + +func handleRepeatedParams(request AcsRequest, dataValue reflect.Value, prefix, name, fieldPosition string, index int) (err error) { + repeatedFieldValue := dataValue.Field(index) + if repeatedFieldValue.Kind() != reflect.Slice { + // possible value: {"[]string", "*[]struct"}, we must call Elem() in the last condition + repeatedFieldValue = repeatedFieldValue.Elem() + } + if repeatedFieldValue.IsValid() && !repeatedFieldValue.IsNil() { + for m := 0; m < repeatedFieldValue.Len(); m++ { + elementValue := repeatedFieldValue.Index(m) + key := prefix + name + "." + strconv.Itoa(m+1) + if elementValue.Type().Kind().String() == "string" { + value := elementValue.String() + err = addParam(request, fieldPosition, key, value) + if err != nil { + return + } + } else { + err = flatRepeatedList(elementValue, request, fieldPosition, key+".") + if err != nil { + return + } + } + } + } + return nil +} + +func handleStruct(request AcsRequest, dataValue reflect.Value, prefix, name, fieldPosition string, index int) (err error) { + valueField := dataValue.Field(index) + if valueField.IsValid() && valueField.String() != "" { + valueFieldType := valueField.Type() + for m := 0; m < valueFieldType.NumField(); m++ { + fieldName := valueFieldType.Field(m).Name + elementValue := valueField.FieldByName(fieldName) + key := prefix + name + "." + fieldName + if elementValue.Type().String() == "[]string" { + if elementValue.IsNil() { + continue + } + for j := 0; j < elementValue.Len(); j++ { + err = addParam(request, fieldPosition, key+"."+strconv.Itoa(j+1), elementValue.Index(j).String()) + if err != nil { + return + } + } + } else { + if elementValue.Type().Kind().String() == "string" { + value := elementValue.String() + err = addParam(request, fieldPosition, key, value) + if err != nil { + return + } + } else if elementValue.Type().Kind().String() == "struct" { + err = flatRepeatedList(elementValue, request, fieldPosition, key+".") + if err != nil { + return + } + } else if !elementValue.IsNil() { + repeatedFieldValue := elementValue.Elem() + if repeatedFieldValue.IsValid() && !repeatedFieldValue.IsNil() { + for m := 0; m < repeatedFieldValue.Len(); m++ { + elementValue := repeatedFieldValue.Index(m) + err = flatRepeatedList(elementValue, request, fieldPosition, key+"."+strconv.Itoa(m+1)+".") + if err != nil { + return + } + } + } + } + } + } + } + return nil +} + +func addParam(request AcsRequest, position, name, value string) (err error) { + if len(value) > 0 { + switch position { + case Header: + request.addHeaderParam(name, value) + case Query: + request.addQueryParam(name, value) + case Path: + request.addPathParam(name, value) + case Body: + request.addFormParam(name, value) + default: + errMsg := fmt.Sprintf(errors.UnsupportedParamPositionErrorMessage, position) + err = errors.NewClientError(errors.UnsupportedParamPositionErrorCode, errMsg, nil) + } + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests/common_request.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests/common_request.go new file mode 100644 index 0000000000..80c170097c --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests/common_request.go @@ -0,0 +1,108 @@ +package requests + +import ( + "bytes" + "fmt" + "io" + "sort" + "strings" +) + +type CommonRequest struct { + *baseRequest + + Version string + ApiName string + Product string + ServiceCode string + + // roa params + PathPattern string + PathParams map[string]string + + Ontology AcsRequest +} + +func NewCommonRequest() (request *CommonRequest) { + request = &CommonRequest{ + baseRequest: defaultBaseRequest(), + } + request.Headers["x-sdk-invoke-type"] = "common" + request.PathParams = make(map[string]string) + return +} + +func (request *CommonRequest) String() string { + request.TransToAcsRequest() + + resultBuilder := bytes.Buffer{} + + mapOutput := func(m map[string]string) { + if len(m) > 0 { + sortedKeys := make([]string, 0) + for k := range m { + sortedKeys = append(sortedKeys, k) + } + + // sort 'string' key in increasing order + sort.Strings(sortedKeys) + + for _, key := range sortedKeys { + resultBuilder.WriteString(key + ": " + m[key] + "\n") + } + } + } + + // Request Line + resultBuilder.WriteString(fmt.Sprintf("%s %s %s/1.1\n", request.Method, request.BuildQueries(), strings.ToUpper(request.Scheme))) + + // Headers + resultBuilder.WriteString("Host" + ": " + request.Domain + "\n") + mapOutput(request.Headers) + + resultBuilder.WriteString("\n") + // Body + if len(request.Content) > 0 { + resultBuilder.WriteString(string(request.Content) + "\n") + } else { + mapOutput(request.FormParams) + } + + return resultBuilder.String() +} + +func (request *CommonRequest) TransToAcsRequest() { + if len(request.PathPattern) > 0 { + roaRequest := &RoaRequest{} + roaRequest.initWithCommonRequest(request) + request.Ontology = roaRequest + } else { + rpcRequest := &RpcRequest{} + rpcRequest.baseRequest = request.baseRequest + rpcRequest.product = request.Product + rpcRequest.version = request.Version + rpcRequest.locationServiceCode = request.ServiceCode + rpcRequest.actionName = request.ApiName + request.Ontology = rpcRequest + } +} + +func (request *CommonRequest) BuildUrl() string { + return request.Ontology.BuildUrl() +} + +func (request *CommonRequest) BuildQueries() string { + return request.Ontology.BuildQueries() +} + +func (request *CommonRequest) GetBodyReader() io.Reader { + return request.Ontology.GetBodyReader() +} + +func (request *CommonRequest) GetStyle() string { + return request.Ontology.GetStyle() +} + +func (request *CommonRequest) addPathParam(key, value string) { + request.PathParams[key] = value +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests/roa_request.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests/roa_request.go new file mode 100644 index 0000000000..5c2877d9e2 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests/roa_request.go @@ -0,0 +1,144 @@ +/* + * 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. + */ + +package requests + +import ( + "bytes" + "fmt" + "io" + "net/url" + "sort" + "strings" + + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/utils" +) + +type RoaRequest struct { + *baseRequest + pathPattern string + PathParams map[string]string +} + +func (*RoaRequest) GetStyle() string { + return ROA +} + +func (request *RoaRequest) GetBodyReader() io.Reader { + if request.FormParams != nil && len(request.FormParams) > 0 { + formString := utils.GetUrlFormedMap(request.FormParams) + return strings.NewReader(formString) + } else if len(request.Content) > 0 { + return bytes.NewReader(request.Content) + } else { + return nil + } +} + +// for sign method, need not url encoded +func (request *RoaRequest) BuildQueries() string { + return request.buildQueries() +} + +func (request *RoaRequest) buildPath() string { + path := request.pathPattern + for key, value := range request.PathParams { + path = strings.Replace(path, "["+key+"]", value, 1) + } + return path +} + +func (request *RoaRequest) buildQueries() string { + // replace path params with value + path := request.buildPath() + queryParams := request.QueryParams + // sort QueryParams by key + var queryKeys []string + for key := range queryParams { + queryKeys = append(queryKeys, key) + } + sort.Strings(queryKeys) + + // append urlBuilder + urlBuilder := bytes.Buffer{} + urlBuilder.WriteString(path) + if len(queryKeys) > 0 { + urlBuilder.WriteString("?") + } + for i := 0; i < len(queryKeys); i++ { + queryKey := queryKeys[i] + urlBuilder.WriteString(queryKey) + if value := queryParams[queryKey]; len(value) > 0 { + urlBuilder.WriteString("=") + urlBuilder.WriteString(value) + } + if i < len(queryKeys)-1 { + urlBuilder.WriteString("&") + } + } + result := urlBuilder.String() + return result +} + +func (request *RoaRequest) buildQueryString() string { + queryParams := request.QueryParams + // sort QueryParams by key + q := url.Values{} + for key, value := range queryParams { + q.Add(key, value) + } + return q.Encode() +} + +func (request *RoaRequest) BuildUrl() string { + // for network trans, need url encoded + scheme := strings.ToLower(request.Scheme) + domain := request.Domain + port := request.Port + path := request.buildPath() + url := fmt.Sprintf("%s://%s:%s%s", scheme, domain, port, path) + querystring := request.buildQueryString() + if len(querystring) > 0 { + url = fmt.Sprintf("%s?%s", url, querystring) + } + return url +} + +func (request *RoaRequest) addPathParam(key, value string) { + request.PathParams[key] = value +} + +func (request *RoaRequest) InitWithApiInfo(product, version, action, uriPattern, serviceCode, endpointType string) { + request.baseRequest = defaultBaseRequest() + request.PathParams = make(map[string]string) + request.Headers["x-acs-version"] = version + request.pathPattern = uriPattern + request.locationServiceCode = serviceCode + request.locationEndpointType = endpointType + request.product = product + //request.version = version + request.actionName = action +} + +func (request *RoaRequest) initWithCommonRequest(commonRequest *CommonRequest) { + request.baseRequest = commonRequest.baseRequest + request.PathParams = commonRequest.PathParams + request.product = commonRequest.Product + //request.version = commonRequest.Version + request.Headers["x-acs-version"] = commonRequest.Version + request.actionName = commonRequest.ApiName + request.pathPattern = commonRequest.PathPattern + request.locationServiceCode = commonRequest.ServiceCode + request.locationEndpointType = "" +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests/rpc_request.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests/rpc_request.go new file mode 100644 index 0000000000..01be6fd04e --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests/rpc_request.go @@ -0,0 +1,79 @@ +/* + * 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. + */ + +package requests + +import ( + "fmt" + "io" + "strings" + + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/utils" +) + +type RpcRequest struct { + *baseRequest +} + +func (request *RpcRequest) init() { + request.baseRequest = defaultBaseRequest() + request.Method = POST +} + +func (*RpcRequest) GetStyle() string { + return RPC +} + +func (request *RpcRequest) GetBodyReader() io.Reader { + if request.FormParams != nil && len(request.FormParams) > 0 { + formString := utils.GetUrlFormedMap(request.FormParams) + return strings.NewReader(formString) + } else { + return strings.NewReader("") + } +} + +func (request *RpcRequest) BuildQueries() string { + request.queries = "/?" + utils.GetUrlFormedMap(request.QueryParams) + return request.queries +} + +func (request *RpcRequest) BuildUrl() string { + url := fmt.Sprintf("%s://%s", strings.ToLower(request.Scheme), request.Domain) + if len(request.Port) > 0 { + url = fmt.Sprintf("%s:%s", url, request.Port) + } + return url + request.BuildQueries() +} + +func (request *RpcRequest) GetVersion() string { + return request.version +} + +func (request *RpcRequest) GetActionName() string { + return request.actionName +} + +func (request *RpcRequest) addPathParam(key, value string) { + panic("not support") +} + +func (request *RpcRequest) InitWithApiInfo(product, version, action, serviceCode, endpointType string) { + request.init() + request.product = product + request.version = version + request.actionName = action + request.locationServiceCode = serviceCode + request.locationEndpointType = endpointType +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests/types.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests/types.go new file mode 100644 index 0000000000..28af63ea10 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests/types.go @@ -0,0 +1,53 @@ +package requests + +import "strconv" + +type Integer string + +func NewInteger(integer int) Integer { + return Integer(strconv.Itoa(integer)) +} + +func (integer Integer) HasValue() bool { + return integer != "" +} + +func (integer Integer) GetValue() (int, error) { + return strconv.Atoi(string(integer)) +} + +func NewInteger64(integer int64) Integer { + return Integer(strconv.FormatInt(integer, 10)) +} + +func (integer Integer) GetValue64() (int64, error) { + return strconv.ParseInt(string(integer), 10, 0) +} + +type Boolean string + +func NewBoolean(bool bool) Boolean { + return Boolean(strconv.FormatBool(bool)) +} + +func (boolean Boolean) HasValue() bool { + return boolean != "" +} + +func (boolean Boolean) GetValue() (bool, error) { + return strconv.ParseBool(string(boolean)) +} + +type Float string + +func NewFloat(f float64) Float { + return Float(strconv.FormatFloat(f, 'f', 6, 64)) +} + +func (float Float) HasValue() bool { + return float != "" +} + +func (float Float) GetValue() (float64, error) { + return strconv.ParseFloat(string(float), 64) +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses/BUILD.bazel b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses/BUILD.bazel new file mode 100644 index 0000000000..7693f5f6e3 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses/BUILD.bazel @@ -0,0 +1,17 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "go_default_library", + srcs = [ + "json_parser.go", + "response.go", + ], + importmap = "k8s.io/kops/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses", + importpath = "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses", + visibility = ["//visibility:public"], + deps = [ + "//vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/errors:go_default_library", + "//vendor/github.com/json-iterator/go:go_default_library", + "//vendor/github.com/modern-go/reflect2:go_default_library", + ], +) diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses/json_parser.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses/json_parser.go new file mode 100644 index 0000000000..cd66316d7f --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses/json_parser.go @@ -0,0 +1,333 @@ +package responses + +import ( + "encoding/json" + "io" + "math" + "reflect" + "strconv" + "strings" + "unsafe" + + jsoniter "github.com/json-iterator/go" + "github.com/modern-go/reflect2" +) + +const maxUint = ^uint(0) +const maxInt = int(maxUint >> 1) +const minInt = -maxInt - 1 + +var jsonParser jsoniter.API + +func init() { + jsonParser = jsoniter.Config{ + EscapeHTML: true, + SortMapKeys: true, + ValidateJsonRawMessage: true, + CaseSensitive: true, + }.Froze() + + jsonParser.RegisterExtension(newBetterFuzzyExtension()) +} + +func newBetterFuzzyExtension() jsoniter.DecoderExtension { + return jsoniter.DecoderExtension{ + reflect2.DefaultTypeOfKind(reflect.String): &nullableFuzzyStringDecoder{}, + reflect2.DefaultTypeOfKind(reflect.Bool): &fuzzyBoolDecoder{}, + reflect2.DefaultTypeOfKind(reflect.Float32): &nullableFuzzyFloat32Decoder{}, + reflect2.DefaultTypeOfKind(reflect.Float64): &nullableFuzzyFloat64Decoder{}, + reflect2.DefaultTypeOfKind(reflect.Int): &nullableFuzzyIntegerDecoder{func(isFloat bool, ptr unsafe.Pointer, iter *jsoniter.Iterator) { + if isFloat { + val := iter.ReadFloat64() + if val > float64(maxInt) || val < float64(minInt) { + iter.ReportError("fuzzy decode int", "exceed range") + return + } + *((*int)(ptr)) = int(val) + } else { + *((*int)(ptr)) = iter.ReadInt() + } + }}, + reflect2.DefaultTypeOfKind(reflect.Uint): &nullableFuzzyIntegerDecoder{func(isFloat bool, ptr unsafe.Pointer, iter *jsoniter.Iterator) { + if isFloat { + val := iter.ReadFloat64() + if val > float64(maxUint) || val < 0 { + iter.ReportError("fuzzy decode uint", "exceed range") + return + } + *((*uint)(ptr)) = uint(val) + } else { + *((*uint)(ptr)) = iter.ReadUint() + } + }}, + reflect2.DefaultTypeOfKind(reflect.Int8): &nullableFuzzyIntegerDecoder{func(isFloat bool, ptr unsafe.Pointer, iter *jsoniter.Iterator) { + if isFloat { + val := iter.ReadFloat64() + if val > float64(math.MaxInt8) || val < float64(math.MinInt8) { + iter.ReportError("fuzzy decode int8", "exceed range") + return + } + *((*int8)(ptr)) = int8(val) + } else { + *((*int8)(ptr)) = iter.ReadInt8() + } + }}, + reflect2.DefaultTypeOfKind(reflect.Uint8): &nullableFuzzyIntegerDecoder{func(isFloat bool, ptr unsafe.Pointer, iter *jsoniter.Iterator) { + if isFloat { + val := iter.ReadFloat64() + if val > float64(math.MaxUint8) || val < 0 { + iter.ReportError("fuzzy decode uint8", "exceed range") + return + } + *((*uint8)(ptr)) = uint8(val) + } else { + *((*uint8)(ptr)) = iter.ReadUint8() + } + }}, + reflect2.DefaultTypeOfKind(reflect.Int16): &nullableFuzzyIntegerDecoder{func(isFloat bool, ptr unsafe.Pointer, iter *jsoniter.Iterator) { + if isFloat { + val := iter.ReadFloat64() + if val > float64(math.MaxInt16) || val < float64(math.MinInt16) { + iter.ReportError("fuzzy decode int16", "exceed range") + return + } + *((*int16)(ptr)) = int16(val) + } else { + *((*int16)(ptr)) = iter.ReadInt16() + } + }}, + reflect2.DefaultTypeOfKind(reflect.Uint16): &nullableFuzzyIntegerDecoder{func(isFloat bool, ptr unsafe.Pointer, iter *jsoniter.Iterator) { + if isFloat { + val := iter.ReadFloat64() + if val > float64(math.MaxUint16) || val < 0 { + iter.ReportError("fuzzy decode uint16", "exceed range") + return + } + *((*uint16)(ptr)) = uint16(val) + } else { + *((*uint16)(ptr)) = iter.ReadUint16() + } + }}, + reflect2.DefaultTypeOfKind(reflect.Int32): &nullableFuzzyIntegerDecoder{func(isFloat bool, ptr unsafe.Pointer, iter *jsoniter.Iterator) { + if isFloat { + val := iter.ReadFloat64() + if val > float64(math.MaxInt32) || val < float64(math.MinInt32) { + iter.ReportError("fuzzy decode int32", "exceed range") + return + } + *((*int32)(ptr)) = int32(val) + } else { + *((*int32)(ptr)) = iter.ReadInt32() + } + }}, + reflect2.DefaultTypeOfKind(reflect.Uint32): &nullableFuzzyIntegerDecoder{func(isFloat bool, ptr unsafe.Pointer, iter *jsoniter.Iterator) { + if isFloat { + val := iter.ReadFloat64() + if val > float64(math.MaxUint32) || val < 0 { + iter.ReportError("fuzzy decode uint32", "exceed range") + return + } + *((*uint32)(ptr)) = uint32(val) + } else { + *((*uint32)(ptr)) = iter.ReadUint32() + } + }}, + reflect2.DefaultTypeOfKind(reflect.Int64): &nullableFuzzyIntegerDecoder{func(isFloat bool, ptr unsafe.Pointer, iter *jsoniter.Iterator) { + if isFloat { + val := iter.ReadFloat64() + if val > float64(math.MaxInt64) || val < float64(math.MinInt64) { + iter.ReportError("fuzzy decode int64", "exceed range") + return + } + *((*int64)(ptr)) = int64(val) + } else { + *((*int64)(ptr)) = iter.ReadInt64() + } + }}, + reflect2.DefaultTypeOfKind(reflect.Uint64): &nullableFuzzyIntegerDecoder{func(isFloat bool, ptr unsafe.Pointer, iter *jsoniter.Iterator) { + if isFloat { + val := iter.ReadFloat64() + if val > float64(math.MaxUint64) || val < 0 { + iter.ReportError("fuzzy decode uint64", "exceed range") + return + } + *((*uint64)(ptr)) = uint64(val) + } else { + *((*uint64)(ptr)) = iter.ReadUint64() + } + }}, + } +} + +type nullableFuzzyStringDecoder struct { +} + +func (decoder *nullableFuzzyStringDecoder) Decode(ptr unsafe.Pointer, iter *jsoniter.Iterator) { + valueType := iter.WhatIsNext() + switch valueType { + case jsoniter.NumberValue: + var number json.Number + iter.ReadVal(&number) + *((*string)(ptr)) = string(number) + case jsoniter.StringValue: + *((*string)(ptr)) = iter.ReadString() + case jsoniter.BoolValue: + *((*string)(ptr)) = strconv.FormatBool(iter.ReadBool()) + case jsoniter.NilValue: + iter.ReadNil() + *((*string)(ptr)) = "" + default: + iter.ReportError("fuzzyStringDecoder", "not number or string or bool") + } +} + +type fuzzyBoolDecoder struct { +} + +func (decoder *fuzzyBoolDecoder) Decode(ptr unsafe.Pointer, iter *jsoniter.Iterator) { + valueType := iter.WhatIsNext() + switch valueType { + case jsoniter.BoolValue: + *((*bool)(ptr)) = iter.ReadBool() + case jsoniter.NumberValue: + var number json.Number + iter.ReadVal(&number) + num, err := number.Int64() + if err != nil { + iter.ReportError("fuzzyBoolDecoder", "get value from json.number failed") + } + if num == 0 { + *((*bool)(ptr)) = false + } else { + *((*bool)(ptr)) = true + } + case jsoniter.StringValue: + strValue := strings.ToLower(iter.ReadString()) + if strValue == "true" { + *((*bool)(ptr)) = true + } else if strValue == "false" || strValue == "" { + *((*bool)(ptr)) = false + } else { + iter.ReportError("fuzzyBoolDecoder", "unsupported bool value: "+strValue) + } + case jsoniter.NilValue: + iter.ReadNil() + *((*bool)(ptr)) = false + default: + iter.ReportError("fuzzyBoolDecoder", "not number or string or nil") + } +} + +type nullableFuzzyIntegerDecoder struct { + fun func(isFloat bool, ptr unsafe.Pointer, iter *jsoniter.Iterator) +} + +func (decoder *nullableFuzzyIntegerDecoder) Decode(ptr unsafe.Pointer, iter *jsoniter.Iterator) { + valueType := iter.WhatIsNext() + var str string + switch valueType { + case jsoniter.NumberValue: + var number json.Number + iter.ReadVal(&number) + str = string(number) + case jsoniter.StringValue: + str = iter.ReadString() + // support empty string + if str == "" { + str = "0" + } + case jsoniter.BoolValue: + if iter.ReadBool() { + str = "1" + } else { + str = "0" + } + case jsoniter.NilValue: + iter.ReadNil() + str = "0" + default: + iter.ReportError("fuzzyIntegerDecoder", "not number or string") + } + newIter := iter.Pool().BorrowIterator([]byte(str)) + defer iter.Pool().ReturnIterator(newIter) + isFloat := strings.IndexByte(str, '.') != -1 + decoder.fun(isFloat, ptr, newIter) + if newIter.Error != nil && newIter.Error != io.EOF { + iter.Error = newIter.Error + } +} + +type nullableFuzzyFloat32Decoder struct { +} + +func (decoder *nullableFuzzyFloat32Decoder) Decode(ptr unsafe.Pointer, iter *jsoniter.Iterator) { + valueType := iter.WhatIsNext() + var str string + switch valueType { + case jsoniter.NumberValue: + *((*float32)(ptr)) = iter.ReadFloat32() + case jsoniter.StringValue: + str = iter.ReadString() + // support empty string + if str == "" { + *((*float32)(ptr)) = 0 + return + } + newIter := iter.Pool().BorrowIterator([]byte(str)) + defer iter.Pool().ReturnIterator(newIter) + *((*float32)(ptr)) = newIter.ReadFloat32() + if newIter.Error != nil && newIter.Error != io.EOF { + iter.Error = newIter.Error + } + case jsoniter.BoolValue: + // support bool to float32 + if iter.ReadBool() { + *((*float32)(ptr)) = 1 + } else { + *((*float32)(ptr)) = 0 + } + case jsoniter.NilValue: + iter.ReadNil() + *((*float32)(ptr)) = 0 + default: + iter.ReportError("nullableFuzzyFloat32Decoder", "not number or string") + } +} + +type nullableFuzzyFloat64Decoder struct { +} + +func (decoder *nullableFuzzyFloat64Decoder) Decode(ptr unsafe.Pointer, iter *jsoniter.Iterator) { + valueType := iter.WhatIsNext() + var str string + switch valueType { + case jsoniter.NumberValue: + *((*float64)(ptr)) = iter.ReadFloat64() + case jsoniter.StringValue: + str = iter.ReadString() + // support empty string + if str == "" { + *((*float64)(ptr)) = 0 + return + } + newIter := iter.Pool().BorrowIterator([]byte(str)) + defer iter.Pool().ReturnIterator(newIter) + *((*float64)(ptr)) = newIter.ReadFloat64() + if newIter.Error != nil && newIter.Error != io.EOF { + iter.Error = newIter.Error + } + case jsoniter.BoolValue: + // support bool to float64 + if iter.ReadBool() { + *((*float64)(ptr)) = 1 + } else { + *((*float64)(ptr)) = 0 + } + case jsoniter.NilValue: + // support empty string + iter.ReadNil() + *((*float64)(ptr)) = 0 + default: + iter.ReportError("nullableFuzzyFloat64Decoder", "not number or string") + } +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses/response.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses/response.go new file mode 100644 index 0000000000..53a156b71a --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses/response.go @@ -0,0 +1,144 @@ +/* + * 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. + */ + +package responses + +import ( + "bytes" + "encoding/xml" + "fmt" + "io/ioutil" + "net/http" + "strings" + + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/errors" +) + +type AcsResponse interface { + IsSuccess() bool + GetHttpStatus() int + GetHttpHeaders() map[string][]string + GetHttpContentString() string + GetHttpContentBytes() []byte + GetOriginHttpResponse() *http.Response + parseFromHttpResponse(httpResponse *http.Response) error +} + +// Unmarshal object from http response body to target Response +func Unmarshal(response AcsResponse, httpResponse *http.Response, format string) (err error) { + err = response.parseFromHttpResponse(httpResponse) + if err != nil { + return + } + if !response.IsSuccess() { + err = errors.NewServerError(response.GetHttpStatus(), response.GetHttpContentString(), "") + return + } + + if _, isCommonResponse := response.(*CommonResponse); isCommonResponse { + // common response need not unmarshal + return + } + + if len(response.GetHttpContentBytes()) == 0 { + return + } + + if strings.ToUpper(format) == "JSON" { + err = jsonParser.Unmarshal(response.GetHttpContentBytes(), response) + if err != nil { + err = errors.NewClientError(errors.JsonUnmarshalErrorCode, errors.JsonUnmarshalErrorMessage, err) + } + } else if strings.ToUpper(format) == "XML" { + err = xml.Unmarshal(response.GetHttpContentBytes(), response) + } + return +} + +type BaseResponse struct { + httpStatus int + httpHeaders map[string][]string + httpContentString string + httpContentBytes []byte + originHttpResponse *http.Response +} + +func (baseResponse *BaseResponse) GetHttpStatus() int { + return baseResponse.httpStatus +} + +func (baseResponse *BaseResponse) GetHttpHeaders() map[string][]string { + return baseResponse.httpHeaders +} + +func (baseResponse *BaseResponse) GetHttpContentString() string { + return baseResponse.httpContentString +} + +func (baseResponse *BaseResponse) GetHttpContentBytes() []byte { + return baseResponse.httpContentBytes +} + +func (baseResponse *BaseResponse) GetOriginHttpResponse() *http.Response { + return baseResponse.originHttpResponse +} + +func (baseResponse *BaseResponse) IsSuccess() bool { + if baseResponse.GetHttpStatus() >= 200 && baseResponse.GetHttpStatus() < 300 { + return true + } + + return false +} + +func (baseResponse *BaseResponse) parseFromHttpResponse(httpResponse *http.Response) (err error) { + defer httpResponse.Body.Close() + body, err := ioutil.ReadAll(httpResponse.Body) + if err != nil { + return + } + baseResponse.httpStatus = httpResponse.StatusCode + baseResponse.httpHeaders = httpResponse.Header + baseResponse.httpContentBytes = body + baseResponse.httpContentString = string(body) + baseResponse.originHttpResponse = httpResponse + return +} + +func (baseResponse *BaseResponse) String() string { + resultBuilder := bytes.Buffer{} + // statusCode + // resultBuilder.WriteString("\n") + resultBuilder.WriteString(fmt.Sprintf("%s %s\n", baseResponse.originHttpResponse.Proto, baseResponse.originHttpResponse.Status)) + // httpHeaders + //resultBuilder.WriteString("Headers:\n") + for key, value := range baseResponse.httpHeaders { + resultBuilder.WriteString(key + ": " + strings.Join(value, ";") + "\n") + } + resultBuilder.WriteString("\n") + // content + //resultBuilder.WriteString("Content:\n") + resultBuilder.WriteString(baseResponse.httpContentString + "\n") + return resultBuilder.String() +} + +type CommonResponse struct { + *BaseResponse +} + +func NewCommonResponse() (response *CommonResponse) { + return &CommonResponse{ + BaseResponse: &BaseResponse{}, + } +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/utils/BUILD.bazel b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/utils/BUILD.bazel new file mode 100644 index 0000000000..a2997e9ac1 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/utils/BUILD.bazel @@ -0,0 +1,12 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "go_default_library", + srcs = [ + "debug.go", + "utils.go", + ], + importmap = "k8s.io/kops/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/utils", + importpath = "github.com/aliyun/alibaba-cloud-sdk-go/sdk/utils", + visibility = ["//visibility:public"], +) diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/utils/debug.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/utils/debug.go new file mode 100644 index 0000000000..09440d27be --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/utils/debug.go @@ -0,0 +1,36 @@ +package utils + +import ( + "fmt" + "os" + "strings" +) + +type Debug func(format string, v ...interface{}) + +var hookGetEnv = func() string { + return os.Getenv("DEBUG") +} + +var hookPrint = func(input string) { + fmt.Println(input) +} + +func Init(flag string) Debug { + enable := false + + env := hookGetEnv() + parts := strings.Split(env, ",") + for _, part := range parts { + if part == flag { + enable = true + break + } + } + + return func(format string, v ...interface{}) { + if enable { + hookPrint(fmt.Sprintf(format, v...)) + } + } +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/utils/utils.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/utils/utils.go new file mode 100644 index 0000000000..f8a3ad3840 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/utils/utils.go @@ -0,0 +1,141 @@ +/* + * 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. + */ + +package utils + +import ( + "crypto/md5" + "crypto/rand" + "encoding/base64" + "encoding/hex" + "hash" + rand2 "math/rand" + "net/url" + "reflect" + "strconv" + "time" +) + +type UUID [16]byte + +const letterBytes = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" + +func GetUUID() (uuidHex string) { + uuid := NewUUID() + uuidHex = hex.EncodeToString(uuid[:]) + return +} + +func RandStringBytes(n int) string { + b := make([]byte, n) + for i := range b { + b[i] = letterBytes[rand2.Intn(len(letterBytes))] + } + return string(b) +} + +func GetMD5Base64(bytes []byte) (base64Value string) { + md5Ctx := md5.New() + md5Ctx.Write(bytes) + md5Value := md5Ctx.Sum(nil) + base64Value = base64.StdEncoding.EncodeToString(md5Value) + return +} + +func GetTimeInFormatISO8601() (timeStr string) { + gmt := time.FixedZone("GMT", 0) + + return time.Now().In(gmt).Format("2006-01-02T15:04:05Z") +} + +func GetTimeInFormatRFC2616() (timeStr string) { + gmt := time.FixedZone("GMT", 0) + + return time.Now().In(gmt).Format("Mon, 02 Jan 2006 15:04:05 GMT") +} + +func GetUrlFormedMap(source map[string]string) (urlEncoded string) { + urlEncoder := url.Values{} + for key, value := range source { + urlEncoder.Add(key, value) + } + urlEncoded = urlEncoder.Encode() + return +} + +func InitStructWithDefaultTag(bean interface{}) { + configType := reflect.TypeOf(bean) + for i := 0; i < configType.Elem().NumField(); i++ { + field := configType.Elem().Field(i) + defaultValue := field.Tag.Get("default") + if defaultValue == "" { + continue + } + setter := reflect.ValueOf(bean).Elem().Field(i) + switch field.Type.String() { + case "int": + intValue, _ := strconv.ParseInt(defaultValue, 10, 64) + setter.SetInt(intValue) + case "time.Duration": + intValue, _ := strconv.ParseInt(defaultValue, 10, 64) + setter.SetInt(intValue) + case "string": + setter.SetString(defaultValue) + case "bool": + boolValue, _ := strconv.ParseBool(defaultValue) + setter.SetBool(boolValue) + } + } +} + +func NewUUID() UUID { + ns := UUID{} + safeRandom(ns[:]) + u := newFromHash(md5.New(), ns, RandStringBytes(16)) + u[6] = (u[6] & 0x0f) | (byte(2) << 4) + u[8] = (u[8]&(0xff>>2) | (0x02 << 6)) + + return u +} + +func newFromHash(h hash.Hash, ns UUID, name string) UUID { + u := UUID{} + h.Write(ns[:]) + h.Write([]byte(name)) + copy(u[:], h.Sum(nil)) + + return u +} + +func safeRandom(dest []byte) { + if _, err := rand.Read(dest); err != nil { + panic(err) + } +} + +func (u UUID) String() string { + buf := make([]byte, 36) + + hex.Encode(buf[0:8], u[0:4]) + buf[8] = '-' + hex.Encode(buf[9:13], u[4:6]) + buf[13] = '-' + hex.Encode(buf[14:18], u[6:8]) + buf[18] = '-' + hex.Encode(buf[19:23], u[8:10]) + buf[23] = '-' + hex.Encode(buf[24:], u[10:]) + + return string(buf) +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/BUILD.bazel b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/BUILD.bazel new file mode 100644 index 0000000000..57a2eaf543 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/BUILD.bazel @@ -0,0 +1,183 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "go_default_library", + srcs = [ + "add_access_control_list_entry.go", + "add_backend_servers.go", + "add_listener_white_list_item.go", + "add_tags.go", + "add_v_server_group_backend_servers.go", + "client.go", + "create_access_control_list.go", + "create_domain_extension.go", + "create_load_balancer.go", + "create_load_balancer_http_listener.go", + "create_load_balancer_https_listener.go", + "create_load_balancer_tcp_listener.go", + "create_load_balancer_udp_listener.go", + "create_master_slave_server_group.go", + "create_rules.go", + "create_v_server_group.go", + "delete_access_control_list.go", + "delete_ca_certificate.go", + "delete_domain_extension.go", + "delete_load_balancer.go", + "delete_load_balancer_listener.go", + "delete_master_slave_server_group.go", + "delete_rules.go", + "delete_server_certificate.go", + "delete_v_server_group.go", + "describe_access_control_list_attribute.go", + "describe_access_control_lists.go", + "describe_available_resource.go", + "describe_ca_certificates.go", + "describe_domain_extension_attribute.go", + "describe_domain_extensions.go", + "describe_health_status.go", + "describe_listener_access_control_attribute.go", + "describe_load_balancer_attribute.go", + "describe_load_balancer_http_listener_attribute.go", + "describe_load_balancer_https_listener_attribute.go", + "describe_load_balancer_tcp_listener_attribute.go", + "describe_load_balancer_udp_listener_attribute.go", + "describe_load_balancers.go", + "describe_master_slave_server_group_attribute.go", + "describe_master_slave_server_groups.go", + "describe_regions.go", + "describe_rule_attribute.go", + "describe_rules.go", + "describe_server_certificates.go", + "describe_tags.go", + "describe_v_server_group_attribute.go", + "describe_v_server_groups.go", + "describe_zones.go", + "endpoint.go", + "list_tag_resources.go", + "modify_load_balancer_instance_spec.go", + "modify_load_balancer_internet_spec.go", + "modify_load_balancer_pay_type.go", + "modify_v_server_group_backend_servers.go", + "remove_access_control_list_entry.go", + "remove_backend_servers.go", + "remove_listener_white_list_item.go", + "remove_tags.go", + "remove_v_server_group_backend_servers.go", + "set_access_control_list_attribute.go", + "set_backend_servers.go", + "set_ca_certificate_name.go", + "set_domain_extension_attribute.go", + "set_listener_access_control_status.go", + "set_load_balancer_delete_protection.go", + "set_load_balancer_http_listener_attribute.go", + "set_load_balancer_https_listener_attribute.go", + "set_load_balancer_name.go", + "set_load_balancer_status.go", + "set_load_balancer_tcp_listener_attribute.go", + "set_load_balancer_udp_listener_attribute.go", + "set_rule.go", + "set_server_certificate_name.go", + "set_v_server_group_attribute.go", + "start_load_balancer_listener.go", + "stop_load_balancer_listener.go", + "struct_acl.go", + "struct_acl_entry.go", + "struct_acl_entrys.go", + "struct_acl_ids_in_describe_load_balancer_http_listener_attribute.go", + "struct_acl_ids_in_describe_load_balancer_https_listener_attribute.go", + "struct_acl_ids_in_describe_load_balancer_tcp_listener_attribute.go", + "struct_acl_ids_in_describe_load_balancer_udp_listener_attribute.go", + "struct_acls.go", + "struct_associated_objects.go", + "struct_available_resource.go", + "struct_available_resources.go", + "struct_backend_server.go", + "struct_backend_server_in_add_v_server_group_backend_servers.go", + "struct_backend_server_in_create_v_server_group.go", + "struct_backend_server_in_describe_load_balancer_attribute.go", + "struct_backend_server_in_describe_v_server_group_attribute.go", + "struct_backend_server_in_modify_v_server_group_backend_servers.go", + "struct_backend_server_in_remove_backend_servers.go", + "struct_backend_server_in_remove_v_server_group_backend_servers.go", + "struct_backend_server_in_set_v_server_group_attribute.go", + "struct_backend_servers_in_add_backend_servers.go", + "struct_backend_servers_in_add_v_server_group_backend_servers.go", + "struct_backend_servers_in_create_v_server_group.go", + "struct_backend_servers_in_describe_health_status.go", + "struct_backend_servers_in_describe_load_balancer_attribute.go", + "struct_backend_servers_in_describe_v_server_group_attribute.go", + "struct_backend_servers_in_modify_v_server_group_backend_servers.go", + "struct_backend_servers_in_remove_backend_servers.go", + "struct_backend_servers_in_remove_v_server_group_backend_servers.go", + "struct_backend_servers_in_set_backend_servers.go", + "struct_backend_servers_in_set_v_server_group_attribute.go", + "struct_ca_certificate.go", + "struct_ca_certificates.go", + "struct_domain_extension.go", + "struct_domain_extensions_in_describe_domain_extensions.go", + "struct_domain_extensions_in_describe_load_balancer_https_listener_attribute.go", + "struct_listener.go", + "struct_listener_port_and_protocal.go", + "struct_listener_port_and_protocol.go", + "struct_listener_ports.go", + "struct_listener_ports_and_protocal.go", + "struct_listener_ports_and_protocol.go", + "struct_listeners_in_describe_master_slave_server_groups.go", + "struct_listeners_in_describe_v_server_groups.go", + "struct_load_balancer.go", + "struct_load_balancers.go", + "struct_master_slave_backend_server.go", + "struct_master_slave_backend_servers_in_create_master_slave_server_group.go", + "struct_master_slave_backend_servers_in_describe_master_slave_server_group_attribute.go", + "struct_master_slave_server_group.go", + "struct_master_slave_server_groups.go", + "struct_port_range.go", + "struct_port_ranges_in_describe_load_balancer_tcp_listener_attribute.go", + "struct_port_ranges_in_describe_load_balancer_udp_listener_attribute.go", + "struct_region.go", + "struct_regions.go", + "struct_related_listener.go", + "struct_related_listeners.go", + "struct_rule.go", + "struct_rules_in_create_rules.go", + "struct_rules_in_describe_load_balancer_http_listener_attribute.go", + "struct_rules_in_describe_load_balancer_https_listener_attribute.go", + "struct_rules_in_describe_rules.go", + "struct_rules_in_describe_v_server_groups.go", + "struct_server_certificate.go", + "struct_server_certificates.go", + "struct_slave_zone.go", + "struct_slave_zones.go", + "struct_subject_alternative_names_in_describe_server_certificates.go", + "struct_subject_alternative_names_in_upload_server_certificate.go", + "struct_support_resource.go", + "struct_support_resources.go", + "struct_tag.go", + "struct_tag_resource.go", + "struct_tag_resources.go", + "struct_tag_set.go", + "struct_tag_sets.go", + "struct_tags_in_describe_access_control_lists.go", + "struct_tags_in_describe_ca_certificates.go", + "struct_tags_in_describe_load_balancers.go", + "struct_tags_in_describe_server_certificates.go", + "struct_v_server_group.go", + "struct_v_server_groups.go", + "struct_zone.go", + "struct_zones.go", + "tag_resources.go", + "untag_resources.go", + "upload_ca_certificate.go", + "upload_server_certificate.go", + ], + importmap = "k8s.io/kops/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb", + importpath = "github.com/aliyun/alibaba-cloud-sdk-go/services/slb", + visibility = ["//visibility:public"], + deps = [ + "//vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk:go_default_library", + "//vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth:go_default_library", + "//vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/provider:go_default_library", + "//vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests:go_default_library", + "//vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses:go_default_library", + ], +) diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/add_access_control_list_entry.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/add_access_control_list_entry.go new file mode 100644 index 0000000000..183abfbc4b --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/add_access_control_list_entry.go @@ -0,0 +1,110 @@ +package slb + +//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" +) + +// AddAccessControlListEntry invokes the slb.AddAccessControlListEntry API synchronously +// api document: https://help.aliyun.com/api/slb/addaccesscontrollistentry.html +func (client *Client) AddAccessControlListEntry(request *AddAccessControlListEntryRequest) (response *AddAccessControlListEntryResponse, err error) { + response = CreateAddAccessControlListEntryResponse() + err = client.DoAction(request, response) + return +} + +// AddAccessControlListEntryWithChan invokes the slb.AddAccessControlListEntry API asynchronously +// api document: https://help.aliyun.com/api/slb/addaccesscontrollistentry.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) AddAccessControlListEntryWithChan(request *AddAccessControlListEntryRequest) (<-chan *AddAccessControlListEntryResponse, <-chan error) { + responseChan := make(chan *AddAccessControlListEntryResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.AddAccessControlListEntry(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// AddAccessControlListEntryWithCallback invokes the slb.AddAccessControlListEntry API asynchronously +// api document: https://help.aliyun.com/api/slb/addaccesscontrollistentry.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) AddAccessControlListEntryWithCallback(request *AddAccessControlListEntryRequest, callback func(response *AddAccessControlListEntryResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *AddAccessControlListEntryResponse + var err error + defer close(result) + response, err = client.AddAccessControlListEntry(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// AddAccessControlListEntryRequest is the request struct for api AddAccessControlListEntry +type AddAccessControlListEntryRequest struct { + *requests.RpcRequest + AccessKeyId string `position:"Query" name:"access_key_id"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + AclEntrys string `position:"Query" name:"AclEntrys"` + AclId string `position:"Query" name:"AclId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + Tags string `position:"Query" name:"Tags"` +} + +// AddAccessControlListEntryResponse is the response struct for api AddAccessControlListEntry +type AddAccessControlListEntryResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateAddAccessControlListEntryRequest creates a request to invoke AddAccessControlListEntry API +func CreateAddAccessControlListEntryRequest() (request *AddAccessControlListEntryRequest) { + request = &AddAccessControlListEntryRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Slb", "2014-05-15", "AddAccessControlListEntry", "slb", "openAPI") + return +} + +// CreateAddAccessControlListEntryResponse creates a response to parse from AddAccessControlListEntry response +func CreateAddAccessControlListEntryResponse() (response *AddAccessControlListEntryResponse) { + response = &AddAccessControlListEntryResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/add_backend_servers.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/add_backend_servers.go new file mode 100644 index 0000000000..79cd1589bb --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/add_backend_servers.go @@ -0,0 +1,112 @@ +package slb + +//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" +) + +// AddBackendServers invokes the slb.AddBackendServers API synchronously +// api document: https://help.aliyun.com/api/slb/addbackendservers.html +func (client *Client) AddBackendServers(request *AddBackendServersRequest) (response *AddBackendServersResponse, err error) { + response = CreateAddBackendServersResponse() + err = client.DoAction(request, response) + return +} + +// AddBackendServersWithChan invokes the slb.AddBackendServers API asynchronously +// api document: https://help.aliyun.com/api/slb/addbackendservers.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) AddBackendServersWithChan(request *AddBackendServersRequest) (<-chan *AddBackendServersResponse, <-chan error) { + responseChan := make(chan *AddBackendServersResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.AddBackendServers(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// AddBackendServersWithCallback invokes the slb.AddBackendServers API asynchronously +// api document: https://help.aliyun.com/api/slb/addbackendservers.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) AddBackendServersWithCallback(request *AddBackendServersRequest, callback func(response *AddBackendServersResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *AddBackendServersResponse + var err error + defer close(result) + response, err = client.AddBackendServers(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// AddBackendServersRequest is the request struct for api AddBackendServers +type AddBackendServersRequest struct { + *requests.RpcRequest + AccessKeyId string `position:"Query" name:"access_key_id"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + BackendServers string `position:"Query" name:"BackendServers"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + Tags string `position:"Query" name:"Tags"` + LoadBalancerId string `position:"Query" name:"LoadBalancerId"` +} + +// AddBackendServersResponse is the response struct for api AddBackendServers +type AddBackendServersResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + LoadBalancerId string `json:"LoadBalancerId" xml:"LoadBalancerId"` + BackendServers BackendServersInAddBackendServers `json:"BackendServers" xml:"BackendServers"` +} + +// CreateAddBackendServersRequest creates a request to invoke AddBackendServers API +func CreateAddBackendServersRequest() (request *AddBackendServersRequest) { + request = &AddBackendServersRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Slb", "2014-05-15", "AddBackendServers", "slb", "openAPI") + return +} + +// CreateAddBackendServersResponse creates a response to parse from AddBackendServers response +func CreateAddBackendServersResponse() (response *AddBackendServersResponse) { + response = &AddBackendServersResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/add_listener_white_list_item.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/add_listener_white_list_item.go new file mode 100644 index 0000000000..f8a56a181e --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/add_listener_white_list_item.go @@ -0,0 +1,112 @@ +package slb + +//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" +) + +// AddListenerWhiteListItem invokes the slb.AddListenerWhiteListItem API synchronously +// api document: https://help.aliyun.com/api/slb/addlistenerwhitelistitem.html +func (client *Client) AddListenerWhiteListItem(request *AddListenerWhiteListItemRequest) (response *AddListenerWhiteListItemResponse, err error) { + response = CreateAddListenerWhiteListItemResponse() + err = client.DoAction(request, response) + return +} + +// AddListenerWhiteListItemWithChan invokes the slb.AddListenerWhiteListItem API asynchronously +// api document: https://help.aliyun.com/api/slb/addlistenerwhitelistitem.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) AddListenerWhiteListItemWithChan(request *AddListenerWhiteListItemRequest) (<-chan *AddListenerWhiteListItemResponse, <-chan error) { + responseChan := make(chan *AddListenerWhiteListItemResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.AddListenerWhiteListItem(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// AddListenerWhiteListItemWithCallback invokes the slb.AddListenerWhiteListItem API asynchronously +// api document: https://help.aliyun.com/api/slb/addlistenerwhitelistitem.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) AddListenerWhiteListItemWithCallback(request *AddListenerWhiteListItemRequest, callback func(response *AddListenerWhiteListItemResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *AddListenerWhiteListItemResponse + var err error + defer close(result) + response, err = client.AddListenerWhiteListItem(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// AddListenerWhiteListItemRequest is the request struct for api AddListenerWhiteListItem +type AddListenerWhiteListItemRequest struct { + *requests.RpcRequest + AccessKeyId string `position:"Query" name:"access_key_id"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + SourceItems string `position:"Query" name:"SourceItems"` + ListenerPort requests.Integer `position:"Query" name:"ListenerPort"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + ListenerProtocol string `position:"Query" name:"ListenerProtocol"` + Tags string `position:"Query" name:"Tags"` + LoadBalancerId string `position:"Query" name:"LoadBalancerId"` +} + +// AddListenerWhiteListItemResponse is the response struct for api AddListenerWhiteListItem +type AddListenerWhiteListItemResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateAddListenerWhiteListItemRequest creates a request to invoke AddListenerWhiteListItem API +func CreateAddListenerWhiteListItemRequest() (request *AddListenerWhiteListItemRequest) { + request = &AddListenerWhiteListItemRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Slb", "2014-05-15", "AddListenerWhiteListItem", "slb", "openAPI") + return +} + +// CreateAddListenerWhiteListItemResponse creates a response to parse from AddListenerWhiteListItem response +func CreateAddListenerWhiteListItemResponse() (response *AddListenerWhiteListItemResponse) { + response = &AddListenerWhiteListItemResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/add_tags.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/add_tags.go new file mode 100644 index 0000000000..f4a4f4fe0d --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/add_tags.go @@ -0,0 +1,109 @@ +package slb + +//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" +) + +// AddTags invokes the slb.AddTags API synchronously +// api document: https://help.aliyun.com/api/slb/addtags.html +func (client *Client) AddTags(request *AddTagsRequest) (response *AddTagsResponse, err error) { + response = CreateAddTagsResponse() + err = client.DoAction(request, response) + return +} + +// AddTagsWithChan invokes the slb.AddTags API asynchronously +// api document: https://help.aliyun.com/api/slb/addtags.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) AddTagsWithChan(request *AddTagsRequest) (<-chan *AddTagsResponse, <-chan error) { + responseChan := make(chan *AddTagsResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.AddTags(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// AddTagsWithCallback invokes the slb.AddTags API asynchronously +// api document: https://help.aliyun.com/api/slb/addtags.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) AddTagsWithCallback(request *AddTagsRequest, callback func(response *AddTagsResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *AddTagsResponse + var err error + defer close(result) + response, err = client.AddTags(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// AddTagsRequest is the request struct for api AddTags +type AddTagsRequest struct { + *requests.RpcRequest + AccessKeyId string `position:"Query" name:"access_key_id"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + Tags string `position:"Query" name:"Tags"` + LoadBalancerId string `position:"Query" name:"LoadBalancerId"` +} + +// AddTagsResponse is the response struct for api AddTags +type AddTagsResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateAddTagsRequest creates a request to invoke AddTags API +func CreateAddTagsRequest() (request *AddTagsRequest) { + request = &AddTagsRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Slb", "2014-05-15", "AddTags", "slb", "openAPI") + return +} + +// CreateAddTagsResponse creates a response to parse from AddTags response +func CreateAddTagsResponse() (response *AddTagsResponse) { + response = &AddTagsResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/add_v_server_group_backend_servers.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/add_v_server_group_backend_servers.go new file mode 100644 index 0000000000..533a64432f --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/add_v_server_group_backend_servers.go @@ -0,0 +1,112 @@ +package slb + +//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" +) + +// AddVServerGroupBackendServers invokes the slb.AddVServerGroupBackendServers API synchronously +// api document: https://help.aliyun.com/api/slb/addvservergroupbackendservers.html +func (client *Client) AddVServerGroupBackendServers(request *AddVServerGroupBackendServersRequest) (response *AddVServerGroupBackendServersResponse, err error) { + response = CreateAddVServerGroupBackendServersResponse() + err = client.DoAction(request, response) + return +} + +// AddVServerGroupBackendServersWithChan invokes the slb.AddVServerGroupBackendServers API asynchronously +// api document: https://help.aliyun.com/api/slb/addvservergroupbackendservers.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) AddVServerGroupBackendServersWithChan(request *AddVServerGroupBackendServersRequest) (<-chan *AddVServerGroupBackendServersResponse, <-chan error) { + responseChan := make(chan *AddVServerGroupBackendServersResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.AddVServerGroupBackendServers(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// AddVServerGroupBackendServersWithCallback invokes the slb.AddVServerGroupBackendServers API asynchronously +// api document: https://help.aliyun.com/api/slb/addvservergroupbackendservers.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) AddVServerGroupBackendServersWithCallback(request *AddVServerGroupBackendServersRequest, callback func(response *AddVServerGroupBackendServersResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *AddVServerGroupBackendServersResponse + var err error + defer close(result) + response, err = client.AddVServerGroupBackendServers(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// AddVServerGroupBackendServersRequest is the request struct for api AddVServerGroupBackendServers +type AddVServerGroupBackendServersRequest struct { + *requests.RpcRequest + AccessKeyId string `position:"Query" name:"access_key_id"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + BackendServers string `position:"Query" name:"BackendServers"` + VServerGroupId string `position:"Query" name:"VServerGroupId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + Tags string `position:"Query" name:"Tags"` +} + +// AddVServerGroupBackendServersResponse is the response struct for api AddVServerGroupBackendServers +type AddVServerGroupBackendServersResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + VServerGroupId string `json:"VServerGroupId" xml:"VServerGroupId"` + BackendServers BackendServersInAddVServerGroupBackendServers `json:"BackendServers" xml:"BackendServers"` +} + +// CreateAddVServerGroupBackendServersRequest creates a request to invoke AddVServerGroupBackendServers API +func CreateAddVServerGroupBackendServersRequest() (request *AddVServerGroupBackendServersRequest) { + request = &AddVServerGroupBackendServersRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Slb", "2014-05-15", "AddVServerGroupBackendServers", "slb", "openAPI") + return +} + +// CreateAddVServerGroupBackendServersResponse creates a response to parse from AddVServerGroupBackendServers response +func CreateAddVServerGroupBackendServersResponse() (response *AddVServerGroupBackendServersResponse) { + response = &AddVServerGroupBackendServersResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/client.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/client.go new file mode 100644 index 0000000000..bbdba01471 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/client.go @@ -0,0 +1,129 @@ +package slb + +//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 ( + "reflect" + + "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 +} + +// SetClientProperty Set Property by Reflect +func SetClientProperty(client *Client, propertyName string, propertyValue interface{}) { + v := reflect.ValueOf(client).Elem() + if v.FieldByName(propertyName).IsValid() && v.FieldByName(propertyName).CanSet() { + v.FieldByName(propertyName).Set(reflect.ValueOf(propertyValue)) + } +} + +// SetEndpointDataToClient Set EndpointMap and ENdpointType +func SetEndpointDataToClient(client *Client) { + SetClientProperty(client, "EndpointMap", GetEndpointMap()) + SetClientProperty(client, "EndpointType", GetEndpointType()) +} + +// NewClient creates a sdk client with environment variables +func NewClient() (client *Client, err error) { + client = &Client{} + err = client.Init() + SetEndpointDataToClient(client) + 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) + SetEndpointDataToClient(client) + 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) + SetEndpointDataToClient(client) + 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) + SetEndpointDataToClient(client) + 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) + SetEndpointDataToClient(client) + 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) + SetEndpointDataToClient(client) + 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) + SetEndpointDataToClient(client) + 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) + SetEndpointDataToClient(client) + 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) + SetEndpointDataToClient(client) + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/create_access_control_list.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/create_access_control_list.go new file mode 100644 index 0000000000..bdfe42b34c --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/create_access_control_list.go @@ -0,0 +1,112 @@ +package slb + +//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" +) + +// CreateAccessControlList invokes the slb.CreateAccessControlList API synchronously +// api document: https://help.aliyun.com/api/slb/createaccesscontrollist.html +func (client *Client) CreateAccessControlList(request *CreateAccessControlListRequest) (response *CreateAccessControlListResponse, err error) { + response = CreateCreateAccessControlListResponse() + err = client.DoAction(request, response) + return +} + +// CreateAccessControlListWithChan invokes the slb.CreateAccessControlList API asynchronously +// api document: https://help.aliyun.com/api/slb/createaccesscontrollist.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) CreateAccessControlListWithChan(request *CreateAccessControlListRequest) (<-chan *CreateAccessControlListResponse, <-chan error) { + responseChan := make(chan *CreateAccessControlListResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.CreateAccessControlList(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// CreateAccessControlListWithCallback invokes the slb.CreateAccessControlList API asynchronously +// api document: https://help.aliyun.com/api/slb/createaccesscontrollist.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) CreateAccessControlListWithCallback(request *CreateAccessControlListRequest, callback func(response *CreateAccessControlListResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *CreateAccessControlListResponse + var err error + defer close(result) + response, err = client.CreateAccessControlList(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// CreateAccessControlListRequest is the request struct for api CreateAccessControlList +type CreateAccessControlListRequest struct { + *requests.RpcRequest + AccessKeyId string `position:"Query" name:"access_key_id"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + AclName string `position:"Query" name:"AclName"` + AddressIPVersion string `position:"Query" name:"AddressIPVersion"` + ResourceGroupId string `position:"Query" name:"ResourceGroupId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + Tags string `position:"Query" name:"Tags"` +} + +// CreateAccessControlListResponse is the response struct for api CreateAccessControlList +type CreateAccessControlListResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + AclId string `json:"AclId" xml:"AclId"` +} + +// CreateCreateAccessControlListRequest creates a request to invoke CreateAccessControlList API +func CreateCreateAccessControlListRequest() (request *CreateAccessControlListRequest) { + request = &CreateAccessControlListRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Slb", "2014-05-15", "CreateAccessControlList", "slb", "openAPI") + return +} + +// CreateCreateAccessControlListResponse creates a response to parse from CreateAccessControlList response +func CreateCreateAccessControlListResponse() (response *CreateAccessControlListResponse) { + response = &CreateAccessControlListResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/create_domain_extension.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/create_domain_extension.go new file mode 100644 index 0000000000..0efaaf377f --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/create_domain_extension.go @@ -0,0 +1,114 @@ +package slb + +//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" +) + +// CreateDomainExtension invokes the slb.CreateDomainExtension API synchronously +// api document: https://help.aliyun.com/api/slb/createdomainextension.html +func (client *Client) CreateDomainExtension(request *CreateDomainExtensionRequest) (response *CreateDomainExtensionResponse, err error) { + response = CreateCreateDomainExtensionResponse() + err = client.DoAction(request, response) + return +} + +// CreateDomainExtensionWithChan invokes the slb.CreateDomainExtension API asynchronously +// api document: https://help.aliyun.com/api/slb/createdomainextension.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) CreateDomainExtensionWithChan(request *CreateDomainExtensionRequest) (<-chan *CreateDomainExtensionResponse, <-chan error) { + responseChan := make(chan *CreateDomainExtensionResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.CreateDomainExtension(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// CreateDomainExtensionWithCallback invokes the slb.CreateDomainExtension API asynchronously +// api document: https://help.aliyun.com/api/slb/createdomainextension.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) CreateDomainExtensionWithCallback(request *CreateDomainExtensionRequest, callback func(response *CreateDomainExtensionResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *CreateDomainExtensionResponse + var err error + defer close(result) + response, err = client.CreateDomainExtension(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// CreateDomainExtensionRequest is the request struct for api CreateDomainExtension +type CreateDomainExtensionRequest struct { + *requests.RpcRequest + AccessKeyId string `position:"Query" name:"access_key_id"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ListenerPort requests.Integer `position:"Query" name:"ListenerPort"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + ServerCertificateId string `position:"Query" name:"ServerCertificateId"` + Tags string `position:"Query" name:"Tags"` + LoadBalancerId string `position:"Query" name:"LoadBalancerId"` + Domain string `position:"Query" name:"Domain"` +} + +// CreateDomainExtensionResponse is the response struct for api CreateDomainExtension +type CreateDomainExtensionResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + ListenerPort int `json:"ListenerPort" xml:"ListenerPort"` + DomainExtensionId string `json:"DomainExtensionId" xml:"DomainExtensionId"` +} + +// CreateCreateDomainExtensionRequest creates a request to invoke CreateDomainExtension API +func CreateCreateDomainExtensionRequest() (request *CreateDomainExtensionRequest) { + request = &CreateDomainExtensionRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Slb", "2014-05-15", "CreateDomainExtension", "slb", "openAPI") + return +} + +// CreateCreateDomainExtensionResponse creates a response to parse from CreateDomainExtension response +func CreateCreateDomainExtensionResponse() (response *CreateDomainExtensionResponse) { + response = &CreateDomainExtensionResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/create_load_balancer.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/create_load_balancer.go new file mode 100644 index 0000000000..bb40f98e5f --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/create_load_balancer.go @@ -0,0 +1,139 @@ +package slb + +//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 slb.CreateLoadBalancer API synchronously +// api document: https://help.aliyun.com/api/slb/createloadbalancer.html +func (client *Client) CreateLoadBalancer(request *CreateLoadBalancerRequest) (response *CreateLoadBalancerResponse, err error) { + response = CreateCreateLoadBalancerResponse() + err = client.DoAction(request, response) + return +} + +// CreateLoadBalancerWithChan invokes the slb.CreateLoadBalancer API asynchronously +// api document: https://help.aliyun.com/api/slb/createloadbalancer.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +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 slb.CreateLoadBalancer API asynchronously +// api document: https://help.aliyun.com/api/slb/createloadbalancer.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +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 + AccessKeyId string `position:"Query" name:"access_key_id"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + SupportPrivateLink requests.Boolean `position:"Query" name:"SupportPrivateLink"` + ClientToken string `position:"Query" name:"ClientToken"` + CloudType string `position:"Query" name:"CloudType"` + AddressIPVersion string `position:"Query" name:"AddressIPVersion"` + MasterZoneId string `position:"Query" name:"MasterZoneId"` + Duration requests.Integer `position:"Query" name:"Duration"` + ResourceGroupId string `position:"Query" name:"ResourceGroupId"` + LoadBalancerName string `position:"Query" name:"LoadBalancerName"` + AddressType string `position:"Query" name:"AddressType"` + SlaveZoneId string `position:"Query" name:"SlaveZoneId"` + DeleteProtection string `position:"Query" name:"DeleteProtection"` + LoadBalancerSpec string `position:"Query" name:"LoadBalancerSpec"` + AutoPay requests.Boolean `position:"Query" name:"AutoPay"` + Address string `position:"Query" name:"Address"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + Bandwidth requests.Integer `position:"Query" name:"Bandwidth"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + Tags string `position:"Query" name:"Tags"` + VSwitchId string `position:"Query" name:"VSwitchId"` + EnableVpcVipFlow string `position:"Query" name:"EnableVpcVipFlow"` + InternetChargeType string `position:"Query" name:"InternetChargeType"` + VpcId string `position:"Query" name:"VpcId"` + PayType string `position:"Query" name:"PayType"` + PricingCycle string `position:"Query" name:"PricingCycle"` + Ratio requests.Integer `position:"Query" name:"Ratio"` +} + +// CreateLoadBalancerResponse is the response struct for api CreateLoadBalancer +type CreateLoadBalancerResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + LoadBalancerId string `json:"LoadBalancerId" xml:"LoadBalancerId"` + ResourceGroupId string `json:"ResourceGroupId" xml:"ResourceGroupId"` + Address string `json:"Address" xml:"Address"` + LoadBalancerName string `json:"LoadBalancerName" xml:"LoadBalancerName"` + VpcId string `json:"VpcId" xml:"VpcId"` + VSwitchId string `json:"VSwitchId" xml:"VSwitchId"` + NetworkType string `json:"NetworkType" xml:"NetworkType"` + OrderId int64 `json:"OrderId" xml:"OrderId"` + AddressIPVersion string `json:"AddressIPVersion" xml:"AddressIPVersion"` +} + +// CreateCreateLoadBalancerRequest creates a request to invoke CreateLoadBalancer API +func CreateCreateLoadBalancerRequest() (request *CreateLoadBalancerRequest) { + request = &CreateLoadBalancerRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Slb", "2014-05-15", "CreateLoadBalancer", "slb", "openAPI") + return +} + +// CreateCreateLoadBalancerResponse creates a response to parse from CreateLoadBalancer response +func CreateCreateLoadBalancerResponse() (response *CreateLoadBalancerResponse) { + response = &CreateLoadBalancerResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/create_load_balancer_http_listener.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/create_load_balancer_http_listener.go new file mode 100644 index 0000000000..b019756a42 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/create_load_balancer_http_listener.go @@ -0,0 +1,145 @@ +package slb + +//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" +) + +// CreateLoadBalancerHTTPListener invokes the slb.CreateLoadBalancerHTTPListener API synchronously +// api document: https://help.aliyun.com/api/slb/createloadbalancerhttplistener.html +func (client *Client) CreateLoadBalancerHTTPListener(request *CreateLoadBalancerHTTPListenerRequest) (response *CreateLoadBalancerHTTPListenerResponse, err error) { + response = CreateCreateLoadBalancerHTTPListenerResponse() + err = client.DoAction(request, response) + return +} + +// CreateLoadBalancerHTTPListenerWithChan invokes the slb.CreateLoadBalancerHTTPListener API asynchronously +// api document: https://help.aliyun.com/api/slb/createloadbalancerhttplistener.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) CreateLoadBalancerHTTPListenerWithChan(request *CreateLoadBalancerHTTPListenerRequest) (<-chan *CreateLoadBalancerHTTPListenerResponse, <-chan error) { + responseChan := make(chan *CreateLoadBalancerHTTPListenerResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.CreateLoadBalancerHTTPListener(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// CreateLoadBalancerHTTPListenerWithCallback invokes the slb.CreateLoadBalancerHTTPListener API asynchronously +// api document: https://help.aliyun.com/api/slb/createloadbalancerhttplistener.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) CreateLoadBalancerHTTPListenerWithCallback(request *CreateLoadBalancerHTTPListenerRequest, callback func(response *CreateLoadBalancerHTTPListenerResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *CreateLoadBalancerHTTPListenerResponse + var err error + defer close(result) + response, err = client.CreateLoadBalancerHTTPListener(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// CreateLoadBalancerHTTPListenerRequest is the request struct for api CreateLoadBalancerHTTPListener +type CreateLoadBalancerHTTPListenerRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + HealthCheckTimeout requests.Integer `position:"Query" name:"HealthCheckTimeout"` + ListenerForward string `position:"Query" name:"ListenerForward"` + XForwardedFor string `position:"Query" name:"XForwardedFor"` + HealthCheckURI string `position:"Query" name:"HealthCheckURI"` + AclStatus string `position:"Query" name:"AclStatus"` + AclType string `position:"Query" name:"AclType"` + HealthCheck string `position:"Query" name:"HealthCheck"` + VpcIds string `position:"Query" name:"VpcIds"` + VServerGroupId string `position:"Query" name:"VServerGroupId"` + AclId string `position:"Query" name:"AclId"` + Cookie string `position:"Query" name:"Cookie"` + HealthCheckMethod string `position:"Query" name:"HealthCheckMethod"` + HealthCheckDomain string `position:"Query" name:"HealthCheckDomain"` + RequestTimeout requests.Integer `position:"Query" name:"RequestTimeout"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + Tags string `position:"Query" name:"Tags"` + LoadBalancerId string `position:"Query" name:"LoadBalancerId"` + XForwardedForSLBIP string `position:"Query" name:"XForwardedFor_SLBIP"` + BackendServerPort requests.Integer `position:"Query" name:"BackendServerPort"` + HealthCheckInterval requests.Integer `position:"Query" name:"HealthCheckInterval"` + XForwardedForSLBID string `position:"Query" name:"XForwardedFor_SLBID"` + HealthCheckHttpVersion string `position:"Query" name:"HealthCheckHttpVersion"` + AccessKeyId string `position:"Query" name:"access_key_id"` + Description string `position:"Query" name:"Description"` + UnhealthyThreshold requests.Integer `position:"Query" name:"UnhealthyThreshold"` + HealthyThreshold requests.Integer `position:"Query" name:"HealthyThreshold"` + Scheduler string `position:"Query" name:"Scheduler"` + ForwardPort requests.Integer `position:"Query" name:"ForwardPort"` + MaxConnection requests.Integer `position:"Query" name:"MaxConnection"` + CookieTimeout requests.Integer `position:"Query" name:"CookieTimeout"` + StickySessionType string `position:"Query" name:"StickySessionType"` + ListenerPort requests.Integer `position:"Query" name:"ListenerPort"` + HealthCheckType string `position:"Query" name:"HealthCheckType"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + Bandwidth requests.Integer `position:"Query" name:"Bandwidth"` + StickySession string `position:"Query" name:"StickySession"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + Gzip string `position:"Query" name:"Gzip"` + IdleTimeout requests.Integer `position:"Query" name:"IdleTimeout"` + XForwardedForProto string `position:"Query" name:"XForwardedFor_proto"` + HealthCheckConnectPort requests.Integer `position:"Query" name:"HealthCheckConnectPort"` + HealthCheckHttpCode string `position:"Query" name:"HealthCheckHttpCode"` +} + +// CreateLoadBalancerHTTPListenerResponse is the response struct for api CreateLoadBalancerHTTPListener +type CreateLoadBalancerHTTPListenerResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateCreateLoadBalancerHTTPListenerRequest creates a request to invoke CreateLoadBalancerHTTPListener API +func CreateCreateLoadBalancerHTTPListenerRequest() (request *CreateLoadBalancerHTTPListenerRequest) { + request = &CreateLoadBalancerHTTPListenerRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Slb", "2014-05-15", "CreateLoadBalancerHTTPListener", "slb", "openAPI") + return +} + +// CreateCreateLoadBalancerHTTPListenerResponse creates a response to parse from CreateLoadBalancerHTTPListener response +func CreateCreateLoadBalancerHTTPListenerResponse() (response *CreateLoadBalancerHTTPListenerResponse) { + response = &CreateLoadBalancerHTTPListenerResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/create_load_balancer_https_listener.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/create_load_balancer_https_listener.go new file mode 100644 index 0000000000..5bd0c7aad6 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/create_load_balancer_https_listener.go @@ -0,0 +1,148 @@ +package slb + +//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" +) + +// CreateLoadBalancerHTTPSListener invokes the slb.CreateLoadBalancerHTTPSListener API synchronously +// api document: https://help.aliyun.com/api/slb/createloadbalancerhttpslistener.html +func (client *Client) CreateLoadBalancerHTTPSListener(request *CreateLoadBalancerHTTPSListenerRequest) (response *CreateLoadBalancerHTTPSListenerResponse, err error) { + response = CreateCreateLoadBalancerHTTPSListenerResponse() + err = client.DoAction(request, response) + return +} + +// CreateLoadBalancerHTTPSListenerWithChan invokes the slb.CreateLoadBalancerHTTPSListener API asynchronously +// api document: https://help.aliyun.com/api/slb/createloadbalancerhttpslistener.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) CreateLoadBalancerHTTPSListenerWithChan(request *CreateLoadBalancerHTTPSListenerRequest) (<-chan *CreateLoadBalancerHTTPSListenerResponse, <-chan error) { + responseChan := make(chan *CreateLoadBalancerHTTPSListenerResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.CreateLoadBalancerHTTPSListener(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// CreateLoadBalancerHTTPSListenerWithCallback invokes the slb.CreateLoadBalancerHTTPSListener API asynchronously +// api document: https://help.aliyun.com/api/slb/createloadbalancerhttpslistener.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) CreateLoadBalancerHTTPSListenerWithCallback(request *CreateLoadBalancerHTTPSListenerRequest, callback func(response *CreateLoadBalancerHTTPSListenerResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *CreateLoadBalancerHTTPSListenerResponse + var err error + defer close(result) + response, err = client.CreateLoadBalancerHTTPSListener(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// CreateLoadBalancerHTTPSListenerRequest is the request struct for api CreateLoadBalancerHTTPSListener +type CreateLoadBalancerHTTPSListenerRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + HealthCheckTimeout requests.Integer `position:"Query" name:"HealthCheckTimeout"` + XForwardedFor string `position:"Query" name:"XForwardedFor"` + HealthCheckURI string `position:"Query" name:"HealthCheckURI"` + AclStatus string `position:"Query" name:"AclStatus"` + AclType string `position:"Query" name:"AclType"` + HealthCheck string `position:"Query" name:"HealthCheck"` + VpcIds string `position:"Query" name:"VpcIds"` + VServerGroupId string `position:"Query" name:"VServerGroupId"` + AclId string `position:"Query" name:"AclId"` + Cookie string `position:"Query" name:"Cookie"` + HealthCheckMethod string `position:"Query" name:"HealthCheckMethod"` + HealthCheckDomain string `position:"Query" name:"HealthCheckDomain"` + RequestTimeout requests.Integer `position:"Query" name:"RequestTimeout"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + CACertificateId string `position:"Query" name:"CACertificateId"` + BackendProtocol string `position:"Query" name:"BackendProtocol"` + Tags string `position:"Query" name:"Tags"` + LoadBalancerId string `position:"Query" name:"LoadBalancerId"` + XForwardedForSLBIP string `position:"Query" name:"XForwardedFor_SLBIP"` + BackendServerPort requests.Integer `position:"Query" name:"BackendServerPort"` + HealthCheckInterval requests.Integer `position:"Query" name:"HealthCheckInterval"` + XForwardedForSLBID string `position:"Query" name:"XForwardedFor_SLBID"` + HealthCheckHttpVersion string `position:"Query" name:"HealthCheckHttpVersion"` + AccessKeyId string `position:"Query" name:"access_key_id"` + Description string `position:"Query" name:"Description"` + UnhealthyThreshold requests.Integer `position:"Query" name:"UnhealthyThreshold"` + HealthyThreshold requests.Integer `position:"Query" name:"HealthyThreshold"` + Scheduler string `position:"Query" name:"Scheduler"` + MaxConnection requests.Integer `position:"Query" name:"MaxConnection"` + EnableHttp2 string `position:"Query" name:"EnableHttp2"` + CookieTimeout requests.Integer `position:"Query" name:"CookieTimeout"` + StickySessionType string `position:"Query" name:"StickySessionType"` + ListenerPort requests.Integer `position:"Query" name:"ListenerPort"` + HealthCheckType string `position:"Query" name:"HealthCheckType"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + Bandwidth requests.Integer `position:"Query" name:"Bandwidth"` + StickySession string `position:"Query" name:"StickySession"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + Gzip string `position:"Query" name:"Gzip"` + TLSCipherPolicy string `position:"Query" name:"TLSCipherPolicy"` + ServerCertificateId string `position:"Query" name:"ServerCertificateId"` + IdleTimeout requests.Integer `position:"Query" name:"IdleTimeout"` + XForwardedForProto string `position:"Query" name:"XForwardedFor_proto"` + HealthCheckConnectPort requests.Integer `position:"Query" name:"HealthCheckConnectPort"` + HealthCheckHttpCode string `position:"Query" name:"HealthCheckHttpCode"` +} + +// CreateLoadBalancerHTTPSListenerResponse is the response struct for api CreateLoadBalancerHTTPSListener +type CreateLoadBalancerHTTPSListenerResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateCreateLoadBalancerHTTPSListenerRequest creates a request to invoke CreateLoadBalancerHTTPSListener API +func CreateCreateLoadBalancerHTTPSListenerRequest() (request *CreateLoadBalancerHTTPSListenerRequest) { + request = &CreateLoadBalancerHTTPSListenerRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Slb", "2014-05-15", "CreateLoadBalancerHTTPSListener", "slb", "openAPI") + return +} + +// CreateCreateLoadBalancerHTTPSListenerResponse creates a response to parse from CreateLoadBalancerHTTPSListener response +func CreateCreateLoadBalancerHTTPSListenerResponse() (response *CreateLoadBalancerHTTPSListenerResponse) { + response = &CreateLoadBalancerHTTPSListenerResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/create_load_balancer_tcp_listener.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/create_load_balancer_tcp_listener.go new file mode 100644 index 0000000000..08568f05e6 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/create_load_balancer_tcp_listener.go @@ -0,0 +1,142 @@ +package slb + +//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" +) + +// CreateLoadBalancerTCPListener invokes the slb.CreateLoadBalancerTCPListener API synchronously +// api document: https://help.aliyun.com/api/slb/createloadbalancertcplistener.html +func (client *Client) CreateLoadBalancerTCPListener(request *CreateLoadBalancerTCPListenerRequest) (response *CreateLoadBalancerTCPListenerResponse, err error) { + response = CreateCreateLoadBalancerTCPListenerResponse() + err = client.DoAction(request, response) + return +} + +// CreateLoadBalancerTCPListenerWithChan invokes the slb.CreateLoadBalancerTCPListener API asynchronously +// api document: https://help.aliyun.com/api/slb/createloadbalancertcplistener.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) CreateLoadBalancerTCPListenerWithChan(request *CreateLoadBalancerTCPListenerRequest) (<-chan *CreateLoadBalancerTCPListenerResponse, <-chan error) { + responseChan := make(chan *CreateLoadBalancerTCPListenerResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.CreateLoadBalancerTCPListener(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// CreateLoadBalancerTCPListenerWithCallback invokes the slb.CreateLoadBalancerTCPListener API asynchronously +// api document: https://help.aliyun.com/api/slb/createloadbalancertcplistener.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) CreateLoadBalancerTCPListenerWithCallback(request *CreateLoadBalancerTCPListenerRequest, callback func(response *CreateLoadBalancerTCPListenerResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *CreateLoadBalancerTCPListenerResponse + var err error + defer close(result) + response, err = client.CreateLoadBalancerTCPListener(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// CreateLoadBalancerTCPListenerRequest is the request struct for api CreateLoadBalancerTCPListener +type CreateLoadBalancerTCPListenerRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + HealthCheckURI string `position:"Query" name:"HealthCheckURI"` + AclStatus string `position:"Query" name:"AclStatus"` + AclType string `position:"Query" name:"AclType"` + EstablishedTimeout requests.Integer `position:"Query" name:"EstablishedTimeout"` + PersistenceTimeout requests.Integer `position:"Query" name:"PersistenceTimeout"` + VpcIds string `position:"Query" name:"VpcIds"` + VServerGroupId string `position:"Query" name:"VServerGroupId"` + AclId string `position:"Query" name:"AclId"` + PortRange *[]CreateLoadBalancerTCPListenerPortRange `position:"Query" name:"PortRange" type:"Repeated"` + HealthCheckMethod string `position:"Query" name:"HealthCheckMethod"` + HealthCheckDomain string `position:"Query" name:"HealthCheckDomain"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + Tags string `position:"Query" name:"Tags"` + LoadBalancerId string `position:"Query" name:"LoadBalancerId"` + MasterSlaveServerGroupId string `position:"Query" name:"MasterSlaveServerGroupId"` + BackendServerPort requests.Integer `position:"Query" name:"BackendServerPort"` + HealthCheckInterval requests.Integer `position:"Query" name:"healthCheckInterval"` + ConnectionDrain string `position:"Query" name:"ConnectionDrain"` + AccessKeyId string `position:"Query" name:"access_key_id"` + HealthCheckConnectTimeout requests.Integer `position:"Query" name:"HealthCheckConnectTimeout"` + Description string `position:"Query" name:"Description"` + UnhealthyThreshold requests.Integer `position:"Query" name:"UnhealthyThreshold"` + HealthyThreshold requests.Integer `position:"Query" name:"HealthyThreshold"` + Scheduler string `position:"Query" name:"Scheduler"` + MaxConnection requests.Integer `position:"Query" name:"MaxConnection"` + ListenerPort requests.Integer `position:"Query" name:"ListenerPort"` + HealthCheckType string `position:"Query" name:"HealthCheckType"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + Bandwidth requests.Integer `position:"Query" name:"Bandwidth"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + ConnectionDrainTimeout requests.Integer `position:"Query" name:"ConnectionDrainTimeout"` + HealthCheckConnectPort requests.Integer `position:"Query" name:"HealthCheckConnectPort"` + HealthCheckHttpCode string `position:"Query" name:"HealthCheckHttpCode"` +} + +// CreateLoadBalancerTCPListenerPortRange is a repeated param struct in CreateLoadBalancerTCPListenerRequest +type CreateLoadBalancerTCPListenerPortRange struct { + StartPort string `name:"StartPort"` + EndPort string `name:"EndPort"` +} + +// CreateLoadBalancerTCPListenerResponse is the response struct for api CreateLoadBalancerTCPListener +type CreateLoadBalancerTCPListenerResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateCreateLoadBalancerTCPListenerRequest creates a request to invoke CreateLoadBalancerTCPListener API +func CreateCreateLoadBalancerTCPListenerRequest() (request *CreateLoadBalancerTCPListenerRequest) { + request = &CreateLoadBalancerTCPListenerRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Slb", "2014-05-15", "CreateLoadBalancerTCPListener", "slb", "openAPI") + return +} + +// CreateCreateLoadBalancerTCPListenerResponse creates a response to parse from CreateLoadBalancerTCPListener response +func CreateCreateLoadBalancerTCPListenerResponse() (response *CreateLoadBalancerTCPListenerResponse) { + response = &CreateLoadBalancerTCPListenerResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/create_load_balancer_udp_listener.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/create_load_balancer_udp_listener.go new file mode 100644 index 0000000000..c20f5ba69f --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/create_load_balancer_udp_listener.go @@ -0,0 +1,138 @@ +package slb + +//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" +) + +// CreateLoadBalancerUDPListener invokes the slb.CreateLoadBalancerUDPListener API synchronously +// api document: https://help.aliyun.com/api/slb/createloadbalancerudplistener.html +func (client *Client) CreateLoadBalancerUDPListener(request *CreateLoadBalancerUDPListenerRequest) (response *CreateLoadBalancerUDPListenerResponse, err error) { + response = CreateCreateLoadBalancerUDPListenerResponse() + err = client.DoAction(request, response) + return +} + +// CreateLoadBalancerUDPListenerWithChan invokes the slb.CreateLoadBalancerUDPListener API asynchronously +// api document: https://help.aliyun.com/api/slb/createloadbalancerudplistener.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) CreateLoadBalancerUDPListenerWithChan(request *CreateLoadBalancerUDPListenerRequest) (<-chan *CreateLoadBalancerUDPListenerResponse, <-chan error) { + responseChan := make(chan *CreateLoadBalancerUDPListenerResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.CreateLoadBalancerUDPListener(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// CreateLoadBalancerUDPListenerWithCallback invokes the slb.CreateLoadBalancerUDPListener API asynchronously +// api document: https://help.aliyun.com/api/slb/createloadbalancerudplistener.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) CreateLoadBalancerUDPListenerWithCallback(request *CreateLoadBalancerUDPListenerRequest, callback func(response *CreateLoadBalancerUDPListenerResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *CreateLoadBalancerUDPListenerResponse + var err error + defer close(result) + response, err = client.CreateLoadBalancerUDPListener(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// CreateLoadBalancerUDPListenerRequest is the request struct for api CreateLoadBalancerUDPListener +type CreateLoadBalancerUDPListenerRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + AclStatus string `position:"Query" name:"AclStatus"` + AclType string `position:"Query" name:"AclType"` + PersistenceTimeout requests.Integer `position:"Query" name:"PersistenceTimeout"` + VpcIds string `position:"Query" name:"VpcIds"` + VServerGroupId string `position:"Query" name:"VServerGroupId"` + AclId string `position:"Query" name:"AclId"` + PortRange *[]CreateLoadBalancerUDPListenerPortRange `position:"Query" name:"PortRange" type:"Repeated"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + Tags string `position:"Query" name:"Tags"` + LoadBalancerId string `position:"Query" name:"LoadBalancerId"` + MasterSlaveServerGroupId string `position:"Query" name:"MasterSlaveServerGroupId"` + HealthCheckReq string `position:"Query" name:"healthCheckReq"` + BackendServerPort requests.Integer `position:"Query" name:"BackendServerPort"` + HealthCheckInterval requests.Integer `position:"Query" name:"healthCheckInterval"` + HealthCheckExp string `position:"Query" name:"healthCheckExp"` + ConnectionDrain string `position:"Query" name:"ConnectionDrain"` + AccessKeyId string `position:"Query" name:"access_key_id"` + HealthCheckConnectTimeout requests.Integer `position:"Query" name:"HealthCheckConnectTimeout"` + Description string `position:"Query" name:"Description"` + UnhealthyThreshold requests.Integer `position:"Query" name:"UnhealthyThreshold"` + HealthyThreshold requests.Integer `position:"Query" name:"HealthyThreshold"` + Scheduler string `position:"Query" name:"Scheduler"` + MaxConnection requests.Integer `position:"Query" name:"MaxConnection"` + ListenerPort requests.Integer `position:"Query" name:"ListenerPort"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + Bandwidth requests.Integer `position:"Query" name:"Bandwidth"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + ConnectionDrainTimeout requests.Integer `position:"Query" name:"ConnectionDrainTimeout"` + HealthCheckConnectPort requests.Integer `position:"Query" name:"HealthCheckConnectPort"` +} + +// CreateLoadBalancerUDPListenerPortRange is a repeated param struct in CreateLoadBalancerUDPListenerRequest +type CreateLoadBalancerUDPListenerPortRange struct { + StartPort string `name:"StartPort"` + EndPort string `name:"EndPort"` +} + +// CreateLoadBalancerUDPListenerResponse is the response struct for api CreateLoadBalancerUDPListener +type CreateLoadBalancerUDPListenerResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateCreateLoadBalancerUDPListenerRequest creates a request to invoke CreateLoadBalancerUDPListener API +func CreateCreateLoadBalancerUDPListenerRequest() (request *CreateLoadBalancerUDPListenerRequest) { + request = &CreateLoadBalancerUDPListenerRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Slb", "2014-05-15", "CreateLoadBalancerUDPListener", "slb", "openAPI") + return +} + +// CreateCreateLoadBalancerUDPListenerResponse creates a response to parse from CreateLoadBalancerUDPListener response +func CreateCreateLoadBalancerUDPListenerResponse() (response *CreateLoadBalancerUDPListenerResponse) { + response = &CreateLoadBalancerUDPListenerResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/create_master_slave_server_group.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/create_master_slave_server_group.go new file mode 100644 index 0000000000..c8714498c8 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/create_master_slave_server_group.go @@ -0,0 +1,113 @@ +package slb + +//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" +) + +// CreateMasterSlaveServerGroup invokes the slb.CreateMasterSlaveServerGroup API synchronously +// api document: https://help.aliyun.com/api/slb/createmasterslaveservergroup.html +func (client *Client) CreateMasterSlaveServerGroup(request *CreateMasterSlaveServerGroupRequest) (response *CreateMasterSlaveServerGroupResponse, err error) { + response = CreateCreateMasterSlaveServerGroupResponse() + err = client.DoAction(request, response) + return +} + +// CreateMasterSlaveServerGroupWithChan invokes the slb.CreateMasterSlaveServerGroup API asynchronously +// api document: https://help.aliyun.com/api/slb/createmasterslaveservergroup.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) CreateMasterSlaveServerGroupWithChan(request *CreateMasterSlaveServerGroupRequest) (<-chan *CreateMasterSlaveServerGroupResponse, <-chan error) { + responseChan := make(chan *CreateMasterSlaveServerGroupResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.CreateMasterSlaveServerGroup(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// CreateMasterSlaveServerGroupWithCallback invokes the slb.CreateMasterSlaveServerGroup API asynchronously +// api document: https://help.aliyun.com/api/slb/createmasterslaveservergroup.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) CreateMasterSlaveServerGroupWithCallback(request *CreateMasterSlaveServerGroupRequest, callback func(response *CreateMasterSlaveServerGroupResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *CreateMasterSlaveServerGroupResponse + var err error + defer close(result) + response, err = client.CreateMasterSlaveServerGroup(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// CreateMasterSlaveServerGroupRequest is the request struct for api CreateMasterSlaveServerGroup +type CreateMasterSlaveServerGroupRequest struct { + *requests.RpcRequest + AccessKeyId string `position:"Query" name:"access_key_id"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + MasterSlaveBackendServers string `position:"Query" name:"MasterSlaveBackendServers"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + MasterSlaveServerGroupName string `position:"Query" name:"MasterSlaveServerGroupName"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + Tags string `position:"Query" name:"Tags"` + LoadBalancerId string `position:"Query" name:"LoadBalancerId"` +} + +// CreateMasterSlaveServerGroupResponse is the response struct for api CreateMasterSlaveServerGroup +type CreateMasterSlaveServerGroupResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + MasterSlaveServerGroupId string `json:"MasterSlaveServerGroupId" xml:"MasterSlaveServerGroupId"` + MasterSlaveBackendServers MasterSlaveBackendServersInCreateMasterSlaveServerGroup `json:"MasterSlaveBackendServers" xml:"MasterSlaveBackendServers"` +} + +// CreateCreateMasterSlaveServerGroupRequest creates a request to invoke CreateMasterSlaveServerGroup API +func CreateCreateMasterSlaveServerGroupRequest() (request *CreateMasterSlaveServerGroupRequest) { + request = &CreateMasterSlaveServerGroupRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Slb", "2014-05-15", "CreateMasterSlaveServerGroup", "slb", "openAPI") + return +} + +// CreateCreateMasterSlaveServerGroupResponse creates a response to parse from CreateMasterSlaveServerGroup response +func CreateCreateMasterSlaveServerGroupResponse() (response *CreateMasterSlaveServerGroupResponse) { + response = &CreateMasterSlaveServerGroupResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/create_rules.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/create_rules.go new file mode 100644 index 0000000000..36128b8ac5 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/create_rules.go @@ -0,0 +1,113 @@ +package slb + +//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" +) + +// CreateRules invokes the slb.CreateRules API synchronously +// api document: https://help.aliyun.com/api/slb/createrules.html +func (client *Client) CreateRules(request *CreateRulesRequest) (response *CreateRulesResponse, err error) { + response = CreateCreateRulesResponse() + err = client.DoAction(request, response) + return +} + +// CreateRulesWithChan invokes the slb.CreateRules API asynchronously +// api document: https://help.aliyun.com/api/slb/createrules.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) CreateRulesWithChan(request *CreateRulesRequest) (<-chan *CreateRulesResponse, <-chan error) { + responseChan := make(chan *CreateRulesResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.CreateRules(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// CreateRulesWithCallback invokes the slb.CreateRules API asynchronously +// api document: https://help.aliyun.com/api/slb/createrules.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) CreateRulesWithCallback(request *CreateRulesRequest, callback func(response *CreateRulesResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *CreateRulesResponse + var err error + defer close(result) + response, err = client.CreateRules(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// CreateRulesRequest is the request struct for api CreateRules +type CreateRulesRequest struct { + *requests.RpcRequest + AccessKeyId string `position:"Query" name:"access_key_id"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + RuleList string `position:"Query" name:"RuleList"` + ListenerPort requests.Integer `position:"Query" name:"ListenerPort"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + ListenerProtocol string `position:"Query" name:"ListenerProtocol"` + Tags string `position:"Query" name:"Tags"` + LoadBalancerId string `position:"Query" name:"LoadBalancerId"` +} + +// CreateRulesResponse is the response struct for api CreateRules +type CreateRulesResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + Rules RulesInCreateRules `json:"Rules" xml:"Rules"` +} + +// CreateCreateRulesRequest creates a request to invoke CreateRules API +func CreateCreateRulesRequest() (request *CreateRulesRequest) { + request = &CreateRulesRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Slb", "2014-05-15", "CreateRules", "slb", "openAPI") + return +} + +// CreateCreateRulesResponse creates a response to parse from CreateRules response +func CreateCreateRulesResponse() (response *CreateRulesResponse) { + response = &CreateRulesResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/create_v_server_group.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/create_v_server_group.go new file mode 100644 index 0000000000..888287930d --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/create_v_server_group.go @@ -0,0 +1,113 @@ +package slb + +//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" +) + +// CreateVServerGroup invokes the slb.CreateVServerGroup API synchronously +// api document: https://help.aliyun.com/api/slb/createvservergroup.html +func (client *Client) CreateVServerGroup(request *CreateVServerGroupRequest) (response *CreateVServerGroupResponse, err error) { + response = CreateCreateVServerGroupResponse() + err = client.DoAction(request, response) + return +} + +// CreateVServerGroupWithChan invokes the slb.CreateVServerGroup API asynchronously +// api document: https://help.aliyun.com/api/slb/createvservergroup.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) CreateVServerGroupWithChan(request *CreateVServerGroupRequest) (<-chan *CreateVServerGroupResponse, <-chan error) { + responseChan := make(chan *CreateVServerGroupResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.CreateVServerGroup(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// CreateVServerGroupWithCallback invokes the slb.CreateVServerGroup API asynchronously +// api document: https://help.aliyun.com/api/slb/createvservergroup.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) CreateVServerGroupWithCallback(request *CreateVServerGroupRequest, callback func(response *CreateVServerGroupResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *CreateVServerGroupResponse + var err error + defer close(result) + response, err = client.CreateVServerGroup(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// CreateVServerGroupRequest is the request struct for api CreateVServerGroup +type CreateVServerGroupRequest struct { + *requests.RpcRequest + AccessKeyId string `position:"Query" name:"access_key_id"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + BackendServers string `position:"Query" name:"BackendServers"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + Tags string `position:"Query" name:"Tags"` + VServerGroupName string `position:"Query" name:"VServerGroupName"` + LoadBalancerId string `position:"Query" name:"LoadBalancerId"` +} + +// CreateVServerGroupResponse is the response struct for api CreateVServerGroup +type CreateVServerGroupResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + VServerGroupId string `json:"VServerGroupId" xml:"VServerGroupId"` + BackendServers BackendServersInCreateVServerGroup `json:"BackendServers" xml:"BackendServers"` +} + +// CreateCreateVServerGroupRequest creates a request to invoke CreateVServerGroup API +func CreateCreateVServerGroupRequest() (request *CreateVServerGroupRequest) { + request = &CreateVServerGroupRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Slb", "2014-05-15", "CreateVServerGroup", "slb", "openAPI") + return +} + +// CreateCreateVServerGroupResponse creates a response to parse from CreateVServerGroup response +func CreateCreateVServerGroupResponse() (response *CreateVServerGroupResponse) { + response = &CreateVServerGroupResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/delete_access_control_list.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/delete_access_control_list.go new file mode 100644 index 0000000000..8625b66df2 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/delete_access_control_list.go @@ -0,0 +1,109 @@ +package slb + +//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" +) + +// DeleteAccessControlList invokes the slb.DeleteAccessControlList API synchronously +// api document: https://help.aliyun.com/api/slb/deleteaccesscontrollist.html +func (client *Client) DeleteAccessControlList(request *DeleteAccessControlListRequest) (response *DeleteAccessControlListResponse, err error) { + response = CreateDeleteAccessControlListResponse() + err = client.DoAction(request, response) + return +} + +// DeleteAccessControlListWithChan invokes the slb.DeleteAccessControlList API asynchronously +// api document: https://help.aliyun.com/api/slb/deleteaccesscontrollist.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DeleteAccessControlListWithChan(request *DeleteAccessControlListRequest) (<-chan *DeleteAccessControlListResponse, <-chan error) { + responseChan := make(chan *DeleteAccessControlListResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DeleteAccessControlList(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DeleteAccessControlListWithCallback invokes the slb.DeleteAccessControlList API asynchronously +// api document: https://help.aliyun.com/api/slb/deleteaccesscontrollist.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DeleteAccessControlListWithCallback(request *DeleteAccessControlListRequest, callback func(response *DeleteAccessControlListResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DeleteAccessControlListResponse + var err error + defer close(result) + response, err = client.DeleteAccessControlList(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DeleteAccessControlListRequest is the request struct for api DeleteAccessControlList +type DeleteAccessControlListRequest struct { + *requests.RpcRequest + AccessKeyId string `position:"Query" name:"access_key_id"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + AclId string `position:"Query" name:"AclId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + Tags string `position:"Query" name:"Tags"` +} + +// DeleteAccessControlListResponse is the response struct for api DeleteAccessControlList +type DeleteAccessControlListResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateDeleteAccessControlListRequest creates a request to invoke DeleteAccessControlList API +func CreateDeleteAccessControlListRequest() (request *DeleteAccessControlListRequest) { + request = &DeleteAccessControlListRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Slb", "2014-05-15", "DeleteAccessControlList", "slb", "openAPI") + return +} + +// CreateDeleteAccessControlListResponse creates a response to parse from DeleteAccessControlList response +func CreateDeleteAccessControlListResponse() (response *DeleteAccessControlListResponse) { + response = &DeleteAccessControlListResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/delete_ca_certificate.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/delete_ca_certificate.go new file mode 100644 index 0000000000..796b06c853 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/delete_ca_certificate.go @@ -0,0 +1,108 @@ +package slb + +//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" +) + +// DeleteCACertificate invokes the slb.DeleteCACertificate API synchronously +// api document: https://help.aliyun.com/api/slb/deletecacertificate.html +func (client *Client) DeleteCACertificate(request *DeleteCACertificateRequest) (response *DeleteCACertificateResponse, err error) { + response = CreateDeleteCACertificateResponse() + err = client.DoAction(request, response) + return +} + +// DeleteCACertificateWithChan invokes the slb.DeleteCACertificate API asynchronously +// api document: https://help.aliyun.com/api/slb/deletecacertificate.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DeleteCACertificateWithChan(request *DeleteCACertificateRequest) (<-chan *DeleteCACertificateResponse, <-chan error) { + responseChan := make(chan *DeleteCACertificateResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DeleteCACertificate(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DeleteCACertificateWithCallback invokes the slb.DeleteCACertificate API asynchronously +// api document: https://help.aliyun.com/api/slb/deletecacertificate.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DeleteCACertificateWithCallback(request *DeleteCACertificateRequest, callback func(response *DeleteCACertificateResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DeleteCACertificateResponse + var err error + defer close(result) + response, err = client.DeleteCACertificate(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DeleteCACertificateRequest is the request struct for api DeleteCACertificate +type DeleteCACertificateRequest struct { + *requests.RpcRequest + AccessKeyId string `position:"Query" name:"access_key_id"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + CACertificateId string `position:"Query" name:"CACertificateId"` +} + +// DeleteCACertificateResponse is the response struct for api DeleteCACertificate +type DeleteCACertificateResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateDeleteCACertificateRequest creates a request to invoke DeleteCACertificate API +func CreateDeleteCACertificateRequest() (request *DeleteCACertificateRequest) { + request = &DeleteCACertificateRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Slb", "2014-05-15", "DeleteCACertificate", "slb", "openAPI") + return +} + +// CreateDeleteCACertificateResponse creates a response to parse from DeleteCACertificate response +func CreateDeleteCACertificateResponse() (response *DeleteCACertificateResponse) { + response = &DeleteCACertificateResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/delete_domain_extension.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/delete_domain_extension.go new file mode 100644 index 0000000000..7aac4f15cf --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/delete_domain_extension.go @@ -0,0 +1,109 @@ +package slb + +//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" +) + +// DeleteDomainExtension invokes the slb.DeleteDomainExtension API synchronously +// api document: https://help.aliyun.com/api/slb/deletedomainextension.html +func (client *Client) DeleteDomainExtension(request *DeleteDomainExtensionRequest) (response *DeleteDomainExtensionResponse, err error) { + response = CreateDeleteDomainExtensionResponse() + err = client.DoAction(request, response) + return +} + +// DeleteDomainExtensionWithChan invokes the slb.DeleteDomainExtension API asynchronously +// api document: https://help.aliyun.com/api/slb/deletedomainextension.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DeleteDomainExtensionWithChan(request *DeleteDomainExtensionRequest) (<-chan *DeleteDomainExtensionResponse, <-chan error) { + responseChan := make(chan *DeleteDomainExtensionResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DeleteDomainExtension(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DeleteDomainExtensionWithCallback invokes the slb.DeleteDomainExtension API asynchronously +// api document: https://help.aliyun.com/api/slb/deletedomainextension.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DeleteDomainExtensionWithCallback(request *DeleteDomainExtensionRequest, callback func(response *DeleteDomainExtensionResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DeleteDomainExtensionResponse + var err error + defer close(result) + response, err = client.DeleteDomainExtension(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DeleteDomainExtensionRequest is the request struct for api DeleteDomainExtension +type DeleteDomainExtensionRequest struct { + *requests.RpcRequest + AccessKeyId string `position:"Query" name:"access_key_id"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + DomainExtensionId string `position:"Query" name:"DomainExtensionId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + Tags string `position:"Query" name:"Tags"` +} + +// DeleteDomainExtensionResponse is the response struct for api DeleteDomainExtension +type DeleteDomainExtensionResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateDeleteDomainExtensionRequest creates a request to invoke DeleteDomainExtension API +func CreateDeleteDomainExtensionRequest() (request *DeleteDomainExtensionRequest) { + request = &DeleteDomainExtensionRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Slb", "2014-05-15", "DeleteDomainExtension", "slb", "openAPI") + return +} + +// CreateDeleteDomainExtensionResponse creates a response to parse from DeleteDomainExtension response +func CreateDeleteDomainExtensionResponse() (response *DeleteDomainExtensionResponse) { + response = &DeleteDomainExtensionResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/delete_load_balancer.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/delete_load_balancer.go new file mode 100644 index 0000000000..3d4082a34c --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/delete_load_balancer.go @@ -0,0 +1,109 @@ +package slb + +//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 slb.DeleteLoadBalancer API synchronously +// api document: https://help.aliyun.com/api/slb/deleteloadbalancer.html +func (client *Client) DeleteLoadBalancer(request *DeleteLoadBalancerRequest) (response *DeleteLoadBalancerResponse, err error) { + response = CreateDeleteLoadBalancerResponse() + err = client.DoAction(request, response) + return +} + +// DeleteLoadBalancerWithChan invokes the slb.DeleteLoadBalancer API asynchronously +// api document: https://help.aliyun.com/api/slb/deleteloadbalancer.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +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 slb.DeleteLoadBalancer API asynchronously +// api document: https://help.aliyun.com/api/slb/deleteloadbalancer.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +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 + AccessKeyId string `position:"Query" name:"access_key_id"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + Tags string `position:"Query" name:"Tags"` + LoadBalancerId string `position:"Query" 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("Slb", "2014-05-15", "DeleteLoadBalancer", "slb", "openAPI") + return +} + +// CreateDeleteLoadBalancerResponse creates a response to parse from DeleteLoadBalancer response +func CreateDeleteLoadBalancerResponse() (response *DeleteLoadBalancerResponse) { + response = &DeleteLoadBalancerResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/delete_load_balancer_listener.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/delete_load_balancer_listener.go new file mode 100644 index 0000000000..9c22a18ca2 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/delete_load_balancer_listener.go @@ -0,0 +1,111 @@ +package slb + +//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" +) + +// DeleteLoadBalancerListener invokes the slb.DeleteLoadBalancerListener API synchronously +// api document: https://help.aliyun.com/api/slb/deleteloadbalancerlistener.html +func (client *Client) DeleteLoadBalancerListener(request *DeleteLoadBalancerListenerRequest) (response *DeleteLoadBalancerListenerResponse, err error) { + response = CreateDeleteLoadBalancerListenerResponse() + err = client.DoAction(request, response) + return +} + +// DeleteLoadBalancerListenerWithChan invokes the slb.DeleteLoadBalancerListener API asynchronously +// api document: https://help.aliyun.com/api/slb/deleteloadbalancerlistener.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DeleteLoadBalancerListenerWithChan(request *DeleteLoadBalancerListenerRequest) (<-chan *DeleteLoadBalancerListenerResponse, <-chan error) { + responseChan := make(chan *DeleteLoadBalancerListenerResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DeleteLoadBalancerListener(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DeleteLoadBalancerListenerWithCallback invokes the slb.DeleteLoadBalancerListener API asynchronously +// api document: https://help.aliyun.com/api/slb/deleteloadbalancerlistener.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DeleteLoadBalancerListenerWithCallback(request *DeleteLoadBalancerListenerRequest, callback func(response *DeleteLoadBalancerListenerResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DeleteLoadBalancerListenerResponse + var err error + defer close(result) + response, err = client.DeleteLoadBalancerListener(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DeleteLoadBalancerListenerRequest is the request struct for api DeleteLoadBalancerListener +type DeleteLoadBalancerListenerRequest struct { + *requests.RpcRequest + AccessKeyId string `position:"Query" name:"access_key_id"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ListenerPort requests.Integer `position:"Query" name:"ListenerPort"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + ListenerProtocol string `position:"Query" name:"ListenerProtocol"` + Tags string `position:"Query" name:"Tags"` + LoadBalancerId string `position:"Query" name:"LoadBalancerId"` +} + +// DeleteLoadBalancerListenerResponse is the response struct for api DeleteLoadBalancerListener +type DeleteLoadBalancerListenerResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateDeleteLoadBalancerListenerRequest creates a request to invoke DeleteLoadBalancerListener API +func CreateDeleteLoadBalancerListenerRequest() (request *DeleteLoadBalancerListenerRequest) { + request = &DeleteLoadBalancerListenerRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Slb", "2014-05-15", "DeleteLoadBalancerListener", "slb", "openAPI") + return +} + +// CreateDeleteLoadBalancerListenerResponse creates a response to parse from DeleteLoadBalancerListener response +func CreateDeleteLoadBalancerListenerResponse() (response *DeleteLoadBalancerListenerResponse) { + response = &DeleteLoadBalancerListenerResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/delete_master_slave_server_group.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/delete_master_slave_server_group.go new file mode 100644 index 0000000000..2fc517704c --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/delete_master_slave_server_group.go @@ -0,0 +1,109 @@ +package slb + +//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" +) + +// DeleteMasterSlaveServerGroup invokes the slb.DeleteMasterSlaveServerGroup API synchronously +// api document: https://help.aliyun.com/api/slb/deletemasterslaveservergroup.html +func (client *Client) DeleteMasterSlaveServerGroup(request *DeleteMasterSlaveServerGroupRequest) (response *DeleteMasterSlaveServerGroupResponse, err error) { + response = CreateDeleteMasterSlaveServerGroupResponse() + err = client.DoAction(request, response) + return +} + +// DeleteMasterSlaveServerGroupWithChan invokes the slb.DeleteMasterSlaveServerGroup API asynchronously +// api document: https://help.aliyun.com/api/slb/deletemasterslaveservergroup.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DeleteMasterSlaveServerGroupWithChan(request *DeleteMasterSlaveServerGroupRequest) (<-chan *DeleteMasterSlaveServerGroupResponse, <-chan error) { + responseChan := make(chan *DeleteMasterSlaveServerGroupResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DeleteMasterSlaveServerGroup(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DeleteMasterSlaveServerGroupWithCallback invokes the slb.DeleteMasterSlaveServerGroup API asynchronously +// api document: https://help.aliyun.com/api/slb/deletemasterslaveservergroup.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DeleteMasterSlaveServerGroupWithCallback(request *DeleteMasterSlaveServerGroupRequest, callback func(response *DeleteMasterSlaveServerGroupResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DeleteMasterSlaveServerGroupResponse + var err error + defer close(result) + response, err = client.DeleteMasterSlaveServerGroup(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DeleteMasterSlaveServerGroupRequest is the request struct for api DeleteMasterSlaveServerGroup +type DeleteMasterSlaveServerGroupRequest struct { + *requests.RpcRequest + AccessKeyId string `position:"Query" name:"access_key_id"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + Tags string `position:"Query" name:"Tags"` + MasterSlaveServerGroupId string `position:"Query" name:"MasterSlaveServerGroupId"` +} + +// DeleteMasterSlaveServerGroupResponse is the response struct for api DeleteMasterSlaveServerGroup +type DeleteMasterSlaveServerGroupResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateDeleteMasterSlaveServerGroupRequest creates a request to invoke DeleteMasterSlaveServerGroup API +func CreateDeleteMasterSlaveServerGroupRequest() (request *DeleteMasterSlaveServerGroupRequest) { + request = &DeleteMasterSlaveServerGroupRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Slb", "2014-05-15", "DeleteMasterSlaveServerGroup", "slb", "openAPI") + return +} + +// CreateDeleteMasterSlaveServerGroupResponse creates a response to parse from DeleteMasterSlaveServerGroup response +func CreateDeleteMasterSlaveServerGroupResponse() (response *DeleteMasterSlaveServerGroupResponse) { + response = &DeleteMasterSlaveServerGroupResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/delete_rules.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/delete_rules.go new file mode 100644 index 0000000000..b4c58c0dfc --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/delete_rules.go @@ -0,0 +1,109 @@ +package slb + +//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" +) + +// DeleteRules invokes the slb.DeleteRules API synchronously +// api document: https://help.aliyun.com/api/slb/deleterules.html +func (client *Client) DeleteRules(request *DeleteRulesRequest) (response *DeleteRulesResponse, err error) { + response = CreateDeleteRulesResponse() + err = client.DoAction(request, response) + return +} + +// DeleteRulesWithChan invokes the slb.DeleteRules API asynchronously +// api document: https://help.aliyun.com/api/slb/deleterules.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DeleteRulesWithChan(request *DeleteRulesRequest) (<-chan *DeleteRulesResponse, <-chan error) { + responseChan := make(chan *DeleteRulesResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DeleteRules(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DeleteRulesWithCallback invokes the slb.DeleteRules API asynchronously +// api document: https://help.aliyun.com/api/slb/deleterules.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DeleteRulesWithCallback(request *DeleteRulesRequest, callback func(response *DeleteRulesResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DeleteRulesResponse + var err error + defer close(result) + response, err = client.DeleteRules(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DeleteRulesRequest is the request struct for api DeleteRules +type DeleteRulesRequest struct { + *requests.RpcRequest + AccessKeyId string `position:"Query" name:"access_key_id"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + Tags string `position:"Query" name:"Tags"` + RuleIds string `position:"Query" name:"RuleIds"` +} + +// DeleteRulesResponse is the response struct for api DeleteRules +type DeleteRulesResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateDeleteRulesRequest creates a request to invoke DeleteRules API +func CreateDeleteRulesRequest() (request *DeleteRulesRequest) { + request = &DeleteRulesRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Slb", "2014-05-15", "DeleteRules", "slb", "openAPI") + return +} + +// CreateDeleteRulesResponse creates a response to parse from DeleteRules response +func CreateDeleteRulesResponse() (response *DeleteRulesResponse) { + response = &DeleteRulesResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/delete_server_certificate.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/delete_server_certificate.go new file mode 100644 index 0000000000..23d5893c43 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/delete_server_certificate.go @@ -0,0 +1,109 @@ +package slb + +//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" +) + +// DeleteServerCertificate invokes the slb.DeleteServerCertificate API synchronously +// api document: https://help.aliyun.com/api/slb/deleteservercertificate.html +func (client *Client) DeleteServerCertificate(request *DeleteServerCertificateRequest) (response *DeleteServerCertificateResponse, err error) { + response = CreateDeleteServerCertificateResponse() + err = client.DoAction(request, response) + return +} + +// DeleteServerCertificateWithChan invokes the slb.DeleteServerCertificate API asynchronously +// api document: https://help.aliyun.com/api/slb/deleteservercertificate.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DeleteServerCertificateWithChan(request *DeleteServerCertificateRequest) (<-chan *DeleteServerCertificateResponse, <-chan error) { + responseChan := make(chan *DeleteServerCertificateResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DeleteServerCertificate(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DeleteServerCertificateWithCallback invokes the slb.DeleteServerCertificate API asynchronously +// api document: https://help.aliyun.com/api/slb/deleteservercertificate.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DeleteServerCertificateWithCallback(request *DeleteServerCertificateRequest, callback func(response *DeleteServerCertificateResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DeleteServerCertificateResponse + var err error + defer close(result) + response, err = client.DeleteServerCertificate(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DeleteServerCertificateRequest is the request struct for api DeleteServerCertificate +type DeleteServerCertificateRequest struct { + *requests.RpcRequest + AccessKeyId string `position:"Query" name:"access_key_id"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + ServerCertificateId string `position:"Query" name:"ServerCertificateId"` + Tags string `position:"Query" name:"Tags"` +} + +// DeleteServerCertificateResponse is the response struct for api DeleteServerCertificate +type DeleteServerCertificateResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateDeleteServerCertificateRequest creates a request to invoke DeleteServerCertificate API +func CreateDeleteServerCertificateRequest() (request *DeleteServerCertificateRequest) { + request = &DeleteServerCertificateRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Slb", "2014-05-15", "DeleteServerCertificate", "slb", "openAPI") + return +} + +// CreateDeleteServerCertificateResponse creates a response to parse from DeleteServerCertificate response +func CreateDeleteServerCertificateResponse() (response *DeleteServerCertificateResponse) { + response = &DeleteServerCertificateResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/delete_v_server_group.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/delete_v_server_group.go new file mode 100644 index 0000000000..28cba6adcc --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/delete_v_server_group.go @@ -0,0 +1,109 @@ +package slb + +//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" +) + +// DeleteVServerGroup invokes the slb.DeleteVServerGroup API synchronously +// api document: https://help.aliyun.com/api/slb/deletevservergroup.html +func (client *Client) DeleteVServerGroup(request *DeleteVServerGroupRequest) (response *DeleteVServerGroupResponse, err error) { + response = CreateDeleteVServerGroupResponse() + err = client.DoAction(request, response) + return +} + +// DeleteVServerGroupWithChan invokes the slb.DeleteVServerGroup API asynchronously +// api document: https://help.aliyun.com/api/slb/deletevservergroup.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DeleteVServerGroupWithChan(request *DeleteVServerGroupRequest) (<-chan *DeleteVServerGroupResponse, <-chan error) { + responseChan := make(chan *DeleteVServerGroupResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DeleteVServerGroup(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DeleteVServerGroupWithCallback invokes the slb.DeleteVServerGroup API asynchronously +// api document: https://help.aliyun.com/api/slb/deletevservergroup.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DeleteVServerGroupWithCallback(request *DeleteVServerGroupRequest, callback func(response *DeleteVServerGroupResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DeleteVServerGroupResponse + var err error + defer close(result) + response, err = client.DeleteVServerGroup(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DeleteVServerGroupRequest is the request struct for api DeleteVServerGroup +type DeleteVServerGroupRequest struct { + *requests.RpcRequest + AccessKeyId string `position:"Query" name:"access_key_id"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + VServerGroupId string `position:"Query" name:"VServerGroupId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + Tags string `position:"Query" name:"Tags"` +} + +// DeleteVServerGroupResponse is the response struct for api DeleteVServerGroup +type DeleteVServerGroupResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateDeleteVServerGroupRequest creates a request to invoke DeleteVServerGroup API +func CreateDeleteVServerGroupRequest() (request *DeleteVServerGroupRequest) { + request = &DeleteVServerGroupRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Slb", "2014-05-15", "DeleteVServerGroup", "slb", "openAPI") + return +} + +// CreateDeleteVServerGroupResponse creates a response to parse from DeleteVServerGroup response +func CreateDeleteVServerGroupResponse() (response *DeleteVServerGroupResponse) { + response = &DeleteVServerGroupResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/describe_access_control_list_attribute.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/describe_access_control_list_attribute.go new file mode 100644 index 0000000000..361ead14a3 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/describe_access_control_list_attribute.go @@ -0,0 +1,116 @@ +package slb + +//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" +) + +// DescribeAccessControlListAttribute invokes the slb.DescribeAccessControlListAttribute API synchronously +// api document: https://help.aliyun.com/api/slb/describeaccesscontrollistattribute.html +func (client *Client) DescribeAccessControlListAttribute(request *DescribeAccessControlListAttributeRequest) (response *DescribeAccessControlListAttributeResponse, err error) { + response = CreateDescribeAccessControlListAttributeResponse() + err = client.DoAction(request, response) + return +} + +// DescribeAccessControlListAttributeWithChan invokes the slb.DescribeAccessControlListAttribute API asynchronously +// api document: https://help.aliyun.com/api/slb/describeaccesscontrollistattribute.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeAccessControlListAttributeWithChan(request *DescribeAccessControlListAttributeRequest) (<-chan *DescribeAccessControlListAttributeResponse, <-chan error) { + responseChan := make(chan *DescribeAccessControlListAttributeResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DescribeAccessControlListAttribute(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DescribeAccessControlListAttributeWithCallback invokes the slb.DescribeAccessControlListAttribute API asynchronously +// api document: https://help.aliyun.com/api/slb/describeaccesscontrollistattribute.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeAccessControlListAttributeWithCallback(request *DescribeAccessControlListAttributeRequest, callback func(response *DescribeAccessControlListAttributeResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DescribeAccessControlListAttributeResponse + var err error + defer close(result) + response, err = client.DescribeAccessControlListAttribute(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DescribeAccessControlListAttributeRequest is the request struct for api DescribeAccessControlListAttribute +type DescribeAccessControlListAttributeRequest struct { + *requests.RpcRequest + AccessKeyId string `position:"Query" name:"access_key_id"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + AclId string `position:"Query" name:"AclId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + AclEntryComment string `position:"Query" name:"AclEntryComment"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + Tags string `position:"Query" name:"Tags"` +} + +// DescribeAccessControlListAttributeResponse is the response struct for api DescribeAccessControlListAttribute +type DescribeAccessControlListAttributeResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + AclId string `json:"AclId" xml:"AclId"` + AclName string `json:"AclName" xml:"AclName"` + AddressIPVersion string `json:"AddressIPVersion" xml:"AddressIPVersion"` + ResourceGroupId string `json:"ResourceGroupId" xml:"ResourceGroupId"` + AclEntrys AclEntrys `json:"AclEntrys" xml:"AclEntrys"` + RelatedListeners RelatedListeners `json:"RelatedListeners" xml:"RelatedListeners"` +} + +// CreateDescribeAccessControlListAttributeRequest creates a request to invoke DescribeAccessControlListAttribute API +func CreateDescribeAccessControlListAttributeRequest() (request *DescribeAccessControlListAttributeRequest) { + request = &DescribeAccessControlListAttributeRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Slb", "2014-05-15", "DescribeAccessControlListAttribute", "slb", "openAPI") + return +} + +// CreateDescribeAccessControlListAttributeResponse creates a response to parse from DescribeAccessControlListAttribute response +func CreateDescribeAccessControlListAttributeResponse() (response *DescribeAccessControlListAttributeResponse) { + response = &DescribeAccessControlListAttributeResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/describe_access_control_lists.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/describe_access_control_lists.go new file mode 100644 index 0000000000..239691967e --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/describe_access_control_lists.go @@ -0,0 +1,125 @@ +package slb + +//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" +) + +// DescribeAccessControlLists invokes the slb.DescribeAccessControlLists API synchronously +// api document: https://help.aliyun.com/api/slb/describeaccesscontrollists.html +func (client *Client) DescribeAccessControlLists(request *DescribeAccessControlListsRequest) (response *DescribeAccessControlListsResponse, err error) { + response = CreateDescribeAccessControlListsResponse() + err = client.DoAction(request, response) + return +} + +// DescribeAccessControlListsWithChan invokes the slb.DescribeAccessControlLists API asynchronously +// api document: https://help.aliyun.com/api/slb/describeaccesscontrollists.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeAccessControlListsWithChan(request *DescribeAccessControlListsRequest) (<-chan *DescribeAccessControlListsResponse, <-chan error) { + responseChan := make(chan *DescribeAccessControlListsResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DescribeAccessControlLists(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DescribeAccessControlListsWithCallback invokes the slb.DescribeAccessControlLists API asynchronously +// api document: https://help.aliyun.com/api/slb/describeaccesscontrollists.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeAccessControlListsWithCallback(request *DescribeAccessControlListsRequest, callback func(response *DescribeAccessControlListsResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DescribeAccessControlListsResponse + var err error + defer close(result) + response, err = client.DescribeAccessControlLists(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DescribeAccessControlListsRequest is the request struct for api DescribeAccessControlLists +type DescribeAccessControlListsRequest struct { + *requests.RpcRequest + AccessKeyId string `position:"Query" name:"access_key_id"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + AclName string `position:"Query" name:"AclName"` + AddressIPVersion string `position:"Query" name:"AddressIPVersion"` + PageNumber requests.Integer `position:"Query" name:"PageNumber"` + ResourceGroupId string `position:"Query" name:"ResourceGroupId"` + PageSize requests.Integer `position:"Query" name:"PageSize"` + Tag *[]DescribeAccessControlListsTag `position:"Query" name:"Tag" type:"Repeated"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + Tags string `position:"Query" name:"Tags"` +} + +// DescribeAccessControlListsTag is a repeated param struct in DescribeAccessControlListsRequest +type DescribeAccessControlListsTag struct { + Value string `name:"Value"` + Key string `name:"Key"` +} + +// DescribeAccessControlListsResponse is the response struct for api DescribeAccessControlLists +type DescribeAccessControlListsResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + TotalCount int `json:"TotalCount" xml:"TotalCount"` + PageSize int `json:"PageSize" xml:"PageSize"` + Count int `json:"Count" xml:"Count"` + PageNumber int `json:"PageNumber" xml:"PageNumber"` + Acls Acls `json:"Acls" xml:"Acls"` +} + +// CreateDescribeAccessControlListsRequest creates a request to invoke DescribeAccessControlLists API +func CreateDescribeAccessControlListsRequest() (request *DescribeAccessControlListsRequest) { + request = &DescribeAccessControlListsRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Slb", "2014-05-15", "DescribeAccessControlLists", "slb", "openAPI") + return +} + +// CreateDescribeAccessControlListsResponse creates a response to parse from DescribeAccessControlLists response +func CreateDescribeAccessControlListsResponse() (response *DescribeAccessControlListsResponse) { + response = &DescribeAccessControlListsResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/describe_available_resource.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/describe_available_resource.go new file mode 100644 index 0000000000..9e37ef490e --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/describe_available_resource.go @@ -0,0 +1,110 @@ +package slb + +//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" +) + +// DescribeAvailableResource invokes the slb.DescribeAvailableResource API synchronously +// api document: https://help.aliyun.com/api/slb/describeavailableresource.html +func (client *Client) DescribeAvailableResource(request *DescribeAvailableResourceRequest) (response *DescribeAvailableResourceResponse, err error) { + response = CreateDescribeAvailableResourceResponse() + err = client.DoAction(request, response) + return +} + +// DescribeAvailableResourceWithChan invokes the slb.DescribeAvailableResource API asynchronously +// api document: https://help.aliyun.com/api/slb/describeavailableresource.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeAvailableResourceWithChan(request *DescribeAvailableResourceRequest) (<-chan *DescribeAvailableResourceResponse, <-chan error) { + responseChan := make(chan *DescribeAvailableResourceResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DescribeAvailableResource(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DescribeAvailableResourceWithCallback invokes the slb.DescribeAvailableResource API asynchronously +// api document: https://help.aliyun.com/api/slb/describeavailableresource.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeAvailableResourceWithCallback(request *DescribeAvailableResourceRequest, callback func(response *DescribeAvailableResourceResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DescribeAvailableResourceResponse + var err error + defer close(result) + response, err = client.DescribeAvailableResource(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DescribeAvailableResourceRequest is the request struct for api DescribeAvailableResource +type DescribeAvailableResourceRequest struct { + *requests.RpcRequest + AccessKeyId string `position:"Query" name:"access_key_id"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + AddressIPVersion string `position:"Query" name:"AddressIPVersion"` + AddressType string `position:"Query" name:"AddressType"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// DescribeAvailableResourceResponse is the response struct for api DescribeAvailableResource +type DescribeAvailableResourceResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + AvailableResources AvailableResources `json:"AvailableResources" xml:"AvailableResources"` +} + +// CreateDescribeAvailableResourceRequest creates a request to invoke DescribeAvailableResource API +func CreateDescribeAvailableResourceRequest() (request *DescribeAvailableResourceRequest) { + request = &DescribeAvailableResourceRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Slb", "2014-05-15", "DescribeAvailableResource", "slb", "openAPI") + return +} + +// CreateDescribeAvailableResourceResponse creates a response to parse from DescribeAvailableResource response +func CreateDescribeAvailableResourceResponse() (response *DescribeAvailableResourceResponse) { + response = &DescribeAvailableResourceResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/describe_ca_certificates.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/describe_ca_certificates.go new file mode 100644 index 0000000000..a87f4ace50 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/describe_ca_certificates.go @@ -0,0 +1,117 @@ +package slb + +//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" +) + +// DescribeCACertificates invokes the slb.DescribeCACertificates API synchronously +// api document: https://help.aliyun.com/api/slb/describecacertificates.html +func (client *Client) DescribeCACertificates(request *DescribeCACertificatesRequest) (response *DescribeCACertificatesResponse, err error) { + response = CreateDescribeCACertificatesResponse() + err = client.DoAction(request, response) + return +} + +// DescribeCACertificatesWithChan invokes the slb.DescribeCACertificates API asynchronously +// api document: https://help.aliyun.com/api/slb/describecacertificates.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeCACertificatesWithChan(request *DescribeCACertificatesRequest) (<-chan *DescribeCACertificatesResponse, <-chan error) { + responseChan := make(chan *DescribeCACertificatesResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DescribeCACertificates(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DescribeCACertificatesWithCallback invokes the slb.DescribeCACertificates API asynchronously +// api document: https://help.aliyun.com/api/slb/describecacertificates.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeCACertificatesWithCallback(request *DescribeCACertificatesRequest, callback func(response *DescribeCACertificatesResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DescribeCACertificatesResponse + var err error + defer close(result) + response, err = client.DescribeCACertificates(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DescribeCACertificatesRequest is the request struct for api DescribeCACertificates +type DescribeCACertificatesRequest struct { + *requests.RpcRequest + AccessKeyId string `position:"Query" name:"access_key_id"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceGroupId string `position:"Query" name:"ResourceGroupId"` + Tag *[]DescribeCACertificatesTag `position:"Query" name:"Tag" type:"Repeated"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + CACertificateId string `position:"Query" name:"CACertificateId"` +} + +// DescribeCACertificatesTag is a repeated param struct in DescribeCACertificatesRequest +type DescribeCACertificatesTag struct { + Value string `name:"Value"` + Key string `name:"Key"` +} + +// DescribeCACertificatesResponse is the response struct for api DescribeCACertificates +type DescribeCACertificatesResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + CACertificates CACertificates `json:"CACertificates" xml:"CACertificates"` +} + +// CreateDescribeCACertificatesRequest creates a request to invoke DescribeCACertificates API +func CreateDescribeCACertificatesRequest() (request *DescribeCACertificatesRequest) { + request = &DescribeCACertificatesRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Slb", "2014-05-15", "DescribeCACertificates", "slb", "openAPI") + return +} + +// CreateDescribeCACertificatesResponse creates a response to parse from DescribeCACertificates response +func CreateDescribeCACertificatesResponse() (response *DescribeCACertificatesResponse) { + response = &DescribeCACertificatesResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/describe_domain_extension_attribute.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/describe_domain_extension_attribute.go new file mode 100644 index 0000000000..5174f3b6e5 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/describe_domain_extension_attribute.go @@ -0,0 +1,114 @@ +package slb + +//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" +) + +// DescribeDomainExtensionAttribute invokes the slb.DescribeDomainExtensionAttribute API synchronously +// api document: https://help.aliyun.com/api/slb/describedomainextensionattribute.html +func (client *Client) DescribeDomainExtensionAttribute(request *DescribeDomainExtensionAttributeRequest) (response *DescribeDomainExtensionAttributeResponse, err error) { + response = CreateDescribeDomainExtensionAttributeResponse() + err = client.DoAction(request, response) + return +} + +// DescribeDomainExtensionAttributeWithChan invokes the slb.DescribeDomainExtensionAttribute API asynchronously +// api document: https://help.aliyun.com/api/slb/describedomainextensionattribute.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeDomainExtensionAttributeWithChan(request *DescribeDomainExtensionAttributeRequest) (<-chan *DescribeDomainExtensionAttributeResponse, <-chan error) { + responseChan := make(chan *DescribeDomainExtensionAttributeResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DescribeDomainExtensionAttribute(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DescribeDomainExtensionAttributeWithCallback invokes the slb.DescribeDomainExtensionAttribute API asynchronously +// api document: https://help.aliyun.com/api/slb/describedomainextensionattribute.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeDomainExtensionAttributeWithCallback(request *DescribeDomainExtensionAttributeRequest, callback func(response *DescribeDomainExtensionAttributeResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DescribeDomainExtensionAttributeResponse + var err error + defer close(result) + response, err = client.DescribeDomainExtensionAttribute(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DescribeDomainExtensionAttributeRequest is the request struct for api DescribeDomainExtensionAttribute +type DescribeDomainExtensionAttributeRequest struct { + *requests.RpcRequest + AccessKeyId string `position:"Query" name:"access_key_id"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + DomainExtensionId string `position:"Query" name:"DomainExtensionId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + Tags string `position:"Query" name:"Tags"` +} + +// DescribeDomainExtensionAttributeResponse is the response struct for api DescribeDomainExtensionAttribute +type DescribeDomainExtensionAttributeResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + DomainExtensionId string `json:"DomainExtensionId" xml:"DomainExtensionId"` + Domain string `json:"Domain" xml:"Domain"` + ServerCertificateId string `json:"ServerCertificateId" xml:"ServerCertificateId"` + LoadBalancerId string `json:"LoadBalancerId" xml:"LoadBalancerId"` + ListenerPort int `json:"ListenerPort" xml:"ListenerPort"` +} + +// CreateDescribeDomainExtensionAttributeRequest creates a request to invoke DescribeDomainExtensionAttribute API +func CreateDescribeDomainExtensionAttributeRequest() (request *DescribeDomainExtensionAttributeRequest) { + request = &DescribeDomainExtensionAttributeRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Slb", "2014-05-15", "DescribeDomainExtensionAttribute", "slb", "openAPI") + return +} + +// CreateDescribeDomainExtensionAttributeResponse creates a response to parse from DescribeDomainExtensionAttribute response +func CreateDescribeDomainExtensionAttributeResponse() (response *DescribeDomainExtensionAttributeResponse) { + response = &DescribeDomainExtensionAttributeResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/describe_domain_extensions.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/describe_domain_extensions.go new file mode 100644 index 0000000000..fdaa07768e --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/describe_domain_extensions.go @@ -0,0 +1,112 @@ +package slb + +//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" +) + +// DescribeDomainExtensions invokes the slb.DescribeDomainExtensions API synchronously +// api document: https://help.aliyun.com/api/slb/describedomainextensions.html +func (client *Client) DescribeDomainExtensions(request *DescribeDomainExtensionsRequest) (response *DescribeDomainExtensionsResponse, err error) { + response = CreateDescribeDomainExtensionsResponse() + err = client.DoAction(request, response) + return +} + +// DescribeDomainExtensionsWithChan invokes the slb.DescribeDomainExtensions API asynchronously +// api document: https://help.aliyun.com/api/slb/describedomainextensions.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeDomainExtensionsWithChan(request *DescribeDomainExtensionsRequest) (<-chan *DescribeDomainExtensionsResponse, <-chan error) { + responseChan := make(chan *DescribeDomainExtensionsResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DescribeDomainExtensions(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DescribeDomainExtensionsWithCallback invokes the slb.DescribeDomainExtensions API asynchronously +// api document: https://help.aliyun.com/api/slb/describedomainextensions.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeDomainExtensionsWithCallback(request *DescribeDomainExtensionsRequest, callback func(response *DescribeDomainExtensionsResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DescribeDomainExtensionsResponse + var err error + defer close(result) + response, err = client.DescribeDomainExtensions(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DescribeDomainExtensionsRequest is the request struct for api DescribeDomainExtensions +type DescribeDomainExtensionsRequest struct { + *requests.RpcRequest + AccessKeyId string `position:"Query" name:"access_key_id"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + DomainExtensionId string `position:"Query" name:"DomainExtensionId"` + ListenerPort requests.Integer `position:"Query" name:"ListenerPort"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + Tags string `position:"Query" name:"Tags"` + LoadBalancerId string `position:"Query" name:"LoadBalancerId"` +} + +// DescribeDomainExtensionsResponse is the response struct for api DescribeDomainExtensions +type DescribeDomainExtensionsResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + DomainExtensions DomainExtensionsInDescribeDomainExtensions `json:"DomainExtensions" xml:"DomainExtensions"` +} + +// CreateDescribeDomainExtensionsRequest creates a request to invoke DescribeDomainExtensions API +func CreateDescribeDomainExtensionsRequest() (request *DescribeDomainExtensionsRequest) { + request = &DescribeDomainExtensionsRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Slb", "2014-05-15", "DescribeDomainExtensions", "slb", "openAPI") + return +} + +// CreateDescribeDomainExtensionsResponse creates a response to parse from DescribeDomainExtensions response +func CreateDescribeDomainExtensionsResponse() (response *DescribeDomainExtensionsResponse) { + response = &DescribeDomainExtensionsResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/describe_health_status.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/describe_health_status.go new file mode 100644 index 0000000000..67081322d0 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/describe_health_status.go @@ -0,0 +1,112 @@ +package slb + +//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" +) + +// DescribeHealthStatus invokes the slb.DescribeHealthStatus API synchronously +// api document: https://help.aliyun.com/api/slb/describehealthstatus.html +func (client *Client) DescribeHealthStatus(request *DescribeHealthStatusRequest) (response *DescribeHealthStatusResponse, err error) { + response = CreateDescribeHealthStatusResponse() + err = client.DoAction(request, response) + return +} + +// DescribeHealthStatusWithChan invokes the slb.DescribeHealthStatus API asynchronously +// api document: https://help.aliyun.com/api/slb/describehealthstatus.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeHealthStatusWithChan(request *DescribeHealthStatusRequest) (<-chan *DescribeHealthStatusResponse, <-chan error) { + responseChan := make(chan *DescribeHealthStatusResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DescribeHealthStatus(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DescribeHealthStatusWithCallback invokes the slb.DescribeHealthStatus API asynchronously +// api document: https://help.aliyun.com/api/slb/describehealthstatus.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeHealthStatusWithCallback(request *DescribeHealthStatusRequest, callback func(response *DescribeHealthStatusResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DescribeHealthStatusResponse + var err error + defer close(result) + response, err = client.DescribeHealthStatus(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DescribeHealthStatusRequest is the request struct for api DescribeHealthStatus +type DescribeHealthStatusRequest struct { + *requests.RpcRequest + AccessKeyId string `position:"Query" name:"access_key_id"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ListenerPort requests.Integer `position:"Query" name:"ListenerPort"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + ListenerProtocol string `position:"Query" name:"ListenerProtocol"` + Tags string `position:"Query" name:"Tags"` + LoadBalancerId string `position:"Query" name:"LoadBalancerId"` +} + +// DescribeHealthStatusResponse is the response struct for api DescribeHealthStatus +type DescribeHealthStatusResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + BackendServers BackendServersInDescribeHealthStatus `json:"BackendServers" xml:"BackendServers"` +} + +// CreateDescribeHealthStatusRequest creates a request to invoke DescribeHealthStatus API +func CreateDescribeHealthStatusRequest() (request *DescribeHealthStatusRequest) { + request = &DescribeHealthStatusRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Slb", "2014-05-15", "DescribeHealthStatus", "slb", "openAPI") + return +} + +// CreateDescribeHealthStatusResponse creates a response to parse from DescribeHealthStatus response +func CreateDescribeHealthStatusResponse() (response *DescribeHealthStatusResponse) { + response = &DescribeHealthStatusResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/describe_listener_access_control_attribute.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/describe_listener_access_control_attribute.go new file mode 100644 index 0000000000..daaba92043 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/describe_listener_access_control_attribute.go @@ -0,0 +1,113 @@ +package slb + +//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" +) + +// DescribeListenerAccessControlAttribute invokes the slb.DescribeListenerAccessControlAttribute API synchronously +// api document: https://help.aliyun.com/api/slb/describelisteneraccesscontrolattribute.html +func (client *Client) DescribeListenerAccessControlAttribute(request *DescribeListenerAccessControlAttributeRequest) (response *DescribeListenerAccessControlAttributeResponse, err error) { + response = CreateDescribeListenerAccessControlAttributeResponse() + err = client.DoAction(request, response) + return +} + +// DescribeListenerAccessControlAttributeWithChan invokes the slb.DescribeListenerAccessControlAttribute API asynchronously +// api document: https://help.aliyun.com/api/slb/describelisteneraccesscontrolattribute.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeListenerAccessControlAttributeWithChan(request *DescribeListenerAccessControlAttributeRequest) (<-chan *DescribeListenerAccessControlAttributeResponse, <-chan error) { + responseChan := make(chan *DescribeListenerAccessControlAttributeResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DescribeListenerAccessControlAttribute(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DescribeListenerAccessControlAttributeWithCallback invokes the slb.DescribeListenerAccessControlAttribute API asynchronously +// api document: https://help.aliyun.com/api/slb/describelisteneraccesscontrolattribute.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeListenerAccessControlAttributeWithCallback(request *DescribeListenerAccessControlAttributeRequest, callback func(response *DescribeListenerAccessControlAttributeResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DescribeListenerAccessControlAttributeResponse + var err error + defer close(result) + response, err = client.DescribeListenerAccessControlAttribute(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DescribeListenerAccessControlAttributeRequest is the request struct for api DescribeListenerAccessControlAttribute +type DescribeListenerAccessControlAttributeRequest struct { + *requests.RpcRequest + AccessKeyId string `position:"Query" name:"access_key_id"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ListenerPort requests.Integer `position:"Query" name:"ListenerPort"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + ListenerProtocol string `position:"Query" name:"ListenerProtocol"` + Tags string `position:"Query" name:"Tags"` + LoadBalancerId string `position:"Query" name:"LoadBalancerId"` +} + +// DescribeListenerAccessControlAttributeResponse is the response struct for api DescribeListenerAccessControlAttribute +type DescribeListenerAccessControlAttributeResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + AccessControlStatus string `json:"AccessControlStatus" xml:"AccessControlStatus"` + SourceItems string `json:"SourceItems" xml:"SourceItems"` +} + +// CreateDescribeListenerAccessControlAttributeRequest creates a request to invoke DescribeListenerAccessControlAttribute API +func CreateDescribeListenerAccessControlAttributeRequest() (request *DescribeListenerAccessControlAttributeRequest) { + request = &DescribeListenerAccessControlAttributeRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Slb", "2014-05-15", "DescribeListenerAccessControlAttribute", "slb", "openAPI") + return +} + +// CreateDescribeListenerAccessControlAttributeResponse creates a response to parse from DescribeListenerAccessControlAttribute response +func CreateDescribeListenerAccessControlAttributeResponse() (response *DescribeListenerAccessControlAttributeResponse) { + response = &DescribeListenerAccessControlAttributeResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/describe_load_balancer_attribute.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/describe_load_balancer_attribute.go new file mode 100644 index 0000000000..6a5960240a --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/describe_load_balancer_attribute.go @@ -0,0 +1,154 @@ +package slb + +//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" +) + +// DescribeLoadBalancerAttribute invokes the slb.DescribeLoadBalancerAttribute API synchronously +// api document: https://help.aliyun.com/api/slb/describeloadbalancerattribute.html +func (client *Client) DescribeLoadBalancerAttribute(request *DescribeLoadBalancerAttributeRequest) (response *DescribeLoadBalancerAttributeResponse, err error) { + response = CreateDescribeLoadBalancerAttributeResponse() + err = client.DoAction(request, response) + return +} + +// DescribeLoadBalancerAttributeWithChan invokes the slb.DescribeLoadBalancerAttribute API asynchronously +// api document: https://help.aliyun.com/api/slb/describeloadbalancerattribute.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeLoadBalancerAttributeWithChan(request *DescribeLoadBalancerAttributeRequest) (<-chan *DescribeLoadBalancerAttributeResponse, <-chan error) { + responseChan := make(chan *DescribeLoadBalancerAttributeResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DescribeLoadBalancerAttribute(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DescribeLoadBalancerAttributeWithCallback invokes the slb.DescribeLoadBalancerAttribute API asynchronously +// api document: https://help.aliyun.com/api/slb/describeloadbalancerattribute.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeLoadBalancerAttributeWithCallback(request *DescribeLoadBalancerAttributeRequest, callback func(response *DescribeLoadBalancerAttributeResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DescribeLoadBalancerAttributeResponse + var err error + defer close(result) + response, err = client.DescribeLoadBalancerAttribute(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DescribeLoadBalancerAttributeRequest is the request struct for api DescribeLoadBalancerAttribute +type DescribeLoadBalancerAttributeRequest struct { + *requests.RpcRequest + AccessKeyId string `position:"Query" name:"access_key_id"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + IncludeReservedData requests.Boolean `position:"Query" name:"IncludeReservedData"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + Tags string `position:"Query" name:"Tags"` + LoadBalancerId string `position:"Query" name:"LoadBalancerId"` +} + +// DescribeLoadBalancerAttributeResponse is the response struct for api DescribeLoadBalancerAttribute +type DescribeLoadBalancerAttributeResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + LoadBalancerId string `json:"LoadBalancerId" xml:"LoadBalancerId"` + ResourceGroupId string `json:"ResourceGroupId" xml:"ResourceGroupId"` + LoadBalancerName string `json:"LoadBalancerName" xml:"LoadBalancerName"` + LoadBalancerStatus string `json:"LoadBalancerStatus" xml:"LoadBalancerStatus"` + RegionId string `json:"RegionId" xml:"RegionId"` + RegionIdAlias string `json:"RegionIdAlias" xml:"RegionIdAlias"` + Address string `json:"Address" xml:"Address"` + AddressType string `json:"AddressType" xml:"AddressType"` + VpcId string `json:"VpcId" xml:"VpcId"` + VSwitchId string `json:"VSwitchId" xml:"VSwitchId"` + NetworkType string `json:"NetworkType" xml:"NetworkType"` + InternetChargeType string `json:"InternetChargeType" xml:"InternetChargeType"` + AutoReleaseTime int64 `json:"AutoReleaseTime" xml:"AutoReleaseTime"` + Bandwidth int `json:"Bandwidth" xml:"Bandwidth"` + LoadBalancerSpec string `json:"LoadBalancerSpec" xml:"LoadBalancerSpec"` + CreateTime string `json:"CreateTime" xml:"CreateTime"` + CreateTimeStamp int64 `json:"CreateTimeStamp" xml:"CreateTimeStamp"` + EndTime string `json:"EndTime" xml:"EndTime"` + EndTimeStamp int64 `json:"EndTimeStamp" xml:"EndTimeStamp"` + PayType string `json:"PayType" xml:"PayType"` + MasterZoneId string `json:"MasterZoneId" xml:"MasterZoneId"` + SlaveZoneId string `json:"SlaveZoneId" xml:"SlaveZoneId"` + AddressIPVersion string `json:"AddressIPVersion" xml:"AddressIPVersion"` + CloudType string `json:"CloudType" xml:"CloudType"` + RenewalDuration int `json:"RenewalDuration" xml:"RenewalDuration"` + RenewalStatus string `json:"RenewalStatus" xml:"RenewalStatus"` + RenewalCycUnit string `json:"RenewalCycUnit" xml:"RenewalCycUnit"` + HasReservedInfo string `json:"HasReservedInfo" xml:"HasReservedInfo"` + ReservedInfoOrderType string `json:"ReservedInfoOrderType" xml:"ReservedInfoOrderType"` + ReservedInfoInternetChargeType string `json:"ReservedInfoInternetChargeType" xml:"ReservedInfoInternetChargeType"` + ReservedInfoBandwidth string `json:"ReservedInfoBandwidth" xml:"ReservedInfoBandwidth"` + ReservedInfoActiveTime string `json:"ReservedInfoActiveTime" xml:"ReservedInfoActiveTime"` + DeleteProtection string `json:"DeleteProtection" xml:"DeleteProtection"` + AssociatedCenId string `json:"AssociatedCenId" xml:"AssociatedCenId"` + AssociatedCenStatus string `json:"AssociatedCenStatus" xml:"AssociatedCenStatus"` + CloudInstanceType string `json:"CloudInstanceType" xml:"CloudInstanceType"` + CloudInstanceId string `json:"CloudInstanceId" xml:"CloudInstanceId"` + TunnelType string `json:"TunnelType" xml:"TunnelType"` + CloudInstanceUid int64 `json:"CloudInstanceUid" xml:"CloudInstanceUid"` + SupportPrivateLink bool `json:"SupportPrivateLink" xml:"SupportPrivateLink"` + ListenerPorts ListenerPorts `json:"ListenerPorts" xml:"ListenerPorts"` + ListenerPortsAndProtocal ListenerPortsAndProtocal `json:"ListenerPortsAndProtocal" xml:"ListenerPortsAndProtocal"` + ListenerPortsAndProtocol ListenerPortsAndProtocol `json:"ListenerPortsAndProtocol" xml:"ListenerPortsAndProtocol"` + BackendServers BackendServersInDescribeLoadBalancerAttribute `json:"BackendServers" xml:"BackendServers"` +} + +// CreateDescribeLoadBalancerAttributeRequest creates a request to invoke DescribeLoadBalancerAttribute API +func CreateDescribeLoadBalancerAttributeRequest() (request *DescribeLoadBalancerAttributeRequest) { + request = &DescribeLoadBalancerAttributeRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Slb", "2014-05-15", "DescribeLoadBalancerAttribute", "slb", "openAPI") + return +} + +// CreateDescribeLoadBalancerAttributeResponse creates a response to parse from DescribeLoadBalancerAttribute response +func CreateDescribeLoadBalancerAttributeResponse() (response *DescribeLoadBalancerAttributeResponse) { + response = &DescribeLoadBalancerAttributeResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/describe_load_balancer_http_listener_attribute.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/describe_load_balancer_http_listener_attribute.go new file mode 100644 index 0000000000..bbf5c58a41 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/describe_load_balancer_http_listener_attribute.go @@ -0,0 +1,150 @@ +package slb + +//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" +) + +// DescribeLoadBalancerHTTPListenerAttribute invokes the slb.DescribeLoadBalancerHTTPListenerAttribute API synchronously +// api document: https://help.aliyun.com/api/slb/describeloadbalancerhttplistenerattribute.html +func (client *Client) DescribeLoadBalancerHTTPListenerAttribute(request *DescribeLoadBalancerHTTPListenerAttributeRequest) (response *DescribeLoadBalancerHTTPListenerAttributeResponse, err error) { + response = CreateDescribeLoadBalancerHTTPListenerAttributeResponse() + err = client.DoAction(request, response) + return +} + +// DescribeLoadBalancerHTTPListenerAttributeWithChan invokes the slb.DescribeLoadBalancerHTTPListenerAttribute API asynchronously +// api document: https://help.aliyun.com/api/slb/describeloadbalancerhttplistenerattribute.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeLoadBalancerHTTPListenerAttributeWithChan(request *DescribeLoadBalancerHTTPListenerAttributeRequest) (<-chan *DescribeLoadBalancerHTTPListenerAttributeResponse, <-chan error) { + responseChan := make(chan *DescribeLoadBalancerHTTPListenerAttributeResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DescribeLoadBalancerHTTPListenerAttribute(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DescribeLoadBalancerHTTPListenerAttributeWithCallback invokes the slb.DescribeLoadBalancerHTTPListenerAttribute API asynchronously +// api document: https://help.aliyun.com/api/slb/describeloadbalancerhttplistenerattribute.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeLoadBalancerHTTPListenerAttributeWithCallback(request *DescribeLoadBalancerHTTPListenerAttributeRequest, callback func(response *DescribeLoadBalancerHTTPListenerAttributeResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DescribeLoadBalancerHTTPListenerAttributeResponse + var err error + defer close(result) + response, err = client.DescribeLoadBalancerHTTPListenerAttribute(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DescribeLoadBalancerHTTPListenerAttributeRequest is the request struct for api DescribeLoadBalancerHTTPListenerAttribute +type DescribeLoadBalancerHTTPListenerAttributeRequest struct { + *requests.RpcRequest + AccessKeyId string `position:"Query" name:"access_key_id"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ListenerPort requests.Integer `position:"Query" name:"ListenerPort"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + Tags string `position:"Query" name:"Tags"` + LoadBalancerId string `position:"Query" name:"LoadBalancerId"` +} + +// DescribeLoadBalancerHTTPListenerAttributeResponse is the response struct for api DescribeLoadBalancerHTTPListenerAttribute +type DescribeLoadBalancerHTTPListenerAttributeResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + ListenerPort int `json:"ListenerPort" xml:"ListenerPort"` + BackendServerPort int `json:"BackendServerPort" xml:"BackendServerPort"` + Bandwidth int `json:"Bandwidth" xml:"Bandwidth"` + Status string `json:"Status" xml:"Status"` + SecurityStatus string `json:"SecurityStatus" xml:"SecurityStatus"` + XForwardedFor string `json:"XForwardedFor" xml:"XForwardedFor"` + Scheduler string `json:"Scheduler" xml:"Scheduler"` + StickySession string `json:"StickySession" xml:"StickySession"` + StickySessionType string `json:"StickySessionType" xml:"StickySessionType"` + CookieTimeout int `json:"CookieTimeout" xml:"CookieTimeout"` + Cookie string `json:"Cookie" xml:"Cookie"` + HealthCheck string `json:"HealthCheck" xml:"HealthCheck"` + HealthCheckType string `json:"HealthCheckType" xml:"HealthCheckType"` + HealthCheckDomain string `json:"HealthCheckDomain" xml:"HealthCheckDomain"` + HealthCheckURI string `json:"HealthCheckURI" xml:"HealthCheckURI"` + HealthyThreshold int `json:"HealthyThreshold" xml:"HealthyThreshold"` + UnhealthyThreshold int `json:"UnhealthyThreshold" xml:"UnhealthyThreshold"` + HealthCheckTimeout int `json:"HealthCheckTimeout" xml:"HealthCheckTimeout"` + HealthCheckInterval int `json:"HealthCheckInterval" xml:"HealthCheckInterval"` + HealthCheckConnectPort int `json:"HealthCheckConnectPort" xml:"HealthCheckConnectPort"` + HealthCheckHttpCode string `json:"HealthCheckHttpCode" xml:"HealthCheckHttpCode"` + HealthCheckMethod string `json:"HealthCheckMethod" xml:"HealthCheckMethod"` + HealthCheckHttpVersion string `json:"HealthCheckHttpVersion" xml:"HealthCheckHttpVersion"` + MaxConnection int `json:"MaxConnection" xml:"MaxConnection"` + VServerGroupId string `json:"VServerGroupId" xml:"VServerGroupId"` + Gzip string `json:"Gzip" xml:"Gzip"` + XForwardedForSLBIP string `json:"XForwardedFor_SLBIP" xml:"XForwardedFor_SLBIP"` + XForwardedForSLBID string `json:"XForwardedFor_SLBID" xml:"XForwardedFor_SLBID"` + XForwardedForProto string `json:"XForwardedFor_proto" xml:"XForwardedFor_proto"` + AclId string `json:"AclId" xml:"AclId"` + AclType string `json:"AclType" xml:"AclType"` + AclStatus string `json:"AclStatus" xml:"AclStatus"` + VpcIds string `json:"VpcIds" xml:"VpcIds"` + ListenerForward string `json:"ListenerForward" xml:"ListenerForward"` + ForwardPort int `json:"ForwardPort" xml:"ForwardPort"` + RequestTimeout int `json:"RequestTimeout" xml:"RequestTimeout"` + IdleTimeout int `json:"IdleTimeout" xml:"IdleTimeout"` + Description string `json:"Description" xml:"Description"` + AclIds AclIdsInDescribeLoadBalancerHTTPListenerAttribute `json:"AclIds" xml:"AclIds"` + Rules RulesInDescribeLoadBalancerHTTPListenerAttribute `json:"Rules" xml:"Rules"` +} + +// CreateDescribeLoadBalancerHTTPListenerAttributeRequest creates a request to invoke DescribeLoadBalancerHTTPListenerAttribute API +func CreateDescribeLoadBalancerHTTPListenerAttributeRequest() (request *DescribeLoadBalancerHTTPListenerAttributeRequest) { + request = &DescribeLoadBalancerHTTPListenerAttributeRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Slb", "2014-05-15", "DescribeLoadBalancerHTTPListenerAttribute", "slb", "openAPI") + return +} + +// CreateDescribeLoadBalancerHTTPListenerAttributeResponse creates a response to parse from DescribeLoadBalancerHTTPListenerAttribute response +func CreateDescribeLoadBalancerHTTPListenerAttributeResponse() (response *DescribeLoadBalancerHTTPListenerAttributeResponse) { + response = &DescribeLoadBalancerHTTPListenerAttributeResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/describe_load_balancer_https_listener_attribute.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/describe_load_balancer_https_listener_attribute.go new file mode 100644 index 0000000000..0fd716479f --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/describe_load_balancer_https_listener_attribute.go @@ -0,0 +1,154 @@ +package slb + +//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" +) + +// DescribeLoadBalancerHTTPSListenerAttribute invokes the slb.DescribeLoadBalancerHTTPSListenerAttribute API synchronously +// api document: https://help.aliyun.com/api/slb/describeloadbalancerhttpslistenerattribute.html +func (client *Client) DescribeLoadBalancerHTTPSListenerAttribute(request *DescribeLoadBalancerHTTPSListenerAttributeRequest) (response *DescribeLoadBalancerHTTPSListenerAttributeResponse, err error) { + response = CreateDescribeLoadBalancerHTTPSListenerAttributeResponse() + err = client.DoAction(request, response) + return +} + +// DescribeLoadBalancerHTTPSListenerAttributeWithChan invokes the slb.DescribeLoadBalancerHTTPSListenerAttribute API asynchronously +// api document: https://help.aliyun.com/api/slb/describeloadbalancerhttpslistenerattribute.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeLoadBalancerHTTPSListenerAttributeWithChan(request *DescribeLoadBalancerHTTPSListenerAttributeRequest) (<-chan *DescribeLoadBalancerHTTPSListenerAttributeResponse, <-chan error) { + responseChan := make(chan *DescribeLoadBalancerHTTPSListenerAttributeResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DescribeLoadBalancerHTTPSListenerAttribute(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DescribeLoadBalancerHTTPSListenerAttributeWithCallback invokes the slb.DescribeLoadBalancerHTTPSListenerAttribute API asynchronously +// api document: https://help.aliyun.com/api/slb/describeloadbalancerhttpslistenerattribute.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeLoadBalancerHTTPSListenerAttributeWithCallback(request *DescribeLoadBalancerHTTPSListenerAttributeRequest, callback func(response *DescribeLoadBalancerHTTPSListenerAttributeResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DescribeLoadBalancerHTTPSListenerAttributeResponse + var err error + defer close(result) + response, err = client.DescribeLoadBalancerHTTPSListenerAttribute(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DescribeLoadBalancerHTTPSListenerAttributeRequest is the request struct for api DescribeLoadBalancerHTTPSListenerAttribute +type DescribeLoadBalancerHTTPSListenerAttributeRequest struct { + *requests.RpcRequest + AccessKeyId string `position:"Query" name:"access_key_id"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ListenerPort requests.Integer `position:"Query" name:"ListenerPort"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + Tags string `position:"Query" name:"Tags"` + LoadBalancerId string `position:"Query" name:"LoadBalancerId"` +} + +// DescribeLoadBalancerHTTPSListenerAttributeResponse is the response struct for api DescribeLoadBalancerHTTPSListenerAttribute +type DescribeLoadBalancerHTTPSListenerAttributeResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + ListenerPort int `json:"ListenerPort" xml:"ListenerPort"` + BackendServerPort int `json:"BackendServerPort" xml:"BackendServerPort"` + BackendProtocol string `json:"BackendProtocol" xml:"BackendProtocol"` + Bandwidth int `json:"Bandwidth" xml:"Bandwidth"` + Status string `json:"Status" xml:"Status"` + SecurityStatus string `json:"SecurityStatus" xml:"SecurityStatus"` + XForwardedFor string `json:"XForwardedFor" xml:"XForwardedFor"` + Scheduler string `json:"Scheduler" xml:"Scheduler"` + StickySession string `json:"StickySession" xml:"StickySession"` + StickySessionType string `json:"StickySessionType" xml:"StickySessionType"` + CookieTimeout int `json:"CookieTimeout" xml:"CookieTimeout"` + Cookie string `json:"Cookie" xml:"Cookie"` + HealthCheck string `json:"HealthCheck" xml:"HealthCheck"` + HealthCheckType string `json:"HealthCheckType" xml:"HealthCheckType"` + HealthCheckDomain string `json:"HealthCheckDomain" xml:"HealthCheckDomain"` + HealthCheckURI string `json:"HealthCheckURI" xml:"HealthCheckURI"` + HealthyThreshold int `json:"HealthyThreshold" xml:"HealthyThreshold"` + UnhealthyThreshold int `json:"UnhealthyThreshold" xml:"UnhealthyThreshold"` + HealthCheckTimeout int `json:"HealthCheckTimeout" xml:"HealthCheckTimeout"` + HealthCheckInterval int `json:"HealthCheckInterval" xml:"HealthCheckInterval"` + HealthCheckConnectPort int `json:"HealthCheckConnectPort" xml:"HealthCheckConnectPort"` + HealthCheckHttpCode string `json:"HealthCheckHttpCode" xml:"HealthCheckHttpCode"` + ServerCertificateId string `json:"ServerCertificateId" xml:"ServerCertificateId"` + CACertificateId string `json:"CACertificateId" xml:"CACertificateId"` + HealthCheckMethod string `json:"HealthCheckMethod" xml:"HealthCheckMethod"` + HealthCheckHttpVersion string `json:"HealthCheckHttpVersion" xml:"HealthCheckHttpVersion"` + MaxConnection int `json:"MaxConnection" xml:"MaxConnection"` + VServerGroupId string `json:"VServerGroupId" xml:"VServerGroupId"` + Gzip string `json:"Gzip" xml:"Gzip"` + XForwardedForSLBIP string `json:"XForwardedFor_SLBIP" xml:"XForwardedFor_SLBIP"` + XForwardedForSLBID string `json:"XForwardedFor_SLBID" xml:"XForwardedFor_SLBID"` + XForwardedForProto string `json:"XForwardedFor_proto" xml:"XForwardedFor_proto"` + AclId string `json:"AclId" xml:"AclId"` + AclType string `json:"AclType" xml:"AclType"` + AclStatus string `json:"AclStatus" xml:"AclStatus"` + VpcIds string `json:"VpcIds" xml:"VpcIds"` + RequestTimeout int `json:"RequestTimeout" xml:"RequestTimeout"` + IdleTimeout int `json:"IdleTimeout" xml:"IdleTimeout"` + EnableHttp2 string `json:"EnableHttp2" xml:"EnableHttp2"` + TLSCipherPolicy string `json:"TLSCipherPolicy" xml:"TLSCipherPolicy"` + Description string `json:"Description" xml:"Description"` + AclIds AclIdsInDescribeLoadBalancerHTTPSListenerAttribute `json:"AclIds" xml:"AclIds"` + Rules RulesInDescribeLoadBalancerHTTPSListenerAttribute `json:"Rules" xml:"Rules"` + DomainExtensions DomainExtensionsInDescribeLoadBalancerHTTPSListenerAttribute `json:"DomainExtensions" xml:"DomainExtensions"` +} + +// CreateDescribeLoadBalancerHTTPSListenerAttributeRequest creates a request to invoke DescribeLoadBalancerHTTPSListenerAttribute API +func CreateDescribeLoadBalancerHTTPSListenerAttributeRequest() (request *DescribeLoadBalancerHTTPSListenerAttributeRequest) { + request = &DescribeLoadBalancerHTTPSListenerAttributeRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Slb", "2014-05-15", "DescribeLoadBalancerHTTPSListenerAttribute", "slb", "openAPI") + return +} + +// CreateDescribeLoadBalancerHTTPSListenerAttributeResponse creates a response to parse from DescribeLoadBalancerHTTPSListenerAttribute response +func CreateDescribeLoadBalancerHTTPSListenerAttributeResponse() (response *DescribeLoadBalancerHTTPSListenerAttributeResponse) { + response = &DescribeLoadBalancerHTTPSListenerAttributeResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/describe_load_balancer_tcp_listener_attribute.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/describe_load_balancer_tcp_listener_attribute.go new file mode 100644 index 0000000000..d1da762bc9 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/describe_load_balancer_tcp_listener_attribute.go @@ -0,0 +1,141 @@ +package slb + +//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" +) + +// DescribeLoadBalancerTCPListenerAttribute invokes the slb.DescribeLoadBalancerTCPListenerAttribute API synchronously +// api document: https://help.aliyun.com/api/slb/describeloadbalancertcplistenerattribute.html +func (client *Client) DescribeLoadBalancerTCPListenerAttribute(request *DescribeLoadBalancerTCPListenerAttributeRequest) (response *DescribeLoadBalancerTCPListenerAttributeResponse, err error) { + response = CreateDescribeLoadBalancerTCPListenerAttributeResponse() + err = client.DoAction(request, response) + return +} + +// DescribeLoadBalancerTCPListenerAttributeWithChan invokes the slb.DescribeLoadBalancerTCPListenerAttribute API asynchronously +// api document: https://help.aliyun.com/api/slb/describeloadbalancertcplistenerattribute.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeLoadBalancerTCPListenerAttributeWithChan(request *DescribeLoadBalancerTCPListenerAttributeRequest) (<-chan *DescribeLoadBalancerTCPListenerAttributeResponse, <-chan error) { + responseChan := make(chan *DescribeLoadBalancerTCPListenerAttributeResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DescribeLoadBalancerTCPListenerAttribute(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DescribeLoadBalancerTCPListenerAttributeWithCallback invokes the slb.DescribeLoadBalancerTCPListenerAttribute API asynchronously +// api document: https://help.aliyun.com/api/slb/describeloadbalancertcplistenerattribute.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeLoadBalancerTCPListenerAttributeWithCallback(request *DescribeLoadBalancerTCPListenerAttributeRequest, callback func(response *DescribeLoadBalancerTCPListenerAttributeResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DescribeLoadBalancerTCPListenerAttributeResponse + var err error + defer close(result) + response, err = client.DescribeLoadBalancerTCPListenerAttribute(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DescribeLoadBalancerTCPListenerAttributeRequest is the request struct for api DescribeLoadBalancerTCPListenerAttribute +type DescribeLoadBalancerTCPListenerAttributeRequest struct { + *requests.RpcRequest + AccessKeyId string `position:"Query" name:"access_key_id"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ListenerPort requests.Integer `position:"Query" name:"ListenerPort"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + Tags string `position:"Query" name:"Tags"` + LoadBalancerId string `position:"Query" name:"LoadBalancerId"` +} + +// DescribeLoadBalancerTCPListenerAttributeResponse is the response struct for api DescribeLoadBalancerTCPListenerAttribute +type DescribeLoadBalancerTCPListenerAttributeResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + ListenerPort int `json:"ListenerPort" xml:"ListenerPort"` + BackendServerPort int `json:"BackendServerPort" xml:"BackendServerPort"` + Status string `json:"Status" xml:"Status"` + Bandwidth int `json:"Bandwidth" xml:"Bandwidth"` + Scheduler string `json:"Scheduler" xml:"Scheduler"` + SynProxy string `json:"SynProxy" xml:"SynProxy"` + PersistenceTimeout int `json:"PersistenceTimeout" xml:"PersistenceTimeout"` + EstablishedTimeout int `json:"EstablishedTimeout" xml:"EstablishedTimeout"` + HealthCheck string `json:"HealthCheck" xml:"HealthCheck"` + HealthyThreshold int `json:"HealthyThreshold" xml:"HealthyThreshold"` + UnhealthyThreshold int `json:"UnhealthyThreshold" xml:"UnhealthyThreshold"` + HealthCheckConnectTimeout int `json:"HealthCheckConnectTimeout" xml:"HealthCheckConnectTimeout"` + HealthCheckConnectPort int `json:"HealthCheckConnectPort" xml:"HealthCheckConnectPort"` + HealthCheckInterval int `json:"HealthCheckInterval" xml:"HealthCheckInterval"` + HealthCheckHttpCode string `json:"HealthCheckHttpCode" xml:"HealthCheckHttpCode"` + HealthCheckDomain string `json:"HealthCheckDomain" xml:"HealthCheckDomain"` + HealthCheckURI string `json:"HealthCheckURI" xml:"HealthCheckURI"` + HealthCheckType string `json:"HealthCheckType" xml:"HealthCheckType"` + HealthCheckMethod string `json:"HealthCheckMethod" xml:"HealthCheckMethod"` + MaxConnection int `json:"MaxConnection" xml:"MaxConnection"` + VServerGroupId string `json:"VServerGroupId" xml:"VServerGroupId"` + MasterSlaveServerGroupId string `json:"MasterSlaveServerGroupId" xml:"MasterSlaveServerGroupId"` + AclId string `json:"AclId" xml:"AclId"` + AclType string `json:"AclType" xml:"AclType"` + AclStatus string `json:"AclStatus" xml:"AclStatus"` + VpcIds string `json:"VpcIds" xml:"VpcIds"` + Description string `json:"Description" xml:"Description"` + ConnectionDrain string `json:"ConnectionDrain" xml:"ConnectionDrain"` + ConnectionDrainTimeout int `json:"ConnectionDrainTimeout" xml:"ConnectionDrainTimeout"` + AclIds AclIdsInDescribeLoadBalancerTCPListenerAttribute `json:"AclIds" xml:"AclIds"` + PortRanges PortRangesInDescribeLoadBalancerTCPListenerAttribute `json:"PortRanges" xml:"PortRanges"` +} + +// CreateDescribeLoadBalancerTCPListenerAttributeRequest creates a request to invoke DescribeLoadBalancerTCPListenerAttribute API +func CreateDescribeLoadBalancerTCPListenerAttributeRequest() (request *DescribeLoadBalancerTCPListenerAttributeRequest) { + request = &DescribeLoadBalancerTCPListenerAttributeRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Slb", "2014-05-15", "DescribeLoadBalancerTCPListenerAttribute", "slb", "openAPI") + return +} + +// CreateDescribeLoadBalancerTCPListenerAttributeResponse creates a response to parse from DescribeLoadBalancerTCPListenerAttribute response +func CreateDescribeLoadBalancerTCPListenerAttributeResponse() (response *DescribeLoadBalancerTCPListenerAttributeResponse) { + response = &DescribeLoadBalancerTCPListenerAttributeResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/describe_load_balancer_udp_listener_attribute.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/describe_load_balancer_udp_listener_attribute.go new file mode 100644 index 0000000000..aff5db0384 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/describe_load_balancer_udp_listener_attribute.go @@ -0,0 +1,136 @@ +package slb + +//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" +) + +// DescribeLoadBalancerUDPListenerAttribute invokes the slb.DescribeLoadBalancerUDPListenerAttribute API synchronously +// api document: https://help.aliyun.com/api/slb/describeloadbalancerudplistenerattribute.html +func (client *Client) DescribeLoadBalancerUDPListenerAttribute(request *DescribeLoadBalancerUDPListenerAttributeRequest) (response *DescribeLoadBalancerUDPListenerAttributeResponse, err error) { + response = CreateDescribeLoadBalancerUDPListenerAttributeResponse() + err = client.DoAction(request, response) + return +} + +// DescribeLoadBalancerUDPListenerAttributeWithChan invokes the slb.DescribeLoadBalancerUDPListenerAttribute API asynchronously +// api document: https://help.aliyun.com/api/slb/describeloadbalancerudplistenerattribute.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeLoadBalancerUDPListenerAttributeWithChan(request *DescribeLoadBalancerUDPListenerAttributeRequest) (<-chan *DescribeLoadBalancerUDPListenerAttributeResponse, <-chan error) { + responseChan := make(chan *DescribeLoadBalancerUDPListenerAttributeResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DescribeLoadBalancerUDPListenerAttribute(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DescribeLoadBalancerUDPListenerAttributeWithCallback invokes the slb.DescribeLoadBalancerUDPListenerAttribute API asynchronously +// api document: https://help.aliyun.com/api/slb/describeloadbalancerudplistenerattribute.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeLoadBalancerUDPListenerAttributeWithCallback(request *DescribeLoadBalancerUDPListenerAttributeRequest, callback func(response *DescribeLoadBalancerUDPListenerAttributeResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DescribeLoadBalancerUDPListenerAttributeResponse + var err error + defer close(result) + response, err = client.DescribeLoadBalancerUDPListenerAttribute(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DescribeLoadBalancerUDPListenerAttributeRequest is the request struct for api DescribeLoadBalancerUDPListenerAttribute +type DescribeLoadBalancerUDPListenerAttributeRequest struct { + *requests.RpcRequest + AccessKeyId string `position:"Query" name:"access_key_id"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ListenerPort requests.Integer `position:"Query" name:"ListenerPort"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + Tags string `position:"Query" name:"Tags"` + LoadBalancerId string `position:"Query" name:"LoadBalancerId"` +} + +// DescribeLoadBalancerUDPListenerAttributeResponse is the response struct for api DescribeLoadBalancerUDPListenerAttribute +type DescribeLoadBalancerUDPListenerAttributeResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + ListenerPort int `json:"ListenerPort" xml:"ListenerPort"` + BackendServerPort int `json:"BackendServerPort" xml:"BackendServerPort"` + Status string `json:"Status" xml:"Status"` + Bandwidth int `json:"Bandwidth" xml:"Bandwidth"` + Scheduler string `json:"Scheduler" xml:"Scheduler"` + PersistenceTimeout int `json:"PersistenceTimeout" xml:"PersistenceTimeout"` + HealthCheck string `json:"HealthCheck" xml:"HealthCheck"` + HealthyThreshold int `json:"HealthyThreshold" xml:"HealthyThreshold"` + UnhealthyThreshold int `json:"UnhealthyThreshold" xml:"UnhealthyThreshold"` + HealthCheckConnectTimeout int `json:"HealthCheckConnectTimeout" xml:"HealthCheckConnectTimeout"` + HealthCheckConnectPort int `json:"HealthCheckConnectPort" xml:"HealthCheckConnectPort"` + HealthCheckInterval int `json:"HealthCheckInterval" xml:"HealthCheckInterval"` + HealthCheckReq string `json:"HealthCheckReq" xml:"HealthCheckReq"` + HealthCheckExp string `json:"HealthCheckExp" xml:"HealthCheckExp"` + MaxConnection int `json:"MaxConnection" xml:"MaxConnection"` + VServerGroupId string `json:"VServerGroupId" xml:"VServerGroupId"` + MasterSlaveServerGroupId string `json:"MasterSlaveServerGroupId" xml:"MasterSlaveServerGroupId"` + AclId string `json:"AclId" xml:"AclId"` + AclType string `json:"AclType" xml:"AclType"` + AclStatus string `json:"AclStatus" xml:"AclStatus"` + VpcIds string `json:"VpcIds" xml:"VpcIds"` + Description string `json:"Description" xml:"Description"` + ConnectionDrain string `json:"ConnectionDrain" xml:"ConnectionDrain"` + ConnectionDrainTimeout int `json:"ConnectionDrainTimeout" xml:"ConnectionDrainTimeout"` + AclIds AclIdsInDescribeLoadBalancerUDPListenerAttribute `json:"AclIds" xml:"AclIds"` + PortRanges PortRangesInDescribeLoadBalancerUDPListenerAttribute `json:"PortRanges" xml:"PortRanges"` +} + +// CreateDescribeLoadBalancerUDPListenerAttributeRequest creates a request to invoke DescribeLoadBalancerUDPListenerAttribute API +func CreateDescribeLoadBalancerUDPListenerAttributeRequest() (request *DescribeLoadBalancerUDPListenerAttributeRequest) { + request = &DescribeLoadBalancerUDPListenerAttributeRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Slb", "2014-05-15", "DescribeLoadBalancerUDPListenerAttribute", "slb", "openAPI") + return +} + +// CreateDescribeLoadBalancerUDPListenerAttributeResponse creates a response to parse from DescribeLoadBalancerUDPListenerAttribute response +func CreateDescribeLoadBalancerUDPListenerAttributeResponse() (response *DescribeLoadBalancerUDPListenerAttributeResponse) { + response = &DescribeLoadBalancerUDPListenerAttributeResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/describe_load_balancers.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/describe_load_balancers.go new file mode 100644 index 0000000000..90239f1e0b --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/describe_load_balancers.go @@ -0,0 +1,139 @@ +package slb + +//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" +) + +// DescribeLoadBalancers invokes the slb.DescribeLoadBalancers API synchronously +// api document: https://help.aliyun.com/api/slb/describeloadbalancers.html +func (client *Client) DescribeLoadBalancers(request *DescribeLoadBalancersRequest) (response *DescribeLoadBalancersResponse, err error) { + response = CreateDescribeLoadBalancersResponse() + err = client.DoAction(request, response) + return +} + +// DescribeLoadBalancersWithChan invokes the slb.DescribeLoadBalancers API asynchronously +// api document: https://help.aliyun.com/api/slb/describeloadbalancers.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeLoadBalancersWithChan(request *DescribeLoadBalancersRequest) (<-chan *DescribeLoadBalancersResponse, <-chan error) { + responseChan := make(chan *DescribeLoadBalancersResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DescribeLoadBalancers(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DescribeLoadBalancersWithCallback invokes the slb.DescribeLoadBalancers API asynchronously +// api document: https://help.aliyun.com/api/slb/describeloadbalancers.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeLoadBalancersWithCallback(request *DescribeLoadBalancersRequest, callback func(response *DescribeLoadBalancersResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DescribeLoadBalancersResponse + var err error + defer close(result) + response, err = client.DescribeLoadBalancers(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DescribeLoadBalancersRequest is the request struct for api DescribeLoadBalancers +type DescribeLoadBalancersRequest struct { + *requests.RpcRequest + AccessKeyId string `position:"Query" name:"access_key_id"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + SupportPrivateLink requests.Boolean `position:"Query" name:"SupportPrivateLink"` + NetworkType string `position:"Query" name:"NetworkType"` + AddressIPVersion string `position:"Query" name:"AddressIPVersion"` + MasterZoneId string `position:"Query" name:"MasterZoneId"` + PageNumber requests.Integer `position:"Query" name:"PageNumber"` + ResourceGroupId string `position:"Query" name:"ResourceGroupId"` + LoadBalancerName string `position:"Query" name:"LoadBalancerName"` + PageSize requests.Integer `position:"Query" name:"PageSize"` + AddressType string `position:"Query" name:"AddressType"` + SlaveZoneId string `position:"Query" name:"SlaveZoneId"` + Tag *[]DescribeLoadBalancersTag `position:"Query" name:"Tag" type:"Repeated"` + Fuzzy string `position:"Query" name:"Fuzzy"` + Address string `position:"Query" name:"Address"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + ServerId string `position:"Query" name:"ServerId"` + LoadBalancerStatus string `position:"Query" name:"LoadBalancerStatus"` + Tags string `position:"Query" name:"Tags"` + ServerIntranetAddress string `position:"Query" name:"ServerIntranetAddress"` + VSwitchId string `position:"Query" name:"VSwitchId"` + LoadBalancerId string `position:"Query" name:"LoadBalancerId"` + InternetChargeType string `position:"Query" name:"InternetChargeType"` + VpcId string `position:"Query" name:"VpcId"` + PayType string `position:"Query" name:"PayType"` +} + +// DescribeLoadBalancersTag is a repeated param struct in DescribeLoadBalancersRequest +type DescribeLoadBalancersTag struct { + Value string `name:"Value"` + Key string `name:"Key"` +} + +// DescribeLoadBalancersResponse is the response struct for api DescribeLoadBalancers +type DescribeLoadBalancersResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + PageNumber int `json:"PageNumber" xml:"PageNumber"` + PageSize int `json:"PageSize" xml:"PageSize"` + TotalCount int `json:"TotalCount" xml:"TotalCount"` + LoadBalancers LoadBalancers `json:"LoadBalancers" xml:"LoadBalancers"` +} + +// CreateDescribeLoadBalancersRequest creates a request to invoke DescribeLoadBalancers API +func CreateDescribeLoadBalancersRequest() (request *DescribeLoadBalancersRequest) { + request = &DescribeLoadBalancersRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Slb", "2014-05-15", "DescribeLoadBalancers", "slb", "openAPI") + return +} + +// CreateDescribeLoadBalancersResponse creates a response to parse from DescribeLoadBalancers response +func CreateDescribeLoadBalancersResponse() (response *DescribeLoadBalancersResponse) { + response = &DescribeLoadBalancersResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/describe_master_slave_server_group_attribute.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/describe_master_slave_server_group_attribute.go new file mode 100644 index 0000000000..580f1188a1 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/describe_master_slave_server_group_attribute.go @@ -0,0 +1,113 @@ +package slb + +//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" +) + +// DescribeMasterSlaveServerGroupAttribute invokes the slb.DescribeMasterSlaveServerGroupAttribute API synchronously +// api document: https://help.aliyun.com/api/slb/describemasterslaveservergroupattribute.html +func (client *Client) DescribeMasterSlaveServerGroupAttribute(request *DescribeMasterSlaveServerGroupAttributeRequest) (response *DescribeMasterSlaveServerGroupAttributeResponse, err error) { + response = CreateDescribeMasterSlaveServerGroupAttributeResponse() + err = client.DoAction(request, response) + return +} + +// DescribeMasterSlaveServerGroupAttributeWithChan invokes the slb.DescribeMasterSlaveServerGroupAttribute API asynchronously +// api document: https://help.aliyun.com/api/slb/describemasterslaveservergroupattribute.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeMasterSlaveServerGroupAttributeWithChan(request *DescribeMasterSlaveServerGroupAttributeRequest) (<-chan *DescribeMasterSlaveServerGroupAttributeResponse, <-chan error) { + responseChan := make(chan *DescribeMasterSlaveServerGroupAttributeResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DescribeMasterSlaveServerGroupAttribute(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DescribeMasterSlaveServerGroupAttributeWithCallback invokes the slb.DescribeMasterSlaveServerGroupAttribute API asynchronously +// api document: https://help.aliyun.com/api/slb/describemasterslaveservergroupattribute.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeMasterSlaveServerGroupAttributeWithCallback(request *DescribeMasterSlaveServerGroupAttributeRequest, callback func(response *DescribeMasterSlaveServerGroupAttributeResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DescribeMasterSlaveServerGroupAttributeResponse + var err error + defer close(result) + response, err = client.DescribeMasterSlaveServerGroupAttribute(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DescribeMasterSlaveServerGroupAttributeRequest is the request struct for api DescribeMasterSlaveServerGroupAttribute +type DescribeMasterSlaveServerGroupAttributeRequest struct { + *requests.RpcRequest + AccessKeyId string `position:"Query" name:"access_key_id"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + Tags string `position:"Query" name:"Tags"` + MasterSlaveServerGroupId string `position:"Query" name:"MasterSlaveServerGroupId"` +} + +// DescribeMasterSlaveServerGroupAttributeResponse is the response struct for api DescribeMasterSlaveServerGroupAttribute +type DescribeMasterSlaveServerGroupAttributeResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + LoadBalancerId string `json:"LoadBalancerId" xml:"LoadBalancerId"` + MasterSlaveServerGroupId string `json:"MasterSlaveServerGroupId" xml:"MasterSlaveServerGroupId"` + MasterSlaveServerGroupName string `json:"MasterSlaveServerGroupName" xml:"MasterSlaveServerGroupName"` + MasterSlaveBackendServers MasterSlaveBackendServersInDescribeMasterSlaveServerGroupAttribute `json:"MasterSlaveBackendServers" xml:"MasterSlaveBackendServers"` +} + +// CreateDescribeMasterSlaveServerGroupAttributeRequest creates a request to invoke DescribeMasterSlaveServerGroupAttribute API +func CreateDescribeMasterSlaveServerGroupAttributeRequest() (request *DescribeMasterSlaveServerGroupAttributeRequest) { + request = &DescribeMasterSlaveServerGroupAttributeRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Slb", "2014-05-15", "DescribeMasterSlaveServerGroupAttribute", "slb", "openAPI") + return +} + +// CreateDescribeMasterSlaveServerGroupAttributeResponse creates a response to parse from DescribeMasterSlaveServerGroupAttribute response +func CreateDescribeMasterSlaveServerGroupAttributeResponse() (response *DescribeMasterSlaveServerGroupAttributeResponse) { + response = &DescribeMasterSlaveServerGroupAttributeResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/describe_master_slave_server_groups.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/describe_master_slave_server_groups.go new file mode 100644 index 0000000000..6ef025ffbe --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/describe_master_slave_server_groups.go @@ -0,0 +1,111 @@ +package slb + +//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" +) + +// DescribeMasterSlaveServerGroups invokes the slb.DescribeMasterSlaveServerGroups API synchronously +// api document: https://help.aliyun.com/api/slb/describemasterslaveservergroups.html +func (client *Client) DescribeMasterSlaveServerGroups(request *DescribeMasterSlaveServerGroupsRequest) (response *DescribeMasterSlaveServerGroupsResponse, err error) { + response = CreateDescribeMasterSlaveServerGroupsResponse() + err = client.DoAction(request, response) + return +} + +// DescribeMasterSlaveServerGroupsWithChan invokes the slb.DescribeMasterSlaveServerGroups API asynchronously +// api document: https://help.aliyun.com/api/slb/describemasterslaveservergroups.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeMasterSlaveServerGroupsWithChan(request *DescribeMasterSlaveServerGroupsRequest) (<-chan *DescribeMasterSlaveServerGroupsResponse, <-chan error) { + responseChan := make(chan *DescribeMasterSlaveServerGroupsResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DescribeMasterSlaveServerGroups(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DescribeMasterSlaveServerGroupsWithCallback invokes the slb.DescribeMasterSlaveServerGroups API asynchronously +// api document: https://help.aliyun.com/api/slb/describemasterslaveservergroups.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeMasterSlaveServerGroupsWithCallback(request *DescribeMasterSlaveServerGroupsRequest, callback func(response *DescribeMasterSlaveServerGroupsResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DescribeMasterSlaveServerGroupsResponse + var err error + defer close(result) + response, err = client.DescribeMasterSlaveServerGroups(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DescribeMasterSlaveServerGroupsRequest is the request struct for api DescribeMasterSlaveServerGroups +type DescribeMasterSlaveServerGroupsRequest struct { + *requests.RpcRequest + AccessKeyId string `position:"Query" name:"access_key_id"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + IncludeListener requests.Boolean `position:"Query" name:"IncludeListener"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + Tags string `position:"Query" name:"Tags"` + LoadBalancerId string `position:"Query" name:"LoadBalancerId"` +} + +// DescribeMasterSlaveServerGroupsResponse is the response struct for api DescribeMasterSlaveServerGroups +type DescribeMasterSlaveServerGroupsResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + MasterSlaveServerGroups MasterSlaveServerGroups `json:"MasterSlaveServerGroups" xml:"MasterSlaveServerGroups"` +} + +// CreateDescribeMasterSlaveServerGroupsRequest creates a request to invoke DescribeMasterSlaveServerGroups API +func CreateDescribeMasterSlaveServerGroupsRequest() (request *DescribeMasterSlaveServerGroupsRequest) { + request = &DescribeMasterSlaveServerGroupsRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Slb", "2014-05-15", "DescribeMasterSlaveServerGroups", "slb", "openAPI") + return +} + +// CreateDescribeMasterSlaveServerGroupsResponse creates a response to parse from DescribeMasterSlaveServerGroups response +func CreateDescribeMasterSlaveServerGroupsResponse() (response *DescribeMasterSlaveServerGroupsResponse) { + response = &DescribeMasterSlaveServerGroupsResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/describe_regions.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/describe_regions.go new file mode 100644 index 0000000000..c32762835b --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/describe_regions.go @@ -0,0 +1,110 @@ +package slb + +//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 slb.DescribeRegions API synchronously +// api document: https://help.aliyun.com/api/slb/describeregions.html +func (client *Client) DescribeRegions(request *DescribeRegionsRequest) (response *DescribeRegionsResponse, err error) { + response = CreateDescribeRegionsResponse() + err = client.DoAction(request, response) + return +} + +// DescribeRegionsWithChan invokes the slb.DescribeRegions API asynchronously +// api document: https://help.aliyun.com/api/slb/describeregions.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +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 slb.DescribeRegions API asynchronously +// api document: https://help.aliyun.com/api/slb/describeregions.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +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 + AccessKeyId string `position:"Query" name:"access_key_id"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + Tags string `position:"Query" name:"Tags"` + AcceptLanguage string `position:"Query" name:"AcceptLanguage"` +} + +// DescribeRegionsResponse is the response struct for api DescribeRegions +type DescribeRegionsResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + Regions Regions `json:"Regions" xml:"Regions"` +} + +// CreateDescribeRegionsRequest creates a request to invoke DescribeRegions API +func CreateDescribeRegionsRequest() (request *DescribeRegionsRequest) { + request = &DescribeRegionsRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Slb", "2014-05-15", "DescribeRegions", "slb", "openAPI") + return +} + +// CreateDescribeRegionsResponse creates a response to parse from DescribeRegions response +func CreateDescribeRegionsResponse() (response *DescribeRegionsResponse) { + response = &DescribeRegionsResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/describe_rule_attribute.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/describe_rule_attribute.go new file mode 100644 index 0000000000..8c509933b7 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/describe_rule_attribute.go @@ -0,0 +1,131 @@ +package slb + +//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" +) + +// DescribeRuleAttribute invokes the slb.DescribeRuleAttribute API synchronously +// api document: https://help.aliyun.com/api/slb/describeruleattribute.html +func (client *Client) DescribeRuleAttribute(request *DescribeRuleAttributeRequest) (response *DescribeRuleAttributeResponse, err error) { + response = CreateDescribeRuleAttributeResponse() + err = client.DoAction(request, response) + return +} + +// DescribeRuleAttributeWithChan invokes the slb.DescribeRuleAttribute API asynchronously +// api document: https://help.aliyun.com/api/slb/describeruleattribute.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeRuleAttributeWithChan(request *DescribeRuleAttributeRequest) (<-chan *DescribeRuleAttributeResponse, <-chan error) { + responseChan := make(chan *DescribeRuleAttributeResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DescribeRuleAttribute(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DescribeRuleAttributeWithCallback invokes the slb.DescribeRuleAttribute API asynchronously +// api document: https://help.aliyun.com/api/slb/describeruleattribute.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeRuleAttributeWithCallback(request *DescribeRuleAttributeRequest, callback func(response *DescribeRuleAttributeResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DescribeRuleAttributeResponse + var err error + defer close(result) + response, err = client.DescribeRuleAttribute(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DescribeRuleAttributeRequest is the request struct for api DescribeRuleAttribute +type DescribeRuleAttributeRequest struct { + *requests.RpcRequest + AccessKeyId string `position:"Query" name:"access_key_id"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + Tags string `position:"Query" name:"Tags"` + RuleId string `position:"Query" name:"RuleId"` +} + +// DescribeRuleAttributeResponse is the response struct for api DescribeRuleAttribute +type DescribeRuleAttributeResponse struct { + *responses.BaseResponse + RuleId string `json:"RuleId" xml:"RuleId"` + RequestId string `json:"RequestId" xml:"RequestId"` + RuleName string `json:"RuleName" xml:"RuleName"` + LoadBalancerId string `json:"LoadBalancerId" xml:"LoadBalancerId"` + ListenerPort string `json:"ListenerPort" xml:"ListenerPort"` + Domain string `json:"Domain" xml:"Domain"` + Url string `json:"Url" xml:"Url"` + VServerGroupId string `json:"VServerGroupId" xml:"VServerGroupId"` + ListenerSync string `json:"ListenerSync" xml:"ListenerSync"` + Scheduler string `json:"Scheduler" xml:"Scheduler"` + StickySession string `json:"StickySession" xml:"StickySession"` + StickySessionType string `json:"StickySessionType" xml:"StickySessionType"` + CookieTimeout int `json:"CookieTimeout" xml:"CookieTimeout"` + Cookie string `json:"Cookie" xml:"Cookie"` + HealthCheck string `json:"HealthCheck" xml:"HealthCheck"` + HealthCheckDomain string `json:"HealthCheckDomain" xml:"HealthCheckDomain"` + HealthCheckURI string `json:"HealthCheckURI" xml:"HealthCheckURI"` + HealthyThreshold int `json:"HealthyThreshold" xml:"HealthyThreshold"` + UnhealthyThreshold int `json:"UnhealthyThreshold" xml:"UnhealthyThreshold"` + HealthCheckTimeout int `json:"HealthCheckTimeout" xml:"HealthCheckTimeout"` + HealthCheckInterval int `json:"HealthCheckInterval" xml:"HealthCheckInterval"` + HealthCheckConnectPort int `json:"HealthCheckConnectPort" xml:"HealthCheckConnectPort"` + HealthCheckHttpCode string `json:"HealthCheckHttpCode" xml:"HealthCheckHttpCode"` +} + +// CreateDescribeRuleAttributeRequest creates a request to invoke DescribeRuleAttribute API +func CreateDescribeRuleAttributeRequest() (request *DescribeRuleAttributeRequest) { + request = &DescribeRuleAttributeRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Slb", "2014-05-15", "DescribeRuleAttribute", "slb", "openAPI") + return +} + +// CreateDescribeRuleAttributeResponse creates a response to parse from DescribeRuleAttribute response +func CreateDescribeRuleAttributeResponse() (response *DescribeRuleAttributeResponse) { + response = &DescribeRuleAttributeResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/describe_rules.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/describe_rules.go new file mode 100644 index 0000000000..57f6207711 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/describe_rules.go @@ -0,0 +1,112 @@ +package slb + +//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" +) + +// DescribeRules invokes the slb.DescribeRules API synchronously +// api document: https://help.aliyun.com/api/slb/describerules.html +func (client *Client) DescribeRules(request *DescribeRulesRequest) (response *DescribeRulesResponse, err error) { + response = CreateDescribeRulesResponse() + err = client.DoAction(request, response) + return +} + +// DescribeRulesWithChan invokes the slb.DescribeRules API asynchronously +// api document: https://help.aliyun.com/api/slb/describerules.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeRulesWithChan(request *DescribeRulesRequest) (<-chan *DescribeRulesResponse, <-chan error) { + responseChan := make(chan *DescribeRulesResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DescribeRules(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DescribeRulesWithCallback invokes the slb.DescribeRules API asynchronously +// api document: https://help.aliyun.com/api/slb/describerules.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeRulesWithCallback(request *DescribeRulesRequest, callback func(response *DescribeRulesResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DescribeRulesResponse + var err error + defer close(result) + response, err = client.DescribeRules(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DescribeRulesRequest is the request struct for api DescribeRules +type DescribeRulesRequest struct { + *requests.RpcRequest + AccessKeyId string `position:"Query" name:"access_key_id"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ListenerPort requests.Integer `position:"Query" name:"ListenerPort"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + ListenerProtocol string `position:"Query" name:"ListenerProtocol"` + Tags string `position:"Query" name:"Tags"` + LoadBalancerId string `position:"Query" name:"LoadBalancerId"` +} + +// DescribeRulesResponse is the response struct for api DescribeRules +type DescribeRulesResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + Rules RulesInDescribeRules `json:"Rules" xml:"Rules"` +} + +// CreateDescribeRulesRequest creates a request to invoke DescribeRules API +func CreateDescribeRulesRequest() (request *DescribeRulesRequest) { + request = &DescribeRulesRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Slb", "2014-05-15", "DescribeRules", "slb", "openAPI") + return +} + +// CreateDescribeRulesResponse creates a response to parse from DescribeRules response +func CreateDescribeRulesResponse() (response *DescribeRulesResponse) { + response = &DescribeRulesResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/describe_server_certificates.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/describe_server_certificates.go new file mode 100644 index 0000000000..4d97861937 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/describe_server_certificates.go @@ -0,0 +1,118 @@ +package slb + +//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" +) + +// DescribeServerCertificates invokes the slb.DescribeServerCertificates API synchronously +// api document: https://help.aliyun.com/api/slb/describeservercertificates.html +func (client *Client) DescribeServerCertificates(request *DescribeServerCertificatesRequest) (response *DescribeServerCertificatesResponse, err error) { + response = CreateDescribeServerCertificatesResponse() + err = client.DoAction(request, response) + return +} + +// DescribeServerCertificatesWithChan invokes the slb.DescribeServerCertificates API asynchronously +// api document: https://help.aliyun.com/api/slb/describeservercertificates.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeServerCertificatesWithChan(request *DescribeServerCertificatesRequest) (<-chan *DescribeServerCertificatesResponse, <-chan error) { + responseChan := make(chan *DescribeServerCertificatesResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DescribeServerCertificates(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DescribeServerCertificatesWithCallback invokes the slb.DescribeServerCertificates API asynchronously +// api document: https://help.aliyun.com/api/slb/describeservercertificates.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeServerCertificatesWithCallback(request *DescribeServerCertificatesRequest, callback func(response *DescribeServerCertificatesResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DescribeServerCertificatesResponse + var err error + defer close(result) + response, err = client.DescribeServerCertificates(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DescribeServerCertificatesRequest is the request struct for api DescribeServerCertificates +type DescribeServerCertificatesRequest struct { + *requests.RpcRequest + AccessKeyId string `position:"Query" name:"access_key_id"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceGroupId string `position:"Query" name:"ResourceGroupId"` + Tag *[]DescribeServerCertificatesTag `position:"Query" name:"Tag" type:"Repeated"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + ServerCertificateId string `position:"Query" name:"ServerCertificateId"` + Tags string `position:"Query" name:"Tags"` +} + +// DescribeServerCertificatesTag is a repeated param struct in DescribeServerCertificatesRequest +type DescribeServerCertificatesTag struct { + Value string `name:"Value"` + Key string `name:"Key"` +} + +// DescribeServerCertificatesResponse is the response struct for api DescribeServerCertificates +type DescribeServerCertificatesResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + ServerCertificates ServerCertificates `json:"ServerCertificates" xml:"ServerCertificates"` +} + +// CreateDescribeServerCertificatesRequest creates a request to invoke DescribeServerCertificates API +func CreateDescribeServerCertificatesRequest() (request *DescribeServerCertificatesRequest) { + request = &DescribeServerCertificatesRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Slb", "2014-05-15", "DescribeServerCertificates", "slb", "openAPI") + return +} + +// CreateDescribeServerCertificatesResponse creates a response to parse from DescribeServerCertificates response +func CreateDescribeServerCertificatesResponse() (response *DescribeServerCertificatesResponse) { + response = &DescribeServerCertificatesResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/describe_tags.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/describe_tags.go new file mode 100644 index 0000000000..ef58ab2531 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/describe_tags.go @@ -0,0 +1,116 @@ +package slb + +//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" +) + +// DescribeTags invokes the slb.DescribeTags API synchronously +// api document: https://help.aliyun.com/api/slb/describetags.html +func (client *Client) DescribeTags(request *DescribeTagsRequest) (response *DescribeTagsResponse, err error) { + response = CreateDescribeTagsResponse() + err = client.DoAction(request, response) + return +} + +// DescribeTagsWithChan invokes the slb.DescribeTags API asynchronously +// api document: https://help.aliyun.com/api/slb/describetags.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeTagsWithChan(request *DescribeTagsRequest) (<-chan *DescribeTagsResponse, <-chan error) { + responseChan := make(chan *DescribeTagsResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DescribeTags(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DescribeTagsWithCallback invokes the slb.DescribeTags API asynchronously +// api document: https://help.aliyun.com/api/slb/describetags.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeTagsWithCallback(request *DescribeTagsRequest, callback func(response *DescribeTagsResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DescribeTagsResponse + var err error + defer close(result) + response, err = client.DescribeTags(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DescribeTagsRequest is the request struct for api DescribeTags +type DescribeTagsRequest struct { + *requests.RpcRequest + AccessKeyId string `position:"Query" name:"access_key_id"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + PageNumber requests.Integer `position:"Query" name:"PageNumber"` + PageSize requests.Integer `position:"Query" name:"PageSize"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + DistinctKey requests.Boolean `position:"Query" name:"DistinctKey"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + Tags string `position:"Query" name:"Tags"` + LoadBalancerId string `position:"Query" name:"LoadBalancerId"` +} + +// DescribeTagsResponse is the response struct for api DescribeTags +type DescribeTagsResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + PageSize int `json:"PageSize" xml:"PageSize"` + PageNumber int `json:"PageNumber" xml:"PageNumber"` + TotalCount int `json:"TotalCount" xml:"TotalCount"` + TagSets TagSets `json:"TagSets" xml:"TagSets"` +} + +// CreateDescribeTagsRequest creates a request to invoke DescribeTags API +func CreateDescribeTagsRequest() (request *DescribeTagsRequest) { + request = &DescribeTagsRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Slb", "2014-05-15", "DescribeTags", "slb", "openAPI") + return +} + +// CreateDescribeTagsResponse creates a response to parse from DescribeTags response +func CreateDescribeTagsResponse() (response *DescribeTagsResponse) { + response = &DescribeTagsResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/describe_v_server_group_attribute.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/describe_v_server_group_attribute.go new file mode 100644 index 0000000000..389b996df5 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/describe_v_server_group_attribute.go @@ -0,0 +1,113 @@ +package slb + +//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" +) + +// DescribeVServerGroupAttribute invokes the slb.DescribeVServerGroupAttribute API synchronously +// api document: https://help.aliyun.com/api/slb/describevservergroupattribute.html +func (client *Client) DescribeVServerGroupAttribute(request *DescribeVServerGroupAttributeRequest) (response *DescribeVServerGroupAttributeResponse, err error) { + response = CreateDescribeVServerGroupAttributeResponse() + err = client.DoAction(request, response) + return +} + +// DescribeVServerGroupAttributeWithChan invokes the slb.DescribeVServerGroupAttribute API asynchronously +// api document: https://help.aliyun.com/api/slb/describevservergroupattribute.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeVServerGroupAttributeWithChan(request *DescribeVServerGroupAttributeRequest) (<-chan *DescribeVServerGroupAttributeResponse, <-chan error) { + responseChan := make(chan *DescribeVServerGroupAttributeResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DescribeVServerGroupAttribute(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DescribeVServerGroupAttributeWithCallback invokes the slb.DescribeVServerGroupAttribute API asynchronously +// api document: https://help.aliyun.com/api/slb/describevservergroupattribute.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeVServerGroupAttributeWithCallback(request *DescribeVServerGroupAttributeRequest, callback func(response *DescribeVServerGroupAttributeResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DescribeVServerGroupAttributeResponse + var err error + defer close(result) + response, err = client.DescribeVServerGroupAttribute(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DescribeVServerGroupAttributeRequest is the request struct for api DescribeVServerGroupAttribute +type DescribeVServerGroupAttributeRequest struct { + *requests.RpcRequest + AccessKeyId string `position:"Query" name:"access_key_id"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + VServerGroupId string `position:"Query" name:"VServerGroupId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + Tags string `position:"Query" name:"Tags"` +} + +// DescribeVServerGroupAttributeResponse is the response struct for api DescribeVServerGroupAttribute +type DescribeVServerGroupAttributeResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + VServerGroupId string `json:"VServerGroupId" xml:"VServerGroupId"` + VServerGroupName string `json:"VServerGroupName" xml:"VServerGroupName"` + LoadBalancerId string `json:"LoadBalancerId" xml:"LoadBalancerId"` + BackendServers BackendServersInDescribeVServerGroupAttribute `json:"BackendServers" xml:"BackendServers"` +} + +// CreateDescribeVServerGroupAttributeRequest creates a request to invoke DescribeVServerGroupAttribute API +func CreateDescribeVServerGroupAttributeRequest() (request *DescribeVServerGroupAttributeRequest) { + request = &DescribeVServerGroupAttributeRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Slb", "2014-05-15", "DescribeVServerGroupAttribute", "slb", "openAPI") + return +} + +// CreateDescribeVServerGroupAttributeResponse creates a response to parse from DescribeVServerGroupAttribute response +func CreateDescribeVServerGroupAttributeResponse() (response *DescribeVServerGroupAttributeResponse) { + response = &DescribeVServerGroupAttributeResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/describe_v_server_groups.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/describe_v_server_groups.go new file mode 100644 index 0000000000..9575cd8d64 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/describe_v_server_groups.go @@ -0,0 +1,112 @@ +package slb + +//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" +) + +// DescribeVServerGroups invokes the slb.DescribeVServerGroups API synchronously +// api document: https://help.aliyun.com/api/slb/describevservergroups.html +func (client *Client) DescribeVServerGroups(request *DescribeVServerGroupsRequest) (response *DescribeVServerGroupsResponse, err error) { + response = CreateDescribeVServerGroupsResponse() + err = client.DoAction(request, response) + return +} + +// DescribeVServerGroupsWithChan invokes the slb.DescribeVServerGroups API asynchronously +// api document: https://help.aliyun.com/api/slb/describevservergroups.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeVServerGroupsWithChan(request *DescribeVServerGroupsRequest) (<-chan *DescribeVServerGroupsResponse, <-chan error) { + responseChan := make(chan *DescribeVServerGroupsResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DescribeVServerGroups(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DescribeVServerGroupsWithCallback invokes the slb.DescribeVServerGroups API asynchronously +// api document: https://help.aliyun.com/api/slb/describevservergroups.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeVServerGroupsWithCallback(request *DescribeVServerGroupsRequest, callback func(response *DescribeVServerGroupsResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DescribeVServerGroupsResponse + var err error + defer close(result) + response, err = client.DescribeVServerGroups(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DescribeVServerGroupsRequest is the request struct for api DescribeVServerGroups +type DescribeVServerGroupsRequest struct { + *requests.RpcRequest + AccessKeyId string `position:"Query" name:"access_key_id"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + IncludeListener requests.Boolean `position:"Query" name:"IncludeListener"` + IncludeRule requests.Boolean `position:"Query" name:"IncludeRule"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + Tags string `position:"Query" name:"Tags"` + LoadBalancerId string `position:"Query" name:"LoadBalancerId"` +} + +// DescribeVServerGroupsResponse is the response struct for api DescribeVServerGroups +type DescribeVServerGroupsResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + VServerGroups VServerGroups `json:"VServerGroups" xml:"VServerGroups"` +} + +// CreateDescribeVServerGroupsRequest creates a request to invoke DescribeVServerGroups API +func CreateDescribeVServerGroupsRequest() (request *DescribeVServerGroupsRequest) { + request = &DescribeVServerGroupsRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Slb", "2014-05-15", "DescribeVServerGroups", "slb", "openAPI") + return +} + +// CreateDescribeVServerGroupsResponse creates a response to parse from DescribeVServerGroups response +func CreateDescribeVServerGroupsResponse() (response *DescribeVServerGroupsResponse) { + response = &DescribeVServerGroupsResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/describe_zones.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/describe_zones.go new file mode 100644 index 0000000000..1efb901010 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/describe_zones.go @@ -0,0 +1,109 @@ +package slb + +//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 slb.DescribeZones API synchronously +// api document: https://help.aliyun.com/api/slb/describezones.html +func (client *Client) DescribeZones(request *DescribeZonesRequest) (response *DescribeZonesResponse, err error) { + response = CreateDescribeZonesResponse() + err = client.DoAction(request, response) + return +} + +// DescribeZonesWithChan invokes the slb.DescribeZones API asynchronously +// api document: https://help.aliyun.com/api/slb/describezones.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +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 slb.DescribeZones API asynchronously +// api document: https://help.aliyun.com/api/slb/describezones.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +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 + AccessKeyId string `position:"Query" name:"access_key_id"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + Tags string `position:"Query" name:"Tags"` +} + +// DescribeZonesResponse is the response struct for api DescribeZones +type DescribeZonesResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + Zones Zones `json:"Zones" xml:"Zones"` +} + +// CreateDescribeZonesRequest creates a request to invoke DescribeZones API +func CreateDescribeZonesRequest() (request *DescribeZonesRequest) { + request = &DescribeZonesRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Slb", "2014-05-15", "DescribeZones", "slb", "openAPI") + return +} + +// CreateDescribeZonesResponse creates a response to parse from DescribeZones response +func CreateDescribeZonesResponse() (response *DescribeZonesResponse) { + response = &DescribeZonesResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/endpoint.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/endpoint.go new file mode 100644 index 0000000000..f016c40edd --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/endpoint.go @@ -0,0 +1,63 @@ +package slb + +// EndpointMap Endpoint Data +var EndpointMap map[string]string + +// EndpointType regional or central +var EndpointType = "regional" + +// GetEndpointMap Get Endpoint Data Map +func GetEndpointMap() map[string]string { + if EndpointMap == nil { + EndpointMap = map[string]string{ + "cn-shanghai-internal-test-1": "slb.aliyuncs.com", + "cn-beijing-gov-1": "slb.aliyuncs.com", + "cn-shenzhen-su18-b01": "slb.aliyuncs.com", + "cn-beijing": "slb.aliyuncs.com", + "cn-shanghai-inner": "slb.aliyuncs.com", + "cn-shenzhen-st4-d01": "slb.aliyuncs.com", + "cn-haidian-cm12-c01": "slb.aliyuncs.com", + "cn-hangzhou-internal-prod-1": "slb.aliyuncs.com", + "cn-north-2-gov-1": "slb.aliyuncs.com", + "cn-yushanfang": "slb.aliyuncs.com", + "cn-qingdao": "slb.aliyuncs.com", + "cn-hongkong-finance-pop": "slb.aliyuncs.com", + "cn-shanghai": "slb.aliyuncs.com", + "cn-shanghai-finance-1": "slb.aliyuncs.com", + "cn-hongkong": "slb.aliyuncs.com", + "cn-beijing-finance-pop": "slb.aliyuncs.com", + "cn-wuhan": "slb.aliyuncs.com", + "us-west-1": "slb.aliyuncs.com", + "cn-shenzhen": "slb.aliyuncs.com", + "cn-zhengzhou-nebula-1": "slb.aliyuncs.com", + "rus-west-1-pop": "slb.ap-northeast-1.aliyuncs.com", + "cn-shanghai-et15-b01": "slb.aliyuncs.com", + "cn-hangzhou-bj-b01": "slb.aliyuncs.com", + "cn-hangzhou-internal-test-1": "slb.aliyuncs.com", + "eu-west-1-oxs": "slb.ap-northeast-1.aliyuncs.com", + "cn-zhangbei-na61-b01": "slb.aliyuncs.com", + "cn-beijing-finance-1": "slb.aliyuncs.com", + "cn-hangzhou-internal-test-3": "slb.aliyuncs.com", + "cn-shenzhen-finance-1": "slb.aliyuncs.com", + "cn-hangzhou-internal-test-2": "slb.aliyuncs.com", + "cn-hangzhou-test-306": "slb.aliyuncs.com", + "cn-shanghai-et2-b01": "slb.aliyuncs.com", + "cn-hangzhou-finance": "slb.aliyuncs.com", + "ap-southeast-1": "slb.aliyuncs.com", + "cn-beijing-nu16-b01": "slb.aliyuncs.com", + "cn-edge-1": "slb.aliyuncs.com", + "us-east-1": "slb.aliyuncs.com", + "cn-fujian": "slb.aliyuncs.com", + "ap-northeast-2-pop": "slb.ap-northeast-1.aliyuncs.com", + "cn-shenzhen-inner": "slb.aliyuncs.com", + "cn-zhangjiakou-na62-a01": "slb.aliyuncs.com", + "cn-hangzhou": "slb.aliyuncs.com", + } + } + return EndpointMap +} + +// GetEndpointType Get Endpoint Type Value +func GetEndpointType() string { + return EndpointType +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/list_tag_resources.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/list_tag_resources.go new file mode 100644 index 0000000000..ca34535950 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/list_tag_resources.go @@ -0,0 +1,119 @@ +package slb + +//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 slb.ListTagResources API synchronously +// api document: https://help.aliyun.com/api/slb/listtagresources.html +func (client *Client) ListTagResources(request *ListTagResourcesRequest) (response *ListTagResourcesResponse, err error) { + response = CreateListTagResourcesResponse() + err = client.DoAction(request, response) + return +} + +// ListTagResourcesWithChan invokes the slb.ListTagResources API asynchronously +// api document: https://help.aliyun.com/api/slb/listtagresources.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +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 slb.ListTagResources API asynchronously +// api document: https://help.aliyun.com/api/slb/listtagresources.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +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 + AccessKeyId string `position:"Query" name:"access_key_id"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + NextToken string `position:"Query" name:"NextToken"` + Tag *[]ListTagResourcesTag `position:"Query" name:"Tag" type:"Repeated"` + ResourceId *[]string `position:"Query" name:"ResourceId" type:"Repeated"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + ResourceType string `position:"Query" name:"ResourceType"` +} + +// ListTagResourcesTag is a repeated param struct in ListTagResourcesRequest +type ListTagResourcesTag struct { + Value string `name:"Value"` + Key string `name:"Key"` +} + +// ListTagResourcesResponse is the response struct for api ListTagResources +type ListTagResourcesResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + NextToken string `json:"NextToken" xml:"NextToken"` + TagResources TagResources `json:"TagResources" xml:"TagResources"` +} + +// CreateListTagResourcesRequest creates a request to invoke ListTagResources API +func CreateListTagResourcesRequest() (request *ListTagResourcesRequest) { + request = &ListTagResourcesRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Slb", "2014-05-15", "ListTagResources", "slb", "openAPI") + return +} + +// CreateListTagResourcesResponse creates a response to parse from ListTagResources response +func CreateListTagResourcesResponse() (response *ListTagResourcesResponse) { + response = &ListTagResourcesResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/modify_load_balancer_instance_spec.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/modify_load_balancer_instance_spec.go new file mode 100644 index 0000000000..0b2e14d441 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/modify_load_balancer_instance_spec.go @@ -0,0 +1,112 @@ +package slb + +//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" +) + +// ModifyLoadBalancerInstanceSpec invokes the slb.ModifyLoadBalancerInstanceSpec API synchronously +// api document: https://help.aliyun.com/api/slb/modifyloadbalancerinstancespec.html +func (client *Client) ModifyLoadBalancerInstanceSpec(request *ModifyLoadBalancerInstanceSpecRequest) (response *ModifyLoadBalancerInstanceSpecResponse, err error) { + response = CreateModifyLoadBalancerInstanceSpecResponse() + err = client.DoAction(request, response) + return +} + +// ModifyLoadBalancerInstanceSpecWithChan invokes the slb.ModifyLoadBalancerInstanceSpec API asynchronously +// api document: https://help.aliyun.com/api/slb/modifyloadbalancerinstancespec.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifyLoadBalancerInstanceSpecWithChan(request *ModifyLoadBalancerInstanceSpecRequest) (<-chan *ModifyLoadBalancerInstanceSpecResponse, <-chan error) { + responseChan := make(chan *ModifyLoadBalancerInstanceSpecResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.ModifyLoadBalancerInstanceSpec(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// ModifyLoadBalancerInstanceSpecWithCallback invokes the slb.ModifyLoadBalancerInstanceSpec API asynchronously +// api document: https://help.aliyun.com/api/slb/modifyloadbalancerinstancespec.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifyLoadBalancerInstanceSpecWithCallback(request *ModifyLoadBalancerInstanceSpecRequest, callback func(response *ModifyLoadBalancerInstanceSpecResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *ModifyLoadBalancerInstanceSpecResponse + var err error + defer close(result) + response, err = client.ModifyLoadBalancerInstanceSpec(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// ModifyLoadBalancerInstanceSpecRequest is the request struct for api ModifyLoadBalancerInstanceSpec +type ModifyLoadBalancerInstanceSpecRequest struct { + *requests.RpcRequest + AccessKeyId string `position:"Query" name:"access_key_id"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + LoadBalancerSpec string `position:"Query" name:"LoadBalancerSpec"` + AutoPay requests.Boolean `position:"Query" name:"AutoPay"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + Tags string `position:"Query" name:"Tags"` + LoadBalancerId string `position:"Query" name:"LoadBalancerId"` +} + +// ModifyLoadBalancerInstanceSpecResponse is the response struct for api ModifyLoadBalancerInstanceSpec +type ModifyLoadBalancerInstanceSpecResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + OrderId int64 `json:"OrderId" xml:"OrderId"` +} + +// CreateModifyLoadBalancerInstanceSpecRequest creates a request to invoke ModifyLoadBalancerInstanceSpec API +func CreateModifyLoadBalancerInstanceSpecRequest() (request *ModifyLoadBalancerInstanceSpecRequest) { + request = &ModifyLoadBalancerInstanceSpecRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Slb", "2014-05-15", "ModifyLoadBalancerInstanceSpec", "slb", "openAPI") + return +} + +// CreateModifyLoadBalancerInstanceSpecResponse creates a response to parse from ModifyLoadBalancerInstanceSpec response +func CreateModifyLoadBalancerInstanceSpecResponse() (response *ModifyLoadBalancerInstanceSpecResponse) { + response = &ModifyLoadBalancerInstanceSpecResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/modify_load_balancer_internet_spec.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/modify_load_balancer_internet_spec.go new file mode 100644 index 0000000000..f246ad7431 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/modify_load_balancer_internet_spec.go @@ -0,0 +1,114 @@ +package slb + +//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" +) + +// ModifyLoadBalancerInternetSpec invokes the slb.ModifyLoadBalancerInternetSpec API synchronously +// api document: https://help.aliyun.com/api/slb/modifyloadbalancerinternetspec.html +func (client *Client) ModifyLoadBalancerInternetSpec(request *ModifyLoadBalancerInternetSpecRequest) (response *ModifyLoadBalancerInternetSpecResponse, err error) { + response = CreateModifyLoadBalancerInternetSpecResponse() + err = client.DoAction(request, response) + return +} + +// ModifyLoadBalancerInternetSpecWithChan invokes the slb.ModifyLoadBalancerInternetSpec API asynchronously +// api document: https://help.aliyun.com/api/slb/modifyloadbalancerinternetspec.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifyLoadBalancerInternetSpecWithChan(request *ModifyLoadBalancerInternetSpecRequest) (<-chan *ModifyLoadBalancerInternetSpecResponse, <-chan error) { + responseChan := make(chan *ModifyLoadBalancerInternetSpecResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.ModifyLoadBalancerInternetSpec(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// ModifyLoadBalancerInternetSpecWithCallback invokes the slb.ModifyLoadBalancerInternetSpec API asynchronously +// api document: https://help.aliyun.com/api/slb/modifyloadbalancerinternetspec.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifyLoadBalancerInternetSpecWithCallback(request *ModifyLoadBalancerInternetSpecRequest, callback func(response *ModifyLoadBalancerInternetSpecResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *ModifyLoadBalancerInternetSpecResponse + var err error + defer close(result) + response, err = client.ModifyLoadBalancerInternetSpec(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// ModifyLoadBalancerInternetSpecRequest is the request struct for api ModifyLoadBalancerInternetSpec +type ModifyLoadBalancerInternetSpecRequest struct { + *requests.RpcRequest + AccessKeyId string `position:"Query" name:"access_key_id"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + AutoPay requests.Boolean `position:"Query" name:"AutoPay"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + Bandwidth requests.Integer `position:"Query" name:"Bandwidth"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + Tags string `position:"Query" name:"Tags"` + LoadBalancerId string `position:"Query" name:"LoadBalancerId"` + InternetChargeType string `position:"Query" name:"InternetChargeType"` + Ratio requests.Integer `position:"Query" name:"Ratio"` +} + +// ModifyLoadBalancerInternetSpecResponse is the response struct for api ModifyLoadBalancerInternetSpec +type ModifyLoadBalancerInternetSpecResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + OrderId int64 `json:"OrderId" xml:"OrderId"` +} + +// CreateModifyLoadBalancerInternetSpecRequest creates a request to invoke ModifyLoadBalancerInternetSpec API +func CreateModifyLoadBalancerInternetSpecRequest() (request *ModifyLoadBalancerInternetSpecRequest) { + request = &ModifyLoadBalancerInternetSpecRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Slb", "2014-05-15", "ModifyLoadBalancerInternetSpec", "slb", "openAPI") + return +} + +// CreateModifyLoadBalancerInternetSpecResponse creates a response to parse from ModifyLoadBalancerInternetSpec response +func CreateModifyLoadBalancerInternetSpecResponse() (response *ModifyLoadBalancerInternetSpecResponse) { + response = &ModifyLoadBalancerInternetSpecResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/modify_load_balancer_pay_type.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/modify_load_balancer_pay_type.go new file mode 100644 index 0000000000..8995550d71 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/modify_load_balancer_pay_type.go @@ -0,0 +1,114 @@ +package slb + +//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" +) + +// ModifyLoadBalancerPayType invokes the slb.ModifyLoadBalancerPayType API synchronously +// api document: https://help.aliyun.com/api/slb/modifyloadbalancerpaytype.html +func (client *Client) ModifyLoadBalancerPayType(request *ModifyLoadBalancerPayTypeRequest) (response *ModifyLoadBalancerPayTypeResponse, err error) { + response = CreateModifyLoadBalancerPayTypeResponse() + err = client.DoAction(request, response) + return +} + +// ModifyLoadBalancerPayTypeWithChan invokes the slb.ModifyLoadBalancerPayType API asynchronously +// api document: https://help.aliyun.com/api/slb/modifyloadbalancerpaytype.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifyLoadBalancerPayTypeWithChan(request *ModifyLoadBalancerPayTypeRequest) (<-chan *ModifyLoadBalancerPayTypeResponse, <-chan error) { + responseChan := make(chan *ModifyLoadBalancerPayTypeResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.ModifyLoadBalancerPayType(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// ModifyLoadBalancerPayTypeWithCallback invokes the slb.ModifyLoadBalancerPayType API asynchronously +// api document: https://help.aliyun.com/api/slb/modifyloadbalancerpaytype.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifyLoadBalancerPayTypeWithCallback(request *ModifyLoadBalancerPayTypeRequest, callback func(response *ModifyLoadBalancerPayTypeResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *ModifyLoadBalancerPayTypeResponse + var err error + defer close(result) + response, err = client.ModifyLoadBalancerPayType(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// ModifyLoadBalancerPayTypeRequest is the request struct for api ModifyLoadBalancerPayType +type ModifyLoadBalancerPayTypeRequest struct { + *requests.RpcRequest + AccessKeyId string `position:"Query" name:"access_key_id"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + Duration requests.Integer `position:"Query" name:"Duration"` + AutoPay requests.Boolean `position:"Query" name:"AutoPay"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + Tags string `position:"Query" name:"Tags"` + LoadBalancerId string `position:"Query" name:"LoadBalancerId"` + PayType string `position:"Query" name:"PayType"` + PricingCycle string `position:"Query" name:"PricingCycle"` +} + +// ModifyLoadBalancerPayTypeResponse is the response struct for api ModifyLoadBalancerPayType +type ModifyLoadBalancerPayTypeResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + OrderId int64 `json:"OrderId" xml:"OrderId"` +} + +// CreateModifyLoadBalancerPayTypeRequest creates a request to invoke ModifyLoadBalancerPayType API +func CreateModifyLoadBalancerPayTypeRequest() (request *ModifyLoadBalancerPayTypeRequest) { + request = &ModifyLoadBalancerPayTypeRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Slb", "2014-05-15", "ModifyLoadBalancerPayType", "slb", "openAPI") + return +} + +// CreateModifyLoadBalancerPayTypeResponse creates a response to parse from ModifyLoadBalancerPayType response +func CreateModifyLoadBalancerPayTypeResponse() (response *ModifyLoadBalancerPayTypeResponse) { + response = &ModifyLoadBalancerPayTypeResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/modify_v_server_group_backend_servers.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/modify_v_server_group_backend_servers.go new file mode 100644 index 0000000000..ec65867798 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/modify_v_server_group_backend_servers.go @@ -0,0 +1,113 @@ +package slb + +//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" +) + +// ModifyVServerGroupBackendServers invokes the slb.ModifyVServerGroupBackendServers API synchronously +// api document: https://help.aliyun.com/api/slb/modifyvservergroupbackendservers.html +func (client *Client) ModifyVServerGroupBackendServers(request *ModifyVServerGroupBackendServersRequest) (response *ModifyVServerGroupBackendServersResponse, err error) { + response = CreateModifyVServerGroupBackendServersResponse() + err = client.DoAction(request, response) + return +} + +// ModifyVServerGroupBackendServersWithChan invokes the slb.ModifyVServerGroupBackendServers API asynchronously +// api document: https://help.aliyun.com/api/slb/modifyvservergroupbackendservers.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifyVServerGroupBackendServersWithChan(request *ModifyVServerGroupBackendServersRequest) (<-chan *ModifyVServerGroupBackendServersResponse, <-chan error) { + responseChan := make(chan *ModifyVServerGroupBackendServersResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.ModifyVServerGroupBackendServers(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// ModifyVServerGroupBackendServersWithCallback invokes the slb.ModifyVServerGroupBackendServers API asynchronously +// api document: https://help.aliyun.com/api/slb/modifyvservergroupbackendservers.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifyVServerGroupBackendServersWithCallback(request *ModifyVServerGroupBackendServersRequest, callback func(response *ModifyVServerGroupBackendServersResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *ModifyVServerGroupBackendServersResponse + var err error + defer close(result) + response, err = client.ModifyVServerGroupBackendServers(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// ModifyVServerGroupBackendServersRequest is the request struct for api ModifyVServerGroupBackendServers +type ModifyVServerGroupBackendServersRequest struct { + *requests.RpcRequest + AccessKeyId string `position:"Query" name:"access_key_id"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + VServerGroupId string `position:"Query" name:"VServerGroupId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + NewBackendServers string `position:"Query" name:"NewBackendServers"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + Tags string `position:"Query" name:"Tags"` + OldBackendServers string `position:"Query" name:"OldBackendServers"` +} + +// ModifyVServerGroupBackendServersResponse is the response struct for api ModifyVServerGroupBackendServers +type ModifyVServerGroupBackendServersResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + VServerGroupId string `json:"VServerGroupId" xml:"VServerGroupId"` + BackendServers BackendServersInModifyVServerGroupBackendServers `json:"BackendServers" xml:"BackendServers"` +} + +// CreateModifyVServerGroupBackendServersRequest creates a request to invoke ModifyVServerGroupBackendServers API +func CreateModifyVServerGroupBackendServersRequest() (request *ModifyVServerGroupBackendServersRequest) { + request = &ModifyVServerGroupBackendServersRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Slb", "2014-05-15", "ModifyVServerGroupBackendServers", "slb", "openAPI") + return +} + +// CreateModifyVServerGroupBackendServersResponse creates a response to parse from ModifyVServerGroupBackendServers response +func CreateModifyVServerGroupBackendServersResponse() (response *ModifyVServerGroupBackendServersResponse) { + response = &ModifyVServerGroupBackendServersResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/remove_access_control_list_entry.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/remove_access_control_list_entry.go new file mode 100644 index 0000000000..2331d97c7c --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/remove_access_control_list_entry.go @@ -0,0 +1,110 @@ +package slb + +//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" +) + +// RemoveAccessControlListEntry invokes the slb.RemoveAccessControlListEntry API synchronously +// api document: https://help.aliyun.com/api/slb/removeaccesscontrollistentry.html +func (client *Client) RemoveAccessControlListEntry(request *RemoveAccessControlListEntryRequest) (response *RemoveAccessControlListEntryResponse, err error) { + response = CreateRemoveAccessControlListEntryResponse() + err = client.DoAction(request, response) + return +} + +// RemoveAccessControlListEntryWithChan invokes the slb.RemoveAccessControlListEntry API asynchronously +// api document: https://help.aliyun.com/api/slb/removeaccesscontrollistentry.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) RemoveAccessControlListEntryWithChan(request *RemoveAccessControlListEntryRequest) (<-chan *RemoveAccessControlListEntryResponse, <-chan error) { + responseChan := make(chan *RemoveAccessControlListEntryResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.RemoveAccessControlListEntry(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// RemoveAccessControlListEntryWithCallback invokes the slb.RemoveAccessControlListEntry API asynchronously +// api document: https://help.aliyun.com/api/slb/removeaccesscontrollistentry.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) RemoveAccessControlListEntryWithCallback(request *RemoveAccessControlListEntryRequest, callback func(response *RemoveAccessControlListEntryResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *RemoveAccessControlListEntryResponse + var err error + defer close(result) + response, err = client.RemoveAccessControlListEntry(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// RemoveAccessControlListEntryRequest is the request struct for api RemoveAccessControlListEntry +type RemoveAccessControlListEntryRequest struct { + *requests.RpcRequest + AccessKeyId string `position:"Query" name:"access_key_id"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + AclEntrys string `position:"Query" name:"AclEntrys"` + AclId string `position:"Query" name:"AclId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + Tags string `position:"Query" name:"Tags"` +} + +// RemoveAccessControlListEntryResponse is the response struct for api RemoveAccessControlListEntry +type RemoveAccessControlListEntryResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateRemoveAccessControlListEntryRequest creates a request to invoke RemoveAccessControlListEntry API +func CreateRemoveAccessControlListEntryRequest() (request *RemoveAccessControlListEntryRequest) { + request = &RemoveAccessControlListEntryRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Slb", "2014-05-15", "RemoveAccessControlListEntry", "slb", "openAPI") + return +} + +// CreateRemoveAccessControlListEntryResponse creates a response to parse from RemoveAccessControlListEntry response +func CreateRemoveAccessControlListEntryResponse() (response *RemoveAccessControlListEntryResponse) { + response = &RemoveAccessControlListEntryResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/remove_backend_servers.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/remove_backend_servers.go new file mode 100644 index 0000000000..3de521138e --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/remove_backend_servers.go @@ -0,0 +1,112 @@ +package slb + +//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" +) + +// RemoveBackendServers invokes the slb.RemoveBackendServers API synchronously +// api document: https://help.aliyun.com/api/slb/removebackendservers.html +func (client *Client) RemoveBackendServers(request *RemoveBackendServersRequest) (response *RemoveBackendServersResponse, err error) { + response = CreateRemoveBackendServersResponse() + err = client.DoAction(request, response) + return +} + +// RemoveBackendServersWithChan invokes the slb.RemoveBackendServers API asynchronously +// api document: https://help.aliyun.com/api/slb/removebackendservers.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) RemoveBackendServersWithChan(request *RemoveBackendServersRequest) (<-chan *RemoveBackendServersResponse, <-chan error) { + responseChan := make(chan *RemoveBackendServersResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.RemoveBackendServers(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// RemoveBackendServersWithCallback invokes the slb.RemoveBackendServers API asynchronously +// api document: https://help.aliyun.com/api/slb/removebackendservers.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) RemoveBackendServersWithCallback(request *RemoveBackendServersRequest, callback func(response *RemoveBackendServersResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *RemoveBackendServersResponse + var err error + defer close(result) + response, err = client.RemoveBackendServers(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// RemoveBackendServersRequest is the request struct for api RemoveBackendServers +type RemoveBackendServersRequest struct { + *requests.RpcRequest + AccessKeyId string `position:"Query" name:"access_key_id"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + BackendServers string `position:"Query" name:"BackendServers"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + Tags string `position:"Query" name:"Tags"` + LoadBalancerId string `position:"Query" name:"LoadBalancerId"` +} + +// RemoveBackendServersResponse is the response struct for api RemoveBackendServers +type RemoveBackendServersResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + LoadBalancerId string `json:"LoadBalancerId" xml:"LoadBalancerId"` + BackendServers BackendServersInRemoveBackendServers `json:"BackendServers" xml:"BackendServers"` +} + +// CreateRemoveBackendServersRequest creates a request to invoke RemoveBackendServers API +func CreateRemoveBackendServersRequest() (request *RemoveBackendServersRequest) { + request = &RemoveBackendServersRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Slb", "2014-05-15", "RemoveBackendServers", "slb", "openAPI") + return +} + +// CreateRemoveBackendServersResponse creates a response to parse from RemoveBackendServers response +func CreateRemoveBackendServersResponse() (response *RemoveBackendServersResponse) { + response = &RemoveBackendServersResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/remove_listener_white_list_item.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/remove_listener_white_list_item.go new file mode 100644 index 0000000000..d6709705cc --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/remove_listener_white_list_item.go @@ -0,0 +1,112 @@ +package slb + +//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" +) + +// RemoveListenerWhiteListItem invokes the slb.RemoveListenerWhiteListItem API synchronously +// api document: https://help.aliyun.com/api/slb/removelistenerwhitelistitem.html +func (client *Client) RemoveListenerWhiteListItem(request *RemoveListenerWhiteListItemRequest) (response *RemoveListenerWhiteListItemResponse, err error) { + response = CreateRemoveListenerWhiteListItemResponse() + err = client.DoAction(request, response) + return +} + +// RemoveListenerWhiteListItemWithChan invokes the slb.RemoveListenerWhiteListItem API asynchronously +// api document: https://help.aliyun.com/api/slb/removelistenerwhitelistitem.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) RemoveListenerWhiteListItemWithChan(request *RemoveListenerWhiteListItemRequest) (<-chan *RemoveListenerWhiteListItemResponse, <-chan error) { + responseChan := make(chan *RemoveListenerWhiteListItemResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.RemoveListenerWhiteListItem(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// RemoveListenerWhiteListItemWithCallback invokes the slb.RemoveListenerWhiteListItem API asynchronously +// api document: https://help.aliyun.com/api/slb/removelistenerwhitelistitem.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) RemoveListenerWhiteListItemWithCallback(request *RemoveListenerWhiteListItemRequest, callback func(response *RemoveListenerWhiteListItemResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *RemoveListenerWhiteListItemResponse + var err error + defer close(result) + response, err = client.RemoveListenerWhiteListItem(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// RemoveListenerWhiteListItemRequest is the request struct for api RemoveListenerWhiteListItem +type RemoveListenerWhiteListItemRequest struct { + *requests.RpcRequest + AccessKeyId string `position:"Query" name:"access_key_id"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + SourceItems string `position:"Query" name:"SourceItems"` + ListenerPort requests.Integer `position:"Query" name:"ListenerPort"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + ListenerProtocol string `position:"Query" name:"ListenerProtocol"` + Tags string `position:"Query" name:"Tags"` + LoadBalancerId string `position:"Query" name:"LoadBalancerId"` +} + +// RemoveListenerWhiteListItemResponse is the response struct for api RemoveListenerWhiteListItem +type RemoveListenerWhiteListItemResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateRemoveListenerWhiteListItemRequest creates a request to invoke RemoveListenerWhiteListItem API +func CreateRemoveListenerWhiteListItemRequest() (request *RemoveListenerWhiteListItemRequest) { + request = &RemoveListenerWhiteListItemRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Slb", "2014-05-15", "RemoveListenerWhiteListItem", "slb", "openAPI") + return +} + +// CreateRemoveListenerWhiteListItemResponse creates a response to parse from RemoveListenerWhiteListItem response +func CreateRemoveListenerWhiteListItemResponse() (response *RemoveListenerWhiteListItemResponse) { + response = &RemoveListenerWhiteListItemResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/remove_tags.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/remove_tags.go new file mode 100644 index 0000000000..70d2ee2232 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/remove_tags.go @@ -0,0 +1,109 @@ +package slb + +//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" +) + +// RemoveTags invokes the slb.RemoveTags API synchronously +// api document: https://help.aliyun.com/api/slb/removetags.html +func (client *Client) RemoveTags(request *RemoveTagsRequest) (response *RemoveTagsResponse, err error) { + response = CreateRemoveTagsResponse() + err = client.DoAction(request, response) + return +} + +// RemoveTagsWithChan invokes the slb.RemoveTags API asynchronously +// api document: https://help.aliyun.com/api/slb/removetags.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) RemoveTagsWithChan(request *RemoveTagsRequest) (<-chan *RemoveTagsResponse, <-chan error) { + responseChan := make(chan *RemoveTagsResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.RemoveTags(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// RemoveTagsWithCallback invokes the slb.RemoveTags API asynchronously +// api document: https://help.aliyun.com/api/slb/removetags.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) RemoveTagsWithCallback(request *RemoveTagsRequest, callback func(response *RemoveTagsResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *RemoveTagsResponse + var err error + defer close(result) + response, err = client.RemoveTags(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// RemoveTagsRequest is the request struct for api RemoveTags +type RemoveTagsRequest struct { + *requests.RpcRequest + AccessKeyId string `position:"Query" name:"access_key_id"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + Tags string `position:"Query" name:"Tags"` + LoadBalancerId string `position:"Query" name:"LoadBalancerId"` +} + +// RemoveTagsResponse is the response struct for api RemoveTags +type RemoveTagsResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateRemoveTagsRequest creates a request to invoke RemoveTags API +func CreateRemoveTagsRequest() (request *RemoveTagsRequest) { + request = &RemoveTagsRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Slb", "2014-05-15", "RemoveTags", "slb", "openAPI") + return +} + +// CreateRemoveTagsResponse creates a response to parse from RemoveTags response +func CreateRemoveTagsResponse() (response *RemoveTagsResponse) { + response = &RemoveTagsResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/remove_v_server_group_backend_servers.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/remove_v_server_group_backend_servers.go new file mode 100644 index 0000000000..2d2df51cee --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/remove_v_server_group_backend_servers.go @@ -0,0 +1,112 @@ +package slb + +//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" +) + +// RemoveVServerGroupBackendServers invokes the slb.RemoveVServerGroupBackendServers API synchronously +// api document: https://help.aliyun.com/api/slb/removevservergroupbackendservers.html +func (client *Client) RemoveVServerGroupBackendServers(request *RemoveVServerGroupBackendServersRequest) (response *RemoveVServerGroupBackendServersResponse, err error) { + response = CreateRemoveVServerGroupBackendServersResponse() + err = client.DoAction(request, response) + return +} + +// RemoveVServerGroupBackendServersWithChan invokes the slb.RemoveVServerGroupBackendServers API asynchronously +// api document: https://help.aliyun.com/api/slb/removevservergroupbackendservers.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) RemoveVServerGroupBackendServersWithChan(request *RemoveVServerGroupBackendServersRequest) (<-chan *RemoveVServerGroupBackendServersResponse, <-chan error) { + responseChan := make(chan *RemoveVServerGroupBackendServersResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.RemoveVServerGroupBackendServers(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// RemoveVServerGroupBackendServersWithCallback invokes the slb.RemoveVServerGroupBackendServers API asynchronously +// api document: https://help.aliyun.com/api/slb/removevservergroupbackendservers.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) RemoveVServerGroupBackendServersWithCallback(request *RemoveVServerGroupBackendServersRequest, callback func(response *RemoveVServerGroupBackendServersResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *RemoveVServerGroupBackendServersResponse + var err error + defer close(result) + response, err = client.RemoveVServerGroupBackendServers(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// RemoveVServerGroupBackendServersRequest is the request struct for api RemoveVServerGroupBackendServers +type RemoveVServerGroupBackendServersRequest struct { + *requests.RpcRequest + AccessKeyId string `position:"Query" name:"access_key_id"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + BackendServers string `position:"Query" name:"BackendServers"` + VServerGroupId string `position:"Query" name:"VServerGroupId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + Tags string `position:"Query" name:"Tags"` +} + +// RemoveVServerGroupBackendServersResponse is the response struct for api RemoveVServerGroupBackendServers +type RemoveVServerGroupBackendServersResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + VServerGroupId string `json:"VServerGroupId" xml:"VServerGroupId"` + BackendServers BackendServersInRemoveVServerGroupBackendServers `json:"BackendServers" xml:"BackendServers"` +} + +// CreateRemoveVServerGroupBackendServersRequest creates a request to invoke RemoveVServerGroupBackendServers API +func CreateRemoveVServerGroupBackendServersRequest() (request *RemoveVServerGroupBackendServersRequest) { + request = &RemoveVServerGroupBackendServersRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Slb", "2014-05-15", "RemoveVServerGroupBackendServers", "slb", "openAPI") + return +} + +// CreateRemoveVServerGroupBackendServersResponse creates a response to parse from RemoveVServerGroupBackendServers response +func CreateRemoveVServerGroupBackendServersResponse() (response *RemoveVServerGroupBackendServersResponse) { + response = &RemoveVServerGroupBackendServersResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/set_access_control_list_attribute.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/set_access_control_list_attribute.go new file mode 100644 index 0000000000..e179eee6e4 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/set_access_control_list_attribute.go @@ -0,0 +1,111 @@ +package slb + +//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" +) + +// SetAccessControlListAttribute invokes the slb.SetAccessControlListAttribute API synchronously +// api document: https://help.aliyun.com/api/slb/setaccesscontrollistattribute.html +func (client *Client) SetAccessControlListAttribute(request *SetAccessControlListAttributeRequest) (response *SetAccessControlListAttributeResponse, err error) { + response = CreateSetAccessControlListAttributeResponse() + err = client.DoAction(request, response) + return +} + +// SetAccessControlListAttributeWithChan invokes the slb.SetAccessControlListAttribute API asynchronously +// api document: https://help.aliyun.com/api/slb/setaccesscontrollistattribute.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) SetAccessControlListAttributeWithChan(request *SetAccessControlListAttributeRequest) (<-chan *SetAccessControlListAttributeResponse, <-chan error) { + responseChan := make(chan *SetAccessControlListAttributeResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.SetAccessControlListAttribute(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// SetAccessControlListAttributeWithCallback invokes the slb.SetAccessControlListAttribute API asynchronously +// api document: https://help.aliyun.com/api/slb/setaccesscontrollistattribute.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) SetAccessControlListAttributeWithCallback(request *SetAccessControlListAttributeRequest, callback func(response *SetAccessControlListAttributeResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *SetAccessControlListAttributeResponse + var err error + defer close(result) + response, err = client.SetAccessControlListAttribute(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// SetAccessControlListAttributeRequest is the request struct for api SetAccessControlListAttribute +type SetAccessControlListAttributeRequest struct { + *requests.RpcRequest + AccessKeyId string `position:"Query" name:"access_key_id"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + AclName string `position:"Query" name:"AclName"` + AclId string `position:"Query" name:"AclId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + Tags string `position:"Query" name:"Tags"` +} + +// SetAccessControlListAttributeResponse is the response struct for api SetAccessControlListAttribute +type SetAccessControlListAttributeResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + AclId string `json:"AclId" xml:"AclId"` +} + +// CreateSetAccessControlListAttributeRequest creates a request to invoke SetAccessControlListAttribute API +func CreateSetAccessControlListAttributeRequest() (request *SetAccessControlListAttributeRequest) { + request = &SetAccessControlListAttributeRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Slb", "2014-05-15", "SetAccessControlListAttribute", "slb", "openAPI") + return +} + +// CreateSetAccessControlListAttributeResponse creates a response to parse from SetAccessControlListAttribute response +func CreateSetAccessControlListAttributeResponse() (response *SetAccessControlListAttributeResponse) { + response = &SetAccessControlListAttributeResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/set_backend_servers.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/set_backend_servers.go new file mode 100644 index 0000000000..1cdcf68e77 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/set_backend_servers.go @@ -0,0 +1,112 @@ +package slb + +//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" +) + +// SetBackendServers invokes the slb.SetBackendServers API synchronously +// api document: https://help.aliyun.com/api/slb/setbackendservers.html +func (client *Client) SetBackendServers(request *SetBackendServersRequest) (response *SetBackendServersResponse, err error) { + response = CreateSetBackendServersResponse() + err = client.DoAction(request, response) + return +} + +// SetBackendServersWithChan invokes the slb.SetBackendServers API asynchronously +// api document: https://help.aliyun.com/api/slb/setbackendservers.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) SetBackendServersWithChan(request *SetBackendServersRequest) (<-chan *SetBackendServersResponse, <-chan error) { + responseChan := make(chan *SetBackendServersResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.SetBackendServers(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// SetBackendServersWithCallback invokes the slb.SetBackendServers API asynchronously +// api document: https://help.aliyun.com/api/slb/setbackendservers.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) SetBackendServersWithCallback(request *SetBackendServersRequest, callback func(response *SetBackendServersResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *SetBackendServersResponse + var err error + defer close(result) + response, err = client.SetBackendServers(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// SetBackendServersRequest is the request struct for api SetBackendServers +type SetBackendServersRequest struct { + *requests.RpcRequest + AccessKeyId string `position:"Query" name:"access_key_id"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + BackendServers string `position:"Query" name:"BackendServers"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + Tags string `position:"Query" name:"Tags"` + LoadBalancerId string `position:"Query" name:"LoadBalancerId"` +} + +// SetBackendServersResponse is the response struct for api SetBackendServers +type SetBackendServersResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + LoadBalancerId string `json:"LoadBalancerId" xml:"LoadBalancerId"` + BackendServers BackendServersInSetBackendServers `json:"BackendServers" xml:"BackendServers"` +} + +// CreateSetBackendServersRequest creates a request to invoke SetBackendServers API +func CreateSetBackendServersRequest() (request *SetBackendServersRequest) { + request = &SetBackendServersRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Slb", "2014-05-15", "SetBackendServers", "slb", "openAPI") + return +} + +// CreateSetBackendServersResponse creates a response to parse from SetBackendServers response +func CreateSetBackendServersResponse() (response *SetBackendServersResponse) { + response = &SetBackendServersResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/set_ca_certificate_name.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/set_ca_certificate_name.go new file mode 100644 index 0000000000..68bae4bca6 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/set_ca_certificate_name.go @@ -0,0 +1,109 @@ +package slb + +//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" +) + +// SetCACertificateName invokes the slb.SetCACertificateName API synchronously +// api document: https://help.aliyun.com/api/slb/setcacertificatename.html +func (client *Client) SetCACertificateName(request *SetCACertificateNameRequest) (response *SetCACertificateNameResponse, err error) { + response = CreateSetCACertificateNameResponse() + err = client.DoAction(request, response) + return +} + +// SetCACertificateNameWithChan invokes the slb.SetCACertificateName API asynchronously +// api document: https://help.aliyun.com/api/slb/setcacertificatename.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) SetCACertificateNameWithChan(request *SetCACertificateNameRequest) (<-chan *SetCACertificateNameResponse, <-chan error) { + responseChan := make(chan *SetCACertificateNameResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.SetCACertificateName(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// SetCACertificateNameWithCallback invokes the slb.SetCACertificateName API asynchronously +// api document: https://help.aliyun.com/api/slb/setcacertificatename.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) SetCACertificateNameWithCallback(request *SetCACertificateNameRequest, callback func(response *SetCACertificateNameResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *SetCACertificateNameResponse + var err error + defer close(result) + response, err = client.SetCACertificateName(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// SetCACertificateNameRequest is the request struct for api SetCACertificateName +type SetCACertificateNameRequest struct { + *requests.RpcRequest + AccessKeyId string `position:"Query" name:"access_key_id"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + CACertificateName string `position:"Query" name:"CACertificateName"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + CACertificateId string `position:"Query" name:"CACertificateId"` +} + +// SetCACertificateNameResponse is the response struct for api SetCACertificateName +type SetCACertificateNameResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateSetCACertificateNameRequest creates a request to invoke SetCACertificateName API +func CreateSetCACertificateNameRequest() (request *SetCACertificateNameRequest) { + request = &SetCACertificateNameRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Slb", "2014-05-15", "SetCACertificateName", "slb", "openAPI") + return +} + +// CreateSetCACertificateNameResponse creates a response to parse from SetCACertificateName response +func CreateSetCACertificateNameResponse() (response *SetCACertificateNameResponse) { + response = &SetCACertificateNameResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/set_domain_extension_attribute.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/set_domain_extension_attribute.go new file mode 100644 index 0000000000..b4ddd1a443 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/set_domain_extension_attribute.go @@ -0,0 +1,110 @@ +package slb + +//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" +) + +// SetDomainExtensionAttribute invokes the slb.SetDomainExtensionAttribute API synchronously +// api document: https://help.aliyun.com/api/slb/setdomainextensionattribute.html +func (client *Client) SetDomainExtensionAttribute(request *SetDomainExtensionAttributeRequest) (response *SetDomainExtensionAttributeResponse, err error) { + response = CreateSetDomainExtensionAttributeResponse() + err = client.DoAction(request, response) + return +} + +// SetDomainExtensionAttributeWithChan invokes the slb.SetDomainExtensionAttribute API asynchronously +// api document: https://help.aliyun.com/api/slb/setdomainextensionattribute.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) SetDomainExtensionAttributeWithChan(request *SetDomainExtensionAttributeRequest) (<-chan *SetDomainExtensionAttributeResponse, <-chan error) { + responseChan := make(chan *SetDomainExtensionAttributeResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.SetDomainExtensionAttribute(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// SetDomainExtensionAttributeWithCallback invokes the slb.SetDomainExtensionAttribute API asynchronously +// api document: https://help.aliyun.com/api/slb/setdomainextensionattribute.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) SetDomainExtensionAttributeWithCallback(request *SetDomainExtensionAttributeRequest, callback func(response *SetDomainExtensionAttributeResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *SetDomainExtensionAttributeResponse + var err error + defer close(result) + response, err = client.SetDomainExtensionAttribute(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// SetDomainExtensionAttributeRequest is the request struct for api SetDomainExtensionAttribute +type SetDomainExtensionAttributeRequest struct { + *requests.RpcRequest + AccessKeyId string `position:"Query" name:"access_key_id"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + DomainExtensionId string `position:"Query" name:"DomainExtensionId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + ServerCertificateId string `position:"Query" name:"ServerCertificateId"` + Tags string `position:"Query" name:"Tags"` +} + +// SetDomainExtensionAttributeResponse is the response struct for api SetDomainExtensionAttribute +type SetDomainExtensionAttributeResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateSetDomainExtensionAttributeRequest creates a request to invoke SetDomainExtensionAttribute API +func CreateSetDomainExtensionAttributeRequest() (request *SetDomainExtensionAttributeRequest) { + request = &SetDomainExtensionAttributeRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Slb", "2014-05-15", "SetDomainExtensionAttribute", "slb", "openAPI") + return +} + +// CreateSetDomainExtensionAttributeResponse creates a response to parse from SetDomainExtensionAttribute response +func CreateSetDomainExtensionAttributeResponse() (response *SetDomainExtensionAttributeResponse) { + response = &SetDomainExtensionAttributeResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/set_listener_access_control_status.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/set_listener_access_control_status.go new file mode 100644 index 0000000000..9919ea0d0a --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/set_listener_access_control_status.go @@ -0,0 +1,112 @@ +package slb + +//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" +) + +// SetListenerAccessControlStatus invokes the slb.SetListenerAccessControlStatus API synchronously +// api document: https://help.aliyun.com/api/slb/setlisteneraccesscontrolstatus.html +func (client *Client) SetListenerAccessControlStatus(request *SetListenerAccessControlStatusRequest) (response *SetListenerAccessControlStatusResponse, err error) { + response = CreateSetListenerAccessControlStatusResponse() + err = client.DoAction(request, response) + return +} + +// SetListenerAccessControlStatusWithChan invokes the slb.SetListenerAccessControlStatus API asynchronously +// api document: https://help.aliyun.com/api/slb/setlisteneraccesscontrolstatus.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) SetListenerAccessControlStatusWithChan(request *SetListenerAccessControlStatusRequest) (<-chan *SetListenerAccessControlStatusResponse, <-chan error) { + responseChan := make(chan *SetListenerAccessControlStatusResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.SetListenerAccessControlStatus(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// SetListenerAccessControlStatusWithCallback invokes the slb.SetListenerAccessControlStatus API asynchronously +// api document: https://help.aliyun.com/api/slb/setlisteneraccesscontrolstatus.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) SetListenerAccessControlStatusWithCallback(request *SetListenerAccessControlStatusRequest, callback func(response *SetListenerAccessControlStatusResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *SetListenerAccessControlStatusResponse + var err error + defer close(result) + response, err = client.SetListenerAccessControlStatus(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// SetListenerAccessControlStatusRequest is the request struct for api SetListenerAccessControlStatus +type SetListenerAccessControlStatusRequest struct { + *requests.RpcRequest + AccessKeyId string `position:"Query" name:"access_key_id"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + AccessControlStatus string `position:"Query" name:"AccessControlStatus"` + ListenerPort requests.Integer `position:"Query" name:"ListenerPort"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + ListenerProtocol string `position:"Query" name:"ListenerProtocol"` + Tags string `position:"Query" name:"Tags"` + LoadBalancerId string `position:"Query" name:"LoadBalancerId"` +} + +// SetListenerAccessControlStatusResponse is the response struct for api SetListenerAccessControlStatus +type SetListenerAccessControlStatusResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateSetListenerAccessControlStatusRequest creates a request to invoke SetListenerAccessControlStatus API +func CreateSetListenerAccessControlStatusRequest() (request *SetListenerAccessControlStatusRequest) { + request = &SetListenerAccessControlStatusRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Slb", "2014-05-15", "SetListenerAccessControlStatus", "slb", "openAPI") + return +} + +// CreateSetListenerAccessControlStatusResponse creates a response to parse from SetListenerAccessControlStatus response +func CreateSetListenerAccessControlStatusResponse() (response *SetListenerAccessControlStatusResponse) { + response = &SetListenerAccessControlStatusResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/set_load_balancer_delete_protection.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/set_load_balancer_delete_protection.go new file mode 100644 index 0000000000..994b0a6704 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/set_load_balancer_delete_protection.go @@ -0,0 +1,110 @@ +package slb + +//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" +) + +// SetLoadBalancerDeleteProtection invokes the slb.SetLoadBalancerDeleteProtection API synchronously +// api document: https://help.aliyun.com/api/slb/setloadbalancerdeleteprotection.html +func (client *Client) SetLoadBalancerDeleteProtection(request *SetLoadBalancerDeleteProtectionRequest) (response *SetLoadBalancerDeleteProtectionResponse, err error) { + response = CreateSetLoadBalancerDeleteProtectionResponse() + err = client.DoAction(request, response) + return +} + +// SetLoadBalancerDeleteProtectionWithChan invokes the slb.SetLoadBalancerDeleteProtection API asynchronously +// api document: https://help.aliyun.com/api/slb/setloadbalancerdeleteprotection.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) SetLoadBalancerDeleteProtectionWithChan(request *SetLoadBalancerDeleteProtectionRequest) (<-chan *SetLoadBalancerDeleteProtectionResponse, <-chan error) { + responseChan := make(chan *SetLoadBalancerDeleteProtectionResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.SetLoadBalancerDeleteProtection(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// SetLoadBalancerDeleteProtectionWithCallback invokes the slb.SetLoadBalancerDeleteProtection API asynchronously +// api document: https://help.aliyun.com/api/slb/setloadbalancerdeleteprotection.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) SetLoadBalancerDeleteProtectionWithCallback(request *SetLoadBalancerDeleteProtectionRequest, callback func(response *SetLoadBalancerDeleteProtectionResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *SetLoadBalancerDeleteProtectionResponse + var err error + defer close(result) + response, err = client.SetLoadBalancerDeleteProtection(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// SetLoadBalancerDeleteProtectionRequest is the request struct for api SetLoadBalancerDeleteProtection +type SetLoadBalancerDeleteProtectionRequest struct { + *requests.RpcRequest + AccessKeyId string `position:"Query" name:"access_key_id"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + DeleteProtection string `position:"Query" name:"DeleteProtection"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + Tags string `position:"Query" name:"Tags"` + LoadBalancerId string `position:"Query" name:"LoadBalancerId"` +} + +// SetLoadBalancerDeleteProtectionResponse is the response struct for api SetLoadBalancerDeleteProtection +type SetLoadBalancerDeleteProtectionResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateSetLoadBalancerDeleteProtectionRequest creates a request to invoke SetLoadBalancerDeleteProtection API +func CreateSetLoadBalancerDeleteProtectionRequest() (request *SetLoadBalancerDeleteProtectionRequest) { + request = &SetLoadBalancerDeleteProtectionRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Slb", "2014-05-15", "SetLoadBalancerDeleteProtection", "slb", "openAPI") + return +} + +// CreateSetLoadBalancerDeleteProtectionResponse creates a response to parse from SetLoadBalancerDeleteProtection response +func CreateSetLoadBalancerDeleteProtectionResponse() (response *SetLoadBalancerDeleteProtectionResponse) { + response = &SetLoadBalancerDeleteProtectionResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/set_load_balancer_http_listener_attribute.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/set_load_balancer_http_listener_attribute.go new file mode 100644 index 0000000000..ecbf89c42e --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/set_load_balancer_http_listener_attribute.go @@ -0,0 +1,142 @@ +package slb + +//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" +) + +// SetLoadBalancerHTTPListenerAttribute invokes the slb.SetLoadBalancerHTTPListenerAttribute API synchronously +// api document: https://help.aliyun.com/api/slb/setloadbalancerhttplistenerattribute.html +func (client *Client) SetLoadBalancerHTTPListenerAttribute(request *SetLoadBalancerHTTPListenerAttributeRequest) (response *SetLoadBalancerHTTPListenerAttributeResponse, err error) { + response = CreateSetLoadBalancerHTTPListenerAttributeResponse() + err = client.DoAction(request, response) + return +} + +// SetLoadBalancerHTTPListenerAttributeWithChan invokes the slb.SetLoadBalancerHTTPListenerAttribute API asynchronously +// api document: https://help.aliyun.com/api/slb/setloadbalancerhttplistenerattribute.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) SetLoadBalancerHTTPListenerAttributeWithChan(request *SetLoadBalancerHTTPListenerAttributeRequest) (<-chan *SetLoadBalancerHTTPListenerAttributeResponse, <-chan error) { + responseChan := make(chan *SetLoadBalancerHTTPListenerAttributeResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.SetLoadBalancerHTTPListenerAttribute(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// SetLoadBalancerHTTPListenerAttributeWithCallback invokes the slb.SetLoadBalancerHTTPListenerAttribute API asynchronously +// api document: https://help.aliyun.com/api/slb/setloadbalancerhttplistenerattribute.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) SetLoadBalancerHTTPListenerAttributeWithCallback(request *SetLoadBalancerHTTPListenerAttributeRequest, callback func(response *SetLoadBalancerHTTPListenerAttributeResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *SetLoadBalancerHTTPListenerAttributeResponse + var err error + defer close(result) + response, err = client.SetLoadBalancerHTTPListenerAttribute(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// SetLoadBalancerHTTPListenerAttributeRequest is the request struct for api SetLoadBalancerHTTPListenerAttribute +type SetLoadBalancerHTTPListenerAttributeRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + HealthCheckTimeout requests.Integer `position:"Query" name:"HealthCheckTimeout"` + XForwardedFor string `position:"Query" name:"XForwardedFor"` + HealthCheckURI string `position:"Query" name:"HealthCheckURI"` + AclStatus string `position:"Query" name:"AclStatus"` + AclType string `position:"Query" name:"AclType"` + HealthCheck string `position:"Query" name:"HealthCheck"` + VpcIds string `position:"Query" name:"VpcIds"` + VServerGroupId string `position:"Query" name:"VServerGroupId"` + AclId string `position:"Query" name:"AclId"` + Cookie string `position:"Query" name:"Cookie"` + HealthCheckMethod string `position:"Query" name:"HealthCheckMethod"` + HealthCheckDomain string `position:"Query" name:"HealthCheckDomain"` + RequestTimeout requests.Integer `position:"Query" name:"RequestTimeout"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + Tags string `position:"Query" name:"Tags"` + LoadBalancerId string `position:"Query" name:"LoadBalancerId"` + XForwardedForSLBIP string `position:"Query" name:"XForwardedFor_SLBIP"` + HealthCheckInterval requests.Integer `position:"Query" name:"HealthCheckInterval"` + XForwardedForSLBID string `position:"Query" name:"XForwardedFor_SLBID"` + AccessKeyId string `position:"Query" name:"access_key_id"` + Description string `position:"Query" name:"Description"` + UnhealthyThreshold requests.Integer `position:"Query" name:"UnhealthyThreshold"` + HealthyThreshold requests.Integer `position:"Query" name:"HealthyThreshold"` + Scheduler string `position:"Query" name:"Scheduler"` + MaxConnection requests.Integer `position:"Query" name:"MaxConnection"` + CookieTimeout requests.Integer `position:"Query" name:"CookieTimeout"` + StickySessionType string `position:"Query" name:"StickySessionType"` + ListenerPort requests.Integer `position:"Query" name:"ListenerPort"` + HealthCheckType string `position:"Query" name:"HealthCheckType"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + Bandwidth requests.Integer `position:"Query" name:"Bandwidth"` + StickySession string `position:"Query" name:"StickySession"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + Gzip string `position:"Query" name:"Gzip"` + IdleTimeout requests.Integer `position:"Query" name:"IdleTimeout"` + XForwardedForProto string `position:"Query" name:"XForwardedFor_proto"` + HealthCheckConnectPort requests.Integer `position:"Query" name:"HealthCheckConnectPort"` + HealthCheckHttpCode string `position:"Query" name:"HealthCheckHttpCode"` + VServerGroup string `position:"Query" name:"VServerGroup"` +} + +// SetLoadBalancerHTTPListenerAttributeResponse is the response struct for api SetLoadBalancerHTTPListenerAttribute +type SetLoadBalancerHTTPListenerAttributeResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateSetLoadBalancerHTTPListenerAttributeRequest creates a request to invoke SetLoadBalancerHTTPListenerAttribute API +func CreateSetLoadBalancerHTTPListenerAttributeRequest() (request *SetLoadBalancerHTTPListenerAttributeRequest) { + request = &SetLoadBalancerHTTPListenerAttributeRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Slb", "2014-05-15", "SetLoadBalancerHTTPListenerAttribute", "slb", "openAPI") + return +} + +// CreateSetLoadBalancerHTTPListenerAttributeResponse creates a response to parse from SetLoadBalancerHTTPListenerAttribute response +func CreateSetLoadBalancerHTTPListenerAttributeResponse() (response *SetLoadBalancerHTTPListenerAttributeResponse) { + response = &SetLoadBalancerHTTPListenerAttributeResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/set_load_balancer_https_listener_attribute.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/set_load_balancer_https_listener_attribute.go new file mode 100644 index 0000000000..6a87c8b7e2 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/set_load_balancer_https_listener_attribute.go @@ -0,0 +1,147 @@ +package slb + +//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" +) + +// SetLoadBalancerHTTPSListenerAttribute invokes the slb.SetLoadBalancerHTTPSListenerAttribute API synchronously +// api document: https://help.aliyun.com/api/slb/setloadbalancerhttpslistenerattribute.html +func (client *Client) SetLoadBalancerHTTPSListenerAttribute(request *SetLoadBalancerHTTPSListenerAttributeRequest) (response *SetLoadBalancerHTTPSListenerAttributeResponse, err error) { + response = CreateSetLoadBalancerHTTPSListenerAttributeResponse() + err = client.DoAction(request, response) + return +} + +// SetLoadBalancerHTTPSListenerAttributeWithChan invokes the slb.SetLoadBalancerHTTPSListenerAttribute API asynchronously +// api document: https://help.aliyun.com/api/slb/setloadbalancerhttpslistenerattribute.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) SetLoadBalancerHTTPSListenerAttributeWithChan(request *SetLoadBalancerHTTPSListenerAttributeRequest) (<-chan *SetLoadBalancerHTTPSListenerAttributeResponse, <-chan error) { + responseChan := make(chan *SetLoadBalancerHTTPSListenerAttributeResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.SetLoadBalancerHTTPSListenerAttribute(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// SetLoadBalancerHTTPSListenerAttributeWithCallback invokes the slb.SetLoadBalancerHTTPSListenerAttribute API asynchronously +// api document: https://help.aliyun.com/api/slb/setloadbalancerhttpslistenerattribute.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) SetLoadBalancerHTTPSListenerAttributeWithCallback(request *SetLoadBalancerHTTPSListenerAttributeRequest, callback func(response *SetLoadBalancerHTTPSListenerAttributeResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *SetLoadBalancerHTTPSListenerAttributeResponse + var err error + defer close(result) + response, err = client.SetLoadBalancerHTTPSListenerAttribute(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// SetLoadBalancerHTTPSListenerAttributeRequest is the request struct for api SetLoadBalancerHTTPSListenerAttribute +type SetLoadBalancerHTTPSListenerAttributeRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + HealthCheckTimeout requests.Integer `position:"Query" name:"HealthCheckTimeout"` + XForwardedFor string `position:"Query" name:"XForwardedFor"` + HealthCheckURI string `position:"Query" name:"HealthCheckURI"` + AclStatus string `position:"Query" name:"AclStatus"` + AclType string `position:"Query" name:"AclType"` + HealthCheck string `position:"Query" name:"HealthCheck"` + VpcIds string `position:"Query" name:"VpcIds"` + VServerGroupId string `position:"Query" name:"VServerGroupId"` + AclId string `position:"Query" name:"AclId"` + Cookie string `position:"Query" name:"Cookie"` + HealthCheckMethod string `position:"Query" name:"HealthCheckMethod"` + HealthCheckDomain string `position:"Query" name:"HealthCheckDomain"` + RequestTimeout requests.Integer `position:"Query" name:"RequestTimeout"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + CACertificateId string `position:"Query" name:"CACertificateId"` + BackendProtocol string `position:"Query" name:"BackendProtocol"` + Tags string `position:"Query" name:"Tags"` + LoadBalancerId string `position:"Query" name:"LoadBalancerId"` + XForwardedForSLBIP string `position:"Query" name:"XForwardedFor_SLBIP"` + HealthCheckInterval requests.Integer `position:"Query" name:"HealthCheckInterval"` + XForwardedForSLBID string `position:"Query" name:"XForwardedFor_SLBID"` + AccessKeyId string `position:"Query" name:"access_key_id"` + Description string `position:"Query" name:"Description"` + UnhealthyThreshold requests.Integer `position:"Query" name:"UnhealthyThreshold"` + HealthyThreshold requests.Integer `position:"Query" name:"HealthyThreshold"` + Scheduler string `position:"Query" name:"Scheduler"` + MaxConnection requests.Integer `position:"Query" name:"MaxConnection"` + EnableHttp2 string `position:"Query" name:"EnableHttp2"` + CookieTimeout requests.Integer `position:"Query" name:"CookieTimeout"` + StickySessionType string `position:"Query" name:"StickySessionType"` + ListenerPort requests.Integer `position:"Query" name:"ListenerPort"` + HealthCheckType string `position:"Query" name:"HealthCheckType"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + Bandwidth requests.Integer `position:"Query" name:"Bandwidth"` + StickySession string `position:"Query" name:"StickySession"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + Gzip string `position:"Query" name:"Gzip"` + TLSCipherPolicy string `position:"Query" name:"TLSCipherPolicy"` + ServerCertificateId string `position:"Query" name:"ServerCertificateId"` + IdleTimeout requests.Integer `position:"Query" name:"IdleTimeout"` + XForwardedForProto string `position:"Query" name:"XForwardedFor_proto"` + HealthCheckConnectPort requests.Integer `position:"Query" name:"HealthCheckConnectPort"` + HealthCheckHttpCode string `position:"Query" name:"HealthCheckHttpCode"` + VServerGroup string `position:"Query" name:"VServerGroup"` +} + +// SetLoadBalancerHTTPSListenerAttributeResponse is the response struct for api SetLoadBalancerHTTPSListenerAttribute +type SetLoadBalancerHTTPSListenerAttributeResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateSetLoadBalancerHTTPSListenerAttributeRequest creates a request to invoke SetLoadBalancerHTTPSListenerAttribute API +func CreateSetLoadBalancerHTTPSListenerAttributeRequest() (request *SetLoadBalancerHTTPSListenerAttributeRequest) { + request = &SetLoadBalancerHTTPSListenerAttributeRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Slb", "2014-05-15", "SetLoadBalancerHTTPSListenerAttribute", "slb", "openAPI") + return +} + +// CreateSetLoadBalancerHTTPSListenerAttributeResponse creates a response to parse from SetLoadBalancerHTTPSListenerAttribute response +func CreateSetLoadBalancerHTTPSListenerAttributeResponse() (response *SetLoadBalancerHTTPSListenerAttributeResponse) { + response = &SetLoadBalancerHTTPSListenerAttributeResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/set_load_balancer_name.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/set_load_balancer_name.go new file mode 100644 index 0000000000..04c9dac3cf --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/set_load_balancer_name.go @@ -0,0 +1,110 @@ +package slb + +//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" +) + +// SetLoadBalancerName invokes the slb.SetLoadBalancerName API synchronously +// api document: https://help.aliyun.com/api/slb/setloadbalancername.html +func (client *Client) SetLoadBalancerName(request *SetLoadBalancerNameRequest) (response *SetLoadBalancerNameResponse, err error) { + response = CreateSetLoadBalancerNameResponse() + err = client.DoAction(request, response) + return +} + +// SetLoadBalancerNameWithChan invokes the slb.SetLoadBalancerName API asynchronously +// api document: https://help.aliyun.com/api/slb/setloadbalancername.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) SetLoadBalancerNameWithChan(request *SetLoadBalancerNameRequest) (<-chan *SetLoadBalancerNameResponse, <-chan error) { + responseChan := make(chan *SetLoadBalancerNameResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.SetLoadBalancerName(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// SetLoadBalancerNameWithCallback invokes the slb.SetLoadBalancerName API asynchronously +// api document: https://help.aliyun.com/api/slb/setloadbalancername.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) SetLoadBalancerNameWithCallback(request *SetLoadBalancerNameRequest, callback func(response *SetLoadBalancerNameResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *SetLoadBalancerNameResponse + var err error + defer close(result) + response, err = client.SetLoadBalancerName(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// SetLoadBalancerNameRequest is the request struct for api SetLoadBalancerName +type SetLoadBalancerNameRequest struct { + *requests.RpcRequest + AccessKeyId string `position:"Query" name:"access_key_id"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + LoadBalancerName string `position:"Query" name:"LoadBalancerName"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + Tags string `position:"Query" name:"Tags"` + LoadBalancerId string `position:"Query" name:"LoadBalancerId"` +} + +// SetLoadBalancerNameResponse is the response struct for api SetLoadBalancerName +type SetLoadBalancerNameResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateSetLoadBalancerNameRequest creates a request to invoke SetLoadBalancerName API +func CreateSetLoadBalancerNameRequest() (request *SetLoadBalancerNameRequest) { + request = &SetLoadBalancerNameRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Slb", "2014-05-15", "SetLoadBalancerName", "slb", "openAPI") + return +} + +// CreateSetLoadBalancerNameResponse creates a response to parse from SetLoadBalancerName response +func CreateSetLoadBalancerNameResponse() (response *SetLoadBalancerNameResponse) { + response = &SetLoadBalancerNameResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/set_load_balancer_status.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/set_load_balancer_status.go new file mode 100644 index 0000000000..f4941ea85c --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/set_load_balancer_status.go @@ -0,0 +1,110 @@ +package slb + +//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" +) + +// SetLoadBalancerStatus invokes the slb.SetLoadBalancerStatus API synchronously +// api document: https://help.aliyun.com/api/slb/setloadbalancerstatus.html +func (client *Client) SetLoadBalancerStatus(request *SetLoadBalancerStatusRequest) (response *SetLoadBalancerStatusResponse, err error) { + response = CreateSetLoadBalancerStatusResponse() + err = client.DoAction(request, response) + return +} + +// SetLoadBalancerStatusWithChan invokes the slb.SetLoadBalancerStatus API asynchronously +// api document: https://help.aliyun.com/api/slb/setloadbalancerstatus.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) SetLoadBalancerStatusWithChan(request *SetLoadBalancerStatusRequest) (<-chan *SetLoadBalancerStatusResponse, <-chan error) { + responseChan := make(chan *SetLoadBalancerStatusResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.SetLoadBalancerStatus(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// SetLoadBalancerStatusWithCallback invokes the slb.SetLoadBalancerStatus API asynchronously +// api document: https://help.aliyun.com/api/slb/setloadbalancerstatus.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) SetLoadBalancerStatusWithCallback(request *SetLoadBalancerStatusRequest, callback func(response *SetLoadBalancerStatusResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *SetLoadBalancerStatusResponse + var err error + defer close(result) + response, err = client.SetLoadBalancerStatus(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// SetLoadBalancerStatusRequest is the request struct for api SetLoadBalancerStatus +type SetLoadBalancerStatusRequest struct { + *requests.RpcRequest + AccessKeyId string `position:"Query" name:"access_key_id"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + LoadBalancerStatus string `position:"Query" name:"LoadBalancerStatus"` + Tags string `position:"Query" name:"Tags"` + LoadBalancerId string `position:"Query" name:"LoadBalancerId"` +} + +// SetLoadBalancerStatusResponse is the response struct for api SetLoadBalancerStatus +type SetLoadBalancerStatusResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateSetLoadBalancerStatusRequest creates a request to invoke SetLoadBalancerStatus API +func CreateSetLoadBalancerStatusRequest() (request *SetLoadBalancerStatusRequest) { + request = &SetLoadBalancerStatusRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Slb", "2014-05-15", "SetLoadBalancerStatus", "slb", "openAPI") + return +} + +// CreateSetLoadBalancerStatusResponse creates a response to parse from SetLoadBalancerStatus response +func CreateSetLoadBalancerStatusResponse() (response *SetLoadBalancerStatusResponse) { + response = &SetLoadBalancerStatusResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/set_load_balancer_tcp_listener_attribute.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/set_load_balancer_tcp_listener_attribute.go new file mode 100644 index 0000000000..f2d7cb26d2 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/set_load_balancer_tcp_listener_attribute.go @@ -0,0 +1,144 @@ +package slb + +//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" +) + +// SetLoadBalancerTCPListenerAttribute invokes the slb.SetLoadBalancerTCPListenerAttribute API synchronously +// api document: https://help.aliyun.com/api/slb/setloadbalancertcplistenerattribute.html +func (client *Client) SetLoadBalancerTCPListenerAttribute(request *SetLoadBalancerTCPListenerAttributeRequest) (response *SetLoadBalancerTCPListenerAttributeResponse, err error) { + response = CreateSetLoadBalancerTCPListenerAttributeResponse() + err = client.DoAction(request, response) + return +} + +// SetLoadBalancerTCPListenerAttributeWithChan invokes the slb.SetLoadBalancerTCPListenerAttribute API asynchronously +// api document: https://help.aliyun.com/api/slb/setloadbalancertcplistenerattribute.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) SetLoadBalancerTCPListenerAttributeWithChan(request *SetLoadBalancerTCPListenerAttributeRequest) (<-chan *SetLoadBalancerTCPListenerAttributeResponse, <-chan error) { + responseChan := make(chan *SetLoadBalancerTCPListenerAttributeResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.SetLoadBalancerTCPListenerAttribute(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// SetLoadBalancerTCPListenerAttributeWithCallback invokes the slb.SetLoadBalancerTCPListenerAttribute API asynchronously +// api document: https://help.aliyun.com/api/slb/setloadbalancertcplistenerattribute.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) SetLoadBalancerTCPListenerAttributeWithCallback(request *SetLoadBalancerTCPListenerAttributeRequest, callback func(response *SetLoadBalancerTCPListenerAttributeResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *SetLoadBalancerTCPListenerAttributeResponse + var err error + defer close(result) + response, err = client.SetLoadBalancerTCPListenerAttribute(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// SetLoadBalancerTCPListenerAttributeRequest is the request struct for api SetLoadBalancerTCPListenerAttribute +type SetLoadBalancerTCPListenerAttributeRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + HealthCheckURI string `position:"Query" name:"HealthCheckURI"` + AclStatus string `position:"Query" name:"AclStatus"` + AclType string `position:"Query" name:"AclType"` + MasterSlaveServerGroup string `position:"Query" name:"MasterSlaveServerGroup"` + EstablishedTimeout requests.Integer `position:"Query" name:"EstablishedTimeout"` + PersistenceTimeout requests.Integer `position:"Query" name:"PersistenceTimeout"` + VpcIds string `position:"Query" name:"VpcIds"` + VServerGroupId string `position:"Query" name:"VServerGroupId"` + AclId string `position:"Query" name:"AclId"` + PortRange *[]SetLoadBalancerTCPListenerAttributePortRange `position:"Query" name:"PortRange" type:"Repeated"` + HealthCheckMethod string `position:"Query" name:"HealthCheckMethod"` + HealthCheckDomain string `position:"Query" name:"HealthCheckDomain"` + SynProxy string `position:"Query" name:"SynProxy"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + Tags string `position:"Query" name:"Tags"` + LoadBalancerId string `position:"Query" name:"LoadBalancerId"` + MasterSlaveServerGroupId string `position:"Query" name:"MasterSlaveServerGroupId"` + HealthCheckInterval requests.Integer `position:"Query" name:"HealthCheckInterval"` + ConnectionDrain string `position:"Query" name:"ConnectionDrain"` + AccessKeyId string `position:"Query" name:"access_key_id"` + HealthCheckConnectTimeout requests.Integer `position:"Query" name:"HealthCheckConnectTimeout"` + Description string `position:"Query" name:"Description"` + UnhealthyThreshold requests.Integer `position:"Query" name:"UnhealthyThreshold"` + HealthyThreshold requests.Integer `position:"Query" name:"HealthyThreshold"` + Scheduler string `position:"Query" name:"Scheduler"` + MaxConnection requests.Integer `position:"Query" name:"MaxConnection"` + ListenerPort requests.Integer `position:"Query" name:"ListenerPort"` + HealthCheckType string `position:"Query" name:"HealthCheckType"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + Bandwidth requests.Integer `position:"Query" name:"Bandwidth"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + ConnectionDrainTimeout requests.Integer `position:"Query" name:"ConnectionDrainTimeout"` + HealthCheckConnectPort requests.Integer `position:"Query" name:"HealthCheckConnectPort"` + HealthCheckHttpCode string `position:"Query" name:"HealthCheckHttpCode"` + VServerGroup string `position:"Query" name:"VServerGroup"` +} + +// SetLoadBalancerTCPListenerAttributePortRange is a repeated param struct in SetLoadBalancerTCPListenerAttributeRequest +type SetLoadBalancerTCPListenerAttributePortRange struct { + StartPort string `name:"StartPort"` + EndPort string `name:"EndPort"` +} + +// SetLoadBalancerTCPListenerAttributeResponse is the response struct for api SetLoadBalancerTCPListenerAttribute +type SetLoadBalancerTCPListenerAttributeResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateSetLoadBalancerTCPListenerAttributeRequest creates a request to invoke SetLoadBalancerTCPListenerAttribute API +func CreateSetLoadBalancerTCPListenerAttributeRequest() (request *SetLoadBalancerTCPListenerAttributeRequest) { + request = &SetLoadBalancerTCPListenerAttributeRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Slb", "2014-05-15", "SetLoadBalancerTCPListenerAttribute", "slb", "openAPI") + return +} + +// CreateSetLoadBalancerTCPListenerAttributeResponse creates a response to parse from SetLoadBalancerTCPListenerAttribute response +func CreateSetLoadBalancerTCPListenerAttributeResponse() (response *SetLoadBalancerTCPListenerAttributeResponse) { + response = &SetLoadBalancerTCPListenerAttributeResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/set_load_balancer_udp_listener_attribute.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/set_load_balancer_udp_listener_attribute.go new file mode 100644 index 0000000000..e71d9c2b9a --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/set_load_balancer_udp_listener_attribute.go @@ -0,0 +1,139 @@ +package slb + +//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" +) + +// SetLoadBalancerUDPListenerAttribute invokes the slb.SetLoadBalancerUDPListenerAttribute API synchronously +// api document: https://help.aliyun.com/api/slb/setloadbalancerudplistenerattribute.html +func (client *Client) SetLoadBalancerUDPListenerAttribute(request *SetLoadBalancerUDPListenerAttributeRequest) (response *SetLoadBalancerUDPListenerAttributeResponse, err error) { + response = CreateSetLoadBalancerUDPListenerAttributeResponse() + err = client.DoAction(request, response) + return +} + +// SetLoadBalancerUDPListenerAttributeWithChan invokes the slb.SetLoadBalancerUDPListenerAttribute API asynchronously +// api document: https://help.aliyun.com/api/slb/setloadbalancerudplistenerattribute.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) SetLoadBalancerUDPListenerAttributeWithChan(request *SetLoadBalancerUDPListenerAttributeRequest) (<-chan *SetLoadBalancerUDPListenerAttributeResponse, <-chan error) { + responseChan := make(chan *SetLoadBalancerUDPListenerAttributeResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.SetLoadBalancerUDPListenerAttribute(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// SetLoadBalancerUDPListenerAttributeWithCallback invokes the slb.SetLoadBalancerUDPListenerAttribute API asynchronously +// api document: https://help.aliyun.com/api/slb/setloadbalancerudplistenerattribute.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) SetLoadBalancerUDPListenerAttributeWithCallback(request *SetLoadBalancerUDPListenerAttributeRequest, callback func(response *SetLoadBalancerUDPListenerAttributeResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *SetLoadBalancerUDPListenerAttributeResponse + var err error + defer close(result) + response, err = client.SetLoadBalancerUDPListenerAttribute(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// SetLoadBalancerUDPListenerAttributeRequest is the request struct for api SetLoadBalancerUDPListenerAttribute +type SetLoadBalancerUDPListenerAttributeRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + AclStatus string `position:"Query" name:"AclStatus"` + AclType string `position:"Query" name:"AclType"` + MasterSlaveServerGroup string `position:"Query" name:"MasterSlaveServerGroup"` + PersistenceTimeout requests.Integer `position:"Query" name:"PersistenceTimeout"` + VpcIds string `position:"Query" name:"VpcIds"` + VServerGroupId string `position:"Query" name:"VServerGroupId"` + AclId string `position:"Query" name:"AclId"` + PortRange *[]SetLoadBalancerUDPListenerAttributePortRange `position:"Query" name:"PortRange" type:"Repeated"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + Tags string `position:"Query" name:"Tags"` + LoadBalancerId string `position:"Query" name:"LoadBalancerId"` + MasterSlaveServerGroupId string `position:"Query" name:"MasterSlaveServerGroupId"` + HealthCheckReq string `position:"Query" name:"healthCheckReq"` + HealthCheckInterval requests.Integer `position:"Query" name:"HealthCheckInterval"` + HealthCheckExp string `position:"Query" name:"healthCheckExp"` + ConnectionDrain string `position:"Query" name:"ConnectionDrain"` + AccessKeyId string `position:"Query" name:"access_key_id"` + HealthCheckConnectTimeout requests.Integer `position:"Query" name:"HealthCheckConnectTimeout"` + Description string `position:"Query" name:"Description"` + UnhealthyThreshold requests.Integer `position:"Query" name:"UnhealthyThreshold"` + HealthyThreshold requests.Integer `position:"Query" name:"HealthyThreshold"` + Scheduler string `position:"Query" name:"Scheduler"` + MaxConnection requests.Integer `position:"Query" name:"MaxConnection"` + ListenerPort requests.Integer `position:"Query" name:"ListenerPort"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + Bandwidth requests.Integer `position:"Query" name:"Bandwidth"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + ConnectionDrainTimeout requests.Integer `position:"Query" name:"ConnectionDrainTimeout"` + HealthCheckConnectPort requests.Integer `position:"Query" name:"HealthCheckConnectPort"` + VServerGroup string `position:"Query" name:"VServerGroup"` +} + +// SetLoadBalancerUDPListenerAttributePortRange is a repeated param struct in SetLoadBalancerUDPListenerAttributeRequest +type SetLoadBalancerUDPListenerAttributePortRange struct { + StartPort string `name:"StartPort"` + EndPort string `name:"EndPort"` +} + +// SetLoadBalancerUDPListenerAttributeResponse is the response struct for api SetLoadBalancerUDPListenerAttribute +type SetLoadBalancerUDPListenerAttributeResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateSetLoadBalancerUDPListenerAttributeRequest creates a request to invoke SetLoadBalancerUDPListenerAttribute API +func CreateSetLoadBalancerUDPListenerAttributeRequest() (request *SetLoadBalancerUDPListenerAttributeRequest) { + request = &SetLoadBalancerUDPListenerAttributeRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Slb", "2014-05-15", "SetLoadBalancerUDPListenerAttribute", "slb", "openAPI") + return +} + +// CreateSetLoadBalancerUDPListenerAttributeResponse creates a response to parse from SetLoadBalancerUDPListenerAttribute response +func CreateSetLoadBalancerUDPListenerAttributeResponse() (response *SetLoadBalancerUDPListenerAttributeResponse) { + response = &SetLoadBalancerUDPListenerAttributeResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/set_rule.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/set_rule.go new file mode 100644 index 0000000000..a9330580c6 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/set_rule.go @@ -0,0 +1,126 @@ +package slb + +//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" +) + +// SetRule invokes the slb.SetRule API synchronously +// api document: https://help.aliyun.com/api/slb/setrule.html +func (client *Client) SetRule(request *SetRuleRequest) (response *SetRuleResponse, err error) { + response = CreateSetRuleResponse() + err = client.DoAction(request, response) + return +} + +// SetRuleWithChan invokes the slb.SetRule API asynchronously +// api document: https://help.aliyun.com/api/slb/setrule.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) SetRuleWithChan(request *SetRuleRequest) (<-chan *SetRuleResponse, <-chan error) { + responseChan := make(chan *SetRuleResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.SetRule(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// SetRuleWithCallback invokes the slb.SetRule API asynchronously +// api document: https://help.aliyun.com/api/slb/setrule.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) SetRuleWithCallback(request *SetRuleRequest, callback func(response *SetRuleResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *SetRuleResponse + var err error + defer close(result) + response, err = client.SetRule(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// SetRuleRequest is the request struct for api SetRule +type SetRuleRequest struct { + *requests.RpcRequest + AccessKeyId string `position:"Query" name:"access_key_id"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + HealthCheckTimeout requests.Integer `position:"Query" name:"HealthCheckTimeout"` + HealthCheckURI string `position:"Query" name:"HealthCheckURI"` + RuleName string `position:"Query" name:"RuleName"` + UnhealthyThreshold requests.Integer `position:"Query" name:"UnhealthyThreshold"` + HealthyThreshold requests.Integer `position:"Query" name:"HealthyThreshold"` + Scheduler string `position:"Query" name:"Scheduler"` + HealthCheck string `position:"Query" name:"HealthCheck"` + ListenerSync string `position:"Query" name:"ListenerSync"` + CookieTimeout requests.Integer `position:"Query" name:"CookieTimeout"` + StickySessionType string `position:"Query" name:"StickySessionType"` + VServerGroupId string `position:"Query" name:"VServerGroupId"` + Cookie string `position:"Query" name:"Cookie"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + StickySession string `position:"Query" name:"StickySession"` + HealthCheckDomain string `position:"Query" name:"HealthCheckDomain"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + Tags string `position:"Query" name:"Tags"` + HealthCheckInterval requests.Integer `position:"Query" name:"HealthCheckInterval"` + RuleId string `position:"Query" name:"RuleId"` + HealthCheckConnectPort requests.Integer `position:"Query" name:"HealthCheckConnectPort"` + HealthCheckHttpCode string `position:"Query" name:"HealthCheckHttpCode"` +} + +// SetRuleResponse is the response struct for api SetRule +type SetRuleResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateSetRuleRequest creates a request to invoke SetRule API +func CreateSetRuleRequest() (request *SetRuleRequest) { + request = &SetRuleRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Slb", "2014-05-15", "SetRule", "slb", "openAPI") + return +} + +// CreateSetRuleResponse creates a response to parse from SetRule response +func CreateSetRuleResponse() (response *SetRuleResponse) { + response = &SetRuleResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/set_server_certificate_name.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/set_server_certificate_name.go new file mode 100644 index 0000000000..68e7e9ca68 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/set_server_certificate_name.go @@ -0,0 +1,110 @@ +package slb + +//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" +) + +// SetServerCertificateName invokes the slb.SetServerCertificateName API synchronously +// api document: https://help.aliyun.com/api/slb/setservercertificatename.html +func (client *Client) SetServerCertificateName(request *SetServerCertificateNameRequest) (response *SetServerCertificateNameResponse, err error) { + response = CreateSetServerCertificateNameResponse() + err = client.DoAction(request, response) + return +} + +// SetServerCertificateNameWithChan invokes the slb.SetServerCertificateName API asynchronously +// api document: https://help.aliyun.com/api/slb/setservercertificatename.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) SetServerCertificateNameWithChan(request *SetServerCertificateNameRequest) (<-chan *SetServerCertificateNameResponse, <-chan error) { + responseChan := make(chan *SetServerCertificateNameResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.SetServerCertificateName(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// SetServerCertificateNameWithCallback invokes the slb.SetServerCertificateName API asynchronously +// api document: https://help.aliyun.com/api/slb/setservercertificatename.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) SetServerCertificateNameWithCallback(request *SetServerCertificateNameRequest, callback func(response *SetServerCertificateNameResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *SetServerCertificateNameResponse + var err error + defer close(result) + response, err = client.SetServerCertificateName(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// SetServerCertificateNameRequest is the request struct for api SetServerCertificateName +type SetServerCertificateNameRequest struct { + *requests.RpcRequest + AccessKeyId string `position:"Query" name:"access_key_id"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + ServerCertificateId string `position:"Query" name:"ServerCertificateId"` + Tags string `position:"Query" name:"Tags"` + ServerCertificateName string `position:"Query" name:"ServerCertificateName"` +} + +// SetServerCertificateNameResponse is the response struct for api SetServerCertificateName +type SetServerCertificateNameResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateSetServerCertificateNameRequest creates a request to invoke SetServerCertificateName API +func CreateSetServerCertificateNameRequest() (request *SetServerCertificateNameRequest) { + request = &SetServerCertificateNameRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Slb", "2014-05-15", "SetServerCertificateName", "slb", "openAPI") + return +} + +// CreateSetServerCertificateNameResponse creates a response to parse from SetServerCertificateName response +func CreateSetServerCertificateNameResponse() (response *SetServerCertificateNameResponse) { + response = &SetServerCertificateNameResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/set_v_server_group_attribute.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/set_v_server_group_attribute.go new file mode 100644 index 0000000000..abcb346051 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/set_v_server_group_attribute.go @@ -0,0 +1,114 @@ +package slb + +//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" +) + +// SetVServerGroupAttribute invokes the slb.SetVServerGroupAttribute API synchronously +// api document: https://help.aliyun.com/api/slb/setvservergroupattribute.html +func (client *Client) SetVServerGroupAttribute(request *SetVServerGroupAttributeRequest) (response *SetVServerGroupAttributeResponse, err error) { + response = CreateSetVServerGroupAttributeResponse() + err = client.DoAction(request, response) + return +} + +// SetVServerGroupAttributeWithChan invokes the slb.SetVServerGroupAttribute API asynchronously +// api document: https://help.aliyun.com/api/slb/setvservergroupattribute.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) SetVServerGroupAttributeWithChan(request *SetVServerGroupAttributeRequest) (<-chan *SetVServerGroupAttributeResponse, <-chan error) { + responseChan := make(chan *SetVServerGroupAttributeResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.SetVServerGroupAttribute(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// SetVServerGroupAttributeWithCallback invokes the slb.SetVServerGroupAttribute API asynchronously +// api document: https://help.aliyun.com/api/slb/setvservergroupattribute.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) SetVServerGroupAttributeWithCallback(request *SetVServerGroupAttributeRequest, callback func(response *SetVServerGroupAttributeResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *SetVServerGroupAttributeResponse + var err error + defer close(result) + response, err = client.SetVServerGroupAttribute(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// SetVServerGroupAttributeRequest is the request struct for api SetVServerGroupAttribute +type SetVServerGroupAttributeRequest struct { + *requests.RpcRequest + AccessKeyId string `position:"Query" name:"access_key_id"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + BackendServers string `position:"Query" name:"BackendServers"` + VServerGroupId string `position:"Query" name:"VServerGroupId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + Tags string `position:"Query" name:"Tags"` + VServerGroupName string `position:"Query" name:"VServerGroupName"` +} + +// SetVServerGroupAttributeResponse is the response struct for api SetVServerGroupAttribute +type SetVServerGroupAttributeResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + VServerGroupId string `json:"VServerGroupId" xml:"VServerGroupId"` + VServerGroupName string `json:"VServerGroupName" xml:"VServerGroupName"` + BackendServers BackendServersInSetVServerGroupAttribute `json:"BackendServers" xml:"BackendServers"` +} + +// CreateSetVServerGroupAttributeRequest creates a request to invoke SetVServerGroupAttribute API +func CreateSetVServerGroupAttributeRequest() (request *SetVServerGroupAttributeRequest) { + request = &SetVServerGroupAttributeRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Slb", "2014-05-15", "SetVServerGroupAttribute", "slb", "openAPI") + return +} + +// CreateSetVServerGroupAttributeResponse creates a response to parse from SetVServerGroupAttribute response +func CreateSetVServerGroupAttributeResponse() (response *SetVServerGroupAttributeResponse) { + response = &SetVServerGroupAttributeResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/start_load_balancer_listener.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/start_load_balancer_listener.go new file mode 100644 index 0000000000..fec905c69b --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/start_load_balancer_listener.go @@ -0,0 +1,111 @@ +package slb + +//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" +) + +// StartLoadBalancerListener invokes the slb.StartLoadBalancerListener API synchronously +// api document: https://help.aliyun.com/api/slb/startloadbalancerlistener.html +func (client *Client) StartLoadBalancerListener(request *StartLoadBalancerListenerRequest) (response *StartLoadBalancerListenerResponse, err error) { + response = CreateStartLoadBalancerListenerResponse() + err = client.DoAction(request, response) + return +} + +// StartLoadBalancerListenerWithChan invokes the slb.StartLoadBalancerListener API asynchronously +// api document: https://help.aliyun.com/api/slb/startloadbalancerlistener.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) StartLoadBalancerListenerWithChan(request *StartLoadBalancerListenerRequest) (<-chan *StartLoadBalancerListenerResponse, <-chan error) { + responseChan := make(chan *StartLoadBalancerListenerResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.StartLoadBalancerListener(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// StartLoadBalancerListenerWithCallback invokes the slb.StartLoadBalancerListener API asynchronously +// api document: https://help.aliyun.com/api/slb/startloadbalancerlistener.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) StartLoadBalancerListenerWithCallback(request *StartLoadBalancerListenerRequest, callback func(response *StartLoadBalancerListenerResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *StartLoadBalancerListenerResponse + var err error + defer close(result) + response, err = client.StartLoadBalancerListener(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// StartLoadBalancerListenerRequest is the request struct for api StartLoadBalancerListener +type StartLoadBalancerListenerRequest struct { + *requests.RpcRequest + AccessKeyId string `position:"Query" name:"access_key_id"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ListenerPort requests.Integer `position:"Query" name:"ListenerPort"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + ListenerProtocol string `position:"Query" name:"ListenerProtocol"` + Tags string `position:"Query" name:"Tags"` + LoadBalancerId string `position:"Query" name:"LoadBalancerId"` +} + +// StartLoadBalancerListenerResponse is the response struct for api StartLoadBalancerListener +type StartLoadBalancerListenerResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateStartLoadBalancerListenerRequest creates a request to invoke StartLoadBalancerListener API +func CreateStartLoadBalancerListenerRequest() (request *StartLoadBalancerListenerRequest) { + request = &StartLoadBalancerListenerRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Slb", "2014-05-15", "StartLoadBalancerListener", "slb", "openAPI") + return +} + +// CreateStartLoadBalancerListenerResponse creates a response to parse from StartLoadBalancerListener response +func CreateStartLoadBalancerListenerResponse() (response *StartLoadBalancerListenerResponse) { + response = &StartLoadBalancerListenerResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/stop_load_balancer_listener.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/stop_load_balancer_listener.go new file mode 100644 index 0000000000..2222d4de2b --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/stop_load_balancer_listener.go @@ -0,0 +1,111 @@ +package slb + +//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" +) + +// StopLoadBalancerListener invokes the slb.StopLoadBalancerListener API synchronously +// api document: https://help.aliyun.com/api/slb/stoploadbalancerlistener.html +func (client *Client) StopLoadBalancerListener(request *StopLoadBalancerListenerRequest) (response *StopLoadBalancerListenerResponse, err error) { + response = CreateStopLoadBalancerListenerResponse() + err = client.DoAction(request, response) + return +} + +// StopLoadBalancerListenerWithChan invokes the slb.StopLoadBalancerListener API asynchronously +// api document: https://help.aliyun.com/api/slb/stoploadbalancerlistener.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) StopLoadBalancerListenerWithChan(request *StopLoadBalancerListenerRequest) (<-chan *StopLoadBalancerListenerResponse, <-chan error) { + responseChan := make(chan *StopLoadBalancerListenerResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.StopLoadBalancerListener(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// StopLoadBalancerListenerWithCallback invokes the slb.StopLoadBalancerListener API asynchronously +// api document: https://help.aliyun.com/api/slb/stoploadbalancerlistener.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) StopLoadBalancerListenerWithCallback(request *StopLoadBalancerListenerRequest, callback func(response *StopLoadBalancerListenerResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *StopLoadBalancerListenerResponse + var err error + defer close(result) + response, err = client.StopLoadBalancerListener(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// StopLoadBalancerListenerRequest is the request struct for api StopLoadBalancerListener +type StopLoadBalancerListenerRequest struct { + *requests.RpcRequest + AccessKeyId string `position:"Query" name:"access_key_id"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ListenerPort requests.Integer `position:"Query" name:"ListenerPort"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + ListenerProtocol string `position:"Query" name:"ListenerProtocol"` + Tags string `position:"Query" name:"Tags"` + LoadBalancerId string `position:"Query" name:"LoadBalancerId"` +} + +// StopLoadBalancerListenerResponse is the response struct for api StopLoadBalancerListener +type StopLoadBalancerListenerResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateStopLoadBalancerListenerRequest creates a request to invoke StopLoadBalancerListener API +func CreateStopLoadBalancerListenerRequest() (request *StopLoadBalancerListenerRequest) { + request = &StopLoadBalancerListenerRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Slb", "2014-05-15", "StopLoadBalancerListener", "slb", "openAPI") + return +} + +// CreateStopLoadBalancerListenerResponse creates a response to parse from StopLoadBalancerListener response +func CreateStopLoadBalancerListenerResponse() (response *StopLoadBalancerListenerResponse) { + response = &StopLoadBalancerListenerResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_acl.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_acl.go new file mode 100644 index 0000000000..f8a6451e58 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_acl.go @@ -0,0 +1,25 @@ +package slb + +//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. + +// Acl is a nested struct in slb response +type Acl struct { + AclId string `json:"AclId" xml:"AclId"` + AclName string `json:"AclName" xml:"AclName"` + AddressIPVersion string `json:"AddressIPVersion" xml:"AddressIPVersion"` + ResourceGroupId string `json:"ResourceGroupId" xml:"ResourceGroupId"` + Tags TagsInDescribeAccessControlLists `json:"Tags" xml:"Tags"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_acl_entry.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_acl_entry.go new file mode 100644 index 0000000000..a197c96434 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_acl_entry.go @@ -0,0 +1,22 @@ +package slb + +//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. + +// AclEntry is a nested struct in slb response +type AclEntry struct { + AclEntryIP string `json:"AclEntryIP" xml:"AclEntryIP"` + AclEntryComment string `json:"AclEntryComment" xml:"AclEntryComment"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_acl_entrys.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_acl_entrys.go new file mode 100644 index 0000000000..c47d2a016a --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_acl_entrys.go @@ -0,0 +1,21 @@ +package slb + +//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. + +// AclEntrys is a nested struct in slb response +type AclEntrys struct { + AclEntry []AclEntry `json:"AclEntry" xml:"AclEntry"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_acl_ids_in_describe_load_balancer_http_listener_attribute.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_acl_ids_in_describe_load_balancer_http_listener_attribute.go new file mode 100644 index 0000000000..68c8dde8e9 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_acl_ids_in_describe_load_balancer_http_listener_attribute.go @@ -0,0 +1,21 @@ +package slb + +//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. + +// AclIdsInDescribeLoadBalancerHTTPListenerAttribute is a nested struct in slb response +type AclIdsInDescribeLoadBalancerHTTPListenerAttribute struct { + AclId []string `json:"AclId" xml:"AclId"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_acl_ids_in_describe_load_balancer_https_listener_attribute.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_acl_ids_in_describe_load_balancer_https_listener_attribute.go new file mode 100644 index 0000000000..d7ead0dfdd --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_acl_ids_in_describe_load_balancer_https_listener_attribute.go @@ -0,0 +1,21 @@ +package slb + +//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. + +// AclIdsInDescribeLoadBalancerHTTPSListenerAttribute is a nested struct in slb response +type AclIdsInDescribeLoadBalancerHTTPSListenerAttribute struct { + AclId []string `json:"AclId" xml:"AclId"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_acl_ids_in_describe_load_balancer_tcp_listener_attribute.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_acl_ids_in_describe_load_balancer_tcp_listener_attribute.go new file mode 100644 index 0000000000..d669abdd35 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_acl_ids_in_describe_load_balancer_tcp_listener_attribute.go @@ -0,0 +1,21 @@ +package slb + +//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. + +// AclIdsInDescribeLoadBalancerTCPListenerAttribute is a nested struct in slb response +type AclIdsInDescribeLoadBalancerTCPListenerAttribute struct { + AclId []string `json:"AclId" xml:"AclId"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_acl_ids_in_describe_load_balancer_udp_listener_attribute.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_acl_ids_in_describe_load_balancer_udp_listener_attribute.go new file mode 100644 index 0000000000..aa077f93e0 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_acl_ids_in_describe_load_balancer_udp_listener_attribute.go @@ -0,0 +1,21 @@ +package slb + +//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. + +// AclIdsInDescribeLoadBalancerUDPListenerAttribute is a nested struct in slb response +type AclIdsInDescribeLoadBalancerUDPListenerAttribute struct { + AclId []string `json:"AclId" xml:"AclId"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_acls.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_acls.go new file mode 100644 index 0000000000..99f6763a90 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_acls.go @@ -0,0 +1,21 @@ +package slb + +//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. + +// Acls is a nested struct in slb response +type Acls struct { + Acl []Acl `json:"Acl" xml:"Acl"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_associated_objects.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_associated_objects.go new file mode 100644 index 0000000000..ab97dd6e4f --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_associated_objects.go @@ -0,0 +1,22 @@ +package slb + +//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. + +// AssociatedObjects is a nested struct in slb response +type AssociatedObjects struct { + Rules RulesInDescribeVServerGroups `json:"Rules" xml:"Rules"` + Listeners ListenersInDescribeMasterSlaveServerGroups `json:"Listeners" xml:"Listeners"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_available_resource.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_available_resource.go new file mode 100644 index 0000000000..976adad04e --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_available_resource.go @@ -0,0 +1,23 @@ +package slb + +//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. + +// AvailableResource is a nested struct in slb response +type AvailableResource struct { + MasterZoneId string `json:"MasterZoneId" xml:"MasterZoneId"` + SlaveZoneId string `json:"SlaveZoneId" xml:"SlaveZoneId"` + SupportResources SupportResources `json:"SupportResources" xml:"SupportResources"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_available_resources.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_available_resources.go new file mode 100644 index 0000000000..039fff990d --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_available_resources.go @@ -0,0 +1,21 @@ +package slb + +//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. + +// AvailableResources is a nested struct in slb response +type AvailableResources struct { + AvailableResource []AvailableResource `json:"AvailableResource" xml:"AvailableResource"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_backend_server.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_backend_server.go new file mode 100644 index 0000000000..7997caf883 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_backend_server.go @@ -0,0 +1,31 @@ +package slb + +//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. + +// BackendServer is a nested struct in slb response +type BackendServer struct { + Port int `json:"Port" xml:"Port"` + Protocol string `json:"Protocol" xml:"Protocol"` + ServerIp string `json:"ServerIp" xml:"ServerIp"` + ServerHealthStatus string `json:"ServerHealthStatus" xml:"ServerHealthStatus"` + ServerId string `json:"ServerId" xml:"ServerId"` + VpcId string `json:"VpcId" xml:"VpcId"` + ListenerPort int `json:"ListenerPort" xml:"ListenerPort"` + Weight string `json:"Weight" xml:"Weight"` + Description string `json:"Description" xml:"Description"` + EniHost string `json:"EniHost" xml:"EniHost"` + Type string `json:"Type" xml:"Type"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_backend_server_in_add_v_server_group_backend_servers.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_backend_server_in_add_v_server_group_backend_servers.go new file mode 100644 index 0000000000..24eb8d339d --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_backend_server_in_add_v_server_group_backend_servers.go @@ -0,0 +1,29 @@ +package slb + +//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. + +// BackendServerInAddVServerGroupBackendServers is a nested struct in slb response +type BackendServerInAddVServerGroupBackendServers struct { + ServerId string `json:"ServerId" xml:"ServerId"` + Port int `json:"Port" xml:"Port"` + Weight int `json:"Weight" xml:"Weight"` + Type string `json:"Type" xml:"Type"` + ServerIp string `json:"ServerIp" xml:"ServerIp"` + VpcId string `json:"VpcId" xml:"VpcId"` + VbrId string `json:"VbrId" xml:"VbrId"` + ServerRegionId string `json:"ServerRegionId" xml:"ServerRegionId"` + Description string `json:"Description" xml:"Description"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_backend_server_in_create_v_server_group.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_backend_server_in_create_v_server_group.go new file mode 100644 index 0000000000..da1eea29b5 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_backend_server_in_create_v_server_group.go @@ -0,0 +1,29 @@ +package slb + +//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. + +// BackendServerInCreateVServerGroup is a nested struct in slb response +type BackendServerInCreateVServerGroup struct { + ServerId string `json:"ServerId" xml:"ServerId"` + Port int `json:"Port" xml:"Port"` + Weight int `json:"Weight" xml:"Weight"` + Type string `json:"Type" xml:"Type"` + ServerIp string `json:"ServerIp" xml:"ServerIp"` + VpcId string `json:"VpcId" xml:"VpcId"` + VbrId string `json:"VbrId" xml:"VbrId"` + ServerRegionId string `json:"ServerRegionId" xml:"ServerRegionId"` + Description string `json:"Description" xml:"Description"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_backend_server_in_describe_load_balancer_attribute.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_backend_server_in_describe_load_balancer_attribute.go new file mode 100644 index 0000000000..dbb6fea452 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_backend_server_in_describe_load_balancer_attribute.go @@ -0,0 +1,26 @@ +package slb + +//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. + +// BackendServerInDescribeLoadBalancerAttribute is a nested struct in slb response +type BackendServerInDescribeLoadBalancerAttribute struct { + ServerId string `json:"ServerId" xml:"ServerId"` + Weight int `json:"Weight" xml:"Weight"` + Type string `json:"Type" xml:"Type"` + ServerIp string `json:"ServerIp" xml:"ServerIp"` + VpcId string `json:"VpcId" xml:"VpcId"` + Description string `json:"Description" xml:"Description"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_backend_server_in_describe_v_server_group_attribute.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_backend_server_in_describe_v_server_group_attribute.go new file mode 100644 index 0000000000..89ee160c29 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_backend_server_in_describe_v_server_group_attribute.go @@ -0,0 +1,29 @@ +package slb + +//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. + +// BackendServerInDescribeVServerGroupAttribute is a nested struct in slb response +type BackendServerInDescribeVServerGroupAttribute struct { + ServerId string `json:"ServerId" xml:"ServerId"` + Port int `json:"Port" xml:"Port"` + Weight int `json:"Weight" xml:"Weight"` + Type string `json:"Type" xml:"Type"` + ServerIp string `json:"ServerIp" xml:"ServerIp"` + VpcId string `json:"VpcId" xml:"VpcId"` + VbrId string `json:"VbrId" xml:"VbrId"` + ServerRegionId string `json:"ServerRegionId" xml:"ServerRegionId"` + Description string `json:"Description" xml:"Description"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_backend_server_in_modify_v_server_group_backend_servers.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_backend_server_in_modify_v_server_group_backend_servers.go new file mode 100644 index 0000000000..b6df580656 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_backend_server_in_modify_v_server_group_backend_servers.go @@ -0,0 +1,29 @@ +package slb + +//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. + +// BackendServerInModifyVServerGroupBackendServers is a nested struct in slb response +type BackendServerInModifyVServerGroupBackendServers struct { + ServerId string `json:"ServerId" xml:"ServerId"` + Port int `json:"Port" xml:"Port"` + Weight int `json:"Weight" xml:"Weight"` + Type string `json:"Type" xml:"Type"` + ServerIp string `json:"ServerIp" xml:"ServerIp"` + VpcId string `json:"VpcId" xml:"VpcId"` + VbrId string `json:"VbrId" xml:"VbrId"` + ServerRegionId string `json:"ServerRegionId" xml:"ServerRegionId"` + Description string `json:"Description" xml:"Description"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_backend_server_in_remove_backend_servers.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_backend_server_in_remove_backend_servers.go new file mode 100644 index 0000000000..65b4a2c72d --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_backend_server_in_remove_backend_servers.go @@ -0,0 +1,26 @@ +package slb + +//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. + +// BackendServerInRemoveBackendServers is a nested struct in slb response +type BackendServerInRemoveBackendServers struct { + ServerId string `json:"ServerId" xml:"ServerId"` + Weight int `json:"Weight" xml:"Weight"` + ServerIp string `json:"ServerIp" xml:"ServerIp"` + VpcId string `json:"VpcId" xml:"VpcId"` + Type string `json:"Type" xml:"Type"` + Description string `json:"Description" xml:"Description"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_backend_server_in_remove_v_server_group_backend_servers.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_backend_server_in_remove_v_server_group_backend_servers.go new file mode 100644 index 0000000000..36b4ff8d2a --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_backend_server_in_remove_v_server_group_backend_servers.go @@ -0,0 +1,29 @@ +package slb + +//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. + +// BackendServerInRemoveVServerGroupBackendServers is a nested struct in slb response +type BackendServerInRemoveVServerGroupBackendServers struct { + ServerId string `json:"ServerId" xml:"ServerId"` + Port int `json:"Port" xml:"Port"` + Weight int `json:"Weight" xml:"Weight"` + Type string `json:"Type" xml:"Type"` + ServerIp string `json:"ServerIp" xml:"ServerIp"` + VpcId string `json:"VpcId" xml:"VpcId"` + VbrId string `json:"VbrId" xml:"VbrId"` + ServerRegionId string `json:"ServerRegionId" xml:"ServerRegionId"` + Description string `json:"Description" xml:"Description"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_backend_server_in_set_v_server_group_attribute.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_backend_server_in_set_v_server_group_attribute.go new file mode 100644 index 0000000000..99c09b4429 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_backend_server_in_set_v_server_group_attribute.go @@ -0,0 +1,29 @@ +package slb + +//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. + +// BackendServerInSetVServerGroupAttribute is a nested struct in slb response +type BackendServerInSetVServerGroupAttribute struct { + ServerId string `json:"ServerId" xml:"ServerId"` + Port int `json:"Port" xml:"Port"` + Weight int `json:"Weight" xml:"Weight"` + Type string `json:"Type" xml:"Type"` + ServerIp string `json:"ServerIp" xml:"ServerIp"` + VpcId string `json:"VpcId" xml:"VpcId"` + VbrId string `json:"VbrId" xml:"VbrId"` + ServerRegionId string `json:"ServerRegionId" xml:"ServerRegionId"` + Description string `json:"Description" xml:"Description"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_backend_servers_in_add_backend_servers.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_backend_servers_in_add_backend_servers.go new file mode 100644 index 0000000000..7ef9b37714 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_backend_servers_in_add_backend_servers.go @@ -0,0 +1,21 @@ +package slb + +//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. + +// BackendServersInAddBackendServers is a nested struct in slb response +type BackendServersInAddBackendServers struct { + BackendServer []BackendServer `json:"BackendServer" xml:"BackendServer"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_backend_servers_in_add_v_server_group_backend_servers.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_backend_servers_in_add_v_server_group_backend_servers.go new file mode 100644 index 0000000000..3ab076bb11 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_backend_servers_in_add_v_server_group_backend_servers.go @@ -0,0 +1,21 @@ +package slb + +//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. + +// BackendServersInAddVServerGroupBackendServers is a nested struct in slb response +type BackendServersInAddVServerGroupBackendServers struct { + BackendServer []BackendServerInAddVServerGroupBackendServers `json:"BackendServer" xml:"BackendServer"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_backend_servers_in_create_v_server_group.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_backend_servers_in_create_v_server_group.go new file mode 100644 index 0000000000..7886fd66c3 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_backend_servers_in_create_v_server_group.go @@ -0,0 +1,21 @@ +package slb + +//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. + +// BackendServersInCreateVServerGroup is a nested struct in slb response +type BackendServersInCreateVServerGroup struct { + BackendServer []BackendServerInCreateVServerGroup `json:"BackendServer" xml:"BackendServer"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_backend_servers_in_describe_health_status.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_backend_servers_in_describe_health_status.go new file mode 100644 index 0000000000..63f094f8c2 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_backend_servers_in_describe_health_status.go @@ -0,0 +1,21 @@ +package slb + +//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. + +// BackendServersInDescribeHealthStatus is a nested struct in slb response +type BackendServersInDescribeHealthStatus struct { + BackendServer []BackendServer `json:"BackendServer" xml:"BackendServer"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_backend_servers_in_describe_load_balancer_attribute.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_backend_servers_in_describe_load_balancer_attribute.go new file mode 100644 index 0000000000..8df08c75f7 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_backend_servers_in_describe_load_balancer_attribute.go @@ -0,0 +1,21 @@ +package slb + +//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. + +// BackendServersInDescribeLoadBalancerAttribute is a nested struct in slb response +type BackendServersInDescribeLoadBalancerAttribute struct { + BackendServer []BackendServerInDescribeLoadBalancerAttribute `json:"BackendServer" xml:"BackendServer"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_backend_servers_in_describe_v_server_group_attribute.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_backend_servers_in_describe_v_server_group_attribute.go new file mode 100644 index 0000000000..4f7b58748b --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_backend_servers_in_describe_v_server_group_attribute.go @@ -0,0 +1,21 @@ +package slb + +//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. + +// BackendServersInDescribeVServerGroupAttribute is a nested struct in slb response +type BackendServersInDescribeVServerGroupAttribute struct { + BackendServer []BackendServerInDescribeVServerGroupAttribute `json:"BackendServer" xml:"BackendServer"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_backend_servers_in_modify_v_server_group_backend_servers.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_backend_servers_in_modify_v_server_group_backend_servers.go new file mode 100644 index 0000000000..223e96fd10 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_backend_servers_in_modify_v_server_group_backend_servers.go @@ -0,0 +1,21 @@ +package slb + +//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. + +// BackendServersInModifyVServerGroupBackendServers is a nested struct in slb response +type BackendServersInModifyVServerGroupBackendServers struct { + BackendServer []BackendServerInModifyVServerGroupBackendServers `json:"BackendServer" xml:"BackendServer"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_backend_servers_in_remove_backend_servers.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_backend_servers_in_remove_backend_servers.go new file mode 100644 index 0000000000..6eb93fac92 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_backend_servers_in_remove_backend_servers.go @@ -0,0 +1,21 @@ +package slb + +//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. + +// BackendServersInRemoveBackendServers is a nested struct in slb response +type BackendServersInRemoveBackendServers struct { + BackendServer []BackendServerInRemoveBackendServers `json:"BackendServer" xml:"BackendServer"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_backend_servers_in_remove_v_server_group_backend_servers.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_backend_servers_in_remove_v_server_group_backend_servers.go new file mode 100644 index 0000000000..0797e4c1d8 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_backend_servers_in_remove_v_server_group_backend_servers.go @@ -0,0 +1,21 @@ +package slb + +//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. + +// BackendServersInRemoveVServerGroupBackendServers is a nested struct in slb response +type BackendServersInRemoveVServerGroupBackendServers struct { + BackendServer []BackendServerInRemoveVServerGroupBackendServers `json:"BackendServer" xml:"BackendServer"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_backend_servers_in_set_backend_servers.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_backend_servers_in_set_backend_servers.go new file mode 100644 index 0000000000..07055554f5 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_backend_servers_in_set_backend_servers.go @@ -0,0 +1,21 @@ +package slb + +//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. + +// BackendServersInSetBackendServers is a nested struct in slb response +type BackendServersInSetBackendServers struct { + BackendServer []BackendServer `json:"BackendServer" xml:"BackendServer"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_backend_servers_in_set_v_server_group_attribute.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_backend_servers_in_set_v_server_group_attribute.go new file mode 100644 index 0000000000..c78bb27190 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_backend_servers_in_set_v_server_group_attribute.go @@ -0,0 +1,21 @@ +package slb + +//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. + +// BackendServersInSetVServerGroupAttribute is a nested struct in slb response +type BackendServersInSetVServerGroupAttribute struct { + BackendServer []BackendServerInSetVServerGroupAttribute `json:"BackendServer" xml:"BackendServer"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_ca_certificate.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_ca_certificate.go new file mode 100644 index 0000000000..3e5d25af47 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_ca_certificate.go @@ -0,0 +1,31 @@ +package slb + +//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. + +// CACertificate is a nested struct in slb response +type CACertificate struct { + RegionId string `json:"RegionId" xml:"RegionId"` + CACertificateId string `json:"CACertificateId" xml:"CACertificateId"` + CACertificateName string `json:"CACertificateName" xml:"CACertificateName"` + Fingerprint string `json:"Fingerprint" xml:"Fingerprint"` + ResourceGroupId string `json:"ResourceGroupId" xml:"ResourceGroupId"` + CreateTime string `json:"CreateTime" xml:"CreateTime"` + CreateTimeStamp int64 `json:"CreateTimeStamp" xml:"CreateTimeStamp"` + ExpireTime string `json:"ExpireTime" xml:"ExpireTime"` + ExpireTimeStamp int64 `json:"ExpireTimeStamp" xml:"ExpireTimeStamp"` + CommonName string `json:"CommonName" xml:"CommonName"` + Tags TagsInDescribeCACertificates `json:"Tags" xml:"Tags"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_ca_certificates.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_ca_certificates.go new file mode 100644 index 0000000000..3ef188e6b6 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_ca_certificates.go @@ -0,0 +1,21 @@ +package slb + +//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. + +// CACertificates is a nested struct in slb response +type CACertificates struct { + CACertificate []CACertificate `json:"CACertificate" xml:"CACertificate"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_domain_extension.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_domain_extension.go new file mode 100644 index 0000000000..f8a3fe1787 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_domain_extension.go @@ -0,0 +1,23 @@ +package slb + +//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. + +// DomainExtension is a nested struct in slb response +type DomainExtension struct { + Domain string `json:"Domain" xml:"Domain"` + ServerCertificateId string `json:"ServerCertificateId" xml:"ServerCertificateId"` + DomainExtensionId string `json:"DomainExtensionId" xml:"DomainExtensionId"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_domain_extensions_in_describe_domain_extensions.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_domain_extensions_in_describe_domain_extensions.go new file mode 100644 index 0000000000..b2069ebf3b --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_domain_extensions_in_describe_domain_extensions.go @@ -0,0 +1,21 @@ +package slb + +//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. + +// DomainExtensionsInDescribeDomainExtensions is a nested struct in slb response +type DomainExtensionsInDescribeDomainExtensions struct { + DomainExtension []DomainExtension `json:"DomainExtension" xml:"DomainExtension"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_domain_extensions_in_describe_load_balancer_https_listener_attribute.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_domain_extensions_in_describe_load_balancer_https_listener_attribute.go new file mode 100644 index 0000000000..5b64f1fde8 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_domain_extensions_in_describe_load_balancer_https_listener_attribute.go @@ -0,0 +1,21 @@ +package slb + +//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. + +// DomainExtensionsInDescribeLoadBalancerHTTPSListenerAttribute is a nested struct in slb response +type DomainExtensionsInDescribeLoadBalancerHTTPSListenerAttribute struct { + DomainExtension []DomainExtension `json:"DomainExtension" xml:"DomainExtension"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_listener.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_listener.go new file mode 100644 index 0000000000..de3123b40e --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_listener.go @@ -0,0 +1,22 @@ +package slb + +//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 slb response +type Listener struct { + Port int `json:"Port" xml:"Port"` + Protocol string `json:"Protocol" xml:"Protocol"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_listener_port_and_protocal.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_listener_port_and_protocal.go new file mode 100644 index 0000000000..4e240ebaef --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_listener_port_and_protocal.go @@ -0,0 +1,22 @@ +package slb + +//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. + +// ListenerPortAndProtocal is a nested struct in slb response +type ListenerPortAndProtocal struct { + ListenerPort int `json:"ListenerPort" xml:"ListenerPort"` + ListenerProtocal string `json:"ListenerProtocal" xml:"ListenerProtocal"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_listener_port_and_protocol.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_listener_port_and_protocol.go new file mode 100644 index 0000000000..501ffeb3d6 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_listener_port_and_protocol.go @@ -0,0 +1,25 @@ +package slb + +//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. + +// ListenerPortAndProtocol is a nested struct in slb response +type ListenerPortAndProtocol struct { + ListenerPort int `json:"ListenerPort" xml:"ListenerPort"` + ListenerProtocol string `json:"ListenerProtocol" xml:"ListenerProtocol"` + ListenerForward string `json:"ListenerForward" xml:"ListenerForward"` + ForwardPort int `json:"ForwardPort" xml:"ForwardPort"` + Description string `json:"Description" xml:"Description"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_listener_ports.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_listener_ports.go new file mode 100644 index 0000000000..f70c490026 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_listener_ports.go @@ -0,0 +1,21 @@ +package slb + +//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. + +// ListenerPorts is a nested struct in slb response +type ListenerPorts struct { + ListenerPort []int `json:"ListenerPort" xml:"ListenerPort"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_listener_ports_and_protocal.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_listener_ports_and_protocal.go new file mode 100644 index 0000000000..92cbc1f10c --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_listener_ports_and_protocal.go @@ -0,0 +1,21 @@ +package slb + +//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. + +// ListenerPortsAndProtocal is a nested struct in slb response +type ListenerPortsAndProtocal struct { + ListenerPortAndProtocal []ListenerPortAndProtocal `json:"ListenerPortAndProtocal" xml:"ListenerPortAndProtocal"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_listener_ports_and_protocol.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_listener_ports_and_protocol.go new file mode 100644 index 0000000000..8ce12a3de1 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_listener_ports_and_protocol.go @@ -0,0 +1,21 @@ +package slb + +//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. + +// ListenerPortsAndProtocol is a nested struct in slb response +type ListenerPortsAndProtocol struct { + ListenerPortAndProtocol []ListenerPortAndProtocol `json:"ListenerPortAndProtocol" xml:"ListenerPortAndProtocol"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_listeners_in_describe_master_slave_server_groups.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_listeners_in_describe_master_slave_server_groups.go new file mode 100644 index 0000000000..4a1d5b1d2a --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_listeners_in_describe_master_slave_server_groups.go @@ -0,0 +1,21 @@ +package slb + +//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. + +// ListenersInDescribeMasterSlaveServerGroups is a nested struct in slb response +type ListenersInDescribeMasterSlaveServerGroups struct { + Listener []Listener `json:"Listener" xml:"Listener"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_listeners_in_describe_v_server_groups.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_listeners_in_describe_v_server_groups.go new file mode 100644 index 0000000000..f1910b27d3 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_listeners_in_describe_v_server_groups.go @@ -0,0 +1,21 @@ +package slb + +//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. + +// ListenersInDescribeVServerGroups is a nested struct in slb response +type ListenersInDescribeVServerGroups struct { + Listener []Listener `json:"Listener" xml:"Listener"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_load_balancer.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_load_balancer.go new file mode 100644 index 0000000000..025acd1f49 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_load_balancer.go @@ -0,0 +1,39 @@ +package slb + +//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. + +// LoadBalancer is a nested struct in slb response +type LoadBalancer struct { + LoadBalancerId string `json:"LoadBalancerId" xml:"LoadBalancerId"` + LoadBalancerName string `json:"LoadBalancerName" xml:"LoadBalancerName"` + LoadBalancerStatus string `json:"LoadBalancerStatus" xml:"LoadBalancerStatus"` + Address string `json:"Address" xml:"Address"` + AddressType string `json:"AddressType" xml:"AddressType"` + RegionId string `json:"RegionId" xml:"RegionId"` + RegionIdAlias string `json:"RegionIdAlias" xml:"RegionIdAlias"` + VSwitchId string `json:"VSwitchId" xml:"VSwitchId"` + VpcId string `json:"VpcId" xml:"VpcId"` + NetworkType string `json:"NetworkType" xml:"NetworkType"` + MasterZoneId string `json:"MasterZoneId" xml:"MasterZoneId"` + SlaveZoneId string `json:"SlaveZoneId" xml:"SlaveZoneId"` + InternetChargeType string `json:"InternetChargeType" xml:"InternetChargeType"` + CreateTime string `json:"CreateTime" xml:"CreateTime"` + CreateTimeStamp int64 `json:"CreateTimeStamp" xml:"CreateTimeStamp"` + PayType string `json:"PayType" xml:"PayType"` + ResourceGroupId string `json:"ResourceGroupId" xml:"ResourceGroupId"` + AddressIPVersion string `json:"AddressIPVersion" xml:"AddressIPVersion"` + Tags TagsInDescribeLoadBalancers `json:"Tags" xml:"Tags"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_load_balancers.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_load_balancers.go new file mode 100644 index 0000000000..bffff10a50 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_load_balancers.go @@ -0,0 +1,21 @@ +package slb + +//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 slb response +type LoadBalancers struct { + LoadBalancer []LoadBalancer `json:"LoadBalancer" xml:"LoadBalancer"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_master_slave_backend_server.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_master_slave_backend_server.go new file mode 100644 index 0000000000..342ab0304c --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_master_slave_backend_server.go @@ -0,0 +1,28 @@ +package slb + +//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. + +// MasterSlaveBackendServer is a nested struct in slb response +type MasterSlaveBackendServer struct { + Port int `json:"Port" xml:"Port"` + ServerIp string `json:"ServerIp" xml:"ServerIp"` + ServerId string `json:"ServerId" xml:"ServerId"` + ServerType string `json:"ServerType" xml:"ServerType"` + VpcId string `json:"VpcId" xml:"VpcId"` + Weight int `json:"Weight" xml:"Weight"` + Description string `json:"Description" xml:"Description"` + Type string `json:"Type" xml:"Type"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_master_slave_backend_servers_in_create_master_slave_server_group.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_master_slave_backend_servers_in_create_master_slave_server_group.go new file mode 100644 index 0000000000..3437fb5e8c --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_master_slave_backend_servers_in_create_master_slave_server_group.go @@ -0,0 +1,21 @@ +package slb + +//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. + +// MasterSlaveBackendServersInCreateMasterSlaveServerGroup is a nested struct in slb response +type MasterSlaveBackendServersInCreateMasterSlaveServerGroup struct { + MasterSlaveBackendServer []MasterSlaveBackendServer `json:"MasterSlaveBackendServer" xml:"MasterSlaveBackendServer"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_master_slave_backend_servers_in_describe_master_slave_server_group_attribute.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_master_slave_backend_servers_in_describe_master_slave_server_group_attribute.go new file mode 100644 index 0000000000..9d875308ef --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_master_slave_backend_servers_in_describe_master_slave_server_group_attribute.go @@ -0,0 +1,21 @@ +package slb + +//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. + +// MasterSlaveBackendServersInDescribeMasterSlaveServerGroupAttribute is a nested struct in slb response +type MasterSlaveBackendServersInDescribeMasterSlaveServerGroupAttribute struct { + MasterSlaveBackendServer []MasterSlaveBackendServer `json:"MasterSlaveBackendServer" xml:"MasterSlaveBackendServer"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_master_slave_server_group.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_master_slave_server_group.go new file mode 100644 index 0000000000..19a0917519 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_master_slave_server_group.go @@ -0,0 +1,23 @@ +package slb + +//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. + +// MasterSlaveServerGroup is a nested struct in slb response +type MasterSlaveServerGroup struct { + MasterSlaveServerGroupId string `json:"MasterSlaveServerGroupId" xml:"MasterSlaveServerGroupId"` + MasterSlaveServerGroupName string `json:"MasterSlaveServerGroupName" xml:"MasterSlaveServerGroupName"` + AssociatedObjects AssociatedObjects `json:"AssociatedObjects" xml:"AssociatedObjects"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_master_slave_server_groups.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_master_slave_server_groups.go new file mode 100644 index 0000000000..5a127bbf75 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_master_slave_server_groups.go @@ -0,0 +1,21 @@ +package slb + +//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. + +// MasterSlaveServerGroups is a nested struct in slb response +type MasterSlaveServerGroups struct { + MasterSlaveServerGroup []MasterSlaveServerGroup `json:"MasterSlaveServerGroup" xml:"MasterSlaveServerGroup"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_port_range.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_port_range.go new file mode 100644 index 0000000000..7d1380b04c --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_port_range.go @@ -0,0 +1,22 @@ +package slb + +//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. + +// PortRange is a nested struct in slb response +type PortRange struct { + EndPort int `json:"EndPort" xml:"EndPort"` + StartPort int `json:"StartPort" xml:"StartPort"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_port_ranges_in_describe_load_balancer_tcp_listener_attribute.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_port_ranges_in_describe_load_balancer_tcp_listener_attribute.go new file mode 100644 index 0000000000..cc5dd990c1 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_port_ranges_in_describe_load_balancer_tcp_listener_attribute.go @@ -0,0 +1,21 @@ +package slb + +//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. + +// PortRangesInDescribeLoadBalancerTCPListenerAttribute is a nested struct in slb response +type PortRangesInDescribeLoadBalancerTCPListenerAttribute struct { + PortRange []PortRange `json:"PortRange" xml:"PortRange"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_port_ranges_in_describe_load_balancer_udp_listener_attribute.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_port_ranges_in_describe_load_balancer_udp_listener_attribute.go new file mode 100644 index 0000000000..e08daf2ada --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_port_ranges_in_describe_load_balancer_udp_listener_attribute.go @@ -0,0 +1,21 @@ +package slb + +//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. + +// PortRangesInDescribeLoadBalancerUDPListenerAttribute is a nested struct in slb response +type PortRangesInDescribeLoadBalancerUDPListenerAttribute struct { + PortRange []PortRange `json:"PortRange" xml:"PortRange"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_region.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_region.go new file mode 100644 index 0000000000..3e93370a8d --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_region.go @@ -0,0 +1,23 @@ +package slb + +//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. + +// Region is a nested struct in slb response +type Region struct { + RegionId string `json:"RegionId" xml:"RegionId"` + LocalName string `json:"LocalName" xml:"LocalName"` + RegionEndpoint string `json:"RegionEndpoint" xml:"RegionEndpoint"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_regions.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_regions.go new file mode 100644 index 0000000000..7e5dcd0619 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_regions.go @@ -0,0 +1,21 @@ +package slb + +//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 slb response +type Regions struct { + Region []Region `json:"Region" xml:"Region"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_related_listener.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_related_listener.go new file mode 100644 index 0000000000..65c5de1a60 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_related_listener.go @@ -0,0 +1,24 @@ +package slb + +//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. + +// RelatedListener is a nested struct in slb response +type RelatedListener struct { + LoadBalancerId string `json:"LoadBalancerId" xml:"LoadBalancerId"` + ListenerPort int `json:"ListenerPort" xml:"ListenerPort"` + AclType string `json:"AclType" xml:"AclType"` + Protocol string `json:"Protocol" xml:"Protocol"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_related_listeners.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_related_listeners.go new file mode 100644 index 0000000000..f665586e02 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_related_listeners.go @@ -0,0 +1,21 @@ +package slb + +//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. + +// RelatedListeners is a nested struct in slb response +type RelatedListeners struct { + RelatedListener []RelatedListener `json:"RelatedListener" xml:"RelatedListener"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_rule.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_rule.go new file mode 100644 index 0000000000..a8ce742126 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_rule.go @@ -0,0 +1,40 @@ +package slb + +//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. + +// Rule is a nested struct in slb response +type Rule struct { + Domain string `json:"Domain" xml:"Domain"` + HealthCheckTimeout int `json:"HealthCheckTimeout" xml:"HealthCheckTimeout"` + RuleName string `json:"RuleName" xml:"RuleName"` + HealthCheckURI string `json:"HealthCheckURI" xml:"HealthCheckURI"` + StickySession string `json:"StickySession" xml:"StickySession"` + HealthCheckInterval int `json:"HealthCheckInterval" xml:"HealthCheckInterval"` + ListenerSync string `json:"ListenerSync" xml:"ListenerSync"` + RuleId string `json:"RuleId" xml:"RuleId"` + HealthCheckDomain string `json:"HealthCheckDomain" xml:"HealthCheckDomain"` + Scheduler string `json:"Scheduler" xml:"Scheduler"` + Url string `json:"Url" xml:"Url"` + VServerGroupId string `json:"VServerGroupId" xml:"VServerGroupId"` + HealthyThreshold int `json:"HealthyThreshold" xml:"HealthyThreshold"` + CookieTimeout int `json:"CookieTimeout" xml:"CookieTimeout"` + HealthCheckHttpCode string `json:"HealthCheckHttpCode" xml:"HealthCheckHttpCode"` + UnhealthyThreshold int `json:"UnhealthyThreshold" xml:"UnhealthyThreshold"` + StickySessionType string `json:"StickySessionType" xml:"StickySessionType"` + HealthCheckConnectPort int `json:"HealthCheckConnectPort" xml:"HealthCheckConnectPort"` + Cookie string `json:"Cookie" xml:"Cookie"` + HealthCheck string `json:"HealthCheck" xml:"HealthCheck"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_rules_in_create_rules.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_rules_in_create_rules.go new file mode 100644 index 0000000000..c33f1885a7 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_rules_in_create_rules.go @@ -0,0 +1,21 @@ +package slb + +//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. + +// RulesInCreateRules is a nested struct in slb response +type RulesInCreateRules struct { + Rule []Rule `json:"Rule" xml:"Rule"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_rules_in_describe_load_balancer_http_listener_attribute.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_rules_in_describe_load_balancer_http_listener_attribute.go new file mode 100644 index 0000000000..514535a4f0 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_rules_in_describe_load_balancer_http_listener_attribute.go @@ -0,0 +1,21 @@ +package slb + +//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. + +// RulesInDescribeLoadBalancerHTTPListenerAttribute is a nested struct in slb response +type RulesInDescribeLoadBalancerHTTPListenerAttribute struct { + Rule []Rule `json:"Rule" xml:"Rule"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_rules_in_describe_load_balancer_https_listener_attribute.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_rules_in_describe_load_balancer_https_listener_attribute.go new file mode 100644 index 0000000000..38f8cab6f7 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_rules_in_describe_load_balancer_https_listener_attribute.go @@ -0,0 +1,21 @@ +package slb + +//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. + +// RulesInDescribeLoadBalancerHTTPSListenerAttribute is a nested struct in slb response +type RulesInDescribeLoadBalancerHTTPSListenerAttribute struct { + Rule []Rule `json:"Rule" xml:"Rule"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_rules_in_describe_rules.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_rules_in_describe_rules.go new file mode 100644 index 0000000000..50c324b825 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_rules_in_describe_rules.go @@ -0,0 +1,21 @@ +package slb + +//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. + +// RulesInDescribeRules is a nested struct in slb response +type RulesInDescribeRules struct { + Rule []Rule `json:"Rule" xml:"Rule"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_rules_in_describe_v_server_groups.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_rules_in_describe_v_server_groups.go new file mode 100644 index 0000000000..73bd524c94 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_rules_in_describe_v_server_groups.go @@ -0,0 +1,21 @@ +package slb + +//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. + +// RulesInDescribeVServerGroups is a nested struct in slb response +type RulesInDescribeVServerGroups struct { + Rule []Rule `json:"Rule" xml:"Rule"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_server_certificate.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_server_certificate.go new file mode 100644 index 0000000000..eb87f81649 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_server_certificate.go @@ -0,0 +1,36 @@ +package slb + +//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. + +// ServerCertificate is a nested struct in slb response +type ServerCertificate struct { + ServerCertificateId string `json:"ServerCertificateId" xml:"ServerCertificateId"` + Fingerprint string `json:"Fingerprint" xml:"Fingerprint"` + ServerCertificateName string `json:"ServerCertificateName" xml:"ServerCertificateName"` + RegionId string `json:"RegionId" xml:"RegionId"` + RegionIdAlias string `json:"RegionIdAlias" xml:"RegionIdAlias"` + AliCloudCertificateId string `json:"AliCloudCertificateId" xml:"AliCloudCertificateId"` + AliCloudCertificateName string `json:"AliCloudCertificateName" xml:"AliCloudCertificateName"` + IsAliCloudCertificate int `json:"IsAliCloudCertificate" xml:"IsAliCloudCertificate"` + ResourceGroupId string `json:"ResourceGroupId" xml:"ResourceGroupId"` + CreateTime string `json:"CreateTime" xml:"CreateTime"` + CreateTimeStamp int64 `json:"CreateTimeStamp" xml:"CreateTimeStamp"` + ExpireTime string `json:"ExpireTime" xml:"ExpireTime"` + ExpireTimeStamp int64 `json:"ExpireTimeStamp" xml:"ExpireTimeStamp"` + CommonName string `json:"CommonName" xml:"CommonName"` + SubjectAlternativeNames SubjectAlternativeNamesInDescribeServerCertificates `json:"SubjectAlternativeNames" xml:"SubjectAlternativeNames"` + Tags TagsInDescribeServerCertificates `json:"Tags" xml:"Tags"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_server_certificates.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_server_certificates.go new file mode 100644 index 0000000000..56f19dbc1e --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_server_certificates.go @@ -0,0 +1,21 @@ +package slb + +//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. + +// ServerCertificates is a nested struct in slb response +type ServerCertificates struct { + ServerCertificate []ServerCertificate `json:"ServerCertificate" xml:"ServerCertificate"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_slave_zone.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_slave_zone.go new file mode 100644 index 0000000000..ef431161eb --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_slave_zone.go @@ -0,0 +1,22 @@ +package slb + +//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. + +// SlaveZone is a nested struct in slb response +type SlaveZone struct { + ZoneId string `json:"ZoneId" xml:"ZoneId"` + LocalName string `json:"LocalName" xml:"LocalName"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_slave_zones.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_slave_zones.go new file mode 100644 index 0000000000..badda39748 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_slave_zones.go @@ -0,0 +1,21 @@ +package slb + +//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. + +// SlaveZones is a nested struct in slb response +type SlaveZones struct { + SlaveZone []SlaveZone `json:"SlaveZone" xml:"SlaveZone"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_subject_alternative_names_in_describe_server_certificates.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_subject_alternative_names_in_describe_server_certificates.go new file mode 100644 index 0000000000..74a6691037 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_subject_alternative_names_in_describe_server_certificates.go @@ -0,0 +1,21 @@ +package slb + +//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. + +// SubjectAlternativeNamesInDescribeServerCertificates is a nested struct in slb response +type SubjectAlternativeNamesInDescribeServerCertificates struct { + SubjectAlternativeName []string `json:"SubjectAlternativeName" xml:"SubjectAlternativeName"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_subject_alternative_names_in_upload_server_certificate.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_subject_alternative_names_in_upload_server_certificate.go new file mode 100644 index 0000000000..f1014d5a89 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_subject_alternative_names_in_upload_server_certificate.go @@ -0,0 +1,21 @@ +package slb + +//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. + +// SubjectAlternativeNamesInUploadServerCertificate is a nested struct in slb response +type SubjectAlternativeNamesInUploadServerCertificate struct { + SubjectAlternativeName []string `json:"SubjectAlternativeName" xml:"SubjectAlternativeName"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_support_resource.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_support_resource.go new file mode 100644 index 0000000000..fb96bfee1d --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_support_resource.go @@ -0,0 +1,22 @@ +package slb + +//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. + +// SupportResource is a nested struct in slb response +type SupportResource struct { + AddressType string `json:"AddressType" xml:"AddressType"` + AddressIPVersion string `json:"AddressIPVersion" xml:"AddressIPVersion"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_support_resources.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_support_resources.go new file mode 100644 index 0000000000..3329a850ec --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_support_resources.go @@ -0,0 +1,21 @@ +package slb + +//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. + +// SupportResources is a nested struct in slb response +type SupportResources struct { + SupportResource []SupportResource `json:"SupportResource" xml:"SupportResource"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_tag.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_tag.go new file mode 100644 index 0000000000..d78de08bc9 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_tag.go @@ -0,0 +1,22 @@ +package slb + +//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. + +// Tag is a nested struct in slb response +type Tag struct { + TagValue string `json:"TagValue" xml:"TagValue"` + TagKey string `json:"TagKey" xml:"TagKey"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_tag_resource.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_tag_resource.go new file mode 100644 index 0000000000..b420cfc4c1 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_tag_resource.go @@ -0,0 +1,24 @@ +package slb + +//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 slb response +type TagResource struct { + TagKey string `json:"TagKey" xml:"TagKey"` + TagValue string `json:"TagValue" xml:"TagValue"` + ResourceType string `json:"ResourceType" xml:"ResourceType"` + ResourceId string `json:"ResourceId" xml:"ResourceId"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_tag_resources.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_tag_resources.go new file mode 100644 index 0000000000..2817c72603 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_tag_resources.go @@ -0,0 +1,21 @@ +package slb + +//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 slb response +type TagResources struct { + TagResource []TagResource `json:"TagResource" xml:"TagResource"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_tag_set.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_tag_set.go new file mode 100644 index 0000000000..aef08ef8da --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_tag_set.go @@ -0,0 +1,23 @@ +package slb + +//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. + +// TagSet is a nested struct in slb response +type TagSet struct { + TagKey string `json:"TagKey" xml:"TagKey"` + TagValue string `json:"TagValue" xml:"TagValue"` + InstanceCount int `json:"InstanceCount" xml:"InstanceCount"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_tag_sets.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_tag_sets.go new file mode 100644 index 0000000000..d095ab2f44 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_tag_sets.go @@ -0,0 +1,21 @@ +package slb + +//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. + +// TagSets is a nested struct in slb response +type TagSets struct { + TagSet []TagSet `json:"TagSet" xml:"TagSet"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_tags_in_describe_access_control_lists.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_tags_in_describe_access_control_lists.go new file mode 100644 index 0000000000..ea296f8859 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_tags_in_describe_access_control_lists.go @@ -0,0 +1,21 @@ +package slb + +//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. + +// TagsInDescribeAccessControlLists is a nested struct in slb response +type TagsInDescribeAccessControlLists struct { + Tag []Tag `json:"Tag" xml:"Tag"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_tags_in_describe_ca_certificates.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_tags_in_describe_ca_certificates.go new file mode 100644 index 0000000000..97573e404d --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_tags_in_describe_ca_certificates.go @@ -0,0 +1,21 @@ +package slb + +//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. + +// TagsInDescribeCACertificates is a nested struct in slb response +type TagsInDescribeCACertificates struct { + Tag []Tag `json:"Tag" xml:"Tag"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_tags_in_describe_load_balancers.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_tags_in_describe_load_balancers.go new file mode 100644 index 0000000000..2dbdab2e93 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_tags_in_describe_load_balancers.go @@ -0,0 +1,21 @@ +package slb + +//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. + +// TagsInDescribeLoadBalancers is a nested struct in slb response +type TagsInDescribeLoadBalancers struct { + Tag []Tag `json:"Tag" xml:"Tag"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_tags_in_describe_server_certificates.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_tags_in_describe_server_certificates.go new file mode 100644 index 0000000000..84fbc16511 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_tags_in_describe_server_certificates.go @@ -0,0 +1,21 @@ +package slb + +//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. + +// TagsInDescribeServerCertificates is a nested struct in slb response +type TagsInDescribeServerCertificates struct { + Tag []Tag `json:"Tag" xml:"Tag"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_v_server_group.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_v_server_group.go new file mode 100644 index 0000000000..191a622cd9 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_v_server_group.go @@ -0,0 +1,23 @@ +package slb + +//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. + +// VServerGroup is a nested struct in slb response +type VServerGroup struct { + VServerGroupId string `json:"VServerGroupId" xml:"VServerGroupId"` + VServerGroupName string `json:"VServerGroupName" xml:"VServerGroupName"` + AssociatedObjects AssociatedObjects `json:"AssociatedObjects" xml:"AssociatedObjects"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_v_server_groups.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_v_server_groups.go new file mode 100644 index 0000000000..79bd1ae47f --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_v_server_groups.go @@ -0,0 +1,21 @@ +package slb + +//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. + +// VServerGroups is a nested struct in slb response +type VServerGroups struct { + VServerGroup []VServerGroup `json:"VServerGroup" xml:"VServerGroup"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_zone.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_zone.go new file mode 100644 index 0000000000..3bb51f0789 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_zone.go @@ -0,0 +1,23 @@ +package slb + +//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. + +// Zone is a nested struct in slb response +type Zone struct { + ZoneId string `json:"ZoneId" xml:"ZoneId"` + LocalName string `json:"LocalName" xml:"LocalName"` + SlaveZones SlaveZones `json:"SlaveZones" xml:"SlaveZones"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_zones.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_zones.go new file mode 100644 index 0000000000..bd2d1efab3 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/struct_zones.go @@ -0,0 +1,21 @@ +package slb + +//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 slb response +type Zones struct { + Zone []Zone `json:"Zone" xml:"Zone"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/tag_resources.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/tag_resources.go new file mode 100644 index 0000000000..8366a9c484 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/tag_resources.go @@ -0,0 +1,116 @@ +package slb + +//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 slb.TagResources API synchronously +// api document: https://help.aliyun.com/api/slb/tagresources.html +func (client *Client) TagResources(request *TagResourcesRequest) (response *TagResourcesResponse, err error) { + response = CreateTagResourcesResponse() + err = client.DoAction(request, response) + return +} + +// TagResourcesWithChan invokes the slb.TagResources API asynchronously +// api document: https://help.aliyun.com/api/slb/tagresources.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +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 slb.TagResources API asynchronously +// api document: https://help.aliyun.com/api/slb/tagresources.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +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 + AccessKeyId string `position:"Query" name:"access_key_id"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + Tag *[]TagResourcesTag `position:"Query" name:"Tag" type:"Repeated"` + ResourceId *[]string `position:"Query" name:"ResourceId" type:"Repeated"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + ResourceType string `position:"Query" name:"ResourceType"` +} + +// TagResourcesTag is a repeated param struct in TagResourcesRequest +type TagResourcesTag struct { + Value string `name:"Value"` + Key string `name:"Key"` +} + +// 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("Slb", "2014-05-15", "TagResources", "slb", "openAPI") + return +} + +// CreateTagResourcesResponse creates a response to parse from TagResources response +func CreateTagResourcesResponse() (response *TagResourcesResponse) { + response = &TagResourcesResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/untag_resources.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/untag_resources.go new file mode 100644 index 0000000000..ad15a1ff1d --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/untag_resources.go @@ -0,0 +1,111 @@ +package slb + +//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 slb.UntagResources API synchronously +// api document: https://help.aliyun.com/api/slb/untagresources.html +func (client *Client) UntagResources(request *UntagResourcesRequest) (response *UntagResourcesResponse, err error) { + response = CreateUntagResourcesResponse() + err = client.DoAction(request, response) + return +} + +// UntagResourcesWithChan invokes the slb.UntagResources API asynchronously +// api document: https://help.aliyun.com/api/slb/untagresources.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +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 slb.UntagResources API asynchronously +// api document: https://help.aliyun.com/api/slb/untagresources.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +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 + AccessKeyId string `position:"Query" name:"access_key_id"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + All requests.Boolean `position:"Query" name:"All"` + ResourceId *[]string `position:"Query" name:"ResourceId" type:"Repeated"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + ResourceType string `position:"Query" name:"ResourceType"` + TagKey *[]string `position:"Query" 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("Slb", "2014-05-15", "UntagResources", "slb", "openAPI") + return +} + +// CreateUntagResourcesResponse creates a response to parse from UntagResources response +func CreateUntagResourcesResponse() (response *UntagResourcesResponse) { + response = &UntagResourcesResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/upload_ca_certificate.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/upload_ca_certificate.go new file mode 100644 index 0000000000..e628483d41 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/upload_ca_certificate.go @@ -0,0 +1,119 @@ +package slb + +//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" +) + +// UploadCACertificate invokes the slb.UploadCACertificate API synchronously +// api document: https://help.aliyun.com/api/slb/uploadcacertificate.html +func (client *Client) UploadCACertificate(request *UploadCACertificateRequest) (response *UploadCACertificateResponse, err error) { + response = CreateUploadCACertificateResponse() + err = client.DoAction(request, response) + return +} + +// UploadCACertificateWithChan invokes the slb.UploadCACertificate API asynchronously +// api document: https://help.aliyun.com/api/slb/uploadcacertificate.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) UploadCACertificateWithChan(request *UploadCACertificateRequest) (<-chan *UploadCACertificateResponse, <-chan error) { + responseChan := make(chan *UploadCACertificateResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.UploadCACertificate(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// UploadCACertificateWithCallback invokes the slb.UploadCACertificate API asynchronously +// api document: https://help.aliyun.com/api/slb/uploadcacertificate.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) UploadCACertificateWithCallback(request *UploadCACertificateRequest, callback func(response *UploadCACertificateResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *UploadCACertificateResponse + var err error + defer close(result) + response, err = client.UploadCACertificate(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// UploadCACertificateRequest is the request struct for api UploadCACertificate +type UploadCACertificateRequest struct { + *requests.RpcRequest + AccessKeyId string `position:"Query" name:"access_key_id"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceGroupId string `position:"Query" name:"ResourceGroupId"` + CACertificateName string `position:"Query" name:"CACertificateName"` + CACertificate string `position:"Query" name:"CACertificate"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// UploadCACertificateResponse is the response struct for api UploadCACertificate +type UploadCACertificateResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + CACertificateId string `json:"CACertificateId" xml:"CACertificateId"` + CACertificateName string `json:"CACertificateName" xml:"CACertificateName"` + Fingerprint string `json:"Fingerprint" xml:"Fingerprint"` + ResourceGroupId string `json:"ResourceGroupId" xml:"ResourceGroupId"` + CreateTime string `json:"CreateTime" xml:"CreateTime"` + CreateTimeStamp int64 `json:"CreateTimeStamp" xml:"CreateTimeStamp"` + ExpireTime string `json:"ExpireTime" xml:"ExpireTime"` + ExpireTimeStamp int64 `json:"ExpireTimeStamp" xml:"ExpireTimeStamp"` + CommonName string `json:"CommonName" xml:"CommonName"` +} + +// CreateUploadCACertificateRequest creates a request to invoke UploadCACertificate API +func CreateUploadCACertificateRequest() (request *UploadCACertificateRequest) { + request = &UploadCACertificateRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Slb", "2014-05-15", "UploadCACertificate", "slb", "openAPI") + return +} + +// CreateUploadCACertificateResponse creates a response to parse from UploadCACertificate response +func CreateUploadCACertificateResponse() (response *UploadCACertificateResponse) { + response = &UploadCACertificateResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/upload_server_certificate.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/upload_server_certificate.go new file mode 100644 index 0000000000..e6c2af8447 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/slb/upload_server_certificate.go @@ -0,0 +1,130 @@ +package slb + +//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" +) + +// UploadServerCertificate invokes the slb.UploadServerCertificate API synchronously +// api document: https://help.aliyun.com/api/slb/uploadservercertificate.html +func (client *Client) UploadServerCertificate(request *UploadServerCertificateRequest) (response *UploadServerCertificateResponse, err error) { + response = CreateUploadServerCertificateResponse() + err = client.DoAction(request, response) + return +} + +// UploadServerCertificateWithChan invokes the slb.UploadServerCertificate API asynchronously +// api document: https://help.aliyun.com/api/slb/uploadservercertificate.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) UploadServerCertificateWithChan(request *UploadServerCertificateRequest) (<-chan *UploadServerCertificateResponse, <-chan error) { + responseChan := make(chan *UploadServerCertificateResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.UploadServerCertificate(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// UploadServerCertificateWithCallback invokes the slb.UploadServerCertificate API asynchronously +// api document: https://help.aliyun.com/api/slb/uploadservercertificate.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) UploadServerCertificateWithCallback(request *UploadServerCertificateRequest, callback func(response *UploadServerCertificateResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *UploadServerCertificateResponse + var err error + defer close(result) + response, err = client.UploadServerCertificate(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// UploadServerCertificateRequest is the request struct for api UploadServerCertificate +type UploadServerCertificateRequest struct { + *requests.RpcRequest + AccessKeyId string `position:"Query" name:"access_key_id"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ServerCertificate string `position:"Query" name:"ServerCertificate"` + AliCloudCertificateName string `position:"Query" name:"AliCloudCertificateName"` + AliCloudCertificateId string `position:"Query" name:"AliCloudCertificateId"` + PrivateKey string `position:"Query" name:"PrivateKey"` + ResourceGroupId string `position:"Query" name:"ResourceGroupId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + Tags string `position:"Query" name:"Tags"` + AliCloudCertificateRegionId string `position:"Query" name:"AliCloudCertificateRegionId"` + ServerCertificateName string `position:"Query" name:"ServerCertificateName"` +} + +// UploadServerCertificateResponse is the response struct for api UploadServerCertificate +type UploadServerCertificateResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + ServerCertificateId string `json:"ServerCertificateId" xml:"ServerCertificateId"` + Fingerprint string `json:"Fingerprint" xml:"Fingerprint"` + ServerCertificateName string `json:"ServerCertificateName" xml:"ServerCertificateName"` + RegionId string `json:"RegionId" xml:"RegionId"` + RegionIdAlias string `json:"RegionIdAlias" xml:"RegionIdAlias"` + AliCloudCertificateId string `json:"AliCloudCertificateId" xml:"AliCloudCertificateId"` + AliCloudCertificateName string `json:"AliCloudCertificateName" xml:"AliCloudCertificateName"` + IsAliCloudCertificate int `json:"IsAliCloudCertificate" xml:"IsAliCloudCertificate"` + ResourceGroupId string `json:"ResourceGroupId" xml:"ResourceGroupId"` + CreateTime string `json:"CreateTime" xml:"CreateTime"` + CreateTimeStamp int64 `json:"CreateTimeStamp" xml:"CreateTimeStamp"` + ExpireTime string `json:"ExpireTime" xml:"ExpireTime"` + ExpireTimeStamp int64 `json:"ExpireTimeStamp" xml:"ExpireTimeStamp"` + CommonName string `json:"CommonName" xml:"CommonName"` + SubjectAlternativeNames SubjectAlternativeNamesInUploadServerCertificate `json:"SubjectAlternativeNames" xml:"SubjectAlternativeNames"` +} + +// CreateUploadServerCertificateRequest creates a request to invoke UploadServerCertificate API +func CreateUploadServerCertificateRequest() (request *UploadServerCertificateRequest) { + request = &UploadServerCertificateRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Slb", "2014-05-15", "UploadServerCertificate", "slb", "openAPI") + return +} + +// CreateUploadServerCertificateResponse creates a response to parse from UploadServerCertificate response +func CreateUploadServerCertificateResponse() (response *UploadServerCertificateResponse) { + response = &UploadServerCertificateResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/gopkg.in/ini.v1/.gitignore b/vendor/gopkg.in/ini.v1/.gitignore new file mode 100644 index 0000000000..12411127b3 --- /dev/null +++ b/vendor/gopkg.in/ini.v1/.gitignore @@ -0,0 +1,6 @@ +testdata/conf_out.ini +ini.sublime-project +ini.sublime-workspace +testdata/conf_reflect.ini +.idea +/.vscode diff --git a/vendor/gopkg.in/ini.v1/.travis.yml b/vendor/gopkg.in/ini.v1/.travis.yml new file mode 100644 index 0000000000..149b7249f6 --- /dev/null +++ b/vendor/gopkg.in/ini.v1/.travis.yml @@ -0,0 +1,20 @@ +sudo: false +language: go +go: + - 1.6.x + - 1.7.x + - 1.8.x + - 1.9.x + - 1.10.x + - 1.11.x + - 1.12.x + - 1.13.x + +install: skip +script: + - go get golang.org/x/tools/cmd/cover + - go get github.com/smartystreets/goconvey + - mkdir -p $HOME/gopath/src/gopkg.in + - ln -s $HOME/gopath/src/github.com/go-ini/ini $HOME/gopath/src/gopkg.in/ini.v1 + - cd $HOME/gopath/src/gopkg.in/ini.v1 + - go test -v -cover -race diff --git a/vendor/gopkg.in/ini.v1/BUILD.bazel b/vendor/gopkg.in/ini.v1/BUILD.bazel new file mode 100644 index 0000000000..b5107fbc18 --- /dev/null +++ b/vendor/gopkg.in/ini.v1/BUILD.bazel @@ -0,0 +1,20 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "go_default_library", + srcs = [ + "data_source.go", + "deprecated.go", + "error.go", + "file.go", + "helper.go", + "ini.go", + "key.go", + "parser.go", + "section.go", + "struct.go", + ], + importmap = "k8s.io/kops/vendor/gopkg.in/ini.v1", + importpath = "gopkg.in/ini.v1", + visibility = ["//visibility:public"], +) diff --git a/vendor/gopkg.in/ini.v1/LICENSE b/vendor/gopkg.in/ini.v1/LICENSE new file mode 100644 index 0000000000..d361bbcdf5 --- /dev/null +++ b/vendor/gopkg.in/ini.v1/LICENSE @@ -0,0 +1,191 @@ +Apache License +Version 2.0, January 2004 +http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + +"License" shall mean the terms and conditions for use, reproduction, and +distribution as defined by Sections 1 through 9 of this document. + +"Licensor" shall mean the copyright owner or entity authorized by the copyright +owner that is granting the License. + +"Legal Entity" shall mean the union of the acting entity and all other entities +that control, are controlled by, or are under common control with that entity. +For the purposes of this definition, "control" means (i) the power, direct or +indirect, to cause the direction or management of such entity, whether by +contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the +outstanding shares, or (iii) beneficial ownership of such entity. + +"You" (or "Your") shall mean an individual or Legal Entity exercising +permissions granted by this License. + +"Source" form shall mean the preferred form for making modifications, including +but not limited to software source code, documentation source, and configuration +files. + +"Object" form shall mean any form resulting from mechanical transformation or +translation of a Source form, including but not limited to compiled object code, +generated documentation, and conversions to other media types. + +"Work" shall mean the work of authorship, whether in Source or Object form, made +available under the License, as indicated by a copyright notice that is included +in or attached to the work (an example is provided in the Appendix below). + +"Derivative Works" shall mean any work, whether in Source or Object form, that +is based on (or derived from) the Work and for which the editorial revisions, +annotations, elaborations, or other modifications represent, as a whole, an +original work of authorship. For the purposes of this License, Derivative Works +shall not include works that remain separable from, or merely link (or bind by +name) to the interfaces of, the Work and Derivative Works thereof. + +"Contribution" shall mean any work of authorship, including the original version +of the Work and any modifications or additions to that Work or Derivative Works +thereof, that is intentionally submitted to Licensor for inclusion in the Work +by the copyright owner or by an individual or Legal Entity authorized to submit +on behalf of the copyright owner. For the purposes of this definition, +"submitted" means any form of electronic, verbal, or written communication sent +to the Licensor or its representatives, including but not limited to +communication on electronic mailing lists, source code control systems, and +issue tracking systems that are managed by, or on behalf of, the Licensor for +the purpose of discussing and improving the Work, but excluding communication +that is conspicuously marked or otherwise designated in writing by the copyright +owner as "Not a Contribution." + +"Contributor" shall mean Licensor and any individual or Legal Entity on behalf +of whom a Contribution has been received by Licensor and subsequently +incorporated within the Work. + +2. Grant of Copyright License. + +Subject to the terms and conditions of this License, each Contributor hereby +grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, +irrevocable copyright license to reproduce, prepare Derivative Works of, +publicly display, publicly perform, sublicense, and distribute the Work and such +Derivative Works in Source or Object form. + +3. Grant of Patent License. + +Subject to the terms and conditions of this License, each Contributor hereby +grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, +irrevocable (except as stated in this section) patent license to make, have +made, use, offer to sell, sell, import, and otherwise transfer the Work, where +such license applies only to those patent claims licensable by such Contributor +that are necessarily infringed by their Contribution(s) alone or by combination +of their Contribution(s) with the Work to which such Contribution(s) was +submitted. If You institute patent litigation against any entity (including a +cross-claim or counterclaim in a lawsuit) alleging that the Work or a +Contribution incorporated within the Work constitutes direct or contributory +patent infringement, then any patent licenses granted to You under this License +for that Work shall terminate as of the date such litigation is filed. + +4. Redistribution. + +You may reproduce and distribute copies of the Work or Derivative Works thereof +in any medium, with or without modifications, and in Source or Object form, +provided that You meet the following conditions: + +You must give any other recipients of the Work or Derivative Works a copy of +this License; and +You must cause any modified files to carry prominent notices stating that You +changed the files; and +You must retain, in the Source form of any Derivative Works that You distribute, +all copyright, patent, trademark, and attribution notices from the Source form +of the Work, excluding those notices that do not pertain to any part of the +Derivative Works; and +If the Work includes a "NOTICE" text file as part of its distribution, then any +Derivative Works that You distribute must include a readable copy of the +attribution notices contained within such NOTICE file, excluding those notices +that do not pertain to any part of the Derivative Works, in at least one of the +following places: within a NOTICE text file distributed as part of the +Derivative Works; within the Source form or documentation, if provided along +with the Derivative Works; or, within a display generated by the Derivative +Works, if and wherever such third-party notices normally appear. The contents of +the NOTICE file are for informational purposes only and do not modify the +License. You may add Your own attribution notices within Derivative Works that +You distribute, alongside or as an addendum to the NOTICE text from the Work, +provided that such additional attribution notices cannot be construed as +modifying the License. +You may add Your own copyright statement to Your modifications and may provide +additional or different license terms and conditions for use, reproduction, or +distribution of Your modifications, or for any such Derivative Works as a whole, +provided Your use, reproduction, and distribution of the Work otherwise complies +with the conditions stated in this License. + +5. Submission of Contributions. + +Unless You explicitly state otherwise, any Contribution intentionally submitted +for inclusion in the Work by You to the Licensor shall be under the terms and +conditions of this License, without any additional terms or conditions. +Notwithstanding the above, nothing herein shall supersede or modify the terms of +any separate license agreement you may have executed with Licensor regarding +such Contributions. + +6. Trademarks. + +This License does not grant permission to use the trade names, trademarks, +service marks, or product names of the Licensor, except as required for +reasonable and customary use in describing the origin of the Work and +reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. + +Unless required by applicable law or agreed to in writing, Licensor provides the +Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, +including, without limitation, any warranties or conditions of TITLE, +NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are +solely responsible for determining the appropriateness of using or +redistributing the Work and assume any risks associated with Your exercise of +permissions under this License. + +8. Limitation of Liability. + +In no event and under no legal theory, whether in tort (including negligence), +contract, or otherwise, unless required by applicable law (such as deliberate +and grossly negligent acts) or agreed to in writing, shall any Contributor be +liable to You for damages, including any direct, indirect, special, incidental, +or consequential damages of any character arising as a result of this License or +out of the use or inability to use the Work (including but not limited to +damages for loss of goodwill, work stoppage, computer failure or malfunction, or +any and all other commercial damages or losses), even if such Contributor has +been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. + +While redistributing the Work or Derivative Works thereof, You may choose to +offer, and charge a fee for, acceptance of support, warranty, indemnity, or +other liability obligations and/or rights consistent with this License. However, +in accepting such obligations, You may act only on Your own behalf and on Your +sole responsibility, not on behalf of any other Contributor, and only if You +agree to indemnify, defend, and hold each Contributor harmless for any liability +incurred by, or claims asserted against, such Contributor by reason of your +accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work + +To apply the Apache License to your work, attach the following boilerplate +notice, with the fields enclosed by brackets "[]" replaced with your own +identifying information. (Don't include the brackets!) The text should be +enclosed in the appropriate comment syntax for the file format. We also +recommend that a file or class name and description of purpose be included on +the same "printed page" as the copyright notice for easier identification within +third-party archives. + + Copyright 2014 Unknwon + + 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. diff --git a/vendor/gopkg.in/ini.v1/Makefile b/vendor/gopkg.in/ini.v1/Makefile new file mode 100644 index 0000000000..af27ff0768 --- /dev/null +++ b/vendor/gopkg.in/ini.v1/Makefile @@ -0,0 +1,15 @@ +.PHONY: build test bench vet coverage + +build: vet bench + +test: + go test -v -cover -race + +bench: + go test -v -cover -race -test.bench=. -test.benchmem + +vet: + go vet + +coverage: + go test -coverprofile=c.out && go tool cover -html=c.out && rm c.out diff --git a/vendor/gopkg.in/ini.v1/README.md b/vendor/gopkg.in/ini.v1/README.md new file mode 100644 index 0000000000..3d6d3cfc07 --- /dev/null +++ b/vendor/gopkg.in/ini.v1/README.md @@ -0,0 +1,39 @@ +# INI + +[![Build Status](https://img.shields.io/travis/go-ini/ini/master.svg?style=for-the-badge&logo=travis)](https://travis-ci.org/go-ini/ini) [![Sourcegraph](https://img.shields.io/badge/view%20on-Sourcegraph-brightgreen.svg?style=for-the-badge&logo=sourcegraph)](https://sourcegraph.com/github.com/go-ini/ini) + +![](https://avatars0.githubusercontent.com/u/10216035?v=3&s=200) + +Package ini provides INI file read and write functionality in Go. + +## Features + +- Load from multiple data sources(`[]byte`, file and `io.ReadCloser`) with overwrites. +- Read with recursion values. +- Read with parent-child sections. +- Read with auto-increment key names. +- Read with multiple-line values. +- Read with tons of helper methods. +- Read and convert values to Go types. +- Read and **WRITE** comments of sections and keys. +- Manipulate sections, keys and comments with ease. +- Keep sections and keys in order as you parse and save. + +## Installation + +The minimum requirement of Go is **1.6**. + +```sh +$ go get gopkg.in/ini.v1 +``` + +Please add `-u` flag to update in the future. + +## Getting Help + +- [Getting Started](https://ini.unknwon.io/docs/intro/getting_started) +- [API Documentation](https://gowalker.org/gopkg.in/ini.v1) + +## License + +This project is under Apache v2 License. See the [LICENSE](LICENSE) file for the full license text. diff --git a/vendor/gopkg.in/ini.v1/data_source.go b/vendor/gopkg.in/ini.v1/data_source.go new file mode 100644 index 0000000000..dc0277ec64 --- /dev/null +++ b/vendor/gopkg.in/ini.v1/data_source.go @@ -0,0 +1,74 @@ +// Copyright 2019 Unknwon +// +// 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. + +package ini + +import ( + "bytes" + "fmt" + "io" + "io/ioutil" + "os" +) + +var ( + _ dataSource = (*sourceFile)(nil) + _ dataSource = (*sourceData)(nil) + _ dataSource = (*sourceReadCloser)(nil) +) + +// dataSource is an interface that returns object which can be read and closed. +type dataSource interface { + ReadCloser() (io.ReadCloser, error) +} + +// sourceFile represents an object that contains content on the local file system. +type sourceFile struct { + name string +} + +func (s sourceFile) ReadCloser() (_ io.ReadCloser, err error) { + return os.Open(s.name) +} + +// sourceData represents an object that contains content in memory. +type sourceData struct { + data []byte +} + +func (s *sourceData) ReadCloser() (io.ReadCloser, error) { + return ioutil.NopCloser(bytes.NewReader(s.data)), nil +} + +// sourceReadCloser represents an input stream with Close method. +type sourceReadCloser struct { + reader io.ReadCloser +} + +func (s *sourceReadCloser) ReadCloser() (io.ReadCloser, error) { + return s.reader, nil +} + +func parseDataSource(source interface{}) (dataSource, error) { + switch s := source.(type) { + case string: + return sourceFile{s}, nil + case []byte: + return &sourceData{s}, nil + case io.ReadCloser: + return &sourceReadCloser{s}, nil + default: + return nil, fmt.Errorf("error parsing data source: unknown type %q", s) + } +} diff --git a/vendor/gopkg.in/ini.v1/deprecated.go b/vendor/gopkg.in/ini.v1/deprecated.go new file mode 100644 index 0000000000..e8bda06e6f --- /dev/null +++ b/vendor/gopkg.in/ini.v1/deprecated.go @@ -0,0 +1,25 @@ +// Copyright 2019 Unknwon +// +// 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. + +package ini + +const ( + // Deprecated: Use "DefaultSection" instead. + DEFAULT_SECTION = DefaultSection +) + +var ( + // Deprecated: AllCapsUnderscore converts to format ALL_CAPS_UNDERSCORE. + AllCapsUnderscore = SnackCase +) diff --git a/vendor/gopkg.in/ini.v1/error.go b/vendor/gopkg.in/ini.v1/error.go new file mode 100644 index 0000000000..d88347c54b --- /dev/null +++ b/vendor/gopkg.in/ini.v1/error.go @@ -0,0 +1,34 @@ +// Copyright 2016 Unknwon +// +// 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. + +package ini + +import ( + "fmt" +) + +// ErrDelimiterNotFound indicates the error type of no delimiter is found which there should be one. +type ErrDelimiterNotFound struct { + Line string +} + +// IsErrDelimiterNotFound returns true if the given error is an instance of ErrDelimiterNotFound. +func IsErrDelimiterNotFound(err error) bool { + _, ok := err.(ErrDelimiterNotFound) + return ok +} + +func (err ErrDelimiterNotFound) Error() string { + return fmt.Sprintf("key-value delimiter not found: %s", err.Line) +} diff --git a/vendor/gopkg.in/ini.v1/file.go b/vendor/gopkg.in/ini.v1/file.go new file mode 100644 index 0000000000..017b77c8be --- /dev/null +++ b/vendor/gopkg.in/ini.v1/file.go @@ -0,0 +1,418 @@ +// Copyright 2017 Unknwon +// +// 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. + +package ini + +import ( + "bytes" + "errors" + "fmt" + "io" + "io/ioutil" + "os" + "strings" + "sync" +) + +// File represents a combination of a or more INI file(s) in memory. +type File struct { + options LoadOptions + dataSources []dataSource + + // Should make things safe, but sometimes doesn't matter. + BlockMode bool + lock sync.RWMutex + + // To keep data in order. + sectionList []string + // Actual data is stored here. + sections map[string]*Section + + NameMapper + ValueMapper +} + +// newFile initializes File object with given data sources. +func newFile(dataSources []dataSource, opts LoadOptions) *File { + if len(opts.KeyValueDelimiters) == 0 { + opts.KeyValueDelimiters = "=:" + } + return &File{ + BlockMode: true, + dataSources: dataSources, + sections: make(map[string]*Section), + sectionList: make([]string, 0, 10), + options: opts, + } +} + +// Empty returns an empty file object. +func Empty() *File { + // Ignore error here, we sure our data is good. + f, _ := Load([]byte("")) + return f +} + +// NewSection creates a new section. +func (f *File) NewSection(name string) (*Section, error) { + if len(name) == 0 { + return nil, errors.New("error creating new section: empty section name") + } else if f.options.Insensitive && name != DefaultSection { + name = strings.ToLower(name) + } + + if f.BlockMode { + f.lock.Lock() + defer f.lock.Unlock() + } + + if inSlice(name, f.sectionList) { + return f.sections[name], nil + } + + f.sectionList = append(f.sectionList, name) + f.sections[name] = newSection(f, name) + return f.sections[name], nil +} + +// NewRawSection creates a new section with an unparseable body. +func (f *File) NewRawSection(name, body string) (*Section, error) { + section, err := f.NewSection(name) + if err != nil { + return nil, err + } + + section.isRawSection = true + section.rawBody = body + return section, nil +} + +// NewSections creates a list of sections. +func (f *File) NewSections(names ...string) (err error) { + for _, name := range names { + if _, err = f.NewSection(name); err != nil { + return err + } + } + return nil +} + +// GetSection returns section by given name. +func (f *File) GetSection(name string) (*Section, error) { + if len(name) == 0 { + name = DefaultSection + } + if f.options.Insensitive { + name = strings.ToLower(name) + } + + if f.BlockMode { + f.lock.RLock() + defer f.lock.RUnlock() + } + + sec := f.sections[name] + if sec == nil { + return nil, fmt.Errorf("section '%s' does not exist", name) + } + return sec, nil +} + +// Section assumes named section exists and returns a zero-value when not. +func (f *File) Section(name string) *Section { + sec, err := f.GetSection(name) + if err != nil { + // Note: It's OK here because the only possible error is empty section name, + // but if it's empty, this piece of code won't be executed. + sec, _ = f.NewSection(name) + return sec + } + return sec +} + +// Sections returns a list of Section stored in the current instance. +func (f *File) Sections() []*Section { + if f.BlockMode { + f.lock.RLock() + defer f.lock.RUnlock() + } + + sections := make([]*Section, len(f.sectionList)) + for i, name := range f.sectionList { + sections[i] = f.sections[name] + } + return sections +} + +// ChildSections returns a list of child sections of given section name. +func (f *File) ChildSections(name string) []*Section { + return f.Section(name).ChildSections() +} + +// SectionStrings returns list of section names. +func (f *File) SectionStrings() []string { + list := make([]string, len(f.sectionList)) + copy(list, f.sectionList) + return list +} + +// DeleteSection deletes a section. +func (f *File) DeleteSection(name string) { + if f.BlockMode { + f.lock.Lock() + defer f.lock.Unlock() + } + + if len(name) == 0 { + name = DefaultSection + } + + for i, s := range f.sectionList { + if s == name { + f.sectionList = append(f.sectionList[:i], f.sectionList[i+1:]...) + delete(f.sections, name) + return + } + } +} + +func (f *File) reload(s dataSource) error { + r, err := s.ReadCloser() + if err != nil { + return err + } + defer r.Close() + + return f.parse(r) +} + +// Reload reloads and parses all data sources. +func (f *File) Reload() (err error) { + for _, s := range f.dataSources { + if err = f.reload(s); err != nil { + // In loose mode, we create an empty default section for nonexistent files. + if os.IsNotExist(err) && f.options.Loose { + f.parse(bytes.NewBuffer(nil)) + continue + } + return err + } + } + return nil +} + +// Append appends one or more data sources and reloads automatically. +func (f *File) Append(source interface{}, others ...interface{}) error { + ds, err := parseDataSource(source) + if err != nil { + return err + } + f.dataSources = append(f.dataSources, ds) + for _, s := range others { + ds, err = parseDataSource(s) + if err != nil { + return err + } + f.dataSources = append(f.dataSources, ds) + } + return f.Reload() +} + +func (f *File) writeToBuffer(indent string) (*bytes.Buffer, error) { + equalSign := DefaultFormatLeft + "=" + DefaultFormatRight + + if PrettyFormat || PrettyEqual { + equalSign = " = " + } + + // Use buffer to make sure target is safe until finish encoding. + buf := bytes.NewBuffer(nil) + for i, sname := range f.sectionList { + sec := f.Section(sname) + if len(sec.Comment) > 0 { + // Support multiline comments + lines := strings.Split(sec.Comment, LineBreak) + for i := range lines { + if lines[i][0] != '#' && lines[i][0] != ';' { + lines[i] = "; " + lines[i] + } else { + lines[i] = lines[i][:1] + " " + strings.TrimSpace(lines[i][1:]) + } + + if _, err := buf.WriteString(lines[i] + LineBreak); err != nil { + return nil, err + } + } + } + + if i > 0 || DefaultHeader { + if _, err := buf.WriteString("[" + sname + "]" + LineBreak); err != nil { + return nil, err + } + } else { + // Write nothing if default section is empty + if len(sec.keyList) == 0 { + continue + } + } + + if sec.isRawSection { + if _, err := buf.WriteString(sec.rawBody); err != nil { + return nil, err + } + + if PrettySection { + // Put a line between sections + if _, err := buf.WriteString(LineBreak); err != nil { + return nil, err + } + } + continue + } + + // Count and generate alignment length and buffer spaces using the + // longest key. Keys may be modifed if they contain certain characters so + // we need to take that into account in our calculation. + alignLength := 0 + if PrettyFormat { + for _, kname := range sec.keyList { + keyLength := len(kname) + // First case will surround key by ` and second by """ + if strings.Contains(kname, "\"") || strings.ContainsAny(kname, f.options.KeyValueDelimiters) { + keyLength += 2 + } else if strings.Contains(kname, "`") { + keyLength += 6 + } + + if keyLength > alignLength { + alignLength = keyLength + } + } + } + alignSpaces := bytes.Repeat([]byte(" "), alignLength) + + KeyList: + for _, kname := range sec.keyList { + key := sec.Key(kname) + if len(key.Comment) > 0 { + if len(indent) > 0 && sname != DefaultSection { + buf.WriteString(indent) + } + + // Support multiline comments + lines := strings.Split(key.Comment, LineBreak) + for i := range lines { + if lines[i][0] != '#' && lines[i][0] != ';' { + lines[i] = "; " + strings.TrimSpace(lines[i]) + } else { + lines[i] = lines[i][:1] + " " + strings.TrimSpace(lines[i][1:]) + } + + if _, err := buf.WriteString(lines[i] + LineBreak); err != nil { + return nil, err + } + } + } + + if len(indent) > 0 && sname != DefaultSection { + buf.WriteString(indent) + } + + switch { + case key.isAutoIncrement: + kname = "-" + case strings.Contains(kname, "\"") || strings.ContainsAny(kname, f.options.KeyValueDelimiters): + kname = "`" + kname + "`" + case strings.Contains(kname, "`"): + kname = `"""` + kname + `"""` + } + + for _, val := range key.ValueWithShadows() { + if _, err := buf.WriteString(kname); err != nil { + return nil, err + } + + if key.isBooleanType { + if kname != sec.keyList[len(sec.keyList)-1] { + buf.WriteString(LineBreak) + } + continue KeyList + } + + // Write out alignment spaces before "=" sign + if PrettyFormat { + buf.Write(alignSpaces[:alignLength-len(kname)]) + } + + // In case key value contains "\n", "`", "\"", "#" or ";" + if strings.ContainsAny(val, "\n`") { + val = `"""` + val + `"""` + } else if !f.options.IgnoreInlineComment && strings.ContainsAny(val, "#;") { + val = "`" + val + "`" + } + if _, err := buf.WriteString(equalSign + val + LineBreak); err != nil { + return nil, err + } + } + + for _, val := range key.nestedValues { + if _, err := buf.WriteString(indent + " " + val + LineBreak); err != nil { + return nil, err + } + } + } + + if PrettySection { + // Put a line between sections + if _, err := buf.WriteString(LineBreak); err != nil { + return nil, err + } + } + } + + return buf, nil +} + +// WriteToIndent writes content into io.Writer with given indention. +// If PrettyFormat has been set to be true, +// it will align "=" sign with spaces under each section. +func (f *File) WriteToIndent(w io.Writer, indent string) (int64, error) { + buf, err := f.writeToBuffer(indent) + if err != nil { + return 0, err + } + return buf.WriteTo(w) +} + +// WriteTo writes file content into io.Writer. +func (f *File) WriteTo(w io.Writer) (int64, error) { + return f.WriteToIndent(w, "") +} + +// SaveToIndent writes content to file system with given value indention. +func (f *File) SaveToIndent(filename, indent string) error { + // Note: Because we are truncating with os.Create, + // so it's safer to save to a temporary file location and rename afte done. + buf, err := f.writeToBuffer(indent) + if err != nil { + return err + } + + return ioutil.WriteFile(filename, buf.Bytes(), 0666) +} + +// SaveTo writes content to file system. +func (f *File) SaveTo(filename string) error { + return f.SaveToIndent(filename, "") +} diff --git a/vendor/gopkg.in/ini.v1/helper.go b/vendor/gopkg.in/ini.v1/helper.go new file mode 100644 index 0000000000..f9d80a682a --- /dev/null +++ b/vendor/gopkg.in/ini.v1/helper.go @@ -0,0 +1,24 @@ +// Copyright 2019 Unknwon +// +// 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. + +package ini + +func inSlice(str string, s []string) bool { + for _, v := range s { + if str == v { + return true + } + } + return false +} diff --git a/vendor/gopkg.in/ini.v1/ini.go b/vendor/gopkg.in/ini.v1/ini.go new file mode 100644 index 0000000000..945fc00c0f --- /dev/null +++ b/vendor/gopkg.in/ini.v1/ini.go @@ -0,0 +1,166 @@ +// +build go1.6 + +// Copyright 2014 Unknwon +// +// 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. + +// Package ini provides INI file read and write functionality in Go. +package ini + +import ( + "regexp" + "runtime" +) + +const ( + // DefaultSection is the name of default section. You can use this constant or the string literal. + // In most of cases, an empty string is all you need to access the section. + DefaultSection = "DEFAULT" + + // Maximum allowed depth when recursively substituing variable names. + depthValues = 99 + version = "1.51.0" +) + +// Version returns current package version literal. +func Version() string { + return version +} + +var ( + // LineBreak is the delimiter to determine or compose a new line. + // This variable will be changed to "\r\n" automatically on Windows at package init time. + LineBreak = "\n" + + // Variable regexp pattern: %(variable)s + varPattern = regexp.MustCompile(`%\(([^)]+)\)s`) + + // DefaultHeader explicitly writes default section header. + DefaultHeader = false + + // PrettySection indicates whether to put a line between sections. + PrettySection = true + // PrettyFormat indicates whether to align "=" sign with spaces to produce pretty output + // or reduce all possible spaces for compact format. + PrettyFormat = true + // PrettyEqual places spaces around "=" sign even when PrettyFormat is false. + PrettyEqual = false + // DefaultFormatLeft places custom spaces on the left when PrettyFormat and PrettyEqual are both disabled. + DefaultFormatLeft = "" + // DefaultFormatRight places custom spaces on the right when PrettyFormat and PrettyEqual are both disabled. + DefaultFormatRight = "" +) + +func init() { + if runtime.GOOS == "windows" { + LineBreak = "\r\n" + } +} + +// LoadOptions contains all customized options used for load data source(s). +type LoadOptions struct { + // Loose indicates whether the parser should ignore nonexistent files or return error. + Loose bool + // Insensitive indicates whether the parser forces all section and key names to lowercase. + Insensitive bool + // IgnoreContinuation indicates whether to ignore continuation lines while parsing. + IgnoreContinuation bool + // IgnoreInlineComment indicates whether to ignore comments at the end of value and treat it as part of value. + IgnoreInlineComment bool + // SkipUnrecognizableLines indicates whether to skip unrecognizable lines that do not conform to key/value pairs. + SkipUnrecognizableLines bool + // AllowBooleanKeys indicates whether to allow boolean type keys or treat as value is missing. + // This type of keys are mostly used in my.cnf. + AllowBooleanKeys bool + // AllowShadows indicates whether to keep track of keys with same name under same section. + AllowShadows bool + // AllowNestedValues indicates whether to allow AWS-like nested values. + // Docs: http://docs.aws.amazon.com/cli/latest/topic/config-vars.html#nested-values + AllowNestedValues bool + // AllowPythonMultilineValues indicates whether to allow Python-like multi-line values. + // Docs: https://docs.python.org/3/library/configparser.html#supported-ini-file-structure + // Relevant quote: Values can also span multiple lines, as long as they are indented deeper + // than the first line of the value. + AllowPythonMultilineValues bool + // SpaceBeforeInlineComment indicates whether to allow comment symbols (\# and \;) inside value. + // Docs: https://docs.python.org/2/library/configparser.html + // Quote: Comments may appear on their own in an otherwise empty line, or may be entered in lines holding values or section names. + // In the latter case, they need to be preceded by a whitespace character to be recognized as a comment. + SpaceBeforeInlineComment bool + // UnescapeValueDoubleQuotes indicates whether to unescape double quotes inside value to regular format + // when value is surrounded by double quotes, e.g. key="a \"value\"" => key=a "value" + UnescapeValueDoubleQuotes bool + // UnescapeValueCommentSymbols indicates to unescape comment symbols (\# and \;) inside value to regular format + // when value is NOT surrounded by any quotes. + // Note: UNSTABLE, behavior might change to only unescape inside double quotes but may noy necessary at all. + UnescapeValueCommentSymbols bool + // UnparseableSections stores a list of blocks that are allowed with raw content which do not otherwise + // conform to key/value pairs. Specify the names of those blocks here. + UnparseableSections []string + // KeyValueDelimiters is the sequence of delimiters that are used to separate key and value. By default, it is "=:". + KeyValueDelimiters string + // PreserveSurroundedQuote indicates whether to preserve surrounded quote (single and double quotes). + PreserveSurroundedQuote bool + // DebugFunc is called to collect debug information (currently only useful to debug parsing Python-style multiline values). + DebugFunc DebugFunc + // ReaderBufferSize is the buffer size of the reader in bytes. + ReaderBufferSize int +} + +// DebugFunc is the type of function called to log parse events. +type DebugFunc func(message string) + +// LoadSources allows caller to apply customized options for loading from data source(s). +func LoadSources(opts LoadOptions, source interface{}, others ...interface{}) (_ *File, err error) { + sources := make([]dataSource, len(others)+1) + sources[0], err = parseDataSource(source) + if err != nil { + return nil, err + } + for i := range others { + sources[i+1], err = parseDataSource(others[i]) + if err != nil { + return nil, err + } + } + f := newFile(sources, opts) + if err = f.Reload(); err != nil { + return nil, err + } + return f, nil +} + +// Load loads and parses from INI data sources. +// Arguments can be mixed of file name with string type, or raw data in []byte. +// It will return error if list contains nonexistent files. +func Load(source interface{}, others ...interface{}) (*File, error) { + return LoadSources(LoadOptions{}, source, others...) +} + +// LooseLoad has exactly same functionality as Load function +// except it ignores nonexistent files instead of returning error. +func LooseLoad(source interface{}, others ...interface{}) (*File, error) { + return LoadSources(LoadOptions{Loose: true}, source, others...) +} + +// InsensitiveLoad has exactly same functionality as Load function +// except it forces all section and key names to be lowercased. +func InsensitiveLoad(source interface{}, others ...interface{}) (*File, error) { + return LoadSources(LoadOptions{Insensitive: true}, source, others...) +} + +// ShadowLoad has exactly same functionality as Load function +// except it allows have shadow keys. +func ShadowLoad(source interface{}, others ...interface{}) (*File, error) { + return LoadSources(LoadOptions{AllowShadows: true}, source, others...) +} diff --git a/vendor/gopkg.in/ini.v1/key.go b/vendor/gopkg.in/ini.v1/key.go new file mode 100644 index 0000000000..3c197410fa --- /dev/null +++ b/vendor/gopkg.in/ini.v1/key.go @@ -0,0 +1,801 @@ +// Copyright 2014 Unknwon +// +// 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. + +package ini + +import ( + "bytes" + "errors" + "fmt" + "strconv" + "strings" + "time" +) + +// Key represents a key under a section. +type Key struct { + s *Section + Comment string + name string + value string + isAutoIncrement bool + isBooleanType bool + + isShadow bool + shadows []*Key + + nestedValues []string +} + +// newKey simply return a key object with given values. +func newKey(s *Section, name, val string) *Key { + return &Key{ + s: s, + name: name, + value: val, + } +} + +func (k *Key) addShadow(val string) error { + if k.isShadow { + return errors.New("cannot add shadow to another shadow key") + } else if k.isAutoIncrement || k.isBooleanType { + return errors.New("cannot add shadow to auto-increment or boolean key") + } + + // Deduplicate shadows based on their values. + if k.value == val { + return nil + } + for i := range k.shadows { + if k.shadows[i].value == val { + return nil + } + } + + shadow := newKey(k.s, k.name, val) + shadow.isShadow = true + k.shadows = append(k.shadows, shadow) + return nil +} + +// AddShadow adds a new shadow key to itself. +func (k *Key) AddShadow(val string) error { + if !k.s.f.options.AllowShadows { + return errors.New("shadow key is not allowed") + } + return k.addShadow(val) +} + +func (k *Key) addNestedValue(val string) error { + if k.isAutoIncrement || k.isBooleanType { + return errors.New("cannot add nested value to auto-increment or boolean key") + } + + k.nestedValues = append(k.nestedValues, val) + return nil +} + +// AddNestedValue adds a nested value to the key. +func (k *Key) AddNestedValue(val string) error { + if !k.s.f.options.AllowNestedValues { + return errors.New("nested value is not allowed") + } + return k.addNestedValue(val) +} + +// ValueMapper represents a mapping function for values, e.g. os.ExpandEnv +type ValueMapper func(string) string + +// Name returns name of key. +func (k *Key) Name() string { + return k.name +} + +// Value returns raw value of key for performance purpose. +func (k *Key) Value() string { + return k.value +} + +// ValueWithShadows returns raw values of key and its shadows if any. +func (k *Key) ValueWithShadows() []string { + if len(k.shadows) == 0 { + return []string{k.value} + } + vals := make([]string, len(k.shadows)+1) + vals[0] = k.value + for i := range k.shadows { + vals[i+1] = k.shadows[i].value + } + return vals +} + +// NestedValues returns nested values stored in the key. +// It is possible returned value is nil if no nested values stored in the key. +func (k *Key) NestedValues() []string { + return k.nestedValues +} + +// transformValue takes a raw value and transforms to its final string. +func (k *Key) transformValue(val string) string { + if k.s.f.ValueMapper != nil { + val = k.s.f.ValueMapper(val) + } + + // Fail-fast if no indicate char found for recursive value + if !strings.Contains(val, "%") { + return val + } + for i := 0; i < depthValues; i++ { + vr := varPattern.FindString(val) + if len(vr) == 0 { + break + } + + // Take off leading '%(' and trailing ')s'. + noption := vr[2 : len(vr)-2] + + // Search in the same section. + // If not found or found the key itself, then search again in default section. + nk, err := k.s.GetKey(noption) + if err != nil || k == nk { + nk, _ = k.s.f.Section("").GetKey(noption) + if nk == nil { + // Stop when no results found in the default section, + // and returns the value as-is. + break + } + } + + // Substitute by new value and take off leading '%(' and trailing ')s'. + val = strings.Replace(val, vr, nk.value, -1) + } + return val +} + +// String returns string representation of value. +func (k *Key) String() string { + return k.transformValue(k.value) +} + +// Validate accepts a validate function which can +// return modifed result as key value. +func (k *Key) Validate(fn func(string) string) string { + return fn(k.String()) +} + +// parseBool returns the boolean value represented by the string. +// +// It accepts 1, t, T, TRUE, true, True, YES, yes, Yes, y, ON, on, On, +// 0, f, F, FALSE, false, False, NO, no, No, n, OFF, off, Off. +// Any other value returns an error. +func parseBool(str string) (value bool, err error) { + switch str { + case "1", "t", "T", "true", "TRUE", "True", "YES", "yes", "Yes", "y", "ON", "on", "On": + return true, nil + case "0", "f", "F", "false", "FALSE", "False", "NO", "no", "No", "n", "OFF", "off", "Off": + return false, nil + } + return false, fmt.Errorf("parsing \"%s\": invalid syntax", str) +} + +// Bool returns bool type value. +func (k *Key) Bool() (bool, error) { + return parseBool(k.String()) +} + +// Float64 returns float64 type value. +func (k *Key) Float64() (float64, error) { + return strconv.ParseFloat(k.String(), 64) +} + +// Int returns int type value. +func (k *Key) Int() (int, error) { + v, err := strconv.ParseInt(k.String(), 0, 64) + return int(v), err +} + +// Int64 returns int64 type value. +func (k *Key) Int64() (int64, error) { + return strconv.ParseInt(k.String(), 0, 64) +} + +// Uint returns uint type valued. +func (k *Key) Uint() (uint, error) { + u, e := strconv.ParseUint(k.String(), 0, 64) + return uint(u), e +} + +// Uint64 returns uint64 type value. +func (k *Key) Uint64() (uint64, error) { + return strconv.ParseUint(k.String(), 0, 64) +} + +// Duration returns time.Duration type value. +func (k *Key) Duration() (time.Duration, error) { + return time.ParseDuration(k.String()) +} + +// TimeFormat parses with given format and returns time.Time type value. +func (k *Key) TimeFormat(format string) (time.Time, error) { + return time.Parse(format, k.String()) +} + +// Time parses with RFC3339 format and returns time.Time type value. +func (k *Key) Time() (time.Time, error) { + return k.TimeFormat(time.RFC3339) +} + +// MustString returns default value if key value is empty. +func (k *Key) MustString(defaultVal string) string { + val := k.String() + if len(val) == 0 { + k.value = defaultVal + return defaultVal + } + return val +} + +// MustBool always returns value without error, +// it returns false if error occurs. +func (k *Key) MustBool(defaultVal ...bool) bool { + val, err := k.Bool() + if len(defaultVal) > 0 && err != nil { + k.value = strconv.FormatBool(defaultVal[0]) + return defaultVal[0] + } + return val +} + +// MustFloat64 always returns value without error, +// it returns 0.0 if error occurs. +func (k *Key) MustFloat64(defaultVal ...float64) float64 { + val, err := k.Float64() + if len(defaultVal) > 0 && err != nil { + k.value = strconv.FormatFloat(defaultVal[0], 'f', -1, 64) + return defaultVal[0] + } + return val +} + +// MustInt always returns value without error, +// it returns 0 if error occurs. +func (k *Key) MustInt(defaultVal ...int) int { + val, err := k.Int() + if len(defaultVal) > 0 && err != nil { + k.value = strconv.FormatInt(int64(defaultVal[0]), 10) + return defaultVal[0] + } + return val +} + +// MustInt64 always returns value without error, +// it returns 0 if error occurs. +func (k *Key) MustInt64(defaultVal ...int64) int64 { + val, err := k.Int64() + if len(defaultVal) > 0 && err != nil { + k.value = strconv.FormatInt(defaultVal[0], 10) + return defaultVal[0] + } + return val +} + +// MustUint always returns value without error, +// it returns 0 if error occurs. +func (k *Key) MustUint(defaultVal ...uint) uint { + val, err := k.Uint() + if len(defaultVal) > 0 && err != nil { + k.value = strconv.FormatUint(uint64(defaultVal[0]), 10) + return defaultVal[0] + } + return val +} + +// MustUint64 always returns value without error, +// it returns 0 if error occurs. +func (k *Key) MustUint64(defaultVal ...uint64) uint64 { + val, err := k.Uint64() + if len(defaultVal) > 0 && err != nil { + k.value = strconv.FormatUint(defaultVal[0], 10) + return defaultVal[0] + } + return val +} + +// MustDuration always returns value without error, +// it returns zero value if error occurs. +func (k *Key) MustDuration(defaultVal ...time.Duration) time.Duration { + val, err := k.Duration() + if len(defaultVal) > 0 && err != nil { + k.value = defaultVal[0].String() + return defaultVal[0] + } + return val +} + +// MustTimeFormat always parses with given format and returns value without error, +// it returns zero value if error occurs. +func (k *Key) MustTimeFormat(format string, defaultVal ...time.Time) time.Time { + val, err := k.TimeFormat(format) + if len(defaultVal) > 0 && err != nil { + k.value = defaultVal[0].Format(format) + return defaultVal[0] + } + return val +} + +// MustTime always parses with RFC3339 format and returns value without error, +// it returns zero value if error occurs. +func (k *Key) MustTime(defaultVal ...time.Time) time.Time { + return k.MustTimeFormat(time.RFC3339, defaultVal...) +} + +// In always returns value without error, +// it returns default value if error occurs or doesn't fit into candidates. +func (k *Key) In(defaultVal string, candidates []string) string { + val := k.String() + for _, cand := range candidates { + if val == cand { + return val + } + } + return defaultVal +} + +// InFloat64 always returns value without error, +// it returns default value if error occurs or doesn't fit into candidates. +func (k *Key) InFloat64(defaultVal float64, candidates []float64) float64 { + val := k.MustFloat64() + for _, cand := range candidates { + if val == cand { + return val + } + } + return defaultVal +} + +// InInt always returns value without error, +// it returns default value if error occurs or doesn't fit into candidates. +func (k *Key) InInt(defaultVal int, candidates []int) int { + val := k.MustInt() + for _, cand := range candidates { + if val == cand { + return val + } + } + return defaultVal +} + +// InInt64 always returns value without error, +// it returns default value if error occurs or doesn't fit into candidates. +func (k *Key) InInt64(defaultVal int64, candidates []int64) int64 { + val := k.MustInt64() + for _, cand := range candidates { + if val == cand { + return val + } + } + return defaultVal +} + +// InUint always returns value without error, +// it returns default value if error occurs or doesn't fit into candidates. +func (k *Key) InUint(defaultVal uint, candidates []uint) uint { + val := k.MustUint() + for _, cand := range candidates { + if val == cand { + return val + } + } + return defaultVal +} + +// InUint64 always returns value without error, +// it returns default value if error occurs or doesn't fit into candidates. +func (k *Key) InUint64(defaultVal uint64, candidates []uint64) uint64 { + val := k.MustUint64() + for _, cand := range candidates { + if val == cand { + return val + } + } + return defaultVal +} + +// InTimeFormat always parses with given format and returns value without error, +// it returns default value if error occurs or doesn't fit into candidates. +func (k *Key) InTimeFormat(format string, defaultVal time.Time, candidates []time.Time) time.Time { + val := k.MustTimeFormat(format) + for _, cand := range candidates { + if val == cand { + return val + } + } + return defaultVal +} + +// InTime always parses with RFC3339 format and returns value without error, +// it returns default value if error occurs or doesn't fit into candidates. +func (k *Key) InTime(defaultVal time.Time, candidates []time.Time) time.Time { + return k.InTimeFormat(time.RFC3339, defaultVal, candidates) +} + +// RangeFloat64 checks if value is in given range inclusively, +// and returns default value if it's not. +func (k *Key) RangeFloat64(defaultVal, min, max float64) float64 { + val := k.MustFloat64() + if val < min || val > max { + return defaultVal + } + return val +} + +// RangeInt checks if value is in given range inclusively, +// and returns default value if it's not. +func (k *Key) RangeInt(defaultVal, min, max int) int { + val := k.MustInt() + if val < min || val > max { + return defaultVal + } + return val +} + +// RangeInt64 checks if value is in given range inclusively, +// and returns default value if it's not. +func (k *Key) RangeInt64(defaultVal, min, max int64) int64 { + val := k.MustInt64() + if val < min || val > max { + return defaultVal + } + return val +} + +// RangeTimeFormat checks if value with given format is in given range inclusively, +// and returns default value if it's not. +func (k *Key) RangeTimeFormat(format string, defaultVal, min, max time.Time) time.Time { + val := k.MustTimeFormat(format) + if val.Unix() < min.Unix() || val.Unix() > max.Unix() { + return defaultVal + } + return val +} + +// RangeTime checks if value with RFC3339 format is in given range inclusively, +// and returns default value if it's not. +func (k *Key) RangeTime(defaultVal, min, max time.Time) time.Time { + return k.RangeTimeFormat(time.RFC3339, defaultVal, min, max) +} + +// Strings returns list of string divided by given delimiter. +func (k *Key) Strings(delim string) []string { + str := k.String() + if len(str) == 0 { + return []string{} + } + + runes := []rune(str) + vals := make([]string, 0, 2) + var buf bytes.Buffer + escape := false + idx := 0 + for { + if escape { + escape = false + if runes[idx] != '\\' && !strings.HasPrefix(string(runes[idx:]), delim) { + buf.WriteRune('\\') + } + buf.WriteRune(runes[idx]) + } else { + if runes[idx] == '\\' { + escape = true + } else if strings.HasPrefix(string(runes[idx:]), delim) { + idx += len(delim) - 1 + vals = append(vals, strings.TrimSpace(buf.String())) + buf.Reset() + } else { + buf.WriteRune(runes[idx]) + } + } + idx++ + if idx == len(runes) { + break + } + } + + if buf.Len() > 0 { + vals = append(vals, strings.TrimSpace(buf.String())) + } + + return vals +} + +// StringsWithShadows returns list of string divided by given delimiter. +// Shadows will also be appended if any. +func (k *Key) StringsWithShadows(delim string) []string { + vals := k.ValueWithShadows() + results := make([]string, 0, len(vals)*2) + for i := range vals { + if len(vals) == 0 { + continue + } + + results = append(results, strings.Split(vals[i], delim)...) + } + + for i := range results { + results[i] = k.transformValue(strings.TrimSpace(results[i])) + } + return results +} + +// Float64s returns list of float64 divided by given delimiter. Any invalid input will be treated as zero value. +func (k *Key) Float64s(delim string) []float64 { + vals, _ := k.parseFloat64s(k.Strings(delim), true, false) + return vals +} + +// Ints returns list of int divided by given delimiter. Any invalid input will be treated as zero value. +func (k *Key) Ints(delim string) []int { + vals, _ := k.parseInts(k.Strings(delim), true, false) + return vals +} + +// Int64s returns list of int64 divided by given delimiter. Any invalid input will be treated as zero value. +func (k *Key) Int64s(delim string) []int64 { + vals, _ := k.parseInt64s(k.Strings(delim), true, false) + return vals +} + +// Uints returns list of uint divided by given delimiter. Any invalid input will be treated as zero value. +func (k *Key) Uints(delim string) []uint { + vals, _ := k.parseUints(k.Strings(delim), true, false) + return vals +} + +// Uint64s returns list of uint64 divided by given delimiter. Any invalid input will be treated as zero value. +func (k *Key) Uint64s(delim string) []uint64 { + vals, _ := k.parseUint64s(k.Strings(delim), true, false) + return vals +} + +// Bools returns list of bool divided by given delimiter. Any invalid input will be treated as zero value. +func (k *Key) Bools(delim string) []bool { + vals, _ := k.parseBools(k.Strings(delim), true, false) + return vals +} + +// TimesFormat parses with given format and returns list of time.Time divided by given delimiter. +// Any invalid input will be treated as zero value (0001-01-01 00:00:00 +0000 UTC). +func (k *Key) TimesFormat(format, delim string) []time.Time { + vals, _ := k.parseTimesFormat(format, k.Strings(delim), true, false) + return vals +} + +// Times parses with RFC3339 format and returns list of time.Time divided by given delimiter. +// Any invalid input will be treated as zero value (0001-01-01 00:00:00 +0000 UTC). +func (k *Key) Times(delim string) []time.Time { + return k.TimesFormat(time.RFC3339, delim) +} + +// ValidFloat64s returns list of float64 divided by given delimiter. If some value is not float, then +// it will not be included to result list. +func (k *Key) ValidFloat64s(delim string) []float64 { + vals, _ := k.parseFloat64s(k.Strings(delim), false, false) + return vals +} + +// ValidInts returns list of int divided by given delimiter. If some value is not integer, then it will +// not be included to result list. +func (k *Key) ValidInts(delim string) []int { + vals, _ := k.parseInts(k.Strings(delim), false, false) + return vals +} + +// ValidInt64s returns list of int64 divided by given delimiter. If some value is not 64-bit integer, +// then it will not be included to result list. +func (k *Key) ValidInt64s(delim string) []int64 { + vals, _ := k.parseInt64s(k.Strings(delim), false, false) + return vals +} + +// ValidUints returns list of uint divided by given delimiter. If some value is not unsigned integer, +// then it will not be included to result list. +func (k *Key) ValidUints(delim string) []uint { + vals, _ := k.parseUints(k.Strings(delim), false, false) + return vals +} + +// ValidUint64s returns list of uint64 divided by given delimiter. If some value is not 64-bit unsigned +// integer, then it will not be included to result list. +func (k *Key) ValidUint64s(delim string) []uint64 { + vals, _ := k.parseUint64s(k.Strings(delim), false, false) + return vals +} + +// ValidBools returns list of bool divided by given delimiter. If some value is not 64-bit unsigned +// integer, then it will not be included to result list. +func (k *Key) ValidBools(delim string) []bool { + vals, _ := k.parseBools(k.Strings(delim), false, false) + return vals +} + +// ValidTimesFormat parses with given format and returns list of time.Time divided by given delimiter. +func (k *Key) ValidTimesFormat(format, delim string) []time.Time { + vals, _ := k.parseTimesFormat(format, k.Strings(delim), false, false) + return vals +} + +// ValidTimes parses with RFC3339 format and returns list of time.Time divided by given delimiter. +func (k *Key) ValidTimes(delim string) []time.Time { + return k.ValidTimesFormat(time.RFC3339, delim) +} + +// StrictFloat64s returns list of float64 divided by given delimiter or error on first invalid input. +func (k *Key) StrictFloat64s(delim string) ([]float64, error) { + return k.parseFloat64s(k.Strings(delim), false, true) +} + +// StrictInts returns list of int divided by given delimiter or error on first invalid input. +func (k *Key) StrictInts(delim string) ([]int, error) { + return k.parseInts(k.Strings(delim), false, true) +} + +// StrictInt64s returns list of int64 divided by given delimiter or error on first invalid input. +func (k *Key) StrictInt64s(delim string) ([]int64, error) { + return k.parseInt64s(k.Strings(delim), false, true) +} + +// StrictUints returns list of uint divided by given delimiter or error on first invalid input. +func (k *Key) StrictUints(delim string) ([]uint, error) { + return k.parseUints(k.Strings(delim), false, true) +} + +// StrictUint64s returns list of uint64 divided by given delimiter or error on first invalid input. +func (k *Key) StrictUint64s(delim string) ([]uint64, error) { + return k.parseUint64s(k.Strings(delim), false, true) +} + +// StrictBools returns list of bool divided by given delimiter or error on first invalid input. +func (k *Key) StrictBools(delim string) ([]bool, error) { + return k.parseBools(k.Strings(delim), false, true) +} + +// StrictTimesFormat parses with given format and returns list of time.Time divided by given delimiter +// or error on first invalid input. +func (k *Key) StrictTimesFormat(format, delim string) ([]time.Time, error) { + return k.parseTimesFormat(format, k.Strings(delim), false, true) +} + +// StrictTimes parses with RFC3339 format and returns list of time.Time divided by given delimiter +// or error on first invalid input. +func (k *Key) StrictTimes(delim string) ([]time.Time, error) { + return k.StrictTimesFormat(time.RFC3339, delim) +} + +// parseBools transforms strings to bools. +func (k *Key) parseBools(strs []string, addInvalid, returnOnInvalid bool) ([]bool, error) { + vals := make([]bool, 0, len(strs)) + for _, str := range strs { + val, err := parseBool(str) + if err != nil && returnOnInvalid { + return nil, err + } + if err == nil || addInvalid { + vals = append(vals, val) + } + } + return vals, nil +} + +// parseFloat64s transforms strings to float64s. +func (k *Key) parseFloat64s(strs []string, addInvalid, returnOnInvalid bool) ([]float64, error) { + vals := make([]float64, 0, len(strs)) + for _, str := range strs { + val, err := strconv.ParseFloat(str, 64) + if err != nil && returnOnInvalid { + return nil, err + } + if err == nil || addInvalid { + vals = append(vals, val) + } + } + return vals, nil +} + +// parseInts transforms strings to ints. +func (k *Key) parseInts(strs []string, addInvalid, returnOnInvalid bool) ([]int, error) { + vals := make([]int, 0, len(strs)) + for _, str := range strs { + valInt64, err := strconv.ParseInt(str, 0, 64) + val := int(valInt64) + if err != nil && returnOnInvalid { + return nil, err + } + if err == nil || addInvalid { + vals = append(vals, val) + } + } + return vals, nil +} + +// parseInt64s transforms strings to int64s. +func (k *Key) parseInt64s(strs []string, addInvalid, returnOnInvalid bool) ([]int64, error) { + vals := make([]int64, 0, len(strs)) + for _, str := range strs { + val, err := strconv.ParseInt(str, 0, 64) + if err != nil && returnOnInvalid { + return nil, err + } + if err == nil || addInvalid { + vals = append(vals, val) + } + } + return vals, nil +} + +// parseUints transforms strings to uints. +func (k *Key) parseUints(strs []string, addInvalid, returnOnInvalid bool) ([]uint, error) { + vals := make([]uint, 0, len(strs)) + for _, str := range strs { + val, err := strconv.ParseUint(str, 0, 0) + if err != nil && returnOnInvalid { + return nil, err + } + if err == nil || addInvalid { + vals = append(vals, uint(val)) + } + } + return vals, nil +} + +// parseUint64s transforms strings to uint64s. +func (k *Key) parseUint64s(strs []string, addInvalid, returnOnInvalid bool) ([]uint64, error) { + vals := make([]uint64, 0, len(strs)) + for _, str := range strs { + val, err := strconv.ParseUint(str, 0, 64) + if err != nil && returnOnInvalid { + return nil, err + } + if err == nil || addInvalid { + vals = append(vals, val) + } + } + return vals, nil +} + +// parseTimesFormat transforms strings to times in given format. +func (k *Key) parseTimesFormat(format string, strs []string, addInvalid, returnOnInvalid bool) ([]time.Time, error) { + vals := make([]time.Time, 0, len(strs)) + for _, str := range strs { + val, err := time.Parse(format, str) + if err != nil && returnOnInvalid { + return nil, err + } + if err == nil || addInvalid { + vals = append(vals, val) + } + } + return vals, nil +} + +// SetValue changes key value. +func (k *Key) SetValue(v string) { + if k.s.f.BlockMode { + k.s.f.lock.Lock() + defer k.s.f.lock.Unlock() + } + + k.value = v + k.s.keysHash[k.name] = v +} diff --git a/vendor/gopkg.in/ini.v1/parser.go b/vendor/gopkg.in/ini.v1/parser.go new file mode 100644 index 0000000000..53ab45c46f --- /dev/null +++ b/vendor/gopkg.in/ini.v1/parser.go @@ -0,0 +1,526 @@ +// Copyright 2015 Unknwon +// +// 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. + +package ini + +import ( + "bufio" + "bytes" + "fmt" + "io" + "regexp" + "strconv" + "strings" + "unicode" +) + +const minReaderBufferSize = 4096 + +var pythonMultiline = regexp.MustCompile(`^([\t\f ]+)(.*)`) + +type parserOptions struct { + IgnoreContinuation bool + IgnoreInlineComment bool + AllowPythonMultilineValues bool + SpaceBeforeInlineComment bool + UnescapeValueDoubleQuotes bool + UnescapeValueCommentSymbols bool + PreserveSurroundedQuote bool + DebugFunc DebugFunc + ReaderBufferSize int +} + +type parser struct { + buf *bufio.Reader + options parserOptions + + isEOF bool + count int + comment *bytes.Buffer +} + +func (p *parser) debug(format string, args ...interface{}) { + if p.options.DebugFunc != nil { + p.options.DebugFunc(fmt.Sprintf(format, args...)) + } +} + +func newParser(r io.Reader, opts parserOptions) *parser { + size := opts.ReaderBufferSize + if size < minReaderBufferSize { + size = minReaderBufferSize + } + + return &parser{ + buf: bufio.NewReaderSize(r, size), + options: opts, + count: 1, + comment: &bytes.Buffer{}, + } +} + +// BOM handles header of UTF-8, UTF-16 LE and UTF-16 BE's BOM format. +// http://en.wikipedia.org/wiki/Byte_order_mark#Representations_of_byte_order_marks_by_encoding +func (p *parser) BOM() error { + mask, err := p.buf.Peek(2) + if err != nil && err != io.EOF { + return err + } else if len(mask) < 2 { + return nil + } + + switch { + case mask[0] == 254 && mask[1] == 255: + fallthrough + case mask[0] == 255 && mask[1] == 254: + p.buf.Read(mask) + case mask[0] == 239 && mask[1] == 187: + mask, err := p.buf.Peek(3) + if err != nil && err != io.EOF { + return err + } else if len(mask) < 3 { + return nil + } + if mask[2] == 191 { + p.buf.Read(mask) + } + } + return nil +} + +func (p *parser) readUntil(delim byte) ([]byte, error) { + data, err := p.buf.ReadBytes(delim) + if err != nil { + if err == io.EOF { + p.isEOF = true + } else { + return nil, err + } + } + return data, nil +} + +func cleanComment(in []byte) ([]byte, bool) { + i := bytes.IndexAny(in, "#;") + if i == -1 { + return nil, false + } + return in[i:], true +} + +func readKeyName(delimiters string, in []byte) (string, int, error) { + line := string(in) + + // Check if key name surrounded by quotes. + var keyQuote string + if line[0] == '"' { + if len(line) > 6 && string(line[0:3]) == `"""` { + keyQuote = `"""` + } else { + keyQuote = `"` + } + } else if line[0] == '`' { + keyQuote = "`" + } + + // Get out key name + endIdx := -1 + if len(keyQuote) > 0 { + startIdx := len(keyQuote) + // FIXME: fail case -> """"""name"""=value + pos := strings.Index(line[startIdx:], keyQuote) + if pos == -1 { + return "", -1, fmt.Errorf("missing closing key quote: %s", line) + } + pos += startIdx + + // Find key-value delimiter + i := strings.IndexAny(line[pos+startIdx:], delimiters) + if i < 0 { + return "", -1, ErrDelimiterNotFound{line} + } + endIdx = pos + i + return strings.TrimSpace(line[startIdx:pos]), endIdx + startIdx + 1, nil + } + + endIdx = strings.IndexAny(line, delimiters) + if endIdx < 0 { + return "", -1, ErrDelimiterNotFound{line} + } + return strings.TrimSpace(line[0:endIdx]), endIdx + 1, nil +} + +func (p *parser) readMultilines(line, val, valQuote string) (string, error) { + for { + data, err := p.readUntil('\n') + if err != nil { + return "", err + } + next := string(data) + + pos := strings.LastIndex(next, valQuote) + if pos > -1 { + val += next[:pos] + + comment, has := cleanComment([]byte(next[pos:])) + if has { + p.comment.Write(bytes.TrimSpace(comment)) + } + break + } + val += next + if p.isEOF { + return "", fmt.Errorf("missing closing key quote from '%s' to '%s'", line, next) + } + } + return val, nil +} + +func (p *parser) readContinuationLines(val string) (string, error) { + for { + data, err := p.readUntil('\n') + if err != nil { + return "", err + } + next := strings.TrimSpace(string(data)) + + if len(next) == 0 { + break + } + val += next + if val[len(val)-1] != '\\' { + break + } + val = val[:len(val)-1] + } + return val, nil +} + +// hasSurroundedQuote check if and only if the first and last characters +// are quotes \" or \'. +// It returns false if any other parts also contain same kind of quotes. +func hasSurroundedQuote(in string, quote byte) bool { + return len(in) >= 2 && in[0] == quote && in[len(in)-1] == quote && + strings.IndexByte(in[1:], quote) == len(in)-2 +} + +func (p *parser) readValue(in []byte, bufferSize int) (string, error) { + + line := strings.TrimLeftFunc(string(in), unicode.IsSpace) + if len(line) == 0 { + if p.options.AllowPythonMultilineValues && len(in) > 0 && in[len(in)-1] == '\n' { + return p.readPythonMultilines(line, bufferSize) + } + return "", nil + } + + var valQuote string + if len(line) > 3 && string(line[0:3]) == `"""` { + valQuote = `"""` + } else if line[0] == '`' { + valQuote = "`" + } else if p.options.UnescapeValueDoubleQuotes && line[0] == '"' { + valQuote = `"` + } + + if len(valQuote) > 0 { + startIdx := len(valQuote) + pos := strings.LastIndex(line[startIdx:], valQuote) + // Check for multi-line value + if pos == -1 { + return p.readMultilines(line, line[startIdx:], valQuote) + } + + if p.options.UnescapeValueDoubleQuotes && valQuote == `"` { + return strings.Replace(line[startIdx:pos+startIdx], `\"`, `"`, -1), nil + } + return line[startIdx : pos+startIdx], nil + } + + lastChar := line[len(line)-1] + // Won't be able to reach here if value only contains whitespace + line = strings.TrimSpace(line) + trimmedLastChar := line[len(line)-1] + + // Check continuation lines when desired + if !p.options.IgnoreContinuation && trimmedLastChar == '\\' { + return p.readContinuationLines(line[:len(line)-1]) + } + + // Check if ignore inline comment + if !p.options.IgnoreInlineComment { + var i int + if p.options.SpaceBeforeInlineComment { + i = strings.Index(line, " #") + if i == -1 { + i = strings.Index(line, " ;") + } + + } else { + i = strings.IndexAny(line, "#;") + } + + if i > -1 { + p.comment.WriteString(line[i:]) + line = strings.TrimSpace(line[:i]) + } + + } + + // Trim single and double quotes + if (hasSurroundedQuote(line, '\'') || + hasSurroundedQuote(line, '"')) && !p.options.PreserveSurroundedQuote { + line = line[1 : len(line)-1] + } else if len(valQuote) == 0 && p.options.UnescapeValueCommentSymbols { + if strings.Contains(line, `\;`) { + line = strings.Replace(line, `\;`, ";", -1) + } + if strings.Contains(line, `\#`) { + line = strings.Replace(line, `\#`, "#", -1) + } + } else if p.options.AllowPythonMultilineValues && lastChar == '\n' { + return p.readPythonMultilines(line, bufferSize) + } + + return line, nil +} + +func (p *parser) readPythonMultilines(line string, bufferSize int) (string, error) { + parserBufferPeekResult, _ := p.buf.Peek(bufferSize) + peekBuffer := bytes.NewBuffer(parserBufferPeekResult) + + indentSize := 0 + for { + peekData, peekErr := peekBuffer.ReadBytes('\n') + if peekErr != nil { + if peekErr == io.EOF { + p.debug("readPythonMultilines: io.EOF, peekData: %q, line: %q", string(peekData), line) + return line, nil + } + + p.debug("readPythonMultilines: failed to peek with error: %v", peekErr) + return "", peekErr + } + + p.debug("readPythonMultilines: parsing %q", string(peekData)) + + peekMatches := pythonMultiline.FindStringSubmatch(string(peekData)) + p.debug("readPythonMultilines: matched %d parts", len(peekMatches)) + for n, v := range peekMatches { + p.debug(" %d: %q", n, v) + } + + // Return if not a Python multiline value. + if len(peekMatches) != 3 { + p.debug("readPythonMultilines: end of value, got: %q", line) + return line, nil + } + + // Determine indent size and line prefix. + currentIndentSize := len(peekMatches[1]) + if indentSize < 1 { + indentSize = currentIndentSize + p.debug("readPythonMultilines: indent size is %d", indentSize) + } + + // Make sure each line is indented at least as far as first line. + if currentIndentSize < indentSize { + p.debug("readPythonMultilines: end of value, current indent: %d, expected indent: %d, line: %q", currentIndentSize, indentSize, line) + return line, nil + } + + // Advance the parser reader (buffer) in-sync with the peek buffer. + _, err := p.buf.Discard(len(peekData)) + if err != nil { + p.debug("readPythonMultilines: failed to skip to the end, returning error") + return "", err + } + + // Handle indented empty line. + line += "\n" + peekMatches[1][indentSize:] + peekMatches[2] + } +} + +// parse parses data through an io.Reader. +func (f *File) parse(reader io.Reader) (err error) { + p := newParser(reader, parserOptions{ + IgnoreContinuation: f.options.IgnoreContinuation, + IgnoreInlineComment: f.options.IgnoreInlineComment, + AllowPythonMultilineValues: f.options.AllowPythonMultilineValues, + SpaceBeforeInlineComment: f.options.SpaceBeforeInlineComment, + UnescapeValueDoubleQuotes: f.options.UnescapeValueDoubleQuotes, + UnescapeValueCommentSymbols: f.options.UnescapeValueCommentSymbols, + PreserveSurroundedQuote: f.options.PreserveSurroundedQuote, + DebugFunc: f.options.DebugFunc, + ReaderBufferSize: f.options.ReaderBufferSize, + }) + if err = p.BOM(); err != nil { + return fmt.Errorf("BOM: %v", err) + } + + // Ignore error because default section name is never empty string. + name := DefaultSection + if f.options.Insensitive { + name = strings.ToLower(DefaultSection) + } + section, _ := f.NewSection(name) + + // This "last" is not strictly equivalent to "previous one" if current key is not the first nested key + var isLastValueEmpty bool + var lastRegularKey *Key + + var line []byte + var inUnparseableSection bool + + // NOTE: Iterate and increase `currentPeekSize` until + // the size of the parser buffer is found. + // TODO(unknwon): When Golang 1.10 is the lowest version supported, replace with `parserBufferSize := p.buf.Size()`. + parserBufferSize := 0 + // NOTE: Peek 4kb at a time. + currentPeekSize := minReaderBufferSize + + if f.options.AllowPythonMultilineValues { + for { + peekBytes, _ := p.buf.Peek(currentPeekSize) + peekBytesLength := len(peekBytes) + + if parserBufferSize >= peekBytesLength { + break + } + + currentPeekSize *= 2 + parserBufferSize = peekBytesLength + } + } + + for !p.isEOF { + line, err = p.readUntil('\n') + if err != nil { + return err + } + + if f.options.AllowNestedValues && + isLastValueEmpty && len(line) > 0 { + if line[0] == ' ' || line[0] == '\t' { + lastRegularKey.addNestedValue(string(bytes.TrimSpace(line))) + continue + } + } + + line = bytes.TrimLeftFunc(line, unicode.IsSpace) + if len(line) == 0 { + continue + } + + // Comments + if line[0] == '#' || line[0] == ';' { + // Note: we do not care ending line break, + // it is needed for adding second line, + // so just clean it once at the end when set to value. + p.comment.Write(line) + continue + } + + // Section + if line[0] == '[' { + // Read to the next ']' (TODO: support quoted strings) + closeIdx := bytes.LastIndexByte(line, ']') + if closeIdx == -1 { + return fmt.Errorf("unclosed section: %s", line) + } + + name := string(line[1:closeIdx]) + section, err = f.NewSection(name) + if err != nil { + return err + } + + comment, has := cleanComment(line[closeIdx+1:]) + if has { + p.comment.Write(comment) + } + + section.Comment = strings.TrimSpace(p.comment.String()) + + // Reset aotu-counter and comments + p.comment.Reset() + p.count = 1 + + inUnparseableSection = false + for i := range f.options.UnparseableSections { + if f.options.UnparseableSections[i] == name || + (f.options.Insensitive && strings.ToLower(f.options.UnparseableSections[i]) == strings.ToLower(name)) { + inUnparseableSection = true + continue + } + } + continue + } + + if inUnparseableSection { + section.isRawSection = true + section.rawBody += string(line) + continue + } + + kname, offset, err := readKeyName(f.options.KeyValueDelimiters, line) + if err != nil { + // Treat as boolean key when desired, and whole line is key name. + if IsErrDelimiterNotFound(err) { + switch { + case f.options.AllowBooleanKeys: + kname, err := p.readValue(line, parserBufferSize) + if err != nil { + return err + } + key, err := section.NewBooleanKey(kname) + if err != nil { + return err + } + key.Comment = strings.TrimSpace(p.comment.String()) + p.comment.Reset() + continue + + case f.options.SkipUnrecognizableLines: + continue + } + } + return err + } + + // Auto increment. + isAutoIncr := false + if kname == "-" { + isAutoIncr = true + kname = "#" + strconv.Itoa(p.count) + p.count++ + } + + value, err := p.readValue(line[offset:], parserBufferSize) + if err != nil { + return err + } + isLastValueEmpty = len(value) == 0 + + key, err := section.NewKey(kname, value) + if err != nil { + return err + } + key.isAutoIncrement = isAutoIncr + key.Comment = strings.TrimSpace(p.comment.String()) + p.comment.Reset() + lastRegularKey = key + } + return nil +} diff --git a/vendor/gopkg.in/ini.v1/section.go b/vendor/gopkg.in/ini.v1/section.go new file mode 100644 index 0000000000..0bd3e13015 --- /dev/null +++ b/vendor/gopkg.in/ini.v1/section.go @@ -0,0 +1,256 @@ +// Copyright 2014 Unknwon +// +// 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. + +package ini + +import ( + "errors" + "fmt" + "strings" +) + +// Section represents a config section. +type Section struct { + f *File + Comment string + name string + keys map[string]*Key + keyList []string + keysHash map[string]string + + isRawSection bool + rawBody string +} + +func newSection(f *File, name string) *Section { + return &Section{ + f: f, + name: name, + keys: make(map[string]*Key), + keyList: make([]string, 0, 10), + keysHash: make(map[string]string), + } +} + +// Name returns name of Section. +func (s *Section) Name() string { + return s.name +} + +// Body returns rawBody of Section if the section was marked as unparseable. +// It still follows the other rules of the INI format surrounding leading/trailing whitespace. +func (s *Section) Body() string { + return strings.TrimSpace(s.rawBody) +} + +// SetBody updates body content only if section is raw. +func (s *Section) SetBody(body string) { + if !s.isRawSection { + return + } + s.rawBody = body +} + +// NewKey creates a new key to given section. +func (s *Section) NewKey(name, val string) (*Key, error) { + if len(name) == 0 { + return nil, errors.New("error creating new key: empty key name") + } else if s.f.options.Insensitive { + name = strings.ToLower(name) + } + + if s.f.BlockMode { + s.f.lock.Lock() + defer s.f.lock.Unlock() + } + + if inSlice(name, s.keyList) { + if s.f.options.AllowShadows { + if err := s.keys[name].addShadow(val); err != nil { + return nil, err + } + } else { + s.keys[name].value = val + s.keysHash[name] = val + } + return s.keys[name], nil + } + + s.keyList = append(s.keyList, name) + s.keys[name] = newKey(s, name, val) + s.keysHash[name] = val + return s.keys[name], nil +} + +// NewBooleanKey creates a new boolean type key to given section. +func (s *Section) NewBooleanKey(name string) (*Key, error) { + key, err := s.NewKey(name, "true") + if err != nil { + return nil, err + } + + key.isBooleanType = true + return key, nil +} + +// GetKey returns key in section by given name. +func (s *Section) GetKey(name string) (*Key, error) { + if s.f.BlockMode { + s.f.lock.RLock() + } + if s.f.options.Insensitive { + name = strings.ToLower(name) + } + key := s.keys[name] + if s.f.BlockMode { + s.f.lock.RUnlock() + } + + if key == nil { + // Check if it is a child-section. + sname := s.name + for { + if i := strings.LastIndex(sname, "."); i > -1 { + sname = sname[:i] + sec, err := s.f.GetSection(sname) + if err != nil { + continue + } + return sec.GetKey(name) + } + break + } + return nil, fmt.Errorf("error when getting key of section '%s': key '%s' not exists", s.name, name) + } + return key, nil +} + +// HasKey returns true if section contains a key with given name. +func (s *Section) HasKey(name string) bool { + key, _ := s.GetKey(name) + return key != nil +} + +// Deprecated: Use "HasKey" instead. +func (s *Section) Haskey(name string) bool { + return s.HasKey(name) +} + +// HasValue returns true if section contains given raw value. +func (s *Section) HasValue(value string) bool { + if s.f.BlockMode { + s.f.lock.RLock() + defer s.f.lock.RUnlock() + } + + for _, k := range s.keys { + if value == k.value { + return true + } + } + return false +} + +// Key assumes named Key exists in section and returns a zero-value when not. +func (s *Section) Key(name string) *Key { + key, err := s.GetKey(name) + if err != nil { + // It's OK here because the only possible error is empty key name, + // but if it's empty, this piece of code won't be executed. + key, _ = s.NewKey(name, "") + return key + } + return key +} + +// Keys returns list of keys of section. +func (s *Section) Keys() []*Key { + keys := make([]*Key, len(s.keyList)) + for i := range s.keyList { + keys[i] = s.Key(s.keyList[i]) + } + return keys +} + +// ParentKeys returns list of keys of parent section. +func (s *Section) ParentKeys() []*Key { + var parentKeys []*Key + sname := s.name + for { + if i := strings.LastIndex(sname, "."); i > -1 { + sname = sname[:i] + sec, err := s.f.GetSection(sname) + if err != nil { + continue + } + parentKeys = append(parentKeys, sec.Keys()...) + } else { + break + } + + } + return parentKeys +} + +// KeyStrings returns list of key names of section. +func (s *Section) KeyStrings() []string { + list := make([]string, len(s.keyList)) + copy(list, s.keyList) + return list +} + +// KeysHash returns keys hash consisting of names and values. +func (s *Section) KeysHash() map[string]string { + if s.f.BlockMode { + s.f.lock.RLock() + defer s.f.lock.RUnlock() + } + + hash := map[string]string{} + for key, value := range s.keysHash { + hash[key] = value + } + return hash +} + +// DeleteKey deletes a key from section. +func (s *Section) DeleteKey(name string) { + if s.f.BlockMode { + s.f.lock.Lock() + defer s.f.lock.Unlock() + } + + for i, k := range s.keyList { + if k == name { + s.keyList = append(s.keyList[:i], s.keyList[i+1:]...) + delete(s.keys, name) + delete(s.keysHash, name) + return + } + } +} + +// ChildSections returns a list of child sections of current section. +// For example, "[parent.child1]" and "[parent.child12]" are child sections +// of section "[parent]". +func (s *Section) ChildSections() []*Section { + prefix := s.name + "." + children := make([]*Section, 0, 3) + for _, name := range s.f.sectionList { + if strings.HasPrefix(name, prefix) { + children = append(children, s.f.sections[name]) + } + } + return children +} diff --git a/vendor/gopkg.in/ini.v1/struct.go b/vendor/gopkg.in/ini.v1/struct.go new file mode 100644 index 0000000000..6bc70e4d4f --- /dev/null +++ b/vendor/gopkg.in/ini.v1/struct.go @@ -0,0 +1,603 @@ +// Copyright 2014 Unknwon +// +// 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. + +package ini + +import ( + "bytes" + "errors" + "fmt" + "reflect" + "strings" + "time" + "unicode" +) + +// NameMapper represents a ini tag name mapper. +type NameMapper func(string) string + +// Built-in name getters. +var ( + // SnackCase converts to format SNACK_CASE. + SnackCase NameMapper = func(raw string) string { + newstr := make([]rune, 0, len(raw)) + for i, chr := range raw { + if isUpper := 'A' <= chr && chr <= 'Z'; isUpper { + if i > 0 { + newstr = append(newstr, '_') + } + } + newstr = append(newstr, unicode.ToUpper(chr)) + } + return string(newstr) + } + // TitleUnderscore converts to format title_underscore. + TitleUnderscore NameMapper = func(raw string) string { + newstr := make([]rune, 0, len(raw)) + for i, chr := range raw { + if isUpper := 'A' <= chr && chr <= 'Z'; isUpper { + if i > 0 { + newstr = append(newstr, '_') + } + chr -= 'A' - 'a' + } + newstr = append(newstr, chr) + } + return string(newstr) + } +) + +func (s *Section) parseFieldName(raw, actual string) string { + if len(actual) > 0 { + return actual + } + if s.f.NameMapper != nil { + return s.f.NameMapper(raw) + } + return raw +} + +func parseDelim(actual string) string { + if len(actual) > 0 { + return actual + } + return "," +} + +var reflectTime = reflect.TypeOf(time.Now()).Kind() + +// setSliceWithProperType sets proper values to slice based on its type. +func setSliceWithProperType(key *Key, field reflect.Value, delim string, allowShadow, isStrict bool) error { + var strs []string + if allowShadow { + strs = key.StringsWithShadows(delim) + } else { + strs = key.Strings(delim) + } + + numVals := len(strs) + if numVals == 0 { + return nil + } + + var vals interface{} + var err error + + sliceOf := field.Type().Elem().Kind() + switch sliceOf { + case reflect.String: + vals = strs + case reflect.Int: + vals, err = key.parseInts(strs, true, false) + case reflect.Int64: + vals, err = key.parseInt64s(strs, true, false) + case reflect.Uint: + vals, err = key.parseUints(strs, true, false) + case reflect.Uint64: + vals, err = key.parseUint64s(strs, true, false) + case reflect.Float64: + vals, err = key.parseFloat64s(strs, true, false) + case reflect.Bool: + vals, err = key.parseBools(strs, true, false) + case reflectTime: + vals, err = key.parseTimesFormat(time.RFC3339, strs, true, false) + default: + return fmt.Errorf("unsupported type '[]%s'", sliceOf) + } + if err != nil && isStrict { + return err + } + + slice := reflect.MakeSlice(field.Type(), numVals, numVals) + for i := 0; i < numVals; i++ { + switch sliceOf { + case reflect.String: + slice.Index(i).Set(reflect.ValueOf(vals.([]string)[i])) + case reflect.Int: + slice.Index(i).Set(reflect.ValueOf(vals.([]int)[i])) + case reflect.Int64: + slice.Index(i).Set(reflect.ValueOf(vals.([]int64)[i])) + case reflect.Uint: + slice.Index(i).Set(reflect.ValueOf(vals.([]uint)[i])) + case reflect.Uint64: + slice.Index(i).Set(reflect.ValueOf(vals.([]uint64)[i])) + case reflect.Float64: + slice.Index(i).Set(reflect.ValueOf(vals.([]float64)[i])) + case reflect.Bool: + slice.Index(i).Set(reflect.ValueOf(vals.([]bool)[i])) + case reflectTime: + slice.Index(i).Set(reflect.ValueOf(vals.([]time.Time)[i])) + } + } + field.Set(slice) + return nil +} + +func wrapStrictError(err error, isStrict bool) error { + if isStrict { + return err + } + return nil +} + +// setWithProperType sets proper value to field based on its type, +// but it does not return error for failing parsing, +// because we want to use default value that is already assigned to struct. +func setWithProperType(t reflect.Type, key *Key, field reflect.Value, delim string, allowShadow, isStrict bool) error { + vt := t + isPtr := t.Kind() == reflect.Ptr + if isPtr { + vt = t.Elem() + } + switch vt.Kind() { + case reflect.String: + stringVal := key.String() + if isPtr { + field.Set(reflect.ValueOf(&stringVal)) + } else if len(stringVal) > 0 { + field.SetString(key.String()) + } + case reflect.Bool: + boolVal, err := key.Bool() + if err != nil { + return wrapStrictError(err, isStrict) + } + if isPtr { + field.Set(reflect.ValueOf(&boolVal)) + } else { + field.SetBool(boolVal) + } + case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: + // ParseDuration will not return err for `0`, so check the type name + if vt.Name() == "Duration" { + durationVal, err := key.Duration() + if err != nil { + return wrapStrictError(err, isStrict) + } + if isPtr { + field.Set(reflect.ValueOf(&durationVal)) + } else if int64(durationVal) > 0 { + field.Set(reflect.ValueOf(durationVal)) + } + return nil + } + + intVal, err := key.Int64() + if err != nil { + return wrapStrictError(err, isStrict) + } + if isPtr { + pv := reflect.New(t.Elem()) + pv.Elem().SetInt(intVal) + field.Set(pv) + } else { + field.SetInt(intVal) + } + // byte is an alias for uint8, so supporting uint8 breaks support for byte + case reflect.Uint, reflect.Uint16, reflect.Uint32, reflect.Uint64: + durationVal, err := key.Duration() + // Skip zero value + if err == nil && uint64(durationVal) > 0 { + if isPtr { + field.Set(reflect.ValueOf(&durationVal)) + } else { + field.Set(reflect.ValueOf(durationVal)) + } + return nil + } + + uintVal, err := key.Uint64() + if err != nil { + return wrapStrictError(err, isStrict) + } + if isPtr { + pv := reflect.New(t.Elem()) + pv.Elem().SetUint(uintVal) + field.Set(pv) + } else { + field.SetUint(uintVal) + } + + case reflect.Float32, reflect.Float64: + floatVal, err := key.Float64() + if err != nil { + return wrapStrictError(err, isStrict) + } + if isPtr { + pv := reflect.New(t.Elem()) + pv.Elem().SetFloat(floatVal) + field.Set(pv) + } else { + field.SetFloat(floatVal) + } + case reflectTime: + timeVal, err := key.Time() + if err != nil { + return wrapStrictError(err, isStrict) + } + if isPtr { + field.Set(reflect.ValueOf(&timeVal)) + } else { + field.Set(reflect.ValueOf(timeVal)) + } + case reflect.Slice: + return setSliceWithProperType(key, field, delim, allowShadow, isStrict) + default: + return fmt.Errorf("unsupported type '%s'", t) + } + return nil +} + +func parseTagOptions(tag string) (rawName string, omitEmpty bool, allowShadow bool) { + opts := strings.SplitN(tag, ",", 3) + rawName = opts[0] + if len(opts) > 1 { + omitEmpty = opts[1] == "omitempty" + } + if len(opts) > 2 { + allowShadow = opts[2] == "allowshadow" + } + return rawName, omitEmpty, allowShadow +} + +func (s *Section) mapTo(val reflect.Value, isStrict bool) error { + if val.Kind() == reflect.Ptr { + val = val.Elem() + } + typ := val.Type() + + for i := 0; i < typ.NumField(); i++ { + field := val.Field(i) + tpField := typ.Field(i) + + tag := tpField.Tag.Get("ini") + if tag == "-" { + continue + } + + rawName, _, allowShadow := parseTagOptions(tag) + fieldName := s.parseFieldName(tpField.Name, rawName) + if len(fieldName) == 0 || !field.CanSet() { + continue + } + + isStruct := tpField.Type.Kind() == reflect.Struct + isStructPtr := tpField.Type.Kind() == reflect.Ptr && tpField.Type.Elem().Kind() == reflect.Struct + isAnonymous := tpField.Type.Kind() == reflect.Ptr && tpField.Anonymous + if isAnonymous { + field.Set(reflect.New(tpField.Type.Elem())) + } + + if isAnonymous || isStruct || isStructPtr { + if sec, err := s.f.GetSection(fieldName); err == nil { + // Only set the field to non-nil struct value if we have + // a section for it. Otherwise, we end up with a non-nil + // struct ptr even though there is no data. + if isStructPtr && field.IsNil() { + field.Set(reflect.New(tpField.Type.Elem())) + } + if err = sec.mapTo(field, isStrict); err != nil { + return fmt.Errorf("error mapping field(%s): %v", fieldName, err) + } + continue + } + } + if key, err := s.GetKey(fieldName); err == nil { + delim := parseDelim(tpField.Tag.Get("delim")) + if err = setWithProperType(tpField.Type, key, field, delim, allowShadow, isStrict); err != nil { + return fmt.Errorf("error mapping field(%s): %v", fieldName, err) + } + } + } + return nil +} + +// MapTo maps section to given struct. +func (s *Section) MapTo(v interface{}) error { + typ := reflect.TypeOf(v) + val := reflect.ValueOf(v) + if typ.Kind() == reflect.Ptr { + typ = typ.Elem() + val = val.Elem() + } else { + return errors.New("cannot map to non-pointer struct") + } + + return s.mapTo(val, false) +} + +// StrictMapTo maps section to given struct in strict mode, +// which returns all possible error including value parsing error. +func (s *Section) StrictMapTo(v interface{}) error { + typ := reflect.TypeOf(v) + val := reflect.ValueOf(v) + if typ.Kind() == reflect.Ptr { + typ = typ.Elem() + val = val.Elem() + } else { + return errors.New("cannot map to non-pointer struct") + } + + return s.mapTo(val, true) +} + +// MapTo maps file to given struct. +func (f *File) MapTo(v interface{}) error { + return f.Section("").MapTo(v) +} + +// StrictMapTo maps file to given struct in strict mode, +// which returns all possible error including value parsing error. +func (f *File) StrictMapTo(v interface{}) error { + return f.Section("").StrictMapTo(v) +} + +// MapToWithMapper maps data sources to given struct with name mapper. +func MapToWithMapper(v interface{}, mapper NameMapper, source interface{}, others ...interface{}) error { + cfg, err := Load(source, others...) + if err != nil { + return err + } + cfg.NameMapper = mapper + return cfg.MapTo(v) +} + +// StrictMapToWithMapper maps data sources to given struct with name mapper in strict mode, +// which returns all possible error including value parsing error. +func StrictMapToWithMapper(v interface{}, mapper NameMapper, source interface{}, others ...interface{}) error { + cfg, err := Load(source, others...) + if err != nil { + return err + } + cfg.NameMapper = mapper + return cfg.StrictMapTo(v) +} + +// MapTo maps data sources to given struct. +func MapTo(v, source interface{}, others ...interface{}) error { + return MapToWithMapper(v, nil, source, others...) +} + +// StrictMapTo maps data sources to given struct in strict mode, +// which returns all possible error including value parsing error. +func StrictMapTo(v, source interface{}, others ...interface{}) error { + return StrictMapToWithMapper(v, nil, source, others...) +} + +// reflectSliceWithProperType does the opposite thing as setSliceWithProperType. +func reflectSliceWithProperType(key *Key, field reflect.Value, delim string, allowShadow bool) error { + slice := field.Slice(0, field.Len()) + if field.Len() == 0 { + return nil + } + sliceOf := field.Type().Elem().Kind() + + if allowShadow { + var keyWithShadows *Key + for i := 0; i < field.Len(); i++ { + var val string + switch sliceOf { + case reflect.String: + val = slice.Index(i).String() + case reflect.Int, reflect.Int64: + val = fmt.Sprint(slice.Index(i).Int()) + case reflect.Uint, reflect.Uint64: + val = fmt.Sprint(slice.Index(i).Uint()) + case reflect.Float64: + val = fmt.Sprint(slice.Index(i).Float()) + case reflect.Bool: + val = fmt.Sprint(slice.Index(i).Bool()) + case reflectTime: + val = slice.Index(i).Interface().(time.Time).Format(time.RFC3339) + default: + return fmt.Errorf("unsupported type '[]%s'", sliceOf) + } + + if i == 0 { + keyWithShadows = newKey(key.s, key.name, val) + } else { + keyWithShadows.AddShadow(val) + } + } + key = keyWithShadows + return nil + } + + var buf bytes.Buffer + for i := 0; i < field.Len(); i++ { + switch sliceOf { + case reflect.String: + buf.WriteString(slice.Index(i).String()) + case reflect.Int, reflect.Int64: + buf.WriteString(fmt.Sprint(slice.Index(i).Int())) + case reflect.Uint, reflect.Uint64: + buf.WriteString(fmt.Sprint(slice.Index(i).Uint())) + case reflect.Float64: + buf.WriteString(fmt.Sprint(slice.Index(i).Float())) + case reflect.Bool: + buf.WriteString(fmt.Sprint(slice.Index(i).Bool())) + case reflectTime: + buf.WriteString(slice.Index(i).Interface().(time.Time).Format(time.RFC3339)) + default: + return fmt.Errorf("unsupported type '[]%s'", sliceOf) + } + buf.WriteString(delim) + } + key.SetValue(buf.String()[:buf.Len()-len(delim)]) + return nil +} + +// reflectWithProperType does the opposite thing as setWithProperType. +func reflectWithProperType(t reflect.Type, key *Key, field reflect.Value, delim string, allowShadow bool) error { + switch t.Kind() { + case reflect.String: + key.SetValue(field.String()) + case reflect.Bool: + key.SetValue(fmt.Sprint(field.Bool())) + case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: + key.SetValue(fmt.Sprint(field.Int())) + case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64: + key.SetValue(fmt.Sprint(field.Uint())) + case reflect.Float32, reflect.Float64: + key.SetValue(fmt.Sprint(field.Float())) + case reflectTime: + key.SetValue(fmt.Sprint(field.Interface().(time.Time).Format(time.RFC3339))) + case reflect.Slice: + return reflectSliceWithProperType(key, field, delim, allowShadow) + case reflect.Ptr: + if !field.IsNil() { + return reflectWithProperType(t.Elem(), key, field.Elem(), delim, allowShadow) + } + default: + return fmt.Errorf("unsupported type '%s'", t) + } + return nil +} + +// CR: copied from encoding/json/encode.go with modifications of time.Time support. +// TODO: add more test coverage. +func isEmptyValue(v reflect.Value) bool { + switch v.Kind() { + case reflect.Array, reflect.Map, reflect.Slice, reflect.String: + return v.Len() == 0 + case reflect.Bool: + return !v.Bool() + case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: + return v.Int() == 0 + case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: + return v.Uint() == 0 + case reflect.Float32, reflect.Float64: + return v.Float() == 0 + case reflect.Interface, reflect.Ptr: + return v.IsNil() + case reflectTime: + t, ok := v.Interface().(time.Time) + return ok && t.IsZero() + } + return false +} + +func (s *Section) reflectFrom(val reflect.Value) error { + if val.Kind() == reflect.Ptr { + val = val.Elem() + } + typ := val.Type() + + for i := 0; i < typ.NumField(); i++ { + field := val.Field(i) + tpField := typ.Field(i) + + tag := tpField.Tag.Get("ini") + if tag == "-" { + continue + } + + rawName, omitEmpty, allowShadow := parseTagOptions(tag) + if omitEmpty && isEmptyValue(field) { + continue + } + + fieldName := s.parseFieldName(tpField.Name, rawName) + if len(fieldName) == 0 || !field.CanSet() { + continue + } + + if (tpField.Type.Kind() == reflect.Ptr && tpField.Anonymous) || + (tpField.Type.Kind() == reflect.Struct && tpField.Type.Name() != "Time") { + // Note: The only error here is section doesn't exist. + sec, err := s.f.GetSection(fieldName) + if err != nil { + // Note: fieldName can never be empty here, ignore error. + sec, _ = s.f.NewSection(fieldName) + } + + // Add comment from comment tag + if len(sec.Comment) == 0 { + sec.Comment = tpField.Tag.Get("comment") + } + + if err = sec.reflectFrom(field); err != nil { + return fmt.Errorf("error reflecting field (%s): %v", fieldName, err) + } + continue + } + + // Note: Same reason as secion. + key, err := s.GetKey(fieldName) + if err != nil { + key, _ = s.NewKey(fieldName, "") + } + + // Add comment from comment tag + if len(key.Comment) == 0 { + key.Comment = tpField.Tag.Get("comment") + } + + if err = reflectWithProperType(tpField.Type, key, field, parseDelim(tpField.Tag.Get("delim")), allowShadow); err != nil { + return fmt.Errorf("error reflecting field (%s): %v", fieldName, err) + } + + } + return nil +} + +// ReflectFrom reflects secion from given struct. +func (s *Section) ReflectFrom(v interface{}) error { + typ := reflect.TypeOf(v) + val := reflect.ValueOf(v) + if typ.Kind() == reflect.Ptr { + typ = typ.Elem() + val = val.Elem() + } else { + return errors.New("cannot reflect from non-pointer struct") + } + + return s.reflectFrom(val) +} + +// ReflectFrom reflects file from given struct. +func (f *File) ReflectFrom(v interface{}) error { + return f.Section("").ReflectFrom(v) +} + +// ReflectFromWithMapper reflects data sources from given struct with name mapper. +func ReflectFromWithMapper(cfg *File, v interface{}, mapper NameMapper) error { + cfg.NameMapper = mapper + return cfg.ReflectFrom(v) +} + +// ReflectFrom reflects data sources from given struct. +func ReflectFrom(cfg *File, v interface{}) error { + return ReflectFromWithMapper(cfg, v, nil) +} diff --git a/vendor/modules.txt b/vendor/modules.txt index bdbb5f8483..9769326f7a 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -36,6 +36,18 @@ github.com/PuerkitoBio/purell github.com/PuerkitoBio/urlesc # github.com/agext/levenshtein v1.2.1 github.com/agext/levenshtein +# github.com/aliyun/alibaba-cloud-sdk-go v1.61.264 +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 +github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/provider +github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers +github.com/aliyun/alibaba-cloud-sdk-go/sdk/endpoints +github.com/aliyun/alibaba-cloud-sdk-go/sdk/errors +github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests +github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses +github.com/aliyun/alibaba-cloud-sdk-go/sdk/utils +github.com/aliyun/alibaba-cloud-sdk-go/services/slb # github.com/aokoli/goutils v1.0.1 github.com/aokoli/goutils # github.com/apparentlymart/go-textseg v1.0.0 @@ -668,6 +680,8 @@ gopkg.in/gcfg.v1/token gopkg.in/gcfg.v1/types # gopkg.in/inf.v0 v0.9.1 gopkg.in/inf.v0 +# gopkg.in/ini.v1 v1.51.0 +gopkg.in/ini.v1 # gopkg.in/square/go-jose.v2 v2.3.1 gopkg.in/square/go-jose.v2 gopkg.in/square/go-jose.v2/cipher