github.com/amrnt/deis@v1.3.1/docs/reference/api-v1.1.rst (about)

     1  :title: Controller API v1.1
     2  :description: The v1.1 REST API for Deis' Controller
     3  
     4  .. _controller_api_v1:
     5  
     6  Controller API v1.1
     7  ===================
     8  
     9  This is the v1.1 REST API for the :ref:`Controller`.
    10  
    11  
    12  What's New
    13  ----------
    14  
    15  **New!** All controller responses now return the ``X_DEIS_API_VERSION`` header.
    16  
    17  **New!** All controller responses now return the ``X_DEIS_PLATFORM_VERSION`` header.
    18  
    19  **New!** Users see a 404 response when modifying applications they are unauthorized to see.
    20  
    21  **New!** Responses returned from the scheduler are properly formatted JSON responses.
    22  
    23  
    24  Authentication
    25  --------------
    26  
    27  
    28  Register a New User
    29  ```````````````````
    30  
    31  Example Request:
    32  
    33  .. code-block:: console
    34  
    35      POST /v1/auth/register/ HTTP/1.1
    36      Host: deis.example.com
    37      Content-Type: application/json
    38  
    39      {
    40          "username": "test",
    41          "password": "opensesame"
    42      }
    43  
    44  Optional Parameters:
    45  
    46  .. code-block:: console
    47  
    48      {
    49          "email": "test@example.com",
    50          "first_name": "test",
    51          "last_name": "testerson"
    52      }
    53  
    54  Example Response:
    55  
    56  .. code-block:: console
    57  
    58      HTTP/1.1 201 CREATED
    59      X_DEIS_API_VERSION: 1.1
    60      X_DEIS_PLATFORM_VERSION: 1.3.1
    61      Content-Type: application/json
    62  
    63      {
    64          "id": 1,
    65          "last_login": "2014-10-19T22:01:00.601Z",
    66          "is_superuser": true,
    67          "username": "test",
    68          "first_name": "test",
    69          "last_name": "testerson",
    70          "email": "test@example.com",
    71          "is_staff": true,
    72          "is_active": true,
    73          "date_joined": "2014-10-19T22:01:00.601Z",
    74          "groups": [],
    75          "user_permissions": []
    76      }
    77  
    78  
    79  Log in
    80  ``````
    81  
    82  Example Request:
    83  
    84  .. code-block:: console
    85  
    86      POST /v1/auth/login/ HTTP/1.1
    87      Host: deis.example.com
    88      Content-Type: application/json
    89  
    90      {"username": "test", "password": "opensesame"}
    91  
    92  Example Response:
    93  
    94  .. code-block:: console
    95  
    96      HTTP/1.1 200 OK
    97      X_DEIS_API_VERSION: 1.1
    98      X_DEIS_PLATFORM_VERSION: 1.3.1
    99      Content-Type: application/json
   100  
   101      {"token": "abc123"}
   102  
   103  
   104  Cancel Account
   105  ``````````````
   106  
   107  Example Request:
   108  
   109  .. code-block:: console
   110  
   111      DELETE /v1/auth/cancel/ HTTP/1.1
   112      Host: deis.example.com
   113      Authorization: token abc123
   114  
   115  Example Response:
   116  
   117  .. code-block:: console
   118  
   119      HTTP/1.1 204 NO CONTENT
   120      X_DEIS_API_VERSION: 1.1
   121      X_DEIS_PLATFORM_VERSION: 1.3.1
   122  
   123  
   124  Applications
   125  ------------
   126  
   127  
   128  List all Applications
   129  `````````````````````
   130  
   131  Example Request:
   132  
   133  .. code-block:: console
   134  
   135      GET /v1/apps HTTP/1.1
   136      Host: deis.example.com
   137      Authorization: token abc123
   138  
   139  Example Response:
   140  
   141  .. code-block:: console
   142  
   143      HTTP/1.1 200 OK
   144      X_DEIS_API_VERSION: 1.1
   145      X_DEIS_PLATFORM_VERSION: 1.3.1
   146      Content-Type: application/json
   147  
   148      {
   149          "count": 1,
   150          "next": null,
   151          "previous": null,
   152          "results": [
   153              {
   154                  "created": "2014-01-01T00:00:00UTC",
   155                  "id": "example-go",
   156                  "owner": "test",
   157                  "structure": {},
   158                  "updated": "2014-01-01T00:00:00UTC",
   159                  "url": "example-go.example.com",
   160                  "uuid": "de1bf5b5-4a72-4f94-a10c-d2a3741cdf75"
   161              }
   162          ]
   163      }
   164  
   165  
   166  Create an Application
   167  `````````````````````
   168  
   169  Example Request:
   170  
   171  .. code-block:: console
   172  
   173      POST /v1/apps/ HTTP/1.1
   174      Host: deis.example.com
   175      Content-Type: application/json
   176      Authorization: token abc123
   177  
   178  Optional parameters:
   179  
   180  .. code-block:: console
   181  
   182      {"id": "example-go"}
   183  
   184  
   185  Example Response:
   186  
   187  .. code-block:: console
   188  
   189      HTTP/1.1 201 CREATED
   190      X_DEIS_API_VERSION: 1.1
   191      X_DEIS_PLATFORM_VERSION: 1.3.1
   192      Content-Type: application/json
   193  
   194      {
   195          "created": "2014-01-01T00:00:00UTC",
   196          "id": "example-go",
   197          "owner": "test",
   198          "structure": {},
   199          "updated": "2014-01-01T00:00:00UTC",
   200          "url": "example-go.example.com",
   201          "uuid": "de1bf5b5-4a72-4f94-a10c-d2a3741cdf75"
   202      }
   203  
   204  
   205  Destroy an Application
   206  ``````````````````````
   207  
   208  Example Request:
   209  
   210  .. code-block:: console
   211  
   212      DELETE /v1/apps/example-go/ HTTP/1.1
   213      Host: deis.example.com
   214      Authorization: token abc123
   215  
   216  Example Response:
   217  
   218  .. code-block:: console
   219  
   220      HTTP/1.1 204 NO CONTENT
   221      X_DEIS_API_VERSION: 1.1
   222      X_DEIS_PLATFORM_VERSION: 1.3.1
   223  
   224  
   225  List Application Details
   226  ````````````````````````
   227  
   228  Example Request:
   229  
   230  .. code-block:: console
   231  
   232      GET /v1/apps/example-go/ HTTP/1.1
   233      Host: deis.example.com
   234      Authorization: token abc123
   235  
   236  Example Response:
   237  
   238  .. code-block:: console
   239  
   240      HTTP/1.1 200 OK
   241      X_DEIS_API_VERSION: 1.1
   242      X_DEIS_PLATFORM_VERSION: 1.3.1
   243      Content-Type: application/json
   244  
   245      {
   246          "created": "2014-01-01T00:00:00UTC",
   247          "id": "example-go",
   248          "owner": "test",
   249          "structure": {},
   250          "updated": "2014-01-01T00:00:00UTC",
   251          "url": "example-go.example.com",
   252          "uuid": "de1bf5b5-4a72-4f94-a10c-d2a3741cdf75"
   253      }
   254  
   255  
   256  Retrieve Application Logs
   257  `````````````````````````
   258  
   259  Example Request:
   260  
   261  .. code-block:: console
   262  
   263      GET /v1/apps/example-go/logs/ 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      X_DEIS_API_VERSION: 1.1
   273      X_DEIS_PLATFORM_VERSION: 1.3.1
   274      Content-Type: text/plain
   275  
   276      "16:51:14 deis[api]: test created initial release\n"
   277  
   278  
   279  Run one-off Commands
   280  ````````````````````
   281  
   282  .. code-block:: console
   283  
   284      POST /v1/apps/example-go/run/ HTTP/1.1
   285      Host: deis.example.com
   286      Content-Type: application/json
   287      Authorization: token abc123
   288  
   289      {"command": "echo hi"}
   290  
   291  Example Response:
   292  
   293  .. code-block:: console
   294  
   295      HTTP/1.1 200 OK
   296      X_DEIS_API_VERSION: 1.1
   297      X_DEIS_PLATFORM_VERSION: 1.3.1
   298      Content-Type: application/json
   299  
   300      {"rc": 0, "output": "hi"}
   301  
   302  
   303  Containers
   304  ----------
   305  
   306  
   307  List all Containers
   308  ```````````````````
   309  
   310  Example Request:
   311  
   312  .. code-block:: console
   313  
   314      GET /v1/apps/example-go/containers/ HTTP/1.1
   315      Host: deis.example.com
   316      Authorization: token abc123
   317  
   318  Example Response:
   319  
   320  .. code-block:: console
   321  
   322      HTTP/1.1 200 OK
   323      X_DEIS_API_VERSION: 1.1
   324      X_DEIS_PLATFORM_VERSION: 1.3.1
   325      Content-Type: application/json
   326  
   327      {
   328          "count": 1,
   329          "next": null,
   330          "previous": null,
   331          "results": [
   332              {
   333                  "owner": "test",
   334                  "app": "example-go",
   335                  "release": "v2",
   336                  "created": "2014-01-01T00:00:00UTC",
   337                  "updated": "2014-01-01T00:00:00UTC",
   338                  "uuid": "de1bf5b5-4a72-4f94-a10c-d2a3741cdf75",
   339                  "type": "web",
   340                  "num": 1,
   341                  "state": "up"
   342              }
   343          ]
   344      }
   345  
   346  
   347  List all Containers by Type
   348  ```````````````````````````
   349  
   350  Example Request:
   351  
   352  .. code-block:: console
   353  
   354      GET /v1/apps/example-go/containers/web/ HTTP/1.1
   355      Host: deis.example.com
   356      Authorization: token abc123
   357  
   358  Example Response:
   359  
   360  .. code-block:: console
   361  
   362      HTTP/1.1 200 OK
   363      X_DEIS_API_VERSION: 1.1
   364      X_DEIS_PLATFORM_VERSION: 1.3.1
   365      Content-Type: application/json
   366  
   367      {
   368          "count": 1,
   369          "next": null,
   370          "previous": null,
   371          "results": [
   372              {
   373                  "owner": "test",
   374                  "app": "example-go",
   375                  "release": "v2",
   376                  "created": "2014-01-01T00:00:00UTC",
   377                  "updated": "2014-01-01T00:00:00UTC",
   378                  "uuid": "de1bf5b5-4a72-4f94-a10c-d2a3741cdf75",
   379                  "type": "web",
   380                  "num": 1,
   381                  "state": "up"
   382              }
   383          ]
   384      }
   385  
   386  
   387  Scale Containers
   388  ````````````````
   389  
   390  Example Request:
   391  
   392  .. code-block:: console
   393  
   394      POST /v1/apps/example-go/scale/ HTTP/1.1
   395      Host: deis.example.com
   396      Content-Type: application/json
   397      Authorization: token abc123
   398  
   399      {"web": 3}
   400  
   401  Example Response:
   402  
   403  .. code-block:: console
   404  
   405      HTTP/1.1 204 NO CONTENT
   406      X_DEIS_API_VERSION: 1.1
   407      X_DEIS_PLATFORM_VERSION: 1.3.1
   408  
   409  
   410  Configuration
   411  -------------
   412  
   413  
   414  List Application Configuration
   415  ``````````````````````````````
   416  
   417  Example Request:
   418  
   419  .. code-block:: console
   420  
   421      GET /v1/apps/example-go/config/ HTTP/1.1
   422      Host: deis.example.com
   423      Authorization: token abc123
   424  
   425  Example Response:
   426  
   427  .. code-block:: console
   428  
   429      HTTP/1.1 200 OK
   430      X_DEIS_API_VERSION: 1.1
   431      X_DEIS_PLATFORM_VERSION: 1.3.1
   432      Content-Type: application/json
   433  
   434      {
   435          "owner": "test",
   436          "app": "example-go",
   437          "values": {},
   438          "memory": {},
   439          "cpu": {},
   440          "tags": {},
   441          "created": "2014-01-01T00:00:00UTC",
   442          "updated": "2014-01-01T00:00:00UTC",
   443          "uuid": "de1bf5b5-4a72-4f94-a10c-d2a3741cdf75"
   444      }
   445  
   446  
   447  Create new Config
   448  `````````````````
   449  
   450  Example Request:
   451  
   452  .. code-block:: console
   453  
   454      POST /v1/apps/example-go/config/ HTTP/1.1
   455      Host: deis.example.com
   456      Content-Type: application/json
   457      Authorization: token abc123
   458  
   459      {"values": {"HELLO": "world", "PLATFORM: "deis"}}
   460  
   461  Example Response:
   462  
   463  .. code-block:: console
   464  
   465      HTTP/1.1 201 CREATED
   466      X_DEIS_API_VERSION: 1.1
   467      X_DEIS_PLATFORM_VERSION: 1.3.1
   468      Content-Type: application/json
   469      X-Deis-Release: 3
   470  
   471      {
   472          "owner": "test",
   473          "app": "example-go",
   474          "values": {
   475              "DEIS_APP": "example-go",
   476              "DEIS_RELEASE": "v3",
   477              "HELLO": "world",
   478              "PLATFORM": "deis"
   479  
   480          },
   481          "memory": {},
   482          "cpu": {},
   483          "tags": {},
   484          "created": "2014-01-01T00:00:00UTC",
   485          "updated": "2014-01-01T00:00:00UTC",
   486          "uuid": "de1bf5b5-4a72-4f94-a10c-d2a3741cdf75"
   487      }
   488  
   489  
   490  Unset Config Variable
   491  `````````````````````
   492  
   493  Example Request:
   494  
   495  .. code-block:: console
   496  
   497      POST /v1/apps/example-go/config/ HTTP/1.1
   498      Host: deis.example.com
   499      Content-Type: application/json
   500      Authorization: token abc123
   501  
   502      {"values": {"HELLO": null}}
   503  
   504  Example Response:
   505  
   506  .. code-block:: console
   507  
   508      HTTP/1.1 201 CREATED
   509      X_DEIS_API_VERSION: 1.1
   510      X_DEIS_PLATFORM_VERSION: 1.3.1
   511      Content-Type: application/json
   512      X-Deis-Release: 4
   513  
   514      {
   515          "owner": "test",
   516          "app": "example-go",
   517          "values": {
   518              "DEIS_APP": "example-go",
   519              "DEIS_RELEASE": "v4",
   520              "PLATFORM": "deis"
   521         },
   522          "memory": {},
   523          "cpu": {},
   524          "tags": {},
   525          "created": "2014-01-01T00:00:00UTC",
   526          "updated": "2014-01-01T00:00:00UTC",
   527          "uuid": "de1bf5b5-4a72-4f94-a10c-d2a3741cdf75"
   528      }
   529  
   530  
   531  Domains
   532  -------
   533  
   534  
   535  List Application Domains
   536  ````````````````````````
   537  
   538  Example Request:
   539  
   540  .. code-block:: console
   541  
   542      GET /v1/apps/example-go/domains/ HTTP/1.1
   543      Host: deis.example.com
   544      Authorization: token abc123
   545  
   546  Example Response:
   547  
   548  .. code-block:: console
   549  
   550      HTTP/1.1 200 OK
   551      X_DEIS_API_VERSION: 1.1
   552      X_DEIS_PLATFORM_VERSION: 1.3.1
   553      Content-Type: application/json
   554  
   555      {
   556          "count": 1,
   557          "next": null,
   558          "previous": null,
   559          "results": [
   560              {
   561                  "app": "example-go",
   562                  "created": "2014-01-01T00:00:00UTC",
   563                  "domain": "example.example.com",
   564                  "owner": "test",
   565                  "updated": "2014-01-01T00:00:00UTC"
   566              }
   567          ]
   568      }
   569  
   570  
   571  Add Domain
   572  ``````````
   573  
   574  Example Request:
   575  
   576  .. code-block:: console
   577  
   578      POST /v1/apps/example-go/domains/ HTTP/1.1
   579      Host: deis.example.com
   580      Authorization: token abc123
   581  
   582      {'domain': 'example.example.com'}
   583  
   584  Example Response:
   585  
   586  .. code-block:: console
   587  
   588      HTTP/1.1 201 CREATED
   589      X_DEIS_API_VERSION: 1.1
   590      X_DEIS_PLATFORM_VERSION: 1.3.1
   591      Content-Type: application/json
   592  
   593      {
   594          "app": "example-go",
   595          "created": "2014-01-01T00:00:00UTC",
   596          "domain": "example.example.com",
   597          "owner": "test",
   598          "updated": "2014-01-01T00:00:00UTC"
   599      }
   600  
   601  
   602  
   603  Remove Domain
   604  `````````````
   605  
   606  Example Request:
   607  
   608  .. code-block:: console
   609  
   610      DELETE /v1/apps/example-go/domains/example.example.com HTTP/1.1
   611      Host: deis.example.com
   612      Authorization: token abc123
   613  
   614  Example Response:
   615  
   616  .. code-block:: console
   617  
   618      HTTP/1.1 204 NO CONTENT
   619      X_DEIS_API_VERSION: 1.1
   620      X_DEIS_PLATFORM_VERSION: 1.3.1
   621  
   622  
   623  Builds
   624  ------
   625  
   626  
   627  List Application Builds
   628  ```````````````````````
   629  
   630  Example Request:
   631  
   632  .. code-block:: console
   633  
   634      GET /v1/apps/example-go/builds/ 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      X_DEIS_API_VERSION: 1.1
   644      X_DEIS_PLATFORM_VERSION: 1.3.1
   645      Content-Type: application/json
   646  
   647      {
   648          "count": 1,
   649          "next": null,
   650          "previous": null,
   651          "results": [
   652              {
   653                  "app": "example-go",
   654                  "created": "2014-01-01T00:00:00UTC",
   655                  "dockerfile": "FROM deis/slugrunner RUN mkdir -p /app WORKDIR /app ENTRYPOINT [\"/runner/init\"] ADD slug.tgz /app ENV GIT_SHA 060da68f654e75fac06dbedd1995d5f8ad9084db",
   656                  "image": "example-go",
   657                  "owner": "test",
   658                  "procfile": {
   659                      "web": "example-go"
   660                  },
   661                  "sha": "060da68f",
   662                  "updated": "2014-01-01T00:00:00UTC",
   663                  "uuid": "de1bf5b5-4a72-4f94-a10c-d2a3741cdf75"
   664              }
   665          ]
   666      }
   667  
   668  
   669  Create Application Build
   670  ````````````````````````
   671  
   672  Example Request:
   673  
   674  .. code-block:: console
   675  
   676      POST /v1/apps/example-go/builds/ HTTP/1.1
   677      Host: deis.example.com
   678      Content-Type: application/json
   679      Authorization: token abc123
   680  
   681      {"image": "deis/example-go:latest"}
   682  
   683  Example Response:
   684  
   685  .. code-block:: console
   686  
   687      HTTP/1.1 201 CREATED
   688      X_DEIS_API_VERSION: 1.1
   689      X_DEIS_PLATFORM_VERSION: 1.3.1
   690      Content-Type: application/json
   691      X-Deis-Release: 4
   692  
   693      {
   694          "app": "example-go",
   695          "created": "2014-01-01T00:00:00UTC",
   696          "dockerfile": "",
   697          "image": "deis/example-go:latest",
   698          "owner": "test",
   699          "procfile": {},
   700          "sha": "",
   701          "updated": "2014-01-01T00:00:00UTC",
   702          "uuid": "de1bf5b5-4a72-4f94-a10c-d2a3741cdf75"
   703      }
   704  
   705  
   706  Releases
   707  --------
   708  
   709  
   710  List Application Releases
   711  `````````````````````````
   712  
   713  Example Request:
   714  
   715  .. code-block:: console
   716  
   717      GET /v1/apps/example-go/releases/ HTTP/1.1
   718      Host: deis.example.com
   719      Authorization: token abc123
   720  
   721  Example Response:
   722  
   723  .. code-block:: console
   724  
   725      HTTP/1.1 200 OK
   726      X_DEIS_API_VERSION: 1.1
   727      X_DEIS_PLATFORM_VERSION: 1.3.1
   728      Content-Type: application/json
   729  
   730      {
   731          "count": 3,
   732          "next": null,
   733          "previous": null,
   734          "results": [
   735              {
   736                  "app": "example-go",
   737                  "build": "202d8e4b-600e-4425-a85c-ffc7ea607f61",
   738                  "config": "ed637ceb-5d32-44bd-9406-d326a777a513",
   739                  "created": "2014-01-01T00:00:00UTC",
   740                  "owner": "test",
   741                  "summary": "test changed nothing",
   742                  "updated": "2014-01-01T00:00:00UTC",
   743                  "uuid": "de1bf5b5-4a72-4f94-a10c-d2a3741cdf75",
   744                  "version": 3
   745              },
   746              {
   747                  "app": "example-go",
   748                  "build": "202d8e4b-600e-4425-a85c-ffc7ea607f61",
   749                  "config": "95bd6dea-1685-4f78-a03d-fd7270b058d1",
   750                  "created": "2014-01-01T00:00:00UTC",
   751                  "owner": "test",
   752                  "summary": "test deployed 060da68",
   753                  "updated": "2014-01-01T00:00:00UTC",
   754                  "uuid": "de1bf5b5-4a72-4f94-a10c-d2a3741cdf75",
   755                  "version": 2
   756              },
   757              {
   758                  "app": "example-go",
   759                  "build": null,
   760                  "config": "95bd6dea-1685-4f78-a03d-fd7270b058d1",
   761                  "created": "2014-01-01T00:00:00UTC",
   762                  "owner": "test",
   763                  "summary": "test created initial release",
   764                  "updated": "2014-01-01T00:00:00UTC",
   765                  "uuid": "de1bf5b5-4a72-4f94-a10c-d2a3741cdf75",
   766                  "version": 1
   767              }
   768          ]
   769      }
   770  
   771  
   772  List Release Details
   773  ````````````````````
   774  
   775  Example Request:
   776  
   777  .. code-block:: console
   778  
   779      GET /v1/apps/example-go/releases/v1/ HTTP/1.1
   780      Host: deis.example.com
   781      Authorization: token abc123
   782  
   783  Example Response:
   784  
   785  .. code-block:: console
   786  
   787      HTTP/1.1 200 OK
   788      X_DEIS_API_VERSION: 1.1
   789      X_DEIS_PLATFORM_VERSION: 1.3.1
   790      Content-Type: application/json
   791  
   792      {
   793          "app": "example-go",
   794          "build": null,
   795          "config": "95bd6dea-1685-4f78-a03d-fd7270b058d1",
   796          "created": "2014-01-01T00:00:00UTC",
   797          "owner": "test",
   798          "summary": "test created initial release",
   799          "updated": "2014-01-01T00:00:00UTC",
   800          "uuid": "de1bf5b5-4a72-4f94-a10c-d2a3741cdf75",
   801          "version": 1
   802      }
   803  
   804  
   805  Rollback Release
   806  ````````````````
   807  
   808  Example Request:
   809  
   810  .. code-block:: console
   811  
   812      POST /v1/apps/example-go/releases/rollback/ HTTP/1.1
   813      Host: deis.example.com
   814      Content-Type: application/json
   815      Authorization: token abc123
   816  
   817      {"version": 1}
   818  
   819  Example Response:
   820  
   821  .. code-block:: console
   822  
   823      HTTP/1.1 201 CREATED
   824      X_DEIS_API_VERSION: 1.1
   825      X_DEIS_PLATFORM_VERSION: 1.3.1
   826      Content-Type: application/json
   827  
   828      {"version": 5}
   829  
   830  
   831  Keys
   832  ----
   833  
   834  
   835  List Keys
   836  `````````
   837  
   838  Example Request:
   839  
   840  .. code-block:: console
   841  
   842      GET /v1/keys/ HTTP/1.1
   843      Host: deis.example.com
   844      Authorization: token abc123
   845  
   846  Example Response:
   847  
   848  .. code-block:: console
   849  
   850      {
   851      X_DEIS_API_VERSION: 1.1
   852      X_DEIS_PLATFORM_VERSION: 1.3.1
   853          "count": 1,
   854          "next": null,
   855          "previous": null,
   856          "results": [
   857              {
   858                  "created": "2014-01-01T00:00:00UTC",
   859                  "id": "test@example.com",
   860                  "owner": "test",
   861                  "public": "ssh-rsa <...>",
   862                  "updated": "2014-01-01T00:00:00UTC",
   863                  "uuid": "de1bf5b5-4a72-4f94-a10c-d2a3741cdf75"
   864              }
   865          ]
   866      }
   867  
   868  
   869  Add Key to User
   870  ```````````````
   871  
   872  Example Request:
   873  
   874  .. code-block:: console
   875  
   876      POST /v1/keys/ HTTP/1.1
   877      Host: deis.example.com
   878      Authorization: token abc123
   879  
   880      {
   881          "id": "example",
   882          "public": "ssh-rsa <...>"
   883      }
   884  
   885  Example Response:
   886  
   887  .. code-block:: console
   888  
   889      HTTP/1.1 201 CREATED
   890      X_DEIS_API_VERSION: 1.1
   891      X_DEIS_PLATFORM_VERSION: 1.3.1
   892      Content-Type: application/json
   893  
   894      {
   895          "created": "2014-01-01T00:00:00UTC",
   896          "id": "example",
   897          "owner": "example",
   898          "public": "ssh-rsa <...>",
   899          "updated": "2014-01-01T00:00:00UTC",
   900          "uuid": "de1bf5b5-4a72-4f94-a10c-d2a3741cdf75"
   901      }
   902  
   903  
   904  Remove Key from User
   905  ````````````````````
   906  
   907  Example Request:
   908  
   909  .. code-block:: console
   910  
   911      DELETE /v1/keys/example HTTP/1.1
   912      Host: deis.example.com
   913      Authorization: token abc123
   914  
   915  Example Response:
   916  
   917  .. code-block:: console
   918  
   919      HTTP/1.1 204 NO CONTENT
   920      X_DEIS_API_VERSION: 1.1
   921      X_DEIS_PLATFORM_VERSION: 1.3.1
   922  
   923  
   924  Permissions
   925  -----------
   926  
   927  
   928  List Application Permissions
   929  ````````````````````````````
   930  
   931  Example Request:
   932  
   933  .. code-block:: console
   934  
   935      GET /v1/apps/example-go/perms/ HTTP/1.1
   936      Host: deis.example.com
   937      Authorization: token abc123
   938  
   939  Example Response:
   940  
   941  .. code-block:: console
   942  
   943      HTTP/1.1 200 OK
   944      X_DEIS_API_VERSION: 1.1
   945      X_DEIS_PLATFORM_VERSION: 1.3.1
   946      Content-Type: application/json
   947  
   948      {
   949          "users": []
   950      }
   951  
   952  
   953  Create Application Permission
   954  `````````````````````````````
   955  
   956  Example Request:
   957  
   958  .. code-block:: console
   959  
   960      POST /v1/apps/example-go/perms/ HTTP/1.1
   961      Host: deis.example.com
   962      Authorization: token abc123
   963  
   964      {"username": "example"}
   965  
   966  Example Response:
   967  
   968  .. code-block:: console
   969  
   970      HTTP/1.1 201 CREATED
   971      X_DEIS_API_VERSION: 1.1
   972      X_DEIS_PLATFORM_VERSION: 1.3.1
   973  
   974  
   975  Remove Application Permission
   976  `````````````````````````````
   977  
   978  Example Request:
   979  
   980  .. code-block:: console
   981  
   982      POST /v1/apps/example-go/perms/example HTTP/1.1
   983      Host: deis.example.com
   984      Authorization: token abc123
   985  
   986  Example Response:
   987  
   988  .. code-block:: console
   989  
   990      HTTP/1.1 204 NO CONTENT
   991      X_DEIS_API_VERSION: 1.1
   992      X_DEIS_PLATFORM_VERSION: 1.3.1
   993  
   994  Grant User Administrative Privileges
   995  ````````````````````````````````````
   996  
   997  .. note::
   998  
   999      This command requires administrative privileges
  1000  
  1001  Example Request:
  1002  
  1003  .. code-block:: console
  1004  
  1005      POST /v1/admin/perms HTTP/1.1
  1006      Host: deis.example.com
  1007      Authorization: token abc123
  1008  
  1009      {"username": "example"}
  1010  
  1011  Example Response:
  1012  
  1013  .. code-block:: console
  1014  
  1015      HTTP/1.1 201 CREATED
  1016      X_DEIS_API_VERSION: 1.1
  1017      X_DEIS_PLATFORM_VERSION: 1.3.1