github.com/greenboxal/deis@v1.12.1/docs/reference/api-v1.4.rst (about)

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