Skip to content

Commit 7773eb5

Browse files
committed
Updated README.md
1 parent 423890f commit 7773eb5

File tree

3 files changed

+18
-6
lines changed

3 files changed

+18
-6
lines changed

README.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,19 @@ function namespace_command {
112112
register namespace_command help text
113113
```
114114

115-
Please note, that your plugins will not be validated, so you can change global behavior or break the script.
115+
To send a call to the AppDynamics controller you can use the `apiCall` helper, that allows you to easily create a subcommand:
116+
117+
```
118+
function tier_nodes {
119+
apiCall -X GET "/controller/rest/applications/\${a}/tiers/\${t}/nodes" "$@"
120+
}
121+
```
122+
123+
The command `adc.sh tier nodes` will now take two arguments (via -a and -t) and send the given request to the AppDynamics controller.
124+
125+
Since all other sub commands are loaded, you can reuse them in your plugin. Most importantly `call_controller` to send requests to the controller.
126+
127+
Please note, that your plugins will not be validated, so you can change global behaviour or break the script.
116128

117129
## Build
118130

adc.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22
ADC_VERSION="v0.2.0"
3-
ADC_LAST_COMMIT="afc07f1824d883268d9e9d007c63ad3fd6e04de3"
3+
ADC_LAST_COMMIT="423890fe40e000d1f75fa6fc96065877ecdb9e2c"
44
USER_CONFIG="$HOME/.appdynamics/adc/config.sh"
55
GLOBAL_CONFIG="/etc/appdynamics/adc/config.sh"
66
CONFIG_CONTROLLER_COOKIE_LOCATION="/tmp/appdynamics-controller-cookie.txt"
@@ -305,8 +305,8 @@ register _help Display the global usage information
305305
function _version {
306306
COMMAND_RESULT="$ADC_VERSION ~ $ADC_LAST_COMMIT"
307307
}
308-
register _config Print the current version of $SCRIPTNAME
309-
describe _config << EOF
308+
register _version Print the current version of $SCRIPTNAME
309+
describe _version << EOF
310310
Print the current version of $SCRIPTNAME
311311
EOF
312312
CONTROLLER_LOGIN_STATUS=0

commands/version.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ function _version {
44
COMMAND_RESULT="$ADC_VERSION ~ $ADC_LAST_COMMIT"
55
}
66

7-
register _config Print the current version of $SCRIPTNAME
8-
describe _config << EOF
7+
register _version Print the current version of $SCRIPTNAME
8+
describe _version << EOF
99
Print the current version of $SCRIPTNAME
1010
EOF

0 commit comments

Comments
 (0)