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)。
  • PREPAID:预付费,即包年包月
  • POSTPAID_BY_HOUR:按小时后付费
  • SPOTPAID:竞价付费
  • 默认值:POSTPAID_BY_HOUR。 + InstanceChargeType *string `json:"InstanceChargeType,omitnil,omitempty" name:"InstanceChargeType"` + + // 预付费模式,即包年包月相关参数设置。通过该参数可以指定包年包月节点的购买时长、是否设置自动续费等属性。若指定节点的付费模式为预付费则该参数必传。 + InstanceChargePrepaid *InstanceChargePrepaid `json:"InstanceChargePrepaid,omitnil,omitempty" name:"InstanceChargePrepaid"` + + // 节点机型。不同实例机型指定了不同的资源规格。
  • 具体取值可通过调用接口[DescribeInstanceTypeConfigs](https://cloud.tencent.com/document/api/213/15749)来获得最新的规格表或参见[实例规格](https://cloud.tencent.com/document/product/213/11518)描述。
  • + InstanceType *string `json:"InstanceType,omitnil,omitempty" name:"InstanceType"` + + // 节点系统盘配置信息。若不指定该参数,则按照系统默认值进行分配。 + SystemDisk *SystemDisk `json:"SystemDisk,omitnil,omitempty" name:"SystemDisk"` + + // 节点数据盘配置信息。若不指定该参数,则默认不购买数据盘。支持购买的时候指定21块数据盘,其中最多包含1块LOCAL_BASIC数据盘或者LOCAL_SSD数据盘,最多包含20块CLOUD_BASIC数据盘、CLOUD_PREMIUM数据盘或者CLOUD_SSD数据盘。 + DataDisks []*DataDisk `json:"DataDisks,omitnil,omitempty" name:"DataDisks"` + + // 公网带宽相关信息设置。若不指定该参数,则默认公网带宽为0Mbps。 + InternetAccessible *InternetAccessible `json:"InternetAccessible,omitnil,omitempty" name:"InternetAccessible"` + + // 节点显示名称。 + // 不指定节点显示名称则默认显示‘未命名’。 + // 最多支持60个字符。 + InstanceName *string `json:"InstanceName,omitnil,omitempty" name:"InstanceName"` + + // 集群登录设置。 + LoginSettings *LoginSettings `json:"LoginSettings,omitnil,omitempty" name:"LoginSettings"` + + // 集群中实例所属安全组。该参数可以通过调用 [DescribeSecurityGroups](https://cloud.tencent.com/document/api/215/15808) 的返回值中的sgId字段来获取。若不指定该参数,则绑定默认安全组。 + SecurityGroupIds []*string `json:"SecurityGroupIds,omitnil,omitempty" name:"SecurityGroupIds"` + + // 用于保证请求幂等性的字符串。该字符串由客户生成,需保证不同请求之间唯一,最大值不超过64个ASCII字符。若不指定该参数,则无法保证请求的幂等性。 + ClientToken *string `json:"ClientToken,omitnil,omitempty" name:"ClientToken"` + + // 队列名称。不指定则为默认队列。
  • SLURM默认队列为:compute。
  • SGE默认队列为:all.q。
  • + QueueName *string `json:"QueueName,omitnil,omitempty" name:"QueueName"` + + // 添加节点角色。默认值:Compute
  • Compute:计算节点。
  • Login:登录节点。
  • + NodeRole *string `json:"NodeRole,omitnil,omitempty" name:"NodeRole"` + + // 是否只预检此次请求。 + // true:发送检查请求,不会创建实例。检查项包括是否填写了必需参数,请求格式,业务限制和云服务器库存。 + // 如果检查不通过,则返回对应错误码; + // 如果检查通过,则返回RequestId. + // false(默认):发送正常请求,通过检查后直接创建实例 + DryRun *bool `json:"DryRun,omitnil,omitempty" name:"DryRun"` + + // 添加节点类型。默认取值:STATIC。
  • STATIC:静态节点,不会参与弹性伸缩流程。
  • DYNAMIC:弹性节点,会被弹性缩容的节点。管控节点和登录节点不支持此参数。
  • + NodeType *string `json:"NodeType,omitnil,omitempty" name:"NodeType"` + + // 实例所属项目ID。该参数可以通过调用 [DescribeProject](https://cloud.tencent.com/document/api/651/78725) 的返回值中的 projectId 字段来获取。不填为默认项目。 + ProjectId *int64 `json:"ProjectId,omitnil,omitempty" name:"ProjectId"` + + // 要新增节点的资源类型。
  • CVM:CVM实例类型资源
  • WORKSPACE:工作空间类型实例资源
  • 默认值:CVM。 + ResourceType *string `json:"ResourceType,omitnil,omitempty" name:"ResourceType"` +} + +type AddNodesRequest struct { + *tchttp.BaseRequest + + // 集群中实例所在的位置。 + 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)。
  • PREPAID:预付费,即包年包月
  • POSTPAID_BY_HOUR:按小时后付费
  • SPOTPAID:竞价付费
  • 默认值:POSTPAID_BY_HOUR。 + InstanceChargeType *string `json:"InstanceChargeType,omitnil,omitempty" name:"InstanceChargeType"` + + // 预付费模式,即包年包月相关参数设置。通过该参数可以指定包年包月节点的购买时长、是否设置自动续费等属性。若指定节点的付费模式为预付费则该参数必传。 + InstanceChargePrepaid *InstanceChargePrepaid `json:"InstanceChargePrepaid,omitnil,omitempty" name:"InstanceChargePrepaid"` + + // 节点机型。不同实例机型指定了不同的资源规格。
  • 具体取值可通过调用接口[DescribeInstanceTypeConfigs](https://cloud.tencent.com/document/api/213/15749)来获得最新的规格表或参见[实例规格](https://cloud.tencent.com/document/product/213/11518)描述。
  • + InstanceType *string `json:"InstanceType,omitnil,omitempty" name:"InstanceType"` + + // 节点系统盘配置信息。若不指定该参数,则按照系统默认值进行分配。 + SystemDisk *SystemDisk `json:"SystemDisk,omitnil,omitempty" name:"SystemDisk"` + + // 节点数据盘配置信息。若不指定该参数,则默认不购买数据盘。支持购买的时候指定21块数据盘,其中最多包含1块LOCAL_BASIC数据盘或者LOCAL_SSD数据盘,最多包含20块CLOUD_BASIC数据盘、CLOUD_PREMIUM数据盘或者CLOUD_SSD数据盘。 + DataDisks []*DataDisk `json:"DataDisks,omitnil,omitempty" name:"DataDisks"` + + // 公网带宽相关信息设置。若不指定该参数,则默认公网带宽为0Mbps。 + InternetAccessible *InternetAccessible `json:"InternetAccessible,omitnil,omitempty" name:"InternetAccessible"` + + // 节点显示名称。 + // 不指定节点显示名称则默认显示‘未命名’。 + // 最多支持60个字符。 + InstanceName *string `json:"InstanceName,omitnil,omitempty" name:"InstanceName"` + + // 集群登录设置。 + LoginSettings *LoginSettings `json:"LoginSettings,omitnil,omitempty" name:"LoginSettings"` + + // 集群中实例所属安全组。该参数可以通过调用 [DescribeSecurityGroups](https://cloud.tencent.com/document/api/215/15808) 的返回值中的sgId字段来获取。若不指定该参数,则绑定默认安全组。 + SecurityGroupIds []*string `json:"SecurityGroupIds,omitnil,omitempty" name:"SecurityGroupIds"` + + // 用于保证请求幂等性的字符串。该字符串由客户生成,需保证不同请求之间唯一,最大值不超过64个ASCII字符。若不指定该参数,则无法保证请求的幂等性。 + ClientToken *string `json:"ClientToken,omitnil,omitempty" name:"ClientToken"` + + // 队列名称。不指定则为默认队列。
  • SLURM默认队列为:compute。
  • SGE默认队列为:all.q。
  • + QueueName *string `json:"QueueName,omitnil,omitempty" name:"QueueName"` + + // 添加节点角色。默认值:Compute
  • Compute:计算节点。
  • Login:登录节点。
  • + NodeRole *string `json:"NodeRole,omitnil,omitempty" name:"NodeRole"` + + // 是否只预检此次请求。 + // true:发送检查请求,不会创建实例。检查项包括是否填写了必需参数,请求格式,业务限制和云服务器库存。 + // 如果检查不通过,则返回对应错误码; + // 如果检查通过,则返回RequestId. + // false(默认):发送正常请求,通过检查后直接创建实例 + DryRun *bool `json:"DryRun,omitnil,omitempty" name:"DryRun"` + + // 添加节点类型。默认取值:STATIC。
  • STATIC:静态节点,不会参与弹性伸缩流程。
  • DYNAMIC:弹性节点,会被弹性缩容的节点。管控节点和登录节点不支持此参数。
  • + NodeType *string `json:"NodeType,omitnil,omitempty" name:"NodeType"` + + // 实例所属项目ID。该参数可以通过调用 [DescribeProject](https://cloud.tencent.com/document/api/651/78725) 的返回值中的 projectId 字段来获取。不填为默认项目。 + ProjectId *int64 `json:"ProjectId,omitnil,omitempty" name:"ProjectId"` + + // 要新增节点的资源类型。
  • CVM:CVM实例类型资源
  • WORKSPACE:工作空间类型实例资源
  • 默认值:CVM。 + ResourceType *string `json:"ResourceType,omitnil,omitempty" name:"ResourceType"` +} + +func (r *AddNodesRequest) 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 *AddNodesRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "Placement") + delete(f, "ClusterId") + delete(f, "VirtualPrivateCloud") + delete(f, "Count") + delete(f, "ImageId") + delete(f, "InstanceChargeType") + delete(f, "InstanceChargePrepaid") + delete(f, "InstanceType") + delete(f, "SystemDisk") + delete(f, "DataDisks") + delete(f, "InternetAccessible") + delete(f, "InstanceName") + delete(f, "LoginSettings") + delete(f, "SecurityGroupIds") + delete(f, "ClientToken") + delete(f, "QueueName") + delete(f, "NodeRole") + delete(f, "DryRun") + delete(f, "NodeType") + delete(f, "ProjectId") + delete(f, "ResourceType") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "AddNodesRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type AddNodesResponseParams struct { + // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` +} + +type AddNodesResponse struct { + *tchttp.BaseResponse + Response *AddNodesResponseParams `json:"Response"` +} + +func (r *AddNodesResponse) 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 *AddNodesResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type AddQueueRequestParams struct { + // 集群ID。 + ClusterId *string `json:"ClusterId,omitnil,omitempty" name:"ClusterId"` + + // 队列名称。
  • 最多支持32个字符。 + QueueName *string `json:"QueueName,omitnil,omitempty" name:"QueueName"` +} + +type AddQueueRequest struct { + *tchttp.BaseRequest + + // 集群ID。 + ClusterId *string `json:"ClusterId,omitnil,omitempty" name:"ClusterId"` + + // 队列名称。
  • 最多支持32个字符。 + QueueName *string `json:"QueueName,omitnil,omitempty" name:"QueueName"` +} + +func (r *AddQueueRequest) 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 *AddQueueRequest) 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, "QueueName") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "AddQueueRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type AddQueueResponseParams struct { + // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` +} + +type AddQueueResponse struct { + *tchttp.BaseResponse + Response *AddQueueResponseParams `json:"Response"` +} + +func (r *AddQueueResponse) 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 *AddQueueResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type AttachNodesRequestParams struct { + // 集群id + ClusterId *string `json:"ClusterId,omitnil,omitempty" name:"ClusterId"` + + // 节点的资源类型。
  • CVM:CVM实例类型资源
  • WORKSPACE:工作空间类型实例资源
  • 默认值:CVM。 + ResourceSet []*string `json:"ResourceSet,omitnil,omitempty" name:"ResourceSet"` + + // 队列名称。不指定则为默认队列: + // SLURM默认队列为:compute。 + // SGE默认队列为:all.q。 + QueueName *string `json:"QueueName,omitnil,omitempty" name:"QueueName"` + + // 指定有效的镜像ID,格式形如img-xxx。目前仅支持公有镜像和特定自定义镜像。如不指定,则该字段是默认镜像。 + ImageId *string `json:"ImageId,omitnil,omitempty" name:"ImageId"` + + // 要新增节点的资源类型。
  • CVM:CVM实例类型资源
  • WORKSPACE:工作空间类型实例资源
  • 默认值:CVM。 + ResourceType *string `json:"ResourceType,omitnil,omitempty" name:"ResourceType"` +} + +type AttachNodesRequest struct { + *tchttp.BaseRequest + + // 集群id + ClusterId *string `json:"ClusterId,omitnil,omitempty" name:"ClusterId"` + + // 节点的资源类型。
  • CVM:CVM实例类型资源
  • WORKSPACE:工作空间类型实例资源
  • 默认值:CVM。 + ResourceSet []*string `json:"ResourceSet,omitnil,omitempty" name:"ResourceSet"` + + // 队列名称。不指定则为默认队列: + // SLURM默认队列为:compute。 + // SGE默认队列为:all.q。 + QueueName *string `json:"QueueName,omitnil,omitempty" name:"QueueName"` + + // 指定有效的镜像ID,格式形如img-xxx。目前仅支持公有镜像和特定自定义镜像。如不指定,则该字段是默认镜像。 + ImageId *string `json:"ImageId,omitnil,omitempty" name:"ImageId"` + + // 要新增节点的资源类型。
  • CVM:CVM实例类型资源
  • WORKSPACE:工作空间类型实例资源
  • 默认值:CVM。 + ResourceType *string `json:"ResourceType,omitnil,omitempty" name:"ResourceType"` +} + +func (r *AttachNodesRequest) 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 *AttachNodesRequest) 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, "ResourceSet") + delete(f, "QueueName") + delete(f, "ImageId") + delete(f, "ResourceType") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "AttachNodesRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type AttachNodesResponseParams struct { + // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` +} + +type AttachNodesResponse struct { + *tchttp.BaseResponse + Response *AttachNodesResponseParams `json:"Response"` +} + +func (r *AttachNodesResponse) 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 *AttachNodesResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +type CFSOption struct { + // 文件系统本地挂载路径。 + LocalPath *string `json:"LocalPath,omitnil,omitempty" name:"LocalPath"` + + // 文件系统远程挂载ip及路径。 + RemotePath *string `json:"RemotePath,omitnil,omitempty" name:"RemotePath"` + + // 文件系统协议类型,默认值NFS 3.0。 + //
  • NFS 3.0。 + //
  • NFS 4.0。 + //
  • TURBO。 + Protocol *string `json:"Protocol,omitnil,omitempty" name:"Protocol"` + + // 文件系统存储类型,默认值SD;其中 SD 为通用标准型标准型存储, HP为通用性能型存储, TB为turbo标准型, TP 为turbo性能型。 + StorageType *string `json:"StorageType,omitnil,omitempty" name:"StorageType"` + + // 文件系统挂载挂载命令参数选项。 + // + // - NFS 3.0默认值:vers=3,nolock,proto=tcp,noresvport + // - NFS 4.0默认值:vers=4.0,noresvport + // - TURBO默认值:user_xattr + MountOption *string `json:"MountOption,omitnil,omitempty" name:"MountOption"` +} + +type CFSOptionOverview struct { + // 文件系统本地挂载路径。 + LocalPath *string `json:"LocalPath,omitnil,omitempty" name:"LocalPath"` + + // 文件系统远程挂载ip及路径。 + RemotePath *string `json:"RemotePath,omitnil,omitempty" name:"RemotePath"` + + // 文件系统协议类型。 + //
  • NFS 3.0。 + //
  • NFS 4.0。 + //
  • TURBO。 + Protocol *string `json:"Protocol,omitnil,omitempty" name:"Protocol"` + + // 文件系统存储类型,默认值SD;其中 SD 为通用标准型标准型存储, HP为通用性能型存储, TB为turbo标准型, TP 为turbo性能型。 + StorageType *string `json:"StorageType,omitnil,omitempty" name:"StorageType"` + + // 文件系统挂载命令参数选项。 + MountOption *string `json:"MountOption,omitnil,omitempty" name:"MountOption"` +} + +type ClusterActivity struct { + // 集群ID。 + ClusterId *string `json:"ClusterId,omitnil,omitempty" name:"ClusterId"` + + // 集群活动ID。 + ActivityId *string `json:"ActivityId,omitnil,omitempty" name:"ActivityId"` + + // 集群活动类型。取值范围:
  • CreateAndAddNodes:创建实例并添加进集群
  • RemoveNodesFromCluster:从集群移除实例
  • TerminateNodes:销毁实例
  • MountStorageOption:增加挂载选项并进行挂载
  • UmountStorageOption:删除集群挂载存储选项并解挂载 + ActivityType *string `json:"ActivityType,omitnil,omitempty" name:"ActivityType"` + + // 集群活动状态。取值范围:
  • PENDING:等待运行
  • RUNNING:运行中
  • SUCCESSFUL:活动成功
  • PARTIALLY_SUCCESSFUL:活动部分成功
  • FAILED:活动失败 + ActivityStatus *string `json:"ActivityStatus,omitnil,omitempty" name:"ActivityStatus"` + + // 集群活动状态码。 + // 注意:此字段可能返回 null,表示取不到有效值。 + ActivityStatusCode *string `json:"ActivityStatusCode,omitnil,omitempty" name:"ActivityStatusCode"` + + // 集群活动结果详情。 + // 注意:此字段可能返回 null,表示取不到有效值。 + ResultDetail *string `json:"ResultDetail,omitnil,omitempty" name:"ResultDetail"` + + // 集群活动起因。 + Cause *string `json:"Cause,omitnil,omitempty" name:"Cause"` + + // 集群活动描述。 + Description *string `json:"Description,omitnil,omitempty" name:"Description"` + + // 集群活动相关节点活动集合。 + RelatedNodeActivitySet []*NodeActivity `json:"RelatedNodeActivitySet,omitnil,omitempty" name:"RelatedNodeActivitySet"` + + // 集群活动开始时间。 + // 注意:此字段可能返回 null,表示取不到有效值。 + StartTime *string `json:"StartTime,omitnil,omitempty" name:"StartTime"` + + // 集群活动结束时间。 + // 注意:此字段可能返回 null,表示取不到有效值。 + EndTime *string `json:"EndTime,omitnil,omitempty" name:"EndTime"` +} + +type ClusterOverview struct { + // 集群ID。 + ClusterId *string `json:"ClusterId,omitnil,omitempty" name:"ClusterId"` + + // 集群状态。取值范围:
  • PENDING:创建中
  • INITING:初始化中
  • INIT_FAILED:初始化失败
  • RUNNING:运行中
  • TERMINATING:销毁中
  • + ClusterStatus *string `json:"ClusterStatus,omitnil,omitempty" name:"ClusterStatus"` + + // 集群名称。 + ClusterName *string `json:"ClusterName,omitnil,omitempty" name:"ClusterName"` + + // 集群位置信息。 + Placement *Placement `json:"Placement,omitnil,omitempty" name:"Placement"` + + // 集群创建时间。 + CreateTime *string `json:"CreateTime,omitnil,omitempty" name:"CreateTime"` + + // 集群调度器。 + SchedulerType *string `json:"SchedulerType,omitnil,omitempty" name:"SchedulerType"` + + // 集群调度器版本。 + // 注意:此字段可能返回 null,表示取不到有效值。 + SchedulerVersion *string `json:"SchedulerVersion,omitnil,omitempty" name:"SchedulerVersion"` + + // 计算节点数量。 + ComputeNodeCount *int64 `json:"ComputeNodeCount,omitnil,omitempty" name:"ComputeNodeCount"` + + // 计算节点概览。 + ComputeNodeSet []*ComputeNodeOverview `json:"ComputeNodeSet,omitnil,omitempty" name:"ComputeNodeSet"` + + // 管控节点数量。 + ManagerNodeCount *int64 `json:"ManagerNodeCount,omitnil,omitempty" name:"ManagerNodeCount"` + + // 管控节点概览。 + ManagerNodeSet []*ManagerNodeOverview `json:"ManagerNodeSet,omitnil,omitempty" name:"ManagerNodeSet"` + + // 登录节点概览。 + LoginNodeSet []*LoginNodeOverview `json:"LoginNodeSet,omitnil,omitempty" name:"LoginNodeSet"` + + // 登录节点数量。 + LoginNodeCount *int64 `json:"LoginNodeCount,omitnil,omitempty" name:"LoginNodeCount"` + + // 弹性伸缩类型。取值范围:
  • THPC_AS:集群自动扩缩容由THPC产品内部实现。
  • AS:集群自动扩缩容由[弹性伸缩](https://cloud.tencent.com/document/product/377/3154)产品实现。
  • + AutoScalingType *string `json:"AutoScalingType,omitnil,omitempty" name:"AutoScalingType"` + + // 集群所属私有网络ID。 + VpcId *string `json:"VpcId,omitnil,omitempty" name:"VpcId"` +} + +type ComputeNode struct { + // 节点[计费类型](https://cloud.tencent.com/document/product/213/2180)。
  • PREPAID:预付费,即包年包月
  • POSTPAID_BY_HOUR:按小时后付费
  • SPOTPAID:竞价付费
  • 默认值:POSTPAID_BY_HOUR。 + InstanceChargeType *string `json:"InstanceChargeType,omitnil,omitempty" name:"InstanceChargeType"` + + // 预付费模式,即包年包月相关参数设置。通过该参数可以指定包年包月节点的购买时长、是否设置自动续费等属性。若指定节点的付费模式为预付费则该参数必传。 + InstanceChargePrepaid *InstanceChargePrepaid `json:"InstanceChargePrepaid,omitnil,omitempty" name:"InstanceChargePrepaid"` + + // 节点机型。不同实例机型指定了不同的资源规格。
  • 具体取值可通过调用接口[DescribeInstanceTypeConfigs](https://cloud.tencent.com/document/api/213/15749)来获得最新的规格表或参见[实例规格](https://cloud.tencent.com/document/product/213/11518)描述。
  • + InstanceType *string `json:"InstanceType,omitnil,omitempty" name:"InstanceType"` + + // 节点系统盘配置信息。若不指定该参数,则按照系统默认值进行分配。 + SystemDisk *SystemDisk `json:"SystemDisk,omitnil,omitempty" name:"SystemDisk"` + + // 节点数据盘配置信息。若不指定该参数,则默认不购买数据盘。支持购买的时候指定21块数据盘,其中最多包含1块LOCAL_BASIC数据盘或者LOCAL_SSD数据盘,最多包含20块CLOUD_BASIC数据盘、CLOUD_PREMIUM数据盘或者CLOUD_SSD数据盘。 + DataDisks []*DataDisk `json:"DataDisks,omitnil,omitempty" name:"DataDisks"` + + // 公网带宽相关信息设置。若不指定该参数,则默认公网带宽为0Mbps。 + InternetAccessible *InternetAccessible `json:"InternetAccessible,omitnil,omitempty" name:"InternetAccessible"` + + // 节点显示名称。
  • 不指定节点显示名称则默认显示‘未命名’。 + // 最多支持60个字符。
  • + InstanceName *string `json:"InstanceName,omitnil,omitempty" name:"InstanceName"` + + // 实例所属项目ID。该参数可以通过调用 [DescribeProject](https://cloud.tencent.com/document/api/651/78725) 的返回值中的 projectId 字段来获取。不填为默认项目。 + ProjectId *int64 `json:"ProjectId,omitnil,omitempty" name:"ProjectId"` + + // 实例资源类型,默认是CVM资源 + ResourceType *string `json:"ResourceType,omitnil,omitempty" name:"ResourceType"` +} + +type ComputeNodeOverview struct { + // 计算节点ID。 + // 注意:此字段可能返回 null,表示取不到有效值。 + NodeId *string `json:"NodeId,omitnil,omitempty" name:"NodeId"` +} + +// Predefined struct for user +type CreateClusterRequestParams struct { + // 集群中实例所在的位置。 + Placement *Placement `json:"Placement,omitnil,omitempty" name:"Placement"` + + // 指定管理节点。 + ManagerNode *ManagerNode `json:"ManagerNode,omitnil,omitempty" name:"ManagerNode"` + + // 指定管理节点的数量。默认取值:1。取值范围:1~2。 + ManagerNodeCount *int64 `json:"ManagerNodeCount,omitnil,omitempty" name:"ManagerNodeCount"` + + // 指定计算节点。 + ComputeNode *ComputeNode `json:"ComputeNode,omitnil,omitempty" name:"ComputeNode"` + + // 指定计算节点的数量。默认取值:0。 + ComputeNodeCount *int64 `json:"ComputeNodeCount,omitnil,omitempty" name:"ComputeNodeCount"` + + // 调度器类型。默认取值:SLURM。
  • SGE:SGE调度器。
  • SLURM:SLURM调度器。
  • + SchedulerType *string `json:"SchedulerType,omitnil,omitempty" name:"SchedulerType"` + + // 创建调度器的版本号,可填写版本号为“latest” 和 各调度器支持的版本号;如果是"latest", 则代表创建的是平台当前支持的该类型调度器最新版本。如果不填写,默认创建的是“latest”版本调度器 + // 各调度器支持的集群版本: + //
  • SLURM:21.08.8、23.11.7
  • + //
  • SGE: 8.1.9
  • + SchedulerVersion *string `json:"SchedulerVersion,omitnil,omitempty" name:"SchedulerVersion"` + + // 指定有效的[镜像](https://cloud.tencent.com/document/product/213/4940)ID,格式形如`img-xxx`。目前支持部分公有镜像和自定义镜像。 + ImageId *string `json:"ImageId,omitnil,omitempty" name:"ImageId"` + + // 私有网络相关信息配置。 + VirtualPrivateCloud *VirtualPrivateCloud `json:"VirtualPrivateCloud,omitnil,omitempty" name:"VirtualPrivateCloud"` + + // 集群登录设置。 + LoginSettings *LoginSettings `json:"LoginSettings,omitnil,omitempty" name:"LoginSettings"` + + // 集群中实例所属安全组。该参数可以通过调用 [DescribeSecurityGroups](https://cloud.tencent.com/document/api/215/15808) 的返回值中的sgId字段来获取。若不指定该参数,则绑定默认安全组。 + SecurityGroupIds []*string `json:"SecurityGroupIds,omitnil,omitempty" name:"SecurityGroupIds"` + + // 用于保证请求幂等性的字符串。该字符串由客户生成,需保证不同请求之间唯一,最大值不超过64个ASCII字符。若不指定该参数,则无法保证请求的幂等性。 + ClientToken *string `json:"ClientToken,omitnil,omitempty" name:"ClientToken"` + + // 是否只预检此次请求。 + // true:发送检查请求,不会创建实例。检查项包括是否填写了必需参数,请求格式,业务限制和云服务器库存。 + // 如果检查不通过,则返回对应错误码; + // 如果检查通过,则返回RequestId. + // false(默认):发送正常请求,通过检查后直接创建实例 + DryRun *bool `json:"DryRun,omitnil,omitempty" name:"DryRun"` + + // 域名字服务类型。默认取值:NIS。 + //
  • NIS:NIS域名字服务。
  • + AccountType *string `json:"AccountType,omitnil,omitempty" name:"AccountType"` + + // 集群显示名称。 + ClusterName *string `json:"ClusterName,omitnil,omitempty" name:"ClusterName"` + + // 集群存储选项 + StorageOption *StorageOption `json:"StorageOption,omitnil,omitempty" name:"StorageOption"` + + // 指定登录节点。 + LoginNode *LoginNode `json:"LoginNode,omitnil,omitempty" name:"LoginNode"` + + // 指定登录节点的数量。默认取值:0。取值范围:0~10。 + LoginNodeCount *int64 `json:"LoginNodeCount,omitnil,omitempty" name:"LoginNodeCount"` + + // 创建集群时同时绑定的标签对说明。 + Tags []*Tag `json:"Tags,omitnil,omitempty" name:"Tags"` + + // 弹性伸缩类型。默认值:THPC_AS
  • THPC_AS:集群自动扩缩容由THPC产品内部实现。
  • AS:集群自动扩缩容由[弹性伸缩](https://cloud.tencent.com/document/product/377/3154)产品实现。
  • + AutoScalingType *string `json:"AutoScalingType,omitnil,omitempty" name:"AutoScalingType"` + + // 节点初始化脚本信息列表。 + InitNodeScripts []*NodeScript `json:"InitNodeScripts,omitnil,omitempty" name:"InitNodeScripts"` + + // 高性能计算集群ID。若创建的实例为高性能计算实例,需指定实例放置的集群,否则不可指定。 + HpcClusterId *string `json:"HpcClusterId,omitnil,omitempty" name:"HpcClusterId"` +} + +type CreateClusterRequest struct { + *tchttp.BaseRequest + + // 集群中实例所在的位置。 + Placement *Placement `json:"Placement,omitnil,omitempty" name:"Placement"` + + // 指定管理节点。 + ManagerNode *ManagerNode `json:"ManagerNode,omitnil,omitempty" name:"ManagerNode"` + + // 指定管理节点的数量。默认取值:1。取值范围:1~2。 + ManagerNodeCount *int64 `json:"ManagerNodeCount,omitnil,omitempty" name:"ManagerNodeCount"` + + // 指定计算节点。 + ComputeNode *ComputeNode `json:"ComputeNode,omitnil,omitempty" name:"ComputeNode"` + + // 指定计算节点的数量。默认取值:0。 + ComputeNodeCount *int64 `json:"ComputeNodeCount,omitnil,omitempty" name:"ComputeNodeCount"` + + // 调度器类型。默认取值:SLURM。
  • SGE:SGE调度器。
  • SLURM:SLURM调度器。
  • + SchedulerType *string `json:"SchedulerType,omitnil,omitempty" name:"SchedulerType"` + + // 创建调度器的版本号,可填写版本号为“latest” 和 各调度器支持的版本号;如果是"latest", 则代表创建的是平台当前支持的该类型调度器最新版本。如果不填写,默认创建的是“latest”版本调度器 + // 各调度器支持的集群版本: + //
  • SLURM:21.08.8、23.11.7
  • + //
  • SGE: 8.1.9
  • + SchedulerVersion *string `json:"SchedulerVersion,omitnil,omitempty" name:"SchedulerVersion"` + + // 指定有效的[镜像](https://cloud.tencent.com/document/product/213/4940)ID,格式形如`img-xxx`。目前支持部分公有镜像和自定义镜像。 + ImageId *string `json:"ImageId,omitnil,omitempty" name:"ImageId"` + + // 私有网络相关信息配置。 + VirtualPrivateCloud *VirtualPrivateCloud `json:"VirtualPrivateCloud,omitnil,omitempty" name:"VirtualPrivateCloud"` + + // 集群登录设置。 + LoginSettings *LoginSettings `json:"LoginSettings,omitnil,omitempty" name:"LoginSettings"` + + // 集群中实例所属安全组。该参数可以通过调用 [DescribeSecurityGroups](https://cloud.tencent.com/document/api/215/15808) 的返回值中的sgId字段来获取。若不指定该参数,则绑定默认安全组。 + SecurityGroupIds []*string `json:"SecurityGroupIds,omitnil,omitempty" name:"SecurityGroupIds"` + + // 用于保证请求幂等性的字符串。该字符串由客户生成,需保证不同请求之间唯一,最大值不超过64个ASCII字符。若不指定该参数,则无法保证请求的幂等性。 + ClientToken *string `json:"ClientToken,omitnil,omitempty" name:"ClientToken"` + + // 是否只预检此次请求。 + // true:发送检查请求,不会创建实例。检查项包括是否填写了必需参数,请求格式,业务限制和云服务器库存。 + // 如果检查不通过,则返回对应错误码; + // 如果检查通过,则返回RequestId. + // false(默认):发送正常请求,通过检查后直接创建实例 + DryRun *bool `json:"DryRun,omitnil,omitempty" name:"DryRun"` + + // 域名字服务类型。默认取值:NIS。 + //
  • NIS:NIS域名字服务。
  • + AccountType *string `json:"AccountType,omitnil,omitempty" name:"AccountType"` + + // 集群显示名称。 + ClusterName *string `json:"ClusterName,omitnil,omitempty" name:"ClusterName"` + + // 集群存储选项 + StorageOption *StorageOption `json:"StorageOption,omitnil,omitempty" name:"StorageOption"` + + // 指定登录节点。 + LoginNode *LoginNode `json:"LoginNode,omitnil,omitempty" name:"LoginNode"` + + // 指定登录节点的数量。默认取值:0。取值范围:0~10。 + LoginNodeCount *int64 `json:"LoginNodeCount,omitnil,omitempty" name:"LoginNodeCount"` + + // 创建集群时同时绑定的标签对说明。 + Tags []*Tag `json:"Tags,omitnil,omitempty" name:"Tags"` + + // 弹性伸缩类型。默认值:THPC_AS
  • THPC_AS:集群自动扩缩容由THPC产品内部实现。
  • AS:集群自动扩缩容由[弹性伸缩](https://cloud.tencent.com/document/product/377/3154)产品实现。
  • + AutoScalingType *string `json:"AutoScalingType,omitnil,omitempty" name:"AutoScalingType"` + + // 节点初始化脚本信息列表。 + InitNodeScripts []*NodeScript `json:"InitNodeScripts,omitnil,omitempty" name:"InitNodeScripts"` + + // 高性能计算集群ID。若创建的实例为高性能计算实例,需指定实例放置的集群,否则不可指定。 + HpcClusterId *string `json:"HpcClusterId,omitnil,omitempty" name:"HpcClusterId"` +} + +func (r *CreateClusterRequest) 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 *CreateClusterRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "Placement") + delete(f, "ManagerNode") + delete(f, "ManagerNodeCount") + delete(f, "ComputeNode") + delete(f, "ComputeNodeCount") + delete(f, "SchedulerType") + delete(f, "SchedulerVersion") + delete(f, "ImageId") + delete(f, "VirtualPrivateCloud") + delete(f, "LoginSettings") + delete(f, "SecurityGroupIds") + delete(f, "ClientToken") + delete(f, "DryRun") + delete(f, "AccountType") + delete(f, "ClusterName") + delete(f, "StorageOption") + delete(f, "LoginNode") + delete(f, "LoginNodeCount") + delete(f, "Tags") + delete(f, "AutoScalingType") + delete(f, "InitNodeScripts") + delete(f, "HpcClusterId") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "CreateClusterRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type CreateClusterResponseParams struct { + // 集群ID。 + // 注意:此字段可能返回 null,表示取不到有效值。 + ClusterId *string `json:"ClusterId,omitnil,omitempty" name:"ClusterId"` + + // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` +} + +type CreateClusterResponse struct { + *tchttp.BaseResponse + Response *CreateClusterResponseParams `json:"Response"` +} + +func (r *CreateClusterResponse) 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 *CreateClusterResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type CreateWorkspacesRequestParams struct { + // 用于保证请求幂等性的字符串。该字符串由客户生成,需保证不同请求之间唯一,最大值不超过64个ASCII字符。若不指定该参数,则无法保证请求的幂等性。 + ClientToken *string `json:"ClientToken,omitnil,omitempty" name:"ClientToken"` + + // 实例所在的位置。通过该参数可以指定实例所属可用区,所属项目,所属宿主机(在专用宿主机上创建子机时指定)等属性。 注:如果您不指定LaunchTemplate参数,则Placement为必选参数。若同时传递Placement和LaunchTemplate,则默认覆盖LaunchTemplate中对应的Placement的值。 + Placement *SpacePlacement `json:"Placement,omitnil,omitempty" name:"Placement"` + + // 预付费模式,即包年包月相关参数设置。通过该参数可以指定包年包月实例的购买时长、是否设置自动续费等属性。若指定实例的付费模式为预付费则该参数必传。 + SpaceChargePrepaid *SpaceChargePrepaid `json:"SpaceChargePrepaid,omitnil,omitempty" name:"SpaceChargePrepaid"` + + // 工作空间计费类型 + SpaceChargeType *string `json:"SpaceChargeType,omitnil,omitempty" name:"SpaceChargeType"` + + // 工作空间规格 + SpaceType *string `json:"SpaceType,omitnil,omitempty" name:"SpaceType"` + + // 镜像ID + ImageId *string `json:"ImageId,omitnil,omitempty" name:"ImageId"` + + // 工作空间系统盘信息 + SystemDisk *SpaceSystemDisk `json:"SystemDisk,omitnil,omitempty" name:"SystemDisk"` + + // 工作空间数据盘信息 + DataDisks []*SpaceDataDisk `json:"DataDisks,omitnil,omitempty" name:"DataDisks"` + + // 私有网络相关信息 + VirtualPrivateCloud *SpaceVirtualPrivateCloud `json:"VirtualPrivateCloud,omitnil,omitempty" name:"VirtualPrivateCloud"` + + // 公网带宽相关信息设置 + InternetAccessible *SpaceInternetAccessible `json:"InternetAccessible,omitnil,omitempty" name:"InternetAccessible"` + + // 购买工作空间数量 + SpaceCount *int64 `json:"SpaceCount,omitnil,omitempty" name:"SpaceCount"` + + // 工作空间显示名称 + SpaceName *string `json:"SpaceName,omitnil,omitempty" name:"SpaceName"` + + // 工作空间登陆设置 + LoginSettings *LoginSettings `json:"LoginSettings,omitnil,omitempty" name:"LoginSettings"` + + // 工作空间所属安全组 + SecurityGroupIds []*string `json:"SecurityGroupIds,omitnil,omitempty" name:"SecurityGroupIds"` + + // 增强服务 + EnhancedService *EnhancedService `json:"EnhancedService,omitnil,omitempty" name:"EnhancedService"` + + // 是否只预检此次请求 + DryRun *bool `json:"DryRun,omitnil,omitempty" name:"DryRun"` + + // 提供给工作空间使用的用户数据 + UserData *string `json:"UserData,omitnil,omitempty" name:"UserData"` + + // 置放群组id + DisasterRecoverGroupIds []*string `json:"DisasterRecoverGroupIds,omitnil,omitempty" name:"DisasterRecoverGroupIds"` + + // 标签描述列表 + TagSpecification []*TagSpecification `json:"TagSpecification,omitnil,omitempty" name:"TagSpecification"` + + // 高性能计算集群ID + HpcClusterId *string `json:"HpcClusterId,omitnil,omitempty" name:"HpcClusterId"` + + // CAM角色名称 + CamRoleName *string `json:"CamRoleName,omitnil,omitempty" name:"CamRoleName"` + + // 实例主机名。
  • 点号(.)和短横线(-)不能作为 HostName 的首尾字符,不能连续使用。

  • Windows 实例:主机名名字符长度为[2, 15],允许字母(不限制大小写)、数字和短横线(-)组成,不支持点号(.),不能全是数字。

  • 其他类型(Linux 等)实例:主机名字符长度为[2, 60],允许支持多个点号,点之间为一段,每段允许字母(不限制大小写)、数字和短横线(-)组成。

  • 购买多台实例,如果指定模式串`{R:x}`,表示生成数字`[x, x+n-1]`,其中`n`表示购买实例的数量,例如`server{R:3}`,购买1台时,实例主机名为`server3`;购买2台时,实例主机名分别为`server3`,`server4`。支持指定多个模式串`{R:x}`。

  • 购买多台实例,如果不指定模式串,则在实例主机名添加后缀`1、2...n`,其中`n`表示购买实例的数量,例如`server`,购买2台时,实例主机名分别为`server1`,`server2`。
  • + HostName *string `json:"HostName,omitnil,omitempty" name:"HostName"` +} + +type CreateWorkspacesRequest struct { + *tchttp.BaseRequest + + // 用于保证请求幂等性的字符串。该字符串由客户生成,需保证不同请求之间唯一,最大值不超过64个ASCII字符。若不指定该参数,则无法保证请求的幂等性。 + ClientToken *string `json:"ClientToken,omitnil,omitempty" name:"ClientToken"` + + // 实例所在的位置。通过该参数可以指定实例所属可用区,所属项目,所属宿主机(在专用宿主机上创建子机时指定)等属性。 注:如果您不指定LaunchTemplate参数,则Placement为必选参数。若同时传递Placement和LaunchTemplate,则默认覆盖LaunchTemplate中对应的Placement的值。 + Placement *SpacePlacement `json:"Placement,omitnil,omitempty" name:"Placement"` + + // 预付费模式,即包年包月相关参数设置。通过该参数可以指定包年包月实例的购买时长、是否设置自动续费等属性。若指定实例的付费模式为预付费则该参数必传。 + SpaceChargePrepaid *SpaceChargePrepaid `json:"SpaceChargePrepaid,omitnil,omitempty" name:"SpaceChargePrepaid"` + + // 工作空间计费类型 + SpaceChargeType *string `json:"SpaceChargeType,omitnil,omitempty" name:"SpaceChargeType"` + + // 工作空间规格 + SpaceType *string `json:"SpaceType,omitnil,omitempty" name:"SpaceType"` + + // 镜像ID + ImageId *string `json:"ImageId,omitnil,omitempty" name:"ImageId"` + + // 工作空间系统盘信息 + SystemDisk *SpaceSystemDisk `json:"SystemDisk,omitnil,omitempty" name:"SystemDisk"` + + // 工作空间数据盘信息 + DataDisks []*SpaceDataDisk `json:"DataDisks,omitnil,omitempty" name:"DataDisks"` + + // 私有网络相关信息 + VirtualPrivateCloud *SpaceVirtualPrivateCloud `json:"VirtualPrivateCloud,omitnil,omitempty" name:"VirtualPrivateCloud"` + + // 公网带宽相关信息设置 + InternetAccessible *SpaceInternetAccessible `json:"InternetAccessible,omitnil,omitempty" name:"InternetAccessible"` + + // 购买工作空间数量 + SpaceCount *int64 `json:"SpaceCount,omitnil,omitempty" name:"SpaceCount"` + + // 工作空间显示名称 + SpaceName *string `json:"SpaceName,omitnil,omitempty" name:"SpaceName"` + + // 工作空间登陆设置 + LoginSettings *LoginSettings `json:"LoginSettings,omitnil,omitempty" name:"LoginSettings"` + + // 工作空间所属安全组 + SecurityGroupIds []*string `json:"SecurityGroupIds,omitnil,omitempty" name:"SecurityGroupIds"` + + // 增强服务 + EnhancedService *EnhancedService `json:"EnhancedService,omitnil,omitempty" name:"EnhancedService"` + + // 是否只预检此次请求 + DryRun *bool `json:"DryRun,omitnil,omitempty" name:"DryRun"` + + // 提供给工作空间使用的用户数据 + UserData *string `json:"UserData,omitnil,omitempty" name:"UserData"` + + // 置放群组id + DisasterRecoverGroupIds []*string `json:"DisasterRecoverGroupIds,omitnil,omitempty" name:"DisasterRecoverGroupIds"` + + // 标签描述列表 + TagSpecification []*TagSpecification `json:"TagSpecification,omitnil,omitempty" name:"TagSpecification"` + + // 高性能计算集群ID + HpcClusterId *string `json:"HpcClusterId,omitnil,omitempty" name:"HpcClusterId"` + + // CAM角色名称 + CamRoleName *string `json:"CamRoleName,omitnil,omitempty" name:"CamRoleName"` + + // 实例主机名。
  • 点号(.)和短横线(-)不能作为 HostName 的首尾字符,不能连续使用。

  • Windows 实例:主机名名字符长度为[2, 15],允许字母(不限制大小写)、数字和短横线(-)组成,不支持点号(.),不能全是数字。

  • 其他类型(Linux 等)实例:主机名字符长度为[2, 60],允许支持多个点号,点之间为一段,每段允许字母(不限制大小写)、数字和短横线(-)组成。

  • 购买多台实例,如果指定模式串`{R:x}`,表示生成数字`[x, x+n-1]`,其中`n`表示购买实例的数量,例如`server{R:3}`,购买1台时,实例主机名为`server3`;购买2台时,实例主机名分别为`server3`,`server4`。支持指定多个模式串`{R:x}`。

  • 购买多台实例,如果不指定模式串,则在实例主机名添加后缀`1、2...n`,其中`n`表示购买实例的数量,例如`server`,购买2台时,实例主机名分别为`server1`,`server2`。
  • + HostName *string `json:"HostName,omitnil,omitempty" name:"HostName"` +} + +func (r *CreateWorkspacesRequest) 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 *CreateWorkspacesRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "ClientToken") + delete(f, "Placement") + delete(f, "SpaceChargePrepaid") + delete(f, "SpaceChargeType") + delete(f, "SpaceType") + delete(f, "ImageId") + delete(f, "SystemDisk") + delete(f, "DataDisks") + delete(f, "VirtualPrivateCloud") + delete(f, "InternetAccessible") + delete(f, "SpaceCount") + delete(f, "SpaceName") + delete(f, "LoginSettings") + delete(f, "SecurityGroupIds") + delete(f, "EnhancedService") + delete(f, "DryRun") + delete(f, "UserData") + delete(f, "DisasterRecoverGroupIds") + delete(f, "TagSpecification") + delete(f, "HpcClusterId") + delete(f, "CamRoleName") + delete(f, "HostName") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "CreateWorkspacesRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type CreateWorkspacesResponseParams struct { + // 工作空间ID + SpaceIdSet []*string `json:"SpaceIdSet,omitnil,omitempty" name:"SpaceIdSet"` + + // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` +} + +type CreateWorkspacesResponse struct { + *tchttp.BaseResponse + Response *CreateWorkspacesResponseParams `json:"Response"` +} + +func (r *CreateWorkspacesResponse) 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 *CreateWorkspacesResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +type DataDisk struct { + // 数据盘大小,单位:GB。最小调整步长为10G,不同数据盘类型取值范围不同,具体限制详见:[存储概述](https://cloud.tencent.com/document/product/213/4952)。默认值为0,表示不购买数据盘。更多限制详见产品文档。 + // 注意:此字段可能返回 null,表示取不到有效值。 + DiskSize *int64 `json:"DiskSize,omitnil,omitempty" name:"DiskSize"` + + // 数据盘类型。数据盘类型限制详见[存储概述](https://cloud.tencent.com/document/product/213/4952)。取值范围:
  • LOCAL_NVME:本地NVME硬盘,与InstanceType强相关,不支持指定
  • LOCAL_PRO:本地HDD硬盘,与InstanceType强相关,不支持指定
  • CLOUD_BASIC:普通云硬盘
  • CLOUD_PREMIUM:高性能云硬盘
  • CLOUD_SSD:SSD云硬盘
  • CLOUD_HSSD:增强型SSD云硬盘
  • CLOUD_TSSD:极速型SSD云硬盘
  • CLOUD_BSSD:通用型SSD云硬盘 + // 注意:此字段可能返回 null,表示取不到有效值。 + DiskType *string `json:"DiskType,omitnil,omitempty" name:"DiskType"` +} + +// Predefined struct for user +type DeleteClusterRequestParams struct { + // 集群ID。 + ClusterId *string `json:"ClusterId,omitnil,omitempty" name:"ClusterId"` +} + +type DeleteClusterRequest struct { + *tchttp.BaseRequest + + // 集群ID。 + ClusterId *string `json:"ClusterId,omitnil,omitempty" name:"ClusterId"` +} + +func (r *DeleteClusterRequest) 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 *DeleteClusterRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "ClusterId") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DeleteClusterRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DeleteClusterResponseParams struct { + // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` +} + +type DeleteClusterResponse struct { + *tchttp.BaseResponse + Response *DeleteClusterResponseParams `json:"Response"` +} + +func (r *DeleteClusterResponse) 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 *DeleteClusterResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DeleteClusterStorageOptionRequestParams struct { + // 集群ID。 + ClusterId *string `json:"ClusterId,omitnil,omitempty" name:"ClusterId"` + + // 本地挂载路径。 + LocalPath *string `json:"LocalPath,omitnil,omitempty" name:"LocalPath"` +} + +type DeleteClusterStorageOptionRequest struct { + *tchttp.BaseRequest + + // 集群ID。 + ClusterId *string `json:"ClusterId,omitnil,omitempty" name:"ClusterId"` + + // 本地挂载路径。 + LocalPath *string `json:"LocalPath,omitnil,omitempty" name:"LocalPath"` +} + +func (r *DeleteClusterStorageOptionRequest) 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 *DeleteClusterStorageOptionRequest) 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, "LocalPath") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DeleteClusterStorageOptionRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DeleteClusterStorageOptionResponseParams struct { + // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` +} + +type DeleteClusterStorageOptionResponse struct { + *tchttp.BaseResponse + Response *DeleteClusterStorageOptionResponseParams `json:"Response"` +} + +func (r *DeleteClusterStorageOptionResponse) 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 *DeleteClusterStorageOptionResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DeleteNodesRequestParams struct { + // 集群ID。 + ClusterId *string `json:"ClusterId,omitnil,omitempty" name:"ClusterId"` + + // 节点ID。 + NodeIds []*string `json:"NodeIds,omitnil,omitempty" name:"NodeIds"` +} + +type DeleteNodesRequest struct { + *tchttp.BaseRequest + + // 集群ID。 + ClusterId *string `json:"ClusterId,omitnil,omitempty" name:"ClusterId"` + + // 节点ID。 + NodeIds []*string `json:"NodeIds,omitnil,omitempty" name:"NodeIds"` +} + +func (r *DeleteNodesRequest) 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 *DeleteNodesRequest) 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, "NodeIds") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DeleteNodesRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DeleteNodesResponseParams struct { + // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` +} + +type DeleteNodesResponse struct { + *tchttp.BaseResponse + Response *DeleteNodesResponseParams `json:"Response"` +} + +func (r *DeleteNodesResponse) 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 *DeleteNodesResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DeleteQueueRequestParams struct { + // 集群ID。 + ClusterId *string `json:"ClusterId,omitnil,omitempty" name:"ClusterId"` + + // 队列名称。
  • 最多支持32个字符。 + QueueName *string `json:"QueueName,omitnil,omitempty" name:"QueueName"` +} + +type DeleteQueueRequest struct { + *tchttp.BaseRequest + + // 集群ID。 + ClusterId *string `json:"ClusterId,omitnil,omitempty" name:"ClusterId"` + + // 队列名称。
  • 最多支持32个字符。 + QueueName *string `json:"QueueName,omitnil,omitempty" name:"QueueName"` +} + +func (r *DeleteQueueRequest) 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 *DeleteQueueRequest) 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, "QueueName") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DeleteQueueRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DeleteQueueResponseParams struct { + // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` +} + +type DeleteQueueResponse struct { + *tchttp.BaseResponse + Response *DeleteQueueResponseParams `json:"Response"` +} + +func (r *DeleteQueueResponse) 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 *DeleteQueueResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DescribeAutoScalingConfigurationRequestParams struct { + // 集群ID。 + ClusterId *string `json:"ClusterId,omitnil,omitempty" name:"ClusterId"` +} + +type DescribeAutoScalingConfigurationRequest struct { + *tchttp.BaseRequest + + // 集群ID。 + ClusterId *string `json:"ClusterId,omitnil,omitempty" name:"ClusterId"` +} + +func (r *DescribeAutoScalingConfigurationRequest) 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 *DescribeAutoScalingConfigurationRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "ClusterId") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeAutoScalingConfigurationRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DescribeAutoScalingConfigurationResponseParams struct { + // 集群ID。 + ClusterId *string `json:"ClusterId,omitnil,omitempty" name:"ClusterId"` + + // 任务连续等待时间,队列的任务处于连续等待的时间。单位秒。 + ExpansionBusyTime *int64 `json:"ExpansionBusyTime,omitnil,omitempty" name:"ExpansionBusyTime"` + + // 节点连续空闲(未运行作业)时间,一个节点连续处于空闲状态时间。 + ShrinkIdleTime *int64 `json:"ShrinkIdleTime,omitnil,omitempty" name:"ShrinkIdleTime"` + + // 扩容队列配置概览列表。 + QueueConfigs []*QueueConfigOverview `json:"QueueConfigs,omitnil,omitempty" name:"QueueConfigs"` + + // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` +} + +type DescribeAutoScalingConfigurationResponse struct { + *tchttp.BaseResponse + Response *DescribeAutoScalingConfigurationResponseParams `json:"Response"` +} + +func (r *DescribeAutoScalingConfigurationResponse) 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 *DescribeAutoScalingConfigurationResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DescribeClusterActivitiesRequestParams 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 DescribeClusterActivitiesRequest 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 *DescribeClusterActivitiesRequest) 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 *DescribeClusterActivitiesRequest) 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", "DescribeClusterActivitiesRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DescribeClusterActivitiesResponseParams struct { + // 集群活动历史记录列表。 + ClusterActivitySet []*ClusterActivity `json:"ClusterActivitySet,omitnil,omitempty" name:"ClusterActivitySet"` + + // 集群活动历史记录数量。 + TotalCount *int64 `json:"TotalCount,omitnil,omitempty" name:"TotalCount"` + + // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` +} + +type DescribeClusterActivitiesResponse struct { + *tchttp.BaseResponse + Response *DescribeClusterActivitiesResponseParams `json:"Response"` +} + +func (r *DescribeClusterActivitiesResponse) 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 *DescribeClusterActivitiesResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DescribeClusterStorageOptionRequestParams struct { + // 集群ID。 + ClusterId *string `json:"ClusterId,omitnil,omitempty" name:"ClusterId"` +} + +type DescribeClusterStorageOptionRequest struct { + *tchttp.BaseRequest + + // 集群ID。 + ClusterId *string `json:"ClusterId,omitnil,omitempty" name:"ClusterId"` +} + +func (r *DescribeClusterStorageOptionRequest) 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 *DescribeClusterStorageOptionRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "ClusterId") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeClusterStorageOptionRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DescribeClusterStorageOptionResponseParams struct { + // 集群存储选项信息概览。 + StorageOption *StorageOptionOverview `json:"StorageOption,omitnil,omitempty" name:"StorageOption"` + + // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` +} + +type DescribeClusterStorageOptionResponse struct { + *tchttp.BaseResponse + Response *DescribeClusterStorageOptionResponseParams `json:"Response"` +} + +func (r *DescribeClusterStorageOptionResponse) 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 *DescribeClusterStorageOptionResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DescribeClustersRequestParams struct { + // 集群ID列表。通过该参数可以指定需要查询信息的集群列表。
    如果您不指定该参数,则返回Limit数量以内的集群信息。 + ClusterIds []*string `json:"ClusterIds,omitnil,omitempty" name:"ClusterIds"` + + // 偏移量,默认为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 DescribeClustersRequest struct { + *tchttp.BaseRequest + + // 集群ID列表。通过该参数可以指定需要查询信息的集群列表。
    如果您不指定该参数,则返回Limit数量以内的集群信息。 + ClusterIds []*string `json:"ClusterIds,omitnil,omitempty" name:"ClusterIds"` + + // 偏移量,默认为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 *DescribeClustersRequest) 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 *DescribeClustersRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "ClusterIds") + delete(f, "Offset") + delete(f, "Limit") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeClustersRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DescribeClustersResponseParams struct { + // 集群概览信息列表。 + ClusterSet []*ClusterOverview `json:"ClusterSet,omitnil,omitempty" name:"ClusterSet"` + + // 集群数量。 + TotalCount *int64 `json:"TotalCount,omitnil,omitempty" name:"TotalCount"` + + // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` +} + +type DescribeClustersResponse struct { + *tchttp.BaseResponse + Response *DescribeClustersResponseParams `json:"Response"` +} + +func (r *DescribeClustersResponse) 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 *DescribeClustersResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DescribeInitNodeScriptsRequestParams struct { + // 集群ID。 + ClusterId *string `json:"ClusterId,omitnil,omitempty" name:"ClusterId"` +} + +type DescribeInitNodeScriptsRequest struct { + *tchttp.BaseRequest + + // 集群ID。 + ClusterId *string `json:"ClusterId,omitnil,omitempty" name:"ClusterId"` +} + +func (r *DescribeInitNodeScriptsRequest) 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 *DescribeInitNodeScriptsRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "ClusterId") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeInitNodeScriptsRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DescribeInitNodeScriptsResponseParams struct { + // 节点初始化脚本列表。 + // 注意:此字段可能返回 null,表示取不到有效值。 + InitNodeScriptSet []*NodeScript `json:"InitNodeScriptSet,omitnil,omitempty" name:"InitNodeScriptSet"` + + // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` +} + +type DescribeInitNodeScriptsResponse struct { + *tchttp.BaseResponse + Response *DescribeInitNodeScriptsResponseParams `json:"Response"` +} + +func (r *DescribeInitNodeScriptsResponse) 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 *DescribeInitNodeScriptsResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DescribeNodesRequestParams struct { + // 集群ID。 + ClusterId *string `json:"ClusterId,omitnil,omitempty" name:"ClusterId"` + + // + //

    每次请求的`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"` + + // + //

    每次请求的`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列表。通过该参数可以指定需要查询信息的集群列表。
    如果您不指定该参数,则返回Limit数量以内的集群信息。 + SpaceIds []*string `json:"SpaceIds,omitnil,omitempty" name:"SpaceIds"` + + // 偏移量,默认为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"` + + // 过滤列表 + Filters []*Filter `json:"Filters,omitnil,omitempty" name:"Filters"` +} + +type DescribeWorkspacesRequest struct { + *tchttp.BaseRequest + + // 集群ID列表。通过该参数可以指定需要查询信息的集群列表。
    如果您不指定该参数,则返回Limit数量以内的集群信息。 + SpaceIds []*string `json:"SpaceIds,omitnil,omitempty" name:"SpaceIds"` + + // 偏移量,默认为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"` + + // 过滤列表 + Filters []*Filter `json:"Filters,omitnil,omitempty" name:"Filters"` +} + +func (r *DescribeWorkspacesRequest) 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 *DescribeWorkspacesRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "SpaceIds") + delete(f, "Offset") + delete(f, "Limit") + delete(f, "Filters") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeWorkspacesRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DescribeWorkspacesResponseParams struct { + // 集群概览信息列表 + SpaceSet []*SpaceInfo `json:"SpaceSet,omitnil,omitempty" name:"SpaceSet"` + + // 集群数量 + TotalCount *int64 `json:"TotalCount,omitnil,omitempty" name:"TotalCount"` + + // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` +} + +type DescribeWorkspacesResponse struct { + *tchttp.BaseResponse + Response *DescribeWorkspacesResponseParams `json:"Response"` +} + +func (r *DescribeWorkspacesResponse) 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 *DescribeWorkspacesResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DetachNodesRequestParams struct { + // 集群id + ClusterId *string `json:"ClusterId,omitnil,omitempty" name:"ClusterId"` + + // 集群中的节点id + NodeIds []*string `json:"NodeIds,omitnil,omitempty" name:"NodeIds"` +} + +type DetachNodesRequest struct { + *tchttp.BaseRequest + + // 集群id + ClusterId *string `json:"ClusterId,omitnil,omitempty" name:"ClusterId"` + + // 集群中的节点id + NodeIds []*string `json:"NodeIds,omitnil,omitempty" name:"NodeIds"` +} + +func (r *DetachNodesRequest) 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 *DetachNodesRequest) 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, "NodeIds") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DetachNodesRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DetachNodesResponseParams struct { + // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` +} + +type DetachNodesResponse struct { + *tchttp.BaseResponse + Response *DetachNodesResponseParams `json:"Response"` +} + +func (r *DetachNodesResponse) 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 *DetachNodesResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +type EnhancedService struct { + // 开启云安全服务。若不指定该参数,则默认开启云安全服务。 + // 注意:此字段可能返回 null,表示取不到有效值。 + SecurityService *RunSecurityServiceEnabled `json:"SecurityService,omitnil,omitempty" name:"SecurityService"` + + // 开启腾讯云可观测平台服务。若不指定该参数,则默认开启腾讯云可观测平台服务。 + // 注意:此字段可能返回 null,表示取不到有效值。 + MonitorService *RunMonitorServiceEnabled `json:"MonitorService,omitnil,omitempty" name:"MonitorService"` + + // 开启云自动化助手服务(TencentCloud Automation Tools,TAT)。若不指定该参数,默认开启云自动化助手服务。 + // 注意:此字段可能返回 null,表示取不到有效值。 + AutomationService *RunAutomationServiceEnabled `json:"AutomationService,omitnil,omitempty" name:"AutomationService"` +} + +type ExpansionNodeConfig struct { + // 扩容实例所在的位置。 + Placement *Placement `json:"Placement,omitnil,omitempty" name:"Placement"` + + // 节点[计费类型](https://cloud.tencent.com/document/product/213/2180)。
  • PREPAID:预付费,即包年包月
  • POSTPAID_BY_HOUR:按小时后付费
  • SPOTPAID:竞价付费
    默认值:POSTPAID_BY_HOUR。 + InstanceChargeType *string `json:"InstanceChargeType,omitnil,omitempty" name:"InstanceChargeType"` + + // 预付费模式,即包年包月相关参数设置。通过该参数可以指定包年包月节点的购买时长、是否设置自动续费等属性。若指定节点的付费模式为预付费则该参数必传。 + InstanceChargePrepaid *InstanceChargePrepaid `json:"InstanceChargePrepaid,omitnil,omitempty" name:"InstanceChargePrepaid"` + + // 节点机型。不同实例机型指定了不同的资源规格。 + //
  • 具体取值可通过调用接口[DescribeInstanceTypeConfigs](https://cloud.tencent.com/document/api/213/15749)来获得最新的规格表或参见[实例规格](https://cloud.tencent.com/document/product/213/11518)描述。 + InstanceType *string `json:"InstanceType,omitnil,omitempty" name:"InstanceType"` + + // 私有网络相关信息配置。 + VirtualPrivateCloud *VirtualPrivateCloud `json:"VirtualPrivateCloud,omitnil,omitempty" name:"VirtualPrivateCloud"` + + // 实例所属项目ID。该参数可以通过调用 [DescribeProject](https://cloud.tencent.com/document/api/651/78725) 的返回值中的 projectId 字段来获取。不填为默认项目。 + ProjectId *int64 `json:"ProjectId,omitnil,omitempty" name:"ProjectId"` +} + +type ExpansionNodeConfigOverview struct { + // 节点机型。 + // 注意:此字段可能返回 null,表示取不到有效值。 + InstanceType *string `json:"InstanceType,omitnil,omitempty" name:"InstanceType"` + + // 扩容实例所在的位置。 + // 注意:此字段可能返回 null,表示取不到有效值。 + Placement *Placement `json:"Placement,omitnil,omitempty" name:"Placement"` + + // 节点[计费类型](https://cloud.tencent.com/document/product/213/2180)。 + // 注意:此字段可能返回 null,表示取不到有效值。 + InstanceChargeType *string `json:"InstanceChargeType,omitnil,omitempty" name:"InstanceChargeType"` + + // 预付费模式,即包年包月相关参数设置。通过该参数可以指定包年包月节点的购买时长、是否设置自动续费等属性。若指定节点的付费模式为预付费则该参数必传。 + // 注意:此字段可能返回 null,表示取不到有效值。 + InstanceChargePrepaid *InstanceChargePrepaid `json:"InstanceChargePrepaid,omitnil,omitempty" name:"InstanceChargePrepaid"` + + // 私有网络相关信息配置。 + // 注意:此字段可能返回 null,表示取不到有效值。 + VirtualPrivateCloud *VirtualPrivateCloud `json:"VirtualPrivateCloud,omitnil,omitempty" name:"VirtualPrivateCloud"` + + // 指定有效的[镜像](https://cloud.tencent.com/document/product/213/4940)ID,格式形如`img-xxx`。 + // 注意:此字段可能返回 null,表示取不到有效值。 + ImageId *string `json:"ImageId,omitnil,omitempty" name:"ImageId"` + + // 公网带宽相关信息设置。 + // 注意:此字段可能返回 null,表示取不到有效值。 + InternetAccessible *InternetAccessible `json:"InternetAccessible,omitnil,omitempty" name:"InternetAccessible"` + + // 节点系统盘配置信息。 + // 注意:此字段可能返回 null,表示取不到有效值。 + SystemDisk *SystemDisk `json:"SystemDisk,omitnil,omitempty" name:"SystemDisk"` + + // 节点数据盘配置信息。 + // 注意:此字段可能返回 null,表示取不到有效值。 + DataDisks []*DataDisk `json:"DataDisks,omitnil,omitempty" name:"DataDisks"` +} + +type Filter struct { + // 需要过滤的字段。 + Name *string `json:"Name,omitnil,omitempty" name:"Name"` + + // 字段的过滤值。 + Values []*string `json:"Values,omitnil,omitempty" name:"Values"` +} + +type GooseFSOption struct { + // 文件系统本地挂载路径。 + LocalPath *string `json:"LocalPath,omitnil,omitempty" name:"LocalPath"` + + // 文件系统远程挂载路径。 + RemotePath *string `json:"RemotePath,omitnil,omitempty" name:"RemotePath"` + + // 文件系统master的ip和端口。 + Masters []*string `json:"Masters,omitnil,omitempty" name:"Masters"` +} + +type GooseFSOptionOverview struct { + // 文件系统本地挂载路径。 + LocalPath *string `json:"LocalPath,omitnil,omitempty" name:"LocalPath"` + + // 文件系统远程挂载路径。 + RemotePath *string `json:"RemotePath,omitnil,omitempty" name:"RemotePath"` + + // 文件系统master的ip和端口。 + Masters []*string `json:"Masters,omitnil,omitempty" name:"Masters"` +} + +type GooseFSxOption struct { + // 文件系统master的ip和端口列表。 + Masters []*string `json:"Masters,omitnil,omitempty" name:"Masters"` + + // 文件系统的本地挂载路径。GooseFSx目前只支持挂载在/goosefsx/{文件系统ID}_proxy/目录下。 + LocalPath *string `json:"LocalPath,omitnil,omitempty" name:"LocalPath"` +} + +type GooseFSxOptionOverview struct { + // 文件系统master的ip和端口列表。 + // 注意:此字段可能返回 null,表示取不到有效值。 + Masters []*string `json:"Masters,omitnil,omitempty" name:"Masters"` + + // 文件系统的本地挂载路径。GooseFSx目前只支持挂载在/goosefsx/{文件系统ID}_proxy/目录下。 + // 注意:此字段可能返回 null,表示取不到有效值。 + LocalPath *string `json:"LocalPath,omitnil,omitempty" name:"LocalPath"` +} + +type InstanceChargePrepaid struct { + // 购买实例的时长,单位:月。取值范围:1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 24, 36, 48, 60。 + // 注意:此字段可能返回 null,表示取不到有效值。 + Period *int64 `json:"Period,omitnil,omitempty" name:"Period"` + + // 自动续费标识。取值范围: + // NOTIFY_AND_AUTO_RENEW:通知过期且自动续费 + // NOTIFY_AND_MANUAL_RENEW:通知过期不自动续费 + // DISABLE_NOTIFY_AND_MANUAL_RENEW:不通知过期不自动续费 + // + // 默认取值:NOTIFY_AND_MANUAL_RENEW。若该参数指定为NOTIFY_AND_AUTO_RENEW,在账户余额充足的情况下,实例到期后将按月自动续费。 + // 注意:此字段可能返回 null,表示取不到有效值。 + RenewFlag *string `json:"RenewFlag,omitnil,omitempty" name:"RenewFlag"` +} + +type InternetAccessible struct { + // 网络计费类型。取值范围: + // BANDWIDTH_PREPAID:预付费按带宽结算 + // TRAFFIC_POSTPAID_BY_HOUR:流量按小时后付费 + // BANDWIDTH_POSTPAID_BY_HOUR:带宽按小时后付费 + // BANDWIDTH_PACKAGE:带宽包用户 + // 默认取值:非带宽包用户默认与子机付费类型保持一致。 + // 注意:此字段可能返回 null,表示取不到有效值。 + InternetChargeType *string `json:"InternetChargeType,omitnil,omitempty" name:"InternetChargeType"` + + // 公网出带宽上限,单位:Mbps。默认值:0Mbps。不同机型带宽上限范围不一致,具体限制详见购买网络带宽。 + // 注意:此字段可能返回 null,表示取不到有效值。 + InternetMaxBandwidthOut *int64 `json:"InternetMaxBandwidthOut,omitnil,omitempty" name:"InternetMaxBandwidthOut"` +} + +type LoginNode struct { + // 节点[计费类型](https://cloud.tencent.com/document/product/213/2180)。
  • PREPAID:预付费,即包年包月
  • POSTPAID_BY_HOUR:按小时后付费
  • SPOTPAID:竞价付费
    默认值:POSTPAID_BY_HOUR。 + InstanceChargeType *string `json:"InstanceChargeType,omitnil,omitempty" name:"InstanceChargeType"` + + // 预付费模式,即包年包月相关参数设置。通过该参数可以指定包年包月节点的购买时长、是否设置自动续费等属性。若指定节点的付费模式为预付费则该参数必传。 + InstanceChargePrepaid *InstanceChargePrepaid `json:"InstanceChargePrepaid,omitnil,omitempty" name:"InstanceChargePrepaid"` + + // 节点机型。不同实例机型指定了不同的资源规格。 + //
  • 具体取值可通过调用接口[DescribeInstanceTypeConfigs](https://cloud.tencent.com/document/api/213/15749)来获得最新的规格表或参见[实例规格](https://cloud.tencent.com/document/product/213/11518)描述。 + InstanceType *string `json:"InstanceType,omitnil,omitempty" name:"InstanceType"` + + // 节点系统盘配置信息。若不指定该参数,则按照系统默认值进行分配。 + SystemDisk *SystemDisk `json:"SystemDisk,omitnil,omitempty" name:"SystemDisk"` + + // 节点数据盘配置信息。若不指定该参数,则默认不购买数据盘。支持购买的时候指定21块数据盘,其中最多包含1块LOCAL_BASIC数据盘或者LOCAL_SSD数据盘,最多包含20块CLOUD_BASIC数据盘、CLOUD_PREMIUM数据盘或者CLOUD_SSD数据盘。 + DataDisks []*DataDisk `json:"DataDisks,omitnil,omitempty" name:"DataDisks"` + + // 公网带宽相关信息设置。若不指定该参数,则默认公网带宽为0Mbps。 + InternetAccessible *InternetAccessible `json:"InternetAccessible,omitnil,omitempty" name:"InternetAccessible"` + + // 节点显示名称。
  • + // 不指定节点显示名称则默认显示‘未命名’。 + // 最多支持60个字符。 + InstanceName *string `json:"InstanceName,omitnil,omitempty" name:"InstanceName"` + + // 实例所属项目ID。该参数可以通过调用 [DescribeProject](https://cloud.tencent.com/document/api/651/78725) 的返回值中的 projectId 字段来获取。不填为默认项目。 + ProjectId *int64 `json:"ProjectId,omitnil,omitempty" name:"ProjectId"` +} + +type LoginNodeOverview struct { + // 登录节点ID。 + NodeId *string `json:"NodeId,omitnil,omitempty" name:"NodeId"` +} + +type LoginSettings struct { + // 实例登录密码。不同操作系统类型密码复杂度限制不一样,具体如下:
  • Linux实例密码必须8到30位,至少包括两项[a-z],[A-Z]、[0-9] 和 [( ) \` ~ ! @ # $ % ^ & * - + = | { } [ ] : ; ' , . ? / ]中的特殊符号。

  • Windows实例密码必须12到30位,至少包括三项[a-z],[A-Z],[0-9] 和 [( ) \` ~ ! @ # $ % ^ & * - + = | { } [ ] : ; ' , . ? /]中的特殊符号。


  • 若不指定该参数,则由系统随机生成密码,并通过站内信方式通知到用户。 + Password *string `json:"Password,omitnil,omitempty" name:"Password"` + + // 实例登录密钥 + KeyIds []*string `json:"KeyIds,omitnil,omitempty" name:"KeyIds"` +} + +type ManagerNode struct { + // 节点[计费类型](https://cloud.tencent.com/document/product/213/2180)。
  • PREPAID:预付费,即包年包月
  • POSTPAID_BY_HOUR:按小时后付费
    默认值:POSTPAID_BY_HOUR。 + InstanceChargeType *string `json:"InstanceChargeType,omitnil,omitempty" name:"InstanceChargeType"` + + // 预付费模式,即包年包月相关参数设置。通过该参数可以指定包年包月节点的购买时长、是否设置自动续费等属性。若指定节点的付费模式为预付费则该参数必传。 + InstanceChargePrepaid *InstanceChargePrepaid `json:"InstanceChargePrepaid,omitnil,omitempty" name:"InstanceChargePrepaid"` + + // 节点机型。不同实例机型指定了不同的资源规格。 + //
  • 对于付费模式为PREPAID或POSTPAID\_BY\_HOUR的实例创建,具体取值可通过调用接口[DescribeInstanceTypeConfigs](https://cloud.tencent.com/document/api/213/15749)来获得最新的规格表或参见[实例规格](https://cloud.tencent.com/document/product/213/11518)描述。 + InstanceType *string `json:"InstanceType,omitnil,omitempty" name:"InstanceType"` + + // 节点系统盘配置信息。若不指定该参数,则按照系统默认值进行分配。 + SystemDisk *SystemDisk `json:"SystemDisk,omitnil,omitempty" name:"SystemDisk"` + + // 节点数据盘配置信息。若不指定该参数,则默认不购买数据盘。支持购买的时候指定21块数据盘,其中最多包含1块LOCAL_BASIC数据盘或者LOCAL_SSD数据盘,最多包含20块CLOUD_BASIC数据盘、CLOUD_PREMIUM数据盘或者CLOUD_SSD数据盘。 + DataDisks []*DataDisk `json:"DataDisks,omitnil,omitempty" name:"DataDisks"` + + // 公网带宽相关信息设置。若不指定该参数,则默认公网带宽为0Mbps。 + InternetAccessible *InternetAccessible `json:"InternetAccessible,omitnil,omitempty" name:"InternetAccessible"` + + // 节点显示名称。
  • + // 不指定节点显示名称则默认显示‘未命名’。 + //
  • 购买多个节点,如果指定模式串`{R:x}`,表示生成数字[`[x, x+n-1]`,其中`n`表示购买节点的数量,例如`server_{R:3}`,购买1个时,节点显示名称为`server_3`;购买2个时,节点显示名称分别为`server_3`,`server_4`。支持指定多个模式串`{R:x}`。 + // 购买多个节点,如果不指定模式串,则在节点显示名称添加后缀`1、2...n`,其中`n`表示购买节点的数量,例如`server_`,购买2个时,节点显示名称分别为`server_1`,`server_2`。
  • + // 最多支持60个字符(包含模式串)。 + InstanceName *string `json:"InstanceName,omitnil,omitempty" name:"InstanceName"` + + // 实例所属项目ID。该参数可以通过调用 [DescribeProject](https://cloud.tencent.com/document/api/651/78725) 的返回值中的 projectId 字段来获取。不填为默认项目。 + ProjectId *int64 `json:"ProjectId,omitnil,omitempty" name:"ProjectId"` + + // 增强服务。通过该参数可以指定是否开启云安全、腾讯云可观测平台等服务。若不指定该参数,则默认开启腾讯云可观测平台、云安全服务、自动化助手服务。 + EnhancedService *EnhancedService `json:"EnhancedService,omitnil,omitempty" name:"EnhancedService"` +} + +type ManagerNodeOverview struct { + // 管控节点ID。 + // 注意:此字段可能返回 null,表示取不到有效值。 + NodeId *string `json:"NodeId,omitnil,omitempty" name:"NodeId"` +} + +// Predefined struct for user +type ModifyInitNodeScriptsRequestParams struct { + // 集群ID。 + ClusterId *string `json:"ClusterId,omitnil,omitempty" name:"ClusterId"` + + // 节点初始化脚本信息列表。 + InitNodeScripts []*NodeScript `json:"InitNodeScripts,omitnil,omitempty" name:"InitNodeScripts"` +} + +type ModifyInitNodeScriptsRequest struct { + *tchttp.BaseRequest + + // 集群ID。 + ClusterId *string `json:"ClusterId,omitnil,omitempty" name:"ClusterId"` + + // 节点初始化脚本信息列表。 + InitNodeScripts []*NodeScript `json:"InitNodeScripts,omitnil,omitempty" name:"InitNodeScripts"` +} + +func (r *ModifyInitNodeScriptsRequest) 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 *ModifyInitNodeScriptsRequest) 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, "InitNodeScripts") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ModifyInitNodeScriptsRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type ModifyInitNodeScriptsResponseParams struct { + // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` +} + +type ModifyInitNodeScriptsResponse struct { + *tchttp.BaseResponse + Response *ModifyInitNodeScriptsResponseParams `json:"Response"` +} + +func (r *ModifyInitNodeScriptsResponse) 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 *ModifyInitNodeScriptsResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type ModifyWorkspacesAttributeRequestParams struct { + // 工作空间列表 + SpaceIds []*string `json:"SpaceIds,omitnil,omitempty" name:"SpaceIds"` + + // 修改后的工作空间名称。可任意命名,但不得超过60个字符。 + SpaceName *string `json:"SpaceName,omitnil,omitempty" name:"SpaceName"` +} + +type ModifyWorkspacesAttributeRequest struct { + *tchttp.BaseRequest + + // 工作空间列表 + SpaceIds []*string `json:"SpaceIds,omitnil,omitempty" name:"SpaceIds"` + + // 修改后的工作空间名称。可任意命名,但不得超过60个字符。 + SpaceName *string `json:"SpaceName,omitnil,omitempty" name:"SpaceName"` +} + +func (r *ModifyWorkspacesAttributeRequest) 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 *ModifyWorkspacesAttributeRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "SpaceIds") + delete(f, "SpaceName") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ModifyWorkspacesAttributeRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type ModifyWorkspacesAttributeResponseParams struct { + // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` +} + +type ModifyWorkspacesAttributeResponse struct { + *tchttp.BaseResponse + Response *ModifyWorkspacesAttributeResponseParams `json:"Response"` +} + +func (r *ModifyWorkspacesAttributeResponse) 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 *ModifyWorkspacesAttributeResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +type NodeActivity struct { + // 节点活动所在的实例ID。 + // 注意:此字段可能返回 null,表示取不到有效值。 + NodeInstanceId *string `json:"NodeInstanceId,omitnil,omitempty" name:"NodeInstanceId"` + + // 节点活动状态。取值范围:
  • RUNNING:运行中
  • SUCCESSFUL:活动成功
  • FAILED:活动失败 + NodeActivityStatus *string `json:"NodeActivityStatus,omitnil,omitempty" name:"NodeActivityStatus"` + + // 节点活动状态码。 + // 注意:此字段可能返回 null,表示取不到有效值。 + NodeActivityStatusCode *string `json:"NodeActivityStatusCode,omitnil,omitempty" name:"NodeActivityStatusCode"` + + // 节点活动状态原因。 + // 注意:此字段可能返回 null,表示取不到有效值。 + NodeActivityStatusReason *string `json:"NodeActivityStatusReason,omitnil,omitempty" name:"NodeActivityStatusReason"` +} + +type NodeOverview struct { + // 节点实例ID。 + // 注意:此字段可能返回 null,表示取不到有效值。 + InstanceId *string `json:"InstanceId,omitnil,omitempty" name:"InstanceId"` + + // 节点所在可用区信息。 + // 注意:此字段可能返回 null,表示取不到有效值。 + Zone *string `json:"Zone,omitnil,omitempty" name:"Zone"` + + // 节点状态。
  • SUBMITTED:已完成提交。
  • CREATING:创建中。
  • CREATED:完成创建。
  • INITING:初始化中。
  • INIT_FAILED:初始化失败。
  • RUNNING:运行中。
  • DELETING:销毁中。
  • + // 注意:此字段可能返回 null,表示取不到有效值。 + NodeState *string `json:"NodeState,omitnil,omitempty" name:"NodeState"` + + // 镜像ID。 + // 注意:此字段可能返回 null,表示取不到有效值。 + ImageId *string `json:"ImageId,omitnil,omitempty" name:"ImageId"` + + // 节点所属队列名称。 + // 注意:此字段可能返回 null,表示取不到有效值。 + QueueName *string `json:"QueueName,omitnil,omitempty" name:"QueueName"` + + // 节点角色。
  • Manager:管控节点。
  • Compute:计算节点。
  • Login:登录节点。
  • ManagerBackup:备用管控节点。
  • + // 注意:此字段可能返回 null,表示取不到有效值。 + NodeRole *string `json:"NodeRole,omitnil,omitempty" name:"NodeRole"` + + // 节点类型。
  • STATIC:静态节点。
  • DYNAMIC:弹性节点。
  • + // 注意:此字段可能返回 null,表示取不到有效值。 + NodeType *string `json:"NodeType,omitnil,omitempty" name:"NodeType"` + + // thpc集群节点id + // 注意:此字段可能返回 null,表示取不到有效值。 + NodeId *string `json:"NodeId,omitnil,omitempty" name:"NodeId"` +} + +type NodeScript struct { + // 节点执行脚本获取地址。 + // 目前仅支持cos地址。地址最大长度:255。 + // 注意:此字段可能返回 null,表示取不到有效值。 + ScriptPath *string `json:"ScriptPath,omitnil,omitempty" name:"ScriptPath"` + + // 脚本执行超时时间(包含拉取脚本的时间)。单位秒,默认值:30。取值范围:10~1200。 + // 注意:此字段可能返回 null,表示取不到有效值。 + Timeout *int64 `json:"Timeout,omitnil,omitempty" name:"Timeout"` +} + +type Placement struct { + // 实例所属的可用区名称。该参数可以通过调用 [DescribeZones](https://cloud.tencent.com/document/product/213/15707) 的返回值中的Zone字段来获取。 + // 注意:此字段可能返回 null,表示取不到有效值。 + Zone *string `json:"Zone,omitnil,omitempty" name:"Zone"` +} + +type QueueConfig struct { + // 队列名称。 + QueueName *string `json:"QueueName,omitnil,omitempty" name:"QueueName"` + + // 队列中弹性节点数量最小值。默认值:0。取值范围:0~200。 + MinSize *uint64 `json:"MinSize,omitnil,omitempty" name:"MinSize"` + + // 队列中弹性节点数量最大值。默认值:10。取值范围:0~200。 + MaxSize *uint64 `json:"MaxSize,omitnil,omitempty" name:"MaxSize"` + + // 是否开启自动扩容。 + EnableAutoExpansion *bool `json:"EnableAutoExpansion,omitnil,omitempty" name:"EnableAutoExpansion"` + + // 是否开启自动缩容。 + EnableAutoShrink *bool `json:"EnableAutoShrink,omitnil,omitempty" name:"EnableAutoShrink"` + + // 指定有效的[镜像](https://cloud.tencent.com/document/product/213/4940)ID,格式形如`img-xxx`。目前仅支持公有镜和特定自定义镜像。 + ImageId *string `json:"ImageId,omitnil,omitempty" name:"ImageId"` + + // 节点系统盘配置信息。若不指定该参数,则按照系统默认值进行分配。 + SystemDisk *SystemDisk `json:"SystemDisk,omitnil,omitempty" name:"SystemDisk"` + + // 节点数据盘配置信息。若不指定该参数,则默认不购买数据盘。支持购买的时候指定21块数据盘,其中最多包含1块LOCAL_BASIC数据盘或者LOCAL_SSD数据盘,最多包含20块CLOUD_BASIC数据盘、CLOUD_PREMIUM数据盘或者CLOUD_SSD数据盘。 + DataDisks []*DataDisk `json:"DataDisks,omitnil,omitempty" name:"DataDisks"` + + // 公网带宽相关信息设置。若不指定该参数,则默认公网带宽为0Mbps。 + InternetAccessible *InternetAccessible `json:"InternetAccessible,omitnil,omitempty" name:"InternetAccessible"` + + // 扩容节点配置信息。 + ExpansionNodeConfigs []*ExpansionNodeConfig `json:"ExpansionNodeConfigs,omitnil,omitempty" name:"ExpansionNodeConfigs"` + + // 队列中期望的空闲节点数量(包含弹性节点和静态节点)。默认值:0。队列中,处于空闲状态的节点小于此值,集群会扩容弹性节点;处于空闲状态的节点大于此值,集群会缩容弹性节点。 + DesiredIdleNodeCapacity *int64 `json:"DesiredIdleNodeCapacity,omitnil,omitempty" name:"DesiredIdleNodeCapacity"` + + // 扩容比例。默认值:100。取值范围:1~100。 + // 如果扩容比例为50,那么每轮只会扩容当前作业负载所需的50%数量的节点。 + ScaleOutRatio *int64 `json:"ScaleOutRatio,omitnil,omitempty" name:"ScaleOutRatio"` + + // 比例扩容阈值。默认值:0。取值范围:0~200。 + // 当作业负载需要扩容节点数量大于此值,当前扩容轮次按照ScaleOutRatio配置的比例进行扩容。当作业负载需要扩容节点数量小于此值,当前扩容轮次扩容当前作业负载所需数量的节点。 + // 此参数配合ScaleOutRatio参数进行使用,用于比例扩容场景下,在作业负载所需节点数量较小时,加快收敛速度。 + ScaleOutNodeThreshold *int64 `json:"ScaleOutNodeThreshold,omitnil,omitempty" name:"ScaleOutNodeThreshold"` + + // 每轮扩容最大节点个数。默认值:100。取值范围:1~100。 + MaxNodesPerCycle *int64 `json:"MaxNodesPerCycle,omitnil,omitempty" name:"MaxNodesPerCycle"` + + // 扩容过程中,作业的内存在匹配实例机型时增大比例(不会影响作业提交的内存大小,只影响匹配计算过程)。
    + // 针对场景:由于实例机型的总内存会大于实例内部的可用内存,16GB内存规格的实例,实例操作系统内的可用内存只有约14.9GB内存。假设此时提交一个需要15GB内存的作业, + // + // - 当ScaleUpMemRatio=0时,会匹配到16GB内存规格的实例,但是由于操作系统内的可用内存为14.9GB小于作业所需的15GB,扩容出来的实例作业无法运行起来。 + // - 当ScaleUpMemRatio=10时,匹配实例规格会按照15*(1+10%)=16.5GB来进行实例规格匹配,则不会匹配到16GB的实例,而是更大内存规格的实例来保证作业能够被运行起来。 + ScaleUpMemRatio *int64 `json:"ScaleUpMemRatio,omitnil,omitempty" name:"ScaleUpMemRatio"` + + // 增强服务。通过该参数可以指定是否开启云安全、腾讯云可观测平台等服务。若不指定该参数,则默认开启腾讯云可观测平台、云安全服务、自动化助手服务。 + EnhancedService *EnhancedService `json:"EnhancedService,omitnil,omitempty" name:"EnhancedService"` +} + +type QueueConfigOverview struct { + // 队列名称。 + QueueName *string `json:"QueueName,omitnil,omitempty" name:"QueueName"` + + // 队列中弹性节点数量最小值。取值范围0~200。 + MinSize *int64 `json:"MinSize,omitnil,omitempty" name:"MinSize"` + + // 队列中弹性节点数量最大值。取值范围0~200。 + MaxSize *int64 `json:"MaxSize,omitnil,omitempty" name:"MaxSize"` + + // 是否开启自动扩容。 + EnableAutoExpansion *bool `json:"EnableAutoExpansion,omitnil,omitempty" name:"EnableAutoExpansion"` + + // 是否开启自动缩容。 + EnableAutoShrink *bool `json:"EnableAutoShrink,omitnil,omitempty" name:"EnableAutoShrink"` + + // 扩容节点配置信息。 + ExpansionNodeConfigs []*ExpansionNodeConfigOverview `json:"ExpansionNodeConfigs,omitnil,omitempty" name:"ExpansionNodeConfigs"` + + // 队列中期望的空闲节点数量(包含弹性节点和静态节点)。默认值:0。队列中,处于空闲状态的节点小于此值,集群会扩容弹性节点;处于空闲状态的节点大于此值,集群会缩容弹性节点。 + // 注意:此字段可能返回 null,表示取不到有效值。 + DesiredIdleNodeCapacity *int64 `json:"DesiredIdleNodeCapacity,omitnil,omitempty" name:"DesiredIdleNodeCapacity"` + + // 扩容比例。默认值:100。取值范围:1~100。 + // 如果扩容比例为50,那么每轮只会扩容当前作业负载所需的50%数量的节点。 + // 注意:此字段可能返回 null,表示取不到有效值。 + ScaleOutRatio *int64 `json:"ScaleOutRatio,omitnil,omitempty" name:"ScaleOutRatio"` + + // 比例扩容阈值。默认值:0。取值范围:0~200。 + // 当作业负载需要扩容节点数量大于此值,当前扩容轮次按照ScaleOutRatio配置的的比例进行扩容。当作业负载需要扩容节点数量小于此值,当前扩容轮次扩容当前作业负载所需数量的节点。 + // 此参数配合ScaleOutRatio参数进行使用,用于比例扩容场景下,在作业负载所需节点数量较小时,加快收敛速度。 + // 注意:此字段可能返回 null,表示取不到有效值。 + ScaleOutNodeThreshold *int64 `json:"ScaleOutNodeThreshold,omitnil,omitempty" name:"ScaleOutNodeThreshold"` + + // 每轮扩容最大节点个数。 + // 注意:此字段可能返回 null,表示取不到有效值。 + MaxNodesPerCycle *int64 `json:"MaxNodesPerCycle,omitnil,omitempty" name:"MaxNodesPerCycle"` + + // 扩容过程中,作业的内存在匹配实例机型时增大比例(不会影响作业提交的内存大小,只影响匹配计算过程)。
    + // 针对场景:由于实例机型的总内存会大于实例内部的可用内存,16GB内存规格的实例,实例操作系统内的可用内存只有约14.9GB内存。假设此时提交一个需要15GB内存的作业, + // + // - 当ScaleUpMemRatio=0时,会匹配到16GB内存规格的实例,但是由于操作系统内的可用内存为14.9GB小于作业所需的15GB,扩容出来的实例作业无法运行起来。 + // - 当ScaleUpMemRatio=10时,匹配实例规格会按照15*(1+10%)=16.5GB来进行实例规格匹配,则不会匹配到16GB的实例,而是更大内存规格的实例来保证作业能够被运行起来。 + // 注意:此字段可能返回 null,表示取不到有效值。 + ScaleUpMemRatio *int64 `json:"ScaleUpMemRatio,omitnil,omitempty" name:"ScaleUpMemRatio"` +} + +type QueueOverview struct { + // 队列名称。 + // 注意:此字段可能返回 null,表示取不到有效值。 + QueueName *string `json:"QueueName,omitnil,omitempty" name:"QueueName"` +} + +type RunAutomationServiceEnabled struct { + // 是否开启云自动化助手。取值范围:
  • TRUE:表示开启云自动化助手服务
  • FALSE:表示不开启云自动化助手服务

    默认取值:TRUE。 + Enabled *bool `json:"Enabled,omitnil,omitempty" name:"Enabled"` +} + +type RunMonitorServiceEnabled struct { + // 是否开启[腾讯云可观测平台](/document/product/248)服务。取值范围:
  • TRUE:表示开启腾讯云可观测平台服务
  • FALSE:表示不开启腾讯云可观测平台服务

    默认取值:TRUE。 + // 注意:此字段可能返回 null,表示取不到有效值。 + Enabled *bool `json:"Enabled,omitnil,omitempty" name:"Enabled"` +} + +type RunSecurityServiceEnabled struct { + // 是否开启[云安全](/document/product/296)服务。取值范围:
  • TRUE:表示开启云安全服务
  • FALSE:表示不开启云安全服务

    默认取值:TRUE。 + Enabled *bool `json:"Enabled,omitnil,omitempty" name:"Enabled"` +} + +// Predefined struct for user +type SetAutoScalingConfigurationRequestParams struct { + // 集群ID。 + ClusterId *string `json:"ClusterId,omitnil,omitempty" name:"ClusterId"` + + // 任务连续等待时间,队列的任务处于连续等待的时间。单位秒。默认值120。 + ExpansionBusyTime *int64 `json:"ExpansionBusyTime,omitnil,omitempty" name:"ExpansionBusyTime"` + + // 节点连续空闲(未运行作业)时间,一个节点连续处于空闲状态时间。单位秒。默认值300。 + ShrinkIdleTime *int64 `json:"ShrinkIdleTime,omitnil,omitempty" name:"ShrinkIdleTime"` + + // 扩容队列配置列表。 + QueueConfigs []*QueueConfig `json:"QueueConfigs,omitnil,omitempty" name:"QueueConfigs"` + + // 是否只预检此次请求。 + // true:发送检查请求,不会绑定弹性伸缩组。检查项包括是否填写了必需参数,请求格式,业务限制。 + // 如果检查不通过,则返回对应错误码; + // 如果检查通过,则返回RequestId。 + // false(默认):发送正常请求,通过检查后直接绑定弹性伸缩组。 + DryRun *bool `json:"DryRun,omitnil,omitempty" name:"DryRun"` +} + +type SetAutoScalingConfigurationRequest struct { + *tchttp.BaseRequest + + // 集群ID。 + ClusterId *string `json:"ClusterId,omitnil,omitempty" name:"ClusterId"` + + // 任务连续等待时间,队列的任务处于连续等待的时间。单位秒。默认值120。 + ExpansionBusyTime *int64 `json:"ExpansionBusyTime,omitnil,omitempty" name:"ExpansionBusyTime"` + + // 节点连续空闲(未运行作业)时间,一个节点连续处于空闲状态时间。单位秒。默认值300。 + ShrinkIdleTime *int64 `json:"ShrinkIdleTime,omitnil,omitempty" name:"ShrinkIdleTime"` + + // 扩容队列配置列表。 + QueueConfigs []*QueueConfig `json:"QueueConfigs,omitnil,omitempty" name:"QueueConfigs"` + + // 是否只预检此次请求。 + // true:发送检查请求,不会绑定弹性伸缩组。检查项包括是否填写了必需参数,请求格式,业务限制。 + // 如果检查不通过,则返回对应错误码; + // 如果检查通过,则返回RequestId。 + // false(默认):发送正常请求,通过检查后直接绑定弹性伸缩组。 + DryRun *bool `json:"DryRun,omitnil,omitempty" name:"DryRun"` +} + +func (r *SetAutoScalingConfigurationRequest) 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 *SetAutoScalingConfigurationRequest) 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, "ExpansionBusyTime") + delete(f, "ShrinkIdleTime") + delete(f, "QueueConfigs") + delete(f, "DryRun") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "SetAutoScalingConfigurationRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type SetAutoScalingConfigurationResponseParams struct { + // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` +} + +type SetAutoScalingConfigurationResponse struct { + *tchttp.BaseResponse + Response *SetAutoScalingConfigurationResponseParams `json:"Response"` +} + +func (r *SetAutoScalingConfigurationResponse) 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 *SetAutoScalingConfigurationResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +type SpaceChargePrepaid struct { + // 购买实例的时长,单位:月。取值范围:1, 2, 3, 12, 24, 36。默认取值为1。 + // 注意:此字段可能返回 null,表示取不到有效值。 + Period *int64 `json:"Period,omitnil,omitempty" name:"Period"` + + // 自动续费标识。取值范围: + // + // NOTIFY_AND_AUTO_RENEW:通知过期且自动续费 + // + // NOTIFY_AND_MANUAL_RENEW:通知过期不自动续费 + // + // DISABLE_NOTIFY_AND_MANUAL_RENEW:不通知过期不自动续费 + // + // + // 默认取值:NOTIFY_AND_MANUAL_RENEW。若该参数指定为NOTIFY_AND_AUTO_RENEW,在账户余额充足的情况下,实例到期后将按月自动续费。 + // 注意:此字段可能返回 null,表示取不到有效值。 + RenewFlag *string `json:"RenewFlag,omitnil,omitempty" name:"RenewFlag"` +} + +type SpaceDataDisk struct { + // 数据盘类型。数据盘类型限制详见[存储概述](https://cloud.tencent.com/document/product/213/4952)。取值范围:
    + //
  • + // LOCAL_BASIC:本地硬盘
    + //
  • + // LOCAL_SSD:本地SSD硬盘
    + //
  • + // LOCAL_NVME:本地NVME硬盘,与InstanceType强相关,不支持指定
    + //
  • + // LOCAL_PRO:本地HDD硬盘,与InstanceType强相关,不支持指定
    + //
  • + // CLOUD_BASIC:普通云硬盘
    + //
  • + // CLOUD_PREMIUM:高性能云硬盘
    + //
  • + // CLOUD_SSD:SSD云硬盘
    + //
  • + // CLOUD_HSSD:增强型SSD云硬盘
    + //
  • + // CLOUD_TSSD:极速型SSD云硬盘
    + //
  • + // CLOUD_BSSD:通用型SSD云硬盘

    默认取值:LOCAL_BASIC。

    该参数对`ResizeInstanceDisk`接口无效。 + //
  • + // + // + // + // + // + // + // + // + // + DiskType *string `json:"DiskType,omitnil,omitempty" name:"DiskType"` + + // 数据盘 + // 注意:此字段可能返回 null,表示取不到有效值。 + DiskId *string `json:"DiskId,omitnil,omitempty" name:"DiskId"` + + // 数据盘大小,单位:GB。最小调整步长为10G,不同数据盘类型取值范围不同,具体限制详见:[存储概述](https://cloud.tencent.com/document/product/213/4952)。默认值为0,表示不购买数据盘。更多限制详见产品文档。 + DiskSize *int64 `json:"DiskSize,omitnil,omitempty" name:"DiskSize"` + + // 数据盘是否随子机销毁。取值范围: + //
  • TRUE:子机销毁时,销毁数据盘,只支持按小时后付费云盘
  • + //
  • + // FALSE:子机销毁时,保留数据盘
    + // 默认取值:TRUE
    + // 该参数目前仅用于 `RunInstances` 接口。 + //
  • + // 注意:此字段可能返回 null,表示取不到有效值。 + DeleteWithInstance *bool `json:"DeleteWithInstance,omitnil,omitempty" name:"DeleteWithInstance"` + + // 数据盘快照ID。选择的数据盘快照大小需小于数据盘大小。 + // 注意:此字段可能返回 null,表示取不到有效值。 + SnapshotId *string `json:"SnapshotId,omitnil,omitempty" name:"SnapshotId"` + + // 数据盘是加密。取值范围: + //
  • true:加密
  • + //
  • + // false:不加密
    + // 默认取值:false
    + // 该参数目前仅用于 `RunInstances` 接口。 + //
  • + // 注意:此字段可能返回 null,表示取不到有效值。 + Encrypt *bool `json:"Encrypt,omitnil,omitempty" name:"Encrypt"` + + // 自定义CMK对应的ID,取值为UUID或者类似kms-abcd1234。用于加密云盘。 + // + // 该参数目前仅用于 `CreateWorkspaces` 接口。 + // 注意:此字段可能返回 null,表示取不到有效值。 + KmsKeyId *string `json:"KmsKeyId,omitnil,omitempty" name:"KmsKeyId"` + + // 云硬盘性能,单位:MB/s + // 注意:此字段可能返回 null,表示取不到有效值。 + ThroughputPerformance *int64 `json:"ThroughputPerformance,omitnil,omitempty" name:"ThroughputPerformance"` + + // 突发性能 + // + // 注:内测中。 + // 注意:此字段可能返回 null,表示取不到有效值。 + BurstPerformance *bool `json:"BurstPerformance,omitnil,omitempty" name:"BurstPerformance"` +} + +type SpaceInfo struct { + // 工作空间ID + SpaceId *string `json:"SpaceId,omitnil,omitempty" name:"SpaceId"` + + // 工作空间类型 + SpaceFamily *string `json:"SpaceFamily,omitnil,omitempty" name:"SpaceFamily"` + + // 工作空间规格 + SpaceType *string `json:"SpaceType,omitnil,omitempty" name:"SpaceType"` + + // 工作空间名称 + SpaceName *string `json:"SpaceName,omitnil,omitempty" name:"SpaceName"` + + // 工作空间状态。取值范围:
  • PENDING:表示创建中
  • LAUNCH_FAILED:表示创建失败
  • ONLINE:表示运行中
  • ARREARS:表示隔离中
  • TERMINATING:表示销毁中。
  • + SpaceState *string `json:"SpaceState,omitnil,omitempty" name:"SpaceState"` + + // 工作空间计费模式 + SpaceChargeType *string `json:"SpaceChargeType,omitnil,omitempty" name:"SpaceChargeType"` + + // 工作空间对应资源ID + ResourceId *string `json:"ResourceId,omitnil,omitempty" name:"ResourceId"` + + // 自动续费标识 + RenewFlag *string `json:"RenewFlag,omitnil,omitempty" name:"RenewFlag"` + + // 工作空间关联的工作列表 + Tags []*Tag `json:"Tags,omitnil,omitempty" name:"Tags"` + + // 创建时间 + CreatedTime *string `json:"CreatedTime,omitnil,omitempty" name:"CreatedTime"` + + // 到期时间 + ExpiredTime *string `json:"ExpiredTime,omitnil,omitempty" name:"ExpiredTime"` + + // 工作空间所在位置 + Placement *Placement `json:"Placement,omitnil,omitempty" name:"Placement"` + + // 工作空间的最新操作 + // 注意:此字段可能返回 null,表示取不到有效值。 + LatestOperation *string `json:"LatestOperation,omitnil,omitempty" name:"LatestOperation"` + + // 工作空间的最新操作状态 + // 注意:此字段可能返回 null,表示取不到有效值。 + LatestOperationState *string `json:"LatestOperationState,omitnil,omitempty" name:"LatestOperationState"` +} + +type SpaceInternetAccessible struct { + // 网络计费类型 + // 注意:此字段可能返回 null,表示取不到有效值。 + InternetChargeType *string `json:"InternetChargeType,omitnil,omitempty" name:"InternetChargeType"` + + // 公网出带宽上限,默认为0 + // 注意:此字段可能返回 null,表示取不到有效值。 + InternetMaxBandwidthOut *int64 `json:"InternetMaxBandwidthOut,omitnil,omitempty" name:"InternetMaxBandwidthOut"` + + // 是否分配公网IP + // 注意:此字段可能返回 null,表示取不到有效值。 + PublicIpAssigned *bool `json:"PublicIpAssigned,omitnil,omitempty" name:"PublicIpAssigned"` + + // 带宽包ID + // 注意:此字段可能返回 null,表示取不到有效值。 + BandwidthPackageId *string `json:"BandwidthPackageId,omitnil,omitempty" name:"BandwidthPackageId"` +} + +type SpacePlacement struct { + // 可用区 + // 注意:此字段可能返回 null,表示取不到有效值。 + Zone *string `json:"Zone,omitnil,omitempty" name:"Zone"` + + // 项目,默认是0 + // 注意:此字段可能返回 null,表示取不到有效值。 + ProjectId *uint64 `json:"ProjectId,omitnil,omitempty" name:"ProjectId"` +} + +type SpaceSystemDisk struct { + // 系统盘类型。系统盘类型限制详见[存储概述](https://cloud.tencent.com/document/product/213/4952)。取值范围:默认取值:当前有库存的硬盘类型。 + // 注意:此字段可能返回 null,表示取不到有效值。 + DiskType *string `json:"DiskType,omitnil,omitempty" name:"DiskType"` + + // 系统盘大小,单位:GB。默认值为 50 + // 注意:此字段可能返回 null,表示取不到有效值。 + DiskSize *int64 `json:"DiskSize,omitnil,omitempty" name:"DiskSize"` +} + +type SpaceVirtualPrivateCloud struct { + // 私有网络ID + VpcId *string `json:"VpcId,omitnil,omitempty" name:"VpcId"` + + // 私有网络子网ID + SubnetId *string `json:"SubnetId,omitnil,omitempty" name:"SubnetId"` + + // 是否用作公网网关 + AsVpcGateway *bool `json:"AsVpcGateway,omitnil,omitempty" name:"AsVpcGateway"` + + // 私有网络子网 IP 数组 + PrivateIpAddresses []*string `json:"PrivateIpAddresses,omitnil,omitempty" name:"PrivateIpAddresses"` + + // 为弹性网卡指定随机生成 + Ipv6AddressCount *uint64 `json:"Ipv6AddressCount,omitnil,omitempty" name:"Ipv6AddressCount"` +} + +type StorageOption struct { + // 集群挂载CFS文件系统选项。 + CFSOptions []*CFSOption `json:"CFSOptions,omitnil,omitempty" name:"CFSOptions"` + + // 集群挂载GooseFS文件系统选项。 + GooseFSOptions []*GooseFSOption `json:"GooseFSOptions,omitnil,omitempty" name:"GooseFSOptions"` + + // 集群挂载GooseFSx文件系统选项。 + GooseFSxOptions []*GooseFSxOption `json:"GooseFSxOptions,omitnil,omitempty" name:"GooseFSxOptions"` +} + +type StorageOptionOverview struct { + // CFS存储选项概览信息列表。 + CFSOptions []*CFSOptionOverview `json:"CFSOptions,omitnil,omitempty" name:"CFSOptions"` + + // GooseFS存储选项概览信息列表。 + GooseFSOptions []*GooseFSOptionOverview `json:"GooseFSOptions,omitnil,omitempty" name:"GooseFSOptions"` + + // GooseFSx存储选项概览信息列表。 + GooseFSxOptions []*GooseFSxOptionOverview `json:"GooseFSxOptions,omitnil,omitempty" name:"GooseFSxOptions"` +} + +type SystemDisk struct { + // 系统盘类型。系统盘类型限制详见存储概述。取值范围: + // CLOUD_BASIC:普通云硬盘 + // CLOUD_SSD:SSD云硬盘 + // CLOUD_PREMIUM:高性能云硬盘 + // + // 默认取值:当前有库存的硬盘类型。 + // 注意:此字段可能返回 null,表示取不到有效值。 + DiskType *string `json:"DiskType,omitnil,omitempty" name:"DiskType"` + + // 系统盘大小,单位:GB。默认值为 50 + // 注意:此字段可能返回 null,表示取不到有效值。 + DiskSize *int64 `json:"DiskSize,omitnil,omitempty" name:"DiskSize"` +} + +type Tag struct { + // 标签键 + Key *string `json:"Key,omitnil,omitempty" name:"Key"` + + // 标签值 + Value *string `json:"Value,omitnil,omitempty" name:"Value"` +} + +type TagSpecification struct { + // 标签绑定的资源类型 + // 注意:此字段可能返回 null,表示取不到有效值。 + ResourceType *string `json:"ResourceType,omitnil,omitempty" name:"ResourceType"` + + // 标签对列表 + // 注意:此字段可能返回 null,表示取不到有效值。 + Tags []*Tag `json:"Tags,omitnil,omitempty" name:"Tags"` +} + +// Predefined struct for user +type TerminateWorkspacesRequestParams struct { + // 工作空间ID + SpaceIds []*string `json:"SpaceIds,omitnil,omitempty" name:"SpaceIds"` + + // 释放空间挂载的包年包月数据盘。true表示销毁空间同时释放包年包月数据盘,false表示只销毁空间。 + ReleasePrepaidDataDisks *bool `json:"ReleasePrepaidDataDisks,omitnil,omitempty" name:"ReleasePrepaidDataDisks"` +} + +type TerminateWorkspacesRequest struct { + *tchttp.BaseRequest + + // 工作空间ID + SpaceIds []*string `json:"SpaceIds,omitnil,omitempty" name:"SpaceIds"` + + // 释放空间挂载的包年包月数据盘。true表示销毁空间同时释放包年包月数据盘,false表示只销毁空间。 + ReleasePrepaidDataDisks *bool `json:"ReleasePrepaidDataDisks,omitnil,omitempty" name:"ReleasePrepaidDataDisks"` +} + +func (r *TerminateWorkspacesRequest) 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 *TerminateWorkspacesRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "SpaceIds") + delete(f, "ReleasePrepaidDataDisks") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "TerminateWorkspacesRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type TerminateWorkspacesResponseParams struct { + // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` +} + +type TerminateWorkspacesResponse struct { + *tchttp.BaseResponse + Response *TerminateWorkspacesResponseParams `json:"Response"` +} + +func (r *TerminateWorkspacesResponse) 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 *TerminateWorkspacesResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +type VirtualPrivateCloud struct { + // 私有网络ID,形如`vpc-xxx`。有效的VpcId可通过登录[控制台](https://console.cloud.tencent.com/vpc/vpc?rid=1)查询;也可以调用接口 [DescribeVpcEx](/document/api/215/1372) ,从接口返回中的`unVpcId`字段获取。若在创建子机时VpcId与SubnetId同时传入`DEFAULT`,则强制使用默认vpc网络。 + // 注意:此字段可能返回 null,表示取不到有效值。 + VpcId *string `json:"VpcId,omitnil,omitempty" name:"VpcId"` + + // 私有网络子网ID,形如`subnet-xxx`。有效的私有网络子网ID可通过登录[控制台](https://console.cloud.tencent.com/vpc/subnet?rid=1)查询;也可以调用接口 [DescribeSubnets](/document/api/215/15784) ,从接口返回中的`unSubnetId`字段获取。若在创建子机时SubnetId与VpcId同时传入`DEFAULT`,则强制使用默认vpc网络。 + // 注意:此字段可能返回 null,表示取不到有效值。 + SubnetId *string `json:"SubnetId,omitnil,omitempty" name:"SubnetId"` +} \ No newline at end of file diff --git a/vendor/modules.txt b/vendor/modules.txt index f8731f809a..9d62f20e71 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -1318,6 +1318,9 @@ github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/tem/v20210701 # github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/teo v1.0.912 ## explicit; go 1.14 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/teo/v20220901 +# github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/thpc v1.0.998 +## explicit; go 1.14 +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/thpc/v20230321 # github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/tke v1.0.921 ## explicit; go 1.14 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/tke/v20180525 diff --git a/website/docs/r/thpc_workspaces.html.markdown b/website/docs/r/thpc_workspaces.html.markdown new file mode 100644 index 0000000000..bd57186ead --- /dev/null +++ b/website/docs/r/thpc_workspaces.html.markdown @@ -0,0 +1,331 @@ +--- +subcategory: "THPC" +layout: "tencentcloud" +page_title: "TencentCloud: tencentcloud_thpc_workspaces" +sidebar_current: "docs-tencentcloud-resource-thpc_workspaces" +description: |- + Provides a resource to create a THPC workspaces +--- + +# tencentcloud_thpc_workspaces + +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 + } + } +} +``` + +## Argument Reference + +The following arguments are supported: + +* `cam_role_name` - (Optional, String) CAM role name authorized to access. +* `client_token` - (Optional, String) 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. +* `data_disks` - (Optional, List) Workspace data disk information. +* `disaster_recover_group_id` - (Optional, String) Placement Group ID. +* `enhanced_service` - (Optional, List) Enhanced Services. +* `host_name` - (Optional, String) 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. +* `hpc_cluster_id` - (Optional, String) Hyper Computing Cluster ID. +* `image_id` - (Optional, String) Image ID. +* `internet_accessible` - (Optional, List) Public network bandwidth settings. +* `login_settings` - (Optional, List) Workspace Login Settings. +* `placement` - (Optional, List) 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. +* `security_group_ids` - (Optional, Set: [`String`]) Workspace Security Group. +* `space_charge_prepaid` - (Optional, List) 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. +* `space_charge_type` - (Optional, String) Workspace billing type. +* `space_name` - (Optional, String) Workspace Display Name. +* `space_type` - (Optional, String) Workspace specifications. +* `system_disk` - (Optional, List) Workspace system disk information. +* `tag_specification` - (Optional, List) Tag Description List. +* `user_data` - (Optional, String) User Data for Workspace. +* `virtual_private_cloud` - (Optional, List) VPC related information. + +The `automation_service` object of `enhanced_service` supports the following: + +* `enabled` - (Optional, Bool) Whether to enable. + +The `data_disks` object supports the following: + +* `burst_performance` - (Optional, Bool) Sudden performance. PS: During testing. +* `delete_with_instance` - (Optional, Bool) 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. +* `disk_id` - (Optional, String) 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` - (Optional, Int) Size of the data disk, and unit is GB. +* `disk_type` - (Optional, String) 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. +* `encrypt` - (Optional, Bool) Decides whether the disk is encrypted. Default is `false`. +* `kms_key_id` - (Optional, String) Kms key ID. +* `snapshot_id` - (Optional, String) Snapshot ID of the data disk. The selected data disk snapshot size must be smaller than the data disk size. +* `throughput_performance` - (Optional, Int) Add extra performance to the data disk. Only works when disk type is `CLOUD_TSSD` or `CLOUD_HSSD`. + +The `enhanced_service` object supports the following: + +* `automation_service` - (Optional, List) Enable the TencentCloud Automation Tools (TAT) service. If this parameter is not specified, the cloud automation tools service will be enabled by default. +* `monitor_service` - (Optional, List) Activate Tencent Cloud Observable Platform service. If this parameter is not specified, the Tencent Cloud Observable Platform service will be enabled by default. +* `security_service` - (Optional, List) Activate cloud security services. If this parameter is not specified, cloud security services will be enabled by default. + +The `internet_accessible` object supports the following: + +* `bandwidth_package_id` - (Optional, String) Bandwidth package id. if user is standard user, then the bandwidth_package_id is needed, or default has bandwidth_package_id. +* `internet_charge_type` - (Optional, String) 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` - (Optional, Int) 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` - (Optional, Bool) Associate a public IP address with an instance in a VPC or Classic. Boolean value, Default is false. + +The `login_settings` object supports the following: + +* `key_ids` - (Optional, Set) The key pair to use for the instance, it looks like `skey-16jig7tx`. Modifying will cause the instance reset. +* `password` - (Optional, String) 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. + +The `monitor_service` object of `enhanced_service` supports the following: + +* `enabled` - (Optional, Bool) Whether to enable. + +The `placement` object supports the following: + +* `zone` - (Required, String) The available zone for the CVM instance. +* `project_id` - (Optional, Int) The project the instance belongs to, default to 0. + +The `security_service` object of `enhanced_service` supports the following: + +* `enabled` - (Optional, Bool) Whether to enable. + +The `space_charge_prepaid` object supports the following: + +* `period` - (Optional, Int) 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` - (Optional, String) 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`. + +The `system_disk` object supports the following: + +* `disk_size` - (Optional, Int) Size of the system disk. unit is GB, Default is 50GB. +* `disk_type` - (Optional, String) 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. + +The `tag_specification` object supports the following: + +* `tags` - (Required, List) tags. + +The `tags` object of `tag_specification` supports the following: + +* `key` - (Required, String) Tag key. +* `value` - (Required, String) Tag value. + +The `virtual_private_cloud` object supports the following: + +* `subnet_id` - (Required, String) The ID of a VPC subnet. If you want to create instances in a VPC network, this parameter must be set. +* `vpc_id` - (Required, String) The ID of a VPC network. If you want to create instances in a VPC network, this parameter must be set. +* `as_vpc_gateway` - (Optional, Bool) Is it used as a public network gateway. +* `ipv6_address_count` - (Optional, Int) IPV6 address count. +* `private_ip_addresses` - (Optional, Set) Array of private ip address. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `id` - ID of the resource. +* `resource_id` - CVM instance ID. + + +## Import + +thpc workspaces can be imported using the id, e.g. + +``` +terraform import tencentcloud_thpc_workspaces.example wks-gwg3ygz1 +``` + diff --git a/website/tencentcloud.erb b/website/tencentcloud.erb index b7e22d18d9..e55c5c46a0 100644 --- a/website/tencentcloud.erb +++ b/website/tencentcloud.erb @@ -4311,6 +4311,20 @@ +
  • + THPC + +
  • Tag