Skip to content

Commit 50c26f2

Browse files
committed
Add update for dbmon, fix #21
1 parent 91179b9 commit 50c26f2

File tree

4 files changed

+41
-1
lines changed

4 files changed

+41
-1
lines changed

USAGE.md

+1
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,7 @@ Use the Database Visibility API to get, create, update, and delete Database Visi
212212
| list | List all collectors. No further arguments required. | `act.sh dbmon list ` |
213213
| queries | Get queries for a server. Requires a server id (-i), a start time (-b) and an end time (-f) as parameters. | `act.sh dbmon queries -i 2 -b 1545237000000 -f 1545238602` |
214214
| servers | List all servers. No further arguments required. | `act.sh dbmon servers ` |
215+
| update | Update a specific collector. Provide a json string or a @file (-d) as parameter. | `act.sh dbmon update -d @collector.json` |
215216
| create | Create a new database collector. You need to provide the following parameters:"<br>"/ -i name"<br>"/ -u user name"<br>"/ -h host name"<br>"/ -a agent name"<br>"/ -t type"<br>"/ -d database name"<br>"/ -p port"<br>"/ -s password | `act.sh dbmon create -i MyTestDB -h localhost -n db -u user -a "Default Database Agent" -t DB2 -p 1555 -s password` |
216217
| events | List all database agent events. This is an alias for `act.sh event list -a '_dbmon'`, so you can use the same parameters for querying the events. | `act.sh dbmon events -t BEFORE_NOW -d 60 -s INFO,WARN,ERROR -e AGENT_EVENT` |
217218

act.sh

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22
ACT_VERSION="v0.5.0"
3-
ACT_LAST_COMMIT="c3a1118a71fce876b65fe56b9e71ba790ea97c75"
3+
ACT_LAST_COMMIT="91179b9156d77853cf0dda9358fcdbc10ac3e4dd"
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"
@@ -208,6 +208,8 @@ dbmon_queries() { apiCall -X POST -d '{"cluster":false,"serverId":{{i:server_id}
208208
rde dbmon_queries "Get queries for a server." "Requires a server id (-i), a start time (-b) and an end time (-f) as parameters." "-i 2 -b 1545237000000 -f 1545238602"
209209
dbmon_servers() { apiCall '/controller/rest/databases/servers' "$@" ; }
210210
rde dbmon_servers "List all servers." "No further arguments required." ""
211+
dbmon_update() { apiCall -X POST -d '{{d:database_collector_update_definition}}' '/controller/rest/databases/collectors/update' "$@" ; }
212+
rde dbmon_update "Update a specific collector." "Provide a json string or a @file (-d) as parameter." "-d @collector.json"
211213
doc event << EOF
212214
Create and list events in your business applications.
213215
EOF

commands.yml

+7
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,13 @@ dbmon:
289289
example: -c 17
290290
method: GET
291291
endpoint: /controller/rest/databases/collectors/{{c:database_collector}}
292+
update:
293+
title: Update a specific collector.
294+
description: Provide a json string or a @file (-d) as parameter.
295+
example: -d @collector.json
296+
method: POST
297+
endpoint: /controller/rest/databases/collectors/update
298+
payload: {{d:database_collector_update_definition}}
292299
delete:
293300
title: Delete multiple collectors.
294301
description: Provide a comma seperated list of collector analyticsSavedSearches

postman-collection.json

+30
Original file line numberDiff line numberDiff line change
@@ -1468,6 +1468,36 @@
14681468
},
14691469
"description": "No further arguments required."
14701470
}
1471+
},{
1472+
"name": "Update a specific collector.",
1473+
"request": {
1474+
"method": "POST",
1475+
"header": [
1476+
{
1477+
"key": "Content-Type",
1478+
"value": "application/json;charset=UTF-8",
1479+
"type": "text"
1480+
},
1481+
{
1482+
"key": "X-CSRF-TOKEN",
1483+
"value": "{{X-CSRF-TOKEN}}",
1484+
"type": "text"
1485+
}
1486+
],
1487+
"body": {
1488+
"mode": "raw",
1489+
"raw": "{{database_collector_update_definition}}"
1490+
},
1491+
"url": {
1492+
"raw": "{{controller_host}}/controller/rest/databases/collectors/update",
1493+
"host": [
1494+
"{{controller_host}}"
1495+
],
1496+
"path": ["controller","rest","databases","collectors","update"],
1497+
"query": []
1498+
},
1499+
"description": "Provide a json string or a @file (-d) as parameter."
1500+
}
14711501
}]},{"name": "event","item": [{
14721502
"name": "Create an event.",
14731503
"request": {

0 commit comments

Comments
 (0)