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