github.com/technosophos/deis@v1.7.1-0.20150915173815-f9005256004b/docs/reference/api-v1.5.rst (about) 1 :title: Controller API v1.5 2 :description: The v1.5 REST API for Deis' Controller 3 4 Controller API v1.5 5 =================== 6 7 This is the v1.5 REST API for the :ref:`Controller`. 8 9 10 What's New 11 ---------- 12 13 **New!** ``/auth/tokens/`` endpoint for regenerating tokens. 14 15 Authentication 16 -------------- 17 18 19 Register a New User 20 ``````````````````` 21 22 Example Request: 23 24 .. code-block:: console 25 26 POST /v1/auth/register/ HTTP/1.1 27 Host: deis.example.com 28 Content-Type: application/json 29 30 { 31 "username": "test", 32 "password": "opensesame", 33 "email": "test@example.com" 34 } 35 36 Optional Parameters: 37 38 .. code-block:: console 39 40 { 41 "first_name": "test", 42 "last_name": "testerson" 43 } 44 45 Example Response: 46 47 .. code-block:: console 48 49 HTTP/1.1 201 CREATED 50 DEIS_API_VERSION: 1.5 51 DEIS_PLATFORM_VERSION: 1.9.1 52 Content-Type: application/json 53 54 { 55 "id": 1, 56 "last_login": "2014-10-19T22:01:00.601Z", 57 "is_superuser": true, 58 "username": "test", 59 "first_name": "test", 60 "last_name": "testerson", 61 "email": "test@example.com", 62 "is_staff": true, 63 "is_active": true, 64 "date_joined": "2014-10-19T22:01:00.601Z", 65 "groups": [], 66 "user_permissions": [] 67 } 68 69 70 Log in 71 `````` 72 73 Example Request: 74 75 .. code-block:: console 76 77 POST /v1/auth/login/ HTTP/1.1 78 Host: deis.example.com 79 Content-Type: application/json 80 81 {"username": "test", "password": "opensesame"} 82 83 Example Response: 84 85 .. code-block:: console 86 87 HTTP/1.1 200 OK 88 DEIS_API_VERSION: 1.5 89 DEIS_PLATFORM_VERSION: 1.9.1 90 Content-Type: application/json 91 92 {"token": "abc123"} 93 94 95 Cancel Account 96 `````````````` 97 98 Example Request: 99 100 .. code-block:: console 101 102 DELETE /v1/auth/cancel/ HTTP/1.1 103 Host: deis.example.com 104 Authorization: token abc123 105 106 Example Response: 107 108 .. code-block:: console 109 110 HTTP/1.1 204 NO CONTENT 111 DEIS_API_VERSION: 1.5 112 DEIS_PLATFORM_VERSION: 1.9.1 113 114 Regenerate Token 115 ```````````````` 116 117 .. note:: 118 119 This command could require administrative privileges 120 121 Example Request: 122 123 .. code-block:: console 124 125 POST /v1/auth/tokens/ HTTP/1.1 126 Host: deis.example.com 127 Authorization: token abc123 128 129 Optional Parameters: 130 131 .. code-block:: console 132 133 { 134 "username" : "test" 135 "all" : "true" 136 } 137 138 Example Response: 139 140 .. code-block:: console 141 142 HTTP/1.1 200 OK 143 DEIS_API_VERSION: 1.5 144 DEIS_PLATFORM_VERSION: 1.9.1 145 Content-Type: application/json 146 147 {"token": "abc123"} 148 149 Change Password 150 ``````````````` 151 152 Example Request: 153 154 .. code-block:: console 155 156 POST /v1/auth/passwd/ HTTP/1.1 157 Host: deis.example.com 158 Authorization: token abc123 159 160 { 161 "password": "foo", 162 "new_password": "bar" 163 } 164 165 Optional parameters: 166 167 .. code-block:: console 168 169 {"username": "testuser"} 170 171 .. note:: 172 173 Using the ``username`` parameter requires administrative privileges 174 175 Example Response: 176 177 .. code-block:: console 178 179 HTTP/1.1 200 OK 180 DEIS_API_VERSION: 1.5 181 DEIS_PLATFORM_VERSION: 1.9.1 182 183 184 Applications 185 ------------ 186 187 188 List all Applications 189 ````````````````````` 190 191 Example Request: 192 193 .. code-block:: console 194 195 GET /v1/apps HTTP/1.1 196 Host: deis.example.com 197 Authorization: token abc123 198 199 Example Response: 200 201 .. code-block:: console 202 203 HTTP/1.1 200 OK 204 DEIS_API_VERSION: 1.5 205 DEIS_PLATFORM_VERSION: 1.9.1 206 Content-Type: application/json 207 208 { 209 "count": 1, 210 "next": null, 211 "previous": null, 212 "results": [ 213 { 214 "created": "2014-01-01T00:00:00UTC", 215 "id": "example-go", 216 "owner": "test", 217 "structure": {}, 218 "updated": "2014-01-01T00:00:00UTC", 219 "url": "example-go.example.com", 220 "uuid": "de1bf5b5-4a72-4f94-a10c-d2a3741cdf75" 221 } 222 ] 223 } 224 225 226 Create an Application 227 ````````````````````` 228 229 Example Request: 230 231 .. code-block:: console 232 233 POST /v1/apps/ HTTP/1.1 234 Host: deis.example.com 235 Content-Type: application/json 236 Authorization: token abc123 237 238 Optional parameters: 239 240 .. code-block:: console 241 242 {"id": "example-go"} 243 244 245 Example Response: 246 247 .. code-block:: console 248 249 HTTP/1.1 201 CREATED 250 DEIS_API_VERSION: 1.5 251 DEIS_PLATFORM_VERSION: 1.9.1 252 Content-Type: application/json 253 254 { 255 "created": "2014-01-01T00:00:00UTC", 256 "id": "example-go", 257 "owner": "test", 258 "structure": {}, 259 "updated": "2014-01-01T00:00:00UTC", 260 "url": "example-go.example.com", 261 "uuid": "de1bf5b5-4a72-4f94-a10c-d2a3741cdf75" 262 } 263 264 265 Destroy an Application 266 `````````````````````` 267 268 Example Request: 269 270 .. code-block:: console 271 272 DELETE /v1/apps/example-go/ HTTP/1.1 273 Host: deis.example.com 274 Authorization: token abc123 275 276 Example Response: 277 278 .. code-block:: console 279 280 HTTP/1.1 204 NO CONTENT 281 DEIS_API_VERSION: 1.5 282 DEIS_PLATFORM_VERSION: 1.9.1 283 284 285 List Application Details 286 ```````````````````````` 287 288 Example Request: 289 290 .. code-block:: console 291 292 GET /v1/apps/example-go/ HTTP/1.1 293 Host: deis.example.com 294 Authorization: token abc123 295 296 Example Response: 297 298 .. code-block:: console 299 300 HTTP/1.1 200 OK 301 DEIS_API_VERSION: 1.5 302 DEIS_PLATFORM_VERSION: 1.9.1 303 Content-Type: application/json 304 305 { 306 "created": "2014-01-01T00:00:00UTC", 307 "id": "example-go", 308 "owner": "test", 309 "structure": {}, 310 "updated": "2014-01-01T00:00:00UTC", 311 "url": "example-go.example.com", 312 "uuid": "de1bf5b5-4a72-4f94-a10c-d2a3741cdf75" 313 } 314 315 316 Retrieve Application Logs 317 ````````````````````````` 318 319 Example Request: 320 321 .. code-block:: console 322 323 GET /v1/apps/example-go/logs/ HTTP/1.1 324 Host: deis.example.com 325 Authorization: token abc123 326 327 Optional URL Query Parameters: 328 329 .. code-block:: console 330 331 ?log_lines= 332 333 Example Response: 334 335 .. code-block:: console 336 337 HTTP/1.1 200 OK 338 DEIS_API_VERSION: 1.5 339 DEIS_PLATFORM_VERSION: 1.9.1 340 Content-Type: text/plain 341 342 "16:51:14 deis[api]: test created initial release\n" 343 344 345 Run one-off Commands 346 ```````````````````` 347 348 .. code-block:: console 349 350 POST /v1/apps/example-go/run/ HTTP/1.1 351 Host: deis.example.com 352 Content-Type: application/json 353 Authorization: token abc123 354 355 {"command": "echo hi"} 356 357 Example Response: 358 359 .. code-block:: console 360 361 HTTP/1.1 200 OK 362 DEIS_API_VERSION: 1.5 363 DEIS_PLATFORM_VERSION: 1.9.1 364 Content-Type: application/json 365 366 [0, "hi\n"] 367 368 369 Certificates 370 ------------ 371 372 373 List all Certificates 374 ````````````````````` 375 376 Example Request: 377 378 .. code-block:: console 379 380 GET /v1/certs HTTP/1.1 381 Host: deis.example.com 382 Authorization: token abc123 383 384 Example Response: 385 386 .. code-block:: console 387 388 HTTP/1.1 200 OK 389 DEIS_API_VERSION: 1.5 390 DEIS_PLATFORM_VERSION: 1.9.1 391 Content-Type: application/json 392 393 { 394 "count": 1, 395 "next": null, 396 "previous": null, 397 "results": [ 398 { 399 "common_name": "test.example.com", 400 "expires": "2014-01-01T00:00:00UTC" 401 } 402 ] 403 } 404 405 406 List Certificate Details 407 ```````````````````````` 408 409 Example Request: 410 411 .. code-block:: console 412 413 GET /v1/certs/test.example.com HTTP/1.1 414 Host: deis.example.com 415 Authorization: token abc123 416 417 Example Response: 418 419 .. code-block:: console 420 421 HTTP/1.1 200 OK 422 DEIS_API_VERSION: 1.5 423 DEIS_PLATFORM_VERSION: 1.9.1 424 Content-Type: application/json 425 426 { 427 "updated": "2014-01-01T00:00:00UTC", 428 "created": "2014-01-01T00:00:00UTC", 429 "expires": "2015-01-01T00:00:00UTC", 430 "common_name": "test.example.com", 431 "owner": "test", 432 "id": 1 433 } 434 435 436 Create Certificate 437 `````````````````` 438 439 Example Request: 440 441 .. code-block:: console 442 443 POST /v1/certs/ HTTP/1.1 444 Host: deis.example.com 445 Content-Type: application/json 446 Authorization: token abc123 447 448 { 449 "certificate": "-----BEGIN CERTIFICATE-----", 450 "key": "-----BEGIN RSA PRIVATE KEY-----" 451 } 452 453 Optional Parameters: 454 455 .. code-block:: console 456 457 { 458 "common_name": "test.example.com" 459 } 460 461 462 Example Response: 463 464 .. code-block:: console 465 466 HTTP/1.1 201 CREATED 467 DEIS_API_VERSION: 1.5 468 DEIS_PLATFORM_VERSION: 1.9.1 469 Content-Type: application/json 470 471 { 472 "updated": "2014-01-01T00:00:00UTC", 473 "created": "2014-01-01T00:00:00UTC", 474 "expires": "2015-01-01T00:00:00UTC", 475 "common_name": "test.example.com", 476 "owner": "test", 477 "id": 1 478 } 479 480 481 Destroy a Certificate 482 ````````````````````` 483 484 Example Request: 485 486 .. code-block:: console 487 488 DELETE /v1/certs/test.example.com HTTP/1.1 489 Host: deis.example.com 490 Authorization: token abc123 491 492 Example Response: 493 494 .. code-block:: console 495 496 HTTP/1.1 204 NO CONTENT 497 DEIS_API_VERSION: 1.5 498 DEIS_PLATFORM_VERSION: 1.9.1 499 500 501 Containers 502 ---------- 503 504 505 List all Containers 506 ``````````````````` 507 508 Example Request: 509 510 .. code-block:: console 511 512 GET /v1/apps/example-go/containers/ HTTP/1.1 513 Host: deis.example.com 514 Authorization: token abc123 515 516 Example Response: 517 518 .. code-block:: console 519 520 HTTP/1.1 200 OK 521 DEIS_API_VERSION: 1.5 522 DEIS_PLATFORM_VERSION: 1.9.1 523 Content-Type: application/json 524 525 { 526 "count": 1, 527 "next": null, 528 "previous": null, 529 "results": [ 530 { 531 "owner": "test", 532 "app": "example-go", 533 "release": "v2", 534 "created": "2014-01-01T00:00:00UTC", 535 "updated": "2014-01-01T00:00:00UTC", 536 "uuid": "de1bf5b5-4a72-4f94-a10c-d2a3741cdf75", 537 "type": "web", 538 "num": 1, 539 "state": "up" 540 } 541 ] 542 } 543 544 545 List all Containers by Type 546 ``````````````````````````` 547 548 Example Request: 549 550 .. code-block:: console 551 552 GET /v1/apps/example-go/containers/web/ HTTP/1.1 553 Host: deis.example.com 554 Authorization: token abc123 555 556 Example Response: 557 558 .. code-block:: console 559 560 HTTP/1.1 200 OK 561 DEIS_API_VERSION: 1.5 562 DEIS_PLATFORM_VERSION: 1.9.1 563 Content-Type: application/json 564 565 { 566 "count": 1, 567 "next": null, 568 "previous": null, 569 "results": [ 570 { 571 "owner": "test", 572 "app": "example-go", 573 "release": "v2", 574 "created": "2014-01-01T00:00:00UTC", 575 "updated": "2014-01-01T00:00:00UTC", 576 "uuid": "de1bf5b5-4a72-4f94-a10c-d2a3741cdf75", 577 "type": "web", 578 "num": 1, 579 "state": "up" 580 } 581 ] 582 } 583 584 585 Restart All Containers 586 `````````````````````` 587 588 Example Request: 589 590 .. code-block:: console 591 592 POST /v1/apps/example-go/containers/restart/ HTTP/1.1 593 Host: deis.example.com 594 Authorization: token abc123 595 596 Example Response: 597 598 .. code-block:: console 599 600 HTTP/1.1 200 OK 601 DEIS_API_VERSION: 1.5 602 DEIS_PLATFORM_VERSION: 1.9.1 603 Content-Type: application/json 604 605 [ 606 { 607 "owner": "test", 608 "app": "example-go", 609 "release": "v2", 610 "created": "2014-01-01T00:00:00UTC", 611 "updated": "2014-01-01T00:00:00UTC", 612 "uuid": "de1bf5b5-4a72-4f94-a10c-d2a3741cdf75", 613 "type": "web", 614 "num": 1, 615 "state": "up" 616 } 617 ] 618 619 620 Restart Containers by Type 621 `````````````````````````` 622 623 Example Request: 624 625 .. code-block:: console 626 627 POST /v1/apps/example-go/containers/web/restart/ HTTP/1.1 628 Host: deis.example.com 629 Authorization: token abc123 630 631 Example Response: 632 633 .. code-block:: console 634 635 HTTP/1.1 200 OK 636 DEIS_API_VERSION: 1.5 637 DEIS_PLATFORM_VERSION: 1.9.1 638 Content-Type: application/json 639 640 [ 641 { 642 "owner": "test", 643 "app": "example-go", 644 "release": "v2", 645 "created": "2014-01-01T00:00:00UTC", 646 "updated": "2014-01-01T00:00:00UTC", 647 "uuid": "de1bf5b5-4a72-4f94-a10c-d2a3741cdf75", 648 "type": "web", 649 "num": 1, 650 "state": "up" 651 } 652 ] 653 654 655 Restart Containers by Type and Number 656 ````````````````````````````````````` 657 658 Example Request: 659 660 .. code-block:: console 661 662 POST /v1/apps/example-go/containers/web/1/restart/ HTTP/1.1 663 Host: deis.example.com 664 Authorization: token abc123 665 666 Example Response: 667 668 .. code-block:: console 669 670 HTTP/1.1 200 OK 671 DEIS_API_VERSION: 1.5 672 DEIS_PLATFORM_VERSION: 1.9.1 673 Content-Type: application/json 674 675 [ 676 { 677 "owner": "test", 678 "app": "example-go", 679 "release": "v2", 680 "created": "2014-01-01T00:00:00UTC", 681 "updated": "2014-01-01T00:00:00UTC", 682 "uuid": "de1bf5b5-4a72-4f94-a10c-d2a3741cdf75", 683 "type": "web", 684 "num": 1, 685 "state": "up" 686 } 687 ] 688 689 690 Scale Containers 691 ```````````````` 692 693 Example Request: 694 695 .. code-block:: console 696 697 POST /v1/apps/example-go/scale/ HTTP/1.1 698 Host: deis.example.com 699 Content-Type: application/json 700 Authorization: token abc123 701 702 {"web": 3} 703 704 Example Response: 705 706 .. code-block:: console 707 708 HTTP/1.1 204 NO CONTENT 709 DEIS_API_VERSION: 1.5 710 DEIS_PLATFORM_VERSION: 1.9.1 711 712 713 Configuration 714 ------------- 715 716 717 List Application Configuration 718 `````````````````````````````` 719 720 Example Request: 721 722 .. code-block:: console 723 724 GET /v1/apps/example-go/config/ HTTP/1.1 725 Host: deis.example.com 726 Authorization: token abc123 727 728 Example Response: 729 730 .. code-block:: console 731 732 HTTP/1.1 200 OK 733 DEIS_API_VERSION: 1.5 734 DEIS_PLATFORM_VERSION: 1.9.1 735 Content-Type: application/json 736 737 { 738 "owner": "test", 739 "app": "example-go", 740 "values": { 741 "PLATFORM": "deis" 742 }, 743 "memory": {}, 744 "cpu": {}, 745 "tags": {}, 746 "created": "2014-01-01T00:00:00UTC", 747 "updated": "2014-01-01T00:00:00UTC", 748 "uuid": "de1bf5b5-4a72-4f94-a10c-d2a3741cdf75" 749 } 750 751 752 Create new Config 753 ````````````````` 754 755 Example Request: 756 757 .. code-block:: console 758 759 POST /v1/apps/example-go/config/ HTTP/1.1 760 Host: deis.example.com 761 Content-Type: application/json 762 Authorization: token abc123 763 764 {"values": {"HELLO": "world", "PLATFORM": "deis"}} 765 766 Example Response: 767 768 .. code-block:: console 769 770 HTTP/1.1 201 CREATED 771 DEIS_API_VERSION: 1.5 772 DEIS_PLATFORM_VERSION: 1.9.1 773 Content-Type: application/json 774 X-Deis-Release: 3 775 776 { 777 "owner": "test", 778 "app": "example-go", 779 "values": { 780 "DEIS_APP": "example-go", 781 "DEIS_RELEASE": "v3", 782 "HELLO": "world", 783 "PLATFORM": "deis" 784 785 }, 786 "memory": {}, 787 "cpu": {}, 788 "tags": {}, 789 "created": "2014-01-01T00:00:00UTC", 790 "updated": "2014-01-01T00:00:00UTC", 791 "uuid": "de1bf5b5-4a72-4f94-a10c-d2a3741cdf75" 792 } 793 794 795 Unset Config Variable 796 ````````````````````` 797 798 Example Request: 799 800 .. code-block:: console 801 802 POST /v1/apps/example-go/config/ HTTP/1.1 803 Host: deis.example.com 804 Content-Type: application/json 805 Authorization: token abc123 806 807 {"values": {"HELLO": null}} 808 809 Example Response: 810 811 .. code-block:: console 812 813 HTTP/1.1 201 CREATED 814 DEIS_API_VERSION: 1.5 815 DEIS_PLATFORM_VERSION: 1.9.1 816 Content-Type: application/json 817 X-Deis-Release: 4 818 819 { 820 "owner": "test", 821 "app": "example-go", 822 "values": { 823 "DEIS_APP": "example-go", 824 "DEIS_RELEASE": "v4", 825 "PLATFORM": "deis" 826 }, 827 "memory": {}, 828 "cpu": {}, 829 "tags": {}, 830 "created": "2014-01-01T00:00:00UTC", 831 "updated": "2014-01-01T00:00:00UTC", 832 "uuid": "de1bf5b5-4a72-4f94-a10c-d2a3741cdf75" 833 } 834 835 836 Domains 837 ------- 838 839 840 List Application Domains 841 ```````````````````````` 842 843 Example Request: 844 845 .. code-block:: console 846 847 GET /v1/apps/example-go/domains/ HTTP/1.1 848 Host: deis.example.com 849 Authorization: token abc123 850 851 Example Response: 852 853 .. code-block:: console 854 855 HTTP/1.1 200 OK 856 DEIS_API_VERSION: 1.5 857 DEIS_PLATFORM_VERSION: 1.9.1 858 Content-Type: application/json 859 860 { 861 "count": 1, 862 "next": null, 863 "previous": null, 864 "results": [ 865 { 866 "app": "example-go", 867 "created": "2014-01-01T00:00:00UTC", 868 "domain": "example.example.com", 869 "owner": "test", 870 "updated": "2014-01-01T00:00:00UTC" 871 } 872 ] 873 } 874 875 876 Add Domain 877 `````````` 878 879 Example Request: 880 881 .. code-block:: console 882 883 POST /v1/apps/example-go/domains/ HTTP/1.1 884 Host: deis.example.com 885 Authorization: token abc123 886 887 {'domain': 'example.example.com'} 888 889 Example Response: 890 891 .. code-block:: console 892 893 HTTP/1.1 201 CREATED 894 DEIS_API_VERSION: 1.5 895 DEIS_PLATFORM_VERSION: 1.9.1 896 Content-Type: application/json 897 898 { 899 "app": "example-go", 900 "created": "2014-01-01T00:00:00UTC", 901 "domain": "example.example.com", 902 "owner": "test", 903 "updated": "2014-01-01T00:00:00UTC" 904 } 905 906 907 908 Remove Domain 909 ````````````` 910 911 Example Request: 912 913 .. code-block:: console 914 915 DELETE /v1/apps/example-go/domains/example.example.com HTTP/1.1 916 Host: deis.example.com 917 Authorization: token abc123 918 919 Example Response: 920 921 .. code-block:: console 922 923 HTTP/1.1 204 NO CONTENT 924 DEIS_API_VERSION: 1.5 925 DEIS_PLATFORM_VERSION: 1.9.1 926 927 928 Builds 929 ------ 930 931 932 List Application Builds 933 ``````````````````````` 934 935 Example Request: 936 937 .. code-block:: console 938 939 GET /v1/apps/example-go/builds/ HTTP/1.1 940 Host: deis.example.com 941 Authorization: token abc123 942 943 Example Response: 944 945 .. code-block:: console 946 947 HTTP/1.1 200 OK 948 DEIS_API_VERSION: 1.5 949 DEIS_PLATFORM_VERSION: 1.9.1 950 Content-Type: application/json 951 952 { 953 "count": 1, 954 "next": null, 955 "previous": null, 956 "results": [ 957 { 958 "app": "example-go", 959 "created": "2014-01-01T00:00:00UTC", 960 "dockerfile": "FROM deis/slugrunner RUN mkdir -p /app WORKDIR /app ENTRYPOINT [\"/runner/init\"] ADD slug.tgz /app ENV GIT_SHA 060da68f654e75fac06dbedd1995d5f8ad9084db", 961 "image": "example-go", 962 "owner": "test", 963 "procfile": { 964 "web": "example-go" 965 }, 966 "sha": "060da68f", 967 "updated": "2014-01-01T00:00:00UTC", 968 "uuid": "de1bf5b5-4a72-4f94-a10c-d2a3741cdf75" 969 } 970 ] 971 } 972 973 974 Create Application Build 975 ```````````````````````` 976 977 Example Request: 978 979 .. code-block:: console 980 981 POST /v1/apps/example-go/builds/ HTTP/1.1 982 Host: deis.example.com 983 Content-Type: application/json 984 Authorization: token abc123 985 986 {"image": "deis/example-go:latest"} 987 988 Optional Parameters: 989 990 .. code-block:: console 991 992 { 993 "procfile": { 994 "web": "./cmd" 995 } 996 } 997 998 Example Response: 999 1000 .. code-block:: console 1001 1002 HTTP/1.1 201 CREATED 1003 DEIS_API_VERSION: 1.5 1004 DEIS_PLATFORM_VERSION: 1.9.1 1005 Content-Type: application/json 1006 X-Deis-Release: 4 1007 1008 { 1009 "app": "example-go", 1010 "created": "2014-01-01T00:00:00UTC", 1011 "dockerfile": "", 1012 "image": "deis/example-go:latest", 1013 "owner": "test", 1014 "procfile": {}, 1015 "sha": "", 1016 "updated": "2014-01-01T00:00:00UTC", 1017 "uuid": "de1bf5b5-4a72-4f94-a10c-d2a3741cdf75" 1018 } 1019 1020 1021 Releases 1022 -------- 1023 1024 1025 List Application Releases 1026 ````````````````````````` 1027 1028 Example Request: 1029 1030 .. code-block:: console 1031 1032 GET /v1/apps/example-go/releases/ HTTP/1.1 1033 Host: deis.example.com 1034 Authorization: token abc123 1035 1036 Example Response: 1037 1038 .. code-block:: console 1039 1040 HTTP/1.1 200 OK 1041 DEIS_API_VERSION: 1.5 1042 DEIS_PLATFORM_VERSION: 1.9.1 1043 Content-Type: application/json 1044 1045 { 1046 "count": 3, 1047 "next": null, 1048 "previous": null, 1049 "results": [ 1050 { 1051 "app": "example-go", 1052 "build": "202d8e4b-600e-4425-a85c-ffc7ea607f61", 1053 "config": "ed637ceb-5d32-44bd-9406-d326a777a513", 1054 "created": "2014-01-01T00:00:00UTC", 1055 "owner": "test", 1056 "summary": "test changed nothing", 1057 "updated": "2014-01-01T00:00:00UTC", 1058 "uuid": "de1bf5b5-4a72-4f94-a10c-d2a3741cdf75", 1059 "version": 3 1060 }, 1061 { 1062 "app": "example-go", 1063 "build": "202d8e4b-600e-4425-a85c-ffc7ea607f61", 1064 "config": "95bd6dea-1685-4f78-a03d-fd7270b058d1", 1065 "created": "2014-01-01T00:00:00UTC", 1066 "owner": "test", 1067 "summary": "test deployed 060da68", 1068 "updated": "2014-01-01T00:00:00UTC", 1069 "uuid": "de1bf5b5-4a72-4f94-a10c-d2a3741cdf75", 1070 "version": 2 1071 }, 1072 { 1073 "app": "example-go", 1074 "build": null, 1075 "config": "95bd6dea-1685-4f78-a03d-fd7270b058d1", 1076 "created": "2014-01-01T00:00:00UTC", 1077 "owner": "test", 1078 "summary": "test created initial release", 1079 "updated": "2014-01-01T00:00:00UTC", 1080 "uuid": "de1bf5b5-4a72-4f94-a10c-d2a3741cdf75", 1081 "version": 1 1082 } 1083 ] 1084 } 1085 1086 1087 List Release Details 1088 ```````````````````` 1089 1090 Example Request: 1091 1092 .. code-block:: console 1093 1094 GET /v1/apps/example-go/releases/v1/ HTTP/1.1 1095 Host: deis.example.com 1096 Authorization: token abc123 1097 1098 Example Response: 1099 1100 .. code-block:: console 1101 1102 HTTP/1.1 200 OK 1103 DEIS_API_VERSION: 1.5 1104 DEIS_PLATFORM_VERSION: 1.9.1 1105 Content-Type: application/json 1106 1107 { 1108 "app": "example-go", 1109 "build": null, 1110 "config": "95bd6dea-1685-4f78-a03d-fd7270b058d1", 1111 "created": "2014-01-01T00:00:00UTC", 1112 "owner": "test", 1113 "summary": "test created initial release", 1114 "updated": "2014-01-01T00:00:00UTC", 1115 "uuid": "de1bf5b5-4a72-4f94-a10c-d2a3741cdf75", 1116 "version": 1 1117 } 1118 1119 1120 Rollback Release 1121 ```````````````` 1122 1123 Example Request: 1124 1125 .. code-block:: console 1126 1127 POST /v1/apps/example-go/releases/rollback/ HTTP/1.1 1128 Host: deis.example.com 1129 Content-Type: application/json 1130 Authorization: token abc123 1131 1132 {"version": 1} 1133 1134 Example Response: 1135 1136 .. code-block:: console 1137 1138 HTTP/1.1 201 CREATED 1139 DEIS_API_VERSION: 1.5 1140 DEIS_PLATFORM_VERSION: 1.9.1 1141 Content-Type: application/json 1142 1143 {"version": 5} 1144 1145 1146 Keys 1147 ---- 1148 1149 1150 List Keys 1151 ````````` 1152 1153 Example Request: 1154 1155 .. code-block:: console 1156 1157 GET /v1/keys/ HTTP/1.1 1158 Host: deis.example.com 1159 Authorization: token abc123 1160 1161 Example Response: 1162 1163 .. code-block:: console 1164 1165 HTTP/1.1 201 CREATED 1166 DEIS_API_VERSION: 1.5 1167 DEIS_PLATFORM_VERSION: 1.9.1 1168 Content-Type: application/json 1169 1170 { 1171 "count": 1, 1172 "next": null, 1173 "previous": null, 1174 "results": [ 1175 { 1176 "created": "2014-01-01T00:00:00UTC", 1177 "id": "test@example.com", 1178 "owner": "test", 1179 "public": "ssh-rsa <...>", 1180 "updated": "2014-01-01T00:00:00UTC", 1181 "uuid": "de1bf5b5-4a72-4f94-a10c-d2a3741cdf75" 1182 } 1183 ] 1184 } 1185 1186 1187 Add Key to User 1188 ``````````````` 1189 1190 Example Request: 1191 1192 .. code-block:: console 1193 1194 POST /v1/keys/ HTTP/1.1 1195 Host: deis.example.com 1196 Authorization: token abc123 1197 1198 { 1199 "id": "example", 1200 "public": "ssh-rsa <...>" 1201 } 1202 1203 Example Response: 1204 1205 .. code-block:: console 1206 1207 HTTP/1.1 201 CREATED 1208 DEIS_API_VERSION: 1.5 1209 DEIS_PLATFORM_VERSION: 1.9.1 1210 Content-Type: application/json 1211 1212 { 1213 "created": "2014-01-01T00:00:00UTC", 1214 "id": "example", 1215 "owner": "example", 1216 "public": "ssh-rsa <...>", 1217 "updated": "2014-01-01T00:00:00UTC", 1218 "uuid": "de1bf5b5-4a72-4f94-a10c-d2a3741cdf75" 1219 } 1220 1221 1222 Remove Key from User 1223 ```````````````````` 1224 1225 Example Request: 1226 1227 .. code-block:: console 1228 1229 DELETE /v1/keys/example HTTP/1.1 1230 Host: deis.example.com 1231 Authorization: token abc123 1232 1233 Example Response: 1234 1235 .. code-block:: console 1236 1237 HTTP/1.1 204 NO CONTENT 1238 DEIS_API_VERSION: 1.5 1239 DEIS_PLATFORM_VERSION: 1.9.1 1240 1241 1242 Permissions 1243 ----------- 1244 1245 1246 List Application Permissions 1247 ```````````````````````````` 1248 1249 .. note:: 1250 1251 This does not include the app owner. 1252 1253 Example Request: 1254 1255 .. code-block:: console 1256 1257 GET /v1/apps/example-go/perms/ HTTP/1.1 1258 Host: deis.example.com 1259 Authorization: token abc123 1260 1261 Example Response: 1262 1263 .. code-block:: console 1264 1265 HTTP/1.1 200 OK 1266 DEIS_API_VERSION: 1.5 1267 DEIS_PLATFORM_VERSION: 1.9.1 1268 Content-Type: application/json 1269 1270 { 1271 "users": [ 1272 "test", 1273 "foo" 1274 ] 1275 } 1276 1277 1278 Create Application Permission 1279 ````````````````````````````` 1280 1281 Example Request: 1282 1283 .. code-block:: console 1284 1285 POST /v1/apps/example-go/perms/ HTTP/1.1 1286 Host: deis.example.com 1287 Authorization: token abc123 1288 1289 {"username": "example"} 1290 1291 Example Response: 1292 1293 .. code-block:: console 1294 1295 HTTP/1.1 201 CREATED 1296 DEIS_API_VERSION: 1.5 1297 DEIS_PLATFORM_VERSION: 1.9.1 1298 1299 1300 Remove Application Permission 1301 ````````````````````````````` 1302 1303 Example Request: 1304 1305 .. code-block:: console 1306 1307 DELETE /v1/apps/example-go/perms/example HTTP/1.1 1308 Host: deis.example.com 1309 Authorization: token abc123 1310 1311 Example Response: 1312 1313 .. code-block:: console 1314 1315 HTTP/1.1 204 NO CONTENT 1316 DEIS_API_VERSION: 1.5 1317 DEIS_PLATFORM_VERSION: 1.9.1 1318 1319 List Administrators 1320 ``````````````````` 1321 1322 Example Request: 1323 1324 .. code-block:: console 1325 1326 GET /v1/admin/perms/ HTTP/1.1 1327 Host: deis.example.com 1328 Authorization: token abc123 1329 1330 Example Response: 1331 1332 .. code-block:: console 1333 1334 HTTP/1.1 200 OK 1335 DEIS_API_VERSION: 1.5 1336 DEIS_PLATFORM_VERSION: 1.9.1 1337 Content-Type: application/json 1338 1339 { 1340 "count": 2, 1341 "next": null 1342 "previous": null, 1343 "results": [ 1344 { 1345 "username": "test", 1346 "is_superuser": true 1347 }, 1348 { 1349 "username": "foo", 1350 "is_superuser": true 1351 } 1352 ] 1353 } 1354 1355 1356 Grant User Administrative Privileges 1357 ```````````````````````````````````` 1358 1359 .. note:: 1360 1361 This command requires administrative privileges 1362 1363 Example Request: 1364 1365 .. code-block:: console 1366 1367 POST /v1/admin/perms HTTP/1.1 1368 Host: deis.example.com 1369 Authorization: token abc123 1370 1371 {"username": "example"} 1372 1373 Example Response: 1374 1375 .. code-block:: console 1376 1377 HTTP/1.1 201 CREATED 1378 DEIS_API_VERSION: 1.5 1379 DEIS_PLATFORM_VERSION: 1.9.1 1380 1381 Remove User's Administrative Privileges 1382 ``````````````````````````````````````` 1383 1384 .. note:: 1385 1386 This command requires administrative privileges 1387 1388 Example Request: 1389 1390 .. code-block:: console 1391 1392 DELETE /v1/admin/perms/example HTTP/1.1 1393 Host: deis.example.com 1394 Authorization: token abc123 1395 1396 Example Response: 1397 1398 .. code-block:: console 1399 1400 HTTP/1.1 204 NO CONTENT 1401 DEIS_API_VERSION: 1.5 1402 DEIS_PLATFORM_VERSION: 1.9.1 1403 1404 Users 1405 ----- 1406 1407 List all users 1408 `````````````` 1409 1410 .. note:: 1411 1412 This command requires administrative privileges 1413 1414 Example Request: 1415 1416 .. code-block:: console 1417 1418 GET /v1/users HTTP/1.1 1419 Host: deis.example.com 1420 Authorization: token abc123 1421 1422 Example Response: 1423 1424 .. code-block:: console 1425 1426 HTTP/1.1 200 OK 1427 DEIS_API_VERSION: 1.5 1428 DEIS_PLATFORM_VERSION: 1.9.1 1429 Content-Type: application/json 1430 1431 { 1432 "count": 1, 1433 "next": null, 1434 "previous": null, 1435 "results": [ 1436 { 1437 "id": 1, 1438 "last_login": "2014-10-19T22:01:00.601Z", 1439 "is_superuser": true, 1440 "username": "test", 1441 "first_name": "test", 1442 "last_name": "testerson", 1443 "email": "test@example.com", 1444 "is_staff": true, 1445 "is_active": true, 1446 "date_joined": "2014-10-19T22:01:00.601Z", 1447 "groups": [], 1448 "user_permissions": [] 1449 } 1450 ] 1451 }