diff --git a/go.mod b/go.mod index b9aca6d2da..bf5fb78b68 100644 --- a/go.mod +++ b/go.mod @@ -27,11 +27,11 @@ require ( github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cdb v1.0.199 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cdn v1.0.199 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cfs v1.0.199 - github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/ckafka v1.0.376 + github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/ckafka v1.0.403 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/clb v1.0.283 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cloudaudit v1.0.199 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cls v1.0.377 - github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.398 + github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.403 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cvm v1.0.385 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cynosdb v1.0.359 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dayu v1.0.335 diff --git a/go.sum b/go.sum index f3d20aa8f5..7dcde221ae 100644 --- a/go.sum +++ b/go.sum @@ -466,6 +466,10 @@ github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cfs v1.0.199 h1:VyOKZOl github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cfs v1.0.199/go.mod h1:9ldm0D1ToaztnlD2bFC5yjMMqvQfVeAMhvcoCCVnZb8= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/ckafka v1.0.376 h1:q7TNQ/5zalD483Z6ufGtxeZIEgO0eUN+5M9y1qxg/ck= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/ckafka v1.0.376/go.mod h1:YVajJ5YZ8YIFtecbXknudDPXLfG1oRwrL6GxZel5rY8= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/ckafka v1.0.399 h1:GWa+5s6tbgf5B1AakoirllClfdOmUUSZpb/qso7YiuE= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/ckafka v1.0.399/go.mod h1:IvRRjtjGHNzOeH+r0CuyTKeZRZhwqqFzPw6jgAMK9NM= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/ckafka v1.0.403 h1:rD9H4dQkULnRpq1BiD2KuDKsd9VEKHun2gMT+V6DNOE= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/ckafka v1.0.403/go.mod h1:yWwwGj2gV0hRPfM9GXG4EgDee0cEWYcAwl/M8CTTvzM= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/clb v1.0.283 h1:8pML0UtXgui5WZFLLrCv6QdR8e0fUva0V4W5wSgTCSc= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/clb v1.0.283/go.mod h1:zgARzAnsLzpLhdpAHrHTUilOXytH9aEJy5ssCdizVV0= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cloudaudit v1.0.199 h1:o41qFAFJGPDTLNWXs7nLw4fsDxFUCe5gkO2YXI9Ye6Q= @@ -489,6 +493,10 @@ github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.397 h1:oYU+ github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.397/go.mod h1:7sCQWVkxcsR38nffDW057DRGk8mUjK1Ing/EFOK8s8Y= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.398 h1:+VbaPRPCKAplIvwj9oGEOTbZmYiEX9AeqaTCPqLzwS8= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.398/go.mod h1:7sCQWVkxcsR38nffDW057DRGk8mUjK1Ing/EFOK8s8Y= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.399 h1:iTkEybEo9axJoE7FXnAS1jP6qGdgLi1FMFBNxPk+99k= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.399/go.mod h1:7sCQWVkxcsR38nffDW057DRGk8mUjK1Ing/EFOK8s8Y= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.403 h1:61iPtR+lIVT8BtAaviUx0t5InIHcJ/N51xQdezu2r1s= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.403/go.mod h1:7sCQWVkxcsR38nffDW057DRGk8mUjK1Ing/EFOK8s8Y= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cvm v1.0.385 h1:8bwloRxRwSADSK48KxaUeO9JHmmgniNGJbA7Or/HUEk= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cvm v1.0.385/go.mod h1:PMxA0L4o8Fbx/6+ju1cAMAU7x2bV4C6e/LTqVe745yM= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cynosdb v1.0.359 h1:cNKqelPgUxrJkLY0Azd2QHr/UMYOPPnmqs88clt2akk= diff --git a/tencentcloud/resource_tc_ckafka_instance.go b/tencentcloud/resource_tc_ckafka_instance.go index 407887baa9..a26add2923 100644 --- a/tencentcloud/resource_tc_ckafka_instance.go +++ b/tencentcloud/resource_tc_ckafka_instance.go @@ -81,7 +81,6 @@ func resourceTencentCloudCkafkaInstance() *schema.Resource { "zone_id": { Type: schema.TypeInt, Required: true, - ForceNew: true, Description: "Available zone id.", DiffSuppressFunc: func(k, old, new string, d *schema.ResourceData) bool { multiZone := d.Get("multi_zone_flag").(bool) @@ -99,19 +98,16 @@ func resourceTencentCloudCkafkaInstance() *schema.Resource { "period": { Type: schema.TypeInt, Optional: true, - ForceNew: true, Description: "Prepaid purchase time, such as 1, is one month.", }, "vpc_id": { Type: schema.TypeString, Required: true, - ForceNew: true, Description: "Vpc id.", }, "subnet_id": { Type: schema.TypeString, Required: true, - ForceNew: true, Description: "Subnet id.", }, "msg_retention_time": { @@ -125,7 +121,6 @@ func resourceTencentCloudCkafkaInstance() *schema.Resource { "renew_flag": { Type: schema.TypeInt, Optional: true, - ForceNew: true, Computed: true, Description: "Prepaid automatic renewal mark, 0 means the default state, the initial state," + " 1 means automatic renewal, 2 means clear no automatic renewal (user setting).", @@ -134,21 +129,18 @@ func resourceTencentCloudCkafkaInstance() *schema.Resource { Type: schema.TypeString, Optional: true, Computed: true, - ForceNew: true, Description: "Kafka version (0.10.2/1.1.1/2.4.1).", }, "band_width": { Type: schema.TypeInt, Optional: true, Computed: true, - ForceNew: true, Description: "Instance bandwidth in MBps.", }, "disk_size": { Type: schema.TypeInt, Optional: true, Computed: true, - ForceNew: true, Description: "Disk Size. Its interval varies with bandwidth, and the input must be within the interval, which can be viewed through the control. " + "If it is not within the interval, the plan will cause a change when first created.", }, @@ -156,20 +148,17 @@ func resourceTencentCloudCkafkaInstance() *schema.Resource { Type: schema.TypeInt, Optional: true, Computed: true, - ForceNew: true, Description: "Partition Size. Its interval varies with bandwidth, and the input must be within the interval, which can be viewed through the control. " + "If it is not within the interval, the plan will cause a change when first created.", }, "multi_zone_flag": { Type: schema.TypeBool, Optional: true, - ForceNew: true, Description: "Indicates whether the instance is multi zones. NOTE: if set to `true`, `zone_ids` must set together.", }, "zone_ids": { Type: schema.TypeSet, Optional: true, - ForceNew: true, Description: "List of available zone id. NOTE: this argument must set together with `multi_zone_flag`.", RequiredWith: []string{"multi_zone_flag"}, Elem: &schema.Schema{Type: schema.TypeInt}, @@ -177,7 +166,6 @@ func resourceTencentCloudCkafkaInstance() *schema.Resource { "tags": { Type: schema.TypeList, Optional: true, - ForceNew: true, Description: "Partition size, the professional version does not need tag.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ @@ -198,7 +186,6 @@ func resourceTencentCloudCkafkaInstance() *schema.Resource { Type: schema.TypeString, Optional: true, Computed: true, - ForceNew: true, Description: "Type of disk.", }, "config": { @@ -583,6 +570,15 @@ func resourceTencentCloudCkafkaInstanceUpdate(d *schema.ResourceData, meta inter service := CkafkaService{ client: meta.(*TencentCloudClient).apiV3Conn, } + + if d.HasChange("zone_id") || d.HasChange("period") || d.HasChange("vpc_id") || d.HasChange("subnet_id") || + d.HasChange("renew_flag") || d.HasChange("kafka_version") || d.HasChange("multi_zone_flag") || d.HasChange("zone_ids") || + d.HasChange("tags") || d.HasChange("disk_type") { + + return fmt.Errorf("parms like 'zone_id | period | vpc_id | subnet_id | renew_flag | " + + "kafka_version | multi_zone_flag | zone_ids | tags | disk_type', do not support change now.") + } + instanceId := d.Id() request := ckafka.NewModifyInstanceAttributesRequest() request.InstanceId = &instanceId @@ -654,6 +650,41 @@ func resourceTencentCloudCkafkaInstanceUpdate(d *schema.ResourceData, meta inter return fmt.Errorf("[API]Set kafka instance attributes fail, reason:%s", error.Error()) } + if d.HasChange("band_width") || d.HasChange("disk_size") || d.HasChange("partition") { + request := ckafka.NewModifyInstancePreRequest() + request.InstanceId = helper.String(instanceId) + if v, ok := d.GetOk("band_width"); ok { + request.BandWidth = helper.Int64(int64(v.(int))) + } + if v, ok := d.GetOk("disk_size"); ok { + request.DiskSize = helper.Int64(int64(v.(int))) + } + if v, ok := d.GetOk("partition"); ok { + request.Partition = helper.Int64(int64(v.(int))) + } + + _, err := service.client.UseCkafkaClient().ModifyInstancePre(request) + if err != nil { + return fmt.Errorf("[CRITAL]%s api[%s] fail, request body [%s], reason[%s]", logId, + request.GetAction(), request.ToJsonString(), err.Error()) + } + + err = resource.Retry(5*readRetryTimeout, func() *resource.RetryError { + _, ready, err := service.CheckCkafkaInstanceReady(ctx, instanceId) + if err != nil { + return resource.NonRetryableError(err) + } + if ready { + return nil + } + return resource.RetryableError(fmt.Errorf("upgrade ckafka instance task is processing")) + }) + + if err != nil { + return err + } + } + return resourceTencentCloudCkafkaInstanceRead(d, meta) } diff --git a/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/ckafka/v20190819/client.go b/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/ckafka/v20190819/client.go index b999d9057a..b5a53257ad 100644 --- a/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/ckafka/v20190819/client.go +++ b/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/ckafka/v20190819/client.go @@ -66,6 +66,7 @@ func NewAuthorizeTokenResponse() (response *AuthorizeTokenResponse) { // 给实例授权token // // 可能返回的错误码: +// FAILEDOPERATION = "FailedOperation" // INTERNALERROR = "InternalError" // INVALIDPARAMETER = "InvalidParameter" // INVALIDPARAMETERVALUE = "InvalidParameterValue" @@ -78,6 +79,7 @@ func (c *Client) AuthorizeToken(request *AuthorizeTokenRequest) (response *Autho // 给实例授权token // // 可能返回的错误码: +// FAILEDOPERATION = "FailedOperation" // INTERNALERROR = "InternalError" // INVALIDPARAMETER = "InvalidParameter" // INVALIDPARAMETERVALUE = "InvalidParameterValue" @@ -282,6 +284,7 @@ func NewCancelAuthorizationTokenResponse() (response *CancelAuthorizationTokenRe // 取消授权token // // 可能返回的错误码: +// FAILEDOPERATION = "FailedOperation" // INTERNALERROR = "InternalError" // INVALIDPARAMETER = "InvalidParameter" // INVALIDPARAMETERVALUE = "InvalidParameterValue" @@ -294,6 +297,7 @@ func (c *Client) CancelAuthorizationToken(request *CancelAuthorizationTokenReque // 取消授权token // // 可能返回的错误码: +// FAILEDOPERATION = "FailedOperation" // INTERNALERROR = "InternalError" // INVALIDPARAMETER = "InvalidParameter" // INVALIDPARAMETERVALUE = "InvalidParameterValue" @@ -538,6 +542,7 @@ func NewCreatePartitionResponse() (response *CreatePartitionResponse) { // 本接口用于增加主题中的分区 // // 可能返回的错误码: +// FAILEDOPERATION = "FailedOperation" // INTERNALERROR = "InternalError" // INVALIDPARAMETER = "InvalidParameter" // INVALIDPARAMETERVALUE_INSTANCENOTEXIST = "InvalidParameterValue.InstanceNotExist" @@ -559,6 +564,7 @@ func (c *Client) CreatePartition(request *CreatePartitionRequest) (response *Cre // 本接口用于增加主题中的分区 // // 可能返回的错误码: +// FAILEDOPERATION = "FailedOperation" // INTERNALERROR = "InternalError" // INVALIDPARAMETER = "InvalidParameter" // INVALIDPARAMETERVALUE_INSTANCENOTEXIST = "InvalidParameterValue.InstanceNotExist" @@ -889,6 +895,7 @@ func NewCreateUserResponse() (response *CreateUserResponse) { // 添加用户 // // 可能返回的错误码: +// FAILEDOPERATION = "FailedOperation" // INTERNALERROR = "InternalError" // INVALIDPARAMETER = "InvalidParameter" // INVALIDPARAMETERVALUE_INSTANCENOTEXIST = "InvalidParameterValue.InstanceNotExist" @@ -910,6 +917,7 @@ func (c *Client) CreateUser(request *CreateUserRequest) (response *CreateUserRes // 添加用户 // // 可能返回的错误码: +// FAILEDOPERATION = "FailedOperation" // INTERNALERROR = "InternalError" // INVALIDPARAMETER = "InvalidParameter" // INVALIDPARAMETERVALUE_INSTANCENOTEXIST = "InvalidParameterValue.InstanceNotExist" @@ -1205,6 +1213,83 @@ func (c *Client) DeleteInstancePreWithContext(ctx context.Context, request *Dele return } +func NewDeleteRouteRequest() (request *DeleteRouteRequest) { + request = &DeleteRouteRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + request.Init().WithApiInfo("ckafka", APIVersion, "DeleteRoute") + + + return +} + +func NewDeleteRouteResponse() (response *DeleteRouteResponse) { + response = &DeleteRouteResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return +} + +// DeleteRoute +// 删除路由 +// +// 可能返回的错误码: +// FAILEDOPERATION = "FailedOperation" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE_INSTANCENOTEXIST = "InvalidParameterValue.InstanceNotExist" +// INVALIDPARAMETERVALUE_REPETITIONVALUE = "InvalidParameterValue.RepetitionValue" +// INVALIDPARAMETERVALUE_SUBNETIDINVALID = "InvalidParameterValue.SubnetIdInvalid" +// INVALIDPARAMETERVALUE_SUBNETNOTBELONGTOZONE = "InvalidParameterValue.SubnetNotBelongToZone" +// INVALIDPARAMETERVALUE_VPCIDINVALID = "InvalidParameterValue.VpcIdInvalid" +// INVALIDPARAMETERVALUE_WRONGACTION = "InvalidParameterValue.WrongAction" +// INVALIDPARAMETERVALUE_ZONENOTSUPPORT = "InvalidParameterValue.ZoneNotSupport" +// RESOURCENOTFOUND = "ResourceNotFound" +// RESOURCEUNAVAILABLE = "ResourceUnavailable" +// UNAUTHORIZEDOPERATION = "UnauthorizedOperation" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +// UNSUPPORTEDOPERATION_BATCHDELINSTANCELIMIT = "UnsupportedOperation.BatchDelInstanceLimit" +// UNSUPPORTEDOPERATION_OSSREJECT = "UnsupportedOperation.OssReject" +func (c *Client) DeleteRoute(request *DeleteRouteRequest) (response *DeleteRouteResponse, err error) { + return c.DeleteRouteWithContext(context.Background(), request) +} + +// DeleteRoute +// 删除路由 +// +// 可能返回的错误码: +// FAILEDOPERATION = "FailedOperation" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE_INSTANCENOTEXIST = "InvalidParameterValue.InstanceNotExist" +// INVALIDPARAMETERVALUE_REPETITIONVALUE = "InvalidParameterValue.RepetitionValue" +// INVALIDPARAMETERVALUE_SUBNETIDINVALID = "InvalidParameterValue.SubnetIdInvalid" +// INVALIDPARAMETERVALUE_SUBNETNOTBELONGTOZONE = "InvalidParameterValue.SubnetNotBelongToZone" +// INVALIDPARAMETERVALUE_VPCIDINVALID = "InvalidParameterValue.VpcIdInvalid" +// INVALIDPARAMETERVALUE_WRONGACTION = "InvalidParameterValue.WrongAction" +// INVALIDPARAMETERVALUE_ZONENOTSUPPORT = "InvalidParameterValue.ZoneNotSupport" +// RESOURCENOTFOUND = "ResourceNotFound" +// RESOURCEUNAVAILABLE = "ResourceUnavailable" +// UNAUTHORIZEDOPERATION = "UnauthorizedOperation" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +// UNSUPPORTEDOPERATION_BATCHDELINSTANCELIMIT = "UnsupportedOperation.BatchDelInstanceLimit" +// UNSUPPORTEDOPERATION_OSSREJECT = "UnsupportedOperation.OssReject" +func (c *Client) DeleteRouteWithContext(ctx context.Context, request *DeleteRouteRequest) (response *DeleteRouteResponse, err error) { + if request == nil { + request = NewDeleteRouteRequest() + } + + if c.GetCredential() == nil { + return nil, errors.New("DeleteRoute require credential") + } + + request.SetContext(ctx) + + response = NewDeleteRouteResponse() + err = c.Send(request, response) + return +} + func NewDeleteRouteTriggerTimeRequest() (request *DeleteRouteTriggerTimeRequest) { request = &DeleteRouteTriggerTimeRequest{ BaseRequest: &tchttp.BaseRequest{}, @@ -1500,6 +1585,7 @@ func NewDescribeACLResponse() (response *DescribeACLResponse) { // 枚举ACL // // 可能返回的错误码: +// FAILEDOPERATION = "FailedOperation" // INTERNALERROR = "InternalError" // INVALIDPARAMETER = "InvalidParameter" // INVALIDPARAMETERVALUE_INSTANCENOTEXIST = "InvalidParameterValue.InstanceNotExist" @@ -1521,6 +1607,7 @@ func (c *Client) DescribeACL(request *DescribeACLRequest) (response *DescribeACL // 枚举ACL // // 可能返回的错误码: +// FAILEDOPERATION = "FailedOperation" // INTERNALERROR = "InternalError" // INVALIDPARAMETER = "InvalidParameter" // INVALIDPARAMETERVALUE_INSTANCENOTEXIST = "InvalidParameterValue.InstanceNotExist" @@ -2966,6 +3053,75 @@ func (c *Client) ModifyInstanceAttributesWithContext(ctx context.Context, reques return } +func NewModifyInstancePreRequest() (request *ModifyInstancePreRequest) { + request = &ModifyInstancePreRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + request.Init().WithApiInfo("ckafka", APIVersion, "ModifyInstancePre") + + + return +} + +func NewModifyInstancePreResponse() (response *ModifyInstancePreResponse) { + response = &ModifyInstancePreResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return +} + +// ModifyInstancePre +// 预付费实例变配接口,调整磁盘,带宽 +// +// 可能返回的错误码: +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE_INSTANCENOTEXIST = "InvalidParameterValue.InstanceNotExist" +// INVALIDPARAMETERVALUE_NOTALLOWEDEMPTY = "InvalidParameterValue.NotAllowedEmpty" +// INVALIDPARAMETERVALUE_REPETITIONVALUE = "InvalidParameterValue.RepetitionValue" +// INVALIDPARAMETERVALUE_SUBNETIDINVALID = "InvalidParameterValue.SubnetIdInvalid" +// INVALIDPARAMETERVALUE_SUBNETNOTBELONGTOZONE = "InvalidParameterValue.SubnetNotBelongToZone" +// INVALIDPARAMETERVALUE_VPCIDINVALID = "InvalidParameterValue.VpcIdInvalid" +// INVALIDPARAMETERVALUE_WRONGACTION = "InvalidParameterValue.WrongAction" +// INVALIDPARAMETERVALUE_ZONENOTSUPPORT = "InvalidParameterValue.ZoneNotSupport" +// RESOURCENOTFOUND = "ResourceNotFound" +// UNSUPPORTEDOPERATION_OSSREJECT = "UnsupportedOperation.OssReject" +func (c *Client) ModifyInstancePre(request *ModifyInstancePreRequest) (response *ModifyInstancePreResponse, err error) { + return c.ModifyInstancePreWithContext(context.Background(), request) +} + +// ModifyInstancePre +// 预付费实例变配接口,调整磁盘,带宽 +// +// 可能返回的错误码: +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE_INSTANCENOTEXIST = "InvalidParameterValue.InstanceNotExist" +// INVALIDPARAMETERVALUE_NOTALLOWEDEMPTY = "InvalidParameterValue.NotAllowedEmpty" +// INVALIDPARAMETERVALUE_REPETITIONVALUE = "InvalidParameterValue.RepetitionValue" +// INVALIDPARAMETERVALUE_SUBNETIDINVALID = "InvalidParameterValue.SubnetIdInvalid" +// INVALIDPARAMETERVALUE_SUBNETNOTBELONGTOZONE = "InvalidParameterValue.SubnetNotBelongToZone" +// INVALIDPARAMETERVALUE_VPCIDINVALID = "InvalidParameterValue.VpcIdInvalid" +// INVALIDPARAMETERVALUE_WRONGACTION = "InvalidParameterValue.WrongAction" +// INVALIDPARAMETERVALUE_ZONENOTSUPPORT = "InvalidParameterValue.ZoneNotSupport" +// RESOURCENOTFOUND = "ResourceNotFound" +// UNSUPPORTEDOPERATION_OSSREJECT = "UnsupportedOperation.OssReject" +func (c *Client) ModifyInstancePreWithContext(ctx context.Context, request *ModifyInstancePreRequest) (response *ModifyInstancePreResponse, err error) { + if request == nil { + request = NewModifyInstancePreRequest() + } + + if c.GetCredential() == nil { + return nil, errors.New("ModifyInstancePre require credential") + } + + request.SetContext(ctx) + + response = NewModifyInstancePreResponse() + err = c.Send(request, response) + return +} + func NewModifyPasswordRequest() (request *ModifyPasswordRequest) { request = &ModifyPasswordRequest{ BaseRequest: &tchttp.BaseRequest{}, diff --git a/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/ckafka/v20190819/models.go b/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/ckafka/v20190819/models.go index 7b1b68dcd2..7aa7d37028 100644 --- a/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/ckafka/v20190819/models.go +++ b/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/ckafka/v20190819/models.go @@ -807,7 +807,8 @@ type CreateInstancePreRequest struct { // 预付费购买时长,例如 "1m",就是一个月 Period *string `json:"Period,omitempty" name:"Period"` - // 实例规格,专业版默认填写1。1:入门型 ,2: 标准型,3 :进阶型,4 :容量型,5: 高阶型1,6:高阶性2, 7: 高阶型3,8: 高阶型4, 9 :独占型。 + // 实例规格说明 专业版实例[所有规格]填写1. + // 标准版实例 ([入门型]填写1,[标准型]填写2,[进阶型]填写3,[容量型]填写4,[高阶型1]填写5,[高阶性2]填写6,[高阶型3]填写7,[高阶型4]填写8,[独占型]填写9。 InstanceType *int64 `json:"InstanceType,omitempty" name:"InstanceType"` // vpcId,不填默认基础网络 @@ -825,10 +826,10 @@ type CreateInstancePreRequest struct { // 预付费自动续费标记,0表示默认状态(用户未设置,即初始状态), 1表示自动续费,2表示明确不自动续费(用户设置) RenewFlag *int64 `json:"RenewFlag,omitempty" name:"RenewFlag"` - // 支持指定版本Kafka版本(0.10.2/1.1.1/2.4.1) 。指定专业版参数specificationsType=pro + // CKafka版本号[0.10.2、1.1.1、2.4.1], 默认是1.1.1 KafkaVersion *string `json:"KafkaVersion,omitempty" name:"KafkaVersion"` - // 专业版必须填写 (专业版:profession、标准版:standard) 默认是standard。专业版填profession + // 实例类型: [标准版实例]填写 standard(默认), [专业版实例]填写 profession SpecificationsType *string `json:"SpecificationsType,omitempty" name:"SpecificationsType"` // 磁盘大小,专业版不填写默认最小磁盘,填写后根据磁盘带宽分区数弹性计算 @@ -1211,12 +1212,15 @@ type CreateTopicRequest struct { // 是否允许未同步的副本选为leader,false:不允许,true:允许,默认不允许 UncleanLeaderElectionEnable *int64 `json:"UncleanLeaderElectionEnable,omitempty" name:"UncleanLeaderElectionEnable"` - // 可消息选。保留时间,单位ms,当前最小值为60000ms + // 可选参数。消息保留时间,单位ms,当前最小值为60000ms RetentionMs *int64 `json:"RetentionMs,omitempty" name:"RetentionMs"` // Segment分片滚动的时长,单位ms,当前最小为3600000ms SegmentMs *int64 `json:"SegmentMs,omitempty" name:"SegmentMs"` + // 主题消息最大值,单位为 Byte,最小值1024Byte(即1KB),最大值为8388608Byte(即8MB)。 + MaxMessageBytes *int64 `json:"MaxMessageBytes,omitempty" name:"MaxMessageBytes"` + // 预设ACL规则, 1:打开 0:关闭,默认不打开 EnableAclRule *int64 `json:"EnableAclRule,omitempty" name:"EnableAclRule"` @@ -1254,6 +1258,7 @@ func (r *CreateTopicRequest) FromJsonString(s string) error { delete(f, "UncleanLeaderElectionEnable") delete(f, "RetentionMs") delete(f, "SegmentMs") + delete(f, "MaxMessageBytes") delete(f, "EnableAclRule") delete(f, "AclRuleName") delete(f, "RetentionBytes") @@ -1578,6 +1583,67 @@ func (r *DeleteInstancePreResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } +type DeleteRouteRequest struct { + *tchttp.BaseRequest + + // 实例唯一id + InstanceId *string `json:"InstanceId,omitempty" name:"InstanceId"` + + // 路由id + RouteId *int64 `json:"RouteId,omitempty" name:"RouteId"` + + // 调用方appId + CallerAppid *int64 `json:"CallerAppid,omitempty" name:"CallerAppid"` + + // 删除路由时间 + DeleteRouteTime *string `json:"DeleteRouteTime,omitempty" name:"DeleteRouteTime"` +} + +func (r *DeleteRouteRequest) 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 *DeleteRouteRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "InstanceId") + delete(f, "RouteId") + delete(f, "CallerAppid") + delete(f, "DeleteRouteTime") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DeleteRouteRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +type DeleteRouteResponse struct { + *tchttp.BaseResponse + Response *struct { + + // 返回结果 + Result *JgwOperateResponse `json:"Result,omitempty" name:"Result"` + + // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitempty" name:"RequestId"` + } `json:"Response"` +} + +func (r *DeleteRouteResponse) 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 *DeleteRouteResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + type DeleteRouteTriggerTimeRequest struct { *tchttp.BaseRequest @@ -2282,11 +2348,14 @@ type DescribeInstancesDetailRequest struct { // 匹配标签key值。 TagKey *string `json:"TagKey,omitempty" name:"TagKey"` - // 过滤器。 + // 过滤器。filter.Name 支持('Ip', 'VpcId', 'SubNetId', 'InstanceType','InstanceId') ,filter.Values最多传递10个值. Filters []*Filter `json:"Filters,omitempty" name:"Filters"` // 已经废弃, 使用InstanceIdList InstanceIds *string `json:"InstanceIds,omitempty" name:"InstanceIds"` + + // 按照实例ID过滤 + InstanceIdList []*string `json:"InstanceIdList,omitempty" name:"InstanceIdList"` } func (r *DescribeInstancesDetailRequest) ToJsonString() string { @@ -2309,6 +2378,7 @@ func (r *DescribeInstancesDetailRequest) FromJsonString(s string) error { delete(f, "TagKey") delete(f, "Filters") delete(f, "InstanceIds") + delete(f, "InstanceIdList") if len(f) > 0 { return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeInstancesDetailRequest has unknown keys!", "") } @@ -2939,7 +3009,7 @@ type FetchMessageByOffsetRequest struct { // 分区id Partition *int64 `json:"Partition,omitempty" name:"Partition"` - // 位点信息 + // 位点信息,必填 Offset *int64 `json:"Offset,omitempty" name:"Offset"` } @@ -3572,6 +3642,67 @@ func (r *ModifyInstanceAttributesResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } +type ModifyInstancePreRequest struct { + *tchttp.BaseRequest + + // 实例名称 + InstanceId *string `json:"InstanceId,omitempty" name:"InstanceId"` + + // 预计磁盘,根据磁盘步长,规格向上调整。 + DiskSize *int64 `json:"DiskSize,omitempty" name:"DiskSize"` + + // 预计带宽,根据带宽步长,规格向上调整。 + BandWidth *int64 `json:"BandWidth,omitempty" name:"BandWidth"` + + // 预计分区,根据带宽步长,规格向上调整。 + Partition *int64 `json:"Partition,omitempty" name:"Partition"` +} + +func (r *ModifyInstancePreRequest) 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 *ModifyInstancePreRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "InstanceId") + delete(f, "DiskSize") + delete(f, "BandWidth") + delete(f, "Partition") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ModifyInstancePreRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +type ModifyInstancePreResponse struct { + *tchttp.BaseResponse + Response *struct { + + // 变更预付费实例配置返回结构 + Result *CreateInstancePreResp `json:"Result,omitempty" name:"Result"` + + // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitempty" name:"RequestId"` + } `json:"Response"` +} + +func (r *ModifyInstancePreResponse) 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 *ModifyInstancePreResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + type ModifyPasswordRequest struct { *tchttp.BaseRequest @@ -3660,7 +3791,7 @@ type ModifyTopicAttributesRequest struct { // Segment 分片滚动的时长,单位:ms,当前最小为86400000ms。 SegmentMs *int64 `json:"SegmentMs,omitempty" name:"SegmentMs"` - // 主题消息最大值,单位为 Byte,最大值为8388608Byte(即8MB)。 + // 主题消息最大值,单位为 Byte,最大值为12582912Byte(即12MB)。 MaxMessageBytes *int64 `json:"MaxMessageBytes,omitempty" name:"MaxMessageBytes"` // 消息删除策略,可以选择delete 或者compact @@ -3832,7 +3963,7 @@ type Route struct { // 路由ID RouteId *int64 `json:"RouteId,omitempty" name:"RouteId"` - // vip网络类型(1:外网TGW 2:基础网络 3:VPC网络 4:支撑网络(标准版) 5:SSL外网访问方式访问 6:黑石环境vpc 7:支撑网络(专业版)) + // vip网络类型(1:外网TGW 2:基础网络 3:VPC网络 4:支撑网络(idc 环境) 5:SSL外网访问方式访问 6:黑石环境vpc 7:支撑网络(cvm 环境) VipType *int64 `json:"VipType,omitempty" name:"VipType"` // 虚拟IP列表 diff --git a/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/http/request.go b/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/http/request.go index fe499085ca..b5210a22c8 100644 --- a/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/http/request.go +++ b/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/http/request.go @@ -254,7 +254,7 @@ func CompleteCommonParams(request Request, region string) { params["Action"] = request.GetAction() params["Timestamp"] = strconv.FormatInt(time.Now().Unix(), 10) params["Nonce"] = strconv.Itoa(rand.Int()) - params["RequestClient"] = "SDK_GO_1.0.398" + params["RequestClient"] = "SDK_GO_1.0.403" } func ConstructParams(req Request) (err error) { diff --git a/vendor/modules.txt b/vendor/modules.txt index 573a6ced13..3bdb79ed00 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -547,7 +547,7 @@ github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cdb/v20170320 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cdn/v20180606 # github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cfs v1.0.199 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cfs/v20190719 -# github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/ckafka v1.0.376 +# github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/ckafka v1.0.403 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/ckafka/v20190819 # github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/clb v1.0.283 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/clb/v20180317 @@ -555,7 +555,7 @@ github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/clb/v20180317 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cloudaudit/v20190319 # github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cls v1.0.377 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cls/v20201016 -# github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.398 +# github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.403 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/errors github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/http diff --git a/website/docs/r/ckafka_instance.html.markdown b/website/docs/r/ckafka_instance.html.markdown index c092798c7c..f46210bc58 100644 --- a/website/docs/r/ckafka_instance.html.markdown +++ b/website/docs/r/ckafka_instance.html.markdown @@ -56,24 +56,24 @@ resource "tencentcloud_ckafka_instance" "foo" { The following arguments are supported: * `instance_name` - (Required) Instance name. -* `subnet_id` - (Required, ForceNew) Subnet id. -* `vpc_id` - (Required, ForceNew) Vpc id. -* `zone_id` - (Required, ForceNew) Available zone id. -* `band_width` - (Optional, ForceNew) Instance bandwidth in MBps. +* `subnet_id` - (Required) Subnet id. +* `vpc_id` - (Required) Vpc id. +* `zone_id` - (Required) Available zone id. +* `band_width` - (Optional) Instance bandwidth in MBps. * `config` - (Optional) Instance configuration. -* `disk_size` - (Optional, ForceNew) Disk Size. Its interval varies with bandwidth, and the input must be within the interval, which can be viewed through the control. If it is not within the interval, the plan will cause a change when first created. -* `disk_type` - (Optional, ForceNew) Type of disk. +* `disk_size` - (Optional) Disk Size. Its interval varies with bandwidth, and the input must be within the interval, which can be viewed through the control. If it is not within the interval, the plan will cause a change when first created. +* `disk_type` - (Optional) Type of disk. * `dynamic_retention_config` - (Optional) Dynamic message retention policy configuration. -* `kafka_version` - (Optional, ForceNew) Kafka version (0.10.2/1.1.1/2.4.1). +* `kafka_version` - (Optional) Kafka version (0.10.2/1.1.1/2.4.1). * `msg_retention_time` - (Optional) The maximum retention time of instance logs, in minutes. the default is 10080 (7 days), the maximum is 30 days, and the default 0 is not filled, which means that the log retention time recovery policy is not enabled. -* `multi_zone_flag` - (Optional, ForceNew) Indicates whether the instance is multi zones. NOTE: if set to `true`, `zone_ids` must set together. -* `partition` - (Optional, ForceNew) Partition Size. Its interval varies with bandwidth, and the input must be within the interval, which can be viewed through the control. If it is not within the interval, the plan will cause a change when first created. -* `period` - (Optional, ForceNew) Prepaid purchase time, such as 1, is one month. +* `multi_zone_flag` - (Optional) Indicates whether the instance is multi zones. NOTE: if set to `true`, `zone_ids` must set together. +* `partition` - (Optional) Partition Size. Its interval varies with bandwidth, and the input must be within the interval, which can be viewed through the control. If it is not within the interval, the plan will cause a change when first created. +* `period` - (Optional) Prepaid purchase time, such as 1, is one month. * `public_network` - (Optional) Timestamp. * `rebalance_time` - (Optional) Modification of the rebalancing time after upgrade. -* `renew_flag` - (Optional, ForceNew) Prepaid automatic renewal mark, 0 means the default state, the initial state, 1 means automatic renewal, 2 means clear no automatic renewal (user setting). -* `tags` - (Optional, ForceNew) Partition size, the professional version does not need tag. -* `zone_ids` - (Optional, ForceNew) List of available zone id. NOTE: this argument must set together with `multi_zone_flag`. +* `renew_flag` - (Optional) Prepaid automatic renewal mark, 0 means the default state, the initial state, 1 means automatic renewal, 2 means clear no automatic renewal (user setting). +* `tags` - (Optional) Partition size, the professional version does not need tag. +* `zone_ids` - (Optional) List of available zone id. NOTE: this argument must set together with `multi_zone_flag`. The `config` object supports the following: