diff --git a/.changelog/3397.txt b/.changelog/3397.txt new file mode 100644 index 0000000000..ace062e8bf --- /dev/null +++ b/.changelog/3397.txt @@ -0,0 +1,3 @@ +```release-note:enhancement +resource/tencentcloud_private_dns_record: optmize create function code logic +``` diff --git a/go.mod b/go.mod index 18dd091e6b..1f9080c219 100644 --- a/go.mod +++ b/go.mod @@ -25,7 +25,7 @@ require ( github.com/mozillazg/go-httpheader v0.4.0 // indirect github.com/pkg/errors v0.9.1 github.com/stretchr/testify v1.8.2 - github.com/tencentcloud/tencentcloud-sdk-go-intl-en v3.0.1161+incompatible + github.com/tencentcloud/tencentcloud-sdk-go-intl-en v3.0.1214+incompatible github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/antiddos v1.0.799 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/api v1.0.285 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/apigateway v1.0.763 diff --git a/go.sum b/go.sum index b94d28ca41..e32991d78b 100644 --- a/go.sum +++ b/go.sum @@ -819,6 +819,10 @@ github.com/tdakkota/asciicheck v0.2.0 h1:o8jvnUANo0qXtnslk2d3nMKTFNlOnJjRrNcj0j9 github.com/tdakkota/asciicheck v0.2.0/go.mod h1:Qb7Y9EgjCLJGup51gDHFzbI08/gbGhL/UVhYIPWG2rg= github.com/tencentcloud/tencentcloud-sdk-go-intl-en v3.0.1161+incompatible h1:gGfe9oRCYZAWxd/xm0k8NaLmEssVPPl7pEwO022Arb4= github.com/tencentcloud/tencentcloud-sdk-go-intl-en v3.0.1161+incompatible/go.mod h1:72Wo6Gt6F8d8V+njrAmduVoT9QjPwCyXktpqCWr7PUc= +github.com/tencentcloud/tencentcloud-sdk-go-intl-en v3.0.1213+incompatible h1:3B0fKJW/Wh1NaXcdHibvhEUMH9iLrHI9VEkx3sSuVEY= +github.com/tencentcloud/tencentcloud-sdk-go-intl-en v3.0.1213+incompatible/go.mod h1:72Wo6Gt6F8d8V+njrAmduVoT9QjPwCyXktpqCWr7PUc= +github.com/tencentcloud/tencentcloud-sdk-go-intl-en v3.0.1214+incompatible h1:2pQ01ULc1d4WxNxwSR2qglNLA4xzB5ipffJ48fytTcg= +github.com/tencentcloud/tencentcloud-sdk-go-intl-en v3.0.1214+incompatible/go.mod h1:72Wo6Gt6F8d8V+njrAmduVoT9QjPwCyXktpqCWr7PUc= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/antiddos v1.0.799 h1:u49r1bGFDY0CeAF46iotNnLtc5yplPf9XXa7W7zJ4fE= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/antiddos v1.0.799/go.mod h1:JQa/Ess7Kkn/BuAugq0Tt5GJR7ZQAY47ypP9LjEn/DE= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/api v1.0.285 h1:gFmukRGLtYiXVBVvg/5DP/0fM1+dKpwDjT+khtDVLmc= diff --git a/tencentcloud/services/privatedns/resource_tc_private_dns_record.go b/tencentcloud/services/privatedns/resource_tc_private_dns_record.go index 40e621181a..639e27ab22 100644 --- a/tencentcloud/services/privatedns/resource_tc_private_dns_record.go +++ b/tencentcloud/services/privatedns/resource_tc_private_dns_record.go @@ -132,32 +132,8 @@ func resourceTencentCloudDPrivateDnsRecordCreate(d *schema.ResourceData, meta in recordId := *response.Response.RecordId // wait - err = resource.Retry(tccommon.ReadRetryTimeout, func() *resource.RetryError { - records, e := service.DescribePrivateDnsRecordByFilter(ctx, zoneId, nil) - if e != nil { - return tccommon.RetryError(e, PRIVATEDNS_CUSTOM_RETRY_SDK_ERROR...) - } - - if len(records) < 1 { - return resource.RetryableError(fmt.Errorf("[WARN]%s resource `PrivateDnsRecord` [%s] wait creating...\n", logId, zoneId)) - } - - var record *privatedns.PrivateZoneRecord - for _, item := range records { - if item.RecordId != nil && *item.RecordId == recordId { - record = item - } - } - - if record != nil { - return nil - } - - return resource.RetryableError(fmt.Errorf("[WARN]%s resource `PrivateDnsRecord` [%s] wait creating...\n", logId, recordId)) - }) - + _, err = service.DescribePrivateDnsRecordById(ctx, zoneId, recordId) if err != nil { - log.Printf("[CRITAL]%s describe PrivateDns record failed, reason:%s\n", logId, err.Error()) return err } diff --git a/tencentcloud/services/privatedns/service_tencentcloud_private_dns.go b/tencentcloud/services/privatedns/service_tencentcloud_private_dns.go index ba9831acf1..fc16fc862d 100644 --- a/tencentcloud/services/privatedns/service_tencentcloud_private_dns.go +++ b/tencentcloud/services/privatedns/service_tencentcloud_private_dns.go @@ -492,3 +492,52 @@ func (me *PrivatednsService) DescribePrivateDnsEndPointsByFilter(ctx context.Con return } + +func (me *PrivateDnsService) DescribePrivateDnsRecordById(ctx context.Context, zoneId, recordId string) (recordInfo *privatednsIntlv20201028.RecordInfo, errRet error) { + logId := tccommon.GetLogId(ctx) + + request := privatednsIntlv20201028.NewDescribeRecordRequest() + response := privatednsIntlv20201028.NewDescribeRecordResponse() + request.ZoneId = &zoneId + request.RecordId = &recordId + + defer func() { + if errRet != nil { + log.Printf("[CRITAL]%s api[%s] fail, request body [%s], reason[%s]\n", logId, request.GetAction(), request.ToJsonString(), errRet.Error()) + } + }() + + err := resource.Retry(tccommon.ReadRetryTimeout, func() *resource.RetryError { + ratelimit.Check(request.GetAction()) + result, e := me.client.UsePrivatednsIntlV20201028Client().DescribeRecord(request) + if e != nil { + return tccommon.RetryError(e, PRIVATEDNS_CUSTOM_RETRY_SDK_ERROR...) + } else { + log.Printf("[DEBUG]%s api[%s] success, request body [%s], response body [%s]\n", logId, request.GetAction(), request.ToJsonString(), result.ToJsonString()) + } + + if result == nil || result.Response == nil { + return resource.NonRetryableError(fmt.Errorf("Describe PrivateDns record %s failed, Response is nil.", recordId)) + } + + if result.Response.RecordInfo != nil && result.Response.RecordInfo.RecordId != nil { + respRecordId := *result.Response.RecordInfo.RecordId + if respRecordId == recordId { + response = result + return nil + } else { + return resource.NonRetryableError(fmt.Errorf("Describe PrivateDns record %s does not meet expectations, Response is %s.", recordId, respRecordId)) + } + } + + return resource.RetryableError(fmt.Errorf("Record %s is still creating...", recordId)) + }) + + if err != nil { + errRet = err + return + } + + recordInfo = response.Response.RecordInfo + return +} diff --git a/vendor/github.com/tencentcloud/tencentcloud-sdk-go-intl-en/tencentcloud/common/client.go b/vendor/github.com/tencentcloud/tencentcloud-sdk-go-intl-en/tencentcloud/common/client.go index c9a02df890..37b287ae19 100644 --- a/vendor/github.com/tencentcloud/tencentcloud-sdk-go-intl-en/tencentcloud/common/client.go +++ b/vendor/github.com/tencentcloud/tencentcloud-sdk-go-intl-en/tencentcloud/common/client.go @@ -24,22 +24,48 @@ const ( octetStream = "application/octet-stream" ) +// DefaultHttpClient is the default HTTP client used by the SDK. +// It can be overridden for custom HTTP client configurations. var DefaultHttpClient *http.Client +// Client encapsulates the core functionalities for interacting with Tencent Cloud services. type Client struct { - region string - httpClient *http.Client - httpProfile *profile.HttpProfile - profile *profile.ClientProfile - credential CredentialIface - signMethod string + // The region to which the client is connected. + region string + + // The HTTP client used for making requests. + httpClient *http.Client + + // The HTTP profile containing endpoint and method settings. + httpProfile *profile.HttpProfile + + // The client profile containing retry and sign method settings. + profile *profile.ClientProfile + + // The credential used for authentication. + credential CredentialIface + + // The signature method used for signing requests (e.g., HmacSHA256, HmacSHA1). + signMethod string + + // Indicates whether the payload should be unsigned. unsignedPayload bool - debug bool - rb *circuitBreaker - logger Logger - requestClient string + + // Enables debug logging. + debug bool + + // The circuit breaker for handling service unavailability. + rb *circuitBreaker + + // The logger for logging messages. + logger Logger + + // The client identifier sent in the request header. + requestClient string } +// Send sends the request and parses the response. +// It handles request completion, signature, and circuit breaking. func (c *Client) Send(request tchttp.Request, response tchttp.Response) (err error) { c.completeRequest(request) @@ -51,7 +77,7 @@ func (c *Client) Send(request tchttp.Request, response tchttp.Response) (err err } if request.GetSkipSign() { - // Some APIs can skip signature. + // Some APIs allow skipping the signature process. return c.sendWithoutSignature(request, response) } else if c.profile.DisableRegionBreaker == true || c.rb == nil { return c.sendWithSignature(request, response) @@ -60,6 +86,8 @@ func (c *Client) Send(request tchttp.Request, response tchttp.Response) (err err } } +// completeRequest fills in any missing request parameters with default values +// from the client's configuration. func (c *Client) completeRequest(request tchttp.Request) { if request.GetScheme() == "" { request.SetScheme(c.httpProfile.Scheme) @@ -81,6 +109,7 @@ func (c *Client) completeRequest(request tchttp.Request) { request.SetHttpMethod(c.httpProfile.ReqMethod) } + // Add idempotency key for unsafe retries. if c.profile.UnsafeRetryOnConnectionFailure { header := request.GetHeader() if header == nil { @@ -280,6 +309,8 @@ func (c *Client) sendWithSignatureV1(request tchttp.Request, response tchttp.Res } func (c *Client) sendWithSignatureV3(request tchttp.Request, response tchttp.Response) (err error) { + // Prepare the headers for the request, including essential information + // and the necessary components for Signature Version 3 authentication. headers := map[string]string{ "Host": request.GetDomain(), "X-TC-Action": request.GetAction(), @@ -288,18 +319,26 @@ func (c *Client) sendWithSignatureV3(request tchttp.Request, response tchttp.Res "X-TC-RequestClient": request.GetParams()["RequestClient"], "X-TC-Language": c.profile.Language, } + + // Include the region if specified. if c.region != "" { headers["X-TC-Region"] = c.region } + + // Retrieve the secret ID, secret key, and security token from the credentials. secId, secKey, token := c.credential.GetCredential() if token != "" { headers["X-TC-Token"] = token } + + // Set the Content-Type header based on the HTTP method. if request.GetHttpMethod() == "GET" { headers["Content-Type"] = "application/x-www-form-urlencoded" } else { headers["Content-Type"] = "application/json" } + + // Handle octet-stream (binary data) requests. isOctetStream := false cr := &tchttp.CommonRequest{} ok := false @@ -316,6 +355,8 @@ func (c *Client) sendWithSignatureV3(request tchttp.Request, response tchttp.Res } } + // Merge any additional headers from the request, but skip built-in headers + // to prevent them from being overridden. for k, v := range request.GetHeader() { switch k { case "X-TC-Action", "X-TC-Version", "X-TC-Timestamp", "X-TC-RequestClient", @@ -326,6 +367,8 @@ func (c *Client) sendWithSignatureV3(request tchttp.Request, response tchttp.Res } } + // Handle the case where the request content type is explicitly set to octet-stream, + // but it's not already handled as an OctetStream CommonRequest. if !isOctetStream && request.GetContentType() == octetStream { isOctetStream = true b, _ := json.Marshal(request) @@ -339,11 +382,17 @@ func (c *Client) sendWithSignatureV3(request tchttp.Request, response tchttp.Res headers["Content-Type"] = octetStream octetStreamBody = request.GetBody() } - // start signature v3 process + // --- Begin Signature Version 3 (TC3-HMAC-SHA256) Signing Process --- - // build canonical request string + // 1. Construct the Canonical Request + + // HTTP Method (e.g., "GET", "POST"). httpRequestMethod := request.GetHttpMethod() + + // Canonical URI (always "/"). canonicalURI := "/" + + // Canonical Query String (for GET requests). canonicalQueryString := "" if httpRequestMethod == "GET" { err = tchttp.ConstructParams(request) @@ -354,6 +403,7 @@ func (c *Client) sendWithSignatureV3(request tchttp.Request, response tchttp.Res for key, value := range request.GetParams() { params[key] = value } + // Remove standard parameters that are not part of the canonical query string. delete(params, "Action") delete(params, "Version") delete(params, "Nonce") @@ -362,8 +412,14 @@ func (c *Client) sendWithSignatureV3(request tchttp.Request, response tchttp.Res delete(params, "Timestamp") canonicalQueryString = tchttp.GetUrlQueriesEncoded(params) } + + // Canonical Headers (sorted and formatted). canonicalHeaders := fmt.Sprintf("content-type:%s\nhost:%s\n", headers["Content-Type"], headers["Host"]) + + // Signed Headers (list of headers included in the signature). signedHeaders := "content-type;host" + + // Request Payload (for POST requests). requestPayload := "" if httpRequestMethod == "POST" { if isOctetStream { @@ -377,6 +433,8 @@ func (c *Client) sendWithSignatureV3(request tchttp.Request, response tchttp.Res requestPayload = string(b) } } + + // Hashed Request Payload. hashedRequestPayload := "" if c.unsignedPayload { hashedRequestPayload = sha256hex("UNSIGNED-PAYLOAD") @@ -384,6 +442,8 @@ func (c *Client) sendWithSignatureV3(request tchttp.Request, response tchttp.Res } else { hashedRequestPayload = sha256hex(requestPayload) } + + // Construct the complete Canonical Request String. canonicalRequest := fmt.Sprintf("%s\n%s\n%s\n%s\n%s\n%s", httpRequestMethod, canonicalURI, @@ -393,15 +453,25 @@ func (c *Client) sendWithSignatureV3(request tchttp.Request, response tchttp.Res hashedRequestPayload) //log.Println("canonicalRequest:", canonicalRequest) - // build string to sign + // 2. Construct the String to Sign + + // Algorithm. algorithm := "TC3-HMAC-SHA256" + + // Request Timestamp. requestTimestamp := headers["X-TC-Timestamp"] + + // Credential Scope. 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()) + + // Hashed Canonical Request. hashedCanonicalRequest := sha256hex(canonicalRequest) + + // Construct the String to Sign. string2sign := fmt.Sprintf("%s\n%s\n%s\n%s", algorithm, requestTimestamp, @@ -409,14 +479,24 @@ func (c *Client) sendWithSignatureV3(request tchttp.Request, response tchttp.Res hashedCanonicalRequest) //log.Println("string2sign", string2sign) - // sign string + // 3. Calculate the Signature + + // Secret Date. secretDate := hmacsha256(date, "TC3"+secKey) + + // Secret Service. secretService := hmacsha256(request.GetService(), secretDate) + + // Secret Key. secretKey := hmacsha256("tc3_request", secretService) + + // Signature. signature := hex.EncodeToString([]byte(hmacsha256(string2sign, secretKey))) //log.Println("signature", signature) - // build authorization + // 4. Construct the Authorization Header + + // Authorization Header. authorization := fmt.Sprintf("%s Credential=%s/%s, SignedHeaders=%s, Signature=%s", algorithm, secId, @@ -425,25 +505,37 @@ func (c *Client) sendWithSignatureV3(request tchttp.Request, response tchttp.Res signature) //log.Println("authorization", authorization) + // Add the Authorization header to the request headers. headers["Authorization"] = authorization + + // --- End Signature Version 3 Signing Process --- + + // Construct the full URL. url := request.GetScheme() + "://" + request.GetDomain() + request.GetPath() if canonicalQueryString != "" { url = url + "?" + canonicalQueryString } + + // Create the HTTP request. httpRequest, err := http.NewRequest(httpRequestMethod, url, strings.NewReader(requestPayload)) if err != nil { return err } httpRequest = httpRequest.WithContext(request.GetContext()) + + // Set all the headers on the request. for k, v := range headers { httpRequest.Header[k] = []string{v} } + + // Send the HTTP request with rate limit retry logic. httpResponse, err := c.sendWithRateLimitRetry(httpRequest, isRetryable(request)) if err != nil { return err } - err = tchttp.ParseFromHttpResponse(httpResponse, response) - return err + + // Parse the HTTP response into the specified response object. + return tchttp.ParseFromHttpResponse(httpResponse, response) } // send http request diff --git a/vendor/github.com/tencentcloud/tencentcloud-sdk-go-intl-en/tencentcloud/common/credentials.go b/vendor/github.com/tencentcloud/tencentcloud-sdk-go-intl-en/tencentcloud/common/credentials.go index c8fab3ee58..2e6694f19e 100644 --- a/vendor/github.com/tencentcloud/tencentcloud-sdk-go-intl-en/tencentcloud/common/credentials.go +++ b/vendor/github.com/tencentcloud/tencentcloud-sdk-go-intl-en/tencentcloud/common/credentials.go @@ -4,17 +4,28 @@ var creErr = "ClientError.CredentialError" type CredentialIface interface { GetSecretId() string + GetToken() string + GetSecretKey() string + + // GetCredential retrieves all credential components (SecretId, SecretKey, Token) as a tuple. + // This method is designed to fetch all three credential values (SecretId, SecretKey, Token) at once. + // This is beneficial for atomic operations, preventing potential issues that could arise from + // separate calls where one credential element might be updated while others are not, leading to inconsistency. GetCredential() (string, string, string) + // needRefresh() bool // refresh() } +// Credential is a basic implementation of the CredentialIface. +// It stores the SecretId, SecretKey, and Token directly. +// This struct is suitable for simple cases where credentials are known beforehand. type Credential struct { - SecretId string - SecretKey string - Token string + SecretId string // The SecretId for authentication. + SecretKey string // The SecretKey for signing requests. + Token string // The security token (optional). } func (c *Credential) needRefresh() bool { @@ -24,6 +35,8 @@ func (c *Credential) needRefresh() bool { func (c *Credential) refresh() { } +// NewCredential creates a new Credential instance with the given SecretId and SecretKey. +// This constructor is used when you don't have a security token. func NewCredential(secretId, secretKey string) *Credential { return &Credential{ SecretId: secretId, @@ -31,6 +44,8 @@ func NewCredential(secretId, secretKey string) *Credential { } } +// NewTokenCredential creates a new Credential instance with the given SecretId, SecretKey, and Token. +// This constructor is used when you have a security token. func NewTokenCredential(secretId, secretKey, token string) *Credential { return &Credential{ SecretId: secretId, diff --git a/vendor/github.com/tencentcloud/tencentcloud-sdk-go-intl-en/tencentcloud/common/http/request.go b/vendor/github.com/tencentcloud/tencentcloud-sdk-go-intl-en/tencentcloud/common/http/request.go index 8de07375de..7681372819 100644 --- a/vendor/github.com/tencentcloud/tencentcloud-sdk-go-intl-en/tencentcloud/common/http/request.go +++ b/vendor/github.com/tencentcloud/tencentcloud-sdk-go-intl-en/tencentcloud/common/http/request.go @@ -265,7 +265,7 @@ func CompleteCommonParams(request Request, region string, requestClient string) params["Action"] = request.GetAction() params["Timestamp"] = strconv.FormatInt(time.Now().Unix(), 10) params["Nonce"] = strconv.Itoa(rand.Int()) - params["RequestClient"] = "SDK_GO_3.0.1161" + params["RequestClient"] = "SDK_GO_3.0.1214" if requestClient != "" { params["RequestClient"] += ": " + requestClient } diff --git a/vendor/github.com/tencentcloud/tencentcloud-sdk-go-intl-en/tencentcloud/common/profile/client_profile.go b/vendor/github.com/tencentcloud/tencentcloud-sdk-go-intl-en/tencentcloud/common/profile/client_profile.go index b5094d5d2d..bb64d3a397 100644 --- a/vendor/github.com/tencentcloud/tencentcloud-sdk-go-intl-en/tencentcloud/common/profile/client_profile.go +++ b/vendor/github.com/tencentcloud/tencentcloud-sdk-go-intl-en/tencentcloud/common/profile/client_profile.go @@ -20,25 +20,40 @@ func ExponentialBackoff(index int) time.Duration { type ClientProfile struct { HttpProfile *HttpProfile - // Valid choices: HmacSHA1, HmacSHA256, TC3-HMAC-SHA256. - // Default value is TC3-HMAC-SHA256. - SignMethod string + // SignMethod specifies the signing algorithm used for request signatures. + // Valid options: "HmacSHA1", "HmacSHA256", "TC3-HMAC-SHA256". + // Default value is "TC3-HMAC-SHA256". + SignMethod string + + // UnsignedPayload indicates whether the payload is unsigned. UnsignedPayload bool - // Valid choices: zh-CN, en-US. - // Default value is zh-CN. + + // Language specifies the language of the client profile. + // Valid options: "zh-CN" (Chinese), "en-US" (English). + // Default value is "zh-CN". Language string - Debug bool - // define Whether to enable Regional auto switch + + // Debug enables or disables debug output for client operations. + Debug bool + + // DisableRegionBreaker determines whether to enable the Regional auto switch. + // The SDK uses ap-guangzhou.tencentcloudapi.com as the default backup endpoint. + // You can override this by specifying the BackupEndpoint. DisableRegionBreaker bool - // Deprecated. Use BackupEndpoint instead. + // BackupEndPoint specifies an alternative endpoint to use by region breaker. + // Deprecated: Use BackupEndpoint instead. BackupEndPoint string BackupEndpoint string - // define how to retry request - NetworkFailureMaxRetries int - NetworkFailureRetryDuration DurationFunc - RateLimitExceededMaxRetries int + // NetworkFailureMaxRetries defines the maximum number of retries when a network failure occurs. + NetworkFailureMaxRetries int + // NetworkFailureRetryDuration is a function that determines the retry duration between network failure retries. + NetworkFailureRetryDuration DurationFunc + + // RateLimitExceededMaxRetries defines the maximum number of retries when rate limit is exceeded. + RateLimitExceededMaxRetries int + // RateLimitExceededRetryDuration is a function that determines the retry duration between rate limit exceeded retries. RateLimitExceededRetryDuration DurationFunc // Configure this client to retry or not when a connectivity problem is encountered. diff --git a/vendor/github.com/tencentcloud/tencentcloud-sdk-go-intl-en/tencentcloud/common/profile/http_profile.go b/vendor/github.com/tencentcloud/tencentcloud-sdk-go-intl-en/tencentcloud/common/profile/http_profile.go index 610abb63ee..f75ec5edc8 100644 --- a/vendor/github.com/tencentcloud/tencentcloud-sdk-go-intl-en/tencentcloud/common/profile/http_profile.go +++ b/vendor/github.com/tencentcloud/tencentcloud-sdk-go-intl-en/tencentcloud/common/profile/http_profile.go @@ -1,17 +1,44 @@ package profile +// HttpProfile encapsulates the configuration for HTTP requests. +// It defines settings such as the request method, timeout, scheme, and endpoints. type HttpProfile struct { - ReqMethod string - ReqTimeout int - Scheme string - RootDomain string - Endpoint string - ApigwEndpoint string - // Deprecated, use Scheme instead + // ReqMethod specifies the HTTP request method (e.g., "GET", "POST"). + // Default: "POST". + ReqMethod string + + // ReqTimeout defines the request timeout in seconds. + // This determines how long the client will wait for a response before timing out. + // Default: 60 seconds. + ReqTimeout int + + // Deprecated: Use Scheme instead. Protocol string - Proxy string + // Scheme specifies the protocol scheme to use for the request (e.g., "HTTP", "HTTPS"). + // Default: "HTTPS". + Scheme string + + // RootDomain specifies the root domain for the API request. + // This is often used as a base for constructing the full API endpoint. + // Default: "". + RootDomain string + + // Endpoint specifies the specific API endpoint to which the request is sent. + // This can be a full URL or a domain name, depending on the service. + // Default: "". + Endpoint string + + ApigwEndpoint string + + // Proxy specifies the URL of a proxy server to use for the requests. + // If set, all requests will be routed through this proxy. + // Default: "". + Proxy string } +// NewHttpProfile creates and initializes a new HttpProfile with default values. +// This function provides a convenient way to obtain a HttpProfile instance +// with sensible defaults, which can then be customized as needed. func NewHttpProfile() *HttpProfile { return &HttpProfile{ ReqMethod: "POST", diff --git a/vendor/github.com/tencentcloud/tencentcloud-sdk-go-intl-en/tencentcloud/common/rewindable_body.go b/vendor/github.com/tencentcloud/tencentcloud-sdk-go-intl-en/tencentcloud/common/rewindable_body.go index be1c88be62..85aa390303 100644 --- a/vendor/github.com/tencentcloud/tencentcloud-sdk-go-intl-en/tencentcloud/common/rewindable_body.go +++ b/vendor/github.com/tencentcloud/tencentcloud-sdk-go-intl-en/tencentcloud/common/rewindable_body.go @@ -6,62 +6,78 @@ import ( "net/http" ) +// newRequestRetryer creates a function to reset the request body for retries. +// It handles cases where the request body needs to be read multiple times. func newRequestRetryer(r *http.Request) func() error { + // If the request doesn't have a GetBody function, we need to add one. if r.GetBody == nil { + // Wrap the original body in a rewindableBody to allow reading it multiple times. rb := &rewindableBody{body: r.Body} r.Body = rb + // Set GetBody to a function that rewinds the rewindableBody. r.GetBody = func() (io.ReadCloser, error) { - err := rb.Rewind() + err := rb.Rewind() // Prepare the body for reading again. return rb, err } } + // Return a closure that resets the request's Body to a new reader. return func() error { - bodyCopy, err := r.GetBody() + bodyCopy, err := r.GetBody() // Get a new ReadCloser for the body. if err != nil { return err } - r.Body = bodyCopy + r.Body = bodyCopy // Set the request's Body to the new reader. return nil } } +// rewindableBody allows an io.ReadCloser to be read multiple times. +// It buffers the body content to enable rewinding. type rewindableBody struct { - body io.ReadCloser - buf []byte - r bytes.Reader - rewind bool + body io.ReadCloser // The original request body. + buf []byte // Buffer to store the body content. + r bytes.Reader // Reader to read from the buffer. + rewind bool // Flag indicating if the body has been rewound. } +// Read implements the io.Reader interface. +// If rewind is true, it reads from the buffer; otherwise, it reads from the original body +// and buffers the data. func (r *rewindableBody) Read(p []byte) (int, error) { if r.rewind { - return r.r.Read(p) + return r.r.Read(p) // Read from the buffer. } - nr, err := r.body.Read(p) + nr, err := r.body.Read(p) // Read from the original body. if nr > 0 { - r.buf = append(r.buf, p[:nr]...) + r.buf = append(r.buf, p[:nr]...) // Buffer the read data. } return nr, err } +// Close implements the io.Closer interface. +// It closes the original request body. func (r *rewindableBody) Close() error { return r.body.Close() } +// Rewind prepares the body for rereading. +// If the body has not been rewound, it drains and buffers the original body. +// It then resets the buffer reader and sets the rewind flag. func (r *rewindableBody) Rewind() error { if !r.rewind { - // drain body + // Drain and buffer the original body. buf := bytes.NewBuffer(r.buf) _, err := io.Copy(buf, r.body) if err != nil { return err } - r.buf = buf.Bytes() + r.buf = buf.Bytes() // Store the buffered data. } - r.r.Reset(r.buf) - r.rewind = true + r.r.Reset(r.buf) // Reset the buffer reader. + r.rewind = true // Set the rewind flag. return nil } diff --git a/vendor/github.com/tencentcloud/tencentcloud-sdk-go-intl-en/tencentcloud/common/types.go b/vendor/github.com/tencentcloud/tencentcloud-sdk-go-intl-en/tencentcloud/common/types.go index 6da779da99..c16b85f7c9 100644 --- a/vendor/github.com/tencentcloud/tencentcloud-sdk-go-intl-en/tencentcloud/common/types.go +++ b/vendor/github.com/tencentcloud/tencentcloud-sdk-go-intl-en/tencentcloud/common/types.go @@ -1,33 +1,42 @@ package common +// IntPtr returns a pointer to the int value passed. func IntPtr(v int) *int { return &v } +// Int64Ptr returns a pointer to the int64 value passed. func Int64Ptr(v int64) *int64 { return &v } +// UintPtr returns a pointer to the uint value passed. func UintPtr(v uint) *uint { return &v } +// Uint64Ptr returns a pointer to the uint64 value passed. func Uint64Ptr(v uint64) *uint64 { return &v } +// Float64Ptr returns a pointer to the float64 value passed. func Float64Ptr(v float64) *float64 { return &v } +// BoolPtr returns a pointer to the bool value passed. func BoolPtr(v bool) *bool { return &v } +// StringPtr returns a pointer to the string value passed. func StringPtr(v string) *string { return &v } +// StringValues converts a slice of string pointers to a slice of strings. +// Nil pointers are converted to empty strings. func StringValues(ptrs []*string) []string { values := make([]string, len(ptrs)) for i := 0; i < len(ptrs); i++ { @@ -38,6 +47,7 @@ func StringValues(ptrs []*string) []string { return values } +// IntPtrs converts a slice of ints to a slice of int pointers. func IntPtrs(vals []int) []*int { ptrs := make([]*int, len(vals)) for i := 0; i < len(vals); i++ { @@ -46,6 +56,7 @@ func IntPtrs(vals []int) []*int { return ptrs } +// Int64Ptrs converts a slice of int64s to a slice of int64 pointers. func Int64Ptrs(vals []int64) []*int64 { ptrs := make([]*int64, len(vals)) for i := 0; i < len(vals); i++ { @@ -54,6 +65,7 @@ func Int64Ptrs(vals []int64) []*int64 { return ptrs } +// UintPtrs converts a slice of uints to a slice of uint pointers. func UintPtrs(vals []uint) []*uint { ptrs := make([]*uint, len(vals)) for i := 0; i < len(vals); i++ { @@ -62,6 +74,7 @@ func UintPtrs(vals []uint) []*uint { return ptrs } +// Uint64Ptrs converts a slice of uint64s to a slice of uint64 pointers. func Uint64Ptrs(vals []uint64) []*uint64 { ptrs := make([]*uint64, len(vals)) for i := 0; i < len(vals); i++ { @@ -70,6 +83,7 @@ func Uint64Ptrs(vals []uint64) []*uint64 { return ptrs } +// Float64Ptrs converts a slice of float64s to a slice of float64 pointers. func Float64Ptrs(vals []float64) []*float64 { ptrs := make([]*float64, len(vals)) for i := 0; i < len(vals); i++ { @@ -78,6 +92,7 @@ func Float64Ptrs(vals []float64) []*float64 { return ptrs } +// BoolPtrs converts a slice of bools to a slice of bool pointers. func BoolPtrs(vals []bool) []*bool { ptrs := make([]*bool, len(vals)) for i := 0; i < len(vals); i++ { @@ -86,6 +101,7 @@ func BoolPtrs(vals []bool) []*bool { return ptrs } +// StringPtrs converts a slice of strings to a slice of string pointers. func StringPtrs(vals []string) []*string { ptrs := make([]*string, len(vals)) for i := 0; i < len(vals); i++ { diff --git a/vendor/github.com/tencentcloud/tencentcloud-sdk-go-intl-en/tencentcloud/cvm/v20170312/client.go b/vendor/github.com/tencentcloud/tencentcloud-sdk-go-intl-en/tencentcloud/cvm/v20170312/client.go index 20b7f3e0c3..8e138f08da 100644 --- a/vendor/github.com/tencentcloud/tencentcloud-sdk-go-intl-en/tencentcloud/cvm/v20170312/client.go +++ b/vendor/github.com/tencentcloud/tencentcloud-sdk-go-intl-en/tencentcloud/cvm/v20170312/client.go @@ -848,15 +848,15 @@ func NewCreateLaunchTemplateResponse() (response *CreateLaunchTemplateResponse) } // CreateLaunchTemplate -// This API is used to create an instance launch template. +// This interface (CreateLaunchTemplate) is used for instance launch template creation. // // // -// An instance launch template contains the configuration information required to create an instance, including instance type, data/system disk type and size, and security group, etc. +// An instance launch template is a configuration data and can be used to create instances. Its content includes configurations required to create instances, such as instance type, types and sizes of data disk and system disk, and security group and other information. // // // -// When a template is created, it defaults to Version 1. You can use `CreateLaunchTemplateVersion` to create new versions of this template, with the version number increasing. When you run `RunInstances` to create instances, you can specify the instance launch template version. If it's not specified, the default template version is used. +// This API is used to create an instance launch template. After the initial creation of the instance template, its template version is the default version 1. A new version can be created using CreateLaunchTemplateVersion (https://intl.cloud.tencent.com/document/product/213/66326?from_cn_redirect=1), and the version number will increment. By default, when specifying an instance launch template in RunInstances (https://intl.cloud.tencent.com/document/product/213/15730?from_cn_redirect=1), if the template version number is not specified, the default version will be used. // // error code that may be returned: // ACCOUNTQUALIFICATIONRESTRICTIONS = "AccountQualificationRestrictions" @@ -954,15 +954,15 @@ func (c *Client) CreateLaunchTemplate(request *CreateLaunchTemplateRequest) (res } // CreateLaunchTemplate -// This API is used to create an instance launch template. +// This interface (CreateLaunchTemplate) is used for instance launch template creation. // // // -// An instance launch template contains the configuration information required to create an instance, including instance type, data/system disk type and size, and security group, etc. +// An instance launch template is a configuration data and can be used to create instances. Its content includes configurations required to create instances, such as instance type, types and sizes of data disk and system disk, and security group and other information. // // // -// When a template is created, it defaults to Version 1. You can use `CreateLaunchTemplateVersion` to create new versions of this template, with the version number increasing. When you run `RunInstances` to create instances, you can specify the instance launch template version. If it's not specified, the default template version is used. +// This API is used to create an instance launch template. After the initial creation of the instance template, its template version is the default version 1. A new version can be created using CreateLaunchTemplateVersion (https://intl.cloud.tencent.com/document/product/213/66326?from_cn_redirect=1), and the version number will increment. By default, when specifying an instance launch template in RunInstances (https://intl.cloud.tencent.com/document/product/213/15730?from_cn_redirect=1), if the template version number is not specified, the default version will be used. // // error code that may be returned: // ACCOUNTQUALIFICATIONRESTRICTIONS = "AccountQualificationRestrictions" @@ -2473,6 +2473,57 @@ func (c *Client) DescribeInstancesWithContext(ctx context.Context, request *Desc return } +func NewDescribeInstancesAttributesRequest() (request *DescribeInstancesAttributesRequest) { + request = &DescribeInstancesAttributesRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("cvm", APIVersion, "DescribeInstancesAttributes") + + + return +} + +func NewDescribeInstancesAttributesResponse() (response *DescribeInstancesAttributesResponse) { + response = &DescribeInstancesAttributesResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return + +} + +// DescribeInstancesAttributes +// This API is used to obtain the attributes of specified instances. Currently, it supports querying the custom data UserData of instances. +// +// error code that may be returned: +// INVALIDINSTANCEID_NOTFOUND = "InvalidInstanceId.NotFound" +// INVALIDPARAMETERVALUE_INSTANCEIDMALFORMED = "InvalidParameterValue.InstanceIdMalformed" +func (c *Client) DescribeInstancesAttributes(request *DescribeInstancesAttributesRequest) (response *DescribeInstancesAttributesResponse, err error) { + return c.DescribeInstancesAttributesWithContext(context.Background(), request) +} + +// DescribeInstancesAttributes +// This API is used to obtain the attributes of specified instances. Currently, it supports querying the custom data UserData of instances. +// +// error code that may be returned: +// INVALIDINSTANCEID_NOTFOUND = "InvalidInstanceId.NotFound" +// INVALIDPARAMETERVALUE_INSTANCEIDMALFORMED = "InvalidParameterValue.InstanceIdMalformed" +func (c *Client) DescribeInstancesAttributesWithContext(ctx context.Context, request *DescribeInstancesAttributesRequest) (response *DescribeInstancesAttributesResponse, err error) { + if request == nil { + request = NewDescribeInstancesAttributesRequest() + } + + if c.GetCredential() == nil { + return nil, errors.New("DescribeInstancesAttributes require credential") + } + + request.SetContext(ctx) + + response = NewDescribeInstancesAttributesResponse() + err = c.Send(request, response) + return +} + func NewDescribeInstancesOperationLimitRequest() (request *DescribeInstancesOperationLimitRequest) { request = &DescribeInstancesOperationLimitRequest{ BaseRequest: &tchttp.BaseRequest{}, @@ -7458,8 +7509,6 @@ func NewTerminateInstancesResponse() (response *TerminateInstancesResponse) { // // * Pay-as-you-go instances can be returned directly through this API. // -// * When this API is called for the first time, the instance will be moved to the recycle bin. When this API is called for the second time, the instance will be terminated and cannot be recovered. -// // * Batch operations are supported. The allowed maximum number of instances in each request is 100. // // error code that may be returned: @@ -7522,8 +7571,6 @@ func (c *Client) TerminateInstances(request *TerminateInstancesRequest) (respons // // * Pay-as-you-go instances can be returned directly through this API. // -// * When this API is called for the first time, the instance will be moved to the recycle bin. When this API is called for the second time, the instance will be terminated and cannot be recovered. -// // * Batch operations are supported. The allowed maximum number of instances in each request is 100. // // error code that may be returned: diff --git a/vendor/github.com/tencentcloud/tencentcloud-sdk-go-intl-en/tencentcloud/cvm/v20170312/errors.go b/vendor/github.com/tencentcloud/tencentcloud-sdk-go-intl-en/tencentcloud/cvm/v20170312/errors.go index 656305c6d3..713a42e61b 100644 --- a/vendor/github.com/tencentcloud/tencentcloud-sdk-go-intl-en/tencentcloud/cvm/v20170312/errors.go +++ b/vendor/github.com/tencentcloud/tencentcloud-sdk-go-intl-en/tencentcloud/cvm/v20170312/errors.go @@ -467,7 +467,7 @@ const ( // Invalid IP address. INVALIDPARAMETERVALUE_INVALIDIPFORMAT = "InvalidParameterValue.InvalidIpFormat" - // Incorrect format of instance launch template description. + // Instance boot template description format is incorrect. INVALIDPARAMETERVALUE_INVALIDLAUNCHTEMPLATEDESCRIPTION = "InvalidParameterValue.InvalidLaunchTemplateDescription" // Incorrect format of instance launch template name. diff --git a/vendor/github.com/tencentcloud/tencentcloud-sdk-go-intl-en/tencentcloud/cvm/v20170312/models.go b/vendor/github.com/tencentcloud/tencentcloud-sdk-go-intl-en/tencentcloud/cvm/v20170312/models.go index 4041bd798f..075df4a41c 100644 --- a/vendor/github.com/tencentcloud/tencentcloud-sdk-go-intl-en/tencentcloud/cvm/v20170312/models.go +++ b/vendor/github.com/tencentcloud/tencentcloud-sdk-go-intl-en/tencentcloud/cvm/v20170312/models.go @@ -21,29 +21,22 @@ import ( ) type ActionTimer struct { - // Timer action. Valid value: `TerminateInstances`. - // Note: This field may return `null`, indicating that no valid values can be obtained. + // Timer action currently only supports terminating one value: TerminateInstances. TimerAction *string `json:"TimerAction,omitnil,omitempty" name:"TimerAction"` - // Action time, which follows the ISO8601 standard and uses UTC time. It must be 5 minutes later than the current time. Format: YYYY-MM-DDThh:mm:ssZ. For example: 2018-05-29T11:26:40Z. - // Note: This field may return `null`, indicating that no valid values can be obtained. + // Execution time, in standard ISO8601 representation and using UTC time. format: YYYY-MM-DDThh:MM:ssZ. for example, 2018-05-29T11:26:40Z. the execution time must be later than the current time by 5 minutes. ActionTime *string `json:"ActionTime,omitnil,omitempty" name:"ActionTime"` - // Extended data - // Note: This field may return `null`, indicating that no valid values can be obtained. + // Extension data. only used as output usage. Externals *Externals `json:"Externals,omitnil,omitempty" name:"Externals"` - // Timer ID. + // Timer ID. only used as output usage. ActionTimerId *string `json:"ActionTimerId,omitnil,omitempty" name:"ActionTimerId"` - // Timer status. Valid values: - // - // UNDO: Not triggered. - // DOING: Triggering. - // DONE: Triggered already. + // Timer status, for output usage only. value ranges from:
  • UNDO: unexecuted
  • DOING: executing
  • DONE: execution completed.
  • . Status *string `json:"Status,omitnil,omitempty" name:"Status"` - // Instance ID corresponding to a timer. + // Instance ID corresponding to a timer. used only for output. InstanceId *string `json:"InstanceId,omitnil,omitempty" name:"InstanceId"` } @@ -275,6 +268,11 @@ func (r *AssociateSecurityGroupsResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } +type Attribute struct { + // Custom data of instances. + UserData *string `json:"UserData,omitnil,omitempty" name:"UserData"` +} + type ChargePrepaid struct { // Purchased usage period, in month. Valid values: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 24, 36 Period *uint64 `json:"Period,omitnil,omitempty" name:"Period"` @@ -941,187 +939,211 @@ func (r *CreateKeyPairResponse) FromJsonString(s string) error { // Predefined struct for user type CreateLaunchTemplateRequestParams struct { - // Instance launch template name. It can include 2-128 characters. + // Name of an instance launch template. It contains 2 to 128 English or Chinese characters. LaunchTemplateName *string `json:"LaunchTemplateName,omitnil,omitempty" name:"LaunchTemplateName"` - // Location of the instance. You can use this parameter to specify the attributes of the instance, such as its availability zone, project, and CDH (for dedicated CVMs) + // Location of the instance. You can specify attributes such as availability zone, project, and host (specified when creating a instance on the CDH) to which the instance belongs through this parameter. Placement *Placement `json:"Placement,omitnil,omitempty" name:"Placement"` - // The [image](https://intl.cloud.tencent.com/document/product/213/4940?from_cn_redirect=1) ID in the format of `img-xxx`. There are four types of images:
  • Public images
  • Custom images
  • Shared images
  • Marketplace images (for Chinese mainland only)

  • To check the image ID:
  • For public images, custom images, and shared images, go to the [console](https://console.cloud.tencent.com/cvm/image?rid=1&imageType=PUBLIC_IMAGE). For marketplace images, go to [Cloud Marketplace](https://market.cloud.tencent.com/list).
  • Call [DescribeImages](https://intl.cloud.tencent.com/document/api/213/15715?from_cn_redirect=1), pass in `InstanceType` to retrieve the list of images supported by the current model, and then find the `ImageId` in the response.
  • + // Specify an effective [mirror](https://intl.cloud.tencent.com/document/product/213/4940?from_cn_redirect=1) ID in the format of `img-xxx`. there are four image types:
  • PUBLIC image
  • custom image
  • shared image
  • service market image
  • you can obtain available mirror ids in the following ways:
  • the mirror ids of `PUBLIC image`, `custom image` and `shared image` can be queried by logging in to the [console](https://console.cloud.tencent.com/cvm/image?rid=1&imageType=PUBLIC_image); the mirror ids of `service market image` can be queried through the [cloud market](https://market.cloud.tencent.com/list).
  • call the api [DescribeImages](https://intl.cloud.tencent.com/document/api/213/15715?from_cn_redirect=1), input InstanceType to obtain the list of images supported by the current model, and take the `ImageId` field from the return information.
  • . ImageId *string `json:"ImageId,omitnil,omitempty" name:"ImageId"` - // Description of instance launch template versions. This parameter can contain 2-256 characters. + // Version description of an instance launch template. It contains 2 to 256 English or Chinese characters. LaunchTemplateVersionDescription *string `json:"LaunchTemplateVersionDescription,omitnil,omitempty" name:"LaunchTemplateVersionDescription"` - // The instance model. Different resource specifications are specified for different instance models. - //
  • To view specific values for `PREPAID` or `POSTPAID_BY_HOUR` instances, you can call [DescribeInstanceTypeConfigs](https://intl.cloud.tencent.com/document/api/213/15749?from_cn_redirect=1) or refer to [Instance Types](https://intl.cloud.tencent.com/document/product/213/11518?from_cn_redirect=1). If this parameter is not specified, the system will specify the default model according to the dynamic resource sales in the current region.
  • For `CDHPAID` instances, the value of this parameter is in the format of `CDH_XCXG` based on the number of CPU cores and memory capacity. For example, if you want to create a CDH instance with a single-core CPU and 1 GB memory, you need to specify this parameter as `CDH_1C1G`. + // Instance model. Different instance models specify different resource specifications. + // + //
  • For instances created with the payment modes PREPAID or POSTPAID_BY_HOUR, the specific values can be obtained BY calling the [DescribeInstanceTypeConfigs](https://intl.cloud.tencent.com/document/api/213/15749?from_cn_redirect=1) api to get the latest specification table or referring to the [instance specifications](https://intl.cloud.tencent.com/document/product/213/11518?from_cn_redirect=1) description. if this parameter is not specified, the system will dynamically assign a default model based on the current resource sales situation in a region.
  • for instances created with the payment mode CDHPAID, this parameter has the prefix "CDH_" and is generated based on the CPU and memory configuration. the specific format is: CDH_XCXG. for example, for creating a CDH instance with 1 CPU core and 1 gb memory, this parameter should be CDH_1C1G.
  • . InstanceType *string `json:"InstanceType,omitnil,omitempty" name:"InstanceType"` - // System disk configuration of the instance. If this parameter is not specified, the default value will be used. + // Instance system disk configuration information. If this parameter is not specified, it will be assigned based on the system default values. SystemDisk *SystemDisk `json:"SystemDisk,omitnil,omitempty" name:"SystemDisk"` - // The configuration information of instance data disks. If this parameter is not specified, no data disk will be purchased by default. When purchasing, you can specify 21 data disks, which can contain at most 1 LOCAL_BASIC or LOCAL_SSD data disk, and at most 20 CLOUD_BASIC, CLOUD_PREMIUM, or CLOUD_SSD data disks. + // Instance data disk configuration information. if not specified, no data disks are purchased by default. support specifying 21 data disks at the time of purchase, among which a maximum of 1 LOCAL_BASIC data disk or LOCAL_SSD data disk can be included, and a maximum of 20 CLOUD_BASIC data disks, CLOUD_PREMIUM data disks or CLOUD_SSD data disks can be included. DataDisks []*DataDisk `json:"DataDisks,omitnil,omitempty" name:"DataDisks"` - // Configuration information of VPC. This parameter is used to specify VPC ID and subnet ID, etc. If this parameter is not specified, the classic network is used by default. If a VPC IP is specified in this parameter, it indicates the primary ENI IP of each instance. The value of parameter InstanceCount must be same as the number of VPC IPs, which cannot be greater than 20. + // VPC-related information configuration. You can specify information such as VPC ID and subnet ID through this parameter. If this parameter is not specified, use the basic network by default. If a VPC IP is specified in this parameter, it indicates the primary network interface card IP of each instance. In addition, the number of the InstanceCount parameter should be consistent with the number of the VPC IP and should not exceed 20. VirtualPrivateCloud *VirtualPrivateCloud `json:"VirtualPrivateCloud,omitnil,omitempty" name:"VirtualPrivateCloud"` - // Configuration of public network bandwidth. If this parameter is not specified, 0 Mbps will be used by default. + // Public bandwidth-related settings. If this parameter is not specified, the public bandwidth is 0 Mbps by default. InternetAccessible *InternetAccessible `json:"InternetAccessible,omitnil,omitempty" name:"InternetAccessible"` - // Number of instances to be purchased. Value range for monthly-subscribed instances: [1, 300]. Value range for pay-as-you-go instances: [1, 100]. Default value: 1. The specified number of instances to be purchased cannot exceed the remaining quota allowed for the user. For more information on quota, see CVM instance [Purchase Limits](https://intl.cloud.tencent.com/document/product/213/2664). + // Number of instances to purchase. value range for monthly subscription instances: [1, 300]. value range for pay-as-you-go instances: [1, 100]. default value: 1. the number of instances to purchase must not exceed the remaining user quota. for specific quota limitations, see [CVM instance purchase limitations](https://intl.cloud.tencent.com/document/product/213/2664?from_cn_redirect=1). InstanceCount *int64 `json:"InstanceCount,omitnil,omitempty" name:"InstanceCount"` - // Instance name to be displayed.
  • If this parameter is not specified, "Unnamed" will be displayed by default.
  • If you purchase multiple instances at the same time and specify a pattern string `{R:x}`, numbers `[x, x+n-1]` will be generated, where `n` represents the number of instances purchased. For example, you specify a pattern string, `server_{R:3}`. If you only purchase 1 instance, the instance will be named `server_3`; if you purchase 2, they will be named `server_3` and `server_4`. You can specify multiple pattern strings in the format of `{R:x}`.
  • If you purchase multiple instances at the same time and do not specify a pattern string, the instance names will be suffixed by `1, 2...n`, where `n` represents the number of instances purchased. For example, if you purchase 2 instances and the instance name body is `server_`, the instance names will be `server_1` and `server_2`.
  • This parameter can contain up to 60 characters, including the pattern string. + // Instance display name.
  • if the instance display name is not specified, it will display by default as 'unnamed'.
  • when purchasing multiple instances, if the pattern string `{R:x}` is specified, it indicates generating numbers `[x, x+n-1]`, where `n` represents the number of purchased instances. for example, `server_{R:3}` will result in instance display names as `server_3` when purchasing 1 instance; when purchasing 2 instances, the instance display names will be `server_3` and `server_4` respectively. it supports specifying multiple pattern strings `{R:x}`.
  • when purchasing multiple instances, if no pattern string is specified, a suffix `1, 2...n` will be added to the instance display name, where `n` represents the number of purchased instances. for example, for `server_`, when purchasing 2 instances, the instance display names will be `server_1` and `server_2` respectively.
  • it supports up to 128 characters (including pattern strings).
  • . InstanceName *string `json:"InstanceName,omitnil,omitempty" name:"InstanceName"` - // Login settings of the instance. You can use this parameter to set the login method, password, and key of the instance or keep the login settings of the original image. By default, a random password will be generated and sent to you via the Message Center. + // Instance login settings. this parameter allows you to set the instance login method to key or maintain the original login settings of the image. LoginSettings *LoginSettings `json:"LoginSettings,omitnil,omitempty" name:"LoginSettings"` - // Security groups to which the instance belongs. To obtain the security group IDs, you can call [DescribeSecurityGroups](https://intl.cloud.tencent.com/document/api/215/15808) and look for the `sgld` fields in the response. If this parameter is not specified, the instance will be associated with default security groups. + // Security group to which an instance belongs. this parameter can be obtained by calling the sgId field in the returned value of [DescribeSecurityGroups](https://intl.cloud.tencent.com/document/api/215/15808?from_cn_redirect=1). if not specified, the default security group is bound. SecurityGroupIds []*string `json:"SecurityGroupIds,omitnil,omitempty" name:"SecurityGroupIds"` - // Enhanced service. You can use this parameter to specify whether to enable services such as Anti-DDoS and Cloud Monitor. If this parameter is not specified, Cloud Monitor and Anti-DDoS are enabled for public images by default. However, for custom images and images from the marketplace, Anti-DDoS and Cloud Monitor are not enabled by default. The original services in the image will be retained. + // Enhanced services. You can specify whether to enable services such as Cloud Security and Cloud Monitor through this parameter. If this parameter is not specified, Cloud Monitor and Cloud Security are enabled for public images by default, but not enabled for custom images and marketplace images by default. Instead, they use services retained in the images. EnhancedService *EnhancedService `json:"EnhancedService,omitnil,omitempty" name:"EnhancedService"` - // A unique string supplied by the client to ensure that the request is idempotent. Its maximum length is 64 ASCII characters. If this parameter is not specified, the idempotency of the request cannot be guaranteed. + // A string used to ensure the idempotence of the request. This string is generated by the customer and should be unique across different requests, with a maximum length of 64 ASCII characters. If this parameter is not specified, the idempotence of the request cannot be guaranteed. ClientToken *string `json:"ClientToken,omitnil,omitempty" name:"ClientToken"` - // Host name of the CVM.
  • Dots (.) or hyphens (-) cannot be the start or end of a host name or appear consecutively in a host name.
  • For Windows instances, the host name must be 2-15 characters long and can contain uppercase and lowercase letters, numbers, and hyphens (-). It cannot contain dots (.) or contain only numbers.
  • For other instances, such as Linux instances, the host name must be 2-60 characters long. It supports multiple dots (.) and allows uppercase and lowercase letters, numbers, and hyphens (-) between any two dots (.). + // Specifies the HostName of the cloud virtual machine.
  • the dot (.) and hyphen (-) cannot be used at the beginning or end of the HostName, and cannot be used consecutively.
  • for Windows instances: the character length is 2 to 15. it consists of letters (case insensitive), digits, and hyphens (-). dots (.) are not supported, and it cannot be all digits.
  • for other types (such as Linux) instances: the character length is 2 to 60. multiple dots are allowed. each segment between dots can include letters (case insensitive), digits, and hyphens (-).
  • . HostName *string `json:"HostName,omitnil,omitempty" name:"HostName"` - // Scheduled tasks. You can use this parameter to specify scheduled tasks for the instance. Only scheduled termination is supported. + // Scheduled task. You can specify a scheduled task for the instance through this parameter. Currently, only scheduled termination is supported. ActionTimer *ActionTimer `json:"ActionTimer,omitnil,omitempty" name:"ActionTimer"` - // Placement group ID. You can only specify one. + // Placement group ID. Only one can be specified. DisasterRecoverGroupIds []*string `json:"DisasterRecoverGroupIds,omitnil,omitempty" name:"DisasterRecoverGroupIds"` - // The tag description list. This parameter is used to bind a tag to a resource instance. A tag can only be bound to CVM instances. + // List of tag descriptions. You can bind tags to corresponding resource instances at the same time by specifying this parameter. Currently, only binding tags to the CVM is supported. TagSpecification []*TagSpecification `json:"TagSpecification,omitnil,omitempty" name:"TagSpecification"` - // Market options of the instance, such as parameters related to spot instances. This parameter is required for spot instances. + // Market-Related options of the instance, such as relevant parameters of the bidding instance. this parameter is required if the payment mode of the specified instance is spot payment. InstanceMarketOptions *InstanceMarketOptionsRequest `json:"InstanceMarketOptions,omitnil,omitempty" name:"InstanceMarketOptions"` - // User data provided to the instance. This parameter needs to be encoded in base64 format with the maximum size of 16KB. For more information on how to get the value of this parameter, see the commands you need to execute on startup for [Windows](https://intl.cloud.tencent.com/document/product/213/17526) or [Linux](https://intl.cloud.tencent.com/document/product/213/17525). + // User data provided for an instance must be encoded in base64. valid values for maximum data size are up to 16 KB. for details on obtaining this parameter, see running commands at startup for Windows (https://intl.cloud.tencent.com/document/product/213/17526?from_cn_redirect=1) and Linux (https://intl.cloud.tencent.com/document/product/213/17525?from_cn_redirect=1). UserData *string `json:"UserData,omitnil,omitempty" name:"UserData"` - // Whether the request is a dry run only. - // true: dry run only. The request will not create instance(s). A dry run can check whether all the required parameters are specified, whether the request format is right, whether the request exceeds service limits, and whether the specified CVMs are available. - // If the dry run fails, the corresponding error code will be returned. - // If the dry run succeeds, the RequestId will be returned. - // false (default value): send a normal request and create instance(s) if all the requirements are met. + // Whether it is a pre-check for this request only. + // true: sends a check request without creating an instance. check items include whether required parameters are filled in, request format, service limits, and cvm inventory. + // If the check fails, return the corresponding error code. + // If the check passed, return RequestId. + // false (default): sends a normal request. after passing the check, creates an instance directly. DryRun *bool `json:"DryRun,omitnil,omitempty" name:"DryRun"` - // CAM role name, which can be obtained from the `roleName` field in the response of the [`DescribeRoleList`](https://intl.cloud.tencent.com/document/product/598/13887?from_cn_redirect=1) API. + // CAM role name. it can be obtained through the roleName in the return value from the API DescribeRoleList. CamRoleName *string `json:"CamRoleName,omitnil,omitempty" name:"CamRoleName"` - // HPC cluster ID. The HPC cluster must and can only be specified for a high-performance computing instance. + // High-performance computing cluster ID. If the created instance is a high-performance computing instance, the cluster where the instance is placed should be specified. Otherwise, it cannot be specified. HpcClusterId *string `json:"HpcClusterId,omitnil,omitempty" name:"HpcClusterId"` - // Instance [Billing Mode](https://intl.cloud.tencent.com/document/product/213/2180?from_cn_redirect=1). Valid values:
  • `PREPAID`: prepaid, i.e., billed for monthly-subscribed instances
  • `POSTPAID_BY_HOUR`: pay-as-you-go on an hourly basis
  • `CDHPAID`: billed for CDH instances, not the CVMs running on the CDHs.
  • `SPOTPAID`: billed for spot instances.
    Default value: POSTPAID_BY_HOUR. + // Instance [billing mode](https://intl.cloud.tencent.com/document/product/213/2180?from_cn_redirect=1).
  • PREPAID: prepaid, that is, monthly subscription.
  • POSTPAID_BY_HOUR: pay-as-you-go by hour.
  • CDHPAID: CDH instance (created based on CDH; the resources of the host are free of charge).
  • SPOTPAID: spot payment.
  • Default value: POSTPAID_BY_HOUR. InstanceChargeType *string `json:"InstanceChargeType,omitnil,omitempty" name:"InstanceChargeType"` - // Details of the monthly subscription, including the purchase period, auto-renewal. It is required if the `InstanceChargeType` is `PREPAID`. + // Prepaid mode, that is, annual and monthly subscription related parameter settings. Through this parameter, you can specify the purchase duration of annual and monthly subscription instances, whether to set auto-renewal, etc. If the specified instance's billing mode is the prepaid mode, this parameter must be passed. InstanceChargePrepaid *InstanceChargePrepaid `json:"InstanceChargePrepaid,omitnil,omitempty" name:"InstanceChargePrepaid"` - // Instance termination protection flag, indicating whether an instance is allowed to be deleted through an API. Valid values:
  • true: Instance protection is enabled, and the instance is not allowed to be deleted through the API.

  • false: Instance protection is disabled, and the instance is allowed to be deleted through the API.


  • Default value: false. + // Instance destruction protection flag: indicates whether an instance is allowed to be deleted through an api. value ranges from: - **TRUE**: indicates that instance protection is enabled, deletion through apis is not allowed. - **FALSE**: indicates that instance protection is disabled, deletion through apis is allowed. default value: FALSE. DisableApiTermination *bool `json:"DisableApiTermination,omitnil,omitempty" name:"DisableApiTermination"` - // Instance launch template tag description list. By specifying the TemplateTag parameter, you can bind tags to the instance launch template. + // Description list of tags. by specifying this parameter, tags can be bound to the instance launch template. LaunchTemplateTagSpecification []*TagSpecification `json:"LaunchTemplateTagSpecification,omitnil,omitempty" name:"LaunchTemplateTagSpecification"` + + // Custom metadata. specifies that custom metadata key-value pairs can be added when creating a CVM. + // Note: this field is in beta test. + Metadata *Metadata `json:"Metadata,omitnil,omitempty" name:"Metadata"` + + // Specifies that only the Update and Replace parameters are allowed. this parameter is valid only when custom Metadata is used in the template and Metadata is also transmitted in RunInstances. defaults to Replace. + // + // -Update: if template t contains this parameter with a value of Update and metadata=[k1:v1, k2:v2], then RunInstances (with metadata=[k2:v3]) + t creates a cvm using metadata=[k1:v1, k2:v3]. + // -Replace: if the template t contains this parameter with a value of Replace and metadata=[k1:v1, k2:v2], then when creating a cvm using RunInstances (with metadata=[k2:v3]) + t, the created cvm will use metadata=[k2:v3]. + // Note: this field is in beta test. + TemplateDataModifyAction *string `json:"TemplateDataModifyAction,omitnil,omitempty" name:"TemplateDataModifyAction"` } type CreateLaunchTemplateRequest struct { *tchttp.BaseRequest - // Instance launch template name. It can include 2-128 characters. + // Name of an instance launch template. It contains 2 to 128 English or Chinese characters. LaunchTemplateName *string `json:"LaunchTemplateName,omitnil,omitempty" name:"LaunchTemplateName"` - // Location of the instance. You can use this parameter to specify the attributes of the instance, such as its availability zone, project, and CDH (for dedicated CVMs) + // Location of the instance. You can specify attributes such as availability zone, project, and host (specified when creating a instance on the CDH) to which the instance belongs through this parameter. Placement *Placement `json:"Placement,omitnil,omitempty" name:"Placement"` - // The [image](https://intl.cloud.tencent.com/document/product/213/4940?from_cn_redirect=1) ID in the format of `img-xxx`. There are four types of images:
  • Public images
  • Custom images
  • Shared images
  • Marketplace images (for Chinese mainland only)

  • To check the image ID:
  • For public images, custom images, and shared images, go to the [console](https://console.cloud.tencent.com/cvm/image?rid=1&imageType=PUBLIC_IMAGE). For marketplace images, go to [Cloud Marketplace](https://market.cloud.tencent.com/list).
  • Call [DescribeImages](https://intl.cloud.tencent.com/document/api/213/15715?from_cn_redirect=1), pass in `InstanceType` to retrieve the list of images supported by the current model, and then find the `ImageId` in the response.
  • + // Specify an effective [mirror](https://intl.cloud.tencent.com/document/product/213/4940?from_cn_redirect=1) ID in the format of `img-xxx`. there are four image types:
  • PUBLIC image
  • custom image
  • shared image
  • service market image
  • you can obtain available mirror ids in the following ways:
  • the mirror ids of `PUBLIC image`, `custom image` and `shared image` can be queried by logging in to the [console](https://console.cloud.tencent.com/cvm/image?rid=1&imageType=PUBLIC_image); the mirror ids of `service market image` can be queried through the [cloud market](https://market.cloud.tencent.com/list).
  • call the api [DescribeImages](https://intl.cloud.tencent.com/document/api/213/15715?from_cn_redirect=1), input InstanceType to obtain the list of images supported by the current model, and take the `ImageId` field from the return information.
  • . ImageId *string `json:"ImageId,omitnil,omitempty" name:"ImageId"` - // Description of instance launch template versions. This parameter can contain 2-256 characters. + // Version description of an instance launch template. It contains 2 to 256 English or Chinese characters. LaunchTemplateVersionDescription *string `json:"LaunchTemplateVersionDescription,omitnil,omitempty" name:"LaunchTemplateVersionDescription"` - // The instance model. Different resource specifications are specified for different instance models. - //
  • To view specific values for `PREPAID` or `POSTPAID_BY_HOUR` instances, you can call [DescribeInstanceTypeConfigs](https://intl.cloud.tencent.com/document/api/213/15749?from_cn_redirect=1) or refer to [Instance Types](https://intl.cloud.tencent.com/document/product/213/11518?from_cn_redirect=1). If this parameter is not specified, the system will specify the default model according to the dynamic resource sales in the current region.
  • For `CDHPAID` instances, the value of this parameter is in the format of `CDH_XCXG` based on the number of CPU cores and memory capacity. For example, if you want to create a CDH instance with a single-core CPU and 1 GB memory, you need to specify this parameter as `CDH_1C1G`. + // Instance model. Different instance models specify different resource specifications. + // + //
  • For instances created with the payment modes PREPAID or POSTPAID_BY_HOUR, the specific values can be obtained BY calling the [DescribeInstanceTypeConfigs](https://intl.cloud.tencent.com/document/api/213/15749?from_cn_redirect=1) api to get the latest specification table or referring to the [instance specifications](https://intl.cloud.tencent.com/document/product/213/11518?from_cn_redirect=1) description. if this parameter is not specified, the system will dynamically assign a default model based on the current resource sales situation in a region.
  • for instances created with the payment mode CDHPAID, this parameter has the prefix "CDH_" and is generated based on the CPU and memory configuration. the specific format is: CDH_XCXG. for example, for creating a CDH instance with 1 CPU core and 1 gb memory, this parameter should be CDH_1C1G.
  • . InstanceType *string `json:"InstanceType,omitnil,omitempty" name:"InstanceType"` - // System disk configuration of the instance. If this parameter is not specified, the default value will be used. + // Instance system disk configuration information. If this parameter is not specified, it will be assigned based on the system default values. SystemDisk *SystemDisk `json:"SystemDisk,omitnil,omitempty" name:"SystemDisk"` - // The configuration information of instance data disks. If this parameter is not specified, no data disk will be purchased by default. When purchasing, you can specify 21 data disks, which can contain at most 1 LOCAL_BASIC or LOCAL_SSD data disk, and at most 20 CLOUD_BASIC, CLOUD_PREMIUM, or CLOUD_SSD data disks. + // Instance data disk configuration information. if not specified, no data disks are purchased by default. support specifying 21 data disks at the time of purchase, among which a maximum of 1 LOCAL_BASIC data disk or LOCAL_SSD data disk can be included, and a maximum of 20 CLOUD_BASIC data disks, CLOUD_PREMIUM data disks or CLOUD_SSD data disks can be included. DataDisks []*DataDisk `json:"DataDisks,omitnil,omitempty" name:"DataDisks"` - // Configuration information of VPC. This parameter is used to specify VPC ID and subnet ID, etc. If this parameter is not specified, the classic network is used by default. If a VPC IP is specified in this parameter, it indicates the primary ENI IP of each instance. The value of parameter InstanceCount must be same as the number of VPC IPs, which cannot be greater than 20. + // VPC-related information configuration. You can specify information such as VPC ID and subnet ID through this parameter. If this parameter is not specified, use the basic network by default. If a VPC IP is specified in this parameter, it indicates the primary network interface card IP of each instance. In addition, the number of the InstanceCount parameter should be consistent with the number of the VPC IP and should not exceed 20. VirtualPrivateCloud *VirtualPrivateCloud `json:"VirtualPrivateCloud,omitnil,omitempty" name:"VirtualPrivateCloud"` - // Configuration of public network bandwidth. If this parameter is not specified, 0 Mbps will be used by default. + // Public bandwidth-related settings. If this parameter is not specified, the public bandwidth is 0 Mbps by default. InternetAccessible *InternetAccessible `json:"InternetAccessible,omitnil,omitempty" name:"InternetAccessible"` - // Number of instances to be purchased. Value range for monthly-subscribed instances: [1, 300]. Value range for pay-as-you-go instances: [1, 100]. Default value: 1. The specified number of instances to be purchased cannot exceed the remaining quota allowed for the user. For more information on quota, see CVM instance [Purchase Limits](https://intl.cloud.tencent.com/document/product/213/2664). + // Number of instances to purchase. value range for monthly subscription instances: [1, 300]. value range for pay-as-you-go instances: [1, 100]. default value: 1. the number of instances to purchase must not exceed the remaining user quota. for specific quota limitations, see [CVM instance purchase limitations](https://intl.cloud.tencent.com/document/product/213/2664?from_cn_redirect=1). InstanceCount *int64 `json:"InstanceCount,omitnil,omitempty" name:"InstanceCount"` - // Instance name to be displayed.
  • If this parameter is not specified, "Unnamed" will be displayed by default.
  • If you purchase multiple instances at the same time and specify a pattern string `{R:x}`, numbers `[x, x+n-1]` will be generated, where `n` represents the number of instances purchased. For example, you specify a pattern string, `server_{R:3}`. If you only purchase 1 instance, the instance will be named `server_3`; if you purchase 2, they will be named `server_3` and `server_4`. You can specify multiple pattern strings in the format of `{R:x}`.
  • If you purchase multiple instances at the same time and do not specify a pattern string, the instance names will be suffixed by `1, 2...n`, where `n` represents the number of instances purchased. For example, if you purchase 2 instances and the instance name body is `server_`, the instance names will be `server_1` and `server_2`.
  • This parameter can contain up to 60 characters, including the pattern string. + // Instance display name.
  • if the instance display name is not specified, it will display by default as 'unnamed'.
  • when purchasing multiple instances, if the pattern string `{R:x}` is specified, it indicates generating numbers `[x, x+n-1]`, where `n` represents the number of purchased instances. for example, `server_{R:3}` will result in instance display names as `server_3` when purchasing 1 instance; when purchasing 2 instances, the instance display names will be `server_3` and `server_4` respectively. it supports specifying multiple pattern strings `{R:x}`.
  • when purchasing multiple instances, if no pattern string is specified, a suffix `1, 2...n` will be added to the instance display name, where `n` represents the number of purchased instances. for example, for `server_`, when purchasing 2 instances, the instance display names will be `server_1` and `server_2` respectively.
  • it supports up to 128 characters (including pattern strings).
  • . InstanceName *string `json:"InstanceName,omitnil,omitempty" name:"InstanceName"` - // Login settings of the instance. You can use this parameter to set the login method, password, and key of the instance or keep the login settings of the original image. By default, a random password will be generated and sent to you via the Message Center. + // Instance login settings. this parameter allows you to set the instance login method to key or maintain the original login settings of the image. LoginSettings *LoginSettings `json:"LoginSettings,omitnil,omitempty" name:"LoginSettings"` - // Security groups to which the instance belongs. To obtain the security group IDs, you can call [DescribeSecurityGroups](https://intl.cloud.tencent.com/document/api/215/15808) and look for the `sgld` fields in the response. If this parameter is not specified, the instance will be associated with default security groups. + // Security group to which an instance belongs. this parameter can be obtained by calling the sgId field in the returned value of [DescribeSecurityGroups](https://intl.cloud.tencent.com/document/api/215/15808?from_cn_redirect=1). if not specified, the default security group is bound. SecurityGroupIds []*string `json:"SecurityGroupIds,omitnil,omitempty" name:"SecurityGroupIds"` - // Enhanced service. You can use this parameter to specify whether to enable services such as Anti-DDoS and Cloud Monitor. If this parameter is not specified, Cloud Monitor and Anti-DDoS are enabled for public images by default. However, for custom images and images from the marketplace, Anti-DDoS and Cloud Monitor are not enabled by default. The original services in the image will be retained. + // Enhanced services. You can specify whether to enable services such as Cloud Security and Cloud Monitor through this parameter. If this parameter is not specified, Cloud Monitor and Cloud Security are enabled for public images by default, but not enabled for custom images and marketplace images by default. Instead, they use services retained in the images. EnhancedService *EnhancedService `json:"EnhancedService,omitnil,omitempty" name:"EnhancedService"` - // A unique string supplied by the client to ensure that the request is idempotent. Its maximum length is 64 ASCII characters. If this parameter is not specified, the idempotency of the request cannot be guaranteed. + // A string used to ensure the idempotence of the request. This string is generated by the customer and should be unique across different requests, with a maximum length of 64 ASCII characters. If this parameter is not specified, the idempotence of the request cannot be guaranteed. ClientToken *string `json:"ClientToken,omitnil,omitempty" name:"ClientToken"` - // Host name of the CVM.
  • Dots (.) or hyphens (-) cannot be the start or end of a host name or appear consecutively in a host name.
  • For Windows instances, the host name must be 2-15 characters long and can contain uppercase and lowercase letters, numbers, and hyphens (-). It cannot contain dots (.) or contain only numbers.
  • For other instances, such as Linux instances, the host name must be 2-60 characters long. It supports multiple dots (.) and allows uppercase and lowercase letters, numbers, and hyphens (-) between any two dots (.). + // Specifies the HostName of the cloud virtual machine.
  • the dot (.) and hyphen (-) cannot be used at the beginning or end of the HostName, and cannot be used consecutively.
  • for Windows instances: the character length is 2 to 15. it consists of letters (case insensitive), digits, and hyphens (-). dots (.) are not supported, and it cannot be all digits.
  • for other types (such as Linux) instances: the character length is 2 to 60. multiple dots are allowed. each segment between dots can include letters (case insensitive), digits, and hyphens (-).
  • . HostName *string `json:"HostName,omitnil,omitempty" name:"HostName"` - // Scheduled tasks. You can use this parameter to specify scheduled tasks for the instance. Only scheduled termination is supported. + // Scheduled task. You can specify a scheduled task for the instance through this parameter. Currently, only scheduled termination is supported. ActionTimer *ActionTimer `json:"ActionTimer,omitnil,omitempty" name:"ActionTimer"` - // Placement group ID. You can only specify one. + // Placement group ID. Only one can be specified. DisasterRecoverGroupIds []*string `json:"DisasterRecoverGroupIds,omitnil,omitempty" name:"DisasterRecoverGroupIds"` - // The tag description list. This parameter is used to bind a tag to a resource instance. A tag can only be bound to CVM instances. + // List of tag descriptions. You can bind tags to corresponding resource instances at the same time by specifying this parameter. Currently, only binding tags to the CVM is supported. TagSpecification []*TagSpecification `json:"TagSpecification,omitnil,omitempty" name:"TagSpecification"` - // Market options of the instance, such as parameters related to spot instances. This parameter is required for spot instances. + // Market-Related options of the instance, such as relevant parameters of the bidding instance. this parameter is required if the payment mode of the specified instance is spot payment. InstanceMarketOptions *InstanceMarketOptionsRequest `json:"InstanceMarketOptions,omitnil,omitempty" name:"InstanceMarketOptions"` - // User data provided to the instance. This parameter needs to be encoded in base64 format with the maximum size of 16KB. For more information on how to get the value of this parameter, see the commands you need to execute on startup for [Windows](https://intl.cloud.tencent.com/document/product/213/17526) or [Linux](https://intl.cloud.tencent.com/document/product/213/17525). + // User data provided for an instance must be encoded in base64. valid values for maximum data size are up to 16 KB. for details on obtaining this parameter, see running commands at startup for Windows (https://intl.cloud.tencent.com/document/product/213/17526?from_cn_redirect=1) and Linux (https://intl.cloud.tencent.com/document/product/213/17525?from_cn_redirect=1). UserData *string `json:"UserData,omitnil,omitempty" name:"UserData"` - // Whether the request is a dry run only. - // true: dry run only. The request will not create instance(s). A dry run can check whether all the required parameters are specified, whether the request format is right, whether the request exceeds service limits, and whether the specified CVMs are available. - // If the dry run fails, the corresponding error code will be returned. - // If the dry run succeeds, the RequestId will be returned. - // false (default value): send a normal request and create instance(s) if all the requirements are met. + // Whether it is a pre-check for this request only. + // true: sends a check request without creating an instance. check items include whether required parameters are filled in, request format, service limits, and cvm inventory. + // If the check fails, return the corresponding error code. + // If the check passed, return RequestId. + // false (default): sends a normal request. after passing the check, creates an instance directly. DryRun *bool `json:"DryRun,omitnil,omitempty" name:"DryRun"` - // CAM role name, which can be obtained from the `roleName` field in the response of the [`DescribeRoleList`](https://intl.cloud.tencent.com/document/product/598/13887?from_cn_redirect=1) API. + // CAM role name. it can be obtained through the roleName in the return value from the API DescribeRoleList. CamRoleName *string `json:"CamRoleName,omitnil,omitempty" name:"CamRoleName"` - // HPC cluster ID. The HPC cluster must and can only be specified for a high-performance computing instance. + // High-performance computing cluster ID. If the created instance is a high-performance computing instance, the cluster where the instance is placed should be specified. Otherwise, it cannot be specified. HpcClusterId *string `json:"HpcClusterId,omitnil,omitempty" name:"HpcClusterId"` - // Instance [Billing Mode](https://intl.cloud.tencent.com/document/product/213/2180?from_cn_redirect=1). Valid values:
  • `PREPAID`: prepaid, i.e., billed for monthly-subscribed instances
  • `POSTPAID_BY_HOUR`: pay-as-you-go on an hourly basis
  • `CDHPAID`: billed for CDH instances, not the CVMs running on the CDHs.
  • `SPOTPAID`: billed for spot instances.
    Default value: POSTPAID_BY_HOUR. + // Instance [billing mode](https://intl.cloud.tencent.com/document/product/213/2180?from_cn_redirect=1).
  • PREPAID: prepaid, that is, monthly subscription.
  • POSTPAID_BY_HOUR: pay-as-you-go by hour.
  • CDHPAID: CDH instance (created based on CDH; the resources of the host are free of charge).
  • SPOTPAID: spot payment.
  • Default value: POSTPAID_BY_HOUR. InstanceChargeType *string `json:"InstanceChargeType,omitnil,omitempty" name:"InstanceChargeType"` - // Details of the monthly subscription, including the purchase period, auto-renewal. It is required if the `InstanceChargeType` is `PREPAID`. + // Prepaid mode, that is, annual and monthly subscription related parameter settings. Through this parameter, you can specify the purchase duration of annual and monthly subscription instances, whether to set auto-renewal, etc. If the specified instance's billing mode is the prepaid mode, this parameter must be passed. InstanceChargePrepaid *InstanceChargePrepaid `json:"InstanceChargePrepaid,omitnil,omitempty" name:"InstanceChargePrepaid"` - // Instance termination protection flag, indicating whether an instance is allowed to be deleted through an API. Valid values:
  • true: Instance protection is enabled, and the instance is not allowed to be deleted through the API.

  • false: Instance protection is disabled, and the instance is allowed to be deleted through the API.


  • Default value: false. + // Instance destruction protection flag: indicates whether an instance is allowed to be deleted through an api. value ranges from: - **TRUE**: indicates that instance protection is enabled, deletion through apis is not allowed. - **FALSE**: indicates that instance protection is disabled, deletion through apis is allowed. default value: FALSE. DisableApiTermination *bool `json:"DisableApiTermination,omitnil,omitempty" name:"DisableApiTermination"` - // Instance launch template tag description list. By specifying the TemplateTag parameter, you can bind tags to the instance launch template. + // Description list of tags. by specifying this parameter, tags can be bound to the instance launch template. LaunchTemplateTagSpecification []*TagSpecification `json:"LaunchTemplateTagSpecification,omitnil,omitempty" name:"LaunchTemplateTagSpecification"` + + // Custom metadata. specifies that custom metadata key-value pairs can be added when creating a CVM. + // Note: this field is in beta test. + Metadata *Metadata `json:"Metadata,omitnil,omitempty" name:"Metadata"` + + // Specifies that only the Update and Replace parameters are allowed. this parameter is valid only when custom Metadata is used in the template and Metadata is also transmitted in RunInstances. defaults to Replace. + // + // -Update: if template t contains this parameter with a value of Update and metadata=[k1:v1, k2:v2], then RunInstances (with metadata=[k2:v3]) + t creates a cvm using metadata=[k1:v1, k2:v3]. + // -Replace: if the template t contains this parameter with a value of Replace and metadata=[k1:v1, k2:v2], then when creating a cvm using RunInstances (with metadata=[k2:v3]) + t, the created cvm will use metadata=[k2:v3]. + // Note: this field is in beta test. + TemplateDataModifyAction *string `json:"TemplateDataModifyAction,omitnil,omitempty" name:"TemplateDataModifyAction"` } func (r *CreateLaunchTemplateRequest) ToJsonString() string { @@ -1164,6 +1186,8 @@ func (r *CreateLaunchTemplateRequest) FromJsonString(s string) error { delete(f, "InstanceChargePrepaid") delete(f, "DisableApiTermination") delete(f, "LaunchTemplateTagSpecification") + delete(f, "Metadata") + delete(f, "TemplateDataModifyAction") if len(f) > 0 { return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "CreateLaunchTemplateRequest has unknown keys!", "") } @@ -1172,7 +1196,7 @@ func (r *CreateLaunchTemplateRequest) FromJsonString(s string) error { // Predefined struct for user type CreateLaunchTemplateResponseParams struct { - // The ID of successfully created instance launch template. This parameter will be returned when the instance launch template is created through the `CreateLaunchTemplate` API. + // Specifies the ID of the successfully created instance launch template when this parameter is returned by creating an instance launch template through this interface. LaunchTemplateId *string `json:"LaunchTemplateId,omitnil,omitempty" name:"LaunchTemplateId"` // The unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem. @@ -1214,7 +1238,7 @@ type CreateLaunchTemplateVersionRequestParams struct { //
  • For instances created with the payment modes PREPAID or POSTPAID_BY_HOUR, the specific values can be obtained by calling the [DescribeInstanceTypeConfigs](https://intl.cloud.tencent.com/document/api/213/15749?from_cn_redirect=1) API for the latest specification table or referring to [Instance Specifications](https://intl.cloud.tencent.com/document/product/213/11518?from_cn_redirect=1). If this parameter is not specified, the system will dynamically assign a default model based on the current resource sales situation in a region.

  • For instances created with the payment mode CDHPAID, this parameter has the prefix "CDH_" and is generated based on the CPU and memory configuration. The specific format is: CDH_XCXG. For example, for creating a CDH instance with 1 CPU core and 1 GB memory, this parameter should be CDH_1C1G.
  • InstanceType *string `json:"InstanceType,omitnil,omitempty" name:"InstanceType"` - // The [image](https://intl.cloud.tencent.com/document/product/213/4940?from_cn_redirect=1) ID in the format of `img-xxx`. There are four types of images:
  • Public images
  • Custom images
  • Shared images
  • Marketplace images (for Chinese mainland only)

  • To check the image ID:
  • For public images, custom images, and shared images, go to the [console](https://console.cloud.tencent.com/cvm/image?rid=1&imageType=PUBLIC_IMAGE). For marketplace images, go to [Cloud Marketplace](https://market.cloud.tencent.com/list).
  • Call [DescribeImages](https://intl.cloud.tencent.com/document/api/213/15715?from_cn_redirect=1), pass in `InstanceType` to retrieve the list of images supported by the current model, and then find the `ImageId` in the response.
  • + // Assign an effective [mirror](https://intl.cloud.tencent.com/document/product/213/4940?from_cn_redirect=1) ID in the format like `img-xxx`. there are four image types:
  • PUBLIC image
  • custom image
  • shared image
  • cloud image market

  • you can obtain available mirror ids in the following ways:
  • the mirror ids of `PUBLIC image`, `custom image` and `shared image` can be queried by logging in to the [console](https://console.cloud.tencent.com/cvm/image?rid=1&imageType=PUBLIC_image); the mirror ID of `cloud image market` can be queried through the [cloud market](https://market.cloud.tencent.com/list).
  • call the api [DescribeImages](https://intl.cloud.tencent.com/document/api/213/15715?from_cn_redirect=1), input InstanceType to obtain the list of images supported by the current model, and take the `ImageId` field from the return information.
  • . ImageId *string `json:"ImageId,omitnil,omitempty" name:"ImageId"` // System disk configuration of the instance. If this parameter is not specified, the default value will be used. @@ -1232,16 +1256,16 @@ type CreateLaunchTemplateVersionRequestParams struct { // Number of instances to be purchased. Value range for monthly-subscribed instances: [1, 300]. Value range for pay-as-you-go instances: [1, 100]. Default value: 1. The specified number of instances to be purchased cannot exceed the remaining quota allowed for the user. For more information on quota, see CVM instance [Purchase Limits](https://intl.cloud.tencent.com/document/product/213/2664). InstanceCount *int64 `json:"InstanceCount,omitnil,omitempty" name:"InstanceCount"` - // Instance name.
  • If this parameter is not specified, "Unnamed" will be displayed by default.
  • If you purchase multiple instances and specify a pattern string `{R:x}`, numbers `[x, x+n-1]` will be generated, where `n` represents the number of instances purchased. For example, you specify a pattern string `server_{R:3}`. If you purchase only one instance, the instance will be named `server_3`; if you purchase two, they will be named `server_3` and `server_4`. You can specify multiple pattern strings in the format of `{R:x}`.
  • If you purchase multiple instances without specifying a pattern string, the instance names will be suffixed with `1, 2...n`, where `n` represents the number of instances purchased. For example, if you purchase two instances with the name `server_`, the instance names will be `server_1` and `server_2`.
  • This parameter can contain up to 60 characters (including pattern strings).
  • + // Instance display name.
  • if the instance display name is not specified, it will display by default as 'unnamed'.
  • when purchasing multiple instances, if the pattern string `{R:x}` is specified, it indicates generating numbers `[x, x+n-1]`, where `n` represents the number of purchased instances. for example, `server_{R:3}` will result in instance display names as `server_3` when purchasing 1 instance; when purchasing 2 instances, the instance display names will be `server_3` and `server_4` respectively. it supports specifying multiple pattern strings `{R:x}`.
  • when purchasing multiple instances, if no pattern string is specified, a suffix `1, 2...n` will be added to the instance display name, where `n` represents the number of purchased instances. for example, for `server_`, when purchasing 2 instances, the instance display names will be `server_1` and `server_2` respectively.
  • it supports up to 128 characters (including pattern strings).
  • . InstanceName *string `json:"InstanceName,omitnil,omitempty" name:"InstanceName"` - // Login settings of the instance. You can use this parameter to set the login method, password, and key of the instance or keep the login settings of the original image. By default, a random password will be generated and sent to you via the Message Center. + // Instance login settings. you can use this parameter to set the instance's login method to key or keep the original login settings of the image. LoginSettings *LoginSettings `json:"LoginSettings,omitnil,omitempty" name:"LoginSettings"` // Security groups to which the instance belongs. To obtain the security group IDs, you can call [DescribeSecurityGroups](https://intl.cloud.tencent.com/document/api/215/15808) and look for the `sgld` fields in the response. If this parameter is not specified, the instance will be associated with default security groups. SecurityGroupIds []*string `json:"SecurityGroupIds,omitnil,omitempty" name:"SecurityGroupIds"` - // Enhanced service. You can use this parameter to specify whether to enable services such as Anti-DDoS and Cloud Monitor. If this parameter is not specified, Cloud Monitor and Anti-DDoS are enabled for public images by default. However, for custom images and images from the marketplace, Anti-DDoS and Cloud Monitor are not enabled by default. The original services in the image will be retained. + // Enhanced service. this parameter can be used to specify whether to enable services such as cloud security and cloud monitoring. if this parameter is not specified, cloud monitor and cloud security services are enabled for public images by default; for custom images and marketplace images, cloud monitor and cloud security services are not enabled by default, and the services retained in the image will be used. EnhancedService *EnhancedService `json:"EnhancedService,omitnil,omitempty" name:"EnhancedService"` // A unique string supplied by the client to ensure that the request is idempotent. Its maximum length is 64 ASCII characters. If this parameter is not specified, the idempotency of the request cannot be guaranteed. @@ -1286,6 +1310,17 @@ type CreateLaunchTemplateVersionRequestParams struct { // Instance termination protection flag, indicating whether an instance is allowed to be deleted through an API. Valid values:
  • TRUE: Instance protection is enabled, and the instance is not allowed to be deleted through the API.

  • FALSE: Instance protection is disabled, and the instance is allowed to be deleted through the API.


  • Default value: FALSE. DisableApiTermination *bool `json:"DisableApiTermination,omitnil,omitempty" name:"DisableApiTermination"` + + // Custom metadata. specifies that custom metadata key-value pairs can be added when creating a CVM. + // Note: this field is in beta test. + Metadata *Metadata `json:"Metadata,omitnil,omitempty" name:"Metadata"` + + // Specifies that only the Update and Replace parameters are allowed. this parameter is valid only when custom Metadata is used in the template and Metadata is also transmitted in RunInstances. defaults to Replace. + // + // -Update: if template t contains this parameter with a value of Update and metadata=[k1:v1, k2:v2], then RunInstances (with metadata=[k2:v3]) + t creates a cvm using metadata=[k1:v1, k2:v3]. + // -Replace: if the template t contains this parameter with a value of Replace and metadata=[k1:v1, k2:v2], then when creating a cvm using RunInstances (with metadata=[k2:v3]) + t, the created cvm will use metadata=[k2:v3]. + // Note: this field is in beta test. + TemplateDataModifyAction *string `json:"TemplateDataModifyAction,omitnil,omitempty" name:"TemplateDataModifyAction"` } type CreateLaunchTemplateVersionRequest struct { @@ -1308,7 +1343,7 @@ type CreateLaunchTemplateVersionRequest struct { //
  • For instances created with the payment modes PREPAID or POSTPAID_BY_HOUR, the specific values can be obtained by calling the [DescribeInstanceTypeConfigs](https://intl.cloud.tencent.com/document/api/213/15749?from_cn_redirect=1) API for the latest specification table or referring to [Instance Specifications](https://intl.cloud.tencent.com/document/product/213/11518?from_cn_redirect=1). If this parameter is not specified, the system will dynamically assign a default model based on the current resource sales situation in a region.

  • For instances created with the payment mode CDHPAID, this parameter has the prefix "CDH_" and is generated based on the CPU and memory configuration. The specific format is: CDH_XCXG. For example, for creating a CDH instance with 1 CPU core and 1 GB memory, this parameter should be CDH_1C1G.
  • InstanceType *string `json:"InstanceType,omitnil,omitempty" name:"InstanceType"` - // The [image](https://intl.cloud.tencent.com/document/product/213/4940?from_cn_redirect=1) ID in the format of `img-xxx`. There are four types of images:
  • Public images
  • Custom images
  • Shared images
  • Marketplace images (for Chinese mainland only)

  • To check the image ID:
  • For public images, custom images, and shared images, go to the [console](https://console.cloud.tencent.com/cvm/image?rid=1&imageType=PUBLIC_IMAGE). For marketplace images, go to [Cloud Marketplace](https://market.cloud.tencent.com/list).
  • Call [DescribeImages](https://intl.cloud.tencent.com/document/api/213/15715?from_cn_redirect=1), pass in `InstanceType` to retrieve the list of images supported by the current model, and then find the `ImageId` in the response.
  • + // Assign an effective [mirror](https://intl.cloud.tencent.com/document/product/213/4940?from_cn_redirect=1) ID in the format like `img-xxx`. there are four image types:
  • PUBLIC image
  • custom image
  • shared image
  • cloud image market

  • you can obtain available mirror ids in the following ways:
  • the mirror ids of `PUBLIC image`, `custom image` and `shared image` can be queried by logging in to the [console](https://console.cloud.tencent.com/cvm/image?rid=1&imageType=PUBLIC_image); the mirror ID of `cloud image market` can be queried through the [cloud market](https://market.cloud.tencent.com/list).
  • call the api [DescribeImages](https://intl.cloud.tencent.com/document/api/213/15715?from_cn_redirect=1), input InstanceType to obtain the list of images supported by the current model, and take the `ImageId` field from the return information.
  • . ImageId *string `json:"ImageId,omitnil,omitempty" name:"ImageId"` // System disk configuration of the instance. If this parameter is not specified, the default value will be used. @@ -1326,16 +1361,16 @@ type CreateLaunchTemplateVersionRequest struct { // Number of instances to be purchased. Value range for monthly-subscribed instances: [1, 300]. Value range for pay-as-you-go instances: [1, 100]. Default value: 1. The specified number of instances to be purchased cannot exceed the remaining quota allowed for the user. For more information on quota, see CVM instance [Purchase Limits](https://intl.cloud.tencent.com/document/product/213/2664). InstanceCount *int64 `json:"InstanceCount,omitnil,omitempty" name:"InstanceCount"` - // Instance name.
  • If this parameter is not specified, "Unnamed" will be displayed by default.
  • If you purchase multiple instances and specify a pattern string `{R:x}`, numbers `[x, x+n-1]` will be generated, where `n` represents the number of instances purchased. For example, you specify a pattern string `server_{R:3}`. If you purchase only one instance, the instance will be named `server_3`; if you purchase two, they will be named `server_3` and `server_4`. You can specify multiple pattern strings in the format of `{R:x}`.
  • If you purchase multiple instances without specifying a pattern string, the instance names will be suffixed with `1, 2...n`, where `n` represents the number of instances purchased. For example, if you purchase two instances with the name `server_`, the instance names will be `server_1` and `server_2`.
  • This parameter can contain up to 60 characters (including pattern strings).
  • + // Instance display name.
  • if the instance display name is not specified, it will display by default as 'unnamed'.
  • when purchasing multiple instances, if the pattern string `{R:x}` is specified, it indicates generating numbers `[x, x+n-1]`, where `n` represents the number of purchased instances. for example, `server_{R:3}` will result in instance display names as `server_3` when purchasing 1 instance; when purchasing 2 instances, the instance display names will be `server_3` and `server_4` respectively. it supports specifying multiple pattern strings `{R:x}`.
  • when purchasing multiple instances, if no pattern string is specified, a suffix `1, 2...n` will be added to the instance display name, where `n` represents the number of purchased instances. for example, for `server_`, when purchasing 2 instances, the instance display names will be `server_1` and `server_2` respectively.
  • it supports up to 128 characters (including pattern strings).
  • . InstanceName *string `json:"InstanceName,omitnil,omitempty" name:"InstanceName"` - // Login settings of the instance. You can use this parameter to set the login method, password, and key of the instance or keep the login settings of the original image. By default, a random password will be generated and sent to you via the Message Center. + // Instance login settings. you can use this parameter to set the instance's login method to key or keep the original login settings of the image. LoginSettings *LoginSettings `json:"LoginSettings,omitnil,omitempty" name:"LoginSettings"` // Security groups to which the instance belongs. To obtain the security group IDs, you can call [DescribeSecurityGroups](https://intl.cloud.tencent.com/document/api/215/15808) and look for the `sgld` fields in the response. If this parameter is not specified, the instance will be associated with default security groups. SecurityGroupIds []*string `json:"SecurityGroupIds,omitnil,omitempty" name:"SecurityGroupIds"` - // Enhanced service. You can use this parameter to specify whether to enable services such as Anti-DDoS and Cloud Monitor. If this parameter is not specified, Cloud Monitor and Anti-DDoS are enabled for public images by default. However, for custom images and images from the marketplace, Anti-DDoS and Cloud Monitor are not enabled by default. The original services in the image will be retained. + // Enhanced service. this parameter can be used to specify whether to enable services such as cloud security and cloud monitoring. if this parameter is not specified, cloud monitor and cloud security services are enabled for public images by default; for custom images and marketplace images, cloud monitor and cloud security services are not enabled by default, and the services retained in the image will be used. EnhancedService *EnhancedService `json:"EnhancedService,omitnil,omitempty" name:"EnhancedService"` // A unique string supplied by the client to ensure that the request is idempotent. Its maximum length is 64 ASCII characters. If this parameter is not specified, the idempotency of the request cannot be guaranteed. @@ -1380,6 +1415,17 @@ type CreateLaunchTemplateVersionRequest struct { // Instance termination protection flag, indicating whether an instance is allowed to be deleted through an API. Valid values:
  • TRUE: Instance protection is enabled, and the instance is not allowed to be deleted through the API.

  • FALSE: Instance protection is disabled, and the instance is allowed to be deleted through the API.


  • Default value: FALSE. DisableApiTermination *bool `json:"DisableApiTermination,omitnil,omitempty" name:"DisableApiTermination"` + + // Custom metadata. specifies that custom metadata key-value pairs can be added when creating a CVM. + // Note: this field is in beta test. + Metadata *Metadata `json:"Metadata,omitnil,omitempty" name:"Metadata"` + + // Specifies that only the Update and Replace parameters are allowed. this parameter is valid only when custom Metadata is used in the template and Metadata is also transmitted in RunInstances. defaults to Replace. + // + // -Update: if template t contains this parameter with a value of Update and metadata=[k1:v1, k2:v2], then RunInstances (with metadata=[k2:v3]) + t creates a cvm using metadata=[k1:v1, k2:v3]. + // -Replace: if the template t contains this parameter with a value of Replace and metadata=[k1:v1, k2:v2], then when creating a cvm using RunInstances (with metadata=[k2:v3]) + t, the created cvm will use metadata=[k2:v3]. + // Note: this field is in beta test. + TemplateDataModifyAction *string `json:"TemplateDataModifyAction,omitnil,omitempty" name:"TemplateDataModifyAction"` } func (r *CreateLaunchTemplateVersionRequest) ToJsonString() string { @@ -1422,6 +1468,8 @@ func (r *CreateLaunchTemplateVersionRequest) FromJsonString(s string) error { delete(f, "InstanceChargeType") delete(f, "InstanceChargePrepaid") delete(f, "DisableApiTermination") + delete(f, "Metadata") + delete(f, "TemplateDataModifyAction") if len(f) > 0 { return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "CreateLaunchTemplateVersionRequest has unknown keys!", "") } @@ -1454,64 +1502,43 @@ func (r *CreateLaunchTemplateVersionResponse) FromJsonString(s string) error { } type DataDisk struct { - // Data disk size (in GB). The minimum adjustment increment is 10 GB. The value range varies by data disk type. For more information on limits, see [Storage Overview](https://intl.cloud.tencent.com/document/product/213/4952?from_cn_redirect=1). The default value is 0, indicating that no data disk is purchased. For more information, see the product documentation. + // Data disk size, unit: GiB. the minimum adjustment step size is 10 GiB. the value ranges of different data disk types vary. for specific limitations, see the storage overview (https://intl.cloud.tencent.com/document/product/213/4952?from_cn_redirect=1). the default value is 0, which means no data disk purchase. for more restrictions, see the product document. DiskSize *int64 `json:"DiskSize,omitnil,omitempty" name:"DiskSize"` // Data disk type. For the detailed restrictions on the data disk type, refer to [Storage Overview](https://cloud.tencent.com/document/product/213/4952). Valid values:
  • LOCAL_BASIC: Local Disk
  • LOCAL_SSD: Local SSD
  • LOCAL_NVME: Local NVMe Disk, which is strongly related with InstanceType and can not be specified
  • LOCAL_PRO: Local HDD, which is strongly related with InstanceType and can not be specified
  • CLOUD_BASIC: Basic Cloud Disk
  • CLOUD_PREMIUM: Premium Disk
  • CLOUD_SSD: Cloud SSD
  • CLOUD_HSSD: Enhanced SSD
  • CLOUD_TSSD: Tremendous SSD
  • CLOUD_BSSD: Balanced SSD

    Default value: LOCAL_BASIC.

    This parameter is invalid for the `ResizeInstanceDisk` API.
  • DiskType *string `json:"DiskType,omitnil,omitempty" name:"DiskType"` - // Data disk ID. Note that it's not available for `LOCAL_BASIC` and `LOCAL_SSD` disks. - // It is only used as a response parameter for APIs such as `DescribeInstances`, and cannot be used as a request parameter for APIs such as `RunInstances`. + // Specifies the data disk ID. + // This parameter currently only serves as a response parameter for query apis such as `DescribeInstances`, and cannot be used as an input parameter for write apis such as `RunInstances`. DiskId *string `json:"DiskId,omitnil,omitempty" name:"DiskId"` - // Whether the data disk is terminated with the Cloud Virtual Machine (CVM). Valid values: - // - //
  • true: Terminate the data disk when the CVM is terminated. Only the pay-as-you-go cloud disk billed by hour is supported.
  • - //
  • - // false: Retain the data disk when the CVM is terminated.
    - // Default value: true.
    - // This parameter is currently only used for the `RunInstances` API. - //
  • - // Note: This field may return null, indicating that no valid value is found. + // Whether the data disk is terminated with the instance. value range:
  • true: when the instance is terminated, the data disk is also terminated. only hourly postpaid cloud disks are supported.
  • false: when the instance is terminated, the data disk is retained.
    default value: true
    currently, this parameter is only used for the API `RunInstances`. DeleteWithInstance *bool `json:"DeleteWithInstance,omitnil,omitempty" name:"DeleteWithInstance"` - // Data disk snapshot ID. The size of the selected data disk snapshot must be smaller than that of the data disk. - // Note: This field may return null, indicating that no valid value is found. + // Data disk snapshot ID. the size of the selected data disk snapshot must be less than the data disk size. SnapshotId *string `json:"SnapshotId,omitnil,omitempty" name:"SnapshotId"` - // Whether a data disk is encrypted. Valid values: - //
  • true: encrypted.
  • - //
  • - // false: not encrypted.
    - // Default value: false.
    - // This parameter is currently used only in the `RunInstances` API. - //
  • - // Note: This field may return null, indicating that no valid value is found. + // Specifies whether the data disk is encrypted. value range:
  • true: encrypted
  • false: unencrypted

  • default value: false
    this parameter is currently only used for the `RunInstances` api. Encrypt *bool `json:"Encrypt,omitnil,omitempty" name:"Encrypt"` - // ID of the custom CMK in the format of UUID or "kms-abcd1234". This parameter is used to encrypt cloud disks. + // Custom CMK's corresponding ID, with a value of UUID or something similar to kms - abcd1234. used for encrypting cloud disks. // - // Currently, this parameter is only used in the `RunInstances` API. - // Note: this field may return null, indicating that no valid values can be obtained. + // This parameter is currently only used for the `RunInstances` api. KmsKeyId *string `json:"KmsKeyId,omitnil,omitempty" name:"KmsKeyId"` - // Cloud disk performance, in MB/s - // Note: this field may return `null`, indicating that no valid values can be obtained. + // Specifies the cloud disk performance (unit: MiB/s). using this parameter allows you to purchase additional performance for the cloud disk. + // Currently only supports ultra-fast CLOUD disk (CLOUD_TSSD) and enhanced SSD CLOUD disk (CLOUD_HSSD). ThroughputPerformance *int64 `json:"ThroughputPerformance,omitnil,omitempty" name:"ThroughputPerformance"` - // ID of the dedicated cluster to which the instance belongs. - // Note: this field may return `null`, indicating that no valid values can be obtained. + // Specifies the exclusive cluster ID it belongs to. CdcId *string `json:"CdcId,omitnil,omitempty" name:"CdcId"` // Burst performance. // - // Note: This field is in beta test. - // Note: This field may return null, indicating that no valid value is found. + // Note: this feature is in beta test.. BurstPerformance *bool `json:"BurstPerformance,omitnil,omitempty" name:"BurstPerformance"` - // Disk name, with a length of not more than 128 characters. - // - // This parameter is in invite-only testing and is not yet open for use. + // Disk name, with a length not exceeding 128 characters. DiskName *string `json:"DiskName,omitnil,omitempty" name:"DiskName"` } @@ -2618,6 +2645,72 @@ func (r *DescribeInstanceFamilyConfigsResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } +// Predefined struct for user +type DescribeInstancesAttributesRequestParams struct { + // Instance attributes to be obtained. Valid value(s): + // UserData: Custom data of instances. + Attributes []*string `json:"Attributes,omitnil,omitempty" name:"Attributes"` + + // Instance ID list. + InstanceIds []*string `json:"InstanceIds,omitnil,omitempty" name:"InstanceIds"` +} + +type DescribeInstancesAttributesRequest struct { + *tchttp.BaseRequest + + // Instance attributes to be obtained. Valid value(s): + // UserData: Custom data of instances. + Attributes []*string `json:"Attributes,omitnil,omitempty" name:"Attributes"` + + // Instance ID list. + InstanceIds []*string `json:"InstanceIds,omitnil,omitempty" name:"InstanceIds"` +} + +func (r *DescribeInstancesAttributesRequest) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *DescribeInstancesAttributesRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "Attributes") + delete(f, "InstanceIds") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeInstancesAttributesRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DescribeInstancesAttributesResponseParams struct { + // List of attributes of specified instances. + InstanceSet []*InstanceAttribute `json:"InstanceSet,omitnil,omitempty" name:"InstanceSet"` + + // The unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem. + RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` +} + +type DescribeInstancesAttributesResponse struct { + *tchttp.BaseResponse + Response *DescribeInstancesAttributesResponseParams `json:"Response"` +} + +func (r *DescribeInstancesAttributesResponse) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *DescribeInstancesAttributesResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + // Predefined struct for user type DescribeInstancesOperationLimitRequestParams struct { // Query by instance ID(s). You can obtain the instance IDs from the value of `InstanceId` returned by the [DescribeInstances](https://intl.cloud.tencent.com/document/api/213/15728?from_cn_redirect=1) API. For example, instance ID: ins-xxxxxxxx. (For the specific format, refer to section `ids.N` of the API [Introduction](https://intl.cloud.tencent.com/document/api/213/15688?from_cn_redirect=1).) You can query up to 100 instances in each request. @@ -4100,16 +4193,13 @@ func (r *ExportImagesResponse) FromJsonString(s string) error { } type Externals struct { - // Release address - // Note: This field may return null, indicating that no valid value is found. + // Release Address ReleaseAddress *bool `json:"ReleaseAddress,omitnil,omitempty" name:"ReleaseAddress"` - // Not supported network. Value:
  • BASIC: classic network
  • VPC1.0: VPC1.0 - // Note: This field may return null, indicating that no valid value was found. + // Unsupported network type. valid values:
  • BASIC: BASIC network
  • VPC1.0: private network VPC1.0
  • . UnsupportNetworks []*string `json:"UnsupportNetworks,omitnil,omitempty" name:"UnsupportNetworks"` - // Attributes of local HDD storage - // Note: This field may return null, indicating that no valid value is found. + // Specifies the HDD local storage attributes. StorageBlockAttr *StorageBlock `json:"StorageBlockAttr,omitnil,omitempty" name:"StorageBlockAttr"` } @@ -5219,13 +5309,19 @@ type Instance struct { LatestOperationErrorMsg *string `json:"LatestOperationErrorMsg,omitnil,omitempty" name:"LatestOperationErrorMsg"` } +type InstanceAttribute struct { + // Instance ID. + InstanceId *string `json:"InstanceId,omitnil,omitempty" name:"InstanceId"` + + // Instance attribute information. + Attributes *Attribute `json:"Attributes,omitnil,omitempty" name:"Attributes"` +} + type InstanceChargePrepaid struct { - // Subscription period (in month). Valid values: `1`, `2`, `3`, `4`, `5`, `6`, `7`, `8`, `9`, `10`, `11`, `12`, `24`, `36`, `48’, `60`. - // Note: This field may return `null`, indicating that no valid values can be obtained. + // Subscription period in months. value range: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 24, 36, 48, 60. Period *int64 `json:"Period,omitnil,omitempty" name:"Period"` - // Auto-renewal flag. Valid values:
  • NOTIFY_AND_AUTO_RENEW: Notify of expiration and automatically renew.

  • NOTIFY_AND_MANUAL_RENEW: Notify of expiration and manually renew.

  • DISABLE_NOTIFY_AND_MANUAL_RENEW: Do not notify of expiration and do not automatically renew.


  • Default value: NOTIFY_AND_MANUAL_RENEW. If this parameter is set to NOTIFY_AND_AUTO_RENEW, an instance will be automatically renewed monthly after expiration, provided that the account balance is sufficient. - // Note: This field may return null, indicating that no valid value is found. + // AUTO-Renewal flag. value ranges:
  • NOTIFY_AND_AUTO_RENEW: NOTIFY of expiration AND automatically RENEW.

  • NOTIFY_AND_MANUAL_RENEW: NOTIFY of expiration but do not automatically RENEW.

  • DISABLE_NOTIFY_AND_MANUAL_RENEW: do not NOTIFY of expiration AND do not automatically RENEW.


  • default value: NOTIFY_AND_MANUAL_RENEW. if this parameter is set to NOTIFY_AND_AUTO_RENEW, the instance will be automatically renewed monthly after expiration, provided that the account balance is sufficient. RenewFlag *string `json:"RenewFlag,omitnil,omitempty" name:"RenewFlag"` } @@ -5238,12 +5334,10 @@ type InstanceFamilyConfig struct { } type InstanceMarketOptionsRequest struct { - // Spot-related options - // Note: This field may return `null`, indicating that no valid values can be obtained. + // Relevant options for spot instances. SpotOptions *SpotMarketOptions `json:"SpotOptions,omitnil,omitempty" name:"SpotOptions"` - // Market type. Valid value: `spot`. - // Note: This field may return `null`, indicating that no valid values can be obtained. + // Market option type. The value can only be spot currently. MarketType *string `json:"MarketType,omitnil,omitempty" name:"MarketType"` } @@ -5343,7 +5437,7 @@ type InternetAccessible struct { // Whether to allocate a public IP address. Valid values:
  • true: Allocate a public IP address.
  • false: Do not allocate a public IP address.

  • When the public network bandwidth is greater than 0 Mbps, you can choose whether to enable the public IP address. The public IP address is enabled by default. When the public network bandwidth is 0, allocating the public IP address is not supported. This parameter is only used as an input parameter in the RunInstances API. PublicIpAssigned *bool `json:"PublicIpAssigned,omitnil,omitempty" name:"PublicIpAssigned"` - // Bandwidth package ID. To obatin the IDs, you can call [`DescribeBandwidthPackages`](https://intl.cloud.tencent.com/document/api/215/19209?from_cn_redirect=1) and look for the `BandwidthPackageId` fields in the response. + // Bandwidth package ID. it can be obtained through the `BandwidthPackageId` in the return value from the DescribeBandwidthPackages api. this parameter is used as an input parameter only in the RunInstances api. BandwidthPackageId *string `json:"BandwidthPackageId,omitnil,omitempty" name:"BandwidthPackageId"` } @@ -5663,11 +5757,23 @@ type LoginSettings struct { // Note: This field may return `null`, indicating that no valid values can be obtained. KeyIds []*string `json:"KeyIds,omitnil,omitempty" name:"KeyIds"` - // Maintains the original settings of the image. This parameter cannot be specified simultaneously with Password or KeyIds.N. It can be set to true only when an instance is created with a custom image, shared image, or externally imported image. Valid values:
  • true: indicates that the login settings of the image are maintained
  • false: indicates that the login settings of the image are not maintained
  • Default value: false. - // Note: This field may return null, indicating that no valid value is found. + // Retain the original settings of the image. this parameter cannot be specified simultaneously with Password or KeyIds.N. it can be set to true only when an instance is created with a custom image, shared image, or externally imported image. value ranges from true to false:
  • true: indicates that the login settings of the image are retained
  • false: indicates that the login settings of the image are not retained
  • . default value: false. KeepImageLogin *string `json:"KeepImageLogin,omitnil,omitempty" name:"KeepImageLogin"` } +type Metadata struct { + // A list of custom metadata key-value pairs. + Items []*MetadataItem `json:"Items,omitnil,omitempty" name:"Items"` +} + +type MetadataItem struct { + // Custom metadata key. it must comply with the regular expression ^[a-zA-Z0-9_-]+$. the length is less than or equal to 128 bytes (case-sensitive). + Key *string `json:"Key,omitnil,omitempty" name:"Key"` + + // Specifies a custom metadata value. it supports any data . The size is ≤ 256 KB. it is case-sensitive. + Value *string `json:"Value,omitnil,omitempty" name:"Value"` +} + // Predefined struct for user type ModifyChcAttributeRequestParams struct { // CHC host IDs @@ -7705,7 +7811,7 @@ func (r *RunInstancesResponse) FromJsonString(s string) error { } type RunMonitorServiceEnabled struct { - // Whether to enable [Cloud Monitor](https://intl.cloud.tencent.com/document/product/248?from_cn_redirect=1). Valid values:
  • TRUE: enable Cloud Monitor
  • FALSE: do not enable Cloud Monitor

    Default value: TRUE. + // Whether to enable the cloud monitor service. value ranges from:
  • true: indicates enabling the cloud monitor service
  • false: indicates disabling the cloud monitor service
  • default value: true. Enabled *bool `json:"Enabled,omitnil,omitempty" name:"Enabled"` } @@ -7736,10 +7842,10 @@ type Snapshot struct { } type SpotMarketOptions struct { - // Bidding price + // Bid price. MaxPrice *string `json:"MaxPrice,omitnil,omitempty" name:"MaxPrice"` - // Bidding request type. Currently only "one-time" is supported. + // Bid request type. valid values: one-time. currently, only the one-time type is supported. SpotInstanceType *string `json:"SpotInstanceType,omitnil,omitempty" name:"SpotInstanceType"` } @@ -7877,16 +7983,13 @@ func (r *StopInstancesResponse) FromJsonString(s string) error { } type StorageBlock struct { - // Local HDD storage type. Value: LOCAL_PRO. - // Note: This field may return null, indicating that no valid value is found. + // HDD LOCAL storage type specifies the value: LOCAL_PRO. Type *string `json:"Type,omitnil,omitempty" name:"Type"` - // Minimum capacity of local HDD storage - // Note: This field may return null, indicating that no valid value is found. + // Specifies the minimum HDD local storage capacity. measurement unit: GiB. MinSize *int64 `json:"MinSize,omitnil,omitempty" name:"MinSize"` - // Maximum capacity of local HDD storage - // Note: This field may return null, indicating that no valid value is found. + // Specifies the maximum capacity of HDD local storage. measurement unit: GiB. MaxSize *int64 `json:"MaxSize,omitnil,omitempty" name:"MaxSize"` } @@ -8014,32 +8117,29 @@ func (r *SyncImagesResponse) FromJsonString(s string) error { } type SystemDisk struct { - // System disk type. For the restrictions on the system disk type, refer to [Storage Overview](https://intl.cloud.tencent.com/document/product/213/4952?from_cn_redirect=1). Value values:
    - //
  • LOCAL_BASIC: Local Disk
  • - //
  • LOCAL_SSD: Local SSD
  • - //
  • CLOUD_BASIC: Basic Cloud Disk
  • - //
  • CLOUD_SSD: Cloud SSD
  • - //
  • CLOUD_PREMIUM: Premium Disk
  • - //
  • CLOUD_BSSD: Balanced SSD
  • - //
  • CLOUD_HSSD: Enhanced SSD
  • - //
  • CLOUD_TSSD: Tremendous SSD

  • + // Specifies the system disk type. for the restrictions on the system disk type, refer to [storage overview](https://intl.cloud.tencent.com/document/product/213/4952?from_cn_redirect=1). value range:
    . + //
  • LOCAL_BASIC: specifies a local hard disk.
  • . + //
  • LOCAL_SSD: specifies a local ssd.
  • . + //
  • CLOUD_BASIC: ordinary cloud disk.
  • . + //
  • CLOUD_SSD: ssd cloud disk
  • . + //
  • CLOUD_PREMIUM: high-performance cloud block storage.
  • . + //
  • CLOUD_BSSD: universal type ssd cloud disk
  • . + //
  • CLOUD_HSSD: enhanced ssd cloud disk
  • . + //
  • CLOUD_TSSD: ultra-fast SSD cbstrue: It is used as a public gateway.
  • false: It is not used as a public gateway.
  • Default value: false. diff --git a/vendor/github.com/tencentcloud/tencentcloud-sdk-go-intl-en/tencentcloud/mdl/v20200326/client.go b/vendor/github.com/tencentcloud/tencentcloud-sdk-go-intl-en/tencentcloud/mdl/v20200326/client.go index f842e6aae2..e3ceaa478b 100644 --- a/vendor/github.com/tencentcloud/tencentcloud-sdk-go-intl-en/tencentcloud/mdl/v20200326/client.go +++ b/vendor/github.com/tencentcloud/tencentcloud-sdk-go-intl-en/tencentcloud/mdl/v20200326/client.go @@ -633,57 +633,6 @@ func (c *Client) DeleteStreamLiveWatermarkWithContext(ctx context.Context, reque return } -func NewDescribeMediaLiveHighlightResultRequest() (request *DescribeMediaLiveHighlightResultRequest) { - request = &DescribeMediaLiveHighlightResultRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("mdl", APIVersion, "DescribeMediaLiveHighlightResult") - - - return -} - -func NewDescribeMediaLiveHighlightResultResponse() (response *DescribeMediaLiveHighlightResultResponse) { - response = &DescribeMediaLiveHighlightResultResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return - -} - -// DescribeMediaLiveHighlightResult -// Query the highlight result information corresponding to the media live broadcast channel. -// -// error code that may be returned: -// INVALIDPARAMETER_ID = "InvalidParameter.Id" -// INVALIDPARAMETER_NOTFOUND = "InvalidParameter.NotFound" -func (c *Client) DescribeMediaLiveHighlightResult(request *DescribeMediaLiveHighlightResultRequest) (response *DescribeMediaLiveHighlightResultResponse, err error) { - return c.DescribeMediaLiveHighlightResultWithContext(context.Background(), request) -} - -// DescribeMediaLiveHighlightResult -// Query the highlight result information corresponding to the media live broadcast channel. -// -// error code that may be returned: -// INVALIDPARAMETER_ID = "InvalidParameter.Id" -// INVALIDPARAMETER_NOTFOUND = "InvalidParameter.NotFound" -func (c *Client) DescribeMediaLiveHighlightResultWithContext(ctx context.Context, request *DescribeMediaLiveHighlightResultRequest) (response *DescribeMediaLiveHighlightResultResponse, err error) { - if request == nil { - request = NewDescribeMediaLiveHighlightResultRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DescribeMediaLiveHighlightResult require credential") - } - - request.SetContext(ctx) - - response = NewDescribeMediaLiveHighlightResultResponse() - err = c.Send(request, response) - return -} - func NewDescribeStreamLiveChannelRequest() (request *DescribeStreamLiveChannelRequest) { request = &DescribeStreamLiveChannelRequest{ BaseRequest: &tchttp.BaseRequest{}, @@ -1475,6 +1424,55 @@ func (c *Client) DescribeStreamLiveWatermarksWithContext(ctx context.Context, re return } +func NewGetAbWatermarkPlayUrlRequest() (request *GetAbWatermarkPlayUrlRequest) { + request = &GetAbWatermarkPlayUrlRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("mdl", APIVersion, "GetAbWatermarkPlayUrl") + + + return +} + +func NewGetAbWatermarkPlayUrlResponse() (response *GetAbWatermarkPlayUrlResponse) { + response = &GetAbWatermarkPlayUrlResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return + +} + +// GetAbWatermarkPlayUrl +// Get AB watermark play url. +// +// error code that may be returned: +// INVALIDPARAMETER = "InvalidParameter" +func (c *Client) GetAbWatermarkPlayUrl(request *GetAbWatermarkPlayUrlRequest) (response *GetAbWatermarkPlayUrlResponse, err error) { + return c.GetAbWatermarkPlayUrlWithContext(context.Background(), request) +} + +// GetAbWatermarkPlayUrl +// Get AB watermark play url. +// +// error code that may be returned: +// INVALIDPARAMETER = "InvalidParameter" +func (c *Client) GetAbWatermarkPlayUrlWithContext(ctx context.Context, request *GetAbWatermarkPlayUrlRequest) (response *GetAbWatermarkPlayUrlResponse, err error) { + if request == nil { + request = NewGetAbWatermarkPlayUrlRequest() + } + + if c.GetCredential() == nil { + return nil, errors.New("GetAbWatermarkPlayUrl require credential") + } + + request.SetContext(ctx) + + response = NewGetAbWatermarkPlayUrlResponse() + err = c.Send(request, response) + return +} + func NewModifyStreamLiveChannelRequest() (request *ModifyStreamLiveChannelRequest) { request = &ModifyStreamLiveChannelRequest{ BaseRequest: &tchttp.BaseRequest{}, diff --git a/vendor/github.com/tencentcloud/tencentcloud-sdk-go-intl-en/tencentcloud/mdl/v20200326/models.go b/vendor/github.com/tencentcloud/tencentcloud-sdk-go-intl-en/tencentcloud/mdl/v20200326/models.go index 1812a0bed8..036724cc33 100644 --- a/vendor/github.com/tencentcloud/tencentcloud-sdk-go-intl-en/tencentcloud/mdl/v20200326/models.go +++ b/vendor/github.com/tencentcloud/tencentcloud-sdk-go-intl-en/tencentcloud/mdl/v20200326/models.go @@ -30,10 +30,10 @@ type AVTemplate struct { // Video codec. Valid values: `H264`, `H265`. If this parameter is left empty, the original video codec will be used. Vcodec *string `json:"Vcodec,omitnil,omitempty" name:"Vcodec"` - // Video width. Value range: (0, 3000]. The value must be an integer multiple of 4. If this parameter is left empty, the original video width will be used. + // Video width. Value range: (0, 4096]. The value must be an integer multiple of 2. If this parameter is left empty, the original video width will be used. Width *uint64 `json:"Width,omitnil,omitempty" name:"Width"` - // Video height. Value range: (0, 3000]. The value must be an integer multiple of 4. If this parameter is left empty, the original video height will be used. + // Video height. Value range: (0, 4096]. The value must be an integer multiple of 2. If this parameter is left empty, the original video height will be used. Height *uint64 `json:"Height,omitnil,omitempty" name:"Height"` // Video frame rate. Value range: [1, 240]. If this parameter is left empty, the original frame rate will be used. @@ -1172,106 +1172,6 @@ type DescribeImageSettings struct { Height *int64 `json:"Height,omitnil,omitempty" name:"Height"` } -// Predefined struct for user -type DescribeMediaLiveHighlightResultRequestParams struct { - // Media live broadcast channel ID. - Id *string `json:"Id,omitnil,omitempty" name:"Id"` - - // Query start time, unix timestamp, query data within the last 6 hours by default, and the maximum query range supports the last 7 days. - StartTime *uint64 `json:"StartTime,omitnil,omitempty" name:"StartTime"` - - // Query end time, Unix timestamp, query data within the last 6 hours by default, and the maximum query range supports the last 7 days. - EndTime *uint64 `json:"EndTime,omitnil,omitempty" name:"EndTime"` - - // Paging query page number. - PageNum *uint64 `json:"PageNum,omitnil,omitempty" name:"PageNum"` - - // Paging query the size of each page. - PageSize *uint64 `json:"PageSize,omitnil,omitempty" name:"PageSize"` -} - -type DescribeMediaLiveHighlightResultRequest struct { - *tchttp.BaseRequest - - // Media live broadcast channel ID. - Id *string `json:"Id,omitnil,omitempty" name:"Id"` - - // Query start time, unix timestamp, query data within the last 6 hours by default, and the maximum query range supports the last 7 days. - StartTime *uint64 `json:"StartTime,omitnil,omitempty" name:"StartTime"` - - // Query end time, Unix timestamp, query data within the last 6 hours by default, and the maximum query range supports the last 7 days. - EndTime *uint64 `json:"EndTime,omitnil,omitempty" name:"EndTime"` - - // Paging query page number. - PageNum *uint64 `json:"PageNum,omitnil,omitempty" name:"PageNum"` - - // Paging query the size of each page. - PageSize *uint64 `json:"PageSize,omitnil,omitempty" name:"PageSize"` -} - -func (r *DescribeMediaLiveHighlightResultRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeMediaLiveHighlightResultRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "Id") - delete(f, "StartTime") - delete(f, "EndTime") - delete(f, "PageNum") - delete(f, "PageSize") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeMediaLiveHighlightResultRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeMediaLiveHighlightResultResponseParams struct { - // Highlight results information. - Info []*HighlightResInfoResp `json:"Info,omitnil,omitempty" name:"Info"` - - // Collection id. - Id *string `json:"Id,omitnil,omitempty" name:"Id"` - - // Media live broadcast channel id. - ChannelId *string `json:"ChannelId,omitnil,omitempty" name:"ChannelId"` - - // Number of pages. - PageNum *uint64 `json:"PageNum,omitnil,omitempty" name:"PageNum"` - - // Paging Size. - PageSize *uint64 `json:"PageSize,omitnil,omitempty" name:"PageSize"` - - // The total number of eligible entries in the background. - TotalNum *uint64 `json:"TotalNum,omitnil,omitempty" name:"TotalNum"` - - // The unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem. - RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` -} - -type DescribeMediaLiveHighlightResultResponse struct { - *tchttp.BaseResponse - Response *DescribeMediaLiveHighlightResultResponseParams `json:"Response"` -} - -func (r *DescribeMediaLiveHighlightResultResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeMediaLiveHighlightResultResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - // Predefined struct for user type DescribeStreamLiveChannelAlertsRequestParams struct { // Channel ID @@ -2506,6 +2406,77 @@ type FrameCaptureTemplate struct { Sharpness *uint64 `json:"Sharpness,omitnil,omitempty" name:"Sharpness"` } +// Predefined struct for user +type GetAbWatermarkPlayUrlRequestParams struct { + // Client UUID, 32-bit unsigned integer, [0, 4294967295]. + Uuid *uint64 `json:"Uuid,omitnil,omitempty" name:"Uuid"` + + // Channel ID of Stream Package. + StreamPackageChannelId *string `json:"StreamPackageChannelId,omitnil,omitempty" name:"StreamPackageChannelId"` + + // Original play URL. + Url *string `json:"Url,omitnil,omitempty" name:"Url"` +} + +type GetAbWatermarkPlayUrlRequest struct { + *tchttp.BaseRequest + + // Client UUID, 32-bit unsigned integer, [0, 4294967295]. + Uuid *uint64 `json:"Uuid,omitnil,omitempty" name:"Uuid"` + + // Channel ID of Stream Package. + StreamPackageChannelId *string `json:"StreamPackageChannelId,omitnil,omitempty" name:"StreamPackageChannelId"` + + // Original play URL. + Url *string `json:"Url,omitnil,omitempty" name:"Url"` +} + +func (r *GetAbWatermarkPlayUrlRequest) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *GetAbWatermarkPlayUrlRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "Uuid") + delete(f, "StreamPackageChannelId") + delete(f, "Url") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "GetAbWatermarkPlayUrlRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type GetAbWatermarkPlayUrlResponseParams struct { + // The play URL after adding token. + Url *string `json:"Url,omitnil,omitempty" name:"Url"` + + // The unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem. + RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` +} + +type GetAbWatermarkPlayUrlResponse struct { + *tchttp.BaseResponse + Response *GetAbWatermarkPlayUrlResponseParams `json:"Response"` +} + +func (r *GetAbWatermarkPlayUrlResponse) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *GetAbWatermarkPlayUrlResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + type HighlightInfo struct { // Whether to enable input recognition 0: Disable 1 Enable Default value 0 Disable. HighlightEnabled *uint64 `json:"HighlightEnabled,omitnil,omitempty" name:"HighlightEnabled"` @@ -2532,29 +2503,6 @@ type HighlightInfo struct { AudioSelectorNames []*string `json:"AudioSelectorNames,omitnil,omitempty" name:"AudioSelectorNames"` } -type HighlightResInfoResp struct { - // MPS task ID. - TaskId *string `json:"TaskId,omitnil,omitempty" name:"TaskId"` - - // Highlights video link. - SegmentUrl *string `json:"SegmentUrl,omitnil,omitempty" name:"SegmentUrl"` - - // Collection cover link. - CovImgUrl *string `json:"CovImgUrl,omitnil,omitempty" name:"CovImgUrl"` - - // Generation time, UTC format. - CreateTime *uint64 `json:"CreateTime,omitnil,omitempty" name:"CreateTime"` - - // Starting pts. - StartTime *float64 `json:"StartTime,omitnil,omitempty" name:"StartTime"` - - // End pts. - EndTime *float64 `json:"EndTime,omitnil,omitempty" name:"EndTime"` - - // Duration in seconds. - Duration *float64 `json:"Duration,omitnil,omitempty" name:"Duration"` -} - type HlsRemuxSettingsInfo struct { // Segment duration in ms. Value range: [1000,30000]. Default value: 4000. The value can only be a multiple of 1,000. SegmentDuration *uint64 `json:"SegmentDuration,omitnil,omitempty" name:"SegmentDuration"` @@ -2595,6 +2543,9 @@ type HlsRemuxSettingsInfo struct { // Whether to include the `EXT-X-ENDLIST` tag, 1 includes `EXT-X-ENDLIST` tag, 2 does not include `EXT-X-ENDLIST` tag; the default value is 1. EndListTag *int64 `json:"EndListTag,omitnil,omitempty" name:"EndListTag"` + + // Optional: `ENHANCED_SCTE35`, `DATERANGE`; default value: `ENHANCED_SCTE35`. + AdMarkupType *string `json:"AdMarkupType,omitnil,omitempty" name:"AdMarkupType"` } type InputAnalysisInfo struct { @@ -2659,11 +2610,11 @@ type InputSecurityGroupInfo struct { } type InputSettingInfo struct { - // Application name, which is valid if `Type` is `RTMP_PUSH` and can contain 1-32 letters and digits + // Application name, which is valid if `Type` is `RTMP_PUSH` or `RTMPS_PUSH`, and can contain 1-32 letters and digits // Note: This field may return `null`, indicating that no valid value was found. AppName *string `json:"AppName,omitnil,omitempty" name:"AppName"` - // Stream name, which is valid if `Type` is `RTMP_PUSH` and can contain 1-32 letters and digits + // Stream name, which is valid if `Type` is `RTMP_PUSH` or `RTMPS_PUSH`, and can contain 1-32 letters and digits // Note: This field may return `null`, indicating that no valid value was found. StreamName *string `json:"StreamName,omitnil,omitempty" name:"StreamName"` @@ -2679,8 +2630,8 @@ type InputSettingInfo struct { // Note: this field may return `null`, indicating that no valid value was found. SourceType *string `json:"SourceType,omitnil,omitempty" name:"SourceType"` - // Delayed time (ms) for playback, which is valid if `Type` is `RTMP_PUSH` - // Value range: 0 (default) or 10000-600000 + // Delayed time (ms) for playback, which is valid if `Type` is `RTMP_PUSH` or `RTMPS_PUSH`. + // Value range: 0 (default) or 10000-600000. // The value must be a multiple of 1,000. // Note: This field may return `null`, indicating that no valid value was found. DelayTime *int64 `json:"DelayTime,omitnil,omitempty" name:"DelayTime"` @@ -3904,10 +3855,10 @@ type VideoTemplateInfo struct { // Video bitrate. Value range: [50000,40000000]. The value can only be a multiple of 1,000. If this parameter is left empty, the original value will be used. VideoBitrate *uint64 `json:"VideoBitrate,omitnil,omitempty" name:"VideoBitrate"` - // Video width. Value range: (0,3000]. The value can only be a multiple of 4. If this parameter is left empty, the original value will be used. + // Video width. Value range: (0,4096]. The value can only be a multiple of 2. If this parameter is left empty, the original value will be used. Width *uint64 `json:"Width,omitnil,omitempty" name:"Width"` - // Video height. Value range: (0,3000]. The value can only be a multiple of 4. If this parameter is left empty, the original value will be used. + // Video height. Value range: (0,4096]. The value can only be a multiple of 2. If this parameter is left empty, the original value will be used. Height *uint64 `json:"Height,omitnil,omitempty" name:"Height"` // Video frame rate. Value range: [1,240]. If this parameter is left empty, the original value will be used. diff --git a/vendor/github.com/tencentcloud/tencentcloud-sdk-go-intl-en/tencentcloud/privatedns/v20201028/client.go b/vendor/github.com/tencentcloud/tencentcloud-sdk-go-intl-en/tencentcloud/privatedns/v20201028/client.go index a935042ba7..7e32dbaaaf 100644 --- a/vendor/github.com/tencentcloud/tencentcloud-sdk-go-intl-en/tencentcloud/privatedns/v20201028/client.go +++ b/vendor/github.com/tencentcloud/tencentcloud-sdk-go-intl-en/tencentcloud/privatedns/v20201028/client.go @@ -2008,6 +2008,79 @@ func (c *Client) DescribeQuotaUsageWithContext(ctx context.Context, request *Des return } +func NewDescribeRecordRequest() (request *DescribeRecordRequest) { + request = &DescribeRecordRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("privatedns", APIVersion, "DescribeRecord") + + + return +} + +func NewDescribeRecordResponse() (response *DescribeRecordResponse) { + response = &DescribeRecordResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return + +} + +// DescribeRecord +// This API is used to obtain the private domain records. +// +// error code that may be returned: +// AUTHFAILURE = "AuthFailure" +// FAILEDOPERATION = "FailedOperation" +// INTERNALERROR = "InternalError" +// INTERNALERROR_UNDEFIENDERROR = "InternalError.UndefiendError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETER_RECORDNOTEXIST = "InvalidParameter.RecordNotExist" +// INVALIDPARAMETER_ZONENOTEXISTS = "InvalidParameter.ZoneNotExists" +// MISSINGPARAMETER = "MissingParameter" +// RESOURCENOTFOUND_SERVICENOTSUBSCRIBED = "ResourceNotFound.ServiceNotSubscribed" +// UNAUTHORIZEDOPERATION = "UnauthorizedOperation" +// UNAUTHORIZEDOPERATION_UNAUTHORIZEDACCOUNT = "UnauthorizedOperation.UnauthorizedAccount" +// UNKNOWNPARAMETER = "UnknownParameter" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) DescribeRecord(request *DescribeRecordRequest) (response *DescribeRecordResponse, err error) { + return c.DescribeRecordWithContext(context.Background(), request) +} + +// DescribeRecord +// This API is used to obtain the private domain records. +// +// error code that may be returned: +// AUTHFAILURE = "AuthFailure" +// FAILEDOPERATION = "FailedOperation" +// INTERNALERROR = "InternalError" +// INTERNALERROR_UNDEFIENDERROR = "InternalError.UndefiendError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETER_RECORDNOTEXIST = "InvalidParameter.RecordNotExist" +// INVALIDPARAMETER_ZONENOTEXISTS = "InvalidParameter.ZoneNotExists" +// MISSINGPARAMETER = "MissingParameter" +// RESOURCENOTFOUND_SERVICENOTSUBSCRIBED = "ResourceNotFound.ServiceNotSubscribed" +// UNAUTHORIZEDOPERATION = "UnauthorizedOperation" +// UNAUTHORIZEDOPERATION_UNAUTHORIZEDACCOUNT = "UnauthorizedOperation.UnauthorizedAccount" +// UNKNOWNPARAMETER = "UnknownParameter" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) DescribeRecordWithContext(ctx context.Context, request *DescribeRecordRequest) (response *DescribeRecordResponse, err error) { + if request == nil { + request = NewDescribeRecordRequest() + } + + if c.GetCredential() == nil { + return nil, errors.New("DescribeRecord require credential") + } + + request.SetContext(ctx) + + response = NewDescribeRecordResponse() + err = c.Send(request, response) + return +} + func NewDescribeRequestDataRequest() (request *DescribeRequestDataRequest) { request = &DescribeRequestDataRequest{ BaseRequest: &tchttp.BaseRequest{}, diff --git a/vendor/github.com/tencentcloud/tencentcloud-sdk-go-intl-en/tencentcloud/privatedns/v20201028/models.go b/vendor/github.com/tencentcloud/tencentcloud-sdk-go-intl-en/tencentcloud/privatedns/v20201028/models.go index 365f057baa..c0e6cc0e2b 100644 --- a/vendor/github.com/tencentcloud/tencentcloud-sdk-go-intl-en/tencentcloud/privatedns/v20201028/models.go +++ b/vendor/github.com/tencentcloud/tencentcloud-sdk-go-intl-en/tencentcloud/privatedns/v20201028/models.go @@ -624,6 +624,8 @@ type CreatePrivateZoneRequestParams struct { DnsForwardStatus *string `json:"DnsForwardStatus,omitnil,omitempty" name:"DnsForwardStatus"` // Associates the private domain to a VPC when it is created + // + // Deprecated: Vpcs is deprecated. Vpcs []*VpcInfo `json:"Vpcs,omitnil,omitempty" name:"Vpcs"` // List of authorized accounts' VPCs to associate with the private domain @@ -1799,6 +1801,70 @@ func (r *DescribeQuotaUsageResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } +// Predefined struct for user +type DescribeRecordRequestParams struct { + // Private domain ID. + ZoneId *string `json:"ZoneId,omitnil,omitempty" name:"ZoneId"` + + // Record ID + RecordId *string `json:"RecordId,omitnil,omitempty" name:"RecordId"` +} + +type DescribeRecordRequest struct { + *tchttp.BaseRequest + + // Private domain ID. + ZoneId *string `json:"ZoneId,omitnil,omitempty" name:"ZoneId"` + + // Record ID + RecordId *string `json:"RecordId,omitnil,omitempty" name:"RecordId"` +} + +func (r *DescribeRecordRequest) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *DescribeRecordRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "ZoneId") + delete(f, "RecordId") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeRecordRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DescribeRecordResponseParams struct { + // Record information. + RecordInfo *RecordInfo `json:"RecordInfo,omitnil,omitempty" name:"RecordInfo"` + + // The unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem. + RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` +} + +type DescribeRecordResponse struct { + *tchttp.BaseResponse + Response *DescribeRecordResponseParams `json:"Response"` +} + +func (r *DescribeRecordResponse) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *DescribeRecordResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + // Predefined struct for user type DescribeRequestDataRequestParams struct { // Request volume statistics start time in the format of 2020-11-22 00:00:00 @@ -2590,6 +2656,44 @@ type PrivateZoneRecord struct { Extra *string `json:"Extra,omitnil,omitempty" name:"Extra"` } +type RecordInfo struct { + // Record ID. + RecordId *string `json:"RecordId,omitnil,omitempty" name:"RecordId"` + + // Private domain ID, which is in zone-xxxxxxxx format. + ZoneId *string `json:"ZoneId,omitnil,omitempty" name:"ZoneId"` + + // Subdomain name. + SubDomain *string `json:"SubDomain,omitnil,omitempty" name:"SubDomain"` + + // Record type. Valid values: A, AAAA, CNAME, MX, TXT, and PTR. + RecordType *string `json:"RecordType,omitnil,omitempty" name:"RecordType"` + + // Record value. + RecordValue *string `json:"RecordValue,omitnil,omitempty" name:"RecordValue"` + + // Record cache time. The smaller the value, the faster the record will take effect. Value range: 1-86,400s. Default value: 600. + TTL *int64 `json:"TTL,omitnil,omitempty" name:"TTL"` + + // MX priority, which is required when the record type is mx. valid values: 5, 10, 15, 20, 30, 40, and 50. + MX *int64 `json:"MX,omitnil,omitempty" name:"MX"` + + // Record weight. valid values: 1–100. + Weight *int64 `json:"Weight,omitnil,omitempty" name:"Weight"` + + // Record creation time. + CreatedOn *string `json:"CreatedOn,omitnil,omitempty" name:"CreatedOn"` + + // Record update time. + UpdatedOn *string `json:"UpdatedOn,omitnil,omitempty" name:"UpdatedOn"` + + // 0 suspend 1 enable. + Enabled *uint64 `json:"Enabled,omitnil,omitempty" name:"Enabled"` + + // Remarks + Remark *string `json:"Remark,omitnil,omitempty" name:"Remark"` +} + type RegionInfo struct { // Region encoding RegionCode *string `json:"RegionCode,omitnil,omitempty" name:"RegionCode"` diff --git a/vendor/modules.txt b/vendor/modules.txt index b056289e4e..e2e55f5505 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -1086,7 +1086,7 @@ github.com/t-yuki/gocover-cobertura # github.com/tdakkota/asciicheck v0.2.0 ## explicit; go 1.18 github.com/tdakkota/asciicheck -# github.com/tencentcloud/tencentcloud-sdk-go-intl-en v3.0.1161+incompatible +# github.com/tencentcloud/tencentcloud-sdk-go-intl-en v3.0.1214+incompatible ## explicit github.com/tencentcloud/tencentcloud-sdk-go-intl-en/tencentcloud/common github.com/tencentcloud/tencentcloud-sdk-go-intl-en/tencentcloud/common/errors