diff --git a/.changelog/2737.txt b/.changelog/2737.txt new file mode 100644 index 0000000000..d574420636 --- /dev/null +++ b/.changelog/2737.txt @@ -0,0 +1,19 @@ +```release-note:new-resource +tencentcloud_cdc_site +``` + +```release-note:new-resource +tencentcloud_cdc_dedicated_cluster +``` + +```release-note:new-data-source +tencentcloud_cdc_dedicated_cluster_hosts +``` + +```release-note:new-data-source +tencentcloud_cdc_dedicated_cluster_instance_types +``` + +```release-note:new-data-source +tencentcloud_cdc_dedicated_cluster_orders +``` \ No newline at end of file diff --git a/go.mod b/go.mod index c3aec943c1..f4151f94df 100644 --- a/go.mod +++ b/go.mod @@ -45,8 +45,8 @@ require ( github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/ckafka v1.0.748 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/clb v1.0.961 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cloudaudit v1.0.544 - github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cls v1.0.962 - github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.967 + github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cls v1.0.970 + github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.970 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cvm v1.0.960 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cwp v1.0.762 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cynosdb v1.0.692 @@ -61,7 +61,7 @@ require ( github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/eb v1.0.760 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/emr v1.0.811 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/es v1.0.777 - github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/gaap v1.0.967 + github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/gaap v1.0.970 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/kms v1.0.563 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/lighthouse v1.0.729 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/live v1.0.777 @@ -107,9 +107,10 @@ require ( require ( github.com/hashicorp/go-uuid v1.0.3 + github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cdc v1.0.970 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cdwpg v1.0.772 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/csip v1.0.860 - github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dasb v1.0.964 + github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dasb v1.0.970 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/oceanus v1.0.831 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/region v1.0.920 github.com/wI2L/jsondiff v0.3.0 diff --git a/go.sum b/go.sum index a6a1f077e8..6e2cad99cb 100644 --- a/go.sum +++ b/go.sum @@ -838,6 +838,10 @@ github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cbs v1.0.591 h1:TPGLjH6 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cbs v1.0.591/go.mod h1:nCAGfVTXZkVnurkbjF3b0FM6RwGztE9t8D9Ms1unaKo= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cdb v1.0.800 h1:VnnmCIaAXU7t0uwNtaLs990V7+V7/7viMpOytOT6GOE= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cdb v1.0.800/go.mod h1:8wiecMvcwN6785rTWLJmdm/Y7u1DjFmqI/iqiWwpm5o= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cdc v1.0.967 h1:+05iVbm200Dh1td+apCB/aX2w97TvmcSlpECkaL53Bw= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cdc v1.0.967/go.mod h1:JzIWhJtlitR2S92TMXikPAOQlC8smQrMbU2Y8NBzRk8= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cdc v1.0.970 h1:0A6PwOaUeLtm4U5TR1uD91ETBgDcnfqFnsG9mwCNvlY= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cdc v1.0.970/go.mod h1:H4k8QCKds731GA9pmSOfHJ99ZOZhy+gKvX1/N2DOsQQ= 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.843 h1:3Xr3UPscUfi5jAzCtwQjDfDf4TPsbUxsCrDdHo6xIRI= @@ -868,6 +872,8 @@ github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cls v1.0.952 h1:+4g+Wp3 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cls v1.0.952/go.mod h1:OW+FNkQgeQTesREQ7iPA4g9V81cEb/NcWSYO6bYe2Qo= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cls v1.0.962 h1:rkceP3tcjU0BCh9xloqZ5cuzDXP327YlQgWHXEaVgns= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cls v1.0.962/go.mod h1:OEg00w6fKlT/3Q/4UI13P5kEJU2IvZm3XMZGUYEKPPs= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cls v1.0.970 h1:PfyFPicGDDDc23id+sXh5vF0sbFpCPulzgLhqqVdp9M= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cls v1.0.970/go.mod h1:VVMyTwJWyP+XVS9OK1y4tJV4XMXZgnKHl+Fg8r0Jf1Q= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.414/go.mod h1:7sCQWVkxcsR38nffDW057DRGk8mUjK1Ing/EFOK8s8Y= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.486/go.mod h1:7sCQWVkxcsR38nffDW057DRGk8mUjK1Ing/EFOK8s8Y= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.524/go.mod h1:7sCQWVkxcsR38nffDW057DRGk8mUjK1Ing/EFOK8s8Y= @@ -956,14 +962,14 @@ github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.963 h1:lUVC github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.963/go.mod h1:r5r4xbfxSaeR04b166HGsBa/R4U3SueirEUpXGuw+Q0= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.964 h1:ET3EulYQvWrdD5FNwOP+196w5Vbniy/uRGucM5ILExQ= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.964/go.mod h1:r5r4xbfxSaeR04b166HGsBa/R4U3SueirEUpXGuw+Q0= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.967 h1:ui73H/2pKk2aDCxaBCLAeMB3JlNgdCkn0nx1x0pqvf0= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.967/go.mod h1:r5r4xbfxSaeR04b166HGsBa/R4U3SueirEUpXGuw+Q0= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.959 h1:GZUqSDQkttkhH2hxWNj5apDo1/YhQwML0Q68wW60LSA= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.959/go.mod h1:r5r4xbfxSaeR04b166HGsBa/R4U3SueirEUpXGuw+Q0= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.960 h1:hde8uWA3624nGUvC8QPf9njcyBZ7A9weqscRrqyM1Rk= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.960/go.mod h1:r5r4xbfxSaeR04b166HGsBa/R4U3SueirEUpXGuw+Q0= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.961 h1:UqinjIsO+Y48BQYSxrD6aHQe8SD+Wsbvj+jU9V9VvWM= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.961/go.mod h1:r5r4xbfxSaeR04b166HGsBa/R4U3SueirEUpXGuw+Q0= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.970 h1:IsF+IWWOfzhbyxP1jFYU3w4kZXWfDH4QaNLXgIy3Sgg= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.970/go.mod h1:r5r4xbfxSaeR04b166HGsBa/R4U3SueirEUpXGuw+Q0= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/csip v1.0.860 h1:F3esKBIT3HW9+7Gt8cVgf8X06VdGIczpgLBUECzSEzU= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/csip v1.0.860/go.mod h1:NZo1WplQcC314kMlCRUoy8NQju2BnolIJj7NAWgsuhY= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cvm v1.0.624 h1:nEZqsoqt1pEoaP9JjkHQy3/H00suCfzlHW1qOm2nYD8= @@ -980,6 +986,8 @@ github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dasb v1.0.798 h1:8FQbCE github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dasb v1.0.798/go.mod h1:ch3pOoPfIs0i+l8qV5yO+Tpk45ubgdltYF/0MfDk4YA= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dasb v1.0.964 h1:GLUcK8t83ay4+W90gWCl4mMDcwbWiF8VHw7iOhzQ1ZM= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dasb v1.0.964/go.mod h1:EErTkW1DHjRtNTlhBmXm+y3plwYreiwoi9o/YEAUNXc= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dasb v1.0.970 h1:qVIRHgG1twsqF4aVN/x2T2yMRfPpsZBTNefDkqzM06M= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dasb v1.0.970/go.mod h1:NJuuQD4z6vcnsZnC7Tvz2U9hElNS1wroc34UQbZvP2U= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dayu v1.0.335 h1:D8qrelkK5udv8RzJJIABMzItGIyaZoYnxEVeIsYqiNw= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dayu v1.0.335/go.mod h1:pz4s3nOhoB9cY0+uWzifuwr7lfh/Gvi1rv0ADxpPzD4= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dbbrain v1.0.652 h1:agjXNi5342DaL0TzRx1FjFlT+9VU2l6aN0yERmxiLLc= @@ -1006,6 +1014,8 @@ github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/gaap v1.0.771 h1:hdd41T github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/gaap v1.0.771/go.mod h1:SzBYz5GyZvZlBHLhKKQ7X/1YaJu73ehlJRx4WK/V7hQ= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/gaap v1.0.967 h1:zV/M+XqJjSn5uqTd4gWsEFPhMOgEaRgDPUB5obel9Qk= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/gaap v1.0.967/go.mod h1:d2Rx/0LqYx5fQbGkpen6D27CRKHvxdng8vSeKIJ5ZZU= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/gaap v1.0.970 h1:Z82LbcEnE2m4CGvcOY024N7REhAN++xdEyE88HG2YBA= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/gaap v1.0.970/go.mod h1:qnOT3rycGxlNy4/gmprV58Uqd9CKLUr2CL235R1AvuQ= 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.729 h1:WQpzm3x27Jo/5uh6/Yqe/gbJ7r2ui9hc9ST7Ml2eP9Y= diff --git a/tencentcloud/connectivity/client.go b/tencentcloud/connectivity/client.go index 0f60d46269..c0763494de 100644 --- a/tencentcloud/connectivity/client.go +++ b/tencentcloud/connectivity/client.go @@ -9,6 +9,8 @@ import ( "strconv" "time" + cdc "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cdc/v20201214" + csip "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/csip/v20221121" cos "github.com/tencentyun/cos-go-sdk-v5" @@ -208,6 +210,7 @@ type TencentCloudClient struct { //internal version: replace client begin, please do not modify this annotation and refrain from inserting any code between the beginning and end lines of the annotation. //internal version: replace client end, please do not modify this annotation and refrain from inserting any code between the beginning and end lines of the annotation. tke2Conn *tke2.Client + cdcConn *cdc.Client //omit nil client omitNilConn *common.Client } @@ -1612,3 +1615,16 @@ func (me *TencentCloudClient) UseTke2Client(iacExtInfo ...IacExtInfo) *tke2.Clie return me.tke2Conn } + +// UseCdcClient returns tem client for service +func (me *TencentCloudClient) UseCdcClient() *cdc.Client { + if me.cdcConn != nil { + return me.cdcConn + } + + cpf := me.NewClientProfile(300) + me.cdcConn, _ = cdc.NewClient(me.Credential, me.Region, cpf) + me.cdcConn.WithHttpTransport(&LogRoundTripper{}) + + return me.cdcConn +} diff --git a/tencentcloud/provider.go b/tencentcloud/provider.go index eae106adc5..826203cd48 100644 --- a/tencentcloud/provider.go +++ b/tencentcloud/provider.go @@ -33,6 +33,7 @@ import ( "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/services/cbs" "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/services/ccn" "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/services/cdb" + "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/services/cdc" "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/services/cdh" "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/services/cdn" "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/services/cdwch" @@ -989,7 +990,11 @@ func Provider() *schema.Provider { "tencentcloud_clickhouse_instance_shards": cdwch.DataSourceTencentCloudClickhouseInstanceShards(), "tencentcloud_clickhouse_instance_nodes": cdwch.DataSourceTencentCloudClickhouseInstanceNodes(), "tencentcloud_organization_org_share_area": tco.DataSourceTencentCloudOrganizationOrgShareArea(), - "tencentcloud_kubernetes_cluster_native_node_pools": tke.DataSourceTencentCloudKubernetesClusterNativeNodePools()}, + "tencentcloud_kubernetes_cluster_native_node_pools": tke.DataSourceTencentCloudKubernetesClusterNativeNodePools(), + "tencentcloud_cdc_dedicated_cluster_hosts": cdc.DataSourceTencentCloudCdcDedicatedClusterHosts(), + "tencentcloud_cdc_dedicated_cluster_instance_types": cdc.DataSourceTencentCloudCdcDedicatedClusterInstanceTypes(), + "tencentcloud_cdc_dedicated_cluster_orders": cdc.DataSourceTencentCloudCdcDedicatedClusterOrders(), + }, ResourcesMap: map[string]*schema.Resource{ "tencentcloud_project": project.ResourceTencentCloudProject(), @@ -1986,7 +1991,10 @@ func Provider() *schema.Provider { "tencentcloud_organization_org_share_unit": tco.ResourceTencentCloudOrganizationOrgShareUnit(), "tencentcloud_kubernetes_addon": tke.ResourceTencentCloudKubernetesAddon(), "tencentcloud_kubernetes_addon_config": tke.ResourceTencentCloudKubernetesAddonConfig(), - "tencentcloud_kubernetes_native_node_pool": tke.ResourceTencentCloudKubernetesNativeNodePool()}, + "tencentcloud_kubernetes_native_node_pool": tke.ResourceTencentCloudKubernetesNativeNodePool(), + "tencentcloud_cdc_site": cdc.ResourceTencentCloudCdcSite(), + "tencentcloud_cdc_dedicated_cluster": cdc.ResourceTencentCloudCdcDedicatedCluster(), + }, ConfigureFunc: providerConfigure, } diff --git a/tencentcloud/provider.md b/tencentcloud/provider.md index 56d27be4ac..9ac53a275a 100644 --- a/tencentcloud/provider.md +++ b/tencentcloud/provider.md @@ -2146,4 +2146,15 @@ CDWPG CSIP Resource - tencentcloud_csip_risk_center \ No newline at end of file + tencentcloud_csip_risk_center + +CDC + Data Source + tencentcloud_cdc_dedicated_cluster_hosts + tencentcloud_cdc_dedicated_cluster_instance_types + tencentcloud_cdc_dedicated_cluster_orders + + Resource + tencentcloud_cdc_site + tencentcloud_cdc_dedicated_cluster + \ No newline at end of file diff --git a/tencentcloud/services/cdc/data_source_tc_cdc_dedicated_cluster_hosts.go b/tencentcloud/services/cdc/data_source_tc_cdc_dedicated_cluster_hosts.go new file mode 100644 index 0000000000..9fc4be0f3a --- /dev/null +++ b/tencentcloud/services/cdc/data_source_tc_cdc_dedicated_cluster_hosts.go @@ -0,0 +1,193 @@ +package cdc + +import ( + "context" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + cdc "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cdc/v20201214" + tccommon "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/common" + "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/internal/helper" +) + +func DataSourceTencentCloudCdcDedicatedClusterHosts() *schema.Resource { + return &schema.Resource{ + Read: DataSourceTencentCloudCdcDedicatedClusterHostsRead, + Schema: map[string]*schema.Schema{ + "dedicated_cluster_id": { + Required: true, + Type: schema.TypeString, + Description: "Dedicated Cluster ID.", + }, + // computed + "host_info_set": { + Computed: true, + Type: schema.TypeList, + Description: "Dedicated Cluster Host Info.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "host_ip": { + Type: schema.TypeString, + Computed: true, + Description: "Dedicated Cluster Host Ip (Deprecated).", + }, + "service_type": { + Type: schema.TypeString, + Computed: true, + Description: "Dedicated Cluster Service Type.", + }, + "host_status": { + Type: schema.TypeString, + Computed: true, + Description: "Dedicated Cluster Host Status.", + }, + "host_type": { + Type: schema.TypeString, + Computed: true, + Description: "Dedicated Cluster Host Type.", + }, + "cpu_available": { + Type: schema.TypeInt, + Computed: true, + Description: "Dedicated Cluster Host CPU Available Count.", + }, + "cpu_total": { + Type: schema.TypeInt, + Computed: true, + Description: "Dedicated Cluster Host CPU Total Count.", + }, + "mem_available": { + Type: schema.TypeInt, + Computed: true, + Description: "Dedicated Cluster Host Memory Available Count (GB).", + }, + "mem_total": { + Type: schema.TypeInt, + Computed: true, + Description: "Dedicated Cluster Host Memory Total Count (GB).", + }, + "run_time": { + Type: schema.TypeString, + Computed: true, + Description: "Dedicated Cluster Host Run Time.", + }, + "expire_time": { + Type: schema.TypeString, + Computed: true, + Description: "Dedicated Cluster Host Expire Time.", + }, + "host_id": { + Type: schema.TypeString, + Computed: true, + Description: "Dedicated Cluster Host ID.", + }, + }, + }, + }, + "result_output_file": { + Type: schema.TypeString, + Optional: true, + Description: "Used to save results.", + }, + }, + } +} + +func DataSourceTencentCloudCdcDedicatedClusterHostsRead(d *schema.ResourceData, meta interface{}) error { + defer tccommon.LogElapsed("data_source.tencentcloud_cdc_dedicated_cluster_hosts.read")() + defer tccommon.InconsistentCheck(d, meta)() + + var ( + logId = tccommon.GetLogId(tccommon.ContextNil) + ctx = context.WithValue(context.TODO(), tccommon.LogIdKey, logId) + service = CdcService{client: meta.(tccommon.ProviderMeta).GetAPIV3Conn()} + hostInfoSet []*cdc.HostInfo + ) + + paramMap := make(map[string]interface{}) + if v, ok := d.GetOk("dedicated_cluster_id"); ok { + paramMap["DedicatedClusterId"] = helper.String(v.(string)) + } + + err := resource.Retry(tccommon.ReadRetryTimeout, func() *resource.RetryError { + result, e := service.DescribeCdcHostByFilter(ctx, paramMap) + if e != nil { + return tccommon.RetryError(e) + } + + hostInfoSet = result + return nil + }) + + if err != nil { + return err + } + + ids := make([]string, 0, len(hostInfoSet)) + tmpList := make([]map[string]interface{}, 0, len(hostInfoSet)) + + if hostInfoSet != nil { + for _, hostInfo := range hostInfoSet { + hostInfoMap := map[string]interface{}{} + + if hostInfo.HostIp != nil { + hostInfoMap["host_ip"] = hostInfo.HostIp + } + + if hostInfo.ServiceType != nil { + hostInfoMap["service_type"] = hostInfo.ServiceType + } + + if hostInfo.HostStatus != nil { + hostInfoMap["host_status"] = hostInfo.HostStatus + } + + if hostInfo.HostType != nil { + hostInfoMap["host_type"] = hostInfo.HostType + } + + if hostInfo.CpuAvailable != nil { + hostInfoMap["cpu_available"] = hostInfo.CpuAvailable + } + + if hostInfo.CpuTotal != nil { + hostInfoMap["cpu_total"] = hostInfo.CpuTotal + } + + if hostInfo.MemAvailable != nil { + hostInfoMap["mem_available"] = hostInfo.MemAvailable + } + + if hostInfo.MemTotal != nil { + hostInfoMap["mem_total"] = hostInfo.MemTotal + } + + if hostInfo.RunTime != nil { + hostInfoMap["run_time"] = hostInfo.RunTime + } + + if hostInfo.ExpireTime != nil { + hostInfoMap["expire_time"] = hostInfo.ExpireTime + } + + if hostInfo.HostId != nil { + hostInfoMap["host_id"] = hostInfo.HostId + } + + ids = append(ids) + tmpList = append(tmpList, hostInfoMap) + } + + _ = d.Set("host_info_set", tmpList) + } + + d.SetId(helper.DataResourceIdsHash(ids)) + output, ok := d.GetOk("result_output_file") + if ok && output.(string) != "" { + if e := tccommon.WriteToFile(output.(string), tmpList); e != nil { + return e + } + } + + return nil +} diff --git a/tencentcloud/services/cdc/data_source_tc_cdc_dedicated_cluster_hosts.md b/tencentcloud/services/cdc/data_source_tc_cdc_dedicated_cluster_hosts.md new file mode 100644 index 0000000000..2964cc4bd4 --- /dev/null +++ b/tencentcloud/services/cdc/data_source_tc_cdc_dedicated_cluster_hosts.md @@ -0,0 +1,9 @@ +Use this data source to query detailed information of CDC dedicated cluster hosts + +Example Usage + +```hcl +data "tencentcloud_cdc_dedicated_cluster_hosts" "hosts" { + dedicated_cluster_id = "cluster-262n63e8" +} +``` diff --git a/tencentcloud/services/cdc/data_source_tc_cdc_dedicated_cluster_hosts_test.go b/tencentcloud/services/cdc/data_source_tc_cdc_dedicated_cluster_hosts_test.go new file mode 100644 index 0000000000..124e61f1ca --- /dev/null +++ b/tencentcloud/services/cdc/data_source_tc_cdc_dedicated_cluster_hosts_test.go @@ -0,0 +1,34 @@ +package cdc + +import ( + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + tcacctest "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/acctest" +) + +// go test -i; go test -test.run TestAccTencentCloudNeedFixCdcDedicatedClusterHostsDataSource_basic -v +func TestAccTencentCloudNeedFixCdcDedicatedClusterHostsDataSource_basic(t *testing.T) { + t.Parallel() + resource.Test(t, resource.TestCase{ + PreCheck: func() { + tcacctest.AccPreCheck(t) + }, + Providers: tcacctest.AccProviders, + Steps: []resource.TestStep{ + { + Config: testAccCdcDedicatedClusterHostsDataSource, + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrSet("data.tencentcloud_cdc_dedicated_cluster_hosts.hosts", "id"), + resource.TestCheckResourceAttrSet("data.tencentcloud_cdc_dedicated_cluster_hosts.hosts", "dedicated_cluster_id"), + ), + }, + }, + }) +} + +const testAccCdcDedicatedClusterHostsDataSource = ` +data "tencentcloud_cdc_dedicated_cluster_hosts" "hosts" { + dedicated_cluster_id = "cluster-262n63e8" +} +` diff --git a/tencentcloud/services/cdc/data_source_tc_cdc_dedicated_cluster_instance_types.go b/tencentcloud/services/cdc/data_source_tc_cdc_dedicated_cluster_instance_types.go new file mode 100644 index 0000000000..3049b2da11 --- /dev/null +++ b/tencentcloud/services/cdc/data_source_tc_cdc_dedicated_cluster_instance_types.go @@ -0,0 +1,230 @@ +package cdc + +import ( + "context" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + cdc "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cdc/v20201214" + tccommon "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/common" + "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/internal/helper" +) + +func DataSourceTencentCloudCdcDedicatedClusterInstanceTypes() *schema.Resource { + return &schema.Resource{ + Read: DataSourceTencentCloudCdcDedicatedClusterInstanceTypesRead, + Schema: map[string]*schema.Schema{ + "dedicated_cluster_id": { + Required: true, + Type: schema.TypeString, + Description: "Dedicated Cluster ID.", + }, + // computed + "dedicated_cluster_instance_type_set": { + Computed: true, + Type: schema.TypeList, + Description: "Dedicated Cluster Supported InstanceType.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "zone": { + Type: schema.TypeString, + Computed: true, + Description: "Zone Name.", + }, + "instance_type": { + Type: schema.TypeString, + Computed: true, + Description: "Instance Type.", + }, + "network_card": { + Type: schema.TypeInt, + Computed: true, + Description: "Instance Type.", + }, + "cpu": { + Type: schema.TypeInt, + Computed: true, + Description: "Instance CPU.", + }, + "memory": { + Type: schema.TypeInt, + Computed: true, + Description: "Instance Memory.", + }, + "instance_family": { + Type: schema.TypeString, + Computed: true, + Description: "Instance Family.", + }, + "type_name": { + Type: schema.TypeString, + Computed: true, + Description: "Instance Type Name.", + }, + "storage_block_amount": { + Type: schema.TypeInt, + Computed: true, + Description: "Instance Storage Block Amount.", + }, + "instance_bandwidth": { + Type: schema.TypeFloat, + Computed: true, + Description: "Instance Bandwidth.", + }, + "instance_pps": { + Type: schema.TypeInt, + Computed: true, + Description: "Instance Pps.", + }, + "cpu_type": { + Type: schema.TypeString, + Computed: true, + Description: "Instance CPU Type.", + }, + "gpu": { + Type: schema.TypeInt, + Computed: true, + Description: "Instance GPU.", + }, + "fpga": { + Type: schema.TypeInt, + Computed: true, + Description: "Instance Fpga.", + }, + "remark": { + Type: schema.TypeString, + Computed: true, + Description: "Instance Remark.", + }, + "status": { + Type: schema.TypeString, + Computed: true, + Description: "Instance Status.", + }, + }, + }, + }, + + "result_output_file": { + Type: schema.TypeString, + Optional: true, + Description: "Used to save results.", + }, + }, + } +} + +func DataSourceTencentCloudCdcDedicatedClusterInstanceTypesRead(d *schema.ResourceData, meta interface{}) error { + defer tccommon.LogElapsed("data_source.tencentcloud_cdc_dedicated_cluster_instance_types.read")() + defer tccommon.InconsistentCheck(d, meta)() + + var ( + logId = tccommon.GetLogId(tccommon.ContextNil) + ctx = context.WithValue(context.TODO(), tccommon.LogIdKey, logId) + service = CdcService{client: meta.(tccommon.ProviderMeta).GetAPIV3Conn()} + dedicatedClusterInstanceTypeSet []*cdc.DedicatedClusterInstanceType + ) + + paramMap := make(map[string]interface{}) + if v, ok := d.GetOk("dedicated_cluster_id"); ok { + paramMap["DedicatedClusterId"] = helper.String(v.(string)) + } + + err := resource.Retry(tccommon.ReadRetryTimeout, func() *resource.RetryError { + result, e := service.DescribeCdcDedicatedClusterInstanceTypesByFilter(ctx, paramMap) + if e != nil { + return tccommon.RetryError(e) + } + + dedicatedClusterInstanceTypeSet = result + return nil + }) + + if err != nil { + return err + } + + ids := make([]string, 0, len(dedicatedClusterInstanceTypeSet)) + tmpList := make([]map[string]interface{}, 0, len(dedicatedClusterInstanceTypeSet)) + + if dedicatedClusterInstanceTypeSet != nil { + for _, dedicatedClusterInstanceType := range dedicatedClusterInstanceTypeSet { + dedicatedClusterInstanceTypeMap := map[string]interface{}{} + + if dedicatedClusterInstanceType.Zone != nil { + dedicatedClusterInstanceTypeMap["zone"] = dedicatedClusterInstanceType.Zone + } + + if dedicatedClusterInstanceType.InstanceType != nil { + dedicatedClusterInstanceTypeMap["instance_type"] = dedicatedClusterInstanceType.InstanceType + } + + if dedicatedClusterInstanceType.NetworkCard != nil { + dedicatedClusterInstanceTypeMap["network_card"] = dedicatedClusterInstanceType.NetworkCard + } + + if dedicatedClusterInstanceType.Cpu != nil { + dedicatedClusterInstanceTypeMap["cpu"] = dedicatedClusterInstanceType.Cpu + } + + if dedicatedClusterInstanceType.Memory != nil { + dedicatedClusterInstanceTypeMap["memory"] = dedicatedClusterInstanceType.Memory + } + + if dedicatedClusterInstanceType.InstanceFamily != nil { + dedicatedClusterInstanceTypeMap["instance_family"] = dedicatedClusterInstanceType.InstanceFamily + } + + if dedicatedClusterInstanceType.TypeName != nil { + dedicatedClusterInstanceTypeMap["type_name"] = dedicatedClusterInstanceType.TypeName + } + + if dedicatedClusterInstanceType.StorageBlockAmount != nil { + dedicatedClusterInstanceTypeMap["storage_block_amount"] = dedicatedClusterInstanceType.StorageBlockAmount + } + + if dedicatedClusterInstanceType.InstanceBandwidth != nil { + dedicatedClusterInstanceTypeMap["instance_bandwidth"] = dedicatedClusterInstanceType.InstanceBandwidth + } + + if dedicatedClusterInstanceType.InstancePps != nil { + dedicatedClusterInstanceTypeMap["instance_pps"] = dedicatedClusterInstanceType.InstancePps + } + + if dedicatedClusterInstanceType.CpuType != nil { + dedicatedClusterInstanceTypeMap["cpu_type"] = dedicatedClusterInstanceType.CpuType + } + + if dedicatedClusterInstanceType.Gpu != nil { + dedicatedClusterInstanceTypeMap["gpu"] = dedicatedClusterInstanceType.Gpu + } + + if dedicatedClusterInstanceType.Fpga != nil { + dedicatedClusterInstanceTypeMap["fpga"] = dedicatedClusterInstanceType.Fpga + } + + if dedicatedClusterInstanceType.Remark != nil { + dedicatedClusterInstanceTypeMap["remark"] = dedicatedClusterInstanceType.Remark + } + + if dedicatedClusterInstanceType.Status != nil { + dedicatedClusterInstanceTypeMap["status"] = dedicatedClusterInstanceType.Status + } + + ids = append(ids) + tmpList = append(tmpList, dedicatedClusterInstanceTypeMap) + } + + _ = d.Set("dedicated_cluster_instance_type_set", tmpList) + } + + d.SetId(helper.DataResourceIdsHash(ids)) + output, ok := d.GetOk("result_output_file") + if ok && output.(string) != "" { + if e := tccommon.WriteToFile(output.(string), tmpList); e != nil { + return e + } + } + + return nil +} diff --git a/tencentcloud/services/cdc/data_source_tc_cdc_dedicated_cluster_instance_types.md b/tencentcloud/services/cdc/data_source_tc_cdc_dedicated_cluster_instance_types.md new file mode 100644 index 0000000000..1310a789f1 --- /dev/null +++ b/tencentcloud/services/cdc/data_source_tc_cdc_dedicated_cluster_instance_types.md @@ -0,0 +1,9 @@ +Use this data source to query detailed information of CDC dedicated cluster instance types + +Example Usage + +```hcl +data "tencentcloud_cdc_dedicated_cluster_instance_types" "types" { + dedicated_cluster_id = "cluster-262n63e8" +} +``` diff --git a/tencentcloud/services/cdc/data_source_tc_cdc_dedicated_cluster_instance_types_test.go b/tencentcloud/services/cdc/data_source_tc_cdc_dedicated_cluster_instance_types_test.go new file mode 100644 index 0000000000..f23e9ab6be --- /dev/null +++ b/tencentcloud/services/cdc/data_source_tc_cdc_dedicated_cluster_instance_types_test.go @@ -0,0 +1,34 @@ +package cdc + +import ( + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + tcacctest "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/acctest" +) + +// go test -i; go test -test.run TestAccTencentCloudNeedFixCdcDedicatedClusterInstanceTypesDataSource_basic -v +func TestAccTencentCloudNeedFixCdcDedicatedClusterInstanceTypesDataSource_basic(t *testing.T) { + t.Parallel() + resource.Test(t, resource.TestCase{ + PreCheck: func() { + tcacctest.AccPreCheck(t) + }, + Providers: tcacctest.AccProviders, + Steps: []resource.TestStep{ + { + Config: testAccCdcDedicatedClusterInstanceTypesDataSource, + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrSet("data.tencentcloud_cdc_dedicated_cluster_instance_types.types", "id"), + resource.TestCheckResourceAttrSet("data.tencentcloud_cdc_dedicated_cluster_instance_types.types", "dedicated_cluster_id"), + ), + }, + }, + }) +} + +const testAccCdcDedicatedClusterInstanceTypesDataSource = ` +data "tencentcloud_cdc_dedicated_cluster_instance_types" "types" { + dedicated_cluster_id = "cluster-262n63e8" +} +` diff --git a/tencentcloud/services/cdc/data_source_tc_cdc_dedicated_cluster_orders.go b/tencentcloud/services/cdc/data_source_tc_cdc_dedicated_cluster_orders.go new file mode 100644 index 0000000000..d53d06e74b --- /dev/null +++ b/tencentcloud/services/cdc/data_source_tc_cdc_dedicated_cluster_orders.go @@ -0,0 +1,497 @@ +package cdc + +import ( + "context" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + cdc "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cdc/v20201214" + tccommon "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/common" + "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/internal/helper" +) + +func DataSourceTencentCloudCdcDedicatedClusterOrders() *schema.Resource { + return &schema.Resource{ + Read: DataSourceTencentCloudCdcDedicatedClusterOrdersRead, + Schema: map[string]*schema.Schema{ + "dedicated_cluster_ids": { + Optional: true, + Type: schema.TypeSet, + Elem: &schema.Schema{Type: schema.TypeString}, + Description: "Filter by Dedicated Cluster ID.", + }, + //"dedicated_cluster_order_id": { + // Optional: true, + // Type: schema.TypeString, + // Description: "Filter by Dedicated Cluster Order ID.", + //}, + "status": { + Optional: true, + Type: schema.TypeString, + Description: "Filter by Dedicated Cluster Order Status. Allow filter value: PENDING, INCONSTRUCTION, DELIVERING, DELIVERED, EXPIRED, CANCELLED, OFFLINE.", + }, + "action_type": { + Optional: true, + Type: schema.TypeString, + Description: "Filter by Dedicated Cluster Order Action Type. Allow filter value: CREATE, EXTEND.", + }, + // computed + "dedicated_cluster_order_set": { + Computed: true, + Type: schema.TypeList, + Description: "Filter by Dedicated Cluster Order.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "dedicated_cluster_id": { + Type: schema.TypeString, + Computed: true, + Description: "Dedicated Cluster ID.", + }, + "dedicated_cluster_type_id": { + Type: schema.TypeString, + Computed: true, + Description: "Dedicated Cluster Type ID.", + }, + "supported_storage_type": { + Type: schema.TypeSet, + Elem: &schema.Schema{Type: schema.TypeString}, + Computed: true, + Description: "Dedicated Cluster Storage Type.", + }, + "supported_uplink_speed": { + Type: schema.TypeSet, + Elem: &schema.Schema{Type: schema.TypeInt}, + Computed: true, + Description: "Dedicated Cluster Supported Uplink Speed.", + }, + "supported_instance_family": { + Type: schema.TypeSet, + Elem: &schema.Schema{Type: schema.TypeString}, + Computed: true, + Description: "Dedicated Cluster Supported Instance Family.", + }, + "weight": { + Type: schema.TypeInt, + Computed: true, + Description: "Dedicated Cluster Supported Weight.", + }, + "power_draw": { + Type: schema.TypeFloat, + Computed: true, + Description: "Dedicated Cluster Supported PowerDraw.", + }, + "order_status": { + Type: schema.TypeString, + Computed: true, + Description: "Dedicated Cluster Order Status.", + }, + "create_time": { + Type: schema.TypeString, + Computed: true, + Description: "Dedicated Cluster Order Create time.", + }, + "dedicated_cluster_order_id": { + Type: schema.TypeString, + Computed: true, + Description: "Dedicated Cluster Order ID.", + }, + "action": { + Type: schema.TypeString, + Computed: true, + Description: "Dedicated Cluster Order Action Type.", + }, + "dedicated_cluster_order_items": { + Type: schema.TypeList, + Computed: true, + Description: "Dedicated Cluster Order Item List.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "dedicated_cluster_type_id": { + Type: schema.TypeString, + Computed: true, + Description: "Dedicated Cluster ID.", + }, + "supported_storage_type": { + Type: schema.TypeSet, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + Computed: true, + Description: "Dedicated Cluster Storage Type.", + }, + "supported_uplink_speed": { + Type: schema.TypeSet, + Elem: &schema.Schema{ + Type: schema.TypeInt, + }, + Computed: true, + Description: "Dedicated Cluster Supported Uplink Speed.", + }, + "supported_instance_family": { + Type: schema.TypeSet, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + Computed: true, + Description: "Dedicated Cluster Supported Instance Family.", + }, + "weight": { + Type: schema.TypeInt, + Computed: true, + Description: "Dedicated Cluster Supported Weight.", + }, + "power_draw": { + Type: schema.TypeFloat, + Computed: true, + Description: "Dedicated Cluster Supported PowerDraw.", + }, + "sub_order_status": { + Type: schema.TypeString, + Computed: true, + Description: "Dedicated Cluster Order Status.", + }, + "create_time": { + Type: schema.TypeString, + Computed: true, + Description: "Dedicated Cluster Order Create time.", + }, + "sub_order_id": { + Type: schema.TypeString, + Computed: true, + Description: "Dedicated Cluster SubOrder ID.", + }, + "count": { + Type: schema.TypeInt, + Computed: true, + Description: "Dedicated Cluster SubOrder Count.", + }, + "name": { + Type: schema.TypeString, + Computed: true, + Description: "Dedicated Cluster Type Name.", + }, + "description": { + Type: schema.TypeString, + Computed: true, + Description: "Dedicated Cluster Type Description.", + }, + "total_cpu": { + Type: schema.TypeInt, + Computed: true, + Description: "Dedicated Cluster Total CPU.", + }, + "total_mem": { + Type: schema.TypeInt, + Computed: true, + Description: "Dedicated Cluster Total Memory.", + }, + "total_gpu": { + Type: schema.TypeInt, + Computed: true, + Description: "Dedicated Cluster Total GPU.", + }, + "type_name": { + Type: schema.TypeString, + Computed: true, + Description: "Dedicated Cluster Type Name.", + }, + "compute_format": { + Type: schema.TypeString, + Computed: true, + Description: "Dedicated Cluster Compute Format.", + }, + "type_family": { + Type: schema.TypeString, + Computed: true, + Description: "Dedicated Cluster Type Family.", + }, + "sub_order_pay_status": { + Type: schema.TypeInt, + Computed: true, + Description: "Dedicated Cluster SubOrder Pay Status.", + }, + }, + }, + }, + "cpu": { + Type: schema.TypeInt, + Computed: true, + Description: "Dedicated Cluster CPU.", + }, + "mem": { + Type: schema.TypeInt, + Computed: true, + Description: "Dedicated Cluster Memory.", + }, + "gpu": { + Type: schema.TypeInt, + Computed: true, + Description: "Dedicated Cluster GPU.", + }, + "pay_status": { + Type: schema.TypeInt, + Computed: true, + Description: "Dedicated Cluster Order Pay Status.", + }, + "pay_type": { + Type: schema.TypeString, + Computed: true, + Description: "Dedicated Cluster Order Pay Type.", + }, + "time_unit": { + Type: schema.TypeString, + Computed: true, + Description: "Dedicated Cluster Order Pay Time Unit.", + }, + "time_span": { + Type: schema.TypeInt, + Computed: true, + Description: "Dedicated Cluster Order Pay Time Span.", + }, + "order_type": { + Type: schema.TypeString, + Computed: true, + Description: "Dedicated Cluster Order Type.", + }, + }, + }, + }, + "result_output_file": { + Type: schema.TypeString, + Optional: true, + Description: "Used to save results.", + }, + }, + } +} + +func DataSourceTencentCloudCdcDedicatedClusterOrdersRead(d *schema.ResourceData, meta interface{}) error { + defer tccommon.LogElapsed("data_source.tencentcloud_cdc_dedicated_cluster_orders.read")() + defer tccommon.InconsistentCheck(d, meta)() + + var ( + logId = tccommon.GetLogId(tccommon.ContextNil) + ctx = context.WithValue(context.TODO(), tccommon.LogIdKey, logId) + service = CdcService{client: meta.(tccommon.ProviderMeta).GetAPIV3Conn()} + dedicatedClusterOrderSet []*cdc.DedicatedClusterOrder + ) + + paramMap := make(map[string]interface{}) + if v, ok := d.GetOk("dedicated_cluster_ids"); ok { + dedicatedClusterIdsSet := v.(*schema.Set).List() + paramMap["DedicatedClusterIds"] = helper.InterfacesStringsPoint(dedicatedClusterIdsSet) + } + + //if v, ok := d.GetOk("dedicated_cluster_order_id"); ok { + // paramMap["DedicatedClusterOrderIds"] = helper.String(v.(string)) + //} + + if v, ok := d.GetOk("status"); ok { + paramMap["Status"] = helper.String(v.(string)) + } + + if v, ok := d.GetOk("action_type"); ok { + paramMap["ActionType"] = helper.String(v.(string)) + } + + err := resource.Retry(tccommon.ReadRetryTimeout, func() *resource.RetryError { + result, e := service.DescribeCdcDedicatedClusterOrdersByFilter(ctx, paramMap) + if e != nil { + return tccommon.RetryError(e) + } + + dedicatedClusterOrderSet = result + return nil + }) + + if err != nil { + return err + } + + ids := make([]string, 0, len(dedicatedClusterOrderSet)) + tmpList := make([]map[string]interface{}, 0, len(dedicatedClusterOrderSet)) + + if dedicatedClusterOrderSet != nil { + for _, dedicatedClusterOrder := range dedicatedClusterOrderSet { + dedicatedClusterOrderMap := map[string]interface{}{} + + if dedicatedClusterOrder.DedicatedClusterId != nil { + dedicatedClusterOrderMap["dedicated_cluster_id"] = dedicatedClusterOrder.DedicatedClusterId + } + + if dedicatedClusterOrder.DedicatedClusterTypeId != nil { + dedicatedClusterOrderMap["dedicated_cluster_type_id"] = dedicatedClusterOrder.DedicatedClusterTypeId + } + + if dedicatedClusterOrder.SupportedStorageType != nil { + dedicatedClusterOrderMap["supported_storage_type"] = dedicatedClusterOrder.SupportedStorageType + } + + if dedicatedClusterOrder.SupportedUplinkSpeed != nil { + dedicatedClusterOrderMap["supported_uplink_speed"] = dedicatedClusterOrder.SupportedUplinkSpeed + } + + if dedicatedClusterOrder.SupportedInstanceFamily != nil { + dedicatedClusterOrderMap["supported_instance_family"] = dedicatedClusterOrder.SupportedInstanceFamily + } + + if dedicatedClusterOrder.Weight != nil { + dedicatedClusterOrderMap["weight"] = dedicatedClusterOrder.Weight + } + + if dedicatedClusterOrder.PowerDraw != nil { + dedicatedClusterOrderMap["power_draw"] = dedicatedClusterOrder.PowerDraw + } + + if dedicatedClusterOrder.OrderStatus != nil { + dedicatedClusterOrderMap["order_status"] = dedicatedClusterOrder.OrderStatus + } + + if dedicatedClusterOrder.CreateTime != nil { + dedicatedClusterOrderMap["create_time"] = dedicatedClusterOrder.CreateTime + } + + if dedicatedClusterOrder.DedicatedClusterOrderId != nil { + dedicatedClusterOrderMap["dedicated_cluster_order_id"] = dedicatedClusterOrder.DedicatedClusterOrderId + } + + if dedicatedClusterOrder.Action != nil { + dedicatedClusterOrderMap["action"] = dedicatedClusterOrder.Action + } + + if dedicatedClusterOrder.DedicatedClusterOrderItems != nil { + dedicatedClusterOrderItemsList := []interface{}{} + for _, dedicatedClusterOrderItems := range dedicatedClusterOrder.DedicatedClusterOrderItems { + dedicatedClusterOrderItemsMap := map[string]interface{}{} + + if dedicatedClusterOrderItems.DedicatedClusterTypeId != nil { + dedicatedClusterOrderItemsMap["dedicated_cluster_type_id"] = dedicatedClusterOrderItems.DedicatedClusterTypeId + } + + if dedicatedClusterOrderItems.SupportedStorageType != nil { + dedicatedClusterOrderItemsMap["supported_storage_type"] = dedicatedClusterOrderItems.SupportedStorageType + } + + if dedicatedClusterOrderItems.SupportedUplinkSpeed != nil { + dedicatedClusterOrderItemsMap["supported_uplink_speed"] = dedicatedClusterOrderItems.SupportedUplinkSpeed + } + + if dedicatedClusterOrderItems.SupportedInstanceFamily != nil { + dedicatedClusterOrderItemsMap["supported_instance_family"] = dedicatedClusterOrderItems.SupportedInstanceFamily + } + + if dedicatedClusterOrderItems.Weight != nil { + dedicatedClusterOrderItemsMap["weight"] = dedicatedClusterOrderItems.Weight + } + + if dedicatedClusterOrderItems.PowerDraw != nil { + dedicatedClusterOrderItemsMap["power_draw"] = dedicatedClusterOrderItems.PowerDraw + } + + if dedicatedClusterOrderItems.SubOrderStatus != nil { + dedicatedClusterOrderItemsMap["sub_order_status"] = dedicatedClusterOrderItems.SubOrderStatus + } + + if dedicatedClusterOrderItems.CreateTime != nil { + dedicatedClusterOrderItemsMap["create_time"] = dedicatedClusterOrderItems.CreateTime + } + + if dedicatedClusterOrderItems.SubOrderId != nil { + dedicatedClusterOrderItemsMap["sub_order_id"] = dedicatedClusterOrderItems.SubOrderId + } + + if dedicatedClusterOrderItems.Count != nil { + dedicatedClusterOrderItemsMap["count"] = dedicatedClusterOrderItems.Count + } + + if dedicatedClusterOrderItems.Name != nil { + dedicatedClusterOrderItemsMap["name"] = dedicatedClusterOrderItems.Name + } + + if dedicatedClusterOrderItems.Description != nil { + dedicatedClusterOrderItemsMap["description"] = dedicatedClusterOrderItems.Description + } + + if dedicatedClusterOrderItems.TotalCpu != nil { + dedicatedClusterOrderItemsMap["total_cpu"] = dedicatedClusterOrderItems.TotalCpu + } + + if dedicatedClusterOrderItems.TotalMem != nil { + dedicatedClusterOrderItemsMap["total_mem"] = dedicatedClusterOrderItems.TotalMem + } + + if dedicatedClusterOrderItems.TotalGpu != nil { + dedicatedClusterOrderItemsMap["total_gpu"] = dedicatedClusterOrderItems.TotalGpu + } + + if dedicatedClusterOrderItems.TypeName != nil { + dedicatedClusterOrderItemsMap["type_name"] = dedicatedClusterOrderItems.TypeName + } + + if dedicatedClusterOrderItems.ComputeFormat != nil { + dedicatedClusterOrderItemsMap["compute_format"] = dedicatedClusterOrderItems.ComputeFormat + } + + if dedicatedClusterOrderItems.TypeFamily != nil { + dedicatedClusterOrderItemsMap["type_family"] = dedicatedClusterOrderItems.TypeFamily + } + + if dedicatedClusterOrderItems.SubOrderPayStatus != nil { + dedicatedClusterOrderItemsMap["sub_order_pay_status"] = dedicatedClusterOrderItems.SubOrderPayStatus + } + + dedicatedClusterOrderItemsList = append(dedicatedClusterOrderItemsList, dedicatedClusterOrderItemsMap) + } + + dedicatedClusterOrderMap["dedicated_cluster_order_items"] = dedicatedClusterOrderItemsList + } + + if dedicatedClusterOrder.Cpu != nil { + dedicatedClusterOrderMap["cpu"] = dedicatedClusterOrder.Cpu + } + + if dedicatedClusterOrder.Mem != nil { + dedicatedClusterOrderMap["mem"] = dedicatedClusterOrder.Mem + } + + if dedicatedClusterOrder.Gpu != nil { + dedicatedClusterOrderMap["gpu"] = dedicatedClusterOrder.Gpu + } + + if dedicatedClusterOrder.PayStatus != nil { + dedicatedClusterOrderMap["pay_status"] = dedicatedClusterOrder.PayStatus + } + + if dedicatedClusterOrder.PayType != nil { + dedicatedClusterOrderMap["pay_type"] = dedicatedClusterOrder.PayType + } + + if dedicatedClusterOrder.TimeUnit != nil { + dedicatedClusterOrderMap["time_unit"] = dedicatedClusterOrder.TimeUnit + } + + if dedicatedClusterOrder.TimeSpan != nil { + dedicatedClusterOrderMap["time_span"] = dedicatedClusterOrder.TimeSpan + } + + if dedicatedClusterOrder.OrderType != nil { + dedicatedClusterOrderMap["order_type"] = dedicatedClusterOrder.OrderType + } + + ids = append(ids) + tmpList = append(tmpList, dedicatedClusterOrderMap) + } + + _ = d.Set("dedicated_cluster_order_set", tmpList) + } + + d.SetId(helper.DataResourceIdsHash(ids)) + output, ok := d.GetOk("result_output_file") + if ok && output.(string) != "" { + if e := tccommon.WriteToFile(output.(string), tmpList); e != nil { + return e + } + } + + return nil +} diff --git a/tencentcloud/services/cdc/data_source_tc_cdc_dedicated_cluster_orders.md b/tencentcloud/services/cdc/data_source_tc_cdc_dedicated_cluster_orders.md new file mode 100644 index 0000000000..ed6f271da9 --- /dev/null +++ b/tencentcloud/services/cdc/data_source_tc_cdc_dedicated_cluster_orders.md @@ -0,0 +1,22 @@ +Use this data source to query detailed information of CDC dedicated cluster orders + +Example Usage + +Query all orders + +```hcl +data "tencentcloud_cdc_dedicated_cluster_orders" "orders" {} +``` + +Query orders by filter + +```hcl +data "tencentcloud_cdc_dedicated_cluster_orders" "orders1" { + dedicated_cluster_ids = ["cluster-262n63e8"] +} + +data "tencentcloud_cdc_dedicated_cluster_orders" "orders3" { + status = "PENDING" + action_type = "CREATE" +} +``` diff --git a/tencentcloud/services/cdc/data_source_tc_cdc_dedicated_cluster_orders_test.go b/tencentcloud/services/cdc/data_source_tc_cdc_dedicated_cluster_orders_test.go new file mode 100644 index 0000000000..3dd2b1a4ff --- /dev/null +++ b/tencentcloud/services/cdc/data_source_tc_cdc_dedicated_cluster_orders_test.go @@ -0,0 +1,34 @@ +package cdc + +import ( + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + tcacctest "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/acctest" +) + +// go test -i; go test -test.run TestAccTencentCloudNeedFixCdcDedicatedClusterOrdersDataSource_basic -v +func TestAccTencentCloudNeedFixCdcDedicatedClusterOrdersDataSource_basic(t *testing.T) { + t.Parallel() + resource.Test(t, resource.TestCase{ + PreCheck: func() { + tcacctest.AccPreCheck(t) + }, + Providers: tcacctest.AccProviders, + Steps: []resource.TestStep{ + { + Config: testAccCdcDedicatedClusterOrdersDataSource, + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrSet("data.tencentcloud_cdc_dedicated_cluster_orders.orders", "id"), + resource.TestCheckResourceAttrSet("data.tencentcloud_cdc_dedicated_cluster_orders.orders", "dedicated_cluster_ids.#"), + ), + }, + }, + }) +} + +const testAccCdcDedicatedClusterOrdersDataSource = ` +data "tencentcloud_cdc_dedicated_cluster_orders" "orders1" { + dedicated_cluster_ids = ["cluster-262n63e8"] +} +` diff --git a/tencentcloud/services/cdc/resource_tc_cdc_dedicated_cluster.go b/tencentcloud/services/cdc/resource_tc_cdc_dedicated_cluster.go new file mode 100644 index 0000000000..5c8de66847 --- /dev/null +++ b/tencentcloud/services/cdc/resource_tc_cdc_dedicated_cluster.go @@ -0,0 +1,211 @@ +package cdc + +import ( + "context" + "fmt" + "log" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + cdc "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cdc/v20201214" + tccommon "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/common" + "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/internal/helper" +) + +func ResourceTencentCloudCdcDedicatedCluster() *schema.Resource { + return &schema.Resource{ + Create: ResourceTencentCloudCdcDedicatedClusterCreate, + Read: ResourceTencentCloudCdcDedicatedClusterRead, + Update: ResourceTencentCloudCdcDedicatedClusterUpdate, + Delete: ResourceTencentCloudCdcDedicatedClusterDelete, + Importer: &schema.ResourceImporter{ + State: schema.ImportStatePassthrough, + }, + Schema: map[string]*schema.Schema{ + "site_id": { + Required: true, + Type: schema.TypeString, + Description: "Dedicated Cluster Site ID.", + }, + "name": { + Required: true, + Type: schema.TypeString, + Description: "Dedicated Cluster Name.", + }, + "zone": { + Required: true, + Type: schema.TypeString, + Description: "Dedicated Cluster Zone.", + }, + "description": { + Optional: true, + Type: schema.TypeString, + Description: "Dedicated Cluster Description.", + }, + }, + } +} + +func ResourceTencentCloudCdcDedicatedClusterCreate(d *schema.ResourceData, meta interface{}) error { + defer tccommon.LogElapsed("resource.tencentcloud_cdc_dedicated_cluster.create")() + + var ( + logId = tccommon.GetLogId(tccommon.ContextNil) + request = cdc.NewCreateDedicatedClusterRequest() + response = cdc.NewCreateDedicatedClusterResponse() + dedicatedClusterId string + ) + + if v, ok := d.GetOk("site_id"); ok { + request.SiteId = helper.String(v.(string)) + } + + if v, ok := d.GetOk("name"); ok { + request.Name = helper.String(v.(string)) + } + + if v, ok := d.GetOk("zone"); ok { + request.Zone = helper.String(v.(string)) + } + + if v, ok := d.GetOk("description"); ok { + request.Description = helper.String(v.(string)) + } + + err := resource.Retry(tccommon.WriteRetryTimeout, func() *resource.RetryError { + result, e := meta.(tccommon.ProviderMeta).GetAPIV3Conn().UseCdcClient().CreateDedicatedCluster(request) + if e != nil { + return tccommon.RetryError(e) + } else { + log.Printf("[DEBUG]%s api[%s] success, request body [%s], response body [%s]\n", logId, request.GetAction(), request.ToJsonString(), result.ToJsonString()) + } + + if result == nil { + e = fmt.Errorf("create cdc dedicatedcluster failed") + return resource.NonRetryableError(e) + } + + response = result + return nil + }) + + if err != nil { + log.Printf("[CRITAL]%s create cdc dedicatedCluster failed, reason:%+v", logId, err) + return err + } + + dedicatedClusterId = *response.Response.DedicatedClusterId + d.SetId(dedicatedClusterId) + + return ResourceTencentCloudCdcDedicatedClusterRead(d, meta) +} + +func ResourceTencentCloudCdcDedicatedClusterRead(d *schema.ResourceData, meta interface{}) error { + defer tccommon.LogElapsed("resource.tencentcloud_cdc_dedicated_cluster.read")() + + var ( + logId = tccommon.GetLogId(tccommon.ContextNil) + ctx = context.WithValue(context.TODO(), tccommon.LogIdKey, logId) + service = CdcService{client: meta.(tccommon.ProviderMeta).GetAPIV3Conn()} + dedicatedClusterId = d.Id() + ) + + dedicatedCluster, err := service.DescribeCdcDedicatedClusterById(ctx, dedicatedClusterId) + if err != nil { + return err + } + + if dedicatedCluster == nil { + d.SetId("") + log.Printf("[WARN]%s resource `CdcDedicatedCluster` [%s] not found, please check if it has been deleted.\n", logId, d.Id()) + return nil + } + + if dedicatedCluster.SiteId != nil { + _ = d.Set("site_id", dedicatedCluster.SiteId) + } + + if dedicatedCluster.Name != nil { + _ = d.Set("name", dedicatedCluster.Name) + } + + if dedicatedCluster.Zone != nil { + _ = d.Set("zone", dedicatedCluster.Zone) + } + + if dedicatedCluster.Description != nil { + _ = d.Set("description", dedicatedCluster.Description) + } + + return nil +} + +func ResourceTencentCloudCdcDedicatedClusterUpdate(d *schema.ResourceData, meta interface{}) error { + defer tccommon.LogElapsed("resource.tencentcloud_cdc_dedicated_cluster.update")() + + var ( + logId = tccommon.GetLogId(tccommon.ContextNil) + request = cdc.NewModifyDedicatedClusterInfoRequest() + dedicatedClusterId = d.Id() + ) + + request.DedicatedClusterId = &dedicatedClusterId + if d.HasChange("site_id") { + if v, ok := d.GetOk("site_id"); ok { + request.SiteId = helper.String(v.(string)) + } + } + + if d.HasChange("name") { + if v, ok := d.GetOk("name"); ok { + request.Name = helper.String(v.(string)) + } + } + + if d.HasChange("zone") { + if v, ok := d.GetOk("zone"); ok { + request.Zone = helper.String(v.(string)) + } + } + + if d.HasChange("description") { + if v, ok := d.GetOk("description"); ok { + request.Description = helper.String(v.(string)) + } + } + + err := resource.Retry(tccommon.WriteRetryTimeout, func() *resource.RetryError { + result, e := meta.(tccommon.ProviderMeta).GetAPIV3Conn().UseCdcClient().ModifyDedicatedClusterInfo(request) + if e != nil { + return tccommon.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 cdc dedicatedCluster failed, reason:%+v", logId, err) + return err + } + + return ResourceTencentCloudCdcDedicatedClusterRead(d, meta) +} + +func ResourceTencentCloudCdcDedicatedClusterDelete(d *schema.ResourceData, meta interface{}) error { + defer tccommon.LogElapsed("resource.tencentcloud_cdc_dedicated_cluster.delete")() + + var ( + logId = tccommon.GetLogId(tccommon.ContextNil) + ctx = context.WithValue(context.TODO(), tccommon.LogIdKey, logId) + service = CdcService{client: meta.(tccommon.ProviderMeta).GetAPIV3Conn()} + dedicatedClusterId = d.Id() + ) + + if err := service.DeleteCdcDedicatedClusterById(ctx, dedicatedClusterId); err != nil { + return err + } + + return nil +} diff --git a/tencentcloud/services/cdc/resource_tc_cdc_dedicated_cluster.md b/tencentcloud/services/cdc/resource_tc_cdc_dedicated_cluster.md new file mode 100644 index 0000000000..6ed0f3654d --- /dev/null +++ b/tencentcloud/services/cdc/resource_tc_cdc_dedicated_cluster.md @@ -0,0 +1,31 @@ +Provides a resource to create a CDC dedicated cluster + +Example Usage + +```hcl +# create cdc site +resource "tencentcloud_cdc_site" "example" { + name = "tf-example" + country = "China" + province = "Guangdong Province" + city = "Guangzhou" + address_line = "Tencent Building" + description = "desc." +} + +# create cdc dedicated cluster +resource "tencentcloud_cdc_dedicated_cluster" "example" { + site_id = tencentcloud_cdc_site.example.id + name = "tf-example" + zone = "ap-guangzhou-6" + description = "desc." +} +``` + +Import + +CDC dedicated cluster can be imported using the id, e.g. + +``` +terraform import tencentcloud_cdc_dedicated_cluster.example cluster-d574omhk +``` diff --git a/tencentcloud/services/cdc/resource_tc_cdc_dedicated_cluster_test.go b/tencentcloud/services/cdc/resource_tc_cdc_dedicated_cluster_test.go new file mode 100644 index 0000000000..0266f971f8 --- /dev/null +++ b/tencentcloud/services/cdc/resource_tc_cdc_dedicated_cluster_test.go @@ -0,0 +1,82 @@ +package cdc + +import ( + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + tcacctest "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/acctest" +) + +// go test -i; go test -test.run TestAccTencentCloudNeedFixCdcDedicatedClusterResource_basic -v +func TestAccTencentCloudNeedFixCdcDedicatedClusterResource_basic(t *testing.T) { + t.Parallel() + resource.Test(t, resource.TestCase{ + PreCheck: func() { + tcacctest.AccPreCheck(t) + }, + Providers: tcacctest.AccProviders, + Steps: []resource.TestStep{ + { + Config: testAccCdcDedicatedCluster, + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrSet("tencentcloud_cdc_dedicated_cluster.example", "id"), + resource.TestCheckResourceAttrSet("tencentcloud_cdc_dedicated_cluster.example", "site_id"), + resource.TestCheckResourceAttrSet("tencentcloud_cdc_dedicated_cluster.example", "name"), + resource.TestCheckResourceAttrSet("tencentcloud_cdc_dedicated_cluster.example", "zone"), + resource.TestCheckResourceAttrSet("tencentcloud_cdc_dedicated_cluster.example", "description"), + ), + }, + { + Config: testAccCdcDedicatedClusterUpdate, + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrSet("tencentcloud_cdc_dedicated_cluster.example", "id"), + resource.TestCheckResourceAttrSet("tencentcloud_cdc_dedicated_cluster.example", "site_id"), + resource.TestCheckResourceAttrSet("tencentcloud_cdc_dedicated_cluster.example", "name"), + resource.TestCheckResourceAttrSet("tencentcloud_cdc_dedicated_cluster.example", "zone"), + resource.TestCheckResourceAttrSet("tencentcloud_cdc_dedicated_cluster.example", "description"), + ), + }, + { + ResourceName: "tencentcloud_cdc_dedicated_cluster.example", + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + +const testAccCdcDedicatedCluster = ` +resource "tencentcloud_cdc_site" "example" { + name = "tf-example" + country = "China" + province = "Guangdong Province" + city = "Guangzhou" + address_line = "Tencent Building" + description = "desc." +} + +resource "tencentcloud_cdc_dedicated_cluster" "example" { + site_id = tencentcloud_cdc_site.example.id + name = "tf-example" + zone = "ap-guangzhou-6" + description = "desc." +} +` + +const testAccCdcDedicatedClusterUpdate = ` +resource "tencentcloud_cdc_site" "example" { + name = "tf-example" + country = "China" + province = "Guangdong Province" + city = "Guangzhou" + address_line = "Tencent Building" + description = "desc." +} + +resource "tencentcloud_cdc_dedicated_cluster" "example" { + site_id = tencentcloud_cdc_site.example.id + name = "tf-example-update" + zone = "ap-guangzhou-3" + description = "desc update." +} +` diff --git a/tencentcloud/services/cdc/resource_tc_cdc_site.go b/tencentcloud/services/cdc/resource_tc_cdc_site.go new file mode 100644 index 0000000000..efb207e003 --- /dev/null +++ b/tencentcloud/services/cdc/resource_tc_cdc_site.go @@ -0,0 +1,500 @@ +package cdc + +import ( + "context" + "fmt" + "log" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + cdc "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cdc/v20201214" + "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/internal/helper" + + tccommon "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/common" +) + +func ResourceTencentCloudCdcSite() *schema.Resource { + return &schema.Resource{ + Create: ResourceTencentCloudCdcSiteCreate, + Read: ResourceTencentCloudCdcSiteRead, + Update: ResourceTencentCloudCdcSiteUpdate, + Delete: ResourceTencentCloudCdcSiteDelete, + Importer: &schema.ResourceImporter{ + State: schema.ImportStatePassthrough, + }, + Schema: map[string]*schema.Schema{ + "name": { + Required: true, + Type: schema.TypeString, + Description: "Site Name.", + }, + "country": { + Required: true, + Type: schema.TypeString, + Description: "Site Country.", + }, + "province": { + Required: true, + Type: schema.TypeString, + Description: "Site Province.", + }, + "city": { + Required: true, + Type: schema.TypeString, + Description: "Site City.", + }, + "address_line": { + Required: true, + Type: schema.TypeString, + Description: "Site Detail Address.", + }, + "description": { + Optional: true, + Type: schema.TypeString, + Description: "Site Description.", + }, + //"note": { + // Optional: true, + // Type: schema.TypeString, + // Description: "Site Note.", + //}, + "fiber_type": { + Optional: true, + Type: schema.TypeString, + Description: "Site Fiber Type. Using optical fiber type to connect the CDC device to the network SM(Single-Mode) or MM(Multi-Mode) fibers are available.", + }, + "optical_standard": { + Optional: true, + Type: schema.TypeString, + Description: "Site Optical Standard. Optical standard used to connect the CDC device to the network This field depends on the uplink speed, optical fiber type, and distance to upstream equipment. Allow value: `SM`, `MM`.", + }, + "power_connectors": { + Optional: true, + Type: schema.TypeString, + Description: "Site Power Connectors. Example: 380VAC3P.", + }, + "power_feed_drop": { + Optional: true, + Type: schema.TypeString, + Description: "Site Power Feed Drop. Whether power is supplied from above or below the rack. Allow value: `UP`, `DOWN`.", + }, + "max_weight": { + Optional: true, + Computed: true, + Type: schema.TypeInt, + Description: "Site Max Weight capacity (KG).", + }, + "power_draw_kva": { + Optional: true, + Computed: true, + Type: schema.TypeInt, + Description: "Site Power DrawKva (KW).", + }, + "uplink_speed_gbps": { + Optional: true, + Computed: true, + Type: schema.TypeInt, + Description: "Uplink speed from the network to Tencent Cloud Region.", + }, + "uplink_count": { + Optional: true, + Computed: true, + Type: schema.TypeInt, + Description: "Number of uplinks used by each CDC device (2 devices per rack) when connected to the network.", + }, + "condition_requirement": { + Optional: true, + Computed: true, + Type: schema.TypeBool, + Description: "Whether the following environmental conditions are met: n1. There are no material requirements or the acceptance standard on site that will affect the delivery and installation of the CDC device. n2. The following conditions are met for finalized rack positions: Temperature ranges from 41 to 104 degrees F (5 to 40 degrees C). Humidity ranges from 10 degrees F (-12 degrees C) to 70 degrees F (21 degrees C) and relative humidity ranges from 8% RH to 80% RH. Air flows from front to back at the rack position and there is sufficient air in CFM (cubic feet per minute). The air quantity in CFM must be 145.8 times the power consumption (in KVA) of CDC.", + }, + "dimension_requirement": { + Optional: true, + Computed: true, + Type: schema.TypeBool, + Description: "Whether the following dimension conditions are met: Your loading dock can accommodate one rack container (H x W x D = 94 x 54 x 48). You can provide a clear route from the delivery point of your rack (H x W x D = 80 x 24 x 48) to its final installation location. You should consider platforms, corridors, doors, turns, ramps, freight elevators as well as other access restrictions when measuring the depth. There shall be a 48 or greater front clearance and a 24 or greater rear clearance where the CDC is finally installed.", + }, + "redundant_networking": { + Optional: true, + Computed: true, + Type: schema.TypeBool, + Description: "Whether redundant upstream equipment (switch or router) is provided so that both network devices can be connected to the network.", + }, + //"postal_code": { + // Optional: true, + // Type: schema.TypeInt, + // Description: "Postal code of the site area.", + //}, + "optional_address_line": { + Optional: true, + Type: schema.TypeString, + Description: "Detailed address of the site area (to be added).", + }, + "need_help": { + Optional: true, + Computed: true, + Type: schema.TypeBool, + Description: "Whether you need help from Tencent Cloud for rack installation.", + }, + "redundant_power": { + Optional: true, + Computed: true, + Type: schema.TypeBool, + Description: "Whether there is power redundancy.", + }, + "breaker_requirement": { + Optional: true, + Computed: true, + Type: schema.TypeBool, + Description: "Whether there is an upstream circuit breaker.", + }, + }, + } +} + +func ResourceTencentCloudCdcSiteCreate(d *schema.ResourceData, meta interface{}) error { + defer tccommon.LogElapsed("resource.tencentcloud_cdc_site.create")() + + var ( + logId = tccommon.GetLogId(tccommon.ContextNil) + request = cdc.NewCreateSiteRequest() + response = cdc.NewCreateSiteResponse() + siteId string + ) + + if v, ok := d.GetOk("name"); ok { + request.Name = helper.String(v.(string)) + } + + if v, ok := d.GetOk("country"); ok { + request.Country = helper.String(v.(string)) + } + + if v, ok := d.GetOk("province"); ok { + request.Province = helper.String(v.(string)) + } + + if v, ok := d.GetOk("city"); ok { + request.City = helper.String(v.(string)) + } + + if v, ok := d.GetOk("address_line"); ok { + request.AddressLine = helper.String(v.(string)) + } + + if v, ok := d.GetOk("description"); ok { + request.Description = helper.String(v.(string)) + } + + //if v, ok := d.GetOk("note"); ok { + // request.Note = helper.String(v.(string)) + //} + + if v, ok := d.GetOk("fiber_type"); ok { + request.FiberType = helper.String(v.(string)) + } + + if v, ok := d.GetOk("optical_standard"); ok { + request.OpticalStandard = helper.String(v.(string)) + } + + if v, ok := d.GetOk("power_connectors"); ok { + request.PowerConnectors = helper.String(v.(string)) + } + + if v, ok := d.GetOk("power_feed_drop"); ok { + request.PowerFeedDrop = helper.String(v.(string)) + } + + if v, ok := d.GetOkExists("max_weight"); ok { + request.MaxWeight = helper.IntInt64(v.(int)) + } + + if v, ok := d.GetOkExists("power_draw_kva"); ok { + request.PowerDrawKva = helper.IntInt64(v.(int)) + } + + if v, ok := d.GetOkExists("uplink_speed_gbps"); ok { + request.UplinkSpeedGbps = helper.IntInt64(v.(int)) + } + + if v, ok := d.GetOkExists("uplink_count"); ok { + request.UplinkCount = helper.IntInt64(v.(int)) + } + + if v, ok := d.GetOkExists("condition_requirement"); ok { + request.ConditionRequirement = helper.Bool(v.(bool)) + } + + if v, ok := d.GetOkExists("dimension_requirement"); ok { + request.DimensionRequirement = helper.Bool(v.(bool)) + } + + if v, ok := d.GetOkExists("redundant_networking"); ok { + request.RedundantNetworking = helper.Bool(v.(bool)) + } + + //if v, ok := d.GetOkExists("postal_code"); ok { + // request.PostalCode = helper.IntInt64(v.(int)) + //} + + if v, ok := d.GetOk("optional_address_line"); ok { + request.OptionalAddressLine = helper.String(v.(string)) + } + + if v, ok := d.GetOkExists("need_help"); ok { + request.NeedHelp = helper.Bool(v.(bool)) + } + + if v, ok := d.GetOkExists("redundant_power"); ok { + request.RedundantPower = helper.Bool(v.(bool)) + } + + if v, ok := d.GetOkExists("breaker_requirement"); ok { + request.BreakerRequirement = helper.Bool(v.(bool)) + } + + err := resource.Retry(tccommon.WriteRetryTimeout, func() *resource.RetryError { + result, e := meta.(tccommon.ProviderMeta).GetAPIV3Conn().UseCdcClient().CreateSite(request) + if e != nil { + return tccommon.RetryError(e) + } else { + log.Printf("[DEBUG]%s api[%s] success, request body [%s], response body [%s]\n", logId, request.GetAction(), request.ToJsonString(), result.ToJsonString()) + } + + if result == nil { + e = fmt.Errorf("create cdc site failed") + return resource.NonRetryableError(e) + } + + response = result + return nil + }) + + if err != nil { + log.Printf("[CRITAL]%s create cdc site failed, reason:%+v", logId, err) + return err + } + + siteId = *response.Response.SiteId + d.SetId(siteId) + + return ResourceTencentCloudCdcSiteRead(d, meta) +} + +func ResourceTencentCloudCdcSiteRead(d *schema.ResourceData, meta interface{}) error { + defer tccommon.LogElapsed("resource.tencentcloud_cdc_site.read")() + + var ( + logId = tccommon.GetLogId(tccommon.ContextNil) + ctx = context.WithValue(context.TODO(), tccommon.LogIdKey, logId) + service = CdcService{client: meta.(tccommon.ProviderMeta).GetAPIV3Conn()} + siteId = d.Id() + ) + + siteDetail, err := service.DescribeCdcSiteDetailById(ctx, siteId) + if err != nil { + return err + } + + if siteDetail == nil { + d.SetId("") + log.Printf("[WARN]%s resource `CdcSite` [%s] not found, please check if it has been deleted.\n", logId, d.Id()) + return nil + } + + if siteDetail.Name != nil { + _ = d.Set("name", siteDetail.Name) + } + + if siteDetail.Country != nil { + _ = d.Set("country", siteDetail.Country) + } + + if siteDetail.Province != nil { + _ = d.Set("province", siteDetail.Province) + } + + if siteDetail.City != nil { + _ = d.Set("city", siteDetail.City) + } + + if siteDetail.AddressLine != nil { + _ = d.Set("address_line", siteDetail.AddressLine) + } + + if siteDetail.Description != nil { + _ = d.Set("description", siteDetail.Description) + } + + //if siteDetail.Note != nil { + // _ = d.Set("note", siteDetail.Note) + //} + + if siteDetail.FiberType != nil { + _ = d.Set("fiber_type", siteDetail.FiberType) + } + + if siteDetail.OpticalStandard != nil { + _ = d.Set("optical_standard", siteDetail.OpticalStandard) + } + + if siteDetail.PowerConnectors != nil { + _ = d.Set("power_connectors", siteDetail.PowerConnectors) + } + + if siteDetail.PowerFeedDrop != nil { + _ = d.Set("power_feed_drop", siteDetail.PowerFeedDrop) + } + + if siteDetail.MaxWeight != nil { + _ = d.Set("max_weight", siteDetail.MaxWeight) + } + + if siteDetail.PowerDrawKva != nil { + _ = d.Set("power_draw_kva", siteDetail.PowerDrawKva) + } + + if siteDetail.UplinkSpeedGbps != nil { + _ = d.Set("uplink_speed_gbps", siteDetail.UplinkSpeedGbps) + } + + if siteDetail.UplinkCount != nil { + _ = d.Set("uplink_count", siteDetail.UplinkCount) + } + + if siteDetail.ConditionRequirement != nil { + _ = d.Set("condition_requirement", siteDetail.ConditionRequirement) + } + + if siteDetail.DimensionRequirement != nil { + _ = d.Set("dimension_requirement", siteDetail.DimensionRequirement) + } + + if siteDetail.RedundantNetworking != nil { + _ = d.Set("redundant_networking", siteDetail.RedundantNetworking) + } + + //if siteDetail.PostalCode != nil { + // _ = d.Set("postal_code", siteDetail.PostalCode) + //} + + if siteDetail.OptionalAddressLine != nil { + _ = d.Set("optional_address_line", siteDetail.OptionalAddressLine) + } + + if siteDetail.NeedHelp != nil { + _ = d.Set("need_help", siteDetail.NeedHelp) + } + + if siteDetail.RedundantPower != nil { + _ = d.Set("redundant_power", siteDetail.RedundantPower) + } + + if siteDetail.BreakerRequirement != nil { + _ = d.Set("breaker_requirement", siteDetail.BreakerRequirement) + } + + return nil +} + +func ResourceTencentCloudCdcSiteUpdate(d *schema.ResourceData, meta interface{}) error { + defer tccommon.LogElapsed("resource.tencentcloud_cdc_site.update")() + + var ( + logId = tccommon.GetLogId(tccommon.ContextNil) + request = cdc.NewModifySiteInfoRequest() + siteId = d.Id() + ) + + immutableArgs := []string{"fiber_type", "optical_standard", "power_connectors", "power_feed_drop", "max_weight", "power_draw_kva", "uplink_speed_gbps", "uplink_count", "condition_requirement", "dimension_requirement", "redundant_networking", "optional_address_line", "need_help", "redundant_power", "breaker_requirement"} + for _, v := range immutableArgs { + if d.HasChange(v) { + return fmt.Errorf("argument `%s` cannot be changed", v) + } + } + + request.SiteId = &siteId + if d.HasChange("name") { + if v, ok := d.GetOk("name"); ok { + request.Name = helper.String(v.(string)) + } + } + + if d.HasChange("country") { + if v, ok := d.GetOk("country"); ok { + request.Country = helper.String(v.(string)) + } + } + + if d.HasChange("province") { + if v, ok := d.GetOk("province"); ok { + request.Province = helper.String(v.(string)) + } + } + + if d.HasChange("city") { + if v, ok := d.GetOk("city"); ok { + request.City = helper.String(v.(string)) + } + } + + if d.HasChange("address_line") { + if v, ok := d.GetOk("address_line"); ok { + request.AddressLine = helper.String(v.(string)) + } + } + + if d.HasChange("description") { + if v, ok := d.GetOk("description"); ok { + request.Description = helper.String(v.(string)) + } + } + + //if d.HasChange("note") { + // if v, ok := d.GetOk("note"); ok { + // request.Note = helper.String(v.(string)) + // } + //} + + //if d.HasChange("postal_code") { + // if v, ok := d.GetOkExists("postal_code"); ok { + // request.PostalCode = helper.String(v.(string)) + // } + //} + + err := resource.Retry(tccommon.WriteRetryTimeout, func() *resource.RetryError { + result, e := meta.(tccommon.ProviderMeta).GetAPIV3Conn().UseCdcClient().ModifySiteInfo(request) + if e != nil { + return tccommon.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 cdc site failed, reason:%+v", logId, err) + return err + } + + return ResourceTencentCloudCdcSiteRead(d, meta) +} + +func ResourceTencentCloudCdcSiteDelete(d *schema.ResourceData, meta interface{}) error { + defer tccommon.LogElapsed("resource.tencentcloud_cdc_site.delete")() + + var ( + logId = tccommon.GetLogId(tccommon.ContextNil) + ctx = context.WithValue(context.TODO(), tccommon.LogIdKey, logId) + service = CdcService{client: meta.(tccommon.ProviderMeta).GetAPIV3Conn()} + siteId = d.Id() + ) + + if err := service.DeleteCdcSiteById(ctx, siteId); err != nil { + return err + } + + return nil +} diff --git a/tencentcloud/services/cdc/resource_tc_cdc_site.md b/tencentcloud/services/cdc/resource_tc_cdc_site.md new file mode 100644 index 0000000000..664943c412 --- /dev/null +++ b/tencentcloud/services/cdc/resource_tc_cdc_site.md @@ -0,0 +1,52 @@ +Provides a resource to create a CDC site + +Example Usage + +Create a basic CDC site + +```hcl +resource "tencentcloud_cdc_site" "example" { + name = "tf-example" + country = "China" + province = "Guangdong Province" + city = "Guangzhou" + address_line = "Tencent Building" + description = "desc." +} +``` + +Create a complete CDC site + +```hcl +resource "tencentcloud_cdc_site" "example" { + name = "tf-example" + country = "China" + province = "Guangdong Province" + city = "Guangzhou" + address_line = "Shenzhen Tencent Building" + optional_address_line = "Shenzhen Tencent Building of Binhai" + description = "desc." + fiber_type = "MM" + optical_standard = "MM" + power_connectors = "380VAC3P" + power_feed_drop = "DOWN" + max_weight = 100 + power_draw_kva = 10 + uplink_speed_gbps = 10 + uplink_count = 2 + condition_requirement = true + dimension_requirement = true + redundant_networking = true + need_help = true + redundant_power = true + breaker_requirement = true +} +``` + +Import + +CDC site can be imported using the id, e.g. + +``` +terraform import tencentcloud_cdc_site.example site-43qcf1ag +``` diff --git a/tencentcloud/services/cdc/resource_tc_cdc_site_test.go b/tencentcloud/services/cdc/resource_tc_cdc_site_test.go new file mode 100644 index 0000000000..7f4e949f76 --- /dev/null +++ b/tencentcloud/services/cdc/resource_tc_cdc_site_test.go @@ -0,0 +1,132 @@ +package cdc + +import ( + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + tcacctest "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/acctest" +) + +// go test -i; go test -test.run TestAccTencentCloudNeedFixCdcSiteResource_basic -v +func TestAccTencentCloudNeedFixCdcSiteResource_basic(t *testing.T) { + t.Parallel() + resource.Test(t, resource.TestCase{ + PreCheck: func() { + tcacctest.AccPreCheck(t) + }, + Providers: tcacctest.AccProviders, + Steps: []resource.TestStep{ + { + Config: testAccCdcSite, + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrSet("tencentcloud_cdc_site.example", "id"), + resource.TestCheckResourceAttrSet("tencentcloud_cdc_site.example", "name"), + resource.TestCheckResourceAttrSet("tencentcloud_cdc_site.example", "country"), + resource.TestCheckResourceAttrSet("tencentcloud_cdc_site.example", "province"), + resource.TestCheckResourceAttrSet("tencentcloud_cdc_site.example", "city"), + resource.TestCheckResourceAttrSet("tencentcloud_cdc_site.example", "address_line"), + resource.TestCheckResourceAttrSet("tencentcloud_cdc_site.example", "optional_address_line"), + resource.TestCheckResourceAttrSet("tencentcloud_cdc_site.example", "description"), + resource.TestCheckResourceAttrSet("tencentcloud_cdc_site.example", "fiber_type"), + resource.TestCheckResourceAttrSet("tencentcloud_cdc_site.example", "optical_standard"), + resource.TestCheckResourceAttrSet("tencentcloud_cdc_site.example", "power_connectors"), + resource.TestCheckResourceAttrSet("tencentcloud_cdc_site.example", "power_feed_drop"), + resource.TestCheckResourceAttrSet("tencentcloud_cdc_site.example", "max_weight"), + resource.TestCheckResourceAttrSet("tencentcloud_cdc_site.example", "power_draw_kva"), + resource.TestCheckResourceAttrSet("tencentcloud_cdc_site.example", "uplink_speed_gbps"), + resource.TestCheckResourceAttrSet("tencentcloud_cdc_site.example", "uplink_count"), + resource.TestCheckResourceAttrSet("tencentcloud_cdc_site.example", "condition_requirement"), + resource.TestCheckResourceAttrSet("tencentcloud_cdc_site.example", "dimension_requirement"), + resource.TestCheckResourceAttrSet("tencentcloud_cdc_site.example", "redundant_networking"), + resource.TestCheckResourceAttrSet("tencentcloud_cdc_site.example", "need_help"), + resource.TestCheckResourceAttrSet("tencentcloud_cdc_site.example", "redundant_power"), + resource.TestCheckResourceAttrSet("tencentcloud_cdc_site.example", "breaker_requirement"), + ), + }, + { + Config: testAccCdcSiteUpdate, + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrSet("tencentcloud_cdc_site.example", "id"), + resource.TestCheckResourceAttrSet("tencentcloud_cdc_site.example", "name"), + resource.TestCheckResourceAttrSet("tencentcloud_cdc_site.example", "country"), + resource.TestCheckResourceAttrSet("tencentcloud_cdc_site.example", "province"), + resource.TestCheckResourceAttrSet("tencentcloud_cdc_site.example", "city"), + resource.TestCheckResourceAttrSet("tencentcloud_cdc_site.example", "address_line"), + resource.TestCheckResourceAttrSet("tencentcloud_cdc_site.example", "optional_address_line"), + resource.TestCheckResourceAttrSet("tencentcloud_cdc_site.example", "description"), + resource.TestCheckResourceAttrSet("tencentcloud_cdc_site.example", "fiber_type"), + resource.TestCheckResourceAttrSet("tencentcloud_cdc_site.example", "optical_standard"), + resource.TestCheckResourceAttrSet("tencentcloud_cdc_site.example", "power_connectors"), + resource.TestCheckResourceAttrSet("tencentcloud_cdc_site.example", "power_feed_drop"), + resource.TestCheckResourceAttrSet("tencentcloud_cdc_site.example", "max_weight"), + resource.TestCheckResourceAttrSet("tencentcloud_cdc_site.example", "power_draw_kva"), + resource.TestCheckResourceAttrSet("tencentcloud_cdc_site.example", "uplink_speed_gbps"), + resource.TestCheckResourceAttrSet("tencentcloud_cdc_site.example", "uplink_count"), + resource.TestCheckResourceAttrSet("tencentcloud_cdc_site.example", "condition_requirement"), + resource.TestCheckResourceAttrSet("tencentcloud_cdc_site.example", "dimension_requirement"), + resource.TestCheckResourceAttrSet("tencentcloud_cdc_site.example", "redundant_networking"), + resource.TestCheckResourceAttrSet("tencentcloud_cdc_site.example", "need_help"), + resource.TestCheckResourceAttrSet("tencentcloud_cdc_site.example", "redundant_power"), + resource.TestCheckResourceAttrSet("tencentcloud_cdc_site.example", "breaker_requirement"), + ), + }, + { + ResourceName: "tencentcloud_cdc_site.example", + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + +const testAccCdcSite = ` +resource "tencentcloud_cdc_site" "example" { + name = "tf-example" + country = "China" + province = "Guangdong Province" + city = "Guangzhou" + address_line = "Shenzhen Tencent Building" + optional_address_line = "Shenzhen Tencent Building of Binhai" + description = "desc." + fiber_type = "MM" + optical_standard = "MM" + power_connectors = "380VAC3P" + power_feed_drop = "DOWN" + max_weight = 100 + power_draw_kva = 10 + uplink_speed_gbps = 10 + uplink_count = 2 + condition_requirement = true + dimension_requirement = true + redundant_networking = true + need_help = true + redundant_power = true + breaker_requirement = true +} +` + +const testAccCdcSiteUpdate = ` +resource "tencentcloud_cdc_site" "example" { + name = "tf-example-update" + country = "China" + province = "Guangdong Province" + city = "Guangzhou" + address_line = "Shenzhen Tencent Building 001" + optional_address_line = "Shenzhen Tencent Building of Binhai 002" + description = "desc update." + fiber_type = "MM" + optical_standard = "MM" + power_connectors = "380VAC3P" + power_feed_drop = "DOWN" + max_weight = 100 + power_draw_kva = 10 + uplink_speed_gbps = 10 + uplink_count = 2 + condition_requirement = true + dimension_requirement = true + redundant_networking = true + need_help = true + redundant_power = true + breaker_requirement = true +} +` diff --git a/tencentcloud/services/cdc/service_tencentcloud_cdc.go b/tencentcloud/services/cdc/service_tencentcloud_cdc.go new file mode 100644 index 0000000000..2b3e629884 --- /dev/null +++ b/tencentcloud/services/cdc/service_tencentcloud_cdc.go @@ -0,0 +1,254 @@ +package cdc + +import ( + "context" + "log" + + cdc "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cdc/v20201214" + tccommon "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/common" + "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/connectivity" + "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/internal/helper" + "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/ratelimit" +) + +type CdcService struct { + client *connectivity.TencentCloudClient +} + +func (me *CdcService) DescribeCdcSiteDetailById(ctx context.Context, siteId string) (siteDetail *cdc.SiteDetail, errRet error) { + logId := tccommon.GetLogId(ctx) + + request := cdc.NewDescribeSitesDetailRequest() + request.SiteIds = helper.Strings([]string{siteId}) + + 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.UseCdcClient().DescribeSitesDetail(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.SiteDetailSet) < 1 { + return + } + + siteDetail = response.Response.SiteDetailSet[0] + return +} + +func (me *CdcService) DeleteCdcSiteById(ctx context.Context, siteId string) (errRet error) { + logId := tccommon.GetLogId(ctx) + + request := cdc.NewDeleteSitesRequest() + request.SiteIds = helper.Strings([]string{siteId}) + + 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.UseCdcClient().DeleteSites(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 *CdcService) DescribeCdcDedicatedClusterById(ctx context.Context, dedicatedClusterId string) (dedicatedCluster *cdc.DedicatedCluster, errRet error) { + logId := tccommon.GetLogId(ctx) + + request := cdc.NewDescribeDedicatedClustersRequest() + request.DedicatedClusterIds = helper.Strings([]string{dedicatedClusterId}) + + 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.UseCdcClient().DescribeDedicatedClusters(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.DedicatedClusterSet) < 1 { + return + } + + dedicatedCluster = response.Response.DedicatedClusterSet[0] + return +} + +func (me *CdcService) DeleteCdcDedicatedClusterById(ctx context.Context, dedicatedClusterId string) (errRet error) { + logId := tccommon.GetLogId(ctx) + + request := cdc.NewDeleteDedicatedClustersRequest() + request.DedicatedClusterIds = helper.Strings([]string{dedicatedClusterId}) + + 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.UseCdcClient().DeleteDedicatedClusters(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 *CdcService) DescribeCdcHostByFilter(ctx context.Context, param map[string]interface{}) (hostList []*cdc.HostInfo, errRet error) { + var ( + logId = tccommon.GetLogId(ctx) + request = cdc.NewDescribeDedicatedClusterHostsRequest() + ) + + 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()) + } + }() + + for k, v := range param { + if k == "DedicatedClusterId" { + request.DedicatedClusterId = v.(*string) + } + } + + ratelimit.Check(request.GetAction()) + var ( + offset uint64 = 0 + limit uint64 = 20 + ) + for { + request.Offset = &offset + request.Limit = &limit + response, err := me.client.UseCdcClient().DescribeDedicatedClusterHosts(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.HostInfoSet) < 1 { + break + } + + hostList = append(hostList, response.Response.HostInfoSet...) + offset += limit + } + + return +} + +func (me *CdcService) DescribeCdcDedicatedClusterInstanceTypesByFilter(ctx context.Context, param map[string]interface{}) (DedicatedClusterInstanceTypes []*cdc.DedicatedClusterInstanceType, errRet error) { + var ( + logId = tccommon.GetLogId(ctx) + request = cdc.NewDescribeDedicatedClusterInstanceTypesRequest() + ) + + 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()) + } + }() + + for k, v := range param { + if k == "DedicatedClusterId" { + request.DedicatedClusterId = v.(*string) + } + } + + ratelimit.Check(request.GetAction()) + + response, err := me.client.UseCdcClient().DescribeDedicatedClusterInstanceTypes(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 len(response.Response.DedicatedClusterInstanceTypeSet) < 1 { + return + } + + DedicatedClusterInstanceTypes = response.Response.DedicatedClusterInstanceTypeSet + return +} + +func (me *CdcService) DescribeCdcDedicatedClusterOrdersByFilter(ctx context.Context, param map[string]interface{}) (dedicatedClusterOrders []*cdc.DedicatedClusterOrder, errRet error) { + var ( + logId = tccommon.GetLogId(ctx) + request = cdc.NewDescribeDedicatedClusterOrdersRequest() + ) + + 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()) + } + }() + + for k, v := range param { + if k == "DedicatedClusterIds" { + request.DedicatedClusterIds = v.([]*string) + } + + //if k == "DedicatedClusterOrderIds" { + // request.DedicatedClusterOrderIds = v.(*string) + //} + + if k == "Status" { + request.Status = v.(*string) + } + + if k == "ActionType" { + request.ActionType = v.(*string) + } + } + + ratelimit.Check(request.GetAction()) + + response, err := me.client.UseCdcClient().DescribeDedicatedClusterOrders(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 len(response.Response.DedicatedClusterOrderSet) < 1 { + return + } + + dedicatedClusterOrders = response.Response.DedicatedClusterOrderSet + return +} diff --git a/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cdc/LICENSE b/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cdc/LICENSE new file mode 100644 index 0000000000..efc75a2253 --- /dev/null +++ b/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cdc/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright (c) 2017-2018 Tencent Ltd. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cdc/v20201214/client.go b/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cdc/v20201214/client.go new file mode 100644 index 0000000000..559d50ed06 --- /dev/null +++ b/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cdc/v20201214/client.go @@ -0,0 +1,1151 @@ +// Copyright (c) 2017-2018 THL A29 Limited, a Tencent company. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package v20201214 + +import ( + "context" + "errors" + "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common" + tchttp "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/http" + "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/profile" +) + +const APIVersion = "2020-12-14" + +type Client struct { + common.Client +} + +// Deprecated +func NewClientWithSecretId(secretId, secretKey, region string) (client *Client, err error) { + cpf := profile.NewClientProfile() + client = &Client{} + client.Init(region).WithSecretId(secretId, secretKey).WithProfile(cpf) + return +} + +func NewClient(credential common.CredentialIface, region string, clientProfile *profile.ClientProfile) (client *Client, err error) { + client = &Client{} + client.Init(region). + WithCredential(credential). + WithProfile(clientProfile) + return +} + + +func NewCreateDedicatedClusterRequest() (request *CreateDedicatedClusterRequest) { + request = &CreateDedicatedClusterRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("cdc", APIVersion, "CreateDedicatedCluster") + + + return +} + +func NewCreateDedicatedClusterResponse() (response *CreateDedicatedClusterResponse) { + response = &CreateDedicatedClusterResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return + +} + +// CreateDedicatedCluster +// 创建专用集群 +// +// 可能返回的错误码: +// FAILEDOPERATION_CDCBINDVPCFAIL = "FailedOperation.CdcBindVpcFail" +// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong" +// INVALIDPARAMETERVALUE_ZONEMISMATCHREGION = "InvalidParameterValue.ZoneMismatchRegion" +// RESOURCENOTFOUND_INVALIDSITEID = "ResourceNotFound.InvalidSiteId" +func (c *Client) CreateDedicatedCluster(request *CreateDedicatedClusterRequest) (response *CreateDedicatedClusterResponse, err error) { + return c.CreateDedicatedClusterWithContext(context.Background(), request) +} + +// CreateDedicatedCluster +// 创建专用集群 +// +// 可能返回的错误码: +// FAILEDOPERATION_CDCBINDVPCFAIL = "FailedOperation.CdcBindVpcFail" +// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong" +// INVALIDPARAMETERVALUE_ZONEMISMATCHREGION = "InvalidParameterValue.ZoneMismatchRegion" +// RESOURCENOTFOUND_INVALIDSITEID = "ResourceNotFound.InvalidSiteId" +func (c *Client) CreateDedicatedClusterWithContext(ctx context.Context, request *CreateDedicatedClusterRequest) (response *CreateDedicatedClusterResponse, err error) { + if request == nil { + request = NewCreateDedicatedClusterRequest() + } + + if c.GetCredential() == nil { + return nil, errors.New("CreateDedicatedCluster require credential") + } + + request.SetContext(ctx) + + response = NewCreateDedicatedClusterResponse() + err = c.Send(request, response) + return +} + +func NewCreateDedicatedClusterOrderRequest() (request *CreateDedicatedClusterOrderRequest) { + request = &CreateDedicatedClusterOrderRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("cdc", APIVersion, "CreateDedicatedClusterOrder") + + + return +} + +func NewCreateDedicatedClusterOrderResponse() (response *CreateDedicatedClusterOrderResponse) { + response = &CreateDedicatedClusterOrderResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return + +} + +// CreateDedicatedClusterOrder +// 创建专用集群订单 +// +// 可能返回的错误码: +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// INVALIDPARAMETERVALUE_INVALIDVALUEDEDICATEDCLUSTERCOSSIZE = "InvalidParameterValue.InvalidValueDedicatedClusterCosSize" +// INVALIDPARAMETERVALUE_INVALIDVALUEDEDICATEDCLUSTERDATASTEPSIZE = "InvalidParameterValue.InvalidValueDedicatedClusterDataStepSize" +// RESOURCENOTFOUND_INVALIDDEDICATEDCLUSTERID = "ResourceNotFound.InvalidDedicatedClusterId" +// RESOURCENOTFOUND_INVALIDDEDICATEDCLUSTERORDERID = "ResourceNotFound.InvalidDedicatedClusterOrderId" +// RESOURCENOTFOUND_INVALIDDEDICATEDCLUSTERTYPEID = "ResourceNotFound.InvalidDedicatedClusterTypeId" +// UNSUPPORTEDOPERATION_NONCUSTOMERAPPIDNOTSUPPORT = "UnsupportedOperation.NonCustomerAppIdNotSupport" +func (c *Client) CreateDedicatedClusterOrder(request *CreateDedicatedClusterOrderRequest) (response *CreateDedicatedClusterOrderResponse, err error) { + return c.CreateDedicatedClusterOrderWithContext(context.Background(), request) +} + +// CreateDedicatedClusterOrder +// 创建专用集群订单 +// +// 可能返回的错误码: +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// INVALIDPARAMETERVALUE_INVALIDVALUEDEDICATEDCLUSTERCOSSIZE = "InvalidParameterValue.InvalidValueDedicatedClusterCosSize" +// INVALIDPARAMETERVALUE_INVALIDVALUEDEDICATEDCLUSTERDATASTEPSIZE = "InvalidParameterValue.InvalidValueDedicatedClusterDataStepSize" +// RESOURCENOTFOUND_INVALIDDEDICATEDCLUSTERID = "ResourceNotFound.InvalidDedicatedClusterId" +// RESOURCENOTFOUND_INVALIDDEDICATEDCLUSTERORDERID = "ResourceNotFound.InvalidDedicatedClusterOrderId" +// RESOURCENOTFOUND_INVALIDDEDICATEDCLUSTERTYPEID = "ResourceNotFound.InvalidDedicatedClusterTypeId" +// UNSUPPORTEDOPERATION_NONCUSTOMERAPPIDNOTSUPPORT = "UnsupportedOperation.NonCustomerAppIdNotSupport" +func (c *Client) CreateDedicatedClusterOrderWithContext(ctx context.Context, request *CreateDedicatedClusterOrderRequest) (response *CreateDedicatedClusterOrderResponse, err error) { + if request == nil { + request = NewCreateDedicatedClusterOrderRequest() + } + + if c.GetCredential() == nil { + return nil, errors.New("CreateDedicatedClusterOrder require credential") + } + + request.SetContext(ctx) + + response = NewCreateDedicatedClusterOrderResponse() + err = c.Send(request, response) + return +} + +func NewCreateSiteRequest() (request *CreateSiteRequest) { + request = &CreateSiteRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("cdc", APIVersion, "CreateSite") + + + return +} + +func NewCreateSiteResponse() (response *CreateSiteResponse) { + response = &CreateSiteResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return + +} + +// CreateSite +// 创建站点 +// +// 可能返回的错误码: +// INVALIDPARAMETERVALUE_INVALIDAPPIDFORMAT = "InvalidParameterValue.InvalidAppIdFormat" +// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong" +func (c *Client) CreateSite(request *CreateSiteRequest) (response *CreateSiteResponse, err error) { + return c.CreateSiteWithContext(context.Background(), request) +} + +// CreateSite +// 创建站点 +// +// 可能返回的错误码: +// INVALIDPARAMETERVALUE_INVALIDAPPIDFORMAT = "InvalidParameterValue.InvalidAppIdFormat" +// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong" +func (c *Client) CreateSiteWithContext(ctx context.Context, request *CreateSiteRequest) (response *CreateSiteResponse, err error) { + if request == nil { + request = NewCreateSiteRequest() + } + + if c.GetCredential() == nil { + return nil, errors.New("CreateSite require credential") + } + + request.SetContext(ctx) + + response = NewCreateSiteResponse() + err = c.Send(request, response) + return +} + +func NewDeleteDedicatedClustersRequest() (request *DeleteDedicatedClustersRequest) { + request = &DeleteDedicatedClustersRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("cdc", APIVersion, "DeleteDedicatedClusters") + + + return +} + +func NewDeleteDedicatedClustersResponse() (response *DeleteDedicatedClustersResponse) { + response = &DeleteDedicatedClustersResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return + +} + +// DeleteDedicatedClusters +// 删除专用集群 +// +// 可能返回的错误码: +// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" +// RESOURCENOTFOUND_INVALIDDEDICATEDCLUSTERID = "ResourceNotFound.InvalidDedicatedClusterId" +func (c *Client) DeleteDedicatedClusters(request *DeleteDedicatedClustersRequest) (response *DeleteDedicatedClustersResponse, err error) { + return c.DeleteDedicatedClustersWithContext(context.Background(), request) +} + +// DeleteDedicatedClusters +// 删除专用集群 +// +// 可能返回的错误码: +// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" +// RESOURCENOTFOUND_INVALIDDEDICATEDCLUSTERID = "ResourceNotFound.InvalidDedicatedClusterId" +func (c *Client) DeleteDedicatedClustersWithContext(ctx context.Context, request *DeleteDedicatedClustersRequest) (response *DeleteDedicatedClustersResponse, err error) { + if request == nil { + request = NewDeleteDedicatedClustersRequest() + } + + if c.GetCredential() == nil { + return nil, errors.New("DeleteDedicatedClusters require credential") + } + + request.SetContext(ctx) + + response = NewDeleteDedicatedClustersResponse() + err = c.Send(request, response) + return +} + +func NewDeleteSitesRequest() (request *DeleteSitesRequest) { + request = &DeleteSitesRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("cdc", APIVersion, "DeleteSites") + + + return +} + +func NewDeleteSitesResponse() (response *DeleteSitesResponse) { + response = &DeleteSitesResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return + +} + +// DeleteSites +// 删除站点 +// +// 可能返回的错误码: +// FAILEDOPERATION_FAILDELETESITE = "FailedOperation.FailDeleteSite" +// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" +// RESOURCENOTFOUND_INVALIDSITEID = "ResourceNotFound.InvalidSiteId" +func (c *Client) DeleteSites(request *DeleteSitesRequest) (response *DeleteSitesResponse, err error) { + return c.DeleteSitesWithContext(context.Background(), request) +} + +// DeleteSites +// 删除站点 +// +// 可能返回的错误码: +// FAILEDOPERATION_FAILDELETESITE = "FailedOperation.FailDeleteSite" +// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" +// RESOURCENOTFOUND_INVALIDSITEID = "ResourceNotFound.InvalidSiteId" +func (c *Client) DeleteSitesWithContext(ctx context.Context, request *DeleteSitesRequest) (response *DeleteSitesResponse, err error) { + if request == nil { + request = NewDeleteSitesRequest() + } + + if c.GetCredential() == nil { + return nil, errors.New("DeleteSites require credential") + } + + request.SetContext(ctx) + + response = NewDeleteSitesResponse() + err = c.Send(request, response) + return +} + +func NewDescribeDedicatedClusterCbsStatisticsRequest() (request *DescribeDedicatedClusterCbsStatisticsRequest) { + request = &DescribeDedicatedClusterCbsStatisticsRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("cdc", APIVersion, "DescribeDedicatedClusterCbsStatistics") + + + return +} + +func NewDescribeDedicatedClusterCbsStatisticsResponse() (response *DescribeDedicatedClusterCbsStatisticsResponse) { + response = &DescribeDedicatedClusterCbsStatisticsResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return + +} + +// DescribeDedicatedClusterCbsStatistics +// 查询本地专用集群云硬盘仓库信息 +// +// 可能返回的错误码: +// FAILEDOPERATION_FAILDELETESITE = "FailedOperation.FailDeleteSite" +// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" +// RESOURCENOTFOUND_INVALIDSITEID = "ResourceNotFound.InvalidSiteId" +func (c *Client) DescribeDedicatedClusterCbsStatistics(request *DescribeDedicatedClusterCbsStatisticsRequest) (response *DescribeDedicatedClusterCbsStatisticsResponse, err error) { + return c.DescribeDedicatedClusterCbsStatisticsWithContext(context.Background(), request) +} + +// DescribeDedicatedClusterCbsStatistics +// 查询本地专用集群云硬盘仓库信息 +// +// 可能返回的错误码: +// FAILEDOPERATION_FAILDELETESITE = "FailedOperation.FailDeleteSite" +// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" +// RESOURCENOTFOUND_INVALIDSITEID = "ResourceNotFound.InvalidSiteId" +func (c *Client) DescribeDedicatedClusterCbsStatisticsWithContext(ctx context.Context, request *DescribeDedicatedClusterCbsStatisticsRequest) (response *DescribeDedicatedClusterCbsStatisticsResponse, err error) { + if request == nil { + request = NewDescribeDedicatedClusterCbsStatisticsRequest() + } + + if c.GetCredential() == nil { + return nil, errors.New("DescribeDedicatedClusterCbsStatistics require credential") + } + + request.SetContext(ctx) + + response = NewDescribeDedicatedClusterCbsStatisticsResponse() + err = c.Send(request, response) + return +} + +func NewDescribeDedicatedClusterCosCapacityRequest() (request *DescribeDedicatedClusterCosCapacityRequest) { + request = &DescribeDedicatedClusterCosCapacityRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("cdc", APIVersion, "DescribeDedicatedClusterCosCapacity") + + + return +} + +func NewDescribeDedicatedClusterCosCapacityResponse() (response *DescribeDedicatedClusterCosCapacityResponse) { + response = &DescribeDedicatedClusterCosCapacityResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return + +} + +// DescribeDedicatedClusterCosCapacity +// 查询专用集群内cos的容量信息 +// +// 可能返回的错误码: +// INVALIDPARAMETERVALUE_INVALIDAPPIDFORMAT = "InvalidParameterValue.InvalidAppIdFormat" +// RESOURCENOTFOUND_INVALIDDEDICATEDCLUSTERID = "ResourceNotFound.InvalidDedicatedClusterId" +func (c *Client) DescribeDedicatedClusterCosCapacity(request *DescribeDedicatedClusterCosCapacityRequest) (response *DescribeDedicatedClusterCosCapacityResponse, err error) { + return c.DescribeDedicatedClusterCosCapacityWithContext(context.Background(), request) +} + +// DescribeDedicatedClusterCosCapacity +// 查询专用集群内cos的容量信息 +// +// 可能返回的错误码: +// INVALIDPARAMETERVALUE_INVALIDAPPIDFORMAT = "InvalidParameterValue.InvalidAppIdFormat" +// RESOURCENOTFOUND_INVALIDDEDICATEDCLUSTERID = "ResourceNotFound.InvalidDedicatedClusterId" +func (c *Client) DescribeDedicatedClusterCosCapacityWithContext(ctx context.Context, request *DescribeDedicatedClusterCosCapacityRequest) (response *DescribeDedicatedClusterCosCapacityResponse, err error) { + if request == nil { + request = NewDescribeDedicatedClusterCosCapacityRequest() + } + + if c.GetCredential() == nil { + return nil, errors.New("DescribeDedicatedClusterCosCapacity require credential") + } + + request.SetContext(ctx) + + response = NewDescribeDedicatedClusterCosCapacityResponse() + err = c.Send(request, response) + return +} + +func NewDescribeDedicatedClusterHostStatisticsRequest() (request *DescribeDedicatedClusterHostStatisticsRequest) { + request = &DescribeDedicatedClusterHostStatisticsRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("cdc", APIVersion, "DescribeDedicatedClusterHostStatistics") + + + return +} + +func NewDescribeDedicatedClusterHostStatisticsResponse() (response *DescribeDedicatedClusterHostStatisticsResponse) { + response = &DescribeDedicatedClusterHostStatisticsResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return + +} + +// DescribeDedicatedClusterHostStatistics +// 查询专用集群内宿主机的统计信息 +// +// 可能返回的错误码: +// INVALIDPARAMETER_INSTANCETYPENOTSUPPORT = "InvalidParameter.InstanceTypeNotSupport" +// INVALIDPARAMETERVALUE_INVALIDAPPIDFORMAT = "InvalidParameterValue.InvalidAppIdFormat" +// RESOURCENOTFOUND_INVALIDDEDICATEDCLUSTERID = "ResourceNotFound.InvalidDedicatedClusterId" +func (c *Client) DescribeDedicatedClusterHostStatistics(request *DescribeDedicatedClusterHostStatisticsRequest) (response *DescribeDedicatedClusterHostStatisticsResponse, err error) { + return c.DescribeDedicatedClusterHostStatisticsWithContext(context.Background(), request) +} + +// DescribeDedicatedClusterHostStatistics +// 查询专用集群内宿主机的统计信息 +// +// 可能返回的错误码: +// INVALIDPARAMETER_INSTANCETYPENOTSUPPORT = "InvalidParameter.InstanceTypeNotSupport" +// INVALIDPARAMETERVALUE_INVALIDAPPIDFORMAT = "InvalidParameterValue.InvalidAppIdFormat" +// RESOURCENOTFOUND_INVALIDDEDICATEDCLUSTERID = "ResourceNotFound.InvalidDedicatedClusterId" +func (c *Client) DescribeDedicatedClusterHostStatisticsWithContext(ctx context.Context, request *DescribeDedicatedClusterHostStatisticsRequest) (response *DescribeDedicatedClusterHostStatisticsResponse, err error) { + if request == nil { + request = NewDescribeDedicatedClusterHostStatisticsRequest() + } + + if c.GetCredential() == nil { + return nil, errors.New("DescribeDedicatedClusterHostStatistics require credential") + } + + request.SetContext(ctx) + + response = NewDescribeDedicatedClusterHostStatisticsResponse() + err = c.Send(request, response) + return +} + +func NewDescribeDedicatedClusterHostsRequest() (request *DescribeDedicatedClusterHostsRequest) { + request = &DescribeDedicatedClusterHostsRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("cdc", APIVersion, "DescribeDedicatedClusterHosts") + + + return +} + +func NewDescribeDedicatedClusterHostsResponse() (response *DescribeDedicatedClusterHostsResponse) { + response = &DescribeDedicatedClusterHostsResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return + +} + +// DescribeDedicatedClusterHosts +// 查询专用集群宿主机信息 +// +// 可能返回的错误码: +// INVALIDPARAMETER_INSTANCETYPENOTSUPPORT = "InvalidParameter.InstanceTypeNotSupport" +// INVALIDPARAMETERVALUE_INVALIDAPPIDFORMAT = "InvalidParameterValue.InvalidAppIdFormat" +// RESOURCENOTFOUND_INVALIDDEDICATEDCLUSTERID = "ResourceNotFound.InvalidDedicatedClusterId" +func (c *Client) DescribeDedicatedClusterHosts(request *DescribeDedicatedClusterHostsRequest) (response *DescribeDedicatedClusterHostsResponse, err error) { + return c.DescribeDedicatedClusterHostsWithContext(context.Background(), request) +} + +// DescribeDedicatedClusterHosts +// 查询专用集群宿主机信息 +// +// 可能返回的错误码: +// INVALIDPARAMETER_INSTANCETYPENOTSUPPORT = "InvalidParameter.InstanceTypeNotSupport" +// INVALIDPARAMETERVALUE_INVALIDAPPIDFORMAT = "InvalidParameterValue.InvalidAppIdFormat" +// RESOURCENOTFOUND_INVALIDDEDICATEDCLUSTERID = "ResourceNotFound.InvalidDedicatedClusterId" +func (c *Client) DescribeDedicatedClusterHostsWithContext(ctx context.Context, request *DescribeDedicatedClusterHostsRequest) (response *DescribeDedicatedClusterHostsResponse, err error) { + if request == nil { + request = NewDescribeDedicatedClusterHostsRequest() + } + + if c.GetCredential() == nil { + return nil, errors.New("DescribeDedicatedClusterHosts require credential") + } + + request.SetContext(ctx) + + response = NewDescribeDedicatedClusterHostsResponse() + err = c.Send(request, response) + return +} + +func NewDescribeDedicatedClusterInstanceTypesRequest() (request *DescribeDedicatedClusterInstanceTypesRequest) { + request = &DescribeDedicatedClusterInstanceTypesRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("cdc", APIVersion, "DescribeDedicatedClusterInstanceTypes") + + + return +} + +func NewDescribeDedicatedClusterInstanceTypesResponse() (response *DescribeDedicatedClusterInstanceTypesResponse) { + response = &DescribeDedicatedClusterInstanceTypesResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return + +} + +// DescribeDedicatedClusterInstanceTypes +// 查询专用集群支持的实例规格列表 +// +// 可能返回的错误码: +// INVALIDPARAMETERVALUE_INVALIDAPPIDFORMAT = "InvalidParameterValue.InvalidAppIdFormat" +// RESOURCENOTFOUND_INVALIDDEDICATEDCLUSTERID = "ResourceNotFound.InvalidDedicatedClusterId" +func (c *Client) DescribeDedicatedClusterInstanceTypes(request *DescribeDedicatedClusterInstanceTypesRequest) (response *DescribeDedicatedClusterInstanceTypesResponse, err error) { + return c.DescribeDedicatedClusterInstanceTypesWithContext(context.Background(), request) +} + +// DescribeDedicatedClusterInstanceTypes +// 查询专用集群支持的实例规格列表 +// +// 可能返回的错误码: +// INVALIDPARAMETERVALUE_INVALIDAPPIDFORMAT = "InvalidParameterValue.InvalidAppIdFormat" +// RESOURCENOTFOUND_INVALIDDEDICATEDCLUSTERID = "ResourceNotFound.InvalidDedicatedClusterId" +func (c *Client) DescribeDedicatedClusterInstanceTypesWithContext(ctx context.Context, request *DescribeDedicatedClusterInstanceTypesRequest) (response *DescribeDedicatedClusterInstanceTypesResponse, err error) { + if request == nil { + request = NewDescribeDedicatedClusterInstanceTypesRequest() + } + + if c.GetCredential() == nil { + return nil, errors.New("DescribeDedicatedClusterInstanceTypes require credential") + } + + request.SetContext(ctx) + + response = NewDescribeDedicatedClusterInstanceTypesResponse() + err = c.Send(request, response) + return +} + +func NewDescribeDedicatedClusterOrdersRequest() (request *DescribeDedicatedClusterOrdersRequest) { + request = &DescribeDedicatedClusterOrdersRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("cdc", APIVersion, "DescribeDedicatedClusterOrders") + + + return +} + +func NewDescribeDedicatedClusterOrdersResponse() (response *DescribeDedicatedClusterOrdersResponse) { + response = &DescribeDedicatedClusterOrdersResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return + +} + +// DescribeDedicatedClusterOrders +// 查询专用集群订单列表 +// +// 可能返回的错误码: +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// INVALIDPARAMETERVALUE_INVALIDAPPIDFORMAT = "InvalidParameterValue.InvalidAppIdFormat" +func (c *Client) DescribeDedicatedClusterOrders(request *DescribeDedicatedClusterOrdersRequest) (response *DescribeDedicatedClusterOrdersResponse, err error) { + return c.DescribeDedicatedClusterOrdersWithContext(context.Background(), request) +} + +// DescribeDedicatedClusterOrders +// 查询专用集群订单列表 +// +// 可能返回的错误码: +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// INVALIDPARAMETERVALUE_INVALIDAPPIDFORMAT = "InvalidParameterValue.InvalidAppIdFormat" +func (c *Client) DescribeDedicatedClusterOrdersWithContext(ctx context.Context, request *DescribeDedicatedClusterOrdersRequest) (response *DescribeDedicatedClusterOrdersResponse, err error) { + if request == nil { + request = NewDescribeDedicatedClusterOrdersRequest() + } + + if c.GetCredential() == nil { + return nil, errors.New("DescribeDedicatedClusterOrders require credential") + } + + request.SetContext(ctx) + + response = NewDescribeDedicatedClusterOrdersResponse() + err = c.Send(request, response) + return +} + +func NewDescribeDedicatedClusterOverviewRequest() (request *DescribeDedicatedClusterOverviewRequest) { + request = &DescribeDedicatedClusterOverviewRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("cdc", APIVersion, "DescribeDedicatedClusterOverview") + + + return +} + +func NewDescribeDedicatedClusterOverviewResponse() (response *DescribeDedicatedClusterOverviewResponse) { + response = &DescribeDedicatedClusterOverviewResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return + +} + +// DescribeDedicatedClusterOverview +// 查询专用集群概览信息 +// +// 可能返回的错误码: +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// INVALIDPARAMETERVALUE_INVALIDAPPIDFORMAT = "InvalidParameterValue.InvalidAppIdFormat" +func (c *Client) DescribeDedicatedClusterOverview(request *DescribeDedicatedClusterOverviewRequest) (response *DescribeDedicatedClusterOverviewResponse, err error) { + return c.DescribeDedicatedClusterOverviewWithContext(context.Background(), request) +} + +// DescribeDedicatedClusterOverview +// 查询专用集群概览信息 +// +// 可能返回的错误码: +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// INVALIDPARAMETERVALUE_INVALIDAPPIDFORMAT = "InvalidParameterValue.InvalidAppIdFormat" +func (c *Client) DescribeDedicatedClusterOverviewWithContext(ctx context.Context, request *DescribeDedicatedClusterOverviewRequest) (response *DescribeDedicatedClusterOverviewResponse, err error) { + if request == nil { + request = NewDescribeDedicatedClusterOverviewRequest() + } + + if c.GetCredential() == nil { + return nil, errors.New("DescribeDedicatedClusterOverview require credential") + } + + request.SetContext(ctx) + + response = NewDescribeDedicatedClusterOverviewResponse() + err = c.Send(request, response) + return +} + +func NewDescribeDedicatedClusterTypesRequest() (request *DescribeDedicatedClusterTypesRequest) { + request = &DescribeDedicatedClusterTypesRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("cdc", APIVersion, "DescribeDedicatedClusterTypes") + + + return +} + +func NewDescribeDedicatedClusterTypesResponse() (response *DescribeDedicatedClusterTypesResponse) { + response = &DescribeDedicatedClusterTypesResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return + +} + +// DescribeDedicatedClusterTypes +// 查询专有集群配置列表 +// +// 可能返回的错误码: +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// INVALIDPARAMETERVALUE_INVALIDAPPIDFORMAT = "InvalidParameterValue.InvalidAppIdFormat" +func (c *Client) DescribeDedicatedClusterTypes(request *DescribeDedicatedClusterTypesRequest) (response *DescribeDedicatedClusterTypesResponse, err error) { + return c.DescribeDedicatedClusterTypesWithContext(context.Background(), request) +} + +// DescribeDedicatedClusterTypes +// 查询专有集群配置列表 +// +// 可能返回的错误码: +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// INVALIDPARAMETERVALUE_INVALIDAPPIDFORMAT = "InvalidParameterValue.InvalidAppIdFormat" +func (c *Client) DescribeDedicatedClusterTypesWithContext(ctx context.Context, request *DescribeDedicatedClusterTypesRequest) (response *DescribeDedicatedClusterTypesResponse, err error) { + if request == nil { + request = NewDescribeDedicatedClusterTypesRequest() + } + + if c.GetCredential() == nil { + return nil, errors.New("DescribeDedicatedClusterTypes require credential") + } + + request.SetContext(ctx) + + response = NewDescribeDedicatedClusterTypesResponse() + err = c.Send(request, response) + return +} + +func NewDescribeDedicatedClustersRequest() (request *DescribeDedicatedClustersRequest) { + request = &DescribeDedicatedClustersRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("cdc", APIVersion, "DescribeDedicatedClusters") + + + return +} + +func NewDescribeDedicatedClustersResponse() (response *DescribeDedicatedClustersResponse) { + response = &DescribeDedicatedClustersResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return + +} + +// DescribeDedicatedClusters +// 查询专用集群列表 +// +// 可能返回的错误码: +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// INVALIDPARAMETERVALUE_INVALIDAPPIDFORMAT = "InvalidParameterValue.InvalidAppIdFormat" +// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" +func (c *Client) DescribeDedicatedClusters(request *DescribeDedicatedClustersRequest) (response *DescribeDedicatedClustersResponse, err error) { + return c.DescribeDedicatedClustersWithContext(context.Background(), request) +} + +// DescribeDedicatedClusters +// 查询专用集群列表 +// +// 可能返回的错误码: +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// INVALIDPARAMETERVALUE_INVALIDAPPIDFORMAT = "InvalidParameterValue.InvalidAppIdFormat" +// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" +func (c *Client) DescribeDedicatedClustersWithContext(ctx context.Context, request *DescribeDedicatedClustersRequest) (response *DescribeDedicatedClustersResponse, err error) { + if request == nil { + request = NewDescribeDedicatedClustersRequest() + } + + if c.GetCredential() == nil { + return nil, errors.New("DescribeDedicatedClusters require credential") + } + + request.SetContext(ctx) + + response = NewDescribeDedicatedClustersResponse() + err = c.Send(request, response) + return +} + +func NewDescribeDedicatedSupportedZonesRequest() (request *DescribeDedicatedSupportedZonesRequest) { + request = &DescribeDedicatedSupportedZonesRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("cdc", APIVersion, "DescribeDedicatedSupportedZones") + + + return +} + +func NewDescribeDedicatedSupportedZonesResponse() (response *DescribeDedicatedSupportedZonesResponse) { + response = &DescribeDedicatedSupportedZonesResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return + +} + +// DescribeDedicatedSupportedZones +// 查询专用集群支持的可用区列表 +// +// 可能返回的错误码: +// INVALIDPARAMETERVALUE_INVALIDVALUEREGION = "InvalidParameterValue.InvalidValueRegion" +// INVALIDPARAMETERVALUE_REGION = "InvalidParameterValue.Region" +// INVALIDPARAMETERVALUE_ZONEMISMATCHREGION = "InvalidParameterValue.ZoneMismatchRegion" +func (c *Client) DescribeDedicatedSupportedZones(request *DescribeDedicatedSupportedZonesRequest) (response *DescribeDedicatedSupportedZonesResponse, err error) { + return c.DescribeDedicatedSupportedZonesWithContext(context.Background(), request) +} + +// DescribeDedicatedSupportedZones +// 查询专用集群支持的可用区列表 +// +// 可能返回的错误码: +// INVALIDPARAMETERVALUE_INVALIDVALUEREGION = "InvalidParameterValue.InvalidValueRegion" +// INVALIDPARAMETERVALUE_REGION = "InvalidParameterValue.Region" +// INVALIDPARAMETERVALUE_ZONEMISMATCHREGION = "InvalidParameterValue.ZoneMismatchRegion" +func (c *Client) DescribeDedicatedSupportedZonesWithContext(ctx context.Context, request *DescribeDedicatedSupportedZonesRequest) (response *DescribeDedicatedSupportedZonesResponse, err error) { + if request == nil { + request = NewDescribeDedicatedSupportedZonesRequest() + } + + if c.GetCredential() == nil { + return nil, errors.New("DescribeDedicatedSupportedZones require credential") + } + + request.SetContext(ctx) + + response = NewDescribeDedicatedSupportedZonesResponse() + err = c.Send(request, response) + return +} + +func NewDescribeSitesRequest() (request *DescribeSitesRequest) { + request = &DescribeSitesRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("cdc", APIVersion, "DescribeSites") + + + return +} + +func NewDescribeSitesResponse() (response *DescribeSitesResponse) { + response = &DescribeSitesResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return + +} + +// DescribeSites +// 查询站点列表 +// +// 可能返回的错误码: +// INVALIDPARAMETERVALUE_INVALIDVALUEREGION = "InvalidParameterValue.InvalidValueRegion" +// INVALIDPARAMETERVALUE_REGION = "InvalidParameterValue.Region" +// INVALIDPARAMETERVALUE_ZONEMISMATCHREGION = "InvalidParameterValue.ZoneMismatchRegion" +func (c *Client) DescribeSites(request *DescribeSitesRequest) (response *DescribeSitesResponse, err error) { + return c.DescribeSitesWithContext(context.Background(), request) +} + +// DescribeSites +// 查询站点列表 +// +// 可能返回的错误码: +// INVALIDPARAMETERVALUE_INVALIDVALUEREGION = "InvalidParameterValue.InvalidValueRegion" +// INVALIDPARAMETERVALUE_REGION = "InvalidParameterValue.Region" +// INVALIDPARAMETERVALUE_ZONEMISMATCHREGION = "InvalidParameterValue.ZoneMismatchRegion" +func (c *Client) DescribeSitesWithContext(ctx context.Context, request *DescribeSitesRequest) (response *DescribeSitesResponse, err error) { + if request == nil { + request = NewDescribeSitesRequest() + } + + if c.GetCredential() == nil { + return nil, errors.New("DescribeSites require credential") + } + + request.SetContext(ctx) + + response = NewDescribeSitesResponse() + err = c.Send(request, response) + return +} + +func NewDescribeSitesDetailRequest() (request *DescribeSitesDetailRequest) { + request = &DescribeSitesDetailRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("cdc", APIVersion, "DescribeSitesDetail") + + + return +} + +func NewDescribeSitesDetailResponse() (response *DescribeSitesDetailResponse) { + response = &DescribeSitesDetailResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return + +} + +// DescribeSitesDetail +// 查询站点详情 +// +// 可能返回的错误码: +// INVALIDPARAMETERVALUE_INVALIDAPPIDFORMAT = "InvalidParameterValue.InvalidAppIdFormat" +func (c *Client) DescribeSitesDetail(request *DescribeSitesDetailRequest) (response *DescribeSitesDetailResponse, err error) { + return c.DescribeSitesDetailWithContext(context.Background(), request) +} + +// DescribeSitesDetail +// 查询站点详情 +// +// 可能返回的错误码: +// INVALIDPARAMETERVALUE_INVALIDAPPIDFORMAT = "InvalidParameterValue.InvalidAppIdFormat" +func (c *Client) DescribeSitesDetailWithContext(ctx context.Context, request *DescribeSitesDetailRequest) (response *DescribeSitesDetailResponse, err error) { + if request == nil { + request = NewDescribeSitesDetailRequest() + } + + if c.GetCredential() == nil { + return nil, errors.New("DescribeSitesDetail require credential") + } + + request.SetContext(ctx) + + response = NewDescribeSitesDetailResponse() + err = c.Send(request, response) + return +} + +func NewModifyDedicatedClusterInfoRequest() (request *ModifyDedicatedClusterInfoRequest) { + request = &ModifyDedicatedClusterInfoRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("cdc", APIVersion, "ModifyDedicatedClusterInfo") + + + return +} + +func NewModifyDedicatedClusterInfoResponse() (response *ModifyDedicatedClusterInfoResponse) { + response = &ModifyDedicatedClusterInfoResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return + +} + +// ModifyDedicatedClusterInfo +// 修改本地专用集群信息 +// +// 可能返回的错误码: +// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong" +// INVALIDPARAMETERVALUE_ZONEMISMATCHREGION = "InvalidParameterValue.ZoneMismatchRegion" +// INVALIDPARAMETERVALUE_ZONENOTSUPPORTED = "InvalidParameterValue.ZoneNotSupported" +// MISSINGPARAMETER = "MissingParameter" +// MISSINGPARAMETER_ATLEASTONE = "MissingParameter.AtLeastOne" +// RESOURCEINSUFFICIENT_CLOUDDISKUNAVAILABLE = "ResourceInsufficient.CloudDiskUnavailable" +// RESOURCENOTFOUND_INVALIDDEDICATEDCLUSTERID = "ResourceNotFound.InvalidDedicatedClusterId" +// RESOURCENOTFOUND_INVALIDSITEID = "ResourceNotFound.InvalidSiteId" +func (c *Client) ModifyDedicatedClusterInfo(request *ModifyDedicatedClusterInfoRequest) (response *ModifyDedicatedClusterInfoResponse, err error) { + return c.ModifyDedicatedClusterInfoWithContext(context.Background(), request) +} + +// ModifyDedicatedClusterInfo +// 修改本地专用集群信息 +// +// 可能返回的错误码: +// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong" +// INVALIDPARAMETERVALUE_ZONEMISMATCHREGION = "InvalidParameterValue.ZoneMismatchRegion" +// INVALIDPARAMETERVALUE_ZONENOTSUPPORTED = "InvalidParameterValue.ZoneNotSupported" +// MISSINGPARAMETER = "MissingParameter" +// MISSINGPARAMETER_ATLEASTONE = "MissingParameter.AtLeastOne" +// RESOURCEINSUFFICIENT_CLOUDDISKUNAVAILABLE = "ResourceInsufficient.CloudDiskUnavailable" +// RESOURCENOTFOUND_INVALIDDEDICATEDCLUSTERID = "ResourceNotFound.InvalidDedicatedClusterId" +// RESOURCENOTFOUND_INVALIDSITEID = "ResourceNotFound.InvalidSiteId" +func (c *Client) ModifyDedicatedClusterInfoWithContext(ctx context.Context, request *ModifyDedicatedClusterInfoRequest) (response *ModifyDedicatedClusterInfoResponse, err error) { + if request == nil { + request = NewModifyDedicatedClusterInfoRequest() + } + + if c.GetCredential() == nil { + return nil, errors.New("ModifyDedicatedClusterInfo require credential") + } + + request.SetContext(ctx) + + response = NewModifyDedicatedClusterInfoResponse() + err = c.Send(request, response) + return +} + +func NewModifyOrderStatusRequest() (request *ModifyOrderStatusRequest) { + request = &ModifyOrderStatusRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("cdc", APIVersion, "ModifyOrderStatus") + + + return +} + +func NewModifyOrderStatusResponse() (response *ModifyOrderStatusResponse) { + response = &ModifyOrderStatusResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return + +} + +// ModifyOrderStatus +// 修改大订单、小订单的状态 +// +// 可能返回的错误码: +// RESOURCENOTFOUND_INVALIDDEDICATEDCLUSTERORDERID = "ResourceNotFound.InvalidDedicatedClusterOrderId" +func (c *Client) ModifyOrderStatus(request *ModifyOrderStatusRequest) (response *ModifyOrderStatusResponse, err error) { + return c.ModifyOrderStatusWithContext(context.Background(), request) +} + +// ModifyOrderStatus +// 修改大订单、小订单的状态 +// +// 可能返回的错误码: +// RESOURCENOTFOUND_INVALIDDEDICATEDCLUSTERORDERID = "ResourceNotFound.InvalidDedicatedClusterOrderId" +func (c *Client) ModifyOrderStatusWithContext(ctx context.Context, request *ModifyOrderStatusRequest) (response *ModifyOrderStatusResponse, err error) { + if request == nil { + request = NewModifyOrderStatusRequest() + } + + if c.GetCredential() == nil { + return nil, errors.New("ModifyOrderStatus require credential") + } + + request.SetContext(ctx) + + response = NewModifyOrderStatusResponse() + err = c.Send(request, response) + return +} + +func NewModifySiteDeviceInfoRequest() (request *ModifySiteDeviceInfoRequest) { + request = &ModifySiteDeviceInfoRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("cdc", APIVersion, "ModifySiteDeviceInfo") + + + return +} + +func NewModifySiteDeviceInfoResponse() (response *ModifySiteDeviceInfoResponse) { + response = &ModifySiteDeviceInfoResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return + +} + +// ModifySiteDeviceInfo +// 修改机房设备信息 +// +// 可能返回的错误码: +// MISSINGPARAMETER_ATLEASTONE = "MissingParameter.AtLeastOne" +func (c *Client) ModifySiteDeviceInfo(request *ModifySiteDeviceInfoRequest) (response *ModifySiteDeviceInfoResponse, err error) { + return c.ModifySiteDeviceInfoWithContext(context.Background(), request) +} + +// ModifySiteDeviceInfo +// 修改机房设备信息 +// +// 可能返回的错误码: +// MISSINGPARAMETER_ATLEASTONE = "MissingParameter.AtLeastOne" +func (c *Client) ModifySiteDeviceInfoWithContext(ctx context.Context, request *ModifySiteDeviceInfoRequest) (response *ModifySiteDeviceInfoResponse, err error) { + if request == nil { + request = NewModifySiteDeviceInfoRequest() + } + + if c.GetCredential() == nil { + return nil, errors.New("ModifySiteDeviceInfo require credential") + } + + request.SetContext(ctx) + + response = NewModifySiteDeviceInfoResponse() + err = c.Send(request, response) + return +} + +func NewModifySiteInfoRequest() (request *ModifySiteInfoRequest) { + request = &ModifySiteInfoRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("cdc", APIVersion, "ModifySiteInfo") + + + return +} + +func NewModifySiteInfoResponse() (response *ModifySiteInfoResponse) { + response = &ModifySiteInfoResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return + +} + +// ModifySiteInfo +// 修改机房信息 +// +// 可能返回的错误码: +// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong" +// MISSINGPARAMETER_ATLEASTONE = "MissingParameter.AtLeastOne" +func (c *Client) ModifySiteInfo(request *ModifySiteInfoRequest) (response *ModifySiteInfoResponse, err error) { + return c.ModifySiteInfoWithContext(context.Background(), request) +} + +// ModifySiteInfo +// 修改机房信息 +// +// 可能返回的错误码: +// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong" +// MISSINGPARAMETER_ATLEASTONE = "MissingParameter.AtLeastOne" +func (c *Client) ModifySiteInfoWithContext(ctx context.Context, request *ModifySiteInfoRequest) (response *ModifySiteInfoResponse, err error) { + if request == nil { + request = NewModifySiteInfoRequest() + } + + if c.GetCredential() == nil { + return nil, errors.New("ModifySiteInfo require credential") + } + + request.SetContext(ctx) + + response = NewModifySiteInfoResponse() + err = c.Send(request, response) + return +} diff --git a/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cdc/v20201214/errors.go b/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cdc/v20201214/errors.go new file mode 100644 index 0000000000..3cab5c23a2 --- /dev/null +++ b/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cdc/v20201214/errors.go @@ -0,0 +1,82 @@ +// Copyright (c) 2017-2018 THL A29 Limited, a Tencent company. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package v20201214 + +const ( + // 此产品的特有错误码 + + // CDC绑定VPC失败。 + FAILEDOPERATION_CDCBINDVPCFAIL = "FailedOperation.CdcBindVpcFail" + + // 删除site失败。 + FAILEDOPERATION_FAILDELETESITE = "FailedOperation.FailDeleteSite" + + // 该机型暂不支持。 + INVALIDPARAMETER_INSTANCETYPENOTSUPPORT = "InvalidParameter.InstanceTypeNotSupport" + + // 参数取值错误。 + INVALIDPARAMETERVALUE = "InvalidParameterValue" + + // 无效的AppId + INVALIDPARAMETERVALUE_INVALIDAPPIDFORMAT = "InvalidParameterValue.InvalidAppIdFormat" + + // 本地专用集群COS大小不正确。 + INVALIDPARAMETERVALUE_INVALIDVALUEDEDICATEDCLUSTERCOSSIZE = "InvalidParameterValue.InvalidValueDedicatedClusterCosSize" + + // CBS大小不正确,它必须是40的整数倍。 + INVALIDPARAMETERVALUE_INVALIDVALUEDEDICATEDCLUSTERDATASTEPSIZE = "InvalidParameterValue.InvalidValueDedicatedClusterDataStepSize" + + // region无效。 + INVALIDPARAMETERVALUE_INVALIDVALUEREGION = "InvalidParameterValue.InvalidValueRegion" + + // 超出大小限制。 + INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" + + // 无效Region ID 。 + INVALIDPARAMETERVALUE_REGION = "InvalidParameterValue.Region" + + // 参数名过长。 + INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong" + + // zone和region不匹配。 + INVALIDPARAMETERVALUE_ZONEMISMATCHREGION = "InvalidParameterValue.ZoneMismatchRegion" + + // 当前可用区暂未支持。 + INVALIDPARAMETERVALUE_ZONENOTSUPPORTED = "InvalidParameterValue.ZoneNotSupported" + + // 缺少参数错误。 + MISSINGPARAMETER = "MissingParameter" + + // 至少输入一个入参。 + MISSINGPARAMETER_ATLEASTONE = "MissingParameter.AtLeastOne" + + // 云硬盘余量不足。 + RESOURCEINSUFFICIENT_CLOUDDISKUNAVAILABLE = "ResourceInsufficient.CloudDiskUnavailable" + + // 该资源没有找到。 + RESOURCENOTFOUND_INVALIDDEDICATEDCLUSTERID = "ResourceNotFound.InvalidDedicatedClusterId" + + // 请确认资源ID 是否存在。 + RESOURCENOTFOUND_INVALIDDEDICATEDCLUSTERORDERID = "ResourceNotFound.InvalidDedicatedClusterOrderId" + + // 该资源没有找到。 + RESOURCENOTFOUND_INVALIDDEDICATEDCLUSTERTYPEID = "ResourceNotFound.InvalidDedicatedClusterTypeId" + + // 站点机房无效。 + RESOURCENOTFOUND_INVALIDSITEID = "ResourceNotFound.InvalidSiteId" + + // 不支持非CUSTOMER类型的app id。 + UNSUPPORTEDOPERATION_NONCUSTOMERAPPIDNOTSUPPORT = "UnsupportedOperation.NonCustomerAppIdNotSupport" +) diff --git a/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cdc/v20201214/models.go b/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cdc/v20201214/models.go new file mode 100644 index 0000000000..28df0ca565 --- /dev/null +++ b/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cdc/v20201214/models.go @@ -0,0 +1,2561 @@ +// Copyright (c) 2017-2018 THL A29 Limited, a Tencent company. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package v20201214 + +import ( + tcerr "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/errors" + tchttp "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/http" + "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/json" +) + +type CbsInfo struct { + // cbs存储大小,单位TB + Size *int64 `json:"Size,omitnil,omitempty" name:"Size"` + + // cbs存储类型,默认为SSD + Type *string `json:"Type,omitnil,omitempty" name:"Type"` +} + +type CosCapacity struct { + // 已购cos的总容量大小,单位GB + TotalCapacity *float64 `json:"TotalCapacity,omitnil,omitempty" name:"TotalCapacity"` + + // 剩余可用cos的容量大小,单位GB + TotalFreeCapacity *float64 `json:"TotalFreeCapacity,omitnil,omitempty" name:"TotalFreeCapacity"` + + // 已用cos的容量大小,单位GB + TotalUsedCapacity *float64 `json:"TotalUsedCapacity,omitnil,omitempty" name:"TotalUsedCapacity"` +} + +type CosInfo struct { + // COS存储大小,单位TB + Size *int64 `json:"Size,omitnil,omitempty" name:"Size"` + + // COS存储类型,默认为cos + Type *string `json:"Type,omitnil,omitempty" name:"Type"` +} + +// Predefined struct for user +type CreateDedicatedClusterOrderRequestParams struct { + // 专用集群id + DedicatedClusterId *string `json:"DedicatedClusterId,omitnil,omitempty" name:"DedicatedClusterId"` + + // order关联的专用集群类型数组 + DedicatedClusterTypes []*DedicatedClusterTypeInfo `json:"DedicatedClusterTypes,omitnil,omitempty" name:"DedicatedClusterTypes"` + + // order关联的cos存储信息 + CosInfo *CosInfo `json:"CosInfo,omitnil,omitempty" name:"CosInfo"` + + // order关联的cbs存储信息 + CbsInfo *CbsInfo `json:"CbsInfo,omitnil,omitempty" name:"CbsInfo"` + + // 购买来源,默认为cloudApi + PurchaseSource *string `json:"PurchaseSource,omitnil,omitempty" name:"PurchaseSource"` + + // 当调用API接口提交订单时,需要提交DedicatedClusterOrderId + DedicatedClusterOrderId *string `json:"DedicatedClusterOrderId,omitnil,omitempty" name:"DedicatedClusterOrderId"` +} + +type CreateDedicatedClusterOrderRequest struct { + *tchttp.BaseRequest + + // 专用集群id + DedicatedClusterId *string `json:"DedicatedClusterId,omitnil,omitempty" name:"DedicatedClusterId"` + + // order关联的专用集群类型数组 + DedicatedClusterTypes []*DedicatedClusterTypeInfo `json:"DedicatedClusterTypes,omitnil,omitempty" name:"DedicatedClusterTypes"` + + // order关联的cos存储信息 + CosInfo *CosInfo `json:"CosInfo,omitnil,omitempty" name:"CosInfo"` + + // order关联的cbs存储信息 + CbsInfo *CbsInfo `json:"CbsInfo,omitnil,omitempty" name:"CbsInfo"` + + // 购买来源,默认为cloudApi + PurchaseSource *string `json:"PurchaseSource,omitnil,omitempty" name:"PurchaseSource"` + + // 当调用API接口提交订单时,需要提交DedicatedClusterOrderId + DedicatedClusterOrderId *string `json:"DedicatedClusterOrderId,omitnil,omitempty" name:"DedicatedClusterOrderId"` +} + +func (r *CreateDedicatedClusterOrderRequest) 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 *CreateDedicatedClusterOrderRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "DedicatedClusterId") + delete(f, "DedicatedClusterTypes") + delete(f, "CosInfo") + delete(f, "CbsInfo") + delete(f, "PurchaseSource") + delete(f, "DedicatedClusterOrderId") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "CreateDedicatedClusterOrderRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type CreateDedicatedClusterOrderResponseParams struct { + // 专用集群订单id + // 注意:此字段可能返回 null,表示取不到有效值。 + DedicatedClusterOrderId *string `json:"DedicatedClusterOrderId,omitnil,omitempty" name:"DedicatedClusterOrderId"` + + // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` +} + +type CreateDedicatedClusterOrderResponse struct { + *tchttp.BaseResponse + Response *CreateDedicatedClusterOrderResponseParams `json:"Response"` +} + +func (r *CreateDedicatedClusterOrderResponse) 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 *CreateDedicatedClusterOrderResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type CreateDedicatedClusterRequestParams struct { + // 专用集群所属的SiteId + SiteId *string `json:"SiteId,omitnil,omitempty" name:"SiteId"` + + // 专用集群的名称 + Name *string `json:"Name,omitnil,omitempty" name:"Name"` + + // 专用集群所属的可用区 + Zone *string `json:"Zone,omitnil,omitempty" name:"Zone"` + + // 专用集群的描述 + Description *string `json:"Description,omitnil,omitempty" name:"Description"` +} + +type CreateDedicatedClusterRequest struct { + *tchttp.BaseRequest + + // 专用集群所属的SiteId + SiteId *string `json:"SiteId,omitnil,omitempty" name:"SiteId"` + + // 专用集群的名称 + Name *string `json:"Name,omitnil,omitempty" name:"Name"` + + // 专用集群所属的可用区 + Zone *string `json:"Zone,omitnil,omitempty" name:"Zone"` + + // 专用集群的描述 + Description *string `json:"Description,omitnil,omitempty" name:"Description"` +} + +func (r *CreateDedicatedClusterRequest) 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 *CreateDedicatedClusterRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "SiteId") + delete(f, "Name") + delete(f, "Zone") + delete(f, "Description") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "CreateDedicatedClusterRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type CreateDedicatedClusterResponseParams struct { + // 创建的专用集群id + DedicatedClusterId *string `json:"DedicatedClusterId,omitnil,omitempty" name:"DedicatedClusterId"` + + // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` +} + +type CreateDedicatedClusterResponse struct { + *tchttp.BaseResponse + Response *CreateDedicatedClusterResponseParams `json:"Response"` +} + +func (r *CreateDedicatedClusterResponse) 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 *CreateDedicatedClusterResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type CreateSiteRequestParams struct { + // 站点名称 + Name *string `json:"Name,omitnil,omitempty" name:"Name"` + + // 站点所在国家 + Country *string `json:"Country,omitnil,omitempty" name:"Country"` + + // 站点所在省份 + Province *string `json:"Province,omitnil,omitempty" name:"Province"` + + // 站点所在城市 + City *string `json:"City,omitnil,omitempty" name:"City"` + + // 站点所在地区的详细地址信息 + AddressLine *string `json:"AddressLine,omitnil,omitempty" name:"AddressLine"` + + // 站点描述 + Description *string `json:"Description,omitnil,omitempty" name:"Description"` + + // 注意事项 + Note *string `json:"Note,omitnil,omitempty" name:"Note"` + + // 您将使用光纤类型将CDC设备连接到网络。有单模和多模两种选项。 + FiberType *string `json:"FiberType,omitnil,omitempty" name:"FiberType"` + + // 您将CDC连接到网络时采用的光学标准。此字段取决于上行链路速度、光纤类型和到上游设备的距离。 + OpticalStandard *string `json:"OpticalStandard,omitnil,omitempty" name:"OpticalStandard"` + + // 电源连接器类型 + PowerConnectors *string `json:"PowerConnectors,omitnil,omitempty" name:"PowerConnectors"` + + // 从机架上方还是下方供电。 + PowerFeedDrop *string `json:"PowerFeedDrop,omitnil,omitempty" name:"PowerFeedDrop"` + + // 最大承重(KG) + MaxWeight *int64 `json:"MaxWeight,omitnil,omitempty" name:"MaxWeight"` + + // 功耗(KW) + PowerDrawKva *int64 `json:"PowerDrawKva,omitnil,omitempty" name:"PowerDrawKva"` + + // 网络到腾讯云Region区域的上行链路速度 + UplinkSpeedGbps *int64 `json:"UplinkSpeedGbps,omitnil,omitempty" name:"UplinkSpeedGbps"` + + // 将CDC连接到网络时,每台CDC网络设备(每个机架 2 台设备)使用的上行链路数量。 + UplinkCount *int64 `json:"UplinkCount,omitnil,omitempty" name:"UplinkCount"` + + // 是否满足下面环境条件: + // 1、场地没有材料要求或验收标准会影响 CDC 设备配送和安装。 + // 2、确定的机架位置包含: + // 温度范围为 41 到 104°F (5 到 40°C)。 + // 湿度范围为 10°F (-12°C)和 8% RH (相对湿度)到 70°F(21°C)和 80% RH。 + // 机架位置的气流方向为从前向后,且应具有足够的 CFM (每分钟立方英尺)。CFM 必须是 CDC 配置的 kVA 功耗值的 145.8 倍。 + ConditionRequirement *bool `json:"ConditionRequirement,omitnil,omitempty" name:"ConditionRequirement"` + + // 是否满足下面的尺寸条件: + // 您的装货站台可以容纳一个机架箱(高 x 宽 x 深 = 94" x 54" x 48")。 + // 您可以提供从机架(高 x 宽 x 深 = 80" x 24" x 48")交货地点到机架最终安置位置的明确通道。测量深度时,应包括站台、走廊通道、门、转弯、坡道、货梯,并将其他通道限制考虑在内。 + // 在最终的 CDC安置位置,前部间隙可以为 48" 或更大,后部间隙可以为 24" 或更大。 + DimensionRequirement *bool `json:"DimensionRequirement,omitnil,omitempty" name:"DimensionRequirement"` + + // 是否提供冗余的上游设备(交换机或路由器),以便两台 网络设备都能连接到网络设备。 + RedundantNetworking *bool `json:"RedundantNetworking,omitnil,omitempty" name:"RedundantNetworking"` + + // 站点所在地区的邮编 + PostalCode *int64 `json:"PostalCode,omitnil,omitempty" name:"PostalCode"` + + // 站点所在地区的详细地址信息(补充) + OptionalAddressLine *string `json:"OptionalAddressLine,omitnil,omitempty" name:"OptionalAddressLine"` + + // 是否需要腾讯云团队协助完成机架支撑工作 + NeedHelp *bool `json:"NeedHelp,omitnil,omitempty" name:"NeedHelp"` + + // 是否电源冗余 + RedundantPower *bool `json:"RedundantPower,omitnil,omitempty" name:"RedundantPower"` + + // 上游断路器是否具备 + BreakerRequirement *bool `json:"BreakerRequirement,omitnil,omitempty" name:"BreakerRequirement"` +} + +type CreateSiteRequest struct { + *tchttp.BaseRequest + + // 站点名称 + Name *string `json:"Name,omitnil,omitempty" name:"Name"` + + // 站点所在国家 + Country *string `json:"Country,omitnil,omitempty" name:"Country"` + + // 站点所在省份 + Province *string `json:"Province,omitnil,omitempty" name:"Province"` + + // 站点所在城市 + City *string `json:"City,omitnil,omitempty" name:"City"` + + // 站点所在地区的详细地址信息 + AddressLine *string `json:"AddressLine,omitnil,omitempty" name:"AddressLine"` + + // 站点描述 + Description *string `json:"Description,omitnil,omitempty" name:"Description"` + + // 注意事项 + Note *string `json:"Note,omitnil,omitempty" name:"Note"` + + // 您将使用光纤类型将CDC设备连接到网络。有单模和多模两种选项。 + FiberType *string `json:"FiberType,omitnil,omitempty" name:"FiberType"` + + // 您将CDC连接到网络时采用的光学标准。此字段取决于上行链路速度、光纤类型和到上游设备的距离。 + OpticalStandard *string `json:"OpticalStandard,omitnil,omitempty" name:"OpticalStandard"` + + // 电源连接器类型 + PowerConnectors *string `json:"PowerConnectors,omitnil,omitempty" name:"PowerConnectors"` + + // 从机架上方还是下方供电。 + PowerFeedDrop *string `json:"PowerFeedDrop,omitnil,omitempty" name:"PowerFeedDrop"` + + // 最大承重(KG) + MaxWeight *int64 `json:"MaxWeight,omitnil,omitempty" name:"MaxWeight"` + + // 功耗(KW) + PowerDrawKva *int64 `json:"PowerDrawKva,omitnil,omitempty" name:"PowerDrawKva"` + + // 网络到腾讯云Region区域的上行链路速度 + UplinkSpeedGbps *int64 `json:"UplinkSpeedGbps,omitnil,omitempty" name:"UplinkSpeedGbps"` + + // 将CDC连接到网络时,每台CDC网络设备(每个机架 2 台设备)使用的上行链路数量。 + UplinkCount *int64 `json:"UplinkCount,omitnil,omitempty" name:"UplinkCount"` + + // 是否满足下面环境条件: + // 1、场地没有材料要求或验收标准会影响 CDC 设备配送和安装。 + // 2、确定的机架位置包含: + // 温度范围为 41 到 104°F (5 到 40°C)。 + // 湿度范围为 10°F (-12°C)和 8% RH (相对湿度)到 70°F(21°C)和 80% RH。 + // 机架位置的气流方向为从前向后,且应具有足够的 CFM (每分钟立方英尺)。CFM 必须是 CDC 配置的 kVA 功耗值的 145.8 倍。 + ConditionRequirement *bool `json:"ConditionRequirement,omitnil,omitempty" name:"ConditionRequirement"` + + // 是否满足下面的尺寸条件: + // 您的装货站台可以容纳一个机架箱(高 x 宽 x 深 = 94" x 54" x 48")。 + // 您可以提供从机架(高 x 宽 x 深 = 80" x 24" x 48")交货地点到机架最终安置位置的明确通道。测量深度时,应包括站台、走廊通道、门、转弯、坡道、货梯,并将其他通道限制考虑在内。 + // 在最终的 CDC安置位置,前部间隙可以为 48" 或更大,后部间隙可以为 24" 或更大。 + DimensionRequirement *bool `json:"DimensionRequirement,omitnil,omitempty" name:"DimensionRequirement"` + + // 是否提供冗余的上游设备(交换机或路由器),以便两台 网络设备都能连接到网络设备。 + RedundantNetworking *bool `json:"RedundantNetworking,omitnil,omitempty" name:"RedundantNetworking"` + + // 站点所在地区的邮编 + PostalCode *int64 `json:"PostalCode,omitnil,omitempty" name:"PostalCode"` + + // 站点所在地区的详细地址信息(补充) + OptionalAddressLine *string `json:"OptionalAddressLine,omitnil,omitempty" name:"OptionalAddressLine"` + + // 是否需要腾讯云团队协助完成机架支撑工作 + NeedHelp *bool `json:"NeedHelp,omitnil,omitempty" name:"NeedHelp"` + + // 是否电源冗余 + RedundantPower *bool `json:"RedundantPower,omitnil,omitempty" name:"RedundantPower"` + + // 上游断路器是否具备 + BreakerRequirement *bool `json:"BreakerRequirement,omitnil,omitempty" name:"BreakerRequirement"` +} + +func (r *CreateSiteRequest) 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 *CreateSiteRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "Name") + delete(f, "Country") + delete(f, "Province") + delete(f, "City") + delete(f, "AddressLine") + delete(f, "Description") + delete(f, "Note") + delete(f, "FiberType") + delete(f, "OpticalStandard") + delete(f, "PowerConnectors") + delete(f, "PowerFeedDrop") + delete(f, "MaxWeight") + delete(f, "PowerDrawKva") + delete(f, "UplinkSpeedGbps") + delete(f, "UplinkCount") + delete(f, "ConditionRequirement") + delete(f, "DimensionRequirement") + delete(f, "RedundantNetworking") + delete(f, "PostalCode") + delete(f, "OptionalAddressLine") + delete(f, "NeedHelp") + delete(f, "RedundantPower") + delete(f, "BreakerRequirement") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "CreateSiteRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type CreateSiteResponseParams struct { + // 创建Site生成的id + SiteId *string `json:"SiteId,omitnil,omitempty" name:"SiteId"` + + // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` +} + +type CreateSiteResponse struct { + *tchttp.BaseResponse + Response *CreateSiteResponseParams `json:"Response"` +} + +func (r *CreateSiteResponse) 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 *CreateSiteResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +type DedicatedCluster struct { + // 专用集群id。如"cluster-xxxxx"。 + DedicatedClusterId *string `json:"DedicatedClusterId,omitnil,omitempty" name:"DedicatedClusterId"` + + // 专用集群所属可用区名称。 + Zone *string `json:"Zone,omitnil,omitempty" name:"Zone"` + + // 专用集群的描述。 + // 注意:此字段可能返回 null,表示取不到有效值。 + Description *string `json:"Description,omitnil,omitempty" name:"Description"` + + // 专用集群的名称。 + Name *string `json:"Name,omitnil,omitempty" name:"Name"` + + // 专用集群的生命周期。如"PENDING"。 + LifecycleStatus *string `json:"LifecycleStatus,omitnil,omitempty" name:"LifecycleStatus"` + + // 专用集群的创建时间。 + CreateTime *string `json:"CreateTime,omitnil,omitempty" name:"CreateTime"` + + // 专用集群所属的站点id。 + SiteId *string `json:"SiteId,omitnil,omitempty" name:"SiteId"` +} + +type DedicatedClusterInstanceType struct { + // 可用区 + Zone *string `json:"Zone,omitnil,omitempty" name:"Zone"` + + // 规格名称 + InstanceType *string `json:"InstanceType,omitnil,omitempty" name:"InstanceType"` + + // 网卡类型,例如:25代表25G网卡 + NetworkCard *int64 `json:"NetworkCard,omitnil,omitempty" name:"NetworkCard"` + + // 实例的CPU核数,单位:核。 + Cpu *int64 `json:"Cpu,omitnil,omitempty" name:"Cpu"` + + // 实例内存容量,单位:`GB`。 + Memory *int64 `json:"Memory,omitnil,omitempty" name:"Memory"` + + // 实例机型系列。 + InstanceFamily *string `json:"InstanceFamily,omitnil,omitempty" name:"InstanceFamily"` + + // 机型名称。 + TypeName *string `json:"TypeName,omitnil,omitempty" name:"TypeName"` + + // 本地存储块数量。 + StorageBlockAmount *int64 `json:"StorageBlockAmount,omitnil,omitempty" name:"StorageBlockAmount"` + + // 内网带宽,单位Gbps。 + InstanceBandwidth *float64 `json:"InstanceBandwidth,omitnil,omitempty" name:"InstanceBandwidth"` + + // 网络收发包能力,单位万PPS。 + InstancePps *int64 `json:"InstancePps,omitnil,omitempty" name:"InstancePps"` + + // 处理器型号。 + CpuType *string `json:"CpuType,omitnil,omitempty" name:"CpuType"` + + // 实例的GPU数量。 + Gpu *int64 `json:"Gpu,omitnil,omitempty" name:"Gpu"` + + // 实例的FPGA数量。 + Fpga *int64 `json:"Fpga,omitnil,omitempty" name:"Fpga"` + + // 机型描述 + Remark *string `json:"Remark,omitnil,omitempty" name:"Remark"` + + // 实例是否售卖。取值范围:
  • SELL:表示实例可购买
  • SOLD_OUT:表示实例已售罄。 + Status *string `json:"Status,omitnil,omitempty" name:"Status"` +} + +type DedicatedClusterOrder struct { + // 专用集群id + DedicatedClusterId *string `json:"DedicatedClusterId,omitnil,omitempty" name:"DedicatedClusterId"` + + // 专用集群类型id(移到下一层级,已经废弃,后续将删除) + DedicatedClusterTypeId *string `json:"DedicatedClusterTypeId,omitnil,omitempty" name:"DedicatedClusterTypeId"` + + // 支持的存储类型列表(移到下一层级,已经废弃,后续将删除) + SupportedStorageType []*string `json:"SupportedStorageType,omitnil,omitempty" name:"SupportedStorageType"` + + // 支持的上连交换机的链路传输速率(GiB)(移到下一层级,已经废弃,后续将删除) + SupportedUplinkSpeed []*int64 `json:"SupportedUplinkSpeed,omitnil,omitempty" name:"SupportedUplinkSpeed"` + + // 支持的实例族列表(移到下一层级,已经废弃,后续将删除) + SupportedInstanceFamily []*string `json:"SupportedInstanceFamily,omitnil,omitempty" name:"SupportedInstanceFamily"` + + // 地板承重要求(KG) + Weight *int64 `json:"Weight,omitnil,omitempty" name:"Weight"` + + // 功率要求(KW) + PowerDraw *float64 `json:"PowerDraw,omitnil,omitempty" name:"PowerDraw"` + + // 订单状态 + OrderStatus *string `json:"OrderStatus,omitnil,omitempty" name:"OrderStatus"` + + // 订单创建的时间 + CreateTime *string `json:"CreateTime,omitnil,omitempty" name:"CreateTime"` + + // 大订单ID + DedicatedClusterOrderId *string `json:"DedicatedClusterOrderId,omitnil,omitempty" name:"DedicatedClusterOrderId"` + + // 订单类型,创建CREATE或扩容EXTEND + Action *string `json:"Action,omitnil,omitempty" name:"Action"` + + // 子订单详情列表 + // 注意:此字段可能返回 null,表示取不到有效值。 + DedicatedClusterOrderItems []*DedicatedClusterOrderItem `json:"DedicatedClusterOrderItems,omitnil,omitempty" name:"DedicatedClusterOrderItems"` + + // cpu值 + // 注意:此字段可能返回 null,表示取不到有效值。 + Cpu *int64 `json:"Cpu,omitnil,omitempty" name:"Cpu"` + + // mem值 + // 注意:此字段可能返回 null,表示取不到有效值。 + Mem *int64 `json:"Mem,omitnil,omitempty" name:"Mem"` + + // gpu值 + // 注意:此字段可能返回 null,表示取不到有效值。 + Gpu *int64 `json:"Gpu,omitnil,omitempty" name:"Gpu"` + + // 0代表未支付,1代表已支付 + // 注意:此字段可能返回 null,表示取不到有效值。 + PayStatus *int64 `json:"PayStatus,omitnil,omitempty" name:"PayStatus"` + + // 支付方式,一次性、按月、按年 + // 注意:此字段可能返回 null,表示取不到有效值。 + PayType *string `json:"PayType,omitnil,omitempty" name:"PayType"` + + // 购买时长的单位 + // 注意:此字段可能返回 null,表示取不到有效值。 + TimeUnit *string `json:"TimeUnit,omitnil,omitempty" name:"TimeUnit"` + + // 购买时长 + // 注意:此字段可能返回 null,表示取不到有效值。 + TimeSpan *int64 `json:"TimeSpan,omitnil,omitempty" name:"TimeSpan"` + + // 订单类型 + // 注意:此字段可能返回 null,表示取不到有效值。 + OrderType *string `json:"OrderType,omitnil,omitempty" name:"OrderType"` + + // 验收状态 + // 注意:此字段可能返回 null,表示取不到有效值。 + CheckStatus *string `json:"CheckStatus,omitnil,omitempty" name:"CheckStatus"` + + // 交付预期时间 + // 注意:此字段可能返回 null,表示取不到有效值。 + DeliverExpectTime *string `json:"DeliverExpectTime,omitnil,omitempty" name:"DeliverExpectTime"` + + // 交付实际完成时间 + // 注意:此字段可能返回 null,表示取不到有效值。 + DeliverFinishTime *string `json:"DeliverFinishTime,omitnil,omitempty" name:"DeliverFinishTime"` + + // 验收预期时间 + // 注意:此字段可能返回 null,表示取不到有效值。 + CheckExpectTime *string `json:"CheckExpectTime,omitnil,omitempty" name:"CheckExpectTime"` + + // 验收实际完成时间 + // 注意:此字段可能返回 null,表示取不到有效值。 + CheckFinishTime *string `json:"CheckFinishTime,omitnil,omitempty" name:"CheckFinishTime"` + + // 订单SLA + // 注意:此字段可能返回 null,表示取不到有效值。 + OrderSLA *string `json:"OrderSLA,omitnil,omitempty" name:"OrderSLA"` + + // 订单支付计划 + // 注意:此字段可能返回 null,表示取不到有效值。 + OrderPayPlan *string `json:"OrderPayPlan,omitnil,omitempty" name:"OrderPayPlan"` +} + +type DedicatedClusterOrderItem struct { + // 专用集群类型id + DedicatedClusterTypeId *string `json:"DedicatedClusterTypeId,omitnil,omitempty" name:"DedicatedClusterTypeId"` + + // 支持的存储类型列表 + SupportedStorageType []*string `json:"SupportedStorageType,omitnil,omitempty" name:"SupportedStorageType"` + + // 支持的上连交换机的链路传输速率(GiB) + SupportedUplinkSpeed []*int64 `json:"SupportedUplinkSpeed,omitnil,omitempty" name:"SupportedUplinkSpeed"` + + // 支持的实例族列表 + SupportedInstanceFamily []*string `json:"SupportedInstanceFamily,omitnil,omitempty" name:"SupportedInstanceFamily"` + + // 地板承重要求(KG) + Weight *int64 `json:"Weight,omitnil,omitempty" name:"Weight"` + + // 功率要求(KW) + PowerDraw *float64 `json:"PowerDraw,omitnil,omitempty" name:"PowerDraw"` + + // 订单状态 + SubOrderStatus *string `json:"SubOrderStatus,omitnil,omitempty" name:"SubOrderStatus"` + + // 订单创建的时间 + CreateTime *string `json:"CreateTime,omitnil,omitempty" name:"CreateTime"` + + // 子订单ID + SubOrderId *string `json:"SubOrderId,omitnil,omitempty" name:"SubOrderId"` + + // 关联的集群规格数量 + Count *int64 `json:"Count,omitnil,omitempty" name:"Count"` + + // 规格简单描述 + Name *string `json:"Name,omitnil,omitempty" name:"Name"` + + // 规格详细描述 + Description *string `json:"Description,omitnil,omitempty" name:"Description"` + + // CPU数 + TotalCpu *int64 `json:"TotalCpu,omitnil,omitempty" name:"TotalCpu"` + + // 内存数 + TotalMem *int64 `json:"TotalMem,omitnil,omitempty" name:"TotalMem"` + + // GPU数 + TotalGpu *int64 `json:"TotalGpu,omitnil,omitempty" name:"TotalGpu"` + + // 规格英文名 + TypeName *string `json:"TypeName,omitnil,omitempty" name:"TypeName"` + + // 规格展示 + // 注意:此字段可能返回 null,表示取不到有效值。 + ComputeFormat *string `json:"ComputeFormat,omitnil,omitempty" name:"ComputeFormat"` + + // 规格类型 + // 注意:此字段可能返回 null,表示取不到有效值。 + TypeFamily *string `json:"TypeFamily,omitnil,omitempty" name:"TypeFamily"` + + // 0未支付,1已支付 + // 注意:此字段可能返回 null,表示取不到有效值。 + SubOrderPayStatus *int64 `json:"SubOrderPayStatus,omitnil,omitempty" name:"SubOrderPayStatus"` +} + +type DedicatedClusterType struct { + // 配置id + DedicatedClusterTypeId *string `json:"DedicatedClusterTypeId,omitnil,omitempty" name:"DedicatedClusterTypeId"` + + // 配置描述,对应描述 + // 注意:此字段可能返回 null,表示取不到有效值。 + Description *string `json:"Description,omitnil,omitempty" name:"Description"` + + // 配置名称,对应计算资源类型 + Name *string `json:"Name,omitnil,omitempty" name:"Name"` + + // 创建配置的时间 + CreateTime *string `json:"CreateTime,omitnil,omitempty" name:"CreateTime"` + + // 支持的存储类型列表 + SupportedStorageType []*string `json:"SupportedStorageType,omitnil,omitempty" name:"SupportedStorageType"` + + // 支持的上连交换机的链路传输速率 + SupportedUplinkGiB []*int64 `json:"SupportedUplinkGiB,omitnil,omitempty" name:"SupportedUplinkGiB"` + + // 支持的实例族列表 + SupportedInstanceFamily []*string `json:"SupportedInstanceFamily,omitnil,omitempty" name:"SupportedInstanceFamily"` + + // 地板承重要求(KG) + Weight *int64 `json:"Weight,omitnil,omitempty" name:"Weight"` + + // 功率要求(KW) + PowerDrawKva *float64 `json:"PowerDrawKva,omitnil,omitempty" name:"PowerDrawKva"` + + // 显示计算资源规格详情,存储等资源不显示 + ComputeFormatDesc *string `json:"ComputeFormatDesc,omitnil,omitempty" name:"ComputeFormatDesc"` +} + +type DedicatedClusterTypeInfo struct { + // 集群类型Id + Id *string `json:"Id,omitnil,omitempty" name:"Id"` + + // 集群类型个数 + Count *int64 `json:"Count,omitnil,omitempty" name:"Count"` +} + +// Predefined struct for user +type DeleteDedicatedClustersRequestParams struct { + // 要删除的专用集群id + DedicatedClusterIds []*string `json:"DedicatedClusterIds,omitnil,omitempty" name:"DedicatedClusterIds"` +} + +type DeleteDedicatedClustersRequest struct { + *tchttp.BaseRequest + + // 要删除的专用集群id + DedicatedClusterIds []*string `json:"DedicatedClusterIds,omitnil,omitempty" name:"DedicatedClusterIds"` +} + +func (r *DeleteDedicatedClustersRequest) 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 *DeleteDedicatedClustersRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "DedicatedClusterIds") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DeleteDedicatedClustersRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DeleteDedicatedClustersResponseParams struct { + // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` +} + +type DeleteDedicatedClustersResponse struct { + *tchttp.BaseResponse + Response *DeleteDedicatedClustersResponseParams `json:"Response"` +} + +func (r *DeleteDedicatedClustersResponse) 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 *DeleteDedicatedClustersResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DeleteSitesRequestParams struct { + // 要删除的站点id列表 + SiteIds []*string `json:"SiteIds,omitnil,omitempty" name:"SiteIds"` +} + +type DeleteSitesRequest struct { + *tchttp.BaseRequest + + // 要删除的站点id列表 + SiteIds []*string `json:"SiteIds,omitnil,omitempty" name:"SiteIds"` +} + +func (r *DeleteSitesRequest) 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 *DeleteSitesRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "SiteIds") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DeleteSitesRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DeleteSitesResponseParams struct { + // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` +} + +type DeleteSitesResponse struct { + *tchttp.BaseResponse + Response *DeleteSitesResponseParams `json:"Response"` +} + +func (r *DeleteSitesResponse) 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 *DeleteSitesResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DescribeDedicatedClusterCbsStatisticsRequestParams struct { + // 查询的专用集群id + DedicatedClusterId *string `json:"DedicatedClusterId,omitnil,omitempty" name:"DedicatedClusterId"` + + // 云硬盘仓库id + SetId *string `json:"SetId,omitnil,omitempty" name:"SetId"` + + // 开始时间 + StartTime *string `json:"StartTime,omitnil,omitempty" name:"StartTime"` + + // 结束时间 + EndTime *string `json:"EndTime,omitnil,omitempty" name:"EndTime"` + + // 时间范围精度,1分钟/5分钟 + Period *string `json:"Period,omitnil,omitempty" name:"Period"` + + // 偏移量,默认为0。 + Offset *uint64 `json:"Offset,omitnil,omitempty" name:"Offset"` + + // 返回数量,默认为20 + Limit *uint64 `json:"Limit,omitnil,omitempty" name:"Limit"` +} + +type DescribeDedicatedClusterCbsStatisticsRequest struct { + *tchttp.BaseRequest + + // 查询的专用集群id + DedicatedClusterId *string `json:"DedicatedClusterId,omitnil,omitempty" name:"DedicatedClusterId"` + + // 云硬盘仓库id + SetId *string `json:"SetId,omitnil,omitempty" name:"SetId"` + + // 开始时间 + StartTime *string `json:"StartTime,omitnil,omitempty" name:"StartTime"` + + // 结束时间 + EndTime *string `json:"EndTime,omitnil,omitempty" name:"EndTime"` + + // 时间范围精度,1分钟/5分钟 + Period *string `json:"Period,omitnil,omitempty" name:"Period"` + + // 偏移量,默认为0。 + Offset *uint64 `json:"Offset,omitnil,omitempty" name:"Offset"` + + // 返回数量,默认为20 + Limit *uint64 `json:"Limit,omitnil,omitempty" name:"Limit"` +} + +func (r *DescribeDedicatedClusterCbsStatisticsRequest) 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 *DescribeDedicatedClusterCbsStatisticsRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "DedicatedClusterId") + delete(f, "SetId") + delete(f, "StartTime") + delete(f, "EndTime") + delete(f, "Period") + delete(f, "Offset") + delete(f, "Limit") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeDedicatedClusterCbsStatisticsRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DescribeDedicatedClusterCbsStatisticsResponseParams struct { + // 云硬盘仓库信息 + // 注意:此字段可能返回 null,表示取不到有效值。 + SetList []*SetInfo `json:"SetList,omitnil,omitempty" name:"SetList"` + + // 总数 + // 注意:此字段可能返回 null,表示取不到有效值。 + TotalCount *uint64 `json:"TotalCount,omitnil,omitempty" name:"TotalCount"` + + // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` +} + +type DescribeDedicatedClusterCbsStatisticsResponse struct { + *tchttp.BaseResponse + Response *DescribeDedicatedClusterCbsStatisticsResponseParams `json:"Response"` +} + +func (r *DescribeDedicatedClusterCbsStatisticsResponse) 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 *DescribeDedicatedClusterCbsStatisticsResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DescribeDedicatedClusterCosCapacityRequestParams struct { + // 查询的专用集群id + DedicatedClusterId *string `json:"DedicatedClusterId,omitnil,omitempty" name:"DedicatedClusterId"` +} + +type DescribeDedicatedClusterCosCapacityRequest struct { + *tchttp.BaseRequest + + // 查询的专用集群id + DedicatedClusterId *string `json:"DedicatedClusterId,omitnil,omitempty" name:"DedicatedClusterId"` +} + +func (r *DescribeDedicatedClusterCosCapacityRequest) 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 *DescribeDedicatedClusterCosCapacityRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "DedicatedClusterId") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeDedicatedClusterCosCapacityRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DescribeDedicatedClusterCosCapacityResponseParams struct { + // 本集群内cos容量信息,单位:‘GB’ + CosCapacity *CosCapacity `json:"CosCapacity,omitnil,omitempty" name:"CosCapacity"` + + // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` +} + +type DescribeDedicatedClusterCosCapacityResponse struct { + *tchttp.BaseResponse + Response *DescribeDedicatedClusterCosCapacityResponseParams `json:"Response"` +} + +func (r *DescribeDedicatedClusterCosCapacityResponse) 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 *DescribeDedicatedClusterCosCapacityResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DescribeDedicatedClusterHostStatisticsRequestParams struct { + // 查询的专用集群id + DedicatedClusterId *string `json:"DedicatedClusterId,omitnil,omitempty" name:"DedicatedClusterId"` + + // 宿主机id + HostId *string `json:"HostId,omitnil,omitempty" name:"HostId"` + + // 开始时间 + StartTime *string `json:"StartTime,omitnil,omitempty" name:"StartTime"` + + // 结束时间 + EndTime *string `json:"EndTime,omitnil,omitempty" name:"EndTime"` + + // 时间范围精度,1分钟/5分钟 + Period *string `json:"Period,omitnil,omitempty" name:"Period"` +} + +type DescribeDedicatedClusterHostStatisticsRequest struct { + *tchttp.BaseRequest + + // 查询的专用集群id + DedicatedClusterId *string `json:"DedicatedClusterId,omitnil,omitempty" name:"DedicatedClusterId"` + + // 宿主机id + HostId *string `json:"HostId,omitnil,omitempty" name:"HostId"` + + // 开始时间 + StartTime *string `json:"StartTime,omitnil,omitempty" name:"StartTime"` + + // 结束时间 + EndTime *string `json:"EndTime,omitnil,omitempty" name:"EndTime"` + + // 时间范围精度,1分钟/5分钟 + Period *string `json:"Period,omitnil,omitempty" name:"Period"` +} + +func (r *DescribeDedicatedClusterHostStatisticsRequest) 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 *DescribeDedicatedClusterHostStatisticsRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "DedicatedClusterId") + delete(f, "HostId") + delete(f, "StartTime") + delete(f, "EndTime") + delete(f, "Period") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeDedicatedClusterHostStatisticsRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DescribeDedicatedClusterHostStatisticsResponseParams struct { + // 该集群内宿主机的统计信息列表 + HostStatisticSet []*HostStatistic `json:"HostStatisticSet,omitnil,omitempty" name:"HostStatisticSet"` + + // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` +} + +type DescribeDedicatedClusterHostStatisticsResponse struct { + *tchttp.BaseResponse + Response *DescribeDedicatedClusterHostStatisticsResponseParams `json:"Response"` +} + +func (r *DescribeDedicatedClusterHostStatisticsResponse) 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 *DescribeDedicatedClusterHostStatisticsResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DescribeDedicatedClusterHostsRequestParams struct { + // 集群id + DedicatedClusterId *string `json:"DedicatedClusterId,omitnil,omitempty" name:"DedicatedClusterId"` + + // 偏移量,默认为0。 + Offset *uint64 `json:"Offset,omitnil,omitempty" name:"Offset"` + + // 返回数量,默认为20 + Limit *uint64 `json:"Limit,omitnil,omitempty" name:"Limit"` +} + +type DescribeDedicatedClusterHostsRequest struct { + *tchttp.BaseRequest + + // 集群id + DedicatedClusterId *string `json:"DedicatedClusterId,omitnil,omitempty" name:"DedicatedClusterId"` + + // 偏移量,默认为0。 + Offset *uint64 `json:"Offset,omitnil,omitempty" name:"Offset"` + + // 返回数量,默认为20 + Limit *uint64 `json:"Limit,omitnil,omitempty" name:"Limit"` +} + +func (r *DescribeDedicatedClusterHostsRequest) 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 *DescribeDedicatedClusterHostsRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "DedicatedClusterId") + delete(f, "Offset") + delete(f, "Limit") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeDedicatedClusterHostsRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DescribeDedicatedClusterHostsResponseParams struct { + // 宿主机信息 + // 注意:此字段可能返回 null,表示取不到有效值。 + HostInfoSet []*HostInfo `json:"HostInfoSet,omitnil,omitempty" name:"HostInfoSet"` + + // 宿主机总数 + TotalCount *uint64 `json:"TotalCount,omitnil,omitempty" name:"TotalCount"` + + // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` +} + +type DescribeDedicatedClusterHostsResponse struct { + *tchttp.BaseResponse + Response *DescribeDedicatedClusterHostsResponseParams `json:"Response"` +} + +func (r *DescribeDedicatedClusterHostsResponse) 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 *DescribeDedicatedClusterHostsResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DescribeDedicatedClusterInstanceTypesRequestParams struct { + // 查询的专用集群id + DedicatedClusterId *string `json:"DedicatedClusterId,omitnil,omitempty" name:"DedicatedClusterId"` +} + +type DescribeDedicatedClusterInstanceTypesRequest struct { + *tchttp.BaseRequest + + // 查询的专用集群id + DedicatedClusterId *string `json:"DedicatedClusterId,omitnil,omitempty" name:"DedicatedClusterId"` +} + +func (r *DescribeDedicatedClusterInstanceTypesRequest) 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 *DescribeDedicatedClusterInstanceTypesRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "DedicatedClusterId") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeDedicatedClusterInstanceTypesRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DescribeDedicatedClusterInstanceTypesResponseParams struct { + // 支持的实例规格列表 + DedicatedClusterInstanceTypeSet []*DedicatedClusterInstanceType `json:"DedicatedClusterInstanceTypeSet,omitnil,omitempty" name:"DedicatedClusterInstanceTypeSet"` + + // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` +} + +type DescribeDedicatedClusterInstanceTypesResponse struct { + *tchttp.BaseResponse + Response *DescribeDedicatedClusterInstanceTypesResponseParams `json:"Response"` +} + +func (r *DescribeDedicatedClusterInstanceTypesResponse) 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 *DescribeDedicatedClusterInstanceTypesResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DescribeDedicatedClusterOrdersRequestParams struct { + // 按照专用集群id过滤 + DedicatedClusterIds []*string `json:"DedicatedClusterIds,omitnil,omitempty" name:"DedicatedClusterIds"` + + // 按照专用集群订单id过滤 + DedicatedClusterOrderIds *string `json:"DedicatedClusterOrderIds,omitnil,omitempty" name:"DedicatedClusterOrderIds"` + + // 偏移量,默认为0。关于`Offset`的更进一步介绍请参考 API [简介](https://cloud.tencent.com/document/api/213/15688)中的相关小节。 + Offset *int64 `json:"Offset,omitnil,omitempty" name:"Offset"` + + // 返回数量,默认为20,最大值为100。关于`Limit`的更进一步介绍请参考 API [简介](https://cloud.tencent.com/document/api/213/15688)中的相关小节。 + Limit *int64 `json:"Limit,omitnil,omitempty" name:"Limit"` + + // 订单状态为过滤条件:PENDING INCONSTRUCTION DELIVERING DELIVERED EXPIRED CANCELLED OFFLINE + Status *string `json:"Status,omitnil,omitempty" name:"Status"` + + // 订单类型为过滤条件:CREATE EXTEND + ActionType *string `json:"ActionType,omitnil,omitempty" name:"ActionType"` + + // 订单类型列表 + OrderTypes []*string `json:"OrderTypes,omitnil,omitempty" name:"OrderTypes"` +} + +type DescribeDedicatedClusterOrdersRequest struct { + *tchttp.BaseRequest + + // 按照专用集群id过滤 + DedicatedClusterIds []*string `json:"DedicatedClusterIds,omitnil,omitempty" name:"DedicatedClusterIds"` + + // 按照专用集群订单id过滤 + DedicatedClusterOrderIds *string `json:"DedicatedClusterOrderIds,omitnil,omitempty" name:"DedicatedClusterOrderIds"` + + // 偏移量,默认为0。关于`Offset`的更进一步介绍请参考 API [简介](https://cloud.tencent.com/document/api/213/15688)中的相关小节。 + Offset *int64 `json:"Offset,omitnil,omitempty" name:"Offset"` + + // 返回数量,默认为20,最大值为100。关于`Limit`的更进一步介绍请参考 API [简介](https://cloud.tencent.com/document/api/213/15688)中的相关小节。 + Limit *int64 `json:"Limit,omitnil,omitempty" name:"Limit"` + + // 订单状态为过滤条件:PENDING INCONSTRUCTION DELIVERING DELIVERED EXPIRED CANCELLED OFFLINE + Status *string `json:"Status,omitnil,omitempty" name:"Status"` + + // 订单类型为过滤条件:CREATE EXTEND + ActionType *string `json:"ActionType,omitnil,omitempty" name:"ActionType"` + + // 订单类型列表 + OrderTypes []*string `json:"OrderTypes,omitnil,omitempty" name:"OrderTypes"` +} + +func (r *DescribeDedicatedClusterOrdersRequest) 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 *DescribeDedicatedClusterOrdersRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "DedicatedClusterIds") + delete(f, "DedicatedClusterOrderIds") + delete(f, "Offset") + delete(f, "Limit") + delete(f, "Status") + delete(f, "ActionType") + delete(f, "OrderTypes") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeDedicatedClusterOrdersRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DescribeDedicatedClusterOrdersResponseParams struct { + // 专用集群订单列表 + DedicatedClusterOrderSet []*DedicatedClusterOrder `json:"DedicatedClusterOrderSet,omitnil,omitempty" name:"DedicatedClusterOrderSet"` + + // 符合条件的专用集群订单总数 + TotalCount *int64 `json:"TotalCount,omitnil,omitempty" name:"TotalCount"` + + // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` +} + +type DescribeDedicatedClusterOrdersResponse struct { + *tchttp.BaseResponse + Response *DescribeDedicatedClusterOrdersResponseParams `json:"Response"` +} + +func (r *DescribeDedicatedClusterOrdersResponse) 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 *DescribeDedicatedClusterOrdersResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DescribeDedicatedClusterOverviewRequestParams struct { + // 集群id + DedicatedClusterId *string `json:"DedicatedClusterId,omitnil,omitempty" name:"DedicatedClusterId"` +} + +type DescribeDedicatedClusterOverviewRequest struct { + *tchttp.BaseRequest + + // 集群id + DedicatedClusterId *string `json:"DedicatedClusterId,omitnil,omitempty" name:"DedicatedClusterId"` +} + +func (r *DescribeDedicatedClusterOverviewRequest) 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 *DescribeDedicatedClusterOverviewRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "DedicatedClusterId") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeDedicatedClusterOverviewRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DescribeDedicatedClusterOverviewResponseParams struct { + // 云服务器数量 + CvmCount *uint64 `json:"CvmCount,omitnil,omitempty" name:"CvmCount"` + + // 宿主机数量 + HostCount *uint64 `json:"HostCount,omitnil,omitempty" name:"HostCount"` + + // vpn通道状态 + // 注意:此字段可能返回 null,表示取不到有效值。 + VpnConnectionState *string `json:"VpnConnectionState,omitnil,omitempty" name:"VpnConnectionState"` + + // vpn网关监控数据 + // 注意:此字段可能返回 null,表示取不到有效值。 + VpngwBandwidthData *VpngwBandwidthData `json:"VpngwBandwidthData,omitnil,omitempty" name:"VpngwBandwidthData"` + + // 本地网关信息 + // 注意:此字段可能返回 null,表示取不到有效值。 + LocalNetInfo *LocalNetInfo `json:"LocalNetInfo,omitnil,omitempty" name:"LocalNetInfo"` + + // vpn网关通道监控数据 + // 注意:此字段可能返回 null,表示取不到有效值。 + VpnConnectionBandwidthData []*VpngwBandwidthData `json:"VpnConnectionBandwidthData,omitnil,omitempty" name:"VpnConnectionBandwidthData"` + + // 宿主机资源概览信息 + // 注意:此字段可能返回 null,表示取不到有效值。 + HostDetailInfo []*HostDetailInfo `json:"HostDetailInfo,omitnil,omitempty" name:"HostDetailInfo"` + + // 热备宿主机数量 + // 注意:此字段可能返回 null,表示取不到有效值。 + HostStandbyCount *uint64 `json:"HostStandbyCount,omitnil,omitempty" name:"HostStandbyCount"` + + // 普通宿主机数量 + // 注意:此字段可能返回 null,表示取不到有效值。 + HostNormalCount *uint64 `json:"HostNormalCount,omitnil,omitempty" name:"HostNormalCount"` + + // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` +} + +type DescribeDedicatedClusterOverviewResponse struct { + *tchttp.BaseResponse + Response *DescribeDedicatedClusterOverviewResponseParams `json:"Response"` +} + +func (r *DescribeDedicatedClusterOverviewResponse) 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 *DescribeDedicatedClusterOverviewResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DescribeDedicatedClusterTypesRequestParams struct { + // 模糊匹配专用集群配置名称 + Name *string `json:"Name,omitnil,omitempty" name:"Name"` + + // 待查询的专用集群配置id列表 + DedicatedClusterTypeIds []*string `json:"DedicatedClusterTypeIds,omitnil,omitempty" name:"DedicatedClusterTypeIds"` + + // 偏移量,默认为0。关于`Offset`的更进一步介绍请参考 API [简介](https://cloud.tencent.com/document/api/213/15688)中的相关小节。 + Offset *int64 `json:"Offset,omitnil,omitempty" name:"Offset"` + + // 返回数量,默认为20,最大值为100。关于`Limit`的更进一步介绍请参考 API [简介](https://cloud.tencent.com/document/api/213/15688)中的相关小节。 + Limit *int64 `json:"Limit,omitnil,omitempty" name:"Limit"` + + // 是否只查询计算规格类型 + IsCompute *bool `json:"IsCompute,omitnil,omitempty" name:"IsCompute"` +} + +type DescribeDedicatedClusterTypesRequest struct { + *tchttp.BaseRequest + + // 模糊匹配专用集群配置名称 + Name *string `json:"Name,omitnil,omitempty" name:"Name"` + + // 待查询的专用集群配置id列表 + DedicatedClusterTypeIds []*string `json:"DedicatedClusterTypeIds,omitnil,omitempty" name:"DedicatedClusterTypeIds"` + + // 偏移量,默认为0。关于`Offset`的更进一步介绍请参考 API [简介](https://cloud.tencent.com/document/api/213/15688)中的相关小节。 + Offset *int64 `json:"Offset,omitnil,omitempty" name:"Offset"` + + // 返回数量,默认为20,最大值为100。关于`Limit`的更进一步介绍请参考 API [简介](https://cloud.tencent.com/document/api/213/15688)中的相关小节。 + Limit *int64 `json:"Limit,omitnil,omitempty" name:"Limit"` + + // 是否只查询计算规格类型 + IsCompute *bool `json:"IsCompute,omitnil,omitempty" name:"IsCompute"` +} + +func (r *DescribeDedicatedClusterTypesRequest) 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 *DescribeDedicatedClusterTypesRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "Name") + delete(f, "DedicatedClusterTypeIds") + delete(f, "Offset") + delete(f, "Limit") + delete(f, "IsCompute") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeDedicatedClusterTypesRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DescribeDedicatedClusterTypesResponseParams struct { + // 专用集群配置列表 + DedicatedClusterTypeSet []*DedicatedClusterType `json:"DedicatedClusterTypeSet,omitnil,omitempty" name:"DedicatedClusterTypeSet"` + + // 符合条件的个数 + TotalCount *int64 `json:"TotalCount,omitnil,omitempty" name:"TotalCount"` + + // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` +} + +type DescribeDedicatedClusterTypesResponse struct { + *tchttp.BaseResponse + Response *DescribeDedicatedClusterTypesResponseParams `json:"Response"` +} + +func (r *DescribeDedicatedClusterTypesResponse) 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 *DescribeDedicatedClusterTypesResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DescribeDedicatedClustersRequestParams struct { + // 按照一个或者多个实例ID查询。实例ID形如:`cluster-xxxxxxxx` + DedicatedClusterIds []*string `json:"DedicatedClusterIds,omitnil,omitempty" name:"DedicatedClusterIds"` + + // 按照可用区名称过滤 + Zones []*string `json:"Zones,omitnil,omitempty" name:"Zones"` + + // 按照站点id过滤 + SiteIds []*string `json:"SiteIds,omitnil,omitempty" name:"SiteIds"` + + // 按照专用集群生命周期过滤 + LifecycleStatuses []*string `json:"LifecycleStatuses,omitnil,omitempty" name:"LifecycleStatuses"` + + // 模糊匹配专用集群名称 + Name *string `json:"Name,omitnil,omitempty" name:"Name"` + + // 偏移量,默认为0。关于`Offset`的更进一步介绍请参考 API [简介](https://cloud.tencent.com/document/api/213/15688)中的相关小节。 + Offset *int64 `json:"Offset,omitnil,omitempty" name:"Offset"` + + // 返回数量,默认为20,最大值为100。关于`Limit`的更进一步介绍请参考 API [简介](https://cloud.tencent.com/document/api/213/15688)中的相关小节。 + Limit *int64 `json:"Limit,omitnil,omitempty" name:"Limit"` +} + +type DescribeDedicatedClustersRequest struct { + *tchttp.BaseRequest + + // 按照一个或者多个实例ID查询。实例ID形如:`cluster-xxxxxxxx` + DedicatedClusterIds []*string `json:"DedicatedClusterIds,omitnil,omitempty" name:"DedicatedClusterIds"` + + // 按照可用区名称过滤 + Zones []*string `json:"Zones,omitnil,omitempty" name:"Zones"` + + // 按照站点id过滤 + SiteIds []*string `json:"SiteIds,omitnil,omitempty" name:"SiteIds"` + + // 按照专用集群生命周期过滤 + LifecycleStatuses []*string `json:"LifecycleStatuses,omitnil,omitempty" name:"LifecycleStatuses"` + + // 模糊匹配专用集群名称 + Name *string `json:"Name,omitnil,omitempty" name:"Name"` + + // 偏移量,默认为0。关于`Offset`的更进一步介绍请参考 API [简介](https://cloud.tencent.com/document/api/213/15688)中的相关小节。 + Offset *int64 `json:"Offset,omitnil,omitempty" name:"Offset"` + + // 返回数量,默认为20,最大值为100。关于`Limit`的更进一步介绍请参考 API [简介](https://cloud.tencent.com/document/api/213/15688)中的相关小节。 + Limit *int64 `json:"Limit,omitnil,omitempty" name:"Limit"` +} + +func (r *DescribeDedicatedClustersRequest) 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 *DescribeDedicatedClustersRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "DedicatedClusterIds") + delete(f, "Zones") + delete(f, "SiteIds") + delete(f, "LifecycleStatuses") + delete(f, "Name") + delete(f, "Offset") + delete(f, "Limit") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeDedicatedClustersRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DescribeDedicatedClustersResponseParams struct { + // 符合查询条件的专用集群列表 + DedicatedClusterSet []*DedicatedCluster `json:"DedicatedClusterSet,omitnil,omitempty" name:"DedicatedClusterSet"` + + // 符合条件的专用集群数量。 + TotalCount *int64 `json:"TotalCount,omitnil,omitempty" name:"TotalCount"` + + // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` +} + +type DescribeDedicatedClustersResponse struct { + *tchttp.BaseResponse + Response *DescribeDedicatedClustersResponseParams `json:"Response"` +} + +func (r *DescribeDedicatedClustersResponse) 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 *DescribeDedicatedClustersResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DescribeDedicatedSupportedZonesRequestParams struct { + // 传入region列表 + Regions []*int64 `json:"Regions,omitnil,omitempty" name:"Regions"` +} + +type DescribeDedicatedSupportedZonesRequest struct { + *tchttp.BaseRequest + + // 传入region列表 + Regions []*int64 `json:"Regions,omitnil,omitempty" name:"Regions"` +} + +func (r *DescribeDedicatedSupportedZonesRequest) 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 *DescribeDedicatedSupportedZonesRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "Regions") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeDedicatedSupportedZonesRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DescribeDedicatedSupportedZonesResponseParams struct { + // 支持的可用区列表 + ZoneSet []*RegionZoneInfo `json:"ZoneSet,omitnil,omitempty" name:"ZoneSet"` + + // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` +} + +type DescribeDedicatedSupportedZonesResponse struct { + *tchttp.BaseResponse + Response *DescribeDedicatedSupportedZonesResponseParams `json:"Response"` +} + +func (r *DescribeDedicatedSupportedZonesResponse) 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 *DescribeDedicatedSupportedZonesResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DescribeSitesDetailRequestParams struct { + // 按照站点id过滤 + SiteIds []*string `json:"SiteIds,omitnil,omitempty" name:"SiteIds"` + + // 偏移量,默认为0。关于`Offset`的更进一步介绍请参考 API [简介](https://cloud.tencent.com/document/api/213/15688)中的相关小节。 + Offset *int64 `json:"Offset,omitnil,omitempty" name:"Offset"` + + // 返回数量,默认为20,最大值为100。关于`Limit`的更进一步介绍请参考 API [简介](https://cloud.tencent.com/document/api/213/15688)中的相关小节。 + Limit *int64 `json:"Limit,omitnil,omitempty" name:"Limit"` + + // 按照站定名称模糊匹配 + Name *string `json:"Name,omitnil,omitempty" name:"Name"` +} + +type DescribeSitesDetailRequest struct { + *tchttp.BaseRequest + + // 按照站点id过滤 + SiteIds []*string `json:"SiteIds,omitnil,omitempty" name:"SiteIds"` + + // 偏移量,默认为0。关于`Offset`的更进一步介绍请参考 API [简介](https://cloud.tencent.com/document/api/213/15688)中的相关小节。 + Offset *int64 `json:"Offset,omitnil,omitempty" name:"Offset"` + + // 返回数量,默认为20,最大值为100。关于`Limit`的更进一步介绍请参考 API [简介](https://cloud.tencent.com/document/api/213/15688)中的相关小节。 + Limit *int64 `json:"Limit,omitnil,omitempty" name:"Limit"` + + // 按照站定名称模糊匹配 + Name *string `json:"Name,omitnil,omitempty" name:"Name"` +} + +func (r *DescribeSitesDetailRequest) 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 *DescribeSitesDetailRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "SiteIds") + delete(f, "Offset") + delete(f, "Limit") + delete(f, "Name") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeSitesDetailRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DescribeSitesDetailResponseParams struct { + // 站点详情 + SiteDetailSet []*SiteDetail `json:"SiteDetailSet,omitnil,omitempty" name:"SiteDetailSet"` + + // 符合条件的站点总数 + TotalCount *int64 `json:"TotalCount,omitnil,omitempty" name:"TotalCount"` + + // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` +} + +type DescribeSitesDetailResponse struct { + *tchttp.BaseResponse + Response *DescribeSitesDetailResponseParams `json:"Response"` +} + +func (r *DescribeSitesDetailResponse) 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 *DescribeSitesDetailResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DescribeSitesRequestParams struct { + // 按照站点id过滤 + SiteIds []*string `json:"SiteIds,omitnil,omitempty" name:"SiteIds"` + + // 模糊匹配站点名称 + Name *string `json:"Name,omitnil,omitempty" name:"Name"` + + // 偏移量,默认为0。关于`Offset`的更进一步介绍请参考 API [简介](https://cloud.tencent.com/document/api/213/15688)中的相关小节。 + Offset *int64 `json:"Offset,omitnil,omitempty" name:"Offset"` + + // 返回数量,默认为20,最大值为100。关于`Limit`的更进一步介绍请参考 API [简介](https://cloud.tencent.com/document/api/213/15688)中的相关小节。 + Limit *int64 `json:"Limit,omitnil,omitempty" name:"Limit"` +} + +type DescribeSitesRequest struct { + *tchttp.BaseRequest + + // 按照站点id过滤 + SiteIds []*string `json:"SiteIds,omitnil,omitempty" name:"SiteIds"` + + // 模糊匹配站点名称 + Name *string `json:"Name,omitnil,omitempty" name:"Name"` + + // 偏移量,默认为0。关于`Offset`的更进一步介绍请参考 API [简介](https://cloud.tencent.com/document/api/213/15688)中的相关小节。 + Offset *int64 `json:"Offset,omitnil,omitempty" name:"Offset"` + + // 返回数量,默认为20,最大值为100。关于`Limit`的更进一步介绍请参考 API [简介](https://cloud.tencent.com/document/api/213/15688)中的相关小节。 + Limit *int64 `json:"Limit,omitnil,omitempty" name:"Limit"` +} + +func (r *DescribeSitesRequest) 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 *DescribeSitesRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "SiteIds") + delete(f, "Name") + delete(f, "Offset") + delete(f, "Limit") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeSitesRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DescribeSitesResponseParams struct { + // 符合查询条件的站点列表 + SiteSet []*Site `json:"SiteSet,omitnil,omitempty" name:"SiteSet"` + + // 符合条件的站点数量。 + TotalCount *int64 `json:"TotalCount,omitnil,omitempty" name:"TotalCount"` + + // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` +} + +type DescribeSitesResponse struct { + *tchttp.BaseResponse + Response *DescribeSitesResponseParams `json:"Response"` +} + +func (r *DescribeSitesResponse) 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 *DescribeSitesResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +type DetailData struct { + // 时间戳 + // 注意:此字段可能返回 null,表示取不到有效值。 + Timestamps []*float64 `json:"Timestamps,omitnil,omitempty" name:"Timestamps"` + + // 对应的具体值 + // 注意:此字段可能返回 null,表示取不到有效值。 + Values []*float64 `json:"Values,omitnil,omitempty" name:"Values"` +} + +type HostDetailInfo struct { + // 类型族 + // 注意:此字段可能返回 null,表示取不到有效值。 + HostTypeFamily *string `json:"HostTypeFamily,omitnil,omitempty" name:"HostTypeFamily"` + + // 总CPU + // 注意:此字段可能返回 null,表示取不到有效值。 + CpuTotal *float64 `json:"CpuTotal,omitnil,omitempty" name:"CpuTotal"` + + // 可用CPU + // 注意:此字段可能返回 null,表示取不到有效值。 + CpuAvailable *float64 `json:"CpuAvailable,omitnil,omitempty" name:"CpuAvailable"` + + // 总内存 + // 注意:此字段可能返回 null,表示取不到有效值。 + MemTotal *float64 `json:"MemTotal,omitnil,omitempty" name:"MemTotal"` + + // 可用内存 + // 注意:此字段可能返回 null,表示取不到有效值。 + MemAvailable *float64 `json:"MemAvailable,omitnil,omitempty" name:"MemAvailable"` +} + +type HostInfo struct { + // 宿主机IP(废弃) + HostIp *string `json:"HostIp,omitnil,omitempty" name:"HostIp"` + + // 云服务类型 + ServiceType *string `json:"ServiceType,omitnil,omitempty" name:"ServiceType"` + + // 宿主机运行状态 + HostStatus *string `json:"HostStatus,omitnil,omitempty" name:"HostStatus"` + + // 宿主机类型 + HostType *string `json:"HostType,omitnil,omitempty" name:"HostType"` + + // cpu可用数 + CpuAvailable *uint64 `json:"CpuAvailable,omitnil,omitempty" name:"CpuAvailable"` + + // cpu总数 + CpuTotal *uint64 `json:"CpuTotal,omitnil,omitempty" name:"CpuTotal"` + + // 内存可用数 + MemAvailable *uint64 `json:"MemAvailable,omitnil,omitempty" name:"MemAvailable"` + + // 内存总数 + MemTotal *uint64 `json:"MemTotal,omitnil,omitempty" name:"MemTotal"` + + // 运行时间 + RunTime *string `json:"RunTime,omitnil,omitempty" name:"RunTime"` + + // 到期时间 + ExpireTime *string `json:"ExpireTime,omitnil,omitempty" name:"ExpireTime"` + + // 宿主机id + // 注意:此字段可能返回 null,表示取不到有效值。 + HostId *string `json:"HostId,omitnil,omitempty" name:"HostId"` +} + +type HostStatistic struct { + // 宿主机规格 + HostType *string `json:"HostType,omitnil,omitempty" name:"HostType"` + + // 宿主机机型系列 + HostFamily *string `json:"HostFamily,omitnil,omitempty" name:"HostFamily"` + + // 宿主机的CPU核数,单位:核 + Cpu *uint64 `json:"Cpu,omitnil,omitempty" name:"Cpu"` + + // 宿主机内存大小,单位:GB + Memory *uint64 `json:"Memory,omitnil,omitempty" name:"Memory"` + + // 该规格宿主机的数量 + Count *uint64 `json:"Count,omitnil,omitempty" name:"Count"` + + // 平均cpu负载百分比 + // 注意:此字段可能返回 null,表示取不到有效值。 + CpuAverage *float64 `json:"CpuAverage,omitnil,omitempty" name:"CpuAverage"` + + // 平均内存使用率百分比 + // 注意:此字段可能返回 null,表示取不到有效值。 + MemAverage *float64 `json:"MemAverage,omitnil,omitempty" name:"MemAverage"` + + // 平均网络流量 + // 注意:此字段可能返回 null,表示取不到有效值。 + NetAverage *float64 `json:"NetAverage,omitnil,omitempty" name:"NetAverage"` + + // cpu详细监控数据 + // 注意:此字段可能返回 null,表示取不到有效值。 + CpuDetailData *DetailData `json:"CpuDetailData,omitnil,omitempty" name:"CpuDetailData"` + + // 内存详细数据 + // 注意:此字段可能返回 null,表示取不到有效值。 + MemDetailData *DetailData `json:"MemDetailData,omitnil,omitempty" name:"MemDetailData"` + + // 网络速率详细数据 + // 注意:此字段可能返回 null,表示取不到有效值。 + NetRateDetailData *DetailData `json:"NetRateDetailData,omitnil,omitempty" name:"NetRateDetailData"` + + // 网速包详细数据 + // 注意:此字段可能返回 null,表示取不到有效值。 + NetPacketDetailData *DetailData `json:"NetPacketDetailData,omitnil,omitempty" name:"NetPacketDetailData"` +} + +type InBandwidth struct { + // 时间戳 + // 注意:此字段可能返回 null,表示取不到有效值。 + Timestamps []*float64 `json:"Timestamps,omitnil,omitempty" name:"Timestamps"` + + // 时间对应的值 + // 注意:此字段可能返回 null,表示取不到有效值。 + Values []*float64 `json:"Values,omitnil,omitempty" name:"Values"` +} + +type LocalNetInfo struct { + // 协议 + // 注意:此字段可能返回 null,表示取不到有效值。 + Protocol *string `json:"Protocol,omitnil,omitempty" name:"Protocol"` + + // 网络id + // 注意:此字段可能返回 null,表示取不到有效值。 + VpcId *string `json:"VpcId,omitnil,omitempty" name:"VpcId"` + + // 路由信息 + // 注意:此字段可能返回 null,表示取不到有效值。 + BGPRoute *string `json:"BGPRoute,omitnil,omitempty" name:"BGPRoute"` + + // 本地IP + // 注意:此字段可能返回 null,表示取不到有效值。 + LocalIp *string `json:"LocalIp,omitnil,omitempty" name:"LocalIp"` +} + +// Predefined struct for user +type ModifyDedicatedClusterInfoRequestParams struct { + // 本地专用集群ID + DedicatedClusterId *string `json:"DedicatedClusterId,omitnil,omitempty" name:"DedicatedClusterId"` + + // 集群的新名称 + Name *string `json:"Name,omitnil,omitempty" name:"Name"` + + // 集群的新可用区 + Zone *string `json:"Zone,omitnil,omitempty" name:"Zone"` + + // 集群的新描述信息 + Description *string `json:"Description,omitnil,omitempty" name:"Description"` + + // 集群所在站点 + SiteId *string `json:"SiteId,omitnil,omitempty" name:"SiteId"` +} + +type ModifyDedicatedClusterInfoRequest struct { + *tchttp.BaseRequest + + // 本地专用集群ID + DedicatedClusterId *string `json:"DedicatedClusterId,omitnil,omitempty" name:"DedicatedClusterId"` + + // 集群的新名称 + Name *string `json:"Name,omitnil,omitempty" name:"Name"` + + // 集群的新可用区 + Zone *string `json:"Zone,omitnil,omitempty" name:"Zone"` + + // 集群的新描述信息 + Description *string `json:"Description,omitnil,omitempty" name:"Description"` + + // 集群所在站点 + SiteId *string `json:"SiteId,omitnil,omitempty" name:"SiteId"` +} + +func (r *ModifyDedicatedClusterInfoRequest) 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 *ModifyDedicatedClusterInfoRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "DedicatedClusterId") + delete(f, "Name") + delete(f, "Zone") + delete(f, "Description") + delete(f, "SiteId") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ModifyDedicatedClusterInfoRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type ModifyDedicatedClusterInfoResponseParams struct { + // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` +} + +type ModifyDedicatedClusterInfoResponse struct { + *tchttp.BaseResponse + Response *ModifyDedicatedClusterInfoResponseParams `json:"Response"` +} + +func (r *ModifyDedicatedClusterInfoResponse) 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 *ModifyDedicatedClusterInfoResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type ModifyOrderStatusRequestParams struct { + // 要更新成的状态 + Status *string `json:"Status,omitnil,omitempty" name:"Status"` + + // 大订单ID + DedicatedClusterOrderId *string `json:"DedicatedClusterOrderId,omitnil,omitempty" name:"DedicatedClusterOrderId"` + + // 小订单ID + SubOrderIds []*string `json:"SubOrderIds,omitnil,omitempty" name:"SubOrderIds"` +} + +type ModifyOrderStatusRequest struct { + *tchttp.BaseRequest + + // 要更新成的状态 + Status *string `json:"Status,omitnil,omitempty" name:"Status"` + + // 大订单ID + DedicatedClusterOrderId *string `json:"DedicatedClusterOrderId,omitnil,omitempty" name:"DedicatedClusterOrderId"` + + // 小订单ID + SubOrderIds []*string `json:"SubOrderIds,omitnil,omitempty" name:"SubOrderIds"` +} + +func (r *ModifyOrderStatusRequest) 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 *ModifyOrderStatusRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "Status") + delete(f, "DedicatedClusterOrderId") + delete(f, "SubOrderIds") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ModifyOrderStatusRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type ModifyOrderStatusResponseParams struct { + // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` +} + +type ModifyOrderStatusResponse struct { + *tchttp.BaseResponse + Response *ModifyOrderStatusResponseParams `json:"Response"` +} + +func (r *ModifyOrderStatusResponse) 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 *ModifyOrderStatusResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type ModifySiteDeviceInfoRequestParams struct { + // 机房ID + SiteId *string `json:"SiteId,omitnil,omitempty" name:"SiteId"` + + // 您将使用光纤类型将CDC设备连接到网络。有单模和多模两种选项。 + FiberType *string `json:"FiberType,omitnil,omitempty" name:"FiberType"` + + // 您将CDC连接到网络时采用的光学标准。此字段取决于上行链路速度、光纤类型和到上游设备的距离。 + OpticalStandard *string `json:"OpticalStandard,omitnil,omitempty" name:"OpticalStandard"` + + // 电源连接器类型 + PowerConnectors *string `json:"PowerConnectors,omitnil,omitempty" name:"PowerConnectors"` + + // 从机架上方还是下方供电。 + PowerFeedDrop *string `json:"PowerFeedDrop,omitnil,omitempty" name:"PowerFeedDrop"` + + // 最大承重(KG) + MaxWeight *int64 `json:"MaxWeight,omitnil,omitempty" name:"MaxWeight"` + + // 功耗(KW) + PowerDrawKva *int64 `json:"PowerDrawKva,omitnil,omitempty" name:"PowerDrawKva"` + + // 网络到腾讯云Region区域的上行链路速度 + UplinkSpeedGbps *int64 `json:"UplinkSpeedGbps,omitnil,omitempty" name:"UplinkSpeedGbps"` + + // 将CDC连接到网络时,每台CDC网络设备(每个机架 2 台设备)使用的上行链路数量。 + UplinkCount *int64 `json:"UplinkCount,omitnil,omitempty" name:"UplinkCount"` + + // 是否满足下面环境条件: + // 1、场地没有材料要求或验收标准会影响 CDC 设备配送和安装。 + // 2、确定的机架位置包含: + // 温度范围为 41 到 104°F (5 到 40°C)。 + // 湿度范围为 10°F (-12°C)和 8% RH (相对湿度)到 70°F(21°C)和 80% RH。 + // 机架位置的气流方向为从前向后,且应具有足够的 CFM (每分钟立方英尺),散热功率须达到CDC运行功率值的 145.8 倍以上。 + ConditionRequirement *bool `json:"ConditionRequirement,omitnil,omitempty" name:"ConditionRequirement"` + + // 是否满足下面的尺寸条件: + // 您的装货站台可以容纳一个机架箱(高 x 宽 x 深 = 94" x 54" x 48")。 + // 您可以提供从机架(高 x 宽 x 深 = 80" x 24" x 48")交货地点到机架最终安置位置的明确通道。测量深度时,应包括站台、走廊通道、门、转弯、坡道、货梯,并将其他通道限制考虑在内。 + // 在最终的 CDC安置位置,前部间隙可以为 48" 或更大,后部间隙可以为 24" 或更大。 + DimensionRequirement *bool `json:"DimensionRequirement,omitnil,omitempty" name:"DimensionRequirement"` + + // 是否提供冗余的上游设备(交换机或路由器),以便实现网络出口的高可用。 + RedundantNetworking *bool `json:"RedundantNetworking,omitnil,omitempty" name:"RedundantNetworking"` + + // 是否需要腾讯云团队协助完成机架支撑工作 + NeedHelp *bool `json:"NeedHelp,omitnil,omitempty" name:"NeedHelp"` + + // 是否电源冗余 + RedundantPower *bool `json:"RedundantPower,omitnil,omitempty" name:"RedundantPower"` + + // 上游断路器是否具备 + BreakerRequirement *bool `json:"BreakerRequirement,omitnil,omitempty" name:"BreakerRequirement"` +} + +type ModifySiteDeviceInfoRequest struct { + *tchttp.BaseRequest + + // 机房ID + SiteId *string `json:"SiteId,omitnil,omitempty" name:"SiteId"` + + // 您将使用光纤类型将CDC设备连接到网络。有单模和多模两种选项。 + FiberType *string `json:"FiberType,omitnil,omitempty" name:"FiberType"` + + // 您将CDC连接到网络时采用的光学标准。此字段取决于上行链路速度、光纤类型和到上游设备的距离。 + OpticalStandard *string `json:"OpticalStandard,omitnil,omitempty" name:"OpticalStandard"` + + // 电源连接器类型 + PowerConnectors *string `json:"PowerConnectors,omitnil,omitempty" name:"PowerConnectors"` + + // 从机架上方还是下方供电。 + PowerFeedDrop *string `json:"PowerFeedDrop,omitnil,omitempty" name:"PowerFeedDrop"` + + // 最大承重(KG) + MaxWeight *int64 `json:"MaxWeight,omitnil,omitempty" name:"MaxWeight"` + + // 功耗(KW) + PowerDrawKva *int64 `json:"PowerDrawKva,omitnil,omitempty" name:"PowerDrawKva"` + + // 网络到腾讯云Region区域的上行链路速度 + UplinkSpeedGbps *int64 `json:"UplinkSpeedGbps,omitnil,omitempty" name:"UplinkSpeedGbps"` + + // 将CDC连接到网络时,每台CDC网络设备(每个机架 2 台设备)使用的上行链路数量。 + UplinkCount *int64 `json:"UplinkCount,omitnil,omitempty" name:"UplinkCount"` + + // 是否满足下面环境条件: + // 1、场地没有材料要求或验收标准会影响 CDC 设备配送和安装。 + // 2、确定的机架位置包含: + // 温度范围为 41 到 104°F (5 到 40°C)。 + // 湿度范围为 10°F (-12°C)和 8% RH (相对湿度)到 70°F(21°C)和 80% RH。 + // 机架位置的气流方向为从前向后,且应具有足够的 CFM (每分钟立方英尺),散热功率须达到CDC运行功率值的 145.8 倍以上。 + ConditionRequirement *bool `json:"ConditionRequirement,omitnil,omitempty" name:"ConditionRequirement"` + + // 是否满足下面的尺寸条件: + // 您的装货站台可以容纳一个机架箱(高 x 宽 x 深 = 94" x 54" x 48")。 + // 您可以提供从机架(高 x 宽 x 深 = 80" x 24" x 48")交货地点到机架最终安置位置的明确通道。测量深度时,应包括站台、走廊通道、门、转弯、坡道、货梯,并将其他通道限制考虑在内。 + // 在最终的 CDC安置位置,前部间隙可以为 48" 或更大,后部间隙可以为 24" 或更大。 + DimensionRequirement *bool `json:"DimensionRequirement,omitnil,omitempty" name:"DimensionRequirement"` + + // 是否提供冗余的上游设备(交换机或路由器),以便实现网络出口的高可用。 + RedundantNetworking *bool `json:"RedundantNetworking,omitnil,omitempty" name:"RedundantNetworking"` + + // 是否需要腾讯云团队协助完成机架支撑工作 + NeedHelp *bool `json:"NeedHelp,omitnil,omitempty" name:"NeedHelp"` + + // 是否电源冗余 + RedundantPower *bool `json:"RedundantPower,omitnil,omitempty" name:"RedundantPower"` + + // 上游断路器是否具备 + BreakerRequirement *bool `json:"BreakerRequirement,omitnil,omitempty" name:"BreakerRequirement"` +} + +func (r *ModifySiteDeviceInfoRequest) 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 *ModifySiteDeviceInfoRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "SiteId") + delete(f, "FiberType") + delete(f, "OpticalStandard") + delete(f, "PowerConnectors") + delete(f, "PowerFeedDrop") + delete(f, "MaxWeight") + delete(f, "PowerDrawKva") + delete(f, "UplinkSpeedGbps") + delete(f, "UplinkCount") + delete(f, "ConditionRequirement") + delete(f, "DimensionRequirement") + delete(f, "RedundantNetworking") + delete(f, "NeedHelp") + delete(f, "RedundantPower") + delete(f, "BreakerRequirement") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ModifySiteDeviceInfoRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type ModifySiteDeviceInfoResponseParams struct { + // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` +} + +type ModifySiteDeviceInfoResponse struct { + *tchttp.BaseResponse + Response *ModifySiteDeviceInfoResponseParams `json:"Response"` +} + +func (r *ModifySiteDeviceInfoResponse) 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 *ModifySiteDeviceInfoResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type ModifySiteInfoRequestParams struct { + // 机房ID + SiteId *string `json:"SiteId,omitnil,omitempty" name:"SiteId"` + + // 站点名称 + Name *string `json:"Name,omitnil,omitempty" name:"Name"` + + // 站点描述 + Description *string `json:"Description,omitnil,omitempty" name:"Description"` + + // 注意事项 + Note *string `json:"Note,omitnil,omitempty" name:"Note"` + + // 站点所在国家 + Country *string `json:"Country,omitnil,omitempty" name:"Country"` + + // 站点所在省份 + Province *string `json:"Province,omitnil,omitempty" name:"Province"` + + // 站点所在城市 + City *string `json:"City,omitnil,omitempty" name:"City"` + + // 站点所在地区的邮编 + PostalCode *string `json:"PostalCode,omitnil,omitempty" name:"PostalCode"` + + // 站点所在地区的详细地址信息 + AddressLine *string `json:"AddressLine,omitnil,omitempty" name:"AddressLine"` +} + +type ModifySiteInfoRequest struct { + *tchttp.BaseRequest + + // 机房ID + SiteId *string `json:"SiteId,omitnil,omitempty" name:"SiteId"` + + // 站点名称 + Name *string `json:"Name,omitnil,omitempty" name:"Name"` + + // 站点描述 + Description *string `json:"Description,omitnil,omitempty" name:"Description"` + + // 注意事项 + Note *string `json:"Note,omitnil,omitempty" name:"Note"` + + // 站点所在国家 + Country *string `json:"Country,omitnil,omitempty" name:"Country"` + + // 站点所在省份 + Province *string `json:"Province,omitnil,omitempty" name:"Province"` + + // 站点所在城市 + City *string `json:"City,omitnil,omitempty" name:"City"` + + // 站点所在地区的邮编 + PostalCode *string `json:"PostalCode,omitnil,omitempty" name:"PostalCode"` + + // 站点所在地区的详细地址信息 + AddressLine *string `json:"AddressLine,omitnil,omitempty" name:"AddressLine"` +} + +func (r *ModifySiteInfoRequest) 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 *ModifySiteInfoRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "SiteId") + delete(f, "Name") + delete(f, "Description") + delete(f, "Note") + delete(f, "Country") + delete(f, "Province") + delete(f, "City") + delete(f, "PostalCode") + delete(f, "AddressLine") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ModifySiteInfoRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type ModifySiteInfoResponseParams struct { + // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` +} + +type ModifySiteInfoResponse struct { + *tchttp.BaseResponse + Response *ModifySiteInfoResponseParams `json:"Response"` +} + +func (r *ModifySiteInfoResponse) 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 *ModifySiteInfoResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +type OutBandwidth struct { + // 时间戳 + // 注意:此字段可能返回 null,表示取不到有效值。 + Timestamps []*float64 `json:"Timestamps,omitnil,omitempty" name:"Timestamps"` + + // 对应时间的值 + // 注意:此字段可能返回 null,表示取不到有效值。 + Values []*float64 `json:"Values,omitnil,omitempty" name:"Values"` +} + +type RegionZoneInfo struct { + // Region id + RegionId *int64 `json:"RegionId,omitnil,omitempty" name:"RegionId"` + + // ZoneInfo数组 + Zones []*ZoneInfo `json:"Zones,omitnil,omitempty" name:"Zones"` +} + +type SetInfo struct { + // 云硬盘仓库id + // 注意:此字段可能返回 null,表示取不到有效值。 + SetId *string `json:"SetId,omitnil,omitempty" name:"SetId"` + + // 云硬盘仓库名称 + // 注意:此字段可能返回 null,表示取不到有效值。 + SetName *string `json:"SetName,omitnil,omitempty" name:"SetName"` + + // 云硬盘仓库类型 + // 注意:此字段可能返回 null,表示取不到有效值。 + SetType *string `json:"SetType,omitnil,omitempty" name:"SetType"` + + // 云硬盘仓库容量 + // 注意:此字段可能返回 null,表示取不到有效值。 + SetSize *float64 `json:"SetSize,omitnil,omitempty" name:"SetSize"` + + // 云硬盘仓库状态 + // 注意:此字段可能返回 null,表示取不到有效值。 + SetStatus *string `json:"SetStatus,omitnil,omitempty" name:"SetStatus"` + + // 云硬盘仓库创建时间 + // 注意:此字段可能返回 null,表示取不到有效值。 + CreateTime *string `json:"CreateTime,omitnil,omitempty" name:"CreateTime"` + + // 读流量 + // 注意:此字段可能返回 null,表示取不到有效值。 + ReadTraffic *DetailData `json:"ReadTraffic,omitnil,omitempty" name:"ReadTraffic"` + + // 写流量 + // 注意:此字段可能返回 null,表示取不到有效值。 + WriteTraffic *DetailData `json:"WriteTraffic,omitnil,omitempty" name:"WriteTraffic"` + + // 读IO + // 注意:此字段可能返回 null,表示取不到有效值。 + ReadIO *DetailData `json:"ReadIO,omitnil,omitempty" name:"ReadIO"` + + // 写IO + // 注意:此字段可能返回 null,表示取不到有效值。 + WriteIO *DetailData `json:"WriteIO,omitnil,omitempty" name:"WriteIO"` + + // 平均等待时间 + // 注意:此字段可能返回 null,表示取不到有效值。 + Await *DetailData `json:"Await,omitnil,omitempty" name:"Await"` + + // 利用率 + // 注意:此字段可能返回 null,表示取不到有效值。 + Util *DetailData `json:"Util,omitnil,omitempty" name:"Util"` +} + +type Site struct { + // 站点名称 + Name *string `json:"Name,omitnil,omitempty" name:"Name"` + + // 站点id + SiteId *string `json:"SiteId,omitnil,omitempty" name:"SiteId"` + + // 站点描述 + // 注意:此字段可能返回 null,表示取不到有效值。 + Description *string `json:"Description,omitnil,omitempty" name:"Description"` + + // 站点创建时间 + CreateTime *string `json:"CreateTime,omitnil,omitempty" name:"CreateTime"` +} + +type SiteDetail struct { + // 站点id + SiteId *string `json:"SiteId,omitnil,omitempty" name:"SiteId"` + + // 站点名称 + Name *string `json:"Name,omitnil,omitempty" name:"Name"` + + // 站点描述 + Description *string `json:"Description,omitnil,omitempty" name:"Description"` + + // 站点创建时间 + CreateTime *string `json:"CreateTime,omitnil,omitempty" name:"CreateTime"` + + // 光纤类型 + FiberType *string `json:"FiberType,omitnil,omitempty" name:"FiberType"` + + // 网络到腾讯云Region区域的上行链路速度 + UplinkSpeedGbps *int64 `json:"UplinkSpeedGbps,omitnil,omitempty" name:"UplinkSpeedGbps"` + + // 将CDC连接到网络时,每台CDC网络设备(每个机架 2 台设备)使用的上行链路数量。 + UplinkCount *int64 `json:"UplinkCount,omitnil,omitempty" name:"UplinkCount"` + + // 将CDC连接到网络时采用的光学标准 + OpticalStandard *string `json:"OpticalStandard,omitnil,omitempty" name:"OpticalStandard"` + + // 是否提供冗余的上游设备(交换机或路由器),以便两台 网络设备都能连接到网络设备。 + RedundantNetworking *bool `json:"RedundantNetworking,omitnil,omitempty" name:"RedundantNetworking"` + + // 电源连接器类型 + PowerConnectors *string `json:"PowerConnectors,omitnil,omitempty" name:"PowerConnectors"` + + // 从机架上方还是下方供电。 + PowerFeedDrop *string `json:"PowerFeedDrop,omitnil,omitempty" name:"PowerFeedDrop"` + + // 功耗(KW) + PowerDrawKva *float64 `json:"PowerDrawKva,omitnil,omitempty" name:"PowerDrawKva"` + + // 是否满足下面环境条件: + // 1、场地没有材料要求或验收标准会影响 CDC 设备配送和安装。 + // 2、确定的机架位置包含: + // 温度范围为 41 到 104°F (5 到 40°C)。 + // 湿度范围为 10°F (-12°C)和 8% RH (相对湿度)到 70°F(21°C)和 80% RH。 + // 机架位置的气流方向为从前向后,且应具有足够的 CFM (每分钟立方英尺)。CFM 必须是 CDC 配置的 kVA 功耗值的 145.8 倍。 + ConditionRequirement *bool `json:"ConditionRequirement,omitnil,omitempty" name:"ConditionRequirement"` + + // 是否满足下面的尺寸条件: + // 您的装货站台可以容纳一个机架箱(高 x 宽 x 深 = 94" x 54" x 48")。 + // 您可以提供从机架(高 x 宽 x 深 = 80" x 24" x 48")交货地点到机架最终安置位置的明确通道。测量深度时,应包括站台、走廊通道、门、转弯、坡道、货梯,并将其他通道限制考虑在内。 + // 在最终的 CDC安置位置,前部间隙可以为 48" 或更大,后部间隙可以为 24" 或更大。 + DimensionRequirement *bool `json:"DimensionRequirement,omitnil,omitempty" name:"DimensionRequirement"` + + // 最大承重(KG) + MaxWeight *int64 `json:"MaxWeight,omitnil,omitempty" name:"MaxWeight"` + + // 站点地址 + AddressLine *string `json:"AddressLine,omitnil,omitempty" name:"AddressLine"` + + // 站点所在地区的详细地址信息(补充) + OptionalAddressLine *string `json:"OptionalAddressLine,omitnil,omitempty" name:"OptionalAddressLine"` + + // 是否需要腾讯云团队协助完成机架支撑工作 + NeedHelp *bool `json:"NeedHelp,omitnil,omitempty" name:"NeedHelp"` + + // 上游断路器是否具备 + BreakerRequirement *bool `json:"BreakerRequirement,omitnil,omitempty" name:"BreakerRequirement"` + + // 是否电源冗余 + RedundantPower *bool `json:"RedundantPower,omitnil,omitempty" name:"RedundantPower"` + + // 站点所在国家 + Country *string `json:"Country,omitnil,omitempty" name:"Country"` + + // 站点所在省份 + Province *string `json:"Province,omitnil,omitempty" name:"Province"` + + // 站点所在城市 + City *string `json:"City,omitnil,omitempty" name:"City"` + + // 站点所在地区的邮编 + PostalCode *int64 `json:"PostalCode,omitnil,omitempty" name:"PostalCode"` +} + +type VpngwBandwidthData struct { + // 出带宽流量 + // 注意:此字段可能返回 null,表示取不到有效值。 + OutBandwidth *OutBandwidth `json:"OutBandwidth,omitnil,omitempty" name:"OutBandwidth"` + + // 入带宽流量 + InBandwidth *InBandwidth `json:"InBandwidth,omitnil,omitempty" name:"InBandwidth"` +} + +type ZoneInfo struct { + // 可用区名称 + Zone *string `json:"Zone,omitnil,omitempty" name:"Zone"` + + // 可用区描述 + ZoneName *string `json:"ZoneName,omitnil,omitempty" name:"ZoneName"` + + // 可用区ID + ZoneId *int64 `json:"ZoneId,omitnil,omitempty" name:"ZoneId"` + + // 可用区状态,包含AVAILABLE和UNAVAILABLE。AVAILABLE代表可用,UNAVAILABLE代表不可用。 + ZoneState *string `json:"ZoneState,omitnil,omitempty" name:"ZoneState"` +} \ No newline at end of file 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 d18338abf6..5d9d3b9fdf 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 @@ -265,7 +265,7 @@ func CompleteCommonParams(request Request, region string, requestClient string) params["Action"] = request.GetAction() params["Timestamp"] = strconv.FormatInt(time.Now().Unix(), 10) params["Nonce"] = strconv.Itoa(rand.Int()) - params["RequestClient"] = "SDK_GO_1.0.967" + params["RequestClient"] = "SDK_GO_1.0.970" if requestClient != "" { params["RequestClient"] += ": " + requestClient } diff --git a/vendor/modules.txt b/vendor/modules.txt index 2db02c507b..7a3c7d2f5b 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -1124,6 +1124,9 @@ github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cbs/v20170312 # github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cdb v1.0.800 ## explicit; go 1.14 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cdb/v20170320 +# github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cdc v1.0.970 +## explicit; go 1.14 +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cdc/v20201214 # github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cdn v1.0.539 ## explicit; go 1.14 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cdn/v20180606 @@ -1154,10 +1157,10 @@ github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/clb/v20180317 # github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cloudaudit v1.0.544 ## explicit; go 1.14 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cloudaudit/v20190319 -# github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cls v1.0.962 +# github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cls v1.0.970 ## explicit; go 1.14 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cls/v20201016 -# github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.967 +# github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.970 ## explicit; go 1.11 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/errors @@ -1177,7 +1180,7 @@ github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cwp/v20180228 # github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cynosdb v1.0.692 ## explicit; go 1.14 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cynosdb/v20190107 -# github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dasb v1.0.964 +# github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dasb v1.0.970 ## explicit; go 1.14 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dasb/v20191018 # github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dayu v1.0.335 @@ -1213,7 +1216,7 @@ github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/emr/v20190103 # github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/es v1.0.777 ## explicit; go 1.14 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/es/v20180416 -# github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/gaap v1.0.967 +# github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/gaap v1.0.970 ## explicit; go 1.14 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/gaap/v20180529 # github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/kms v1.0.563 diff --git a/website/docs/d/cdc_dedicated_cluster_hosts.html.markdown b/website/docs/d/cdc_dedicated_cluster_hosts.html.markdown new file mode 100644 index 0000000000..170fd06b33 --- /dev/null +++ b/website/docs/d/cdc_dedicated_cluster_hosts.html.markdown @@ -0,0 +1,46 @@ +--- +subcategory: "CDC" +layout: "tencentcloud" +page_title: "TencentCloud: tencentcloud_cdc_dedicated_cluster_hosts" +sidebar_current: "docs-tencentcloud-datasource-cdc_dedicated_cluster_hosts" +description: |- + Use this data source to query detailed information of CDC dedicated cluster hosts +--- + +# tencentcloud_cdc_dedicated_cluster_hosts + +Use this data source to query detailed information of CDC dedicated cluster hosts + +## Example Usage + +```hcl +data "tencentcloud_cdc_dedicated_cluster_hosts" "hosts" { + dedicated_cluster_id = "cluster-262n63e8" +} +``` + +## Argument Reference + +The following arguments are supported: + +* `dedicated_cluster_id` - (Required, String) Dedicated Cluster ID. +* `result_output_file` - (Optional, String) Used to save results. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `host_info_set` - Dedicated Cluster Host Info. + * `cpu_available` - Dedicated Cluster Host CPU Available Count. + * `cpu_total` - Dedicated Cluster Host CPU Total Count. + * `expire_time` - Dedicated Cluster Host Expire Time. + * `host_id` - Dedicated Cluster Host ID. + * `host_ip` - Dedicated Cluster Host Ip (Deprecated). + * `host_status` - Dedicated Cluster Host Status. + * `host_type` - Dedicated Cluster Host Type. + * `mem_available` - Dedicated Cluster Host Memory Available Count (GB). + * `mem_total` - Dedicated Cluster Host Memory Total Count (GB). + * `run_time` - Dedicated Cluster Host Run Time. + * `service_type` - Dedicated Cluster Service Type. + + diff --git a/website/docs/d/cdc_dedicated_cluster_instance_types.html.markdown b/website/docs/d/cdc_dedicated_cluster_instance_types.html.markdown new file mode 100644 index 0000000000..e531c1c027 --- /dev/null +++ b/website/docs/d/cdc_dedicated_cluster_instance_types.html.markdown @@ -0,0 +1,50 @@ +--- +subcategory: "CDC" +layout: "tencentcloud" +page_title: "TencentCloud: tencentcloud_cdc_dedicated_cluster_instance_types" +sidebar_current: "docs-tencentcloud-datasource-cdc_dedicated_cluster_instance_types" +description: |- + Use this data source to query detailed information of CDC dedicated cluster instance types +--- + +# tencentcloud_cdc_dedicated_cluster_instance_types + +Use this data source to query detailed information of CDC dedicated cluster instance types + +## Example Usage + +```hcl +data "tencentcloud_cdc_dedicated_cluster_instance_types" "types" { + dedicated_cluster_id = "cluster-262n63e8" +} +``` + +## Argument Reference + +The following arguments are supported: + +* `dedicated_cluster_id` - (Required, String) Dedicated Cluster ID. +* `result_output_file` - (Optional, String) Used to save results. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `dedicated_cluster_instance_type_set` - Dedicated Cluster Supported InstanceType. + * `cpu_type` - Instance CPU Type. + * `cpu` - Instance CPU. + * `fpga` - Instance Fpga. + * `gpu` - Instance GPU. + * `instance_bandwidth` - Instance Bandwidth. + * `instance_family` - Instance Family. + * `instance_pps` - Instance Pps. + * `instance_type` - Instance Type. + * `memory` - Instance Memory. + * `network_card` - Instance Type. + * `remark` - Instance Remark. + * `status` - Instance Status. + * `storage_block_amount` - Instance Storage Block Amount. + * `type_name` - Instance Type Name. + * `zone` - Zone Name. + + diff --git a/website/docs/d/cdc_dedicated_cluster_orders.html.markdown b/website/docs/d/cdc_dedicated_cluster_orders.html.markdown new file mode 100644 index 0000000000..e5caeee329 --- /dev/null +++ b/website/docs/d/cdc_dedicated_cluster_orders.html.markdown @@ -0,0 +1,89 @@ +--- +subcategory: "CDC" +layout: "tencentcloud" +page_title: "TencentCloud: tencentcloud_cdc_dedicated_cluster_orders" +sidebar_current: "docs-tencentcloud-datasource-cdc_dedicated_cluster_orders" +description: |- + Use this data source to query detailed information of CDC dedicated cluster orders +--- + +# tencentcloud_cdc_dedicated_cluster_orders + +Use this data source to query detailed information of CDC dedicated cluster orders + +## Example Usage + +### Query all orders + +```hcl +data "tencentcloud_cdc_dedicated_cluster_orders" "orders" {} +``` + +### Query orders by filter + +```hcl +data "tencentcloud_cdc_dedicated_cluster_orders" "orders1" { + dedicated_cluster_ids = ["cluster-262n63e8"] +} + +data "tencentcloud_cdc_dedicated_cluster_orders" "orders3" { + status = "PENDING" + action_type = "CREATE" +} +``` + +## Argument Reference + +The following arguments are supported: + +* `action_type` - (Optional, String) Filter by Dedicated Cluster Order Action Type. Allow filter value: CREATE, EXTEND. +* `dedicated_cluster_ids` - (Optional, Set: [`String`]) Filter by Dedicated Cluster ID. +* `result_output_file` - (Optional, String) Used to save results. +* `status` - (Optional, String) Filter by Dedicated Cluster Order Status. Allow filter value: PENDING, INCONSTRUCTION, DELIVERING, DELIVERED, EXPIRED, CANCELLED, OFFLINE. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `dedicated_cluster_order_set` - Filter by Dedicated Cluster Order. + * `action` - Dedicated Cluster Order Action Type. + * `cpu` - Dedicated Cluster CPU. + * `create_time` - Dedicated Cluster Order Create time. + * `dedicated_cluster_id` - Dedicated Cluster ID. + * `dedicated_cluster_order_id` - Dedicated Cluster Order ID. + * `dedicated_cluster_order_items` - Dedicated Cluster Order Item List. + * `compute_format` - Dedicated Cluster Compute Format. + * `count` - Dedicated Cluster SubOrder Count. + * `create_time` - Dedicated Cluster Order Create time. + * `dedicated_cluster_type_id` - Dedicated Cluster ID. + * `description` - Dedicated Cluster Type Description. + * `name` - Dedicated Cluster Type Name. + * `power_draw` - Dedicated Cluster Supported PowerDraw. + * `sub_order_id` - Dedicated Cluster SubOrder ID. + * `sub_order_pay_status` - Dedicated Cluster SubOrder Pay Status. + * `sub_order_status` - Dedicated Cluster Order Status. + * `supported_instance_family` - Dedicated Cluster Supported Instance Family. + * `supported_storage_type` - Dedicated Cluster Storage Type. + * `supported_uplink_speed` - Dedicated Cluster Supported Uplink Speed. + * `total_cpu` - Dedicated Cluster Total CPU. + * `total_gpu` - Dedicated Cluster Total GPU. + * `total_mem` - Dedicated Cluster Total Memory. + * `type_family` - Dedicated Cluster Type Family. + * `type_name` - Dedicated Cluster Type Name. + * `weight` - Dedicated Cluster Supported Weight. + * `dedicated_cluster_type_id` - Dedicated Cluster Type ID. + * `gpu` - Dedicated Cluster GPU. + * `mem` - Dedicated Cluster Memory. + * `order_status` - Dedicated Cluster Order Status. + * `order_type` - Dedicated Cluster Order Type. + * `pay_status` - Dedicated Cluster Order Pay Status. + * `pay_type` - Dedicated Cluster Order Pay Type. + * `power_draw` - Dedicated Cluster Supported PowerDraw. + * `supported_instance_family` - Dedicated Cluster Supported Instance Family. + * `supported_storage_type` - Dedicated Cluster Storage Type. + * `supported_uplink_speed` - Dedicated Cluster Supported Uplink Speed. + * `time_span` - Dedicated Cluster Order Pay Time Span. + * `time_unit` - Dedicated Cluster Order Pay Time Unit. + * `weight` - Dedicated Cluster Supported Weight. + + diff --git a/website/docs/r/cdc_dedicated_cluster.html.markdown b/website/docs/r/cdc_dedicated_cluster.html.markdown new file mode 100644 index 0000000000..4a5bcf42f6 --- /dev/null +++ b/website/docs/r/cdc_dedicated_cluster.html.markdown @@ -0,0 +1,60 @@ +--- +subcategory: "CDC" +layout: "tencentcloud" +page_title: "TencentCloud: tencentcloud_cdc_dedicated_cluster" +sidebar_current: "docs-tencentcloud-resource-cdc_dedicated_cluster" +description: |- + Provides a resource to create a CDC dedicated cluster +--- + +# tencentcloud_cdc_dedicated_cluster + +Provides a resource to create a CDC dedicated cluster + +## Example Usage + +```hcl +# create cdc site +resource "tencentcloud_cdc_site" "example" { + name = "tf-example" + country = "China" + province = "Guangdong Province" + city = "Guangzhou" + address_line = "Tencent Building" + description = "desc." +} + +# create cdc dedicated cluster +resource "tencentcloud_cdc_dedicated_cluster" "example" { + site_id = tencentcloud_cdc_site.example.id + name = "tf-example" + zone = "ap-guangzhou-6" + description = "desc." +} +``` + +## Argument Reference + +The following arguments are supported: + +* `name` - (Required, String) Dedicated Cluster Name. +* `site_id` - (Required, String) Dedicated Cluster Site ID. +* `zone` - (Required, String) Dedicated Cluster Zone. +* `description` - (Optional, String) Dedicated Cluster Description. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `id` - ID of the resource. + + + +## Import + +CDC dedicated cluster can be imported using the id, e.g. + +``` +terraform import tencentcloud_cdc_dedicated_cluster.example cluster-d574omhk +``` + diff --git a/website/docs/r/cdc_site.html.markdown b/website/docs/r/cdc_site.html.markdown new file mode 100644 index 0000000000..df0e2f5dee --- /dev/null +++ b/website/docs/r/cdc_site.html.markdown @@ -0,0 +1,98 @@ +--- +subcategory: "CDC" +layout: "tencentcloud" +page_title: "TencentCloud: tencentcloud_cdc_site" +sidebar_current: "docs-tencentcloud-resource-cdc_site" +description: |- + Provides a resource to create a CDC site +--- + +# tencentcloud_cdc_site + +Provides a resource to create a CDC site + +## Example Usage + +### Create a basic CDC site + +```hcl +resource "tencentcloud_cdc_site" "example" { + name = "tf-example" + country = "China" + province = "Guangdong Province" + city = "Guangzhou" + address_line = "Tencent Building" + description = "desc." +} +``` + +### Create a complete CDC site + +```hcl +resource "tencentcloud_cdc_site" "example" { + name = "tf-example" + country = "China" + province = "Guangdong Province" + city = "Guangzhou" + address_line = "Shenzhen Tencent Building" + optional_address_line = "Shenzhen Tencent Building of Binhai" + description = "desc." + fiber_type = "MM" + optical_standard = "MM" + power_connectors = "380VAC3P" + power_feed_drop = "DOWN" + max_weight = 100 + power_draw_kva = 10 + uplink_speed_gbps = 10 + uplink_count = 2 + condition_requirement = true + dimension_requirement = true + redundant_networking = true + need_help = true + redundant_power = true + breaker_requirement = true +} +``` + +## Argument Reference + +The following arguments are supported: + +* `address_line` - (Required, String) Site Detail Address. +* `city` - (Required, String) Site City. +* `country` - (Required, String) Site Country. +* `name` - (Required, String) Site Name. +* `province` - (Required, String) Site Province. +* `breaker_requirement` - (Optional, Bool) Whether there is an upstream circuit breaker. +* `condition_requirement` - (Optional, Bool) Whether the following environmental conditions are met: n1. There are no material requirements or the acceptance standard on site that will affect the delivery and installation of the CDC device. n2. The following conditions are met for finalized rack positions: Temperature ranges from 41 to 104 degrees F (5 to 40 degrees C). Humidity ranges from 10 degrees F (-12 degrees C) to 70 degrees F (21 degrees C) and relative humidity ranges from 8% RH to 80% RH. Air flows from front to back at the rack position and there is sufficient air in CFM (cubic feet per minute). The air quantity in CFM must be 145.8 times the power consumption (in KVA) of CDC. +* `description` - (Optional, String) Site Description. +* `dimension_requirement` - (Optional, Bool) Whether the following dimension conditions are met: Your loading dock can accommodate one rack container (H x W x D = 94 x 54 x 48). You can provide a clear route from the delivery point of your rack (H x W x D = 80 x 24 x 48) to its final installation location. You should consider platforms, corridors, doors, turns, ramps, freight elevators as well as other access restrictions when measuring the depth. There shall be a 48 or greater front clearance and a 24 or greater rear clearance where the CDC is finally installed. +* `fiber_type` - (Optional, String) Site Fiber Type. Using optical fiber type to connect the CDC device to the network SM(Single-Mode) or MM(Multi-Mode) fibers are available. +* `max_weight` - (Optional, Int) Site Max Weight capacity (KG). +* `need_help` - (Optional, Bool) Whether you need help from Tencent Cloud for rack installation. +* `optical_standard` - (Optional, String) Site Optical Standard. Optical standard used to connect the CDC device to the network This field depends on the uplink speed, optical fiber type, and distance to upstream equipment. Allow value: `SM`, `MM`. +* `optional_address_line` - (Optional, String) Detailed address of the site area (to be added). +* `power_connectors` - (Optional, String) Site Power Connectors. Example: 380VAC3P. +* `power_draw_kva` - (Optional, Int) Site Power DrawKva (KW). +* `power_feed_drop` - (Optional, String) Site Power Feed Drop. Whether power is supplied from above or below the rack. Allow value: `UP`, `DOWN`. +* `redundant_networking` - (Optional, Bool) Whether redundant upstream equipment (switch or router) is provided so that both network devices can be connected to the network. +* `redundant_power` - (Optional, Bool) Whether there is power redundancy. +* `uplink_count` - (Optional, Int) Number of uplinks used by each CDC device (2 devices per rack) when connected to the network. +* `uplink_speed_gbps` - (Optional, Int) Uplink speed from the network to Tencent Cloud Region. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `id` - ID of the resource. + + + +## Import + +CDC site can be imported using the id, e.g. + +``` +terraform import tencentcloud_cdc_site.example site-43qcf1ag +``` + diff --git a/website/tencentcloud.erb b/website/tencentcloud.erb index 1ea3f2179a..1dd05b3712 100644 --- a/website/tencentcloud.erb +++ b/website/tencentcloud.erb @@ -520,6 +520,36 @@
  • +
  • + CDC + +
  • CDWPG