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