From 46684e3055da89ddf8fd1ff5847f55301445c786 Mon Sep 17 00:00:00 2001 From: Severin Neumann Date: Tue, 26 Jan 2021 11:52:20 +0100 Subject: [PATCH] Add eumCorrelation disable --- USAGE.md | 9 +++++++ act.sh | 7 ++++- commands.yml | 9 +++++++ postman-collection.json | 30 ++++++++++++++++++++++ recipes/disable_all_correlation_cookies.sh | 9 +++++++ 5 files changed, 63 insertions(+), 1 deletion(-) create mode 100755 recipes/disable_all_correlation_cookies.sh diff --git a/USAGE.md b/USAGE.md index e7c533a..b3d614b 100644 --- a/USAGE.md +++ b/USAGE.md @@ -264,6 +264,15 @@ Afterwards you can use `act.sh -E ` to call the given controller. | getapps | Get EUM Apps. | | +## eumCorrelation + +Manage correlation cookies for APM and EUM integration + +| Command | Description | Example | +| ------- | ----------- | ------- | +| disable | Disable all EUM correlation cookies. | `act.sh eumCorrelation disable -a 41` | + + ## event Create and list events in your business applications. diff --git a/act.sh b/act.sh index 35e5663..73a1823 100755 --- a/act.sh +++ b/act.sh @@ -1,6 +1,6 @@ #!/bin/bash ACT_VERSION="v20.3.0" -ACT_LAST_COMMIT="3bd5817c8aa788838c686c37ffe1fea56c39e90b" +ACT_LAST_COMMIT="2d76e711095ed5c5b6cd7affa9e55de9a91330d0" USER_CONFIG="$HOME/.appdynamics/act/config.sh" GLOBAL_CONFIG="/etc/appdynamics/act/config.sh" CONFIG_CONTROLLER_COOKIE_LOCATION="/tmp/appdynamics-controller-cookie.txt" @@ -223,6 +223,11 @@ dbmon_servers() { apiCall '/controller/rest/databases/servers' "$@" ; } rde dbmon_servers "List all servers." "No further arguments required." "" dbmon_update() { apiCall -X POST -d '{{d:database_collector_update_definition}}' '/controller/rest/databases/collectors/update' "$@" ; } rde dbmon_update "Update a specific collector." "Provide a json string or a @file (-d) as parameter." "-d @collector.json" +doc eumCorrelation << EOF +Manage correlation cookies for APM and EUM integration +EOF +eumCorrelation_disable() { apiCall -X POST -d '{"isEnabled":false,"includeRules":[],"excludeRules":[],"btHeaderInjectionForSafeAgentsEnabled":false}' '/controller/restui/configuration/userExperienceAppIntegration/businessTransactionEumCorrelation/saveConfiguration/{{a:application}}' "$@" ; } +rde eumCorrelation_disable "Disable all EUM correlation cookies." "" "-a 41" doc event << EOF Create and list events in your business applications. EOF diff --git a/commands.yml b/commands.yml index c852339..98bd1e4 100644 --- a/commands.yml +++ b/commands.yml @@ -700,6 +700,15 @@ synthetic: method: POST endpoint: /controller/restui/synthetic/schedule/{{a:application}}/updateScheduleBatch payload: {{d:synthetic_job}} +eumCorrelation: + title: User Experience App Integration + description: Manage correlation cookies for APM and EUM integration + disable: + title: Disable all EUM correlation cookies. + example: -a 41 + method: POST + endpoint: /controller/restui/configuration/userExperienceAppIntegration/businessTransactionEumCorrelation/saveConfiguration/{{a:application}} + payload: {\"isEnabled\":false,\"includeRules\":[],\"excludeRules\":[],\"btHeaderInjectionForSafeAgentsEnabled\":false} tier: title: Tiers description: List all tiers. diff --git a/postman-collection.json b/postman-collection.json index a88a48c..2350515 100644 --- a/postman-collection.json +++ b/postman-collection.json @@ -1648,6 +1648,36 @@ }, "description": "Provide a json string or a @file (-d) as parameter." } + }]},{"name": "eumCorrelation","item": [{ + "name": "Disable all EUM correlation cookies.", + "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": "{\"isEnabled\":false,\"includeRules\":[],\"excludeRules\":[],\"btHeaderInjectionForSafeAgentsEnabled\":false}" + }, + "url": { + "raw": "{{controller_host}}/controller/restui/configuration/userExperienceAppIntegration/businessTransactionEumCorrelation/saveConfiguration/{{a:application}}", + "host": [ + "{{controller_host}}" + ], + "path": ["controller","restui","configuration","userExperienceAppIntegration","businessTransactionEumCorrelation","saveConfiguration","{{application}}"], + "query": [] + }, + "description": "" + } }]},{"name": "event","item": [{ "name": "Create an event.", "request": { diff --git a/recipes/disable_all_correlation_cookies.sh b/recipes/disable_all_correlation_cookies.sh new file mode 100755 index 0000000..bf33ec4 --- /dev/null +++ b/recipes/disable_all_correlation_cookies.sh @@ -0,0 +1,9 @@ +#!/bin/bash +ENVIRONMENT=$1 +EXISTING_APPLICATION_IDS=$(../act.sh -E "${ENVIRONMENT}" application list | grep "" | sed "s# *\([^<]*\)#\1#g") + +for APPLICATION in $EXISTING_APPLICATION_IDS +do +echo "Disable correlation cookies for ${APPLICATION}" +../act.sh -E "${ENVIRONMENT}" eumCorrelation disable "${APPLICATION}" +done;