Merge pull request #7815 from zqfan/tencent-data-disks
feature: support data disks for tencentcloud builder
This commit is contained in:
commit
486bdcce9d
|
@ -104,6 +104,7 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack
|
||||||
InstanceName: b.config.InstanceName,
|
InstanceName: b.config.InstanceName,
|
||||||
DiskType: b.config.DiskType,
|
DiskType: b.config.DiskType,
|
||||||
DiskSize: b.config.DiskSize,
|
DiskSize: b.config.DiskSize,
|
||||||
|
DataDisks: b.config.DataDisks,
|
||||||
HostName: b.config.HostName,
|
HostName: b.config.HostName,
|
||||||
InternetMaxBandwidthOut: b.config.InternetMaxBandwidthOut,
|
InternetMaxBandwidthOut: b.config.InternetMaxBandwidthOut,
|
||||||
AssociatePublicIpAddress: b.config.AssociatePublicIpAddress,
|
AssociatePublicIpAddress: b.config.AssociatePublicIpAddress,
|
||||||
|
|
|
@ -10,28 +10,35 @@ import (
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
type tencentCloudDataDisk struct {
|
||||||
|
DiskType string `mapstructure:"disk_type"`
|
||||||
|
DiskSize int64 `mapstructure:"disk_size"`
|
||||||
|
SnapshotId string `mapstructure:"disk_snapshot_id"`
|
||||||
|
}
|
||||||
|
|
||||||
type TencentCloudRunConfig struct {
|
type TencentCloudRunConfig struct {
|
||||||
AssociatePublicIpAddress bool `mapstructure:"associate_public_ip_address"`
|
AssociatePublicIpAddress bool `mapstructure:"associate_public_ip_address"`
|
||||||
SourceImageId string `mapstructure:"source_image_id"`
|
SourceImageId string `mapstructure:"source_image_id"`
|
||||||
InstanceType string `mapstructure:"instance_type"`
|
InstanceType string `mapstructure:"instance_type"`
|
||||||
InstanceName string `mapstructure:"instance_name"`
|
InstanceName string `mapstructure:"instance_name"`
|
||||||
DiskType string `mapstructure:"disk_type"`
|
DiskType string `mapstructure:"disk_type"`
|
||||||
DiskSize int64 `mapstructure:"disk_size"`
|
DiskSize int64 `mapstructure:"disk_size"`
|
||||||
VpcId string `mapstructure:"vpc_id"`
|
DataDisks []tencentCloudDataDisk `mapstructure:"data_disks"`
|
||||||
VpcName string `mapstructure:"vpc_name"`
|
VpcId string `mapstructure:"vpc_id"`
|
||||||
VpcIp string `mapstructure:"vpc_ip"`
|
VpcName string `mapstructure:"vpc_name"`
|
||||||
SubnetId string `mapstructure:"subnet_id"`
|
VpcIp string `mapstructure:"vpc_ip"`
|
||||||
SubnetName string `mapstructure:"subnet_name"`
|
SubnetId string `mapstructure:"subnet_id"`
|
||||||
CidrBlock string `mapstructure:"cidr_block"` // 10.0.0.0/16(default), 172.16.0.0/12, 192.168.0.0/16
|
SubnetName string `mapstructure:"subnet_name"`
|
||||||
SubnectCidrBlock string `mapstructure:"subnect_cidr_block"`
|
CidrBlock string `mapstructure:"cidr_block"` // 10.0.0.0/16(default), 172.16.0.0/12, 192.168.0.0/16
|
||||||
InternetChargeType string `mapstructure:"internet_charge_type"`
|
SubnectCidrBlock string `mapstructure:"subnect_cidr_block"`
|
||||||
InternetMaxBandwidthOut int64 `mapstructure:"internet_max_bandwidth_out"`
|
InternetChargeType string `mapstructure:"internet_charge_type"`
|
||||||
SecurityGroupId string `mapstructure:"security_group_id"`
|
InternetMaxBandwidthOut int64 `mapstructure:"internet_max_bandwidth_out"`
|
||||||
SecurityGroupName string `mapstructure:"security_group_name"`
|
SecurityGroupId string `mapstructure:"security_group_id"`
|
||||||
UserData string `mapstructure:"user_data"`
|
SecurityGroupName string `mapstructure:"security_group_name"`
|
||||||
UserDataFile string `mapstructure:"user_data_file"`
|
UserData string `mapstructure:"user_data"`
|
||||||
HostName string `mapstructure:"host_name"`
|
UserDataFile string `mapstructure:"user_data_file"`
|
||||||
RunTags map[string]string `mapstructure:"run_tags"`
|
HostName string `mapstructure:"host_name"`
|
||||||
|
RunTags map[string]string `mapstructure:"run_tags"`
|
||||||
|
|
||||||
// Communicator settings
|
// Communicator settings
|
||||||
Comm communicator.Config `mapstructure:",squash"`
|
Comm communicator.Config `mapstructure:",squash"`
|
||||||
|
|
|
@ -28,6 +28,15 @@ func (s *stepCreateImage) Run(ctx context.Context, state multistep.StateBag) mul
|
||||||
req.ImageName = &config.ImageName
|
req.ImageName = &config.ImageName
|
||||||
req.ImageDescription = &config.ImageDescription
|
req.ImageDescription = &config.ImageDescription
|
||||||
req.InstanceId = instance.InstanceId
|
req.InstanceId = instance.InstanceId
|
||||||
|
// TODO: We should allow user to specify which data disk should be
|
||||||
|
// included into created image.
|
||||||
|
var dataDiskIds []*string
|
||||||
|
for _, disk := range instance.DataDisks {
|
||||||
|
dataDiskIds = append(dataDiskIds, disk.DiskId)
|
||||||
|
}
|
||||||
|
if len(dataDiskIds) > 0 {
|
||||||
|
req.DataDiskIds = dataDiskIds
|
||||||
|
}
|
||||||
|
|
||||||
True := "True"
|
True := "True"
|
||||||
False := "False"
|
False := "False"
|
||||||
|
|
|
@ -27,6 +27,7 @@ type stepRunInstance struct {
|
||||||
InternetMaxBandwidthOut int64
|
InternetMaxBandwidthOut int64
|
||||||
AssociatePublicIpAddress bool
|
AssociatePublicIpAddress bool
|
||||||
Tags map[string]string
|
Tags map[string]string
|
||||||
|
DataDisks []tencentCloudDataDisk
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *stepRunInstance) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction {
|
func (s *stepRunInstance) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction {
|
||||||
|
@ -62,10 +63,46 @@ func (s *stepRunInstance) Run(ctx context.Context, state multistep.StateBag) mul
|
||||||
req.ImageId = source_image.ImageId
|
req.ImageId = source_image.ImageId
|
||||||
req.InstanceChargeType = &POSTPAID_BY_HOUR
|
req.InstanceChargeType = &POSTPAID_BY_HOUR
|
||||||
req.InstanceType = &s.InstanceType
|
req.InstanceType = &s.InstanceType
|
||||||
|
// TODO: Add check for system disk size, it should be larger than image system disk size.
|
||||||
req.SystemDisk = &cvm.SystemDisk{
|
req.SystemDisk = &cvm.SystemDisk{
|
||||||
DiskType: &s.DiskType,
|
DiskType: &s.DiskType,
|
||||||
DiskSize: &s.DiskSize,
|
DiskSize: &s.DiskSize,
|
||||||
}
|
}
|
||||||
|
// System disk snapshot is mandatory, so if there are additional data disks,
|
||||||
|
// length will be larger than 1.
|
||||||
|
if source_image.SnapshotSet != nil && len(source_image.SnapshotSet) > 1 {
|
||||||
|
ui.Say("Use source image snapshot data disks, ignore user data disk settings.")
|
||||||
|
var dataDisks []*cvm.DataDisk
|
||||||
|
for _, snapshot := range source_image.SnapshotSet {
|
||||||
|
if *snapshot.DiskUsage == "DATA_DISK" {
|
||||||
|
var dataDisk cvm.DataDisk
|
||||||
|
// FIXME: Currently we have no way to get original disk type
|
||||||
|
// from data disk snapshots, and we don't allow user to overwrite
|
||||||
|
// snapshot settings, and we cannot guarantee a certain hard-coded type
|
||||||
|
// is not sold out, so here we use system disk type as a workaround.
|
||||||
|
//
|
||||||
|
// Eventually, we need to allow user to overwrite snapshot disk
|
||||||
|
// settings.
|
||||||
|
dataDisk.DiskType = &s.DiskType
|
||||||
|
dataDisk.DiskSize = snapshot.DiskSize
|
||||||
|
dataDisk.SnapshotId = snapshot.SnapshotId
|
||||||
|
dataDisks = append(dataDisks, &dataDisk)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
req.DataDisks = dataDisks
|
||||||
|
} else {
|
||||||
|
var dataDisks []*cvm.DataDisk
|
||||||
|
for _, disk := range s.DataDisks {
|
||||||
|
var dataDisk cvm.DataDisk
|
||||||
|
dataDisk.DiskType = &disk.DiskType
|
||||||
|
dataDisk.DiskSize = &disk.DiskSize
|
||||||
|
if disk.SnapshotId != "" {
|
||||||
|
dataDisk.SnapshotId = &disk.SnapshotId
|
||||||
|
}
|
||||||
|
dataDisks = append(dataDisks, &dataDisk)
|
||||||
|
}
|
||||||
|
req.DataDisks = dataDisks
|
||||||
|
}
|
||||||
req.VirtualPrivateCloud = &cvm.VirtualPrivateCloud{
|
req.VirtualPrivateCloud = &cvm.VirtualPrivateCloud{
|
||||||
VpcId: &vpc_id,
|
VpcId: &vpc_id,
|
||||||
SubnetId: &subnet_id,
|
SubnetId: &subnet_id,
|
||||||
|
|
|
@ -0,0 +1,34 @@
|
||||||
|
{
|
||||||
|
"variables": {
|
||||||
|
"secret_id": "{{env `TENCENTCLOUD_ACCESS_KEY`}}",
|
||||||
|
"secret_key": "{{env `TENCENTCLOUD_SECRET_KEY`}}"
|
||||||
|
},
|
||||||
|
"builders": [{
|
||||||
|
"type": "tencentcloud-cvm",
|
||||||
|
"secret_id": "{{user `secret_id`}}",
|
||||||
|
"secret_key": "{{user `secret_key`}}",
|
||||||
|
"region": "ap-guangzhou",
|
||||||
|
"zone": "ap-guangzhou-4",
|
||||||
|
"instance_type": "S4.SMALL1",
|
||||||
|
"source_image_id": "img-oikl1tzv",
|
||||||
|
"ssh_username" : "root",
|
||||||
|
"image_name": "PackerTest",
|
||||||
|
"disk_type": "CLOUD_PREMIUM",
|
||||||
|
"packer_debug": true,
|
||||||
|
"associate_public_ip_address": true,
|
||||||
|
"run_tags": {
|
||||||
|
"good": "luck"
|
||||||
|
},
|
||||||
|
"data_disks": [{
|
||||||
|
"disk_type": "CLOUD_PREMIUM",
|
||||||
|
"disk_size": 50
|
||||||
|
}]
|
||||||
|
}],
|
||||||
|
"provisioners": [{
|
||||||
|
"type": "shell",
|
||||||
|
"inline": [
|
||||||
|
"sleep 30",
|
||||||
|
"yum install redis.x86_64 -y"
|
||||||
|
]
|
||||||
|
}]
|
||||||
|
}
|
2
go.mod
2
go.mod
|
@ -109,7 +109,7 @@ require (
|
||||||
github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d // indirect
|
github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d // indirect
|
||||||
github.com/smartystreets/goconvey v0.0.0-20181108003508-044398e4856c // indirect
|
github.com/smartystreets/goconvey v0.0.0-20181108003508-044398e4856c // indirect
|
||||||
github.com/stretchr/testify v1.3.0
|
github.com/stretchr/testify v1.3.0
|
||||||
github.com/tencentcloud/tencentcloud-sdk-go v0.0.0-20181220135002-f1744d40d346
|
github.com/tencentcloud/tencentcloud-sdk-go v3.0.71+incompatible
|
||||||
github.com/ucloud/ucloud-sdk-go v0.8.7
|
github.com/ucloud/ucloud-sdk-go v0.8.7
|
||||||
github.com/ugorji/go v0.0.0-20151218193438-646ae4a518c1
|
github.com/ugorji/go v0.0.0-20151218193438-646ae4a518c1
|
||||||
github.com/ulikunitz/xz v0.5.5
|
github.com/ulikunitz/xz v0.5.5
|
||||||
|
|
4
go.sum
4
go.sum
|
@ -425,8 +425,8 @@ github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXf
|
||||||
github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q=
|
github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q=
|
||||||
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
|
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
|
||||||
github.com/tarm/serial v0.0.0-20180830185346-98f6abe2eb07/go.mod h1:kDXzergiv9cbyO7IOYJZWg1U88JhDg3PB6klq9Hg2pA=
|
github.com/tarm/serial v0.0.0-20180830185346-98f6abe2eb07/go.mod h1:kDXzergiv9cbyO7IOYJZWg1U88JhDg3PB6klq9Hg2pA=
|
||||||
github.com/tencentcloud/tencentcloud-sdk-go v0.0.0-20181220135002-f1744d40d346 h1:a014AaXz7AISMePv8xKRffUZZkr5z2XmSDf41gRV3+A=
|
github.com/tencentcloud/tencentcloud-sdk-go v3.0.71+incompatible h1:9sIWfe6ZC7xoSlshYWNGicPqomK7N+CsHMa1YFWBCWU=
|
||||||
github.com/tencentcloud/tencentcloud-sdk-go v0.0.0-20181220135002-f1744d40d346/go.mod h1:0PfYow01SHPMhKY31xa+EFz2RStxIqj6JFAJS+IkCi4=
|
github.com/tencentcloud/tencentcloud-sdk-go v3.0.71+incompatible/go.mod h1:0PfYow01SHPMhKY31xa+EFz2RStxIqj6JFAJS+IkCi4=
|
||||||
github.com/ucloud/ucloud-sdk-go v0.8.7 h1:BmXOb5RivI0Uu4oZRpjI6SQ9/y7n/H9wxTGR1txIE8o=
|
github.com/ucloud/ucloud-sdk-go v0.8.7 h1:BmXOb5RivI0Uu4oZRpjI6SQ9/y7n/H9wxTGR1txIE8o=
|
||||||
github.com/ucloud/ucloud-sdk-go v0.8.7/go.mod h1:lM6fpI8y6iwACtlbHUav823/uKPdXsNBlnBpRF2fj3c=
|
github.com/ucloud/ucloud-sdk-go v0.8.7/go.mod h1:lM6fpI8y6iwACtlbHUav823/uKPdXsNBlnBpRF2fj3c=
|
||||||
github.com/ugorji/go v0.0.0-20151218193438-646ae4a518c1 h1:U6ufy3mLDgg9RYupntOvAF7xCmNNquyKaYaaVHo1Nnk=
|
github.com/ugorji/go v0.0.0-20151218193438-646ae4a518c1 h1:U6ufy3mLDgg9RYupntOvAF7xCmNNquyKaYaaVHo1Nnk=
|
||||||
|
|
165
vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/client.go
generated
vendored
165
vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/client.go
generated
vendored
|
@ -1,8 +1,13 @@
|
||||||
package common
|
package common
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"encoding/hex"
|
||||||
|
"encoding/json"
|
||||||
|
"fmt"
|
||||||
"log"
|
"log"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
"strconv"
|
||||||
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
tchttp "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/http"
|
tchttp "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/http"
|
||||||
|
@ -10,12 +15,13 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
type Client struct {
|
type Client struct {
|
||||||
region string
|
region string
|
||||||
httpClient *http.Client
|
httpClient *http.Client
|
||||||
httpProfile *profile.HttpProfile
|
httpProfile *profile.HttpProfile
|
||||||
credential *Credential
|
credential *Credential
|
||||||
signMethod string
|
signMethod string
|
||||||
debug bool
|
unsignedPayload bool
|
||||||
|
debug bool
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Client) Send(request tchttp.Request, response tchttp.Response) (err error) {
|
func (c *Client) Send(request tchttp.Request, response tchttp.Response) (err error) {
|
||||||
|
@ -31,18 +37,27 @@ func (c *Client) Send(request tchttp.Request, response tchttp.Response) (err err
|
||||||
request.SetHttpMethod(c.httpProfile.ReqMethod)
|
request.SetHttpMethod(c.httpProfile.ReqMethod)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
tchttp.CompleteCommonParams(request, c.GetRegion())
|
||||||
|
|
||||||
|
if c.signMethod == "HmacSHA1" || c.signMethod == "HmacSHA256" {
|
||||||
|
return c.sendWithSignatureV1(request, response)
|
||||||
|
} else {
|
||||||
|
return c.sendWithSignatureV3(request, response)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *Client) sendWithSignatureV1(request tchttp.Request, response tchttp.Response) (err error) {
|
||||||
err = tchttp.ConstructParams(request)
|
err = tchttp.ConstructParams(request)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return err
|
||||||
}
|
}
|
||||||
tchttp.CompleteCommonParams(request, c.GetRegion())
|
|
||||||
err = signRequest(request, c.credential, c.signMethod)
|
err = signRequest(request, c.credential, c.signMethod)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return err
|
||||||
}
|
}
|
||||||
httpRequest, err := http.NewRequest(request.GetHttpMethod(), request.GetUrl(), request.GetBodyReader())
|
httpRequest, err := http.NewRequest(request.GetHttpMethod(), request.GetUrl(), request.GetBodyReader())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return err
|
||||||
}
|
}
|
||||||
if request.GetHttpMethod() == "POST" {
|
if request.GetHttpMethod() == "POST" {
|
||||||
httpRequest.Header["Content-Type"] = []string{"application/x-www-form-urlencoded"}
|
httpRequest.Header["Content-Type"] = []string{"application/x-www-form-urlencoded"}
|
||||||
|
@ -53,7 +68,129 @@ func (c *Client) Send(request tchttp.Request, response tchttp.Response) (err err
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
err = tchttp.ParseFromHttpResponse(httpResponse, response)
|
err = tchttp.ParseFromHttpResponse(httpResponse, response)
|
||||||
return
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *Client) sendWithSignatureV3(request tchttp.Request, response tchttp.Response) (err error) {
|
||||||
|
headers := map[string]string{
|
||||||
|
"Host": request.GetDomain(),
|
||||||
|
"X-TC-Action": request.GetAction(),
|
||||||
|
"X-TC-Version": request.GetVersion(),
|
||||||
|
"X-TC-Timestamp": request.GetParams()["Timestamp"],
|
||||||
|
"X-TC-RequestClient": request.GetParams()["RequestClient"],
|
||||||
|
}
|
||||||
|
if c.region != "" {
|
||||||
|
headers["X-TC-Region"] = c.region
|
||||||
|
}
|
||||||
|
if c.credential.Token != "" {
|
||||||
|
headers["X-TC-Token"] = c.credential.Token
|
||||||
|
}
|
||||||
|
if request.GetHttpMethod() == "GET" {
|
||||||
|
headers["Content-Type"] = "application/x-www-form-urlencoded"
|
||||||
|
} else {
|
||||||
|
headers["Content-Type"] = "application/json"
|
||||||
|
}
|
||||||
|
|
||||||
|
// start signature v3 process
|
||||||
|
|
||||||
|
// build canonical request string
|
||||||
|
httpRequestMethod := request.GetHttpMethod()
|
||||||
|
canonicalURI := "/"
|
||||||
|
canonicalQueryString := ""
|
||||||
|
if httpRequestMethod == "GET" {
|
||||||
|
err = tchttp.ConstructParams(request)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
params := make(map[string]string)
|
||||||
|
for key, value := range request.GetParams() {
|
||||||
|
params[key] = value
|
||||||
|
}
|
||||||
|
delete(params, "Action")
|
||||||
|
delete(params, "Version")
|
||||||
|
delete(params, "Nonce")
|
||||||
|
delete(params, "Region")
|
||||||
|
delete(params, "RequestClient")
|
||||||
|
delete(params, "Timestamp")
|
||||||
|
canonicalQueryString = tchttp.GetUrlQueriesEncoded(params)
|
||||||
|
}
|
||||||
|
canonicalHeaders := fmt.Sprintf("content-type:%s\nhost:%s\n", headers["Content-Type"], headers["Host"])
|
||||||
|
signedHeaders := "content-type;host"
|
||||||
|
requestPayload := ""
|
||||||
|
if httpRequestMethod == "POST" {
|
||||||
|
b, err := json.Marshal(request)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
requestPayload = string(b)
|
||||||
|
}
|
||||||
|
hashedRequestPayload := ""
|
||||||
|
if c.unsignedPayload {
|
||||||
|
hashedRequestPayload = sha256hex("UNSIGNED-PAYLOAD")
|
||||||
|
headers["X-TC-Content-SHA256"] = "UNSIGNED-PAYLOAD"
|
||||||
|
} else {
|
||||||
|
hashedRequestPayload = sha256hex(requestPayload)
|
||||||
|
}
|
||||||
|
canonicalRequest := fmt.Sprintf("%s\n%s\n%s\n%s\n%s\n%s",
|
||||||
|
httpRequestMethod,
|
||||||
|
canonicalURI,
|
||||||
|
canonicalQueryString,
|
||||||
|
canonicalHeaders,
|
||||||
|
signedHeaders,
|
||||||
|
hashedRequestPayload)
|
||||||
|
//log.Println("canonicalRequest:", canonicalRequest)
|
||||||
|
|
||||||
|
// build string to sign
|
||||||
|
algorithm := "TC3-HMAC-SHA256"
|
||||||
|
requestTimestamp := headers["X-TC-Timestamp"]
|
||||||
|
timestamp, _ := strconv.ParseInt(requestTimestamp, 10, 64)
|
||||||
|
t := time.Unix(timestamp, 0).UTC()
|
||||||
|
// must be the format 2006-01-02, ref to package time for more info
|
||||||
|
date := t.Format("2006-01-02")
|
||||||
|
credentialScope := fmt.Sprintf("%s/%s/tc3_request", date, request.GetService())
|
||||||
|
hashedCanonicalRequest := sha256hex(canonicalRequest)
|
||||||
|
string2sign := fmt.Sprintf("%s\n%s\n%s\n%s",
|
||||||
|
algorithm,
|
||||||
|
requestTimestamp,
|
||||||
|
credentialScope,
|
||||||
|
hashedCanonicalRequest)
|
||||||
|
//log.Println("string2sign", string2sign)
|
||||||
|
|
||||||
|
// sign string
|
||||||
|
secretDate := hmacsha256(date, "TC3"+c.credential.SecretKey)
|
||||||
|
secretService := hmacsha256(request.GetService(), secretDate)
|
||||||
|
secretKey := hmacsha256("tc3_request", secretService)
|
||||||
|
signature := hex.EncodeToString([]byte(hmacsha256(string2sign, secretKey)))
|
||||||
|
//log.Println("signature", signature)
|
||||||
|
|
||||||
|
// build authorization
|
||||||
|
authorization := fmt.Sprintf("%s Credential=%s/%s, SignedHeaders=%s, Signature=%s",
|
||||||
|
algorithm,
|
||||||
|
c.credential.SecretId,
|
||||||
|
credentialScope,
|
||||||
|
signedHeaders,
|
||||||
|
signature)
|
||||||
|
//log.Println("authorization", authorization)
|
||||||
|
|
||||||
|
headers["Authorization"] = authorization
|
||||||
|
url := "https://" + request.GetDomain() + request.GetPath()
|
||||||
|
if canonicalQueryString != "" {
|
||||||
|
url = url + "?" + canonicalQueryString
|
||||||
|
}
|
||||||
|
httpRequest, err := http.NewRequest(httpRequestMethod, url, strings.NewReader(requestPayload))
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
for k, v := range headers {
|
||||||
|
httpRequest.Header[k] = []string{v}
|
||||||
|
}
|
||||||
|
//log.Printf("[DEBUG] http request=%v, body=%v", httpRequest, requestPayload)
|
||||||
|
httpResponse, err := c.httpClient.Do(httpRequest)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
err = tchttp.ParseFromHttpResponse(httpResponse, response)
|
||||||
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Client) GetRegion() string {
|
func (c *Client) GetRegion() string {
|
||||||
|
@ -81,6 +218,7 @@ func (c *Client) WithCredential(cred *Credential) *Client {
|
||||||
|
|
||||||
func (c *Client) WithProfile(clientProfile *profile.ClientProfile) *Client {
|
func (c *Client) WithProfile(clientProfile *profile.ClientProfile) *Client {
|
||||||
c.signMethod = clientProfile.SignMethod
|
c.signMethod = clientProfile.SignMethod
|
||||||
|
c.unsignedPayload = clientProfile.UnsignedPayload
|
||||||
c.httpProfile = clientProfile.HttpProfile
|
c.httpProfile = clientProfile.HttpProfile
|
||||||
c.httpClient.Timeout = time.Duration(c.httpProfile.ReqTimeout) * time.Second
|
c.httpClient.Timeout = time.Duration(c.httpProfile.ReqTimeout) * time.Second
|
||||||
return c
|
return c
|
||||||
|
@ -91,6 +229,11 @@ func (c *Client) WithSignatureMethod(method string) *Client {
|
||||||
return c
|
return c
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (c *Client) WithHttpTransport (transport http.RoundTripper) *Client {
|
||||||
|
c.httpClient.Transport = transport
|
||||||
|
return c
|
||||||
|
}
|
||||||
|
|
||||||
func NewClientWithSecretId(secretId, secretKey, region string) (client *Client, err error) {
|
func NewClientWithSecretId(secretId, secretKey, region string) (client *Client, err error) {
|
||||||
client = &Client{}
|
client = &Client{}
|
||||||
client.Init(region).WithSecretId(secretId, secretKey)
|
client.Init(region).WithSecretId(secretId, secretKey)
|
||||||
|
|
18
vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/http/request.go
generated
vendored
18
vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/http/request.go
generated
vendored
|
@ -92,7 +92,7 @@ func (r *BaseRequest) GetService() string {
|
||||||
|
|
||||||
func (r *BaseRequest) GetUrl() string {
|
func (r *BaseRequest) GetUrl() string {
|
||||||
if r.httpMethod == GET {
|
if r.httpMethod == GET {
|
||||||
return "https://" + r.domain + r.path + "?" + getUrlQueriesEncoded(r.params)
|
return "https://" + r.domain + r.path + "?" + GetUrlQueriesEncoded(r.params)
|
||||||
} else if r.httpMethod == POST {
|
} else if r.httpMethod == POST {
|
||||||
return "https://" + r.domain + r.path
|
return "https://" + r.domain + r.path
|
||||||
} else {
|
} else {
|
||||||
|
@ -104,7 +104,7 @@ func (r *BaseRequest) GetVersion() string {
|
||||||
return r.version
|
return r.version
|
||||||
}
|
}
|
||||||
|
|
||||||
func getUrlQueriesEncoded(params map[string]string) string {
|
func GetUrlQueriesEncoded(params map[string]string) string {
|
||||||
values := url.Values{}
|
values := url.Values{}
|
||||||
for key, value := range params {
|
for key, value := range params {
|
||||||
if value != "" {
|
if value != "" {
|
||||||
|
@ -116,8 +116,7 @@ func getUrlQueriesEncoded(params map[string]string) string {
|
||||||
|
|
||||||
func (r *BaseRequest) GetBodyReader() io.Reader {
|
func (r *BaseRequest) GetBodyReader() io.Reader {
|
||||||
if r.httpMethod == POST {
|
if r.httpMethod == POST {
|
||||||
s := getUrlQueriesEncoded(r.params)
|
s := GetUrlQueriesEncoded(r.params)
|
||||||
//log.Printf("[DEBUG] body: %s", s)
|
|
||||||
return strings.NewReader(s)
|
return strings.NewReader(s)
|
||||||
} else {
|
} else {
|
||||||
return strings.NewReader("")
|
return strings.NewReader("")
|
||||||
|
@ -153,7 +152,7 @@ func CompleteCommonParams(request Request, region string) {
|
||||||
params["Action"] = request.GetAction()
|
params["Action"] = request.GetAction()
|
||||||
params["Timestamp"] = strconv.FormatInt(time.Now().Unix(), 10)
|
params["Timestamp"] = strconv.FormatInt(time.Now().Unix(), 10)
|
||||||
params["Nonce"] = strconv.Itoa(rand.Int())
|
params["Nonce"] = strconv.Itoa(rand.Int())
|
||||||
params["RequestClient"] = "SDK_GO_3.0.42"
|
params["RequestClient"] = "SDK_GO_3.0.71"
|
||||||
}
|
}
|
||||||
|
|
||||||
func ConstructParams(req Request) (err error) {
|
func ConstructParams(req Request) (err error) {
|
||||||
|
@ -196,9 +195,8 @@ func flatStructure(value reflect.Value, request Request, prefix string) (err err
|
||||||
} else if kind == reflect.Float64 {
|
} else if kind == reflect.Float64 {
|
||||||
request.GetParams()[key] = strconv.FormatFloat(field.Float(), 'f', -1, 64)
|
request.GetParams()[key] = strconv.FormatFloat(field.Float(), 'f', -1, 64)
|
||||||
} else if kind == reflect.Slice {
|
} else if kind == reflect.Slice {
|
||||||
list := value.Field(i)
|
for j := 0; j < field.Len(); j++ {
|
||||||
for j := 0; j < list.Len(); j++ {
|
vj := field.Index(j)
|
||||||
vj := list.Index(j)
|
|
||||||
key := prefix + nameTag + "." + strconv.Itoa(j)
|
key := prefix + nameTag + "." + strconv.Itoa(j)
|
||||||
kind = vj.Kind()
|
kind = vj.Kind()
|
||||||
if kind == reflect.Ptr && vj.IsNil() {
|
if kind == reflect.Ptr && vj.IsNil() {
|
||||||
|
@ -219,11 +217,11 @@ func flatStructure(value reflect.Value, request Request, prefix string) (err err
|
||||||
} else if kind == reflect.Float64 {
|
} else if kind == reflect.Float64 {
|
||||||
request.GetParams()[key] = strconv.FormatFloat(vj.Float(), 'f', -1, 64)
|
request.GetParams()[key] = strconv.FormatFloat(vj.Float(), 'f', -1, 64)
|
||||||
} else {
|
} else {
|
||||||
flatStructure(vj, request, key+".")
|
return flatStructure(vj, request, key+".")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
flatStructure(reflect.ValueOf(field.Interface()), request, prefix+nameTag+".")
|
return flatStructure(reflect.ValueOf(field.Interface()), request, prefix+nameTag+".")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
|
|
|
@ -4,7 +4,7 @@ import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
//"log"
|
"log"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/errors"
|
"github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/errors"
|
||||||
|
@ -69,5 +69,8 @@ func ParseFromHttpResponse(hr *http.Response, response Response) (err error) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
err = json.Unmarshal(body, &response)
|
err = json.Unmarshal(body, &response)
|
||||||
|
if err != nil {
|
||||||
|
log.Printf("Unexpected Error occurs when parsing API response\n%s\n", string(body[:]))
|
||||||
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,13 +1,15 @@
|
||||||
package profile
|
package profile
|
||||||
|
|
||||||
type ClientProfile struct {
|
type ClientProfile struct {
|
||||||
HttpProfile *HttpProfile
|
HttpProfile *HttpProfile
|
||||||
SignMethod string
|
SignMethod string
|
||||||
|
UnsignedPayload bool
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewClientProfile() *ClientProfile {
|
func NewClientProfile() *ClientProfile {
|
||||||
return &ClientProfile{
|
return &ClientProfile{
|
||||||
HttpProfile: NewHttpProfile(),
|
HttpProfile: NewHttpProfile(),
|
||||||
SignMethod: "HmacSHA256",
|
SignMethod: "TC3-HMAC-SHA256",
|
||||||
|
UnsignedPayload: false,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
12
vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/sign.go
generated
vendored
12
vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/sign.go
generated
vendored
|
@ -5,6 +5,7 @@ import (
|
||||||
"crypto/sha1"
|
"crypto/sha1"
|
||||||
"crypto/sha256"
|
"crypto/sha256"
|
||||||
"encoding/base64"
|
"encoding/base64"
|
||||||
|
"encoding/hex"
|
||||||
"fmt"
|
"fmt"
|
||||||
"sort"
|
"sort"
|
||||||
"strings"
|
"strings"
|
||||||
|
@ -27,6 +28,17 @@ func Sign(s, secretKey, method string) string {
|
||||||
return base64.StdEncoding.EncodeToString(hashed.Sum(nil))
|
return base64.StdEncoding.EncodeToString(hashed.Sum(nil))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func sha256hex(s string) string {
|
||||||
|
b := sha256.Sum256([]byte(s))
|
||||||
|
return hex.EncodeToString(b[:])
|
||||||
|
}
|
||||||
|
|
||||||
|
func hmacsha256(s, key string) string {
|
||||||
|
hashed := hmac.New(sha256.New, []byte(key))
|
||||||
|
hashed.Write([]byte(s))
|
||||||
|
return string(hashed.Sum(nil))
|
||||||
|
}
|
||||||
|
|
||||||
func signRequest(request tchttp.Request, credential *Credential, method string) (err error) {
|
func signRequest(request tchttp.Request, credential *Credential, method string) (err error) {
|
||||||
if method != SHA256 {
|
if method != SHA256 {
|
||||||
method = SHA1
|
method = SHA1
|
||||||
|
|
37
vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cvm/v20170312/client.go
generated
vendored
37
vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cvm/v20170312/client.go
generated
vendored
|
@ -611,6 +611,33 @@ func (c *Client) DescribeInstances(request *DescribeInstancesRequest) (response
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func NewDescribeInstancesOperationLimitRequest() (request *DescribeInstancesOperationLimitRequest) {
|
||||||
|
request = &DescribeInstancesOperationLimitRequest{
|
||||||
|
BaseRequest: &tchttp.BaseRequest{},
|
||||||
|
}
|
||||||
|
request.Init().WithApiInfo("cvm", APIVersion, "DescribeInstancesOperationLimit")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewDescribeInstancesOperationLimitResponse() (response *DescribeInstancesOperationLimitResponse) {
|
||||||
|
response = &DescribeInstancesOperationLimitResponse{
|
||||||
|
BaseResponse: &tchttp.BaseResponse{},
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// 本接口(DescribeInstancesOperationLimit)用于查询实例操作限制。
|
||||||
|
//
|
||||||
|
// * 目前支持调整配置操作限制次数查询。
|
||||||
|
func (c *Client) DescribeInstancesOperationLimit(request *DescribeInstancesOperationLimitRequest) (response *DescribeInstancesOperationLimitResponse, err error) {
|
||||||
|
if request == nil {
|
||||||
|
request = NewDescribeInstancesOperationLimitRequest()
|
||||||
|
}
|
||||||
|
response = NewDescribeInstancesOperationLimitResponse()
|
||||||
|
err = c.Send(request, response)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
func NewDescribeInstancesStatusRequest() (request *DescribeInstancesStatusRequest) {
|
func NewDescribeInstancesStatusRequest() (request *DescribeInstancesStatusRequest) {
|
||||||
request = &DescribeInstancesStatusRequest{
|
request = &DescribeInstancesStatusRequest{
|
||||||
BaseRequest: &tchttp.BaseRequest{},
|
BaseRequest: &tchttp.BaseRequest{},
|
||||||
|
@ -785,7 +812,7 @@ func NewDisassociateInstancesKeyPairsResponse() (response *DisassociateInstances
|
||||||
//
|
//
|
||||||
// * 只支持[`STOPPED`](https://cloud.tencent.com/document/api/213/9452#INSTANCE_STATE)状态的`Linux`操作系统的实例。
|
// * 只支持[`STOPPED`](https://cloud.tencent.com/document/api/213/9452#INSTANCE_STATE)状态的`Linux`操作系统的实例。
|
||||||
// * 解绑密钥后,实例可以通过原来设置的密码登录。
|
// * 解绑密钥后,实例可以通过原来设置的密码登录。
|
||||||
// * 如果原来没有设置密码,解绑后将无法使用 `SSH` 登录。可以调用 [ResetInstancesPassword](https://cloud.tencent.com/document/api/213/9397) 接口来设置登陆密码。
|
// * 如果原来没有设置密码,解绑后将无法使用 `SSH` 登录。可以调用 [ResetInstancesPassword](https://cloud.tencent.com/document/api/213/15736) 接口来设置登录密码。
|
||||||
// * 支持批量操作。每次请求批量实例的上限为100。如果批量实例存在不允许操作的实例,操作会以特定错误码返回。
|
// * 支持批量操作。每次请求批量实例的上限为100。如果批量实例存在不允许操作的实例,操作会以特定错误码返回。
|
||||||
func (c *Client) DisassociateInstancesKeyPairs(request *DisassociateInstancesKeyPairsRequest) (response *DisassociateInstancesKeyPairsResponse, err error) {
|
func (c *Client) DisassociateInstancesKeyPairs(request *DisassociateInstancesKeyPairsRequest) (response *DisassociateInstancesKeyPairsResponse, err error) {
|
||||||
if request == nil {
|
if request == nil {
|
||||||
|
@ -1006,7 +1033,6 @@ func NewInquiryPriceResetInstancesTypeResponse() (response *InquiryPriceResetIns
|
||||||
//
|
//
|
||||||
// * 目前只支持[系统盘类型](https://cloud.tencent.com/document/api/213/9452#block_device)是`CLOUD_BASIC`、`CLOUD_PREMIUM`、`CLOUD_SSD`类型的实例使用该接口进行调整机型询价。
|
// * 目前只支持[系统盘类型](https://cloud.tencent.com/document/api/213/9452#block_device)是`CLOUD_BASIC`、`CLOUD_PREMIUM`、`CLOUD_SSD`类型的实例使用该接口进行调整机型询价。
|
||||||
// * 目前不支持[CDH](https://cloud.tencent.com/document/product/416)实例使用该接口调整机型询价。
|
// * 目前不支持[CDH](https://cloud.tencent.com/document/product/416)实例使用该接口调整机型询价。
|
||||||
// * 目前不支持跨机型系统来调整机型,即使用该接口时指定的`InstanceType`和实例原来的机型需要属于同一系列。
|
|
||||||
// * 对于包年包月实例,使用该接口会涉及扣费,请确保账户余额充足。可通过[`DescribeAccountBalance`](https://cloud.tencent.com/document/product/378/4397)接口查询账户余额。
|
// * 对于包年包月实例,使用该接口会涉及扣费,请确保账户余额充足。可通过[`DescribeAccountBalance`](https://cloud.tencent.com/document/product/378/4397)接口查询账户余额。
|
||||||
func (c *Client) InquiryPriceResetInstancesType(request *InquiryPriceResetInstancesTypeRequest) (response *InquiryPriceResetInstancesTypeResponse, err error) {
|
func (c *Client) InquiryPriceResetInstancesType(request *InquiryPriceResetInstancesTypeRequest) (response *InquiryPriceResetInstancesTypeResponse, err error) {
|
||||||
if request == nil {
|
if request == nil {
|
||||||
|
@ -1034,7 +1060,7 @@ func NewInquiryPriceResizeInstanceDisksResponse() (response *InquiryPriceResizeI
|
||||||
|
|
||||||
// 本接口 (InquiryPriceResizeInstanceDisks) 用于扩容实例的数据盘询价。
|
// 本接口 (InquiryPriceResizeInstanceDisks) 用于扩容实例的数据盘询价。
|
||||||
//
|
//
|
||||||
// * 目前只支持扩容随实例购买的数据盘询价,且[数据盘类型](/document/api/213/9452#block_device)为:`CLOUD_BASIC`、`CLOUD_PREMIUM`、`CLOUD_SSD`。
|
// * 目前只支持扩容非弹性数据盘([`DescribeDisks`](https://cloud.tencent.com/document/api/362/16315)接口返回值中的`Portable`为`false`表示非弹性)询价,且[数据盘类型](/document/api/213/9452#block_device)为:`CLOUD_BASIC`、`CLOUD_PREMIUM`、`CLOUD_SSD`。
|
||||||
// * 目前不支持[CDH](https://cloud.tencent.com/document/product/416)实例使用该接口扩容数据盘询价。* 仅支持包年包月实例随机器购买的数据盘。* 目前只支持扩容一块数据盘询价。
|
// * 目前不支持[CDH](https://cloud.tencent.com/document/product/416)实例使用该接口扩容数据盘询价。* 仅支持包年包月实例随机器购买的数据盘。* 目前只支持扩容一块数据盘询价。
|
||||||
func (c *Client) InquiryPriceResizeInstanceDisks(request *InquiryPriceResizeInstanceDisksRequest) (response *InquiryPriceResizeInstanceDisksResponse, err error) {
|
func (c *Client) InquiryPriceResizeInstanceDisks(request *InquiryPriceResizeInstanceDisksRequest) (response *InquiryPriceResizeInstanceDisksResponse, err error) {
|
||||||
if request == nil {
|
if request == nil {
|
||||||
|
@ -1544,7 +1570,7 @@ func NewResetInstancesTypeResponse() (response *ResetInstancesTypeResponse) {
|
||||||
|
|
||||||
// 本接口 (ResetInstancesType) 用于调整实例的机型。
|
// 本接口 (ResetInstancesType) 用于调整实例的机型。
|
||||||
// * 目前只支持[系统盘类型](/document/api/213/9452#block_device)是`CLOUD_BASIC`、`CLOUD_PREMIUM`、`CLOUD_SSD`类型的实例使用该接口进行机型调整。
|
// * 目前只支持[系统盘类型](/document/api/213/9452#block_device)是`CLOUD_BASIC`、`CLOUD_PREMIUM`、`CLOUD_SSD`类型的实例使用该接口进行机型调整。
|
||||||
// * 目前不支持[CDH](https://cloud.tencent.com/document/product/416)实例使用该接口调整机型。* 目前不支持跨机型系统来调整机型,即使用该接口时指定的`InstanceType`和实例原来的机型需要属于同一系列。* 对于包年包月实例,使用该接口会涉及扣费,请确保账户余额充足。可通过[`DescribeAccountBalance`](https://cloud.tencent.com/document/product/378/4397)接口查询账户余额。
|
// * 目前不支持[CDH](https://cloud.tencent.com/document/product/416)实例使用该接口调整机型。对于包年包月实例,使用该接口会涉及扣费,请确保账户余额充足。可通过[`DescribeAccountBalance`](https://cloud.tencent.com/document/product/378/4397)接口查询账户余额。
|
||||||
func (c *Client) ResetInstancesType(request *ResetInstancesTypeRequest) (response *ResetInstancesTypeResponse, err error) {
|
func (c *Client) ResetInstancesType(request *ResetInstancesTypeRequest) (response *ResetInstancesTypeResponse, err error) {
|
||||||
if request == nil {
|
if request == nil {
|
||||||
request = NewResetInstancesTypeRequest()
|
request = NewResetInstancesTypeRequest()
|
||||||
|
@ -1571,7 +1597,8 @@ func NewResizeInstanceDisksResponse() (response *ResizeInstanceDisksResponse) {
|
||||||
|
|
||||||
// 本接口 (ResizeInstanceDisks) 用于扩容实例的数据盘。
|
// 本接口 (ResizeInstanceDisks) 用于扩容实例的数据盘。
|
||||||
//
|
//
|
||||||
// * 目前只支持扩容随实例购买的数据盘,且[数据盘类型](/document/api/213/9452#block_device)为:`CLOUD_BASIC`、`CLOUD_PREMIUM`、`CLOUD_SSD`。* 目前不支持[CDH](https://cloud.tencent.com/document/product/416)实例使用该接口扩容数据盘。
|
// * 目前只支持扩容非弹性数据盘([`DescribeDisks`](https://cloud.tencent.com/document/api/362/16315)接口返回值中的`Portable`为`false`表示非弹性),且[数据盘类型](/document/api/213/9452#block_device)为:`CLOUD_BASIC`、`CLOUD_PREMIUM`、`CLOUD_SSD`。
|
||||||
|
// * 目前不支持[CDH](https://cloud.tencent.com/document/product/416)实例使用该接口扩容数据盘。
|
||||||
// * 对于包年包月实例,使用该接口会涉及扣费,请确保账户余额充足。可通过[`DescribeAccountBalance`](https://cloud.tencent.com/document/product/378/4397)接口查询账户余额。
|
// * 对于包年包月实例,使用该接口会涉及扣费,请确保账户余额充足。可通过[`DescribeAccountBalance`](https://cloud.tencent.com/document/product/378/4397)接口查询账户余额。
|
||||||
// * 目前只支持扩容一块数据盘。
|
// * 目前只支持扩容一块数据盘。
|
||||||
func (c *Client) ResizeInstanceDisks(request *ResizeInstanceDisksRequest) (response *ResizeInstanceDisksResponse, err error) {
|
func (c *Client) ResizeInstanceDisks(request *ResizeInstanceDisksRequest) (response *ResizeInstanceDisksResponse, err error) {
|
||||||
|
|
1086
vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cvm/v20170312/models.go
generated
vendored
1086
vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cvm/v20170312/models.go
generated
vendored
File diff suppressed because it is too large
Load Diff
670
vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/vpc/v20170312/client.go
generated
vendored
670
vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/vpc/v20170312/client.go
generated
vendored
|
@ -93,6 +93,33 @@ func (c *Client) AddBandwidthPackageResources(request *AddBandwidthPackageResour
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func NewAddIp6RulesRequest() (request *AddIp6RulesRequest) {
|
||||||
|
request = &AddIp6RulesRequest{
|
||||||
|
BaseRequest: &tchttp.BaseRequest{},
|
||||||
|
}
|
||||||
|
request.Init().WithApiInfo("vpc", APIVersion, "AddIp6Rules")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewAddIp6RulesResponse() (response *AddIp6RulesResponse) {
|
||||||
|
response = &AddIp6RulesResponse{
|
||||||
|
BaseResponse: &tchttp.BaseResponse{},
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// 1. 该接口用于在转换实例下添加IPV6转换规则。
|
||||||
|
// 2. 支持在同一个转换实例下批量添加转换规则,一个账户在一个地域最多50个。
|
||||||
|
// 3. 一个完整的转换规则包括vip6:vport6:protocol:vip:vport,其中vip6:vport6:protocol必须是唯一。
|
||||||
|
func (c *Client) AddIp6Rules(request *AddIp6RulesRequest) (response *AddIp6RulesResponse, err error) {
|
||||||
|
if request == nil {
|
||||||
|
request = NewAddIp6RulesRequest()
|
||||||
|
}
|
||||||
|
response = NewAddIp6RulesResponse()
|
||||||
|
err = c.Send(request, response)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
func NewAllocateAddressesRequest() (request *AllocateAddressesRequest) {
|
func NewAllocateAddressesRequest() (request *AllocateAddressesRequest) {
|
||||||
request = &AllocateAddressesRequest{
|
request = &AllocateAddressesRequest{
|
||||||
BaseRequest: &tchttp.BaseRequest{},
|
BaseRequest: &tchttp.BaseRequest{},
|
||||||
|
@ -121,6 +148,90 @@ func (c *Client) AllocateAddresses(request *AllocateAddressesRequest) (response
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func NewAssignIpv6AddressesRequest() (request *AssignIpv6AddressesRequest) {
|
||||||
|
request = &AssignIpv6AddressesRequest{
|
||||||
|
BaseRequest: &tchttp.BaseRequest{},
|
||||||
|
}
|
||||||
|
request.Init().WithApiInfo("vpc", APIVersion, "AssignIpv6Addresses")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewAssignIpv6AddressesResponse() (response *AssignIpv6AddressesResponse) {
|
||||||
|
response = &AssignIpv6AddressesResponse{
|
||||||
|
BaseResponse: &tchttp.BaseResponse{},
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// 本接口(AssignIpv6Addresses)用于弹性网卡申请`IPv6`地址。<br />
|
||||||
|
// 本接口是异步完成,如需查询异步任务执行结果,请使用本接口返回的`RequestId`轮询`QueryTask`接口。
|
||||||
|
// * 一个弹性网卡支持绑定的IP地址是有限制的,更多资源限制信息详见<a href="/document/product/576/18527">弹性网卡使用限制</a>。
|
||||||
|
// * 可以指定`IPv6`地址申请,地址类型不能为主`IP`,`IPv6`地址暂时只支持作为辅助`IP`。
|
||||||
|
// * 地址必须要在弹性网卡所在子网内,而且不能被占用。
|
||||||
|
// * 在弹性网卡上申请一个到多个辅助`IPv6`地址,接口会在弹性网卡所在子网段内返回指定数量的辅助`IPv6`地址。
|
||||||
|
func (c *Client) AssignIpv6Addresses(request *AssignIpv6AddressesRequest) (response *AssignIpv6AddressesResponse, err error) {
|
||||||
|
if request == nil {
|
||||||
|
request = NewAssignIpv6AddressesRequest()
|
||||||
|
}
|
||||||
|
response = NewAssignIpv6AddressesResponse()
|
||||||
|
err = c.Send(request, response)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewAssignIpv6CidrBlockRequest() (request *AssignIpv6CidrBlockRequest) {
|
||||||
|
request = &AssignIpv6CidrBlockRequest{
|
||||||
|
BaseRequest: &tchttp.BaseRequest{},
|
||||||
|
}
|
||||||
|
request.Init().WithApiInfo("vpc", APIVersion, "AssignIpv6CidrBlock")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewAssignIpv6CidrBlockResponse() (response *AssignIpv6CidrBlockResponse) {
|
||||||
|
response = &AssignIpv6CidrBlockResponse{
|
||||||
|
BaseResponse: &tchttp.BaseResponse{},
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// 本接口(AssignIpv6CidrBlock)用于分配IPv6网段。
|
||||||
|
// * 使用本接口前,你需要已有VPC实例,如果没有可通过接口<a href="https://cloud.tencent.com/document/api/215/15774" title="CreateVpc" target="_blank">CreateVpc</a>创建。
|
||||||
|
// * 每个VPC只能申请一个IPv6网段
|
||||||
|
func (c *Client) AssignIpv6CidrBlock(request *AssignIpv6CidrBlockRequest) (response *AssignIpv6CidrBlockResponse, err error) {
|
||||||
|
if request == nil {
|
||||||
|
request = NewAssignIpv6CidrBlockRequest()
|
||||||
|
}
|
||||||
|
response = NewAssignIpv6CidrBlockResponse()
|
||||||
|
err = c.Send(request, response)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewAssignIpv6SubnetCidrBlockRequest() (request *AssignIpv6SubnetCidrBlockRequest) {
|
||||||
|
request = &AssignIpv6SubnetCidrBlockRequest{
|
||||||
|
BaseRequest: &tchttp.BaseRequest{},
|
||||||
|
}
|
||||||
|
request.Init().WithApiInfo("vpc", APIVersion, "AssignIpv6SubnetCidrBlock")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewAssignIpv6SubnetCidrBlockResponse() (response *AssignIpv6SubnetCidrBlockResponse) {
|
||||||
|
response = &AssignIpv6SubnetCidrBlockResponse{
|
||||||
|
BaseResponse: &tchttp.BaseResponse{},
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// 本接口(AssignIpv6SubnetCidrBlock)用于分配IPv6子网段。
|
||||||
|
// * 给子网分配 `IPv6` 网段,要求子网所属 `VPC` 已获得 `IPv6` 网段。如果尚未分配,请先通过接口 `AssignIpv6CidrBlock` 给子网所属 `VPC` 分配一个 `IPv6` 网段。否则无法分配 `IPv6` 子网段。
|
||||||
|
// * 每个子网只能分配一个IPv6网段。
|
||||||
|
func (c *Client) AssignIpv6SubnetCidrBlock(request *AssignIpv6SubnetCidrBlockRequest) (response *AssignIpv6SubnetCidrBlockResponse, err error) {
|
||||||
|
if request == nil {
|
||||||
|
request = NewAssignIpv6SubnetCidrBlockRequest()
|
||||||
|
}
|
||||||
|
response = NewAssignIpv6SubnetCidrBlockResponse()
|
||||||
|
err = c.Send(request, response)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
func NewAssignPrivateIpAddressesRequest() (request *AssignPrivateIpAddressesRequest) {
|
func NewAssignPrivateIpAddressesRequest() (request *AssignPrivateIpAddressesRequest) {
|
||||||
request = &AssignPrivateIpAddressesRequest{
|
request = &AssignPrivateIpAddressesRequest{
|
||||||
BaseRequest: &tchttp.BaseRequest{},
|
BaseRequest: &tchttp.BaseRequest{},
|
||||||
|
@ -165,9 +276,10 @@ func NewAssociateAddressResponse() (response *AssociateAddressResponse) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// 本接口 (AssociateAddress) 用于将[弹性公网IP](https://cloud.tencent.com/document/product/213/1941)(简称 EIP)绑定到实例或弹性网卡的指定内网 IP 上。
|
// 本接口 (AssociateAddress) 用于将[弹性公网IP](https://cloud.tencent.com/document/product/213/1941)(简称 EIP)绑定到实例或弹性网卡的指定内网 IP 上。
|
||||||
// * 将 EIP 绑定到实例上,其本质是将 EIP 绑定到实例上主网卡的主内网 IP 上。
|
// * 将 EIP 绑定到实例(CVM)上,其本质是将 EIP 绑定到实例上主网卡的主内网 IP 上。
|
||||||
// * 将 EIP 绑定到主网卡的主内网IP上,绑定过程会把其上绑定的普通公网 IP 自动解绑并释放。
|
// * 将 EIP 绑定到主网卡的主内网IP上,绑定过程会把其上绑定的普通公网 IP 自动解绑并释放。
|
||||||
// * 如果指定网卡的内网 IP 已经绑定了 EIP,则必须先解绑该 EIP,才能再绑定新的。
|
// * 将 EIP 绑定到指定网卡的内网 IP上(非主网卡的主内网IP),则必须先解绑该 EIP,才能再绑定新的。
|
||||||
|
// * 将 EIP 绑定到NAT网关,请使用接口[EipBindNatGateway](https://cloud.tencent.com/document/product/215/4093)
|
||||||
// * EIP 如果欠费或被封堵,则不能被绑定。
|
// * EIP 如果欠费或被封堵,则不能被绑定。
|
||||||
// * 只有状态为 UNBIND 的 EIP 才能够被绑定。
|
// * 只有状态为 UNBIND 的 EIP 才能够被绑定。
|
||||||
func (c *Client) AssociateAddress(request *AssociateAddressRequest) (response *AssociateAddressResponse, err error) {
|
func (c *Client) AssociateAddress(request *AssociateAddressRequest) (response *AssociateAddressResponse, err error) {
|
||||||
|
@ -276,7 +388,7 @@ func NewCreateAddressTemplateResponse() (response *CreateAddressTemplateResponse
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// 创建IP地址模版
|
// 本接口(CreateAddressTemplate)用于创建IP地址模版
|
||||||
func (c *Client) CreateAddressTemplate(request *CreateAddressTemplateRequest) (response *CreateAddressTemplateResponse, err error) {
|
func (c *Client) CreateAddressTemplate(request *CreateAddressTemplateRequest) (response *CreateAddressTemplateResponse, err error) {
|
||||||
if request == nil {
|
if request == nil {
|
||||||
request = NewCreateAddressTemplateRequest()
|
request = NewCreateAddressTemplateRequest()
|
||||||
|
@ -301,7 +413,7 @@ func NewCreateAddressTemplateGroupResponse() (response *CreateAddressTemplateGro
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// 创建IP地址模版集合
|
// 本接口(CreateAddressTemplateGroup)用于创建IP地址模版集合
|
||||||
func (c *Client) CreateAddressTemplateGroup(request *CreateAddressTemplateGroupRequest) (response *CreateAddressTemplateGroupResponse, err error) {
|
func (c *Client) CreateAddressTemplateGroup(request *CreateAddressTemplateGroupRequest) (response *CreateAddressTemplateGroupResponse, err error) {
|
||||||
if request == nil {
|
if request == nil {
|
||||||
request = NewCreateAddressTemplateGroupRequest()
|
request = NewCreateAddressTemplateGroupRequest()
|
||||||
|
@ -470,6 +582,31 @@ func (c *Client) CreateDirectConnectGatewayCcnRoutes(request *CreateDirectConnec
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func NewCreateFlowLogRequest() (request *CreateFlowLogRequest) {
|
||||||
|
request = &CreateFlowLogRequest{
|
||||||
|
BaseRequest: &tchttp.BaseRequest{},
|
||||||
|
}
|
||||||
|
request.Init().WithApiInfo("vpc", APIVersion, "CreateFlowLog")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewCreateFlowLogResponse() (response *CreateFlowLogResponse) {
|
||||||
|
response = &CreateFlowLogResponse{
|
||||||
|
BaseResponse: &tchttp.BaseResponse{},
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// 本接口(CreateFlowLog)用于创建流日志
|
||||||
|
func (c *Client) CreateFlowLog(request *CreateFlowLogRequest) (response *CreateFlowLogResponse, err error) {
|
||||||
|
if request == nil {
|
||||||
|
request = NewCreateFlowLogRequest()
|
||||||
|
}
|
||||||
|
response = NewCreateFlowLogResponse()
|
||||||
|
err = c.Send(request, response)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
func NewCreateHaVipRequest() (request *CreateHaVipRequest) {
|
func NewCreateHaVipRequest() (request *CreateHaVipRequest) {
|
||||||
request = &CreateHaVipRequest{
|
request = &CreateHaVipRequest{
|
||||||
BaseRequest: &tchttp.BaseRequest{},
|
BaseRequest: &tchttp.BaseRequest{},
|
||||||
|
@ -495,6 +632,32 @@ func (c *Client) CreateHaVip(request *CreateHaVipRequest) (response *CreateHaVip
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func NewCreateIp6TranslatorsRequest() (request *CreateIp6TranslatorsRequest) {
|
||||||
|
request = &CreateIp6TranslatorsRequest{
|
||||||
|
BaseRequest: &tchttp.BaseRequest{},
|
||||||
|
}
|
||||||
|
request.Init().WithApiInfo("vpc", APIVersion, "CreateIp6Translators")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewCreateIp6TranslatorsResponse() (response *CreateIp6TranslatorsResponse) {
|
||||||
|
response = &CreateIp6TranslatorsResponse{
|
||||||
|
BaseResponse: &tchttp.BaseResponse{},
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// 1. 该接口用于创建IPV6转换IPV4实例,支持批量
|
||||||
|
// 2. 同一个账户在在一个地域最多允许创建10个转换实例
|
||||||
|
func (c *Client) CreateIp6Translators(request *CreateIp6TranslatorsRequest) (response *CreateIp6TranslatorsResponse, err error) {
|
||||||
|
if request == nil {
|
||||||
|
request = NewCreateIp6TranslatorsRequest()
|
||||||
|
}
|
||||||
|
response = NewCreateIp6TranslatorsResponse()
|
||||||
|
err = c.Send(request, response)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
func NewCreateNetworkInterfaceRequest() (request *CreateNetworkInterfaceRequest) {
|
func NewCreateNetworkInterfaceRequest() (request *CreateNetworkInterfaceRequest) {
|
||||||
request = &CreateNetworkInterfaceRequest{
|
request = &CreateNetworkInterfaceRequest{
|
||||||
BaseRequest: &tchttp.BaseRequest{},
|
BaseRequest: &tchttp.BaseRequest{},
|
||||||
|
@ -624,7 +787,7 @@ func NewCreateSecurityGroupPoliciesResponse() (response *CreateSecurityGroupPoli
|
||||||
// * Protocol字段支持输入TCP, UDP, ICMP, GRE, ALL。
|
// * Protocol字段支持输入TCP, UDP, ICMP, GRE, ALL。
|
||||||
// * CidrBlock字段允许输入符合cidr格式标准的任意字符串。(展开)在基础网络中,如果CidrBlock包含您的账户内的云服务器之外的设备在腾讯云的内网IP,并不代表此规则允许您访问这些设备,租户之间网络隔离规则优先于安全组中的内网规则。
|
// * CidrBlock字段允许输入符合cidr格式标准的任意字符串。(展开)在基础网络中,如果CidrBlock包含您的账户内的云服务器之外的设备在腾讯云的内网IP,并不代表此规则允许您访问这些设备,租户之间网络隔离规则优先于安全组中的内网规则。
|
||||||
// * SecurityGroupId字段允许输入与待修改的安全组位于相同项目中的安全组ID,包括这个安全组ID本身,代表安全组下所有云服务器的内网IP。使用这个字段时,这条规则用来匹配网络报文的过程中会随着被使用的这个ID所关联的云服务器变化而变化,不需要重新修改。
|
// * SecurityGroupId字段允许输入与待修改的安全组位于相同项目中的安全组ID,包括这个安全组ID本身,代表安全组下所有云服务器的内网IP。使用这个字段时,这条规则用来匹配网络报文的过程中会随着被使用的这个ID所关联的云服务器变化而变化,不需要重新修改。
|
||||||
// * Port字段允许输入一个单独端口号,或者用减号分隔的两个端口号代表端口范围,例如80或8000-8010。只有当Protocol字段是TCP或UDP时,Port字段才被接受。
|
// * Port字段允许输入一个单独端口号,或者用减号分隔的两个端口号代表端口范围,例如80或8000-8010。只有当Protocol字段是TCP或UDP时,Port字段才被接受,即Protocol字段不是TCP或UDP时,Protocol和Port排他关系,不允许同时输入,否则会接口报错。
|
||||||
// * Action字段只允许输入ACCEPT或DROP。
|
// * Action字段只允许输入ACCEPT或DROP。
|
||||||
// * CidrBlock, SecurityGroupId, AddressTemplate三者是排他关系,不允许同时输入,Protocol + Port和ServiceTemplate二者是排他关系,不允许同时输入。
|
// * CidrBlock, SecurityGroupId, AddressTemplate三者是排他关系,不允许同时输入,Protocol + Port和ServiceTemplate二者是排他关系,不允许同时输入。
|
||||||
// * 一次请求中只能创建单个方向的规则, 如果需要指定索引(PolicyIndex)参数, 多条规则的索引必须一致。
|
// * 一次请求中只能创建单个方向的规则, 如果需要指定索引(PolicyIndex)参数, 多条规则的索引必须一致。
|
||||||
|
@ -652,7 +815,7 @@ func NewCreateServiceTemplateResponse() (response *CreateServiceTemplateResponse
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// 创建协议端口模板
|
// 本接口(CreateServiceTemplate)用于创建协议端口模板
|
||||||
func (c *Client) CreateServiceTemplate(request *CreateServiceTemplateRequest) (response *CreateServiceTemplateResponse, err error) {
|
func (c *Client) CreateServiceTemplate(request *CreateServiceTemplateRequest) (response *CreateServiceTemplateResponse, err error) {
|
||||||
if request == nil {
|
if request == nil {
|
||||||
request = NewCreateServiceTemplateRequest()
|
request = NewCreateServiceTemplateRequest()
|
||||||
|
@ -677,7 +840,7 @@ func NewCreateServiceTemplateGroupResponse() (response *CreateServiceTemplateGro
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// 创建协议端口模板集合
|
// 本接口(CreateServiceTemplateGroup)用于创建协议端口模板集合
|
||||||
func (c *Client) CreateServiceTemplateGroup(request *CreateServiceTemplateGroupRequest) (response *CreateServiceTemplateGroupResponse, err error) {
|
func (c *Client) CreateServiceTemplateGroup(request *CreateServiceTemplateGroupRequest) (response *CreateServiceTemplateGroupResponse, err error) {
|
||||||
if request == nil {
|
if request == nil {
|
||||||
request = NewCreateServiceTemplateGroupRequest()
|
request = NewCreateServiceTemplateGroupRequest()
|
||||||
|
@ -717,6 +880,36 @@ func (c *Client) CreateSubnet(request *CreateSubnetRequest) (response *CreateSub
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func NewCreateSubnetsRequest() (request *CreateSubnetsRequest) {
|
||||||
|
request = &CreateSubnetsRequest{
|
||||||
|
BaseRequest: &tchttp.BaseRequest{},
|
||||||
|
}
|
||||||
|
request.Init().WithApiInfo("vpc", APIVersion, "CreateSubnets")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewCreateSubnetsResponse() (response *CreateSubnetsResponse) {
|
||||||
|
response = &CreateSubnetsResponse{
|
||||||
|
BaseResponse: &tchttp.BaseResponse{},
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// 本接口(CreateSubnets)用于批量创建子网。
|
||||||
|
// * 创建子网前必须创建好 VPC。
|
||||||
|
// * 子网创建成功后,子网网段不能修改。子网网段必须在VPC网段内,可以和VPC网段相同(VPC有且只有一个子网时),建议子网网段在VPC网段内,预留网段给其他子网使用。
|
||||||
|
// * 你可以创建的最小网段子网掩码为28(有16个IP地址),最大网段子网掩码为16(65,536个IP地址)。
|
||||||
|
// * 同一个VPC内,多个子网的网段不能重叠。
|
||||||
|
// * 子网创建后会自动关联到默认路由表。
|
||||||
|
func (c *Client) CreateSubnets(request *CreateSubnetsRequest) (response *CreateSubnetsResponse, err error) {
|
||||||
|
if request == nil {
|
||||||
|
request = NewCreateSubnetsRequest()
|
||||||
|
}
|
||||||
|
response = NewCreateSubnetsResponse()
|
||||||
|
err = c.Send(request, response)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
func NewCreateVpcRequest() (request *CreateVpcRequest) {
|
func NewCreateVpcRequest() (request *CreateVpcRequest) {
|
||||||
request = &CreateVpcRequest{
|
request = &CreateVpcRequest{
|
||||||
BaseRequest: &tchttp.BaseRequest{},
|
BaseRequest: &tchttp.BaseRequest{},
|
||||||
|
@ -784,7 +977,7 @@ func NewCreateVpnGatewayResponse() (response *CreateVpnGatewayResponse) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// 本接口(CreateVpnGateways)用于创建VPN网关。
|
// 本接口(CreateVpnGateway)用于创建VPN网关。
|
||||||
func (c *Client) CreateVpnGateway(request *CreateVpnGatewayRequest) (response *CreateVpnGatewayResponse, err error) {
|
func (c *Client) CreateVpnGateway(request *CreateVpnGatewayRequest) (response *CreateVpnGatewayResponse, err error) {
|
||||||
if request == nil {
|
if request == nil {
|
||||||
request = NewCreateVpnGatewayRequest()
|
request = NewCreateVpnGatewayRequest()
|
||||||
|
@ -809,7 +1002,7 @@ func NewDeleteAddressTemplateResponse() (response *DeleteAddressTemplateResponse
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// 删除IP地址模板
|
// 本接口(DeleteAddressTemplate)用于删除IP地址模板
|
||||||
func (c *Client) DeleteAddressTemplate(request *DeleteAddressTemplateRequest) (response *DeleteAddressTemplateResponse, err error) {
|
func (c *Client) DeleteAddressTemplate(request *DeleteAddressTemplateRequest) (response *DeleteAddressTemplateResponse, err error) {
|
||||||
if request == nil {
|
if request == nil {
|
||||||
request = NewDeleteAddressTemplateRequest()
|
request = NewDeleteAddressTemplateRequest()
|
||||||
|
@ -834,7 +1027,7 @@ func NewDeleteAddressTemplateGroupResponse() (response *DeleteAddressTemplateGro
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// 删除IP地址模板集合
|
// 本接口(DeleteAddressTemplateGroup)用于删除IP地址模板集合
|
||||||
func (c *Client) DeleteAddressTemplateGroup(request *DeleteAddressTemplateGroupRequest) (response *DeleteAddressTemplateGroupResponse, err error) {
|
func (c *Client) DeleteAddressTemplateGroup(request *DeleteAddressTemplateGroupRequest) (response *DeleteAddressTemplateGroupResponse, err error) {
|
||||||
if request == nil {
|
if request == nil {
|
||||||
request = NewDeleteAddressTemplateGroupRequest()
|
request = NewDeleteAddressTemplateGroupRequest()
|
||||||
|
@ -974,6 +1167,31 @@ func (c *Client) DeleteDirectConnectGatewayCcnRoutes(request *DeleteDirectConnec
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func NewDeleteFlowLogRequest() (request *DeleteFlowLogRequest) {
|
||||||
|
request = &DeleteFlowLogRequest{
|
||||||
|
BaseRequest: &tchttp.BaseRequest{},
|
||||||
|
}
|
||||||
|
request.Init().WithApiInfo("vpc", APIVersion, "DeleteFlowLog")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewDeleteFlowLogResponse() (response *DeleteFlowLogResponse) {
|
||||||
|
response = &DeleteFlowLogResponse{
|
||||||
|
BaseResponse: &tchttp.BaseResponse{},
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// 本接口(DeleteFlowLog)用于删除流日志
|
||||||
|
func (c *Client) DeleteFlowLog(request *DeleteFlowLogRequest) (response *DeleteFlowLogResponse, err error) {
|
||||||
|
if request == nil {
|
||||||
|
request = NewDeleteFlowLogRequest()
|
||||||
|
}
|
||||||
|
response = NewDeleteFlowLogResponse()
|
||||||
|
err = c.Send(request, response)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
func NewDeleteHaVipRequest() (request *DeleteHaVipRequest) {
|
func NewDeleteHaVipRequest() (request *DeleteHaVipRequest) {
|
||||||
request = &DeleteHaVipRequest{
|
request = &DeleteHaVipRequest{
|
||||||
BaseRequest: &tchttp.BaseRequest{},
|
BaseRequest: &tchttp.BaseRequest{},
|
||||||
|
@ -1000,6 +1218,32 @@ func (c *Client) DeleteHaVip(request *DeleteHaVipRequest) (response *DeleteHaVip
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func NewDeleteIp6TranslatorsRequest() (request *DeleteIp6TranslatorsRequest) {
|
||||||
|
request = &DeleteIp6TranslatorsRequest{
|
||||||
|
BaseRequest: &tchttp.BaseRequest{},
|
||||||
|
}
|
||||||
|
request.Init().WithApiInfo("vpc", APIVersion, "DeleteIp6Translators")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewDeleteIp6TranslatorsResponse() (response *DeleteIp6TranslatorsResponse) {
|
||||||
|
response = &DeleteIp6TranslatorsResponse{
|
||||||
|
BaseResponse: &tchttp.BaseResponse{},
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// 1. 该接口用于释放IPV6转换实例,支持批量。
|
||||||
|
// 2. 如果IPV6转换实例建立有转换规则,会一并删除。
|
||||||
|
func (c *Client) DeleteIp6Translators(request *DeleteIp6TranslatorsRequest) (response *DeleteIp6TranslatorsResponse, err error) {
|
||||||
|
if request == nil {
|
||||||
|
request = NewDeleteIp6TranslatorsRequest()
|
||||||
|
}
|
||||||
|
response = NewDeleteIp6TranslatorsResponse()
|
||||||
|
err = c.Send(request, response)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
func NewDeleteNetworkInterfaceRequest() (request *DeleteNetworkInterfaceRequest) {
|
func NewDeleteNetworkInterfaceRequest() (request *DeleteNetworkInterfaceRequest) {
|
||||||
request = &DeleteNetworkInterfaceRequest{
|
request = &DeleteNetworkInterfaceRequest{
|
||||||
BaseRequest: &tchttp.BaseRequest{},
|
BaseRequest: &tchttp.BaseRequest{},
|
||||||
|
@ -1146,7 +1390,7 @@ func NewDeleteServiceTemplateResponse() (response *DeleteServiceTemplateResponse
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// 删除协议端口模板
|
// 本接口(DeleteServiceTemplate)用于删除协议端口模板
|
||||||
func (c *Client) DeleteServiceTemplate(request *DeleteServiceTemplateRequest) (response *DeleteServiceTemplateResponse, err error) {
|
func (c *Client) DeleteServiceTemplate(request *DeleteServiceTemplateRequest) (response *DeleteServiceTemplateResponse, err error) {
|
||||||
if request == nil {
|
if request == nil {
|
||||||
request = NewDeleteServiceTemplateRequest()
|
request = NewDeleteServiceTemplateRequest()
|
||||||
|
@ -1171,7 +1415,7 @@ func NewDeleteServiceTemplateGroupResponse() (response *DeleteServiceTemplateGro
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// 删除协议端口模板集合
|
// 本接口(DeleteServiceTemplateGroup)用于删除协议端口模板集合
|
||||||
func (c *Client) DeleteServiceTemplateGroup(request *DeleteServiceTemplateGroupRequest) (response *DeleteServiceTemplateGroupResponse, err error) {
|
func (c *Client) DeleteServiceTemplateGroup(request *DeleteServiceTemplateGroupRequest) (response *DeleteServiceTemplateGroupResponse, err error) {
|
||||||
if request == nil {
|
if request == nil {
|
||||||
request = NewDeleteServiceTemplateGroupRequest()
|
request = NewDeleteServiceTemplateGroupRequest()
|
||||||
|
@ -1349,7 +1593,7 @@ func NewDescribeAddressTemplateGroupsResponse() (response *DescribeAddressTempla
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// 查询IP地址模板集合
|
// 本接口(DescribeAddressTemplateGroups)用于查询IP地址模板集合
|
||||||
func (c *Client) DescribeAddressTemplateGroups(request *DescribeAddressTemplateGroupsRequest) (response *DescribeAddressTemplateGroupsResponse, err error) {
|
func (c *Client) DescribeAddressTemplateGroups(request *DescribeAddressTemplateGroupsRequest) (response *DescribeAddressTemplateGroupsResponse, err error) {
|
||||||
if request == nil {
|
if request == nil {
|
||||||
request = NewDescribeAddressTemplateGroupsRequest()
|
request = NewDescribeAddressTemplateGroupsRequest()
|
||||||
|
@ -1374,7 +1618,7 @@ func NewDescribeAddressTemplatesResponse() (response *DescribeAddressTemplatesRe
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// 查询IP地址模板
|
// 本接口(DescribeAddressTemplates)用于查询IP地址模板
|
||||||
func (c *Client) DescribeAddressTemplates(request *DescribeAddressTemplatesRequest) (response *DescribeAddressTemplatesResponse, err error) {
|
func (c *Client) DescribeAddressTemplates(request *DescribeAddressTemplatesRequest) (response *DescribeAddressTemplatesResponse, err error) {
|
||||||
if request == nil {
|
if request == nil {
|
||||||
request = NewDescribeAddressTemplatesRequest()
|
request = NewDescribeAddressTemplatesRequest()
|
||||||
|
@ -1685,6 +1929,83 @@ func (c *Client) DescribeDirectConnectGateways(request *DescribeDirectConnectGat
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func NewDescribeFlowLogRequest() (request *DescribeFlowLogRequest) {
|
||||||
|
request = &DescribeFlowLogRequest{
|
||||||
|
BaseRequest: &tchttp.BaseRequest{},
|
||||||
|
}
|
||||||
|
request.Init().WithApiInfo("vpc", APIVersion, "DescribeFlowLog")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewDescribeFlowLogResponse() (response *DescribeFlowLogResponse) {
|
||||||
|
response = &DescribeFlowLogResponse{
|
||||||
|
BaseResponse: &tchttp.BaseResponse{},
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// 本接口(DescribeFlowLog)用于查询流日志实例信息
|
||||||
|
func (c *Client) DescribeFlowLog(request *DescribeFlowLogRequest) (response *DescribeFlowLogResponse, err error) {
|
||||||
|
if request == nil {
|
||||||
|
request = NewDescribeFlowLogRequest()
|
||||||
|
}
|
||||||
|
response = NewDescribeFlowLogResponse()
|
||||||
|
err = c.Send(request, response)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewDescribeFlowLogsRequest() (request *DescribeFlowLogsRequest) {
|
||||||
|
request = &DescribeFlowLogsRequest{
|
||||||
|
BaseRequest: &tchttp.BaseRequest{},
|
||||||
|
}
|
||||||
|
request.Init().WithApiInfo("vpc", APIVersion, "DescribeFlowLogs")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewDescribeFlowLogsResponse() (response *DescribeFlowLogsResponse) {
|
||||||
|
response = &DescribeFlowLogsResponse{
|
||||||
|
BaseResponse: &tchttp.BaseResponse{},
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// 本接口(DescribeFlowLogs)用于查询获取流日志集合
|
||||||
|
func (c *Client) DescribeFlowLogs(request *DescribeFlowLogsRequest) (response *DescribeFlowLogsResponse, err error) {
|
||||||
|
if request == nil {
|
||||||
|
request = NewDescribeFlowLogsRequest()
|
||||||
|
}
|
||||||
|
response = NewDescribeFlowLogsResponse()
|
||||||
|
err = c.Send(request, response)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewDescribeGatewayFlowMonitorDetailRequest() (request *DescribeGatewayFlowMonitorDetailRequest) {
|
||||||
|
request = &DescribeGatewayFlowMonitorDetailRequest{
|
||||||
|
BaseRequest: &tchttp.BaseRequest{},
|
||||||
|
}
|
||||||
|
request.Init().WithApiInfo("vpc", APIVersion, "DescribeGatewayFlowMonitorDetail")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewDescribeGatewayFlowMonitorDetailResponse() (response *DescribeGatewayFlowMonitorDetailResponse) {
|
||||||
|
response = &DescribeGatewayFlowMonitorDetailResponse{
|
||||||
|
BaseResponse: &tchttp.BaseResponse{},
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// 本接口(DescribeGatewayFlowMonitorDetail)用于查询网关流量监控明细。
|
||||||
|
// * 只支持单个网关实例查询。即入参 `VpnId` `DirectConnectGatewayId` `PeeringConnectionId` `NatId` 最多只支持传一个,且必须传一个。
|
||||||
|
// * 如果网关有流量,但调用本接口没有返回数据,请在控制台对应网关详情页确认是否开启网关流量监控。
|
||||||
|
func (c *Client) DescribeGatewayFlowMonitorDetail(request *DescribeGatewayFlowMonitorDetailRequest) (response *DescribeGatewayFlowMonitorDetailResponse, err error) {
|
||||||
|
if request == nil {
|
||||||
|
request = NewDescribeGatewayFlowMonitorDetailRequest()
|
||||||
|
}
|
||||||
|
response = NewDescribeGatewayFlowMonitorDetailResponse()
|
||||||
|
err = c.Send(request, response)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
func NewDescribeHaVipsRequest() (request *DescribeHaVipsRequest) {
|
func NewDescribeHaVipsRequest() (request *DescribeHaVipsRequest) {
|
||||||
request = &DescribeHaVipsRequest{
|
request = &DescribeHaVipsRequest{
|
||||||
BaseRequest: &tchttp.BaseRequest{},
|
BaseRequest: &tchttp.BaseRequest{},
|
||||||
|
@ -1710,6 +2031,57 @@ func (c *Client) DescribeHaVips(request *DescribeHaVipsRequest) (response *Descr
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func NewDescribeIp6TranslatorQuotaRequest() (request *DescribeIp6TranslatorQuotaRequest) {
|
||||||
|
request = &DescribeIp6TranslatorQuotaRequest{
|
||||||
|
BaseRequest: &tchttp.BaseRequest{},
|
||||||
|
}
|
||||||
|
request.Init().WithApiInfo("vpc", APIVersion, "DescribeIp6TranslatorQuota")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewDescribeIp6TranslatorQuotaResponse() (response *DescribeIp6TranslatorQuotaResponse) {
|
||||||
|
response = &DescribeIp6TranslatorQuotaResponse{
|
||||||
|
BaseResponse: &tchttp.BaseResponse{},
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询账户在指定地域IPV6转换实例和规则的配额
|
||||||
|
func (c *Client) DescribeIp6TranslatorQuota(request *DescribeIp6TranslatorQuotaRequest) (response *DescribeIp6TranslatorQuotaResponse, err error) {
|
||||||
|
if request == nil {
|
||||||
|
request = NewDescribeIp6TranslatorQuotaRequest()
|
||||||
|
}
|
||||||
|
response = NewDescribeIp6TranslatorQuotaResponse()
|
||||||
|
err = c.Send(request, response)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewDescribeIp6TranslatorsRequest() (request *DescribeIp6TranslatorsRequest) {
|
||||||
|
request = &DescribeIp6TranslatorsRequest{
|
||||||
|
BaseRequest: &tchttp.BaseRequest{},
|
||||||
|
}
|
||||||
|
request.Init().WithApiInfo("vpc", APIVersion, "DescribeIp6Translators")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewDescribeIp6TranslatorsResponse() (response *DescribeIp6TranslatorsResponse) {
|
||||||
|
response = &DescribeIp6TranslatorsResponse{
|
||||||
|
BaseResponse: &tchttp.BaseResponse{},
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// 1. 该接口用于查询账户下的IPV6转换实例及其绑定的转换规则信息
|
||||||
|
// 2. 支持过滤查询
|
||||||
|
func (c *Client) DescribeIp6Translators(request *DescribeIp6TranslatorsRequest) (response *DescribeIp6TranslatorsResponse, err error) {
|
||||||
|
if request == nil {
|
||||||
|
request = NewDescribeIp6TranslatorsRequest()
|
||||||
|
}
|
||||||
|
response = NewDescribeIp6TranslatorsResponse()
|
||||||
|
err = c.Send(request, response)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
func NewDescribeNetworkInterfacesRequest() (request *DescribeNetworkInterfacesRequest) {
|
func NewDescribeNetworkInterfacesRequest() (request *DescribeNetworkInterfacesRequest) {
|
||||||
request = &DescribeNetworkInterfacesRequest{
|
request = &DescribeNetworkInterfacesRequest{
|
||||||
BaseRequest: &tchttp.BaseRequest{},
|
BaseRequest: &tchttp.BaseRequest{},
|
||||||
|
@ -1875,7 +2247,7 @@ func NewDescribeServiceTemplateGroupsResponse() (response *DescribeServiceTempla
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// 查询协议端口模板集合
|
// 本接口(DescribeServiceTemplateGroups)用于查询协议端口模板集合
|
||||||
func (c *Client) DescribeServiceTemplateGroups(request *DescribeServiceTemplateGroupsRequest) (response *DescribeServiceTemplateGroupsResponse, err error) {
|
func (c *Client) DescribeServiceTemplateGroups(request *DescribeServiceTemplateGroupsRequest) (response *DescribeServiceTemplateGroupsResponse, err error) {
|
||||||
if request == nil {
|
if request == nil {
|
||||||
request = NewDescribeServiceTemplateGroupsRequest()
|
request = NewDescribeServiceTemplateGroupsRequest()
|
||||||
|
@ -1900,7 +2272,7 @@ func NewDescribeServiceTemplatesResponse() (response *DescribeServiceTemplatesRe
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// 查询协议端口模板
|
// 本接口(DescribeServiceTemplates)用于查询协议端口模板
|
||||||
func (c *Client) DescribeServiceTemplates(request *DescribeServiceTemplatesRequest) (response *DescribeServiceTemplatesResponse, err error) {
|
func (c *Client) DescribeServiceTemplates(request *DescribeServiceTemplatesRequest) (response *DescribeServiceTemplatesResponse, err error) {
|
||||||
if request == nil {
|
if request == nil {
|
||||||
request = NewDescribeServiceTemplatesRequest()
|
request = NewDescribeServiceTemplatesRequest()
|
||||||
|
@ -1935,6 +2307,58 @@ func (c *Client) DescribeSubnets(request *DescribeSubnetsRequest) (response *Des
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func NewDescribeVpcIpv6AddressesRequest() (request *DescribeVpcIpv6AddressesRequest) {
|
||||||
|
request = &DescribeVpcIpv6AddressesRequest{
|
||||||
|
BaseRequest: &tchttp.BaseRequest{},
|
||||||
|
}
|
||||||
|
request.Init().WithApiInfo("vpc", APIVersion, "DescribeVpcIpv6Addresses")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewDescribeVpcIpv6AddressesResponse() (response *DescribeVpcIpv6AddressesResponse) {
|
||||||
|
response = &DescribeVpcIpv6AddressesResponse{
|
||||||
|
BaseResponse: &tchttp.BaseResponse{},
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// 本接口(DescribeVpcIpv6Addresses)用于查询 `VPC` `IPv6` 信息。
|
||||||
|
// 只能查询已使用的`IPv6`信息,当查询未使用的IP时,本接口不会报错,但不会出现在返回结果里。
|
||||||
|
func (c *Client) DescribeVpcIpv6Addresses(request *DescribeVpcIpv6AddressesRequest) (response *DescribeVpcIpv6AddressesResponse, err error) {
|
||||||
|
if request == nil {
|
||||||
|
request = NewDescribeVpcIpv6AddressesRequest()
|
||||||
|
}
|
||||||
|
response = NewDescribeVpcIpv6AddressesResponse()
|
||||||
|
err = c.Send(request, response)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewDescribeVpcPrivateIpAddressesRequest() (request *DescribeVpcPrivateIpAddressesRequest) {
|
||||||
|
request = &DescribeVpcPrivateIpAddressesRequest{
|
||||||
|
BaseRequest: &tchttp.BaseRequest{},
|
||||||
|
}
|
||||||
|
request.Init().WithApiInfo("vpc", APIVersion, "DescribeVpcPrivateIpAddresses")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewDescribeVpcPrivateIpAddressesResponse() (response *DescribeVpcPrivateIpAddressesResponse) {
|
||||||
|
response = &DescribeVpcPrivateIpAddressesResponse{
|
||||||
|
BaseResponse: &tchttp.BaseResponse{},
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// 本接口(DescribeVpcPrivateIpAddresses)用于查询VPC内网IP信息。<br />
|
||||||
|
// 只能查询已使用的IP信息,当查询未使用的IP时,本接口不会报错,但不会出现在返回结果里。
|
||||||
|
func (c *Client) DescribeVpcPrivateIpAddresses(request *DescribeVpcPrivateIpAddressesRequest) (response *DescribeVpcPrivateIpAddressesResponse, err error) {
|
||||||
|
if request == nil {
|
||||||
|
request = NewDescribeVpcPrivateIpAddressesRequest()
|
||||||
|
}
|
||||||
|
response = NewDescribeVpcPrivateIpAddressesResponse()
|
||||||
|
err = c.Send(request, response)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
func NewDescribeVpcsRequest() (request *DescribeVpcsRequest) {
|
func NewDescribeVpcsRequest() (request *DescribeVpcsRequest) {
|
||||||
request = &DescribeVpcsRequest{
|
request = &DescribeVpcsRequest{
|
||||||
BaseRequest: &tchttp.BaseRequest{},
|
BaseRequest: &tchttp.BaseRequest{},
|
||||||
|
@ -2152,6 +2576,8 @@ func NewDisassociateAddressResponse() (response *DisassociateAddressResponse) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// 本接口 (DisassociateAddress) 用于解绑[弹性公网IP](https://cloud.tencent.com/document/product/213/1941)(简称 EIP)。
|
// 本接口 (DisassociateAddress) 用于解绑[弹性公网IP](https://cloud.tencent.com/document/product/213/1941)(简称 EIP)。
|
||||||
|
// * 支持CVM实例,弹性网卡上的EIP解绑
|
||||||
|
// * 不支持NAT上的EIP解绑。NAT上的EIP解绑请参考[EipUnBindNatGateway](https://cloud.tencent.com/document/product/215/4092)
|
||||||
// * 只有状态为 BIND 和 BIND_ENI 的 EIP 才能进行解绑定操作。
|
// * 只有状态为 BIND 和 BIND_ENI 的 EIP 才能进行解绑定操作。
|
||||||
// * EIP 如果被封堵,则不能进行解绑定操作。
|
// * EIP 如果被封堵,则不能进行解绑定操作。
|
||||||
func (c *Client) DisassociateAddress(request *DisassociateAddressRequest) (response *DisassociateAddressResponse, err error) {
|
func (c *Client) DisassociateAddress(request *DisassociateAddressRequest) (response *DisassociateAddressResponse, err error) {
|
||||||
|
@ -2460,7 +2886,7 @@ func NewModifyAddressTemplateAttributeResponse() (response *ModifyAddressTemplat
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// 修改IP地址模板
|
// 本接口(ModifyAddressTemplateAttribute)用于修改IP地址模板
|
||||||
func (c *Client) ModifyAddressTemplateAttribute(request *ModifyAddressTemplateAttributeRequest) (response *ModifyAddressTemplateAttributeResponse, err error) {
|
func (c *Client) ModifyAddressTemplateAttribute(request *ModifyAddressTemplateAttributeRequest) (response *ModifyAddressTemplateAttributeResponse, err error) {
|
||||||
if request == nil {
|
if request == nil {
|
||||||
request = NewModifyAddressTemplateAttributeRequest()
|
request = NewModifyAddressTemplateAttributeRequest()
|
||||||
|
@ -2485,7 +2911,7 @@ func NewModifyAddressTemplateGroupAttributeResponse() (response *ModifyAddressTe
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// 修改IP地址模板集合
|
// 本接口(ModifyAddressTemplateGroupAttribute)用于修改IP地址模板集合
|
||||||
func (c *Client) ModifyAddressTemplateGroupAttribute(request *ModifyAddressTemplateGroupAttributeRequest) (response *ModifyAddressTemplateGroupAttributeResponse, err error) {
|
func (c *Client) ModifyAddressTemplateGroupAttribute(request *ModifyAddressTemplateGroupAttributeRequest) (response *ModifyAddressTemplateGroupAttributeResponse, err error) {
|
||||||
if request == nil {
|
if request == nil {
|
||||||
request = NewModifyAddressTemplateGroupAttributeRequest()
|
request = NewModifyAddressTemplateGroupAttributeRequest()
|
||||||
|
@ -2510,7 +2936,7 @@ func NewModifyAddressesBandwidthResponse() (response *ModifyAddressesBandwidthRe
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// 接口用于调整[弹性公网IP](https://cloud.tencent.com/document/product/213/1941)(简称EIP)带宽,包括后付费EIP, 预付费EIP和带宽包EIP
|
// 本接口(ModifyAddressesBandwidth)用于调整[弹性公网IP](https://cloud.tencent.com/document/product/213/1941)(简称EIP)带宽,包括后付费EIP, 预付费EIP和带宽包EIP
|
||||||
func (c *Client) ModifyAddressesBandwidth(request *ModifyAddressesBandwidthRequest) (response *ModifyAddressesBandwidthResponse, err error) {
|
func (c *Client) ModifyAddressesBandwidth(request *ModifyAddressesBandwidthRequest) (response *ModifyAddressesBandwidthResponse, err error) {
|
||||||
if request == nil {
|
if request == nil {
|
||||||
request = NewModifyAddressesBandwidthRequest()
|
request = NewModifyAddressesBandwidthRequest()
|
||||||
|
@ -2620,6 +3046,31 @@ func (c *Client) ModifyDirectConnectGatewayAttribute(request *ModifyDirectConnec
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func NewModifyFlowLogAttributeRequest() (request *ModifyFlowLogAttributeRequest) {
|
||||||
|
request = &ModifyFlowLogAttributeRequest{
|
||||||
|
BaseRequest: &tchttp.BaseRequest{},
|
||||||
|
}
|
||||||
|
request.Init().WithApiInfo("vpc", APIVersion, "ModifyFlowLogAttribute")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewModifyFlowLogAttributeResponse() (response *ModifyFlowLogAttributeResponse) {
|
||||||
|
response = &ModifyFlowLogAttributeResponse{
|
||||||
|
BaseResponse: &tchttp.BaseResponse{},
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// 本接口(ModifyFlowLogAttribute)用于修改流日志属性
|
||||||
|
func (c *Client) ModifyFlowLogAttribute(request *ModifyFlowLogAttributeRequest) (response *ModifyFlowLogAttributeResponse, err error) {
|
||||||
|
if request == nil {
|
||||||
|
request = NewModifyFlowLogAttributeRequest()
|
||||||
|
}
|
||||||
|
response = NewModifyFlowLogAttributeResponse()
|
||||||
|
err = c.Send(request, response)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
func NewModifyHaVipAttributeRequest() (request *ModifyHaVipAttributeRequest) {
|
func NewModifyHaVipAttributeRequest() (request *ModifyHaVipAttributeRequest) {
|
||||||
request = &ModifyHaVipAttributeRequest{
|
request = &ModifyHaVipAttributeRequest{
|
||||||
BaseRequest: &tchttp.BaseRequest{},
|
BaseRequest: &tchttp.BaseRequest{},
|
||||||
|
@ -2645,6 +3096,81 @@ func (c *Client) ModifyHaVipAttribute(request *ModifyHaVipAttributeRequest) (res
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func NewModifyIp6RuleRequest() (request *ModifyIp6RuleRequest) {
|
||||||
|
request = &ModifyIp6RuleRequest{
|
||||||
|
BaseRequest: &tchttp.BaseRequest{},
|
||||||
|
}
|
||||||
|
request.Init().WithApiInfo("vpc", APIVersion, "ModifyIp6Rule")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewModifyIp6RuleResponse() (response *ModifyIp6RuleResponse) {
|
||||||
|
response = &ModifyIp6RuleResponse{
|
||||||
|
BaseResponse: &tchttp.BaseResponse{},
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// 该接口用于修改IPV6转换规则,当前仅支持修改转换规则名称,IPV4地址和IPV4端口号
|
||||||
|
func (c *Client) ModifyIp6Rule(request *ModifyIp6RuleRequest) (response *ModifyIp6RuleResponse, err error) {
|
||||||
|
if request == nil {
|
||||||
|
request = NewModifyIp6RuleRequest()
|
||||||
|
}
|
||||||
|
response = NewModifyIp6RuleResponse()
|
||||||
|
err = c.Send(request, response)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewModifyIp6TranslatorRequest() (request *ModifyIp6TranslatorRequest) {
|
||||||
|
request = &ModifyIp6TranslatorRequest{
|
||||||
|
BaseRequest: &tchttp.BaseRequest{},
|
||||||
|
}
|
||||||
|
request.Init().WithApiInfo("vpc", APIVersion, "ModifyIp6Translator")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewModifyIp6TranslatorResponse() (response *ModifyIp6TranslatorResponse) {
|
||||||
|
response = &ModifyIp6TranslatorResponse{
|
||||||
|
BaseResponse: &tchttp.BaseResponse{},
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// 该接口用于修改IP6转换实例属性,当前仅支持修改实例名称。
|
||||||
|
func (c *Client) ModifyIp6Translator(request *ModifyIp6TranslatorRequest) (response *ModifyIp6TranslatorResponse, err error) {
|
||||||
|
if request == nil {
|
||||||
|
request = NewModifyIp6TranslatorRequest()
|
||||||
|
}
|
||||||
|
response = NewModifyIp6TranslatorResponse()
|
||||||
|
err = c.Send(request, response)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewModifyIpv6AddressesAttributeRequest() (request *ModifyIpv6AddressesAttributeRequest) {
|
||||||
|
request = &ModifyIpv6AddressesAttributeRequest{
|
||||||
|
BaseRequest: &tchttp.BaseRequest{},
|
||||||
|
}
|
||||||
|
request.Init().WithApiInfo("vpc", APIVersion, "ModifyIpv6AddressesAttribute")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewModifyIpv6AddressesAttributeResponse() (response *ModifyIpv6AddressesAttributeResponse) {
|
||||||
|
response = &ModifyIpv6AddressesAttributeResponse{
|
||||||
|
BaseResponse: &tchttp.BaseResponse{},
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// 本接口(ModifyIpv6AddressesAttribute)用于修改弹性网卡内网IPv6地址属性。
|
||||||
|
func (c *Client) ModifyIpv6AddressesAttribute(request *ModifyIpv6AddressesAttributeRequest) (response *ModifyIpv6AddressesAttributeResponse, err error) {
|
||||||
|
if request == nil {
|
||||||
|
request = NewModifyIpv6AddressesAttributeRequest()
|
||||||
|
}
|
||||||
|
response = NewModifyIpv6AddressesAttributeResponse()
|
||||||
|
err = c.Send(request, response)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
func NewModifyNetworkInterfaceAttributeRequest() (request *ModifyNetworkInterfaceAttributeRequest) {
|
func NewModifyNetworkInterfaceAttributeRequest() (request *ModifyNetworkInterfaceAttributeRequest) {
|
||||||
request = &ModifyNetworkInterfaceAttributeRequest{
|
request = &ModifyNetworkInterfaceAttributeRequest{
|
||||||
BaseRequest: &tchttp.BaseRequest{},
|
BaseRequest: &tchttp.BaseRequest{},
|
||||||
|
@ -2794,7 +3320,7 @@ func NewModifyServiceTemplateAttributeResponse() (response *ModifyServiceTemplat
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// 修改协议端口模板
|
// 本接口(ModifyServiceTemplateAttribute)用于修改协议端口模板
|
||||||
func (c *Client) ModifyServiceTemplateAttribute(request *ModifyServiceTemplateAttributeRequest) (response *ModifyServiceTemplateAttributeResponse, err error) {
|
func (c *Client) ModifyServiceTemplateAttribute(request *ModifyServiceTemplateAttributeRequest) (response *ModifyServiceTemplateAttributeResponse, err error) {
|
||||||
if request == nil {
|
if request == nil {
|
||||||
request = NewModifyServiceTemplateAttributeRequest()
|
request = NewModifyServiceTemplateAttributeRequest()
|
||||||
|
@ -3006,6 +3532,32 @@ func (c *Client) RemoveBandwidthPackageResources(request *RemoveBandwidthPackage
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func NewRemoveIp6RulesRequest() (request *RemoveIp6RulesRequest) {
|
||||||
|
request = &RemoveIp6RulesRequest{
|
||||||
|
BaseRequest: &tchttp.BaseRequest{},
|
||||||
|
}
|
||||||
|
request.Init().WithApiInfo("vpc", APIVersion, "RemoveIp6Rules")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewRemoveIp6RulesResponse() (response *RemoveIp6RulesResponse) {
|
||||||
|
response = &RemoveIp6RulesResponse{
|
||||||
|
BaseResponse: &tchttp.BaseResponse{},
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// 1. 该接口用于删除IPV6转换规则
|
||||||
|
// 2. 支持批量删除同一个转换实例下的多个转换规则
|
||||||
|
func (c *Client) RemoveIp6Rules(request *RemoveIp6RulesRequest) (response *RemoveIp6RulesResponse, err error) {
|
||||||
|
if request == nil {
|
||||||
|
request = NewRemoveIp6RulesRequest()
|
||||||
|
}
|
||||||
|
response = NewRemoveIp6RulesResponse()
|
||||||
|
err = c.Send(request, response)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
func NewRenewVpnGatewayRequest() (request *RenewVpnGatewayRequest) {
|
func NewRenewVpnGatewayRequest() (request *RenewVpnGatewayRequest) {
|
||||||
request = &RenewVpnGatewayRequest{
|
request = &RenewVpnGatewayRequest{
|
||||||
BaseRequest: &tchttp.BaseRequest{},
|
BaseRequest: &tchttp.BaseRequest{},
|
||||||
|
@ -3285,6 +3837,84 @@ func (c *Client) TransformAddress(request *TransformAddressRequest) (response *T
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func NewUnassignIpv6AddressesRequest() (request *UnassignIpv6AddressesRequest) {
|
||||||
|
request = &UnassignIpv6AddressesRequest{
|
||||||
|
BaseRequest: &tchttp.BaseRequest{},
|
||||||
|
}
|
||||||
|
request.Init().WithApiInfo("vpc", APIVersion, "UnassignIpv6Addresses")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewUnassignIpv6AddressesResponse() (response *UnassignIpv6AddressesResponse) {
|
||||||
|
response = &UnassignIpv6AddressesResponse{
|
||||||
|
BaseResponse: &tchttp.BaseResponse{},
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// 本接口(UnassignIpv6Addresses)用于释放弹性网卡`IPv6`地址。<br />
|
||||||
|
// 本接口是异步完成,如需查询异步任务执行结果,请使用本接口返回的`RequestId`轮询`QueryTask`接口。
|
||||||
|
func (c *Client) UnassignIpv6Addresses(request *UnassignIpv6AddressesRequest) (response *UnassignIpv6AddressesResponse, err error) {
|
||||||
|
if request == nil {
|
||||||
|
request = NewUnassignIpv6AddressesRequest()
|
||||||
|
}
|
||||||
|
response = NewUnassignIpv6AddressesResponse()
|
||||||
|
err = c.Send(request, response)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewUnassignIpv6CidrBlockRequest() (request *UnassignIpv6CidrBlockRequest) {
|
||||||
|
request = &UnassignIpv6CidrBlockRequest{
|
||||||
|
BaseRequest: &tchttp.BaseRequest{},
|
||||||
|
}
|
||||||
|
request.Init().WithApiInfo("vpc", APIVersion, "UnassignIpv6CidrBlock")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewUnassignIpv6CidrBlockResponse() (response *UnassignIpv6CidrBlockResponse) {
|
||||||
|
response = &UnassignIpv6CidrBlockResponse{
|
||||||
|
BaseResponse: &tchttp.BaseResponse{},
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// 本接口(UnassignIpv6CidrBlock)用于释放IPv6网段。<br />
|
||||||
|
// 网段如果还有IP占用且未回收,则网段无法释放。
|
||||||
|
func (c *Client) UnassignIpv6CidrBlock(request *UnassignIpv6CidrBlockRequest) (response *UnassignIpv6CidrBlockResponse, err error) {
|
||||||
|
if request == nil {
|
||||||
|
request = NewUnassignIpv6CidrBlockRequest()
|
||||||
|
}
|
||||||
|
response = NewUnassignIpv6CidrBlockResponse()
|
||||||
|
err = c.Send(request, response)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewUnassignIpv6SubnetCidrBlockRequest() (request *UnassignIpv6SubnetCidrBlockRequest) {
|
||||||
|
request = &UnassignIpv6SubnetCidrBlockRequest{
|
||||||
|
BaseRequest: &tchttp.BaseRequest{},
|
||||||
|
}
|
||||||
|
request.Init().WithApiInfo("vpc", APIVersion, "UnassignIpv6SubnetCidrBlock")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewUnassignIpv6SubnetCidrBlockResponse() (response *UnassignIpv6SubnetCidrBlockResponse) {
|
||||||
|
response = &UnassignIpv6SubnetCidrBlockResponse{
|
||||||
|
BaseResponse: &tchttp.BaseResponse{},
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// 本接口(UnassignIpv6SubnetCidrBlock)用于释放IPv6子网段。<br />
|
||||||
|
// 子网段如果还有IP占用且未回收,则子网段无法释放。
|
||||||
|
func (c *Client) UnassignIpv6SubnetCidrBlock(request *UnassignIpv6SubnetCidrBlockRequest) (response *UnassignIpv6SubnetCidrBlockResponse, err error) {
|
||||||
|
if request == nil {
|
||||||
|
request = NewUnassignIpv6SubnetCidrBlockRequest()
|
||||||
|
}
|
||||||
|
response = NewUnassignIpv6SubnetCidrBlockResponse()
|
||||||
|
err = c.Send(request, response)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
func NewUnassignPrivateIpAddressesRequest() (request *UnassignPrivateIpAddressesRequest) {
|
func NewUnassignPrivateIpAddressesRequest() (request *UnassignPrivateIpAddressesRequest) {
|
||||||
request = &UnassignPrivateIpAddressesRequest{
|
request = &UnassignPrivateIpAddressesRequest{
|
||||||
BaseRequest: &tchttp.BaseRequest{},
|
BaseRequest: &tchttp.BaseRequest{},
|
||||||
|
|
2954
vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/vpc/v20170312/models.go
generated
vendored
2954
vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/vpc/v20170312/models.go
generated
vendored
File diff suppressed because it is too large
Load Diff
|
@ -401,7 +401,7 @@ github.com/sirupsen/logrus
|
||||||
# github.com/stretchr/testify v1.3.0
|
# github.com/stretchr/testify v1.3.0
|
||||||
github.com/stretchr/testify/assert
|
github.com/stretchr/testify/assert
|
||||||
github.com/stretchr/testify/require
|
github.com/stretchr/testify/require
|
||||||
# github.com/tencentcloud/tencentcloud-sdk-go v0.0.0-20181220135002-f1744d40d346
|
# github.com/tencentcloud/tencentcloud-sdk-go v3.0.71+incompatible
|
||||||
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common
|
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common
|
||||||
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/errors
|
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/errors
|
||||||
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/profile
|
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/profile
|
||||||
|
|
|
@ -88,6 +88,16 @@ builder.
|
||||||
- LOCAL_BASIC: 50
|
- LOCAL_BASIC: 50
|
||||||
- Other: 50 ~ 1000 (need whitelist if > 50)
|
- Other: 50 ~ 1000 (need whitelist if > 50)
|
||||||
|
|
||||||
|
- `data_disks` (array of data disks) - Add one or more data disks to the instance before creating the
|
||||||
|
image. Note that if the source image has data disk snapshots, this argument will be ignored, and
|
||||||
|
the running instance will use source image data disk settings, in such case, `disk_type`
|
||||||
|
argument will be used as disk type for all data disks, and each data disk size will use the
|
||||||
|
origin value in source image.
|
||||||
|
The data disks allow for the following argument:
|
||||||
|
- `disk_type` - Type of the data disk. Valid choices: `CLOUD_BASIC`, `CLOUD_PREMIUM` and `CLOUD_SSD`.
|
||||||
|
- `disk_size` - Size of the data disk.
|
||||||
|
- `disk_snapshot_id` - Id of the snapshot for a data disk.
|
||||||
|
|
||||||
- `vpc_id` (string) - Specify vpc your cvm will be launched by.
|
- `vpc_id` (string) - Specify vpc your cvm will be launched by.
|
||||||
|
|
||||||
- `vpc_name` (string) - Specify vpc name you will create. if `vpc_id` is not set, packer will
|
- `vpc_name` (string) - Specify vpc name you will create. if `vpc_id` is not set, packer will
|
||||||
|
|
Loading…
Reference in New Issue