Skip to content

Commit 07d9c97

Browse files
committed
Replace function with ()
1 parent b70cd27 commit 07d9c97

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+301
-211
lines changed

USAGE.md

+2-2

act.sh

+138-138
Large diffs are not rendered by default.

commands.yml

+8-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ action:
1616
import:
1717
title: Import actions.
1818
description: Provide an application id or name as parameter (-a) and a json string or a file (with @ as prefix) as parameter (-d)
19-
example: -a 15 -F @actions.json
19+
example: -a 15 -d @actions.json
2020
method: POST
2121
endpoint: /controller/actions/{{a:application}}
2222
form: file={{d:actions}}
@@ -448,6 +448,12 @@ server:
448448
example: -i 244
449449
method: GET
450450
endpoint: /controller/sim/v2/user/machines/{{m:machine}}
451+
list:
452+
title: List all machines.
453+
description: No additional argument required.
454+
example:
455+
method: GET
456+
endpoint: /controller/sim/v2/user/machines
451457
snapshot:
452458
title: Snapshot API
453459
description: List APM snapshots.
@@ -474,6 +480,7 @@ synthetic:
474480
method: POST
475481
endpoint: /controller/restui/synthetic/schedule/{{a:application}}/updateSchedule
476482
payload: {{d:synthetic_job}}
483+
expand: true
477484
snapshot:
478485
title: Generate synthetic snapshot.
479486
description: Provide an EUM application (-a), a brower (-b) and an URL (-u) as parameter.

commands/actiontemplate/delete.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22

3-
function actiontemplate_delete {
3+
actiontemplate_delete() {
44
local TYPE="httprequest"
55
local ID=0
66
while getopts "t:i:" opt "$@";

commands/actiontemplate/import.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22

3-
function actiontemplate_import {
3+
actiontemplate_import() {
44
local FILE=""
55
local TYPE="httprequest"
66
while getopts "t:" opt "$@";

commands/actiontemplate/list.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22

3-
function actiontemplate_list {
3+
actiontemplate_list() {
44
local TYPE="httprequest"
55
while getopts "t:" opt "$@";
66
do

commands/analyticssearch/import.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22

3-
function analyticssearch_import {
3+
analyticssearch_import() {
44
FILE="$*"
55
if [ -r "${FILE}" ] ; then
66
DATA="$(<${FILE})"

commands/config.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22

3-
function _config {
3+
_config() {
44
environment_add -d "$@"
55
}
66

commands/controller/call.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22

3-
function controller_call {
3+
controller_call() {
44
debug "Calling $CONFIG_CONTROLLER_HOST"
55
local METHOD="GET"
66
local FORM=""

commands/controller/isup.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22

3-
function controller_isup {
3+
controller_isup() {
44
local START
55
local END
66
declare -i END

commands/controller/login.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
CONTROLLER_LOGIN_STATUS=0
44

5-
function controller_login {
5+
controller_login() {
66
debug "Login at ${CONFIG_CONTROLLER_HOST} with ${CONFIG_CONTROLLER_CREDENTIALS}"
77
LOGIN_RESPONSE=$(httpClient -sI -c "${CONFIG_CONTROLLER_COOKIE_LOCATION}" --user "${CONFIG_CONTROLLER_CREDENTIALS}" "${CONFIG_CONTROLLER_HOST}/controller/auth?action=login")
88
debug "RESPONSE: ${LOGIN_RESPONSE}"

commands/controller/ping.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22

3-
function controller_ping {
3+
controller_ping() {
44
debug "Ping $CONFIG_CONTROLLER_HOST"
55
local PING_RESPONSE=$(httpClient -sI $CONFIG_CONTROLLER_HOST -w "RESPONSE=%{http_code} TIME_TOTAL=%{time_total}")
66
debug "RESPONSE: ${PING_RESPONSE}"

commands/controller/version.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22

3-
function controller_version {
3+
controller_version() {
44
controller_call -X GET /controller/rest/serverstatus
55
COMMAND_RESULT=`echo -e $COMMAND_RESULT | sed -n -e 's/.*Controller v\(.*\) Build.*/\1/p'`
66
}

commands/dbmon/create.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22

3-
function dbmon_create {
3+
dbmon_create() {
44
apiCall -X POST -d "{ \
55
\"name\": \"{{i}}\",\
66
\"username\": \"{{u}}\",\

commands/dbmon/events.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22

3-
function dbmon_events {
3+
dbmon_events() {
44
event_list -a '_dbmon' "$@"
55
}
66

commands/doc.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22

3-
function _doc {
3+
_doc() {
44
read -r -d '' COMMAND_RESULT <<- EOM
55
# Usage
66
Below you will find a list of all available namespaces and commands available with

commands/download/get.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22

3-
function download_get {
3+
download_get() {
44
local WORKING_DIRECTORY="."
55
local DOWNLOAD_DRYRUN=0
66
local DOWNLOAD_ALL_MATCHES=1
@@ -55,7 +55,7 @@ function download_get {
5555
output "Dry run."
5656
fi
5757
done
58-
COMMAND_RESULT="Successfully downloaded `basename ${FILE}` to ${WORKING_DIRECTORY}"
58+
COMMAND_RESULT="Successfully downloaded $(bashBasename ${FILE}) to ${WORKING_DIRECTORY}"
5959
cd "${OLD_DIRECTORY}" || exit
6060
fi
6161
else

commands/download/list.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22

3-
function download_list {
3+
download_list() {
44
local FILES
55
local DELIMITER='"filename":'
66
local ENTRY
@@ -25,7 +25,7 @@ function download_list {
2525
output "Downloading list of available files. Please wait."
2626
FILES=$(httpClient -s https://download.appdynamics.com/download/downloadfilelatest/)
2727
#delimiter='"download_path":'
28-
s=$FILES${DELIMITER}
28+
local s=$FILES${DELIMITER}
2929
COMMAND_RESULT=""
3030
while [[ $s ]]; do
3131
ENTRY="${s%%"${DELIMITER}"*}\n\n"

commands/download/login.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
PORTAL_LOGIN_STATUS=0
33
PORTAL_LOGIN_TOKEN=""
44

5-
function download_login {
5+
download_login() {
66
if [ -n "$CONFIG_PORTAL_CREDENTIALS" ] ; then
77
USERNAME=${CONFIG_PORTAL_CREDENTIALS%%:*}
88
PASSWORD=${CONFIG_PORTAL_CREDENTIALS#*:}

commands/environment/add.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22

3-
function environment_add {
3+
environment_add() {
44
local FORCE=0
55
local GLOBAL=0
66
local SHOW=0

commands/environment/delete.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22

3-
function environment_delete {
3+
environment_delete() {
44
rm "${HOME}/.appdynamics/act/config.$1.sh"
55
COMMAND_RESULT="${1} deleted"
66
}

commands/environment/edit.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22

3-
function environment_edit {
3+
environment_edit() {
44
if [ -x "${EDITOR}" ] || [ -x "`which "${EDITOR}"`" ] ; then
55
${EDITOR} "${HOME}/.appdynamics/act/config.$1.sh"
66
else

commands/environment/export.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22

3-
function environment_export {
3+
environment_export() {
44
environment_source "${1}";
55

66
local USER_AND_ACCOUNT="${CONFIG_CONTROLLER_CREDENTIALS%%:*}"

commands/environment/get.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22

3-
function environment_get {
3+
environment_get() {
44
COMMAND_RESULT=`cat "${HOME}/.appdynamics/act/config.$1.sh"`
55
}
66

commands/environment/list.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
#!/bin/bash
22

3-
function environment_list {
3+
environment_list() {
44
local BASE
55
local TEMP
66
COMMAND_RESULT="(default)"
77
for file in "${HOME}/.appdynamics/act/config."*".sh"
88
do
9-
BASE=`basename "${file}"`
9+
BASE=$(bashBasename "${file}")
1010
TEMP=${BASE#*.}
1111
COMMAND_RESULT="${COMMAND_RESULT} ${TEMP%.*}"
1212
done

commands/environment/source.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22

3-
function environment_source {
3+
environment_source() {
44
if [ "$1" == "" ] ; then
55
source "${HOME}/.appdynamics/act/config.sh"
66
else

commands/eum/getapps.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22

3-
function eum_getapps {
3+
eum_getapps() {
44
apiCall "/controller/restui/eumApplications/getAllEumApplicationsData?time-range=last_1_hour.BEFORE_NOW.-1.-1.60"
55
}
66

commands/event/list.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22

3-
function event_list {
3+
event_list() {
44
# Add some "ALL" magic
55
local PREV=""
66
local ARGS=()

commands/federation/setup.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22

3-
function federation_setup {
3+
federation_setup() {
44

55
local FRIEND_CONTROLLER_CREDENTIALS=""
66
local FRIEND_CONTROLLER_HOST=""

commands/healthrule/copy.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22

3-
function healthrule_copy {
3+
healthrule_copy() {
44
local SOURCE_APPLICATION=${CONFIG_CONTROLLER_DEFAULT_APPLICATION}
55
local TARGET_APPLICATION=""
66
local TARGET_ENVIRONMENT=""

commands/healthrule/import.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22

3-
function healthrule_import {
3+
healthrule_import() {
44
local APPLICATION=${CONFIG_CONTROLLER_DEFAULT_APPLICATION}
55
local FILE=""
66
while getopts "a:" opt "$@";

commands/help.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22

3-
function _help {
3+
_help() {
44
if [ "$1" = "" ] ; then
55
read -r -d '' COMMAND_RESULT <<- EOM
66
Usage: ${USAGE_DESCRIPTION}${EOL}

commands/metric/get.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22

3-
function metric_get {
3+
metric_get() {
44
local APPLICATION=${CONFIG_CONTROLLER_DEFAULT_APPLICATION}
55
local START_TIME=-1
66
local END_TIME=-1

commands/metric/list.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22

3-
function metric_list {
3+
metric_list() {
44
local APPLICATION=${CONFIG_CONTROLLER_DEFAULT_APPLICATION}
55
local METRIC_PATH=""
66
while getopts "a:" opt "$@";

commands/metric/tree.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
RECURSIVE_COMMAND_RESULT=""
44

5-
function metric_tree {
5+
metric_tree() {
66
local APPLICATION=${CONFIG_CONTROLLER_DEFAULT_APPLICATION}
77
local DEPTH=0
88
declare -i DEPTH

commands/server/list.sh

-11
This file was deleted.

commands/timerange/create.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22

3-
function timerange_create {
3+
timerange_create() {
44
local START_TIME=-1
55
local END_TIME=-1
66
local DURATION_IN_MINUTES=0

commands/timerange/delete.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22

3-
function timerange_delete {
3+
timerange_delete() {
44
local TIMERANGE_ID=$*
55
if [[ $TIMERANGE_ID =~ ^[0-9]+$ ]]; then
66
controller_call -X POST -d "$TIMERANGE_ID" /controller/restui/user/deleteCustomRange

commands/timerange/list.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22

3-
function timerange_list {
3+
timerange_list() {
44
controller_call -X GET /controller/restui/user/getAllCustomTimeRanges
55
}
66

commands/usage.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22

3-
function _usage {
3+
_usage() {
44
# shellcheck disable=SC2034
55
read -r -d '' COMMAND_RESULT <<- EOM
66
Usage: ${USAGE_DESCRIPTION}${EOL}

commands/version.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22

3-
function _version {
3+
_version() {
44
# shellcheck disable=SC2034
55
COMMAND_RESULT="$ACT_VERSION ~ $ACT_LAST_COMMIT (${GLOBAL_COMMANDS_COUNTER} commands)"
66
}

0 commit comments

Comments
 (0)