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