diff --git a/.changelog/2813.txt b/.changelog/2813.txt
new file mode 100644
index 0000000000..813fbc47bc
--- /dev/null
+++ b/.changelog/2813.txt
@@ -0,0 +1,3 @@
+```release-note:new-resource
+tencentcloud_thpc_workspaces
+```
diff --git a/go.mod b/go.mod
index ff5714039c..4f27485fe3 100644
--- a/go.mod
+++ b/go.mod
@@ -115,6 +115,7 @@ require (
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/tencentcloud/tencentcloud-sdk-go/tencentcloud/thpc v1.0.998
github.com/wI2L/jsondiff v0.3.0
k8s.io/apimachinery v0.22.4
)
diff --git a/go.sum b/go.sum
index 379bec0b08..d83e14ab9f 100644
--- a/go.sum
+++ b/go.sum
@@ -939,6 +939,16 @@ github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.998 h1:FVOc
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.998/go.mod h1:r5r4xbfxSaeR04b166HGsBa/R4U3SueirEUpXGuw+Q0=
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/controlcenter v1.0.993 h1:WlPgXldQCxt7qi5Xrc6j6zTrsXWzN5BcOGs7Irq7fwQ=
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/controlcenter v1.0.993/go.mod h1:Z9U8zNtyuyKhjS0698wqsrG/kLx1TQ5CEixXBwVe7xY=
+github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/controlcenter v1.0.993 h1:WlPgXldQCxt7qi5Xrc6j6zTrsXWzN5BcOGs7Irq7fwQ=
+github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/controlcenter v1.0.993/go.mod h1:Z9U8zNtyuyKhjS0698wqsrG/kLx1TQ5CEixXBwVe7xY=
+github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.995 h1:I1l5kl6rdQYDLEk8DqWjZgwMh0+nYnqbwq7KS4bqi/s=
+github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.995/go.mod h1:r5r4xbfxSaeR04b166HGsBa/R4U3SueirEUpXGuw+Q0=
+github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.996 h1:m++6lrqL4NglwGwmgKD7VbvhxYVhmQRS9BWdFnzwVwY=
+github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.996/go.mod h1:r5r4xbfxSaeR04b166HGsBa/R4U3SueirEUpXGuw+Q0=
+github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.998 h1:FVOc3KPlI9JAFz7A7s19xGoF+t54vzNByRzenTyAKpA=
+github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.998/go.mod h1:r5r4xbfxSaeR04b166HGsBa/R4U3SueirEUpXGuw+Q0=
+github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/controlcenter v1.0.993 h1:WlPgXldQCxt7qi5Xrc6j6zTrsXWzN5BcOGs7Irq7fwQ=
+github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/controlcenter v1.0.993/go.mod h1:Z9U8zNtyuyKhjS0698wqsrG/kLx1TQ5CEixXBwVe7xY=
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.960 h1:Tpz3KVUfaJ7b98wQDYZSbmoKIn0hlH0oHPOzWMzE5Q8=
@@ -1041,6 +1051,10 @@ github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/tem v1.0.578 h1:vBpQhUr
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/tem v1.0.578/go.mod h1:UlojGQh/9wb7/uXPNi7PvMral1CNAskVDNgqJEV83l0=
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/teo v1.0.912 h1:XGOKd5umgbXDDTSOuLmoLDfNdh712lCIgIzw5SQItrA=
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/teo v1.0.912/go.mod h1:iqTDU0pVTQ8RCeMJPk/PAWl9HeI1DFMd1h07yMH7RGU=
+github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/thpc v1.0.996 h1:RtpskwAhYlNZ6I8KhzAkC1KkrOYK85xlbKcDPNyOq8s=
+github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/thpc v1.0.996/go.mod h1:NNaPLakkKjufzvcMcln18WPYVfbbIBI4NRenQy7VLr4=
+github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/thpc v1.0.998 h1:f4/n0dVKQTD06xJ84B5asHViNJHrZmGojdAWEPIsITM=
+github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/thpc v1.0.998/go.mod h1:fyi/HUwCwVe2NCCCjz8k/C5GwPu3QazCZO+OBJ3MhLk=
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/tke v1.0.921 h1:jCrZDMDNNI5TFZEEk5AXMcNThDzxAHMKrQFspoqEdCA=
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/tke v1.0.921/go.mod h1:waWKRKzVqvpXYIMuJvrXBEX9igTo5VntpP/Soi6O5Hc=
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/trocket v1.0.947 h1:iZfuU8S86kfqFsAVT/LUApP8L5cpT90hl2wSKiUDVvw=
diff --git a/tencentcloud/connectivity/client.go b/tencentcloud/connectivity/client.go
index f8d032f2e7..7d2267d505 100644
--- a/tencentcloud/connectivity/client.go
+++ b/tencentcloud/connectivity/client.go
@@ -90,6 +90,7 @@ import (
tdmq "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/tdmq/v20200217"
tem "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/tem/v20210701"
teo "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/teo/v20220901"
+ thpc "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/thpc/v20230321"
tkev20180525 "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/tke/v20180525"
tkev20220501 "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/tke/v20220501"
trocket "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/trocket/v20230308"
@@ -207,6 +208,7 @@ type TencentCloudClient struct {
cdcConn *cdc.Client
cdwdorisConn *cdwdoris.Client
controlcenterConn *controlcenter.Client
+ thpcConn *thpc.Client
//omit nil client
omitNilConn *common.Client
}
@@ -1713,3 +1715,16 @@ func (me *TencentCloudClient) UseControlcenterV20230110Client() *controlcenter.C
return me.controlcenterConn
}
+
+// UseThpcClient return THPC client for service
+func (me *TencentCloudClient) UseThpcV20230321Client() *thpc.Client {
+ if me.thpcConn != nil {
+ return me.thpcConn
+ }
+ cpf := me.NewClientProfile(300)
+ cpf.Language = "zh-CN"
+ me.thpcConn, _ = thpc.NewClient(me.Credential, me.Region, cpf)
+ me.thpcConn.WithHttpTransport(&LogRoundTripper{})
+
+ return me.thpcConn
+}
diff --git a/tencentcloud/provider.go b/tencentcloud/provider.go
index 352e498049..4a4cb9876a 100644
--- a/tencentcloud/provider.go
+++ b/tencentcloud/provider.go
@@ -103,6 +103,7 @@ import (
"github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/services/tdcpg"
"github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/services/tem"
"github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/services/teo"
+ "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/services/thpc"
"github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/services/tke"
"github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/services/tmp"
"github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/services/tpulsar"
@@ -2126,6 +2127,7 @@ func Provider() *schema.Provider {
"tencentcloud_cdwdoris_workload_group": cdwdoris.ResourceTencentCloudCdwdorisWorkloadGroup(),
//"tencentcloud_cdwdoris_user": cdwdoris.ResourceTencentCloudCdwdorisUser(),
"tencentcloud_batch_apply_account_baselines": controlcenter.ResourceTencentCloudBatchApplyAccountBaselines(),
+ "tencentcloud_thpc_workspaces": thpc.ResourceTencentCloudThpcWorkspaces(),
},
ConfigureFunc: providerConfigure,
diff --git a/tencentcloud/provider.md b/tencentcloud/provider.md
index 591ae631c5..9a80acf0b0 100644
--- a/tencentcloud/provider.md
+++ b/tencentcloud/provider.md
@@ -2184,4 +2184,8 @@ CdwDoris
ControlCenter
Resource
- tencentcloud_batch_apply_account_baselines
\ No newline at end of file
+ tencentcloud_batch_apply_account_baselines
+
+THPC
+ Resource
+ tencentcloud_thpc_workspaces
\ No newline at end of file
diff --git a/tencentcloud/services/postgresql/data_source_tc_postgresql_account_privileges.go b/tencentcloud/services/postgresql/data_source_tc_postgresql_account_privileges.go
index 3656e14519..e3ef140b6f 100644
--- a/tencentcloud/services/postgresql/data_source_tc_postgresql_account_privileges.go
+++ b/tencentcloud/services/postgresql/data_source_tc_postgresql_account_privileges.go
@@ -1,10 +1,11 @@
package postgresql
import (
- "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/internal/helper"
"log"
"strings"
+ "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/internal/helper"
+
tccommon "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/common"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
diff --git a/tencentcloud/services/postgresql/resource_tc_postgresql_account.go b/tencentcloud/services/postgresql/resource_tc_postgresql_account.go
index 1b121abd04..4bb7e60761 100644
--- a/tencentcloud/services/postgresql/resource_tc_postgresql_account.go
+++ b/tencentcloud/services/postgresql/resource_tc_postgresql_account.go
@@ -3,13 +3,14 @@ package postgresql
import (
"context"
"fmt"
+ "log"
+ "strings"
+
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
postgresql "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/postgres/v20170312"
tccommon "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/common"
"github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/internal/helper"
- "log"
- "strings"
)
func ResourceTencentCloudPostgresqlAccount() *schema.Resource {
diff --git a/tencentcloud/services/postgresql/resource_tc_postgresql_account_privileges_operation.go b/tencentcloud/services/postgresql/resource_tc_postgresql_account_privileges_operation.go
index d1f9839e64..3b12c40a76 100644
--- a/tencentcloud/services/postgresql/resource_tc_postgresql_account_privileges_operation.go
+++ b/tencentcloud/services/postgresql/resource_tc_postgresql_account_privileges_operation.go
@@ -1,13 +1,14 @@
package postgresql
import (
+ "log"
+ "strings"
+
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
postgresql "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/postgres/v20170312"
tccommon "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/common"
"github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/internal/helper"
- "log"
- "strings"
)
func ResourceTencentCloudPostgresqlAccountPrivilegesOperation() *schema.Resource {
diff --git a/tencentcloud/services/postgresql/resource_tc_postgresql_account_privileges_operation_test.go b/tencentcloud/services/postgresql/resource_tc_postgresql_account_privileges_operation_test.go
index d707f990f4..0d9d95c80e 100644
--- a/tencentcloud/services/postgresql/resource_tc_postgresql_account_privileges_operation_test.go
+++ b/tencentcloud/services/postgresql/resource_tc_postgresql_account_privileges_operation_test.go
@@ -1,9 +1,10 @@
package postgresql_test
import (
+ "testing"
+
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
tcacctest "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/acctest"
- "testing"
)
// go test -i; go test -test.run TestAccTencentCloudPostgresqlAccountPrivilegesOperationResource_basic -v
diff --git a/tencentcloud/services/postgresql/resource_tc_postgresql_account_test.go b/tencentcloud/services/postgresql/resource_tc_postgresql_account_test.go
index 569900ff94..64c87ad874 100644
--- a/tencentcloud/services/postgresql/resource_tc_postgresql_account_test.go
+++ b/tencentcloud/services/postgresql/resource_tc_postgresql_account_test.go
@@ -1,9 +1,10 @@
package postgresql_test
import (
+ "testing"
+
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
tcacctest "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/acctest"
- "testing"
)
// go test -i; go test -test.run TestAccTencentCloudPostgresqlAccountResource_basic -v
diff --git a/tencentcloud/services/thpc/extension_thpc.go b/tencentcloud/services/thpc/extension_thpc.go
new file mode 100644
index 0000000000..79e2304e6a
--- /dev/null
+++ b/tencentcloud/services/thpc/extension_thpc.go
@@ -0,0 +1,44 @@
+package thpc
+
+const (
+ SPACE_STATE_ONLINE = "ONLINE"
+ SPACE_STATE_ARREARS = "ARREARS"
+)
+
+const (
+ SPACE_CHARGE_TYPE_PREPAID = "PREPAID"
+ SPACE_CHARGE_TYPE_UNDERWRITE = "UNDERWRITE"
+)
+
+var SPACE_CHARGE_TYPE = []string{
+ SPACE_CHARGE_TYPE_PREPAID,
+ SPACE_CHARGE_TYPE_UNDERWRITE,
+}
+
+const (
+ CVM_DISK_TYPE_LOCAL_NVME = "CVM_DISK_TYPE_LOCAL_NVME"
+ CVM_DISK_TYPE_LOCAL_BASIC = "LOCAL_BASIC"
+ CVM_DISK_TYPE_LOCAL_SSD = "LOCAL_SSD"
+ CVM_DISK_TYPE_CLOUD_BASIC = "CLOUD_BASIC"
+ CVM_DISK_TYPE_CLOUD_SSD = "CLOUD_SSD"
+ CVM_DISK_TYPE_CLOUD_PREMIUM = "CLOUD_PREMIUM"
+ CVM_DISK_TYPE_CLOUD_BSSD = "CLOUD_BSSD"
+ CVM_DISK_TYPE_CLOUD_HSSD = "CLOUD_HSSD"
+ CVM_DISK_TYPE_CLOUD_TSSD = "CLOUD_TSSD"
+)
+
+var SYSTEM_DISK_TYPE = []string{
+ CVM_DISK_TYPE_LOCAL_BASIC,
+ CVM_DISK_TYPE_LOCAL_SSD,
+ CVM_DISK_TYPE_CLOUD_BASIC,
+ CVM_DISK_TYPE_CLOUD_SSD,
+ CVM_DISK_TYPE_CLOUD_PREMIUM,
+ CVM_DISK_TYPE_CLOUD_BSSD,
+ CVM_DISK_TYPE_CLOUD_HSSD,
+ CVM_DISK_TYPE_CLOUD_TSSD,
+}
+
+const (
+ CVM_INSTANCE_STATE_FAILED = "FAILED"
+ CVM_INSTANCE_STATE_OPERATING = "OPERATING"
+)
diff --git a/tencentcloud/services/thpc/resource_tc_thpc_workspaces.go b/tencentcloud/services/thpc/resource_tc_thpc_workspaces.go
new file mode 100644
index 0000000000..d97cb223ec
--- /dev/null
+++ b/tencentcloud/services/thpc/resource_tc_thpc_workspaces.go
@@ -0,0 +1,1273 @@
+// Code generated by iacg; DO NOT EDIT.
+package thpc
+
+import (
+ "context"
+ "fmt"
+ "log"
+
+ cvm "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cvm/v20170312"
+
+ svccbs "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/services/cbs"
+
+ svccvm "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/services/cvm"
+
+ "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
+ "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
+ thpcv20230321 "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/thpc/v20230321"
+
+ tccommon "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/common"
+ "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/internal/helper"
+)
+
+func ResourceTencentCloudThpcWorkspaces() *schema.Resource {
+ return &schema.Resource{
+ Create: resourceTencentCloudThpcWorkspacesCreate,
+ Read: resourceTencentCloudThpcWorkspacesRead,
+ Update: resourceTencentCloudThpcWorkspacesUpdate,
+ Delete: resourceTencentCloudThpcWorkspacesDelete,
+ Importer: &schema.ResourceImporter{
+ State: schema.ImportStatePassthrough,
+ },
+ Schema: map[string]*schema.Schema{
+ "client_token": {
+ Type: schema.TypeString,
+ Optional: true,
+ Description: "A string used to ensure the idempotence of the request. This string is generated by the customer and must be unique across different requests, with a maximum length of 64 ASCII characters. If this parameter is not specified, the idempotence of the request cannot be guaranteed. Example value: system-f3827db9-c58a-49cc-bf10-33fc1923a34a.",
+ },
+ "placement": {
+ Type: schema.TypeList,
+ Optional: true,
+ MaxItems: 1,
+ Description: "The position of the instance. This parameter allows you to specify attributes such as the availability zone, project, and host machine (when creating a sub-instance on CDH) that the instance belongs to. Note: If you do not specify the LaunchTemplate parameter, Placement is a mandatory parameter. If both Placement and LaunchTemplate are passed, the values in Placement override the corresponding values in LaunchTemplate by default.",
+ Elem: &schema.Resource{
+ Schema: map[string]*schema.Schema{
+ "zone": {
+ Type: schema.TypeString,
+ Required: true,
+ Description: "The available zone for the CVM instance.",
+ },
+ "project_id": {
+ Type: schema.TypeInt,
+ Optional: true,
+ Description: "The project the instance belongs to, default to 0.",
+ },
+ },
+ },
+ },
+ "space_charge_prepaid": {
+ Type: schema.TypeList,
+ Optional: true,
+ MaxItems: 1,
+ Description: "Prepaid mode: This refers to the parameters related to the annual and monthly subscription. By this parameter, you can specify the purchase duration of the prepaid instances, whether to set auto-renewal, and other attributes. If the instance's billing mode is prepaid, this parameter is required.",
+ Elem: &schema.Resource{
+ Schema: map[string]*schema.Schema{
+ "period": {
+ Type: schema.TypeInt,
+ Optional: true,
+ Description: "The tenancy (time unit is month) of the prepaid instance, NOTE: it only works when instance_charge_type is set to `PREPAID`. Valid values are `1`, `2`, `3`, `4`, `5`, `6`, `7`, `8`, `9`, `10`, `11`, `12`, `24`, `36`, `48`, `60`.",
+ },
+ "renew_flag": {
+ Type: schema.TypeString,
+ Optional: true,
+ Description: "Auto renewal flag. Valid values: `NOTIFY_AND_AUTO_RENEW`: notify upon expiration and renew automatically, `NOTIFY_AND_MANUAL_RENEW`: notify upon expiration but do not renew automatically, `DISABLE_NOTIFY_AND_MANUAL_RENEW`: neither notify upon expiration nor renew automatically. Default value: `NOTIFY_AND_MANUAL_RENEW`. If this parameter is specified as `NOTIFY_AND_AUTO_RENEW`, the instance will be automatically renewed on a monthly basis if the account balance is sufficient. NOTE: it only works when instance_charge_type is set to `PREPAID`.",
+ },
+ },
+ },
+ },
+ "space_charge_type": {
+ Type: schema.TypeString,
+ Optional: true,
+ ValidateFunc: tccommon.ValidateAllowedStringValue(SPACE_CHARGE_TYPE),
+ Description: "Workspace billing type.",
+ },
+ "space_type": {
+ Type: schema.TypeString,
+ Optional: true,
+ Description: "Workspace specifications.",
+ },
+ "image_id": {
+ Type: schema.TypeString,
+ Optional: true,
+ Description: "Image ID.",
+ },
+ "system_disk": {
+ Type: schema.TypeList,
+ Optional: true,
+ MaxItems: 1,
+ Description: "Workspace system disk information.",
+ Elem: &schema.Resource{
+ Schema: map[string]*schema.Schema{
+ "disk_id": {
+ Type: schema.TypeString,
+ Computed: true,
+ Description: "System disk snapshot ID used to initialize the system disk. When system disk type is `LOCAL_BASIC` and `LOCAL_SSD`, disk id is not supported.",
+ },
+ "disk_type": {
+ Type: schema.TypeString,
+ Optional: true,
+ ValidateFunc: tccommon.ValidateAllowedStringValue(SYSTEM_DISK_TYPE),
+ Description: "System disk type. For more information on limits of system disk types, see [Storage Overview](https://intl.cloud.tencent.com/document/product/213/4952). Valid values: `LOCAL_BASIC`: local disk, `LOCAL_SSD`: local SSD disk, `CLOUD_BASIC`: cloud disk, `CLOUD_SSD`: cloud SSD disk, `CLOUD_PREMIUM`: Premium Cloud Storage, `CLOUD_BSSD`: Basic SSD, `CLOUD_HSSD`: Enhanced SSD, `CLOUD_TSSD`: Tremendous SSD. NOTE: If modified, the instance may force stop.",
+ },
+ "disk_size": {
+ Type: schema.TypeInt,
+ Optional: true,
+ Computed: true,
+ Description: "Size of the system disk. unit is GB, Default is 50GB.",
+ },
+ },
+ },
+ },
+ "data_disks": {
+ Type: schema.TypeList,
+ Optional: true,
+ Computed: true,
+ Description: "Workspace data disk information.",
+ Elem: &schema.Resource{
+ Schema: map[string]*schema.Schema{
+ "disk_type": {
+ Type: schema.TypeString,
+ Optional: true,
+ Description: "Data disk type. For more information about limits on different data disk types, see [Storage Overview](https://intl.cloud.tencent.com/document/product/213/4952). Valid values: LOCAL_BASIC: local disk, LOCAL_SSD: local SSD disk, LOCAL_NVME: local NVME disk, specified in the InstanceType, LOCAL_PRO: local HDD disk, specified in the InstanceType, CLOUD_BASIC: HDD cloud disk, CLOUD_PREMIUM: Premium Cloud Storage, CLOUD_SSD: SSD, CLOUD_HSSD: Enhanced SSD, CLOUD_TSSD: Tremendous SSD, CLOUD_BSSD: Balanced SSD.",
+ },
+ "disk_id": {
+ Type: schema.TypeString,
+ Optional: true,
+ Computed: true,
+ Description: "Data disk ID used to initialize the data disk. When data disk type is `LOCAL_BASIC` and `LOCAL_SSD`, disk id is not supported.",
+ },
+ "disk_size": {
+ Type: schema.TypeInt,
+ Optional: true,
+ Description: "Size of the data disk, and unit is GB.",
+ },
+ "delete_with_instance": {
+ Type: schema.TypeBool,
+ Optional: true,
+ Description: "Decides whether the disk is deleted with instance(only applied to `CLOUD_BASIC`, `CLOUD_SSD` and `CLOUD_PREMIUM` disk with `POSTPAID_BY_HOUR` instance), Default is true.",
+ },
+ "snapshot_id": {
+ Type: schema.TypeString,
+ Optional: true,
+ Description: "Snapshot ID of the data disk. The selected data disk snapshot size must be smaller than the data disk size.",
+ },
+ "encrypt": {
+ Type: schema.TypeBool,
+ Optional: true,
+ Description: "Decides whether the disk is encrypted. Default is `false`.",
+ },
+ "kms_key_id": {
+ Type: schema.TypeString,
+ Optional: true,
+ Description: "Kms key ID.",
+ },
+ "throughput_performance": {
+ Type: schema.TypeInt,
+ Optional: true,
+ Description: "Add extra performance to the data disk. Only works when disk type is `CLOUD_TSSD` or `CLOUD_HSSD`.",
+ },
+ "burst_performance": {
+ Type: schema.TypeBool,
+ Optional: true,
+ Description: "Sudden performance. PS: During testing.",
+ },
+ },
+ },
+ },
+ "virtual_private_cloud": {
+ Type: schema.TypeList,
+ Optional: true,
+ MaxItems: 1,
+ Description: "VPC related information.",
+ Elem: &schema.Resource{
+ Schema: map[string]*schema.Schema{
+ "vpc_id": {
+ Type: schema.TypeString,
+ Required: true,
+ Description: "The ID of a VPC network. If you want to create instances in a VPC network, this parameter must be set.",
+ },
+ "subnet_id": {
+ Type: schema.TypeString,
+ Required: true,
+ Description: "The ID of a VPC subnet. If you want to create instances in a VPC network, this parameter must be set.",
+ },
+ "as_vpc_gateway": {
+ Type: schema.TypeBool,
+ Optional: true,
+ Description: "Is it used as a public network gateway.",
+ },
+ "private_ip_addresses": {
+ Type: schema.TypeSet,
+ Optional: true,
+ Description: "Array of private ip address.",
+ Elem: &schema.Schema{Type: schema.TypeString},
+ },
+ "ipv6_address_count": {
+ Type: schema.TypeInt,
+ Optional: true,
+ Description: "IPV6 address count.",
+ },
+ },
+ },
+ },
+ "internet_accessible": {
+ Type: schema.TypeList,
+ Optional: true,
+ MaxItems: 1,
+ Description: "Public network bandwidth settings.",
+ Elem: &schema.Resource{
+ Schema: map[string]*schema.Schema{
+ "internet_charge_type": {
+ Type: schema.TypeString,
+ Optional: true,
+ Description: "Internet charge type of the instance, Valid values are `BANDWIDTH_PREPAID`, `TRAFFIC_POSTPAID_BY_HOUR`, `BANDWIDTH_POSTPAID_BY_HOUR` and `BANDWIDTH_PACKAGE`. If not set, internet charge type are consistent with the cvm charge type by default. This value takes NO Effect when changing and does not need to be set when `allocate_public_ip` is false.",
+ },
+ "internet_max_bandwidth_out": {
+ Type: schema.TypeInt,
+ Optional: true,
+ Computed: true,
+ Description: "Maximum outgoing bandwidth to the public network, measured in Mbps (Mega bits per second). This value does not need to be set when `allocate_public_ip` is false.",
+ },
+ "public_ip_assigned": {
+ Type: schema.TypeBool,
+ Optional: true,
+ Description: "Associate a public IP address with an instance in a VPC or Classic. Boolean value, Default is false.",
+ },
+ "bandwidth_package_id": {
+ Type: schema.TypeString,
+ Optional: true,
+ Description: "Bandwidth package id. if user is standard user, then the bandwidth_package_id is needed, or default has bandwidth_package_id.",
+ },
+ },
+ },
+ },
+ "space_name": {
+ Type: schema.TypeString,
+ Optional: true,
+ Description: "Workspace Display Name.",
+ },
+ "login_settings": {
+ Type: schema.TypeList,
+ Optional: true,
+ MaxItems: 1,
+ Description: "Workspace Login Settings.",
+ Elem: &schema.Resource{
+ Schema: map[string]*schema.Schema{
+ "password": {
+ Type: schema.TypeString,
+ Optional: true,
+ Sensitive: true,
+ Description: "Password for the instance. In order for the new password to take effect, the instance will be restarted after the password change. Modifying will cause the instance reset.",
+ },
+ "key_ids": {
+ Type: schema.TypeSet,
+ Optional: true,
+ Description: "The key pair to use for the instance, it looks like `skey-16jig7tx`. Modifying will cause the instance reset.",
+ Elem: &schema.Schema{Type: schema.TypeString},
+ },
+ },
+ },
+ },
+ "security_group_ids": {
+ Type: schema.TypeSet,
+ Optional: true,
+ Computed: true,
+ Description: "Workspace Security Group.",
+ Elem: &schema.Schema{Type: schema.TypeString},
+ },
+ "enhanced_service": {
+ Type: schema.TypeList,
+ Optional: true,
+ MaxItems: 1,
+ Description: "Enhanced Services.",
+ Elem: &schema.Resource{
+ Schema: map[string]*schema.Schema{
+ "security_service": {
+ Type: schema.TypeList,
+ Optional: true,
+ MaxItems: 1,
+ Description: "Activate cloud security services. If this parameter is not specified, cloud security services will be enabled by default.",
+ Elem: &schema.Resource{
+ Schema: map[string]*schema.Schema{
+ "enabled": {
+ Type: schema.TypeBool,
+ Optional: true,
+ Description: "Whether to enable.",
+ },
+ },
+ },
+ },
+ "monitor_service": {
+ Type: schema.TypeList,
+ Optional: true,
+ MaxItems: 1,
+ Description: "Activate Tencent Cloud Observable Platform service. If this parameter is not specified, the Tencent Cloud Observable Platform service will be enabled by default.",
+ Elem: &schema.Resource{
+ Schema: map[string]*schema.Schema{
+ "enabled": {
+ Type: schema.TypeBool,
+ Optional: true,
+ Description: "Whether to enable.",
+ },
+ },
+ },
+ },
+ "automation_service": {
+ Type: schema.TypeList,
+ Optional: true,
+ MaxItems: 1,
+ Description: "Enable the TencentCloud Automation Tools (TAT) service. If this parameter is not specified, the cloud automation tools service will be enabled by default.",
+ Elem: &schema.Resource{
+ Schema: map[string]*schema.Schema{
+ "enabled": {
+ Type: schema.TypeBool,
+ Optional: true,
+ Description: "Whether to enable.",
+ },
+ },
+ },
+ },
+ },
+ },
+ },
+ "user_data": {
+ Type: schema.TypeString,
+ Optional: true,
+ Description: "User Data for Workspace.",
+ },
+ "disaster_recover_group_id": {
+ Type: schema.TypeString,
+ Optional: true,
+ Description: "Placement Group ID.",
+ },
+ "tag_specification": {
+ Type: schema.TypeList,
+ Optional: true,
+ Description: "Tag Description List.",
+ Elem: &schema.Resource{
+ Schema: map[string]*schema.Schema{
+ "tags": {
+ Type: schema.TypeList,
+ Required: true,
+ Description: "tags.",
+ Elem: &schema.Resource{
+ Schema: map[string]*schema.Schema{
+ "key": {
+ Type: schema.TypeString,
+ Required: true,
+ Description: "Tag key.",
+ },
+ "value": {
+ Type: schema.TypeString,
+ Required: true,
+ Description: "Tag value.",
+ },
+ },
+ },
+ },
+ },
+ },
+ },
+ "hpc_cluster_id": {
+ Type: schema.TypeString,
+ Optional: true,
+ Description: "Hyper Computing Cluster ID.",
+ },
+ "cam_role_name": {
+ Type: schema.TypeString,
+ Optional: true,
+ Description: "CAM role name authorized to access.",
+ },
+ "host_name": {
+ Type: schema.TypeString,
+ Optional: true,
+ Description: "The hostname of the instance. Windows instance: The name should be a combination of 2 to 15 characters comprised of letters (case insensitive), numbers, and hyphens (-). Period (.) is not supported, and the name cannot be a string of pure numbers. Other types (such as Linux) of instances: The name should be a combination of 2 to 60 characters, supporting multiple periods (.). The piece between two periods is composed of letters (case insensitive), numbers, and hyphens (-). Modifying will cause the instance reset.",
+ },
+ // computed
+ "resource_id": {
+ Type: schema.TypeString,
+ Computed: true,
+ Description: "CVM instance ID.",
+ },
+ },
+ }
+}
+
+func resourceTencentCloudThpcWorkspacesCreate(d *schema.ResourceData, meta interface{}) error {
+ defer tccommon.LogElapsed("resource.tencentcloud_thpc_workspaces.create")()
+ defer tccommon.InconsistentCheck(d, meta)()
+
+ var (
+ logId = tccommon.GetLogId(tccommon.ContextNil)
+ ctx = tccommon.NewResourceLifeCycleHandleFuncContext(context.Background(), logId, d, meta)
+ request = thpcv20230321.NewCreateWorkspacesRequest()
+ response = thpcv20230321.NewCreateWorkspacesResponse()
+ )
+
+ if v, ok := d.GetOk("client_token"); ok {
+ request.ClientToken = helper.String(v.(string))
+ }
+
+ if placementMap, ok := helper.InterfacesHeadMap(d, "placement"); ok {
+ spacePlacement := thpcv20230321.SpacePlacement{}
+ if v, ok := placementMap["zone"]; ok && v != "" {
+ spacePlacement.Zone = helper.String(v.(string))
+ }
+
+ if v, ok := placementMap["project_id"]; ok {
+ spacePlacement.ProjectId = helper.IntUint64(v.(int))
+ }
+
+ request.Placement = &spacePlacement
+ }
+
+ if spaceChargePrepaidMap, ok := helper.InterfacesHeadMap(d, "space_charge_prepaid"); ok {
+ spaceChargePrepaid := thpcv20230321.SpaceChargePrepaid{}
+ if v, ok := spaceChargePrepaidMap["period"]; ok {
+ spaceChargePrepaid.Period = helper.IntInt64(v.(int))
+ }
+
+ if v, ok := spaceChargePrepaidMap["renew_flag"]; ok && v != "" {
+ spaceChargePrepaid.RenewFlag = helper.String(v.(string))
+ }
+
+ request.SpaceChargePrepaid = &spaceChargePrepaid
+ }
+
+ if v, ok := d.GetOk("space_charge_type"); ok {
+ request.SpaceChargeType = helper.String(v.(string))
+ }
+
+ if v, ok := d.GetOk("space_type"); ok {
+ request.SpaceType = helper.String(v.(string))
+ }
+
+ if v, ok := d.GetOk("image_id"); ok {
+ request.ImageId = helper.String(v.(string))
+ }
+
+ if systemDiskMap, ok := helper.InterfacesHeadMap(d, "system_disk"); ok {
+ spaceSystemDisk := thpcv20230321.SpaceSystemDisk{}
+ if v, ok := systemDiskMap["disk_type"]; ok && v != "" {
+ spaceSystemDisk.DiskType = helper.String(v.(string))
+ }
+
+ if v, ok := systemDiskMap["disk_size"]; ok && v != "" {
+ spaceSystemDisk.DiskSize = helper.IntInt64(v.(int))
+ }
+
+ request.SystemDisk = &spaceSystemDisk
+ }
+
+ if v, ok := d.GetOk("data_disks"); ok {
+ for _, item := range v.([]interface{}) {
+ dataDisksMap := item.(map[string]interface{})
+ spaceDataDisk := thpcv20230321.SpaceDataDisk{}
+ if v, ok := dataDisksMap["disk_type"]; ok && v != "" {
+ spaceDataDisk.DiskType = helper.String(v.(string))
+ }
+
+ if v, ok := dataDisksMap["disk_id"]; ok && v != "" {
+ spaceDataDisk.DiskId = helper.String(v.(string))
+ }
+
+ if v, ok := dataDisksMap["disk_size"]; ok {
+ spaceDataDisk.DiskSize = helper.IntInt64(v.(int))
+ }
+
+ if v, ok := dataDisksMap["delete_with_instance"]; ok {
+ spaceDataDisk.DeleteWithInstance = helper.Bool(v.(bool))
+ }
+
+ if v, ok := dataDisksMap["snapshot_id"]; ok && v != "" {
+ spaceDataDisk.SnapshotId = helper.String(v.(string))
+ }
+
+ if v, ok := dataDisksMap["encrypt"]; ok {
+ spaceDataDisk.Encrypt = helper.Bool(v.(bool))
+ }
+
+ if v, ok := dataDisksMap["kms_key_id"]; ok {
+ spaceDataDisk.KmsKeyId = helper.String(v.(string))
+ }
+
+ if v, ok := dataDisksMap["throughput_performance"]; ok {
+ spaceDataDisk.ThroughputPerformance = helper.IntInt64(v.(int))
+ }
+
+ if v, ok := dataDisksMap["burst_performance"]; ok {
+ spaceDataDisk.BurstPerformance = helper.Bool(v.(bool))
+ }
+
+ request.DataDisks = append(request.DataDisks, &spaceDataDisk)
+ }
+ }
+
+ if virtualPrivateCloudMap, ok := helper.InterfacesHeadMap(d, "virtual_private_cloud"); ok {
+ spaceVirtualPrivateCloud := thpcv20230321.SpaceVirtualPrivateCloud{}
+ if v, ok := virtualPrivateCloudMap["vpc_id"]; ok && v != "" {
+ spaceVirtualPrivateCloud.VpcId = helper.String(v.(string))
+ }
+
+ if v, ok := virtualPrivateCloudMap["subnet_id"]; ok && v != "" {
+ spaceVirtualPrivateCloud.SubnetId = helper.String(v.(string))
+ }
+
+ if v, ok := virtualPrivateCloudMap["as_vpc_gateway"]; ok {
+ spaceVirtualPrivateCloud.AsVpcGateway = helper.Bool(v.(bool))
+ }
+
+ if v, ok := virtualPrivateCloudMap["private_ip_addresses"]; ok {
+ privateIpAddressesSet := v.(*schema.Set).List()
+ for i := range privateIpAddressesSet {
+ privateIpAddresses := privateIpAddressesSet[i].(string)
+ spaceVirtualPrivateCloud.PrivateIpAddresses = append(spaceVirtualPrivateCloud.PrivateIpAddresses, helper.String(privateIpAddresses))
+ }
+ }
+
+ if v, ok := virtualPrivateCloudMap["ipv6_address_count"]; ok {
+ spaceVirtualPrivateCloud.Ipv6AddressCount = helper.IntUint64(v.(int))
+ }
+
+ request.VirtualPrivateCloud = &spaceVirtualPrivateCloud
+ }
+
+ if internetAccessibleMap, ok := helper.InterfacesHeadMap(d, "internet_accessible"); ok {
+ spaceInternetAccessible := thpcv20230321.SpaceInternetAccessible{}
+ if v, ok := internetAccessibleMap["internet_charge_type"]; ok && v != "" {
+ spaceInternetAccessible.InternetChargeType = helper.String(v.(string))
+ }
+
+ if v, ok := internetAccessibleMap["internet_max_bandwidth_out"]; ok {
+ spaceInternetAccessible.InternetMaxBandwidthOut = helper.IntInt64(v.(int))
+ }
+
+ if v, ok := internetAccessibleMap["public_ip_assigned"]; ok {
+ spaceInternetAccessible.PublicIpAssigned = helper.Bool(v.(bool))
+ }
+
+ if v, ok := internetAccessibleMap["bandwidth_package_id"]; ok && v != "" {
+ spaceInternetAccessible.BandwidthPackageId = helper.String(v.(string))
+ }
+
+ request.InternetAccessible = &spaceInternetAccessible
+ }
+
+ if v, ok := d.GetOkExists("space_count"); ok {
+ request.SpaceCount = helper.IntInt64(v.(int))
+ }
+
+ if v, ok := d.GetOk("space_name"); ok {
+ request.SpaceName = helper.String(v.(string))
+ }
+
+ if loginSettingsMap, ok := helper.InterfacesHeadMap(d, "login_settings"); ok {
+ loginSettings := thpcv20230321.LoginSettings{}
+ if v, ok := loginSettingsMap["password"]; ok && v != "" {
+ loginSettings.Password = helper.String(v.(string))
+ }
+
+ if v, ok := loginSettingsMap["key_ids"]; ok {
+ keyIdsSet := v.(*schema.Set).List()
+ for i := range keyIdsSet {
+ keyIds := keyIdsSet[i].(string)
+ loginSettings.KeyIds = append(loginSettings.KeyIds, helper.String(keyIds))
+ }
+ }
+
+ request.LoginSettings = &loginSettings
+ }
+
+ if v, ok := d.GetOk("security_group_ids"); ok {
+ securityGroupIdsSet := v.(*schema.Set).List()
+ for i := range securityGroupIdsSet {
+ securityGroupIds := securityGroupIdsSet[i].(string)
+ request.SecurityGroupIds = append(request.SecurityGroupIds, helper.String(securityGroupIds))
+ }
+ }
+
+ if enhancedServiceMap, ok := helper.InterfacesHeadMap(d, "enhanced_service"); ok {
+ enhancedService := thpcv20230321.EnhancedService{}
+ if securityServiceMap, ok := helper.ConvertInterfacesHeadToMap(enhancedServiceMap["security_service"]); ok {
+ runSecurityServiceEnabled := thpcv20230321.RunSecurityServiceEnabled{}
+ if v, ok := securityServiceMap["enabled"]; ok {
+ runSecurityServiceEnabled.Enabled = helper.Bool(v.(bool))
+ }
+
+ enhancedService.SecurityService = &runSecurityServiceEnabled
+ }
+
+ if monitorServiceMap, ok := helper.ConvertInterfacesHeadToMap(enhancedServiceMap["monitor_service"]); ok {
+ runMonitorServiceEnabled := thpcv20230321.RunMonitorServiceEnabled{}
+ if v, ok := monitorServiceMap["enabled"]; ok {
+ runMonitorServiceEnabled.Enabled = helper.Bool(v.(bool))
+ }
+
+ enhancedService.MonitorService = &runMonitorServiceEnabled
+ }
+
+ if automationServiceMap, ok := helper.ConvertInterfacesHeadToMap(enhancedServiceMap["automation_service"]); ok {
+ runAutomationServiceEnabled := thpcv20230321.RunAutomationServiceEnabled{}
+ if v, ok := automationServiceMap["enabled"]; ok {
+ runAutomationServiceEnabled.Enabled = helper.Bool(v.(bool))
+ }
+
+ enhancedService.AutomationService = &runAutomationServiceEnabled
+ }
+
+ request.EnhancedService = &enhancedService
+ }
+
+ if v, ok := d.GetOk("user_data"); ok {
+ request.UserData = helper.String(v.(string))
+ }
+
+ if v, ok := d.GetOk("disaster_recover_group_id"); ok {
+ request.DisasterRecoverGroupIds = helper.Strings([]string{v.(string)})
+ }
+
+ if v, ok := d.GetOk("tag_specification"); ok {
+ for _, item := range v.([]interface{}) {
+ tagSpecificationMap := item.(map[string]interface{})
+ tagSpecification := thpcv20230321.TagSpecification{}
+ tagSpecification.ResourceType = helper.String("workspace")
+
+ if v, ok := tagSpecificationMap["tags"]; ok {
+ for _, item := range v.([]interface{}) {
+ tagsMap := item.(map[string]interface{})
+ tag := thpcv20230321.Tag{}
+ if v, ok := tagsMap["key"]; ok {
+ tag.Key = helper.String(v.(string))
+ }
+
+ if v, ok := tagsMap["value"]; ok {
+ tag.Value = helper.String(v.(string))
+ }
+
+ tagSpecification.Tags = append(tagSpecification.Tags, &tag)
+ }
+ }
+
+ request.TagSpecification = append(request.TagSpecification, &tagSpecification)
+ }
+ }
+
+ if v, ok := d.GetOk("hpc_cluster_id"); ok {
+ request.HpcClusterId = helper.String(v.(string))
+ }
+
+ if v, ok := d.GetOk("cam_role_name"); ok {
+ request.CamRoleName = helper.String(v.(string))
+ }
+
+ if v, ok := d.GetOk("host_name"); ok {
+ request.HostName = helper.String(v.(string))
+ }
+
+ err := resource.Retry(tccommon.WriteRetryTimeout, func() *resource.RetryError {
+ result, e := meta.(tccommon.ProviderMeta).GetAPIV3Conn().UseThpcV20230321Client().CreateWorkspacesWithContext(ctx, 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())
+ }
+
+ response = result
+ return nil
+ })
+
+ if err != nil {
+ log.Printf("[CRITAL]%s create thpc workspaces failed, reason:%+v", logId, err)
+ return err
+ }
+
+ spaceId := *response.Response.SpaceIdSet[0]
+
+ d.SetId(spaceId)
+
+ // wait status
+ waitRequest := thpcv20230321.NewDescribeWorkspacesRequest()
+ waitRequest.SpaceIds = helper.Strings([]string{spaceId})
+ err = resource.Retry(tccommon.ReadRetryTimeout*10, func() *resource.RetryError {
+ result, e := meta.(tccommon.ProviderMeta).GetAPIV3Conn().UseThpcV20230321Client().DescribeWorkspacesWithContext(ctx, waitRequest)
+ if e != nil {
+ return tccommon.RetryError(e)
+ } else {
+ log.Printf("[DEBUG]%s api[%s] success, request body [%s], response body [%s]\n", logId, waitRequest.GetAction(), waitRequest.ToJsonString(), result.ToJsonString())
+ }
+
+ if result == nil || result.Response == nil || len(result.Response.SpaceSet) != 1 || result.Response.SpaceSet[0].SpaceState == nil {
+ return resource.NonRetryableError(fmt.Errorf("create thpc workspaces failed"))
+ }
+
+ if *result.Response.SpaceSet[0].SpaceState != SPACE_STATE_ONLINE {
+ return resource.RetryableError(fmt.Errorf("create thpc workspaces status is %d, requestId is %s", *result.Response.SpaceSet[0].SpaceState, *result.Response.RequestId))
+ }
+
+ return nil
+ })
+
+ if err != nil {
+ log.Printf("[CRITAL]%s create thpc workspaces failed, reason:%+v", logId, err)
+ return err
+ }
+
+ return resourceTencentCloudThpcWorkspacesRead(d, meta)
+}
+
+func resourceTencentCloudThpcWorkspacesRead(d *schema.ResourceData, meta interface{}) error {
+ defer tccommon.LogElapsed("resource.tencentcloud_thpc_workspaces.read")()
+ defer tccommon.InconsistentCheck(d, meta)()
+
+ var (
+ logId = tccommon.GetLogId(tccommon.ContextNil)
+ ctx = tccommon.NewResourceLifeCycleHandleFuncContext(context.Background(), logId, d, meta)
+ service = ThpcService{client: meta.(tccommon.ProviderMeta).GetAPIV3Conn()}
+ cvmService = svccvm.NewCvmService(meta.(tccommon.ProviderMeta).GetAPIV3Conn())
+ spaceId = d.Id()
+ cvmInstanceId string
+ )
+
+ respData, err := service.DescribeThpcWorkspacesById(ctx, spaceId)
+ if err != nil {
+ return err
+ }
+
+ if respData == nil {
+ d.SetId("")
+ log.Printf("[WARN]%s resource `thpc_workspaces` [%s] not found, please check if it has been deleted.\n", logId, d.Id())
+ return nil
+ }
+
+ if respData.ResourceId != nil {
+ cvmInstanceId = *respData.ResourceId
+ }
+
+ if cvmInstanceId == "" {
+ log.Printf("[WARN]%s resource `thpc_workspaces` ResourceID not found, please check if it has been deleted.\n", logId)
+ return nil
+ }
+
+ cvmInfo, err := cvmService.DescribeInstanceById(ctx, cvmInstanceId)
+ if err != nil {
+ return err
+ }
+
+ if cvmInfo == nil || *cvmInfo.InstanceState == svccvm.CVM_STATUS_LAUNCH_FAILED {
+ log.Printf("[CRITAL]instance %s not exist or launch failed", cvmInstanceId)
+ return nil
+ }
+
+ _ = d.Set("resource_id", cvmInstanceId)
+
+ if respData.SpaceName != nil {
+ _ = d.Set("space_name", respData.SpaceName)
+ }
+
+ if respData.SpaceType != nil {
+ _ = d.Set("space_type", respData.SpaceType)
+ }
+
+ if respData.SpaceChargeType != nil {
+ _ = d.Set("space_charge_type", respData.SpaceChargeType)
+ }
+
+ if respData.Tags != nil {
+ tagsList := make([]map[string]interface{}, 0, len(respData.Tags))
+ for _, tags := range respData.Tags {
+ tagsMap := map[string]interface{}{}
+ if tags.Key != nil {
+ tagsMap["key"] = tags.Key
+ }
+
+ if tags.Value != nil {
+ tagsMap["value"] = tags.Value
+ }
+
+ tagsList = append(tagsList, tagsMap)
+ }
+
+ _ = d.Set("tag_specification", tagsList)
+ }
+
+ if cvmInfo.Placement != nil {
+ tmpList := make([]interface{}, 0)
+ tmpMap := make(map[string]interface{})
+ if cvmInfo.Placement.Zone != nil {
+ tmpMap["zone"] = cvmInfo.Placement.Zone
+ }
+
+ if cvmInfo.Placement.ProjectId != nil {
+ tmpMap["project_id"] = cvmInfo.Placement.ProjectId
+ }
+
+ tmpList = append(tmpList, tmpMap)
+
+ _ = d.Set("placement", tmpList)
+ }
+
+ if cvmInfo.ImageId != nil {
+ _ = d.Set("image_id", cvmInfo.ImageId)
+ }
+
+ if cvmInfo.SystemDisk != nil {
+ tmpList := make([]interface{}, 0)
+ tmpMap := make(map[string]interface{})
+ if cvmInfo.SystemDisk.DiskId != nil {
+ tmpMap["disk_id"] = cvmInfo.SystemDisk.DiskId
+ }
+
+ if cvmInfo.SystemDisk.DiskType != nil {
+ tmpMap["disk_type"] = cvmInfo.SystemDisk.DiskType
+ }
+
+ if cvmInfo.SystemDisk.DiskSize != nil {
+ tmpMap["disk_size"] = cvmInfo.SystemDisk.DiskSize
+ }
+
+ tmpList = append(tmpList, tmpMap)
+ _ = d.Set("system_disk", tmpList)
+ }
+
+ tmpDiskList := make([]interface{}, 0)
+ if _, ok := d.GetOk("data_disks"); ok {
+ // wait dataDisks init
+ err = resource.Retry(tccommon.ReadRetryTimeout*5, func() *resource.RetryError {
+ tmpCvmInfo, e := cvmService.DescribeInstanceById(ctx, cvmInstanceId)
+ if e != nil {
+ return tccommon.RetryError(e)
+ }
+
+ if tmpCvmInfo.DataDisks != nil && len(tmpCvmInfo.DataDisks) > 0 {
+ for _, item := range tmpCvmInfo.DataDisks {
+ if *item.DiskType == CVM_DISK_TYPE_LOCAL_NVME {
+ continue
+ }
+
+ tmpMap := make(map[string]interface{})
+ if item.DiskType != nil {
+ tmpMap["disk_type"] = item.DiskType
+ }
+
+ if item.DiskId != nil {
+ tmpMap["disk_id"] = item.DiskId
+ }
+
+ if item.DiskSize != nil {
+ tmpMap["disk_size"] = item.DiskSize
+ }
+
+ if item.DeleteWithInstance != nil {
+ tmpMap["delete_with_instance"] = item.DeleteWithInstance
+ }
+
+ if item.SnapshotId != nil {
+ tmpMap["snapshot_id"] = item.SnapshotId
+ }
+
+ if item.Encrypt != nil {
+ tmpMap["encrypt"] = item.Encrypt
+ }
+
+ if item.KmsKeyId != nil {
+ tmpMap["kms_key_id"] = item.KmsKeyId
+ }
+
+ if item.ThroughputPerformance != nil {
+ tmpMap["throughput_performance"] = item.ThroughputPerformance
+ }
+
+ if item.BurstPerformance != nil {
+ tmpMap["burst_performance"] = item.BurstPerformance
+ }
+
+ tmpDiskList = append(tmpDiskList, tmpMap)
+ }
+
+ return nil
+ }
+
+ return resource.RetryableError(fmt.Errorf("wait cvm data disks"))
+ })
+
+ if err != nil {
+ log.Printf("[CRITAL]%s get cvm data disks failed, reason:%+v", logId, err)
+ return err
+ }
+ } else {
+ for _, item := range cvmInfo.DataDisks {
+ if *item.DiskType == "LOCAL_NVME" {
+ continue
+ }
+
+ tmpMap := make(map[string]interface{})
+ if item.DiskType != nil {
+ tmpMap["disk_type"] = item.DiskType
+ }
+
+ if item.DiskId != nil {
+ tmpMap["disk_id"] = item.DiskId
+ }
+
+ if item.DiskSize != nil {
+ tmpMap["disk_size"] = item.DiskSize
+ }
+
+ if item.DeleteWithInstance != nil {
+ tmpMap["delete_with_instance"] = item.DeleteWithInstance
+ }
+
+ if item.SnapshotId != nil {
+ tmpMap["snapshot_id"] = item.SnapshotId
+ }
+
+ if item.Encrypt != nil {
+ tmpMap["encrypt"] = item.Encrypt
+ }
+
+ if item.KmsKeyId != nil {
+ tmpMap["kms_key_id"] = item.KmsKeyId
+ }
+
+ if item.ThroughputPerformance != nil {
+ tmpMap["throughput_performance"] = item.ThroughputPerformance
+ }
+
+ if item.BurstPerformance != nil {
+ tmpMap["burst_performance"] = item.BurstPerformance
+ }
+
+ tmpDiskList = append(tmpDiskList, tmpMap)
+ }
+ }
+
+ _ = d.Set("data_disks", tmpDiskList)
+
+ if cvmInfo.VirtualPrivateCloud != nil {
+ tmpList := make([]interface{}, 0)
+ tmpMap := make(map[string]interface{})
+ if cvmInfo.VirtualPrivateCloud.VpcId != nil {
+ tmpMap["vpc_id"] = cvmInfo.VirtualPrivateCloud.VpcId
+ }
+
+ if cvmInfo.VirtualPrivateCloud.SubnetId != nil {
+ tmpMap["subnet_id"] = cvmInfo.VirtualPrivateCloud.SubnetId
+ }
+
+ if cvmInfo.VirtualPrivateCloud.AsVpcGateway != nil {
+ tmpMap["as_vpc_gateway"] = cvmInfo.VirtualPrivateCloud.AsVpcGateway
+ }
+
+ if cvmInfo.PrivateIpAddresses != nil {
+ privateIpAddresseList := make([]interface{}, 0, len(cvmInfo.PrivateIpAddresses))
+ for _, privateIpAddress := range cvmInfo.PrivateIpAddresses {
+ privateIpAddresseList = append(privateIpAddresseList, privateIpAddress)
+ }
+
+ tmpMap["private_ip_addresses"] = privateIpAddresseList
+ }
+
+ if cvmInfo.VirtualPrivateCloud.Ipv6AddressCount != nil {
+ tmpMap["ipv6_address_count"] = cvmInfo.VirtualPrivateCloud.Ipv6AddressCount
+ }
+
+ tmpList = append(tmpList, tmpMap)
+ _ = d.Set("virtual_private_cloud", tmpList)
+ }
+
+ if cvmInfo.InternetAccessible != nil {
+ tmpList := make([]interface{}, 0)
+ tmpMap := make(map[string]interface{})
+ if cvmInfo.InternetAccessible.InternetChargeType != nil {
+ tmpMap["internet_charge_type"] = cvmInfo.InternetAccessible.InternetChargeType
+ }
+
+ if cvmInfo.InternetAccessible.InternetMaxBandwidthOut != nil {
+ tmpMap["internet_max_bandwidth_out"] = cvmInfo.InternetAccessible.InternetMaxBandwidthOut
+ }
+
+ if len(cvmInfo.PublicIpAddresses) > 0 {
+ tmpMap["public_ip_assigned"] = true
+ } else {
+ tmpMap["public_ip_assigned"] = false
+ }
+
+ if cvmInfo.InternetAccessible.BandwidthPackageId != nil {
+ tmpMap["bandwidth_package_id"] = cvmInfo.InternetAccessible.BandwidthPackageId
+ }
+
+ tmpList = append(tmpList, tmpMap)
+ _ = d.Set("internet_accessible", tmpList)
+ }
+
+ if cvmInfo.LoginSettings != nil {
+ tmpList := make([]interface{}, 0)
+ tmpMap := make(map[string]interface{})
+ if cvmInfo.LoginSettings.Password != nil {
+ tmpMap["password"] = cvmInfo.LoginSettings.Password
+ }
+
+ if cvmInfo.LoginSettings.KeyIds != nil {
+ keyList := make([]interface{}, 0, len(cvmInfo.LoginSettings.KeyIds))
+ for _, item := range cvmInfo.LoginSettings.KeyIds {
+ keyList = append(keyList, item)
+ }
+
+ tmpMap["key_ids"] = keyList
+ }
+
+ tmpList = append(tmpList, tmpMap)
+ _ = d.Set("login_settings", tmpList)
+ }
+
+ if cvmInfo.SecurityGroupIds != nil {
+ tmpList := make([]interface{}, 0)
+ for _, item := range cvmInfo.SecurityGroupIds {
+ tmpList = append(tmpList, item)
+ }
+
+ _ = d.Set("security_group_ids", tmpList)
+ }
+
+ if cvmInfo.DisasterRecoverGroupId != nil {
+ _ = d.Set("disaster_recover_group_id", cvmInfo.DisasterRecoverGroupId)
+ }
+
+ if cvmInfo.HpcClusterId != nil {
+ _ = d.Set("hpc_cluster_id", cvmInfo.HpcClusterId)
+ }
+
+ if cvmInfo.CamRoleName != nil {
+ _ = d.Set("cam_role_name", cvmInfo.CamRoleName)
+ }
+
+ return nil
+}
+
+func resourceTencentCloudThpcWorkspacesUpdate(d *schema.ResourceData, meta interface{}) error {
+ defer tccommon.LogElapsed("resource.tencentcloud_thpc_workspaces.update")()
+ defer tccommon.InconsistentCheck(d, meta)()
+
+ var (
+ logId = tccommon.GetLogId(tccommon.ContextNil)
+ ctx = tccommon.NewResourceLifeCycleHandleFuncContext(context.Background(), logId, d, meta)
+ spaceId = d.Id()
+ )
+
+ immutableArgs := []string{"client_token", "placement", "space_charge_prepaid", "space_charge_type", "space_type", "image_id", "virtual_private_cloud", "internet_accessible", "login_settings", "security_group_ids", "enhanced_service", "user_data", "disaster_recover_group_id", "tag_specification", "hpc_cluster_id", "cam_role_name", "host_name"}
+ for _, v := range immutableArgs {
+ if d.HasChange(v) {
+ return fmt.Errorf("argument `%s` cannot be changed", v)
+ }
+ }
+
+ if d.HasChange("space_name") {
+ request := thpcv20230321.NewModifyWorkspacesAttributeRequest()
+ request.SpaceIds = helper.Strings([]string{spaceId})
+
+ if v, ok := d.GetOk("space_name"); ok {
+ request.SpaceName = helper.String(v.(string))
+ }
+
+ err := resource.Retry(tccommon.WriteRetryTimeout, func() *resource.RetryError {
+ result, e := meta.(tccommon.ProviderMeta).GetAPIV3Conn().UseThpcV20230321Client().ModifyWorkspacesAttributeWithContext(ctx, 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 thpc workspaces space name failed, reason:%+v", logId, err)
+ return err
+ }
+ }
+
+ if d.HasChange("system_disk") {
+ sizeKey := fmt.Sprintf("system_disk.0.disk_size")
+ typeKey := fmt.Sprintf("system_disk.0.disk_type")
+ if d.HasChange(sizeKey) || d.HasChange(typeKey) {
+ instanceId := d.Get("resource_id").(string)
+ size := d.Get(sizeKey).(int)
+ diskType := d.Get(typeKey).(string)
+ req := cvm.NewResizeInstanceDisksRequest()
+ req.InstanceId = &instanceId
+ req.ForceStop = helper.Bool(true)
+ req.SystemDisk = &cvm.SystemDisk{
+ DiskSize: helper.IntInt64(size),
+ DiskType: &diskType,
+ }
+
+ // resize
+ cvmService := svccvm.NewCvmService(meta.(tccommon.ProviderMeta).GetAPIV3Conn())
+ err := cvmService.ResizeInstanceDisks(ctx, req)
+ if err != nil {
+ return fmt.Errorf("an error occurred when modifying system_disk, reason: %s", err.Error())
+ }
+
+ // wait
+ err = resource.Retry(tccommon.ReadRetryTimeout*5, func() *resource.RetryError {
+ instance, e := cvmService.DescribeInstanceById(ctx, instanceId)
+ if e != nil {
+ return resource.NonRetryableError(e)
+ }
+
+ if instance != nil && instance.LatestOperationState != nil {
+ if *instance.InstanceState == CVM_INSTANCE_STATE_FAILED {
+ return resource.NonRetryableError(fmt.Errorf("instance operation failed"))
+ }
+
+ if *instance.InstanceState == CVM_INSTANCE_STATE_OPERATING {
+ return resource.RetryableError(fmt.Errorf("instance operating"))
+ }
+ }
+
+ if instance != nil && instance.SystemDisk != nil {
+ // wait until disk result as expected
+ if *instance.SystemDisk.DiskType != diskType || int(*instance.SystemDisk.DiskSize) != size {
+ return resource.RetryableError(fmt.Errorf("waiting for expanding success"))
+ }
+ }
+
+ return nil
+ })
+
+ if err != nil {
+ return err
+ }
+ }
+ }
+
+ if d.HasChange("data_disks") {
+ o, n := d.GetChange("data_disks")
+ ov := o.([]interface{})
+ nv := n.([]interface{})
+
+ if len(ov) != len(nv) {
+ return fmt.Errorf("error: data disk count has changed (%d -> %d) but doesn't support add or remove for now", len(ov), len(nv))
+ }
+
+ cbsService := svccbs.NewCbsService(meta.(tccommon.ProviderMeta).GetAPIV3Conn())
+
+ for i := range nv {
+ sizeKey := fmt.Sprintf("data_disks.%d.disk_size", i)
+ idKey := fmt.Sprintf("data_disks.%d.disk_id", i)
+ if !d.HasChange(sizeKey) {
+ continue
+ }
+
+ size := d.Get(sizeKey).(int)
+ diskId := d.Get(idKey).(string)
+ err := cbsService.ResizeDisk(ctx, diskId, size)
+ if err != nil {
+ return fmt.Errorf("an error occurred when modifying %s, reason: %s", sizeKey, err.Error())
+ }
+ }
+ }
+
+ return resourceTencentCloudThpcWorkspacesRead(d, meta)
+}
+
+func resourceTencentCloudThpcWorkspacesDelete(d *schema.ResourceData, meta interface{}) error {
+ defer tccommon.LogElapsed("resource.tencentcloud_thpc_workspaces.delete")()
+ defer tccommon.InconsistentCheck(d, meta)()
+
+ var (
+ logId = tccommon.GetLogId(tccommon.ContextNil)
+ ctx = tccommon.NewResourceLifeCycleHandleFuncContext(context.Background(), logId, d, meta)
+ request = thpcv20230321.NewTerminateWorkspacesRequest()
+ spaceId = d.Id()
+ )
+
+ request.SpaceIds = helper.Strings([]string{spaceId})
+ request.ReleasePrepaidDataDisks = helper.Bool(true)
+ err := resource.Retry(tccommon.WriteRetryTimeout, func() *resource.RetryError {
+ result, e := meta.(tccommon.ProviderMeta).GetAPIV3Conn().UseThpcV20230321Client().TerminateWorkspacesWithContext(ctx, 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 delete thpc workspaces failed, reason:%+v", logId, err)
+ return err
+ }
+
+ // wait status
+ waitRequest := thpcv20230321.NewDescribeWorkspacesRequest()
+ waitRequest.SpaceIds = helper.Strings([]string{spaceId})
+ err = resource.Retry(tccommon.ReadRetryTimeout*10, func() *resource.RetryError {
+ result, e := meta.(tccommon.ProviderMeta).GetAPIV3Conn().UseThpcV20230321Client().DescribeWorkspacesWithContext(ctx, waitRequest)
+ if e != nil {
+ return tccommon.RetryError(e)
+ } else {
+ log.Printf("[DEBUG]%s api[%s] success, request body [%s], response body [%s]\n", logId, waitRequest.GetAction(), waitRequest.ToJsonString(), result.ToJsonString())
+ }
+
+ if result == nil || result.Response == nil || len(result.Response.SpaceSet) != 1 || result.Response.SpaceSet[0].SpaceState == nil {
+ return resource.NonRetryableError(fmt.Errorf("delete thpc workspaces failed"))
+ }
+
+ if *result.Response.SpaceSet[0].SpaceState != SPACE_STATE_ARREARS {
+ return resource.RetryableError(fmt.Errorf("delete thpc workspaces status is %d, requestId is %s", *result.Response.SpaceSet[0].SpaceState, *result.Response.RequestId))
+ }
+
+ return nil
+ })
+
+ if err != nil {
+ log.Printf("[CRITAL]%s delete thpc workspaces failed, reason:%+v", logId, err)
+ return err
+ }
+
+ // delete again
+ err = resource.Retry(tccommon.WriteRetryTimeout, func() *resource.RetryError {
+ result, e := meta.(tccommon.ProviderMeta).GetAPIV3Conn().UseThpcV20230321Client().TerminateWorkspacesWithContext(ctx, 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 delete thpc workspaces failed, reason:%+v", logId, err)
+ return err
+ }
+
+ // wait status
+ err = resource.Retry(tccommon.ReadRetryTimeout*10, func() *resource.RetryError {
+ result, e := meta.(tccommon.ProviderMeta).GetAPIV3Conn().UseThpcV20230321Client().DescribeWorkspacesWithContext(ctx, waitRequest)
+ if e != nil {
+ return tccommon.RetryError(e)
+ } else {
+ log.Printf("[DEBUG]%s api[%s] success, request body [%s], response body [%s]\n", logId, waitRequest.GetAction(), waitRequest.ToJsonString(), result.ToJsonString())
+ }
+
+ if result == nil || result.Response == nil {
+ return resource.NonRetryableError(fmt.Errorf("delete thpc workspaces failed"))
+ }
+
+ if len(result.Response.SpaceSet) != 0 {
+ return resource.RetryableError(fmt.Errorf("delete thpc workspaces status is %d, requestId is %s", *result.Response.SpaceSet[0].SpaceState, *result.Response.RequestId))
+ }
+
+ return nil
+ })
+
+ if err != nil {
+ log.Printf("[CRITAL]%s delete thpc workspaces failed, reason:%+v", logId, err)
+ return err
+ }
+
+ return nil
+}
diff --git a/tencentcloud/services/thpc/resource_tc_thpc_workspaces.md b/tencentcloud/services/thpc/resource_tc_thpc_workspaces.md
new file mode 100644
index 0000000000..c09bea7995
--- /dev/null
+++ b/tencentcloud/services/thpc/resource_tc_thpc_workspaces.md
@@ -0,0 +1,212 @@
+Provides a resource to create a THPC workspaces
+
+-> **Note:** If space_charge_type is UNDERWRITE, Not currently supported for deletion.
+
+Example Usage
+
+Create a PREPAID THPC workspaces
+
+```hcl
+variable "availability_zone" {
+ default = "ap-nanjing-1"
+}
+
+data "tencentcloud_images" "images" {
+ image_type = ["PUBLIC_IMAGE"]
+ os_name = "TencentOS Server 3.1 (TK4) UEFI"
+}
+
+# create vpc
+resource "tencentcloud_vpc" "vpc" {
+ name = "vpc"
+ cidr_block = "172.16.0.0/16"
+}
+
+# create subnet
+resource "tencentcloud_subnet" "subnet" {
+ availability_zone = var.availability_zone
+ name = "subnet"
+ vpc_id = tencentcloud_vpc.vpc.id
+ cidr_block = "172.16.0.0/24"
+ is_multicast = false
+}
+
+# create security group
+resource "tencentcloud_security_group" "example" {
+ name = "tf-example"
+ description = "security group desc."
+
+ tags = {
+ "createBy" = "Terraform"
+ }
+}
+
+# create thpc workspaces
+resource "tencentcloud_thpc_workspaces" "example" {
+ space_name = "tf-example"
+ space_charge_type = "PREPAID"
+ space_type = "96A.96XLARGE2304"
+ hpc_cluster_id = "hpc-l9anqcbl"
+ image_id = data.tencentcloud_images.images.images.0.image_id
+ security_group_ids = [tencentcloud_security_group.example.id]
+ placement {
+ zone = var.availability_zone
+ project_id = 0
+ }
+
+ space_charge_prepaid {
+ period = 1
+ renew_flag = "NOTIFY_AND_AUTO_RENEW"
+ }
+
+ system_disk {
+ disk_size = 100
+ disk_type = "CLOUD_HSSD"
+ }
+
+ data_disk {
+ disk_size = 200
+ disk_type = "CLOUD_HSSD"
+ encrypt = false
+ }
+
+ virtual_private_cloud {
+ vpc_id = tencentcloud_vpc.vpc.id
+ subnet_id = tencentcloud_subnet.subnet.id
+ as_vpc_gateway = false
+ ipv6_address_count = 0
+ }
+
+ internet_accessible {
+ internet_charge_type = "TRAFFIC_POSTPAID_BY_HOUR"
+ internet_max_bandwidth_out = 200
+ public_ip_assigned = true
+ }
+
+ login_settings {
+ password = "Password@123"
+ }
+
+ enhanced_service {
+ security_service {
+ enabled = true
+ }
+
+ monitor_service {
+ enabled = true
+ }
+
+ automation_service {
+ enabled = true
+ }
+ }
+}
+```
+
+Create a UNDERWRITE THPC workspaces
+
+```hcl
+variable "availability_zone" {
+ default = "ap-nanjing-1"
+}
+
+data "tencentcloud_images" "images" {
+ image_type = ["PUBLIC_IMAGE"]
+ os_name = "TencentOS Server 3.1 (TK4) UEFI"
+}
+
+# create vpc
+resource "tencentcloud_vpc" "vpc" {
+ name = "vpc"
+ cidr_block = "172.16.0.0/16"
+}
+
+# create subnet
+resource "tencentcloud_subnet" "subnet" {
+ availability_zone = var.availability_zone
+ name = "subnet"
+ vpc_id = tencentcloud_vpc.vpc.id
+ cidr_block = "172.16.0.0/24"
+ is_multicast = false
+}
+
+# create security group
+resource "tencentcloud_security_group" "example" {
+ name = "tf-example"
+ description = "security group desc."
+
+ tags = {
+ "createBy" = "Terraform"
+ }
+}
+
+# create thpc workspaces
+resource "tencentcloud_thpc_workspaces" "example" {
+ space_name = "tf-example"
+ space_charge_type = "UNDERWRITE"
+ space_type = "96A.96XLARGE2304"
+ hpc_cluster_id = "hpc-l9anqcbl"
+ image_id = data.tencentcloud_images.images.images.0.image_id
+ security_group_ids = [tencentcloud_security_group.example.id]
+ placement {
+ zone = var.availability_zone
+ project_id = 0
+ }
+
+ space_charge_prepaid {
+ period = 12
+ renew_flag = "NOTIFY_AND_AUTO_RENEW"
+ }
+
+ system_disk {
+ disk_size = 100
+ disk_type = "CLOUD_HSSD"
+ }
+
+ data_disks {
+ disk_size = 200
+ disk_type = "CLOUD_HSSD"
+ encrypt = false
+ }
+
+ virtual_private_cloud {
+ vpc_id = tencentcloud_vpc.vpc.id
+ subnet_id = tencentcloud_subnet.subnet.id
+ as_vpc_gateway = false
+ ipv6_address_count = 0
+ private_ip_addresses = ["172.16.0.2"]
+ }
+
+ internet_accessible {
+ internet_charge_type = "BANDWIDTH_PREPAID"
+ internet_max_bandwidth_out = 200
+ public_ip_assigned = true
+ }
+
+ login_settings {
+ key_ids = ["skey-qxjpz7uj"]
+ }
+
+ enhanced_service {
+ security_service {
+ enabled = true
+ }
+
+ monitor_service {
+ enabled = true
+ }
+
+ automation_service {
+ enabled = true
+ }
+ }
+}
+```
+
+Import
+
+thpc workspaces can be imported using the id, e.g.
+
+```
+terraform import tencentcloud_thpc_workspaces.example wks-gwg3ygz1
+```
diff --git a/tencentcloud/services/thpc/resource_tc_thpc_workspaces_test.go b/tencentcloud/services/thpc/resource_tc_thpc_workspaces_test.go
new file mode 100644
index 0000000000..d5d127899b
--- /dev/null
+++ b/tencentcloud/services/thpc/resource_tc_thpc_workspaces_test.go
@@ -0,0 +1,129 @@
+package thpc_test
+
+import (
+ "testing"
+
+ "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
+
+ tcacctest "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/acctest"
+)
+
+func TestAccTencentCloudThpcWorkspacesResource_basic(t *testing.T) {
+ t.Parallel()
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() {
+ tcacctest.AccPreCheck(t)
+ },
+ Providers: tcacctest.AccProviders,
+ Steps: []resource.TestStep{
+ {
+ Config: testAccThpcWorkspaces,
+ Check: resource.ComposeTestCheckFunc(
+ resource.TestCheckResourceAttrSet("tencentcloud_thpc_workspaces.thpc_workspaces", "id"),
+ ),
+ },
+ {
+ ResourceName: "tencentcloud_thpc_workspaces.thpc_workspaces",
+ ImportState: true,
+ ImportStateVerify: true,
+ },
+ },
+ })
+}
+
+const testAccThpcWorkspaces = `
+variable "availability_zone" {
+ default = "ap-nanjing-1"
+}
+
+data "tencentcloud_images" "images" {
+ image_type = ["PUBLIC_IMAGE"]
+ os_name = "TencentOS Server 3.1 (TK4) UEFI"
+}
+
+# create vpc
+resource "tencentcloud_vpc" "vpc" {
+ name = "vpc"
+ cidr_block = "172.16.0.0/16"
+}
+
+# create subnet
+resource "tencentcloud_subnet" "subnet" {
+ availability_zone = var.availability_zone
+ name = "subnet"
+ vpc_id = tencentcloud_vpc.vpc.id
+ cidr_block = "172.16.0.0/24"
+ is_multicast = false
+}
+
+# create security group
+resource "tencentcloud_security_group" "example" {
+ name = "tf-example"
+ description = "security group desc."
+
+ tags = {
+ "createBy" = "Terraform"
+ }
+}
+
+# create thpc workspaces
+resource "tencentcloud_thpc_workspaces" "example" {
+ space_name = "tf-example"
+ space_charge_type = "PREPAID"
+ space_type = "96A.96XLARGE2304"
+ hpc_cluster_id = "hpc-l9anqcbl"
+ image_id = data.tencentcloud_images.images.images.0.image_id
+ security_group_ids = [tencentcloud_security_group.example.id]
+ placement {
+ zone = var.availability_zone
+ project_id = 0
+ }
+
+ space_charge_prepaid {
+ period = 1
+ renew_flag = "NOTIFY_AND_AUTO_RENEW"
+ }
+
+ system_disk {
+ disk_size = 100
+ disk_type = "CLOUD_HSSD"
+ }
+
+ data_disk {
+ disk_size = 200
+ disk_type = "CLOUD_HSSD"
+ encrypt = false
+ }
+
+ virtual_private_cloud {
+ vpc_id = tencentcloud_vpc.vpc.id
+ subnet_id = tencentcloud_subnet.subnet.id
+ as_vpc_gateway = false
+ ipv6_address_count = 0
+ }
+
+ internet_accessible {
+ internet_charge_type = "TRAFFIC_POSTPAID_BY_HOUR"
+ internet_max_bandwidth_out = 200
+ public_ip_assigned = true
+ }
+
+ login_settings {
+ password = "Password@123"
+ }
+
+ enhanced_service {
+ security_service {
+ enabled = true
+ }
+
+ monitor_service {
+ enabled = true
+ }
+
+ automation_service {
+ enabled = true
+ }
+ }
+}
+`
diff --git a/tencentcloud/services/thpc/service_tencentcloud_thpc.go b/tencentcloud/services/thpc/service_tencentcloud_thpc.go
new file mode 100644
index 0000000000..bde04abf98
--- /dev/null
+++ b/tencentcloud/services/thpc/service_tencentcloud_thpc.go
@@ -0,0 +1,53 @@
+// Code generated by iacg; DO NOT EDIT.
+package thpc
+
+import (
+ "context"
+ "log"
+
+ "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/internal/helper"
+
+ thpcv20230321 "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/thpc/v20230321"
+
+ tccommon "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/common"
+ "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/connectivity"
+ "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/ratelimit"
+)
+
+func NewThpcService(client *connectivity.TencentCloudClient) ThpcService {
+ return ThpcService{client: client}
+}
+
+type ThpcService struct {
+ client *connectivity.TencentCloudClient
+}
+
+func (me *ThpcService) DescribeThpcWorkspacesById(ctx context.Context, spaceId string) (ret *thpcv20230321.SpaceInfo, errRet error) {
+ logId := tccommon.GetLogId(ctx)
+
+ request := thpcv20230321.NewDescribeWorkspacesRequest()
+ request.SpaceIds = helper.Strings([]string{spaceId})
+
+ 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.UseThpcV20230321Client().DescribeWorkspaces(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 || response.Response == nil || len(response.Response.SpaceSet) != 1 {
+ return
+ }
+
+ ret = response.Response.SpaceSet[0]
+ return
+}
diff --git a/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/thpc/LICENSE b/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/thpc/LICENSE
new file mode 100644
index 0000000000..efc75a2253
--- /dev/null
+++ b/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/thpc/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/thpc/v20230321/client.go b/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/thpc/v20230321/client.go
new file mode 100644
index 0000000000..3dad112b8a
--- /dev/null
+++ b/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/thpc/v20230321/client.go
@@ -0,0 +1,1501 @@
+// 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 v20230321
+
+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 = "2023-03-21"
+
+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 NewAddClusterStorageOptionRequest() (request *AddClusterStorageOptionRequest) {
+ request = &AddClusterStorageOptionRequest{
+ BaseRequest: &tchttp.BaseRequest{},
+ }
+
+ request.Init().WithApiInfo("thpc", APIVersion, "AddClusterStorageOption")
+
+
+ return
+}
+
+func NewAddClusterStorageOptionResponse() (response *AddClusterStorageOptionResponse) {
+ response = &AddClusterStorageOptionResponse{
+ BaseResponse: &tchttp.BaseResponse{},
+ }
+ return
+
+}
+
+// AddClusterStorageOption
+// 本接口(AddClusterStorageOption)用于添加集群存储选项信息。
+//
+// 可能返回的错误码:
+// INVALIDPARAMETER_MALFORMED = "InvalidParameter.Malformed"
+// INVALIDPARAMETERVALUE_VALUEDUPLICATED = "InvalidParameterValue.ValueDuplicated"
+// RESOURCENOTFOUND_CLUSTERID = "ResourceNotFound.ClusterId"
+func (c *Client) AddClusterStorageOption(request *AddClusterStorageOptionRequest) (response *AddClusterStorageOptionResponse, err error) {
+ return c.AddClusterStorageOptionWithContext(context.Background(), request)
+}
+
+// AddClusterStorageOption
+// 本接口(AddClusterStorageOption)用于添加集群存储选项信息。
+//
+// 可能返回的错误码:
+// INVALIDPARAMETER_MALFORMED = "InvalidParameter.Malformed"
+// INVALIDPARAMETERVALUE_VALUEDUPLICATED = "InvalidParameterValue.ValueDuplicated"
+// RESOURCENOTFOUND_CLUSTERID = "ResourceNotFound.ClusterId"
+func (c *Client) AddClusterStorageOptionWithContext(ctx context.Context, request *AddClusterStorageOptionRequest) (response *AddClusterStorageOptionResponse, err error) {
+ if request == nil {
+ request = NewAddClusterStorageOptionRequest()
+ }
+
+ if c.GetCredential() == nil {
+ return nil, errors.New("AddClusterStorageOption require credential")
+ }
+
+ request.SetContext(ctx)
+
+ response = NewAddClusterStorageOptionResponse()
+ err = c.Send(request, response)
+ return
+}
+
+func NewAddNodesRequest() (request *AddNodesRequest) {
+ request = &AddNodesRequest{
+ BaseRequest: &tchttp.BaseRequest{},
+ }
+
+ request.Init().WithApiInfo("thpc", APIVersion, "AddNodes")
+
+
+ return
+}
+
+func NewAddNodesResponse() (response *AddNodesResponse) {
+ response = &AddNodesResponse{
+ BaseResponse: &tchttp.BaseResponse{},
+ }
+ return
+
+}
+
+// AddNodes
+// 本接口(AddNodes)用于添加一个或者多个计算节点或者登录节点到指定集群。
+//
+// 可能返回的错误码:
+// DRYRUNOPERATION = "DryRunOperation"
+// INTERNALERROR_CALLCVM = "InternalError.CallCvm"
+// INVALIDPARAMETER_MALFORMED = "InvalidParameter.Malformed"
+// INVALIDPARAMETERVALUE_NOTSUPPORTED = "InvalidParameterValue.NotSupported"
+// INVALIDPARAMETERVALUE_PARAMETERSNOTSUPPORTED = "InvalidParameterValue.ParametersNotSupported"
+// INVALIDPARAMETERVALUE_TOOLARGE = "InvalidParameterValue.TooLarge"
+// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong"
+// INVALIDPARAMETERVALUE_TOOSMALL = "InvalidParameterValue.TooSmall"
+// MISSINGPARAMETER = "MissingParameter"
+// RESOURCEINSUFFICIENT = "ResourceInsufficient"
+// RESOURCENOTFOUND_CLUSTERID = "ResourceNotFound.ClusterId"
+// RESOURCENOTFOUND_IMAGEID = "ResourceNotFound.ImageId"
+// RESOURCENOTFOUND_QUEUE = "ResourceNotFound.Queue"
+// UNSUPPORTEDOPERATION_CLUSTERSTATUSNOTSUPPORT = "UnsupportedOperation.ClusterStatusNotSupport"
+// UNSUPPORTEDOPERATION_VPCIDCONFLICT = "UnsupportedOperation.VpcIdConflict"
+func (c *Client) AddNodes(request *AddNodesRequest) (response *AddNodesResponse, err error) {
+ return c.AddNodesWithContext(context.Background(), request)
+}
+
+// AddNodes
+// 本接口(AddNodes)用于添加一个或者多个计算节点或者登录节点到指定集群。
+//
+// 可能返回的错误码:
+// DRYRUNOPERATION = "DryRunOperation"
+// INTERNALERROR_CALLCVM = "InternalError.CallCvm"
+// INVALIDPARAMETER_MALFORMED = "InvalidParameter.Malformed"
+// INVALIDPARAMETERVALUE_NOTSUPPORTED = "InvalidParameterValue.NotSupported"
+// INVALIDPARAMETERVALUE_PARAMETERSNOTSUPPORTED = "InvalidParameterValue.ParametersNotSupported"
+// INVALIDPARAMETERVALUE_TOOLARGE = "InvalidParameterValue.TooLarge"
+// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong"
+// INVALIDPARAMETERVALUE_TOOSMALL = "InvalidParameterValue.TooSmall"
+// MISSINGPARAMETER = "MissingParameter"
+// RESOURCEINSUFFICIENT = "ResourceInsufficient"
+// RESOURCENOTFOUND_CLUSTERID = "ResourceNotFound.ClusterId"
+// RESOURCENOTFOUND_IMAGEID = "ResourceNotFound.ImageId"
+// RESOURCENOTFOUND_QUEUE = "ResourceNotFound.Queue"
+// UNSUPPORTEDOPERATION_CLUSTERSTATUSNOTSUPPORT = "UnsupportedOperation.ClusterStatusNotSupport"
+// UNSUPPORTEDOPERATION_VPCIDCONFLICT = "UnsupportedOperation.VpcIdConflict"
+func (c *Client) AddNodesWithContext(ctx context.Context, request *AddNodesRequest) (response *AddNodesResponse, err error) {
+ if request == nil {
+ request = NewAddNodesRequest()
+ }
+
+ if c.GetCredential() == nil {
+ return nil, errors.New("AddNodes require credential")
+ }
+
+ request.SetContext(ctx)
+
+ response = NewAddNodesResponse()
+ err = c.Send(request, response)
+ return
+}
+
+func NewAddQueueRequest() (request *AddQueueRequest) {
+ request = &AddQueueRequest{
+ BaseRequest: &tchttp.BaseRequest{},
+ }
+
+ request.Init().WithApiInfo("thpc", APIVersion, "AddQueue")
+
+
+ return
+}
+
+func NewAddQueueResponse() (response *AddQueueResponse) {
+ response = &AddQueueResponse{
+ BaseResponse: &tchttp.BaseResponse{},
+ }
+ return
+
+}
+
+// AddQueue
+// 本接口(AddQueue)用于添加队列到指定集群。
+//
+// * 本接口为目前只支持SchedulerType为SLURM的集群。
+//
+// * 单个集群中队列数量上限为10个。
+//
+// 可能返回的错误码:
+// AUTHFAILURE = "AuthFailure"
+// FAILEDOPERATION = "FailedOperation"
+// INVALIDPARAMETER_MALFORMED = "InvalidParameter.Malformed"
+// INVALIDPARAMETERVALUE_NOTSUPPORTED = "InvalidParameterValue.NotSupported"
+// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong"
+// INVALIDPARAMETERVALUE_TOOSMALL = "InvalidParameterValue.TooSmall"
+// INVALIDPARAMETERVALUE_VALUEDUPLICATED = "InvalidParameterValue.ValueDuplicated"
+// LIMITEXCEEDED = "LimitExceeded"
+// LIMITEXCEEDED_QUEUENUMLIMIT = "LimitExceeded.QueueNumLimit"
+// OPERATIONDENIED = "OperationDenied"
+// REQUESTLIMITEXCEEDED = "RequestLimitExceeded"
+// RESOURCENOTFOUND = "ResourceNotFound"
+// RESOURCENOTFOUND_CLUSTERID = "ResourceNotFound.ClusterId"
+// UNSUPPORTEDOPERATION = "UnsupportedOperation"
+// UNSUPPORTEDOPERATION_CLUSTERSTATUSNOTSUPPORT = "UnsupportedOperation.ClusterStatusNotSupport"
+func (c *Client) AddQueue(request *AddQueueRequest) (response *AddQueueResponse, err error) {
+ return c.AddQueueWithContext(context.Background(), request)
+}
+
+// AddQueue
+// 本接口(AddQueue)用于添加队列到指定集群。
+//
+// * 本接口为目前只支持SchedulerType为SLURM的集群。
+//
+// * 单个集群中队列数量上限为10个。
+//
+// 可能返回的错误码:
+// AUTHFAILURE = "AuthFailure"
+// FAILEDOPERATION = "FailedOperation"
+// INVALIDPARAMETER_MALFORMED = "InvalidParameter.Malformed"
+// INVALIDPARAMETERVALUE_NOTSUPPORTED = "InvalidParameterValue.NotSupported"
+// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong"
+// INVALIDPARAMETERVALUE_TOOSMALL = "InvalidParameterValue.TooSmall"
+// INVALIDPARAMETERVALUE_VALUEDUPLICATED = "InvalidParameterValue.ValueDuplicated"
+// LIMITEXCEEDED = "LimitExceeded"
+// LIMITEXCEEDED_QUEUENUMLIMIT = "LimitExceeded.QueueNumLimit"
+// OPERATIONDENIED = "OperationDenied"
+// REQUESTLIMITEXCEEDED = "RequestLimitExceeded"
+// RESOURCENOTFOUND = "ResourceNotFound"
+// RESOURCENOTFOUND_CLUSTERID = "ResourceNotFound.ClusterId"
+// UNSUPPORTEDOPERATION = "UnsupportedOperation"
+// UNSUPPORTEDOPERATION_CLUSTERSTATUSNOTSUPPORT = "UnsupportedOperation.ClusterStatusNotSupport"
+func (c *Client) AddQueueWithContext(ctx context.Context, request *AddQueueRequest) (response *AddQueueResponse, err error) {
+ if request == nil {
+ request = NewAddQueueRequest()
+ }
+
+ if c.GetCredential() == nil {
+ return nil, errors.New("AddQueue require credential")
+ }
+
+ request.SetContext(ctx)
+
+ response = NewAddQueueResponse()
+ err = c.Send(request, response)
+ return
+}
+
+func NewAttachNodesRequest() (request *AttachNodesRequest) {
+ request = &AttachNodesRequest{
+ BaseRequest: &tchttp.BaseRequest{},
+ }
+
+ request.Init().WithApiInfo("thpc", APIVersion, "AttachNodes")
+
+
+ return
+}
+
+func NewAttachNodesResponse() (response *AttachNodesResponse) {
+ response = &AttachNodesResponse{
+ BaseResponse: &tchttp.BaseResponse{},
+ }
+ return
+
+}
+
+// AttachNodes
+// 本接口 (AttachNodes) 用于绑定一个或者多个计算节点指定资源到指定集群中。
+//
+// 可能返回的错误码:
+// AUTHFAILURE = "AuthFailure"
+// FAILEDOPERATION = "FailedOperation"
+// INVALIDPARAMETER_MALFORMED = "InvalidParameter.Malformed"
+// INVALIDPARAMETERVALUE_NOTSUPPORTED = "InvalidParameterValue.NotSupported"
+// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong"
+// INVALIDPARAMETERVALUE_TOOSMALL = "InvalidParameterValue.TooSmall"
+// INVALIDPARAMETERVALUE_VALUEDUPLICATED = "InvalidParameterValue.ValueDuplicated"
+// LIMITEXCEEDED = "LimitExceeded"
+// LIMITEXCEEDED_QUEUENUMLIMIT = "LimitExceeded.QueueNumLimit"
+// OPERATIONDENIED = "OperationDenied"
+// REQUESTLIMITEXCEEDED = "RequestLimitExceeded"
+// RESOURCENOTFOUND = "ResourceNotFound"
+// RESOURCENOTFOUND_CLUSTERID = "ResourceNotFound.ClusterId"
+// UNSUPPORTEDOPERATION = "UnsupportedOperation"
+// UNSUPPORTEDOPERATION_CLUSTERSTATUSNOTSUPPORT = "UnsupportedOperation.ClusterStatusNotSupport"
+func (c *Client) AttachNodes(request *AttachNodesRequest) (response *AttachNodesResponse, err error) {
+ return c.AttachNodesWithContext(context.Background(), request)
+}
+
+// AttachNodes
+// 本接口 (AttachNodes) 用于绑定一个或者多个计算节点指定资源到指定集群中。
+//
+// 可能返回的错误码:
+// AUTHFAILURE = "AuthFailure"
+// FAILEDOPERATION = "FailedOperation"
+// INVALIDPARAMETER_MALFORMED = "InvalidParameter.Malformed"
+// INVALIDPARAMETERVALUE_NOTSUPPORTED = "InvalidParameterValue.NotSupported"
+// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong"
+// INVALIDPARAMETERVALUE_TOOSMALL = "InvalidParameterValue.TooSmall"
+// INVALIDPARAMETERVALUE_VALUEDUPLICATED = "InvalidParameterValue.ValueDuplicated"
+// LIMITEXCEEDED = "LimitExceeded"
+// LIMITEXCEEDED_QUEUENUMLIMIT = "LimitExceeded.QueueNumLimit"
+// OPERATIONDENIED = "OperationDenied"
+// REQUESTLIMITEXCEEDED = "RequestLimitExceeded"
+// RESOURCENOTFOUND = "ResourceNotFound"
+// RESOURCENOTFOUND_CLUSTERID = "ResourceNotFound.ClusterId"
+// UNSUPPORTEDOPERATION = "UnsupportedOperation"
+// UNSUPPORTEDOPERATION_CLUSTERSTATUSNOTSUPPORT = "UnsupportedOperation.ClusterStatusNotSupport"
+func (c *Client) AttachNodesWithContext(ctx context.Context, request *AttachNodesRequest) (response *AttachNodesResponse, err error) {
+ if request == nil {
+ request = NewAttachNodesRequest()
+ }
+
+ if c.GetCredential() == nil {
+ return nil, errors.New("AttachNodes require credential")
+ }
+
+ request.SetContext(ctx)
+
+ response = NewAttachNodesResponse()
+ err = c.Send(request, response)
+ return
+}
+
+func NewCreateClusterRequest() (request *CreateClusterRequest) {
+ request = &CreateClusterRequest{
+ BaseRequest: &tchttp.BaseRequest{},
+ }
+
+ request.Init().WithApiInfo("thpc", APIVersion, "CreateCluster")
+
+
+ return
+}
+
+func NewCreateClusterResponse() (response *CreateClusterResponse) {
+ response = &CreateClusterResponse{
+ BaseResponse: &tchttp.BaseResponse{},
+ }
+ return
+
+}
+
+// CreateCluster
+// 本接口 (CreateCluster) 用于创建并启动集群。
+//
+//
+//
+// * 本接口为异步接口, 当创建集群请求下发成功后会返回一个集群`ID`和一个`RequestId`,此时创建集群操作并未立即完成。在此期间集群的状态将会处于“PENDING”或者“INITING”,集群创建结果可以通过调用 [DescribeClusters](https://cloud.tencent.com/document/product/1527/72100) 接口查询,如果集群状态(ClusterStatus)变为“RUNNING(运行中)”,则代表集群创建成功,“ INIT_FAILED”代表集群创建失败。
+//
+// 可能返回的错误码:
+// INTERNALERROR_CALLCAM = "InternalError.CallCAM"
+// INTERNALERROR_CALLCVM = "InternalError.CallCvm"
+// INVALIDPARAMETER_MALFORMED = "InvalidParameter.Malformed"
+// INVALIDPARAMETERVALUE = "InvalidParameterValue"
+// INVALIDPARAMETERVALUE_NOTSUPPORTED = "InvalidParameterValue.NotSupported"
+// INVALIDPARAMETERVALUE_PARAMETERSNOTSUPPORTED = "InvalidParameterValue.ParametersNotSupported"
+// INVALIDPARAMETERVALUE_TOOLARGE = "InvalidParameterValue.TooLarge"
+// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong"
+// INVALIDPARAMETERVALUE_TOOSHORT = "InvalidParameterValue.TooShort"
+// INVALIDPARAMETERVALUE_TOOSMALL = "InvalidParameterValue.TooSmall"
+// RESOURCENOTFOUND_IMAGEID = "ResourceNotFound.ImageId"
+func (c *Client) CreateCluster(request *CreateClusterRequest) (response *CreateClusterResponse, err error) {
+ return c.CreateClusterWithContext(context.Background(), request)
+}
+
+// CreateCluster
+// 本接口 (CreateCluster) 用于创建并启动集群。
+//
+//
+//
+// * 本接口为异步接口, 当创建集群请求下发成功后会返回一个集群`ID`和一个`RequestId`,此时创建集群操作并未立即完成。在此期间集群的状态将会处于“PENDING”或者“INITING”,集群创建结果可以通过调用 [DescribeClusters](https://cloud.tencent.com/document/product/1527/72100) 接口查询,如果集群状态(ClusterStatus)变为“RUNNING(运行中)”,则代表集群创建成功,“ INIT_FAILED”代表集群创建失败。
+//
+// 可能返回的错误码:
+// INTERNALERROR_CALLCAM = "InternalError.CallCAM"
+// INTERNALERROR_CALLCVM = "InternalError.CallCvm"
+// INVALIDPARAMETER_MALFORMED = "InvalidParameter.Malformed"
+// INVALIDPARAMETERVALUE = "InvalidParameterValue"
+// INVALIDPARAMETERVALUE_NOTSUPPORTED = "InvalidParameterValue.NotSupported"
+// INVALIDPARAMETERVALUE_PARAMETERSNOTSUPPORTED = "InvalidParameterValue.ParametersNotSupported"
+// INVALIDPARAMETERVALUE_TOOLARGE = "InvalidParameterValue.TooLarge"
+// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong"
+// INVALIDPARAMETERVALUE_TOOSHORT = "InvalidParameterValue.TooShort"
+// INVALIDPARAMETERVALUE_TOOSMALL = "InvalidParameterValue.TooSmall"
+// RESOURCENOTFOUND_IMAGEID = "ResourceNotFound.ImageId"
+func (c *Client) CreateClusterWithContext(ctx context.Context, request *CreateClusterRequest) (response *CreateClusterResponse, err error) {
+ if request == nil {
+ request = NewCreateClusterRequest()
+ }
+
+ if c.GetCredential() == nil {
+ return nil, errors.New("CreateCluster require credential")
+ }
+
+ request.SetContext(ctx)
+
+ response = NewCreateClusterResponse()
+ err = c.Send(request, response)
+ return
+}
+
+func NewCreateWorkspacesRequest() (request *CreateWorkspacesRequest) {
+ request = &CreateWorkspacesRequest{
+ BaseRequest: &tchttp.BaseRequest{},
+ }
+
+ request.Init().WithApiInfo("thpc", APIVersion, "CreateWorkspaces")
+
+
+ return
+}
+
+func NewCreateWorkspacesResponse() (response *CreateWorkspacesResponse) {
+ response = &CreateWorkspacesResponse{
+ BaseResponse: &tchttp.BaseResponse{},
+ }
+ return
+
+}
+
+// CreateWorkspaces
+// 本接口 (CreateWorkspaces) 用于创建工作空间。
+//
+// 可能返回的错误码:
+// INTERNALERROR_CALLCAM = "InternalError.CallCAM"
+// INTERNALERROR_CALLCVM = "InternalError.CallCvm"
+// INVALIDPARAMETER_MALFORMED = "InvalidParameter.Malformed"
+// INVALIDPARAMETERVALUE = "InvalidParameterValue"
+// INVALIDPARAMETERVALUE_NOTSUPPORTED = "InvalidParameterValue.NotSupported"
+// INVALIDPARAMETERVALUE_PARAMETERSNOTSUPPORTED = "InvalidParameterValue.ParametersNotSupported"
+// INVALIDPARAMETERVALUE_TOOLARGE = "InvalidParameterValue.TooLarge"
+// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong"
+// INVALIDPARAMETERVALUE_TOOSHORT = "InvalidParameterValue.TooShort"
+// INVALIDPARAMETERVALUE_TOOSMALL = "InvalidParameterValue.TooSmall"
+// RESOURCENOTFOUND_IMAGEID = "ResourceNotFound.ImageId"
+func (c *Client) CreateWorkspaces(request *CreateWorkspacesRequest) (response *CreateWorkspacesResponse, err error) {
+ return c.CreateWorkspacesWithContext(context.Background(), request)
+}
+
+// CreateWorkspaces
+// 本接口 (CreateWorkspaces) 用于创建工作空间。
+//
+// 可能返回的错误码:
+// INTERNALERROR_CALLCAM = "InternalError.CallCAM"
+// INTERNALERROR_CALLCVM = "InternalError.CallCvm"
+// INVALIDPARAMETER_MALFORMED = "InvalidParameter.Malformed"
+// INVALIDPARAMETERVALUE = "InvalidParameterValue"
+// INVALIDPARAMETERVALUE_NOTSUPPORTED = "InvalidParameterValue.NotSupported"
+// INVALIDPARAMETERVALUE_PARAMETERSNOTSUPPORTED = "InvalidParameterValue.ParametersNotSupported"
+// INVALIDPARAMETERVALUE_TOOLARGE = "InvalidParameterValue.TooLarge"
+// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong"
+// INVALIDPARAMETERVALUE_TOOSHORT = "InvalidParameterValue.TooShort"
+// INVALIDPARAMETERVALUE_TOOSMALL = "InvalidParameterValue.TooSmall"
+// RESOURCENOTFOUND_IMAGEID = "ResourceNotFound.ImageId"
+func (c *Client) CreateWorkspacesWithContext(ctx context.Context, request *CreateWorkspacesRequest) (response *CreateWorkspacesResponse, err error) {
+ if request == nil {
+ request = NewCreateWorkspacesRequest()
+ }
+
+ if c.GetCredential() == nil {
+ return nil, errors.New("CreateWorkspaces require credential")
+ }
+
+ request.SetContext(ctx)
+
+ response = NewCreateWorkspacesResponse()
+ err = c.Send(request, response)
+ return
+}
+
+func NewDeleteClusterRequest() (request *DeleteClusterRequest) {
+ request = &DeleteClusterRequest{
+ BaseRequest: &tchttp.BaseRequest{},
+ }
+
+ request.Init().WithApiInfo("thpc", APIVersion, "DeleteCluster")
+
+
+ return
+}
+
+func NewDeleteClusterResponse() (response *DeleteClusterResponse) {
+ response = &DeleteClusterResponse{
+ BaseResponse: &tchttp.BaseResponse{},
+ }
+ return
+
+}
+
+// DeleteCluster
+// 本接口(DeleteCluster)用于删除一个指定的集群。
+//
+// 可能返回的错误码:
+// INVALIDPARAMETER_MALFORMED = "InvalidParameter.Malformed"
+// RESOURCENOTFOUND_CLUSTERID = "ResourceNotFound.ClusterId"
+// UNSUPPORTEDOPERATION_CLUSTERSTATUSNOTSUPPORT = "UnsupportedOperation.ClusterStatusNotSupport"
+func (c *Client) DeleteCluster(request *DeleteClusterRequest) (response *DeleteClusterResponse, err error) {
+ return c.DeleteClusterWithContext(context.Background(), request)
+}
+
+// DeleteCluster
+// 本接口(DeleteCluster)用于删除一个指定的集群。
+//
+// 可能返回的错误码:
+// INVALIDPARAMETER_MALFORMED = "InvalidParameter.Malformed"
+// RESOURCENOTFOUND_CLUSTERID = "ResourceNotFound.ClusterId"
+// UNSUPPORTEDOPERATION_CLUSTERSTATUSNOTSUPPORT = "UnsupportedOperation.ClusterStatusNotSupport"
+func (c *Client) DeleteClusterWithContext(ctx context.Context, request *DeleteClusterRequest) (response *DeleteClusterResponse, err error) {
+ if request == nil {
+ request = NewDeleteClusterRequest()
+ }
+
+ if c.GetCredential() == nil {
+ return nil, errors.New("DeleteCluster require credential")
+ }
+
+ request.SetContext(ctx)
+
+ response = NewDeleteClusterResponse()
+ err = c.Send(request, response)
+ return
+}
+
+func NewDeleteClusterStorageOptionRequest() (request *DeleteClusterStorageOptionRequest) {
+ request = &DeleteClusterStorageOptionRequest{
+ BaseRequest: &tchttp.BaseRequest{},
+ }
+
+ request.Init().WithApiInfo("thpc", APIVersion, "DeleteClusterStorageOption")
+
+
+ return
+}
+
+func NewDeleteClusterStorageOptionResponse() (response *DeleteClusterStorageOptionResponse) {
+ response = &DeleteClusterStorageOptionResponse{
+ BaseResponse: &tchttp.BaseResponse{},
+ }
+ return
+
+}
+
+// DeleteClusterStorageOption
+// 本接口 (DeleteClusterStorageOption) 用于删除集群存储选项信息。
+//
+// 可能返回的错误码:
+// RESOURCENOTFOUND_CLUSTERID = "ResourceNotFound.ClusterId"
+// RESOURCENOTFOUND_LOCALPATH = "ResourceNotFound.LocalPath"
+func (c *Client) DeleteClusterStorageOption(request *DeleteClusterStorageOptionRequest) (response *DeleteClusterStorageOptionResponse, err error) {
+ return c.DeleteClusterStorageOptionWithContext(context.Background(), request)
+}
+
+// DeleteClusterStorageOption
+// 本接口 (DeleteClusterStorageOption) 用于删除集群存储选项信息。
+//
+// 可能返回的错误码:
+// RESOURCENOTFOUND_CLUSTERID = "ResourceNotFound.ClusterId"
+// RESOURCENOTFOUND_LOCALPATH = "ResourceNotFound.LocalPath"
+func (c *Client) DeleteClusterStorageOptionWithContext(ctx context.Context, request *DeleteClusterStorageOptionRequest) (response *DeleteClusterStorageOptionResponse, err error) {
+ if request == nil {
+ request = NewDeleteClusterStorageOptionRequest()
+ }
+
+ if c.GetCredential() == nil {
+ return nil, errors.New("DeleteClusterStorageOption require credential")
+ }
+
+ request.SetContext(ctx)
+
+ response = NewDeleteClusterStorageOptionResponse()
+ err = c.Send(request, response)
+ return
+}
+
+func NewDeleteNodesRequest() (request *DeleteNodesRequest) {
+ request = &DeleteNodesRequest{
+ BaseRequest: &tchttp.BaseRequest{},
+ }
+
+ request.Init().WithApiInfo("thpc", APIVersion, "DeleteNodes")
+
+
+ return
+}
+
+func NewDeleteNodesResponse() (response *DeleteNodesResponse) {
+ response = &DeleteNodesResponse{
+ BaseResponse: &tchttp.BaseResponse{},
+ }
+ return
+
+}
+
+// DeleteNodes
+// 本接口(DeleteNodes)用于删除指定集群中一个或者多个计算节点或者登录节点。
+//
+// 可能返回的错误码:
+// INVALIDPARAMETER_MALFORMED = "InvalidParameter.Malformed"
+// RESOURCENOTFOUND_CLUSTERID = "ResourceNotFound.ClusterId"
+// RESOURCENOTFOUND_NODEID = "ResourceNotFound.NodeId"
+// UNSUPPORTEDOPERATION_CLUSTERSTATUSNOTSUPPORT = "UnsupportedOperation.ClusterStatusNotSupport"
+// UNSUPPORTEDOPERATION_INVALIDNODEROLE = "UnsupportedOperation.InvalidNodeRole"
+// UNSUPPORTEDOPERATION_NODESTATUSNOTSUPPORT = "UnsupportedOperation.NodeStatusNotSupport"
+func (c *Client) DeleteNodes(request *DeleteNodesRequest) (response *DeleteNodesResponse, err error) {
+ return c.DeleteNodesWithContext(context.Background(), request)
+}
+
+// DeleteNodes
+// 本接口(DeleteNodes)用于删除指定集群中一个或者多个计算节点或者登录节点。
+//
+// 可能返回的错误码:
+// INVALIDPARAMETER_MALFORMED = "InvalidParameter.Malformed"
+// RESOURCENOTFOUND_CLUSTERID = "ResourceNotFound.ClusterId"
+// RESOURCENOTFOUND_NODEID = "ResourceNotFound.NodeId"
+// UNSUPPORTEDOPERATION_CLUSTERSTATUSNOTSUPPORT = "UnsupportedOperation.ClusterStatusNotSupport"
+// UNSUPPORTEDOPERATION_INVALIDNODEROLE = "UnsupportedOperation.InvalidNodeRole"
+// UNSUPPORTEDOPERATION_NODESTATUSNOTSUPPORT = "UnsupportedOperation.NodeStatusNotSupport"
+func (c *Client) DeleteNodesWithContext(ctx context.Context, request *DeleteNodesRequest) (response *DeleteNodesResponse, err error) {
+ if request == nil {
+ request = NewDeleteNodesRequest()
+ }
+
+ if c.GetCredential() == nil {
+ return nil, errors.New("DeleteNodes require credential")
+ }
+
+ request.SetContext(ctx)
+
+ response = NewDeleteNodesResponse()
+ err = c.Send(request, response)
+ return
+}
+
+func NewDeleteQueueRequest() (request *DeleteQueueRequest) {
+ request = &DeleteQueueRequest{
+ BaseRequest: &tchttp.BaseRequest{},
+ }
+
+ request.Init().WithApiInfo("thpc", APIVersion, "DeleteQueue")
+
+
+ return
+}
+
+func NewDeleteQueueResponse() (response *DeleteQueueResponse) {
+ response = &DeleteQueueResponse{
+ BaseResponse: &tchttp.BaseResponse{},
+ }
+ return
+
+}
+
+// DeleteQueue
+// 本接口(DeleteQueue)用于从指定集群删除队列。
+//
+// * 本接口为目前只支持SchedulerType为SLURM的集群。
+//
+//
+//
+// * 删除队列时,需要保证队列内不存在节点。
+//
+// 可能返回的错误码:
+// FAILEDOPERATION = "FailedOperation"
+// INTERNALERROR = "InternalError"
+// INVALIDPARAMETER = "InvalidParameter"
+// INVALIDPARAMETER_MALFORMED = "InvalidParameter.Malformed"
+// INVALIDPARAMETERVALUE = "InvalidParameterValue"
+// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded"
+// INVALIDPARAMETERVALUE_NOTSUPPORTED = "InvalidParameterValue.NotSupported"
+// INVALIDPARAMETERVALUE_PARAMETERSNOTSUPPORTED = "InvalidParameterValue.ParametersNotSupported"
+// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong"
+// INVALIDPARAMETERVALUE_TOOSHORT = "InvalidParameterValue.TooShort"
+// INVALIDPARAMETERVALUE_TOOSMALL = "InvalidParameterValue.TooSmall"
+// INVALIDPARAMETERVALUE_VALUEDUPLICATED = "InvalidParameterValue.ValueDuplicated"
+// LIMITEXCEEDED = "LimitExceeded"
+// MISSINGPARAMETER = "MissingParameter"
+// RESOURCEINUSE = "ResourceInUse"
+// RESOURCENOTFOUND = "ResourceNotFound"
+// RESOURCENOTFOUND_CLUSTERID = "ResourceNotFound.ClusterId"
+// RESOURCENOTFOUND_QUEUE = "ResourceNotFound.Queue"
+// UNAUTHORIZEDOPERATION = "UnauthorizedOperation"
+// UNKNOWNPARAMETER = "UnknownParameter"
+// UNSUPPORTEDOPERATION_CLUSTERSTATUSNOTSUPPORT = "UnsupportedOperation.ClusterStatusNotSupport"
+// UNSUPPORTEDOPERATION_QUEUENOTEMPTY = "UnsupportedOperation.QueueNotEmpty"
+func (c *Client) DeleteQueue(request *DeleteQueueRequest) (response *DeleteQueueResponse, err error) {
+ return c.DeleteQueueWithContext(context.Background(), request)
+}
+
+// DeleteQueue
+// 本接口(DeleteQueue)用于从指定集群删除队列。
+//
+// * 本接口为目前只支持SchedulerType为SLURM的集群。
+//
+//
+//
+// * 删除队列时,需要保证队列内不存在节点。
+//
+// 可能返回的错误码:
+// FAILEDOPERATION = "FailedOperation"
+// INTERNALERROR = "InternalError"
+// INVALIDPARAMETER = "InvalidParameter"
+// INVALIDPARAMETER_MALFORMED = "InvalidParameter.Malformed"
+// INVALIDPARAMETERVALUE = "InvalidParameterValue"
+// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded"
+// INVALIDPARAMETERVALUE_NOTSUPPORTED = "InvalidParameterValue.NotSupported"
+// INVALIDPARAMETERVALUE_PARAMETERSNOTSUPPORTED = "InvalidParameterValue.ParametersNotSupported"
+// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong"
+// INVALIDPARAMETERVALUE_TOOSHORT = "InvalidParameterValue.TooShort"
+// INVALIDPARAMETERVALUE_TOOSMALL = "InvalidParameterValue.TooSmall"
+// INVALIDPARAMETERVALUE_VALUEDUPLICATED = "InvalidParameterValue.ValueDuplicated"
+// LIMITEXCEEDED = "LimitExceeded"
+// MISSINGPARAMETER = "MissingParameter"
+// RESOURCEINUSE = "ResourceInUse"
+// RESOURCENOTFOUND = "ResourceNotFound"
+// RESOURCENOTFOUND_CLUSTERID = "ResourceNotFound.ClusterId"
+// RESOURCENOTFOUND_QUEUE = "ResourceNotFound.Queue"
+// UNAUTHORIZEDOPERATION = "UnauthorizedOperation"
+// UNKNOWNPARAMETER = "UnknownParameter"
+// UNSUPPORTEDOPERATION_CLUSTERSTATUSNOTSUPPORT = "UnsupportedOperation.ClusterStatusNotSupport"
+// UNSUPPORTEDOPERATION_QUEUENOTEMPTY = "UnsupportedOperation.QueueNotEmpty"
+func (c *Client) DeleteQueueWithContext(ctx context.Context, request *DeleteQueueRequest) (response *DeleteQueueResponse, err error) {
+ if request == nil {
+ request = NewDeleteQueueRequest()
+ }
+
+ if c.GetCredential() == nil {
+ return nil, errors.New("DeleteQueue require credential")
+ }
+
+ request.SetContext(ctx)
+
+ response = NewDeleteQueueResponse()
+ err = c.Send(request, response)
+ return
+}
+
+func NewDescribeAutoScalingConfigurationRequest() (request *DescribeAutoScalingConfigurationRequest) {
+ request = &DescribeAutoScalingConfigurationRequest{
+ BaseRequest: &tchttp.BaseRequest{},
+ }
+
+ request.Init().WithApiInfo("thpc", APIVersion, "DescribeAutoScalingConfiguration")
+
+
+ return
+}
+
+func NewDescribeAutoScalingConfigurationResponse() (response *DescribeAutoScalingConfigurationResponse) {
+ response = &DescribeAutoScalingConfigurationResponse{
+ BaseResponse: &tchttp.BaseResponse{},
+ }
+ return
+
+}
+
+// DescribeAutoScalingConfiguration
+// 本接口(DescribeAutoScalingConfiguration)用于查询集群弹性伸缩配置信息。本接口仅适用于弹性伸缩类型为THPC_AS的集群。
+//
+// 可能返回的错误码:
+// INVALIDPARAMETER_MALFORMED = "InvalidParameter.Malformed"
+// RESOURCENOTFOUND_CLUSTERID = "ResourceNotFound.ClusterId"
+// UNSUPPORTEDOPERATION_AUTOSCALINGTYPE = "UnsupportedOperation.AutoScalingType"
+// UNSUPPORTEDOPERATION_CLUSTERSTATUSNOTSUPPORT = "UnsupportedOperation.ClusterStatusNotSupport"
+func (c *Client) DescribeAutoScalingConfiguration(request *DescribeAutoScalingConfigurationRequest) (response *DescribeAutoScalingConfigurationResponse, err error) {
+ return c.DescribeAutoScalingConfigurationWithContext(context.Background(), request)
+}
+
+// DescribeAutoScalingConfiguration
+// 本接口(DescribeAutoScalingConfiguration)用于查询集群弹性伸缩配置信息。本接口仅适用于弹性伸缩类型为THPC_AS的集群。
+//
+// 可能返回的错误码:
+// INVALIDPARAMETER_MALFORMED = "InvalidParameter.Malformed"
+// RESOURCENOTFOUND_CLUSTERID = "ResourceNotFound.ClusterId"
+// UNSUPPORTEDOPERATION_AUTOSCALINGTYPE = "UnsupportedOperation.AutoScalingType"
+// UNSUPPORTEDOPERATION_CLUSTERSTATUSNOTSUPPORT = "UnsupportedOperation.ClusterStatusNotSupport"
+func (c *Client) DescribeAutoScalingConfigurationWithContext(ctx context.Context, request *DescribeAutoScalingConfigurationRequest) (response *DescribeAutoScalingConfigurationResponse, err error) {
+ if request == nil {
+ request = NewDescribeAutoScalingConfigurationRequest()
+ }
+
+ if c.GetCredential() == nil {
+ return nil, errors.New("DescribeAutoScalingConfiguration require credential")
+ }
+
+ request.SetContext(ctx)
+
+ response = NewDescribeAutoScalingConfigurationResponse()
+ err = c.Send(request, response)
+ return
+}
+
+func NewDescribeClusterActivitiesRequest() (request *DescribeClusterActivitiesRequest) {
+ request = &DescribeClusterActivitiesRequest{
+ BaseRequest: &tchttp.BaseRequest{},
+ }
+
+ request.Init().WithApiInfo("thpc", APIVersion, "DescribeClusterActivities")
+
+
+ return
+}
+
+func NewDescribeClusterActivitiesResponse() (response *DescribeClusterActivitiesResponse) {
+ response = &DescribeClusterActivitiesResponse{
+ BaseResponse: &tchttp.BaseResponse{},
+ }
+ return
+
+}
+
+// DescribeClusterActivities
+// 本接口(DescribeClusterActivities)用于查询集群活动历史记录列表。
+//
+// 可能返回的错误码:
+// INVALIDPARAMETER_MALFORMED = "InvalidParameter.Malformed"
+// INVALIDPARAMETERVALUE_TOOLARGE = "InvalidParameterValue.TooLarge"
+func (c *Client) DescribeClusterActivities(request *DescribeClusterActivitiesRequest) (response *DescribeClusterActivitiesResponse, err error) {
+ return c.DescribeClusterActivitiesWithContext(context.Background(), request)
+}
+
+// DescribeClusterActivities
+// 本接口(DescribeClusterActivities)用于查询集群活动历史记录列表。
+//
+// 可能返回的错误码:
+// INVALIDPARAMETER_MALFORMED = "InvalidParameter.Malformed"
+// INVALIDPARAMETERVALUE_TOOLARGE = "InvalidParameterValue.TooLarge"
+func (c *Client) DescribeClusterActivitiesWithContext(ctx context.Context, request *DescribeClusterActivitiesRequest) (response *DescribeClusterActivitiesResponse, err error) {
+ if request == nil {
+ request = NewDescribeClusterActivitiesRequest()
+ }
+
+ if c.GetCredential() == nil {
+ return nil, errors.New("DescribeClusterActivities require credential")
+ }
+
+ request.SetContext(ctx)
+
+ response = NewDescribeClusterActivitiesResponse()
+ err = c.Send(request, response)
+ return
+}
+
+func NewDescribeClusterStorageOptionRequest() (request *DescribeClusterStorageOptionRequest) {
+ request = &DescribeClusterStorageOptionRequest{
+ BaseRequest: &tchttp.BaseRequest{},
+ }
+
+ request.Init().WithApiInfo("thpc", APIVersion, "DescribeClusterStorageOption")
+
+
+ return
+}
+
+func NewDescribeClusterStorageOptionResponse() (response *DescribeClusterStorageOptionResponse) {
+ response = &DescribeClusterStorageOptionResponse{
+ BaseResponse: &tchttp.BaseResponse{},
+ }
+ return
+
+}
+
+// DescribeClusterStorageOption
+// 本接口 (DescribeClusterStorageOption) 用于查询集群存储选项信息。
+//
+// 可能返回的错误码:
+// INVALIDPARAMETER_MALFORMED = "InvalidParameter.Malformed"
+// RESOURCENOTFOUND_CLUSTERID = "ResourceNotFound.ClusterId"
+// UNSUPPORTEDOPERATION_CLUSTERSTATUSNOTSUPPORT = "UnsupportedOperation.ClusterStatusNotSupport"
+func (c *Client) DescribeClusterStorageOption(request *DescribeClusterStorageOptionRequest) (response *DescribeClusterStorageOptionResponse, err error) {
+ return c.DescribeClusterStorageOptionWithContext(context.Background(), request)
+}
+
+// DescribeClusterStorageOption
+// 本接口 (DescribeClusterStorageOption) 用于查询集群存储选项信息。
+//
+// 可能返回的错误码:
+// INVALIDPARAMETER_MALFORMED = "InvalidParameter.Malformed"
+// RESOURCENOTFOUND_CLUSTERID = "ResourceNotFound.ClusterId"
+// UNSUPPORTEDOPERATION_CLUSTERSTATUSNOTSUPPORT = "UnsupportedOperation.ClusterStatusNotSupport"
+func (c *Client) DescribeClusterStorageOptionWithContext(ctx context.Context, request *DescribeClusterStorageOptionRequest) (response *DescribeClusterStorageOptionResponse, err error) {
+ if request == nil {
+ request = NewDescribeClusterStorageOptionRequest()
+ }
+
+ if c.GetCredential() == nil {
+ return nil, errors.New("DescribeClusterStorageOption require credential")
+ }
+
+ request.SetContext(ctx)
+
+ response = NewDescribeClusterStorageOptionResponse()
+ err = c.Send(request, response)
+ return
+}
+
+func NewDescribeClustersRequest() (request *DescribeClustersRequest) {
+ request = &DescribeClustersRequest{
+ BaseRequest: &tchttp.BaseRequest{},
+ }
+
+ request.Init().WithApiInfo("thpc", APIVersion, "DescribeClusters")
+
+
+ return
+}
+
+func NewDescribeClustersResponse() (response *DescribeClustersResponse) {
+ response = &DescribeClustersResponse{
+ BaseResponse: &tchttp.BaseResponse{},
+ }
+ return
+
+}
+
+// DescribeClusters
+// 本接口(DescribeClusters)用于查询集群列表。
+//
+// 可能返回的错误码:
+// INVALIDPARAMETER_MALFORMED = "InvalidParameter.Malformed"
+func (c *Client) DescribeClusters(request *DescribeClustersRequest) (response *DescribeClustersResponse, err error) {
+ return c.DescribeClustersWithContext(context.Background(), request)
+}
+
+// DescribeClusters
+// 本接口(DescribeClusters)用于查询集群列表。
+//
+// 可能返回的错误码:
+// INVALIDPARAMETER_MALFORMED = "InvalidParameter.Malformed"
+func (c *Client) DescribeClustersWithContext(ctx context.Context, request *DescribeClustersRequest) (response *DescribeClustersResponse, err error) {
+ if request == nil {
+ request = NewDescribeClustersRequest()
+ }
+
+ if c.GetCredential() == nil {
+ return nil, errors.New("DescribeClusters require credential")
+ }
+
+ request.SetContext(ctx)
+
+ response = NewDescribeClustersResponse()
+ err = c.Send(request, response)
+ return
+}
+
+func NewDescribeInitNodeScriptsRequest() (request *DescribeInitNodeScriptsRequest) {
+ request = &DescribeInitNodeScriptsRequest{
+ BaseRequest: &tchttp.BaseRequest{},
+ }
+
+ request.Init().WithApiInfo("thpc", APIVersion, "DescribeInitNodeScripts")
+
+
+ return
+}
+
+func NewDescribeInitNodeScriptsResponse() (response *DescribeInitNodeScriptsResponse) {
+ response = &DescribeInitNodeScriptsResponse{
+ BaseResponse: &tchttp.BaseResponse{},
+ }
+ return
+
+}
+
+// DescribeInitNodeScripts
+// 本接口 (DescribeInitNodeScripts) 用于查询节点初始化脚本列表。
+//
+// 可能返回的错误码:
+// INVALIDPARAMETER_MALFORMED = "InvalidParameter.Malformed"
+func (c *Client) DescribeInitNodeScripts(request *DescribeInitNodeScriptsRequest) (response *DescribeInitNodeScriptsResponse, err error) {
+ return c.DescribeInitNodeScriptsWithContext(context.Background(), request)
+}
+
+// DescribeInitNodeScripts
+// 本接口 (DescribeInitNodeScripts) 用于查询节点初始化脚本列表。
+//
+// 可能返回的错误码:
+// INVALIDPARAMETER_MALFORMED = "InvalidParameter.Malformed"
+func (c *Client) DescribeInitNodeScriptsWithContext(ctx context.Context, request *DescribeInitNodeScriptsRequest) (response *DescribeInitNodeScriptsResponse, err error) {
+ if request == nil {
+ request = NewDescribeInitNodeScriptsRequest()
+ }
+
+ if c.GetCredential() == nil {
+ return nil, errors.New("DescribeInitNodeScripts require credential")
+ }
+
+ request.SetContext(ctx)
+
+ response = NewDescribeInitNodeScriptsResponse()
+ err = c.Send(request, response)
+ return
+}
+
+func NewDescribeNodesRequest() (request *DescribeNodesRequest) {
+ request = &DescribeNodesRequest{
+ BaseRequest: &tchttp.BaseRequest{},
+ }
+
+ request.Init().WithApiInfo("thpc", APIVersion, "DescribeNodes")
+
+
+ return
+}
+
+func NewDescribeNodesResponse() (response *DescribeNodesResponse) {
+ response = &DescribeNodesResponse{
+ BaseResponse: &tchttp.BaseResponse{},
+ }
+ return
+
+}
+
+// DescribeNodes
+// 本接口 (DescribeNodes) 用于查询指定集群节点概览信息列表。
+//
+// 可能返回的错误码:
+// AUTHFAILURE = "AuthFailure"
+// INTERNALERROR = "InternalError"
+// INVALIDPARAMETER = "InvalidParameter"
+// INVALIDPARAMETER_MALFORMED = "InvalidParameter.Malformed"
+// INVALIDPARAMETERVALUE = "InvalidParameterValue"
+// INVALIDPARAMETERVALUE_INVALIDFILTERNOTSUPPORTEDNAME = "InvalidParameterValue.InvalidFilterNotSupportedName"
+// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded"
+// INVALIDPARAMETERVALUE_TOOLARGE = "InvalidParameterValue.TooLarge"
+// INVALIDPARAMETERVALUE_TOOSMALL = "InvalidParameterValue.TooSmall"
+// LIMITEXCEEDED = "LimitExceeded"
+// MISSINGPARAMETER = "MissingParameter"
+// REQUESTLIMITEXCEEDED = "RequestLimitExceeded"
+// UNKNOWNPARAMETER = "UnknownParameter"
+// UNSUPPORTEDOPERATION_PARAMETERTOOLARGE = "UnsupportedOperation.ParameterTooLarge"
+// UNSUPPORTEDOPERATION_PARAMETERTOOSMALL = "UnsupportedOperation.ParameterTooSmall"
+func (c *Client) DescribeNodes(request *DescribeNodesRequest) (response *DescribeNodesResponse, err error) {
+ return c.DescribeNodesWithContext(context.Background(), request)
+}
+
+// DescribeNodes
+// 本接口 (DescribeNodes) 用于查询指定集群节点概览信息列表。
+//
+// 可能返回的错误码:
+// AUTHFAILURE = "AuthFailure"
+// INTERNALERROR = "InternalError"
+// INVALIDPARAMETER = "InvalidParameter"
+// INVALIDPARAMETER_MALFORMED = "InvalidParameter.Malformed"
+// INVALIDPARAMETERVALUE = "InvalidParameterValue"
+// INVALIDPARAMETERVALUE_INVALIDFILTERNOTSUPPORTEDNAME = "InvalidParameterValue.InvalidFilterNotSupportedName"
+// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded"
+// INVALIDPARAMETERVALUE_TOOLARGE = "InvalidParameterValue.TooLarge"
+// INVALIDPARAMETERVALUE_TOOSMALL = "InvalidParameterValue.TooSmall"
+// LIMITEXCEEDED = "LimitExceeded"
+// MISSINGPARAMETER = "MissingParameter"
+// REQUESTLIMITEXCEEDED = "RequestLimitExceeded"
+// UNKNOWNPARAMETER = "UnknownParameter"
+// UNSUPPORTEDOPERATION_PARAMETERTOOLARGE = "UnsupportedOperation.ParameterTooLarge"
+// UNSUPPORTEDOPERATION_PARAMETERTOOSMALL = "UnsupportedOperation.ParameterTooSmall"
+func (c *Client) DescribeNodesWithContext(ctx context.Context, request *DescribeNodesRequest) (response *DescribeNodesResponse, err error) {
+ if request == nil {
+ request = NewDescribeNodesRequest()
+ }
+
+ if c.GetCredential() == nil {
+ return nil, errors.New("DescribeNodes require credential")
+ }
+
+ request.SetContext(ctx)
+
+ response = NewDescribeNodesResponse()
+ err = c.Send(request, response)
+ return
+}
+
+func NewDescribeQueuesRequest() (request *DescribeQueuesRequest) {
+ request = &DescribeQueuesRequest{
+ BaseRequest: &tchttp.BaseRequest{},
+ }
+
+ request.Init().WithApiInfo("thpc", APIVersion, "DescribeQueues")
+
+
+ return
+}
+
+func NewDescribeQueuesResponse() (response *DescribeQueuesResponse) {
+ response = &DescribeQueuesResponse{
+ BaseResponse: &tchttp.BaseResponse{},
+ }
+ return
+
+}
+
+// DescribeQueues
+// 本接口(DescribeQueues)用于查询指定集群队列概览信息列表。
+//
+// 可能返回的错误码:
+// FAILEDOPERATION = "FailedOperation"
+// INTERNALERROR = "InternalError"
+// INVALIDPARAMETER = "InvalidParameter"
+// INVALIDPARAMETER_MALFORMED = "InvalidParameter.Malformed"
+// INVALIDPARAMETERVALUE = "InvalidParameterValue"
+// INVALIDPARAMETERVALUE_PARAMETERSNOTSUPPORTED = "InvalidParameterValue.ParametersNotSupported"
+// INVALIDPARAMETERVALUE_TOOSHORT = "InvalidParameterValue.TooShort"
+// LIMITEXCEEDED = "LimitExceeded"
+// MISSINGPARAMETER = "MissingParameter"
+// REQUESTLIMITEXCEEDED = "RequestLimitExceeded"
+// RESOURCENOTFOUND = "ResourceNotFound"
+// UNKNOWNPARAMETER = "UnknownParameter"
+// UNSUPPORTEDOPERATION_PARAMETERTOOLARGE = "UnsupportedOperation.ParameterTooLarge"
+// UNSUPPORTEDOPERATION_PARAMETERTOOSMALL = "UnsupportedOperation.ParameterTooSmall"
+func (c *Client) DescribeQueues(request *DescribeQueuesRequest) (response *DescribeQueuesResponse, err error) {
+ return c.DescribeQueuesWithContext(context.Background(), request)
+}
+
+// DescribeQueues
+// 本接口(DescribeQueues)用于查询指定集群队列概览信息列表。
+//
+// 可能返回的错误码:
+// FAILEDOPERATION = "FailedOperation"
+// INTERNALERROR = "InternalError"
+// INVALIDPARAMETER = "InvalidParameter"
+// INVALIDPARAMETER_MALFORMED = "InvalidParameter.Malformed"
+// INVALIDPARAMETERVALUE = "InvalidParameterValue"
+// INVALIDPARAMETERVALUE_PARAMETERSNOTSUPPORTED = "InvalidParameterValue.ParametersNotSupported"
+// INVALIDPARAMETERVALUE_TOOSHORT = "InvalidParameterValue.TooShort"
+// LIMITEXCEEDED = "LimitExceeded"
+// MISSINGPARAMETER = "MissingParameter"
+// REQUESTLIMITEXCEEDED = "RequestLimitExceeded"
+// RESOURCENOTFOUND = "ResourceNotFound"
+// UNKNOWNPARAMETER = "UnknownParameter"
+// UNSUPPORTEDOPERATION_PARAMETERTOOLARGE = "UnsupportedOperation.ParameterTooLarge"
+// UNSUPPORTEDOPERATION_PARAMETERTOOSMALL = "UnsupportedOperation.ParameterTooSmall"
+func (c *Client) DescribeQueuesWithContext(ctx context.Context, request *DescribeQueuesRequest) (response *DescribeQueuesResponse, err error) {
+ if request == nil {
+ request = NewDescribeQueuesRequest()
+ }
+
+ if c.GetCredential() == nil {
+ return nil, errors.New("DescribeQueues require credential")
+ }
+
+ request.SetContext(ctx)
+
+ response = NewDescribeQueuesResponse()
+ err = c.Send(request, response)
+ return
+}
+
+func NewDescribeWorkspacesRequest() (request *DescribeWorkspacesRequest) {
+ request = &DescribeWorkspacesRequest{
+ BaseRequest: &tchttp.BaseRequest{},
+ }
+
+ request.Init().WithApiInfo("thpc", APIVersion, "DescribeWorkspaces")
+
+
+ return
+}
+
+func NewDescribeWorkspacesResponse() (response *DescribeWorkspacesResponse) {
+ response = &DescribeWorkspacesResponse{
+ BaseResponse: &tchttp.BaseResponse{},
+ }
+ return
+
+}
+
+// DescribeWorkspaces
+// 本接口(DescribeWorkspaces)用于查询工作空间列表。
+//
+// 可能返回的错误码:
+// INVALIDPARAMETER_MALFORMED = "InvalidParameter.Malformed"
+func (c *Client) DescribeWorkspaces(request *DescribeWorkspacesRequest) (response *DescribeWorkspacesResponse, err error) {
+ return c.DescribeWorkspacesWithContext(context.Background(), request)
+}
+
+// DescribeWorkspaces
+// 本接口(DescribeWorkspaces)用于查询工作空间列表。
+//
+// 可能返回的错误码:
+// INVALIDPARAMETER_MALFORMED = "InvalidParameter.Malformed"
+func (c *Client) DescribeWorkspacesWithContext(ctx context.Context, request *DescribeWorkspacesRequest) (response *DescribeWorkspacesResponse, err error) {
+ if request == nil {
+ request = NewDescribeWorkspacesRequest()
+ }
+
+ if c.GetCredential() == nil {
+ return nil, errors.New("DescribeWorkspaces require credential")
+ }
+
+ request.SetContext(ctx)
+
+ response = NewDescribeWorkspacesResponse()
+ err = c.Send(request, response)
+ return
+}
+
+func NewDetachNodesRequest() (request *DetachNodesRequest) {
+ request = &DetachNodesRequest{
+ BaseRequest: &tchttp.BaseRequest{},
+ }
+
+ request.Init().WithApiInfo("thpc", APIVersion, "DetachNodes")
+
+
+ return
+}
+
+func NewDetachNodesResponse() (response *DetachNodesResponse) {
+ response = &DetachNodesResponse{
+ BaseResponse: &tchttp.BaseResponse{},
+ }
+ return
+
+}
+
+// DetachNodes
+// 本接口 (DetachNodes) 用于将一个或者多个计算节点从集群中移除,但是不销毁指定计算资源。
+//
+// 可能返回的错误码:
+// INVALIDPARAMETER_MALFORMED = "InvalidParameter.Malformed"
+func (c *Client) DetachNodes(request *DetachNodesRequest) (response *DetachNodesResponse, err error) {
+ return c.DetachNodesWithContext(context.Background(), request)
+}
+
+// DetachNodes
+// 本接口 (DetachNodes) 用于将一个或者多个计算节点从集群中移除,但是不销毁指定计算资源。
+//
+// 可能返回的错误码:
+// INVALIDPARAMETER_MALFORMED = "InvalidParameter.Malformed"
+func (c *Client) DetachNodesWithContext(ctx context.Context, request *DetachNodesRequest) (response *DetachNodesResponse, err error) {
+ if request == nil {
+ request = NewDetachNodesRequest()
+ }
+
+ if c.GetCredential() == nil {
+ return nil, errors.New("DetachNodes require credential")
+ }
+
+ request.SetContext(ctx)
+
+ response = NewDetachNodesResponse()
+ err = c.Send(request, response)
+ return
+}
+
+func NewModifyInitNodeScriptsRequest() (request *ModifyInitNodeScriptsRequest) {
+ request = &ModifyInitNodeScriptsRequest{
+ BaseRequest: &tchttp.BaseRequest{},
+ }
+
+ request.Init().WithApiInfo("thpc", APIVersion, "ModifyInitNodeScripts")
+
+
+ return
+}
+
+func NewModifyInitNodeScriptsResponse() (response *ModifyInitNodeScriptsResponse) {
+ response = &ModifyInitNodeScriptsResponse{
+ BaseResponse: &tchttp.BaseResponse{},
+ }
+ return
+
+}
+
+// ModifyInitNodeScripts
+// 本接口 (ModifyInitNodeScripts) 用于修改节点初始化脚本。
+//
+// 可能返回的错误码:
+// INVALIDPARAMETERVALUE_TOOLARGE = "InvalidParameterValue.TooLarge"
+func (c *Client) ModifyInitNodeScripts(request *ModifyInitNodeScriptsRequest) (response *ModifyInitNodeScriptsResponse, err error) {
+ return c.ModifyInitNodeScriptsWithContext(context.Background(), request)
+}
+
+// ModifyInitNodeScripts
+// 本接口 (ModifyInitNodeScripts) 用于修改节点初始化脚本。
+//
+// 可能返回的错误码:
+// INVALIDPARAMETERVALUE_TOOLARGE = "InvalidParameterValue.TooLarge"
+func (c *Client) ModifyInitNodeScriptsWithContext(ctx context.Context, request *ModifyInitNodeScriptsRequest) (response *ModifyInitNodeScriptsResponse, err error) {
+ if request == nil {
+ request = NewModifyInitNodeScriptsRequest()
+ }
+
+ if c.GetCredential() == nil {
+ return nil, errors.New("ModifyInitNodeScripts require credential")
+ }
+
+ request.SetContext(ctx)
+
+ response = NewModifyInitNodeScriptsResponse()
+ err = c.Send(request, response)
+ return
+}
+
+func NewModifyWorkspacesAttributeRequest() (request *ModifyWorkspacesAttributeRequest) {
+ request = &ModifyWorkspacesAttributeRequest{
+ BaseRequest: &tchttp.BaseRequest{},
+ }
+
+ request.Init().WithApiInfo("thpc", APIVersion, "ModifyWorkspacesAttribute")
+
+
+ return
+}
+
+func NewModifyWorkspacesAttributeResponse() (response *ModifyWorkspacesAttributeResponse) {
+ response = &ModifyWorkspacesAttributeResponse{
+ BaseResponse: &tchttp.BaseResponse{},
+ }
+ return
+
+}
+
+// ModifyWorkspacesAttribute
+// 本接口 (ModifyWorkspacesAttribute) 用于修改工作空间的属性(目前只支持修改工作空间的名称)。
+//
+// 可能返回的错误码:
+// INVALIDPARAMETER_MALFORMED = "InvalidParameter.Malformed"
+func (c *Client) ModifyWorkspacesAttribute(request *ModifyWorkspacesAttributeRequest) (response *ModifyWorkspacesAttributeResponse, err error) {
+ return c.ModifyWorkspacesAttributeWithContext(context.Background(), request)
+}
+
+// ModifyWorkspacesAttribute
+// 本接口 (ModifyWorkspacesAttribute) 用于修改工作空间的属性(目前只支持修改工作空间的名称)。
+//
+// 可能返回的错误码:
+// INVALIDPARAMETER_MALFORMED = "InvalidParameter.Malformed"
+func (c *Client) ModifyWorkspacesAttributeWithContext(ctx context.Context, request *ModifyWorkspacesAttributeRequest) (response *ModifyWorkspacesAttributeResponse, err error) {
+ if request == nil {
+ request = NewModifyWorkspacesAttributeRequest()
+ }
+
+ if c.GetCredential() == nil {
+ return nil, errors.New("ModifyWorkspacesAttribute require credential")
+ }
+
+ request.SetContext(ctx)
+
+ response = NewModifyWorkspacesAttributeResponse()
+ err = c.Send(request, response)
+ return
+}
+
+func NewSetAutoScalingConfigurationRequest() (request *SetAutoScalingConfigurationRequest) {
+ request = &SetAutoScalingConfigurationRequest{
+ BaseRequest: &tchttp.BaseRequest{},
+ }
+
+ request.Init().WithApiInfo("thpc", APIVersion, "SetAutoScalingConfiguration")
+
+
+ return
+}
+
+func NewSetAutoScalingConfigurationResponse() (response *SetAutoScalingConfigurationResponse) {
+ response = &SetAutoScalingConfigurationResponse{
+ BaseResponse: &tchttp.BaseResponse{},
+ }
+ return
+
+}
+
+// SetAutoScalingConfiguration
+// 本接口(SetAutoScalingConfiguration)用于为集群设置集群弹性伸缩配置信息。
+//
+// 可能返回的错误码:
+// INTERNALERROR_CALLCVM = "InternalError.CallCvm"
+// INVALIDPARAMETER_MALFORMED = "InvalidParameter.Malformed"
+// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded"
+// INVALIDPARAMETERVALUE_TOOLARGE = "InvalidParameterValue.TooLarge"
+// INVALIDPARAMETERVALUE_TOOSMALL = "InvalidParameterValue.TooSmall"
+// RESOURCENOTFOUND_CLUSTERID = "ResourceNotFound.ClusterId"
+// RESOURCENOTFOUND_IMAGEID = "ResourceNotFound.ImageId"
+// RESOURCENOTFOUND_QUEUE = "ResourceNotFound.Queue"
+// UNSUPPORTEDOPERATION_AUTOSCALINGTYPE = "UnsupportedOperation.AutoScalingType"
+// UNSUPPORTEDOPERATION_CLUSTERACCEPTOTHERREQUEST = "UnsupportedOperation.ClusterAcceptOtherRequest"
+// UNSUPPORTEDOPERATION_CLUSTERSTATUSNOTSUPPORT = "UnsupportedOperation.ClusterStatusNotSupport"
+// UNSUPPORTEDOPERATION_PARAMETERTOOLARGE = "UnsupportedOperation.ParameterTooLarge"
+// UNSUPPORTEDOPERATION_VPCIDCONFLICT = "UnsupportedOperation.VpcIdConflict"
+func (c *Client) SetAutoScalingConfiguration(request *SetAutoScalingConfigurationRequest) (response *SetAutoScalingConfigurationResponse, err error) {
+ return c.SetAutoScalingConfigurationWithContext(context.Background(), request)
+}
+
+// SetAutoScalingConfiguration
+// 本接口(SetAutoScalingConfiguration)用于为集群设置集群弹性伸缩配置信息。
+//
+// 可能返回的错误码:
+// INTERNALERROR_CALLCVM = "InternalError.CallCvm"
+// INVALIDPARAMETER_MALFORMED = "InvalidParameter.Malformed"
+// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded"
+// INVALIDPARAMETERVALUE_TOOLARGE = "InvalidParameterValue.TooLarge"
+// INVALIDPARAMETERVALUE_TOOSMALL = "InvalidParameterValue.TooSmall"
+// RESOURCENOTFOUND_CLUSTERID = "ResourceNotFound.ClusterId"
+// RESOURCENOTFOUND_IMAGEID = "ResourceNotFound.ImageId"
+// RESOURCENOTFOUND_QUEUE = "ResourceNotFound.Queue"
+// UNSUPPORTEDOPERATION_AUTOSCALINGTYPE = "UnsupportedOperation.AutoScalingType"
+// UNSUPPORTEDOPERATION_CLUSTERACCEPTOTHERREQUEST = "UnsupportedOperation.ClusterAcceptOtherRequest"
+// UNSUPPORTEDOPERATION_CLUSTERSTATUSNOTSUPPORT = "UnsupportedOperation.ClusterStatusNotSupport"
+// UNSUPPORTEDOPERATION_PARAMETERTOOLARGE = "UnsupportedOperation.ParameterTooLarge"
+// UNSUPPORTEDOPERATION_VPCIDCONFLICT = "UnsupportedOperation.VpcIdConflict"
+func (c *Client) SetAutoScalingConfigurationWithContext(ctx context.Context, request *SetAutoScalingConfigurationRequest) (response *SetAutoScalingConfigurationResponse, err error) {
+ if request == nil {
+ request = NewSetAutoScalingConfigurationRequest()
+ }
+
+ if c.GetCredential() == nil {
+ return nil, errors.New("SetAutoScalingConfiguration require credential")
+ }
+
+ request.SetContext(ctx)
+
+ response = NewSetAutoScalingConfigurationResponse()
+ err = c.Send(request, response)
+ return
+}
+
+func NewTerminateWorkspacesRequest() (request *TerminateWorkspacesRequest) {
+ request = &TerminateWorkspacesRequest{
+ BaseRequest: &tchttp.BaseRequest{},
+ }
+
+ request.Init().WithApiInfo("thpc", APIVersion, "TerminateWorkspaces")
+
+
+ return
+}
+
+func NewTerminateWorkspacesResponse() (response *TerminateWorkspacesResponse) {
+ response = &TerminateWorkspacesResponse{
+ BaseResponse: &tchttp.BaseResponse{},
+ }
+ return
+
+}
+
+// TerminateWorkspaces
+// 本接口 (TerminateWorkspaces) 用于主动退还工作空间。
+//
+// 可能返回的错误码:
+// INTERNALERROR_CALLCVM = "InternalError.CallCvm"
+// INVALIDPARAMETER_MALFORMED = "InvalidParameter.Malformed"
+// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded"
+// INVALIDPARAMETERVALUE_TOOLARGE = "InvalidParameterValue.TooLarge"
+// INVALIDPARAMETERVALUE_TOOSMALL = "InvalidParameterValue.TooSmall"
+// RESOURCENOTFOUND_CLUSTERID = "ResourceNotFound.ClusterId"
+// RESOURCENOTFOUND_IMAGEID = "ResourceNotFound.ImageId"
+// RESOURCENOTFOUND_QUEUE = "ResourceNotFound.Queue"
+// UNSUPPORTEDOPERATION_AUTOSCALINGTYPE = "UnsupportedOperation.AutoScalingType"
+// UNSUPPORTEDOPERATION_CLUSTERACCEPTOTHERREQUEST = "UnsupportedOperation.ClusterAcceptOtherRequest"
+// UNSUPPORTEDOPERATION_CLUSTERSTATUSNOTSUPPORT = "UnsupportedOperation.ClusterStatusNotSupport"
+// UNSUPPORTEDOPERATION_PARAMETERTOOLARGE = "UnsupportedOperation.ParameterTooLarge"
+// UNSUPPORTEDOPERATION_VPCIDCONFLICT = "UnsupportedOperation.VpcIdConflict"
+func (c *Client) TerminateWorkspaces(request *TerminateWorkspacesRequest) (response *TerminateWorkspacesResponse, err error) {
+ return c.TerminateWorkspacesWithContext(context.Background(), request)
+}
+
+// TerminateWorkspaces
+// 本接口 (TerminateWorkspaces) 用于主动退还工作空间。
+//
+// 可能返回的错误码:
+// INTERNALERROR_CALLCVM = "InternalError.CallCvm"
+// INVALIDPARAMETER_MALFORMED = "InvalidParameter.Malformed"
+// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded"
+// INVALIDPARAMETERVALUE_TOOLARGE = "InvalidParameterValue.TooLarge"
+// INVALIDPARAMETERVALUE_TOOSMALL = "InvalidParameterValue.TooSmall"
+// RESOURCENOTFOUND_CLUSTERID = "ResourceNotFound.ClusterId"
+// RESOURCENOTFOUND_IMAGEID = "ResourceNotFound.ImageId"
+// RESOURCENOTFOUND_QUEUE = "ResourceNotFound.Queue"
+// UNSUPPORTEDOPERATION_AUTOSCALINGTYPE = "UnsupportedOperation.AutoScalingType"
+// UNSUPPORTEDOPERATION_CLUSTERACCEPTOTHERREQUEST = "UnsupportedOperation.ClusterAcceptOtherRequest"
+// UNSUPPORTEDOPERATION_CLUSTERSTATUSNOTSUPPORT = "UnsupportedOperation.ClusterStatusNotSupport"
+// UNSUPPORTEDOPERATION_PARAMETERTOOLARGE = "UnsupportedOperation.ParameterTooLarge"
+// UNSUPPORTEDOPERATION_VPCIDCONFLICT = "UnsupportedOperation.VpcIdConflict"
+func (c *Client) TerminateWorkspacesWithContext(ctx context.Context, request *TerminateWorkspacesRequest) (response *TerminateWorkspacesResponse, err error) {
+ if request == nil {
+ request = NewTerminateWorkspacesRequest()
+ }
+
+ if c.GetCredential() == nil {
+ return nil, errors.New("TerminateWorkspaces require credential")
+ }
+
+ request.SetContext(ctx)
+
+ response = NewTerminateWorkspacesResponse()
+ err = c.Send(request, response)
+ return
+}
diff --git a/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/thpc/v20230321/errors.go b/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/thpc/v20230321/errors.go
new file mode 100644
index 0000000000..fa0ba61ffe
--- /dev/null
+++ b/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/thpc/v20230321/errors.go
@@ -0,0 +1,148 @@
+// 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 v20230321
+
+const (
+ // 此产品的特有错误码
+
+ // CAM签名/鉴权错误。
+ AUTHFAILURE = "AuthFailure"
+
+ // DryRun 操作,代表请求将会是成功的,只是多传了 DryRun 参数。
+ DRYRUNOPERATION = "DryRunOperation"
+
+ // 操作失败。
+ FAILEDOPERATION = "FailedOperation"
+
+ // 内部错误。
+ INTERNALERROR = "InternalError"
+
+ // CAM服务调用失败。
+ INTERNALERROR_CALLCAM = "InternalError.CallCAM"
+
+ // cvm调用失败。
+ INTERNALERROR_CALLCVM = "InternalError.CallCvm"
+
+ // 参数错误。
+ INVALIDPARAMETER = "InvalidParameter"
+
+ // 参数格式有误。
+ INVALIDPARAMETER_MALFORMED = "InvalidParameter.Malformed"
+
+ // 参数取值错误。
+ INVALIDPARAMETERVALUE = "InvalidParameterValue"
+
+ // 不支持指定过滤器的键。
+ INVALIDPARAMETERVALUE_INVALIDFILTERNOTSUPPORTEDNAME = "InvalidParameterValue.InvalidFilterNotSupportedName"
+
+ // 参数值数量超过限制。
+ INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded"
+
+ // 不支持该参数值。
+ INVALIDPARAMETERVALUE_NOTSUPPORTED = "InvalidParameterValue.NotSupported"
+
+ // 字段不支持此值。
+ INVALIDPARAMETERVALUE_PARAMETERSNOTSUPPORTED = "InvalidParameterValue.ParametersNotSupported"
+
+ // 参数值过大。
+ INVALIDPARAMETERVALUE_TOOLARGE = "InvalidParameterValue.TooLarge"
+
+ // 参数长度过长。
+ INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong"
+
+ // 无效参数值。参数值太短。
+ INVALIDPARAMETERVALUE_TOOSHORT = "InvalidParameterValue.TooShort"
+
+ // 参数值过小。
+ INVALIDPARAMETERVALUE_TOOSMALL = "InvalidParameterValue.TooSmall"
+
+ // 参数值重复。不支持此操作。
+ INVALIDPARAMETERVALUE_VALUEDUPLICATED = "InvalidParameterValue.ValueDuplicated"
+
+ // 超过配额限制。
+ LIMITEXCEEDED = "LimitExceeded"
+
+ // 队列数量达到上限。
+ LIMITEXCEEDED_QUEUENUMLIMIT = "LimitExceeded.QueueNumLimit"
+
+ // 缺少参数错误。
+ MISSINGPARAMETER = "MissingParameter"
+
+ // 操作被拒绝。
+ OPERATIONDENIED = "OperationDenied"
+
+ // 请求的次数超过了频率限制。
+ REQUESTLIMITEXCEEDED = "RequestLimitExceeded"
+
+ // 资源被占用。
+ RESOURCEINUSE = "ResourceInUse"
+
+ // 资源不足。
+ RESOURCEINSUFFICIENT = "ResourceInsufficient"
+
+ // 资源不存在。
+ RESOURCENOTFOUND = "ResourceNotFound"
+
+ // 集群不存在。
+ RESOURCENOTFOUND_CLUSTERID = "ResourceNotFound.ClusterId"
+
+ // 无法找到镜像ID。
+ RESOURCENOTFOUND_IMAGEID = "ResourceNotFound.ImageId"
+
+ // 无法找到本地挂载路径。
+ RESOURCENOTFOUND_LOCALPATH = "ResourceNotFound.LocalPath"
+
+ // 无法找到ID对应节点。
+ RESOURCENOTFOUND_NODEID = "ResourceNotFound.NodeId"
+
+ // 无法找到指定队列。
+ RESOURCENOTFOUND_QUEUE = "ResourceNotFound.Queue"
+
+ // 未授权操作。
+ UNAUTHORIZEDOPERATION = "UnauthorizedOperation"
+
+ // 未知参数错误。
+ UNKNOWNPARAMETER = "UnknownParameter"
+
+ // 操作不支持。
+ UNSUPPORTEDOPERATION = "UnsupportedOperation"
+
+ // 弹性伸缩类型不支持此操作。
+ UNSUPPORTEDOPERATION_AUTOSCALINGTYPE = "UnsupportedOperation.AutoScalingType"
+
+ // 集群资源正在处理其他请求。
+ UNSUPPORTEDOPERATION_CLUSTERACCEPTOTHERREQUEST = "UnsupportedOperation.ClusterAcceptOtherRequest"
+
+ // 该集群当前状态不支持该操作。
+ UNSUPPORTEDOPERATION_CLUSTERSTATUSNOTSUPPORT = "UnsupportedOperation.ClusterStatusNotSupport"
+
+ // 类型节点不支持当前操作。
+ UNSUPPORTEDOPERATION_INVALIDNODEROLE = "UnsupportedOperation.InvalidNodeRole"
+
+ // 节点状态不支持此操作。
+ UNSUPPORTEDOPERATION_NODESTATUSNOTSUPPORT = "UnsupportedOperation.NodeStatusNotSupport"
+
+ // 参数值过大,不支持此操作。
+ UNSUPPORTEDOPERATION_PARAMETERTOOLARGE = "UnsupportedOperation.ParameterTooLarge"
+
+ // 参数值过小,不支持此操作。
+ UNSUPPORTEDOPERATION_PARAMETERTOOSMALL = "UnsupportedOperation.ParameterTooSmall"
+
+ // 队列内存在节点,不支持此操作。
+ UNSUPPORTEDOPERATION_QUEUENOTEMPTY = "UnsupportedOperation.QueueNotEmpty"
+
+ // vpc冲突,不支持当前操作。
+ UNSUPPORTEDOPERATION_VPCIDCONFLICT = "UnsupportedOperation.VpcIdConflict"
+)
diff --git a/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/thpc/v20230321/models.go b/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/thpc/v20230321/models.go
new file mode 100644
index 0000000000..1ec03ccb8e
--- /dev/null
+++ b/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/thpc/v20230321/models.go
@@ -0,0 +1,2901 @@
+// 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 v20230321
+
+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"
+)
+
+// Predefined struct for user
+type AddClusterStorageOptionRequestParams struct {
+ // 集群ID。
+ ClusterId *string `json:"ClusterId,omitnil,omitempty" name:"ClusterId"`
+
+ // 集群存储选项。
+ StorageOption *StorageOption `json:"StorageOption,omitnil,omitempty" name:"StorageOption"`
+}
+
+type AddClusterStorageOptionRequest struct {
+ *tchttp.BaseRequest
+
+ // 集群ID。
+ ClusterId *string `json:"ClusterId,omitnil,omitempty" name:"ClusterId"`
+
+ // 集群存储选项。
+ StorageOption *StorageOption `json:"StorageOption,omitnil,omitempty" name:"StorageOption"`
+}
+
+func (r *AddClusterStorageOptionRequest) 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 *AddClusterStorageOptionRequest) FromJsonString(s string) error {
+ f := make(map[string]interface{})
+ if err := json.Unmarshal([]byte(s), &f); err != nil {
+ return err
+ }
+ delete(f, "ClusterId")
+ delete(f, "StorageOption")
+ if len(f) > 0 {
+ return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "AddClusterStorageOptionRequest has unknown keys!", "")
+ }
+ return json.Unmarshal([]byte(s), &r)
+}
+
+// Predefined struct for user
+type AddClusterStorageOptionResponseParams struct {
+ // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。
+ RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"`
+}
+
+type AddClusterStorageOptionResponse struct {
+ *tchttp.BaseResponse
+ Response *AddClusterStorageOptionResponseParams `json:"Response"`
+}
+
+func (r *AddClusterStorageOptionResponse) 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 *AddClusterStorageOptionResponse) FromJsonString(s string) error {
+ return json.Unmarshal([]byte(s), &r)
+}
+
+// Predefined struct for user
+type AddNodesRequestParams struct {
+ // 集群中实例所在的位置。
+ Placement *Placement `json:"Placement,omitnil,omitempty" name:"Placement"`
+
+ // 集群ID。
+ ClusterId *string `json:"ClusterId,omitnil,omitempty" name:"ClusterId"`
+
+ // 私有网络相关信息配置。
+ VirtualPrivateCloud *VirtualPrivateCloud `json:"VirtualPrivateCloud,omitnil,omitempty" name:"VirtualPrivateCloud"`
+
+ // 添加节点数量。
+ Count *int64 `json:"Count,omitnil,omitempty" name:"Count"`
+
+ // 指定有效的[镜像](https://cloud.tencent.com/document/product/213/4940)ID,格式形如`img-xxx`。目前仅支持公有镜像和特定自定义镜像。
+ ImageId *string `json:"ImageId,omitnil,omitempty" name:"ImageId"`
+
+ // 节点[计费类型](https://cloud.tencent.com/document/product/213/2180)。
按照【队列名称】进行过滤。队列名称形如:compute。
+ //类型:String
+ //必选:否
+ //按照【节点角色】进行过滤。节点角色形如:Manager。(Manager:管控节点。Compute:计算节点。Login:登录节点。ManagerBackup:备用管控节点。)
+ //类型:String
+ //必选:否
+ //按照【节点类型】进行过滤。节点类型形如:STATIC。(STATIC:静态节点。DYNAMIC:弹性节点。)
+ //类型:String
+ //必选:否
+ //每次请求的`Filters`的上限为10,`Filter.Values`的上限为5。
+ Filters []*Filter `json:"Filters,omitnil,omitempty" name:"Filters"` + + // 偏移量,默认为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 DescribeNodesRequest struct { + *tchttp.BaseRequest + + // 集群ID。 + ClusterId *string `json:"ClusterId,omitnil,omitempty" name:"ClusterId"` + + //按照【队列名称】进行过滤。队列名称形如:compute。
+ //类型:String
+ //必选:否
+ //按照【节点角色】进行过滤。节点角色形如:Manager。(Manager:管控节点。Compute:计算节点。Login:登录节点。ManagerBackup:备用管控节点。)
+ //类型:String
+ //必选:否
+ //按照【节点类型】进行过滤。节点类型形如:STATIC。(STATIC:静态节点。DYNAMIC:弹性节点。)
+ //类型:String
+ //必选:否
+ //每次请求的`Filters`的上限为10,`Filter.Values`的上限为5。
+ Filters []*Filter `json:"Filters,omitnil,omitempty" name:"Filters"` + + // 偏移量,默认为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 *DescribeNodesRequest) 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 *DescribeNodesRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "ClusterId") + delete(f, "Filters") + delete(f, "Offset") + delete(f, "Limit") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeNodesRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DescribeNodesResponseParams struct { + // 节点概览信息列表。 + NodeSet []*NodeOverview `json:"NodeSet,omitnil,omitempty" name:"NodeSet"` + + // 符合条件的节点数量。 + TotalCount *int64 `json:"TotalCount,omitnil,omitempty" name:"TotalCount"` + + // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` +} + +type DescribeNodesResponse struct { + *tchttp.BaseResponse + Response *DescribeNodesResponseParams `json:"Response"` +} + +func (r *DescribeNodesResponse) 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 *DescribeNodesResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DescribeQueuesRequestParams struct { + // 集群ID。 + ClusterId *string `json:"ClusterId,omitnil,omitempty" name:"ClusterId"` + + // 偏移量,默认为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 DescribeQueuesRequest struct { + *tchttp.BaseRequest + + // 集群ID。 + ClusterId *string `json:"ClusterId,omitnil,omitempty" name:"ClusterId"` + + // 偏移量,默认为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 *DescribeQueuesRequest) 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 *DescribeQueuesRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "ClusterId") + delete(f, "Offset") + delete(f, "Limit") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeQueuesRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DescribeQueuesResponseParams struct { + // 队列概览信息列表。 + QueueSet []*QueueOverview `json:"QueueSet,omitnil,omitempty" name:"QueueSet"` + + // 符合条件的队列数量。 + TotalCount *int64 `json:"TotalCount,omitnil,omitempty" name:"TotalCount"` + + // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` +} + +type DescribeQueuesResponse struct { + *tchttp.BaseResponse + Response *DescribeQueuesResponseParams `json:"Response"` +} + +func (r *DescribeQueuesResponse) 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 *DescribeQueuesResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DescribeWorkspacesRequestParams struct { + // 集群ID列表。通过该参数可以指定需要查询信息的集群列表。