-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added optional arguments for apiCall and added event list
- Loading branch information
Showing
7 changed files
with
119 additions
and
119 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,10 @@ | ||
#!/bin/bash | ||
|
||
function event_create { | ||
local APPLICATION=${CONFIG_CONTROLLER_DEFAULT_APPLICATION} | ||
local NODE | ||
local TIER | ||
local SEVERITY | ||
local EVENTTYPE | ||
local BT | ||
local COMMENT | ||
while getopts "n:e:s:t:c:a:" opt "$@"; | ||
do | ||
case "${opt}" in | ||
n) | ||
NODE=${OPTARG} | ||
;; | ||
t) | ||
TIER=${OPTARG} | ||
;; | ||
s) | ||
SEVERITY=${OPTARG} | ||
;; | ||
e) | ||
EVENTTYPE=${OPTARG} | ||
;; | ||
b) | ||
BT=${OPTARG} | ||
;; | ||
c) | ||
COMMENT=`urlencode "$OPTARG"` | ||
;; | ||
a) | ||
APPLICATION=${OPTARG} | ||
;; | ||
esac | ||
done; | ||
shiftOptInd | ||
shift $SHIFTS | ||
SUMMARY=`urlencode "$*"` | ||
debug -X POST "/controller/rest/applications/${APPLICATION}/events?summary=${SUMMARY}&comment=${COMMENT}&eventtype=${EVENTTYPE}&severity=${SEVERITY}&bt=${BT}&node=${NODE}&tier=${TIER}" | ||
controller_call -X POST "/controller/rest/applications/${APPLICATION}/events?summary=${SUMMARY}&comment=${COMMENT}&eventtype=${EVENTTYPE}&severity=${SEVERITY}&bt=${BT}&node=${NODE}&tier=${TIER}" | ||
apiCall -X POST "/controller/rest/applications/\${a}/events?summary=\${s}&comment=\${c?}&eventtype=\${e}&severity=\${l}&bt=&\${b?}node=\${n?}&tier=\${t?}" "$@" | ||
} | ||
|
||
register event_create Create a custom event for a given application | ||
describe event_create << EOF | ||
Create a custom event for a given application | ||
Create a custom event for a given application. Application, summary, event type and severity are required parameters. | ||
EOF |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/bash | ||
|
||
function event_list { | ||
apiCall '/controller/rest/applications/${a}/events?time-range-type=${t}&duration-in-mins=${d?}&start-time=${b?}&end-time=${f?}&event-types=${e}&severities=${s}' "$@" | ||
} | ||
|
||
register event_list List all events for a given time range. | ||
describe event_list << EOF | ||
List all events for a given time range. | ||
EOF |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.