Skip to content

Commit f30c613

Browse files
committed
Add sub-command analyticsmetric list
1 parent 739b80a commit f30c613

File tree

4 files changed

+40
-1
lines changed

4 files changed

+40
-1
lines changed

USAGE.md

+1
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ Manage custom analytics metrics
106106
| Command | Description | Example |
107107
| ------- | ----------- | ------- |
108108
| create | Create analytics metric Provide an adql query (-q) and an event type (-e BROWSER_RECORD, BIZ_TXN) and a name (-n) as parameters. The description (-d) is optional. | `act.sh analyticsmetric create -q 'SELECT count(*) FROM browser_records' -e BROWSER_RECORD -n 'My Custom Metric'` |
109+
| list | List all analytics metrics | `act.sh analyticsmetric list ` |
109110

110111

111112
## analyticsschema

act.sh

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22
ACT_VERSION="v22.11.0"
3-
ACT_LAST_COMMIT="103026d3b4e9e8ceaa6cf3aa667df94d3888453a"
3+
ACT_LAST_COMMIT="739b80a0fcafeb3692d154d578257146850db9f7"
44
USER_CONFIG="$HOME/.appdynamics/act/config.sh"
55
GLOBAL_CONFIG="/etc/appdynamics/act/config.sh"
66
CONFIG_CONTROLLER_COOKIE_LOCATION="/tmp/appdynamics-controller-cookie.txt"
@@ -123,6 +123,8 @@ Manage custom analytics metrics
123123
EOF
124124
analyticsmetric_create() { apiCall -X POST -d '{"adqlQueryString":"{{q:query}}","eventType":"{{e:eventType}}","enabled":true,"queryType":"ADQL_QUERY","queryName":"{{n:queryname}}","queryDescription":"{{d:querydescription?}}"}' '/controller/restui/analyticsMetric/create' "$@" ; }
125125
rde analyticsmetric_create "Create analytics metric" "Provide an adql query (-q) and an event type (-e BROWSER_RECORD, BIZ_TXN) and a name (-n) as parameters. The description (-d) is optional." "-q 'SELECT count(*) FROM browser_records' -e BROWSER_RECORD -n 'My Custom Metric'"
126+
analyticsmetric_list() { apiCall '/controller/restui/analyticsMetric/getAnalyticsScheduledQueryReports' "$@" ; }
127+
rde analyticsmetric_list "List all analytics metrics" "" ""
126128
doc analyticsschema << EOF
127129
These commands allow you to manage analytics schemas.
128130
EOF

commands.yml

+6
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,12 @@ analyticsmetric:
217217
method: POST
218218
endpoint: /controller/restui/analyticsMetric/create
219219
payload: {\"adqlQueryString\":\"{{q:query}}\",\"eventType\":\"{{e:eventType}}\",\"enabled\":true,\"queryType\":\"ADQL_QUERY\",\"queryName\":\"{{n:queryname}}\",\"queryDescription\":\"{{d:querydescription?}}\"}
220+
list:
221+
title: List all analytics metrics
222+
description:
223+
example:
224+
method: GET
225+
endpoint: /controller/restui/analyticsMetric/getAnalyticsScheduledQueryReports
220226
analyticsschema:
221227
title: Analytics Schemas
222228
description: These commands allow you to manage analytics schemas.

postman-collection.json

+30
Original file line numberDiff line numberDiff line change
@@ -598,6 +598,36 @@
598598
},
599599
"description": "Provide an adql query (-q) and an event type (-e BROWSER_RECORD, BIZ_TXN) and a name (-n) as parameters. The description (-d) is optional."
600600
}
601+
},{
602+
"name": "List all analytics metrics",
603+
"request": {
604+
"method": "GET",
605+
"header": [
606+
{
607+
"key": "Content-Type",
608+
"value": "application/json;charset=UTF-8",
609+
"type": "text"
610+
},
611+
{
612+
"key": "X-CSRF-TOKEN",
613+
"value": "{{X-CSRF-TOKEN}}",
614+
"type": "text"
615+
}
616+
],
617+
"body": {
618+
"mode": "raw",
619+
"raw": ""
620+
},
621+
"url": {
622+
"raw": "{{controller_host}}/controller/restui/analyticsMetric/getAnalyticsScheduledQueryReports",
623+
"host": [
624+
"{{controller_host}}"
625+
],
626+
"path": ["controller","restui","analyticsMetric","getAnalyticsScheduledQueryReports"],
627+
"query": []
628+
},
629+
"description": ""
630+
}
601631
}]},{"name": "analyticsschema","item": [{
602632
"name": "List all analytics schemas.",
603633
"request": {

0 commit comments

Comments
 (0)