Database

POST /(db)

Create a new Container

Creates a new container on the database

  • Permission: guillotina.AddContainer
  • Context: guillotina.interfaces.content.IDatabase

http

POST /db HTTP/1.1
Accept: application/json
Authorization: Basic cm9vdDpyb290
Content-Type: application/json

{
    "@type": "Container",
    "id": "container"
}

curl

curl -i -X POST http://nohost/db -H 'Accept: application/json' -H 'Content-Type: application/json' --data-raw '{"@type": "Container", "id": "container"}' --user root:root

httpie

echo '{
  "@type": "Container",
  "id": "container"
}' | http POST http://nohost/db Accept:application/json Content-Type:application/json -a root:root

response

HTTP/1.1 200 OK
Content-Type: application/json
Location: /db/container

{
    "@type": "Container",
    "id": "container",
    "title": "container"
}
Status Codes:

GET /(db)

Get list of containers

  • Permission: guillotina.GetContainers
  • Context: guillotina.interfaces.content.IDatabase

http

GET /db HTTP/1.1
Accept: application/json
Authorization: Basic cm9vdDpyb290

curl

curl -i http://nohost/db -H 'Accept: application/json' --user root:root

httpie

http http://nohost/db Accept:application/json -a root:root

response

HTTP/1.1 200 OK
Content-Type: application/json

{
    "containers": [
        "container"
    ],
    "@type": "Database"
}
Status Codes: