{ "info": { "_postman_id": "53e46098-8624-4fb6-accb-0c8eff673843", "name": "Agility2018-ASM342", "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json" }, "item": [ { "_postman_id": "342e4596-d8be-49e4-a424-ec9d88faf1b5", "name": "Module3Lab1-ex1-GetAllASMPolicies", "event": [ { "listen": "test", "script": { "id": "a80d7230-04af-4cc2-a4fc-15950e1f8225", "type": "text/javascript", "exec": [ "", "" ] } } ], "request": { "method": "GET", "header": [ { "key": "Content-Type", "value": "application/json" } ], "body": {}, "url": { "raw": "https://{{bigipa_host}}/mgmt/tm/asm/policies/", "protocol": "https", "host": [ "{{bigipa_host}}" ], "path": [ "mgmt", "tm", "asm", "policies", "" ] } }, "response": [] }, { "_postman_id": "9794129a-34bc-4025-b3ad-8c173b08b9e3", "name": "Module3Lab1-ex2-GetAllASMPoliciesFilteredParam", "event": [ { "listen": "test", "script": { "id": "ba6fab62-71e4-44ee-8469-14ea05db108a", "type": "text/javascript", "exec": [ "", "", "" ] } } ], "request": { "method": "GET", "header": [ { "key": "Content-Type", "value": "application/json" } ], "body": {}, "url": { "raw": "https://{{bigipa_host}}/mgmt/tm/asm/policies/?$filter=name+eq+ansible1&$select=id", "protocol": "https", "host": [ "{{bigipa_host}}" ], "path": [ "mgmt", "tm", "asm", "policies", "" ], "query": [ { "key": "$filter", "value": "name+eq+ansible1" }, { "key": "$select", "value": "id" } ] } }, "response": [] }, { "_postman_id": "ae615549-628b-436d-b9d1-6b12b5ce8c4c", "name": "Module3Lab1-ex3-GetAllASMPoliciesFilteredTests", "event": [ { "listen": "test", "script": { "id": "11063f14-695e-4f2d-b210-b1031da12e5c", "type": "text/javascript", "exec": [ "//Store the response in a variable", "var getAllASMPoliciesData = JSON.parse(responseBody);", "", "//iterate through all the policies", "for (i = 0; i < getAllASMPoliciesData.totalItems; i++) {", " ", " //filter on the name and find the policy wiht the name \"ansible1\"", " if ( getAllASMPoliciesData.items[i].name == \"ansible1\" ) {", " ", " //set the policyid envirnment variable equal to the policy id", " pm.environment.set(\"policyid\",getAllASMPoliciesData.items[i].id)", " //print the policyid to the javascript console", " console.log( pm.environment.get(\"policyid\"))", "", " ", " }", " ", " ", "}", "", "" ] } } ], "request": { "method": "GET", "header": [ { "key": "Content-Type", "value": "application/json" } ], "body": {}, "url": { "raw": "https://{{bigipa_host}}/mgmt/tm/asm/policies", "protocol": "https", "host": [ "{{bigipa_host}}" ], "path": [ "mgmt", "tm", "asm", "policies" ] } }, "response": [] } ], "auth": { "type": "basic", "basic": [ { "key": "password", "value": "{{bigipa_password}}", "type": "string" }, { "key": "username", "value": "{{bigipa_user}}", "type": "string" }, { "key": "saveHelperData", "type": "any" }, { "key": "showPassword", "value": false, "type": "boolean" } ] }, "event": [ { "listen": "prerequest", "script": { "id": "9244f415-923a-402d-a049-a5a73a01b73a", "type": "text/javascript", "exec": [ "" ] } }, { "listen": "test", "script": { "id": "fb0afd19-c128-4a94-b5f9-4bd121229413", "type": "text/javascript", "exec": [ "" ] } } ], "variable": [ { "id": "70bae370-1591-4edd-a1c3-33f71d7f7bbb", "key": "bigipa_user", "value": "admin", "type": "string" }, { "id": "829a4776-2215-4b0c-bf15-79e7cd9418a7", "key": "bigipa_password", "value": "password", "type": "string" }, { "id": "59b84582-3e17-4a7a-ab33-ddb9aa4856de", "key": "ansible1_policyid", "value": "u-6T62j_f0XMkjJ_s_Z-gg", "type": "string" }, { "id": "acda9ea5-b108-4548-8be2-dc979ce6818f", "key": "bigipa_host", "value": "10.1.1.245", "type": "string" }, { "id": "507c063e-257d-4672-8622-0dec9152af4b", "key": "policyid", "value": "", "type": "string" } ] }