The following pull request was submitted through Github. It can be accessed and reviewed at: https://github.com/lxc/lxd/pull/1922
This e-mail was sent by the LXC bot, direct replies will not reach the author unless they happen to be subscribed to this list. === Description (from pull-request) ===
From 27b84d63adb961d9988fd2494a0bd38433621242 Mon Sep 17 00:00:00 2001 From: Daniel Middleton <mono...@users.noreply.github.com> Date: Fri, 22 Apr 2016 21:01:59 +0100 Subject: [PATCH] Add basic REST API usage example to README.md --- README.md | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/README.md b/README.md index e9c8983..5a77a74 100644 --- a/README.md +++ b/README.md @@ -28,6 +28,39 @@ shell you're going to interact with lxd from. After you've got LXD installed and a session with the right permissions, you can take your [first steps](#first-steps). +## Using the REST API directly +Here's a simple example of REST API usage via cURL: +```bash +curl -k -L -I \ + --cert ${LXD_API_CRT} \ + --key ${LXD_API_KEY} \ + -H "Content-Type: application/json" \ + -X POST \ + -d @hello-ubuntu.json \ + "${LXD_API_URL}/containers" +``` +where `hello-ubuntu.json` could contain: +```json +{ + "name":"some-ubuntu", + "architecture":"x86_64", + "profiles":[ + "default" + ], + "ephemeral":true, + "config":{ + "limits.cpu":"2" + }, + "source": { + "type":"image", + "mode":"pull", + "protocol":"simplestreams", + "server":"https://cloud-images.ubuntu.com/releases", + "alias":"14.04" + } +} +``` + ## Building from source We recommend having the latest versions of liblxc (>= 1.1 required) and CRIU
_______________________________________________ lxc-devel mailing list lxc-devel@lists.linuxcontainers.org http://lists.linuxcontainers.org/listinfo/lxc-devel