github.com/greenboxal/deis@v1.12.1/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.12.1
    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.12.1
    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.12.1
   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.12.1
   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.12.1
   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.12.1
   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.12.1
   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.12.1
   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.12.1
   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.12.1
   371      Content-Type: text/plain
   372  
   373      "16:51:14 deis[api]: test created initial release\n"
   374  
   375  
   376  Run one-off Commands
   377  ````````````````````
   378  
   379  .. code-block:: console
   380  
   381      POST /v1/apps/example-go/run/ HTTP/1.1
   382      Host: deis.example.com
   383      Content-Type: application/json
   384      Authorization: token abc123
   385  
   386      {"command": "echo hi"}
   387  
   388  Example Response:
   389  
   390  .. code-block:: console
   391  
   392      HTTP/1.1 200 OK
   393      DEIS_API_VERSION: 1.7
   394      DEIS_PLATFORM_VERSION: 1.12.1
   395      Content-Type: application/json
   396  
   397      [0, "hi\n"]
   398  
   399  
   400  Certificates
   401  ------------
   402  
   403  
   404  List all Certificates
   405  `````````````````````
   406  
   407  Example Request:
   408  
   409  .. code-block:: console
   410  
   411      GET /v1/certs HTTP/1.1
   412      Host: deis.example.com
   413      Authorization: token abc123
   414  
   415  Example Response:
   416  
   417  .. code-block:: console
   418  
   419      HTTP/1.1 200 OK
   420      DEIS_API_VERSION: 1.7
   421      DEIS_PLATFORM_VERSION: 1.12.1
   422      Content-Type: application/json
   423  
   424      {
   425          "count": 1,
   426          "next": null,
   427          "previous": null,
   428          "results": [
   429              {
   430                  "common_name": "test.example.com",
   431                  "expires": "2014-01-01T00:00:00UTC"
   432              }
   433          ]
   434      }
   435  
   436  
   437  List Certificate Details
   438  ````````````````````````
   439  
   440  Example Request:
   441  
   442  .. code-block:: console
   443  
   444      GET /v1/certs/test.example.com HTTP/1.1
   445      Host: deis.example.com
   446      Authorization: token abc123
   447  
   448  Example Response:
   449  
   450  .. code-block:: console
   451  
   452      HTTP/1.1 200 OK
   453      DEIS_API_VERSION: 1.7
   454      DEIS_PLATFORM_VERSION: 1.12.1
   455      Content-Type: application/json
   456  
   457      {
   458          "updated": "2014-01-01T00:00:00UTC",
   459          "created": "2014-01-01T00:00:00UTC",
   460          "expires": "2015-01-01T00:00:00UTC",
   461          "common_name": "test.example.com",
   462          "owner": "test",
   463          "id": 1
   464      }
   465  
   466  
   467  Create Certificate
   468  ``````````````````
   469  
   470  Example Request:
   471  
   472  .. code-block:: console
   473  
   474      POST /v1/certs/ HTTP/1.1
   475      Host: deis.example.com
   476      Content-Type: application/json
   477      Authorization: token abc123
   478  
   479      {
   480          "certificate": "-----BEGIN CERTIFICATE-----",
   481          "key": "-----BEGIN RSA PRIVATE KEY-----"
   482      }
   483  
   484  Optional Parameters:
   485  
   486  .. code-block:: console
   487  
   488      {
   489          "common_name": "test.example.com"
   490      }
   491  
   492  
   493  Example Response:
   494  
   495  .. code-block:: console
   496  
   497      HTTP/1.1 201 CREATED
   498      DEIS_API_VERSION: 1.7
   499      DEIS_PLATFORM_VERSION: 1.12.1
   500      Content-Type: application/json
   501  
   502      {
   503          "updated": "2014-01-01T00:00:00UTC",
   504          "created": "2014-01-01T00:00:00UTC",
   505          "expires": "2015-01-01T00:00:00UTC",
   506          "common_name": "test.example.com",
   507          "owner": "test",
   508          "id": 1
   509      }
   510  
   511  
   512  Destroy a Certificate
   513  `````````````````````
   514  
   515  Example Request:
   516  
   517  .. code-block:: console
   518  
   519      DELETE /v1/certs/test.example.com 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 204 NO CONTENT
   528      DEIS_API_VERSION: 1.7
   529      DEIS_PLATFORM_VERSION: 1.12.1
   530  
   531  
   532  Containers
   533  ----------
   534  
   535  
   536  List all Containers
   537  ```````````````````
   538  
   539  Example Request:
   540  
   541  .. code-block:: console
   542  
   543      GET /v1/apps/example-go/containers/ HTTP/1.1
   544      Host: deis.example.com
   545      Authorization: token abc123
   546  
   547  Example Response:
   548  
   549  .. code-block:: console
   550  
   551      HTTP/1.1 200 OK
   552      DEIS_API_VERSION: 1.7
   553      DEIS_PLATFORM_VERSION: 1.12.1
   554      Content-Type: application/json
   555  
   556      {
   557          "count": 1,
   558          "next": null,
   559          "previous": null,
   560          "results": [
   561              {
   562                  "owner": "test",
   563                  "app": "example-go",
   564                  "release": "v2",
   565                  "created": "2014-01-01T00:00:00UTC",
   566                  "updated": "2014-01-01T00:00:00UTC",
   567                  "uuid": "de1bf5b5-4a72-4f94-a10c-d2a3741cdf75",
   568                  "type": "web",
   569                  "num": 1,
   570                  "state": "up"
   571              }
   572          ]
   573      }
   574  
   575  
   576  List all Containers by Type
   577  ```````````````````````````
   578  
   579  Example Request:
   580  
   581  .. code-block:: console
   582  
   583      GET /v1/apps/example-go/containers/web/ HTTP/1.1
   584      Host: deis.example.com
   585      Authorization: token abc123
   586  
   587  Example Response:
   588  
   589  .. code-block:: console
   590  
   591      HTTP/1.1 200 OK
   592      DEIS_API_VERSION: 1.7
   593      DEIS_PLATFORM_VERSION: 1.12.1
   594      Content-Type: application/json
   595  
   596      {
   597          "count": 1,
   598          "next": null,
   599          "previous": null,
   600          "results": [
   601              {
   602                  "owner": "test",
   603                  "app": "example-go",
   604                  "release": "v2",
   605                  "created": "2014-01-01T00:00:00UTC",
   606                  "updated": "2014-01-01T00:00:00UTC",
   607                  "uuid": "de1bf5b5-4a72-4f94-a10c-d2a3741cdf75",
   608                  "type": "web",
   609                  "num": 1,
   610                  "state": "up"
   611              }
   612          ]
   613      }
   614  
   615  
   616  Restart All Containers
   617  ``````````````````````
   618  
   619  Example Request:
   620  
   621  .. code-block:: console
   622  
   623      POST /v1/apps/example-go/containers/restart/ HTTP/1.1
   624      Host: deis.example.com
   625      Authorization: token abc123
   626  
   627  Example Response:
   628  
   629  .. code-block:: console
   630  
   631      HTTP/1.1 200 OK
   632      DEIS_API_VERSION: 1.7
   633      DEIS_PLATFORM_VERSION: 1.12.1
   634      Content-Type: application/json
   635  
   636      [
   637          {
   638              "owner": "test",
   639              "app": "example-go",
   640              "release": "v2",
   641              "created": "2014-01-01T00:00:00UTC",
   642              "updated": "2014-01-01T00:00:00UTC",
   643              "uuid": "de1bf5b5-4a72-4f94-a10c-d2a3741cdf75",
   644              "type": "web",
   645              "num": 1,
   646              "state": "up"
   647          }
   648      ]
   649  
   650  
   651  Restart Containers by Type
   652  ``````````````````````````
   653  
   654  Example Request:
   655  
   656  .. code-block:: console
   657  
   658      POST /v1/apps/example-go/containers/web/restart/ HTTP/1.1
   659      Host: deis.example.com
   660      Authorization: token abc123
   661  
   662  Example Response:
   663  
   664  .. code-block:: console
   665  
   666      HTTP/1.1 200 OK
   667      DEIS_API_VERSION: 1.7
   668      DEIS_PLATFORM_VERSION: 1.12.1
   669      Content-Type: application/json
   670  
   671      [
   672          {
   673              "owner": "test",
   674              "app": "example-go",
   675              "release": "v2",
   676              "created": "2014-01-01T00:00:00UTC",
   677              "updated": "2014-01-01T00:00:00UTC",
   678              "uuid": "de1bf5b5-4a72-4f94-a10c-d2a3741cdf75",
   679              "type": "web",
   680              "num": 1,
   681              "state": "up"
   682          }
   683      ]
   684  
   685  
   686  Restart Containers by Type and Number
   687  `````````````````````````````````````
   688  
   689  Example Request:
   690  
   691  .. code-block:: console
   692  
   693      POST /v1/apps/example-go/containers/web/1/restart/ HTTP/1.1
   694      Host: deis.example.com
   695      Authorization: token abc123
   696  
   697  Example Response:
   698  
   699  .. code-block:: console
   700  
   701      HTTP/1.1 200 OK
   702      DEIS_API_VERSION: 1.7
   703      DEIS_PLATFORM_VERSION: 1.12.1
   704      Content-Type: application/json
   705  
   706      [
   707          {
   708              "owner": "test",
   709              "app": "example-go",
   710              "release": "v2",
   711              "created": "2014-01-01T00:00:00UTC",
   712              "updated": "2014-01-01T00:00:00UTC",
   713              "uuid": "de1bf5b5-4a72-4f94-a10c-d2a3741cdf75",
   714              "type": "web",
   715              "num": 1,
   716              "state": "up"
   717          }
   718      ]
   719  
   720  
   721  Scale Containers
   722  ````````````````
   723  
   724  Example Request:
   725  
   726  .. code-block:: console
   727  
   728      POST /v1/apps/example-go/scale/ HTTP/1.1
   729      Host: deis.example.com
   730      Content-Type: application/json
   731      Authorization: token abc123
   732  
   733      {"web": 3}
   734  
   735  Example Response:
   736  
   737  .. code-block:: console
   738  
   739      HTTP/1.1 204 NO CONTENT
   740      DEIS_API_VERSION: 1.7
   741      DEIS_PLATFORM_VERSION: 1.12.1
   742  
   743  
   744  Configuration
   745  -------------
   746  
   747  
   748  List Application Configuration
   749  ``````````````````````````````
   750  
   751  Example Request:
   752  
   753  .. code-block:: console
   754  
   755      GET /v1/apps/example-go/config/ HTTP/1.1
   756      Host: deis.example.com
   757      Authorization: token abc123
   758  
   759  Example Response:
   760  
   761  .. code-block:: console
   762  
   763      HTTP/1.1 200 OK
   764      DEIS_API_VERSION: 1.7
   765      DEIS_PLATFORM_VERSION: 1.12.1
   766      Content-Type: application/json
   767  
   768      {
   769          "owner": "test",
   770          "app": "example-go",
   771          "values": {
   772            "PLATFORM": "deis"
   773          },
   774          "memory": {},
   775          "cpu": {},
   776          "tags": {},
   777          "created": "2014-01-01T00:00:00UTC",
   778          "updated": "2014-01-01T00:00:00UTC",
   779          "uuid": "de1bf5b5-4a72-4f94-a10c-d2a3741cdf75"
   780      }
   781  
   782  
   783  Create new Config
   784  `````````````````
   785  
   786  Example Request:
   787  
   788  .. code-block:: console
   789  
   790      POST /v1/apps/example-go/config/ HTTP/1.1
   791      Host: deis.example.com
   792      Content-Type: application/json
   793      Authorization: token abc123
   794  
   795      {"values": {"HELLO": "world", "PLATFORM": "deis"}}
   796  
   797  Example Response:
   798  
   799  .. code-block:: console
   800  
   801      HTTP/1.1 201 CREATED
   802      DEIS_API_VERSION: 1.7
   803      DEIS_PLATFORM_VERSION: 1.12.1
   804      Content-Type: application/json
   805      X-Deis-Release: 3
   806  
   807      {
   808          "owner": "test",
   809          "app": "example-go",
   810          "values": {
   811              "DEIS_APP": "example-go",
   812              "DEIS_RELEASE": "v3",
   813              "HELLO": "world",
   814              "PLATFORM": "deis"
   815  
   816          },
   817          "memory": {},
   818          "cpu": {},
   819          "tags": {},
   820          "created": "2014-01-01T00:00:00UTC",
   821          "updated": "2014-01-01T00:00:00UTC",
   822          "uuid": "de1bf5b5-4a72-4f94-a10c-d2a3741cdf75"
   823      }
   824  
   825  
   826  Unset Config Variable
   827  `````````````````````
   828  
   829  Example Request:
   830  
   831  .. code-block:: console
   832  
   833      POST /v1/apps/example-go/config/ HTTP/1.1
   834      Host: deis.example.com
   835      Content-Type: application/json
   836      Authorization: token abc123
   837  
   838      {"values": {"HELLO": null}}
   839  
   840  Example Response:
   841  
   842  .. code-block:: console
   843  
   844      HTTP/1.1 201 CREATED
   845      DEIS_API_VERSION: 1.7
   846      DEIS_PLATFORM_VERSION: 1.12.1
   847      Content-Type: application/json
   848      X-Deis-Release: 4
   849  
   850      {
   851          "owner": "test",
   852          "app": "example-go",
   853          "values": {
   854              "DEIS_APP": "example-go",
   855              "DEIS_RELEASE": "v4",
   856              "PLATFORM": "deis"
   857         },
   858          "memory": {},
   859          "cpu": {},
   860          "tags": {},
   861          "created": "2014-01-01T00:00:00UTC",
   862          "updated": "2014-01-01T00:00:00UTC",
   863          "uuid": "de1bf5b5-4a72-4f94-a10c-d2a3741cdf75"
   864      }
   865  
   866  
   867  Domains
   868  -------
   869  
   870  
   871  List Application Domains
   872  ````````````````````````
   873  
   874  Example Request:
   875  
   876  .. code-block:: console
   877  
   878      GET /v1/apps/example-go/domains/ HTTP/1.1
   879      Host: deis.example.com
   880      Authorization: token abc123
   881  
   882  Example Response:
   883  
   884  .. code-block:: console
   885  
   886      HTTP/1.1 200 OK
   887      DEIS_API_VERSION: 1.7
   888      DEIS_PLATFORM_VERSION: 1.12.1
   889      Content-Type: application/json
   890  
   891      {
   892          "count": 1,
   893          "next": null,
   894          "previous": null,
   895          "results": [
   896              {
   897                  "app": "example-go",
   898                  "created": "2014-01-01T00:00:00UTC",
   899                  "domain": "example.example.com",
   900                  "owner": "test",
   901                  "updated": "2014-01-01T00:00:00UTC"
   902              }
   903          ]
   904      }
   905  
   906  
   907  Add Domain
   908  ``````````
   909  
   910  Example Request:
   911  
   912  .. code-block:: console
   913  
   914      POST /v1/apps/example-go/domains/ HTTP/1.1
   915      Host: deis.example.com
   916      Authorization: token abc123
   917  
   918      {'domain': 'example.example.com'}
   919  
   920  Example Response:
   921  
   922  .. code-block:: console
   923  
   924      HTTP/1.1 201 CREATED
   925      DEIS_API_VERSION: 1.7
   926      DEIS_PLATFORM_VERSION: 1.12.1
   927      Content-Type: application/json
   928  
   929      {
   930          "app": "example-go",
   931          "created": "2014-01-01T00:00:00UTC",
   932          "domain": "example.example.com",
   933          "owner": "test",
   934          "updated": "2014-01-01T00:00:00UTC"
   935      }
   936  
   937  
   938  
   939  Remove Domain
   940  `````````````
   941  
   942  Example Request:
   943  
   944  .. code-block:: console
   945  
   946      DELETE /v1/apps/example-go/domains/example.example.com 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 204 NO CONTENT
   955      DEIS_API_VERSION: 1.7
   956      DEIS_PLATFORM_VERSION: 1.12.1
   957  
   958  
   959  Builds
   960  ------
   961  
   962  
   963  List Application Builds
   964  ```````````````````````
   965  
   966  Example Request:
   967  
   968  .. code-block:: console
   969  
   970      GET /v1/apps/example-go/builds/ HTTP/1.1
   971      Host: deis.example.com
   972      Authorization: token abc123
   973  
   974  Example Response:
   975  
   976  .. code-block:: console
   977  
   978      HTTP/1.1 200 OK
   979      DEIS_API_VERSION: 1.7
   980      DEIS_PLATFORM_VERSION: 1.12.1
   981      Content-Type: application/json
   982  
   983      {
   984          "count": 1,
   985          "next": null,
   986          "previous": null,
   987          "results": [
   988              {
   989                  "app": "example-go",
   990                  "created": "2014-01-01T00:00:00UTC",
   991                  "dockerfile": "FROM deis/slugrunner RUN mkdir -p /app WORKDIR /app ENTRYPOINT [\"/runner/init\"] ADD slug.tgz /app ENV GIT_SHA 060da68f654e75fac06dbedd1995d5f8ad9084db",
   992                  "image": "example-go",
   993                  "owner": "test",
   994                  "procfile": {
   995                      "web": "example-go"
   996                  },
   997                  "sha": "060da68f",
   998                  "updated": "2014-01-01T00:00:00UTC",
   999                  "uuid": "de1bf5b5-4a72-4f94-a10c-d2a3741cdf75"
  1000              }
  1001          ]
  1002      }
  1003  
  1004  
  1005  Create Application Build
  1006  ````````````````````````
  1007  
  1008  Example Request:
  1009  
  1010  .. code-block:: console
  1011  
  1012      POST /v1/apps/example-go/builds/ HTTP/1.1
  1013      Host: deis.example.com
  1014      Content-Type: application/json
  1015      Authorization: token abc123
  1016  
  1017      {"image": "deis/example-go:latest"}
  1018  
  1019  Optional Parameters:
  1020  
  1021  .. code-block:: console
  1022  
  1023      {
  1024          "procfile": {
  1025            "web": "./cmd"
  1026          }
  1027      }
  1028  
  1029  Example Response:
  1030  
  1031  .. code-block:: console
  1032  
  1033      HTTP/1.1 201 CREATED
  1034      DEIS_API_VERSION: 1.7
  1035      DEIS_PLATFORM_VERSION: 1.12.1
  1036      Content-Type: application/json
  1037      X-Deis-Release: 4
  1038  
  1039      {
  1040          "app": "example-go",
  1041          "created": "2014-01-01T00:00:00UTC",
  1042          "dockerfile": "",
  1043          "image": "deis/example-go:latest",
  1044          "owner": "test",
  1045          "procfile": {},
  1046          "sha": "",
  1047          "updated": "2014-01-01T00:00:00UTC",
  1048          "uuid": "de1bf5b5-4a72-4f94-a10c-d2a3741cdf75"
  1049      }
  1050  
  1051  
  1052  Releases
  1053  --------
  1054  
  1055  
  1056  List Application Releases
  1057  `````````````````````````
  1058  
  1059  Example Request:
  1060  
  1061  .. code-block:: console
  1062  
  1063      GET /v1/apps/example-go/releases/ HTTP/1.1
  1064      Host: deis.example.com
  1065      Authorization: token abc123
  1066  
  1067  Example Response:
  1068  
  1069  .. code-block:: console
  1070  
  1071      HTTP/1.1 200 OK
  1072      DEIS_API_VERSION: 1.7
  1073      DEIS_PLATFORM_VERSION: 1.12.1
  1074      Content-Type: application/json
  1075  
  1076      {
  1077          "count": 3,
  1078          "next": null,
  1079          "previous": null,
  1080          "results": [
  1081              {
  1082                  "app": "example-go",
  1083                  "build": "202d8e4b-600e-4425-a85c-ffc7ea607f61",
  1084                  "config": "ed637ceb-5d32-44bd-9406-d326a777a513",
  1085                  "created": "2014-01-01T00:00:00UTC",
  1086                  "owner": "test",
  1087                  "summary": "test changed nothing",
  1088                  "updated": "2014-01-01T00:00:00UTC",
  1089                  "uuid": "de1bf5b5-4a72-4f94-a10c-d2a3741cdf75",
  1090                  "version": 3
  1091              },
  1092              {
  1093                  "app": "example-go",
  1094                  "build": "202d8e4b-600e-4425-a85c-ffc7ea607f61",
  1095                  "config": "95bd6dea-1685-4f78-a03d-fd7270b058d1",
  1096                  "created": "2014-01-01T00:00:00UTC",
  1097                  "owner": "test",
  1098                  "summary": "test deployed 060da68",
  1099                  "updated": "2014-01-01T00:00:00UTC",
  1100                  "uuid": "de1bf5b5-4a72-4f94-a10c-d2a3741cdf75",
  1101                  "version": 2
  1102              },
  1103              {
  1104                  "app": "example-go",
  1105                  "build": null,
  1106                  "config": "95bd6dea-1685-4f78-a03d-fd7270b058d1",
  1107                  "created": "2014-01-01T00:00:00UTC",
  1108                  "owner": "test",
  1109                  "summary": "test created initial release",
  1110                  "updated": "2014-01-01T00:00:00UTC",
  1111                  "uuid": "de1bf5b5-4a72-4f94-a10c-d2a3741cdf75",
  1112                  "version": 1
  1113              }
  1114          ]
  1115      }
  1116  
  1117  
  1118  List Release Details
  1119  ````````````````````
  1120  
  1121  Example Request:
  1122  
  1123  .. code-block:: console
  1124  
  1125      GET /v1/apps/example-go/releases/v1/ HTTP/1.1
  1126      Host: deis.example.com
  1127      Authorization: token abc123
  1128  
  1129  Example Response:
  1130  
  1131  .. code-block:: console
  1132  
  1133      HTTP/1.1 200 OK
  1134      DEIS_API_VERSION: 1.7
  1135      DEIS_PLATFORM_VERSION: 1.12.1
  1136      Content-Type: application/json
  1137  
  1138      {
  1139          "app": "example-go",
  1140          "build": null,
  1141          "config": "95bd6dea-1685-4f78-a03d-fd7270b058d1",
  1142          "created": "2014-01-01T00:00:00UTC",
  1143          "owner": "test",
  1144          "summary": "test created initial release",
  1145          "updated": "2014-01-01T00:00:00UTC",
  1146          "uuid": "de1bf5b5-4a72-4f94-a10c-d2a3741cdf75",
  1147          "version": 1
  1148      }
  1149  
  1150  
  1151  Rollback Release
  1152  ````````````````
  1153  
  1154  Example Request:
  1155  
  1156  .. code-block:: console
  1157  
  1158      POST /v1/apps/example-go/releases/rollback/ HTTP/1.1
  1159      Host: deis.example.com
  1160      Content-Type: application/json
  1161      Authorization: token abc123
  1162  
  1163      {"version": 1}
  1164  
  1165  Example Response:
  1166  
  1167  .. code-block:: console
  1168  
  1169      HTTP/1.1 201 CREATED
  1170      DEIS_API_VERSION: 1.7
  1171      DEIS_PLATFORM_VERSION: 1.12.1
  1172      Content-Type: application/json
  1173  
  1174      {"version": 5}
  1175  
  1176  
  1177  Keys
  1178  ----
  1179  
  1180  
  1181  List Keys
  1182  `````````
  1183  
  1184  Example Request:
  1185  
  1186  .. code-block:: console
  1187  
  1188      GET /v1/keys/ HTTP/1.1
  1189      Host: deis.example.com
  1190      Authorization: token abc123
  1191  
  1192  Example Response:
  1193  
  1194  .. code-block:: console
  1195  
  1196      HTTP/1.1 201 CREATED
  1197      DEIS_API_VERSION: 1.7
  1198      DEIS_PLATFORM_VERSION: 1.12.1
  1199      Content-Type: application/json
  1200  
  1201      {
  1202          "count": 1,
  1203          "next": null,
  1204          "previous": null,
  1205          "results": [
  1206              {
  1207                  "created": "2014-01-01T00:00:00UTC",
  1208                  "id": "test@example.com",
  1209                  "owner": "test",
  1210                  "public": "ssh-rsa <...>",
  1211                  "updated": "2014-01-01T00:00:00UTC",
  1212                  "uuid": "de1bf5b5-4a72-4f94-a10c-d2a3741cdf75"
  1213              }
  1214          ]
  1215      }
  1216  
  1217  
  1218  Add Key to User
  1219  ```````````````
  1220  
  1221  Example Request:
  1222  
  1223  .. code-block:: console
  1224  
  1225      POST /v1/keys/ HTTP/1.1
  1226      Host: deis.example.com
  1227      Authorization: token abc123
  1228  
  1229      {
  1230          "id": "example",
  1231          "public": "ssh-rsa <...>"
  1232      }
  1233  
  1234  Example Response:
  1235  
  1236  .. code-block:: console
  1237  
  1238      HTTP/1.1 201 CREATED
  1239      DEIS_API_VERSION: 1.7
  1240      DEIS_PLATFORM_VERSION: 1.12.1
  1241      Content-Type: application/json
  1242  
  1243      {
  1244          "created": "2014-01-01T00:00:00UTC",
  1245          "id": "example",
  1246          "owner": "example",
  1247          "public": "ssh-rsa <...>",
  1248          "updated": "2014-01-01T00:00:00UTC",
  1249          "uuid": "de1bf5b5-4a72-4f94-a10c-d2a3741cdf75"
  1250      }
  1251  
  1252  
  1253  Remove Key from User
  1254  ````````````````````
  1255  
  1256  Example Request:
  1257  
  1258  .. code-block:: console
  1259  
  1260      DELETE /v1/keys/example HTTP/1.1
  1261      Host: deis.example.com
  1262      Authorization: token abc123
  1263  
  1264  Example Response:
  1265  
  1266  .. code-block:: console
  1267  
  1268      HTTP/1.1 204 NO CONTENT
  1269      DEIS_API_VERSION: 1.7
  1270      DEIS_PLATFORM_VERSION: 1.12.1
  1271  
  1272  
  1273  Permissions
  1274  -----------
  1275  
  1276  
  1277  List Application Permissions
  1278  ````````````````````````````
  1279  
  1280  .. note::
  1281  
  1282      This does not include the app owner.
  1283  
  1284  Example Request:
  1285  
  1286  .. code-block:: console
  1287  
  1288      GET /v1/apps/example-go/perms/ HTTP/1.1
  1289      Host: deis.example.com
  1290      Authorization: token abc123
  1291  
  1292  Example Response:
  1293  
  1294  .. code-block:: console
  1295  
  1296      HTTP/1.1 200 OK
  1297      DEIS_API_VERSION: 1.7
  1298      DEIS_PLATFORM_VERSION: 1.12.1
  1299      Content-Type: application/json
  1300  
  1301      {
  1302          "users": [
  1303              "test",
  1304              "foo"
  1305          ]
  1306      }
  1307  
  1308  
  1309  Create Application Permission
  1310  `````````````````````````````
  1311  
  1312  Example Request:
  1313  
  1314  .. code-block:: console
  1315  
  1316      POST /v1/apps/example-go/perms/ HTTP/1.1
  1317      Host: deis.example.com
  1318      Authorization: token abc123
  1319  
  1320      {"username": "example"}
  1321  
  1322  Example Response:
  1323  
  1324  .. code-block:: console
  1325  
  1326      HTTP/1.1 201 CREATED
  1327      DEIS_API_VERSION: 1.7
  1328      DEIS_PLATFORM_VERSION: 1.12.1
  1329  
  1330  
  1331  Remove Application Permission
  1332  `````````````````````````````
  1333  
  1334  Example Request:
  1335  
  1336  .. code-block:: console
  1337  
  1338      DELETE /v1/apps/example-go/perms/example HTTP/1.1
  1339      Host: deis.example.com
  1340      Authorization: token abc123
  1341  
  1342  Example Response:
  1343  
  1344  .. code-block:: console
  1345  
  1346      HTTP/1.1 204 NO CONTENT
  1347      DEIS_API_VERSION: 1.7
  1348      DEIS_PLATFORM_VERSION: 1.12.1
  1349  
  1350  List Administrators
  1351  ```````````````````
  1352  
  1353  Example Request:
  1354  
  1355  .. code-block:: console
  1356  
  1357      GET /v1/admin/perms/ HTTP/1.1
  1358      Host: deis.example.com
  1359      Authorization: token abc123
  1360  
  1361  Example Response:
  1362  
  1363  .. code-block:: console
  1364  
  1365      HTTP/1.1 200 OK
  1366      DEIS_API_VERSION: 1.7
  1367      DEIS_PLATFORM_VERSION: 1.12.1
  1368      Content-Type: application/json
  1369  
  1370      {
  1371          "count": 2,
  1372          "next": null
  1373          "previous": null,
  1374          "results": [
  1375              {
  1376                  "username": "test",
  1377                  "is_superuser": true
  1378              },
  1379              {
  1380                  "username": "foo",
  1381                  "is_superuser": true
  1382              }
  1383          ]
  1384      }
  1385  
  1386  
  1387  Grant User Administrative Privileges
  1388  ````````````````````````````````````
  1389  
  1390  .. note::
  1391  
  1392      This command requires administrative privileges
  1393  
  1394  Example Request:
  1395  
  1396  .. code-block:: console
  1397  
  1398      POST /v1/admin/perms HTTP/1.1
  1399      Host: deis.example.com
  1400      Authorization: token abc123
  1401  
  1402      {"username": "example"}
  1403  
  1404  Example Response:
  1405  
  1406  .. code-block:: console
  1407  
  1408      HTTP/1.1 201 CREATED
  1409      DEIS_API_VERSION: 1.7
  1410      DEIS_PLATFORM_VERSION: 1.12.1
  1411  
  1412  Remove User's Administrative Privileges
  1413  ```````````````````````````````````````
  1414  
  1415  .. note::
  1416  
  1417      This command requires administrative privileges
  1418  
  1419  Example Request:
  1420  
  1421  .. code-block:: console
  1422  
  1423      DELETE /v1/admin/perms/example HTTP/1.1
  1424      Host: deis.example.com
  1425      Authorization: token abc123
  1426  
  1427  Example Response:
  1428  
  1429  .. code-block:: console
  1430  
  1431      HTTP/1.1 204 NO CONTENT
  1432      DEIS_API_VERSION: 1.7
  1433      DEIS_PLATFORM_VERSION: 1.12.1
  1434  
  1435  Users
  1436  -----
  1437  
  1438  List all users
  1439  ``````````````
  1440  
  1441  .. note::
  1442  
  1443      This command requires administrative privileges
  1444  
  1445  Example Request:
  1446  
  1447  .. code-block:: console
  1448  
  1449      GET /v1/users HTTP/1.1
  1450      Host: deis.example.com
  1451      Authorization: token abc123
  1452  
  1453  Example Response:
  1454  
  1455  .. code-block:: console
  1456  
  1457      HTTP/1.1 200 OK
  1458      DEIS_API_VERSION: 1.7
  1459      DEIS_PLATFORM_VERSION: 1.12.1
  1460      Content-Type: application/json
  1461  
  1462      {
  1463          "count": 1,
  1464          "next": null,
  1465          "previous": null,
  1466          "results": [
  1467              {
  1468                  "id": 1,
  1469                  "last_login": "2014-10-19T22:01:00.601Z",
  1470                  "is_superuser": true,
  1471                  "username": "test",
  1472                  "first_name": "test",
  1473                  "last_name": "testerson",
  1474                  "email": "test@example.com",
  1475                  "is_staff": true,
  1476                  "is_active": true,
  1477                  "date_joined": "2014-10-19T22:01:00.601Z",
  1478                  "groups": [],
  1479                  "user_permissions": []
  1480              }
  1481          ]
  1482      }