Skip to content

Commit 1244d6c

Browse files
gitmknanonymous
andauthored
fix: modify example (#1536)
* fix: modify example * fix: modify example --------- Co-authored-by: anonymous <anonymous@mail.org>
1 parent 5bff622 commit 1244d6c

File tree

4 files changed

+59
-71
lines changed

4 files changed

+59
-71
lines changed

tencentcloud/resource_tc_monitor_tmp_tke_alert_policy.go

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -5,32 +5,26 @@ Example Usage
55
66
```hcl
77
8-
resource "tencentcloud_monitor_tmp_tke_alert_policy" "tmpAlertPolicy" {
9-
instance_id = "xxxxx"
8+
resource "tencentcloud_monitor_tmp_tke_alert_policy" "basic" {
9+
instance_id = "prom-xxxxxx"
1010
alert_rule {
11-
name = "xxx"
11+
name = "alert_rule-test"
1212
rules {
13-
name = "xx"
14-
rule = "xx"
15-
template = "xx"
16-
for = "xx"
13+
name = "rules-test"
14+
rule = "(count(kube_node_status_allocatable_cpu_cores) by (cluster) -1) / count(kube_node_status_allocatable_cpu_cores) by (cluster)"
15+
template = "The CPU requested by the Pod in the cluster {{ $labels.cluster }} is overloaded, and the current CPU application ratio is {{ $value | humanizePercentage }}"
16+
for = "5m"
1717
labels {
18-
name = "xx"
19-
value = "xx"
20-
}
21-
annotations {
22-
name = "xx"
23-
value = "xx"
18+
name = "severity"
19+
value = "warning"
2420
}
2521
}
2622
notification {
27-
type = "xx"
23+
type = "amp"
2824
enabled = true
2925
alert_manager {
30-
url = "xx"
31-
cluster_id = "xx"
32-
cluster_type = "xx"
33-
}
26+
url = "xxx"
27+
}
3428
}
3529
}
3630
}

tencentcloud/resource_tc_monitor_tmp_tke_global_notification.go

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -4,28 +4,28 @@ Provides a resource to create a tmp tke global notification
44
Example Usage
55
66
```hcl
7-
resource "tencentcloud_monitor_tmp_tke_global_notification" "tmpGlobalNotification" {
8-
instance_id = xxx
9-
notification{
10-
enabled = true
11-
type = "webhook"
12-
web_hook = ""
13-
alert_manager {
14-
url = ""
15-
cluster_type = ""
16-
cluster_id = ""
17-
}
18-
repeat_interval = ""
19-
time_range_start = ""
20-
time_range_end = ""
21-
notify_way = ["SMS", "EMAIL"]
22-
receiver_groups = [""]
23-
phone_notify_order = []
24-
phone_circle_times = xxx
25-
phone_inner_interval = xxx
26-
phone_circle_interval = xxx
27-
phone_arrive_notice = false
28-
}
7+
resource "tencentcloud_monitor_tmp_tke_global_notification" "basic" {
8+
instance_id = "prom-xxxxxx"
9+
notification {
10+
enabled = true
11+
type = "webhook"
12+
alert_manager {
13+
cluster_id = ""
14+
cluster_type = ""
15+
url = ""
16+
}
17+
web_hook = ""
18+
repeat_interval = "5m"
19+
time_range_start = "00:00:00"
20+
time_range_end = "23:59:59"
21+
notify_way = ["SMS", "EMAIL"]
22+
receiver_groups = []
23+
phone_notify_order = []
24+
phone_circle_times = 0
25+
phone_inner_interval = 0
26+
phone_circle_interval = 0
27+
phone_arrive_notice = false
28+
}
2929
}
3030
```
3131
*/

website/docs/r/monitor_tmp_tke_alert_policy.html.markdown

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -14,31 +14,25 @@ Provides a resource to create a tke tmpAlertPolicy
1414
## Example Usage
1515

1616
```hcl
17-
resource "tencentcloud_monitor_tmp_tke_alert_policy" "tmpAlertPolicy" {
18-
instance_id = "xxxxx"
17+
resource "tencentcloud_monitor_tmp_tke_alert_policy" "basic" {
18+
instance_id = "prom-xxxxxx"
1919
alert_rule {
20-
name = "xxx"
20+
name = "alert_rule-test"
2121
rules {
22-
name = "xx"
23-
rule = "xx"
24-
template = "xx"
25-
for = "xx"
22+
name = "rules-test"
23+
rule = "(count(kube_node_status_allocatable_cpu_cores) by (cluster) -1) / count(kube_node_status_allocatable_cpu_cores) by (cluster)"
24+
template = "The CPU requested by the Pod in the cluster {{ $labels.cluster }} is overloaded, and the current CPU application ratio is {{ $value | humanizePercentage }}"
25+
for = "5m"
2626
labels {
27-
name = "xx"
28-
value = "xx"
29-
}
30-
annotations {
31-
name = "xx"
32-
value = "xx"
27+
name = "severity"
28+
value = "warning"
3329
}
3430
}
3531
notification {
36-
type = "xx"
32+
type = "amp"
3733
enabled = true
3834
alert_manager {
39-
url = "xx"
40-
cluster_id = "xx"
41-
cluster_type = "xx"
35+
url = "xxx"
4236
}
4337
}
4438
}

website/docs/r/monitor_tmp_tke_global_notification.html.markdown

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,26 +14,26 @@ Provides a resource to create a tmp tke global notification
1414
## Example Usage
1515

1616
```hcl
17-
resource "tencentcloud_monitor_tmp_tke_global_notification" "tmpGlobalNotification" {
18-
instance_id = xxx
17+
resource "tencentcloud_monitor_tmp_tke_global_notification" "basic" {
18+
instance_id = "prom-xxxxxx"
1919
notification {
20-
enabled = true
21-
type = "webhook"
22-
web_hook = ""
20+
enabled = true
21+
type = "webhook"
2322
alert_manager {
24-
url = ""
25-
cluster_type = ""
2623
cluster_id = ""
24+
cluster_type = ""
25+
url = ""
2726
}
28-
repeat_interval = ""
29-
time_range_start = ""
30-
time_range_end = ""
27+
web_hook = ""
28+
repeat_interval = "5m"
29+
time_range_start = "00:00:00"
30+
time_range_end = "23:59:59"
3131
notify_way = ["SMS", "EMAIL"]
32-
receiver_groups = [""]
32+
receiver_groups = []
3333
phone_notify_order = []
34-
phone_circle_times = xxx
35-
phone_inner_interval = xxx
36-
phone_circle_interval = xxx
34+
phone_circle_times = 0
35+
phone_inner_interval = 0
36+
phone_circle_interval = 0
3737
phone_arrive_notice = false
3838
}
3939
}

0 commit comments

Comments
 (0)