Skip to content

Commit

Permalink
Add update for dbmon, fix #21
Browse files Browse the repository at this point in the history
  • Loading branch information
svrnm committed Mar 23, 2020
1 parent 91179b9 commit 50c26f2
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 1 deletion.
1 change: 1 addition & 0 deletions USAGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@ Use the Database Visibility API to get, create, update, and delete Database Visi
| list | List all collectors. No further arguments required. | `act.sh dbmon list ` |
| 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` |
| servers | List all servers. No further arguments required. | `act.sh dbmon servers ` |
| update | Update a specific collector. Provide a json string or a @file (-d) as parameter. | `act.sh dbmon update -d @collector.json` |
| 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` |
| 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` |

Expand Down
4 changes: 3 additions & 1 deletion act.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash
ACT_VERSION="v0.5.0"
ACT_LAST_COMMIT="c3a1118a71fce876b65fe56b9e71ba790ea97c75"
ACT_LAST_COMMIT="91179b9156d77853cf0dda9358fcdbc10ac3e4dd"
USER_CONFIG="$HOME/.appdynamics/act/config.sh"
GLOBAL_CONFIG="/etc/appdynamics/act/config.sh"
CONFIG_CONTROLLER_COOKIE_LOCATION="/tmp/appdynamics-controller-cookie.txt"
Expand Down Expand Up @@ -208,6 +208,8 @@ dbmon_queries() { apiCall -X POST -d '{"cluster":false,"serverId":{{i:server_id}
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"
dbmon_servers() { apiCall '/controller/rest/databases/servers' "$@" ; }
rde dbmon_servers "List all servers." "No further arguments required." ""
dbmon_update() { apiCall -X POST -d '{{d:database_collector_update_definition}}' '/controller/rest/databases/collectors/update' "$@" ; }
rde dbmon_update "Update a specific collector." "Provide a json string or a @file (-d) as parameter." "-d @collector.json"
doc event << EOF
Create and list events in your business applications.
EOF
Expand Down
7 changes: 7 additions & 0 deletions commands.yml
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,13 @@ dbmon:
example: -c 17
method: GET
endpoint: /controller/rest/databases/collectors/{{c:database_collector}}
update:
title: Update a specific collector.
description: Provide a json string or a @file (-d) as parameter.
example: -d @collector.json
method: POST
endpoint: /controller/rest/databases/collectors/update
payload: {{d:database_collector_update_definition}}
delete:
title: Delete multiple collectors.
description: Provide a comma seperated list of collector analyticsSavedSearches
Expand Down
30 changes: 30 additions & 0 deletions postman-collection.json
Original file line number Diff line number Diff line change
Expand Up @@ -1468,6 +1468,36 @@
},
"description": "No further arguments required."
}
},{
"name": "Update a specific collector.",
"request": {
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/json;charset=UTF-8",
"type": "text"
},
{
"key": "X-CSRF-TOKEN",
"value": "{{X-CSRF-TOKEN}}",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "{{database_collector_update_definition}}"
},
"url": {
"raw": "{{controller_host}}/controller/rest/databases/collectors/update",
"host": [
"{{controller_host}}"
],
"path": ["controller","rest","databases","collectors","update"],
"query": []
},
"description": "Provide a json string or a @file (-d) as parameter."
}
}]},{"name": "event","item": [{
"name": "Create an event.",
"request": {
Expand Down

0 comments on commit 50c26f2

Please sign in to comment.