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