diff --git a/go.mod b/go.mod index bf5fb78b68..a4b59ece6c 100644 --- a/go.mod +++ b/go.mod @@ -55,7 +55,7 @@ require ( github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/tcaplusdb v1.0.199 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/tcr v1.0.267 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/tdmq v1.0.268 - github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/tke v1.0.381 + github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/tke v1.0.401 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/vod v1.0.199 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/vpc v1.0.398 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/wss v1.0.199 diff --git a/go.sum b/go.sum index 7dcde221ae..58ac0eae0a 100644 --- a/go.sum +++ b/go.sum @@ -464,10 +464,6 @@ github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cdn v1.0.199 h1:ji9wSYF github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cdn v1.0.199/go.mod h1:gJDjRbA4JhsRGKkNzqwx053/vqgNMhf42ID2a7lcE0g= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cfs v1.0.199 h1:VyOKZOlgTXW0szboWhI1N35khPsaHE4CyH9pf42o7P8= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cfs v1.0.199/go.mod h1:9ldm0D1ToaztnlD2bFC5yjMMqvQfVeAMhvcoCCVnZb8= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/ckafka v1.0.376 h1:q7TNQ/5zalD483Z6ufGtxeZIEgO0eUN+5M9y1qxg/ck= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/ckafka v1.0.376/go.mod h1:YVajJ5YZ8YIFtecbXknudDPXLfG1oRwrL6GxZel5rY8= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/ckafka v1.0.399 h1:GWa+5s6tbgf5B1AakoirllClfdOmUUSZpb/qso7YiuE= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/ckafka v1.0.399/go.mod h1:IvRRjtjGHNzOeH+r0CuyTKeZRZhwqqFzPw6jgAMK9NM= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/ckafka v1.0.403 h1:rD9H4dQkULnRpq1BiD2KuDKsd9VEKHun2gMT+V6DNOE= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/ckafka v1.0.403/go.mod h1:yWwwGj2gV0hRPfM9GXG4EgDee0cEWYcAwl/M8CTTvzM= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/clb v1.0.283 h1:8pML0UtXgui5WZFLLrCv6QdR8e0fUva0V4W5wSgTCSc= @@ -480,21 +476,14 @@ github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.194/go.mod github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.358/go.mod h1:7sCQWVkxcsR38nffDW057DRGk8mUjK1Ing/EFOK8s8Y= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.359/go.mod h1:7sCQWVkxcsR38nffDW057DRGk8mUjK1Ing/EFOK8s8Y= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.363/go.mod h1:7sCQWVkxcsR38nffDW057DRGk8mUjK1Ing/EFOK8s8Y= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.376/go.mod h1:7sCQWVkxcsR38nffDW057DRGk8mUjK1Ing/EFOK8s8Y= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.377/go.mod h1:7sCQWVkxcsR38nffDW057DRGk8mUjK1Ing/EFOK8s8Y= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.381/go.mod h1:7sCQWVkxcsR38nffDW057DRGk8mUjK1Ing/EFOK8s8Y= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.383/go.mod h1:7sCQWVkxcsR38nffDW057DRGk8mUjK1Ing/EFOK8s8Y= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.385/go.mod h1:7sCQWVkxcsR38nffDW057DRGk8mUjK1Ing/EFOK8s8Y= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.389/go.mod h1:7sCQWVkxcsR38nffDW057DRGk8mUjK1Ing/EFOK8s8Y= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.391/go.mod h1:7sCQWVkxcsR38nffDW057DRGk8mUjK1Ing/EFOK8s8Y= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.392 h1:UqcmPErxEm77NwqaRq6J1i2rcbhXcZHzq7WOuc9clAQ= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.392/go.mod h1:7sCQWVkxcsR38nffDW057DRGk8mUjK1Ing/EFOK8s8Y= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.397 h1:oYU+ghWYDEXSpU8aogzPYHiuZAI1291BMroSG0WKdAc= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.397/go.mod h1:7sCQWVkxcsR38nffDW057DRGk8mUjK1Ing/EFOK8s8Y= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.398 h1:+VbaPRPCKAplIvwj9oGEOTbZmYiEX9AeqaTCPqLzwS8= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.398/go.mod h1:7sCQWVkxcsR38nffDW057DRGk8mUjK1Ing/EFOK8s8Y= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.399 h1:iTkEybEo9axJoE7FXnAS1jP6qGdgLi1FMFBNxPk+99k= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.399/go.mod h1:7sCQWVkxcsR38nffDW057DRGk8mUjK1Ing/EFOK8s8Y= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.401/go.mod h1:7sCQWVkxcsR38nffDW057DRGk8mUjK1Ing/EFOK8s8Y= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.403 h1:61iPtR+lIVT8BtAaviUx0t5InIHcJ/N51xQdezu2r1s= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.403/go.mod h1:7sCQWVkxcsR38nffDW057DRGk8mUjK1Ing/EFOK8s8Y= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cvm v1.0.385 h1:8bwloRxRwSADSK48KxaUeO9JHmmgniNGJbA7Or/HUEk= @@ -511,8 +500,6 @@ github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/emr v1.0.287 h1:+9COBXA github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/emr v1.0.287/go.mod h1:xRvd0xsyCoviCiMRfJMh5lODPnLx+bnTfENNx6GHzFA= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/es v1.0.383 h1:OhKvreaRPhwBEButv45yBcu6BvfvR1JAEXbU/NTck94= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/es v1.0.383/go.mod h1:WLskTV0GsorWBboZsLUWrgj+f1xGOKGzPGCK9275tdU= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/gaap v1.0.199 h1:tmjUPp0VBKuzjTqt0IQ5PT6iYt0yLmvM2DUzMFF7SGk= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/gaap v1.0.199/go.mod h1:tuPVv7O2B2fIpoDsrV/kvC62FO4CE4FihUxZY0JX2ek= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/gaap v1.0.397 h1:i0GyUqV/dAJkvEO1foUBB4GG/KrwbseORspjLNdTcfo= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/gaap v1.0.397/go.mod h1:5XosT/WYkH2v6Q6L34hjJIeQXOymyoBWYcvlmxupjFo= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/kms v1.0.194/go.mod h1:yrBKWhChnDqNz1xuXdSbWXG56XawEq0G5j1lg4VwBD4= @@ -546,12 +533,10 @@ github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/tcr v1.0.267 h1:Aqnh1ed github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/tcr v1.0.267/go.mod h1:SEUO10oGtg+4AGCfpJDn9ynf47P+ZiyvhzOyXLt0mOY= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/tdmq v1.0.268 h1:ez5lvKQVWGQV90BV3m9SeFODaoDbrtkMzw2S0DRMncA= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/tdmq v1.0.268/go.mod h1:fchXZhmqaYaG2c4wTCBTdnW6TFAtxl3D/P/yuuuLMfA= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/tke v1.0.381 h1:hi3fczplLOukXZZIhPA3ouoPk0bWe3Bx06X6t0zuoCk= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/tke v1.0.381/go.mod h1:Y8HK7RDWAdM4QvYsKyoqmn1qL8mEGNaDPJMkZP2TolM= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/tke v1.0.401 h1:L54Iof1fzxnuWyfvqA6BzUS4se7dO2Brv7uVSOQw/uw= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/tke v1.0.401/go.mod h1:VferweibNGBu3H6R7v2V3+6L0rZTTi/Xwjhn/nMMylw= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/vod v1.0.199 h1:6Yt74l4pA5QtzhwMNIEUt0spXdSBKH744DDqTHJOCP0= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/vod v1.0.199/go.mod h1:Yw6OQ33z3s4k0HVYTNSffB12qOzEJ2Zf1Vj4+5S3sRs= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/vpc v1.0.392 h1:nx8MQ8yJ3srpfEAlKLQKtOsBCBc30QJ3Q0RsSOGSphQ= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/vpc v1.0.392/go.mod h1:IAl660UAxdUtp1rHUwbUwxFCVqwk61xAIRbBk6QtTy8= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/vpc v1.0.398 h1:1JVKMl+yjZbntwAW0A6esjQI1/dXXqjQ9+OLai7ZS2w= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/vpc v1.0.398/go.mod h1:+TD/TRnb5WrLcE2SL3db7ROOpwED5gBfbC19gaXnGxs= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/wss v1.0.199 h1:hMBLtiJPnZ9GvA677cTB6ELBR6B68wCR2QY1sNoGQc4= diff --git a/tencentcloud/basic_test.go b/tencentcloud/basic_test.go index ed7e41f2b0..ba13d047a0 100644 --- a/tencentcloud/basic_test.go +++ b/tencentcloud/basic_test.go @@ -617,9 +617,11 @@ data "tencentcloud_instance_types" "ins_type" { availability_zone = "` + defaultCvmAZone + `" cpu_core_count = 1 memory_size = 2 + exclude_sold_out = true } locals { + ins_az = "` + defaultCvmAZone + `" type1 = [for i in data.tencentcloud_instance_types.ins_type.instance_types: i if lookup(i, "instance_charge_type") == "POSTPAID_BY_HOUR"][0].instance_type type2 = [for i in data.tencentcloud_instance_types.ins_type.instance_types: i if lookup(i, "instance_charge_type") == "POSTPAID_BY_HOUR"][1].instance_type } diff --git a/tencentcloud/resource_tc_kubernetes_as_scaling_group.go b/tencentcloud/resource_tc_kubernetes_as_scaling_group.go index 3750a09143..58b9627f8f 100644 --- a/tencentcloud/resource_tc_kubernetes_as_scaling_group.go +++ b/tencentcloud/resource_tc_kubernetes_as_scaling_group.go @@ -1,42 +1,32 @@ /* -Provide a resource to create an auto scaling group for kubernetes cluster. +Auto scaling group for kubernetes cluster (offlined). -~> **NOTE:** It has been deprecated and replaced by `tencentcloud_cluster_node_pool`. -~> **NOTE:** To use the custom Kubernetes component startup parameter function (parameter `extra_args`), you need to submit a ticket for application. +~> **NOTE:** This resource was offline no longer suppored. Example Usage ```hcl - -resource "tencentcloud_kubernetes_as_scaling_group" "test" { - - cluster_id = "cls-kb32pbv4" - - auto_scaling_group { - scaling_group_name = "tf-guagua-as-group" - max_size = "5" - min_size = "0" - vpc_id = "vpc-dk8zmwuf" - subnet_ids = ["subnet-pqfek0t8"] - project_id = 0 - default_cooldown = 400 - desired_capacity = "0" - termination_policies = ["NEWEST_INSTANCE"] - retry_policy = "INCREMENTAL_INTERVALS" - - tags = { - "test" = "test" - } - - } - +# Use tencentcloud_kubernetes_node_pool instead +resource "tencentcloud_kubernetes_node_pool" "mynodepool" { + name = "mynodepool" + cluster_id = "cls-xxxxxxxx" + max_size = 6 + min_size = 1 + vpc_id = "vpc-xxxxxxxx" + subnet_ids = ["subnet-xxxxxxxx"] + retry_policy = "INCREMENTAL_INTERVALS" + desired_capacity = 4 + enable_auto_scale = true + multi_zone_subnet_policy = "EQUALITY" auto_scaling_config { - configuration_name = "tf-guagua-as-config" - instance_type = "S1.SMALL1" - project_id = 0 + instance_type = var.default_instance_type system_disk_type = "CLOUD_PREMIUM" system_disk_size = "50" + security_group_ids = ["sg-24vswocp"] + instance_charge_type = "SPOTPAID" + spot_instance_type = "one-time" + spot_max_price = "1000" data_disk { disk_type = "CLOUD_PREMIUM" @@ -46,85 +36,17 @@ resource "tencentcloud_kubernetes_as_scaling_group" "test" { internet_charge_type = "TRAFFIC_POSTPAID_BY_HOUR" internet_max_bandwidth_out = 10 public_ip_assigned = true - password = "test123#" + password = input_your_password enhanced_security_service = false enhanced_monitor_service = false - - instance_tags = { - tag = "as" - } - } labels = { "test1" = "test1", - "test1" = "test2", - } -} -``` - -Use Kubelet - -```hcl - -resource "tencentcloud_kubernetes_as_scaling_group" "test" { - - cluster_id = "cls-kb32pbv4" - - auto_scaling_group { - scaling_group_name = "tf-guagua-as-group" - max_size = "5" - min_size = "0" - vpc_id = "vpc-dk8zmwuf" - subnet_ids = ["subnet-pqfek0t8"] - project_id = 0 - default_cooldown = 400 - desired_capacity = "0" - termination_policies = ["NEWEST_INSTANCE"] - retry_policy = "INCREMENTAL_INTERVALS" - - tags = { - "test" = "test" - } - - } - - - auto_scaling_config { - configuration_name = "tf-guagua-as-config" - instance_type = "S1.SMALL1" - project_id = 0 - system_disk_type = "CLOUD_PREMIUM" - system_disk_size = "50" - - data_disk { - disk_type = "CLOUD_PREMIUM" - disk_size = 50 - } - - internet_charge_type = "TRAFFIC_POSTPAID_BY_HOUR" - internet_max_bandwidth_out = 10 - public_ip_assigned = true - password = "test123#" - enhanced_security_service = false - enhanced_monitor_service = false - - instance_tags = { - tag = "as" - } - + "test2" = "test2", } - extra_args = [ - "root-dir=/var/lib/kubelet" - ] - - labels = { - "test1" = "test1", - "test1" = "test2", - } } -``` */ package tencentcloud diff --git a/tencentcloud/resource_tc_kubernetes_cluster.go b/tencentcloud/resource_tc_kubernetes_cluster.go index b45a38ae22..d22ec5d4bb 100644 --- a/tencentcloud/resource_tc_kubernetes_cluster.go +++ b/tencentcloud/resource_tc_kubernetes_cluster.go @@ -394,6 +394,30 @@ resource "tencentcloud_kubernetes_cluster" "managed_cluster" { } } ``` + +Using ops options +``` +resource "tencentcloud_kubernetes_cluster" "managed_cluster" { + # ...your basic fields + + log_agent { + enabled = true + kubelet_root_dir = "" # optional + } + + event_persistence { + enabled = true + log_set_id = "" # optional + log_set_topic = "" # optional + } + + cluster_audit { + enabled = true + log_set_id = "" # optional + log_set_topic = "" # optional + } +} +``` */ package tencentcloud @@ -1235,6 +1259,76 @@ func resourceTencentCloudTkeCluster() *schema.Resource { }, Description: "Information of the add-on to be installed.", }, + "log_agent": { + Type: schema.TypeList, + Optional: true, + MaxItems: 1, + Description: "Specify cluster log agent config.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "enabled": { + Type: schema.TypeBool, + Required: true, + Description: "Whether the log agent enabled.", + }, + "kubelet_root_dir": { + Type: schema.TypeString, + Optional: true, + Description: "Kubelet root directory as the literal.", + }, + }, + }, + }, + "event_persistence": { + Type: schema.TypeList, + Optional: true, + MaxItems: 1, + Description: "Specify cluster Event Persistence config. NOTE: Please make sure your TKE CamRole have permission to access CLS service.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "enabled": { + Type: schema.TypeBool, + Required: true, + Description: "Specify weather the Event Persistence enabled.", + }, + "log_set_id": { + Type: schema.TypeString, + Optional: true, + Description: "Specify id of existing CLS log set, or auto create a new set by leave it empty.", + }, + "topic_id": { + Type: schema.TypeString, + Optional: true, + Description: "Specify id of existing CLS log topic, or auto create a new topic by leave it empty.", + }, + }, + }, + }, + "cluster_audit": { + Type: schema.TypeList, + Optional: true, + MaxItems: 1, + Description: "Specify Cluster Audit config. NOTE: Please make sure your TKE CamRole have permission to access CLS service.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "enabled": { + Type: schema.TypeBool, + Required: true, + Description: "Specify weather the Cluster Audit enabled. NOTE: Enable Cluster Audit will also auto install Log Agent.", + }, + "log_set_id": { + Type: schema.TypeString, + Optional: true, + Description: "Specify id of existing CLS log set, or auto create a new set by leave it empty.", + }, + "topic_id": { + Type: schema.TypeString, + Optional: true, + Description: "Specify id of existing CLS log topic, or auto create a new topic by leave it empty.", + }, + }, + }, + }, "tags": { Type: schema.TypeMap, Optional: true, @@ -2194,6 +2288,42 @@ func resourceTencentCloudTkeClusterCreate(d *schema.ResourceData, meta interface } } + if v, ok := helper.InterfacesHeadMap(d, "log_agent"); ok { + enabled := v["enabled"].(bool) + rootDir := v["kubelet_root_dir"].(string) + + if enabled { + err := service.SwitchLogAgent(ctx, id, rootDir, enabled) + if err != nil { + return err + } + } + } + + if v, ok := helper.InterfacesHeadMap(d, "event_persistence"); ok { + enabled := v["enabled"].(bool) + logSetId := v["log_set_id"].(string) + topicId := v["topic_id"].(string) + if enabled { + err := service.SwitchEventPersistence(ctx, id, logSetId, topicId, enabled) + if err != nil { + return err + } + } + } + + if v, ok := helper.InterfacesHeadMap(d, "cluster_audit"); ok { + enabled := v["enabled"].(bool) + logSetId := v["log_set_id"].(string) + topicId := v["topic_id"].(string) + if enabled { + err := service.SwitchClusterAudit(ctx, id, logSetId, topicId, enabled) + if err != nil { + return err + } + } + } + if err = resourceTencentCloudTkeClusterRead(d, meta); err != nil { log.Printf("[WARN]%s resource.kubernetes_cluster.read after create fail , %s", logId, err.Error()) return err @@ -2780,6 +2910,52 @@ func resourceTencentCloudTkeClusterUpdate(d *schema.ResourceData, meta interface } } + if d.HasChange("log_agent") { + v, ok := helper.InterfacesHeadMap(d, "log_agent") + enabled := false + rootDir := "" + if ok { + rootDir = v["kubelet_root_dir"].(string) + enabled = v["enabled"].(bool) + } + err := tkeService.SwitchLogAgent(ctx, id, rootDir, enabled) + if err != nil { + return err + } + } + + if d.HasChange("event_persistence") { + v, ok := helper.InterfacesHeadMap(d, "event_persistence") + enabled := false + logSetId := "" + topicId := "" + if ok { + enabled = v["enabled"].(bool) + logSetId = v["log_set_id"].(string) + topicId = v["topic_id"].(string) + } + err := tkeService.SwitchEventPersistence(ctx, id, logSetId, topicId, enabled) + if err != nil { + return err + } + } + + if d.HasChange("cluster_audit") { + v, ok := helper.InterfacesHeadMap(d, "cluster_audit") + enabled := false + logSetId := "" + topicId := "" + if ok { + enabled = v["enabled"].(bool) + logSetId = v["log_set_id"].(string) + topicId = v["topic_id"].(string) + } + err := tkeService.SwitchClusterAudit(ctx, id, logSetId, topicId, enabled) + if err != nil { + return err + } + } + d.Partial(false) if err := resourceTencentCloudTkeClusterRead(d, meta); err != nil { log.Printf("[WARN]%s resource.kubernetes_cluster.read after update fail , %s", logId, err.Error()) diff --git a/tencentcloud/resource_tc_kubernetes_cluster_attachment_test.go b/tencentcloud/resource_tc_kubernetes_cluster_attachment_test.go index 371c8b3de5..626ec558a2 100644 --- a/tencentcloud/resource_tc_kubernetes_cluster_attachment_test.go +++ b/tencentcloud/resource_tc_kubernetes_cluster_attachment_test.go @@ -18,8 +18,7 @@ func TestAccTencentCloudTkeAttachResource(t *testing.T) { CheckDestroy: testAccCheckTkeAttachDestroy, Steps: []resource.TestStep{ { - ExpectNonEmptyPlan: false, - Config: testAccTkeAttachCluster(), + Config: testAccTkeAttachCluster(), Check: resource.ComposeTestCheckFunc( testAccCheckTkeAttachExists("tencentcloud_kubernetes_cluster_attachment.test_attach"), resource.TestCheckResourceAttrSet("tencentcloud_kubernetes_cluster_attachment.test_attach", "cluster_id"), @@ -139,9 +138,23 @@ func testAccCheckTkeAttachExists(n string) resource.TestCheckFunc { } } +const ClusterAttachmentInstanceType = ` +data "tencentcloud_instance_types" "ins_type" { + availability_zone = "ap-guangzhou-3" + cpu_core_count = 2 + memory_size = 2 + exclude_sold_out = true +} + +locals { + type1 = [for i in data.tencentcloud_instance_types.ins_type.instance_types: i if lookup(i, "instance_charge_type") == "POSTPAID_BY_HOUR"][0].instance_type + type2 = [for i in data.tencentcloud_instance_types.ins_type.instance_types: i if lookup(i, "instance_charge_type") == "POSTPAID_BY_HOUR"][1].instance_type +} +` + func testAccTkeAttachCluster() string { - return TkeDataSource + TkeInstanceType + ` + return TkeDataSource + ClusterAttachmentInstanceType + defaultImages + ` variable "cluster_cidr" { default = "172.16.0.0/16" } @@ -157,7 +170,7 @@ data "tencentcloud_vpc_subnets" "sub" { resource "tencentcloud_instance" "foo" { instance_name = "tf-auto-test-1-1" availability_zone = data.tencentcloud_vpc_subnets.sub.instance_list.0.availability_zone - image_id = "` + defaultTkeOSImageId + `" + image_id = var.default_img_id instance_type = local.type1 system_disk_type = "CLOUD_PREMIUM" system_disk_size = 50 diff --git a/tencentcloud/resource_tc_kubernetes_cluster_test.go b/tencentcloud/resource_tc_kubernetes_cluster_test.go index 67c55d9d67..d32ccdd443 100644 --- a/tencentcloud/resource_tc_kubernetes_cluster_test.go +++ b/tencentcloud/resource_tc_kubernetes_cluster_test.go @@ -94,6 +94,45 @@ func TestAccTencentCloudTkeResourceBasic(t *testing.T) { }) } +func TestAccTencentCloudTkeResourceLogs(t *testing.T) { + t.Parallel() + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckTkeDestroy, + Steps: []resource.TestStep{ + { + Config: testAccTkeClusterLogs, + Check: resource.ComposeTestCheckFunc( + testAccCheckTkeExists(testTkeClusterResourceKey), + resource.TestCheckResourceAttr(testTkeClusterResourceKey, "cluster_cidr", "192.168.0.0/18"), + resource.TestCheckResourceAttr(testTkeClusterResourceKey, "cluster_name", "test"), + resource.TestCheckResourceAttr(testTkeClusterResourceKey, "cluster_desc", "test cluster desc"), + resource.TestCheckResourceAttr(testTkeClusterResourceKey, "log_agent.0.enabled", "true"), + resource.TestCheckResourceAttr(testTkeClusterResourceKey, "event_persistence.0.enabled", "true"), + resource.TestCheckResourceAttr(testTkeClusterResourceKey, "cluster_audit.0.enabled", "false"), + ), + }, + { + PreConfig: func() { + // do not update so fast + time.Sleep(10 * time.Second) + }, + Config: testAccTkeClusterLogsUpdate, + Check: resource.ComposeTestCheckFunc( + testAccCheckTkeExists(testTkeClusterResourceKey), + resource.TestCheckResourceAttr(testTkeClusterResourceKey, "cluster_cidr", "192.168.0.0/18"), + resource.TestCheckResourceAttr(testTkeClusterResourceKey, "cluster_name", "test"), + resource.TestCheckResourceAttr(testTkeClusterResourceKey, "cluster_desc", "test cluster desc"), + resource.TestCheckResourceAttr(testTkeClusterResourceKey, "log_agent.0.enabled", "true"), + resource.TestCheckResourceAttr(testTkeClusterResourceKey, "event_persistence.0.enabled", "false"), + resource.TestCheckResourceAttr(testTkeClusterResourceKey, "cluster_audit.0.enabled", "true"), + ), + }, + }, + }) +} + func testAccCheckTkeDestroy(s *terraform.State) error { logId := getLogId(contextNil) ctx := context.WithValue(context.TODO(), logIdKey, logId) @@ -179,6 +218,23 @@ func testAccCheckTkeExists(n string) resource.TestCheckFunc { } } +// If test environment change, make sure to attach Tke access cls permission +// We will not apply/destroy frequently +const TkeAccessClsRole = ` +data "tencentcloud_cam_roles" "tke" { + name = "TKE_QCSRole" +} + +data "tencentcloud_cam_policies" "cls" { + name = "QcloudCLSFullAccess" +} + +resource "tencentcloud_cam_role_policy_attachment" "tke_cls" { + policy_id = data.tencentcloud_cam_policies.cls.policy_list.0.policy_id + role_id = data.tencentcloud_cam_roles.tke.role_list.0.role_id +} +` + const TkeDeps = TkeExclusiveNetwork + TkeInstanceType + TkeCIDRs + defaultImages + defaultSecurityGroupData const testAccTkeCluster = TkeDeps + ` @@ -307,3 +363,65 @@ resource "tencentcloud_kubernetes_cluster" "managed_cluster" { ] } ` + +const testAccTkeClusterLogs = TkeDeps + ` +variable "availability_zone" { + default = "ap-guangzhou-3" +} + +resource "tencentcloud_kubernetes_cluster" "managed_cluster" { + vpc_id = local.vpc_id + cluster_cidr = var.tke_cidr_c.0 + cluster_max_pod_num = 32 + cluster_name = "test" + cluster_desc = "test cluster desc" + cluster_max_service_num = 32 + cluster_version = "1.20.6" + cluster_os = "tlinux2.2(tkernel3)x86_64" + cluster_level = "L5" + auto_upgrade_cluster_level = true + cluster_deploy_type = "MANAGED_CLUSTER" + + log_agent { + enabled = true + } + + event_persistence { + enabled = true + } + + cluster_audit { + enabled = false + } +}` + +const testAccTkeClusterLogsUpdate = TkeDeps + ` +variable "availability_zone" { + default = "ap-guangzhou-3" +} + +resource "tencentcloud_kubernetes_cluster" "managed_cluster" { + vpc_id = local.vpc_id + cluster_cidr = var.tke_cidr_c.0 + cluster_max_pod_num = 32 + cluster_name = "test" + cluster_desc = "test cluster desc" + cluster_max_service_num = 32 + cluster_version = "1.20.6" + cluster_os = "tlinux2.2(tkernel3)x86_64" + cluster_level = "L5" + auto_upgrade_cluster_level = true + cluster_deploy_type = "MANAGED_CLUSTER" + + log_agent { + enabled = true + } + + event_persistence { + enabled = false + } + + cluster_audit { + enabled = true + } +}` diff --git a/tencentcloud/service_tencentcloud_tke.go b/tencentcloud/service_tencentcloud_tke.go index 92f139ecc1..2af5759457 100644 --- a/tencentcloud/service_tencentcloud_tke.go +++ b/tencentcloud/service_tencentcloud_tke.go @@ -6,6 +6,8 @@ import ( "log" "strings" + sdkErrors "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/errors" + "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" @@ -718,42 +720,7 @@ func (me *TkeService) DescribeClusterSecurity(ctx context.Context, id string) (r } func (me *TkeService) CreateClusterAsGroup(ctx context.Context, id, groupPara, configPara string, labels []*tke.Label, iAdvanced InstanceAdvancedSettings) (asGroupId string, errRet error) { - - logId := getLogId(ctx) - request := tke.NewCreateClusterAsGroupRequest() - - defer func() { - if errRet != nil { - log.Printf("[CRITAL]%s api[%s] fail, reason[%s]\n", logId, request.GetAction(), errRet.Error()) - } - }() - request.ClusterId = &id - request.AutoScalingGroupPara = &groupPara - request.LaunchConfigurePara = &configPara - if len(iAdvanced.ExtraArgs.Kubelet) > 0 { - request.InstanceAdvancedSettings = &tke.InstanceAdvancedSettings{ - ExtraArgs: &iAdvanced.ExtraArgs, - } - } - - if len(labels) > 0 { - request.Labels = labels - } - - ratelimit.Check(request.GetAction()) - response, err := me.client.UseTkeClient().CreateClusterAsGroup(request) - if err != nil { - errRet = err - return - } - - if response == nil || response.Response == nil || response.Response.AutoScalingGroupId == nil { - errRet = fmt.Errorf("CreateClusterAsGroup return nil response") - return - } - - asGroupId = *response.Response.AutoScalingGroupId - return + return "", fmt.Errorf("Cluster AS Group has OFFLINE") } func (me *TkeService) DescribeClusterAsGroupsByGroupId(ctx context.Context, id string, groupId string) (clusterAsGroupSet *tke.ClusterAsGroup, errRet error) { @@ -1608,3 +1575,193 @@ func (me *TkeService) AcquireClusterAdminRole(ctx context.Context, clusterId str return } + +func (me *TkeService) SwitchLogAgent(ctx context.Context, clusterId, rootDir string, enable bool) error { + if enable { + request := tke.NewInstallLogAgentRequest() + request.ClusterId = &clusterId + if rootDir != "" { + request.KubeletRootDir = &rootDir + } + return me.InstallLogAgent(ctx, request) + } + request := tke.NewUninstallLogAgentRequest() + request.ClusterId = &clusterId + return me.UninstallLogAgent(ctx, request) +} + +func (me *TkeService) SwitchEventPersistence(ctx context.Context, clusterId, logSetId, topicId string, enable bool) error { + if enable { + request := tke.NewEnableEventPersistenceRequest() + request.ClusterId = &clusterId + if logSetId != "" { + request.LogsetId = &logSetId + } + if topicId != "" { + request.TopicId = &topicId + } + return me.EnableEventPersistence(ctx, request) + } + request := tke.NewDisableEventPersistenceRequest() + request.ClusterId = &clusterId + return me.DisableEventPersistence(ctx, request) +} + +func (me *TkeService) SwitchClusterAudit(ctx context.Context, clusterId, logSetId, topicId string, enable bool) error { + if enable { + request := tke.NewEnableClusterAuditRequest() + request.ClusterId = &clusterId + if logSetId != "" { + request.LogsetId = &logSetId + } + if topicId != "" { + request.TopicId = &topicId + } + return me.EnableClusterAudit(ctx, request) + } + request := tke.NewDisableClusterAuditRequest() + request.ClusterId = &clusterId + return me.DisableClusterAudit(ctx, request) +} + +func (me *TkeService) InstallLogAgent(ctx context.Context, request *tke.InstallLogAgentRequest) (errRet error) { + logId := getLogId(ctx) + 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.UseTkeClient().InstallLogAgent(request) + + if err != nil { + errRet = err + return + } + + log.Printf("[DEBUG]%s api[%s] success, request body [%s], response body [%s]\n", + logId, request.GetAction(), request.ToJsonString(), response.ToJsonString()) + + return +} + +func (me *TkeService) UninstallLogAgent(ctx context.Context, request *tke.UninstallLogAgentRequest) (errRet error) { + logId := getLogId(ctx) + 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.UseTkeClient().UninstallLogAgent(request) + + if err != nil { + errRet = err + return + } + + log.Printf("[DEBUG]%s api[%s] success, request body [%s], response body [%s]\n", + logId, request.GetAction(), request.ToJsonString(), response.ToJsonString()) + + return +} + +func (me *TkeService) EnableEventPersistence(ctx context.Context, request *tke.EnableEventPersistenceRequest) (errRet error) { + logId := getLogId(ctx) + 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.UseTkeClient().EnableEventPersistence(request) + + if err != nil { + errRet = err + return + } + + log.Printf("[DEBUG]%s api[%s] success, request body [%s], response body [%s]\n", + logId, request.GetAction(), request.ToJsonString(), response.ToJsonString()) + + return +} + +func (me *TkeService) DisableEventPersistence(ctx context.Context, request *tke.DisableEventPersistenceRequest) (errRet error) { + logId := getLogId(ctx) + 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.UseTkeClient().DisableEventPersistence(request) + + if err != nil { + code := err.(*sdkErrors.TencentCloudSDKError).Code + if code == "InternalError.KubernetesDeleteOperationError" { + return + } + errRet = err + return + } + + log.Printf("[DEBUG]%s api[%s] success, request body [%s], response body [%s]\n", + logId, request.GetAction(), request.ToJsonString(), response.ToJsonString()) + + return +} + +func (me *TkeService) EnableClusterAudit(ctx context.Context, request *tke.EnableClusterAuditRequest) (errRet error) { + logId := getLogId(ctx) + 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.UseTkeClient().EnableClusterAudit(request) + + if err != nil { + errRet = err + return + } + + log.Printf("[DEBUG]%s api[%s] success, request body [%s], response body [%s]\n", + logId, request.GetAction(), request.ToJsonString(), response.ToJsonString()) + + return +} + +func (me *TkeService) DisableClusterAudit(ctx context.Context, request *tke.DisableClusterAuditRequest) (errRet error) { + logId := getLogId(ctx) + 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.UseTkeClient().DisableClusterAudit(request) + + if err != nil { + errRet = err + return + } + + log.Printf("[DEBUG]%s api[%s] success, request body [%s], response body [%s]\n", + logId, request.GetAction(), request.ToJsonString(), response.ToJsonString()) + + return +} diff --git a/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/tke/v20180525/client.go b/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/tke/v20180525/client.go index f85c737d3e..9352773917 100644 --- a/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/tke/v20180525/client.go +++ b/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/tke/v20180525/client.go @@ -66,6 +66,8 @@ func NewAcquireClusterAdminRoleResponse() (response *AcquireClusterAdminRoleResp // 通过此接口,可以获取集群的tke:admin的ClusterRole,即管理员角色,可以用于CAM侧高权限的用户,通过CAM策略给予子账户此接口权限,进而可以通过此接口直接获取到kubernetes集群内的管理员角色。 // // 可能返回的错误码: +// FAILEDOPERATION_COMPONENTCLIENTHTTP = "FailedOperation.ComponentClientHttp" +// FAILEDOPERATION_KUBERNETESCREATEOPERATIONERROR = "FailedOperation.KubernetesCreateOperationError" // INTERNALERROR = "InternalError" // INTERNALERROR_CAMNOAUTH = "InternalError.CamNoAuth" // INTERNALERROR_KUBERNETESCLIENTBUILDERROR = "InternalError.KubernetesClientBuildError" @@ -87,6 +89,8 @@ func (c *Client) AcquireClusterAdminRole(request *AcquireClusterAdminRoleRequest // 通过此接口,可以获取集群的tke:admin的ClusterRole,即管理员角色,可以用于CAM侧高权限的用户,通过CAM策略给予子账户此接口权限,进而可以通过此接口直接获取到kubernetes集群内的管理员角色。 // // 可能返回的错误码: +// FAILEDOPERATION_COMPONENTCLIENTHTTP = "FailedOperation.ComponentClientHttp" +// FAILEDOPERATION_KUBERNETESCREATEOPERATIONERROR = "FailedOperation.KubernetesCreateOperationError" // INTERNALERROR = "InternalError" // INTERNALERROR_CAMNOAUTH = "InternalError.CamNoAuth" // INTERNALERROR_KUBERNETESCLIENTBUILDERROR = "InternalError.KubernetesClientBuildError" @@ -204,6 +208,12 @@ func NewAddExistedInstancesResponse() (response *AddExistedInstancesResponse) { // 添加已经存在的实例到集群 // // 可能返回的错误码: +// FAILEDOPERATION_CLUSTERNOTFOUND = "FailedOperation.ClusterNotFound" +// FAILEDOPERATION_CLUSTERSTATE = "FailedOperation.ClusterState" +// FAILEDOPERATION_CVMCOMMON = "FailedOperation.CvmCommon" +// FAILEDOPERATION_NETWORKSCALEERROR = "FailedOperation.NetworkScaleError" +// FAILEDOPERATION_PARAM = "FailedOperation.Param" +// FAILEDOPERATION_QUOTAMAXNODLIMIT = "FailedOperation.QuotaMaxNodLimit" // INTERNALERROR = "InternalError" // INTERNALERROR_CLUSTERNOTFOUND = "InternalError.ClusterNotFound" // INTERNALERROR_CLUSTERSTATE = "InternalError.ClusterState" @@ -211,6 +221,7 @@ func NewAddExistedInstancesResponse() (response *AddExistedInstancesResponse) { // INTERNALERROR_DB = "InternalError.Db" // INTERNALERROR_DBAFFECTIVEDROWS = "InternalError.DbAffectivedRows" // INTERNALERROR_PARAM = "InternalError.Param" +// INTERNALERROR_QUOTAMAXNODLIMIT = "InternalError.QuotaMaxNodLimit" // INTERNALERROR_UNEXCEPTEDINTERNAL = "InternalError.UnexceptedInternal" // INTERNALERROR_UNEXPECTEDINTERNAL = "InternalError.UnexpectedInternal" // INVALIDPARAMETER = "InvalidParameter" @@ -223,6 +234,12 @@ func (c *Client) AddExistedInstances(request *AddExistedInstancesRequest) (respo // 添加已经存在的实例到集群 // // 可能返回的错误码: +// FAILEDOPERATION_CLUSTERNOTFOUND = "FailedOperation.ClusterNotFound" +// FAILEDOPERATION_CLUSTERSTATE = "FailedOperation.ClusterState" +// FAILEDOPERATION_CVMCOMMON = "FailedOperation.CvmCommon" +// FAILEDOPERATION_NETWORKSCALEERROR = "FailedOperation.NetworkScaleError" +// FAILEDOPERATION_PARAM = "FailedOperation.Param" +// FAILEDOPERATION_QUOTAMAXNODLIMIT = "FailedOperation.QuotaMaxNodLimit" // INTERNALERROR = "InternalError" // INTERNALERROR_CLUSTERNOTFOUND = "InternalError.ClusterNotFound" // INTERNALERROR_CLUSTERSTATE = "InternalError.ClusterState" @@ -230,6 +247,7 @@ func (c *Client) AddExistedInstances(request *AddExistedInstancesRequest) (respo // INTERNALERROR_DB = "InternalError.Db" // INTERNALERROR_DBAFFECTIVEDROWS = "InternalError.DbAffectivedRows" // INTERNALERROR_PARAM = "InternalError.Param" +// INTERNALERROR_QUOTAMAXNODLIMIT = "InternalError.QuotaMaxNodLimit" // INTERNALERROR_UNEXCEPTEDINTERNAL = "InternalError.UnexceptedInternal" // INTERNALERROR_UNEXPECTEDINTERNAL = "InternalError.UnexpectedInternal" // INVALIDPARAMETER = "InvalidParameter" @@ -318,6 +336,7 @@ func NewAddVpcCniSubnetsResponse() (response *AddVpcCniSubnetsResponse) { // 针对VPC-CNI模式的集群,增加集群容器网络可使用的子网 // // 可能返回的错误码: +// FAILEDOPERATION_VPCRECODRNOTFOUND = "FailedOperation.VpcRecodrNotFound" // INTERNALERROR = "InternalError" // INTERNALERROR_DB = "InternalError.Db" // INTERNALERROR_DBRECORDNOTFOUND = "InternalError.DbRecordNotFound" @@ -336,6 +355,7 @@ func (c *Client) AddVpcCniSubnets(request *AddVpcCniSubnetsRequest) (response *A // 针对VPC-CNI模式的集群,增加集群容器网络可使用的子网 // // 可能返回的错误码: +// FAILEDOPERATION_VPCRECODRNOTFOUND = "FailedOperation.VpcRecodrNotFound" // INTERNALERROR = "InternalError" // INTERNALERROR_DB = "InternalError.Db" // INTERNALERROR_DBRECORDNOTFOUND = "InternalError.DbRecordNotFound" @@ -383,6 +403,7 @@ func NewCheckInstancesUpgradeAbleResponse() (response *CheckInstancesUpgradeAble // 检查给定节点列表中哪些是可升级的 // // 可能返回的错误码: +// FAILEDOPERATION_KUBECLIENTCONNECTION = "FailedOperation.KubeClientConnection" // INTERNALERROR = "InternalError" // INTERNALERROR_DB = "InternalError.Db" // INTERNALERROR_KUBECLIENTCONNECTION = "InternalError.KubeClientConnection" @@ -391,6 +412,7 @@ func NewCheckInstancesUpgradeAbleResponse() (response *CheckInstancesUpgradeAble // INTERNALERROR_UNEXPECTEDINTERNAL = "InternalError.UnexpectedInternal" // INVALIDPARAMETER = "InvalidParameter" // INVALIDPARAMETER_PARAM = "InvalidParameter.Param" +// RESOURCENOTFOUND = "ResourceNotFound" // RESOURCENOTFOUND_CLUSTERNOTFOUND = "ResourceNotFound.ClusterNotFound" func (c *Client) CheckInstancesUpgradeAble(request *CheckInstancesUpgradeAbleRequest) (response *CheckInstancesUpgradeAbleResponse, err error) { return c.CheckInstancesUpgradeAbleWithContext(context.Background(), request) @@ -400,6 +422,7 @@ func (c *Client) CheckInstancesUpgradeAble(request *CheckInstancesUpgradeAbleReq // 检查给定节点列表中哪些是可升级的 // // 可能返回的错误码: +// FAILEDOPERATION_KUBECLIENTCONNECTION = "FailedOperation.KubeClientConnection" // INTERNALERROR = "InternalError" // INTERNALERROR_DB = "InternalError.Db" // INTERNALERROR_KUBECLIENTCONNECTION = "InternalError.KubeClientConnection" @@ -408,6 +431,7 @@ func (c *Client) CheckInstancesUpgradeAble(request *CheckInstancesUpgradeAbleReq // INTERNALERROR_UNEXPECTEDINTERNAL = "InternalError.UnexpectedInternal" // INVALIDPARAMETER = "InvalidParameter" // INVALIDPARAMETER_PARAM = "InvalidParameter.Param" +// RESOURCENOTFOUND = "ResourceNotFound" // RESOURCENOTFOUND_CLUSTERNOTFOUND = "ResourceNotFound.ClusterNotFound" func (c *Client) CheckInstancesUpgradeAbleWithContext(ctx context.Context, request *CheckInstancesUpgradeAbleRequest) (response *CheckInstancesUpgradeAbleResponse, err error) { if request == nil { @@ -446,6 +470,21 @@ func NewCreateClusterResponse() (response *CreateClusterResponse) { // 创建集群 // // 可能返回的错误码: +// FAILEDOPERATION_ACCOUNTCOMMON = "FailedOperation.AccountCommon" +// FAILEDOPERATION_ACCOUNTUSERNOTAUTHENTICATED = "FailedOperation.AccountUserNotAuthenticated" +// FAILEDOPERATION_COMPONENTCLINETHTTP = "FailedOperation.ComponentClinetHttp" +// FAILEDOPERATION_CVMCOMMON = "FailedOperation.CvmCommon" +// FAILEDOPERATION_CVMNUMBERNOTMATCH = "FailedOperation.CvmNumberNotMatch" +// FAILEDOPERATION_CVMVPCIDNOTMATCH = "FailedOperation.CvmVpcidNotMatch" +// FAILEDOPERATION_DBRECORDNOTFOUND = "FailedOperation.DbRecordNotFound" +// FAILEDOPERATION_DFWGETUSGQUOTA = "FailedOperation.DfwGetUSGQuota" +// FAILEDOPERATION_OSNOTSUPPORT = "FailedOperation.OsNotSupport" +// FAILEDOPERATION_PARAM = "FailedOperation.Param" +// FAILEDOPERATION_QUOTAMAXCLSLIMIT = "FailedOperation.QuotaMaxClsLimit" +// FAILEDOPERATION_QUOTAMAXNODLIMIT = "FailedOperation.QuotaMaxNodLimit" +// FAILEDOPERATION_QUOTAUSGLIMIT = "FailedOperation.QuotaUSGLimit" +// FAILEDOPERATION_TRADECOMMON = "FailedOperation.TradeCommon" +// FAILEDOPERATION_VPCRECODRNOTFOUND = "FailedOperation.VpcRecodrNotFound" // INTERNALERROR = "InternalError" // INTERNALERROR_ACCOUNTCOMMON = "InternalError.AccountCommon" // INTERNALERROR_ACCOUNTUSERNOTAUTHENTICATED = "InternalError.AccountUserNotAuthenticated" @@ -486,6 +525,7 @@ func NewCreateClusterResponse() (response *CreateClusterResponse) { // INVALIDPARAMETER_CIDRCONFLICTWITHOTHERROUTE = "InvalidParameter.CidrConflictWithOtherRoute" // INVALIDPARAMETER_CIDRCONFLICTWITHVPCCIDR = "InvalidParameter.CidrConflictWithVpcCidr" // INVALIDPARAMETER_CIDRCONFLICTWITHVPCGLOBALROUTE = "InvalidParameter.CidrConflictWithVpcGlobalRoute" +// INVALIDPARAMETER_CIDRINVALI = "InvalidParameter.CidrInvali" // INVALIDPARAMETER_CIDRINVALID = "InvalidParameter.CidrInvalid" // INVALIDPARAMETER_INVALIDPRIVATENETWORKCIDR = "InvalidParameter.InvalidPrivateNetworkCIDR" // LIMITEXCEEDED = "LimitExceeded" @@ -497,6 +537,21 @@ func (c *Client) CreateCluster(request *CreateClusterRequest) (response *CreateC // 创建集群 // // 可能返回的错误码: +// FAILEDOPERATION_ACCOUNTCOMMON = "FailedOperation.AccountCommon" +// FAILEDOPERATION_ACCOUNTUSERNOTAUTHENTICATED = "FailedOperation.AccountUserNotAuthenticated" +// FAILEDOPERATION_COMPONENTCLINETHTTP = "FailedOperation.ComponentClinetHttp" +// FAILEDOPERATION_CVMCOMMON = "FailedOperation.CvmCommon" +// FAILEDOPERATION_CVMNUMBERNOTMATCH = "FailedOperation.CvmNumberNotMatch" +// FAILEDOPERATION_CVMVPCIDNOTMATCH = "FailedOperation.CvmVpcidNotMatch" +// FAILEDOPERATION_DBRECORDNOTFOUND = "FailedOperation.DbRecordNotFound" +// FAILEDOPERATION_DFWGETUSGQUOTA = "FailedOperation.DfwGetUSGQuota" +// FAILEDOPERATION_OSNOTSUPPORT = "FailedOperation.OsNotSupport" +// FAILEDOPERATION_PARAM = "FailedOperation.Param" +// FAILEDOPERATION_QUOTAMAXCLSLIMIT = "FailedOperation.QuotaMaxClsLimit" +// FAILEDOPERATION_QUOTAMAXNODLIMIT = "FailedOperation.QuotaMaxNodLimit" +// FAILEDOPERATION_QUOTAUSGLIMIT = "FailedOperation.QuotaUSGLimit" +// FAILEDOPERATION_TRADECOMMON = "FailedOperation.TradeCommon" +// FAILEDOPERATION_VPCRECODRNOTFOUND = "FailedOperation.VpcRecodrNotFound" // INTERNALERROR = "InternalError" // INTERNALERROR_ACCOUNTCOMMON = "InternalError.AccountCommon" // INTERNALERROR_ACCOUNTUSERNOTAUTHENTICATED = "InternalError.AccountUserNotAuthenticated" @@ -537,6 +592,7 @@ func (c *Client) CreateCluster(request *CreateClusterRequest) (response *CreateC // INVALIDPARAMETER_CIDRCONFLICTWITHOTHERROUTE = "InvalidParameter.CidrConflictWithOtherRoute" // INVALIDPARAMETER_CIDRCONFLICTWITHVPCCIDR = "InvalidParameter.CidrConflictWithVpcCidr" // INVALIDPARAMETER_CIDRCONFLICTWITHVPCGLOBALROUTE = "InvalidParameter.CidrConflictWithVpcGlobalRoute" +// INVALIDPARAMETER_CIDRINVALI = "InvalidParameter.CidrInvali" // INVALIDPARAMETER_CIDRINVALID = "InvalidParameter.CidrInvalid" // INVALIDPARAMETER_INVALIDPRIVATENETWORKCIDR = "InvalidParameter.InvalidPrivateNetworkCIDR" // LIMITEXCEEDED = "LimitExceeded" @@ -556,87 +612,6 @@ func (c *Client) CreateClusterWithContext(ctx context.Context, request *CreateCl return } -func NewCreateClusterAsGroupRequest() (request *CreateClusterAsGroupRequest) { - request = &CreateClusterAsGroupRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - request.Init().WithApiInfo("tke", APIVersion, "CreateClusterAsGroup") - - - return -} - -func NewCreateClusterAsGroupResponse() (response *CreateClusterAsGroupResponse) { - response = &CreateClusterAsGroupResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// CreateClusterAsGroup -// 为已经存在的集群创建伸缩组 -// -// 可能返回的错误码: -// FAILEDOPERATION = "FailedOperation" -// INTERNALERROR = "InternalError" -// INTERNALERROR_ACCOUNTUSERNOTAUTHENTICATED = "InternalError.AccountUserNotAuthenticated" -// INTERNALERROR_ASCOMMON = "InternalError.AsCommon" -// INTERNALERROR_CLUSTERNOTFOUND = "InternalError.ClusterNotFound" -// INTERNALERROR_CVMCOMMON = "InternalError.CvmCommon" -// INTERNALERROR_CVMNOTFOUND = "InternalError.CvmNotFound" -// INTERNALERROR_DB = "InternalError.Db" -// INTERNALERROR_DBAFFECTIVEDROWS = "InternalError.DbAffectivedRows" -// INTERNALERROR_IMAGEIDNOTFOUND = "InternalError.ImageIdNotFound" -// INTERNALERROR_OSNOTSUPPORT = "InternalError.OsNotSupport" -// INTERNALERROR_PARAM = "InternalError.Param" -// INTERNALERROR_UNEXCEPTEDINTERNAL = "InternalError.UnexceptedInternal" -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETER_ASCOMMONERROR = "InvalidParameter.AsCommonError" -// LIMITEXCEEDED = "LimitExceeded" -// MISSINGPARAMETER = "MissingParameter" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -func (c *Client) CreateClusterAsGroup(request *CreateClusterAsGroupRequest) (response *CreateClusterAsGroupResponse, err error) { - return c.CreateClusterAsGroupWithContext(context.Background(), request) -} - -// CreateClusterAsGroup -// 为已经存在的集群创建伸缩组 -// -// 可能返回的错误码: -// FAILEDOPERATION = "FailedOperation" -// INTERNALERROR = "InternalError" -// INTERNALERROR_ACCOUNTUSERNOTAUTHENTICATED = "InternalError.AccountUserNotAuthenticated" -// INTERNALERROR_ASCOMMON = "InternalError.AsCommon" -// INTERNALERROR_CLUSTERNOTFOUND = "InternalError.ClusterNotFound" -// INTERNALERROR_CVMCOMMON = "InternalError.CvmCommon" -// INTERNALERROR_CVMNOTFOUND = "InternalError.CvmNotFound" -// INTERNALERROR_DB = "InternalError.Db" -// INTERNALERROR_DBAFFECTIVEDROWS = "InternalError.DbAffectivedRows" -// INTERNALERROR_IMAGEIDNOTFOUND = "InternalError.ImageIdNotFound" -// INTERNALERROR_OSNOTSUPPORT = "InternalError.OsNotSupport" -// INTERNALERROR_PARAM = "InternalError.Param" -// INTERNALERROR_UNEXCEPTEDINTERNAL = "InternalError.UnexceptedInternal" -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETER_ASCOMMONERROR = "InvalidParameter.AsCommonError" -// LIMITEXCEEDED = "LimitExceeded" -// MISSINGPARAMETER = "MissingParameter" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -func (c *Client) CreateClusterAsGroupWithContext(ctx context.Context, request *CreateClusterAsGroupRequest) (response *CreateClusterAsGroupResponse, err error) { - if request == nil { - request = NewCreateClusterAsGroupRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("CreateClusterAsGroup require credential") - } - - request.SetContext(ctx) - - response = NewCreateClusterAsGroupResponse() - err = c.Send(request, response) - return -} - func NewCreateClusterEndpointRequest() (request *CreateClusterEndpointRequest) { request = &CreateClusterEndpointRequest{ BaseRequest: &tchttp.BaseRequest{}, @@ -823,6 +798,13 @@ func NewCreateClusterInstancesResponse() (response *CreateClusterInstancesRespon // // 可能返回的错误码: // FAILEDOPERATION = "FailedOperation" +// FAILEDOPERATION_CLUSTERNOTFOUND = "FailedOperation.ClusterNotFound" +// FAILEDOPERATION_CLUSTERSTATE = "FailedOperation.ClusterState" +// FAILEDOPERATION_CVMCOMMON = "FailedOperation.CvmCommon" +// FAILEDOPERATION_DB = "FailedOperation.Db" +// FAILEDOPERATION_NETWORKSCALEERROR = "FailedOperation.NetworkScaleError" +// FAILEDOPERATION_PARAM = "FailedOperation.Param" +// FAILEDOPERATION_QUOTAMAXNODLIMIT = "FailedOperation.QuotaMaxNodLimit" // INTERNALERROR = "InternalError" // INTERNALERROR_ACCOUNTCOMMON = "InternalError.AccountCommon" // INTERNALERROR_ACCOUNTUSERNOTAUTHENTICATED = "InternalError.AccountUserNotAuthenticated" @@ -862,6 +844,13 @@ func (c *Client) CreateClusterInstances(request *CreateClusterInstancesRequest) // // 可能返回的错误码: // FAILEDOPERATION = "FailedOperation" +// FAILEDOPERATION_CLUSTERNOTFOUND = "FailedOperation.ClusterNotFound" +// FAILEDOPERATION_CLUSTERSTATE = "FailedOperation.ClusterState" +// FAILEDOPERATION_CVMCOMMON = "FailedOperation.CvmCommon" +// FAILEDOPERATION_DB = "FailedOperation.Db" +// FAILEDOPERATION_NETWORKSCALEERROR = "FailedOperation.NetworkScaleError" +// FAILEDOPERATION_PARAM = "FailedOperation.Param" +// FAILEDOPERATION_QUOTAMAXNODLIMIT = "FailedOperation.QuotaMaxNodLimit" // INTERNALERROR = "InternalError" // INTERNALERROR_ACCOUNTCOMMON = "InternalError.AccountCommon" // INTERNALERROR_ACCOUNTUSERNOTAUTHENTICATED = "InternalError.AccountUserNotAuthenticated" @@ -929,6 +918,7 @@ func NewCreateClusterNodePoolResponse() (response *CreateClusterNodePoolResponse // 创建节点池 // // 可能返回的错误码: +// FAILEDOPERATION_ASCOMMON = "FailedOperation.AsCommon" // INTERNALERROR_ASCOMMON = "InternalError.AsCommon" // INTERNALERROR_COMPONENTCLIENTHTTP = "InternalError.ComponentClientHttp" // INTERNALERROR_DB = "InternalError.Db" @@ -945,6 +935,7 @@ func (c *Client) CreateClusterNodePool(request *CreateClusterNodePoolRequest) (r // 创建节点池 // // 可能返回的错误码: +// FAILEDOPERATION_ASCOMMON = "FailedOperation.AsCommon" // INTERNALERROR_ASCOMMON = "InternalError.AsCommon" // INTERNALERROR_COMPONENTCLIENTHTTP = "InternalError.ComponentClientHttp" // INTERNALERROR_DB = "InternalError.Db" @@ -991,6 +982,8 @@ func NewCreateClusterNodePoolFromExistingAsgResponse() (response *CreateClusterN // // 可能返回的错误码: // INTERNALERROR_UNEXPECTEDINTERNAL = "InternalError.UnexpectedInternal" +// INVALIDPARAMETER_PARAM = "InvalidParameter.Param" +// RESOURCENOTFOUND = "ResourceNotFound" func (c *Client) CreateClusterNodePoolFromExistingAsg(request *CreateClusterNodePoolFromExistingAsgRequest) (response *CreateClusterNodePoolFromExistingAsgResponse, err error) { return c.CreateClusterNodePoolFromExistingAsgWithContext(context.Background(), request) } @@ -1000,6 +993,8 @@ func (c *Client) CreateClusterNodePoolFromExistingAsg(request *CreateClusterNode // // 可能返回的错误码: // INTERNALERROR_UNEXPECTEDINTERNAL = "InternalError.UnexpectedInternal" +// INVALIDPARAMETER_PARAM = "InvalidParameter.Param" +// RESOURCENOTFOUND = "ResourceNotFound" func (c *Client) CreateClusterNodePoolFromExistingAsgWithContext(ctx context.Context, request *CreateClusterNodePoolFromExistingAsgRequest) (response *CreateClusterNodePoolFromExistingAsgResponse, err error) { if request == nil { request = NewCreateClusterNodePoolFromExistingAsgRequest() @@ -1337,6 +1332,63 @@ func (c *Client) CreateImageCacheWithContext(ctx context.Context, request *Creat return } +func NewCreatePrometheusAlertPolicyRequest() (request *CreatePrometheusAlertPolicyRequest) { + request = &CreatePrometheusAlertPolicyRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + request.Init().WithApiInfo("tke", APIVersion, "CreatePrometheusAlertPolicy") + + + return +} + +func NewCreatePrometheusAlertPolicyResponse() (response *CreatePrometheusAlertPolicyResponse) { + response = &CreatePrometheusAlertPolicyResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return +} + +// CreatePrometheusAlertPolicy +// 创建告警策略 +// +// 可能返回的错误码: +// INTERNALERROR = "InternalError" +// INTERNALERROR_PARAM = "InternalError.Param" +// INTERNALERROR_UNEXPECTEDINTERNAL = "InternalError.UnexpectedInternal" +// INVALIDPARAMETER_PARAM = "InvalidParameter.Param" +// INVALIDPARAMETER_PROMINSTANCENOTFOUND = "InvalidParameter.PromInstanceNotFound" +// RESOURCENOTFOUND = "ResourceNotFound" +func (c *Client) CreatePrometheusAlertPolicy(request *CreatePrometheusAlertPolicyRequest) (response *CreatePrometheusAlertPolicyResponse, err error) { + return c.CreatePrometheusAlertPolicyWithContext(context.Background(), request) +} + +// CreatePrometheusAlertPolicy +// 创建告警策略 +// +// 可能返回的错误码: +// INTERNALERROR = "InternalError" +// INTERNALERROR_PARAM = "InternalError.Param" +// INTERNALERROR_UNEXPECTEDINTERNAL = "InternalError.UnexpectedInternal" +// INVALIDPARAMETER_PARAM = "InvalidParameter.Param" +// INVALIDPARAMETER_PROMINSTANCENOTFOUND = "InvalidParameter.PromInstanceNotFound" +// RESOURCENOTFOUND = "ResourceNotFound" +func (c *Client) CreatePrometheusAlertPolicyWithContext(ctx context.Context, request *CreatePrometheusAlertPolicyRequest) (response *CreatePrometheusAlertPolicyResponse, err error) { + if request == nil { + request = NewCreatePrometheusAlertPolicyRequest() + } + + if c.GetCredential() == nil { + return nil, errors.New("CreatePrometheusAlertPolicy require credential") + } + + request.SetContext(ctx) + + response = NewCreatePrometheusAlertPolicyResponse() + err = c.Send(request, response) + return +} + func NewCreatePrometheusAlertRuleRequest() (request *CreatePrometheusAlertRuleRequest) { request = &CreatePrometheusAlertRuleRequest{ BaseRequest: &tchttp.BaseRequest{}, @@ -1417,6 +1469,7 @@ func NewCreatePrometheusDashboardResponse() (response *CreatePrometheusDashboard // INTERNALERROR_PARAM = "InternalError.Param" // INTERNALERROR_UNEXPECTEDINTERNAL = "InternalError.UnexpectedInternal" // INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETER_CLUSTERNOTFOUND = "InvalidParameter.ClusterNotFound" // INVALIDPARAMETER_PARAM = "InvalidParameter.Param" // INVALIDPARAMETER_PROMINSTANCENOTFOUND = "InvalidParameter.PromInstanceNotFound" func (c *Client) CreatePrometheusDashboard(request *CreatePrometheusDashboardRequest) (response *CreatePrometheusDashboardResponse, err error) { @@ -1431,6 +1484,7 @@ func (c *Client) CreatePrometheusDashboard(request *CreatePrometheusDashboardReq // INTERNALERROR_PARAM = "InternalError.Param" // INTERNALERROR_UNEXPECTEDINTERNAL = "InternalError.UnexpectedInternal" // INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETER_CLUSTERNOTFOUND = "InvalidParameter.ClusterNotFound" // INVALIDPARAMETER_PARAM = "InvalidParameter.Param" // INVALIDPARAMETER_PROMINSTANCENOTFOUND = "InvalidParameter.PromInstanceNotFound" func (c *Client) CreatePrometheusDashboardWithContext(ctx context.Context, request *CreatePrometheusDashboardRequest) (response *CreatePrometheusDashboardResponse, err error) { @@ -1449,6 +1503,57 @@ func (c *Client) CreatePrometheusDashboardWithContext(ctx context.Context, reque return } +func NewCreatePrometheusTempRequest() (request *CreatePrometheusTempRequest) { + request = &CreatePrometheusTempRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + request.Init().WithApiInfo("tke", APIVersion, "CreatePrometheusTemp") + + + return +} + +func NewCreatePrometheusTempResponse() (response *CreatePrometheusTempResponse) { + response = &CreatePrometheusTempResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return +} + +// CreatePrometheusTemp +// 创建一个云原生Prometheus模板 +// +// 可能返回的错误码: +// INTERNALERROR = "InternalError" +// INTERNALERROR_PARAM = "InternalError.Param" +// INVALIDPARAMETER_PARAM = "InvalidParameter.Param" +func (c *Client) CreatePrometheusTemp(request *CreatePrometheusTempRequest) (response *CreatePrometheusTempResponse, err error) { + return c.CreatePrometheusTempWithContext(context.Background(), request) +} + +// CreatePrometheusTemp +// 创建一个云原生Prometheus模板 +// +// 可能返回的错误码: +// INTERNALERROR = "InternalError" +// INTERNALERROR_PARAM = "InternalError.Param" +// INVALIDPARAMETER_PARAM = "InvalidParameter.Param" +func (c *Client) CreatePrometheusTempWithContext(ctx context.Context, request *CreatePrometheusTempRequest) (response *CreatePrometheusTempResponse, err error) { + if request == nil { + request = NewCreatePrometheusTempRequest() + } + + if c.GetCredential() == nil { + return nil, errors.New("CreatePrometheusTemp require credential") + } + + request.SetContext(ctx) + + response = NewCreatePrometheusTempResponse() + err = c.Send(request, response) + return +} + func NewCreatePrometheusTemplateRequest() (request *CreatePrometheusTemplateRequest) { request = &CreatePrometheusTemplateRequest{ BaseRequest: &tchttp.BaseRequest{}, @@ -1522,6 +1627,10 @@ func NewDeleteClusterResponse() (response *DeleteClusterResponse) { // // 可能返回的错误码: // FAILEDOPERATION = "FailedOperation" +// FAILEDOPERATION_CLUSTERNOTFOUND = "FailedOperation.ClusterNotFound" +// FAILEDOPERATION_CLUSTERSTATE = "FailedOperation.ClusterState" +// FAILEDOPERATION_COMPONENTCLINETHTTP = "FailedOperation.ComponentClinetHttp" +// FAILEDOPERATION_PARAM = "FailedOperation.Param" // INTERNALERROR = "InternalError" // INTERNALERROR_CAMNOAUTH = "InternalError.CamNoAuth" // INTERNALERROR_CLUSTERNOTFOUND = "InternalError.ClusterNotFound" @@ -1543,6 +1652,10 @@ func (c *Client) DeleteCluster(request *DeleteClusterRequest) (response *DeleteC // // 可能返回的错误码: // FAILEDOPERATION = "FailedOperation" +// FAILEDOPERATION_CLUSTERNOTFOUND = "FailedOperation.ClusterNotFound" +// FAILEDOPERATION_CLUSTERSTATE = "FailedOperation.ClusterState" +// FAILEDOPERATION_COMPONENTCLINETHTTP = "FailedOperation.ComponentClinetHttp" +// FAILEDOPERATION_PARAM = "FailedOperation.Param" // INTERNALERROR = "InternalError" // INTERNALERROR_CAMNOAUTH = "InternalError.CamNoAuth" // INTERNALERROR_CLUSTERNOTFOUND = "InternalError.ClusterNotFound" @@ -1593,6 +1706,8 @@ func NewDeleteClusterAsGroupsResponse() (response *DeleteClusterAsGroupsResponse // // 可能返回的错误码: // FAILEDOPERATION = "FailedOperation" +// FAILEDOPERATION_CLUSTERSTATE = "FailedOperation.ClusterState" +// FAILEDOPERATION_PARAM = "FailedOperation.Param" // INTERNALERROR = "InternalError" // INTERNALERROR_ACCOUNTUSERNOTAUTHENTICATED = "InternalError.AccountUserNotAuthenticated" // INTERNALERROR_ASCOMMON = "InternalError.AsCommon" @@ -1618,6 +1733,8 @@ func (c *Client) DeleteClusterAsGroups(request *DeleteClusterAsGroupsRequest) (r // // 可能返回的错误码: // FAILEDOPERATION = "FailedOperation" +// FAILEDOPERATION_CLUSTERSTATE = "FailedOperation.ClusterState" +// FAILEDOPERATION_PARAM = "FailedOperation.Param" // INTERNALERROR = "InternalError" // INTERNALERROR_ACCOUNTUSERNOTAUTHENTICATED = "InternalError.AccountUserNotAuthenticated" // INTERNALERROR_ASCOMMON = "InternalError.AsCommon" @@ -1843,6 +1960,9 @@ func NewDeleteClusterInstancesResponse() (response *DeleteClusterInstancesRespon // 删除集群中的实例 // // 可能返回的错误码: +// FAILEDOPERATION_ASCOMMON = "FailedOperation.AsCommon" +// FAILEDOPERATION_CLUSTERNOTFOUND = "FailedOperation.ClusterNotFound" +// FAILEDOPERATION_PARAM = "FailedOperation.Param" // INTERNALERROR = "InternalError" // INTERNALERROR_ASCOMMON = "InternalError.AsCommon" // INTERNALERROR_CLUSTERNOTFOUND = "InternalError.ClusterNotFound" @@ -1862,6 +1982,9 @@ func (c *Client) DeleteClusterInstances(request *DeleteClusterInstancesRequest) // 删除集群中的实例 // // 可能返回的错误码: +// FAILEDOPERATION_ASCOMMON = "FailedOperation.AsCommon" +// FAILEDOPERATION_CLUSTERNOTFOUND = "FailedOperation.ClusterNotFound" +// FAILEDOPERATION_PARAM = "FailedOperation.Param" // INTERNALERROR = "InternalError" // INTERNALERROR_ASCOMMON = "InternalError.AsCommon" // INTERNALERROR_CLUSTERNOTFOUND = "InternalError.ClusterNotFound" @@ -1913,6 +2036,7 @@ func NewDeleteClusterNodePoolResponse() (response *DeleteClusterNodePoolResponse // INTERNALERROR_DB = "InternalError.Db" // INTERNALERROR_DBRECORDNOTFOUND = "InternalError.DbRecordNotFound" // INVALIDPARAMETER_PARAM = "InvalidParameter.Param" +// RESOURCENOTFOUND = "ResourceNotFound" func (c *Client) DeleteClusterNodePool(request *DeleteClusterNodePoolRequest) (response *DeleteClusterNodePoolResponse, err error) { return c.DeleteClusterNodePoolWithContext(context.Background(), request) } @@ -1924,6 +2048,7 @@ func (c *Client) DeleteClusterNodePool(request *DeleteClusterNodePoolRequest) (r // INTERNALERROR_DB = "InternalError.Db" // INTERNALERROR_DBRECORDNOTFOUND = "InternalError.DbRecordNotFound" // INVALIDPARAMETER_PARAM = "InvalidParameter.Param" +// RESOURCENOTFOUND = "ResourceNotFound" func (c *Client) DeleteClusterNodePoolWithContext(ctx context.Context, request *DeleteClusterNodePoolRequest) (response *DeleteClusterNodePoolResponse, err error) { if request == nil { request = NewDeleteClusterNodePoolRequest() @@ -2235,6 +2360,59 @@ func (c *Client) DeleteImageCachesWithContext(ctx context.Context, request *Dele return } +func NewDeletePrometheusAlertPolicyRequest() (request *DeletePrometheusAlertPolicyRequest) { + request = &DeletePrometheusAlertPolicyRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + request.Init().WithApiInfo("tke", APIVersion, "DeletePrometheusAlertPolicy") + + + return +} + +func NewDeletePrometheusAlertPolicyResponse() (response *DeletePrometheusAlertPolicyResponse) { + response = &DeletePrometheusAlertPolicyResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return +} + +// DeletePrometheusAlertPolicy +// 删除2.0实例告警策略 +// +// 可能返回的错误码: +// INTERNALERROR = "InternalError" +// INTERNALERROR_PARAM = "InternalError.Param" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETER_PROMINSTANCENOTFOUND = "InvalidParameter.PromInstanceNotFound" +func (c *Client) DeletePrometheusAlertPolicy(request *DeletePrometheusAlertPolicyRequest) (response *DeletePrometheusAlertPolicyResponse, err error) { + return c.DeletePrometheusAlertPolicyWithContext(context.Background(), request) +} + +// DeletePrometheusAlertPolicy +// 删除2.0实例告警策略 +// +// 可能返回的错误码: +// INTERNALERROR = "InternalError" +// INTERNALERROR_PARAM = "InternalError.Param" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETER_PROMINSTANCENOTFOUND = "InvalidParameter.PromInstanceNotFound" +func (c *Client) DeletePrometheusAlertPolicyWithContext(ctx context.Context, request *DeletePrometheusAlertPolicyRequest) (response *DeletePrometheusAlertPolicyResponse, err error) { + if request == nil { + request = NewDeletePrometheusAlertPolicyRequest() + } + + if c.GetCredential() == nil { + return nil, errors.New("DeletePrometheusAlertPolicy require credential") + } + + request.SetContext(ctx) + + response = NewDeletePrometheusAlertPolicyResponse() + err = c.Send(request, response) + return +} + func NewDeletePrometheusAlertRuleRequest() (request *DeletePrometheusAlertRuleRequest) { request = &DeletePrometheusAlertRuleRequest{ BaseRequest: &tchttp.BaseRequest{}, @@ -2288,24 +2466,24 @@ func (c *Client) DeletePrometheusAlertRuleWithContext(ctx context.Context, reque return } -func NewDeletePrometheusTemplateRequest() (request *DeletePrometheusTemplateRequest) { - request = &DeletePrometheusTemplateRequest{ +func NewDeletePrometheusTempRequest() (request *DeletePrometheusTempRequest) { + request = &DeletePrometheusTempRequest{ BaseRequest: &tchttp.BaseRequest{}, } - request.Init().WithApiInfo("tke", APIVersion, "DeletePrometheusTemplate") + request.Init().WithApiInfo("tke", APIVersion, "DeletePrometheusTemp") return } -func NewDeletePrometheusTemplateResponse() (response *DeletePrometheusTemplateResponse) { - response = &DeletePrometheusTemplateResponse{ +func NewDeletePrometheusTempResponse() (response *DeletePrometheusTempResponse) { + response = &DeletePrometheusTempResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } -// DeletePrometheusTemplate +// DeletePrometheusTemp // 删除一个云原生Prometheus配置模板 // // 可能返回的错误码: @@ -2314,11 +2492,11 @@ func NewDeletePrometheusTemplateResponse() (response *DeletePrometheusTemplateRe // INTERNALERROR_UNEXPECTEDINTERNAL = "InternalError.UnexpectedInternal" // INVALIDPARAMETER_PARAM = "InvalidParameter.Param" // INVALIDPARAMETER_RESOURCENOTFOUND = "InvalidParameter.ResourceNotFound" -func (c *Client) DeletePrometheusTemplate(request *DeletePrometheusTemplateRequest) (response *DeletePrometheusTemplateResponse, err error) { - return c.DeletePrometheusTemplateWithContext(context.Background(), request) +func (c *Client) DeletePrometheusTemp(request *DeletePrometheusTempRequest) (response *DeletePrometheusTempResponse, err error) { + return c.DeletePrometheusTempWithContext(context.Background(), request) } -// DeletePrometheusTemplate +// DeletePrometheusTemp // 删除一个云原生Prometheus配置模板 // // 可能返回的错误码: @@ -2327,41 +2505,41 @@ func (c *Client) DeletePrometheusTemplate(request *DeletePrometheusTemplateReque // INTERNALERROR_UNEXPECTEDINTERNAL = "InternalError.UnexpectedInternal" // INVALIDPARAMETER_PARAM = "InvalidParameter.Param" // INVALIDPARAMETER_RESOURCENOTFOUND = "InvalidParameter.ResourceNotFound" -func (c *Client) DeletePrometheusTemplateWithContext(ctx context.Context, request *DeletePrometheusTemplateRequest) (response *DeletePrometheusTemplateResponse, err error) { +func (c *Client) DeletePrometheusTempWithContext(ctx context.Context, request *DeletePrometheusTempRequest) (response *DeletePrometheusTempResponse, err error) { if request == nil { - request = NewDeletePrometheusTemplateRequest() + request = NewDeletePrometheusTempRequest() } if c.GetCredential() == nil { - return nil, errors.New("DeletePrometheusTemplate require credential") + return nil, errors.New("DeletePrometheusTemp require credential") } request.SetContext(ctx) - response = NewDeletePrometheusTemplateResponse() + response = NewDeletePrometheusTempResponse() err = c.Send(request, response) return } -func NewDeletePrometheusTemplateSyncRequest() (request *DeletePrometheusTemplateSyncRequest) { - request = &DeletePrometheusTemplateSyncRequest{ +func NewDeletePrometheusTempSyncRequest() (request *DeletePrometheusTempSyncRequest) { + request = &DeletePrometheusTempSyncRequest{ BaseRequest: &tchttp.BaseRequest{}, } - request.Init().WithApiInfo("tke", APIVersion, "DeletePrometheusTemplateSync") + request.Init().WithApiInfo("tke", APIVersion, "DeletePrometheusTempSync") return } -func NewDeletePrometheusTemplateSyncResponse() (response *DeletePrometheusTemplateSyncResponse) { - response = &DeletePrometheusTemplateSyncResponse{ +func NewDeletePrometheusTempSyncResponse() (response *DeletePrometheusTempSyncResponse) { + response = &DeletePrometheusTempSyncResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } -// DeletePrometheusTemplateSync -// 取消模板同步,这将会删除目标中该模板所生产的配置 +// DeletePrometheusTempSync +// 解除模板同步,这将会删除目标中该模板所生产的配置,针对V2版本实例 // // 可能返回的错误码: // INTERNALERROR = "InternalError" @@ -2371,12 +2549,12 @@ func NewDeletePrometheusTemplateSyncResponse() (response *DeletePrometheusTempla // INTERNALERROR_UNEXPECTEDINTERNAL = "InternalError.UnexpectedInternal" // INVALIDPARAMETER_PARAM = "InvalidParameter.Param" // INVALIDPARAMETER_RESOURCENOTFOUND = "InvalidParameter.ResourceNotFound" -func (c *Client) DeletePrometheusTemplateSync(request *DeletePrometheusTemplateSyncRequest) (response *DeletePrometheusTemplateSyncResponse, err error) { - return c.DeletePrometheusTemplateSyncWithContext(context.Background(), request) +func (c *Client) DeletePrometheusTempSync(request *DeletePrometheusTempSyncRequest) (response *DeletePrometheusTempSyncResponse, err error) { + return c.DeletePrometheusTempSyncWithContext(context.Background(), request) } -// DeletePrometheusTemplateSync -// 取消模板同步,这将会删除目标中该模板所生产的配置 +// DeletePrometheusTempSync +// 解除模板同步,这将会删除目标中该模板所生产的配置,针对V2版本实例 // // 可能返回的错误码: // INTERNALERROR = "InternalError" @@ -2386,68 +2564,184 @@ func (c *Client) DeletePrometheusTemplateSync(request *DeletePrometheusTemplateS // INTERNALERROR_UNEXPECTEDINTERNAL = "InternalError.UnexpectedInternal" // INVALIDPARAMETER_PARAM = "InvalidParameter.Param" // INVALIDPARAMETER_RESOURCENOTFOUND = "InvalidParameter.ResourceNotFound" -func (c *Client) DeletePrometheusTemplateSyncWithContext(ctx context.Context, request *DeletePrometheusTemplateSyncRequest) (response *DeletePrometheusTemplateSyncResponse, err error) { +func (c *Client) DeletePrometheusTempSyncWithContext(ctx context.Context, request *DeletePrometheusTempSyncRequest) (response *DeletePrometheusTempSyncResponse, err error) { if request == nil { - request = NewDeletePrometheusTemplateSyncRequest() + request = NewDeletePrometheusTempSyncRequest() } if c.GetCredential() == nil { - return nil, errors.New("DeletePrometheusTemplateSync require credential") + return nil, errors.New("DeletePrometheusTempSync require credential") } request.SetContext(ctx) - response = NewDeletePrometheusTemplateSyncResponse() + response = NewDeletePrometheusTempSyncResponse() err = c.Send(request, response) return } -func NewDescribeAvailableClusterVersionRequest() (request *DescribeAvailableClusterVersionRequest) { - request = &DescribeAvailableClusterVersionRequest{ +func NewDeletePrometheusTemplateRequest() (request *DeletePrometheusTemplateRequest) { + request = &DeletePrometheusTemplateRequest{ BaseRequest: &tchttp.BaseRequest{}, } - request.Init().WithApiInfo("tke", APIVersion, "DescribeAvailableClusterVersion") + request.Init().WithApiInfo("tke", APIVersion, "DeletePrometheusTemplate") return } -func NewDescribeAvailableClusterVersionResponse() (response *DescribeAvailableClusterVersionResponse) { - response = &DescribeAvailableClusterVersionResponse{ +func NewDeletePrometheusTemplateResponse() (response *DeletePrometheusTemplateResponse) { + response = &DeletePrometheusTemplateResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } -// DescribeAvailableClusterVersion -// 获取集群可以升级的所有版本 +// DeletePrometheusTemplate +// 删除一个云原生Prometheus配置模板 // // 可能返回的错误码: // INTERNALERROR = "InternalError" // INTERNALERROR_PARAM = "InternalError.Param" // INTERNALERROR_UNEXPECTEDINTERNAL = "InternalError.UnexpectedInternal" -// INVALIDPARAMETER = "InvalidParameter" // INVALIDPARAMETER_PARAM = "InvalidParameter.Param" -// RESOURCENOTFOUND = "ResourceNotFound" -// RESOURCENOTFOUND_CLUSTERNOTFOUND = "ResourceNotFound.ClusterNotFound" -func (c *Client) DescribeAvailableClusterVersion(request *DescribeAvailableClusterVersionRequest) (response *DescribeAvailableClusterVersionResponse, err error) { - return c.DescribeAvailableClusterVersionWithContext(context.Background(), request) +// INVALIDPARAMETER_RESOURCENOTFOUND = "InvalidParameter.ResourceNotFound" +func (c *Client) DeletePrometheusTemplate(request *DeletePrometheusTemplateRequest) (response *DeletePrometheusTemplateResponse, err error) { + return c.DeletePrometheusTemplateWithContext(context.Background(), request) } -// DescribeAvailableClusterVersion -// 获取集群可以升级的所有版本 +// DeletePrometheusTemplate +// 删除一个云原生Prometheus配置模板 // // 可能返回的错误码: // INTERNALERROR = "InternalError" // INTERNALERROR_PARAM = "InternalError.Param" // INTERNALERROR_UNEXPECTEDINTERNAL = "InternalError.UnexpectedInternal" -// INVALIDPARAMETER = "InvalidParameter" // INVALIDPARAMETER_PARAM = "InvalidParameter.Param" -// RESOURCENOTFOUND = "ResourceNotFound" -// RESOURCENOTFOUND_CLUSTERNOTFOUND = "ResourceNotFound.ClusterNotFound" -func (c *Client) DescribeAvailableClusterVersionWithContext(ctx context.Context, request *DescribeAvailableClusterVersionRequest) (response *DescribeAvailableClusterVersionResponse, err error) { +// INVALIDPARAMETER_RESOURCENOTFOUND = "InvalidParameter.ResourceNotFound" +func (c *Client) DeletePrometheusTemplateWithContext(ctx context.Context, request *DeletePrometheusTemplateRequest) (response *DeletePrometheusTemplateResponse, err error) { if request == nil { - request = NewDescribeAvailableClusterVersionRequest() + request = NewDeletePrometheusTemplateRequest() + } + + if c.GetCredential() == nil { + return nil, errors.New("DeletePrometheusTemplate require credential") + } + + request.SetContext(ctx) + + response = NewDeletePrometheusTemplateResponse() + err = c.Send(request, response) + return +} + +func NewDeletePrometheusTemplateSyncRequest() (request *DeletePrometheusTemplateSyncRequest) { + request = &DeletePrometheusTemplateSyncRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + request.Init().WithApiInfo("tke", APIVersion, "DeletePrometheusTemplateSync") + + + return +} + +func NewDeletePrometheusTemplateSyncResponse() (response *DeletePrometheusTemplateSyncResponse) { + response = &DeletePrometheusTemplateSyncResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return +} + +// DeletePrometheusTemplateSync +// 取消模板同步,这将会删除目标中该模板所生产的配置 +// +// 可能返回的错误码: +// INTERNALERROR = "InternalError" +// INTERNALERROR_DB = "InternalError.Db" +// INTERNALERROR_DBRECORDNOTFOUND = "InternalError.DbRecordNotFound" +// INTERNALERROR_PARAM = "InternalError.Param" +// INTERNALERROR_UNEXPECTEDINTERNAL = "InternalError.UnexpectedInternal" +// INVALIDPARAMETER_PARAM = "InvalidParameter.Param" +// INVALIDPARAMETER_RESOURCENOTFOUND = "InvalidParameter.ResourceNotFound" +func (c *Client) DeletePrometheusTemplateSync(request *DeletePrometheusTemplateSyncRequest) (response *DeletePrometheusTemplateSyncResponse, err error) { + return c.DeletePrometheusTemplateSyncWithContext(context.Background(), request) +} + +// DeletePrometheusTemplateSync +// 取消模板同步,这将会删除目标中该模板所生产的配置 +// +// 可能返回的错误码: +// INTERNALERROR = "InternalError" +// INTERNALERROR_DB = "InternalError.Db" +// INTERNALERROR_DBRECORDNOTFOUND = "InternalError.DbRecordNotFound" +// INTERNALERROR_PARAM = "InternalError.Param" +// INTERNALERROR_UNEXPECTEDINTERNAL = "InternalError.UnexpectedInternal" +// INVALIDPARAMETER_PARAM = "InvalidParameter.Param" +// INVALIDPARAMETER_RESOURCENOTFOUND = "InvalidParameter.ResourceNotFound" +func (c *Client) DeletePrometheusTemplateSyncWithContext(ctx context.Context, request *DeletePrometheusTemplateSyncRequest) (response *DeletePrometheusTemplateSyncResponse, err error) { + if request == nil { + request = NewDeletePrometheusTemplateSyncRequest() + } + + if c.GetCredential() == nil { + return nil, errors.New("DeletePrometheusTemplateSync require credential") + } + + request.SetContext(ctx) + + response = NewDeletePrometheusTemplateSyncResponse() + err = c.Send(request, response) + return +} + +func NewDescribeAvailableClusterVersionRequest() (request *DescribeAvailableClusterVersionRequest) { + request = &DescribeAvailableClusterVersionRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + request.Init().WithApiInfo("tke", APIVersion, "DescribeAvailableClusterVersion") + + + return +} + +func NewDescribeAvailableClusterVersionResponse() (response *DescribeAvailableClusterVersionResponse) { + response = &DescribeAvailableClusterVersionResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return +} + +// DescribeAvailableClusterVersion +// 获取集群可以升级的所有版本 +// +// 可能返回的错误码: +// INTERNALERROR = "InternalError" +// INTERNALERROR_PARAM = "InternalError.Param" +// INTERNALERROR_UNEXPECTEDINTERNAL = "InternalError.UnexpectedInternal" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETER_PARAM = "InvalidParameter.Param" +// RESOURCENOTFOUND = "ResourceNotFound" +// RESOURCENOTFOUND_CLUSTERNOTFOUND = "ResourceNotFound.ClusterNotFound" +// RESOURCEUNAVAILABLE_CLUSTERINABNORMALSTAT = "ResourceUnavailable.ClusterInAbnormalStat" +func (c *Client) DescribeAvailableClusterVersion(request *DescribeAvailableClusterVersionRequest) (response *DescribeAvailableClusterVersionResponse, err error) { + return c.DescribeAvailableClusterVersionWithContext(context.Background(), request) +} + +// DescribeAvailableClusterVersion +// 获取集群可以升级的所有版本 +// +// 可能返回的错误码: +// INTERNALERROR = "InternalError" +// INTERNALERROR_PARAM = "InternalError.Param" +// INTERNALERROR_UNEXPECTEDINTERNAL = "InternalError.UnexpectedInternal" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETER_PARAM = "InvalidParameter.Param" +// RESOURCENOTFOUND = "ResourceNotFound" +// RESOURCENOTFOUND_CLUSTERNOTFOUND = "ResourceNotFound.ClusterNotFound" +// RESOURCEUNAVAILABLE_CLUSTERINABNORMALSTAT = "ResourceUnavailable.ClusterInAbnormalStat" +func (c *Client) DescribeAvailableClusterVersionWithContext(ctx context.Context, request *DescribeAvailableClusterVersionRequest) (response *DescribeAvailableClusterVersionResponse, err error) { + if request == nil { + request = NewDescribeAvailableClusterVersionRequest() } if c.GetCredential() == nil { @@ -2483,6 +2777,8 @@ func NewDescribeClusterAsGroupOptionResponse() (response *DescribeClusterAsGroup // // 可能返回的错误码: // FAILEDOPERATION = "FailedOperation" +// FAILEDOPERATION_CLUSTERNOTFOUND = "FailedOperation.ClusterNotFound" +// FAILEDOPERATION_CLUSTERSTATE = "FailedOperation.ClusterState" // INTERNALERROR = "InternalError" // INTERNALERROR_ACCOUNTUSERNOTAUTHENTICATED = "InternalError.AccountUserNotAuthenticated" // INTERNALERROR_ASCOMMON = "InternalError.AsCommon" @@ -2502,6 +2798,8 @@ func (c *Client) DescribeClusterAsGroupOption(request *DescribeClusterAsGroupOpt // // 可能返回的错误码: // FAILEDOPERATION = "FailedOperation" +// FAILEDOPERATION_CLUSTERNOTFOUND = "FailedOperation.ClusterNotFound" +// FAILEDOPERATION_CLUSTERSTATE = "FailedOperation.ClusterState" // INTERNALERROR = "InternalError" // INTERNALERROR_ACCOUNTUSERNOTAUTHENTICATED = "InternalError.AccountUserNotAuthenticated" // INTERNALERROR_ASCOMMON = "InternalError.AsCommon" @@ -2550,6 +2848,9 @@ func NewDescribeClusterAsGroupsResponse() (response *DescribeClusterAsGroupsResp // // 可能返回的错误码: // FAILEDOPERATION = "FailedOperation" +// FAILEDOPERATION_CLUSTERNOTFOUND = "FailedOperation.ClusterNotFound" +// FAILEDOPERATION_CLUSTERSTATE = "FailedOperation.ClusterState" +// FAILEDOPERATION_PARAM = "FailedOperation.Param" // INTERNALERROR = "InternalError" // INTERNALERROR_ACCOUNTUSERNOTAUTHENTICATED = "InternalError.AccountUserNotAuthenticated" // INTERNALERROR_ASCOMMON = "InternalError.AsCommon" @@ -2571,6 +2872,9 @@ func (c *Client) DescribeClusterAsGroups(request *DescribeClusterAsGroupsRequest // // 可能返回的错误码: // FAILEDOPERATION = "FailedOperation" +// FAILEDOPERATION_CLUSTERNOTFOUND = "FailedOperation.ClusterNotFound" +// FAILEDOPERATION_CLUSTERSTATE = "FailedOperation.ClusterState" +// FAILEDOPERATION_PARAM = "FailedOperation.Param" // INTERNALERROR = "InternalError" // INTERNALERROR_ACCOUNTUSERNOTAUTHENTICATED = "InternalError.AccountUserNotAuthenticated" // INTERNALERROR_ASCOMMON = "InternalError.AsCommon" @@ -2678,6 +2982,7 @@ func NewDescribeClusterCommonNamesResponse() (response *DescribeClusterCommonNam // INTERNALERROR_WHITELISTUNEXPECTEDERROR = "InternalError.WhitelistUnexpectedError" // INVALIDPARAMETER = "InvalidParameter" // INVALIDPARAMETER_PARAM = "InvalidParameter.Param" +// RESOURCENOTFOUND = "ResourceNotFound" // RESOURCENOTFOUND_CLUSTERNOTFOUND = "ResourceNotFound.ClusterNotFound" // RESOURCEUNAVAILABLE_CLUSTERSTATE = "ResourceUnavailable.ClusterState" // UNAUTHORIZEDOPERATION_CAMNOAUTH = "UnauthorizedOperation.CamNoAuth" @@ -2695,6 +3000,7 @@ func (c *Client) DescribeClusterCommonNames(request *DescribeClusterCommonNamesR // INTERNALERROR_WHITELISTUNEXPECTEDERROR = "InternalError.WhitelistUnexpectedError" // INVALIDPARAMETER = "InvalidParameter" // INVALIDPARAMETER_PARAM = "InvalidParameter.Param" +// RESOURCENOTFOUND = "ResourceNotFound" // RESOURCENOTFOUND_CLUSTERNOTFOUND = "ResourceNotFound.ClusterNotFound" // RESOURCEUNAVAILABLE_CLUSTERSTATE = "ResourceUnavailable.ClusterState" // UNAUTHORIZEDOPERATION_CAMNOAUTH = "UnauthorizedOperation.CamNoAuth" @@ -2792,6 +3098,8 @@ func NewDescribeClusterEndpointStatusResponse() (response *DescribeClusterEndpoi // // 可能返回的错误码: // FAILEDOPERATION = "FailedOperation" +// FAILEDOPERATION_KUBECLIENTCONNECTION = "FailedOperation.KubeClientConnection" +// FAILEDOPERATION_KUBERNETESINTERNAL = "FailedOperation.KubernetesInternal" // INTERNALERROR = "InternalError" // INTERNALERROR_CAMNOAUTH = "InternalError.CamNoAuth" // INTERNALERROR_CLUSTERNOTFOUND = "InternalError.ClusterNotFound" @@ -2822,6 +3130,8 @@ func (c *Client) DescribeClusterEndpointStatus(request *DescribeClusterEndpointS // // 可能返回的错误码: // FAILEDOPERATION = "FailedOperation" +// FAILEDOPERATION_KUBECLIENTCONNECTION = "FailedOperation.KubeClientConnection" +// FAILEDOPERATION_KUBERNETESINTERNAL = "FailedOperation.KubernetesInternal" // INTERNALERROR = "InternalError" // INTERNALERROR_CAMNOAUTH = "InternalError.CamNoAuth" // INTERNALERROR_CLUSTERNOTFOUND = "InternalError.ClusterNotFound" @@ -3036,6 +3346,7 @@ func NewDescribeClusterKubeconfigResponse() (response *DescribeClusterKubeconfig // 获取集群的kubeconfig文件,不同子账户获取自己的kubeconfig文件,该文件中有每个子账户自己的kube-apiserver的客户端证书,默认首次调此接口时候创建客户端证书,时效20年,未授予任何权限,如果是集群所有者或者主账户,则默认是cluster-admin权限。 // // 可能返回的错误码: +// FAILEDOPERATION_COMPONENTCLIENTHTTP = "FailedOperation.ComponentClientHttp" // INTERNALERROR = "InternalError" // INTERNALERROR_CAMNOAUTH = "InternalError.CamNoAuth" // INTERNALERROR_COMPONENTCLIENTHTTP = "InternalError.ComponentClientHttp" @@ -3052,6 +3363,7 @@ func NewDescribeClusterKubeconfigResponse() (response *DescribeClusterKubeconfig // RESOURCENOTFOUND = "ResourceNotFound" // RESOURCENOTFOUND_CLUSTERNOTFOUND = "ResourceNotFound.ClusterNotFound" // RESOURCENOTFOUND_KUBERNETESRESOURCENOTFOUND = "ResourceNotFound.KubernetesResourceNotFound" +// RESOURCEUNAVAILABLE_CLUSTERINABNORMALSTAT = "ResourceUnavailable.ClusterInAbnormalStat" // UNAUTHORIZEDOPERATION_CAMNOAUTH = "UnauthorizedOperation.CamNoAuth" func (c *Client) DescribeClusterKubeconfig(request *DescribeClusterKubeconfigRequest) (response *DescribeClusterKubeconfigResponse, err error) { return c.DescribeClusterKubeconfigWithContext(context.Background(), request) @@ -3061,6 +3373,7 @@ func (c *Client) DescribeClusterKubeconfig(request *DescribeClusterKubeconfigReq // 获取集群的kubeconfig文件,不同子账户获取自己的kubeconfig文件,该文件中有每个子账户自己的kube-apiserver的客户端证书,默认首次调此接口时候创建客户端证书,时效20年,未授予任何权限,如果是集群所有者或者主账户,则默认是cluster-admin权限。 // // 可能返回的错误码: +// FAILEDOPERATION_COMPONENTCLIENTHTTP = "FailedOperation.ComponentClientHttp" // INTERNALERROR = "InternalError" // INTERNALERROR_CAMNOAUTH = "InternalError.CamNoAuth" // INTERNALERROR_COMPONENTCLIENTHTTP = "InternalError.ComponentClientHttp" @@ -3077,6 +3390,7 @@ func (c *Client) DescribeClusterKubeconfig(request *DescribeClusterKubeconfigReq // RESOURCENOTFOUND = "ResourceNotFound" // RESOURCENOTFOUND_CLUSTERNOTFOUND = "ResourceNotFound.ClusterNotFound" // RESOURCENOTFOUND_KUBERNETESRESOURCENOTFOUND = "ResourceNotFound.KubernetesResourceNotFound" +// RESOURCEUNAVAILABLE_CLUSTERINABNORMALSTAT = "ResourceUnavailable.ClusterInAbnormalStat" // UNAUTHORIZEDOPERATION_CAMNOAUTH = "UnauthorizedOperation.CamNoAuth" func (c *Client) DescribeClusterKubeconfigWithContext(ctx context.Context, request *DescribeClusterKubeconfigRequest) (response *DescribeClusterKubeconfigResponse, err error) { if request == nil { @@ -3117,6 +3431,8 @@ func NewDescribeClusterLevelAttributeResponse() (response *DescribeClusterLevelA // 可能返回的错误码: // INTERNALERROR_UNEXPECTEDINTERNAL = "InternalError.UnexpectedInternal" // INVALIDPARAMETER_PARAM = "InvalidParameter.Param" +// RESOURCENOTFOUND = "ResourceNotFound" +// RESOURCEUNAVAILABLE = "ResourceUnavailable" func (c *Client) DescribeClusterLevelAttribute(request *DescribeClusterLevelAttributeRequest) (response *DescribeClusterLevelAttributeResponse, err error) { return c.DescribeClusterLevelAttributeWithContext(context.Background(), request) } @@ -3127,6 +3443,8 @@ func (c *Client) DescribeClusterLevelAttribute(request *DescribeClusterLevelAttr // 可能返回的错误码: // INTERNALERROR_UNEXPECTEDINTERNAL = "InternalError.UnexpectedInternal" // INVALIDPARAMETER_PARAM = "InvalidParameter.Param" +// RESOURCENOTFOUND = "ResourceNotFound" +// RESOURCEUNAVAILABLE = "ResourceUnavailable" func (c *Client) DescribeClusterLevelAttributeWithContext(ctx context.Context, request *DescribeClusterLevelAttributeRequest) (response *DescribeClusterLevelAttributeResponse, err error) { if request == nil { request = NewDescribeClusterLevelAttributeRequest() @@ -3166,6 +3484,8 @@ func NewDescribeClusterLevelChangeRecordsResponse() (response *DescribeClusterLe // 可能返回的错误码: // INTERNALERROR_UNEXPECTEDINTERNAL = "InternalError.UnexpectedInternal" // INVALIDPARAMETER_PARAM = "InvalidParameter.Param" +// RESOURCENOTFOUND = "ResourceNotFound" +// RESOURCEUNAVAILABLE = "ResourceUnavailable" func (c *Client) DescribeClusterLevelChangeRecords(request *DescribeClusterLevelChangeRecordsRequest) (response *DescribeClusterLevelChangeRecordsResponse, err error) { return c.DescribeClusterLevelChangeRecordsWithContext(context.Background(), request) } @@ -3176,6 +3496,8 @@ func (c *Client) DescribeClusterLevelChangeRecords(request *DescribeClusterLevel // 可能返回的错误码: // INTERNALERROR_UNEXPECTEDINTERNAL = "InternalError.UnexpectedInternal" // INVALIDPARAMETER_PARAM = "InvalidParameter.Param" +// RESOURCENOTFOUND = "ResourceNotFound" +// RESOURCEUNAVAILABLE = "ResourceUnavailable" func (c *Client) DescribeClusterLevelChangeRecordsWithContext(ctx context.Context, request *DescribeClusterLevelChangeRecordsRequest) (response *DescribeClusterLevelChangeRecordsResponse, err error) { if request == nil { request = NewDescribeClusterLevelChangeRecordsRequest() @@ -3422,6 +3744,10 @@ func NewDescribeClusterSecurityResponse() (response *DescribeClusterSecurityResp // // 可能返回的错误码: // FAILEDOPERATION = "FailedOperation" +// FAILEDOPERATION_COMPONENTCLIENTHTTP = "FailedOperation.ComponentClientHttp" +// FAILEDOPERATION_COMPONENTCLIENTUNPACK = "FailedOperation.ComponentClientUnpack" +// FAILEDOPERATION_KUBECOMMON = "FailedOperation.KubeCommon" +// FAILEDOPERATION_LBCOMMON = "FailedOperation.LbCommon" // INTERNALERROR = "InternalError" // INTERNALERROR_ACCOUNTUSERNOTAUTHENTICATED = "InternalError.AccountUserNotAuthenticated" // INTERNALERROR_COMPONENTCLIENTHTTP = "InternalError.ComponentClientHttp" @@ -3455,6 +3781,10 @@ func (c *Client) DescribeClusterSecurity(request *DescribeClusterSecurityRequest // // 可能返回的错误码: // FAILEDOPERATION = "FailedOperation" +// FAILEDOPERATION_COMPONENTCLIENTHTTP = "FailedOperation.ComponentClientHttp" +// FAILEDOPERATION_COMPONENTCLIENTUNPACK = "FailedOperation.ComponentClientUnpack" +// FAILEDOPERATION_KUBECOMMON = "FailedOperation.KubeCommon" +// FAILEDOPERATION_LBCOMMON = "FailedOperation.LbCommon" // INTERNALERROR = "InternalError" // INTERNALERROR_ACCOUNTUSERNOTAUTHENTICATED = "InternalError.AccountUserNotAuthenticated" // INTERNALERROR_COMPONENTCLIENTHTTP = "InternalError.ComponentClientHttp" @@ -3517,6 +3847,9 @@ func NewDescribeClusterStatusResponse() (response *DescribeClusterStatusResponse // // 可能返回的错误码: // FAILEDOPERATION = "FailedOperation" +// FAILEDOPERATION_CAMNOAUTH = "FailedOperation.CamNoAuth" +// FAILEDOPERATION_COMPONENTCLIENTHTTP = "FailedOperation.ComponentClientHttp" +// FAILEDOPERATION_COMPONENTCLINETHTTP = "FailedOperation.ComponentClinetHttp" // INTERNALERROR = "InternalError" // INTERNALERROR_CAMNOAUTH = "InternalError.CamNoAuth" // INTERNALERROR_COMPONENTCLINETHTTP = "InternalError.ComponentClinetHttp" @@ -3537,6 +3870,9 @@ func (c *Client) DescribeClusterStatus(request *DescribeClusterStatusRequest) (r // // 可能返回的错误码: // FAILEDOPERATION = "FailedOperation" +// FAILEDOPERATION_CAMNOAUTH = "FailedOperation.CamNoAuth" +// FAILEDOPERATION_COMPONENTCLIENTHTTP = "FailedOperation.ComponentClientHttp" +// FAILEDOPERATION_COMPONENTCLINETHTTP = "FailedOperation.ComponentClinetHttp" // INTERNALERROR = "InternalError" // INTERNALERROR_CAMNOAUTH = "InternalError.CamNoAuth" // INTERNALERROR_COMPONENTCLINETHTTP = "InternalError.ComponentClinetHttp" @@ -4080,6 +4416,11 @@ func NewDescribeExistedInstancesResponse() (response *DescribeExistedInstancesRe // // 可能返回的错误码: // FAILEDOPERATION = "FailedOperation" +// FAILEDOPERATION_ASCOMMON = "FailedOperation.AsCommon" +// FAILEDOPERATION_CLUSTERNOTFOUND = "FailedOperation.ClusterNotFound" +// FAILEDOPERATION_CLUSTERSTATE = "FailedOperation.ClusterState" +// FAILEDOPERATION_CVMCOMMON = "FailedOperation.CvmCommon" +// FAILEDOPERATION_PARAM = "FailedOperation.Param" // INTERNALERROR = "InternalError" // INTERNALERROR_ACCOUNTUSERNOTAUTHENTICATED = "InternalError.AccountUserNotAuthenticated" // INTERNALERROR_ASCOMMON = "InternalError.AsCommon" @@ -4117,6 +4458,11 @@ func (c *Client) DescribeExistedInstances(request *DescribeExistedInstancesReque // // 可能返回的错误码: // FAILEDOPERATION = "FailedOperation" +// FAILEDOPERATION_ASCOMMON = "FailedOperation.AsCommon" +// FAILEDOPERATION_CLUSTERNOTFOUND = "FailedOperation.ClusterNotFound" +// FAILEDOPERATION_CLUSTERSTATE = "FailedOperation.ClusterState" +// FAILEDOPERATION_CVMCOMMON = "FailedOperation.CvmCommon" +// FAILEDOPERATION_PARAM = "FailedOperation.Param" // INTERNALERROR = "InternalError" // INTERNALERROR_ACCOUNTUSERNOTAUTHENTICATED = "InternalError.AccountUserNotAuthenticated" // INTERNALERROR_ASCOMMON = "InternalError.AsCommon" @@ -4535,25 +4881,25 @@ func (c *Client) DescribePrometheusAlertHistoryWithContext(ctx context.Context, return } -func NewDescribePrometheusAlertRuleRequest() (request *DescribePrometheusAlertRuleRequest) { - request = &DescribePrometheusAlertRuleRequest{ +func NewDescribePrometheusAlertPolicyRequest() (request *DescribePrometheusAlertPolicyRequest) { + request = &DescribePrometheusAlertPolicyRequest{ BaseRequest: &tchttp.BaseRequest{}, } - request.Init().WithApiInfo("tke", APIVersion, "DescribePrometheusAlertRule") + request.Init().WithApiInfo("tke", APIVersion, "DescribePrometheusAlertPolicy") return } -func NewDescribePrometheusAlertRuleResponse() (response *DescribePrometheusAlertRuleResponse) { - response = &DescribePrometheusAlertRuleResponse{ +func NewDescribePrometheusAlertPolicyResponse() (response *DescribePrometheusAlertPolicyResponse) { + response = &DescribePrometheusAlertPolicyResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } -// DescribePrometheusAlertRule -// 获取告警规则列表 +// DescribePrometheusAlertPolicy +// 获取2.0实例告警策略列表 // // 可能返回的错误码: // INTERNALERROR = "InternalError" @@ -4561,15 +4907,14 @@ func NewDescribePrometheusAlertRuleResponse() (response *DescribePrometheusAlert // INTERNALERROR_PARAM = "InternalError.Param" // INTERNALERROR_UNEXPECTEDINTERNAL = "InternalError.UnexpectedInternal" // INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETER_CLUSTERNOTFOUND = "InvalidParameter.ClusterNotFound" // INVALIDPARAMETER_PARAM = "InvalidParameter.Param" // INVALIDPARAMETER_PROMINSTANCENOTFOUND = "InvalidParameter.PromInstanceNotFound" -func (c *Client) DescribePrometheusAlertRule(request *DescribePrometheusAlertRuleRequest) (response *DescribePrometheusAlertRuleResponse, err error) { - return c.DescribePrometheusAlertRuleWithContext(context.Background(), request) +func (c *Client) DescribePrometheusAlertPolicy(request *DescribePrometheusAlertPolicyRequest) (response *DescribePrometheusAlertPolicyResponse, err error) { + return c.DescribePrometheusAlertPolicyWithContext(context.Background(), request) } -// DescribePrometheusAlertRule -// 获取告警规则列表 +// DescribePrometheusAlertPolicy +// 获取2.0实例告警策略列表 // // 可能返回的错误码: // INTERNALERROR = "InternalError" @@ -4577,238 +4922,571 @@ func (c *Client) DescribePrometheusAlertRule(request *DescribePrometheusAlertRul // INTERNALERROR_PARAM = "InternalError.Param" // INTERNALERROR_UNEXPECTEDINTERNAL = "InternalError.UnexpectedInternal" // INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETER_CLUSTERNOTFOUND = "InvalidParameter.ClusterNotFound" // INVALIDPARAMETER_PARAM = "InvalidParameter.Param" // INVALIDPARAMETER_PROMINSTANCENOTFOUND = "InvalidParameter.PromInstanceNotFound" -func (c *Client) DescribePrometheusAlertRuleWithContext(ctx context.Context, request *DescribePrometheusAlertRuleRequest) (response *DescribePrometheusAlertRuleResponse, err error) { +func (c *Client) DescribePrometheusAlertPolicyWithContext(ctx context.Context, request *DescribePrometheusAlertPolicyRequest) (response *DescribePrometheusAlertPolicyResponse, err error) { if request == nil { - request = NewDescribePrometheusAlertRuleRequest() + request = NewDescribePrometheusAlertPolicyRequest() } if c.GetCredential() == nil { - return nil, errors.New("DescribePrometheusAlertRule require credential") + return nil, errors.New("DescribePrometheusAlertPolicy require credential") } request.SetContext(ctx) - response = NewDescribePrometheusAlertRuleResponse() + response = NewDescribePrometheusAlertPolicyResponse() err = c.Send(request, response) return } -func NewDescribePrometheusInstanceRequest() (request *DescribePrometheusInstanceRequest) { - request = &DescribePrometheusInstanceRequest{ +func NewDescribePrometheusAlertRuleRequest() (request *DescribePrometheusAlertRuleRequest) { + request = &DescribePrometheusAlertRuleRequest{ BaseRequest: &tchttp.BaseRequest{}, } - request.Init().WithApiInfo("tke", APIVersion, "DescribePrometheusInstance") + request.Init().WithApiInfo("tke", APIVersion, "DescribePrometheusAlertRule") return } -func NewDescribePrometheusInstanceResponse() (response *DescribePrometheusInstanceResponse) { - response = &DescribePrometheusInstanceResponse{ +func NewDescribePrometheusAlertRuleResponse() (response *DescribePrometheusAlertRuleResponse) { + response = &DescribePrometheusAlertRuleResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } -// DescribePrometheusInstance -// 获取实例详细信息 +// DescribePrometheusAlertRule +// 获取告警规则列表 // // 可能返回的错误码: // INTERNALERROR = "InternalError" -// INTERNALERROR_DB = "InternalError.Db" // INTERNALERROR_DBRECORDNOTFOUND = "InternalError.DbRecordNotFound" // INTERNALERROR_PARAM = "InternalError.Param" // INTERNALERROR_UNEXPECTEDINTERNAL = "InternalError.UnexpectedInternal" // INVALIDPARAMETER = "InvalidParameter" // INVALIDPARAMETER_CLUSTERNOTFOUND = "InvalidParameter.ClusterNotFound" +// INVALIDPARAMETER_PARAM = "InvalidParameter.Param" // INVALIDPARAMETER_PROMINSTANCENOTFOUND = "InvalidParameter.PromInstanceNotFound" -func (c *Client) DescribePrometheusInstance(request *DescribePrometheusInstanceRequest) (response *DescribePrometheusInstanceResponse, err error) { - return c.DescribePrometheusInstanceWithContext(context.Background(), request) +func (c *Client) DescribePrometheusAlertRule(request *DescribePrometheusAlertRuleRequest) (response *DescribePrometheusAlertRuleResponse, err error) { + return c.DescribePrometheusAlertRuleWithContext(context.Background(), request) } -// DescribePrometheusInstance -// 获取实例详细信息 +// DescribePrometheusAlertRule +// 获取告警规则列表 // // 可能返回的错误码: // INTERNALERROR = "InternalError" -// INTERNALERROR_DB = "InternalError.Db" // INTERNALERROR_DBRECORDNOTFOUND = "InternalError.DbRecordNotFound" // INTERNALERROR_PARAM = "InternalError.Param" // INTERNALERROR_UNEXPECTEDINTERNAL = "InternalError.UnexpectedInternal" // INVALIDPARAMETER = "InvalidParameter" // INVALIDPARAMETER_CLUSTERNOTFOUND = "InvalidParameter.ClusterNotFound" +// INVALIDPARAMETER_PARAM = "InvalidParameter.Param" // INVALIDPARAMETER_PROMINSTANCENOTFOUND = "InvalidParameter.PromInstanceNotFound" -func (c *Client) DescribePrometheusInstanceWithContext(ctx context.Context, request *DescribePrometheusInstanceRequest) (response *DescribePrometheusInstanceResponse, err error) { +func (c *Client) DescribePrometheusAlertRuleWithContext(ctx context.Context, request *DescribePrometheusAlertRuleRequest) (response *DescribePrometheusAlertRuleResponse, err error) { if request == nil { - request = NewDescribePrometheusInstanceRequest() + request = NewDescribePrometheusAlertRuleRequest() } if c.GetCredential() == nil { - return nil, errors.New("DescribePrometheusInstance require credential") + return nil, errors.New("DescribePrometheusAlertRule require credential") } request.SetContext(ctx) - response = NewDescribePrometheusInstanceResponse() + response = NewDescribePrometheusAlertRuleResponse() err = c.Send(request, response) return } -func NewDescribePrometheusOverviewsRequest() (request *DescribePrometheusOverviewsRequest) { - request = &DescribePrometheusOverviewsRequest{ +func NewDescribePrometheusClusterAgentsRequest() (request *DescribePrometheusClusterAgentsRequest) { + request = &DescribePrometheusClusterAgentsRequest{ BaseRequest: &tchttp.BaseRequest{}, } - request.Init().WithApiInfo("tke", APIVersion, "DescribePrometheusOverviews") + request.Init().WithApiInfo("tke", APIVersion, "DescribePrometheusClusterAgents") return } -func NewDescribePrometheusOverviewsResponse() (response *DescribePrometheusOverviewsResponse) { - response = &DescribePrometheusOverviewsResponse{ +func NewDescribePrometheusClusterAgentsResponse() (response *DescribePrometheusClusterAgentsResponse) { + response = &DescribePrometheusClusterAgentsResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } -// DescribePrometheusOverviews -// 获取实例列表 +// DescribePrometheusClusterAgents +// 获取2.0实例关联集群列表 // // 可能返回的错误码: // INTERNALERROR = "InternalError" -// INTERNALERROR_DB = "InternalError.Db" -// INTERNALERROR_PARAM = "InternalError.Param" // INTERNALERROR_UNEXPECTEDINTERNAL = "InternalError.UnexpectedInternal" -func (c *Client) DescribePrometheusOverviews(request *DescribePrometheusOverviewsRequest) (response *DescribePrometheusOverviewsResponse, err error) { - return c.DescribePrometheusOverviewsWithContext(context.Background(), request) +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETER_PARAM = "InvalidParameter.Param" +func (c *Client) DescribePrometheusClusterAgents(request *DescribePrometheusClusterAgentsRequest) (response *DescribePrometheusClusterAgentsResponse, err error) { + return c.DescribePrometheusClusterAgentsWithContext(context.Background(), request) } -// DescribePrometheusOverviews -// 获取实例列表 +// DescribePrometheusClusterAgents +// 获取2.0实例关联集群列表 // // 可能返回的错误码: // INTERNALERROR = "InternalError" -// INTERNALERROR_DB = "InternalError.Db" -// INTERNALERROR_PARAM = "InternalError.Param" // INTERNALERROR_UNEXPECTEDINTERNAL = "InternalError.UnexpectedInternal" -func (c *Client) DescribePrometheusOverviewsWithContext(ctx context.Context, request *DescribePrometheusOverviewsRequest) (response *DescribePrometheusOverviewsResponse, err error) { +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETER_PARAM = "InvalidParameter.Param" +func (c *Client) DescribePrometheusClusterAgentsWithContext(ctx context.Context, request *DescribePrometheusClusterAgentsRequest) (response *DescribePrometheusClusterAgentsResponse, err error) { if request == nil { - request = NewDescribePrometheusOverviewsRequest() + request = NewDescribePrometheusClusterAgentsRequest() } if c.GetCredential() == nil { - return nil, errors.New("DescribePrometheusOverviews require credential") + return nil, errors.New("DescribePrometheusClusterAgents require credential") } request.SetContext(ctx) - response = NewDescribePrometheusOverviewsResponse() + response = NewDescribePrometheusClusterAgentsResponse() err = c.Send(request, response) return } -func NewDescribePrometheusTargetsRequest() (request *DescribePrometheusTargetsRequest) { - request = &DescribePrometheusTargetsRequest{ +func NewDescribePrometheusInstanceRequest() (request *DescribePrometheusInstanceRequest) { + request = &DescribePrometheusInstanceRequest{ BaseRequest: &tchttp.BaseRequest{}, } - request.Init().WithApiInfo("tke", APIVersion, "DescribePrometheusTargets") + request.Init().WithApiInfo("tke", APIVersion, "DescribePrometheusInstance") return } -func NewDescribePrometheusTargetsResponse() (response *DescribePrometheusTargetsResponse) { - response = &DescribePrometheusTargetsResponse{ +func NewDescribePrometheusInstanceResponse() (response *DescribePrometheusInstanceResponse) { + response = &DescribePrometheusInstanceResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } -// DescribePrometheusTargets -// 获取targets信息 +// DescribePrometheusInstance +// 获取实例详细信息 // // 可能返回的错误码: // INTERNALERROR = "InternalError" +// INTERNALERROR_DB = "InternalError.Db" // INTERNALERROR_DBRECORDNOTFOUND = "InternalError.DbRecordNotFound" // INTERNALERROR_PARAM = "InternalError.Param" // INTERNALERROR_UNEXPECTEDINTERNAL = "InternalError.UnexpectedInternal" // INVALIDPARAMETER = "InvalidParameter" // INVALIDPARAMETER_CLUSTERNOTFOUND = "InvalidParameter.ClusterNotFound" -// INVALIDPARAMETER_PROMCLUSTERNOTFOUND = "InvalidParameter.PromClusterNotFound" +// INVALIDPARAMETER_PARAM = "InvalidParameter.Param" // INVALIDPARAMETER_PROMINSTANCENOTFOUND = "InvalidParameter.PromInstanceNotFound" -func (c *Client) DescribePrometheusTargets(request *DescribePrometheusTargetsRequest) (response *DescribePrometheusTargetsResponse, err error) { - return c.DescribePrometheusTargetsWithContext(context.Background(), request) +func (c *Client) DescribePrometheusInstance(request *DescribePrometheusInstanceRequest) (response *DescribePrometheusInstanceResponse, err error) { + return c.DescribePrometheusInstanceWithContext(context.Background(), request) } -// DescribePrometheusTargets -// 获取targets信息 +// DescribePrometheusInstance +// 获取实例详细信息 // // 可能返回的错误码: // INTERNALERROR = "InternalError" +// INTERNALERROR_DB = "InternalError.Db" // INTERNALERROR_DBRECORDNOTFOUND = "InternalError.DbRecordNotFound" // INTERNALERROR_PARAM = "InternalError.Param" // INTERNALERROR_UNEXPECTEDINTERNAL = "InternalError.UnexpectedInternal" // INVALIDPARAMETER = "InvalidParameter" // INVALIDPARAMETER_CLUSTERNOTFOUND = "InvalidParameter.ClusterNotFound" -// INVALIDPARAMETER_PROMCLUSTERNOTFOUND = "InvalidParameter.PromClusterNotFound" +// INVALIDPARAMETER_PARAM = "InvalidParameter.Param" // INVALIDPARAMETER_PROMINSTANCENOTFOUND = "InvalidParameter.PromInstanceNotFound" -func (c *Client) DescribePrometheusTargetsWithContext(ctx context.Context, request *DescribePrometheusTargetsRequest) (response *DescribePrometheusTargetsResponse, err error) { +func (c *Client) DescribePrometheusInstanceWithContext(ctx context.Context, request *DescribePrometheusInstanceRequest) (response *DescribePrometheusInstanceResponse, err error) { if request == nil { - request = NewDescribePrometheusTargetsRequest() + request = NewDescribePrometheusInstanceRequest() } if c.GetCredential() == nil { - return nil, errors.New("DescribePrometheusTargets require credential") + return nil, errors.New("DescribePrometheusInstance require credential") } request.SetContext(ctx) - response = NewDescribePrometheusTargetsResponse() + response = NewDescribePrometheusInstanceResponse() err = c.Send(request, response) return } -func NewDescribePrometheusTemplateSyncRequest() (request *DescribePrometheusTemplateSyncRequest) { - request = &DescribePrometheusTemplateSyncRequest{ +func NewDescribePrometheusInstancesOverviewRequest() (request *DescribePrometheusInstancesOverviewRequest) { + request = &DescribePrometheusInstancesOverviewRequest{ BaseRequest: &tchttp.BaseRequest{}, } - request.Init().WithApiInfo("tke", APIVersion, "DescribePrometheusTemplateSync") + request.Init().WithApiInfo("tke", APIVersion, "DescribePrometheusInstancesOverview") return } -func NewDescribePrometheusTemplateSyncResponse() (response *DescribePrometheusTemplateSyncResponse) { - response = &DescribePrometheusTemplateSyncResponse{ +func NewDescribePrometheusInstancesOverviewResponse() (response *DescribePrometheusInstancesOverviewResponse) { + response = &DescribePrometheusInstancesOverviewResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } -// DescribePrometheusTemplateSync -// 获取模板同步信息 +// DescribePrometheusInstancesOverview +// 获取与云监控融合实例列表 // // 可能返回的错误码: // INTERNALERROR = "InternalError" -// INTERNALERROR_DB = "InternalError.Db" // INTERNALERROR_PARAM = "InternalError.Param" -// INVALIDPARAMETER_RESOURCENOTFOUND = "InvalidParameter.ResourceNotFound" -func (c *Client) DescribePrometheusTemplateSync(request *DescribePrometheusTemplateSyncRequest) (response *DescribePrometheusTemplateSyncResponse, err error) { - return c.DescribePrometheusTemplateSyncWithContext(context.Background(), request) +// INTERNALERROR_UNEXPECTEDINTERNAL = "InternalError.UnexpectedInternal" +// INVALIDPARAMETER_PARAM = "InvalidParameter.Param" +func (c *Client) DescribePrometheusInstancesOverview(request *DescribePrometheusInstancesOverviewRequest) (response *DescribePrometheusInstancesOverviewResponse, err error) { + return c.DescribePrometheusInstancesOverviewWithContext(context.Background(), request) } -// DescribePrometheusTemplateSync -// 获取模板同步信息 +// DescribePrometheusInstancesOverview +// 获取与云监控融合实例列表 // // 可能返回的错误码: // INTERNALERROR = "InternalError" -// INTERNALERROR_DB = "InternalError.Db" // INTERNALERROR_PARAM = "InternalError.Param" -// INVALIDPARAMETER_RESOURCENOTFOUND = "InvalidParameter.ResourceNotFound" -func (c *Client) DescribePrometheusTemplateSyncWithContext(ctx context.Context, request *DescribePrometheusTemplateSyncRequest) (response *DescribePrometheusTemplateSyncResponse, err error) { +// INTERNALERROR_UNEXPECTEDINTERNAL = "InternalError.UnexpectedInternal" +// INVALIDPARAMETER_PARAM = "InvalidParameter.Param" +func (c *Client) DescribePrometheusInstancesOverviewWithContext(ctx context.Context, request *DescribePrometheusInstancesOverviewRequest) (response *DescribePrometheusInstancesOverviewResponse, err error) { + if request == nil { + request = NewDescribePrometheusInstancesOverviewRequest() + } + + if c.GetCredential() == nil { + return nil, errors.New("DescribePrometheusInstancesOverview require credential") + } + + request.SetContext(ctx) + + response = NewDescribePrometheusInstancesOverviewResponse() + err = c.Send(request, response) + return +} + +func NewDescribePrometheusOverviewsRequest() (request *DescribePrometheusOverviewsRequest) { + request = &DescribePrometheusOverviewsRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + request.Init().WithApiInfo("tke", APIVersion, "DescribePrometheusOverviews") + + + return +} + +func NewDescribePrometheusOverviewsResponse() (response *DescribePrometheusOverviewsResponse) { + response = &DescribePrometheusOverviewsResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return +} + +// DescribePrometheusOverviews +// 获取实例列表 +// +// 可能返回的错误码: +// INTERNALERROR = "InternalError" +// INTERNALERROR_DB = "InternalError.Db" +// INTERNALERROR_PARAM = "InternalError.Param" +// INTERNALERROR_UNEXPECTEDINTERNAL = "InternalError.UnexpectedInternal" +func (c *Client) DescribePrometheusOverviews(request *DescribePrometheusOverviewsRequest) (response *DescribePrometheusOverviewsResponse, err error) { + return c.DescribePrometheusOverviewsWithContext(context.Background(), request) +} + +// DescribePrometheusOverviews +// 获取实例列表 +// +// 可能返回的错误码: +// INTERNALERROR = "InternalError" +// INTERNALERROR_DB = "InternalError.Db" +// INTERNALERROR_PARAM = "InternalError.Param" +// INTERNALERROR_UNEXPECTEDINTERNAL = "InternalError.UnexpectedInternal" +func (c *Client) DescribePrometheusOverviewsWithContext(ctx context.Context, request *DescribePrometheusOverviewsRequest) (response *DescribePrometheusOverviewsResponse, err error) { + if request == nil { + request = NewDescribePrometheusOverviewsRequest() + } + + if c.GetCredential() == nil { + return nil, errors.New("DescribePrometheusOverviews require credential") + } + + request.SetContext(ctx) + + response = NewDescribePrometheusOverviewsResponse() + err = c.Send(request, response) + return +} + +func NewDescribePrometheusRecordRulesRequest() (request *DescribePrometheusRecordRulesRequest) { + request = &DescribePrometheusRecordRulesRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + request.Init().WithApiInfo("tke", APIVersion, "DescribePrometheusRecordRules") + + + return +} + +func NewDescribePrometheusRecordRulesResponse() (response *DescribePrometheusRecordRulesResponse) { + response = &DescribePrometheusRecordRulesResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return +} + +// DescribePrometheusRecordRules +// 获取聚合规则列表,包含关联集群内crd资源创建的record rule +// +// 可能返回的错误码: +// INTERNALERROR = "InternalError" +// INTERNALERROR_DBRECORDNOTFOUND = "InternalError.DbRecordNotFound" +// INTERNALERROR_PARAM = "InternalError.Param" +// INTERNALERROR_UNEXPECTEDINTERNAL = "InternalError.UnexpectedInternal" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETER_PROMINSTANCENOTFOUND = "InvalidParameter.PromInstanceNotFound" +func (c *Client) DescribePrometheusRecordRules(request *DescribePrometheusRecordRulesRequest) (response *DescribePrometheusRecordRulesResponse, err error) { + return c.DescribePrometheusRecordRulesWithContext(context.Background(), request) +} + +// DescribePrometheusRecordRules +// 获取聚合规则列表,包含关联集群内crd资源创建的record rule +// +// 可能返回的错误码: +// INTERNALERROR = "InternalError" +// INTERNALERROR_DBRECORDNOTFOUND = "InternalError.DbRecordNotFound" +// INTERNALERROR_PARAM = "InternalError.Param" +// INTERNALERROR_UNEXPECTEDINTERNAL = "InternalError.UnexpectedInternal" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETER_PROMINSTANCENOTFOUND = "InvalidParameter.PromInstanceNotFound" +func (c *Client) DescribePrometheusRecordRulesWithContext(ctx context.Context, request *DescribePrometheusRecordRulesRequest) (response *DescribePrometheusRecordRulesResponse, err error) { + if request == nil { + request = NewDescribePrometheusRecordRulesRequest() + } + + if c.GetCredential() == nil { + return nil, errors.New("DescribePrometheusRecordRules require credential") + } + + request.SetContext(ctx) + + response = NewDescribePrometheusRecordRulesResponse() + err = c.Send(request, response) + return +} + +func NewDescribePrometheusTargetsRequest() (request *DescribePrometheusTargetsRequest) { + request = &DescribePrometheusTargetsRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + request.Init().WithApiInfo("tke", APIVersion, "DescribePrometheusTargets") + + + return +} + +func NewDescribePrometheusTargetsResponse() (response *DescribePrometheusTargetsResponse) { + response = &DescribePrometheusTargetsResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return +} + +// DescribePrometheusTargets +// 获取targets信息 +// +// 可能返回的错误码: +// INTERNALERROR = "InternalError" +// INTERNALERROR_DBRECORDNOTFOUND = "InternalError.DbRecordNotFound" +// INTERNALERROR_PARAM = "InternalError.Param" +// INTERNALERROR_UNEXPECTEDINTERNAL = "InternalError.UnexpectedInternal" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETER_CLUSTERNOTFOUND = "InvalidParameter.ClusterNotFound" +// INVALIDPARAMETER_PROMCLUSTERNOTFOUND = "InvalidParameter.PromClusterNotFound" +// INVALIDPARAMETER_PROMINSTANCENOTFOUND = "InvalidParameter.PromInstanceNotFound" +func (c *Client) DescribePrometheusTargets(request *DescribePrometheusTargetsRequest) (response *DescribePrometheusTargetsResponse, err error) { + return c.DescribePrometheusTargetsWithContext(context.Background(), request) +} + +// DescribePrometheusTargets +// 获取targets信息 +// +// 可能返回的错误码: +// INTERNALERROR = "InternalError" +// INTERNALERROR_DBRECORDNOTFOUND = "InternalError.DbRecordNotFound" +// INTERNALERROR_PARAM = "InternalError.Param" +// INTERNALERROR_UNEXPECTEDINTERNAL = "InternalError.UnexpectedInternal" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETER_CLUSTERNOTFOUND = "InvalidParameter.ClusterNotFound" +// INVALIDPARAMETER_PROMCLUSTERNOTFOUND = "InvalidParameter.PromClusterNotFound" +// INVALIDPARAMETER_PROMINSTANCENOTFOUND = "InvalidParameter.PromInstanceNotFound" +func (c *Client) DescribePrometheusTargetsWithContext(ctx context.Context, request *DescribePrometheusTargetsRequest) (response *DescribePrometheusTargetsResponse, err error) { + if request == nil { + request = NewDescribePrometheusTargetsRequest() + } + + if c.GetCredential() == nil { + return nil, errors.New("DescribePrometheusTargets require credential") + } + + request.SetContext(ctx) + + response = NewDescribePrometheusTargetsResponse() + err = c.Send(request, response) + return +} + +func NewDescribePrometheusTempRequest() (request *DescribePrometheusTempRequest) { + request = &DescribePrometheusTempRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + request.Init().WithApiInfo("tke", APIVersion, "DescribePrometheusTemp") + + + return +} + +func NewDescribePrometheusTempResponse() (response *DescribePrometheusTempResponse) { + response = &DescribePrometheusTempResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return +} + +// DescribePrometheusTemp +// 拉取模板列表,默认模板将总是在最前面 +// +// 可能返回的错误码: +// INTERNALERROR_DB = "InternalError.Db" +// INTERNALERROR_PARAM = "InternalError.Param" +// INTERNALERROR_UNEXPECTEDINTERNAL = "InternalError.UnexpectedInternal" +// INVALIDPARAMETER_PARAM = "InvalidParameter.Param" +func (c *Client) DescribePrometheusTemp(request *DescribePrometheusTempRequest) (response *DescribePrometheusTempResponse, err error) { + return c.DescribePrometheusTempWithContext(context.Background(), request) +} + +// DescribePrometheusTemp +// 拉取模板列表,默认模板将总是在最前面 +// +// 可能返回的错误码: +// INTERNALERROR_DB = "InternalError.Db" +// INTERNALERROR_PARAM = "InternalError.Param" +// INTERNALERROR_UNEXPECTEDINTERNAL = "InternalError.UnexpectedInternal" +// INVALIDPARAMETER_PARAM = "InvalidParameter.Param" +func (c *Client) DescribePrometheusTempWithContext(ctx context.Context, request *DescribePrometheusTempRequest) (response *DescribePrometheusTempResponse, err error) { + if request == nil { + request = NewDescribePrometheusTempRequest() + } + + if c.GetCredential() == nil { + return nil, errors.New("DescribePrometheusTemp require credential") + } + + request.SetContext(ctx) + + response = NewDescribePrometheusTempResponse() + err = c.Send(request, response) + return +} + +func NewDescribePrometheusTempSyncRequest() (request *DescribePrometheusTempSyncRequest) { + request = &DescribePrometheusTempSyncRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + request.Init().WithApiInfo("tke", APIVersion, "DescribePrometheusTempSync") + + + return +} + +func NewDescribePrometheusTempSyncResponse() (response *DescribePrometheusTempSyncResponse) { + response = &DescribePrometheusTempSyncResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return +} + +// DescribePrometheusTempSync +// 获取模板关联实例信息,针对V2版本实例 +// +// 可能返回的错误码: +// INTERNALERROR = "InternalError" +// INTERNALERROR_DB = "InternalError.Db" +// INTERNALERROR_PARAM = "InternalError.Param" +// INVALIDPARAMETER_PARAM = "InvalidParameter.Param" +// INVALIDPARAMETER_RESOURCENOTFOUND = "InvalidParameter.ResourceNotFound" +func (c *Client) DescribePrometheusTempSync(request *DescribePrometheusTempSyncRequest) (response *DescribePrometheusTempSyncResponse, err error) { + return c.DescribePrometheusTempSyncWithContext(context.Background(), request) +} + +// DescribePrometheusTempSync +// 获取模板关联实例信息,针对V2版本实例 +// +// 可能返回的错误码: +// INTERNALERROR = "InternalError" +// INTERNALERROR_DB = "InternalError.Db" +// INTERNALERROR_PARAM = "InternalError.Param" +// INVALIDPARAMETER_PARAM = "InvalidParameter.Param" +// INVALIDPARAMETER_RESOURCENOTFOUND = "InvalidParameter.ResourceNotFound" +func (c *Client) DescribePrometheusTempSyncWithContext(ctx context.Context, request *DescribePrometheusTempSyncRequest) (response *DescribePrometheusTempSyncResponse, err error) { + if request == nil { + request = NewDescribePrometheusTempSyncRequest() + } + + if c.GetCredential() == nil { + return nil, errors.New("DescribePrometheusTempSync require credential") + } + + request.SetContext(ctx) + + response = NewDescribePrometheusTempSyncResponse() + err = c.Send(request, response) + return +} + +func NewDescribePrometheusTemplateSyncRequest() (request *DescribePrometheusTemplateSyncRequest) { + request = &DescribePrometheusTemplateSyncRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + request.Init().WithApiInfo("tke", APIVersion, "DescribePrometheusTemplateSync") + + + return +} + +func NewDescribePrometheusTemplateSyncResponse() (response *DescribePrometheusTemplateSyncResponse) { + response = &DescribePrometheusTemplateSyncResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return +} + +// DescribePrometheusTemplateSync +// 获取模板同步信息 +// +// 可能返回的错误码: +// INTERNALERROR = "InternalError" +// INTERNALERROR_DB = "InternalError.Db" +// INTERNALERROR_PARAM = "InternalError.Param" +// INVALIDPARAMETER_RESOURCENOTFOUND = "InvalidParameter.ResourceNotFound" +func (c *Client) DescribePrometheusTemplateSync(request *DescribePrometheusTemplateSyncRequest) (response *DescribePrometheusTemplateSyncResponse, err error) { + return c.DescribePrometheusTemplateSyncWithContext(context.Background(), request) +} + +// DescribePrometheusTemplateSync +// 获取模板同步信息 +// +// 可能返回的错误码: +// INTERNALERROR = "InternalError" +// INTERNALERROR_DB = "InternalError.Db" +// INTERNALERROR_PARAM = "InternalError.Param" +// INVALIDPARAMETER_RESOURCENOTFOUND = "InvalidParameter.ResourceNotFound" +func (c *Client) DescribePrometheusTemplateSyncWithContext(ctx context.Context, request *DescribePrometheusTemplateSyncRequest) (response *DescribePrometheusTemplateSyncResponse, err error) { if request == nil { request = NewDescribePrometheusTemplateSyncRequest() } @@ -4897,6 +5575,7 @@ func NewDescribeRegionsResponse() (response *DescribeRegionsResponse) { // // 可能返回的错误码: // FAILEDOPERATION = "FailedOperation" +// FAILEDOPERATION_COMPONENTCLIENTHTTP = "FailedOperation.ComponentClientHttp" // INTERNALERROR = "InternalError" // INTERNALERROR_ACCOUNTUSERNOTAUTHENTICATED = "InternalError.AccountUserNotAuthenticated" // INTERNALERROR_CAMNOAUTH = "InternalError.CamNoAuth" @@ -4921,6 +5600,7 @@ func (c *Client) DescribeRegions(request *DescribeRegionsRequest) (response *Des // // 可能返回的错误码: // FAILEDOPERATION = "FailedOperation" +// FAILEDOPERATION_COMPONENTCLIENTHTTP = "FailedOperation.ComponentClientHttp" // INTERNALERROR = "InternalError" // INTERNALERROR_ACCOUNTUSERNOTAUTHENTICATED = "InternalError.AccountUserNotAuthenticated" // INTERNALERROR_CAMNOAUTH = "InternalError.CamNoAuth" @@ -5030,6 +5710,7 @@ func NewDescribeRouteTableConflictsResponse() (response *DescribeRouteTableConfl // 查询路由表冲突列表 // // 可能返回的错误码: +// FAILEDOPERATION_PARAM = "FailedOperation.Param" // INTERNALERROR = "InternalError" // INTERNALERROR_CIDRMASKSIZEOUTOFRANGE = "InternalError.CidrMaskSizeOutOfRange" // INTERNALERROR_INVALIDPRIVATENETWORKCIDR = "InternalError.InvalidPrivateNetworkCidr" @@ -5045,6 +5726,7 @@ func (c *Client) DescribeRouteTableConflicts(request *DescribeRouteTableConflict // 查询路由表冲突列表 // // 可能返回的错误码: +// FAILEDOPERATION_PARAM = "FailedOperation.Param" // INTERNALERROR = "InternalError" // INTERNALERROR_CIDRMASKSIZEOUTOFRANGE = "InternalError.CidrMaskSizeOutOfRange" // INTERNALERROR_INVALIDPRIVATENETWORKCIDR = "InternalError.InvalidPrivateNetworkCidr" @@ -5156,6 +5838,8 @@ func NewDescribeVersionsResponse() (response *DescribeVersionsResponse) { // 获取集群版本信息 // // 可能返回的错误码: +// FAILEDOPERATION_COMPONENTCLIENTHTTP = "FailedOperation.ComponentClientHttp" +// FAILEDOPERATION_COMPONENTCLINETHTTP = "FailedOperation.ComponentClinetHttp" // INTERNALERROR = "InternalError" // INTERNALERROR_CAMNOAUTH = "InternalError.CamNoAuth" // INTERNALERROR_COMPONENTCLINETHTTP = "InternalError.ComponentClinetHttp" @@ -5182,6 +5866,8 @@ func (c *Client) DescribeVersions(request *DescribeVersionsRequest) (response *D // 获取集群版本信息 // // 可能返回的错误码: +// FAILEDOPERATION_COMPONENTCLIENTHTTP = "FailedOperation.ComponentClientHttp" +// FAILEDOPERATION_COMPONENTCLINETHTTP = "FailedOperation.ComponentClinetHttp" // INTERNALERROR = "InternalError" // INTERNALERROR_CAMNOAUTH = "InternalError.CamNoAuth" // INTERNALERROR_COMPONENTCLINETHTTP = "InternalError.ComponentClinetHttp" @@ -5287,6 +5973,53 @@ func (c *Client) DescribeVpcCniPodLimitsWithContext(ctx context.Context, request return } +func NewDisableClusterAuditRequest() (request *DisableClusterAuditRequest) { + request = &DisableClusterAuditRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + request.Init().WithApiInfo("tke", APIVersion, "DisableClusterAudit") + + + return +} + +func NewDisableClusterAuditResponse() (response *DisableClusterAuditResponse) { + response = &DisableClusterAuditResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return +} + +// DisableClusterAudit +// 关闭集群审计 +// +// 可能返回的错误码: +// INTERNALERROR_UNEXPECTEDINTERNAL = "InternalError.UnexpectedInternal" +func (c *Client) DisableClusterAudit(request *DisableClusterAuditRequest) (response *DisableClusterAuditResponse, err error) { + return c.DisableClusterAuditWithContext(context.Background(), request) +} + +// DisableClusterAudit +// 关闭集群审计 +// +// 可能返回的错误码: +// INTERNALERROR_UNEXPECTEDINTERNAL = "InternalError.UnexpectedInternal" +func (c *Client) DisableClusterAuditWithContext(ctx context.Context, request *DisableClusterAuditRequest) (response *DisableClusterAuditResponse, err error) { + if request == nil { + request = NewDisableClusterAuditRequest() + } + + if c.GetCredential() == nil { + return nil, errors.New("DisableClusterAudit require credential") + } + + request.SetContext(ctx) + + response = NewDisableClusterAuditResponse() + err = c.Send(request, response) + return +} + func NewDisableClusterDeletionProtectionRequest() (request *DisableClusterDeletionProtectionRequest) { request = &DisableClusterDeletionProtectionRequest{ BaseRequest: &tchttp.BaseRequest{}, @@ -5322,16 +6055,75 @@ func (c *Client) DisableClusterDeletionProtection(request *DisableClusterDeletio // INVALIDPARAMETER_PARAM = "InvalidParameter.Param" func (c *Client) DisableClusterDeletionProtectionWithContext(ctx context.Context, request *DisableClusterDeletionProtectionRequest) (response *DisableClusterDeletionProtectionResponse, err error) { if request == nil { - request = NewDisableClusterDeletionProtectionRequest() + request = NewDisableClusterDeletionProtectionRequest() + } + + if c.GetCredential() == nil { + return nil, errors.New("DisableClusterDeletionProtection require credential") + } + + request.SetContext(ctx) + + response = NewDisableClusterDeletionProtectionResponse() + err = c.Send(request, response) + return +} + +func NewDisableEventPersistenceRequest() (request *DisableEventPersistenceRequest) { + request = &DisableEventPersistenceRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + request.Init().WithApiInfo("tke", APIVersion, "DisableEventPersistence") + + + return +} + +func NewDisableEventPersistenceResponse() (response *DisableEventPersistenceResponse) { + response = &DisableEventPersistenceResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return +} + +// DisableEventPersistence +// 关闭事件持久化功能 +// +// 可能返回的错误码: +// FAILEDOPERATION = "FailedOperation" +// FAILEDOPERATION_RBACFORBIDDEN = "FailedOperation.RBACForbidden" +// INTERNALERROR = "InternalError" +// INTERNALERROR_ACCOUNTUSERNOTAUTHENTICATED = "InternalError.AccountUserNotAuthenticated" +// INTERNALERROR_KUBERNETESCLIENTBUILDERROR = "InternalError.KubernetesClientBuildError" +// INTERNALERROR_KUBERNETESDELETEOPERATIONERROR = "InternalError.KubernetesDeleteOperationError" +// INTERNALERROR_KUBERNETESGETOPERATIONERROR = "InternalError.KubernetesGetOperationError" +func (c *Client) DisableEventPersistence(request *DisableEventPersistenceRequest) (response *DisableEventPersistenceResponse, err error) { + return c.DisableEventPersistenceWithContext(context.Background(), request) +} + +// DisableEventPersistence +// 关闭事件持久化功能 +// +// 可能返回的错误码: +// FAILEDOPERATION = "FailedOperation" +// FAILEDOPERATION_RBACFORBIDDEN = "FailedOperation.RBACForbidden" +// INTERNALERROR = "InternalError" +// INTERNALERROR_ACCOUNTUSERNOTAUTHENTICATED = "InternalError.AccountUserNotAuthenticated" +// INTERNALERROR_KUBERNETESCLIENTBUILDERROR = "InternalError.KubernetesClientBuildError" +// INTERNALERROR_KUBERNETESDELETEOPERATIONERROR = "InternalError.KubernetesDeleteOperationError" +// INTERNALERROR_KUBERNETESGETOPERATIONERROR = "InternalError.KubernetesGetOperationError" +func (c *Client) DisableEventPersistenceWithContext(ctx context.Context, request *DisableEventPersistenceRequest) (response *DisableEventPersistenceResponse, err error) { + if request == nil { + request = NewDisableEventPersistenceRequest() } if c.GetCredential() == nil { - return nil, errors.New("DisableClusterDeletionProtection require credential") + return nil, errors.New("DisableEventPersistence require credential") } request.SetContext(ctx) - response = NewDisableClusterDeletionProtectionResponse() + response = NewDisableEventPersistenceResponse() err = c.Send(request, response) return } @@ -5391,6 +6183,57 @@ func (c *Client) DisableVpcCniNetworkTypeWithContext(ctx context.Context, reques return } +func NewEnableClusterAuditRequest() (request *EnableClusterAuditRequest) { + request = &EnableClusterAuditRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + request.Init().WithApiInfo("tke", APIVersion, "EnableClusterAudit") + + + return +} + +func NewEnableClusterAuditResponse() (response *EnableClusterAuditResponse) { + response = &EnableClusterAuditResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return +} + +// EnableClusterAudit +// 开启集群审计 +// +// 可能返回的错误码: +// INTERNALERROR_UNEXPECTEDINTERNAL = "InternalError.UnexpectedInternal" +// INVALIDPARAMETER_PARAM = "InvalidParameter.Param" +// RESOURCENOTFOUND_CLUSTERNOTFOUND = "ResourceNotFound.ClusterNotFound" +func (c *Client) EnableClusterAudit(request *EnableClusterAuditRequest) (response *EnableClusterAuditResponse, err error) { + return c.EnableClusterAuditWithContext(context.Background(), request) +} + +// EnableClusterAudit +// 开启集群审计 +// +// 可能返回的错误码: +// INTERNALERROR_UNEXPECTEDINTERNAL = "InternalError.UnexpectedInternal" +// INVALIDPARAMETER_PARAM = "InvalidParameter.Param" +// RESOURCENOTFOUND_CLUSTERNOTFOUND = "ResourceNotFound.ClusterNotFound" +func (c *Client) EnableClusterAuditWithContext(ctx context.Context, request *EnableClusterAuditRequest) (response *EnableClusterAuditResponse, err error) { + if request == nil { + request = NewEnableClusterAuditRequest() + } + + if c.GetCredential() == nil { + return nil, errors.New("EnableClusterAudit require credential") + } + + request.SetContext(ctx) + + response = NewEnableClusterAuditResponse() + err = c.Send(request, response) + return +} + func NewEnableClusterDeletionProtectionRequest() (request *EnableClusterDeletionProtectionRequest) { request = &EnableClusterDeletionProtectionRequest{ BaseRequest: &tchttp.BaseRequest{}, @@ -5442,6 +6285,77 @@ func (c *Client) EnableClusterDeletionProtectionWithContext(ctx context.Context, return } +func NewEnableEventPersistenceRequest() (request *EnableEventPersistenceRequest) { + request = &EnableEventPersistenceRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + request.Init().WithApiInfo("tke", APIVersion, "EnableEventPersistence") + + + return +} + +func NewEnableEventPersistenceResponse() (response *EnableEventPersistenceResponse) { + response = &EnableEventPersistenceResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return +} + +// EnableEventPersistence +// 开启事件持久化功能 +// +// 可能返回的错误码: +// FAILEDOPERATION = "FailedOperation" +// FAILEDOPERATION_RBACFORBIDDEN = "FailedOperation.RBACForbidden" +// INTERNALERROR = "InternalError" +// INTERNALERROR_ACCOUNTUSERNOTAUTHENTICATED = "InternalError.AccountUserNotAuthenticated" +// INTERNALERROR_KUBERNETESCLIENTBUILDERROR = "InternalError.KubernetesClientBuildError" +// INTERNALERROR_KUBERNETESCREATEOPERATIONERROR = "InternalError.KubernetesCreateOperationError" +// INTERNALERROR_KUBERNETESDELETEOPERATIONERROR = "InternalError.KubernetesDeleteOperationError" +// INTERNALERROR_KUBERNETESGETOPERATIONERROR = "InternalError.KubernetesGetOperationError" +// INTERNALERROR_KUBERNETESPATCHOPERATIONERROR = "InternalError.KubernetesPatchOperationError" +// INTERNALERROR_PARAM = "InternalError.Param" +// INTERNALERROR_UNEXPECTEDINTERNAL = "InternalError.UnexpectedInternal" +// INVALIDPARAMETER = "InvalidParameter" +// RESOURCENOTFOUND_CLUSTERNOTFOUND = "ResourceNotFound.ClusterNotFound" +func (c *Client) EnableEventPersistence(request *EnableEventPersistenceRequest) (response *EnableEventPersistenceResponse, err error) { + return c.EnableEventPersistenceWithContext(context.Background(), request) +} + +// EnableEventPersistence +// 开启事件持久化功能 +// +// 可能返回的错误码: +// FAILEDOPERATION = "FailedOperation" +// FAILEDOPERATION_RBACFORBIDDEN = "FailedOperation.RBACForbidden" +// INTERNALERROR = "InternalError" +// INTERNALERROR_ACCOUNTUSERNOTAUTHENTICATED = "InternalError.AccountUserNotAuthenticated" +// INTERNALERROR_KUBERNETESCLIENTBUILDERROR = "InternalError.KubernetesClientBuildError" +// INTERNALERROR_KUBERNETESCREATEOPERATIONERROR = "InternalError.KubernetesCreateOperationError" +// INTERNALERROR_KUBERNETESDELETEOPERATIONERROR = "InternalError.KubernetesDeleteOperationError" +// INTERNALERROR_KUBERNETESGETOPERATIONERROR = "InternalError.KubernetesGetOperationError" +// INTERNALERROR_KUBERNETESPATCHOPERATIONERROR = "InternalError.KubernetesPatchOperationError" +// INTERNALERROR_PARAM = "InternalError.Param" +// INTERNALERROR_UNEXPECTEDINTERNAL = "InternalError.UnexpectedInternal" +// INVALIDPARAMETER = "InvalidParameter" +// RESOURCENOTFOUND_CLUSTERNOTFOUND = "ResourceNotFound.ClusterNotFound" +func (c *Client) EnableEventPersistenceWithContext(ctx context.Context, request *EnableEventPersistenceRequest) (response *EnableEventPersistenceResponse, err error) { + if request == nil { + request = NewEnableEventPersistenceRequest() + } + + if c.GetCredential() == nil { + return nil, errors.New("EnableEventPersistence require credential") + } + + request.SetContext(ctx) + + response = NewEnableEventPersistenceResponse() + err = c.Send(request, response) + return +} + func NewEnableVpcCniNetworkTypeRequest() (request *EnableVpcCniNetworkTypeRequest) { request = &EnableVpcCniNetworkTypeRequest{ BaseRequest: &tchttp.BaseRequest{}, @@ -5589,6 +6503,7 @@ func NewGetClusterLevelPriceResponse() (response *GetClusterLevelPriceResponse) // 获取集群规模价格 // // 可能返回的错误码: +// FAILEDOPERATION_TRADECOMMON = "FailedOperation.TradeCommon" // INTERNALERROR_TRADECOMMON = "InternalError.TradeCommon" func (c *Client) GetClusterLevelPrice(request *GetClusterLevelPriceRequest) (response *GetClusterLevelPriceResponse, err error) { return c.GetClusterLevelPriceWithContext(context.Background(), request) @@ -5598,6 +6513,7 @@ func (c *Client) GetClusterLevelPrice(request *GetClusterLevelPriceRequest) (res // 获取集群规模价格 // // 可能返回的错误码: +// FAILEDOPERATION_TRADECOMMON = "FailedOperation.TradeCommon" // INTERNALERROR_TRADECOMMON = "InternalError.TradeCommon" func (c *Client) GetClusterLevelPriceWithContext(ctx context.Context, request *GetClusterLevelPriceRequest) (response *GetClusterLevelPriceResponse, err error) { if request == nil { @@ -5764,6 +6680,59 @@ func (c *Client) GetUpgradeInstanceProgressWithContext(ctx context.Context, requ return } +func NewInstallLogAgentRequest() (request *InstallLogAgentRequest) { + request = &InstallLogAgentRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + request.Init().WithApiInfo("tke", APIVersion, "InstallLogAgent") + + + return +} + +func NewInstallLogAgentResponse() (response *InstallLogAgentResponse) { + response = &InstallLogAgentResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return +} + +// InstallLogAgent +// 在TKE集群中安装CLS日志采集组件 +// +// 可能返回的错误码: +// FAILEDOPERATION_KUBERNETESCREATEOPERATIONERROR = "FailedOperation.KubernetesCreateOperationError" +// INTERNALERROR_UNEXPECTEDINTERNAL = "InternalError.UnexpectedInternal" +// INVALIDPARAMETER_PARAM = "InvalidParameter.Param" +// RESOURCEUNAVAILABLE_CLUSTERSTATE = "ResourceUnavailable.ClusterState" +func (c *Client) InstallLogAgent(request *InstallLogAgentRequest) (response *InstallLogAgentResponse, err error) { + return c.InstallLogAgentWithContext(context.Background(), request) +} + +// InstallLogAgent +// 在TKE集群中安装CLS日志采集组件 +// +// 可能返回的错误码: +// FAILEDOPERATION_KUBERNETESCREATEOPERATIONERROR = "FailedOperation.KubernetesCreateOperationError" +// INTERNALERROR_UNEXPECTEDINTERNAL = "InternalError.UnexpectedInternal" +// INVALIDPARAMETER_PARAM = "InvalidParameter.Param" +// RESOURCEUNAVAILABLE_CLUSTERSTATE = "ResourceUnavailable.ClusterState" +func (c *Client) InstallLogAgentWithContext(ctx context.Context, request *InstallLogAgentRequest) (response *InstallLogAgentResponse, err error) { + if request == nil { + request = NewInstallLogAgentRequest() + } + + if c.GetCredential() == nil { + return nil, errors.New("InstallLogAgent require credential") + } + + request.SetContext(ctx) + + response = NewInstallLogAgentResponse() + err = c.Send(request, response) + return +} + func NewModifyClusterAsGroupAttributeRequest() (request *ModifyClusterAsGroupAttributeRequest) { request = &ModifyClusterAsGroupAttributeRequest{ BaseRequest: &tchttp.BaseRequest{}, @@ -5951,6 +6920,8 @@ func NewModifyClusterAttributeResponse() (response *ModifyClusterAttributeRespon // 修改集群属性 // // 可能返回的错误码: +// FAILEDOPERATION_COMPONENTCLIENTHTTP = "FailedOperation.ComponentClientHttp" +// FAILEDOPERATION_TRADECOMMON = "FailedOperation.TradeCommon" // INTERNALERROR = "InternalError" // INTERNALERROR_CAMNOAUTH = "InternalError.CamNoAuth" // INTERNALERROR_DB = "InternalError.Db" @@ -5974,6 +6945,8 @@ func (c *Client) ModifyClusterAttribute(request *ModifyClusterAttributeRequest) // 修改集群属性 // // 可能返回的错误码: +// FAILEDOPERATION_COMPONENTCLIENTHTTP = "FailedOperation.ComponentClientHttp" +// FAILEDOPERATION_TRADECOMMON = "FailedOperation.TradeCommon" // INTERNALERROR = "InternalError" // INTERNALERROR_CAMNOAUTH = "InternalError.CamNoAuth" // INTERNALERROR_DB = "InternalError.Db" @@ -6028,6 +7001,7 @@ func NewModifyClusterAuthenticationOptionsResponse() (response *ModifyClusterAut // 可能返回的错误码: // INTERNALERROR = "InternalError" // INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETER_PARAM = "InvalidParameter.Param" // OPERATIONDENIED = "OperationDenied" // RESOURCEUNAVAILABLE_CLUSTERSTATE = "ResourceUnavailable.ClusterState" func (c *Client) ModifyClusterAuthenticationOptions(request *ModifyClusterAuthenticationOptionsRequest) (response *ModifyClusterAuthenticationOptionsResponse, err error) { @@ -6040,6 +7014,7 @@ func (c *Client) ModifyClusterAuthenticationOptions(request *ModifyClusterAuthen // 可能返回的错误码: // INTERNALERROR = "InternalError" // INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETER_PARAM = "InvalidParameter.Param" // OPERATIONDENIED = "OperationDenied" // RESOURCEUNAVAILABLE_CLUSTERSTATE = "ResourceUnavailable.ClusterState" func (c *Client) ModifyClusterAuthenticationOptionsWithContext(ctx context.Context, request *ModifyClusterAuthenticationOptionsRequest) (response *ModifyClusterAuthenticationOptionsResponse, err error) { @@ -6080,6 +7055,8 @@ func NewModifyClusterEndpointSPResponse() (response *ModifyClusterEndpointSPResp // // 可能返回的错误码: // FAILEDOPERATION = "FailedOperation" +// FAILEDOPERATION_CLBUNEXPECTEDERROR = "FailedOperation.CLBUnexpectedError" +// FAILEDOPERATION_VPCUNEXPECTEDERROR = "FailedOperation.VPCUnexpectedError" // INTERNALERROR = "InternalError" // INTERNALERROR_CAMNOAUTH = "InternalError.CamNoAuth" // INTERNALERROR_CLUSTERNOTFOUND = "InternalError.ClusterNotFound" @@ -6107,6 +7084,8 @@ func (c *Client) ModifyClusterEndpointSP(request *ModifyClusterEndpointSPRequest // // 可能返回的错误码: // FAILEDOPERATION = "FailedOperation" +// FAILEDOPERATION_CLBUNEXPECTEDERROR = "FailedOperation.CLBUnexpectedError" +// FAILEDOPERATION_VPCUNEXPECTEDERROR = "FailedOperation.VPCUnexpectedError" // INTERNALERROR = "InternalError" // INTERNALERROR_CAMNOAUTH = "InternalError.CamNoAuth" // INTERNALERROR_CLUSTERNOTFOUND = "InternalError.ClusterNotFound" @@ -6162,6 +7141,7 @@ func NewModifyClusterNodePoolResponse() (response *ModifyClusterNodePoolResponse // 编辑节点池 // // 可能返回的错误码: +// FAILEDOPERATION_COMPONENTCLIENTHTTP = "FailedOperation.ComponentClientHttp" // INTERNALERROR_DB = "InternalError.Db" // INTERNALERROR_UNEXPECTEDINTERNAL = "InternalError.UnexpectedInternal" // INVALIDPARAMETER_PARAM = "InvalidParameter.Param" @@ -6176,6 +7156,7 @@ func (c *Client) ModifyClusterNodePool(request *ModifyClusterNodePoolRequest) (r // 编辑节点池 // // 可能返回的错误码: +// FAILEDOPERATION_COMPONENTCLIENTHTTP = "FailedOperation.ComponentClientHttp" // INTERNALERROR_DB = "InternalError.Db" // INTERNALERROR_UNEXPECTEDINTERNAL = "InternalError.UnexpectedInternal" // INVALIDPARAMETER_PARAM = "InvalidParameter.Param" @@ -6328,6 +7309,61 @@ func (c *Client) ModifyNodePoolInstanceTypesWithContext(ctx context.Context, req return } +func NewModifyPrometheusAlertPolicyRequest() (request *ModifyPrometheusAlertPolicyRequest) { + request = &ModifyPrometheusAlertPolicyRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + request.Init().WithApiInfo("tke", APIVersion, "ModifyPrometheusAlertPolicy") + + + return +} + +func NewModifyPrometheusAlertPolicyResponse() (response *ModifyPrometheusAlertPolicyResponse) { + response = &ModifyPrometheusAlertPolicyResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return +} + +// ModifyPrometheusAlertPolicy +// 修改2.0实例告警策略 +// +// 可能返回的错误码: +// INTERNALERROR = "InternalError" +// INTERNALERROR_PARAM = "InternalError.Param" +// INTERNALERROR_UNEXPECTEDINTERNAL = "InternalError.UnexpectedInternal" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETER_PARAM = "InvalidParameter.Param" +func (c *Client) ModifyPrometheusAlertPolicy(request *ModifyPrometheusAlertPolicyRequest) (response *ModifyPrometheusAlertPolicyResponse, err error) { + return c.ModifyPrometheusAlertPolicyWithContext(context.Background(), request) +} + +// ModifyPrometheusAlertPolicy +// 修改2.0实例告警策略 +// +// 可能返回的错误码: +// INTERNALERROR = "InternalError" +// INTERNALERROR_PARAM = "InternalError.Param" +// INTERNALERROR_UNEXPECTEDINTERNAL = "InternalError.UnexpectedInternal" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETER_PARAM = "InvalidParameter.Param" +func (c *Client) ModifyPrometheusAlertPolicyWithContext(ctx context.Context, request *ModifyPrometheusAlertPolicyRequest) (response *ModifyPrometheusAlertPolicyResponse, err error) { + if request == nil { + request = NewModifyPrometheusAlertPolicyRequest() + } + + if c.GetCredential() == nil { + return nil, errors.New("ModifyPrometheusAlertPolicy require credential") + } + + request.SetContext(ctx) + + response = NewModifyPrometheusAlertPolicyResponse() + err = c.Send(request, response) + return +} + func NewModifyPrometheusAlertRuleRequest() (request *ModifyPrometheusAlertRuleRequest) { request = &ModifyPrometheusAlertRuleRequest{ BaseRequest: &tchttp.BaseRequest{}, @@ -6612,6 +7648,7 @@ func NewScaleOutClusterMasterResponse() (response *ScaleOutClusterMasterResponse // 扩容独立集群master节点 // // 可能返回的错误码: +// FAILEDOPERATION_CVMUNEXPECTEDERROR = "FailedOperation.CVMUnexpectedError" // INTERNALERROR = "InternalError" // OPERATIONDENIED = "OperationDenied" func (c *Client) ScaleOutClusterMaster(request *ScaleOutClusterMasterRequest) (response *ScaleOutClusterMasterResponse, err error) { @@ -6622,6 +7659,7 @@ func (c *Client) ScaleOutClusterMaster(request *ScaleOutClusterMasterRequest) (r // 扩容独立集群master节点 // // 可能返回的错误码: +// FAILEDOPERATION_CVMUNEXPECTEDERROR = "FailedOperation.CVMUnexpectedError" // INTERNALERROR = "InternalError" // OPERATIONDENIED = "OperationDenied" func (c *Client) ScaleOutClusterMasterWithContext(ctx context.Context, request *ScaleOutClusterMasterRequest) (response *ScaleOutClusterMasterResponse, err error) { @@ -6705,6 +7743,65 @@ func (c *Client) SetNodePoolNodeProtectionWithContext(ctx context.Context, reque return } +func NewSyncPrometheusTempRequest() (request *SyncPrometheusTempRequest) { + request = &SyncPrometheusTempRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + request.Init().WithApiInfo("tke", APIVersion, "SyncPrometheusTemp") + + + return +} + +func NewSyncPrometheusTempResponse() (response *SyncPrometheusTempResponse) { + response = &SyncPrometheusTempResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return +} + +// SyncPrometheusTemp +// 同步模板到实例或者集群,针对V2版本实例 +// +// 可能返回的错误码: +// INTERNALERROR_DB = "InternalError.Db" +// INTERNALERROR_PARAM = "InternalError.Param" +// INTERNALERROR_UNEXPECTEDINTERNAL = "InternalError.UnexpectedInternal" +// INVALIDPARAMETER_PARAM = "InvalidParameter.Param" +// INVALIDPARAMETER_PROMCLUSTERNOTFOUND = "InvalidParameter.PromClusterNotFound" +// INVALIDPARAMETER_PROMINSTANCENOTFOUND = "InvalidParameter.PromInstanceNotFound" +// INVALIDPARAMETER_RESOURCENOTFOUND = "InvalidParameter.ResourceNotFound" +func (c *Client) SyncPrometheusTemp(request *SyncPrometheusTempRequest) (response *SyncPrometheusTempResponse, err error) { + return c.SyncPrometheusTempWithContext(context.Background(), request) +} + +// SyncPrometheusTemp +// 同步模板到实例或者集群,针对V2版本实例 +// +// 可能返回的错误码: +// INTERNALERROR_DB = "InternalError.Db" +// INTERNALERROR_PARAM = "InternalError.Param" +// INTERNALERROR_UNEXPECTEDINTERNAL = "InternalError.UnexpectedInternal" +// INVALIDPARAMETER_PARAM = "InvalidParameter.Param" +// INVALIDPARAMETER_PROMCLUSTERNOTFOUND = "InvalidParameter.PromClusterNotFound" +// INVALIDPARAMETER_PROMINSTANCENOTFOUND = "InvalidParameter.PromInstanceNotFound" +// INVALIDPARAMETER_RESOURCENOTFOUND = "InvalidParameter.ResourceNotFound" +func (c *Client) SyncPrometheusTempWithContext(ctx context.Context, request *SyncPrometheusTempRequest) (response *SyncPrometheusTempResponse, err error) { + if request == nil { + request = NewSyncPrometheusTempRequest() + } + + if c.GetCredential() == nil { + return nil, errors.New("SyncPrometheusTemp require credential") + } + + request.SetContext(ctx) + + response = NewSyncPrometheusTempResponse() + err = c.Send(request, response) + return +} + func NewSyncPrometheusTemplateRequest() (request *SyncPrometheusTemplateRequest) { request = &SyncPrometheusTemplateRequest{ BaseRequest: &tchttp.BaseRequest{}, @@ -6764,6 +7861,55 @@ func (c *Client) SyncPrometheusTemplateWithContext(ctx context.Context, request return } +func NewUninstallLogAgentRequest() (request *UninstallLogAgentRequest) { + request = &UninstallLogAgentRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + request.Init().WithApiInfo("tke", APIVersion, "UninstallLogAgent") + + + return +} + +func NewUninstallLogAgentResponse() (response *UninstallLogAgentResponse) { + response = &UninstallLogAgentResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return +} + +// UninstallLogAgent +// 从TKE集群中卸载CLS日志采集组件 +// +// 可能返回的错误码: +// INTERNALERROR_UNEXPECTEDINTERNAL = "InternalError.UnexpectedInternal" +// INVALIDPARAMETER_PARAM = "InvalidParameter.Param" +func (c *Client) UninstallLogAgent(request *UninstallLogAgentRequest) (response *UninstallLogAgentResponse, err error) { + return c.UninstallLogAgentWithContext(context.Background(), request) +} + +// UninstallLogAgent +// 从TKE集群中卸载CLS日志采集组件 +// +// 可能返回的错误码: +// INTERNALERROR_UNEXPECTEDINTERNAL = "InternalError.UnexpectedInternal" +// INVALIDPARAMETER_PARAM = "InvalidParameter.Param" +func (c *Client) UninstallLogAgentWithContext(ctx context.Context, request *UninstallLogAgentRequest) (response *UninstallLogAgentResponse, err error) { + if request == nil { + request = NewUninstallLogAgentRequest() + } + + if c.GetCredential() == nil { + return nil, errors.New("UninstallLogAgent require credential") + } + + request.SetContext(ctx) + + response = NewUninstallLogAgentResponse() + err = c.Send(request, response) + return +} + func NewUpdateClusterVersionRequest() (request *UpdateClusterVersionRequest) { request = &UpdateClusterVersionRequest{ BaseRequest: &tchttp.BaseRequest{}, @@ -6785,12 +7931,14 @@ func NewUpdateClusterVersionResponse() (response *UpdateClusterVersionResponse) // 升级集群 Master 组件到指定版本 // // 可能返回的错误码: +// FAILEDOPERATION_CLUSTERUPGRADENODEVERSION = "FailedOperation.ClusterUpgradeNodeVersion" // INTERNALERROR = "InternalError" // INTERNALERROR_CLUSTERUPGRADENODEVERSION = "InternalError.ClusterUpgradeNodeVersion" // INTERNALERROR_PARAM = "InternalError.Param" // INTERNALERROR_UNEXPECTEDINTERNAL = "InternalError.UnexpectedInternal" // INVALIDPARAMETER = "InvalidParameter" // INVALIDPARAMETER_PARAM = "InvalidParameter.Param" +// RESOURCENOTFOUND = "ResourceNotFound" // RESOURCEUNAVAILABLE_CLUSTERSTATE = "ResourceUnavailable.ClusterState" func (c *Client) UpdateClusterVersion(request *UpdateClusterVersionRequest) (response *UpdateClusterVersionResponse, err error) { return c.UpdateClusterVersionWithContext(context.Background(), request) @@ -6800,12 +7948,14 @@ func (c *Client) UpdateClusterVersion(request *UpdateClusterVersionRequest) (res // 升级集群 Master 组件到指定版本 // // 可能返回的错误码: +// FAILEDOPERATION_CLUSTERUPGRADENODEVERSION = "FailedOperation.ClusterUpgradeNodeVersion" // INTERNALERROR = "InternalError" // INTERNALERROR_CLUSTERUPGRADENODEVERSION = "InternalError.ClusterUpgradeNodeVersion" // INTERNALERROR_PARAM = "InternalError.Param" // INTERNALERROR_UNEXPECTEDINTERNAL = "InternalError.UnexpectedInternal" // INVALIDPARAMETER = "InvalidParameter" // INVALIDPARAMETER_PARAM = "InvalidParameter.Param" +// RESOURCENOTFOUND = "ResourceNotFound" // RESOURCEUNAVAILABLE_CLUSTERSTATE = "ResourceUnavailable.ClusterState" func (c *Client) UpdateClusterVersionWithContext(ctx context.Context, request *UpdateClusterVersionRequest) (response *UpdateClusterVersionResponse, err error) { if request == nil { @@ -6964,6 +8114,7 @@ func NewUpdateImageCacheResponse() (response *UpdateImageCacheResponse) { // 更新镜像缓存接口 // // 可能返回的错误码: +// RESOURCENOTFOUND = "ResourceNotFound" // UNSUPPORTEDOPERATION = "UnsupportedOperation" func (c *Client) UpdateImageCache(request *UpdateImageCacheRequest) (response *UpdateImageCacheResponse, err error) { return c.UpdateImageCacheWithContext(context.Background(), request) @@ -6973,6 +8124,7 @@ func (c *Client) UpdateImageCache(request *UpdateImageCacheRequest) (response *U // 更新镜像缓存接口 // // 可能返回的错误码: +// RESOURCENOTFOUND = "ResourceNotFound" // UNSUPPORTEDOPERATION = "UnsupportedOperation" func (c *Client) UpdateImageCacheWithContext(ctx context.Context, request *UpdateImageCacheRequest) (response *UpdateImageCacheResponse, err error) { if request == nil { @@ -7011,6 +8163,7 @@ func NewUpgradeClusterInstancesResponse() (response *UpgradeClusterInstancesResp // 给集群的一批work节点进行升级 // // 可能返回的错误码: +// FAILEDOPERATION_TASKALREADYRUNNING = "FailedOperation.TaskAlreadyRunning" // INTERNALERROR_CLUSTERNOTFOUND = "InternalError.ClusterNotFound" // INTERNALERROR_PARAM = "InternalError.Param" // INTERNALERROR_TASKALREADYRUNNING = "InternalError.TaskAlreadyRunning" @@ -7018,6 +8171,7 @@ func NewUpgradeClusterInstancesResponse() (response *UpgradeClusterInstancesResp // INTERNALERROR_TASKNOTFOUND = "InternalError.TaskNotFound" // INTERNALERROR_UNEXCEPTEDINTERNAL = "InternalError.UnexceptedInternal" // INVALIDPARAMETER_PARAM = "InvalidParameter.Param" +// RESOURCENOTFOUND = "ResourceNotFound" // RESOURCEUNAVAILABLE_CLUSTERSTATE = "ResourceUnavailable.ClusterState" func (c *Client) UpgradeClusterInstances(request *UpgradeClusterInstancesRequest) (response *UpgradeClusterInstancesResponse, err error) { return c.UpgradeClusterInstancesWithContext(context.Background(), request) @@ -7027,6 +8181,7 @@ func (c *Client) UpgradeClusterInstances(request *UpgradeClusterInstancesRequest // 给集群的一批work节点进行升级 // // 可能返回的错误码: +// FAILEDOPERATION_TASKALREADYRUNNING = "FailedOperation.TaskAlreadyRunning" // INTERNALERROR_CLUSTERNOTFOUND = "InternalError.ClusterNotFound" // INTERNALERROR_PARAM = "InternalError.Param" // INTERNALERROR_TASKALREADYRUNNING = "InternalError.TaskAlreadyRunning" @@ -7034,6 +8189,7 @@ func (c *Client) UpgradeClusterInstances(request *UpgradeClusterInstancesRequest // INTERNALERROR_TASKNOTFOUND = "InternalError.TaskNotFound" // INTERNALERROR_UNEXCEPTEDINTERNAL = "InternalError.UnexceptedInternal" // INVALIDPARAMETER_PARAM = "InvalidParameter.Param" +// RESOURCENOTFOUND = "ResourceNotFound" // RESOURCEUNAVAILABLE_CLUSTERSTATE = "ResourceUnavailable.ClusterState" func (c *Client) UpgradeClusterInstancesWithContext(ctx context.Context, request *UpgradeClusterInstancesRequest) (response *UpgradeClusterInstancesResponse, err error) { if request == nil { diff --git a/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/tke/v20180525/errors.go b/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/tke/v20180525/errors.go index 919bc6c9e7..3578bbdee9 100644 --- a/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/tke/v20180525/errors.go +++ b/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/tke/v20180525/errors.go @@ -20,9 +20,108 @@ const ( // 操作失败。 FAILEDOPERATION = "FailedOperation" + // 获取用户认证信息失败。 + FAILEDOPERATION_ACCOUNTCOMMON = "FailedOperation.AccountCommon" + + // 账户未通过认证。 + FAILEDOPERATION_ACCOUNTUSERNOTAUTHENTICATED = "FailedOperation.AccountUserNotAuthenticated" + + // 伸缩组资源创建报错。 + FAILEDOPERATION_ASCOMMON = "FailedOperation.AsCommon" + + // CLB 未知错误。 + FAILEDOPERATION_CLBUNEXPECTEDERROR = "FailedOperation.CLBUnexpectedError" + + // CVM未知错误。 + FAILEDOPERATION_CVMUNEXPECTEDERROR = "FailedOperation.CVMUnexpectedError" + + // 无该接口CAM权限。 + FAILEDOPERATION_CAMNOAUTH = "FailedOperation.CamNoAuth" + + // 集群未找到。 + FAILEDOPERATION_CLUSTERNOTFOUND = "FailedOperation.ClusterNotFound" + + // 集群状态错误。 + FAILEDOPERATION_CLUSTERSTATE = "FailedOperation.ClusterState" + + // 集群节点版本过低。 + FAILEDOPERATION_CLUSTERUPGRADENODEVERSION = "FailedOperation.ClusterUpgradeNodeVersion" + + // 内部HTTP客户端错误。 + FAILEDOPERATION_COMPONENTCLIENTHTTP = "FailedOperation.ComponentClientHttp" + + // 内部HTTP解包失败。 + FAILEDOPERATION_COMPONENTCLIENTUNPACK = "FailedOperation.ComponentClientUnpack" + + // 请求(http请求)其他云服务失败。 + FAILEDOPERATION_COMPONENTCLINETHTTP = "FailedOperation.ComponentClinetHttp" + + // cvm创建节点报错。 + FAILEDOPERATION_CVMCOMMON = "FailedOperation.CvmCommon" + + // 存在云服务器在CVM侧查询不到。 + FAILEDOPERATION_CVMNUMBERNOTMATCH = "FailedOperation.CvmNumberNotMatch" + + // CVM 和 VPC ID 不匹配。 + FAILEDOPERATION_CVMVPCIDNOTMATCH = "FailedOperation.CvmVpcidNotMatch" + + // db错误。 + FAILEDOPERATION_DB = "FailedOperation.Db" + + // 记录未找到。 + FAILEDOPERATION_DBRECORDNOTFOUND = "FailedOperation.DbRecordNotFound" + + // 获得安全组配额失败。 + FAILEDOPERATION_DFWGETUSGQUOTA = "FailedOperation.DfwGetUSGQuota" + + // 连接用户Kubernetes集群失败。 + FAILEDOPERATION_KUBECLIENTCONNECTION = "FailedOperation.KubeClientConnection" + + // KubernetesAPI错误。 + FAILEDOPERATION_KUBECOMMON = "FailedOperation.KubeCommon" + + // 创建集群Client出错。 + FAILEDOPERATION_KUBERNETESCREATEOPERATIONERROR = "FailedOperation.KubernetesCreateOperationError" + + // Kubernetes未知错误。 + FAILEDOPERATION_KUBERNETESINTERNAL = "FailedOperation.KubernetesInternal" + + // 底层调用CLB未知错误。 + FAILEDOPERATION_LBCOMMON = "FailedOperation.LbCommon" + + // 网络扩展错误。 + FAILEDOPERATION_NETWORKSCALEERROR = "FailedOperation.NetworkScaleError" + + // 镜像OS不支持。 + FAILEDOPERATION_OSNOTSUPPORT = "FailedOperation.OsNotSupport" + + // 参数错误。 + FAILEDOPERATION_PARAM = "FailedOperation.Param" + + // 超过配额限制。 + FAILEDOPERATION_QUOTAMAXCLSLIMIT = "FailedOperation.QuotaMaxClsLimit" + + // 超过配额限制。 + FAILEDOPERATION_QUOTAMAXNODLIMIT = "FailedOperation.QuotaMaxNodLimit" + + // 安全组配额不足。 + FAILEDOPERATION_QUOTAUSGLIMIT = "FailedOperation.QuotaUSGLimit" + // 子账户RBAC权限不足。 FAILEDOPERATION_RBACFORBIDDEN = "FailedOperation.RBACForbidden" + // 已有相同任务执行中。 + FAILEDOPERATION_TASKALREADYRUNNING = "FailedOperation.TaskAlreadyRunning" + + // 询价错误。 + FAILEDOPERATION_TRADECOMMON = "FailedOperation.TradeCommon" + + // VPC未知错误。 + FAILEDOPERATION_VPCUNEXPECTEDERROR = "FailedOperation.VPCUnexpectedError" + + // 未发现vpc记录。 + FAILEDOPERATION_VPCRECODRNOTFOUND = "FailedOperation.VpcRecodrNotFound" + // 内部错误。 INTERNALERROR = "InternalError" @@ -149,6 +248,9 @@ const ( // Kubernetes未知错误。 INTERNALERROR_KUBERNETESINTERNAL = "InternalError.KubernetesInternal" + // Kubernetes Patch操作失败。 + INTERNALERROR_KUBERNETESPATCHOPERATIONERROR = "InternalError.KubernetesPatchOperationError" + // 底层调用CLB未知错误。 INTERNALERROR_LBCOMMON = "InternalError.LbCommon" @@ -245,6 +347,9 @@ const ( // 创建的路由与VPC下已存在的全局路由产生冲突。 INVALIDPARAMETER_CIDRCONFLICTWITHVPCGLOBALROUTE = "InvalidParameter.CidrConflictWithVpcGlobalRoute" + // CIDR无效。 + INVALIDPARAMETER_CIDRINVALI = "InvalidParameter.CidrInvali" + // 参数错误,CIDR不符合规范。 INVALIDPARAMETER_CIDRINVALID = "InvalidParameter.CidrInvalid" @@ -314,6 +419,9 @@ const ( // 资源不可用。 RESOURCEUNAVAILABLE = "ResourceUnavailable" + // 集群状态异常。 + RESOURCEUNAVAILABLE_CLUSTERINABNORMALSTAT = "ResourceUnavailable.ClusterInAbnormalStat" + // 集群状态不支持该操作。 RESOURCEUNAVAILABLE_CLUSTERSTATE = "ResourceUnavailable.ClusterState" diff --git a/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/tke/v20180525/models.go b/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/tke/v20180525/models.go index 52379aa14d..bfae72a973 100644 --- a/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/tke/v20180525/models.go +++ b/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/tke/v20180525/models.go @@ -720,7 +720,7 @@ type ClusterBasicSettings struct { // 容器的镜像版本,"DOCKER_CUSTOMIZE"(容器定制版),"GENERAL"(普通版本,默认值) OsCustomizeType *string `json:"OsCustomizeType,omitempty" name:"OsCustomizeType"` - // 是否开启节点的默认安全组(默认: 否,Aphla特性) + // 是否开启节点的默认安全组(默认: 否,Alpha特性) NeedWorkSecurityGroup *bool `json:"NeedWorkSecurityGroup,omitempty" name:"NeedWorkSecurityGroup"` // 当选择Cilium Overlay网络插件时,TKE会从该子网获取2个IP用来创建内网负载均衡 @@ -1059,74 +1059,6 @@ type ControllerStatus struct { Enabled *bool `json:"Enabled,omitempty" name:"Enabled"` } -type CreateClusterAsGroupRequest struct { - *tchttp.BaseRequest - - // 集群ID - ClusterId *string `json:"ClusterId,omitempty" name:"ClusterId"` - - // 伸缩组创建透传参数,json化字符串格式,详见[伸缩组创建实例](https://cloud.tencent.com/document/api/377/20440)接口。LaunchConfigurationId由LaunchConfigurePara参数创建,不支持填写 - AutoScalingGroupPara *string `json:"AutoScalingGroupPara,omitempty" name:"AutoScalingGroupPara"` - - // 启动配置创建透传参数,json化字符串格式,详见[创建启动配置](https://cloud.tencent.com/document/api/377/20447)接口。另外ImageId参数由于集群维度已经有的ImageId信息,这个字段不需要填写。UserData字段设置通过UserScript设置,这个字段不需要填写。 - LaunchConfigurePara *string `json:"LaunchConfigurePara,omitempty" name:"LaunchConfigurePara"` - - // 节点高级配置信息 - InstanceAdvancedSettings *InstanceAdvancedSettings `json:"InstanceAdvancedSettings,omitempty" name:"InstanceAdvancedSettings"` - - // 节点Label数组 - Labels []*Label `json:"Labels,omitempty" name:"Labels"` -} - -func (r *CreateClusterAsGroupRequest) 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 *CreateClusterAsGroupRequest) 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, "AutoScalingGroupPara") - delete(f, "LaunchConfigurePara") - delete(f, "InstanceAdvancedSettings") - delete(f, "Labels") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "CreateClusterAsGroupRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -type CreateClusterAsGroupResponse struct { - *tchttp.BaseResponse - Response *struct { - - // 启动配置ID - LaunchConfigurationId *string `json:"LaunchConfigurationId,omitempty" name:"LaunchConfigurationId"` - - // 伸缩组ID - AutoScalingGroupId *string `json:"AutoScalingGroupId,omitempty" name:"AutoScalingGroupId"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` - } `json:"Response"` -} - -func (r *CreateClusterAsGroupResponse) 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 *CreateClusterAsGroupResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - type CreateClusterEndpointRequest struct { *tchttp.BaseRequest @@ -1138,6 +1070,15 @@ type CreateClusterEndpointRequest struct { // 是否为外网访问(TRUE 外网访问 FALSE 内网访问,默认值: FALSE) IsExtranet *bool `json:"IsExtranet,omitempty" name:"IsExtranet"` + + // 设置域名 + Domain *string `json:"Domain,omitempty" name:"Domain"` + + // 使用的安全组,只有外网访问需要传递 + SecurityGroup *string `json:"SecurityGroup,omitempty" name:"SecurityGroup"` + + // 创建lb参数,只有外网访问需要设置 + ExtensiveParameters *string `json:"ExtensiveParameters,omitempty" name:"ExtensiveParameters"` } func (r *CreateClusterEndpointRequest) ToJsonString() string { @@ -1155,6 +1096,9 @@ func (r *CreateClusterEndpointRequest) FromJsonString(s string) error { delete(f, "ClusterId") delete(f, "SubnetId") delete(f, "IsExtranet") + delete(f, "Domain") + delete(f, "SecurityGroup") + delete(f, "ExtensiveParameters") if len(f) > 0 { return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "CreateClusterEndpointRequest has unknown keys!", "") } @@ -1941,6 +1885,48 @@ func (r *CreateImageCacheResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } +type CreatePrometheusAlertPolicyRequest struct { + *tchttp.BaseRequest +} + +func (r *CreatePrometheusAlertPolicyRequest) 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 *CreatePrometheusAlertPolicyRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "CreatePrometheusAlertPolicyRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +type CreatePrometheusAlertPolicyResponse struct { + *tchttp.BaseResponse + Response *struct { + + // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitempty" name:"RequestId"` + } `json:"Response"` +} + +func (r *CreatePrometheusAlertPolicyResponse) 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 *CreatePrometheusAlertPolicyResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + type CreatePrometheusAlertRuleRequest struct { *tchttp.BaseRequest @@ -2049,6 +2035,48 @@ func (r *CreatePrometheusDashboardResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } +type CreatePrometheusTempRequest struct { + *tchttp.BaseRequest +} + +func (r *CreatePrometheusTempRequest) 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 *CreatePrometheusTempRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "CreatePrometheusTempRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +type CreatePrometheusTempResponse struct { + *tchttp.BaseResponse + Response *struct { + + // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitempty" name:"RequestId"` + } `json:"Response"` +} + +func (r *CreatePrometheusTempResponse) 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 *CreatePrometheusTempResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + type CreatePrometheusTemplateRequest struct { *tchttp.BaseRequest @@ -2721,6 +2749,48 @@ func (r *DeleteImageCachesResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } +type DeletePrometheusAlertPolicyRequest struct { + *tchttp.BaseRequest +} + +func (r *DeletePrometheusAlertPolicyRequest) 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 *DeletePrometheusAlertPolicyRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DeletePrometheusAlertPolicyRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +type DeletePrometheusAlertPolicyResponse struct { + *tchttp.BaseResponse + Response *struct { + + // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitempty" name:"RequestId"` + } `json:"Response"` +} + +func (r *DeletePrometheusAlertPolicyResponse) 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 *DeletePrometheusAlertPolicyResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + type DeletePrometheusAlertRuleRequest struct { *tchttp.BaseRequest @@ -2771,6 +2841,90 @@ func (r *DeletePrometheusAlertRuleResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } +type DeletePrometheusTempRequest struct { + *tchttp.BaseRequest +} + +func (r *DeletePrometheusTempRequest) 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 *DeletePrometheusTempRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DeletePrometheusTempRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +type DeletePrometheusTempResponse struct { + *tchttp.BaseResponse + Response *struct { + + // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitempty" name:"RequestId"` + } `json:"Response"` +} + +func (r *DeletePrometheusTempResponse) 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 *DeletePrometheusTempResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +type DeletePrometheusTempSyncRequest struct { + *tchttp.BaseRequest +} + +func (r *DeletePrometheusTempSyncRequest) 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 *DeletePrometheusTempSyncRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DeletePrometheusTempSyncRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +type DeletePrometheusTempSyncResponse struct { + *tchttp.BaseResponse + Response *struct { + + // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitempty" name:"RequestId"` + } `json:"Response"` +} + +func (r *DeletePrometheusTempSyncResponse) 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 *DeletePrometheusTempSyncResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + type DeletePrometheusTemplateRequest struct { *tchttp.BaseRequest @@ -4918,41 +5072,83 @@ func (r *DescribePrometheusAlertHistoryResponse) FromJsonString(s string) error return json.Unmarshal([]byte(s), &r) } -type DescribePrometheusAlertRuleRequest struct { +type DescribePrometheusAlertPolicyRequest struct { *tchttp.BaseRequest - - // 实例id - InstanceId *string `json:"InstanceId,omitempty" name:"InstanceId"` - - // 分页 - Offset *uint64 `json:"Offset,omitempty" name:"Offset"` - - // 分页 - Limit *uint64 `json:"Limit,omitempty" name:"Limit"` - - // 过滤 - // 支持ID,Name - Filters []*Filter `json:"Filters,omitempty" name:"Filters"` } -func (r *DescribePrometheusAlertRuleRequest) ToJsonString() string { +func (r *DescribePrometheusAlertPolicyRequest) 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 *DescribePrometheusAlertRuleRequest) FromJsonString(s string) error { +func (r *DescribePrometheusAlertPolicyRequest) FromJsonString(s string) error { f := make(map[string]interface{}) if err := json.Unmarshal([]byte(s), &f); err != nil { return err } - delete(f, "InstanceId") - delete(f, "Offset") - delete(f, "Limit") - delete(f, "Filters") if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribePrometheusAlertRuleRequest has unknown keys!", "") + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribePrometheusAlertPolicyRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +type DescribePrometheusAlertPolicyResponse struct { + *tchttp.BaseResponse + Response *struct { + + // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitempty" name:"RequestId"` + } `json:"Response"` +} + +func (r *DescribePrometheusAlertPolicyResponse) 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 *DescribePrometheusAlertPolicyResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +type DescribePrometheusAlertRuleRequest struct { + *tchttp.BaseRequest + + // 实例id + InstanceId *string `json:"InstanceId,omitempty" name:"InstanceId"` + + // 分页 + Offset *uint64 `json:"Offset,omitempty" name:"Offset"` + + // 分页 + Limit *uint64 `json:"Limit,omitempty" name:"Limit"` + + // 过滤 + // 支持ID,Name + Filters []*Filter `json:"Filters,omitempty" name:"Filters"` +} + +func (r *DescribePrometheusAlertRuleRequest) 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 *DescribePrometheusAlertRuleRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "InstanceId") + delete(f, "Offset") + delete(f, "Limit") + delete(f, "Filters") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribePrometheusAlertRuleRequest has unknown keys!", "") } return json.Unmarshal([]byte(s), &r) } @@ -4983,6 +5179,48 @@ func (r *DescribePrometheusAlertRuleResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } +type DescribePrometheusClusterAgentsRequest struct { + *tchttp.BaseRequest +} + +func (r *DescribePrometheusClusterAgentsRequest) 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 *DescribePrometheusClusterAgentsRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribePrometheusClusterAgentsRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +type DescribePrometheusClusterAgentsResponse struct { + *tchttp.BaseResponse + Response *struct { + + // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitempty" name:"RequestId"` + } `json:"Response"` +} + +func (r *DescribePrometheusClusterAgentsResponse) 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 *DescribePrometheusClusterAgentsResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + type DescribePrometheusInstanceRequest struct { *tchttp.BaseRequest @@ -5055,6 +5293,48 @@ func (r *DescribePrometheusInstanceResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } +type DescribePrometheusInstancesOverviewRequest struct { + *tchttp.BaseRequest +} + +func (r *DescribePrometheusInstancesOverviewRequest) 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 *DescribePrometheusInstancesOverviewRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribePrometheusInstancesOverviewRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +type DescribePrometheusInstancesOverviewResponse struct { + *tchttp.BaseResponse + Response *struct { + + // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitempty" name:"RequestId"` + } `json:"Response"` +} + +func (r *DescribePrometheusInstancesOverviewResponse) 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 *DescribePrometheusInstancesOverviewResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + type DescribePrometheusOverviewsRequest struct { *tchttp.BaseRequest @@ -5118,6 +5398,48 @@ func (r *DescribePrometheusOverviewsResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } +type DescribePrometheusRecordRulesRequest struct { + *tchttp.BaseRequest +} + +func (r *DescribePrometheusRecordRulesRequest) 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 *DescribePrometheusRecordRulesRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribePrometheusRecordRulesRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +type DescribePrometheusRecordRulesResponse struct { + *tchttp.BaseResponse + Response *struct { + + // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitempty" name:"RequestId"` + } `json:"Response"` +} + +func (r *DescribePrometheusRecordRulesResponse) 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 *DescribePrometheusRecordRulesResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + type DescribePrometheusTargetsRequest struct { *tchttp.BaseRequest @@ -5181,6 +5503,90 @@ func (r *DescribePrometheusTargetsResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } +type DescribePrometheusTempRequest struct { + *tchttp.BaseRequest +} + +func (r *DescribePrometheusTempRequest) 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 *DescribePrometheusTempRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribePrometheusTempRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +type DescribePrometheusTempResponse struct { + *tchttp.BaseResponse + Response *struct { + + // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitempty" name:"RequestId"` + } `json:"Response"` +} + +func (r *DescribePrometheusTempResponse) 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 *DescribePrometheusTempResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +type DescribePrometheusTempSyncRequest struct { + *tchttp.BaseRequest +} + +func (r *DescribePrometheusTempSyncRequest) 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 *DescribePrometheusTempSyncRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribePrometheusTempSyncRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +type DescribePrometheusTempSyncResponse struct { + *tchttp.BaseResponse + Response *struct { + + // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitempty" name:"RequestId"` + } `json:"Response"` +} + +func (r *DescribePrometheusTempSyncResponse) 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 *DescribePrometheusTempSyncResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + type DescribePrometheusTemplateSyncRequest struct { *tchttp.BaseRequest @@ -5596,66 +6002,158 @@ func (r *DescribeVpcCniPodLimitsRequest) FromJsonString(s string) error { delete(f, "InstanceFamily") delete(f, "InstanceType") if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeVpcCniPodLimitsRequest has unknown keys!", "") + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeVpcCniPodLimitsRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +type DescribeVpcCniPodLimitsResponse struct { + *tchttp.BaseResponse + Response *struct { + + // 机型数据数量 + // 注意:此字段可能返回 null,表示取不到有效值。 + TotalCount *int64 `json:"TotalCount,omitempty" name:"TotalCount"` + + // 机型信息及其可支持的最大VPC-CNI模式Pod数量信息 + // 注意:此字段可能返回 null,表示取不到有效值。 + PodLimitsInstanceSet []*PodLimitsInstance `json:"PodLimitsInstanceSet,omitempty" name:"PodLimitsInstanceSet"` + + // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitempty" name:"RequestId"` + } `json:"Response"` +} + +func (r *DescribeVpcCniPodLimitsResponse) 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 *DescribeVpcCniPodLimitsResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +type DisableClusterAuditRequest struct { + *tchttp.BaseRequest + + // 集群ID + ClusterId *string `json:"ClusterId,omitempty" name:"ClusterId"` +} + +func (r *DisableClusterAuditRequest) 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 *DisableClusterAuditRequest) 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", "DisableClusterAuditRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +type DisableClusterAuditResponse struct { + *tchttp.BaseResponse + Response *struct { + + // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitempty" name:"RequestId"` + } `json:"Response"` +} + +func (r *DisableClusterAuditResponse) 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 *DisableClusterAuditResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +type DisableClusterDeletionProtectionRequest struct { + *tchttp.BaseRequest + + // 集群ID + ClusterId *string `json:"ClusterId,omitempty" name:"ClusterId"` +} + +func (r *DisableClusterDeletionProtectionRequest) 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 *DisableClusterDeletionProtectionRequest) 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", "DisableClusterDeletionProtectionRequest has unknown keys!", "") } return json.Unmarshal([]byte(s), &r) } -type DescribeVpcCniPodLimitsResponse struct { +type DisableClusterDeletionProtectionResponse struct { *tchttp.BaseResponse Response *struct { - // 机型数据数量 - // 注意:此字段可能返回 null,表示取不到有效值。 - TotalCount *int64 `json:"TotalCount,omitempty" name:"TotalCount"` - - // 机型信息及其可支持的最大VPC-CNI模式Pod数量信息 - // 注意:此字段可能返回 null,表示取不到有效值。 - PodLimitsInstanceSet []*PodLimitsInstance `json:"PodLimitsInstanceSet,omitempty" name:"PodLimitsInstanceSet"` - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } -func (r *DescribeVpcCniPodLimitsResponse) ToJsonString() string { +func (r *DisableClusterDeletionProtectionResponse) 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 *DescribeVpcCniPodLimitsResponse) FromJsonString(s string) error { +func (r *DisableClusterDeletionProtectionResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } -type DisableClusterDeletionProtectionRequest struct { +type DisableEventPersistenceRequest struct { *tchttp.BaseRequest // 集群ID ClusterId *string `json:"ClusterId,omitempty" name:"ClusterId"` } -func (r *DisableClusterDeletionProtectionRequest) ToJsonString() string { +func (r *DisableEventPersistenceRequest) 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 *DisableClusterDeletionProtectionRequest) FromJsonString(s string) error { +func (r *DisableEventPersistenceRequest) 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", "DisableClusterDeletionProtectionRequest has unknown keys!", "") + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DisableEventPersistenceRequest has unknown keys!", "") } return json.Unmarshal([]byte(s), &r) } -type DisableClusterDeletionProtectionResponse struct { +type DisableEventPersistenceResponse struct { *tchttp.BaseResponse Response *struct { @@ -5664,14 +6162,14 @@ type DisableClusterDeletionProtectionResponse struct { } `json:"Response"` } -func (r *DisableClusterDeletionProtectionResponse) ToJsonString() string { +func (r *DisableEventPersistenceResponse) 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 *DisableClusterDeletionProtectionResponse) FromJsonString(s string) error { +func (r *DisableEventPersistenceResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } @@ -5910,6 +6408,60 @@ type EksCluster struct { TagSpecification []*TagSpecification `json:"TagSpecification,omitempty" name:"TagSpecification"` } +type EnableClusterAuditRequest struct { + *tchttp.BaseRequest + + // 集群ID + ClusterId *string `json:"ClusterId,omitempty" name:"ClusterId"` + + // CLS日志集ID + LogsetId *string `json:"LogsetId,omitempty" name:"LogsetId"` + + // CLS日志主题ID + TopicId *string `json:"TopicId,omitempty" name:"TopicId"` +} + +func (r *EnableClusterAuditRequest) 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 *EnableClusterAuditRequest) 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, "LogsetId") + delete(f, "TopicId") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "EnableClusterAuditRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +type EnableClusterAuditResponse struct { + *tchttp.BaseResponse + Response *struct { + + // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitempty" name:"RequestId"` + } `json:"Response"` +} + +func (r *EnableClusterAuditResponse) 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 *EnableClusterAuditResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + type EnableClusterDeletionProtectionRequest struct { *tchttp.BaseRequest @@ -5956,6 +6508,60 @@ func (r *EnableClusterDeletionProtectionResponse) FromJsonString(s string) error return json.Unmarshal([]byte(s), &r) } +type EnableEventPersistenceRequest struct { + *tchttp.BaseRequest + + // 集群ID + ClusterId *string `json:"ClusterId,omitempty" name:"ClusterId"` + + // cls服务的logsetID + LogsetId *string `json:"LogsetId,omitempty" name:"LogsetId"` + + // cls服务的topicID + TopicId *string `json:"TopicId,omitempty" name:"TopicId"` +} + +func (r *EnableEventPersistenceRequest) 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 *EnableEventPersistenceRequest) 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, "LogsetId") + delete(f, "TopicId") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "EnableEventPersistenceRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +type EnableEventPersistenceResponse struct { + *tchttp.BaseResponse + Response *struct { + + // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitempty" name:"RequestId"` + } `json:"Response"` +} + +func (r *EnableEventPersistenceResponse) 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 *EnableEventPersistenceResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + type EnableVpcCniNetworkTypeRequest struct { *tchttp.BaseRequest @@ -6615,6 +7221,56 @@ type ImageRegistryCredential struct { Name *string `json:"Name,omitempty" name:"Name"` } +type InstallLogAgentRequest struct { + *tchttp.BaseRequest + + // TKE集群ID + ClusterId *string `json:"ClusterId,omitempty" name:"ClusterId"` + + // kubelet根目录 + KubeletRootDir *string `json:"KubeletRootDir,omitempty" name:"KubeletRootDir"` +} + +func (r *InstallLogAgentRequest) 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 *InstallLogAgentRequest) 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, "KubeletRootDir") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "InstallLogAgentRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +type InstallLogAgentResponse struct { + *tchttp.BaseResponse + Response *struct { + + // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitempty" name:"RequestId"` + } `json:"Response"` +} + +func (r *InstallLogAgentResponse) 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 *InstallLogAgentResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + type Instance struct { // 实例ID @@ -7329,6 +7985,48 @@ func (r *ModifyNodePoolInstanceTypesResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } +type ModifyPrometheusAlertPolicyRequest struct { + *tchttp.BaseRequest +} + +func (r *ModifyPrometheusAlertPolicyRequest) 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 *ModifyPrometheusAlertPolicyRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ModifyPrometheusAlertPolicyRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +type ModifyPrometheusAlertPolicyResponse struct { + *tchttp.BaseResponse + Response *struct { + + // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitempty" name:"RequestId"` + } `json:"Response"` +} + +func (r *ModifyPrometheusAlertPolicyResponse) 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 *ModifyPrometheusAlertPolicyResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + type ModifyPrometheusAlertRuleRequest struct { *tchttp.BaseRequest @@ -8442,6 +9140,48 @@ func (r *SetNodePoolNodeProtectionResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } +type SyncPrometheusTempRequest struct { + *tchttp.BaseRequest +} + +func (r *SyncPrometheusTempRequest) 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 *SyncPrometheusTempRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "SyncPrometheusTempRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +type SyncPrometheusTempResponse struct { + *tchttp.BaseResponse + Response *struct { + + // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitempty" name:"RequestId"` + } `json:"Response"` +} + +func (r *SyncPrometheusTempResponse) 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 *SyncPrometheusTempResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + type SyncPrometheusTemplateRequest struct { *tchttp.BaseRequest @@ -8556,6 +9296,52 @@ type TcpSocket struct { Port *uint64 `json:"Port,omitempty" name:"Port"` } +type UninstallLogAgentRequest struct { + *tchttp.BaseRequest + + // 集群ID + ClusterId *string `json:"ClusterId,omitempty" name:"ClusterId"` +} + +func (r *UninstallLogAgentRequest) 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 *UninstallLogAgentRequest) 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", "UninstallLogAgentRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +type UninstallLogAgentResponse struct { + *tchttp.BaseResponse + Response *struct { + + // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitempty" name:"RequestId"` + } `json:"Response"` +} + +func (r *UninstallLogAgentResponse) 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 *UninstallLogAgentResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + type UpdateClusterVersionRequest struct { *tchttp.BaseRequest diff --git a/vendor/modules.txt b/vendor/modules.txt index 3bdb79ed00..7277e77ce6 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -607,7 +607,7 @@ github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/tcaplusdb/v20190823 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/tcr/v20190924 # github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/tdmq v1.0.268 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/tdmq/v20200217 -# github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/tke v1.0.381 +# github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/tke v1.0.401 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/tke/v20180525 # github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/vod v1.0.199 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/vod/v20180717 diff --git a/website/docs/r/kubernetes_as_scaling_group.html.markdown b/website/docs/r/kubernetes_as_scaling_group.html.markdown index b98648823d..a516b57025 100644 --- a/website/docs/r/kubernetes_as_scaling_group.html.markdown +++ b/website/docs/r/kubernetes_as_scaling_group.html.markdown @@ -4,133 +4,18 @@ layout: "tencentcloud" page_title: "TencentCloud: tencentcloud_kubernetes_as_scaling_group" sidebar_current: "docs-tencentcloud-resource-kubernetes_as_scaling_group" description: |- - Provide a resource to create an auto scaling group for kubernetes cluster. + Auto scaling group for kubernetes cluster (offlined). --- # tencentcloud_kubernetes_as_scaling_group -Provide a resource to create an auto scaling group for kubernetes cluster. +Auto scaling group for kubernetes cluster (offlined). -~> **NOTE:** It has been deprecated and replaced by `tencentcloud_cluster_node_pool`. -~> **NOTE:** To use the custom Kubernetes component startup parameter function (parameter `extra_args`), you need to submit a ticket for application. +~> **NOTE:** This resource was offline no longer suppored. ## Example Usage -```hcl -resource "tencentcloud_kubernetes_as_scaling_group" "test" { - - cluster_id = "cls-kb32pbv4" - - auto_scaling_group { - scaling_group_name = "tf-guagua-as-group" - max_size = "5" - min_size = "0" - vpc_id = "vpc-dk8zmwuf" - subnet_ids = ["subnet-pqfek0t8"] - project_id = 0 - default_cooldown = 400 - desired_capacity = "0" - termination_policies = ["NEWEST_INSTANCE"] - retry_policy = "INCREMENTAL_INTERVALS" - - tags = { - "test" = "test" - } - - } - - auto_scaling_config { - configuration_name = "tf-guagua-as-config" - instance_type = "S1.SMALL1" - project_id = 0 - system_disk_type = "CLOUD_PREMIUM" - system_disk_size = "50" - - data_disk { - disk_type = "CLOUD_PREMIUM" - disk_size = 50 - } - - internet_charge_type = "TRAFFIC_POSTPAID_BY_HOUR" - internet_max_bandwidth_out = 10 - public_ip_assigned = true - password = "test123#" - enhanced_security_service = false - enhanced_monitor_service = false - - instance_tags = { - tag = "as" - } - - } - - labels = { - "test1" = "test1", - "test1" = "test2", - } -} -``` - -Use Kubelet - -```hcl -resource "tencentcloud_kubernetes_as_scaling_group" "test" { - - cluster_id = "cls-kb32pbv4" - - auto_scaling_group { - scaling_group_name = "tf-guagua-as-group" - max_size = "5" - min_size = "0" - vpc_id = "vpc-dk8zmwuf" - subnet_ids = ["subnet-pqfek0t8"] - project_id = 0 - default_cooldown = 400 - desired_capacity = "0" - termination_policies = ["NEWEST_INSTANCE"] - retry_policy = "INCREMENTAL_INTERVALS" - - tags = { - "test" = "test" - } - - } - - auto_scaling_config { - configuration_name = "tf-guagua-as-config" - instance_type = "S1.SMALL1" - project_id = 0 - system_disk_type = "CLOUD_PREMIUM" - system_disk_size = "50" - - data_disk { - disk_type = "CLOUD_PREMIUM" - disk_size = 50 - } - - internet_charge_type = "TRAFFIC_POSTPAID_BY_HOUR" - internet_max_bandwidth_out = 10 - public_ip_assigned = true - password = "test123#" - enhanced_security_service = false - enhanced_monitor_service = false - - instance_tags = { - tag = "as" - } - - } - - extra_args = [ - "root-dir=/var/lib/kubelet" - ] - - labels = { - "test1" = "test1", - "test1" = "test2", - } -} -``` + ## Argument Reference diff --git a/website/docs/r/kubernetes_cluster.html.markdown b/website/docs/r/kubernetes_cluster.html.markdown index 24c5761b2a..538388cc4c 100644 --- a/website/docs/r/kubernetes_cluster.html.markdown +++ b/website/docs/r/kubernetes_cluster.html.markdown @@ -406,6 +406,31 @@ resource "tencentcloud_kubernetes_cluster" "managed_cluster" { } ``` +Using ops options + +```hcl +resource "tencentcloud_kubernetes_cluster" "managed_cluster" { + # ...your basic fields + + log_agent { + enabled = true + kubelet_root_dir = "" # optional + } + + event_persistence { + enabled = true + log_set_id = "" # optional + log_set_topic = "" # optional + } + + cluster_audit { + enabled = true + log_set_id = "" # optional + log_set_topic = "" # optional + } +} +``` + ## Argument Reference The following arguments are supported: @@ -417,6 +442,7 @@ The following arguments are supported: * `base_pod_num` - (Optional, ForceNew) The number of basic pods. valid when enable_customized_pod_cidr=true. * `claim_expired_seconds` - (Optional) Claim expired seconds to recycle ENI. This field can only set when field `network_type` is 'VPC-CNI'. `claim_expired_seconds` must greater or equal than 300 and less than 15768000. * `cluster_as_enabled` - (Optional, ForceNew) Indicates whether to enable cluster node auto scaling. Default is false. +* `cluster_audit` - (Optional) Specify Cluster Audit config. NOTE: Please make sure your TKE CamRole have permission to access CLS service. * `cluster_cidr` - (Optional, ForceNew) A network address block of the cluster. Different from vpc cidr and cidr of other clusters within this vpc. Must be in 10./192.168/172.[16-31] segments. * `cluster_deploy_type` - (Optional, ForceNew) Deployment type of the cluster, the available values include: 'MANAGED_CLUSTER' and 'INDEPENDENT_CLUSTER'. Default is 'MANAGED_CLUSTER'. * `cluster_desc` - (Optional) Description of the cluster. @@ -437,6 +463,7 @@ The following arguments are supported: * `docker_graph_path` - (Optional, ForceNew) Docker graph path. Default is `/var/lib/docker`. * `enable_customized_pod_cidr` - (Optional) Whether to enable the custom mode of node podCIDR size. Default is false. * `eni_subnet_ids` - (Optional) Subnet Ids for cluster with VPC-CNI network mode. This field can only set when field `network_type` is 'VPC-CNI'. `eni_subnet_ids` can not empty once be set. +* `event_persistence` - (Optional) Specify cluster Event Persistence config. NOTE: Please make sure your TKE CamRole have permission to access CLS service. * `exist_instance` - (Optional, ForceNew) create tke cluster by existed instances. * `extension_addon` - (Optional, ForceNew) Information of the add-on to be installed. * `extra_args` - (Optional, ForceNew) Custom parameter information related to the node. @@ -445,6 +472,7 @@ The following arguments are supported: * `is_non_static_ip_mode` - (Optional, ForceNew) Indicates whether non-static ip mode is enabled. Default is false. * `kube_proxy_mode` - (Optional) Cluster kube-proxy mode, the available values include: 'kube-proxy-bpf'. Default is not set.When set to kube-proxy-bpf, cluster version greater than 1.14 and with Tencent Linux 2.4 is required. * `labels` - (Optional, ForceNew) Labels of tke cluster nodes. +* `log_agent` - (Optional) Specify cluster log agent config. * `managed_cluster_internet_security_policies` - (Optional) Security policies for managed cluster internet, like:'192.168.1.0/24' or '113.116.51.27', '0.0.0.0/0' means all. This field can only set when field `cluster_deploy_type` is 'MANAGED_CLUSTER' and `cluster_internet` is true. `managed_cluster_internet_security_policies` can not delete or empty once be set. * `master_config` - (Optional, ForceNew) Deploy the machine configuration information of the 'MASTER_ETCD' service, and create <=7 units for common users. * `mount_target` - (Optional, ForceNew) Mount target. Default is not mounting. @@ -465,6 +493,12 @@ The `auth_options` object supports the following: * `issuer` - (Optional) Specify service-account-issuer. * `jwks_uri` - (Optional) Specify service-account-jwks-uri. +The `cluster_audit` object supports the following: + +* `enabled` - (Required) Specify weather the Cluster Audit enabled. NOTE: Enable Cluster Audit will also auto install Log Agent. +* `log_set_id` - (Optional) Specify id of existing CLS log set, or auto create a new set by leave it empty. +* `topic_id` - (Optional) Specify id of existing CLS log topic, or auto create a new topic by leave it empty. + The `cluster_extra_args` object supports the following: * `kube_apiserver` - (Optional, ForceNew) The customized parameters for kube-apiserver. @@ -481,6 +515,12 @@ The `data_disk` object supports the following: * `mount_target` - (Optional, ForceNew) Mount target. * `snapshot_id` - (Optional, ForceNew) Data disk snapshot ID. +The `event_persistence` object supports the following: + +* `enabled` - (Required) Specify weather the Event Persistence enabled. +* `log_set_id` - (Optional) Specify id of existing CLS log set, or auto create a new set by leave it empty. +* `topic_id` - (Optional) Specify id of existing CLS log topic, or auto create a new topic by leave it empty. + The `exist_instance` object supports the following: * `desired_pod_numbers` - (Optional, ForceNew) Custom mode cluster, you can specify the number of pods for each node. corresponding to the existed_instances_para.instance_ids parameter. @@ -496,6 +536,11 @@ The `instances_para` object supports the following: * `instance_ids` - (Required, ForceNew) Cluster IDs. +The `log_agent` object supports the following: + +* `enabled` - (Required) Whether the log agent enabled. +* `kubelet_root_dir` - (Optional) Kubelet root directory as the literal. + The `master_config` object supports the following: * `instance_type` - (Required, ForceNew) Specified types of CVM instance.