Skip to content

Commit 5a6d252

Browse files
committed
Add scope creation
1 parent 8706c0b commit 5a6d252

File tree

4 files changed

+41
-1
lines changed

4 files changed

+41
-1
lines changed

USAGE.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -361,6 +361,7 @@ Manage scopes for instrumentation
361361

362362
| Command | Description | Example |
363363
| ------- | ----------- | ------- |
364+
| create | Create a new scope. Provide an application id (-a) as parameter | `act.sh scope create ` |
364365
| list | List all scopes. Provide an application id (-a) as parameter | `act.sh scope list -a 25` |
365366

366367

act.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22
ACT_VERSION="v0.5.0"
3-
ACT_LAST_COMMIT="4b1db5aa618d4a3cccd93e11360660b38e53a2eb"
3+
ACT_LAST_COMMIT="8706c0b89707ebdc36628a80aeedcd32d3336c0b"
44
USER_CONFIG="$HOME/.appdynamics/act/config.sh"
55
GLOBAL_CONFIG="/etc/appdynamics/act/config.sh"
66
CONFIG_CONTROLLER_COOKIE_LOCATION="/tmp/appdynamics-controller-cookie.txt"
@@ -274,6 +274,8 @@ rde sam_list "List monitors." "This command requires no further arguments." ""
274274
doc scope << EOF
275275
Manage scopes for instrumentation
276276
EOF
277+
scope_create() { apiCall -X POST -d '{{d:scope_definition}}' '/controller/restui/transactionConfigProto/createScope?applicationId={{a:application}}' "$@" ; }
278+
rde scope_create "Create a new scope." "Provide an application id (-a) as parameter" ""
277279
scope_list() { apiCall '/controller/restui/transactionConfigProto/getScopes/{{a:application}}' "$@" ; }
278280
rde scope_list "List all scopes." "Provide an application id (-a) as parameter" "-a 25"
279281
doc sep << EOF

commands.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -512,6 +512,13 @@ scope:
512512
example: -a 25
513513
method: GET
514514
endpoint: /controller/restui/transactionConfigProto/getScopes/{{a:application}}
515+
create:
516+
title: Create a new scope.
517+
description: Provide an application id (-a) as parameter
518+
example -a 25 -d @scope.json
519+
method: POST
520+
endpoint: /controller/restui/transactionConfigProto/createScope?applicationId={{a:application}}
521+
payload: {{d:scope_definition}}
515522
sep:
516523
title: Service Endpoints
517524
description: List service endpoints

postman-collection.json

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2039,6 +2039,36 @@
20392039
"description": "This command requires no further arguments."
20402040
}
20412041
}]},{"name": "scope","item": [{
2042+
"name": "Create a new scope.",
2043+
"request": {
2044+
"method": "POST",
2045+
"header": [
2046+
{
2047+
"key": "Content-Type",
2048+
"value": "application/json;charset=UTF-8",
2049+
"type": "text"
2050+
},
2051+
{
2052+
"key": "X-CSRF-TOKEN",
2053+
"value": "{{X-CSRF-TOKEN}}",
2054+
"type": "text"
2055+
}
2056+
],
2057+
"body": {
2058+
"mode": "raw",
2059+
"raw": "{{scope_definition}}"
2060+
},
2061+
"url": {
2062+
"raw": "{{controller_host}}/controller/restui/transactionConfigProto/createScope?applicationId={{a:application}}",
2063+
"host": [
2064+
"{{controller_host}}"
2065+
],
2066+
"path": ["controller","restui","transactionConfigProto","createScope"],
2067+
"query": [{"key": "applicationId","value": "{{application}}"}]
2068+
},
2069+
"description": "Provide an application id (-a) as parameter"
2070+
}
2071+
},{
20422072
"name": "List all scopes.",
20432073
"request": {
20442074
"method": "GET",

0 commit comments

Comments
 (0)