Skip to content

Administration API

Dominik Burgdörfer edited this page Jun 6, 2016 · 4 revisions

This document describes the API used to administrate clusters, websites and users.

Resources

GET /users

This resource returns the users of the platform.

Query params

  • type - Filter for user type (administrator, owner, user)
  • website - Only show user for website

Status codes

  • 200

POST /users

This endpoint creates a new user. If the requesting user is an owner, the resulting user is automatically assigned to its first website or the requested.

Query params

  • website - The website to assign the user to (If the requesting user is an administrator or the owner of the site).

Body

  • name - The display name of the user.
  • isActive - Bool that describes if the user is active and can login (true [default], false)
  • type - The type of the user (administrator, owner, user [default]).
  • email - The email address of the user (must be unique).

Status codes

  • 201 - The user was successfully created.
  • 403 - You're not authorized to create this user.

PUT /users/:id

Update a user. See POST /users.

DELETE /users/:id

Removes an user.

GET /websites

Receive websites.

POST /websites

Creates a new website. This can currently only be executed by administrators.

Body

  • users - Array of user ids that can edit the website.
  • owner - The user id of the owner.
  • deployment
    • method - The method describing the deployment process (s3 [default])
    • options - Optional options for the driver.

See drivers.

PUT /websites/:id

Updates an existing website. See POST /websites.

DELETE /websites/:id

Removes a website.

POST /websites/:id/deploy

Deploy a new version of the website. See deployment.

Body (multipart/form-data)

This is better described in an example. See the discussion about pages and components.

Content-Type: multipart/form-data; boundary=---------------------------9051914041544843365972754266
Content-Length: ...

-----------------------------9051914041544843365972754266
Content-Disposition: form-data; name="pages/my-page"; filename="my-page.html"
Content-Type: text/html

<html>
  <head>blabla</head>
  <body>
    my page content
  </body>
</html>
-----------------------------9051914041544843365972754266
Content-Disposition: form-data; name="objects/my-object-type"; filename="edit.html"
Content-Type: text/html

...
-----------------------------9051914041544843365972754266
Content-Disposition: form-data; name="components/MyComponent"; filename="my_component.js"
Content-Type: application/javascript

...
-----------------------------9051914041544843365972754266--

Clone this wiki locally