diff --git a/Gopkg.lock b/Gopkg.lock index 260209ed3..9830e3bac 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -76,6 +76,26 @@ pruneopts = "NUT" revision = "de5bf2ad457846296e2031421a34e2568e304e35" +[[projects]] + digest = "1:08ecfb98f990d77a699802b7ff746a5afef78066120a876fc5f99ccb5dff289c" + name = "github.com/aliyun/alibaba-cloud-sdk-go" + packages = [ + "sdk", + "sdk/auth", + "sdk/auth/credentials", + "sdk/auth/credentials/provider", + "sdk/auth/signers", + "sdk/endpoints", + "sdk/errors", + "sdk/requests", + "sdk/responses", + "sdk/utils", + "services/vpc", + ] + pruneopts = "NUT" + revision = "d15efc607c829fd1a01067b9cfe9dc384f0be03f" + version = "1.58.8" + [[projects]] digest = "1:680b63a131506e668818d630d3ca36123ff290afa0afc9f4be21940adca3f27d" name = "github.com/appscode/jsonpatch" @@ -606,11 +626,12 @@ version = "v1.0" [[projects]] - digest = "1:ac6d01547ec4f7f673311b4663909269bfb8249952de3279799289467837c3cc" + digest = "1:7c818eb119c69fc685573449e8f799596ba81827074b006ff0cb71052424f254" name = "github.com/jmespath/go-jmespath" packages = ["."] pruneopts = "NUT" - revision = "0b12d6b5" + revision = "3433f3ea46d9f8019119e7dd41274e112a2359a9" + version = "0.2.2" [[projects]] digest = "1:da62aa6632d04e080b8a8b85a59ed9ed1550842a0099a55f3ae3a20d02a3745a" @@ -874,6 +895,14 @@ pruneopts = "NUT" revision = "300106c228d52c8941d4b3de6054a6062a86dda3" +[[projects]] + digest = "1:6bc0652ea6e39e22ccd522458b8bdd8665bf23bdc5a20eec90056e4dc7e273ca" + name = "github.com/satori/go.uuid" + packages = ["."] + pruneopts = "NUT" + revision = "f58768cc1a7a7e77a3bd49e98cdd21419399b6a3" + version = "v1.2.0" + [[projects]] digest = "1:debf1a119378d059b68925f1796851b6855bfc2f55419a50d634ecce3eabd8e8" name = "github.com/shurcooL/sanitized_anchor_name" @@ -1175,6 +1204,14 @@ revision = "d2d2541c53f18d2a059457998ce2876cc8e67cbf" version = "v0.9.1" +[[projects]] + digest = "1:d74ba1aea6244ead12e4f16d5f61a15ced9a2f2d1cae2021fbb76088b27e7afa" + name = "gopkg.in/ini.v1" + packages = ["."] + pruneopts = "NUT" + revision = "c85607071cf08ca1adaf48319cd1aa322e81d8c1" + version = "v1.42.0" + [[projects]] digest = "1:d5547d77e1c9ca9850f3d868d29eed275742611eeae2b99bcd8a1f18f368b6e8" name = "gopkg.in/square/go-jose.v2" @@ -1737,6 +1774,7 @@ analyzer-name = "dep" analyzer-version = 1 input-imports = [ + "github.com/aliyun/alibaba-cloud-sdk-go/services/vpc", "github.com/appscode/jsonpatch", "github.com/aws/aws-sdk-go/aws", "github.com/aws/aws-sdk-go/aws/awserr", diff --git a/Gopkg.toml b/Gopkg.toml index f23758c9e..f31567159 100644 --- a/Gopkg.toml +++ b/Gopkg.toml @@ -58,6 +58,10 @@ required = [ name = "github.com/russross/blackfriday" revision = "300106c228d52c8941d4b3de6054a6062a86dda3" +[[override]] + name = "github.com/jmespath/go-jmespath" + version = "^0.2.2" + [[constraint]] name = "github.com/aws/aws-sdk-go" version = "~1.12.48" diff --git a/controllers/provider-alicloud/charts/internal/alicloud-infra/Chart.yaml b/controllers/provider-alicloud/charts/internal/alicloud-infra/Chart.yaml new file mode 100644 index 000000000..bdd8a7be8 --- /dev/null +++ b/controllers/provider-alicloud/charts/internal/alicloud-infra/Chart.yaml @@ -0,0 +1,4 @@ +apiVersion: v1 +description: Alicloud chart for main k8s infrastructure +name: alicloud-infra +version: 0.1.0 diff --git a/controllers/provider-alicloud/charts/internal/alicloud-infra/templates/main.tf b/controllers/provider-alicloud/charts/internal/alicloud-infra/templates/main.tf new file mode 100644 index 000000000..e686bffbb --- /dev/null +++ b/controllers/provider-alicloud/charts/internal/alicloud-infra/templates/main.tf @@ -0,0 +1,115 @@ +provider "alicloud" { + access_key = "${var.ACCESS_KEY_ID}" + secret_key = "${var.ACCESS_KEY_SECRET}" + region = "{{ required "alicloud.region is required" .Values.alicloud.region }}" +} + +// Import an existing public key to build a alicloud key pair +resource "alicloud_key_pair" "publickey" { + key_name = "{{ required "clusterName is required" .Values.clusterName }}-ssh-publickey" + public_key = "{{ required "sshPublicKey is required" .Values.sshPublicKey }}" +} + +{{ if .Values.create.vpc -}} +resource "alicloud_vpc" "vpc" { + name = "{{ required "clusterName is required" .Values.clusterName }}-vpc" + cidr_block = "{{ required "vpc.cidr is required" .Values.vpc.cidr }}" +} +resource "alicloud_nat_gateway" "nat_gateway" { + vpc_id = "{{ required "vpc.id is required" .Values.vpc.id }}" + spec = "Small" + name = "{{ required "clusterName is required" .Values.clusterName }}-natgw" +} +{{- end }} + + +// Loop zones +{{ range $index, $zone := .Values.zones }} + +resource "alicloud_vswitch" "vsw_z{{ $index }}" { + name = "{{ required "clusterName is required" $.Values.clusterName }}-{{ required "zone.name is required" $zone.name }}-vsw" + vpc_id = "{{ required "vpc.id is required" $.Values.vpc.id }}" + cidr_block = "{{ required "zone.cidr.worker is required" $zone.cidr.worker }}" + availability_zone = "{{ required "zone.name is required" $zone.name }}" +} + +// Create a new EIP. +resource "alicloud_eip" "eip_natgw_z{{ $index }}" { + name = "{{ required "clusterName is required" $.Values.clusterName }}-eip-natgw-z{{ $index }}" + bandwidth = "20" + internet_charge_type = "PayByBandwidth" +} + +resource "alicloud_eip_association" "eip_natgw_asso_z{{ $index }}" { + allocation_id = "${alicloud_eip.eip_natgw_z{{ $index }}.id}" + instance_id = "{{ required "natGatewayID is required" $.Values.vpc.natGatewayID }}" +} + +resource "alicloud_snat_entry" "snat_z{{ $index }}" { + snat_table_id = "{{ required "snatTableID is required" $.Values.vpc.snatTableID }}" + source_vswitch_id = "${alicloud_vswitch.vsw_z{{ $index }}.id}" + snat_ip = "${alicloud_eip.eip_natgw_z{{ $index }}.ip_address}" +} + +// Output +output "vswitch_id_z{{ $index }}" { + value = "${alicloud_vswitch.vsw_z{{ $index }}.id}" +} + +{{end}} +// End of loop zones + +resource "alicloud_security_group" "sg" { + name = "{{ required "clusterName is required" .Values.clusterName }}-sg" + vpc_id = "{{ required "vpc.id is required" .Values.vpc.id }}" +} + +resource "alicloud_security_group_rule" "allow_k8s_tcp_in" { + type = "ingress" + ip_protocol = "tcp" + policy = "accept" + port_range = "30000/32767" + priority = 1 + security_group_id = "${alicloud_security_group.sg.id}" + cidr_ip = "0.0.0.0/0" +} + +resource "alicloud_security_group_rule" "allow_all_internal_tcp_in" { + type = "ingress" + ip_protocol = "tcp" + policy = "accept" + port_range = "1/65535" + priority = 1 + security_group_id = "${alicloud_security_group.sg.id}" + cidr_ip = "{{ required "pod is required" .Values.vpc.cidr }}" +} + +resource "alicloud_security_group_rule" "allow_all_internal_udp_in" { + type = "ingress" + ip_protocol = "udp" + policy = "accept" + port_range = "1/65535" + priority = 1 + security_group_id = "${alicloud_security_group.sg.id}" + cidr_ip = "{{ required "pod is required" .Values.vpc.cidr }}" +} + +//===================================================================== +//= Output variables +//===================================================================== + +output "{{ .Values.outputKeys.securityGroupID }}" { + value = "${alicloud_security_group.sg.id}" +} + +output "{{ .Values.outputKeys.vpcID }}" { + value = "{{ required "vpc.id is required" .Values.vpc.id }}" +} + +output "{{ .Values.outputKeys.vpcCIDR }}" { + value = "{{ required "vpc.cidr is required" .Values.vpc.cidr }}" +} + +output "{{ .Values.outputKeys.keyPairName }}" { + value = "${alicloud_key_pair.publickey.key_name}" +} diff --git a/controllers/provider-alicloud/charts/internal/alicloud-infra/templates/terraform.tfvars b/controllers/provider-alicloud/charts/internal/alicloud-infra/templates/terraform.tfvars new file mode 100644 index 000000000..d719d105d --- /dev/null +++ b/controllers/provider-alicloud/charts/internal/alicloud-infra/templates/terraform.tfvars @@ -0,0 +1,2 @@ + +# New line is needed! Do not remove this comment. diff --git a/controllers/provider-alicloud/charts/internal/alicloud-infra/templates/variables.tf b/controllers/provider-alicloud/charts/internal/alicloud-infra/templates/variables.tf new file mode 100644 index 000000000..b01fcdf9f --- /dev/null +++ b/controllers/provider-alicloud/charts/internal/alicloud-infra/templates/variables.tf @@ -0,0 +1,9 @@ +variable "ACCESS_KEY_ID" { + description = "Alicloud access key id" + type = "string" +} + +variable "ACCESS_KEY_SECRET" { + description = "Alicloud access key secret" + type = "string" +} diff --git a/controllers/provider-alicloud/charts/internal/alicloud-infra/values.yaml b/controllers/provider-alicloud/charts/internal/alicloud-infra/values.yaml new file mode 100644 index 000000000..5acd80b12 --- /dev/null +++ b/controllers/provider-alicloud/charts/internal/alicloud-infra/values.yaml @@ -0,0 +1,37 @@ +alicloud: + region: cn-beijing + +create: + vpc: true + +clusterName: test-namespace + +sshPublicKey: sshkey-12345 + +vpc: + id: ${alicloud_vpc.vpc.id} + cidr: 10.10.10.10/6 + natGatewayID: ${alicloud_nat_gateway.nat_gateway.id} + snatTableID: ${alicloud_nat_gateway.nat_gateway.snat_table_ids} + + +zones: +- name: cn-beijing-a + cidr: + worker: 10.250.0.0/19 +- name: cn-beijing-b + cidr: + worker: 10.250.32.0/19 + +names: + configuration: shoot.tf-config + variables: shoot.tf-vars + state: shoot.tf-state + +initializeEmptyState: true + +outputKeys: + securityGroupID: sg_id + vpcID: vpc_id + vpcCIDR: vpc_cidr + keyPairName: key_pair_name \ No newline at end of file diff --git a/controllers/provider-alicloud/cmd/gardener-extension-provider-alicloud/app/app.go b/controllers/provider-alicloud/cmd/gardener-extension-provider-alicloud/app/app.go index ec8184339..18242fde9 100644 --- a/controllers/provider-alicloud/cmd/gardener-extension-provider-alicloud/app/app.go +++ b/controllers/provider-alicloud/cmd/gardener-extension-provider-alicloud/app/app.go @@ -17,6 +17,8 @@ package app import ( "context" "fmt" + alicloudcontroller "github.com/gardener/gardener-extensions/controllers/provider-alicloud/pkg/controller" + alicloudinfrastructure "github.com/gardener/gardener-extensions/controllers/provider-alicloud/pkg/controller/infrastructure" "os" "github.com/gardener/gardener-extensions/pkg/controller" @@ -40,14 +42,16 @@ func NewControllerManagerCommand(ctx context.Context) *cobra.Command { LeaderElectionID: controllercmd.LeaderElectionNameID(Name), LeaderElectionNamespace: os.Getenv("LEADER_ELECTION_NAMESPACE"), } - ctrlOpts = &controllercmd.ControllerOptions{ + infraCtrlOpts = &controllercmd.ControllerOptions{ MaxConcurrentReconciles: 5, } - infrastructureReconcilerOpts = &infrastructure.ReconcilerOptions{ + infraReconcileOpts = &infrastructure.ReconcilerOptions{ IgnoreOperationAnnotation: true, } + unprefixedInfraOpts = controllercmd.NewOptionAggregator(infraCtrlOpts, infraReconcileOpts) + infraOpts = controllercmd.PrefixOption("infrastructure-", &unprefixedInfraOpts) - aggOption = controllercmd.NewOptionAggregator(restOpts, mgrOpts, ctrlOpts, infrastructureReconcilerOpts) + aggOption = controllercmd.NewOptionAggregator(restOpts, mgrOpts, infraOpts) ) cmd := &cobra.Command{ @@ -67,6 +71,13 @@ func NewControllerManagerCommand(ctx context.Context) *cobra.Command { controllercmd.LogErrAndExit(err, "Could not update manager scheme") } + infraCtrlOpts.Completed().Apply(&alicloudinfrastructure.DefaultAddOptions.Controller) + infraReconcileOpts.Completed().Apply(&alicloudinfrastructure.DefaultAddOptions.IgnoreOperationAnnotation) + + if err := alicloudcontroller.AddToManager(mgr); err != nil { + controllercmd.LogErrAndExit(err, "Could not add controllers to manager") + } + if err := mgr.Start(ctx.Done()); err != nil { controllercmd.LogErrAndExit(err, "Error running manager") } diff --git a/controllers/provider-alicloud/example/infrastructure.yaml b/controllers/provider-alicloud/example/infrastructure.yaml new file mode 100644 index 000000000..49ace0822 --- /dev/null +++ b/controllers/provider-alicloud/example/infrastructure.yaml @@ -0,0 +1,66 @@ +--- +apiVersion: v1 +kind: Namespace +metadata: + name: shoot--foo--bar +--- +apiVersion: v1 +kind: Secret +metadata: + namespace: shoot--foo--bar + name: core-alicloud +type: Opaque +data: +# accessKeyID: base64(accessKeyID) +# accessKeySecret: base64(accessKeySecret) +--- +apiVersion: extensions.gardener.cloud/v1alpha1 +kind: Cluster +metadata: + name: shoot--foo--bar +spec: + cloudProfile: + apiVersion: garden.sapcloud.io/v1beta1 + kind: CloudProfile + spec: + alicloud: + seed: + apiVersion: garden.sapcloud.io/v1beta1 + kind: Seed + shoot: + apiVersion: garden.sapcloud.io/v1beta1 + kind: Shoot + spec: + cloud: + alicloud: + networks: + pods: 10.243.128.0/17 + services: 10.243.0.0/17 + status: + lastOperation: + state: Succeeded +--- +apiVersion: extensions.gardener.cloud/v1alpha1 +kind: Infrastructure +metadata: + namespace: shoot--foo--bar + name: alicloud-infra +spec: + type: alicloud + region: eu-central-1 + secretRef: + namespace: shoot--foo--bar + name: core-alicloud +# sshPublicKey: base64(sshPublicKey) + providerConfig: + apiVersion: alicloud.provider.extensions.gardener.cloud/v1alpha1 + kind: InfrastructureConfig + networks: + vpc: # specify either 'id' or 'cidr' + # id: my-vnet + cidr: 10.250.0.0/16 + zones: + - name: eu-central-1a + worker: 10.250.1.0/24 + # resourceGroup: + # name: mygroup diff --git a/controllers/provider-alicloud/hack/generate-code b/controllers/provider-alicloud/hack/generate-code new file mode 100755 index 000000000..163b4075c --- /dev/null +++ b/controllers/provider-alicloud/hack/generate-code @@ -0,0 +1,53 @@ +#!/bin/bash +# +# Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +function headers() { + echo '''/* +Copyright (c) YEAR SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +''' +} + +rm -f $GOPATH/bin/*-gen + +$(dirname $0)/../../../vendor/k8s.io/code-generator/generate-internal-groups.sh \ + deepcopy,defaulter \ + github.com/gardener/gardener-extensions/controllers/provider-alicloud/pkg/client \ + github.com/gardener/gardener-extensions/controllers/provider-alicloud/pkg/apis \ + github.com/gardener/gardener-extensions/controllers/provider-alicloud/pkg/apis \ + "alicloud:v1alpha1" \ + -h <(headers) + +$(dirname $0)/../../../vendor/k8s.io/code-generator/generate-internal-groups.sh \ + conversion \ + github.com/gardener/gardener-extensions/controllers/provider-alicloud/pkg/client \ + github.com/gardener/gardener-extensions/controllers/provider-alicloud/pkg/apis \ + github.com/gardener/gardener-extensions/controllers/provider-alicloud/pkg/apis \ + "alicloud:v1alpha1" \ + --extra-peer-dirs=github.com/gardener/gardener-extensions/controllers/provider-alicloud/pkg/apis/alicloud,github.com/gardener/gardener-extensions/controllers/provider-alicloud/pkg/apis/alicloud/v1alpha1,k8s.io/apimachinery/pkg/apis/meta/v1,k8s.io/apimachinery/pkg/conversion,k8s.io/apimachinery/pkg/runtime \ + -h <(headers) diff --git a/controllers/provider-alicloud/pkg/alicloud/client/client.go b/controllers/provider-alicloud/pkg/alicloud/client/client.go new file mode 100644 index 000000000..ccb40c970 --- /dev/null +++ b/controllers/provider-alicloud/pkg/alicloud/client/client.go @@ -0,0 +1,82 @@ +// Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT 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 client + +import ( + "fmt" + corev1 "k8s.io/api/core/v1" + + alicloudvpc "github.com/aliyun/alibaba-cloud-sdk-go/services/vpc" +) + +const ( + // AccessKeyIDField is the data field in a secret where the access key id is stored at. + AccessKeyIDField = "accessKeyID" + // AccessKeySecretField is the data field in a secret where the access key secret is stored at. + AccessKeySecretField = "accessKeySecret" +) + +// ReadSecretCredentials reads the Credentials from the given secret. +func ReadSecretCredentials(secret *corev1.Secret) (*Credentials, error) { + if secret.Data == nil { + return nil, fmt.Errorf("secret %s/%s has no data section", secret.Namespace, secret.Name) + } + + accessKeyID, ok := secret.Data[AccessKeyIDField] + if !ok { + return nil, fmt.Errorf("secret %s/%s has no access key id at data.%s", secret.Namespace, secret.Name, AccessKeyIDField) + } + + accessKeySecret, ok := secret.Data[AccessKeySecretField] + if !ok { + return nil, fmt.Errorf("secret %s/%s has no access key secret at data.%s", secret.Namespace, secret.Name, AccessKeySecretField) + } + + return &Credentials{ + AccessKeyID: string(accessKeyID), + AccessKeySecret: string(accessKeySecret), + }, nil +} + +type factory struct{} + +// NewVPCClientWithAccessKey implements Factory. +func (factory) NewVPCClientWithAccessKey(region, accessKeyID, accessKeySecret string) (VPC, error) { + client, err := alicloudvpc.NewClientWithAccessKey(region, accessKeyID, accessKeySecret) + if err != nil { + return nil, err + } + + return &vpc{client}, nil +} + +type vpc struct { + vpc *alicloudvpc.Client +} + +// DescribeVPCs implements Factory. +func (v *vpc) DescribeVPCs(req *alicloudvpc.DescribeVpcsRequest) (*alicloudvpc.DescribeVpcsResponse, error) { + return v.vpc.DescribeVpcs(req) +} + +// DescribeNATGateways implements Factory. +func (v *vpc) DescribeNATGateways(req *alicloudvpc.DescribeNatGatewaysRequest) (*alicloudvpc.DescribeNatGatewaysResponse, error) { + return v.vpc.DescribeNatGateways(req) +} + +// DefaultFactory instantiates a default Factory. +func DefaultFactory() Factory { + return factory{} +} diff --git a/controllers/provider-alicloud/pkg/alicloud/client/types.go b/controllers/provider-alicloud/pkg/alicloud/client/types.go new file mode 100644 index 000000000..f9a6da510 --- /dev/null +++ b/controllers/provider-alicloud/pkg/alicloud/client/types.go @@ -0,0 +1,39 @@ +// Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT 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 client + +import ( + alicloudvpc "github.com/aliyun/alibaba-cloud-sdk-go/services/vpc" +) + +// Credentials are the credentials to access the Alicloud API. +type Credentials struct { + AccessKeyID string + AccessKeySecret string +} + +// VPC is the interface to the Alicloud VPC service. +type VPC interface { + // DescribeVPCs describes the VPCs for the request. + DescribeVPCs(req *alicloudvpc.DescribeVpcsRequest) (*alicloudvpc.DescribeVpcsResponse, error) + // DescribeNATGateways describes the NAT gateways for the request. + DescribeNATGateways(req *alicloudvpc.DescribeNatGatewaysRequest) (*alicloudvpc.DescribeNatGatewaysResponse, error) +} + +// Factory is the factory to instantiate Alicloud clients. +type Factory interface { + // NewVPCClientWithAccessKey creates a new VPC client from the given credentials and region. + NewVPCClientWithAccessKey(region, accessKeyID, accessKeySecret string) (VPC, error) +} diff --git a/controllers/provider-alicloud/pkg/alicloud/types.go b/controllers/provider-alicloud/pkg/alicloud/types.go index 03b7a776d..723bb32c0 100644 --- a/controllers/provider-alicloud/pkg/alicloud/types.go +++ b/controllers/provider-alicloud/pkg/alicloud/types.go @@ -17,8 +17,8 @@ package alicloud import "path/filepath" const ( - // TerraformerImageName is the name of the Terraformer image. - TerraformerImageName = "terraformer" + // InfraRelease is the name of the alicloud-infra chart. + InfraRelease = "alicloud-infra" ) var ( @@ -26,4 +26,6 @@ var ( ChartsPath = filepath.Join("controllers", "provider-alicloud", "charts") // InternalChartsPath is the path to the internal charts InternalChartsPath = filepath.Join(ChartsPath, "internal") + // InfraChartPath is the path to the alicloud-infra chart. + InfraChartPath = filepath.Join(InternalChartsPath, "alicloud-infra") ) diff --git a/controllers/provider-alicloud/pkg/apis/alicloud/doc.go b/controllers/provider-alicloud/pkg/apis/alicloud/doc.go new file mode 100644 index 000000000..3dcdc9fa0 --- /dev/null +++ b/controllers/provider-alicloud/pkg/apis/alicloud/doc.go @@ -0,0 +1,20 @@ +// Copyright (c) 2018 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// +k8s:deepcopy-gen=package +// +groupName="alicloud.provider.extensions.gardener.cloud" + +//go:generate ../../../hack/generate-code + +package alicloud // import "github.com/gardener/gardener-extensions/controllers/provider-alicloud/pkg/apis/alicloud" diff --git a/controllers/provider-alicloud/pkg/apis/alicloud/install/install.go b/controllers/provider-alicloud/pkg/apis/alicloud/install/install.go new file mode 100644 index 000000000..8ddc109d7 --- /dev/null +++ b/controllers/provider-alicloud/pkg/apis/alicloud/install/install.go @@ -0,0 +1,42 @@ +// Copyright (c) 2018 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT 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 install + +import ( + "github.com/gardener/gardener-extensions/controllers/provider-alicloud/pkg/apis/alicloud" + "github.com/gardener/gardener-extensions/controllers/provider-alicloud/pkg/apis/alicloud/v1alpha1" + "k8s.io/apimachinery/pkg/runtime" + utilruntime "k8s.io/apimachinery/pkg/util/runtime" +) + +var ( + schemeBuilder = runtime.NewSchemeBuilder( + v1alpha1.AddToScheme, + alicloud.AddToScheme, + setVersionPriority, + ) + + // AddToScheme adds all APIs to the scheme. + AddToScheme = schemeBuilder.AddToScheme +) + +func setVersionPriority(scheme *runtime.Scheme) error { + return scheme.SetVersionPriority(v1alpha1.SchemeGroupVersion) +} + +// Install installs all APIs in the scheme. +func Install(scheme *runtime.Scheme) { + utilruntime.Must(AddToScheme(scheme)) +} diff --git a/controllers/provider-alicloud/pkg/apis/alicloud/register.go b/controllers/provider-alicloud/pkg/apis/alicloud/register.go new file mode 100644 index 000000000..bc6076ebd --- /dev/null +++ b/controllers/provider-alicloud/pkg/apis/alicloud/register.go @@ -0,0 +1,52 @@ +// Copyright (c) 2018 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT 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 alicloud + +import ( + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" +) + +// GroupName is the group name use in this package +const GroupName = "alicloud.provider.extensions.gardener.cloud" + +// SchemeGroupVersion is group version used to register these objects +var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: runtime.APIVersionInternal} + +// Kind takes an unqualified kind and returns a Group qualified GroupKind +func Kind(kind string) schema.GroupKind { + return SchemeGroupVersion.WithKind(kind).GroupKind() +} + +// Resource takes an unqualified resource and returns a Group qualified GroupResource +func Resource(resource string) schema.GroupResource { + return SchemeGroupVersion.WithResource(resource).GroupResource() +} + +var ( + // SchemeBuilder used to register the Shoot resource. + SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) + // AddToScheme is a pointer to SchemeBuilder.AddToScheme. + AddToScheme = SchemeBuilder.AddToScheme +) + +// Adds the list of known types to api.Scheme. +func addKnownTypes(scheme *runtime.Scheme) error { + scheme.AddKnownTypes(SchemeGroupVersion, + &InfrastructureConfig{}, + &InfrastructureStatus{}, + ) + return nil +} diff --git a/controllers/provider-alicloud/pkg/apis/alicloud/types_infrastructure.go b/controllers/provider-alicloud/pkg/apis/alicloud/types_infrastructure.go new file mode 100644 index 000000000..a380ad857 --- /dev/null +++ b/controllers/provider-alicloud/pkg/apis/alicloud/types_infrastructure.go @@ -0,0 +1,68 @@ +// Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT 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 alicloud + +import ( + gardencorev1alpha1 "github.com/gardener/gardener/pkg/apis/core/v1alpha1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// InfrastructureConfig infrastructure configuration resource +type InfrastructureConfig struct { + metav1.TypeMeta + + // Networks specifies the networks for an infrastructure. + Networks Networks +} + +// Networks specifies the networks for an infrastructure. +type Networks struct { + // VPC contains information about whether to create a new or use an existing VPC. + VPC VPC + + // Zones are the network zones for an infrastructure. + Zones []Zone +} + +// VPC contains information about whether to create a new or use an existing VPC. +type VPC struct { + // ID is the ID of an existing VPC. + // +optional + ID *string + // CIDR is the CIDR of a VPC to create. + // +optional + CIDR *gardencorev1alpha1.CIDR +} + +// Zone is a zone with a name and worker CIDR. +type Zone struct { + // Name is the name of a zone. + Name string + // Worker specifies the worker CIDR to use. + Worker gardencorev1alpha1.CIDR +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// InfrastructureStatus contains information about created infrastructure resources. +type InfrastructureStatus struct { + metav1.TypeMeta + + VPC VPC + SecurityGroupID string + KeyPairName string +} diff --git a/controllers/provider-alicloud/pkg/apis/alicloud/v1alpha1/defaults.go b/controllers/provider-alicloud/pkg/apis/alicloud/v1alpha1/defaults.go new file mode 100644 index 000000000..8b665d270 --- /dev/null +++ b/controllers/provider-alicloud/pkg/apis/alicloud/v1alpha1/defaults.go @@ -0,0 +1,23 @@ +// Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT 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 v1alpha1 + +import ( + "k8s.io/apimachinery/pkg/runtime" +) + +func addDefaultingFuncs(scheme *runtime.Scheme) error { + return RegisterDefaults(scheme) +} diff --git a/controllers/provider-alicloud/pkg/apis/alicloud/v1alpha1/doc.go b/controllers/provider-alicloud/pkg/apis/alicloud/v1alpha1/doc.go new file mode 100644 index 000000000..601bb1dc2 --- /dev/null +++ b/controllers/provider-alicloud/pkg/apis/alicloud/v1alpha1/doc.go @@ -0,0 +1,20 @@ +// Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// +k8s:deepcopy-gen=package +// +k8s:conversion-gen=github.com/gardener/gardener-extensions/controllers/provider-alicloud/pkg/apis/alicloud +// +k8s:openapi-gen=true +// +k8s:defaulter-gen=TypeMeta + +package v1alpha1 // import "github.com/gardener/gardener-extensions/controllers/provider-alicloud/pkg/apis/alicloud/v1alpha1" diff --git a/controllers/provider-alicloud/pkg/apis/alicloud/v1alpha1/register.go b/controllers/provider-alicloud/pkg/apis/alicloud/v1alpha1/register.go new file mode 100644 index 000000000..f97bbc0d4 --- /dev/null +++ b/controllers/provider-alicloud/pkg/apis/alicloud/v1alpha1/register.go @@ -0,0 +1,55 @@ +// Copyright (c) 2018 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT 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 v1alpha1 + +import ( + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" +) + +// GroupName is the group name use in this package +const GroupName = "alicloud.provider.extensions.gardener.cloud" + +// SchemeGroupVersion is group version used to register these objects +var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1alpha1"} + +// Resource takes an unqualified resource and returns a Group qualified GroupResource +func Resource(resource string) schema.GroupResource { + return SchemeGroupVersion.WithResource(resource).GroupResource() +} + +var ( + // SchemeBuilder used to register the Shoot resource. + SchemeBuilder runtime.SchemeBuilder + localSchemeBuilder = &SchemeBuilder + // AddToScheme is a pointer to SchemeBuilder.AddToScheme. + AddToScheme = localSchemeBuilder.AddToScheme +) + +func init() { + // We only register manually written functions here. The registration of the + // generated functions takes place in the generated files. The separation + // makes the code compile even when the generated files are missing. + localSchemeBuilder.Register(addDefaultingFuncs, addKnownTypes) +} + +// Adds the list of known types to api.Scheme. +func addKnownTypes(scheme *runtime.Scheme) error { + scheme.AddKnownTypes(SchemeGroupVersion, + &InfrastructureConfig{}, + &InfrastructureStatus{}, + ) + return nil +} diff --git a/controllers/provider-alicloud/pkg/apis/alicloud/v1alpha1/types_infrastructure.go b/controllers/provider-alicloud/pkg/apis/alicloud/v1alpha1/types_infrastructure.go new file mode 100644 index 000000000..e21b1b353 --- /dev/null +++ b/controllers/provider-alicloud/pkg/apis/alicloud/v1alpha1/types_infrastructure.go @@ -0,0 +1,68 @@ +// Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT 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 v1alpha1 + +import ( + gardencorev1alpha1 "github.com/gardener/gardener/pkg/apis/core/v1alpha1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// InfrastructureConfig infrastructure configuration resource +type InfrastructureConfig struct { + metav1.TypeMeta `json:",inline"` + + // Networks specifies the networks for an infrastructure. + Networks Networks `json:"networks"` +} + +// Networks specifies the networks for an infrastructure. +type Networks struct { + // VPC contains information about whether to create a new or use an existing VPC. + VPC VPC `json:"vpc"` + + // Zones are the network zones for an infrastructure. + Zones []Zone `json:"zones"` +} + +// VPC contains information about whether to create a new or use an existing VPC. +type VPC struct { + // ID is the ID of an existing VPC. + // +optional + ID *string `json:"id,omitempty"` + // CIDR is the CIDR of a VPC to create. + // +optional + CIDR *gardencorev1alpha1.CIDR `json:"cidr,omitempty"` +} + +// Zone is a zone with a name and worker CIDR. +type Zone struct { + // Name is the name of a zone. + Name string `json:"name"` + // Worker specifies the worker CIDR to use. + Worker gardencorev1alpha1.CIDR `json:"worker"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// InfrastructureStatus contains information about created infrastructure resources. +type InfrastructureStatus struct { + metav1.TypeMeta `json:",inline"` + + VPC VPC `json:"vpc"` + SecurityGroupID string `json:"securityGroupId"` + KeyPairName string `json:"keyPairName"` +} diff --git a/controllers/provider-alicloud/pkg/apis/alicloud/v1alpha1/zz_generated.conversion.go b/controllers/provider-alicloud/pkg/apis/alicloud/v1alpha1/zz_generated.conversion.go new file mode 100644 index 000000000..c059d76f2 --- /dev/null +++ b/controllers/provider-alicloud/pkg/apis/alicloud/v1alpha1/zz_generated.conversion.go @@ -0,0 +1,212 @@ +// +build !ignore_autogenerated + +/* +Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT 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 conversion-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + unsafe "unsafe" + + alicloud "github.com/gardener/gardener-extensions/controllers/provider-alicloud/pkg/apis/alicloud" + corev1alpha1 "github.com/gardener/gardener/pkg/apis/core/v1alpha1" + conversion "k8s.io/apimachinery/pkg/conversion" + runtime "k8s.io/apimachinery/pkg/runtime" +) + +func init() { + localSchemeBuilder.Register(RegisterConversions) +} + +// RegisterConversions adds conversion functions to the given scheme. +// Public to allow building arbitrary schemes. +func RegisterConversions(s *runtime.Scheme) error { + if err := s.AddGeneratedConversionFunc((*InfrastructureConfig)(nil), (*alicloud.InfrastructureConfig)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha1_InfrastructureConfig_To_alicloud_InfrastructureConfig(a.(*InfrastructureConfig), b.(*alicloud.InfrastructureConfig), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*alicloud.InfrastructureConfig)(nil), (*InfrastructureConfig)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_alicloud_InfrastructureConfig_To_v1alpha1_InfrastructureConfig(a.(*alicloud.InfrastructureConfig), b.(*InfrastructureConfig), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*InfrastructureStatus)(nil), (*alicloud.InfrastructureStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha1_InfrastructureStatus_To_alicloud_InfrastructureStatus(a.(*InfrastructureStatus), b.(*alicloud.InfrastructureStatus), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*alicloud.InfrastructureStatus)(nil), (*InfrastructureStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_alicloud_InfrastructureStatus_To_v1alpha1_InfrastructureStatus(a.(*alicloud.InfrastructureStatus), b.(*InfrastructureStatus), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*Networks)(nil), (*alicloud.Networks)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha1_Networks_To_alicloud_Networks(a.(*Networks), b.(*alicloud.Networks), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*alicloud.Networks)(nil), (*Networks)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_alicloud_Networks_To_v1alpha1_Networks(a.(*alicloud.Networks), b.(*Networks), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*VPC)(nil), (*alicloud.VPC)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha1_VPC_To_alicloud_VPC(a.(*VPC), b.(*alicloud.VPC), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*alicloud.VPC)(nil), (*VPC)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_alicloud_VPC_To_v1alpha1_VPC(a.(*alicloud.VPC), b.(*VPC), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*Zone)(nil), (*alicloud.Zone)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha1_Zone_To_alicloud_Zone(a.(*Zone), b.(*alicloud.Zone), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*alicloud.Zone)(nil), (*Zone)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_alicloud_Zone_To_v1alpha1_Zone(a.(*alicloud.Zone), b.(*Zone), scope) + }); err != nil { + return err + } + return nil +} + +func autoConvert_v1alpha1_InfrastructureConfig_To_alicloud_InfrastructureConfig(in *InfrastructureConfig, out *alicloud.InfrastructureConfig, s conversion.Scope) error { + if err := Convert_v1alpha1_Networks_To_alicloud_Networks(&in.Networks, &out.Networks, s); err != nil { + return err + } + return nil +} + +// Convert_v1alpha1_InfrastructureConfig_To_alicloud_InfrastructureConfig is an autogenerated conversion function. +func Convert_v1alpha1_InfrastructureConfig_To_alicloud_InfrastructureConfig(in *InfrastructureConfig, out *alicloud.InfrastructureConfig, s conversion.Scope) error { + return autoConvert_v1alpha1_InfrastructureConfig_To_alicloud_InfrastructureConfig(in, out, s) +} + +func autoConvert_alicloud_InfrastructureConfig_To_v1alpha1_InfrastructureConfig(in *alicloud.InfrastructureConfig, out *InfrastructureConfig, s conversion.Scope) error { + if err := Convert_alicloud_Networks_To_v1alpha1_Networks(&in.Networks, &out.Networks, s); err != nil { + return err + } + return nil +} + +// Convert_alicloud_InfrastructureConfig_To_v1alpha1_InfrastructureConfig is an autogenerated conversion function. +func Convert_alicloud_InfrastructureConfig_To_v1alpha1_InfrastructureConfig(in *alicloud.InfrastructureConfig, out *InfrastructureConfig, s conversion.Scope) error { + return autoConvert_alicloud_InfrastructureConfig_To_v1alpha1_InfrastructureConfig(in, out, s) +} + +func autoConvert_v1alpha1_InfrastructureStatus_To_alicloud_InfrastructureStatus(in *InfrastructureStatus, out *alicloud.InfrastructureStatus, s conversion.Scope) error { + if err := Convert_v1alpha1_VPC_To_alicloud_VPC(&in.VPC, &out.VPC, s); err != nil { + return err + } + out.SecurityGroupID = in.SecurityGroupID + out.KeyPairName = in.KeyPairName + return nil +} + +// Convert_v1alpha1_InfrastructureStatus_To_alicloud_InfrastructureStatus is an autogenerated conversion function. +func Convert_v1alpha1_InfrastructureStatus_To_alicloud_InfrastructureStatus(in *InfrastructureStatus, out *alicloud.InfrastructureStatus, s conversion.Scope) error { + return autoConvert_v1alpha1_InfrastructureStatus_To_alicloud_InfrastructureStatus(in, out, s) +} + +func autoConvert_alicloud_InfrastructureStatus_To_v1alpha1_InfrastructureStatus(in *alicloud.InfrastructureStatus, out *InfrastructureStatus, s conversion.Scope) error { + if err := Convert_alicloud_VPC_To_v1alpha1_VPC(&in.VPC, &out.VPC, s); err != nil { + return err + } + out.SecurityGroupID = in.SecurityGroupID + out.KeyPairName = in.KeyPairName + return nil +} + +// Convert_alicloud_InfrastructureStatus_To_v1alpha1_InfrastructureStatus is an autogenerated conversion function. +func Convert_alicloud_InfrastructureStatus_To_v1alpha1_InfrastructureStatus(in *alicloud.InfrastructureStatus, out *InfrastructureStatus, s conversion.Scope) error { + return autoConvert_alicloud_InfrastructureStatus_To_v1alpha1_InfrastructureStatus(in, out, s) +} + +func autoConvert_v1alpha1_Networks_To_alicloud_Networks(in *Networks, out *alicloud.Networks, s conversion.Scope) error { + if err := Convert_v1alpha1_VPC_To_alicloud_VPC(&in.VPC, &out.VPC, s); err != nil { + return err + } + out.Zones = *(*[]alicloud.Zone)(unsafe.Pointer(&in.Zones)) + return nil +} + +// Convert_v1alpha1_Networks_To_alicloud_Networks is an autogenerated conversion function. +func Convert_v1alpha1_Networks_To_alicloud_Networks(in *Networks, out *alicloud.Networks, s conversion.Scope) error { + return autoConvert_v1alpha1_Networks_To_alicloud_Networks(in, out, s) +} + +func autoConvert_alicloud_Networks_To_v1alpha1_Networks(in *alicloud.Networks, out *Networks, s conversion.Scope) error { + if err := Convert_alicloud_VPC_To_v1alpha1_VPC(&in.VPC, &out.VPC, s); err != nil { + return err + } + out.Zones = *(*[]Zone)(unsafe.Pointer(&in.Zones)) + return nil +} + +// Convert_alicloud_Networks_To_v1alpha1_Networks is an autogenerated conversion function. +func Convert_alicloud_Networks_To_v1alpha1_Networks(in *alicloud.Networks, out *Networks, s conversion.Scope) error { + return autoConvert_alicloud_Networks_To_v1alpha1_Networks(in, out, s) +} + +func autoConvert_v1alpha1_VPC_To_alicloud_VPC(in *VPC, out *alicloud.VPC, s conversion.Scope) error { + out.ID = (*string)(unsafe.Pointer(in.ID)) + out.CIDR = (*corev1alpha1.CIDR)(unsafe.Pointer(in.CIDR)) + return nil +} + +// Convert_v1alpha1_VPC_To_alicloud_VPC is an autogenerated conversion function. +func Convert_v1alpha1_VPC_To_alicloud_VPC(in *VPC, out *alicloud.VPC, s conversion.Scope) error { + return autoConvert_v1alpha1_VPC_To_alicloud_VPC(in, out, s) +} + +func autoConvert_alicloud_VPC_To_v1alpha1_VPC(in *alicloud.VPC, out *VPC, s conversion.Scope) error { + out.ID = (*string)(unsafe.Pointer(in.ID)) + out.CIDR = (*corev1alpha1.CIDR)(unsafe.Pointer(in.CIDR)) + return nil +} + +// Convert_alicloud_VPC_To_v1alpha1_VPC is an autogenerated conversion function. +func Convert_alicloud_VPC_To_v1alpha1_VPC(in *alicloud.VPC, out *VPC, s conversion.Scope) error { + return autoConvert_alicloud_VPC_To_v1alpha1_VPC(in, out, s) +} + +func autoConvert_v1alpha1_Zone_To_alicloud_Zone(in *Zone, out *alicloud.Zone, s conversion.Scope) error { + out.Name = in.Name + out.Worker = corev1alpha1.CIDR(in.Worker) + return nil +} + +// Convert_v1alpha1_Zone_To_alicloud_Zone is an autogenerated conversion function. +func Convert_v1alpha1_Zone_To_alicloud_Zone(in *Zone, out *alicloud.Zone, s conversion.Scope) error { + return autoConvert_v1alpha1_Zone_To_alicloud_Zone(in, out, s) +} + +func autoConvert_alicloud_Zone_To_v1alpha1_Zone(in *alicloud.Zone, out *Zone, s conversion.Scope) error { + out.Name = in.Name + out.Worker = corev1alpha1.CIDR(in.Worker) + return nil +} + +// Convert_alicloud_Zone_To_v1alpha1_Zone is an autogenerated conversion function. +func Convert_alicloud_Zone_To_v1alpha1_Zone(in *alicloud.Zone, out *Zone, s conversion.Scope) error { + return autoConvert_alicloud_Zone_To_v1alpha1_Zone(in, out, s) +} diff --git a/controllers/provider-alicloud/pkg/apis/alicloud/v1alpha1/zz_generated.deepcopy.go b/controllers/provider-alicloud/pkg/apis/alicloud/v1alpha1/zz_generated.deepcopy.go new file mode 100644 index 000000000..e04c80e58 --- /dev/null +++ b/controllers/provider-alicloud/pkg/apis/alicloud/v1alpha1/zz_generated.deepcopy.go @@ -0,0 +1,142 @@ +// +build !ignore_autogenerated + +/* +Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT 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 deepcopy-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + corev1alpha1 "github.com/gardener/gardener/pkg/apis/core/v1alpha1" + runtime "k8s.io/apimachinery/pkg/runtime" +) + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *InfrastructureConfig) DeepCopyInto(out *InfrastructureConfig) { + *out = *in + out.TypeMeta = in.TypeMeta + in.Networks.DeepCopyInto(&out.Networks) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InfrastructureConfig. +func (in *InfrastructureConfig) DeepCopy() *InfrastructureConfig { + if in == nil { + return nil + } + out := new(InfrastructureConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *InfrastructureConfig) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *InfrastructureStatus) DeepCopyInto(out *InfrastructureStatus) { + *out = *in + out.TypeMeta = in.TypeMeta + in.VPC.DeepCopyInto(&out.VPC) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InfrastructureStatus. +func (in *InfrastructureStatus) DeepCopy() *InfrastructureStatus { + if in == nil { + return nil + } + out := new(InfrastructureStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *InfrastructureStatus) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Networks) DeepCopyInto(out *Networks) { + *out = *in + in.VPC.DeepCopyInto(&out.VPC) + if in.Zones != nil { + in, out := &in.Zones, &out.Zones + *out = make([]Zone, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Networks. +func (in *Networks) DeepCopy() *Networks { + if in == nil { + return nil + } + out := new(Networks) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VPC) DeepCopyInto(out *VPC) { + *out = *in + if in.ID != nil { + in, out := &in.ID, &out.ID + *out = new(string) + **out = **in + } + if in.CIDR != nil { + in, out := &in.CIDR, &out.CIDR + *out = new(corev1alpha1.CIDR) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VPC. +func (in *VPC) DeepCopy() *VPC { + if in == nil { + return nil + } + out := new(VPC) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Zone) DeepCopyInto(out *Zone) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Zone. +func (in *Zone) DeepCopy() *Zone { + if in == nil { + return nil + } + out := new(Zone) + in.DeepCopyInto(out) + return out +} diff --git a/controllers/provider-alicloud/pkg/apis/alicloud/v1alpha1/zz_generated.defaults.go b/controllers/provider-alicloud/pkg/apis/alicloud/v1alpha1/zz_generated.defaults.go new file mode 100644 index 000000000..7985166a6 --- /dev/null +++ b/controllers/provider-alicloud/pkg/apis/alicloud/v1alpha1/zz_generated.defaults.go @@ -0,0 +1,16 @@ +// +build !ignore_autogenerated + +// Code generated by defaulter-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + runtime "k8s.io/apimachinery/pkg/runtime" +) + +// RegisterDefaults adds defaulters functions to the given scheme. +// Public to allow building arbitrary schemes. +// All generated defaulters are covering - they call all nested defaulters. +func RegisterDefaults(scheme *runtime.Scheme) error { + return nil +} diff --git a/controllers/provider-alicloud/pkg/apis/alicloud/zz_generated.deepcopy.go b/controllers/provider-alicloud/pkg/apis/alicloud/zz_generated.deepcopy.go new file mode 100644 index 000000000..317c5747c --- /dev/null +++ b/controllers/provider-alicloud/pkg/apis/alicloud/zz_generated.deepcopy.go @@ -0,0 +1,142 @@ +// +build !ignore_autogenerated + +/* +Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT 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 deepcopy-gen. DO NOT EDIT. + +package alicloud + +import ( + v1alpha1 "github.com/gardener/gardener/pkg/apis/core/v1alpha1" + runtime "k8s.io/apimachinery/pkg/runtime" +) + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *InfrastructureConfig) DeepCopyInto(out *InfrastructureConfig) { + *out = *in + out.TypeMeta = in.TypeMeta + in.Networks.DeepCopyInto(&out.Networks) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InfrastructureConfig. +func (in *InfrastructureConfig) DeepCopy() *InfrastructureConfig { + if in == nil { + return nil + } + out := new(InfrastructureConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *InfrastructureConfig) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *InfrastructureStatus) DeepCopyInto(out *InfrastructureStatus) { + *out = *in + out.TypeMeta = in.TypeMeta + in.VPC.DeepCopyInto(&out.VPC) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InfrastructureStatus. +func (in *InfrastructureStatus) DeepCopy() *InfrastructureStatus { + if in == nil { + return nil + } + out := new(InfrastructureStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *InfrastructureStatus) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Networks) DeepCopyInto(out *Networks) { + *out = *in + in.VPC.DeepCopyInto(&out.VPC) + if in.Zones != nil { + in, out := &in.Zones, &out.Zones + *out = make([]Zone, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Networks. +func (in *Networks) DeepCopy() *Networks { + if in == nil { + return nil + } + out := new(Networks) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VPC) DeepCopyInto(out *VPC) { + *out = *in + if in.ID != nil { + in, out := &in.ID, &out.ID + *out = new(string) + **out = **in + } + if in.CIDR != nil { + in, out := &in.CIDR, &out.CIDR + *out = new(v1alpha1.CIDR) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VPC. +func (in *VPC) DeepCopy() *VPC { + if in == nil { + return nil + } + out := new(VPC) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Zone) DeepCopyInto(out *Zone) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Zone. +func (in *Zone) DeepCopy() *Zone { + if in == nil { + return nil + } + out := new(Zone) + in.DeepCopyInto(out) + return out +} diff --git a/controllers/provider-alicloud/pkg/controller/common/common_test.go b/controllers/provider-alicloud/pkg/controller/common/common_test.go new file mode 100644 index 000000000..b1fc3b4dc --- /dev/null +++ b/controllers/provider-alicloud/pkg/controller/common/common_test.go @@ -0,0 +1,26 @@ +// Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT 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 common + +import ( + . "github.com/onsi/ginkgo" + . "github.com/onsi/gomega" + "testing" +) + +func TestCommon(t *testing.T) { + RegisterFailHandler(Fail) + RunSpecs(t, "Common") +} diff --git a/controllers/provider-alicloud/pkg/controller/common/terraform.go b/controllers/provider-alicloud/pkg/controller/common/terraform.go new file mode 100644 index 000000000..98dffa3a1 --- /dev/null +++ b/controllers/provider-alicloud/pkg/controller/common/terraform.go @@ -0,0 +1,43 @@ +// Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT 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 common + +import ( + "github.com/gardener/gardener-extensions/controllers/provider-alicloud/pkg/alicloud/client" + "github.com/gardener/gardener-extensions/controllers/provider-alicloud/pkg/imagevector" + "github.com/gardener/gardener-extensions/pkg/gardener/terraformer" + "github.com/gardener/gardener/pkg/logger" + "k8s.io/client-go/rest" +) + +const ( + TerraformVarAccessKeyID = "TF_VAR_ACCESS_KEY_ID" + TerraformVarAccessKeySecret = "TF_VAR_ACCESS_KEY_SECRET" +) + +// NewTerraformer creates a new Terraformer and initializes it with the credentials. +func NewTerraformer(factory terraformer.Factory, config *rest.Config, credentials *client.Credentials, purpose, namespace, name string) (terraformer.Interface, error) { + tf, err := factory.NewForConfig(logger.NewLogger("info"), config, purpose, namespace, name, imagevector.TerraformerImage()) + if err != nil { + return nil, err + } + + variablesEnvironment := map[string]string{ + TerraformVarAccessKeyID: credentials.AccessKeyID, + TerraformVarAccessKeySecret: credentials.AccessKeySecret, + } + + return tf.SetVariablesEnvironment(variablesEnvironment), nil +} diff --git a/controllers/provider-alicloud/pkg/controller/common/terraform_test.go b/controllers/provider-alicloud/pkg/controller/common/terraform_test.go new file mode 100644 index 000000000..ed9e2de78 --- /dev/null +++ b/controllers/provider-alicloud/pkg/controller/common/terraform_test.go @@ -0,0 +1,71 @@ +// Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT 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 common + +import ( + "github.com/gardener/gardener-extensions/controllers/provider-alicloud/pkg/alicloud/client" + "github.com/gardener/gardener-extensions/controllers/provider-alicloud/pkg/imagevector" + mockterraformer "github.com/gardener/gardener-extensions/pkg/mock/gardener-extensions/gardener/terraformer" + "github.com/golang/mock/gomock" + . "github.com/onsi/ginkgo" + . "github.com/onsi/gomega" + "k8s.io/client-go/rest" +) + +var _ = Describe("Terraform", func() { + var ( + ctrl *gomock.Controller + ) + BeforeEach(func() { + ctrl = gomock.NewController(GinkgoT()) + }) + AfterEach(func() { + ctrl.Finish() + }) + + Describe("#NewTerraformer", func() { + It("should create a new terraformer and initialize it with the credentials", func() { + var ( + factory = mockterraformer.NewMockFactory(ctrl) + tf = mockterraformer.NewMockInterface(ctrl) + config rest.Config + accessKeyID = "accessKeyID" + accessKeySecret = "accessKeySecret" + credentials = client.Credentials{ + AccessKeyID: accessKeyID, + AccessKeySecret: accessKeySecret, + } + purpose = "purpose" + namespace = "namespace" + name = "name" + ) + + gomock.InOrder( + factory.EXPECT(). + NewForConfig(gomock.Any(), &config, purpose, namespace, name, imagevector.TerraformerImage()). + Return(tf, nil), + + tf.EXPECT().SetVariablesEnvironment(map[string]string{ + TerraformVarAccessKeyID: accessKeyID, + TerraformVarAccessKeySecret: accessKeySecret, + }).Return(tf), + ) + + actual, err := NewTerraformer(factory, &config, &credentials, purpose, namespace, name) + Expect(err).NotTo(HaveOccurred()) + Expect(actual).To(BeIdenticalTo(tf)) + }) + }) +}) diff --git a/controllers/provider-alicloud/pkg/controller/controller.go b/controllers/provider-alicloud/pkg/controller/controller.go new file mode 100644 index 000000000..b2cf88623 --- /dev/null +++ b/controllers/provider-alicloud/pkg/controller/controller.go @@ -0,0 +1,29 @@ +// Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT 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 controller + +import ( + "github.com/gardener/gardener-extensions/controllers/provider-alicloud/pkg/controller/infrastructure" + "github.com/gardener/gardener-extensions/pkg/controller" +) + +var ( + addToManagerBuilder = controller.NewAddToManagerBuilder( + infrastructure.AddToManager, + ) + + // AddToManager adds all controllers to the given manager. + AddToManager = addToManagerBuilder.AddToManager +) diff --git a/controllers/provider-alicloud/pkg/controller/infrastructure/actuator.go b/controllers/provider-alicloud/pkg/controller/infrastructure/actuator.go new file mode 100644 index 000000000..26d6d5f97 --- /dev/null +++ b/controllers/provider-alicloud/pkg/controller/infrastructure/actuator.go @@ -0,0 +1,227 @@ +// Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT 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 infrastructure + +import ( + "context" + "github.com/gardener/gardener-extensions/controllers/provider-alicloud/pkg/alicloud" + alicloudclient "github.com/gardener/gardener-extensions/controllers/provider-alicloud/pkg/alicloud/client" + "github.com/gardener/gardener-extensions/controllers/provider-alicloud/pkg/apis/alicloud/v1alpha1" + "github.com/gardener/gardener-extensions/controllers/provider-alicloud/pkg/controller/common" + extensioncontroller "github.com/gardener/gardener-extensions/pkg/controller" + controllererrors "github.com/gardener/gardener-extensions/pkg/controller/error" + "github.com/gardener/gardener-extensions/pkg/controller/infrastructure" + extensionschartrenderer "github.com/gardener/gardener-extensions/pkg/gardener/chartrenderer" + "github.com/gardener/gardener-extensions/pkg/gardener/terraformer" + chartutil "github.com/gardener/gardener-extensions/pkg/util/chart" + extensionsv1alpha1 "github.com/gardener/gardener/pkg/apis/extensions/v1alpha1" + "github.com/gardener/gardener/pkg/chartrenderer" + "github.com/go-logr/logr" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/serializer" + "k8s.io/client-go/rest" + "k8s.io/client-go/util/retry" + "sigs.k8s.io/controller-runtime/pkg/client" + "sigs.k8s.io/controller-runtime/pkg/runtime/log" + "time" +) + +// NewActuator instantiates an actuator with the default dependencies. +func NewActuator() infrastructure.Actuator { + return NewActuatorWithDeps( + log.Log.WithName("infrastructure-actuator"), + alicloudclient.DefaultFactory(), + terraformer.DefaultFactory(), + extensionschartrenderer.DefaultFactory(), + ) +} + +// NewActuatorWithDeps instantiates an actuator with the given dependencies. +func NewActuatorWithDeps( + logger logr.Logger, + alicloudClientFactory alicloudclient.Factory, + terraformerFactory terraformer.Factory, + chartRendererFactory extensionschartrenderer.Factory, +) infrastructure.Actuator { + a := &actuator{ + logger: logger, + + alicloudClientFactory: alicloudClientFactory, + terraformerFactory: terraformerFactory, + chartRendererFactory: chartRendererFactory, + } + + return a +} + +type actuator struct { + decoder runtime.Decoder + logger logr.Logger + + alicloudClientFactory alicloudclient.Factory + terraformerFactory terraformer.Factory + chartRendererFactory extensionschartrenderer.Factory + + client client.Client + config *rest.Config + + chartRenderer chartrenderer.Interface +} + +func (a *actuator) InjectScheme(scheme *runtime.Scheme) error { + a.decoder = serializer.NewCodecFactory(scheme).UniversalDeserializer() + return nil +} + +// InjectClient implements inject.Client. +func (a *actuator) InjectClient(client client.Client) error { + a.client = client + return nil +} + +// InjectConfig implements inject.Config. +func (a *actuator) InjectConfig(config *rest.Config) error { + a.config = config + + var err error + a.chartRenderer, err = a.chartRendererFactory.NewForConfig(config) + return err +} + +func (a *actuator) getConfigAndCredentialsForInfra(ctx context.Context, infra *extensionsv1alpha1.Infrastructure) (*v1alpha1.InfrastructureConfig, *alicloudclient.Credentials, error) { + config := &v1alpha1.InfrastructureConfig{} + if _, _, err := a.decoder.Decode(infra.Spec.ProviderConfig.Raw, nil, config); err != nil { + return nil, nil, err + } + + secret, err := extensioncontroller.GetSecretByReference(ctx, a.client, &infra.Spec.SecretRef) + if err != nil { + return nil, nil, err + } + + credentials, err := alicloudclient.ReadSecretCredentials(secret) + if err != nil { + return nil, nil, err + } + + return config, credentials, nil +} + +func (a *actuator) getInitializerValues( + infra *extensionsv1alpha1.Infrastructure, + config *v1alpha1.InfrastructureConfig, + credentials *alicloudclient.Credentials, +) (*InitializerValues, error) { + if config.Networks.VPC.ID == nil { + return ComputeCreateVPCInitializerValues(config), nil + } + + vpcID := *config.Networks.VPC.ID + vpcClient, err := a.alicloudClientFactory.NewVPCClientWithAccessKey(infra.Spec.Region, credentials.AccessKeyID, credentials.AccessKeySecret) + if err != nil { + return nil, err + } + + vpcInfo, err := GetVPCInfo(vpcClient, vpcID) + if err != nil { + return nil, err + } + + return ComputeUseVPCInitializerValues(config, vpcInfo), nil +} + +func (a *actuator) newInitializer(infra *extensionsv1alpha1.Infrastructure, config *v1alpha1.InfrastructureConfig, values *InitializerValues) (terraformer.Initializer, error) { + chartValues := ComputeTerraformerChartValues(infra, config, values) + release, err := a.chartRenderer.Render(alicloud.InfraChartPath, alicloud.InfraRelease, infra.Namespace, chartValues) + if err != nil { + return nil, err + } + + files, err := chartutil.ExtractTerraformFiles(release) + if err != nil { + return nil, err + } + + return a.terraformerFactory.DefaultInitializer(a.client, files.Main, files.Variables, files.TFVars), nil +} + +func (a *actuator) newTerraformer(infra *extensionsv1alpha1.Infrastructure, credentials *alicloudclient.Credentials) (terraformer.Interface, error) { + return common.NewTerraformer(a.terraformerFactory, a.config, credentials, TerraformerPurpose, infra.Namespace, infra.Name) +} + +// Reconcile implements infrastructure.Actuator. +func (a *actuator) Reconcile(ctx context.Context, infra *extensionsv1alpha1.Infrastructure, cluster *extensioncontroller.Cluster) error { + config, credentials, err := a.getConfigAndCredentialsForInfra(ctx, infra) + if err != nil { + return err + } + + initializerValues, err := a.getInitializerValues(infra, config, credentials) + if err != nil { + return err + } + + initializer, err := a.newInitializer(infra, config, initializerValues) + if err != nil { + return err + } + + tf, err := a.newTerraformer(infra, credentials) + if err != nil { + return err + } + + if err := tf.InitializeWith(initializer).Apply(); err != nil { + a.logger.Error(err, "failed to apply the terraform config", "infrastructure", infra.Name) + return &controllererrors.RequeueAfterError{ + Cause: err, + RequeueAfter: 30 * time.Second, + } + } + + tfStatus, err := ExtractTerraformStatus(tf) + if err != nil { + return err + } + + status := StatusFromTerraformStatus(tfStatus) + return extensioncontroller.TryUpdateStatus(ctx, retry.DefaultBackoff, a.client, infra, func() error { + infra.Status.ProviderStatus = &runtime.RawExtension{Object: status} + return nil + }) +} + +// Delete implements infrastructure.Actuator. +func (a *actuator) Delete(ctx context.Context, infra *extensionsv1alpha1.Infrastructure, cluster *extensioncontroller.Cluster) error { + _, credentials, err := a.getConfigAndCredentialsForInfra(ctx, infra) + if err != nil { + return err + } + + tf, err := a.newTerraformer(infra, credentials) + if err != nil { + return err + } + + configExists, err := tf.ConfigExists() + if err != nil { + return err + } + if !configExists { + return nil + } + + return tf.Destroy() +} diff --git a/controllers/provider-alicloud/pkg/controller/infrastructure/actuator_test.go b/controllers/provider-alicloud/pkg/controller/infrastructure/actuator_test.go new file mode 100644 index 000000000..44e0eba51 --- /dev/null +++ b/controllers/provider-alicloud/pkg/controller/infrastructure/actuator_test.go @@ -0,0 +1,203 @@ +// Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT 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 infrastructure + +import ( + "context" + "fmt" + "github.com/gardener/gardener-extensions/controllers/provider-alicloud/pkg/alicloud" + alicloudclient "github.com/gardener/gardener-extensions/controllers/provider-alicloud/pkg/alicloud/client" + "github.com/gardener/gardener-extensions/controllers/provider-alicloud/pkg/apis/alicloud/install" + "github.com/gardener/gardener-extensions/controllers/provider-alicloud/pkg/apis/alicloud/v1alpha1" + "github.com/gardener/gardener-extensions/controllers/provider-alicloud/pkg/controller/common" + "github.com/gardener/gardener-extensions/controllers/provider-alicloud/pkg/imagevector" + mockalicloudclient "github.com/gardener/gardener-extensions/controllers/provider-alicloud/pkg/mock/provider-alicloud/alicloud/client" + "github.com/gardener/gardener-extensions/pkg/controller" + mockclient "github.com/gardener/gardener-extensions/pkg/mock/controller-runtime/client" + mockchartrenderer "github.com/gardener/gardener-extensions/pkg/mock/gardener-extensions/gardener/chartrenderer" + mockterraformer "github.com/gardener/gardener-extensions/pkg/mock/gardener-extensions/gardener/terraformer" + mockgardenerchartrenderer "github.com/gardener/gardener-extensions/pkg/mock/gardener/chartrenderer" + "github.com/gardener/gardener-extensions/pkg/mock/go-logr/logr" + "github.com/gardener/gardener-extensions/pkg/util/chart" + gardencorev1alpha1 "github.com/gardener/gardener/pkg/apis/core/v1alpha1" + extensionsv1alpha1 "github.com/gardener/gardener/pkg/apis/extensions/v1alpha1" + "github.com/gardener/gardener/pkg/chartrenderer" + "github.com/golang/mock/gomock" + . "github.com/onsi/ginkgo" + . "github.com/onsi/gomega" + corev1 "k8s.io/api/core/v1" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/serializer/json" + "k8s.io/client-go/rest" + "k8s.io/helm/pkg/manifest" + "sigs.k8s.io/controller-runtime/pkg/client" + "sigs.k8s.io/controller-runtime/pkg/runtime/inject" +) + +func ExpectInject(ok bool, err error) { + Expect(err).NotTo(HaveOccurred()) + Expect(ok).To(BeTrue(), "no injection happened") +} + +func ExpectEncode(data []byte, err error) []byte { + Expect(err).NotTo(HaveOccurred()) + Expect(data).NotTo(BeNil()) + return data +} + +func mkManifest(name string, content string) manifest.Manifest { + return manifest.Manifest{ + Name: fmt.Sprintf("/templates/%s", name), + Content: content, + } +} + +var _ = Describe("Actuator", func() { + var ( + ctrl *gomock.Controller + scheme *runtime.Scheme + serializer runtime.Serializer + ) + BeforeEach(func() { + ctrl = gomock.NewController(GinkgoT()) + scheme = runtime.NewScheme() + install.Install(scheme) + Expect(controller.AddToScheme(scheme)).To(Succeed()) + serializer = json.NewYAMLSerializer(json.DefaultMetaFactory, scheme, scheme) + }) + AfterEach(func() { + ctrl.Finish() + }) + + Context("Actuator", func() { + Describe("#Reconcile", func() { + It("should correctly reconcile the infrastructure", func() { + var ( + ctx = context.TODO() + logger = logr.NewMockLogger(ctrl) + alicloudClientFactory = mockalicloudclient.NewMockFactory(ctrl) + terraformerFactory = mockterraformer.NewMockFactory(ctrl) + terraformer = mockterraformer.NewMockInterface(ctrl) + chartRendererFactory = mockchartrenderer.NewMockFactory(ctrl) + actuator = NewActuatorWithDeps(logger, alicloudClientFactory, terraformerFactory, chartRendererFactory) + c = mockclient.NewMockClient(ctrl) + initializer = mockterraformer.NewMockInitializer(ctrl) + restConfig rest.Config + + chartRenderer = mockgardenerchartrenderer.NewMockInterface(ctrl) + + gardenCoreCIDR = gardencorev1alpha1.CIDR("192.168.0.0/16") + config = v1alpha1.InfrastructureConfig{ + Networks: v1alpha1.Networks{ + VPC: v1alpha1.VPC{ + CIDR: &gardenCoreCIDR, + }, + }, + } + configYAML = ExpectEncode(runtime.Encode(serializer, &config)) + secretNamespace = "secretns" + secretName = "secret" + infra = extensionsv1alpha1.Infrastructure{ + Spec: extensionsv1alpha1.InfrastructureSpec{ + ProviderConfig: &runtime.RawExtension{ + Raw: configYAML, + }, + SecretRef: corev1.SecretReference{ + Namespace: secretNamespace, + Name: secretName, + }, + }, + } + accessKeyID = "accessKeyID" + accessKeySecret = "accessKeySecret" + cluster = controller.Cluster{} + + mainContent = "main" + variablesContent = "variables" + tfVarsContent = "tfVars" + + vpcID = "vpcID" + vpcCIDR = "vpcCIDR" + securityGroupID = "sgID" + keyPairName = "keyPairName" + ) + + gomock.InOrder( + chartRendererFactory.EXPECT().NewForConfig(&restConfig).Return(chartRenderer, nil), + + c.EXPECT().Get(ctx, client.ObjectKey{Namespace: secretNamespace, Name: secretName}, gomock.AssignableToTypeOf(&corev1.Secret{})). + SetArg(2, corev1.Secret{ + Data: map[string][]byte{ + alicloudclient.AccessKeyIDField: []byte(accessKeyID), + alicloudclient.AccessKeySecretField: []byte(accessKeySecret), + }, + }), + + chartRenderer.EXPECT().Render( + alicloud.InfraChartPath, + alicloud.InfraRelease, + infra.Namespace, + ComputeTerraformerChartValues(&infra, &config, ComputeCreateVPCInitializerValues(&config)), + ).Return(&chartrenderer.RenderedChart{ + Manifests: []manifest.Manifest{ + mkManifest(chart.TerraformMainTFFilename, mainContent), + mkManifest(chart.TerraformVariablesTFFilename, variablesContent), + mkManifest(chart.TerraformTFVarsFilename, tfVarsContent), + }, + }, nil), + + terraformerFactory.EXPECT().DefaultInitializer(c, mainContent, variablesContent, []byte(tfVarsContent)).Return(initializer), + + terraformerFactory.EXPECT().NewForConfig(gomock.Any(), &restConfig, TerraformerPurpose, infra.Namespace, infra.Name, imagevector.TerraformerImage()). + Return(terraformer, nil), + + terraformer.EXPECT().SetVariablesEnvironment(map[string]string{ + common.TerraformVarAccessKeyID: accessKeyID, + common.TerraformVarAccessKeySecret: accessKeySecret, + }).Return(terraformer), + + terraformer.EXPECT().InitializeWith(initializer).Return(terraformer), + + terraformer.EXPECT().Apply(), + + terraformer.EXPECT().GetStateOutputVariables(TerraformerOutputKeyVPCID, TerraformerOutputKeyVPCCIDR, TerraformerOutputKeySecurityGroupID, TerraformerOutputKeyKeyPairName). + Return(map[string]string{ + TerraformerOutputKeyVPCID: vpcID, + TerraformerOutputKeyVPCCIDR: vpcCIDR, + TerraformerOutputKeySecurityGroupID: securityGroupID, + TerraformerOutputKeyKeyPairName: keyPairName, + }, nil), + + c.EXPECT().Status().Return(c), + c.EXPECT().Get(ctx, client.ObjectKey{Namespace: infra.Namespace, Name: infra.Name}, &infra), + + c.EXPECT().Update(ctx, &infra), + ) + + ExpectInject(inject.ClientInto(c, actuator)) + ExpectInject(inject.SchemeInto(scheme, actuator)) + ExpectInject(inject.ConfigInto(&restConfig, actuator)) + + Expect(actuator.Reconcile(ctx, &infra, &cluster)).To(Succeed()) + Expect(infra.Status.ProviderStatus.Object).To(Equal(StatusFromTerraformStatus(&TerraformStatus{ + VPCID: vpcID, + VPCCIDR: vpcCIDR, + SecurityGroupID: securityGroupID, + KeyPairName: keyPairName, + }))) + }) + }) + }) +}) diff --git a/controllers/provider-alicloud/pkg/controller/infrastructure/add.go b/controllers/provider-alicloud/pkg/controller/infrastructure/add.go new file mode 100644 index 000000000..0b392be44 --- /dev/null +++ b/controllers/provider-alicloud/pkg/controller/infrastructure/add.go @@ -0,0 +1,51 @@ +// Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT 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 infrastructure + +import ( + "github.com/gardener/gardener-extensions/controllers/provider-alicloud/pkg/alicloud" + "github.com/gardener/gardener-extensions/pkg/controller/infrastructure" + + "sigs.k8s.io/controller-runtime/pkg/controller" + "sigs.k8s.io/controller-runtime/pkg/manager" +) + +var ( + // DefaultAddOptions are the default AddOptions for AddToManager. + DefaultAddOptions = AddOptions{} +) + +// AddOptions are options to apply when adding the infrastructure controller to the manager. +type AddOptions struct { + // Controller are the controller.Options. + Controller controller.Options + // IgnoreOperationAnnotation specifies whether to ignore the operation annotation or not. + IgnoreOperationAnnotation bool +} + +// AddToManagerWithOptions adds a controller with the given AddOptions to the given manager. +// The opts.Reconciler is being set with a newly instantiated actuator. +func AddToManagerWithOptions(mgr manager.Manager, options AddOptions) error { + return infrastructure.Add(mgr, infrastructure.AddArgs{ + Actuator: infrastructure.OperationAnnotationWrapper(NewActuator()), + ControllerOptions: options.Controller, + Predicates: infrastructure.DefaultPredicates(mgr.GetClient(), alicloud.Type, options.IgnoreOperationAnnotation), + }) +} + +// AddToManager adds a controller with the default AddOptions. +func AddToManager(mgr manager.Manager) error { + return AddToManagerWithOptions(mgr, DefaultAddOptions) +} diff --git a/controllers/provider-alicloud/pkg/controller/infrastructure/client.go b/controllers/provider-alicloud/pkg/controller/infrastructure/client.go new file mode 100644 index 000000000..8d5a6fce1 --- /dev/null +++ b/controllers/provider-alicloud/pkg/controller/infrastructure/client.go @@ -0,0 +1,58 @@ +// Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT 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 infrastructure + +import ( + "fmt" + "github.com/aliyun/alibaba-cloud-sdk-go/services/vpc" + alicloudclient "github.com/gardener/gardener-extensions/controllers/provider-alicloud/pkg/alicloud/client" + "strings" +) + +// GetVPCInfo gets info of an existing VPC. +func GetVPCInfo(vpcClient alicloudclient.VPC, vpcID string) (*VPCInfo, error) { + describeVPCsReq := vpc.CreateDescribeVpcsRequest() + describeVPCsReq.VpcId = vpcID + describeVPCsRes, err := vpcClient.DescribeVPCs(describeVPCsReq) + if err != nil { + return nil, err + } + + if len(describeVPCsRes.Vpcs.Vpc) != 1 { + return nil, fmt.Errorf("ambiguous VPC response: expected 1 VPC but got %v", describeVPCsRes.Vpcs.Vpc) + } + + vpcCIDR := describeVPCsRes.Vpcs.Vpc[0].CidrBlock + + describeNATGatewaysReq := vpc.CreateDescribeNatGatewaysRequest() + describeNATGatewaysReq.VpcId = vpcID + describeNatGatewaysRes, err := vpcClient.DescribeNATGateways(describeNATGatewaysReq) + if err != nil { + return nil, err + } + + if len(describeNatGatewaysRes.NatGateways.NatGateway) != 1 { + return nil, fmt.Errorf("ambiguous NAT Gateway response: expected 1 NAT Gateway but got %v", describeNatGatewaysRes.NatGateways.NatGateway) + } + natGateway := describeNatGatewaysRes.NatGateways.NatGateway[0] + natGatewayID := natGateway.NatGatewayId + sNATTableIDs := strings.Join(natGateway.SnatTableIds.SnatTableId, ",") + + return &VPCInfo{ + CIDR: vpcCIDR, + NATGatewayID: natGatewayID, + SNATTableIDs: sNATTableIDs, + }, nil +} diff --git a/controllers/provider-alicloud/pkg/controller/infrastructure/client_test.go b/controllers/provider-alicloud/pkg/controller/infrastructure/client_test.go new file mode 100644 index 000000000..2cd1b93da --- /dev/null +++ b/controllers/provider-alicloud/pkg/controller/infrastructure/client_test.go @@ -0,0 +1,87 @@ +// Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT 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 infrastructure + +import ( + "fmt" + "github.com/aliyun/alibaba-cloud-sdk-go/services/vpc" + mockclient "github.com/gardener/gardener-extensions/controllers/provider-alicloud/pkg/mock/provider-alicloud/alicloud/client" + "github.com/golang/mock/gomock" + . "github.com/onsi/ginkgo" + . "github.com/onsi/gomega" +) + +var _ = Describe("Client", func() { + var ( + ctrl *gomock.Controller + ) + BeforeEach(func() { + ctrl = gomock.NewController(GinkgoT()) + }) + AfterEach(func() { + ctrl.Finish() + }) + + Describe("#GetVPCInfo", func() { + It("should get info about the specified VPC", func() { + var ( + client = mockclient.NewMockVPC(ctrl) + vpcID = "vpcID" + vpcCIDR = "vpcCIDR" + natGatewayID = "natGatewayID" + sNATTableID1 = "sNATTableID1" + sNATTableID2 = "sNATTableID2" + sNATTableIDs = fmt.Sprintf("%s,%s", sNATTableID1, sNATTableID2) + ) + + describeVPCsReq := vpc.CreateDescribeVpcsRequest() + describeVPCsReq.VpcId = vpcID + + describeNATGatewaysReq := vpc.CreateDescribeNatGatewaysRequest() + describeNATGatewaysReq.VpcId = vpcID + + gomock.InOrder( + client.EXPECT().DescribeVPCs(describeVPCsReq).Return(&vpc.DescribeVpcsResponse{ + Vpcs: vpc.Vpcs{ + Vpc: []vpc.Vpc{ + {CidrBlock: vpcCIDR}, + }, + }, + }, nil), + + client.EXPECT().DescribeNATGateways(describeNATGatewaysReq).Return(&vpc.DescribeNatGatewaysResponse{ + NatGateways: vpc.NatGateways{ + NatGateway: []vpc.NatGateway{ + { + NatGatewayId: natGatewayID, + SnatTableIds: vpc.SnatTableIdsInDescribeNatGateways{ + SnatTableId: []string{sNATTableID1, sNATTableID2}, + }, + }, + }, + }, + }, nil), + ) + + info, err := GetVPCInfo(client, vpcID) + Expect(err).NotTo(HaveOccurred()) + Expect(info).To(Equal(&VPCInfo{ + CIDR: vpcCIDR, + NATGatewayID: natGatewayID, + SNATTableIDs: sNATTableIDs, + })) + }) + }) +}) diff --git a/controllers/provider-alicloud/pkg/controller/infrastructure/infrastructure_test.go b/controllers/provider-alicloud/pkg/controller/infrastructure/infrastructure_test.go new file mode 100644 index 000000000..5e5a786c0 --- /dev/null +++ b/controllers/provider-alicloud/pkg/controller/infrastructure/infrastructure_test.go @@ -0,0 +1,26 @@ +// Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT 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 infrastructure + +import ( + . "github.com/onsi/ginkgo" + . "github.com/onsi/gomega" + "testing" +) + +func TestInfrastructure(t *testing.T) { + RegisterFailHandler(Fail) + RunSpecs(t, "Infrastructure") +} diff --git a/controllers/provider-alicloud/pkg/controller/infrastructure/terraform.go b/controllers/provider-alicloud/pkg/controller/infrastructure/terraform.go new file mode 100644 index 000000000..ab5752e76 --- /dev/null +++ b/controllers/provider-alicloud/pkg/controller/infrastructure/terraform.go @@ -0,0 +1,126 @@ +// Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT 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 infrastructure + +import ( + "github.com/gardener/gardener-extensions/controllers/provider-alicloud/pkg/apis/alicloud/v1alpha1" + "github.com/gardener/gardener-extensions/pkg/controller" + extensionsterraformer "github.com/gardener/gardener-extensions/pkg/gardener/terraformer" + gardencorev1alpha1 "github.com/gardener/gardener/pkg/apis/core/v1alpha1" + extensionsv1alpha1 "github.com/gardener/gardener/pkg/apis/extensions/v1alpha1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// ComputeCreateVPCInitializerValues computes the InitializerValues to create a new VPC. +func ComputeCreateVPCInitializerValues(config *v1alpha1.InfrastructureConfig) *InitializerValues { + return &InitializerValues{ + CreateVPC: true, + VPCID: TerraformDefaultVPCID, + VPCCIDR: string(*config.Networks.VPC.CIDR), + NATGatewayID: TerraformDefaultNATGatewayID, + SNATTableIDs: TerraformDefaultSNATTableIDs, + } +} + +// ComputeUseVPCInitializerValues computes the InitializerValues to use an existing VPC. +func ComputeUseVPCInitializerValues(config *v1alpha1.InfrastructureConfig, info *VPCInfo) *InitializerValues { + return &InitializerValues{ + CreateVPC: false, + VPCID: *config.Networks.VPC.ID, + VPCCIDR: info.CIDR, + NATGatewayID: info.NATGatewayID, + SNATTableIDs: info.SNATTableIDs, + } +} + +// ComputeTerraformerChartValues computes the values necessary for the infrastructure Terraform chart. +func ComputeTerraformerChartValues( + infra *extensionsv1alpha1.Infrastructure, + config *v1alpha1.InfrastructureConfig, + values *InitializerValues, +) map[string]interface{} { + zones := make([]map[string]interface{}, 0, len(config.Networks.Zones)) + for _, zone := range config.Networks.Zones { + zones = append(zones, map[string]interface{}{ + "name": zone.Name, + "cidr": map[string]interface{}{ + "worker": string(zone.Worker), + }, + }) + } + + return map[string]interface{}{ + "alicloud": map[string]interface{}{ + "region": infra.Spec.Region, + }, + "create": map[string]interface{}{ + "vpc": values.CreateVPC, + }, + "vpc": map[string]interface{}{ + "cidr": values.VPCCIDR, + "id": values.VPCID, + "natGatewayID": values.NATGatewayID, + "snatTableID": values.SNATTableIDs, + }, + "clusterName": infra.Namespace, + "sshPublicKey": string(infra.Spec.SSHPublicKey), + "zones": zones, + "outputKeys": map[string]interface{}{ + "vpcID": TerraformerOutputKeyVPCID, + "vpcCIDR": TerraformerOutputKeyVPCCIDR, + "securityGroupID": TerraformerOutputKeySecurityGroupID, + "keyPairName": TerraformerOutputKeyKeyPairName, + }, + } +} + +// ExtractTerraformStatus tries to extract the TerraformStatus from the given Terraformer. +func ExtractTerraformStatus(tf extensionsterraformer.Interface) (*TerraformStatus, error) { + vars, err := tf.GetStateOutputVariables(TerraformerOutputKeyVPCID, TerraformerOutputKeyVPCCIDR, TerraformerOutputKeySecurityGroupID, TerraformerOutputKeyKeyPairName) + if err != nil { + return nil, err + } + + return &TerraformStatus{ + VPCID: vars[TerraformerOutputKeyVPCID], + VPCCIDR: vars[TerraformerOutputKeyVPCCIDR], + SecurityGroupID: vars[TerraformerOutputKeySecurityGroupID], + KeyPairName: vars[TerraformerOutputKeyKeyPairName], + }, nil +} + +// StatusTypeMeta is the TypeMeta of InfrastructureStatus. +var StatusTypeMeta = func() metav1.TypeMeta { + apiVersion, kind := v1alpha1.SchemeGroupVersion.WithKind(controller.UnsafeGuessKind(&v1alpha1.InfrastructureStatus{})).ToAPIVersionAndKind() + return metav1.TypeMeta{ + APIVersion: apiVersion, + Kind: kind, + } +}() + +// StatusFromTerraformStatus computes the InfrastructureStatus from the given TerraformStatus and vpcCIDRString. +func StatusFromTerraformStatus(terraformStatus *TerraformStatus) *v1alpha1.InfrastructureStatus { + vpcCIDR := gardencorev1alpha1.CIDR(terraformStatus.VPCCIDR) + + return &v1alpha1.InfrastructureStatus{ + TypeMeta: StatusTypeMeta, + VPC: v1alpha1.VPC{ + ID: &terraformStatus.VPCID, + CIDR: &vpcCIDR, + }, + KeyPairName: terraformStatus.KeyPairName, + SecurityGroupID: terraformStatus.SecurityGroupID, + } +} diff --git a/controllers/provider-alicloud/pkg/controller/infrastructure/terraform_test.go b/controllers/provider-alicloud/pkg/controller/infrastructure/terraform_test.go new file mode 100644 index 000000000..88e8ae21c --- /dev/null +++ b/controllers/provider-alicloud/pkg/controller/infrastructure/terraform_test.go @@ -0,0 +1,238 @@ +// Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT 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 infrastructure + +import ( + "github.com/gardener/gardener-extensions/controllers/provider-alicloud/pkg/apis/alicloud/v1alpha1" + "github.com/gardener/gardener-extensions/pkg/mock/gardener-extensions/gardener/terraformer" + gardencorev1alpha1 "github.com/gardener/gardener/pkg/apis/core/v1alpha1" + extensionsv1alpha1 "github.com/gardener/gardener/pkg/apis/extensions/v1alpha1" + "github.com/golang/mock/gomock" + . "github.com/onsi/ginkgo" + . "github.com/onsi/gomega" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +var _ = Describe("Terraform", func() { + var ( + ctrl *gomock.Controller + ) + BeforeEach(func() { + ctrl = gomock.NewController(GinkgoT()) + }) + AfterEach(func() { + ctrl.Finish() + }) + + Describe("#ComputeCreateVPCInitializerValues", func() { + It("should compute the values from the config", func() { + var ( + cidr = gardencorev1alpha1.CIDR("192.168.0.0/16") + config = v1alpha1.InfrastructureConfig{ + Networks: v1alpha1.Networks{ + VPC: v1alpha1.VPC{ + CIDR: &cidr, + }, + }, + } + ) + + Expect(ComputeCreateVPCInitializerValues(&config)).To(Equal(&InitializerValues{ + CreateVPC: true, + VPCID: TerraformDefaultVPCID, + VPCCIDR: string(cidr), + NATGatewayID: TerraformDefaultNATGatewayID, + SNATTableIDs: TerraformDefaultSNATTableIDs, + })) + }) + }) + + Describe("#ComputeUseVPCInitializerValues", func() { + It("should compute the values from the infra and config", func() { + var ( + id = "id" + cidr = "192.168.0.0/16" + natGatewayID = "natGatewayID" + sNATTableIDs = "sNATTableIDs" + info = VPCInfo{ + CIDR: cidr, + NATGatewayID: natGatewayID, + SNATTableIDs: sNATTableIDs, + } + config = v1alpha1.InfrastructureConfig{ + Networks: v1alpha1.Networks{ + VPC: v1alpha1.VPC{ + ID: &id, + }, + }, + } + ) + + Expect(ComputeUseVPCInitializerValues(&config, &info)).To(Equal(&InitializerValues{ + CreateVPC: false, + VPCID: id, + VPCCIDR: cidr, + NATGatewayID: natGatewayID, + SNATTableIDs: sNATTableIDs, + })) + }) + }) + + Describe("#ComputeTerraformerChartValues", func() { + It("should compute the terraformer chart values", func() { + var ( + namespace = "cluster-foo" + region = "region" + sshPublicKey = "sshPublicKey" + + infra = extensionsv1alpha1.Infrastructure{ + ObjectMeta: metav1.ObjectMeta{ + Namespace: namespace, + }, + Spec: extensionsv1alpha1.InfrastructureSpec{ + Region: region, + SSHPublicKey: []byte(sshPublicKey), + }, + } + + zone1Name = "zone1" + zone1Worker = "192.168.0.0/16" + + zone2Name = "zone2" + zone2Worker = "192.169.0.0/16" + + config = v1alpha1.InfrastructureConfig{ + Networks: v1alpha1.Networks{ + Zones: []v1alpha1.Zone{ + { + Name: zone1Name, + Worker: gardencorev1alpha1.CIDR(zone1Worker), + }, + { + Name: zone2Name, + Worker: gardencorev1alpha1.CIDR(zone2Worker), + }, + }, + }, + } + + vpcCIDR = "192.170.0.0/16" + vpcID = "vpcID" + natGatewayID = "natGatewayID" + sNATTableIDs = "sNATTableIDs" + values = InitializerValues{ + CreateVPC: true, + VPCCIDR: vpcCIDR, + VPCID: vpcID, + NATGatewayID: natGatewayID, + SNATTableIDs: sNATTableIDs, + } + ) + + Expect(ComputeTerraformerChartValues(&infra, &config, &values)).To(Equal(map[string]interface{}{ + "alicloud": map[string]interface{}{ + "region": region, + }, + "create": map[string]interface{}{ + "vpc": true, + }, + "vpc": map[string]interface{}{ + "cidr": vpcCIDR, + "id": vpcID, + "natGatewayID": natGatewayID, + "snatTableID": sNATTableIDs, + }, + "clusterName": namespace, + "sshPublicKey": sshPublicKey, + "zones": []map[string]interface{}{ + { + "name": zone1Name, + "cidr": map[string]interface{}{ + "worker": zone1Worker, + }, + }, + { + "name": zone2Name, + "cidr": map[string]interface{}{ + "worker": zone2Worker, + }, + }, + }, + "outputKeys": map[string]interface{}{ + "vpcID": TerraformerOutputKeyVPCID, + "vpcCIDR": TerraformerOutputKeyVPCCIDR, + "securityGroupID": TerraformerOutputKeySecurityGroupID, + "keyPairName": TerraformerOutputKeyKeyPairName, + }, + })) + }) + }) + + Describe("#ExtractTerraformStatus", func() { + It("should correctly extract the terraform status", func() { + var ( + tf = terraformer.NewMockInterface(ctrl) + vpcID = "vpcID" + vpcCIDR = "vpcCIDR" + securityGroupID = "securityGroupID" + keyPairName = "keyPairName" + ) + + tf.EXPECT().GetStateOutputVariables(TerraformerOutputKeyVPCID, TerraformerOutputKeyVPCCIDR, TerraformerOutputKeySecurityGroupID, TerraformerOutputKeyKeyPairName). + Return(map[string]string{ + TerraformerOutputKeyVPCID: vpcID, + TerraformerOutputKeyVPCCIDR: vpcCIDR, + TerraformerOutputKeySecurityGroupID: securityGroupID, + TerraformerOutputKeyKeyPairName: keyPairName, + }, nil) + + status, err := ExtractTerraformStatus(tf) + Expect(err).NotTo(HaveOccurred()) + Expect(status).To(Equal(&TerraformStatus{ + VPCID: vpcID, + VPCCIDR: vpcCIDR, + SecurityGroupID: securityGroupID, + KeyPairName: keyPairName, + })) + }) + }) + + Describe("#StatusFromTerraformStatus", func() { + It("should compute the infrastructure status from the terraform status", func() { + var ( + vpcID = "vpcID" + securityGroupID = "sgID" + keyPairName = "keyPairName" + vpcCIDRString = "192.168.0.0/16" + vpcCIDR = gardencorev1alpha1.CIDR(vpcCIDRString) + ) + + Expect(StatusFromTerraformStatus(&TerraformStatus{ + VPCID: vpcID, + VPCCIDR: vpcCIDRString, + SecurityGroupID: securityGroupID, + KeyPairName: keyPairName, + })).To(Equal(&v1alpha1.InfrastructureStatus{ + TypeMeta: StatusTypeMeta, + VPC: v1alpha1.VPC{ + ID: &vpcID, + CIDR: &vpcCIDR, + }, + KeyPairName: keyPairName, + SecurityGroupID: securityGroupID, + })) + }) + }) +}) diff --git a/controllers/provider-alicloud/pkg/controller/infrastructure/types.go b/controllers/provider-alicloud/pkg/controller/infrastructure/types.go new file mode 100644 index 000000000..a3861acad --- /dev/null +++ b/controllers/provider-alicloud/pkg/controller/infrastructure/types.go @@ -0,0 +1,60 @@ +// Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT 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 infrastructure + +const ( + // TerraformerPurpose is the Terraformer purpose for infrastructure operations. + TerraformerPurpose = "infra" + + // TerraformerOutputKeyVPCID is the output key of the VPC ID. + TerraformerOutputKeyVPCID = "vpc_id" + // TerraformerOutputKeyVPCCIDR is the output key of the VPC CIDR. + TerraformerOutputKeyVPCCIDR = "vpc_cidr" + // TerraformerOutputKeySecurityGroupID is the output key of the security group ID. + TerraformerOutputKeySecurityGroupID = "sg_id" + // TerraformerOutputKeyKeyPairName is the output key of the key pair name. + TerraformerOutputKeyKeyPairName = "key_pair_name" + + // TerraformDefaultVPCID is the default value for the VPC ID in the chart. + TerraformDefaultVPCID = "${alicloud_vpc.vpc.id}" + // TerraformDefaultNATGatewayID is the default value for the NAT gateway ID in the chart. + TerraformDefaultNATGatewayID = "${alicloud_nat_gateway.nat_gateway.id}" + // TerraformDefaultSNATTableIDs is the default value for the SNAT table IDs in the chart. + TerraformDefaultSNATTableIDs = "${alicloud_nat_gateway.nat_gateway.snat_table_ids}" +) + +// VPCInfo contains info about an existing VPC. +type VPCInfo struct { + CIDR string + NATGatewayID string + SNATTableIDs string +} + +// TerraformStatus is the status of a terraformer after reconciling successfully. +type TerraformStatus struct { + VPCID string + VPCCIDR string + SecurityGroupID string + KeyPairName string +} + +// InitializerValues are values used to render a terraform initializer chart. +type InitializerValues struct { + CreateVPC bool + VPCID string + VPCCIDR string + NATGatewayID string + SNATTableIDs string +} diff --git a/controllers/provider-alicloud/pkg/imagevector/imagevector.go b/controllers/provider-alicloud/pkg/imagevector/imagevector.go index d64da4925..7932f1005 100644 --- a/controllers/provider-alicloud/pkg/imagevector/imagevector.go +++ b/controllers/provider-alicloud/pkg/imagevector/imagevector.go @@ -12,22 +12,51 @@ // See the License for the specific language governing permissions and // limitations under the License. +//go:generate packr2 + package imagevector import ( - "path/filepath" - - "github.com/gardener/gardener-extensions/controllers/provider-alicloud/pkg/alicloud" "github.com/gardener/gardener/pkg/utils/imagevector" "k8s.io/apimachinery/pkg/util/runtime" ) -// ImageVector is the image vector that contains al the needed images -var ImageVector imagevector.ImageVector +import ( + "strings" + + "github.com/gobuffalo/packr/v2" +) + +const ( + // TerraformerImageName is the name of the Terraformer image. + TerraformerImageName = "terraformer" +) + +var imageVector imagevector.ImageVector func init() { - var err error - ImageVector, err = imagevector.ReadFile(filepath.Join(alicloud.ChartsPath, "images.yaml")) + box := packr.New("charts", "../../charts") + + imagesYaml, err := box.FindString("images.yaml") runtime.Must(err) + + imageVector, err = imagevector.Read(strings.NewReader(imagesYaml)) + runtime.Must(err) + + imageVector, err = imagevector.WithEnvOverride(imageVector) + runtime.Must(err) +} + +// ImageVector is the image vector that contains al the needed images +func ImageVector() imagevector.ImageVector { + return imageVector +} + +// TerraformerImage retrieves the Terraformer image. +func TerraformerImage() string { + image, err := imageVector.FindImage(TerraformerImageName, "", "") + runtime.Must(err) + + return image.String() } diff --git a/controllers/provider-alicloud/pkg/mock/provider-alicloud/alicloud/client/doc.go b/controllers/provider-alicloud/pkg/mock/provider-alicloud/alicloud/client/doc.go new file mode 100644 index 000000000..da3cdf2be --- /dev/null +++ b/controllers/provider-alicloud/pkg/mock/provider-alicloud/alicloud/client/doc.go @@ -0,0 +1,17 @@ +// Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//go:generate mockgen -package=client -destination=mocks.go github.com/gardener/gardener-extensions/controllers/provider-alicloud/pkg/alicloud/client VPC,Factory + +package client diff --git a/controllers/provider-alicloud/pkg/mock/provider-alicloud/alicloud/client/mocks.go b/controllers/provider-alicloud/pkg/mock/provider-alicloud/alicloud/client/mocks.go new file mode 100644 index 000000000..5f83c562a --- /dev/null +++ b/controllers/provider-alicloud/pkg/mock/provider-alicloud/alicloud/client/mocks.go @@ -0,0 +1,103 @@ +// Code generated by MockGen. DO NOT EDIT. +// Source: github.com/gardener/gardener-extensions/controllers/provider-alicloud/pkg/alicloud/client (interfaces: VPC,Factory) + +// Package client is a generated GoMock package. +package client + +import ( + vpc "github.com/aliyun/alibaba-cloud-sdk-go/services/vpc" + client "github.com/gardener/gardener-extensions/controllers/provider-alicloud/pkg/alicloud/client" + gomock "github.com/golang/mock/gomock" + reflect "reflect" +) + +// MockVPC is a mock of VPC interface +type MockVPC struct { + ctrl *gomock.Controller + recorder *MockVPCMockRecorder +} + +// MockVPCMockRecorder is the mock recorder for MockVPC +type MockVPCMockRecorder struct { + mock *MockVPC +} + +// NewMockVPC creates a new mock instance +func NewMockVPC(ctrl *gomock.Controller) *MockVPC { + mock := &MockVPC{ctrl: ctrl} + mock.recorder = &MockVPCMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use +func (m *MockVPC) EXPECT() *MockVPCMockRecorder { + return m.recorder +} + +// DescribeNATGateways mocks base method +func (m *MockVPC) DescribeNATGateways(arg0 *vpc.DescribeNatGatewaysRequest) (*vpc.DescribeNatGatewaysResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DescribeNATGateways", arg0) + ret0, _ := ret[0].(*vpc.DescribeNatGatewaysResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// DescribeNATGateways indicates an expected call of DescribeNATGateways +func (mr *MockVPCMockRecorder) DescribeNATGateways(arg0 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeNATGateways", reflect.TypeOf((*MockVPC)(nil).DescribeNATGateways), arg0) +} + +// DescribeVPCs mocks base method +func (m *MockVPC) DescribeVPCs(arg0 *vpc.DescribeVpcsRequest) (*vpc.DescribeVpcsResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DescribeVPCs", arg0) + ret0, _ := ret[0].(*vpc.DescribeVpcsResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// DescribeVPCs indicates an expected call of DescribeVPCs +func (mr *MockVPCMockRecorder) DescribeVPCs(arg0 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeVPCs", reflect.TypeOf((*MockVPC)(nil).DescribeVPCs), arg0) +} + +// MockFactory is a mock of Factory interface +type MockFactory struct { + ctrl *gomock.Controller + recorder *MockFactoryMockRecorder +} + +// MockFactoryMockRecorder is the mock recorder for MockFactory +type MockFactoryMockRecorder struct { + mock *MockFactory +} + +// NewMockFactory creates a new mock instance +func NewMockFactory(ctrl *gomock.Controller) *MockFactory { + mock := &MockFactory{ctrl: ctrl} + mock.recorder = &MockFactoryMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use +func (m *MockFactory) EXPECT() *MockFactoryMockRecorder { + return m.recorder +} + +// NewVPCClientWithAccessKey mocks base method +func (m *MockFactory) NewVPCClientWithAccessKey(arg0, arg1, arg2 string) (client.VPC, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "NewVPCClientWithAccessKey", arg0, arg1, arg2) + ret0, _ := ret[0].(client.VPC) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// NewVPCClientWithAccessKey indicates an expected call of NewVPCClientWithAccessKey +func (mr *MockFactoryMockRecorder) NewVPCClientWithAccessKey(arg0, arg1, arg2 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NewVPCClientWithAccessKey", reflect.TypeOf((*MockFactory)(nil).NewVPCClientWithAccessKey), arg0, arg1, arg2) +} diff --git a/pkg/controller/utils.go b/pkg/controller/utils.go index cf163f170..e45557b42 100644 --- a/pkg/controller/utils.go +++ b/pkg/controller/utils.go @@ -16,6 +16,9 @@ package controller import ( "context" + "fmt" + kutil "github.com/gardener/gardener/pkg/utils/kubernetes" + corev1 "k8s.io/api/core/v1" "reflect" "time" @@ -170,6 +173,19 @@ func DeleteFinalizer(ctx context.Context, client client.Client, finalizerName st return client.Update(ctx, obj) } +func SecretReferenceToKey(ref *corev1.SecretReference) client.ObjectKey { + return kutil.Key(ref.Namespace, ref.Name) +} + +func GetSecretByReference(ctx context.Context, c client.Client, ref *corev1.SecretReference) (*corev1.Secret, error) { + secret := &corev1.Secret{} + if err := c.Get(ctx, SecretReferenceToKey(ref), secret); err != nil { + return nil, err + } + + return secret, nil +} + // CreateOrUpdate creates or updates the object. Optionally, it executes a transformation function before the // request is made. func CreateOrUpdate(ctx context.Context, c client.Client, obj runtime.Object, transform func() error) error { @@ -286,3 +302,15 @@ func (w *WatchBuilder) AddToController(ctrl controller.Controller) error { } return nil } + +// UnsafeGuessKind makes an unsafe guess what is the kind of the given object. +// +// The argument to this method _has_ to be a pointer, otherwise it panics. +func UnsafeGuessKind(obj runtime.Object) string { + t := reflect.TypeOf(obj) + if t.Kind() != reflect.Ptr { + panic(fmt.Sprintf("kind of obj %T is not pointer", obj)) + } + + return t.Elem().Name() +} diff --git a/pkg/controller/utils_test.go b/pkg/controller/utils_test.go new file mode 100644 index 000000000..7f8efe768 --- /dev/null +++ b/pkg/controller/utils_test.go @@ -0,0 +1,30 @@ +// Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT 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 controller_test + +import ( + "github.com/gardener/gardener-extensions/pkg/controller" + extensionsv1alpha1 "github.com/gardener/gardener/pkg/apis/extensions/v1alpha1" + . "github.com/onsi/ginkgo" + . "github.com/onsi/gomega" +) + +var _ = Describe("Utils", func() { + Describe("UnsafeGuessKind", func() { + It("should guess the kind correctly", func() { + Expect(controller.UnsafeGuessKind(&extensionsv1alpha1.Infrastructure{})).To(Equal("Infrastructure")) + }) + }) +}) diff --git a/pkg/gardener/chartrenderer/chartrenderer.go b/pkg/gardener/chartrenderer/chartrenderer.go new file mode 100644 index 000000000..07bbb3afb --- /dev/null +++ b/pkg/gardener/chartrenderer/chartrenderer.go @@ -0,0 +1,32 @@ +// Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT 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 chartrenderer + +import ( + "github.com/gardener/gardener/pkg/chartrenderer" + "k8s.io/client-go/rest" +) + +type factory struct{} + +// NewForConfig implements Factory. +func (factory) NewForConfig(config *rest.Config) (chartrenderer.Interface, error) { + return chartrenderer.NewForConfig(config) +} + +// DefaultFactory returns the default Factory. +func DefaultFactory() Factory { + return factory{} +} diff --git a/pkg/gardener/chartrenderer/types.go b/pkg/gardener/chartrenderer/types.go new file mode 100644 index 000000000..ea9682df7 --- /dev/null +++ b/pkg/gardener/chartrenderer/types.go @@ -0,0 +1,25 @@ +// Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT 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 chartrenderer + +import ( + "github.com/gardener/gardener/pkg/chartrenderer" + "k8s.io/client-go/rest" +) + +// Factory is a factory that is able to produce chartrenderer.Interface. +type Factory interface { + NewForConfig(config *rest.Config) (chartrenderer.Interface, error) +} diff --git a/pkg/gardener/terraformer/terraformer.go b/pkg/gardener/terraformer/terraformer.go new file mode 100644 index 000000000..256fad694 --- /dev/null +++ b/pkg/gardener/terraformer/terraformer.go @@ -0,0 +1,93 @@ +// Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT 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 terraformer + +import ( + gardenerterraformer "github.com/gardener/gardener/pkg/operation/terraformer" + "github.com/sirupsen/logrus" + "k8s.io/client-go/kubernetes/typed/core/v1" + "k8s.io/client-go/rest" + "sigs.k8s.io/controller-runtime/pkg/client" +) + +type terraformer struct { + tf *gardenerterraformer.Terraformer +} + +// SetVariablesEnvironment implements Terraformer. +func (t *terraformer) SetVariablesEnvironment(tfVarsEnvironment map[string]string) Interface { + return &terraformer{t.tf.SetVariablesEnvironment(tfVarsEnvironment)} +} + +// InitializeWith implements Terraformer. +func (t *terraformer) InitializeWith(initializer Initializer) Interface { + return &terraformer{t.tf.InitializeWith(initializer.Initialize)} +} + +// Apply implements Terraformer. +func (t *terraformer) Apply() error { + return t.tf.Apply() +} + +// Destroy implements Terraformer. +func (t *terraformer) Destroy() error { + return t.tf.Destroy() +} + +// GetStateOutputVariables implements Terraformer. +func (t *terraformer) GetStateOutputVariables(variables ...string) (map[string]string, error) { + return t.tf.GetStateOutputVariables(variables...) +} + +// ConfigExists implements Terraformer. +func (t *terraformer) ConfigExists() (bool, error) { + return t.tf.ConfigExists() +} + +type initializer struct { + initialize func(config *gardenerterraformer.InitializerConfig) error +} + +// Initialize implements Initializer. +func (i *initializer) Initialize(config *gardenerterraformer.InitializerConfig) error { + return i.initialize(config) +} + +type factory struct{} + +// NewForConfig implements Factory. +func (factory) NewForConfig(logger logrus.FieldLogger, config *rest.Config, purpose, namespace, name, image string) (Interface, error) { + tf, err := gardenerterraformer.NewForConfig(logger, config, purpose, namespace, name, image) + if err != nil { + return nil, err + } + + return &terraformer{tf}, nil +} + +// New implements Factory. +func (factory) New(logger logrus.FieldLogger, client client.Client, coreV1Client v1.CoreV1Interface, purpose, namespace, name, image string) Interface { + return &terraformer{gardenerterraformer.New(logger, client, coreV1Client, purpose, namespace, name, image)} +} + +// DefaultInitializer implements Factory. +func (factory) DefaultInitializer(c client.Client, main, variables string, tfVars []byte) Initializer { + return &initializer{gardenerterraformer.DefaultInitializer(c, main, variables, tfVars)} +} + +// DefaultFactory returns the default factory. +func DefaultFactory() Factory { + return factory{} +} diff --git a/pkg/gardener/terraformer/types.go b/pkg/gardener/terraformer/types.go new file mode 100644 index 000000000..d4bd2aee4 --- /dev/null +++ b/pkg/gardener/terraformer/types.go @@ -0,0 +1,45 @@ +// Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT 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 terraformer + +import ( + gardenerterraformer "github.com/gardener/gardener/pkg/operation/terraformer" + "github.com/sirupsen/logrus" + corev1client "k8s.io/client-go/kubernetes/typed/core/v1" + "k8s.io/client-go/rest" + "sigs.k8s.io/controller-runtime/pkg/client" +) + +// Interface is the terraformer interface. +type Interface interface { + SetVariablesEnvironment(tfVarsEnvironment map[string]string) Interface + InitializeWith(initializer Initializer) Interface + Apply() error + Destroy() error + GetStateOutputVariables(variables ...string) (map[string]string, error) + ConfigExists() (bool, error) +} + +// Factory is a factory that can produce Interface and Initializer. +type Factory interface { + NewForConfig(logger logrus.FieldLogger, config *rest.Config, purpose, namespace, name, image string) (Interface, error) + New(logger logrus.FieldLogger, client client.Client, coreV1Client corev1client.CoreV1Interface, purpose, namespace, name, image string) Interface + DefaultInitializer(c client.Client, main, variables string, tfVars []byte) Initializer +} + +// Initializer can initialize an Interface. +type Initializer interface { + Initialize(config *gardenerterraformer.InitializerConfig) error +} diff --git a/pkg/mock/gardener-extensions/gardener/chartrenderer/doc.go b/pkg/mock/gardener-extensions/gardener/chartrenderer/doc.go new file mode 100644 index 000000000..1a96c08d6 --- /dev/null +++ b/pkg/mock/gardener-extensions/gardener/chartrenderer/doc.go @@ -0,0 +1,17 @@ +// Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//go:generate mockgen -package=chartrenderer -destination=mocks.go github.com/gardener/gardener-extensions/pkg/gardener/chartrenderer Factory + +package chartrenderer diff --git a/pkg/mock/gardener-extensions/gardener/chartrenderer/mocks.go b/pkg/mock/gardener-extensions/gardener/chartrenderer/mocks.go new file mode 100644 index 000000000..61af4ccdf --- /dev/null +++ b/pkg/mock/gardener-extensions/gardener/chartrenderer/mocks.go @@ -0,0 +1,50 @@ +// Code generated by MockGen. DO NOT EDIT. +// Source: github.com/gardener/gardener-extensions/pkg/gardener/chartrenderer (interfaces: Factory) + +// Package chartrenderer is a generated GoMock package. +package chartrenderer + +import ( + chartrenderer "github.com/gardener/gardener/pkg/chartrenderer" + gomock "github.com/golang/mock/gomock" + rest "k8s.io/client-go/rest" + reflect "reflect" +) + +// MockFactory is a mock of Factory interface +type MockFactory struct { + ctrl *gomock.Controller + recorder *MockFactoryMockRecorder +} + +// MockFactoryMockRecorder is the mock recorder for MockFactory +type MockFactoryMockRecorder struct { + mock *MockFactory +} + +// NewMockFactory creates a new mock instance +func NewMockFactory(ctrl *gomock.Controller) *MockFactory { + mock := &MockFactory{ctrl: ctrl} + mock.recorder = &MockFactoryMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use +func (m *MockFactory) EXPECT() *MockFactoryMockRecorder { + return m.recorder +} + +// NewForConfig mocks base method +func (m *MockFactory) NewForConfig(arg0 *rest.Config) (chartrenderer.Interface, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "NewForConfig", arg0) + ret0, _ := ret[0].(chartrenderer.Interface) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// NewForConfig indicates an expected call of NewForConfig +func (mr *MockFactoryMockRecorder) NewForConfig(arg0 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NewForConfig", reflect.TypeOf((*MockFactory)(nil).NewForConfig), arg0) +} diff --git a/pkg/mock/gardener-extensions/gardener/terraformer/doc.go b/pkg/mock/gardener-extensions/gardener/terraformer/doc.go new file mode 100644 index 000000000..78cba97b8 --- /dev/null +++ b/pkg/mock/gardener-extensions/gardener/terraformer/doc.go @@ -0,0 +1,17 @@ +// Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//go:generate mockgen -package=terraformer -destination=mocks.go github.com/gardener/gardener-extensions/pkg/gardener/terraformer Interface,Initializer,Factory + +package terraformer diff --git a/pkg/mock/gardener-extensions/gardener/terraformer/mocks.go b/pkg/mock/gardener-extensions/gardener/terraformer/mocks.go new file mode 100644 index 000000000..e77d55968 --- /dev/null +++ b/pkg/mock/gardener-extensions/gardener/terraformer/mocks.go @@ -0,0 +1,232 @@ +// Code generated by MockGen. DO NOT EDIT. +// Source: github.com/gardener/gardener-extensions/pkg/gardener/terraformer (interfaces: Interface,Initializer,Factory) + +// Package terraformer is a generated GoMock package. +package terraformer + +import ( + terraformer "github.com/gardener/gardener-extensions/pkg/gardener/terraformer" + terraformer0 "github.com/gardener/gardener/pkg/operation/terraformer" + gomock "github.com/golang/mock/gomock" + logrus "github.com/sirupsen/logrus" + v1 "k8s.io/client-go/kubernetes/typed/core/v1" + rest "k8s.io/client-go/rest" + reflect "reflect" + client "sigs.k8s.io/controller-runtime/pkg/client" +) + +// MockInterface is a mock of Interface interface +type MockInterface struct { + ctrl *gomock.Controller + recorder *MockInterfaceMockRecorder +} + +// MockInterfaceMockRecorder is the mock recorder for MockInterface +type MockInterfaceMockRecorder struct { + mock *MockInterface +} + +// NewMockInterface creates a new mock instance +func NewMockInterface(ctrl *gomock.Controller) *MockInterface { + mock := &MockInterface{ctrl: ctrl} + mock.recorder = &MockInterfaceMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use +func (m *MockInterface) EXPECT() *MockInterfaceMockRecorder { + return m.recorder +} + +// Apply mocks base method +func (m *MockInterface) Apply() error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Apply") + ret0, _ := ret[0].(error) + return ret0 +} + +// Apply indicates an expected call of Apply +func (mr *MockInterfaceMockRecorder) Apply() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Apply", reflect.TypeOf((*MockInterface)(nil).Apply)) +} + +// ConfigExists mocks base method +func (m *MockInterface) ConfigExists() (bool, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ConfigExists") + ret0, _ := ret[0].(bool) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ConfigExists indicates an expected call of ConfigExists +func (mr *MockInterfaceMockRecorder) ConfigExists() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ConfigExists", reflect.TypeOf((*MockInterface)(nil).ConfigExists)) +} + +// Destroy mocks base method +func (m *MockInterface) Destroy() error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Destroy") + ret0, _ := ret[0].(error) + return ret0 +} + +// Destroy indicates an expected call of Destroy +func (mr *MockInterfaceMockRecorder) Destroy() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Destroy", reflect.TypeOf((*MockInterface)(nil).Destroy)) +} + +// GetStateOutputVariables mocks base method +func (m *MockInterface) GetStateOutputVariables(arg0 ...string) (map[string]string, error) { + m.ctrl.T.Helper() + varargs := []interface{}{} + for _, a := range arg0 { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "GetStateOutputVariables", varargs...) + ret0, _ := ret[0].(map[string]string) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetStateOutputVariables indicates an expected call of GetStateOutputVariables +func (mr *MockInterfaceMockRecorder) GetStateOutputVariables(arg0 ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetStateOutputVariables", reflect.TypeOf((*MockInterface)(nil).GetStateOutputVariables), arg0...) +} + +// InitializeWith mocks base method +func (m *MockInterface) InitializeWith(arg0 terraformer.Initializer) terraformer.Interface { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "InitializeWith", arg0) + ret0, _ := ret[0].(terraformer.Interface) + return ret0 +} + +// InitializeWith indicates an expected call of InitializeWith +func (mr *MockInterfaceMockRecorder) InitializeWith(arg0 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "InitializeWith", reflect.TypeOf((*MockInterface)(nil).InitializeWith), arg0) +} + +// SetVariablesEnvironment mocks base method +func (m *MockInterface) SetVariablesEnvironment(arg0 map[string]string) terraformer.Interface { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "SetVariablesEnvironment", arg0) + ret0, _ := ret[0].(terraformer.Interface) + return ret0 +} + +// SetVariablesEnvironment indicates an expected call of SetVariablesEnvironment +func (mr *MockInterfaceMockRecorder) SetVariablesEnvironment(arg0 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetVariablesEnvironment", reflect.TypeOf((*MockInterface)(nil).SetVariablesEnvironment), arg0) +} + +// MockInitializer is a mock of Initializer interface +type MockInitializer struct { + ctrl *gomock.Controller + recorder *MockInitializerMockRecorder +} + +// MockInitializerMockRecorder is the mock recorder for MockInitializer +type MockInitializerMockRecorder struct { + mock *MockInitializer +} + +// NewMockInitializer creates a new mock instance +func NewMockInitializer(ctrl *gomock.Controller) *MockInitializer { + mock := &MockInitializer{ctrl: ctrl} + mock.recorder = &MockInitializerMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use +func (m *MockInitializer) EXPECT() *MockInitializerMockRecorder { + return m.recorder +} + +// Initialize mocks base method +func (m *MockInitializer) Initialize(arg0 *terraformer0.InitializerConfig) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Initialize", arg0) + ret0, _ := ret[0].(error) + return ret0 +} + +// Initialize indicates an expected call of Initialize +func (mr *MockInitializerMockRecorder) Initialize(arg0 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Initialize", reflect.TypeOf((*MockInitializer)(nil).Initialize), arg0) +} + +// MockFactory is a mock of Factory interface +type MockFactory struct { + ctrl *gomock.Controller + recorder *MockFactoryMockRecorder +} + +// MockFactoryMockRecorder is the mock recorder for MockFactory +type MockFactoryMockRecorder struct { + mock *MockFactory +} + +// NewMockFactory creates a new mock instance +func NewMockFactory(ctrl *gomock.Controller) *MockFactory { + mock := &MockFactory{ctrl: ctrl} + mock.recorder = &MockFactoryMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use +func (m *MockFactory) EXPECT() *MockFactoryMockRecorder { + return m.recorder +} + +// DefaultInitializer mocks base method +func (m *MockFactory) DefaultInitializer(arg0 client.Client, arg1, arg2 string, arg3 []byte) terraformer.Initializer { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DefaultInitializer", arg0, arg1, arg2, arg3) + ret0, _ := ret[0].(terraformer.Initializer) + return ret0 +} + +// DefaultInitializer indicates an expected call of DefaultInitializer +func (mr *MockFactoryMockRecorder) DefaultInitializer(arg0, arg1, arg2, arg3 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DefaultInitializer", reflect.TypeOf((*MockFactory)(nil).DefaultInitializer), arg0, arg1, arg2, arg3) +} + +// New mocks base method +func (m *MockFactory) New(arg0 logrus.FieldLogger, arg1 client.Client, arg2 v1.CoreV1Interface, arg3, arg4, arg5, arg6 string) terraformer.Interface { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "New", arg0, arg1, arg2, arg3, arg4, arg5, arg6) + ret0, _ := ret[0].(terraformer.Interface) + return ret0 +} + +// New indicates an expected call of New +func (mr *MockFactoryMockRecorder) New(arg0, arg1, arg2, arg3, arg4, arg5, arg6 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "New", reflect.TypeOf((*MockFactory)(nil).New), arg0, arg1, arg2, arg3, arg4, arg5, arg6) +} + +// NewForConfig mocks base method +func (m *MockFactory) NewForConfig(arg0 logrus.FieldLogger, arg1 *rest.Config, arg2, arg3, arg4, arg5 string) (terraformer.Interface, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "NewForConfig", arg0, arg1, arg2, arg3, arg4, arg5) + ret0, _ := ret[0].(terraformer.Interface) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// NewForConfig indicates an expected call of NewForConfig +func (mr *MockFactoryMockRecorder) NewForConfig(arg0, arg1, arg2, arg3, arg4, arg5 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NewForConfig", reflect.TypeOf((*MockFactory)(nil).NewForConfig), arg0, arg1, arg2, arg3, arg4, arg5) +} diff --git a/pkg/mock/gardener/chartrenderer/doc.go b/pkg/mock/gardener/chartrenderer/doc.go new file mode 100644 index 000000000..ab94806eb --- /dev/null +++ b/pkg/mock/gardener/chartrenderer/doc.go @@ -0,0 +1,17 @@ +// Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//go:generate mockgen -package=chartrenderer -destination=mocks.go github.com/gardener/gardener/pkg/chartrenderer Interface + +package chartrenderer diff --git a/pkg/mock/gardener/chartrenderer/mocks.go b/pkg/mock/gardener/chartrenderer/mocks.go new file mode 100644 index 000000000..311716a4b --- /dev/null +++ b/pkg/mock/gardener/chartrenderer/mocks.go @@ -0,0 +1,64 @@ +// Code generated by MockGen. DO NOT EDIT. +// Source: github.com/gardener/gardener/pkg/chartrenderer (interfaces: Interface) + +// Package chartrenderer is a generated GoMock package. +package chartrenderer + +import ( + chartrenderer "github.com/gardener/gardener/pkg/chartrenderer" + gomock "github.com/golang/mock/gomock" + reflect "reflect" +) + +// MockInterface is a mock of Interface interface +type MockInterface struct { + ctrl *gomock.Controller + recorder *MockInterfaceMockRecorder +} + +// MockInterfaceMockRecorder is the mock recorder for MockInterface +type MockInterfaceMockRecorder struct { + mock *MockInterface +} + +// NewMockInterface creates a new mock instance +func NewMockInterface(ctrl *gomock.Controller) *MockInterface { + mock := &MockInterface{ctrl: ctrl} + mock.recorder = &MockInterfaceMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use +func (m *MockInterface) EXPECT() *MockInterfaceMockRecorder { + return m.recorder +} + +// Render mocks base method +func (m *MockInterface) Render(arg0, arg1, arg2 string, arg3 map[string]interface{}) (*chartrenderer.RenderedChart, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Render", arg0, arg1, arg2, arg3) + ret0, _ := ret[0].(*chartrenderer.RenderedChart) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// Render indicates an expected call of Render +func (mr *MockInterfaceMockRecorder) Render(arg0, arg1, arg2, arg3 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Render", reflect.TypeOf((*MockInterface)(nil).Render), arg0, arg1, arg2, arg3) +} + +// RenderArchive mocks base method +func (m *MockInterface) RenderArchive(arg0 []byte, arg1, arg2 string, arg3 map[string]interface{}) (*chartrenderer.RenderedChart, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "RenderArchive", arg0, arg1, arg2, arg3) + ret0, _ := ret[0].(*chartrenderer.RenderedChart) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// RenderArchive indicates an expected call of RenderArchive +func (mr *MockInterfaceMockRecorder) RenderArchive(arg0, arg1, arg2, arg3 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RenderArchive", reflect.TypeOf((*MockInterface)(nil).RenderArchive), arg0, arg1, arg2, arg3) +} diff --git a/pkg/util/chart/chart.go b/pkg/util/chart/chart.go new file mode 100644 index 000000000..90836a88a --- /dev/null +++ b/pkg/util/chart/chart.go @@ -0,0 +1,71 @@ +// Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT 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 chart + +import ( + "fmt" + "github.com/gardener/gardener/pkg/chartrenderer" +) + +const ( + // TerraformMainTFFilename is the name of the main.tf file. + TerraformMainTFFilename = "main.tf" + // TerraformVariablesTFFilename is the name of the variables.tf file. + TerraformVariablesTFFilename = "variables.tf" + // TerraformTFVarsFilename is the name of the terraform.tfvars file. + TerraformTFVarsFilename = "terraform.tfvars" +) + +// TerraformFiles contains all files necessary for initializing a Terraformer. +type TerraformFiles struct { + Main string + Variables string + TFVars []byte +} + +func nonEmptyFileContent(release *chartrenderer.RenderedChart, filename string) (string, error) { + content := release.FileContent(filename) + if len(content) == 0 { + return "", fmt.Errorf("empty %s file", filename) + } + + return content, nil +} + +// ExtractTerraformFiles extracts TerraformFiles from the given RenderedChart. +// +// It errors if a file is not contained in the chart. +func ExtractTerraformFiles(release *chartrenderer.RenderedChart) (*TerraformFiles, error) { + main, err := nonEmptyFileContent(release, TerraformMainTFFilename) + if err != nil { + return nil, err + } + + variables, err := nonEmptyFileContent(release, TerraformVariablesTFFilename) + if err != nil { + return nil, err + } + + tfVars, err := nonEmptyFileContent(release, TerraformTFVarsFilename) + if err != nil { + return nil, err + } + + return &TerraformFiles{ + Main: main, + Variables: variables, + TFVars: []byte(tfVars), + }, nil +} diff --git a/pkg/util/chart/chart_test.go b/pkg/util/chart/chart_test.go new file mode 100644 index 000000000..cae13b730 --- /dev/null +++ b/pkg/util/chart/chart_test.go @@ -0,0 +1,63 @@ +// Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT 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 chart + +import ( + "fmt" + "github.com/gardener/gardener/pkg/chartrenderer" + . "github.com/onsi/ginkgo" + . "github.com/onsi/gomega" + "k8s.io/helm/pkg/manifest" + "testing" +) + +func TestUtil(t *testing.T) { + RegisterFailHandler(Fail) + RunSpecs(t, "Chart Suite") +} + +func mkManifest(name string, content string) manifest.Manifest { + return manifest.Manifest{ + Name: fmt.Sprintf("/templates/%s", name), + Content: content, + } +} + +var _ = Describe("Chart", func() { + Describe("#ExtractTerraformFiles", func() { + It("should extract the terraform files", func() { + var ( + mainContent = "main" + variablesContent = "variables" + tfVarsContent = "tfVars" + ) + + files, err := ExtractTerraformFiles(&chartrenderer.RenderedChart{ + Manifests: []manifest.Manifest{ + mkManifest(TerraformMainTFFilename, mainContent), + mkManifest(TerraformVariablesTFFilename, variablesContent), + mkManifest(TerraformTFVarsFilename, tfVarsContent), + }, + }) + + Expect(err).NotTo(HaveOccurred()) + Expect(files).To(Equal(&TerraformFiles{ + Main: mainContent, + Variables: variablesContent, + TFVars: []byte(tfVarsContent), + })) + }) + }) +}) 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 000000000..261eeb9e9 --- /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 [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT 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/auth/credential.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credential.go new file mode 100644 index 000000000..7f20b7a40 --- /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/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 000000000..68f822633 --- /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 000000000..6d4763e66 --- /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 000000000..55a5c2da0 --- /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/env.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/provider/env.go new file mode 100644 index 000000000..3cd0d020a --- /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 000000000..1906d21f6 --- /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 = time.Second * 1 + 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 000000000..8d525c37a --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/provider/profile_credentials.go @@ -0,0 +1,158 @@ +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 { + 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 000000000..ae4e168eb --- /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 000000000..3f9315d13 --- /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 000000000..00d688eb8 --- /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 000000000..554431ff0 --- /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 000000000..27602fd74 --- /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 000000000..77fcec231 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/roa_signature_composer.go @@ -0,0 +1,136 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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) + signature := signer.Sign(stringToSign, "") + accessKeyId, err := signer.GetAccessKeyId() + if err != nil { + return nil + } + + 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)) + 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 000000000..14ea15ca4 --- /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 hookGetUUIDV4 = 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"] = hookGetUUIDV4(utils.GetUUIDV4) + 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 000000000..cbbc3cef7 --- /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/algorithms.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers/algorithms.go new file mode 100644 index 000000000..887f50209 --- /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 000000000..ba291a41e --- /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 000000000..99c624c88 --- /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 000000000..bc4f35b85 --- /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 000000000..75b78433a --- /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 000000000..73788429e --- /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 000000000..19273d5a6 --- /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 000000000..c945c8aeb --- /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 000000000..d0ce36c38 --- /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 000000000..973485298 --- /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 000000000..01c2f93ba --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/client.go @@ -0,0 +1,725 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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" + + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/provider" + + "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/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 + + 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) 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 +} + +// 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.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) 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 + 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 && client.httpClient.Timeout != 10000000000 { + readTimeout = client.httpClient.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 { + 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 value == 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 { + 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 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()) + // 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 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 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 000000000..e8862e0c2 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/config.go @@ -0,0 +1,91 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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"` + Timeout time.Duration `default:"10000000000"` + HttpTransport *http.Transport `default:""` + EnableAsync bool `default:"false"` + MaxTaskQueueSize int `default:"1000"` + GoRoutinePoolSize int `default:"5"` + Scheme string `default:"HTTP"` +} + +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/endpoints_config.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/endpoints/endpoints_config.go new file mode 100644 index 000000000..60adf7d45 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/endpoints/endpoints_config.go @@ -0,0 +1,1670 @@ + +package endpoints + +import ( + "encoding/json" + "fmt" + "sync" +) + +const endpointsJson =`{ + "products": [ + { + "code": "ecs", + "document_id": "25484", + "location_service_code": "ecs", + "regional_endpoints": [ + { + "region": "cn-shanghai", + "endpoint": "ecs-cn-hangzhou.aliyuncs.com" + }, + { + "region": "eu-west-1", + "endpoint": "ecs.eu-west-1.aliyuncs.com" + }, + { + "region": "cn-huhehaote", + "endpoint": "ecs.cn-huhehaote.aliyuncs.com" + }, + { + "region": "me-east-1", + "endpoint": "ecs.me-east-1.aliyuncs.com" + }, + { + "region": "ap-southeast-3", + "endpoint": "ecs.ap-southeast-3.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-beijing", + "endpoint": "ecs-cn-hangzhou.aliyuncs.com" + }, + { + "region": "cn-hangzhou", + "endpoint": "ecs-cn-hangzhou.aliyuncs.com" + }, + { + "region": "cn-shenzhen", + "endpoint": "ecs-cn-hangzhou.aliyuncs.com" + }, + { + "region": "ap-northeast-1", + "endpoint": "ecs.ap-northeast-1.aliyuncs.com" + }, + { + "region": "ap-southeast-5", + "endpoint": "ecs.ap-southeast-5.aliyuncs.com" + }, + { + "region": "eu-central-1", + "endpoint": "ecs.eu-central-1.aliyuncs.com" + }, + { + "region": "cn-zhangjiakou", + "endpoint": "ecs.cn-zhangjiakou.aliyuncs.com" + }, + { + "region": "cn-qingdao", + "endpoint": "ecs-cn-hangzhou.aliyuncs.com" + }, + { + "region": "cn-hongkong", + "endpoint": "ecs-cn-hangzhou.aliyuncs.com" + }, + { + "region": "ap-southeast-1", + "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" + } + ], + "global_endpoint": "ecs-cn-hangzhou.aliyuncs.com", + "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": "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": "itaas", + "document_id": "55759", + "location_service_code": "itaas", + "regional_endpoints": null, + "global_endpoint": "itaas.aliyuncs.com", + "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": "slb", + "document_id": "27565", + "location_service_code": "slb", + "regional_endpoints": [ + { + "region": "cn-hongkong", + "endpoint": "slb.aliyuncs.com" + }, + { + "region": "me-east-1", + "endpoint": "slb.me-east-1.aliyuncs.com" + }, + { + "region": "ap-southeast-5", + "endpoint": "slb.ap-southeast-5.aliyuncs.com" + }, + { + "region": "ap-southeast-2", + "endpoint": "slb.ap-southeast-2.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-shanghai", + "endpoint": "slb.aliyuncs.com" + }, + { + "region": "eu-west-1", + "endpoint": "slb.eu-west-1.aliyuncs.com" + }, + { + "region": "cn-huhehaote", + "endpoint": "slb.cn-huhehaote.aliyuncs.com" + }, + { + "region": "us-west-1", + "endpoint": "slb.aliyuncs.com" + }, + { + "region": "cn-zhangjiakou", + "endpoint": "slb.cn-zhangjiakou.aliyuncs.com" + }, + { + "region": "cn-qingdao", + "endpoint": "slb.aliyuncs.com" + }, + { + "region": "cn-hangzhou", + "endpoint": "slb.aliyuncs.com" + }, + { + "region": "cn-shenzhen", + "endpoint": "slb.aliyuncs.com" + }, + { + "region": "us-east-1", + "endpoint": "slb.aliyuncs.com" + }, + { + "region": "ap-southeast-3", + "endpoint": "slb.ap-southeast-3.aliyuncs.com" + }, + { + "region": "cn-beijing", + "endpoint": "slb.aliyuncs.com" + }, + { + "region": "ap-southeast-1", + "endpoint": "slb.aliyuncs.com" + }, + { + "region": "ap-northeast-1", + "endpoint": "slb.ap-northeast-1.aliyuncs.com" + } + ], + "global_endpoint": "slb.aliyuncs.com", + "regional_endpoint_pattern": "" + }, + { + "code": "cloudwf", + "document_id": "58111", + "location_service_code": "cloudwf", + "regional_endpoints": null, + "global_endpoint": "cloudwf.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": "dds", + "document_id": "61715", + "location_service_code": "dds", + "regional_endpoints": [ + { + "region": "ap-southeast-5", + "endpoint": "mongodb.ap-southeast-5.aliyuncs.com" + }, + { + "region": "cn-qingdao", + "endpoint": "mongodb.aliyuncs.com" + }, + { + "region": "cn-hongkong", + "endpoint": "mongodb.aliyuncs.com" + }, + { + "region": "eu-west-1", + "endpoint": "mongodb.eu-west-1.aliyuncs.com" + }, + { + "region": "us-west-1", + "endpoint": "mongodb.aliyuncs.com" + }, + { + "region": "us-east-1", + "endpoint": "mongodb.aliyuncs.com" + }, + { + "region": "me-east-1", + "endpoint": "mongodb.me-east-1.aliyuncs.com" + }, + { + "region": "cn-zhangjiakou", + "endpoint": "mongodb.cn-zhangjiakou.aliyuncs.com" + }, + { + "region": "cn-shanghai", + "endpoint": "mongodb.aliyuncs.com" + }, + { + "region": "cn-shenzhen", + "endpoint": "mongodb.aliyuncs.com" + }, + { + "region": "ap-northeast-1", + "endpoint": "mongodb.ap-northeast-1.aliyuncs.com" + }, + { + "region": "ap-southeast-1", + "endpoint": "mongodb.aliyuncs.com" + }, + { + "region": "ap-southeast-2", + "endpoint": "mongodb.ap-southeast-2.aliyuncs.com" + }, + { + "region": "ap-southeast-3", + "endpoint": "mongodb.ap-southeast-3.aliyuncs.com" + }, + { + "region": "ap-south-1", + "endpoint": "mongodb.ap-south-1.aliyuncs.com" + }, + { + "region": "eu-central-1", + "endpoint": "mongodb.eu-central-1.aliyuncs.com" + }, + { + "region": "cn-beijing", + "endpoint": "mongodb.aliyuncs.com" + }, + { + "region": "cn-hangzhou", + "endpoint": "mongodb.aliyuncs.com" + }, + { + "region": "cn-huhehaote", + "endpoint": "mongodb.cn-huhehaote.aliyuncs.com" + } + ], + "global_endpoint": "mongodb.aliyuncs.com", + "regional_endpoint_pattern": "mongodb.[RegionId].aliyuncs.com" + }, + { + "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": "ons", + "document_id": "44416", + "location_service_code": "ons", + "regional_endpoints": [ + { + "region": "cn-zhangjiakou", + "endpoint": "ons.cn-zhangjiakou.aliyuncs.com" + }, + { + "region": "us-west-1", + "endpoint": "ons.us-west-1.aliyuncs.com" + }, + { + "region": "me-east-1", + "endpoint": "ons.me-east-1.aliyuncs.com" + }, + { + "region": "us-east-1", + "endpoint": "ons.us-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-southeast-1", + "endpoint": "ons.ap-southeast-1.aliyuncs.com" + }, + { + "region": "cn-shanghai", + "endpoint": "ons.cn-shanghai.aliyuncs.com" + }, + { + "region": "cn-shenzhen", + "endpoint": "ons.cn-shenzhen.aliyuncs.com" + }, + { + "region": "cn-hangzhou", + "endpoint": "ons.cn-hangzhou.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": "cn-beijing", + "endpoint": "ons.cn-beijing.aliyuncs.com" + }, + { + "region": "ap-southeast-3", + "endpoint": "ons.ap-southeast-3.aliyuncs.com" + }, + { + "region": "cn-huhehaote", + "endpoint": "ons.cn-huhehaote.aliyuncs.com" + }, + { + "region": "cn-hongkong", + "endpoint": "ons.cn-hongkong.aliyuncs.com" + }, + { + "region": "cn-qingdao", + "endpoint": "ons.cn-qingdao.aliyuncs.com" + } + ], + "global_endpoint": "", + "regional_endpoint_pattern": "" + }, + { + "code": "polardb", + "document_id": "58764", + "location_service_code": "polardb", + "regional_endpoints": [ + { + "region": "cn-qingdao", + "endpoint": "polardb.aliyuncs.com" + }, + { + "region": "cn-beijing", + "endpoint": "polardb.aliyuncs.com" + }, + { + "region": "cn-hangzhou", + "endpoint": "polardb.aliyuncs.com" + }, + { + "region": "cn-shanghai", + "endpoint": "polardb.aliyuncs.com" + }, + { + "region": "cn-shenzhen", + "endpoint": "polardb.aliyuncs.com" + }, + { + "region": "cn-huhehaote", + "endpoint": "polardb.cn-huhehaote.aliyuncs.com" + }, + { + "region": "ap-southeast-5", + "endpoint": "polardb.ap-southeast-5.aliyuncs.com" + }, + { + "region": "ap-south-1", + "endpoint": "polardb.ap-south-1.aliyuncs.com" + }, + { + "region": "cn-hongkong", + "endpoint": "polardb.aliyuncs.com" + } + ], + "global_endpoint": "", + "regional_endpoint_pattern": "polardb.aliyuncs.com" + }, + { + "code": "batchcompute", + "document_id": "44717", + "location_service_code": "batchcompute", + "regional_endpoints": [ + { + "region": "us-west-1", + "endpoint": "batchcompute.us-west-1.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" + }, + { + "region": "cn-huhehaote", + "endpoint": "batchcompute.cn-huhehaote.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" + } + ], + "global_endpoint": "", + "regional_endpoint_pattern": "batchcompute.[RegionId].aliyuncs.com" + }, + { + "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": "vod", + "document_id": "60574", + "location_service_code": "vod", + "regional_endpoints": [ + { + "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" + }, + { + "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" + } + ], + "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": "ess", + "document_id": "25925", + "location_service_code": "ess", + "regional_endpoints": [ + { + "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": "eu-central-1", + "endpoint": "ess.eu-central-1.aliyuncs.com" + }, + { + "region": "cn-shanghai", + "endpoint": "ess.aliyuncs.com" + }, + { + "region": "ap-southeast-1", + "endpoint": "ess.aliyuncs.com" + }, + { + "region": "cn-huhehaote", + "endpoint": "ess.cn-huhehaote.aliyuncs.com" + }, + { + "region": "ap-southeast-2", + "endpoint": "ess.ap-southeast-2.aliyuncs.com" + }, + { + "region": "cn-beijing", + "endpoint": "ess.aliyuncs.com" + }, + { + "region": "cn-hongkong", + "endpoint": "ess.aliyuncs.com" + }, + { + "region": "us-west-1", + "endpoint": "ess.aliyuncs.com" + }, + { + "region": "us-east-1", + "endpoint": "ess.aliyuncs.com" + }, + { + "region": "ap-southeast-5", + "endpoint": "ess.ap-southeast-5.aliyuncs.com" + }, + { + "region": "cn-qingdao", + "endpoint": "ess.aliyuncs.com" + }, + { + "region": "ap-southeast-3", + "endpoint": "ess.ap-southeast-3.aliyuncs.com" + }, + { + "region": "cn-zhangjiakou", + "endpoint": "ess.cn-zhangjiakou.aliyuncs.com" + }, + { + "region": "cn-hangzhou", + "endpoint": "ess.aliyuncs.com" + }, + { + "region": "cn-shenzhen", + "endpoint": "ess.aliyuncs.com" + }, + { + "region": "eu-west-1", + "endpoint": "ess.eu-west-1.aliyuncs.com" + } + ], + "global_endpoint": "ess.aliyuncs.com", + "regional_endpoint_pattern": "ess.[RegionId].aliyuncs.com" + }, + { + "code": "live", + "document_id": "48207", + "location_service_code": "live", + "regional_endpoints": [ + { + "region": "cn-beijing", + "endpoint": "live.aliyuncs.com" + }, + { + "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" + } + ], + "global_endpoint": "live.aliyuncs.com", + "regional_endpoint_pattern": "" + }, + { + "code": "hpc", + "document_id": "35201", + "location_service_code": "hpc", + "regional_endpoints": [ + { + "region": "cn-hangzhou", + "endpoint": "hpc.aliyuncs.com" + }, + { + "region": "cn-beijing", + "endpoint": "hpc.aliyuncs.com" + } + ], + "global_endpoint": "hpc.aliyuncs.com", + "regional_endpoint_pattern": "" + }, + { + "code": "rds", + "document_id": "26223", + "location_service_code": "rds", + "regional_endpoints": [ + { + "region": "me-east-1", + "endpoint": "rds.me-east-1.aliyuncs.com" + }, + { + "region": "ap-south-1", + "endpoint": "rds.ap-south-1.aliyuncs.com" + }, + { + "region": "cn-hangzhou", + "endpoint": "rds.aliyuncs.com" + }, + { + "region": "cn-shenzhen", + "endpoint": "rds.aliyuncs.com" + }, + { + "region": "ap-southeast-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-zhangjiakou", + "endpoint": "rds.cn-zhangjiakou.aliyuncs.com" + }, + { + "region": "cn-qingdao", + "endpoint": "rds.aliyuncs.com" + }, + { + "region": "us-west-1", + "endpoint": "rds.aliyuncs.com" + }, + { + "region": "us-east-1", + "endpoint": "rds.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-beijing", + "endpoint": "rds.aliyuncs.com" + }, + { + "region": "cn-shanghai", + "endpoint": "rds.aliyuncs.com" + }, + { + "region": "eu-west-1", + "endpoint": "rds.eu-west-1.aliyuncs.com" + }, + { + "region": "cn-huhehaote", + "endpoint": "rds.cn-huhehaote.aliyuncs.com" + }, + { + "region": "ap-northeast-1", + "endpoint": "rds.ap-northeast-1.aliyuncs.com" + }, + { + "region": "cn-hongkong", + "endpoint": "rds.aliyuncs.com" + } + ], + "global_endpoint": "rds.aliyuncs.com", + "regional_endpoint_pattern": "" + }, + { + "code": "cloudapi", + "document_id": "43590", + "location_service_code": "apigateway", + "regional_endpoints": [ + { + "region": "cn-beijing", + "endpoint": "apigateway.cn-beijing.aliyuncs.com" + }, + { + "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": "cn-shanghai", + "endpoint": "apigateway.cn-shanghai.aliyuncs.com" + }, + { + "region": "us-west-1", + "endpoint": "apigateway.us-west-1.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-qingdao", + "endpoint": "apigateway.cn-qingdao.aliyuncs.com" + }, + { + "region": "cn-zhangjiakou", + "endpoint": "apigateway.cn-zhangjiakou.aliyuncs.com" + }, + { + "region": "cn-huhehaote", + "endpoint": "apigateway.cn-huhehaote.aliyuncs.com" + }, + { + "region": "eu-west-1", + "endpoint": "apigateway.eu-west-1.aliyuncs.com" + }, + { + "region": "me-east-1", + "endpoint": "apigateway.me-east-1.aliyuncs.com" + }, + { + "region": "cn-hangzhou", + "endpoint": "apigateway.cn-hangzhou.aliyuncs.com" + }, + { + "region": "ap-northeast-1", + "endpoint": "apigateway.ap-northeast-1.aliyuncs.com" + }, + { + "region": "ap-southeast-5", + "endpoint": "apigateway.ap-southeast-5.aliyuncs.com" + }, + { + "region": "cn-hongkong", + "endpoint": "apigateway.cn-hongkong.aliyuncs.com" + }, + { + "region": "cn-shenzhen", + "endpoint": "apigateway.cn-shenzhen.aliyuncs.com" + }, + { + "region": "ap-southeast-3", + "endpoint": "apigateway.ap-southeast-3.aliyuncs.com" + } + ], + "global_endpoint": "", + "regional_endpoint_pattern": "apigateway.[RegionId].aliyuncs.com" + }, + { + "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": "cs", + "document_id": "26043", + "location_service_code": "cs", + "regional_endpoints": null, + "global_endpoint": "cs.aliyuncs.com", + "regional_endpoint_pattern": "" + }, + { + "code": "jaq", + "document_id": "35037", + "location_service_code": "jaq", + "regional_endpoints": null, + "global_endpoint": "jaq.aliyuncs.com", + "regional_endpoint_pattern": "" + }, + { + "code": "r-kvstore", + "document_id": "60831", + "location_service_code": "redisa", + "regional_endpoints": [ + { + "region": "cn-huhehaote", + "endpoint": "r-kvstore.cn-huhehaote.aliyuncs.com" + }, + { + "region": "cn-zhangjiakou", + "endpoint": "r-kvstore.cn-zhangjiakou.aliyuncs.com" + }, + { + "region": "cn-beijing", + "endpoint": "r-kvstore.aliyuncs.com" + }, + { + "region": "cn-shanghai", + "endpoint": "r-kvstore.aliyuncs.com" + }, + { + "region": "ap-south-1", + "endpoint": "r-kvstore.ap-south-1.aliyuncs.com" + }, + { + "region": "eu-central-1", + "endpoint": "r-kvstore.eu-central-1.aliyuncs.com" + }, + { + "region": "cn-hangzhou", + "endpoint": "r-kvstore.aliyuncs.com" + }, + { + "region": "cn-shenzhen", + "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": "cn-hongkong", + "endpoint": "r-kvstore.cn-hongkong.aliyuncs.com" + }, + { + "region": "ap-southeast-2", + "endpoint": "r-kvstore.ap-southeast-2.aliyuncs.com" + }, + { + "region": "eu-west-1", + "endpoint": "r-kvstore.eu-west-1.aliyuncs.com" + }, + { + "region": "ap-southeast-5", + "endpoint": "r-kvstore.ap-southeast-5.aliyuncs.com" + }, + { + "region": "us-west-1", + "endpoint": "r-kvstore.aliyuncs.com" + }, + { + "region": "ap-southeast-1", + "endpoint": "r-kvstore.ap-southeast-1.aliyuncs.com" + }, + { + "region": "ap-southeast-3", + "endpoint": "r-kvstore.ap-southeast-3.aliyuncs.com" + }, + { + "region": "cn-qingdao", + "endpoint": "r-kvstore.aliyuncs.com" + }, + { + "region": "us-east-1", + "endpoint": "r-kvstore.aliyuncs.com" + } + ], + "global_endpoint": "r-kvstore.aliyuncs.com", + "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": "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": "sts", + "document_id": "28756", + "location_service_code": "sts", + "regional_endpoints": null, + "global_endpoint": "sts.aliyuncs.com", + "regional_endpoint_pattern": "" + }, + { + "code": "cr", + "document_id": "60716", + "location_service_code": "cr", + "regional_endpoints": null, + "global_endpoint": "cr.aliyuncs.com", + "regional_endpoint_pattern": "" + }, + { + "code": "arms", + "document_id": "42924", + "location_service_code": "arms", + "regional_endpoints": [ + { + "region": "cn-hangzhou", + "endpoint": "arms.cn-hangzhou.aliyuncs.com" + }, + { + "region": "cn-shanghai", + "endpoint": "arms.cn-shanghai.aliyuncs.com" + }, + { + "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" + } + ], + "global_endpoint": "", + "regional_endpoint_pattern": "arms.[RegionId].aliyuncs.com" + }, + { + "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": "vpc", + "document_id": "34962", + "location_service_code": "vpc", + "regional_endpoints": [ + { + "region": "us-west-1", + "endpoint": "vpc.aliyuncs.com" + }, + { + "region": "us-east-1", + "endpoint": "vpc.aliyuncs.com" + }, + { + "region": "cn-hangzhou", + "endpoint": "vpc.aliyuncs.com" + }, + { + "region": "cn-shenzhen", + "endpoint": "vpc.aliyuncs.com" + }, + { + "region": "ap-southeast-1", + "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-northeast-1", + "endpoint": "vpc.ap-northeast-1.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": "ap-southeast-5", + "endpoint": "vpc.ap-southeast-5.aliyuncs.com" + }, + { + "region": "ap-south-1", + "endpoint": "vpc.ap-south-1.aliyuncs.com" + }, + { + "region": "cn-zhangjiakou", + "endpoint": "vpc.cn-zhangjiakou.aliyuncs.com" + }, + { + "region": "cn-beijing", + "endpoint": "vpc.aliyuncs.com" + }, + { + "region": "ap-southeast-2", + "endpoint": "vpc.ap-southeast-2.aliyuncs.com" + }, + { + "region": "cn-qingdao", + "endpoint": "vpc.aliyuncs.com" + }, + { + "region": "cn-shanghai", + "endpoint": "vpc.aliyuncs.com" + }, + { + "region": "cn-hongkong", + "endpoint": "vpc.aliyuncs.com" + }, + { + "region": "eu-west-1", + "endpoint": "vpc.eu-west-1.aliyuncs.com" + } + ], + "global_endpoint": "vpc.aliyuncs.com", + "regional_endpoint_pattern": "" + }, + { + "code": "aegis", + "document_id": "28449", + "location_service_code": "vipaegis", + "regional_endpoints": [ + { + "region": "ap-southeast-3", + "endpoint": "aegis.ap-southeast-3.aliyuncs.com" + }, + { + "region": "cn-hangzhou", + "endpoint": "aegis.cn-hangzhou.aliyuncs.com" + } + ], + "global_endpoint": "aegis.cn-hangzhou.aliyuncs.com", + "regional_endpoint_pattern": "" + }, + { + "code": "domain", + "document_id": "42875", + "location_service_code": "domain", + "regional_endpoints": [ + { + "region": "cn-hangzhou", + "endpoint": "domain.aliyuncs.com" + }, + { + "region": "ap-southeast-1", + "endpoint": "domain-intl.aliyuncs.com" + } + ], + "global_endpoint": "domain.aliyuncs.com", + "regional_endpoint_pattern": "domain.aliyuncs.com" + }, + { + "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": "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": "emr", + "document_id": "28140", + "location_service_code": "emr", + "regional_endpoints": [ + { + "region": "us-east-1", + "endpoint": "emr.us-east-1.aliyuncs.com" + }, + { + "region": "ap-southeast-5", + "endpoint": "emr.ap-southeast-5.aliyuncs.com" + }, + { + "region": "eu-central-1", + "endpoint": "emr.eu-central-1.aliyuncs.com" + }, + { + "region": "eu-west-1", + "endpoint": "emr.eu-west-1.aliyuncs.com" + }, + { + "region": "us-west-1", + "endpoint": "emr.aliyuncs.com" + }, + { + "region": "ap-southeast-1", + "endpoint": "emr.aliyuncs.com" + }, + { + "region": "ap-south-1", + "endpoint": "emr.ap-south-1.aliyuncs.com" + }, + { + "region": "me-east-1", + "endpoint": "emr.me-east-1.aliyuncs.com" + }, + { + "region": "cn-beijing", + "endpoint": "emr.aliyuncs.com" + }, + { + "region": "cn-shanghai", + "endpoint": "emr.aliyuncs.com" + }, + { + "region": "cn-hongkong", + "endpoint": "emr.cn-hongkong.aliyuncs.com" + }, + { + "region": "cn-huhehaote", + "endpoint": "emr.cn-huhehaote.aliyuncs.com" + }, + { + "region": "ap-northeast-1", + "endpoint": "emr.ap-northeast-1.aliyuncs.com" + }, + { + "region": "ap-southeast-3", + "endpoint": "emr.ap-southeast-3.aliyuncs.com" + }, + { + "region": "cn-hangzhou", + "endpoint": "emr.aliyuncs.com" + }, + { + "region": "ap-southeast-2", + "endpoint": "emr.ap-southeast-2.aliyuncs.com" + }, + { + "region": "cn-zhangjiakou", + "endpoint": "emr.cn-zhangjiakou.aliyuncs.com" + }, + { + "region": "cn-qingdao", + "endpoint": "emr.cn-qingdao.aliyuncs.com" + }, + { + "region": "cn-shenzhen", + "endpoint": "emr.aliyuncs.com" + } + ], + "global_endpoint": "emr.aliyuncs.com", + "regional_endpoint_pattern": "emr.[RegionId].aliyuncs.com" + }, + { + "code": "httpdns", + "document_id": "52679", + "location_service_code": "httpdns", + "regional_endpoints": null, + "global_endpoint": "httpdns-api.aliyuncs.com", + "regional_endpoint_pattern": "" + }, + { + "code": "push", + "document_id": "30074", + "location_service_code": "push", + "regional_endpoints": null, + "global_endpoint": "cloudpush.aliyuncs.com", + "regional_endpoint_pattern": "" + }, + { + "code": "cms", + "document_id": "28615", + "location_service_code": "cms", + "regional_endpoints": [ + { + "region": "cn-qingdao", + "endpoint": "metrics.cn-hangzhou.aliyuncs.com" + }, + { + "region": "cn-hangzhou", + "endpoint": "metrics.cn-hangzhou.aliyuncs.com" + }, + { + "region": "eu-west-1", + "endpoint": "metrics.eu-west-1.aliyuncs.com" + }, + { + "region": "eu-central-1", + "endpoint": "metrics.cn-hangzhou.aliyuncs.com" + }, + { + "region": "ap-northeast-1", + "endpoint": "metrics.ap-northeast-1.aliyuncs.com" + }, + { + "region": "ap-south-1", + "endpoint": "metrics.ap-south-1.aliyuncs.com" + }, + { + "region": "cn-beijing", + "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": "ap-southeast-2", + "endpoint": "metrics.cn-hangzhou.aliyuncs.com" + }, + { + "region": "ap-southeast-5", + "endpoint": "metrics.ap-southeast-5.aliyuncs.com" + }, + { + "region": "cn-huhehaote", + "endpoint": "metrics.cn-huhehaote.aliyuncs.com" + }, + { + "region": "cn-zhangjiakou", + "endpoint": "metrics.cn-hangzhou.aliyuncs.com" + }, + { + "region": "me-east-1", + "endpoint": "metrics.cn-hangzhou.aliyuncs.com" + }, + { + "region": "ap-southeast-3", + "endpoint": "metrics.ap-southeast-3.aliyuncs.com" + }, + { + "region": "cn-shanghai", + "endpoint": "metrics.cn-hangzhou.aliyuncs.com" + }, + { + "region": "cn-hongkong", + "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" + } + ], + "global_endpoint": "metrics.cn-hangzhou.aliyuncs.com", + "regional_endpoint_pattern": "" + }, + { + "code": "nas", + "document_id": "62598", + "location_service_code": "nas", + "regional_endpoints": [ + { + "region": "ap-southeast-5", + "endpoint": "nas.ap-southeast-5.aliyuncs.com" + }, + { + "region": "ap-south-1", + "endpoint": "nas.ap-south-1.aliyuncs.com" + }, + { + "region": "us-west-1", + "endpoint": "nas.us-west-1.aliyuncs.com" + }, + { + "region": "ap-southeast-3", + "endpoint": "nas.ap-southeast-3.aliyuncs.com" + }, + { + "region": "cn-zhangjiakou", + "endpoint": "nas.cn-zhangjiakou.aliyuncs.com" + }, + { + "region": "ap-northeast-1", + "endpoint": "nas.ap-northeast-1.aliyuncs.com" + }, + { + "region": "cn-hangzhou", + "endpoint": "nas.cn-hangzhou.aliyuncs.com" + }, + { + "region": "cn-qingdao", + "endpoint": "nas.cn-qingdao.aliyuncs.com" + }, + { + "region": "cn-beijing", + "endpoint": "nas.cn-beijing.aliyuncs.com" + }, + { + "region": "ap-southeast-2", + "endpoint": "nas.ap-southeast-2.aliyuncs.com" + }, + { + "region": "cn-shenzhen", + "endpoint": "nas.cn-shenzhen.aliyuncs.com" + }, + { + "region": "eu-central-1", + "endpoint": "nas.eu-central-1.aliyuncs.com" + }, + { + "region": "cn-huhehaote", + "endpoint": "nas.cn-huhehaote.aliyuncs.com" + }, + { + "region": "cn-shanghai", + "endpoint": "nas.cn-shanghai.aliyuncs.com" + }, + { + "region": "cn-hongkong", + "endpoint": "nas.cn-hongkong.aliyuncs.com" + }, + { + "region": "ap-southeast-1", + "endpoint": "nas.ap-southeast-1.aliyuncs.com" + }, + { + "region": "us-east-1", + "endpoint": "nas.us-east-1.aliyuncs.com" + } + ], + "global_endpoint": "", + "regional_endpoint_pattern": "" + }, + { + "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": "green", + "document_id": "28427", + "location_service_code": "green", + "regional_endpoints": [ + { + "region": "us-west-1", + "endpoint": "green.us-west-1.aliyuncs.com" + }, + { + "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" + } + ], + "global_endpoint": "green.aliyuncs.com", + "regional_endpoint_pattern": "" + }, + { + "code": "ccc", + "document_id": "63027", + "location_service_code": "ccc", + "regional_endpoints": [ + { + "region": "cn-shanghai", + "endpoint": "ccc.cn-shanghai.aliyuncs.com" + }, + { + "region": "cn-hangzhou", + "endpoint": "ccc.cn-hangzhou.aliyuncs.com" + } + ], + "global_endpoint": "", + "regional_endpoint_pattern": "ccc.[RegionId].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": "mts", + "document_id": "29212", + "location_service_code": "mts", + "regional_endpoints": [ + { + "region": "ap-northeast-1", + "endpoint": "mts.ap-northeast-1.aliyuncs.com" + }, + { + "region": "cn-shanghai", + "endpoint": "mts.cn-shanghai.aliyuncs.com" + }, + { + "region": "cn-hongkong", + "endpoint": "mts.cn-hongkong.aliyuncs.com" + }, + { + "region": "cn-shenzhen", + "endpoint": "mts.cn-shenzhen.aliyuncs.com" + }, + { + "region": "us-west-1", + "endpoint": "mts.us-west-1.aliyuncs.com" + }, + { + "region": "cn-zhangjiakou", + "endpoint": "mts.cn-zhangjiakou.aliyuncs.com" + }, + { + "region": "eu-west-1", + "endpoint": "mts.eu-west-1.aliyuncs.com" + }, + { + "region": "ap-south-1", + "endpoint": "mts.ap-south-1.aliyuncs.com" + }, + { + "region": "cn-beijing", + "endpoint": "mts.cn-beijing.aliyuncs.com" + }, + { + "region": "cn-hangzhou", + "endpoint": "mts.cn-hangzhou.aliyuncs.com" + }, + { + "region": "ap-southeast-1", + "endpoint": "mts.ap-southeast-1.aliyuncs.com" + }, + { + "region": "eu-central-1", + "endpoint": "mts.eu-central-1.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 000000000..160e62cb6 --- /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 000000000..7fee64d42 --- /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 000000000..cc354cc4d --- /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 000000000..e39f53367 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/endpoints/mapping_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" +) + +const keyFormatter = "%s::%s" + +var endpointMapping = make(map[string]string) + +// AddEndpointMapping Use product id and region id as key to store the endpoint into inner map +func AddEndpointMapping(regionId, productId, endpoint string) (err error) { + key := fmt.Sprintf(keyFormatter, strings.ToLower(regionId), strings.ToLower(productId)) + endpointMapping[key] = endpoint + return nil +} + +// MappingResolver the mapping resolver type +type MappingResolver struct { +} + +// GetName get the resolver name: "mapping resolver" +func (resolver *MappingResolver) GetName() (name string) { + name = "mapping resolver" + return +} + +// TryResolve use Product and RegionId as key to find endpoint from inner map +func (resolver *MappingResolver) TryResolve(param *ResolveParam) (endpoint string, support bool, err error) { + key := fmt.Sprintf(keyFormatter, strings.ToLower(param.RegionId), strings.ToLower(param.Product)) + endpoint, contains := endpointMapping[key] + return endpoint, contains, nil +} 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 000000000..5e1e30530 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/endpoints/resolver.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 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{ + &SimpleHostResolver{}, + &MappingResolver{}, + &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/endpoints/simple_host_resolver.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/endpoints/simple_host_resolver.go new file mode 100644 index 000000000..9ba2346c6 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/endpoints/simple_host_resolver.go @@ -0,0 +1,33 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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 + +// SimpleHostResolver the simple host resolver type +type SimpleHostResolver struct { +} + +// GetName get the resolver name: "simple host resolver" +func (resolver *SimpleHostResolver) GetName() (name string) { + name = "simple host resolver" + return +} + +// TryResolve if the Domain exist in param, use it as endpoint +func (resolver *SimpleHostResolver) TryResolve(param *ResolveParam) (endpoint string, support bool, err error) { + if support = len(param.Domain) > 0; support { + endpoint = param.Domain + } + return +} 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 000000000..1e2d9c004 --- /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 000000000..49962f3b5 --- /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 000000000..1b7810414 --- /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 000000000..4b09d7d71 --- /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 000000000..04f033935 --- /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_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/acs_request.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests/acs_request.go new file mode 100644 index 000000000..725b20b91 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests/acs_request.go @@ -0,0 +1,373 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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" + 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 + 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) 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) + } + err = addParam(request, fieldPosition, key, value) + if err != nil { + return + } + } else if typeTag == "Repeated" { + // repeated param + repeatedFieldValue := dataValue.Field(i) + 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 +} + +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 000000000..80c170097 --- /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 000000000..8159aa377 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests/roa_request.go @@ -0,0 +1,152 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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() + result = popStandardUrlencode(result) + 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 popStandardUrlencode(stringToSign string) (result string) { + result = strings.Replace(stringToSign, "+", "%20", -1) + result = strings.Replace(result, "*", "%2A", -1) + result = strings.Replace(result, "%7E", "~", -1) + return +} + +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 000000000..01be6fd04 --- /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 000000000..28af63ea1 --- /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/json_parser.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses/json_parser.go new file mode 100644 index 000000000..4c9570198 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses/json_parser.go @@ -0,0 +1,332 @@ +package responses + +import ( + "encoding/json" + "io" + "math" + "strconv" + "strings" + "sync" + "unsafe" + + jsoniter "github.com/json-iterator/go" +) + +const maxUint = ^uint(0) +const maxInt = int(maxUint >> 1) +const minInt = -maxInt - 1 + +var jsonParser jsoniter.API +var initJson = &sync.Once{} + +func initJsonParserOnce() { + initJson.Do(func() { + registerBetterFuzzyDecoder() + jsonParser = jsoniter.Config{ + EscapeHTML: true, + SortMapKeys: true, + ValidateJsonRawMessage: true, + CaseSensitive: true, + }.Froze() + }) +} + +func registerBetterFuzzyDecoder() { + jsoniter.RegisterTypeDecoder("string", &nullableFuzzyStringDecoder{}) + jsoniter.RegisterTypeDecoder("bool", &fuzzyBoolDecoder{}) + jsoniter.RegisterTypeDecoder("float32", &nullableFuzzyFloat32Decoder{}) + jsoniter.RegisterTypeDecoder("float64", &nullableFuzzyFloat64Decoder{}) + jsoniter.RegisterTypeDecoder("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() + } + }}) + jsoniter.RegisterTypeDecoder("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() + } + }}) + jsoniter.RegisterTypeDecoder("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() + } + }}) + jsoniter.RegisterTypeDecoder("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() + } + }}) + jsoniter.RegisterTypeDecoder("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() + } + }}) + jsoniter.RegisterTypeDecoder("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() + } + }}) + jsoniter.RegisterTypeDecoder("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() + } + }}) + jsoniter.RegisterTypeDecoder("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() + } + }}) + jsoniter.RegisterTypeDecoder("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() + } + }}) + jsoniter.RegisterTypeDecoder("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 000000000..dd6ae5b4c --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses/response.go @@ -0,0 +1,152 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/utils" +) + +type AcsResponse interface { + IsSuccess() bool + GetHttpStatus() int + GetHttpHeaders() map[string][]string + GetHttpContentString() string + GetHttpContentBytes() []byte + GetOriginHttpResponse() *http.Response + parseFromHttpResponse(httpResponse *http.Response) error +} + +var debug utils.Debug + +func init() { + debug = utils.Init("sdk") +} +// 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" { + initJsonParserOnce() + 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 + } + debug("%s", string(body)) + 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/debug.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/utils/debug.go new file mode 100644 index 000000000..09440d27b --- /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 000000000..378e50106 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/utils/utils.go @@ -0,0 +1,87 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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" + "encoding/base64" + "encoding/hex" + "net/url" + "reflect" + "strconv" + "time" + + "github.com/satori/go.uuid" +) + +func GetUUIDV4() (uuidHex string) { + uuidV4 := uuid.NewV4() + uuidHex = hex.EncodeToString(uuidV4.Bytes()) + return +} + +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) + } + } +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/activate_router_interface.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/activate_router_interface.go new file mode 100644 index 000000000..9d1c97319 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/activate_router_interface.go @@ -0,0 +1,106 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// ActivateRouterInterface invokes the vpc.ActivateRouterInterface API synchronously +// api document: https://help.aliyun.com/api/vpc/activaterouterinterface.html +func (client *Client) ActivateRouterInterface(request *ActivateRouterInterfaceRequest) (response *ActivateRouterInterfaceResponse, err error) { + response = CreateActivateRouterInterfaceResponse() + err = client.DoAction(request, response) + return +} + +// ActivateRouterInterfaceWithChan invokes the vpc.ActivateRouterInterface API asynchronously +// api document: https://help.aliyun.com/api/vpc/activaterouterinterface.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ActivateRouterInterfaceWithChan(request *ActivateRouterInterfaceRequest) (<-chan *ActivateRouterInterfaceResponse, <-chan error) { + responseChan := make(chan *ActivateRouterInterfaceResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.ActivateRouterInterface(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// ActivateRouterInterfaceWithCallback invokes the vpc.ActivateRouterInterface API asynchronously +// api document: https://help.aliyun.com/api/vpc/activaterouterinterface.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ActivateRouterInterfaceWithCallback(request *ActivateRouterInterfaceRequest, callback func(response *ActivateRouterInterfaceResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *ActivateRouterInterfaceResponse + var err error + defer close(result) + response, err = client.ActivateRouterInterface(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// ActivateRouterInterfaceRequest is the request struct for api ActivateRouterInterface +type ActivateRouterInterfaceRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + RouterInterfaceId string `position:"Query" name:"RouterInterfaceId"` +} + +// ActivateRouterInterfaceResponse is the response struct for api ActivateRouterInterface +type ActivateRouterInterfaceResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateActivateRouterInterfaceRequest creates a request to invoke ActivateRouterInterface API +func CreateActivateRouterInterfaceRequest() (request *ActivateRouterInterfaceRequest) { + request = &ActivateRouterInterfaceRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "ActivateRouterInterface", "vpc", "openAPI") + return +} + +// CreateActivateRouterInterfaceResponse creates a response to parse from ActivateRouterInterface response +func CreateActivateRouterInterfaceResponse() (response *ActivateRouterInterfaceResponse) { + response = &ActivateRouterInterfaceResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/active_flow_log.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/active_flow_log.go new file mode 100644 index 000000000..f79ed3a18 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/active_flow_log.go @@ -0,0 +1,108 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// ActiveFlowLog invokes the vpc.ActiveFlowLog API synchronously +// api document: https://help.aliyun.com/api/vpc/activeflowlog.html +func (client *Client) ActiveFlowLog(request *ActiveFlowLogRequest) (response *ActiveFlowLogResponse, err error) { + response = CreateActiveFlowLogResponse() + err = client.DoAction(request, response) + return +} + +// ActiveFlowLogWithChan invokes the vpc.ActiveFlowLog API asynchronously +// api document: https://help.aliyun.com/api/vpc/activeflowlog.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ActiveFlowLogWithChan(request *ActiveFlowLogRequest) (<-chan *ActiveFlowLogResponse, <-chan error) { + responseChan := make(chan *ActiveFlowLogResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.ActiveFlowLog(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// ActiveFlowLogWithCallback invokes the vpc.ActiveFlowLog API asynchronously +// api document: https://help.aliyun.com/api/vpc/activeflowlog.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ActiveFlowLogWithCallback(request *ActiveFlowLogRequest, callback func(response *ActiveFlowLogResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *ActiveFlowLogResponse + var err error + defer close(result) + response, err = client.ActiveFlowLog(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// ActiveFlowLogRequest is the request struct for api ActiveFlowLog +type ActiveFlowLogRequest struct { + *requests.RpcRequest + 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"` + FlowLogId string `position:"Query" name:"FlowLogId"` +} + +// ActiveFlowLogResponse is the response struct for api ActiveFlowLog +type ActiveFlowLogResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + Success string `json:"Success" xml:"Success"` +} + +// CreateActiveFlowLogRequest creates a request to invoke ActiveFlowLog API +func CreateActiveFlowLogRequest() (request *ActiveFlowLogRequest) { + request = &ActiveFlowLogRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "ActiveFlowLog", "vpc", "openAPI") + return +} + +// CreateActiveFlowLogResponse creates a response to parse from ActiveFlowLog response +func CreateActiveFlowLogResponse() (response *ActiveFlowLogResponse) { + response = &ActiveFlowLogResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/add_bandwidth_package_ips.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/add_bandwidth_package_ips.go new file mode 100644 index 000000000..1aa7e0b3a --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/add_bandwidth_package_ips.go @@ -0,0 +1,109 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// AddBandwidthPackageIps invokes the vpc.AddBandwidthPackageIps API synchronously +// api document: https://help.aliyun.com/api/vpc/addbandwidthpackageips.html +func (client *Client) AddBandwidthPackageIps(request *AddBandwidthPackageIpsRequest) (response *AddBandwidthPackageIpsResponse, err error) { + response = CreateAddBandwidthPackageIpsResponse() + err = client.DoAction(request, response) + return +} + +// AddBandwidthPackageIpsWithChan invokes the vpc.AddBandwidthPackageIps API asynchronously +// api document: https://help.aliyun.com/api/vpc/addbandwidthpackageips.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) AddBandwidthPackageIpsWithChan(request *AddBandwidthPackageIpsRequest) (<-chan *AddBandwidthPackageIpsResponse, <-chan error) { + responseChan := make(chan *AddBandwidthPackageIpsResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.AddBandwidthPackageIps(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// AddBandwidthPackageIpsWithCallback invokes the vpc.AddBandwidthPackageIps API asynchronously +// api document: https://help.aliyun.com/api/vpc/addbandwidthpackageips.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) AddBandwidthPackageIpsWithCallback(request *AddBandwidthPackageIpsRequest, callback func(response *AddBandwidthPackageIpsResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *AddBandwidthPackageIpsResponse + var err error + defer close(result) + response, err = client.AddBandwidthPackageIps(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// AddBandwidthPackageIpsRequest is the request struct for api AddBandwidthPackageIps +type AddBandwidthPackageIpsRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + BandwidthPackageId string `position:"Query" name:"BandwidthPackageId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + ClientToken string `position:"Query" name:"ClientToken"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + IpCount string `position:"Query" name:"IpCount"` +} + +// AddBandwidthPackageIpsResponse is the response struct for api AddBandwidthPackageIps +type AddBandwidthPackageIpsResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateAddBandwidthPackageIpsRequest creates a request to invoke AddBandwidthPackageIps API +func CreateAddBandwidthPackageIpsRequest() (request *AddBandwidthPackageIpsRequest) { + request = &AddBandwidthPackageIpsRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "AddBandwidthPackageIps", "vpc", "openAPI") + return +} + +// CreateAddBandwidthPackageIpsResponse creates a response to parse from AddBandwidthPackageIps response +func CreateAddBandwidthPackageIpsResponse() (response *AddBandwidthPackageIpsResponse) { + response = &AddBandwidthPackageIpsResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/add_bgp_network.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/add_bgp_network.go new file mode 100644 index 000000000..a0696f993 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/add_bgp_network.go @@ -0,0 +1,110 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// AddBgpNetwork invokes the vpc.AddBgpNetwork API synchronously +// api document: https://help.aliyun.com/api/vpc/addbgpnetwork.html +func (client *Client) AddBgpNetwork(request *AddBgpNetworkRequest) (response *AddBgpNetworkResponse, err error) { + response = CreateAddBgpNetworkResponse() + err = client.DoAction(request, response) + return +} + +// AddBgpNetworkWithChan invokes the vpc.AddBgpNetwork API asynchronously +// api document: https://help.aliyun.com/api/vpc/addbgpnetwork.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) AddBgpNetworkWithChan(request *AddBgpNetworkRequest) (<-chan *AddBgpNetworkResponse, <-chan error) { + responseChan := make(chan *AddBgpNetworkResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.AddBgpNetwork(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// AddBgpNetworkWithCallback invokes the vpc.AddBgpNetwork API asynchronously +// api document: https://help.aliyun.com/api/vpc/addbgpnetwork.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) AddBgpNetworkWithCallback(request *AddBgpNetworkRequest, callback func(response *AddBgpNetworkResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *AddBgpNetworkResponse + var err error + defer close(result) + response, err = client.AddBgpNetwork(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// AddBgpNetworkRequest is the request struct for api AddBgpNetwork +type AddBgpNetworkRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + ClientToken string `position:"Query" name:"ClientToken"` + RouterId string `position:"Query" name:"RouterId"` + VpcId string `position:"Query" name:"VpcId"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + DstCidrBlock string `position:"Query" name:"DstCidrBlock"` +} + +// AddBgpNetworkResponse is the response struct for api AddBgpNetwork +type AddBgpNetworkResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateAddBgpNetworkRequest creates a request to invoke AddBgpNetwork API +func CreateAddBgpNetworkRequest() (request *AddBgpNetworkRequest) { + request = &AddBgpNetworkRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "AddBgpNetwork", "vpc", "openAPI") + return +} + +// CreateAddBgpNetworkResponse creates a response to parse from AddBgpNetwork response +func CreateAddBgpNetworkResponse() (response *AddBgpNetworkResponse) { + response = &AddBgpNetworkResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/add_common_bandwidth_package_ip.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/add_common_bandwidth_package_ip.go new file mode 100644 index 000000000..08d1d852c --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/add_common_bandwidth_package_ip.go @@ -0,0 +1,108 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// AddCommonBandwidthPackageIp invokes the vpc.AddCommonBandwidthPackageIp API synchronously +// api document: https://help.aliyun.com/api/vpc/addcommonbandwidthpackageip.html +func (client *Client) AddCommonBandwidthPackageIp(request *AddCommonBandwidthPackageIpRequest) (response *AddCommonBandwidthPackageIpResponse, err error) { + response = CreateAddCommonBandwidthPackageIpResponse() + err = client.DoAction(request, response) + return +} + +// AddCommonBandwidthPackageIpWithChan invokes the vpc.AddCommonBandwidthPackageIp API asynchronously +// api document: https://help.aliyun.com/api/vpc/addcommonbandwidthpackageip.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) AddCommonBandwidthPackageIpWithChan(request *AddCommonBandwidthPackageIpRequest) (<-chan *AddCommonBandwidthPackageIpResponse, <-chan error) { + responseChan := make(chan *AddCommonBandwidthPackageIpResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.AddCommonBandwidthPackageIp(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// AddCommonBandwidthPackageIpWithCallback invokes the vpc.AddCommonBandwidthPackageIp API asynchronously +// api document: https://help.aliyun.com/api/vpc/addcommonbandwidthpackageip.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) AddCommonBandwidthPackageIpWithCallback(request *AddCommonBandwidthPackageIpRequest, callback func(response *AddCommonBandwidthPackageIpResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *AddCommonBandwidthPackageIpResponse + var err error + defer close(result) + response, err = client.AddCommonBandwidthPackageIp(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// AddCommonBandwidthPackageIpRequest is the request struct for api AddCommonBandwidthPackageIp +type AddCommonBandwidthPackageIpRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + BandwidthPackageId string `position:"Query" name:"BandwidthPackageId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + IpInstanceId string `position:"Query" name:"IpInstanceId"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// AddCommonBandwidthPackageIpResponse is the response struct for api AddCommonBandwidthPackageIp +type AddCommonBandwidthPackageIpResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateAddCommonBandwidthPackageIpRequest creates a request to invoke AddCommonBandwidthPackageIp API +func CreateAddCommonBandwidthPackageIpRequest() (request *AddCommonBandwidthPackageIpRequest) { + request = &AddCommonBandwidthPackageIpRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "AddCommonBandwidthPackageIp", "vpc", "openAPI") + return +} + +// CreateAddCommonBandwidthPackageIpResponse creates a response to parse from AddCommonBandwidthPackageIp response +func CreateAddCommonBandwidthPackageIpResponse() (response *AddCommonBandwidthPackageIpResponse) { + response = &AddCommonBandwidthPackageIpResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/add_global_acceleration_instance_ip.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/add_global_acceleration_instance_ip.go new file mode 100644 index 000000000..7837a5954 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/add_global_acceleration_instance_ip.go @@ -0,0 +1,108 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// AddGlobalAccelerationInstanceIp invokes the vpc.AddGlobalAccelerationInstanceIp API synchronously +// api document: https://help.aliyun.com/api/vpc/addglobalaccelerationinstanceip.html +func (client *Client) AddGlobalAccelerationInstanceIp(request *AddGlobalAccelerationInstanceIpRequest) (response *AddGlobalAccelerationInstanceIpResponse, err error) { + response = CreateAddGlobalAccelerationInstanceIpResponse() + err = client.DoAction(request, response) + return +} + +// AddGlobalAccelerationInstanceIpWithChan invokes the vpc.AddGlobalAccelerationInstanceIp API asynchronously +// api document: https://help.aliyun.com/api/vpc/addglobalaccelerationinstanceip.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) AddGlobalAccelerationInstanceIpWithChan(request *AddGlobalAccelerationInstanceIpRequest) (<-chan *AddGlobalAccelerationInstanceIpResponse, <-chan error) { + responseChan := make(chan *AddGlobalAccelerationInstanceIpResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.AddGlobalAccelerationInstanceIp(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// AddGlobalAccelerationInstanceIpWithCallback invokes the vpc.AddGlobalAccelerationInstanceIp API asynchronously +// api document: https://help.aliyun.com/api/vpc/addglobalaccelerationinstanceip.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) AddGlobalAccelerationInstanceIpWithCallback(request *AddGlobalAccelerationInstanceIpRequest, callback func(response *AddGlobalAccelerationInstanceIpResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *AddGlobalAccelerationInstanceIpResponse + var err error + defer close(result) + response, err = client.AddGlobalAccelerationInstanceIp(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// AddGlobalAccelerationInstanceIpRequest is the request struct for api AddGlobalAccelerationInstanceIp +type AddGlobalAccelerationInstanceIpRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + IpInstanceId string `position:"Query" name:"IpInstanceId"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + GlobalAccelerationInstanceId string `position:"Query" name:"GlobalAccelerationInstanceId"` +} + +// AddGlobalAccelerationInstanceIpResponse is the response struct for api AddGlobalAccelerationInstanceIp +type AddGlobalAccelerationInstanceIpResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateAddGlobalAccelerationInstanceIpRequest creates a request to invoke AddGlobalAccelerationInstanceIp API +func CreateAddGlobalAccelerationInstanceIpRequest() (request *AddGlobalAccelerationInstanceIpRequest) { + request = &AddGlobalAccelerationInstanceIpRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "AddGlobalAccelerationInstanceIp", "vpc", "openAPI") + return +} + +// CreateAddGlobalAccelerationInstanceIpResponse creates a response to parse from AddGlobalAccelerationInstanceIp response +func CreateAddGlobalAccelerationInstanceIpResponse() (response *AddGlobalAccelerationInstanceIpResponse) { + response = &AddGlobalAccelerationInstanceIpResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/add_i_pv6_translator_acl_list_entry.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/add_i_pv6_translator_acl_list_entry.go new file mode 100644 index 000000000..1c81a0430 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/add_i_pv6_translator_acl_list_entry.go @@ -0,0 +1,110 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// AddIPv6TranslatorAclListEntry invokes the vpc.AddIPv6TranslatorAclListEntry API synchronously +// api document: https://help.aliyun.com/api/vpc/addipv6translatoracllistentry.html +func (client *Client) AddIPv6TranslatorAclListEntry(request *AddIPv6TranslatorAclListEntryRequest) (response *AddIPv6TranslatorAclListEntryResponse, err error) { + response = CreateAddIPv6TranslatorAclListEntryResponse() + err = client.DoAction(request, response) + return +} + +// AddIPv6TranslatorAclListEntryWithChan invokes the vpc.AddIPv6TranslatorAclListEntry API asynchronously +// api document: https://help.aliyun.com/api/vpc/addipv6translatoracllistentry.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) AddIPv6TranslatorAclListEntryWithChan(request *AddIPv6TranslatorAclListEntryRequest) (<-chan *AddIPv6TranslatorAclListEntryResponse, <-chan error) { + responseChan := make(chan *AddIPv6TranslatorAclListEntryResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.AddIPv6TranslatorAclListEntry(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// AddIPv6TranslatorAclListEntryWithCallback invokes the vpc.AddIPv6TranslatorAclListEntry API asynchronously +// api document: https://help.aliyun.com/api/vpc/addipv6translatoracllistentry.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) AddIPv6TranslatorAclListEntryWithCallback(request *AddIPv6TranslatorAclListEntryRequest, callback func(response *AddIPv6TranslatorAclListEntryResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *AddIPv6TranslatorAclListEntryResponse + var err error + defer close(result) + response, err = client.AddIPv6TranslatorAclListEntry(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// AddIPv6TranslatorAclListEntryRequest is the request struct for api AddIPv6TranslatorAclListEntry +type AddIPv6TranslatorAclListEntryRequest struct { + *requests.RpcRequest + AclId string `position:"Query" name:"AclId"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + AclEntryIp string `position:"Query" name:"AclEntryIp"` + 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"` +} + +// AddIPv6TranslatorAclListEntryResponse is the response struct for api AddIPv6TranslatorAclListEntry +type AddIPv6TranslatorAclListEntryResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + AclEntryId string `json:"AclEntryId" xml:"AclEntryId"` +} + +// CreateAddIPv6TranslatorAclListEntryRequest creates a request to invoke AddIPv6TranslatorAclListEntry API +func CreateAddIPv6TranslatorAclListEntryRequest() (request *AddIPv6TranslatorAclListEntryRequest) { + request = &AddIPv6TranslatorAclListEntryRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "AddIPv6TranslatorAclListEntry", "vpc", "openAPI") + return +} + +// CreateAddIPv6TranslatorAclListEntryResponse creates a response to parse from AddIPv6TranslatorAclListEntry response +func CreateAddIPv6TranslatorAclListEntryResponse() (response *AddIPv6TranslatorAclListEntryResponse) { + response = &AddIPv6TranslatorAclListEntryResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/allocate_eip_address.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/allocate_eip_address.go new file mode 100644 index 000000000..9eb9c1b74 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/allocate_eip_address.go @@ -0,0 +1,120 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// AllocateEipAddress invokes the vpc.AllocateEipAddress API synchronously +// api document: https://help.aliyun.com/api/vpc/allocateeipaddress.html +func (client *Client) AllocateEipAddress(request *AllocateEipAddressRequest) (response *AllocateEipAddressResponse, err error) { + response = CreateAllocateEipAddressResponse() + err = client.DoAction(request, response) + return +} + +// AllocateEipAddressWithChan invokes the vpc.AllocateEipAddress API asynchronously +// api document: https://help.aliyun.com/api/vpc/allocateeipaddress.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) AllocateEipAddressWithChan(request *AllocateEipAddressRequest) (<-chan *AllocateEipAddressResponse, <-chan error) { + responseChan := make(chan *AllocateEipAddressResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.AllocateEipAddress(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// AllocateEipAddressWithCallback invokes the vpc.AllocateEipAddress API asynchronously +// api document: https://help.aliyun.com/api/vpc/allocateeipaddress.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) AllocateEipAddressWithCallback(request *AllocateEipAddressRequest, callback func(response *AllocateEipAddressResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *AllocateEipAddressResponse + var err error + defer close(result) + response, err = client.AllocateEipAddress(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// AllocateEipAddressRequest is the request struct for api AllocateEipAddress +type AllocateEipAddressRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + Period requests.Integer `position:"Query" name:"Period"` + AutoPay requests.Boolean `position:"Query" name:"AutoPay"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + Bandwidth string `position:"Query" name:"Bandwidth"` + ClientToken string `position:"Query" name:"ClientToken"` + ISP string `position:"Query" name:"ISP"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + ResourceGroupId string `position:"Query" name:"ResourceGroupId"` + InternetChargeType string `position:"Query" name:"InternetChargeType"` + Netmode string `position:"Query" name:"Netmode"` + PricingCycle string `position:"Query" name:"PricingCycle"` + InstanceChargeType string `position:"Query" name:"InstanceChargeType"` +} + +// AllocateEipAddressResponse is the response struct for api AllocateEipAddress +type AllocateEipAddressResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + AllocationId string `json:"AllocationId" xml:"AllocationId"` + EipAddress string `json:"EipAddress" xml:"EipAddress"` + OrderId int `json:"OrderId" xml:"OrderId"` + ResourceGroupId string `json:"ResourceGroupId" xml:"ResourceGroupId"` +} + +// CreateAllocateEipAddressRequest creates a request to invoke AllocateEipAddress API +func CreateAllocateEipAddressRequest() (request *AllocateEipAddressRequest) { + request = &AllocateEipAddressRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "AllocateEipAddress", "vpc", "openAPI") + return +} + +// CreateAllocateEipAddressResponse creates a response to parse from AllocateEipAddress response +func CreateAllocateEipAddressResponse() (response *AllocateEipAddressResponse) { + response = &AllocateEipAddressResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/allocate_ipv6_internet_bandwidth.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/allocate_ipv6_internet_bandwidth.go new file mode 100644 index 000000000..c00cc966c --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/allocate_ipv6_internet_bandwidth.go @@ -0,0 +1,113 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// AllocateIpv6InternetBandwidth invokes the vpc.AllocateIpv6InternetBandwidth API synchronously +// api document: https://help.aliyun.com/api/vpc/allocateipv6internetbandwidth.html +func (client *Client) AllocateIpv6InternetBandwidth(request *AllocateIpv6InternetBandwidthRequest) (response *AllocateIpv6InternetBandwidthResponse, err error) { + response = CreateAllocateIpv6InternetBandwidthResponse() + err = client.DoAction(request, response) + return +} + +// AllocateIpv6InternetBandwidthWithChan invokes the vpc.AllocateIpv6InternetBandwidth API asynchronously +// api document: https://help.aliyun.com/api/vpc/allocateipv6internetbandwidth.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) AllocateIpv6InternetBandwidthWithChan(request *AllocateIpv6InternetBandwidthRequest) (<-chan *AllocateIpv6InternetBandwidthResponse, <-chan error) { + responseChan := make(chan *AllocateIpv6InternetBandwidthResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.AllocateIpv6InternetBandwidth(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// AllocateIpv6InternetBandwidthWithCallback invokes the vpc.AllocateIpv6InternetBandwidth API asynchronously +// api document: https://help.aliyun.com/api/vpc/allocateipv6internetbandwidth.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) AllocateIpv6InternetBandwidthWithCallback(request *AllocateIpv6InternetBandwidthRequest, callback func(response *AllocateIpv6InternetBandwidthResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *AllocateIpv6InternetBandwidthResponse + var err error + defer close(result) + response, err = client.AllocateIpv6InternetBandwidth(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// AllocateIpv6InternetBandwidthRequest is the request struct for api AllocateIpv6InternetBandwidth +type AllocateIpv6InternetBandwidthRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ClientToken string `position:"Query" name:"ClientToken"` + Bandwidth requests.Integer `position:"Query" name:"Bandwidth"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + Ipv6AddressId string `position:"Query" name:"Ipv6AddressId"` + InternetChargeType string `position:"Query" name:"InternetChargeType"` + Ipv6GatewayId string `position:"Query" name:"Ipv6GatewayId"` +} + +// AllocateIpv6InternetBandwidthResponse is the response struct for api AllocateIpv6InternetBandwidth +type AllocateIpv6InternetBandwidthResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + Ipv6AddressId string `json:"Ipv6AddressId" xml:"Ipv6AddressId"` + InternetBandwidthId string `json:"InternetBandwidthId" xml:"InternetBandwidthId"` +} + +// CreateAllocateIpv6InternetBandwidthRequest creates a request to invoke AllocateIpv6InternetBandwidth API +func CreateAllocateIpv6InternetBandwidthRequest() (request *AllocateIpv6InternetBandwidthRequest) { + request = &AllocateIpv6InternetBandwidthRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "AllocateIpv6InternetBandwidth", "vpc", "openAPI") + return +} + +// CreateAllocateIpv6InternetBandwidthResponse creates a response to parse from AllocateIpv6InternetBandwidth response +func CreateAllocateIpv6InternetBandwidthResponse() (response *AllocateIpv6InternetBandwidthResponse) { + response = &AllocateIpv6InternetBandwidthResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/associate_eip_address.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/associate_eip_address.go new file mode 100644 index 000000000..98005efc1 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/associate_eip_address.go @@ -0,0 +1,111 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// AssociateEipAddress invokes the vpc.AssociateEipAddress API synchronously +// api document: https://help.aliyun.com/api/vpc/associateeipaddress.html +func (client *Client) AssociateEipAddress(request *AssociateEipAddressRequest) (response *AssociateEipAddressResponse, err error) { + response = CreateAssociateEipAddressResponse() + err = client.DoAction(request, response) + return +} + +// AssociateEipAddressWithChan invokes the vpc.AssociateEipAddress API asynchronously +// api document: https://help.aliyun.com/api/vpc/associateeipaddress.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) AssociateEipAddressWithChan(request *AssociateEipAddressRequest) (<-chan *AssociateEipAddressResponse, <-chan error) { + responseChan := make(chan *AssociateEipAddressResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.AssociateEipAddress(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// AssociateEipAddressWithCallback invokes the vpc.AssociateEipAddress API asynchronously +// api document: https://help.aliyun.com/api/vpc/associateeipaddress.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) AssociateEipAddressWithCallback(request *AssociateEipAddressRequest, callback func(response *AssociateEipAddressResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *AssociateEipAddressResponse + var err error + defer close(result) + response, err = client.AssociateEipAddress(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// AssociateEipAddressRequest is the request struct for api AssociateEipAddress +type AssociateEipAddressRequest struct { + *requests.RpcRequest + PrivateIpAddress string `position:"Query" name:"PrivateIpAddress"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + InstanceId string `position:"Query" name:"InstanceId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + InstanceRegionId string `position:"Query" name:"InstanceRegionId"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + InstanceType string `position:"Query" name:"InstanceType"` + AllocationId string `position:"Query" name:"AllocationId"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// AssociateEipAddressResponse is the response struct for api AssociateEipAddress +type AssociateEipAddressResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateAssociateEipAddressRequest creates a request to invoke AssociateEipAddress API +func CreateAssociateEipAddressRequest() (request *AssociateEipAddressRequest) { + request = &AssociateEipAddressRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "AssociateEipAddress", "vpc", "openAPI") + return +} + +// CreateAssociateEipAddressResponse creates a response to parse from AssociateEipAddress response +func CreateAssociateEipAddressResponse() (response *AssociateEipAddressResponse) { + response = &AssociateEipAddressResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/associate_global_acceleration_instance.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/associate_global_acceleration_instance.go new file mode 100644 index 000000000..5303be3ea --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/associate_global_acceleration_instance.go @@ -0,0 +1,110 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// AssociateGlobalAccelerationInstance invokes the vpc.AssociateGlobalAccelerationInstance API synchronously +// api document: https://help.aliyun.com/api/vpc/associateglobalaccelerationinstance.html +func (client *Client) AssociateGlobalAccelerationInstance(request *AssociateGlobalAccelerationInstanceRequest) (response *AssociateGlobalAccelerationInstanceResponse, err error) { + response = CreateAssociateGlobalAccelerationInstanceResponse() + err = client.DoAction(request, response) + return +} + +// AssociateGlobalAccelerationInstanceWithChan invokes the vpc.AssociateGlobalAccelerationInstance API asynchronously +// api document: https://help.aliyun.com/api/vpc/associateglobalaccelerationinstance.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) AssociateGlobalAccelerationInstanceWithChan(request *AssociateGlobalAccelerationInstanceRequest) (<-chan *AssociateGlobalAccelerationInstanceResponse, <-chan error) { + responseChan := make(chan *AssociateGlobalAccelerationInstanceResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.AssociateGlobalAccelerationInstance(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// AssociateGlobalAccelerationInstanceWithCallback invokes the vpc.AssociateGlobalAccelerationInstance API asynchronously +// api document: https://help.aliyun.com/api/vpc/associateglobalaccelerationinstance.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) AssociateGlobalAccelerationInstanceWithCallback(request *AssociateGlobalAccelerationInstanceRequest, callback func(response *AssociateGlobalAccelerationInstanceResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *AssociateGlobalAccelerationInstanceResponse + var err error + defer close(result) + response, err = client.AssociateGlobalAccelerationInstance(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// AssociateGlobalAccelerationInstanceRequest is the request struct for api AssociateGlobalAccelerationInstance +type AssociateGlobalAccelerationInstanceRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + BackendServerId string `position:"Query" name:"BackendServerId"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + GlobalAccelerationInstanceId string `position:"Query" name:"GlobalAccelerationInstanceId"` + BackendServerRegionId string `position:"Query" name:"BackendServerRegionId"` + BackendServerType string `position:"Query" name:"BackendServerType"` +} + +// AssociateGlobalAccelerationInstanceResponse is the response struct for api AssociateGlobalAccelerationInstance +type AssociateGlobalAccelerationInstanceResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateAssociateGlobalAccelerationInstanceRequest creates a request to invoke AssociateGlobalAccelerationInstance API +func CreateAssociateGlobalAccelerationInstanceRequest() (request *AssociateGlobalAccelerationInstanceRequest) { + request = &AssociateGlobalAccelerationInstanceRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "AssociateGlobalAccelerationInstance", "vpc", "openAPI") + return +} + +// CreateAssociateGlobalAccelerationInstanceResponse creates a response to parse from AssociateGlobalAccelerationInstance response +func CreateAssociateGlobalAccelerationInstanceResponse() (response *AssociateGlobalAccelerationInstanceResponse) { + response = &AssociateGlobalAccelerationInstanceResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/associate_ha_vip.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/associate_ha_vip.go new file mode 100644 index 000000000..96a32391f --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/associate_ha_vip.go @@ -0,0 +1,109 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// AssociateHaVip invokes the vpc.AssociateHaVip API synchronously +// api document: https://help.aliyun.com/api/vpc/associatehavip.html +func (client *Client) AssociateHaVip(request *AssociateHaVipRequest) (response *AssociateHaVipResponse, err error) { + response = CreateAssociateHaVipResponse() + err = client.DoAction(request, response) + return +} + +// AssociateHaVipWithChan invokes the vpc.AssociateHaVip API asynchronously +// api document: https://help.aliyun.com/api/vpc/associatehavip.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) AssociateHaVipWithChan(request *AssociateHaVipRequest) (<-chan *AssociateHaVipResponse, <-chan error) { + responseChan := make(chan *AssociateHaVipResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.AssociateHaVip(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// AssociateHaVipWithCallback invokes the vpc.AssociateHaVip API asynchronously +// api document: https://help.aliyun.com/api/vpc/associatehavip.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) AssociateHaVipWithCallback(request *AssociateHaVipRequest, callback func(response *AssociateHaVipResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *AssociateHaVipResponse + var err error + defer close(result) + response, err = client.AssociateHaVip(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// AssociateHaVipRequest is the request struct for api AssociateHaVip +type AssociateHaVipRequest struct { + *requests.RpcRequest + HaVipId string `position:"Query" name:"HaVipId"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + InstanceId string `position:"Query" name:"InstanceId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + ClientToken string `position:"Query" name:"ClientToken"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// AssociateHaVipResponse is the response struct for api AssociateHaVip +type AssociateHaVipResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateAssociateHaVipRequest creates a request to invoke AssociateHaVip API +func CreateAssociateHaVipRequest() (request *AssociateHaVipRequest) { + request = &AssociateHaVipRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "AssociateHaVip", "vpc", "openAPI") + return +} + +// CreateAssociateHaVipResponse creates a response to parse from AssociateHaVip response +func CreateAssociateHaVipResponse() (response *AssociateHaVipResponse) { + response = &AssociateHaVipResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/associate_physical_connection_to_virtual_border_router.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/associate_physical_connection_to_virtual_border_router.go new file mode 100644 index 000000000..2eeec6a20 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/associate_physical_connection_to_virtual_border_router.go @@ -0,0 +1,114 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// AssociatePhysicalConnectionToVirtualBorderRouter invokes the vpc.AssociatePhysicalConnectionToVirtualBorderRouter API synchronously +// api document: https://help.aliyun.com/api/vpc/associatephysicalconnectiontovirtualborderrouter.html +func (client *Client) AssociatePhysicalConnectionToVirtualBorderRouter(request *AssociatePhysicalConnectionToVirtualBorderRouterRequest) (response *AssociatePhysicalConnectionToVirtualBorderRouterResponse, err error) { + response = CreateAssociatePhysicalConnectionToVirtualBorderRouterResponse() + err = client.DoAction(request, response) + return +} + +// AssociatePhysicalConnectionToVirtualBorderRouterWithChan invokes the vpc.AssociatePhysicalConnectionToVirtualBorderRouter API asynchronously +// api document: https://help.aliyun.com/api/vpc/associatephysicalconnectiontovirtualborderrouter.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) AssociatePhysicalConnectionToVirtualBorderRouterWithChan(request *AssociatePhysicalConnectionToVirtualBorderRouterRequest) (<-chan *AssociatePhysicalConnectionToVirtualBorderRouterResponse, <-chan error) { + responseChan := make(chan *AssociatePhysicalConnectionToVirtualBorderRouterResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.AssociatePhysicalConnectionToVirtualBorderRouter(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// AssociatePhysicalConnectionToVirtualBorderRouterWithCallback invokes the vpc.AssociatePhysicalConnectionToVirtualBorderRouter API asynchronously +// api document: https://help.aliyun.com/api/vpc/associatephysicalconnectiontovirtualborderrouter.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) AssociatePhysicalConnectionToVirtualBorderRouterWithCallback(request *AssociatePhysicalConnectionToVirtualBorderRouterRequest, callback func(response *AssociatePhysicalConnectionToVirtualBorderRouterResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *AssociatePhysicalConnectionToVirtualBorderRouterResponse + var err error + defer close(result) + response, err = client.AssociatePhysicalConnectionToVirtualBorderRouter(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// AssociatePhysicalConnectionToVirtualBorderRouterRequest is the request struct for api AssociatePhysicalConnectionToVirtualBorderRouter +type AssociatePhysicalConnectionToVirtualBorderRouterRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + CircuitCode string `position:"Query" name:"CircuitCode"` + VlanId string `position:"Query" name:"VlanId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + ClientToken string `position:"Query" name:"ClientToken"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + VbrId string `position:"Query" name:"VbrId"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + PeerGatewayIp string `position:"Query" name:"PeerGatewayIp"` + PeeringSubnetMask string `position:"Query" name:"PeeringSubnetMask"` + PhysicalConnectionId string `position:"Query" name:"PhysicalConnectionId"` + LocalGatewayIp string `position:"Query" name:"LocalGatewayIp"` +} + +// AssociatePhysicalConnectionToVirtualBorderRouterResponse is the response struct for api AssociatePhysicalConnectionToVirtualBorderRouter +type AssociatePhysicalConnectionToVirtualBorderRouterResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateAssociatePhysicalConnectionToVirtualBorderRouterRequest creates a request to invoke AssociatePhysicalConnectionToVirtualBorderRouter API +func CreateAssociatePhysicalConnectionToVirtualBorderRouterRequest() (request *AssociatePhysicalConnectionToVirtualBorderRouterRequest) { + request = &AssociatePhysicalConnectionToVirtualBorderRouterRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "AssociatePhysicalConnectionToVirtualBorderRouter", "vpc", "openAPI") + return +} + +// CreateAssociatePhysicalConnectionToVirtualBorderRouterResponse creates a response to parse from AssociatePhysicalConnectionToVirtualBorderRouter response +func CreateAssociatePhysicalConnectionToVirtualBorderRouterResponse() (response *AssociatePhysicalConnectionToVirtualBorderRouterResponse) { + response = &AssociatePhysicalConnectionToVirtualBorderRouterResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/associate_route_table.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/associate_route_table.go new file mode 100644 index 000000000..c0811bfb9 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/associate_route_table.go @@ -0,0 +1,109 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// AssociateRouteTable invokes the vpc.AssociateRouteTable API synchronously +// api document: https://help.aliyun.com/api/vpc/associateroutetable.html +func (client *Client) AssociateRouteTable(request *AssociateRouteTableRequest) (response *AssociateRouteTableResponse, err error) { + response = CreateAssociateRouteTableResponse() + err = client.DoAction(request, response) + return +} + +// AssociateRouteTableWithChan invokes the vpc.AssociateRouteTable API asynchronously +// api document: https://help.aliyun.com/api/vpc/associateroutetable.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) AssociateRouteTableWithChan(request *AssociateRouteTableRequest) (<-chan *AssociateRouteTableResponse, <-chan error) { + responseChan := make(chan *AssociateRouteTableResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.AssociateRouteTable(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// AssociateRouteTableWithCallback invokes the vpc.AssociateRouteTable API asynchronously +// api document: https://help.aliyun.com/api/vpc/associateroutetable.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) AssociateRouteTableWithCallback(request *AssociateRouteTableRequest, callback func(response *AssociateRouteTableResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *AssociateRouteTableResponse + var err error + defer close(result) + response, err = client.AssociateRouteTable(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// AssociateRouteTableRequest is the request struct for api AssociateRouteTable +type AssociateRouteTableRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ClientToken string `position:"Query" name:"ClientToken"` + RouteTableId string `position:"Query" name:"RouteTableId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + VSwitchId string `position:"Query" name:"VSwitchId"` +} + +// AssociateRouteTableResponse is the response struct for api AssociateRouteTable +type AssociateRouteTableResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateAssociateRouteTableRequest creates a request to invoke AssociateRouteTable API +func CreateAssociateRouteTableRequest() (request *AssociateRouteTableRequest) { + request = &AssociateRouteTableRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "AssociateRouteTable", "vpc", "openAPI") + return +} + +// CreateAssociateRouteTableResponse creates a response to parse from AssociateRouteTable response +func CreateAssociateRouteTableResponse() (response *AssociateRouteTableResponse) { + response = &AssociateRouteTableResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/cancel_physical_connection.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/cancel_physical_connection.go new file mode 100644 index 000000000..9483aa058 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/cancel_physical_connection.go @@ -0,0 +1,108 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// CancelPhysicalConnection invokes the vpc.CancelPhysicalConnection API synchronously +// api document: https://help.aliyun.com/api/vpc/cancelphysicalconnection.html +func (client *Client) CancelPhysicalConnection(request *CancelPhysicalConnectionRequest) (response *CancelPhysicalConnectionResponse, err error) { + response = CreateCancelPhysicalConnectionResponse() + err = client.DoAction(request, response) + return +} + +// CancelPhysicalConnectionWithChan invokes the vpc.CancelPhysicalConnection API asynchronously +// api document: https://help.aliyun.com/api/vpc/cancelphysicalconnection.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) CancelPhysicalConnectionWithChan(request *CancelPhysicalConnectionRequest) (<-chan *CancelPhysicalConnectionResponse, <-chan error) { + responseChan := make(chan *CancelPhysicalConnectionResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.CancelPhysicalConnection(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// CancelPhysicalConnectionWithCallback invokes the vpc.CancelPhysicalConnection API asynchronously +// api document: https://help.aliyun.com/api/vpc/cancelphysicalconnection.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) CancelPhysicalConnectionWithCallback(request *CancelPhysicalConnectionRequest, callback func(response *CancelPhysicalConnectionResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *CancelPhysicalConnectionResponse + var err error + defer close(result) + response, err = client.CancelPhysicalConnection(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// CancelPhysicalConnectionRequest is the request struct for api CancelPhysicalConnection +type CancelPhysicalConnectionRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + ClientToken string `position:"Query" name:"ClientToken"` + PhysicalConnectionId string `position:"Query" name:"PhysicalConnectionId"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// CancelPhysicalConnectionResponse is the response struct for api CancelPhysicalConnection +type CancelPhysicalConnectionResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateCancelPhysicalConnectionRequest creates a request to invoke CancelPhysicalConnection API +func CreateCancelPhysicalConnectionRequest() (request *CancelPhysicalConnectionRequest) { + request = &CancelPhysicalConnectionRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "CancelPhysicalConnection", "vpc", "openAPI") + return +} + +// CreateCancelPhysicalConnectionResponse creates a response to parse from CancelPhysicalConnection response +func CreateCancelPhysicalConnectionResponse() (response *CancelPhysicalConnectionResponse) { + response = &CancelPhysicalConnectionResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/client.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/client.go new file mode 100644 index 000000000..706562409 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/client.go @@ -0,0 +1,81 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth" +) + +// Client is the sdk client struct, each func corresponds to an OpenAPI +type Client struct { + sdk.Client +} + +// NewClient creates a sdk client with environment variables +func NewClient() (client *Client, err error) { + client = &Client{} + err = client.Init() + return +} + +// NewClientWithOptions creates a sdk client with regionId/sdkConfig/credential +// this is the common api to create a sdk client +func NewClientWithOptions(regionId string, config *sdk.Config, credential auth.Credential) (client *Client, err error) { + client = &Client{} + err = client.InitWithOptions(regionId, config, credential) + return +} + +// NewClientWithAccessKey is a shortcut to create sdk client with accesskey +// usage: https://help.aliyun.com/document_detail/66217.html +func NewClientWithAccessKey(regionId, accessKeyId, accessKeySecret string) (client *Client, err error) { + client = &Client{} + err = client.InitWithAccessKey(regionId, accessKeyId, accessKeySecret) + return +} + +// NewClientWithStsToken is a shortcut to create sdk client with sts token +// usage: https://help.aliyun.com/document_detail/66222.html +func NewClientWithStsToken(regionId, stsAccessKeyId, stsAccessKeySecret, stsToken string) (client *Client, err error) { + client = &Client{} + err = client.InitWithStsToken(regionId, stsAccessKeyId, stsAccessKeySecret, stsToken) + return +} + +// NewClientWithRamRoleArn is a shortcut to create sdk client with ram roleArn +// usage: https://help.aliyun.com/document_detail/66222.html +func NewClientWithRamRoleArn(regionId string, accessKeyId, accessKeySecret, roleArn, roleSessionName string) (client *Client, err error) { + client = &Client{} + err = client.InitWithRamRoleArn(regionId, accessKeyId, accessKeySecret, roleArn, roleSessionName) + return +} + +// NewClientWithEcsRamRole is a shortcut to create sdk client with ecs ram role +// usage: https://help.aliyun.com/document_detail/66223.html +func NewClientWithEcsRamRole(regionId string, roleName string) (client *Client, err error) { + client = &Client{} + err = client.InitWithEcsRamRole(regionId, roleName) + return +} + +// NewClientWithRsaKeyPair is a shortcut to create sdk client with rsa key pair +// attention: rsa key pair auth is only Japan regions available +func NewClientWithRsaKeyPair(regionId string, publicKeyId, privateKey string, sessionExpiration int) (client *Client, err error) { + client = &Client{} + err = client.InitWithRsaKeyPair(regionId, publicKeyId, privateKey, sessionExpiration) + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/connect_router_interface.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/connect_router_interface.go new file mode 100644 index 000000000..5da50f0af --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/connect_router_interface.go @@ -0,0 +1,106 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// ConnectRouterInterface invokes the vpc.ConnectRouterInterface API synchronously +// api document: https://help.aliyun.com/api/vpc/connectrouterinterface.html +func (client *Client) ConnectRouterInterface(request *ConnectRouterInterfaceRequest) (response *ConnectRouterInterfaceResponse, err error) { + response = CreateConnectRouterInterfaceResponse() + err = client.DoAction(request, response) + return +} + +// ConnectRouterInterfaceWithChan invokes the vpc.ConnectRouterInterface API asynchronously +// api document: https://help.aliyun.com/api/vpc/connectrouterinterface.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ConnectRouterInterfaceWithChan(request *ConnectRouterInterfaceRequest) (<-chan *ConnectRouterInterfaceResponse, <-chan error) { + responseChan := make(chan *ConnectRouterInterfaceResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.ConnectRouterInterface(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// ConnectRouterInterfaceWithCallback invokes the vpc.ConnectRouterInterface API asynchronously +// api document: https://help.aliyun.com/api/vpc/connectrouterinterface.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ConnectRouterInterfaceWithCallback(request *ConnectRouterInterfaceRequest, callback func(response *ConnectRouterInterfaceResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *ConnectRouterInterfaceResponse + var err error + defer close(result) + response, err = client.ConnectRouterInterface(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// ConnectRouterInterfaceRequest is the request struct for api ConnectRouterInterface +type ConnectRouterInterfaceRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + RouterInterfaceId string `position:"Query" name:"RouterInterfaceId"` +} + +// ConnectRouterInterfaceResponse is the response struct for api ConnectRouterInterface +type ConnectRouterInterfaceResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateConnectRouterInterfaceRequest creates a request to invoke ConnectRouterInterface API +func CreateConnectRouterInterfaceRequest() (request *ConnectRouterInterfaceRequest) { + request = &ConnectRouterInterfaceRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "ConnectRouterInterface", "vpc", "openAPI") + return +} + +// CreateConnectRouterInterfaceResponse creates a response to parse from ConnectRouterInterface response +func CreateConnectRouterInterfaceResponse() (response *ConnectRouterInterfaceResponse) { + response = &ConnectRouterInterfaceResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/convert_bandwidth_package.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/convert_bandwidth_package.go new file mode 100644 index 000000000..bf9941f5e --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/convert_bandwidth_package.go @@ -0,0 +1,108 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// ConvertBandwidthPackage invokes the vpc.ConvertBandwidthPackage API synchronously +// api document: https://help.aliyun.com/api/vpc/convertbandwidthpackage.html +func (client *Client) ConvertBandwidthPackage(request *ConvertBandwidthPackageRequest) (response *ConvertBandwidthPackageResponse, err error) { + response = CreateConvertBandwidthPackageResponse() + err = client.DoAction(request, response) + return +} + +// ConvertBandwidthPackageWithChan invokes the vpc.ConvertBandwidthPackage API asynchronously +// api document: https://help.aliyun.com/api/vpc/convertbandwidthpackage.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ConvertBandwidthPackageWithChan(request *ConvertBandwidthPackageRequest) (<-chan *ConvertBandwidthPackageResponse, <-chan error) { + responseChan := make(chan *ConvertBandwidthPackageResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.ConvertBandwidthPackage(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// ConvertBandwidthPackageWithCallback invokes the vpc.ConvertBandwidthPackage API asynchronously +// api document: https://help.aliyun.com/api/vpc/convertbandwidthpackage.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ConvertBandwidthPackageWithCallback(request *ConvertBandwidthPackageRequest, callback func(response *ConvertBandwidthPackageResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *ConvertBandwidthPackageResponse + var err error + defer close(result) + response, err = client.ConvertBandwidthPackage(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// ConvertBandwidthPackageRequest is the request struct for api ConvertBandwidthPackage +type ConvertBandwidthPackageRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ClientToken string `position:"Query" name:"ClientToken"` + BandwidthPackageId string `position:"Query" name:"BandwidthPackageId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// ConvertBandwidthPackageResponse is the response struct for api ConvertBandwidthPackage +type ConvertBandwidthPackageResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + ConvertInstanceId string `json:"ConvertInstanceId" xml:"ConvertInstanceId"` +} + +// CreateConvertBandwidthPackageRequest creates a request to invoke ConvertBandwidthPackage API +func CreateConvertBandwidthPackageRequest() (request *ConvertBandwidthPackageRequest) { + request = &ConvertBandwidthPackageRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "ConvertBandwidthPackage", "vpc", "openAPI") + return +} + +// CreateConvertBandwidthPackageResponse creates a response to parse from ConvertBandwidthPackage response +func CreateConvertBandwidthPackageResponse() (response *ConvertBandwidthPackageResponse) { + response = &ConvertBandwidthPackageResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/create_bandwidth_package.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/create_bandwidth_package.go new file mode 100644 index 000000000..7b26ee572 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/create_bandwidth_package.go @@ -0,0 +1,116 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// CreateBandwidthPackage invokes the vpc.CreateBandwidthPackage API synchronously +// api document: https://help.aliyun.com/api/vpc/createbandwidthpackage.html +func (client *Client) CreateBandwidthPackage(request *CreateBandwidthPackageRequest) (response *CreateBandwidthPackageResponse, err error) { + response = CreateCreateBandwidthPackageResponse() + err = client.DoAction(request, response) + return +} + +// CreateBandwidthPackageWithChan invokes the vpc.CreateBandwidthPackage API asynchronously +// api document: https://help.aliyun.com/api/vpc/createbandwidthpackage.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) CreateBandwidthPackageWithChan(request *CreateBandwidthPackageRequest) (<-chan *CreateBandwidthPackageResponse, <-chan error) { + responseChan := make(chan *CreateBandwidthPackageResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.CreateBandwidthPackage(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// CreateBandwidthPackageWithCallback invokes the vpc.CreateBandwidthPackage API asynchronously +// api document: https://help.aliyun.com/api/vpc/createbandwidthpackage.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) CreateBandwidthPackageWithCallback(request *CreateBandwidthPackageRequest, callback func(response *CreateBandwidthPackageResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *CreateBandwidthPackageResponse + var err error + defer close(result) + response, err = client.CreateBandwidthPackage(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// CreateBandwidthPackageRequest is the request struct for api CreateBandwidthPackage +type CreateBandwidthPackageRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + ClientToken string `position:"Query" name:"ClientToken"` + Bandwidth requests.Integer `position:"Query" name:"Bandwidth"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + ISP string `position:"Query" name:"ISP"` + Description string `position:"Query" name:"Description"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + Zone string `position:"Query" name:"Zone"` + InternetChargeType string `position:"Query" name:"InternetChargeType"` + Name string `position:"Query" name:"Name"` + NatGatewayId string `position:"Query" name:"NatGatewayId"` + IpCount requests.Integer `position:"Query" name:"IpCount"` +} + +// CreateBandwidthPackageResponse is the response struct for api CreateBandwidthPackage +type CreateBandwidthPackageResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + BandwidthPackageId string `json:"BandwidthPackageId" xml:"BandwidthPackageId"` +} + +// CreateCreateBandwidthPackageRequest creates a request to invoke CreateBandwidthPackage API +func CreateCreateBandwidthPackageRequest() (request *CreateBandwidthPackageRequest) { + request = &CreateBandwidthPackageRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "CreateBandwidthPackage", "vpc", "openAPI") + return +} + +// CreateCreateBandwidthPackageResponse creates a response to parse from CreateBandwidthPackage response +func CreateCreateBandwidthPackageResponse() (response *CreateBandwidthPackageResponse) { + response = &CreateBandwidthPackageResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/create_bgp_group.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/create_bgp_group.go new file mode 100644 index 000000000..c47952907 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/create_bgp_group.go @@ -0,0 +1,114 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// CreateBgpGroup invokes the vpc.CreateBgpGroup API synchronously +// api document: https://help.aliyun.com/api/vpc/createbgpgroup.html +func (client *Client) CreateBgpGroup(request *CreateBgpGroupRequest) (response *CreateBgpGroupResponse, err error) { + response = CreateCreateBgpGroupResponse() + err = client.DoAction(request, response) + return +} + +// CreateBgpGroupWithChan invokes the vpc.CreateBgpGroup API asynchronously +// api document: https://help.aliyun.com/api/vpc/createbgpgroup.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) CreateBgpGroupWithChan(request *CreateBgpGroupRequest) (<-chan *CreateBgpGroupResponse, <-chan error) { + responseChan := make(chan *CreateBgpGroupResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.CreateBgpGroup(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// CreateBgpGroupWithCallback invokes the vpc.CreateBgpGroup API asynchronously +// api document: https://help.aliyun.com/api/vpc/createbgpgroup.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) CreateBgpGroupWithCallback(request *CreateBgpGroupRequest, callback func(response *CreateBgpGroupResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *CreateBgpGroupResponse + var err error + defer close(result) + response, err = client.CreateBgpGroup(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// CreateBgpGroupRequest is the request struct for api CreateBgpGroup +type CreateBgpGroupRequest struct { + *requests.RpcRequest + AuthKey string `position:"Query" name:"AuthKey"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + ClientToken string `position:"Query" name:"ClientToken"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + Description string `position:"Query" name:"Description"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + PeerAsn requests.Integer `position:"Query" name:"PeerAsn"` + IsFakeAsn requests.Boolean `position:"Query" name:"IsFakeAsn"` + RouterId string `position:"Query" name:"RouterId"` + Name string `position:"Query" name:"Name"` +} + +// CreateBgpGroupResponse is the response struct for api CreateBgpGroup +type CreateBgpGroupResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + BgpGroupId string `json:"BgpGroupId" xml:"BgpGroupId"` +} + +// CreateCreateBgpGroupRequest creates a request to invoke CreateBgpGroup API +func CreateCreateBgpGroupRequest() (request *CreateBgpGroupRequest) { + request = &CreateBgpGroupRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "CreateBgpGroup", "vpc", "openAPI") + return +} + +// CreateCreateBgpGroupResponse creates a response to parse from CreateBgpGroup response +func CreateCreateBgpGroupResponse() (response *CreateBgpGroupResponse) { + response = &CreateBgpGroupResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/create_bgp_peer.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/create_bgp_peer.go new file mode 100644 index 000000000..27999c3c0 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/create_bgp_peer.go @@ -0,0 +1,110 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// CreateBgpPeer invokes the vpc.CreateBgpPeer API synchronously +// api document: https://help.aliyun.com/api/vpc/createbgppeer.html +func (client *Client) CreateBgpPeer(request *CreateBgpPeerRequest) (response *CreateBgpPeerResponse, err error) { + response = CreateCreateBgpPeerResponse() + err = client.DoAction(request, response) + return +} + +// CreateBgpPeerWithChan invokes the vpc.CreateBgpPeer API asynchronously +// api document: https://help.aliyun.com/api/vpc/createbgppeer.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) CreateBgpPeerWithChan(request *CreateBgpPeerRequest) (<-chan *CreateBgpPeerResponse, <-chan error) { + responseChan := make(chan *CreateBgpPeerResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.CreateBgpPeer(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// CreateBgpPeerWithCallback invokes the vpc.CreateBgpPeer API asynchronously +// api document: https://help.aliyun.com/api/vpc/createbgppeer.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) CreateBgpPeerWithCallback(request *CreateBgpPeerRequest, callback func(response *CreateBgpPeerResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *CreateBgpPeerResponse + var err error + defer close(result) + response, err = client.CreateBgpPeer(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// CreateBgpPeerRequest is the request struct for api CreateBgpPeer +type CreateBgpPeerRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + ClientToken string `position:"Query" name:"ClientToken"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + BgpGroupId string `position:"Query" name:"BgpGroupId"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + PeerIpAddress string `position:"Query" name:"PeerIpAddress"` +} + +// CreateBgpPeerResponse is the response struct for api CreateBgpPeer +type CreateBgpPeerResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + BgpPeerId string `json:"BgpPeerId" xml:"BgpPeerId"` +} + +// CreateCreateBgpPeerRequest creates a request to invoke CreateBgpPeer API +func CreateCreateBgpPeerRequest() (request *CreateBgpPeerRequest) { + request = &CreateBgpPeerRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "CreateBgpPeer", "vpc", "openAPI") + return +} + +// CreateCreateBgpPeerResponse creates a response to parse from CreateBgpPeer response +func CreateCreateBgpPeerResponse() (response *CreateBgpPeerResponse) { + response = &CreateBgpPeerResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/create_common_bandwidth_package.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/create_common_bandwidth_package.go new file mode 100644 index 000000000..99010f45c --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/create_common_bandwidth_package.go @@ -0,0 +1,117 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// CreateCommonBandwidthPackage invokes the vpc.CreateCommonBandwidthPackage API synchronously +// api document: https://help.aliyun.com/api/vpc/createcommonbandwidthpackage.html +func (client *Client) CreateCommonBandwidthPackage(request *CreateCommonBandwidthPackageRequest) (response *CreateCommonBandwidthPackageResponse, err error) { + response = CreateCreateCommonBandwidthPackageResponse() + err = client.DoAction(request, response) + return +} + +// CreateCommonBandwidthPackageWithChan invokes the vpc.CreateCommonBandwidthPackage API asynchronously +// api document: https://help.aliyun.com/api/vpc/createcommonbandwidthpackage.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) CreateCommonBandwidthPackageWithChan(request *CreateCommonBandwidthPackageRequest) (<-chan *CreateCommonBandwidthPackageResponse, <-chan error) { + responseChan := make(chan *CreateCommonBandwidthPackageResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.CreateCommonBandwidthPackage(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// CreateCommonBandwidthPackageWithCallback invokes the vpc.CreateCommonBandwidthPackage API asynchronously +// api document: https://help.aliyun.com/api/vpc/createcommonbandwidthpackage.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) CreateCommonBandwidthPackageWithCallback(request *CreateCommonBandwidthPackageRequest, callback func(response *CreateCommonBandwidthPackageResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *CreateCommonBandwidthPackageResponse + var err error + defer close(result) + response, err = client.CreateCommonBandwidthPackage(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// CreateCommonBandwidthPackageRequest is the request struct for api CreateCommonBandwidthPackage +type CreateCommonBandwidthPackageRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + ClientToken string `position:"Query" name:"ClientToken"` + Bandwidth requests.Integer `position:"Query" name:"Bandwidth"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + ISP string `position:"Query" name:"ISP"` + Description string `position:"Query" name:"Description"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + ResourceGroupId string `position:"Query" name:"ResourceGroupId"` + Zone string `position:"Query" name:"Zone"` + InternetChargeType string `position:"Query" name:"InternetChargeType"` + Name string `position:"Query" name:"Name"` + Ratio requests.Integer `position:"Query" name:"Ratio"` +} + +// CreateCommonBandwidthPackageResponse is the response struct for api CreateCommonBandwidthPackage +type CreateCommonBandwidthPackageResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + BandwidthPackageId string `json:"BandwidthPackageId" xml:"BandwidthPackageId"` + ResourceGroupId string `json:"ResourceGroupId" xml:"ResourceGroupId"` +} + +// CreateCreateCommonBandwidthPackageRequest creates a request to invoke CreateCommonBandwidthPackage API +func CreateCreateCommonBandwidthPackageRequest() (request *CreateCommonBandwidthPackageRequest) { + request = &CreateCommonBandwidthPackageRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "CreateCommonBandwidthPackage", "vpc", "openAPI") + return +} + +// CreateCreateCommonBandwidthPackageResponse creates a response to parse from CreateCommonBandwidthPackage response +func CreateCreateCommonBandwidthPackageResponse() (response *CreateCommonBandwidthPackageResponse) { + response = &CreateCommonBandwidthPackageResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/create_customer_gateway.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/create_customer_gateway.go new file mode 100644 index 000000000..a92f12006 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/create_customer_gateway.go @@ -0,0 +1,115 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// CreateCustomerGateway invokes the vpc.CreateCustomerGateway API synchronously +// api document: https://help.aliyun.com/api/vpc/createcustomergateway.html +func (client *Client) CreateCustomerGateway(request *CreateCustomerGatewayRequest) (response *CreateCustomerGatewayResponse, err error) { + response = CreateCreateCustomerGatewayResponse() + err = client.DoAction(request, response) + return +} + +// CreateCustomerGatewayWithChan invokes the vpc.CreateCustomerGateway API asynchronously +// api document: https://help.aliyun.com/api/vpc/createcustomergateway.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) CreateCustomerGatewayWithChan(request *CreateCustomerGatewayRequest) (<-chan *CreateCustomerGatewayResponse, <-chan error) { + responseChan := make(chan *CreateCustomerGatewayResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.CreateCustomerGateway(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// CreateCustomerGatewayWithCallback invokes the vpc.CreateCustomerGateway API asynchronously +// api document: https://help.aliyun.com/api/vpc/createcustomergateway.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) CreateCustomerGatewayWithCallback(request *CreateCustomerGatewayRequest, callback func(response *CreateCustomerGatewayResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *CreateCustomerGatewayResponse + var err error + defer close(result) + response, err = client.CreateCustomerGateway(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// CreateCustomerGatewayRequest is the request struct for api CreateCustomerGateway +type CreateCustomerGatewayRequest struct { + *requests.RpcRequest + IpAddress string `position:"Query" name:"IpAddress"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + ClientToken string `position:"Query" name:"ClientToken"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + Name string `position:"Query" name:"Name"` + Description string `position:"Query" name:"Description"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// CreateCustomerGatewayResponse is the response struct for api CreateCustomerGateway +type CreateCustomerGatewayResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + CustomerGatewayId string `json:"CustomerGatewayId" xml:"CustomerGatewayId"` + IpAddress string `json:"IpAddress" xml:"IpAddress"` + Name string `json:"Name" xml:"Name"` + Description string `json:"Description" xml:"Description"` + CreateTime int `json:"CreateTime" xml:"CreateTime"` +} + +// CreateCreateCustomerGatewayRequest creates a request to invoke CreateCustomerGateway API +func CreateCreateCustomerGatewayRequest() (request *CreateCustomerGatewayRequest) { + request = &CreateCustomerGatewayRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "CreateCustomerGateway", "vpc", "openAPI") + return +} + +// CreateCreateCustomerGatewayResponse creates a response to parse from CreateCustomerGateway response +func CreateCreateCustomerGatewayResponse() (response *CreateCustomerGatewayResponse) { + response = &CreateCustomerGatewayResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/create_flow_log.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/create_flow_log.go new file mode 100644 index 000000000..8ec2025b2 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/create_flow_log.go @@ -0,0 +1,115 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// CreateFlowLog invokes the vpc.CreateFlowLog API synchronously +// api document: https://help.aliyun.com/api/vpc/createflowlog.html +func (client *Client) CreateFlowLog(request *CreateFlowLogRequest) (response *CreateFlowLogResponse, err error) { + response = CreateCreateFlowLogResponse() + err = client.DoAction(request, response) + return +} + +// CreateFlowLogWithChan invokes the vpc.CreateFlowLog API asynchronously +// api document: https://help.aliyun.com/api/vpc/createflowlog.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) CreateFlowLogWithChan(request *CreateFlowLogRequest) (<-chan *CreateFlowLogResponse, <-chan error) { + responseChan := make(chan *CreateFlowLogResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.CreateFlowLog(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// CreateFlowLogWithCallback invokes the vpc.CreateFlowLog API asynchronously +// api document: https://help.aliyun.com/api/vpc/createflowlog.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) CreateFlowLogWithCallback(request *CreateFlowLogRequest, callback func(response *CreateFlowLogResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *CreateFlowLogResponse + var err error + defer close(result) + response, err = client.CreateFlowLog(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// CreateFlowLogRequest is the request struct for api CreateFlowLog +type CreateFlowLogRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceId string `position:"Query" name:"ResourceId"` + ProjectName string `position:"Query" name:"ProjectName"` + LogStoreName string `position:"Query" name:"LogStoreName"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + Description string `position:"Query" name:"Description"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + ResourceType string `position:"Query" name:"ResourceType"` + TrafficType string `position:"Query" name:"TrafficType"` + FlowLogName string `position:"Query" name:"FlowLogName"` +} + +// CreateFlowLogResponse is the response struct for api CreateFlowLog +type CreateFlowLogResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + Success string `json:"Success" xml:"Success"` + FlowLogId string `json:"FlowLogId" xml:"FlowLogId"` +} + +// CreateCreateFlowLogRequest creates a request to invoke CreateFlowLog API +func CreateCreateFlowLogRequest() (request *CreateFlowLogRequest) { + request = &CreateFlowLogRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "CreateFlowLog", "vpc", "openAPI") + return +} + +// CreateCreateFlowLogResponse creates a response to parse from CreateFlowLog response +func CreateCreateFlowLogResponse() (response *CreateFlowLogResponse) { + response = &CreateFlowLogResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/create_forward_entry.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/create_forward_entry.go new file mode 100644 index 000000000..d09fa6b44 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/create_forward_entry.go @@ -0,0 +1,114 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// CreateForwardEntry invokes the vpc.CreateForwardEntry API synchronously +// api document: https://help.aliyun.com/api/vpc/createforwardentry.html +func (client *Client) CreateForwardEntry(request *CreateForwardEntryRequest) (response *CreateForwardEntryResponse, err error) { + response = CreateCreateForwardEntryResponse() + err = client.DoAction(request, response) + return +} + +// CreateForwardEntryWithChan invokes the vpc.CreateForwardEntry API asynchronously +// api document: https://help.aliyun.com/api/vpc/createforwardentry.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) CreateForwardEntryWithChan(request *CreateForwardEntryRequest) (<-chan *CreateForwardEntryResponse, <-chan error) { + responseChan := make(chan *CreateForwardEntryResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.CreateForwardEntry(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// CreateForwardEntryWithCallback invokes the vpc.CreateForwardEntry API asynchronously +// api document: https://help.aliyun.com/api/vpc/createforwardentry.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) CreateForwardEntryWithCallback(request *CreateForwardEntryRequest, callback func(response *CreateForwardEntryResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *CreateForwardEntryResponse + var err error + defer close(result) + response, err = client.CreateForwardEntry(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// CreateForwardEntryRequest is the request struct for api CreateForwardEntry +type CreateForwardEntryRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + IpProtocol string `position:"Query" name:"IpProtocol"` + ForwardEntryName string `position:"Query" name:"ForwardEntryName"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + ForwardTableId string `position:"Query" name:"ForwardTableId"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + InternalIp string `position:"Query" name:"InternalIp"` + InternalPort string `position:"Query" name:"InternalPort"` + ExternalIp string `position:"Query" name:"ExternalIp"` + ExternalPort string `position:"Query" name:"ExternalPort"` +} + +// CreateForwardEntryResponse is the response struct for api CreateForwardEntry +type CreateForwardEntryResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + ForwardEntryId string `json:"ForwardEntryId" xml:"ForwardEntryId"` +} + +// CreateCreateForwardEntryRequest creates a request to invoke CreateForwardEntry API +func CreateCreateForwardEntryRequest() (request *CreateForwardEntryRequest) { + request = &CreateForwardEntryRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "CreateForwardEntry", "vpc", "openAPI") + return +} + +// CreateCreateForwardEntryResponse creates a response to parse from CreateForwardEntry response +func CreateCreateForwardEntryResponse() (response *CreateForwardEntryResponse) { + response = &CreateForwardEntryResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/create_global_acceleration_instance.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/create_global_acceleration_instance.go new file mode 100644 index 000000000..80e4a398f --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/create_global_acceleration_instance.go @@ -0,0 +1,115 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// CreateGlobalAccelerationInstance invokes the vpc.CreateGlobalAccelerationInstance API synchronously +// api document: https://help.aliyun.com/api/vpc/createglobalaccelerationinstance.html +func (client *Client) CreateGlobalAccelerationInstance(request *CreateGlobalAccelerationInstanceRequest) (response *CreateGlobalAccelerationInstanceResponse, err error) { + response = CreateCreateGlobalAccelerationInstanceResponse() + err = client.DoAction(request, response) + return +} + +// CreateGlobalAccelerationInstanceWithChan invokes the vpc.CreateGlobalAccelerationInstance API asynchronously +// api document: https://help.aliyun.com/api/vpc/createglobalaccelerationinstance.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) CreateGlobalAccelerationInstanceWithChan(request *CreateGlobalAccelerationInstanceRequest) (<-chan *CreateGlobalAccelerationInstanceResponse, <-chan error) { + responseChan := make(chan *CreateGlobalAccelerationInstanceResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.CreateGlobalAccelerationInstance(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// CreateGlobalAccelerationInstanceWithCallback invokes the vpc.CreateGlobalAccelerationInstance API asynchronously +// api document: https://help.aliyun.com/api/vpc/createglobalaccelerationinstance.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) CreateGlobalAccelerationInstanceWithCallback(request *CreateGlobalAccelerationInstanceRequest, callback func(response *CreateGlobalAccelerationInstanceResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *CreateGlobalAccelerationInstanceResponse + var err error + defer close(result) + response, err = client.CreateGlobalAccelerationInstance(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// CreateGlobalAccelerationInstanceRequest is the request struct for api CreateGlobalAccelerationInstance +type CreateGlobalAccelerationInstanceRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + BandwidthType string `position:"Query" name:"BandwidthType"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + ServiceLocation string `position:"Query" name:"ServiceLocation"` + Bandwidth string `position:"Query" name:"Bandwidth"` + ClientToken string `position:"Query" name:"ClientToken"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + Description string `position:"Query" name:"Description"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + InternetChargeType string `position:"Query" name:"InternetChargeType"` + Name string `position:"Query" name:"Name"` +} + +// CreateGlobalAccelerationInstanceResponse is the response struct for api CreateGlobalAccelerationInstance +type CreateGlobalAccelerationInstanceResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + GlobalAccelerationInstanceId string `json:"GlobalAccelerationInstanceId" xml:"GlobalAccelerationInstanceId"` + IpAddress string `json:"IpAddress" xml:"IpAddress"` +} + +// CreateCreateGlobalAccelerationInstanceRequest creates a request to invoke CreateGlobalAccelerationInstance API +func CreateCreateGlobalAccelerationInstanceRequest() (request *CreateGlobalAccelerationInstanceRequest) { + request = &CreateGlobalAccelerationInstanceRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "CreateGlobalAccelerationInstance", "vpc", "openAPI") + return +} + +// CreateCreateGlobalAccelerationInstanceResponse creates a response to parse from CreateGlobalAccelerationInstance response +func CreateCreateGlobalAccelerationInstanceResponse() (response *CreateGlobalAccelerationInstanceResponse) { + response = &CreateGlobalAccelerationInstanceResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/create_ha_vip.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/create_ha_vip.go new file mode 100644 index 000000000..54d6132e4 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/create_ha_vip.go @@ -0,0 +1,111 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// CreateHaVip invokes the vpc.CreateHaVip API synchronously +// api document: https://help.aliyun.com/api/vpc/createhavip.html +func (client *Client) CreateHaVip(request *CreateHaVipRequest) (response *CreateHaVipResponse, err error) { + response = CreateCreateHaVipResponse() + err = client.DoAction(request, response) + return +} + +// CreateHaVipWithChan invokes the vpc.CreateHaVip API asynchronously +// api document: https://help.aliyun.com/api/vpc/createhavip.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) CreateHaVipWithChan(request *CreateHaVipRequest) (<-chan *CreateHaVipResponse, <-chan error) { + responseChan := make(chan *CreateHaVipResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.CreateHaVip(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// CreateHaVipWithCallback invokes the vpc.CreateHaVip API asynchronously +// api document: https://help.aliyun.com/api/vpc/createhavip.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) CreateHaVipWithCallback(request *CreateHaVipRequest, callback func(response *CreateHaVipResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *CreateHaVipResponse + var err error + defer close(result) + response, err = client.CreateHaVip(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// CreateHaVipRequest is the request struct for api CreateHaVip +type CreateHaVipRequest struct { + *requests.RpcRequest + VSwitchId string `position:"Query" name:"VSwitchId"` + IpAddress string `position:"Query" name:"IpAddress"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + ClientToken string `position:"Query" name:"ClientToken"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + Description string `position:"Query" name:"Description"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// CreateHaVipResponse is the response struct for api CreateHaVip +type CreateHaVipResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + HaVipId string `json:"HaVipId" xml:"HaVipId"` +} + +// CreateCreateHaVipRequest creates a request to invoke CreateHaVip API +func CreateCreateHaVipRequest() (request *CreateHaVipRequest) { + request = &CreateHaVipRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "CreateHaVip", "vpc", "openAPI") + return +} + +// CreateCreateHaVipResponse creates a response to parse from CreateHaVip response +func CreateCreateHaVipResponse() (response *CreateHaVipResponse) { + response = &CreateHaVipResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/create_i_pv6_translator.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/create_i_pv6_translator.go new file mode 100644 index 000000000..dc41c95f9 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/create_i_pv6_translator.go @@ -0,0 +1,118 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// CreateIPv6Translator invokes the vpc.CreateIPv6Translator API synchronously +// api document: https://help.aliyun.com/api/vpc/createipv6translator.html +func (client *Client) CreateIPv6Translator(request *CreateIPv6TranslatorRequest) (response *CreateIPv6TranslatorResponse, err error) { + response = CreateCreateIPv6TranslatorResponse() + err = client.DoAction(request, response) + return +} + +// CreateIPv6TranslatorWithChan invokes the vpc.CreateIPv6Translator API asynchronously +// api document: https://help.aliyun.com/api/vpc/createipv6translator.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) CreateIPv6TranslatorWithChan(request *CreateIPv6TranslatorRequest) (<-chan *CreateIPv6TranslatorResponse, <-chan error) { + responseChan := make(chan *CreateIPv6TranslatorResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.CreateIPv6Translator(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// CreateIPv6TranslatorWithCallback invokes the vpc.CreateIPv6Translator API asynchronously +// api document: https://help.aliyun.com/api/vpc/createipv6translator.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) CreateIPv6TranslatorWithCallback(request *CreateIPv6TranslatorRequest, callback func(response *CreateIPv6TranslatorResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *CreateIPv6TranslatorResponse + var err error + defer close(result) + response, err = client.CreateIPv6Translator(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// CreateIPv6TranslatorRequest is the request struct for api CreateIPv6Translator +type CreateIPv6TranslatorRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + AutoPay requests.Boolean `position:"Query" name:"AutoPay"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + ClientToken string `position:"Query" name:"ClientToken"` + Bandwidth requests.Integer `position:"Query" name:"Bandwidth"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + Spec string `position:"Query" name:"Spec"` + Duration requests.Integer `position:"Query" name:"Duration"` + Name string `position:"Query" name:"Name"` + PayType string `position:"Query" name:"PayType"` + PricingCycle string `position:"Query" name:"PricingCycle"` +} + +// CreateIPv6TranslatorResponse is the response struct for api CreateIPv6Translator +type CreateIPv6TranslatorResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + Ipv6TranslatorId string `json:"Ipv6TranslatorId" xml:"Ipv6TranslatorId"` + Name string `json:"Name" xml:"Name"` + Spec string `json:"Spec" xml:"Spec"` + OrderId int `json:"OrderId" xml:"OrderId"` +} + +// CreateCreateIPv6TranslatorRequest creates a request to invoke CreateIPv6Translator API +func CreateCreateIPv6TranslatorRequest() (request *CreateIPv6TranslatorRequest) { + request = &CreateIPv6TranslatorRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "CreateIPv6Translator", "vpc", "openAPI") + return +} + +// CreateCreateIPv6TranslatorResponse creates a response to parse from CreateIPv6Translator response +func CreateCreateIPv6TranslatorResponse() (response *CreateIPv6TranslatorResponse) { + response = &CreateIPv6TranslatorResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/create_i_pv6_translator_acl_list.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/create_i_pv6_translator_acl_list.go new file mode 100644 index 000000000..8856c8f7f --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/create_i_pv6_translator_acl_list.go @@ -0,0 +1,109 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// CreateIPv6TranslatorAclList invokes the vpc.CreateIPv6TranslatorAclList API synchronously +// api document: https://help.aliyun.com/api/vpc/createipv6translatoracllist.html +func (client *Client) CreateIPv6TranslatorAclList(request *CreateIPv6TranslatorAclListRequest) (response *CreateIPv6TranslatorAclListResponse, err error) { + response = CreateCreateIPv6TranslatorAclListResponse() + err = client.DoAction(request, response) + return +} + +// CreateIPv6TranslatorAclListWithChan invokes the vpc.CreateIPv6TranslatorAclList API asynchronously +// api document: https://help.aliyun.com/api/vpc/createipv6translatoracllist.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) CreateIPv6TranslatorAclListWithChan(request *CreateIPv6TranslatorAclListRequest) (<-chan *CreateIPv6TranslatorAclListResponse, <-chan error) { + responseChan := make(chan *CreateIPv6TranslatorAclListResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.CreateIPv6TranslatorAclList(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// CreateIPv6TranslatorAclListWithCallback invokes the vpc.CreateIPv6TranslatorAclList API asynchronously +// api document: https://help.aliyun.com/api/vpc/createipv6translatoracllist.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) CreateIPv6TranslatorAclListWithCallback(request *CreateIPv6TranslatorAclListRequest, callback func(response *CreateIPv6TranslatorAclListResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *CreateIPv6TranslatorAclListResponse + var err error + defer close(result) + response, err = client.CreateIPv6TranslatorAclList(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// CreateIPv6TranslatorAclListRequest is the request struct for api CreateIPv6TranslatorAclList +type CreateIPv6TranslatorAclListRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + AclName string `position:"Query" name:"AclName"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + ClientToken string `position:"Query" name:"ClientToken"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// CreateIPv6TranslatorAclListResponse is the response struct for api CreateIPv6TranslatorAclList +type CreateIPv6TranslatorAclListResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + AclId string `json:"AclId" xml:"AclId"` +} + +// CreateCreateIPv6TranslatorAclListRequest creates a request to invoke CreateIPv6TranslatorAclList API +func CreateCreateIPv6TranslatorAclListRequest() (request *CreateIPv6TranslatorAclListRequest) { + request = &CreateIPv6TranslatorAclListRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "CreateIPv6TranslatorAclList", "vpc", "openAPI") + return +} + +// CreateCreateIPv6TranslatorAclListResponse creates a response to parse from CreateIPv6TranslatorAclList response +func CreateCreateIPv6TranslatorAclListResponse() (response *CreateIPv6TranslatorAclListResponse) { + response = &CreateIPv6TranslatorAclListResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/create_i_pv6_translator_entry.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/create_i_pv6_translator_entry.go new file mode 100644 index 000000000..1bf81fa79 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/create_i_pv6_translator_entry.go @@ -0,0 +1,118 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// CreateIPv6TranslatorEntry invokes the vpc.CreateIPv6TranslatorEntry API synchronously +// api document: https://help.aliyun.com/api/vpc/createipv6translatorentry.html +func (client *Client) CreateIPv6TranslatorEntry(request *CreateIPv6TranslatorEntryRequest) (response *CreateIPv6TranslatorEntryResponse, err error) { + response = CreateCreateIPv6TranslatorEntryResponse() + err = client.DoAction(request, response) + return +} + +// CreateIPv6TranslatorEntryWithChan invokes the vpc.CreateIPv6TranslatorEntry API asynchronously +// api document: https://help.aliyun.com/api/vpc/createipv6translatorentry.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) CreateIPv6TranslatorEntryWithChan(request *CreateIPv6TranslatorEntryRequest) (<-chan *CreateIPv6TranslatorEntryResponse, <-chan error) { + responseChan := make(chan *CreateIPv6TranslatorEntryResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.CreateIPv6TranslatorEntry(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// CreateIPv6TranslatorEntryWithCallback invokes the vpc.CreateIPv6TranslatorEntry API asynchronously +// api document: https://help.aliyun.com/api/vpc/createipv6translatorentry.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) CreateIPv6TranslatorEntryWithCallback(request *CreateIPv6TranslatorEntryRequest, callback func(response *CreateIPv6TranslatorEntryResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *CreateIPv6TranslatorEntryResponse + var err error + defer close(result) + response, err = client.CreateIPv6TranslatorEntry(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// CreateIPv6TranslatorEntryRequest is the request struct for api CreateIPv6TranslatorEntry +type CreateIPv6TranslatorEntryRequest struct { + *requests.RpcRequest + BackendIpv4Port requests.Integer `position:"Query" name:"BackendIpv4Port"` + AclId string `position:"Query" name:"AclId"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + EntryName string `position:"Query" name:"EntryName"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + AclStatus string `position:"Query" name:"AclStatus"` + EntryBandwidth requests.Integer `position:"Query" name:"EntryBandwidth"` + AclType string `position:"Query" name:"AclType"` + AllocateIpv6Port requests.Integer `position:"Query" name:"AllocateIpv6Port"` + EntryDescription string `position:"Query" name:"EntryDescription"` + BackendIpv4Addr string `position:"Query" name:"BackendIpv4Addr"` + TransProtocol string `position:"Query" name:"TransProtocol"` + Ipv6TranslatorId string `position:"Query" name:"Ipv6TranslatorId"` +} + +// CreateIPv6TranslatorEntryResponse is the response struct for api CreateIPv6TranslatorEntry +type CreateIPv6TranslatorEntryResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + Ipv6TranslatorEntryId string `json:"Ipv6TranslatorEntryId" xml:"Ipv6TranslatorEntryId"` +} + +// CreateCreateIPv6TranslatorEntryRequest creates a request to invoke CreateIPv6TranslatorEntry API +func CreateCreateIPv6TranslatorEntryRequest() (request *CreateIPv6TranslatorEntryRequest) { + request = &CreateIPv6TranslatorEntryRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "CreateIPv6TranslatorEntry", "vpc", "openAPI") + return +} + +// CreateCreateIPv6TranslatorEntryResponse creates a response to parse from CreateIPv6TranslatorEntry response +func CreateCreateIPv6TranslatorEntryResponse() (response *CreateIPv6TranslatorEntryResponse) { + response = &CreateIPv6TranslatorEntryResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/create_ipv6_egress_only_rule.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/create_ipv6_egress_only_rule.go new file mode 100644 index 000000000..1f19c962b --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/create_ipv6_egress_only_rule.go @@ -0,0 +1,113 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// CreateIpv6EgressOnlyRule invokes the vpc.CreateIpv6EgressOnlyRule API synchronously +// api document: https://help.aliyun.com/api/vpc/createipv6egressonlyrule.html +func (client *Client) CreateIpv6EgressOnlyRule(request *CreateIpv6EgressOnlyRuleRequest) (response *CreateIpv6EgressOnlyRuleResponse, err error) { + response = CreateCreateIpv6EgressOnlyRuleResponse() + err = client.DoAction(request, response) + return +} + +// CreateIpv6EgressOnlyRuleWithChan invokes the vpc.CreateIpv6EgressOnlyRule API asynchronously +// api document: https://help.aliyun.com/api/vpc/createipv6egressonlyrule.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) CreateIpv6EgressOnlyRuleWithChan(request *CreateIpv6EgressOnlyRuleRequest) (<-chan *CreateIpv6EgressOnlyRuleResponse, <-chan error) { + responseChan := make(chan *CreateIpv6EgressOnlyRuleResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.CreateIpv6EgressOnlyRule(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// CreateIpv6EgressOnlyRuleWithCallback invokes the vpc.CreateIpv6EgressOnlyRule API asynchronously +// api document: https://help.aliyun.com/api/vpc/createipv6egressonlyrule.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) CreateIpv6EgressOnlyRuleWithCallback(request *CreateIpv6EgressOnlyRuleRequest, callback func(response *CreateIpv6EgressOnlyRuleResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *CreateIpv6EgressOnlyRuleResponse + var err error + defer close(result) + response, err = client.CreateIpv6EgressOnlyRule(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// CreateIpv6EgressOnlyRuleRequest is the request struct for api CreateIpv6EgressOnlyRule +type CreateIpv6EgressOnlyRuleRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ClientToken string `position:"Query" name:"ClientToken"` + Description string `position:"Query" name:"Description"` + InstanceType string `position:"Query" name:"InstanceType"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + InstanceId string `position:"Query" name:"InstanceId"` + Ipv6GatewayId string `position:"Query" name:"Ipv6GatewayId"` + Name string `position:"Query" name:"Name"` +} + +// CreateIpv6EgressOnlyRuleResponse is the response struct for api CreateIpv6EgressOnlyRule +type CreateIpv6EgressOnlyRuleResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + Ipv6EgressRuleId string `json:"Ipv6EgressRuleId" xml:"Ipv6EgressRuleId"` +} + +// CreateCreateIpv6EgressOnlyRuleRequest creates a request to invoke CreateIpv6EgressOnlyRule API +func CreateCreateIpv6EgressOnlyRuleRequest() (request *CreateIpv6EgressOnlyRuleRequest) { + request = &CreateIpv6EgressOnlyRuleRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "CreateIpv6EgressOnlyRule", "vpc", "openAPI") + return +} + +// CreateCreateIpv6EgressOnlyRuleResponse creates a response to parse from CreateIpv6EgressOnlyRule response +func CreateCreateIpv6EgressOnlyRuleResponse() (response *CreateIpv6EgressOnlyRuleResponse) { + response = &CreateIpv6EgressOnlyRuleResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/create_ipv6_gateway.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/create_ipv6_gateway.go new file mode 100644 index 000000000..f768d99cc --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/create_ipv6_gateway.go @@ -0,0 +1,112 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// CreateIpv6Gateway invokes the vpc.CreateIpv6Gateway API synchronously +// api document: https://help.aliyun.com/api/vpc/createipv6gateway.html +func (client *Client) CreateIpv6Gateway(request *CreateIpv6GatewayRequest) (response *CreateIpv6GatewayResponse, err error) { + response = CreateCreateIpv6GatewayResponse() + err = client.DoAction(request, response) + return +} + +// CreateIpv6GatewayWithChan invokes the vpc.CreateIpv6Gateway API asynchronously +// api document: https://help.aliyun.com/api/vpc/createipv6gateway.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) CreateIpv6GatewayWithChan(request *CreateIpv6GatewayRequest) (<-chan *CreateIpv6GatewayResponse, <-chan error) { + responseChan := make(chan *CreateIpv6GatewayResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.CreateIpv6Gateway(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// CreateIpv6GatewayWithCallback invokes the vpc.CreateIpv6Gateway API asynchronously +// api document: https://help.aliyun.com/api/vpc/createipv6gateway.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) CreateIpv6GatewayWithCallback(request *CreateIpv6GatewayRequest, callback func(response *CreateIpv6GatewayResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *CreateIpv6GatewayResponse + var err error + defer close(result) + response, err = client.CreateIpv6Gateway(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// CreateIpv6GatewayRequest is the request struct for api CreateIpv6Gateway +type CreateIpv6GatewayRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ClientToken string `position:"Query" name:"ClientToken"` + Description string `position:"Query" name:"Description"` + Spec string `position:"Query" name:"Spec"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + VpcId string `position:"Query" name:"VpcId"` + Name string `position:"Query" name:"Name"` +} + +// CreateIpv6GatewayResponse is the response struct for api CreateIpv6Gateway +type CreateIpv6GatewayResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + Ipv6GatewayId string `json:"Ipv6GatewayId" xml:"Ipv6GatewayId"` +} + +// CreateCreateIpv6GatewayRequest creates a request to invoke CreateIpv6Gateway API +func CreateCreateIpv6GatewayRequest() (request *CreateIpv6GatewayRequest) { + request = &CreateIpv6GatewayRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "CreateIpv6Gateway", "vpc", "openAPI") + return +} + +// CreateCreateIpv6GatewayResponse creates a response to parse from CreateIpv6Gateway response +func CreateCreateIpv6GatewayResponse() (response *CreateIpv6GatewayResponse) { + response = &CreateIpv6GatewayResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/create_nat_gateway.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/create_nat_gateway.go new file mode 100644 index 000000000..9afd3a60c --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/create_nat_gateway.go @@ -0,0 +1,129 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// CreateNatGateway invokes the vpc.CreateNatGateway API synchronously +// api document: https://help.aliyun.com/api/vpc/createnatgateway.html +func (client *Client) CreateNatGateway(request *CreateNatGatewayRequest) (response *CreateNatGatewayResponse, err error) { + response = CreateCreateNatGatewayResponse() + err = client.DoAction(request, response) + return +} + +// CreateNatGatewayWithChan invokes the vpc.CreateNatGateway API asynchronously +// api document: https://help.aliyun.com/api/vpc/createnatgateway.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) CreateNatGatewayWithChan(request *CreateNatGatewayRequest) (<-chan *CreateNatGatewayResponse, <-chan error) { + responseChan := make(chan *CreateNatGatewayResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.CreateNatGateway(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// CreateNatGatewayWithCallback invokes the vpc.CreateNatGateway API asynchronously +// api document: https://help.aliyun.com/api/vpc/createnatgateway.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) CreateNatGatewayWithCallback(request *CreateNatGatewayRequest, callback func(response *CreateNatGatewayResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *CreateNatGatewayResponse + var err error + defer close(result) + response, err = client.CreateNatGateway(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// CreateNatGatewayRequest is the request struct for api CreateNatGateway +type CreateNatGatewayRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + AutoPay requests.Boolean `position:"Query" name:"AutoPay"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + ClientToken string `position:"Query" name:"ClientToken"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + Description string `position:"Query" name:"Description"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + Spec string `position:"Query" name:"Spec"` + Duration string `position:"Query" name:"Duration"` + VpcId string `position:"Query" name:"VpcId"` + Name string `position:"Query" name:"Name"` + BandwidthPackage *[]CreateNatGatewayBandwidthPackage `position:"Query" name:"BandwidthPackage" type:"Repeated"` + InstanceChargeType string `position:"Query" name:"InstanceChargeType"` + PricingCycle string `position:"Query" name:"PricingCycle"` +} + +// CreateNatGatewayBandwidthPackage is a repeated param struct in CreateNatGatewayRequest +type CreateNatGatewayBandwidthPackage struct { + Bandwidth string `name:"Bandwidth"` + Zone string `name:"Zone"` + InternetChargeType string `name:"InternetChargeType"` + ISP string `name:"ISP"` + IpCount string `name:"IpCount"` +} + +// CreateNatGatewayResponse is the response struct for api CreateNatGateway +type CreateNatGatewayResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + NatGatewayId string `json:"NatGatewayId" xml:"NatGatewayId"` + ForwardTableIds ForwardTableIdsInCreateNatGateway `json:"ForwardTableIds" xml:"ForwardTableIds"` + SnatTableIds SnatTableIdsInCreateNatGateway `json:"SnatTableIds" xml:"SnatTableIds"` + BandwidthPackageIds BandwidthPackageIdsInCreateNatGateway `json:"BandwidthPackageIds" xml:"BandwidthPackageIds"` +} + +// CreateCreateNatGatewayRequest creates a request to invoke CreateNatGateway API +func CreateCreateNatGatewayRequest() (request *CreateNatGatewayRequest) { + request = &CreateNatGatewayRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "CreateNatGateway", "vpc", "openAPI") + return +} + +// CreateCreateNatGatewayResponse creates a response to parse from CreateNatGateway response +func CreateCreateNatGatewayResponse() (response *CreateNatGatewayResponse) { + response = &CreateNatGatewayResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/create_nqa.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/create_nqa.go new file mode 100644 index 000000000..cc6ec6a23 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/create_nqa.go @@ -0,0 +1,110 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// CreateNqa invokes the vpc.CreateNqa API synchronously +// api document: https://help.aliyun.com/api/vpc/createnqa.html +func (client *Client) CreateNqa(request *CreateNqaRequest) (response *CreateNqaResponse, err error) { + response = CreateCreateNqaResponse() + err = client.DoAction(request, response) + return +} + +// CreateNqaWithChan invokes the vpc.CreateNqa API asynchronously +// api document: https://help.aliyun.com/api/vpc/createnqa.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) CreateNqaWithChan(request *CreateNqaRequest) (<-chan *CreateNqaResponse, <-chan error) { + responseChan := make(chan *CreateNqaResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.CreateNqa(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// CreateNqaWithCallback invokes the vpc.CreateNqa API asynchronously +// api document: https://help.aliyun.com/api/vpc/createnqa.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) CreateNqaWithCallback(request *CreateNqaRequest, callback func(response *CreateNqaResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *CreateNqaResponse + var err error + defer close(result) + response, err = client.CreateNqa(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// CreateNqaRequest is the request struct for api CreateNqa +type CreateNqaRequest struct { + *requests.RpcRequest + DestinationIp string `position:"Query" name:"DestinationIp"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + ClientToken string `position:"Query" name:"ClientToken"` + RouterId string `position:"Query" name:"RouterId"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// CreateNqaResponse is the response struct for api CreateNqa +type CreateNqaResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + NqaId string `json:"NqaId" xml:"NqaId"` +} + +// CreateCreateNqaRequest creates a request to invoke CreateNqa API +func CreateCreateNqaRequest() (request *CreateNqaRequest) { + request = &CreateNqaRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "CreateNqa", "vpc", "openAPI") + return +} + +// CreateCreateNqaResponse creates a response to parse from CreateNqa response +func CreateCreateNqaResponse() (response *CreateNqaResponse) { + response = &CreateNqaResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/create_physical_connection.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/create_physical_connection.go new file mode 100644 index 000000000..e4be40da2 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/create_physical_connection.go @@ -0,0 +1,118 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// CreatePhysicalConnection invokes the vpc.CreatePhysicalConnection API synchronously +// api document: https://help.aliyun.com/api/vpc/createphysicalconnection.html +func (client *Client) CreatePhysicalConnection(request *CreatePhysicalConnectionRequest) (response *CreatePhysicalConnectionResponse, err error) { + response = CreateCreatePhysicalConnectionResponse() + err = client.DoAction(request, response) + return +} + +// CreatePhysicalConnectionWithChan invokes the vpc.CreatePhysicalConnection API asynchronously +// api document: https://help.aliyun.com/api/vpc/createphysicalconnection.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) CreatePhysicalConnectionWithChan(request *CreatePhysicalConnectionRequest) (<-chan *CreatePhysicalConnectionResponse, <-chan error) { + responseChan := make(chan *CreatePhysicalConnectionResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.CreatePhysicalConnection(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// CreatePhysicalConnectionWithCallback invokes the vpc.CreatePhysicalConnection API asynchronously +// api document: https://help.aliyun.com/api/vpc/createphysicalconnection.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) CreatePhysicalConnectionWithCallback(request *CreatePhysicalConnectionRequest, callback func(response *CreatePhysicalConnectionResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *CreatePhysicalConnectionResponse + var err error + defer close(result) + response, err = client.CreatePhysicalConnection(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// CreatePhysicalConnectionRequest is the request struct for api CreatePhysicalConnection +type CreatePhysicalConnectionRequest struct { + *requests.RpcRequest + AccessPointId string `position:"Query" name:"AccessPointId"` + RedundantPhysicalConnectionId string `position:"Query" name:"RedundantPhysicalConnectionId"` + PeerLocation string `position:"Query" name:"PeerLocation"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + PortType string `position:"Query" name:"PortType"` + CircuitCode string `position:"Query" name:"CircuitCode"` + Bandwidth requests.Integer `position:"Query" name:"bandwidth"` + ClientToken string `position:"Query" name:"ClientToken"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + Description string `position:"Query" name:"Description"` + Type string `position:"Query" name:"Type"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + LineOperator string `position:"Query" name:"LineOperator"` + Name string `position:"Query" name:"Name"` +} + +// CreatePhysicalConnectionResponse is the response struct for api CreatePhysicalConnection +type CreatePhysicalConnectionResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + PhysicalConnectionId string `json:"PhysicalConnectionId" xml:"PhysicalConnectionId"` +} + +// CreateCreatePhysicalConnectionRequest creates a request to invoke CreatePhysicalConnection API +func CreateCreatePhysicalConnectionRequest() (request *CreatePhysicalConnectionRequest) { + request = &CreatePhysicalConnectionRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "CreatePhysicalConnection", "vpc", "openAPI") + return +} + +// CreateCreatePhysicalConnectionResponse creates a response to parse from CreatePhysicalConnection response +func CreateCreatePhysicalConnectionResponse() (response *CreatePhysicalConnectionResponse) { + response = &CreatePhysicalConnectionResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/create_physical_connection_new.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/create_physical_connection_new.go new file mode 100644 index 000000000..d1233aee7 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/create_physical_connection_new.go @@ -0,0 +1,120 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// CreatePhysicalConnectionNew invokes the vpc.CreatePhysicalConnectionNew API synchronously +// api document: https://help.aliyun.com/api/vpc/createphysicalconnectionnew.html +func (client *Client) CreatePhysicalConnectionNew(request *CreatePhysicalConnectionNewRequest) (response *CreatePhysicalConnectionNewResponse, err error) { + response = CreateCreatePhysicalConnectionNewResponse() + err = client.DoAction(request, response) + return +} + +// CreatePhysicalConnectionNewWithChan invokes the vpc.CreatePhysicalConnectionNew API asynchronously +// api document: https://help.aliyun.com/api/vpc/createphysicalconnectionnew.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) CreatePhysicalConnectionNewWithChan(request *CreatePhysicalConnectionNewRequest) (<-chan *CreatePhysicalConnectionNewResponse, <-chan error) { + responseChan := make(chan *CreatePhysicalConnectionNewResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.CreatePhysicalConnectionNew(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// CreatePhysicalConnectionNewWithCallback invokes the vpc.CreatePhysicalConnectionNew API asynchronously +// api document: https://help.aliyun.com/api/vpc/createphysicalconnectionnew.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) CreatePhysicalConnectionNewWithCallback(request *CreatePhysicalConnectionNewRequest, callback func(response *CreatePhysicalConnectionNewResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *CreatePhysicalConnectionNewResponse + var err error + defer close(result) + response, err = client.CreatePhysicalConnectionNew(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// CreatePhysicalConnectionNewRequest is the request struct for api CreatePhysicalConnectionNew +type CreatePhysicalConnectionNewRequest struct { + *requests.RpcRequest + AccessPointId string `position:"Query" name:"AccessPointId"` + RedundantPhysicalConnectionId string `position:"Query" name:"RedundantPhysicalConnectionId"` + PeerLocation string `position:"Query" name:"PeerLocation"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + PortType string `position:"Query" name:"PortType"` + CircuitCode string `position:"Query" name:"CircuitCode"` + Bandwidth requests.Integer `position:"Query" name:"bandwidth"` + ClientToken string `position:"Query" name:"ClientToken"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + Description string `position:"Query" name:"Description"` + InterfaceName string `position:"Query" name:"InterfaceName"` + Type string `position:"Query" name:"Type"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + LineOperator string `position:"Query" name:"LineOperator"` + Name string `position:"Query" name:"Name"` + DeviceName string `position:"Query" name:"DeviceName"` +} + +// CreatePhysicalConnectionNewResponse is the response struct for api CreatePhysicalConnectionNew +type CreatePhysicalConnectionNewResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + PhysicalConnectionId string `json:"PhysicalConnectionId" xml:"PhysicalConnectionId"` +} + +// CreateCreatePhysicalConnectionNewRequest creates a request to invoke CreatePhysicalConnectionNew API +func CreateCreatePhysicalConnectionNewRequest() (request *CreatePhysicalConnectionNewRequest) { + request = &CreatePhysicalConnectionNewRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "CreatePhysicalConnectionNew", "vpc", "openAPI") + return +} + +// CreateCreatePhysicalConnectionNewResponse creates a response to parse from CreatePhysicalConnectionNew response +func CreateCreatePhysicalConnectionNewResponse() (response *CreatePhysicalConnectionNewResponse) { + response = &CreatePhysicalConnectionNewResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/create_route_entry.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/create_route_entry.go new file mode 100644 index 000000000..46f027d25 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/create_route_entry.go @@ -0,0 +1,121 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// CreateRouteEntry invokes the vpc.CreateRouteEntry API synchronously +// api document: https://help.aliyun.com/api/vpc/createrouteentry.html +func (client *Client) CreateRouteEntry(request *CreateRouteEntryRequest) (response *CreateRouteEntryResponse, err error) { + response = CreateCreateRouteEntryResponse() + err = client.DoAction(request, response) + return +} + +// CreateRouteEntryWithChan invokes the vpc.CreateRouteEntry API asynchronously +// api document: https://help.aliyun.com/api/vpc/createrouteentry.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) CreateRouteEntryWithChan(request *CreateRouteEntryRequest) (<-chan *CreateRouteEntryResponse, <-chan error) { + responseChan := make(chan *CreateRouteEntryResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.CreateRouteEntry(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// CreateRouteEntryWithCallback invokes the vpc.CreateRouteEntry API asynchronously +// api document: https://help.aliyun.com/api/vpc/createrouteentry.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) CreateRouteEntryWithCallback(request *CreateRouteEntryRequest, callback func(response *CreateRouteEntryResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *CreateRouteEntryResponse + var err error + defer close(result) + response, err = client.CreateRouteEntry(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// CreateRouteEntryRequest is the request struct for api CreateRouteEntry +type CreateRouteEntryRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + RouteEntryName string `position:"Query" name:"RouteEntryName"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + ClientToken string `position:"Query" name:"ClientToken"` + DestinationCidrBlock string `position:"Query" name:"DestinationCidrBlock"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + PrivateIpAddress string `position:"Query" name:"PrivateIpAddress"` + NextHopId string `position:"Query" name:"NextHopId"` + NextHopType string `position:"Query" name:"NextHopType"` + NextHopList *[]CreateRouteEntryNextHopList `position:"Query" name:"NextHopList" type:"Repeated"` + RouteTableId string `position:"Query" name:"RouteTableId"` +} + +// CreateRouteEntryNextHopList is a repeated param struct in CreateRouteEntryRequest +type CreateRouteEntryNextHopList struct { + Weight string `name:"Weight"` + NextHopId string `name:"NextHopId"` + NextHopType string `name:"NextHopType"` +} + +// CreateRouteEntryResponse is the response struct for api CreateRouteEntry +type CreateRouteEntryResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateCreateRouteEntryRequest creates a request to invoke CreateRouteEntry API +func CreateCreateRouteEntryRequest() (request *CreateRouteEntryRequest) { + request = &CreateRouteEntryRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "CreateRouteEntry", "vpc", "openAPI") + return +} + +// CreateCreateRouteEntryResponse creates a response to parse from CreateRouteEntry response +func CreateCreateRouteEntryResponse() (response *CreateRouteEntryResponse) { + response = &CreateRouteEntryResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/create_route_table.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/create_route_table.go new file mode 100644 index 000000000..8fa7ba1b2 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/create_route_table.go @@ -0,0 +1,111 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// CreateRouteTable invokes the vpc.CreateRouteTable API synchronously +// api document: https://help.aliyun.com/api/vpc/createroutetable.html +func (client *Client) CreateRouteTable(request *CreateRouteTableRequest) (response *CreateRouteTableResponse, err error) { + response = CreateCreateRouteTableResponse() + err = client.DoAction(request, response) + return +} + +// CreateRouteTableWithChan invokes the vpc.CreateRouteTable API asynchronously +// api document: https://help.aliyun.com/api/vpc/createroutetable.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) CreateRouteTableWithChan(request *CreateRouteTableRequest) (<-chan *CreateRouteTableResponse, <-chan error) { + responseChan := make(chan *CreateRouteTableResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.CreateRouteTable(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// CreateRouteTableWithCallback invokes the vpc.CreateRouteTable API asynchronously +// api document: https://help.aliyun.com/api/vpc/createroutetable.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) CreateRouteTableWithCallback(request *CreateRouteTableRequest, callback func(response *CreateRouteTableResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *CreateRouteTableResponse + var err error + defer close(result) + response, err = client.CreateRouteTable(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// CreateRouteTableRequest is the request struct for api CreateRouteTable +type CreateRouteTableRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ClientToken string `position:"Query" name:"ClientToken"` + Description string `position:"Query" name:"Description"` + RouteTableName string `position:"Query" name:"RouteTableName"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + VpcId string `position:"Query" name:"VpcId"` +} + +// CreateRouteTableResponse is the response struct for api CreateRouteTable +type CreateRouteTableResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + RouteTableId string `json:"RouteTableId" xml:"RouteTableId"` +} + +// CreateCreateRouteTableRequest creates a request to invoke CreateRouteTable API +func CreateCreateRouteTableRequest() (request *CreateRouteTableRequest) { + request = &CreateRouteTableRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "CreateRouteTable", "vpc", "openAPI") + return +} + +// CreateCreateRouteTableResponse creates a response to parse from CreateRouteTable response +func CreateCreateRouteTableResponse() (response *CreateRouteTableResponse) { + response = &CreateRouteTableResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/create_router_interface.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/create_router_interface.go new file mode 100644 index 000000000..17bda801d --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/create_router_interface.go @@ -0,0 +1,128 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// CreateRouterInterface invokes the vpc.CreateRouterInterface API synchronously +// api document: https://help.aliyun.com/api/vpc/createrouterinterface.html +func (client *Client) CreateRouterInterface(request *CreateRouterInterfaceRequest) (response *CreateRouterInterfaceResponse, err error) { + response = CreateCreateRouterInterfaceResponse() + err = client.DoAction(request, response) + return +} + +// CreateRouterInterfaceWithChan invokes the vpc.CreateRouterInterface API asynchronously +// api document: https://help.aliyun.com/api/vpc/createrouterinterface.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) CreateRouterInterfaceWithChan(request *CreateRouterInterfaceRequest) (<-chan *CreateRouterInterfaceResponse, <-chan error) { + responseChan := make(chan *CreateRouterInterfaceResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.CreateRouterInterface(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// CreateRouterInterfaceWithCallback invokes the vpc.CreateRouterInterface API asynchronously +// api document: https://help.aliyun.com/api/vpc/createrouterinterface.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) CreateRouterInterfaceWithCallback(request *CreateRouterInterfaceRequest, callback func(response *CreateRouterInterfaceResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *CreateRouterInterfaceResponse + var err error + defer close(result) + response, err = client.CreateRouterInterface(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// CreateRouterInterfaceRequest is the request struct for api CreateRouterInterface +type CreateRouterInterfaceRequest struct { + *requests.RpcRequest + AccessPointId string `position:"Query" name:"AccessPointId"` + OppositeRouterId string `position:"Query" name:"OppositeRouterId"` + OppositeAccessPointId string `position:"Query" name:"OppositeAccessPointId"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + Role string `position:"Query" name:"Role"` + ClientToken string `position:"Query" name:"ClientToken"` + HealthCheckTargetIp string `position:"Query" name:"HealthCheckTargetIp"` + Description string `position:"Query" name:"Description"` + Spec string `position:"Query" name:"Spec"` + OppositeInterfaceId string `position:"Query" name:"OppositeInterfaceId"` + InstanceChargeType string `position:"Query" name:"InstanceChargeType"` + Period requests.Integer `position:"Query" name:"Period"` + AutoPay requests.Boolean `position:"Query" name:"AutoPay"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OppositeRegionId string `position:"Query" name:"OppositeRegionId"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + OppositeInterfaceOwnerId string `position:"Query" name:"OppositeInterfaceOwnerId"` + RouterType string `position:"Query" name:"RouterType"` + HealthCheckSourceIp string `position:"Query" name:"HealthCheckSourceIp"` + RouterId string `position:"Query" name:"RouterId"` + OppositeRouterType string `position:"Query" name:"OppositeRouterType"` + Name string `position:"Query" name:"Name"` + PricingCycle string `position:"Query" name:"PricingCycle"` +} + +// CreateRouterInterfaceResponse is the response struct for api CreateRouterInterface +type CreateRouterInterfaceResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + RouterInterfaceId string `json:"RouterInterfaceId" xml:"RouterInterfaceId"` + OrderId int `json:"OrderId" xml:"OrderId"` +} + +// CreateCreateRouterInterfaceRequest creates a request to invoke CreateRouterInterface API +func CreateCreateRouterInterfaceRequest() (request *CreateRouterInterfaceRequest) { + request = &CreateRouterInterfaceRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "CreateRouterInterface", "vpc", "openAPI") + return +} + +// CreateCreateRouterInterfaceResponse creates a response to parse from CreateRouterInterface response +func CreateCreateRouterInterfaceResponse() (response *CreateRouterInterfaceResponse) { + response = &CreateRouterInterfaceResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/create_snat_entry.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/create_snat_entry.go new file mode 100644 index 000000000..4374a0bb7 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/create_snat_entry.go @@ -0,0 +1,112 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// CreateSnatEntry invokes the vpc.CreateSnatEntry API synchronously +// api document: https://help.aliyun.com/api/vpc/createsnatentry.html +func (client *Client) CreateSnatEntry(request *CreateSnatEntryRequest) (response *CreateSnatEntryResponse, err error) { + response = CreateCreateSnatEntryResponse() + err = client.DoAction(request, response) + return +} + +// CreateSnatEntryWithChan invokes the vpc.CreateSnatEntry API asynchronously +// api document: https://help.aliyun.com/api/vpc/createsnatentry.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) CreateSnatEntryWithChan(request *CreateSnatEntryRequest) (<-chan *CreateSnatEntryResponse, <-chan error) { + responseChan := make(chan *CreateSnatEntryResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.CreateSnatEntry(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// CreateSnatEntryWithCallback invokes the vpc.CreateSnatEntry API asynchronously +// api document: https://help.aliyun.com/api/vpc/createsnatentry.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) CreateSnatEntryWithCallback(request *CreateSnatEntryRequest, callback func(response *CreateSnatEntryResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *CreateSnatEntryResponse + var err error + defer close(result) + response, err = client.CreateSnatEntry(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// CreateSnatEntryRequest is the request struct for api CreateSnatEntry +type CreateSnatEntryRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + SourceVSwitchId string `position:"Query" name:"SourceVSwitchId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + SnatEntryName string `position:"Query" name:"SnatEntryName"` + SourceCIDR string `position:"Query" name:"SourceCIDR"` + SnatTableId string `position:"Query" name:"SnatTableId"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + SnatIp string `position:"Query" name:"SnatIp"` +} + +// CreateSnatEntryResponse is the response struct for api CreateSnatEntry +type CreateSnatEntryResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + SnatEntryId string `json:"SnatEntryId" xml:"SnatEntryId"` +} + +// CreateCreateSnatEntryRequest creates a request to invoke CreateSnatEntry API +func CreateCreateSnatEntryRequest() (request *CreateSnatEntryRequest) { + request = &CreateSnatEntryRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "CreateSnatEntry", "vpc", "openAPI") + return +} + +// CreateCreateSnatEntryResponse creates a response to parse from CreateSnatEntry response +func CreateCreateSnatEntryResponse() (response *CreateSnatEntryResponse) { + response = &CreateSnatEntryResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/create_ssl_vpn_client_cert.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/create_ssl_vpn_client_cert.go new file mode 100644 index 000000000..7d9e9e693 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/create_ssl_vpn_client_cert.go @@ -0,0 +1,111 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// CreateSslVpnClientCert invokes the vpc.CreateSslVpnClientCert API synchronously +// api document: https://help.aliyun.com/api/vpc/createsslvpnclientcert.html +func (client *Client) CreateSslVpnClientCert(request *CreateSslVpnClientCertRequest) (response *CreateSslVpnClientCertResponse, err error) { + response = CreateCreateSslVpnClientCertResponse() + err = client.DoAction(request, response) + return +} + +// CreateSslVpnClientCertWithChan invokes the vpc.CreateSslVpnClientCert API asynchronously +// api document: https://help.aliyun.com/api/vpc/createsslvpnclientcert.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) CreateSslVpnClientCertWithChan(request *CreateSslVpnClientCertRequest) (<-chan *CreateSslVpnClientCertResponse, <-chan error) { + responseChan := make(chan *CreateSslVpnClientCertResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.CreateSslVpnClientCert(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// CreateSslVpnClientCertWithCallback invokes the vpc.CreateSslVpnClientCert API asynchronously +// api document: https://help.aliyun.com/api/vpc/createsslvpnclientcert.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) CreateSslVpnClientCertWithCallback(request *CreateSslVpnClientCertRequest, callback func(response *CreateSslVpnClientCertResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *CreateSslVpnClientCertResponse + var err error + defer close(result) + response, err = client.CreateSslVpnClientCert(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// CreateSslVpnClientCertRequest is the request struct for api CreateSslVpnClientCert +type CreateSslVpnClientCertRequest struct { + *requests.RpcRequest + SslVpnServerId string `position:"Query" name:"SslVpnServerId"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + ClientToken string `position:"Query" name:"ClientToken"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + Name string `position:"Query" name:"Name"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// CreateSslVpnClientCertResponse is the response struct for api CreateSslVpnClientCert +type CreateSslVpnClientCertResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + Name string `json:"Name" xml:"Name"` + SslVpnClientCertId string `json:"SslVpnClientCertId" xml:"SslVpnClientCertId"` +} + +// CreateCreateSslVpnClientCertRequest creates a request to invoke CreateSslVpnClientCert API +func CreateCreateSslVpnClientCertRequest() (request *CreateSslVpnClientCertRequest) { + request = &CreateSslVpnClientCertRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "CreateSslVpnClientCert", "vpc", "openAPI") + return +} + +// CreateCreateSslVpnClientCertResponse creates a response to parse from CreateSslVpnClientCert response +func CreateCreateSslVpnClientCertResponse() (response *CreateSslVpnClientCertResponse) { + response = &CreateSslVpnClientCertResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/create_ssl_vpn_server.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/create_ssl_vpn_server.go new file mode 100644 index 000000000..75a5de6e1 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/create_ssl_vpn_server.go @@ -0,0 +1,117 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// CreateSslVpnServer invokes the vpc.CreateSslVpnServer API synchronously +// api document: https://help.aliyun.com/api/vpc/createsslvpnserver.html +func (client *Client) CreateSslVpnServer(request *CreateSslVpnServerRequest) (response *CreateSslVpnServerResponse, err error) { + response = CreateCreateSslVpnServerResponse() + err = client.DoAction(request, response) + return +} + +// CreateSslVpnServerWithChan invokes the vpc.CreateSslVpnServer API asynchronously +// api document: https://help.aliyun.com/api/vpc/createsslvpnserver.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) CreateSslVpnServerWithChan(request *CreateSslVpnServerRequest) (<-chan *CreateSslVpnServerResponse, <-chan error) { + responseChan := make(chan *CreateSslVpnServerResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.CreateSslVpnServer(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// CreateSslVpnServerWithCallback invokes the vpc.CreateSslVpnServer API asynchronously +// api document: https://help.aliyun.com/api/vpc/createsslvpnserver.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) CreateSslVpnServerWithCallback(request *CreateSslVpnServerRequest, callback func(response *CreateSslVpnServerResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *CreateSslVpnServerResponse + var err error + defer close(result) + response, err = client.CreateSslVpnServer(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// CreateSslVpnServerRequest is the request struct for api CreateSslVpnServer +type CreateSslVpnServerRequest struct { + *requests.RpcRequest + Cipher string `position:"Query" name:"Cipher"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ClientIpPool string `position:"Query" name:"ClientIpPool"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + ClientToken string `position:"Query" name:"ClientToken"` + Compress requests.Boolean `position:"Query" name:"Compress"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + VpnGatewayId string `position:"Query" name:"VpnGatewayId"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + LocalSubnet string `position:"Query" name:"LocalSubnet"` + Port requests.Integer `position:"Query" name:"Port"` + Proto string `position:"Query" name:"Proto"` + Name string `position:"Query" name:"Name"` +} + +// CreateSslVpnServerResponse is the response struct for api CreateSslVpnServer +type CreateSslVpnServerResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + SslVpnServerId string `json:"SslVpnServerId" xml:"SslVpnServerId"` + Name string `json:"Name" xml:"Name"` +} + +// CreateCreateSslVpnServerRequest creates a request to invoke CreateSslVpnServer API +func CreateCreateSslVpnServerRequest() (request *CreateSslVpnServerRequest) { + request = &CreateSslVpnServerRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "CreateSslVpnServer", "vpc", "openAPI") + return +} + +// CreateCreateSslVpnServerResponse creates a response to parse from CreateSslVpnServer response +func CreateCreateSslVpnServerResponse() (response *CreateSslVpnServerResponse) { + response = &CreateSslVpnServerResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/create_v_switch.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/create_v_switch.go new file mode 100644 index 000000000..1803c75b3 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/create_v_switch.go @@ -0,0 +1,114 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// CreateVSwitch invokes the vpc.CreateVSwitch API synchronously +// api document: https://help.aliyun.com/api/vpc/createvswitch.html +func (client *Client) CreateVSwitch(request *CreateVSwitchRequest) (response *CreateVSwitchResponse, err error) { + response = CreateCreateVSwitchResponse() + err = client.DoAction(request, response) + return +} + +// CreateVSwitchWithChan invokes the vpc.CreateVSwitch API asynchronously +// api document: https://help.aliyun.com/api/vpc/createvswitch.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) CreateVSwitchWithChan(request *CreateVSwitchRequest) (<-chan *CreateVSwitchResponse, <-chan error) { + responseChan := make(chan *CreateVSwitchResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.CreateVSwitch(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// CreateVSwitchWithCallback invokes the vpc.CreateVSwitch API asynchronously +// api document: https://help.aliyun.com/api/vpc/createvswitch.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) CreateVSwitchWithCallback(request *CreateVSwitchRequest, callback func(response *CreateVSwitchResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *CreateVSwitchResponse + var err error + defer close(result) + response, err = client.CreateVSwitch(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// CreateVSwitchRequest is the request struct for api CreateVSwitch +type CreateVSwitchRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + ClientToken string `position:"Query" name:"ClientToken"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + Description string `position:"Query" name:"Description"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + Ipv6CidrBlock requests.Integer `position:"Query" name:"Ipv6CidrBlock"` + VpcId string `position:"Query" name:"VpcId"` + VSwitchName string `position:"Query" name:"VSwitchName"` + CidrBlock string `position:"Query" name:"CidrBlock"` + ZoneId string `position:"Query" name:"ZoneId"` +} + +// CreateVSwitchResponse is the response struct for api CreateVSwitch +type CreateVSwitchResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + VSwitchId string `json:"VSwitchId" xml:"VSwitchId"` +} + +// CreateCreateVSwitchRequest creates a request to invoke CreateVSwitch API +func CreateCreateVSwitchRequest() (request *CreateVSwitchRequest) { + request = &CreateVSwitchRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "CreateVSwitch", "vpc", "openAPI") + return +} + +// CreateCreateVSwitchResponse creates a response to parse from CreateVSwitch response +func CreateCreateVSwitchResponse() (response *CreateVSwitchResponse) { + response = &CreateVSwitchResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/create_virtual_border_router.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/create_virtual_border_router.go new file mode 100644 index 000000000..c444de911 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/create_virtual_border_router.go @@ -0,0 +1,117 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// CreateVirtualBorderRouter invokes the vpc.CreateVirtualBorderRouter API synchronously +// api document: https://help.aliyun.com/api/vpc/createvirtualborderrouter.html +func (client *Client) CreateVirtualBorderRouter(request *CreateVirtualBorderRouterRequest) (response *CreateVirtualBorderRouterResponse, err error) { + response = CreateCreateVirtualBorderRouterResponse() + err = client.DoAction(request, response) + return +} + +// CreateVirtualBorderRouterWithChan invokes the vpc.CreateVirtualBorderRouter API asynchronously +// api document: https://help.aliyun.com/api/vpc/createvirtualborderrouter.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) CreateVirtualBorderRouterWithChan(request *CreateVirtualBorderRouterRequest) (<-chan *CreateVirtualBorderRouterResponse, <-chan error) { + responseChan := make(chan *CreateVirtualBorderRouterResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.CreateVirtualBorderRouter(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// CreateVirtualBorderRouterWithCallback invokes the vpc.CreateVirtualBorderRouter API asynchronously +// api document: https://help.aliyun.com/api/vpc/createvirtualborderrouter.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) CreateVirtualBorderRouterWithCallback(request *CreateVirtualBorderRouterRequest, callback func(response *CreateVirtualBorderRouterResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *CreateVirtualBorderRouterResponse + var err error + defer close(result) + response, err = client.CreateVirtualBorderRouter(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// CreateVirtualBorderRouterRequest is the request struct for api CreateVirtualBorderRouter +type CreateVirtualBorderRouterRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + CircuitCode string `position:"Query" name:"CircuitCode"` + VlanId requests.Integer `position:"Query" name:"VlanId"` + ClientToken string `position:"Query" name:"ClientToken"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + Description string `position:"Query" name:"Description"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + PeerGatewayIp string `position:"Query" name:"PeerGatewayIp"` + PeeringSubnetMask string `position:"Query" name:"PeeringSubnetMask"` + PhysicalConnectionId string `position:"Query" name:"PhysicalConnectionId"` + Name string `position:"Query" name:"Name"` + LocalGatewayIp string `position:"Query" name:"LocalGatewayIp"` + VbrOwnerId requests.Integer `position:"Query" name:"VbrOwnerId"` +} + +// CreateVirtualBorderRouterResponse is the response struct for api CreateVirtualBorderRouter +type CreateVirtualBorderRouterResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + VbrId string `json:"VbrId" xml:"VbrId"` +} + +// CreateCreateVirtualBorderRouterRequest creates a request to invoke CreateVirtualBorderRouter API +func CreateCreateVirtualBorderRouterRequest() (request *CreateVirtualBorderRouterRequest) { + request = &CreateVirtualBorderRouterRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "CreateVirtualBorderRouter", "vpc", "openAPI") + return +} + +// CreateCreateVirtualBorderRouterResponse creates a response to parse from CreateVirtualBorderRouter response +func CreateCreateVirtualBorderRouterResponse() (response *CreateVirtualBorderRouterResponse) { + response = &CreateVirtualBorderRouterResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/create_vpc.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/create_vpc.go new file mode 100644 index 000000000..f34eba7b2 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/create_vpc.go @@ -0,0 +1,118 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// CreateVpc invokes the vpc.CreateVpc API synchronously +// api document: https://help.aliyun.com/api/vpc/createvpc.html +func (client *Client) CreateVpc(request *CreateVpcRequest) (response *CreateVpcResponse, err error) { + response = CreateCreateVpcResponse() + err = client.DoAction(request, response) + return +} + +// CreateVpcWithChan invokes the vpc.CreateVpc API asynchronously +// api document: https://help.aliyun.com/api/vpc/createvpc.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) CreateVpcWithChan(request *CreateVpcRequest) (<-chan *CreateVpcResponse, <-chan error) { + responseChan := make(chan *CreateVpcResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.CreateVpc(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// CreateVpcWithCallback invokes the vpc.CreateVpc API asynchronously +// api document: https://help.aliyun.com/api/vpc/createvpc.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) CreateVpcWithCallback(request *CreateVpcRequest, callback func(response *CreateVpcResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *CreateVpcResponse + var err error + defer close(result) + response, err = client.CreateVpc(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// CreateVpcRequest is the request struct for api CreateVpc +type CreateVpcRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + ClientToken string `position:"Query" name:"ClientToken"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + EnableIpv6 requests.Boolean `position:"Query" name:"EnableIpv6"` + Description string `position:"Query" name:"Description"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + Ipv6CidrBlock string `position:"Query" name:"Ipv6CidrBlock"` + VpcName string `position:"Query" name:"VpcName"` + ResourceGroupId string `position:"Query" name:"ResourceGroupId"` + CidrBlock string `position:"Query" name:"CidrBlock"` + UserCidr string `position:"Query" name:"UserCidr"` +} + +// CreateVpcResponse is the response struct for api CreateVpc +type CreateVpcResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + VpcId string `json:"VpcId" xml:"VpcId"` + VRouterId string `json:"VRouterId" xml:"VRouterId"` + RouteTableId string `json:"RouteTableId" xml:"RouteTableId"` + ResourceGroupId string `json:"ResourceGroupId" xml:"ResourceGroupId"` +} + +// CreateCreateVpcRequest creates a request to invoke CreateVpc API +func CreateCreateVpcRequest() (request *CreateVpcRequest) { + request = &CreateVpcRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "CreateVpc", "vpc", "openAPI") + return +} + +// CreateCreateVpcResponse creates a response to parse from CreateVpc response +func CreateCreateVpcResponse() (response *CreateVpcResponse) { + response = &CreateVpcResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/create_vpn_connection.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/create_vpn_connection.go new file mode 100644 index 000000000..f739fb2d1 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/create_vpn_connection.go @@ -0,0 +1,118 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// CreateVpnConnection invokes the vpc.CreateVpnConnection API synchronously +// api document: https://help.aliyun.com/api/vpc/createvpnconnection.html +func (client *Client) CreateVpnConnection(request *CreateVpnConnectionRequest) (response *CreateVpnConnectionResponse, err error) { + response = CreateCreateVpnConnectionResponse() + err = client.DoAction(request, response) + return +} + +// CreateVpnConnectionWithChan invokes the vpc.CreateVpnConnection API asynchronously +// api document: https://help.aliyun.com/api/vpc/createvpnconnection.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) CreateVpnConnectionWithChan(request *CreateVpnConnectionRequest) (<-chan *CreateVpnConnectionResponse, <-chan error) { + responseChan := make(chan *CreateVpnConnectionResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.CreateVpnConnection(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// CreateVpnConnectionWithCallback invokes the vpc.CreateVpnConnection API asynchronously +// api document: https://help.aliyun.com/api/vpc/createvpnconnection.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) CreateVpnConnectionWithCallback(request *CreateVpnConnectionRequest, callback func(response *CreateVpnConnectionResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *CreateVpnConnectionResponse + var err error + defer close(result) + response, err = client.CreateVpnConnection(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// CreateVpnConnectionRequest is the request struct for api CreateVpnConnection +type CreateVpnConnectionRequest struct { + *requests.RpcRequest + IkeConfig string `position:"Query" name:"IkeConfig"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + RemoteSubnet string `position:"Query" name:"RemoteSubnet"` + EffectImmediately requests.Boolean `position:"Query" name:"EffectImmediately"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + ClientToken string `position:"Query" name:"ClientToken"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + IpsecConfig string `position:"Query" name:"IpsecConfig"` + VpnGatewayId string `position:"Query" name:"VpnGatewayId"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + CustomerGatewayId string `position:"Query" name:"CustomerGatewayId"` + LocalSubnet string `position:"Query" name:"LocalSubnet"` + Name string `position:"Query" name:"Name"` +} + +// CreateVpnConnectionResponse is the response struct for api CreateVpnConnection +type CreateVpnConnectionResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + VpnConnectionId string `json:"VpnConnectionId" xml:"VpnConnectionId"` + Name string `json:"Name" xml:"Name"` + CreateTime int `json:"CreateTime" xml:"CreateTime"` +} + +// CreateCreateVpnConnectionRequest creates a request to invoke CreateVpnConnection API +func CreateCreateVpnConnectionRequest() (request *CreateVpnConnectionRequest) { + request = &CreateVpnConnectionRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "CreateVpnConnection", "vpc", "openAPI") + return +} + +// CreateCreateVpnConnectionResponse creates a response to parse from CreateVpnConnection response +func CreateCreateVpnConnectionResponse() (response *CreateVpnConnectionResponse) { + response = &CreateVpnConnectionResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/create_vpn_gateway.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/create_vpn_gateway.go new file mode 100644 index 000000000..628e76d83 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/create_vpn_gateway.go @@ -0,0 +1,118 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// CreateVpnGateway invokes the vpc.CreateVpnGateway API synchronously +// api document: https://help.aliyun.com/api/vpc/createvpngateway.html +func (client *Client) CreateVpnGateway(request *CreateVpnGatewayRequest) (response *CreateVpnGatewayResponse, err error) { + response = CreateCreateVpnGatewayResponse() + err = client.DoAction(request, response) + return +} + +// CreateVpnGatewayWithChan invokes the vpc.CreateVpnGateway API asynchronously +// api document: https://help.aliyun.com/api/vpc/createvpngateway.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) CreateVpnGatewayWithChan(request *CreateVpnGatewayRequest) (<-chan *CreateVpnGatewayResponse, <-chan error) { + responseChan := make(chan *CreateVpnGatewayResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.CreateVpnGateway(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// CreateVpnGatewayWithCallback invokes the vpc.CreateVpnGateway API asynchronously +// api document: https://help.aliyun.com/api/vpc/createvpngateway.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) CreateVpnGatewayWithCallback(request *CreateVpnGatewayRequest, callback func(response *CreateVpnGatewayResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *CreateVpnGatewayResponse + var err error + defer close(result) + response, err = client.CreateVpnGateway(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// CreateVpnGatewayRequest is the request struct for api CreateVpnGateway +type CreateVpnGatewayRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + Period requests.Integer `position:"Query" name:"Period"` + AutoPay requests.Boolean `position:"Query" name:"AutoPay"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + Bandwidth requests.Integer `position:"Query" name:"Bandwidth"` + EnableIpsec requests.Boolean `position:"Query" name:"EnableIpsec"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + EnableSsl requests.Boolean `position:"Query" name:"EnableSsl"` + SslConnections requests.Integer `position:"Query" name:"SslConnections"` + VpcId string `position:"Query" name:"VpcId"` + Name string `position:"Query" name:"Name"` + InstanceChargeType string `position:"Query" name:"InstanceChargeType"` +} + +// CreateVpnGatewayResponse is the response struct for api CreateVpnGateway +type CreateVpnGatewayResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + VpnGatewayId string `json:"VpnGatewayId" xml:"VpnGatewayId"` + Name string `json:"Name" xml:"Name"` + OrderId int `json:"OrderId" xml:"OrderId"` +} + +// CreateCreateVpnGatewayRequest creates a request to invoke CreateVpnGateway API +func CreateCreateVpnGatewayRequest() (request *CreateVpnGatewayRequest) { + request = &CreateVpnGatewayRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "CreateVpnGateway", "vpc", "openAPI") + return +} + +// CreateCreateVpnGatewayResponse creates a response to parse from CreateVpnGateway response +func CreateCreateVpnGatewayResponse() (response *CreateVpnGatewayResponse) { + response = &CreateVpnGatewayResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/deactivate_router_interface.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/deactivate_router_interface.go new file mode 100644 index 000000000..2c0e50460 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/deactivate_router_interface.go @@ -0,0 +1,106 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// DeactivateRouterInterface invokes the vpc.DeactivateRouterInterface API synchronously +// api document: https://help.aliyun.com/api/vpc/deactivaterouterinterface.html +func (client *Client) DeactivateRouterInterface(request *DeactivateRouterInterfaceRequest) (response *DeactivateRouterInterfaceResponse, err error) { + response = CreateDeactivateRouterInterfaceResponse() + err = client.DoAction(request, response) + return +} + +// DeactivateRouterInterfaceWithChan invokes the vpc.DeactivateRouterInterface API asynchronously +// api document: https://help.aliyun.com/api/vpc/deactivaterouterinterface.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DeactivateRouterInterfaceWithChan(request *DeactivateRouterInterfaceRequest) (<-chan *DeactivateRouterInterfaceResponse, <-chan error) { + responseChan := make(chan *DeactivateRouterInterfaceResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DeactivateRouterInterface(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DeactivateRouterInterfaceWithCallback invokes the vpc.DeactivateRouterInterface API asynchronously +// api document: https://help.aliyun.com/api/vpc/deactivaterouterinterface.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DeactivateRouterInterfaceWithCallback(request *DeactivateRouterInterfaceRequest, callback func(response *DeactivateRouterInterfaceResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DeactivateRouterInterfaceResponse + var err error + defer close(result) + response, err = client.DeactivateRouterInterface(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DeactivateRouterInterfaceRequest is the request struct for api DeactivateRouterInterface +type DeactivateRouterInterfaceRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + RouterInterfaceId string `position:"Query" name:"RouterInterfaceId"` +} + +// DeactivateRouterInterfaceResponse is the response struct for api DeactivateRouterInterface +type DeactivateRouterInterfaceResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateDeactivateRouterInterfaceRequest creates a request to invoke DeactivateRouterInterface API +func CreateDeactivateRouterInterfaceRequest() (request *DeactivateRouterInterfaceRequest) { + request = &DeactivateRouterInterfaceRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "DeactivateRouterInterface", "vpc", "openAPI") + return +} + +// CreateDeactivateRouterInterfaceResponse creates a response to parse from DeactivateRouterInterface response +func CreateDeactivateRouterInterfaceResponse() (response *DeactivateRouterInterfaceResponse) { + response = &DeactivateRouterInterfaceResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/deactive_flow_log.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/deactive_flow_log.go new file mode 100644 index 000000000..55a847ce9 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/deactive_flow_log.go @@ -0,0 +1,108 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// DeactiveFlowLog invokes the vpc.DeactiveFlowLog API synchronously +// api document: https://help.aliyun.com/api/vpc/deactiveflowlog.html +func (client *Client) DeactiveFlowLog(request *DeactiveFlowLogRequest) (response *DeactiveFlowLogResponse, err error) { + response = CreateDeactiveFlowLogResponse() + err = client.DoAction(request, response) + return +} + +// DeactiveFlowLogWithChan invokes the vpc.DeactiveFlowLog API asynchronously +// api document: https://help.aliyun.com/api/vpc/deactiveflowlog.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DeactiveFlowLogWithChan(request *DeactiveFlowLogRequest) (<-chan *DeactiveFlowLogResponse, <-chan error) { + responseChan := make(chan *DeactiveFlowLogResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DeactiveFlowLog(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DeactiveFlowLogWithCallback invokes the vpc.DeactiveFlowLog API asynchronously +// api document: https://help.aliyun.com/api/vpc/deactiveflowlog.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DeactiveFlowLogWithCallback(request *DeactiveFlowLogRequest, callback func(response *DeactiveFlowLogResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DeactiveFlowLogResponse + var err error + defer close(result) + response, err = client.DeactiveFlowLog(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DeactiveFlowLogRequest is the request struct for api DeactiveFlowLog +type DeactiveFlowLogRequest struct { + *requests.RpcRequest + 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"` + FlowLogId string `position:"Query" name:"FlowLogId"` +} + +// DeactiveFlowLogResponse is the response struct for api DeactiveFlowLog +type DeactiveFlowLogResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + Success string `json:"Success" xml:"Success"` +} + +// CreateDeactiveFlowLogRequest creates a request to invoke DeactiveFlowLog API +func CreateDeactiveFlowLogRequest() (request *DeactiveFlowLogRequest) { + request = &DeactiveFlowLogRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "DeactiveFlowLog", "vpc", "openAPI") + return +} + +// CreateDeactiveFlowLogResponse creates a response to parse from DeactiveFlowLog response +func CreateDeactiveFlowLogResponse() (response *DeactiveFlowLogResponse) { + response = &DeactiveFlowLogResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/delete_bandwidth_package.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/delete_bandwidth_package.go new file mode 100644 index 000000000..e40aa29dd --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/delete_bandwidth_package.go @@ -0,0 +1,108 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// DeleteBandwidthPackage invokes the vpc.DeleteBandwidthPackage API synchronously +// api document: https://help.aliyun.com/api/vpc/deletebandwidthpackage.html +func (client *Client) DeleteBandwidthPackage(request *DeleteBandwidthPackageRequest) (response *DeleteBandwidthPackageResponse, err error) { + response = CreateDeleteBandwidthPackageResponse() + err = client.DoAction(request, response) + return +} + +// DeleteBandwidthPackageWithChan invokes the vpc.DeleteBandwidthPackage API asynchronously +// api document: https://help.aliyun.com/api/vpc/deletebandwidthpackage.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DeleteBandwidthPackageWithChan(request *DeleteBandwidthPackageRequest) (<-chan *DeleteBandwidthPackageResponse, <-chan error) { + responseChan := make(chan *DeleteBandwidthPackageResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DeleteBandwidthPackage(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DeleteBandwidthPackageWithCallback invokes the vpc.DeleteBandwidthPackage API asynchronously +// api document: https://help.aliyun.com/api/vpc/deletebandwidthpackage.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DeleteBandwidthPackageWithCallback(request *DeleteBandwidthPackageRequest, callback func(response *DeleteBandwidthPackageResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DeleteBandwidthPackageResponse + var err error + defer close(result) + response, err = client.DeleteBandwidthPackage(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DeleteBandwidthPackageRequest is the request struct for api DeleteBandwidthPackage +type DeleteBandwidthPackageRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + BandwidthPackageId string `position:"Query" name:"BandwidthPackageId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + Force requests.Boolean `position:"Query" name:"Force"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// DeleteBandwidthPackageResponse is the response struct for api DeleteBandwidthPackage +type DeleteBandwidthPackageResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateDeleteBandwidthPackageRequest creates a request to invoke DeleteBandwidthPackage API +func CreateDeleteBandwidthPackageRequest() (request *DeleteBandwidthPackageRequest) { + request = &DeleteBandwidthPackageRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "DeleteBandwidthPackage", "vpc", "openAPI") + return +} + +// CreateDeleteBandwidthPackageResponse creates a response to parse from DeleteBandwidthPackage response +func CreateDeleteBandwidthPackageResponse() (response *DeleteBandwidthPackageResponse) { + response = &DeleteBandwidthPackageResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/delete_bgp_group.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/delete_bgp_group.go new file mode 100644 index 000000000..f8dab49ad --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/delete_bgp_group.go @@ -0,0 +1,108 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// DeleteBgpGroup invokes the vpc.DeleteBgpGroup API synchronously +// api document: https://help.aliyun.com/api/vpc/deletebgpgroup.html +func (client *Client) DeleteBgpGroup(request *DeleteBgpGroupRequest) (response *DeleteBgpGroupResponse, err error) { + response = CreateDeleteBgpGroupResponse() + err = client.DoAction(request, response) + return +} + +// DeleteBgpGroupWithChan invokes the vpc.DeleteBgpGroup API asynchronously +// api document: https://help.aliyun.com/api/vpc/deletebgpgroup.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DeleteBgpGroupWithChan(request *DeleteBgpGroupRequest) (<-chan *DeleteBgpGroupResponse, <-chan error) { + responseChan := make(chan *DeleteBgpGroupResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DeleteBgpGroup(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DeleteBgpGroupWithCallback invokes the vpc.DeleteBgpGroup API asynchronously +// api document: https://help.aliyun.com/api/vpc/deletebgpgroup.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DeleteBgpGroupWithCallback(request *DeleteBgpGroupRequest, callback func(response *DeleteBgpGroupResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DeleteBgpGroupResponse + var err error + defer close(result) + response, err = client.DeleteBgpGroup(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DeleteBgpGroupRequest is the request struct for api DeleteBgpGroup +type DeleteBgpGroupRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + ClientToken string `position:"Query" name:"ClientToken"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + BgpGroupId string `position:"Query" name:"BgpGroupId"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// DeleteBgpGroupResponse is the response struct for api DeleteBgpGroup +type DeleteBgpGroupResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateDeleteBgpGroupRequest creates a request to invoke DeleteBgpGroup API +func CreateDeleteBgpGroupRequest() (request *DeleteBgpGroupRequest) { + request = &DeleteBgpGroupRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "DeleteBgpGroup", "vpc", "openAPI") + return +} + +// CreateDeleteBgpGroupResponse creates a response to parse from DeleteBgpGroup response +func CreateDeleteBgpGroupResponse() (response *DeleteBgpGroupResponse) { + response = &DeleteBgpGroupResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/delete_bgp_network.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/delete_bgp_network.go new file mode 100644 index 000000000..09a9dfb91 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/delete_bgp_network.go @@ -0,0 +1,109 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// DeleteBgpNetwork invokes the vpc.DeleteBgpNetwork API synchronously +// api document: https://help.aliyun.com/api/vpc/deletebgpnetwork.html +func (client *Client) DeleteBgpNetwork(request *DeleteBgpNetworkRequest) (response *DeleteBgpNetworkResponse, err error) { + response = CreateDeleteBgpNetworkResponse() + err = client.DoAction(request, response) + return +} + +// DeleteBgpNetworkWithChan invokes the vpc.DeleteBgpNetwork API asynchronously +// api document: https://help.aliyun.com/api/vpc/deletebgpnetwork.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DeleteBgpNetworkWithChan(request *DeleteBgpNetworkRequest) (<-chan *DeleteBgpNetworkResponse, <-chan error) { + responseChan := make(chan *DeleteBgpNetworkResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DeleteBgpNetwork(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DeleteBgpNetworkWithCallback invokes the vpc.DeleteBgpNetwork API asynchronously +// api document: https://help.aliyun.com/api/vpc/deletebgpnetwork.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DeleteBgpNetworkWithCallback(request *DeleteBgpNetworkRequest, callback func(response *DeleteBgpNetworkResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DeleteBgpNetworkResponse + var err error + defer close(result) + response, err = client.DeleteBgpNetwork(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DeleteBgpNetworkRequest is the request struct for api DeleteBgpNetwork +type DeleteBgpNetworkRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + ClientToken string `position:"Query" name:"ClientToken"` + RouterId string `position:"Query" name:"RouterId"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + DstCidrBlock string `position:"Query" name:"DstCidrBlock"` +} + +// DeleteBgpNetworkResponse is the response struct for api DeleteBgpNetwork +type DeleteBgpNetworkResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateDeleteBgpNetworkRequest creates a request to invoke DeleteBgpNetwork API +func CreateDeleteBgpNetworkRequest() (request *DeleteBgpNetworkRequest) { + request = &DeleteBgpNetworkRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "DeleteBgpNetwork", "vpc", "openAPI") + return +} + +// CreateDeleteBgpNetworkResponse creates a response to parse from DeleteBgpNetwork response +func CreateDeleteBgpNetworkResponse() (response *DeleteBgpNetworkResponse) { + response = &DeleteBgpNetworkResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/delete_bgp_peer.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/delete_bgp_peer.go new file mode 100644 index 000000000..7899e1bbb --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/delete_bgp_peer.go @@ -0,0 +1,108 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// DeleteBgpPeer invokes the vpc.DeleteBgpPeer API synchronously +// api document: https://help.aliyun.com/api/vpc/deletebgppeer.html +func (client *Client) DeleteBgpPeer(request *DeleteBgpPeerRequest) (response *DeleteBgpPeerResponse, err error) { + response = CreateDeleteBgpPeerResponse() + err = client.DoAction(request, response) + return +} + +// DeleteBgpPeerWithChan invokes the vpc.DeleteBgpPeer API asynchronously +// api document: https://help.aliyun.com/api/vpc/deletebgppeer.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DeleteBgpPeerWithChan(request *DeleteBgpPeerRequest) (<-chan *DeleteBgpPeerResponse, <-chan error) { + responseChan := make(chan *DeleteBgpPeerResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DeleteBgpPeer(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DeleteBgpPeerWithCallback invokes the vpc.DeleteBgpPeer API asynchronously +// api document: https://help.aliyun.com/api/vpc/deletebgppeer.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DeleteBgpPeerWithCallback(request *DeleteBgpPeerRequest, callback func(response *DeleteBgpPeerResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DeleteBgpPeerResponse + var err error + defer close(result) + response, err = client.DeleteBgpPeer(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DeleteBgpPeerRequest is the request struct for api DeleteBgpPeer +type DeleteBgpPeerRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + ClientToken string `position:"Query" name:"ClientToken"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + BgpPeerId string `position:"Query" name:"BgpPeerId"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// DeleteBgpPeerResponse is the response struct for api DeleteBgpPeer +type DeleteBgpPeerResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateDeleteBgpPeerRequest creates a request to invoke DeleteBgpPeer API +func CreateDeleteBgpPeerRequest() (request *DeleteBgpPeerRequest) { + request = &DeleteBgpPeerRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "DeleteBgpPeer", "vpc", "openAPI") + return +} + +// CreateDeleteBgpPeerResponse creates a response to parse from DeleteBgpPeer response +func CreateDeleteBgpPeerResponse() (response *DeleteBgpPeerResponse) { + response = &DeleteBgpPeerResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/delete_common_bandwidth_package.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/delete_common_bandwidth_package.go new file mode 100644 index 000000000..290f540d5 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/delete_common_bandwidth_package.go @@ -0,0 +1,108 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// DeleteCommonBandwidthPackage invokes the vpc.DeleteCommonBandwidthPackage API synchronously +// api document: https://help.aliyun.com/api/vpc/deletecommonbandwidthpackage.html +func (client *Client) DeleteCommonBandwidthPackage(request *DeleteCommonBandwidthPackageRequest) (response *DeleteCommonBandwidthPackageResponse, err error) { + response = CreateDeleteCommonBandwidthPackageResponse() + err = client.DoAction(request, response) + return +} + +// DeleteCommonBandwidthPackageWithChan invokes the vpc.DeleteCommonBandwidthPackage API asynchronously +// api document: https://help.aliyun.com/api/vpc/deletecommonbandwidthpackage.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DeleteCommonBandwidthPackageWithChan(request *DeleteCommonBandwidthPackageRequest) (<-chan *DeleteCommonBandwidthPackageResponse, <-chan error) { + responseChan := make(chan *DeleteCommonBandwidthPackageResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DeleteCommonBandwidthPackage(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DeleteCommonBandwidthPackageWithCallback invokes the vpc.DeleteCommonBandwidthPackage API asynchronously +// api document: https://help.aliyun.com/api/vpc/deletecommonbandwidthpackage.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DeleteCommonBandwidthPackageWithCallback(request *DeleteCommonBandwidthPackageRequest, callback func(response *DeleteCommonBandwidthPackageResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DeleteCommonBandwidthPackageResponse + var err error + defer close(result) + response, err = client.DeleteCommonBandwidthPackage(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DeleteCommonBandwidthPackageRequest is the request struct for api DeleteCommonBandwidthPackage +type DeleteCommonBandwidthPackageRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + BandwidthPackageId string `position:"Query" name:"BandwidthPackageId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + Force string `position:"Query" name:"Force"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// DeleteCommonBandwidthPackageResponse is the response struct for api DeleteCommonBandwidthPackage +type DeleteCommonBandwidthPackageResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateDeleteCommonBandwidthPackageRequest creates a request to invoke DeleteCommonBandwidthPackage API +func CreateDeleteCommonBandwidthPackageRequest() (request *DeleteCommonBandwidthPackageRequest) { + request = &DeleteCommonBandwidthPackageRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "DeleteCommonBandwidthPackage", "vpc", "openAPI") + return +} + +// CreateDeleteCommonBandwidthPackageResponse creates a response to parse from DeleteCommonBandwidthPackage response +func CreateDeleteCommonBandwidthPackageResponse() (response *DeleteCommonBandwidthPackageResponse) { + response = &DeleteCommonBandwidthPackageResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/delete_customer_gateway.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/delete_customer_gateway.go new file mode 100644 index 000000000..9e0708b27 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/delete_customer_gateway.go @@ -0,0 +1,108 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// DeleteCustomerGateway invokes the vpc.DeleteCustomerGateway API synchronously +// api document: https://help.aliyun.com/api/vpc/deletecustomergateway.html +func (client *Client) DeleteCustomerGateway(request *DeleteCustomerGatewayRequest) (response *DeleteCustomerGatewayResponse, err error) { + response = CreateDeleteCustomerGatewayResponse() + err = client.DoAction(request, response) + return +} + +// DeleteCustomerGatewayWithChan invokes the vpc.DeleteCustomerGateway API asynchronously +// api document: https://help.aliyun.com/api/vpc/deletecustomergateway.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DeleteCustomerGatewayWithChan(request *DeleteCustomerGatewayRequest) (<-chan *DeleteCustomerGatewayResponse, <-chan error) { + responseChan := make(chan *DeleteCustomerGatewayResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DeleteCustomerGateway(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DeleteCustomerGatewayWithCallback invokes the vpc.DeleteCustomerGateway API asynchronously +// api document: https://help.aliyun.com/api/vpc/deletecustomergateway.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DeleteCustomerGatewayWithCallback(request *DeleteCustomerGatewayRequest, callback func(response *DeleteCustomerGatewayResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DeleteCustomerGatewayResponse + var err error + defer close(result) + response, err = client.DeleteCustomerGateway(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DeleteCustomerGatewayRequest is the request struct for api DeleteCustomerGateway +type DeleteCustomerGatewayRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + ClientToken string `position:"Query" name:"ClientToken"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + CustomerGatewayId string `position:"Query" name:"CustomerGatewayId"` +} + +// DeleteCustomerGatewayResponse is the response struct for api DeleteCustomerGateway +type DeleteCustomerGatewayResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateDeleteCustomerGatewayRequest creates a request to invoke DeleteCustomerGateway API +func CreateDeleteCustomerGatewayRequest() (request *DeleteCustomerGatewayRequest) { + request = &DeleteCustomerGatewayRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "DeleteCustomerGateway", "vpc", "openAPI") + return +} + +// CreateDeleteCustomerGatewayResponse creates a response to parse from DeleteCustomerGateway response +func CreateDeleteCustomerGatewayResponse() (response *DeleteCustomerGatewayResponse) { + response = &DeleteCustomerGatewayResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/delete_flow_log.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/delete_flow_log.go new file mode 100644 index 000000000..0e5e70b10 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/delete_flow_log.go @@ -0,0 +1,108 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// DeleteFlowLog invokes the vpc.DeleteFlowLog API synchronously +// api document: https://help.aliyun.com/api/vpc/deleteflowlog.html +func (client *Client) DeleteFlowLog(request *DeleteFlowLogRequest) (response *DeleteFlowLogResponse, err error) { + response = CreateDeleteFlowLogResponse() + err = client.DoAction(request, response) + return +} + +// DeleteFlowLogWithChan invokes the vpc.DeleteFlowLog API asynchronously +// api document: https://help.aliyun.com/api/vpc/deleteflowlog.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DeleteFlowLogWithChan(request *DeleteFlowLogRequest) (<-chan *DeleteFlowLogResponse, <-chan error) { + responseChan := make(chan *DeleteFlowLogResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DeleteFlowLog(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DeleteFlowLogWithCallback invokes the vpc.DeleteFlowLog API asynchronously +// api document: https://help.aliyun.com/api/vpc/deleteflowlog.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DeleteFlowLogWithCallback(request *DeleteFlowLogRequest, callback func(response *DeleteFlowLogResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DeleteFlowLogResponse + var err error + defer close(result) + response, err = client.DeleteFlowLog(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DeleteFlowLogRequest is the request struct for api DeleteFlowLog +type DeleteFlowLogRequest struct { + *requests.RpcRequest + 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"` + FlowLogId string `position:"Query" name:"FlowLogId"` +} + +// DeleteFlowLogResponse is the response struct for api DeleteFlowLog +type DeleteFlowLogResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + Success string `json:"Success" xml:"Success"` +} + +// CreateDeleteFlowLogRequest creates a request to invoke DeleteFlowLog API +func CreateDeleteFlowLogRequest() (request *DeleteFlowLogRequest) { + request = &DeleteFlowLogRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "DeleteFlowLog", "vpc", "openAPI") + return +} + +// CreateDeleteFlowLogResponse creates a response to parse from DeleteFlowLog response +func CreateDeleteFlowLogResponse() (response *DeleteFlowLogResponse) { + response = &DeleteFlowLogResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/delete_forward_entry.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/delete_forward_entry.go new file mode 100644 index 000000000..bae43065e --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/delete_forward_entry.go @@ -0,0 +1,108 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// DeleteForwardEntry invokes the vpc.DeleteForwardEntry API synchronously +// api document: https://help.aliyun.com/api/vpc/deleteforwardentry.html +func (client *Client) DeleteForwardEntry(request *DeleteForwardEntryRequest) (response *DeleteForwardEntryResponse, err error) { + response = CreateDeleteForwardEntryResponse() + err = client.DoAction(request, response) + return +} + +// DeleteForwardEntryWithChan invokes the vpc.DeleteForwardEntry API asynchronously +// api document: https://help.aliyun.com/api/vpc/deleteforwardentry.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DeleteForwardEntryWithChan(request *DeleteForwardEntryRequest) (<-chan *DeleteForwardEntryResponse, <-chan error) { + responseChan := make(chan *DeleteForwardEntryResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DeleteForwardEntry(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DeleteForwardEntryWithCallback invokes the vpc.DeleteForwardEntry API asynchronously +// api document: https://help.aliyun.com/api/vpc/deleteforwardentry.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DeleteForwardEntryWithCallback(request *DeleteForwardEntryRequest, callback func(response *DeleteForwardEntryResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DeleteForwardEntryResponse + var err error + defer close(result) + response, err = client.DeleteForwardEntry(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DeleteForwardEntryRequest is the request struct for api DeleteForwardEntry +type DeleteForwardEntryRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + ForwardEntryId string `position:"Query" name:"ForwardEntryId"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + ForwardTableId string `position:"Query" name:"ForwardTableId"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// DeleteForwardEntryResponse is the response struct for api DeleteForwardEntry +type DeleteForwardEntryResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateDeleteForwardEntryRequest creates a request to invoke DeleteForwardEntry API +func CreateDeleteForwardEntryRequest() (request *DeleteForwardEntryRequest) { + request = &DeleteForwardEntryRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "DeleteForwardEntry", "vpc", "openAPI") + return +} + +// CreateDeleteForwardEntryResponse creates a response to parse from DeleteForwardEntry response +func CreateDeleteForwardEntryResponse() (response *DeleteForwardEntryResponse) { + response = &DeleteForwardEntryResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/delete_global_acceleration_instance.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/delete_global_acceleration_instance.go new file mode 100644 index 000000000..d9b30b67d --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/delete_global_acceleration_instance.go @@ -0,0 +1,107 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// DeleteGlobalAccelerationInstance invokes the vpc.DeleteGlobalAccelerationInstance API synchronously +// api document: https://help.aliyun.com/api/vpc/deleteglobalaccelerationinstance.html +func (client *Client) DeleteGlobalAccelerationInstance(request *DeleteGlobalAccelerationInstanceRequest) (response *DeleteGlobalAccelerationInstanceResponse, err error) { + response = CreateDeleteGlobalAccelerationInstanceResponse() + err = client.DoAction(request, response) + return +} + +// DeleteGlobalAccelerationInstanceWithChan invokes the vpc.DeleteGlobalAccelerationInstance API asynchronously +// api document: https://help.aliyun.com/api/vpc/deleteglobalaccelerationinstance.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DeleteGlobalAccelerationInstanceWithChan(request *DeleteGlobalAccelerationInstanceRequest) (<-chan *DeleteGlobalAccelerationInstanceResponse, <-chan error) { + responseChan := make(chan *DeleteGlobalAccelerationInstanceResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DeleteGlobalAccelerationInstance(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DeleteGlobalAccelerationInstanceWithCallback invokes the vpc.DeleteGlobalAccelerationInstance API asynchronously +// api document: https://help.aliyun.com/api/vpc/deleteglobalaccelerationinstance.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DeleteGlobalAccelerationInstanceWithCallback(request *DeleteGlobalAccelerationInstanceRequest, callback func(response *DeleteGlobalAccelerationInstanceResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DeleteGlobalAccelerationInstanceResponse + var err error + defer close(result) + response, err = client.DeleteGlobalAccelerationInstance(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DeleteGlobalAccelerationInstanceRequest is the request struct for api DeleteGlobalAccelerationInstance +type DeleteGlobalAccelerationInstanceRequest struct { + *requests.RpcRequest + 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"` + GlobalAccelerationInstanceId string `position:"Query" name:"GlobalAccelerationInstanceId"` +} + +// DeleteGlobalAccelerationInstanceResponse is the response struct for api DeleteGlobalAccelerationInstance +type DeleteGlobalAccelerationInstanceResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateDeleteGlobalAccelerationInstanceRequest creates a request to invoke DeleteGlobalAccelerationInstance API +func CreateDeleteGlobalAccelerationInstanceRequest() (request *DeleteGlobalAccelerationInstanceRequest) { + request = &DeleteGlobalAccelerationInstanceRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "DeleteGlobalAccelerationInstance", "vpc", "openAPI") + return +} + +// CreateDeleteGlobalAccelerationInstanceResponse creates a response to parse from DeleteGlobalAccelerationInstance response +func CreateDeleteGlobalAccelerationInstanceResponse() (response *DeleteGlobalAccelerationInstanceResponse) { + response = &DeleteGlobalAccelerationInstanceResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/delete_ha_vip.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/delete_ha_vip.go new file mode 100644 index 000000000..7fa3ef7f1 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/delete_ha_vip.go @@ -0,0 +1,108 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// DeleteHaVip invokes the vpc.DeleteHaVip API synchronously +// api document: https://help.aliyun.com/api/vpc/deletehavip.html +func (client *Client) DeleteHaVip(request *DeleteHaVipRequest) (response *DeleteHaVipResponse, err error) { + response = CreateDeleteHaVipResponse() + err = client.DoAction(request, response) + return +} + +// DeleteHaVipWithChan invokes the vpc.DeleteHaVip API asynchronously +// api document: https://help.aliyun.com/api/vpc/deletehavip.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DeleteHaVipWithChan(request *DeleteHaVipRequest) (<-chan *DeleteHaVipResponse, <-chan error) { + responseChan := make(chan *DeleteHaVipResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DeleteHaVip(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DeleteHaVipWithCallback invokes the vpc.DeleteHaVip API asynchronously +// api document: https://help.aliyun.com/api/vpc/deletehavip.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DeleteHaVipWithCallback(request *DeleteHaVipRequest, callback func(response *DeleteHaVipResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DeleteHaVipResponse + var err error + defer close(result) + response, err = client.DeleteHaVip(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DeleteHaVipRequest is the request struct for api DeleteHaVip +type DeleteHaVipRequest struct { + *requests.RpcRequest + HaVipId string `position:"Query" name:"HaVipId"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + ClientToken string `position:"Query" name:"ClientToken"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// DeleteHaVipResponse is the response struct for api DeleteHaVip +type DeleteHaVipResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateDeleteHaVipRequest creates a request to invoke DeleteHaVip API +func CreateDeleteHaVipRequest() (request *DeleteHaVipRequest) { + request = &DeleteHaVipRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "DeleteHaVip", "vpc", "openAPI") + return +} + +// CreateDeleteHaVipResponse creates a response to parse from DeleteHaVip response +func CreateDeleteHaVipResponse() (response *DeleteHaVipResponse) { + response = &DeleteHaVipResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/delete_i_pv6_translator.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/delete_i_pv6_translator.go new file mode 100644 index 000000000..73bbe5491 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/delete_i_pv6_translator.go @@ -0,0 +1,108 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// DeleteIPv6Translator invokes the vpc.DeleteIPv6Translator API synchronously +// api document: https://help.aliyun.com/api/vpc/deleteipv6translator.html +func (client *Client) DeleteIPv6Translator(request *DeleteIPv6TranslatorRequest) (response *DeleteIPv6TranslatorResponse, err error) { + response = CreateDeleteIPv6TranslatorResponse() + err = client.DoAction(request, response) + return +} + +// DeleteIPv6TranslatorWithChan invokes the vpc.DeleteIPv6Translator API asynchronously +// api document: https://help.aliyun.com/api/vpc/deleteipv6translator.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DeleteIPv6TranslatorWithChan(request *DeleteIPv6TranslatorRequest) (<-chan *DeleteIPv6TranslatorResponse, <-chan error) { + responseChan := make(chan *DeleteIPv6TranslatorResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DeleteIPv6Translator(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DeleteIPv6TranslatorWithCallback invokes the vpc.DeleteIPv6Translator API asynchronously +// api document: https://help.aliyun.com/api/vpc/deleteipv6translator.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DeleteIPv6TranslatorWithCallback(request *DeleteIPv6TranslatorRequest, callback func(response *DeleteIPv6TranslatorResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DeleteIPv6TranslatorResponse + var err error + defer close(result) + response, err = client.DeleteIPv6Translator(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DeleteIPv6TranslatorRequest is the request struct for api DeleteIPv6Translator +type DeleteIPv6TranslatorRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + ClientToken string `position:"Query" name:"ClientToken"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + Ipv6TranslatorId string `position:"Query" name:"Ipv6TranslatorId"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// DeleteIPv6TranslatorResponse is the response struct for api DeleteIPv6Translator +type DeleteIPv6TranslatorResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateDeleteIPv6TranslatorRequest creates a request to invoke DeleteIPv6Translator API +func CreateDeleteIPv6TranslatorRequest() (request *DeleteIPv6TranslatorRequest) { + request = &DeleteIPv6TranslatorRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "DeleteIPv6Translator", "vpc", "openAPI") + return +} + +// CreateDeleteIPv6TranslatorResponse creates a response to parse from DeleteIPv6Translator response +func CreateDeleteIPv6TranslatorResponse() (response *DeleteIPv6TranslatorResponse) { + response = &DeleteIPv6TranslatorResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/delete_i_pv6_translator_acl_list.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/delete_i_pv6_translator_acl_list.go new file mode 100644 index 000000000..bc3914e3a --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/delete_i_pv6_translator_acl_list.go @@ -0,0 +1,108 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// DeleteIPv6TranslatorAclList invokes the vpc.DeleteIPv6TranslatorAclList API synchronously +// api document: https://help.aliyun.com/api/vpc/deleteipv6translatoracllist.html +func (client *Client) DeleteIPv6TranslatorAclList(request *DeleteIPv6TranslatorAclListRequest) (response *DeleteIPv6TranslatorAclListResponse, err error) { + response = CreateDeleteIPv6TranslatorAclListResponse() + err = client.DoAction(request, response) + return +} + +// DeleteIPv6TranslatorAclListWithChan invokes the vpc.DeleteIPv6TranslatorAclList API asynchronously +// api document: https://help.aliyun.com/api/vpc/deleteipv6translatoracllist.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DeleteIPv6TranslatorAclListWithChan(request *DeleteIPv6TranslatorAclListRequest) (<-chan *DeleteIPv6TranslatorAclListResponse, <-chan error) { + responseChan := make(chan *DeleteIPv6TranslatorAclListResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DeleteIPv6TranslatorAclList(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DeleteIPv6TranslatorAclListWithCallback invokes the vpc.DeleteIPv6TranslatorAclList API asynchronously +// api document: https://help.aliyun.com/api/vpc/deleteipv6translatoracllist.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DeleteIPv6TranslatorAclListWithCallback(request *DeleteIPv6TranslatorAclListRequest, callback func(response *DeleteIPv6TranslatorAclListResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DeleteIPv6TranslatorAclListResponse + var err error + defer close(result) + response, err = client.DeleteIPv6TranslatorAclList(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DeleteIPv6TranslatorAclListRequest is the request struct for api DeleteIPv6TranslatorAclList +type DeleteIPv6TranslatorAclListRequest struct { + *requests.RpcRequest + AclId string `position:"Query" name:"AclId"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + ClientToken string `position:"Query" name:"ClientToken"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// DeleteIPv6TranslatorAclListResponse is the response struct for api DeleteIPv6TranslatorAclList +type DeleteIPv6TranslatorAclListResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateDeleteIPv6TranslatorAclListRequest creates a request to invoke DeleteIPv6TranslatorAclList API +func CreateDeleteIPv6TranslatorAclListRequest() (request *DeleteIPv6TranslatorAclListRequest) { + request = &DeleteIPv6TranslatorAclListRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "DeleteIPv6TranslatorAclList", "vpc", "openAPI") + return +} + +// CreateDeleteIPv6TranslatorAclListResponse creates a response to parse from DeleteIPv6TranslatorAclList response +func CreateDeleteIPv6TranslatorAclListResponse() (response *DeleteIPv6TranslatorAclListResponse) { + response = &DeleteIPv6TranslatorAclListResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/delete_i_pv6_translator_entry.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/delete_i_pv6_translator_entry.go new file mode 100644 index 000000000..a2bb24d76 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/delete_i_pv6_translator_entry.go @@ -0,0 +1,109 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// DeleteIPv6TranslatorEntry invokes the vpc.DeleteIPv6TranslatorEntry API synchronously +// api document: https://help.aliyun.com/api/vpc/deleteipv6translatorentry.html +func (client *Client) DeleteIPv6TranslatorEntry(request *DeleteIPv6TranslatorEntryRequest) (response *DeleteIPv6TranslatorEntryResponse, err error) { + response = CreateDeleteIPv6TranslatorEntryResponse() + err = client.DoAction(request, response) + return +} + +// DeleteIPv6TranslatorEntryWithChan invokes the vpc.DeleteIPv6TranslatorEntry API asynchronously +// api document: https://help.aliyun.com/api/vpc/deleteipv6translatorentry.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DeleteIPv6TranslatorEntryWithChan(request *DeleteIPv6TranslatorEntryRequest) (<-chan *DeleteIPv6TranslatorEntryResponse, <-chan error) { + responseChan := make(chan *DeleteIPv6TranslatorEntryResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DeleteIPv6TranslatorEntry(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DeleteIPv6TranslatorEntryWithCallback invokes the vpc.DeleteIPv6TranslatorEntry API asynchronously +// api document: https://help.aliyun.com/api/vpc/deleteipv6translatorentry.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DeleteIPv6TranslatorEntryWithCallback(request *DeleteIPv6TranslatorEntryRequest, callback func(response *DeleteIPv6TranslatorEntryResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DeleteIPv6TranslatorEntryResponse + var err error + defer close(result) + response, err = client.DeleteIPv6TranslatorEntry(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DeleteIPv6TranslatorEntryRequest is the request struct for api DeleteIPv6TranslatorEntry +type DeleteIPv6TranslatorEntryRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + Ipv6TranslatorEntryId string `position:"Query" name:"Ipv6TranslatorEntryId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + ClientToken string `position:"Query" name:"ClientToken"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + Ipv6TranslatorId string `position:"Query" name:"Ipv6TranslatorId"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// DeleteIPv6TranslatorEntryResponse is the response struct for api DeleteIPv6TranslatorEntry +type DeleteIPv6TranslatorEntryResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateDeleteIPv6TranslatorEntryRequest creates a request to invoke DeleteIPv6TranslatorEntry API +func CreateDeleteIPv6TranslatorEntryRequest() (request *DeleteIPv6TranslatorEntryRequest) { + request = &DeleteIPv6TranslatorEntryRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "DeleteIPv6TranslatorEntry", "vpc", "openAPI") + return +} + +// CreateDeleteIPv6TranslatorEntryResponse creates a response to parse from DeleteIPv6TranslatorEntry response +func CreateDeleteIPv6TranslatorEntryResponse() (response *DeleteIPv6TranslatorEntryResponse) { + response = &DeleteIPv6TranslatorEntryResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/delete_ipv6_egress_only_rule.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/delete_ipv6_egress_only_rule.go new file mode 100644 index 000000000..4af702767 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/delete_ipv6_egress_only_rule.go @@ -0,0 +1,108 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// DeleteIpv6EgressOnlyRule invokes the vpc.DeleteIpv6EgressOnlyRule API synchronously +// api document: https://help.aliyun.com/api/vpc/deleteipv6egressonlyrule.html +func (client *Client) DeleteIpv6EgressOnlyRule(request *DeleteIpv6EgressOnlyRuleRequest) (response *DeleteIpv6EgressOnlyRuleResponse, err error) { + response = CreateDeleteIpv6EgressOnlyRuleResponse() + err = client.DoAction(request, response) + return +} + +// DeleteIpv6EgressOnlyRuleWithChan invokes the vpc.DeleteIpv6EgressOnlyRule API asynchronously +// api document: https://help.aliyun.com/api/vpc/deleteipv6egressonlyrule.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DeleteIpv6EgressOnlyRuleWithChan(request *DeleteIpv6EgressOnlyRuleRequest) (<-chan *DeleteIpv6EgressOnlyRuleResponse, <-chan error) { + responseChan := make(chan *DeleteIpv6EgressOnlyRuleResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DeleteIpv6EgressOnlyRule(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DeleteIpv6EgressOnlyRuleWithCallback invokes the vpc.DeleteIpv6EgressOnlyRule API asynchronously +// api document: https://help.aliyun.com/api/vpc/deleteipv6egressonlyrule.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DeleteIpv6EgressOnlyRuleWithCallback(request *DeleteIpv6EgressOnlyRuleRequest, callback func(response *DeleteIpv6EgressOnlyRuleResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DeleteIpv6EgressOnlyRuleResponse + var err error + defer close(result) + response, err = client.DeleteIpv6EgressOnlyRule(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DeleteIpv6EgressOnlyRuleRequest is the request struct for api DeleteIpv6EgressOnlyRule +type DeleteIpv6EgressOnlyRuleRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ClientToken string `position:"Query" name:"ClientToken"` + Ipv6EgressOnlyRuleId string `position:"Query" name:"Ipv6EgressOnlyRuleId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// DeleteIpv6EgressOnlyRuleResponse is the response struct for api DeleteIpv6EgressOnlyRule +type DeleteIpv6EgressOnlyRuleResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateDeleteIpv6EgressOnlyRuleRequest creates a request to invoke DeleteIpv6EgressOnlyRule API +func CreateDeleteIpv6EgressOnlyRuleRequest() (request *DeleteIpv6EgressOnlyRuleRequest) { + request = &DeleteIpv6EgressOnlyRuleRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "DeleteIpv6EgressOnlyRule", "vpc", "openAPI") + return +} + +// CreateDeleteIpv6EgressOnlyRuleResponse creates a response to parse from DeleteIpv6EgressOnlyRule response +func CreateDeleteIpv6EgressOnlyRuleResponse() (response *DeleteIpv6EgressOnlyRuleResponse) { + response = &DeleteIpv6EgressOnlyRuleResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/delete_ipv6_gateway.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/delete_ipv6_gateway.go new file mode 100644 index 000000000..78323a735 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/delete_ipv6_gateway.go @@ -0,0 +1,107 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// DeleteIpv6Gateway invokes the vpc.DeleteIpv6Gateway API synchronously +// api document: https://help.aliyun.com/api/vpc/deleteipv6gateway.html +func (client *Client) DeleteIpv6Gateway(request *DeleteIpv6GatewayRequest) (response *DeleteIpv6GatewayResponse, err error) { + response = CreateDeleteIpv6GatewayResponse() + err = client.DoAction(request, response) + return +} + +// DeleteIpv6GatewayWithChan invokes the vpc.DeleteIpv6Gateway API asynchronously +// api document: https://help.aliyun.com/api/vpc/deleteipv6gateway.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DeleteIpv6GatewayWithChan(request *DeleteIpv6GatewayRequest) (<-chan *DeleteIpv6GatewayResponse, <-chan error) { + responseChan := make(chan *DeleteIpv6GatewayResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DeleteIpv6Gateway(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DeleteIpv6GatewayWithCallback invokes the vpc.DeleteIpv6Gateway API asynchronously +// api document: https://help.aliyun.com/api/vpc/deleteipv6gateway.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DeleteIpv6GatewayWithCallback(request *DeleteIpv6GatewayRequest, callback func(response *DeleteIpv6GatewayResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DeleteIpv6GatewayResponse + var err error + defer close(result) + response, err = client.DeleteIpv6Gateway(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DeleteIpv6GatewayRequest is the request struct for api DeleteIpv6Gateway +type DeleteIpv6GatewayRequest struct { + *requests.RpcRequest + 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"` + Ipv6GatewayId string `position:"Query" name:"Ipv6GatewayId"` +} + +// DeleteIpv6GatewayResponse is the response struct for api DeleteIpv6Gateway +type DeleteIpv6GatewayResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateDeleteIpv6GatewayRequest creates a request to invoke DeleteIpv6Gateway API +func CreateDeleteIpv6GatewayRequest() (request *DeleteIpv6GatewayRequest) { + request = &DeleteIpv6GatewayRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "DeleteIpv6Gateway", "vpc", "openAPI") + return +} + +// CreateDeleteIpv6GatewayResponse creates a response to parse from DeleteIpv6Gateway response +func CreateDeleteIpv6GatewayResponse() (response *DeleteIpv6GatewayResponse) { + response = &DeleteIpv6GatewayResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/delete_ipv6_internet_bandwidth.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/delete_ipv6_internet_bandwidth.go new file mode 100644 index 000000000..da439f3d7 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/delete_ipv6_internet_bandwidth.go @@ -0,0 +1,108 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// DeleteIpv6InternetBandwidth invokes the vpc.DeleteIpv6InternetBandwidth API synchronously +// api document: https://help.aliyun.com/api/vpc/deleteipv6internetbandwidth.html +func (client *Client) DeleteIpv6InternetBandwidth(request *DeleteIpv6InternetBandwidthRequest) (response *DeleteIpv6InternetBandwidthResponse, err error) { + response = CreateDeleteIpv6InternetBandwidthResponse() + err = client.DoAction(request, response) + return +} + +// DeleteIpv6InternetBandwidthWithChan invokes the vpc.DeleteIpv6InternetBandwidth API asynchronously +// api document: https://help.aliyun.com/api/vpc/deleteipv6internetbandwidth.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DeleteIpv6InternetBandwidthWithChan(request *DeleteIpv6InternetBandwidthRequest) (<-chan *DeleteIpv6InternetBandwidthResponse, <-chan error) { + responseChan := make(chan *DeleteIpv6InternetBandwidthResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DeleteIpv6InternetBandwidth(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DeleteIpv6InternetBandwidthWithCallback invokes the vpc.DeleteIpv6InternetBandwidth API asynchronously +// api document: https://help.aliyun.com/api/vpc/deleteipv6internetbandwidth.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DeleteIpv6InternetBandwidthWithCallback(request *DeleteIpv6InternetBandwidthRequest, callback func(response *DeleteIpv6InternetBandwidthResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DeleteIpv6InternetBandwidthResponse + var err error + defer close(result) + response, err = client.DeleteIpv6InternetBandwidth(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DeleteIpv6InternetBandwidthRequest is the request struct for api DeleteIpv6InternetBandwidth +type DeleteIpv6InternetBandwidthRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + Ipv6InternetBandwidthId string `position:"Query" name:"Ipv6InternetBandwidthId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + Ipv6AddressId string `position:"Query" name:"Ipv6AddressId"` +} + +// DeleteIpv6InternetBandwidthResponse is the response struct for api DeleteIpv6InternetBandwidth +type DeleteIpv6InternetBandwidthResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateDeleteIpv6InternetBandwidthRequest creates a request to invoke DeleteIpv6InternetBandwidth API +func CreateDeleteIpv6InternetBandwidthRequest() (request *DeleteIpv6InternetBandwidthRequest) { + request = &DeleteIpv6InternetBandwidthRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "DeleteIpv6InternetBandwidth", "vpc", "openAPI") + return +} + +// CreateDeleteIpv6InternetBandwidthResponse creates a response to parse from DeleteIpv6InternetBandwidth response +func CreateDeleteIpv6InternetBandwidthResponse() (response *DeleteIpv6InternetBandwidthResponse) { + response = &DeleteIpv6InternetBandwidthResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/delete_nat_gateway.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/delete_nat_gateway.go new file mode 100644 index 000000000..f0a797b67 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/delete_nat_gateway.go @@ -0,0 +1,108 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// DeleteNatGateway invokes the vpc.DeleteNatGateway API synchronously +// api document: https://help.aliyun.com/api/vpc/deletenatgateway.html +func (client *Client) DeleteNatGateway(request *DeleteNatGatewayRequest) (response *DeleteNatGatewayResponse, err error) { + response = CreateDeleteNatGatewayResponse() + err = client.DoAction(request, response) + return +} + +// DeleteNatGatewayWithChan invokes the vpc.DeleteNatGateway API asynchronously +// api document: https://help.aliyun.com/api/vpc/deletenatgateway.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DeleteNatGatewayWithChan(request *DeleteNatGatewayRequest) (<-chan *DeleteNatGatewayResponse, <-chan error) { + responseChan := make(chan *DeleteNatGatewayResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DeleteNatGateway(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DeleteNatGatewayWithCallback invokes the vpc.DeleteNatGateway API asynchronously +// api document: https://help.aliyun.com/api/vpc/deletenatgateway.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DeleteNatGatewayWithCallback(request *DeleteNatGatewayRequest, callback func(response *DeleteNatGatewayResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DeleteNatGatewayResponse + var err error + defer close(result) + response, err = client.DeleteNatGateway(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DeleteNatGatewayRequest is the request struct for api DeleteNatGateway +type DeleteNatGatewayRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + Force requests.Boolean `position:"Query" name:"Force"` + NatGatewayId string `position:"Query" name:"NatGatewayId"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// DeleteNatGatewayResponse is the response struct for api DeleteNatGateway +type DeleteNatGatewayResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateDeleteNatGatewayRequest creates a request to invoke DeleteNatGateway API +func CreateDeleteNatGatewayRequest() (request *DeleteNatGatewayRequest) { + request = &DeleteNatGatewayRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "DeleteNatGateway", "vpc", "openAPI") + return +} + +// CreateDeleteNatGatewayResponse creates a response to parse from DeleteNatGateway response +func CreateDeleteNatGatewayResponse() (response *DeleteNatGatewayResponse) { + response = &DeleteNatGatewayResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/delete_nqa.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/delete_nqa.go new file mode 100644 index 000000000..bf373f29a --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/delete_nqa.go @@ -0,0 +1,108 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// DeleteNqa invokes the vpc.DeleteNqa API synchronously +// api document: https://help.aliyun.com/api/vpc/deletenqa.html +func (client *Client) DeleteNqa(request *DeleteNqaRequest) (response *DeleteNqaResponse, err error) { + response = CreateDeleteNqaResponse() + err = client.DoAction(request, response) + return +} + +// DeleteNqaWithChan invokes the vpc.DeleteNqa API asynchronously +// api document: https://help.aliyun.com/api/vpc/deletenqa.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DeleteNqaWithChan(request *DeleteNqaRequest) (<-chan *DeleteNqaResponse, <-chan error) { + responseChan := make(chan *DeleteNqaResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DeleteNqa(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DeleteNqaWithCallback invokes the vpc.DeleteNqa API asynchronously +// api document: https://help.aliyun.com/api/vpc/deletenqa.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DeleteNqaWithCallback(request *DeleteNqaRequest, callback func(response *DeleteNqaResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DeleteNqaResponse + var err error + defer close(result) + response, err = client.DeleteNqa(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DeleteNqaRequest is the request struct for api DeleteNqa +type DeleteNqaRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + ClientToken string `position:"Query" name:"ClientToken"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + NqaId string `position:"Query" name:"NqaId"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// DeleteNqaResponse is the response struct for api DeleteNqa +type DeleteNqaResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateDeleteNqaRequest creates a request to invoke DeleteNqa API +func CreateDeleteNqaRequest() (request *DeleteNqaRequest) { + request = &DeleteNqaRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "DeleteNqa", "vpc", "openAPI") + return +} + +// CreateDeleteNqaResponse creates a response to parse from DeleteNqa response +func CreateDeleteNqaResponse() (response *DeleteNqaResponse) { + response = &DeleteNqaResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/delete_physical_connection.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/delete_physical_connection.go new file mode 100644 index 000000000..de48af876 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/delete_physical_connection.go @@ -0,0 +1,109 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// DeletePhysicalConnection invokes the vpc.DeletePhysicalConnection API synchronously +// api document: https://help.aliyun.com/api/vpc/deletephysicalconnection.html +func (client *Client) DeletePhysicalConnection(request *DeletePhysicalConnectionRequest) (response *DeletePhysicalConnectionResponse, err error) { + response = CreateDeletePhysicalConnectionResponse() + err = client.DoAction(request, response) + return +} + +// DeletePhysicalConnectionWithChan invokes the vpc.DeletePhysicalConnection API asynchronously +// api document: https://help.aliyun.com/api/vpc/deletephysicalconnection.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DeletePhysicalConnectionWithChan(request *DeletePhysicalConnectionRequest) (<-chan *DeletePhysicalConnectionResponse, <-chan error) { + responseChan := make(chan *DeletePhysicalConnectionResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DeletePhysicalConnection(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DeletePhysicalConnectionWithCallback invokes the vpc.DeletePhysicalConnection API asynchronously +// api document: https://help.aliyun.com/api/vpc/deletephysicalconnection.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DeletePhysicalConnectionWithCallback(request *DeletePhysicalConnectionRequest, callback func(response *DeletePhysicalConnectionResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DeletePhysicalConnectionResponse + var err error + defer close(result) + response, err = client.DeletePhysicalConnection(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DeletePhysicalConnectionRequest is the request struct for api DeletePhysicalConnection +type DeletePhysicalConnectionRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + ClientToken string `position:"Query" name:"ClientToken"` + PhysicalConnectionId string `position:"Query" name:"PhysicalConnectionId"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + UserCidr string `position:"Query" name:"UserCidr"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// DeletePhysicalConnectionResponse is the response struct for api DeletePhysicalConnection +type DeletePhysicalConnectionResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateDeletePhysicalConnectionRequest creates a request to invoke DeletePhysicalConnection API +func CreateDeletePhysicalConnectionRequest() (request *DeletePhysicalConnectionRequest) { + request = &DeletePhysicalConnectionRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "DeletePhysicalConnection", "vpc", "openAPI") + return +} + +// CreateDeletePhysicalConnectionResponse creates a response to parse from DeletePhysicalConnection response +func CreateDeletePhysicalConnectionResponse() (response *DeletePhysicalConnectionResponse) { + response = &DeletePhysicalConnectionResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/delete_route_entry.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/delete_route_entry.go new file mode 100644 index 000000000..3d93bc575 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/delete_route_entry.go @@ -0,0 +1,117 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// DeleteRouteEntry invokes the vpc.DeleteRouteEntry API synchronously +// api document: https://help.aliyun.com/api/vpc/deleterouteentry.html +func (client *Client) DeleteRouteEntry(request *DeleteRouteEntryRequest) (response *DeleteRouteEntryResponse, err error) { + response = CreateDeleteRouteEntryResponse() + err = client.DoAction(request, response) + return +} + +// DeleteRouteEntryWithChan invokes the vpc.DeleteRouteEntry API asynchronously +// api document: https://help.aliyun.com/api/vpc/deleterouteentry.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DeleteRouteEntryWithChan(request *DeleteRouteEntryRequest) (<-chan *DeleteRouteEntryResponse, <-chan error) { + responseChan := make(chan *DeleteRouteEntryResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DeleteRouteEntry(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DeleteRouteEntryWithCallback invokes the vpc.DeleteRouteEntry API asynchronously +// api document: https://help.aliyun.com/api/vpc/deleterouteentry.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DeleteRouteEntryWithCallback(request *DeleteRouteEntryRequest, callback func(response *DeleteRouteEntryResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DeleteRouteEntryResponse + var err error + defer close(result) + response, err = client.DeleteRouteEntry(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DeleteRouteEntryRequest is the request struct for api DeleteRouteEntry +type DeleteRouteEntryRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + RouteEntryId string `position:"Query" name:"RouteEntryId"` + DestinationCidrBlock string `position:"Query" name:"DestinationCidrBlock"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + NextHopId string `position:"Query" name:"NextHopId"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + NextHopList *[]DeleteRouteEntryNextHopList `position:"Query" name:"NextHopList" type:"Repeated"` + RouteTableId string `position:"Query" name:"RouteTableId"` +} + +// DeleteRouteEntryNextHopList is a repeated param struct in DeleteRouteEntryRequest +type DeleteRouteEntryNextHopList struct { + NextHopId string `name:"NextHopId"` + NextHopType string `name:"NextHopType"` +} + +// DeleteRouteEntryResponse is the response struct for api DeleteRouteEntry +type DeleteRouteEntryResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateDeleteRouteEntryRequest creates a request to invoke DeleteRouteEntry API +func CreateDeleteRouteEntryRequest() (request *DeleteRouteEntryRequest) { + request = &DeleteRouteEntryRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "DeleteRouteEntry", "vpc", "openAPI") + return +} + +// CreateDeleteRouteEntryResponse creates a response to parse from DeleteRouteEntry response +func CreateDeleteRouteEntryResponse() (response *DeleteRouteEntryResponse) { + response = &DeleteRouteEntryResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/delete_route_table.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/delete_route_table.go new file mode 100644 index 000000000..7a6b70883 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/delete_route_table.go @@ -0,0 +1,107 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// DeleteRouteTable invokes the vpc.DeleteRouteTable API synchronously +// api document: https://help.aliyun.com/api/vpc/deleteroutetable.html +func (client *Client) DeleteRouteTable(request *DeleteRouteTableRequest) (response *DeleteRouteTableResponse, err error) { + response = CreateDeleteRouteTableResponse() + err = client.DoAction(request, response) + return +} + +// DeleteRouteTableWithChan invokes the vpc.DeleteRouteTable API asynchronously +// api document: https://help.aliyun.com/api/vpc/deleteroutetable.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DeleteRouteTableWithChan(request *DeleteRouteTableRequest) (<-chan *DeleteRouteTableResponse, <-chan error) { + responseChan := make(chan *DeleteRouteTableResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DeleteRouteTable(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DeleteRouteTableWithCallback invokes the vpc.DeleteRouteTable API asynchronously +// api document: https://help.aliyun.com/api/vpc/deleteroutetable.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DeleteRouteTableWithCallback(request *DeleteRouteTableRequest, callback func(response *DeleteRouteTableResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DeleteRouteTableResponse + var err error + defer close(result) + response, err = client.DeleteRouteTable(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DeleteRouteTableRequest is the request struct for api DeleteRouteTable +type DeleteRouteTableRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + RouteTableId string `position:"Query" name:"RouteTableId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// DeleteRouteTableResponse is the response struct for api DeleteRouteTable +type DeleteRouteTableResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateDeleteRouteTableRequest creates a request to invoke DeleteRouteTable API +func CreateDeleteRouteTableRequest() (request *DeleteRouteTableRequest) { + request = &DeleteRouteTableRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "DeleteRouteTable", "vpc", "openAPI") + return +} + +// CreateDeleteRouteTableResponse creates a response to parse from DeleteRouteTable response +func CreateDeleteRouteTableResponse() (response *DeleteRouteTableResponse) { + response = &DeleteRouteTableResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/delete_router_interface.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/delete_router_interface.go new file mode 100644 index 000000000..158edc297 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/delete_router_interface.go @@ -0,0 +1,108 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// DeleteRouterInterface invokes the vpc.DeleteRouterInterface API synchronously +// api document: https://help.aliyun.com/api/vpc/deleterouterinterface.html +func (client *Client) DeleteRouterInterface(request *DeleteRouterInterfaceRequest) (response *DeleteRouterInterfaceResponse, err error) { + response = CreateDeleteRouterInterfaceResponse() + err = client.DoAction(request, response) + return +} + +// DeleteRouterInterfaceWithChan invokes the vpc.DeleteRouterInterface API asynchronously +// api document: https://help.aliyun.com/api/vpc/deleterouterinterface.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DeleteRouterInterfaceWithChan(request *DeleteRouterInterfaceRequest) (<-chan *DeleteRouterInterfaceResponse, <-chan error) { + responseChan := make(chan *DeleteRouterInterfaceResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DeleteRouterInterface(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DeleteRouterInterfaceWithCallback invokes the vpc.DeleteRouterInterface API asynchronously +// api document: https://help.aliyun.com/api/vpc/deleterouterinterface.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DeleteRouterInterfaceWithCallback(request *DeleteRouterInterfaceRequest, callback func(response *DeleteRouterInterfaceResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DeleteRouterInterfaceResponse + var err error + defer close(result) + response, err = client.DeleteRouterInterface(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DeleteRouterInterfaceRequest is the request struct for api DeleteRouterInterface +type DeleteRouterInterfaceRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + ClientToken string `position:"Query" name:"ClientToken"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + RouterInterfaceId string `position:"Query" name:"RouterInterfaceId"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// DeleteRouterInterfaceResponse is the response struct for api DeleteRouterInterface +type DeleteRouterInterfaceResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateDeleteRouterInterfaceRequest creates a request to invoke DeleteRouterInterface API +func CreateDeleteRouterInterfaceRequest() (request *DeleteRouterInterfaceRequest) { + request = &DeleteRouterInterfaceRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "DeleteRouterInterface", "vpc", "openAPI") + return +} + +// CreateDeleteRouterInterfaceResponse creates a response to parse from DeleteRouterInterface response +func CreateDeleteRouterInterfaceResponse() (response *DeleteRouterInterfaceResponse) { + response = &DeleteRouterInterfaceResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/delete_snat_entry.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/delete_snat_entry.go new file mode 100644 index 000000000..f8d5b7db0 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/delete_snat_entry.go @@ -0,0 +1,108 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// DeleteSnatEntry invokes the vpc.DeleteSnatEntry API synchronously +// api document: https://help.aliyun.com/api/vpc/deletesnatentry.html +func (client *Client) DeleteSnatEntry(request *DeleteSnatEntryRequest) (response *DeleteSnatEntryResponse, err error) { + response = CreateDeleteSnatEntryResponse() + err = client.DoAction(request, response) + return +} + +// DeleteSnatEntryWithChan invokes the vpc.DeleteSnatEntry API asynchronously +// api document: https://help.aliyun.com/api/vpc/deletesnatentry.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DeleteSnatEntryWithChan(request *DeleteSnatEntryRequest) (<-chan *DeleteSnatEntryResponse, <-chan error) { + responseChan := make(chan *DeleteSnatEntryResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DeleteSnatEntry(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DeleteSnatEntryWithCallback invokes the vpc.DeleteSnatEntry API asynchronously +// api document: https://help.aliyun.com/api/vpc/deletesnatentry.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DeleteSnatEntryWithCallback(request *DeleteSnatEntryRequest, callback func(response *DeleteSnatEntryResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DeleteSnatEntryResponse + var err error + defer close(result) + response, err = client.DeleteSnatEntry(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DeleteSnatEntryRequest is the request struct for api DeleteSnatEntry +type DeleteSnatEntryRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + SnatTableId string `position:"Query" name:"SnatTableId"` + SnatEntryId string `position:"Query" name:"SnatEntryId"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// DeleteSnatEntryResponse is the response struct for api DeleteSnatEntry +type DeleteSnatEntryResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateDeleteSnatEntryRequest creates a request to invoke DeleteSnatEntry API +func CreateDeleteSnatEntryRequest() (request *DeleteSnatEntryRequest) { + request = &DeleteSnatEntryRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "DeleteSnatEntry", "vpc", "openAPI") + return +} + +// CreateDeleteSnatEntryResponse creates a response to parse from DeleteSnatEntry response +func CreateDeleteSnatEntryResponse() (response *DeleteSnatEntryResponse) { + response = &DeleteSnatEntryResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/delete_ssl_vpn_client_cert.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/delete_ssl_vpn_client_cert.go new file mode 100644 index 000000000..d7c5622e5 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/delete_ssl_vpn_client_cert.go @@ -0,0 +1,108 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// DeleteSslVpnClientCert invokes the vpc.DeleteSslVpnClientCert API synchronously +// api document: https://help.aliyun.com/api/vpc/deletesslvpnclientcert.html +func (client *Client) DeleteSslVpnClientCert(request *DeleteSslVpnClientCertRequest) (response *DeleteSslVpnClientCertResponse, err error) { + response = CreateDeleteSslVpnClientCertResponse() + err = client.DoAction(request, response) + return +} + +// DeleteSslVpnClientCertWithChan invokes the vpc.DeleteSslVpnClientCert API asynchronously +// api document: https://help.aliyun.com/api/vpc/deletesslvpnclientcert.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DeleteSslVpnClientCertWithChan(request *DeleteSslVpnClientCertRequest) (<-chan *DeleteSslVpnClientCertResponse, <-chan error) { + responseChan := make(chan *DeleteSslVpnClientCertResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DeleteSslVpnClientCert(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DeleteSslVpnClientCertWithCallback invokes the vpc.DeleteSslVpnClientCert API asynchronously +// api document: https://help.aliyun.com/api/vpc/deletesslvpnclientcert.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DeleteSslVpnClientCertWithCallback(request *DeleteSslVpnClientCertRequest, callback func(response *DeleteSslVpnClientCertResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DeleteSslVpnClientCertResponse + var err error + defer close(result) + response, err = client.DeleteSslVpnClientCert(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DeleteSslVpnClientCertRequest is the request struct for api DeleteSslVpnClientCert +type DeleteSslVpnClientCertRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + ClientToken string `position:"Query" name:"ClientToken"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + SslVpnClientCertId string `position:"Query" name:"SslVpnClientCertId"` +} + +// DeleteSslVpnClientCertResponse is the response struct for api DeleteSslVpnClientCert +type DeleteSslVpnClientCertResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateDeleteSslVpnClientCertRequest creates a request to invoke DeleteSslVpnClientCert API +func CreateDeleteSslVpnClientCertRequest() (request *DeleteSslVpnClientCertRequest) { + request = &DeleteSslVpnClientCertRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "DeleteSslVpnClientCert", "vpc", "openAPI") + return +} + +// CreateDeleteSslVpnClientCertResponse creates a response to parse from DeleteSslVpnClientCert response +func CreateDeleteSslVpnClientCertResponse() (response *DeleteSslVpnClientCertResponse) { + response = &DeleteSslVpnClientCertResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/delete_ssl_vpn_server.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/delete_ssl_vpn_server.go new file mode 100644 index 000000000..9cf947a2a --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/delete_ssl_vpn_server.go @@ -0,0 +1,108 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// DeleteSslVpnServer invokes the vpc.DeleteSslVpnServer API synchronously +// api document: https://help.aliyun.com/api/vpc/deletesslvpnserver.html +func (client *Client) DeleteSslVpnServer(request *DeleteSslVpnServerRequest) (response *DeleteSslVpnServerResponse, err error) { + response = CreateDeleteSslVpnServerResponse() + err = client.DoAction(request, response) + return +} + +// DeleteSslVpnServerWithChan invokes the vpc.DeleteSslVpnServer API asynchronously +// api document: https://help.aliyun.com/api/vpc/deletesslvpnserver.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DeleteSslVpnServerWithChan(request *DeleteSslVpnServerRequest) (<-chan *DeleteSslVpnServerResponse, <-chan error) { + responseChan := make(chan *DeleteSslVpnServerResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DeleteSslVpnServer(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DeleteSslVpnServerWithCallback invokes the vpc.DeleteSslVpnServer API asynchronously +// api document: https://help.aliyun.com/api/vpc/deletesslvpnserver.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DeleteSslVpnServerWithCallback(request *DeleteSslVpnServerRequest, callback func(response *DeleteSslVpnServerResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DeleteSslVpnServerResponse + var err error + defer close(result) + response, err = client.DeleteSslVpnServer(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DeleteSslVpnServerRequest is the request struct for api DeleteSslVpnServer +type DeleteSslVpnServerRequest struct { + *requests.RpcRequest + SslVpnServerId string `position:"Query" name:"SslVpnServerId"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + ClientToken string `position:"Query" name:"ClientToken"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// DeleteSslVpnServerResponse is the response struct for api DeleteSslVpnServer +type DeleteSslVpnServerResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateDeleteSslVpnServerRequest creates a request to invoke DeleteSslVpnServer API +func CreateDeleteSslVpnServerRequest() (request *DeleteSslVpnServerRequest) { + request = &DeleteSslVpnServerRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "DeleteSslVpnServer", "vpc", "openAPI") + return +} + +// CreateDeleteSslVpnServerResponse creates a response to parse from DeleteSslVpnServer response +func CreateDeleteSslVpnServerResponse() (response *DeleteSslVpnServerResponse) { + response = &DeleteSslVpnServerResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/delete_v_switch.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/delete_v_switch.go new file mode 100644 index 000000000..bfd5913af --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/delete_v_switch.go @@ -0,0 +1,107 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// DeleteVSwitch invokes the vpc.DeleteVSwitch API synchronously +// api document: https://help.aliyun.com/api/vpc/deletevswitch.html +func (client *Client) DeleteVSwitch(request *DeleteVSwitchRequest) (response *DeleteVSwitchResponse, err error) { + response = CreateDeleteVSwitchResponse() + err = client.DoAction(request, response) + return +} + +// DeleteVSwitchWithChan invokes the vpc.DeleteVSwitch API asynchronously +// api document: https://help.aliyun.com/api/vpc/deletevswitch.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DeleteVSwitchWithChan(request *DeleteVSwitchRequest) (<-chan *DeleteVSwitchResponse, <-chan error) { + responseChan := make(chan *DeleteVSwitchResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DeleteVSwitch(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DeleteVSwitchWithCallback invokes the vpc.DeleteVSwitch API asynchronously +// api document: https://help.aliyun.com/api/vpc/deletevswitch.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DeleteVSwitchWithCallback(request *DeleteVSwitchRequest, callback func(response *DeleteVSwitchResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DeleteVSwitchResponse + var err error + defer close(result) + response, err = client.DeleteVSwitch(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DeleteVSwitchRequest is the request struct for api DeleteVSwitch +type DeleteVSwitchRequest struct { + *requests.RpcRequest + VSwitchId string `position:"Query" name:"VSwitchId"` + 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"` +} + +// DeleteVSwitchResponse is the response struct for api DeleteVSwitch +type DeleteVSwitchResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateDeleteVSwitchRequest creates a request to invoke DeleteVSwitch API +func CreateDeleteVSwitchRequest() (request *DeleteVSwitchRequest) { + request = &DeleteVSwitchRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "DeleteVSwitch", "vpc", "openAPI") + return +} + +// CreateDeleteVSwitchResponse creates a response to parse from DeleteVSwitch response +func CreateDeleteVSwitchResponse() (response *DeleteVSwitchResponse) { + response = &DeleteVSwitchResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/delete_virtual_border_router.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/delete_virtual_border_router.go new file mode 100644 index 000000000..33085f969 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/delete_virtual_border_router.go @@ -0,0 +1,108 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// DeleteVirtualBorderRouter invokes the vpc.DeleteVirtualBorderRouter API synchronously +// api document: https://help.aliyun.com/api/vpc/deletevirtualborderrouter.html +func (client *Client) DeleteVirtualBorderRouter(request *DeleteVirtualBorderRouterRequest) (response *DeleteVirtualBorderRouterResponse, err error) { + response = CreateDeleteVirtualBorderRouterResponse() + err = client.DoAction(request, response) + return +} + +// DeleteVirtualBorderRouterWithChan invokes the vpc.DeleteVirtualBorderRouter API asynchronously +// api document: https://help.aliyun.com/api/vpc/deletevirtualborderrouter.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DeleteVirtualBorderRouterWithChan(request *DeleteVirtualBorderRouterRequest) (<-chan *DeleteVirtualBorderRouterResponse, <-chan error) { + responseChan := make(chan *DeleteVirtualBorderRouterResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DeleteVirtualBorderRouter(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DeleteVirtualBorderRouterWithCallback invokes the vpc.DeleteVirtualBorderRouter API asynchronously +// api document: https://help.aliyun.com/api/vpc/deletevirtualborderrouter.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DeleteVirtualBorderRouterWithCallback(request *DeleteVirtualBorderRouterRequest, callback func(response *DeleteVirtualBorderRouterResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DeleteVirtualBorderRouterResponse + var err error + defer close(result) + response, err = client.DeleteVirtualBorderRouter(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DeleteVirtualBorderRouterRequest is the request struct for api DeleteVirtualBorderRouter +type DeleteVirtualBorderRouterRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + ClientToken string `position:"Query" name:"ClientToken"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + VbrId string `position:"Query" name:"VbrId"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// DeleteVirtualBorderRouterResponse is the response struct for api DeleteVirtualBorderRouter +type DeleteVirtualBorderRouterResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateDeleteVirtualBorderRouterRequest creates a request to invoke DeleteVirtualBorderRouter API +func CreateDeleteVirtualBorderRouterRequest() (request *DeleteVirtualBorderRouterRequest) { + request = &DeleteVirtualBorderRouterRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "DeleteVirtualBorderRouter", "vpc", "openAPI") + return +} + +// CreateDeleteVirtualBorderRouterResponse creates a response to parse from DeleteVirtualBorderRouter response +func CreateDeleteVirtualBorderRouterResponse() (response *DeleteVirtualBorderRouterResponse) { + response = &DeleteVirtualBorderRouterResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/delete_vpc.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/delete_vpc.go new file mode 100644 index 000000000..f922b26e8 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/delete_vpc.go @@ -0,0 +1,107 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// DeleteVpc invokes the vpc.DeleteVpc API synchronously +// api document: https://help.aliyun.com/api/vpc/deletevpc.html +func (client *Client) DeleteVpc(request *DeleteVpcRequest) (response *DeleteVpcResponse, err error) { + response = CreateDeleteVpcResponse() + err = client.DoAction(request, response) + return +} + +// DeleteVpcWithChan invokes the vpc.DeleteVpc API asynchronously +// api document: https://help.aliyun.com/api/vpc/deletevpc.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DeleteVpcWithChan(request *DeleteVpcRequest) (<-chan *DeleteVpcResponse, <-chan error) { + responseChan := make(chan *DeleteVpcResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DeleteVpc(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DeleteVpcWithCallback invokes the vpc.DeleteVpc API asynchronously +// api document: https://help.aliyun.com/api/vpc/deletevpc.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DeleteVpcWithCallback(request *DeleteVpcRequest, callback func(response *DeleteVpcResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DeleteVpcResponse + var err error + defer close(result) + response, err = client.DeleteVpc(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DeleteVpcRequest is the request struct for api DeleteVpc +type DeleteVpcRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + VpcId string `position:"Query" name:"VpcId"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// DeleteVpcResponse is the response struct for api DeleteVpc +type DeleteVpcResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateDeleteVpcRequest creates a request to invoke DeleteVpc API +func CreateDeleteVpcRequest() (request *DeleteVpcRequest) { + request = &DeleteVpcRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "DeleteVpc", "vpc", "openAPI") + return +} + +// CreateDeleteVpcResponse creates a response to parse from DeleteVpc response +func CreateDeleteVpcResponse() (response *DeleteVpcResponse) { + response = &DeleteVpcResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/delete_vpn_connection.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/delete_vpn_connection.go new file mode 100644 index 000000000..04438bee3 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/delete_vpn_connection.go @@ -0,0 +1,108 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// DeleteVpnConnection invokes the vpc.DeleteVpnConnection API synchronously +// api document: https://help.aliyun.com/api/vpc/deletevpnconnection.html +func (client *Client) DeleteVpnConnection(request *DeleteVpnConnectionRequest) (response *DeleteVpnConnectionResponse, err error) { + response = CreateDeleteVpnConnectionResponse() + err = client.DoAction(request, response) + return +} + +// DeleteVpnConnectionWithChan invokes the vpc.DeleteVpnConnection API asynchronously +// api document: https://help.aliyun.com/api/vpc/deletevpnconnection.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DeleteVpnConnectionWithChan(request *DeleteVpnConnectionRequest) (<-chan *DeleteVpnConnectionResponse, <-chan error) { + responseChan := make(chan *DeleteVpnConnectionResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DeleteVpnConnection(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DeleteVpnConnectionWithCallback invokes the vpc.DeleteVpnConnection API asynchronously +// api document: https://help.aliyun.com/api/vpc/deletevpnconnection.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DeleteVpnConnectionWithCallback(request *DeleteVpnConnectionRequest, callback func(response *DeleteVpnConnectionResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DeleteVpnConnectionResponse + var err error + defer close(result) + response, err = client.DeleteVpnConnection(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DeleteVpnConnectionRequest is the request struct for api DeleteVpnConnection +type DeleteVpnConnectionRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + ClientToken string `position:"Query" name:"ClientToken"` + VpnConnectionId string `position:"Query" name:"VpnConnectionId"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// DeleteVpnConnectionResponse is the response struct for api DeleteVpnConnection +type DeleteVpnConnectionResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateDeleteVpnConnectionRequest creates a request to invoke DeleteVpnConnection API +func CreateDeleteVpnConnectionRequest() (request *DeleteVpnConnectionRequest) { + request = &DeleteVpnConnectionRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "DeleteVpnConnection", "vpc", "openAPI") + return +} + +// CreateDeleteVpnConnectionResponse creates a response to parse from DeleteVpnConnection response +func CreateDeleteVpnConnectionResponse() (response *DeleteVpnConnectionResponse) { + response = &DeleteVpnConnectionResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/delete_vpn_gateway.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/delete_vpn_gateway.go new file mode 100644 index 000000000..7eca131bc --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/delete_vpn_gateway.go @@ -0,0 +1,108 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// DeleteVpnGateway invokes the vpc.DeleteVpnGateway API synchronously +// api document: https://help.aliyun.com/api/vpc/deletevpngateway.html +func (client *Client) DeleteVpnGateway(request *DeleteVpnGatewayRequest) (response *DeleteVpnGatewayResponse, err error) { + response = CreateDeleteVpnGatewayResponse() + err = client.DoAction(request, response) + return +} + +// DeleteVpnGatewayWithChan invokes the vpc.DeleteVpnGateway API asynchronously +// api document: https://help.aliyun.com/api/vpc/deletevpngateway.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DeleteVpnGatewayWithChan(request *DeleteVpnGatewayRequest) (<-chan *DeleteVpnGatewayResponse, <-chan error) { + responseChan := make(chan *DeleteVpnGatewayResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DeleteVpnGateway(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DeleteVpnGatewayWithCallback invokes the vpc.DeleteVpnGateway API asynchronously +// api document: https://help.aliyun.com/api/vpc/deletevpngateway.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DeleteVpnGatewayWithCallback(request *DeleteVpnGatewayRequest, callback func(response *DeleteVpnGatewayResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DeleteVpnGatewayResponse + var err error + defer close(result) + response, err = client.DeleteVpnGateway(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DeleteVpnGatewayRequest is the request struct for api DeleteVpnGateway +type DeleteVpnGatewayRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + ClientToken string `position:"Query" name:"ClientToken"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + VpnGatewayId string `position:"Query" name:"VpnGatewayId"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// DeleteVpnGatewayResponse is the response struct for api DeleteVpnGateway +type DeleteVpnGatewayResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateDeleteVpnGatewayRequest creates a request to invoke DeleteVpnGateway API +func CreateDeleteVpnGatewayRequest() (request *DeleteVpnGatewayRequest) { + request = &DeleteVpnGatewayRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "DeleteVpnGateway", "vpc", "openAPI") + return +} + +// CreateDeleteVpnGatewayResponse creates a response to parse from DeleteVpnGateway response +func CreateDeleteVpnGatewayResponse() (response *DeleteVpnGatewayResponse) { + response = &DeleteVpnGatewayResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/describe_access_points.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/describe_access_points.go new file mode 100644 index 000000000..5e60eb795 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/describe_access_points.go @@ -0,0 +1,121 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// DescribeAccessPoints invokes the vpc.DescribeAccessPoints API synchronously +// api document: https://help.aliyun.com/api/vpc/describeaccesspoints.html +func (client *Client) DescribeAccessPoints(request *DescribeAccessPointsRequest) (response *DescribeAccessPointsResponse, err error) { + response = CreateDescribeAccessPointsResponse() + err = client.DoAction(request, response) + return +} + +// DescribeAccessPointsWithChan invokes the vpc.DescribeAccessPoints API asynchronously +// api document: https://help.aliyun.com/api/vpc/describeaccesspoints.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeAccessPointsWithChan(request *DescribeAccessPointsRequest) (<-chan *DescribeAccessPointsResponse, <-chan error) { + responseChan := make(chan *DescribeAccessPointsResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DescribeAccessPoints(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DescribeAccessPointsWithCallback invokes the vpc.DescribeAccessPoints API asynchronously +// api document: https://help.aliyun.com/api/vpc/describeaccesspoints.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeAccessPointsWithCallback(request *DescribeAccessPointsRequest, callback func(response *DescribeAccessPointsResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DescribeAccessPointsResponse + var err error + defer close(result) + response, err = client.DescribeAccessPoints(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DescribeAccessPointsRequest is the request struct for api DescribeAccessPoints +type DescribeAccessPointsRequest struct { + *requests.RpcRequest + Filter *[]DescribeAccessPointsFilter `position:"Query" name:"Filter" type:"Repeated"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + HostOperator string `position:"Query" name:"HostOperator"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + Name string `position:"Query" name:"Name"` + PageSize requests.Integer `position:"Query" name:"PageSize"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + Type string `position:"Query" name:"Type"` + PageNumber requests.Integer `position:"Query" name:"PageNumber"` +} + +// DescribeAccessPointsFilter is a repeated param struct in DescribeAccessPointsRequest +type DescribeAccessPointsFilter struct { + Value *[]string `name:"Value" type:"Repeated"` + Key string `name:"Key"` +} + +// DescribeAccessPointsResponse is the response struct for api DescribeAccessPoints +type DescribeAccessPointsResponse 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"` + AccessPointSet AccessPointSet `json:"AccessPointSet" xml:"AccessPointSet"` +} + +// CreateDescribeAccessPointsRequest creates a request to invoke DescribeAccessPoints API +func CreateDescribeAccessPointsRequest() (request *DescribeAccessPointsRequest) { + request = &DescribeAccessPointsRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "DescribeAccessPoints", "vpc", "openAPI") + return +} + +// CreateDescribeAccessPointsResponse creates a response to parse from DescribeAccessPoints response +func CreateDescribeAccessPointsResponse() (response *DescribeAccessPointsResponse) { + response = &DescribeAccessPointsResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/describe_bandwidth_packages.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/describe_bandwidth_packages.go new file mode 100644 index 000000000..4a423e861 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/describe_bandwidth_packages.go @@ -0,0 +1,114 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// DescribeBandwidthPackages invokes the vpc.DescribeBandwidthPackages API synchronously +// api document: https://help.aliyun.com/api/vpc/describebandwidthpackages.html +func (client *Client) DescribeBandwidthPackages(request *DescribeBandwidthPackagesRequest) (response *DescribeBandwidthPackagesResponse, err error) { + response = CreateDescribeBandwidthPackagesResponse() + err = client.DoAction(request, response) + return +} + +// DescribeBandwidthPackagesWithChan invokes the vpc.DescribeBandwidthPackages API asynchronously +// api document: https://help.aliyun.com/api/vpc/describebandwidthpackages.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeBandwidthPackagesWithChan(request *DescribeBandwidthPackagesRequest) (<-chan *DescribeBandwidthPackagesResponse, <-chan error) { + responseChan := make(chan *DescribeBandwidthPackagesResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DescribeBandwidthPackages(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DescribeBandwidthPackagesWithCallback invokes the vpc.DescribeBandwidthPackages API asynchronously +// api document: https://help.aliyun.com/api/vpc/describebandwidthpackages.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeBandwidthPackagesWithCallback(request *DescribeBandwidthPackagesRequest, callback func(response *DescribeBandwidthPackagesResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DescribeBandwidthPackagesResponse + var err error + defer close(result) + response, err = client.DescribeBandwidthPackages(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DescribeBandwidthPackagesRequest is the request struct for api DescribeBandwidthPackages +type DescribeBandwidthPackagesRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + BandwidthPackageId string `position:"Query" name:"BandwidthPackageId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + PageSize requests.Integer `position:"Query" name:"PageSize"` + NatGatewayId string `position:"Query" name:"NatGatewayId"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + PageNumber requests.Integer `position:"Query" name:"PageNumber"` +} + +// DescribeBandwidthPackagesResponse is the response struct for api DescribeBandwidthPackages +type DescribeBandwidthPackagesResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + TotalCount int `json:"TotalCount" xml:"TotalCount"` + PageNumber int `json:"PageNumber" xml:"PageNumber"` + PageSize int `json:"PageSize" xml:"PageSize"` + BandwidthPackages BandwidthPackages `json:"BandwidthPackages" xml:"BandwidthPackages"` +} + +// CreateDescribeBandwidthPackagesRequest creates a request to invoke DescribeBandwidthPackages API +func CreateDescribeBandwidthPackagesRequest() (request *DescribeBandwidthPackagesRequest) { + request = &DescribeBandwidthPackagesRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "DescribeBandwidthPackages", "vpc", "openAPI") + return +} + +// CreateDescribeBandwidthPackagesResponse creates a response to parse from DescribeBandwidthPackages response +func CreateDescribeBandwidthPackagesResponse() (response *DescribeBandwidthPackagesResponse) { + response = &DescribeBandwidthPackagesResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/describe_bgp_groups.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/describe_bgp_groups.go new file mode 100644 index 000000000..2b0445f76 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/describe_bgp_groups.go @@ -0,0 +1,115 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// DescribeBgpGroups invokes the vpc.DescribeBgpGroups API synchronously +// api document: https://help.aliyun.com/api/vpc/describebgpgroups.html +func (client *Client) DescribeBgpGroups(request *DescribeBgpGroupsRequest) (response *DescribeBgpGroupsResponse, err error) { + response = CreateDescribeBgpGroupsResponse() + err = client.DoAction(request, response) + return +} + +// DescribeBgpGroupsWithChan invokes the vpc.DescribeBgpGroups API asynchronously +// api document: https://help.aliyun.com/api/vpc/describebgpgroups.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeBgpGroupsWithChan(request *DescribeBgpGroupsRequest) (<-chan *DescribeBgpGroupsResponse, <-chan error) { + responseChan := make(chan *DescribeBgpGroupsResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DescribeBgpGroups(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DescribeBgpGroupsWithCallback invokes the vpc.DescribeBgpGroups API asynchronously +// api document: https://help.aliyun.com/api/vpc/describebgpgroups.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeBgpGroupsWithCallback(request *DescribeBgpGroupsRequest, callback func(response *DescribeBgpGroupsResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DescribeBgpGroupsResponse + var err error + defer close(result) + response, err = client.DescribeBgpGroups(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DescribeBgpGroupsRequest is the request struct for api DescribeBgpGroups +type DescribeBgpGroupsRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + RouterId string `position:"Query" name:"RouterId"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + PageSize requests.Integer `position:"Query" name:"PageSize"` + BgpGroupId string `position:"Query" name:"BgpGroupId"` + IsDefault requests.Boolean `position:"Query" name:"IsDefault"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + PageNumber requests.Integer `position:"Query" name:"PageNumber"` +} + +// DescribeBgpGroupsResponse is the response struct for api DescribeBgpGroups +type DescribeBgpGroupsResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + TotalCount int `json:"TotalCount" xml:"TotalCount"` + PageNumber int `json:"PageNumber" xml:"PageNumber"` + PageSize int `json:"PageSize" xml:"PageSize"` + BgpGroups BgpGroups `json:"BgpGroups" xml:"BgpGroups"` +} + +// CreateDescribeBgpGroupsRequest creates a request to invoke DescribeBgpGroups API +func CreateDescribeBgpGroupsRequest() (request *DescribeBgpGroupsRequest) { + request = &DescribeBgpGroupsRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "DescribeBgpGroups", "vpc", "openAPI") + return +} + +// CreateDescribeBgpGroupsResponse creates a response to parse from DescribeBgpGroups response +func CreateDescribeBgpGroupsResponse() (response *DescribeBgpGroupsResponse) { + response = &DescribeBgpGroupsResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/describe_bgp_networks.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/describe_bgp_networks.go new file mode 100644 index 000000000..63ced2e93 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/describe_bgp_networks.go @@ -0,0 +1,113 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// DescribeBgpNetworks invokes the vpc.DescribeBgpNetworks API synchronously +// api document: https://help.aliyun.com/api/vpc/describebgpnetworks.html +func (client *Client) DescribeBgpNetworks(request *DescribeBgpNetworksRequest) (response *DescribeBgpNetworksResponse, err error) { + response = CreateDescribeBgpNetworksResponse() + err = client.DoAction(request, response) + return +} + +// DescribeBgpNetworksWithChan invokes the vpc.DescribeBgpNetworks API asynchronously +// api document: https://help.aliyun.com/api/vpc/describebgpnetworks.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeBgpNetworksWithChan(request *DescribeBgpNetworksRequest) (<-chan *DescribeBgpNetworksResponse, <-chan error) { + responseChan := make(chan *DescribeBgpNetworksResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DescribeBgpNetworks(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DescribeBgpNetworksWithCallback invokes the vpc.DescribeBgpNetworks API asynchronously +// api document: https://help.aliyun.com/api/vpc/describebgpnetworks.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeBgpNetworksWithCallback(request *DescribeBgpNetworksRequest, callback func(response *DescribeBgpNetworksResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DescribeBgpNetworksResponse + var err error + defer close(result) + response, err = client.DescribeBgpNetworks(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DescribeBgpNetworksRequest is the request struct for api DescribeBgpNetworks +type DescribeBgpNetworksRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + RouterId string `position:"Query" name:"RouterId"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + PageSize requests.Integer `position:"Query" name:"PageSize"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + PageNumber requests.Integer `position:"Query" name:"PageNumber"` +} + +// DescribeBgpNetworksResponse is the response struct for api DescribeBgpNetworks +type DescribeBgpNetworksResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + TotalCount int `json:"TotalCount" xml:"TotalCount"` + PageNumber int `json:"PageNumber" xml:"PageNumber"` + PageSize int `json:"PageSize" xml:"PageSize"` + BgpNetworks BgpNetworks `json:"BgpNetworks" xml:"BgpNetworks"` +} + +// CreateDescribeBgpNetworksRequest creates a request to invoke DescribeBgpNetworks API +func CreateDescribeBgpNetworksRequest() (request *DescribeBgpNetworksRequest) { + request = &DescribeBgpNetworksRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "DescribeBgpNetworks", "vpc", "openAPI") + return +} + +// CreateDescribeBgpNetworksResponse creates a response to parse from DescribeBgpNetworks response +func CreateDescribeBgpNetworksResponse() (response *DescribeBgpNetworksResponse) { + response = &DescribeBgpNetworksResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/describe_bgp_peers.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/describe_bgp_peers.go new file mode 100644 index 000000000..3315f009e --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/describe_bgp_peers.go @@ -0,0 +1,116 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// DescribeBgpPeers invokes the vpc.DescribeBgpPeers API synchronously +// api document: https://help.aliyun.com/api/vpc/describebgppeers.html +func (client *Client) DescribeBgpPeers(request *DescribeBgpPeersRequest) (response *DescribeBgpPeersResponse, err error) { + response = CreateDescribeBgpPeersResponse() + err = client.DoAction(request, response) + return +} + +// DescribeBgpPeersWithChan invokes the vpc.DescribeBgpPeers API asynchronously +// api document: https://help.aliyun.com/api/vpc/describebgppeers.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeBgpPeersWithChan(request *DescribeBgpPeersRequest) (<-chan *DescribeBgpPeersResponse, <-chan error) { + responseChan := make(chan *DescribeBgpPeersResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DescribeBgpPeers(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DescribeBgpPeersWithCallback invokes the vpc.DescribeBgpPeers API asynchronously +// api document: https://help.aliyun.com/api/vpc/describebgppeers.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeBgpPeersWithCallback(request *DescribeBgpPeersRequest, callback func(response *DescribeBgpPeersResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DescribeBgpPeersResponse + var err error + defer close(result) + response, err = client.DescribeBgpPeers(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DescribeBgpPeersRequest is the request struct for api DescribeBgpPeers +type DescribeBgpPeersRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + RouterId string `position:"Query" name:"RouterId"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + PageSize requests.Integer `position:"Query" name:"PageSize"` + BgpGroupId string `position:"Query" name:"BgpGroupId"` + BgpPeerId string `position:"Query" name:"BgpPeerId"` + IsDefault requests.Boolean `position:"Query" name:"IsDefault"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + PageNumber requests.Integer `position:"Query" name:"PageNumber"` +} + +// DescribeBgpPeersResponse is the response struct for api DescribeBgpPeers +type DescribeBgpPeersResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + TotalCount int `json:"TotalCount" xml:"TotalCount"` + PageNumber int `json:"PageNumber" xml:"PageNumber"` + PageSize int `json:"PageSize" xml:"PageSize"` + BgpPeers BgpPeers `json:"BgpPeers" xml:"BgpPeers"` +} + +// CreateDescribeBgpPeersRequest creates a request to invoke DescribeBgpPeers API +func CreateDescribeBgpPeersRequest() (request *DescribeBgpPeersRequest) { + request = &DescribeBgpPeersRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "DescribeBgpPeers", "vpc", "openAPI") + return +} + +// CreateDescribeBgpPeersResponse creates a response to parse from DescribeBgpPeers response +func CreateDescribeBgpPeersResponse() (response *DescribeBgpPeersResponse) { + response = &DescribeBgpPeersResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/describe_common_bandwidth_packages.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/describe_common_bandwidth_packages.go new file mode 100644 index 000000000..d1d2187af --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/describe_common_bandwidth_packages.go @@ -0,0 +1,116 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// DescribeCommonBandwidthPackages invokes the vpc.DescribeCommonBandwidthPackages API synchronously +// api document: https://help.aliyun.com/api/vpc/describecommonbandwidthpackages.html +func (client *Client) DescribeCommonBandwidthPackages(request *DescribeCommonBandwidthPackagesRequest) (response *DescribeCommonBandwidthPackagesResponse, err error) { + response = CreateDescribeCommonBandwidthPackagesResponse() + err = client.DoAction(request, response) + return +} + +// DescribeCommonBandwidthPackagesWithChan invokes the vpc.DescribeCommonBandwidthPackages API asynchronously +// api document: https://help.aliyun.com/api/vpc/describecommonbandwidthpackages.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeCommonBandwidthPackagesWithChan(request *DescribeCommonBandwidthPackagesRequest) (<-chan *DescribeCommonBandwidthPackagesResponse, <-chan error) { + responseChan := make(chan *DescribeCommonBandwidthPackagesResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DescribeCommonBandwidthPackages(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DescribeCommonBandwidthPackagesWithCallback invokes the vpc.DescribeCommonBandwidthPackages API asynchronously +// api document: https://help.aliyun.com/api/vpc/describecommonbandwidthpackages.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeCommonBandwidthPackagesWithCallback(request *DescribeCommonBandwidthPackagesRequest, callback func(response *DescribeCommonBandwidthPackagesResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DescribeCommonBandwidthPackagesResponse + var err error + defer close(result) + response, err = client.DescribeCommonBandwidthPackages(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DescribeCommonBandwidthPackagesRequest is the request struct for api DescribeCommonBandwidthPackages +type DescribeCommonBandwidthPackagesRequest struct { + *requests.RpcRequest + ResourceGroupId string `position:"Query" name:"ResourceGroupId"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + BandwidthPackageId string `position:"Query" name:"BandwidthPackageId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + Name string `position:"Query" name:"Name"` + PageSize requests.Integer `position:"Query" name:"PageSize"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + IncludeReservationData requests.Boolean `position:"Query" name:"IncludeReservationData"` + PageNumber requests.Integer `position:"Query" name:"PageNumber"` +} + +// DescribeCommonBandwidthPackagesResponse is the response struct for api DescribeCommonBandwidthPackages +type DescribeCommonBandwidthPackagesResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + TotalCount int `json:"TotalCount" xml:"TotalCount"` + PageNumber int `json:"PageNumber" xml:"PageNumber"` + PageSize int `json:"PageSize" xml:"PageSize"` + CommonBandwidthPackages CommonBandwidthPackages `json:"CommonBandwidthPackages" xml:"CommonBandwidthPackages"` +} + +// CreateDescribeCommonBandwidthPackagesRequest creates a request to invoke DescribeCommonBandwidthPackages API +func CreateDescribeCommonBandwidthPackagesRequest() (request *DescribeCommonBandwidthPackagesRequest) { + request = &DescribeCommonBandwidthPackagesRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "DescribeCommonBandwidthPackages", "vpc", "openAPI") + return +} + +// CreateDescribeCommonBandwidthPackagesResponse creates a response to parse from DescribeCommonBandwidthPackages response +func CreateDescribeCommonBandwidthPackagesResponse() (response *DescribeCommonBandwidthPackagesResponse) { + response = &DescribeCommonBandwidthPackagesResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/describe_customer_gateway.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/describe_customer_gateway.go new file mode 100644 index 000000000..8c6134891 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/describe_customer_gateway.go @@ -0,0 +1,112 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// DescribeCustomerGateway invokes the vpc.DescribeCustomerGateway API synchronously +// api document: https://help.aliyun.com/api/vpc/describecustomergateway.html +func (client *Client) DescribeCustomerGateway(request *DescribeCustomerGatewayRequest) (response *DescribeCustomerGatewayResponse, err error) { + response = CreateDescribeCustomerGatewayResponse() + err = client.DoAction(request, response) + return +} + +// DescribeCustomerGatewayWithChan invokes the vpc.DescribeCustomerGateway API asynchronously +// api document: https://help.aliyun.com/api/vpc/describecustomergateway.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeCustomerGatewayWithChan(request *DescribeCustomerGatewayRequest) (<-chan *DescribeCustomerGatewayResponse, <-chan error) { + responseChan := make(chan *DescribeCustomerGatewayResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DescribeCustomerGateway(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DescribeCustomerGatewayWithCallback invokes the vpc.DescribeCustomerGateway API asynchronously +// api document: https://help.aliyun.com/api/vpc/describecustomergateway.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeCustomerGatewayWithCallback(request *DescribeCustomerGatewayRequest, callback func(response *DescribeCustomerGatewayResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DescribeCustomerGatewayResponse + var err error + defer close(result) + response, err = client.DescribeCustomerGateway(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DescribeCustomerGatewayRequest is the request struct for api DescribeCustomerGateway +type DescribeCustomerGatewayRequest struct { + *requests.RpcRequest + 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"` + CustomerGatewayId string `position:"Query" name:"CustomerGatewayId"` +} + +// DescribeCustomerGatewayResponse is the response struct for api DescribeCustomerGateway +type DescribeCustomerGatewayResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + CustomerGatewayId string `json:"CustomerGatewayId" xml:"CustomerGatewayId"` + IpAddress string `json:"IpAddress" xml:"IpAddress"` + Name string `json:"Name" xml:"Name"` + Description string `json:"Description" xml:"Description"` + CreateTime int `json:"CreateTime" xml:"CreateTime"` +} + +// CreateDescribeCustomerGatewayRequest creates a request to invoke DescribeCustomerGateway API +func CreateDescribeCustomerGatewayRequest() (request *DescribeCustomerGatewayRequest) { + request = &DescribeCustomerGatewayRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "DescribeCustomerGateway", "vpc", "openAPI") + return +} + +// CreateDescribeCustomerGatewayResponse creates a response to parse from DescribeCustomerGateway response +func CreateDescribeCustomerGatewayResponse() (response *DescribeCustomerGatewayResponse) { + response = &DescribeCustomerGatewayResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/describe_customer_gateways.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/describe_customer_gateways.go new file mode 100644 index 000000000..5e78a8bc6 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/describe_customer_gateways.go @@ -0,0 +1,113 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// DescribeCustomerGateways invokes the vpc.DescribeCustomerGateways API synchronously +// api document: https://help.aliyun.com/api/vpc/describecustomergateways.html +func (client *Client) DescribeCustomerGateways(request *DescribeCustomerGatewaysRequest) (response *DescribeCustomerGatewaysResponse, err error) { + response = CreateDescribeCustomerGatewaysResponse() + err = client.DoAction(request, response) + return +} + +// DescribeCustomerGatewaysWithChan invokes the vpc.DescribeCustomerGateways API asynchronously +// api document: https://help.aliyun.com/api/vpc/describecustomergateways.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeCustomerGatewaysWithChan(request *DescribeCustomerGatewaysRequest) (<-chan *DescribeCustomerGatewaysResponse, <-chan error) { + responseChan := make(chan *DescribeCustomerGatewaysResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DescribeCustomerGateways(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DescribeCustomerGatewaysWithCallback invokes the vpc.DescribeCustomerGateways API asynchronously +// api document: https://help.aliyun.com/api/vpc/describecustomergateways.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeCustomerGatewaysWithCallback(request *DescribeCustomerGatewaysRequest, callback func(response *DescribeCustomerGatewaysResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DescribeCustomerGatewaysResponse + var err error + defer close(result) + response, err = client.DescribeCustomerGateways(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DescribeCustomerGatewaysRequest is the request struct for api DescribeCustomerGateways +type DescribeCustomerGatewaysRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + PageSize requests.Integer `position:"Query" name:"PageSize"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + CustomerGatewayId string `position:"Query" name:"CustomerGatewayId"` + PageNumber requests.Integer `position:"Query" name:"PageNumber"` +} + +// DescribeCustomerGatewaysResponse is the response struct for api DescribeCustomerGateways +type DescribeCustomerGatewaysResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + TotalCount int `json:"TotalCount" xml:"TotalCount"` + PageNumber int `json:"PageNumber" xml:"PageNumber"` + PageSize int `json:"PageSize" xml:"PageSize"` + CustomerGateways CustomerGateways `json:"CustomerGateways" xml:"CustomerGateways"` +} + +// CreateDescribeCustomerGatewaysRequest creates a request to invoke DescribeCustomerGateways API +func CreateDescribeCustomerGatewaysRequest() (request *DescribeCustomerGatewaysRequest) { + request = &DescribeCustomerGatewaysRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "DescribeCustomerGateways", "vpc", "openAPI") + return +} + +// CreateDescribeCustomerGatewaysResponse creates a response to parse from DescribeCustomerGateways response +func CreateDescribeCustomerGatewaysResponse() (response *DescribeCustomerGatewaysResponse) { + response = &DescribeCustomerGatewaysResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/describe_eip_addresses.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/describe_eip_addresses.go new file mode 100644 index 000000000..14e93763a --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/describe_eip_addresses.go @@ -0,0 +1,133 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// DescribeEipAddresses invokes the vpc.DescribeEipAddresses API synchronously +// api document: https://help.aliyun.com/api/vpc/describeeipaddresses.html +func (client *Client) DescribeEipAddresses(request *DescribeEipAddressesRequest) (response *DescribeEipAddressesResponse, err error) { + response = CreateDescribeEipAddressesResponse() + err = client.DoAction(request, response) + return +} + +// DescribeEipAddressesWithChan invokes the vpc.DescribeEipAddresses API asynchronously +// api document: https://help.aliyun.com/api/vpc/describeeipaddresses.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeEipAddressesWithChan(request *DescribeEipAddressesRequest) (<-chan *DescribeEipAddressesResponse, <-chan error) { + responseChan := make(chan *DescribeEipAddressesResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DescribeEipAddresses(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DescribeEipAddressesWithCallback invokes the vpc.DescribeEipAddresses API asynchronously +// api document: https://help.aliyun.com/api/vpc/describeeipaddresses.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeEipAddressesWithCallback(request *DescribeEipAddressesRequest, callback func(response *DescribeEipAddressesResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DescribeEipAddressesResponse + var err error + defer close(result) + response, err = client.DescribeEipAddresses(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DescribeEipAddressesRequest is the request struct for api DescribeEipAddresses +type DescribeEipAddressesRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + Filter2Value string `position:"Query" name:"Filter.2.Value"` + ISP string `position:"Query" name:"ISP"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + AllocationId string `position:"Query" name:"AllocationId"` + Filter1Value string `position:"Query" name:"Filter.1.Value"` + Filter2Key string `position:"Query" name:"Filter.2.Key"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + IncludeReservationData requests.Boolean `position:"Query" name:"IncludeReservationData"` + EipAddress string `position:"Query" name:"EipAddress"` + PageNumber requests.Integer `position:"Query" name:"PageNumber"` + ResourceGroupId string `position:"Query" name:"ResourceGroupId"` + LockReason string `position:"Query" name:"LockReason"` + Filter1Key string `position:"Query" name:"Filter.1.Key"` + AssociatedInstanceType string `position:"Query" name:"AssociatedInstanceType"` + PageSize requests.Integer `position:"Query" name:"PageSize"` + Tag *[]DescribeEipAddressesTag `position:"Query" name:"Tag" type:"Repeated"` + ChargeType string `position:"Query" name:"ChargeType"` + AssociatedInstanceId string `position:"Query" name:"AssociatedInstanceId"` + Status string `position:"Query" name:"Status"` +} + +// DescribeEipAddressesTag is a repeated param struct in DescribeEipAddressesRequest +type DescribeEipAddressesTag struct { + Value string `name:"Value"` + Key string `name:"Key"` +} + +// DescribeEipAddressesResponse is the response struct for api DescribeEipAddresses +type DescribeEipAddressesResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + TotalCount int `json:"TotalCount" xml:"TotalCount"` + PageNumber int `json:"PageNumber" xml:"PageNumber"` + PageSize int `json:"PageSize" xml:"PageSize"` + EipAddresses EipAddresses `json:"EipAddresses" xml:"EipAddresses"` +} + +// CreateDescribeEipAddressesRequest creates a request to invoke DescribeEipAddresses API +func CreateDescribeEipAddressesRequest() (request *DescribeEipAddressesRequest) { + request = &DescribeEipAddressesRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "DescribeEipAddresses", "vpc", "openAPI") + return +} + +// CreateDescribeEipAddressesResponse creates a response to parse from DescribeEipAddresses response +func CreateDescribeEipAddressesResponse() (response *DescribeEipAddressesResponse) { + response = &DescribeEipAddressesResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/describe_eip_monitor_data.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/describe_eip_monitor_data.go new file mode 100644 index 000000000..bb86b4010 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/describe_eip_monitor_data.go @@ -0,0 +1,111 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// DescribeEipMonitorData invokes the vpc.DescribeEipMonitorData API synchronously +// api document: https://help.aliyun.com/api/vpc/describeeipmonitordata.html +func (client *Client) DescribeEipMonitorData(request *DescribeEipMonitorDataRequest) (response *DescribeEipMonitorDataResponse, err error) { + response = CreateDescribeEipMonitorDataResponse() + err = client.DoAction(request, response) + return +} + +// DescribeEipMonitorDataWithChan invokes the vpc.DescribeEipMonitorData API asynchronously +// api document: https://help.aliyun.com/api/vpc/describeeipmonitordata.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeEipMonitorDataWithChan(request *DescribeEipMonitorDataRequest) (<-chan *DescribeEipMonitorDataResponse, <-chan error) { + responseChan := make(chan *DescribeEipMonitorDataResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DescribeEipMonitorData(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DescribeEipMonitorDataWithCallback invokes the vpc.DescribeEipMonitorData API asynchronously +// api document: https://help.aliyun.com/api/vpc/describeeipmonitordata.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeEipMonitorDataWithCallback(request *DescribeEipMonitorDataRequest, callback func(response *DescribeEipMonitorDataResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DescribeEipMonitorDataResponse + var err error + defer close(result) + response, err = client.DescribeEipMonitorData(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DescribeEipMonitorDataRequest is the request struct for api DescribeEipMonitorData +type DescribeEipMonitorDataRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + Period requests.Integer `position:"Query" name:"Period"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + EndTime string `position:"Query" name:"EndTime"` + AllocationId string `position:"Query" name:"AllocationId"` + StartTime string `position:"Query" name:"StartTime"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// DescribeEipMonitorDataResponse is the response struct for api DescribeEipMonitorData +type DescribeEipMonitorDataResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + EipMonitorDatas EipMonitorDatas `json:"EipMonitorDatas" xml:"EipMonitorDatas"` +} + +// CreateDescribeEipMonitorDataRequest creates a request to invoke DescribeEipMonitorData API +func CreateDescribeEipMonitorDataRequest() (request *DescribeEipMonitorDataRequest) { + request = &DescribeEipMonitorDataRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "DescribeEipMonitorData", "vpc", "openAPI") + return +} + +// CreateDescribeEipMonitorDataResponse creates a response to parse from DescribeEipMonitorData response +func CreateDescribeEipMonitorDataResponse() (response *DescribeEipMonitorDataResponse) { + response = &DescribeEipMonitorDataResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/describe_flow_logs.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/describe_flow_logs.go new file mode 100644 index 000000000..d4bf89416 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/describe_flow_logs.go @@ -0,0 +1,122 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// DescribeFlowLogs invokes the vpc.DescribeFlowLogs API synchronously +// api document: https://help.aliyun.com/api/vpc/describeflowlogs.html +func (client *Client) DescribeFlowLogs(request *DescribeFlowLogsRequest) (response *DescribeFlowLogsResponse, err error) { + response = CreateDescribeFlowLogsResponse() + err = client.DoAction(request, response) + return +} + +// DescribeFlowLogsWithChan invokes the vpc.DescribeFlowLogs API asynchronously +// api document: https://help.aliyun.com/api/vpc/describeflowlogs.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeFlowLogsWithChan(request *DescribeFlowLogsRequest) (<-chan *DescribeFlowLogsResponse, <-chan error) { + responseChan := make(chan *DescribeFlowLogsResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DescribeFlowLogs(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DescribeFlowLogsWithCallback invokes the vpc.DescribeFlowLogs API asynchronously +// api document: https://help.aliyun.com/api/vpc/describeflowlogs.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeFlowLogsWithCallback(request *DescribeFlowLogsRequest, callback func(response *DescribeFlowLogsResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DescribeFlowLogsResponse + var err error + defer close(result) + response, err = client.DescribeFlowLogs(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DescribeFlowLogsRequest is the request struct for api DescribeFlowLogs +type DescribeFlowLogsRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceId string `position:"Query" name:"ResourceId"` + ProjectName string `position:"Query" name:"ProjectName"` + LogStoreName string `position:"Query" name:"LogStoreName"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + Description string `position:"Query" name:"Description"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + ResourceType string `position:"Query" name:"ResourceType"` + PageNumber requests.Integer `position:"Query" name:"PageNumber"` + PageSize requests.Integer `position:"Query" name:"PageSize"` + TrafficType string `position:"Query" name:"TrafficType"` + FlowLogId string `position:"Query" name:"FlowLogId"` + FlowLogName string `position:"Query" name:"FlowLogName"` + Status string `position:"Query" name:"Status"` +} + +// DescribeFlowLogsResponse is the response struct for api DescribeFlowLogs +type DescribeFlowLogsResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + Success string `json:"Success" xml:"Success"` + TotalCount string `json:"TotalCount" xml:"TotalCount"` + PageNumber string `json:"PageNumber" xml:"PageNumber"` + PageSize string `json:"PageSize" xml:"PageSize"` + FlowLogs FlowLogs `json:"FlowLogs" xml:"FlowLogs"` +} + +// CreateDescribeFlowLogsRequest creates a request to invoke DescribeFlowLogs API +func CreateDescribeFlowLogsRequest() (request *DescribeFlowLogsRequest) { + request = &DescribeFlowLogsRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "DescribeFlowLogs", "vpc", "openAPI") + return +} + +// CreateDescribeFlowLogsResponse creates a response to parse from DescribeFlowLogs response +func CreateDescribeFlowLogsResponse() (response *DescribeFlowLogsResponse) { + response = &DescribeFlowLogsResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/describe_forward_table_entries.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/describe_forward_table_entries.go new file mode 100644 index 000000000..46dd83ae0 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/describe_forward_table_entries.go @@ -0,0 +1,120 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// DescribeForwardTableEntries invokes the vpc.DescribeForwardTableEntries API synchronously +// api document: https://help.aliyun.com/api/vpc/describeforwardtableentries.html +func (client *Client) DescribeForwardTableEntries(request *DescribeForwardTableEntriesRequest) (response *DescribeForwardTableEntriesResponse, err error) { + response = CreateDescribeForwardTableEntriesResponse() + err = client.DoAction(request, response) + return +} + +// DescribeForwardTableEntriesWithChan invokes the vpc.DescribeForwardTableEntries API asynchronously +// api document: https://help.aliyun.com/api/vpc/describeforwardtableentries.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeForwardTableEntriesWithChan(request *DescribeForwardTableEntriesRequest) (<-chan *DescribeForwardTableEntriesResponse, <-chan error) { + responseChan := make(chan *DescribeForwardTableEntriesResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DescribeForwardTableEntries(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DescribeForwardTableEntriesWithCallback invokes the vpc.DescribeForwardTableEntries API asynchronously +// api document: https://help.aliyun.com/api/vpc/describeforwardtableentries.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeForwardTableEntriesWithCallback(request *DescribeForwardTableEntriesRequest, callback func(response *DescribeForwardTableEntriesResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DescribeForwardTableEntriesResponse + var err error + defer close(result) + response, err = client.DescribeForwardTableEntries(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DescribeForwardTableEntriesRequest is the request struct for api DescribeForwardTableEntries +type DescribeForwardTableEntriesRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + IpProtocol string `position:"Query" name:"IpProtocol"` + ForwardEntryName string `position:"Query" name:"ForwardEntryName"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + ForwardTableId string `position:"Query" name:"ForwardTableId"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + InternalIp string `position:"Query" name:"InternalIp"` + PageNumber requests.Integer `position:"Query" name:"PageNumber"` + ForwardEntryId string `position:"Query" name:"ForwardEntryId"` + InternalPort string `position:"Query" name:"InternalPort"` + PageSize requests.Integer `position:"Query" name:"PageSize"` + ExternalIp string `position:"Query" name:"ExternalIp"` + ExternalPort string `position:"Query" name:"ExternalPort"` +} + +// DescribeForwardTableEntriesResponse is the response struct for api DescribeForwardTableEntries +type DescribeForwardTableEntriesResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + TotalCount int `json:"TotalCount" xml:"TotalCount"` + PageNumber int `json:"PageNumber" xml:"PageNumber"` + PageSize int `json:"PageSize" xml:"PageSize"` + ForwardTableEntries ForwardTableEntries `json:"ForwardTableEntries" xml:"ForwardTableEntries"` +} + +// CreateDescribeForwardTableEntriesRequest creates a request to invoke DescribeForwardTableEntries API +func CreateDescribeForwardTableEntriesRequest() (request *DescribeForwardTableEntriesRequest) { + request = &DescribeForwardTableEntriesRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "DescribeForwardTableEntries", "vpc", "openAPI") + return +} + +// CreateDescribeForwardTableEntriesResponse creates a response to parse from DescribeForwardTableEntries response +func CreateDescribeForwardTableEntriesResponse() (response *DescribeForwardTableEntriesResponse) { + response = &DescribeForwardTableEntriesResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/describe_global_acceleration_instances.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/describe_global_acceleration_instances.go new file mode 100644 index 000000000..0e25bc476 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/describe_global_acceleration_instances.go @@ -0,0 +1,120 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// DescribeGlobalAccelerationInstances invokes the vpc.DescribeGlobalAccelerationInstances API synchronously +// api document: https://help.aliyun.com/api/vpc/describeglobalaccelerationinstances.html +func (client *Client) DescribeGlobalAccelerationInstances(request *DescribeGlobalAccelerationInstancesRequest) (response *DescribeGlobalAccelerationInstancesResponse, err error) { + response = CreateDescribeGlobalAccelerationInstancesResponse() + err = client.DoAction(request, response) + return +} + +// DescribeGlobalAccelerationInstancesWithChan invokes the vpc.DescribeGlobalAccelerationInstances API asynchronously +// api document: https://help.aliyun.com/api/vpc/describeglobalaccelerationinstances.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeGlobalAccelerationInstancesWithChan(request *DescribeGlobalAccelerationInstancesRequest) (<-chan *DescribeGlobalAccelerationInstancesResponse, <-chan error) { + responseChan := make(chan *DescribeGlobalAccelerationInstancesResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DescribeGlobalAccelerationInstances(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DescribeGlobalAccelerationInstancesWithCallback invokes the vpc.DescribeGlobalAccelerationInstances API asynchronously +// api document: https://help.aliyun.com/api/vpc/describeglobalaccelerationinstances.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeGlobalAccelerationInstancesWithCallback(request *DescribeGlobalAccelerationInstancesRequest, callback func(response *DescribeGlobalAccelerationInstancesResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DescribeGlobalAccelerationInstancesResponse + var err error + defer close(result) + response, err = client.DescribeGlobalAccelerationInstances(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DescribeGlobalAccelerationInstancesRequest is the request struct for api DescribeGlobalAccelerationInstances +type DescribeGlobalAccelerationInstancesRequest struct { + *requests.RpcRequest + IpAddress string `position:"Query" name:"IpAddress"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + BandwidthType string `position:"Query" name:"BandwidthType"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + ServiceLocation string `position:"Query" name:"ServiceLocation"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + IncludeReservationData requests.Boolean `position:"Query" name:"IncludeReservationData"` + GlobalAccelerationInstanceId string `position:"Query" name:"GlobalAccelerationInstanceId"` + ServerId string `position:"Query" name:"ServerId"` + PageNumber requests.Integer `position:"Query" name:"PageNumber"` + Name string `position:"Query" name:"Name"` + PageSize requests.Integer `position:"Query" name:"PageSize"` + Status string `position:"Query" name:"Status"` +} + +// DescribeGlobalAccelerationInstancesResponse is the response struct for api DescribeGlobalAccelerationInstances +type DescribeGlobalAccelerationInstancesResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + TotalCount int `json:"TotalCount" xml:"TotalCount"` + PageNumber int `json:"PageNumber" xml:"PageNumber"` + PageSize int `json:"PageSize" xml:"PageSize"` + GlobalAccelerationInstances GlobalAccelerationInstancesInDescribeGlobalAccelerationInstances `json:"GlobalAccelerationInstances" xml:"GlobalAccelerationInstances"` +} + +// CreateDescribeGlobalAccelerationInstancesRequest creates a request to invoke DescribeGlobalAccelerationInstances API +func CreateDescribeGlobalAccelerationInstancesRequest() (request *DescribeGlobalAccelerationInstancesRequest) { + request = &DescribeGlobalAccelerationInstancesRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "DescribeGlobalAccelerationInstances", "vpc", "openAPI") + return +} + +// CreateDescribeGlobalAccelerationInstancesResponse creates a response to parse from DescribeGlobalAccelerationInstances response +func CreateDescribeGlobalAccelerationInstancesResponse() (response *DescribeGlobalAccelerationInstancesResponse) { + response = &DescribeGlobalAccelerationInstancesResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/describe_grant_rules_to_cen.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/describe_grant_rules_to_cen.go new file mode 100644 index 000000000..e548db9c8 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/describe_grant_rules_to_cen.go @@ -0,0 +1,114 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// DescribeGrantRulesToCen invokes the vpc.DescribeGrantRulesToCen API synchronously +// api document: https://help.aliyun.com/api/vpc/describegrantrulestocen.html +func (client *Client) DescribeGrantRulesToCen(request *DescribeGrantRulesToCenRequest) (response *DescribeGrantRulesToCenResponse, err error) { + response = CreateDescribeGrantRulesToCenResponse() + err = client.DoAction(request, response) + return +} + +// DescribeGrantRulesToCenWithChan invokes the vpc.DescribeGrantRulesToCen API asynchronously +// api document: https://help.aliyun.com/api/vpc/describegrantrulestocen.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeGrantRulesToCenWithChan(request *DescribeGrantRulesToCenRequest) (<-chan *DescribeGrantRulesToCenResponse, <-chan error) { + responseChan := make(chan *DescribeGrantRulesToCenResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DescribeGrantRulesToCen(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DescribeGrantRulesToCenWithCallback invokes the vpc.DescribeGrantRulesToCen API asynchronously +// api document: https://help.aliyun.com/api/vpc/describegrantrulestocen.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeGrantRulesToCenWithCallback(request *DescribeGrantRulesToCenRequest, callback func(response *DescribeGrantRulesToCenResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DescribeGrantRulesToCenResponse + var err error + defer close(result) + response, err = client.DescribeGrantRulesToCen(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DescribeGrantRulesToCenRequest is the request struct for api DescribeGrantRulesToCen +type DescribeGrantRulesToCenRequest struct { + *requests.RpcRequest + ResourceGroupId string `position:"Query" name:"ResourceGroupId"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + InstanceId string `position:"Query" name:"InstanceId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + ClientToken string `position:"Query" name:"ClientToken"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + InstanceType string `position:"Query" name:"InstanceType"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// DescribeGrantRulesToCenResponse is the response struct for api DescribeGrantRulesToCen +type DescribeGrantRulesToCenResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + TotalCount int `json:"TotalCount" xml:"TotalCount"` + PageNumber int `json:"PageNumber" xml:"PageNumber"` + PageSize int `json:"PageSize" xml:"PageSize"` + CenGrantRules CenGrantRules `json:"CenGrantRules" xml:"CenGrantRules"` +} + +// CreateDescribeGrantRulesToCenRequest creates a request to invoke DescribeGrantRulesToCen API +func CreateDescribeGrantRulesToCenRequest() (request *DescribeGrantRulesToCenRequest) { + request = &DescribeGrantRulesToCenRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "DescribeGrantRulesToCen", "vpc", "openAPI") + return +} + +// CreateDescribeGrantRulesToCenResponse creates a response to parse from DescribeGrantRulesToCen response +func CreateDescribeGrantRulesToCenResponse() (response *DescribeGrantRulesToCenResponse) { + response = &DescribeGrantRulesToCenResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/describe_ha_vips.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/describe_ha_vips.go new file mode 100644 index 000000000..9d009bb34 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/describe_ha_vips.go @@ -0,0 +1,119 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// DescribeHaVips invokes the vpc.DescribeHaVips API synchronously +// api document: https://help.aliyun.com/api/vpc/describehavips.html +func (client *Client) DescribeHaVips(request *DescribeHaVipsRequest) (response *DescribeHaVipsResponse, err error) { + response = CreateDescribeHaVipsResponse() + err = client.DoAction(request, response) + return +} + +// DescribeHaVipsWithChan invokes the vpc.DescribeHaVips API asynchronously +// api document: https://help.aliyun.com/api/vpc/describehavips.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeHaVipsWithChan(request *DescribeHaVipsRequest) (<-chan *DescribeHaVipsResponse, <-chan error) { + responseChan := make(chan *DescribeHaVipsResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DescribeHaVips(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DescribeHaVipsWithCallback invokes the vpc.DescribeHaVips API asynchronously +// api document: https://help.aliyun.com/api/vpc/describehavips.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeHaVipsWithCallback(request *DescribeHaVipsRequest, callback func(response *DescribeHaVipsResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DescribeHaVipsResponse + var err error + defer close(result) + response, err = client.DescribeHaVips(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DescribeHaVipsRequest is the request struct for api DescribeHaVips +type DescribeHaVipsRequest struct { + *requests.RpcRequest + Filter *[]DescribeHaVipsFilter `position:"Query" name:"Filter" type:"Repeated"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + PageSize requests.Integer `position:"Query" name:"PageSize"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + PageNumber requests.Integer `position:"Query" name:"PageNumber"` +} + +// DescribeHaVipsFilter is a repeated param struct in DescribeHaVipsRequest +type DescribeHaVipsFilter struct { + Value *[]string `name:"Value" type:"Repeated"` + Key string `name:"Key"` +} + +// DescribeHaVipsResponse is the response struct for api DescribeHaVips +type DescribeHaVipsResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + TotalCount int `json:"TotalCount" xml:"TotalCount"` + PageNumber int `json:"PageNumber" xml:"PageNumber"` + PageSize int `json:"PageSize" xml:"PageSize"` + HaVips HaVips `json:"HaVips" xml:"HaVips"` +} + +// CreateDescribeHaVipsRequest creates a request to invoke DescribeHaVips API +func CreateDescribeHaVipsRequest() (request *DescribeHaVipsRequest) { + request = &DescribeHaVipsRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "DescribeHaVips", "vpc", "openAPI") + return +} + +// CreateDescribeHaVipsResponse creates a response to parse from DescribeHaVips response +func CreateDescribeHaVipsResponse() (response *DescribeHaVipsResponse) { + response = &DescribeHaVipsResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/describe_i_pv6_translator_acl_list_attributes.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/describe_i_pv6_translator_acl_list_attributes.go new file mode 100644 index 000000000..12fe6a9b5 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/describe_i_pv6_translator_acl_list_attributes.go @@ -0,0 +1,115 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// DescribeIPv6TranslatorAclListAttributes invokes the vpc.DescribeIPv6TranslatorAclListAttributes API synchronously +// api document: https://help.aliyun.com/api/vpc/describeipv6translatoracllistattributes.html +func (client *Client) DescribeIPv6TranslatorAclListAttributes(request *DescribeIPv6TranslatorAclListAttributesRequest) (response *DescribeIPv6TranslatorAclListAttributesResponse, err error) { + response = CreateDescribeIPv6TranslatorAclListAttributesResponse() + err = client.DoAction(request, response) + return +} + +// DescribeIPv6TranslatorAclListAttributesWithChan invokes the vpc.DescribeIPv6TranslatorAclListAttributes API asynchronously +// api document: https://help.aliyun.com/api/vpc/describeipv6translatoracllistattributes.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeIPv6TranslatorAclListAttributesWithChan(request *DescribeIPv6TranslatorAclListAttributesRequest) (<-chan *DescribeIPv6TranslatorAclListAttributesResponse, <-chan error) { + responseChan := make(chan *DescribeIPv6TranslatorAclListAttributesResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DescribeIPv6TranslatorAclListAttributes(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DescribeIPv6TranslatorAclListAttributesWithCallback invokes the vpc.DescribeIPv6TranslatorAclListAttributes API asynchronously +// api document: https://help.aliyun.com/api/vpc/describeipv6translatoracllistattributes.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeIPv6TranslatorAclListAttributesWithCallback(request *DescribeIPv6TranslatorAclListAttributesRequest, callback func(response *DescribeIPv6TranslatorAclListAttributesResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DescribeIPv6TranslatorAclListAttributesResponse + var err error + defer close(result) + response, err = client.DescribeIPv6TranslatorAclListAttributes(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DescribeIPv6TranslatorAclListAttributesRequest is the request struct for api DescribeIPv6TranslatorAclListAttributes +type DescribeIPv6TranslatorAclListAttributesRequest struct { + *requests.RpcRequest + AclId string `position:"Query" name:"AclId"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + PageSize requests.Integer `position:"Query" name:"PageSize"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + PageNumber requests.Integer `position:"Query" name:"PageNumber"` +} + +// DescribeIPv6TranslatorAclListAttributesResponse is the response struct for api DescribeIPv6TranslatorAclListAttributes +type DescribeIPv6TranslatorAclListAttributesResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + AclId string `json:"AclId" xml:"AclId"` + AclName string `json:"AclName" xml:"AclName"` + TotalCount int `json:"TotalCount" xml:"TotalCount"` + PageNumber int `json:"PageNumber" xml:"PageNumber"` + PageSize int `json:"PageSize" xml:"PageSize"` + AclEntries AclEntries `json:"AclEntries" xml:"AclEntries"` +} + +// CreateDescribeIPv6TranslatorAclListAttributesRequest creates a request to invoke DescribeIPv6TranslatorAclListAttributes API +func CreateDescribeIPv6TranslatorAclListAttributesRequest() (request *DescribeIPv6TranslatorAclListAttributesRequest) { + request = &DescribeIPv6TranslatorAclListAttributesRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "DescribeIPv6TranslatorAclListAttributes", "vpc", "openAPI") + return +} + +// CreateDescribeIPv6TranslatorAclListAttributesResponse creates a response to parse from DescribeIPv6TranslatorAclListAttributes response +func CreateDescribeIPv6TranslatorAclListAttributesResponse() (response *DescribeIPv6TranslatorAclListAttributesResponse) { + response = &DescribeIPv6TranslatorAclListAttributesResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/describe_i_pv6_translator_acl_lists.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/describe_i_pv6_translator_acl_lists.go new file mode 100644 index 000000000..0d8c51147 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/describe_i_pv6_translator_acl_lists.go @@ -0,0 +1,114 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// DescribeIPv6TranslatorAclLists invokes the vpc.DescribeIPv6TranslatorAclLists API synchronously +// api document: https://help.aliyun.com/api/vpc/describeipv6translatoracllists.html +func (client *Client) DescribeIPv6TranslatorAclLists(request *DescribeIPv6TranslatorAclListsRequest) (response *DescribeIPv6TranslatorAclListsResponse, err error) { + response = CreateDescribeIPv6TranslatorAclListsResponse() + err = client.DoAction(request, response) + return +} + +// DescribeIPv6TranslatorAclListsWithChan invokes the vpc.DescribeIPv6TranslatorAclLists API asynchronously +// api document: https://help.aliyun.com/api/vpc/describeipv6translatoracllists.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeIPv6TranslatorAclListsWithChan(request *DescribeIPv6TranslatorAclListsRequest) (<-chan *DescribeIPv6TranslatorAclListsResponse, <-chan error) { + responseChan := make(chan *DescribeIPv6TranslatorAclListsResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DescribeIPv6TranslatorAclLists(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DescribeIPv6TranslatorAclListsWithCallback invokes the vpc.DescribeIPv6TranslatorAclLists API asynchronously +// api document: https://help.aliyun.com/api/vpc/describeipv6translatoracllists.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeIPv6TranslatorAclListsWithCallback(request *DescribeIPv6TranslatorAclListsRequest, callback func(response *DescribeIPv6TranslatorAclListsResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DescribeIPv6TranslatorAclListsResponse + var err error + defer close(result) + response, err = client.DescribeIPv6TranslatorAclLists(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DescribeIPv6TranslatorAclListsRequest is the request struct for api DescribeIPv6TranslatorAclLists +type DescribeIPv6TranslatorAclListsRequest struct { + *requests.RpcRequest + AclId string `position:"Query" name:"AclId"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + AclName string `position:"Query" name:"AclName"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + PageSize requests.Integer `position:"Query" name:"PageSize"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + PageNumber requests.Integer `position:"Query" name:"PageNumber"` +} + +// DescribeIPv6TranslatorAclListsResponse is the response struct for api DescribeIPv6TranslatorAclLists +type DescribeIPv6TranslatorAclListsResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + TotalCount int `json:"TotalCount" xml:"TotalCount"` + PageNumber int `json:"PageNumber" xml:"PageNumber"` + PageSize int `json:"PageSize" xml:"PageSize"` + Ipv6TranslatorAcls Ipv6TranslatorAcls `json:"Ipv6TranslatorAcls" xml:"Ipv6TranslatorAcls"` +} + +// CreateDescribeIPv6TranslatorAclListsRequest creates a request to invoke DescribeIPv6TranslatorAclLists API +func CreateDescribeIPv6TranslatorAclListsRequest() (request *DescribeIPv6TranslatorAclListsRequest) { + request = &DescribeIPv6TranslatorAclListsRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "DescribeIPv6TranslatorAclLists", "vpc", "openAPI") + return +} + +// CreateDescribeIPv6TranslatorAclListsResponse creates a response to parse from DescribeIPv6TranslatorAclLists response +func CreateDescribeIPv6TranslatorAclListsResponse() (response *DescribeIPv6TranslatorAclListsResponse) { + response = &DescribeIPv6TranslatorAclListsResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/describe_i_pv6_translator_entries.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/describe_i_pv6_translator_entries.go new file mode 100644 index 000000000..0a929620e --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/describe_i_pv6_translator_entries.go @@ -0,0 +1,124 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// DescribeIPv6TranslatorEntries invokes the vpc.DescribeIPv6TranslatorEntries API synchronously +// api document: https://help.aliyun.com/api/vpc/describeipv6translatorentries.html +func (client *Client) DescribeIPv6TranslatorEntries(request *DescribeIPv6TranslatorEntriesRequest) (response *DescribeIPv6TranslatorEntriesResponse, err error) { + response = CreateDescribeIPv6TranslatorEntriesResponse() + err = client.DoAction(request, response) + return +} + +// DescribeIPv6TranslatorEntriesWithChan invokes the vpc.DescribeIPv6TranslatorEntries API asynchronously +// api document: https://help.aliyun.com/api/vpc/describeipv6translatorentries.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeIPv6TranslatorEntriesWithChan(request *DescribeIPv6TranslatorEntriesRequest) (<-chan *DescribeIPv6TranslatorEntriesResponse, <-chan error) { + responseChan := make(chan *DescribeIPv6TranslatorEntriesResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DescribeIPv6TranslatorEntries(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DescribeIPv6TranslatorEntriesWithCallback invokes the vpc.DescribeIPv6TranslatorEntries API asynchronously +// api document: https://help.aliyun.com/api/vpc/describeipv6translatorentries.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeIPv6TranslatorEntriesWithCallback(request *DescribeIPv6TranslatorEntriesRequest, callback func(response *DescribeIPv6TranslatorEntriesResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DescribeIPv6TranslatorEntriesResponse + var err error + defer close(result) + response, err = client.DescribeIPv6TranslatorEntries(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DescribeIPv6TranslatorEntriesRequest is the request struct for api DescribeIPv6TranslatorEntries +type DescribeIPv6TranslatorEntriesRequest struct { + *requests.RpcRequest + BackendIpv4Port requests.Integer `position:"Query" name:"BackendIpv4Port"` + AclId string `position:"Query" name:"AclId"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + Ipv6TranslatorEntryId string `position:"Query" name:"Ipv6TranslatorEntryId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + EntryName string `position:"Query" name:"EntryName"` + AllocateIpv6Addr string `position:"Query" name:"AllocateIpv6Addr"` + ClientToken string `position:"Query" name:"ClientToken"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + AclStatus string `position:"Query" name:"AclStatus"` + PageNumber requests.Integer `position:"Query" name:"PageNumber"` + AclType string `position:"Query" name:"AclType"` + AllocateIpv6Port requests.Integer `position:"Query" name:"AllocateIpv6Port"` + PageSize requests.Integer `position:"Query" name:"PageSize"` + BackendIpv4Addr string `position:"Query" name:"BackendIpv4Addr"` + TransProtocol string `position:"Query" name:"TransProtocol"` + Ipv6TranslatorId string `position:"Query" name:"Ipv6TranslatorId"` +} + +// DescribeIPv6TranslatorEntriesResponse is the response struct for api DescribeIPv6TranslatorEntries +type DescribeIPv6TranslatorEntriesResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + TotalCount int `json:"TotalCount" xml:"TotalCount"` + PageNumber int `json:"PageNumber" xml:"PageNumber"` + PageSize int `json:"PageSize" xml:"PageSize"` + Ipv6TranslatorEntries Ipv6TranslatorEntries `json:"Ipv6TranslatorEntries" xml:"Ipv6TranslatorEntries"` +} + +// CreateDescribeIPv6TranslatorEntriesRequest creates a request to invoke DescribeIPv6TranslatorEntries API +func CreateDescribeIPv6TranslatorEntriesRequest() (request *DescribeIPv6TranslatorEntriesRequest) { + request = &DescribeIPv6TranslatorEntriesRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "DescribeIPv6TranslatorEntries", "vpc", "openAPI") + return +} + +// CreateDescribeIPv6TranslatorEntriesResponse creates a response to parse from DescribeIPv6TranslatorEntries response +func CreateDescribeIPv6TranslatorEntriesResponse() (response *DescribeIPv6TranslatorEntriesResponse) { + response = &DescribeIPv6TranslatorEntriesResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/describe_i_pv6_translators.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/describe_i_pv6_translators.go new file mode 100644 index 000000000..8fefb8ce8 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/describe_i_pv6_translators.go @@ -0,0 +1,120 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// DescribeIPv6Translators invokes the vpc.DescribeIPv6Translators API synchronously +// api document: https://help.aliyun.com/api/vpc/describeipv6translators.html +func (client *Client) DescribeIPv6Translators(request *DescribeIPv6TranslatorsRequest) (response *DescribeIPv6TranslatorsResponse, err error) { + response = CreateDescribeIPv6TranslatorsResponse() + err = client.DoAction(request, response) + return +} + +// DescribeIPv6TranslatorsWithChan invokes the vpc.DescribeIPv6Translators API asynchronously +// api document: https://help.aliyun.com/api/vpc/describeipv6translators.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeIPv6TranslatorsWithChan(request *DescribeIPv6TranslatorsRequest) (<-chan *DescribeIPv6TranslatorsResponse, <-chan error) { + responseChan := make(chan *DescribeIPv6TranslatorsResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DescribeIPv6Translators(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DescribeIPv6TranslatorsWithCallback invokes the vpc.DescribeIPv6Translators API asynchronously +// api document: https://help.aliyun.com/api/vpc/describeipv6translators.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeIPv6TranslatorsWithCallback(request *DescribeIPv6TranslatorsRequest, callback func(response *DescribeIPv6TranslatorsResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DescribeIPv6TranslatorsResponse + var err error + defer close(result) + response, err = client.DescribeIPv6Translators(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DescribeIPv6TranslatorsRequest is the request struct for api DescribeIPv6Translators +type DescribeIPv6TranslatorsRequest struct { + *requests.RpcRequest + BusinessStatus string `position:"Query" name:"BusinessStatus"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + AllocateIpv6Addr string `position:"Query" name:"AllocateIpv6Addr"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + AllocateIpv4Addr string `position:"Query" name:"AllocateIpv4Addr"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + Spec string `position:"Query" name:"Spec"` + PageNumber requests.Integer `position:"Query" name:"PageNumber"` + Name string `position:"Query" name:"Name"` + PageSize requests.Integer `position:"Query" name:"PageSize"` + Ipv6TranslatorId string `position:"Query" name:"Ipv6TranslatorId"` + PayType string `position:"Query" name:"PayType"` + Status string `position:"Query" name:"Status"` +} + +// DescribeIPv6TranslatorsResponse is the response struct for api DescribeIPv6Translators +type DescribeIPv6TranslatorsResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + TotalCount int `json:"TotalCount" xml:"TotalCount"` + PageNumber int `json:"PageNumber" xml:"PageNumber"` + PageSize int `json:"PageSize" xml:"PageSize"` + Ipv6Translators Ipv6Translators `json:"Ipv6Translators" xml:"Ipv6Translators"` +} + +// CreateDescribeIPv6TranslatorsRequest creates a request to invoke DescribeIPv6Translators API +func CreateDescribeIPv6TranslatorsRequest() (request *DescribeIPv6TranslatorsRequest) { + request = &DescribeIPv6TranslatorsRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "DescribeIPv6Translators", "vpc", "openAPI") + return +} + +// CreateDescribeIPv6TranslatorsResponse creates a response to parse from DescribeIPv6Translators response +func CreateDescribeIPv6TranslatorsResponse() (response *DescribeIPv6TranslatorsResponse) { + response = &DescribeIPv6TranslatorsResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/describe_ipv6_addresses.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/describe_ipv6_addresses.go new file mode 100644 index 000000000..7b4fb9599 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/describe_ipv6_addresses.go @@ -0,0 +1,121 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// DescribeIpv6Addresses invokes the vpc.DescribeIpv6Addresses API synchronously +// api document: https://help.aliyun.com/api/vpc/describeipv6addresses.html +func (client *Client) DescribeIpv6Addresses(request *DescribeIpv6AddressesRequest) (response *DescribeIpv6AddressesResponse, err error) { + response = CreateDescribeIpv6AddressesResponse() + err = client.DoAction(request, response) + return +} + +// DescribeIpv6AddressesWithChan invokes the vpc.DescribeIpv6Addresses API asynchronously +// api document: https://help.aliyun.com/api/vpc/describeipv6addresses.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeIpv6AddressesWithChan(request *DescribeIpv6AddressesRequest) (<-chan *DescribeIpv6AddressesResponse, <-chan error) { + responseChan := make(chan *DescribeIpv6AddressesResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DescribeIpv6Addresses(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DescribeIpv6AddressesWithCallback invokes the vpc.DescribeIpv6Addresses API asynchronously +// api document: https://help.aliyun.com/api/vpc/describeipv6addresses.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeIpv6AddressesWithCallback(request *DescribeIpv6AddressesRequest, callback func(response *DescribeIpv6AddressesResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DescribeIpv6AddressesResponse + var err error + defer close(result) + response, err = client.DescribeIpv6Addresses(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DescribeIpv6AddressesRequest is the request struct for api DescribeIpv6Addresses +type DescribeIpv6AddressesRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + Ipv6InternetBandwidthId string `position:"Query" name:"Ipv6InternetBandwidthId"` + NetworkType string `position:"Query" name:"NetworkType"` + PageNumber requests.Integer `position:"Query" name:"PageNumber"` + AssociatedInstanceType string `position:"Query" name:"AssociatedInstanceType"` + PageSize requests.Integer `position:"Query" name:"PageSize"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + VSwitchId string `position:"Query" name:"VSwitchId"` + Ipv6AddressId string `position:"Query" name:"Ipv6AddressId"` + VpcId string `position:"Query" name:"VpcId"` + Name string `position:"Query" name:"Name"` + Ipv6Address string `position:"Query" name:"Ipv6Address"` + AssociatedInstanceId string `position:"Query" name:"AssociatedInstanceId"` +} + +// DescribeIpv6AddressesResponse is the response struct for api DescribeIpv6Addresses +type DescribeIpv6AddressesResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + TotalCount int `json:"TotalCount" xml:"TotalCount"` + PageNumber int `json:"PageNumber" xml:"PageNumber"` + PageSize int `json:"PageSize" xml:"PageSize"` + Ipv6Addresses Ipv6Addresses `json:"Ipv6Addresses" xml:"Ipv6Addresses"` +} + +// CreateDescribeIpv6AddressesRequest creates a request to invoke DescribeIpv6Addresses API +func CreateDescribeIpv6AddressesRequest() (request *DescribeIpv6AddressesRequest) { + request = &DescribeIpv6AddressesRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "DescribeIpv6Addresses", "vpc", "openAPI") + return +} + +// CreateDescribeIpv6AddressesResponse creates a response to parse from DescribeIpv6Addresses response +func CreateDescribeIpv6AddressesResponse() (response *DescribeIpv6AddressesResponse) { + response = &DescribeIpv6AddressesResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/describe_ipv6_egress_only_rules.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/describe_ipv6_egress_only_rules.go new file mode 100644 index 000000000..b0bda45c2 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/describe_ipv6_egress_only_rules.go @@ -0,0 +1,117 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// DescribeIpv6EgressOnlyRules invokes the vpc.DescribeIpv6EgressOnlyRules API synchronously +// api document: https://help.aliyun.com/api/vpc/describeipv6egressonlyrules.html +func (client *Client) DescribeIpv6EgressOnlyRules(request *DescribeIpv6EgressOnlyRulesRequest) (response *DescribeIpv6EgressOnlyRulesResponse, err error) { + response = CreateDescribeIpv6EgressOnlyRulesResponse() + err = client.DoAction(request, response) + return +} + +// DescribeIpv6EgressOnlyRulesWithChan invokes the vpc.DescribeIpv6EgressOnlyRules API asynchronously +// api document: https://help.aliyun.com/api/vpc/describeipv6egressonlyrules.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeIpv6EgressOnlyRulesWithChan(request *DescribeIpv6EgressOnlyRulesRequest) (<-chan *DescribeIpv6EgressOnlyRulesResponse, <-chan error) { + responseChan := make(chan *DescribeIpv6EgressOnlyRulesResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DescribeIpv6EgressOnlyRules(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DescribeIpv6EgressOnlyRulesWithCallback invokes the vpc.DescribeIpv6EgressOnlyRules API asynchronously +// api document: https://help.aliyun.com/api/vpc/describeipv6egressonlyrules.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeIpv6EgressOnlyRulesWithCallback(request *DescribeIpv6EgressOnlyRulesRequest, callback func(response *DescribeIpv6EgressOnlyRulesResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DescribeIpv6EgressOnlyRulesResponse + var err error + defer close(result) + response, err = client.DescribeIpv6EgressOnlyRules(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DescribeIpv6EgressOnlyRulesRequest is the request struct for api DescribeIpv6EgressOnlyRules +type DescribeIpv6EgressOnlyRulesRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + PageNumber requests.Integer `position:"Query" name:"PageNumber"` + Ipv6EgressOnlyRuleId string `position:"Query" name:"Ipv6EgressOnlyRuleId"` + PageSize requests.Integer `position:"Query" name:"PageSize"` + InstanceType string `position:"Query" name:"InstanceType"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + InstanceId string `position:"Query" name:"InstanceId"` + Ipv6GatewayId string `position:"Query" name:"Ipv6GatewayId"` + Name string `position:"Query" name:"Name"` +} + +// DescribeIpv6EgressOnlyRulesResponse is the response struct for api DescribeIpv6EgressOnlyRules +type DescribeIpv6EgressOnlyRulesResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + TotalCount int `json:"TotalCount" xml:"TotalCount"` + PageNumber int `json:"PageNumber" xml:"PageNumber"` + PageSize int `json:"PageSize" xml:"PageSize"` + Ipv6EgressOnlyRules Ipv6EgressOnlyRules `json:"Ipv6EgressOnlyRules" xml:"Ipv6EgressOnlyRules"` +} + +// CreateDescribeIpv6EgressOnlyRulesRequest creates a request to invoke DescribeIpv6EgressOnlyRules API +func CreateDescribeIpv6EgressOnlyRulesRequest() (request *DescribeIpv6EgressOnlyRulesRequest) { + request = &DescribeIpv6EgressOnlyRulesRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "DescribeIpv6EgressOnlyRules", "vpc", "openAPI") + return +} + +// CreateDescribeIpv6EgressOnlyRulesResponse creates a response to parse from DescribeIpv6EgressOnlyRules response +func CreateDescribeIpv6EgressOnlyRulesResponse() (response *DescribeIpv6EgressOnlyRulesResponse) { + response = &DescribeIpv6EgressOnlyRulesResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/describe_ipv6_gateway_attribute.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/describe_ipv6_gateway_attribute.go new file mode 100644 index 000000000..c8b11b748 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/describe_ipv6_gateway_attribute.go @@ -0,0 +1,118 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// DescribeIpv6GatewayAttribute invokes the vpc.DescribeIpv6GatewayAttribute API synchronously +// api document: https://help.aliyun.com/api/vpc/describeipv6gatewayattribute.html +func (client *Client) DescribeIpv6GatewayAttribute(request *DescribeIpv6GatewayAttributeRequest) (response *DescribeIpv6GatewayAttributeResponse, err error) { + response = CreateDescribeIpv6GatewayAttributeResponse() + err = client.DoAction(request, response) + return +} + +// DescribeIpv6GatewayAttributeWithChan invokes the vpc.DescribeIpv6GatewayAttribute API asynchronously +// api document: https://help.aliyun.com/api/vpc/describeipv6gatewayattribute.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeIpv6GatewayAttributeWithChan(request *DescribeIpv6GatewayAttributeRequest) (<-chan *DescribeIpv6GatewayAttributeResponse, <-chan error) { + responseChan := make(chan *DescribeIpv6GatewayAttributeResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DescribeIpv6GatewayAttribute(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DescribeIpv6GatewayAttributeWithCallback invokes the vpc.DescribeIpv6GatewayAttribute API asynchronously +// api document: https://help.aliyun.com/api/vpc/describeipv6gatewayattribute.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeIpv6GatewayAttributeWithCallback(request *DescribeIpv6GatewayAttributeRequest, callback func(response *DescribeIpv6GatewayAttributeResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DescribeIpv6GatewayAttributeResponse + var err error + defer close(result) + response, err = client.DescribeIpv6GatewayAttribute(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DescribeIpv6GatewayAttributeRequest is the request struct for api DescribeIpv6GatewayAttribute +type DescribeIpv6GatewayAttributeRequest struct { + *requests.RpcRequest + 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"` + Ipv6GatewayId string `position:"Query" name:"Ipv6GatewayId"` +} + +// DescribeIpv6GatewayAttributeResponse is the response struct for api DescribeIpv6GatewayAttribute +type DescribeIpv6GatewayAttributeResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + RegionId string `json:"RegionId" xml:"RegionId"` + Ipv6GatewayId string `json:"Ipv6GatewayId" xml:"Ipv6GatewayId"` + VpcId string `json:"VpcId" xml:"VpcId"` + Status string `json:"Status" xml:"Status"` + BusinessStatus string `json:"BusinessStatus" xml:"BusinessStatus"` + Name string `json:"Name" xml:"Name"` + Description string `json:"Description" xml:"Description"` + Spec string `json:"Spec" xml:"Spec"` + InstanceChargeType string `json:"InstanceChargeType" xml:"InstanceChargeType"` + ExpiredTime string `json:"ExpiredTime" xml:"ExpiredTime"` + CreationTime string `json:"CreationTime" xml:"CreationTime"` +} + +// CreateDescribeIpv6GatewayAttributeRequest creates a request to invoke DescribeIpv6GatewayAttribute API +func CreateDescribeIpv6GatewayAttributeRequest() (request *DescribeIpv6GatewayAttributeRequest) { + request = &DescribeIpv6GatewayAttributeRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "DescribeIpv6GatewayAttribute", "vpc", "openAPI") + return +} + +// CreateDescribeIpv6GatewayAttributeResponse creates a response to parse from DescribeIpv6GatewayAttribute response +func CreateDescribeIpv6GatewayAttributeResponse() (response *DescribeIpv6GatewayAttributeResponse) { + response = &DescribeIpv6GatewayAttributeResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/describe_ipv6_gateways.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/describe_ipv6_gateways.go new file mode 100644 index 000000000..a43f48ea4 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/describe_ipv6_gateways.go @@ -0,0 +1,115 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// DescribeIpv6Gateways invokes the vpc.DescribeIpv6Gateways API synchronously +// api document: https://help.aliyun.com/api/vpc/describeipv6gateways.html +func (client *Client) DescribeIpv6Gateways(request *DescribeIpv6GatewaysRequest) (response *DescribeIpv6GatewaysResponse, err error) { + response = CreateDescribeIpv6GatewaysResponse() + err = client.DoAction(request, response) + return +} + +// DescribeIpv6GatewaysWithChan invokes the vpc.DescribeIpv6Gateways API asynchronously +// api document: https://help.aliyun.com/api/vpc/describeipv6gateways.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeIpv6GatewaysWithChan(request *DescribeIpv6GatewaysRequest) (<-chan *DescribeIpv6GatewaysResponse, <-chan error) { + responseChan := make(chan *DescribeIpv6GatewaysResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DescribeIpv6Gateways(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DescribeIpv6GatewaysWithCallback invokes the vpc.DescribeIpv6Gateways API asynchronously +// api document: https://help.aliyun.com/api/vpc/describeipv6gateways.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeIpv6GatewaysWithCallback(request *DescribeIpv6GatewaysRequest, callback func(response *DescribeIpv6GatewaysResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DescribeIpv6GatewaysResponse + var err error + defer close(result) + response, err = client.DescribeIpv6Gateways(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DescribeIpv6GatewaysRequest is the request struct for api DescribeIpv6Gateways +type DescribeIpv6GatewaysRequest struct { + *requests.RpcRequest + 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"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + VpcId string `position:"Query" name:"VpcId"` + Ipv6GatewayId string `position:"Query" name:"Ipv6GatewayId"` + Name string `position:"Query" name:"Name"` +} + +// DescribeIpv6GatewaysResponse is the response struct for api DescribeIpv6Gateways +type DescribeIpv6GatewaysResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + TotalCount int `json:"TotalCount" xml:"TotalCount"` + PageNumber int `json:"PageNumber" xml:"PageNumber"` + PageSize int `json:"PageSize" xml:"PageSize"` + Ipv6Gateways Ipv6Gateways `json:"Ipv6Gateways" xml:"Ipv6Gateways"` +} + +// CreateDescribeIpv6GatewaysRequest creates a request to invoke DescribeIpv6Gateways API +func CreateDescribeIpv6GatewaysRequest() (request *DescribeIpv6GatewaysRequest) { + request = &DescribeIpv6GatewaysRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "DescribeIpv6Gateways", "vpc", "openAPI") + return +} + +// CreateDescribeIpv6GatewaysResponse creates a response to parse from DescribeIpv6Gateways response +func CreateDescribeIpv6GatewaysResponse() (response *DescribeIpv6GatewaysResponse) { + response = &DescribeIpv6GatewaysResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/describe_nat_gateways.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/describe_nat_gateways.go new file mode 100644 index 000000000..8c7728268 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/describe_nat_gateways.go @@ -0,0 +1,117 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// DescribeNatGateways invokes the vpc.DescribeNatGateways API synchronously +// api document: https://help.aliyun.com/api/vpc/describenatgateways.html +func (client *Client) DescribeNatGateways(request *DescribeNatGatewaysRequest) (response *DescribeNatGatewaysResponse, err error) { + response = CreateDescribeNatGatewaysResponse() + err = client.DoAction(request, response) + return +} + +// DescribeNatGatewaysWithChan invokes the vpc.DescribeNatGateways API asynchronously +// api document: https://help.aliyun.com/api/vpc/describenatgateways.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeNatGatewaysWithChan(request *DescribeNatGatewaysRequest) (<-chan *DescribeNatGatewaysResponse, <-chan error) { + responseChan := make(chan *DescribeNatGatewaysResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DescribeNatGateways(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DescribeNatGatewaysWithCallback invokes the vpc.DescribeNatGateways API asynchronously +// api document: https://help.aliyun.com/api/vpc/describenatgateways.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeNatGatewaysWithCallback(request *DescribeNatGatewaysRequest, callback func(response *DescribeNatGatewaysResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DescribeNatGatewaysResponse + var err error + defer close(result) + response, err = client.DescribeNatGateways(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DescribeNatGatewaysRequest is the request struct for api DescribeNatGateways +type DescribeNatGatewaysRequest struct { + *requests.RpcRequest + 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"` + Spec string `position:"Query" name:"Spec"` + PageNumber requests.Integer `position:"Query" name:"PageNumber"` + VpcId string `position:"Query" name:"VpcId"` + Name string `position:"Query" name:"Name"` + PageSize requests.Integer `position:"Query" name:"PageSize"` + NatGatewayId string `position:"Query" name:"NatGatewayId"` + InstanceChargeType string `position:"Query" name:"InstanceChargeType"` +} + +// DescribeNatGatewaysResponse is the response struct for api DescribeNatGateways +type DescribeNatGatewaysResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + TotalCount int `json:"TotalCount" xml:"TotalCount"` + PageNumber int `json:"PageNumber" xml:"PageNumber"` + PageSize int `json:"PageSize" xml:"PageSize"` + NatGateways NatGateways `json:"NatGateways" xml:"NatGateways"` +} + +// CreateDescribeNatGatewaysRequest creates a request to invoke DescribeNatGateways API +func CreateDescribeNatGatewaysRequest() (request *DescribeNatGatewaysRequest) { + request = &DescribeNatGatewaysRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "DescribeNatGateways", "vpc", "openAPI") + return +} + +// CreateDescribeNatGatewaysResponse creates a response to parse from DescribeNatGateways response +func CreateDescribeNatGatewaysResponse() (response *DescribeNatGatewaysResponse) { + response = &DescribeNatGatewaysResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/describe_nqas.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/describe_nqas.go new file mode 100644 index 000000000..b7279f6fc --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/describe_nqas.go @@ -0,0 +1,115 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// DescribeNqas invokes the vpc.DescribeNqas API synchronously +// api document: https://help.aliyun.com/api/vpc/describenqas.html +func (client *Client) DescribeNqas(request *DescribeNqasRequest) (response *DescribeNqasResponse, err error) { + response = CreateDescribeNqasResponse() + err = client.DoAction(request, response) + return +} + +// DescribeNqasWithChan invokes the vpc.DescribeNqas API asynchronously +// api document: https://help.aliyun.com/api/vpc/describenqas.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeNqasWithChan(request *DescribeNqasRequest) (<-chan *DescribeNqasResponse, <-chan error) { + responseChan := make(chan *DescribeNqasResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DescribeNqas(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DescribeNqasWithCallback invokes the vpc.DescribeNqas API asynchronously +// api document: https://help.aliyun.com/api/vpc/describenqas.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeNqasWithCallback(request *DescribeNqasRequest, callback func(response *DescribeNqasResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DescribeNqasResponse + var err error + defer close(result) + response, err = client.DescribeNqas(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DescribeNqasRequest is the request struct for api DescribeNqas +type DescribeNqasRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + RouterId string `position:"Query" name:"RouterId"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + PageSize requests.Integer `position:"Query" name:"PageSize"` + NqaId string `position:"Query" name:"NqaId"` + IsDefault requests.Boolean `position:"Query" name:"IsDefault"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + PageNumber requests.Integer `position:"Query" name:"PageNumber"` +} + +// DescribeNqasResponse is the response struct for api DescribeNqas +type DescribeNqasResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + TotalCount int `json:"TotalCount" xml:"TotalCount"` + PageNumber int `json:"PageNumber" xml:"PageNumber"` + PageSize int `json:"PageSize" xml:"PageSize"` + Nqas Nqas `json:"Nqas" xml:"Nqas"` +} + +// CreateDescribeNqasRequest creates a request to invoke DescribeNqas API +func CreateDescribeNqasRequest() (request *DescribeNqasRequest) { + request = &DescribeNqasRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "DescribeNqas", "vpc", "openAPI") + return +} + +// CreateDescribeNqasResponse creates a response to parse from DescribeNqas response +func CreateDescribeNqasResponse() (response *DescribeNqasResponse) { + response = &DescribeNqasResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/describe_physical_connection_order.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/describe_physical_connection_order.go new file mode 100644 index 000000000..a4b70e4f3 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/describe_physical_connection_order.go @@ -0,0 +1,110 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// DescribePhysicalConnectionOrder invokes the vpc.DescribePhysicalConnectionOrder API synchronously +// api document: https://help.aliyun.com/api/vpc/describephysicalconnectionorder.html +func (client *Client) DescribePhysicalConnectionOrder(request *DescribePhysicalConnectionOrderRequest) (response *DescribePhysicalConnectionOrderResponse, err error) { + response = CreateDescribePhysicalConnectionOrderResponse() + err = client.DoAction(request, response) + return +} + +// DescribePhysicalConnectionOrderWithChan invokes the vpc.DescribePhysicalConnectionOrder API asynchronously +// api document: https://help.aliyun.com/api/vpc/describephysicalconnectionorder.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribePhysicalConnectionOrderWithChan(request *DescribePhysicalConnectionOrderRequest) (<-chan *DescribePhysicalConnectionOrderResponse, <-chan error) { + responseChan := make(chan *DescribePhysicalConnectionOrderResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DescribePhysicalConnectionOrder(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DescribePhysicalConnectionOrderWithCallback invokes the vpc.DescribePhysicalConnectionOrder API asynchronously +// api document: https://help.aliyun.com/api/vpc/describephysicalconnectionorder.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribePhysicalConnectionOrderWithCallback(request *DescribePhysicalConnectionOrderRequest, callback func(response *DescribePhysicalConnectionOrderResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DescribePhysicalConnectionOrderResponse + var err error + defer close(result) + response, err = client.DescribePhysicalConnectionOrder(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DescribePhysicalConnectionOrderRequest is the request struct for api DescribePhysicalConnectionOrder +type DescribePhysicalConnectionOrderRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + ClientToken string `position:"Query" name:"ClientToken"` + PhysicalConnectionId string `position:"Query" name:"PhysicalConnectionId"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// DescribePhysicalConnectionOrderResponse is the response struct for api DescribePhysicalConnectionOrder +type DescribePhysicalConnectionOrderResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + InstanceId string `json:"InstanceId" xml:"InstanceId"` + OrderId string `json:"OrderId" xml:"OrderId"` +} + +// CreateDescribePhysicalConnectionOrderRequest creates a request to invoke DescribePhysicalConnectionOrder API +func CreateDescribePhysicalConnectionOrderRequest() (request *DescribePhysicalConnectionOrderRequest) { + request = &DescribePhysicalConnectionOrderRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "DescribePhysicalConnectionOrder", "vpc", "openAPI") + return +} + +// CreateDescribePhysicalConnectionOrderResponse creates a response to parse from DescribePhysicalConnectionOrder response +func CreateDescribePhysicalConnectionOrderResponse() (response *DescribePhysicalConnectionOrderResponse) { + response = &DescribePhysicalConnectionOrderResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/describe_physical_connections.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/describe_physical_connections.go new file mode 100644 index 000000000..21969a860 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/describe_physical_connections.go @@ -0,0 +1,120 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// DescribePhysicalConnections invokes the vpc.DescribePhysicalConnections API synchronously +// api document: https://help.aliyun.com/api/vpc/describephysicalconnections.html +func (client *Client) DescribePhysicalConnections(request *DescribePhysicalConnectionsRequest) (response *DescribePhysicalConnectionsResponse, err error) { + response = CreateDescribePhysicalConnectionsResponse() + err = client.DoAction(request, response) + return +} + +// DescribePhysicalConnectionsWithChan invokes the vpc.DescribePhysicalConnections API asynchronously +// api document: https://help.aliyun.com/api/vpc/describephysicalconnections.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribePhysicalConnectionsWithChan(request *DescribePhysicalConnectionsRequest) (<-chan *DescribePhysicalConnectionsResponse, <-chan error) { + responseChan := make(chan *DescribePhysicalConnectionsResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DescribePhysicalConnections(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DescribePhysicalConnectionsWithCallback invokes the vpc.DescribePhysicalConnections API asynchronously +// api document: https://help.aliyun.com/api/vpc/describephysicalconnections.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribePhysicalConnectionsWithCallback(request *DescribePhysicalConnectionsRequest, callback func(response *DescribePhysicalConnectionsResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DescribePhysicalConnectionsResponse + var err error + defer close(result) + response, err = client.DescribePhysicalConnections(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DescribePhysicalConnectionsRequest is the request struct for api DescribePhysicalConnections +type DescribePhysicalConnectionsRequest struct { + *requests.RpcRequest + Filter *[]DescribePhysicalConnectionsFilter `position:"Query" name:"Filter" type:"Repeated"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + ClientToken string `position:"Query" name:"ClientToken"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + PageSize requests.Integer `position:"Query" name:"PageSize"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + PageNumber requests.Integer `position:"Query" name:"PageNumber"` +} + +// DescribePhysicalConnectionsFilter is a repeated param struct in DescribePhysicalConnectionsRequest +type DescribePhysicalConnectionsFilter struct { + Value *[]string `name:"Value" type:"Repeated"` + Key string `name:"Key"` +} + +// DescribePhysicalConnectionsResponse is the response struct for api DescribePhysicalConnections +type DescribePhysicalConnectionsResponse 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"` + PhysicalConnectionSet PhysicalConnectionSet `json:"PhysicalConnectionSet" xml:"PhysicalConnectionSet"` +} + +// CreateDescribePhysicalConnectionsRequest creates a request to invoke DescribePhysicalConnections API +func CreateDescribePhysicalConnectionsRequest() (request *DescribePhysicalConnectionsRequest) { + request = &DescribePhysicalConnectionsRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "DescribePhysicalConnections", "vpc", "openAPI") + return +} + +// CreateDescribePhysicalConnectionsResponse creates a response to parse from DescribePhysicalConnections response +func CreateDescribePhysicalConnectionsResponse() (response *DescribePhysicalConnectionsResponse) { + response = &DescribePhysicalConnectionsResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/describe_regions.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/describe_regions.go new file mode 100644 index 000000000..a8c165f26 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/describe_regions.go @@ -0,0 +1,109 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// DescribeRegions invokes the vpc.DescribeRegions API synchronously +// api document: https://help.aliyun.com/api/vpc/describeregions.html +func (client *Client) DescribeRegions(request *DescribeRegionsRequest) (response *DescribeRegionsResponse, err error) { + response = CreateDescribeRegionsResponse() + err = client.DoAction(request, response) + return +} + +// DescribeRegionsWithChan invokes the vpc.DescribeRegions API asynchronously +// api document: https://help.aliyun.com/api/vpc/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 vpc.DescribeRegions API asynchronously +// api document: https://help.aliyun.com/api/vpc/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 + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + AcceptLanguage string `position:"Query" name:"AcceptLanguage"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + ProductType string `position:"Query" name:"ProductType"` +} + +// 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("Vpc", "2016-04-28", "DescribeRegions", "vpc", "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/vpc/describe_route_table_list.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/describe_route_table_list.go new file mode 100644 index 000000000..24ebe346e --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/describe_route_table_list.go @@ -0,0 +1,128 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// DescribeRouteTableList invokes the vpc.DescribeRouteTableList API synchronously +// api document: https://help.aliyun.com/api/vpc/describeroutetablelist.html +func (client *Client) DescribeRouteTableList(request *DescribeRouteTableListRequest) (response *DescribeRouteTableListResponse, err error) { + response = CreateDescribeRouteTableListResponse() + err = client.DoAction(request, response) + return +} + +// DescribeRouteTableListWithChan invokes the vpc.DescribeRouteTableList API asynchronously +// api document: https://help.aliyun.com/api/vpc/describeroutetablelist.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeRouteTableListWithChan(request *DescribeRouteTableListRequest) (<-chan *DescribeRouteTableListResponse, <-chan error) { + responseChan := make(chan *DescribeRouteTableListResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DescribeRouteTableList(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DescribeRouteTableListWithCallback invokes the vpc.DescribeRouteTableList API asynchronously +// api document: https://help.aliyun.com/api/vpc/describeroutetablelist.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeRouteTableListWithCallback(request *DescribeRouteTableListRequest, callback func(response *DescribeRouteTableListResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DescribeRouteTableListResponse + var err error + defer close(result) + response, err = client.DescribeRouteTableList(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DescribeRouteTableListRequest is the request struct for api DescribeRouteTableList +type DescribeRouteTableListRequest struct { + *requests.RpcRequest + 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"` + PageNumber requests.Integer `position:"Query" name:"PageNumber"` + RouterType string `position:"Query" name:"RouterType"` + ResourceGroupId string `position:"Query" name:"ResourceGroupId"` + RouteTableName string `position:"Query" name:"RouteTableName"` + RouterId string `position:"Query" name:"RouterId"` + VpcId string `position:"Query" name:"VpcId"` + PageSize requests.Integer `position:"Query" name:"PageSize"` + Tag *[]DescribeRouteTableListTag `position:"Query" name:"Tag" type:"Repeated"` + RouteTableId string `position:"Query" name:"RouteTableId"` +} + +// DescribeRouteTableListTag is a repeated param struct in DescribeRouteTableListRequest +type DescribeRouteTableListTag struct { + Value string `name:"Value"` + Key string `name:"Key"` +} + +// DescribeRouteTableListResponse is the response struct for api DescribeRouteTableList +type DescribeRouteTableListResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + Code string `json:"Code" xml:"Code"` + Message string `json:"Message" xml:"Message"` + Success bool `json:"Success" xml:"Success"` + PageSize int `json:"PageSize" xml:"PageSize"` + PageNumber int `json:"PageNumber" xml:"PageNumber"` + TotalCount int `json:"TotalCount" xml:"TotalCount"` + RouterTableList RouterTableList `json:"RouterTableList" xml:"RouterTableList"` +} + +// CreateDescribeRouteTableListRequest creates a request to invoke DescribeRouteTableList API +func CreateDescribeRouteTableListRequest() (request *DescribeRouteTableListRequest) { + request = &DescribeRouteTableListRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "DescribeRouteTableList", "vpc", "openAPI") + return +} + +// CreateDescribeRouteTableListResponse creates a response to parse from DescribeRouteTableList response +func CreateDescribeRouteTableListResponse() (response *DescribeRouteTableListResponse) { + response = &DescribeRouteTableListResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/describe_route_tables.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/describe_route_tables.go new file mode 100644 index 000000000..014520156 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/describe_route_tables.go @@ -0,0 +1,119 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// DescribeRouteTables invokes the vpc.DescribeRouteTables API synchronously +// api document: https://help.aliyun.com/api/vpc/describeroutetables.html +func (client *Client) DescribeRouteTables(request *DescribeRouteTablesRequest) (response *DescribeRouteTablesResponse, err error) { + response = CreateDescribeRouteTablesResponse() + err = client.DoAction(request, response) + return +} + +// DescribeRouteTablesWithChan invokes the vpc.DescribeRouteTables API asynchronously +// api document: https://help.aliyun.com/api/vpc/describeroutetables.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeRouteTablesWithChan(request *DescribeRouteTablesRequest) (<-chan *DescribeRouteTablesResponse, <-chan error) { + responseChan := make(chan *DescribeRouteTablesResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DescribeRouteTables(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DescribeRouteTablesWithCallback invokes the vpc.DescribeRouteTables API asynchronously +// api document: https://help.aliyun.com/api/vpc/describeroutetables.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeRouteTablesWithCallback(request *DescribeRouteTablesRequest, callback func(response *DescribeRouteTablesResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DescribeRouteTablesResponse + var err error + defer close(result) + response, err = client.DescribeRouteTables(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DescribeRouteTablesRequest is the request struct for api DescribeRouteTables +type DescribeRouteTablesRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + VRouterId string `position:"Query" name:"VRouterId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + Type string `position:"Query" name:"Type"` + PageNumber requests.Integer `position:"Query" name:"PageNumber"` + RouterType string `position:"Query" name:"RouterType"` + ResourceGroupId string `position:"Query" name:"ResourceGroupId"` + RouteTableName string `position:"Query" name:"RouteTableName"` + RouterId string `position:"Query" name:"RouterId"` + PageSize requests.Integer `position:"Query" name:"PageSize"` + RouteTableId string `position:"Query" name:"RouteTableId"` +} + +// DescribeRouteTablesResponse is the response struct for api DescribeRouteTables +type DescribeRouteTablesResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + TotalCount int `json:"TotalCount" xml:"TotalCount"` + PageNumber int `json:"PageNumber" xml:"PageNumber"` + PageSize int `json:"PageSize" xml:"PageSize"` + RouteTables RouteTables `json:"RouteTables" xml:"RouteTables"` +} + +// CreateDescribeRouteTablesRequest creates a request to invoke DescribeRouteTables API +func CreateDescribeRouteTablesRequest() (request *DescribeRouteTablesRequest) { + request = &DescribeRouteTablesRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "DescribeRouteTables", "vpc", "openAPI") + return +} + +// CreateDescribeRouteTablesResponse creates a response to parse from DescribeRouteTables response +func CreateDescribeRouteTablesResponse() (response *DescribeRouteTablesResponse) { + response = &DescribeRouteTablesResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/describe_router_interfaces.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/describe_router_interfaces.go new file mode 100644 index 000000000..aac1fa34b --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/describe_router_interfaces.go @@ -0,0 +1,119 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// DescribeRouterInterfaces invokes the vpc.DescribeRouterInterfaces API synchronously +// api document: https://help.aliyun.com/api/vpc/describerouterinterfaces.html +func (client *Client) DescribeRouterInterfaces(request *DescribeRouterInterfacesRequest) (response *DescribeRouterInterfacesResponse, err error) { + response = CreateDescribeRouterInterfacesResponse() + err = client.DoAction(request, response) + return +} + +// DescribeRouterInterfacesWithChan invokes the vpc.DescribeRouterInterfaces API asynchronously +// api document: https://help.aliyun.com/api/vpc/describerouterinterfaces.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeRouterInterfacesWithChan(request *DescribeRouterInterfacesRequest) (<-chan *DescribeRouterInterfacesResponse, <-chan error) { + responseChan := make(chan *DescribeRouterInterfacesResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DescribeRouterInterfaces(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DescribeRouterInterfacesWithCallback invokes the vpc.DescribeRouterInterfaces API asynchronously +// api document: https://help.aliyun.com/api/vpc/describerouterinterfaces.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeRouterInterfacesWithCallback(request *DescribeRouterInterfacesRequest, callback func(response *DescribeRouterInterfacesResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DescribeRouterInterfacesResponse + var err error + defer close(result) + response, err = client.DescribeRouterInterfaces(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DescribeRouterInterfacesRequest is the request struct for api DescribeRouterInterfaces +type DescribeRouterInterfacesRequest struct { + *requests.RpcRequest + Filter *[]DescribeRouterInterfacesFilter `position:"Query" name:"Filter" type:"Repeated"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + PageSize requests.Integer `position:"Query" name:"PageSize"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + IncludeReservationData requests.Boolean `position:"Query" name:"IncludeReservationData"` + PageNumber requests.Integer `position:"Query" name:"PageNumber"` +} + +// DescribeRouterInterfacesFilter is a repeated param struct in DescribeRouterInterfacesRequest +type DescribeRouterInterfacesFilter struct { + Value *[]string `name:"Value" type:"Repeated"` + Key string `name:"Key"` +} + +// DescribeRouterInterfacesResponse is the response struct for api DescribeRouterInterfaces +type DescribeRouterInterfacesResponse 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"` + RouterInterfaceSet RouterInterfaceSet `json:"RouterInterfaceSet" xml:"RouterInterfaceSet"` +} + +// CreateDescribeRouterInterfacesRequest creates a request to invoke DescribeRouterInterfaces API +func CreateDescribeRouterInterfacesRequest() (request *DescribeRouterInterfacesRequest) { + request = &DescribeRouterInterfacesRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "DescribeRouterInterfaces", "vpc", "openAPI") + return +} + +// CreateDescribeRouterInterfacesResponse creates a response to parse from DescribeRouterInterfaces response +func CreateDescribeRouterInterfacesResponse() (response *DescribeRouterInterfacesResponse) { + response = &DescribeRouterInterfacesResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/describe_server_related_global_acceleration_instances.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/describe_server_related_global_acceleration_instances.go new file mode 100644 index 000000000..716280478 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/describe_server_related_global_acceleration_instances.go @@ -0,0 +1,109 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// DescribeServerRelatedGlobalAccelerationInstances invokes the vpc.DescribeServerRelatedGlobalAccelerationInstances API synchronously +// api document: https://help.aliyun.com/api/vpc/describeserverrelatedglobalaccelerationinstances.html +func (client *Client) DescribeServerRelatedGlobalAccelerationInstances(request *DescribeServerRelatedGlobalAccelerationInstancesRequest) (response *DescribeServerRelatedGlobalAccelerationInstancesResponse, err error) { + response = CreateDescribeServerRelatedGlobalAccelerationInstancesResponse() + err = client.DoAction(request, response) + return +} + +// DescribeServerRelatedGlobalAccelerationInstancesWithChan invokes the vpc.DescribeServerRelatedGlobalAccelerationInstances API asynchronously +// api document: https://help.aliyun.com/api/vpc/describeserverrelatedglobalaccelerationinstances.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeServerRelatedGlobalAccelerationInstancesWithChan(request *DescribeServerRelatedGlobalAccelerationInstancesRequest) (<-chan *DescribeServerRelatedGlobalAccelerationInstancesResponse, <-chan error) { + responseChan := make(chan *DescribeServerRelatedGlobalAccelerationInstancesResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DescribeServerRelatedGlobalAccelerationInstances(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DescribeServerRelatedGlobalAccelerationInstancesWithCallback invokes the vpc.DescribeServerRelatedGlobalAccelerationInstances API asynchronously +// api document: https://help.aliyun.com/api/vpc/describeserverrelatedglobalaccelerationinstances.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeServerRelatedGlobalAccelerationInstancesWithCallback(request *DescribeServerRelatedGlobalAccelerationInstancesRequest, callback func(response *DescribeServerRelatedGlobalAccelerationInstancesResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DescribeServerRelatedGlobalAccelerationInstancesResponse + var err error + defer close(result) + response, err = client.DescribeServerRelatedGlobalAccelerationInstances(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DescribeServerRelatedGlobalAccelerationInstancesRequest is the request struct for api DescribeServerRelatedGlobalAccelerationInstances +type DescribeServerRelatedGlobalAccelerationInstancesRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ServerType string `position:"Query" name:"ServerType"` + 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"` +} + +// DescribeServerRelatedGlobalAccelerationInstancesResponse is the response struct for api DescribeServerRelatedGlobalAccelerationInstances +type DescribeServerRelatedGlobalAccelerationInstancesResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + GlobalAccelerationInstances GlobalAccelerationInstancesInDescribeServerRelatedGlobalAccelerationInstances `json:"GlobalAccelerationInstances" xml:"GlobalAccelerationInstances"` +} + +// CreateDescribeServerRelatedGlobalAccelerationInstancesRequest creates a request to invoke DescribeServerRelatedGlobalAccelerationInstances API +func CreateDescribeServerRelatedGlobalAccelerationInstancesRequest() (request *DescribeServerRelatedGlobalAccelerationInstancesRequest) { + request = &DescribeServerRelatedGlobalAccelerationInstancesRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "DescribeServerRelatedGlobalAccelerationInstances", "vpc", "openAPI") + return +} + +// CreateDescribeServerRelatedGlobalAccelerationInstancesResponse creates a response to parse from DescribeServerRelatedGlobalAccelerationInstances response +func CreateDescribeServerRelatedGlobalAccelerationInstancesResponse() (response *DescribeServerRelatedGlobalAccelerationInstancesResponse) { + response = &DescribeServerRelatedGlobalAccelerationInstancesResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/describe_snat_table_entries.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/describe_snat_table_entries.go new file mode 100644 index 000000000..b762f4a5c --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/describe_snat_table_entries.go @@ -0,0 +1,118 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// DescribeSnatTableEntries invokes the vpc.DescribeSnatTableEntries API synchronously +// api document: https://help.aliyun.com/api/vpc/describesnattableentries.html +func (client *Client) DescribeSnatTableEntries(request *DescribeSnatTableEntriesRequest) (response *DescribeSnatTableEntriesResponse, err error) { + response = CreateDescribeSnatTableEntriesResponse() + err = client.DoAction(request, response) + return +} + +// DescribeSnatTableEntriesWithChan invokes the vpc.DescribeSnatTableEntries API asynchronously +// api document: https://help.aliyun.com/api/vpc/describesnattableentries.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeSnatTableEntriesWithChan(request *DescribeSnatTableEntriesRequest) (<-chan *DescribeSnatTableEntriesResponse, <-chan error) { + responseChan := make(chan *DescribeSnatTableEntriesResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DescribeSnatTableEntries(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DescribeSnatTableEntriesWithCallback invokes the vpc.DescribeSnatTableEntries API asynchronously +// api document: https://help.aliyun.com/api/vpc/describesnattableentries.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeSnatTableEntriesWithCallback(request *DescribeSnatTableEntriesRequest, callback func(response *DescribeSnatTableEntriesResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DescribeSnatTableEntriesResponse + var err error + defer close(result) + response, err = client.DescribeSnatTableEntries(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DescribeSnatTableEntriesRequest is the request struct for api DescribeSnatTableEntries +type DescribeSnatTableEntriesRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + SourceCIDR string `position:"Query" name:"SourceCIDR"` + SnatTableId string `position:"Query" name:"SnatTableId"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + SnatIp string `position:"Query" name:"SnatIp"` + PageNumber requests.Integer `position:"Query" name:"PageNumber"` + SourceVSwitchId string `position:"Query" name:"SourceVSwitchId"` + SnatEntryName string `position:"Query" name:"SnatEntryName"` + PageSize requests.Integer `position:"Query" name:"PageSize"` + SnatEntryId string `position:"Query" name:"SnatEntryId"` +} + +// DescribeSnatTableEntriesResponse is the response struct for api DescribeSnatTableEntries +type DescribeSnatTableEntriesResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + TotalCount int `json:"TotalCount" xml:"TotalCount"` + PageNumber int `json:"PageNumber" xml:"PageNumber"` + PageSize int `json:"PageSize" xml:"PageSize"` + SnatTableEntries SnatTableEntries `json:"SnatTableEntries" xml:"SnatTableEntries"` +} + +// CreateDescribeSnatTableEntriesRequest creates a request to invoke DescribeSnatTableEntries API +func CreateDescribeSnatTableEntriesRequest() (request *DescribeSnatTableEntriesRequest) { + request = &DescribeSnatTableEntriesRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "DescribeSnatTableEntries", "vpc", "openAPI") + return +} + +// CreateDescribeSnatTableEntriesResponse creates a response to parse from DescribeSnatTableEntries response +func CreateDescribeSnatTableEntriesResponse() (response *DescribeSnatTableEntriesResponse) { + response = &DescribeSnatTableEntriesResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/describe_ssl_vpn_client_cert.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/describe_ssl_vpn_client_cert.go new file mode 100644 index 000000000..4328c4d93 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/describe_ssl_vpn_client_cert.go @@ -0,0 +1,118 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// DescribeSslVpnClientCert invokes the vpc.DescribeSslVpnClientCert API synchronously +// api document: https://help.aliyun.com/api/vpc/describesslvpnclientcert.html +func (client *Client) DescribeSslVpnClientCert(request *DescribeSslVpnClientCertRequest) (response *DescribeSslVpnClientCertResponse, err error) { + response = CreateDescribeSslVpnClientCertResponse() + err = client.DoAction(request, response) + return +} + +// DescribeSslVpnClientCertWithChan invokes the vpc.DescribeSslVpnClientCert API asynchronously +// api document: https://help.aliyun.com/api/vpc/describesslvpnclientcert.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeSslVpnClientCertWithChan(request *DescribeSslVpnClientCertRequest) (<-chan *DescribeSslVpnClientCertResponse, <-chan error) { + responseChan := make(chan *DescribeSslVpnClientCertResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DescribeSslVpnClientCert(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DescribeSslVpnClientCertWithCallback invokes the vpc.DescribeSslVpnClientCert API asynchronously +// api document: https://help.aliyun.com/api/vpc/describesslvpnclientcert.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeSslVpnClientCertWithCallback(request *DescribeSslVpnClientCertRequest, callback func(response *DescribeSslVpnClientCertResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DescribeSslVpnClientCertResponse + var err error + defer close(result) + response, err = client.DescribeSslVpnClientCert(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DescribeSslVpnClientCertRequest is the request struct for api DescribeSslVpnClientCert +type DescribeSslVpnClientCertRequest struct { + *requests.RpcRequest + 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"` + SslVpnClientCertId string `position:"Query" name:"SslVpnClientCertId"` +} + +// DescribeSslVpnClientCertResponse is the response struct for api DescribeSslVpnClientCert +type DescribeSslVpnClientCertResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + RegionId string `json:"RegionId" xml:"RegionId"` + SslVpnClientCertId string `json:"SslVpnClientCertId" xml:"SslVpnClientCertId"` + Name string `json:"Name" xml:"Name"` + SslVpnServerId string `json:"SslVpnServerId" xml:"SslVpnServerId"` + CaCert string `json:"CaCert" xml:"CaCert"` + ClientCert string `json:"ClientCert" xml:"ClientCert"` + ClientKey string `json:"ClientKey" xml:"ClientKey"` + ClientConfig string `json:"ClientConfig" xml:"ClientConfig"` + CreateTime int `json:"CreateTime" xml:"CreateTime"` + EndTime int `json:"EndTime" xml:"EndTime"` + Status string `json:"Status" xml:"Status"` +} + +// CreateDescribeSslVpnClientCertRequest creates a request to invoke DescribeSslVpnClientCert API +func CreateDescribeSslVpnClientCertRequest() (request *DescribeSslVpnClientCertRequest) { + request = &DescribeSslVpnClientCertRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "DescribeSslVpnClientCert", "vpc", "openAPI") + return +} + +// CreateDescribeSslVpnClientCertResponse creates a response to parse from DescribeSslVpnClientCert response +func CreateDescribeSslVpnClientCertResponse() (response *DescribeSslVpnClientCertResponse) { + response = &DescribeSslVpnClientCertResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/describe_ssl_vpn_client_certs.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/describe_ssl_vpn_client_certs.go new file mode 100644 index 000000000..f91d94d82 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/describe_ssl_vpn_client_certs.go @@ -0,0 +1,115 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// DescribeSslVpnClientCerts invokes the vpc.DescribeSslVpnClientCerts API synchronously +// api document: https://help.aliyun.com/api/vpc/describesslvpnclientcerts.html +func (client *Client) DescribeSslVpnClientCerts(request *DescribeSslVpnClientCertsRequest) (response *DescribeSslVpnClientCertsResponse, err error) { + response = CreateDescribeSslVpnClientCertsResponse() + err = client.DoAction(request, response) + return +} + +// DescribeSslVpnClientCertsWithChan invokes the vpc.DescribeSslVpnClientCerts API asynchronously +// api document: https://help.aliyun.com/api/vpc/describesslvpnclientcerts.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeSslVpnClientCertsWithChan(request *DescribeSslVpnClientCertsRequest) (<-chan *DescribeSslVpnClientCertsResponse, <-chan error) { + responseChan := make(chan *DescribeSslVpnClientCertsResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DescribeSslVpnClientCerts(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DescribeSslVpnClientCertsWithCallback invokes the vpc.DescribeSslVpnClientCerts API asynchronously +// api document: https://help.aliyun.com/api/vpc/describesslvpnclientcerts.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeSslVpnClientCertsWithCallback(request *DescribeSslVpnClientCertsRequest, callback func(response *DescribeSslVpnClientCertsResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DescribeSslVpnClientCertsResponse + var err error + defer close(result) + response, err = client.DescribeSslVpnClientCerts(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DescribeSslVpnClientCertsRequest is the request struct for api DescribeSslVpnClientCerts +type DescribeSslVpnClientCertsRequest struct { + *requests.RpcRequest + SslVpnServerId string `position:"Query" name:"SslVpnServerId"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + Name string `position:"Query" name:"Name"` + PageSize requests.Integer `position:"Query" name:"PageSize"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + SslVpnClientCertId string `position:"Query" name:"SslVpnClientCertId"` + PageNumber requests.Integer `position:"Query" name:"PageNumber"` +} + +// DescribeSslVpnClientCertsResponse is the response struct for api DescribeSslVpnClientCerts +type DescribeSslVpnClientCertsResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + TotalCount int `json:"TotalCount" xml:"TotalCount"` + PageNumber int `json:"PageNumber" xml:"PageNumber"` + PageSize int `json:"PageSize" xml:"PageSize"` + SslVpnClientCertKeys SslVpnClientCertKeys `json:"SslVpnClientCertKeys" xml:"SslVpnClientCertKeys"` +} + +// CreateDescribeSslVpnClientCertsRequest creates a request to invoke DescribeSslVpnClientCerts API +func CreateDescribeSslVpnClientCertsRequest() (request *DescribeSslVpnClientCertsRequest) { + request = &DescribeSslVpnClientCertsRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "DescribeSslVpnClientCerts", "vpc", "openAPI") + return +} + +// CreateDescribeSslVpnClientCertsResponse creates a response to parse from DescribeSslVpnClientCerts response +func CreateDescribeSslVpnClientCertsResponse() (response *DescribeSslVpnClientCertsResponse) { + response = &DescribeSslVpnClientCertsResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/describe_ssl_vpn_servers.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/describe_ssl_vpn_servers.go new file mode 100644 index 000000000..71635c82a --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/describe_ssl_vpn_servers.go @@ -0,0 +1,115 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// DescribeSslVpnServers invokes the vpc.DescribeSslVpnServers API synchronously +// api document: https://help.aliyun.com/api/vpc/describesslvpnservers.html +func (client *Client) DescribeSslVpnServers(request *DescribeSslVpnServersRequest) (response *DescribeSslVpnServersResponse, err error) { + response = CreateDescribeSslVpnServersResponse() + err = client.DoAction(request, response) + return +} + +// DescribeSslVpnServersWithChan invokes the vpc.DescribeSslVpnServers API asynchronously +// api document: https://help.aliyun.com/api/vpc/describesslvpnservers.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeSslVpnServersWithChan(request *DescribeSslVpnServersRequest) (<-chan *DescribeSslVpnServersResponse, <-chan error) { + responseChan := make(chan *DescribeSslVpnServersResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DescribeSslVpnServers(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DescribeSslVpnServersWithCallback invokes the vpc.DescribeSslVpnServers API asynchronously +// api document: https://help.aliyun.com/api/vpc/describesslvpnservers.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeSslVpnServersWithCallback(request *DescribeSslVpnServersRequest, callback func(response *DescribeSslVpnServersResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DescribeSslVpnServersResponse + var err error + defer close(result) + response, err = client.DescribeSslVpnServers(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DescribeSslVpnServersRequest is the request struct for api DescribeSslVpnServers +type DescribeSslVpnServersRequest struct { + *requests.RpcRequest + SslVpnServerId string `position:"Query" name:"SslVpnServerId"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + Name string `position:"Query" name:"Name"` + PageSize requests.Integer `position:"Query" name:"PageSize"` + VpnGatewayId string `position:"Query" name:"VpnGatewayId"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + PageNumber requests.Integer `position:"Query" name:"PageNumber"` +} + +// DescribeSslVpnServersResponse is the response struct for api DescribeSslVpnServers +type DescribeSslVpnServersResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + TotalCount int `json:"TotalCount" xml:"TotalCount"` + PageNumber int `json:"PageNumber" xml:"PageNumber"` + PageSize int `json:"PageSize" xml:"PageSize"` + SslVpnServers SslVpnServers `json:"SslVpnServers" xml:"SslVpnServers"` +} + +// CreateDescribeSslVpnServersRequest creates a request to invoke DescribeSslVpnServers API +func CreateDescribeSslVpnServersRequest() (request *DescribeSslVpnServersRequest) { + request = &DescribeSslVpnServersRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "DescribeSslVpnServers", "vpc", "openAPI") + return +} + +// CreateDescribeSslVpnServersResponse creates a response to parse from DescribeSslVpnServers response +func CreateDescribeSslVpnServersResponse() (response *DescribeSslVpnServersResponse) { + response = &DescribeSslVpnServersResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/describe_v_routers.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/describe_v_routers.go new file mode 100644 index 000000000..11330b3bf --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/describe_v_routers.go @@ -0,0 +1,113 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// DescribeVRouters invokes the vpc.DescribeVRouters API synchronously +// api document: https://help.aliyun.com/api/vpc/describevrouters.html +func (client *Client) DescribeVRouters(request *DescribeVRoutersRequest) (response *DescribeVRoutersResponse, err error) { + response = CreateDescribeVRoutersResponse() + err = client.DoAction(request, response) + return +} + +// DescribeVRoutersWithChan invokes the vpc.DescribeVRouters API asynchronously +// api document: https://help.aliyun.com/api/vpc/describevrouters.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeVRoutersWithChan(request *DescribeVRoutersRequest) (<-chan *DescribeVRoutersResponse, <-chan error) { + responseChan := make(chan *DescribeVRoutersResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DescribeVRouters(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DescribeVRoutersWithCallback invokes the vpc.DescribeVRouters API asynchronously +// api document: https://help.aliyun.com/api/vpc/describevrouters.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeVRoutersWithCallback(request *DescribeVRoutersRequest, callback func(response *DescribeVRoutersResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DescribeVRoutersResponse + var err error + defer close(result) + response, err = client.DescribeVRouters(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DescribeVRoutersRequest is the request struct for api DescribeVRouters +type DescribeVRoutersRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + VRouterId string `position:"Query" name:"VRouterId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + PageSize requests.Integer `position:"Query" name:"PageSize"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + PageNumber requests.Integer `position:"Query" name:"PageNumber"` +} + +// DescribeVRoutersResponse is the response struct for api DescribeVRouters +type DescribeVRoutersResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + TotalCount int `json:"TotalCount" xml:"TotalCount"` + PageNumber int `json:"PageNumber" xml:"PageNumber"` + PageSize int `json:"PageSize" xml:"PageSize"` + VRouters VRouters `json:"VRouters" xml:"VRouters"` +} + +// CreateDescribeVRoutersRequest creates a request to invoke DescribeVRouters API +func CreateDescribeVRoutersRequest() (request *DescribeVRoutersRequest) { + request = &DescribeVRoutersRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "DescribeVRouters", "vpc", "openAPI") + return +} + +// CreateDescribeVRoutersResponse creates a response to parse from DescribeVRouters response +func CreateDescribeVRoutersResponse() (response *DescribeVRoutersResponse) { + response = &DescribeVRoutersResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/describe_v_switch_attributes.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/describe_v_switch_attributes.go new file mode 100644 index 000000000..3bffb6a53 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/describe_v_switch_attributes.go @@ -0,0 +1,121 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// DescribeVSwitchAttributes invokes the vpc.DescribeVSwitchAttributes API synchronously +// api document: https://help.aliyun.com/api/vpc/describevswitchattributes.html +func (client *Client) DescribeVSwitchAttributes(request *DescribeVSwitchAttributesRequest) (response *DescribeVSwitchAttributesResponse, err error) { + response = CreateDescribeVSwitchAttributesResponse() + err = client.DoAction(request, response) + return +} + +// DescribeVSwitchAttributesWithChan invokes the vpc.DescribeVSwitchAttributes API asynchronously +// api document: https://help.aliyun.com/api/vpc/describevswitchattributes.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeVSwitchAttributesWithChan(request *DescribeVSwitchAttributesRequest) (<-chan *DescribeVSwitchAttributesResponse, <-chan error) { + responseChan := make(chan *DescribeVSwitchAttributesResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DescribeVSwitchAttributes(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DescribeVSwitchAttributesWithCallback invokes the vpc.DescribeVSwitchAttributes API asynchronously +// api document: https://help.aliyun.com/api/vpc/describevswitchattributes.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeVSwitchAttributesWithCallback(request *DescribeVSwitchAttributesRequest, callback func(response *DescribeVSwitchAttributesResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DescribeVSwitchAttributesResponse + var err error + defer close(result) + response, err = client.DescribeVSwitchAttributes(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DescribeVSwitchAttributesRequest is the request struct for api DescribeVSwitchAttributes +type DescribeVSwitchAttributesRequest struct { + *requests.RpcRequest + VSwitchId string `position:"Query" name:"VSwitchId"` + 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"` +} + +// DescribeVSwitchAttributesResponse is the response struct for api DescribeVSwitchAttributes +type DescribeVSwitchAttributesResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + VSwitchId string `json:"VSwitchId" xml:"VSwitchId"` + VpcId string `json:"VpcId" xml:"VpcId"` + Status string `json:"Status" xml:"Status"` + CidrBlock string `json:"CidrBlock" xml:"CidrBlock"` + Ipv6CidrBlock string `json:"Ipv6CidrBlock" xml:"Ipv6CidrBlock"` + ZoneId string `json:"ZoneId" xml:"ZoneId"` + AvailableIpAddressCount int `json:"AvailableIpAddressCount" xml:"AvailableIpAddressCount"` + Description string `json:"Description" xml:"Description"` + VSwitchName string `json:"VSwitchName" xml:"VSwitchName"` + CreationTime string `json:"CreationTime" xml:"CreationTime"` + IsDefault bool `json:"IsDefault" xml:"IsDefault"` + ResourceGroupId string `json:"ResourceGroupId" xml:"ResourceGroupId"` + RouteTable RouteTable `json:"RouteTable" xml:"RouteTable"` + CloudResources CloudResourcesInDescribeVSwitchAttributes `json:"CloudResources" xml:"CloudResources"` +} + +// CreateDescribeVSwitchAttributesRequest creates a request to invoke DescribeVSwitchAttributes API +func CreateDescribeVSwitchAttributesRequest() (request *DescribeVSwitchAttributesRequest) { + request = &DescribeVSwitchAttributesRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "DescribeVSwitchAttributes", "vpc", "openAPI") + return +} + +// CreateDescribeVSwitchAttributesResponse creates a response to parse from DescribeVSwitchAttributes response +func CreateDescribeVSwitchAttributesResponse() (response *DescribeVSwitchAttributesResponse) { + response = &DescribeVSwitchAttributesResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/describe_v_switches.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/describe_v_switches.go new file mode 100644 index 000000000..2f51e1017 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/describe_v_switches.go @@ -0,0 +1,126 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// DescribeVSwitches invokes the vpc.DescribeVSwitches API synchronously +// api document: https://help.aliyun.com/api/vpc/describevswitches.html +func (client *Client) DescribeVSwitches(request *DescribeVSwitchesRequest) (response *DescribeVSwitchesResponse, err error) { + response = CreateDescribeVSwitchesResponse() + err = client.DoAction(request, response) + return +} + +// DescribeVSwitchesWithChan invokes the vpc.DescribeVSwitches API asynchronously +// api document: https://help.aliyun.com/api/vpc/describevswitches.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeVSwitchesWithChan(request *DescribeVSwitchesRequest) (<-chan *DescribeVSwitchesResponse, <-chan error) { + responseChan := make(chan *DescribeVSwitchesResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DescribeVSwitches(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DescribeVSwitchesWithCallback invokes the vpc.DescribeVSwitches API asynchronously +// api document: https://help.aliyun.com/api/vpc/describevswitches.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeVSwitchesWithCallback(request *DescribeVSwitchesRequest, callback func(response *DescribeVSwitchesResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DescribeVSwitchesResponse + var err error + defer close(result) + response, err = client.DescribeVSwitches(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DescribeVSwitchesRequest is the request struct for api DescribeVSwitches +type DescribeVSwitchesRequest struct { + *requests.RpcRequest + 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"` + PageNumber requests.Integer `position:"Query" name:"PageNumber"` + VSwitchId string `position:"Query" name:"VSwitchId"` + ResourceGroupId string `position:"Query" name:"ResourceGroupId"` + VpcId string `position:"Query" name:"VpcId"` + VSwitchName string `position:"Query" name:"VSwitchName"` + PageSize requests.Integer `position:"Query" name:"PageSize"` + ZoneId string `position:"Query" name:"ZoneId"` + Tag *[]DescribeVSwitchesTag `position:"Query" name:"Tag" type:"Repeated"` + IsDefault requests.Boolean `position:"Query" name:"IsDefault"` + RouteTableId string `position:"Query" name:"RouteTableId"` +} + +// DescribeVSwitchesTag is a repeated param struct in DescribeVSwitchesRequest +type DescribeVSwitchesTag struct { + Value string `name:"Value"` + Key string `name:"Key"` +} + +// DescribeVSwitchesResponse is the response struct for api DescribeVSwitches +type DescribeVSwitchesResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + TotalCount int `json:"TotalCount" xml:"TotalCount"` + PageNumber int `json:"PageNumber" xml:"PageNumber"` + PageSize int `json:"PageSize" xml:"PageSize"` + VSwitches VSwitches `json:"VSwitches" xml:"VSwitches"` +} + +// CreateDescribeVSwitchesRequest creates a request to invoke DescribeVSwitches API +func CreateDescribeVSwitchesRequest() (request *DescribeVSwitchesRequest) { + request = &DescribeVSwitchesRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "DescribeVSwitches", "vpc", "openAPI") + return +} + +// CreateDescribeVSwitchesResponse creates a response to parse from DescribeVSwitches response +func CreateDescribeVSwitchesResponse() (response *DescribeVSwitchesResponse) { + response = &DescribeVSwitchesResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/describe_virtual_border_routers.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/describe_virtual_border_routers.go new file mode 100644 index 000000000..884d87aec --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/describe_virtual_border_routers.go @@ -0,0 +1,118 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// DescribeVirtualBorderRouters invokes the vpc.DescribeVirtualBorderRouters API synchronously +// api document: https://help.aliyun.com/api/vpc/describevirtualborderrouters.html +func (client *Client) DescribeVirtualBorderRouters(request *DescribeVirtualBorderRoutersRequest) (response *DescribeVirtualBorderRoutersResponse, err error) { + response = CreateDescribeVirtualBorderRoutersResponse() + err = client.DoAction(request, response) + return +} + +// DescribeVirtualBorderRoutersWithChan invokes the vpc.DescribeVirtualBorderRouters API asynchronously +// api document: https://help.aliyun.com/api/vpc/describevirtualborderrouters.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeVirtualBorderRoutersWithChan(request *DescribeVirtualBorderRoutersRequest) (<-chan *DescribeVirtualBorderRoutersResponse, <-chan error) { + responseChan := make(chan *DescribeVirtualBorderRoutersResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DescribeVirtualBorderRouters(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DescribeVirtualBorderRoutersWithCallback invokes the vpc.DescribeVirtualBorderRouters API asynchronously +// api document: https://help.aliyun.com/api/vpc/describevirtualborderrouters.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeVirtualBorderRoutersWithCallback(request *DescribeVirtualBorderRoutersRequest, callback func(response *DescribeVirtualBorderRoutersResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DescribeVirtualBorderRoutersResponse + var err error + defer close(result) + response, err = client.DescribeVirtualBorderRouters(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DescribeVirtualBorderRoutersRequest is the request struct for api DescribeVirtualBorderRouters +type DescribeVirtualBorderRoutersRequest struct { + *requests.RpcRequest + Filter *[]DescribeVirtualBorderRoutersFilter `position:"Query" name:"Filter" type:"Repeated"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + PageSize requests.Integer `position:"Query" name:"PageSize"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + PageNumber requests.Integer `position:"Query" name:"PageNumber"` +} + +// DescribeVirtualBorderRoutersFilter is a repeated param struct in DescribeVirtualBorderRoutersRequest +type DescribeVirtualBorderRoutersFilter struct { + Value *[]string `name:"Value" type:"Repeated"` + Key string `name:"Key"` +} + +// DescribeVirtualBorderRoutersResponse is the response struct for api DescribeVirtualBorderRouters +type DescribeVirtualBorderRoutersResponse 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"` + VirtualBorderRouterSet VirtualBorderRouterSet `json:"VirtualBorderRouterSet" xml:"VirtualBorderRouterSet"` +} + +// CreateDescribeVirtualBorderRoutersRequest creates a request to invoke DescribeVirtualBorderRouters API +func CreateDescribeVirtualBorderRoutersRequest() (request *DescribeVirtualBorderRoutersRequest) { + request = &DescribeVirtualBorderRoutersRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "DescribeVirtualBorderRouters", "vpc", "openAPI") + return +} + +// CreateDescribeVirtualBorderRoutersResponse creates a response to parse from DescribeVirtualBorderRouters response +func CreateDescribeVirtualBorderRoutersResponse() (response *DescribeVirtualBorderRoutersResponse) { + response = &DescribeVirtualBorderRoutersResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/describe_virtual_border_routers_for_physical_connection.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/describe_virtual_border_routers_for_physical_connection.go new file mode 100644 index 000000000..be1f2f2f4 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/describe_virtual_border_routers_for_physical_connection.go @@ -0,0 +1,119 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// DescribeVirtualBorderRoutersForPhysicalConnection invokes the vpc.DescribeVirtualBorderRoutersForPhysicalConnection API synchronously +// api document: https://help.aliyun.com/api/vpc/describevirtualborderroutersforphysicalconnection.html +func (client *Client) DescribeVirtualBorderRoutersForPhysicalConnection(request *DescribeVirtualBorderRoutersForPhysicalConnectionRequest) (response *DescribeVirtualBorderRoutersForPhysicalConnectionResponse, err error) { + response = CreateDescribeVirtualBorderRoutersForPhysicalConnectionResponse() + err = client.DoAction(request, response) + return +} + +// DescribeVirtualBorderRoutersForPhysicalConnectionWithChan invokes the vpc.DescribeVirtualBorderRoutersForPhysicalConnection API asynchronously +// api document: https://help.aliyun.com/api/vpc/describevirtualborderroutersforphysicalconnection.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeVirtualBorderRoutersForPhysicalConnectionWithChan(request *DescribeVirtualBorderRoutersForPhysicalConnectionRequest) (<-chan *DescribeVirtualBorderRoutersForPhysicalConnectionResponse, <-chan error) { + responseChan := make(chan *DescribeVirtualBorderRoutersForPhysicalConnectionResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DescribeVirtualBorderRoutersForPhysicalConnection(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DescribeVirtualBorderRoutersForPhysicalConnectionWithCallback invokes the vpc.DescribeVirtualBorderRoutersForPhysicalConnection API asynchronously +// api document: https://help.aliyun.com/api/vpc/describevirtualborderroutersforphysicalconnection.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeVirtualBorderRoutersForPhysicalConnectionWithCallback(request *DescribeVirtualBorderRoutersForPhysicalConnectionRequest, callback func(response *DescribeVirtualBorderRoutersForPhysicalConnectionResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DescribeVirtualBorderRoutersForPhysicalConnectionResponse + var err error + defer close(result) + response, err = client.DescribeVirtualBorderRoutersForPhysicalConnection(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DescribeVirtualBorderRoutersForPhysicalConnectionRequest is the request struct for api DescribeVirtualBorderRoutersForPhysicalConnection +type DescribeVirtualBorderRoutersForPhysicalConnectionRequest struct { + *requests.RpcRequest + Filter *[]DescribeVirtualBorderRoutersForPhysicalConnectionFilter `position:"Query" name:"Filter" type:"Repeated"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + PhysicalConnectionId string `position:"Query" name:"PhysicalConnectionId"` + PageSize requests.Integer `position:"Query" name:"PageSize"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + PageNumber requests.Integer `position:"Query" name:"PageNumber"` +} + +// DescribeVirtualBorderRoutersForPhysicalConnectionFilter is a repeated param struct in DescribeVirtualBorderRoutersForPhysicalConnectionRequest +type DescribeVirtualBorderRoutersForPhysicalConnectionFilter struct { + Value *[]string `name:"Value" type:"Repeated"` + Key string `name:"Key"` +} + +// DescribeVirtualBorderRoutersForPhysicalConnectionResponse is the response struct for api DescribeVirtualBorderRoutersForPhysicalConnection +type DescribeVirtualBorderRoutersForPhysicalConnectionResponse 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"` + VirtualBorderRouterForPhysicalConnectionSet VirtualBorderRouterForPhysicalConnectionSet `json:"VirtualBorderRouterForPhysicalConnectionSet" xml:"VirtualBorderRouterForPhysicalConnectionSet"` +} + +// CreateDescribeVirtualBorderRoutersForPhysicalConnectionRequest creates a request to invoke DescribeVirtualBorderRoutersForPhysicalConnection API +func CreateDescribeVirtualBorderRoutersForPhysicalConnectionRequest() (request *DescribeVirtualBorderRoutersForPhysicalConnectionRequest) { + request = &DescribeVirtualBorderRoutersForPhysicalConnectionRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "DescribeVirtualBorderRoutersForPhysicalConnection", "vpc", "openAPI") + return +} + +// CreateDescribeVirtualBorderRoutersForPhysicalConnectionResponse creates a response to parse from DescribeVirtualBorderRoutersForPhysicalConnection response +func CreateDescribeVirtualBorderRoutersForPhysicalConnectionResponse() (response *DescribeVirtualBorderRoutersForPhysicalConnectionResponse) { + response = &DescribeVirtualBorderRoutersForPhysicalConnectionResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/describe_vpc_attribute.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/describe_vpc_attribute.go new file mode 100644 index 000000000..40599ea5d --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/describe_vpc_attribute.go @@ -0,0 +1,124 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// DescribeVpcAttribute invokes the vpc.DescribeVpcAttribute API synchronously +// api document: https://help.aliyun.com/api/vpc/describevpcattribute.html +func (client *Client) DescribeVpcAttribute(request *DescribeVpcAttributeRequest) (response *DescribeVpcAttributeResponse, err error) { + response = CreateDescribeVpcAttributeResponse() + err = client.DoAction(request, response) + return +} + +// DescribeVpcAttributeWithChan invokes the vpc.DescribeVpcAttribute API asynchronously +// api document: https://help.aliyun.com/api/vpc/describevpcattribute.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeVpcAttributeWithChan(request *DescribeVpcAttributeRequest) (<-chan *DescribeVpcAttributeResponse, <-chan error) { + responseChan := make(chan *DescribeVpcAttributeResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DescribeVpcAttribute(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DescribeVpcAttributeWithCallback invokes the vpc.DescribeVpcAttribute API asynchronously +// api document: https://help.aliyun.com/api/vpc/describevpcattribute.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeVpcAttributeWithCallback(request *DescribeVpcAttributeRequest, callback func(response *DescribeVpcAttributeResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DescribeVpcAttributeResponse + var err error + defer close(result) + response, err = client.DescribeVpcAttribute(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DescribeVpcAttributeRequest is the request struct for api DescribeVpcAttribute +type DescribeVpcAttributeRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + VpcId string `position:"Query" name:"VpcId"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + IsDefault requests.Boolean `position:"Query" name:"IsDefault"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// DescribeVpcAttributeResponse is the response struct for api DescribeVpcAttribute +type DescribeVpcAttributeResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + VpcId string `json:"VpcId" xml:"VpcId"` + RegionId string `json:"RegionId" xml:"RegionId"` + Status string `json:"Status" xml:"Status"` + VpcName string `json:"VpcName" xml:"VpcName"` + CreationTime string `json:"CreationTime" xml:"CreationTime"` + CidrBlock string `json:"CidrBlock" xml:"CidrBlock"` + Ipv6CidrBlock string `json:"Ipv6CidrBlock" xml:"Ipv6CidrBlock"` + VRouterId string `json:"VRouterId" xml:"VRouterId"` + Description string `json:"Description" xml:"Description"` + IsDefault bool `json:"IsDefault" xml:"IsDefault"` + ClassicLinkEnabled bool `json:"ClassicLinkEnabled" xml:"ClassicLinkEnabled"` + ResourceGroupId string `json:"ResourceGroupId" xml:"ResourceGroupId"` + VSwitchIds VSwitchIdsInDescribeVpcAttribute `json:"VSwitchIds" xml:"VSwitchIds"` + UserCidrs UserCidrsInDescribeVpcAttribute `json:"UserCidrs" xml:"UserCidrs"` + AssociatedCens AssociatedCensInDescribeVpcAttribute `json:"AssociatedCens" xml:"AssociatedCens"` + CloudResources CloudResourcesInDescribeVpcAttribute `json:"CloudResources" xml:"CloudResources"` +} + +// CreateDescribeVpcAttributeRequest creates a request to invoke DescribeVpcAttribute API +func CreateDescribeVpcAttributeRequest() (request *DescribeVpcAttributeRequest) { + request = &DescribeVpcAttributeRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "DescribeVpcAttribute", "vpc", "openAPI") + return +} + +// CreateDescribeVpcAttributeResponse creates a response to parse from DescribeVpcAttribute response +func CreateDescribeVpcAttributeResponse() (response *DescribeVpcAttributeResponse) { + response = &DescribeVpcAttributeResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/describe_vpcs.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/describe_vpcs.go new file mode 100644 index 000000000..2f6f7dd1f --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/describe_vpcs.go @@ -0,0 +1,123 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// DescribeVpcs invokes the vpc.DescribeVpcs API synchronously +// api document: https://help.aliyun.com/api/vpc/describevpcs.html +func (client *Client) DescribeVpcs(request *DescribeVpcsRequest) (response *DescribeVpcsResponse, err error) { + response = CreateDescribeVpcsResponse() + err = client.DoAction(request, response) + return +} + +// DescribeVpcsWithChan invokes the vpc.DescribeVpcs API asynchronously +// api document: https://help.aliyun.com/api/vpc/describevpcs.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeVpcsWithChan(request *DescribeVpcsRequest) (<-chan *DescribeVpcsResponse, <-chan error) { + responseChan := make(chan *DescribeVpcsResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DescribeVpcs(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DescribeVpcsWithCallback invokes the vpc.DescribeVpcs API asynchronously +// api document: https://help.aliyun.com/api/vpc/describevpcs.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeVpcsWithCallback(request *DescribeVpcsRequest, callback func(response *DescribeVpcsResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DescribeVpcsResponse + var err error + defer close(result) + response, err = client.DescribeVpcs(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DescribeVpcsRequest is the request struct for api DescribeVpcs +type DescribeVpcsRequest struct { + *requests.RpcRequest + 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"` + PageNumber requests.Integer `position:"Query" name:"PageNumber"` + VpcName string `position:"Query" name:"VpcName"` + ResourceGroupId string `position:"Query" name:"ResourceGroupId"` + VpcId string `position:"Query" name:"VpcId"` + PageSize requests.Integer `position:"Query" name:"PageSize"` + Tag *[]DescribeVpcsTag `position:"Query" name:"Tag" type:"Repeated"` + IsDefault requests.Boolean `position:"Query" name:"IsDefault"` +} + +// DescribeVpcsTag is a repeated param struct in DescribeVpcsRequest +type DescribeVpcsTag struct { + Value string `name:"Value"` + Key string `name:"Key"` +} + +// DescribeVpcsResponse is the response struct for api DescribeVpcs +type DescribeVpcsResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + TotalCount int `json:"TotalCount" xml:"TotalCount"` + PageNumber int `json:"PageNumber" xml:"PageNumber"` + PageSize int `json:"PageSize" xml:"PageSize"` + Vpcs Vpcs `json:"Vpcs" xml:"Vpcs"` +} + +// CreateDescribeVpcsRequest creates a request to invoke DescribeVpcs API +func CreateDescribeVpcsRequest() (request *DescribeVpcsRequest) { + request = &DescribeVpcsRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "DescribeVpcs", "vpc", "openAPI") + return +} + +// CreateDescribeVpcsResponse creates a response to parse from DescribeVpcs response +func CreateDescribeVpcsResponse() (response *DescribeVpcsResponse) { + response = &DescribeVpcsResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/describe_vpn_connection.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/describe_vpn_connection.go new file mode 100644 index 000000000..4a491f750 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/describe_vpn_connection.go @@ -0,0 +1,118 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// DescribeVpnConnection invokes the vpc.DescribeVpnConnection API synchronously +// api document: https://help.aliyun.com/api/vpc/describevpnconnection.html +func (client *Client) DescribeVpnConnection(request *DescribeVpnConnectionRequest) (response *DescribeVpnConnectionResponse, err error) { + response = CreateDescribeVpnConnectionResponse() + err = client.DoAction(request, response) + return +} + +// DescribeVpnConnectionWithChan invokes the vpc.DescribeVpnConnection API asynchronously +// api document: https://help.aliyun.com/api/vpc/describevpnconnection.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeVpnConnectionWithChan(request *DescribeVpnConnectionRequest) (<-chan *DescribeVpnConnectionResponse, <-chan error) { + responseChan := make(chan *DescribeVpnConnectionResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DescribeVpnConnection(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DescribeVpnConnectionWithCallback invokes the vpc.DescribeVpnConnection API asynchronously +// api document: https://help.aliyun.com/api/vpc/describevpnconnection.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeVpnConnectionWithCallback(request *DescribeVpnConnectionRequest, callback func(response *DescribeVpnConnectionResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DescribeVpnConnectionResponse + var err error + defer close(result) + response, err = client.DescribeVpnConnection(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DescribeVpnConnectionRequest is the request struct for api DescribeVpnConnection +type DescribeVpnConnectionRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + VpnConnectionId string `position:"Query" name:"VpnConnectionId"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// DescribeVpnConnectionResponse is the response struct for api DescribeVpnConnection +type DescribeVpnConnectionResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + VpnConnectionId string `json:"VpnConnectionId" xml:"VpnConnectionId"` + CustomerGatewayId string `json:"CustomerGatewayId" xml:"CustomerGatewayId"` + VpnGatewayId string `json:"VpnGatewayId" xml:"VpnGatewayId"` + Name string `json:"Name" xml:"Name"` + LocalSubnet string `json:"LocalSubnet" xml:"LocalSubnet"` + RemoteSubnet string `json:"RemoteSubnet" xml:"RemoteSubnet"` + CreateTime int `json:"CreateTime" xml:"CreateTime"` + EffectImmediately bool `json:"EffectImmediately" xml:"EffectImmediately"` + Status string `json:"Status" xml:"Status"` + IkeConfig IkeConfig `json:"IkeConfig" xml:"IkeConfig"` + IpsecConfig IpsecConfig `json:"IpsecConfig" xml:"IpsecConfig"` +} + +// CreateDescribeVpnConnectionRequest creates a request to invoke DescribeVpnConnection API +func CreateDescribeVpnConnectionRequest() (request *DescribeVpnConnectionRequest) { + request = &DescribeVpnConnectionRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "DescribeVpnConnection", "vpc", "openAPI") + return +} + +// CreateDescribeVpnConnectionResponse creates a response to parse from DescribeVpnConnection response +func CreateDescribeVpnConnectionResponse() (response *DescribeVpnConnectionResponse) { + response = &DescribeVpnConnectionResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/describe_vpn_connections.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/describe_vpn_connections.go new file mode 100644 index 000000000..eacee5055 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/describe_vpn_connections.go @@ -0,0 +1,115 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// DescribeVpnConnections invokes the vpc.DescribeVpnConnections API synchronously +// api document: https://help.aliyun.com/api/vpc/describevpnconnections.html +func (client *Client) DescribeVpnConnections(request *DescribeVpnConnectionsRequest) (response *DescribeVpnConnectionsResponse, err error) { + response = CreateDescribeVpnConnectionsResponse() + err = client.DoAction(request, response) + return +} + +// DescribeVpnConnectionsWithChan invokes the vpc.DescribeVpnConnections API asynchronously +// api document: https://help.aliyun.com/api/vpc/describevpnconnections.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeVpnConnectionsWithChan(request *DescribeVpnConnectionsRequest) (<-chan *DescribeVpnConnectionsResponse, <-chan error) { + responseChan := make(chan *DescribeVpnConnectionsResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DescribeVpnConnections(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DescribeVpnConnectionsWithCallback invokes the vpc.DescribeVpnConnections API asynchronously +// api document: https://help.aliyun.com/api/vpc/describevpnconnections.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeVpnConnectionsWithCallback(request *DescribeVpnConnectionsRequest, callback func(response *DescribeVpnConnectionsResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DescribeVpnConnectionsResponse + var err error + defer close(result) + response, err = client.DescribeVpnConnections(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DescribeVpnConnectionsRequest is the request struct for api DescribeVpnConnections +type DescribeVpnConnectionsRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + VpnConnectionId string `position:"Query" name:"VpnConnectionId"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + PageSize requests.Integer `position:"Query" name:"PageSize"` + VpnGatewayId string `position:"Query" name:"VpnGatewayId"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + CustomerGatewayId string `position:"Query" name:"CustomerGatewayId"` + PageNumber requests.Integer `position:"Query" name:"PageNumber"` +} + +// DescribeVpnConnectionsResponse is the response struct for api DescribeVpnConnections +type DescribeVpnConnectionsResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + TotalCount int `json:"TotalCount" xml:"TotalCount"` + PageNumber int `json:"PageNumber" xml:"PageNumber"` + PageSize int `json:"PageSize" xml:"PageSize"` + VpnConnections VpnConnections `json:"VpnConnections" xml:"VpnConnections"` +} + +// CreateDescribeVpnConnectionsRequest creates a request to invoke DescribeVpnConnections API +func CreateDescribeVpnConnectionsRequest() (request *DescribeVpnConnectionsRequest) { + request = &DescribeVpnConnectionsRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "DescribeVpnConnections", "vpc", "openAPI") + return +} + +// CreateDescribeVpnConnectionsResponse creates a response to parse from DescribeVpnConnections response +func CreateDescribeVpnConnectionsResponse() (response *DescribeVpnConnectionsResponse) { + response = &DescribeVpnConnectionsResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/describe_vpn_gateway.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/describe_vpn_gateway.go new file mode 100644 index 000000000..888104b5d --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/describe_vpn_gateway.go @@ -0,0 +1,122 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// DescribeVpnGateway invokes the vpc.DescribeVpnGateway API synchronously +// api document: https://help.aliyun.com/api/vpc/describevpngateway.html +func (client *Client) DescribeVpnGateway(request *DescribeVpnGatewayRequest) (response *DescribeVpnGatewayResponse, err error) { + response = CreateDescribeVpnGatewayResponse() + err = client.DoAction(request, response) + return +} + +// DescribeVpnGatewayWithChan invokes the vpc.DescribeVpnGateway API asynchronously +// api document: https://help.aliyun.com/api/vpc/describevpngateway.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeVpnGatewayWithChan(request *DescribeVpnGatewayRequest) (<-chan *DescribeVpnGatewayResponse, <-chan error) { + responseChan := make(chan *DescribeVpnGatewayResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DescribeVpnGateway(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DescribeVpnGatewayWithCallback invokes the vpc.DescribeVpnGateway API asynchronously +// api document: https://help.aliyun.com/api/vpc/describevpngateway.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeVpnGatewayWithCallback(request *DescribeVpnGatewayRequest, callback func(response *DescribeVpnGatewayResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DescribeVpnGatewayResponse + var err error + defer close(result) + response, err = client.DescribeVpnGateway(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DescribeVpnGatewayRequest is the request struct for api DescribeVpnGateway +type DescribeVpnGatewayRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + VpnGatewayId string `position:"Query" name:"VpnGatewayId"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// DescribeVpnGatewayResponse is the response struct for api DescribeVpnGateway +type DescribeVpnGatewayResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + VpnGatewayId string `json:"VpnGatewayId" xml:"VpnGatewayId"` + VpcId string `json:"VpcId" xml:"VpcId"` + VSwitchId string `json:"VSwitchId" xml:"VSwitchId"` + InternetIp string `json:"InternetIp" xml:"InternetIp"` + CreateTime int `json:"CreateTime" xml:"CreateTime"` + EndTime int `json:"EndTime" xml:"EndTime"` + Spec string `json:"Spec" xml:"Spec"` + Name string `json:"Name" xml:"Name"` + Description string `json:"Description" xml:"Description"` + Status string `json:"Status" xml:"Status"` + BusinessStatus string `json:"BusinessStatus" xml:"BusinessStatus"` + ChargeType string `json:"ChargeType" xml:"ChargeType"` + IpsecVpn string `json:"IpsecVpn" xml:"IpsecVpn"` + SslVpn string `json:"SslVpn" xml:"SslVpn"` + SslMaxConnections int `json:"SslMaxConnections" xml:"SslMaxConnections"` +} + +// CreateDescribeVpnGatewayRequest creates a request to invoke DescribeVpnGateway API +func CreateDescribeVpnGatewayRequest() (request *DescribeVpnGatewayRequest) { + request = &DescribeVpnGatewayRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "DescribeVpnGateway", "vpc", "openAPI") + return +} + +// CreateDescribeVpnGatewayResponse creates a response to parse from DescribeVpnGateway response +func CreateDescribeVpnGatewayResponse() (response *DescribeVpnGatewayResponse) { + response = &DescribeVpnGatewayResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/describe_vpn_gateways.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/describe_vpn_gateways.go new file mode 100644 index 000000000..3b80e7afd --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/describe_vpn_gateways.go @@ -0,0 +1,116 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// DescribeVpnGateways invokes the vpc.DescribeVpnGateways API synchronously +// api document: https://help.aliyun.com/api/vpc/describevpngateways.html +func (client *Client) DescribeVpnGateways(request *DescribeVpnGatewaysRequest) (response *DescribeVpnGatewaysResponse, err error) { + response = CreateDescribeVpnGatewaysResponse() + err = client.DoAction(request, response) + return +} + +// DescribeVpnGatewaysWithChan invokes the vpc.DescribeVpnGateways API asynchronously +// api document: https://help.aliyun.com/api/vpc/describevpngateways.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeVpnGatewaysWithChan(request *DescribeVpnGatewaysRequest) (<-chan *DescribeVpnGatewaysResponse, <-chan error) { + responseChan := make(chan *DescribeVpnGatewaysResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DescribeVpnGateways(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DescribeVpnGatewaysWithCallback invokes the vpc.DescribeVpnGateways API asynchronously +// api document: https://help.aliyun.com/api/vpc/describevpngateways.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DescribeVpnGatewaysWithCallback(request *DescribeVpnGatewaysRequest, callback func(response *DescribeVpnGatewaysResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DescribeVpnGatewaysResponse + var err error + defer close(result) + response, err = client.DescribeVpnGateways(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DescribeVpnGatewaysRequest is the request struct for api DescribeVpnGateways +type DescribeVpnGatewaysRequest struct { + *requests.RpcRequest + BusinessStatus string `position:"Query" name:"BusinessStatus"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + VpcId string `position:"Query" name:"VpcId"` + PageSize requests.Integer `position:"Query" name:"PageSize"` + VpnGatewayId string `position:"Query" name:"VpnGatewayId"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + PageNumber requests.Integer `position:"Query" name:"PageNumber"` + Status string `position:"Query" name:"Status"` +} + +// DescribeVpnGatewaysResponse is the response struct for api DescribeVpnGateways +type DescribeVpnGatewaysResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + TotalCount int `json:"TotalCount" xml:"TotalCount"` + PageNumber int `json:"PageNumber" xml:"PageNumber"` + PageSize int `json:"PageSize" xml:"PageSize"` + VpnGateways VpnGateways `json:"VpnGateways" xml:"VpnGateways"` +} + +// CreateDescribeVpnGatewaysRequest creates a request to invoke DescribeVpnGateways API +func CreateDescribeVpnGatewaysRequest() (request *DescribeVpnGatewaysRequest) { + request = &DescribeVpnGatewaysRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "DescribeVpnGateways", "vpc", "openAPI") + return +} + +// CreateDescribeVpnGatewaysResponse creates a response to parse from DescribeVpnGateways response +func CreateDescribeVpnGatewaysResponse() (response *DescribeVpnGatewaysResponse) { + response = &DescribeVpnGatewaysResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/describe_zones.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/describe_zones.go new file mode 100644 index 000000000..d68291c6d --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/describe_zones.go @@ -0,0 +1,107 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// DescribeZones invokes the vpc.DescribeZones API synchronously +// api document: https://help.aliyun.com/api/vpc/describezones.html +func (client *Client) DescribeZones(request *DescribeZonesRequest) (response *DescribeZonesResponse, err error) { + response = CreateDescribeZonesResponse() + err = client.DoAction(request, response) + return +} + +// DescribeZonesWithChan invokes the vpc.DescribeZones API asynchronously +// api document: https://help.aliyun.com/api/vpc/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 vpc.DescribeZones API asynchronously +// api document: https://help.aliyun.com/api/vpc/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 + 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"` +} + +// 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("Vpc", "2016-04-28", "DescribeZones", "vpc", "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/vpc/disable_vpc_classic_link.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/disable_vpc_classic_link.go new file mode 100644 index 000000000..404a02eed --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/disable_vpc_classic_link.go @@ -0,0 +1,108 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// DisableVpcClassicLink invokes the vpc.DisableVpcClassicLink API synchronously +// api document: https://help.aliyun.com/api/vpc/disablevpcclassiclink.html +func (client *Client) DisableVpcClassicLink(request *DisableVpcClassicLinkRequest) (response *DisableVpcClassicLinkResponse, err error) { + response = CreateDisableVpcClassicLinkResponse() + err = client.DoAction(request, response) + return +} + +// DisableVpcClassicLinkWithChan invokes the vpc.DisableVpcClassicLink API asynchronously +// api document: https://help.aliyun.com/api/vpc/disablevpcclassiclink.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DisableVpcClassicLinkWithChan(request *DisableVpcClassicLinkRequest) (<-chan *DisableVpcClassicLinkResponse, <-chan error) { + responseChan := make(chan *DisableVpcClassicLinkResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DisableVpcClassicLink(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DisableVpcClassicLinkWithCallback invokes the vpc.DisableVpcClassicLink API asynchronously +// api document: https://help.aliyun.com/api/vpc/disablevpcclassiclink.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DisableVpcClassicLinkWithCallback(request *DisableVpcClassicLinkRequest, callback func(response *DisableVpcClassicLinkResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DisableVpcClassicLinkResponse + var err error + defer close(result) + response, err = client.DisableVpcClassicLink(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DisableVpcClassicLinkRequest is the request struct for api DisableVpcClassicLink +type DisableVpcClassicLinkRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + ClientToken string `position:"Query" name:"ClientToken"` + VpcId string `position:"Query" name:"VpcId"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// DisableVpcClassicLinkResponse is the response struct for api DisableVpcClassicLink +type DisableVpcClassicLinkResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateDisableVpcClassicLinkRequest creates a request to invoke DisableVpcClassicLink API +func CreateDisableVpcClassicLinkRequest() (request *DisableVpcClassicLinkRequest) { + request = &DisableVpcClassicLinkRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "DisableVpcClassicLink", "vpc", "openAPI") + return +} + +// CreateDisableVpcClassicLinkResponse creates a response to parse from DisableVpcClassicLink response +func CreateDisableVpcClassicLinkResponse() (response *DisableVpcClassicLinkResponse) { + response = &DisableVpcClassicLinkResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/download_vpn_connection_config.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/download_vpn_connection_config.go new file mode 100644 index 000000000..af129311e --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/download_vpn_connection_config.go @@ -0,0 +1,108 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// DownloadVpnConnectionConfig invokes the vpc.DownloadVpnConnectionConfig API synchronously +// api document: https://help.aliyun.com/api/vpc/downloadvpnconnectionconfig.html +func (client *Client) DownloadVpnConnectionConfig(request *DownloadVpnConnectionConfigRequest) (response *DownloadVpnConnectionConfigResponse, err error) { + response = CreateDownloadVpnConnectionConfigResponse() + err = client.DoAction(request, response) + return +} + +// DownloadVpnConnectionConfigWithChan invokes the vpc.DownloadVpnConnectionConfig API asynchronously +// api document: https://help.aliyun.com/api/vpc/downloadvpnconnectionconfig.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DownloadVpnConnectionConfigWithChan(request *DownloadVpnConnectionConfigRequest) (<-chan *DownloadVpnConnectionConfigResponse, <-chan error) { + responseChan := make(chan *DownloadVpnConnectionConfigResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.DownloadVpnConnectionConfig(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// DownloadVpnConnectionConfigWithCallback invokes the vpc.DownloadVpnConnectionConfig API asynchronously +// api document: https://help.aliyun.com/api/vpc/downloadvpnconnectionconfig.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) DownloadVpnConnectionConfigWithCallback(request *DownloadVpnConnectionConfigRequest, callback func(response *DownloadVpnConnectionConfigResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *DownloadVpnConnectionConfigResponse + var err error + defer close(result) + response, err = client.DownloadVpnConnectionConfig(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// DownloadVpnConnectionConfigRequest is the request struct for api DownloadVpnConnectionConfig +type DownloadVpnConnectionConfigRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + VpnConnectionId string `position:"Query" name:"VpnConnectionId"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// DownloadVpnConnectionConfigResponse is the response struct for api DownloadVpnConnectionConfig +type DownloadVpnConnectionConfigResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + VpnConnectionConfig VpnConnectionConfig `json:"VpnConnectionConfig" xml:"VpnConnectionConfig"` +} + +// CreateDownloadVpnConnectionConfigRequest creates a request to invoke DownloadVpnConnectionConfig API +func CreateDownloadVpnConnectionConfigRequest() (request *DownloadVpnConnectionConfigRequest) { + request = &DownloadVpnConnectionConfigRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "DownloadVpnConnectionConfig", "vpc", "openAPI") + return +} + +// CreateDownloadVpnConnectionConfigResponse creates a response to parse from DownloadVpnConnectionConfig response +func CreateDownloadVpnConnectionConfigResponse() (response *DownloadVpnConnectionConfigResponse) { + response = &DownloadVpnConnectionConfigResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/enable_physical_connection.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/enable_physical_connection.go new file mode 100644 index 000000000..a672144c6 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/enable_physical_connection.go @@ -0,0 +1,108 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// EnablePhysicalConnection invokes the vpc.EnablePhysicalConnection API synchronously +// api document: https://help.aliyun.com/api/vpc/enablephysicalconnection.html +func (client *Client) EnablePhysicalConnection(request *EnablePhysicalConnectionRequest) (response *EnablePhysicalConnectionResponse, err error) { + response = CreateEnablePhysicalConnectionResponse() + err = client.DoAction(request, response) + return +} + +// EnablePhysicalConnectionWithChan invokes the vpc.EnablePhysicalConnection API asynchronously +// api document: https://help.aliyun.com/api/vpc/enablephysicalconnection.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) EnablePhysicalConnectionWithChan(request *EnablePhysicalConnectionRequest) (<-chan *EnablePhysicalConnectionResponse, <-chan error) { + responseChan := make(chan *EnablePhysicalConnectionResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.EnablePhysicalConnection(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// EnablePhysicalConnectionWithCallback invokes the vpc.EnablePhysicalConnection API asynchronously +// api document: https://help.aliyun.com/api/vpc/enablephysicalconnection.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) EnablePhysicalConnectionWithCallback(request *EnablePhysicalConnectionRequest, callback func(response *EnablePhysicalConnectionResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *EnablePhysicalConnectionResponse + var err error + defer close(result) + response, err = client.EnablePhysicalConnection(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// EnablePhysicalConnectionRequest is the request struct for api EnablePhysicalConnection +type EnablePhysicalConnectionRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + ClientToken string `position:"Query" name:"ClientToken"` + PhysicalConnectionId string `position:"Query" name:"PhysicalConnectionId"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// EnablePhysicalConnectionResponse is the response struct for api EnablePhysicalConnection +type EnablePhysicalConnectionResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateEnablePhysicalConnectionRequest creates a request to invoke EnablePhysicalConnection API +func CreateEnablePhysicalConnectionRequest() (request *EnablePhysicalConnectionRequest) { + request = &EnablePhysicalConnectionRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "EnablePhysicalConnection", "vpc", "openAPI") + return +} + +// CreateEnablePhysicalConnectionResponse creates a response to parse from EnablePhysicalConnection response +func CreateEnablePhysicalConnectionResponse() (response *EnablePhysicalConnectionResponse) { + response = &EnablePhysicalConnectionResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/enable_vpc_classic_link.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/enable_vpc_classic_link.go new file mode 100644 index 000000000..186c0bad5 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/enable_vpc_classic_link.go @@ -0,0 +1,108 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// EnableVpcClassicLink invokes the vpc.EnableVpcClassicLink API synchronously +// api document: https://help.aliyun.com/api/vpc/enablevpcclassiclink.html +func (client *Client) EnableVpcClassicLink(request *EnableVpcClassicLinkRequest) (response *EnableVpcClassicLinkResponse, err error) { + response = CreateEnableVpcClassicLinkResponse() + err = client.DoAction(request, response) + return +} + +// EnableVpcClassicLinkWithChan invokes the vpc.EnableVpcClassicLink API asynchronously +// api document: https://help.aliyun.com/api/vpc/enablevpcclassiclink.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) EnableVpcClassicLinkWithChan(request *EnableVpcClassicLinkRequest) (<-chan *EnableVpcClassicLinkResponse, <-chan error) { + responseChan := make(chan *EnableVpcClassicLinkResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.EnableVpcClassicLink(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// EnableVpcClassicLinkWithCallback invokes the vpc.EnableVpcClassicLink API asynchronously +// api document: https://help.aliyun.com/api/vpc/enablevpcclassiclink.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) EnableVpcClassicLinkWithCallback(request *EnableVpcClassicLinkRequest, callback func(response *EnableVpcClassicLinkResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *EnableVpcClassicLinkResponse + var err error + defer close(result) + response, err = client.EnableVpcClassicLink(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// EnableVpcClassicLinkRequest is the request struct for api EnableVpcClassicLink +type EnableVpcClassicLinkRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + ClientToken string `position:"Query" name:"ClientToken"` + VpcId string `position:"Query" name:"VpcId"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// EnableVpcClassicLinkResponse is the response struct for api EnableVpcClassicLink +type EnableVpcClassicLinkResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateEnableVpcClassicLinkRequest creates a request to invoke EnableVpcClassicLink API +func CreateEnableVpcClassicLinkRequest() (request *EnableVpcClassicLinkRequest) { + request = &EnableVpcClassicLinkRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "EnableVpcClassicLink", "vpc", "openAPI") + return +} + +// CreateEnableVpcClassicLinkResponse creates a response to parse from EnableVpcClassicLink response +func CreateEnableVpcClassicLinkResponse() (response *EnableVpcClassicLinkResponse) { + response = &EnableVpcClassicLinkResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/grant_instance_to_cen.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/grant_instance_to_cen.go new file mode 100644 index 000000000..f21c41a65 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/grant_instance_to_cen.go @@ -0,0 +1,111 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// GrantInstanceToCen invokes the vpc.GrantInstanceToCen API synchronously +// api document: https://help.aliyun.com/api/vpc/grantinstancetocen.html +func (client *Client) GrantInstanceToCen(request *GrantInstanceToCenRequest) (response *GrantInstanceToCenResponse, err error) { + response = CreateGrantInstanceToCenResponse() + err = client.DoAction(request, response) + return +} + +// GrantInstanceToCenWithChan invokes the vpc.GrantInstanceToCen API asynchronously +// api document: https://help.aliyun.com/api/vpc/grantinstancetocen.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) GrantInstanceToCenWithChan(request *GrantInstanceToCenRequest) (<-chan *GrantInstanceToCenResponse, <-chan error) { + responseChan := make(chan *GrantInstanceToCenResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.GrantInstanceToCen(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// GrantInstanceToCenWithCallback invokes the vpc.GrantInstanceToCen API asynchronously +// api document: https://help.aliyun.com/api/vpc/grantinstancetocen.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) GrantInstanceToCenWithCallback(request *GrantInstanceToCenRequest, callback func(response *GrantInstanceToCenResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *GrantInstanceToCenResponse + var err error + defer close(result) + response, err = client.GrantInstanceToCen(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// GrantInstanceToCenRequest is the request struct for api GrantInstanceToCen +type GrantInstanceToCenRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + InstanceId string `position:"Query" name:"InstanceId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + CenId string `position:"Query" name:"CenId"` + ClientToken string `position:"Query" name:"ClientToken"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + InstanceType string `position:"Query" name:"InstanceType"` + CenOwnerId requests.Integer `position:"Query" name:"CenOwnerId"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// GrantInstanceToCenResponse is the response struct for api GrantInstanceToCen +type GrantInstanceToCenResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateGrantInstanceToCenRequest creates a request to invoke GrantInstanceToCen API +func CreateGrantInstanceToCenRequest() (request *GrantInstanceToCenRequest) { + request = &GrantInstanceToCenRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "GrantInstanceToCen", "vpc", "openAPI") + return +} + +// CreateGrantInstanceToCenResponse creates a response to parse from GrantInstanceToCen response +func CreateGrantInstanceToCenResponse() (response *GrantInstanceToCenResponse) { + response = &GrantInstanceToCenResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/modify_bandwidth_package_attribute.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/modify_bandwidth_package_attribute.go new file mode 100644 index 000000000..ace2ac163 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/modify_bandwidth_package_attribute.go @@ -0,0 +1,109 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// ModifyBandwidthPackageAttribute invokes the vpc.ModifyBandwidthPackageAttribute API synchronously +// api document: https://help.aliyun.com/api/vpc/modifybandwidthpackageattribute.html +func (client *Client) ModifyBandwidthPackageAttribute(request *ModifyBandwidthPackageAttributeRequest) (response *ModifyBandwidthPackageAttributeResponse, err error) { + response = CreateModifyBandwidthPackageAttributeResponse() + err = client.DoAction(request, response) + return +} + +// ModifyBandwidthPackageAttributeWithChan invokes the vpc.ModifyBandwidthPackageAttribute API asynchronously +// api document: https://help.aliyun.com/api/vpc/modifybandwidthpackageattribute.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifyBandwidthPackageAttributeWithChan(request *ModifyBandwidthPackageAttributeRequest) (<-chan *ModifyBandwidthPackageAttributeResponse, <-chan error) { + responseChan := make(chan *ModifyBandwidthPackageAttributeResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.ModifyBandwidthPackageAttribute(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// ModifyBandwidthPackageAttributeWithCallback invokes the vpc.ModifyBandwidthPackageAttribute API asynchronously +// api document: https://help.aliyun.com/api/vpc/modifybandwidthpackageattribute.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifyBandwidthPackageAttributeWithCallback(request *ModifyBandwidthPackageAttributeRequest, callback func(response *ModifyBandwidthPackageAttributeResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *ModifyBandwidthPackageAttributeResponse + var err error + defer close(result) + response, err = client.ModifyBandwidthPackageAttribute(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// ModifyBandwidthPackageAttributeRequest is the request struct for api ModifyBandwidthPackageAttribute +type ModifyBandwidthPackageAttributeRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + BandwidthPackageId string `position:"Query" name:"BandwidthPackageId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + Name string `position:"Query" name:"Name"` + Description string `position:"Query" name:"Description"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// ModifyBandwidthPackageAttributeResponse is the response struct for api ModifyBandwidthPackageAttribute +type ModifyBandwidthPackageAttributeResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateModifyBandwidthPackageAttributeRequest creates a request to invoke ModifyBandwidthPackageAttribute API +func CreateModifyBandwidthPackageAttributeRequest() (request *ModifyBandwidthPackageAttributeRequest) { + request = &ModifyBandwidthPackageAttributeRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "ModifyBandwidthPackageAttribute", "vpc", "openAPI") + return +} + +// CreateModifyBandwidthPackageAttributeResponse creates a response to parse from ModifyBandwidthPackageAttribute response +func CreateModifyBandwidthPackageAttributeResponse() (response *ModifyBandwidthPackageAttributeResponse) { + response = &ModifyBandwidthPackageAttributeResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/modify_bandwidth_package_spec.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/modify_bandwidth_package_spec.go new file mode 100644 index 000000000..d6b88acb4 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/modify_bandwidth_package_spec.go @@ -0,0 +1,108 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// ModifyBandwidthPackageSpec invokes the vpc.ModifyBandwidthPackageSpec API synchronously +// api document: https://help.aliyun.com/api/vpc/modifybandwidthpackagespec.html +func (client *Client) ModifyBandwidthPackageSpec(request *ModifyBandwidthPackageSpecRequest) (response *ModifyBandwidthPackageSpecResponse, err error) { + response = CreateModifyBandwidthPackageSpecResponse() + err = client.DoAction(request, response) + return +} + +// ModifyBandwidthPackageSpecWithChan invokes the vpc.ModifyBandwidthPackageSpec API asynchronously +// api document: https://help.aliyun.com/api/vpc/modifybandwidthpackagespec.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifyBandwidthPackageSpecWithChan(request *ModifyBandwidthPackageSpecRequest) (<-chan *ModifyBandwidthPackageSpecResponse, <-chan error) { + responseChan := make(chan *ModifyBandwidthPackageSpecResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.ModifyBandwidthPackageSpec(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// ModifyBandwidthPackageSpecWithCallback invokes the vpc.ModifyBandwidthPackageSpec API asynchronously +// api document: https://help.aliyun.com/api/vpc/modifybandwidthpackagespec.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifyBandwidthPackageSpecWithCallback(request *ModifyBandwidthPackageSpecRequest, callback func(response *ModifyBandwidthPackageSpecResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *ModifyBandwidthPackageSpecResponse + var err error + defer close(result) + response, err = client.ModifyBandwidthPackageSpec(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// ModifyBandwidthPackageSpecRequest is the request struct for api ModifyBandwidthPackageSpec +type ModifyBandwidthPackageSpecRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + BandwidthPackageId string `position:"Query" name:"BandwidthPackageId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + Bandwidth string `position:"Query" name:"Bandwidth"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// ModifyBandwidthPackageSpecResponse is the response struct for api ModifyBandwidthPackageSpec +type ModifyBandwidthPackageSpecResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateModifyBandwidthPackageSpecRequest creates a request to invoke ModifyBandwidthPackageSpec API +func CreateModifyBandwidthPackageSpecRequest() (request *ModifyBandwidthPackageSpecRequest) { + request = &ModifyBandwidthPackageSpecRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "ModifyBandwidthPackageSpec", "vpc", "openAPI") + return +} + +// CreateModifyBandwidthPackageSpecResponse creates a response to parse from ModifyBandwidthPackageSpec response +func CreateModifyBandwidthPackageSpecResponse() (response *ModifyBandwidthPackageSpecResponse) { + response = &ModifyBandwidthPackageSpecResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/modify_bgp_group_attribute.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/modify_bgp_group_attribute.go new file mode 100644 index 000000000..d4b4cb6c1 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/modify_bgp_group_attribute.go @@ -0,0 +1,113 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// ModifyBgpGroupAttribute invokes the vpc.ModifyBgpGroupAttribute API synchronously +// api document: https://help.aliyun.com/api/vpc/modifybgpgroupattribute.html +func (client *Client) ModifyBgpGroupAttribute(request *ModifyBgpGroupAttributeRequest) (response *ModifyBgpGroupAttributeResponse, err error) { + response = CreateModifyBgpGroupAttributeResponse() + err = client.DoAction(request, response) + return +} + +// ModifyBgpGroupAttributeWithChan invokes the vpc.ModifyBgpGroupAttribute API asynchronously +// api document: https://help.aliyun.com/api/vpc/modifybgpgroupattribute.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifyBgpGroupAttributeWithChan(request *ModifyBgpGroupAttributeRequest) (<-chan *ModifyBgpGroupAttributeResponse, <-chan error) { + responseChan := make(chan *ModifyBgpGroupAttributeResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.ModifyBgpGroupAttribute(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// ModifyBgpGroupAttributeWithCallback invokes the vpc.ModifyBgpGroupAttribute API asynchronously +// api document: https://help.aliyun.com/api/vpc/modifybgpgroupattribute.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifyBgpGroupAttributeWithCallback(request *ModifyBgpGroupAttributeRequest, callback func(response *ModifyBgpGroupAttributeResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *ModifyBgpGroupAttributeResponse + var err error + defer close(result) + response, err = client.ModifyBgpGroupAttribute(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// ModifyBgpGroupAttributeRequest is the request struct for api ModifyBgpGroupAttribute +type ModifyBgpGroupAttributeRequest struct { + *requests.RpcRequest + AuthKey string `position:"Query" name:"AuthKey"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + ClientToken string `position:"Query" name:"ClientToken"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + BgpGroupId string `position:"Query" name:"BgpGroupId"` + Description string `position:"Query" name:"Description"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + PeerAsn requests.Integer `position:"Query" name:"PeerAsn"` + IsFakeAsn requests.Boolean `position:"Query" name:"IsFakeAsn"` + Name string `position:"Query" name:"Name"` +} + +// ModifyBgpGroupAttributeResponse is the response struct for api ModifyBgpGroupAttribute +type ModifyBgpGroupAttributeResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateModifyBgpGroupAttributeRequest creates a request to invoke ModifyBgpGroupAttribute API +func CreateModifyBgpGroupAttributeRequest() (request *ModifyBgpGroupAttributeRequest) { + request = &ModifyBgpGroupAttributeRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "ModifyBgpGroupAttribute", "vpc", "openAPI") + return +} + +// CreateModifyBgpGroupAttributeResponse creates a response to parse from ModifyBgpGroupAttribute response +func CreateModifyBgpGroupAttributeResponse() (response *ModifyBgpGroupAttributeResponse) { + response = &ModifyBgpGroupAttributeResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/modify_common_bandwidth_package_attribute.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/modify_common_bandwidth_package_attribute.go new file mode 100644 index 000000000..d654d9dbf --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/modify_common_bandwidth_package_attribute.go @@ -0,0 +1,109 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// ModifyCommonBandwidthPackageAttribute invokes the vpc.ModifyCommonBandwidthPackageAttribute API synchronously +// api document: https://help.aliyun.com/api/vpc/modifycommonbandwidthpackageattribute.html +func (client *Client) ModifyCommonBandwidthPackageAttribute(request *ModifyCommonBandwidthPackageAttributeRequest) (response *ModifyCommonBandwidthPackageAttributeResponse, err error) { + response = CreateModifyCommonBandwidthPackageAttributeResponse() + err = client.DoAction(request, response) + return +} + +// ModifyCommonBandwidthPackageAttributeWithChan invokes the vpc.ModifyCommonBandwidthPackageAttribute API asynchronously +// api document: https://help.aliyun.com/api/vpc/modifycommonbandwidthpackageattribute.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifyCommonBandwidthPackageAttributeWithChan(request *ModifyCommonBandwidthPackageAttributeRequest) (<-chan *ModifyCommonBandwidthPackageAttributeResponse, <-chan error) { + responseChan := make(chan *ModifyCommonBandwidthPackageAttributeResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.ModifyCommonBandwidthPackageAttribute(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// ModifyCommonBandwidthPackageAttributeWithCallback invokes the vpc.ModifyCommonBandwidthPackageAttribute API asynchronously +// api document: https://help.aliyun.com/api/vpc/modifycommonbandwidthpackageattribute.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifyCommonBandwidthPackageAttributeWithCallback(request *ModifyCommonBandwidthPackageAttributeRequest, callback func(response *ModifyCommonBandwidthPackageAttributeResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *ModifyCommonBandwidthPackageAttributeResponse + var err error + defer close(result) + response, err = client.ModifyCommonBandwidthPackageAttribute(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// ModifyCommonBandwidthPackageAttributeRequest is the request struct for api ModifyCommonBandwidthPackageAttribute +type ModifyCommonBandwidthPackageAttributeRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + BandwidthPackageId string `position:"Query" name:"BandwidthPackageId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + Name string `position:"Query" name:"Name"` + Description string `position:"Query" name:"Description"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// ModifyCommonBandwidthPackageAttributeResponse is the response struct for api ModifyCommonBandwidthPackageAttribute +type ModifyCommonBandwidthPackageAttributeResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateModifyCommonBandwidthPackageAttributeRequest creates a request to invoke ModifyCommonBandwidthPackageAttribute API +func CreateModifyCommonBandwidthPackageAttributeRequest() (request *ModifyCommonBandwidthPackageAttributeRequest) { + request = &ModifyCommonBandwidthPackageAttributeRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "ModifyCommonBandwidthPackageAttribute", "vpc", "openAPI") + return +} + +// CreateModifyCommonBandwidthPackageAttributeResponse creates a response to parse from ModifyCommonBandwidthPackageAttribute response +func CreateModifyCommonBandwidthPackageAttributeResponse() (response *ModifyCommonBandwidthPackageAttributeResponse) { + response = &ModifyCommonBandwidthPackageAttributeResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/modify_common_bandwidth_package_pay_type.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/modify_common_bandwidth_package_pay_type.go new file mode 100644 index 000000000..a90154e0b --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/modify_common_bandwidth_package_pay_type.go @@ -0,0 +1,118 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// ModifyCommonBandwidthPackagePayType invokes the vpc.ModifyCommonBandwidthPackagePayType API synchronously +// api document: https://help.aliyun.com/api/vpc/modifycommonbandwidthpackagepaytype.html +func (client *Client) ModifyCommonBandwidthPackagePayType(request *ModifyCommonBandwidthPackagePayTypeRequest) (response *ModifyCommonBandwidthPackagePayTypeResponse, err error) { + response = CreateModifyCommonBandwidthPackagePayTypeResponse() + err = client.DoAction(request, response) + return +} + +// ModifyCommonBandwidthPackagePayTypeWithChan invokes the vpc.ModifyCommonBandwidthPackagePayType API asynchronously +// api document: https://help.aliyun.com/api/vpc/modifycommonbandwidthpackagepaytype.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifyCommonBandwidthPackagePayTypeWithChan(request *ModifyCommonBandwidthPackagePayTypeRequest) (<-chan *ModifyCommonBandwidthPackagePayTypeResponse, <-chan error) { + responseChan := make(chan *ModifyCommonBandwidthPackagePayTypeResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.ModifyCommonBandwidthPackagePayType(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// ModifyCommonBandwidthPackagePayTypeWithCallback invokes the vpc.ModifyCommonBandwidthPackagePayType API asynchronously +// api document: https://help.aliyun.com/api/vpc/modifycommonbandwidthpackagepaytype.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifyCommonBandwidthPackagePayTypeWithCallback(request *ModifyCommonBandwidthPackagePayTypeRequest, callback func(response *ModifyCommonBandwidthPackagePayTypeResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *ModifyCommonBandwidthPackagePayTypeResponse + var err error + defer close(result) + response, err = client.ModifyCommonBandwidthPackagePayType(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// ModifyCommonBandwidthPackagePayTypeRequest is the request struct for api ModifyCommonBandwidthPackagePayType +type ModifyCommonBandwidthPackagePayTypeRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + BandwidthPackageId string `position:"Query" name:"BandwidthPackageId"` + AutoPay requests.Boolean `position:"Query" name:"AutoPay"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + Bandwidth string `position:"Query" name:"Bandwidth"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + Duration requests.Integer `position:"Query" name:"Duration"` + KbpsBandwidth string `position:"Query" name:"KbpsBandwidth"` + ResourceUid requests.Integer `position:"Query" name:"ResourceUid"` + ResourceBid string `position:"Query" name:"ResourceBid"` + PayType string `position:"Query" name:"PayType"` + PricingCycle string `position:"Query" name:"PricingCycle"` +} + +// ModifyCommonBandwidthPackagePayTypeResponse is the response struct for api ModifyCommonBandwidthPackagePayType +type ModifyCommonBandwidthPackagePayTypeResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + OrderId int `json:"OrderId" xml:"OrderId"` + Code string `json:"Code" xml:"Code"` + Message string `json:"Message" xml:"Message"` +} + +// CreateModifyCommonBandwidthPackagePayTypeRequest creates a request to invoke ModifyCommonBandwidthPackagePayType API +func CreateModifyCommonBandwidthPackagePayTypeRequest() (request *ModifyCommonBandwidthPackagePayTypeRequest) { + request = &ModifyCommonBandwidthPackagePayTypeRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "ModifyCommonBandwidthPackagePayType", "vpc", "openAPI") + return +} + +// CreateModifyCommonBandwidthPackagePayTypeResponse creates a response to parse from ModifyCommonBandwidthPackagePayType response +func CreateModifyCommonBandwidthPackagePayTypeResponse() (response *ModifyCommonBandwidthPackagePayTypeResponse) { + response = &ModifyCommonBandwidthPackagePayTypeResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/modify_common_bandwidth_package_spec.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/modify_common_bandwidth_package_spec.go new file mode 100644 index 000000000..6c168a68d --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/modify_common_bandwidth_package_spec.go @@ -0,0 +1,108 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// ModifyCommonBandwidthPackageSpec invokes the vpc.ModifyCommonBandwidthPackageSpec API synchronously +// api document: https://help.aliyun.com/api/vpc/modifycommonbandwidthpackagespec.html +func (client *Client) ModifyCommonBandwidthPackageSpec(request *ModifyCommonBandwidthPackageSpecRequest) (response *ModifyCommonBandwidthPackageSpecResponse, err error) { + response = CreateModifyCommonBandwidthPackageSpecResponse() + err = client.DoAction(request, response) + return +} + +// ModifyCommonBandwidthPackageSpecWithChan invokes the vpc.ModifyCommonBandwidthPackageSpec API asynchronously +// api document: https://help.aliyun.com/api/vpc/modifycommonbandwidthpackagespec.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifyCommonBandwidthPackageSpecWithChan(request *ModifyCommonBandwidthPackageSpecRequest) (<-chan *ModifyCommonBandwidthPackageSpecResponse, <-chan error) { + responseChan := make(chan *ModifyCommonBandwidthPackageSpecResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.ModifyCommonBandwidthPackageSpec(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// ModifyCommonBandwidthPackageSpecWithCallback invokes the vpc.ModifyCommonBandwidthPackageSpec API asynchronously +// api document: https://help.aliyun.com/api/vpc/modifycommonbandwidthpackagespec.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifyCommonBandwidthPackageSpecWithCallback(request *ModifyCommonBandwidthPackageSpecRequest, callback func(response *ModifyCommonBandwidthPackageSpecResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *ModifyCommonBandwidthPackageSpecResponse + var err error + defer close(result) + response, err = client.ModifyCommonBandwidthPackageSpec(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// ModifyCommonBandwidthPackageSpecRequest is the request struct for api ModifyCommonBandwidthPackageSpec +type ModifyCommonBandwidthPackageSpecRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + BandwidthPackageId string `position:"Query" name:"BandwidthPackageId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + Bandwidth string `position:"Query" name:"Bandwidth"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// ModifyCommonBandwidthPackageSpecResponse is the response struct for api ModifyCommonBandwidthPackageSpec +type ModifyCommonBandwidthPackageSpecResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateModifyCommonBandwidthPackageSpecRequest creates a request to invoke ModifyCommonBandwidthPackageSpec API +func CreateModifyCommonBandwidthPackageSpecRequest() (request *ModifyCommonBandwidthPackageSpecRequest) { + request = &ModifyCommonBandwidthPackageSpecRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "ModifyCommonBandwidthPackageSpec", "vpc", "openAPI") + return +} + +// CreateModifyCommonBandwidthPackageSpecResponse creates a response to parse from ModifyCommonBandwidthPackageSpec response +func CreateModifyCommonBandwidthPackageSpecResponse() (response *ModifyCommonBandwidthPackageSpecResponse) { + response = &ModifyCommonBandwidthPackageSpecResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/modify_customer_gateway_attribute.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/modify_customer_gateway_attribute.go new file mode 100644 index 000000000..c96bbe5f3 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/modify_customer_gateway_attribute.go @@ -0,0 +1,115 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// ModifyCustomerGatewayAttribute invokes the vpc.ModifyCustomerGatewayAttribute API synchronously +// api document: https://help.aliyun.com/api/vpc/modifycustomergatewayattribute.html +func (client *Client) ModifyCustomerGatewayAttribute(request *ModifyCustomerGatewayAttributeRequest) (response *ModifyCustomerGatewayAttributeResponse, err error) { + response = CreateModifyCustomerGatewayAttributeResponse() + err = client.DoAction(request, response) + return +} + +// ModifyCustomerGatewayAttributeWithChan invokes the vpc.ModifyCustomerGatewayAttribute API asynchronously +// api document: https://help.aliyun.com/api/vpc/modifycustomergatewayattribute.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifyCustomerGatewayAttributeWithChan(request *ModifyCustomerGatewayAttributeRequest) (<-chan *ModifyCustomerGatewayAttributeResponse, <-chan error) { + responseChan := make(chan *ModifyCustomerGatewayAttributeResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.ModifyCustomerGatewayAttribute(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// ModifyCustomerGatewayAttributeWithCallback invokes the vpc.ModifyCustomerGatewayAttribute API asynchronously +// api document: https://help.aliyun.com/api/vpc/modifycustomergatewayattribute.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifyCustomerGatewayAttributeWithCallback(request *ModifyCustomerGatewayAttributeRequest, callback func(response *ModifyCustomerGatewayAttributeResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *ModifyCustomerGatewayAttributeResponse + var err error + defer close(result) + response, err = client.ModifyCustomerGatewayAttribute(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// ModifyCustomerGatewayAttributeRequest is the request struct for api ModifyCustomerGatewayAttribute +type ModifyCustomerGatewayAttributeRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + ClientToken string `position:"Query" name:"ClientToken"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + Name string `position:"Query" name:"Name"` + Description string `position:"Query" name:"Description"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + CustomerGatewayId string `position:"Query" name:"CustomerGatewayId"` +} + +// ModifyCustomerGatewayAttributeResponse is the response struct for api ModifyCustomerGatewayAttribute +type ModifyCustomerGatewayAttributeResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + CustomerGatewayId string `json:"CustomerGatewayId" xml:"CustomerGatewayId"` + IpAddress string `json:"IpAddress" xml:"IpAddress"` + Name string `json:"Name" xml:"Name"` + Description string `json:"Description" xml:"Description"` + CreateTime int `json:"CreateTime" xml:"CreateTime"` +} + +// CreateModifyCustomerGatewayAttributeRequest creates a request to invoke ModifyCustomerGatewayAttribute API +func CreateModifyCustomerGatewayAttributeRequest() (request *ModifyCustomerGatewayAttributeRequest) { + request = &ModifyCustomerGatewayAttributeRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "ModifyCustomerGatewayAttribute", "vpc", "openAPI") + return +} + +// CreateModifyCustomerGatewayAttributeResponse creates a response to parse from ModifyCustomerGatewayAttribute response +func CreateModifyCustomerGatewayAttributeResponse() (response *ModifyCustomerGatewayAttributeResponse) { + response = &ModifyCustomerGatewayAttributeResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/modify_eip_address_attribute.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/modify_eip_address_attribute.go new file mode 100644 index 000000000..7d1db86bc --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/modify_eip_address_attribute.go @@ -0,0 +1,110 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// ModifyEipAddressAttribute invokes the vpc.ModifyEipAddressAttribute API synchronously +// api document: https://help.aliyun.com/api/vpc/modifyeipaddressattribute.html +func (client *Client) ModifyEipAddressAttribute(request *ModifyEipAddressAttributeRequest) (response *ModifyEipAddressAttributeResponse, err error) { + response = CreateModifyEipAddressAttributeResponse() + err = client.DoAction(request, response) + return +} + +// ModifyEipAddressAttributeWithChan invokes the vpc.ModifyEipAddressAttribute API asynchronously +// api document: https://help.aliyun.com/api/vpc/modifyeipaddressattribute.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifyEipAddressAttributeWithChan(request *ModifyEipAddressAttributeRequest) (<-chan *ModifyEipAddressAttributeResponse, <-chan error) { + responseChan := make(chan *ModifyEipAddressAttributeResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.ModifyEipAddressAttribute(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// ModifyEipAddressAttributeWithCallback invokes the vpc.ModifyEipAddressAttribute API asynchronously +// api document: https://help.aliyun.com/api/vpc/modifyeipaddressattribute.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifyEipAddressAttributeWithCallback(request *ModifyEipAddressAttributeRequest, callback func(response *ModifyEipAddressAttributeResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *ModifyEipAddressAttributeResponse + var err error + defer close(result) + response, err = client.ModifyEipAddressAttribute(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// ModifyEipAddressAttributeRequest is the request struct for api ModifyEipAddressAttribute +type ModifyEipAddressAttributeRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + Bandwidth string `position:"Query" name:"Bandwidth"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + Name string `position:"Query" name:"Name"` + Description string `position:"Query" name:"Description"` + AllocationId string `position:"Query" name:"AllocationId"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// ModifyEipAddressAttributeResponse is the response struct for api ModifyEipAddressAttribute +type ModifyEipAddressAttributeResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateModifyEipAddressAttributeRequest creates a request to invoke ModifyEipAddressAttribute API +func CreateModifyEipAddressAttributeRequest() (request *ModifyEipAddressAttributeRequest) { + request = &ModifyEipAddressAttributeRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "ModifyEipAddressAttribute", "vpc", "openAPI") + return +} + +// CreateModifyEipAddressAttributeResponse creates a response to parse from ModifyEipAddressAttribute response +func CreateModifyEipAddressAttributeResponse() (response *ModifyEipAddressAttributeResponse) { + response = &ModifyEipAddressAttributeResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/modify_flow_log_attribute.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/modify_flow_log_attribute.go new file mode 100644 index 000000000..af61fec2f --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/modify_flow_log_attribute.go @@ -0,0 +1,110 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// ModifyFlowLogAttribute invokes the vpc.ModifyFlowLogAttribute API synchronously +// api document: https://help.aliyun.com/api/vpc/modifyflowlogattribute.html +func (client *Client) ModifyFlowLogAttribute(request *ModifyFlowLogAttributeRequest) (response *ModifyFlowLogAttributeResponse, err error) { + response = CreateModifyFlowLogAttributeResponse() + err = client.DoAction(request, response) + return +} + +// ModifyFlowLogAttributeWithChan invokes the vpc.ModifyFlowLogAttribute API asynchronously +// api document: https://help.aliyun.com/api/vpc/modifyflowlogattribute.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifyFlowLogAttributeWithChan(request *ModifyFlowLogAttributeRequest) (<-chan *ModifyFlowLogAttributeResponse, <-chan error) { + responseChan := make(chan *ModifyFlowLogAttributeResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.ModifyFlowLogAttribute(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// ModifyFlowLogAttributeWithCallback invokes the vpc.ModifyFlowLogAttribute API asynchronously +// api document: https://help.aliyun.com/api/vpc/modifyflowlogattribute.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifyFlowLogAttributeWithCallback(request *ModifyFlowLogAttributeRequest, callback func(response *ModifyFlowLogAttributeResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *ModifyFlowLogAttributeResponse + var err error + defer close(result) + response, err = client.ModifyFlowLogAttribute(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// ModifyFlowLogAttributeRequest is the request struct for api ModifyFlowLogAttribute +type ModifyFlowLogAttributeRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + Description string `position:"Query" name:"Description"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + FlowLogId string `position:"Query" name:"FlowLogId"` + FlowLogName string `position:"Query" name:"FlowLogName"` +} + +// ModifyFlowLogAttributeResponse is the response struct for api ModifyFlowLogAttribute +type ModifyFlowLogAttributeResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + Success string `json:"Success" xml:"Success"` +} + +// CreateModifyFlowLogAttributeRequest creates a request to invoke ModifyFlowLogAttribute API +func CreateModifyFlowLogAttributeRequest() (request *ModifyFlowLogAttributeRequest) { + request = &ModifyFlowLogAttributeRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "ModifyFlowLogAttribute", "vpc", "openAPI") + return +} + +// CreateModifyFlowLogAttributeResponse creates a response to parse from ModifyFlowLogAttribute response +func CreateModifyFlowLogAttributeResponse() (response *ModifyFlowLogAttributeResponse) { + response = &ModifyFlowLogAttributeResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/modify_forward_entry.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/modify_forward_entry.go new file mode 100644 index 000000000..6e79cb5d9 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/modify_forward_entry.go @@ -0,0 +1,114 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// ModifyForwardEntry invokes the vpc.ModifyForwardEntry API synchronously +// api document: https://help.aliyun.com/api/vpc/modifyforwardentry.html +func (client *Client) ModifyForwardEntry(request *ModifyForwardEntryRequest) (response *ModifyForwardEntryResponse, err error) { + response = CreateModifyForwardEntryResponse() + err = client.DoAction(request, response) + return +} + +// ModifyForwardEntryWithChan invokes the vpc.ModifyForwardEntry API asynchronously +// api document: https://help.aliyun.com/api/vpc/modifyforwardentry.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifyForwardEntryWithChan(request *ModifyForwardEntryRequest) (<-chan *ModifyForwardEntryResponse, <-chan error) { + responseChan := make(chan *ModifyForwardEntryResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.ModifyForwardEntry(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// ModifyForwardEntryWithCallback invokes the vpc.ModifyForwardEntry API asynchronously +// api document: https://help.aliyun.com/api/vpc/modifyforwardentry.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifyForwardEntryWithCallback(request *ModifyForwardEntryRequest, callback func(response *ModifyForwardEntryResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *ModifyForwardEntryResponse + var err error + defer close(result) + response, err = client.ModifyForwardEntry(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// ModifyForwardEntryRequest is the request struct for api ModifyForwardEntry +type ModifyForwardEntryRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + IpProtocol string `position:"Query" name:"IpProtocol"` + ForwardEntryName string `position:"Query" name:"ForwardEntryName"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + ForwardTableId string `position:"Query" name:"ForwardTableId"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + InternalIp string `position:"Query" name:"InternalIp"` + ForwardEntryId string `position:"Query" name:"ForwardEntryId"` + InternalPort string `position:"Query" name:"InternalPort"` + ExternalIp string `position:"Query" name:"ExternalIp"` + ExternalPort string `position:"Query" name:"ExternalPort"` +} + +// ModifyForwardEntryResponse is the response struct for api ModifyForwardEntry +type ModifyForwardEntryResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateModifyForwardEntryRequest creates a request to invoke ModifyForwardEntry API +func CreateModifyForwardEntryRequest() (request *ModifyForwardEntryRequest) { + request = &ModifyForwardEntryRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "ModifyForwardEntry", "vpc", "openAPI") + return +} + +// CreateModifyForwardEntryResponse creates a response to parse from ModifyForwardEntry response +func CreateModifyForwardEntryResponse() (response *ModifyForwardEntryResponse) { + response = &ModifyForwardEntryResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/modify_global_acceleration_instance_attributes.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/modify_global_acceleration_instance_attributes.go new file mode 100644 index 000000000..03825cea0 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/modify_global_acceleration_instance_attributes.go @@ -0,0 +1,109 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// ModifyGlobalAccelerationInstanceAttributes invokes the vpc.ModifyGlobalAccelerationInstanceAttributes API synchronously +// api document: https://help.aliyun.com/api/vpc/modifyglobalaccelerationinstanceattributes.html +func (client *Client) ModifyGlobalAccelerationInstanceAttributes(request *ModifyGlobalAccelerationInstanceAttributesRequest) (response *ModifyGlobalAccelerationInstanceAttributesResponse, err error) { + response = CreateModifyGlobalAccelerationInstanceAttributesResponse() + err = client.DoAction(request, response) + return +} + +// ModifyGlobalAccelerationInstanceAttributesWithChan invokes the vpc.ModifyGlobalAccelerationInstanceAttributes API asynchronously +// api document: https://help.aliyun.com/api/vpc/modifyglobalaccelerationinstanceattributes.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifyGlobalAccelerationInstanceAttributesWithChan(request *ModifyGlobalAccelerationInstanceAttributesRequest) (<-chan *ModifyGlobalAccelerationInstanceAttributesResponse, <-chan error) { + responseChan := make(chan *ModifyGlobalAccelerationInstanceAttributesResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.ModifyGlobalAccelerationInstanceAttributes(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// ModifyGlobalAccelerationInstanceAttributesWithCallback invokes the vpc.ModifyGlobalAccelerationInstanceAttributes API asynchronously +// api document: https://help.aliyun.com/api/vpc/modifyglobalaccelerationinstanceattributes.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifyGlobalAccelerationInstanceAttributesWithCallback(request *ModifyGlobalAccelerationInstanceAttributesRequest, callback func(response *ModifyGlobalAccelerationInstanceAttributesResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *ModifyGlobalAccelerationInstanceAttributesResponse + var err error + defer close(result) + response, err = client.ModifyGlobalAccelerationInstanceAttributes(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// ModifyGlobalAccelerationInstanceAttributesRequest is the request struct for api ModifyGlobalAccelerationInstanceAttributes +type ModifyGlobalAccelerationInstanceAttributesRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + Name string `position:"Query" name:"Name"` + Description string `position:"Query" name:"Description"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + GlobalAccelerationInstanceId string `position:"Query" name:"GlobalAccelerationInstanceId"` +} + +// ModifyGlobalAccelerationInstanceAttributesResponse is the response struct for api ModifyGlobalAccelerationInstanceAttributes +type ModifyGlobalAccelerationInstanceAttributesResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateModifyGlobalAccelerationInstanceAttributesRequest creates a request to invoke ModifyGlobalAccelerationInstanceAttributes API +func CreateModifyGlobalAccelerationInstanceAttributesRequest() (request *ModifyGlobalAccelerationInstanceAttributesRequest) { + request = &ModifyGlobalAccelerationInstanceAttributesRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "ModifyGlobalAccelerationInstanceAttributes", "vpc", "openAPI") + return +} + +// CreateModifyGlobalAccelerationInstanceAttributesResponse creates a response to parse from ModifyGlobalAccelerationInstanceAttributes response +func CreateModifyGlobalAccelerationInstanceAttributesResponse() (response *ModifyGlobalAccelerationInstanceAttributesResponse) { + response = &ModifyGlobalAccelerationInstanceAttributesResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/modify_global_acceleration_instance_spec.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/modify_global_acceleration_instance_spec.go new file mode 100644 index 000000000..ca83082cd --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/modify_global_acceleration_instance_spec.go @@ -0,0 +1,108 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// ModifyGlobalAccelerationInstanceSpec invokes the vpc.ModifyGlobalAccelerationInstanceSpec API synchronously +// api document: https://help.aliyun.com/api/vpc/modifyglobalaccelerationinstancespec.html +func (client *Client) ModifyGlobalAccelerationInstanceSpec(request *ModifyGlobalAccelerationInstanceSpecRequest) (response *ModifyGlobalAccelerationInstanceSpecResponse, err error) { + response = CreateModifyGlobalAccelerationInstanceSpecResponse() + err = client.DoAction(request, response) + return +} + +// ModifyGlobalAccelerationInstanceSpecWithChan invokes the vpc.ModifyGlobalAccelerationInstanceSpec API asynchronously +// api document: https://help.aliyun.com/api/vpc/modifyglobalaccelerationinstancespec.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifyGlobalAccelerationInstanceSpecWithChan(request *ModifyGlobalAccelerationInstanceSpecRequest) (<-chan *ModifyGlobalAccelerationInstanceSpecResponse, <-chan error) { + responseChan := make(chan *ModifyGlobalAccelerationInstanceSpecResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.ModifyGlobalAccelerationInstanceSpec(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// ModifyGlobalAccelerationInstanceSpecWithCallback invokes the vpc.ModifyGlobalAccelerationInstanceSpec API asynchronously +// api document: https://help.aliyun.com/api/vpc/modifyglobalaccelerationinstancespec.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifyGlobalAccelerationInstanceSpecWithCallback(request *ModifyGlobalAccelerationInstanceSpecRequest, callback func(response *ModifyGlobalAccelerationInstanceSpecResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *ModifyGlobalAccelerationInstanceSpecResponse + var err error + defer close(result) + response, err = client.ModifyGlobalAccelerationInstanceSpec(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// ModifyGlobalAccelerationInstanceSpecRequest is the request struct for api ModifyGlobalAccelerationInstanceSpec +type ModifyGlobalAccelerationInstanceSpecRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + Bandwidth string `position:"Query" name:"Bandwidth"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + GlobalAccelerationInstanceId string `position:"Query" name:"GlobalAccelerationInstanceId"` +} + +// ModifyGlobalAccelerationInstanceSpecResponse is the response struct for api ModifyGlobalAccelerationInstanceSpec +type ModifyGlobalAccelerationInstanceSpecResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateModifyGlobalAccelerationInstanceSpecRequest creates a request to invoke ModifyGlobalAccelerationInstanceSpec API +func CreateModifyGlobalAccelerationInstanceSpecRequest() (request *ModifyGlobalAccelerationInstanceSpecRequest) { + request = &ModifyGlobalAccelerationInstanceSpecRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "ModifyGlobalAccelerationInstanceSpec", "vpc", "openAPI") + return +} + +// CreateModifyGlobalAccelerationInstanceSpecResponse creates a response to parse from ModifyGlobalAccelerationInstanceSpec response +func CreateModifyGlobalAccelerationInstanceSpecResponse() (response *ModifyGlobalAccelerationInstanceSpecResponse) { + response = &ModifyGlobalAccelerationInstanceSpecResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/modify_ha_vip_attribute.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/modify_ha_vip_attribute.go new file mode 100644 index 000000000..a4110141b --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/modify_ha_vip_attribute.go @@ -0,0 +1,109 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// ModifyHaVipAttribute invokes the vpc.ModifyHaVipAttribute API synchronously +// api document: https://help.aliyun.com/api/vpc/modifyhavipattribute.html +func (client *Client) ModifyHaVipAttribute(request *ModifyHaVipAttributeRequest) (response *ModifyHaVipAttributeResponse, err error) { + response = CreateModifyHaVipAttributeResponse() + err = client.DoAction(request, response) + return +} + +// ModifyHaVipAttributeWithChan invokes the vpc.ModifyHaVipAttribute API asynchronously +// api document: https://help.aliyun.com/api/vpc/modifyhavipattribute.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifyHaVipAttributeWithChan(request *ModifyHaVipAttributeRequest) (<-chan *ModifyHaVipAttributeResponse, <-chan error) { + responseChan := make(chan *ModifyHaVipAttributeResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.ModifyHaVipAttribute(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// ModifyHaVipAttributeWithCallback invokes the vpc.ModifyHaVipAttribute API asynchronously +// api document: https://help.aliyun.com/api/vpc/modifyhavipattribute.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifyHaVipAttributeWithCallback(request *ModifyHaVipAttributeRequest, callback func(response *ModifyHaVipAttributeResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *ModifyHaVipAttributeResponse + var err error + defer close(result) + response, err = client.ModifyHaVipAttribute(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// ModifyHaVipAttributeRequest is the request struct for api ModifyHaVipAttribute +type ModifyHaVipAttributeRequest struct { + *requests.RpcRequest + HaVipId string `position:"Query" name:"HaVipId"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + ClientToken string `position:"Query" name:"ClientToken"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + Description string `position:"Query" name:"Description"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// ModifyHaVipAttributeResponse is the response struct for api ModifyHaVipAttribute +type ModifyHaVipAttributeResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateModifyHaVipAttributeRequest creates a request to invoke ModifyHaVipAttribute API +func CreateModifyHaVipAttributeRequest() (request *ModifyHaVipAttributeRequest) { + request = &ModifyHaVipAttributeRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "ModifyHaVipAttribute", "vpc", "openAPI") + return +} + +// CreateModifyHaVipAttributeResponse creates a response to parse from ModifyHaVipAttribute response +func CreateModifyHaVipAttributeResponse() (response *ModifyHaVipAttributeResponse) { + response = &ModifyHaVipAttributeResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/modify_i_pv6_translator_acl_attribute.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/modify_i_pv6_translator_acl_attribute.go new file mode 100644 index 000000000..0ab8c99c3 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/modify_i_pv6_translator_acl_attribute.go @@ -0,0 +1,109 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// ModifyIPv6TranslatorAclAttribute invokes the vpc.ModifyIPv6TranslatorAclAttribute API synchronously +// api document: https://help.aliyun.com/api/vpc/modifyipv6translatoraclattribute.html +func (client *Client) ModifyIPv6TranslatorAclAttribute(request *ModifyIPv6TranslatorAclAttributeRequest) (response *ModifyIPv6TranslatorAclAttributeResponse, err error) { + response = CreateModifyIPv6TranslatorAclAttributeResponse() + err = client.DoAction(request, response) + return +} + +// ModifyIPv6TranslatorAclAttributeWithChan invokes the vpc.ModifyIPv6TranslatorAclAttribute API asynchronously +// api document: https://help.aliyun.com/api/vpc/modifyipv6translatoraclattribute.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifyIPv6TranslatorAclAttributeWithChan(request *ModifyIPv6TranslatorAclAttributeRequest) (<-chan *ModifyIPv6TranslatorAclAttributeResponse, <-chan error) { + responseChan := make(chan *ModifyIPv6TranslatorAclAttributeResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.ModifyIPv6TranslatorAclAttribute(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// ModifyIPv6TranslatorAclAttributeWithCallback invokes the vpc.ModifyIPv6TranslatorAclAttribute API asynchronously +// api document: https://help.aliyun.com/api/vpc/modifyipv6translatoraclattribute.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifyIPv6TranslatorAclAttributeWithCallback(request *ModifyIPv6TranslatorAclAttributeRequest, callback func(response *ModifyIPv6TranslatorAclAttributeResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *ModifyIPv6TranslatorAclAttributeResponse + var err error + defer close(result) + response, err = client.ModifyIPv6TranslatorAclAttribute(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// ModifyIPv6TranslatorAclAttributeRequest is the request struct for api ModifyIPv6TranslatorAclAttribute +type ModifyIPv6TranslatorAclAttributeRequest struct { + *requests.RpcRequest + AclId string `position:"Query" name:"AclId"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + AclName string `position:"Query" name:"AclName"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + ClientToken string `position:"Query" name:"ClientToken"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// ModifyIPv6TranslatorAclAttributeResponse is the response struct for api ModifyIPv6TranslatorAclAttribute +type ModifyIPv6TranslatorAclAttributeResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateModifyIPv6TranslatorAclAttributeRequest creates a request to invoke ModifyIPv6TranslatorAclAttribute API +func CreateModifyIPv6TranslatorAclAttributeRequest() (request *ModifyIPv6TranslatorAclAttributeRequest) { + request = &ModifyIPv6TranslatorAclAttributeRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "ModifyIPv6TranslatorAclAttribute", "vpc", "openAPI") + return +} + +// CreateModifyIPv6TranslatorAclAttributeResponse creates a response to parse from ModifyIPv6TranslatorAclAttribute response +func CreateModifyIPv6TranslatorAclAttributeResponse() (response *ModifyIPv6TranslatorAclAttributeResponse) { + response = &ModifyIPv6TranslatorAclAttributeResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/modify_i_pv6_translator_acl_list_entry.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/modify_i_pv6_translator_acl_list_entry.go new file mode 100644 index 000000000..3b22900b8 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/modify_i_pv6_translator_acl_list_entry.go @@ -0,0 +1,109 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// ModifyIPv6TranslatorAclListEntry invokes the vpc.ModifyIPv6TranslatorAclListEntry API synchronously +// api document: https://help.aliyun.com/api/vpc/modifyipv6translatoracllistentry.html +func (client *Client) ModifyIPv6TranslatorAclListEntry(request *ModifyIPv6TranslatorAclListEntryRequest) (response *ModifyIPv6TranslatorAclListEntryResponse, err error) { + response = CreateModifyIPv6TranslatorAclListEntryResponse() + err = client.DoAction(request, response) + return +} + +// ModifyIPv6TranslatorAclListEntryWithChan invokes the vpc.ModifyIPv6TranslatorAclListEntry API asynchronously +// api document: https://help.aliyun.com/api/vpc/modifyipv6translatoracllistentry.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifyIPv6TranslatorAclListEntryWithChan(request *ModifyIPv6TranslatorAclListEntryRequest) (<-chan *ModifyIPv6TranslatorAclListEntryResponse, <-chan error) { + responseChan := make(chan *ModifyIPv6TranslatorAclListEntryResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.ModifyIPv6TranslatorAclListEntry(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// ModifyIPv6TranslatorAclListEntryWithCallback invokes the vpc.ModifyIPv6TranslatorAclListEntry API asynchronously +// api document: https://help.aliyun.com/api/vpc/modifyipv6translatoracllistentry.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifyIPv6TranslatorAclListEntryWithCallback(request *ModifyIPv6TranslatorAclListEntryRequest, callback func(response *ModifyIPv6TranslatorAclListEntryResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *ModifyIPv6TranslatorAclListEntryResponse + var err error + defer close(result) + response, err = client.ModifyIPv6TranslatorAclListEntry(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// ModifyIPv6TranslatorAclListEntryRequest is the request struct for api ModifyIPv6TranslatorAclListEntry +type ModifyIPv6TranslatorAclListEntryRequest struct { + *requests.RpcRequest + AclId string `position:"Query" name:"AclId"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + 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"` + AclEntryId string `position:"Query" name:"AclEntryId"` +} + +// ModifyIPv6TranslatorAclListEntryResponse is the response struct for api ModifyIPv6TranslatorAclListEntry +type ModifyIPv6TranslatorAclListEntryResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateModifyIPv6TranslatorAclListEntryRequest creates a request to invoke ModifyIPv6TranslatorAclListEntry API +func CreateModifyIPv6TranslatorAclListEntryRequest() (request *ModifyIPv6TranslatorAclListEntryRequest) { + request = &ModifyIPv6TranslatorAclListEntryRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "ModifyIPv6TranslatorAclListEntry", "vpc", "openAPI") + return +} + +// CreateModifyIPv6TranslatorAclListEntryResponse creates a response to parse from ModifyIPv6TranslatorAclListEntry response +func CreateModifyIPv6TranslatorAclListEntryResponse() (response *ModifyIPv6TranslatorAclListEntryResponse) { + response = &ModifyIPv6TranslatorAclListEntryResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/modify_i_pv6_translator_attribute.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/modify_i_pv6_translator_attribute.go new file mode 100644 index 000000000..01384954f --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/modify_i_pv6_translator_attribute.go @@ -0,0 +1,110 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// ModifyIPv6TranslatorAttribute invokes the vpc.ModifyIPv6TranslatorAttribute API synchronously +// api document: https://help.aliyun.com/api/vpc/modifyipv6translatorattribute.html +func (client *Client) ModifyIPv6TranslatorAttribute(request *ModifyIPv6TranslatorAttributeRequest) (response *ModifyIPv6TranslatorAttributeResponse, err error) { + response = CreateModifyIPv6TranslatorAttributeResponse() + err = client.DoAction(request, response) + return +} + +// ModifyIPv6TranslatorAttributeWithChan invokes the vpc.ModifyIPv6TranslatorAttribute API asynchronously +// api document: https://help.aliyun.com/api/vpc/modifyipv6translatorattribute.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifyIPv6TranslatorAttributeWithChan(request *ModifyIPv6TranslatorAttributeRequest) (<-chan *ModifyIPv6TranslatorAttributeResponse, <-chan error) { + responseChan := make(chan *ModifyIPv6TranslatorAttributeResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.ModifyIPv6TranslatorAttribute(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// ModifyIPv6TranslatorAttributeWithCallback invokes the vpc.ModifyIPv6TranslatorAttribute API asynchronously +// api document: https://help.aliyun.com/api/vpc/modifyipv6translatorattribute.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifyIPv6TranslatorAttributeWithCallback(request *ModifyIPv6TranslatorAttributeRequest, callback func(response *ModifyIPv6TranslatorAttributeResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *ModifyIPv6TranslatorAttributeResponse + var err error + defer close(result) + response, err = client.ModifyIPv6TranslatorAttribute(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// ModifyIPv6TranslatorAttributeRequest is the request struct for api ModifyIPv6TranslatorAttribute +type ModifyIPv6TranslatorAttributeRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + ClientToken string `position:"Query" name:"ClientToken"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + Name string `position:"Query" name:"Name"` + Description string `position:"Query" name:"Description"` + Ipv6TranslatorId string `position:"Query" name:"Ipv6TranslatorId"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// ModifyIPv6TranslatorAttributeResponse is the response struct for api ModifyIPv6TranslatorAttribute +type ModifyIPv6TranslatorAttributeResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateModifyIPv6TranslatorAttributeRequest creates a request to invoke ModifyIPv6TranslatorAttribute API +func CreateModifyIPv6TranslatorAttributeRequest() (request *ModifyIPv6TranslatorAttributeRequest) { + request = &ModifyIPv6TranslatorAttributeRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "ModifyIPv6TranslatorAttribute", "vpc", "openAPI") + return +} + +// CreateModifyIPv6TranslatorAttributeResponse creates a response to parse from ModifyIPv6TranslatorAttribute response +func CreateModifyIPv6TranslatorAttributeResponse() (response *ModifyIPv6TranslatorAttributeResponse) { + response = &ModifyIPv6TranslatorAttributeResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/modify_i_pv6_translator_bandwidth.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/modify_i_pv6_translator_bandwidth.go new file mode 100644 index 000000000..c1f8e8a56 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/modify_i_pv6_translator_bandwidth.go @@ -0,0 +1,111 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// ModifyIPv6TranslatorBandwidth invokes the vpc.ModifyIPv6TranslatorBandwidth API synchronously +// api document: https://help.aliyun.com/api/vpc/modifyipv6translatorbandwidth.html +func (client *Client) ModifyIPv6TranslatorBandwidth(request *ModifyIPv6TranslatorBandwidthRequest) (response *ModifyIPv6TranslatorBandwidthResponse, err error) { + response = CreateModifyIPv6TranslatorBandwidthResponse() + err = client.DoAction(request, response) + return +} + +// ModifyIPv6TranslatorBandwidthWithChan invokes the vpc.ModifyIPv6TranslatorBandwidth API asynchronously +// api document: https://help.aliyun.com/api/vpc/modifyipv6translatorbandwidth.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifyIPv6TranslatorBandwidthWithChan(request *ModifyIPv6TranslatorBandwidthRequest) (<-chan *ModifyIPv6TranslatorBandwidthResponse, <-chan error) { + responseChan := make(chan *ModifyIPv6TranslatorBandwidthResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.ModifyIPv6TranslatorBandwidth(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// ModifyIPv6TranslatorBandwidthWithCallback invokes the vpc.ModifyIPv6TranslatorBandwidth API asynchronously +// api document: https://help.aliyun.com/api/vpc/modifyipv6translatorbandwidth.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifyIPv6TranslatorBandwidthWithCallback(request *ModifyIPv6TranslatorBandwidthRequest, callback func(response *ModifyIPv6TranslatorBandwidthResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *ModifyIPv6TranslatorBandwidthResponse + var err error + defer close(result) + response, err = client.ModifyIPv6TranslatorBandwidth(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// ModifyIPv6TranslatorBandwidthRequest is the request struct for api ModifyIPv6TranslatorBandwidth +type ModifyIPv6TranslatorBandwidthRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + AutoPay requests.Boolean `position:"Query" name:"AutoPay"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + ClientToken string `position:"Query" name:"ClientToken"` + Bandwidth requests.Integer `position:"Query" name:"Bandwidth"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + Ipv6TranslatorId string `position:"Query" name:"Ipv6TranslatorId"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// ModifyIPv6TranslatorBandwidthResponse is the response struct for api ModifyIPv6TranslatorBandwidth +type ModifyIPv6TranslatorBandwidthResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + OrderId string `json:"OrderId" xml:"OrderId"` +} + +// CreateModifyIPv6TranslatorBandwidthRequest creates a request to invoke ModifyIPv6TranslatorBandwidth API +func CreateModifyIPv6TranslatorBandwidthRequest() (request *ModifyIPv6TranslatorBandwidthRequest) { + request = &ModifyIPv6TranslatorBandwidthRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "ModifyIPv6TranslatorBandwidth", "vpc", "openAPI") + return +} + +// CreateModifyIPv6TranslatorBandwidthResponse creates a response to parse from ModifyIPv6TranslatorBandwidth response +func CreateModifyIPv6TranslatorBandwidthResponse() (response *ModifyIPv6TranslatorBandwidthResponse) { + response = &ModifyIPv6TranslatorBandwidthResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/modify_i_pv6_translator_entry.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/modify_i_pv6_translator_entry.go new file mode 100644 index 000000000..db7cd49b8 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/modify_i_pv6_translator_entry.go @@ -0,0 +1,117 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// ModifyIPv6TranslatorEntry invokes the vpc.ModifyIPv6TranslatorEntry API synchronously +// api document: https://help.aliyun.com/api/vpc/modifyipv6translatorentry.html +func (client *Client) ModifyIPv6TranslatorEntry(request *ModifyIPv6TranslatorEntryRequest) (response *ModifyIPv6TranslatorEntryResponse, err error) { + response = CreateModifyIPv6TranslatorEntryResponse() + err = client.DoAction(request, response) + return +} + +// ModifyIPv6TranslatorEntryWithChan invokes the vpc.ModifyIPv6TranslatorEntry API asynchronously +// api document: https://help.aliyun.com/api/vpc/modifyipv6translatorentry.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifyIPv6TranslatorEntryWithChan(request *ModifyIPv6TranslatorEntryRequest) (<-chan *ModifyIPv6TranslatorEntryResponse, <-chan error) { + responseChan := make(chan *ModifyIPv6TranslatorEntryResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.ModifyIPv6TranslatorEntry(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// ModifyIPv6TranslatorEntryWithCallback invokes the vpc.ModifyIPv6TranslatorEntry API asynchronously +// api document: https://help.aliyun.com/api/vpc/modifyipv6translatorentry.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifyIPv6TranslatorEntryWithCallback(request *ModifyIPv6TranslatorEntryRequest, callback func(response *ModifyIPv6TranslatorEntryResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *ModifyIPv6TranslatorEntryResponse + var err error + defer close(result) + response, err = client.ModifyIPv6TranslatorEntry(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// ModifyIPv6TranslatorEntryRequest is the request struct for api ModifyIPv6TranslatorEntry +type ModifyIPv6TranslatorEntryRequest struct { + *requests.RpcRequest + BackendIpv4Port requests.Integer `position:"Query" name:"BackendIpv4Port"` + AclId string `position:"Query" name:"AclId"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + Ipv6TranslatorEntryId string `position:"Query" name:"Ipv6TranslatorEntryId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + EntryName string `position:"Query" name:"EntryName"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + AclStatus string `position:"Query" name:"AclStatus"` + EntryBandwidth requests.Integer `position:"Query" name:"EntryBandwidth"` + AclType string `position:"Query" name:"AclType"` + AllocateIpv6Port requests.Integer `position:"Query" name:"AllocateIpv6Port"` + EntryDescription string `position:"Query" name:"EntryDescription"` + BackendIpv4Addr string `position:"Query" name:"BackendIpv4Addr"` + TransProtocol string `position:"Query" name:"TransProtocol"` +} + +// ModifyIPv6TranslatorEntryResponse is the response struct for api ModifyIPv6TranslatorEntry +type ModifyIPv6TranslatorEntryResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateModifyIPv6TranslatorEntryRequest creates a request to invoke ModifyIPv6TranslatorEntry API +func CreateModifyIPv6TranslatorEntryRequest() (request *ModifyIPv6TranslatorEntryRequest) { + request = &ModifyIPv6TranslatorEntryRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "ModifyIPv6TranslatorEntry", "vpc", "openAPI") + return +} + +// CreateModifyIPv6TranslatorEntryResponse creates a response to parse from ModifyIPv6TranslatorEntry response +func CreateModifyIPv6TranslatorEntryResponse() (response *ModifyIPv6TranslatorEntryResponse) { + response = &ModifyIPv6TranslatorEntryResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/modify_ipv6_address_attribute.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/modify_ipv6_address_attribute.go new file mode 100644 index 000000000..c02f783b8 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/modify_ipv6_address_attribute.go @@ -0,0 +1,109 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// ModifyIpv6AddressAttribute invokes the vpc.ModifyIpv6AddressAttribute API synchronously +// api document: https://help.aliyun.com/api/vpc/modifyipv6addressattribute.html +func (client *Client) ModifyIpv6AddressAttribute(request *ModifyIpv6AddressAttributeRequest) (response *ModifyIpv6AddressAttributeResponse, err error) { + response = CreateModifyIpv6AddressAttributeResponse() + err = client.DoAction(request, response) + return +} + +// ModifyIpv6AddressAttributeWithChan invokes the vpc.ModifyIpv6AddressAttribute API asynchronously +// api document: https://help.aliyun.com/api/vpc/modifyipv6addressattribute.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifyIpv6AddressAttributeWithChan(request *ModifyIpv6AddressAttributeRequest) (<-chan *ModifyIpv6AddressAttributeResponse, <-chan error) { + responseChan := make(chan *ModifyIpv6AddressAttributeResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.ModifyIpv6AddressAttribute(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// ModifyIpv6AddressAttributeWithCallback invokes the vpc.ModifyIpv6AddressAttribute API asynchronously +// api document: https://help.aliyun.com/api/vpc/modifyipv6addressattribute.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifyIpv6AddressAttributeWithCallback(request *ModifyIpv6AddressAttributeRequest, callback func(response *ModifyIpv6AddressAttributeResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *ModifyIpv6AddressAttributeResponse + var err error + defer close(result) + response, err = client.ModifyIpv6AddressAttribute(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// ModifyIpv6AddressAttributeRequest is the request struct for api ModifyIpv6AddressAttribute +type ModifyIpv6AddressAttributeRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + Description string `position:"Query" name:"Description"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + Ipv6AddressId string `position:"Query" name:"Ipv6AddressId"` + Name string `position:"Query" name:"Name"` +} + +// ModifyIpv6AddressAttributeResponse is the response struct for api ModifyIpv6AddressAttribute +type ModifyIpv6AddressAttributeResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateModifyIpv6AddressAttributeRequest creates a request to invoke ModifyIpv6AddressAttribute API +func CreateModifyIpv6AddressAttributeRequest() (request *ModifyIpv6AddressAttributeRequest) { + request = &ModifyIpv6AddressAttributeRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "ModifyIpv6AddressAttribute", "vpc", "openAPI") + return +} + +// CreateModifyIpv6AddressAttributeResponse creates a response to parse from ModifyIpv6AddressAttribute response +func CreateModifyIpv6AddressAttributeResponse() (response *ModifyIpv6AddressAttributeResponse) { + response = &ModifyIpv6AddressAttributeResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/modify_ipv6_gateway_attribute.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/modify_ipv6_gateway_attribute.go new file mode 100644 index 000000000..f317652b3 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/modify_ipv6_gateway_attribute.go @@ -0,0 +1,109 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// ModifyIpv6GatewayAttribute invokes the vpc.ModifyIpv6GatewayAttribute API synchronously +// api document: https://help.aliyun.com/api/vpc/modifyipv6gatewayattribute.html +func (client *Client) ModifyIpv6GatewayAttribute(request *ModifyIpv6GatewayAttributeRequest) (response *ModifyIpv6GatewayAttributeResponse, err error) { + response = CreateModifyIpv6GatewayAttributeResponse() + err = client.DoAction(request, response) + return +} + +// ModifyIpv6GatewayAttributeWithChan invokes the vpc.ModifyIpv6GatewayAttribute API asynchronously +// api document: https://help.aliyun.com/api/vpc/modifyipv6gatewayattribute.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifyIpv6GatewayAttributeWithChan(request *ModifyIpv6GatewayAttributeRequest) (<-chan *ModifyIpv6GatewayAttributeResponse, <-chan error) { + responseChan := make(chan *ModifyIpv6GatewayAttributeResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.ModifyIpv6GatewayAttribute(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// ModifyIpv6GatewayAttributeWithCallback invokes the vpc.ModifyIpv6GatewayAttribute API asynchronously +// api document: https://help.aliyun.com/api/vpc/modifyipv6gatewayattribute.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifyIpv6GatewayAttributeWithCallback(request *ModifyIpv6GatewayAttributeRequest, callback func(response *ModifyIpv6GatewayAttributeResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *ModifyIpv6GatewayAttributeResponse + var err error + defer close(result) + response, err = client.ModifyIpv6GatewayAttribute(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// ModifyIpv6GatewayAttributeRequest is the request struct for api ModifyIpv6GatewayAttribute +type ModifyIpv6GatewayAttributeRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + Description string `position:"Query" name:"Description"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + Ipv6GatewayId string `position:"Query" name:"Ipv6GatewayId"` + Name string `position:"Query" name:"Name"` +} + +// ModifyIpv6GatewayAttributeResponse is the response struct for api ModifyIpv6GatewayAttribute +type ModifyIpv6GatewayAttributeResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateModifyIpv6GatewayAttributeRequest creates a request to invoke ModifyIpv6GatewayAttribute API +func CreateModifyIpv6GatewayAttributeRequest() (request *ModifyIpv6GatewayAttributeRequest) { + request = &ModifyIpv6GatewayAttributeRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "ModifyIpv6GatewayAttribute", "vpc", "openAPI") + return +} + +// CreateModifyIpv6GatewayAttributeResponse creates a response to parse from ModifyIpv6GatewayAttribute response +func CreateModifyIpv6GatewayAttributeResponse() (response *ModifyIpv6GatewayAttributeResponse) { + response = &ModifyIpv6GatewayAttributeResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/modify_ipv6_gateway_spec.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/modify_ipv6_gateway_spec.go new file mode 100644 index 000000000..d4bf84447 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/modify_ipv6_gateway_spec.go @@ -0,0 +1,109 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// ModifyIpv6GatewaySpec invokes the vpc.ModifyIpv6GatewaySpec API synchronously +// api document: https://help.aliyun.com/api/vpc/modifyipv6gatewayspec.html +func (client *Client) ModifyIpv6GatewaySpec(request *ModifyIpv6GatewaySpecRequest) (response *ModifyIpv6GatewaySpecResponse, err error) { + response = CreateModifyIpv6GatewaySpecResponse() + err = client.DoAction(request, response) + return +} + +// ModifyIpv6GatewaySpecWithChan invokes the vpc.ModifyIpv6GatewaySpec API asynchronously +// api document: https://help.aliyun.com/api/vpc/modifyipv6gatewayspec.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifyIpv6GatewaySpecWithChan(request *ModifyIpv6GatewaySpecRequest) (<-chan *ModifyIpv6GatewaySpecResponse, <-chan error) { + responseChan := make(chan *ModifyIpv6GatewaySpecResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.ModifyIpv6GatewaySpec(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// ModifyIpv6GatewaySpecWithCallback invokes the vpc.ModifyIpv6GatewaySpec API asynchronously +// api document: https://help.aliyun.com/api/vpc/modifyipv6gatewayspec.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifyIpv6GatewaySpecWithCallback(request *ModifyIpv6GatewaySpecRequest, callback func(response *ModifyIpv6GatewaySpecResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *ModifyIpv6GatewaySpecResponse + var err error + defer close(result) + response, err = client.ModifyIpv6GatewaySpec(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// ModifyIpv6GatewaySpecRequest is the request struct for api ModifyIpv6GatewaySpec +type ModifyIpv6GatewaySpecRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ClientToken string `position:"Query" name:"ClientToken"` + Spec string `position:"Query" name:"Spec"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + Ipv6GatewayId string `position:"Query" name:"Ipv6GatewayId"` +} + +// ModifyIpv6GatewaySpecResponse is the response struct for api ModifyIpv6GatewaySpec +type ModifyIpv6GatewaySpecResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateModifyIpv6GatewaySpecRequest creates a request to invoke ModifyIpv6GatewaySpec API +func CreateModifyIpv6GatewaySpecRequest() (request *ModifyIpv6GatewaySpecRequest) { + request = &ModifyIpv6GatewaySpecRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "ModifyIpv6GatewaySpec", "vpc", "openAPI") + return +} + +// CreateModifyIpv6GatewaySpecResponse creates a response to parse from ModifyIpv6GatewaySpec response +func CreateModifyIpv6GatewaySpecResponse() (response *ModifyIpv6GatewaySpecResponse) { + response = &ModifyIpv6GatewaySpecResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/modify_ipv6_internet_bandwidth.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/modify_ipv6_internet_bandwidth.go new file mode 100644 index 000000000..39583a2e7 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/modify_ipv6_internet_bandwidth.go @@ -0,0 +1,110 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// ModifyIpv6InternetBandwidth invokes the vpc.ModifyIpv6InternetBandwidth API synchronously +// api document: https://help.aliyun.com/api/vpc/modifyipv6internetbandwidth.html +func (client *Client) ModifyIpv6InternetBandwidth(request *ModifyIpv6InternetBandwidthRequest) (response *ModifyIpv6InternetBandwidthResponse, err error) { + response = CreateModifyIpv6InternetBandwidthResponse() + err = client.DoAction(request, response) + return +} + +// ModifyIpv6InternetBandwidthWithChan invokes the vpc.ModifyIpv6InternetBandwidth API asynchronously +// api document: https://help.aliyun.com/api/vpc/modifyipv6internetbandwidth.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifyIpv6InternetBandwidthWithChan(request *ModifyIpv6InternetBandwidthRequest) (<-chan *ModifyIpv6InternetBandwidthResponse, <-chan error) { + responseChan := make(chan *ModifyIpv6InternetBandwidthResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.ModifyIpv6InternetBandwidth(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// ModifyIpv6InternetBandwidthWithCallback invokes the vpc.ModifyIpv6InternetBandwidth API asynchronously +// api document: https://help.aliyun.com/api/vpc/modifyipv6internetbandwidth.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifyIpv6InternetBandwidthWithCallback(request *ModifyIpv6InternetBandwidthRequest, callback func(response *ModifyIpv6InternetBandwidthResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *ModifyIpv6InternetBandwidthResponse + var err error + defer close(result) + response, err = client.ModifyIpv6InternetBandwidth(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// ModifyIpv6InternetBandwidthRequest is the request struct for api ModifyIpv6InternetBandwidth +type ModifyIpv6InternetBandwidthRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ClientToken string `position:"Query" name:"ClientToken"` + Ipv6InternetBandwidthId string `position:"Query" name:"Ipv6InternetBandwidthId"` + Bandwidth requests.Integer `position:"Query" name:"Bandwidth"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + Ipv6AddressId string `position:"Query" name:"Ipv6AddressId"` +} + +// ModifyIpv6InternetBandwidthResponse is the response struct for api ModifyIpv6InternetBandwidth +type ModifyIpv6InternetBandwidthResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateModifyIpv6InternetBandwidthRequest creates a request to invoke ModifyIpv6InternetBandwidth API +func CreateModifyIpv6InternetBandwidthRequest() (request *ModifyIpv6InternetBandwidthRequest) { + request = &ModifyIpv6InternetBandwidthRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "ModifyIpv6InternetBandwidth", "vpc", "openAPI") + return +} + +// CreateModifyIpv6InternetBandwidthResponse creates a response to parse from ModifyIpv6InternetBandwidth response +func CreateModifyIpv6InternetBandwidthResponse() (response *ModifyIpv6InternetBandwidthResponse) { + response = &ModifyIpv6InternetBandwidthResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/modify_nat_gateway_attribute.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/modify_nat_gateway_attribute.go new file mode 100644 index 000000000..5f776108e --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/modify_nat_gateway_attribute.go @@ -0,0 +1,109 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// ModifyNatGatewayAttribute invokes the vpc.ModifyNatGatewayAttribute API synchronously +// api document: https://help.aliyun.com/api/vpc/modifynatgatewayattribute.html +func (client *Client) ModifyNatGatewayAttribute(request *ModifyNatGatewayAttributeRequest) (response *ModifyNatGatewayAttributeResponse, err error) { + response = CreateModifyNatGatewayAttributeResponse() + err = client.DoAction(request, response) + return +} + +// ModifyNatGatewayAttributeWithChan invokes the vpc.ModifyNatGatewayAttribute API asynchronously +// api document: https://help.aliyun.com/api/vpc/modifynatgatewayattribute.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifyNatGatewayAttributeWithChan(request *ModifyNatGatewayAttributeRequest) (<-chan *ModifyNatGatewayAttributeResponse, <-chan error) { + responseChan := make(chan *ModifyNatGatewayAttributeResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.ModifyNatGatewayAttribute(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// ModifyNatGatewayAttributeWithCallback invokes the vpc.ModifyNatGatewayAttribute API asynchronously +// api document: https://help.aliyun.com/api/vpc/modifynatgatewayattribute.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifyNatGatewayAttributeWithCallback(request *ModifyNatGatewayAttributeRequest, callback func(response *ModifyNatGatewayAttributeResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *ModifyNatGatewayAttributeResponse + var err error + defer close(result) + response, err = client.ModifyNatGatewayAttribute(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// ModifyNatGatewayAttributeRequest is the request struct for api ModifyNatGatewayAttribute +type ModifyNatGatewayAttributeRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + Name string `position:"Query" name:"Name"` + Description string `position:"Query" name:"Description"` + NatGatewayId string `position:"Query" name:"NatGatewayId"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// ModifyNatGatewayAttributeResponse is the response struct for api ModifyNatGatewayAttribute +type ModifyNatGatewayAttributeResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateModifyNatGatewayAttributeRequest creates a request to invoke ModifyNatGatewayAttribute API +func CreateModifyNatGatewayAttributeRequest() (request *ModifyNatGatewayAttributeRequest) { + request = &ModifyNatGatewayAttributeRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "ModifyNatGatewayAttribute", "vpc", "openAPI") + return +} + +// CreateModifyNatGatewayAttributeResponse creates a response to parse from ModifyNatGatewayAttribute response +func CreateModifyNatGatewayAttributeResponse() (response *ModifyNatGatewayAttributeResponse) { + response = &ModifyNatGatewayAttributeResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/modify_nat_gateway_spec.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/modify_nat_gateway_spec.go new file mode 100644 index 000000000..41f7dc33a --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/modify_nat_gateway_spec.go @@ -0,0 +1,110 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// ModifyNatGatewaySpec invokes the vpc.ModifyNatGatewaySpec API synchronously +// api document: https://help.aliyun.com/api/vpc/modifynatgatewayspec.html +func (client *Client) ModifyNatGatewaySpec(request *ModifyNatGatewaySpecRequest) (response *ModifyNatGatewaySpecResponse, err error) { + response = CreateModifyNatGatewaySpecResponse() + err = client.DoAction(request, response) + return +} + +// ModifyNatGatewaySpecWithChan invokes the vpc.ModifyNatGatewaySpec API asynchronously +// api document: https://help.aliyun.com/api/vpc/modifynatgatewayspec.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifyNatGatewaySpecWithChan(request *ModifyNatGatewaySpecRequest) (<-chan *ModifyNatGatewaySpecResponse, <-chan error) { + responseChan := make(chan *ModifyNatGatewaySpecResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.ModifyNatGatewaySpec(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// ModifyNatGatewaySpecWithCallback invokes the vpc.ModifyNatGatewaySpec API asynchronously +// api document: https://help.aliyun.com/api/vpc/modifynatgatewayspec.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifyNatGatewaySpecWithCallback(request *ModifyNatGatewaySpecRequest, callback func(response *ModifyNatGatewaySpecResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *ModifyNatGatewaySpecResponse + var err error + defer close(result) + response, err = client.ModifyNatGatewaySpec(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// ModifyNatGatewaySpecRequest is the request struct for api ModifyNatGatewaySpec +type ModifyNatGatewaySpecRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + AutoPay requests.Boolean `position:"Query" name:"AutoPay"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + ClientToken string `position:"Query" name:"ClientToken"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + NatGatewayId string `position:"Query" name:"NatGatewayId"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + Spec string `position:"Query" name:"Spec"` +} + +// ModifyNatGatewaySpecResponse is the response struct for api ModifyNatGatewaySpec +type ModifyNatGatewaySpecResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateModifyNatGatewaySpecRequest creates a request to invoke ModifyNatGatewaySpec API +func CreateModifyNatGatewaySpecRequest() (request *ModifyNatGatewaySpecRequest) { + request = &ModifyNatGatewaySpecRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "ModifyNatGatewaySpec", "vpc", "openAPI") + return +} + +// CreateModifyNatGatewaySpecResponse creates a response to parse from ModifyNatGatewaySpec response +func CreateModifyNatGatewaySpecResponse() (response *ModifyNatGatewaySpecResponse) { + response = &ModifyNatGatewaySpecResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/modify_nqa.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/modify_nqa.go new file mode 100644 index 000000000..ddba3bad7 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/modify_nqa.go @@ -0,0 +1,109 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// ModifyNqa invokes the vpc.ModifyNqa API synchronously +// api document: https://help.aliyun.com/api/vpc/modifynqa.html +func (client *Client) ModifyNqa(request *ModifyNqaRequest) (response *ModifyNqaResponse, err error) { + response = CreateModifyNqaResponse() + err = client.DoAction(request, response) + return +} + +// ModifyNqaWithChan invokes the vpc.ModifyNqa API asynchronously +// api document: https://help.aliyun.com/api/vpc/modifynqa.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifyNqaWithChan(request *ModifyNqaRequest) (<-chan *ModifyNqaResponse, <-chan error) { + responseChan := make(chan *ModifyNqaResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.ModifyNqa(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// ModifyNqaWithCallback invokes the vpc.ModifyNqa API asynchronously +// api document: https://help.aliyun.com/api/vpc/modifynqa.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifyNqaWithCallback(request *ModifyNqaRequest, callback func(response *ModifyNqaResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *ModifyNqaResponse + var err error + defer close(result) + response, err = client.ModifyNqa(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// ModifyNqaRequest is the request struct for api ModifyNqa +type ModifyNqaRequest struct { + *requests.RpcRequest + DestinationIp string `position:"Query" name:"DestinationIp"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + ClientToken string `position:"Query" name:"ClientToken"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + NqaId string `position:"Query" name:"NqaId"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// ModifyNqaResponse is the response struct for api ModifyNqa +type ModifyNqaResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateModifyNqaRequest creates a request to invoke ModifyNqa API +func CreateModifyNqaRequest() (request *ModifyNqaRequest) { + request = &ModifyNqaRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "ModifyNqa", "vpc", "openAPI") + return +} + +// CreateModifyNqaResponse creates a response to parse from ModifyNqa response +func CreateModifyNqaResponse() (response *ModifyNqaResponse) { + response = &ModifyNqaResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/modify_physical_connection_attribute.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/modify_physical_connection_attribute.go new file mode 100644 index 000000000..b9657c5c8 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/modify_physical_connection_attribute.go @@ -0,0 +1,116 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// ModifyPhysicalConnectionAttribute invokes the vpc.ModifyPhysicalConnectionAttribute API synchronously +// api document: https://help.aliyun.com/api/vpc/modifyphysicalconnectionattribute.html +func (client *Client) ModifyPhysicalConnectionAttribute(request *ModifyPhysicalConnectionAttributeRequest) (response *ModifyPhysicalConnectionAttributeResponse, err error) { + response = CreateModifyPhysicalConnectionAttributeResponse() + err = client.DoAction(request, response) + return +} + +// ModifyPhysicalConnectionAttributeWithChan invokes the vpc.ModifyPhysicalConnectionAttribute API asynchronously +// api document: https://help.aliyun.com/api/vpc/modifyphysicalconnectionattribute.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifyPhysicalConnectionAttributeWithChan(request *ModifyPhysicalConnectionAttributeRequest) (<-chan *ModifyPhysicalConnectionAttributeResponse, <-chan error) { + responseChan := make(chan *ModifyPhysicalConnectionAttributeResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.ModifyPhysicalConnectionAttribute(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// ModifyPhysicalConnectionAttributeWithCallback invokes the vpc.ModifyPhysicalConnectionAttribute API asynchronously +// api document: https://help.aliyun.com/api/vpc/modifyphysicalconnectionattribute.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifyPhysicalConnectionAttributeWithCallback(request *ModifyPhysicalConnectionAttributeRequest, callback func(response *ModifyPhysicalConnectionAttributeResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *ModifyPhysicalConnectionAttributeResponse + var err error + defer close(result) + response, err = client.ModifyPhysicalConnectionAttribute(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// ModifyPhysicalConnectionAttributeRequest is the request struct for api ModifyPhysicalConnectionAttribute +type ModifyPhysicalConnectionAttributeRequest struct { + *requests.RpcRequest + RedundantPhysicalConnectionId string `position:"Query" name:"RedundantPhysicalConnectionId"` + PeerLocation string `position:"Query" name:"PeerLocation"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + PortType string `position:"Query" name:"PortType"` + CircuitCode string `position:"Query" name:"CircuitCode"` + Bandwidth requests.Integer `position:"Query" name:"bandwidth"` + ClientToken string `position:"Query" name:"ClientToken"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + Description string `position:"Query" name:"Description"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + LineOperator string `position:"Query" name:"LineOperator"` + PhysicalConnectionId string `position:"Query" name:"PhysicalConnectionId"` + Name string `position:"Query" name:"Name"` +} + +// ModifyPhysicalConnectionAttributeResponse is the response struct for api ModifyPhysicalConnectionAttribute +type ModifyPhysicalConnectionAttributeResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateModifyPhysicalConnectionAttributeRequest creates a request to invoke ModifyPhysicalConnectionAttribute API +func CreateModifyPhysicalConnectionAttributeRequest() (request *ModifyPhysicalConnectionAttributeRequest) { + request = &ModifyPhysicalConnectionAttributeRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "ModifyPhysicalConnectionAttribute", "vpc", "openAPI") + return +} + +// CreateModifyPhysicalConnectionAttributeResponse creates a response to parse from ModifyPhysicalConnectionAttribute response +func CreateModifyPhysicalConnectionAttributeResponse() (response *ModifyPhysicalConnectionAttributeResponse) { + response = &ModifyPhysicalConnectionAttributeResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/modify_route_entry.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/modify_route_entry.go new file mode 100644 index 000000000..309a70793 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/modify_route_entry.go @@ -0,0 +1,107 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// ModifyRouteEntry invokes the vpc.ModifyRouteEntry API synchronously +// api document: https://help.aliyun.com/api/vpc/modifyrouteentry.html +func (client *Client) ModifyRouteEntry(request *ModifyRouteEntryRequest) (response *ModifyRouteEntryResponse, err error) { + response = CreateModifyRouteEntryResponse() + err = client.DoAction(request, response) + return +} + +// ModifyRouteEntryWithChan invokes the vpc.ModifyRouteEntry API asynchronously +// api document: https://help.aliyun.com/api/vpc/modifyrouteentry.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifyRouteEntryWithChan(request *ModifyRouteEntryRequest) (<-chan *ModifyRouteEntryResponse, <-chan error) { + responseChan := make(chan *ModifyRouteEntryResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.ModifyRouteEntry(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// ModifyRouteEntryWithCallback invokes the vpc.ModifyRouteEntry API asynchronously +// api document: https://help.aliyun.com/api/vpc/modifyrouteentry.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifyRouteEntryWithCallback(request *ModifyRouteEntryRequest, callback func(response *ModifyRouteEntryResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *ModifyRouteEntryResponse + var err error + defer close(result) + response, err = client.ModifyRouteEntry(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// ModifyRouteEntryRequest is the request struct for api ModifyRouteEntry +type ModifyRouteEntryRequest struct { + *requests.RpcRequest + RouteEntryName string `position:"Query" name:"RouteEntryName"` + RouteEntryId string `position:"Query" name:"RouteEntryId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// ModifyRouteEntryResponse is the response struct for api ModifyRouteEntry +type ModifyRouteEntryResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateModifyRouteEntryRequest creates a request to invoke ModifyRouteEntry API +func CreateModifyRouteEntryRequest() (request *ModifyRouteEntryRequest) { + request = &ModifyRouteEntryRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "ModifyRouteEntry", "vpc", "openAPI") + return +} + +// CreateModifyRouteEntryResponse creates a response to parse from ModifyRouteEntry response +func CreateModifyRouteEntryResponse() (response *ModifyRouteEntryResponse) { + response = &ModifyRouteEntryResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/modify_route_table_attributes.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/modify_route_table_attributes.go new file mode 100644 index 000000000..063d9f583 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/modify_route_table_attributes.go @@ -0,0 +1,116 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// ModifyRouteTableAttributes invokes the vpc.ModifyRouteTableAttributes API synchronously +// api document: https://help.aliyun.com/api/vpc/modifyroutetableattributes.html +func (client *Client) ModifyRouteTableAttributes(request *ModifyRouteTableAttributesRequest) (response *ModifyRouteTableAttributesResponse, err error) { + response = CreateModifyRouteTableAttributesResponse() + err = client.DoAction(request, response) + return +} + +// ModifyRouteTableAttributesWithChan invokes the vpc.ModifyRouteTableAttributes API asynchronously +// api document: https://help.aliyun.com/api/vpc/modifyroutetableattributes.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifyRouteTableAttributesWithChan(request *ModifyRouteTableAttributesRequest) (<-chan *ModifyRouteTableAttributesResponse, <-chan error) { + responseChan := make(chan *ModifyRouteTableAttributesResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.ModifyRouteTableAttributes(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// ModifyRouteTableAttributesWithCallback invokes the vpc.ModifyRouteTableAttributes API asynchronously +// api document: https://help.aliyun.com/api/vpc/modifyroutetableattributes.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifyRouteTableAttributesWithCallback(request *ModifyRouteTableAttributesRequest, callback func(response *ModifyRouteTableAttributesResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *ModifyRouteTableAttributesResponse + var err error + defer close(result) + response, err = client.ModifyRouteTableAttributes(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// ModifyRouteTableAttributesRequest is the request struct for api ModifyRouteTableAttributes +type ModifyRouteTableAttributesRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + Bandwidth string `position:"Query" name:"Bandwidth"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + Description string `position:"Query" name:"Description"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + KbpsBandwidth string `position:"Query" name:"KbpsBandwidth"` + RouteTableName string `position:"Query" name:"RouteTableName"` + ResourceUid requests.Integer `position:"Query" name:"ResourceUid"` + ResourceBid string `position:"Query" name:"ResourceBid"` + RouteTableId string `position:"Query" name:"RouteTableId"` +} + +// ModifyRouteTableAttributesResponse is the response struct for api ModifyRouteTableAttributes +type ModifyRouteTableAttributesResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + Code string `json:"Code" xml:"Code"` + Message string `json:"Message" xml:"Message"` + Success bool `json:"Success" xml:"Success"` +} + +// CreateModifyRouteTableAttributesRequest creates a request to invoke ModifyRouteTableAttributes API +func CreateModifyRouteTableAttributesRequest() (request *ModifyRouteTableAttributesRequest) { + request = &ModifyRouteTableAttributesRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "ModifyRouteTableAttributes", "vpc", "openAPI") + return +} + +// CreateModifyRouteTableAttributesResponse creates a response to parse from ModifyRouteTableAttributes response +func CreateModifyRouteTableAttributesResponse() (response *ModifyRouteTableAttributesResponse) { + response = &ModifyRouteTableAttributesResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/modify_router_interface_attribute.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/modify_router_interface_attribute.go new file mode 100644 index 000000000..9ee26d0aa --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/modify_router_interface_attribute.go @@ -0,0 +1,115 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// ModifyRouterInterfaceAttribute invokes the vpc.ModifyRouterInterfaceAttribute API synchronously +// api document: https://help.aliyun.com/api/vpc/modifyrouterinterfaceattribute.html +func (client *Client) ModifyRouterInterfaceAttribute(request *ModifyRouterInterfaceAttributeRequest) (response *ModifyRouterInterfaceAttributeResponse, err error) { + response = CreateModifyRouterInterfaceAttributeResponse() + err = client.DoAction(request, response) + return +} + +// ModifyRouterInterfaceAttributeWithChan invokes the vpc.ModifyRouterInterfaceAttribute API asynchronously +// api document: https://help.aliyun.com/api/vpc/modifyrouterinterfaceattribute.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifyRouterInterfaceAttributeWithChan(request *ModifyRouterInterfaceAttributeRequest) (<-chan *ModifyRouterInterfaceAttributeResponse, <-chan error) { + responseChan := make(chan *ModifyRouterInterfaceAttributeResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.ModifyRouterInterfaceAttribute(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// ModifyRouterInterfaceAttributeWithCallback invokes the vpc.ModifyRouterInterfaceAttribute API asynchronously +// api document: https://help.aliyun.com/api/vpc/modifyrouterinterfaceattribute.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifyRouterInterfaceAttributeWithCallback(request *ModifyRouterInterfaceAttributeRequest, callback func(response *ModifyRouterInterfaceAttributeResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *ModifyRouterInterfaceAttributeResponse + var err error + defer close(result) + response, err = client.ModifyRouterInterfaceAttribute(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// ModifyRouterInterfaceAttributeRequest is the request struct for api ModifyRouterInterfaceAttribute +type ModifyRouterInterfaceAttributeRequest struct { + *requests.RpcRequest + OppositeRouterId string `position:"Query" name:"OppositeRouterId"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + DeleteHealthCheckIp requests.Boolean `position:"Query" name:"DeleteHealthCheckIp"` + Description string `position:"Query" name:"Description"` + HealthCheckTargetIp string `position:"Query" name:"HealthCheckTargetIp"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + RouterInterfaceId string `position:"Query" name:"RouterInterfaceId"` + OppositeInterfaceOwnerId requests.Integer `position:"Query" name:"OppositeInterfaceOwnerId"` + HealthCheckSourceIp string `position:"Query" name:"HealthCheckSourceIp"` + Name string `position:"Query" name:"Name"` + OppositeRouterType string `position:"Query" name:"OppositeRouterType"` + OppositeInterfaceId string `position:"Query" name:"OppositeInterfaceId"` +} + +// ModifyRouterInterfaceAttributeResponse is the response struct for api ModifyRouterInterfaceAttribute +type ModifyRouterInterfaceAttributeResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateModifyRouterInterfaceAttributeRequest creates a request to invoke ModifyRouterInterfaceAttribute API +func CreateModifyRouterInterfaceAttributeRequest() (request *ModifyRouterInterfaceAttributeRequest) { + request = &ModifyRouterInterfaceAttributeRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "ModifyRouterInterfaceAttribute", "vpc", "openAPI") + return +} + +// CreateModifyRouterInterfaceAttributeResponse creates a response to parse from ModifyRouterInterfaceAttribute response +func CreateModifyRouterInterfaceAttributeResponse() (response *ModifyRouterInterfaceAttributeResponse) { + response = &ModifyRouterInterfaceAttributeResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/modify_router_interface_spec.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/modify_router_interface_spec.go new file mode 100644 index 000000000..10796108d --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/modify_router_interface_spec.go @@ -0,0 +1,110 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// ModifyRouterInterfaceSpec invokes the vpc.ModifyRouterInterfaceSpec API synchronously +// api document: https://help.aliyun.com/api/vpc/modifyrouterinterfacespec.html +func (client *Client) ModifyRouterInterfaceSpec(request *ModifyRouterInterfaceSpecRequest) (response *ModifyRouterInterfaceSpecResponse, err error) { + response = CreateModifyRouterInterfaceSpecResponse() + err = client.DoAction(request, response) + return +} + +// ModifyRouterInterfaceSpecWithChan invokes the vpc.ModifyRouterInterfaceSpec API asynchronously +// api document: https://help.aliyun.com/api/vpc/modifyrouterinterfacespec.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifyRouterInterfaceSpecWithChan(request *ModifyRouterInterfaceSpecRequest) (<-chan *ModifyRouterInterfaceSpecResponse, <-chan error) { + responseChan := make(chan *ModifyRouterInterfaceSpecResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.ModifyRouterInterfaceSpec(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// ModifyRouterInterfaceSpecWithCallback invokes the vpc.ModifyRouterInterfaceSpec API asynchronously +// api document: https://help.aliyun.com/api/vpc/modifyrouterinterfacespec.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifyRouterInterfaceSpecWithCallback(request *ModifyRouterInterfaceSpecRequest, callback func(response *ModifyRouterInterfaceSpecResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *ModifyRouterInterfaceSpecResponse + var err error + defer close(result) + response, err = client.ModifyRouterInterfaceSpec(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// ModifyRouterInterfaceSpecRequest is the request struct for api ModifyRouterInterfaceSpec +type ModifyRouterInterfaceSpecRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + ClientToken string `position:"Query" name:"ClientToken"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + RouterInterfaceId string `position:"Query" name:"RouterInterfaceId"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + Spec string `position:"Query" name:"Spec"` +} + +// ModifyRouterInterfaceSpecResponse is the response struct for api ModifyRouterInterfaceSpec +type ModifyRouterInterfaceSpecResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + Spec string `json:"Spec" xml:"Spec"` +} + +// CreateModifyRouterInterfaceSpecRequest creates a request to invoke ModifyRouterInterfaceSpec API +func CreateModifyRouterInterfaceSpecRequest() (request *ModifyRouterInterfaceSpecRequest) { + request = &ModifyRouterInterfaceSpecRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "ModifyRouterInterfaceSpec", "vpc", "openAPI") + return +} + +// CreateModifyRouterInterfaceSpecResponse creates a response to parse from ModifyRouterInterfaceSpec response +func CreateModifyRouterInterfaceSpecResponse() (response *ModifyRouterInterfaceSpecResponse) { + response = &ModifyRouterInterfaceSpecResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/modify_snat_entry.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/modify_snat_entry.go new file mode 100644 index 000000000..9a5591b29 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/modify_snat_entry.go @@ -0,0 +1,110 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// ModifySnatEntry invokes the vpc.ModifySnatEntry API synchronously +// api document: https://help.aliyun.com/api/vpc/modifysnatentry.html +func (client *Client) ModifySnatEntry(request *ModifySnatEntryRequest) (response *ModifySnatEntryResponse, err error) { + response = CreateModifySnatEntryResponse() + err = client.DoAction(request, response) + return +} + +// ModifySnatEntryWithChan invokes the vpc.ModifySnatEntry API asynchronously +// api document: https://help.aliyun.com/api/vpc/modifysnatentry.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifySnatEntryWithChan(request *ModifySnatEntryRequest) (<-chan *ModifySnatEntryResponse, <-chan error) { + responseChan := make(chan *ModifySnatEntryResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.ModifySnatEntry(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// ModifySnatEntryWithCallback invokes the vpc.ModifySnatEntry API asynchronously +// api document: https://help.aliyun.com/api/vpc/modifysnatentry.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifySnatEntryWithCallback(request *ModifySnatEntryRequest, callback func(response *ModifySnatEntryResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *ModifySnatEntryResponse + var err error + defer close(result) + response, err = client.ModifySnatEntry(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// ModifySnatEntryRequest is the request struct for api ModifySnatEntry +type ModifySnatEntryRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + SnatEntryName string `position:"Query" name:"SnatEntryName"` + SnatTableId string `position:"Query" name:"SnatTableId"` + SnatEntryId string `position:"Query" name:"SnatEntryId"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + SnatIp string `position:"Query" name:"SnatIp"` +} + +// ModifySnatEntryResponse is the response struct for api ModifySnatEntry +type ModifySnatEntryResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateModifySnatEntryRequest creates a request to invoke ModifySnatEntry API +func CreateModifySnatEntryRequest() (request *ModifySnatEntryRequest) { + request = &ModifySnatEntryRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "ModifySnatEntry", "vpc", "openAPI") + return +} + +// CreateModifySnatEntryResponse creates a response to parse from ModifySnatEntry response +func CreateModifySnatEntryResponse() (response *ModifySnatEntryResponse) { + response = &ModifySnatEntryResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/modify_ssl_vpn_client_cert.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/modify_ssl_vpn_client_cert.go new file mode 100644 index 000000000..49dc7d174 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/modify_ssl_vpn_client_cert.go @@ -0,0 +1,111 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// ModifySslVpnClientCert invokes the vpc.ModifySslVpnClientCert API synchronously +// api document: https://help.aliyun.com/api/vpc/modifysslvpnclientcert.html +func (client *Client) ModifySslVpnClientCert(request *ModifySslVpnClientCertRequest) (response *ModifySslVpnClientCertResponse, err error) { + response = CreateModifySslVpnClientCertResponse() + err = client.DoAction(request, response) + return +} + +// ModifySslVpnClientCertWithChan invokes the vpc.ModifySslVpnClientCert API asynchronously +// api document: https://help.aliyun.com/api/vpc/modifysslvpnclientcert.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifySslVpnClientCertWithChan(request *ModifySslVpnClientCertRequest) (<-chan *ModifySslVpnClientCertResponse, <-chan error) { + responseChan := make(chan *ModifySslVpnClientCertResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.ModifySslVpnClientCert(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// ModifySslVpnClientCertWithCallback invokes the vpc.ModifySslVpnClientCert API asynchronously +// api document: https://help.aliyun.com/api/vpc/modifysslvpnclientcert.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifySslVpnClientCertWithCallback(request *ModifySslVpnClientCertRequest, callback func(response *ModifySslVpnClientCertResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *ModifySslVpnClientCertResponse + var err error + defer close(result) + response, err = client.ModifySslVpnClientCert(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// ModifySslVpnClientCertRequest is the request struct for api ModifySslVpnClientCert +type ModifySslVpnClientCertRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + ClientToken string `position:"Query" name:"ClientToken"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + Name string `position:"Query" name:"Name"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + SslVpnClientCertId string `position:"Query" name:"SslVpnClientCertId"` +} + +// ModifySslVpnClientCertResponse is the response struct for api ModifySslVpnClientCert +type ModifySslVpnClientCertResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + Name string `json:"Name" xml:"Name"` + SslVpnClientCertId string `json:"SslVpnClientCertId" xml:"SslVpnClientCertId"` +} + +// CreateModifySslVpnClientCertRequest creates a request to invoke ModifySslVpnClientCert API +func CreateModifySslVpnClientCertRequest() (request *ModifySslVpnClientCertRequest) { + request = &ModifySslVpnClientCertRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "ModifySslVpnClientCert", "vpc", "openAPI") + return +} + +// CreateModifySslVpnClientCertResponse creates a response to parse from ModifySslVpnClientCert response +func CreateModifySslVpnClientCertResponse() (response *ModifySslVpnClientCertResponse) { + response = &ModifySslVpnClientCertResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/modify_ssl_vpn_server.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/modify_ssl_vpn_server.go new file mode 100644 index 000000000..2684516cb --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/modify_ssl_vpn_server.go @@ -0,0 +1,129 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// ModifySslVpnServer invokes the vpc.ModifySslVpnServer API synchronously +// api document: https://help.aliyun.com/api/vpc/modifysslvpnserver.html +func (client *Client) ModifySslVpnServer(request *ModifySslVpnServerRequest) (response *ModifySslVpnServerResponse, err error) { + response = CreateModifySslVpnServerResponse() + err = client.DoAction(request, response) + return +} + +// ModifySslVpnServerWithChan invokes the vpc.ModifySslVpnServer API asynchronously +// api document: https://help.aliyun.com/api/vpc/modifysslvpnserver.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifySslVpnServerWithChan(request *ModifySslVpnServerRequest) (<-chan *ModifySslVpnServerResponse, <-chan error) { + responseChan := make(chan *ModifySslVpnServerResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.ModifySslVpnServer(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// ModifySslVpnServerWithCallback invokes the vpc.ModifySslVpnServer API asynchronously +// api document: https://help.aliyun.com/api/vpc/modifysslvpnserver.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifySslVpnServerWithCallback(request *ModifySslVpnServerRequest, callback func(response *ModifySslVpnServerResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *ModifySslVpnServerResponse + var err error + defer close(result) + response, err = client.ModifySslVpnServer(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// ModifySslVpnServerRequest is the request struct for api ModifySslVpnServer +type ModifySslVpnServerRequest struct { + *requests.RpcRequest + Cipher string `position:"Query" name:"Cipher"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ClientIpPool string `position:"Query" name:"ClientIpPool"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + ClientToken string `position:"Query" name:"ClientToken"` + Compress requests.Boolean `position:"Query" name:"Compress"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + SslVpnServerId string `position:"Query" name:"SslVpnServerId"` + LocalSubnet string `position:"Query" name:"LocalSubnet"` + Port requests.Integer `position:"Query" name:"Port"` + Proto string `position:"Query" name:"Proto"` + Name string `position:"Query" name:"Name"` +} + +// ModifySslVpnServerResponse is the response struct for api ModifySslVpnServer +type ModifySslVpnServerResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + RegionId string `json:"RegionId" xml:"RegionId"` + SslVpnServerId string `json:"SslVpnServerId" xml:"SslVpnServerId"` + VpnGatewayId string `json:"VpnGatewayId" xml:"VpnGatewayId"` + Name string `json:"Name" xml:"Name"` + LocalSubnet string `json:"LocalSubnet" xml:"LocalSubnet"` + ClientIpPool string `json:"ClientIpPool" xml:"ClientIpPool"` + CreateTime int `json:"CreateTime" xml:"CreateTime"` + Cipher string `json:"Cipher" xml:"Cipher"` + Proto string `json:"Proto" xml:"Proto"` + Port int `json:"Port" xml:"Port"` + Compress bool `json:"Compress" xml:"Compress"` + Connections int `json:"Connections" xml:"Connections"` + MaxConnections int `json:"MaxConnections" xml:"MaxConnections"` + InternetIp string `json:"InternetIp" xml:"InternetIp"` +} + +// CreateModifySslVpnServerRequest creates a request to invoke ModifySslVpnServer API +func CreateModifySslVpnServerRequest() (request *ModifySslVpnServerRequest) { + request = &ModifySslVpnServerRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "ModifySslVpnServer", "vpc", "openAPI") + return +} + +// CreateModifySslVpnServerResponse creates a response to parse from ModifySslVpnServer response +func CreateModifySslVpnServerResponse() (response *ModifySslVpnServerResponse) { + response = &ModifySslVpnServerResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/modify_v_router_attribute.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/modify_v_router_attribute.go new file mode 100644 index 000000000..52ab50b3e --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/modify_v_router_attribute.go @@ -0,0 +1,109 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// ModifyVRouterAttribute invokes the vpc.ModifyVRouterAttribute API synchronously +// api document: https://help.aliyun.com/api/vpc/modifyvrouterattribute.html +func (client *Client) ModifyVRouterAttribute(request *ModifyVRouterAttributeRequest) (response *ModifyVRouterAttributeResponse, err error) { + response = CreateModifyVRouterAttributeResponse() + err = client.DoAction(request, response) + return +} + +// ModifyVRouterAttributeWithChan invokes the vpc.ModifyVRouterAttribute API asynchronously +// api document: https://help.aliyun.com/api/vpc/modifyvrouterattribute.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifyVRouterAttributeWithChan(request *ModifyVRouterAttributeRequest) (<-chan *ModifyVRouterAttributeResponse, <-chan error) { + responseChan := make(chan *ModifyVRouterAttributeResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.ModifyVRouterAttribute(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// ModifyVRouterAttributeWithCallback invokes the vpc.ModifyVRouterAttribute API asynchronously +// api document: https://help.aliyun.com/api/vpc/modifyvrouterattribute.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifyVRouterAttributeWithCallback(request *ModifyVRouterAttributeRequest, callback func(response *ModifyVRouterAttributeResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *ModifyVRouterAttributeResponse + var err error + defer close(result) + response, err = client.ModifyVRouterAttribute(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// ModifyVRouterAttributeRequest is the request struct for api ModifyVRouterAttribute +type ModifyVRouterAttributeRequest struct { + *requests.RpcRequest + VRouterName string `position:"Query" name:"VRouterName"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + VRouterId string `position:"Query" name:"VRouterId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + Description string `position:"Query" name:"Description"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// ModifyVRouterAttributeResponse is the response struct for api ModifyVRouterAttribute +type ModifyVRouterAttributeResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateModifyVRouterAttributeRequest creates a request to invoke ModifyVRouterAttribute API +func CreateModifyVRouterAttributeRequest() (request *ModifyVRouterAttributeRequest) { + request = &ModifyVRouterAttributeRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "ModifyVRouterAttribute", "vpc", "openAPI") + return +} + +// CreateModifyVRouterAttributeResponse creates a response to parse from ModifyVRouterAttribute response +func CreateModifyVRouterAttributeResponse() (response *ModifyVRouterAttributeResponse) { + response = &ModifyVRouterAttributeResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/modify_v_switch_attribute.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/modify_v_switch_attribute.go new file mode 100644 index 000000000..1c814ba15 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/modify_v_switch_attribute.go @@ -0,0 +1,110 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// ModifyVSwitchAttribute invokes the vpc.ModifyVSwitchAttribute API synchronously +// api document: https://help.aliyun.com/api/vpc/modifyvswitchattribute.html +func (client *Client) ModifyVSwitchAttribute(request *ModifyVSwitchAttributeRequest) (response *ModifyVSwitchAttributeResponse, err error) { + response = CreateModifyVSwitchAttributeResponse() + err = client.DoAction(request, response) + return +} + +// ModifyVSwitchAttributeWithChan invokes the vpc.ModifyVSwitchAttribute API asynchronously +// api document: https://help.aliyun.com/api/vpc/modifyvswitchattribute.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifyVSwitchAttributeWithChan(request *ModifyVSwitchAttributeRequest) (<-chan *ModifyVSwitchAttributeResponse, <-chan error) { + responseChan := make(chan *ModifyVSwitchAttributeResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.ModifyVSwitchAttribute(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// ModifyVSwitchAttributeWithCallback invokes the vpc.ModifyVSwitchAttribute API asynchronously +// api document: https://help.aliyun.com/api/vpc/modifyvswitchattribute.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifyVSwitchAttributeWithCallback(request *ModifyVSwitchAttributeRequest, callback func(response *ModifyVSwitchAttributeResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *ModifyVSwitchAttributeResponse + var err error + defer close(result) + response, err = client.ModifyVSwitchAttribute(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// ModifyVSwitchAttributeRequest is the request struct for api ModifyVSwitchAttribute +type ModifyVSwitchAttributeRequest struct { + *requests.RpcRequest + VSwitchId string `position:"Query" name:"VSwitchId"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + VSwitchName string `position:"Query" name:"VSwitchName"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + Description string `position:"Query" name:"Description"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + Ipv6CidrBlock requests.Integer `position:"Query" name:"Ipv6CidrBlock"` +} + +// ModifyVSwitchAttributeResponse is the response struct for api ModifyVSwitchAttribute +type ModifyVSwitchAttributeResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateModifyVSwitchAttributeRequest creates a request to invoke ModifyVSwitchAttribute API +func CreateModifyVSwitchAttributeRequest() (request *ModifyVSwitchAttributeRequest) { + request = &ModifyVSwitchAttributeRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "ModifyVSwitchAttribute", "vpc", "openAPI") + return +} + +// CreateModifyVSwitchAttributeResponse creates a response to parse from ModifyVSwitchAttribute response +func CreateModifyVSwitchAttributeResponse() (response *ModifyVSwitchAttributeResponse) { + response = &ModifyVSwitchAttributeResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/modify_virtual_border_router_attribute.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/modify_virtual_border_router_attribute.go new file mode 100644 index 000000000..9d30ec298 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/modify_virtual_border_router_attribute.go @@ -0,0 +1,116 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// ModifyVirtualBorderRouterAttribute invokes the vpc.ModifyVirtualBorderRouterAttribute API synchronously +// api document: https://help.aliyun.com/api/vpc/modifyvirtualborderrouterattribute.html +func (client *Client) ModifyVirtualBorderRouterAttribute(request *ModifyVirtualBorderRouterAttributeRequest) (response *ModifyVirtualBorderRouterAttributeResponse, err error) { + response = CreateModifyVirtualBorderRouterAttributeResponse() + err = client.DoAction(request, response) + return +} + +// ModifyVirtualBorderRouterAttributeWithChan invokes the vpc.ModifyVirtualBorderRouterAttribute API asynchronously +// api document: https://help.aliyun.com/api/vpc/modifyvirtualborderrouterattribute.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifyVirtualBorderRouterAttributeWithChan(request *ModifyVirtualBorderRouterAttributeRequest) (<-chan *ModifyVirtualBorderRouterAttributeResponse, <-chan error) { + responseChan := make(chan *ModifyVirtualBorderRouterAttributeResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.ModifyVirtualBorderRouterAttribute(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// ModifyVirtualBorderRouterAttributeWithCallback invokes the vpc.ModifyVirtualBorderRouterAttribute API asynchronously +// api document: https://help.aliyun.com/api/vpc/modifyvirtualborderrouterattribute.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifyVirtualBorderRouterAttributeWithCallback(request *ModifyVirtualBorderRouterAttributeRequest, callback func(response *ModifyVirtualBorderRouterAttributeResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *ModifyVirtualBorderRouterAttributeResponse + var err error + defer close(result) + response, err = client.ModifyVirtualBorderRouterAttribute(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// ModifyVirtualBorderRouterAttributeRequest is the request struct for api ModifyVirtualBorderRouterAttribute +type ModifyVirtualBorderRouterAttributeRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + CircuitCode string `position:"Query" name:"CircuitCode"` + AssociatedPhysicalConnections string `position:"Query" name:"AssociatedPhysicalConnections"` + VlanId requests.Integer `position:"Query" name:"VlanId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + ClientToken string `position:"Query" name:"ClientToken"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + Description string `position:"Query" name:"Description"` + VbrId string `position:"Query" name:"VbrId"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + PeerGatewayIp string `position:"Query" name:"PeerGatewayIp"` + PeeringSubnetMask string `position:"Query" name:"PeeringSubnetMask"` + Name string `position:"Query" name:"Name"` + LocalGatewayIp string `position:"Query" name:"LocalGatewayIp"` +} + +// ModifyVirtualBorderRouterAttributeResponse is the response struct for api ModifyVirtualBorderRouterAttribute +type ModifyVirtualBorderRouterAttributeResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateModifyVirtualBorderRouterAttributeRequest creates a request to invoke ModifyVirtualBorderRouterAttribute API +func CreateModifyVirtualBorderRouterAttributeRequest() (request *ModifyVirtualBorderRouterAttributeRequest) { + request = &ModifyVirtualBorderRouterAttributeRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "ModifyVirtualBorderRouterAttribute", "vpc", "openAPI") + return +} + +// CreateModifyVirtualBorderRouterAttributeResponse creates a response to parse from ModifyVirtualBorderRouterAttribute response +func CreateModifyVirtualBorderRouterAttributeResponse() (response *ModifyVirtualBorderRouterAttributeResponse) { + response = &ModifyVirtualBorderRouterAttributeResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/modify_vpc_attribute.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/modify_vpc_attribute.go new file mode 100644 index 000000000..08024ce54 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/modify_vpc_attribute.go @@ -0,0 +1,111 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// ModifyVpcAttribute invokes the vpc.ModifyVpcAttribute API synchronously +// api document: https://help.aliyun.com/api/vpc/modifyvpcattribute.html +func (client *Client) ModifyVpcAttribute(request *ModifyVpcAttributeRequest) (response *ModifyVpcAttributeResponse, err error) { + response = CreateModifyVpcAttributeResponse() + err = client.DoAction(request, response) + return +} + +// ModifyVpcAttributeWithChan invokes the vpc.ModifyVpcAttribute API asynchronously +// api document: https://help.aliyun.com/api/vpc/modifyvpcattribute.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifyVpcAttributeWithChan(request *ModifyVpcAttributeRequest) (<-chan *ModifyVpcAttributeResponse, <-chan error) { + responseChan := make(chan *ModifyVpcAttributeResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.ModifyVpcAttribute(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// ModifyVpcAttributeWithCallback invokes the vpc.ModifyVpcAttribute API asynchronously +// api document: https://help.aliyun.com/api/vpc/modifyvpcattribute.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifyVpcAttributeWithCallback(request *ModifyVpcAttributeRequest, callback func(response *ModifyVpcAttributeResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *ModifyVpcAttributeResponse + var err error + defer close(result) + response, err = client.ModifyVpcAttribute(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// ModifyVpcAttributeRequest is the request struct for api ModifyVpcAttribute +type ModifyVpcAttributeRequest struct { + *requests.RpcRequest + VpcName string `position:"Query" name:"VpcName"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + VpcId string `position:"Query" name:"VpcId"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + CidrBlock string `position:"Query" name:"CidrBlock"` + EnableIPv6 requests.Boolean `position:"Query" name:"EnableIPv6"` + Description string `position:"Query" name:"Description"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// ModifyVpcAttributeResponse is the response struct for api ModifyVpcAttribute +type ModifyVpcAttributeResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateModifyVpcAttributeRequest creates a request to invoke ModifyVpcAttribute API +func CreateModifyVpcAttributeRequest() (request *ModifyVpcAttributeRequest) { + request = &ModifyVpcAttributeRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "ModifyVpcAttribute", "vpc", "openAPI") + return +} + +// CreateModifyVpcAttributeResponse creates a response to parse from ModifyVpcAttribute response +func CreateModifyVpcAttributeResponse() (response *ModifyVpcAttributeResponse) { + response = &ModifyVpcAttributeResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/modify_vpn_connection_attribute.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/modify_vpn_connection_attribute.go new file mode 100644 index 000000000..e46ceb4e9 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/modify_vpn_connection_attribute.go @@ -0,0 +1,125 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// ModifyVpnConnectionAttribute invokes the vpc.ModifyVpnConnectionAttribute API synchronously +// api document: https://help.aliyun.com/api/vpc/modifyvpnconnectionattribute.html +func (client *Client) ModifyVpnConnectionAttribute(request *ModifyVpnConnectionAttributeRequest) (response *ModifyVpnConnectionAttributeResponse, err error) { + response = CreateModifyVpnConnectionAttributeResponse() + err = client.DoAction(request, response) + return +} + +// ModifyVpnConnectionAttributeWithChan invokes the vpc.ModifyVpnConnectionAttribute API asynchronously +// api document: https://help.aliyun.com/api/vpc/modifyvpnconnectionattribute.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifyVpnConnectionAttributeWithChan(request *ModifyVpnConnectionAttributeRequest) (<-chan *ModifyVpnConnectionAttributeResponse, <-chan error) { + responseChan := make(chan *ModifyVpnConnectionAttributeResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.ModifyVpnConnectionAttribute(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// ModifyVpnConnectionAttributeWithCallback invokes the vpc.ModifyVpnConnectionAttribute API asynchronously +// api document: https://help.aliyun.com/api/vpc/modifyvpnconnectionattribute.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifyVpnConnectionAttributeWithCallback(request *ModifyVpnConnectionAttributeRequest, callback func(response *ModifyVpnConnectionAttributeResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *ModifyVpnConnectionAttributeResponse + var err error + defer close(result) + response, err = client.ModifyVpnConnectionAttribute(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// ModifyVpnConnectionAttributeRequest is the request struct for api ModifyVpnConnectionAttribute +type ModifyVpnConnectionAttributeRequest struct { + *requests.RpcRequest + IkeConfig string `position:"Query" name:"IkeConfig"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + RemoteSubnet string `position:"Query" name:"RemoteSubnet"` + EffectImmediately requests.Boolean `position:"Query" name:"EffectImmediately"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + ClientToken string `position:"Query" name:"ClientToken"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + IpsecConfig string `position:"Query" name:"IpsecConfig"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + LocalSubnet string `position:"Query" name:"LocalSubnet"` + VpnConnectionId string `position:"Query" name:"VpnConnectionId"` + Name string `position:"Query" name:"Name"` +} + +// ModifyVpnConnectionAttributeResponse is the response struct for api ModifyVpnConnectionAttribute +type ModifyVpnConnectionAttributeResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + VpnConnectionId string `json:"VpnConnectionId" xml:"VpnConnectionId"` + CustomerGatewayId string `json:"CustomerGatewayId" xml:"CustomerGatewayId"` + VpnGatewayId string `json:"VpnGatewayId" xml:"VpnGatewayId"` + Name string `json:"Name" xml:"Name"` + Description string `json:"Description" xml:"Description"` + LocalSubnet string `json:"LocalSubnet" xml:"LocalSubnet"` + RemoteSubnet string `json:"RemoteSubnet" xml:"RemoteSubnet"` + CreateTime int `json:"CreateTime" xml:"CreateTime"` + EffectImmediately bool `json:"EffectImmediately" xml:"EffectImmediately"` + IkeConfig IkeConfig `json:"IkeConfig" xml:"IkeConfig"` + IpsecConfig IpsecConfig `json:"IpsecConfig" xml:"IpsecConfig"` +} + +// CreateModifyVpnConnectionAttributeRequest creates a request to invoke ModifyVpnConnectionAttribute API +func CreateModifyVpnConnectionAttributeRequest() (request *ModifyVpnConnectionAttributeRequest) { + request = &ModifyVpnConnectionAttributeRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "ModifyVpnConnectionAttribute", "vpc", "openAPI") + return +} + +// CreateModifyVpnConnectionAttributeResponse creates a response to parse from ModifyVpnConnectionAttribute response +func CreateModifyVpnConnectionAttributeResponse() (response *ModifyVpnConnectionAttributeResponse) { + response = &ModifyVpnConnectionAttributeResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/modify_vpn_gateway_attribute.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/modify_vpn_gateway_attribute.go new file mode 100644 index 000000000..495b511f4 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/modify_vpn_gateway_attribute.go @@ -0,0 +1,122 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// ModifyVpnGatewayAttribute invokes the vpc.ModifyVpnGatewayAttribute API synchronously +// api document: https://help.aliyun.com/api/vpc/modifyvpngatewayattribute.html +func (client *Client) ModifyVpnGatewayAttribute(request *ModifyVpnGatewayAttributeRequest) (response *ModifyVpnGatewayAttributeResponse, err error) { + response = CreateModifyVpnGatewayAttributeResponse() + err = client.DoAction(request, response) + return +} + +// ModifyVpnGatewayAttributeWithChan invokes the vpc.ModifyVpnGatewayAttribute API asynchronously +// api document: https://help.aliyun.com/api/vpc/modifyvpngatewayattribute.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifyVpnGatewayAttributeWithChan(request *ModifyVpnGatewayAttributeRequest) (<-chan *ModifyVpnGatewayAttributeResponse, <-chan error) { + responseChan := make(chan *ModifyVpnGatewayAttributeResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.ModifyVpnGatewayAttribute(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// ModifyVpnGatewayAttributeWithCallback invokes the vpc.ModifyVpnGatewayAttribute API asynchronously +// api document: https://help.aliyun.com/api/vpc/modifyvpngatewayattribute.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ModifyVpnGatewayAttributeWithCallback(request *ModifyVpnGatewayAttributeRequest, callback func(response *ModifyVpnGatewayAttributeResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *ModifyVpnGatewayAttributeResponse + var err error + defer close(result) + response, err = client.ModifyVpnGatewayAttribute(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// ModifyVpnGatewayAttributeRequest is the request struct for api ModifyVpnGatewayAttribute +type ModifyVpnGatewayAttributeRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + ClientToken string `position:"Query" name:"ClientToken"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + Name string `position:"Query" name:"Name"` + Description string `position:"Query" name:"Description"` + VpnGatewayId string `position:"Query" name:"VpnGatewayId"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// ModifyVpnGatewayAttributeResponse is the response struct for api ModifyVpnGatewayAttribute +type ModifyVpnGatewayAttributeResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + VpnGatewayId string `json:"VpnGatewayId" xml:"VpnGatewayId"` + VpcId string `json:"VpcId" xml:"VpcId"` + VSwitchId string `json:"VSwitchId" xml:"VSwitchId"` + InternetIp string `json:"InternetIp" xml:"InternetIp"` + IntranetIp string `json:"IntranetIp" xml:"IntranetIp"` + CreateTime int `json:"CreateTime" xml:"CreateTime"` + EndTime int `json:"EndTime" xml:"EndTime"` + Spec string `json:"Spec" xml:"Spec"` + Name string `json:"Name" xml:"Name"` + Description string `json:"Description" xml:"Description"` + Status string `json:"Status" xml:"Status"` + BusinessStatus string `json:"BusinessStatus" xml:"BusinessStatus"` +} + +// CreateModifyVpnGatewayAttributeRequest creates a request to invoke ModifyVpnGatewayAttribute API +func CreateModifyVpnGatewayAttributeRequest() (request *ModifyVpnGatewayAttributeRequest) { + request = &ModifyVpnGatewayAttributeRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "ModifyVpnGatewayAttribute", "vpc", "openAPI") + return +} + +// CreateModifyVpnGatewayAttributeResponse creates a response to parse from ModifyVpnGatewayAttribute response +func CreateModifyVpnGatewayAttributeResponse() (response *ModifyVpnGatewayAttributeResponse) { + response = &ModifyVpnGatewayAttributeResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/recover_virtual_border_router.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/recover_virtual_border_router.go new file mode 100644 index 000000000..d27c91488 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/recover_virtual_border_router.go @@ -0,0 +1,108 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// RecoverVirtualBorderRouter invokes the vpc.RecoverVirtualBorderRouter API synchronously +// api document: https://help.aliyun.com/api/vpc/recovervirtualborderrouter.html +func (client *Client) RecoverVirtualBorderRouter(request *RecoverVirtualBorderRouterRequest) (response *RecoverVirtualBorderRouterResponse, err error) { + response = CreateRecoverVirtualBorderRouterResponse() + err = client.DoAction(request, response) + return +} + +// RecoverVirtualBorderRouterWithChan invokes the vpc.RecoverVirtualBorderRouter API asynchronously +// api document: https://help.aliyun.com/api/vpc/recovervirtualborderrouter.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) RecoverVirtualBorderRouterWithChan(request *RecoverVirtualBorderRouterRequest) (<-chan *RecoverVirtualBorderRouterResponse, <-chan error) { + responseChan := make(chan *RecoverVirtualBorderRouterResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.RecoverVirtualBorderRouter(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// RecoverVirtualBorderRouterWithCallback invokes the vpc.RecoverVirtualBorderRouter API asynchronously +// api document: https://help.aliyun.com/api/vpc/recovervirtualborderrouter.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) RecoverVirtualBorderRouterWithCallback(request *RecoverVirtualBorderRouterRequest, callback func(response *RecoverVirtualBorderRouterResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *RecoverVirtualBorderRouterResponse + var err error + defer close(result) + response, err = client.RecoverVirtualBorderRouter(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// RecoverVirtualBorderRouterRequest is the request struct for api RecoverVirtualBorderRouter +type RecoverVirtualBorderRouterRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + ClientToken string `position:"Query" name:"ClientToken"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + VbrId string `position:"Query" name:"VbrId"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// RecoverVirtualBorderRouterResponse is the response struct for api RecoverVirtualBorderRouter +type RecoverVirtualBorderRouterResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateRecoverVirtualBorderRouterRequest creates a request to invoke RecoverVirtualBorderRouter API +func CreateRecoverVirtualBorderRouterRequest() (request *RecoverVirtualBorderRouterRequest) { + request = &RecoverVirtualBorderRouterRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "RecoverVirtualBorderRouter", "vpc", "openAPI") + return +} + +// CreateRecoverVirtualBorderRouterResponse creates a response to parse from RecoverVirtualBorderRouter response +func CreateRecoverVirtualBorderRouterResponse() (response *RecoverVirtualBorderRouterResponse) { + response = &RecoverVirtualBorderRouterResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/release_eip_address.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/release_eip_address.go new file mode 100644 index 000000000..e95f23e0e --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/release_eip_address.go @@ -0,0 +1,107 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// ReleaseEipAddress invokes the vpc.ReleaseEipAddress API synchronously +// api document: https://help.aliyun.com/api/vpc/releaseeipaddress.html +func (client *Client) ReleaseEipAddress(request *ReleaseEipAddressRequest) (response *ReleaseEipAddressResponse, err error) { + response = CreateReleaseEipAddressResponse() + err = client.DoAction(request, response) + return +} + +// ReleaseEipAddressWithChan invokes the vpc.ReleaseEipAddress API asynchronously +// api document: https://help.aliyun.com/api/vpc/releaseeipaddress.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ReleaseEipAddressWithChan(request *ReleaseEipAddressRequest) (<-chan *ReleaseEipAddressResponse, <-chan error) { + responseChan := make(chan *ReleaseEipAddressResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.ReleaseEipAddress(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// ReleaseEipAddressWithCallback invokes the vpc.ReleaseEipAddress API asynchronously +// api document: https://help.aliyun.com/api/vpc/releaseeipaddress.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) ReleaseEipAddressWithCallback(request *ReleaseEipAddressRequest, callback func(response *ReleaseEipAddressResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *ReleaseEipAddressResponse + var err error + defer close(result) + response, err = client.ReleaseEipAddress(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// ReleaseEipAddressRequest is the request struct for api ReleaseEipAddress +type ReleaseEipAddressRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + AllocationId string `position:"Query" name:"AllocationId"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// ReleaseEipAddressResponse is the response struct for api ReleaseEipAddress +type ReleaseEipAddressResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateReleaseEipAddressRequest creates a request to invoke ReleaseEipAddress API +func CreateReleaseEipAddressRequest() (request *ReleaseEipAddressRequest) { + request = &ReleaseEipAddressRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "ReleaseEipAddress", "vpc", "openAPI") + return +} + +// CreateReleaseEipAddressResponse creates a response to parse from ReleaseEipAddress response +func CreateReleaseEipAddressResponse() (response *ReleaseEipAddressResponse) { + response = &ReleaseEipAddressResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/remove_bandwidth_package_ips.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/remove_bandwidth_package_ips.go new file mode 100644 index 000000000..d172514a7 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/remove_bandwidth_package_ips.go @@ -0,0 +1,109 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// RemoveBandwidthPackageIps invokes the vpc.RemoveBandwidthPackageIps API synchronously +// api document: https://help.aliyun.com/api/vpc/removebandwidthpackageips.html +func (client *Client) RemoveBandwidthPackageIps(request *RemoveBandwidthPackageIpsRequest) (response *RemoveBandwidthPackageIpsResponse, err error) { + response = CreateRemoveBandwidthPackageIpsResponse() + err = client.DoAction(request, response) + return +} + +// RemoveBandwidthPackageIpsWithChan invokes the vpc.RemoveBandwidthPackageIps API asynchronously +// api document: https://help.aliyun.com/api/vpc/removebandwidthpackageips.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) RemoveBandwidthPackageIpsWithChan(request *RemoveBandwidthPackageIpsRequest) (<-chan *RemoveBandwidthPackageIpsResponse, <-chan error) { + responseChan := make(chan *RemoveBandwidthPackageIpsResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.RemoveBandwidthPackageIps(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// RemoveBandwidthPackageIpsWithCallback invokes the vpc.RemoveBandwidthPackageIps API asynchronously +// api document: https://help.aliyun.com/api/vpc/removebandwidthpackageips.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) RemoveBandwidthPackageIpsWithCallback(request *RemoveBandwidthPackageIpsRequest, callback func(response *RemoveBandwidthPackageIpsResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *RemoveBandwidthPackageIpsResponse + var err error + defer close(result) + response, err = client.RemoveBandwidthPackageIps(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// RemoveBandwidthPackageIpsRequest is the request struct for api RemoveBandwidthPackageIps +type RemoveBandwidthPackageIpsRequest struct { + *requests.RpcRequest + RemovedIpAddresses *[]string `position:"Query" name:"RemovedIpAddresses" type:"Repeated"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + BandwidthPackageId string `position:"Query" name:"BandwidthPackageId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + ClientToken string `position:"Query" name:"ClientToken"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// RemoveBandwidthPackageIpsResponse is the response struct for api RemoveBandwidthPackageIps +type RemoveBandwidthPackageIpsResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateRemoveBandwidthPackageIpsRequest creates a request to invoke RemoveBandwidthPackageIps API +func CreateRemoveBandwidthPackageIpsRequest() (request *RemoveBandwidthPackageIpsRequest) { + request = &RemoveBandwidthPackageIpsRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "RemoveBandwidthPackageIps", "vpc", "openAPI") + return +} + +// CreateRemoveBandwidthPackageIpsResponse creates a response to parse from RemoveBandwidthPackageIps response +func CreateRemoveBandwidthPackageIpsResponse() (response *RemoveBandwidthPackageIpsResponse) { + response = &RemoveBandwidthPackageIpsResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/remove_common_bandwidth_package_ip.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/remove_common_bandwidth_package_ip.go new file mode 100644 index 000000000..4fd70f741 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/remove_common_bandwidth_package_ip.go @@ -0,0 +1,108 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// RemoveCommonBandwidthPackageIp invokes the vpc.RemoveCommonBandwidthPackageIp API synchronously +// api document: https://help.aliyun.com/api/vpc/removecommonbandwidthpackageip.html +func (client *Client) RemoveCommonBandwidthPackageIp(request *RemoveCommonBandwidthPackageIpRequest) (response *RemoveCommonBandwidthPackageIpResponse, err error) { + response = CreateRemoveCommonBandwidthPackageIpResponse() + err = client.DoAction(request, response) + return +} + +// RemoveCommonBandwidthPackageIpWithChan invokes the vpc.RemoveCommonBandwidthPackageIp API asynchronously +// api document: https://help.aliyun.com/api/vpc/removecommonbandwidthpackageip.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) RemoveCommonBandwidthPackageIpWithChan(request *RemoveCommonBandwidthPackageIpRequest) (<-chan *RemoveCommonBandwidthPackageIpResponse, <-chan error) { + responseChan := make(chan *RemoveCommonBandwidthPackageIpResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.RemoveCommonBandwidthPackageIp(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// RemoveCommonBandwidthPackageIpWithCallback invokes the vpc.RemoveCommonBandwidthPackageIp API asynchronously +// api document: https://help.aliyun.com/api/vpc/removecommonbandwidthpackageip.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) RemoveCommonBandwidthPackageIpWithCallback(request *RemoveCommonBandwidthPackageIpRequest, callback func(response *RemoveCommonBandwidthPackageIpResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *RemoveCommonBandwidthPackageIpResponse + var err error + defer close(result) + response, err = client.RemoveCommonBandwidthPackageIp(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// RemoveCommonBandwidthPackageIpRequest is the request struct for api RemoveCommonBandwidthPackageIp +type RemoveCommonBandwidthPackageIpRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + BandwidthPackageId string `position:"Query" name:"BandwidthPackageId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + IpInstanceId string `position:"Query" name:"IpInstanceId"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// RemoveCommonBandwidthPackageIpResponse is the response struct for api RemoveCommonBandwidthPackageIp +type RemoveCommonBandwidthPackageIpResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateRemoveCommonBandwidthPackageIpRequest creates a request to invoke RemoveCommonBandwidthPackageIp API +func CreateRemoveCommonBandwidthPackageIpRequest() (request *RemoveCommonBandwidthPackageIpRequest) { + request = &RemoveCommonBandwidthPackageIpRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "RemoveCommonBandwidthPackageIp", "vpc", "openAPI") + return +} + +// CreateRemoveCommonBandwidthPackageIpResponse creates a response to parse from RemoveCommonBandwidthPackageIp response +func CreateRemoveCommonBandwidthPackageIpResponse() (response *RemoveCommonBandwidthPackageIpResponse) { + response = &RemoveCommonBandwidthPackageIpResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/remove_global_acceleration_instance_ip.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/remove_global_acceleration_instance_ip.go new file mode 100644 index 000000000..5f5114f11 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/remove_global_acceleration_instance_ip.go @@ -0,0 +1,108 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// RemoveGlobalAccelerationInstanceIp invokes the vpc.RemoveGlobalAccelerationInstanceIp API synchronously +// api document: https://help.aliyun.com/api/vpc/removeglobalaccelerationinstanceip.html +func (client *Client) RemoveGlobalAccelerationInstanceIp(request *RemoveGlobalAccelerationInstanceIpRequest) (response *RemoveGlobalAccelerationInstanceIpResponse, err error) { + response = CreateRemoveGlobalAccelerationInstanceIpResponse() + err = client.DoAction(request, response) + return +} + +// RemoveGlobalAccelerationInstanceIpWithChan invokes the vpc.RemoveGlobalAccelerationInstanceIp API asynchronously +// api document: https://help.aliyun.com/api/vpc/removeglobalaccelerationinstanceip.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) RemoveGlobalAccelerationInstanceIpWithChan(request *RemoveGlobalAccelerationInstanceIpRequest) (<-chan *RemoveGlobalAccelerationInstanceIpResponse, <-chan error) { + responseChan := make(chan *RemoveGlobalAccelerationInstanceIpResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.RemoveGlobalAccelerationInstanceIp(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// RemoveGlobalAccelerationInstanceIpWithCallback invokes the vpc.RemoveGlobalAccelerationInstanceIp API asynchronously +// api document: https://help.aliyun.com/api/vpc/removeglobalaccelerationinstanceip.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) RemoveGlobalAccelerationInstanceIpWithCallback(request *RemoveGlobalAccelerationInstanceIpRequest, callback func(response *RemoveGlobalAccelerationInstanceIpResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *RemoveGlobalAccelerationInstanceIpResponse + var err error + defer close(result) + response, err = client.RemoveGlobalAccelerationInstanceIp(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// RemoveGlobalAccelerationInstanceIpRequest is the request struct for api RemoveGlobalAccelerationInstanceIp +type RemoveGlobalAccelerationInstanceIpRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + IpInstanceId string `position:"Query" name:"IpInstanceId"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + GlobalAccelerationInstanceId string `position:"Query" name:"GlobalAccelerationInstanceId"` +} + +// RemoveGlobalAccelerationInstanceIpResponse is the response struct for api RemoveGlobalAccelerationInstanceIp +type RemoveGlobalAccelerationInstanceIpResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateRemoveGlobalAccelerationInstanceIpRequest creates a request to invoke RemoveGlobalAccelerationInstanceIp API +func CreateRemoveGlobalAccelerationInstanceIpRequest() (request *RemoveGlobalAccelerationInstanceIpRequest) { + request = &RemoveGlobalAccelerationInstanceIpRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "RemoveGlobalAccelerationInstanceIp", "vpc", "openAPI") + return +} + +// CreateRemoveGlobalAccelerationInstanceIpResponse creates a response to parse from RemoveGlobalAccelerationInstanceIp response +func CreateRemoveGlobalAccelerationInstanceIpResponse() (response *RemoveGlobalAccelerationInstanceIpResponse) { + response = &RemoveGlobalAccelerationInstanceIpResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/remove_i_pv6_translator_acl_list_entry.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/remove_i_pv6_translator_acl_list_entry.go new file mode 100644 index 000000000..95f703eda --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/remove_i_pv6_translator_acl_list_entry.go @@ -0,0 +1,109 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// RemoveIPv6TranslatorAclListEntry invokes the vpc.RemoveIPv6TranslatorAclListEntry API synchronously +// api document: https://help.aliyun.com/api/vpc/removeipv6translatoracllistentry.html +func (client *Client) RemoveIPv6TranslatorAclListEntry(request *RemoveIPv6TranslatorAclListEntryRequest) (response *RemoveIPv6TranslatorAclListEntryResponse, err error) { + response = CreateRemoveIPv6TranslatorAclListEntryResponse() + err = client.DoAction(request, response) + return +} + +// RemoveIPv6TranslatorAclListEntryWithChan invokes the vpc.RemoveIPv6TranslatorAclListEntry API asynchronously +// api document: https://help.aliyun.com/api/vpc/removeipv6translatoracllistentry.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) RemoveIPv6TranslatorAclListEntryWithChan(request *RemoveIPv6TranslatorAclListEntryRequest) (<-chan *RemoveIPv6TranslatorAclListEntryResponse, <-chan error) { + responseChan := make(chan *RemoveIPv6TranslatorAclListEntryResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.RemoveIPv6TranslatorAclListEntry(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// RemoveIPv6TranslatorAclListEntryWithCallback invokes the vpc.RemoveIPv6TranslatorAclListEntry API asynchronously +// api document: https://help.aliyun.com/api/vpc/removeipv6translatoracllistentry.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) RemoveIPv6TranslatorAclListEntryWithCallback(request *RemoveIPv6TranslatorAclListEntryRequest, callback func(response *RemoveIPv6TranslatorAclListEntryResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *RemoveIPv6TranslatorAclListEntryResponse + var err error + defer close(result) + response, err = client.RemoveIPv6TranslatorAclListEntry(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// RemoveIPv6TranslatorAclListEntryRequest is the request struct for api RemoveIPv6TranslatorAclListEntry +type RemoveIPv6TranslatorAclListEntryRequest struct { + *requests.RpcRequest + AclId string `position:"Query" name:"AclId"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + ClientToken string `position:"Query" name:"ClientToken"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + AclEntryId string `position:"Query" name:"AclEntryId"` +} + +// RemoveIPv6TranslatorAclListEntryResponse is the response struct for api RemoveIPv6TranslatorAclListEntry +type RemoveIPv6TranslatorAclListEntryResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateRemoveIPv6TranslatorAclListEntryRequest creates a request to invoke RemoveIPv6TranslatorAclListEntry API +func CreateRemoveIPv6TranslatorAclListEntryRequest() (request *RemoveIPv6TranslatorAclListEntryRequest) { + request = &RemoveIPv6TranslatorAclListEntryRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "RemoveIPv6TranslatorAclListEntry", "vpc", "openAPI") + return +} + +// CreateRemoveIPv6TranslatorAclListEntryResponse creates a response to parse from RemoveIPv6TranslatorAclListEntry response +func CreateRemoveIPv6TranslatorAclListEntryResponse() (response *RemoveIPv6TranslatorAclListEntryResponse) { + response = &RemoveIPv6TranslatorAclListEntryResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/revoke_instance_from_cen.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/revoke_instance_from_cen.go new file mode 100644 index 000000000..4e27a514e --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/revoke_instance_from_cen.go @@ -0,0 +1,111 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// RevokeInstanceFromCen invokes the vpc.RevokeInstanceFromCen API synchronously +// api document: https://help.aliyun.com/api/vpc/revokeinstancefromcen.html +func (client *Client) RevokeInstanceFromCen(request *RevokeInstanceFromCenRequest) (response *RevokeInstanceFromCenResponse, err error) { + response = CreateRevokeInstanceFromCenResponse() + err = client.DoAction(request, response) + return +} + +// RevokeInstanceFromCenWithChan invokes the vpc.RevokeInstanceFromCen API asynchronously +// api document: https://help.aliyun.com/api/vpc/revokeinstancefromcen.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) RevokeInstanceFromCenWithChan(request *RevokeInstanceFromCenRequest) (<-chan *RevokeInstanceFromCenResponse, <-chan error) { + responseChan := make(chan *RevokeInstanceFromCenResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.RevokeInstanceFromCen(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// RevokeInstanceFromCenWithCallback invokes the vpc.RevokeInstanceFromCen API asynchronously +// api document: https://help.aliyun.com/api/vpc/revokeinstancefromcen.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) RevokeInstanceFromCenWithCallback(request *RevokeInstanceFromCenRequest, callback func(response *RevokeInstanceFromCenResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *RevokeInstanceFromCenResponse + var err error + defer close(result) + response, err = client.RevokeInstanceFromCen(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// RevokeInstanceFromCenRequest is the request struct for api RevokeInstanceFromCen +type RevokeInstanceFromCenRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + InstanceId string `position:"Query" name:"InstanceId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + CenId string `position:"Query" name:"CenId"` + ClientToken string `position:"Query" name:"ClientToken"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + InstanceType string `position:"Query" name:"InstanceType"` + CenOwnerId requests.Integer `position:"Query" name:"CenOwnerId"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// RevokeInstanceFromCenResponse is the response struct for api RevokeInstanceFromCen +type RevokeInstanceFromCenResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateRevokeInstanceFromCenRequest creates a request to invoke RevokeInstanceFromCen API +func CreateRevokeInstanceFromCenRequest() (request *RevokeInstanceFromCenRequest) { + request = &RevokeInstanceFromCenRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "RevokeInstanceFromCen", "vpc", "openAPI") + return +} + +// CreateRevokeInstanceFromCenResponse creates a response to parse from RevokeInstanceFromCen response +func CreateRevokeInstanceFromCenResponse() (response *RevokeInstanceFromCenResponse) { + response = &RevokeInstanceFromCenResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_access_point_set.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_access_point_set.go new file mode 100644 index 000000000..ca1b0e666 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_access_point_set.go @@ -0,0 +1,21 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// AccessPointSet is a nested struct in vpc response +type AccessPointSet struct { + AccessPointType []AccessPointType `json:"AccessPointType" xml:"AccessPointType"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_access_point_type.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_access_point_type.go new file mode 100644 index 000000000..663c9c38e --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_access_point_type.go @@ -0,0 +1,28 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// AccessPointType is a nested struct in vpc response +type AccessPointType struct { + AccessPointId string `json:"AccessPointId" xml:"AccessPointId"` + Status string `json:"Status" xml:"Status"` + Type string `json:"Type" xml:"Type"` + AttachedRegionNo string `json:"AttachedRegionNo" xml:"AttachedRegionNo"` + Location string `json:"Location" xml:"Location"` + HostOperator string `json:"HostOperator" xml:"HostOperator"` + Name string `json:"Name" xml:"Name"` + Description string `json:"Description" xml:"Description"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_acl_entries.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_acl_entries.go new file mode 100644 index 000000000..57c508c4a --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_acl_entries.go @@ -0,0 +1,21 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// AclEntries is a nested struct in vpc response +type AclEntries struct { + AclEntry []AclEntry `json:"AclEntry" xml:"AclEntry"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_acl_entry.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_acl_entry.go new file mode 100644 index 000000000..463080ef0 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_acl_entry.go @@ -0,0 +1,23 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// AclEntry is a nested struct in vpc response +type AclEntry struct { + AclEntryId string `json:"AclEntryId" xml:"AclEntryId"` + AclEntryIp string `json:"AclEntryIp" xml:"AclEntryIp"` + AclEntryComment string `json:"AclEntryComment" xml:"AclEntryComment"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_associated_cen.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_associated_cen.go new file mode 100644 index 000000000..89c96ab77 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_associated_cen.go @@ -0,0 +1,23 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// AssociatedCen is a nested struct in vpc response +type AssociatedCen struct { + CenStatus string `json:"CenStatus" xml:"CenStatus"` + CenOwnerId int `json:"CenOwnerId" xml:"CenOwnerId"` + CenId string `json:"CenId" xml:"CenId"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_associated_cens_in_describe_virtual_border_routers.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_associated_cens_in_describe_virtual_border_routers.go new file mode 100644 index 000000000..392efdc5e --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_associated_cens_in_describe_virtual_border_routers.go @@ -0,0 +1,21 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// AssociatedCensInDescribeVirtualBorderRouters is a nested struct in vpc response +type AssociatedCensInDescribeVirtualBorderRouters struct { + AssociatedCen []AssociatedCen `json:"AssociatedCen" xml:"AssociatedCen"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_associated_cens_in_describe_vpc_attribute.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_associated_cens_in_describe_vpc_attribute.go new file mode 100644 index 000000000..82dea6925 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_associated_cens_in_describe_vpc_attribute.go @@ -0,0 +1,21 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// AssociatedCensInDescribeVpcAttribute is a nested struct in vpc response +type AssociatedCensInDescribeVpcAttribute struct { + AssociatedCen []AssociatedCen `json:"AssociatedCen" xml:"AssociatedCen"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_associated_eip_addresses.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_associated_eip_addresses.go new file mode 100644 index 000000000..489ce9f86 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_associated_eip_addresses.go @@ -0,0 +1,21 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// AssociatedEipAddresses is a nested struct in vpc response +type AssociatedEipAddresses struct { + AssociatedEipAddresse []string `json:"associatedEipAddresse" xml:"associatedEipAddresse"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_associated_instances.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_associated_instances.go new file mode 100644 index 000000000..f85c9006e --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_associated_instances.go @@ -0,0 +1,21 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// AssociatedInstances is a nested struct in vpc response +type AssociatedInstances struct { + AssociatedInstance []string `json:"associatedInstance" xml:"associatedInstance"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_associated_physical_connection.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_associated_physical_connection.go new file mode 100644 index 000000000..b7c15c37d --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_associated_physical_connection.go @@ -0,0 +1,30 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// AssociatedPhysicalConnection is a nested struct in vpc response +type AssociatedPhysicalConnection struct { + CircuitCode string `json:"CircuitCode" xml:"CircuitCode"` + VlanInterfaceId string `json:"VlanInterfaceId" xml:"VlanInterfaceId"` + LocalGatewayIp string `json:"LocalGatewayIp" xml:"LocalGatewayIp"` + PeerGatewayIp string `json:"PeerGatewayIp" xml:"PeerGatewayIp"` + PeeringSubnetMask string `json:"PeeringSubnetMask" xml:"PeeringSubnetMask"` + PhysicalConnectionId string `json:"PhysicalConnectionId" xml:"PhysicalConnectionId"` + PhysicalConnectionStatus string `json:"PhysicalConnectionStatus" xml:"PhysicalConnectionStatus"` + PhysicalConnectionBusinessStatus string `json:"PhysicalConnectionBusinessStatus" xml:"PhysicalConnectionBusinessStatus"` + PhysicalConnectionOwnerUid string `json:"PhysicalConnectionOwnerUid" xml:"PhysicalConnectionOwnerUid"` + VlanId string `json:"VlanId" xml:"VlanId"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_associated_physical_connections.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_associated_physical_connections.go new file mode 100644 index 000000000..d60507d8e --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_associated_physical_connections.go @@ -0,0 +1,21 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// AssociatedPhysicalConnections is a nested struct in vpc response +type AssociatedPhysicalConnections struct { + AssociatedPhysicalConnection []AssociatedPhysicalConnection `json:"AssociatedPhysicalConnection" xml:"AssociatedPhysicalConnection"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_available_regions.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_available_regions.go new file mode 100644 index 000000000..208cf6727 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_available_regions.go @@ -0,0 +1,21 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// AvailableRegions is a nested struct in vpc response +type AvailableRegions struct { + AvailableRegion []string `json:"AvailableRegion" xml:"AvailableRegion"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_backend_server.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_backend_server.go new file mode 100644 index 000000000..e22487ae7 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_backend_server.go @@ -0,0 +1,24 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// BackendServer is a nested struct in vpc response +type BackendServer struct { + RegionId string `json:"RegionId" xml:"RegionId"` + ServerId string `json:"ServerId" xml:"ServerId"` + ServerIpAddress string `json:"ServerIpAddress" xml:"ServerIpAddress"` + ServerType string `json:"ServerType" xml:"ServerType"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_backend_servers.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_backend_servers.go new file mode 100644 index 000000000..43ccff34f --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_backend_servers.go @@ -0,0 +1,21 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// BackendServers is a nested struct in vpc response +type BackendServers struct { + BackendServer []BackendServer `json:"BackendServer" xml:"BackendServer"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_bandwidth_package.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_bandwidth_package.go new file mode 100644 index 000000000..68cdc5790 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_bandwidth_package.go @@ -0,0 +1,35 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// BandwidthPackage is a nested struct in vpc response +type BandwidthPackage struct { + BandwidthPackageId string `json:"BandwidthPackageId" xml:"BandwidthPackageId"` + RegionId string `json:"RegionId" xml:"RegionId"` + Name string `json:"Name" xml:"Name"` + Description string `json:"Description" xml:"Description"` + ZoneId string `json:"ZoneId" xml:"ZoneId"` + NatGatewayId string `json:"NatGatewayId" xml:"NatGatewayId"` + Bandwidth string `json:"Bandwidth" xml:"Bandwidth"` + InstanceChargeType string `json:"InstanceChargeType" xml:"InstanceChargeType"` + InternetChargeType string `json:"InternetChargeType" xml:"InternetChargeType"` + BusinessStatus string `json:"BusinessStatus" xml:"BusinessStatus"` + IpCount string `json:"IpCount" xml:"IpCount"` + CreationTime string `json:"CreationTime" xml:"CreationTime"` + Status string `json:"Status" xml:"Status"` + ISP string `json:"ISP" xml:"ISP"` + PublicIpAddresses PublicIpAddressesInDescribeBandwidthPackages `json:"PublicIpAddresses" xml:"PublicIpAddresses"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_bandwidth_package_ids_in_create_nat_gateway.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_bandwidth_package_ids_in_create_nat_gateway.go new file mode 100644 index 000000000..714a19dd0 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_bandwidth_package_ids_in_create_nat_gateway.go @@ -0,0 +1,21 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// BandwidthPackageIdsInCreateNatGateway is a nested struct in vpc response +type BandwidthPackageIdsInCreateNatGateway struct { + BandwidthPackageId []string `json:"BandwidthPackageId" xml:"BandwidthPackageId"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_bandwidth_package_ids_in_describe_nat_gateways.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_bandwidth_package_ids_in_describe_nat_gateways.go new file mode 100644 index 000000000..112638001 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_bandwidth_package_ids_in_describe_nat_gateways.go @@ -0,0 +1,21 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// BandwidthPackageIdsInDescribeNatGateways is a nested struct in vpc response +type BandwidthPackageIdsInDescribeNatGateways struct { + BandwidthPackageId []string `json:"BandwidthPackageId" xml:"BandwidthPackageId"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_bandwidth_packages.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_bandwidth_packages.go new file mode 100644 index 000000000..3a285c607 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_bandwidth_packages.go @@ -0,0 +1,21 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// BandwidthPackages is a nested struct in vpc response +type BandwidthPackages struct { + BandwidthPackage []BandwidthPackage `json:"BandwidthPackage" xml:"BandwidthPackage"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_bgp_group.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_bgp_group.go new file mode 100644 index 000000000..0b992b846 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_bgp_group.go @@ -0,0 +1,33 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// BgpGroup is a nested struct in vpc response +type BgpGroup struct { + Name string `json:"Name" xml:"Name"` + Description string `json:"Description" xml:"Description"` + BgpGroupId string `json:"BgpGroupId" xml:"BgpGroupId"` + PeerAsn string `json:"PeerAsn" xml:"PeerAsn"` + AuthKey string `json:"AuthKey" xml:"AuthKey"` + RouterId string `json:"RouterId" xml:"RouterId"` + Status string `json:"Status" xml:"Status"` + Keepalive string `json:"Keepalive" xml:"Keepalive"` + LocalAsn string `json:"LocalAsn" xml:"LocalAsn"` + Hold string `json:"Hold" xml:"Hold"` + IsFake string `json:"IsFake" xml:"IsFake"` + RouteLimit string `json:"RouteLimit" xml:"RouteLimit"` + RegionId string `json:"RegionId" xml:"RegionId"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_bgp_groups.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_bgp_groups.go new file mode 100644 index 000000000..5b71eed02 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_bgp_groups.go @@ -0,0 +1,21 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// BgpGroups is a nested struct in vpc response +type BgpGroups struct { + BgpGroup []BgpGroup `json:"BgpGroup" xml:"BgpGroup"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_bgp_network.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_bgp_network.go new file mode 100644 index 000000000..2faf63eac --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_bgp_network.go @@ -0,0 +1,23 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// BgpNetwork is a nested struct in vpc response +type BgpNetwork struct { + VpcId string `json:"VpcId" xml:"VpcId"` + DstCidrBlock string `json:"DstCidrBlock" xml:"DstCidrBlock"` + RouterId string `json:"RouterId" xml:"RouterId"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_bgp_networks.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_bgp_networks.go new file mode 100644 index 000000000..205c7841b --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_bgp_networks.go @@ -0,0 +1,21 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// BgpNetworks is a nested struct in vpc response +type BgpNetworks struct { + BgpNetwork []BgpNetwork `json:"BgpNetwork" xml:"BgpNetwork"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_bgp_peer.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_bgp_peer.go new file mode 100644 index 000000000..14b14fe5e --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_bgp_peer.go @@ -0,0 +1,36 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// BgpPeer is a nested struct in vpc response +type BgpPeer struct { + Name string `json:"Name" xml:"Name"` + Description string `json:"Description" xml:"Description"` + BgpPeerId string `json:"BgpPeerId" xml:"BgpPeerId"` + BgpGroupId string `json:"BgpGroupId" xml:"BgpGroupId"` + PeerIpAddress string `json:"PeerIpAddress" xml:"PeerIpAddress"` + PeerAsn string `json:"PeerAsn" xml:"PeerAsn"` + AuthKey string `json:"AuthKey" xml:"AuthKey"` + RouterId string `json:"RouterId" xml:"RouterId"` + BgpStatus string `json:"BgpStatus" xml:"BgpStatus"` + Status string `json:"Status" xml:"Status"` + Keepalive string `json:"Keepalive" xml:"Keepalive"` + LocalAsn string `json:"LocalAsn" xml:"LocalAsn"` + Hold string `json:"Hold" xml:"Hold"` + IsFake string `json:"IsFake" xml:"IsFake"` + RouteLimit string `json:"RouteLimit" xml:"RouteLimit"` + RegionId string `json:"RegionId" xml:"RegionId"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_bgp_peers.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_bgp_peers.go new file mode 100644 index 000000000..10fac65ae --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_bgp_peers.go @@ -0,0 +1,21 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// BgpPeers is a nested struct in vpc response +type BgpPeers struct { + BgpPeer []BgpPeer `json:"BgpPeer" xml:"BgpPeer"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_cbn_grant_rule.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_cbn_grant_rule.go new file mode 100644 index 000000000..e56c06f43 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_cbn_grant_rule.go @@ -0,0 +1,23 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// CbnGrantRule is a nested struct in vpc response +type CbnGrantRule struct { + CenInstanceId string `json:"CenInstanceId" xml:"CenInstanceId"` + CenOwnerId int `json:"CenOwnerId" xml:"CenOwnerId"` + CreationTime string `json:"CreationTime" xml:"CreationTime"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_cen_grant_rules.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_cen_grant_rules.go new file mode 100644 index 000000000..4cc37daff --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_cen_grant_rules.go @@ -0,0 +1,21 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// CenGrantRules is a nested struct in vpc response +type CenGrantRules struct { + CbnGrantRule []CbnGrantRule `json:"CbnGrantRule" xml:"CbnGrantRule"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_cloud_resource_set_type.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_cloud_resource_set_type.go new file mode 100644 index 000000000..27e39f31e --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_cloud_resource_set_type.go @@ -0,0 +1,22 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// CloudResourceSetType is a nested struct in vpc response +type CloudResourceSetType struct { + ResourceType string `json:"ResourceType" xml:"ResourceType"` + ResourceCount int `json:"ResourceCount" xml:"ResourceCount"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_cloud_resources_in_describe_v_switch_attributes.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_cloud_resources_in_describe_v_switch_attributes.go new file mode 100644 index 000000000..a7f53520b --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_cloud_resources_in_describe_v_switch_attributes.go @@ -0,0 +1,21 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// CloudResourcesInDescribeVSwitchAttributes is a nested struct in vpc response +type CloudResourcesInDescribeVSwitchAttributes struct { + CloudResourceSetType []CloudResourceSetType `json:"CloudResourceSetType" xml:"CloudResourceSetType"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_cloud_resources_in_describe_vpc_attribute.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_cloud_resources_in_describe_vpc_attribute.go new file mode 100644 index 000000000..b8196281f --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_cloud_resources_in_describe_vpc_attribute.go @@ -0,0 +1,21 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// CloudResourcesInDescribeVpcAttribute is a nested struct in vpc response +type CloudResourcesInDescribeVpcAttribute struct { + CloudResourceSetType []CloudResourceSetType `json:"CloudResourceSetType" xml:"CloudResourceSetType"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_common_bandwidth_package.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_common_bandwidth_package.go new file mode 100644 index 000000000..b75af0fc4 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_common_bandwidth_package.go @@ -0,0 +1,40 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// CommonBandwidthPackage is a nested struct in vpc response +type CommonBandwidthPackage struct { + BandwidthPackageId string `json:"BandwidthPackageId" xml:"BandwidthPackageId"` + RegionId string `json:"RegionId" xml:"RegionId"` + Name string `json:"Name" xml:"Name"` + Description string `json:"Description" xml:"Description"` + Bandwidth string `json:"Bandwidth" xml:"Bandwidth"` + InstanceChargeType string `json:"InstanceChargeType" xml:"InstanceChargeType"` + InternetChargeType string `json:"InternetChargeType" xml:"InternetChargeType"` + BusinessStatus string `json:"BusinessStatus" xml:"BusinessStatus"` + CreationTime string `json:"CreationTime" xml:"CreationTime"` + ExpiredTime string `json:"ExpiredTime" xml:"ExpiredTime"` + Status string `json:"Status" xml:"Status"` + Ratio int `json:"Ratio" xml:"Ratio"` + ResourceGroupId string `json:"ResourceGroupId" xml:"ResourceGroupId"` + HasReservationData string `json:"HasReservationData" xml:"HasReservationData"` + ReservationBandwidth string `json:"ReservationBandwidth" xml:"ReservationBandwidth"` + ReservationInternetChargeType string `json:"ReservationInternetChargeType" xml:"ReservationInternetChargeType"` + ReservationActiveTime string `json:"ReservationActiveTime" xml:"ReservationActiveTime"` + ReservationOrderType string `json:"ReservationOrderType" xml:"ReservationOrderType"` + ISP string `json:"ISP" xml:"ISP"` + PublicIpAddresses PublicIpAddressesInDescribeCommonBandwidthPackages `json:"PublicIpAddresses" xml:"PublicIpAddresses"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_common_bandwidth_packages.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_common_bandwidth_packages.go new file mode 100644 index 000000000..f2dd28aa0 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_common_bandwidth_packages.go @@ -0,0 +1,21 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// CommonBandwidthPackages is a nested struct in vpc response +type CommonBandwidthPackages struct { + CommonBandwidthPackage []CommonBandwidthPackage `json:"CommonBandwidthPackage" xml:"CommonBandwidthPackage"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_customer_gateway.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_customer_gateway.go new file mode 100644 index 000000000..1afd1a249 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_customer_gateway.go @@ -0,0 +1,25 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// CustomerGateway is a nested struct in vpc response +type CustomerGateway struct { + CustomerGatewayId string `json:"CustomerGatewayId" xml:"CustomerGatewayId"` + Name string `json:"Name" xml:"Name"` + IpAddress string `json:"IpAddress" xml:"IpAddress"` + Description string `json:"Description" xml:"Description"` + CreateTime int `json:"CreateTime" xml:"CreateTime"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_customer_gateways.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_customer_gateways.go new file mode 100644 index 000000000..2b832b862 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_customer_gateways.go @@ -0,0 +1,21 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// CustomerGateways is a nested struct in vpc response +type CustomerGateways struct { + CustomerGateway []CustomerGateway `json:"CustomerGateway" xml:"CustomerGateway"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_eip_address.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_eip_address.go new file mode 100644 index 000000000..e78e90685 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_eip_address.go @@ -0,0 +1,50 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// EipAddress is a nested struct in vpc response +type EipAddress struct { + RegionId string `json:"RegionId" xml:"RegionId"` + IpAddress string `json:"IpAddress" xml:"IpAddress"` + PrivateIpAddress string `json:"PrivateIpAddress" xml:"PrivateIpAddress"` + AllocationId string `json:"AllocationId" xml:"AllocationId"` + Status string `json:"Status" xml:"Status"` + InstanceId string `json:"InstanceId" xml:"InstanceId"` + Bandwidth string `json:"Bandwidth" xml:"Bandwidth"` + EipBandwidth string `json:"EipBandwidth" xml:"EipBandwidth"` + InternetChargeType string `json:"InternetChargeType" xml:"InternetChargeType"` + AllocationTime string `json:"AllocationTime" xml:"AllocationTime"` + InstanceType string `json:"InstanceType" xml:"InstanceType"` + InstanceRegionId string `json:"InstanceRegionId" xml:"InstanceRegionId"` + ChargeType string `json:"ChargeType" xml:"ChargeType"` + ExpiredTime string `json:"ExpiredTime" xml:"ExpiredTime"` + HDMonitorStatus string `json:"HDMonitorStatus" xml:"HDMonitorStatus"` + Name string `json:"Name" xml:"Name"` + ISP string `json:"ISP" xml:"ISP"` + Descritpion string `json:"Descritpion" xml:"Descritpion"` + BandwidthPackageId string `json:"BandwidthPackageId" xml:"BandwidthPackageId"` + BandwidthPackageType string `json:"BandwidthPackageType" xml:"BandwidthPackageType"` + ResourceGroupId string `json:"ResourceGroupId" xml:"ResourceGroupId"` + HasReservationData string `json:"HasReservationData" xml:"HasReservationData"` + ReservationBandwidth string `json:"ReservationBandwidth" xml:"ReservationBandwidth"` + ReservationInternetChargeType string `json:"ReservationInternetChargeType" xml:"ReservationInternetChargeType"` + ReservationActiveTime string `json:"ReservationActiveTime" xml:"ReservationActiveTime"` + ReservationOrderType string `json:"ReservationOrderType" xml:"ReservationOrderType"` + Mode string `json:"Mode" xml:"Mode"` + AvailableRegions AvailableRegions `json:"AvailableRegions" xml:"AvailableRegions"` + OperationLocks OperationLocksInDescribeEipAddresses `json:"OperationLocks" xml:"OperationLocks"` + Tags TagsInDescribeEipAddresses `json:"Tags" xml:"Tags"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_eip_addresses.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_eip_addresses.go new file mode 100644 index 000000000..81f6ac357 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_eip_addresses.go @@ -0,0 +1,21 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// EipAddresses is a nested struct in vpc response +type EipAddresses struct { + EipAddress []EipAddress `json:"EipAddress" xml:"EipAddress"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_eip_monitor_data.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_eip_monitor_data.go new file mode 100644 index 000000000..49aee300c --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_eip_monitor_data.go @@ -0,0 +1,26 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// EipMonitorData is a nested struct in vpc response +type EipMonitorData struct { + EipRX int `json:"EipRX" xml:"EipRX"` + EipTX int `json:"EipTX" xml:"EipTX"` + EipFlow int `json:"EipFlow" xml:"EipFlow"` + EipBandwidth int `json:"EipBandwidth" xml:"EipBandwidth"` + EipPackets int `json:"EipPackets" xml:"EipPackets"` + TimeStamp string `json:"TimeStamp" xml:"TimeStamp"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_eip_monitor_datas.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_eip_monitor_datas.go new file mode 100644 index 000000000..847981193 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_eip_monitor_datas.go @@ -0,0 +1,21 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// EipMonitorDatas is a nested struct in vpc response +type EipMonitorDatas struct { + EipMonitorData []EipMonitorData `json:"EipMonitorData" xml:"EipMonitorData"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_flow_log.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_flow_log.go new file mode 100644 index 000000000..b1b537569 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_flow_log.go @@ -0,0 +1,31 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// FlowLog is a nested struct in vpc response +type FlowLog struct { + FlowLogId string `json:"FlowLogId" xml:"FlowLogId"` + FlowLogName string `json:"FlowLogName" xml:"FlowLogName"` + Description string `json:"Description" xml:"Description"` + CreationTime string `json:"CreationTime" xml:"CreationTime"` + ResourceType string `json:"ResourceType" xml:"ResourceType"` + ResourceId string `json:"ResourceId" xml:"ResourceId"` + ProjectName string `json:"ProjectName" xml:"ProjectName"` + LogStoreName string `json:"LogStoreName" xml:"LogStoreName"` + Status string `json:"Status" xml:"Status"` + TrafficType string `json:"TrafficType" xml:"TrafficType"` + RegionId string `json:"RegionId" xml:"RegionId"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_flow_logs.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_flow_logs.go new file mode 100644 index 000000000..8859e1bec --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_flow_logs.go @@ -0,0 +1,21 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// FlowLogs is a nested struct in vpc response +type FlowLogs struct { + FlowLog []FlowLog `json:"FlowLog" xml:"FlowLog"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_forward_table_entries.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_forward_table_entries.go new file mode 100644 index 000000000..c1b61759e --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_forward_table_entries.go @@ -0,0 +1,21 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// ForwardTableEntries is a nested struct in vpc response +type ForwardTableEntries struct { + ForwardTableEntry []ForwardTableEntry `json:"ForwardTableEntry" xml:"ForwardTableEntry"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_forward_table_entry.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_forward_table_entry.go new file mode 100644 index 000000000..e22b086f0 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_forward_table_entry.go @@ -0,0 +1,29 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// ForwardTableEntry is a nested struct in vpc response +type ForwardTableEntry struct { + ForwardTableId string `json:"ForwardTableId" xml:"ForwardTableId"` + ForwardEntryId string `json:"ForwardEntryId" xml:"ForwardEntryId"` + ExternalIp string `json:"ExternalIp" xml:"ExternalIp"` + ExternalPort string `json:"ExternalPort" xml:"ExternalPort"` + IpProtocol string `json:"IpProtocol" xml:"IpProtocol"` + InternalIp string `json:"InternalIp" xml:"InternalIp"` + InternalPort string `json:"InternalPort" xml:"InternalPort"` + Status string `json:"Status" xml:"Status"` + ForwardEntryName string `json:"ForwardEntryName" xml:"ForwardEntryName"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_forward_table_ids_in_create_nat_gateway.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_forward_table_ids_in_create_nat_gateway.go new file mode 100644 index 000000000..c0bd01cf1 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_forward_table_ids_in_create_nat_gateway.go @@ -0,0 +1,21 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// ForwardTableIdsInCreateNatGateway is a nested struct in vpc response +type ForwardTableIdsInCreateNatGateway struct { + ForwardTableId []string `json:"ForwardTableId" xml:"ForwardTableId"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_forward_table_ids_in_describe_nat_gateways.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_forward_table_ids_in_describe_nat_gateways.go new file mode 100644 index 000000000..bc0dc2e79 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_forward_table_ids_in_describe_nat_gateways.go @@ -0,0 +1,21 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// ForwardTableIdsInDescribeNatGateways is a nested struct in vpc response +type ForwardTableIdsInDescribeNatGateways struct { + ForwardTableId []string `json:"ForwardTableId" xml:"ForwardTableId"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_global_acceleration_instance.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_global_acceleration_instance.go new file mode 100644 index 000000000..425d6fb60 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_global_acceleration_instance.go @@ -0,0 +1,43 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// GlobalAccelerationInstance is a nested struct in vpc response +type GlobalAccelerationInstance struct { + Name string `json:"Name" xml:"Name"` + ExpiredTime string `json:"ExpiredTime" xml:"ExpiredTime"` + IpAddress string `json:"IpAddress" xml:"IpAddress"` + HasReservationData string `json:"HasReservationData" xml:"HasReservationData"` + ChargeType string `json:"ChargeType" xml:"ChargeType"` + ServiceLocation string `json:"ServiceLocation" xml:"ServiceLocation"` + CreationTime string `json:"CreationTime" xml:"CreationTime"` + ServerIpAddress string `json:"ServerIpAddress" xml:"ServerIpAddress"` + ReservationBandwidth string `json:"ReservationBandwidth" xml:"ReservationBandwidth"` + ReservationActiveTime string `json:"ReservationActiveTime" xml:"ReservationActiveTime"` + RegionId string `json:"RegionId" xml:"RegionId"` + AccelerationLocation string `json:"AccelerationLocation" xml:"AccelerationLocation"` + ReservationInternetChargeType string `json:"ReservationInternetChargeType" xml:"ReservationInternetChargeType"` + BandwidthType string `json:"BandwidthType" xml:"BandwidthType"` + ReservationOrderType string `json:"ReservationOrderType" xml:"ReservationOrderType"` + Bandwidth string `json:"Bandwidth" xml:"Bandwidth"` + InternetChargeType string `json:"InternetChargeType" xml:"InternetChargeType"` + GlobalAccelerationInstanceId string `json:"GlobalAccelerationInstanceId" xml:"GlobalAccelerationInstanceId"` + Status string `json:"Status" xml:"Status"` + Description string `json:"Description" xml:"Description"` + OperationLocks OperationLocksInDescribeGlobalAccelerationInstances `json:"OperationLocks" xml:"OperationLocks"` + PublicIpAddresses PublicIpAddressesInDescribeGlobalAccelerationInstances `json:"PublicIpAddresses" xml:"PublicIpAddresses"` + BackendServers BackendServers `json:"BackendServers" xml:"BackendServers"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_global_acceleration_instances_in_describe_global_acceleration_instances.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_global_acceleration_instances_in_describe_global_acceleration_instances.go new file mode 100644 index 000000000..a5ab16b54 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_global_acceleration_instances_in_describe_global_acceleration_instances.go @@ -0,0 +1,21 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// GlobalAccelerationInstancesInDescribeGlobalAccelerationInstances is a nested struct in vpc response +type GlobalAccelerationInstancesInDescribeGlobalAccelerationInstances struct { + GlobalAccelerationInstance []GlobalAccelerationInstance `json:"GlobalAccelerationInstance" xml:"GlobalAccelerationInstance"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_global_acceleration_instances_in_describe_server_related_global_acceleration_instances.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_global_acceleration_instances_in_describe_server_related_global_acceleration_instances.go new file mode 100644 index 000000000..9cbc47cab --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_global_acceleration_instances_in_describe_server_related_global_acceleration_instances.go @@ -0,0 +1,21 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// GlobalAccelerationInstancesInDescribeServerRelatedGlobalAccelerationInstances is a nested struct in vpc response +type GlobalAccelerationInstancesInDescribeServerRelatedGlobalAccelerationInstances struct { + GlobalAccelerationInstance []GlobalAccelerationInstance `json:"GlobalAccelerationInstance" xml:"GlobalAccelerationInstance"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_ha_vip.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_ha_vip.go new file mode 100644 index 000000000..ed731aea9 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_ha_vip.go @@ -0,0 +1,31 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// HaVip is a nested struct in vpc response +type HaVip struct { + HaVipId string `json:"HaVipId" xml:"HaVipId"` + RegionId string `json:"RegionId" xml:"RegionId"` + VpcId string `json:"VpcId" xml:"VpcId"` + VSwitchId string `json:"VSwitchId" xml:"VSwitchId"` + IpAddress string `json:"IpAddress" xml:"IpAddress"` + Status string `json:"Status" xml:"Status"` + MasterInstanceId string `json:"MasterInstanceId" xml:"MasterInstanceId"` + Description string `json:"Description" xml:"Description"` + CreateTime string `json:"CreateTime" xml:"CreateTime"` + AssociatedInstances AssociatedInstances `json:"AssociatedInstances" xml:"AssociatedInstances"` + AssociatedEipAddresses AssociatedEipAddresses `json:"AssociatedEipAddresses" xml:"AssociatedEipAddresses"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_ha_vips.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_ha_vips.go new file mode 100644 index 000000000..3ba331c60 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_ha_vips.go @@ -0,0 +1,21 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// HaVips is a nested struct in vpc response +type HaVips struct { + HaVip []HaVip `json:"HaVip" xml:"HaVip"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_i_pv6_translator_acl.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_i_pv6_translator_acl.go new file mode 100644 index 000000000..90f4eff1a --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_i_pv6_translator_acl.go @@ -0,0 +1,22 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// IPv6TranslatorAcl is a nested struct in vpc response +type IPv6TranslatorAcl struct { + AclId string `json:"AclId" xml:"AclId"` + AclName string `json:"AclName" xml:"AclName"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_ike_config.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_ike_config.go new file mode 100644 index 000000000..789c4062e --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_ike_config.go @@ -0,0 +1,29 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// IkeConfig is a nested struct in vpc response +type IkeConfig struct { + LocalId string `json:"LocalId" xml:"LocalId"` + IkeAuthAlg string `json:"IkeAuthAlg" xml:"IkeAuthAlg"` + IkePfs string `json:"IkePfs" xml:"IkePfs"` + IkeMode string `json:"IkeMode" xml:"IkeMode"` + IkeEncAlg string `json:"IkeEncAlg" xml:"IkeEncAlg"` + Psk string `json:"Psk" xml:"Psk"` + RemoteId string `json:"RemoteId" xml:"RemoteId"` + IkeVersion string `json:"IkeVersion" xml:"IkeVersion"` + IkeLifetime int `json:"IkeLifetime" xml:"IkeLifetime"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_ip_list.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_ip_list.go new file mode 100644 index 000000000..054108acf --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_ip_list.go @@ -0,0 +1,24 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// IpList is a nested struct in vpc response +type IpList struct { + AllocationId string `json:"AllocationId" xml:"AllocationId"` + IpAddress string `json:"IpAddress" xml:"IpAddress"` + UsingStatus string `json:"UsingStatus" xml:"UsingStatus"` + ApAccessEnabled bool `json:"ApAccessEnabled" xml:"ApAccessEnabled"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_ip_lists.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_ip_lists.go new file mode 100644 index 000000000..186458744 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_ip_lists.go @@ -0,0 +1,21 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// IpLists is a nested struct in vpc response +type IpLists struct { + IpList []IpList `json:"IpList" xml:"IpList"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_ipsec_config.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_ipsec_config.go new file mode 100644 index 000000000..e21132aa8 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_ipsec_config.go @@ -0,0 +1,24 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// IpsecConfig is a nested struct in vpc response +type IpsecConfig struct { + IpsecAuthAlg string `json:"IpsecAuthAlg" xml:"IpsecAuthAlg"` + IpsecPfs string `json:"IpsecPfs" xml:"IpsecPfs"` + IpsecEncAlg string `json:"IpsecEncAlg" xml:"IpsecEncAlg"` + IpsecLifetime int `json:"IpsecLifetime" xml:"IpsecLifetime"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_ipv6_address.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_ipv6_address.go new file mode 100644 index 000000000..363e01eaa --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_ipv6_address.go @@ -0,0 +1,33 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// Ipv6Address is a nested struct in vpc response +type Ipv6Address struct { + Ipv6AddressId string `json:"Ipv6AddressId" xml:"Ipv6AddressId"` + Ipv6AddressName string `json:"Ipv6AddressName" xml:"Ipv6AddressName"` + VSwitchId string `json:"VSwitchId" xml:"VSwitchId"` + VpcId string `json:"VpcId" xml:"VpcId"` + Ipv6GatewayId string `json:"Ipv6GatewayId" xml:"Ipv6GatewayId"` + Ipv6Address string `json:"Ipv6Address" xml:"Ipv6Address"` + AssociatedInstanceId string `json:"AssociatedInstanceId" xml:"AssociatedInstanceId"` + AssociatedInstanceType string `json:"AssociatedInstanceType" xml:"AssociatedInstanceType"` + Status string `json:"Status" xml:"Status"` + NetworkType string `json:"NetworkType" xml:"NetworkType"` + RealBandwidth int `json:"RealBandwidth" xml:"RealBandwidth"` + AllocationTime string `json:"AllocationTime" xml:"AllocationTime"` + Ipv6InternetBandwidth Ipv6InternetBandwidth `json:"Ipv6InternetBandwidth" xml:"Ipv6InternetBandwidth"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_ipv6_addresses.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_ipv6_addresses.go new file mode 100644 index 000000000..17d6c881f --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_ipv6_addresses.go @@ -0,0 +1,21 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// Ipv6Addresses is a nested struct in vpc response +type Ipv6Addresses struct { + Ipv6Address []Ipv6Address `json:"Ipv6Address" xml:"Ipv6Address"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_ipv6_egress_only_rule.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_ipv6_egress_only_rule.go new file mode 100644 index 000000000..b2ac2dca3 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_ipv6_egress_only_rule.go @@ -0,0 +1,26 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// Ipv6EgressOnlyRule is a nested struct in vpc response +type Ipv6EgressOnlyRule struct { + Ipv6EgressOnlyRuleId string `json:"Ipv6EgressOnlyRuleId" xml:"Ipv6EgressOnlyRuleId"` + InstanceType string `json:"InstanceType" xml:"InstanceType"` + InstanceId string `json:"InstanceId" xml:"InstanceId"` + Status string `json:"Status" xml:"Status"` + Name string `json:"Name" xml:"Name"` + Description string `json:"Description" xml:"Description"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_ipv6_egress_only_rules.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_ipv6_egress_only_rules.go new file mode 100644 index 000000000..0fe8dc370 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_ipv6_egress_only_rules.go @@ -0,0 +1,21 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// Ipv6EgressOnlyRules is a nested struct in vpc response +type Ipv6EgressOnlyRules struct { + Ipv6EgressOnlyRule []Ipv6EgressOnlyRule `json:"Ipv6EgressOnlyRule" xml:"Ipv6EgressOnlyRule"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_ipv6_gateway.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_ipv6_gateway.go new file mode 100644 index 000000000..606f78bd2 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_ipv6_gateway.go @@ -0,0 +1,31 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// Ipv6Gateway is a nested struct in vpc response +type Ipv6Gateway struct { + RegionId string `json:"RegionId" xml:"RegionId"` + Ipv6GatewayId string `json:"Ipv6GatewayId" xml:"Ipv6GatewayId"` + VpcId string `json:"VpcId" xml:"VpcId"` + Status string `json:"Status" xml:"Status"` + Name string `json:"Name" xml:"Name"` + Description string `json:"Description" xml:"Description"` + Spec string `json:"Spec" xml:"Spec"` + InstanceChargeType string `json:"InstanceChargeType" xml:"InstanceChargeType"` + BusinessStatus string `json:"BusinessStatus" xml:"BusinessStatus"` + ExpiredTime string `json:"ExpiredTime" xml:"ExpiredTime"` + CreationTime string `json:"CreationTime" xml:"CreationTime"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_ipv6_gateways.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_ipv6_gateways.go new file mode 100644 index 000000000..61edfc64b --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_ipv6_gateways.go @@ -0,0 +1,21 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// Ipv6Gateways is a nested struct in vpc response +type Ipv6Gateways struct { + Ipv6Gateway []Ipv6Gateway `json:"Ipv6Gateway" xml:"Ipv6Gateway"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_ipv6_internet_bandwidth.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_ipv6_internet_bandwidth.go new file mode 100644 index 000000000..f69a29533 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_ipv6_internet_bandwidth.go @@ -0,0 +1,25 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// Ipv6InternetBandwidth is a nested struct in vpc response +type Ipv6InternetBandwidth struct { + Bandwidth int `json:"Bandwidth" xml:"Bandwidth"` + InstanceChargeType string `json:"InstanceChargeType" xml:"InstanceChargeType"` + InternetChargeType string `json:"InternetChargeType" xml:"InternetChargeType"` + BusinessStatus string `json:"BusinessStatus" xml:"BusinessStatus"` + Ipv6InternetBandwidthId string `json:"Ipv6InternetBandwidthId" xml:"Ipv6InternetBandwidthId"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_ipv6_translator.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_ipv6_translator.go new file mode 100644 index 000000000..eabb2ed74 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_ipv6_translator.go @@ -0,0 +1,35 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// Ipv6Translator is a nested struct in vpc response +type Ipv6Translator struct { + Ipv6TranslatorId string `json:"Ipv6TranslatorId" xml:"Ipv6TranslatorId"` + CreateTime int `json:"CreateTime" xml:"CreateTime"` + EndTime int `json:"EndTime" xml:"EndTime"` + Spec string `json:"Spec" xml:"Spec"` + Name string `json:"Name" xml:"Name"` + Description string `json:"Description" xml:"Description"` + Status string `json:"Status" xml:"Status"` + BusinessStatus string `json:"BusinessStatus" xml:"BusinessStatus"` + PayType string `json:"PayType" xml:"PayType"` + Bandwidth int `json:"Bandwidth" xml:"Bandwidth"` + AllocateIpv6Addr string `json:"AllocateIpv6Addr" xml:"AllocateIpv6Addr"` + AllocateIpv4Addr string `json:"AllocateIpv4Addr" xml:"AllocateIpv4Addr"` + AvailableBandwidth string `json:"AvailableBandwidth" xml:"AvailableBandwidth"` + RegionId string `json:"RegionId" xml:"RegionId"` + Ipv6TranslatorEntryIds Ipv6TranslatorEntryIds `json:"Ipv6TranslatorEntryIds" xml:"Ipv6TranslatorEntryIds"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_ipv6_translator_acls.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_ipv6_translator_acls.go new file mode 100644 index 000000000..beecc8577 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_ipv6_translator_acls.go @@ -0,0 +1,21 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// Ipv6TranslatorAcls is a nested struct in vpc response +type Ipv6TranslatorAcls struct { + IPv6TranslatorAcl []IPv6TranslatorAcl `json:"IPv6TranslatorAcl" xml:"IPv6TranslatorAcl"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_ipv6_translator_entries.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_ipv6_translator_entries.go new file mode 100644 index 000000000..500b01e6c --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_ipv6_translator_entries.go @@ -0,0 +1,21 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// Ipv6TranslatorEntries is a nested struct in vpc response +type Ipv6TranslatorEntries struct { + Ipv6TranslatorEntry []Ipv6TranslatorEntry `json:"Ipv6TranslatorEntry" xml:"Ipv6TranslatorEntry"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_ipv6_translator_entry.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_ipv6_translator_entry.go new file mode 100644 index 000000000..99c160337 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_ipv6_translator_entry.go @@ -0,0 +1,35 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// Ipv6TranslatorEntry is a nested struct in vpc response +type Ipv6TranslatorEntry struct { + Ipv6TranslatorId string `json:"Ipv6TranslatorId" xml:"Ipv6TranslatorId"` + Ipv6TranslatorEntryId string `json:"Ipv6TranslatorEntryId" xml:"Ipv6TranslatorEntryId"` + AllocateIpv6Addr string `json:"AllocateIpv6Addr" xml:"AllocateIpv6Addr"` + AllocateIpv6Port int `json:"AllocateIpv6Port" xml:"AllocateIpv6Port"` + BackendIpv4Addr string `json:"BackendIpv4Addr" xml:"BackendIpv4Addr"` + BackendIpv4Port string `json:"BackendIpv4Port" xml:"BackendIpv4Port"` + TransProtocol string `json:"TransProtocol" xml:"TransProtocol"` + EntryBandwidth string `json:"EntryBandwidth" xml:"EntryBandwidth"` + EntryDescription string `json:"EntryDescription" xml:"EntryDescription"` + EntryName string `json:"EntryName" xml:"EntryName"` + EntryStatus string `json:"EntryStatus" xml:"EntryStatus"` + AclStatus string `json:"AclStatus" xml:"AclStatus"` + AclType string `json:"AclType" xml:"AclType"` + AclId string `json:"AclId" xml:"AclId"` + RegionId string `json:"RegionId" xml:"RegionId"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_ipv6_translator_entry_ids.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_ipv6_translator_entry_ids.go new file mode 100644 index 000000000..6bc2b5e66 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_ipv6_translator_entry_ids.go @@ -0,0 +1,21 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// Ipv6TranslatorEntryIds is a nested struct in vpc response +type Ipv6TranslatorEntryIds struct { + Ipv6TranslatorEntryId []string `json:"Ipv6TranslatorEntryId" xml:"Ipv6TranslatorEntryId"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_ipv6_translators.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_ipv6_translators.go new file mode 100644 index 000000000..2d8397d4f --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_ipv6_translators.go @@ -0,0 +1,21 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// Ipv6Translators is a nested struct in vpc response +type Ipv6Translators struct { + Ipv6Translator []Ipv6Translator `json:"Ipv6Translator" xml:"Ipv6Translator"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_lock_reason.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_lock_reason.go new file mode 100644 index 000000000..4e80e41e6 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_lock_reason.go @@ -0,0 +1,21 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// LockReason is a nested struct in vpc response +type LockReason struct { + LockReason string `json:"LockReason" xml:"LockReason"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_nat_gateway.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_nat_gateway.go new file mode 100644 index 000000000..b45b45035 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_nat_gateway.go @@ -0,0 +1,36 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// NatGateway is a nested struct in vpc response +type NatGateway struct { + NatGatewayId string `json:"NatGatewayId" xml:"NatGatewayId"` + RegionId string `json:"RegionId" xml:"RegionId"` + Name string `json:"Name" xml:"Name"` + Description string `json:"Description" xml:"Description"` + VpcId string `json:"VpcId" xml:"VpcId"` + Spec string `json:"Spec" xml:"Spec"` + InstanceChargeType string `json:"InstanceChargeType" xml:"InstanceChargeType"` + ExpiredTime string `json:"ExpiredTime" xml:"ExpiredTime"` + AutoPay bool `json:"AutoPay" xml:"AutoPay"` + BusinessStatus string `json:"BusinessStatus" xml:"BusinessStatus"` + CreationTime string `json:"CreationTime" xml:"CreationTime"` + Status string `json:"Status" xml:"Status"` + ForwardTableIds ForwardTableIdsInDescribeNatGateways `json:"ForwardTableIds" xml:"ForwardTableIds"` + SnatTableIds SnatTableIdsInDescribeNatGateways `json:"SnatTableIds" xml:"SnatTableIds"` + BandwidthPackageIds BandwidthPackageIdsInDescribeNatGateways `json:"BandwidthPackageIds" xml:"BandwidthPackageIds"` + IpLists IpLists `json:"IpLists" xml:"IpLists"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_nat_gateway_ids.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_nat_gateway_ids.go new file mode 100644 index 000000000..265e49966 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_nat_gateway_ids.go @@ -0,0 +1,21 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// NatGatewayIds is a nested struct in vpc response +type NatGatewayIds struct { + NatGatewayIds []string `json:"NatGatewayIds" xml:"NatGatewayIds"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_nat_gateways.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_nat_gateways.go new file mode 100644 index 000000000..2fa8689f2 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_nat_gateways.go @@ -0,0 +1,21 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// NatGateways is a nested struct in vpc response +type NatGateways struct { + NatGateway []NatGateway `json:"NatGateway" xml:"NatGateway"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_next_hop.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_next_hop.go new file mode 100644 index 000000000..8843a2ba5 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_next_hop.go @@ -0,0 +1,28 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// NextHop is a nested struct in vpc response +type NextHop struct { + NextHopType string `json:"NextHopType" xml:"NextHopType"` + NextHopId string `json:"NextHopId" xml:"NextHopId"` + Enabled int `json:"Enabled" xml:"Enabled"` + Weight int `json:"Weight" xml:"Weight"` + NextHopRegionId string `json:"NextHopRegionId" xml:"NextHopRegionId"` + NextHopOppsiteType string `json:"NextHopOppsiteType" xml:"NextHopOppsiteType"` + NextHopOppsiteInstanceId string `json:"NextHopOppsiteInstanceId" xml:"NextHopOppsiteInstanceId"` + NextHopOppsiteRegionId string `json:"NextHopOppsiteRegionId" xml:"NextHopOppsiteRegionId"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_next_hops.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_next_hops.go new file mode 100644 index 000000000..146889b20 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_next_hops.go @@ -0,0 +1,21 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// NextHops is a nested struct in vpc response +type NextHops struct { + NextHop []NextHop `json:"NextHop" xml:"NextHop"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_nqa.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_nqa.go new file mode 100644 index 000000000..45bd544c5 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_nqa.go @@ -0,0 +1,25 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// Nqa is a nested struct in vpc response +type Nqa struct { + NqaId string `json:"NqaId" xml:"NqaId"` + RegionId string `json:"RegionId" xml:"RegionId"` + Status string `json:"Status" xml:"Status"` + RouterId string `json:"RouterId" xml:"RouterId"` + DestinationIp string `json:"DestinationIp" xml:"DestinationIp"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_nqas.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_nqas.go new file mode 100644 index 000000000..509c04d43 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_nqas.go @@ -0,0 +1,21 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// Nqas is a nested struct in vpc response +type Nqas struct { + Nqa []Nqa `json:"Nqa" xml:"Nqa"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_operation_locks_in_describe_eip_addresses.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_operation_locks_in_describe_eip_addresses.go new file mode 100644 index 000000000..8b3f2ea68 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_operation_locks_in_describe_eip_addresses.go @@ -0,0 +1,21 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// OperationLocksInDescribeEipAddresses is a nested struct in vpc response +type OperationLocksInDescribeEipAddresses struct { + LockReason []LockReason `json:"LockReason" xml:"LockReason"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_operation_locks_in_describe_global_acceleration_instances.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_operation_locks_in_describe_global_acceleration_instances.go new file mode 100644 index 000000000..fd0212c12 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_operation_locks_in_describe_global_acceleration_instances.go @@ -0,0 +1,21 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// OperationLocksInDescribeGlobalAccelerationInstances is a nested struct in vpc response +type OperationLocksInDescribeGlobalAccelerationInstances struct { + LockReason []LockReason `json:"LockReason" xml:"LockReason"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_physical_connection_set.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_physical_connection_set.go new file mode 100644 index 000000000..149205c32 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_physical_connection_set.go @@ -0,0 +1,21 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// PhysicalConnectionSet is a nested struct in vpc response +type PhysicalConnectionSet struct { + PhysicalConnectionType []PhysicalConnectionType `json:"PhysicalConnectionType" xml:"PhysicalConnectionType"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_physical_connection_type.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_physical_connection_type.go new file mode 100644 index 000000000..826f7a058 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_physical_connection_type.go @@ -0,0 +1,38 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// PhysicalConnectionType is a nested struct in vpc response +type PhysicalConnectionType struct { + PhysicalConnectionId string `json:"PhysicalConnectionId" xml:"PhysicalConnectionId"` + AccessPointId string `json:"AccessPointId" xml:"AccessPointId"` + Type string `json:"Type" xml:"Type"` + Status string `json:"Status" xml:"Status"` + BusinessStatus string `json:"BusinessStatus" xml:"BusinessStatus"` + CreationTime string `json:"CreationTime" xml:"CreationTime"` + EnabledTime string `json:"EnabledTime" xml:"EnabledTime"` + LineOperator string `json:"LineOperator" xml:"LineOperator"` + Spec string `json:"Spec" xml:"Spec"` + PeerLocation string `json:"PeerLocation" xml:"PeerLocation"` + PortType string `json:"PortType" xml:"PortType"` + RedundantPhysicalConnectionId string `json:"RedundantPhysicalConnectionId" xml:"RedundantPhysicalConnectionId"` + Name string `json:"Name" xml:"Name"` + Description string `json:"Description" xml:"Description"` + AdLocation string `json:"AdLocation" xml:"AdLocation"` + PortNumber string `json:"PortNumber" xml:"PortNumber"` + CircuitCode string `json:"CircuitCode" xml:"CircuitCode"` + Bandwidth int `json:"Bandwidth" xml:"Bandwidth"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_public_ip_address.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_public_ip_address.go new file mode 100644 index 000000000..ac542511b --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_public_ip_address.go @@ -0,0 +1,22 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// PublicIpAddress is a nested struct in vpc response +type PublicIpAddress struct { + AllocationId string `json:"AllocationId" xml:"AllocationId"` + IpAddress string `json:"IpAddress" xml:"IpAddress"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_public_ip_addresse.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_public_ip_addresse.go new file mode 100644 index 000000000..6ef5054be --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_public_ip_addresse.go @@ -0,0 +1,24 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// PublicIpAddresse is a nested struct in vpc response +type PublicIpAddresse struct { + IpAddress string `json:"IpAddress" xml:"IpAddress"` + ApAccessEnabled bool `json:"ApAccessEnabled" xml:"ApAccessEnabled"` + AllocationId string `json:"AllocationId" xml:"AllocationId"` + UsingStatus string `json:"UsingStatus" xml:"UsingStatus"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_public_ip_addresses_in_describe_bandwidth_packages.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_public_ip_addresses_in_describe_bandwidth_packages.go new file mode 100644 index 000000000..24e36d155 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_public_ip_addresses_in_describe_bandwidth_packages.go @@ -0,0 +1,21 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// PublicIpAddressesInDescribeBandwidthPackages is a nested struct in vpc response +type PublicIpAddressesInDescribeBandwidthPackages struct { + PublicIpAddresse []PublicIpAddresse `json:"PublicIpAddresse" xml:"PublicIpAddresse"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_public_ip_addresses_in_describe_common_bandwidth_packages.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_public_ip_addresses_in_describe_common_bandwidth_packages.go new file mode 100644 index 000000000..08025297e --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_public_ip_addresses_in_describe_common_bandwidth_packages.go @@ -0,0 +1,21 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// PublicIpAddressesInDescribeCommonBandwidthPackages is a nested struct in vpc response +type PublicIpAddressesInDescribeCommonBandwidthPackages struct { + PublicIpAddresse []PublicIpAddresse `json:"PublicIpAddresse" xml:"PublicIpAddresse"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_public_ip_addresses_in_describe_global_acceleration_instances.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_public_ip_addresses_in_describe_global_acceleration_instances.go new file mode 100644 index 000000000..7a6e11e63 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_public_ip_addresses_in_describe_global_acceleration_instances.go @@ -0,0 +1,21 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// PublicIpAddressesInDescribeGlobalAccelerationInstances is a nested struct in vpc response +type PublicIpAddressesInDescribeGlobalAccelerationInstances struct { + PublicIpAddress []PublicIpAddress `json:"PublicIpAddress" xml:"PublicIpAddress"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_region.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_region.go new file mode 100644 index 000000000..f75755243 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_region.go @@ -0,0 +1,23 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// Region is a nested struct in vpc 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/vpc/struct_regions.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_regions.go new file mode 100644 index 000000000..7d202b267 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_regions.go @@ -0,0 +1,21 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// Regions is a nested struct in vpc response +type Regions struct { + Region []Region `json:"Region" xml:"Region"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_route_entry.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_route_entry.go new file mode 100644 index 000000000..7478490f3 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_route_entry.go @@ -0,0 +1,32 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// RouteEntry is a nested struct in vpc response +type RouteEntry struct { + RouteTableId string `json:"RouteTableId" xml:"RouteTableId"` + DestinationCidrBlock string `json:"DestinationCidrBlock" xml:"DestinationCidrBlock"` + Type string `json:"Type" xml:"Type"` + Status string `json:"Status" xml:"Status"` + InstanceId string `json:"InstanceId" xml:"InstanceId"` + NextHopType string `json:"NextHopType" xml:"NextHopType"` + NextHopRegionId string `json:"NextHopRegionId" xml:"NextHopRegionId"` + NextHopOppsiteType string `json:"NextHopOppsiteType" xml:"NextHopOppsiteType"` + NextHopOppsiteInstanceId string `json:"NextHopOppsiteInstanceId" xml:"NextHopOppsiteInstanceId"` + NextHopOppsiteRegionId string `json:"NextHopOppsiteRegionId" xml:"NextHopOppsiteRegionId"` + PrivateIpAddress string `json:"PrivateIpAddress" xml:"PrivateIpAddress"` + NextHops NextHops `json:"NextHops" xml:"NextHops"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_route_entrys.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_route_entrys.go new file mode 100644 index 000000000..45905f77c --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_route_entrys.go @@ -0,0 +1,21 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// RouteEntrys is a nested struct in vpc response +type RouteEntrys struct { + RouteEntry []RouteEntry `json:"RouteEntry" xml:"RouteEntry"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_route_table.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_route_table.go new file mode 100644 index 000000000..c7239cbeb --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_route_table.go @@ -0,0 +1,27 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// RouteTable is a nested struct in vpc response +type RouteTable struct { + ResourceGroupId string `json:"ResourceGroupId" xml:"ResourceGroupId"` + CreationTime string `json:"CreationTime" xml:"CreationTime"` + RouteTableType string `json:"RouteTableType" xml:"RouteTableType"` + RouteTableId string `json:"RouteTableId" xml:"RouteTableId"` + VRouterId string `json:"VRouterId" xml:"VRouterId"` + VSwitchIds VSwitchIdsInDescribeRouteTables `json:"VSwitchIds" xml:"VSwitchIds"` + RouteEntrys RouteEntrys `json:"RouteEntrys" xml:"RouteEntrys"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_route_table_ids.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_route_table_ids.go new file mode 100644 index 000000000..44d73fb69 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_route_table_ids.go @@ -0,0 +1,21 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// RouteTableIds is a nested struct in vpc response +type RouteTableIds struct { + RouteTableId []string `json:"RouteTableId" xml:"RouteTableId"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_route_tables.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_route_tables.go new file mode 100644 index 000000000..020a5d754 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_route_tables.go @@ -0,0 +1,21 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// RouteTables is a nested struct in vpc response +type RouteTables struct { + RouteTable []RouteTable `json:"RouteTable" xml:"RouteTable"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_router_interface_set.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_router_interface_set.go new file mode 100644 index 000000000..29f36a7d6 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_router_interface_set.go @@ -0,0 +1,21 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// RouterInterfaceSet is a nested struct in vpc response +type RouterInterfaceSet struct { + RouterInterfaceType []RouterInterfaceType `json:"RouterInterfaceType" xml:"RouterInterfaceType"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_router_interface_type.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_router_interface_type.go new file mode 100644 index 000000000..70c1b0f88 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_router_interface_type.go @@ -0,0 +1,57 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// RouterInterfaceType is a nested struct in vpc response +type RouterInterfaceType struct { + RouterInterfaceId string `json:"RouterInterfaceId" xml:"RouterInterfaceId"` + OppositeRegionId string `json:"OppositeRegionId" xml:"OppositeRegionId"` + Role string `json:"Role" xml:"Role"` + Spec string `json:"Spec" xml:"Spec"` + Name string `json:"Name" xml:"Name"` + Description string `json:"Description" xml:"Description"` + RouterId string `json:"RouterId" xml:"RouterId"` + RouterType string `json:"RouterType" xml:"RouterType"` + CreationTime string `json:"CreationTime" xml:"CreationTime"` + EndTime string `json:"EndTime" xml:"EndTime"` + ChargeType string `json:"ChargeType" xml:"ChargeType"` + Status string `json:"Status" xml:"Status"` + BusinessStatus string `json:"BusinessStatus" xml:"BusinessStatus"` + ConnectedTime string `json:"ConnectedTime" xml:"ConnectedTime"` + OppositeInterfaceId string `json:"OppositeInterfaceId" xml:"OppositeInterfaceId"` + OppositeInterfaceSpec string `json:"OppositeInterfaceSpec" xml:"OppositeInterfaceSpec"` + OppositeInterfaceStatus string `json:"OppositeInterfaceStatus" xml:"OppositeInterfaceStatus"` + OppositeInterfaceBusinessStatus string `json:"OppositeInterfaceBusinessStatus" xml:"OppositeInterfaceBusinessStatus"` + OppositeRouterId string `json:"OppositeRouterId" xml:"OppositeRouterId"` + OppositeRouterType string `json:"OppositeRouterType" xml:"OppositeRouterType"` + OppositeInterfaceOwnerId string `json:"OppositeInterfaceOwnerId" xml:"OppositeInterfaceOwnerId"` + AccessPointId string `json:"AccessPointId" xml:"AccessPointId"` + OppositeAccessPointId string `json:"OppositeAccessPointId" xml:"OppositeAccessPointId"` + HealthCheckSourceIp string `json:"HealthCheckSourceIp" xml:"HealthCheckSourceIp"` + HealthCheckTargetIp string `json:"HealthCheckTargetIp" xml:"HealthCheckTargetIp"` + OppositeVpcInstanceId string `json:"OppositeVpcInstanceId" xml:"OppositeVpcInstanceId"` + Bandwidth int `json:"Bandwidth" xml:"Bandwidth"` + VpcInstanceId string `json:"VpcInstanceId" xml:"VpcInstanceId"` + OppositeBandwidth int `json:"OppositeBandwidth" xml:"OppositeBandwidth"` + HasReservationData string `json:"HasReservationData" xml:"HasReservationData"` + ReservationBandwidth string `json:"ReservationBandwidth" xml:"ReservationBandwidth"` + ReservationInternetChargeType string `json:"ReservationInternetChargeType" xml:"ReservationInternetChargeType"` + ReservationActiveTime string `json:"ReservationActiveTime" xml:"ReservationActiveTime"` + ReservationOrderType string `json:"ReservationOrderType" xml:"ReservationOrderType"` + CrossBorder bool `json:"CrossBorder" xml:"CrossBorder"` + HcThreshold int `json:"HcThreshold" xml:"HcThreshold"` + HcRate int `json:"HcRate" xml:"HcRate"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_router_table_ids.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_router_table_ids.go new file mode 100644 index 000000000..8c9e9e7eb --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_router_table_ids.go @@ -0,0 +1,21 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// RouterTableIds is a nested struct in vpc response +type RouterTableIds struct { + RouterTableIds []string `json:"RouterTableIds" xml:"RouterTableIds"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_router_table_list.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_router_table_list.go new file mode 100644 index 000000000..bebbfe826 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_router_table_list.go @@ -0,0 +1,21 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// RouterTableList is a nested struct in vpc response +type RouterTableList struct { + RouterTableListType []RouterTableListType `json:"RouterTableListType" xml:"RouterTableListType"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_router_table_list_type.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_router_table_list_type.go new file mode 100644 index 000000000..e0ff9eb61 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_router_table_list_type.go @@ -0,0 +1,31 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// RouterTableListType is a nested struct in vpc response +type RouterTableListType struct { + VpcId string `json:"VpcId" xml:"VpcId"` + RouterType string `json:"RouterType" xml:"RouterType"` + RouterId string `json:"RouterId" xml:"RouterId"` + RouteTableId string `json:"RouteTableId" xml:"RouteTableId"` + RouteTableName string `json:"RouteTableName" xml:"RouteTableName"` + RouteTableType string `json:"RouteTableType" xml:"RouteTableType"` + Description string `json:"Description" xml:"Description"` + ResourceGroupId string `json:"ResourceGroupId" xml:"ResourceGroupId"` + CreationTime string `json:"CreationTime" xml:"CreationTime"` + VSwitchIds VSwitchIdsInDescribeRouteTableList `json:"VSwitchIds" xml:"VSwitchIds"` + Tags TagsInDescribeRouteTableList `json:"Tags" xml:"Tags"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_snat_table_entries.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_snat_table_entries.go new file mode 100644 index 000000000..c14837b96 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_snat_table_entries.go @@ -0,0 +1,21 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// SnatTableEntries is a nested struct in vpc response +type SnatTableEntries struct { + SnatTableEntry []SnatTableEntry `json:"SnatTableEntry" xml:"SnatTableEntry"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_snat_table_entry.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_snat_table_entry.go new file mode 100644 index 000000000..545c910b6 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_snat_table_entry.go @@ -0,0 +1,27 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// SnatTableEntry is a nested struct in vpc response +type SnatTableEntry struct { + SnatTableId string `json:"SnatTableId" xml:"SnatTableId"` + SnatEntryId string `json:"SnatEntryId" xml:"SnatEntryId"` + SourceVSwitchId string `json:"SourceVSwitchId" xml:"SourceVSwitchId"` + SourceCIDR string `json:"SourceCIDR" xml:"SourceCIDR"` + SnatIp string `json:"SnatIp" xml:"SnatIp"` + Status string `json:"Status" xml:"Status"` + SnatEntryName string `json:"SnatEntryName" xml:"SnatEntryName"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_snat_table_ids_in_create_nat_gateway.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_snat_table_ids_in_create_nat_gateway.go new file mode 100644 index 000000000..d01736036 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_snat_table_ids_in_create_nat_gateway.go @@ -0,0 +1,21 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// SnatTableIdsInCreateNatGateway is a nested struct in vpc response +type SnatTableIdsInCreateNatGateway struct { + SnatTableId []string `json:"SnatTableId" xml:"SnatTableId"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_snat_table_ids_in_describe_nat_gateways.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_snat_table_ids_in_describe_nat_gateways.go new file mode 100644 index 000000000..f59bbde8a --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_snat_table_ids_in_describe_nat_gateways.go @@ -0,0 +1,21 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// SnatTableIdsInDescribeNatGateways is a nested struct in vpc response +type SnatTableIdsInDescribeNatGateways struct { + SnatTableId []string `json:"SnatTableId" xml:"SnatTableId"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_ssl_vpn_client_cert_key.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_ssl_vpn_client_cert_key.go new file mode 100644 index 000000000..35f768b6f --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_ssl_vpn_client_cert_key.go @@ -0,0 +1,27 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// SslVpnClientCertKey is a nested struct in vpc response +type SslVpnClientCertKey struct { + RegionId string `json:"RegionId" xml:"RegionId"` + SslVpnClientCertId string `json:"SslVpnClientCertId" xml:"SslVpnClientCertId"` + Name string `json:"Name" xml:"Name"` + SslVpnServerId string `json:"SslVpnServerId" xml:"SslVpnServerId"` + CreateTime int `json:"CreateTime" xml:"CreateTime"` + EndTime int `json:"EndTime" xml:"EndTime"` + Status string `json:"Status" xml:"Status"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_ssl_vpn_client_cert_keys.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_ssl_vpn_client_cert_keys.go new file mode 100644 index 000000000..fdd5f642b --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_ssl_vpn_client_cert_keys.go @@ -0,0 +1,21 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// SslVpnClientCertKeys is a nested struct in vpc response +type SslVpnClientCertKeys struct { + SslVpnClientCertKey []SslVpnClientCertKey `json:"SslVpnClientCertKey" xml:"SslVpnClientCertKey"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_ssl_vpn_server.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_ssl_vpn_server.go new file mode 100644 index 000000000..2f0eb9c69 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_ssl_vpn_server.go @@ -0,0 +1,34 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// SslVpnServer is a nested struct in vpc response +type SslVpnServer struct { + RegionId string `json:"RegionId" xml:"RegionId"` + SslVpnServerId string `json:"SslVpnServerId" xml:"SslVpnServerId"` + VpnGatewayId string `json:"VpnGatewayId" xml:"VpnGatewayId"` + Name string `json:"Name" xml:"Name"` + LocalSubnet string `json:"LocalSubnet" xml:"LocalSubnet"` + ClientIpPool string `json:"ClientIpPool" xml:"ClientIpPool"` + CreateTime int `json:"CreateTime" xml:"CreateTime"` + Cipher string `json:"Cipher" xml:"Cipher"` + Proto string `json:"Proto" xml:"Proto"` + Port int `json:"Port" xml:"Port"` + Compress bool `json:"Compress" xml:"Compress"` + Connections int `json:"Connections" xml:"Connections"` + MaxConnections int `json:"MaxConnections" xml:"MaxConnections"` + InternetIp string `json:"InternetIp" xml:"InternetIp"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_ssl_vpn_servers.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_ssl_vpn_servers.go new file mode 100644 index 000000000..67216845c --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_ssl_vpn_servers.go @@ -0,0 +1,21 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// SslVpnServers is a nested struct in vpc response +type SslVpnServers struct { + SslVpnServer []SslVpnServer `json:"SslVpnServer" xml:"SslVpnServer"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_tag.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_tag.go new file mode 100644 index 000000000..49e6294cf --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_tag.go @@ -0,0 +1,22 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// Tag is a nested struct in vpc response +type Tag struct { + Key string `json:"Key" xml:"Key"` + Value string `json:"Value" xml:"Value"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_tags_in_describe_eip_addresses.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_tags_in_describe_eip_addresses.go new file mode 100644 index 000000000..2ac6cff40 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_tags_in_describe_eip_addresses.go @@ -0,0 +1,21 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// TagsInDescribeEipAddresses is a nested struct in vpc response +type TagsInDescribeEipAddresses struct { + Tag []Tag `json:"Tag" xml:"Tag"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_tags_in_describe_route_table_list.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_tags_in_describe_route_table_list.go new file mode 100644 index 000000000..1bff14827 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_tags_in_describe_route_table_list.go @@ -0,0 +1,21 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// TagsInDescribeRouteTableList is a nested struct in vpc response +type TagsInDescribeRouteTableList struct { + Tag []Tag `json:"Tag" xml:"Tag"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_tags_in_describe_v_switches.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_tags_in_describe_v_switches.go new file mode 100644 index 000000000..03f365df6 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_tags_in_describe_v_switches.go @@ -0,0 +1,21 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// TagsInDescribeVSwitches is a nested struct in vpc response +type TagsInDescribeVSwitches struct { + Tag []Tag `json:"Tag" xml:"Tag"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_tags_in_describe_vpcs.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_tags_in_describe_vpcs.go new file mode 100644 index 000000000..3a70dd359 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_tags_in_describe_vpcs.go @@ -0,0 +1,21 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// TagsInDescribeVpcs is a nested struct in vpc response +type TagsInDescribeVpcs struct { + Tag []Tag `json:"Tag" xml:"Tag"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_user_cidrs_in_describe_vpc_attribute.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_user_cidrs_in_describe_vpc_attribute.go new file mode 100644 index 000000000..248fb2feb --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_user_cidrs_in_describe_vpc_attribute.go @@ -0,0 +1,21 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// UserCidrsInDescribeVpcAttribute is a nested struct in vpc response +type UserCidrsInDescribeVpcAttribute struct { + UserCidr []string `json:"UserCidr" xml:"UserCidr"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_user_cidrs_in_describe_vpcs.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_user_cidrs_in_describe_vpcs.go new file mode 100644 index 000000000..84f135a65 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_user_cidrs_in_describe_vpcs.go @@ -0,0 +1,21 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// UserCidrsInDescribeVpcs is a nested struct in vpc response +type UserCidrsInDescribeVpcs struct { + UserCidr []string `json:"UserCidr" xml:"UserCidr"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_v_router.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_v_router.go new file mode 100644 index 000000000..e681e4702 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_v_router.go @@ -0,0 +1,27 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// VRouter is a nested struct in vpc response +type VRouter struct { + RegionId string `json:"RegionId" xml:"RegionId"` + VpcId string `json:"VpcId" xml:"VpcId"` + VRouterName string `json:"VRouterName" xml:"VRouterName"` + Description string `json:"Description" xml:"Description"` + VRouterId string `json:"VRouterId" xml:"VRouterId"` + CreationTime string `json:"CreationTime" xml:"CreationTime"` + RouteTableIds RouteTableIds `json:"RouteTableIds" xml:"RouteTableIds"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_v_routers.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_v_routers.go new file mode 100644 index 000000000..a7504b623 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_v_routers.go @@ -0,0 +1,21 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// VRouters is a nested struct in vpc response +type VRouters struct { + VRouter []VRouter `json:"VRouter" xml:"VRouter"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_v_switch.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_v_switch.go new file mode 100644 index 000000000..e9010220e --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_v_switch.go @@ -0,0 +1,34 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// VSwitch is a nested struct in vpc response +type VSwitch struct { + VSwitchId string `json:"VSwitchId" xml:"VSwitchId"` + VpcId string `json:"VpcId" xml:"VpcId"` + Status string `json:"Status" xml:"Status"` + CidrBlock string `json:"CidrBlock" xml:"CidrBlock"` + Ipv6CidrBlock string `json:"Ipv6CidrBlock" xml:"Ipv6CidrBlock"` + ZoneId string `json:"ZoneId" xml:"ZoneId"` + AvailableIpAddressCount int `json:"AvailableIpAddressCount" xml:"AvailableIpAddressCount"` + Description string `json:"Description" xml:"Description"` + VSwitchName string `json:"VSwitchName" xml:"VSwitchName"` + CreationTime string `json:"CreationTime" xml:"CreationTime"` + IsDefault bool `json:"IsDefault" xml:"IsDefault"` + ResourceGroupId string `json:"ResourceGroupId" xml:"ResourceGroupId"` + RouteTable RouteTable `json:"RouteTable" xml:"RouteTable"` + Tags TagsInDescribeVSwitches `json:"Tags" xml:"Tags"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_v_switch_ids_in_describe_route_table_list.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_v_switch_ids_in_describe_route_table_list.go new file mode 100644 index 000000000..3996e0ab4 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_v_switch_ids_in_describe_route_table_list.go @@ -0,0 +1,21 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// VSwitchIdsInDescribeRouteTableList is a nested struct in vpc response +type VSwitchIdsInDescribeRouteTableList struct { + VSwitchId []string `json:"VSwitchId" xml:"VSwitchId"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_v_switch_ids_in_describe_route_tables.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_v_switch_ids_in_describe_route_tables.go new file mode 100644 index 000000000..43c13d3d5 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_v_switch_ids_in_describe_route_tables.go @@ -0,0 +1,21 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// VSwitchIdsInDescribeRouteTables is a nested struct in vpc response +type VSwitchIdsInDescribeRouteTables struct { + VSwitchId []string `json:"VSwitchId" xml:"VSwitchId"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_v_switch_ids_in_describe_vpc_attribute.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_v_switch_ids_in_describe_vpc_attribute.go new file mode 100644 index 000000000..6a7532a57 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_v_switch_ids_in_describe_vpc_attribute.go @@ -0,0 +1,21 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// VSwitchIdsInDescribeVpcAttribute is a nested struct in vpc response +type VSwitchIdsInDescribeVpcAttribute struct { + VSwitchId []string `json:"VSwitchId" xml:"VSwitchId"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_v_switch_ids_in_describe_vpcs.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_v_switch_ids_in_describe_vpcs.go new file mode 100644 index 000000000..4b221f36a --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_v_switch_ids_in_describe_vpcs.go @@ -0,0 +1,21 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// VSwitchIdsInDescribeVpcs is a nested struct in vpc response +type VSwitchIdsInDescribeVpcs struct { + VSwitchId []string `json:"VSwitchId" xml:"VSwitchId"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_v_switches.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_v_switches.go new file mode 100644 index 000000000..7948484bc --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_v_switches.go @@ -0,0 +1,21 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// VSwitches is a nested struct in vpc response +type VSwitches struct { + VSwitch []VSwitch `json:"VSwitch" xml:"VSwitch"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_virtual_border_router_for_physical_connection_set.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_virtual_border_router_for_physical_connection_set.go new file mode 100644 index 000000000..ad594273a --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_virtual_border_router_for_physical_connection_set.go @@ -0,0 +1,21 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// VirtualBorderRouterForPhysicalConnectionSet is a nested struct in vpc response +type VirtualBorderRouterForPhysicalConnectionSet struct { + VirtualBorderRouterForPhysicalConnectionType []VirtualBorderRouterForPhysicalConnectionType `json:"VirtualBorderRouterForPhysicalConnectionType" xml:"VirtualBorderRouterForPhysicalConnectionType"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_virtual_border_router_for_physical_connection_type.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_virtual_border_router_for_physical_connection_type.go new file mode 100644 index 000000000..cc27c57f8 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_virtual_border_router_for_physical_connection_type.go @@ -0,0 +1,31 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// VirtualBorderRouterForPhysicalConnectionType is a nested struct in vpc response +type VirtualBorderRouterForPhysicalConnectionType struct { + VbrId string `json:"VbrId" xml:"VbrId"` + VbrOwnerUid int `json:"VbrOwnerUid" xml:"VbrOwnerUid"` + CreationTime string `json:"CreationTime" xml:"CreationTime"` + ActivationTime string `json:"ActivationTime" xml:"ActivationTime"` + TerminationTime string `json:"TerminationTime" xml:"TerminationTime"` + RecoveryTime string `json:"RecoveryTime" xml:"RecoveryTime"` + VlanId int `json:"VlanId" xml:"VlanId"` + CircuitCode string `json:"CircuitCode" xml:"CircuitCode"` + LocalGatewayIp string `json:"LocalGatewayIp" xml:"LocalGatewayIp"` + PeerGatewayIp string `json:"PeerGatewayIp" xml:"PeerGatewayIp"` + PeeringSubnetMask string `json:"PeeringSubnetMask" xml:"PeeringSubnetMask"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_virtual_border_router_set.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_virtual_border_router_set.go new file mode 100644 index 000000000..b849c05be --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_virtual_border_router_set.go @@ -0,0 +1,21 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// VirtualBorderRouterSet is a nested struct in vpc response +type VirtualBorderRouterSet struct { + VirtualBorderRouterType []VirtualBorderRouterType `json:"VirtualBorderRouterType" xml:"VirtualBorderRouterType"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_virtual_border_router_type.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_virtual_border_router_type.go new file mode 100644 index 000000000..b72df18f6 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_virtual_border_router_type.go @@ -0,0 +1,42 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// VirtualBorderRouterType is a nested struct in vpc response +type VirtualBorderRouterType struct { + VbrId string `json:"VbrId" xml:"VbrId"` + CreationTime string `json:"CreationTime" xml:"CreationTime"` + ActivationTime string `json:"ActivationTime" xml:"ActivationTime"` + TerminationTime string `json:"TerminationTime" xml:"TerminationTime"` + RecoveryTime string `json:"RecoveryTime" xml:"RecoveryTime"` + Status string `json:"Status" xml:"Status"` + VlanId int `json:"VlanId" xml:"VlanId"` + CircuitCode string `json:"CircuitCode" xml:"CircuitCode"` + RouteTableId string `json:"RouteTableId" xml:"RouteTableId"` + VlanInterfaceId string `json:"VlanInterfaceId" xml:"VlanInterfaceId"` + LocalGatewayIp string `json:"LocalGatewayIp" xml:"LocalGatewayIp"` + PeerGatewayIp string `json:"PeerGatewayIp" xml:"PeerGatewayIp"` + PeeringSubnetMask string `json:"PeeringSubnetMask" xml:"PeeringSubnetMask"` + PhysicalConnectionId string `json:"PhysicalConnectionId" xml:"PhysicalConnectionId"` + PhysicalConnectionStatus string `json:"PhysicalConnectionStatus" xml:"PhysicalConnectionStatus"` + PhysicalConnectionBusinessStatus string `json:"PhysicalConnectionBusinessStatus" xml:"PhysicalConnectionBusinessStatus"` + PhysicalConnectionOwnerUid string `json:"PhysicalConnectionOwnerUid" xml:"PhysicalConnectionOwnerUid"` + AccessPointId string `json:"AccessPointId" xml:"AccessPointId"` + Name string `json:"Name" xml:"Name"` + Description string `json:"Description" xml:"Description"` + AssociatedPhysicalConnections AssociatedPhysicalConnections `json:"AssociatedPhysicalConnections" xml:"AssociatedPhysicalConnections"` + AssociatedCens AssociatedCensInDescribeVirtualBorderRouters `json:"AssociatedCens" xml:"AssociatedCens"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_vpc.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_vpc.go new file mode 100644 index 000000000..651bf364a --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_vpc.go @@ -0,0 +1,36 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// Vpc is a nested struct in vpc response +type Vpc struct { + VpcId string `json:"VpcId" xml:"VpcId"` + RegionId string `json:"RegionId" xml:"RegionId"` + Status string `json:"Status" xml:"Status"` + VpcName string `json:"VpcName" xml:"VpcName"` + CreationTime string `json:"CreationTime" xml:"CreationTime"` + CidrBlock string `json:"CidrBlock" xml:"CidrBlock"` + Ipv6CidrBlock string `json:"Ipv6CidrBlock" xml:"Ipv6CidrBlock"` + VRouterId string `json:"VRouterId" xml:"VRouterId"` + Description string `json:"Description" xml:"Description"` + IsDefault bool `json:"IsDefault" xml:"IsDefault"` + ResourceGroupId string `json:"ResourceGroupId" xml:"ResourceGroupId"` + VSwitchIds VSwitchIdsInDescribeVpcs `json:"VSwitchIds" xml:"VSwitchIds"` + UserCidrs UserCidrsInDescribeVpcs `json:"UserCidrs" xml:"UserCidrs"` + NatGatewayIds NatGatewayIds `json:"NatGatewayIds" xml:"NatGatewayIds"` + RouterTableIds RouterTableIds `json:"RouterTableIds" xml:"RouterTableIds"` + Tags TagsInDescribeVpcs `json:"Tags" xml:"Tags"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_vpcs.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_vpcs.go new file mode 100644 index 000000000..b85bdc5b4 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_vpcs.go @@ -0,0 +1,21 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// Vpcs is a nested struct in vpc response +type Vpcs struct { + Vpc []Vpc `json:"Vpc" xml:"Vpc"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_vpn_connection.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_vpn_connection.go new file mode 100644 index 000000000..d1bc912c1 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_vpn_connection.go @@ -0,0 +1,31 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// VpnConnection is a nested struct in vpc response +type VpnConnection struct { + VpnConnectionId string `json:"VpnConnectionId" xml:"VpnConnectionId"` + CustomerGatewayId string `json:"CustomerGatewayId" xml:"CustomerGatewayId"` + VpnGatewayId string `json:"VpnGatewayId" xml:"VpnGatewayId"` + Name string `json:"Name" xml:"Name"` + LocalSubnet string `json:"LocalSubnet" xml:"LocalSubnet"` + RemoteSubnet string `json:"RemoteSubnet" xml:"RemoteSubnet"` + CreateTime int `json:"CreateTime" xml:"CreateTime"` + EffectImmediately bool `json:"EffectImmediately" xml:"EffectImmediately"` + Status string `json:"Status" xml:"Status"` + IkeConfig IkeConfig `json:"IkeConfig" xml:"IkeConfig"` + IpsecConfig IpsecConfig `json:"IpsecConfig" xml:"IpsecConfig"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_vpn_connection_config.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_vpn_connection_config.go new file mode 100644 index 000000000..accc63c37 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_vpn_connection_config.go @@ -0,0 +1,26 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// VpnConnectionConfig is a nested struct in vpc response +type VpnConnectionConfig struct { + LocalSubnet string `json:"LocalSubnet" xml:"LocalSubnet"` + RemoteSubnet string `json:"RemoteSubnet" xml:"RemoteSubnet"` + Local string `json:"Local" xml:"Local"` + Remote string `json:"Remote" xml:"Remote"` + IkeConfig IkeConfig `json:"IkeConfig" xml:"IkeConfig"` + IpsecConfig IpsecConfig `json:"IpsecConfig" xml:"IpsecConfig"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_vpn_connections.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_vpn_connections.go new file mode 100644 index 000000000..b33443be5 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_vpn_connections.go @@ -0,0 +1,21 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// VpnConnections is a nested struct in vpc response +type VpnConnections struct { + VpnConnection []VpnConnection `json:"VpnConnection" xml:"VpnConnection"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_vpn_gateway.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_vpn_gateway.go new file mode 100644 index 000000000..657eb2905 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_vpn_gateway.go @@ -0,0 +1,35 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// VpnGateway is a nested struct in vpc response +type VpnGateway struct { + VpnGatewayId string `json:"VpnGatewayId" xml:"VpnGatewayId"` + VpcId string `json:"VpcId" xml:"VpcId"` + VSwitchId string `json:"VSwitchId" xml:"VSwitchId"` + InternetIp string `json:"InternetIp" xml:"InternetIp"` + CreateTime int `json:"CreateTime" xml:"CreateTime"` + EndTime int `json:"EndTime" xml:"EndTime"` + Spec string `json:"Spec" xml:"Spec"` + Name string `json:"Name" xml:"Name"` + Description string `json:"Description" xml:"Description"` + Status string `json:"Status" xml:"Status"` + BusinessStatus string `json:"BusinessStatus" xml:"BusinessStatus"` + ChargeType string `json:"ChargeType" xml:"ChargeType"` + IpsecVpn string `json:"IpsecVpn" xml:"IpsecVpn"` + SslVpn string `json:"SslVpn" xml:"SslVpn"` + SslMaxConnections int `json:"SslMaxConnections" xml:"SslMaxConnections"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_vpn_gateways.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_vpn_gateways.go new file mode 100644 index 000000000..98c3fb625 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_vpn_gateways.go @@ -0,0 +1,21 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// VpnGateways is a nested struct in vpc response +type VpnGateways struct { + VpnGateway []VpnGateway `json:"VpnGateway" xml:"VpnGateway"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_zone.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_zone.go new file mode 100644 index 000000000..bc9ded0e2 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_zone.go @@ -0,0 +1,22 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// Zone is a nested struct in vpc response +type Zone 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/vpc/struct_zones.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_zones.go new file mode 100644 index 000000000..c61fe8728 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/struct_zones.go @@ -0,0 +1,21 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// Zones is a nested struct in vpc response +type Zones struct { + Zone []Zone `json:"Zone" xml:"Zone"` +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/terminate_physical_connection.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/terminate_physical_connection.go new file mode 100644 index 000000000..c9814d90c --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/terminate_physical_connection.go @@ -0,0 +1,108 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// TerminatePhysicalConnection invokes the vpc.TerminatePhysicalConnection API synchronously +// api document: https://help.aliyun.com/api/vpc/terminatephysicalconnection.html +func (client *Client) TerminatePhysicalConnection(request *TerminatePhysicalConnectionRequest) (response *TerminatePhysicalConnectionResponse, err error) { + response = CreateTerminatePhysicalConnectionResponse() + err = client.DoAction(request, response) + return +} + +// TerminatePhysicalConnectionWithChan invokes the vpc.TerminatePhysicalConnection API asynchronously +// api document: https://help.aliyun.com/api/vpc/terminatephysicalconnection.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) TerminatePhysicalConnectionWithChan(request *TerminatePhysicalConnectionRequest) (<-chan *TerminatePhysicalConnectionResponse, <-chan error) { + responseChan := make(chan *TerminatePhysicalConnectionResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.TerminatePhysicalConnection(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// TerminatePhysicalConnectionWithCallback invokes the vpc.TerminatePhysicalConnection API asynchronously +// api document: https://help.aliyun.com/api/vpc/terminatephysicalconnection.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) TerminatePhysicalConnectionWithCallback(request *TerminatePhysicalConnectionRequest, callback func(response *TerminatePhysicalConnectionResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *TerminatePhysicalConnectionResponse + var err error + defer close(result) + response, err = client.TerminatePhysicalConnection(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// TerminatePhysicalConnectionRequest is the request struct for api TerminatePhysicalConnection +type TerminatePhysicalConnectionRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + ClientToken string `position:"Query" name:"ClientToken"` + PhysicalConnectionId string `position:"Query" name:"PhysicalConnectionId"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// TerminatePhysicalConnectionResponse is the response struct for api TerminatePhysicalConnection +type TerminatePhysicalConnectionResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateTerminatePhysicalConnectionRequest creates a request to invoke TerminatePhysicalConnection API +func CreateTerminatePhysicalConnectionRequest() (request *TerminatePhysicalConnectionRequest) { + request = &TerminatePhysicalConnectionRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "TerminatePhysicalConnection", "vpc", "openAPI") + return +} + +// CreateTerminatePhysicalConnectionResponse creates a response to parse from TerminatePhysicalConnection response +func CreateTerminatePhysicalConnectionResponse() (response *TerminatePhysicalConnectionResponse) { + response = &TerminatePhysicalConnectionResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/terminate_virtual_border_router.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/terminate_virtual_border_router.go new file mode 100644 index 000000000..ec0a95f3a --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/terminate_virtual_border_router.go @@ -0,0 +1,108 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// TerminateVirtualBorderRouter invokes the vpc.TerminateVirtualBorderRouter API synchronously +// api document: https://help.aliyun.com/api/vpc/terminatevirtualborderrouter.html +func (client *Client) TerminateVirtualBorderRouter(request *TerminateVirtualBorderRouterRequest) (response *TerminateVirtualBorderRouterResponse, err error) { + response = CreateTerminateVirtualBorderRouterResponse() + err = client.DoAction(request, response) + return +} + +// TerminateVirtualBorderRouterWithChan invokes the vpc.TerminateVirtualBorderRouter API asynchronously +// api document: https://help.aliyun.com/api/vpc/terminatevirtualborderrouter.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) TerminateVirtualBorderRouterWithChan(request *TerminateVirtualBorderRouterRequest) (<-chan *TerminateVirtualBorderRouterResponse, <-chan error) { + responseChan := make(chan *TerminateVirtualBorderRouterResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.TerminateVirtualBorderRouter(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// TerminateVirtualBorderRouterWithCallback invokes the vpc.TerminateVirtualBorderRouter API asynchronously +// api document: https://help.aliyun.com/api/vpc/terminatevirtualborderrouter.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) TerminateVirtualBorderRouterWithCallback(request *TerminateVirtualBorderRouterRequest, callback func(response *TerminateVirtualBorderRouterResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *TerminateVirtualBorderRouterResponse + var err error + defer close(result) + response, err = client.TerminateVirtualBorderRouter(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// TerminateVirtualBorderRouterRequest is the request struct for api TerminateVirtualBorderRouter +type TerminateVirtualBorderRouterRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + ClientToken string `position:"Query" name:"ClientToken"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + VbrId string `position:"Query" name:"VbrId"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// TerminateVirtualBorderRouterResponse is the response struct for api TerminateVirtualBorderRouter +type TerminateVirtualBorderRouterResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateTerminateVirtualBorderRouterRequest creates a request to invoke TerminateVirtualBorderRouter API +func CreateTerminateVirtualBorderRouterRequest() (request *TerminateVirtualBorderRouterRequest) { + request = &TerminateVirtualBorderRouterRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "TerminateVirtualBorderRouter", "vpc", "openAPI") + return +} + +// CreateTerminateVirtualBorderRouterResponse creates a response to parse from TerminateVirtualBorderRouter response +func CreateTerminateVirtualBorderRouterResponse() (response *TerminateVirtualBorderRouterResponse) { + response = &TerminateVirtualBorderRouterResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/unassociate_eip_address.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/unassociate_eip_address.go new file mode 100644 index 000000000..f708a4d7d --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/unassociate_eip_address.go @@ -0,0 +1,111 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// UnassociateEipAddress invokes the vpc.UnassociateEipAddress API synchronously +// api document: https://help.aliyun.com/api/vpc/unassociateeipaddress.html +func (client *Client) UnassociateEipAddress(request *UnassociateEipAddressRequest) (response *UnassociateEipAddressResponse, err error) { + response = CreateUnassociateEipAddressResponse() + err = client.DoAction(request, response) + return +} + +// UnassociateEipAddressWithChan invokes the vpc.UnassociateEipAddress API asynchronously +// api document: https://help.aliyun.com/api/vpc/unassociateeipaddress.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) UnassociateEipAddressWithChan(request *UnassociateEipAddressRequest) (<-chan *UnassociateEipAddressResponse, <-chan error) { + responseChan := make(chan *UnassociateEipAddressResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.UnassociateEipAddress(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// UnassociateEipAddressWithCallback invokes the vpc.UnassociateEipAddress API asynchronously +// api document: https://help.aliyun.com/api/vpc/unassociateeipaddress.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) UnassociateEipAddressWithCallback(request *UnassociateEipAddressRequest, callback func(response *UnassociateEipAddressResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *UnassociateEipAddressResponse + var err error + defer close(result) + response, err = client.UnassociateEipAddress(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// UnassociateEipAddressRequest is the request struct for api UnassociateEipAddress +type UnassociateEipAddressRequest struct { + *requests.RpcRequest + PrivateIpAddress string `position:"Query" name:"PrivateIpAddress"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + InstanceId string `position:"Query" name:"InstanceId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + InstanceType string `position:"Query" name:"InstanceType"` + Force requests.Boolean `position:"Query" name:"Force"` + AllocationId string `position:"Query" name:"AllocationId"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// UnassociateEipAddressResponse is the response struct for api UnassociateEipAddress +type UnassociateEipAddressResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateUnassociateEipAddressRequest creates a request to invoke UnassociateEipAddress API +func CreateUnassociateEipAddressRequest() (request *UnassociateEipAddressRequest) { + request = &UnassociateEipAddressRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "UnassociateEipAddress", "vpc", "openAPI") + return +} + +// CreateUnassociateEipAddressResponse creates a response to parse from UnassociateEipAddress response +func CreateUnassociateEipAddressResponse() (response *UnassociateEipAddressResponse) { + response = &UnassociateEipAddressResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/unassociate_global_acceleration_instance.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/unassociate_global_acceleration_instance.go new file mode 100644 index 000000000..bfad91b6d --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/unassociate_global_acceleration_instance.go @@ -0,0 +1,108 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// UnassociateGlobalAccelerationInstance invokes the vpc.UnassociateGlobalAccelerationInstance API synchronously +// api document: https://help.aliyun.com/api/vpc/unassociateglobalaccelerationinstance.html +func (client *Client) UnassociateGlobalAccelerationInstance(request *UnassociateGlobalAccelerationInstanceRequest) (response *UnassociateGlobalAccelerationInstanceResponse, err error) { + response = CreateUnassociateGlobalAccelerationInstanceResponse() + err = client.DoAction(request, response) + return +} + +// UnassociateGlobalAccelerationInstanceWithChan invokes the vpc.UnassociateGlobalAccelerationInstance API asynchronously +// api document: https://help.aliyun.com/api/vpc/unassociateglobalaccelerationinstance.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) UnassociateGlobalAccelerationInstanceWithChan(request *UnassociateGlobalAccelerationInstanceRequest) (<-chan *UnassociateGlobalAccelerationInstanceResponse, <-chan error) { + responseChan := make(chan *UnassociateGlobalAccelerationInstanceResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.UnassociateGlobalAccelerationInstance(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// UnassociateGlobalAccelerationInstanceWithCallback invokes the vpc.UnassociateGlobalAccelerationInstance API asynchronously +// api document: https://help.aliyun.com/api/vpc/unassociateglobalaccelerationinstance.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) UnassociateGlobalAccelerationInstanceWithCallback(request *UnassociateGlobalAccelerationInstanceRequest, callback func(response *UnassociateGlobalAccelerationInstanceResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *UnassociateGlobalAccelerationInstanceResponse + var err error + defer close(result) + response, err = client.UnassociateGlobalAccelerationInstance(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// UnassociateGlobalAccelerationInstanceRequest is the request struct for api UnassociateGlobalAccelerationInstance +type UnassociateGlobalAccelerationInstanceRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + InstanceType string `position:"Query" name:"InstanceType"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + GlobalAccelerationInstanceId string `position:"Query" name:"GlobalAccelerationInstanceId"` +} + +// UnassociateGlobalAccelerationInstanceResponse is the response struct for api UnassociateGlobalAccelerationInstance +type UnassociateGlobalAccelerationInstanceResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateUnassociateGlobalAccelerationInstanceRequest creates a request to invoke UnassociateGlobalAccelerationInstance API +func CreateUnassociateGlobalAccelerationInstanceRequest() (request *UnassociateGlobalAccelerationInstanceRequest) { + request = &UnassociateGlobalAccelerationInstanceRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "UnassociateGlobalAccelerationInstance", "vpc", "openAPI") + return +} + +// CreateUnassociateGlobalAccelerationInstanceResponse creates a response to parse from UnassociateGlobalAccelerationInstance response +func CreateUnassociateGlobalAccelerationInstanceResponse() (response *UnassociateGlobalAccelerationInstanceResponse) { + response = &UnassociateGlobalAccelerationInstanceResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/unassociate_ha_vip.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/unassociate_ha_vip.go new file mode 100644 index 000000000..168d17c3e --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/unassociate_ha_vip.go @@ -0,0 +1,110 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// UnassociateHaVip invokes the vpc.UnassociateHaVip API synchronously +// api document: https://help.aliyun.com/api/vpc/unassociatehavip.html +func (client *Client) UnassociateHaVip(request *UnassociateHaVipRequest) (response *UnassociateHaVipResponse, err error) { + response = CreateUnassociateHaVipResponse() + err = client.DoAction(request, response) + return +} + +// UnassociateHaVipWithChan invokes the vpc.UnassociateHaVip API asynchronously +// api document: https://help.aliyun.com/api/vpc/unassociatehavip.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) UnassociateHaVipWithChan(request *UnassociateHaVipRequest) (<-chan *UnassociateHaVipResponse, <-chan error) { + responseChan := make(chan *UnassociateHaVipResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.UnassociateHaVip(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// UnassociateHaVipWithCallback invokes the vpc.UnassociateHaVip API asynchronously +// api document: https://help.aliyun.com/api/vpc/unassociatehavip.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) UnassociateHaVipWithCallback(request *UnassociateHaVipRequest, callback func(response *UnassociateHaVipResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *UnassociateHaVipResponse + var err error + defer close(result) + response, err = client.UnassociateHaVip(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// UnassociateHaVipRequest is the request struct for api UnassociateHaVip +type UnassociateHaVipRequest struct { + *requests.RpcRequest + HaVipId string `position:"Query" name:"HaVipId"` + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + InstanceId string `position:"Query" name:"InstanceId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + ClientToken string `position:"Query" name:"ClientToken"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + Force string `position:"Query" name:"Force"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// UnassociateHaVipResponse is the response struct for api UnassociateHaVip +type UnassociateHaVipResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateUnassociateHaVipRequest creates a request to invoke UnassociateHaVip API +func CreateUnassociateHaVipRequest() (request *UnassociateHaVipRequest) { + request = &UnassociateHaVipRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "UnassociateHaVip", "vpc", "openAPI") + return +} + +// CreateUnassociateHaVipResponse creates a response to parse from UnassociateHaVip response +func CreateUnassociateHaVipResponse() (response *UnassociateHaVipResponse) { + response = &UnassociateHaVipResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/unassociate_physical_connection_from_virtual_border_router.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/unassociate_physical_connection_from_virtual_border_router.go new file mode 100644 index 000000000..f20d6cfbb --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/unassociate_physical_connection_from_virtual_border_router.go @@ -0,0 +1,109 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// UnassociatePhysicalConnectionFromVirtualBorderRouter invokes the vpc.UnassociatePhysicalConnectionFromVirtualBorderRouter API synchronously +// api document: https://help.aliyun.com/api/vpc/unassociatephysicalconnectionfromvirtualborderrouter.html +func (client *Client) UnassociatePhysicalConnectionFromVirtualBorderRouter(request *UnassociatePhysicalConnectionFromVirtualBorderRouterRequest) (response *UnassociatePhysicalConnectionFromVirtualBorderRouterResponse, err error) { + response = CreateUnassociatePhysicalConnectionFromVirtualBorderRouterResponse() + err = client.DoAction(request, response) + return +} + +// UnassociatePhysicalConnectionFromVirtualBorderRouterWithChan invokes the vpc.UnassociatePhysicalConnectionFromVirtualBorderRouter API asynchronously +// api document: https://help.aliyun.com/api/vpc/unassociatephysicalconnectionfromvirtualborderrouter.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) UnassociatePhysicalConnectionFromVirtualBorderRouterWithChan(request *UnassociatePhysicalConnectionFromVirtualBorderRouterRequest) (<-chan *UnassociatePhysicalConnectionFromVirtualBorderRouterResponse, <-chan error) { + responseChan := make(chan *UnassociatePhysicalConnectionFromVirtualBorderRouterResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.UnassociatePhysicalConnectionFromVirtualBorderRouter(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// UnassociatePhysicalConnectionFromVirtualBorderRouterWithCallback invokes the vpc.UnassociatePhysicalConnectionFromVirtualBorderRouter API asynchronously +// api document: https://help.aliyun.com/api/vpc/unassociatephysicalconnectionfromvirtualborderrouter.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) UnassociatePhysicalConnectionFromVirtualBorderRouterWithCallback(request *UnassociatePhysicalConnectionFromVirtualBorderRouterRequest, callback func(response *UnassociatePhysicalConnectionFromVirtualBorderRouterResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *UnassociatePhysicalConnectionFromVirtualBorderRouterResponse + var err error + defer close(result) + response, err = client.UnassociatePhysicalConnectionFromVirtualBorderRouter(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// UnassociatePhysicalConnectionFromVirtualBorderRouterRequest is the request struct for api UnassociatePhysicalConnectionFromVirtualBorderRouter +type UnassociatePhysicalConnectionFromVirtualBorderRouterRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + ClientToken string `position:"Query" name:"ClientToken"` + PhysicalConnectionId string `position:"Query" name:"PhysicalConnectionId"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + VbrId string `position:"Query" name:"VbrId"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` +} + +// UnassociatePhysicalConnectionFromVirtualBorderRouterResponse is the response struct for api UnassociatePhysicalConnectionFromVirtualBorderRouter +type UnassociatePhysicalConnectionFromVirtualBorderRouterResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateUnassociatePhysicalConnectionFromVirtualBorderRouterRequest creates a request to invoke UnassociatePhysicalConnectionFromVirtualBorderRouter API +func CreateUnassociatePhysicalConnectionFromVirtualBorderRouterRequest() (request *UnassociatePhysicalConnectionFromVirtualBorderRouterRequest) { + request = &UnassociatePhysicalConnectionFromVirtualBorderRouterRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "UnassociatePhysicalConnectionFromVirtualBorderRouter", "vpc", "openAPI") + return +} + +// CreateUnassociatePhysicalConnectionFromVirtualBorderRouterResponse creates a response to parse from UnassociatePhysicalConnectionFromVirtualBorderRouter response +func CreateUnassociatePhysicalConnectionFromVirtualBorderRouterResponse() (response *UnassociatePhysicalConnectionFromVirtualBorderRouterResponse) { + response = &UnassociatePhysicalConnectionFromVirtualBorderRouterResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/unassociate_route_table.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/unassociate_route_table.go new file mode 100644 index 000000000..7d74fc5d0 --- /dev/null +++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/vpc/unassociate_route_table.go @@ -0,0 +1,109 @@ +package vpc + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// UnassociateRouteTable invokes the vpc.UnassociateRouteTable API synchronously +// api document: https://help.aliyun.com/api/vpc/unassociateroutetable.html +func (client *Client) UnassociateRouteTable(request *UnassociateRouteTableRequest) (response *UnassociateRouteTableResponse, err error) { + response = CreateUnassociateRouteTableResponse() + err = client.DoAction(request, response) + return +} + +// UnassociateRouteTableWithChan invokes the vpc.UnassociateRouteTable API asynchronously +// api document: https://help.aliyun.com/api/vpc/unassociateroutetable.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) UnassociateRouteTableWithChan(request *UnassociateRouteTableRequest) (<-chan *UnassociateRouteTableResponse, <-chan error) { + responseChan := make(chan *UnassociateRouteTableResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.UnassociateRouteTable(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// UnassociateRouteTableWithCallback invokes the vpc.UnassociateRouteTable API asynchronously +// api document: https://help.aliyun.com/api/vpc/unassociateroutetable.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) UnassociateRouteTableWithCallback(request *UnassociateRouteTableRequest, callback func(response *UnassociateRouteTableResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *UnassociateRouteTableResponse + var err error + defer close(result) + response, err = client.UnassociateRouteTable(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// UnassociateRouteTableRequest is the request struct for api UnassociateRouteTable +type UnassociateRouteTableRequest struct { + *requests.RpcRequest + ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` + ClientToken string `position:"Query" name:"ClientToken"` + RouteTableId string `position:"Query" name:"RouteTableId"` + ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` + OwnerAccount string `position:"Query" name:"OwnerAccount"` + OwnerId requests.Integer `position:"Query" name:"OwnerId"` + VSwitchId string `position:"Query" name:"VSwitchId"` +} + +// UnassociateRouteTableResponse is the response struct for api UnassociateRouteTable +type UnassociateRouteTableResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` +} + +// CreateUnassociateRouteTableRequest creates a request to invoke UnassociateRouteTable API +func CreateUnassociateRouteTableRequest() (request *UnassociateRouteTableRequest) { + request = &UnassociateRouteTableRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("Vpc", "2016-04-28", "UnassociateRouteTable", "vpc", "openAPI") + return +} + +// CreateUnassociateRouteTableResponse creates a response to parse from UnassociateRouteTable response +func CreateUnassociateRouteTableResponse() (response *UnassociateRouteTableResponse) { + response = &UnassociateRouteTableResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/vendor/github.com/jmespath/go-jmespath/api.go b/vendor/github.com/jmespath/go-jmespath/api.go index 9cfa988bc..67df3fc1c 100644 --- a/vendor/github.com/jmespath/go-jmespath/api.go +++ b/vendor/github.com/jmespath/go-jmespath/api.go @@ -1,42 +1,5 @@ package jmespath -import "strconv" - -// JmesPath is the epresentation of a compiled JMES path query. A JmesPath is -// safe for concurrent use by multiple goroutines. -type JMESPath struct { - ast ASTNode - intr *treeInterpreter -} - -// Compile parses a JMESPath expression and returns, if successful, a JMESPath -// object that can be used to match against data. -func Compile(expression string) (*JMESPath, error) { - parser := NewParser() - ast, err := parser.Parse(expression) - if err != nil { - return nil, err - } - jmespath := &JMESPath{ast: ast, intr: newInterpreter()} - return jmespath, nil -} - -// MustCompile is like Compile but panics if the expression cannot be parsed. -// It simplifies safe initialization of global variables holding compiled -// JMESPaths. -func MustCompile(expression string) *JMESPath { - jmespath, err := Compile(expression) - if err != nil { - panic(`jmespath: Compile(` + strconv.Quote(expression) + `): ` + err.Error()) - } - return jmespath -} - -// Search evaluates a JMESPath expression against input data and returns the result. -func (jp *JMESPath) Search(data interface{}) (interface{}, error) { - return jp.intr.Execute(jp.ast, data) -} - // Search evaluates a JMESPath expression against input data and returns the result. func Search(expression string, data interface{}) (interface{}, error) { intr := newInterpreter() diff --git a/vendor/github.com/jmespath/go-jmespath/functions.go b/vendor/github.com/jmespath/go-jmespath/functions.go index 9b7cd89b4..8a3f2ef0d 100644 --- a/vendor/github.com/jmespath/go-jmespath/functions.go +++ b/vendor/github.com/jmespath/go-jmespath/functions.go @@ -5,7 +5,6 @@ import ( "errors" "fmt" "math" - "reflect" "sort" "strconv" "strings" @@ -125,197 +124,197 @@ type functionCaller struct { func newFunctionCaller() *functionCaller { caller := &functionCaller{} caller.functionTable = map[string]functionEntry{ - "length": { + "length": functionEntry{ name: "length", arguments: []argSpec{ - {types: []jpType{jpString, jpArray, jpObject}}, + argSpec{types: []jpType{jpString, jpArray, jpObject}}, }, handler: jpfLength, }, - "starts_with": { + "starts_with": functionEntry{ name: "starts_with", arguments: []argSpec{ - {types: []jpType{jpString}}, - {types: []jpType{jpString}}, + argSpec{types: []jpType{jpString}}, + argSpec{types: []jpType{jpString}}, }, handler: jpfStartsWith, }, - "abs": { + "abs": functionEntry{ name: "abs", arguments: []argSpec{ - {types: []jpType{jpNumber}}, + argSpec{types: []jpType{jpNumber}}, }, handler: jpfAbs, }, - "avg": { + "avg": functionEntry{ name: "avg", arguments: []argSpec{ - {types: []jpType{jpArrayNumber}}, + argSpec{types: []jpType{jpArrayNumber}}, }, handler: jpfAvg, }, - "ceil": { + "ceil": functionEntry{ name: "ceil", arguments: []argSpec{ - {types: []jpType{jpNumber}}, + argSpec{types: []jpType{jpNumber}}, }, handler: jpfCeil, }, - "contains": { + "contains": functionEntry{ name: "contains", arguments: []argSpec{ - {types: []jpType{jpArray, jpString}}, - {types: []jpType{jpAny}}, + argSpec{types: []jpType{jpArray, jpString}}, + argSpec{types: []jpType{jpAny}}, }, handler: jpfContains, }, - "ends_with": { + "ends_with": functionEntry{ name: "ends_with", arguments: []argSpec{ - {types: []jpType{jpString}}, - {types: []jpType{jpString}}, + argSpec{types: []jpType{jpString}}, + argSpec{types: []jpType{jpString}}, }, handler: jpfEndsWith, }, - "floor": { + "floor": functionEntry{ name: "floor", arguments: []argSpec{ - {types: []jpType{jpNumber}}, + argSpec{types: []jpType{jpNumber}}, }, handler: jpfFloor, }, - "map": { + "map": functionEntry{ name: "amp", arguments: []argSpec{ - {types: []jpType{jpExpref}}, - {types: []jpType{jpArray}}, + argSpec{types: []jpType{jpExpref}}, + argSpec{types: []jpType{jpArray}}, }, handler: jpfMap, hasExpRef: true, }, - "max": { + "max": functionEntry{ name: "max", arguments: []argSpec{ - {types: []jpType{jpArrayNumber, jpArrayString}}, + argSpec{types: []jpType{jpArrayNumber, jpArrayString}}, }, handler: jpfMax, }, - "merge": { + "merge": functionEntry{ name: "merge", arguments: []argSpec{ - {types: []jpType{jpObject}, variadic: true}, + argSpec{types: []jpType{jpObject}, variadic: true}, }, handler: jpfMerge, }, - "max_by": { + "max_by": functionEntry{ name: "max_by", arguments: []argSpec{ - {types: []jpType{jpArray}}, - {types: []jpType{jpExpref}}, + argSpec{types: []jpType{jpArray}}, + argSpec{types: []jpType{jpExpref}}, }, handler: jpfMaxBy, hasExpRef: true, }, - "sum": { + "sum": functionEntry{ name: "sum", arguments: []argSpec{ - {types: []jpType{jpArrayNumber}}, + argSpec{types: []jpType{jpArrayNumber}}, }, handler: jpfSum, }, - "min": { + "min": functionEntry{ name: "min", arguments: []argSpec{ - {types: []jpType{jpArrayNumber, jpArrayString}}, + argSpec{types: []jpType{jpArrayNumber, jpArrayString}}, }, handler: jpfMin, }, - "min_by": { + "min_by": functionEntry{ name: "min_by", arguments: []argSpec{ - {types: []jpType{jpArray}}, - {types: []jpType{jpExpref}}, + argSpec{types: []jpType{jpArray}}, + argSpec{types: []jpType{jpExpref}}, }, handler: jpfMinBy, hasExpRef: true, }, - "type": { + "type": functionEntry{ name: "type", arguments: []argSpec{ - {types: []jpType{jpAny}}, + argSpec{types: []jpType{jpAny}}, }, handler: jpfType, }, - "keys": { + "keys": functionEntry{ name: "keys", arguments: []argSpec{ - {types: []jpType{jpObject}}, + argSpec{types: []jpType{jpObject}}, }, handler: jpfKeys, }, - "values": { + "values": functionEntry{ name: "values", arguments: []argSpec{ - {types: []jpType{jpObject}}, + argSpec{types: []jpType{jpObject}}, }, handler: jpfValues, }, - "sort": { + "sort": functionEntry{ name: "sort", arguments: []argSpec{ - {types: []jpType{jpArrayString, jpArrayNumber}}, + argSpec{types: []jpType{jpArrayString, jpArrayNumber}}, }, handler: jpfSort, }, - "sort_by": { + "sort_by": functionEntry{ name: "sort_by", arguments: []argSpec{ - {types: []jpType{jpArray}}, - {types: []jpType{jpExpref}}, + argSpec{types: []jpType{jpArray}}, + argSpec{types: []jpType{jpExpref}}, }, handler: jpfSortBy, hasExpRef: true, }, - "join": { + "join": functionEntry{ name: "join", arguments: []argSpec{ - {types: []jpType{jpString}}, - {types: []jpType{jpArrayString}}, + argSpec{types: []jpType{jpString}}, + argSpec{types: []jpType{jpArrayString}}, }, handler: jpfJoin, }, - "reverse": { + "reverse": functionEntry{ name: "reverse", arguments: []argSpec{ - {types: []jpType{jpArray, jpString}}, + argSpec{types: []jpType{jpArray, jpString}}, }, handler: jpfReverse, }, - "to_array": { + "to_array": functionEntry{ name: "to_array", arguments: []argSpec{ - {types: []jpType{jpAny}}, + argSpec{types: []jpType{jpAny}}, }, handler: jpfToArray, }, - "to_string": { + "to_string": functionEntry{ name: "to_string", arguments: []argSpec{ - {types: []jpType{jpAny}}, + argSpec{types: []jpType{jpAny}}, }, handler: jpfToString, }, - "to_number": { + "to_number": functionEntry{ name: "to_number", arguments: []argSpec{ - {types: []jpType{jpAny}}, + argSpec{types: []jpType{jpAny}}, }, handler: jpfToNumber, }, - "not_null": { + "not_null": functionEntry{ name: "not_null", arguments: []argSpec{ - {types: []jpType{jpAny}, variadic: true}, + argSpec{types: []jpType{jpAny}, variadic: true}, }, handler: jpfNotNull, }, @@ -358,7 +357,7 @@ func (a *argSpec) typeCheck(arg interface{}) error { return nil } case jpArray: - if isSliceType(arg) { + if _, ok := arg.([]interface{}); ok { return nil } case jpObject: @@ -410,9 +409,8 @@ func jpfLength(arguments []interface{}) (interface{}, error) { arg := arguments[0] if c, ok := arg.(string); ok { return float64(utf8.RuneCountInString(c)), nil - } else if isSliceType(arg) { - v := reflect.ValueOf(arg) - return float64(v.Len()), nil + } else if c, ok := arg.([]interface{}); ok { + return float64(len(c)), nil } else if c, ok := arg.(map[string]interface{}); ok { return float64(len(c)), nil } diff --git a/vendor/github.com/jmespath/go-jmespath/parser.go b/vendor/github.com/jmespath/go-jmespath/parser.go index 1240a1755..c8f4bcebd 100644 --- a/vendor/github.com/jmespath/go-jmespath/parser.go +++ b/vendor/github.com/jmespath/go-jmespath/parser.go @@ -353,7 +353,7 @@ func (p *Parser) nud(token token) (ASTNode, error) { case tFlatten: left := ASTNode{ nodeType: ASTFlatten, - children: []ASTNode{{nodeType: ASTIdentity}}, + children: []ASTNode{ASTNode{nodeType: ASTIdentity}}, } right, err := p.parseProjectionRHS(bindingPowers[tFlatten]) if err != nil { @@ -378,7 +378,7 @@ func (p *Parser) nud(token token) (ASTNode, error) { } return ASTNode{ nodeType: ASTProjection, - children: []ASTNode{{nodeType: ASTIdentity}, right}, + children: []ASTNode{ASTNode{nodeType: ASTIdentity}, right}, }, nil } else { return p.parseMultiSelectList() diff --git a/vendor/github.com/satori/go.uuid/LICENSE b/vendor/github.com/satori/go.uuid/LICENSE new file mode 100644 index 000000000..926d54987 --- /dev/null +++ b/vendor/github.com/satori/go.uuid/LICENSE @@ -0,0 +1,20 @@ +Copyright (C) 2013-2018 by Maxim Bublis + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/vendor/github.com/satori/go.uuid/codec.go b/vendor/github.com/satori/go.uuid/codec.go new file mode 100644 index 000000000..656892c53 --- /dev/null +++ b/vendor/github.com/satori/go.uuid/codec.go @@ -0,0 +1,206 @@ +// Copyright (C) 2013-2018 by Maxim Bublis +// +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +package uuid + +import ( + "bytes" + "encoding/hex" + "fmt" +) + +// FromBytes returns UUID converted from raw byte slice input. +// It will return error if the slice isn't 16 bytes long. +func FromBytes(input []byte) (u UUID, err error) { + err = u.UnmarshalBinary(input) + return +} + +// FromBytesOrNil returns UUID converted from raw byte slice input. +// Same behavior as FromBytes, but returns a Nil UUID on error. +func FromBytesOrNil(input []byte) UUID { + uuid, err := FromBytes(input) + if err != nil { + return Nil + } + return uuid +} + +// FromString returns UUID parsed from string input. +// Input is expected in a form accepted by UnmarshalText. +func FromString(input string) (u UUID, err error) { + err = u.UnmarshalText([]byte(input)) + return +} + +// FromStringOrNil returns UUID parsed from string input. +// Same behavior as FromString, but returns a Nil UUID on error. +func FromStringOrNil(input string) UUID { + uuid, err := FromString(input) + if err != nil { + return Nil + } + return uuid +} + +// MarshalText implements the encoding.TextMarshaler interface. +// The encoding is the same as returned by String. +func (u UUID) MarshalText() (text []byte, err error) { + text = []byte(u.String()) + return +} + +// UnmarshalText implements the encoding.TextUnmarshaler interface. +// Following formats are supported: +// "6ba7b810-9dad-11d1-80b4-00c04fd430c8", +// "{6ba7b810-9dad-11d1-80b4-00c04fd430c8}", +// "urn:uuid:6ba7b810-9dad-11d1-80b4-00c04fd430c8" +// "6ba7b8109dad11d180b400c04fd430c8" +// ABNF for supported UUID text representation follows: +// uuid := canonical | hashlike | braced | urn +// plain := canonical | hashlike +// canonical := 4hexoct '-' 2hexoct '-' 2hexoct '-' 6hexoct +// hashlike := 12hexoct +// braced := '{' plain '}' +// urn := URN ':' UUID-NID ':' plain +// URN := 'urn' +// UUID-NID := 'uuid' +// 12hexoct := 6hexoct 6hexoct +// 6hexoct := 4hexoct 2hexoct +// 4hexoct := 2hexoct 2hexoct +// 2hexoct := hexoct hexoct +// hexoct := hexdig hexdig +// hexdig := '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' | +// 'a' | 'b' | 'c' | 'd' | 'e' | 'f' | +// 'A' | 'B' | 'C' | 'D' | 'E' | 'F' +func (u *UUID) UnmarshalText(text []byte) (err error) { + switch len(text) { + case 32: + return u.decodeHashLike(text) + case 36: + return u.decodeCanonical(text) + case 38: + return u.decodeBraced(text) + case 41: + fallthrough + case 45: + return u.decodeURN(text) + default: + return fmt.Errorf("uuid: incorrect UUID length: %s", text) + } +} + +// decodeCanonical decodes UUID string in format +// "6ba7b810-9dad-11d1-80b4-00c04fd430c8". +func (u *UUID) decodeCanonical(t []byte) (err error) { + if t[8] != '-' || t[13] != '-' || t[18] != '-' || t[23] != '-' { + return fmt.Errorf("uuid: incorrect UUID format %s", t) + } + + src := t[:] + dst := u[:] + + for i, byteGroup := range byteGroups { + if i > 0 { + src = src[1:] // skip dash + } + _, err = hex.Decode(dst[:byteGroup/2], src[:byteGroup]) + if err != nil { + return + } + src = src[byteGroup:] + dst = dst[byteGroup/2:] + } + + return +} + +// decodeHashLike decodes UUID string in format +// "6ba7b8109dad11d180b400c04fd430c8". +func (u *UUID) decodeHashLike(t []byte) (err error) { + src := t[:] + dst := u[:] + + if _, err = hex.Decode(dst, src); err != nil { + return err + } + return +} + +// decodeBraced decodes UUID string in format +// "{6ba7b810-9dad-11d1-80b4-00c04fd430c8}" or in format +// "{6ba7b8109dad11d180b400c04fd430c8}". +func (u *UUID) decodeBraced(t []byte) (err error) { + l := len(t) + + if t[0] != '{' || t[l-1] != '}' { + return fmt.Errorf("uuid: incorrect UUID format %s", t) + } + + return u.decodePlain(t[1 : l-1]) +} + +// decodeURN decodes UUID string in format +// "urn:uuid:6ba7b810-9dad-11d1-80b4-00c04fd430c8" or in format +// "urn:uuid:6ba7b8109dad11d180b400c04fd430c8". +func (u *UUID) decodeURN(t []byte) (err error) { + total := len(t) + + urn_uuid_prefix := t[:9] + + if !bytes.Equal(urn_uuid_prefix, urnPrefix) { + return fmt.Errorf("uuid: incorrect UUID format: %s", t) + } + + return u.decodePlain(t[9:total]) +} + +// decodePlain decodes UUID string in canonical format +// "6ba7b810-9dad-11d1-80b4-00c04fd430c8" or in hash-like format +// "6ba7b8109dad11d180b400c04fd430c8". +func (u *UUID) decodePlain(t []byte) (err error) { + switch len(t) { + case 32: + return u.decodeHashLike(t) + case 36: + return u.decodeCanonical(t) + default: + return fmt.Errorf("uuid: incorrrect UUID length: %s", t) + } +} + +// MarshalBinary implements the encoding.BinaryMarshaler interface. +func (u UUID) MarshalBinary() (data []byte, err error) { + data = u.Bytes() + return +} + +// UnmarshalBinary implements the encoding.BinaryUnmarshaler interface. +// It will return error if the slice isn't 16 bytes long. +func (u *UUID) UnmarshalBinary(data []byte) (err error) { + if len(data) != Size { + err = fmt.Errorf("uuid: UUID must be exactly 16 bytes long, got %d bytes", len(data)) + return + } + copy(u[:], data) + + return +} diff --git a/vendor/github.com/satori/go.uuid/generator.go b/vendor/github.com/satori/go.uuid/generator.go new file mode 100644 index 000000000..3f2f1da2d --- /dev/null +++ b/vendor/github.com/satori/go.uuid/generator.go @@ -0,0 +1,239 @@ +// Copyright (C) 2013-2018 by Maxim Bublis +// +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +package uuid + +import ( + "crypto/md5" + "crypto/rand" + "crypto/sha1" + "encoding/binary" + "hash" + "net" + "os" + "sync" + "time" +) + +// Difference in 100-nanosecond intervals between +// UUID epoch (October 15, 1582) and Unix epoch (January 1, 1970). +const epochStart = 122192928000000000 + +var ( + global = newDefaultGenerator() + + epochFunc = unixTimeFunc + posixUID = uint32(os.Getuid()) + posixGID = uint32(os.Getgid()) +) + +// NewV1 returns UUID based on current timestamp and MAC address. +func NewV1() UUID { + return global.NewV1() +} + +// NewV2 returns DCE Security UUID based on POSIX UID/GID. +func NewV2(domain byte) UUID { + return global.NewV2(domain) +} + +// NewV3 returns UUID based on MD5 hash of namespace UUID and name. +func NewV3(ns UUID, name string) UUID { + return global.NewV3(ns, name) +} + +// NewV4 returns random generated UUID. +func NewV4() UUID { + return global.NewV4() +} + +// NewV5 returns UUID based on SHA-1 hash of namespace UUID and name. +func NewV5(ns UUID, name string) UUID { + return global.NewV5(ns, name) +} + +// Generator provides interface for generating UUIDs. +type Generator interface { + NewV1() UUID + NewV2(domain byte) UUID + NewV3(ns UUID, name string) UUID + NewV4() UUID + NewV5(ns UUID, name string) UUID +} + +// Default generator implementation. +type generator struct { + storageOnce sync.Once + storageMutex sync.Mutex + + lastTime uint64 + clockSequence uint16 + hardwareAddr [6]byte +} + +func newDefaultGenerator() Generator { + return &generator{} +} + +// NewV1 returns UUID based on current timestamp and MAC address. +func (g *generator) NewV1() UUID { + u := UUID{} + + timeNow, clockSeq, hardwareAddr := g.getStorage() + + binary.BigEndian.PutUint32(u[0:], uint32(timeNow)) + binary.BigEndian.PutUint16(u[4:], uint16(timeNow>>32)) + binary.BigEndian.PutUint16(u[6:], uint16(timeNow>>48)) + binary.BigEndian.PutUint16(u[8:], clockSeq) + + copy(u[10:], hardwareAddr) + + u.SetVersion(V1) + u.SetVariant(VariantRFC4122) + + return u +} + +// NewV2 returns DCE Security UUID based on POSIX UID/GID. +func (g *generator) NewV2(domain byte) UUID { + u := UUID{} + + timeNow, clockSeq, hardwareAddr := g.getStorage() + + switch domain { + case DomainPerson: + binary.BigEndian.PutUint32(u[0:], posixUID) + case DomainGroup: + binary.BigEndian.PutUint32(u[0:], posixGID) + } + + binary.BigEndian.PutUint16(u[4:], uint16(timeNow>>32)) + binary.BigEndian.PutUint16(u[6:], uint16(timeNow>>48)) + binary.BigEndian.PutUint16(u[8:], clockSeq) + u[9] = domain + + copy(u[10:], hardwareAddr) + + u.SetVersion(V2) + u.SetVariant(VariantRFC4122) + + return u +} + +// NewV3 returns UUID based on MD5 hash of namespace UUID and name. +func (g *generator) NewV3(ns UUID, name string) UUID { + u := newFromHash(md5.New(), ns, name) + u.SetVersion(V3) + u.SetVariant(VariantRFC4122) + + return u +} + +// NewV4 returns random generated UUID. +func (g *generator) NewV4() UUID { + u := UUID{} + g.safeRandom(u[:]) + u.SetVersion(V4) + u.SetVariant(VariantRFC4122) + + return u +} + +// NewV5 returns UUID based on SHA-1 hash of namespace UUID and name. +func (g *generator) NewV5(ns UUID, name string) UUID { + u := newFromHash(sha1.New(), ns, name) + u.SetVersion(V5) + u.SetVariant(VariantRFC4122) + + return u +} + +func (g *generator) initStorage() { + g.initClockSequence() + g.initHardwareAddr() +} + +func (g *generator) initClockSequence() { + buf := make([]byte, 2) + g.safeRandom(buf) + g.clockSequence = binary.BigEndian.Uint16(buf) +} + +func (g *generator) initHardwareAddr() { + interfaces, err := net.Interfaces() + if err == nil { + for _, iface := range interfaces { + if len(iface.HardwareAddr) >= 6 { + copy(g.hardwareAddr[:], iface.HardwareAddr) + return + } + } + } + + // Initialize hardwareAddr randomly in case + // of real network interfaces absence + g.safeRandom(g.hardwareAddr[:]) + + // Set multicast bit as recommended in RFC 4122 + g.hardwareAddr[0] |= 0x01 +} + +func (g *generator) safeRandom(dest []byte) { + if _, err := rand.Read(dest); err != nil { + panic(err) + } +} + +// Returns UUID v1/v2 storage state. +// Returns epoch timestamp, clock sequence, and hardware address. +func (g *generator) getStorage() (uint64, uint16, []byte) { + g.storageOnce.Do(g.initStorage) + + g.storageMutex.Lock() + defer g.storageMutex.Unlock() + + timeNow := epochFunc() + // Clock changed backwards since last UUID generation. + // Should increase clock sequence. + if timeNow <= g.lastTime { + g.clockSequence++ + } + g.lastTime = timeNow + + return timeNow, g.clockSequence, g.hardwareAddr[:] +} + +// Returns difference in 100-nanosecond intervals between +// UUID epoch (October 15, 1582) and current time. +// This is default epoch calculation function. +func unixTimeFunc() uint64 { + return epochStart + uint64(time.Now().UnixNano()/100) +} + +// Returns UUID based on hashing of namespace UUID and name. +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 +} diff --git a/vendor/github.com/satori/go.uuid/sql.go b/vendor/github.com/satori/go.uuid/sql.go new file mode 100644 index 000000000..56759d390 --- /dev/null +++ b/vendor/github.com/satori/go.uuid/sql.go @@ -0,0 +1,78 @@ +// Copyright (C) 2013-2018 by Maxim Bublis +// +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +package uuid + +import ( + "database/sql/driver" + "fmt" +) + +// Value implements the driver.Valuer interface. +func (u UUID) Value() (driver.Value, error) { + return u.String(), nil +} + +// Scan implements the sql.Scanner interface. +// A 16-byte slice is handled by UnmarshalBinary, while +// a longer byte slice or a string is handled by UnmarshalText. +func (u *UUID) Scan(src interface{}) error { + switch src := src.(type) { + case []byte: + if len(src) == Size { + return u.UnmarshalBinary(src) + } + return u.UnmarshalText(src) + + case string: + return u.UnmarshalText([]byte(src)) + } + + return fmt.Errorf("uuid: cannot convert %T to UUID", src) +} + +// NullUUID can be used with the standard sql package to represent a +// UUID value that can be NULL in the database +type NullUUID struct { + UUID UUID + Valid bool +} + +// Value implements the driver.Valuer interface. +func (u NullUUID) Value() (driver.Value, error) { + if !u.Valid { + return nil, nil + } + // Delegate to UUID Value function + return u.UUID.Value() +} + +// Scan implements the sql.Scanner interface. +func (u *NullUUID) Scan(src interface{}) error { + if src == nil { + u.UUID, u.Valid = Nil, false + return nil + } + + // Delegate to UUID Scan function + u.Valid = true + return u.UUID.Scan(src) +} diff --git a/vendor/github.com/satori/go.uuid/uuid.go b/vendor/github.com/satori/go.uuid/uuid.go new file mode 100644 index 000000000..a2b8e2ca2 --- /dev/null +++ b/vendor/github.com/satori/go.uuid/uuid.go @@ -0,0 +1,161 @@ +// Copyright (C) 2013-2018 by Maxim Bublis +// +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +// Package uuid provides implementation of Universally Unique Identifier (UUID). +// Supported versions are 1, 3, 4 and 5 (as specified in RFC 4122) and +// version 2 (as specified in DCE 1.1). +package uuid + +import ( + "bytes" + "encoding/hex" +) + +// Size of a UUID in bytes. +const Size = 16 + +// UUID representation compliant with specification +// described in RFC 4122. +type UUID [Size]byte + +// UUID versions +const ( + _ byte = iota + V1 + V2 + V3 + V4 + V5 +) + +// UUID layout variants. +const ( + VariantNCS byte = iota + VariantRFC4122 + VariantMicrosoft + VariantFuture +) + +// UUID DCE domains. +const ( + DomainPerson = iota + DomainGroup + DomainOrg +) + +// String parse helpers. +var ( + urnPrefix = []byte("urn:uuid:") + byteGroups = []int{8, 4, 4, 4, 12} +) + +// Nil is special form of UUID that is specified to have all +// 128 bits set to zero. +var Nil = UUID{} + +// Predefined namespace UUIDs. +var ( + NamespaceDNS = Must(FromString("6ba7b810-9dad-11d1-80b4-00c04fd430c8")) + NamespaceURL = Must(FromString("6ba7b811-9dad-11d1-80b4-00c04fd430c8")) + NamespaceOID = Must(FromString("6ba7b812-9dad-11d1-80b4-00c04fd430c8")) + NamespaceX500 = Must(FromString("6ba7b814-9dad-11d1-80b4-00c04fd430c8")) +) + +// Equal returns true if u1 and u2 equals, otherwise returns false. +func Equal(u1 UUID, u2 UUID) bool { + return bytes.Equal(u1[:], u2[:]) +} + +// Version returns algorithm version used to generate UUID. +func (u UUID) Version() byte { + return u[6] >> 4 +} + +// Variant returns UUID layout variant. +func (u UUID) Variant() byte { + switch { + case (u[8] >> 7) == 0x00: + return VariantNCS + case (u[8] >> 6) == 0x02: + return VariantRFC4122 + case (u[8] >> 5) == 0x06: + return VariantMicrosoft + case (u[8] >> 5) == 0x07: + fallthrough + default: + return VariantFuture + } +} + +// Bytes returns bytes slice representation of UUID. +func (u UUID) Bytes() []byte { + return u[:] +} + +// Returns canonical string representation of UUID: +// xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx. +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) +} + +// SetVersion sets version bits. +func (u *UUID) SetVersion(v byte) { + u[6] = (u[6] & 0x0f) | (v << 4) +} + +// SetVariant sets variant bits. +func (u *UUID) SetVariant(v byte) { + switch v { + case VariantNCS: + u[8] = (u[8]&(0xff>>1) | (0x00 << 7)) + case VariantRFC4122: + u[8] = (u[8]&(0xff>>2) | (0x02 << 6)) + case VariantMicrosoft: + u[8] = (u[8]&(0xff>>3) | (0x06 << 5)) + case VariantFuture: + fallthrough + default: + u[8] = (u[8]&(0xff>>3) | (0x07 << 5)) + } +} + +// Must is a helper that wraps a call to a function returning (UUID, error) +// and panics if the error is non-nil. It is intended for use in variable +// initializations such as +// var packageUUID = uuid.Must(uuid.FromString("123e4567-e89b-12d3-a456-426655440000")); +func Must(u UUID, err error) UUID { + if err != nil { + panic(err) + } + return u +} diff --git a/vendor/gopkg.in/ini.v1/LICENSE b/vendor/gopkg.in/ini.v1/LICENSE new file mode 100644 index 000000000..d361bbcdf --- /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/error.go b/vendor/gopkg.in/ini.v1/error.go new file mode 100644 index 000000000..80afe7431 --- /dev/null +++ b/vendor/gopkg.in/ini.v1/error.go @@ -0,0 +1,32 @@ +// 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" +) + +type ErrDelimiterNotFound struct { + Line string +} + +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 000000000..0ed0eafd0 --- /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 != DEFAULT_SECTION { + 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 = DEFAULT_SECTION + } + 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 +} + +// Section returns list of Section. +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 = DEFAULT_SECTION + } + + 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) + + KEY_LIST: + for _, kname := range sec.keyList { + key := sec.Key(kname) + if len(key.Comment) > 0 { + if len(indent) > 0 && sname != DEFAULT_SECTION { + 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 != DEFAULT_SECTION { + 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 KEY_LIST + } + + // 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/ini.go b/vendor/gopkg.in/ini.v1/ini.go new file mode 100644 index 000000000..f827a1ef9 --- /dev/null +++ b/vendor/gopkg.in/ini.v1/ini.go @@ -0,0 +1,219 @@ +// +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 ( + "bytes" + "fmt" + "io" + "io/ioutil" + "os" + "regexp" + "runtime" +) + +const ( + // Name for 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. + DEFAULT_SECTION = "DEFAULT" + + // Maximum allowed depth when recursively substituing variable names. + _DEPTH_VALUES = 99 + _VERSION = "1.42.0" +) + +// Version returns current package version literal. +func Version() string { + return _VERSION +} + +var ( + // 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" + + // Place custom spaces when PrettyFormat and PrettyEqual are both disabled + DefaultFormatLeft = "" + DefaultFormatRight = "" + + // Variable regexp pattern: %(variable)s + varPattern = regexp.MustCompile(`%\(([^\)]+)\)s`) + + // Indicate whether to align "=" sign with spaces to produce pretty output + // or reduce all possible spaces for compact format. + PrettyFormat = true + + // Place spaces around "=" sign even when PrettyFormat is false + PrettyEqual = false + + // Explicitly write DEFAULT section header + DefaultHeader = false + + // Indicate whether to put a line between sections + PrettySection = true +) + +func init() { + if runtime.GOOS == "windows" { + LineBreak = "\r\n" + } +} + +func inSlice(str string, s []string) bool { + for _, v := range s { + if str == v { + return true + } + } + return false +} + +// 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 '%s'", 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 +} + +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 000000000..0fee0dc7e --- /dev/null +++ b/vendor/gopkg.in/ini.v1/key.go @@ -0,0 +1,752 @@ +// 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") + } + + 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 +} + +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 < _DEPTH_VALUES; 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. + nk, err := k.s.GetKey(noption) + if err != nil || k == nk { + // Search again in default section. + nk, _ = k.s.f.Section("").GetKey(noption) + } + + // 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 += 1 + 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 +} + +// 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 +} + +// 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) +} + +// 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) +} + +// 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 000000000..f20073d1b --- /dev/null +++ b/vendor/gopkg.in/ini.v1/parser.go @@ -0,0 +1,488 @@ +// 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" +) + +var pythonMultiline = regexp.MustCompile("^(\\s+)([^\n]+)") + +type tokenType int + +const ( + _TOKEN_INVALID tokenType = iota + _TOKEN_COMMENT + _TOKEN_SECTION + _TOKEN_KEY +) + +type parser struct { + buf *bufio.Reader + isEOF bool + count int + comment *bytes.Buffer +} + +func newParser(r io.Reader) *parser { + return &parser{ + buf: bufio.NewReader(r), + 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, + parserBufferSize int, + ignoreContinuation, ignoreInlineComment, unescapeValueDoubleQuotes, unescapeValueCommentSymbols, allowPythonMultilines, spaceBeforeInlineComment, preserveSurroundedQuote bool) (string, error) { + + line := strings.TrimLeftFunc(string(in), unicode.IsSpace) + if len(line) == 0 { + return "", nil + } + + var valQuote string + if len(line) > 3 && string(line[0:3]) == `"""` { + valQuote = `"""` + } else if line[0] == '`' { + valQuote = "`" + } else if 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 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 !ignoreContinuation && trimmedLastChar == '\\' { + return p.readContinuationLines(line[:len(line)-1]) + } + + // Check if ignore inline comment + if !ignoreInlineComment { + var i int + if 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, '"')) && !preserveSurroundedQuote { + line = line[1 : len(line)-1] + } else if len(valQuote) == 0 && unescapeValueCommentSymbols { + if strings.Contains(line, `\;`) { + line = strings.Replace(line, `\;`, ";", -1) + } + if strings.Contains(line, `\#`) { + line = strings.Replace(line, `\#`, "#", -1) + } + } else if allowPythonMultilines && lastChar == '\n' { + parserBufferPeekResult, _ := p.buf.Peek(parserBufferSize) + peekBuffer := bytes.NewBuffer(parserBufferPeekResult) + + val := line + + for { + peekData, peekErr := peekBuffer.ReadBytes('\n') + if peekErr != nil { + if peekErr == io.EOF { + return val, nil + } + return "", peekErr + } + + peekMatches := pythonMultiline.FindStringSubmatch(string(peekData)) + if len(peekMatches) != 3 { + return val, nil + } + + // NOTE: Return if not a python-ini multi-line value. + currentIdentSize := len(peekMatches[1]) + if currentIdentSize <= 0 { + return val, nil + } + + // NOTE: Just advance the parser reader (buffer) in-sync with the peek buffer. + _, err := p.readUntil('\n') + if err != nil { + return "", err + } + + val += fmt.Sprintf("\n%s", peekMatches[2]) + } + } + + return line, nil +} + +// parse parses data through an io.Reader. +func (f *File) parse(reader io.Reader) (err error) { + p := newParser(reader) + if err = p.BOM(); err != nil { + return fmt.Errorf("BOM: %v", err) + } + + // Ignore error because default section name is never empty string. + name := DEFAULT_SECTION + if f.options.Insensitive { + name = strings.ToLower(DEFAULT_SECTION) + } + 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 1kb at a time. + currentPeekSize := 1024 + + 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, + f.options.IgnoreContinuation, + f.options.IgnoreInlineComment, + f.options.UnescapeValueDoubleQuotes, + f.options.UnescapeValueCommentSymbols, + f.options.AllowPythonMultilineValues, + f.options.SpaceBeforeInlineComment, + f.options.PreserveSurroundedQuote) + 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, + f.options.IgnoreContinuation, + f.options.IgnoreInlineComment, + f.options.UnescapeValueDoubleQuotes, + f.options.UnescapeValueCommentSymbols, + f.options.AllowPythonMultilineValues, + f.options.SpaceBeforeInlineComment, + f.options.PreserveSurroundedQuote) + 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 000000000..bc32c620d --- /dev/null +++ b/vendor/gopkg.in/ini.v1/section.go @@ -0,0 +1,259 @@ +// 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) { + // FIXME: change to section level lock? + 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) + } else { + 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 +} + +// Haskey is a backwards-compatible name for HasKey. +// TODO: delete me in v2 +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 000000000..a9dfed078 --- /dev/null +++ b/vendor/gopkg.in/ini.v1/struct.go @@ -0,0 +1,512 @@ +// 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 ( + // AllCapsUnderscore converts to format ALL_CAPS_UNDERSCORE. + AllCapsUnderscore 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 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 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 strcut. +func setWithProperType(t reflect.Type, key *Key, field reflect.Value, delim string, allowShadow, isStrict bool) error { + switch t.Kind() { + case reflect.String: + if len(key.String()) == 0 { + return nil + } + field.SetString(key.String()) + case reflect.Bool: + boolVal, err := key.Bool() + if err != nil { + return wrapStrictError(err, isStrict) + } + field.SetBool(boolVal) + case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: + durationVal, err := key.Duration() + // Skip zero value + if err == nil && int64(durationVal) > 0 { + field.Set(reflect.ValueOf(durationVal)) + return nil + } + + intVal, err := key.Int64() + if err != nil { + return wrapStrictError(err, isStrict) + } + 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 { + field.Set(reflect.ValueOf(durationVal)) + return nil + } + + uintVal, err := key.Uint64() + if err != nil { + return wrapStrictError(err, isStrict) + } + field.SetUint(uintVal) + + case reflect.Float32, reflect.Float64: + floatVal, err := key.Float64() + if err != nil { + return wrapStrictError(err, isStrict) + } + field.SetFloat(floatVal) + case reflectTime: + timeVal, err := key.Time() + if err != nil { + return wrapStrictError(err, isStrict) + } + 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 + } + + isAnonymous := tpField.Type.Kind() == reflect.Ptr && tpField.Anonymous + isStruct := tpField.Type.Kind() == reflect.Struct + if isAnonymous { + field.Set(reflect.New(tpField.Type.Elem())) + } + + if isAnonymous || isStruct { + if sec, err := s.f.GetSection(fieldName); err == nil { + 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) +} + +// MapTo 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) +} + +// MapTo 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) +} + +// MapTo 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) error { + slice := field.Slice(0, field.Len()) + if field.Len() == 0 { + return nil + } + + var buf bytes.Buffer + sliceOf := field.Type().Elem().Kind() + 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 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()-1]) + return nil +} + +// reflectWithProperType does the opposite thing as setWithProperType. +func reflectWithProperType(t reflect.Type, key *Key, field reflect.Value, delim string) 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) + 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 + } + + opts := strings.SplitN(tag, ",", 2) + if len(opts) == 2 && opts[1] == "omitempty" && isEmptyValue(field) { + continue + } + + fieldName := s.parseFieldName(tpField.Name, opts[0]) + 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"))); 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) +} + +// ReflectFrom 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) +}