From c0ed83edf4a7feef10ae69f80fab45b04ff66e8c Mon Sep 17 00:00:00 2001 From: hellertang Date: Thu, 14 Sep 2023 12:59:36 +0800 Subject: [PATCH 1/3] flatten trocket --- go.mod | 4 +- go.sum | 68 +- tencentcloud/provider.go | 4 + ...urce_tc_trocket_rocketmq_consumer_group.go | 292 ++++++ ...tc_trocket_rocketmq_consumer_group_test.go | 98 ++ .../resource_tc_trocket_rocketmq_topic.go | 269 ++++++ ...resource_tc_trocket_rocketmq_topic_test.go | 91 ++ tencentcloud/service_tencentcloud_trocket.go | 128 +++ .../tencentcloud/common/http/request.go | 3 +- .../tencentcloud/trocket/v20230308/client.go | 458 ++++++++++ .../tencentcloud/trocket/v20230308/errors.go | 15 + .../tencentcloud/trocket/v20230308/models.go | 841 +++++++++++++++++- vendor/modules.txt | 4 +- .../docs/r/kubernetes_node_pool.html.markdown | 4 +- .../r/kubernetes_scale_worker.html.markdown | 2 +- ...cket_rocketmq_consumer_group.html.markdown | 66 ++ .../r/trocket_rocketmq_topic.html.markdown | 64 ++ website/tencentcloud.erb | 6 + 18 files changed, 2330 insertions(+), 87 deletions(-) create mode 100644 tencentcloud/resource_tc_trocket_rocketmq_consumer_group.go create mode 100644 tencentcloud/resource_tc_trocket_rocketmq_consumer_group_test.go create mode 100644 tencentcloud/resource_tc_trocket_rocketmq_topic.go create mode 100644 tencentcloud/resource_tc_trocket_rocketmq_topic_test.go create mode 100644 website/docs/r/trocket_rocketmq_consumer_group.html.markdown create mode 100644 website/docs/r/trocket_rocketmq_topic.html.markdown diff --git a/go.mod b/go.mod index e40b73c085..7e80832a7d 100644 --- a/go.mod +++ b/go.mod @@ -42,7 +42,7 @@ require ( github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/clb v1.0.693 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cloudaudit v1.0.544 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cls v1.0.711 - github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.745 + github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.746 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cvm v1.0.624 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cwp v1.0.589 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cynosdb v1.0.692 @@ -88,7 +88,7 @@ require ( github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/tem v1.0.578 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/teo v1.0.730 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/tke v1.0.691 - github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/trocket v1.0.744 + github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/trocket v1.0.746 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/tse v1.0.732 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/tsf v1.0.674 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/vod v1.0.199 diff --git a/go.sum b/go.sum index ba7a0166a8..4d9b9983f5 100644 --- a/go.sum +++ b/go.sum @@ -774,14 +774,6 @@ github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/antiddos v1.0.358 h1:U/ github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/antiddos v1.0.358/go.mod h1:oTPWRp1MbE4umgAHAUCogWxTdE6Uu50rL4b8HKIO1d8= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/api v1.0.285 h1:gFmukRGLtYiXVBVvg/5DP/0fM1+dKpwDjT+khtDVLmc= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/api v1.0.285/go.mod h1:aGlXSWjtSnE6kuqcaRy/NKj1CLiB8NlMSHGsDn+k7Ag= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/apigateway v1.0.691 h1:RhnrICcnccAN8AczCAhDq/lW9371YqmbqzWJVn8xZPs= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/apigateway v1.0.691/go.mod h1:XM8zSG1HC+8ZrPpi+ydeNLgPz1WHQxOZQK1gb94jkfs= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/apigateway v1.0.723 h1:SzMQJ9nL7Lg8fKo51RKI/ppuRxOxmigPiyE/cnqGMgg= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/apigateway v1.0.723/go.mod h1:5//PObmpqL0an4y24zsr0ngNWvOqSgzH3yzByV2IfeM= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/apigateway v1.0.731 h1:2Z5Eqi/1JSGufmpsLp8/FJ5dsK3MYKJPAqqXpZ6w/LY= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/apigateway v1.0.731/go.mod h1:3q5nG9MzUVjHjmGg9WBaxqSeKecwEe1Sh47JsE3UmAo= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/apigateway v1.0.735 h1:LTStNz2Yu2sU1h1EbXR0b/BETkY2b8Pmg6/FjkGcisc= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/apigateway v1.0.735/go.mod h1:Mlpl6wI1Nt754/czRtcbBaCOsAeDndImkT/KcqnKArg= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/apigateway v1.0.736 h1:1MnyH8BlX0/9LHIpJ4P45rQY4EYolSwxj57U5izmzzA= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/apigateway v1.0.736/go.mod h1:9VH40P3eA2ebZ04Y4xC5db/nVLSA7GSBIr4zhU5JlUs= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/apm v1.0.624 h1:AXDRZPPJ1dD5NpIU9C+Rh8wgvlqT2RsZPmcWCH24rrs= @@ -798,16 +790,6 @@ github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cdb v1.0.699 h1:LhFt0HW github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cdb v1.0.699/go.mod h1:wgCS1KCnSX7HbSI/mYghFSwfEDnZVeb3gwtPBXIppv4= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cdn v1.0.539 h1:0L6nZhT2bToTc/n1z3HOpNgdu5VX5ulmqIuPY+8UozA= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cdn v1.0.539/go.mod h1:6Syk7W5fdDf0BLvX+RXL5obQ6unkt3Id4aN2QqVrV6U= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cdwch v1.0.698 h1:KB6LWRcQ9x8pnQ46dJ6hMFr0isNnjljNKYVpNfFfwso= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cdwch v1.0.698/go.mod h1:QYtc8Z/v5lGpY7fq4YefsWPcQ71qBdoiTu0P97vrNTw= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cdwch v1.0.734 h1:lLaTMaf49VZ4Bk1gSHmQeWjzgBB5PupUAQ1bkDhyWPE= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cdwch v1.0.734/go.mod h1:b8mkJ06Xxqqiyb42/FTj71YyZ60Gt0zvlbtwbpMF7gY= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cdwch v1.0.736 h1:N6++C79PcOe3yAnjFwaoXwcd8jFT3Jqr0c60QeVtPRA= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cdwch v1.0.736/go.mod h1:Lz8ow6ykZFxoC3IbpLd7IdPMLaa9yFAMF0TuLkIVj2U= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cdwch v1.0.741 h1:Qx/NqGIM7dmDb6OjyTgff6qRr82lTAOwZKKVv86u7kU= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cdwch v1.0.741/go.mod h1:EL1f+ukgQgxiwolaB1fpcfi23FjZ83gz/Cd3epFMKTY= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cdwch v1.0.742 h1:yYeyDWBsUCpqt6hbKx3lGNxf6uiv07ZkXFfyVuq3+yw= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cdwch v1.0.742/go.mod h1:WtsECsOOaKMcGwINrg6yO3Hs3TJcla7Qgogb5HHBGDU= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cdwch v1.0.745 h1:y3CtDHGwJ8VDpAlNjluxZMdPbj4MQTD0RFIwQjKei4Q= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cdwch v1.0.745/go.mod h1:DxjJ8NLE8FGPaQP5k08z1gUqQCSwBuXgPs0u869VoyE= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cfs v1.0.627 h1:nChNdoCUWQZciiJj3gRCWoHBO/8LituLQOdCRREIrS4= @@ -831,7 +813,6 @@ github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.486/go.mod github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.514/go.mod h1:7sCQWVkxcsR38nffDW057DRGk8mUjK1Ing/EFOK8s8Y= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.520/go.mod h1:7sCQWVkxcsR38nffDW057DRGk8mUjK1Ing/EFOK8s8Y= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.524/go.mod h1:7sCQWVkxcsR38nffDW057DRGk8mUjK1Ing/EFOK8s8Y= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.529/go.mod h1:7sCQWVkxcsR38nffDW057DRGk8mUjK1Ing/EFOK8s8Y= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.533/go.mod h1:7sCQWVkxcsR38nffDW057DRGk8mUjK1Ing/EFOK8s8Y= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.535/go.mod h1:7sCQWVkxcsR38nffDW057DRGk8mUjK1Ing/EFOK8s8Y= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.539/go.mod h1:7sCQWVkxcsR38nffDW057DRGk8mUjK1Ing/EFOK8s8Y= @@ -845,7 +826,6 @@ github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.584/go.mod github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.589/go.mod h1:7sCQWVkxcsR38nffDW057DRGk8mUjK1Ing/EFOK8s8Y= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.591/go.mod h1:7sCQWVkxcsR38nffDW057DRGk8mUjK1Ing/EFOK8s8Y= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.600/go.mod h1:7sCQWVkxcsR38nffDW057DRGk8mUjK1Ing/EFOK8s8Y= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.616/go.mod h1:7sCQWVkxcsR38nffDW057DRGk8mUjK1Ing/EFOK8s8Y= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.624/go.mod h1:7sCQWVkxcsR38nffDW057DRGk8mUjK1Ing/EFOK8s8Y= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.627/go.mod h1:7sCQWVkxcsR38nffDW057DRGk8mUjK1Ing/EFOK8s8Y= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.628/go.mod h1:7sCQWVkxcsR38nffDW057DRGk8mUjK1Ing/EFOK8s8Y= @@ -854,9 +834,7 @@ github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.634/go.mod github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.651/go.mod h1:7sCQWVkxcsR38nffDW057DRGk8mUjK1Ing/EFOK8s8Y= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.652/go.mod h1:7sCQWVkxcsR38nffDW057DRGk8mUjK1Ing/EFOK8s8Y= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.655/go.mod h1:7sCQWVkxcsR38nffDW057DRGk8mUjK1Ing/EFOK8s8Y= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.656/go.mod h1:7sCQWVkxcsR38nffDW057DRGk8mUjK1Ing/EFOK8s8Y= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.657/go.mod h1:7sCQWVkxcsR38nffDW057DRGk8mUjK1Ing/EFOK8s8Y= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.664/go.mod h1:7sCQWVkxcsR38nffDW057DRGk8mUjK1Ing/EFOK8s8Y= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.672/go.mod h1:7sCQWVkxcsR38nffDW057DRGk8mUjK1Ing/EFOK8s8Y= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.673/go.mod h1:7sCQWVkxcsR38nffDW057DRGk8mUjK1Ing/EFOK8s8Y= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.674/go.mod h1:7sCQWVkxcsR38nffDW057DRGk8mUjK1Ing/EFOK8s8Y= @@ -868,34 +846,23 @@ github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.692/go.mod github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.693/go.mod h1:7sCQWVkxcsR38nffDW057DRGk8mUjK1Ing/EFOK8s8Y= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.695/go.mod h1:7sCQWVkxcsR38nffDW057DRGk8mUjK1Ing/EFOK8s8Y= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.696/go.mod h1:7sCQWVkxcsR38nffDW057DRGk8mUjK1Ing/EFOK8s8Y= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.698/go.mod h1:7sCQWVkxcsR38nffDW057DRGk8mUjK1Ing/EFOK8s8Y= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.699/go.mod h1:7sCQWVkxcsR38nffDW057DRGk8mUjK1Ing/EFOK8s8Y= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.701/go.mod h1:7sCQWVkxcsR38nffDW057DRGk8mUjK1Ing/EFOK8s8Y= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.706/go.mod h1:7sCQWVkxcsR38nffDW057DRGk8mUjK1Ing/EFOK8s8Y= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.711/go.mod h1:7sCQWVkxcsR38nffDW057DRGk8mUjK1Ing/EFOK8s8Y= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.713/go.mod h1:7sCQWVkxcsR38nffDW057DRGk8mUjK1Ing/EFOK8s8Y= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.715/go.mod h1:7sCQWVkxcsR38nffDW057DRGk8mUjK1Ing/EFOK8s8Y= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.725/go.mod h1:7sCQWVkxcsR38nffDW057DRGk8mUjK1Ing/EFOK8s8Y= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.726 h1:ZHyvJ5yedfZGccd1ZUJD8ChnFq7BX621RdGQDfcJf4w= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.726/go.mod h1:7sCQWVkxcsR38nffDW057DRGk8mUjK1Ing/EFOK8s8Y= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.729/go.mod h1:7sCQWVkxcsR38nffDW057DRGk8mUjK1Ing/EFOK8s8Y= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.730 h1:5biRUxcz/QWdzP6yH3bUBz1XAS19QYTjE9Hv59WM3q0= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.730/go.mod h1:7sCQWVkxcsR38nffDW057DRGk8mUjK1Ing/EFOK8s8Y= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.731 h1:CEVwQ9XWRPJuESAE5svto2WZZqtk9i1eAaqsviQyhyA= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.731/go.mod h1:7sCQWVkxcsR38nffDW057DRGk8mUjK1Ing/EFOK8s8Y= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.732 h1:19TNf4ATZQLFDSKNsJ+FE86rc2HlqkFeIO6wNw2Hj6g= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.732/go.mod h1:7sCQWVkxcsR38nffDW057DRGk8mUjK1Ing/EFOK8s8Y= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.734/go.mod h1:7sCQWVkxcsR38nffDW057DRGk8mUjK1Ing/EFOK8s8Y= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.735 h1:LJF4eHQdBd5fvjoIGrgB19knAZ98besEzskr0uyypLQ= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.735/go.mod h1:7sCQWVkxcsR38nffDW057DRGk8mUjK1Ing/EFOK8s8Y= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.736 h1:kDxUSuxipDOYAgssgXVf33WT2g6UyY+67yVMsVHPGiU= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.736/go.mod h1:7sCQWVkxcsR38nffDW057DRGk8mUjK1Ing/EFOK8s8Y= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.741 h1:lQMXqycdqNkCq6HkAA8yi3CHcRar+leQ8XN1fMvceRg= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.741/go.mod h1:7sCQWVkxcsR38nffDW057DRGk8mUjK1Ing/EFOK8s8Y= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.742 h1:Qno5G08Ppz9nfi0M9yLNnyY+9vsr4TqvWLEp4xnX7yw= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.742/go.mod h1:7sCQWVkxcsR38nffDW057DRGk8mUjK1Ing/EFOK8s8Y= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.745 h1:esd+b4fHf6ZgaryrrEN9Sz7QBTpnozl1cIuZ+bRgZbk= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.737/go.mod h1:7sCQWVkxcsR38nffDW057DRGk8mUjK1Ing/EFOK8s8Y= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.743/go.mod h1:7sCQWVkxcsR38nffDW057DRGk8mUjK1Ing/EFOK8s8Y= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.745/go.mod h1:7sCQWVkxcsR38nffDW057DRGk8mUjK1Ing/EFOK8s8Y= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.746 h1:HR4eaIyJhb4sDK8G9W/EuX+ZTgV7mKsd4t4/y5I3mtU= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.746/go.mod h1:7sCQWVkxcsR38nffDW057DRGk8mUjK1Ing/EFOK8s8Y= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cvm v1.0.624 h1:nEZqsoqt1pEoaP9JjkHQy3/H00suCfzlHW1qOm2nYD8= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cvm v1.0.624/go.mod h1:+TXSVyeKwt1IhZRqKPbTREteBcP+K07Q846/ilNzLWA= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cwp v1.0.589 h1:LZihgirMH0vsaGScYexxwY0fTss9vHaSZs/YOQUVESg= @@ -928,8 +895,6 @@ github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/gaap v1.0.514 h1:MKSaqF github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/gaap v1.0.514/go.mod h1:uTfhkzPZOwop+tSo83QHrMWtesWdQApxJuFZEXGKXH0= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/kms v1.0.563 h1:FoX+MK4vHThvPO6FbP5q98zD8S3n+d5+DbtK7skl++c= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/kms v1.0.563/go.mod h1:uom4Nvi9W+Qkom0exYiJ9VWJjXwyxtPYTkKkaLMlfE0= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/lighthouse v1.0.656 h1:g//msFpwifqXoHuSIara75o2NWs4lRYHJ5qWQuBcYEs= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/lighthouse v1.0.656/go.mod h1:hvE2a3GX09BXRMTIsk0w0vkAJ4QcagMq+pXCLnFmPNM= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/lighthouse v1.0.729 h1:WQpzm3x27Jo/5uh6/Yqe/gbJ7r2ui9hc9ST7Ml2eP9Y= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/lighthouse v1.0.729/go.mod h1:lLoyD7Z6OQQDFxDGGTe8wmirhUFZ36l5OaxzP75853Y= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/live v1.0.535 h1:hSwG4ZbcP2Ht+AWHI81EMCvJdDTyTT7zP/qjOe/VcZg= @@ -938,8 +903,6 @@ github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/mariadb v1.0.672 h1:sR3 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/mariadb v1.0.672/go.mod h1:o3rBKhtfIJfw4BG22M0CQVLQAc0WqIsbyRI/EW52Ka0= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/mongodb v1.0.651 h1:Ohb58H6gIlTcd73CF+goUlEdNJ2CYkYUHTYxV/M4UL4= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/mongodb v1.0.651/go.mod h1:HLqsSgUnwgkE+XecQajekinjz1B7S+1U1J66puH4jpQ= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/monitor v1.0.616 h1:+4NM1Repe514qc4H9qFuDS0IEe0TBmC5snea//YL7Kk= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/monitor v1.0.616/go.mod h1:n7vl5IwlMQS/XzBzj3UEkp1dvQorzuAMq6RYNgl/MjM= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/monitor v1.0.734 h1:VJli3mzhAiwmA949M0eIgp6KLJsPuCtpQ20UBdNI9mY= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/monitor v1.0.734/go.mod h1:H2gtCj02D5k7h0JttS9RMoRgkJ8m9qia/9RlMjbvT0o= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/mps v1.0.584 h1:FJxYOAolkBhXjQMWoiTek9Ag0bslcKFHyrM7w2Jsxos= @@ -948,8 +911,6 @@ github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/organization v1.0.540 h github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/organization v1.0.540/go.mod h1:jHcHwlsdNL9ycLwNtqYZVjLKJILA1xuODMeMDMOxCrA= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/postgres v1.0.676 h1:KDt87M2b8j/Xo/9o+kaVtJ46fOtPctCpMDa1CJpSlkY= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/postgres v1.0.676/go.mod h1:mXbqv53QFAhvyYqainXSAMdoCui5GudorFhKufJxITc= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/privatedns v1.0.290 h1:osYZxh9ApEc8UpvIMwjAUfdl7ytRcWUpcnnqLIpiJ/U= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/privatedns v1.0.290/go.mod h1:En+pdagcHkAASorHT1l8R6tUtieRNNxaQ7nfyqWPefk= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/privatedns v1.0.736 h1:HxilF8QU6rguue0eusDPSo2ygvcA7BPgG2AdVa8YRfs= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/privatedns v1.0.736/go.mod h1:C0aHvKZahgErjMQ5zlLEfCO+M3qj1YSBc+Otf/vwTEI= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/pts v1.0.533 h1:BJDJlHkuoPsSUJ/ZHnmtX3gmA2PVfmKyhB7uV2d9QlE= @@ -958,20 +919,14 @@ github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/redis v1.0.657 h1:9p/4/ github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/redis v1.0.657/go.mod h1:CPc7SSKl8I21UmhTf2AVYZqZfy8MbDr/RrMsSqMkOAM= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/rum v1.0.542 h1:/U0rTVKXD7Y8Opw6OtnqSDPnWiP3zMMAlxOKayII/5Q= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/rum v1.0.542/go.mod h1:QF1J13hmuMY5gMrBopRFmHWFs/KsLr5uCNBRJt5aA1M= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/scf v1.0.664 h1:57r4xDd0t9zQw8tLO9k13gYy/EYYGtFV3fMPx1BJinY= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/scf v1.0.664/go.mod h1:dFFSCohvDzW2jidqjb5GFDhQD/2AfM1tZ8ijkuJUr9Y= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/scf v1.0.729 h1:UWTpLpN3UngFNTuMosxSMCcmuoLksvuc9tt7ulCe0D8= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/scf v1.0.729/go.mod h1:P5cLcaPdmOiRhv79OAvAKf+9JTg/64N7ZxwZHBW2mZA= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/ses v1.0.529 h1:NezuBQEG7ihXbwueREo4qavBAo6ZcHuWGZt1dR+VdKc= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/ses v1.0.529/go.mod h1:Xfmf4Rq4J2ukz6NoEwpADQS5ws3By3KDPemCQeeMF+M= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/ses v1.0.743 h1:loQWl2qSlclwPrgAyvkIODDXbwy3ZPynAxiMf+TJdjY= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/ses v1.0.743/go.mod h1:oqFIxpm3Pu3cT9qAALFw2VqcC4g/tVyWGOkjVkpJakA= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/sms v1.0.486 h1:eHLaL+hl5X5f8Apuf2SGVclO3MRev/E3AfA/0aZQGUA= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/sms v1.0.486/go.mod h1:MSsho0YlAsoPCOMqdBfwqGd/SMQ0FTGh0a6emBy2X+g= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/sqlserver v1.0.689 h1:SWmtQo+FO+QneHfwcl7u/4YnSwgxVjXNyJMn9+WlzmI= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/sqlserver v1.0.689/go.mod h1:nRLv9M2dJm5gH5xlwg8KSJ30g5qOO07mkAePzXoEGVM= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/ssl v1.0.199 h1:UkF3qBxMbpOf2VjxgzMgqvBCS+Hqr8XXSrtRd+rABMk= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/ssl v1.0.199/go.mod h1:Ofo7/s0NJLXV7rX/Yfx0OPq8NaPie07JwoEGZpxTeJY= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/ssl v1.0.737 h1:jwXNUvSfYkSMMqdNtpXvWBxRFG6Vo2Zq55pT0pmUEb4= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/ssl v1.0.737/go.mod h1:8GgTEIpk5TW0mDB/FVV/vNSzijtEMiF42AcHf/NpfRA= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/ssm v1.0.691 h1:UE55TqueOP889MDcJ+cBW+MBjtzvWUw5fuOBWGCBIjs= @@ -994,16 +949,12 @@ github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/tdmq v1.0.713 h1:irzsVE github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/tdmq v1.0.713/go.mod h1:KAeuwpfqNn+WGt3DEgM+pYpK78P0Yk40CVHs37zc4Mw= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/tem v1.0.578 h1:vBpQhUroO+FAslUmsDWGi8nvczsqZBWVgQwlnyT0Aj8= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/tem v1.0.578/go.mod h1:UlojGQh/9wb7/uXPNi7PvMral1CNAskVDNgqJEV83l0= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/teo v1.0.529 h1:vWUgseUvHs1fW/Ok+x3ld9UIhrYRNO9Yr8ccX8wmkkY= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/teo v1.0.529/go.mod h1:vOd23iOVeQqm5LSEXUmE8773kiUCwGuoJnTO0po5D+Q= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/teo v1.0.730 h1:isKxaxmOUKjXXRZZ6lmoy7WhqKLZcEKpRWU1adsIpm8= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/teo v1.0.730/go.mod h1:vA9wf067VO5kkEjUgViUw/VA0ALUXE/wbSI1baeuHpI= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/tke v1.0.691 h1:D+a7bZnjLoqPAAHSPCOmil4eigXnGPkR1R5G3ybT/+c= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/tke v1.0.691/go.mod h1:hsc/CPzbCRXqblCYuE1HuvP3G06OWA9zhAGI6AtEe5U= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/trocket v1.0.744 h1:ceQ0X5ALBhKqD07Ksa+XAO0PMwStqzhRfkfJUuUcWMI= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/trocket v1.0.744/go.mod h1:6dgX5GULjOoROcb3gDWr7tOpMSh9dHwwi0Kl6ZngGtI= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/tse v1.0.701 h1:k048M8hxerqIt9am5Hw9xJBmbJdPDxJd3Fzp2O1jlf0= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/tse v1.0.701/go.mod h1:t8LNOPsOOP1JtkDcZLtDu7dyAp4mwffBKu4Q+5Oyl/o= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/trocket v1.0.746 h1:ZHfhs8xTWUtKHwDJQNd8mGzV2hFifwKOWYDJTbPrOSM= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/trocket v1.0.746/go.mod h1:NS1bkjH/+dhwCFvluZd+uq8h8hbnOHJaFDbkQe0YTm4= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/tse v1.0.732 h1:hC6bRxIBwjAEnqDsJh8tpY/SqcSfP84exN+cVvHwtd4= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/tse v1.0.732/go.mod h1:jF0O9bIPZ/oQ+m3qeEfWHLbtsJFKNaiqvdSNGP7AQCI= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/tsf v1.0.674 h1:VsMV1/vsgVzespG7jUzraZS/AbAUllVQjmtVAlA9W/M= @@ -1018,7 +969,9 @@ github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/wss v1.0.199 h1:hMBLtiJ github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/wss v1.0.199/go.mod h1:nnY91/H3j/Gu7V/oCA6Zeg8T5D3q36EUdBh4EjmHwqY= github.com/tencentyun/cos-go-sdk-v5 v0.7.42-0.20230629101357-7edd77448a0f h1:yTMDoBvFuXjZat10d98DIKbPnN9FQG+drt1SbNfMW5U= github.com/tencentyun/cos-go-sdk-v5 v0.7.42-0.20230629101357-7edd77448a0f/go.mod h1:LUFnaqRmGk6pEHOaRmdn2dCZR2j0cSsM5xowWFPTPao= +github.com/tenntenn/modver v1.0.1 h1:2klLppGhDgzJrScMpkj9Ujy3rXPUspSjAcev9tSEBgA= github.com/tenntenn/modver v1.0.1/go.mod h1:bePIyQPb7UeioSRkw3Q0XeMhYZSMx9B8ePqg6SAMGH0= +github.com/tenntenn/text/transform v0.0.0-20200319021203-7eef512accb3 h1:f+jULpRQGxTSkNYKJ51yaw6ChIqO+Je8UqsTKN/cDag= github.com/tenntenn/text/transform v0.0.0-20200319021203-7eef512accb3/go.mod h1:ON8b8w4BN/kE1EOhwT0o+d62W65a6aPw1nouo9LMgyY= github.com/tetafro/godot v1.4.11 h1:BVoBIqAf/2QdbFmSwAWnaIqDivZdOV0ZRwEm6jivLKw= github.com/tetafro/godot v1.4.11/go.mod h1:LR3CJpxDVGlYOWn3ZZg1PgNZdTUvzsZWu8xaEohUpn8= @@ -1047,6 +1000,7 @@ github.com/vmihailenco/msgpack/v4 v4.3.12 h1:07s4sz9IReOgdikxLTKNbBdqDMLsjPKXwvC github.com/vmihailenco/msgpack/v4 v4.3.12/go.mod h1:gborTTJjAo/GWTqqRjrLCn9pgNN+NXzzngzBKDPIqw4= github.com/vmihailenco/tagparser v0.1.1 h1:quXMXlA39OCbd2wAdTsGDlK9RkOk6Wuw+x37wVyIuWY= github.com/vmihailenco/tagparser v0.1.1/go.mod h1:OeAg3pn3UbLjkWt+rN9oFYB6u/cQgqMEUPoW2WPyhdI= +github.com/xanzy/ssh-agent v0.3.0 h1:wUMzuKtKilRgBAD1sUb8gOwwRr2FGoBVumcjoOACClI= github.com/xanzy/ssh-agent v0.3.0/go.mod h1:3s9xbODqPuuhK9JV1R321M/FlMZSBvE5aY6eAcqrDh0= github.com/xo/terminfo v0.0.0-20210125001918-ca9a967f8778 h1:QldyIu/L63oPpyvQmHgvgickp1Yw510KJOqX7H24mg8= github.com/xo/terminfo v0.0.0-20210125001918-ca9a967f8778/go.mod h1:2MuV+tbUrU1zIOPMxZ5EncGwgmMJsa+9ucAQZXxsObs= @@ -1085,6 +1039,7 @@ go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= go.uber.org/atomic v1.7.0 h1:ADUqmZGgLDDfbSL9ZmPxKTybcoEYHgpYfELNoN+7hsw= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= +go.uber.org/goleak v1.1.11 h1:wy28qYRKZgnJTxGxvye5/wgWr1EKjmUDGYox5mGlRlI= go.uber.org/multierr v1.6.0 h1:y6IPFStTAIT5Ytl7/XYmHvzXQ7S3g/IeZW9hyZ5thw4= go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= go.uber.org/zap v1.24.0 h1:FiJd5l1UOLj0wCgbSE0rwwXHzEdAZS6hiiSnxJN/D60= @@ -1315,6 +1270,7 @@ golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= golang.org/x/term v0.3.0/go.mod h1:q750SLmJuPmVoN1blW3UFBPREJfb1KmY3vwxfr+nFDA= golang.org/x/term v0.4.0/go.mod h1:9P2UbLfCdcvo3p/nzKvsmas4TnlujnuoV9hGgYzW1lQ= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= +golang.org/x/term v0.6.0 h1:clScbb1cHjoCkyRbWwBEUZ5H/tIFu5TAXIqaZD0Gcjw= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1518,6 +1474,7 @@ gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8 gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/cheggaaa/pb.v1 v1.0.27/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= @@ -1525,6 +1482,7 @@ gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMy gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= +gopkg.in/warnings.v0 v0.1.2 h1:wFXVbFY8DY5/xOe1ECiWdKCzZlxgshcYVNkBHstARME= gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= diff --git a/tencentcloud/provider.go b/tencentcloud/provider.go index 5295fa9ed0..5275eb703a 100644 --- a/tencentcloud/provider.go +++ b/tencentcloud/provider.go @@ -1448,6 +1448,8 @@ TDMQ for RocketMQ(trocket) tencentcloud_tdmq_send_rocketmq_message tencentcloud_tdmq_rocketmq_vip_instance tencentcloud_trocket_rocketmq_instance + tencentcloud_trocket_rocketmq_topic + tencentcloud_trocket_rocketmq_consumer_group TDMQ for RabbitMQ(trabbit) Resource @@ -2888,6 +2890,8 @@ func Provider() *schema.Provider { "tencentcloud_tdmq_rocketmq_environment_role": resourceTencentCloudTdmqRocketmqEnvironmentRole(), "tencentcloud_tdmq_rocketmq_vip_instance": resourceTencentCloudTdmqRocketmqVipInstance(), "tencentcloud_trocket_rocketmq_instance": resourceTencentCloudTrocketRocketmqInstance(), + "tencentcloud_trocket_rocketmq_topic": resourceTencentCloudTrocketRocketmqTopic(), + "tencentcloud_trocket_rocketmq_consumer_group": resourceTencentCloudTrocketRocketmqConsumerGroup(), "tencentcloud_dts_sync_job": resourceTencentCloudDtsSyncJob(), "tencentcloud_dts_sync_config": resourceTencentCloudDtsSyncConfig(), "tencentcloud_dts_sync_check_job_operation": resourceTencentCloudDtsSyncCheckJobOperation(), diff --git a/tencentcloud/resource_tc_trocket_rocketmq_consumer_group.go b/tencentcloud/resource_tc_trocket_rocketmq_consumer_group.go new file mode 100644 index 0000000000..04c4dbcb52 --- /dev/null +++ b/tencentcloud/resource_tc_trocket_rocketmq_consumer_group.go @@ -0,0 +1,292 @@ +/* +Provides a resource to create a trocket rocketmq_consumer_group + +Example Usage + +```hcl +resource "tencentcloud_trocket_rocketmq_instance" "rocketmq_instance" { + instance_type = "EXPERIMENT" + name = "test" + sku_code = "experiment_500" + remark = "test" + vpc_id = "vpc-xxxxxx" + subnet_id = "subnet-xxxxx" + tags = { + tag_key = "rocketmq" + tag_value = "5.x" + } +} + +resource "tencentcloud_trocket_rocketmq_consumer_group" "rocketmq_consumer_group" { + instance_id = tencentcloud_trocket_rocketmq_instance.rocketmq_instance.id + consumer_group = "test_consumer_group" + max_retry_times = 20 + consume_enable = false + consume_message_orderly = true + remark = "test for terraform" +} +``` + +Import + +trocket rocketmq_consumer_group can be imported using the id, e.g. + +``` +terraform import tencentcloud_trocket_rocketmq_consumer_group.rocketmq_consumer_group instanceId#consumerGroup +``` +*/ +package tencentcloud + +import ( + "context" + "fmt" + "log" + "strings" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + trocket "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/trocket/v20230308" + "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/internal/helper" +) + +func resourceTencentCloudTrocketRocketmqConsumerGroup() *schema.Resource { + return &schema.Resource{ + Create: resourceTencentCloudTrocketRocketmqConsumerGroupCreate, + Read: resourceTencentCloudTrocketRocketmqConsumerGroupRead, + Update: resourceTencentCloudTrocketRocketmqConsumerGroupUpdate, + Delete: resourceTencentCloudTrocketRocketmqConsumerGroupDelete, + Importer: &schema.ResourceImporter{ + State: schema.ImportStatePassthrough, + }, + Schema: map[string]*schema.Schema{ + "instance_id": { + Required: true, + Type: schema.TypeString, + Description: "Instance ID.", + }, + + "consumer_group": { + Required: true, + Type: schema.TypeString, + Description: "Name of consumer group.", + }, + + "max_retry_times": { + Required: true, + Type: schema.TypeInt, + Description: "Max retry times.", + }, + + "consume_enable": { + Required: true, + Type: schema.TypeBool, + Description: "Whether to enable consumption.", + }, + + "consume_message_orderly": { + Required: true, + Type: schema.TypeBool, + Description: "`true`: Sequential delivery, `false`: Concurrent delivery.", + }, + + "remark": { + Optional: true, + Type: schema.TypeString, + Description: "remark.", + }, + }, + } +} + +func resourceTencentCloudTrocketRocketmqConsumerGroupCreate(d *schema.ResourceData, meta interface{}) error { + defer logElapsed("resource.tencentcloud_trocket_rocketmq_consumer_group.create")() + defer inconsistentCheck(d, meta)() + + logId := getLogId(contextNil) + + var ( + request = trocket.NewCreateConsumerGroupRequest() + response = trocket.NewCreateConsumerGroupResponse() + instanceId string + consumerGroup string + ) + if v, ok := d.GetOk("instance_id"); ok { + request.InstanceId = helper.String(v.(string)) + } + + if v, ok := d.GetOk("consumer_group"); ok { + request.ConsumerGroup = helper.String(v.(string)) + } + + if v, ok := d.GetOkExists("max_retry_times"); ok { + request.MaxRetryTimes = helper.IntInt64(v.(int)) + } + + if v, ok := d.GetOkExists("consume_enable"); ok { + request.ConsumeEnable = helper.Bool(v.(bool)) + } + + if v, ok := d.GetOkExists("consume_message_orderly"); ok { + request.ConsumeMessageOrderly = helper.Bool(v.(bool)) + } + + if v, ok := d.GetOk("remark"); ok { + request.Remark = helper.String(v.(string)) + } + + err := resource.Retry(writeRetryTimeout, func() *resource.RetryError { + result, e := meta.(*TencentCloudClient).apiV3Conn.UseTrocketClient().CreateConsumerGroup(request) + if e != nil { + return retryError(e) + } else { + log.Printf("[DEBUG]%s api[%s] success, request body [%s], response body [%s]\n", logId, request.GetAction(), request.ToJsonString(), result.ToJsonString()) + } + response = result + return nil + }) + if err != nil { + log.Printf("[CRITAL]%s create trocket rocketmqConsumerGroup failed, reason:%+v", logId, err) + return err + } + + instanceId = *response.Response.InstanceId + consumerGroup = *response.Response.ConsumerGroup + d.SetId(instanceId + FILED_SP + consumerGroup) + + return resourceTencentCloudTrocketRocketmqConsumerGroupRead(d, meta) +} + +func resourceTencentCloudTrocketRocketmqConsumerGroupRead(d *schema.ResourceData, meta interface{}) error { + defer logElapsed("resource.tencentcloud_trocket_rocketmq_consumer_group.read")() + defer inconsistentCheck(d, meta)() + + logId := getLogId(contextNil) + + ctx := context.WithValue(context.TODO(), logIdKey, logId) + + service := TrocketService{client: meta.(*TencentCloudClient).apiV3Conn} + + idSplit := strings.Split(d.Id(), FILED_SP) + if len(idSplit) != 2 { + return fmt.Errorf("id is broken,%s", d.Id()) + } + instanceId := idSplit[0] + consumerGroup := idSplit[1] + + rocketmqConsumerGroup, err := service.DescribeTrocketRocketmqConsumerGroupById(ctx, instanceId, consumerGroup) + if err != nil { + return err + } + + if rocketmqConsumerGroup == nil { + d.SetId("") + log.Printf("[WARN]%s resource `TrocketRocketmqConsumerGroup` [%s] not found, please check if it has been deleted.\n", logId, d.Id()) + return nil + } + + _ = d.Set("instance_id", instanceId) + _ = d.Set("consumer_group", consumerGroup) + + if rocketmqConsumerGroup.MaxRetryTimes != nil { + _ = d.Set("max_retry_times", rocketmqConsumerGroup.MaxRetryTimes) + } + + if rocketmqConsumerGroup.ConsumeEnable != nil { + _ = d.Set("consume_enable", rocketmqConsumerGroup.ConsumeEnable) + } + + if rocketmqConsumerGroup.ConsumeMessageOrderly != nil { + _ = d.Set("consume_message_orderly", rocketmqConsumerGroup.ConsumeMessageOrderly) + } + + if rocketmqConsumerGroup.Remark != nil { + _ = d.Set("remark", rocketmqConsumerGroup.Remark) + } + + return nil +} + +func resourceTencentCloudTrocketRocketmqConsumerGroupUpdate(d *schema.ResourceData, meta interface{}) error { + defer logElapsed("resource.tencentcloud_trocket_rocketmq_consumer_group.update")() + defer inconsistentCheck(d, meta)() + + logId := getLogId(contextNil) + + request := trocket.NewModifyConsumerGroupRequest() + + idSplit := strings.Split(d.Id(), FILED_SP) + if len(idSplit) != 2 { + return fmt.Errorf("id is broken,%s", d.Id()) + } + instanceId := idSplit[0] + consumerGroup := idSplit[1] + + request.InstanceId = &instanceId + request.ConsumerGroup = &consumerGroup + + needChange := false + + mutableArgs := []string{"max_retry_times", "consume_enable", "consume_message_orderly", "remark"} + + for _, v := range mutableArgs { + if d.HasChange(v) { + needChange = true + } + } + + if needChange { + if v, ok := d.GetOkExists("max_retry_times"); ok { + request.MaxRetryTimes = helper.IntInt64(v.(int)) + } + + if v, ok := d.GetOkExists("consume_enable"); ok { + request.ConsumeEnable = helper.Bool(v.(bool)) + } + + if v, ok := d.GetOkExists("consume_message_orderly"); ok { + request.ConsumeMessageOrderly = helper.Bool(v.(bool)) + } + + if v, ok := d.GetOk("remark"); ok { + request.Remark = helper.String(v.(string)) + } + + err := resource.Retry(writeRetryTimeout, func() *resource.RetryError { + result, e := meta.(*TencentCloudClient).apiV3Conn.UseTrocketClient().ModifyConsumerGroup(request) + if e != nil { + return retryError(e) + } else { + log.Printf("[DEBUG]%s api[%s] success, request body [%s], response body [%s]\n", logId, request.GetAction(), request.ToJsonString(), result.ToJsonString()) + } + return nil + }) + if err != nil { + log.Printf("[CRITAL]%s update trocket rocketmqConsumerGroup failed, reason:%+v", logId, err) + return err + } + } + + return resourceTencentCloudTrocketRocketmqConsumerGroupRead(d, meta) +} + +func resourceTencentCloudTrocketRocketmqConsumerGroupDelete(d *schema.ResourceData, meta interface{}) error { + defer logElapsed("resource.tencentcloud_trocket_rocketmq_consumer_group.delete")() + defer inconsistentCheck(d, meta)() + + logId := getLogId(contextNil) + ctx := context.WithValue(context.TODO(), logIdKey, logId) + + service := TrocketService{client: meta.(*TencentCloudClient).apiV3Conn} + idSplit := strings.Split(d.Id(), FILED_SP) + if len(idSplit) != 2 { + return fmt.Errorf("id is broken,%s", d.Id()) + } + instanceId := idSplit[0] + consumerGroup := idSplit[1] + + if err := service.DeleteTrocketRocketmqConsumerGroupById(ctx, instanceId, consumerGroup); err != nil { + return err + } + + return nil +} diff --git a/tencentcloud/resource_tc_trocket_rocketmq_consumer_group_test.go b/tencentcloud/resource_tc_trocket_rocketmq_consumer_group_test.go new file mode 100644 index 0000000000..a2b8da1851 --- /dev/null +++ b/tencentcloud/resource_tc_trocket_rocketmq_consumer_group_test.go @@ -0,0 +1,98 @@ +package tencentcloud + +import ( + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" +) + +func TestAccTencentCloudTrocketRocketmqConsumerGroupResource_basic(t *testing.T) { + t.Parallel() + resource.Test(t, resource.TestCase{ + PreCheck: func() { + testAccPreCheck(t) + }, + Providers: testAccProviders, + Steps: []resource.TestStep{ + { + Config: testAccTrocketRocketmqConsumerGroup, + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrSet("tencentcloud_trocket_rocketmq_consumer_group.rocketmq_consumer_group", "id"), + resource.TestCheckResourceAttr("tencentcloud_trocket_rocketmq_consumer_group.rocketmq_consumer_group", "consumer_group", "test_consumer_group"), + resource.TestCheckResourceAttr("tencentcloud_trocket_rocketmq_consumer_group.rocketmq_consumer_group", "max_retry_times", "20"), + resource.TestCheckResourceAttr("tencentcloud_trocket_rocketmq_consumer_group.rocketmq_consumer_group", "consume_enable", "false"), + resource.TestCheckResourceAttr("tencentcloud_trocket_rocketmq_consumer_group.rocketmq_consumer_group", "consume_message_orderly", "true"), + resource.TestCheckResourceAttr("tencentcloud_trocket_rocketmq_consumer_group.rocketmq_consumer_group", "remark", "test for terraform"), + ), + }, + { + Config: testAccTrocketRocketmqConsumerGroupUpdate, + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrSet("tencentcloud_trocket_rocketmq_consumer_group.rocketmq_consumer_group", "id"), + resource.TestCheckResourceAttr("tencentcloud_trocket_rocketmq_consumer_group.rocketmq_consumer_group", "consumer_group", "test_consumer_group"), + resource.TestCheckResourceAttr("tencentcloud_trocket_rocketmq_consumer_group.rocketmq_consumer_group", "max_retry_times", "24"), + resource.TestCheckResourceAttr("tencentcloud_trocket_rocketmq_consumer_group.rocketmq_consumer_group", "consume_enable", "true"), + resource.TestCheckResourceAttr("tencentcloud_trocket_rocketmq_consumer_group.rocketmq_consumer_group", "consume_message_orderly", "true"), + resource.TestCheckResourceAttr("tencentcloud_trocket_rocketmq_consumer_group.rocketmq_consumer_group", "remark", "test terraform"), + ), + }, + { + ResourceName: "tencentcloud_trocket_rocketmq_consumer_group.rocketmq_consumer_group", + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + +const testAccTrocketRocketmqConsumerGroup = ` + +resource "tencentcloud_trocket_rocketmq_instance" "rocketmq_instance" { + instance_type = "EXPERIMENT" + name = "test_consumer_group" + sku_code = "experiment_500" + remark = "test" + vpc_id = "vpc-3a9fo1k9" + subnet_id = "subnet-8nby1yxg" + tags = { + tag_key = "rocketmq" + tag_value = "5.x" + } +} + +resource "tencentcloud_trocket_rocketmq_consumer_group" "rocketmq_consumer_group" { + instance_id = tencentcloud_trocket_rocketmq_instance.rocketmq_instance.id + consumer_group = "test_consumer_group" + max_retry_times = 20 + consume_enable = false + consume_message_orderly = true + remark = "test for terraform" +} + +` + +const testAccTrocketRocketmqConsumerGroupUpdate = ` + +resource "tencentcloud_trocket_rocketmq_instance" "rocketmq_instance" { + instance_type = "EXPERIMENT" + name = "test_consumer_group" + sku_code = "experiment_500" + remark = "test" + vpc_id = "vpc-3a9fo1k9" + subnet_id = "subnet-8nby1yxg" + tags = { + tag_key = "rocketmq" + tag_value = "5.x" + } +} + +resource "tencentcloud_trocket_rocketmq_consumer_group" "rocketmq_consumer_group" { + instance_id = tencentcloud_trocket_rocketmq_instance.rocketmq_instance.id + consumer_group = "test_consumer_group" + max_retry_times = 24 + consume_enable = true + consume_message_orderly = true + remark = "test terraform" +} + +` diff --git a/tencentcloud/resource_tc_trocket_rocketmq_topic.go b/tencentcloud/resource_tc_trocket_rocketmq_topic.go new file mode 100644 index 0000000000..42762c60f5 --- /dev/null +++ b/tencentcloud/resource_tc_trocket_rocketmq_topic.go @@ -0,0 +1,269 @@ +/* +Provides a resource to create a trocket rocketmq_topic + +Example Usage + +```hcl +resource "tencentcloud_trocket_rocketmq_instance" "rocketmq_instance" { + instance_type = "EXPERIMENT" + name = "test" + sku_code = "experiment_500" + remark = "test" + vpc_id = "vpc-xxxxx" + subnet_id = "subnet-xxxxx" + tags = { + tag_key = "rocketmq" + tag_value = "5.x" + } +} + +resource "tencentcloud_trocket_rocketmq_topic" "rocketmq_topic" { + instance_id = tencentcloud_trocket_rocketmq_instance.rocketmq_instance.id + topic = "test_topic" + topic_type = "NORMAL" + queue_num = 4 + remark = "test for terraform" +} +``` + +Import + +trocket rocketmq_topic can be imported using the id, e.g. + +``` +terraform import tencentcloud_trocket_rocketmq_topic.rocketmq_topic instanceId#topic +``` +*/ +package tencentcloud + +import ( + "context" + "fmt" + "log" + "strings" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + trocket "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/trocket/v20230308" + "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/internal/helper" +) + +func resourceTencentCloudTrocketRocketmqTopic() *schema.Resource { + return &schema.Resource{ + Create: resourceTencentCloudTrocketRocketmqTopicCreate, + Read: resourceTencentCloudTrocketRocketmqTopicRead, + Update: resourceTencentCloudTrocketRocketmqTopicUpdate, + Delete: resourceTencentCloudTrocketRocketmqTopicDelete, + Importer: &schema.ResourceImporter{ + State: schema.ImportStatePassthrough, + }, + Schema: map[string]*schema.Schema{ + "instance_id": { + Required: true, + Type: schema.TypeString, + ForceNew: true, + Description: "Instance Id.", + }, + + "topic": { + Required: true, + Type: schema.TypeString, + ForceNew: true, + Description: "topic.", + }, + + "topic_type": { + Required: true, + ForceNew: true, + Type: schema.TypeString, + Description: "Topic type. `UNSPECIFIED`: not specified, `NORMAL`: normal message, `FIFO`: sequential message, `DELAY`: delayed message.", + }, + + "queue_num": { + Required: true, + Type: schema.TypeInt, + Description: "Number of queue. Must be greater than or equal to 3.", + }, + + "remark": { + Optional: true, + Type: schema.TypeString, + Description: "remark.", + }, + }, + } +} + +func resourceTencentCloudTrocketRocketmqTopicCreate(d *schema.ResourceData, meta interface{}) error { + defer logElapsed("resource.tencentcloud_trocket_rocketmq_topic.create")() + defer inconsistentCheck(d, meta)() + + logId := getLogId(contextNil) + + var ( + request = trocket.NewCreateTopicRequest() + response = trocket.NewCreateTopicResponse() + instanceId string + topic string + ) + if v, ok := d.GetOk("instance_id"); ok { + request.InstanceId = helper.String(v.(string)) + } + + if v, ok := d.GetOk("topic"); ok { + request.Topic = helper.String(v.(string)) + } + + if v, ok := d.GetOk("topic_type"); ok { + request.TopicType = helper.String(v.(string)) + } + + if v, ok := d.GetOkExists("queue_num"); ok { + request.QueueNum = helper.IntInt64(v.(int)) + } + + if v, ok := d.GetOk("remark"); ok { + request.Remark = helper.String(v.(string)) + } + + err := resource.Retry(writeRetryTimeout, func() *resource.RetryError { + result, e := meta.(*TencentCloudClient).apiV3Conn.UseTrocketClient().CreateTopic(request) + if e != nil { + return retryError(e) + } else { + log.Printf("[DEBUG]%s api[%s] success, request body [%s], response body [%s]\n", logId, request.GetAction(), request.ToJsonString(), result.ToJsonString()) + } + response = result + return nil + }) + if err != nil { + log.Printf("[CRITAL]%s create trocket rocketmqTopic failed, reason:%+v", logId, err) + return err + } + + instanceId = *response.Response.InstanceId + topic = *response.Response.Topic + d.SetId(instanceId + FILED_SP + topic) + + return resourceTencentCloudTrocketRocketmqTopicRead(d, meta) +} + +func resourceTencentCloudTrocketRocketmqTopicRead(d *schema.ResourceData, meta interface{}) error { + defer logElapsed("resource.tencentcloud_trocket_rocketmq_topic.read")() + defer inconsistentCheck(d, meta)() + + logId := getLogId(contextNil) + + ctx := context.WithValue(context.TODO(), logIdKey, logId) + + service := TrocketService{client: meta.(*TencentCloudClient).apiV3Conn} + + idSplit := strings.Split(d.Id(), FILED_SP) + if len(idSplit) != 2 { + return fmt.Errorf("id is broken,%s", d.Id()) + } + instanceId := idSplit[0] + topic := idSplit[1] + + rocketmqTopic, err := service.DescribeTrocketRocketmqTopicById(ctx, instanceId, topic) + if err != nil { + return err + } + + if rocketmqTopic == nil { + d.SetId("") + log.Printf("[WARN]%s resource `TrocketRocketmqTopic` [%s] not found, please check if it has been deleted.\n", logId, d.Id()) + return nil + } + + if rocketmqTopic.InstanceId != nil { + _ = d.Set("instance_id", rocketmqTopic.InstanceId) + } + + if rocketmqTopic.Topic != nil { + _ = d.Set("topic", rocketmqTopic.Topic) + } + + if rocketmqTopic.TopicType != nil { + _ = d.Set("topic_type", rocketmqTopic.TopicType) + } + + if rocketmqTopic.QueueNum != nil { + _ = d.Set("queue_num", rocketmqTopic.QueueNum) + } + + if rocketmqTopic.Remark != nil { + _ = d.Set("remark", rocketmqTopic.Remark) + } + + return nil +} + +func resourceTencentCloudTrocketRocketmqTopicUpdate(d *schema.ResourceData, meta interface{}) error { + defer logElapsed("resource.tencentcloud_trocket_rocketmq_topic.update")() + defer inconsistentCheck(d, meta)() + + logId := getLogId(contextNil) + + request := trocket.NewModifyTopicRequest() + + idSplit := strings.Split(d.Id(), FILED_SP) + if len(idSplit) != 2 { + return fmt.Errorf("id is broken,%s", d.Id()) + } + instanceId := idSplit[0] + topic := idSplit[1] + + request.InstanceId = &instanceId + request.Topic = &topic + + if d.HasChange("queue_num") { + if v, ok := d.GetOkExists("queue_num"); ok { + request.QueueNum = helper.IntInt64(v.(int)) + } + } + + if d.HasChange("remark") { + if v, ok := d.GetOk("remark"); ok { + request.Remark = helper.String(v.(string)) + } + } + + err := resource.Retry(writeRetryTimeout, func() *resource.RetryError { + result, e := meta.(*TencentCloudClient).apiV3Conn.UseTrocketClient().ModifyTopic(request) + if e != nil { + return retryError(e) + } else { + log.Printf("[DEBUG]%s api[%s] success, request body [%s], response body [%s]\n", logId, request.GetAction(), request.ToJsonString(), result.ToJsonString()) + } + return nil + }) + if err != nil { + log.Printf("[CRITAL]%s update trocket rocketmqTopic failed, reason:%+v", logId, err) + return err + } + + return resourceTencentCloudTrocketRocketmqTopicRead(d, meta) +} + +func resourceTencentCloudTrocketRocketmqTopicDelete(d *schema.ResourceData, meta interface{}) error { + defer logElapsed("resource.tencentcloud_trocket_rocketmq_topic.delete")() + defer inconsistentCheck(d, meta)() + + logId := getLogId(contextNil) + ctx := context.WithValue(context.TODO(), logIdKey, logId) + + service := TrocketService{client: meta.(*TencentCloudClient).apiV3Conn} + idSplit := strings.Split(d.Id(), FILED_SP) + if len(idSplit) != 2 { + return fmt.Errorf("id is broken,%s", d.Id()) + } + instanceId := idSplit[0] + topic := idSplit[1] + + if err := service.DeleteTrocketRocketmqTopicById(ctx, instanceId, topic); err != nil { + return err + } + + return nil +} diff --git a/tencentcloud/resource_tc_trocket_rocketmq_topic_test.go b/tencentcloud/resource_tc_trocket_rocketmq_topic_test.go new file mode 100644 index 0000000000..ed25a83716 --- /dev/null +++ b/tencentcloud/resource_tc_trocket_rocketmq_topic_test.go @@ -0,0 +1,91 @@ +package tencentcloud + +import ( + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" +) + +func TestAccTencentCloudTrocketRocketmqTopicResource_basic(t *testing.T) { + t.Parallel() + resource.Test(t, resource.TestCase{ + PreCheck: func() { + testAccPreCheck(t) + }, + Providers: testAccProviders, + Steps: []resource.TestStep{ + { + Config: testAccTrocketRocketmqTopic, + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrSet("tencentcloud_trocket_rocketmq_topic.rocketmq_topic", "id"), + resource.TestCheckResourceAttr("tencentcloud_trocket_rocketmq_topic.rocketmq_topic", "topic_type", "NORMAL"), + resource.TestCheckResourceAttr("tencentcloud_trocket_rocketmq_topic.rocketmq_topic", "queue_num", "4"), + resource.TestCheckResourceAttr("tencentcloud_trocket_rocketmq_topic.rocketmq_topic", "remark", "test for terraform"), + ), + }, + { + Config: testAccTrocketRocketmqTopicUpdate, + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrSet("tencentcloud_trocket_rocketmq_topic.rocketmq_topic", "id"), + resource.TestCheckResourceAttr("tencentcloud_trocket_rocketmq_topic.rocketmq_topic", "topic_type", "NORMAL"), + resource.TestCheckResourceAttr("tencentcloud_trocket_rocketmq_topic.rocketmq_topic", "queue_num", "5"), + resource.TestCheckResourceAttr("tencentcloud_trocket_rocketmq_topic.rocketmq_topic", "remark", "test terraform"), + )}, + { + ResourceName: "tencentcloud_trocket_rocketmq_topic.rocketmq_topic", + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + +const testAccTrocketRocketmqTopic = ` + +resource "tencentcloud_trocket_rocketmq_instance" "rocketmq_instance" { + instance_type = "EXPERIMENT" + name = "test_topic" + sku_code = "experiment_500" + remark = "test" + vpc_id = "vpc-3a9fo1k9" + subnet_id = "subnet-8nby1yxg" + tags = { + tag_key = "rocketmq" + tag_value = "5.x" + } +} + +resource "tencentcloud_trocket_rocketmq_topic" "rocketmq_topic" { + instance_id = tencentcloud_trocket_rocketmq_instance.rocketmq_instance.id + topic = "test_topic" + topic_type = "NORMAL" + queue_num = 4 + remark = "test for terraform" +} + +` + +const testAccTrocketRocketmqTopicUpdate = ` + +resource "tencentcloud_trocket_rocketmq_instance" "rocketmq_instance" { + instance_type = "EXPERIMENT" + name = "test_topic" + sku_code = "experiment_500" + remark = "test" + vpc_id = "vpc-3a9fo1k9" + subnet_id = "subnet-8nby1yxg" + tags = { + tag_key = "rocketmq" + tag_value = "5.x" + } +} + +resource "tencentcloud_trocket_rocketmq_topic" "rocketmq_topic" { + instance_id = tencentcloud_trocket_rocketmq_instance.rocketmq_instance.id + topic = "test_topic" + topic_type = "NORMAL" + queue_num = 5 + remark = "test terraform" +} + +` diff --git a/tencentcloud/service_tencentcloud_trocket.go b/tencentcloud/service_tencentcloud_trocket.go index daef62922c..d643e90108 100644 --- a/tencentcloud/service_tencentcloud_trocket.go +++ b/tencentcloud/service_tencentcloud_trocket.go @@ -77,3 +77,131 @@ func (me *TrocketService) TrocketRocketmqInstanceStateRefreshFunc(instanceId str return object, helper.PString(object.InstanceStatus), nil } } + +func (me *TrocketService) DescribeTrocketRocketmqTopicById(ctx context.Context, instanceId string, topic string) (rocketmqTopic *trocket.TopicItem, errRet error) { + logId := getLogId(ctx) + + request := trocket.NewDescribeTopicListRequest() + request.InstanceId = &instanceId + filter := &trocket.Filter{ + Name: helper.String("Topic"), + Values: []*string{&topic}, + } + request.Filters = []*trocket.Filter{filter} + + 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()) + } + }() + + ratelimit.Check(request.GetAction()) + + var ( + offset int64 = 0 + limit int64 = 100 + ) + instances := make([]*trocket.TopicItem, 0) + for { + request.Offset = &offset + request.Limit = &limit + response, err := me.client.UseTrocketClient().DescribeTopicList(request) + if err != nil { + errRet = err + return + } + log.Printf("[DEBUG]%s api[%s] success, request body [%s], response body [%s]\n", logId, request.GetAction(), request.ToJsonString(), response.ToJsonString()) + + if response == nil || len(response.Response.Data) < 1 { + break + } + instances = append(instances, response.Response.Data...) + if len(response.Response.Data) < int(limit) { + break + } + + offset += limit + } + + if len(instances) < 1 { + return + } + rocketmqTopic = instances[0] + return +} + +func (me *TrocketService) DeleteTrocketRocketmqTopicById(ctx context.Context, instanceId string, topic string) (errRet error) { + logId := getLogId(ctx) + + request := trocket.NewDeleteTopicRequest() + request.InstanceId = &instanceId + request.Topic = &topic + + 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()) + } + }() + + ratelimit.Check(request.GetAction()) + + response, err := me.client.UseTrocketClient().DeleteTopic(request) + if err != nil { + errRet = err + return + } + log.Printf("[DEBUG]%s api[%s] success, request body [%s], response body [%s]\n", logId, request.GetAction(), request.ToJsonString(), response.ToJsonString()) + + return +} + +func (me *TrocketService) DescribeTrocketRocketmqConsumerGroupById(ctx context.Context, instanceId string, consumerGroup string) (rocketmqConsumerGroup *trocket.DescribeConsumerGroupResponseParams, errRet error) { + logId := getLogId(ctx) + + request := trocket.NewDescribeConsumerGroupRequest() + request.InstanceId = &instanceId + request.ConsumerGroup = &consumerGroup + + 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()) + } + }() + + ratelimit.Check(request.GetAction()) + + response, err := me.client.UseTrocketClient().DescribeConsumerGroup(request) + if err != nil { + errRet = err + return + } + log.Printf("[DEBUG]%s api[%s] success, request body [%s], response body [%s]\n", logId, request.GetAction(), request.ToJsonString(), response.ToJsonString()) + + rocketmqConsumerGroup = response.Response + return +} + +func (me *TrocketService) DeleteTrocketRocketmqConsumerGroupById(ctx context.Context, instanceId string, consumerGroup string) (errRet error) { + logId := getLogId(ctx) + + request := trocket.NewDeleteConsumerGroupRequest() + request.InstanceId = &instanceId + request.ConsumerGroup = &consumerGroup + + 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()) + } + }() + + ratelimit.Check(request.GetAction()) + + response, err := me.client.UseTrocketClient().DeleteConsumerGroup(request) + if err != nil { + errRet = err + return + } + log.Printf("[DEBUG]%s api[%s] success, request body [%s], response body [%s]\n", logId, request.GetAction(), request.ToJsonString(), response.ToJsonString()) + + return +} 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 0b380162e2..4701dab5a2 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 @@ -3,7 +3,6 @@ package common import ( "context" "io" - //"log" "math/rand" "net/url" @@ -266,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_1.0.745" + params["RequestClient"] = "SDK_GO_1.0.746" if requestClient != "" { params["RequestClient"] += ": " + requestClient } diff --git a/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/trocket/v20230308/client.go b/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/trocket/v20230308/client.go index cc272b7c5c..d9d3f5fb80 100644 --- a/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/trocket/v20230308/client.go +++ b/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/trocket/v20230308/client.go @@ -45,6 +45,58 @@ func NewClient(credential common.CredentialIface, region string, clientProfile * } +func NewCreateConsumerGroupRequest() (request *CreateConsumerGroupRequest) { + request = &CreateConsumerGroupRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("trocket", APIVersion, "CreateConsumerGroup") + + + return +} + +func NewCreateConsumerGroupResponse() (response *CreateConsumerGroupResponse) { + response = &CreateConsumerGroupResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return +} + +// CreateConsumerGroup +// 创建消费组 +// +// 可能返回的错误码: +// FAILEDOPERATION = "FailedOperation" +// FAILEDOPERATION_INSTANCENOTREADY = "FailedOperation.InstanceNotReady" +// UNSUPPORTEDOPERATION_RESOURCEALREADYEXISTS = "UnsupportedOperation.ResourceAlreadyExists" +func (c *Client) CreateConsumerGroup(request *CreateConsumerGroupRequest) (response *CreateConsumerGroupResponse, err error) { + return c.CreateConsumerGroupWithContext(context.Background(), request) +} + +// CreateConsumerGroup +// 创建消费组 +// +// 可能返回的错误码: +// FAILEDOPERATION = "FailedOperation" +// FAILEDOPERATION_INSTANCENOTREADY = "FailedOperation.InstanceNotReady" +// UNSUPPORTEDOPERATION_RESOURCEALREADYEXISTS = "UnsupportedOperation.ResourceAlreadyExists" +func (c *Client) CreateConsumerGroupWithContext(ctx context.Context, request *CreateConsumerGroupRequest) (response *CreateConsumerGroupResponse, err error) { + if request == nil { + request = NewCreateConsumerGroupRequest() + } + + if c.GetCredential() == nil { + return nil, errors.New("CreateConsumerGroup require credential") + } + + request.SetContext(ctx) + + response = NewCreateConsumerGroupResponse() + err = c.Send(request, response) + return +} + func NewCreateInstanceRequest() (request *CreateInstanceRequest) { request = &CreateInstanceRequest{ BaseRequest: &tchttp.BaseRequest{}, @@ -93,6 +145,114 @@ func (c *Client) CreateInstanceWithContext(ctx context.Context, request *CreateI return } +func NewCreateTopicRequest() (request *CreateTopicRequest) { + request = &CreateTopicRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("trocket", APIVersion, "CreateTopic") + + + return +} + +func NewCreateTopicResponse() (response *CreateTopicResponse) { + response = &CreateTopicResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return +} + +// CreateTopic +// 创建主题 +// +// 可能返回的错误码: +// FAILEDOPERATION = "FailedOperation" +// FAILEDOPERATION_INSTANCENOTREADY = "FailedOperation.InstanceNotReady" +// LIMITEXCEEDED_TOPICNUM = "LimitExceeded.TopicNum" +// OPERATIONDENIED = "OperationDenied" +// RESOURCENOTFOUND_INSTANCE = "ResourceNotFound.Instance" +// UNSUPPORTEDOPERATION_RESOURCEALREADYEXISTS = "UnsupportedOperation.ResourceAlreadyExists" +func (c *Client) CreateTopic(request *CreateTopicRequest) (response *CreateTopicResponse, err error) { + return c.CreateTopicWithContext(context.Background(), request) +} + +// CreateTopic +// 创建主题 +// +// 可能返回的错误码: +// FAILEDOPERATION = "FailedOperation" +// FAILEDOPERATION_INSTANCENOTREADY = "FailedOperation.InstanceNotReady" +// LIMITEXCEEDED_TOPICNUM = "LimitExceeded.TopicNum" +// OPERATIONDENIED = "OperationDenied" +// RESOURCENOTFOUND_INSTANCE = "ResourceNotFound.Instance" +// UNSUPPORTEDOPERATION_RESOURCEALREADYEXISTS = "UnsupportedOperation.ResourceAlreadyExists" +func (c *Client) CreateTopicWithContext(ctx context.Context, request *CreateTopicRequest) (response *CreateTopicResponse, err error) { + if request == nil { + request = NewCreateTopicRequest() + } + + if c.GetCredential() == nil { + return nil, errors.New("CreateTopic require credential") + } + + request.SetContext(ctx) + + response = NewCreateTopicResponse() + err = c.Send(request, response) + return +} + +func NewDeleteConsumerGroupRequest() (request *DeleteConsumerGroupRequest) { + request = &DeleteConsumerGroupRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("trocket", APIVersion, "DeleteConsumerGroup") + + + return +} + +func NewDeleteConsumerGroupResponse() (response *DeleteConsumerGroupResponse) { + response = &DeleteConsumerGroupResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return +} + +// DeleteConsumerGroup +// 删除消费组 +// +// 可能返回的错误码: +// FAILEDOPERATION = "FailedOperation" +// RESOURCENOTFOUND_GROUP = "ResourceNotFound.Group" +func (c *Client) DeleteConsumerGroup(request *DeleteConsumerGroupRequest) (response *DeleteConsumerGroupResponse, err error) { + return c.DeleteConsumerGroupWithContext(context.Background(), request) +} + +// DeleteConsumerGroup +// 删除消费组 +// +// 可能返回的错误码: +// FAILEDOPERATION = "FailedOperation" +// RESOURCENOTFOUND_GROUP = "ResourceNotFound.Group" +func (c *Client) DeleteConsumerGroupWithContext(ctx context.Context, request *DeleteConsumerGroupRequest) (response *DeleteConsumerGroupResponse, err error) { + if request == nil { + request = NewDeleteConsumerGroupRequest() + } + + if c.GetCredential() == nil { + return nil, errors.New("DeleteConsumerGroup require credential") + } + + request.SetContext(ctx) + + response = NewDeleteConsumerGroupResponse() + err = c.Send(request, response) + return +} + func NewDeleteInstanceRequest() (request *DeleteInstanceRequest) { request = &DeleteInstanceRequest{ BaseRequest: &tchttp.BaseRequest{}, @@ -145,6 +305,102 @@ func (c *Client) DeleteInstanceWithContext(ctx context.Context, request *DeleteI return } +func NewDeleteTopicRequest() (request *DeleteTopicRequest) { + request = &DeleteTopicRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("trocket", APIVersion, "DeleteTopic") + + + return +} + +func NewDeleteTopicResponse() (response *DeleteTopicResponse) { + response = &DeleteTopicResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return +} + +// DeleteTopic +// 删除主题 +// +// 可能返回的错误码: +// FAILEDOPERATION = "FailedOperation" +func (c *Client) DeleteTopic(request *DeleteTopicRequest) (response *DeleteTopicResponse, err error) { + return c.DeleteTopicWithContext(context.Background(), request) +} + +// DeleteTopic +// 删除主题 +// +// 可能返回的错误码: +// FAILEDOPERATION = "FailedOperation" +func (c *Client) DeleteTopicWithContext(ctx context.Context, request *DeleteTopicRequest) (response *DeleteTopicResponse, err error) { + if request == nil { + request = NewDeleteTopicRequest() + } + + if c.GetCredential() == nil { + return nil, errors.New("DeleteTopic require credential") + } + + request.SetContext(ctx) + + response = NewDeleteTopicResponse() + err = c.Send(request, response) + return +} + +func NewDescribeConsumerGroupRequest() (request *DescribeConsumerGroupRequest) { + request = &DescribeConsumerGroupRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("trocket", APIVersion, "DescribeConsumerGroup") + + + return +} + +func NewDescribeConsumerGroupResponse() (response *DescribeConsumerGroupResponse) { + response = &DescribeConsumerGroupResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return +} + +// DescribeConsumerGroup +// 查询消费组详情 +// +// 可能返回的错误码: +// RESOURCENOTFOUND_GROUP = "ResourceNotFound.Group" +func (c *Client) DescribeConsumerGroup(request *DescribeConsumerGroupRequest) (response *DescribeConsumerGroupResponse, err error) { + return c.DescribeConsumerGroupWithContext(context.Background(), request) +} + +// DescribeConsumerGroup +// 查询消费组详情 +// +// 可能返回的错误码: +// RESOURCENOTFOUND_GROUP = "ResourceNotFound.Group" +func (c *Client) DescribeConsumerGroupWithContext(ctx context.Context, request *DescribeConsumerGroupRequest) (response *DescribeConsumerGroupResponse, err error) { + if request == nil { + request = NewDescribeConsumerGroupRequest() + } + + if c.GetCredential() == nil { + return nil, errors.New("DescribeConsumerGroup require credential") + } + + request.SetContext(ctx) + + response = NewDescribeConsumerGroupResponse() + err = c.Send(request, response) + return +} + func NewDescribeInstanceRequest() (request *DescribeInstanceRequest) { request = &DescribeInstanceRequest{ BaseRequest: &tchttp.BaseRequest{}, @@ -265,6 +521,64 @@ func (c *Client) DescribeInstanceListWithContext(ctx context.Context, request *D return } +func NewDescribeTopicRequest() (request *DescribeTopicRequest) { + request = &DescribeTopicRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("trocket", APIVersion, "DescribeTopic") + + + return +} + +func NewDescribeTopicResponse() (response *DescribeTopicResponse) { + response = &DescribeTopicResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return +} + +// DescribeTopic +// 查询主题详情,Offset和Limit参数是指订阅该主题的消费组查询分页参数,Filter参数使用说明如下: +// +// +// +// ConsumerGroup,消费组名称过滤 +// +// 可能返回的错误码: +// RESOURCENOTFOUND_INSTANCE = "ResourceNotFound.Instance" +// RESOURCENOTFOUND_TOPIC = "ResourceNotFound.Topic" +func (c *Client) DescribeTopic(request *DescribeTopicRequest) (response *DescribeTopicResponse, err error) { + return c.DescribeTopicWithContext(context.Background(), request) +} + +// DescribeTopic +// 查询主题详情,Offset和Limit参数是指订阅该主题的消费组查询分页参数,Filter参数使用说明如下: +// +// +// +// ConsumerGroup,消费组名称过滤 +// +// 可能返回的错误码: +// RESOURCENOTFOUND_INSTANCE = "ResourceNotFound.Instance" +// RESOURCENOTFOUND_TOPIC = "ResourceNotFound.Topic" +func (c *Client) DescribeTopicWithContext(ctx context.Context, request *DescribeTopicRequest) (response *DescribeTopicResponse, err error) { + if request == nil { + request = NewDescribeTopicRequest() + } + + if c.GetCredential() == nil { + return nil, errors.New("DescribeTopic require credential") + } + + request.SetContext(ctx) + + response = NewDescribeTopicResponse() + err = c.Send(request, response) + return +} + func NewDescribeTopicListRequest() (request *DescribeTopicListRequest) { request = &DescribeTopicListRequest{ BaseRequest: &tchttp.BaseRequest{}, @@ -325,6 +639,102 @@ func (c *Client) DescribeTopicListWithContext(ctx context.Context, request *Desc return } +func NewDescribeTopicStatsOpRequest() (request *DescribeTopicStatsOpRequest) { + request = &DescribeTopicStatsOpRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("trocket", APIVersion, "DescribeTopicStatsOp") + + + return +} + +func NewDescribeTopicStatsOpResponse() (response *DescribeTopicStatsOpResponse) { + response = &DescribeTopicStatsOpResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return +} + +// DescribeTopicStatsOp +// 运营端查询topicStata +// +// 可能返回的错误码: +// RESOURCENOTFOUND_INSTANCE = "ResourceNotFound.Instance" +func (c *Client) DescribeTopicStatsOp(request *DescribeTopicStatsOpRequest) (response *DescribeTopicStatsOpResponse, err error) { + return c.DescribeTopicStatsOpWithContext(context.Background(), request) +} + +// DescribeTopicStatsOp +// 运营端查询topicStata +// +// 可能返回的错误码: +// RESOURCENOTFOUND_INSTANCE = "ResourceNotFound.Instance" +func (c *Client) DescribeTopicStatsOpWithContext(ctx context.Context, request *DescribeTopicStatsOpRequest) (response *DescribeTopicStatsOpResponse, err error) { + if request == nil { + request = NewDescribeTopicStatsOpRequest() + } + + if c.GetCredential() == nil { + return nil, errors.New("DescribeTopicStatsOp require credential") + } + + request.SetContext(ctx) + + response = NewDescribeTopicStatsOpResponse() + err = c.Send(request, response) + return +} + +func NewModifyConsumerGroupRequest() (request *ModifyConsumerGroupRequest) { + request = &ModifyConsumerGroupRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("trocket", APIVersion, "ModifyConsumerGroup") + + + return +} + +func NewModifyConsumerGroupResponse() (response *ModifyConsumerGroupResponse) { + response = &ModifyConsumerGroupResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return +} + +// ModifyConsumerGroup +// 修改消费组属性 +// +// 可能返回的错误码: +// RESOURCENOTFOUND_INSTANCE = "ResourceNotFound.Instance" +func (c *Client) ModifyConsumerGroup(request *ModifyConsumerGroupRequest) (response *ModifyConsumerGroupResponse, err error) { + return c.ModifyConsumerGroupWithContext(context.Background(), request) +} + +// ModifyConsumerGroup +// 修改消费组属性 +// +// 可能返回的错误码: +// RESOURCENOTFOUND_INSTANCE = "ResourceNotFound.Instance" +func (c *Client) ModifyConsumerGroupWithContext(ctx context.Context, request *ModifyConsumerGroupRequest) (response *ModifyConsumerGroupResponse, err error) { + if request == nil { + request = NewModifyConsumerGroupRequest() + } + + if c.GetCredential() == nil { + return nil, errors.New("ModifyConsumerGroup require credential") + } + + request.SetContext(ctx) + + response = NewModifyConsumerGroupResponse() + err = c.Send(request, response) + return +} + func NewModifyInstanceRequest() (request *ModifyInstanceRequest) { request = &ModifyInstanceRequest{ BaseRequest: &tchttp.BaseRequest{}, @@ -376,3 +786,51 @@ func (c *Client) ModifyInstanceWithContext(ctx context.Context, request *ModifyI err = c.Send(request, response) return } + +func NewModifyTopicRequest() (request *ModifyTopicRequest) { + request = &ModifyTopicRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("trocket", APIVersion, "ModifyTopic") + + + return +} + +func NewModifyTopicResponse() (response *ModifyTopicResponse) { + response = &ModifyTopicResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return +} + +// ModifyTopic +// 修改主题属性 +// +// 可能返回的错误码: +// FAILEDOPERATION = "FailedOperation" +func (c *Client) ModifyTopic(request *ModifyTopicRequest) (response *ModifyTopicResponse, err error) { + return c.ModifyTopicWithContext(context.Background(), request) +} + +// ModifyTopic +// 修改主题属性 +// +// 可能返回的错误码: +// FAILEDOPERATION = "FailedOperation" +func (c *Client) ModifyTopicWithContext(ctx context.Context, request *ModifyTopicRequest) (response *ModifyTopicResponse, err error) { + if request == nil { + request = NewModifyTopicRequest() + } + + if c.GetCredential() == nil { + return nil, errors.New("ModifyTopic require credential") + } + + request.SetContext(ctx) + + response = NewModifyTopicResponse() + err = c.Send(request, response) + return +} diff --git a/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/trocket/v20230308/errors.go b/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/trocket/v20230308/errors.go index e1ac56f6a6..98d0ec4105 100644 --- a/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/trocket/v20230308/errors.go +++ b/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/trocket/v20230308/errors.go @@ -23,12 +23,27 @@ const ( // 实例未就绪,请稍后重试。 FAILEDOPERATION_INSTANCENOTREADY = "FailedOperation.InstanceNotReady" + // 已达到主题数上限。 + LIMITEXCEEDED_TOPICNUM = "LimitExceeded.TopicNum" + + // 操作被拒绝。 + OPERATIONDENIED = "OperationDenied" + // 资源被占用。 RESOURCEINUSE = "ResourceInUse" + // 消费组不存在,请检查后重试。 + RESOURCENOTFOUND_GROUP = "ResourceNotFound.Group" + // 实例不存在。 RESOURCENOTFOUND_INSTANCE = "ResourceNotFound.Instance" + // 主题不存在,请检查后重试。 + RESOURCENOTFOUND_TOPIC = "ResourceNotFound.Topic" + // 资源不可用。 RESOURCEUNAVAILABLE = "ResourceUnavailable" + + // 资源已存在,请检查后重试。 + UNSUPPORTEDOPERATION_RESOURCEALREADYEXISTS = "UnsupportedOperation.ResourceAlreadyExists" ) diff --git a/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/trocket/v20230308/models.go b/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/trocket/v20230308/models.go index 8cbfe81dfb..26f36c2802 100644 --- a/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/trocket/v20230308/models.go +++ b/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/trocket/v20230308/models.go @@ -20,6 +20,103 @@ import ( "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/json" ) +// Predefined struct for user +type CreateConsumerGroupRequestParams struct { + // 实例ID + InstanceId *string `json:"InstanceId,omitnil" name:"InstanceId"` + + // 消费组名称 + ConsumerGroup *string `json:"ConsumerGroup,omitnil" name:"ConsumerGroup"` + + // 最大重试次数 + MaxRetryTimes *int64 `json:"MaxRetryTimes,omitnil" name:"MaxRetryTimes"` + + // 是否开启消费 + ConsumeEnable *bool `json:"ConsumeEnable,omitnil" name:"ConsumeEnable"` + + // 顺序投递:true + // 并发投递:false + ConsumeMessageOrderly *bool `json:"ConsumeMessageOrderly,omitnil" name:"ConsumeMessageOrderly"` + + // 备注 + Remark *string `json:"Remark,omitnil" name:"Remark"` +} + +type CreateConsumerGroupRequest struct { + *tchttp.BaseRequest + + // 实例ID + InstanceId *string `json:"InstanceId,omitnil" name:"InstanceId"` + + // 消费组名称 + ConsumerGroup *string `json:"ConsumerGroup,omitnil" name:"ConsumerGroup"` + + // 最大重试次数 + MaxRetryTimes *int64 `json:"MaxRetryTimes,omitnil" name:"MaxRetryTimes"` + + // 是否开启消费 + ConsumeEnable *bool `json:"ConsumeEnable,omitnil" name:"ConsumeEnable"` + + // 顺序投递:true + // 并发投递:false + ConsumeMessageOrderly *bool `json:"ConsumeMessageOrderly,omitnil" name:"ConsumeMessageOrderly"` + + // 备注 + Remark *string `json:"Remark,omitnil" name:"Remark"` +} + +func (r *CreateConsumerGroupRequest) 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 *CreateConsumerGroupRequest) 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, "ConsumerGroup") + delete(f, "MaxRetryTimes") + delete(f, "ConsumeEnable") + delete(f, "ConsumeMessageOrderly") + delete(f, "Remark") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "CreateConsumerGroupRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type CreateConsumerGroupResponseParams struct { + // 实例ID + InstanceId *string `json:"InstanceId,omitnil" name:"InstanceId"` + + // 消费组 + ConsumerGroup *string `json:"ConsumerGroup,omitnil" name:"ConsumerGroup"` + + // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil" name:"RequestId"` +} + +type CreateConsumerGroupResponse struct { + *tchttp.BaseResponse + Response *CreateConsumerGroupResponseParams `json:"Response"` +} + +func (r *CreateConsumerGroupResponse) 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 *CreateConsumerGroupResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + // Predefined struct for user type CreateInstanceRequestParams struct { // 实例类型, @@ -158,6 +255,165 @@ func (r *CreateInstanceResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } +// Predefined struct for user +type CreateTopicRequestParams struct { + // 实例ID + InstanceId *string `json:"InstanceId,omitnil" name:"InstanceId"` + + // 主题 + Topic *string `json:"Topic,omitnil" name:"Topic"` + + // 主题类型 + // UNSPECIFIED:未指定, + // NORMAL:普通消息, + // FIFO:顺序消息, + // DELAY:延时消息, + // TRANSACTION:事务消息 + TopicType *string `json:"TopicType,omitnil" name:"TopicType"` + + // 队列数量 + QueueNum *int64 `json:"QueueNum,omitnil" name:"QueueNum"` + + // 备注 + Remark *string `json:"Remark,omitnil" name:"Remark"` +} + +type CreateTopicRequest struct { + *tchttp.BaseRequest + + // 实例ID + InstanceId *string `json:"InstanceId,omitnil" name:"InstanceId"` + + // 主题 + Topic *string `json:"Topic,omitnil" name:"Topic"` + + // 主题类型 + // UNSPECIFIED:未指定, + // NORMAL:普通消息, + // FIFO:顺序消息, + // DELAY:延时消息, + // TRANSACTION:事务消息 + TopicType *string `json:"TopicType,omitnil" name:"TopicType"` + + // 队列数量 + QueueNum *int64 `json:"QueueNum,omitnil" name:"QueueNum"` + + // 备注 + Remark *string `json:"Remark,omitnil" name:"Remark"` +} + +func (r *CreateTopicRequest) 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 *CreateTopicRequest) 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, "Topic") + delete(f, "TopicType") + delete(f, "QueueNum") + delete(f, "Remark") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "CreateTopicRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type CreateTopicResponseParams struct { + // 实例ID + InstanceId *string `json:"InstanceId,omitnil" name:"InstanceId"` + + // 主题 + Topic *string `json:"Topic,omitnil" name:"Topic"` + + // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil" name:"RequestId"` +} + +type CreateTopicResponse struct { + *tchttp.BaseResponse + Response *CreateTopicResponseParams `json:"Response"` +} + +func (r *CreateTopicResponse) 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 *CreateTopicResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DeleteConsumerGroupRequestParams struct { + // 实例ID + InstanceId *string `json:"InstanceId,omitnil" name:"InstanceId"` + + // 消费组名称 + ConsumerGroup *string `json:"ConsumerGroup,omitnil" name:"ConsumerGroup"` +} + +type DeleteConsumerGroupRequest struct { + *tchttp.BaseRequest + + // 实例ID + InstanceId *string `json:"InstanceId,omitnil" name:"InstanceId"` + + // 消费组名称 + ConsumerGroup *string `json:"ConsumerGroup,omitnil" name:"ConsumerGroup"` +} + +func (r *DeleteConsumerGroupRequest) 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 *DeleteConsumerGroupRequest) 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, "ConsumerGroup") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DeleteConsumerGroupRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DeleteConsumerGroupResponseParams struct { + // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil" name:"RequestId"` +} + +type DeleteConsumerGroupResponse struct { + *tchttp.BaseResponse + Response *DeleteConsumerGroupResponseParams `json:"Response"` +} + +func (r *DeleteConsumerGroupResponse) 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 *DeleteConsumerGroupResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + // Predefined struct for user type DeleteInstanceRequestParams struct { // 实例ID @@ -212,6 +468,156 @@ func (r *DeleteInstanceResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } +// Predefined struct for user +type DeleteTopicRequestParams struct { + // 实例ID + InstanceId *string `json:"InstanceId,omitnil" name:"InstanceId"` + + // 主题 + Topic *string `json:"Topic,omitnil" name:"Topic"` +} + +type DeleteTopicRequest struct { + *tchttp.BaseRequest + + // 实例ID + InstanceId *string `json:"InstanceId,omitnil" name:"InstanceId"` + + // 主题 + Topic *string `json:"Topic,omitnil" name:"Topic"` +} + +func (r *DeleteTopicRequest) 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 *DeleteTopicRequest) 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, "Topic") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DeleteTopicRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DeleteTopicResponseParams struct { + // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil" name:"RequestId"` +} + +type DeleteTopicResponse struct { + *tchttp.BaseResponse + Response *DeleteTopicResponseParams `json:"Response"` +} + +func (r *DeleteTopicResponse) 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 *DeleteTopicResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DescribeConsumerGroupRequestParams struct { + // 实例ID + InstanceId *string `json:"InstanceId,omitnil" name:"InstanceId"` + + // 消费组名称 + ConsumerGroup *string `json:"ConsumerGroup,omitnil" name:"ConsumerGroup"` +} + +type DescribeConsumerGroupRequest struct { + *tchttp.BaseRequest + + // 实例ID + InstanceId *string `json:"InstanceId,omitnil" name:"InstanceId"` + + // 消费组名称 + ConsumerGroup *string `json:"ConsumerGroup,omitnil" name:"ConsumerGroup"` +} + +func (r *DescribeConsumerGroupRequest) 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 *DescribeConsumerGroupRequest) 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, "ConsumerGroup") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeConsumerGroupRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DescribeConsumerGroupResponseParams struct { + // 在线消费者数量 + ConsumerNum *int64 `json:"ConsumerNum,omitnil" name:"ConsumerNum"` + + // TPS + Tps *int64 `json:"Tps,omitnil" name:"Tps"` + + // 消息堆积数量 + ConsumerLag *int64 `json:"ConsumerLag,omitnil" name:"ConsumerLag"` + + // 消费者类型 + ConsumeType *string `json:"ConsumeType,omitnil" name:"ConsumeType"` + + // 创建时间,秒为单位 + CreatedTime *int64 `json:"CreatedTime,omitnil" name:"CreatedTime"` + + // 顺序投递:true + // 并发投递:false + ConsumeMessageOrderly *bool `json:"ConsumeMessageOrderly,omitnil" name:"ConsumeMessageOrderly"` + + // 是否开启消费 + ConsumeEnable *bool `json:"ConsumeEnable,omitnil" name:"ConsumeEnable"` + + // 最大重试次数 + MaxRetryTimes *int64 `json:"MaxRetryTimes,omitnil" name:"MaxRetryTimes"` + + // 备注 + Remark *string `json:"Remark,omitnil" name:"Remark"` + + // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil" name:"RequestId"` +} + +type DescribeConsumerGroupResponse struct { + *tchttp.BaseResponse + Response *DescribeConsumerGroupResponseParams `json:"Response"` +} + +func (r *DescribeConsumerGroupResponse) 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 *DescribeConsumerGroupResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + // Predefined struct for user type DescribeInstanceListRequestParams struct { // 查询起始位置 @@ -398,37 +804,122 @@ type DescribeInstanceResponseParams struct { // 实例状态 InstanceStatus *string `json:"InstanceStatus,omitnil" name:"InstanceStatus"` - // 实例规格 - SkuCode *string `json:"SkuCode,omitnil" name:"SkuCode"` + // 实例规格 + SkuCode *string `json:"SkuCode,omitnil" name:"SkuCode"` + + // 计费模式 + PayMode *string `json:"PayMode,omitnil" name:"PayMode"` + + // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil" name:"RequestId"` +} + +type DescribeInstanceResponse struct { + *tchttp.BaseResponse + Response *DescribeInstanceResponseParams `json:"Response"` +} + +func (r *DescribeInstanceResponse) 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 *DescribeInstanceResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DescribeTopicListRequestParams struct { + // 实例ID + InstanceId *string `json:"InstanceId,omitnil" name:"InstanceId"` + + // 查询起始位置 + Offset *int64 `json:"Offset,omitnil" name:"Offset"` + + // 查询结果限制数量 + Limit *int64 `json:"Limit,omitnil" name:"Limit"` + + // 查询条件列表 + Filters []*Filter `json:"Filters,omitnil" name:"Filters"` +} + +type DescribeTopicListRequest struct { + *tchttp.BaseRequest + + // 实例ID + InstanceId *string `json:"InstanceId,omitnil" name:"InstanceId"` + + // 查询起始位置 + Offset *int64 `json:"Offset,omitnil" name:"Offset"` + + // 查询结果限制数量 + Limit *int64 `json:"Limit,omitnil" name:"Limit"` + + // 查询条件列表 + Filters []*Filter `json:"Filters,omitnil" name:"Filters"` +} + +func (r *DescribeTopicListRequest) 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 *DescribeTopicListRequest) 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, "Offset") + delete(f, "Limit") + delete(f, "Filters") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeTopicListRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DescribeTopicListResponseParams struct { + // 查询总数 + // 注意:此字段可能返回 null,表示取不到有效值。 + TotalCount *int64 `json:"TotalCount,omitnil" name:"TotalCount"` - // 计费模式 - PayMode *string `json:"PayMode,omitnil" name:"PayMode"` + // 主题列表 + Data []*TopicItem `json:"Data,omitnil" name:"Data"` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitnil" name:"RequestId"` } -type DescribeInstanceResponse struct { +type DescribeTopicListResponse struct { *tchttp.BaseResponse - Response *DescribeInstanceResponseParams `json:"Response"` + Response *DescribeTopicListResponseParams `json:"Response"` } -func (r *DescribeInstanceResponse) ToJsonString() string { +func (r *DescribeTopicListResponse) 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 *DescribeInstanceResponse) FromJsonString(s string) error { +func (r *DescribeTopicListResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } // Predefined struct for user -type DescribeTopicListRequestParams struct { +type DescribeTopicRequestParams struct { // 实例ID InstanceId *string `json:"InstanceId,omitnil" name:"InstanceId"` + // 主题 + Topic *string `json:"Topic,omitnil" name:"Topic"` + // 查询起始位置 Offset *int64 `json:"Offset,omitnil" name:"Offset"` @@ -439,12 +930,15 @@ type DescribeTopicListRequestParams struct { Filters []*Filter `json:"Filters,omitnil" name:"Filters"` } -type DescribeTopicListRequest struct { +type DescribeTopicRequest struct { *tchttp.BaseRequest // 实例ID InstanceId *string `json:"InstanceId,omitnil" name:"InstanceId"` + // 主题 + Topic *string `json:"Topic,omitnil" name:"Topic"` + // 查询起始位置 Offset *int64 `json:"Offset,omitnil" name:"Offset"` @@ -455,54 +949,131 @@ type DescribeTopicListRequest struct { Filters []*Filter `json:"Filters,omitnil" name:"Filters"` } -func (r *DescribeTopicListRequest) ToJsonString() string { +func (r *DescribeTopicRequest) 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 *DescribeTopicListRequest) FromJsonString(s string) error { +func (r *DescribeTopicRequest) 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, "Topic") delete(f, "Offset") delete(f, "Limit") delete(f, "Filters") if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeTopicListRequest has unknown keys!", "") + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeTopicRequest has unknown keys!", "") } return json.Unmarshal([]byte(s), &r) } // Predefined struct for user -type DescribeTopicListResponseParams struct { - // 查询总数 - // 注意:此字段可能返回 null,表示取不到有效值。 - TotalCount *int64 `json:"TotalCount,omitnil" name:"TotalCount"` +type DescribeTopicResponseParams struct { + // 实例ID + InstanceId *string `json:"InstanceId,omitnil" name:"InstanceId"` - // 主题列表 - Data []*TopicItem `json:"Data,omitnil" name:"Data"` + // 主题名称 + Topic *string `json:"Topic,omitnil" name:"Topic"` + + // 主题类型 + // UNSPECIFIED:未指定, + // NORMAL:普通消息, + // FIFO:顺序消息, + // DELAY:延时消息, + // TRANSACTION:事务消息 + TopicType *string `json:"TopicType,omitnil" name:"TopicType"` + + // 备注 + Remark *string `json:"Remark,omitnil" name:"Remark"` + + // 创建时间,秒为单位 + CreatedTime *int64 `json:"CreatedTime,omitnil" name:"CreatedTime"` + + // 最后写入时间,秒为单位 + LastUpdateTime *int64 `json:"LastUpdateTime,omitnil" name:"LastUpdateTime"` + + // 订阅数量 + SubscriptionCount *int64 `json:"SubscriptionCount,omitnil" name:"SubscriptionCount"` + + // 订阅关系列表 + SubscriptionData []*SubscriptionData `json:"SubscriptionData,omitnil" name:"SubscriptionData"` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitnil" name:"RequestId"` } -type DescribeTopicListResponse struct { +type DescribeTopicResponse struct { *tchttp.BaseResponse - Response *DescribeTopicListResponseParams `json:"Response"` + Response *DescribeTopicResponseParams `json:"Response"` } -func (r *DescribeTopicListResponse) ToJsonString() string { +func (r *DescribeTopicResponse) 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 *DescribeTopicListResponse) FromJsonString(s string) error { +func (r *DescribeTopicResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DescribeTopicStatsOpRequestParams struct { + // 主题 + Topic *string `json:"Topic,omitnil" name:"Topic"` +} + +type DescribeTopicStatsOpRequest struct { + *tchttp.BaseRequest + + // 主题 + Topic *string `json:"Topic,omitnil" name:"Topic"` +} + +func (r *DescribeTopicStatsOpRequest) 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 *DescribeTopicStatsOpRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "Topic") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeTopicStatsOpRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DescribeTopicStatsOpResponseParams struct { + // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil" name:"RequestId"` +} + +type DescribeTopicStatsOpResponse struct { + *tchttp.BaseResponse + Response *DescribeTopicStatsOpResponseParams `json:"Response"` +} + +func (r *DescribeTopicStatsOpResponse) 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 *DescribeTopicStatsOpResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } @@ -644,6 +1215,97 @@ type IpRule struct { Remark *string `json:"Remark,omitnil" name:"Remark"` } +// Predefined struct for user +type ModifyConsumerGroupRequestParams struct { + // 实例ID + InstanceId *string `json:"InstanceId,omitnil" name:"InstanceId"` + + // 消费组名称 + ConsumerGroup *string `json:"ConsumerGroup,omitnil" name:"ConsumerGroup"` + + // 是否开启消费 + ConsumeEnable *bool `json:"ConsumeEnable,omitnil" name:"ConsumeEnable"` + + // 顺序投递:true + // 并发投递:false + ConsumeMessageOrderly *bool `json:"ConsumeMessageOrderly,omitnil" name:"ConsumeMessageOrderly"` + + // 最大重试次数 + MaxRetryTimes *int64 `json:"MaxRetryTimes,omitnil" name:"MaxRetryTimes"` + + // 备注 + Remark *string `json:"Remark,omitnil" name:"Remark"` +} + +type ModifyConsumerGroupRequest struct { + *tchttp.BaseRequest + + // 实例ID + InstanceId *string `json:"InstanceId,omitnil" name:"InstanceId"` + + // 消费组名称 + ConsumerGroup *string `json:"ConsumerGroup,omitnil" name:"ConsumerGroup"` + + // 是否开启消费 + ConsumeEnable *bool `json:"ConsumeEnable,omitnil" name:"ConsumeEnable"` + + // 顺序投递:true + // 并发投递:false + ConsumeMessageOrderly *bool `json:"ConsumeMessageOrderly,omitnil" name:"ConsumeMessageOrderly"` + + // 最大重试次数 + MaxRetryTimes *int64 `json:"MaxRetryTimes,omitnil" name:"MaxRetryTimes"` + + // 备注 + Remark *string `json:"Remark,omitnil" name:"Remark"` +} + +func (r *ModifyConsumerGroupRequest) 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 *ModifyConsumerGroupRequest) 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, "ConsumerGroup") + delete(f, "ConsumeEnable") + delete(f, "ConsumeMessageOrderly") + delete(f, "MaxRetryTimes") + delete(f, "Remark") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ModifyConsumerGroupRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type ModifyConsumerGroupResponseParams struct { + // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil" name:"RequestId"` +} + +type ModifyConsumerGroupResponse struct { + *tchttp.BaseResponse + Response *ModifyConsumerGroupResponseParams `json:"Response"` +} + +func (r *ModifyConsumerGroupResponse) 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 *ModifyConsumerGroupResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + // Predefined struct for user type ModifyInstanceRequestParams struct { // 实例ID @@ -740,6 +1402,139 @@ func (r *ModifyInstanceResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } +// Predefined struct for user +type ModifyTopicRequestParams struct { + // 实例ID + InstanceId *string `json:"InstanceId,omitnil" name:"InstanceId"` + + // 主题 + Topic *string `json:"Topic,omitnil" name:"Topic"` + + // 队列数量 + QueueNum *int64 `json:"QueueNum,omitnil" name:"QueueNum"` + + // 备注信息 + Remark *string `json:"Remark,omitnil" name:"Remark"` +} + +type ModifyTopicRequest struct { + *tchttp.BaseRequest + + // 实例ID + InstanceId *string `json:"InstanceId,omitnil" name:"InstanceId"` + + // 主题 + Topic *string `json:"Topic,omitnil" name:"Topic"` + + // 队列数量 + QueueNum *int64 `json:"QueueNum,omitnil" name:"QueueNum"` + + // 备注信息 + Remark *string `json:"Remark,omitnil" name:"Remark"` +} + +func (r *ModifyTopicRequest) 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 *ModifyTopicRequest) 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, "Topic") + delete(f, "QueueNum") + delete(f, "Remark") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ModifyTopicRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type ModifyTopicResponseParams struct { + // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil" name:"RequestId"` +} + +type ModifyTopicResponse struct { + *tchttp.BaseResponse + Response *ModifyTopicResponseParams `json:"Response"` +} + +func (r *ModifyTopicResponse) 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 *ModifyTopicResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +type SubscriptionData struct { + // 实例ID + // 注意:此字段可能返回 null,表示取不到有效值。 + InstanceId *string `json:"InstanceId,omitnil" name:"InstanceId"` + + // 主题名称 + // 注意:此字段可能返回 null,表示取不到有效值。 + Topic *string `json:"Topic,omitnil" name:"Topic"` + + // 主题类型 + // 注意:此字段可能返回 null,表示取不到有效值。 + TopicType *string `json:"TopicType,omitnil" name:"TopicType"` + + // 单个节点上主题队列数 + // 注意:此字段可能返回 null,表示取不到有效值。 + TopicQueueNum *int64 `json:"TopicQueueNum,omitnil" name:"TopicQueueNum"` + + // 消费组名称 + // 注意:此字段可能返回 null,表示取不到有效值。 + ConsumerGroup *string `json:"ConsumerGroup,omitnil" name:"ConsumerGroup"` + + // 是否在线 + // 注意:此字段可能返回 null,表示取不到有效值。 + IsOnline *bool `json:"IsOnline,omitnil" name:"IsOnline"` + + // 消费类型 + // 注意:此字段可能返回 null,表示取不到有效值。 + ConsumeType *string `json:"ConsumeType,omitnil" name:"ConsumeType"` + + // 订阅规则 + // 注意:此字段可能返回 null,表示取不到有效值。 + SubString *string `json:"SubString,omitnil" name:"SubString"` + + // 过滤类型 + // 注意:此字段可能返回 null,表示取不到有效值。 + ExpressionType *string `json:"ExpressionType,omitnil" name:"ExpressionType"` + + // 订阅一致性 + // 注意:此字段可能返回 null,表示取不到有效值。 + Consistency *int64 `json:"Consistency,omitnil" name:"Consistency"` + + // 消费堆积 + // 注意:此字段可能返回 null,表示取不到有效值。 + ConsumerLag *int64 `json:"ConsumerLag,omitnil" name:"ConsumerLag"` + + // 最后消费进度更新时间,秒为单位 + // 注意:此字段可能返回 null,表示取不到有效值。 + LastUpdateTime *int64 `json:"LastUpdateTime,omitnil" name:"LastUpdateTime"` + + // 最大重试次数 + // 注意:此字段可能返回 null,表示取不到有效值。 + MaxRetryTimes *int64 `json:"MaxRetryTimes,omitnil" name:"MaxRetryTimes"` + + // 是否顺序消费 + // 注意:此字段可能返回 null,表示取不到有效值。 + ConsumeMessageOrderly *bool `json:"ConsumeMessageOrderly,omitnil" name:"ConsumeMessageOrderly"` +} + type Tag struct { // 标签名称 // 注意:此字段可能返回 null,表示取不到有效值。 diff --git a/vendor/modules.txt b/vendor/modules.txt index 0752bd6012..413cd003ca 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -1094,7 +1094,7 @@ github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cloudaudit/v20190319 # github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cls v1.0.711 ## explicit; go 1.14 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cls/v20201016 -# github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.745 +# github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.746 ## explicit; go 1.14 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/errors @@ -1237,7 +1237,7 @@ github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/teo/v20220901 # github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/tke v1.0.691 ## explicit; go 1.14 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/tke/v20180525 -# github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/trocket v1.0.744 +# github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/trocket v1.0.746 ## explicit; go 1.14 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/trocket/v20230308 # github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/tse v1.0.732 diff --git a/website/docs/r/kubernetes_node_pool.html.markdown b/website/docs/r/kubernetes_node_pool.html.markdown index c9fda32a9d..cd69b620cb 100644 --- a/website/docs/r/kubernetes_node_pool.html.markdown +++ b/website/docs/r/kubernetes_node_pool.html.markdown @@ -210,7 +210,7 @@ The `auto_scaling_config` object supports the following: * `system_disk_size` - (Optional, Int) Volume of system disk in GB. Default is `50`. * `system_disk_type` - (Optional, String) Type of a CVM disk. Valid value: `CLOUD_PREMIUM` and `CLOUD_SSD`. Default is `CLOUD_PREMIUM`. -The `data_disk` object of `node_config` supports the following: +The `data_disk` object supports the following: * `auto_format_and_mount` - (Optional, Bool, ForceNew) Indicate whether to auto format and mount or not. Default is `false`. * `disk_partition` - (Optional, String, ForceNew) The name of the device or partition to mount. NOTE: this argument doesn't support setting in node pool, or will leads to mount error. @@ -219,7 +219,7 @@ The `data_disk` object of `node_config` supports the following: * `file_system` - (Optional, String, ForceNew) File system, e.g. `ext3/ext4/xfs`. * `mount_target` - (Optional, String, ForceNew) Mount target. -The `data_disk` object of `auto_scaling_config` supports the following: +The `data_disk` object supports the following: * `delete_with_instance` - (Optional, Bool) Indicates whether the disk remove after instance terminated. Default is `false`. * `disk_size` - (Optional, Int) Volume of disk in GB. Default is `0`. diff --git a/website/docs/r/kubernetes_scale_worker.html.markdown b/website/docs/r/kubernetes_scale_worker.html.markdown index 7ce75a06f3..93036d4833 100644 --- a/website/docs/r/kubernetes_scale_worker.html.markdown +++ b/website/docs/r/kubernetes_scale_worker.html.markdown @@ -125,7 +125,7 @@ The following arguments are supported: * `mount_target` - (Optional, String, ForceNew) Mount target. Default is not mounting. * `unschedulable` - (Optional, Int, ForceNew) Sets whether the joining node participates in the schedule. Default is '0'. Participate in scheduling. -The `data_disk` object of `worker_config` supports the following: +The `data_disk` object supports the following: * `auto_format_and_mount` - (Optional, Bool, ForceNew) Indicate whether to auto format and mount or not. Default is `false`. * `disk_partition` - (Optional, String, ForceNew) The name of the device or partition to mount. diff --git a/website/docs/r/trocket_rocketmq_consumer_group.html.markdown b/website/docs/r/trocket_rocketmq_consumer_group.html.markdown new file mode 100644 index 0000000000..50f5d9895b --- /dev/null +++ b/website/docs/r/trocket_rocketmq_consumer_group.html.markdown @@ -0,0 +1,66 @@ +--- +subcategory: "TDMQ for RocketMQ(trocket)" +layout: "tencentcloud" +page_title: "TencentCloud: tencentcloud_trocket_rocketmq_consumer_group" +sidebar_current: "docs-tencentcloud-resource-trocket_rocketmq_consumer_group" +description: |- + Provides a resource to create a trocket rocketmq_consumer_group +--- + +# tencentcloud_trocket_rocketmq_consumer_group + +Provides a resource to create a trocket rocketmq_consumer_group + +## Example Usage + +```hcl +resource "tencentcloud_trocket_rocketmq_instance" "rocketmq_instance" { + instance_type = "EXPERIMENT" + name = "test" + sku_code = "experiment_500" + remark = "test" + vpc_id = "vpc-xxxxxx" + subnet_id = "subnet-xxxxx" + tags = { + tag_key = "rocketmq" + tag_value = "5.x" + } +} + +resource "tencentcloud_trocket_rocketmq_consumer_group" "rocketmq_consumer_group" { + instance_id = tencentcloud_trocket_rocketmq_instance.rocketmq_instance.id + consumer_group = "test_consumer_group" + max_retry_times = 20 + consume_enable = false + consume_message_orderly = true + remark = "test for terraform" +} +``` + +## Argument Reference + +The following arguments are supported: + +* `consume_enable` - (Required, Bool) Whether to enable consumption. +* `consume_message_orderly` - (Required, Bool) `true`: Sequential delivery, `false`: Concurrent delivery. +* `consumer_group` - (Required, String) Name of consumer group. +* `instance_id` - (Required, String) Instance ID. +* `max_retry_times` - (Required, Int) Max retry times. +* `remark` - (Optional, String) remark. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `id` - ID of the resource. + + + +## Import + +trocket rocketmq_consumer_group can be imported using the id, e.g. + +``` +terraform import tencentcloud_trocket_rocketmq_consumer_group.rocketmq_consumer_group instanceId#consumerGroup +``` + diff --git a/website/docs/r/trocket_rocketmq_topic.html.markdown b/website/docs/r/trocket_rocketmq_topic.html.markdown new file mode 100644 index 0000000000..c974bc5c26 --- /dev/null +++ b/website/docs/r/trocket_rocketmq_topic.html.markdown @@ -0,0 +1,64 @@ +--- +subcategory: "TDMQ for RocketMQ(trocket)" +layout: "tencentcloud" +page_title: "TencentCloud: tencentcloud_trocket_rocketmq_topic" +sidebar_current: "docs-tencentcloud-resource-trocket_rocketmq_topic" +description: |- + Provides a resource to create a trocket rocketmq_topic +--- + +# tencentcloud_trocket_rocketmq_topic + +Provides a resource to create a trocket rocketmq_topic + +## Example Usage + +```hcl +resource "tencentcloud_trocket_rocketmq_instance" "rocketmq_instance" { + instance_type = "EXPERIMENT" + name = "test" + sku_code = "experiment_500" + remark = "test" + vpc_id = "vpc-xxxxx" + subnet_id = "subnet-xxxxx" + tags = { + tag_key = "rocketmq" + tag_value = "5.x" + } +} + +resource "tencentcloud_trocket_rocketmq_topic" "rocketmq_topic" { + instance_id = tencentcloud_trocket_rocketmq_instance.rocketmq_instance.id + topic = "test_topic" + topic_type = "NORMAL" + queue_num = 4 + remark = "test for terraform" +} +``` + +## Argument Reference + +The following arguments are supported: + +* `instance_id` - (Required, String, ForceNew) Instance Id. +* `queue_num` - (Required, Int) Number of queue. Must be greater than or equal to 3. +* `topic_type` - (Required, String, ForceNew) Topic type. `UNSPECIFIED`: not specified, `NORMAL`: normal message, `FIFO`: sequential message, `DELAY`: delayed message. +* `topic` - (Required, String, ForceNew) topic. +* `remark` - (Optional, String) remark. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `id` - ID of the resource. + + + +## Import + +trocket rocketmq_topic can be imported using the id, e.g. + +``` +terraform import tencentcloud_trocket_rocketmq_topic.rocketmq_topic instanceId#topic +``` + diff --git a/website/tencentcloud.erb b/website/tencentcloud.erb index fa0eca13b1..7b75a8a846 100644 --- a/website/tencentcloud.erb +++ b/website/tencentcloud.erb @@ -2768,9 +2768,15 @@
  • tencentcloud_tdmq_send_rocketmq_message
  • +
  • + tencentcloud_trocket_rocketmq_consumer_group +
  • tencentcloud_trocket_rocketmq_instance
  • +
  • + tencentcloud_trocket_rocketmq_topic +
  • From cc64cd7371eaa7caea494345e3f1727800c38263 Mon Sep 17 00:00:00 2001 From: hellertang Date: Thu, 14 Sep 2023 13:01:12 +0800 Subject: [PATCH 2/3] add changelog --- .changelog/2123.txt | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 .changelog/2123.txt diff --git a/.changelog/2123.txt b/.changelog/2123.txt new file mode 100644 index 0000000000..2f051c0f80 --- /dev/null +++ b/.changelog/2123.txt @@ -0,0 +1,7 @@ +```release-note:new-resource +tencentcloud_trocket_rocketmq_topic +``` + +```release-note:new-resource +tencentcloud_trocket_rocketmq_consumer_group +``` From 1a8e1897f3b9cda1e20063324d33c2a9acaf07f5 Mon Sep 17 00:00:00 2001 From: hellertang Date: Thu, 14 Sep 2023 14:33:50 +0800 Subject: [PATCH 3/3] update --- tencentcloud/resource_tc_trocket_rocketmq_consumer_group.go | 2 ++ website/docs/r/trocket_rocketmq_consumer_group.html.markdown | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/tencentcloud/resource_tc_trocket_rocketmq_consumer_group.go b/tencentcloud/resource_tc_trocket_rocketmq_consumer_group.go index 04c4dbcb52..39b00b4edc 100644 --- a/tencentcloud/resource_tc_trocket_rocketmq_consumer_group.go +++ b/tencentcloud/resource_tc_trocket_rocketmq_consumer_group.go @@ -62,12 +62,14 @@ func resourceTencentCloudTrocketRocketmqConsumerGroup() *schema.Resource { "instance_id": { Required: true, Type: schema.TypeString, + ForceNew: true, Description: "Instance ID.", }, "consumer_group": { Required: true, Type: schema.TypeString, + ForceNew: true, Description: "Name of consumer group.", }, diff --git a/website/docs/r/trocket_rocketmq_consumer_group.html.markdown b/website/docs/r/trocket_rocketmq_consumer_group.html.markdown index 50f5d9895b..f7a98f4676 100644 --- a/website/docs/r/trocket_rocketmq_consumer_group.html.markdown +++ b/website/docs/r/trocket_rocketmq_consumer_group.html.markdown @@ -43,8 +43,8 @@ The following arguments are supported: * `consume_enable` - (Required, Bool) Whether to enable consumption. * `consume_message_orderly` - (Required, Bool) `true`: Sequential delivery, `false`: Concurrent delivery. -* `consumer_group` - (Required, String) Name of consumer group. -* `instance_id` - (Required, String) Instance ID. +* `consumer_group` - (Required, String, ForceNew) Name of consumer group. +* `instance_id` - (Required, String, ForceNew) Instance ID. * `max_retry_times` - (Required, Int) Max retry times. * `remark` - (Optional, String) remark.