Skip to content

Commit

Permalink
Map existing sep commands to config, create new for list and delete
Browse files Browse the repository at this point in the history
  • Loading branch information
svrnm committed May 7, 2021
1 parent 46684e3 commit 2f91fa3
Show file tree
Hide file tree
Showing 4 changed files with 92 additions and 12 deletions.
6 changes: 4 additions & 2 deletions USAGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -409,8 +409,10 @@ List service endpoints

| Command | Description | Example |
| ------- | ----------- | ------- |
| list | List all SEPs. Provide an application id (-a). | `act.sh sep list -a 29` |
| update | Insert or Update SEPs. Provide an application id (-a) and a json string or a @file (-d) as parameter. | `act.sh sep update -a 29 -d @examples/sep.json` |
| config | List all SEP configurations. Provide an application id (-a). | `act.sh sep config -a 29` |
| delete | Delete SEPs Provide an id or an list of ids of service end points (-s) as parameter. | `act.sh sep delete -s 11705717,11705424` |
| list | List all SEPs Provide an application id (-a), a start timestamp (-s) and an end timestamp (-e) as parameters. | `act.sh sep list -a 29 -s 1610389435 -e 1620389435` |
| updateConfig | Insert or Update SEPs. Provide an application id (-a) and a json string or a @file (-d) as parameter. | `act.sh sep updateConfig -a 29 -d @examples/sep.json` |


## server
Expand Down
16 changes: 10 additions & 6 deletions act.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash
ACT_VERSION="v20.3.0"
ACT_LAST_COMMIT="2d76e711095ed5c5b6cd7affa9e55de9a91330d0"
ACT_VERSION="v21.1.0"
ACT_LAST_COMMIT="46684e3055da89ddf8fd1ff5847f55301445c786"
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 @@ -320,10 +320,14 @@ rde scope_list "List all scopes." "Provide an application id (-a) as parameter"
doc sep << EOF
List service endpoints
EOF
sep_list() { apiCall '/controller/api/accounts/{{i:accountid}}/applications/{{a:application}}/sep' "$@" ; }
rde sep_list "List all SEPs." "Provide an application id (-a)." "-a 29"
sep_update() { apiCall -X POST -d '{{d:sep_json}}' '/controller/api/accounts/{{i:accountid}}/applications/{{a:application}}/sep' "$@" ; }
rde sep_update "Insert or Update SEPs." "Provide an application id (-a) and a json string or a @file (-d) as parameter." "-a 29 -d @examples/sep.json"
sep_config() { apiCall '/controller/api/accounts/{{i:accountid}}/applications/{{a:application}}/sep' "$@" ; }
rde sep_config "List all SEP configurations." "Provide an application id (-a)." "-a 29"
sep_delete() { apiCall -X POST -d '[{{s:service_endpoints}}]' '/controller/restui/serviceEndpoint/delete' "$@" ; }
rde sep_delete "Delete SEPs" "Provide an id or an list of ids of service end points (-s) as parameter." "-s 11705717,11705424"
sep_list() { apiCall -X POST -d '{"requestFilter":{"queryParams":{"applicationId":{{a:application}},"mode":"FILTER_EXCLUDED"},"searchText":"","filters":{"type":[],"sepName":[]}},"columnSorts":[{"column":"NAME","direction":"ASC"}],"timeRangeStart":{{s:start}},"timeRangeEnd":{{e:end}}}' '/controller/restui/serviceEndpoint/list' "$@" ; }
rde sep_list "List all SEPs" "Provide an application id (-a), a start timestamp (-s) and an end timestamp (-e) as parameters." "-a 29 -s 1610389435 -e 1620389435"
sep_updateConfig() { apiCall -X POST -d '{{d:sep_json}}' '/controller/api/accounts/{{i:accountid}}/applications/{{a:application}}/sep' "$@" ; }
rde sep_updateConfig "Insert or Update SEPs." "Provide an application id (-a) and a json string or a @file (-d) as parameter." "-a 29 -d @examples/sep.json"
doc server << EOF
List servers, their properties and metrics
EOF
Expand Down
20 changes: 17 additions & 3 deletions commands.yml
Original file line number Diff line number Diff line change
Expand Up @@ -620,12 +620,26 @@ scope:
sep:
title: Service Endpoints
description: List service endpoints
list:
title: List all SEPs.
config:
title: List all SEP configurations.
description: Provide an application id (-a).
example: -a 29
endpoint: /controller/api/accounts/{{i:accountid}}/applications/{{a:application}}/sep
update:
list:
title: List all SEPs
description: Provide an application id (-a), a start timestamp (-s) and an end timestamp (-e) as parameters.
example: -a 29 -s 1610389435 -e 1620389435
method: POST
endpoint: /controller/restui/serviceEndpoint/list
payload: {\"requestFilter\":{\"queryParams\":{\"applicationId\":{{a:application}},\"mode\":\"FILTER_EXCLUDED\"},\"searchText\":\"\",\"filters\":{\"type\":[],\"sepName\":[]}},\"columnSorts\":[{\"column\":\"NAME\",\"direction\":\"ASC\"}],\"timeRangeStart\":{{s:start}},\"timeRangeEnd\":{{e:end}}}
delete:
title: Delete SEPs
description: Provide an id or an list of ids of service end points (-s) as parameter.
example: -s 11705717,11705424
method: POST
endpoint: /controller/restui/serviceEndpoint/delete
payload: [{{s:service_endpoints}}]
updateConfig:
title: Insert or Update SEPs.
description: Provide an application id (-a) and a json string or a @file (-d) as parameter.
example: -a 29 -d @examples/sep.json
Expand Down
62 changes: 61 additions & 1 deletion postman-collection.json
Original file line number Diff line number Diff line change
Expand Up @@ -2549,7 +2549,7 @@
"description": "Provide an application id (-a) as parameter"
}
}]},{"name": "sep","item": [{
"name": "List all SEPs.",
"name": "List all SEP configurations.",
"request": {
"method": "",
"header": [
Expand Down Expand Up @@ -2578,6 +2578,66 @@
},
"description": "Provide an application id (-a)."
}
},{
"name": "Delete SEPs",
"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": "[{{service_endpoints}}]"
},
"url": {
"raw": "{{controller_host}}/controller/restui/serviceEndpoint/delete",
"host": [
"{{controller_host}}"
],
"path": ["controller","restui","serviceEndpoint","delete"],
"query": []
},
"description": "Provide an id or an list of ids of service end points (-s) as parameter."
}
},{
"name": "List all SEPs",
"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": "{\"requestFilter\":{\"queryParams\":{\"applicationId\":{{application}},\"mode\":\"FILTER_EXCLUDED\"},\"searchText\":\"\",\"filters\":{\"type\":[],\"sepName\":[]}},\"columnSorts\":[{\"column\":\"NAME\",\"direction\":\"ASC\"}],\"timeRangeStart\":{{start}},\"timeRangeEnd\":{{end}}}"
},
"url": {
"raw": "{{controller_host}}/controller/restui/serviceEndpoint/list",
"host": [
"{{controller_host}}"
],
"path": ["controller","restui","serviceEndpoint","list"],
"query": []
},
"description": "Provide an application id (-a), a start timestamp (-s) and an end timestamp (-e) as parameters."
}
},{
"name": "Insert or Update SEPs.",
"request": {
Expand Down

0 comments on commit 2f91fa3

Please sign in to comment.