From f4fc9dd09a7d3699046271f8d0f410cf7ac715af Mon Sep 17 00:00:00 2001 From: "xiaohan.liang" Date: Fri, 9 Aug 2019 15:00:23 +0800 Subject: [PATCH] Rewrite all files, remove sensitive information --- builder/jdcloud/artifact.go | 43 + builder/jdcloud/builder.go | 91 ++ builder/jdcloud/common.go | 432 ++++++ builder/jdcloud/credential_config.go | 86 ++ builder/jdcloud/credential_config_test.go | 34 + builder/jdcloud/instance_config.go | 53 + builder/jdcloud/instance_config_test.go | 54 + builder/jdcloud/step_config_credentials.go | 73 + builder/jdcloud/step_create_image.go | 74 + builder/jdcloud/step_create_instance.go | 223 +++ builder/jdcloud/step_stop_instance.go | 39 + builder/jdcloud/step_validate_parameters.go | 109 ++ command/plugin.go | 2 + examples/jdcloud/credential-key.json | 34 + examples/jdcloud/credential-new-key.json | 31 + examples/jdcloud/credential-password.json | 32 + examples/jdcloud/use_new_subnet.json | 34 + go.mod | 4 +- go.sum | 6 + .../jdcloud-api/jdcloud-sdk-go/LICENSE | 201 +++ .../jdcloud-api/jdcloud-sdk-go/core/Config.go | 44 + .../jdcloud-api/jdcloud-sdk-go/core/Const.go | 32 + .../jdcloud-sdk-go/core/Credential.go | 26 + .../jdcloud-api/jdcloud-sdk-go/core/Doc.go | 4 + .../jdcloud-sdk-go/core/ErrorResponse.go | 21 + .../jdcloud-sdk-go/core/JdcloudClient.go | 120 ++ .../jdcloud-sdk-go/core/JdcloudRequest.go | 55 + .../jdcloud-api/jdcloud-sdk-go/core/Logger.go | 43 + .../jdcloud-sdk-go/core/ParameterBuilder.go | 216 +++ .../jdcloud-sdk-go/core/ResponseProcessor.go | 40 + .../jdcloud-api/jdcloud-sdk-go/core/Signer.go | 380 ++++++ .../jdcloud-api/jdcloud-sdk-go/core/Utils.go | 11 + .../jdcloud-sdk-go/core/Version.go | 17 + .../services/charge/models/Charge.go | 36 + .../services/charge/models/ChargeSpec.go | 30 + .../services/common/models/Filter.go | 30 + .../services/common/models/Quota.go | 30 + .../services/common/models/SimpleResponses.go | 24 + .../services/common/models/Sort.go | 27 + .../services/common/models/TagFilter.go | 27 + .../services/disk/models/Disk.go | 73 + .../services/disk/models/DiskAttachment.go | 39 + .../services/disk/models/DiskSpec.go | 49 + .../services/disk/models/DiskSpecification.go | 54 + .../services/disk/models/Quota.go | 27 + .../services/disk/models/ShareInfo.go | 27 + .../services/disk/models/Snapshot.go | 54 + .../services/disk/models/SnapshotSpec.go | 30 + .../services/disk/models/Soldout.go | 30 + .../services/disk/models/Tag.go | 27 + .../services/disk/models/TagFilter.go | 27 + .../services/vm/apis/AssociateElasticIp.go | 128 ++ .../services/vm/apis/AttachDisk.go | 150 ++ .../vm/apis/AttachNetworkInterface.go | 139 ++ .../services/vm/apis/CopyImages.go | 130 ++ .../services/vm/apis/CreateImage.go | 155 +++ .../services/vm/apis/CreateInstances.go | 148 ++ .../services/vm/apis/CreateKeypair.go | 121 ++ .../services/vm/apis/DeleteImage.go | 114 ++ .../services/vm/apis/DeleteInstance.go | 114 ++ .../services/vm/apis/DeleteKeypair.go | 114 ++ .../services/vm/apis/DescribeImage.go | 116 ++ .../vm/apis/DescribeImageConstraints.go | 116 ++ .../vm/apis/DescribeImageConstraintsBatch.go | 113 ++ .../services/vm/apis/DescribeImageMembers.go | 115 ++ .../services/vm/apis/DescribeImages.go | 180 +++ .../services/vm/apis/DescribeInstance.go | 116 ++ .../apis/DescribeInstancePrivateIpAddress.go | 161 +++ .../vm/apis/DescribeInstanceStatus.go | 161 +++ .../services/vm/apis/DescribeInstanceTypes.go | 122 ++ .../vm/apis/DescribeInstanceVncUrl.go | 115 ++ .../services/vm/apis/DescribeInstances.go | 170 +++ .../services/vm/apis/DescribeKeypairs.go | 140 ++ .../services/vm/apis/DescribeQuotas.go | 128 ++ .../services/vm/apis/DetachDisk.go | 139 ++ .../vm/apis/DetachNetworkInterface.go | 128 ++ .../services/vm/apis/DisassociateElasticIp.go | 128 ++ .../services/vm/apis/ImportKeypair.go | 134 ++ .../services/vm/apis/ModifyImageAttribute.go | 136 ++ .../vm/apis/ModifyInstanceAttribute.go | 136 ++ .../vm/apis/ModifyInstanceDiskAttribute.go | 126 ++ .../vm/apis/ModifyInstanceNetworkAttribute.go | 126 ++ .../vm/apis/ModifyInstancePassword.go | 128 ++ .../services/vm/apis/RebootInstance.go | 114 ++ .../services/vm/apis/RebuildInstance.go | 150 ++ .../services/vm/apis/ResizeInstance.go | 128 ++ .../services/vm/apis/ShareImage.go | 125 ++ .../services/vm/apis/StartInstance.go | 114 ++ .../services/vm/apis/StopInstance.go | 114 ++ .../services/vm/apis/UnShareImage.go | 125 ++ .../services/vm/client/VmClient.go | 962 +++++++++++++ .../jdcloud-sdk-go/services/vm/models/Ag.go | 27 + .../services/vm/models/CopyImage.go | 27 + .../jdcloud-sdk-go/services/vm/models/Gpu.go | 27 + .../services/vm/models/Image.go | 72 + .../services/vm/models/ImageConstraint.go | 27 + .../vm/models/ImageInstanceTypeConstraint.go | 27 + .../services/vm/models/Instance.go | 89 ++ .../vm/models/InstanceDiskAttachment.go | 46 + .../vm/models/InstanceDiskAttachmentSpec.go | 47 + .../vm/models/InstanceDiskAttribute.go | 30 + .../vm/models/InstanceNetworkAttribute.go | 27 + .../vm/models/InstanceNetworkInterface.go | 46 + .../InstanceNetworkInterfaceAttachment.go | 30 + .../InstanceNetworkInterfaceAttachmentSpec.go | 28 + .../vm/models/InstancePrivateIpAddress.go | 27 + .../services/vm/models/InstanceSpec.go | 69 + .../services/vm/models/InstanceStatus.go | 27 + .../services/vm/models/InstanceTemplate.go | 39 + .../vm/models/InstanceTemplateData.go | 48 + .../vm/models/InstanceTemplateDisk.go | 30 + .../models/InstanceTemplateDiskAttachment.go | 46 + .../InstanceTemplateDiskAttachmentSpec.go | 44 + .../vm/models/InstanceTemplateDiskSpec.go | 30 + .../vm/models/InstanceTemplateElasticIp.go | 30 + .../models/InstanceTemplateElasticIpSpec.go | 30 + ...eTemplateNetworkInterfaceAttachmentSpec.go | 30 + .../InstanceTemplateNetworkInterfaceSpec.go | 30 + .../vm/models/InstanceTemplateSpec.go | 45 + .../services/vm/models/InstanceType.go | 48 + .../services/vm/models/InstanceTypeState.go | 27 + .../services/vm/models/Keypair.go | 30 + .../services/vm/models/LocalDisk.go | 27 + .../services/vm/models/Quota.go | 30 + .../services/vm/models/SecurityGroupSimple.go | 27 + .../jdcloud-sdk-go/services/vm/models/Tag.go | 27 + .../services/vm/models/TagFilter.go | 27 + .../services/vpc/apis/AddNetworkAclRules.go | 129 ++ .../vpc/apis/AddNetworkSecurityGroupRules.go | 129 ++ .../services/vpc/apis/AddRouteTableRules.go | 129 ++ .../services/vpc/apis/AssignSecondaryIps.go | 147 ++ .../services/vpc/apis/AssociateElasticIp.go | 147 ++ .../services/vpc/apis/AssociateNetworkAcl.go | 128 ++ .../services/vpc/apis/AssociateRouteTable.go | 128 ++ .../services/vpc/apis/CreateElasticIps.go | 142 ++ .../services/vpc/apis/CreateNetworkAcl.go | 140 ++ .../vpc/apis/CreateNetworkInterface.go | 203 +++ .../vpc/apis/CreateNetworkSecurityGroup.go | 140 ++ .../services/vpc/apis/CreateRouteTable.go | 140 ++ .../services/vpc/apis/CreateSubnet.go | 165 +++ .../services/vpc/apis/CreateVpc.go | 137 ++ .../services/vpc/apis/CreateVpcPeering.go | 155 +++ .../services/vpc/apis/DeleteElasticIp.go | 114 ++ .../services/vpc/apis/DeleteNetworkAcl.go | 114 ++ .../vpc/apis/DeleteNetworkInterface.go | 114 ++ .../vpc/apis/DeleteNetworkSecurityGroup.go | 114 ++ .../services/vpc/apis/DeleteRouteTable.go | 114 ++ .../services/vpc/apis/DeleteSubnet.go | 114 ++ .../services/vpc/apis/DeleteVpc.go | 114 ++ .../services/vpc/apis/DeleteVpcPeering.go | 114 ++ .../services/vpc/apis/DescribeElasticIp.go | 116 ++ .../services/vpc/apis/DescribeElasticIps.go | 146 ++ .../services/vpc/apis/DescribeNetworkAcl.go | 116 ++ .../services/vpc/apis/DescribeNetworkAcls.go | 146 ++ .../vpc/apis/DescribeNetworkInterface.go | 116 ++ .../vpc/apis/DescribeNetworkInterfaces.go | 152 +++ .../vpc/apis/DescribeNetworkSecurityGroup.go | 116 ++ .../vpc/apis/DescribeNetworkSecurityGroups.go | 146 ++ .../services/vpc/apis/DescribeQuota.go | 126 ++ .../services/vpc/apis/DescribeRouteTable.go | 116 ++ .../services/vpc/apis/DescribeRouteTables.go | 146 ++ .../services/vpc/apis/DescribeSubnet.go | 116 ++ .../services/vpc/apis/DescribeSubnets.go | 152 +++ .../services/vpc/apis/DescribeVpc.go | 116 ++ .../services/vpc/apis/DescribeVpcPeering.go | 116 ++ .../services/vpc/apis/DescribeVpcPeerings.go | 149 ++ .../services/vpc/apis/DescribeVpcs.go | 143 ++ .../vpc/apis/DisassociateElasticIp.go | 136 ++ .../vpc/apis/DisassociateNetworkAcl.go | 128 ++ .../vpc/apis/DisassociateRouteTable.go | 128 ++ .../services/vpc/apis/ModifyElasticIp.go | 128 ++ .../services/vpc/apis/ModifyNetworkAcl.go | 136 ++ .../vpc/apis/ModifyNetworkAclRules.go | 129 ++ .../vpc/apis/ModifyNetworkInterface.go | 147 ++ .../vpc/apis/ModifyNetworkSecurityGroup.go | 136 ++ .../apis/ModifyNetworkSecurityGroupRules.go | 129 ++ .../services/vpc/apis/ModifyRouteTable.go | 136 ++ .../vpc/apis/ModifyRouteTableRules.go | 129 ++ .../services/vpc/apis/ModifySubnet.go | 136 ++ .../services/vpc/apis/ModifyVpc.go | 136 ++ .../services/vpc/apis/ModifyVpcPeering.go | 136 ++ .../vpc/apis/RemoveNetworkAclRules.go | 128 ++ .../apis/RemoveNetworkSecurityGroupRules.go | 128 ++ .../vpc/apis/RemoveRouteTableRules.go | 128 ++ .../services/vpc/apis/UnassignSecondaryIps.go | 125 ++ .../services/vpc/client/VpcClient.go | 1215 +++++++++++++++++ .../vpc/models/AddNetworkAclRuleSpec.go | 45 + .../vpc/models/AddNetworkAclRulesSpec.go | 24 + .../AddNetworkSecurityGroupRulesSpec.go | 24 + .../services/vpc/models/AddRouteTableRules.go | 33 + .../vpc/models/AddRouteTableRulesSpec.go | 24 + .../vpc/models/AddSecurityGroupRules.go | 39 + .../vpc/models/AssignSecondaryIpsSpec.go | 30 + .../vpc/models/AssociateElasticIpSpec.go | 30 + .../vpc/models/AssociateRouteTableSpec.go | 24 + .../vpc/models/CreateElasticIpSpec.go | 30 + .../vpc/models/CreateVpcPeeringSpec.go | 33 + .../vpc/models/DisassociateElasticIpSpec.go | 27 + .../vpc/models/DisassociateRouteTableSpec.go | 24 + .../services/vpc/models/ElasticIp.go | 55 + .../services/vpc/models/ElasticIpSpec.go | 31 + .../vpc/models/ModifyElasticIpSpec.go | 24 + .../vpc/models/ModifyNetworkAclRuleSpec.go | 45 + .../vpc/models/ModifyNetworkAclRuleSpecs.go | 24 + .../vpc/models/ModifyNetworkAclRulesSpec.go | 24 + .../vpc/models/ModifyNetworkAclSpec.go | 27 + .../vpc/models/ModifyNetworkInterfaceSpec.go | 30 + .../models/ModifyNetworkSecurityGroupSpec.go | 27 + .../services/vpc/models/ModifyQuotaSpec.go | 30 + .../vpc/models/ModifyRouteTableRules.go | 36 + .../vpc/models/ModifyRouteTableRulesSpec.go | 24 + .../vpc/models/ModifyRouteTableSpec.go | 27 + .../vpc/models/ModifySecurityGroupRuleSpec.go | 24 + .../vpc/models/ModifySecurityGroupRules.go | 39 + .../services/vpc/models/ModifySubnetSpec.go | 27 + .../vpc/models/ModifyVpcPeeringSpec.go | 27 + .../services/vpc/models/ModifyVpcSpec.go | 27 + .../services/vpc/models/NetworkAcl.go | 42 + .../services/vpc/models/NetworkAclRule.go | 51 + .../services/vpc/models/NetworkAclSpec.go | 30 + .../services/vpc/models/NetworkInterface.go | 72 + .../vpc/models/NetworkInterfacePrivateIp.go | 30 + .../vpc/models/NetworkInterfaceSpec.go | 48 + .../vpc/models/NetworkSecurityGroup.go | 39 + .../vpc/models/NetworkSecurityGroupSpec.go | 30 + .../services/vpc/models/Quota.go | 33 + .../services/vpc/models/RouteTable.go | 45 + .../services/vpc/models/RouteTableRule.go | 36 + .../services/vpc/models/RouteTableSpec.go | 30 + .../services/vpc/models/SecurityGroupRule.go | 48 + .../services/vpc/models/Segment.go | 45 + .../services/vpc/models/Subnet.go | 54 + .../services/vpc/models/SubnetSpec.go | 36 + .../vpc/models/UnassignSecondaryIpsSpec.go | 24 + .../jdcloud-sdk-go/services/vpc/models/Vpc.go | 45 + .../services/vpc/models/VpcPeering.go | 42 + .../services/vpc/models/VpcPeeringVpcInfo.go | 30 + .../services/vpc/models/VpcSpec.go | 30 + vendor/modules.txt | 11 + website/source/docs/builders/jdcloud.html.md | 80 ++ website/source/layouts/docs.erb | 3 + 241 files changed, 21469 insertions(+), 1 deletion(-) create mode 100644 builder/jdcloud/artifact.go create mode 100644 builder/jdcloud/builder.go create mode 100644 builder/jdcloud/common.go create mode 100644 builder/jdcloud/credential_config.go create mode 100644 builder/jdcloud/credential_config_test.go create mode 100644 builder/jdcloud/instance_config.go create mode 100644 builder/jdcloud/instance_config_test.go create mode 100644 builder/jdcloud/step_config_credentials.go create mode 100644 builder/jdcloud/step_create_image.go create mode 100644 builder/jdcloud/step_create_instance.go create mode 100644 builder/jdcloud/step_stop_instance.go create mode 100644 builder/jdcloud/step_validate_parameters.go create mode 100644 examples/jdcloud/credential-key.json create mode 100644 examples/jdcloud/credential-new-key.json create mode 100644 examples/jdcloud/credential-password.json create mode 100644 examples/jdcloud/use_new_subnet.json create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/LICENSE create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/core/Config.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/core/Const.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/core/Credential.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/core/Doc.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/core/ErrorResponse.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/core/JdcloudClient.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/core/JdcloudRequest.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/core/Logger.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/core/ParameterBuilder.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/core/ResponseProcessor.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/core/Signer.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/core/Utils.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/core/Version.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/charge/models/Charge.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/charge/models/ChargeSpec.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/common/models/Filter.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/common/models/Quota.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/common/models/SimpleResponses.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/common/models/Sort.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/common/models/TagFilter.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/disk/models/Disk.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/disk/models/DiskAttachment.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/disk/models/DiskSpec.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/disk/models/DiskSpecification.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/disk/models/Quota.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/disk/models/ShareInfo.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/disk/models/Snapshot.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/disk/models/SnapshotSpec.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/disk/models/Soldout.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/disk/models/Tag.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/disk/models/TagFilter.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/AssociateElasticIp.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/AttachDisk.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/AttachNetworkInterface.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/CopyImages.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/CreateImage.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/CreateInstances.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/CreateKeypair.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/DeleteImage.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/DeleteInstance.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/DeleteKeypair.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/DescribeImage.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/DescribeImageConstraints.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/DescribeImageConstraintsBatch.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/DescribeImageMembers.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/DescribeImages.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/DescribeInstance.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/DescribeInstancePrivateIpAddress.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/DescribeInstanceStatus.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/DescribeInstanceTypes.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/DescribeInstanceVncUrl.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/DescribeInstances.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/DescribeKeypairs.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/DescribeQuotas.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/DetachDisk.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/DetachNetworkInterface.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/DisassociateElasticIp.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/ImportKeypair.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/ModifyImageAttribute.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/ModifyInstanceAttribute.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/ModifyInstanceDiskAttribute.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/ModifyInstanceNetworkAttribute.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/ModifyInstancePassword.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/RebootInstance.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/RebuildInstance.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/ResizeInstance.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/ShareImage.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/StartInstance.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/StopInstance.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/UnShareImage.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/client/VmClient.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/Ag.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/CopyImage.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/Gpu.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/Image.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/ImageConstraint.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/ImageInstanceTypeConstraint.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/Instance.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/InstanceDiskAttachment.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/InstanceDiskAttachmentSpec.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/InstanceDiskAttribute.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/InstanceNetworkAttribute.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/InstanceNetworkInterface.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/InstanceNetworkInterfaceAttachment.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/InstanceNetworkInterfaceAttachmentSpec.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/InstancePrivateIpAddress.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/InstanceSpec.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/InstanceStatus.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/InstanceTemplate.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/InstanceTemplateData.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/InstanceTemplateDisk.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/InstanceTemplateDiskAttachment.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/InstanceTemplateDiskAttachmentSpec.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/InstanceTemplateDiskSpec.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/InstanceTemplateElasticIp.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/InstanceTemplateElasticIpSpec.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/InstanceTemplateNetworkInterfaceAttachmentSpec.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/InstanceTemplateNetworkInterfaceSpec.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/InstanceTemplateSpec.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/InstanceType.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/InstanceTypeState.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/Keypair.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/LocalDisk.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/Quota.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/SecurityGroupSimple.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/Tag.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/TagFilter.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/AddNetworkAclRules.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/AddNetworkSecurityGroupRules.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/AddRouteTableRules.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/AssignSecondaryIps.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/AssociateElasticIp.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/AssociateNetworkAcl.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/AssociateRouteTable.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/CreateElasticIps.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/CreateNetworkAcl.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/CreateNetworkInterface.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/CreateNetworkSecurityGroup.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/CreateRouteTable.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/CreateSubnet.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/CreateVpc.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/CreateVpcPeering.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/DeleteElasticIp.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/DeleteNetworkAcl.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/DeleteNetworkInterface.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/DeleteNetworkSecurityGroup.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/DeleteRouteTable.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/DeleteSubnet.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/DeleteVpc.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/DeleteVpcPeering.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/DescribeElasticIp.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/DescribeElasticIps.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/DescribeNetworkAcl.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/DescribeNetworkAcls.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/DescribeNetworkInterface.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/DescribeNetworkInterfaces.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/DescribeNetworkSecurityGroup.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/DescribeNetworkSecurityGroups.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/DescribeQuota.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/DescribeRouteTable.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/DescribeRouteTables.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/DescribeSubnet.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/DescribeSubnets.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/DescribeVpc.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/DescribeVpcPeering.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/DescribeVpcPeerings.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/DescribeVpcs.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/DisassociateElasticIp.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/DisassociateNetworkAcl.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/DisassociateRouteTable.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/ModifyElasticIp.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/ModifyNetworkAcl.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/ModifyNetworkAclRules.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/ModifyNetworkInterface.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/ModifyNetworkSecurityGroup.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/ModifyNetworkSecurityGroupRules.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/ModifyRouteTable.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/ModifyRouteTableRules.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/ModifySubnet.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/ModifyVpc.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/ModifyVpcPeering.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/RemoveNetworkAclRules.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/RemoveNetworkSecurityGroupRules.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/RemoveRouteTableRules.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/UnassignSecondaryIps.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/client/VpcClient.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/AddNetworkAclRuleSpec.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/AddNetworkAclRulesSpec.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/AddNetworkSecurityGroupRulesSpec.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/AddRouteTableRules.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/AddRouteTableRulesSpec.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/AddSecurityGroupRules.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/AssignSecondaryIpsSpec.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/AssociateElasticIpSpec.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/AssociateRouteTableSpec.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/CreateElasticIpSpec.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/CreateVpcPeeringSpec.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/DisassociateElasticIpSpec.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/DisassociateRouteTableSpec.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/ElasticIp.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/ElasticIpSpec.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/ModifyElasticIpSpec.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/ModifyNetworkAclRuleSpec.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/ModifyNetworkAclRuleSpecs.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/ModifyNetworkAclRulesSpec.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/ModifyNetworkAclSpec.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/ModifyNetworkInterfaceSpec.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/ModifyNetworkSecurityGroupSpec.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/ModifyQuotaSpec.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/ModifyRouteTableRules.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/ModifyRouteTableRulesSpec.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/ModifyRouteTableSpec.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/ModifySecurityGroupRuleSpec.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/ModifySecurityGroupRules.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/ModifySubnetSpec.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/ModifyVpcPeeringSpec.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/ModifyVpcSpec.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/NetworkAcl.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/NetworkAclRule.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/NetworkAclSpec.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/NetworkInterface.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/NetworkInterfacePrivateIp.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/NetworkInterfaceSpec.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/NetworkSecurityGroup.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/NetworkSecurityGroupSpec.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/Quota.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/RouteTable.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/RouteTableRule.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/RouteTableSpec.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/SecurityGroupRule.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/Segment.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/Subnet.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/SubnetSpec.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/UnassignSecondaryIpsSpec.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/Vpc.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/VpcPeering.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/VpcPeeringVpcInfo.go create mode 100644 vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/VpcSpec.go create mode 100644 website/source/docs/builders/jdcloud.html.md diff --git a/builder/jdcloud/artifact.go b/builder/jdcloud/artifact.go new file mode 100644 index 000000000..a56d231b0 --- /dev/null +++ b/builder/jdcloud/artifact.go @@ -0,0 +1,43 @@ +package jdcloud + +import ( + "fmt" + "sort" + "strings" +) + +type Artifact struct { + ImageId string + RegionID string +} + +func (*Artifact) BuilderId() string { + return BUILDER_ID +} + +func (*Artifact) Files() []string { + return nil +} + +// Plan +// Though this part is supposed to be an array of Image Ids associated +// with its region, but currently only a single image is supported +func (a *Artifact) Id() string { + parts := []string{fmt.Sprintf("%s:%s", a.RegionID, a.ImageId)} + sort.Strings(parts) + return strings.Join(parts, ",") +} + +func (a *Artifact) String() string { + return fmt.Sprintf("A VMImage was created: %s", a.ImageId) +} + +// Plan +// State and destroy function is abandoned +func (a *Artifact) State(name string) interface{} { + return nil +} + +func (a *Artifact) Destroy() error { + return nil +} diff --git a/builder/jdcloud/builder.go b/builder/jdcloud/builder.go new file mode 100644 index 000000000..4b3700f11 --- /dev/null +++ b/builder/jdcloud/builder.go @@ -0,0 +1,91 @@ +package jdcloud + +import ( + "context" + "fmt" + "github.com/hashicorp/packer/common" + "github.com/hashicorp/packer/helper/communicator" + "github.com/hashicorp/packer/helper/config" + "github.com/hashicorp/packer/helper/multistep" + "github.com/hashicorp/packer/packer" + "github.com/hashicorp/packer/template/interpolate" +) + +func (b *Builder) Prepare(raws ...interface{}) ([]string, error) { + err := config.Decode(&b.config, &config.DecodeOpts{ + Interpolate: true, + InterpolateContext: &b.config.ctx, + InterpolateFilter: &interpolate.RenderFilter{ + Exclude: []string{ + "boot_command", + }, + }, + }, raws...) + if err != nil { + return nil, fmt.Errorf("[ERROR] Failed in decoding JSON->mapstructure") + } + + errs := &packer.MultiError{} + errs = packer.MultiErrorAppend(errs, b.config.JDCloudCredentialConfig.Prepare(&b.config.ctx)...) + errs = packer.MultiErrorAppend(errs, b.config.JDCloudInstanceSpecConfig.Prepare(&b.config.ctx)...) + if errs != nil && len(errs.Errors) != 0 { + return nil, errs + } + + packer.LogSecretFilter.Set(b.config.AccessKey, b.config.SecretKey) + + return nil, nil +} + +func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (packer.Artifact, error) { + + state := new(multistep.BasicStateBag) + state.Put("hook", hook) + state.Put("ui", ui) + state.Put("config", b.config) + + steps := []multistep.Step{ + + &stepValidateParameters{ + InstanceSpecConfig: &b.config.JDCloudInstanceSpecConfig, + }, + + &stepConfigCredentials{ + InstanceSpecConfig: &b.config.JDCloudInstanceSpecConfig, + }, + + &stepCreateJDCloudInstance{ + InstanceSpecConfig: &b.config.JDCloudInstanceSpecConfig, + CredentialConfig: &b.config.JDCloudCredentialConfig, + }, + + &communicator.StepConnect{ + Config: &b.config.JDCloudInstanceSpecConfig.Comm, + SSHConfig: b.config.JDCloudInstanceSpecConfig.Comm.SSHConfigFunc(), + Host: instanceHost, + }, + + &common.StepProvision{}, + + &stepStopJDCloudInstance{ + InstanceSpecConfig: &b.config.JDCloudInstanceSpecConfig, + }, + + &stepCreateJDCloudImage{ + InstanceSpecConfig: &b.config.JDCloudInstanceSpecConfig, + }, + } + + b.runner = common.NewRunnerWithPauseFn(steps, b.config.PackerConfig, ui, state) + b.runner.Run(ctx, state) + + if rawErr, ok := state.GetOk("error"); ok { + return nil, rawErr.(error) + } + + artifact := &Artifact{ + ImageId: b.config.ArtifactId, + RegionID: b.config.RegionId, + } + return artifact, nil +} diff --git a/builder/jdcloud/common.go b/builder/jdcloud/common.go new file mode 100644 index 000000000..d94d9c976 --- /dev/null +++ b/builder/jdcloud/common.go @@ -0,0 +1,432 @@ +package jdcloud + +import ( + "fmt" + "github.com/hashicorp/packer/common" + "github.com/hashicorp/packer/helper/multistep" + "github.com/hashicorp/packer/template/interpolate" + vm "github.com/jdcloud-api/jdcloud-sdk-go/services/vm/client" + vpc "github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/client" + "log" + "strings" + "sync" + "time" +) + +const ( + FINE = 0 + CONNECT_FAILED = "Client.Timeout exceeded" + VM_PENDING = "pending" + VM_RUNNING = "running" + VM_STARTING = "starting" + VM_STOPPING = "stopping" + VM_STOPPED = "stopped" + READY = "ready" + BUILDER_ID = "hashicorp.jdcloud" +) + +var ( + VmClient *vm.VmClient + VpcClient *vpc.VpcClient + Region string +) + +type Config struct { + JDCloudCredentialConfig `mapstructure:",squash"` + JDCloudInstanceSpecConfig `mapstructure:",squash"` + common.PackerConfig `mapstructure:",squash"` + ctx interpolate.Context +} + +type Builder struct { + config Config + runner multistep.Runner +} + +func Retry(timeout time.Duration, f RetryFunc) error { + // These are used to pull the error out of the function; need a mutex to + // avoid a data race. + var resultErr error + var resultErrMu sync.Mutex + + c := &StateChangeConf{ + Pending: []string{"retryableerror"}, + Target: []string{"success"}, + Timeout: timeout, + MinTimeout: 500 * time.Millisecond, + Refresh: func() (interface{}, string, error) { + rerr := f() + + resultErrMu.Lock() + defer resultErrMu.Unlock() + + if rerr == nil { + resultErr = nil + return 42, "success", nil + } + + resultErr = rerr.Err + + if rerr.Retryable { + return 42, "retryableerror", nil + } + return nil, "quit", rerr.Err + }, + } + + _, waitErr := c.WaitForState() + + // Need to acquire the lock here to be able to avoid race using resultErr as + // the return value + resultErrMu.Lock() + defer resultErrMu.Unlock() + + // resultErr may be nil because the wait timed out and resultErr was never + // set; this is still an error + if resultErr == nil { + return waitErr + } + // resultErr takes precedence over waitErr if both are set because it is + // more likely to be useful + return resultErr +} + +// RetryFunc is the function retried until it succeeds. +type RetryFunc func() *RetryError + +// RetryError is the required return type of RetryFunc. It forces client code +// to choose whether or not a given error is retryable. +type RetryError struct { + Err error + Retryable bool +} + +// RetryableError is a helper to create a RetryError that's retryable from a +// given error. +func RetryableError(err error) *RetryError { + if err == nil { + return nil + } + return &RetryError{Err: err, Retryable: true} +} + +// NonRetryableError is a helper to create a RetryError that's _not_ retryable +// from a given error. +func NonRetryableError(err error) *RetryError { + if err == nil { + return nil + } + return &RetryError{Err: err, Retryable: false} +} + +// WaitForState watches an object and waits for it to achieve the state +// specified in the configuration using the specified Refresh() func, +// waiting the number of seconds specified in the timeout configuration. +// +// If the Refresh function returns an error, exit immediately with that error. +// +// If the Refresh function returns a state other than the Target state or one +// listed in Pending, return immediately with an error. +// +// If the Timeout is exceeded before reaching the Target state, return an +// error. +// +// Otherwise, the result is the result of the first call to the Refresh function to +// reach the target state. +func (conf *StateChangeConf) WaitForState() (interface{}, error) { + log.Printf("[DEBUG] Waiting for state to become: %s", conf.Target) + + notfoundTick := 0 + targetOccurence := 0 + + // Set a default for times to check for not found + if conf.NotFoundChecks == 0 { + conf.NotFoundChecks = 20 + } + + if conf.ContinuousTargetOccurence == 0 { + conf.ContinuousTargetOccurence = 1 + } + + type Result struct { + Result interface{} + State string + Error error + Done bool + } + + // Read every result from the refresh loop, waiting for a positive result.Done. + resCh := make(chan Result, 1) + // cancellation channel for the refresh loop + cancelCh := make(chan struct{}) + + result := Result{} + + go func() { + defer close(resCh) + + time.Sleep(conf.Delay) + + // start with 0 delay for the first loop + var wait time.Duration + + for { + // store the last result + resCh <- result + + // wait and watch for cancellation + select { + case <-cancelCh: + return + case <-time.After(wait): + // first round had no wait + if wait == 0 { + wait = 100 * time.Millisecond + } + } + + res, currentState, err := conf.Refresh() + result = Result{ + Result: res, + State: currentState, + Error: err, + } + + if err != nil { + resCh <- result + return + } + + // If we're waiting for the absence of a thing, then return + if res == nil && len(conf.Target) == 0 { + targetOccurence++ + if conf.ContinuousTargetOccurence == targetOccurence { + result.Done = true + resCh <- result + return + } + continue + } + + if res == nil { + // If we didn't find the resource, check if we have been + // not finding it for awhile, and if so, report an error. + notfoundTick++ + if notfoundTick > conf.NotFoundChecks { + result.Error = &NotFoundError{ + LastError: err, + Retries: notfoundTick, + } + resCh <- result + return + } + } else { + // Reset the counter for when a resource isn't found + notfoundTick = 0 + found := false + + for _, allowed := range conf.Target { + if currentState == allowed { + found = true + targetOccurence++ + if conf.ContinuousTargetOccurence == targetOccurence { + result.Done = true + resCh <- result + return + } + continue + } + } + + for _, allowed := range conf.Pending { + if currentState == allowed { + found = true + targetOccurence = 0 + break + } + } + + if !found && len(conf.Pending) > 0 { + result.Error = &UnexpectedStateError{ + LastError: err, + State: result.State, + ExpectedState: conf.Target, + } + resCh <- result + return + } + } + + // Wait between refreshes using exponential backoff, except when + // waiting for the target state to reoccur. + if targetOccurence == 0 { + wait *= 2 + } + + // If a poll interval has been specified, choose that interval. + // Otherwise bound the default value. + if conf.PollInterval > 0 && conf.PollInterval < 180*time.Second { + wait = conf.PollInterval + } else { + if wait < conf.MinTimeout { + wait = conf.MinTimeout + } else if wait > 10*time.Second { + wait = 10 * time.Second + } + } + + log.Printf("[TRACE] Waiting %s before next try", wait) + } + }() + + // store the last value result from the refresh loop + lastResult := Result{} + + timeout := time.After(conf.Timeout) + for { + select { + case r, ok := <-resCh: + // channel closed, so return the last result + if !ok { + return lastResult.Result, lastResult.Error + } + + // we reached the intended state + if r.Done { + return r.Result, r.Error + } + + // still waiting, store the last result + lastResult = r + + case <-timeout: + log.Printf("[WARN] WaitForState timeout after %s", conf.Timeout) + log.Printf("[WARN] WaitForState starting %s refresh grace period", 30*time.Second) + + // cancel the goroutine and start our grace period timer + close(cancelCh) + timeout := time.After(30 * time.Second) + + // we need a for loop and a label to break on, because we may have + // an extra response value to read, but still want to wait for the + // channel to close. + forSelect: + for { + select { + case r, ok := <-resCh: + if r.Done { + // the last refresh loop reached the desired state + return r.Result, r.Error + } + + if !ok { + // the goroutine returned + break forSelect + } + + // target state not reached, save the result for the + // TimeoutError and wait for the channel to close + lastResult = r + case <-timeout: + log.Println("[ERROR] WaitForState exceeded refresh grace period") + break forSelect + } + } + + return nil, &TimeoutError{ + LastError: lastResult.Error, + LastState: lastResult.State, + Timeout: conf.Timeout, + ExpectedState: conf.Target, + } + } + } +} + +type StateChangeConf struct { + Delay time.Duration // Wait this time before starting checks + Pending []string // States that are "allowed" and will continue trying + Refresh StateRefreshFunc // Refreshes the current state + Target []string // Target state + Timeout time.Duration // The amount of time to wait before timeout + MinTimeout time.Duration // Smallest time to wait before refreshes + PollInterval time.Duration // Override MinTimeout/backoff and only poll this often + NotFoundChecks int // Number of times to allow not found + + // This is to work around inconsistent APIs + ContinuousTargetOccurence int // Number of times the Target state has to occur continuously +} + +type NotFoundError struct { + LastError error + LastRequest interface{} + LastResponse interface{} + Message string + Retries int +} + +func (e *NotFoundError) Error() string { + if e.Message != "" { + return e.Message + } + + if e.Retries > 0 { + return fmt.Sprintf("couldn't find resource (%d retries)", e.Retries) + } + + return "couldn't find resource" +} + +// UnexpectedStateError is returned when Refresh returns a state that's neither in Target nor Pending +type UnexpectedStateError struct { + LastError error + State string + ExpectedState []string +} + +func (e *UnexpectedStateError) Error() string { + return fmt.Sprintf( + "unexpected state '%s', wanted target '%s'. last error: %s", + e.State, + strings.Join(e.ExpectedState, ", "), + e.LastError, + ) +} + +// TimeoutError is returned when WaitForState times out +type TimeoutError struct { + LastError error + LastState string + Timeout time.Duration + ExpectedState []string +} + +func (e *TimeoutError) Error() string { + expectedState := "resource to be gone" + if len(e.ExpectedState) > 0 { + expectedState = fmt.Sprintf("state to become '%s'", strings.Join(e.ExpectedState, ", ")) + } + + extraInfo := make([]string, 0) + if e.LastState != "" { + extraInfo = append(extraInfo, fmt.Sprintf("last state: '%s'", e.LastState)) + } + if e.Timeout > 0 { + extraInfo = append(extraInfo, fmt.Sprintf("timeout: %s", e.Timeout.String())) + } + + suffix := "" + if len(extraInfo) > 0 { + suffix = fmt.Sprintf(" (%s)", strings.Join(extraInfo, ", ")) + } + + if e.LastError != nil { + return fmt.Sprintf("timeout while waiting for %s%s: %s", + expectedState, suffix, e.LastError) + } + + return fmt.Sprintf("timeout while waiting for %s%s", + expectedState, suffix) +} + +type StateRefreshFunc func() (result interface{}, state string, err error) diff --git a/builder/jdcloud/credential_config.go b/builder/jdcloud/credential_config.go new file mode 100644 index 000000000..75d07309d --- /dev/null +++ b/builder/jdcloud/credential_config.go @@ -0,0 +1,86 @@ +package jdcloud + +import ( + "fmt" + "github.com/hashicorp/packer/template/interpolate" + "github.com/jdcloud-api/jdcloud-sdk-go/core" + vm "github.com/jdcloud-api/jdcloud-sdk-go/services/vm/client" + vpc "github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/client" + "os" +) + +type JDCloudCredentialConfig struct { + AccessKey string `mapstructure:"access_key"` + SecretKey string `mapstructure:"secret_key"` + RegionId string `mapstructure:"region_id"` + Az string `mapstructure:"az"` +} + +func (jd *JDCloudCredentialConfig) Prepare(ctx *interpolate.Context) []error { + + errorArray := []error{} + + if jd == nil { + return append(errorArray, fmt.Errorf("[PRE-FLIGHT] Empty JDCloudCredentialConfig detected")) + } + + if err := jd.ValidateKeyPair(); err != nil { + errorArray = append(errorArray, err) + } + + if err := jd.validateRegion(); err != nil { + errorArray = append(errorArray, err) + } + + if err := jd.validateAz(); err != nil { + errorArray = append(errorArray, err) + } + + if len(errorArray) != 0 { + return errorArray + } + + credential := core.NewCredentials(jd.AccessKey, jd.SecretKey) + VmClient = vm.NewVmClient(credential) + VpcClient = vpc.NewVpcClient(credential) + Region = jd.RegionId + + return nil +} + +func (jd *JDCloudCredentialConfig) ValidateKeyPair() error { + + if jd.AccessKey == "" { + jd.AccessKey = os.Getenv("JDCLOUD_ACCESS_KEY") + } + + if jd.SecretKey == "" { + jd.SecretKey = os.Getenv("JDCLOUD_SECRET_KEY") + } + + if jd.AccessKey == "" || jd.SecretKey == "" { + return fmt.Errorf("[PRE-FLIGHT] We can't find your key pairs," + + "write them here {access_key=xxx , secret_key=xxx} " + + "or export them as env-variable, {export JDCLOUD_ACCESS_KEY=xxx, export JDCLOUD_SECRET_KEY=xxx} ") + } + + return nil +} + +func (config *JDCloudCredentialConfig) validateRegion() error { + regionArray := []string{"cn-north-1", "cn-south-1", "cn-east-1", "cn-east-2"} + for _, item := range regionArray { + if item == config.RegionId { + return nil + } + } + return fmt.Errorf("[PRE-FLIGHT] Invalid RegionId:%s. "+ + "Legit RegionId are: {cn-north-1, cn-south-1, cn-east-1, cn-east-2}", config.RegionId) +} + +func (config *JDCloudCredentialConfig) validateAz() error { + if len(config.Az) == 0 { + return fmt.Errorf("[PRE-FLIGHT] az info missing") + } + return nil +} diff --git a/builder/jdcloud/credential_config_test.go b/builder/jdcloud/credential_config_test.go new file mode 100644 index 000000000..ca245a1b4 --- /dev/null +++ b/builder/jdcloud/credential_config_test.go @@ -0,0 +1,34 @@ +package jdcloud + +import ( + "testing" +) + +func TestJDCloudCredentialConfig_Prepare(t *testing.T) { + + creds := &JDCloudCredentialConfig{} + + if err := creds.Prepare(nil); err == nil { + t.Fatalf("Test shouldn't pass when there's nothing set") + } + + creds.AccessKey = "abc" + if err := creds.Prepare(nil); err == nil { + t.Fatalf("Test shouldn't pass when theres no Secret key") + } + + creds.SecretKey = "123" + if err := creds.Prepare(nil); err == nil { + t.Fatalf("Test shouldn't pass when theres no Az and region") + } + + creds.RegionId = "cn-west-1" + creds.Az = "cn-north-1c" + if err := creds.Prepare(nil); err == nil { + t.Fatalf("Test shouldn't pass when region_id illegal") + } + creds.RegionId = "cn-north-1" + if err := creds.Prepare(nil); err != nil { + t.Fatalf("Test shouldn't fail...") + } +} diff --git a/builder/jdcloud/instance_config.go b/builder/jdcloud/instance_config.go new file mode 100644 index 000000000..93f6a6115 --- /dev/null +++ b/builder/jdcloud/instance_config.go @@ -0,0 +1,53 @@ +package jdcloud + +import ( + "fmt" + "github.com/hashicorp/packer/helper/communicator" + "github.com/hashicorp/packer/template/interpolate" +) + +type JDCloudInstanceSpecConfig struct { + ImageId string `mapstructure:"image_id"` + InstanceName string `mapstructure:"instance_name"` + InstanceType string `mapstructure:"instance_type"` + ImageName string `mapstructure:"image_name"` + SubnetId string `mapstructure:"subnet_id"` + Comm communicator.Config `mapstructure:",squash"` + InstanceId string + ArtifactId string + PublicIpAddress string + PublicIpId string +} + +func (jd *JDCloudInstanceSpecConfig) Prepare(ctx *interpolate.Context) []error { + + errs := jd.Comm.Prepare(ctx) + + if jd == nil { + return append(errs, fmt.Errorf("[PRE-FLIGHT] Configuration appears to be empty")) + } + + if len(jd.ImageId) == 0 { + errs = append(errs, fmt.Errorf("[PRE-FLIGHT] 'image_id' empty")) + } + + if len(jd.InstanceName) == 0 { + errs = append(errs, fmt.Errorf("[PRE-FLIGHT] 'instance_name' empty")) + } + + if len(jd.InstanceType) == 0 { + errs = append(errs, fmt.Errorf("[PRE-FLIGHT] 'instance-type' empty")) + } + + noPassword := len(jd.Comm.SSHPassword) == 0 + noKeys := len(jd.Comm.SSHKeyPairName) == 0 && len(jd.Comm.SSHPrivateKeyFile) == 0 + noTempKey := len(jd.Comm.SSHTemporaryKeyPairName) == 0 + if noPassword && noKeys && noTempKey { + errs = append(errs, fmt.Errorf("[PRE-FLIGHT] Didn't detect any credentials, you have to specify either "+ + "{password} or "+ + "{key_name+local_private_key_path} or "+ + "{temporary_key_pair_name} cheers :)")) + } + + return errs +} diff --git a/builder/jdcloud/instance_config_test.go b/builder/jdcloud/instance_config_test.go new file mode 100644 index 000000000..36ede82ca --- /dev/null +++ b/builder/jdcloud/instance_config_test.go @@ -0,0 +1,54 @@ +package jdcloud + +import ( + "testing" +) + +func TestJDCloudInstanceSpecConfig_Prepare(t *testing.T) { + + specs := &JDCloudInstanceSpecConfig{} + if err := specs.Prepare(nil); err == nil { + t.Fatalf("Test shouldn't pass when there's nothing set") + } + + specs.InstanceName = "packer_test_instance_name" + specs.InstanceType = "packer_test_instance_type" + if err := specs.Prepare(nil); err == nil { + t.Fatalf("Test shouldn't pass when base-image not given") + } + + specs.ImageId = "img-packer-test" + if err := specs.Prepare(nil); err == nil { + t.Fatalf("Test shouldn't pass when credentials not set") + } + + specs.Comm.SSHPassword = "abc123" + if err := specs.Prepare(nil); err == nil { + t.Fatalf("Test shouldn't pass when username = nil") + } + + specs.Comm.SSHUsername = "root" + if err := specs.Prepare(nil); err != nil { + t.Fatalf("Test shouldn't fail when password set ") + } + + specs.Comm.SSHPassword = "" + specs.Comm.SSHTemporaryKeyPairName = "abc" + if err := specs.Prepare(nil); err != nil { + t.Fatalf("Test shouldn't fail when temp password set") + } + + specs.Comm.SSHTemporaryKeyPairName = "" + specs.Comm.SSHPrivateKeyFile = "abc" + specs.Comm.SSHKeyPairName = "" + if err := specs.Prepare(nil); err == nil { + t.Fatalf("Test shouldn't pass when SSHKeypairName missing") + } + + specs.Comm.SSHPrivateKeyFile = "abc" + specs.Comm.SSHKeyPairName = "123" + if err := specs.Prepare(nil); err == nil { + t.Fatalf("Test shouldn't pass when private key pair path is wrong ") + } + +} diff --git a/builder/jdcloud/step_config_credentials.go b/builder/jdcloud/step_config_credentials.go new file mode 100644 index 000000000..1c6fdfc76 --- /dev/null +++ b/builder/jdcloud/step_config_credentials.go @@ -0,0 +1,73 @@ +package jdcloud + +import ( + "context" + "fmt" + "github.com/hashicorp/packer/helper/multistep" + "github.com/hashicorp/packer/packer" + "github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis" + "io/ioutil" +) + +type stepConfigCredentials struct { + InstanceSpecConfig *JDCloudInstanceSpecConfig + ui packer.Ui +} + +func (s *stepConfigCredentials) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { + + s.ui = state.Get("ui").(packer.Ui) + password := s.InstanceSpecConfig.Comm.SSHPassword + privateKeyPath := s.InstanceSpecConfig.Comm.SSHPrivateKeyFile + privateKeyName := s.InstanceSpecConfig.Comm.SSHKeyPairName + newKeyName := s.InstanceSpecConfig.Comm.SSHTemporaryKeyPairName + + if len(privateKeyPath) > 0 && len(privateKeyName) > 0 { + s.ui.Message("\t Private key detected, we are going to login with this private key :)") + return s.ReadExistingPair() + } + + if len(newKeyName) > 0 { + s.ui.Message("\t We are going to create a new key pair with its name=" + newKeyName) + return s.CreateRandomKeyPair(newKeyName) + } + + if len(password) > 0 { + s.ui.Message("\t Password detected, we are going to login with this password :)") + return multistep.ActionContinue + } + + s.ui.Error("[ERROR] Didn't detect any credentials, you have to specify either " + + "{password} or " + + "{key_name+local_private_key_path} or " + + "{temporary_key_pair_name} cheers :)") + return multistep.ActionHalt +} + +func (s *stepConfigCredentials) ReadExistingPair() multistep.StepAction { + privateKeyBytes, err := ioutil.ReadFile(s.InstanceSpecConfig.Comm.SSHPrivateKeyFile) + if err != nil { + s.ui.Error("Cannot read local private-key, were they correctly placed? Here's the error" + err.Error()) + return multistep.ActionHalt + } + s.ui.Message("\t\t Keys read successfully :)") + s.InstanceSpecConfig.Comm.SSHPrivateKey = privateKeyBytes + return multistep.ActionContinue +} + +func (s *stepConfigCredentials) CreateRandomKeyPair(keyName string) multistep.StepAction { + req := apis.NewCreateKeypairRequest(Region, keyName) + resp, err := VmClient.CreateKeypair(req) + if err != nil || resp.Error.Code != FINE { + s.ui.Error(fmt.Sprintf("[ERROR] Cannot create a new key pair for you, \n error=%v \n response=%v", err, resp)) + return multistep.ActionHalt + } + s.ui.Message("\t\t Keys created successfully :)") + s.InstanceSpecConfig.Comm.SSHPrivateKey = []byte(resp.Result.PrivateKey) + s.InstanceSpecConfig.Comm.SSHKeyPairName = keyName + return multistep.ActionContinue +} + +func (s *stepConfigCredentials) Cleanup(state multistep.StateBag) { + +} diff --git a/builder/jdcloud/step_create_image.go b/builder/jdcloud/step_create_image.go new file mode 100644 index 000000000..03e2d3b60 --- /dev/null +++ b/builder/jdcloud/step_create_image.go @@ -0,0 +1,74 @@ +package jdcloud + +import ( + "context" + "fmt" + "github.com/hashicorp/packer/helper/multistep" + "github.com/hashicorp/packer/packer" + "github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis" + "time" +) + +type stepCreateJDCloudImage struct { + InstanceSpecConfig *JDCloudInstanceSpecConfig +} + +func (s *stepCreateJDCloudImage) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { + + ui := state.Get("ui").(packer.Ui) + ui.Say("Creating images") + + req := apis.NewCreateImageRequest(Region, s.InstanceSpecConfig.InstanceId, s.InstanceSpecConfig.ImageName, "") + resp, err := VmClient.CreateImage(req) + if err != nil || resp.Error.Code != FINE { + ui.Error(fmt.Sprintf("[ERROR] Creating image: Error-%v ,Resp:%v", err, resp)) + return multistep.ActionHalt + } + + s.InstanceSpecConfig.ArtifactId = resp.Result.ImageId + if err := ImageStatusWaiter(s.InstanceSpecConfig.ArtifactId); err != nil { + ui.Error(err.Error()) + return multistep.ActionHalt + } + + return multistep.ActionContinue +} + +func ImageStatusWaiter(imageId string) error { + req := apis.NewDescribeImageRequest(Region, imageId) + + return Retry(5*time.Minute, func() *RetryError { + resp, err := VmClient.DescribeImage(req) + if err == nil && resp.Result.Image.Status == READY { + return nil + } + if connectionError(err) { + return RetryableError(err) + } else { + return NonRetryableError(err) + } + }) + +} + +// Delete created instance image on error +func (s *stepCreateJDCloudImage) Cleanup(state multistep.StateBag) { + + if s.InstanceSpecConfig.ArtifactId != "" { + + req := apis.NewDeleteImageRequest(Region, s.InstanceSpecConfig.ArtifactId) + + _ = Retry(time.Minute, func() *RetryError { + _, err := VmClient.DeleteImage(req) + if err == nil { + return nil + } + if connectionError(err) { + return RetryableError(err) + } else { + return NonRetryableError(err) + } + }) + } + +} diff --git a/builder/jdcloud/step_create_instance.go b/builder/jdcloud/step_create_instance.go new file mode 100644 index 000000000..fe66f464d --- /dev/null +++ b/builder/jdcloud/step_create_instance.go @@ -0,0 +1,223 @@ +package jdcloud + +import ( + "context" + "fmt" + "github.com/hashicorp/packer/helper/multistep" + "github.com/hashicorp/packer/packer" + "github.com/jdcloud-api/jdcloud-sdk-go/core" + "github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis" + vm "github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models" + vpcApis "github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis" + vpcClient "github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/client" + vpc "github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models" + "regexp" + "time" +) + +type stepCreateJDCloudInstance struct { + InstanceSpecConfig *JDCloudInstanceSpecConfig + CredentialConfig *JDCloudCredentialConfig + ui packer.Ui +} + +func (s *stepCreateJDCloudInstance) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { + + privateKey := s.InstanceSpecConfig.Comm.SSHPrivateKey + keyName := s.InstanceSpecConfig.Comm.SSHKeyPairName + password := s.InstanceSpecConfig.Comm.SSHPassword + s.ui = state.Get("ui").(packer.Ui) + s.ui.Say("Creating instances") + + instanceSpec := vm.InstanceSpec{ + Az: &s.CredentialConfig.Az, + InstanceType: &s.InstanceSpecConfig.InstanceType, + ImageId: &s.InstanceSpecConfig.ImageId, + Name: s.InstanceSpecConfig.InstanceName, + PrimaryNetworkInterface: &vm.InstanceNetworkInterfaceAttachmentSpec{ + NetworkInterface: &vpc.NetworkInterfaceSpec{ + SubnetId: s.InstanceSpecConfig.SubnetId, + Az: &s.CredentialConfig.Az, + }, + }, + } + + if len(password) > 0 { + instanceSpec.Password = &password + } + if len(keyName) > 0 && len(privateKey) > 0 { + instanceSpec.KeyNames = []string{keyName} + } + + req := apis.NewCreateInstancesRequest(Region, &instanceSpec) + resp, err := VmClient.CreateInstances(req) + + if err != nil || resp.Error.Code != FINE { + err := fmt.Errorf("Error creating instance, error-%v response:%v", err, resp) + s.ui.Error(err.Error()) + return multistep.ActionHalt + } + + s.InstanceSpecConfig.InstanceId = resp.Result.InstanceIds[0] + instanceInterface, err := InstanceStatusRefresher(s.InstanceSpecConfig.InstanceId, []string{VM_PENDING, VM_STARTING}, []string{VM_RUNNING}) + if err != nil { + s.ui.Error(err.Error()) + return multistep.ActionHalt + } + + instance := instanceInterface.(vm.Instance) + privateIpAddress := instance.PrivateIpAddress + networkInterfaceId := instance.PrimaryNetworkInterface.NetworkInterface.NetworkInterfaceId + + s.ui.Message("Creating public-ip") + s.InstanceSpecConfig.PublicIpId, err = createElasticIp(state) + if err != nil { + s.ui.Error(err.Error()) + return multistep.ActionHalt + } + + s.ui.Message("Associating public-ip with instance") + err = associatePublicIp(networkInterfaceId, s.InstanceSpecConfig.PublicIpId, privateIpAddress) + if err != nil { + s.ui.Error(err.Error()) + return multistep.ActionHalt + } + + req_ := vpcApis.NewDescribeElasticIpRequest(Region, s.InstanceSpecConfig.PublicIpId) + eip, err := VpcClient.DescribeElasticIp(req_) + if err != nil || eip.Error.Code != FINE { + s.ui.Error(fmt.Sprintf("[ERROR] Failed in getting eip,error:%v \n response:%v", err, eip)) + return multistep.ActionHalt + } + + s.InstanceSpecConfig.PublicIpAddress = eip.Result.ElasticIp.ElasticIpAddress + state.Put("eip", s.InstanceSpecConfig.PublicIpAddress) + s.ui.Message(fmt.Sprintf( + "Hi, we have created the instance, its name=%v , "+ + "its id=%v, "+ + "and its eip=%v :) ", instance.InstanceName, s.InstanceSpecConfig.InstanceId, eip.Result.ElasticIp.ElasticIpAddress)) + return multistep.ActionContinue +} + +// Delete created resources {instance,ip} on error +func (s *stepCreateJDCloudInstance) Cleanup(state multistep.StateBag) { + + if s.InstanceSpecConfig.PublicIpId != "" { + + req := vpcApis.NewDeleteElasticIpRequest(Region, s.InstanceSpecConfig.PublicIpId) + + _ = Retry(time.Minute, func() *RetryError { + _, err := VpcClient.DeleteElasticIp(req) + if err == nil { + return nil + } + if connectionError(err) { + return RetryableError(err) + } else { + return NonRetryableError(err) + } + }) + } + + if s.InstanceSpecConfig.InstanceId != "" { + + req := apis.NewDeleteInstanceRequest(Region, s.InstanceSpecConfig.InstanceId) + _ = Retry(time.Minute, func() *RetryError { + _, err := VmClient.DeleteInstance(req) + if err == nil { + return nil + } + if connectionError(err) { + return RetryableError(err) + } else { + return NonRetryableError(err) + } + }) + } +} + +func createElasticIp(state multistep.StateBag) (string, error) { + + generalConfig := state.Get("config").(Config) + regionId := generalConfig.RegionId + credential := core.NewCredentials(generalConfig.AccessKey, generalConfig.SecretKey) + vpcclient := vpcClient.NewVpcClient(credential) + + req := vpcApis.NewCreateElasticIpsRequest(regionId, 1, &vpc.ElasticIpSpec{ + BandwidthMbps: 1, + Provider: "bgp", + }) + + resp, err := vpcclient.CreateElasticIps(req) + + if err != nil || resp.Error.Code != 0 { + return "", fmt.Errorf("[ERROR] Failed in creating new publicIp, Error-%v, Response:%v", err, resp) + } + return resp.Result.ElasticIpIds[0], nil +} + +func associatePublicIp(networkInterfaceId string, eipId string, privateIpAddress string) error { + req := vpcApis.NewAssociateElasticIpRequest(Region, networkInterfaceId) + req.ElasticIpId = &eipId + req.PrivateIpAddress = &privateIpAddress + resp, err := VpcClient.AssociateElasticIp(req) + if err != nil || resp.Error.Code != FINE { + return fmt.Errorf("[ERROR] Failed in associating publicIp, Error-%v, Response:%v", err, resp) + } + return nil +} +func instanceHost(state multistep.StateBag) (string, error) { + return state.Get("eip").(string), nil +} + +func InstanceStatusRefresher(id string, pending, target []string) (instance interface{}, err error) { + + stateConf := &StateChangeConf{ + Pending: pending, + Target: target, + Refresh: instanceStatusRefresher(id), + Delay: 3 * time.Second, + Timeout: 10 * time.Minute, + MinTimeout: 1 * time.Second, + } + if instance, err = stateConf.WaitForState(); err != nil { + return nil, fmt.Errorf("[ERROR] Failed in creating instance ,err message:%v", err) + } + return instance, nil +} + +func instanceStatusRefresher(instanceId string) StateRefreshFunc { + + return func() (instance interface{}, status string, err error) { + + err = Retry(time.Minute, func() *RetryError { + + req := apis.NewDescribeInstanceRequest(Region, instanceId) + resp, err := VmClient.DescribeInstance(req) + + if err == nil && resp.Error.Code == FINE { + instance = resp.Result.Instance + status = resp.Result.Instance.Status + return nil + } + + instance = nil + status = "" + if connectionError(err) { + return RetryableError(err) + } else { + return NonRetryableError(err) + } + }) + return instance, status, err + } +} + +func connectionError(e error) bool { + + if e == nil { + return false + } + ok, _ := regexp.MatchString(CONNECT_FAILED, e.Error()) + return ok +} diff --git a/builder/jdcloud/step_stop_instance.go b/builder/jdcloud/step_stop_instance.go new file mode 100644 index 000000000..1cf249c2c --- /dev/null +++ b/builder/jdcloud/step_stop_instance.go @@ -0,0 +1,39 @@ +package jdcloud + +import ( + "context" + "fmt" + "github.com/hashicorp/packer/helper/multistep" + "github.com/hashicorp/packer/packer" + "github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis" +) + +type stepStopJDCloudInstance struct { + InstanceSpecConfig *JDCloudInstanceSpecConfig +} + +func (s *stepStopJDCloudInstance) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { + + ui := state.Get("ui").(packer.Ui) + ui.Say("Stopping this instance") + + req := apis.NewStopInstanceRequest(Region, s.InstanceSpecConfig.InstanceId) + resp, err := VmClient.StopInstance(req) + if err != nil || resp.Error.Code != FINE { + ui.Error(fmt.Sprintf("[ERROR] Failed in trying to stop this vm: Error-%v ,Resp:%v", err, resp)) + return multistep.ActionHalt + } + + _, err = InstanceStatusRefresher(s.InstanceSpecConfig.InstanceId, []string{VM_RUNNING, VM_STOPPING}, []string{VM_STOPPED}) + if err != nil { + ui.Error(err.Error()) + return multistep.ActionHalt + } + + ui.Message("Instance has been stopped :)") + return multistep.ActionContinue +} + +func (s *stepStopJDCloudInstance) Cleanup(multistep.StateBag) { + return +} diff --git a/builder/jdcloud/step_validate_parameters.go b/builder/jdcloud/step_validate_parameters.go new file mode 100644 index 000000000..62c04078b --- /dev/null +++ b/builder/jdcloud/step_validate_parameters.go @@ -0,0 +1,109 @@ +package jdcloud + +import ( + "context" + "fmt" + "github.com/hashicorp/packer/helper/multistep" + "github.com/hashicorp/packer/packer" + vm "github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis" + vpc "github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis" +) + +type stepValidateParameters struct { + InstanceSpecConfig *JDCloudInstanceSpecConfig + ui packer.Ui + state multistep.StateBag +} + +func (s *stepValidateParameters) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { + + s.ui = state.Get("ui").(packer.Ui) + s.state = state + s.ui.Say("Validating parameters...") + + if err := s.ValidateSubnetFunc(); err != nil { + s.ui.Error(err.Error()) + return multistep.ActionHalt + } + + if err := s.ValidateImageFunc(); err != nil { + s.ui.Error(err.Error()) + return multistep.ActionHalt + } + + return multistep.ActionContinue +} + +func (s *stepValidateParameters) ValidateSubnetFunc() error { + + subnetId := s.InstanceSpecConfig.SubnetId + if len(subnetId) == 0 { + s.ui.Message("\t 'subnet' is not specified, we will create a new one for you :) ") + return s.CreateRandomSubnet() + } + + s.ui.Message("\t validating your subnet:" + s.InstanceSpecConfig.SubnetId) + req := vpc.NewDescribeSubnetRequest(Region, subnetId) + resp, err := VpcClient.DescribeSubnet(req) + if err != nil { + return fmt.Errorf("[ERROR] Failed in validating subnet->%s, reasons:%v", subnetId, err) + } + if resp != nil && resp.Error.Code != FINE { + return fmt.Errorf("[ERROR] Something wrong with your subnet->%s, reasons:%v", subnetId, resp.Error) + } + + s.ui.Message("\t subnet found:" + resp.Result.Subnet.SubnetName) + return nil + +} + +func (s *stepValidateParameters) ValidateImageFunc() error { + + s.ui.Message("\t validating your base image:" + s.InstanceSpecConfig.ImageId) + imageId := s.InstanceSpecConfig.ImageId + req := vm.NewDescribeImageRequest(Region, imageId) + resp, err := VmClient.DescribeImage(req) + if err != nil { + return fmt.Errorf("[ERROR] Failed in validating your image->%s, reasons:%v", imageId, err) + } + if resp != nil && resp.Error.Code != FINE { + return fmt.Errorf("[ERROR] Something wrong with your image->%s, reasons:%v", imageId, resp.Error) + } + + s.ui.Message("\t image found:" + resp.Result.Image.Name) + s.state.Put("source_image", &resp.Result.Image) + return nil +} + +func (s *stepValidateParameters) CreateRandomSubnet() error { + + newVpc, err := s.CreateRandomVpc() + if err != nil { + return err + } + + req := vpc.NewCreateSubnetRequest(Region, newVpc, "created_by_packer", "192.168.0.0/20") + resp, err := VpcClient.CreateSubnet(req) + if err != nil || resp.Error.Code != FINE { + errorMessage := fmt.Sprintf("[ERROR] Failed in creating new subnet :( \n error:%v \n response:%v", err, resp) + s.ui.Error(errorMessage) + return fmt.Errorf(errorMessage) + } + + s.InstanceSpecConfig.SubnetId = resp.Result.SubnetId + s.ui.Message("\t\t Hi, we have created a new subnet for you :) its name is 'created_by_packer' and its id=" + resp.Result.SubnetId) + return nil +} + +func (s *stepValidateParameters) CreateRandomVpc() (string, error) { + req := vpc.NewCreateVpcRequest(Region, "created_by_packer") + resp, err := VpcClient.CreateVpc(req) + if err != nil || resp.Error.Code != FINE { + errorMessage := fmt.Sprintf("[ERROR] Failed in creating new vpc :( \n error :%v, \n response:%v", err, resp) + s.ui.Error(errorMessage) + return "", fmt.Errorf(errorMessage) + } + return resp.Result.VpcId, nil +} + +func (s *stepValidateParameters) Cleanup(state multistep.StateBag) {} diff --git a/command/plugin.go b/command/plugin.go index aff138dd7..81dcc4ec1 100644 --- a/command/plugin.go +++ b/command/plugin.go @@ -29,6 +29,7 @@ import ( hyperonebuilder "github.com/hashicorp/packer/builder/hyperone" hypervisobuilder "github.com/hashicorp/packer/builder/hyperv/iso" hypervvmcxbuilder "github.com/hashicorp/packer/builder/hyperv/vmcx" + jdcloudbuilder "github.com/hashicorp/packer/builder/jdcloud" linodebuilder "github.com/hashicorp/packer/builder/linode" lxcbuilder "github.com/hashicorp/packer/builder/lxc" lxdbuilder "github.com/hashicorp/packer/builder/lxd" @@ -117,6 +118,7 @@ var Builders = map[string]packer.Builder{ "hyperone": new(hyperonebuilder.Builder), "hyperv-iso": new(hypervisobuilder.Builder), "hyperv-vmcx": new(hypervvmcxbuilder.Builder), + "jdcloud": new(jdcloudbuilder.Builder), "linode": new(linodebuilder.Builder), "lxc": new(lxcbuilder.Builder), "lxd": new(lxdbuilder.Builder), diff --git a/examples/jdcloud/credential-key.json b/examples/jdcloud/credential-key.json new file mode 100644 index 000000000..b2f4da03e --- /dev/null +++ b/examples/jdcloud/credential-key.json @@ -0,0 +1,34 @@ +{ + "builders": [ + { + "type": "jdcloud", + "image_id": "", + "access_key": "", + "secret_key": "", + "region_id": "cn-north-1", + "az": "cn-north-1c", + "instance_name": "created_by_packer", + "instance_type": "g.n2.medium", + + "ssh_private_key_file":"/Path/to/your/.ssh/id_rsa", + "ssh_keypair_name":"packer_keys", + + "image_name": "created_by_packer", + "subnet_id": "", + "communicator":"ssh", + "ssh_username": "root", + "ssh_timeout" : "60s" + } + ], + + "provisioners": [ + { + "type": "shell", + "inline": [ + "sleep 3", + "echo 123", + "pwd" + ] + } + ] +} diff --git a/examples/jdcloud/credential-new-key.json b/examples/jdcloud/credential-new-key.json new file mode 100644 index 000000000..7b7187b61 --- /dev/null +++ b/examples/jdcloud/credential-new-key.json @@ -0,0 +1,31 @@ +{ + "builders": [ + { + "type": "jdcloud", + "image_id": "", + "access_key": "", + "secret_key": "", + "region_id": "cn-north-1", + "az": "cn-north-1c", + "instance_name": "created_by_packer", + "instance_type": "g.n2.medium", + "image_name": "packerImage", + "temporary_key_pair_name": "whatever_new_key_name", + "subnet_id": "", + "communicator":"ssh", + "ssh_username": "root", + "ssh_timeout" : "60s" + } + ], + + "provisioners": [ + { + "type": "shell", + "inline": [ + "sleep 3", + "echo 123", + "pwd" + ] + } + ] +} diff --git a/examples/jdcloud/credential-password.json b/examples/jdcloud/credential-password.json new file mode 100644 index 000000000..5e6aa80db --- /dev/null +++ b/examples/jdcloud/credential-password.json @@ -0,0 +1,32 @@ +{ + "builders": [ + { + "type": "jdcloud", + "image_id": "img-h8ly274zg9", + "access_key": "", + "secret_key": "", + "region_id": "cn-north-1", + "az": "cn-north-1c", + "instance_name": "created_by_packer", + "instance_type": "g.n2.medium", + "ssh_password":"/Users/mac/.ssh/id_rsa", + "ssh_keypair_name":"created_by_xiaohan", + "image_name": "packerImage", + "subnet_id": "subnet-jo6e38sdli", + "communicator":"ssh", + "ssh_username": "root", + "ssh_timeout" : "60s" + } + ], + + "provisioners": [ + { + "type": "shell", + "inline": [ + "sleep 3", + "echo 123", + "pwd" + ] + } + ] +} diff --git a/examples/jdcloud/use_new_subnet.json b/examples/jdcloud/use_new_subnet.json new file mode 100644 index 000000000..a4881ca0a --- /dev/null +++ b/examples/jdcloud/use_new_subnet.json @@ -0,0 +1,34 @@ +{ + "builders": [ + { + "type": "jdcloud", + "image_id": "img-h8ly274zg9", + "access_key": "", + "secret_key": "", + "region_id": "cn-north-1", + "az": "cn-north-1c", + "instance_name": "created_by_packer", + "instance_type": "g.n2.medium", + "ssh_password":"/Users/mac/.ssh/id_rsa", + "ssh_keypair_name":"created_by_xiaohan", + "image_name": "packerImage", + + + + "communicator":"ssh", + "ssh_username": "root", + "ssh_timeout" : "60s" + } + ], + + "provisioners": [ + { + "type": "shell", + "inline": [ + "sleep 3", + "echo 123", + "pwd" + ] + } + ] +} diff --git a/go.mod b/go.mod index 03af8883d..a8f135e17 100644 --- a/go.mod +++ b/go.mod @@ -36,8 +36,8 @@ require ( github.com/exoscale/egoscale v0.18.1 github.com/go-ini/ini v1.25.4 github.com/gofrs/flock v0.7.1 - github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db // indirect github.com/golang-collections/collections v0.0.0-20130729185459-604e922904d3 + github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db // indirect github.com/google/go-cmp v0.2.0 github.com/google/shlex v0.0.0-20150127133951-6f45313302b9 github.com/google/uuid v1.0.0 @@ -62,6 +62,7 @@ require ( github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d github.com/hetznercloud/hcloud-go v1.12.0 github.com/hyperonecom/h1-client-go v0.0.0-20190122232013-cf38e8387775 + github.com/jdcloud-api/jdcloud-sdk-go v1.9.1-0.20190605102154-3d81a50ca961 github.com/joyent/triton-go v0.0.0-20180116165742-545edbe0d564 github.com/json-iterator/go v1.1.6 // indirect github.com/jtolds/gls v4.2.1+incompatible // indirect @@ -126,6 +127,7 @@ require ( golang.org/x/sync v0.0.0-20190423024810-112230192c58 golang.org/x/sys v0.0.0-20190425145619-16072639606e golang.org/x/text v0.3.1 // indirect + golang.org/x/tools v0.0.0-20190606050223-4d9ae51c2468 // indirect google.golang.org/api v0.4.0 google.golang.org/grpc v1.20.1 gopkg.in/h2non/gock.v1 v1.0.12 // indirect diff --git a/go.sum b/go.sum index 525fbd81c..f58c2f34d 100644 --- a/go.sum +++ b/go.sum @@ -111,6 +111,7 @@ github.com/gofrs/flock v0.7.1 h1:DP+LD/t0njgoPBvT5MJLeliUIVQR03hiKR6vezdwHlc= github.com/gofrs/flock v0.7.1/go.mod h1:F1TvTiK9OcQqauNUHlbJvyl9Qa1QvF/gOUDKA14jxHU= github.com/gofrs/uuid v3.2.0+incompatible h1:y12jRkkFxsd7GpqdSZ+/KCs/fJbqpEXSGd4+jfEaewE= github.com/gofrs/uuid v3.2.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= +github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/golang-collections/collections v0.0.0-20130729185459-604e922904d3 h1:zN2lZNZRflqFyxVaTIU61KNKQ9C0055u9CAfpmqUvo4= github.com/golang-collections/collections v0.0.0-20130729185459-604e922904d3/go.mod h1:nPpo7qLxd6XL3hWJG/O60sR8ZKfMCiIoNap5GvD12KU= @@ -213,6 +214,8 @@ github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/hyperonecom/h1-client-go v0.0.0-20190122232013-cf38e8387775 h1:MIteIoIQ5nFoOmwEHPDsqng8d0dtKj3lCnQCwGvtxXc= github.com/hyperonecom/h1-client-go v0.0.0-20190122232013-cf38e8387775/go.mod h1:R9rU87RxxmcD3DkspW9JqGBXiJyg5MA+WNCtJrBtnXs= +github.com/jdcloud-api/jdcloud-sdk-go v1.9.1-0.20190605102154-3d81a50ca961 h1:a2/K4HRhg31A5vafiz5yYiGMjaCxwRpyjJStfVquKds= +github.com/jdcloud-api/jdcloud-sdk-go v1.9.1-0.20190605102154-3d81a50ca961/go.mod h1:UrKjuULIWLjHFlG6aSPunArE5QX57LftMmStAZJBEX8= github.com/jellevandenhooff/dkim v0.0.0-20150330215556-f50fe3d243e1/go.mod h1:E0B/fFc00Y+Rasa88328GlI/XbtyysCtTHZS8h7IrBU= github.com/jmespath/go-jmespath v0.0.0-20160202185014-0b12d6b521d8/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af h1:pmfjZENx5imkbgOkpRUYLnmbU7UEFbjtDA2hxJ1ichM= @@ -493,6 +496,9 @@ golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGm golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190524210228-3d17549cdc6b/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190606050223-4d9ae51c2468 h1:fTfk6GjmihJbK0mSUFgPPgYpsdmApQ86Mcd4GuKax9U= +golang.org/x/tools v0.0.0-20190606050223-4d9ae51c2468/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= google.golang.org/api v0.0.0-20180910000450-7ca32eb868bf/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0= google.golang.org/api v0.0.0-20181030000543-1d582fd0359e/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0= google.golang.org/api v0.1.0 h1:K6z2u68e86TPdSdefXdzvXgR1zEMa+459vBSfWYAZkI= diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/LICENSE b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/LICENSE new file mode 100644 index 000000000..261eeb9e9 --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-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/jdcloud-api/jdcloud-sdk-go/core/Config.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/core/Config.go new file mode 100644 index 000000000..993bb0319 --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/core/Config.go @@ -0,0 +1,44 @@ +// Copyright 2018-2025 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT 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 core + +import "time" + +type Config struct { + Scheme string + Endpoint string + Timeout time.Duration +} + +// NewConfig returns a pointer of Config +// +// scheme only accepts http or https +// +// endpoint is the host to access, the connection could not be created if it's error +func NewConfig() *Config { + return &Config{SchemeHttps, "www.jdcloud-api.com", 10 * time.Second} +} + +func (c *Config) SetScheme(scheme string) { + c.Scheme = scheme +} + +func (c *Config) SetEndpoint(endpoint string) { + c.Endpoint = endpoint +} + +func (c *Config) SetTimeout(timeout time.Duration) { + c.Timeout = timeout +} \ No newline at end of file diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/core/Const.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/core/Const.go new file mode 100644 index 000000000..bb8341d8e --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/core/Const.go @@ -0,0 +1,32 @@ +// Copyright 2018-2025 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT 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 core + +const ( + SchemeHttp = "http" + SchemeHttps = "https" + + MethodGet = "GET" + MethodPut = "PUT" + MethodPost = "POST" + MethodDelete = "DELETE" + MethodPatch = "PATCH" + MethodHead = "HEAD" + + HeaderJcloudPrefix = "x-jcloud" + HeaderJdcloudPrefix = "x-jdcloud" + HeaderJdcloudRequestId = "x-jdcloud-request-id" +) + diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/core/Credential.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/core/Credential.go new file mode 100644 index 000000000..addc417f1 --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/core/Credential.go @@ -0,0 +1,26 @@ +// Copyright 2018-2025 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT 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 core + +// Credential is used to sign the request, +// AccessKey and SecretKey could be found in JDCloud console +type Credential struct { + AccessKey string + SecretKey string +} + +func NewCredentials(accessKey, secretKey string) *Credential { + return &Credential{accessKey, secretKey} +} diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/core/Doc.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/core/Doc.go new file mode 100644 index 000000000..77e4c4617 --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/core/Doc.go @@ -0,0 +1,4 @@ +// This core package providers API and clients base struct for services, +// and also some infrastructure function, such as signer, send http(s) +// request and so on. +package core diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/core/ErrorResponse.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/core/ErrorResponse.go new file mode 100644 index 000000000..ee2537109 --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/core/ErrorResponse.go @@ -0,0 +1,21 @@ +// Copyright 2018-2025 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT 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 core + +type ErrorResponse struct { + Code int `json:"code"` + Status string `json:"status"` + Message string `json:"message"` +} diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/core/JdcloudClient.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/core/JdcloudClient.go new file mode 100644 index 000000000..82adae99e --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/core/JdcloudClient.go @@ -0,0 +1,120 @@ +// Copyright 2018-2025 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT 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 core + +import ( + "net/http" + "strings" + "time" + "fmt" + "encoding/json" + "encoding/base64" +) + +// JDCloudClient is the base struct of service clients +type JDCloudClient struct { + Credential Credential + Config Config + ServiceName string + Revision string + Logger Logger +} + +type SignFunc func(*http.Request) error + +// Send send the request and return the response to the client. +// Parameter request accepts concrete request object which follow RequestInterface. +func (c JDCloudClient) Send(request RequestInterface, serviceName string) ([]byte, error) { + method := request.GetMethod() + builder := GetParameterBuilder(method, c.Logger) + jsonReq, _ := json.Marshal(request) + encodedUrl, err := builder.BuildURL(request.GetURL(), jsonReq) + if err != nil { + return nil, err + } + reqUrl := fmt.Sprintf("%s://%s/%s%s", c.Config.Scheme, c.Config.Endpoint, request.GetVersion(), encodedUrl) + + body, err := builder.BuildBody(jsonReq) + if err != nil { + return nil, err + } + + sign := func(r *http.Request) error { + regionId := request.GetRegionId() + // some request has no region parameter, so give a value to it, + // then API gateway can calculate sign successfully. + if regionId == "" { + regionId = "jdcloud-api" + } + + signer := NewSigner(c.Credential, c.Logger) + _, err := signer.Sign(r, strings.NewReader(body), serviceName, regionId, time.Now()) + return err + } + + return c.doSend(method, reqUrl, body, request.GetHeaders(), c.Config.Timeout, sign) +} + +func (c JDCloudClient) doSend(method, url, data string, header map[string]string, timeout time.Duration, sign SignFunc) ([]byte, error) { + client := &http.Client{Timeout: timeout} + + req, err := http.NewRequest(method, url, strings.NewReader(data)) + if err != nil { + c.Logger.Log(LogFatal, err.Error()) + return nil, err + } + + c.setHeader(req, header) + + err = sign(req) + if err != nil { + return nil, err + } + + resp, err := client.Do(req) + if err != nil { + c.Logger.Log(LogError, err.Error()) + return nil, err + } + + processor := GetResponseProcessor(req.Method) + result, err := processor.Process(resp) + if err != nil { + c.Logger.Log(LogError, err.Error()) + return nil, err + } + return result, nil +} + +func (c JDCloudClient) setHeader(req *http.Request, header map[string]string) { + + req.Header.Set("Content-Type", "application/json") + req.Header.Set("User-Agent", fmt.Sprintf("JdcloudSdkGo/%s %s/%s", Version, c.ServiceName, c.Revision)) + + base64Headers := []string{HeaderJdcloudPrefix + "-pin", HeaderJdcloudPrefix + "-erp", HeaderJdcloudPrefix + "-security-token", + HeaderJcloudPrefix + "-pin", HeaderJcloudPrefix + "-erp", HeaderJcloudPrefix + "-security-token"} + + for k, v := range header { + if includes(base64Headers, strings.ToLower(k)) { + v = base64.StdEncoding.EncodeToString([]byte(v)) + } + + req.Header.Set(k, v) + } + + for k, v := range req.Header { + c.Logger.Log(LogInfo, k, v) + } +} diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/core/JdcloudRequest.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/core/JdcloudRequest.go new file mode 100644 index 000000000..3f98a8f67 --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/core/JdcloudRequest.go @@ -0,0 +1,55 @@ +// Copyright 2018-2025 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT 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 core + +type RequestInterface interface { + GetURL() string + GetMethod() string + GetVersion() string + GetHeaders() map[string]string + GetRegionId() string +} + +// JDCloudRequest is the base struct of service requests +type JDCloudRequest struct { + URL string // resource url, i.e. /regions/${regionId}/elasticIps/${elasticIpId} + Method string + Header map[string]string + Version string +} + +func (r JDCloudRequest) GetURL() string { + return r.URL +} + +func (r JDCloudRequest) GetMethod() string { + return r.Method +} + +func (r JDCloudRequest) GetVersion() string { + return r.Version +} + +func (r JDCloudRequest) GetHeaders() map[string]string { + return r.Header +} + +// AddHeader only adds pin or erp, they will be encoded to base64 code +func (r *JDCloudRequest) AddHeader(key, value string) { + if r.Header == nil { + r.Header = make(map[string]string) + } + r.Header[key] = value +} diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/core/Logger.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/core/Logger.go new file mode 100644 index 000000000..deff03c9c --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/core/Logger.go @@ -0,0 +1,43 @@ +// Copyright 2018-2025 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT 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 core + +import "fmt" + +const ( + LogFatal = iota + LogError + LogWarn + LogInfo +) + +type Logger interface { + Log(level int, message... interface{}) +} + +type DefaultLogger struct { + Level int +} + +func NewDefaultLogger(level int) *DefaultLogger { + return &DefaultLogger{level} +} + +func (logger DefaultLogger) Log (level int, message... interface{}) { + if level <= logger.Level { + fmt.Println(message...) + } +} + diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/core/ParameterBuilder.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/core/ParameterBuilder.go new file mode 100644 index 000000000..a48dcc5d1 --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/core/ParameterBuilder.go @@ -0,0 +1,216 @@ +// Copyright 2018-2025 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT 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 core + +import ( + "encoding/json" + "fmt" + "regexp" + "strings" + "errors" + "reflect" + urllib "net/url" +) + +var baseRequestFields []string + +func init() { + req := JDCloudRequest{} + reqType := reflect.TypeOf(req) + for i := 0; i < reqType.NumField(); i++ { + baseRequestFields = append(baseRequestFields, reqType.Field(i).Name) + } +} + +type ParameterBuilder interface { + BuildURL(url string, paramJson []byte) (string, error) + BuildBody(paramJson []byte) (string, error) +} + +func GetParameterBuilder(method string, logger Logger) ParameterBuilder { + if method == MethodGet || method == MethodDelete || method == MethodHead { + return &WithoutBodyBuilder{logger} + } else { + return &WithBodyBuilder{logger} + } +} + +// WithBodyBuilder supports PUT/POST/PATCH methods. +// It has path and body (json) parameters, but no query parameters. +type WithBodyBuilder struct { + Logger Logger +} + +func (b WithBodyBuilder) BuildURL(url string, paramJson []byte) (string, error) { + paramMap := make(map[string]interface{}) + err := json.Unmarshal(paramJson, ¶mMap) + if err != nil { + b.Logger.Log(LogError, err.Error()) + return "", err + } + + replacedUrl, err := replaceUrlWithPathParam(url, paramMap) + if err != nil { + b.Logger.Log(LogError, err.Error()) + return "", err + } + + encodedUrl, err := encodeUrl(replacedUrl, nil) + if err != nil { + return "", err + } + + b.Logger.Log(LogInfo, "URL=" + encodedUrl) + return encodedUrl, nil +} + +func (b WithBodyBuilder) BuildBody(paramJson []byte) (string, error) { + paramMap := make(map[string]interface{}) + err := json.Unmarshal(paramJson, ¶mMap) + if err != nil { + b.Logger.Log(LogError, err.Error()) + return "", err + } + + // remove base request fields + for k := range paramMap { + if includes(baseRequestFields, k) { + delete(paramMap, k) + } + } + + body, _ := json.Marshal(paramMap) + b.Logger.Log(LogInfo, "Body=", string(body)) + return string(body), nil +} + +// WithoutBodyBuilder supports GET/DELETE methods. +// It only builds path and query parameters. +type WithoutBodyBuilder struct { + Logger Logger +} + +func (b WithoutBodyBuilder) BuildURL(url string, paramJson []byte) (string, error) { + paramMap := make(map[string]interface{}) + err := json.Unmarshal(paramJson, ¶mMap) + if err != nil { + b.Logger.Log(LogError, err.Error()) + return "", err + } + + resultUrl, err := replaceUrlWithPathParam(url, paramMap) + if err != nil { + b.Logger.Log(LogError, err.Error()) + return "", err + } + + queryParams := buildQueryParams(paramMap, url) + encodedUrl, err := encodeUrl(resultUrl, queryParams) + if err != nil { + return "", err + } + + b.Logger.Log(LogInfo, string(paramJson)) + b.Logger.Log(LogInfo, "URL=" + encodedUrl) + return encodedUrl, nil +} + +func (b WithoutBodyBuilder) BuildBody(paramJson []byte) (string, error) { + return "", nil +} + +func replaceUrlWithPathParam(url string, paramMap map[string]interface{}) (string, error) { + r, _ := regexp.Compile("{[a-zA-Z0-9-_]+}") + matches := r.FindAllString(url, -1) + for _, match := range matches { + field := strings.TrimLeft(match, "{") + field = strings.TrimRight(field, "}") + value, ok := paramMap[field] + if !ok { + return "", errors.New("Can not find path parameter: " + field) + } + + valueStr := fmt.Sprintf("%v", value) + url = strings.Replace(url, match, valueStr, -1) + } + + return url, nil +} + +func buildQueryParams(paramMap map[string]interface{}, url string) urllib.Values { + values := urllib.Values{} + accessMap(paramMap, url, "", values) + return values +} + +func accessMap(paramMap map[string]interface{}, url, prefix string, values urllib.Values) { + for k, v := range paramMap { + // exclude fields of JDCloudRequest class and path parameters + if shouldIgnoreField(url, k) { + continue + } + + switch e := v.(type) { + case []interface{}: + for i, n := range e { + switch f := n.(type) { + case map[string]interface{}: + subPrefix := fmt.Sprintf("%s.%d.", k, i+1) + accessMap(f, url, subPrefix, values) + case nil: + default: + values.Set(fmt.Sprintf("%s%s.%d", prefix, k, i+1), fmt.Sprintf("%s", n)) + } + } + case nil: + default: + values.Set(fmt.Sprintf("%s%s", prefix, k), fmt.Sprintf("%v", v)) + } + } +} + +func shouldIgnoreField(url, field string) bool { + flag := "{" + field + "}" + if strings.Contains(url, flag) { + return true + } + + if includes(baseRequestFields, field) { + return true + } + + return false +} + +func encodeUrl(requestUrl string, values urllib.Values) (string, error) { + urlObj, err := urllib.Parse(requestUrl) + if err != nil { + return "", err + } + + urlObj.RawPath = EscapePath(urlObj.Path, false) + uri := urlObj.EscapedPath() + + if values != nil { + queryParam := values.Encode() + // RFC 3986, ' ' should be encoded to 20%, '+' to 2B% + queryParam = strings.Replace(queryParam, "+", "%20", -1) + if queryParam != "" { + uri += "?" + queryParam + } + } + + return uri, nil +} diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/core/ResponseProcessor.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/core/ResponseProcessor.go new file mode 100644 index 000000000..217b4b868 --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/core/ResponseProcessor.go @@ -0,0 +1,40 @@ +package core + +import ( + "net/http" + "io/ioutil" + "errors" + "fmt" +) + +type ResponseProcessor interface { + Process(response *http.Response) ([]byte, error) +} + +func GetResponseProcessor(method string) ResponseProcessor { + if method == MethodHead { + return &WithoutBodyResponseProcessor{} + } else { + return &WithBodyResponseProcessor{} + } +} + +type WithBodyResponseProcessor struct { +} + +func (p WithBodyResponseProcessor) Process(response *http.Response) ([]byte, error) { + defer response.Body.Close() + return ioutil.ReadAll(response.Body) +} + +type WithoutBodyResponseProcessor struct { +} + +func (p WithoutBodyResponseProcessor) Process(response *http.Response) ([]byte, error) { + requestId := response.Header.Get(HeaderJdcloudRequestId) + if requestId != "" { + return []byte(fmt.Sprintf(`{"requestId":"%s"}`, requestId)), nil + } + + return nil, errors.New("can not get requestId in HEAD response") +} \ No newline at end of file diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/core/Signer.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/core/Signer.go new file mode 100644 index 000000000..670868597 --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/core/Signer.go @@ -0,0 +1,380 @@ +// Copyright 2018-2025 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// This signer is modified from AWS V4 signer algorithm. + +package core + +import ( + "crypto/hmac" + "crypto/sha256" + "encoding/hex" + "fmt" + "io" + "net/http" + "net/url" + "sort" + "strings" + "time" + "bytes" + "github.com/gofrs/uuid" +) + +const ( + authHeaderPrefix = "JDCLOUD2-HMAC-SHA256" + timeFormat = "20060102T150405Z" + shortTimeFormat = "20060102" + + // emptyStringSHA256 is a SHA256 of an empty string + emptyStringSHA256 = `e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855` +) + +var ignoredHeaders = []string {"Authorization", "User-Agent", "X-Jdcloud-Request-Id"} +var noEscape [256]bool + +func init() { + for i := 0; i < len(noEscape); i++ { + // expects every character except these to be escaped + noEscape[i] = (i >= 'A' && i <= 'Z') || + (i >= 'a' && i <= 'z') || + (i >= '0' && i <= '9') || + i == '-' || + i == '.' || + i == '_' || + i == '~' + } +} + + +type Signer struct { + Credentials Credential + Logger Logger +} + +func NewSigner(credsProvider Credential, logger Logger) *Signer { + return &Signer{ + Credentials: credsProvider, + Logger: logger, + } +} + +type signingCtx struct { + ServiceName string + Region string + Request *http.Request + Body io.ReadSeeker + Query url.Values + Time time.Time + ExpireTime time.Duration + SignedHeaderVals http.Header + + credValues Credential + formattedTime string + formattedShortTime string + + bodyDigest string + signedHeaders string + canonicalHeaders string + canonicalString string + credentialString string + stringToSign string + signature string + authorization string +} + +// Sign signs the request by using AWS V4 signer algorithm, and adds Authorization header +func (v4 Signer) Sign(r *http.Request, body io.ReadSeeker, service, region string, signTime time.Time) (http.Header, error) { + return v4.signWithBody(r, body, service, region, 0, signTime) +} + +func (v4 Signer) signWithBody(r *http.Request, body io.ReadSeeker, service, region string, exp time.Duration, + signTime time.Time) (http.Header, error) { + + ctx := &signingCtx{ + Request: r, + Body: body, + Query: r.URL.Query(), + Time: signTime, + ExpireTime: exp, + ServiceName: service, + Region: region, + } + + for key := range ctx.Query { + sort.Strings(ctx.Query[key]) + } + + if ctx.isRequestSigned() { + ctx.Time = time.Now() + } + + ctx.credValues = v4.Credentials + ctx.build() + + v4.logSigningInfo(ctx) + return ctx.SignedHeaderVals, nil +} + +const logSignInfoMsg = `DEBUG: Request Signature: +---[ CANONICAL STRING ]----------------------------- +%s +---[ STRING TO SIGN ]-------------------------------- +%s%s +-----------------------------------------------------` + +func (v4 *Signer) logSigningInfo(ctx *signingCtx) { + signedURLMsg := "" + msg := fmt.Sprintf(logSignInfoMsg, ctx.canonicalString, ctx.stringToSign, signedURLMsg) + v4.Logger.Log(LogInfo, msg) +} + +func (ctx *signingCtx) build() { + ctx.buildTime() // no depends + ctx.buildNonce() // no depends + ctx.buildCredentialString() // no depends + ctx.buildBodyDigest() + + unsignedHeaders := ctx.Request.Header + ctx.buildCanonicalHeaders(unsignedHeaders) + ctx.buildCanonicalString() // depends on canon headers / signed headers + ctx.buildStringToSign() // depends on canon string + ctx.buildSignature() // depends on string to sign + + parts := []string{ + authHeaderPrefix + " Credential=" + ctx.credValues.AccessKey + "/" + ctx.credentialString, + "SignedHeaders=" + ctx.signedHeaders, + "Signature=" + ctx.signature, + } + ctx.Request.Header.Set("Authorization", strings.Join(parts, ", ")) +} + +func (ctx *signingCtx) buildTime() { + ctx.formattedTime = ctx.Time.UTC().Format(timeFormat) + ctx.formattedShortTime = ctx.Time.UTC().Format(shortTimeFormat) + + ctx.Request.Header.Set("x-jdcloud-date", ctx.formattedTime) +} + +func (ctx *signingCtx) buildNonce() { + nonce, _ := uuid.NewV4() + ctx.Request.Header.Set("x-jdcloud-nonce", nonce.String()) +} + +func (ctx *signingCtx) buildCredentialString() { + ctx.credentialString = strings.Join([]string{ + ctx.formattedShortTime, + ctx.Region, + ctx.ServiceName, + "jdcloud2_request", + }, "/") +} + +func (ctx *signingCtx) buildCanonicalHeaders(header http.Header) { + var headers []string + headers = append(headers, "host") + for k, v := range header { + canonicalKey := http.CanonicalHeaderKey(k) + if shouldIgnore(canonicalKey, ignoredHeaders) { + continue // ignored header + } + if ctx.SignedHeaderVals == nil { + ctx.SignedHeaderVals = make(http.Header) + } + + lowerCaseKey := strings.ToLower(k) + if _, ok := ctx.SignedHeaderVals[lowerCaseKey]; ok { + // include additional values + ctx.SignedHeaderVals[lowerCaseKey] = append(ctx.SignedHeaderVals[lowerCaseKey], v...) + continue + } + + headers = append(headers, lowerCaseKey) + ctx.SignedHeaderVals[lowerCaseKey] = v + } + sort.Strings(headers) + + ctx.signedHeaders = strings.Join(headers, ";") + + headerValues := make([]string, len(headers)) + for i, k := range headers { + if k == "host" { + if ctx.Request.Host != "" { + headerValues[i] = "host:" + ctx.Request.Host + } else { + headerValues[i] = "host:" + ctx.Request.URL.Host + } + } else { + headerValues[i] = k + ":" + + strings.Join(ctx.SignedHeaderVals[k], ",") + } + } + stripExcessSpaces(headerValues) + ctx.canonicalHeaders = strings.Join(headerValues, "\n") +} + +func (ctx *signingCtx) buildCanonicalString() { + uri := getURIPath(ctx.Request.URL) + + ctx.canonicalString = strings.Join([]string{ + ctx.Request.Method, + uri, + ctx.Request.URL.RawQuery, + ctx.canonicalHeaders + "\n", + ctx.signedHeaders, + ctx.bodyDigest, + }, "\n") +} + +func (ctx *signingCtx) buildStringToSign() { + ctx.stringToSign = strings.Join([]string{ + authHeaderPrefix, + ctx.formattedTime, + ctx.credentialString, + hex.EncodeToString(makeSha256([]byte(ctx.canonicalString))), + }, "\n") +} + +func (ctx *signingCtx) buildSignature() { + secret := ctx.credValues.SecretKey + date := makeHmac([]byte("JDCLOUD2"+secret), []byte(ctx.formattedShortTime)) + region := makeHmac(date, []byte(ctx.Region)) + service := makeHmac(region, []byte(ctx.ServiceName)) + credentials := makeHmac(service, []byte("jdcloud2_request")) + signature := makeHmac(credentials, []byte(ctx.stringToSign)) + ctx.signature = hex.EncodeToString(signature) +} + +func (ctx *signingCtx) buildBodyDigest() { + var hash string + if ctx.Body == nil { + hash = emptyStringSHA256 + } else { + hash = hex.EncodeToString(makeSha256Reader(ctx.Body)) + } + + ctx.bodyDigest = hash +} + +// isRequestSigned returns if the request is currently signed or presigned +func (ctx *signingCtx) isRequestSigned() bool { + if ctx.Request.Header.Get("Authorization") != "" { + return true + } + + return false +} + +func makeHmac(key []byte, data []byte) []byte { + hash := hmac.New(sha256.New, key) + hash.Write(data) + return hash.Sum(nil) +} + +func makeSha256(data []byte) []byte { + hash := sha256.New() + hash.Write(data) + return hash.Sum(nil) +} + +func makeSha256Reader(reader io.ReadSeeker) []byte { + hash := sha256.New() + start, _ := reader.Seek(0, 1) + defer reader.Seek(start, 0) + + io.Copy(hash, reader) + return hash.Sum(nil) +} + +const doubleSpace = " " + +// stripExcessSpaces will rewrite the passed in slice's string values to not +// contain multiple side-by-side spaces. +func stripExcessSpaces(vals []string) { + var j, k, l, m, spaces int + for i, str := range vals { + // Trim trailing spaces + for j = len(str) - 1; j >= 0 && str[j] == ' '; j-- { + } + + // Trim leading spaces + for k = 0; k < j && str[k] == ' '; k++ { + } + str = str[k : j+1] + + // Strip multiple spaces. + j = strings.Index(str, doubleSpace) + if j < 0 { + vals[i] = str + continue + } + + buf := []byte(str) + for k, m, l = j, j, len(buf); k < l; k++ { + if buf[k] == ' ' { + if spaces == 0 { + // First space. + buf[m] = buf[k] + m++ + } + spaces++ + } else { + // End of multiple spaces. + spaces = 0 + buf[m] = buf[k] + m++ + } + } + + vals[i] = string(buf[:m]) + } +} + +func getURIPath(u *url.URL) string { + var uri string + + if len(u.Opaque) > 0 { + uri = "/" + strings.Join(strings.Split(u.Opaque, "/")[3:], "/") + } else { + uri = u.EscapedPath() + } + + if len(uri) == 0 { + uri = "/" + } + + return uri +} + +func shouldIgnore(header string, ignoreHeaders []string) bool { + for _, v := range ignoreHeaders { + if v == header { + return true + } + } + return false +} + +// EscapePath escapes part of a URL path +func EscapePath(path string, encodeSep bool) string { + var buf bytes.Buffer + for i := 0; i < len(path); i++ { + c := path[i] + if noEscape[c] || (c == '/' && !encodeSep) { + buf.WriteByte(c) + } else { + fmt.Fprintf(&buf, "%%%02X", c) + } + } + return buf.String() +} diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/core/Utils.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/core/Utils.go new file mode 100644 index 000000000..62e2edbf4 --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/core/Utils.go @@ -0,0 +1,11 @@ +package core + +func includes(fields []string, field string) bool { + for _, v := range fields { + if v == field { + return true + } + } + + return false +} \ No newline at end of file diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/core/Version.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/core/Version.go new file mode 100644 index 000000000..3bde9f3e9 --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/core/Version.go @@ -0,0 +1,17 @@ +// Copyright 2018-2025 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT 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 core + +const Version = "1.1.3" diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/charge/models/Charge.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/charge/models/Charge.go new file mode 100644 index 000000000..c9669e0c5 --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/charge/models/Charge.go @@ -0,0 +1,36 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package models + + +type Charge struct { + + /* 支付模式,取值为:prepaid_by_duration,postpaid_by_usage或postpaid_by_duration,prepaid_by_duration表示预付费,postpaid_by_usage表示按用量后付费,postpaid_by_duration表示按配置后付费,默认为postpaid_by_duration (Optional) */ + ChargeMode string `json:"chargeMode"` + + /* 费用支付状态,取值为:normal、overdue、arrear,normal表示正常,overdue表示已到期,arrear表示欠费 (Optional) */ + ChargeStatus string `json:"chargeStatus"` + + /* 计费开始时间,遵循ISO8601标准,使用UTC时间,格式为:YYYY-MM-DDTHH:mm:ssZ (Optional) */ + ChargeStartTime string `json:"chargeStartTime"` + + /* 过期时间,预付费资源的到期时间,遵循ISO8601标准,使用UTC时间,格式为:YYYY-MM-DDTHH:mm:ssZ,后付费资源此字段内容为空 (Optional) */ + ChargeExpiredTime string `json:"chargeExpiredTime"` + + /* 预期释放时间,资源的预期释放时间,预付费/后付费资源均有此值,遵循ISO8601标准,使用UTC时间,格式为:YYYY-MM-DDTHH:mm:ssZ (Optional) */ + ChargeRetireTime string `json:"chargeRetireTime"` +} diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/charge/models/ChargeSpec.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/charge/models/ChargeSpec.go new file mode 100644 index 000000000..32169444e --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/charge/models/ChargeSpec.go @@ -0,0 +1,30 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package models + + +type ChargeSpec struct { + + /* 计费模式,取值为:prepaid_by_duration,postpaid_by_usage或postpaid_by_duration,prepaid_by_duration表示预付费,postpaid_by_usage表示按用量后付费,postpaid_by_duration表示按配置后付费,默认为postpaid_by_duration (Optional) */ + ChargeMode *string `json:"chargeMode"` + + /* 预付费计费单位,当chargeMode为prepaid_by_duration时有效,取值为:month、year,默认为month (Optional) */ + ChargeUnit *string `json:"chargeUnit"` + + /* 预付费计费时长,当chargeMode取值为prepaid_by_duration时有效。当chargeUnit为month时取值为:1~9,当chargeUnit为year时取值为:1、2、3 (Optional) */ + ChargeDuration *int `json:"chargeDuration"` +} diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/common/models/Filter.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/common/models/Filter.go new file mode 100644 index 000000000..e89325aed --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/common/models/Filter.go @@ -0,0 +1,30 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package models + + +type Filter struct { + + /* 过滤条件的名称 */ + Name string `json:"name"` + + /* 过滤条件的操作符,默认eq (Optional) */ + Operator *string `json:"operator"` + + /* 过滤条件的值 */ + Values []string `json:"values"` +} diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/common/models/Quota.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/common/models/Quota.go new file mode 100644 index 000000000..a9553732c --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/common/models/Quota.go @@ -0,0 +1,30 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package models + + +type Quota struct { + + /* 配额项的名称 (Optional) */ + Name string `json:"name"` + + /* 配额 (Optional) */ + Max int `json:"max"` + + /* 已使用的数目 (Optional) */ + Used int `json:"used"` +} diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/common/models/SimpleResponses.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/common/models/SimpleResponses.go new file mode 100644 index 000000000..dcc6059fd --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/common/models/SimpleResponses.go @@ -0,0 +1,24 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package models + + +type SimpleResponses struct { + + /* Request ID (Optional) */ + RequestId string `json:"requestId"` +} diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/common/models/Sort.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/common/models/Sort.go new file mode 100644 index 000000000..b99a1853a --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/common/models/Sort.go @@ -0,0 +1,27 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package models + + +type Sort struct { + + /* 排序条件的名称 (Optional) */ + Name *string `json:"name"` + + /* 排序条件的方向 (Optional) */ + Direction *string `json:"direction"` +} diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/common/models/TagFilter.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/common/models/TagFilter.go new file mode 100644 index 000000000..60e1f0774 --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/common/models/TagFilter.go @@ -0,0 +1,27 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package models + + +type TagFilter struct { + + /* Tag键 */ + Key string `json:"key"` + + /* Tag值 */ + Values []string `json:"values"` +} diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/disk/models/Disk.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/disk/models/Disk.go new file mode 100644 index 000000000..27a2f0a2a --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/disk/models/Disk.go @@ -0,0 +1,73 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package models + +import charge "github.com/jdcloud-api/jdcloud-sdk-go/services/charge/models" + +type Disk struct { + + /* 云硬盘ID (Optional) */ + DiskId string `json:"diskId"` + + /* 云硬盘所属AZ (Optional) */ + Az string `json:"az"` + + /* 云硬盘名称,只允许输入中文、数字、大小写字母、英文下划线“_”及中划线“-”,不允许为空且不超过32字符。 (Optional) */ + Name string `json:"name"` + + /* 云硬盘描述,允许输入UTF-8编码下的全部字符,不超过256字符。 (Optional) */ + Description string `json:"description"` + + /* 云硬盘类型,取值为 ssd,premium-hdd,ssd.gp1,ssd.io1,hdd.std1 (Optional) */ + DiskType string `json:"diskType"` + + /* 云硬盘大小,单位为 GiB (Optional) */ + DiskSizeGB int `json:"diskSizeGB"` + + /* 该云硬盘实际应用的iops值 (Optional) */ + Iops int `json:"iops"` + + /* 该云硬盘实际应用的吞吐量的数值 (Optional) */ + Throughput int `json:"throughput"` + + /* 云硬盘状态,取值为 creating、available、in-use、extending、restoring、deleting、deleted、error_create、error_delete、error_restore、error_extend 之一 (Optional) */ + Status string `json:"status"` + + /* 挂载信息 (Optional) */ + Attachments []DiskAttachment `json:"attachments"` + + /* 创建该云硬盘的快照ID (Optional) */ + SnapshotId string `json:"snapshotId"` + + /* 云盘是否支持多挂载 (Optional) */ + MultiAttachable bool `json:"multiAttachable"` + + /* 云盘是否为加密盘 (Optional) */ + Encrypted bool `json:"encrypted"` + + /* 云盘是否被暂停(IOPS限制为极低) (Optional) */ + Enable bool `json:"enable"` + + /* 创建云硬盘时间 (Optional) */ + CreateTime string `json:"createTime"` + + /* 云硬盘计费配置信息 (Optional) */ + Charge charge.Charge `json:"charge"` + + /* Tag信息 (Optional) */ + Tags []Tag `json:"tags"` +} diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/disk/models/DiskAttachment.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/disk/models/DiskAttachment.go new file mode 100644 index 000000000..220f3a51f --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/disk/models/DiskAttachment.go @@ -0,0 +1,39 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package models + + +type DiskAttachment struct { + + /* 挂载ID (Optional) */ + AttachmentId string `json:"attachmentId"` + + /* 云硬盘ID (Optional) */ + DiskId string `json:"diskId"` + + /* 挂载实例的类型,取值为 vm、nc (Optional) */ + InstanceType string `json:"instanceType"` + + /* 挂载实例的ID (Optional) */ + InstanceId string `json:"instanceId"` + + /* 挂载状态,取值为 "attaching", "attached", "detaching", "detached" (Optional) */ + Status string `json:"status"` + + /* 挂载时间 (Optional) */ + AttachTime string `json:"attachTime"` +} diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/disk/models/DiskSpec.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/disk/models/DiskSpec.go new file mode 100644 index 000000000..c694ebf82 --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/disk/models/DiskSpec.go @@ -0,0 +1,49 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package models + +import charge "github.com/jdcloud-api/jdcloud-sdk-go/services/charge/models" + +type DiskSpec struct { + + /* 云硬盘所属的可用区 */ + Az string `json:"az"` + + /* 云硬盘名称 */ + Name string `json:"name"` + + /* 云硬盘描述 (Optional) */ + Description *string `json:"description"` + + /* 云硬盘类型,取值为ssd、premium-hdd、ssd.gp1、ssd.io1、hdd.std1之一 */ + DiskType string `json:"diskType"` + + /* 云硬盘大小,单位为 GiB,ssd 类型取值范围[20,1000]GB,步长为10G,premium-hdd 类型取值范围[20,3000]GB,步长为10G */ + DiskSizeGB int `json:"diskSizeGB"` + + /* 用于创建云硬盘的快照ID (Optional) */ + SnapshotId *string `json:"snapshotId"` + + /* 计费配置;如不指定,默认计费类型是后付费-按使用时常付费 (Optional) */ + Charge *charge.ChargeSpec `json:"charge"` + + /* 云硬盘是否支持一盘多主机挂载,默认为false(不支持) (Optional) */ + MultiAttachable *bool `json:"multiAttachable"` + + /* 云硬盘是否加密,默认为false(不加密) (Optional) */ + Encrypt *bool `json:"encrypt"` +} diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/disk/models/DiskSpecification.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/disk/models/DiskSpecification.go new file mode 100644 index 000000000..8f439a49e --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/disk/models/DiskSpecification.go @@ -0,0 +1,54 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package models + + +type DiskSpecification struct { + + /* 云硬盘类型 (Optional) */ + DiskType string `json:"diskType"` + + /* 支持的最小尺寸,单位为 GiB (Optional) */ + MinSizeGB int `json:"minSizeGB"` + + /* 支持的最大尺寸,单位为 GiB (Optional) */ + MaxSizeGB int `json:"maxSizeGB"` + + /* 步长尺寸,单位为 GiB (Optional) */ + StepSizeGB int `json:"stepSizeGB"` + + /* 描述信息 (Optional) */ + Description string `json:"description"` + + /* 默认的iops数量(基础iops数量) (Optional) */ + DefaultIOPS int `json:"defaultIOPS"` + + /* iops步长增量 (Optional) */ + StepIOPS float32 `json:"stepIOPS"` + + /* 最大iops数量 (Optional) */ + MaxIOPS int `json:"maxIOPS"` + + /* 默认的吞吐量 (Optional) */ + DefaultThroughput int `json:"defaultThroughput"` + + /* 吞吐量步长增量 (Optional) */ + StepThroughput float32 `json:"stepThroughput"` + + /* 最大吞吐量 (Optional) */ + MaxThroughput int `json:"maxThroughput"` +} diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/disk/models/Quota.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/disk/models/Quota.go new file mode 100644 index 000000000..4f318f4a0 --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/disk/models/Quota.go @@ -0,0 +1,27 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package models + + +type Quota struct { + + /* 配额 (Optional) */ + Limit int `json:"limit"` + + /* 已使用的数目 (Optional) */ + Used int `json:"used"` +} diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/disk/models/ShareInfo.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/disk/models/ShareInfo.go new file mode 100644 index 000000000..70f5df781 --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/disk/models/ShareInfo.go @@ -0,0 +1,27 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package models + + +type ShareInfo struct { + + /* 被共享快照的用户的pin (Optional) */ + ShareTo string `json:"shareTo"` + + /* 共享时间 (Optional) */ + ShareTime string `json:"shareTime"` +} diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/disk/models/Snapshot.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/disk/models/Snapshot.go new file mode 100644 index 000000000..12a3bbf94 --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/disk/models/Snapshot.go @@ -0,0 +1,54 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package models + + +type Snapshot struct { + + /* 云硬盘快照ID (Optional) */ + SnapshotId string `json:"snapshotId"` + + /* 快照来源 可以有self,others两种来源 (Optional) */ + SnapshotSource string `json:"snapshotSource"` + + /* 创建快照的云硬盘ID(snapshotSource为others时不展示) (Optional) */ + DiskId string `json:"diskId"` + + /* 快照大小,单位为GiB (Optional) */ + SnapshotSizeGB int `json:"snapshotSizeGB"` + + /* 快照关联的所有镜像ID(snapshotSource为others时不展示) (Optional) */ + Images []string `json:"images"` + + /* 快照名称 (Optional) */ + Name string `json:"name"` + + /* 快照描述 (Optional) */ + Description string `json:"description"` + + /* 快照状态,取值为 creating、available、in-use、deleting、error_create、error_delete 之一 (Optional) */ + Status string `json:"status"` + + /* 创建时间 (Optional) */ + CreateTime string `json:"createTime"` + + /* 共享信息 (Optional) */ + SharInfo []ShareInfo `json:"sharInfo"` + + /* 快照是否为加密盘的快照 (Optional) */ + Encrypted bool `json:"encrypted"` +} diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/disk/models/SnapshotSpec.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/disk/models/SnapshotSpec.go new file mode 100644 index 000000000..0918fa64a --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/disk/models/SnapshotSpec.go @@ -0,0 +1,30 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package models + + +type SnapshotSpec struct { + + /* 快照名称 */ + Name string `json:"name"` + + /* 快照描述 (Optional) */ + Description *string `json:"description"` + + /* 用于创建快照的云盘ID */ + DiskId string `json:"diskId"` +} diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/disk/models/Soldout.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/disk/models/Soldout.go new file mode 100644 index 000000000..587bbdf25 --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/disk/models/Soldout.go @@ -0,0 +1,30 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package models + + +type Soldout struct { + + /* 云硬盘所属的可用区 */ + AzName string `json:"azName"` + + /* 云硬盘类型,取值为ssd、premium-hdd、ssd.gp1、ssd.io1、hdd.std1之一 */ + MediaType string `json:"mediaType"` + + /* 是否售罄 */ + IsSoldOut bool `json:"isSoldOut"` +} diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/disk/models/Tag.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/disk/models/Tag.go new file mode 100644 index 000000000..467465457 --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/disk/models/Tag.go @@ -0,0 +1,27 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package models + + +type Tag struct { + + /* Tag键 (Optional) */ + Key string `json:"key"` + + /* Tag值 (Optional) */ + Value string `json:"value"` +} diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/disk/models/TagFilter.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/disk/models/TagFilter.go new file mode 100644 index 000000000..60e1f0774 --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/disk/models/TagFilter.go @@ -0,0 +1,27 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package models + + +type TagFilter struct { + + /* Tag键 */ + Key string `json:"key"` + + /* Tag值 */ + Values []string `json:"values"` +} diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/AssociateElasticIp.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/AssociateElasticIp.go new file mode 100644 index 000000000..c562811b1 --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/AssociateElasticIp.go @@ -0,0 +1,128 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package apis + +import ( + "github.com/jdcloud-api/jdcloud-sdk-go/core" +) + +type AssociateElasticIpRequest struct { + + core.JDCloudRequest + + /* 地域ID */ + RegionId string `json:"regionId"` + + /* 云主机ID */ + InstanceId string `json:"instanceId"` + + /* 弹性公网IP的ID */ + ElasticIpId string `json:"elasticIpId"` +} + +/* + * param regionId: 地域ID (Required) + * param instanceId: 云主机ID (Required) + * param elasticIpId: 弹性公网IP的ID (Required) + * + * @Deprecated, not compatible when mandatory parameters changed + */ +func NewAssociateElasticIpRequest( + regionId string, + instanceId string, + elasticIpId string, +) *AssociateElasticIpRequest { + + return &AssociateElasticIpRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/instances/{instanceId}:associateElasticIp", + Method: "POST", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + InstanceId: instanceId, + ElasticIpId: elasticIpId, + } +} + +/* + * param regionId: 地域ID (Required) + * param instanceId: 云主机ID (Required) + * param elasticIpId: 弹性公网IP的ID (Required) + */ +func NewAssociateElasticIpRequestWithAllParams( + regionId string, + instanceId string, + elasticIpId string, +) *AssociateElasticIpRequest { + + return &AssociateElasticIpRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/instances/{instanceId}:associateElasticIp", + Method: "POST", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + InstanceId: instanceId, + ElasticIpId: elasticIpId, + } +} + +/* This constructor has better compatible ability when API parameters changed */ +func NewAssociateElasticIpRequestWithoutParam() *AssociateElasticIpRequest { + + return &AssociateElasticIpRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/instances/{instanceId}:associateElasticIp", + Method: "POST", + Header: nil, + Version: "v1", + }, + } +} + +/* param regionId: 地域ID(Required) */ +func (r *AssociateElasticIpRequest) SetRegionId(regionId string) { + r.RegionId = regionId +} + +/* param instanceId: 云主机ID(Required) */ +func (r *AssociateElasticIpRequest) SetInstanceId(instanceId string) { + r.InstanceId = instanceId +} + +/* param elasticIpId: 弹性公网IP的ID(Required) */ +func (r *AssociateElasticIpRequest) SetElasticIpId(elasticIpId string) { + r.ElasticIpId = elasticIpId +} + +// GetRegionId returns path parameter 'regionId' if exist, +// otherwise return empty string +func (r AssociateElasticIpRequest) GetRegionId() string { + return r.RegionId +} + +type AssociateElasticIpResponse struct { + RequestID string `json:"requestId"` + Error core.ErrorResponse `json:"error"` + Result AssociateElasticIpResult `json:"result"` +} + +type AssociateElasticIpResult struct { +} \ No newline at end of file diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/AttachDisk.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/AttachDisk.go new file mode 100644 index 000000000..e699d8ea5 --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/AttachDisk.go @@ -0,0 +1,150 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package apis + +import ( + "github.com/jdcloud-api/jdcloud-sdk-go/core" +) + +type AttachDiskRequest struct { + + core.JDCloudRequest + + /* 地域ID */ + RegionId string `json:"regionId"` + + /* 云主机ID */ + InstanceId string `json:"instanceId"` + + /* 云硬盘ID */ + DiskId string `json:"diskId"` + + /* 数据盘的逻辑挂载点[vda,vdb,vdc,vdd,vde,vdf,vdg,vdh,vdi],挂载系统盘时vda必传 (Optional) */ + DeviceName *string `json:"deviceName"` + + /* 自动随主机删除此云硬盘,默认为False。仅按配置计费云硬盘支持修改此参数,包年包月云硬盘默认为False且不可修改。如果是共享型云硬盘,此参数无效。 (Optional) */ + AutoDelete *bool `json:"autoDelete"` +} + +/* + * param regionId: 地域ID (Required) + * param instanceId: 云主机ID (Required) + * param diskId: 云硬盘ID (Required) + * + * @Deprecated, not compatible when mandatory parameters changed + */ +func NewAttachDiskRequest( + regionId string, + instanceId string, + diskId string, +) *AttachDiskRequest { + + return &AttachDiskRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/instances/{instanceId}:attachDisk", + Method: "POST", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + InstanceId: instanceId, + DiskId: diskId, + } +} + +/* + * param regionId: 地域ID (Required) + * param instanceId: 云主机ID (Required) + * param diskId: 云硬盘ID (Required) + * param deviceName: 数据盘的逻辑挂载点[vda,vdb,vdc,vdd,vde,vdf,vdg,vdh,vdi],挂载系统盘时vda必传 (Optional) + * param autoDelete: 自动随主机删除此云硬盘,默认为False。仅按配置计费云硬盘支持修改此参数,包年包月云硬盘默认为False且不可修改。如果是共享型云硬盘,此参数无效。 (Optional) + */ +func NewAttachDiskRequestWithAllParams( + regionId string, + instanceId string, + diskId string, + deviceName *string, + autoDelete *bool, +) *AttachDiskRequest { + + return &AttachDiskRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/instances/{instanceId}:attachDisk", + Method: "POST", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + InstanceId: instanceId, + DiskId: diskId, + DeviceName: deviceName, + AutoDelete: autoDelete, + } +} + +/* This constructor has better compatible ability when API parameters changed */ +func NewAttachDiskRequestWithoutParam() *AttachDiskRequest { + + return &AttachDiskRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/instances/{instanceId}:attachDisk", + Method: "POST", + Header: nil, + Version: "v1", + }, + } +} + +/* param regionId: 地域ID(Required) */ +func (r *AttachDiskRequest) SetRegionId(regionId string) { + r.RegionId = regionId +} + +/* param instanceId: 云主机ID(Required) */ +func (r *AttachDiskRequest) SetInstanceId(instanceId string) { + r.InstanceId = instanceId +} + +/* param diskId: 云硬盘ID(Required) */ +func (r *AttachDiskRequest) SetDiskId(diskId string) { + r.DiskId = diskId +} + +/* param deviceName: 数据盘的逻辑挂载点[vda,vdb,vdc,vdd,vde,vdf,vdg,vdh,vdi],挂载系统盘时vda必传(Optional) */ +func (r *AttachDiskRequest) SetDeviceName(deviceName string) { + r.DeviceName = &deviceName +} + +/* param autoDelete: 自动随主机删除此云硬盘,默认为False。仅按配置计费云硬盘支持修改此参数,包年包月云硬盘默认为False且不可修改。如果是共享型云硬盘,此参数无效。(Optional) */ +func (r *AttachDiskRequest) SetAutoDelete(autoDelete bool) { + r.AutoDelete = &autoDelete +} + +// GetRegionId returns path parameter 'regionId' if exist, +// otherwise return empty string +func (r AttachDiskRequest) GetRegionId() string { + return r.RegionId +} + +type AttachDiskResponse struct { + RequestID string `json:"requestId"` + Error core.ErrorResponse `json:"error"` + Result AttachDiskResult `json:"result"` +} + +type AttachDiskResult struct { +} \ No newline at end of file diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/AttachNetworkInterface.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/AttachNetworkInterface.go new file mode 100644 index 000000000..75c7720fd --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/AttachNetworkInterface.go @@ -0,0 +1,139 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package apis + +import ( + "github.com/jdcloud-api/jdcloud-sdk-go/core" +) + +type AttachNetworkInterfaceRequest struct { + + core.JDCloudRequest + + /* 地域ID */ + RegionId string `json:"regionId"` + + /* 云主机ID */ + InstanceId string `json:"instanceId"` + + /* 弹性网卡ID */ + NetworkInterfaceId string `json:"networkInterfaceId"` + + /* 随主机自动删除,默认为False (Optional) */ + AutoDelete *bool `json:"autoDelete"` +} + +/* + * param regionId: 地域ID (Required) + * param instanceId: 云主机ID (Required) + * param networkInterfaceId: 弹性网卡ID (Required) + * + * @Deprecated, not compatible when mandatory parameters changed + */ +func NewAttachNetworkInterfaceRequest( + regionId string, + instanceId string, + networkInterfaceId string, +) *AttachNetworkInterfaceRequest { + + return &AttachNetworkInterfaceRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/instances/{instanceId}:attachNetworkInterface", + Method: "POST", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + InstanceId: instanceId, + NetworkInterfaceId: networkInterfaceId, + } +} + +/* + * param regionId: 地域ID (Required) + * param instanceId: 云主机ID (Required) + * param networkInterfaceId: 弹性网卡ID (Required) + * param autoDelete: 随主机自动删除,默认为False (Optional) + */ +func NewAttachNetworkInterfaceRequestWithAllParams( + regionId string, + instanceId string, + networkInterfaceId string, + autoDelete *bool, +) *AttachNetworkInterfaceRequest { + + return &AttachNetworkInterfaceRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/instances/{instanceId}:attachNetworkInterface", + Method: "POST", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + InstanceId: instanceId, + NetworkInterfaceId: networkInterfaceId, + AutoDelete: autoDelete, + } +} + +/* This constructor has better compatible ability when API parameters changed */ +func NewAttachNetworkInterfaceRequestWithoutParam() *AttachNetworkInterfaceRequest { + + return &AttachNetworkInterfaceRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/instances/{instanceId}:attachNetworkInterface", + Method: "POST", + Header: nil, + Version: "v1", + }, + } +} + +/* param regionId: 地域ID(Required) */ +func (r *AttachNetworkInterfaceRequest) SetRegionId(regionId string) { + r.RegionId = regionId +} + +/* param instanceId: 云主机ID(Required) */ +func (r *AttachNetworkInterfaceRequest) SetInstanceId(instanceId string) { + r.InstanceId = instanceId +} + +/* param networkInterfaceId: 弹性网卡ID(Required) */ +func (r *AttachNetworkInterfaceRequest) SetNetworkInterfaceId(networkInterfaceId string) { + r.NetworkInterfaceId = networkInterfaceId +} + +/* param autoDelete: 随主机自动删除,默认为False(Optional) */ +func (r *AttachNetworkInterfaceRequest) SetAutoDelete(autoDelete bool) { + r.AutoDelete = &autoDelete +} + +// GetRegionId returns path parameter 'regionId' if exist, +// otherwise return empty string +func (r AttachNetworkInterfaceRequest) GetRegionId() string { + return r.RegionId +} + +type AttachNetworkInterfaceResponse struct { + RequestID string `json:"requestId"` + Error core.ErrorResponse `json:"error"` + Result AttachNetworkInterfaceResult `json:"result"` +} + +type AttachNetworkInterfaceResult struct { +} \ No newline at end of file diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/CopyImages.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/CopyImages.go new file mode 100644 index 000000000..a6c82e8e7 --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/CopyImages.go @@ -0,0 +1,130 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package apis + +import ( + "github.com/jdcloud-api/jdcloud-sdk-go/core" + vm "github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models" +) + +type CopyImagesRequest struct { + + core.JDCloudRequest + + /* 地域ID */ + RegionId string `json:"regionId"` + + /* 源镜像ID */ + SourceImageIds []string `json:"sourceImageIds"` + + /* 目标区域 */ + DestinationRegion string `json:"destinationRegion"` +} + +/* + * param regionId: 地域ID (Required) + * param sourceImageIds: 源镜像ID (Required) + * param destinationRegion: 目标区域 (Required) + * + * @Deprecated, not compatible when mandatory parameters changed + */ +func NewCopyImagesRequest( + regionId string, + sourceImageIds []string, + destinationRegion string, +) *CopyImagesRequest { + + return &CopyImagesRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/images:copyImages", + Method: "POST", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + SourceImageIds: sourceImageIds, + DestinationRegion: destinationRegion, + } +} + +/* + * param regionId: 地域ID (Required) + * param sourceImageIds: 源镜像ID (Required) + * param destinationRegion: 目标区域 (Required) + */ +func NewCopyImagesRequestWithAllParams( + regionId string, + sourceImageIds []string, + destinationRegion string, +) *CopyImagesRequest { + + return &CopyImagesRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/images:copyImages", + Method: "POST", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + SourceImageIds: sourceImageIds, + DestinationRegion: destinationRegion, + } +} + +/* This constructor has better compatible ability when API parameters changed */ +func NewCopyImagesRequestWithoutParam() *CopyImagesRequest { + + return &CopyImagesRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/images:copyImages", + Method: "POST", + Header: nil, + Version: "v1", + }, + } +} + +/* param regionId: 地域ID(Required) */ +func (r *CopyImagesRequest) SetRegionId(regionId string) { + r.RegionId = regionId +} + +/* param sourceImageIds: 源镜像ID(Required) */ +func (r *CopyImagesRequest) SetSourceImageIds(sourceImageIds []string) { + r.SourceImageIds = sourceImageIds +} + +/* param destinationRegion: 目标区域(Required) */ +func (r *CopyImagesRequest) SetDestinationRegion(destinationRegion string) { + r.DestinationRegion = destinationRegion +} + +// GetRegionId returns path parameter 'regionId' if exist, +// otherwise return empty string +func (r CopyImagesRequest) GetRegionId() string { + return r.RegionId +} + +type CopyImagesResponse struct { + RequestID string `json:"requestId"` + Error core.ErrorResponse `json:"error"` + Result CopyImagesResult `json:"result"` +} + +type CopyImagesResult struct { + CopyImages []vm.CopyImage `json:"copyImages"` +} \ No newline at end of file diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/CreateImage.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/CreateImage.go new file mode 100644 index 000000000..f9274a996 --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/CreateImage.go @@ -0,0 +1,155 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package apis + +import ( + "github.com/jdcloud-api/jdcloud-sdk-go/core" + vm "github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models" +) + +type CreateImageRequest struct { + + core.JDCloudRequest + + /* 地域ID */ + RegionId string `json:"regionId"` + + /* 云主机ID */ + InstanceId string `json:"instanceId"` + + /* 镜像名称,参考公共参数规范。 */ + Name string `json:"name"` + + /* 镜像描述,参考公共参数规范。 */ + Description string `json:"description"` + + /* 数据盘列表,可以在实例已挂载数据盘的基础上,额外增加新的快照、空盘、或排除云主机中的数据盘。 (Optional) */ + DataDisks []vm.InstanceDiskAttachmentSpec `json:"dataDisks"` +} + +/* + * param regionId: 地域ID (Required) + * param instanceId: 云主机ID (Required) + * param name: 镜像名称,参考公共参数规范。 (Required) + * param description: 镜像描述,参考公共参数规范。 (Required) + * + * @Deprecated, not compatible when mandatory parameters changed + */ +func NewCreateImageRequest( + regionId string, + instanceId string, + name string, + description string, +) *CreateImageRequest { + + return &CreateImageRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/instances/{instanceId}:createImage", + Method: "POST", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + InstanceId: instanceId, + Name: name, + Description: description, + } +} + +/* + * param regionId: 地域ID (Required) + * param instanceId: 云主机ID (Required) + * param name: 镜像名称,参考公共参数规范。 (Required) + * param description: 镜像描述,参考公共参数规范。 (Required) + * param dataDisks: 数据盘列表,可以在实例已挂载数据盘的基础上,额外增加新的快照、空盘、或排除云主机中的数据盘。 (Optional) + */ +func NewCreateImageRequestWithAllParams( + regionId string, + instanceId string, + name string, + description string, + dataDisks []vm.InstanceDiskAttachmentSpec, +) *CreateImageRequest { + + return &CreateImageRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/instances/{instanceId}:createImage", + Method: "POST", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + InstanceId: instanceId, + Name: name, + Description: description, + DataDisks: dataDisks, + } +} + +/* This constructor has better compatible ability when API parameters changed */ +func NewCreateImageRequestWithoutParam() *CreateImageRequest { + + return &CreateImageRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/instances/{instanceId}:createImage", + Method: "POST", + Header: nil, + Version: "v1", + }, + } +} + +/* param regionId: 地域ID(Required) */ +func (r *CreateImageRequest) SetRegionId(regionId string) { + r.RegionId = regionId +} + +/* param instanceId: 云主机ID(Required) */ +func (r *CreateImageRequest) SetInstanceId(instanceId string) { + r.InstanceId = instanceId +} + +/* param name: 镜像名称,参考公共参数规范。(Required) */ +func (r *CreateImageRequest) SetName(name string) { + r.Name = name +} + +/* param description: 镜像描述,参考公共参数规范。(Required) */ +func (r *CreateImageRequest) SetDescription(description string) { + r.Description = description +} + +/* param dataDisks: 数据盘列表,可以在实例已挂载数据盘的基础上,额外增加新的快照、空盘、或排除云主机中的数据盘。(Optional) */ +func (r *CreateImageRequest) SetDataDisks(dataDisks []vm.InstanceDiskAttachmentSpec) { + r.DataDisks = dataDisks +} + +// GetRegionId returns path parameter 'regionId' if exist, +// otherwise return empty string +func (r CreateImageRequest) GetRegionId() string { + return r.RegionId +} + +type CreateImageResponse struct { + RequestID string `json:"requestId"` + Error core.ErrorResponse `json:"error"` + Result CreateImageResult `json:"result"` +} + +type CreateImageResult struct { + ImageId string `json:"imageId"` +} \ No newline at end of file diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/CreateInstances.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/CreateInstances.go new file mode 100644 index 000000000..f5d342dc0 --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/CreateInstances.go @@ -0,0 +1,148 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package apis + +import ( + "github.com/jdcloud-api/jdcloud-sdk-go/core" + vm "github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models" +) + +type CreateInstancesRequest struct { + + core.JDCloudRequest + + /* 地域ID */ + RegionId string `json:"regionId"` + + /* 描述云主机配置 + */ + InstanceSpec *vm.InstanceSpec `json:"instanceSpec"` + + /* 购买云主机的数量;取值范围:[1,100],默认为1。 + (Optional) */ + MaxCount *int `json:"maxCount"` + + /* 用于保证请求的幂等性。由客户端生成,长度不能超过64个字符。 + (Optional) */ + ClientToken *string `json:"clientToken"` +} + +/* + * param regionId: 地域ID (Required) + * param instanceSpec: 描述云主机配置 + (Required) + * + * @Deprecated, not compatible when mandatory parameters changed + */ +func NewCreateInstancesRequest( + regionId string, + instanceSpec *vm.InstanceSpec, +) *CreateInstancesRequest { + + return &CreateInstancesRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/instances", + Method: "POST", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + InstanceSpec: instanceSpec, + } +} + +/* + * param regionId: 地域ID (Required) + * param instanceSpec: 描述云主机配置 + (Required) + * param maxCount: 购买云主机的数量;取值范围:[1,100],默认为1。 + (Optional) + * param clientToken: 用于保证请求的幂等性。由客户端生成,长度不能超过64个字符。 + (Optional) + */ +func NewCreateInstancesRequestWithAllParams( + regionId string, + instanceSpec *vm.InstanceSpec, + maxCount *int, + clientToken *string, +) *CreateInstancesRequest { + + return &CreateInstancesRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/instances", + Method: "POST", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + InstanceSpec: instanceSpec, + MaxCount: maxCount, + ClientToken: clientToken, + } +} + +/* This constructor has better compatible ability when API parameters changed */ +func NewCreateInstancesRequestWithoutParam() *CreateInstancesRequest { + + return &CreateInstancesRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/instances", + Method: "POST", + Header: nil, + Version: "v1", + }, + } +} + +/* param regionId: 地域ID(Required) */ +func (r *CreateInstancesRequest) SetRegionId(regionId string) { + r.RegionId = regionId +} + +/* param instanceSpec: 描述云主机配置 +(Required) */ +func (r *CreateInstancesRequest) SetInstanceSpec(instanceSpec *vm.InstanceSpec) { + r.InstanceSpec = instanceSpec +} + +/* param maxCount: 购买云主机的数量;取值范围:[1,100],默认为1。 +(Optional) */ +func (r *CreateInstancesRequest) SetMaxCount(maxCount int) { + r.MaxCount = &maxCount +} + +/* param clientToken: 用于保证请求的幂等性。由客户端生成,长度不能超过64个字符。 +(Optional) */ +func (r *CreateInstancesRequest) SetClientToken(clientToken string) { + r.ClientToken = &clientToken +} + +// GetRegionId returns path parameter 'regionId' if exist, +// otherwise return empty string +func (r CreateInstancesRequest) GetRegionId() string { + return r.RegionId +} + +type CreateInstancesResponse struct { + RequestID string `json:"requestId"` + Error core.ErrorResponse `json:"error"` + Result CreateInstancesResult `json:"result"` +} + +type CreateInstancesResult struct { + InstanceIds []string `json:"instanceIds"` +} \ No newline at end of file diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/CreateKeypair.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/CreateKeypair.go new file mode 100644 index 000000000..6ffeee01c --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/CreateKeypair.go @@ -0,0 +1,121 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package apis + +import ( + "github.com/jdcloud-api/jdcloud-sdk-go/core" +) + +type CreateKeypairRequest struct { + + core.JDCloudRequest + + /* 地域ID */ + RegionId string `json:"regionId"` + + /* 密钥对名称,需要全局唯一。只允许数字、大小写字母、下划线“_”及中划线“-”,不超过32个字符。 + */ + KeyName string `json:"keyName"` +} + +/* + * param regionId: 地域ID (Required) + * param keyName: 密钥对名称,需要全局唯一。只允许数字、大小写字母、下划线“_”及中划线“-”,不超过32个字符。 + (Required) + * + * @Deprecated, not compatible when mandatory parameters changed + */ +func NewCreateKeypairRequest( + regionId string, + keyName string, +) *CreateKeypairRequest { + + return &CreateKeypairRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/keypairs", + Method: "POST", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + KeyName: keyName, + } +} + +/* + * param regionId: 地域ID (Required) + * param keyName: 密钥对名称,需要全局唯一。只允许数字、大小写字母、下划线“_”及中划线“-”,不超过32个字符。 + (Required) + */ +func NewCreateKeypairRequestWithAllParams( + regionId string, + keyName string, +) *CreateKeypairRequest { + + return &CreateKeypairRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/keypairs", + Method: "POST", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + KeyName: keyName, + } +} + +/* This constructor has better compatible ability when API parameters changed */ +func NewCreateKeypairRequestWithoutParam() *CreateKeypairRequest { + + return &CreateKeypairRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/keypairs", + Method: "POST", + Header: nil, + Version: "v1", + }, + } +} + +/* param regionId: 地域ID(Required) */ +func (r *CreateKeypairRequest) SetRegionId(regionId string) { + r.RegionId = regionId +} + +/* param keyName: 密钥对名称,需要全局唯一。只允许数字、大小写字母、下划线“_”及中划线“-”,不超过32个字符。 +(Required) */ +func (r *CreateKeypairRequest) SetKeyName(keyName string) { + r.KeyName = keyName +} + +// GetRegionId returns path parameter 'regionId' if exist, +// otherwise return empty string +func (r CreateKeypairRequest) GetRegionId() string { + return r.RegionId +} + +type CreateKeypairResponse struct { + RequestID string `json:"requestId"` + Error core.ErrorResponse `json:"error"` + Result CreateKeypairResult `json:"result"` +} + +type CreateKeypairResult struct { + KeyName string `json:"keyName"` + PrivateKey string `json:"privateKey"` + KeyFingerprint string `json:"keyFingerprint"` +} \ No newline at end of file diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/DeleteImage.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/DeleteImage.go new file mode 100644 index 000000000..3496eace4 --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/DeleteImage.go @@ -0,0 +1,114 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package apis + +import ( + "github.com/jdcloud-api/jdcloud-sdk-go/core" +) + +type DeleteImageRequest struct { + + core.JDCloudRequest + + /* 地域ID */ + RegionId string `json:"regionId"` + + /* 镜像ID */ + ImageId string `json:"imageId"` +} + +/* + * param regionId: 地域ID (Required) + * param imageId: 镜像ID (Required) + * + * @Deprecated, not compatible when mandatory parameters changed + */ +func NewDeleteImageRequest( + regionId string, + imageId string, +) *DeleteImageRequest { + + return &DeleteImageRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/images/{imageId}", + Method: "DELETE", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + ImageId: imageId, + } +} + +/* + * param regionId: 地域ID (Required) + * param imageId: 镜像ID (Required) + */ +func NewDeleteImageRequestWithAllParams( + regionId string, + imageId string, +) *DeleteImageRequest { + + return &DeleteImageRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/images/{imageId}", + Method: "DELETE", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + ImageId: imageId, + } +} + +/* This constructor has better compatible ability when API parameters changed */ +func NewDeleteImageRequestWithoutParam() *DeleteImageRequest { + + return &DeleteImageRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/images/{imageId}", + Method: "DELETE", + Header: nil, + Version: "v1", + }, + } +} + +/* param regionId: 地域ID(Required) */ +func (r *DeleteImageRequest) SetRegionId(regionId string) { + r.RegionId = regionId +} + +/* param imageId: 镜像ID(Required) */ +func (r *DeleteImageRequest) SetImageId(imageId string) { + r.ImageId = imageId +} + +// GetRegionId returns path parameter 'regionId' if exist, +// otherwise return empty string +func (r DeleteImageRequest) GetRegionId() string { + return r.RegionId +} + +type DeleteImageResponse struct { + RequestID string `json:"requestId"` + Error core.ErrorResponse `json:"error"` + Result DeleteImageResult `json:"result"` +} + +type DeleteImageResult struct { +} \ No newline at end of file diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/DeleteInstance.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/DeleteInstance.go new file mode 100644 index 000000000..6482ece51 --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/DeleteInstance.go @@ -0,0 +1,114 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package apis + +import ( + "github.com/jdcloud-api/jdcloud-sdk-go/core" +) + +type DeleteInstanceRequest struct { + + core.JDCloudRequest + + /* 地域ID */ + RegionId string `json:"regionId"` + + /* 云主机ID */ + InstanceId string `json:"instanceId"` +} + +/* + * param regionId: 地域ID (Required) + * param instanceId: 云主机ID (Required) + * + * @Deprecated, not compatible when mandatory parameters changed + */ +func NewDeleteInstanceRequest( + regionId string, + instanceId string, +) *DeleteInstanceRequest { + + return &DeleteInstanceRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/instances/{instanceId}", + Method: "DELETE", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + InstanceId: instanceId, + } +} + +/* + * param regionId: 地域ID (Required) + * param instanceId: 云主机ID (Required) + */ +func NewDeleteInstanceRequestWithAllParams( + regionId string, + instanceId string, +) *DeleteInstanceRequest { + + return &DeleteInstanceRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/instances/{instanceId}", + Method: "DELETE", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + InstanceId: instanceId, + } +} + +/* This constructor has better compatible ability when API parameters changed */ +func NewDeleteInstanceRequestWithoutParam() *DeleteInstanceRequest { + + return &DeleteInstanceRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/instances/{instanceId}", + Method: "DELETE", + Header: nil, + Version: "v1", + }, + } +} + +/* param regionId: 地域ID(Required) */ +func (r *DeleteInstanceRequest) SetRegionId(regionId string) { + r.RegionId = regionId +} + +/* param instanceId: 云主机ID(Required) */ +func (r *DeleteInstanceRequest) SetInstanceId(instanceId string) { + r.InstanceId = instanceId +} + +// GetRegionId returns path parameter 'regionId' if exist, +// otherwise return empty string +func (r DeleteInstanceRequest) GetRegionId() string { + return r.RegionId +} + +type DeleteInstanceResponse struct { + RequestID string `json:"requestId"` + Error core.ErrorResponse `json:"error"` + Result DeleteInstanceResult `json:"result"` +} + +type DeleteInstanceResult struct { +} \ No newline at end of file diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/DeleteKeypair.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/DeleteKeypair.go new file mode 100644 index 000000000..ddac09b04 --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/DeleteKeypair.go @@ -0,0 +1,114 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package apis + +import ( + "github.com/jdcloud-api/jdcloud-sdk-go/core" +) + +type DeleteKeypairRequest struct { + + core.JDCloudRequest + + /* 地域ID */ + RegionId string `json:"regionId"` + + /* 密钥名称 */ + KeyName string `json:"keyName"` +} + +/* + * param regionId: 地域ID (Required) + * param keyName: 密钥名称 (Required) + * + * @Deprecated, not compatible when mandatory parameters changed + */ +func NewDeleteKeypairRequest( + regionId string, + keyName string, +) *DeleteKeypairRequest { + + return &DeleteKeypairRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/keypairs/{keyName}", + Method: "DELETE", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + KeyName: keyName, + } +} + +/* + * param regionId: 地域ID (Required) + * param keyName: 密钥名称 (Required) + */ +func NewDeleteKeypairRequestWithAllParams( + regionId string, + keyName string, +) *DeleteKeypairRequest { + + return &DeleteKeypairRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/keypairs/{keyName}", + Method: "DELETE", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + KeyName: keyName, + } +} + +/* This constructor has better compatible ability when API parameters changed */ +func NewDeleteKeypairRequestWithoutParam() *DeleteKeypairRequest { + + return &DeleteKeypairRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/keypairs/{keyName}", + Method: "DELETE", + Header: nil, + Version: "v1", + }, + } +} + +/* param regionId: 地域ID(Required) */ +func (r *DeleteKeypairRequest) SetRegionId(regionId string) { + r.RegionId = regionId +} + +/* param keyName: 密钥名称(Required) */ +func (r *DeleteKeypairRequest) SetKeyName(keyName string) { + r.KeyName = keyName +} + +// GetRegionId returns path parameter 'regionId' if exist, +// otherwise return empty string +func (r DeleteKeypairRequest) GetRegionId() string { + return r.RegionId +} + +type DeleteKeypairResponse struct { + RequestID string `json:"requestId"` + Error core.ErrorResponse `json:"error"` + Result DeleteKeypairResult `json:"result"` +} + +type DeleteKeypairResult struct { +} \ No newline at end of file diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/DescribeImage.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/DescribeImage.go new file mode 100644 index 000000000..14b9b1709 --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/DescribeImage.go @@ -0,0 +1,116 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package apis + +import ( + "github.com/jdcloud-api/jdcloud-sdk-go/core" + vm "github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models" +) + +type DescribeImageRequest struct { + + core.JDCloudRequest + + /* 地域ID */ + RegionId string `json:"regionId"` + + /* 镜像ID */ + ImageId string `json:"imageId"` +} + +/* + * param regionId: 地域ID (Required) + * param imageId: 镜像ID (Required) + * + * @Deprecated, not compatible when mandatory parameters changed + */ +func NewDescribeImageRequest( + regionId string, + imageId string, +) *DescribeImageRequest { + + return &DescribeImageRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/images/{imageId}", + Method: "GET", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + ImageId: imageId, + } +} + +/* + * param regionId: 地域ID (Required) + * param imageId: 镜像ID (Required) + */ +func NewDescribeImageRequestWithAllParams( + regionId string, + imageId string, +) *DescribeImageRequest { + + return &DescribeImageRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/images/{imageId}", + Method: "GET", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + ImageId: imageId, + } +} + +/* This constructor has better compatible ability when API parameters changed */ +func NewDescribeImageRequestWithoutParam() *DescribeImageRequest { + + return &DescribeImageRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/images/{imageId}", + Method: "GET", + Header: nil, + Version: "v1", + }, + } +} + +/* param regionId: 地域ID(Required) */ +func (r *DescribeImageRequest) SetRegionId(regionId string) { + r.RegionId = regionId +} + +/* param imageId: 镜像ID(Required) */ +func (r *DescribeImageRequest) SetImageId(imageId string) { + r.ImageId = imageId +} + +// GetRegionId returns path parameter 'regionId' if exist, +// otherwise return empty string +func (r DescribeImageRequest) GetRegionId() string { + return r.RegionId +} + +type DescribeImageResponse struct { + RequestID string `json:"requestId"` + Error core.ErrorResponse `json:"error"` + Result DescribeImageResult `json:"result"` +} + +type DescribeImageResult struct { + Image vm.Image `json:"image"` +} \ No newline at end of file diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/DescribeImageConstraints.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/DescribeImageConstraints.go new file mode 100644 index 000000000..8011469e2 --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/DescribeImageConstraints.go @@ -0,0 +1,116 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package apis + +import ( + "github.com/jdcloud-api/jdcloud-sdk-go/core" + vm "github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models" +) + +type DescribeImageConstraintsRequest struct { + + core.JDCloudRequest + + /* 地域ID */ + RegionId string `json:"regionId"` + + /* 镜像ID */ + ImageId string `json:"imageId"` +} + +/* + * param regionId: 地域ID (Required) + * param imageId: 镜像ID (Required) + * + * @Deprecated, not compatible when mandatory parameters changed + */ +func NewDescribeImageConstraintsRequest( + regionId string, + imageId string, +) *DescribeImageConstraintsRequest { + + return &DescribeImageConstraintsRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/images/{imageId}/constraints", + Method: "GET", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + ImageId: imageId, + } +} + +/* + * param regionId: 地域ID (Required) + * param imageId: 镜像ID (Required) + */ +func NewDescribeImageConstraintsRequestWithAllParams( + regionId string, + imageId string, +) *DescribeImageConstraintsRequest { + + return &DescribeImageConstraintsRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/images/{imageId}/constraints", + Method: "GET", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + ImageId: imageId, + } +} + +/* This constructor has better compatible ability when API parameters changed */ +func NewDescribeImageConstraintsRequestWithoutParam() *DescribeImageConstraintsRequest { + + return &DescribeImageConstraintsRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/images/{imageId}/constraints", + Method: "GET", + Header: nil, + Version: "v1", + }, + } +} + +/* param regionId: 地域ID(Required) */ +func (r *DescribeImageConstraintsRequest) SetRegionId(regionId string) { + r.RegionId = regionId +} + +/* param imageId: 镜像ID(Required) */ +func (r *DescribeImageConstraintsRequest) SetImageId(imageId string) { + r.ImageId = imageId +} + +// GetRegionId returns path parameter 'regionId' if exist, +// otherwise return empty string +func (r DescribeImageConstraintsRequest) GetRegionId() string { + return r.RegionId +} + +type DescribeImageConstraintsResponse struct { + RequestID string `json:"requestId"` + Error core.ErrorResponse `json:"error"` + Result DescribeImageConstraintsResult `json:"result"` +} + +type DescribeImageConstraintsResult struct { + ImageConstraints vm.ImageConstraint `json:"imageConstraints"` +} \ No newline at end of file diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/DescribeImageConstraintsBatch.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/DescribeImageConstraintsBatch.go new file mode 100644 index 000000000..f0a968cc1 --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/DescribeImageConstraintsBatch.go @@ -0,0 +1,113 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package apis + +import ( + "github.com/jdcloud-api/jdcloud-sdk-go/core" + vm "github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models" +) + +type DescribeImageConstraintsBatchRequest struct { + + core.JDCloudRequest + + /* 地域ID */ + RegionId string `json:"regionId"` + + /* 镜像ID列表 (Optional) */ + Ids []string `json:"ids"` +} + +/* + * param regionId: 地域ID (Required) + * + * @Deprecated, not compatible when mandatory parameters changed + */ +func NewDescribeImageConstraintsBatchRequest( + regionId string, +) *DescribeImageConstraintsBatchRequest { + + return &DescribeImageConstraintsBatchRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/imageConstraints", + Method: "GET", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + } +} + +/* + * param regionId: 地域ID (Required) + * param ids: 镜像ID列表 (Optional) + */ +func NewDescribeImageConstraintsBatchRequestWithAllParams( + regionId string, + ids []string, +) *DescribeImageConstraintsBatchRequest { + + return &DescribeImageConstraintsBatchRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/imageConstraints", + Method: "GET", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + Ids: ids, + } +} + +/* This constructor has better compatible ability when API parameters changed */ +func NewDescribeImageConstraintsBatchRequestWithoutParam() *DescribeImageConstraintsBatchRequest { + + return &DescribeImageConstraintsBatchRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/imageConstraints", + Method: "GET", + Header: nil, + Version: "v1", + }, + } +} + +/* param regionId: 地域ID(Required) */ +func (r *DescribeImageConstraintsBatchRequest) SetRegionId(regionId string) { + r.RegionId = regionId +} + +/* param ids: 镜像ID列表(Optional) */ +func (r *DescribeImageConstraintsBatchRequest) SetIds(ids []string) { + r.Ids = ids +} + +// GetRegionId returns path parameter 'regionId' if exist, +// otherwise return empty string +func (r DescribeImageConstraintsBatchRequest) GetRegionId() string { + return r.RegionId +} + +type DescribeImageConstraintsBatchResponse struct { + RequestID string `json:"requestId"` + Error core.ErrorResponse `json:"error"` + Result DescribeImageConstraintsBatchResult `json:"result"` +} + +type DescribeImageConstraintsBatchResult struct { + ImageConstraints []vm.ImageConstraint `json:"imageConstraints"` +} \ No newline at end of file diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/DescribeImageMembers.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/DescribeImageMembers.go new file mode 100644 index 000000000..b4374fad7 --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/DescribeImageMembers.go @@ -0,0 +1,115 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package apis + +import ( + "github.com/jdcloud-api/jdcloud-sdk-go/core" +) + +type DescribeImageMembersRequest struct { + + core.JDCloudRequest + + /* 地域ID */ + RegionId string `json:"regionId"` + + /* 镜像ID */ + ImageId string `json:"imageId"` +} + +/* + * param regionId: 地域ID (Required) + * param imageId: 镜像ID (Required) + * + * @Deprecated, not compatible when mandatory parameters changed + */ +func NewDescribeImageMembersRequest( + regionId string, + imageId string, +) *DescribeImageMembersRequest { + + return &DescribeImageMembersRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/images/{imageId}/members", + Method: "GET", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + ImageId: imageId, + } +} + +/* + * param regionId: 地域ID (Required) + * param imageId: 镜像ID (Required) + */ +func NewDescribeImageMembersRequestWithAllParams( + regionId string, + imageId string, +) *DescribeImageMembersRequest { + + return &DescribeImageMembersRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/images/{imageId}/members", + Method: "GET", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + ImageId: imageId, + } +} + +/* This constructor has better compatible ability when API parameters changed */ +func NewDescribeImageMembersRequestWithoutParam() *DescribeImageMembersRequest { + + return &DescribeImageMembersRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/images/{imageId}/members", + Method: "GET", + Header: nil, + Version: "v1", + }, + } +} + +/* param regionId: 地域ID(Required) */ +func (r *DescribeImageMembersRequest) SetRegionId(regionId string) { + r.RegionId = regionId +} + +/* param imageId: 镜像ID(Required) */ +func (r *DescribeImageMembersRequest) SetImageId(imageId string) { + r.ImageId = imageId +} + +// GetRegionId returns path parameter 'regionId' if exist, +// otherwise return empty string +func (r DescribeImageMembersRequest) GetRegionId() string { + return r.RegionId +} + +type DescribeImageMembersResponse struct { + RequestID string `json:"requestId"` + Error core.ErrorResponse `json:"error"` + Result DescribeImageMembersResult `json:"result"` +} + +type DescribeImageMembersResult struct { + Pins []string `json:"pins"` +} \ No newline at end of file diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/DescribeImages.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/DescribeImages.go new file mode 100644 index 000000000..01e89cf65 --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/DescribeImages.go @@ -0,0 +1,180 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package apis + +import ( + "github.com/jdcloud-api/jdcloud-sdk-go/core" + vm "github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models" +) + +type DescribeImagesRequest struct { + + core.JDCloudRequest + + /* 地域ID */ + RegionId string `json:"regionId"` + + /* 镜像来源,如果没有指定ids参数,此参数必传;取值范围:public、shared、thirdparty、private (Optional) */ + ImageSource *string `json:"imageSource"` + + /* 操作系统平台,取值范围:Windows Server、CentOS、Ubuntu (Optional) */ + Platform *string `json:"platform"` + + /* 镜像ID列表,如果指定了此参数,其它参数可为空 (Optional) */ + Ids []string `json:"ids"` + + /* 镜像支持的系统盘类型,[localDisk,cloudDisk] (Optional) */ + RootDeviceType *string `json:"rootDeviceType"` + + /* 参考镜像状态 (Optional) */ + Status *string `json:"status"` + + /* 页码;默认为1 (Optional) */ + PageNumber *int `json:"pageNumber"` + + /* 分页大小;默认为20;取值范围[10, 100] (Optional) */ + PageSize *int `json:"pageSize"` +} + +/* + * param regionId: 地域ID (Required) + * + * @Deprecated, not compatible when mandatory parameters changed + */ +func NewDescribeImagesRequest( + regionId string, +) *DescribeImagesRequest { + + return &DescribeImagesRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/images", + Method: "GET", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + } +} + +/* + * param regionId: 地域ID (Required) + * param imageSource: 镜像来源,如果没有指定ids参数,此参数必传;取值范围:public、shared、thirdparty、private (Optional) + * param platform: 操作系统平台,取值范围:Windows Server、CentOS、Ubuntu (Optional) + * param ids: 镜像ID列表,如果指定了此参数,其它参数可为空 (Optional) + * param rootDeviceType: 镜像支持的系统盘类型,[localDisk,cloudDisk] (Optional) + * param status: 参考镜像状态 (Optional) + * param pageNumber: 页码;默认为1 (Optional) + * param pageSize: 分页大小;默认为20;取值范围[10, 100] (Optional) + */ +func NewDescribeImagesRequestWithAllParams( + regionId string, + imageSource *string, + platform *string, + ids []string, + rootDeviceType *string, + status *string, + pageNumber *int, + pageSize *int, +) *DescribeImagesRequest { + + return &DescribeImagesRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/images", + Method: "GET", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + ImageSource: imageSource, + Platform: platform, + Ids: ids, + RootDeviceType: rootDeviceType, + Status: status, + PageNumber: pageNumber, + PageSize: pageSize, + } +} + +/* This constructor has better compatible ability when API parameters changed */ +func NewDescribeImagesRequestWithoutParam() *DescribeImagesRequest { + + return &DescribeImagesRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/images", + Method: "GET", + Header: nil, + Version: "v1", + }, + } +} + +/* param regionId: 地域ID(Required) */ +func (r *DescribeImagesRequest) SetRegionId(regionId string) { + r.RegionId = regionId +} + +/* param imageSource: 镜像来源,如果没有指定ids参数,此参数必传;取值范围:public、shared、thirdparty、private(Optional) */ +func (r *DescribeImagesRequest) SetImageSource(imageSource string) { + r.ImageSource = &imageSource +} + +/* param platform: 操作系统平台,取值范围:Windows Server、CentOS、Ubuntu(Optional) */ +func (r *DescribeImagesRequest) SetPlatform(platform string) { + r.Platform = &platform +} + +/* param ids: 镜像ID列表,如果指定了此参数,其它参数可为空(Optional) */ +func (r *DescribeImagesRequest) SetIds(ids []string) { + r.Ids = ids +} + +/* param rootDeviceType: 镜像支持的系统盘类型,[localDisk,cloudDisk](Optional) */ +func (r *DescribeImagesRequest) SetRootDeviceType(rootDeviceType string) { + r.RootDeviceType = &rootDeviceType +} + +/* param status: 参考镜像状态(Optional) */ +func (r *DescribeImagesRequest) SetStatus(status string) { + r.Status = &status +} + +/* param pageNumber: 页码;默认为1(Optional) */ +func (r *DescribeImagesRequest) SetPageNumber(pageNumber int) { + r.PageNumber = &pageNumber +} + +/* param pageSize: 分页大小;默认为20;取值范围[10, 100](Optional) */ +func (r *DescribeImagesRequest) SetPageSize(pageSize int) { + r.PageSize = &pageSize +} + +// GetRegionId returns path parameter 'regionId' if exist, +// otherwise return empty string +func (r DescribeImagesRequest) GetRegionId() string { + return r.RegionId +} + +type DescribeImagesResponse struct { + RequestID string `json:"requestId"` + Error core.ErrorResponse `json:"error"` + Result DescribeImagesResult `json:"result"` +} + +type DescribeImagesResult struct { + Images []vm.Image `json:"images"` + TotalCount int `json:"totalCount"` +} \ No newline at end of file diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/DescribeInstance.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/DescribeInstance.go new file mode 100644 index 000000000..84eb194e0 --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/DescribeInstance.go @@ -0,0 +1,116 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package apis + +import ( + "github.com/jdcloud-api/jdcloud-sdk-go/core" + vm "github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models" +) + +type DescribeInstanceRequest struct { + + core.JDCloudRequest + + /* 地域ID */ + RegionId string `json:"regionId"` + + /* 云主机ID */ + InstanceId string `json:"instanceId"` +} + +/* + * param regionId: 地域ID (Required) + * param instanceId: 云主机ID (Required) + * + * @Deprecated, not compatible when mandatory parameters changed + */ +func NewDescribeInstanceRequest( + regionId string, + instanceId string, +) *DescribeInstanceRequest { + + return &DescribeInstanceRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/instances/{instanceId}", + Method: "GET", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + InstanceId: instanceId, + } +} + +/* + * param regionId: 地域ID (Required) + * param instanceId: 云主机ID (Required) + */ +func NewDescribeInstanceRequestWithAllParams( + regionId string, + instanceId string, +) *DescribeInstanceRequest { + + return &DescribeInstanceRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/instances/{instanceId}", + Method: "GET", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + InstanceId: instanceId, + } +} + +/* This constructor has better compatible ability when API parameters changed */ +func NewDescribeInstanceRequestWithoutParam() *DescribeInstanceRequest { + + return &DescribeInstanceRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/instances/{instanceId}", + Method: "GET", + Header: nil, + Version: "v1", + }, + } +} + +/* param regionId: 地域ID(Required) */ +func (r *DescribeInstanceRequest) SetRegionId(regionId string) { + r.RegionId = regionId +} + +/* param instanceId: 云主机ID(Required) */ +func (r *DescribeInstanceRequest) SetInstanceId(instanceId string) { + r.InstanceId = instanceId +} + +// GetRegionId returns path parameter 'regionId' if exist, +// otherwise return empty string +func (r DescribeInstanceRequest) GetRegionId() string { + return r.RegionId +} + +type DescribeInstanceResponse struct { + RequestID string `json:"requestId"` + Error core.ErrorResponse `json:"error"` + Result DescribeInstanceResult `json:"result"` +} + +type DescribeInstanceResult struct { + Instance vm.Instance `json:"instance"` +} \ No newline at end of file diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/DescribeInstancePrivateIpAddress.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/DescribeInstancePrivateIpAddress.go new file mode 100644 index 000000000..457d57089 --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/DescribeInstancePrivateIpAddress.go @@ -0,0 +1,161 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package apis + +import ( + "github.com/jdcloud-api/jdcloud-sdk-go/core" + vm "github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models" + common "github.com/jdcloud-api/jdcloud-sdk-go/services/common/models" +) + +type DescribeInstancePrivateIpAddressRequest struct { + + core.JDCloudRequest + + /* 地域ID */ + RegionId string `json:"regionId"` + + /* 页码;默认为1 (Optional) */ + PageNumber *int `json:"pageNumber"` + + /* 分页大小;默认为20;取值范围[10, 100] (Optional) */ + PageSize *int `json:"pageSize"` + + /* instanceId - 云主机ID,精确匹配,支持多个 +privateIpAddress - 主网卡内网主IP地址,模糊匹配,支持多个 +vpcId - 私有网络ID,精确匹配,支持多个 +status - 云主机状态,精确匹配,支持多个,参考云主机状态 +name - 云主机名称,模糊匹配,支持单个 +imageId - 镜像ID,精确匹配,支持多个 +networkInterfaceId - 弹性网卡ID,精确匹配,支持多个 +subnetId - 子网ID,精确匹配,支持多个 + (Optional) */ + Filters []common.Filter `json:"filters"` +} + +/* + * param regionId: 地域ID (Required) + * + * @Deprecated, not compatible when mandatory parameters changed + */ +func NewDescribeInstancePrivateIpAddressRequest( + regionId string, +) *DescribeInstancePrivateIpAddressRequest { + + return &DescribeInstancePrivateIpAddressRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/instancePrivateIpAddress", + Method: "GET", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + } +} + +/* + * param regionId: 地域ID (Required) + * param pageNumber: 页码;默认为1 (Optional) + * param pageSize: 分页大小;默认为20;取值范围[10, 100] (Optional) + * param filters: instanceId - 云主机ID,精确匹配,支持多个 +privateIpAddress - 主网卡内网主IP地址,模糊匹配,支持多个 +vpcId - 私有网络ID,精确匹配,支持多个 +status - 云主机状态,精确匹配,支持多个,参考云主机状态 +name - 云主机名称,模糊匹配,支持单个 +imageId - 镜像ID,精确匹配,支持多个 +networkInterfaceId - 弹性网卡ID,精确匹配,支持多个 +subnetId - 子网ID,精确匹配,支持多个 + (Optional) + */ +func NewDescribeInstancePrivateIpAddressRequestWithAllParams( + regionId string, + pageNumber *int, + pageSize *int, + filters []common.Filter, +) *DescribeInstancePrivateIpAddressRequest { + + return &DescribeInstancePrivateIpAddressRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/instancePrivateIpAddress", + Method: "GET", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + PageNumber: pageNumber, + PageSize: pageSize, + Filters: filters, + } +} + +/* This constructor has better compatible ability when API parameters changed */ +func NewDescribeInstancePrivateIpAddressRequestWithoutParam() *DescribeInstancePrivateIpAddressRequest { + + return &DescribeInstancePrivateIpAddressRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/instancePrivateIpAddress", + Method: "GET", + Header: nil, + Version: "v1", + }, + } +} + +/* param regionId: 地域ID(Required) */ +func (r *DescribeInstancePrivateIpAddressRequest) SetRegionId(regionId string) { + r.RegionId = regionId +} + +/* param pageNumber: 页码;默认为1(Optional) */ +func (r *DescribeInstancePrivateIpAddressRequest) SetPageNumber(pageNumber int) { + r.PageNumber = &pageNumber +} + +/* param pageSize: 分页大小;默认为20;取值范围[10, 100](Optional) */ +func (r *DescribeInstancePrivateIpAddressRequest) SetPageSize(pageSize int) { + r.PageSize = &pageSize +} + +/* param filters: instanceId - 云主机ID,精确匹配,支持多个 +privateIpAddress - 主网卡内网主IP地址,模糊匹配,支持多个 +vpcId - 私有网络ID,精确匹配,支持多个 +status - 云主机状态,精确匹配,支持多个,参考云主机状态 +name - 云主机名称,模糊匹配,支持单个 +imageId - 镜像ID,精确匹配,支持多个 +networkInterfaceId - 弹性网卡ID,精确匹配,支持多个 +subnetId - 子网ID,精确匹配,支持多个 +(Optional) */ +func (r *DescribeInstancePrivateIpAddressRequest) SetFilters(filters []common.Filter) { + r.Filters = filters +} + +// GetRegionId returns path parameter 'regionId' if exist, +// otherwise return empty string +func (r DescribeInstancePrivateIpAddressRequest) GetRegionId() string { + return r.RegionId +} + +type DescribeInstancePrivateIpAddressResponse struct { + RequestID string `json:"requestId"` + Error core.ErrorResponse `json:"error"` + Result DescribeInstancePrivateIpAddressResult `json:"result"` +} + +type DescribeInstancePrivateIpAddressResult struct { + InstancePrivateIpAddress []vm.InstancePrivateIpAddress `json:"instancePrivateIpAddress"` + TotalCount int `json:"totalCount"` +} \ No newline at end of file diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/DescribeInstanceStatus.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/DescribeInstanceStatus.go new file mode 100644 index 000000000..2dbeb035a --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/DescribeInstanceStatus.go @@ -0,0 +1,161 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package apis + +import ( + "github.com/jdcloud-api/jdcloud-sdk-go/core" + vm "github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models" + common "github.com/jdcloud-api/jdcloud-sdk-go/services/common/models" +) + +type DescribeInstanceStatusRequest struct { + + core.JDCloudRequest + + /* 地域ID */ + RegionId string `json:"regionId"` + + /* 页码;默认为1 (Optional) */ + PageNumber *int `json:"pageNumber"` + + /* 分页大小;默认为20;取值范围[10, 100] (Optional) */ + PageSize *int `json:"pageSize"` + + /* instanceId - 云主机ID,精确匹配,支持多个 +privateIpAddress - 主网卡内网主IP地址,模糊匹配,支持多个 +vpcId - 私有网络ID,精确匹配,支持多个 +status - 云主机状态,精确匹配,支持多个,参考云主机状态 +name - 云主机名称,模糊匹配,支持单个 +imageId - 镜像ID,精确匹配,支持多个 +networkInterfaceId - 弹性网卡ID,精确匹配,支持多个 +subnetId - 子网ID,精确匹配,支持多个 + (Optional) */ + Filters []common.Filter `json:"filters"` +} + +/* + * param regionId: 地域ID (Required) + * + * @Deprecated, not compatible when mandatory parameters changed + */ +func NewDescribeInstanceStatusRequest( + regionId string, +) *DescribeInstanceStatusRequest { + + return &DescribeInstanceStatusRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/instanceStatus", + Method: "GET", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + } +} + +/* + * param regionId: 地域ID (Required) + * param pageNumber: 页码;默认为1 (Optional) + * param pageSize: 分页大小;默认为20;取值范围[10, 100] (Optional) + * param filters: instanceId - 云主机ID,精确匹配,支持多个 +privateIpAddress - 主网卡内网主IP地址,模糊匹配,支持多个 +vpcId - 私有网络ID,精确匹配,支持多个 +status - 云主机状态,精确匹配,支持多个,参考云主机状态 +name - 云主机名称,模糊匹配,支持单个 +imageId - 镜像ID,精确匹配,支持多个 +networkInterfaceId - 弹性网卡ID,精确匹配,支持多个 +subnetId - 子网ID,精确匹配,支持多个 + (Optional) + */ +func NewDescribeInstanceStatusRequestWithAllParams( + regionId string, + pageNumber *int, + pageSize *int, + filters []common.Filter, +) *DescribeInstanceStatusRequest { + + return &DescribeInstanceStatusRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/instanceStatus", + Method: "GET", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + PageNumber: pageNumber, + PageSize: pageSize, + Filters: filters, + } +} + +/* This constructor has better compatible ability when API parameters changed */ +func NewDescribeInstanceStatusRequestWithoutParam() *DescribeInstanceStatusRequest { + + return &DescribeInstanceStatusRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/instanceStatus", + Method: "GET", + Header: nil, + Version: "v1", + }, + } +} + +/* param regionId: 地域ID(Required) */ +func (r *DescribeInstanceStatusRequest) SetRegionId(regionId string) { + r.RegionId = regionId +} + +/* param pageNumber: 页码;默认为1(Optional) */ +func (r *DescribeInstanceStatusRequest) SetPageNumber(pageNumber int) { + r.PageNumber = &pageNumber +} + +/* param pageSize: 分页大小;默认为20;取值范围[10, 100](Optional) */ +func (r *DescribeInstanceStatusRequest) SetPageSize(pageSize int) { + r.PageSize = &pageSize +} + +/* param filters: instanceId - 云主机ID,精确匹配,支持多个 +privateIpAddress - 主网卡内网主IP地址,模糊匹配,支持多个 +vpcId - 私有网络ID,精确匹配,支持多个 +status - 云主机状态,精确匹配,支持多个,参考云主机状态 +name - 云主机名称,模糊匹配,支持单个 +imageId - 镜像ID,精确匹配,支持多个 +networkInterfaceId - 弹性网卡ID,精确匹配,支持多个 +subnetId - 子网ID,精确匹配,支持多个 +(Optional) */ +func (r *DescribeInstanceStatusRequest) SetFilters(filters []common.Filter) { + r.Filters = filters +} + +// GetRegionId returns path parameter 'regionId' if exist, +// otherwise return empty string +func (r DescribeInstanceStatusRequest) GetRegionId() string { + return r.RegionId +} + +type DescribeInstanceStatusResponse struct { + RequestID string `json:"requestId"` + Error core.ErrorResponse `json:"error"` + Result DescribeInstanceStatusResult `json:"result"` +} + +type DescribeInstanceStatusResult struct { + InstanceStatuses []vm.InstanceStatus `json:"instanceStatuses"` + TotalCount int `json:"totalCount"` +} \ No newline at end of file diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/DescribeInstanceTypes.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/DescribeInstanceTypes.go new file mode 100644 index 000000000..6ff9017ff --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/DescribeInstanceTypes.go @@ -0,0 +1,122 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package apis + +import ( + "github.com/jdcloud-api/jdcloud-sdk-go/core" + vm "github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models" + common "github.com/jdcloud-api/jdcloud-sdk-go/services/common/models" +) + +type DescribeInstanceTypesRequest struct { + + core.JDCloudRequest + + /* 地域ID */ + RegionId string `json:"regionId"` + + /* instanceTypes - 实例规格,精确匹配,支持多个 +az - 可用区,精确匹配,支持多个 + (Optional) */ + Filters []common.Filter `json:"filters"` +} + +/* + * param regionId: 地域ID (Required) + * + * @Deprecated, not compatible when mandatory parameters changed + */ +func NewDescribeInstanceTypesRequest( + regionId string, +) *DescribeInstanceTypesRequest { + + return &DescribeInstanceTypesRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/instanceTypes", + Method: "GET", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + } +} + +/* + * param regionId: 地域ID (Required) + * param filters: instanceTypes - 实例规格,精确匹配,支持多个 +az - 可用区,精确匹配,支持多个 + (Optional) + */ +func NewDescribeInstanceTypesRequestWithAllParams( + regionId string, + filters []common.Filter, +) *DescribeInstanceTypesRequest { + + return &DescribeInstanceTypesRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/instanceTypes", + Method: "GET", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + Filters: filters, + } +} + +/* This constructor has better compatible ability when API parameters changed */ +func NewDescribeInstanceTypesRequestWithoutParam() *DescribeInstanceTypesRequest { + + return &DescribeInstanceTypesRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/instanceTypes", + Method: "GET", + Header: nil, + Version: "v1", + }, + } +} + +/* param regionId: 地域ID(Required) */ +func (r *DescribeInstanceTypesRequest) SetRegionId(regionId string) { + r.RegionId = regionId +} + +/* param filters: instanceTypes - 实例规格,精确匹配,支持多个 +az - 可用区,精确匹配,支持多个 +(Optional) */ +func (r *DescribeInstanceTypesRequest) SetFilters(filters []common.Filter) { + r.Filters = filters +} + +// GetRegionId returns path parameter 'regionId' if exist, +// otherwise return empty string +func (r DescribeInstanceTypesRequest) GetRegionId() string { + return r.RegionId +} + +type DescribeInstanceTypesResponse struct { + RequestID string `json:"requestId"` + Error core.ErrorResponse `json:"error"` + Result DescribeInstanceTypesResult `json:"result"` +} + +type DescribeInstanceTypesResult struct { + InstanceTypes []vm.InstanceType `json:"instanceTypes"` + SpecificInstanceTypes []vm.InstanceType `json:"specificInstanceTypes"` + TotalCount int `json:"totalCount"` +} \ No newline at end of file diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/DescribeInstanceVncUrl.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/DescribeInstanceVncUrl.go new file mode 100644 index 000000000..3026725f6 --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/DescribeInstanceVncUrl.go @@ -0,0 +1,115 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package apis + +import ( + "github.com/jdcloud-api/jdcloud-sdk-go/core" +) + +type DescribeInstanceVncUrlRequest struct { + + core.JDCloudRequest + + /* 地域ID */ + RegionId string `json:"regionId"` + + /* 云主机ID */ + InstanceId string `json:"instanceId"` +} + +/* + * param regionId: 地域ID (Required) + * param instanceId: 云主机ID (Required) + * + * @Deprecated, not compatible when mandatory parameters changed + */ +func NewDescribeInstanceVncUrlRequest( + regionId string, + instanceId string, +) *DescribeInstanceVncUrlRequest { + + return &DescribeInstanceVncUrlRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/instances/{instanceId}/vnc", + Method: "GET", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + InstanceId: instanceId, + } +} + +/* + * param regionId: 地域ID (Required) + * param instanceId: 云主机ID (Required) + */ +func NewDescribeInstanceVncUrlRequestWithAllParams( + regionId string, + instanceId string, +) *DescribeInstanceVncUrlRequest { + + return &DescribeInstanceVncUrlRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/instances/{instanceId}/vnc", + Method: "GET", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + InstanceId: instanceId, + } +} + +/* This constructor has better compatible ability when API parameters changed */ +func NewDescribeInstanceVncUrlRequestWithoutParam() *DescribeInstanceVncUrlRequest { + + return &DescribeInstanceVncUrlRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/instances/{instanceId}/vnc", + Method: "GET", + Header: nil, + Version: "v1", + }, + } +} + +/* param regionId: 地域ID(Required) */ +func (r *DescribeInstanceVncUrlRequest) SetRegionId(regionId string) { + r.RegionId = regionId +} + +/* param instanceId: 云主机ID(Required) */ +func (r *DescribeInstanceVncUrlRequest) SetInstanceId(instanceId string) { + r.InstanceId = instanceId +} + +// GetRegionId returns path parameter 'regionId' if exist, +// otherwise return empty string +func (r DescribeInstanceVncUrlRequest) GetRegionId() string { + return r.RegionId +} + +type DescribeInstanceVncUrlResponse struct { + RequestID string `json:"requestId"` + Error core.ErrorResponse `json:"error"` + Result DescribeInstanceVncUrlResult `json:"result"` +} + +type DescribeInstanceVncUrlResult struct { + VncUrl string `json:"vncUrl"` +} \ No newline at end of file diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/DescribeInstances.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/DescribeInstances.go new file mode 100644 index 000000000..a1330c290 --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/DescribeInstances.go @@ -0,0 +1,170 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package apis + +import ( + "github.com/jdcloud-api/jdcloud-sdk-go/core" + vm "github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models" + common "github.com/jdcloud-api/jdcloud-sdk-go/services/common/models" +) + +type DescribeInstancesRequest struct { + + core.JDCloudRequest + + /* 地域ID */ + RegionId string `json:"regionId"` + + /* 页码;默认为1 (Optional) */ + PageNumber *int `json:"pageNumber"` + + /* 分页大小;默认为20;取值范围[10, 100] (Optional) */ + PageSize *int `json:"pageSize"` + + /* instanceId - 云主机ID,精确匹配,支持多个 +privateIpAddress - 主网卡内网主IP地址,模糊匹配,支持多个 +az - 可用区,精确匹配,支持多个 +vpcId - 私有网络ID,精确匹配,支持多个 +status - 云主机状态,精确匹配,支持多个,参考云主机状态 +name - 云主机名称,模糊匹配,支持单个 +imageId - 镜像ID,精确匹配,支持多个 +networkInterfaceId - 弹性网卡ID,精确匹配,支持多个 +subnetId - 子网ID,精确匹配,支持多个 +agId - 使用可用组id,支持单个 +faultDomain - 错误域,支持多个 + (Optional) */ + Filters []common.Filter `json:"filters"` +} + +/* + * param regionId: 地域ID (Required) + * + * @Deprecated, not compatible when mandatory parameters changed + */ +func NewDescribeInstancesRequest( + regionId string, +) *DescribeInstancesRequest { + + return &DescribeInstancesRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/instances", + Method: "GET", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + } +} + +/* + * param regionId: 地域ID (Required) + * param pageNumber: 页码;默认为1 (Optional) + * param pageSize: 分页大小;默认为20;取值范围[10, 100] (Optional) + * param filters: instanceId - 云主机ID,精确匹配,支持多个 +privateIpAddress - 主网卡内网主IP地址,模糊匹配,支持多个 +az - 可用区,精确匹配,支持多个 +vpcId - 私有网络ID,精确匹配,支持多个 +status - 云主机状态,精确匹配,支持多个,参考云主机状态 +name - 云主机名称,模糊匹配,支持单个 +imageId - 镜像ID,精确匹配,支持多个 +networkInterfaceId - 弹性网卡ID,精确匹配,支持多个 +subnetId - 子网ID,精确匹配,支持多个 +agId - 使用可用组id,支持单个 +faultDomain - 错误域,支持多个 + (Optional) + */ +func NewDescribeInstancesRequestWithAllParams( + regionId string, + pageNumber *int, + pageSize *int, + filters []common.Filter, +) *DescribeInstancesRequest { + + return &DescribeInstancesRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/instances", + Method: "GET", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + PageNumber: pageNumber, + PageSize: pageSize, + Filters: filters, + } +} + +/* This constructor has better compatible ability when API parameters changed */ +func NewDescribeInstancesRequestWithoutParam() *DescribeInstancesRequest { + + return &DescribeInstancesRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/instances", + Method: "GET", + Header: nil, + Version: "v1", + }, + } +} + +/* param regionId: 地域ID(Required) */ +func (r *DescribeInstancesRequest) SetRegionId(regionId string) { + r.RegionId = regionId +} + +/* param pageNumber: 页码;默认为1(Optional) */ +func (r *DescribeInstancesRequest) SetPageNumber(pageNumber int) { + r.PageNumber = &pageNumber +} + +/* param pageSize: 分页大小;默认为20;取值范围[10, 100](Optional) */ +func (r *DescribeInstancesRequest) SetPageSize(pageSize int) { + r.PageSize = &pageSize +} + +/* param filters: instanceId - 云主机ID,精确匹配,支持多个 +privateIpAddress - 主网卡内网主IP地址,模糊匹配,支持多个 +az - 可用区,精确匹配,支持多个 +vpcId - 私有网络ID,精确匹配,支持多个 +status - 云主机状态,精确匹配,支持多个,参考云主机状态 +name - 云主机名称,模糊匹配,支持单个 +imageId - 镜像ID,精确匹配,支持多个 +networkInterfaceId - 弹性网卡ID,精确匹配,支持多个 +subnetId - 子网ID,精确匹配,支持多个 +agId - 使用可用组id,支持单个 +faultDomain - 错误域,支持多个 +(Optional) */ +func (r *DescribeInstancesRequest) SetFilters(filters []common.Filter) { + r.Filters = filters +} + +// GetRegionId returns path parameter 'regionId' if exist, +// otherwise return empty string +func (r DescribeInstancesRequest) GetRegionId() string { + return r.RegionId +} + +type DescribeInstancesResponse struct { + RequestID string `json:"requestId"` + Error core.ErrorResponse `json:"error"` + Result DescribeInstancesResult `json:"result"` +} + +type DescribeInstancesResult struct { + Instances []vm.Instance `json:"instances"` + TotalCount int `json:"totalCount"` +} \ No newline at end of file diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/DescribeKeypairs.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/DescribeKeypairs.go new file mode 100644 index 000000000..75b6c5c53 --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/DescribeKeypairs.go @@ -0,0 +1,140 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package apis + +import ( + "github.com/jdcloud-api/jdcloud-sdk-go/core" + vm "github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models" + common "github.com/jdcloud-api/jdcloud-sdk-go/services/common/models" +) + +type DescribeKeypairsRequest struct { + + core.JDCloudRequest + + /* 地域ID */ + RegionId string `json:"regionId"` + + /* 页码;默认为1 (Optional) */ + PageNumber *int `json:"pageNumber"` + + /* 分页大小;默认为20;取值范围[10, 100] (Optional) */ + PageSize *int `json:"pageSize"` + + /* keyNames - 密钥对名称,精确匹配,支持多个 + (Optional) */ + Filters []common.Filter `json:"filters"` +} + +/* + * param regionId: 地域ID (Required) + * + * @Deprecated, not compatible when mandatory parameters changed + */ +func NewDescribeKeypairsRequest( + regionId string, +) *DescribeKeypairsRequest { + + return &DescribeKeypairsRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/keypairs", + Method: "GET", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + } +} + +/* + * param regionId: 地域ID (Required) + * param pageNumber: 页码;默认为1 (Optional) + * param pageSize: 分页大小;默认为20;取值范围[10, 100] (Optional) + * param filters: keyNames - 密钥对名称,精确匹配,支持多个 + (Optional) + */ +func NewDescribeKeypairsRequestWithAllParams( + regionId string, + pageNumber *int, + pageSize *int, + filters []common.Filter, +) *DescribeKeypairsRequest { + + return &DescribeKeypairsRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/keypairs", + Method: "GET", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + PageNumber: pageNumber, + PageSize: pageSize, + Filters: filters, + } +} + +/* This constructor has better compatible ability when API parameters changed */ +func NewDescribeKeypairsRequestWithoutParam() *DescribeKeypairsRequest { + + return &DescribeKeypairsRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/keypairs", + Method: "GET", + Header: nil, + Version: "v1", + }, + } +} + +/* param regionId: 地域ID(Required) */ +func (r *DescribeKeypairsRequest) SetRegionId(regionId string) { + r.RegionId = regionId +} + +/* param pageNumber: 页码;默认为1(Optional) */ +func (r *DescribeKeypairsRequest) SetPageNumber(pageNumber int) { + r.PageNumber = &pageNumber +} + +/* param pageSize: 分页大小;默认为20;取值范围[10, 100](Optional) */ +func (r *DescribeKeypairsRequest) SetPageSize(pageSize int) { + r.PageSize = &pageSize +} + +/* param filters: keyNames - 密钥对名称,精确匹配,支持多个 +(Optional) */ +func (r *DescribeKeypairsRequest) SetFilters(filters []common.Filter) { + r.Filters = filters +} + +// GetRegionId returns path parameter 'regionId' if exist, +// otherwise return empty string +func (r DescribeKeypairsRequest) GetRegionId() string { + return r.RegionId +} + +type DescribeKeypairsResponse struct { + RequestID string `json:"requestId"` + Error core.ErrorResponse `json:"error"` + Result DescribeKeypairsResult `json:"result"` +} + +type DescribeKeypairsResult struct { + Keypairs []vm.Keypair `json:"keypairs"` + TotalCount int `json:"totalCount"` +} \ No newline at end of file diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/DescribeQuotas.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/DescribeQuotas.go new file mode 100644 index 000000000..66041bb0c --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/DescribeQuotas.go @@ -0,0 +1,128 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package apis + +import ( + "github.com/jdcloud-api/jdcloud-sdk-go/core" + vm "github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models" + common "github.com/jdcloud-api/jdcloud-sdk-go/services/common/models" +) + +type DescribeQuotasRequest struct { + + core.JDCloudRequest + + /* 地域ID */ + RegionId string `json:"regionId"` + + /* resourceTypes - 资源类型,支持多个[instance,keypair,image,instanceTemplate,imageShare] + (Optional) */ + Filters []common.Filter `json:"filters"` + + /* 私有镜像Id,查询镜像共享(imageShare)配额时,此参数必传 (Optional) */ + ImageId *string `json:"imageId"` +} + +/* + * param regionId: 地域ID (Required) + * + * @Deprecated, not compatible when mandatory parameters changed + */ +func NewDescribeQuotasRequest( + regionId string, +) *DescribeQuotasRequest { + + return &DescribeQuotasRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/quotas", + Method: "GET", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + } +} + +/* + * param regionId: 地域ID (Required) + * param filters: resourceTypes - 资源类型,支持多个[instance,keypair,image,instanceTemplate,imageShare] + (Optional) + * param imageId: 私有镜像Id,查询镜像共享(imageShare)配额时,此参数必传 (Optional) + */ +func NewDescribeQuotasRequestWithAllParams( + regionId string, + filters []common.Filter, + imageId *string, +) *DescribeQuotasRequest { + + return &DescribeQuotasRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/quotas", + Method: "GET", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + Filters: filters, + ImageId: imageId, + } +} + +/* This constructor has better compatible ability when API parameters changed */ +func NewDescribeQuotasRequestWithoutParam() *DescribeQuotasRequest { + + return &DescribeQuotasRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/quotas", + Method: "GET", + Header: nil, + Version: "v1", + }, + } +} + +/* param regionId: 地域ID(Required) */ +func (r *DescribeQuotasRequest) SetRegionId(regionId string) { + r.RegionId = regionId +} + +/* param filters: resourceTypes - 资源类型,支持多个[instance,keypair,image,instanceTemplate,imageShare] +(Optional) */ +func (r *DescribeQuotasRequest) SetFilters(filters []common.Filter) { + r.Filters = filters +} + +/* param imageId: 私有镜像Id,查询镜像共享(imageShare)配额时,此参数必传(Optional) */ +func (r *DescribeQuotasRequest) SetImageId(imageId string) { + r.ImageId = &imageId +} + +// GetRegionId returns path parameter 'regionId' if exist, +// otherwise return empty string +func (r DescribeQuotasRequest) GetRegionId() string { + return r.RegionId +} + +type DescribeQuotasResponse struct { + RequestID string `json:"requestId"` + Error core.ErrorResponse `json:"error"` + Result DescribeQuotasResult `json:"result"` +} + +type DescribeQuotasResult struct { + Quotas []vm.Quota `json:"quotas"` +} \ No newline at end of file diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/DetachDisk.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/DetachDisk.go new file mode 100644 index 000000000..e393dfb85 --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/DetachDisk.go @@ -0,0 +1,139 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package apis + +import ( + "github.com/jdcloud-api/jdcloud-sdk-go/core" +) + +type DetachDiskRequest struct { + + core.JDCloudRequest + + /* 地域ID */ + RegionId string `json:"regionId"` + + /* 云主机ID */ + InstanceId string `json:"instanceId"` + + /* 云硬盘ID */ + DiskId string `json:"diskId"` + + /* 强制缷载,默认False。如果此参数传值为True,代表数据盘的IO会被强制断掉。 (Optional) */ + Force *bool `json:"force"` +} + +/* + * param regionId: 地域ID (Required) + * param instanceId: 云主机ID (Required) + * param diskId: 云硬盘ID (Required) + * + * @Deprecated, not compatible when mandatory parameters changed + */ +func NewDetachDiskRequest( + regionId string, + instanceId string, + diskId string, +) *DetachDiskRequest { + + return &DetachDiskRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/instances/{instanceId}:detachDisk", + Method: "POST", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + InstanceId: instanceId, + DiskId: diskId, + } +} + +/* + * param regionId: 地域ID (Required) + * param instanceId: 云主机ID (Required) + * param diskId: 云硬盘ID (Required) + * param force: 强制缷载,默认False。如果此参数传值为True,代表数据盘的IO会被强制断掉。 (Optional) + */ +func NewDetachDiskRequestWithAllParams( + regionId string, + instanceId string, + diskId string, + force *bool, +) *DetachDiskRequest { + + return &DetachDiskRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/instances/{instanceId}:detachDisk", + Method: "POST", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + InstanceId: instanceId, + DiskId: diskId, + Force: force, + } +} + +/* This constructor has better compatible ability when API parameters changed */ +func NewDetachDiskRequestWithoutParam() *DetachDiskRequest { + + return &DetachDiskRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/instances/{instanceId}:detachDisk", + Method: "POST", + Header: nil, + Version: "v1", + }, + } +} + +/* param regionId: 地域ID(Required) */ +func (r *DetachDiskRequest) SetRegionId(regionId string) { + r.RegionId = regionId +} + +/* param instanceId: 云主机ID(Required) */ +func (r *DetachDiskRequest) SetInstanceId(instanceId string) { + r.InstanceId = instanceId +} + +/* param diskId: 云硬盘ID(Required) */ +func (r *DetachDiskRequest) SetDiskId(diskId string) { + r.DiskId = diskId +} + +/* param force: 强制缷载,默认False。如果此参数传值为True,代表数据盘的IO会被强制断掉。(Optional) */ +func (r *DetachDiskRequest) SetForce(force bool) { + r.Force = &force +} + +// GetRegionId returns path parameter 'regionId' if exist, +// otherwise return empty string +func (r DetachDiskRequest) GetRegionId() string { + return r.RegionId +} + +type DetachDiskResponse struct { + RequestID string `json:"requestId"` + Error core.ErrorResponse `json:"error"` + Result DetachDiskResult `json:"result"` +} + +type DetachDiskResult struct { +} \ No newline at end of file diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/DetachNetworkInterface.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/DetachNetworkInterface.go new file mode 100644 index 000000000..83087439f --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/DetachNetworkInterface.go @@ -0,0 +1,128 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package apis + +import ( + "github.com/jdcloud-api/jdcloud-sdk-go/core" +) + +type DetachNetworkInterfaceRequest struct { + + core.JDCloudRequest + + /* 地域ID */ + RegionId string `json:"regionId"` + + /* 云主机ID */ + InstanceId string `json:"instanceId"` + + /* 弹性网卡ID */ + NetworkInterfaceId string `json:"networkInterfaceId"` +} + +/* + * param regionId: 地域ID (Required) + * param instanceId: 云主机ID (Required) + * param networkInterfaceId: 弹性网卡ID (Required) + * + * @Deprecated, not compatible when mandatory parameters changed + */ +func NewDetachNetworkInterfaceRequest( + regionId string, + instanceId string, + networkInterfaceId string, +) *DetachNetworkInterfaceRequest { + + return &DetachNetworkInterfaceRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/instances/{instanceId}:detachNetworkInterface", + Method: "POST", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + InstanceId: instanceId, + NetworkInterfaceId: networkInterfaceId, + } +} + +/* + * param regionId: 地域ID (Required) + * param instanceId: 云主机ID (Required) + * param networkInterfaceId: 弹性网卡ID (Required) + */ +func NewDetachNetworkInterfaceRequestWithAllParams( + regionId string, + instanceId string, + networkInterfaceId string, +) *DetachNetworkInterfaceRequest { + + return &DetachNetworkInterfaceRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/instances/{instanceId}:detachNetworkInterface", + Method: "POST", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + InstanceId: instanceId, + NetworkInterfaceId: networkInterfaceId, + } +} + +/* This constructor has better compatible ability when API parameters changed */ +func NewDetachNetworkInterfaceRequestWithoutParam() *DetachNetworkInterfaceRequest { + + return &DetachNetworkInterfaceRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/instances/{instanceId}:detachNetworkInterface", + Method: "POST", + Header: nil, + Version: "v1", + }, + } +} + +/* param regionId: 地域ID(Required) */ +func (r *DetachNetworkInterfaceRequest) SetRegionId(regionId string) { + r.RegionId = regionId +} + +/* param instanceId: 云主机ID(Required) */ +func (r *DetachNetworkInterfaceRequest) SetInstanceId(instanceId string) { + r.InstanceId = instanceId +} + +/* param networkInterfaceId: 弹性网卡ID(Required) */ +func (r *DetachNetworkInterfaceRequest) SetNetworkInterfaceId(networkInterfaceId string) { + r.NetworkInterfaceId = networkInterfaceId +} + +// GetRegionId returns path parameter 'regionId' if exist, +// otherwise return empty string +func (r DetachNetworkInterfaceRequest) GetRegionId() string { + return r.RegionId +} + +type DetachNetworkInterfaceResponse struct { + RequestID string `json:"requestId"` + Error core.ErrorResponse `json:"error"` + Result DetachNetworkInterfaceResult `json:"result"` +} + +type DetachNetworkInterfaceResult struct { +} \ No newline at end of file diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/DisassociateElasticIp.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/DisassociateElasticIp.go new file mode 100644 index 000000000..d1c023f6b --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/DisassociateElasticIp.go @@ -0,0 +1,128 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package apis + +import ( + "github.com/jdcloud-api/jdcloud-sdk-go/core" +) + +type DisassociateElasticIpRequest struct { + + core.JDCloudRequest + + /* 地域ID */ + RegionId string `json:"regionId"` + + /* 云主机ID */ + InstanceId string `json:"instanceId"` + + /* 弹性公网IP的ID */ + ElasticIpId string `json:"elasticIpId"` +} + +/* + * param regionId: 地域ID (Required) + * param instanceId: 云主机ID (Required) + * param elasticIpId: 弹性公网IP的ID (Required) + * + * @Deprecated, not compatible when mandatory parameters changed + */ +func NewDisassociateElasticIpRequest( + regionId string, + instanceId string, + elasticIpId string, +) *DisassociateElasticIpRequest { + + return &DisassociateElasticIpRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/instances/{instanceId}:disassociateElasticIp", + Method: "POST", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + InstanceId: instanceId, + ElasticIpId: elasticIpId, + } +} + +/* + * param regionId: 地域ID (Required) + * param instanceId: 云主机ID (Required) + * param elasticIpId: 弹性公网IP的ID (Required) + */ +func NewDisassociateElasticIpRequestWithAllParams( + regionId string, + instanceId string, + elasticIpId string, +) *DisassociateElasticIpRequest { + + return &DisassociateElasticIpRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/instances/{instanceId}:disassociateElasticIp", + Method: "POST", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + InstanceId: instanceId, + ElasticIpId: elasticIpId, + } +} + +/* This constructor has better compatible ability when API parameters changed */ +func NewDisassociateElasticIpRequestWithoutParam() *DisassociateElasticIpRequest { + + return &DisassociateElasticIpRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/instances/{instanceId}:disassociateElasticIp", + Method: "POST", + Header: nil, + Version: "v1", + }, + } +} + +/* param regionId: 地域ID(Required) */ +func (r *DisassociateElasticIpRequest) SetRegionId(regionId string) { + r.RegionId = regionId +} + +/* param instanceId: 云主机ID(Required) */ +func (r *DisassociateElasticIpRequest) SetInstanceId(instanceId string) { + r.InstanceId = instanceId +} + +/* param elasticIpId: 弹性公网IP的ID(Required) */ +func (r *DisassociateElasticIpRequest) SetElasticIpId(elasticIpId string) { + r.ElasticIpId = elasticIpId +} + +// GetRegionId returns path parameter 'regionId' if exist, +// otherwise return empty string +func (r DisassociateElasticIpRequest) GetRegionId() string { + return r.RegionId +} + +type DisassociateElasticIpResponse struct { + RequestID string `json:"requestId"` + Error core.ErrorResponse `json:"error"` + Result DisassociateElasticIpResult `json:"result"` +} + +type DisassociateElasticIpResult struct { +} \ No newline at end of file diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/ImportKeypair.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/ImportKeypair.go new file mode 100644 index 000000000..387a85c6b --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/ImportKeypair.go @@ -0,0 +1,134 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package apis + +import ( + "github.com/jdcloud-api/jdcloud-sdk-go/core" +) + +type ImportKeypairRequest struct { + + core.JDCloudRequest + + /* 地域ID */ + RegionId string `json:"regionId"` + + /* 密钥对名称,需要全局唯一。只允许数字、大小写字母、下划线“_”及中划线“-”,不超过32个字符。 + */ + KeyName string `json:"keyName"` + + /* 密钥对的公钥部分 */ + PublicKey string `json:"publicKey"` +} + +/* + * param regionId: 地域ID (Required) + * param keyName: 密钥对名称,需要全局唯一。只允许数字、大小写字母、下划线“_”及中划线“-”,不超过32个字符。 + (Required) + * param publicKey: 密钥对的公钥部分 (Required) + * + * @Deprecated, not compatible when mandatory parameters changed + */ +func NewImportKeypairRequest( + regionId string, + keyName string, + publicKey string, +) *ImportKeypairRequest { + + return &ImportKeypairRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/keypairs:import", + Method: "POST", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + KeyName: keyName, + PublicKey: publicKey, + } +} + +/* + * param regionId: 地域ID (Required) + * param keyName: 密钥对名称,需要全局唯一。只允许数字、大小写字母、下划线“_”及中划线“-”,不超过32个字符。 + (Required) + * param publicKey: 密钥对的公钥部分 (Required) + */ +func NewImportKeypairRequestWithAllParams( + regionId string, + keyName string, + publicKey string, +) *ImportKeypairRequest { + + return &ImportKeypairRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/keypairs:import", + Method: "POST", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + KeyName: keyName, + PublicKey: publicKey, + } +} + +/* This constructor has better compatible ability when API parameters changed */ +func NewImportKeypairRequestWithoutParam() *ImportKeypairRequest { + + return &ImportKeypairRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/keypairs:import", + Method: "POST", + Header: nil, + Version: "v1", + }, + } +} + +/* param regionId: 地域ID(Required) */ +func (r *ImportKeypairRequest) SetRegionId(regionId string) { + r.RegionId = regionId +} + +/* param keyName: 密钥对名称,需要全局唯一。只允许数字、大小写字母、下划线“_”及中划线“-”,不超过32个字符。 +(Required) */ +func (r *ImportKeypairRequest) SetKeyName(keyName string) { + r.KeyName = keyName +} + +/* param publicKey: 密钥对的公钥部分(Required) */ +func (r *ImportKeypairRequest) SetPublicKey(publicKey string) { + r.PublicKey = publicKey +} + +// GetRegionId returns path parameter 'regionId' if exist, +// otherwise return empty string +func (r ImportKeypairRequest) GetRegionId() string { + return r.RegionId +} + +type ImportKeypairResponse struct { + RequestID string `json:"requestId"` + Error core.ErrorResponse `json:"error"` + Result ImportKeypairResult `json:"result"` +} + +type ImportKeypairResult struct { + KeyName string `json:"keyName"` + KeyFingerprint string `json:"keyFingerprint"` +} \ No newline at end of file diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/ModifyImageAttribute.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/ModifyImageAttribute.go new file mode 100644 index 000000000..0b811aaf6 --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/ModifyImageAttribute.go @@ -0,0 +1,136 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package apis + +import ( + "github.com/jdcloud-api/jdcloud-sdk-go/core" +) + +type ModifyImageAttributeRequest struct { + + core.JDCloudRequest + + /* 地域ID */ + RegionId string `json:"regionId"` + + /* 镜像ID */ + ImageId string `json:"imageId"` + + /* 名称,参考公共参数规范。 (Optional) */ + Name *string `json:"name"` + + /* 描述,参考公共参数规范。 (Optional) */ + Description *string `json:"description"` +} + +/* + * param regionId: 地域ID (Required) + * param imageId: 镜像ID (Required) + * + * @Deprecated, not compatible when mandatory parameters changed + */ +func NewModifyImageAttributeRequest( + regionId string, + imageId string, +) *ModifyImageAttributeRequest { + + return &ModifyImageAttributeRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/images/{imageId}:modifyImageAttribute", + Method: "POST", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + ImageId: imageId, + } +} + +/* + * param regionId: 地域ID (Required) + * param imageId: 镜像ID (Required) + * param name: 名称,参考公共参数规范。 (Optional) + * param description: 描述,参考公共参数规范。 (Optional) + */ +func NewModifyImageAttributeRequestWithAllParams( + regionId string, + imageId string, + name *string, + description *string, +) *ModifyImageAttributeRequest { + + return &ModifyImageAttributeRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/images/{imageId}:modifyImageAttribute", + Method: "POST", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + ImageId: imageId, + Name: name, + Description: description, + } +} + +/* This constructor has better compatible ability when API parameters changed */ +func NewModifyImageAttributeRequestWithoutParam() *ModifyImageAttributeRequest { + + return &ModifyImageAttributeRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/images/{imageId}:modifyImageAttribute", + Method: "POST", + Header: nil, + Version: "v1", + }, + } +} + +/* param regionId: 地域ID(Required) */ +func (r *ModifyImageAttributeRequest) SetRegionId(regionId string) { + r.RegionId = regionId +} + +/* param imageId: 镜像ID(Required) */ +func (r *ModifyImageAttributeRequest) SetImageId(imageId string) { + r.ImageId = imageId +} + +/* param name: 名称,参考公共参数规范。(Optional) */ +func (r *ModifyImageAttributeRequest) SetName(name string) { + r.Name = &name +} + +/* param description: 描述,参考公共参数规范。(Optional) */ +func (r *ModifyImageAttributeRequest) SetDescription(description string) { + r.Description = &description +} + +// GetRegionId returns path parameter 'regionId' if exist, +// otherwise return empty string +func (r ModifyImageAttributeRequest) GetRegionId() string { + return r.RegionId +} + +type ModifyImageAttributeResponse struct { + RequestID string `json:"requestId"` + Error core.ErrorResponse `json:"error"` + Result ModifyImageAttributeResult `json:"result"` +} + +type ModifyImageAttributeResult struct { +} \ No newline at end of file diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/ModifyInstanceAttribute.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/ModifyInstanceAttribute.go new file mode 100644 index 000000000..cba1debfd --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/ModifyInstanceAttribute.go @@ -0,0 +1,136 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package apis + +import ( + "github.com/jdcloud-api/jdcloud-sdk-go/core" +) + +type ModifyInstanceAttributeRequest struct { + + core.JDCloudRequest + + /* 地域ID */ + RegionId string `json:"regionId"` + + /* 云主机ID */ + InstanceId string `json:"instanceId"` + + /* 名称,参考公共参数规范。 (Optional) */ + Name *string `json:"name"` + + /* 描述,参考公共参数规范。 (Optional) */ + Description *string `json:"description"` +} + +/* + * param regionId: 地域ID (Required) + * param instanceId: 云主机ID (Required) + * + * @Deprecated, not compatible when mandatory parameters changed + */ +func NewModifyInstanceAttributeRequest( + regionId string, + instanceId string, +) *ModifyInstanceAttributeRequest { + + return &ModifyInstanceAttributeRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/instances/{instanceId}:modifyInstanceAttribute", + Method: "POST", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + InstanceId: instanceId, + } +} + +/* + * param regionId: 地域ID (Required) + * param instanceId: 云主机ID (Required) + * param name: 名称,参考公共参数规范。 (Optional) + * param description: 描述,参考公共参数规范。 (Optional) + */ +func NewModifyInstanceAttributeRequestWithAllParams( + regionId string, + instanceId string, + name *string, + description *string, +) *ModifyInstanceAttributeRequest { + + return &ModifyInstanceAttributeRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/instances/{instanceId}:modifyInstanceAttribute", + Method: "POST", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + InstanceId: instanceId, + Name: name, + Description: description, + } +} + +/* This constructor has better compatible ability when API parameters changed */ +func NewModifyInstanceAttributeRequestWithoutParam() *ModifyInstanceAttributeRequest { + + return &ModifyInstanceAttributeRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/instances/{instanceId}:modifyInstanceAttribute", + Method: "POST", + Header: nil, + Version: "v1", + }, + } +} + +/* param regionId: 地域ID(Required) */ +func (r *ModifyInstanceAttributeRequest) SetRegionId(regionId string) { + r.RegionId = regionId +} + +/* param instanceId: 云主机ID(Required) */ +func (r *ModifyInstanceAttributeRequest) SetInstanceId(instanceId string) { + r.InstanceId = instanceId +} + +/* param name: 名称,参考公共参数规范。(Optional) */ +func (r *ModifyInstanceAttributeRequest) SetName(name string) { + r.Name = &name +} + +/* param description: 描述,参考公共参数规范。(Optional) */ +func (r *ModifyInstanceAttributeRequest) SetDescription(description string) { + r.Description = &description +} + +// GetRegionId returns path parameter 'regionId' if exist, +// otherwise return empty string +func (r ModifyInstanceAttributeRequest) GetRegionId() string { + return r.RegionId +} + +type ModifyInstanceAttributeResponse struct { + RequestID string `json:"requestId"` + Error core.ErrorResponse `json:"error"` + Result ModifyInstanceAttributeResult `json:"result"` +} + +type ModifyInstanceAttributeResult struct { +} \ No newline at end of file diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/ModifyInstanceDiskAttribute.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/ModifyInstanceDiskAttribute.go new file mode 100644 index 000000000..8be479476 --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/ModifyInstanceDiskAttribute.go @@ -0,0 +1,126 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package apis + +import ( + "github.com/jdcloud-api/jdcloud-sdk-go/core" + vm "github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models" +) + +type ModifyInstanceDiskAttributeRequest struct { + + core.JDCloudRequest + + /* 地域ID */ + RegionId string `json:"regionId"` + + /* 云主机ID */ + InstanceId string `json:"instanceId"` + + /* 云硬盘列表 (Optional) */ + DataDisks []vm.InstanceDiskAttribute `json:"dataDisks"` +} + +/* + * param regionId: 地域ID (Required) + * param instanceId: 云主机ID (Required) + * + * @Deprecated, not compatible when mandatory parameters changed + */ +func NewModifyInstanceDiskAttributeRequest( + regionId string, + instanceId string, +) *ModifyInstanceDiskAttributeRequest { + + return &ModifyInstanceDiskAttributeRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/instances/{instanceId}:modifyInstanceDiskAttribute", + Method: "POST", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + InstanceId: instanceId, + } +} + +/* + * param regionId: 地域ID (Required) + * param instanceId: 云主机ID (Required) + * param dataDisks: 云硬盘列表 (Optional) + */ +func NewModifyInstanceDiskAttributeRequestWithAllParams( + regionId string, + instanceId string, + dataDisks []vm.InstanceDiskAttribute, +) *ModifyInstanceDiskAttributeRequest { + + return &ModifyInstanceDiskAttributeRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/instances/{instanceId}:modifyInstanceDiskAttribute", + Method: "POST", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + InstanceId: instanceId, + DataDisks: dataDisks, + } +} + +/* This constructor has better compatible ability when API parameters changed */ +func NewModifyInstanceDiskAttributeRequestWithoutParam() *ModifyInstanceDiskAttributeRequest { + + return &ModifyInstanceDiskAttributeRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/instances/{instanceId}:modifyInstanceDiskAttribute", + Method: "POST", + Header: nil, + Version: "v1", + }, + } +} + +/* param regionId: 地域ID(Required) */ +func (r *ModifyInstanceDiskAttributeRequest) SetRegionId(regionId string) { + r.RegionId = regionId +} + +/* param instanceId: 云主机ID(Required) */ +func (r *ModifyInstanceDiskAttributeRequest) SetInstanceId(instanceId string) { + r.InstanceId = instanceId +} + +/* param dataDisks: 云硬盘列表(Optional) */ +func (r *ModifyInstanceDiskAttributeRequest) SetDataDisks(dataDisks []vm.InstanceDiskAttribute) { + r.DataDisks = dataDisks +} + +// GetRegionId returns path parameter 'regionId' if exist, +// otherwise return empty string +func (r ModifyInstanceDiskAttributeRequest) GetRegionId() string { + return r.RegionId +} + +type ModifyInstanceDiskAttributeResponse struct { + RequestID string `json:"requestId"` + Error core.ErrorResponse `json:"error"` + Result ModifyInstanceDiskAttributeResult `json:"result"` +} + +type ModifyInstanceDiskAttributeResult struct { +} \ No newline at end of file diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/ModifyInstanceNetworkAttribute.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/ModifyInstanceNetworkAttribute.go new file mode 100644 index 000000000..dd219907c --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/ModifyInstanceNetworkAttribute.go @@ -0,0 +1,126 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package apis + +import ( + "github.com/jdcloud-api/jdcloud-sdk-go/core" + vm "github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models" +) + +type ModifyInstanceNetworkAttributeRequest struct { + + core.JDCloudRequest + + /* 地域ID */ + RegionId string `json:"regionId"` + + /* 云主机ID */ + InstanceId string `json:"instanceId"` + + /* 弹性网卡列表 (Optional) */ + Networks []vm.InstanceNetworkAttribute `json:"networks"` +} + +/* + * param regionId: 地域ID (Required) + * param instanceId: 云主机ID (Required) + * + * @Deprecated, not compatible when mandatory parameters changed + */ +func NewModifyInstanceNetworkAttributeRequest( + regionId string, + instanceId string, +) *ModifyInstanceNetworkAttributeRequest { + + return &ModifyInstanceNetworkAttributeRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/instances/{instanceId}:modifyInstanceNetworkAttribute", + Method: "POST", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + InstanceId: instanceId, + } +} + +/* + * param regionId: 地域ID (Required) + * param instanceId: 云主机ID (Required) + * param networks: 弹性网卡列表 (Optional) + */ +func NewModifyInstanceNetworkAttributeRequestWithAllParams( + regionId string, + instanceId string, + networks []vm.InstanceNetworkAttribute, +) *ModifyInstanceNetworkAttributeRequest { + + return &ModifyInstanceNetworkAttributeRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/instances/{instanceId}:modifyInstanceNetworkAttribute", + Method: "POST", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + InstanceId: instanceId, + Networks: networks, + } +} + +/* This constructor has better compatible ability when API parameters changed */ +func NewModifyInstanceNetworkAttributeRequestWithoutParam() *ModifyInstanceNetworkAttributeRequest { + + return &ModifyInstanceNetworkAttributeRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/instances/{instanceId}:modifyInstanceNetworkAttribute", + Method: "POST", + Header: nil, + Version: "v1", + }, + } +} + +/* param regionId: 地域ID(Required) */ +func (r *ModifyInstanceNetworkAttributeRequest) SetRegionId(regionId string) { + r.RegionId = regionId +} + +/* param instanceId: 云主机ID(Required) */ +func (r *ModifyInstanceNetworkAttributeRequest) SetInstanceId(instanceId string) { + r.InstanceId = instanceId +} + +/* param networks: 弹性网卡列表(Optional) */ +func (r *ModifyInstanceNetworkAttributeRequest) SetNetworks(networks []vm.InstanceNetworkAttribute) { + r.Networks = networks +} + +// GetRegionId returns path parameter 'regionId' if exist, +// otherwise return empty string +func (r ModifyInstanceNetworkAttributeRequest) GetRegionId() string { + return r.RegionId +} + +type ModifyInstanceNetworkAttributeResponse struct { + RequestID string `json:"requestId"` + Error core.ErrorResponse `json:"error"` + Result ModifyInstanceNetworkAttributeResult `json:"result"` +} + +type ModifyInstanceNetworkAttributeResult struct { +} \ No newline at end of file diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/ModifyInstancePassword.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/ModifyInstancePassword.go new file mode 100644 index 000000000..0d82721ef --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/ModifyInstancePassword.go @@ -0,0 +1,128 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package apis + +import ( + "github.com/jdcloud-api/jdcloud-sdk-go/core" +) + +type ModifyInstancePasswordRequest struct { + + core.JDCloudRequest + + /* 地域ID */ + RegionId string `json:"regionId"` + + /* 云主机ID */ + InstanceId string `json:"instanceId"` + + /* 密码,参考公共参数规范。 */ + Password string `json:"password"` +} + +/* + * param regionId: 地域ID (Required) + * param instanceId: 云主机ID (Required) + * param password: 密码,参考公共参数规范。 (Required) + * + * @Deprecated, not compatible when mandatory parameters changed + */ +func NewModifyInstancePasswordRequest( + regionId string, + instanceId string, + password string, +) *ModifyInstancePasswordRequest { + + return &ModifyInstancePasswordRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/instances/{instanceId}:modifyInstancePassword", + Method: "POST", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + InstanceId: instanceId, + Password: password, + } +} + +/* + * param regionId: 地域ID (Required) + * param instanceId: 云主机ID (Required) + * param password: 密码,参考公共参数规范。 (Required) + */ +func NewModifyInstancePasswordRequestWithAllParams( + regionId string, + instanceId string, + password string, +) *ModifyInstancePasswordRequest { + + return &ModifyInstancePasswordRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/instances/{instanceId}:modifyInstancePassword", + Method: "POST", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + InstanceId: instanceId, + Password: password, + } +} + +/* This constructor has better compatible ability when API parameters changed */ +func NewModifyInstancePasswordRequestWithoutParam() *ModifyInstancePasswordRequest { + + return &ModifyInstancePasswordRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/instances/{instanceId}:modifyInstancePassword", + Method: "POST", + Header: nil, + Version: "v1", + }, + } +} + +/* param regionId: 地域ID(Required) */ +func (r *ModifyInstancePasswordRequest) SetRegionId(regionId string) { + r.RegionId = regionId +} + +/* param instanceId: 云主机ID(Required) */ +func (r *ModifyInstancePasswordRequest) SetInstanceId(instanceId string) { + r.InstanceId = instanceId +} + +/* param password: 密码,参考公共参数规范。(Required) */ +func (r *ModifyInstancePasswordRequest) SetPassword(password string) { + r.Password = password +} + +// GetRegionId returns path parameter 'regionId' if exist, +// otherwise return empty string +func (r ModifyInstancePasswordRequest) GetRegionId() string { + return r.RegionId +} + +type ModifyInstancePasswordResponse struct { + RequestID string `json:"requestId"` + Error core.ErrorResponse `json:"error"` + Result ModifyInstancePasswordResult `json:"result"` +} + +type ModifyInstancePasswordResult struct { +} \ No newline at end of file diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/RebootInstance.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/RebootInstance.go new file mode 100644 index 000000000..7bfac4809 --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/RebootInstance.go @@ -0,0 +1,114 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package apis + +import ( + "github.com/jdcloud-api/jdcloud-sdk-go/core" +) + +type RebootInstanceRequest struct { + + core.JDCloudRequest + + /* 地域ID */ + RegionId string `json:"regionId"` + + /* 云主机ID */ + InstanceId string `json:"instanceId"` +} + +/* + * param regionId: 地域ID (Required) + * param instanceId: 云主机ID (Required) + * + * @Deprecated, not compatible when mandatory parameters changed + */ +func NewRebootInstanceRequest( + regionId string, + instanceId string, +) *RebootInstanceRequest { + + return &RebootInstanceRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/instances/{instanceId}:rebootInstance", + Method: "POST", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + InstanceId: instanceId, + } +} + +/* + * param regionId: 地域ID (Required) + * param instanceId: 云主机ID (Required) + */ +func NewRebootInstanceRequestWithAllParams( + regionId string, + instanceId string, +) *RebootInstanceRequest { + + return &RebootInstanceRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/instances/{instanceId}:rebootInstance", + Method: "POST", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + InstanceId: instanceId, + } +} + +/* This constructor has better compatible ability when API parameters changed */ +func NewRebootInstanceRequestWithoutParam() *RebootInstanceRequest { + + return &RebootInstanceRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/instances/{instanceId}:rebootInstance", + Method: "POST", + Header: nil, + Version: "v1", + }, + } +} + +/* param regionId: 地域ID(Required) */ +func (r *RebootInstanceRequest) SetRegionId(regionId string) { + r.RegionId = regionId +} + +/* param instanceId: 云主机ID(Required) */ +func (r *RebootInstanceRequest) SetInstanceId(instanceId string) { + r.InstanceId = instanceId +} + +// GetRegionId returns path parameter 'regionId' if exist, +// otherwise return empty string +func (r RebootInstanceRequest) GetRegionId() string { + return r.RegionId +} + +type RebootInstanceResponse struct { + RequestID string `json:"requestId"` + Error core.ErrorResponse `json:"error"` + Result RebootInstanceResult `json:"result"` +} + +type RebootInstanceResult struct { +} \ No newline at end of file diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/RebuildInstance.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/RebuildInstance.go new file mode 100644 index 000000000..0aa5380f7 --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/RebuildInstance.go @@ -0,0 +1,150 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package apis + +import ( + "github.com/jdcloud-api/jdcloud-sdk-go/core" +) + +type RebuildInstanceRequest struct { + + core.JDCloudRequest + + /* 地域ID */ + RegionId string `json:"regionId"` + + /* 云主机ID */ + InstanceId string `json:"instanceId"` + + /* 云主机密码,参考公共参数规范。 */ + Password string `json:"password"` + + /* 镜像ID。可查询DescribeImages接口获得指定地域的镜像信息。 (Optional) */ + ImageId *string `json:"imageId"` + + /* 密钥对名称;当前只支持一个。仅Linux系统支持指定。 (Optional) */ + KeyNames []string `json:"keyNames"` +} + +/* + * param regionId: 地域ID (Required) + * param instanceId: 云主机ID (Required) + * param password: 云主机密码,参考公共参数规范。 (Required) + * + * @Deprecated, not compatible when mandatory parameters changed + */ +func NewRebuildInstanceRequest( + regionId string, + instanceId string, + password string, +) *RebuildInstanceRequest { + + return &RebuildInstanceRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/instances/{instanceId}:rebuildInstance", + Method: "POST", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + InstanceId: instanceId, + Password: password, + } +} + +/* + * param regionId: 地域ID (Required) + * param instanceId: 云主机ID (Required) + * param password: 云主机密码,参考公共参数规范。 (Required) + * param imageId: 镜像ID。可查询DescribeImages接口获得指定地域的镜像信息。 (Optional) + * param keyNames: 密钥对名称;当前只支持一个。仅Linux系统支持指定。 (Optional) + */ +func NewRebuildInstanceRequestWithAllParams( + regionId string, + instanceId string, + password string, + imageId *string, + keyNames []string, +) *RebuildInstanceRequest { + + return &RebuildInstanceRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/instances/{instanceId}:rebuildInstance", + Method: "POST", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + InstanceId: instanceId, + Password: password, + ImageId: imageId, + KeyNames: keyNames, + } +} + +/* This constructor has better compatible ability when API parameters changed */ +func NewRebuildInstanceRequestWithoutParam() *RebuildInstanceRequest { + + return &RebuildInstanceRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/instances/{instanceId}:rebuildInstance", + Method: "POST", + Header: nil, + Version: "v1", + }, + } +} + +/* param regionId: 地域ID(Required) */ +func (r *RebuildInstanceRequest) SetRegionId(regionId string) { + r.RegionId = regionId +} + +/* param instanceId: 云主机ID(Required) */ +func (r *RebuildInstanceRequest) SetInstanceId(instanceId string) { + r.InstanceId = instanceId +} + +/* param password: 云主机密码,参考公共参数规范。(Required) */ +func (r *RebuildInstanceRequest) SetPassword(password string) { + r.Password = password +} + +/* param imageId: 镜像ID。可查询DescribeImages接口获得指定地域的镜像信息。(Optional) */ +func (r *RebuildInstanceRequest) SetImageId(imageId string) { + r.ImageId = &imageId +} + +/* param keyNames: 密钥对名称;当前只支持一个。仅Linux系统支持指定。(Optional) */ +func (r *RebuildInstanceRequest) SetKeyNames(keyNames []string) { + r.KeyNames = keyNames +} + +// GetRegionId returns path parameter 'regionId' if exist, +// otherwise return empty string +func (r RebuildInstanceRequest) GetRegionId() string { + return r.RegionId +} + +type RebuildInstanceResponse struct { + RequestID string `json:"requestId"` + Error core.ErrorResponse `json:"error"` + Result RebuildInstanceResult `json:"result"` +} + +type RebuildInstanceResult struct { +} \ No newline at end of file diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/ResizeInstance.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/ResizeInstance.go new file mode 100644 index 000000000..4c5f83bc3 --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/ResizeInstance.go @@ -0,0 +1,128 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package apis + +import ( + "github.com/jdcloud-api/jdcloud-sdk-go/core" +) + +type ResizeInstanceRequest struct { + + core.JDCloudRequest + + /* 地域ID */ + RegionId string `json:"regionId"` + + /* 云主机ID */ + InstanceId string `json:"instanceId"` + + /* 实例规格,可查询DescribeInstanceTypes接口获得指定地域或可用区的规格信息。 */ + InstanceType string `json:"instanceType"` +} + +/* + * param regionId: 地域ID (Required) + * param instanceId: 云主机ID (Required) + * param instanceType: 实例规格,可查询DescribeInstanceTypes接口获得指定地域或可用区的规格信息。 (Required) + * + * @Deprecated, not compatible when mandatory parameters changed + */ +func NewResizeInstanceRequest( + regionId string, + instanceId string, + instanceType string, +) *ResizeInstanceRequest { + + return &ResizeInstanceRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/instances/{instanceId}:resizeInstance", + Method: "POST", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + InstanceId: instanceId, + InstanceType: instanceType, + } +} + +/* + * param regionId: 地域ID (Required) + * param instanceId: 云主机ID (Required) + * param instanceType: 实例规格,可查询DescribeInstanceTypes接口获得指定地域或可用区的规格信息。 (Required) + */ +func NewResizeInstanceRequestWithAllParams( + regionId string, + instanceId string, + instanceType string, +) *ResizeInstanceRequest { + + return &ResizeInstanceRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/instances/{instanceId}:resizeInstance", + Method: "POST", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + InstanceId: instanceId, + InstanceType: instanceType, + } +} + +/* This constructor has better compatible ability when API parameters changed */ +func NewResizeInstanceRequestWithoutParam() *ResizeInstanceRequest { + + return &ResizeInstanceRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/instances/{instanceId}:resizeInstance", + Method: "POST", + Header: nil, + Version: "v1", + }, + } +} + +/* param regionId: 地域ID(Required) */ +func (r *ResizeInstanceRequest) SetRegionId(regionId string) { + r.RegionId = regionId +} + +/* param instanceId: 云主机ID(Required) */ +func (r *ResizeInstanceRequest) SetInstanceId(instanceId string) { + r.InstanceId = instanceId +} + +/* param instanceType: 实例规格,可查询DescribeInstanceTypes接口获得指定地域或可用区的规格信息。(Required) */ +func (r *ResizeInstanceRequest) SetInstanceType(instanceType string) { + r.InstanceType = instanceType +} + +// GetRegionId returns path parameter 'regionId' if exist, +// otherwise return empty string +func (r ResizeInstanceRequest) GetRegionId() string { + return r.RegionId +} + +type ResizeInstanceResponse struct { + RequestID string `json:"requestId"` + Error core.ErrorResponse `json:"error"` + Result ResizeInstanceResult `json:"result"` +} + +type ResizeInstanceResult struct { +} \ No newline at end of file diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/ShareImage.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/ShareImage.go new file mode 100644 index 000000000..3f047a801 --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/ShareImage.go @@ -0,0 +1,125 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package apis + +import ( + "github.com/jdcloud-api/jdcloud-sdk-go/core" +) + +type ShareImageRequest struct { + + core.JDCloudRequest + + /* 地域ID */ + RegionId string `json:"regionId"` + + /* 镜像ID */ + ImageId string `json:"imageId"` + + /* 需要共享的帐户 (Optional) */ + Pins []string `json:"pins"` +} + +/* + * param regionId: 地域ID (Required) + * param imageId: 镜像ID (Required) + * + * @Deprecated, not compatible when mandatory parameters changed + */ +func NewShareImageRequest( + regionId string, + imageId string, +) *ShareImageRequest { + + return &ShareImageRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/images/{imageId}:share", + Method: "POST", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + ImageId: imageId, + } +} + +/* + * param regionId: 地域ID (Required) + * param imageId: 镜像ID (Required) + * param pins: 需要共享的帐户 (Optional) + */ +func NewShareImageRequestWithAllParams( + regionId string, + imageId string, + pins []string, +) *ShareImageRequest { + + return &ShareImageRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/images/{imageId}:share", + Method: "POST", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + ImageId: imageId, + Pins: pins, + } +} + +/* This constructor has better compatible ability when API parameters changed */ +func NewShareImageRequestWithoutParam() *ShareImageRequest { + + return &ShareImageRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/images/{imageId}:share", + Method: "POST", + Header: nil, + Version: "v1", + }, + } +} + +/* param regionId: 地域ID(Required) */ +func (r *ShareImageRequest) SetRegionId(regionId string) { + r.RegionId = regionId +} + +/* param imageId: 镜像ID(Required) */ +func (r *ShareImageRequest) SetImageId(imageId string) { + r.ImageId = imageId +} + +/* param pins: 需要共享的帐户(Optional) */ +func (r *ShareImageRequest) SetPins(pins []string) { + r.Pins = pins +} + +// GetRegionId returns path parameter 'regionId' if exist, +// otherwise return empty string +func (r ShareImageRequest) GetRegionId() string { + return r.RegionId +} + +type ShareImageResponse struct { + RequestID string `json:"requestId"` + Error core.ErrorResponse `json:"error"` + Result ShareImageResult `json:"result"` +} + +type ShareImageResult struct { +} \ No newline at end of file diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/StartInstance.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/StartInstance.go new file mode 100644 index 000000000..cdb93d9d9 --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/StartInstance.go @@ -0,0 +1,114 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package apis + +import ( + "github.com/jdcloud-api/jdcloud-sdk-go/core" +) + +type StartInstanceRequest struct { + + core.JDCloudRequest + + /* 地域ID */ + RegionId string `json:"regionId"` + + /* 云主机ID */ + InstanceId string `json:"instanceId"` +} + +/* + * param regionId: 地域ID (Required) + * param instanceId: 云主机ID (Required) + * + * @Deprecated, not compatible when mandatory parameters changed + */ +func NewStartInstanceRequest( + regionId string, + instanceId string, +) *StartInstanceRequest { + + return &StartInstanceRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/instances/{instanceId}:startInstance", + Method: "POST", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + InstanceId: instanceId, + } +} + +/* + * param regionId: 地域ID (Required) + * param instanceId: 云主机ID (Required) + */ +func NewStartInstanceRequestWithAllParams( + regionId string, + instanceId string, +) *StartInstanceRequest { + + return &StartInstanceRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/instances/{instanceId}:startInstance", + Method: "POST", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + InstanceId: instanceId, + } +} + +/* This constructor has better compatible ability when API parameters changed */ +func NewStartInstanceRequestWithoutParam() *StartInstanceRequest { + + return &StartInstanceRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/instances/{instanceId}:startInstance", + Method: "POST", + Header: nil, + Version: "v1", + }, + } +} + +/* param regionId: 地域ID(Required) */ +func (r *StartInstanceRequest) SetRegionId(regionId string) { + r.RegionId = regionId +} + +/* param instanceId: 云主机ID(Required) */ +func (r *StartInstanceRequest) SetInstanceId(instanceId string) { + r.InstanceId = instanceId +} + +// GetRegionId returns path parameter 'regionId' if exist, +// otherwise return empty string +func (r StartInstanceRequest) GetRegionId() string { + return r.RegionId +} + +type StartInstanceResponse struct { + RequestID string `json:"requestId"` + Error core.ErrorResponse `json:"error"` + Result StartInstanceResult `json:"result"` +} + +type StartInstanceResult struct { +} \ No newline at end of file diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/StopInstance.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/StopInstance.go new file mode 100644 index 000000000..c23c6cd42 --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/StopInstance.go @@ -0,0 +1,114 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package apis + +import ( + "github.com/jdcloud-api/jdcloud-sdk-go/core" +) + +type StopInstanceRequest struct { + + core.JDCloudRequest + + /* 地域ID */ + RegionId string `json:"regionId"` + + /* 云主机ID */ + InstanceId string `json:"instanceId"` +} + +/* + * param regionId: 地域ID (Required) + * param instanceId: 云主机ID (Required) + * + * @Deprecated, not compatible when mandatory parameters changed + */ +func NewStopInstanceRequest( + regionId string, + instanceId string, +) *StopInstanceRequest { + + return &StopInstanceRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/instances/{instanceId}:stopInstance", + Method: "POST", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + InstanceId: instanceId, + } +} + +/* + * param regionId: 地域ID (Required) + * param instanceId: 云主机ID (Required) + */ +func NewStopInstanceRequestWithAllParams( + regionId string, + instanceId string, +) *StopInstanceRequest { + + return &StopInstanceRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/instances/{instanceId}:stopInstance", + Method: "POST", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + InstanceId: instanceId, + } +} + +/* This constructor has better compatible ability when API parameters changed */ +func NewStopInstanceRequestWithoutParam() *StopInstanceRequest { + + return &StopInstanceRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/instances/{instanceId}:stopInstance", + Method: "POST", + Header: nil, + Version: "v1", + }, + } +} + +/* param regionId: 地域ID(Required) */ +func (r *StopInstanceRequest) SetRegionId(regionId string) { + r.RegionId = regionId +} + +/* param instanceId: 云主机ID(Required) */ +func (r *StopInstanceRequest) SetInstanceId(instanceId string) { + r.InstanceId = instanceId +} + +// GetRegionId returns path parameter 'regionId' if exist, +// otherwise return empty string +func (r StopInstanceRequest) GetRegionId() string { + return r.RegionId +} + +type StopInstanceResponse struct { + RequestID string `json:"requestId"` + Error core.ErrorResponse `json:"error"` + Result StopInstanceResult `json:"result"` +} + +type StopInstanceResult struct { +} \ No newline at end of file diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/UnShareImage.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/UnShareImage.go new file mode 100644 index 000000000..0e34ed4f9 --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/UnShareImage.go @@ -0,0 +1,125 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package apis + +import ( + "github.com/jdcloud-api/jdcloud-sdk-go/core" +) + +type UnShareImageRequest struct { + + core.JDCloudRequest + + /* 地域ID */ + RegionId string `json:"regionId"` + + /* 镜像ID */ + ImageId string `json:"imageId"` + + /* 需要取消的帐户 (Optional) */ + Pins []string `json:"pins"` +} + +/* + * param regionId: 地域ID (Required) + * param imageId: 镜像ID (Required) + * + * @Deprecated, not compatible when mandatory parameters changed + */ +func NewUnShareImageRequest( + regionId string, + imageId string, +) *UnShareImageRequest { + + return &UnShareImageRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/images/{imageId}:unshare", + Method: "POST", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + ImageId: imageId, + } +} + +/* + * param regionId: 地域ID (Required) + * param imageId: 镜像ID (Required) + * param pins: 需要取消的帐户 (Optional) + */ +func NewUnShareImageRequestWithAllParams( + regionId string, + imageId string, + pins []string, +) *UnShareImageRequest { + + return &UnShareImageRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/images/{imageId}:unshare", + Method: "POST", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + ImageId: imageId, + Pins: pins, + } +} + +/* This constructor has better compatible ability when API parameters changed */ +func NewUnShareImageRequestWithoutParam() *UnShareImageRequest { + + return &UnShareImageRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/images/{imageId}:unshare", + Method: "POST", + Header: nil, + Version: "v1", + }, + } +} + +/* param regionId: 地域ID(Required) */ +func (r *UnShareImageRequest) SetRegionId(regionId string) { + r.RegionId = regionId +} + +/* param imageId: 镜像ID(Required) */ +func (r *UnShareImageRequest) SetImageId(imageId string) { + r.ImageId = imageId +} + +/* param pins: 需要取消的帐户(Optional) */ +func (r *UnShareImageRequest) SetPins(pins []string) { + r.Pins = pins +} + +// GetRegionId returns path parameter 'regionId' if exist, +// otherwise return empty string +func (r UnShareImageRequest) GetRegionId() string { + return r.RegionId +} + +type UnShareImageResponse struct { + RequestID string `json:"requestId"` + Error core.ErrorResponse `json:"error"` + Result UnShareImageResult `json:"result"` +} + +type UnShareImageResult struct { +} \ No newline at end of file diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/client/VmClient.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/client/VmClient.go new file mode 100644 index 000000000..6ec95e956 --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/client/VmClient.go @@ -0,0 +1,962 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package client + +import ( + "github.com/jdcloud-api/jdcloud-sdk-go/core" + vm "github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis" + "encoding/json" + "errors" +) + +type VmClient struct { + core.JDCloudClient +} + +func NewVmClient(credential *core.Credential) *VmClient { + if credential == nil { + return nil + } + + config := core.NewConfig() + config.SetEndpoint("vm.jdcloud-api.com") + + return &VmClient{ + core.JDCloudClient{ + Credential: *credential, + Config: *config, + ServiceName: "vm", + Revision: "1.0.8", + Logger: core.NewDefaultLogger(core.LogInfo), + }} +} + +func (c *VmClient) SetConfig(config *core.Config) { + c.Config = *config +} + +func (c *VmClient) SetLogger(logger core.Logger) { + c.Logger = logger +} + +/* 查询镜像共享帐户列表,只允许操作您的个人私有镜像。 + */ +func (c *VmClient) DescribeImageMembers(request *vm.DescribeImageMembersRequest) (*vm.DescribeImageMembersResponse, error) { + if request == nil { + return nil, errors.New("Request object is nil. ") + } + resp, err := c.Send(request, c.ServiceName) + if err != nil { + return nil, err + } + + jdResp := &vm.DescribeImageMembersResponse{} + err = json.Unmarshal(resp, jdResp) + if err != nil { + c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) + return nil, err + } + + return jdResp, err +} + +/* 为云主机创建私有镜像。云主机状态必须为stopped
+云主机没有正在进行中的任务才可制作镜像。
+制作镜像以备份系统盘为基础,在此之上可选择全部或部分挂载数据盘制作整机镜像(如不做任何更改将默认制作整机镜像),制作镜像过程会为所挂载云硬盘创建快照并与镜像关联。
+调用接口后,需要等待镜像状态变为ready后,才能正常使用镜像。 + */ +func (c *VmClient) CreateImage(request *vm.CreateImageRequest) (*vm.CreateImageResponse, error) { + if request == nil { + return nil, errors.New("Request object is nil. ") + } + resp, err := c.Send(request, c.ServiceName) + if err != nil { + return nil, err + } + + jdResp := &vm.CreateImageResponse{} + err = json.Unmarshal(resp, jdResp) + if err != nil { + c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) + return nil, err + } + + return jdResp, err +} + +/* 创建一台或多台指定配置的云主机,创建模式分为三种:1.普通方式、2.使用高可用组、3.使用启动模板。三种方式创建云主机时参数的必传与非必传是不同的,具体请参考参数详细说明
+- 创建云主机需要通过实名认证 +- 实例规格 + - 可查询DescribeInstanceTypes接口获得指定地域或可用区的规格信息。 + - 不能使用已下线、或已售馨的规格ID +- 镜像 + - Windows Server 2012 R2标准版 64位 中文版 SQL Server 2014 标准版 SP2内存需大于1GB; + - Windows Server所有镜像CPU不可选超过64核CPU。 + - 可查询DescribeImages接口获得指定地域的镜像信息。 + - 选择的镜像必须支持选择的实例规格。可查询DescribeImageConstraints接口获得指定镜像的实例规格限制信息。
+- 网络配置 + - 指定主网卡配置信息 + - 必须指定subnetId + - 可以指定elasticIp规格来约束创建的弹性IP,带宽取值范围[1-100]Mbps,步进1Mbps + - 可以指定主网卡的内网主IP(primaryIpAddress),此时maxCount只能为1 + - 安全组securityGroup需与子网Subnet在同一个私有网络VPC内 + - 一台云主机创建时必须指定一个安全组,至多指定5个安全组,如果没有指定安全组,默认使用默认安全组 + - 主网卡deviceIndex设置为1 +- 存储 + - 系统盘 + - 磁盘分类,系统盘支持local或cloud + - 磁盘大小 + - local:不能指定大小,默认为40GB + - cloud:取值范围: 40-500GB,并且不能小于镜像的最小系统盘大小,如果没有指定,默认以镜像中的系统盘大小为准 + - 自动删除 + - 如果是local,默认自动删除,不能修改此属性 + - 如果是cloud类型的按配置计费的云硬盘,可以指定为True + - 数据盘 + - 磁盘分类,数据盘仅支持cloud + - 云硬盘类型可以选择ssd、premium-hdd + - 磁盘大小 + - premium-hdd:范围[20,3000]GB,步长为10G + - ssd:范围[20,1000]GB,步长为10G + - 自动删除 + - 默认自动删除,如果是包年包月的数据盘或共享型数据盘,此参数不生效 + - 可以指定SnapshotId创建云硬盘 + - 可以从快照创建磁盘 + - local类型系统的云主机可以挂载8块云硬盘 + - cloud类型系统的云主机可以挂载7块云硬盘 +- 计费 + - 弹性IP的计费模式,如果选择按用量类型可以单独设置,其它计费模式都以主机为准 + - 云硬盘的计费模式以主机为准 +- 其他 + - 创建完成后,主机状态为running + - 仅Linux系统云主机可以指定密钥 + - maxCount为最大努力,不保证一定能达到maxCount + - 虚机的az会覆盖磁盘的az属性 +- 密码 + - 参考公共参数规范 + */ +func (c *VmClient) CreateInstances(request *vm.CreateInstancesRequest) (*vm.CreateInstancesResponse, error) { + if request == nil { + return nil, errors.New("Request object is nil. ") + } + resp, err := c.Send(request, c.ServiceName) + if err != nil { + return nil, err + } + + jdResp := &vm.CreateInstancesResponse{} + err = json.Unmarshal(resp, jdResp) + if err != nil { + c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) + return nil, err + } + + return jdResp, err +} + +/* 为云主机主网卡下的主内网IP绑定弹性公网IP。
+一台云主机只能绑定一个弹性公网IP(主网卡),若主网卡已存在弹性公网IP,会返回错误。
+ */ +func (c *VmClient) AssociateElasticIp(request *vm.AssociateElasticIpRequest) (*vm.AssociateElasticIpResponse, error) { + if request == nil { + return nil, errors.New("Request object is nil. ") + } + resp, err := c.Send(request, c.ServiceName) + if err != nil { + return nil, err + } + + jdResp := &vm.AssociateElasticIpResponse{} + err = json.Unmarshal(resp, jdResp) + if err != nil { + c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) + return nil, err + } + + return jdResp, err +} + +/* 共享镜像,只允许操作您的个人私有镜像,单个镜像最多可共享给20个京东云帐户。
+整机镜像目前不支持共享。 + */ +func (c *VmClient) ShareImage(request *vm.ShareImageRequest) (*vm.ShareImageResponse, error) { + if request == nil { + return nil, errors.New("Request object is nil. ") + } + resp, err := c.Send(request, c.ServiceName) + if err != nil { + return nil, err + } + + jdResp := &vm.ShareImageResponse{} + err = json.Unmarshal(resp, jdResp) + if err != nil { + c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) + return nil, err + } + + return jdResp, err +} + +/* 云主机解绑弹性公网IP,解绑的是主网卡、内网主IP对应的弹性公网IP。 + */ +func (c *VmClient) DisassociateElasticIp(request *vm.DisassociateElasticIpRequest) (*vm.DisassociateElasticIpResponse, error) { + if request == nil { + return nil, errors.New("Request object is nil. ") + } + resp, err := c.Send(request, c.ServiceName) + if err != nil { + return nil, err + } + + jdResp := &vm.DisassociateElasticIpResponse{} + err = json.Unmarshal(resp, jdResp) + if err != nil { + c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) + return nil, err + } + + return jdResp, err +} + +/* 停止单个云主机,只能停止running状态的云主机,云主机没有正在进行中的任务才可停止 + */ +func (c *VmClient) StopInstance(request *vm.StopInstanceRequest) (*vm.StopInstanceResponse, error) { + if request == nil { + return nil, errors.New("Request object is nil. ") + } + resp, err := c.Send(request, c.ServiceName) + if err != nil { + return nil, err + } + + jdResp := &vm.StopInstanceResponse{} + err = json.Unmarshal(resp, jdResp) + if err != nil { + c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) + return nil, err + } + + return jdResp, err +} + +/* 启动单个云主机,只能启动stopped状态的云主机,云主机没有正在进行中的任务才可启动。
+只能启动正常计费状态的云主机。 + */ +func (c *VmClient) StartInstance(request *vm.StartInstanceRequest) (*vm.StartInstanceResponse, error) { + if request == nil { + return nil, errors.New("Request object is nil. ") + } + resp, err := c.Send(request, c.ServiceName) + if err != nil { + return nil, err + } + + jdResp := &vm.StartInstanceResponse{} + err = json.Unmarshal(resp, jdResp) + if err != nil { + c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) + return nil, err + } + + return jdResp, err +} + +/* 查询镜像信息列表。
+通过此接口可以查询到京东云官方镜像、第三方镜像、私有镜像、或其他用户共享给您的镜像。
+此接口支持分页查询,默认每页20条。 + */ +func (c *VmClient) DescribeImages(request *vm.DescribeImagesRequest) (*vm.DescribeImagesResponse, error) { + if request == nil { + return nil, errors.New("Request object is nil. ") + } + resp, err := c.Send(request, c.ServiceName) + if err != nil { + return nil, err + } + + jdResp := &vm.DescribeImagesResponse{} + err = json.Unmarshal(resp, jdResp) + if err != nil { + c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) + return nil, err + } + + return jdResp, err +} + +/* 查询镜像的实例规格限制。
+通过此接口可以查看镜像不支持的实例规格。只有官方镜像、第三方镜像有实例规格的限制,个人的私有镜像没有此限制。 + */ +func (c *VmClient) DescribeImageConstraints(request *vm.DescribeImageConstraintsRequest) (*vm.DescribeImageConstraintsResponse, error) { + if request == nil { + return nil, errors.New("Request object is nil. ") + } + resp, err := c.Send(request, c.ServiceName) + if err != nil { + return nil, err + } + + jdResp := &vm.DescribeImageConstraintsResponse{} + err = json.Unmarshal(resp, jdResp) + if err != nil { + c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) + return nil, err + } + + return jdResp, err +} + +/* 获取云主机vnc,用于连接管理云主机。
+vnc地址的有效期为1个小时,调用接口获取vnc地址后如果1个小时内没有使用,vnc地址自动失效,再次使用需要重新获取。 + */ +func (c *VmClient) DescribeInstanceVncUrl(request *vm.DescribeInstanceVncUrlRequest) (*vm.DescribeInstanceVncUrlResponse, error) { + if request == nil { + return nil, errors.New("Request object is nil. ") + } + resp, err := c.Send(request, c.ServiceName) + if err != nil { + return nil, err + } + + jdResp := &vm.DescribeInstanceVncUrlResponse{} + err = json.Unmarshal(resp, jdResp) + if err != nil { + c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) + return nil, err + } + + return jdResp, err +} + +/* 云主机使用指定镜像重置云主机系统
+云主机的状态必须为stopped状态。
+若当前云主机的系统盘类型为local类型,那么更换的镜像必须为localDisk类型的镜像;同理若当前云主机的系统盘为cloud类型,那么更换的镜像必须为cloudDisk类型的镜像。可查询DescribeImages接口获得指定地域的镜像信息。
+若不指定镜像ID,默认使用当前主机的原镜像重置系统。
+指定的镜像必须能够支持当前主机的实例规格(instanceType),否则会返回错误。可查询DescribeImageConstraints接口获得指定镜像支持的系统盘类型信息。 + */ +func (c *VmClient) RebuildInstance(request *vm.RebuildInstanceRequest) (*vm.RebuildInstanceResponse, error) { + if request == nil { + return nil, errors.New("Request object is nil. ") + } + resp, err := c.Send(request, c.ServiceName) + if err != nil { + return nil, err + } + + jdResp := &vm.RebuildInstanceResponse{} + err = json.Unmarshal(resp, jdResp) + if err != nil { + c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) + return nil, err + } + + return jdResp, err +} + +/* 取消共享镜像,只允许操作您的个人私有镜像。 + */ +func (c *VmClient) UnShareImage(request *vm.UnShareImageRequest) (*vm.UnShareImageResponse, error) { + if request == nil { + return nil, errors.New("Request object is nil. ") + } + resp, err := c.Send(request, c.ServiceName) + if err != nil { + return nil, err + } + + jdResp := &vm.UnShareImageResponse{} + err = json.Unmarshal(resp, jdResp) + if err != nil { + c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) + return nil, err + } + + return jdResp, err +} + +/* 修改云主机部分信息,包括名称、描述。 + */ +func (c *VmClient) ModifyInstanceAttribute(request *vm.ModifyInstanceAttributeRequest) (*vm.ModifyInstanceAttributeResponse, error) { + if request == nil { + return nil, errors.New("Request object is nil. ") + } + resp, err := c.Send(request, c.ServiceName) + if err != nil { + return nil, err + } + + jdResp := &vm.ModifyInstanceAttributeResponse{} + err = json.Unmarshal(resp, jdResp) + if err != nil { + c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) + return nil, err + } + + return jdResp, err +} + +/* 云主机变更实例规格
+云主机的状态必须为stopped状态。
+16年创建的云硬盘做系统盘的主机,一代与二代实例规格不允许相互调整。
+本地盘(local类型)做系统盘的主机,一代与二代实例规格不允许相互调整。
+使用高可用组(Ag)创建的主机,一代与二代实例规格不允许相互调整。
+云硬盘(cloud类型)做系统盘的主机,一代与二代实例规格允许相互调整。
+如果当前主机中的弹性网卡数量,大于新实例规格允许的弹性网卡数量,会返回错误。可查询DescribeInstanceTypes接口获得指定地域及可用区下的实例规格信息。
+当前主机所使用的镜像,需要支持要变更的目标实例规格,否则返回错误。可查询DescribeImageConstraints接口获得指定镜像的实例规格限制信息。
+云主机欠费或到期时,无法更改实例规格。 + */ +func (c *VmClient) ResizeInstance(request *vm.ResizeInstanceRequest) (*vm.ResizeInstanceResponse, error) { + if request == nil { + return nil, errors.New("Request object is nil. ") + } + resp, err := c.Send(request, c.ServiceName) + if err != nil { + return nil, err + } + + jdResp := &vm.ResizeInstanceResponse{} + err = json.Unmarshal(resp, jdResp) + if err != nil { + c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) + return nil, err + } + + return jdResp, err +} + +/* 批量查询镜像的实例规格限制。
+通过此接口可以查看镜像不支持的实例规格。只有官方镜像、第三方镜像有实例规格的限制,个人的私有镜像没有此限制。 + */ +func (c *VmClient) DescribeImageConstraintsBatch(request *vm.DescribeImageConstraintsBatchRequest) (*vm.DescribeImageConstraintsBatchResponse, error) { + if request == nil { + return nil, errors.New("Request object is nil. ") + } + resp, err := c.Send(request, c.ServiceName) + if err != nil { + return nil, err + } + + jdResp := &vm.DescribeImageConstraintsBatchResponse{} + err = json.Unmarshal(resp, jdResp) + if err != nil { + c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) + return nil, err + } + + return jdResp, err +} + +/* 为一台云主机挂载一块数据盘(云硬盘),云主机和云硬盘没有正在进行中的的任务时才可挂载。
+云主机状态必须是runningstopped状态。
+本地盘(local类型)做系统盘的云主机可挂载8块数据盘,云硬盘(cloud类型)做系统盘的云主机可挂载7块数据盘。 + */ +func (c *VmClient) AttachDisk(request *vm.AttachDiskRequest) (*vm.AttachDiskResponse, error) { + if request == nil { + return nil, errors.New("Request object is nil. ") + } + resp, err := c.Send(request, c.ServiceName) + if err != nil { + return nil, err + } + + jdResp := &vm.AttachDiskResponse{} + err = json.Unmarshal(resp, jdResp) + if err != nil { + c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) + return nil, err + } + + return jdResp, err +} + +/* 修改云主机密码,主机没有正在进行中的任务时才可操作。
+修改密码后,需要重启云主机后生效。 + */ +func (c *VmClient) ModifyInstancePassword(request *vm.ModifyInstancePasswordRequest) (*vm.ModifyInstancePasswordResponse, error) { + if request == nil { + return nil, errors.New("Request object is nil. ") + } + resp, err := c.Send(request, c.ServiceName) + if err != nil { + return nil, err + } + + jdResp := &vm.ModifyInstancePasswordResponse{} + err = json.Unmarshal(resp, jdResp) + if err != nil { + c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) + return nil, err + } + + return jdResp, err +} + +/* 删除一个私有镜像,只允许操作您的个人私有镜像。
+若镜像已共享给其他用户,需先取消共享才可删除。 + */ +func (c *VmClient) DeleteImage(request *vm.DeleteImageRequest) (*vm.DeleteImageResponse, error) { + if request == nil { + return nil, errors.New("Request object is nil. ") + } + resp, err := c.Send(request, c.ServiceName) + if err != nil { + return nil, err + } + + jdResp := &vm.DeleteImageResponse{} + err = json.Unmarshal(resp, jdResp) + if err != nil { + c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) + return nil, err + } + + return jdResp, err +} + +/* 查询实例规格信息列表 + */ +func (c *VmClient) DescribeInstanceTypes(request *vm.DescribeInstanceTypesRequest) (*vm.DescribeInstanceTypesResponse, error) { + if request == nil { + return nil, errors.New("Request object is nil. ") + } + resp, err := c.Send(request, c.ServiceName) + if err != nil { + return nil, err + } + + jdResp := &vm.DescribeInstanceTypesResponse{} + err = json.Unmarshal(resp, jdResp) + if err != nil { + c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) + return nil, err + } + + return jdResp, err +} + +/* 云主机挂载一块弹性网卡。
+云主机状态必须为runningstopped状态,并且没有正在进行中的任务才可操作。
+弹性网卡上如果绑定了公网IP,那么公网IP所在az需要与云主机的az保持一致,或者公网IP属于全可用区,才可挂载。
+云主机挂载弹性网卡的数量,不能超过实例规格的限制。可查询DescribeInstanceTypes接口获得指定规格可挂载弹性网卡的数量上限。
+弹性网卡与云主机必须在相同vpc下。 + */ +func (c *VmClient) AttachNetworkInterface(request *vm.AttachNetworkInterfaceRequest) (*vm.AttachNetworkInterfaceResponse, error) { + if request == nil { + return nil, errors.New("Request object is nil. ") + } + resp, err := c.Send(request, c.ServiceName) + if err != nil { + return nil, err + } + + jdResp := &vm.AttachNetworkInterfaceResponse{} + err = json.Unmarshal(resp, jdResp) + if err != nil { + c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) + return nil, err + } + + return jdResp, err +} + +/* 删除ssh密钥对。 + */ +func (c *VmClient) DeleteKeypair(request *vm.DeleteKeypairRequest) (*vm.DeleteKeypairResponse, error) { + if request == nil { + return nil, errors.New("Request object is nil. ") + } + resp, err := c.Send(request, c.ServiceName) + if err != nil { + return nil, err + } + + jdResp := &vm.DeleteKeypairResponse{} + err = json.Unmarshal(resp, jdResp) + if err != nil { + c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) + return nil, err + } + + return jdResp, err +} + +/* 查询镜像详情。 + */ +func (c *VmClient) DescribeImage(request *vm.DescribeImageRequest) (*vm.DescribeImageResponse, error) { + if request == nil { + return nil, errors.New("Request object is nil. ") + } + resp, err := c.Send(request, c.ServiceName) + if err != nil { + return nil, err + } + + jdResp := &vm.DescribeImageResponse{} + err = json.Unmarshal(resp, jdResp) + if err != nil { + c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) + return nil, err + } + + return jdResp, err +} + +/* 云主机缷载一块弹性网卡。
+云主机状态必须为runningstopped状态,并且没有正在进行中的任务才可操作。
+不能缷载主网卡。 + */ +func (c *VmClient) DetachNetworkInterface(request *vm.DetachNetworkInterfaceRequest) (*vm.DetachNetworkInterfaceResponse, error) { + if request == nil { + return nil, errors.New("Request object is nil. ") + } + resp, err := c.Send(request, c.ServiceName) + if err != nil { + return nil, err + } + + jdResp := &vm.DetachNetworkInterfaceResponse{} + err = json.Unmarshal(resp, jdResp) + if err != nil { + c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) + return nil, err + } + + return jdResp, err +} + +/* 导入由其他工具生成的密钥对的公钥部分。
+若传入已存在的密钥名称,会返回错误。 + */ +func (c *VmClient) ImportKeypair(request *vm.ImportKeypairRequest) (*vm.ImportKeypairResponse, error) { + if request == nil { + return nil, errors.New("Request object is nil. ") + } + resp, err := c.Send(request, c.ServiceName) + if err != nil { + return nil, err + } + + jdResp := &vm.ImportKeypairResponse{} + err = json.Unmarshal(resp, jdResp) + if err != nil { + c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) + return nil, err + } + + return jdResp, err +} + +/* 镜像跨区复制,将私有镜像复制到其它地域下,只允许操作您的个人私有镜像。
+只支持rootDeviceType为cloudDisk的云硬盘系统盘镜像操作。 + */ +func (c *VmClient) CopyImages(request *vm.CopyImagesRequest) (*vm.CopyImagesResponse, error) { + if request == nil { + return nil, errors.New("Request object is nil. ") + } + resp, err := c.Send(request, c.ServiceName) + if err != nil { + return nil, err + } + + jdResp := &vm.CopyImagesResponse{} + err = json.Unmarshal(resp, jdResp) + if err != nil { + c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) + return nil, err + } + + return jdResp, err +} + +/* 查询一台云主机的详细信息 + */ +func (c *VmClient) DescribeInstance(request *vm.DescribeInstanceRequest) (*vm.DescribeInstanceResponse, error) { + if request == nil { + return nil, errors.New("Request object is nil. ") + } + resp, err := c.Send(request, c.ServiceName) + if err != nil { + return nil, err + } + + jdResp := &vm.DescribeInstanceResponse{} + err = json.Unmarshal(resp, jdResp) + if err != nil { + c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) + return nil, err + } + + return jdResp, err +} + +/* 修改虚机弹性网卡属性,包括是否随云主机一起删除。
+不能修改主网卡。 + */ +func (c *VmClient) ModifyInstanceNetworkAttribute(request *vm.ModifyInstanceNetworkAttributeRequest) (*vm.ModifyInstanceNetworkAttributeResponse, error) { + if request == nil { + return nil, errors.New("Request object is nil. ") + } + resp, err := c.Send(request, c.ServiceName) + if err != nil { + return nil, err + } + + jdResp := &vm.ModifyInstanceNetworkAttributeResponse{} + err = json.Unmarshal(resp, jdResp) + if err != nil { + c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) + return nil, err + } + + return jdResp, err +} + +/* 查询配额,支持:云主机、镜像、密钥、模板、镜像共享 + */ +func (c *VmClient) DescribeQuotas(request *vm.DescribeQuotasRequest) (*vm.DescribeQuotasResponse, error) { + if request == nil { + return nil, errors.New("Request object is nil. ") + } + resp, err := c.Send(request, c.ServiceName) + if err != nil { + return nil, err + } + + jdResp := &vm.DescribeQuotasResponse{} + err = json.Unmarshal(resp, jdResp) + if err != nil { + c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) + return nil, err + } + + return jdResp, err +} + +/* 修改镜像信息,包括名称、描述;只允许操作您的个人私有镜像。 + */ +func (c *VmClient) ModifyImageAttribute(request *vm.ModifyImageAttributeRequest) (*vm.ModifyImageAttributeResponse, error) { + if request == nil { + return nil, errors.New("Request object is nil. ") + } + resp, err := c.Send(request, c.ServiceName) + if err != nil { + return nil, err + } + + jdResp := &vm.ModifyImageAttributeResponse{} + err = json.Unmarshal(resp, jdResp) + if err != nil { + c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) + return nil, err + } + + return jdResp, err +} + +/* 重启单个云主机,只能重启running状态的云主机,云主机没有正在进行中的任务才可重启。 + */ +func (c *VmClient) RebootInstance(request *vm.RebootInstanceRequest) (*vm.RebootInstanceResponse, error) { + if request == nil { + return nil, errors.New("Request object is nil. ") + } + resp, err := c.Send(request, c.ServiceName) + if err != nil { + return nil, err + } + + jdResp := &vm.RebootInstanceResponse{} + err = json.Unmarshal(resp, jdResp) + if err != nil { + c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) + return nil, err + } + + return jdResp, err +} + +/* 修改云主机挂载的数据盘属性,包括是否随主机删除。 + */ +func (c *VmClient) ModifyInstanceDiskAttribute(request *vm.ModifyInstanceDiskAttributeRequest) (*vm.ModifyInstanceDiskAttributeResponse, error) { + if request == nil { + return nil, errors.New("Request object is nil. ") + } + resp, err := c.Send(request, c.ServiceName) + if err != nil { + return nil, err + } + + jdResp := &vm.ModifyInstanceDiskAttributeResponse{} + err = json.Unmarshal(resp, jdResp) + if err != nil { + c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) + return nil, err + } + + return jdResp, err +} + +/* 批量查询云主机内网IP地址,查询的是主网卡内网主IP地址。 */ +func (c *VmClient) DescribeInstancePrivateIpAddress(request *vm.DescribeInstancePrivateIpAddressRequest) (*vm.DescribeInstancePrivateIpAddressResponse, error) { + if request == nil { + return nil, errors.New("Request object is nil. ") + } + resp, err := c.Send(request, c.ServiceName) + if err != nil { + return nil, err + } + + jdResp := &vm.DescribeInstancePrivateIpAddressResponse{} + err = json.Unmarshal(resp, jdResp) + if err != nil { + c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) + return nil, err + } + + return jdResp, err +} + +/* 批量查询云主机状态 */ +func (c *VmClient) DescribeInstanceStatus(request *vm.DescribeInstanceStatusRequest) (*vm.DescribeInstanceStatusResponse, error) { + if request == nil { + return nil, errors.New("Request object is nil. ") + } + resp, err := c.Send(request, c.ServiceName) + if err != nil { + return nil, err + } + + jdResp := &vm.DescribeInstanceStatusResponse{} + err = json.Unmarshal(resp, jdResp) + if err != nil { + c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) + return nil, err + } + + return jdResp, err +} + +/* 批量查询密钥对。
+此接口支持分页查询,默认每页20条。 + */ +func (c *VmClient) DescribeKeypairs(request *vm.DescribeKeypairsRequest) (*vm.DescribeKeypairsResponse, error) { + if request == nil { + return nil, errors.New("Request object is nil. ") + } + resp, err := c.Send(request, c.ServiceName) + if err != nil { + return nil, err + } + + jdResp := &vm.DescribeKeypairsResponse{} + err = json.Unmarshal(resp, jdResp) + if err != nil { + c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) + return nil, err + } + + return jdResp, err +} + +/* 云主机缷载数据盘,云主机和云硬盘没有正在进行中的任务时才可缷载。
+ */ +func (c *VmClient) DetachDisk(request *vm.DetachDiskRequest) (*vm.DetachDiskResponse, error) { + if request == nil { + return nil, errors.New("Request object is nil. ") + } + resp, err := c.Send(request, c.ServiceName) + if err != nil { + return nil, err + } + + jdResp := &vm.DetachDiskResponse{} + err = json.Unmarshal(resp, jdResp) + if err != nil { + c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) + return nil, err + } + + return jdResp, err +} + +/* 删除按配置计费、或包年包月已到期的单个云主机。不能删除没有计费信息的云主机。
+云主机状态必须为运行running、停止stopped、错误error,同时云主机没有正在进行中的任务才可删除。
+包年包月未到期的云主机不能删除。
+如果主机中挂载的数据盘为按配置计费的云硬盘,并且不是共享型云硬盘,并且AutoDelete属性为true,那么数据盘会随主机一起删除。 + [MFA enabled] */ +func (c *VmClient) DeleteInstance(request *vm.DeleteInstanceRequest) (*vm.DeleteInstanceResponse, error) { + if request == nil { + return nil, errors.New("Request object is nil. ") + } + resp, err := c.Send(request, c.ServiceName) + if err != nil { + return nil, err + } + + jdResp := &vm.DeleteInstanceResponse{} + err = json.Unmarshal(resp, jdResp) + if err != nil { + c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) + return nil, err + } + + return jdResp, err +} + +/* 批量查询云主机的详细信息
+此接口支持分页查询,默认每页20条。 + */ +func (c *VmClient) DescribeInstances(request *vm.DescribeInstancesRequest) (*vm.DescribeInstancesResponse, error) { + if request == nil { + return nil, errors.New("Request object is nil. ") + } + resp, err := c.Send(request, c.ServiceName) + if err != nil { + return nil, err + } + + jdResp := &vm.DescribeInstancesResponse{} + err = json.Unmarshal(resp, jdResp) + if err != nil { + c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) + return nil, err + } + + return jdResp, err +} + +/* 创建ssh密钥对。公钥部分存储在京东云,并返回未加密的 PEM 编码的 PKCS#8 格式私钥,您只有一次机会保存您的私钥。请妥善保管。
+若传入已存在的密钥名称,会返回错误。 + */ +func (c *VmClient) CreateKeypair(request *vm.CreateKeypairRequest) (*vm.CreateKeypairResponse, error) { + if request == nil { + return nil, errors.New("Request object is nil. ") + } + resp, err := c.Send(request, c.ServiceName) + if err != nil { + return nil, err + } + + jdResp := &vm.CreateKeypairResponse{} + err = json.Unmarshal(resp, jdResp) + if err != nil { + c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) + return nil, err + } + + return jdResp, err +} + diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/Ag.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/Ag.go new file mode 100644 index 000000000..2e2d48e6a --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/Ag.go @@ -0,0 +1,27 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package models + + +type Ag struct { + + /* 高可用组名称 (Optional) */ + Name string `json:"name"` + + /* 高可用组id (Optional) */ + Id string `json:"id"` +} diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/CopyImage.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/CopyImage.go new file mode 100644 index 000000000..43332d8c5 --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/CopyImage.go @@ -0,0 +1,27 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package models + + +type CopyImage struct { + + /* 复制后的目标镜像ID (Optional) */ + DestinationImageId string `json:"destinationImageId"` + + /* 源镜像ID (Optional) */ + SourceImageId string `json:"sourceImageId"` +} diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/Gpu.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/Gpu.go new file mode 100644 index 000000000..4755199be --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/Gpu.go @@ -0,0 +1,27 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package models + + +type Gpu struct { + + /* GPU型号 (Optional) */ + Model string `json:"model"` + + /* GPU数量 (Optional) */ + Number int `json:"number"` +} diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/Image.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/Image.go new file mode 100644 index 000000000..70e7a6d95 --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/Image.go @@ -0,0 +1,72 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package models + + +type Image struct { + + /* 镜像ID (Optional) */ + ImageId string `json:"imageId"` + + /* 镜像名称 (Optional) */ + Name string `json:"name"` + + /* 镜像的操作系统发行版。取值:Ubuntu,CentOS,Windows Server (Optional) */ + Platform string `json:"platform"` + + /* 镜像的操作系统版本。 (Optional) */ + OsVersion string `json:"osVersion"` + + /* 镜像架构。取值:i386,x86_64 (Optional) */ + Architecture string `json:"architecture"` + + /* 镜像系统盘大小 (Optional) */ + SystemDiskSizeGB int `json:"systemDiskSizeGB"` + + /* 镜像来源。取值:jcloud:官方镜像;marketplace:镜像市场镜像;self:用户自己的镜像;shared:其他用户分享的镜像 (Optional) */ + ImageSource string `json:"imageSource"` + + /* 镜像的操作系统类型。取值:windows,linux (Optional) */ + OsType string `json:"osType"` + + /* 参考镜像状态 (Optional) */ + Status string `json:"status"` + + /* 创建时间 (Optional) */ + CreateTime string `json:"createTime"` + + /* 镜像文件实际大小 (Optional) */ + SizeMB int `json:"sizeMB"` + + /* 镜像描述 (Optional) */ + Desc string `json:"desc"` + + /* 镜像系统盘配置 (Optional) */ + SystemDisk InstanceDiskAttachment `json:"systemDisk"` + + /* 镜像数据盘映射信息 (Optional) */ + DataDisks []InstanceDiskAttachment `json:"dataDisks"` + + /* 创建云盘系统盘所使用的云硬盘快照ID。系统盘类型为本地盘的镜像,此参数为空。 (Optional) */ + SnapshotId string `json:"snapshotId"` + + /* 镜像支持的系统盘类型。取值:localDisk:本地盘系统盘;cloudDisk:云盘系统盘。 (Optional) */ + RootDeviceType string `json:"rootDeviceType"` + + /* 镜像复制和转换时的进度,仅显示数值,单位为百分比 (Optional) */ + Progress string `json:"progress"` +} diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/ImageConstraint.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/ImageConstraint.go new file mode 100644 index 000000000..66bca6972 --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/ImageConstraint.go @@ -0,0 +1,27 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package models + + +type ImageConstraint struct { + + /* 镜像ID (Optional) */ + ImageId string `json:"imageId"` + + /* 使用镜像创建实例的规格限制 (Optional) */ + ImageInstanceTypeConstraint ImageInstanceTypeConstraint `json:"imageInstanceTypeConstraint"` +} diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/ImageInstanceTypeConstraint.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/ImageInstanceTypeConstraint.go new file mode 100644 index 000000000..a53ef7835 --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/ImageInstanceTypeConstraint.go @@ -0,0 +1,27 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package models + + +type ImageInstanceTypeConstraint struct { + + /* 限制类型。取值:excludes:不支持的实例类型;includes:支持的实例类型。 (Optional) */ + ConstraintsType string `json:"constraintsType"` + + /* 实例规格列表 (Optional) */ + InstanceTypes []string `json:"instanceTypes"` +} diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/Instance.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/Instance.go new file mode 100644 index 000000000..c49c6471c --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/Instance.go @@ -0,0 +1,89 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package models + +import charge "github.com/jdcloud-api/jdcloud-sdk-go/services/charge/models" +import disk "github.com/jdcloud-api/jdcloud-sdk-go/services/disk/models" + +type Instance struct { + + /* 云主机ID (Optional) */ + InstanceId string `json:"instanceId"` + + /* 云主机名称 (Optional) */ + InstanceName string `json:"instanceName"` + + /* 实例规格 (Optional) */ + InstanceType string `json:"instanceType"` + + /* 主网卡所属VPC的ID (Optional) */ + VpcId string `json:"vpcId"` + + /* 主网卡所属子网的ID (Optional) */ + SubnetId string `json:"subnetId"` + + /* 主网卡主IP地址 (Optional) */ + PrivateIpAddress string `json:"privateIpAddress"` + + /* 主网卡主IP绑定弹性IP的ID (Optional) */ + ElasticIpId string `json:"elasticIpId"` + + /* 主网卡主IP绑定弹性IP的地址 (Optional) */ + ElasticIpAddress string `json:"elasticIpAddress"` + + /* 云主机状态,参考云主机状态 (Optional) */ + Status string `json:"status"` + + /* 云主机描述 (Optional) */ + Description string `json:"description"` + + /* 镜像ID (Optional) */ + ImageId string `json:"imageId"` + + /* 系统盘配置 (Optional) */ + SystemDisk InstanceDiskAttachment `json:"systemDisk"` + + /* 数据盘配置 (Optional) */ + DataDisks []InstanceDiskAttachment `json:"dataDisks"` + + /* 主网卡配置 (Optional) */ + PrimaryNetworkInterface InstanceNetworkInterfaceAttachment `json:"primaryNetworkInterface"` + + /* 辅助网卡配置 (Optional) */ + SecondaryNetworkInterfaces []InstanceNetworkInterfaceAttachment `json:"secondaryNetworkInterfaces"` + + /* 创建时间 (Optional) */ + LaunchTime string `json:"launchTime"` + + /* 云主机所在可用区 (Optional) */ + Az string `json:"az"` + + /* 密钥对名称 (Optional) */ + KeyNames []string `json:"keyNames"` + + /* 计费信息 (Optional) */ + Charge charge.Charge `json:"charge"` + + /* 高可用组,如果创建云主机使用了高可用组,此处可展示高可用组名称 (Optional) */ + Ag Ag `json:"ag"` + + /* 高可用组中的错误域 (Optional) */ + FaultDomain string `json:"faultDomain"` + + /* Tag信息 (Optional) */ + Tags []disk.Tag `json:"tags"` +} diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/InstanceDiskAttachment.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/InstanceDiskAttachment.go new file mode 100644 index 000000000..33aa425e8 --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/InstanceDiskAttachment.go @@ -0,0 +1,46 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package models + +import disk "github.com/jdcloud-api/jdcloud-sdk-go/services/disk/models" + +type InstanceDiskAttachment struct { + + /* 磁盘分类,取值为本地盘(local)或者数据盘(cloud)。 +系统盘支持本地盘(local)或者云硬盘(cloud)。系统盘选择local类型,必须使用localDisk类型的镜像;同理系统盘选择cloud类型,必须使用cloudDisk类型的镜像。 +数据盘仅支持云硬盘(cloud)。 + (Optional) */ + DiskCategory string `json:"diskCategory"` + + /* 随云主机一起删除,删除主机时自动删除此磁盘,默认为true,本地盘(local)不能更改此值。 +如果云主机中的数据盘(cloud)是包年包月计费方式,此参数不生效。 +如果云主机中的数据盘(cloud)是共享型数据盘,此参数不生效。 + (Optional) */ + AutoDelete bool `json:"autoDelete"` + + /* 本地磁盘配置 (Optional) */ + LocalDisk LocalDisk `json:"localDisk"` + + /* 云硬盘配置 (Optional) */ + CloudDisk disk.Disk `json:"cloudDisk"` + + /* 数据盘逻辑挂载点,取值范围:vda,vdb,vdc,vdd,vde,vdf,vdg,vdh,vdi (Optional) */ + DeviceName string `json:"deviceName"` + + /* 数据盘挂载状态,取值范围:attaching,detaching,attached,detached,error_attach,error_detach (Optional) */ + Status string `json:"status"` +} diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/InstanceDiskAttachmentSpec.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/InstanceDiskAttachmentSpec.go new file mode 100644 index 000000000..452770331 --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/InstanceDiskAttachmentSpec.go @@ -0,0 +1,47 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package models + +import disk "github.com/jdcloud-api/jdcloud-sdk-go/services/disk/models" + +type InstanceDiskAttachmentSpec struct { + + /* 磁盘分类,取值为本地盘(local)或者云硬盘(cloud)。 +系统盘支持本地盘(local)或者云硬盘(cloud)。系统盘选择local类型,必须使用localDisk类型的镜像;同理系统盘选择cloud类型,必须使用cloudDisk类型的镜像。 +数据盘仅支持云硬盘(cloud)。 + (Optional) */ + DiskCategory *string `json:"diskCategory"` + + /* 是否随云主机一起删除,即删除主机时是否自动删除此磁盘,默认为true,本地盘(local)不能更改此值。 +如果云主机中的数据盘(cloud)是包年包月计费方式,此参数不生效。 +如果云主机中的数据盘(cloud)是共享型数据盘,此参数不生效。 + (Optional) */ + AutoDelete *bool `json:"autoDelete"` + + /* 数据盘配置 (Optional) */ + CloudDiskSpec *disk.DiskSpec `json:"cloudDiskSpec"` + + /* 数据盘逻辑挂载点,取值范围:vda,vdb,vdc,vdd,vde,vdf,vdg,vdh,vdi (Optional) */ + DeviceName *string `json:"deviceName"` + + /* 排除设备,使用此参数noDevice配合deviceName一起使用。 +创建整机镜像:如deviceName:vdb、noDevice:true,则表示云主机中的数据盘vdb不参与创建镜像。 +创建模板:如deviceName:vdb、noDevice:true,则表示镜像中的数据盘vdb不参与创建主机。 +创建主机:如deviceName:vdb、noDevice:true,则表示镜像中的数据盘vdb,或者模板(使用模板创建主机)中的数据盘vdb不参与创建主机。 + (Optional) */ + NoDevice *bool `json:"noDevice"` +} diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/InstanceDiskAttribute.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/InstanceDiskAttribute.go new file mode 100644 index 000000000..ef0197d39 --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/InstanceDiskAttribute.go @@ -0,0 +1,30 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package models + + +type InstanceDiskAttribute struct { + + /* 云硬盘ID (Optional) */ + DiskId *string `json:"diskId"` + + /* 随云主机一起删除,删除主机时自动删除此磁盘,默认为false,本地盘(local)不能更改此值。 +如果云主机中的数据盘(cloud)是包年包月计费方式,此参数不生效。 +如果云主机中的数据盘(cloud)是共享型数据盘,此参数不生效。 + (Optional) */ + AutoDelete *bool `json:"autoDelete"` +} diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/InstanceNetworkAttribute.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/InstanceNetworkAttribute.go new file mode 100644 index 000000000..c44383dc5 --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/InstanceNetworkAttribute.go @@ -0,0 +1,27 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package models + + +type InstanceNetworkAttribute struct { + + /* 弹性网卡ID (Optional) */ + NetworkInterfaceId *string `json:"networkInterfaceId"` + + /* 随主机自动删除,默认为False (Optional) */ + AutoDelete *bool `json:"autoDelete"` +} diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/InstanceNetworkInterface.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/InstanceNetworkInterface.go new file mode 100644 index 000000000..29af23e42 --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/InstanceNetworkInterface.go @@ -0,0 +1,46 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package models + +import vpc "github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models" + +type InstanceNetworkInterface struct { + + /* 弹性网卡ID (Optional) */ + NetworkInterfaceId string `json:"networkInterfaceId"` + + /* 以太网地址 (Optional) */ + MacAddress string `json:"macAddress"` + + /* 虚拟网络ID (Optional) */ + VpcId string `json:"vpcId"` + + /* 子网ID (Optional) */ + SubnetId string `json:"subnetId"` + + /* (Optional) */ + SecurityGroups []SecurityGroupSimple `json:"securityGroups"` + + /* 源和目标IP地址校验,取值为0或者1 (Optional) */ + SanityCheck int `json:"sanityCheck"` + + /* 网卡主IP (Optional) */ + PrimaryIp vpc.NetworkInterfacePrivateIp `json:"primaryIp"` + + /* 网卡辅IP (Optional) */ + SecondaryIps []vpc.NetworkInterfacePrivateIp `json:"secondaryIps"` +} diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/InstanceNetworkInterfaceAttachment.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/InstanceNetworkInterfaceAttachment.go new file mode 100644 index 000000000..2a8c79961 --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/InstanceNetworkInterfaceAttachment.go @@ -0,0 +1,30 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package models + + +type InstanceNetworkInterfaceAttachment struct { + + /* 设备Index (Optional) */ + DeviceIndex int `json:"deviceIndex"` + + /* 指明删除实例时是否删除网卡,默认true;当前只能是true (Optional) */ + AutoDelete bool `json:"autoDelete"` + + /* 网卡接口规范 (Optional) */ + NetworkInterface InstanceNetworkInterface `json:"networkInterface"` +} diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/InstanceNetworkInterfaceAttachmentSpec.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/InstanceNetworkInterfaceAttachmentSpec.go new file mode 100644 index 000000000..d6e11621b --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/InstanceNetworkInterfaceAttachmentSpec.go @@ -0,0 +1,28 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package models + +import vpc "github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models" + +type InstanceNetworkInterfaceAttachmentSpec struct { + + /* 网卡设备Index,主网卡只能是1 (Optional) */ + DeviceIndex *int `json:"deviceIndex"` + + /* 网卡接口规范 (Optional) */ + NetworkInterface *vpc.NetworkInterfaceSpec `json:"networkInterface"` +} diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/InstancePrivateIpAddress.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/InstancePrivateIpAddress.go new file mode 100644 index 000000000..6436045c2 --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/InstancePrivateIpAddress.go @@ -0,0 +1,27 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package models + + +type InstancePrivateIpAddress struct { + + /* 云主机ID (Optional) */ + InstanceId string `json:"instanceId"` + + /* 主网卡内网主IP地址 (Optional) */ + PrivateIpAddress string `json:"privateIpAddress"` +} diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/InstanceSpec.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/InstanceSpec.go new file mode 100644 index 000000000..5dc4861c5 --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/InstanceSpec.go @@ -0,0 +1,69 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package models + +import vpc "github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models" +import charge "github.com/jdcloud-api/jdcloud-sdk-go/services/charge/models" + +type InstanceSpec struct { + + /* 高可用组Id。指定了此参数后,只能通过高可用组关联的实例模板创建虚机,并且实例模板中的参数不可覆盖替换。实例模板以外的参数还可以指定。 (Optional) */ + AgId *string `json:"agId"` + + /* 实例模板id,如果没有使用高可用组,那么对于实例模板中没有的信息,需要使用创建虚机的参数进行补充,或者选择覆盖启动模板中的参数。 (Optional) */ + InstanceTemplateId *string `json:"instanceTemplateId"` + + /* 云主机所属的可用区。 (Optional) */ + Az *string `json:"az"` + + /* 实例规格。可查询DescribeInstanceTypes接口获得指定地域或可用区的规格信息。 (Optional) */ + InstanceType *string `json:"instanceType"` + + /* 镜像ID。可查询DescribeImages接口获得指定地域的镜像信息。 (Optional) */ + ImageId *string `json:"imageId"` + + /* 云主机名称,参考公共参数规范。 */ + Name string `json:"name"` + + /* 密码,参考公共参数规范。 (Optional) */ + Password *string `json:"password"` + + /* 密钥对名称,当前只支持传入一个。 (Optional) */ + KeyNames []string `json:"keyNames"` + + /* 主网卡主IP关联的弹性IP规格 (Optional) */ + ElasticIp *vpc.ElasticIpSpec `json:"elasticIp"` + + /* 主网卡配置信息 (Optional) */ + PrimaryNetworkInterface *InstanceNetworkInterfaceAttachmentSpec `json:"primaryNetworkInterface"` + + /* 系统盘配置信息 (Optional) */ + SystemDisk *InstanceDiskAttachmentSpec `json:"systemDisk"` + + /* 数据盘配置信息,本地盘(local类型)做系统盘的云主机可挂载8块数据盘,云硬盘(cloud类型)做系统盘的云主机可挂载7块数据盘。 (Optional) */ + DataDisks []InstanceDiskAttachmentSpec `json:"dataDisks"` + + /* 计费配置 +云主机不支持按用量方式计费,默认为按配置计费。 +打包创建数据盘的情况下,数据盘的计费方式只能与云主机保持一致。 +打包创建弹性公网IP的情况下,若公网IP的计费方式没有指定为按用量计费,那么公网IP计费方式只能与云主机保持一致。 + (Optional) */ + Charge *charge.ChargeSpec `json:"charge"` + + /* 主机描述,参考公共参数规范。 (Optional) */ + Description *string `json:"description"` +} diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/InstanceStatus.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/InstanceStatus.go new file mode 100644 index 000000000..3752f1930 --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/InstanceStatus.go @@ -0,0 +1,27 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package models + + +type InstanceStatus struct { + + /* 云主机ID (Optional) */ + InstanceId string `json:"instanceId"` + + /* 参考云主机状态 (Optional) */ + Status string `json:"status"` +} diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/InstanceTemplate.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/InstanceTemplate.go new file mode 100644 index 000000000..324918daf --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/InstanceTemplate.go @@ -0,0 +1,39 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package models + + +type InstanceTemplate struct { + + /* 启动模板ID (Optional) */ + Id string `json:"id"` + + /* 启动模板名称 (Optional) */ + Name string `json:"name"` + + /* 启动模板描述 (Optional) */ + Description string `json:"description"` + + /* 启动模板的数据 (Optional) */ + InstanceTemplateData InstanceTemplateData `json:"instanceTemplateData"` + + /* 关联的高可用组(ag)信息 (Optional) */ + Ags []Ag `json:"ags"` + + /* 创建时间 (Optional) */ + CreatedTime string `json:"createdTime"` +} diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/InstanceTemplateData.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/InstanceTemplateData.go new file mode 100644 index 000000000..025e481cd --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/InstanceTemplateData.go @@ -0,0 +1,48 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package models + + +type InstanceTemplateData struct { + + /* 实例规格 (Optional) */ + InstanceType string `json:"instanceType"` + + /* 主网卡所属VPC的ID (Optional) */ + VpcId string `json:"vpcId"` + + /* 镜像ID (Optional) */ + ImageId string `json:"imageId"` + + /* 启动模板中是否包含自定义密码,true:包含密码,false:不包含密码 (Optional) */ + IncludePassword bool `json:"includePassword"` + + /* 系统盘信息 (Optional) */ + SystemDisk InstanceTemplateDiskAttachment `json:"systemDisk"` + + /* 数据盘信息,本地盘(local类型)做系统盘的云主机可挂载8块数据盘,云硬盘(cloud类型)做系统盘的云主机可挂载7块数据盘。 (Optional) */ + DataDisks []InstanceTemplateDiskAttachment `json:"dataDisks"` + + /* 主网卡信息 (Optional) */ + PrimaryNetworkInterface InstanceTemplateNetworkInterfaceAttachmentSpec `json:"primaryNetworkInterface"` + + /* 主网卡主IP关联的弹性IP规格 (Optional) */ + ElasticIp InstanceTemplateElasticIp `json:"elasticIp"` + + /* 密钥对名称;当前只支持一个 (Optional) */ + KeyNames []string `json:"keyNames"` +} diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/InstanceTemplateDisk.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/InstanceTemplateDisk.go new file mode 100644 index 000000000..460df4513 --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/InstanceTemplateDisk.go @@ -0,0 +1,30 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package models + + +type InstanceTemplateDisk struct { + + /* 云硬盘类型,取值为 ssd 或 premium-hdd (Optional) */ + DiskType string `json:"diskType"` + + /* 云硬盘大小,单位为 GiB;ssd 类型取值范围[20,1000]GB,步长为10G,premium-hdd 类型取值范围[20,3000]GB,步长为10G (Optional) */ + DiskSizeGB int `json:"diskSizeGB"` + + /* 用于创建云硬盘的快照ID (Optional) */ + SnapshotId string `json:"snapshotId"` +} diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/InstanceTemplateDiskAttachment.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/InstanceTemplateDiskAttachment.go new file mode 100644 index 000000000..ca4db289a --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/InstanceTemplateDiskAttachment.go @@ -0,0 +1,46 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package models + + +type InstanceTemplateDiskAttachment struct { + + /* 磁盘分类,取值为本地盘(local)或者数据盘(cloud)。 +系统盘支持本地盘(local)或者云硬盘(cloud)。系统盘选择local类型,必须使用localDisk类型的镜像;同理系统盘选择cloud类型,必须使用cloudDisk类型的镜像。 +数据盘仅支持云硬盘(cloud)。 + (Optional) */ + DiskCategory string `json:"diskCategory"` + + /* 随云主机一起删除,删除主机时自动删除此磁盘,默认为true,本地盘(local)不能更改此值。 +如果云主机中的数据盘(cloud)是包年包月计费方式,此参数不生效。 +如果云主机中的数据盘(cloud)是共享型数据盘,此参数不生效。 + (Optional) */ + AutoDelete bool `json:"autoDelete"` + + /* 数据盘配置 (Optional) */ + InstanceTemplateDisk InstanceTemplateDisk `json:"instanceTemplateDisk"` + + /* 数据盘逻辑挂载点,取值范围:vda,vdb,vdc,vdd,vde,vdf,vdg,vdh,vdi。系统盘不需要使用,数据盘时才能够使用。 (Optional) */ + DeviceName string `json:"deviceName"` + + /* 排除设备,使用此参数noDevice配合deviceName一起使用。 +创建整机镜像:如deviceName:vdb、noDevice:true,则表示云主机中的数据盘vdb不参与创建镜像。 +创建模板:如deviceName:vdb、noDevice:true,则表示镜像中的数据盘vdb不参与创建主机。 +创建主机:如deviceName:vdb、noDevice:true,则表示镜像中的数据盘vdb,或者模板(使用模板创建主机)中的数据盘vdb不参与创建主机。 + (Optional) */ + NoDevice bool `json:"noDevice"` +} diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/InstanceTemplateDiskAttachmentSpec.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/InstanceTemplateDiskAttachmentSpec.go new file mode 100644 index 000000000..1a6746bd8 --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/InstanceTemplateDiskAttachmentSpec.go @@ -0,0 +1,44 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package models + + +type InstanceTemplateDiskAttachmentSpec struct { + + /* 磁盘分类,取值为本地盘(local)或者数据盘(cloud)。 +系统盘支持本地盘(local)或者云硬盘(cloud)。系统盘选择local类型,必须使用localDisk类型的镜像;同理系统盘选择cloud类型,必须使用cloudDisk类型的镜像。 +数据盘仅支持云硬盘(cloud)。 + (Optional) */ + DiskCategory string `json:"diskCategory"` + + /* 随云主机一起删除,删除主机时自动删除此磁盘,默认为true,本地盘(local)不能更改此值。 +如果云主机中的数据盘(cloud)是包年包月计费方式,此参数不生效。 +如果云主机中的数据盘(cloud)是共享型数据盘,此参数不生效。 + (Optional) */ + AutoDelete bool `json:"autoDelete"` + + /* 数据盘规格 (Optional) */ + CloudDiskSpec InstanceTemplateDiskSpec `json:"cloudDiskSpec"` + + /* 数据盘逻辑挂载点,取值范围:vda,vdb,vdc,vdd,vde,vdf,vdg,vdh,vdi (Optional) */ + DeviceName string `json:"deviceName"` + + /* 排除设备,使用此参数noDevice配合deviceName一起使用。 +创建模板:如deviceName:vdb、noDevice:true,则表示镜像中的数据盘vdb不参与创建主机。 + (Optional) */ + NoDevice bool `json:"noDevice"` +} diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/InstanceTemplateDiskSpec.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/InstanceTemplateDiskSpec.go new file mode 100644 index 000000000..b9784ffe7 --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/InstanceTemplateDiskSpec.go @@ -0,0 +1,30 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package models + + +type InstanceTemplateDiskSpec struct { + + /* 云硬盘类型,取值为 ssd 或 premium-hdd (Optional) */ + DiskType string `json:"diskType"` + + /* 云硬盘大小,单位为 GiB;ssd 类型取值范围[20,1000]GB,步长为10G,premium-hdd 类型取值范围[20,3000]GB,步长为10G (Optional) */ + DiskSizeGB int `json:"diskSizeGB"` + + /* 用于创建云硬盘的快照ID (Optional) */ + SnapshotId string `json:"snapshotId"` +} diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/InstanceTemplateElasticIp.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/InstanceTemplateElasticIp.go new file mode 100644 index 000000000..b6db16956 --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/InstanceTemplateElasticIp.go @@ -0,0 +1,30 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package models + + +type InstanceTemplateElasticIp struct { + + /* 弹性公网IP的限速(单位:MB) */ + BandwidthMbps int `json:"bandwidthMbps"` + + /* IP服务商,取值为BGP,nonBGP (Optional) */ + Provider string `json:"provider"` + + /* 计费类型,支持按带宽计费(bandwith),按流量计费(flow) */ + ChargeMode string `json:"chargeMode"` +} diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/InstanceTemplateElasticIpSpec.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/InstanceTemplateElasticIpSpec.go new file mode 100644 index 000000000..8ef4e0061 --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/InstanceTemplateElasticIpSpec.go @@ -0,0 +1,30 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package models + + +type InstanceTemplateElasticIpSpec struct { + + /* 弹性公网IP的限速(单位:MB) */ + BandwidthMbps int `json:"bandwidthMbps"` + + /* IP服务商,取值为BGP,nonBGP (Optional) */ + Provider string `json:"provider"` + + /* 计费类型,支持按带宽计费(bandwith),按流量计费(flow) */ + ChargeMode string `json:"chargeMode"` +} diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/InstanceTemplateNetworkInterfaceAttachmentSpec.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/InstanceTemplateNetworkInterfaceAttachmentSpec.go new file mode 100644 index 000000000..755410d02 --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/InstanceTemplateNetworkInterfaceAttachmentSpec.go @@ -0,0 +1,30 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package models + + +type InstanceTemplateNetworkInterfaceAttachmentSpec struct { + + /* 设备Index;主网卡的index必须为1;当前仅支持主网卡 (Optional) */ + DeviceIndex int `json:"deviceIndex"` + + /* 指明删除实例时是否删除网卡,默认true;当前只能是true (Optional) */ + AutoDelete bool `json:"autoDelete"` + + /* 网卡接口规范;此字段当前必填 */ + NetworkInterface InstanceTemplateNetworkInterfaceSpec `json:"networkInterface"` +} diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/InstanceTemplateNetworkInterfaceSpec.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/InstanceTemplateNetworkInterfaceSpec.go new file mode 100644 index 000000000..84ee385bf --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/InstanceTemplateNetworkInterfaceSpec.go @@ -0,0 +1,30 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package models + + +type InstanceTemplateNetworkInterfaceSpec struct { + + /* 子网ID */ + SubnetId string `json:"subnetId"` + + /* 安全组ID列表 (Optional) */ + SecurityGroups []string `json:"securityGroups"` + + /* PortSecurity,取值为0或者1,默认为1 (Optional) */ + SanityCheck int `json:"sanityCheck"` +} diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/InstanceTemplateSpec.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/InstanceTemplateSpec.go new file mode 100644 index 000000000..1eb5b7a7b --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/InstanceTemplateSpec.go @@ -0,0 +1,45 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package models + + +type InstanceTemplateSpec struct { + + /* 实例规格,可查询DescribeInstanceTypes接口获得指定地域或可用区的规格信息。 */ + InstanceType string `json:"instanceType"` + + /* 镜像ID,可查询DescribeImages接口获得指定地域的镜像信息。 */ + ImageId string `json:"imageId"` + + /* 密码,参考公共参数规范。 (Optional) */ + Password string `json:"password"` + + /* 密钥对名称;当前只支持一个 (Optional) */ + KeyNames []string `json:"keyNames"` + + /* 主网卡主IP关联的弹性IP规格 (Optional) */ + ElasticIp InstanceTemplateElasticIpSpec `json:"elasticIp"` + + /* 主网卡配置信息 */ + PrimaryNetworkInterface InstanceTemplateNetworkInterfaceAttachmentSpec `json:"primaryNetworkInterface"` + + /* 系统盘配置信息 */ + SystemDisk InstanceTemplateDiskAttachmentSpec `json:"systemDisk"` + + /* 数据盘配置信息 (Optional) */ + DataDisks []InstanceTemplateDiskAttachmentSpec `json:"dataDisks"` +} diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/InstanceType.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/InstanceType.go new file mode 100644 index 000000000..dbe403b20 --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/InstanceType.go @@ -0,0 +1,48 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package models + + +type InstanceType struct { + + /* 实例规格类型 (Optional) */ + Family string `json:"family"` + + /* 实例规格,比如g.b1.2xlarge (Optional) */ + InstanceType string `json:"instanceType"` + + /* cpu个数 (Optional) */ + Cpu int `json:"cpu"` + + /* 内存大小 (Optional) */ + MemoryMB int `json:"memoryMB"` + + /* 支持弹性网卡的数量 (Optional) */ + NicLimit int `json:"nicLimit"` + + /* 描述 (Optional) */ + Desc string `json:"desc"` + + /* 规格状态 (Optional) */ + State []InstanceTypeState `json:"state"` + + /* Gpu配置 (Optional) */ + Gpu Gpu `json:"gpu"` + + /* 本地缓存盘配置,目前只有Gpu规格上才有 (Optional) */ + LocalDisks []LocalDisk `json:"localDisks"` +} diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/InstanceTypeState.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/InstanceTypeState.go new file mode 100644 index 000000000..e047de43e --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/InstanceTypeState.go @@ -0,0 +1,27 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package models + + +type InstanceTypeState struct { + + /* 可用区 (Optional) */ + Az string `json:"az"` + + /* 可售卖情况,true:可售卖、false:已售罄不可用 (Optional) */ + InStock bool `json:"inStock"` +} diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/Keypair.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/Keypair.go new file mode 100644 index 000000000..05c7ae891 --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/Keypair.go @@ -0,0 +1,30 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package models + + +type Keypair struct { + + /* 密钥对名称 (Optional) */ + KeyName string `json:"keyName"` + + /* 密钥对的指纹,根据 RFC4716 定义的公钥指纹格式,采用 MD5 信息摘要算法。 (Optional) */ + KeyFingerprint string `json:"keyFingerprint"` + + /* 创建时间 (Optional) */ + CreateTime string `json:"createTime"` +} diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/LocalDisk.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/LocalDisk.go new file mode 100644 index 000000000..740e65288 --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/LocalDisk.go @@ -0,0 +1,27 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package models + + +type LocalDisk struct { + + /* 磁盘类型,取值范围{premium-hdd, ssd} (Optional) */ + DiskType string `json:"diskType"` + + /* 磁盘大小 (Optional) */ + DiskSizeGB int `json:"diskSizeGB"` +} diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/Quota.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/Quota.go new file mode 100644 index 000000000..4d7f16df6 --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/Quota.go @@ -0,0 +1,30 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package models + + +type Quota struct { + + /* 资源类型[instance,keypair,image,instanceTemplate] (Optional) */ + ResourceType string `json:"resourceType"` + + /* 配额上限 (Optional) */ + Limit int `json:"limit"` + + /* 已用配额 (Optional) */ + Used int `json:"used"` +} diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/SecurityGroupSimple.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/SecurityGroupSimple.go new file mode 100644 index 000000000..17e221b6e --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/SecurityGroupSimple.go @@ -0,0 +1,27 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package models + + +type SecurityGroupSimple struct { + + /* 安全组ID (Optional) */ + GroupId string `json:"groupId"` + + /* 安全组名称 (Optional) */ + GroupName string `json:"groupName"` +} diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/Tag.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/Tag.go new file mode 100644 index 000000000..467465457 --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/Tag.go @@ -0,0 +1,27 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package models + + +type Tag struct { + + /* Tag键 (Optional) */ + Key string `json:"key"` + + /* Tag值 (Optional) */ + Value string `json:"value"` +} diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/TagFilter.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/TagFilter.go new file mode 100644 index 000000000..13daa19a1 --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/TagFilter.go @@ -0,0 +1,27 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package models + + +type TagFilter struct { + + /* Tag键 (Optional) */ + Key string `json:"key"` + + /* Tag值 (Optional) */ + Values []string `json:"values"` +} diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/AddNetworkAclRules.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/AddNetworkAclRules.go new file mode 100644 index 000000000..9f52c7283 --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/AddNetworkAclRules.go @@ -0,0 +1,129 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package apis + +import ( + "github.com/jdcloud-api/jdcloud-sdk-go/core" + vpc "github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models" +) + +type AddNetworkAclRulesRequest struct { + + core.JDCloudRequest + + /* Region ID */ + RegionId string `json:"regionId"` + + /* networkAclId ID */ + NetworkAclId string `json:"networkAclId"` + + /* networkAcl规则列表 */ + NetworkAclRuleSpecs []vpc.AddNetworkAclRuleSpec `json:"networkAclRuleSpecs"` +} + +/* + * param regionId: Region ID (Required) + * param networkAclId: networkAclId ID (Required) + * param networkAclRuleSpecs: networkAcl规则列表 (Required) + * + * @Deprecated, not compatible when mandatory parameters changed + */ +func NewAddNetworkAclRulesRequest( + regionId string, + networkAclId string, + networkAclRuleSpecs []vpc.AddNetworkAclRuleSpec, +) *AddNetworkAclRulesRequest { + + return &AddNetworkAclRulesRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/networkAcls/{networkAclId}:addNetworkAclRules", + Method: "POST", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + NetworkAclId: networkAclId, + NetworkAclRuleSpecs: networkAclRuleSpecs, + } +} + +/* + * param regionId: Region ID (Required) + * param networkAclId: networkAclId ID (Required) + * param networkAclRuleSpecs: networkAcl规则列表 (Required) + */ +func NewAddNetworkAclRulesRequestWithAllParams( + regionId string, + networkAclId string, + networkAclRuleSpecs []vpc.AddNetworkAclRuleSpec, +) *AddNetworkAclRulesRequest { + + return &AddNetworkAclRulesRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/networkAcls/{networkAclId}:addNetworkAclRules", + Method: "POST", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + NetworkAclId: networkAclId, + NetworkAclRuleSpecs: networkAclRuleSpecs, + } +} + +/* This constructor has better compatible ability when API parameters changed */ +func NewAddNetworkAclRulesRequestWithoutParam() *AddNetworkAclRulesRequest { + + return &AddNetworkAclRulesRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/networkAcls/{networkAclId}:addNetworkAclRules", + Method: "POST", + Header: nil, + Version: "v1", + }, + } +} + +/* param regionId: Region ID(Required) */ +func (r *AddNetworkAclRulesRequest) SetRegionId(regionId string) { + r.RegionId = regionId +} + +/* param networkAclId: networkAclId ID(Required) */ +func (r *AddNetworkAclRulesRequest) SetNetworkAclId(networkAclId string) { + r.NetworkAclId = networkAclId +} + +/* param networkAclRuleSpecs: networkAcl规则列表(Required) */ +func (r *AddNetworkAclRulesRequest) SetNetworkAclRuleSpecs(networkAclRuleSpecs []vpc.AddNetworkAclRuleSpec) { + r.NetworkAclRuleSpecs = networkAclRuleSpecs +} + +// GetRegionId returns path parameter 'regionId' if exist, +// otherwise return empty string +func (r AddNetworkAclRulesRequest) GetRegionId() string { + return r.RegionId +} + +type AddNetworkAclRulesResponse struct { + RequestID string `json:"requestId"` + Error core.ErrorResponse `json:"error"` + Result AddNetworkAclRulesResult `json:"result"` +} + +type AddNetworkAclRulesResult struct { +} \ No newline at end of file diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/AddNetworkSecurityGroupRules.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/AddNetworkSecurityGroupRules.go new file mode 100644 index 000000000..e4f635018 --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/AddNetworkSecurityGroupRules.go @@ -0,0 +1,129 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package apis + +import ( + "github.com/jdcloud-api/jdcloud-sdk-go/core" + vpc "github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models" +) + +type AddNetworkSecurityGroupRulesRequest struct { + + core.JDCloudRequest + + /* Region ID */ + RegionId string `json:"regionId"` + + /* NetworkSecurityGroup ID */ + NetworkSecurityGroupId string `json:"networkSecurityGroupId"` + + /* 安全组规则信息 */ + NetworkSecurityGroupRuleSpecs []vpc.AddSecurityGroupRules `json:"networkSecurityGroupRuleSpecs"` +} + +/* + * param regionId: Region ID (Required) + * param networkSecurityGroupId: NetworkSecurityGroup ID (Required) + * param networkSecurityGroupRuleSpecs: 安全组规则信息 (Required) + * + * @Deprecated, not compatible when mandatory parameters changed + */ +func NewAddNetworkSecurityGroupRulesRequest( + regionId string, + networkSecurityGroupId string, + networkSecurityGroupRuleSpecs []vpc.AddSecurityGroupRules, +) *AddNetworkSecurityGroupRulesRequest { + + return &AddNetworkSecurityGroupRulesRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/networkSecurityGroups/{networkSecurityGroupId}:addNetworkSecurityGroupRules", + Method: "POST", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + NetworkSecurityGroupId: networkSecurityGroupId, + NetworkSecurityGroupRuleSpecs: networkSecurityGroupRuleSpecs, + } +} + +/* + * param regionId: Region ID (Required) + * param networkSecurityGroupId: NetworkSecurityGroup ID (Required) + * param networkSecurityGroupRuleSpecs: 安全组规则信息 (Required) + */ +func NewAddNetworkSecurityGroupRulesRequestWithAllParams( + regionId string, + networkSecurityGroupId string, + networkSecurityGroupRuleSpecs []vpc.AddSecurityGroupRules, +) *AddNetworkSecurityGroupRulesRequest { + + return &AddNetworkSecurityGroupRulesRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/networkSecurityGroups/{networkSecurityGroupId}:addNetworkSecurityGroupRules", + Method: "POST", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + NetworkSecurityGroupId: networkSecurityGroupId, + NetworkSecurityGroupRuleSpecs: networkSecurityGroupRuleSpecs, + } +} + +/* This constructor has better compatible ability when API parameters changed */ +func NewAddNetworkSecurityGroupRulesRequestWithoutParam() *AddNetworkSecurityGroupRulesRequest { + + return &AddNetworkSecurityGroupRulesRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/networkSecurityGroups/{networkSecurityGroupId}:addNetworkSecurityGroupRules", + Method: "POST", + Header: nil, + Version: "v1", + }, + } +} + +/* param regionId: Region ID(Required) */ +func (r *AddNetworkSecurityGroupRulesRequest) SetRegionId(regionId string) { + r.RegionId = regionId +} + +/* param networkSecurityGroupId: NetworkSecurityGroup ID(Required) */ +func (r *AddNetworkSecurityGroupRulesRequest) SetNetworkSecurityGroupId(networkSecurityGroupId string) { + r.NetworkSecurityGroupId = networkSecurityGroupId +} + +/* param networkSecurityGroupRuleSpecs: 安全组规则信息(Required) */ +func (r *AddNetworkSecurityGroupRulesRequest) SetNetworkSecurityGroupRuleSpecs(networkSecurityGroupRuleSpecs []vpc.AddSecurityGroupRules) { + r.NetworkSecurityGroupRuleSpecs = networkSecurityGroupRuleSpecs +} + +// GetRegionId returns path parameter 'regionId' if exist, +// otherwise return empty string +func (r AddNetworkSecurityGroupRulesRequest) GetRegionId() string { + return r.RegionId +} + +type AddNetworkSecurityGroupRulesResponse struct { + RequestID string `json:"requestId"` + Error core.ErrorResponse `json:"error"` + Result AddNetworkSecurityGroupRulesResult `json:"result"` +} + +type AddNetworkSecurityGroupRulesResult struct { +} \ No newline at end of file diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/AddRouteTableRules.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/AddRouteTableRules.go new file mode 100644 index 000000000..1dbd5382b --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/AddRouteTableRules.go @@ -0,0 +1,129 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package apis + +import ( + "github.com/jdcloud-api/jdcloud-sdk-go/core" + vpc "github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models" +) + +type AddRouteTableRulesRequest struct { + + core.JDCloudRequest + + /* Region ID */ + RegionId string `json:"regionId"` + + /* RouteTable ID */ + RouteTableId string `json:"routeTableId"` + + /* 安全组规则信息 */ + RouteTableRuleSpecs []vpc.AddRouteTableRules `json:"routeTableRuleSpecs"` +} + +/* + * param regionId: Region ID (Required) + * param routeTableId: RouteTable ID (Required) + * param routeTableRuleSpecs: 安全组规则信息 (Required) + * + * @Deprecated, not compatible when mandatory parameters changed + */ +func NewAddRouteTableRulesRequest( + regionId string, + routeTableId string, + routeTableRuleSpecs []vpc.AddRouteTableRules, +) *AddRouteTableRulesRequest { + + return &AddRouteTableRulesRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/routeTables/{routeTableId}:addRouteTableRules", + Method: "POST", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + RouteTableId: routeTableId, + RouteTableRuleSpecs: routeTableRuleSpecs, + } +} + +/* + * param regionId: Region ID (Required) + * param routeTableId: RouteTable ID (Required) + * param routeTableRuleSpecs: 安全组规则信息 (Required) + */ +func NewAddRouteTableRulesRequestWithAllParams( + regionId string, + routeTableId string, + routeTableRuleSpecs []vpc.AddRouteTableRules, +) *AddRouteTableRulesRequest { + + return &AddRouteTableRulesRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/routeTables/{routeTableId}:addRouteTableRules", + Method: "POST", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + RouteTableId: routeTableId, + RouteTableRuleSpecs: routeTableRuleSpecs, + } +} + +/* This constructor has better compatible ability when API parameters changed */ +func NewAddRouteTableRulesRequestWithoutParam() *AddRouteTableRulesRequest { + + return &AddRouteTableRulesRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/routeTables/{routeTableId}:addRouteTableRules", + Method: "POST", + Header: nil, + Version: "v1", + }, + } +} + +/* param regionId: Region ID(Required) */ +func (r *AddRouteTableRulesRequest) SetRegionId(regionId string) { + r.RegionId = regionId +} + +/* param routeTableId: RouteTable ID(Required) */ +func (r *AddRouteTableRulesRequest) SetRouteTableId(routeTableId string) { + r.RouteTableId = routeTableId +} + +/* param routeTableRuleSpecs: 安全组规则信息(Required) */ +func (r *AddRouteTableRulesRequest) SetRouteTableRuleSpecs(routeTableRuleSpecs []vpc.AddRouteTableRules) { + r.RouteTableRuleSpecs = routeTableRuleSpecs +} + +// GetRegionId returns path parameter 'regionId' if exist, +// otherwise return empty string +func (r AddRouteTableRulesRequest) GetRegionId() string { + return r.RegionId +} + +type AddRouteTableRulesResponse struct { + RequestID string `json:"requestId"` + Error core.ErrorResponse `json:"error"` + Result AddRouteTableRulesResult `json:"result"` +} + +type AddRouteTableRulesResult struct { +} \ No newline at end of file diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/AssignSecondaryIps.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/AssignSecondaryIps.go new file mode 100644 index 000000000..ecf6b3a43 --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/AssignSecondaryIps.go @@ -0,0 +1,147 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package apis + +import ( + "github.com/jdcloud-api/jdcloud-sdk-go/core" +) + +type AssignSecondaryIpsRequest struct { + + core.JDCloudRequest + + /* Region ID */ + RegionId string `json:"regionId"` + + /* networkInterface ID */ + NetworkInterfaceId string `json:"networkInterfaceId"` + + /* secondary ip被其他接口占用时,是否抢占。false:非抢占重分配,true:抢占重分配,默认抢占重分配。默认值:true (Optional) */ + Force *bool `json:"force"` + + /* 指定分配的secondaryIp地址 (Optional) */ + SecondaryIps []string `json:"secondaryIps"` + + /* 指定自动分配的secondaryIp个数 (Optional) */ + SecondaryIpCount *int `json:"secondaryIpCount"` +} + +/* + * param regionId: Region ID (Required) + * param networkInterfaceId: networkInterface ID (Required) + * + * @Deprecated, not compatible when mandatory parameters changed + */ +func NewAssignSecondaryIpsRequest( + regionId string, + networkInterfaceId string, +) *AssignSecondaryIpsRequest { + + return &AssignSecondaryIpsRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/networkInterfaces/{networkInterfaceId}:assignSecondaryIps", + Method: "POST", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + NetworkInterfaceId: networkInterfaceId, + } +} + +/* + * param regionId: Region ID (Required) + * param networkInterfaceId: networkInterface ID (Required) + * param force: secondary ip被其他接口占用时,是否抢占。false:非抢占重分配,true:抢占重分配,默认抢占重分配。默认值:true (Optional) + * param secondaryIps: 指定分配的secondaryIp地址 (Optional) + * param secondaryIpCount: 指定自动分配的secondaryIp个数 (Optional) + */ +func NewAssignSecondaryIpsRequestWithAllParams( + regionId string, + networkInterfaceId string, + force *bool, + secondaryIps []string, + secondaryIpCount *int, +) *AssignSecondaryIpsRequest { + + return &AssignSecondaryIpsRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/networkInterfaces/{networkInterfaceId}:assignSecondaryIps", + Method: "POST", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + NetworkInterfaceId: networkInterfaceId, + Force: force, + SecondaryIps: secondaryIps, + SecondaryIpCount: secondaryIpCount, + } +} + +/* This constructor has better compatible ability when API parameters changed */ +func NewAssignSecondaryIpsRequestWithoutParam() *AssignSecondaryIpsRequest { + + return &AssignSecondaryIpsRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/networkInterfaces/{networkInterfaceId}:assignSecondaryIps", + Method: "POST", + Header: nil, + Version: "v1", + }, + } +} + +/* param regionId: Region ID(Required) */ +func (r *AssignSecondaryIpsRequest) SetRegionId(regionId string) { + r.RegionId = regionId +} + +/* param networkInterfaceId: networkInterface ID(Required) */ +func (r *AssignSecondaryIpsRequest) SetNetworkInterfaceId(networkInterfaceId string) { + r.NetworkInterfaceId = networkInterfaceId +} + +/* param force: secondary ip被其他接口占用时,是否抢占。false:非抢占重分配,true:抢占重分配,默认抢占重分配。默认值:true(Optional) */ +func (r *AssignSecondaryIpsRequest) SetForce(force bool) { + r.Force = &force +} + +/* param secondaryIps: 指定分配的secondaryIp地址(Optional) */ +func (r *AssignSecondaryIpsRequest) SetSecondaryIps(secondaryIps []string) { + r.SecondaryIps = secondaryIps +} + +/* param secondaryIpCount: 指定自动分配的secondaryIp个数(Optional) */ +func (r *AssignSecondaryIpsRequest) SetSecondaryIpCount(secondaryIpCount int) { + r.SecondaryIpCount = &secondaryIpCount +} + +// GetRegionId returns path parameter 'regionId' if exist, +// otherwise return empty string +func (r AssignSecondaryIpsRequest) GetRegionId() string { + return r.RegionId +} + +type AssignSecondaryIpsResponse struct { + RequestID string `json:"requestId"` + Error core.ErrorResponse `json:"error"` + Result AssignSecondaryIpsResult `json:"result"` +} + +type AssignSecondaryIpsResult struct { +} \ No newline at end of file diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/AssociateElasticIp.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/AssociateElasticIp.go new file mode 100644 index 000000000..325099c4f --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/AssociateElasticIp.go @@ -0,0 +1,147 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package apis + +import ( + "github.com/jdcloud-api/jdcloud-sdk-go/core" +) + +type AssociateElasticIpRequest struct { + + core.JDCloudRequest + + /* Region ID */ + RegionId string `json:"regionId"` + + /* networkInterface ID */ + NetworkInterfaceId string `json:"networkInterfaceId"` + + /* 绑定的弹性Ip Id (Optional) */ + ElasticIpId *string `json:"elasticIpId"` + + /* 绑定弹性Ip到指定的privateIp (Optional) */ + PrivateIpAddress *string `json:"privateIpAddress"` + + /* 绑定的弹性Ip地址 (Optional) */ + ElasticIpAddress *string `json:"elasticIpAddress"` +} + +/* + * param regionId: Region ID (Required) + * param networkInterfaceId: networkInterface ID (Required) + * + * @Deprecated, not compatible when mandatory parameters changed + */ +func NewAssociateElasticIpRequest( + regionId string, + networkInterfaceId string, +) *AssociateElasticIpRequest { + + return &AssociateElasticIpRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/networkInterfaces/{networkInterfaceId}:associateElasticIp", + Method: "POST", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + NetworkInterfaceId: networkInterfaceId, + } +} + +/* + * param regionId: Region ID (Required) + * param networkInterfaceId: networkInterface ID (Required) + * param elasticIpId: 绑定的弹性Ip Id (Optional) + * param privateIpAddress: 绑定弹性Ip到指定的privateIp (Optional) + * param elasticIpAddress: 绑定的弹性Ip地址 (Optional) + */ +func NewAssociateElasticIpRequestWithAllParams( + regionId string, + networkInterfaceId string, + elasticIpId *string, + privateIpAddress *string, + elasticIpAddress *string, +) *AssociateElasticIpRequest { + + return &AssociateElasticIpRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/networkInterfaces/{networkInterfaceId}:associateElasticIp", + Method: "POST", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + NetworkInterfaceId: networkInterfaceId, + ElasticIpId: elasticIpId, + PrivateIpAddress: privateIpAddress, + ElasticIpAddress: elasticIpAddress, + } +} + +/* This constructor has better compatible ability when API parameters changed */ +func NewAssociateElasticIpRequestWithoutParam() *AssociateElasticIpRequest { + + return &AssociateElasticIpRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/networkInterfaces/{networkInterfaceId}:associateElasticIp", + Method: "POST", + Header: nil, + Version: "v1", + }, + } +} + +/* param regionId: Region ID(Required) */ +func (r *AssociateElasticIpRequest) SetRegionId(regionId string) { + r.RegionId = regionId +} + +/* param networkInterfaceId: networkInterface ID(Required) */ +func (r *AssociateElasticIpRequest) SetNetworkInterfaceId(networkInterfaceId string) { + r.NetworkInterfaceId = networkInterfaceId +} + +/* param elasticIpId: 绑定的弹性Ip Id(Optional) */ +func (r *AssociateElasticIpRequest) SetElasticIpId(elasticIpId string) { + r.ElasticIpId = &elasticIpId +} + +/* param privateIpAddress: 绑定弹性Ip到指定的privateIp(Optional) */ +func (r *AssociateElasticIpRequest) SetPrivateIpAddress(privateIpAddress string) { + r.PrivateIpAddress = &privateIpAddress +} + +/* param elasticIpAddress: 绑定的弹性Ip地址(Optional) */ +func (r *AssociateElasticIpRequest) SetElasticIpAddress(elasticIpAddress string) { + r.ElasticIpAddress = &elasticIpAddress +} + +// GetRegionId returns path parameter 'regionId' if exist, +// otherwise return empty string +func (r AssociateElasticIpRequest) GetRegionId() string { + return r.RegionId +} + +type AssociateElasticIpResponse struct { + RequestID string `json:"requestId"` + Error core.ErrorResponse `json:"error"` + Result AssociateElasticIpResult `json:"result"` +} + +type AssociateElasticIpResult struct { +} \ No newline at end of file diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/AssociateNetworkAcl.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/AssociateNetworkAcl.go new file mode 100644 index 000000000..2e33b993b --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/AssociateNetworkAcl.go @@ -0,0 +1,128 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package apis + +import ( + "github.com/jdcloud-api/jdcloud-sdk-go/core" +) + +type AssociateNetworkAclRequest struct { + + core.JDCloudRequest + + /* Region ID */ + RegionId string `json:"regionId"` + + /* networkAclId ID */ + NetworkAclId string `json:"networkAclId"` + + /* networkAcl要绑定的子网ID列表, subnet已被其他networkAcl绑定时,自动解绑 */ + SubnetIds []string `json:"subnetIds"` +} + +/* + * param regionId: Region ID (Required) + * param networkAclId: networkAclId ID (Required) + * param subnetIds: networkAcl要绑定的子网ID列表, subnet已被其他networkAcl绑定时,自动解绑 (Required) + * + * @Deprecated, not compatible when mandatory parameters changed + */ +func NewAssociateNetworkAclRequest( + regionId string, + networkAclId string, + subnetIds []string, +) *AssociateNetworkAclRequest { + + return &AssociateNetworkAclRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/networkAcls/{networkAclId}:associateNetworkAcl", + Method: "POST", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + NetworkAclId: networkAclId, + SubnetIds: subnetIds, + } +} + +/* + * param regionId: Region ID (Required) + * param networkAclId: networkAclId ID (Required) + * param subnetIds: networkAcl要绑定的子网ID列表, subnet已被其他networkAcl绑定时,自动解绑 (Required) + */ +func NewAssociateNetworkAclRequestWithAllParams( + regionId string, + networkAclId string, + subnetIds []string, +) *AssociateNetworkAclRequest { + + return &AssociateNetworkAclRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/networkAcls/{networkAclId}:associateNetworkAcl", + Method: "POST", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + NetworkAclId: networkAclId, + SubnetIds: subnetIds, + } +} + +/* This constructor has better compatible ability when API parameters changed */ +func NewAssociateNetworkAclRequestWithoutParam() *AssociateNetworkAclRequest { + + return &AssociateNetworkAclRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/networkAcls/{networkAclId}:associateNetworkAcl", + Method: "POST", + Header: nil, + Version: "v1", + }, + } +} + +/* param regionId: Region ID(Required) */ +func (r *AssociateNetworkAclRequest) SetRegionId(regionId string) { + r.RegionId = regionId +} + +/* param networkAclId: networkAclId ID(Required) */ +func (r *AssociateNetworkAclRequest) SetNetworkAclId(networkAclId string) { + r.NetworkAclId = networkAclId +} + +/* param subnetIds: networkAcl要绑定的子网ID列表, subnet已被其他networkAcl绑定时,自动解绑(Required) */ +func (r *AssociateNetworkAclRequest) SetSubnetIds(subnetIds []string) { + r.SubnetIds = subnetIds +} + +// GetRegionId returns path parameter 'regionId' if exist, +// otherwise return empty string +func (r AssociateNetworkAclRequest) GetRegionId() string { + return r.RegionId +} + +type AssociateNetworkAclResponse struct { + RequestID string `json:"requestId"` + Error core.ErrorResponse `json:"error"` + Result AssociateNetworkAclResult `json:"result"` +} + +type AssociateNetworkAclResult struct { +} \ No newline at end of file diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/AssociateRouteTable.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/AssociateRouteTable.go new file mode 100644 index 000000000..d7f544e8b --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/AssociateRouteTable.go @@ -0,0 +1,128 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package apis + +import ( + "github.com/jdcloud-api/jdcloud-sdk-go/core" +) + +type AssociateRouteTableRequest struct { + + core.JDCloudRequest + + /* Region ID */ + RegionId string `json:"regionId"` + + /* RouteTable ID */ + RouteTableId string `json:"routeTableId"` + + /* 路由表要绑定的子网ID列表, subnet已被其他路由表绑定时,自动解绑。 */ + SubnetIds []string `json:"subnetIds"` +} + +/* + * param regionId: Region ID (Required) + * param routeTableId: RouteTable ID (Required) + * param subnetIds: 路由表要绑定的子网ID列表, subnet已被其他路由表绑定时,自动解绑。 (Required) + * + * @Deprecated, not compatible when mandatory parameters changed + */ +func NewAssociateRouteTableRequest( + regionId string, + routeTableId string, + subnetIds []string, +) *AssociateRouteTableRequest { + + return &AssociateRouteTableRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/routeTables/{routeTableId}:associateRouteTable", + Method: "POST", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + RouteTableId: routeTableId, + SubnetIds: subnetIds, + } +} + +/* + * param regionId: Region ID (Required) + * param routeTableId: RouteTable ID (Required) + * param subnetIds: 路由表要绑定的子网ID列表, subnet已被其他路由表绑定时,自动解绑。 (Required) + */ +func NewAssociateRouteTableRequestWithAllParams( + regionId string, + routeTableId string, + subnetIds []string, +) *AssociateRouteTableRequest { + + return &AssociateRouteTableRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/routeTables/{routeTableId}:associateRouteTable", + Method: "POST", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + RouteTableId: routeTableId, + SubnetIds: subnetIds, + } +} + +/* This constructor has better compatible ability when API parameters changed */ +func NewAssociateRouteTableRequestWithoutParam() *AssociateRouteTableRequest { + + return &AssociateRouteTableRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/routeTables/{routeTableId}:associateRouteTable", + Method: "POST", + Header: nil, + Version: "v1", + }, + } +} + +/* param regionId: Region ID(Required) */ +func (r *AssociateRouteTableRequest) SetRegionId(regionId string) { + r.RegionId = regionId +} + +/* param routeTableId: RouteTable ID(Required) */ +func (r *AssociateRouteTableRequest) SetRouteTableId(routeTableId string) { + r.RouteTableId = routeTableId +} + +/* param subnetIds: 路由表要绑定的子网ID列表, subnet已被其他路由表绑定时,自动解绑。(Required) */ +func (r *AssociateRouteTableRequest) SetSubnetIds(subnetIds []string) { + r.SubnetIds = subnetIds +} + +// GetRegionId returns path parameter 'regionId' if exist, +// otherwise return empty string +func (r AssociateRouteTableRequest) GetRegionId() string { + return r.RegionId +} + +type AssociateRouteTableResponse struct { + RequestID string `json:"requestId"` + Error core.ErrorResponse `json:"error"` + Result AssociateRouteTableResult `json:"result"` +} + +type AssociateRouteTableResult struct { +} \ No newline at end of file diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/CreateElasticIps.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/CreateElasticIps.go new file mode 100644 index 000000000..6ac78c2f5 --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/CreateElasticIps.go @@ -0,0 +1,142 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package apis + +import ( + "github.com/jdcloud-api/jdcloud-sdk-go/core" + vpc "github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models" +) + +type CreateElasticIpsRequest struct { + + core.JDCloudRequest + + /* Region ID */ + RegionId string `json:"regionId"` + + /* 购买弹性ip数量;取值范围:[1,100] */ + MaxCount int `json:"maxCount"` + + /* 指定弹性ip地址进行创建,当申请创建多个弹性ip时,必须为空 (Optional) */ + ElasticIpAddress *string `json:"elasticIpAddress"` + + /* 弹性ip规格 */ + ElasticIpSpec *vpc.ElasticIpSpec `json:"elasticIpSpec"` +} + +/* + * param regionId: Region ID (Required) + * param maxCount: 购买弹性ip数量;取值范围:[1,100] (Required) + * param elasticIpSpec: 弹性ip规格 (Required) + * + * @Deprecated, not compatible when mandatory parameters changed + */ +func NewCreateElasticIpsRequest( + regionId string, + maxCount int, + elasticIpSpec *vpc.ElasticIpSpec, +) *CreateElasticIpsRequest { + + return &CreateElasticIpsRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/elasticIps/", + Method: "POST", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + MaxCount: maxCount, + ElasticIpSpec: elasticIpSpec, + } +} + +/* + * param regionId: Region ID (Required) + * param maxCount: 购买弹性ip数量;取值范围:[1,100] (Required) + * param elasticIpAddress: 指定弹性ip地址进行创建,当申请创建多个弹性ip时,必须为空 (Optional) + * param elasticIpSpec: 弹性ip规格 (Required) + */ +func NewCreateElasticIpsRequestWithAllParams( + regionId string, + maxCount int, + elasticIpAddress *string, + elasticIpSpec *vpc.ElasticIpSpec, +) *CreateElasticIpsRequest { + + return &CreateElasticIpsRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/elasticIps/", + Method: "POST", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + MaxCount: maxCount, + ElasticIpAddress: elasticIpAddress, + ElasticIpSpec: elasticIpSpec, + } +} + +/* This constructor has better compatible ability when API parameters changed */ +func NewCreateElasticIpsRequestWithoutParam() *CreateElasticIpsRequest { + + return &CreateElasticIpsRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/elasticIps/", + Method: "POST", + Header: nil, + Version: "v1", + }, + } +} + +/* param regionId: Region ID(Required) */ +func (r *CreateElasticIpsRequest) SetRegionId(regionId string) { + r.RegionId = regionId +} + +/* param maxCount: 购买弹性ip数量;取值范围:[1,100](Required) */ +func (r *CreateElasticIpsRequest) SetMaxCount(maxCount int) { + r.MaxCount = maxCount +} + +/* param elasticIpAddress: 指定弹性ip地址进行创建,当申请创建多个弹性ip时,必须为空(Optional) */ +func (r *CreateElasticIpsRequest) SetElasticIpAddress(elasticIpAddress string) { + r.ElasticIpAddress = &elasticIpAddress +} + +/* param elasticIpSpec: 弹性ip规格(Required) */ +func (r *CreateElasticIpsRequest) SetElasticIpSpec(elasticIpSpec *vpc.ElasticIpSpec) { + r.ElasticIpSpec = elasticIpSpec +} + +// GetRegionId returns path parameter 'regionId' if exist, +// otherwise return empty string +func (r CreateElasticIpsRequest) GetRegionId() string { + return r.RegionId +} + +type CreateElasticIpsResponse struct { + RequestID string `json:"requestId"` + Error core.ErrorResponse `json:"error"` + Result CreateElasticIpsResult `json:"result"` +} + +type CreateElasticIpsResult struct { + ElasticIpIds []string `json:"elasticIpIds"` + RequestId string `json:"requestId"` +} \ No newline at end of file diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/CreateNetworkAcl.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/CreateNetworkAcl.go new file mode 100644 index 000000000..f1f81bfd8 --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/CreateNetworkAcl.go @@ -0,0 +1,140 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package apis + +import ( + "github.com/jdcloud-api/jdcloud-sdk-go/core" +) + +type CreateNetworkAclRequest struct { + + core.JDCloudRequest + + /* Region ID */ + RegionId string `json:"regionId"` + + /* 私有网络id */ + VpcId string `json:"vpcId"` + + /* networkAcl名称 */ + NetworkAclName string `json:"networkAclName"` + + /* 描述,允许输入UTF-8编码下的全部字符,不超过256字符 (Optional) */ + Description *string `json:"description"` +} + +/* + * param regionId: Region ID (Required) + * param vpcId: 私有网络id (Required) + * param networkAclName: networkAcl名称 (Required) + * + * @Deprecated, not compatible when mandatory parameters changed + */ +func NewCreateNetworkAclRequest( + regionId string, + vpcId string, + networkAclName string, +) *CreateNetworkAclRequest { + + return &CreateNetworkAclRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/networkAcls/", + Method: "POST", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + VpcId: vpcId, + NetworkAclName: networkAclName, + } +} + +/* + * param regionId: Region ID (Required) + * param vpcId: 私有网络id (Required) + * param networkAclName: networkAcl名称 (Required) + * param description: 描述,允许输入UTF-8编码下的全部字符,不超过256字符 (Optional) + */ +func NewCreateNetworkAclRequestWithAllParams( + regionId string, + vpcId string, + networkAclName string, + description *string, +) *CreateNetworkAclRequest { + + return &CreateNetworkAclRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/networkAcls/", + Method: "POST", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + VpcId: vpcId, + NetworkAclName: networkAclName, + Description: description, + } +} + +/* This constructor has better compatible ability when API parameters changed */ +func NewCreateNetworkAclRequestWithoutParam() *CreateNetworkAclRequest { + + return &CreateNetworkAclRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/networkAcls/", + Method: "POST", + Header: nil, + Version: "v1", + }, + } +} + +/* param regionId: Region ID(Required) */ +func (r *CreateNetworkAclRequest) SetRegionId(regionId string) { + r.RegionId = regionId +} + +/* param vpcId: 私有网络id(Required) */ +func (r *CreateNetworkAclRequest) SetVpcId(vpcId string) { + r.VpcId = vpcId +} + +/* param networkAclName: networkAcl名称(Required) */ +func (r *CreateNetworkAclRequest) SetNetworkAclName(networkAclName string) { + r.NetworkAclName = networkAclName +} + +/* param description: 描述,允许输入UTF-8编码下的全部字符,不超过256字符(Optional) */ +func (r *CreateNetworkAclRequest) SetDescription(description string) { + r.Description = &description +} + +// GetRegionId returns path parameter 'regionId' if exist, +// otherwise return empty string +func (r CreateNetworkAclRequest) GetRegionId() string { + return r.RegionId +} + +type CreateNetworkAclResponse struct { + RequestID string `json:"requestId"` + Error core.ErrorResponse `json:"error"` + Result CreateNetworkAclResult `json:"result"` +} + +type CreateNetworkAclResult struct { + NetworkAclId string `json:"networkAclId"` +} \ No newline at end of file diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/CreateNetworkInterface.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/CreateNetworkInterface.go new file mode 100644 index 000000000..14ce0da3c --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/CreateNetworkInterface.go @@ -0,0 +1,203 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package apis + +import ( + "github.com/jdcloud-api/jdcloud-sdk-go/core" +) + +type CreateNetworkInterfaceRequest struct { + + core.JDCloudRequest + + /* Region ID */ + RegionId string `json:"regionId"` + + /* 子网ID */ + SubnetId string `json:"subnetId"` + + /* 可用区,用户的默认可用区 (Optional) */ + Az *string `json:"az"` + + /* 网卡名称,只允许输入中文、数字、大小写字母、英文下划线“_”及中划线“-”,不允许为空且不超过32字符。 (Optional) */ + NetworkInterfaceName *string `json:"networkInterfaceName"` + + /* 网卡主IP,如果不指定,会自动从子网中分配 (Optional) */ + PrimaryIpAddress *string `json:"primaryIpAddress"` + + /* SecondaryIp列表 (Optional) */ + SecondaryIpAddresses []string `json:"secondaryIpAddresses"` + + /* 自动分配的SecondaryIp数量 (Optional) */ + SecondaryIpCount *int `json:"secondaryIpCount"` + + /* 要绑定的安全组ID列表,最多指定5个安全组 (Optional) */ + SecurityGroups []string `json:"securityGroups"` + + /* 源和目标IP地址校验,取值为0或者1,默认为1 (Optional) */ + SanityCheck *int `json:"sanityCheck"` + + /* 描述,​ 允许输入UTF-8编码下的全部字符,不超过256字符 (Optional) */ + Description *string `json:"description"` +} + +/* + * param regionId: Region ID (Required) + * param subnetId: 子网ID (Required) + * + * @Deprecated, not compatible when mandatory parameters changed + */ +func NewCreateNetworkInterfaceRequest( + regionId string, + subnetId string, +) *CreateNetworkInterfaceRequest { + + return &CreateNetworkInterfaceRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/networkInterfaces/", + Method: "POST", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + SubnetId: subnetId, + } +} + +/* + * param regionId: Region ID (Required) + * param subnetId: 子网ID (Required) + * param az: 可用区,用户的默认可用区 (Optional) + * param networkInterfaceName: 网卡名称,只允许输入中文、数字、大小写字母、英文下划线“_”及中划线“-”,不允许为空且不超过32字符。 (Optional) + * param primaryIpAddress: 网卡主IP,如果不指定,会自动从子网中分配 (Optional) + * param secondaryIpAddresses: SecondaryIp列表 (Optional) + * param secondaryIpCount: 自动分配的SecondaryIp数量 (Optional) + * param securityGroups: 要绑定的安全组ID列表,最多指定5个安全组 (Optional) + * param sanityCheck: 源和目标IP地址校验,取值为0或者1,默认为1 (Optional) + * param description: 描述,​ 允许输入UTF-8编码下的全部字符,不超过256字符 (Optional) + */ +func NewCreateNetworkInterfaceRequestWithAllParams( + regionId string, + subnetId string, + az *string, + networkInterfaceName *string, + primaryIpAddress *string, + secondaryIpAddresses []string, + secondaryIpCount *int, + securityGroups []string, + sanityCheck *int, + description *string, +) *CreateNetworkInterfaceRequest { + + return &CreateNetworkInterfaceRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/networkInterfaces/", + Method: "POST", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + SubnetId: subnetId, + Az: az, + NetworkInterfaceName: networkInterfaceName, + PrimaryIpAddress: primaryIpAddress, + SecondaryIpAddresses: secondaryIpAddresses, + SecondaryIpCount: secondaryIpCount, + SecurityGroups: securityGroups, + SanityCheck: sanityCheck, + Description: description, + } +} + +/* This constructor has better compatible ability when API parameters changed */ +func NewCreateNetworkInterfaceRequestWithoutParam() *CreateNetworkInterfaceRequest { + + return &CreateNetworkInterfaceRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/networkInterfaces/", + Method: "POST", + Header: nil, + Version: "v1", + }, + } +} + +/* param regionId: Region ID(Required) */ +func (r *CreateNetworkInterfaceRequest) SetRegionId(regionId string) { + r.RegionId = regionId +} + +/* param subnetId: 子网ID(Required) */ +func (r *CreateNetworkInterfaceRequest) SetSubnetId(subnetId string) { + r.SubnetId = subnetId +} + +/* param az: 可用区,用户的默认可用区(Optional) */ +func (r *CreateNetworkInterfaceRequest) SetAz(az string) { + r.Az = &az +} + +/* param networkInterfaceName: 网卡名称,只允许输入中文、数字、大小写字母、英文下划线“_”及中划线“-”,不允许为空且不超过32字符。(Optional) */ +func (r *CreateNetworkInterfaceRequest) SetNetworkInterfaceName(networkInterfaceName string) { + r.NetworkInterfaceName = &networkInterfaceName +} + +/* param primaryIpAddress: 网卡主IP,如果不指定,会自动从子网中分配(Optional) */ +func (r *CreateNetworkInterfaceRequest) SetPrimaryIpAddress(primaryIpAddress string) { + r.PrimaryIpAddress = &primaryIpAddress +} + +/* param secondaryIpAddresses: SecondaryIp列表(Optional) */ +func (r *CreateNetworkInterfaceRequest) SetSecondaryIpAddresses(secondaryIpAddresses []string) { + r.SecondaryIpAddresses = secondaryIpAddresses +} + +/* param secondaryIpCount: 自动分配的SecondaryIp数量(Optional) */ +func (r *CreateNetworkInterfaceRequest) SetSecondaryIpCount(secondaryIpCount int) { + r.SecondaryIpCount = &secondaryIpCount +} + +/* param securityGroups: 要绑定的安全组ID列表,最多指定5个安全组(Optional) */ +func (r *CreateNetworkInterfaceRequest) SetSecurityGroups(securityGroups []string) { + r.SecurityGroups = securityGroups +} + +/* param sanityCheck: 源和目标IP地址校验,取值为0或者1,默认为1(Optional) */ +func (r *CreateNetworkInterfaceRequest) SetSanityCheck(sanityCheck int) { + r.SanityCheck = &sanityCheck +} + +/* param description: 描述,​ 允许输入UTF-8编码下的全部字符,不超过256字符(Optional) */ +func (r *CreateNetworkInterfaceRequest) SetDescription(description string) { + r.Description = &description +} + +// GetRegionId returns path parameter 'regionId' if exist, +// otherwise return empty string +func (r CreateNetworkInterfaceRequest) GetRegionId() string { + return r.RegionId +} + +type CreateNetworkInterfaceResponse struct { + RequestID string `json:"requestId"` + Error core.ErrorResponse `json:"error"` + Result CreateNetworkInterfaceResult `json:"result"` +} + +type CreateNetworkInterfaceResult struct { + NetworkInterfaceId string `json:"networkInterfaceId"` +} \ No newline at end of file diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/CreateNetworkSecurityGroup.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/CreateNetworkSecurityGroup.go new file mode 100644 index 000000000..c0765bb2c --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/CreateNetworkSecurityGroup.go @@ -0,0 +1,140 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package apis + +import ( + "github.com/jdcloud-api/jdcloud-sdk-go/core" +) + +type CreateNetworkSecurityGroupRequest struct { + + core.JDCloudRequest + + /* Region ID */ + RegionId string `json:"regionId"` + + /* 私有网络ID */ + VpcId string `json:"vpcId"` + + /* 安全组名称,只允许输入中文、数字、大小写字母、英文下划线“_”及中划线“-”,不允许为空且不超过32字符。 */ + NetworkSecurityGroupName string `json:"networkSecurityGroupName"` + + /* 描述,​ 允许输入UTF-8编码下的全部字符,不超过256字符 (Optional) */ + Description *string `json:"description"` +} + +/* + * param regionId: Region ID (Required) + * param vpcId: 私有网络ID (Required) + * param networkSecurityGroupName: 安全组名称,只允许输入中文、数字、大小写字母、英文下划线“_”及中划线“-”,不允许为空且不超过32字符。 (Required) + * + * @Deprecated, not compatible when mandatory parameters changed + */ +func NewCreateNetworkSecurityGroupRequest( + regionId string, + vpcId string, + networkSecurityGroupName string, +) *CreateNetworkSecurityGroupRequest { + + return &CreateNetworkSecurityGroupRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/networkSecurityGroups/", + Method: "POST", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + VpcId: vpcId, + NetworkSecurityGroupName: networkSecurityGroupName, + } +} + +/* + * param regionId: Region ID (Required) + * param vpcId: 私有网络ID (Required) + * param networkSecurityGroupName: 安全组名称,只允许输入中文、数字、大小写字母、英文下划线“_”及中划线“-”,不允许为空且不超过32字符。 (Required) + * param description: 描述,​ 允许输入UTF-8编码下的全部字符,不超过256字符 (Optional) + */ +func NewCreateNetworkSecurityGroupRequestWithAllParams( + regionId string, + vpcId string, + networkSecurityGroupName string, + description *string, +) *CreateNetworkSecurityGroupRequest { + + return &CreateNetworkSecurityGroupRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/networkSecurityGroups/", + Method: "POST", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + VpcId: vpcId, + NetworkSecurityGroupName: networkSecurityGroupName, + Description: description, + } +} + +/* This constructor has better compatible ability when API parameters changed */ +func NewCreateNetworkSecurityGroupRequestWithoutParam() *CreateNetworkSecurityGroupRequest { + + return &CreateNetworkSecurityGroupRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/networkSecurityGroups/", + Method: "POST", + Header: nil, + Version: "v1", + }, + } +} + +/* param regionId: Region ID(Required) */ +func (r *CreateNetworkSecurityGroupRequest) SetRegionId(regionId string) { + r.RegionId = regionId +} + +/* param vpcId: 私有网络ID(Required) */ +func (r *CreateNetworkSecurityGroupRequest) SetVpcId(vpcId string) { + r.VpcId = vpcId +} + +/* param networkSecurityGroupName: 安全组名称,只允许输入中文、数字、大小写字母、英文下划线“_”及中划线“-”,不允许为空且不超过32字符。(Required) */ +func (r *CreateNetworkSecurityGroupRequest) SetNetworkSecurityGroupName(networkSecurityGroupName string) { + r.NetworkSecurityGroupName = networkSecurityGroupName +} + +/* param description: 描述,​ 允许输入UTF-8编码下的全部字符,不超过256字符(Optional) */ +func (r *CreateNetworkSecurityGroupRequest) SetDescription(description string) { + r.Description = &description +} + +// GetRegionId returns path parameter 'regionId' if exist, +// otherwise return empty string +func (r CreateNetworkSecurityGroupRequest) GetRegionId() string { + return r.RegionId +} + +type CreateNetworkSecurityGroupResponse struct { + RequestID string `json:"requestId"` + Error core.ErrorResponse `json:"error"` + Result CreateNetworkSecurityGroupResult `json:"result"` +} + +type CreateNetworkSecurityGroupResult struct { + NetworkSecurityGroupId string `json:"networkSecurityGroupId"` +} \ No newline at end of file diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/CreateRouteTable.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/CreateRouteTable.go new file mode 100644 index 000000000..9cf289d88 --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/CreateRouteTable.go @@ -0,0 +1,140 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package apis + +import ( + "github.com/jdcloud-api/jdcloud-sdk-go/core" +) + +type CreateRouteTableRequest struct { + + core.JDCloudRequest + + /* Region ID */ + RegionId string `json:"regionId"` + + /* 路由表所属的私有网络ID */ + VpcId string `json:"vpcId"` + + /* 路由表名称,只允许输入中文、数字、大小写字母、英文下划线“_”及中划线“-”,不允许为空且不超过32字符。 */ + RouteTableName string `json:"routeTableName"` + + /* 描述,​ 允许输入UTF-8编码下的全部字符,不超过256字符 (Optional) */ + Description *string `json:"description"` +} + +/* + * param regionId: Region ID (Required) + * param vpcId: 路由表所属的私有网络ID (Required) + * param routeTableName: 路由表名称,只允许输入中文、数字、大小写字母、英文下划线“_”及中划线“-”,不允许为空且不超过32字符。 (Required) + * + * @Deprecated, not compatible when mandatory parameters changed + */ +func NewCreateRouteTableRequest( + regionId string, + vpcId string, + routeTableName string, +) *CreateRouteTableRequest { + + return &CreateRouteTableRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/routeTables/", + Method: "POST", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + VpcId: vpcId, + RouteTableName: routeTableName, + } +} + +/* + * param regionId: Region ID (Required) + * param vpcId: 路由表所属的私有网络ID (Required) + * param routeTableName: 路由表名称,只允许输入中文、数字、大小写字母、英文下划线“_”及中划线“-”,不允许为空且不超过32字符。 (Required) + * param description: 描述,​ 允许输入UTF-8编码下的全部字符,不超过256字符 (Optional) + */ +func NewCreateRouteTableRequestWithAllParams( + regionId string, + vpcId string, + routeTableName string, + description *string, +) *CreateRouteTableRequest { + + return &CreateRouteTableRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/routeTables/", + Method: "POST", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + VpcId: vpcId, + RouteTableName: routeTableName, + Description: description, + } +} + +/* This constructor has better compatible ability when API parameters changed */ +func NewCreateRouteTableRequestWithoutParam() *CreateRouteTableRequest { + + return &CreateRouteTableRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/routeTables/", + Method: "POST", + Header: nil, + Version: "v1", + }, + } +} + +/* param regionId: Region ID(Required) */ +func (r *CreateRouteTableRequest) SetRegionId(regionId string) { + r.RegionId = regionId +} + +/* param vpcId: 路由表所属的私有网络ID(Required) */ +func (r *CreateRouteTableRequest) SetVpcId(vpcId string) { + r.VpcId = vpcId +} + +/* param routeTableName: 路由表名称,只允许输入中文、数字、大小写字母、英文下划线“_”及中划线“-”,不允许为空且不超过32字符。(Required) */ +func (r *CreateRouteTableRequest) SetRouteTableName(routeTableName string) { + r.RouteTableName = routeTableName +} + +/* param description: 描述,​ 允许输入UTF-8编码下的全部字符,不超过256字符(Optional) */ +func (r *CreateRouteTableRequest) SetDescription(description string) { + r.Description = &description +} + +// GetRegionId returns path parameter 'regionId' if exist, +// otherwise return empty string +func (r CreateRouteTableRequest) GetRegionId() string { + return r.RegionId +} + +type CreateRouteTableResponse struct { + RequestID string `json:"requestId"` + Error core.ErrorResponse `json:"error"` + Result CreateRouteTableResult `json:"result"` +} + +type CreateRouteTableResult struct { + RouteTableId string `json:"routeTableId"` +} \ No newline at end of file diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/CreateSubnet.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/CreateSubnet.go new file mode 100644 index 000000000..eb2523d43 --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/CreateSubnet.go @@ -0,0 +1,165 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package apis + +import ( + "github.com/jdcloud-api/jdcloud-sdk-go/core" +) + +type CreateSubnetRequest struct { + + core.JDCloudRequest + + /* Region ID */ + RegionId string `json:"regionId"` + + /* 子网所属vpc的Id */ + VpcId string `json:"vpcId"` + + /* 子网名称,只允许输入中文、数字、大小写字母、英文下划线“_”及中划线“-”,不允许为空且不超过32字符。 */ + SubnetName string `json:"subnetName"` + + /* 子网网段,vpc内子网网段不能重叠,cidr的取值范围:10.0.0.0/8、172.16.0.0/12和192.168.0.0/16及它们包含的子网,且子网掩码长度为16-28之间,如果vpc含有cidr,则必须为vpc所在cidr的子网 */ + AddressPrefix string `json:"addressPrefix"` + + /* 子网关联的路由表Id, 默认为vpc的默认路由表 (Optional) */ + RouteTableId *string `json:"routeTableId"` + + /* 子网描述信息,允许输入UTF-8编码下的全部字符,不超过256字符。 (Optional) */ + Description *string `json:"description"` +} + +/* + * param regionId: Region ID (Required) + * param vpcId: 子网所属vpc的Id (Required) + * param subnetName: 子网名称,只允许输入中文、数字、大小写字母、英文下划线“_”及中划线“-”,不允许为空且不超过32字符。 (Required) + * param addressPrefix: 子网网段,vpc内子网网段不能重叠,cidr的取值范围:10.0.0.0/8、172.16.0.0/12和192.168.0.0/16及它们包含的子网,且子网掩码长度为16-28之间,如果vpc含有cidr,则必须为vpc所在cidr的子网 (Required) + * + * @Deprecated, not compatible when mandatory parameters changed + */ +func NewCreateSubnetRequest( + regionId string, + vpcId string, + subnetName string, + addressPrefix string, +) *CreateSubnetRequest { + + return &CreateSubnetRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/subnets/", + Method: "POST", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + VpcId: vpcId, + SubnetName: subnetName, + AddressPrefix: addressPrefix, + } +} + +/* + * param regionId: Region ID (Required) + * param vpcId: 子网所属vpc的Id (Required) + * param subnetName: 子网名称,只允许输入中文、数字、大小写字母、英文下划线“_”及中划线“-”,不允许为空且不超过32字符。 (Required) + * param addressPrefix: 子网网段,vpc内子网网段不能重叠,cidr的取值范围:10.0.0.0/8、172.16.0.0/12和192.168.0.0/16及它们包含的子网,且子网掩码长度为16-28之间,如果vpc含有cidr,则必须为vpc所在cidr的子网 (Required) + * param routeTableId: 子网关联的路由表Id, 默认为vpc的默认路由表 (Optional) + * param description: 子网描述信息,允许输入UTF-8编码下的全部字符,不超过256字符。 (Optional) + */ +func NewCreateSubnetRequestWithAllParams( + regionId string, + vpcId string, + subnetName string, + addressPrefix string, + routeTableId *string, + description *string, +) *CreateSubnetRequest { + + return &CreateSubnetRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/subnets/", + Method: "POST", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + VpcId: vpcId, + SubnetName: subnetName, + AddressPrefix: addressPrefix, + RouteTableId: routeTableId, + Description: description, + } +} + +/* This constructor has better compatible ability when API parameters changed */ +func NewCreateSubnetRequestWithoutParam() *CreateSubnetRequest { + + return &CreateSubnetRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/subnets/", + Method: "POST", + Header: nil, + Version: "v1", + }, + } +} + +/* param regionId: Region ID(Required) */ +func (r *CreateSubnetRequest) SetRegionId(regionId string) { + r.RegionId = regionId +} + +/* param vpcId: 子网所属vpc的Id(Required) */ +func (r *CreateSubnetRequest) SetVpcId(vpcId string) { + r.VpcId = vpcId +} + +/* param subnetName: 子网名称,只允许输入中文、数字、大小写字母、英文下划线“_”及中划线“-”,不允许为空且不超过32字符。(Required) */ +func (r *CreateSubnetRequest) SetSubnetName(subnetName string) { + r.SubnetName = subnetName +} + +/* param addressPrefix: 子网网段,vpc内子网网段不能重叠,cidr的取值范围:10.0.0.0/8、172.16.0.0/12和192.168.0.0/16及它们包含的子网,且子网掩码长度为16-28之间,如果vpc含有cidr,则必须为vpc所在cidr的子网(Required) */ +func (r *CreateSubnetRequest) SetAddressPrefix(addressPrefix string) { + r.AddressPrefix = addressPrefix +} + +/* param routeTableId: 子网关联的路由表Id, 默认为vpc的默认路由表(Optional) */ +func (r *CreateSubnetRequest) SetRouteTableId(routeTableId string) { + r.RouteTableId = &routeTableId +} + +/* param description: 子网描述信息,允许输入UTF-8编码下的全部字符,不超过256字符。(Optional) */ +func (r *CreateSubnetRequest) SetDescription(description string) { + r.Description = &description +} + +// GetRegionId returns path parameter 'regionId' if exist, +// otherwise return empty string +func (r CreateSubnetRequest) GetRegionId() string { + return r.RegionId +} + +type CreateSubnetResponse struct { + RequestID string `json:"requestId"` + Error core.ErrorResponse `json:"error"` + Result CreateSubnetResult `json:"result"` +} + +type CreateSubnetResult struct { + SubnetId string `json:"subnetId"` +} \ No newline at end of file diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/CreateVpc.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/CreateVpc.go new file mode 100644 index 000000000..60641f9d9 --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/CreateVpc.go @@ -0,0 +1,137 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package apis + +import ( + "github.com/jdcloud-api/jdcloud-sdk-go/core" +) + +type CreateVpcRequest struct { + + core.JDCloudRequest + + /* Region ID */ + RegionId string `json:"regionId"` + + /* 私有网络名称,只允许输入中文、数字、大小写字母、英文下划线“_”及中划线“-”,不允许为空且不超过32字符。 */ + VpcName string `json:"vpcName"` + + /* 如果为空,则不限制网段,如果不为空,10.0.0.0/8、172.16.0.0/12和192.168.0.0/16及它们包含的子网,且子网掩码长度为16-28之间 (Optional) */ + AddressPrefix *string `json:"addressPrefix"` + + /* vpc描述,允许输入UTF-8编码下的全部字符,不超过256字符。 (Optional) */ + Description *string `json:"description"` +} + +/* + * param regionId: Region ID (Required) + * param vpcName: 私有网络名称,只允许输入中文、数字、大小写字母、英文下划线“_”及中划线“-”,不允许为空且不超过32字符。 (Required) + * + * @Deprecated, not compatible when mandatory parameters changed + */ +func NewCreateVpcRequest( + regionId string, + vpcName string, +) *CreateVpcRequest { + + return &CreateVpcRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/vpcs/", + Method: "POST", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + VpcName: vpcName, + } +} + +/* + * param regionId: Region ID (Required) + * param vpcName: 私有网络名称,只允许输入中文、数字、大小写字母、英文下划线“_”及中划线“-”,不允许为空且不超过32字符。 (Required) + * param addressPrefix: 如果为空,则不限制网段,如果不为空,10.0.0.0/8、172.16.0.0/12和192.168.0.0/16及它们包含的子网,且子网掩码长度为16-28之间 (Optional) + * param description: vpc描述,允许输入UTF-8编码下的全部字符,不超过256字符。 (Optional) + */ +func NewCreateVpcRequestWithAllParams( + regionId string, + vpcName string, + addressPrefix *string, + description *string, +) *CreateVpcRequest { + + return &CreateVpcRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/vpcs/", + Method: "POST", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + VpcName: vpcName, + AddressPrefix: addressPrefix, + Description: description, + } +} + +/* This constructor has better compatible ability when API parameters changed */ +func NewCreateVpcRequestWithoutParam() *CreateVpcRequest { + + return &CreateVpcRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/vpcs/", + Method: "POST", + Header: nil, + Version: "v1", + }, + } +} + +/* param regionId: Region ID(Required) */ +func (r *CreateVpcRequest) SetRegionId(regionId string) { + r.RegionId = regionId +} + +/* param vpcName: 私有网络名称,只允许输入中文、数字、大小写字母、英文下划线“_”及中划线“-”,不允许为空且不超过32字符。(Required) */ +func (r *CreateVpcRequest) SetVpcName(vpcName string) { + r.VpcName = vpcName +} + +/* param addressPrefix: 如果为空,则不限制网段,如果不为空,10.0.0.0/8、172.16.0.0/12和192.168.0.0/16及它们包含的子网,且子网掩码长度为16-28之间(Optional) */ +func (r *CreateVpcRequest) SetAddressPrefix(addressPrefix string) { + r.AddressPrefix = &addressPrefix +} + +/* param description: vpc描述,允许输入UTF-8编码下的全部字符,不超过256字符。(Optional) */ +func (r *CreateVpcRequest) SetDescription(description string) { + r.Description = &description +} + +// GetRegionId returns path parameter 'regionId' if exist, +// otherwise return empty string +func (r CreateVpcRequest) GetRegionId() string { + return r.RegionId +} + +type CreateVpcResponse struct { + RequestID string `json:"requestId"` + Error core.ErrorResponse `json:"error"` + Result CreateVpcResult `json:"result"` +} + +type CreateVpcResult struct { + VpcId string `json:"vpcId"` +} \ No newline at end of file diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/CreateVpcPeering.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/CreateVpcPeering.go new file mode 100644 index 000000000..518a33f57 --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/CreateVpcPeering.go @@ -0,0 +1,155 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package apis + +import ( + "github.com/jdcloud-api/jdcloud-sdk-go/core" + vpc "github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models" +) + +type CreateVpcPeeringRequest struct { + + core.JDCloudRequest + + /* Region ID */ + RegionId string `json:"regionId"` + + /* VpcPeering的名字,不为空。名称取值范围:1-32个中文、英文大小写的字母、数字和下划线分隔符 */ + VpcPeeringName string `json:"vpcPeeringName"` + + /* VpcPeering本端Vpc的Id */ + VpcId string `json:"vpcId"` + + /* VpcPeering对端Vpc的Id */ + RemoteVpcId string `json:"remoteVpcId"` + + /* VpcPeering 描述,取值范围:0-256个中文、英文大小写的字母、数字和下划线分隔符 (Optional) */ + Description *string `json:"description"` +} + +/* + * param regionId: Region ID (Required) + * param vpcPeeringName: VpcPeering的名字,不为空。名称取值范围:1-32个中文、英文大小写的字母、数字和下划线分隔符 (Required) + * param vpcId: VpcPeering本端Vpc的Id (Required) + * param remoteVpcId: VpcPeering对端Vpc的Id (Required) + * + * @Deprecated, not compatible when mandatory parameters changed + */ +func NewCreateVpcPeeringRequest( + regionId string, + vpcPeeringName string, + vpcId string, + remoteVpcId string, +) *CreateVpcPeeringRequest { + + return &CreateVpcPeeringRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/vpcPeerings/", + Method: "POST", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + VpcPeeringName: vpcPeeringName, + VpcId: vpcId, + RemoteVpcId: remoteVpcId, + } +} + +/* + * param regionId: Region ID (Required) + * param vpcPeeringName: VpcPeering的名字,不为空。名称取值范围:1-32个中文、英文大小写的字母、数字和下划线分隔符 (Required) + * param vpcId: VpcPeering本端Vpc的Id (Required) + * param remoteVpcId: VpcPeering对端Vpc的Id (Required) + * param description: VpcPeering 描述,取值范围:0-256个中文、英文大小写的字母、数字和下划线分隔符 (Optional) + */ +func NewCreateVpcPeeringRequestWithAllParams( + regionId string, + vpcPeeringName string, + vpcId string, + remoteVpcId string, + description *string, +) *CreateVpcPeeringRequest { + + return &CreateVpcPeeringRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/vpcPeerings/", + Method: "POST", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + VpcPeeringName: vpcPeeringName, + VpcId: vpcId, + RemoteVpcId: remoteVpcId, + Description: description, + } +} + +/* This constructor has better compatible ability when API parameters changed */ +func NewCreateVpcPeeringRequestWithoutParam() *CreateVpcPeeringRequest { + + return &CreateVpcPeeringRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/vpcPeerings/", + Method: "POST", + Header: nil, + Version: "v1", + }, + } +} + +/* param regionId: Region ID(Required) */ +func (r *CreateVpcPeeringRequest) SetRegionId(regionId string) { + r.RegionId = regionId +} + +/* param vpcPeeringName: VpcPeering的名字,不为空。名称取值范围:1-32个中文、英文大小写的字母、数字和下划线分隔符(Required) */ +func (r *CreateVpcPeeringRequest) SetVpcPeeringName(vpcPeeringName string) { + r.VpcPeeringName = vpcPeeringName +} + +/* param vpcId: VpcPeering本端Vpc的Id(Required) */ +func (r *CreateVpcPeeringRequest) SetVpcId(vpcId string) { + r.VpcId = vpcId +} + +/* param remoteVpcId: VpcPeering对端Vpc的Id(Required) */ +func (r *CreateVpcPeeringRequest) SetRemoteVpcId(remoteVpcId string) { + r.RemoteVpcId = remoteVpcId +} + +/* param description: VpcPeering 描述,取值范围:0-256个中文、英文大小写的字母、数字和下划线分隔符(Optional) */ +func (r *CreateVpcPeeringRequest) SetDescription(description string) { + r.Description = &description +} + +// GetRegionId returns path parameter 'regionId' if exist, +// otherwise return empty string +func (r CreateVpcPeeringRequest) GetRegionId() string { + return r.RegionId +} + +type CreateVpcPeeringResponse struct { + RequestID string `json:"requestId"` + Error core.ErrorResponse `json:"error"` + Result CreateVpcPeeringResult `json:"result"` +} + +type CreateVpcPeeringResult struct { + VpcPeering vpc.VpcPeering `json:"vpcPeering"` +} \ No newline at end of file diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/DeleteElasticIp.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/DeleteElasticIp.go new file mode 100644 index 000000000..0aa9c8bcc --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/DeleteElasticIp.go @@ -0,0 +1,114 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package apis + +import ( + "github.com/jdcloud-api/jdcloud-sdk-go/core" +) + +type DeleteElasticIpRequest struct { + + core.JDCloudRequest + + /* Region ID */ + RegionId string `json:"regionId"` + + /* ElasticIp ID */ + ElasticIpId string `json:"elasticIpId"` +} + +/* + * param regionId: Region ID (Required) + * param elasticIpId: ElasticIp ID (Required) + * + * @Deprecated, not compatible when mandatory parameters changed + */ +func NewDeleteElasticIpRequest( + regionId string, + elasticIpId string, +) *DeleteElasticIpRequest { + + return &DeleteElasticIpRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/elasticIps/{elasticIpId}", + Method: "DELETE", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + ElasticIpId: elasticIpId, + } +} + +/* + * param regionId: Region ID (Required) + * param elasticIpId: ElasticIp ID (Required) + */ +func NewDeleteElasticIpRequestWithAllParams( + regionId string, + elasticIpId string, +) *DeleteElasticIpRequest { + + return &DeleteElasticIpRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/elasticIps/{elasticIpId}", + Method: "DELETE", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + ElasticIpId: elasticIpId, + } +} + +/* This constructor has better compatible ability when API parameters changed */ +func NewDeleteElasticIpRequestWithoutParam() *DeleteElasticIpRequest { + + return &DeleteElasticIpRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/elasticIps/{elasticIpId}", + Method: "DELETE", + Header: nil, + Version: "v1", + }, + } +} + +/* param regionId: Region ID(Required) */ +func (r *DeleteElasticIpRequest) SetRegionId(regionId string) { + r.RegionId = regionId +} + +/* param elasticIpId: ElasticIp ID(Required) */ +func (r *DeleteElasticIpRequest) SetElasticIpId(elasticIpId string) { + r.ElasticIpId = elasticIpId +} + +// GetRegionId returns path parameter 'regionId' if exist, +// otherwise return empty string +func (r DeleteElasticIpRequest) GetRegionId() string { + return r.RegionId +} + +type DeleteElasticIpResponse struct { + RequestID string `json:"requestId"` + Error core.ErrorResponse `json:"error"` + Result DeleteElasticIpResult `json:"result"` +} + +type DeleteElasticIpResult struct { +} \ No newline at end of file diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/DeleteNetworkAcl.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/DeleteNetworkAcl.go new file mode 100644 index 000000000..a4be188bb --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/DeleteNetworkAcl.go @@ -0,0 +1,114 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package apis + +import ( + "github.com/jdcloud-api/jdcloud-sdk-go/core" +) + +type DeleteNetworkAclRequest struct { + + core.JDCloudRequest + + /* Region ID */ + RegionId string `json:"regionId"` + + /* networkAclId ID */ + NetworkAclId string `json:"networkAclId"` +} + +/* + * param regionId: Region ID (Required) + * param networkAclId: networkAclId ID (Required) + * + * @Deprecated, not compatible when mandatory parameters changed + */ +func NewDeleteNetworkAclRequest( + regionId string, + networkAclId string, +) *DeleteNetworkAclRequest { + + return &DeleteNetworkAclRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/networkAcls/{networkAclId}", + Method: "DELETE", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + NetworkAclId: networkAclId, + } +} + +/* + * param regionId: Region ID (Required) + * param networkAclId: networkAclId ID (Required) + */ +func NewDeleteNetworkAclRequestWithAllParams( + regionId string, + networkAclId string, +) *DeleteNetworkAclRequest { + + return &DeleteNetworkAclRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/networkAcls/{networkAclId}", + Method: "DELETE", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + NetworkAclId: networkAclId, + } +} + +/* This constructor has better compatible ability when API parameters changed */ +func NewDeleteNetworkAclRequestWithoutParam() *DeleteNetworkAclRequest { + + return &DeleteNetworkAclRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/networkAcls/{networkAclId}", + Method: "DELETE", + Header: nil, + Version: "v1", + }, + } +} + +/* param regionId: Region ID(Required) */ +func (r *DeleteNetworkAclRequest) SetRegionId(regionId string) { + r.RegionId = regionId +} + +/* param networkAclId: networkAclId ID(Required) */ +func (r *DeleteNetworkAclRequest) SetNetworkAclId(networkAclId string) { + r.NetworkAclId = networkAclId +} + +// GetRegionId returns path parameter 'regionId' if exist, +// otherwise return empty string +func (r DeleteNetworkAclRequest) GetRegionId() string { + return r.RegionId +} + +type DeleteNetworkAclResponse struct { + RequestID string `json:"requestId"` + Error core.ErrorResponse `json:"error"` + Result DeleteNetworkAclResult `json:"result"` +} + +type DeleteNetworkAclResult struct { +} \ No newline at end of file diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/DeleteNetworkInterface.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/DeleteNetworkInterface.go new file mode 100644 index 000000000..3e64d6fde --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/DeleteNetworkInterface.go @@ -0,0 +1,114 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package apis + +import ( + "github.com/jdcloud-api/jdcloud-sdk-go/core" +) + +type DeleteNetworkInterfaceRequest struct { + + core.JDCloudRequest + + /* Region ID */ + RegionId string `json:"regionId"` + + /* networkInterface ID */ + NetworkInterfaceId string `json:"networkInterfaceId"` +} + +/* + * param regionId: Region ID (Required) + * param networkInterfaceId: networkInterface ID (Required) + * + * @Deprecated, not compatible when mandatory parameters changed + */ +func NewDeleteNetworkInterfaceRequest( + regionId string, + networkInterfaceId string, +) *DeleteNetworkInterfaceRequest { + + return &DeleteNetworkInterfaceRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/networkInterfaces/{networkInterfaceId}", + Method: "DELETE", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + NetworkInterfaceId: networkInterfaceId, + } +} + +/* + * param regionId: Region ID (Required) + * param networkInterfaceId: networkInterface ID (Required) + */ +func NewDeleteNetworkInterfaceRequestWithAllParams( + regionId string, + networkInterfaceId string, +) *DeleteNetworkInterfaceRequest { + + return &DeleteNetworkInterfaceRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/networkInterfaces/{networkInterfaceId}", + Method: "DELETE", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + NetworkInterfaceId: networkInterfaceId, + } +} + +/* This constructor has better compatible ability when API parameters changed */ +func NewDeleteNetworkInterfaceRequestWithoutParam() *DeleteNetworkInterfaceRequest { + + return &DeleteNetworkInterfaceRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/networkInterfaces/{networkInterfaceId}", + Method: "DELETE", + Header: nil, + Version: "v1", + }, + } +} + +/* param regionId: Region ID(Required) */ +func (r *DeleteNetworkInterfaceRequest) SetRegionId(regionId string) { + r.RegionId = regionId +} + +/* param networkInterfaceId: networkInterface ID(Required) */ +func (r *DeleteNetworkInterfaceRequest) SetNetworkInterfaceId(networkInterfaceId string) { + r.NetworkInterfaceId = networkInterfaceId +} + +// GetRegionId returns path parameter 'regionId' if exist, +// otherwise return empty string +func (r DeleteNetworkInterfaceRequest) GetRegionId() string { + return r.RegionId +} + +type DeleteNetworkInterfaceResponse struct { + RequestID string `json:"requestId"` + Error core.ErrorResponse `json:"error"` + Result DeleteNetworkInterfaceResult `json:"result"` +} + +type DeleteNetworkInterfaceResult struct { +} \ No newline at end of file diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/DeleteNetworkSecurityGroup.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/DeleteNetworkSecurityGroup.go new file mode 100644 index 000000000..f48291b13 --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/DeleteNetworkSecurityGroup.go @@ -0,0 +1,114 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package apis + +import ( + "github.com/jdcloud-api/jdcloud-sdk-go/core" +) + +type DeleteNetworkSecurityGroupRequest struct { + + core.JDCloudRequest + + /* Region ID */ + RegionId string `json:"regionId"` + + /* NetworkSecurityGroup ID */ + NetworkSecurityGroupId string `json:"networkSecurityGroupId"` +} + +/* + * param regionId: Region ID (Required) + * param networkSecurityGroupId: NetworkSecurityGroup ID (Required) + * + * @Deprecated, not compatible when mandatory parameters changed + */ +func NewDeleteNetworkSecurityGroupRequest( + regionId string, + networkSecurityGroupId string, +) *DeleteNetworkSecurityGroupRequest { + + return &DeleteNetworkSecurityGroupRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/networkSecurityGroups/{networkSecurityGroupId}", + Method: "DELETE", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + NetworkSecurityGroupId: networkSecurityGroupId, + } +} + +/* + * param regionId: Region ID (Required) + * param networkSecurityGroupId: NetworkSecurityGroup ID (Required) + */ +func NewDeleteNetworkSecurityGroupRequestWithAllParams( + regionId string, + networkSecurityGroupId string, +) *DeleteNetworkSecurityGroupRequest { + + return &DeleteNetworkSecurityGroupRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/networkSecurityGroups/{networkSecurityGroupId}", + Method: "DELETE", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + NetworkSecurityGroupId: networkSecurityGroupId, + } +} + +/* This constructor has better compatible ability when API parameters changed */ +func NewDeleteNetworkSecurityGroupRequestWithoutParam() *DeleteNetworkSecurityGroupRequest { + + return &DeleteNetworkSecurityGroupRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/networkSecurityGroups/{networkSecurityGroupId}", + Method: "DELETE", + Header: nil, + Version: "v1", + }, + } +} + +/* param regionId: Region ID(Required) */ +func (r *DeleteNetworkSecurityGroupRequest) SetRegionId(regionId string) { + r.RegionId = regionId +} + +/* param networkSecurityGroupId: NetworkSecurityGroup ID(Required) */ +func (r *DeleteNetworkSecurityGroupRequest) SetNetworkSecurityGroupId(networkSecurityGroupId string) { + r.NetworkSecurityGroupId = networkSecurityGroupId +} + +// GetRegionId returns path parameter 'regionId' if exist, +// otherwise return empty string +func (r DeleteNetworkSecurityGroupRequest) GetRegionId() string { + return r.RegionId +} + +type DeleteNetworkSecurityGroupResponse struct { + RequestID string `json:"requestId"` + Error core.ErrorResponse `json:"error"` + Result DeleteNetworkSecurityGroupResult `json:"result"` +} + +type DeleteNetworkSecurityGroupResult struct { +} \ No newline at end of file diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/DeleteRouteTable.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/DeleteRouteTable.go new file mode 100644 index 000000000..e272e5b2e --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/DeleteRouteTable.go @@ -0,0 +1,114 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package apis + +import ( + "github.com/jdcloud-api/jdcloud-sdk-go/core" +) + +type DeleteRouteTableRequest struct { + + core.JDCloudRequest + + /* Region ID */ + RegionId string `json:"regionId"` + + /* RouteTable ID */ + RouteTableId string `json:"routeTableId"` +} + +/* + * param regionId: Region ID (Required) + * param routeTableId: RouteTable ID (Required) + * + * @Deprecated, not compatible when mandatory parameters changed + */ +func NewDeleteRouteTableRequest( + regionId string, + routeTableId string, +) *DeleteRouteTableRequest { + + return &DeleteRouteTableRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/routeTables/{routeTableId}", + Method: "DELETE", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + RouteTableId: routeTableId, + } +} + +/* + * param regionId: Region ID (Required) + * param routeTableId: RouteTable ID (Required) + */ +func NewDeleteRouteTableRequestWithAllParams( + regionId string, + routeTableId string, +) *DeleteRouteTableRequest { + + return &DeleteRouteTableRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/routeTables/{routeTableId}", + Method: "DELETE", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + RouteTableId: routeTableId, + } +} + +/* This constructor has better compatible ability when API parameters changed */ +func NewDeleteRouteTableRequestWithoutParam() *DeleteRouteTableRequest { + + return &DeleteRouteTableRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/routeTables/{routeTableId}", + Method: "DELETE", + Header: nil, + Version: "v1", + }, + } +} + +/* param regionId: Region ID(Required) */ +func (r *DeleteRouteTableRequest) SetRegionId(regionId string) { + r.RegionId = regionId +} + +/* param routeTableId: RouteTable ID(Required) */ +func (r *DeleteRouteTableRequest) SetRouteTableId(routeTableId string) { + r.RouteTableId = routeTableId +} + +// GetRegionId returns path parameter 'regionId' if exist, +// otherwise return empty string +func (r DeleteRouteTableRequest) GetRegionId() string { + return r.RegionId +} + +type DeleteRouteTableResponse struct { + RequestID string `json:"requestId"` + Error core.ErrorResponse `json:"error"` + Result DeleteRouteTableResult `json:"result"` +} + +type DeleteRouteTableResult struct { +} \ No newline at end of file diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/DeleteSubnet.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/DeleteSubnet.go new file mode 100644 index 000000000..15c2be6af --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/DeleteSubnet.go @@ -0,0 +1,114 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package apis + +import ( + "github.com/jdcloud-api/jdcloud-sdk-go/core" +) + +type DeleteSubnetRequest struct { + + core.JDCloudRequest + + /* Region ID */ + RegionId string `json:"regionId"` + + /* Subnet ID */ + SubnetId string `json:"subnetId"` +} + +/* + * param regionId: Region ID (Required) + * param subnetId: Subnet ID (Required) + * + * @Deprecated, not compatible when mandatory parameters changed + */ +func NewDeleteSubnetRequest( + regionId string, + subnetId string, +) *DeleteSubnetRequest { + + return &DeleteSubnetRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/subnets/{subnetId}", + Method: "DELETE", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + SubnetId: subnetId, + } +} + +/* + * param regionId: Region ID (Required) + * param subnetId: Subnet ID (Required) + */ +func NewDeleteSubnetRequestWithAllParams( + regionId string, + subnetId string, +) *DeleteSubnetRequest { + + return &DeleteSubnetRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/subnets/{subnetId}", + Method: "DELETE", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + SubnetId: subnetId, + } +} + +/* This constructor has better compatible ability when API parameters changed */ +func NewDeleteSubnetRequestWithoutParam() *DeleteSubnetRequest { + + return &DeleteSubnetRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/subnets/{subnetId}", + Method: "DELETE", + Header: nil, + Version: "v1", + }, + } +} + +/* param regionId: Region ID(Required) */ +func (r *DeleteSubnetRequest) SetRegionId(regionId string) { + r.RegionId = regionId +} + +/* param subnetId: Subnet ID(Required) */ +func (r *DeleteSubnetRequest) SetSubnetId(subnetId string) { + r.SubnetId = subnetId +} + +// GetRegionId returns path parameter 'regionId' if exist, +// otherwise return empty string +func (r DeleteSubnetRequest) GetRegionId() string { + return r.RegionId +} + +type DeleteSubnetResponse struct { + RequestID string `json:"requestId"` + Error core.ErrorResponse `json:"error"` + Result DeleteSubnetResult `json:"result"` +} + +type DeleteSubnetResult struct { +} \ No newline at end of file diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/DeleteVpc.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/DeleteVpc.go new file mode 100644 index 000000000..ef98f098d --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/DeleteVpc.go @@ -0,0 +1,114 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package apis + +import ( + "github.com/jdcloud-api/jdcloud-sdk-go/core" +) + +type DeleteVpcRequest struct { + + core.JDCloudRequest + + /* Region ID */ + RegionId string `json:"regionId"` + + /* Vpc ID */ + VpcId string `json:"vpcId"` +} + +/* + * param regionId: Region ID (Required) + * param vpcId: Vpc ID (Required) + * + * @Deprecated, not compatible when mandatory parameters changed + */ +func NewDeleteVpcRequest( + regionId string, + vpcId string, +) *DeleteVpcRequest { + + return &DeleteVpcRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/vpcs/{vpcId}", + Method: "DELETE", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + VpcId: vpcId, + } +} + +/* + * param regionId: Region ID (Required) + * param vpcId: Vpc ID (Required) + */ +func NewDeleteVpcRequestWithAllParams( + regionId string, + vpcId string, +) *DeleteVpcRequest { + + return &DeleteVpcRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/vpcs/{vpcId}", + Method: "DELETE", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + VpcId: vpcId, + } +} + +/* This constructor has better compatible ability when API parameters changed */ +func NewDeleteVpcRequestWithoutParam() *DeleteVpcRequest { + + return &DeleteVpcRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/vpcs/{vpcId}", + Method: "DELETE", + Header: nil, + Version: "v1", + }, + } +} + +/* param regionId: Region ID(Required) */ +func (r *DeleteVpcRequest) SetRegionId(regionId string) { + r.RegionId = regionId +} + +/* param vpcId: Vpc ID(Required) */ +func (r *DeleteVpcRequest) SetVpcId(vpcId string) { + r.VpcId = vpcId +} + +// GetRegionId returns path parameter 'regionId' if exist, +// otherwise return empty string +func (r DeleteVpcRequest) GetRegionId() string { + return r.RegionId +} + +type DeleteVpcResponse struct { + RequestID string `json:"requestId"` + Error core.ErrorResponse `json:"error"` + Result DeleteVpcResult `json:"result"` +} + +type DeleteVpcResult struct { +} \ No newline at end of file diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/DeleteVpcPeering.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/DeleteVpcPeering.go new file mode 100644 index 000000000..b77e471dd --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/DeleteVpcPeering.go @@ -0,0 +1,114 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package apis + +import ( + "github.com/jdcloud-api/jdcloud-sdk-go/core" +) + +type DeleteVpcPeeringRequest struct { + + core.JDCloudRequest + + /* Region ID */ + RegionId string `json:"regionId"` + + /* vpcPeeringId ID */ + VpcPeeringId string `json:"vpcPeeringId"` +} + +/* + * param regionId: Region ID (Required) + * param vpcPeeringId: vpcPeeringId ID (Required) + * + * @Deprecated, not compatible when mandatory parameters changed + */ +func NewDeleteVpcPeeringRequest( + regionId string, + vpcPeeringId string, +) *DeleteVpcPeeringRequest { + + return &DeleteVpcPeeringRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/vpcPeerings/{vpcPeeringId}", + Method: "DELETE", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + VpcPeeringId: vpcPeeringId, + } +} + +/* + * param regionId: Region ID (Required) + * param vpcPeeringId: vpcPeeringId ID (Required) + */ +func NewDeleteVpcPeeringRequestWithAllParams( + regionId string, + vpcPeeringId string, +) *DeleteVpcPeeringRequest { + + return &DeleteVpcPeeringRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/vpcPeerings/{vpcPeeringId}", + Method: "DELETE", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + VpcPeeringId: vpcPeeringId, + } +} + +/* This constructor has better compatible ability when API parameters changed */ +func NewDeleteVpcPeeringRequestWithoutParam() *DeleteVpcPeeringRequest { + + return &DeleteVpcPeeringRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/vpcPeerings/{vpcPeeringId}", + Method: "DELETE", + Header: nil, + Version: "v1", + }, + } +} + +/* param regionId: Region ID(Required) */ +func (r *DeleteVpcPeeringRequest) SetRegionId(regionId string) { + r.RegionId = regionId +} + +/* param vpcPeeringId: vpcPeeringId ID(Required) */ +func (r *DeleteVpcPeeringRequest) SetVpcPeeringId(vpcPeeringId string) { + r.VpcPeeringId = vpcPeeringId +} + +// GetRegionId returns path parameter 'regionId' if exist, +// otherwise return empty string +func (r DeleteVpcPeeringRequest) GetRegionId() string { + return r.RegionId +} + +type DeleteVpcPeeringResponse struct { + RequestID string `json:"requestId"` + Error core.ErrorResponse `json:"error"` + Result DeleteVpcPeeringResult `json:"result"` +} + +type DeleteVpcPeeringResult struct { +} \ No newline at end of file diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/DescribeElasticIp.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/DescribeElasticIp.go new file mode 100644 index 000000000..6ecb5a97c --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/DescribeElasticIp.go @@ -0,0 +1,116 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package apis + +import ( + "github.com/jdcloud-api/jdcloud-sdk-go/core" + vpc "github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models" +) + +type DescribeElasticIpRequest struct { + + core.JDCloudRequest + + /* Region ID */ + RegionId string `json:"regionId"` + + /* ElasticIp ID */ + ElasticIpId string `json:"elasticIpId"` +} + +/* + * param regionId: Region ID (Required) + * param elasticIpId: ElasticIp ID (Required) + * + * @Deprecated, not compatible when mandatory parameters changed + */ +func NewDescribeElasticIpRequest( + regionId string, + elasticIpId string, +) *DescribeElasticIpRequest { + + return &DescribeElasticIpRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/elasticIps/{elasticIpId}", + Method: "GET", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + ElasticIpId: elasticIpId, + } +} + +/* + * param regionId: Region ID (Required) + * param elasticIpId: ElasticIp ID (Required) + */ +func NewDescribeElasticIpRequestWithAllParams( + regionId string, + elasticIpId string, +) *DescribeElasticIpRequest { + + return &DescribeElasticIpRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/elasticIps/{elasticIpId}", + Method: "GET", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + ElasticIpId: elasticIpId, + } +} + +/* This constructor has better compatible ability when API parameters changed */ +func NewDescribeElasticIpRequestWithoutParam() *DescribeElasticIpRequest { + + return &DescribeElasticIpRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/elasticIps/{elasticIpId}", + Method: "GET", + Header: nil, + Version: "v1", + }, + } +} + +/* param regionId: Region ID(Required) */ +func (r *DescribeElasticIpRequest) SetRegionId(regionId string) { + r.RegionId = regionId +} + +/* param elasticIpId: ElasticIp ID(Required) */ +func (r *DescribeElasticIpRequest) SetElasticIpId(elasticIpId string) { + r.ElasticIpId = elasticIpId +} + +// GetRegionId returns path parameter 'regionId' if exist, +// otherwise return empty string +func (r DescribeElasticIpRequest) GetRegionId() string { + return r.RegionId +} + +type DescribeElasticIpResponse struct { + RequestID string `json:"requestId"` + Error core.ErrorResponse `json:"error"` + Result DescribeElasticIpResult `json:"result"` +} + +type DescribeElasticIpResult struct { + ElasticIp vpc.ElasticIp `json:"elasticIp"` +} \ No newline at end of file diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/DescribeElasticIps.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/DescribeElasticIps.go new file mode 100644 index 000000000..94927eff2 --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/DescribeElasticIps.go @@ -0,0 +1,146 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package apis + +import ( + "github.com/jdcloud-api/jdcloud-sdk-go/core" + vpc "github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models" + common "github.com/jdcloud-api/jdcloud-sdk-go/services/common/models" +) + +type DescribeElasticIpsRequest struct { + + core.JDCloudRequest + + /* Region ID */ + RegionId string `json:"regionId"` + + /* 页码, 默认为1, 取值范围:[1,∞), 页码超过总页数时, 显示最后一页 (Optional) */ + PageNumber *int `json:"pageNumber"` + + /* 分页大小,默认为20,取值范围:[10,100] (Optional) */ + PageSize *int `json:"pageSize"` + + /* elasticIpIds - elasticip id数组条件,支持多个 +elasticIpAddress - eip的IP地址,支持单个 +chargeStatus - eip的费用支付状态,normal(正常状态) or overdue(预付费已到期) or arrear(欠费状态),支持单个 + (Optional) */ + Filters []common.Filter `json:"filters"` +} + +/* + * param regionId: Region ID (Required) + * + * @Deprecated, not compatible when mandatory parameters changed + */ +func NewDescribeElasticIpsRequest( + regionId string, +) *DescribeElasticIpsRequest { + + return &DescribeElasticIpsRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/elasticIps/", + Method: "GET", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + } +} + +/* + * param regionId: Region ID (Required) + * param pageNumber: 页码, 默认为1, 取值范围:[1,∞), 页码超过总页数时, 显示最后一页 (Optional) + * param pageSize: 分页大小,默认为20,取值范围:[10,100] (Optional) + * param filters: elasticIpIds - elasticip id数组条件,支持多个 +elasticIpAddress - eip的IP地址,支持单个 +chargeStatus - eip的费用支付状态,normal(正常状态) or overdue(预付费已到期) or arrear(欠费状态),支持单个 + (Optional) + */ +func NewDescribeElasticIpsRequestWithAllParams( + regionId string, + pageNumber *int, + pageSize *int, + filters []common.Filter, +) *DescribeElasticIpsRequest { + + return &DescribeElasticIpsRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/elasticIps/", + Method: "GET", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + PageNumber: pageNumber, + PageSize: pageSize, + Filters: filters, + } +} + +/* This constructor has better compatible ability when API parameters changed */ +func NewDescribeElasticIpsRequestWithoutParam() *DescribeElasticIpsRequest { + + return &DescribeElasticIpsRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/elasticIps/", + Method: "GET", + Header: nil, + Version: "v1", + }, + } +} + +/* param regionId: Region ID(Required) */ +func (r *DescribeElasticIpsRequest) SetRegionId(regionId string) { + r.RegionId = regionId +} + +/* param pageNumber: 页码, 默认为1, 取值范围:[1,∞), 页码超过总页数时, 显示最后一页(Optional) */ +func (r *DescribeElasticIpsRequest) SetPageNumber(pageNumber int) { + r.PageNumber = &pageNumber +} + +/* param pageSize: 分页大小,默认为20,取值范围:[10,100](Optional) */ +func (r *DescribeElasticIpsRequest) SetPageSize(pageSize int) { + r.PageSize = &pageSize +} + +/* param filters: elasticIpIds - elasticip id数组条件,支持多个 +elasticIpAddress - eip的IP地址,支持单个 +chargeStatus - eip的费用支付状态,normal(正常状态) or overdue(预付费已到期) or arrear(欠费状态),支持单个 +(Optional) */ +func (r *DescribeElasticIpsRequest) SetFilters(filters []common.Filter) { + r.Filters = filters +} + +// GetRegionId returns path parameter 'regionId' if exist, +// otherwise return empty string +func (r DescribeElasticIpsRequest) GetRegionId() string { + return r.RegionId +} + +type DescribeElasticIpsResponse struct { + RequestID string `json:"requestId"` + Error core.ErrorResponse `json:"error"` + Result DescribeElasticIpsResult `json:"result"` +} + +type DescribeElasticIpsResult struct { + ElasticIps []vpc.ElasticIp `json:"elasticIps"` + TotalCount int `json:"totalCount"` +} \ No newline at end of file diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/DescribeNetworkAcl.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/DescribeNetworkAcl.go new file mode 100644 index 000000000..6692a7f70 --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/DescribeNetworkAcl.go @@ -0,0 +1,116 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package apis + +import ( + "github.com/jdcloud-api/jdcloud-sdk-go/core" + vpc "github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models" +) + +type DescribeNetworkAclRequest struct { + + core.JDCloudRequest + + /* Region ID */ + RegionId string `json:"regionId"` + + /* networkAclId ID */ + NetworkAclId string `json:"networkAclId"` +} + +/* + * param regionId: Region ID (Required) + * param networkAclId: networkAclId ID (Required) + * + * @Deprecated, not compatible when mandatory parameters changed + */ +func NewDescribeNetworkAclRequest( + regionId string, + networkAclId string, +) *DescribeNetworkAclRequest { + + return &DescribeNetworkAclRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/networkAcls/{networkAclId}", + Method: "GET", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + NetworkAclId: networkAclId, + } +} + +/* + * param regionId: Region ID (Required) + * param networkAclId: networkAclId ID (Required) + */ +func NewDescribeNetworkAclRequestWithAllParams( + regionId string, + networkAclId string, +) *DescribeNetworkAclRequest { + + return &DescribeNetworkAclRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/networkAcls/{networkAclId}", + Method: "GET", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + NetworkAclId: networkAclId, + } +} + +/* This constructor has better compatible ability when API parameters changed */ +func NewDescribeNetworkAclRequestWithoutParam() *DescribeNetworkAclRequest { + + return &DescribeNetworkAclRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/networkAcls/{networkAclId}", + Method: "GET", + Header: nil, + Version: "v1", + }, + } +} + +/* param regionId: Region ID(Required) */ +func (r *DescribeNetworkAclRequest) SetRegionId(regionId string) { + r.RegionId = regionId +} + +/* param networkAclId: networkAclId ID(Required) */ +func (r *DescribeNetworkAclRequest) SetNetworkAclId(networkAclId string) { + r.NetworkAclId = networkAclId +} + +// GetRegionId returns path parameter 'regionId' if exist, +// otherwise return empty string +func (r DescribeNetworkAclRequest) GetRegionId() string { + return r.RegionId +} + +type DescribeNetworkAclResponse struct { + RequestID string `json:"requestId"` + Error core.ErrorResponse `json:"error"` + Result DescribeNetworkAclResult `json:"result"` +} + +type DescribeNetworkAclResult struct { + NetworkAcl vpc.NetworkAcl `json:"networkAcl"` +} \ No newline at end of file diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/DescribeNetworkAcls.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/DescribeNetworkAcls.go new file mode 100644 index 000000000..5344e55ad --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/DescribeNetworkAcls.go @@ -0,0 +1,146 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package apis + +import ( + "github.com/jdcloud-api/jdcloud-sdk-go/core" + vpc "github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models" + common "github.com/jdcloud-api/jdcloud-sdk-go/services/common/models" +) + +type DescribeNetworkAclsRequest struct { + + core.JDCloudRequest + + /* Region ID */ + RegionId string `json:"regionId"` + + /* 页码, 默认为1, 取值范围:[1,∞), 页码超过总页数时, 显示最后一页 (Optional) */ + PageNumber *int `json:"pageNumber"` + + /* 分页大小,默认为20,取值范围:[10,100] (Optional) */ + PageSize *int `json:"pageSize"` + + /* networkAclIds - 弹性网卡ID列表,支持多个 +networkAclNames - 弹性网卡名称列表,支持多个 +vpcId - 弹性网卡所属vpc Id,支持单个 + (Optional) */ + Filters []common.Filter `json:"filters"` +} + +/* + * param regionId: Region ID (Required) + * + * @Deprecated, not compatible when mandatory parameters changed + */ +func NewDescribeNetworkAclsRequest( + regionId string, +) *DescribeNetworkAclsRequest { + + return &DescribeNetworkAclsRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/networkAcls/", + Method: "GET", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + } +} + +/* + * param regionId: Region ID (Required) + * param pageNumber: 页码, 默认为1, 取值范围:[1,∞), 页码超过总页数时, 显示最后一页 (Optional) + * param pageSize: 分页大小,默认为20,取值范围:[10,100] (Optional) + * param filters: networkAclIds - 弹性网卡ID列表,支持多个 +networkAclNames - 弹性网卡名称列表,支持多个 +vpcId - 弹性网卡所属vpc Id,支持单个 + (Optional) + */ +func NewDescribeNetworkAclsRequestWithAllParams( + regionId string, + pageNumber *int, + pageSize *int, + filters []common.Filter, +) *DescribeNetworkAclsRequest { + + return &DescribeNetworkAclsRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/networkAcls/", + Method: "GET", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + PageNumber: pageNumber, + PageSize: pageSize, + Filters: filters, + } +} + +/* This constructor has better compatible ability when API parameters changed */ +func NewDescribeNetworkAclsRequestWithoutParam() *DescribeNetworkAclsRequest { + + return &DescribeNetworkAclsRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/networkAcls/", + Method: "GET", + Header: nil, + Version: "v1", + }, + } +} + +/* param regionId: Region ID(Required) */ +func (r *DescribeNetworkAclsRequest) SetRegionId(regionId string) { + r.RegionId = regionId +} + +/* param pageNumber: 页码, 默认为1, 取值范围:[1,∞), 页码超过总页数时, 显示最后一页(Optional) */ +func (r *DescribeNetworkAclsRequest) SetPageNumber(pageNumber int) { + r.PageNumber = &pageNumber +} + +/* param pageSize: 分页大小,默认为20,取值范围:[10,100](Optional) */ +func (r *DescribeNetworkAclsRequest) SetPageSize(pageSize int) { + r.PageSize = &pageSize +} + +/* param filters: networkAclIds - 弹性网卡ID列表,支持多个 +networkAclNames - 弹性网卡名称列表,支持多个 +vpcId - 弹性网卡所属vpc Id,支持单个 +(Optional) */ +func (r *DescribeNetworkAclsRequest) SetFilters(filters []common.Filter) { + r.Filters = filters +} + +// GetRegionId returns path parameter 'regionId' if exist, +// otherwise return empty string +func (r DescribeNetworkAclsRequest) GetRegionId() string { + return r.RegionId +} + +type DescribeNetworkAclsResponse struct { + RequestID string `json:"requestId"` + Error core.ErrorResponse `json:"error"` + Result DescribeNetworkAclsResult `json:"result"` +} + +type DescribeNetworkAclsResult struct { + NetworkAcls []vpc.NetworkAcl `json:"networkAcls"` + TotalCount int `json:"totalCount"` +} \ No newline at end of file diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/DescribeNetworkInterface.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/DescribeNetworkInterface.go new file mode 100644 index 000000000..284b32b5d --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/DescribeNetworkInterface.go @@ -0,0 +1,116 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package apis + +import ( + "github.com/jdcloud-api/jdcloud-sdk-go/core" + vpc "github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models" +) + +type DescribeNetworkInterfaceRequest struct { + + core.JDCloudRequest + + /* Region ID */ + RegionId string `json:"regionId"` + + /* networkInterface ID */ + NetworkInterfaceId string `json:"networkInterfaceId"` +} + +/* + * param regionId: Region ID (Required) + * param networkInterfaceId: networkInterface ID (Required) + * + * @Deprecated, not compatible when mandatory parameters changed + */ +func NewDescribeNetworkInterfaceRequest( + regionId string, + networkInterfaceId string, +) *DescribeNetworkInterfaceRequest { + + return &DescribeNetworkInterfaceRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/networkInterfaces/{networkInterfaceId}", + Method: "GET", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + NetworkInterfaceId: networkInterfaceId, + } +} + +/* + * param regionId: Region ID (Required) + * param networkInterfaceId: networkInterface ID (Required) + */ +func NewDescribeNetworkInterfaceRequestWithAllParams( + regionId string, + networkInterfaceId string, +) *DescribeNetworkInterfaceRequest { + + return &DescribeNetworkInterfaceRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/networkInterfaces/{networkInterfaceId}", + Method: "GET", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + NetworkInterfaceId: networkInterfaceId, + } +} + +/* This constructor has better compatible ability when API parameters changed */ +func NewDescribeNetworkInterfaceRequestWithoutParam() *DescribeNetworkInterfaceRequest { + + return &DescribeNetworkInterfaceRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/networkInterfaces/{networkInterfaceId}", + Method: "GET", + Header: nil, + Version: "v1", + }, + } +} + +/* param regionId: Region ID(Required) */ +func (r *DescribeNetworkInterfaceRequest) SetRegionId(regionId string) { + r.RegionId = regionId +} + +/* param networkInterfaceId: networkInterface ID(Required) */ +func (r *DescribeNetworkInterfaceRequest) SetNetworkInterfaceId(networkInterfaceId string) { + r.NetworkInterfaceId = networkInterfaceId +} + +// GetRegionId returns path parameter 'regionId' if exist, +// otherwise return empty string +func (r DescribeNetworkInterfaceRequest) GetRegionId() string { + return r.RegionId +} + +type DescribeNetworkInterfaceResponse struct { + RequestID string `json:"requestId"` + Error core.ErrorResponse `json:"error"` + Result DescribeNetworkInterfaceResult `json:"result"` +} + +type DescribeNetworkInterfaceResult struct { + NetworkInterface vpc.NetworkInterface `json:"networkInterface"` +} \ No newline at end of file diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/DescribeNetworkInterfaces.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/DescribeNetworkInterfaces.go new file mode 100644 index 000000000..2503ca0e1 --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/DescribeNetworkInterfaces.go @@ -0,0 +1,152 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package apis + +import ( + "github.com/jdcloud-api/jdcloud-sdk-go/core" + vpc "github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models" + common "github.com/jdcloud-api/jdcloud-sdk-go/services/common/models" +) + +type DescribeNetworkInterfacesRequest struct { + + core.JDCloudRequest + + /* Region ID */ + RegionId string `json:"regionId"` + + /* 页码, 默认为1, 取值范围:[1,∞), 页码超过总页数时, 显示最后一页 (Optional) */ + PageNumber *int `json:"pageNumber"` + + /* 分页大小,默认为20,取值范围:[10,100] (Optional) */ + PageSize *int `json:"pageSize"` + + /* networkInterfaceIds - 弹性网卡ID列表,支持多个 +networkInterfaceNames - 弹性网卡名称列表,支持多个 +vpcId - 弹性网卡所属vpc Id,支持单个 +subnetId - 弹性网卡所属子网Id,支持单个 +role - 网卡角色,取值范围:Primary(主网卡)、Secondary(辅助网卡),支持单个 + (Optional) */ + Filters []common.Filter `json:"filters"` +} + +/* + * param regionId: Region ID (Required) + * + * @Deprecated, not compatible when mandatory parameters changed + */ +func NewDescribeNetworkInterfacesRequest( + regionId string, +) *DescribeNetworkInterfacesRequest { + + return &DescribeNetworkInterfacesRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/networkInterfaces/", + Method: "GET", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + } +} + +/* + * param regionId: Region ID (Required) + * param pageNumber: 页码, 默认为1, 取值范围:[1,∞), 页码超过总页数时, 显示最后一页 (Optional) + * param pageSize: 分页大小,默认为20,取值范围:[10,100] (Optional) + * param filters: networkInterfaceIds - 弹性网卡ID列表,支持多个 +networkInterfaceNames - 弹性网卡名称列表,支持多个 +vpcId - 弹性网卡所属vpc Id,支持单个 +subnetId - 弹性网卡所属子网Id,支持单个 +role - 网卡角色,取值范围:Primary(主网卡)、Secondary(辅助网卡),支持单个 + (Optional) + */ +func NewDescribeNetworkInterfacesRequestWithAllParams( + regionId string, + pageNumber *int, + pageSize *int, + filters []common.Filter, +) *DescribeNetworkInterfacesRequest { + + return &DescribeNetworkInterfacesRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/networkInterfaces/", + Method: "GET", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + PageNumber: pageNumber, + PageSize: pageSize, + Filters: filters, + } +} + +/* This constructor has better compatible ability when API parameters changed */ +func NewDescribeNetworkInterfacesRequestWithoutParam() *DescribeNetworkInterfacesRequest { + + return &DescribeNetworkInterfacesRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/networkInterfaces/", + Method: "GET", + Header: nil, + Version: "v1", + }, + } +} + +/* param regionId: Region ID(Required) */ +func (r *DescribeNetworkInterfacesRequest) SetRegionId(regionId string) { + r.RegionId = regionId +} + +/* param pageNumber: 页码, 默认为1, 取值范围:[1,∞), 页码超过总页数时, 显示最后一页(Optional) */ +func (r *DescribeNetworkInterfacesRequest) SetPageNumber(pageNumber int) { + r.PageNumber = &pageNumber +} + +/* param pageSize: 分页大小,默认为20,取值范围:[10,100](Optional) */ +func (r *DescribeNetworkInterfacesRequest) SetPageSize(pageSize int) { + r.PageSize = &pageSize +} + +/* param filters: networkInterfaceIds - 弹性网卡ID列表,支持多个 +networkInterfaceNames - 弹性网卡名称列表,支持多个 +vpcId - 弹性网卡所属vpc Id,支持单个 +subnetId - 弹性网卡所属子网Id,支持单个 +role - 网卡角色,取值范围:Primary(主网卡)、Secondary(辅助网卡),支持单个 +(Optional) */ +func (r *DescribeNetworkInterfacesRequest) SetFilters(filters []common.Filter) { + r.Filters = filters +} + +// GetRegionId returns path parameter 'regionId' if exist, +// otherwise return empty string +func (r DescribeNetworkInterfacesRequest) GetRegionId() string { + return r.RegionId +} + +type DescribeNetworkInterfacesResponse struct { + RequestID string `json:"requestId"` + Error core.ErrorResponse `json:"error"` + Result DescribeNetworkInterfacesResult `json:"result"` +} + +type DescribeNetworkInterfacesResult struct { + NetworkInterfaces []vpc.NetworkInterface `json:"networkInterfaces"` + TotalCount int `json:"totalCount"` +} \ No newline at end of file diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/DescribeNetworkSecurityGroup.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/DescribeNetworkSecurityGroup.go new file mode 100644 index 000000000..b7f29d797 --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/DescribeNetworkSecurityGroup.go @@ -0,0 +1,116 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package apis + +import ( + "github.com/jdcloud-api/jdcloud-sdk-go/core" + vpc "github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models" +) + +type DescribeNetworkSecurityGroupRequest struct { + + core.JDCloudRequest + + /* Region ID */ + RegionId string `json:"regionId"` + + /* NetworkSecurityGroup ID */ + NetworkSecurityGroupId string `json:"networkSecurityGroupId"` +} + +/* + * param regionId: Region ID (Required) + * param networkSecurityGroupId: NetworkSecurityGroup ID (Required) + * + * @Deprecated, not compatible when mandatory parameters changed + */ +func NewDescribeNetworkSecurityGroupRequest( + regionId string, + networkSecurityGroupId string, +) *DescribeNetworkSecurityGroupRequest { + + return &DescribeNetworkSecurityGroupRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/networkSecurityGroups/{networkSecurityGroupId}", + Method: "GET", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + NetworkSecurityGroupId: networkSecurityGroupId, + } +} + +/* + * param regionId: Region ID (Required) + * param networkSecurityGroupId: NetworkSecurityGroup ID (Required) + */ +func NewDescribeNetworkSecurityGroupRequestWithAllParams( + regionId string, + networkSecurityGroupId string, +) *DescribeNetworkSecurityGroupRequest { + + return &DescribeNetworkSecurityGroupRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/networkSecurityGroups/{networkSecurityGroupId}", + Method: "GET", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + NetworkSecurityGroupId: networkSecurityGroupId, + } +} + +/* This constructor has better compatible ability when API parameters changed */ +func NewDescribeNetworkSecurityGroupRequestWithoutParam() *DescribeNetworkSecurityGroupRequest { + + return &DescribeNetworkSecurityGroupRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/networkSecurityGroups/{networkSecurityGroupId}", + Method: "GET", + Header: nil, + Version: "v1", + }, + } +} + +/* param regionId: Region ID(Required) */ +func (r *DescribeNetworkSecurityGroupRequest) SetRegionId(regionId string) { + r.RegionId = regionId +} + +/* param networkSecurityGroupId: NetworkSecurityGroup ID(Required) */ +func (r *DescribeNetworkSecurityGroupRequest) SetNetworkSecurityGroupId(networkSecurityGroupId string) { + r.NetworkSecurityGroupId = networkSecurityGroupId +} + +// GetRegionId returns path parameter 'regionId' if exist, +// otherwise return empty string +func (r DescribeNetworkSecurityGroupRequest) GetRegionId() string { + return r.RegionId +} + +type DescribeNetworkSecurityGroupResponse struct { + RequestID string `json:"requestId"` + Error core.ErrorResponse `json:"error"` + Result DescribeNetworkSecurityGroupResult `json:"result"` +} + +type DescribeNetworkSecurityGroupResult struct { + NetworkSecurityGroup vpc.NetworkSecurityGroup `json:"networkSecurityGroup"` +} \ No newline at end of file diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/DescribeNetworkSecurityGroups.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/DescribeNetworkSecurityGroups.go new file mode 100644 index 000000000..e85cc7170 --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/DescribeNetworkSecurityGroups.go @@ -0,0 +1,146 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package apis + +import ( + "github.com/jdcloud-api/jdcloud-sdk-go/core" + vpc "github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models" + common "github.com/jdcloud-api/jdcloud-sdk-go/services/common/models" +) + +type DescribeNetworkSecurityGroupsRequest struct { + + core.JDCloudRequest + + /* Region ID */ + RegionId string `json:"regionId"` + + /* 页码, 默认为1, 取值范围:[1,∞), 页码超过总页数时, 显示最后一页 (Optional) */ + PageNumber *int `json:"pageNumber"` + + /* 分页大小,默认为20,取值范围:[10,100] (Optional) */ + PageSize *int `json:"pageSize"` + + /* networkSecurityGroupIds - 安全组ID列表,支持多个 +networkSecurityGroupNames - 安全组名称列表,支持多个 +vpcId - 安全组所属vpc Id,支持单个 + (Optional) */ + Filters []common.Filter `json:"filters"` +} + +/* + * param regionId: Region ID (Required) + * + * @Deprecated, not compatible when mandatory parameters changed + */ +func NewDescribeNetworkSecurityGroupsRequest( + regionId string, +) *DescribeNetworkSecurityGroupsRequest { + + return &DescribeNetworkSecurityGroupsRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/networkSecurityGroups/", + Method: "GET", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + } +} + +/* + * param regionId: Region ID (Required) + * param pageNumber: 页码, 默认为1, 取值范围:[1,∞), 页码超过总页数时, 显示最后一页 (Optional) + * param pageSize: 分页大小,默认为20,取值范围:[10,100] (Optional) + * param filters: networkSecurityGroupIds - 安全组ID列表,支持多个 +networkSecurityGroupNames - 安全组名称列表,支持多个 +vpcId - 安全组所属vpc Id,支持单个 + (Optional) + */ +func NewDescribeNetworkSecurityGroupsRequestWithAllParams( + regionId string, + pageNumber *int, + pageSize *int, + filters []common.Filter, +) *DescribeNetworkSecurityGroupsRequest { + + return &DescribeNetworkSecurityGroupsRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/networkSecurityGroups/", + Method: "GET", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + PageNumber: pageNumber, + PageSize: pageSize, + Filters: filters, + } +} + +/* This constructor has better compatible ability when API parameters changed */ +func NewDescribeNetworkSecurityGroupsRequestWithoutParam() *DescribeNetworkSecurityGroupsRequest { + + return &DescribeNetworkSecurityGroupsRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/networkSecurityGroups/", + Method: "GET", + Header: nil, + Version: "v1", + }, + } +} + +/* param regionId: Region ID(Required) */ +func (r *DescribeNetworkSecurityGroupsRequest) SetRegionId(regionId string) { + r.RegionId = regionId +} + +/* param pageNumber: 页码, 默认为1, 取值范围:[1,∞), 页码超过总页数时, 显示最后一页(Optional) */ +func (r *DescribeNetworkSecurityGroupsRequest) SetPageNumber(pageNumber int) { + r.PageNumber = &pageNumber +} + +/* param pageSize: 分页大小,默认为20,取值范围:[10,100](Optional) */ +func (r *DescribeNetworkSecurityGroupsRequest) SetPageSize(pageSize int) { + r.PageSize = &pageSize +} + +/* param filters: networkSecurityGroupIds - 安全组ID列表,支持多个 +networkSecurityGroupNames - 安全组名称列表,支持多个 +vpcId - 安全组所属vpc Id,支持单个 +(Optional) */ +func (r *DescribeNetworkSecurityGroupsRequest) SetFilters(filters []common.Filter) { + r.Filters = filters +} + +// GetRegionId returns path parameter 'regionId' if exist, +// otherwise return empty string +func (r DescribeNetworkSecurityGroupsRequest) GetRegionId() string { + return r.RegionId +} + +type DescribeNetworkSecurityGroupsResponse struct { + RequestID string `json:"requestId"` + Error core.ErrorResponse `json:"error"` + Result DescribeNetworkSecurityGroupsResult `json:"result"` +} + +type DescribeNetworkSecurityGroupsResult struct { + NetworkSecurityGroups []vpc.NetworkSecurityGroup `json:"networkSecurityGroups"` + TotalCount int `json:"totalCount"` +} \ No newline at end of file diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/DescribeQuota.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/DescribeQuota.go new file mode 100644 index 000000000..4b6544e0f --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/DescribeQuota.go @@ -0,0 +1,126 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package apis + +import ( + "github.com/jdcloud-api/jdcloud-sdk-go/core" +) + +type DescribeQuotaRequest struct { + + core.JDCloudRequest + + /* Region ID */ + RegionId string `json:"regionId"` + + /* 资源类型,取值范围:vpc、elastic_ip、subnet、security_group、vpcpeering、network_interface(配额只统计辅助网卡) */ + Type string `json:"type"` + + /* type为vpc、elastic_ip、network_interface不设置, type为subnet、security_group、vpcpeering设置为vpcId (Optional) */ + ParentResourceId *string `json:"parentResourceId"` +} + +/* + * param regionId: Region ID (Required) + * param type_: 资源类型,取值范围:vpc、elastic_ip、subnet、security_group、vpcpeering、network_interface(配额只统计辅助网卡) (Required) + * + * @Deprecated, not compatible when mandatory parameters changed + */ +func NewDescribeQuotaRequest( + regionId string, + type_ string, +) *DescribeQuotaRequest { + + return &DescribeQuotaRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/quotas/", + Method: "GET", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + Type: type_, + } +} + +/* + * param regionId: Region ID (Required) + * param type_: 资源类型,取值范围:vpc、elastic_ip、subnet、security_group、vpcpeering、network_interface(配额只统计辅助网卡) (Required) + * param parentResourceId: type为vpc、elastic_ip、network_interface不设置, type为subnet、security_group、vpcpeering设置为vpcId (Optional) + */ +func NewDescribeQuotaRequestWithAllParams( + regionId string, + type_ string, + parentResourceId *string, +) *DescribeQuotaRequest { + + return &DescribeQuotaRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/quotas/", + Method: "GET", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + Type: type_, + ParentResourceId: parentResourceId, + } +} + +/* This constructor has better compatible ability when API parameters changed */ +func NewDescribeQuotaRequestWithoutParam() *DescribeQuotaRequest { + + return &DescribeQuotaRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/quotas/", + Method: "GET", + Header: nil, + Version: "v1", + }, + } +} + +/* param regionId: Region ID(Required) */ +func (r *DescribeQuotaRequest) SetRegionId(regionId string) { + r.RegionId = regionId +} + +/* param type_: 资源类型,取值范围:vpc、elastic_ip、subnet、security_group、vpcpeering、network_interface(配额只统计辅助网卡)(Required) */ +func (r *DescribeQuotaRequest) SetType(type_ string) { + r.Type = type_ +} + +/* param parentResourceId: type为vpc、elastic_ip、network_interface不设置, type为subnet、security_group、vpcpeering设置为vpcId(Optional) */ +func (r *DescribeQuotaRequest) SetParentResourceId(parentResourceId string) { + r.ParentResourceId = &parentResourceId +} + +// GetRegionId returns path parameter 'regionId' if exist, +// otherwise return empty string +func (r DescribeQuotaRequest) GetRegionId() string { + return r.RegionId +} + +type DescribeQuotaResponse struct { + RequestID string `json:"requestId"` + Error core.ErrorResponse `json:"error"` + Result DescribeQuotaResult `json:"result"` +} + +type DescribeQuotaResult struct { + Quota interface{} `json:"quota"` +} \ No newline at end of file diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/DescribeRouteTable.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/DescribeRouteTable.go new file mode 100644 index 000000000..5e6785914 --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/DescribeRouteTable.go @@ -0,0 +1,116 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package apis + +import ( + "github.com/jdcloud-api/jdcloud-sdk-go/core" + vpc "github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models" +) + +type DescribeRouteTableRequest struct { + + core.JDCloudRequest + + /* Region ID */ + RegionId string `json:"regionId"` + + /* RouteTable ID */ + RouteTableId string `json:"routeTableId"` +} + +/* + * param regionId: Region ID (Required) + * param routeTableId: RouteTable ID (Required) + * + * @Deprecated, not compatible when mandatory parameters changed + */ +func NewDescribeRouteTableRequest( + regionId string, + routeTableId string, +) *DescribeRouteTableRequest { + + return &DescribeRouteTableRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/routeTables/{routeTableId}", + Method: "GET", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + RouteTableId: routeTableId, + } +} + +/* + * param regionId: Region ID (Required) + * param routeTableId: RouteTable ID (Required) + */ +func NewDescribeRouteTableRequestWithAllParams( + regionId string, + routeTableId string, +) *DescribeRouteTableRequest { + + return &DescribeRouteTableRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/routeTables/{routeTableId}", + Method: "GET", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + RouteTableId: routeTableId, + } +} + +/* This constructor has better compatible ability when API parameters changed */ +func NewDescribeRouteTableRequestWithoutParam() *DescribeRouteTableRequest { + + return &DescribeRouteTableRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/routeTables/{routeTableId}", + Method: "GET", + Header: nil, + Version: "v1", + }, + } +} + +/* param regionId: Region ID(Required) */ +func (r *DescribeRouteTableRequest) SetRegionId(regionId string) { + r.RegionId = regionId +} + +/* param routeTableId: RouteTable ID(Required) */ +func (r *DescribeRouteTableRequest) SetRouteTableId(routeTableId string) { + r.RouteTableId = routeTableId +} + +// GetRegionId returns path parameter 'regionId' if exist, +// otherwise return empty string +func (r DescribeRouteTableRequest) GetRegionId() string { + return r.RegionId +} + +type DescribeRouteTableResponse struct { + RequestID string `json:"requestId"` + Error core.ErrorResponse `json:"error"` + Result DescribeRouteTableResult `json:"result"` +} + +type DescribeRouteTableResult struct { + RouteTable vpc.RouteTable `json:"routeTable"` +} \ No newline at end of file diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/DescribeRouteTables.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/DescribeRouteTables.go new file mode 100644 index 000000000..801d94c8b --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/DescribeRouteTables.go @@ -0,0 +1,146 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package apis + +import ( + "github.com/jdcloud-api/jdcloud-sdk-go/core" + vpc "github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models" + common "github.com/jdcloud-api/jdcloud-sdk-go/services/common/models" +) + +type DescribeRouteTablesRequest struct { + + core.JDCloudRequest + + /* Region ID */ + RegionId string `json:"regionId"` + + /* 页码, 默认为1, 取值范围:[1,∞), 页码超过总页数时, 显示最后一页 (Optional) */ + PageNumber *int `json:"pageNumber"` + + /* 分页大小,默认为20,取值范围:[10,100] (Optional) */ + PageSize *int `json:"pageSize"` + + /* routeTableIds - 路由表ID列表,支持多个 +routeTableNames - 路由表名称列表,支持多个 +vpcId - 路由表所属vpc Id,支持单个 + (Optional) */ + Filters []common.Filter `json:"filters"` +} + +/* + * param regionId: Region ID (Required) + * + * @Deprecated, not compatible when mandatory parameters changed + */ +func NewDescribeRouteTablesRequest( + regionId string, +) *DescribeRouteTablesRequest { + + return &DescribeRouteTablesRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/routeTables/", + Method: "GET", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + } +} + +/* + * param regionId: Region ID (Required) + * param pageNumber: 页码, 默认为1, 取值范围:[1,∞), 页码超过总页数时, 显示最后一页 (Optional) + * param pageSize: 分页大小,默认为20,取值范围:[10,100] (Optional) + * param filters: routeTableIds - 路由表ID列表,支持多个 +routeTableNames - 路由表名称列表,支持多个 +vpcId - 路由表所属vpc Id,支持单个 + (Optional) + */ +func NewDescribeRouteTablesRequestWithAllParams( + regionId string, + pageNumber *int, + pageSize *int, + filters []common.Filter, +) *DescribeRouteTablesRequest { + + return &DescribeRouteTablesRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/routeTables/", + Method: "GET", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + PageNumber: pageNumber, + PageSize: pageSize, + Filters: filters, + } +} + +/* This constructor has better compatible ability when API parameters changed */ +func NewDescribeRouteTablesRequestWithoutParam() *DescribeRouteTablesRequest { + + return &DescribeRouteTablesRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/routeTables/", + Method: "GET", + Header: nil, + Version: "v1", + }, + } +} + +/* param regionId: Region ID(Required) */ +func (r *DescribeRouteTablesRequest) SetRegionId(regionId string) { + r.RegionId = regionId +} + +/* param pageNumber: 页码, 默认为1, 取值范围:[1,∞), 页码超过总页数时, 显示最后一页(Optional) */ +func (r *DescribeRouteTablesRequest) SetPageNumber(pageNumber int) { + r.PageNumber = &pageNumber +} + +/* param pageSize: 分页大小,默认为20,取值范围:[10,100](Optional) */ +func (r *DescribeRouteTablesRequest) SetPageSize(pageSize int) { + r.PageSize = &pageSize +} + +/* param filters: routeTableIds - 路由表ID列表,支持多个 +routeTableNames - 路由表名称列表,支持多个 +vpcId - 路由表所属vpc Id,支持单个 +(Optional) */ +func (r *DescribeRouteTablesRequest) SetFilters(filters []common.Filter) { + r.Filters = filters +} + +// GetRegionId returns path parameter 'regionId' if exist, +// otherwise return empty string +func (r DescribeRouteTablesRequest) GetRegionId() string { + return r.RegionId +} + +type DescribeRouteTablesResponse struct { + RequestID string `json:"requestId"` + Error core.ErrorResponse `json:"error"` + Result DescribeRouteTablesResult `json:"result"` +} + +type DescribeRouteTablesResult struct { + RouteTables []vpc.RouteTable `json:"routeTables"` + TotalCount int `json:"totalCount"` +} \ No newline at end of file diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/DescribeSubnet.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/DescribeSubnet.go new file mode 100644 index 000000000..2fee1a574 --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/DescribeSubnet.go @@ -0,0 +1,116 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package apis + +import ( + "github.com/jdcloud-api/jdcloud-sdk-go/core" + vpc "github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models" +) + +type DescribeSubnetRequest struct { + + core.JDCloudRequest + + /* Region ID */ + RegionId string `json:"regionId"` + + /* Subnet ID */ + SubnetId string `json:"subnetId"` +} + +/* + * param regionId: Region ID (Required) + * param subnetId: Subnet ID (Required) + * + * @Deprecated, not compatible when mandatory parameters changed + */ +func NewDescribeSubnetRequest( + regionId string, + subnetId string, +) *DescribeSubnetRequest { + + return &DescribeSubnetRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/subnets/{subnetId}", + Method: "GET", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + SubnetId: subnetId, + } +} + +/* + * param regionId: Region ID (Required) + * param subnetId: Subnet ID (Required) + */ +func NewDescribeSubnetRequestWithAllParams( + regionId string, + subnetId string, +) *DescribeSubnetRequest { + + return &DescribeSubnetRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/subnets/{subnetId}", + Method: "GET", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + SubnetId: subnetId, + } +} + +/* This constructor has better compatible ability when API parameters changed */ +func NewDescribeSubnetRequestWithoutParam() *DescribeSubnetRequest { + + return &DescribeSubnetRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/subnets/{subnetId}", + Method: "GET", + Header: nil, + Version: "v1", + }, + } +} + +/* param regionId: Region ID(Required) */ +func (r *DescribeSubnetRequest) SetRegionId(regionId string) { + r.RegionId = regionId +} + +/* param subnetId: Subnet ID(Required) */ +func (r *DescribeSubnetRequest) SetSubnetId(subnetId string) { + r.SubnetId = subnetId +} + +// GetRegionId returns path parameter 'regionId' if exist, +// otherwise return empty string +func (r DescribeSubnetRequest) GetRegionId() string { + return r.RegionId +} + +type DescribeSubnetResponse struct { + RequestID string `json:"requestId"` + Error core.ErrorResponse `json:"error"` + Result DescribeSubnetResult `json:"result"` +} + +type DescribeSubnetResult struct { + Subnet vpc.Subnet `json:"subnet"` +} \ No newline at end of file diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/DescribeSubnets.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/DescribeSubnets.go new file mode 100644 index 000000000..6bb8ce98d --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/DescribeSubnets.go @@ -0,0 +1,152 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package apis + +import ( + "github.com/jdcloud-api/jdcloud-sdk-go/core" + vpc "github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models" + common "github.com/jdcloud-api/jdcloud-sdk-go/services/common/models" +) + +type DescribeSubnetsRequest struct { + + core.JDCloudRequest + + /* Region ID */ + RegionId string `json:"regionId"` + + /* 页码, 默认为1, 取值范围:[1,∞), 页码超过总页数时, 显示最后一页 (Optional) */ + PageNumber *int `json:"pageNumber"` + + /* 分页大小,默认为20,取值范围:[10,100] (Optional) */ + PageSize *int `json:"pageSize"` + + /* subnetIds - subnet ID列表,支持多个 +subnetNames - subnet名称列表,支持多个 +routeTableId - 子网关联路由表Id,支持单个 +aclId - 子网关联acl Id,支持单个 +vpcId - 子网所属VPC Id,支持单个 + (Optional) */ + Filters []common.Filter `json:"filters"` +} + +/* + * param regionId: Region ID (Required) + * + * @Deprecated, not compatible when mandatory parameters changed + */ +func NewDescribeSubnetsRequest( + regionId string, +) *DescribeSubnetsRequest { + + return &DescribeSubnetsRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/subnets/", + Method: "GET", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + } +} + +/* + * param regionId: Region ID (Required) + * param pageNumber: 页码, 默认为1, 取值范围:[1,∞), 页码超过总页数时, 显示最后一页 (Optional) + * param pageSize: 分页大小,默认为20,取值范围:[10,100] (Optional) + * param filters: subnetIds - subnet ID列表,支持多个 +subnetNames - subnet名称列表,支持多个 +routeTableId - 子网关联路由表Id,支持单个 +aclId - 子网关联acl Id,支持单个 +vpcId - 子网所属VPC Id,支持单个 + (Optional) + */ +func NewDescribeSubnetsRequestWithAllParams( + regionId string, + pageNumber *int, + pageSize *int, + filters []common.Filter, +) *DescribeSubnetsRequest { + + return &DescribeSubnetsRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/subnets/", + Method: "GET", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + PageNumber: pageNumber, + PageSize: pageSize, + Filters: filters, + } +} + +/* This constructor has better compatible ability when API parameters changed */ +func NewDescribeSubnetsRequestWithoutParam() *DescribeSubnetsRequest { + + return &DescribeSubnetsRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/subnets/", + Method: "GET", + Header: nil, + Version: "v1", + }, + } +} + +/* param regionId: Region ID(Required) */ +func (r *DescribeSubnetsRequest) SetRegionId(regionId string) { + r.RegionId = regionId +} + +/* param pageNumber: 页码, 默认为1, 取值范围:[1,∞), 页码超过总页数时, 显示最后一页(Optional) */ +func (r *DescribeSubnetsRequest) SetPageNumber(pageNumber int) { + r.PageNumber = &pageNumber +} + +/* param pageSize: 分页大小,默认为20,取值范围:[10,100](Optional) */ +func (r *DescribeSubnetsRequest) SetPageSize(pageSize int) { + r.PageSize = &pageSize +} + +/* param filters: subnetIds - subnet ID列表,支持多个 +subnetNames - subnet名称列表,支持多个 +routeTableId - 子网关联路由表Id,支持单个 +aclId - 子网关联acl Id,支持单个 +vpcId - 子网所属VPC Id,支持单个 +(Optional) */ +func (r *DescribeSubnetsRequest) SetFilters(filters []common.Filter) { + r.Filters = filters +} + +// GetRegionId returns path parameter 'regionId' if exist, +// otherwise return empty string +func (r DescribeSubnetsRequest) GetRegionId() string { + return r.RegionId +} + +type DescribeSubnetsResponse struct { + RequestID string `json:"requestId"` + Error core.ErrorResponse `json:"error"` + Result DescribeSubnetsResult `json:"result"` +} + +type DescribeSubnetsResult struct { + Subnets []vpc.Subnet `json:"subnets"` + TotalCount int `json:"totalCount"` +} \ No newline at end of file diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/DescribeVpc.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/DescribeVpc.go new file mode 100644 index 000000000..d406b724c --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/DescribeVpc.go @@ -0,0 +1,116 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package apis + +import ( + "github.com/jdcloud-api/jdcloud-sdk-go/core" + vpc "github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models" +) + +type DescribeVpcRequest struct { + + core.JDCloudRequest + + /* Region ID */ + RegionId string `json:"regionId"` + + /* Vpc ID */ + VpcId string `json:"vpcId"` +} + +/* + * param regionId: Region ID (Required) + * param vpcId: Vpc ID (Required) + * + * @Deprecated, not compatible when mandatory parameters changed + */ +func NewDescribeVpcRequest( + regionId string, + vpcId string, +) *DescribeVpcRequest { + + return &DescribeVpcRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/vpcs/{vpcId}", + Method: "GET", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + VpcId: vpcId, + } +} + +/* + * param regionId: Region ID (Required) + * param vpcId: Vpc ID (Required) + */ +func NewDescribeVpcRequestWithAllParams( + regionId string, + vpcId string, +) *DescribeVpcRequest { + + return &DescribeVpcRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/vpcs/{vpcId}", + Method: "GET", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + VpcId: vpcId, + } +} + +/* This constructor has better compatible ability when API parameters changed */ +func NewDescribeVpcRequestWithoutParam() *DescribeVpcRequest { + + return &DescribeVpcRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/vpcs/{vpcId}", + Method: "GET", + Header: nil, + Version: "v1", + }, + } +} + +/* param regionId: Region ID(Required) */ +func (r *DescribeVpcRequest) SetRegionId(regionId string) { + r.RegionId = regionId +} + +/* param vpcId: Vpc ID(Required) */ +func (r *DescribeVpcRequest) SetVpcId(vpcId string) { + r.VpcId = vpcId +} + +// GetRegionId returns path parameter 'regionId' if exist, +// otherwise return empty string +func (r DescribeVpcRequest) GetRegionId() string { + return r.RegionId +} + +type DescribeVpcResponse struct { + RequestID string `json:"requestId"` + Error core.ErrorResponse `json:"error"` + Result DescribeVpcResult `json:"result"` +} + +type DescribeVpcResult struct { + Vpc vpc.Vpc `json:"vpc"` +} \ No newline at end of file diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/DescribeVpcPeering.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/DescribeVpcPeering.go new file mode 100644 index 000000000..e0230599a --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/DescribeVpcPeering.go @@ -0,0 +1,116 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package apis + +import ( + "github.com/jdcloud-api/jdcloud-sdk-go/core" + vpc "github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models" +) + +type DescribeVpcPeeringRequest struct { + + core.JDCloudRequest + + /* Region ID */ + RegionId string `json:"regionId"` + + /* vpcPeeringId ID */ + VpcPeeringId string `json:"vpcPeeringId"` +} + +/* + * param regionId: Region ID (Required) + * param vpcPeeringId: vpcPeeringId ID (Required) + * + * @Deprecated, not compatible when mandatory parameters changed + */ +func NewDescribeVpcPeeringRequest( + regionId string, + vpcPeeringId string, +) *DescribeVpcPeeringRequest { + + return &DescribeVpcPeeringRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/vpcPeerings/{vpcPeeringId}", + Method: "GET", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + VpcPeeringId: vpcPeeringId, + } +} + +/* + * param regionId: Region ID (Required) + * param vpcPeeringId: vpcPeeringId ID (Required) + */ +func NewDescribeVpcPeeringRequestWithAllParams( + regionId string, + vpcPeeringId string, +) *DescribeVpcPeeringRequest { + + return &DescribeVpcPeeringRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/vpcPeerings/{vpcPeeringId}", + Method: "GET", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + VpcPeeringId: vpcPeeringId, + } +} + +/* This constructor has better compatible ability when API parameters changed */ +func NewDescribeVpcPeeringRequestWithoutParam() *DescribeVpcPeeringRequest { + + return &DescribeVpcPeeringRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/vpcPeerings/{vpcPeeringId}", + Method: "GET", + Header: nil, + Version: "v1", + }, + } +} + +/* param regionId: Region ID(Required) */ +func (r *DescribeVpcPeeringRequest) SetRegionId(regionId string) { + r.RegionId = regionId +} + +/* param vpcPeeringId: vpcPeeringId ID(Required) */ +func (r *DescribeVpcPeeringRequest) SetVpcPeeringId(vpcPeeringId string) { + r.VpcPeeringId = vpcPeeringId +} + +// GetRegionId returns path parameter 'regionId' if exist, +// otherwise return empty string +func (r DescribeVpcPeeringRequest) GetRegionId() string { + return r.RegionId +} + +type DescribeVpcPeeringResponse struct { + RequestID string `json:"requestId"` + Error core.ErrorResponse `json:"error"` + Result DescribeVpcPeeringResult `json:"result"` +} + +type DescribeVpcPeeringResult struct { + VpcPeering vpc.VpcPeering `json:"vpcPeering"` +} \ No newline at end of file diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/DescribeVpcPeerings.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/DescribeVpcPeerings.go new file mode 100644 index 000000000..391f01b16 --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/DescribeVpcPeerings.go @@ -0,0 +1,149 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package apis + +import ( + "github.com/jdcloud-api/jdcloud-sdk-go/core" + vpc "github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models" + common "github.com/jdcloud-api/jdcloud-sdk-go/services/common/models" +) + +type DescribeVpcPeeringsRequest struct { + + core.JDCloudRequest + + /* Region ID */ + RegionId string `json:"regionId"` + + /* 页码, 默认为1, 取值范围:[1,∞), 页码超过总页数时, 显示最后一页 (Optional) */ + PageNumber *int `json:"pageNumber"` + + /* 分页大小,默认为20,取值范围:[10,100] (Optional) */ + PageSize *int `json:"pageSize"` + + /* vpcPeeringIds - vpcPeering ID,支持多个 +vpcPeeringNames - vpcPeering名称列表,支持多个 +vpcId - vpcPeering本端Vpc Id,支持单个 +remoteVpcId - vpcPeering对端Vpc Id,支持单个 + (Optional) */ + Filters []common.Filter `json:"filters"` +} + +/* + * param regionId: Region ID (Required) + * + * @Deprecated, not compatible when mandatory parameters changed + */ +func NewDescribeVpcPeeringsRequest( + regionId string, +) *DescribeVpcPeeringsRequest { + + return &DescribeVpcPeeringsRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/vpcPeerings/", + Method: "GET", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + } +} + +/* + * param regionId: Region ID (Required) + * param pageNumber: 页码, 默认为1, 取值范围:[1,∞), 页码超过总页数时, 显示最后一页 (Optional) + * param pageSize: 分页大小,默认为20,取值范围:[10,100] (Optional) + * param filters: vpcPeeringIds - vpcPeering ID,支持多个 +vpcPeeringNames - vpcPeering名称列表,支持多个 +vpcId - vpcPeering本端Vpc Id,支持单个 +remoteVpcId - vpcPeering对端Vpc Id,支持单个 + (Optional) + */ +func NewDescribeVpcPeeringsRequestWithAllParams( + regionId string, + pageNumber *int, + pageSize *int, + filters []common.Filter, +) *DescribeVpcPeeringsRequest { + + return &DescribeVpcPeeringsRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/vpcPeerings/", + Method: "GET", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + PageNumber: pageNumber, + PageSize: pageSize, + Filters: filters, + } +} + +/* This constructor has better compatible ability when API parameters changed */ +func NewDescribeVpcPeeringsRequestWithoutParam() *DescribeVpcPeeringsRequest { + + return &DescribeVpcPeeringsRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/vpcPeerings/", + Method: "GET", + Header: nil, + Version: "v1", + }, + } +} + +/* param regionId: Region ID(Required) */ +func (r *DescribeVpcPeeringsRequest) SetRegionId(regionId string) { + r.RegionId = regionId +} + +/* param pageNumber: 页码, 默认为1, 取值范围:[1,∞), 页码超过总页数时, 显示最后一页(Optional) */ +func (r *DescribeVpcPeeringsRequest) SetPageNumber(pageNumber int) { + r.PageNumber = &pageNumber +} + +/* param pageSize: 分页大小,默认为20,取值范围:[10,100](Optional) */ +func (r *DescribeVpcPeeringsRequest) SetPageSize(pageSize int) { + r.PageSize = &pageSize +} + +/* param filters: vpcPeeringIds - vpcPeering ID,支持多个 +vpcPeeringNames - vpcPeering名称列表,支持多个 +vpcId - vpcPeering本端Vpc Id,支持单个 +remoteVpcId - vpcPeering对端Vpc Id,支持单个 +(Optional) */ +func (r *DescribeVpcPeeringsRequest) SetFilters(filters []common.Filter) { + r.Filters = filters +} + +// GetRegionId returns path parameter 'regionId' if exist, +// otherwise return empty string +func (r DescribeVpcPeeringsRequest) GetRegionId() string { + return r.RegionId +} + +type DescribeVpcPeeringsResponse struct { + RequestID string `json:"requestId"` + Error core.ErrorResponse `json:"error"` + Result DescribeVpcPeeringsResult `json:"result"` +} + +type DescribeVpcPeeringsResult struct { + VpcPeerings []vpc.VpcPeering `json:"vpcPeerings"` + TotalCount int `json:"totalCount"` +} \ No newline at end of file diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/DescribeVpcs.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/DescribeVpcs.go new file mode 100644 index 000000000..8faac163c --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/DescribeVpcs.go @@ -0,0 +1,143 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package apis + +import ( + "github.com/jdcloud-api/jdcloud-sdk-go/core" + vpc "github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models" + common "github.com/jdcloud-api/jdcloud-sdk-go/services/common/models" +) + +type DescribeVpcsRequest struct { + + core.JDCloudRequest + + /* Region ID */ + RegionId string `json:"regionId"` + + /* 页码, 默认为1, 取值范围:[1,∞), 页码超过总页数时, 显示最后一页 (Optional) */ + PageNumber *int `json:"pageNumber"` + + /* 分页大小,默认为20,取值范围:[10,100] (Optional) */ + PageSize *int `json:"pageSize"` + + /* vpcIds - vpc ID列表,支持多个 +vpcNames - vpc名称列表,支持多个 + (Optional) */ + Filters []common.Filter `json:"filters"` +} + +/* + * param regionId: Region ID (Required) + * + * @Deprecated, not compatible when mandatory parameters changed + */ +func NewDescribeVpcsRequest( + regionId string, +) *DescribeVpcsRequest { + + return &DescribeVpcsRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/vpcs/", + Method: "GET", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + } +} + +/* + * param regionId: Region ID (Required) + * param pageNumber: 页码, 默认为1, 取值范围:[1,∞), 页码超过总页数时, 显示最后一页 (Optional) + * param pageSize: 分页大小,默认为20,取值范围:[10,100] (Optional) + * param filters: vpcIds - vpc ID列表,支持多个 +vpcNames - vpc名称列表,支持多个 + (Optional) + */ +func NewDescribeVpcsRequestWithAllParams( + regionId string, + pageNumber *int, + pageSize *int, + filters []common.Filter, +) *DescribeVpcsRequest { + + return &DescribeVpcsRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/vpcs/", + Method: "GET", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + PageNumber: pageNumber, + PageSize: pageSize, + Filters: filters, + } +} + +/* This constructor has better compatible ability when API parameters changed */ +func NewDescribeVpcsRequestWithoutParam() *DescribeVpcsRequest { + + return &DescribeVpcsRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/vpcs/", + Method: "GET", + Header: nil, + Version: "v1", + }, + } +} + +/* param regionId: Region ID(Required) */ +func (r *DescribeVpcsRequest) SetRegionId(regionId string) { + r.RegionId = regionId +} + +/* param pageNumber: 页码, 默认为1, 取值范围:[1,∞), 页码超过总页数时, 显示最后一页(Optional) */ +func (r *DescribeVpcsRequest) SetPageNumber(pageNumber int) { + r.PageNumber = &pageNumber +} + +/* param pageSize: 分页大小,默认为20,取值范围:[10,100](Optional) */ +func (r *DescribeVpcsRequest) SetPageSize(pageSize int) { + r.PageSize = &pageSize +} + +/* param filters: vpcIds - vpc ID列表,支持多个 +vpcNames - vpc名称列表,支持多个 +(Optional) */ +func (r *DescribeVpcsRequest) SetFilters(filters []common.Filter) { + r.Filters = filters +} + +// GetRegionId returns path parameter 'regionId' if exist, +// otherwise return empty string +func (r DescribeVpcsRequest) GetRegionId() string { + return r.RegionId +} + +type DescribeVpcsResponse struct { + RequestID string `json:"requestId"` + Error core.ErrorResponse `json:"error"` + Result DescribeVpcsResult `json:"result"` +} + +type DescribeVpcsResult struct { + Vpcs []vpc.Vpc `json:"vpcs"` + TotalCount int `json:"totalCount"` +} \ No newline at end of file diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/DisassociateElasticIp.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/DisassociateElasticIp.go new file mode 100644 index 000000000..35e7dc50e --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/DisassociateElasticIp.go @@ -0,0 +1,136 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package apis + +import ( + "github.com/jdcloud-api/jdcloud-sdk-go/core" +) + +type DisassociateElasticIpRequest struct { + + core.JDCloudRequest + + /* Region ID */ + RegionId string `json:"regionId"` + + /* networkInterface ID */ + NetworkInterfaceId string `json:"networkInterfaceId"` + + /* 指定解绑的弹性Ip Id (Optional) */ + ElasticIpId *string `json:"elasticIpId"` + + /* 指定解绑的弹性Ip地址 (Optional) */ + ElasticIpAddress *string `json:"elasticIpAddress"` +} + +/* + * param regionId: Region ID (Required) + * param networkInterfaceId: networkInterface ID (Required) + * + * @Deprecated, not compatible when mandatory parameters changed + */ +func NewDisassociateElasticIpRequest( + regionId string, + networkInterfaceId string, +) *DisassociateElasticIpRequest { + + return &DisassociateElasticIpRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/networkInterfaces/{networkInterfaceId}:disassociateElasticIp", + Method: "POST", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + NetworkInterfaceId: networkInterfaceId, + } +} + +/* + * param regionId: Region ID (Required) + * param networkInterfaceId: networkInterface ID (Required) + * param elasticIpId: 指定解绑的弹性Ip Id (Optional) + * param elasticIpAddress: 指定解绑的弹性Ip地址 (Optional) + */ +func NewDisassociateElasticIpRequestWithAllParams( + regionId string, + networkInterfaceId string, + elasticIpId *string, + elasticIpAddress *string, +) *DisassociateElasticIpRequest { + + return &DisassociateElasticIpRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/networkInterfaces/{networkInterfaceId}:disassociateElasticIp", + Method: "POST", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + NetworkInterfaceId: networkInterfaceId, + ElasticIpId: elasticIpId, + ElasticIpAddress: elasticIpAddress, + } +} + +/* This constructor has better compatible ability when API parameters changed */ +func NewDisassociateElasticIpRequestWithoutParam() *DisassociateElasticIpRequest { + + return &DisassociateElasticIpRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/networkInterfaces/{networkInterfaceId}:disassociateElasticIp", + Method: "POST", + Header: nil, + Version: "v1", + }, + } +} + +/* param regionId: Region ID(Required) */ +func (r *DisassociateElasticIpRequest) SetRegionId(regionId string) { + r.RegionId = regionId +} + +/* param networkInterfaceId: networkInterface ID(Required) */ +func (r *DisassociateElasticIpRequest) SetNetworkInterfaceId(networkInterfaceId string) { + r.NetworkInterfaceId = networkInterfaceId +} + +/* param elasticIpId: 指定解绑的弹性Ip Id(Optional) */ +func (r *DisassociateElasticIpRequest) SetElasticIpId(elasticIpId string) { + r.ElasticIpId = &elasticIpId +} + +/* param elasticIpAddress: 指定解绑的弹性Ip地址(Optional) */ +func (r *DisassociateElasticIpRequest) SetElasticIpAddress(elasticIpAddress string) { + r.ElasticIpAddress = &elasticIpAddress +} + +// GetRegionId returns path parameter 'regionId' if exist, +// otherwise return empty string +func (r DisassociateElasticIpRequest) GetRegionId() string { + return r.RegionId +} + +type DisassociateElasticIpResponse struct { + RequestID string `json:"requestId"` + Error core.ErrorResponse `json:"error"` + Result DisassociateElasticIpResult `json:"result"` +} + +type DisassociateElasticIpResult struct { +} \ No newline at end of file diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/DisassociateNetworkAcl.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/DisassociateNetworkAcl.go new file mode 100644 index 000000000..41874c7bb --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/DisassociateNetworkAcl.go @@ -0,0 +1,128 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package apis + +import ( + "github.com/jdcloud-api/jdcloud-sdk-go/core" +) + +type DisassociateNetworkAclRequest struct { + + core.JDCloudRequest + + /* Region ID */ + RegionId string `json:"regionId"` + + /* networkAclId ID */ + NetworkAclId string `json:"networkAclId"` + + /* networkAcl要解绑的子网ID */ + SubnetId string `json:"subnetId"` +} + +/* + * param regionId: Region ID (Required) + * param networkAclId: networkAclId ID (Required) + * param subnetId: networkAcl要解绑的子网ID (Required) + * + * @Deprecated, not compatible when mandatory parameters changed + */ +func NewDisassociateNetworkAclRequest( + regionId string, + networkAclId string, + subnetId string, +) *DisassociateNetworkAclRequest { + + return &DisassociateNetworkAclRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/networkAcls/{networkAclId}:disassociateNetworkAcl", + Method: "POST", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + NetworkAclId: networkAclId, + SubnetId: subnetId, + } +} + +/* + * param regionId: Region ID (Required) + * param networkAclId: networkAclId ID (Required) + * param subnetId: networkAcl要解绑的子网ID (Required) + */ +func NewDisassociateNetworkAclRequestWithAllParams( + regionId string, + networkAclId string, + subnetId string, +) *DisassociateNetworkAclRequest { + + return &DisassociateNetworkAclRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/networkAcls/{networkAclId}:disassociateNetworkAcl", + Method: "POST", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + NetworkAclId: networkAclId, + SubnetId: subnetId, + } +} + +/* This constructor has better compatible ability when API parameters changed */ +func NewDisassociateNetworkAclRequestWithoutParam() *DisassociateNetworkAclRequest { + + return &DisassociateNetworkAclRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/networkAcls/{networkAclId}:disassociateNetworkAcl", + Method: "POST", + Header: nil, + Version: "v1", + }, + } +} + +/* param regionId: Region ID(Required) */ +func (r *DisassociateNetworkAclRequest) SetRegionId(regionId string) { + r.RegionId = regionId +} + +/* param networkAclId: networkAclId ID(Required) */ +func (r *DisassociateNetworkAclRequest) SetNetworkAclId(networkAclId string) { + r.NetworkAclId = networkAclId +} + +/* param subnetId: networkAcl要解绑的子网ID(Required) */ +func (r *DisassociateNetworkAclRequest) SetSubnetId(subnetId string) { + r.SubnetId = subnetId +} + +// GetRegionId returns path parameter 'regionId' if exist, +// otherwise return empty string +func (r DisassociateNetworkAclRequest) GetRegionId() string { + return r.RegionId +} + +type DisassociateNetworkAclResponse struct { + RequestID string `json:"requestId"` + Error core.ErrorResponse `json:"error"` + Result DisassociateNetworkAclResult `json:"result"` +} + +type DisassociateNetworkAclResult struct { +} \ No newline at end of file diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/DisassociateRouteTable.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/DisassociateRouteTable.go new file mode 100644 index 000000000..65d7f1c65 --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/DisassociateRouteTable.go @@ -0,0 +1,128 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package apis + +import ( + "github.com/jdcloud-api/jdcloud-sdk-go/core" +) + +type DisassociateRouteTableRequest struct { + + core.JDCloudRequest + + /* Region ID */ + RegionId string `json:"regionId"` + + /* RouteTable ID */ + RouteTableId string `json:"routeTableId"` + + /* 路由表要解绑的子网ID,解绑后子网绑定默认路由表 */ + SubnetId string `json:"subnetId"` +} + +/* + * param regionId: Region ID (Required) + * param routeTableId: RouteTable ID (Required) + * param subnetId: 路由表要解绑的子网ID,解绑后子网绑定默认路由表 (Required) + * + * @Deprecated, not compatible when mandatory parameters changed + */ +func NewDisassociateRouteTableRequest( + regionId string, + routeTableId string, + subnetId string, +) *DisassociateRouteTableRequest { + + return &DisassociateRouteTableRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/routeTables/{routeTableId}:disassociateRouteTable", + Method: "POST", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + RouteTableId: routeTableId, + SubnetId: subnetId, + } +} + +/* + * param regionId: Region ID (Required) + * param routeTableId: RouteTable ID (Required) + * param subnetId: 路由表要解绑的子网ID,解绑后子网绑定默认路由表 (Required) + */ +func NewDisassociateRouteTableRequestWithAllParams( + regionId string, + routeTableId string, + subnetId string, +) *DisassociateRouteTableRequest { + + return &DisassociateRouteTableRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/routeTables/{routeTableId}:disassociateRouteTable", + Method: "POST", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + RouteTableId: routeTableId, + SubnetId: subnetId, + } +} + +/* This constructor has better compatible ability when API parameters changed */ +func NewDisassociateRouteTableRequestWithoutParam() *DisassociateRouteTableRequest { + + return &DisassociateRouteTableRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/routeTables/{routeTableId}:disassociateRouteTable", + Method: "POST", + Header: nil, + Version: "v1", + }, + } +} + +/* param regionId: Region ID(Required) */ +func (r *DisassociateRouteTableRequest) SetRegionId(regionId string) { + r.RegionId = regionId +} + +/* param routeTableId: RouteTable ID(Required) */ +func (r *DisassociateRouteTableRequest) SetRouteTableId(routeTableId string) { + r.RouteTableId = routeTableId +} + +/* param subnetId: 路由表要解绑的子网ID,解绑后子网绑定默认路由表(Required) */ +func (r *DisassociateRouteTableRequest) SetSubnetId(subnetId string) { + r.SubnetId = subnetId +} + +// GetRegionId returns path parameter 'regionId' if exist, +// otherwise return empty string +func (r DisassociateRouteTableRequest) GetRegionId() string { + return r.RegionId +} + +type DisassociateRouteTableResponse struct { + RequestID string `json:"requestId"` + Error core.ErrorResponse `json:"error"` + Result DisassociateRouteTableResult `json:"result"` +} + +type DisassociateRouteTableResult struct { +} \ No newline at end of file diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/ModifyElasticIp.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/ModifyElasticIp.go new file mode 100644 index 000000000..146229ba0 --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/ModifyElasticIp.go @@ -0,0 +1,128 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package apis + +import ( + "github.com/jdcloud-api/jdcloud-sdk-go/core" +) + +type ModifyElasticIpRequest struct { + + core.JDCloudRequest + + /* Region ID */ + RegionId string `json:"regionId"` + + /* ElasticIp ID */ + ElasticIpId string `json:"elasticIpId"` + + /* 弹性公网IP的限速(单位:Mbps),取值范围为[1-200] */ + BandwidthMbps int `json:"bandwidthMbps"` +} + +/* + * param regionId: Region ID (Required) + * param elasticIpId: ElasticIp ID (Required) + * param bandwidthMbps: 弹性公网IP的限速(单位:Mbps),取值范围为[1-200] (Required) + * + * @Deprecated, not compatible when mandatory parameters changed + */ +func NewModifyElasticIpRequest( + regionId string, + elasticIpId string, + bandwidthMbps int, +) *ModifyElasticIpRequest { + + return &ModifyElasticIpRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/elasticIps/{elasticIpId}", + Method: "PATCH", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + ElasticIpId: elasticIpId, + BandwidthMbps: bandwidthMbps, + } +} + +/* + * param regionId: Region ID (Required) + * param elasticIpId: ElasticIp ID (Required) + * param bandwidthMbps: 弹性公网IP的限速(单位:Mbps),取值范围为[1-200] (Required) + */ +func NewModifyElasticIpRequestWithAllParams( + regionId string, + elasticIpId string, + bandwidthMbps int, +) *ModifyElasticIpRequest { + + return &ModifyElasticIpRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/elasticIps/{elasticIpId}", + Method: "PATCH", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + ElasticIpId: elasticIpId, + BandwidthMbps: bandwidthMbps, + } +} + +/* This constructor has better compatible ability when API parameters changed */ +func NewModifyElasticIpRequestWithoutParam() *ModifyElasticIpRequest { + + return &ModifyElasticIpRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/elasticIps/{elasticIpId}", + Method: "PATCH", + Header: nil, + Version: "v1", + }, + } +} + +/* param regionId: Region ID(Required) */ +func (r *ModifyElasticIpRequest) SetRegionId(regionId string) { + r.RegionId = regionId +} + +/* param elasticIpId: ElasticIp ID(Required) */ +func (r *ModifyElasticIpRequest) SetElasticIpId(elasticIpId string) { + r.ElasticIpId = elasticIpId +} + +/* param bandwidthMbps: 弹性公网IP的限速(单位:Mbps),取值范围为[1-200](Required) */ +func (r *ModifyElasticIpRequest) SetBandwidthMbps(bandwidthMbps int) { + r.BandwidthMbps = bandwidthMbps +} + +// GetRegionId returns path parameter 'regionId' if exist, +// otherwise return empty string +func (r ModifyElasticIpRequest) GetRegionId() string { + return r.RegionId +} + +type ModifyElasticIpResponse struct { + RequestID string `json:"requestId"` + Error core.ErrorResponse `json:"error"` + Result ModifyElasticIpResult `json:"result"` +} + +type ModifyElasticIpResult struct { +} \ No newline at end of file diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/ModifyNetworkAcl.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/ModifyNetworkAcl.go new file mode 100644 index 000000000..c091d48a3 --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/ModifyNetworkAcl.go @@ -0,0 +1,136 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package apis + +import ( + "github.com/jdcloud-api/jdcloud-sdk-go/core" +) + +type ModifyNetworkAclRequest struct { + + core.JDCloudRequest + + /* Region ID */ + RegionId string `json:"regionId"` + + /* networkAclId ID */ + NetworkAclId string `json:"networkAclId"` + + /* networkAcl名称,只允许输入中文、数字、大小写字母、英文下划线“_”及中划线“-”,不允许为空且不超过32字符 (Optional) */ + NetworkAclName *string `json:"networkAclName"` + + /* 描述,允许输入UTF-8编码下的全部字符,不超过256字符 (Optional) */ + Description *string `json:"description"` +} + +/* + * param regionId: Region ID (Required) + * param networkAclId: networkAclId ID (Required) + * + * @Deprecated, not compatible when mandatory parameters changed + */ +func NewModifyNetworkAclRequest( + regionId string, + networkAclId string, +) *ModifyNetworkAclRequest { + + return &ModifyNetworkAclRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/networkAcls/{networkAclId}", + Method: "PATCH", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + NetworkAclId: networkAclId, + } +} + +/* + * param regionId: Region ID (Required) + * param networkAclId: networkAclId ID (Required) + * param networkAclName: networkAcl名称,只允许输入中文、数字、大小写字母、英文下划线“_”及中划线“-”,不允许为空且不超过32字符 (Optional) + * param description: 描述,允许输入UTF-8编码下的全部字符,不超过256字符 (Optional) + */ +func NewModifyNetworkAclRequestWithAllParams( + regionId string, + networkAclId string, + networkAclName *string, + description *string, +) *ModifyNetworkAclRequest { + + return &ModifyNetworkAclRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/networkAcls/{networkAclId}", + Method: "PATCH", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + NetworkAclId: networkAclId, + NetworkAclName: networkAclName, + Description: description, + } +} + +/* This constructor has better compatible ability when API parameters changed */ +func NewModifyNetworkAclRequestWithoutParam() *ModifyNetworkAclRequest { + + return &ModifyNetworkAclRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/networkAcls/{networkAclId}", + Method: "PATCH", + Header: nil, + Version: "v1", + }, + } +} + +/* param regionId: Region ID(Required) */ +func (r *ModifyNetworkAclRequest) SetRegionId(regionId string) { + r.RegionId = regionId +} + +/* param networkAclId: networkAclId ID(Required) */ +func (r *ModifyNetworkAclRequest) SetNetworkAclId(networkAclId string) { + r.NetworkAclId = networkAclId +} + +/* param networkAclName: networkAcl名称,只允许输入中文、数字、大小写字母、英文下划线“_”及中划线“-”,不允许为空且不超过32字符(Optional) */ +func (r *ModifyNetworkAclRequest) SetNetworkAclName(networkAclName string) { + r.NetworkAclName = &networkAclName +} + +/* param description: 描述,允许输入UTF-8编码下的全部字符,不超过256字符(Optional) */ +func (r *ModifyNetworkAclRequest) SetDescription(description string) { + r.Description = &description +} + +// GetRegionId returns path parameter 'regionId' if exist, +// otherwise return empty string +func (r ModifyNetworkAclRequest) GetRegionId() string { + return r.RegionId +} + +type ModifyNetworkAclResponse struct { + RequestID string `json:"requestId"` + Error core.ErrorResponse `json:"error"` + Result ModifyNetworkAclResult `json:"result"` +} + +type ModifyNetworkAclResult struct { +} \ No newline at end of file diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/ModifyNetworkAclRules.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/ModifyNetworkAclRules.go new file mode 100644 index 000000000..21f44d284 --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/ModifyNetworkAclRules.go @@ -0,0 +1,129 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package apis + +import ( + "github.com/jdcloud-api/jdcloud-sdk-go/core" + vpc "github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models" +) + +type ModifyNetworkAclRulesRequest struct { + + core.JDCloudRequest + + /* Region ID */ + RegionId string `json:"regionId"` + + /* networkAclId ID */ + NetworkAclId string `json:"networkAclId"` + + /* networkAcl规则列表 */ + ModifyNetworkAclRuleSpecs []vpc.ModifyNetworkAclRuleSpec `json:"modifyNetworkAclRuleSpecs"` +} + +/* + * param regionId: Region ID (Required) + * param networkAclId: networkAclId ID (Required) + * param modifyNetworkAclRuleSpecs: networkAcl规则列表 (Required) + * + * @Deprecated, not compatible when mandatory parameters changed + */ +func NewModifyNetworkAclRulesRequest( + regionId string, + networkAclId string, + modifyNetworkAclRuleSpecs []vpc.ModifyNetworkAclRuleSpec, +) *ModifyNetworkAclRulesRequest { + + return &ModifyNetworkAclRulesRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/networkAcls/{networkAclId}:modifyNetworkAclRules", + Method: "POST", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + NetworkAclId: networkAclId, + ModifyNetworkAclRuleSpecs: modifyNetworkAclRuleSpecs, + } +} + +/* + * param regionId: Region ID (Required) + * param networkAclId: networkAclId ID (Required) + * param modifyNetworkAclRuleSpecs: networkAcl规则列表 (Required) + */ +func NewModifyNetworkAclRulesRequestWithAllParams( + regionId string, + networkAclId string, + modifyNetworkAclRuleSpecs []vpc.ModifyNetworkAclRuleSpec, +) *ModifyNetworkAclRulesRequest { + + return &ModifyNetworkAclRulesRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/networkAcls/{networkAclId}:modifyNetworkAclRules", + Method: "POST", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + NetworkAclId: networkAclId, + ModifyNetworkAclRuleSpecs: modifyNetworkAclRuleSpecs, + } +} + +/* This constructor has better compatible ability when API parameters changed */ +func NewModifyNetworkAclRulesRequestWithoutParam() *ModifyNetworkAclRulesRequest { + + return &ModifyNetworkAclRulesRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/networkAcls/{networkAclId}:modifyNetworkAclRules", + Method: "POST", + Header: nil, + Version: "v1", + }, + } +} + +/* param regionId: Region ID(Required) */ +func (r *ModifyNetworkAclRulesRequest) SetRegionId(regionId string) { + r.RegionId = regionId +} + +/* param networkAclId: networkAclId ID(Required) */ +func (r *ModifyNetworkAclRulesRequest) SetNetworkAclId(networkAclId string) { + r.NetworkAclId = networkAclId +} + +/* param modifyNetworkAclRuleSpecs: networkAcl规则列表(Required) */ +func (r *ModifyNetworkAclRulesRequest) SetModifyNetworkAclRuleSpecs(modifyNetworkAclRuleSpecs []vpc.ModifyNetworkAclRuleSpec) { + r.ModifyNetworkAclRuleSpecs = modifyNetworkAclRuleSpecs +} + +// GetRegionId returns path parameter 'regionId' if exist, +// otherwise return empty string +func (r ModifyNetworkAclRulesRequest) GetRegionId() string { + return r.RegionId +} + +type ModifyNetworkAclRulesResponse struct { + RequestID string `json:"requestId"` + Error core.ErrorResponse `json:"error"` + Result ModifyNetworkAclRulesResult `json:"result"` +} + +type ModifyNetworkAclRulesResult struct { +} \ No newline at end of file diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/ModifyNetworkInterface.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/ModifyNetworkInterface.go new file mode 100644 index 000000000..071bfebe4 --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/ModifyNetworkInterface.go @@ -0,0 +1,147 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package apis + +import ( + "github.com/jdcloud-api/jdcloud-sdk-go/core" +) + +type ModifyNetworkInterfaceRequest struct { + + core.JDCloudRequest + + /* Region ID */ + RegionId string `json:"regionId"` + + /* networkInterface ID */ + NetworkInterfaceId string `json:"networkInterfaceId"` + + /* 弹性网卡名称,只允许输入中文、数字、大小写字母、英文下划线“_”及中划线“-”,不允许为空且不超过32字符 (Optional) */ + NetworkInterfaceName *string `json:"networkInterfaceName"` + + /* 描述,允许输入UTF-8编码下的全部字符,不超过256字符 (Optional) */ + Description *string `json:"description"` + + /* 以覆盖原有安全组的方式更新的安全组。如果更新安全组ID列表,最多5个安全组 (Optional) */ + SecurityGroups []string `json:"securityGroups"` +} + +/* + * param regionId: Region ID (Required) + * param networkInterfaceId: networkInterface ID (Required) + * + * @Deprecated, not compatible when mandatory parameters changed + */ +func NewModifyNetworkInterfaceRequest( + regionId string, + networkInterfaceId string, +) *ModifyNetworkInterfaceRequest { + + return &ModifyNetworkInterfaceRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/networkInterfaces/{networkInterfaceId}", + Method: "PATCH", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + NetworkInterfaceId: networkInterfaceId, + } +} + +/* + * param regionId: Region ID (Required) + * param networkInterfaceId: networkInterface ID (Required) + * param networkInterfaceName: 弹性网卡名称,只允许输入中文、数字、大小写字母、英文下划线“_”及中划线“-”,不允许为空且不超过32字符 (Optional) + * param description: 描述,允许输入UTF-8编码下的全部字符,不超过256字符 (Optional) + * param securityGroups: 以覆盖原有安全组的方式更新的安全组。如果更新安全组ID列表,最多5个安全组 (Optional) + */ +func NewModifyNetworkInterfaceRequestWithAllParams( + regionId string, + networkInterfaceId string, + networkInterfaceName *string, + description *string, + securityGroups []string, +) *ModifyNetworkInterfaceRequest { + + return &ModifyNetworkInterfaceRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/networkInterfaces/{networkInterfaceId}", + Method: "PATCH", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + NetworkInterfaceId: networkInterfaceId, + NetworkInterfaceName: networkInterfaceName, + Description: description, + SecurityGroups: securityGroups, + } +} + +/* This constructor has better compatible ability when API parameters changed */ +func NewModifyNetworkInterfaceRequestWithoutParam() *ModifyNetworkInterfaceRequest { + + return &ModifyNetworkInterfaceRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/networkInterfaces/{networkInterfaceId}", + Method: "PATCH", + Header: nil, + Version: "v1", + }, + } +} + +/* param regionId: Region ID(Required) */ +func (r *ModifyNetworkInterfaceRequest) SetRegionId(regionId string) { + r.RegionId = regionId +} + +/* param networkInterfaceId: networkInterface ID(Required) */ +func (r *ModifyNetworkInterfaceRequest) SetNetworkInterfaceId(networkInterfaceId string) { + r.NetworkInterfaceId = networkInterfaceId +} + +/* param networkInterfaceName: 弹性网卡名称,只允许输入中文、数字、大小写字母、英文下划线“_”及中划线“-”,不允许为空且不超过32字符(Optional) */ +func (r *ModifyNetworkInterfaceRequest) SetNetworkInterfaceName(networkInterfaceName string) { + r.NetworkInterfaceName = &networkInterfaceName +} + +/* param description: 描述,允许输入UTF-8编码下的全部字符,不超过256字符(Optional) */ +func (r *ModifyNetworkInterfaceRequest) SetDescription(description string) { + r.Description = &description +} + +/* param securityGroups: 以覆盖原有安全组的方式更新的安全组。如果更新安全组ID列表,最多5个安全组(Optional) */ +func (r *ModifyNetworkInterfaceRequest) SetSecurityGroups(securityGroups []string) { + r.SecurityGroups = securityGroups +} + +// GetRegionId returns path parameter 'regionId' if exist, +// otherwise return empty string +func (r ModifyNetworkInterfaceRequest) GetRegionId() string { + return r.RegionId +} + +type ModifyNetworkInterfaceResponse struct { + RequestID string `json:"requestId"` + Error core.ErrorResponse `json:"error"` + Result ModifyNetworkInterfaceResult `json:"result"` +} + +type ModifyNetworkInterfaceResult struct { +} \ No newline at end of file diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/ModifyNetworkSecurityGroup.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/ModifyNetworkSecurityGroup.go new file mode 100644 index 000000000..eccec066c --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/ModifyNetworkSecurityGroup.go @@ -0,0 +1,136 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package apis + +import ( + "github.com/jdcloud-api/jdcloud-sdk-go/core" +) + +type ModifyNetworkSecurityGroupRequest struct { + + core.JDCloudRequest + + /* Region ID */ + RegionId string `json:"regionId"` + + /* NetworkSecurityGroup ID */ + NetworkSecurityGroupId string `json:"networkSecurityGroupId"` + + /* 安全组的名字。名称取值范围:1-32个中文、英文大小写的字母、数字和下划线分隔符 (Optional) */ + NetworkSecurityGroupName *string `json:"networkSecurityGroupName"` + + /* 安全组的描述,取值范围:0-256个UTF-8编码下的全部字符 (Optional) */ + Description *string `json:"description"` +} + +/* + * param regionId: Region ID (Required) + * param networkSecurityGroupId: NetworkSecurityGroup ID (Required) + * + * @Deprecated, not compatible when mandatory parameters changed + */ +func NewModifyNetworkSecurityGroupRequest( + regionId string, + networkSecurityGroupId string, +) *ModifyNetworkSecurityGroupRequest { + + return &ModifyNetworkSecurityGroupRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/networkSecurityGroups/{networkSecurityGroupId}", + Method: "PATCH", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + NetworkSecurityGroupId: networkSecurityGroupId, + } +} + +/* + * param regionId: Region ID (Required) + * param networkSecurityGroupId: NetworkSecurityGroup ID (Required) + * param networkSecurityGroupName: 安全组的名字。名称取值范围:1-32个中文、英文大小写的字母、数字和下划线分隔符 (Optional) + * param description: 安全组的描述,取值范围:0-256个UTF-8编码下的全部字符 (Optional) + */ +func NewModifyNetworkSecurityGroupRequestWithAllParams( + regionId string, + networkSecurityGroupId string, + networkSecurityGroupName *string, + description *string, +) *ModifyNetworkSecurityGroupRequest { + + return &ModifyNetworkSecurityGroupRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/networkSecurityGroups/{networkSecurityGroupId}", + Method: "PATCH", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + NetworkSecurityGroupId: networkSecurityGroupId, + NetworkSecurityGroupName: networkSecurityGroupName, + Description: description, + } +} + +/* This constructor has better compatible ability when API parameters changed */ +func NewModifyNetworkSecurityGroupRequestWithoutParam() *ModifyNetworkSecurityGroupRequest { + + return &ModifyNetworkSecurityGroupRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/networkSecurityGroups/{networkSecurityGroupId}", + Method: "PATCH", + Header: nil, + Version: "v1", + }, + } +} + +/* param regionId: Region ID(Required) */ +func (r *ModifyNetworkSecurityGroupRequest) SetRegionId(regionId string) { + r.RegionId = regionId +} + +/* param networkSecurityGroupId: NetworkSecurityGroup ID(Required) */ +func (r *ModifyNetworkSecurityGroupRequest) SetNetworkSecurityGroupId(networkSecurityGroupId string) { + r.NetworkSecurityGroupId = networkSecurityGroupId +} + +/* param networkSecurityGroupName: 安全组的名字。名称取值范围:1-32个中文、英文大小写的字母、数字和下划线分隔符(Optional) */ +func (r *ModifyNetworkSecurityGroupRequest) SetNetworkSecurityGroupName(networkSecurityGroupName string) { + r.NetworkSecurityGroupName = &networkSecurityGroupName +} + +/* param description: 安全组的描述,取值范围:0-256个UTF-8编码下的全部字符(Optional) */ +func (r *ModifyNetworkSecurityGroupRequest) SetDescription(description string) { + r.Description = &description +} + +// GetRegionId returns path parameter 'regionId' if exist, +// otherwise return empty string +func (r ModifyNetworkSecurityGroupRequest) GetRegionId() string { + return r.RegionId +} + +type ModifyNetworkSecurityGroupResponse struct { + RequestID string `json:"requestId"` + Error core.ErrorResponse `json:"error"` + Result ModifyNetworkSecurityGroupResult `json:"result"` +} + +type ModifyNetworkSecurityGroupResult struct { +} \ No newline at end of file diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/ModifyNetworkSecurityGroupRules.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/ModifyNetworkSecurityGroupRules.go new file mode 100644 index 000000000..63b6949f8 --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/ModifyNetworkSecurityGroupRules.go @@ -0,0 +1,129 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package apis + +import ( + "github.com/jdcloud-api/jdcloud-sdk-go/core" + vpc "github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models" +) + +type ModifyNetworkSecurityGroupRulesRequest struct { + + core.JDCloudRequest + + /* Region ID */ + RegionId string `json:"regionId"` + + /* NetworkSecurityGroup ID */ + NetworkSecurityGroupId string `json:"networkSecurityGroupId"` + + /* 安全组规则信息 */ + ModifySecurityGroupRuleSpecs []vpc.ModifySecurityGroupRules `json:"modifySecurityGroupRuleSpecs"` +} + +/* + * param regionId: Region ID (Required) + * param networkSecurityGroupId: NetworkSecurityGroup ID (Required) + * param modifySecurityGroupRuleSpecs: 安全组规则信息 (Required) + * + * @Deprecated, not compatible when mandatory parameters changed + */ +func NewModifyNetworkSecurityGroupRulesRequest( + regionId string, + networkSecurityGroupId string, + modifySecurityGroupRuleSpecs []vpc.ModifySecurityGroupRules, +) *ModifyNetworkSecurityGroupRulesRequest { + + return &ModifyNetworkSecurityGroupRulesRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/networkSecurityGroups/{networkSecurityGroupId}:modifyNetworkSecurityGroupRules", + Method: "POST", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + NetworkSecurityGroupId: networkSecurityGroupId, + ModifySecurityGroupRuleSpecs: modifySecurityGroupRuleSpecs, + } +} + +/* + * param regionId: Region ID (Required) + * param networkSecurityGroupId: NetworkSecurityGroup ID (Required) + * param modifySecurityGroupRuleSpecs: 安全组规则信息 (Required) + */ +func NewModifyNetworkSecurityGroupRulesRequestWithAllParams( + regionId string, + networkSecurityGroupId string, + modifySecurityGroupRuleSpecs []vpc.ModifySecurityGroupRules, +) *ModifyNetworkSecurityGroupRulesRequest { + + return &ModifyNetworkSecurityGroupRulesRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/networkSecurityGroups/{networkSecurityGroupId}:modifyNetworkSecurityGroupRules", + Method: "POST", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + NetworkSecurityGroupId: networkSecurityGroupId, + ModifySecurityGroupRuleSpecs: modifySecurityGroupRuleSpecs, + } +} + +/* This constructor has better compatible ability when API parameters changed */ +func NewModifyNetworkSecurityGroupRulesRequestWithoutParam() *ModifyNetworkSecurityGroupRulesRequest { + + return &ModifyNetworkSecurityGroupRulesRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/networkSecurityGroups/{networkSecurityGroupId}:modifyNetworkSecurityGroupRules", + Method: "POST", + Header: nil, + Version: "v1", + }, + } +} + +/* param regionId: Region ID(Required) */ +func (r *ModifyNetworkSecurityGroupRulesRequest) SetRegionId(regionId string) { + r.RegionId = regionId +} + +/* param networkSecurityGroupId: NetworkSecurityGroup ID(Required) */ +func (r *ModifyNetworkSecurityGroupRulesRequest) SetNetworkSecurityGroupId(networkSecurityGroupId string) { + r.NetworkSecurityGroupId = networkSecurityGroupId +} + +/* param modifySecurityGroupRuleSpecs: 安全组规则信息(Required) */ +func (r *ModifyNetworkSecurityGroupRulesRequest) SetModifySecurityGroupRuleSpecs(modifySecurityGroupRuleSpecs []vpc.ModifySecurityGroupRules) { + r.ModifySecurityGroupRuleSpecs = modifySecurityGroupRuleSpecs +} + +// GetRegionId returns path parameter 'regionId' if exist, +// otherwise return empty string +func (r ModifyNetworkSecurityGroupRulesRequest) GetRegionId() string { + return r.RegionId +} + +type ModifyNetworkSecurityGroupRulesResponse struct { + RequestID string `json:"requestId"` + Error core.ErrorResponse `json:"error"` + Result ModifyNetworkSecurityGroupRulesResult `json:"result"` +} + +type ModifyNetworkSecurityGroupRulesResult struct { +} \ No newline at end of file diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/ModifyRouteTable.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/ModifyRouteTable.go new file mode 100644 index 000000000..e97386635 --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/ModifyRouteTable.go @@ -0,0 +1,136 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package apis + +import ( + "github.com/jdcloud-api/jdcloud-sdk-go/core" +) + +type ModifyRouteTableRequest struct { + + core.JDCloudRequest + + /* Region ID */ + RegionId string `json:"regionId"` + + /* RouteTable ID */ + RouteTableId string `json:"routeTableId"` + + /* 路由表的名字。名称取值范围:1-32个中文、英文大小写的字母、数字和下划线分隔符 (Optional) */ + RouteTableName *string `json:"routeTableName"` + + /* 路由表的描述,取值范围:0-256个UTF-8编码下的全部字符 (Optional) */ + Description *string `json:"description"` +} + +/* + * param regionId: Region ID (Required) + * param routeTableId: RouteTable ID (Required) + * + * @Deprecated, not compatible when mandatory parameters changed + */ +func NewModifyRouteTableRequest( + regionId string, + routeTableId string, +) *ModifyRouteTableRequest { + + return &ModifyRouteTableRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/routeTables/{routeTableId}", + Method: "PATCH", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + RouteTableId: routeTableId, + } +} + +/* + * param regionId: Region ID (Required) + * param routeTableId: RouteTable ID (Required) + * param routeTableName: 路由表的名字。名称取值范围:1-32个中文、英文大小写的字母、数字和下划线分隔符 (Optional) + * param description: 路由表的描述,取值范围:0-256个UTF-8编码下的全部字符 (Optional) + */ +func NewModifyRouteTableRequestWithAllParams( + regionId string, + routeTableId string, + routeTableName *string, + description *string, +) *ModifyRouteTableRequest { + + return &ModifyRouteTableRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/routeTables/{routeTableId}", + Method: "PATCH", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + RouteTableId: routeTableId, + RouteTableName: routeTableName, + Description: description, + } +} + +/* This constructor has better compatible ability when API parameters changed */ +func NewModifyRouteTableRequestWithoutParam() *ModifyRouteTableRequest { + + return &ModifyRouteTableRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/routeTables/{routeTableId}", + Method: "PATCH", + Header: nil, + Version: "v1", + }, + } +} + +/* param regionId: Region ID(Required) */ +func (r *ModifyRouteTableRequest) SetRegionId(regionId string) { + r.RegionId = regionId +} + +/* param routeTableId: RouteTable ID(Required) */ +func (r *ModifyRouteTableRequest) SetRouteTableId(routeTableId string) { + r.RouteTableId = routeTableId +} + +/* param routeTableName: 路由表的名字。名称取值范围:1-32个中文、英文大小写的字母、数字和下划线分隔符(Optional) */ +func (r *ModifyRouteTableRequest) SetRouteTableName(routeTableName string) { + r.RouteTableName = &routeTableName +} + +/* param description: 路由表的描述,取值范围:0-256个UTF-8编码下的全部字符(Optional) */ +func (r *ModifyRouteTableRequest) SetDescription(description string) { + r.Description = &description +} + +// GetRegionId returns path parameter 'regionId' if exist, +// otherwise return empty string +func (r ModifyRouteTableRequest) GetRegionId() string { + return r.RegionId +} + +type ModifyRouteTableResponse struct { + RequestID string `json:"requestId"` + Error core.ErrorResponse `json:"error"` + Result ModifyRouteTableResult `json:"result"` +} + +type ModifyRouteTableResult struct { +} \ No newline at end of file diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/ModifyRouteTableRules.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/ModifyRouteTableRules.go new file mode 100644 index 000000000..7a1479c9c --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/ModifyRouteTableRules.go @@ -0,0 +1,129 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package apis + +import ( + "github.com/jdcloud-api/jdcloud-sdk-go/core" + vpc "github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models" +) + +type ModifyRouteTableRulesRequest struct { + + core.JDCloudRequest + + /* Region ID */ + RegionId string `json:"regionId"` + + /* RouteTable ID */ + RouteTableId string `json:"routeTableId"` + + /* 路由表规则信息 */ + ModifyRouteTableRuleSpecs []vpc.ModifyRouteTableRules `json:"modifyRouteTableRuleSpecs"` +} + +/* + * param regionId: Region ID (Required) + * param routeTableId: RouteTable ID (Required) + * param modifyRouteTableRuleSpecs: 路由表规则信息 (Required) + * + * @Deprecated, not compatible when mandatory parameters changed + */ +func NewModifyRouteTableRulesRequest( + regionId string, + routeTableId string, + modifyRouteTableRuleSpecs []vpc.ModifyRouteTableRules, +) *ModifyRouteTableRulesRequest { + + return &ModifyRouteTableRulesRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/routeTables/{routeTableId}:modifyRouteTableRules", + Method: "POST", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + RouteTableId: routeTableId, + ModifyRouteTableRuleSpecs: modifyRouteTableRuleSpecs, + } +} + +/* + * param regionId: Region ID (Required) + * param routeTableId: RouteTable ID (Required) + * param modifyRouteTableRuleSpecs: 路由表规则信息 (Required) + */ +func NewModifyRouteTableRulesRequestWithAllParams( + regionId string, + routeTableId string, + modifyRouteTableRuleSpecs []vpc.ModifyRouteTableRules, +) *ModifyRouteTableRulesRequest { + + return &ModifyRouteTableRulesRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/routeTables/{routeTableId}:modifyRouteTableRules", + Method: "POST", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + RouteTableId: routeTableId, + ModifyRouteTableRuleSpecs: modifyRouteTableRuleSpecs, + } +} + +/* This constructor has better compatible ability when API parameters changed */ +func NewModifyRouteTableRulesRequestWithoutParam() *ModifyRouteTableRulesRequest { + + return &ModifyRouteTableRulesRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/routeTables/{routeTableId}:modifyRouteTableRules", + Method: "POST", + Header: nil, + Version: "v1", + }, + } +} + +/* param regionId: Region ID(Required) */ +func (r *ModifyRouteTableRulesRequest) SetRegionId(regionId string) { + r.RegionId = regionId +} + +/* param routeTableId: RouteTable ID(Required) */ +func (r *ModifyRouteTableRulesRequest) SetRouteTableId(routeTableId string) { + r.RouteTableId = routeTableId +} + +/* param modifyRouteTableRuleSpecs: 路由表规则信息(Required) */ +func (r *ModifyRouteTableRulesRequest) SetModifyRouteTableRuleSpecs(modifyRouteTableRuleSpecs []vpc.ModifyRouteTableRules) { + r.ModifyRouteTableRuleSpecs = modifyRouteTableRuleSpecs +} + +// GetRegionId returns path parameter 'regionId' if exist, +// otherwise return empty string +func (r ModifyRouteTableRulesRequest) GetRegionId() string { + return r.RegionId +} + +type ModifyRouteTableRulesResponse struct { + RequestID string `json:"requestId"` + Error core.ErrorResponse `json:"error"` + Result ModifyRouteTableRulesResult `json:"result"` +} + +type ModifyRouteTableRulesResult struct { +} \ No newline at end of file diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/ModifySubnet.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/ModifySubnet.go new file mode 100644 index 000000000..1465afc76 --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/ModifySubnet.go @@ -0,0 +1,136 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package apis + +import ( + "github.com/jdcloud-api/jdcloud-sdk-go/core" +) + +type ModifySubnetRequest struct { + + core.JDCloudRequest + + /* Region ID */ + RegionId string `json:"regionId"` + + /* Subnet ID */ + SubnetId string `json:"subnetId"` + + /* 子网名称,只允许输入中文、数字、大小写字母、英文下划线“_”及中划线“-”,不允许为空且不超过32字符。 (Optional) */ + SubnetName *string `json:"subnetName"` + + /* 子网描述信息,允许输入UTF-8编码下的全部字符,不超过256字符。 (Optional) */ + Description *string `json:"description"` +} + +/* + * param regionId: Region ID (Required) + * param subnetId: Subnet ID (Required) + * + * @Deprecated, not compatible when mandatory parameters changed + */ +func NewModifySubnetRequest( + regionId string, + subnetId string, +) *ModifySubnetRequest { + + return &ModifySubnetRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/subnets/{subnetId}", + Method: "PATCH", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + SubnetId: subnetId, + } +} + +/* + * param regionId: Region ID (Required) + * param subnetId: Subnet ID (Required) + * param subnetName: 子网名称,只允许输入中文、数字、大小写字母、英文下划线“_”及中划线“-”,不允许为空且不超过32字符。 (Optional) + * param description: 子网描述信息,允许输入UTF-8编码下的全部字符,不超过256字符。 (Optional) + */ +func NewModifySubnetRequestWithAllParams( + regionId string, + subnetId string, + subnetName *string, + description *string, +) *ModifySubnetRequest { + + return &ModifySubnetRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/subnets/{subnetId}", + Method: "PATCH", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + SubnetId: subnetId, + SubnetName: subnetName, + Description: description, + } +} + +/* This constructor has better compatible ability when API parameters changed */ +func NewModifySubnetRequestWithoutParam() *ModifySubnetRequest { + + return &ModifySubnetRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/subnets/{subnetId}", + Method: "PATCH", + Header: nil, + Version: "v1", + }, + } +} + +/* param regionId: Region ID(Required) */ +func (r *ModifySubnetRequest) SetRegionId(regionId string) { + r.RegionId = regionId +} + +/* param subnetId: Subnet ID(Required) */ +func (r *ModifySubnetRequest) SetSubnetId(subnetId string) { + r.SubnetId = subnetId +} + +/* param subnetName: 子网名称,只允许输入中文、数字、大小写字母、英文下划线“_”及中划线“-”,不允许为空且不超过32字符。(Optional) */ +func (r *ModifySubnetRequest) SetSubnetName(subnetName string) { + r.SubnetName = &subnetName +} + +/* param description: 子网描述信息,允许输入UTF-8编码下的全部字符,不超过256字符。(Optional) */ +func (r *ModifySubnetRequest) SetDescription(description string) { + r.Description = &description +} + +// GetRegionId returns path parameter 'regionId' if exist, +// otherwise return empty string +func (r ModifySubnetRequest) GetRegionId() string { + return r.RegionId +} + +type ModifySubnetResponse struct { + RequestID string `json:"requestId"` + Error core.ErrorResponse `json:"error"` + Result ModifySubnetResult `json:"result"` +} + +type ModifySubnetResult struct { +} \ No newline at end of file diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/ModifyVpc.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/ModifyVpc.go new file mode 100644 index 000000000..c66845701 --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/ModifyVpc.go @@ -0,0 +1,136 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package apis + +import ( + "github.com/jdcloud-api/jdcloud-sdk-go/core" +) + +type ModifyVpcRequest struct { + + core.JDCloudRequest + + /* Region ID */ + RegionId string `json:"regionId"` + + /* Vpc ID */ + VpcId string `json:"vpcId"` + + /* 私有网络名称,只允许输入中文、数字、大小写字母、英文下划线“_”及中划线“-”,不允许为空且不超过32字符。 (Optional) */ + VpcName *string `json:"vpcName"` + + /* vpc描述,允许输入UTF-8编码下的全部字符,不超过256字符。 (Optional) */ + Description *string `json:"description"` +} + +/* + * param regionId: Region ID (Required) + * param vpcId: Vpc ID (Required) + * + * @Deprecated, not compatible when mandatory parameters changed + */ +func NewModifyVpcRequest( + regionId string, + vpcId string, +) *ModifyVpcRequest { + + return &ModifyVpcRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/vpcs/{vpcId}", + Method: "PATCH", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + VpcId: vpcId, + } +} + +/* + * param regionId: Region ID (Required) + * param vpcId: Vpc ID (Required) + * param vpcName: 私有网络名称,只允许输入中文、数字、大小写字母、英文下划线“_”及中划线“-”,不允许为空且不超过32字符。 (Optional) + * param description: vpc描述,允许输入UTF-8编码下的全部字符,不超过256字符。 (Optional) + */ +func NewModifyVpcRequestWithAllParams( + regionId string, + vpcId string, + vpcName *string, + description *string, +) *ModifyVpcRequest { + + return &ModifyVpcRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/vpcs/{vpcId}", + Method: "PATCH", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + VpcId: vpcId, + VpcName: vpcName, + Description: description, + } +} + +/* This constructor has better compatible ability when API parameters changed */ +func NewModifyVpcRequestWithoutParam() *ModifyVpcRequest { + + return &ModifyVpcRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/vpcs/{vpcId}", + Method: "PATCH", + Header: nil, + Version: "v1", + }, + } +} + +/* param regionId: Region ID(Required) */ +func (r *ModifyVpcRequest) SetRegionId(regionId string) { + r.RegionId = regionId +} + +/* param vpcId: Vpc ID(Required) */ +func (r *ModifyVpcRequest) SetVpcId(vpcId string) { + r.VpcId = vpcId +} + +/* param vpcName: 私有网络名称,只允许输入中文、数字、大小写字母、英文下划线“_”及中划线“-”,不允许为空且不超过32字符。(Optional) */ +func (r *ModifyVpcRequest) SetVpcName(vpcName string) { + r.VpcName = &vpcName +} + +/* param description: vpc描述,允许输入UTF-8编码下的全部字符,不超过256字符。(Optional) */ +func (r *ModifyVpcRequest) SetDescription(description string) { + r.Description = &description +} + +// GetRegionId returns path parameter 'regionId' if exist, +// otherwise return empty string +func (r ModifyVpcRequest) GetRegionId() string { + return r.RegionId +} + +type ModifyVpcResponse struct { + RequestID string `json:"requestId"` + Error core.ErrorResponse `json:"error"` + Result ModifyVpcResult `json:"result"` +} + +type ModifyVpcResult struct { +} \ No newline at end of file diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/ModifyVpcPeering.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/ModifyVpcPeering.go new file mode 100644 index 000000000..804b6c5b8 --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/ModifyVpcPeering.go @@ -0,0 +1,136 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package apis + +import ( + "github.com/jdcloud-api/jdcloud-sdk-go/core" +) + +type ModifyVpcPeeringRequest struct { + + core.JDCloudRequest + + /* Region ID */ + RegionId string `json:"regionId"` + + /* vpcPeeringId ID */ + VpcPeeringId string `json:"vpcPeeringId"` + + /* VpcPeering的名字,不为空。名称取值范围:1-32个中文、英文大小写的字母、数字和下划线分隔符 (Optional) */ + VpcPeeringName *string `json:"vpcPeeringName"` + + /* VpcPeering 描述,取值范围:0-256个中文、英文大小写的字母、数字和下划线分隔符 (Optional) */ + Description *string `json:"description"` +} + +/* + * param regionId: Region ID (Required) + * param vpcPeeringId: vpcPeeringId ID (Required) + * + * @Deprecated, not compatible when mandatory parameters changed + */ +func NewModifyVpcPeeringRequest( + regionId string, + vpcPeeringId string, +) *ModifyVpcPeeringRequest { + + return &ModifyVpcPeeringRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/vpcPeerings/{vpcPeeringId}", + Method: "PUT", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + VpcPeeringId: vpcPeeringId, + } +} + +/* + * param regionId: Region ID (Required) + * param vpcPeeringId: vpcPeeringId ID (Required) + * param vpcPeeringName: VpcPeering的名字,不为空。名称取值范围:1-32个中文、英文大小写的字母、数字和下划线分隔符 (Optional) + * param description: VpcPeering 描述,取值范围:0-256个中文、英文大小写的字母、数字和下划线分隔符 (Optional) + */ +func NewModifyVpcPeeringRequestWithAllParams( + regionId string, + vpcPeeringId string, + vpcPeeringName *string, + description *string, +) *ModifyVpcPeeringRequest { + + return &ModifyVpcPeeringRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/vpcPeerings/{vpcPeeringId}", + Method: "PUT", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + VpcPeeringId: vpcPeeringId, + VpcPeeringName: vpcPeeringName, + Description: description, + } +} + +/* This constructor has better compatible ability when API parameters changed */ +func NewModifyVpcPeeringRequestWithoutParam() *ModifyVpcPeeringRequest { + + return &ModifyVpcPeeringRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/vpcPeerings/{vpcPeeringId}", + Method: "PUT", + Header: nil, + Version: "v1", + }, + } +} + +/* param regionId: Region ID(Required) */ +func (r *ModifyVpcPeeringRequest) SetRegionId(regionId string) { + r.RegionId = regionId +} + +/* param vpcPeeringId: vpcPeeringId ID(Required) */ +func (r *ModifyVpcPeeringRequest) SetVpcPeeringId(vpcPeeringId string) { + r.VpcPeeringId = vpcPeeringId +} + +/* param vpcPeeringName: VpcPeering的名字,不为空。名称取值范围:1-32个中文、英文大小写的字母、数字和下划线分隔符(Optional) */ +func (r *ModifyVpcPeeringRequest) SetVpcPeeringName(vpcPeeringName string) { + r.VpcPeeringName = &vpcPeeringName +} + +/* param description: VpcPeering 描述,取值范围:0-256个中文、英文大小写的字母、数字和下划线分隔符(Optional) */ +func (r *ModifyVpcPeeringRequest) SetDescription(description string) { + r.Description = &description +} + +// GetRegionId returns path parameter 'regionId' if exist, +// otherwise return empty string +func (r ModifyVpcPeeringRequest) GetRegionId() string { + return r.RegionId +} + +type ModifyVpcPeeringResponse struct { + RequestID string `json:"requestId"` + Error core.ErrorResponse `json:"error"` + Result ModifyVpcPeeringResult `json:"result"` +} + +type ModifyVpcPeeringResult struct { +} \ No newline at end of file diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/RemoveNetworkAclRules.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/RemoveNetworkAclRules.go new file mode 100644 index 000000000..3bea0a0b7 --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/RemoveNetworkAclRules.go @@ -0,0 +1,128 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package apis + +import ( + "github.com/jdcloud-api/jdcloud-sdk-go/core" +) + +type RemoveNetworkAclRulesRequest struct { + + core.JDCloudRequest + + /* Region ID */ + RegionId string `json:"regionId"` + + /* networkAclId ID */ + NetworkAclId string `json:"networkAclId"` + + /* networkAcl规则ID列表 */ + RuleIds []string `json:"ruleIds"` +} + +/* + * param regionId: Region ID (Required) + * param networkAclId: networkAclId ID (Required) + * param ruleIds: networkAcl规则ID列表 (Required) + * + * @Deprecated, not compatible when mandatory parameters changed + */ +func NewRemoveNetworkAclRulesRequest( + regionId string, + networkAclId string, + ruleIds []string, +) *RemoveNetworkAclRulesRequest { + + return &RemoveNetworkAclRulesRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/networkAcls/{networkAclId}:removeNetworkAclRules", + Method: "POST", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + NetworkAclId: networkAclId, + RuleIds: ruleIds, + } +} + +/* + * param regionId: Region ID (Required) + * param networkAclId: networkAclId ID (Required) + * param ruleIds: networkAcl规则ID列表 (Required) + */ +func NewRemoveNetworkAclRulesRequestWithAllParams( + regionId string, + networkAclId string, + ruleIds []string, +) *RemoveNetworkAclRulesRequest { + + return &RemoveNetworkAclRulesRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/networkAcls/{networkAclId}:removeNetworkAclRules", + Method: "POST", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + NetworkAclId: networkAclId, + RuleIds: ruleIds, + } +} + +/* This constructor has better compatible ability when API parameters changed */ +func NewRemoveNetworkAclRulesRequestWithoutParam() *RemoveNetworkAclRulesRequest { + + return &RemoveNetworkAclRulesRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/networkAcls/{networkAclId}:removeNetworkAclRules", + Method: "POST", + Header: nil, + Version: "v1", + }, + } +} + +/* param regionId: Region ID(Required) */ +func (r *RemoveNetworkAclRulesRequest) SetRegionId(regionId string) { + r.RegionId = regionId +} + +/* param networkAclId: networkAclId ID(Required) */ +func (r *RemoveNetworkAclRulesRequest) SetNetworkAclId(networkAclId string) { + r.NetworkAclId = networkAclId +} + +/* param ruleIds: networkAcl规则ID列表(Required) */ +func (r *RemoveNetworkAclRulesRequest) SetRuleIds(ruleIds []string) { + r.RuleIds = ruleIds +} + +// GetRegionId returns path parameter 'regionId' if exist, +// otherwise return empty string +func (r RemoveNetworkAclRulesRequest) GetRegionId() string { + return r.RegionId +} + +type RemoveNetworkAclRulesResponse struct { + RequestID string `json:"requestId"` + Error core.ErrorResponse `json:"error"` + Result RemoveNetworkAclRulesResult `json:"result"` +} + +type RemoveNetworkAclRulesResult struct { +} \ No newline at end of file diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/RemoveNetworkSecurityGroupRules.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/RemoveNetworkSecurityGroupRules.go new file mode 100644 index 000000000..abb2c3977 --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/RemoveNetworkSecurityGroupRules.go @@ -0,0 +1,128 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package apis + +import ( + "github.com/jdcloud-api/jdcloud-sdk-go/core" +) + +type RemoveNetworkSecurityGroupRulesRequest struct { + + core.JDCloudRequest + + /* Region ID */ + RegionId string `json:"regionId"` + + /* NetworkSecurityGroup ID */ + NetworkSecurityGroupId string `json:"networkSecurityGroupId"` + + /* 安全组规则Id列表 */ + RuleIds []string `json:"ruleIds"` +} + +/* + * param regionId: Region ID (Required) + * param networkSecurityGroupId: NetworkSecurityGroup ID (Required) + * param ruleIds: 安全组规则Id列表 (Required) + * + * @Deprecated, not compatible when mandatory parameters changed + */ +func NewRemoveNetworkSecurityGroupRulesRequest( + regionId string, + networkSecurityGroupId string, + ruleIds []string, +) *RemoveNetworkSecurityGroupRulesRequest { + + return &RemoveNetworkSecurityGroupRulesRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/networkSecurityGroups/{networkSecurityGroupId}:removeNetworkSecurityGroupRules", + Method: "POST", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + NetworkSecurityGroupId: networkSecurityGroupId, + RuleIds: ruleIds, + } +} + +/* + * param regionId: Region ID (Required) + * param networkSecurityGroupId: NetworkSecurityGroup ID (Required) + * param ruleIds: 安全组规则Id列表 (Required) + */ +func NewRemoveNetworkSecurityGroupRulesRequestWithAllParams( + regionId string, + networkSecurityGroupId string, + ruleIds []string, +) *RemoveNetworkSecurityGroupRulesRequest { + + return &RemoveNetworkSecurityGroupRulesRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/networkSecurityGroups/{networkSecurityGroupId}:removeNetworkSecurityGroupRules", + Method: "POST", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + NetworkSecurityGroupId: networkSecurityGroupId, + RuleIds: ruleIds, + } +} + +/* This constructor has better compatible ability when API parameters changed */ +func NewRemoveNetworkSecurityGroupRulesRequestWithoutParam() *RemoveNetworkSecurityGroupRulesRequest { + + return &RemoveNetworkSecurityGroupRulesRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/networkSecurityGroups/{networkSecurityGroupId}:removeNetworkSecurityGroupRules", + Method: "POST", + Header: nil, + Version: "v1", + }, + } +} + +/* param regionId: Region ID(Required) */ +func (r *RemoveNetworkSecurityGroupRulesRequest) SetRegionId(regionId string) { + r.RegionId = regionId +} + +/* param networkSecurityGroupId: NetworkSecurityGroup ID(Required) */ +func (r *RemoveNetworkSecurityGroupRulesRequest) SetNetworkSecurityGroupId(networkSecurityGroupId string) { + r.NetworkSecurityGroupId = networkSecurityGroupId +} + +/* param ruleIds: 安全组规则Id列表(Required) */ +func (r *RemoveNetworkSecurityGroupRulesRequest) SetRuleIds(ruleIds []string) { + r.RuleIds = ruleIds +} + +// GetRegionId returns path parameter 'regionId' if exist, +// otherwise return empty string +func (r RemoveNetworkSecurityGroupRulesRequest) GetRegionId() string { + return r.RegionId +} + +type RemoveNetworkSecurityGroupRulesResponse struct { + RequestID string `json:"requestId"` + Error core.ErrorResponse `json:"error"` + Result RemoveNetworkSecurityGroupRulesResult `json:"result"` +} + +type RemoveNetworkSecurityGroupRulesResult struct { +} \ No newline at end of file diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/RemoveRouteTableRules.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/RemoveRouteTableRules.go new file mode 100644 index 000000000..a307b98db --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/RemoveRouteTableRules.go @@ -0,0 +1,128 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package apis + +import ( + "github.com/jdcloud-api/jdcloud-sdk-go/core" +) + +type RemoveRouteTableRulesRequest struct { + + core.JDCloudRequest + + /* Region ID */ + RegionId string `json:"regionId"` + + /* RouteTable ID */ + RouteTableId string `json:"routeTableId"` + + /* 路由表规则Id列表 */ + RuleIds []string `json:"ruleIds"` +} + +/* + * param regionId: Region ID (Required) + * param routeTableId: RouteTable ID (Required) + * param ruleIds: 路由表规则Id列表 (Required) + * + * @Deprecated, not compatible when mandatory parameters changed + */ +func NewRemoveRouteTableRulesRequest( + regionId string, + routeTableId string, + ruleIds []string, +) *RemoveRouteTableRulesRequest { + + return &RemoveRouteTableRulesRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/routeTables/{routeTableId}:removeRouteTableRules", + Method: "POST", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + RouteTableId: routeTableId, + RuleIds: ruleIds, + } +} + +/* + * param regionId: Region ID (Required) + * param routeTableId: RouteTable ID (Required) + * param ruleIds: 路由表规则Id列表 (Required) + */ +func NewRemoveRouteTableRulesRequestWithAllParams( + regionId string, + routeTableId string, + ruleIds []string, +) *RemoveRouteTableRulesRequest { + + return &RemoveRouteTableRulesRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/routeTables/{routeTableId}:removeRouteTableRules", + Method: "POST", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + RouteTableId: routeTableId, + RuleIds: ruleIds, + } +} + +/* This constructor has better compatible ability when API parameters changed */ +func NewRemoveRouteTableRulesRequestWithoutParam() *RemoveRouteTableRulesRequest { + + return &RemoveRouteTableRulesRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/routeTables/{routeTableId}:removeRouteTableRules", + Method: "POST", + Header: nil, + Version: "v1", + }, + } +} + +/* param regionId: Region ID(Required) */ +func (r *RemoveRouteTableRulesRequest) SetRegionId(regionId string) { + r.RegionId = regionId +} + +/* param routeTableId: RouteTable ID(Required) */ +func (r *RemoveRouteTableRulesRequest) SetRouteTableId(routeTableId string) { + r.RouteTableId = routeTableId +} + +/* param ruleIds: 路由表规则Id列表(Required) */ +func (r *RemoveRouteTableRulesRequest) SetRuleIds(ruleIds []string) { + r.RuleIds = ruleIds +} + +// GetRegionId returns path parameter 'regionId' if exist, +// otherwise return empty string +func (r RemoveRouteTableRulesRequest) GetRegionId() string { + return r.RegionId +} + +type RemoveRouteTableRulesResponse struct { + RequestID string `json:"requestId"` + Error core.ErrorResponse `json:"error"` + Result RemoveRouteTableRulesResult `json:"result"` +} + +type RemoveRouteTableRulesResult struct { +} \ No newline at end of file diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/UnassignSecondaryIps.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/UnassignSecondaryIps.go new file mode 100644 index 000000000..5d3e7260f --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/UnassignSecondaryIps.go @@ -0,0 +1,125 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package apis + +import ( + "github.com/jdcloud-api/jdcloud-sdk-go/core" +) + +type UnassignSecondaryIpsRequest struct { + + core.JDCloudRequest + + /* Region ID */ + RegionId string `json:"regionId"` + + /* networkInterface ID */ + NetworkInterfaceId string `json:"networkInterfaceId"` + + /* 指定删除的secondaryIp地址 (Optional) */ + SecondaryIps []string `json:"secondaryIps"` +} + +/* + * param regionId: Region ID (Required) + * param networkInterfaceId: networkInterface ID (Required) + * + * @Deprecated, not compatible when mandatory parameters changed + */ +func NewUnassignSecondaryIpsRequest( + regionId string, + networkInterfaceId string, +) *UnassignSecondaryIpsRequest { + + return &UnassignSecondaryIpsRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/networkInterfaces/{networkInterfaceId}:unassignSecondaryIps", + Method: "POST", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + NetworkInterfaceId: networkInterfaceId, + } +} + +/* + * param regionId: Region ID (Required) + * param networkInterfaceId: networkInterface ID (Required) + * param secondaryIps: 指定删除的secondaryIp地址 (Optional) + */ +func NewUnassignSecondaryIpsRequestWithAllParams( + regionId string, + networkInterfaceId string, + secondaryIps []string, +) *UnassignSecondaryIpsRequest { + + return &UnassignSecondaryIpsRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/networkInterfaces/{networkInterfaceId}:unassignSecondaryIps", + Method: "POST", + Header: nil, + Version: "v1", + }, + RegionId: regionId, + NetworkInterfaceId: networkInterfaceId, + SecondaryIps: secondaryIps, + } +} + +/* This constructor has better compatible ability when API parameters changed */ +func NewUnassignSecondaryIpsRequestWithoutParam() *UnassignSecondaryIpsRequest { + + return &UnassignSecondaryIpsRequest{ + JDCloudRequest: core.JDCloudRequest{ + URL: "/regions/{regionId}/networkInterfaces/{networkInterfaceId}:unassignSecondaryIps", + Method: "POST", + Header: nil, + Version: "v1", + }, + } +} + +/* param regionId: Region ID(Required) */ +func (r *UnassignSecondaryIpsRequest) SetRegionId(regionId string) { + r.RegionId = regionId +} + +/* param networkInterfaceId: networkInterface ID(Required) */ +func (r *UnassignSecondaryIpsRequest) SetNetworkInterfaceId(networkInterfaceId string) { + r.NetworkInterfaceId = networkInterfaceId +} + +/* param secondaryIps: 指定删除的secondaryIp地址(Optional) */ +func (r *UnassignSecondaryIpsRequest) SetSecondaryIps(secondaryIps []string) { + r.SecondaryIps = secondaryIps +} + +// GetRegionId returns path parameter 'regionId' if exist, +// otherwise return empty string +func (r UnassignSecondaryIpsRequest) GetRegionId() string { + return r.RegionId +} + +type UnassignSecondaryIpsResponse struct { + RequestID string `json:"requestId"` + Error core.ErrorResponse `json:"error"` + Result UnassignSecondaryIpsResult `json:"result"` +} + +type UnassignSecondaryIpsResult struct { +} \ No newline at end of file diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/client/VpcClient.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/client/VpcClient.go new file mode 100644 index 000000000..a81ad2155 --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/client/VpcClient.go @@ -0,0 +1,1215 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package client + +import ( + "github.com/jdcloud-api/jdcloud-sdk-go/core" + vpc "github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis" + "encoding/json" + "errors" +) + +type VpcClient struct { + core.JDCloudClient +} + +func NewVpcClient(credential *core.Credential) *VpcClient { + if credential == nil { + return nil + } + + config := core.NewConfig() + config.SetEndpoint("vpc.jdcloud-api.com") + + return &VpcClient{ + core.JDCloudClient{ + Credential: *credential, + Config: *config, + ServiceName: "vpc", + Revision: "0.5.1", + Logger: core.NewDefaultLogger(core.LogInfo), + }} +} + +func (c *VpcClient) SetConfig(config *core.Config) { + c.Config = *config +} + +func (c *VpcClient) SetLogger(logger core.Logger) { + c.Logger = logger +} + +/* 删除弹性Ip */ +func (c *VpcClient) DeleteElasticIp(request *vpc.DeleteElasticIpRequest) (*vpc.DeleteElasticIpResponse, error) { + if request == nil { + return nil, errors.New("Request object is nil. ") + } + resp, err := c.Send(request, c.ServiceName) + if err != nil { + return nil, err + } + + jdResp := &vpc.DeleteElasticIpResponse{} + err = json.Unmarshal(resp, jdResp) + if err != nil { + c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) + return nil, err + } + + return jdResp, err +} + +/* 修改VpcPeering接口 */ +func (c *VpcClient) ModifyVpcPeering(request *vpc.ModifyVpcPeeringRequest) (*vpc.ModifyVpcPeeringResponse, error) { + if request == nil { + return nil, errors.New("Request object is nil. ") + } + resp, err := c.Send(request, c.ServiceName) + if err != nil { + return nil, err + } + + jdResp := &vpc.ModifyVpcPeeringResponse{} + err = json.Unmarshal(resp, jdResp) + if err != nil { + c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) + return nil, err + } + + return jdResp, err +} + +/* 修改弹性IP */ +func (c *VpcClient) ModifyElasticIp(request *vpc.ModifyElasticIpRequest) (*vpc.ModifyElasticIpResponse, error) { + if request == nil { + return nil, errors.New("Request object is nil. ") + } + resp, err := c.Send(request, c.ServiceName) + if err != nil { + return nil, err + } + + jdResp := &vpc.ModifyElasticIpResponse{} + err = json.Unmarshal(resp, jdResp) + if err != nil { + c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) + return nil, err + } + + return jdResp, err +} + +/* 修改networkAcl接口 */ +func (c *VpcClient) ModifyNetworkAclRules(request *vpc.ModifyNetworkAclRulesRequest) (*vpc.ModifyNetworkAclRulesResponse, error) { + if request == nil { + return nil, errors.New("Request object is nil. ") + } + resp, err := c.Send(request, c.ServiceName) + if err != nil { + return nil, err + } + + jdResp := &vpc.ModifyNetworkAclRulesResponse{} + err = json.Unmarshal(resp, jdResp) + if err != nil { + c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) + return nil, err + } + + return jdResp, err +} + +/* 删除networkAcl接口 */ +func (c *VpcClient) DeleteNetworkAcl(request *vpc.DeleteNetworkAclRequest) (*vpc.DeleteNetworkAclResponse, error) { + if request == nil { + return nil, errors.New("Request object is nil. ") + } + resp, err := c.Send(request, c.ServiceName) + if err != nil { + return nil, err + } + + jdResp := &vpc.DeleteNetworkAclResponse{} + err = json.Unmarshal(resp, jdResp) + if err != nil { + c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) + return nil, err + } + + return jdResp, err +} + +/* 删除子网 */ +func (c *VpcClient) DeleteSubnet(request *vpc.DeleteSubnetRequest) (*vpc.DeleteSubnetResponse, error) { + if request == nil { + return nil, errors.New("Request object is nil. ") + } + resp, err := c.Send(request, c.ServiceName) + if err != nil { + return nil, err + } + + jdResp := &vpc.DeleteSubnetResponse{} + err = json.Unmarshal(resp, jdResp) + if err != nil { + c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) + return nil, err + } + + return jdResp, err +} + +/* 查询子网列表 */ +func (c *VpcClient) DescribeSubnets(request *vpc.DescribeSubnetsRequest) (*vpc.DescribeSubnetsResponse, error) { + if request == nil { + return nil, errors.New("Request object is nil. ") + } + resp, err := c.Send(request, c.ServiceName) + if err != nil { + return nil, err + } + + jdResp := &vpc.DescribeSubnetsResponse{} + err = json.Unmarshal(resp, jdResp) + if err != nil { + c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) + return nil, err + } + + return jdResp, err +} + +/* 查询弹性网卡列表 */ +func (c *VpcClient) DescribeNetworkInterfaces(request *vpc.DescribeNetworkInterfacesRequest) (*vpc.DescribeNetworkInterfacesResponse, error) { + if request == nil { + return nil, errors.New("Request object is nil. ") + } + resp, err := c.Send(request, c.ServiceName) + if err != nil { + return nil, err + } + + jdResp := &vpc.DescribeNetworkInterfacesResponse{} + err = json.Unmarshal(resp, jdResp) + if err != nil { + c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) + return nil, err + } + + return jdResp, err +} + +/* 移除安全组规则 */ +func (c *VpcClient) RemoveNetworkSecurityGroupRules(request *vpc.RemoveNetworkSecurityGroupRulesRequest) (*vpc.RemoveNetworkSecurityGroupRulesResponse, error) { + if request == nil { + return nil, errors.New("Request object is nil. ") + } + resp, err := c.Send(request, c.ServiceName) + if err != nil { + return nil, err + } + + jdResp := &vpc.RemoveNetworkSecurityGroupRulesResponse{} + err = json.Unmarshal(resp, jdResp) + if err != nil { + c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) + return nil, err + } + + return jdResp, err +} + +/* 修改安全组属性 */ +func (c *VpcClient) ModifyNetworkSecurityGroup(request *vpc.ModifyNetworkSecurityGroupRequest) (*vpc.ModifyNetworkSecurityGroupResponse, error) { + if request == nil { + return nil, errors.New("Request object is nil. ") + } + resp, err := c.Send(request, c.ServiceName) + if err != nil { + return nil, err + } + + jdResp := &vpc.ModifyNetworkSecurityGroupResponse{} + err = json.Unmarshal(resp, jdResp) + if err != nil { + c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) + return nil, err + } + + return jdResp, err +} + +/* 添加安全组规则 */ +func (c *VpcClient) AddNetworkSecurityGroupRules(request *vpc.AddNetworkSecurityGroupRulesRequest) (*vpc.AddNetworkSecurityGroupRulesResponse, error) { + if request == nil { + return nil, errors.New("Request object is nil. ") + } + resp, err := c.Send(request, c.ServiceName) + if err != nil { + return nil, err + } + + jdResp := &vpc.AddNetworkSecurityGroupRulesResponse{} + err = json.Unmarshal(resp, jdResp) + if err != nil { + c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) + return nil, err + } + + return jdResp, err +} + +/* 创建networkAcl接口 */ +func (c *VpcClient) CreateNetworkAcl(request *vpc.CreateNetworkAclRequest) (*vpc.CreateNetworkAclResponse, error) { + if request == nil { + return nil, errors.New("Request object is nil. ") + } + resp, err := c.Send(request, c.ServiceName) + if err != nil { + return nil, err + } + + jdResp := &vpc.CreateNetworkAclResponse{} + err = json.Unmarshal(resp, jdResp) + if err != nil { + c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) + return nil, err + } + + return jdResp, err +} + +/* 查询配额信息 */ +func (c *VpcClient) DescribeQuota(request *vpc.DescribeQuotaRequest) (*vpc.DescribeQuotaResponse, error) { + if request == nil { + return nil, errors.New("Request object is nil. ") + } + resp, err := c.Send(request, c.ServiceName) + if err != nil { + return nil, err + } + + jdResp := &vpc.DescribeQuotaResponse{} + err = json.Unmarshal(resp, jdResp) + if err != nil { + c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) + return nil, err + } + + return jdResp, err +} + +/* 创建路由表 */ +func (c *VpcClient) CreateRouteTable(request *vpc.CreateRouteTableRequest) (*vpc.CreateRouteTableResponse, error) { + if request == nil { + return nil, errors.New("Request object is nil. ") + } + resp, err := c.Send(request, c.ServiceName) + if err != nil { + return nil, err + } + + jdResp := &vpc.CreateRouteTableResponse{} + err = json.Unmarshal(resp, jdResp) + if err != nil { + c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) + return nil, err + } + + return jdResp, err +} + +/* 删除安全组 */ +func (c *VpcClient) DeleteNetworkSecurityGroup(request *vpc.DeleteNetworkSecurityGroupRequest) (*vpc.DeleteNetworkSecurityGroupResponse, error) { + if request == nil { + return nil, errors.New("Request object is nil. ") + } + resp, err := c.Send(request, c.ServiceName) + if err != nil { + return nil, err + } + + jdResp := &vpc.DeleteNetworkSecurityGroupResponse{} + err = json.Unmarshal(resp, jdResp) + if err != nil { + c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) + return nil, err + } + + return jdResp, err +} + +/* 查询路由表信息详情 */ +func (c *VpcClient) DescribeRouteTable(request *vpc.DescribeRouteTableRequest) (*vpc.DescribeRouteTableResponse, error) { + if request == nil { + return nil, errors.New("Request object is nil. ") + } + resp, err := c.Send(request, c.ServiceName) + if err != nil { + return nil, err + } + + jdResp := &vpc.DescribeRouteTableResponse{} + err = json.Unmarshal(resp, jdResp) + if err != nil { + c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) + return nil, err + } + + return jdResp, err +} + +/* 删除私有网络 */ +func (c *VpcClient) DeleteVpc(request *vpc.DeleteVpcRequest) (*vpc.DeleteVpcResponse, error) { + if request == nil { + return nil, errors.New("Request object is nil. ") + } + resp, err := c.Send(request, c.ServiceName) + if err != nil { + return nil, err + } + + jdResp := &vpc.DeleteVpcResponse{} + err = json.Unmarshal(resp, jdResp) + if err != nil { + c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) + return nil, err + } + + return jdResp, err +} + +/* 查询VpcPeering资源列表 */ +func (c *VpcClient) DescribeVpcPeerings(request *vpc.DescribeVpcPeeringsRequest) (*vpc.DescribeVpcPeeringsResponse, error) { + if request == nil { + return nil, errors.New("Request object is nil. ") + } + resp, err := c.Send(request, c.ServiceName) + if err != nil { + return nil, err + } + + jdResp := &vpc.DescribeVpcPeeringsResponse{} + err = json.Unmarshal(resp, jdResp) + if err != nil { + c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) + return nil, err + } + + return jdResp, err +} + +/* 查询Acl列表 */ +func (c *VpcClient) DescribeNetworkAcls(request *vpc.DescribeNetworkAclsRequest) (*vpc.DescribeNetworkAclsResponse, error) { + if request == nil { + return nil, errors.New("Request object is nil. ") + } + resp, err := c.Send(request, c.ServiceName) + if err != nil { + return nil, err + } + + jdResp := &vpc.DescribeNetworkAclsResponse{} + err = json.Unmarshal(resp, jdResp) + if err != nil { + c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) + return nil, err + } + + return jdResp, err +} + +/* 查询子网信息详情 */ +func (c *VpcClient) DescribeSubnet(request *vpc.DescribeSubnetRequest) (*vpc.DescribeSubnetResponse, error) { + if request == nil { + return nil, errors.New("Request object is nil. ") + } + resp, err := c.Send(request, c.ServiceName) + if err != nil { + return nil, err + } + + jdResp := &vpc.DescribeSubnetResponse{} + err = json.Unmarshal(resp, jdResp) + if err != nil { + c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) + return nil, err + } + + return jdResp, err +} + +/* 查询安全组信息详情 */ +func (c *VpcClient) DescribeNetworkSecurityGroup(request *vpc.DescribeNetworkSecurityGroupRequest) (*vpc.DescribeNetworkSecurityGroupResponse, error) { + if request == nil { + return nil, errors.New("Request object is nil. ") + } + resp, err := c.Send(request, c.ServiceName) + if err != nil { + return nil, err + } + + jdResp := &vpc.DescribeNetworkSecurityGroupResponse{} + err = json.Unmarshal(resp, jdResp) + if err != nil { + c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) + return nil, err + } + + return jdResp, err +} + +/* 查询安全组列表 */ +func (c *VpcClient) DescribeNetworkSecurityGroups(request *vpc.DescribeNetworkSecurityGroupsRequest) (*vpc.DescribeNetworkSecurityGroupsResponse, error) { + if request == nil { + return nil, errors.New("Request object is nil. ") + } + resp, err := c.Send(request, c.ServiceName) + if err != nil { + return nil, err + } + + jdResp := &vpc.DescribeNetworkSecurityGroupsResponse{} + err = json.Unmarshal(resp, jdResp) + if err != nil { + c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) + return nil, err + } + + return jdResp, err +} + +/* 查询Vpc信息详情 */ +func (c *VpcClient) DescribeVpc(request *vpc.DescribeVpcRequest) (*vpc.DescribeVpcResponse, error) { + if request == nil { + return nil, errors.New("Request object is nil. ") + } + resp, err := c.Send(request, c.ServiceName) + if err != nil { + return nil, err + } + + jdResp := &vpc.DescribeVpcResponse{} + err = json.Unmarshal(resp, jdResp) + if err != nil { + c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) + return nil, err + } + + return jdResp, err +} + +/* 给子网解绑NetworkAcl接口 */ +func (c *VpcClient) DisassociateNetworkAcl(request *vpc.DisassociateNetworkAclRequest) (*vpc.DisassociateNetworkAclResponse, error) { + if request == nil { + return nil, errors.New("Request object is nil. ") + } + resp, err := c.Send(request, c.ServiceName) + if err != nil { + return nil, err + } + + jdResp := &vpc.DisassociateNetworkAclResponse{} + err = json.Unmarshal(resp, jdResp) + if err != nil { + c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) + return nil, err + } + + return jdResp, err +} + +/* 移除networkAcl规则 */ +func (c *VpcClient) RemoveNetworkAclRules(request *vpc.RemoveNetworkAclRulesRequest) (*vpc.RemoveNetworkAclRulesResponse, error) { + if request == nil { + return nil, errors.New("Request object is nil. ") + } + resp, err := c.Send(request, c.ServiceName) + if err != nil { + return nil, err + } + + jdResp := &vpc.RemoveNetworkAclRulesResponse{} + err = json.Unmarshal(resp, jdResp) + if err != nil { + c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) + return nil, err + } + + return jdResp, err +} + +/* 路由表绑定子网接口 */ +func (c *VpcClient) AssociateRouteTable(request *vpc.AssociateRouteTableRequest) (*vpc.AssociateRouteTableResponse, error) { + if request == nil { + return nil, errors.New("Request object is nil. ") + } + resp, err := c.Send(request, c.ServiceName) + if err != nil { + return nil, err + } + + jdResp := &vpc.AssociateRouteTableResponse{} + err = json.Unmarshal(resp, jdResp) + if err != nil { + c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) + return nil, err + } + + return jdResp, err +} + +/* 查询私有网络列表 */ +func (c *VpcClient) DescribeVpcs(request *vpc.DescribeVpcsRequest) (*vpc.DescribeVpcsResponse, error) { + if request == nil { + return nil, errors.New("Request object is nil. ") + } + resp, err := c.Send(request, c.ServiceName) + if err != nil { + return nil, err + } + + jdResp := &vpc.DescribeVpcsResponse{} + err = json.Unmarshal(resp, jdResp) + if err != nil { + c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) + return nil, err + } + + return jdResp, err +} + +/* 创建安全组 */ +func (c *VpcClient) CreateNetworkSecurityGroup(request *vpc.CreateNetworkSecurityGroupRequest) (*vpc.CreateNetworkSecurityGroupResponse, error) { + if request == nil { + return nil, errors.New("Request object is nil. ") + } + resp, err := c.Send(request, c.ServiceName) + if err != nil { + return nil, err + } + + jdResp := &vpc.CreateNetworkSecurityGroupResponse{} + err = json.Unmarshal(resp, jdResp) + if err != nil { + c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) + return nil, err + } + + return jdResp, err +} + +/* 创建子网 */ +func (c *VpcClient) CreateSubnet(request *vpc.CreateSubnetRequest) (*vpc.CreateSubnetResponse, error) { + if request == nil { + return nil, errors.New("Request object is nil. ") + } + resp, err := c.Send(request, c.ServiceName) + if err != nil { + return nil, err + } + + jdResp := &vpc.CreateSubnetResponse{} + err = json.Unmarshal(resp, jdResp) + if err != nil { + c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) + return nil, err + } + + return jdResp, err +} + +/* 删除路由表 */ +func (c *VpcClient) DeleteRouteTable(request *vpc.DeleteRouteTableRequest) (*vpc.DeleteRouteTableResponse, error) { + if request == nil { + return nil, errors.New("Request object is nil. ") + } + resp, err := c.Send(request, c.ServiceName) + if err != nil { + return nil, err + } + + jdResp := &vpc.DeleteRouteTableResponse{} + err = json.Unmarshal(resp, jdResp) + if err != nil { + c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) + return nil, err + } + + return jdResp, err +} + +/* 查询VpcPeering资源详情 */ +func (c *VpcClient) DescribeVpcPeering(request *vpc.DescribeVpcPeeringRequest) (*vpc.DescribeVpcPeeringResponse, error) { + if request == nil { + return nil, errors.New("Request object is nil. ") + } + resp, err := c.Send(request, c.ServiceName) + if err != nil { + return nil, err + } + + jdResp := &vpc.DescribeVpcPeeringResponse{} + err = json.Unmarshal(resp, jdResp) + if err != nil { + c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) + return nil, err + } + + return jdResp, err +} + +/* 移除路由表规则 */ +func (c *VpcClient) RemoveRouteTableRules(request *vpc.RemoveRouteTableRulesRequest) (*vpc.RemoveRouteTableRulesResponse, error) { + if request == nil { + return nil, errors.New("Request object is nil. ") + } + resp, err := c.Send(request, c.ServiceName) + if err != nil { + return nil, err + } + + jdResp := &vpc.RemoveRouteTableRulesResponse{} + err = json.Unmarshal(resp, jdResp) + if err != nil { + c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) + return nil, err + } + + return jdResp, err +} + +/* 创建VpcPeering接口 */ +func (c *VpcClient) CreateVpcPeering(request *vpc.CreateVpcPeeringRequest) (*vpc.CreateVpcPeeringResponse, error) { + if request == nil { + return nil, errors.New("Request object is nil. ") + } + resp, err := c.Send(request, c.ServiceName) + if err != nil { + return nil, err + } + + jdResp := &vpc.CreateVpcPeeringResponse{} + err = json.Unmarshal(resp, jdResp) + if err != nil { + c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) + return nil, err + } + + return jdResp, err +} + +/* 给网卡分配secondaryIp接口 */ +func (c *VpcClient) AssignSecondaryIps(request *vpc.AssignSecondaryIpsRequest) (*vpc.AssignSecondaryIpsResponse, error) { + if request == nil { + return nil, errors.New("Request object is nil. ") + } + resp, err := c.Send(request, c.ServiceName) + if err != nil { + return nil, err + } + + jdResp := &vpc.AssignSecondaryIpsResponse{} + err = json.Unmarshal(resp, jdResp) + if err != nil { + c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) + return nil, err + } + + return jdResp, err +} + +/* 查询路由表列表 */ +func (c *VpcClient) DescribeRouteTables(request *vpc.DescribeRouteTablesRequest) (*vpc.DescribeRouteTablesResponse, error) { + if request == nil { + return nil, errors.New("Request object is nil. ") + } + resp, err := c.Send(request, c.ServiceName) + if err != nil { + return nil, err + } + + jdResp := &vpc.DescribeRouteTablesResponse{} + err = json.Unmarshal(resp, jdResp) + if err != nil { + c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) + return nil, err + } + + return jdResp, err +} + +/* 修改弹性网卡接口 */ +func (c *VpcClient) ModifyNetworkInterface(request *vpc.ModifyNetworkInterfaceRequest) (*vpc.ModifyNetworkInterfaceResponse, error) { + if request == nil { + return nil, errors.New("Request object is nil. ") + } + resp, err := c.Send(request, c.ServiceName) + if err != nil { + return nil, err + } + + jdResp := &vpc.ModifyNetworkInterfaceResponse{} + err = json.Unmarshal(resp, jdResp) + if err != nil { + c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) + return nil, err + } + + return jdResp, err +} + +/* 查询弹性ip列表 */ +func (c *VpcClient) DescribeElasticIps(request *vpc.DescribeElasticIpsRequest) (*vpc.DescribeElasticIpsResponse, error) { + if request == nil { + return nil, errors.New("Request object is nil. ") + } + resp, err := c.Send(request, c.ServiceName) + if err != nil { + return nil, err + } + + jdResp := &vpc.DescribeElasticIpsResponse{} + err = json.Unmarshal(resp, jdResp) + if err != nil { + c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) + return nil, err + } + + return jdResp, err +} + +/* 修改安全组规则 */ +func (c *VpcClient) ModifyNetworkSecurityGroupRules(request *vpc.ModifyNetworkSecurityGroupRulesRequest) (*vpc.ModifyNetworkSecurityGroupRulesResponse, error) { + if request == nil { + return nil, errors.New("Request object is nil. ") + } + resp, err := c.Send(request, c.ServiceName) + if err != nil { + return nil, err + } + + jdResp := &vpc.ModifyNetworkSecurityGroupRulesResponse{} + err = json.Unmarshal(resp, jdResp) + if err != nil { + c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) + return nil, err + } + + return jdResp, err +} + +/* 修改networkAcl接口 */ +func (c *VpcClient) ModifyNetworkAcl(request *vpc.ModifyNetworkAclRequest) (*vpc.ModifyNetworkAclResponse, error) { + if request == nil { + return nil, errors.New("Request object is nil. ") + } + resp, err := c.Send(request, c.ServiceName) + if err != nil { + return nil, err + } + + jdResp := &vpc.ModifyNetworkAclResponse{} + err = json.Unmarshal(resp, jdResp) + if err != nil { + c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) + return nil, err + } + + return jdResp, err +} + +/* 查询弹性网卡信息详情 */ +func (c *VpcClient) DescribeNetworkInterface(request *vpc.DescribeNetworkInterfaceRequest) (*vpc.DescribeNetworkInterfaceResponse, error) { + if request == nil { + return nil, errors.New("Request object is nil. ") + } + resp, err := c.Send(request, c.ServiceName) + if err != nil { + return nil, err + } + + jdResp := &vpc.DescribeNetworkInterfaceResponse{} + err = json.Unmarshal(resp, jdResp) + if err != nil { + c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) + return nil, err + } + + return jdResp, err +} + +/* 给网卡解绑弹性Ip接口 */ +func (c *VpcClient) DisassociateElasticIp(request *vpc.DisassociateElasticIpRequest) (*vpc.DisassociateElasticIpResponse, error) { + if request == nil { + return nil, errors.New("Request object is nil. ") + } + resp, err := c.Send(request, c.ServiceName) + if err != nil { + return nil, err + } + + jdResp := &vpc.DisassociateElasticIpResponse{} + err = json.Unmarshal(resp, jdResp) + if err != nil { + c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) + return nil, err + } + + return jdResp, err +} + +/* 删除VpcPeering接口 */ +func (c *VpcClient) DeleteVpcPeering(request *vpc.DeleteVpcPeeringRequest) (*vpc.DeleteVpcPeeringResponse, error) { + if request == nil { + return nil, errors.New("Request object is nil. ") + } + resp, err := c.Send(request, c.ServiceName) + if err != nil { + return nil, err + } + + jdResp := &vpc.DeleteVpcPeeringResponse{} + err = json.Unmarshal(resp, jdResp) + if err != nil { + c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) + return nil, err + } + + return jdResp, err +} + +/* 创建网卡接口,只能创建辅助网卡 */ +func (c *VpcClient) CreateNetworkInterface(request *vpc.CreateNetworkInterfaceRequest) (*vpc.CreateNetworkInterfaceResponse, error) { + if request == nil { + return nil, errors.New("Request object is nil. ") + } + resp, err := c.Send(request, c.ServiceName) + if err != nil { + return nil, err + } + + jdResp := &vpc.CreateNetworkInterfaceResponse{} + err = json.Unmarshal(resp, jdResp) + if err != nil { + c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) + return nil, err + } + + return jdResp, err +} + +/* 创建私有网络 */ +func (c *VpcClient) CreateVpc(request *vpc.CreateVpcRequest) (*vpc.CreateVpcResponse, error) { + if request == nil { + return nil, errors.New("Request object is nil. ") + } + resp, err := c.Send(request, c.ServiceName) + if err != nil { + return nil, err + } + + jdResp := &vpc.CreateVpcResponse{} + err = json.Unmarshal(resp, jdResp) + if err != nil { + c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) + return nil, err + } + + return jdResp, err +} + +/* 修改路由表规则 */ +func (c *VpcClient) ModifyRouteTableRules(request *vpc.ModifyRouteTableRulesRequest) (*vpc.ModifyRouteTableRulesResponse, error) { + if request == nil { + return nil, errors.New("Request object is nil. ") + } + resp, err := c.Send(request, c.ServiceName) + if err != nil { + return nil, err + } + + jdResp := &vpc.ModifyRouteTableRulesResponse{} + err = json.Unmarshal(resp, jdResp) + if err != nil { + c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) + return nil, err + } + + return jdResp, err +} + +/* 添加路由表规则 */ +func (c *VpcClient) AddRouteTableRules(request *vpc.AddRouteTableRulesRequest) (*vpc.AddRouteTableRulesResponse, error) { + if request == nil { + return nil, errors.New("Request object is nil. ") + } + resp, err := c.Send(request, c.ServiceName) + if err != nil { + return nil, err + } + + jdResp := &vpc.AddRouteTableRulesResponse{} + err = json.Unmarshal(resp, jdResp) + if err != nil { + c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) + return nil, err + } + + return jdResp, err +} + +/* ElasticIp资源信息详情 */ +func (c *VpcClient) DescribeElasticIp(request *vpc.DescribeElasticIpRequest) (*vpc.DescribeElasticIpResponse, error) { + if request == nil { + return nil, errors.New("Request object is nil. ") + } + resp, err := c.Send(request, c.ServiceName) + if err != nil { + return nil, err + } + + jdResp := &vpc.DescribeElasticIpResponse{} + err = json.Unmarshal(resp, jdResp) + if err != nil { + c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) + return nil, err + } + + return jdResp, err +} + +/* 给网卡删除secondaryIp接口 */ +func (c *VpcClient) UnassignSecondaryIps(request *vpc.UnassignSecondaryIpsRequest) (*vpc.UnassignSecondaryIpsResponse, error) { + if request == nil { + return nil, errors.New("Request object is nil. ") + } + resp, err := c.Send(request, c.ServiceName) + if err != nil { + return nil, err + } + + jdResp := &vpc.UnassignSecondaryIpsResponse{} + err = json.Unmarshal(resp, jdResp) + if err != nil { + c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) + return nil, err + } + + return jdResp, err +} + +/* 修改路由表属性 */ +func (c *VpcClient) ModifyRouteTable(request *vpc.ModifyRouteTableRequest) (*vpc.ModifyRouteTableResponse, error) { + if request == nil { + return nil, errors.New("Request object is nil. ") + } + resp, err := c.Send(request, c.ServiceName) + if err != nil { + return nil, err + } + + jdResp := &vpc.ModifyRouteTableResponse{} + err = json.Unmarshal(resp, jdResp) + if err != nil { + c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) + return nil, err + } + + return jdResp, err +} + +/* 给网卡绑定弹性Ip接口 */ +func (c *VpcClient) AssociateElasticIp(request *vpc.AssociateElasticIpRequest) (*vpc.AssociateElasticIpResponse, error) { + if request == nil { + return nil, errors.New("Request object is nil. ") + } + resp, err := c.Send(request, c.ServiceName) + if err != nil { + return nil, err + } + + jdResp := &vpc.AssociateElasticIpResponse{} + err = json.Unmarshal(resp, jdResp) + if err != nil { + c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) + return nil, err + } + + return jdResp, err +} + +/* 给路由表解绑子网接口 */ +func (c *VpcClient) DisassociateRouteTable(request *vpc.DisassociateRouteTableRequest) (*vpc.DisassociateRouteTableResponse, error) { + if request == nil { + return nil, errors.New("Request object is nil. ") + } + resp, err := c.Send(request, c.ServiceName) + if err != nil { + return nil, err + } + + jdResp := &vpc.DisassociateRouteTableResponse{} + err = json.Unmarshal(resp, jdResp) + if err != nil { + c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) + return nil, err + } + + return jdResp, err +} + +/* 修改私有网络接口 */ +func (c *VpcClient) ModifyVpc(request *vpc.ModifyVpcRequest) (*vpc.ModifyVpcResponse, error) { + if request == nil { + return nil, errors.New("Request object is nil. ") + } + resp, err := c.Send(request, c.ServiceName) + if err != nil { + return nil, err + } + + jdResp := &vpc.ModifyVpcResponse{} + err = json.Unmarshal(resp, jdResp) + if err != nil { + c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) + return nil, err + } + + return jdResp, err +} + +/* 给子网绑定networkAcl接口 */ +func (c *VpcClient) AssociateNetworkAcl(request *vpc.AssociateNetworkAclRequest) (*vpc.AssociateNetworkAclResponse, error) { + if request == nil { + return nil, errors.New("Request object is nil. ") + } + resp, err := c.Send(request, c.ServiceName) + if err != nil { + return nil, err + } + + jdResp := &vpc.AssociateNetworkAclResponse{} + err = json.Unmarshal(resp, jdResp) + if err != nil { + c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) + return nil, err + } + + return jdResp, err +} + +/* 修改子网接口 */ +func (c *VpcClient) ModifySubnet(request *vpc.ModifySubnetRequest) (*vpc.ModifySubnetResponse, error) { + if request == nil { + return nil, errors.New("Request object is nil. ") + } + resp, err := c.Send(request, c.ServiceName) + if err != nil { + return nil, err + } + + jdResp := &vpc.ModifySubnetResponse{} + err = json.Unmarshal(resp, jdResp) + if err != nil { + c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) + return nil, err + } + + return jdResp, err +} + +/* 创建一个或者多个弹性Ip */ +func (c *VpcClient) CreateElasticIps(request *vpc.CreateElasticIpsRequest) (*vpc.CreateElasticIpsResponse, error) { + if request == nil { + return nil, errors.New("Request object is nil. ") + } + resp, err := c.Send(request, c.ServiceName) + if err != nil { + return nil, err + } + + jdResp := &vpc.CreateElasticIpsResponse{} + err = json.Unmarshal(resp, jdResp) + if err != nil { + c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) + return nil, err + } + + return jdResp, err +} + +/* 删除弹性网卡接口 */ +func (c *VpcClient) DeleteNetworkInterface(request *vpc.DeleteNetworkInterfaceRequest) (*vpc.DeleteNetworkInterfaceResponse, error) { + if request == nil { + return nil, errors.New("Request object is nil. ") + } + resp, err := c.Send(request, c.ServiceName) + if err != nil { + return nil, err + } + + jdResp := &vpc.DeleteNetworkInterfaceResponse{} + err = json.Unmarshal(resp, jdResp) + if err != nil { + c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) + return nil, err + } + + return jdResp, err +} + +/* 查询networkAcl资源详情 */ +func (c *VpcClient) DescribeNetworkAcl(request *vpc.DescribeNetworkAclRequest) (*vpc.DescribeNetworkAclResponse, error) { + if request == nil { + return nil, errors.New("Request object is nil. ") + } + resp, err := c.Send(request, c.ServiceName) + if err != nil { + return nil, err + } + + jdResp := &vpc.DescribeNetworkAclResponse{} + err = json.Unmarshal(resp, jdResp) + if err != nil { + c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) + return nil, err + } + + return jdResp, err +} + +/* 添加networkAcl规则接口 */ +func (c *VpcClient) AddNetworkAclRules(request *vpc.AddNetworkAclRulesRequest) (*vpc.AddNetworkAclRulesResponse, error) { + if request == nil { + return nil, errors.New("Request object is nil. ") + } + resp, err := c.Send(request, c.ServiceName) + if err != nil { + return nil, err + } + + jdResp := &vpc.AddNetworkAclRulesResponse{} + err = json.Unmarshal(resp, jdResp) + if err != nil { + c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) + return nil, err + } + + return jdResp, err +} + diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/AddNetworkAclRuleSpec.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/AddNetworkAclRuleSpec.go new file mode 100644 index 000000000..8a4a6f079 --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/AddNetworkAclRuleSpec.go @@ -0,0 +1,45 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package models + + +type AddNetworkAclRuleSpec struct { + + /* 规则限定协议。取值范围:All,TCP,UDP,ICMP */ + Protocol string `json:"protocol"` + + /* 规则限定起始传输层端口, 取值范围:1-65535, 若protocol为传输层协议,默认值为1,若protocol不是传输层协议,设置无效,恒为0。如果规则只限定一个端口号,fromPort和toPort填写同一个值 (Optional) */ + FromPort *int `json:"fromPort"` + + /* 规则限定终止传输层端口, 取值范围:1-65535, 若protocol为传输层协议,默认值为65535,若protocol不是传输层协议,设置无效,恒为0。如果规则只限定一个端口号,fromPort和toPort填写同一个值 (Optional) */ + ToPort *int `json:"toPort"` + + /* networkAcl规则方向。ingress:入规则; egress:出规则 */ + Direction string `json:"direction"` + + /* 匹配地址前缀 */ + AddressPrefix string `json:"addressPrefix"` + + /* 访问控制策略:allow:允许,deny:拒绝 */ + RuleAction string `json:"ruleAction"` + + /* 规则匹配优先级,取值范围为[1,32768],优先级数字越小优先级越高 */ + Priority int `json:"priority"` + + /* 描述,允许输入UTF-8编码下的全部字符,不超过256字符 (Optional) */ + Description *string `json:"description"` +} diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/AddNetworkAclRulesSpec.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/AddNetworkAclRulesSpec.go new file mode 100644 index 000000000..1ab41cf86 --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/AddNetworkAclRulesSpec.go @@ -0,0 +1,24 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package models + + +type AddNetworkAclRulesSpec struct { + + /* networkAcl规则列表 */ + NetworkAclRuleSpecs []AddNetworkAclRuleSpec `json:"networkAclRuleSpecs"` +} diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/AddNetworkSecurityGroupRulesSpec.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/AddNetworkSecurityGroupRulesSpec.go new file mode 100644 index 000000000..1c4473104 --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/AddNetworkSecurityGroupRulesSpec.go @@ -0,0 +1,24 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package models + + +type AddNetworkSecurityGroupRulesSpec struct { + + /* 安全组规则信息 */ + NetworkSecurityGroupRuleSpecs []AddSecurityGroupRules `json:"networkSecurityGroupRuleSpecs"` +} diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/AddRouteTableRules.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/AddRouteTableRules.go new file mode 100644 index 000000000..d6c3fac30 --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/AddRouteTableRules.go @@ -0,0 +1,33 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package models + + +type AddRouteTableRules struct { + + /* 下一跳类型, 取值范围:instance:云主机, internet:公网, vpc_peering:vpc对等连接, bgw:边界网关 */ + NextHopType string `json:"nextHopType"` + + /* 下一跳id */ + NextHopId string `json:"nextHopId"` + + /* 匹配地址前缀, internet类型路由跟其他类型的路由,addressPrefix不允许重复 */ + AddressPrefix string `json:"addressPrefix"` + + /* 规则匹配优先级,取值范围[1,255],默认为100。当路由规则子网掩码不同时,路由最长匹配优先;当路由规则子网掩码相同时, 按照优先级匹配转发, 优先级数字越小优先级越高,路由规则子网掩码相同、优先级相同、下一跳不同时,形成等价路由,不同下一跳负载均担。 (Optional) */ + Priority *int `json:"priority"` +} diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/AddRouteTableRulesSpec.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/AddRouteTableRulesSpec.go new file mode 100644 index 000000000..599703cd7 --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/AddRouteTableRulesSpec.go @@ -0,0 +1,24 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package models + + +type AddRouteTableRulesSpec struct { + + /* 安全组规则信息 */ + RouteTableRuleSpecs []AddRouteTableRules `json:"routeTableRuleSpecs"` +} diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/AddSecurityGroupRules.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/AddSecurityGroupRules.go new file mode 100644 index 000000000..f9b279022 --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/AddSecurityGroupRules.go @@ -0,0 +1,39 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package models + + +type AddSecurityGroupRules struct { + + /* 规则限定协议。300:All; 6:TCP; 17:UDP; 1:ICMP */ + Protocol int `json:"protocol"` + + /* 安全组规则方向。0:入规则; 1:出规则 */ + Direction int `json:"direction"` + + /* 匹配地址前缀 */ + AddressPrefix string `json:"addressPrefix"` + + /* 规则限定起始传输层端口, 取值范围:1-65535, 若protocol为传输层协议,默认值为1,若protocol不是传输层协议,恒为0。如果规则只限定一个端口号,fromPort和toPort填写同一个值 (Optional) */ + FromPort *int `json:"fromPort"` + + /* 规则限定终止传输层端口, 取值范围:1-65535, 若protocol为传输层协议,默认值为65535,若protocol不是传输层协议,恒为0。如果规则只限定一个端口号,fromPort和toPort填写同一个值 (Optional) */ + ToPort *int `json:"toPort"` + + /* 描述,​ 允许输入UTF-8编码下的全部字符,不超过256字符 (Optional) */ + Description *string `json:"description"` +} diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/AssignSecondaryIpsSpec.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/AssignSecondaryIpsSpec.go new file mode 100644 index 000000000..fb151872b --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/AssignSecondaryIpsSpec.go @@ -0,0 +1,30 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package models + + +type AssignSecondaryIpsSpec struct { + + /* secondary ip被其他接口占用时,是否抢占。false:非抢占重分配,true:抢占重分配,默认抢占重分配。默认值:true (Optional) */ + Force bool `json:"force"` + + /* 指定分配的secondaryIp地址 (Optional) */ + SecondaryIps []string `json:"secondaryIps"` + + /* 指定自动分配的secondaryIp个数 (Optional) */ + SecondaryIpCount int `json:"secondaryIpCount"` +} diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/AssociateElasticIpSpec.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/AssociateElasticIpSpec.go new file mode 100644 index 000000000..fea484c08 --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/AssociateElasticIpSpec.go @@ -0,0 +1,30 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package models + + +type AssociateElasticIpSpec struct { + + /* 绑定的弹性Ip Id (Optional) */ + ElasticIpId string `json:"elasticIpId"` + + /* 绑定弹性Ip到指定的privateIp (Optional) */ + PrivateIpAddress string `json:"privateIpAddress"` + + /* 绑定的弹性Ip地址 (Optional) */ + ElasticIpAddress string `json:"elasticIpAddress"` +} diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/AssociateRouteTableSpec.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/AssociateRouteTableSpec.go new file mode 100644 index 000000000..77cbe3c90 --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/AssociateRouteTableSpec.go @@ -0,0 +1,24 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package models + + +type AssociateRouteTableSpec struct { + + /* 路由表要绑定的子网ID列表, subnet已被其他路由表绑定时,自动解绑。 */ + SubnetIds []string `json:"subnetIds"` +} diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/CreateElasticIpSpec.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/CreateElasticIpSpec.go new file mode 100644 index 000000000..681f0f2e7 --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/CreateElasticIpSpec.go @@ -0,0 +1,30 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package models + + +type CreateElasticIpSpec struct { + + /* 购买弹性ip数量;取值范围:[1,100] */ + MaxCount int `json:"maxCount"` + + /* 指定弹性ip地址进行创建,当申请创建多个弹性ip时,必须为空 (Optional) */ + ElasticIpAddress string `json:"elasticIpAddress"` + + /* 弹性ip规格 */ + ElasticIpSpec ElasticIpSpec `json:"elasticIpSpec"` +} diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/CreateVpcPeeringSpec.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/CreateVpcPeeringSpec.go new file mode 100644 index 000000000..5733faa74 --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/CreateVpcPeeringSpec.go @@ -0,0 +1,33 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package models + + +type CreateVpcPeeringSpec struct { + + /* VpcPeering的名字,不为空。名称取值范围:1-32个中文、英文大小写的字母、数字和下划线分隔符 */ + VpcPeeringName string `json:"vpcPeeringName"` + + /* VpcPeering本端Vpc的Id */ + VpcId string `json:"vpcId"` + + /* VpcPeering对端Vpc的Id */ + RemoteVpcId string `json:"remoteVpcId"` + + /* VpcPeering 描述,取值范围:0-256个中文、英文大小写的字母、数字和下划线分隔符 (Optional) */ + Description string `json:"description"` +} diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/DisassociateElasticIpSpec.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/DisassociateElasticIpSpec.go new file mode 100644 index 000000000..c9512a325 --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/DisassociateElasticIpSpec.go @@ -0,0 +1,27 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package models + + +type DisassociateElasticIpSpec struct { + + /* 指定解绑的弹性Ip Id (Optional) */ + ElasticIpId string `json:"elasticIpId"` + + /* 指定解绑的弹性Ip地址 (Optional) */ + ElasticIpAddress string `json:"elasticIpAddress"` +} diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/DisassociateRouteTableSpec.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/DisassociateRouteTableSpec.go new file mode 100644 index 000000000..86aad64ef --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/DisassociateRouteTableSpec.go @@ -0,0 +1,24 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package models + + +type DisassociateRouteTableSpec struct { + + /* 路由表要解绑的子网ID,解绑后子网绑定默认路由表 */ + SubnetId string `json:"subnetId"` +} diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/ElasticIp.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/ElasticIp.go new file mode 100644 index 000000000..11822a39d --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/ElasticIp.go @@ -0,0 +1,55 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package models + +import charge "github.com/jdcloud-api/jdcloud-sdk-go/services/charge/models" + +type ElasticIp struct { + + /* 弹性IP的Id (Optional) */ + ElasticIpId string `json:"elasticIpId"` + + /* 弹性IP地址 (Optional) */ + ElasticIpAddress string `json:"elasticIpAddress"` + + /* 弹性ip的限速(单位:Mbps) (Optional) */ + BandwidthMbps int `json:"bandwidthMbps"` + + /* IP服务商,取值为bgp或no_bgp (Optional) */ + Provider string `json:"provider"` + + /* 私有IP的IPV4地址 (Optional) */ + PrivateIpAddress string `json:"privateIpAddress"` + + /* 配置弹性网卡Id (Optional) */ + NetworkInterfaceId string `json:"networkInterfaceId"` + + /* 实例Id (Optional) */ + InstanceId string `json:"instanceId"` + + /* 实例类型 (Optional) */ + InstanceType string `json:"instanceType"` + + /* 计费配置 (Optional) */ + Charge charge.Charge `json:"charge"` + + /* 弹性ip创建时间 (Optional) */ + CreatedTime string `json:"createdTime"` + + /* 弹性ip可用区属性,如果为空,表示全可用区 (Optional) */ + Az string `json:"az"` +} diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/ElasticIpSpec.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/ElasticIpSpec.go new file mode 100644 index 000000000..bc641a734 --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/ElasticIpSpec.go @@ -0,0 +1,31 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package models + +import charge "github.com/jdcloud-api/jdcloud-sdk-go/services/charge/models" + +type ElasticIpSpec struct { + + /* 弹性公网IP的限速(单位:Mbps),取值范围为[1-200] */ + BandwidthMbps int `json:"bandwidthMbps"` + + /* IP服务商,取值为bgp或no_bgp,cn-north-1:bgp;cn-south-1:[bgp,no_bgp];cn-east-1:[bgp,no_bgp];cn-east-2:bgp */ + Provider string `json:"provider"` + + /* 计费配置 (Optional) */ + ChargeSpec *charge.ChargeSpec `json:"chargeSpec"` +} diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/ModifyElasticIpSpec.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/ModifyElasticIpSpec.go new file mode 100644 index 000000000..d4c8823f7 --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/ModifyElasticIpSpec.go @@ -0,0 +1,24 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package models + + +type ModifyElasticIpSpec struct { + + /* 弹性公网IP的限速(单位:Mbps),取值范围为[1-200] */ + BandwidthMbps int `json:"bandwidthMbps"` +} diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/ModifyNetworkAclRuleSpec.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/ModifyNetworkAclRuleSpec.go new file mode 100644 index 000000000..7e8a9aa32 --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/ModifyNetworkAclRuleSpec.go @@ -0,0 +1,45 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package models + + +type ModifyNetworkAclRuleSpec struct { + + /* networkAcl规则ID */ + RuleId string `json:"ruleId"` + + /* 规则限定协议。取值范围:All,TCP,UDP,ICMP (Optional) */ + Protocol *string `json:"protocol"` + + /* 规则限定起始传输层端口, 取值范围:1-65535, 若protocol为传输层协议,默认值为1,若protocol不是传输层协议,设置无效,恒为0。如果规则只限定一个端口号,fromPort和toPort填写同一个值 (Optional) */ + FromPort *int `json:"fromPort"` + + /* 规则限定终止传输层端口, 取值范围:1-65535, 若protocol为传输层协议,默认值为65535,若protocol不是传输层协议,设置无效,恒为0。如果规则只限定一个端口号,fromPort和toPort填写同一个值 (Optional) */ + ToPort *int `json:"toPort"` + + /* 匹配地址前缀 (Optional) */ + AddressPrefix *string `json:"addressPrefix"` + + /* 访问控制策略:allow:允许,deny:拒绝 (Optional) */ + RuleAction *string `json:"ruleAction"` + + /* 规则匹配优先级,取值范围为[1,32768],优先级数字越小优先级越高 (Optional) */ + Priority *int `json:"priority"` + + /* 描述,允许输入UTF-8编码下的全部字符,不超过256字符 (Optional) */ + Description *string `json:"description"` +} diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/ModifyNetworkAclRuleSpecs.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/ModifyNetworkAclRuleSpecs.go new file mode 100644 index 000000000..9864bdb22 --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/ModifyNetworkAclRuleSpecs.go @@ -0,0 +1,24 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package models + + +type ModifyNetworkAclRuleSpecs struct { + + /* networkAcl规则列表 */ + ModifyNetworkAclRuleSpecs []ModifyNetworkAclRuleSpec `json:"modifyNetworkAclRuleSpecs"` +} diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/ModifyNetworkAclRulesSpec.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/ModifyNetworkAclRulesSpec.go new file mode 100644 index 000000000..13df02392 --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/ModifyNetworkAclRulesSpec.go @@ -0,0 +1,24 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package models + + +type ModifyNetworkAclRulesSpec struct { + + /* networkAcl规则列表 */ + ModifyNetworkAclRuleSpecs []ModifyNetworkAclRuleSpec `json:"modifyNetworkAclRuleSpecs"` +} diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/ModifyNetworkAclSpec.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/ModifyNetworkAclSpec.go new file mode 100644 index 000000000..4c2170648 --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/ModifyNetworkAclSpec.go @@ -0,0 +1,27 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package models + + +type ModifyNetworkAclSpec struct { + + /* networkAcl名称,只允许输入中文、数字、大小写字母、英文下划线“_”及中划线“-”,不允许为空且不超过32字符 (Optional) */ + NetworkAclName string `json:"networkAclName"` + + /* 描述,允许输入UTF-8编码下的全部字符,不超过256字符 (Optional) */ + Description string `json:"description"` +} diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/ModifyNetworkInterfaceSpec.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/ModifyNetworkInterfaceSpec.go new file mode 100644 index 000000000..292bfe914 --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/ModifyNetworkInterfaceSpec.go @@ -0,0 +1,30 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package models + + +type ModifyNetworkInterfaceSpec struct { + + /* 弹性网卡名称,只允许输入中文、数字、大小写字母、英文下划线“_”及中划线“-”,不允许为空且不超过32字符 (Optional) */ + NetworkInterfaceName string `json:"networkInterfaceName"` + + /* 描述,允许输入UTF-8编码下的全部字符,不超过256字符 (Optional) */ + Description string `json:"description"` + + /* 以覆盖原有安全组的方式更新的安全组。如果更新安全组ID列表,最多5个安全组 (Optional) */ + SecurityGroups []string `json:"securityGroups"` +} diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/ModifyNetworkSecurityGroupSpec.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/ModifyNetworkSecurityGroupSpec.go new file mode 100644 index 000000000..335009736 --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/ModifyNetworkSecurityGroupSpec.go @@ -0,0 +1,27 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package models + + +type ModifyNetworkSecurityGroupSpec struct { + + /* 安全组的名字。名称取值范围:1-32个中文、英文大小写的字母、数字和下划线分隔符 (Optional) */ + NetworkSecurityGroupName string `json:"networkSecurityGroupName"` + + /* 安全组的描述,取值范围:0-256个UTF-8编码下的全部字符 (Optional) */ + Description string `json:"description"` +} diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/ModifyQuotaSpec.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/ModifyQuotaSpec.go new file mode 100644 index 000000000..ec25778c1 --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/ModifyQuotaSpec.go @@ -0,0 +1,30 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package models + + +type ModifyQuotaSpec struct { + + /* 资源类型,取值范围:vpc、elastic_ip、subnet、security_group、vpcpeering、network_interface(配额只统计辅助网卡) */ + Type string `json:"type"` + + /* type为vpc、elastic_ip、network_interface不设置, type为subnet、security_group、vpcpeering设置为vpcId (Optional) */ + ParentResourceId string `json:"parentResourceId"` + + /* 配额大小 */ + MaxLimit int `json:"maxLimit"` +} diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/ModifyRouteTableRules.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/ModifyRouteTableRules.go new file mode 100644 index 000000000..8b79e5a38 --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/ModifyRouteTableRules.go @@ -0,0 +1,36 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package models + + +type ModifyRouteTableRules struct { + + /* 路由表规则的ID */ + RuleId string `json:"ruleId"` + + /* 规则匹配优先级,取值范围[1,255]。当路由规则子网掩码不同时,路由最长匹配优先;当路由规则子网掩码相同时, 按照优先级匹配转发, 优先级数字越小优先级越高,路由规则子网掩码相同、优先级相同、下一跳不同时,形成等价路由,不同下一跳负载均担。 (Optional) */ + Priority *int `json:"priority"` + + /* 下一跳类型, 取值范围:instance:云主机, internet:公网, vpc_peering:vpc对等连接, bgw:边界网关 (Optional) */ + NextHopType *string `json:"nextHopType"` + + /* 下一跳id (Optional) */ + NextHopId *string `json:"nextHopId"` + + /* 路由表规则前缀, internet类型路由跟其他类型的路由,addressPrefix不允许重复 (Optional) */ + AddressPrefix *string `json:"addressPrefix"` +} diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/ModifyRouteTableRulesSpec.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/ModifyRouteTableRulesSpec.go new file mode 100644 index 000000000..d8894b0dc --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/ModifyRouteTableRulesSpec.go @@ -0,0 +1,24 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package models + + +type ModifyRouteTableRulesSpec struct { + + /* 路由表规则信息 */ + ModifyRouteTableRuleSpecs []ModifyRouteTableRules `json:"modifyRouteTableRuleSpecs"` +} diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/ModifyRouteTableSpec.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/ModifyRouteTableSpec.go new file mode 100644 index 000000000..3a1c902dc --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/ModifyRouteTableSpec.go @@ -0,0 +1,27 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package models + + +type ModifyRouteTableSpec struct { + + /* 路由表的名字。名称取值范围:1-32个中文、英文大小写的字母、数字和下划线分隔符 (Optional) */ + RouteTableName string `json:"routeTableName"` + + /* 路由表的描述,取值范围:0-256个UTF-8编码下的全部字符 (Optional) */ + Description string `json:"description"` +} diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/ModifySecurityGroupRuleSpec.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/ModifySecurityGroupRuleSpec.go new file mode 100644 index 000000000..f59fc26b5 --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/ModifySecurityGroupRuleSpec.go @@ -0,0 +1,24 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package models + + +type ModifySecurityGroupRuleSpec struct { + + /* 安全组规则信息 */ + ModifySecurityGroupRuleSpecs []ModifySecurityGroupRules `json:"modifySecurityGroupRuleSpecs"` +} diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/ModifySecurityGroupRules.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/ModifySecurityGroupRules.go new file mode 100644 index 000000000..38d47fc7e --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/ModifySecurityGroupRules.go @@ -0,0 +1,39 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package models + + +type ModifySecurityGroupRules struct { + + /* 安全组规则的ID。 */ + RuleId string `json:"ruleId"` + + /* 规则限定协议。300:All; 6:TCP; 17:UDP; 1:ICMP (Optional) */ + Protocol *int `json:"protocol"` + + /* 安全组规则的起始端口。取值范围:1-65535 (Optional) */ + FromPort *int `json:"fromPort"` + + /* 安全组规则的终端口。取值范围:1-65535 (Optional) */ + ToPort *int `json:"toPort"` + + /* 安全组规则前缀,取值范围:正确的CIDR (Optional) */ + AddressPrefix *string `json:"addressPrefix"` + + /* 安全组规则的描述,取值范围:0-256个UTF-8编码下的全部字符 (Optional) */ + Description *string `json:"description"` +} diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/ModifySubnetSpec.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/ModifySubnetSpec.go new file mode 100644 index 000000000..aac57100f --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/ModifySubnetSpec.go @@ -0,0 +1,27 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package models + + +type ModifySubnetSpec struct { + + /* 子网名称,只允许输入中文、数字、大小写字母、英文下划线“_”及中划线“-”,不允许为空且不超过32字符。 (Optional) */ + SubnetName string `json:"subnetName"` + + /* 子网描述信息,允许输入UTF-8编码下的全部字符,不超过256字符。 (Optional) */ + Description string `json:"description"` +} diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/ModifyVpcPeeringSpec.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/ModifyVpcPeeringSpec.go new file mode 100644 index 000000000..056f0f1f5 --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/ModifyVpcPeeringSpec.go @@ -0,0 +1,27 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package models + + +type ModifyVpcPeeringSpec struct { + + /* VpcPeering的名字,不为空。名称取值范围:1-32个中文、英文大小写的字母、数字和下划线分隔符 (Optional) */ + VpcPeeringName string `json:"vpcPeeringName"` + + /* VpcPeering 描述,取值范围:0-256个中文、英文大小写的字母、数字和下划线分隔符 (Optional) */ + Description string `json:"description"` +} diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/ModifyVpcSpec.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/ModifyVpcSpec.go new file mode 100644 index 000000000..9c4419843 --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/ModifyVpcSpec.go @@ -0,0 +1,27 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package models + + +type ModifyVpcSpec struct { + + /* 私有网络名称,只允许输入中文、数字、大小写字母、英文下划线“_”及中划线“-”,不允许为空且不超过32字符。 (Optional) */ + VpcName string `json:"vpcName"` + + /* vpc描述,允许输入UTF-8编码下的全部字符,不超过256字符。 (Optional) */ + Description string `json:"description"` +} diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/NetworkAcl.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/NetworkAcl.go new file mode 100644 index 000000000..422ed1611 --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/NetworkAcl.go @@ -0,0 +1,42 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package models + + +type NetworkAcl struct { + + /* networkAcl ID (Optional) */ + NetworkAclId string `json:"networkAclId"` + + /* networkAcl名称 (Optional) */ + NetworkAclName string `json:"networkAclName"` + + /* 私有网络 ID (Optional) */ + VpcId string `json:"vpcId"` + + /* networkAcl规则列表 (Optional) */ + NetworkAclRules []NetworkAclRule `json:"networkAclRules"` + + /* networkAcl绑定的子网列表 (Optional) */ + SubnetIds []string `json:"subnetIds"` + + /* 描述,允许输入UTF-8编码下的全部字符,不超过256字符 (Optional) */ + Description string `json:"description"` + + /* networkAcl创建时间 (Optional) */ + CreatedTime string `json:"createdTime"` +} diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/NetworkAclRule.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/NetworkAclRule.go new file mode 100644 index 000000000..2cd5027b6 --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/NetworkAclRule.go @@ -0,0 +1,51 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package models + + +type NetworkAclRule struct { + + /* networkAcl规则ID (Optional) */ + RuleId string `json:"ruleId"` + + /* 规则限定协议。取值范围:All,TCP,UDP,ICMP (Optional) */ + Protocol string `json:"protocol"` + + /* 规则限定起始传输层端口, 取值范围:1-65535, 若protocol为传输层协议,默认值为1,若protocol不是传输层协议,设置无效,恒为0。如果规则只限定一个端口号,fromPort和toPort填写同一个值 (Optional) */ + FromPort int `json:"fromPort"` + + /* 规则限定终止传输层端口, 取值范围:1-65535, 若protocol为传输层协议,默认值为65535,若protocol不是传输层协议,设置无效,恒为0。如果规则只限定一个端口号,fromPort和toPort填写同一个值 (Optional) */ + ToPort int `json:"toPort"` + + /* networkAcl规则方向。ingress:入规则; egress:出规则 (Optional) */ + Direction string `json:"direction"` + + /* 匹配地址前缀 (Optional) */ + AddressPrefix string `json:"addressPrefix"` + + /* 访问控制策略:allow:允许,deny:拒绝 (Optional) */ + RuleAction string `json:"ruleAction"` + + /* 规则匹配优先级,取值范围为[1,32768],优先级数字越小优先级越高 (Optional) */ + Priority int `json:"priority"` + + /* 描述,允许输入UTF-8编码下的全部字符,不超过256字符 (Optional) */ + Description string `json:"description"` + + /* networkAclRule创建时间 (Optional) */ + CreatedTime string `json:"createdTime"` +} diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/NetworkAclSpec.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/NetworkAclSpec.go new file mode 100644 index 000000000..9710fddec --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/NetworkAclSpec.go @@ -0,0 +1,30 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package models + + +type NetworkAclSpec struct { + + /* 私有网络id */ + VpcId string `json:"vpcId"` + + /* networkAcl名称 */ + NetworkAclName string `json:"networkAclName"` + + /* 描述,允许输入UTF-8编码下的全部字符,不超过256字符 (Optional) */ + Description string `json:"description"` +} diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/NetworkInterface.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/NetworkInterface.go new file mode 100644 index 000000000..b9fc7244b --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/NetworkInterface.go @@ -0,0 +1,72 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package models + + +type NetworkInterface struct { + + /* 弹性网卡名称 (Optional) */ + NetworkInterfaceName string `json:"networkInterfaceName"` + + /* 弹性网卡ID (Optional) */ + NetworkInterfaceId string `json:"networkInterfaceId"` + + /* 可用区名称 (Optional) */ + Az string `json:"az"` + + /* 网卡角色,取值范围:Primary(主网卡)、Secondary(辅助网卡) (Optional) */ + Role string `json:"role"` + + /* 以太网地址 (Optional) */ + MacAddress string `json:"macAddress"` + + /* 虚拟网络ID (Optional) */ + VpcId string `json:"vpcId"` + + /* 子网ID (Optional) */ + SubnetId string `json:"subnetId"` + + /* 安全组ID列表 (Optional) */ + NetworkSecurityGroupIds []string `json:"networkSecurityGroupIds"` + + /* 源和目标IP地址校验,取值为0或者1 (Optional) */ + SanityCheck int `json:"sanityCheck"` + + /* 网卡主IP (Optional) */ + PrimaryIp NetworkInterfacePrivateIp `json:"primaryIp"` + + /* 网卡附属IP列表 (Optional) */ + SecondaryIps []NetworkInterfacePrivateIp `json:"secondaryIps"` + + /* 关联实例类型,取值范围:vm (Optional) */ + InstanceType string `json:"instanceType"` + + /* 关联实例ID (Optional) */ + InstanceId string `json:"instanceId"` + + /* 实例所属的账号 (Optional) */ + InstanceOwnerId string `json:"instanceOwnerId"` + + /* 网卡在实例上的设备索引号,取值范围:[0,8],0:辅助网卡未绑定设备,1:主网卡,2-8:辅助网卡已绑定设备 (Optional) */ + DeviceIndex int `json:"deviceIndex"` + + /* 网卡描述信息 (Optional) */ + Description string `json:"description"` + + /* 弹性网卡创建时间 (Optional) */ + CreatedTime string `json:"createdTime"` +} diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/NetworkInterfacePrivateIp.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/NetworkInterfacePrivateIp.go new file mode 100644 index 000000000..ba235e86a --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/NetworkInterfacePrivateIp.go @@ -0,0 +1,30 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package models + + +type NetworkInterfacePrivateIp struct { + + /* 私有IP的IPV4地址 (Optional) */ + PrivateIpAddress string `json:"privateIpAddress"` + + /* 弹性IP实例ID (Optional) */ + ElasticIpId string `json:"elasticIpId"` + + /* 弹性IP实例地址 (Optional) */ + ElasticIpAddress string `json:"elasticIpAddress"` +} diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/NetworkInterfaceSpec.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/NetworkInterfaceSpec.go new file mode 100644 index 000000000..75c2909e6 --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/NetworkInterfaceSpec.go @@ -0,0 +1,48 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package models + + +type NetworkInterfaceSpec struct { + + /* 子网ID */ + SubnetId string `json:"subnetId"` + + /* 可用区,用户的默认可用区 (Optional) */ + Az *string `json:"az"` + + /* 网卡名称,只允许输入中文、数字、大小写字母、英文下划线“_”及中划线“-”,不允许为空且不超过32字符。 (Optional) */ + NetworkInterfaceName *string `json:"networkInterfaceName"` + + /* 网卡主IP,如果不指定,会自动从子网中分配 (Optional) */ + PrimaryIpAddress *string `json:"primaryIpAddress"` + + /* SecondaryIp列表 (Optional) */ + SecondaryIpAddresses []string `json:"secondaryIpAddresses"` + + /* 自动分配的SecondaryIp数量 (Optional) */ + SecondaryIpCount *int `json:"secondaryIpCount"` + + /* 要绑定的安全组ID列表,最多指定5个安全组 (Optional) */ + SecurityGroups []string `json:"securityGroups"` + + /* 源和目标IP地址校验,取值为0或者1,默认为1 (Optional) */ + SanityCheck *int `json:"sanityCheck"` + + /* 描述,​ 允许输入UTF-8编码下的全部字符,不超过256字符 (Optional) */ + Description *string `json:"description"` +} diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/NetworkSecurityGroup.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/NetworkSecurityGroup.go new file mode 100644 index 000000000..406631dfe --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/NetworkSecurityGroup.go @@ -0,0 +1,39 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package models + + +type NetworkSecurityGroup struct { + + /* 安全组ID (Optional) */ + NetworkSecurityGroupId string `json:"networkSecurityGroupId"` + + /* 安全组名称 (Optional) */ + NetworkSecurityGroupName string `json:"networkSecurityGroupName"` + + /* 安全组描述信息 (Optional) */ + Description string `json:"description"` + + /* 安全组所在vpc的Id (Optional) */ + VpcId string `json:"vpcId"` + + /* 安全组规则信息 (Optional) */ + SecurityGroupRules []SecurityGroupRule `json:"securityGroupRules"` + + /* 安全组创建时间 (Optional) */ + CreatedTime string `json:"createdTime"` +} diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/NetworkSecurityGroupSpec.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/NetworkSecurityGroupSpec.go new file mode 100644 index 000000000..b38e540b4 --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/NetworkSecurityGroupSpec.go @@ -0,0 +1,30 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package models + + +type NetworkSecurityGroupSpec struct { + + /* 私有网络ID */ + VpcId string `json:"vpcId"` + + /* 安全组名称,只允许输入中文、数字、大小写字母、英文下划线“_”及中划线“-”,不允许为空且不超过32字符。 */ + NetworkSecurityGroupName string `json:"networkSecurityGroupName"` + + /* 描述,​ 允许输入UTF-8编码下的全部字符,不超过256字符 (Optional) */ + Description string `json:"description"` +} diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/Quota.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/Quota.go new file mode 100644 index 000000000..cb0f4081f --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/Quota.go @@ -0,0 +1,33 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package models + + +type Quota struct { + + /* 资源类型,取值范围:vpc、elastic_ip、subnet、security_group、vpcpeering、network_interface(配额只统计辅助网卡) (Optional) */ + Type string `json:"type"` + + /* vpc、elastic_ip、network_interface为空, subnet、security_group、vpcpeering为vpcId (Optional) */ + ParentResourceId string `json:"parentResourceId"` + + /* 配额大小 (Optional) */ + MaxLimit int `json:"maxLimit"` + + /* 已存在的资源数量 (Optional) */ + Count int `json:"count"` +} diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/RouteTable.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/RouteTable.go new file mode 100644 index 000000000..b7bf11e18 --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/RouteTable.go @@ -0,0 +1,45 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package models + + +type RouteTable struct { + + /* 路由表ID (Optional) */ + RouteTableId string `json:"routeTableId"` + + /* 路由表名称,只允许输入中文、数字、大小写字母、英文下划线“_”及中划线“-”,不允许为空且不超过32字符。 (Optional) */ + RouteTableName string `json:"routeTableName"` + + /* 路由表类型,default:默认路由表,custom:自定义路由表 (Optional) */ + RouteTableType string `json:"routeTableType"` + + /* 路由表描述信息,允许输入UTF-8编码下的全部字符,不超过256字符。 (Optional) */ + Description string `json:"description"` + + /* 私有网络ID (Optional) */ + VpcId string `json:"vpcId"` + + /* 路由表规则信息 (Optional) */ + RouteTableRules []RouteTableRule `json:"routeTableRules"` + + /* 路由表绑定的子网列表 (Optional) */ + SubnetIds []string `json:"subnetIds"` + + /* 路由表创建时间 (Optional) */ + CreatedTime string `json:"createdTime"` +} diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/RouteTableRule.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/RouteTableRule.go new file mode 100644 index 000000000..049d9b766 --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/RouteTableRule.go @@ -0,0 +1,36 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package models + + +type RouteTableRule struct { + + /* 路由表规则ID (Optional) */ + RuleId string `json:"ruleId"` + + /* 规则匹配优先级,取值范围[1,255],默认为100。当路由规则子网掩码不同时,路由最长匹配优先;当路由规则子网掩码相同时, 按照优先级匹配转发, 优先级数字越小优先级越高,路由规则子网掩码相同、优先级相同、下一跳不同时,形成等价路由,不同下一跳负载均担。 (Optional) */ + Priority int `json:"priority"` + + /* 下一跳类型, 取值范围:local:本地, instance:云主机, internet:公网, vpc_peering:vpc对等连接, bgw:边界网关 (Optional) */ + NextHopType string `json:"nextHopType"` + + /* 下一跳id (Optional) */ + NextHopId string `json:"nextHopId"` + + /* 匹配地址前缀, internet类型路由跟其他类型的路由,addressPrefix不允许重复 (Optional) */ + AddressPrefix string `json:"addressPrefix"` +} diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/RouteTableSpec.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/RouteTableSpec.go new file mode 100644 index 000000000..c91f16c6c --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/RouteTableSpec.go @@ -0,0 +1,30 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package models + + +type RouteTableSpec struct { + + /* 路由表所属的私有网络ID */ + VpcId string `json:"vpcId"` + + /* 路由表名称,只允许输入中文、数字、大小写字母、英文下划线“_”及中划线“-”,不允许为空且不超过32字符。 */ + RouteTableName string `json:"routeTableName"` + + /* 描述,​ 允许输入UTF-8编码下的全部字符,不超过256字符 (Optional) */ + Description string `json:"description"` +} diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/SecurityGroupRule.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/SecurityGroupRule.go new file mode 100644 index 000000000..74ba05afd --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/SecurityGroupRule.go @@ -0,0 +1,48 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package models + + +type SecurityGroupRule struct { + + /* 安全组规则ID (Optional) */ + RuleId string `json:"ruleId"` + + /* 安全组规则方向。0:入规则; 1:出规则 (Optional) */ + Direction int `json:"direction"` + + /* 规则限定协议。300:All; 6:TCP; 17:UDP; 1:ICMP (Optional) */ + Protocol int `json:"protocol"` + + /* 匹配地址前缀 (Optional) */ + AddressPrefix string `json:"addressPrefix"` + + /* 匹配地址协议版本。4:IPv4 (Optional) */ + IpVersion int `json:"ipVersion"` + + /* 规则限定起始传输层端口, 默认1 ,若protocal不是传输层协议,恒为0 (Optional) */ + FromPort int `json:"fromPort"` + + /* 规则限定终止传输层端口, 默认1 ,若protocal不是传输层协议,恒为0 (Optional) */ + ToPort int `json:"toPort"` + + /* 安全组规则创建时间 (Optional) */ + CreatedTime string `json:"createdTime"` + + /* 描述,​ 允许输入UTF-8编码下的全部字符,不超过256字符 (Optional) */ + Description string `json:"description"` +} diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/Segment.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/Segment.go new file mode 100644 index 000000000..875486ad1 --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/Segment.go @@ -0,0 +1,45 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package models + + +type Segment struct { + + /* 网段的Id (Optional) */ + SegmentId string `json:"segmentId"` + + /* 网段名称,只允许输入中文、数字、大小写字母、英文下划线“_”及中划线“-”,不允许为空且不超过32字符。 (Optional) */ + SegmentName string `json:"segmentName"` + + /* 网段描述,允许输入UTF-8编码下的全部字符,不超过256字符。 (Optional) */ + Description string `json:"description"` + + /* 网络地址段 (Optional) */ + AddressPrefix string `json:"addressPrefix"` + + /* 网段可用ip数量 (Optional) */ + AvailableIpCount int `json:"availableIpCount"` + + /* IP服务商,取值为bgp或no_bgp,cn-north-1:bgp;cn-south-1:[bgp,no_bgp];cn-east-1:[bgp,no_bgp];cn-east-2:bgp (Optional) */ + Provider string `json:"provider"` + + /* 网段的起始地址 (Optional) */ + StartIp string `json:"startIp"` + + /* 网段的结束地址 (Optional) */ + EndIp string `json:"endIp"` +} diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/Subnet.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/Subnet.go new file mode 100644 index 000000000..9bd241dae --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/Subnet.go @@ -0,0 +1,54 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package models + + +type Subnet struct { + + /* Subnet的Id (Optional) */ + SubnetId string `json:"subnetId"` + + /* 子网名称 (Optional) */ + SubnetName string `json:"subnetName"` + + /* 子网所属VPC的Id (Optional) */ + VpcId string `json:"vpcId"` + + /* 子网网段,vpc内子网网段不能重叠,cidr的取值范围:10.0.0.0/8、172.16.0.0/12和192.168.0.0/16及它们包含的子网,且子网掩码长度为16-28之间,如果VPC含有Cidr,则必须为VPC所在Cidr的子网 (Optional) */ + AddressPrefix string `json:"addressPrefix"` + + /* 子网可用ip数量 (Optional) */ + AvailableIpCount int `json:"availableIpCount"` + + /* 子网描述信息 (Optional) */ + Description string `json:"description"` + + /* 子网关联的路由表Id (Optional) */ + RouteTableId string `json:"routeTableId"` + + /* 子网关联的acl Id (Optional) */ + AclId string `json:"aclId"` + + /* 子网的起始地址,子网第1个地位为路由器网关保留,第2个地址为dhcp服务保留 (Optional) */ + StartIp string `json:"startIp"` + + /* 子网的结束地址,子网第1个地位为路由器网关保留,第2个地址为dhcp服务保留 (Optional) */ + EndIp string `json:"endIp"` + + /* 子网创建时间 (Optional) */ + CreatedTime string `json:"createdTime"` +} diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/SubnetSpec.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/SubnetSpec.go new file mode 100644 index 000000000..611a18910 --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/SubnetSpec.go @@ -0,0 +1,36 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package models + + +type SubnetSpec struct { + + /* 子网所属vpc的Id */ + VpcId string `json:"vpcId"` + + /* 子网名称,只允许输入中文、数字、大小写字母、英文下划线“_”及中划线“-”,不允许为空且不超过32字符。 */ + SubnetName string `json:"subnetName"` + + /* 子网网段,vpc内子网网段不能重叠,cidr的取值范围:10.0.0.0/8、172.16.0.0/12和192.168.0.0/16及它们包含的子网,且子网掩码长度为16-28之间,如果vpc含有cidr,则必须为vpc所在cidr的子网 */ + AddressPrefix string `json:"addressPrefix"` + + /* 子网关联的路由表Id, 默认为vpc的默认路由表 (Optional) */ + RouteTableId string `json:"routeTableId"` + + /* 子网描述信息,允许输入UTF-8编码下的全部字符,不超过256字符。 (Optional) */ + Description string `json:"description"` +} diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/UnassignSecondaryIpsSpec.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/UnassignSecondaryIpsSpec.go new file mode 100644 index 000000000..ba3a12e19 --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/UnassignSecondaryIpsSpec.go @@ -0,0 +1,24 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package models + + +type UnassignSecondaryIpsSpec struct { + + /* 指定删除的secondaryIp地址 (Optional) */ + SecondaryIps []string `json:"secondaryIps"` +} diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/Vpc.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/Vpc.go new file mode 100644 index 000000000..896b3341b --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/Vpc.go @@ -0,0 +1,45 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package models + + +type Vpc struct { + + /* Vpc的Id (Optional) */ + VpcId string `json:"vpcId"` + + /* 如果为空,则不限制网段,如果不为空,10.0.0.0/8、172.16.0.0/12和192.168.0.0/16及它们包含的子网,且子网掩码长度为16-28之间 (Optional) */ + AddressPrefix string `json:"addressPrefix"` + + /* VPC 描述,取值范围:1~120个字符 (Optional) */ + Description string `json:"description"` + + /* 私有网络名称,取值范围:1-60个中文、英文大小写的字母、数字和下划线分隔符 (Optional) */ + VpcName string `json:"vpcName"` + + /* 同一vpc下的acl id 列表 (Optional) */ + AclIds []string `json:"aclIds"` + + /* (Optional) */ + RouteTableIds []string `json:"routeTableIds"` + + /* 私有网络包含的子网列表 (Optional) */ + Subnets []Subnet `json:"subnets"` + + /* vpc创建时间 (Optional) */ + CreatedTime string `json:"createdTime"` +} diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/VpcPeering.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/VpcPeering.go new file mode 100644 index 000000000..e6245b759 --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/VpcPeering.go @@ -0,0 +1,42 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package models + + +type VpcPeering struct { + + /* VpcPeering的Id (Optional) */ + VpcPeeringId string `json:"vpcPeeringId"` + + /* VpcPeering名称,同账号下不允许重名,取值范围:1-32个中文、英文大小写的字母、数字和下划线分隔符 (Optional) */ + VpcPeeringName string `json:"vpcPeeringName"` + + /* 状态,取值为Connected,Disconnected,Initiated (Optional) */ + VpcPeeringState string `json:"vpcPeeringState"` + + /* VpcPeering 描述,可为空值,取值范围:0-256个中文、英文大小写的字母、数字和下划线分隔符 (Optional) */ + Description string `json:"description"` + + /* 发起VpcPeering的Vpc信息 (Optional) */ + VpcInfo VpcPeeringVpcInfo `json:"vpcInfo"` + + /* 对端的Vpc信息 (Optional) */ + RemoteVpcInfo VpcPeeringVpcInfo `json:"remoteVpcInfo"` + + /* VpcPeering创建时间 (Optional) */ + CreatedTime string `json:"createdTime"` +} diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/VpcPeeringVpcInfo.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/VpcPeeringVpcInfo.go new file mode 100644 index 000000000..4581b43e9 --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/VpcPeeringVpcInfo.go @@ -0,0 +1,30 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package models + + +type VpcPeeringVpcInfo struct { + + /* 子网所属VPC的Id (Optional) */ + VpcId string `json:"vpcId"` + + /* 私有网络名称,取值范围:1-60个中文、英文大小写的字母、数字和下划线分隔符 (Optional) */ + VpcName string `json:"vpcName"` + + /* 如果为空,则不限制网段,如果不为空,10.0.0.0/8、172.16.0.0/12和192.168.0.0/16及它们包含的子网,且子网掩码长度为16-28之间 (Optional) */ + AddressPrefix []string `json:"addressPrefix"` +} diff --git a/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/VpcSpec.go b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/VpcSpec.go new file mode 100644 index 000000000..f9f4f9e1b --- /dev/null +++ b/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/VpcSpec.go @@ -0,0 +1,30 @@ +// Copyright 2018 JDCLOUD.COM +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// NOTE: This class is auto generated by the jdcloud code generator program. + +package models + + +type VpcSpec struct { + + /* 私有网络名称,只允许输入中文、数字、大小写字母、英文下划线“_”及中划线“-”,不允许为空且不超过32字符。 */ + VpcName string `json:"vpcName"` + + /* 如果为空,则不限制网段,如果不为空,10.0.0.0/8、172.16.0.0/12和192.168.0.0/16及它们包含的子网,且子网掩码长度为16-28之间 (Optional) */ + AddressPrefix string `json:"addressPrefix"` + + /* vpc描述,允许输入UTF-8编码下的全部字符,不超过256字符。 (Optional) */ + Description string `json:"description"` +} diff --git a/vendor/modules.txt b/vendor/modules.txt index 1b68e6045..941f93b55 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -299,6 +299,17 @@ github.com/hetznercloud/hcloud-go/hcloud github.com/hetznercloud/hcloud-go/hcloud/schema # github.com/hyperonecom/h1-client-go v0.0.0-20190122232013-cf38e8387775 github.com/hyperonecom/h1-client-go +# github.com/jdcloud-api/jdcloud-sdk-go v1.9.1-0.20190605102154-3d81a50ca961 +github.com/jdcloud-api/jdcloud-sdk-go/core +github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis +github.com/jdcloud-api/jdcloud-sdk-go/services/vm/client +github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models +github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis +github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/client +github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models +github.com/jdcloud-api/jdcloud-sdk-go/services/common/models +github.com/jdcloud-api/jdcloud-sdk-go/services/charge/models +github.com/jdcloud-api/jdcloud-sdk-go/services/disk/models # github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af github.com/jmespath/go-jmespath # github.com/joyent/triton-go v0.0.0-20180116165742-545edbe0d564 diff --git a/website/source/docs/builders/jdcloud.html.md b/website/source/docs/builders/jdcloud.html.md new file mode 100644 index 000000000..313da268c --- /dev/null +++ b/website/source/docs/builders/jdcloud.html.md @@ -0,0 +1,80 @@ +--- +description: | + The `jdcloud` Packer builder helps you to build instance images + based on an existing image +layout: docs +page_title: 'JDCloud Image Builder' +sidebar_current: 'docs-builders-jdcloud' +--- + +# JDCloud Image Builder + +Type: `jdcloud` + +The `jdcloud` Packer builder helps you to build instance images +based on an existing image + +## Configuration Reference + +In order to build a JDCloud instance image, full-fill your configuration file. Necessary attributes +are given below: + +### Required-Parameters: + +- `type` (string) - This parameter tells which cloud-service-provider you are using, in our case, use 'jdcloud' +- `image_id` (string) - New image is generated based on an old one, specify the base-image-id here. +- `access_key` (string) - Your JD Cloud access key. You may set this as an env-variable:`export JDCLOUD_ACCESS_KEY=xxx` +- `secret_key` (string) - Your JD Cloud secret key. You may also set this via env-variable:`export JDCLOUD_SECRET_KEY=xxx` +- `region_id` (string) - Region of your instance, candidates are {"cn-north-1","cn-south-1","cn-east-1","cn-east-2"} +- `az` (string) - Exact availability zone of instance, 'cn-north-1c' for example +- `instance_name` (string) - Name your instance +- `instance_type` (string) - Class of your expected instance +- `image_name` (string) - Name the image you would like to create +- `communicator` (string) - Currently only `ssh` is supported. `winrm` will be added if required + +### Optional-Parameters + +- `subnet_id` (string) - An instance is supposed to exists in an subnet, if not specified , we will create new one for you + + +## Examples + +Here is a basic example for JDCloud. + +``` json +{ + "builders": [ + { + "type": "jdcloud", + "image_id": "img-h8ly274zg9", + "access_key": "", + "secret_key": "", + "region_id": "cn-north-1", + "az": "cn-north-1c", + "instance_name": "created_by_packer", + "instance_type": "g.n2.medium", + "ssh_password":"/Users/mac/.ssh/id_rsa", + "ssh_keypair_name":"created_by_xiaohan", + "image_name": "packerImage", + "subnet_id": "subnet-jo6e38sdli", + "communicator":"ssh", + "ssh_username": "root", + } + ], + + "provisioners": [ + { + "type": "shell", + "inline": [ + "sleep 3", + "echo 123", + "pwd" + ] + } + ] +} + + +``` + +[Find more examples](https://github.com/hashicorp/packer/tree/master/examples/jdcloud) diff --git a/website/source/layouts/docs.erb b/website/source/layouts/docs.erb index b36336994..26fd0ab85 100644 --- a/website/source/layouts/docs.erb +++ b/website/source/layouts/docs.erb @@ -191,6 +191,9 @@ > Tencent Cloud + > + JDCloud + > Triton