File tree Expand file tree Collapse file tree 3 files changed +18
-6
lines changed Expand file tree Collapse file tree 3 files changed +18
-6
lines changed Original file line number Diff line number Diff line change @@ -112,7 +112,19 @@ function namespace_command {
112112register 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
Original file line number Diff line number Diff line change 11#! /bin/bash
22ADC_VERSION=" v0.2.0"
3- ADC_LAST_COMMIT=" afc07f1824d883268d9e9d007c63ad3fd6e04de3 "
3+ ADC_LAST_COMMIT=" 423890fe40e000d1f75fa6fc96065877ecdb9e2c "
44USER_CONFIG=" $HOME /.appdynamics/adc/config.sh"
55GLOBAL_CONFIG=" /etc/appdynamics/adc/config.sh"
66CONFIG_CONTROLLER_COOKIE_LOCATION=" /tmp/appdynamics-controller-cookie.txt"
@@ -305,8 +305,8 @@ register _help Display the global usage information
305305function _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
310310Print the current version of $SCRIPTNAME
311311EOF
312312CONTROLLER_LOGIN_STATUS=0
Original file line number Diff line number Diff 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
99Print the current version of $SCRIPTNAME
1010EOF
You can’t perform that action at this time.
0 commit comments