Applications are your personal best practice environments base on a Template Version. You do have full root access to these environments. So if you feel you need some DRY, go ahead, create an Application out of an Ubuntu Base Template and install any Software by yourself ;)
Now that we have found our perfect Template Version in the previous chapter it is time to create our own Application out of it. The URL for this call was provided by the call of the root endpoint, identified by the relation applications.
$ curl -i -u demo:demo -X POST -H "Content-Type: application/json" https://d9tready.com/rest/applications -d '{"name": "MyPlone", "from_template": "d9t:precise:plone:433"}'
HTTP/1.0 201 CREATED
Date: Fri, 29 Aug 2014 09:38:08 GMT
Server: WSGIServer/0.1 Python/2.7.6
Vary: Accept, Accept-Language, Cookie
Content-Language: en
Location: https://d9tready.com/rest/applications/dd9d5f2be229e70947c4bffc7a22675cb0674406dabc902d59cb9ae1c5e5787f
Allow: GET, POST, HEAD, OPTIONS
The request above created a new Application based on the given Template name. Watch for the Location inside the response for the URL to the new Application.
Alternatively to the provided Location in the response header we can have a look at the list of our Applications to see our newly created one. The URL for this call was provided by the call of the root endpoint, identified by the relation applications.
$ curl -u demo:demo https://d9tready.com/rest/applications
[
{
"id": "43678cada57a6b839653929905ff90129ab78c9e64cb6f5756ccacabc1f34a59",
"name": "MyPlone",
"created": "2014-08-29T11:53:54",
"up": true,
"_links":
[
{
"href": "https://d9tready.com/rest/applications/43678cada57a6b839653929905ff90129ab78c9e64cb6f5756ccacabc1f34a59",
"rel": "self"
},
{
"href": "https://d9tready.com/rest/applications/43678cada57a6b839653929905ff90129ab78c9e64cb6f5756ccacabc1f34a59/credentials",
"rel": "credentials"
},
{
"href": "https://d9tready.com/rest/applications/43678cada57a6b839653929905ff90129ab78c9e64cb6f5756ccacabc1f34a59/firewall",
"rel": "firewall"
},
{
"href": "https://d9tready.com/rest/applications/43678cada57a6b839653929905ff90129ab78c9e64cb6f5756ccacabc1f34a59/domains",
"rel": "domains"
}
]
},
...
]
coming soon... (see Application Resource in our REST API Documentation until then)
Finally after heavy playing with our Application we are ready to get rid of it.
$ curl -u demo:demo -X DELETE https://d9tready.com/rest/applications/dd9d5f2be229e70947c4bffc7a22675cb0674406dabc902d59cb9ae1c5e5787f
HTTP/1.0 204 NO CONTENT
Date: Fri, 29 Aug 2014 09:49:33 GMT
Server: WSGIServer/0.1 Python/2.7.6
Vary: Accept, Accept-Language, Cookie
Content-Length: 0
Content-Language: en
Allow: GET, PUT, DELETE, HEAD, OPTIONS
Now that we know how to create and delete Applications we can go on to the next Chapter and see how we can set up the firewall for opening our services to the outside world.