├── 01-DNAC-Sandbox.postman_collection.json ├── DNAC-Sandbox.postman_environment.json ├── DNAC-SandboxProxy.postman_environment.json ├── LICENSE ├── README.md └── images ├── delete-status.png ├── delete-tag.png ├── find-tag.png ├── firstRequest.png ├── importing.png ├── network-device-get.png ├── tag-POST.png ├── task-fail.png └── task-response.png /01-DNAC-Sandbox.postman_collection.json: -------------------------------------------------------------------------------- 1 | { 2 | "info": { 3 | "_postman_id": "565a7a2b-1ddf-11e9-0195-073a522b088a", 4 | "name": "01-DNAC-Sandbox", 5 | "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json" 6 | }, 7 | "item": [ 8 | { 9 | "name": "1.Ticket", 10 | "description": "", 11 | "item": [ 12 | { 13 | "name": "https://{{dnac}}/api/system/v1/auth/token", 14 | "event": [ 15 | { 16 | "listen": "test", 17 | "script": { 18 | "type": "text/javascript", 19 | "exec": [ 20 | "var data = JSON.parse(responseBody);", 21 | "postman.setEnvironmentVariable(\"token\", data.Token);" 22 | ] 23 | } 24 | } 25 | ], 26 | "request": { 27 | "auth": { 28 | "type": "basic", 29 | "basic": [ 30 | { 31 | "key": "username", 32 | "value": "{{username}}", 33 | "type": "string" 34 | }, 35 | { 36 | "key": "password", 37 | "value": "{{password}}", 38 | "type": "string" 39 | }, 40 | { 41 | "key": "saveHelperData", 42 | "value": true, 43 | "type": "boolean" 44 | }, 45 | { 46 | "key": "showPassword", 47 | "value": false, 48 | "type": "boolean" 49 | } 50 | ] 51 | }, 52 | "method": "POST", 53 | "header": [ 54 | { 55 | "key": "content-type", 56 | "value": "application/json", 57 | "disabled": true 58 | }, 59 | { 60 | "key": "Authorization", 61 | "value": "Basic YWRtaW46R3JhcGV2aW5lMQ==" 62 | } 63 | ], 64 | "body": { 65 | "mode": "raw", 66 | "raw": "" 67 | }, 68 | "url": { 69 | "raw": "https://{{dnac}}:{{port}}/api/system/v1/auth/token", 70 | "protocol": "https", 71 | "host": [ 72 | "{{dnac}}" 73 | ], 74 | "port": "{{port}}", 75 | "path": [ 76 | "api", 77 | "system", 78 | "v1", 79 | "auth", 80 | "token" 81 | ] 82 | } 83 | }, 84 | "response": [] 85 | } 86 | ] 87 | }, 88 | { 89 | "name": "2.Network Device", 90 | "description": "", 91 | "item": [ 92 | { 93 | "name": "https://{{dnac}}:{{port}}/api/v1/network-device/1/14", 94 | "request": { 95 | "method": "GET", 96 | "header": [ 97 | { 98 | "key": "x-auth-token", 99 | "value": "{{token}}" 100 | } 101 | ], 102 | "body": {}, 103 | "url": { 104 | "raw": "https://{{dnac}}:{{port}}/api/v1/network-device/1/14", 105 | "protocol": "https", 106 | "host": [ 107 | "{{dnac}}" 108 | ], 109 | "port": "{{port}}", 110 | "path": [ 111 | "api", 112 | "v1", 113 | "network-device", 114 | "1", 115 | "14" 116 | ] 117 | }, 118 | "description": "This request uses the \"token\" variable generated from the POST request to get first 14 network-devices" 119 | }, 120 | "response": [] 121 | }, 122 | { 123 | "name": "https://{{dnac}}:{{port}}/api/v1/host?limit=100&offset=1", 124 | "request": { 125 | "method": "GET", 126 | "header": [ 127 | { 128 | "key": "x-auth-token", 129 | "value": "{{token}}" 130 | } 131 | ], 132 | "body": {}, 133 | "url": { 134 | "raw": "https://{{dnac}}:{{port}}/api/v1/host?limit=100&offset=1", 135 | "protocol": "https", 136 | "host": [ 137 | "{{dnac}}" 138 | ], 139 | "port": "{{port}}", 140 | "path": [ 141 | "api", 142 | "v1", 143 | "host" 144 | ], 145 | "query": [ 146 | { 147 | "key": "limit", 148 | "value": "100" 149 | }, 150 | { 151 | "key": "offset", 152 | "value": "1" 153 | } 154 | ] 155 | }, 156 | "description": "Example of the /host API" 157 | }, 158 | "response": [] 159 | }, 160 | { 161 | "name": "https://{{dnac}}:{{port}}/api/v1/network-device/ip-address/10.10.22.70", 162 | "event": [ 163 | { 164 | "listen": "test", 165 | "script": { 166 | "type": "text/javascript", 167 | "exec": [ 168 | "var data = JSON.parse(responseBody);", 169 | "console.log(\"here\");", 170 | "console.log(data.response.id);", 171 | "if (data.response.id) {", 172 | " tests[\"Body has id\"] = true;", 173 | " postman.setEnvironmentVariable(\"deviceId\", data.response.id);", 174 | "}", 175 | "else {", 176 | " tests[\"Body has id\"] = false;", 177 | "}", 178 | "" 179 | ] 180 | } 181 | } 182 | ], 183 | "request": { 184 | "method": "GET", 185 | "header": [ 186 | { 187 | "key": "x-auth-token", 188 | "value": "{{token}}" 189 | } 190 | ], 191 | "body": {}, 192 | "url": { 193 | "raw": "https://{{dnac}}:{{port}}/api/v1/network-device/ip-address/10.10.22.70", 194 | "protocol": "https", 195 | "host": [ 196 | "{{dnac}}" 197 | ], 198 | "port": "{{port}}", 199 | "path": [ 200 | "api", 201 | "v1", 202 | "network-device", 203 | "ip-address", 204 | "10.10.22.70" 205 | ] 206 | } 207 | }, 208 | "response": [] 209 | }, 210 | { 211 | "name": "https://{{dnac}}:{{port}}/api/v1/interface", 212 | "request": { 213 | "method": "GET", 214 | "header": [ 215 | { 216 | "key": "x-auth-token", 217 | "value": "{{token}}" 218 | } 219 | ], 220 | "body": {}, 221 | "url": { 222 | "raw": "https://{{dnac}}:{{port}}/api/v1/interface", 223 | "protocol": "https", 224 | "host": [ 225 | "{{dnac}}" 226 | ], 227 | "port": "{{port}}", 228 | "path": [ 229 | "api", 230 | "v1", 231 | "interface" 232 | ] 233 | }, 234 | "description": "Example of the /interface API" 235 | }, 236 | "response": [] 237 | }, 238 | { 239 | "name": "https://{{dnac}}:{{port}}/api/v1/interface/network-device/{{deviceId}}", 240 | "request": { 241 | "method": "GET", 242 | "header": [ 243 | { 244 | "key": "x-auth-token", 245 | "value": "{{token}}" 246 | } 247 | ], 248 | "body": {}, 249 | "url": { 250 | "raw": "https://{{dnac}}:{{port}}/api/v1/interface/network-device/{{deviceId}}", 251 | "protocol": "https", 252 | "host": [ 253 | "{{dnac}}" 254 | ], 255 | "port": "{{port}}", 256 | "path": [ 257 | "api", 258 | "v1", 259 | "interface", 260 | "network-device", 261 | "{{deviceId}}" 262 | ] 263 | }, 264 | "description": "Example of the /interface API" 265 | }, 266 | "response": [] 267 | }, 268 | { 269 | "name": "https://{{dnac}}:{{port}}/api/v1/license-info/network-device/{{deviceId}}", 270 | "request": { 271 | "method": "GET", 272 | "header": [ 273 | { 274 | "key": "x-auth-token", 275 | "value": "{{token}}" 276 | } 277 | ], 278 | "body": {}, 279 | "url": { 280 | "raw": "https://{{dnac}}:{{port}}/api/v1/license-info/network-device/{{deviceId}}", 281 | "protocol": "https", 282 | "host": [ 283 | "{{dnac}}" 284 | ], 285 | "port": "{{port}}", 286 | "path": [ 287 | "api", 288 | "v1", 289 | "license-info", 290 | "network-device", 291 | "{{deviceId}}" 292 | ] 293 | } 294 | }, 295 | "response": [] 296 | }, 297 | { 298 | "name": "https://{{dnac}}:{{port}}/api/v1/network-device/module?deviceId=6d3eaa5d-bb39-4cc4-8881-4a2b2668d2dc", 299 | "request": { 300 | "method": "GET", 301 | "header": [ 302 | { 303 | "key": "x-auth-token", 304 | "value": "{{token}}" 305 | } 306 | ], 307 | "body": {}, 308 | "url": { 309 | "raw": "https://{{dnac}}:{{port}}/api/v1/network-device/module?deviceId=6d3eaa5d-bb39-4cc4-8881-4a2b2668d2dc", 310 | "protocol": "https", 311 | "host": [ 312 | "{{dnac}}" 313 | ], 314 | "port": "{{port}}", 315 | "path": [ 316 | "api", 317 | "v1", 318 | "network-device", 319 | "module" 320 | ], 321 | "query": [ 322 | { 323 | "key": "deviceId", 324 | "value": "6d3eaa5d-bb39-4cc4-8881-4a2b2668d2dc" 325 | } 326 | ] 327 | } 328 | }, 329 | "response": [] 330 | } 331 | ] 332 | }, 333 | { 334 | "name": "3.Tags", 335 | "description": "", 336 | "item": [ 337 | { 338 | "name": "https://{{dnac}}:{{port}}/api/v1/tag", 339 | "event": [ 340 | { 341 | "listen": "test", 342 | "script": { 343 | "type": "text/javascript", 344 | "exec": [ 345 | "var data = JSON.parse(responseBody);", 346 | "console.log(\"here\");", 347 | "console.log(data.response);", 348 | "if (data.response) {", 349 | " tests[\"Body has response\"] = true;", 350 | " var L = data.response.length;", 351 | " for (var i = 0; i < L; i++) {", 352 | " var obj = data.response[i];", 353 | " if (obj.tag == \"InterestingDevice\") {", 354 | " postman.setEnvironmentVariable(\"tagId\", obj.id);", 355 | " } ", 356 | "}", 357 | " ", 358 | "}", 359 | "else {", 360 | " tests[\"Body has response\"] = false;", 361 | "}", 362 | "" 363 | ] 364 | } 365 | } 366 | ], 367 | "request": { 368 | "method": "GET", 369 | "header": [ 370 | { 371 | "key": "x-auth-token", 372 | "value": "{{token}}" 373 | } 374 | ], 375 | "body": {}, 376 | "url": { 377 | "raw": "https://{{dnac}}:{{port}}/api/v1/tag", 378 | "protocol": "https", 379 | "host": [ 380 | "{{dnac}}" 381 | ], 382 | "port": "{{port}}", 383 | "path": [ 384 | "api", 385 | "v1", 386 | "tag" 387 | ] 388 | }, 389 | "description": "Gets a list of all tags defined on the controller" 390 | }, 391 | "response": [] 392 | }, 393 | { 394 | "name": "https://{{dnac}}:{{port}}/api/v1/tag FIND TAG", 395 | "event": [ 396 | { 397 | "listen": "test", 398 | "script": { 399 | "type": "text/javascript", 400 | "exec": [ 401 | "var data = JSON.parse(responseBody);", 402 | "console.log(\"here\");", 403 | "console.log(data.response);", 404 | "if (data.response) {", 405 | " tests[\"Body has response\"] = true;", 406 | " var L = data.response.length;", 407 | " for (var i = 0; i < L; i++) {", 408 | " var obj = data.response[i];", 409 | " if (obj.tag == \"InterestingDevice\") {", 410 | " postman.setEnvironmentVariable(\"tagId\", obj.id);", 411 | " } ", 412 | "}", 413 | " ", 414 | "}", 415 | "else {", 416 | " tests[\"Body has response\"] = false;", 417 | "}", 418 | "" 419 | ] 420 | } 421 | } 422 | ], 423 | "request": { 424 | "method": "GET", 425 | "header": [ 426 | { 427 | "key": "x-auth-token", 428 | "value": "{{token}}" 429 | } 430 | ], 431 | "body": {}, 432 | "url": { 433 | "raw": "https://{{dnac}}:{{port}}/api/v1/tag", 434 | "protocol": "https", 435 | "host": [ 436 | "{{dnac}}" 437 | ], 438 | "port": "{{port}}", 439 | "path": [ 440 | "api", 441 | "v1", 442 | "tag" 443 | ] 444 | }, 445 | "description": "Finds the tagId for the tag created earlier\n\nthis is stored in the tagId environment variable." 446 | }, 447 | "response": [] 448 | }, 449 | { 450 | "name": "https://{{dnac}}:{{port}}/api/v1/tag POST", 451 | "event": [ 452 | { 453 | "listen": "test", 454 | "script": { 455 | "type": "text/javascript", 456 | "exec": [ 457 | "var data = JSON.parse(responseBody);", 458 | "console.log(\"here\");", 459 | "console.log(data.response.taskId);", 460 | "if (data.response.taskId) {", 461 | " tests[\"Body has taskid\"] = true;", 462 | " postman.setEnvironmentVariable(\"taskId\", data.response.taskId);", 463 | "}", 464 | "else {", 465 | " tests[\"Body has taskId\"] = false;", 466 | "}", 467 | "" 468 | ] 469 | } 470 | } 471 | ], 472 | "request": { 473 | "method": "POST", 474 | "header": [ 475 | { 476 | "key": "x-auth-token", 477 | "value": "{{token}}" 478 | }, 479 | { 480 | "key": "Content-type", 481 | "value": "application/json" 482 | } 483 | ], 484 | "body": { 485 | "mode": "raw", 486 | "raw": "{ \"tag\" : \"InterestingDevice\" }" 487 | }, 488 | "url": { 489 | "raw": "https://{{dnac}}:{{port}}/api/v1/tag", 490 | "protocol": "https", 491 | "host": [ 492 | "{{dnac}}" 493 | ], 494 | "port": "{{port}}", 495 | "path": [ 496 | "api", 497 | "v1", 498 | "tag" 499 | ] 500 | }, 501 | "description": "Creates a new tag on the controller" 502 | }, 503 | "response": [] 504 | }, 505 | { 506 | "name": "https://{{dnac}}:{{port}}/api/v1/task/{{taskId}} - TAG", 507 | "request": { 508 | "method": "GET", 509 | "header": [ 510 | { 511 | "key": "x-auth-token", 512 | "value": "{{token}}" 513 | } 514 | ], 515 | "body": {}, 516 | "url": { 517 | "raw": "https://{{dnac}}:{{port}}/api/v1/task/{{taskId}}", 518 | "protocol": "https", 519 | "host": [ 520 | "{{dnac}}" 521 | ], 522 | "port": "{{port}}", 523 | "path": [ 524 | "api", 525 | "v1", 526 | "task", 527 | "{{taskId}}" 528 | ] 529 | }, 530 | "description": "Gets a task status.\nuses environment variable for the taskId" 531 | }, 532 | "response": [] 533 | }, 534 | { 535 | "name": "https://{{dnac}}:{{port}}/api/v1/tag/association", 536 | "event": [ 537 | { 538 | "listen": "test", 539 | "script": { 540 | "type": "text/javascript", 541 | "exec": [ 542 | "var data = JSON.parse(responseBody);", 543 | "console.log(\"here\");", 544 | "console.log(data.response.taskId);", 545 | "if (data.response.taskId) {", 546 | " tests[\"Body has taskid\"] = true;", 547 | " postman.setEnvironmentVariable(\"taskId\", data.response.taskId);", 548 | "}", 549 | "else {", 550 | " tests[\"Body has taskId\"] = false;", 551 | "}" 552 | ] 553 | } 554 | } 555 | ], 556 | "request": { 557 | "method": "POST", 558 | "header": [ 559 | { 560 | "key": "x-auth-token", 561 | "value": "{{token}}" 562 | }, 563 | { 564 | "key": "Content-type", 565 | "value": "application/json" 566 | } 567 | ], 568 | "body": { 569 | "mode": "raw", 570 | "raw": "{\n \"resourceId\": \"{{deviceId}}\",\n\"resourceType\" : \"network-device\",\n \"tag\": \"InterestingDevice\"\n\n}" 571 | }, 572 | "url": { 573 | "raw": "https://{{dnac}}:{{port}}/api/v1/tag/association", 574 | "protocol": "https", 575 | "host": [ 576 | "{{dnac}}" 577 | ], 578 | "port": "{{port}}", 579 | "path": [ 580 | "api", 581 | "v1", 582 | "tag", 583 | "association" 584 | ] 585 | }, 586 | "description": "Associates an existing tag with a network-device.\n\nTag needs to have been created before it can be associated\n\nnetwork-device is the deviceId environment variable, you need to change this" 587 | }, 588 | "response": [] 589 | }, 590 | { 591 | "name": "https://{{dnac}}:{{port}}/api/v1/task/{{taskId}}", 592 | "request": { 593 | "method": "GET", 594 | "header": [ 595 | { 596 | "key": "x-auth-token", 597 | "value": "{{token}}" 598 | } 599 | ], 600 | "body": {}, 601 | "url": { 602 | "raw": "https://{{dnac}}:{{port}}/api/v1/task/{{taskId}}", 603 | "protocol": "https", 604 | "host": [ 605 | "{{dnac}}" 606 | ], 607 | "port": "{{port}}", 608 | "path": [ 609 | "api", 610 | "v1", 611 | "task", 612 | "{{taskId}}" 613 | ] 614 | }, 615 | "description": "Gets a task status.\nuses environment variable for the taskId" 616 | }, 617 | "response": [] 618 | }, 619 | { 620 | "name": "https://{{dnac}}:{{port}}/api/v1/tag/association?tag=InterestingDevice&resourceType=network-device", 621 | "event": [ 622 | { 623 | "listen": "test", 624 | "script": { 625 | "type": "text/javascript", 626 | "exec": [ 627 | "var data = JSON.parse(responseBody);", 628 | "console.log(\"here\");", 629 | "console.log(data.response);", 630 | "if (data.response) {", 631 | " tests[\"Body has response\"] = true;", 632 | " var L = data.response.length;", 633 | " for (var i = 0; i < L; i++) {", 634 | " var obj = data.response[i];", 635 | " if (obj.tag == \"InterestingDevice\") {", 636 | " postman.setEnvironmentVariable(\"tagId\", obj.id);", 637 | " } ", 638 | "}", 639 | " ", 640 | "}", 641 | "else {", 642 | " tests[\"Body has response\"] = false;", 643 | "}", 644 | "" 645 | ] 646 | } 647 | } 648 | ], 649 | "request": { 650 | "method": "GET", 651 | "header": [ 652 | { 653 | "key": "x-auth-token", 654 | "value": "{{token}}" 655 | } 656 | ], 657 | "body": {}, 658 | "url": { 659 | "raw": "https://{{dnac}}:{{port}}/api/v1/tag/association?tag=InterestingDevice&resourceType=network-device", 660 | "protocol": "https", 661 | "host": [ 662 | "{{dnac}}" 663 | ], 664 | "port": "{{port}}", 665 | "path": [ 666 | "api", 667 | "v1", 668 | "tag", 669 | "association" 670 | ], 671 | "query": [ 672 | { 673 | "key": "tag", 674 | "value": "InterestingDevice" 675 | }, 676 | { 677 | "key": "resourceType", 678 | "value": "network-device" 679 | } 680 | ] 681 | } 682 | }, 683 | "response": [] 684 | }, 685 | { 686 | "name": "ttps://{{dnac}}:{{port}}/api/v1/tag/association/{{tagId}}?resourceType=network-device&resourceId={{deviceId}}", 687 | "event": [ 688 | { 689 | "listen": "test", 690 | "script": { 691 | "type": "text/javascript", 692 | "exec": [ 693 | "var data1 = JSON.parse(responseBody);", 694 | "console.log(\"here\");", 695 | "console.log(data1.response.taskId);", 696 | "", 697 | "postman.setEnvironmentVariable(\"taskId\", data1.response.taskId);" 698 | ] 699 | } 700 | } 701 | ], 702 | "request": { 703 | "method": "DELETE", 704 | "header": [ 705 | { 706 | "key": "x-auth-token", 707 | "value": "{{token}}" 708 | } 709 | ], 710 | "body": {}, 711 | "url": { 712 | "raw": "https://{{dnac}}:{{port}}/api/v1/tag/association/{{tagId}}?resourceType=network-device&resourceId={{deviceId}}", 713 | "protocol": "https", 714 | "host": [ 715 | "{{dnac}}" 716 | ], 717 | "port": "{{port}}", 718 | "path": [ 719 | "api", 720 | "v1", 721 | "tag", 722 | "association", 723 | "{{tagId}}" 724 | ], 725 | "query": [ 726 | { 727 | "key": "resourceType", 728 | "value": "network-device" 729 | }, 730 | { 731 | "key": "resourceId", 732 | "value": "{{deviceId}}" 733 | } 734 | ] 735 | }, 736 | "description": "Deletes association between tag and device\n\nyou need to delete the association before you can delete the tag" 737 | }, 738 | "response": [] 739 | }, 740 | { 741 | "name": "https://{{dnac}}:{{port}}/api/v1/tag/{{tagId}}", 742 | "event": [ 743 | { 744 | "listen": "test", 745 | "script": { 746 | "type": "text/javascript", 747 | "exec": [ 748 | "var data1 = JSON.parse(responseBody);", 749 | "console.log(\"here\");", 750 | "console.log(data1.response.taskId);", 751 | "", 752 | "postman.setEnvironmentVariable(\"taskId\", data1.response.taskId);" 753 | ] 754 | } 755 | } 756 | ], 757 | "request": { 758 | "method": "DELETE", 759 | "header": [ 760 | { 761 | "key": "x-auth-token", 762 | "value": "{{token}}" 763 | } 764 | ], 765 | "body": {}, 766 | "url": { 767 | "raw": "https://{{dnac}}:{{port}}/api/v1/tag/{{tagId}}", 768 | "protocol": "https", 769 | "host": [ 770 | "{{dnac}}" 771 | ], 772 | "port": "{{port}}", 773 | "path": [ 774 | "api", 775 | "v1", 776 | "tag", 777 | "{{tagId}}" 778 | ] 779 | }, 780 | "description": "delete tag from controller" 781 | }, 782 | "response": [] 783 | } 784 | ] 785 | }, 786 | { 787 | "name": "4.Path Trace", 788 | "description": "", 789 | "item": [ 790 | { 791 | "name": "https://{{dnac}}:{{port}}/api/v1/flow-analysis", 792 | "event": [ 793 | { 794 | "listen": "test", 795 | "script": { 796 | "type": "text/javascript", 797 | "exec": [ 798 | "var data = JSON.parse(responseBody);", 799 | "console.log(\"here\");", 800 | "console.log(data.response.taskId);", 801 | "if (data.response.taskId) {", 802 | " tests[\"Body has taskid\"] = true;", 803 | " postman.setEnvironmentVariable(\"taskId\", data.response.taskId);", 804 | "}", 805 | "else {", 806 | " tests[\"Body has taskId\"] = false;", 807 | "}", 808 | "" 809 | ] 810 | } 811 | } 812 | ], 813 | "request": { 814 | "method": "POST", 815 | "header": [ 816 | { 817 | "key": "x-auth-token", 818 | "value": "{{token}}" 819 | }, 820 | { 821 | "key": "Content-type", 822 | "value": "application/json" 823 | } 824 | ], 825 | "body": { 826 | "mode": "raw", 827 | "raw": "{ \"sourceIP\" : \"10.10.22.98\", \"destIP\" : \"10.10.22.114\"}" 828 | }, 829 | "url": { 830 | "raw": "https://{{dnac}}:{{port}}/api/v1/flow-analysis", 831 | "protocol": "https", 832 | "host": [ 833 | "{{dnac}}" 834 | ], 835 | "port": "{{port}}", 836 | "path": [ 837 | "api", 838 | "v1", 839 | "flow-analysis" 840 | ] 841 | }, 842 | "description": "Creates a flow analysis. sourceIP and destIP are specified.\n\nsrc/dst port can also be provided" 843 | }, 844 | "response": [] 845 | }, 846 | { 847 | "name": "https://{{dnac}}:{{port}}/api/v1/task/{{taskId}}", 848 | "event": [ 849 | { 850 | "listen": "test", 851 | "script": { 852 | "type": "text/javascript", 853 | "exec": [ 854 | "var data = JSON.parse(responseBody);", 855 | "", 856 | "if (data.response.progress) {", 857 | " tests[\"Body has progress\"] = true;", 858 | " postman.setEnvironmentVariable(\"pathId\", data.response.progress);", 859 | "}", 860 | "else {", 861 | " tests[\"Body has progress\"] = false;", 862 | "}" 863 | ] 864 | } 865 | } 866 | ], 867 | "request": { 868 | "method": "GET", 869 | "header": [ 870 | { 871 | "key": "x-auth-token", 872 | "value": "{{token}}" 873 | } 874 | ], 875 | "body": {}, 876 | "url": { 877 | "raw": "https://{{dnac}}:{{port}}/api/v1/task/{{taskId}}", 878 | "protocol": "https", 879 | "host": [ 880 | "{{dnac}}" 881 | ], 882 | "port": "{{port}}", 883 | "path": [ 884 | "api", 885 | "v1", 886 | "task", 887 | "{{taskId}}" 888 | ] 889 | }, 890 | "description": "Gets a task status.\nuses environment variable for the taskId\n\nAlso parses the result of the task to find the ID of the path.\n\nThis is stored in the pathId environment variable" 891 | }, 892 | "response": [] 893 | }, 894 | { 895 | "name": "https://{{dnac}}:{{port}}/api/v1/flow-analysis", 896 | "request": { 897 | "method": "GET", 898 | "header": [ 899 | { 900 | "key": "x-auth-token", 901 | "value": "{{token}}" 902 | } 903 | ], 904 | "body": {}, 905 | "url": { 906 | "raw": "https://{{dnac}}:{{port}}/api/v1/flow-analysis/{{pathId}}", 907 | "protocol": "https", 908 | "host": [ 909 | "{{dnac}}" 910 | ], 911 | "port": "{{port}}", 912 | "path": [ 913 | "api", 914 | "v1", 915 | "flow-analysis", 916 | "{{pathId}}" 917 | ] 918 | }, 919 | "description": "Gets a flow-analyis\nuses environment variable for the pathId" 920 | }, 921 | "response": [] 922 | } 923 | ] 924 | }, 925 | { 926 | "name": "05. PnP- Onboardng", 927 | "description": "", 928 | "item": [ 929 | { 930 | "name": "https://{{dnac}}:{{port}}/api/v1/onboarding/pnp-workflow", 931 | "event": [ 932 | { 933 | "listen": "test", 934 | "script": { 935 | "id": "90f9cf6a-dcb1-4703-9d50-1e744753536d", 936 | "type": "text/javascript", 937 | "exec": [ 938 | "var data = JSON.parse(responseBody);", 939 | "console.log(data);", 940 | "if (data) {", 941 | " tests[\"Body has response\"] = true;", 942 | " var L = data.length;", 943 | " for (var i = 0; i < L; i++) {", 944 | " var obj = data[i];", 945 | " if (obj.name == \"simpleTemplate\") {", 946 | " postman.setEnvironmentVariable(\"workflowId\", obj.id);", 947 | " } ", 948 | "}", 949 | " ", 950 | "}", 951 | "else {", 952 | " tests[\"Body has response\"] = false;", 953 | "}", 954 | "", 955 | "" 956 | ] 957 | } 958 | } 959 | ], 960 | "request": { 961 | "method": "GET", 962 | "header": [ 963 | { 964 | "key": "x-auth-token", 965 | "value": "{{token}}" 966 | } 967 | ], 968 | "body": { 969 | "mode": "raw", 970 | "raw": "{\n\"enableProxy\" : true,\n\n}" 971 | }, 972 | "url": { 973 | "raw": "https://{{dnac}}:{{port}}/api/v1/onboarding/pnp-workflow", 974 | "protocol": "https", 975 | "host": [ 976 | "{{dnac}}" 977 | ], 978 | "port": "{{port}}", 979 | "path": [ 980 | "api", 981 | "v1", 982 | "onboarding", 983 | "pnp-workflow" 984 | ] 985 | } 986 | }, 987 | "response": [] 988 | }, 989 | { 990 | "name": "https://{{dnac}}:{{port}}/api/v1/onboarding/pnp-device/import ", 991 | "event": [ 992 | { 993 | "listen": "test", 994 | "script": { 995 | "id": "86983332-e4cc-4c30-a424-378cd42a1fb3", 996 | "type": "text/javascript", 997 | "exec": [ 998 | "var data = JSON.parse(responseBody);", 999 | "console.log(data);", 1000 | "if (data.successList) {", 1001 | " tests[\"Body has response\"] = true;", 1002 | " var L = data.successList.length;", 1003 | " for (var i = 0; i < L; i++) {", 1004 | " var obj = data.successList[i];", 1005 | " ", 1006 | " postman.setEnvironmentVariable(\"pnpDeviceId\", obj.id);", 1007 | " ", 1008 | "}", 1009 | " ", 1010 | "}", 1011 | "else {", 1012 | " tests[\"Body has response\"] = false;", 1013 | "}", 1014 | "", 1015 | "" 1016 | ] 1017 | } 1018 | } 1019 | ], 1020 | "request": { 1021 | "method": "POST", 1022 | "header": [ 1023 | { 1024 | "key": "x-auth-token", 1025 | "value": "{{token}}" 1026 | }, 1027 | { 1028 | "key": "Content-Type", 1029 | "value": "application/json" 1030 | } 1031 | ], 1032 | "body": { 1033 | "mode": "raw", 1034 | "raw": "[{\n\t\"deviceInfo\": {\n\t\t\"name\": \"Postname-add\",\n\t\t\"serialNumber\": \"1234567890s\",\n\t\t\"pid\":\"ws-c9300\",\n\t\t\"sudiRequired\": false,\n\t\t\"userSudiSerialNos\": [],\n\t\t\"stack\": false,\n\t\t\"aaaCredentials\": {\n\t\t\t\"username\": \"\",\n\t\t\t\"password\": \"\"\n\t\t}\n\t}\n}]" 1035 | }, 1036 | "url": { 1037 | "raw": "https://{{dnac}}:{{port}}/api/v1/onboarding/pnp-device/import", 1038 | "protocol": "https", 1039 | "host": [ 1040 | "{{dnac}}" 1041 | ], 1042 | "port": "{{port}}", 1043 | "path": [ 1044 | "api", 1045 | "v1", 1046 | "onboarding", 1047 | "pnp-device", 1048 | "import" 1049 | ] 1050 | } 1051 | }, 1052 | "response": [] 1053 | }, 1054 | { 1055 | "name": "https://{{dnac}}:{{port}}/api/v1/onboarding/pnp-device/claim", 1056 | "event": [ 1057 | { 1058 | "listen": "test", 1059 | "script": { 1060 | "id": "ca012854-2739-42e5-adf1-c7ac8f4c1ac9", 1061 | "type": "text/javascript", 1062 | "exec": [ 1063 | "var data = JSON.parse(responseBody);", 1064 | "console.log(data);", 1065 | "if (data.message == \"Device(s) Claimed\") {", 1066 | " ", 1067 | "}", 1068 | " ", 1069 | "}", 1070 | "else {", 1071 | " tests[\"Body has response\"] = false;", 1072 | "}", 1073 | "", 1074 | "" 1075 | ] 1076 | } 1077 | } 1078 | ], 1079 | "request": { 1080 | "method": "POST", 1081 | "header": [ 1082 | { 1083 | "key": "x-auth-token", 1084 | "value": "{{token}}" 1085 | }, 1086 | { 1087 | "key": "Content-Type", 1088 | "value": "application/json" 1089 | } 1090 | ], 1091 | "body": { 1092 | "mode": "raw", 1093 | "raw": "{\n \"workflowId\": \"{{workflowId}}\", \n \"deviceClaimList\": [\n {\n \"configList\": [\n {\n \"configId\": \"a7c64b02-0ba2-4139-9e9c-86b36631a865\", \n \"configParameters\": [\n {\n \"value\": \"adam\", \n \"key\": \"hostname\"\n }\n ]\n }\n ], \n \"deviceId\": \"{{pnpDeviceId}}\"\n }\n ], \n \"populateInventory\": true, \n \"imageId\": null, \n \"projectId\": null, \n \"configId\": null\n}\n" 1094 | }, 1095 | "url": { 1096 | "raw": "https://{{dnac}}:{{port}}/api/v1/onboarding/pnp-device/claim", 1097 | "protocol": "https", 1098 | "host": [ 1099 | "{{dnac}}" 1100 | ], 1101 | "port": "{{port}}", 1102 | "path": [ 1103 | "api", 1104 | "v1", 1105 | "onboarding", 1106 | "pnp-device", 1107 | "claim" 1108 | ] 1109 | } 1110 | }, 1111 | "response": [] 1112 | }, 1113 | { 1114 | "name": "https://{{dnac}}:{{port}}/api/v1/onboarding/pnp-device", 1115 | "event": [ 1116 | { 1117 | "listen": "test", 1118 | "script": { 1119 | "id": "90f9cf6a-dcb1-4703-9d50-1e744753536d", 1120 | "type": "text/javascript", 1121 | "exec": [ 1122 | "var data = JSON.parse(responseBody);", 1123 | "console.log(data);", 1124 | "if (data) {", 1125 | " tests[\"Body has response\"] = true;", 1126 | " var L = data.length;", 1127 | " for (var i = 0; i < L; i++) {", 1128 | " var obj = data[i];", 1129 | " if (obj.name == \"simpleTemplate\") {", 1130 | " postman.setEnvironmentVariable(\"workflowId\", obj.id);", 1131 | " } ", 1132 | "}", 1133 | " ", 1134 | "}", 1135 | "else {", 1136 | " tests[\"Body has response\"] = false;", 1137 | "}", 1138 | "", 1139 | "" 1140 | ] 1141 | } 1142 | } 1143 | ], 1144 | "request": { 1145 | "method": "GET", 1146 | "header": [ 1147 | { 1148 | "key": "x-auth-token", 1149 | "value": "{{token}}" 1150 | } 1151 | ], 1152 | "body": { 1153 | "mode": "raw", 1154 | "raw": "{\n\"enableProxy\" : true,\n\n}" 1155 | }, 1156 | "url": { 1157 | "raw": "https://{{dnac}}:{{port}}/api/v1/onboarding/pnp-device", 1158 | "protocol": "https", 1159 | "host": [ 1160 | "{{dnac}}" 1161 | ], 1162 | "port": "{{port}}", 1163 | "path": [ 1164 | "api", 1165 | "v1", 1166 | "onboarding", 1167 | "pnp-device" 1168 | ] 1169 | } 1170 | }, 1171 | "response": [] 1172 | }, 1173 | { 1174 | "name": "https://{{dnac}}:{{port}}/api/v1/onboarding/pnp-device/claim", 1175 | "event": [ 1176 | { 1177 | "listen": "test", 1178 | "script": { 1179 | "id": "ca012854-2739-42e5-adf1-c7ac8f4c1ac9", 1180 | "type": "text/javascript", 1181 | "exec": [ 1182 | "var data = JSON.parse(responseBody);", 1183 | "console.log(data);", 1184 | "if (data.message == \"Device(s) Claimed\") {", 1185 | " ", 1186 | "}", 1187 | " ", 1188 | "}", 1189 | "else {", 1190 | " tests[\"Body has response\"] = false;", 1191 | "}", 1192 | "", 1193 | "" 1194 | ] 1195 | } 1196 | } 1197 | ], 1198 | "request": { 1199 | "method": "DELETE", 1200 | "header": [ 1201 | { 1202 | "key": "x-auth-token", 1203 | "value": "{{token}}" 1204 | }, 1205 | { 1206 | "key": "Content-Type", 1207 | "value": "application/json" 1208 | } 1209 | ], 1210 | "body": { 1211 | "mode": "raw", 1212 | "raw": "" 1213 | }, 1214 | "url": { 1215 | "raw": "https://{{dnac}}:{{port}}/api/v1/onboarding/pnp-device/{{pnpDeviceId}}", 1216 | "protocol": "https", 1217 | "host": [ 1218 | "{{dnac}}" 1219 | ], 1220 | "port": "{{port}}", 1221 | "path": [ 1222 | "api", 1223 | "v1", 1224 | "onboarding", 1225 | "pnp-device", 1226 | "{{pnpDeviceId}}" 1227 | ] 1228 | } 1229 | }, 1230 | "response": [] 1231 | } 1232 | ] 1233 | }, 1234 | { 1235 | "name": "6.Assurance", 1236 | "description": "", 1237 | "item": [ 1238 | { 1239 | "name": "https://{{dnac}}:{{port}}/api/assurance/v1/time", 1240 | "event": [ 1241 | { 1242 | "listen": "test", 1243 | "script": { 1244 | "id": "1ca0333c-fd52-4b17-83f6-1f6047e44b74", 1245 | "type": "text/javascript", 1246 | "exec": [ 1247 | "var data = JSON.parse(responseBody);", 1248 | "console.log(\"here\");", 1249 | "console.log(data.response);", 1250 | "if (data.response) {", 1251 | " for (i = 0; i < data.response.length; i++) { ", 1252 | " if (data.response[i].timeType == 'GLOBAL'){", 1253 | " postman.setEnvironmentVariable(\"GLOBALtime\", data.response[i].time );", 1254 | " postman.setEnvironmentVariable(\"GLOBALstartTime\", data.response[i].time - 10000 );", 1255 | " }", 1256 | " if (data.response[i].timeType == 'CLIENT'){", 1257 | " postman.setEnvironmentVariable(\"CLIENTtime\", data.response[i].time );", 1258 | " }", 1259 | " }", 1260 | "}", 1261 | "", 1262 | "" 1263 | ] 1264 | } 1265 | } 1266 | ], 1267 | "request": { 1268 | "method": "GET", 1269 | "header": [ 1270 | { 1271 | "key": "x-auth-token", 1272 | "value": "{{token}}" 1273 | } 1274 | ], 1275 | "body": {}, 1276 | "url": { 1277 | "raw": "https://{{dnac}}:{{port}}/api/assurance/v1/time", 1278 | "protocol": "https", 1279 | "host": [ 1280 | "{{dnac}}" 1281 | ], 1282 | "port": "{{port}}", 1283 | "path": [ 1284 | "api", 1285 | "assurance", 1286 | "v1", 1287 | "time" 1288 | ] 1289 | } 1290 | }, 1291 | "response": [] 1292 | }, 1293 | { 1294 | "name": "https://{{dnac}}:{{port}}/api/assurance/v1/host/00:1E:13:A5:B9:40?timestamp={{CLIENTtime}}", 1295 | "request": { 1296 | "method": "GET", 1297 | "header": [ 1298 | { 1299 | "key": "x-auth-token", 1300 | "value": "{{token}}" 1301 | } 1302 | ], 1303 | "body": {}, 1304 | "url": { 1305 | "raw": "https://{{dnac}}:{{port}}/api/assurance/v1/host/00:1E:13:A5:B9:40?timestamp={{CLIENTtime}}", 1306 | "protocol": "https", 1307 | "host": [ 1308 | "{{dnac}}" 1309 | ], 1310 | "port": "{{port}}", 1311 | "path": [ 1312 | "api", 1313 | "assurance", 1314 | "v1", 1315 | "host", 1316 | "00:1E:13:A5:B9:40" 1317 | ], 1318 | "query": [ 1319 | { 1320 | "key": "timestamp", 1321 | "value": "{{CLIENTtime}}" 1322 | } 1323 | ] 1324 | }, 1325 | "description": "Gets a flow-analyis\nuses environment variable for the pathId" 1326 | }, 1327 | "response": [] 1328 | }, 1329 | { 1330 | "name": "https://{{dnac}}:{{port}}/api/assurance/v1/host/00:1E:13:A5:B9:40/neighbor-topology?timestamp={{CLIENTtime}}", 1331 | "request": { 1332 | "method": "GET", 1333 | "header": [ 1334 | { 1335 | "key": "x-auth-token", 1336 | "value": "{{token}}" 1337 | } 1338 | ], 1339 | "body": {}, 1340 | "url": { 1341 | "raw": "https://{{dnac}}:{{port}}/api/assurance/v1/host/00:1E:13:A5:B9:40/neighbor-topology?timestamp={{CLIENTtime}}", 1342 | "protocol": "https", 1343 | "host": [ 1344 | "{{dnac}}" 1345 | ], 1346 | "port": "{{port}}", 1347 | "path": [ 1348 | "api", 1349 | "assurance", 1350 | "v1", 1351 | "host", 1352 | "00:1E:13:A5:B9:40", 1353 | "neighbor-topology" 1354 | ], 1355 | "query": [ 1356 | { 1357 | "key": "timestamp", 1358 | "value": "{{CLIENTtime}}" 1359 | } 1360 | ] 1361 | } 1362 | }, 1363 | "response": [] 1364 | }, 1365 | { 1366 | "name": "https://{{dnac}}:{{port}}/api/assurance/v1/siteHierarchy", 1367 | "event": [ 1368 | { 1369 | "listen": "test", 1370 | "script": { 1371 | "id": "8ab0fb7c-3332-40d0-ab07-71b5bad7854e", 1372 | "type": "text/javascript", 1373 | "exec": [ 1374 | "" 1375 | ] 1376 | } 1377 | } 1378 | ], 1379 | "request": { 1380 | "method": "POST", 1381 | "header": [ 1382 | { 1383 | "key": "x-auth-token", 1384 | "value": "{{token}}" 1385 | }, 1386 | { 1387 | "key": "Content-type", 1388 | "value": "application/json" 1389 | } 1390 | ], 1391 | "body": { 1392 | "mode": "raw", 1393 | "raw": "{\"type\":\"overall\",\"endTime\": \"{{GLOBALtime}}\"}" 1394 | }, 1395 | "url": { 1396 | "raw": "https://{{dnac}}:{{port}}/api/assurance/v1/siteHierarchy", 1397 | "protocol": "https", 1398 | "host": [ 1399 | "{{dnac}}" 1400 | ], 1401 | "port": "{{port}}", 1402 | "path": [ 1403 | "api", 1404 | "assurance", 1405 | "v1", 1406 | "siteHierarchy" 1407 | ] 1408 | } 1409 | }, 1410 | "response": [] 1411 | } 1412 | ], 1413 | "event": [ 1414 | { 1415 | "listen": "prerequest", 1416 | "script": { 1417 | "id": "59247e8d-4d5d-4144-adff-ddf6e38d4563", 1418 | "type": "text/javascript", 1419 | "exec": [ 1420 | "" 1421 | ] 1422 | } 1423 | }, 1424 | { 1425 | "listen": "test", 1426 | "script": { 1427 | "id": "22db45ad-1da8-48f9-a0b6-0f75bd4c8f6a", 1428 | "type": "text/javascript", 1429 | "exec": [ 1430 | "" 1431 | ] 1432 | } 1433 | } 1434 | ] 1435 | }, 1436 | { 1437 | "name": "7.Policy", 1438 | "description": "", 1439 | "item": [] 1440 | }, 1441 | { 1442 | "name": "8.SWIM", 1443 | "description": "", 1444 | "item": [ 1445 | { 1446 | "name": "https://{{dnac}}:{{port}}/api/v1/image/importation/site/-1?imageCategory=PHYSICAL", 1447 | "request": { 1448 | "method": "GET", 1449 | "header": [ 1450 | { 1451 | "key": "x-auth-token", 1452 | "value": "{{token}}" 1453 | } 1454 | ], 1455 | "body": {}, 1456 | "url": { 1457 | "raw": "https://{{dnac}}:{{port}}/api/v1/image/importation/site/-1?imageCategory=PHYSICAL", 1458 | "protocol": "https", 1459 | "host": [ 1460 | "{{dnac}}" 1461 | ], 1462 | "port": "{{port}}", 1463 | "path": [ 1464 | "api", 1465 | "v1", 1466 | "image", 1467 | "importation", 1468 | "site", 1469 | "-1" 1470 | ], 1471 | "query": [ 1472 | { 1473 | "key": "imageCategory", 1474 | "value": "PHYSICAL" 1475 | } 1476 | ] 1477 | } 1478 | }, 1479 | "response": [] 1480 | }, 1481 | { 1482 | "name": "https://{{dnac}}:{{port}}/api/v1/image/importation?name=cat9k", 1483 | "event": [ 1484 | { 1485 | "listen": "test", 1486 | "script": { 1487 | "id": "db8df21a-e704-46f5-8f64-936002246241", 1488 | "type": "text/javascript", 1489 | "exec": [ 1490 | "var data = JSON.parse(responseBody);", 1491 | "", 1492 | "console.log(data);", 1493 | "if (data.response[0].imageUuid) {", 1494 | " tests[\"Body has response.imageUuid\"] = true;", 1495 | " postman.setEnvironmentVariable(\"imageId\", data.response[0].imageUuid);", 1496 | "}", 1497 | "else {", 1498 | " tests[\"Body has response.imageId\"] = false;", 1499 | "}" 1500 | ] 1501 | } 1502 | } 1503 | ], 1504 | "request": { 1505 | "method": "GET", 1506 | "header": [ 1507 | { 1508 | "key": "x-auth-token", 1509 | "value": "{{token}}" 1510 | } 1511 | ], 1512 | "body": {}, 1513 | "url": { 1514 | "raw": "https://{{dnac}}:{{port}}/api/v1/image/importation?name=cat9k", 1515 | "protocol": "https", 1516 | "host": [ 1517 | "{{dnac}}" 1518 | ], 1519 | "port": "{{port}}", 1520 | "path": [ 1521 | "api", 1522 | "v1", 1523 | "image", 1524 | "importation" 1525 | ], 1526 | "query": [ 1527 | { 1528 | "key": "name", 1529 | "value": "cat9k" 1530 | } 1531 | ] 1532 | } 1533 | }, 1534 | "response": [] 1535 | }, 1536 | { 1537 | "name": "https://{{apic}}:{{port}}/api/v1/network-device/ip-address/10.10.22.70", 1538 | "event": [ 1539 | { 1540 | "listen": "test", 1541 | "script": { 1542 | "type": "text/javascript", 1543 | "exec": [ 1544 | "var data = JSON.parse(responseBody);", 1545 | "", 1546 | "console.log(data);", 1547 | "if (data.response.id) {", 1548 | " tests[\"Body has response.id\"] = true;", 1549 | " postman.setEnvironmentVariable(\"deviceId\", data.response.id);", 1550 | "}", 1551 | "else {", 1552 | " tests[\"Body has response.deviceId\"] = false;", 1553 | "}" 1554 | ] 1555 | } 1556 | } 1557 | ], 1558 | "request": { 1559 | "method": "GET", 1560 | "header": [ 1561 | { 1562 | "key": "x-auth-token", 1563 | "value": "{{token}}" 1564 | } 1565 | ], 1566 | "body": {}, 1567 | "url": { 1568 | "raw": "https://{{dnac}}:{{port}}/api/v1/network-device/ip-address/10.10.22.70", 1569 | "protocol": "https", 1570 | "host": [ 1571 | "{{dnac}}" 1572 | ], 1573 | "port": "{{port}}", 1574 | "path": [ 1575 | "api", 1576 | "v1", 1577 | "network-device", 1578 | "ip-address", 1579 | "10.10.22.70" 1580 | ] 1581 | } 1582 | }, 1583 | "response": [] 1584 | }, 1585 | { 1586 | "name": "https://{{dnac}}:{{port}}/api/v1/image/distribution", 1587 | "event": [ 1588 | { 1589 | "listen": "test", 1590 | "script": { 1591 | "type": "text/javascript", 1592 | "exec": [ 1593 | "var data = JSON.parse(responseBody);", 1594 | "console.log(\"here\");", 1595 | "console.log(data.response.taskId);", 1596 | "if (data.response.taskId) {", 1597 | " tests[\"Body has taskid\"] = true;", 1598 | " postman.setEnvironmentVariable(\"taskId\", data.response.taskId);", 1599 | "}", 1600 | "else {", 1601 | " tests[\"Body has taskId\"] = false;", 1602 | "}", 1603 | "" 1604 | ] 1605 | } 1606 | } 1607 | ], 1608 | "request": { 1609 | "method": "POST", 1610 | "header": [ 1611 | { 1612 | "key": "x-auth-token", 1613 | "value": "{{token}}" 1614 | }, 1615 | { 1616 | "key": "Content-Type", 1617 | "value": "application/json" 1618 | } 1619 | ], 1620 | "body": { 1621 | "mode": "raw", 1622 | "raw": "[\n\t{\n\t\t\"deviceUuid\": \"{{deviceId}}\",\n\t\t\"imageUuid\": \"{{imageId}}\"\n\t}\n]" 1623 | }, 1624 | "url": { 1625 | "raw": "https://{{dnac}}:{{port}}/api/v1/image/distribution", 1626 | "protocol": "https", 1627 | "host": [ 1628 | "{{dnac}}" 1629 | ], 1630 | "port": "{{port}}", 1631 | "path": [ 1632 | "api", 1633 | "v1", 1634 | "image", 1635 | "distribution" 1636 | ] 1637 | } 1638 | }, 1639 | "response": [] 1640 | }, 1641 | { 1642 | "name": "https://{{dnac}}:{{port}}/api/v1/task/{{taskId}}", 1643 | "event": [ 1644 | { 1645 | "listen": "test", 1646 | "script": { 1647 | "type": "text/javascript", 1648 | "exec": [ 1649 | "var data = JSON.parse(responseBody);", 1650 | "", 1651 | "if (data.response.additionalStatusURL) {", 1652 | " tests[\"Body has additionalStatusURL\"] = true;", 1653 | " ", 1654 | " postman.setEnvironmentVariable(\"additionalStatusURL\", data.response.additionalStatusURL);", 1655 | "}", 1656 | "else {", 1657 | " tests[\"Body has additionalStatusURL\"] = false;", 1658 | "}" 1659 | ] 1660 | } 1661 | } 1662 | ], 1663 | "request": { 1664 | "method": "GET", 1665 | "header": [ 1666 | { 1667 | "key": "x-auth-token", 1668 | "value": "{{token}}" 1669 | } 1670 | ], 1671 | "body": {}, 1672 | "url": { 1673 | "raw": "https://{{dnac}}:{{port}}/api/v1/task/{{taskId}}", 1674 | "protocol": "https", 1675 | "host": [ 1676 | "{{dnac}}" 1677 | ], 1678 | "port": "{{port}}", 1679 | "path": [ 1680 | "api", 1681 | "v1", 1682 | "task", 1683 | "{{taskId}}" 1684 | ] 1685 | } 1686 | }, 1687 | "response": [] 1688 | }, 1689 | { 1690 | "name": "https://{{dnac}}:{{port}}/{{additionalStatusURL}}", 1691 | "event": [ 1692 | { 1693 | "listen": "test", 1694 | "script": { 1695 | "type": "text/javascript", 1696 | "exec": [ 1697 | "var data = JSON.parse(responseBody);", 1698 | "", 1699 | "if (data.response.progress) {", 1700 | " tests[\"Body has progress\"] = true;", 1701 | " var sp = data.response.progress;", 1702 | " var re = /[^\\[]+\\[([^\\]]+)/;", 1703 | " siteProfileId = re.exec(sp)[1];", 1704 | " postman.setEnvironmentVariable(\"siteProfileId\", data.response.progress);", 1705 | "}", 1706 | "else {", 1707 | " tests[\"Body has progress\"] = false;", 1708 | "}" 1709 | ] 1710 | } 1711 | } 1712 | ], 1713 | "request": { 1714 | "method": "GET", 1715 | "header": [ 1716 | { 1717 | "key": "x-auth-token", 1718 | "value": "{{token}}" 1719 | } 1720 | ], 1721 | "body": {}, 1722 | "url": { 1723 | "raw": "https://{{dnac}}:{{port}}/{{additionalStatusURL}}", 1724 | "protocol": "https", 1725 | "host": [ 1726 | "{{dnac}}" 1727 | ], 1728 | "port": "{{port}}", 1729 | "path": [ 1730 | "{{additionalStatusURL}}" 1731 | ] 1732 | } 1733 | }, 1734 | "response": [] 1735 | }, 1736 | { 1737 | "name": "https://{{dnac}}:{{port}}/api/v1/device-image/device/{{deviceId}}/file", 1738 | "request": { 1739 | "method": "GET", 1740 | "header": [ 1741 | { 1742 | "key": "x-auth-token", 1743 | "value": "{{token}}" 1744 | } 1745 | ], 1746 | "body": {}, 1747 | "url": { 1748 | "raw": "https://{{dnac}}:{{port}}/api/v1/device-image/device/{{deviceId}}/file", 1749 | "protocol": "https", 1750 | "host": [ 1751 | "{{dnac}}" 1752 | ], 1753 | "port": "{{port}}", 1754 | "path": [ 1755 | "api", 1756 | "v1", 1757 | "device-image", 1758 | "device", 1759 | "{{deviceId}}", 1760 | "file" 1761 | ] 1762 | } 1763 | }, 1764 | "response": [] 1765 | }, 1766 | { 1767 | "name": "https://{{apic}}:{{port}}/api/v1/device-image/device/{{deviceId}}/file/cat3k_caa-rpcore.16.06.01.SPA.pkg", 1768 | "event": [ 1769 | { 1770 | "listen": "test", 1771 | "script": { 1772 | "type": "text/javascript", 1773 | "exec": [ 1774 | "var data = JSON.parse(responseBody);", 1775 | "console.log(\"here\");", 1776 | "console.log(data.response.taskId);", 1777 | "if (data.response.taskId) {", 1778 | " tests[\"Body has taskid\"] = true;", 1779 | " postman.setEnvironmentVariable(\"taskId\", data.response.taskId);", 1780 | "}", 1781 | "else {", 1782 | " tests[\"Body has taskId\"] = false;", 1783 | "}", 1784 | "" 1785 | ] 1786 | } 1787 | } 1788 | ], 1789 | "request": { 1790 | "method": "DELETE", 1791 | "header": [ 1792 | { 1793 | "key": "x-auth-token", 1794 | "value": "{{token}}" 1795 | }, 1796 | { 1797 | "key": "Content-Type", 1798 | "value": "application/json" 1799 | } 1800 | ], 1801 | "body": {}, 1802 | "url": { 1803 | "raw": "https://{{dnac}}:{{port}}/api/v1/device-image/device/{{deviceId}}/file/cat9k_iosxe.16.06.02s.SPA.bin", 1804 | "protocol": "https", 1805 | "host": [ 1806 | "{{dnac}}" 1807 | ], 1808 | "port": "{{port}}", 1809 | "path": [ 1810 | "api", 1811 | "v1", 1812 | "device-image", 1813 | "device", 1814 | "{{deviceId}}", 1815 | "file", 1816 | "cat9k_iosxe.16.06.02s.SPA.bin" 1817 | ] 1818 | } 1819 | }, 1820 | "response": [] 1821 | }, 1822 | { 1823 | "name": "https://{{dnac}}:{{port}}/api/v1/task/{{taskId}}", 1824 | "request": { 1825 | "method": "GET", 1826 | "header": [ 1827 | { 1828 | "key": "x-auth-token", 1829 | "value": "{{token}}" 1830 | } 1831 | ], 1832 | "body": {}, 1833 | "url": { 1834 | "raw": "https://{{dnac}}:{{port}}/api/v1/task/{{taskId}}", 1835 | "protocol": "https", 1836 | "host": [ 1837 | "{{dnac}}" 1838 | ], 1839 | "port": "{{port}}", 1840 | "path": [ 1841 | "api", 1842 | "v1", 1843 | "task", 1844 | "{{taskId}}" 1845 | ] 1846 | }, 1847 | "description": "Gets a task status.\nuses environment variable for the taskId" 1848 | }, 1849 | "response": [] 1850 | }, 1851 | { 1852 | "name": "https://{{dnac}}:{{port}}/api/v1/image/activation/device", 1853 | "event": [ 1854 | { 1855 | "listen": "test", 1856 | "script": { 1857 | "type": "text/javascript", 1858 | "exec": [ 1859 | "var data = JSON.parse(responseBody);", 1860 | "console.log(\"here\");", 1861 | "console.log(data.response.taskId);", 1862 | "if (data.response.taskId) {", 1863 | " tests[\"Body has taskid\"] = true;", 1864 | " postman.setEnvironmentVariable(\"taskId\", data.response.taskId);", 1865 | "}", 1866 | "else {", 1867 | " tests[\"Body has taskId\"] = false;", 1868 | "}", 1869 | "" 1870 | ] 1871 | } 1872 | } 1873 | ], 1874 | "request": { 1875 | "method": "POST", 1876 | "header": [ 1877 | { 1878 | "key": "x-auth-token", 1879 | "value": "{{token}}" 1880 | }, 1881 | { 1882 | "key": "Content-Type", 1883 | "value": "application/json" 1884 | } 1885 | ], 1886 | "body": { 1887 | "mode": "raw", 1888 | "raw": "[\n\t{\n\t\t\"distributeIfNeeded\": false,\n\t\t\"activateLowerImageVersion\": false,\n\t\t\"imageUuidList\": [\n\t\t\t\"{{imageId}}\"\n\t\t],\n\t\t\"deviceUpgradeMode\": \"install\",\n\t\t\"deviceUuid\": \"{{deviceId}}\"\n\t}\n]" 1889 | }, 1890 | "url": { 1891 | "raw": "https://{{dnac}}:{{port}}/api/v1/image/activation/device", 1892 | "protocol": "https", 1893 | "host": [ 1894 | "{{dnac}}" 1895 | ], 1896 | "port": "{{port}}", 1897 | "path": [ 1898 | "api", 1899 | "v1", 1900 | "image", 1901 | "activation", 1902 | "device" 1903 | ] 1904 | } 1905 | }, 1906 | "response": [] 1907 | }, 1908 | { 1909 | "name": "https://{{apic}}:{{port}}/api/v1/network-device/ip-address/10.10.22.69", 1910 | "event": [ 1911 | { 1912 | "listen": "test", 1913 | "script": { 1914 | "id": "1a3ac034-9753-4de4-b168-60b791c3f575", 1915 | "type": "text/javascript", 1916 | "exec": [ 1917 | "var data = JSON.parse(responseBody);", 1918 | "", 1919 | "console.log(data);", 1920 | "if (data.response.id) {", 1921 | " tests[\"Body has response.id\"] = true;", 1922 | " postman.setEnvironmentVariable(\"deviceId2\", data.response.id);", 1923 | "}", 1924 | "else {", 1925 | " tests[\"Body has response.deviceId\"] = false;", 1926 | "}" 1927 | ] 1928 | } 1929 | } 1930 | ], 1931 | "request": { 1932 | "method": "GET", 1933 | "header": [ 1934 | { 1935 | "key": "x-auth-token", 1936 | "value": "{{token}}" 1937 | } 1938 | ], 1939 | "body": {}, 1940 | "url": { 1941 | "raw": "https://{{dnac}}:{{port}}/api/v1/network-device/ip-address/10.10.22.69", 1942 | "protocol": "https", 1943 | "host": [ 1944 | "{{dnac}}" 1945 | ], 1946 | "port": "{{port}}", 1947 | "path": [ 1948 | "api", 1949 | "v1", 1950 | "network-device", 1951 | "ip-address", 1952 | "10.10.22.69" 1953 | ] 1954 | } 1955 | }, 1956 | "response": [] 1957 | }, 1958 | { 1959 | "name": "https://{{dnac}}:{{port}}/api/v1/device-image/device?id={{deviceId}}", 1960 | "request": { 1961 | "method": "GET", 1962 | "header": [ 1963 | { 1964 | "key": "x-auth-token", 1965 | "value": "{{token}}" 1966 | } 1967 | ], 1968 | "body": {}, 1969 | "url": { 1970 | "raw": "https://{{dnac}}:{{port}}/api/v1/device-image/device?id={{deviceId2}},{{deviceId}}", 1971 | "protocol": "https", 1972 | "host": [ 1973 | "{{dnac}}" 1974 | ], 1975 | "port": "{{port}}", 1976 | "path": [ 1977 | "api", 1978 | "v1", 1979 | "device-image", 1980 | "device" 1981 | ], 1982 | "query": [ 1983 | { 1984 | "key": "id", 1985 | "value": "{{deviceId2}},{{deviceId}}" 1986 | } 1987 | ] 1988 | } 1989 | }, 1990 | "response": [] 1991 | }, 1992 | { 1993 | "name": "https://{{dnac}}:{{port}}/api/v1/image/task?operation=&taskType=activate&limit=50&sortOrder=des", 1994 | "event": [ 1995 | { 1996 | "listen": "test", 1997 | "script": { 1998 | "id": "a30d0f56-2d42-44f1-b7be-ddbfba80ea7b", 1999 | "type": "text/javascript", 2000 | "exec": [ 2001 | "var data = JSON.parse(responseBody);", 2002 | "", 2003 | "if (data.response[0].deviceTaskUuid) {", 2004 | " tests[\"Body has taskid\"] = true;", 2005 | " postman.setEnvironmentVariable(\"deviceTaskUuid\", data.response[0].deviceTaskUuid);", 2006 | "}", 2007 | "else {", 2008 | " tests[\"Body has taskId\"] = false;", 2009 | "}" 2010 | ] 2011 | } 2012 | } 2013 | ], 2014 | "request": { 2015 | "method": "GET", 2016 | "header": [ 2017 | { 2018 | "key": "x-auth-token", 2019 | "value": "{{token}}" 2020 | } 2021 | ], 2022 | "body": {}, 2023 | "url": { 2024 | "raw": "https://{{dnac}}:{{port}}/api/v1/image/task?operation=&taskType=activate&limit=50&sortOrder=des", 2025 | "protocol": "https", 2026 | "host": [ 2027 | "{{dnac}}" 2028 | ], 2029 | "port": "{{port}}", 2030 | "path": [ 2031 | "api", 2032 | "v1", 2033 | "image", 2034 | "task" 2035 | ], 2036 | "query": [ 2037 | { 2038 | "key": "operation", 2039 | "value": "" 2040 | }, 2041 | { 2042 | "key": "taskType", 2043 | "value": "activate" 2044 | }, 2045 | { 2046 | "key": "limit", 2047 | "value": "50" 2048 | }, 2049 | { 2050 | "key": "sortOrder", 2051 | "value": "des" 2052 | } 2053 | ] 2054 | } 2055 | }, 2056 | "response": [] 2057 | }, 2058 | { 2059 | "name": "https://{{dnac}}:{{port}}/api/v1/task?parentId={{deviceTaskUuid}}&sortBy=startTime&order=asc", 2060 | "request": { 2061 | "method": "GET", 2062 | "header": [ 2063 | { 2064 | "key": "x-auth-token", 2065 | "value": "{{token}}" 2066 | } 2067 | ], 2068 | "body": {}, 2069 | "url": { 2070 | "raw": "https://{{dnac}}:{{port}}/api/v1/task?parentId={{deviceTaskUuid}}&sortBy=startTime&order=asc", 2071 | "protocol": "https", 2072 | "host": [ 2073 | "{{dnac}}" 2074 | ], 2075 | "port": "{{port}}", 2076 | "path": [ 2077 | "api", 2078 | "v1", 2079 | "task" 2080 | ], 2081 | "query": [ 2082 | { 2083 | "key": "parentId", 2084 | "value": "{{deviceTaskUuid}}" 2085 | }, 2086 | { 2087 | "key": "sortBy", 2088 | "value": "startTime" 2089 | }, 2090 | { 2091 | "key": "order", 2092 | "value": "asc" 2093 | } 2094 | ] 2095 | } 2096 | }, 2097 | "response": [] 2098 | } 2099 | ] 2100 | }, 2101 | { 2102 | "name": "9.Command Runner", 2103 | "description": "", 2104 | "item": [ 2105 | { 2106 | "name": "https://{{apic}}:{{port}}/api/v1/network-device-poller/cli/read-request", 2107 | "event": [ 2108 | { 2109 | "listen": "test", 2110 | "script": { 2111 | "type": "text/javascript", 2112 | "exec": [ 2113 | "var data = JSON.parse(responseBody);", 2114 | "console.log(\"here\");", 2115 | "console.log(data.response.taskId);", 2116 | "if (data.response.taskId) {", 2117 | " tests[\"Body has taskid\"] = true;", 2118 | " postman.setEnvironmentVariable(\"taskId\", data.response.taskId);", 2119 | "}", 2120 | "else {", 2121 | " tests[\"Body has taskId\"] = false;", 2122 | "}", 2123 | "" 2124 | ] 2125 | } 2126 | } 2127 | ], 2128 | "request": { 2129 | "method": "POST", 2130 | "header": [ 2131 | { 2132 | "key": "x-auth-token", 2133 | "value": "{{token}}" 2134 | }, 2135 | { 2136 | "key": "Content-Type", 2137 | "value": "application/json" 2138 | } 2139 | ], 2140 | "body": { 2141 | "mode": "raw", 2142 | "raw": "{ \n \"name\" : \"show ver\",\n \"commands\" : [\"show ver | inc RELEASE\"],\n \"deviceUuids\" : [ \"{{deviceId}}\"]\n}\n" 2143 | }, 2144 | "url": { 2145 | "raw": "https://{{dnac}}:{{port}}/api/v1/network-device-poller/cli/read-request", 2146 | "protocol": "https", 2147 | "host": [ 2148 | "{{dnac}}" 2149 | ], 2150 | "port": "{{port}}", 2151 | "path": [ 2152 | "api", 2153 | "v1", 2154 | "network-device-poller", 2155 | "cli", 2156 | "read-request" 2157 | ] 2158 | } 2159 | }, 2160 | "response": [] 2161 | }, 2162 | { 2163 | "name": "https://{{apic}}:{{port}}/api/v1/task/{{taskid}}", 2164 | "event": [ 2165 | { 2166 | "listen": "test", 2167 | "script": { 2168 | "type": "text/javascript", 2169 | "exec": [ 2170 | "", 2171 | "var data = JSON.parse(responseBody);", 2172 | "", 2173 | "if (data.response.progress) {", 2174 | " ", 2175 | " var prog = JSON.parse(data.response.progress)", 2176 | " postman.setEnvironmentVariable(\"fileId\", prog.fileId);", 2177 | " ", 2178 | "}", 2179 | "else {", 2180 | " tests[\"Body has no fileId\"] = false;", 2181 | "}", 2182 | "", 2183 | "", 2184 | "" 2185 | ] 2186 | } 2187 | } 2188 | ], 2189 | "request": { 2190 | "method": "GET", 2191 | "header": [ 2192 | { 2193 | "key": "x-auth-token", 2194 | "value": "{{token}}" 2195 | } 2196 | ], 2197 | "body": { 2198 | "mode": "raw", 2199 | "raw": "{ \n \"username\" : \"{{username}}\",\n\"password\" : \"{{password}}\"\n}\n" 2200 | }, 2201 | "url": { 2202 | "raw": "https://{{dnac}}:{{port}}/api/v1/task/{{taskId}}", 2203 | "protocol": "https", 2204 | "host": [ 2205 | "{{dnac}}" 2206 | ], 2207 | "port": "{{port}}", 2208 | "path": [ 2209 | "api", 2210 | "v1", 2211 | "task", 2212 | "{{taskId}}" 2213 | ] 2214 | } 2215 | }, 2216 | "response": [] 2217 | }, 2218 | { 2219 | "name": "https://{{apic}}:{{port}}/api/v1/file/{{fileId}}", 2220 | "request": { 2221 | "method": "GET", 2222 | "header": [ 2223 | { 2224 | "key": "content-type", 2225 | "value": "application/json" 2226 | }, 2227 | { 2228 | "key": "x-auth-token", 2229 | "value": "{{token}}" 2230 | } 2231 | ], 2232 | "body": { 2233 | "mode": "raw", 2234 | "raw": "{ \n \"username\" : \"{{username}}\",\n\"password\" : \"{{password}}\"\n}\n" 2235 | }, 2236 | "url": { 2237 | "raw": "https://{{dnac}}:{{port}}/api/v1/file/{{fileId}}", 2238 | "protocol": "https", 2239 | "host": [ 2240 | "{{dnac}}" 2241 | ], 2242 | "port": "{{port}}", 2243 | "path": [ 2244 | "api", 2245 | "v1", 2246 | "file", 2247 | "{{fileId}}" 2248 | ] 2249 | } 2250 | }, 2251 | "response": [] 2252 | } 2253 | ] 2254 | }, 2255 | { 2256 | "name": "10.Template", 2257 | "description": "", 2258 | "item": [ 2259 | { 2260 | "name": "https://{{dnac}}:{{port}}/api/v1/template-programmer/project", 2261 | "request": { 2262 | "method": "GET", 2263 | "header": [ 2264 | { 2265 | "key": "x-auth-token", 2266 | "value": "{{token}}" 2267 | }, 2268 | { 2269 | "key": "Content-Type", 2270 | "value": "application/json" 2271 | } 2272 | ], 2273 | "body": {}, 2274 | "url": { 2275 | "raw": "https://{{dnac}}:{{port}}/api/v1/template-programmer/project", 2276 | "protocol": "https", 2277 | "host": [ 2278 | "{{dnac}}" 2279 | ], 2280 | "port": "{{port}}", 2281 | "path": [ 2282 | "api", 2283 | "v1", 2284 | "template-programmer", 2285 | "project" 2286 | ] 2287 | } 2288 | }, 2289 | "response": [] 2290 | }, 2291 | { 2292 | "name": "https://{{dnac}}:{{port}}/api/v1/template-programmer/template/3f7c91b4-4b17-4545-af58-290d51f1de55", 2293 | "request": { 2294 | "method": "GET", 2295 | "header": [ 2296 | { 2297 | "key": "x-auth-token", 2298 | "value": "{{token}}" 2299 | } 2300 | ], 2301 | "body": {}, 2302 | "url": { 2303 | "raw": "https://{{dnac}}:{{port}}/api/v1/template-programmer/template/3f7c91b4-4b17-4545-af58-290d51f1de55", 2304 | "protocol": "https", 2305 | "host": [ 2306 | "{{dnac}}" 2307 | ], 2308 | "port": "{{port}}", 2309 | "path": [ 2310 | "api", 2311 | "v1", 2312 | "template-programmer", 2313 | "template", 2314 | "3f7c91b4-4b17-4545-af58-290d51f1de55" 2315 | ] 2316 | } 2317 | }, 2318 | "response": [] 2319 | }, 2320 | { 2321 | "name": "https://{{dnac}}:{{port}}/api/v1/template-programmer/template/deploy", 2322 | "event": [ 2323 | { 2324 | "listen": "test", 2325 | "script": { 2326 | "type": "text/javascript", 2327 | "exec": [ 2328 | "var data = JSON.parse(responseBody);", 2329 | "", 2330 | "console.log(data);", 2331 | "if (data.deploymentId) {", 2332 | " tests[\"Body has deploymentId\"] = true;", 2333 | " postman.setEnvironmentVariable(\"deploymentId\", data.deploymentId);", 2334 | "}", 2335 | "else {", 2336 | " tests[\"Body has deploymentId\"] = false;", 2337 | "}" 2338 | ] 2339 | } 2340 | } 2341 | ], 2342 | "request": { 2343 | "method": "POST", 2344 | "header": [ 2345 | { 2346 | "key": "x-auth-token", 2347 | "value": "{{token}}" 2348 | }, 2349 | { 2350 | "key": "Content-Type", 2351 | "value": "application/json" 2352 | } 2353 | ], 2354 | "body": { 2355 | "mode": "raw", 2356 | "raw": "{\n \"templateId\": \"3f7c91b4-4b17-4545-af58-290d51f1de55\",\n \"targetInfo\": [\n {\n \n \"id\": \"10.10.22.70\",\n \"type\": \"MANAGED_DEVICE_IP\",\n \"params\": {\"description\": \"changed by DNAC -nnow\", \"interface\":\"TenGigabitEthernet1/0/24\"}\n }\n\t]\n}\n" 2357 | }, 2358 | "url": { 2359 | "raw": "https://{{dnac}}:{{port}}/api/v1/template-programmer/template/deploy", 2360 | "protocol": "https", 2361 | "host": [ 2362 | "{{dnac}}" 2363 | ], 2364 | "port": "{{port}}", 2365 | "path": [ 2366 | "api", 2367 | "v1", 2368 | "template-programmer", 2369 | "template", 2370 | "deploy" 2371 | ] 2372 | } 2373 | }, 2374 | "response": [] 2375 | }, 2376 | { 2377 | "name": "https://{{apic}}:{{port}}/api/v1/template-programmer/template/deploy/status/{{deploymentId}}", 2378 | "request": { 2379 | "method": "GET", 2380 | "header": [ 2381 | { 2382 | "key": "x-auth-token", 2383 | "value": "{{token}}" 2384 | } 2385 | ], 2386 | "body": {}, 2387 | "url": { 2388 | "raw": "https://{{dnac}}:{{port}}/api/v1/template-programmer/template/deploy/status/{{deploymentId}}", 2389 | "protocol": "https", 2390 | "host": [ 2391 | "{{dnac}}" 2392 | ], 2393 | "port": "{{port}}", 2394 | "path": [ 2395 | "api", 2396 | "v1", 2397 | "template-programmer", 2398 | "template", 2399 | "deploy", 2400 | "status", 2401 | "{{deploymentId}}" 2402 | ] 2403 | } 2404 | }, 2405 | "response": [] 2406 | } 2407 | ] 2408 | }, 2409 | { 2410 | "name": "11. Discovery", 2411 | "description": null, 2412 | "item": [ 2413 | { 2414 | "name": "https://{{dnac}}:{{port}}/api/v1/discovery", 2415 | "request": { 2416 | "method": "GET", 2417 | "header": [ 2418 | { 2419 | "key": "x-auth-token", 2420 | "value": "{{token}}" 2421 | }, 2422 | { 2423 | "key": "Content-Type", 2424 | "value": "application/json" 2425 | } 2426 | ], 2427 | "body": { 2428 | "mode": "raw", 2429 | "raw": "{\"id\":\"1\",\"discoveryStatus\":\"Active\"}" 2430 | }, 2431 | "url": { 2432 | "raw": "https://{{dnac}}:{{port}}/api/v1/discovery", 2433 | "protocol": "https", 2434 | "host": [ 2435 | "{{dnac}}" 2436 | ], 2437 | "port": "{{port}}", 2438 | "path": [ 2439 | "api", 2440 | "v1", 2441 | "discovery" 2442 | ] 2443 | } 2444 | }, 2445 | "response": [] 2446 | }, 2447 | { 2448 | "name": "https://{{dnac}}:{{port}}/api/v1/discovery", 2449 | "event": [ 2450 | { 2451 | "listen": "test", 2452 | "script": { 2453 | "id": "396a3d2f-563e-4aa7-8a85-d9eeee7b85b6", 2454 | "type": "text/javascript", 2455 | "exec": [ 2456 | "var data = JSON.parse(responseBody);", 2457 | "", 2458 | "if (data.response.taskId) {", 2459 | " tests[\"Body has taskid\"] = true;", 2460 | " postman.setEnvironmentVariable(\"taskId\", data.response.taskId);", 2461 | "}", 2462 | "else {", 2463 | " tests[\"Body has taskId\"] = false;", 2464 | "}", 2465 | "" 2466 | ] 2467 | } 2468 | } 2469 | ], 2470 | "request": { 2471 | "method": "PUT", 2472 | "header": [ 2473 | { 2474 | "key": "x-auth-token", 2475 | "value": "{{token}}" 2476 | }, 2477 | { 2478 | "key": "Content-Type", 2479 | "value": "application/json" 2480 | } 2481 | ], 2482 | "body": { 2483 | "mode": "raw", 2484 | "raw": "{\"id\":\"1\",\"discoveryStatus\":\"Active\"}" 2485 | }, 2486 | "url": { 2487 | "raw": "https://{{dnac}}:{{port}}/api/v1/discovery", 2488 | "protocol": "https", 2489 | "host": [ 2490 | "{{dnac}}" 2491 | ], 2492 | "port": "{{port}}", 2493 | "path": [ 2494 | "api", 2495 | "v1", 2496 | "discovery" 2497 | ] 2498 | } 2499 | }, 2500 | "response": [] 2501 | }, 2502 | { 2503 | "name": "https://{{dnac}}:{{port}}/api/v1/task/{{taskId}}", 2504 | "event": [ 2505 | { 2506 | "listen": "test", 2507 | "script": { 2508 | "type": "text/javascript", 2509 | "exec": [ 2510 | "var data = JSON.parse(responseBody);", 2511 | "", 2512 | "if (data.response.progress) {", 2513 | " tests[\"Body has progress\"] = true;", 2514 | " postman.setEnvironmentVariable(\"pathId\", data.response.progress);", 2515 | "}", 2516 | "else {", 2517 | " tests[\"Body has progress\"] = false;", 2518 | "}" 2519 | ] 2520 | } 2521 | } 2522 | ], 2523 | "request": { 2524 | "method": "GET", 2525 | "header": [ 2526 | { 2527 | "key": "x-auth-token", 2528 | "value": "{{token}}" 2529 | } 2530 | ], 2531 | "body": {}, 2532 | "url": { 2533 | "raw": "https://{{dnac}}:{{port}}/api/v1/task/{{taskId}}", 2534 | "protocol": "https", 2535 | "host": [ 2536 | "{{dnac}}" 2537 | ], 2538 | "port": "{{port}}", 2539 | "path": [ 2540 | "api", 2541 | "v1", 2542 | "task", 2543 | "{{taskId}}" 2544 | ] 2545 | }, 2546 | "description": "Gets a task status.\nuses environment variable for the taskId\n\nAlso parses the result of the task to find the ID of the path.\n\nThis is stored in the pathId environment variable" 2547 | }, 2548 | "response": [] 2549 | } 2550 | ] 2551 | }, 2552 | { 2553 | "name": "12. Know Your Network", 2554 | "description": null, 2555 | "item": [ 2556 | { 2557 | "name": "https://{{dnac}}:{{port}}/dna/intent/api/v1/network-health", 2558 | "request": { 2559 | "method": "GET", 2560 | "header": [ 2561 | { 2562 | "key": "x-auth-token", 2563 | "value": "{{token}}" 2564 | }, 2565 | { 2566 | "key": "__runsync", 2567 | "value": "True" 2568 | } 2569 | ], 2570 | "body": {}, 2571 | "url": { 2572 | "raw": "https://{{dnac}}:{{port}}/dna/intent/api/v1/network-health?startTime=&endTime=", 2573 | "protocol": "https", 2574 | "host": [ 2575 | "{{dnac}}" 2576 | ], 2577 | "port": "{{port}}", 2578 | "path": [ 2579 | "dna", 2580 | "intent", 2581 | "api", 2582 | "v1", 2583 | "network-health" 2584 | ], 2585 | "query": [ 2586 | { 2587 | "key": "startTime", 2588 | "value": "" 2589 | }, 2590 | { 2591 | "key": "endTime", 2592 | "value": "" 2593 | } 2594 | ] 2595 | } 2596 | }, 2597 | "response": [] 2598 | }, 2599 | { 2600 | "name": "https://{{dnac}}:{{port}}/dna/intent/api/v1/site-hierarchy", 2601 | "request": { 2602 | "method": "GET", 2603 | "header": [ 2604 | { 2605 | "key": "x-auth-token", 2606 | "value": "{{token}}" 2607 | }, 2608 | { 2609 | "key": "__runsync", 2610 | "value": "True" 2611 | } 2612 | ], 2613 | "body": {}, 2614 | "url": { 2615 | "raw": "https://{{dnac}}:{{port}}/dna/intent/api/v1/site-hierarchy?timestamp=", 2616 | "protocol": "https", 2617 | "host": [ 2618 | "{{dnac}}" 2619 | ], 2620 | "port": "{{port}}", 2621 | "path": [ 2622 | "dna", 2623 | "intent", 2624 | "api", 2625 | "v1", 2626 | "site-hierarchy" 2627 | ], 2628 | "query": [ 2629 | { 2630 | "key": "timestamp", 2631 | "value": "" 2632 | } 2633 | ] 2634 | } 2635 | }, 2636 | "response": [] 2637 | }, 2638 | { 2639 | "name": "https://{{dnac}}:{{port}}/dna/intent/api/v1/client-health?startTime=&endTime=", 2640 | "request": { 2641 | "method": "GET", 2642 | "header": [ 2643 | { 2644 | "key": "x-auth-token", 2645 | "value": "{{token}}" 2646 | }, 2647 | { 2648 | "key": "__runsync", 2649 | "value": "True" 2650 | } 2651 | ], 2652 | "body": {}, 2653 | "url": { 2654 | "raw": "https://{{dnac}}:{{port}}/dna/intent/api/v1/client-health?startTime=&endTime=", 2655 | "protocol": "https", 2656 | "host": [ 2657 | "{{dnac}}" 2658 | ], 2659 | "port": "{{port}}", 2660 | "path": [ 2661 | "dna", 2662 | "intent", 2663 | "api", 2664 | "v1", 2665 | "client-health" 2666 | ], 2667 | "query": [ 2668 | { 2669 | "key": "startTime", 2670 | "value": "" 2671 | }, 2672 | { 2673 | "key": "endTime", 2674 | "value": "" 2675 | } 2676 | ] 2677 | } 2678 | }, 2679 | "response": [] 2680 | }, 2681 | { 2682 | "name": "https://{{dnac}}:{{port}}/api/assurance/v1/time", 2683 | "event": [ 2684 | { 2685 | "listen": "test", 2686 | "script": { 2687 | "id": "1ca0333c-fd52-4b17-83f6-1f6047e44b74", 2688 | "type": "text/javascript", 2689 | "exec": [ 2690 | "var data = JSON.parse(responseBody);", 2691 | "console.log(\"here\");", 2692 | "console.log(data.response);", 2693 | "if (data.response) {", 2694 | " for (i = 0; i < data.response.length; i++) { ", 2695 | " if (data.response[i].timeType == 'GLOBAL'){", 2696 | " postman.setEnvironmentVariable(\"GLOBALtime\", data.response[i].time );", 2697 | " postman.setEnvironmentVariable(\"GLOBALstartTime\", data.response[i].time - 10000 );", 2698 | " }", 2699 | " if (data.response[i].timeType == 'CLIENT'){", 2700 | " postman.setEnvironmentVariable(\"CLIENTtime\", data.response[i].time );", 2701 | " }", 2702 | " }", 2703 | "}", 2704 | "", 2705 | "" 2706 | ] 2707 | } 2708 | } 2709 | ], 2710 | "request": { 2711 | "method": "GET", 2712 | "header": [ 2713 | { 2714 | "key": "x-auth-token", 2715 | "value": "{{token}}" 2716 | } 2717 | ], 2718 | "body": {}, 2719 | "url": { 2720 | "raw": "https://{{dnac}}:{{port}}/api/assurance/v1/time", 2721 | "protocol": "https", 2722 | "host": [ 2723 | "{{dnac}}" 2724 | ], 2725 | "port": "{{port}}", 2726 | "path": [ 2727 | "api", 2728 | "assurance", 2729 | "v1", 2730 | "time" 2731 | ] 2732 | } 2733 | }, 2734 | "response": [] 2735 | }, 2736 | { 2737 | "name": "https://{{dnac}}:{{port}}/api/v1/host?limit=100&offset=1", 2738 | "event": [ 2739 | { 2740 | "listen": "test", 2741 | "script": { 2742 | "id": "4f493fb1-d66b-473c-b3c2-1de4d74aa886", 2743 | "type": "text/javascript", 2744 | "exec": [ 2745 | "var data = JSON.parse(responseBody);", 2746 | "", 2747 | "if (data.response[0].hostMac) {", 2748 | " tests[\"Body has hostMac\"] = true;", 2749 | " postman.setEnvironmentVariable(\"mac\", data.response[0].hostMac);", 2750 | " ", 2751 | "}", 2752 | " ", 2753 | "}", 2754 | "else {", 2755 | " tests[\"Body has response\"] = false;", 2756 | "}", 2757 | "" 2758 | ] 2759 | } 2760 | } 2761 | ], 2762 | "request": { 2763 | "method": "GET", 2764 | "header": [ 2765 | { 2766 | "key": "x-auth-token", 2767 | "value": "{{token}}" 2768 | } 2769 | ], 2770 | "body": {}, 2771 | "url": { 2772 | "raw": "https://{{dnac}}:{{port}}/api/v1/host?hostIp=10.10.22.114", 2773 | "protocol": "https", 2774 | "host": [ 2775 | "{{dnac}}" 2776 | ], 2777 | "port": "{{port}}", 2778 | "path": [ 2779 | "api", 2780 | "v1", 2781 | "host" 2782 | ], 2783 | "query": [ 2784 | { 2785 | "key": "hostIp", 2786 | "value": "10.10.22.114" 2787 | } 2788 | ] 2789 | } 2790 | }, 2791 | "response": [] 2792 | }, 2793 | { 2794 | "name": "https://{{dnac}}:{{port}}/dna/intent/api/v1/client-detail", 2795 | "request": { 2796 | "method": "GET", 2797 | "header": [ 2798 | { 2799 | "key": "x-auth-token", 2800 | "value": "{{token}}" 2801 | }, 2802 | { 2803 | "key": "__runsync", 2804 | "value": "True" 2805 | } 2806 | ], 2807 | "body": {}, 2808 | "url": { 2809 | "raw": "https://{{dnac}}:{{port}}/dna/intent/api/v1/client-detail?timestamp={{GLOBALtime}}&macAddress={{mac}}", 2810 | "protocol": "https", 2811 | "host": [ 2812 | "{{dnac}}" 2813 | ], 2814 | "port": "{{port}}", 2815 | "path": [ 2816 | "dna", 2817 | "intent", 2818 | "api", 2819 | "v1", 2820 | "client-detail" 2821 | ], 2822 | "query": [ 2823 | { 2824 | "key": "timestamp", 2825 | "value": "{{GLOBALtime}}" 2826 | }, 2827 | { 2828 | "key": "macAddress", 2829 | "value": "{{mac}}" 2830 | } 2831 | ] 2832 | } 2833 | }, 2834 | "response": [] 2835 | } 2836 | ], 2837 | "event": [ 2838 | { 2839 | "listen": "prerequest", 2840 | "script": { 2841 | "id": "822d79d8-f8ee-42f4-b4bd-3ee26e0a69c5", 2842 | "type": "text/javascript", 2843 | "exec": [ 2844 | "" 2845 | ] 2846 | } 2847 | }, 2848 | { 2849 | "listen": "test", 2850 | "script": { 2851 | "id": "5d410258-7616-41bd-b391-cf9c14d2448d", 2852 | "type": "text/javascript", 2853 | "exec": [ 2854 | "" 2855 | ] 2856 | } 2857 | } 2858 | ] 2859 | }, 2860 | { 2861 | "name": "999.OldNetworkPnP", 2862 | "description": "The order of these requests is important.\n\nThe project that is created gets captured as a projectId variable", 2863 | "item": [ 2864 | { 2865 | "name": "https://{dnac}}:{{port}}/api/v1/pnp-project", 2866 | "event": [ 2867 | { 2868 | "listen": "test", 2869 | "script": { 2870 | "type": "text/javascript", 2871 | "exec": [ 2872 | "var data = JSON.parse(responseBody);", 2873 | "console.log(\"here\");", 2874 | "console.log(data.response.taskId);", 2875 | "if (data.response.taskId) {", 2876 | " tests[\"Body has taskid\"] = true;", 2877 | " postman.setEnvironmentVariable(\"taskId\", data.response.taskId);", 2878 | "}", 2879 | "else {", 2880 | " tests[\"Body has taskId\"] = false;", 2881 | "}", 2882 | "" 2883 | ] 2884 | } 2885 | } 2886 | ], 2887 | "request": { 2888 | "method": "GET", 2889 | "header": [ 2890 | { 2891 | "key": "x-auth-token", 2892 | "value": "{{token}}" 2893 | }, 2894 | { 2895 | "key": "Content-type", 2896 | "value": "application/json" 2897 | } 2898 | ], 2899 | "body": {}, 2900 | "url": { 2901 | "raw": "https://{{dnac}}:{{port}}/api/v1/pnp-project", 2902 | "protocol": "https", 2903 | "host": [ 2904 | "{{dnac}}" 2905 | ], 2906 | "port": "{{port}}", 2907 | "path": [ 2908 | "api", 2909 | "v1", 2910 | "pnp-project" 2911 | ] 2912 | }, 2913 | "description": "Gets a list of all projects defined on the controller" 2914 | }, 2915 | "response": [] 2916 | }, 2917 | { 2918 | "name": "https://{{dnac}}:{{port}}/api/v1/pnp-project", 2919 | "event": [ 2920 | { 2921 | "listen": "test", 2922 | "script": { 2923 | "type": "text/javascript", 2924 | "exec": [ 2925 | "var data = JSON.parse(responseBody);", 2926 | "console.log(\"here\");", 2927 | "console.log(data.response.taskId);", 2928 | "if (data.response.taskId) {", 2929 | " tests[\"Body has taskid\"] = true;", 2930 | " postman.setEnvironmentVariable(\"taskId\", data.response.taskId);", 2931 | "}", 2932 | "else {", 2933 | " tests[\"Body has taskId\"] = false;", 2934 | "}", 2935 | "" 2936 | ] 2937 | } 2938 | } 2939 | ], 2940 | "request": { 2941 | "method": "POST", 2942 | "header": [ 2943 | { 2944 | "key": "x-auth-token", 2945 | "value": "{{token}}" 2946 | }, 2947 | { 2948 | "key": "Content-type", 2949 | "value": "application/json" 2950 | } 2951 | ], 2952 | "body": { 2953 | "mode": "raw", 2954 | "raw": "[{\"siteName\": \"Sydney\"}]" 2955 | }, 2956 | "url": { 2957 | "raw": "https://{{dnac}}:{{port}}/api/v1/pnp-project", 2958 | "protocol": "https", 2959 | "host": [ 2960 | "{{dnac}}" 2961 | ], 2962 | "port": "{{port}}", 2963 | "path": [ 2964 | "api", 2965 | "v1", 2966 | "pnp-project" 2967 | ] 2968 | }, 2969 | "description": "Creates a new project" 2970 | }, 2971 | "response": [] 2972 | }, 2973 | { 2974 | "name": "https://{{dnac}}:{{port}}/api/v1/task/{{taskId}}", 2975 | "event": [ 2976 | { 2977 | "listen": "test", 2978 | "script": { 2979 | "type": "text/javascript", 2980 | "exec": [ 2981 | "var data = JSON.parse(responseBody);", 2982 | "", 2983 | "if (data.response.progress) {", 2984 | " tests[\"Body has progress\"] = true;", 2985 | " var prog = JSON.parse(data.response.progress)", 2986 | " postman.setEnvironmentVariable(\"projectId\", prog.siteId);", 2987 | "}", 2988 | "else {", 2989 | " tests[\"Body has progress\"] = false;", 2990 | "}" 2991 | ] 2992 | } 2993 | } 2994 | ], 2995 | "request": { 2996 | "method": "GET", 2997 | "header": [ 2998 | { 2999 | "key": "x-auth-token", 3000 | "value": "{{token}}" 3001 | } 3002 | ], 3003 | "body": {}, 3004 | "url": { 3005 | "raw": "https://{{dnac}}:{{port}}/api/v1/task/{{taskId}}", 3006 | "protocol": "https", 3007 | "host": [ 3008 | "{{dnac}}" 3009 | ], 3010 | "port": "{{port}}", 3011 | "path": [ 3012 | "api", 3013 | "v1", 3014 | "task", 3015 | "{{taskId}}" 3016 | ] 3017 | }, 3018 | "description": "Gets a task status.\nuses environment variable for the taskId\n\nAlso parse the progress field to find the ID of the project that was created\n\nthis is stored in the projectId environment variable." 3019 | }, 3020 | "response": [] 3021 | }, 3022 | { 3023 | "name": "https://{{dnac}}:{{port}}/api/v1/pnp-project/{{projectId}}/device", 3024 | "event": [ 3025 | { 3026 | "listen": "test", 3027 | "script": { 3028 | "type": "text/javascript", 3029 | "exec": [ 3030 | "var data = JSON.parse(responseBody);", 3031 | "console.log(\"here\");", 3032 | "console.log(data.response.taskId);", 3033 | "if (data.response.taskId) {", 3034 | " tests[\"Body has taskid\"] = true;", 3035 | " postman.setEnvironmentVariable(\"taskId\", data.response.taskId);", 3036 | "}", 3037 | "else {", 3038 | " tests[\"Body has taskId\"] = false;", 3039 | "}", 3040 | "" 3041 | ] 3042 | } 3043 | } 3044 | ], 3045 | "request": { 3046 | "method": "POST", 3047 | "header": [ 3048 | { 3049 | "key": "x-auth-token", 3050 | "value": "{{token}}" 3051 | }, 3052 | { 3053 | "key": "Content-type", 3054 | "value": "application/json" 3055 | } 3056 | ], 3057 | "body": { 3058 | "mode": "raw", 3059 | "raw": "[{\n \"serialNumber\": \"12345678901\",\n \"platformId\": \"C2960X\",\n \"hostName\": \"syd-sw1\",\n \"pkiEnabled\": true\n}]" 3060 | }, 3061 | "url": { 3062 | "raw": "https://{{dnac}}:{{port}}/api/v1/pnp-project/{{projectId}}/device", 3063 | "protocol": "https", 3064 | "host": [ 3065 | "{{dnac}}" 3066 | ], 3067 | "port": "{{port}}", 3068 | "path": [ 3069 | "api", 3070 | "v1", 3071 | "pnp-project", 3072 | "{{projectId}}", 3073 | "device" 3074 | ] 3075 | }, 3076 | "description": "Creates a rule for a device in a project.\n\nuses the projectId from the project we created earlier" 3077 | }, 3078 | "response": [] 3079 | }, 3080 | { 3081 | "name": "https://{{dnac}}:{{port}}/api/v1/task/{{taskId}}", 3082 | "request": { 3083 | "method": "GET", 3084 | "header": [ 3085 | { 3086 | "key": "x-auth-token", 3087 | "value": "{{token}}" 3088 | } 3089 | ], 3090 | "body": {}, 3091 | "url": { 3092 | "raw": "https://{{dnac}}:{{port}}/api/v1/task/{{taskId}}", 3093 | "protocol": "https", 3094 | "host": [ 3095 | "{{dnac}}" 3096 | ], 3097 | "port": "{{port}}", 3098 | "path": [ 3099 | "api", 3100 | "v1", 3101 | "task", 3102 | "{{taskId}}" 3103 | ] 3104 | }, 3105 | "description": "Gets a task status.\nuses environment variable for the taskId" 3106 | }, 3107 | "response": [] 3108 | }, 3109 | { 3110 | "name": "https://{{dnac}}:{{port}}/api/v1/pnp-project/{{projectId}}/device", 3111 | "event": [ 3112 | { 3113 | "listen": "test", 3114 | "script": { 3115 | "type": "text/javascript", 3116 | "exec": [ 3117 | "var data = JSON.parse(responseBody);", 3118 | "", 3119 | "if (data.response) {", 3120 | " tests[\"Body has progress\"] = true;", 3121 | " postman.setEnvironmentVariable(\"projectDeviceId\", data.response[0].id);", 3122 | "}", 3123 | "else {", 3124 | " tests[\"Body has progress\"] = false;", 3125 | "}" 3126 | ] 3127 | } 3128 | } 3129 | ], 3130 | "request": { 3131 | "method": "GET", 3132 | "header": [ 3133 | { 3134 | "key": "x-auth-token", 3135 | "value": "{{token}}" 3136 | } 3137 | ], 3138 | "body": {}, 3139 | "url": { 3140 | "raw": "https://{{dnac}}:{{port}}/api/v1/pnp-project/{{projectId}}/device", 3141 | "protocol": "https", 3142 | "host": [ 3143 | "{{dnac}}" 3144 | ], 3145 | "port": "{{port}}", 3146 | "path": [ 3147 | "api", 3148 | "v1", 3149 | "pnp-project", 3150 | "{{projectId}}", 3151 | "device" 3152 | ] 3153 | }, 3154 | "description": "Gets all of the devices for a project\nUses the projectId environment variable" 3155 | }, 3156 | "response": [] 3157 | }, 3158 | { 3159 | "name": "https://{{dnac}}:{{port}}/api/v1/pnp-project/{{projectId}}/device", 3160 | "event": [ 3161 | { 3162 | "listen": "test", 3163 | "script": { 3164 | "type": "text/javascript", 3165 | "exec": [ 3166 | "var data = JSON.parse(responseBody);", 3167 | "console.log(\"here\");", 3168 | "console.log(data.response.taskId);", 3169 | "if (data.response.taskId) {", 3170 | " tests[\"Body has taskid\"] = true;", 3171 | " postman.setEnvironmentVariable(\"taskId\", data.response.taskId);", 3172 | "}", 3173 | "else {", 3174 | " tests[\"Body has taskId\"] = false;", 3175 | "}", 3176 | "" 3177 | ] 3178 | } 3179 | } 3180 | ], 3181 | "request": { 3182 | "method": "PUT", 3183 | "header": [ 3184 | { 3185 | "key": "x-auth-token", 3186 | "value": "{{token}}" 3187 | }, 3188 | { 3189 | "key": "Content-type", 3190 | "value": "application/json" 3191 | } 3192 | ], 3193 | "body": { 3194 | "mode": "raw", 3195 | "raw": "[{\n \"serialNumber\": \"12345678901\",\n \"platformId\": \"C2960X\",\n \"hostName\": \"syd-sw2\",\n \"pkiEnabled\": true,\n \"id\" : \"{{projectDeviceId}}\"\n}]" 3196 | }, 3197 | "url": { 3198 | "raw": "https://{{dnac}}:{{port}}/api/v1/pnp-project/{{projectId}}/device", 3199 | "protocol": "https", 3200 | "host": [ 3201 | "{{dnac}}" 3202 | ], 3203 | "port": "{{port}}", 3204 | "path": [ 3205 | "api", 3206 | "v1", 3207 | "pnp-project", 3208 | "{{projectId}}", 3209 | "device" 3210 | ] 3211 | }, 3212 | "description": "Updates a parameter of the device\nUses the projectNetworkDevice variable from the environment\nAlso needs projectId environment variable" 3213 | }, 3214 | "response": [] 3215 | }, 3216 | { 3217 | "name": "https://{{dnac}}:{{port}}/api/v1/pnp-project/{{projectId}}?deleteRule=1&deleteDevice=1", 3218 | "event": [ 3219 | { 3220 | "listen": "test", 3221 | "script": { 3222 | "type": "text/javascript", 3223 | "exec": [ 3224 | "var data1 = JSON.parse(responseBody);", 3225 | "console.log(\"here\");", 3226 | "console.log(data1.response.taskId);", 3227 | "", 3228 | "postman.setEnvironmentVariable(\"taskId\", data1.response.taskId);" 3229 | ] 3230 | } 3231 | } 3232 | ], 3233 | "request": { 3234 | "method": "DELETE", 3235 | "header": [ 3236 | { 3237 | "key": "x-auth-token", 3238 | "value": "{{token}}" 3239 | } 3240 | ], 3241 | "body": {}, 3242 | "url": { 3243 | "raw": "https://{{dnac}}:{{port}}/api/v1/pnp-project/{{projectId}}?deleteRule=1&deleteDevice=1", 3244 | "protocol": "https", 3245 | "host": [ 3246 | "{{dnac}}" 3247 | ], 3248 | "port": "{{port}}", 3249 | "path": [ 3250 | "api", 3251 | "v1", 3252 | "pnp-project", 3253 | "{{projectId}}" 3254 | ], 3255 | "query": [ 3256 | { 3257 | "key": "deleteRule", 3258 | "value": "1" 3259 | }, 3260 | { 3261 | "key": "deleteDevice", 3262 | "value": "1" 3263 | } 3264 | ] 3265 | }, 3266 | "description": "Delete the project and all rules/devices contained in it" 3267 | }, 3268 | "response": [] 3269 | }, 3270 | { 3271 | "name": "https://{{dnac}}:{{port}}/api/v1/task/{{taskId}}", 3272 | "request": { 3273 | "method": "GET", 3274 | "header": [ 3275 | { 3276 | "key": "x-auth-token", 3277 | "value": "{{token}}" 3278 | } 3279 | ], 3280 | "body": {}, 3281 | "url": { 3282 | "raw": "https://{{dnac}}:{{port}}/api/v1/task/{{taskId}}", 3283 | "protocol": "https", 3284 | "host": [ 3285 | "{{dnac}}" 3286 | ], 3287 | "port": "{{port}}", 3288 | "path": [ 3289 | "api", 3290 | "v1", 3291 | "task", 3292 | "{{taskId}}" 3293 | ] 3294 | }, 3295 | "description": "Gets a task status.\nuses environment variable for the taskId" 3296 | }, 3297 | "response": [] 3298 | }, 3299 | { 3300 | "name": "https://{{dnac}}:{{port}}/api/v1/file/namespace/config", 3301 | "request": { 3302 | "method": "GET", 3303 | "header": [ 3304 | { 3305 | "key": "x-auth-token", 3306 | "value": "{{token}}" 3307 | } 3308 | ], 3309 | "body": {}, 3310 | "url": { 3311 | "raw": "https://{{dnac}}:{{port}}/api/v1/file/namespace/config", 3312 | "protocol": "https", 3313 | "host": [ 3314 | "{{dnac}}" 3315 | ], 3316 | "port": "{{port}}", 3317 | "path": [ 3318 | "api", 3319 | "v1", 3320 | "file", 3321 | "namespace", 3322 | "config" 3323 | ] 3324 | }, 3325 | "description": "Lists all of the config files on the controller.\nYou can all do the same thing for image files" 3326 | }, 3327 | "response": [] 3328 | }, 3329 | { 3330 | "name": "https://{{dnac}}:{{port}}/api/v1/file/config", 3331 | "event": [ 3332 | { 3333 | "listen": "test", 3334 | "script": { 3335 | "type": "text/javascript", 3336 | "exec": [ 3337 | "var data = JSON.parse(responseBody);", 3338 | "console.log(\"here\");", 3339 | "console.log(data.response.taskId);", 3340 | "if (data.response.id) {", 3341 | " tests[\"Body has id\"] = true;", 3342 | " postman.setEnvironmentVariable(\"fileId\", data.response.id);", 3343 | "}", 3344 | "else {", 3345 | " tests[\"Body has id\"] = false;", 3346 | "}", 3347 | "" 3348 | ] 3349 | } 3350 | } 3351 | ], 3352 | "request": { 3353 | "method": "POST", 3354 | "header": [ 3355 | { 3356 | "key": "x-auth-token", 3357 | "value": "{{token}}" 3358 | } 3359 | ], 3360 | "body": { 3361 | "mode": "formdata", 3362 | "formdata": [ 3363 | { 3364 | "key": "fileUpload", 3365 | "value": "", 3366 | "type": "file" 3367 | } 3368 | ] 3369 | }, 3370 | "url": { 3371 | "raw": "https://{{dnac}}:{{port}}/api/v1/file/config", 3372 | "protocol": "https", 3373 | "host": [ 3374 | "{{dnac}}" 3375 | ], 3376 | "port": "{{port}}", 3377 | "path": [ 3378 | "api", 3379 | "v1", 3380 | "file", 3381 | "config" 3382 | ] 3383 | }, 3384 | "description": "This uploads a configuration file to the controller.\n\nNOTE: You need to select a file to be uploaded. CLick on the \"body\" tab to select a file\n\nNOTENOTE: This call is synchronous... there is no task" 3385 | }, 3386 | "response": [] 3387 | }, 3388 | { 3389 | "name": "https://{{dnac}}:{{port}}/api/v1/file/{{fileId}}", 3390 | "event": [ 3391 | { 3392 | "listen": "test", 3393 | "script": { 3394 | "type": "text/javascript", 3395 | "exec": [ 3396 | "var data1 = JSON.parse(responseBody);", 3397 | "console.log(\"here\");", 3398 | "console.log(data1.response.taskId);", 3399 | "", 3400 | "postman.setEnvironmentVariable(\"taskId\", data1.response.taskId);" 3401 | ] 3402 | } 3403 | } 3404 | ], 3405 | "request": { 3406 | "method": "DELETE", 3407 | "header": [ 3408 | { 3409 | "key": "x-auth-token", 3410 | "value": "{{token}}" 3411 | } 3412 | ], 3413 | "body": {}, 3414 | "url": { 3415 | "raw": "https://{{dnac}}:{{port}}/api/v1/file/{{fileId}}", 3416 | "protocol": "https", 3417 | "host": [ 3418 | "{{dnac}}" 3419 | ], 3420 | "port": "{{port}}", 3421 | "path": [ 3422 | "api", 3423 | "v1", 3424 | "file", 3425 | "{{fileId}}" 3426 | ] 3427 | }, 3428 | "description": "Deletes a configuration file from the controller.\n\nUses the fileId from the previous POST to delete" 3429 | }, 3430 | "response": [] 3431 | } 3432 | ], 3433 | "event": [ 3434 | { 3435 | "listen": "prerequest", 3436 | "script": { 3437 | "id": "4467ba67-caf8-4cf5-8577-d8ce3a4cee48", 3438 | "type": "text/javascript", 3439 | "exec": [ 3440 | "" 3441 | ] 3442 | } 3443 | }, 3444 | { 3445 | "listen": "test", 3446 | "script": { 3447 | "id": "6e528ae4-b24c-4ac8-b7ee-07aa304c3ed0", 3448 | "type": "text/javascript", 3449 | "exec": [ 3450 | "" 3451 | ] 3452 | } 3453 | } 3454 | ] 3455 | }, 3456 | { 3457 | "name": "https://{{dnac}}:{{port}}/api/v1/network-device/1/14", 3458 | "request": { 3459 | "method": "GET", 3460 | "header": [ 3461 | { 3462 | "key": "x-auth-token", 3463 | "value": "{{token}}" 3464 | } 3465 | ], 3466 | "body": {}, 3467 | "url": { 3468 | "raw": "https://{{dnac}}:{{port}}/api/v1/discovery", 3469 | "protocol": "https", 3470 | "host": [ 3471 | "{{dnac}}" 3472 | ], 3473 | "port": "{{port}}", 3474 | "path": [ 3475 | "api", 3476 | "v1", 3477 | "discovery" 3478 | ] 3479 | } 3480 | }, 3481 | "response": [] 3482 | } 3483 | ] 3484 | } -------------------------------------------------------------------------------- /DNAC-Sandbox.postman_environment.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "8b40e26d-9fc7-ea6a-64d5-9cb232e3838c", 3 | "name": "DNAC-Sandbox", 4 | "values": [ 5 | { 6 | "enabled": true, 7 | "key": "dnac", 8 | "value": "sandboxdnac.cisco.com", 9 | "type": "text" 10 | }, 11 | { 12 | "enabled": true, 13 | "key": "username", 14 | "value": "devnetuser", 15 | "type": "text" 16 | }, 17 | { 18 | "enabled": true, 19 | "key": "password", 20 | "value": "Cisco123!", 21 | "type": "text" 22 | }, 23 | { 24 | "enabled": true, 25 | "key": "token", 26 | "value": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiI1YTU4Y2QzN2UwNWJiYTAwOGVmNjJiOTIiLCJhdXRoU291cmNlIjoiaW50ZXJuYWwiLCJ0ZW5hbnROYW1lIjoiVE5UMCIsInJvbGVzIjpbIjVhMzE1MTYwOTA5MGZiYTY5OGIyZjViNyJdLCJ0ZW5hbnRJZCI6IjVhMzE1MTlkZTA1YmJhMDA4ZWY2MWYwYSIsImV4cCI6MTUxNjk1MjIyNCwidXNlcm5hbWUiOiJkZXZuZXR1c2VyIn0.hu_vfX1OtqHhOHdh_NARWDpGvvI9d9Cpv6mfN1HaQV0", 27 | "type": "text" 28 | }, 29 | { 30 | "enabled": true, 31 | "key": "port", 32 | "value": "443", 33 | "type": "text" 34 | }, 35 | { 36 | "enabled": true, 37 | "key": "deviceId", 38 | "value": "74b69532-5dc3-45a1-a0dd-6d1d10051f27", 39 | "type": "text" 40 | }, 41 | { 42 | "enabled": true, 43 | "key": "tagId", 44 | "value": "63088baa-d1fe-419f-862c-044ccb18c99a", 45 | "type": "text" 46 | }, 47 | { 48 | "enabled": true, 49 | "key": "taskId", 50 | "value": "f5759d3c-f619-4927-b5b6-5bb371f20635", 51 | "type": "text" 52 | }, 53 | { 54 | "enabled": true, 55 | "key": "pathId", 56 | "value": "729ad4c6-fe30-4ad4-916d-ba0a56223fbf", 57 | "type": "text" 58 | }, 59 | { 60 | "enabled": true, 61 | "key": "GLOBALtime", 62 | "value": "1516866600000", 63 | "type": "text" 64 | }, 65 | { 66 | "enabled": true, 67 | "key": "CLIENTtime", 68 | "value": "1516866600000", 69 | "type": "text" 70 | } 71 | ], 72 | "timestamp": 1516948636125, 73 | "_postman_variable_scope": "environment", 74 | "_postman_exported_at": "2018-01-26T09:35:18.649Z", 75 | "_postman_exported_using": "Postman/5.5.0" 76 | } -------------------------------------------------------------------------------- /DNAC-SandboxProxy.postman_environment.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "12f400ef-37a5-b5f8-ef83-89303b691104", 3 | "name": "DNAC-Sandbox Proxy", 4 | "values": [ 5 | { 6 | "enabled": true, 7 | "key": "dnac", 8 | "value": "sandboxdnac.cisco.com", 9 | "type": "text" 10 | }, 11 | { 12 | "enabled": true, 13 | "key": "username", 14 | "value": "devnetuser", 15 | "type": "text" 16 | }, 17 | { 18 | "enabled": true, 19 | "key": "password", 20 | "value": "Cisco123!", 21 | "type": "text" 22 | }, 23 | { 24 | "enabled": true, 25 | "key": "port", 26 | "value": "8080", 27 | "type": "text" 28 | }, 29 | { 30 | "enabled": true, 31 | "key": "deviceId", 32 | "value": "74b69532-5dc3-45a1-a0dd-6d1d10051f27", 33 | "type": "text" 34 | }, 35 | { 36 | "enabled": true, 37 | "key": "tagId", 38 | "value": "d1bce9c7-39c2-4db8-9227-b96891aaaca5", 39 | "type": "text" 40 | }, 41 | { 42 | "enabled": true, 43 | "key": "token", 44 | "value": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiI1YTU4Y2QzN2UwNWJiYTAwOGVmNjJiOTIiLCJhdXRoU291cmNlIjoiaW50ZXJuYWwiLCJ0ZW5hbnROYW1lIjoiVE5UMCIsInJvbGVzIjpbIjVhMzE1MTYwOTA5MGZiYTY5OGIyZjViNyJdLCJ0ZW5hbnRJZCI6IjVhMzE1MTlkZTA1YmJhMDA4ZWY2MWYwYSIsImV4cCI6MTUxNjg2MDEzOSwidXNlcm5hbWUiOiJkZXZuZXR1c2VyIn0.pxq-y-SUXlxiHFnwdZgecK-U1z4hXy7YSBbL2lLpeik", 45 | "type": "text" 46 | }, 47 | { 48 | "enabled": true, 49 | "key": "pathId", 50 | "value": "1297e4b7-2d1f-4d06-8dc0-2812ea7011d1", 51 | "type": "text" 52 | }, 53 | { 54 | "enabled": true, 55 | "key": "imageId", 56 | "value": "dbd0f3d3-c24e-4e70-9391-0ab38b3cfc32", 57 | "type": "text" 58 | }, 59 | { 60 | "enabled": true, 61 | "key": "fileId", 62 | "value": "7b14b25e-516b-4bef-88de-c40ed53f95cc", 63 | "type": "text" 64 | }, 65 | { 66 | "enabled": true, 67 | "key": "taskId", 68 | "value": "5d641be3-8de9-41df-9ce6-154503e8e2aa", 69 | "type": "text" 70 | }, 71 | { 72 | "enabled": true, 73 | "key": "projectId", 74 | "value": "00c329c2-a674-41ee-815a-7b6985f9919c", 75 | "type": "text" 76 | }, 77 | { 78 | "enabled": true, 79 | "key": "additionalStatusURL", 80 | "value": "/api/v1/image/task?taskUuid=9bc1b107-7da8-4a26-8b39-fff1d56f8f8f", 81 | "type": "text" 82 | }, 83 | { 84 | "enabled": true, 85 | "key": "GLOBALtime", 86 | "value": "1516847400000", 87 | "type": "text" 88 | }, 89 | { 90 | "enabled": true, 91 | "key": "CLIENTtime", 92 | "value": "1516847400000", 93 | "type": "text" 94 | }, 95 | { 96 | "enabled": true, 97 | "key": "deviceId2", 98 | "value": "8be78ab1-d684-49c1-8529-2b08e9c5a6d4", 99 | "type": "text" 100 | }, 101 | { 102 | "enabled": true, 103 | "key": "deviceTaskUuid", 104 | "value": "54cc437f-0519-4db5-9231-52f519fec59f", 105 | "type": "text" 106 | } 107 | ], 108 | "timestamp": 1516856550574, 109 | "_postman_variable_scope": "environment", 110 | "_postman_exported_at": "2018-01-26T09:50:40.010Z", 111 | "_postman_exported_using": "Postman/5.5.0" 112 | } -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | CISCO SAMPLE CODE LICENSE 2 | 3 | Version 1.1 4 | Copyright (c) 2018 Cisco and/or its affiliates 5 | 6 | These terms govern this Cisco Systems, Inc. (“Cisco”), example or demo source code and its associated documentation (together, the “Sample Code”). By downloading, copying, modifying, compiling, or redistributing the Sample Code, you accept and agree to be bound by the following terms and conditions (the “License”). If you are accepting the License on behalf of an entity, you represent that you have the authority to do so (either you or the entity, “you”). Sample Code is not supported by Cisco TAC and is not tested for quality or performance. This is your only license to the Sample Code and all rights not expressly granted are reserved. 7 | 8 | 1. LICENSE GRANT: Subject to the terms and conditions of this License, Cisco hereby grants to you a perpetual, worldwide, non-exclusive, non-transferable, non-sublicensable, royalty-free license to copy and modify the Sample Code in source code form, and compile and redistribute the Sample Code in binary/object code or other executable forms, in whole or in part, solely for use with Cisco products and services. For interpreted languages like Java and Python, the executable form of the software may include source code and compilation is not required. 9 | 10 | 2. CONDITIONS: You shall not use the Sample Code independent of, or to replicate or compete with, a Cisco product or service. Cisco products and services are licensed under their own separate terms and you shall not use the Sample Code in any way that violates or is inconsistent with those terms (for more information, please visit: www.cisco.com/go/terms ). 11 | 12 | 3. OWNERSHIP: Cisco retains sole and exclusive ownership of the Sample Code, including all intellectual property rights therein, except with respect to any third-party material that may be used in or by the Sample Code. Any such third-party material is licensed under its own separate terms (such as an open source license) and all use must be in full accordance with the applicable license. This License does not grant you permission to use any trade names, trademarks, service marks, or product names of Cisco. If you provide any feedback to Cisco regarding the Sample Code, you agree that Cisco, its partners, and its customers shall be free to use and incorporate such feedback into the Sample Code, and Cisco products and services, for any purpose, and without restriction, payment, or additional consideration of any kind. If you initiate or participate in any litigation against Cisco, its partners, or its customers (including cross-claims and counter-claims) alleging that the Sample Code and/or its use infringe any patent, copyright, or other intellectual property right, then all rights granted to you under this License shall terminate immediately without notice. 13 | 14 | 4. LIMITATION OF LIABILITY: CISCO SHALL HAVE NO LIABILITY IN CONNECTION WITH OR RELATING TO THIS LICENSE OR USE OF THE SAMPLE CODE, FOR DAMAGES OF ANY KIND, INCLUDING BUT NOT LIMITED TO DIRECT, INCIDENTAL, AND CONSEQUENTIAL DAMAGES, OR FOR ANY LOSS OF USE, DATA, INFORMATION, PROFITS, BUSINESS, OR GOODWILL, HOWEVER CAUSED, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 15 | 16 | 5. DISCLAIMER OF WARRANTY: SAMPLE CODE IS INTENDED FOR EXAMPLE PURPOSES ONLY AND IS PROVIDED BY CISCO “AS IS” WITH ALL FAULTS AND WITHOUT WARRANTY OR SUPPORT OF ANY KIND. TO THE MAXIMUM EXTENT PERMITTED BY LAW, ALL EXPRESS AND IMPLIED CONDITIONS, REPRESENTATIONS, AND WARRANTIES INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTY OR CONDITION OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, SATISFACTORY QUALITY, NON-INTERFERENCE, AND ACCURACY, ARE HEREBY EXCLUDED AND EXPRESSLY DISCLAIMED BY CISCO. CISCO DOES NOT WARRANT THAT THE SAMPLE CODE IS SUITABLE FOR PRODUCTION OR COMMERCIAL USE, WILL OPERATE PROPERLY, IS ACCURATE OR COMPLETE, OR IS WITHOUT ERROR OR DEFECT. 17 | 18 | 6. GENERAL: This License shall be governed by and interpreted in accordance with the laws of the State of California, excluding its conflict of laws provisions. You agree to comply with all applicable United States export laws, rules, and regulations. If any provision of this License is judged illegal, invalid, or otherwise unenforceable, that provision shall be severed and the rest of the License shall remain in full force and effect. No failure by Cisco to enforce any of its rights related to the Sample Code or to a breach of this License in a particular situation will act as a waiver of such rights. In the event of any inconsistencies with any other terms, this License shall take precedence. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Introduction 2 | 3 | This is a collection and environment for Cisco Digital Network Architecture Center (DNA-C) 4 | 5 | There is a default environment pointing to an always on sandbox. 6 | 7 | By default the 'devnetuser' has read only access to the API. In order to access a restricted set of POST/DELETE 8 | API there is a proxy running on port 8080. 9 | 10 | To use these examples, you need the latest version of postman (3.2.0). 11 | It has free Jetpacks support. This is required for linking requests. 12 | 13 | # Importing 14 | You need to import the collection as well as the environment. You can import the raw git files using the **From URL** option, as seen below. 15 | You can also download them and import from file/folder. 16 | 17 | * https://raw.githubusercontent.com/CiscoDevNet/dnac-samples-aradford/master/tools/postman/DNAC-Sandbox.postman_environment.json 18 | * https://raw.githubusercontent.com/CiscoDevNet/dnac-samples-aradford/master/tools/postman/DNAC-SandboxProxy.postman_environment.json 19 | * https://raw.githubusercontent.com/CiscoDevNet/dnac-samples-aradford/master/tools/postman/01-DNAC-Sandbox.postman_collection.json 20 | 21 | ![alt tag](https://github.com/CiscoDevNet/DNAC-postman/blob/master/images/importing.png) 22 | 23 | # Getting Started 24 | After the import has completed, you will need to select the environment. You will notice there are two options. 25 | * DNAC-Sandbox.postman_environment - this is a base environment that just talks to DNAC on port 443. 26 | * DNAC-SandboxProxy.postman_environment - this talks to a proxy. The reason for doing this is that devnetuser is read-only 27 | so has no way to execute PUT/POST/DELETE 28 | 29 | Once you have done this, you need to first run the request to get a Ticket. This request is in the **1.Ticket folder**. 30 | The authentication token will then be used in subsequent requests. It is stored in an environment variable. 31 | ![alt tag](https://github.com/CiscoDevNet/DNAC-postman/blob/master/images/firstRequest.png) 32 | 33 | **NOTE: If this request fails you may need to accept the certificate from the controller in your browser** 34 | http://blog.getpostman.com/2014/01/28/using-self-signed-certificates-with-postman/ 35 | 36 | 37 | Inside each folder, the requests are sequential. GET/POST/DELETE etc. So you can run through them one by one. 38 | You can also check on the UI for the controller to see the effect of the requests. 39 | ![alt tag](https://github.com/CiscoDevNet/DNAC-postman/blob/master/images/network-device-get.png) 40 | 41 | 42 | # More Advanced API Calls 43 | 44 | Most of the calls on the controller are asynchronous (PUT/POST/DELETE). When you execute these calls, they will always 45 | succeed and return a taskId. Take a look at 3.Tags and Locations. Select and run the second request which is a POST, 46 | to create a new Tag called "InterestingDevice". 47 | ![alt tag](https://github.com/CiscoDevNet/DNAC-postman/blob/master/images/tag-POST.png) 48 | 49 | The response from the previous request is a task. This is an asynchronous request. You need to poll the task status 50 | to find out if the creation was really successful. 51 | 52 | The next request in the list shows how to do this. 53 | 54 | Notice there is a {{taskId}} in the URL being called. Anything inside the {{}} 55 | is a variable. In this case taskId. This was set behind the scenes in the previous API call. 56 | 57 | ![alt tag](https://github.com/CiscoDevNet/DNAC-postman/blob/master/images/task-response.png) 58 | 59 | The body of the response contains a "progress" key. This indicates the Universally Unique ID (UUID) of the new Tag. 60 | This UUID can be used to lookup the tag directly, assign the tag to a network device (the next API call) or delete the 61 | tag. 62 | 63 | "iserror" being false means the task was successful. The presence of "endTime" means the task has finished. 64 | ``` 65 | { 66 | "response": { 67 | "startTime": 1468020253637, 68 | "endTime": 1468020253742, 69 | "progress": "61ad238b-5ef8-4f19-b97e-092ce5e75ae4", 70 | "version": 1468020253637, 71 | "serviceType": "Inventory service", 72 | "isError": false, 73 | "rootId": "8d40a399-2821-41aa-bf57-d2613cda9f5d", 74 | "id": "8d40a399-2821-41aa-bf57-d2613cda9f5d" 75 | }, 76 | "version": "1.0" 77 | } 78 | ``` 79 | 80 | Lets take a look what happens if you try to create another tag with the same name. 81 | 82 | 83 | Go back to the "https://{{apic}}:{{port}}/api/v1/tag POST" request and Send. 84 | 85 | 86 | Then take a look at the task status "https://{{apic}}:{{port}}/api/v1/task - TAG" 87 | ![alt tag](https://github.com/CiscoDevNet/DNAC-postman/blob/master/images/task-fail.png) 88 | 89 | ``` 90 | { 91 | "response": { 92 | "startTime": 1468021088439, 93 | "endTime": 1468021088474, 94 | "progress": "Adding tag has failed.", 95 | "version": 1468021088439, 96 | "errorCode": "ResourceConflict", 97 | "serviceType": "Inventory service", 98 | "isError": true, 99 | "failureReason": "Tag InterestingDevice already exists.", 100 | "rootId": "8dde3059-2a38-4170-9fc7-09780be46fc0", 101 | "id": "8dde3059-2a38-4170-9fc7-09780be46fc0" 102 | }, 103 | "version": "1.0" 104 | } 105 | ``` 106 | 107 | This is because the tag already exists. You can fix this. You need to use the "https://{{apic}}:{{port}}/api/v1/tag FIND TAG 108 | " request. This has a side effect of setting the tagId to the UUID of the "InterestingDevice" tag. 109 | ![alt tag](https://github.com/CiscoDevNet/DNAC-postman/blob/master/images/find-tag.png) 110 | 111 | You can then scroll down to the "https://{{apic}}:{{port}}/api/v1/tag -DELETE" request, and press Send 112 | ![alt tag](https://github.com/CiscoDevNet/DNAC-postman/blob/master/images/delete-tag.png) 113 | 114 | Again, you will get a taskId. You can use any of the task GET requests. 115 | ![alt tag](https://github.com/CiscoDevNet/DNAC-postman/blob/master/images/delete-status.png) 116 | 117 | Please make sure you clean up by either deleting through the UI or the POSTMAN window. 118 | 119 | 120 | # Next Steps 121 | You can create your own environment, or modify the existing one to point to your own server. 122 | 123 | 124 | -------------------------------------------------------------------------------- /images/delete-status.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CiscoDevNet/DNAC-postman/5a739aaf2e638a6b2105b75cbc0d7d9559f3d95a/images/delete-status.png -------------------------------------------------------------------------------- /images/delete-tag.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CiscoDevNet/DNAC-postman/5a739aaf2e638a6b2105b75cbc0d7d9559f3d95a/images/delete-tag.png -------------------------------------------------------------------------------- /images/find-tag.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CiscoDevNet/DNAC-postman/5a739aaf2e638a6b2105b75cbc0d7d9559f3d95a/images/find-tag.png -------------------------------------------------------------------------------- /images/firstRequest.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CiscoDevNet/DNAC-postman/5a739aaf2e638a6b2105b75cbc0d7d9559f3d95a/images/firstRequest.png -------------------------------------------------------------------------------- /images/importing.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CiscoDevNet/DNAC-postman/5a739aaf2e638a6b2105b75cbc0d7d9559f3d95a/images/importing.png -------------------------------------------------------------------------------- /images/network-device-get.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CiscoDevNet/DNAC-postman/5a739aaf2e638a6b2105b75cbc0d7d9559f3d95a/images/network-device-get.png -------------------------------------------------------------------------------- /images/tag-POST.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CiscoDevNet/DNAC-postman/5a739aaf2e638a6b2105b75cbc0d7d9559f3d95a/images/tag-POST.png -------------------------------------------------------------------------------- /images/task-fail.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CiscoDevNet/DNAC-postman/5a739aaf2e638a6b2105b75cbc0d7d9559f3d95a/images/task-fail.png -------------------------------------------------------------------------------- /images/task-response.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CiscoDevNet/DNAC-postman/5a739aaf2e638a6b2105b75cbc0d7d9559f3d95a/images/task-response.png --------------------------------------------------------------------------------