Skip to content

Commit 1a13530

Browse files
author
Chan Gao
committed
Add 'take template' sub command
1 parent 8f20397 commit 1a13530

8 files changed

Lines changed: 219 additions & 26 deletions

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ nr | backup | dashboards | - | -d &lt;backup_folder&gt;<br> -r &lt;result_file.l
4444
nr | restore | monitors | - | -d &lt;monitors_folder&gt;<br> -f &lt;monitor_filenames&gt;<br> -F &lt;file_contains_names&gt;<br> -m [skip\\|override\\|clean]<br> -r &lt;result_file.log&gt;<br>
4545
nr | restore | alertsconditions | - | -d &lt;alertsconditions_folder&gt;<br> -f &lt;alertscondition_filenames&gt;<br> -F &lt;file_contains_names&gt;<br> -m [skip\\|override\\|clean]<br> -r &lt;result_file.log&gt;<br>
4646
nr | restore | dashboards | - | -d &lt;dashboards_folder&gt;<br> -f &lt;dashboard_filenames&gt;<br> -F &lt;file_contains_names&gt;<br> -m [skip\\|override\\|clean]<br> -r &lt;result_file.log&gt;<br>
47+
nr | take | template | &lt;template type name&gt; |
4748

4849
## To start using nr CLI
4950

cmd/take/take_template.go

Lines changed: 199 additions & 3 deletions
Large diffs are not rendered by default.
Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,15 @@
11
{
2-
"data":
3-
{
4-
"critical_threshold": {
5-
"duration_minutes": 3,
6-
"time_function": "all",
7-
"value": 90
8-
},
9-
"comparison": "above",
10-
"enabled": true,
11-
"event_type": "${event_type}",
12-
"name": "${name}",
13-
"select_value": "cpuPercent",
14-
"type": "${type}"
15-
}
16-
}
17-
2+
"data": {
3+
"comparison": "above",
4+
"critical_threshold": {
5+
"duration_minutes": 3,
6+
"time_function": "all",
7+
"value": 90
8+
},
9+
"enabled": true,
10+
"event_type": "${event_type}",
11+
"name": "${name}",
12+
"select_value": "cpuPercent",
13+
"type": "${type}"
14+
}
15+
}

templates/create/alertsconditions/one_new_alertsconditions_nrql_template.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,4 @@
2020
"since_value": "string"
2121
}
2222
}
23-
}
24-
23+
}

templates/create/alertspolicies/one_new_alertspolicies_template.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
"incident_preference": "PER_POLICY",
44
"name": "${policy_name}"
55
}
6-
}
6+
}

templates/create/alertspolicies/samples/one_new_alertspolicies_sample.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
"incident_preference": "PER_POLICY",
44
"name": "My Test policy"
55
}
6-
}
6+
}

templates/create/dashboard/one_new_dashboard_template.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,4 @@
3131
],
3232
"filter": null
3333
}
34-
}
35-
34+
}

templates/create/monitor/one_new_monitor_simple_template.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@
1010
"slaThreshold": 7,
1111
"userId": 0,
1212
"options": {}
13-
}
13+
}

0 commit comments

Comments
 (0)