Closed DilipRenkila closed 8 years ago
/1.0/info is an endpoint that you can only use after you started a container. It returns the exact same information as you get back on a successful container startup.
It's used to allow the user to re-attach to an existing container by just keeping the container uuid around.
Example:
stgraber@castiana:~/data/code/lxc/lxd-demo-server (master)$ curl http://lxd-demo01.srv.mtl:8080/1.0 -s | jq .
{
"client_address": "2607:f2c0:f00f:2700:6257:18ff:fef0:c201",
"client_protocol": "IPv6",
"containers_count": 0,
"containers_max": 100,
"containers_next": 0,
"server_console_only": false,
"server_ipv6_only": true,
"server_status": 0
}
stgraber@castiana:~/data/code/lxc/lxd-demo-server (master)$ curl http://lxd-demo01.srv.mtl:8080/1.0/terms -s | jq .
{
"hash": "cdc4b35091fec84631f4d3d4fb626f34c4acb815fa2df7af17a51cecc888d5a1",
"terms": "By using the LXD demonstration server, you agree that:<br />\n<ul>\n <li>Access to this service may be revoked at any time for any reason</li>\n <li>Access to this service is solely provided to evaluate LXD</li>\n <li>Your IP address, access time and activity on the test server may be recorded</li>\n <li>Any abuse of this service may lead to a ban or other applicable actions</li>\n</ul>\n\nThe demo environment comes with the following restrictions:<br />\n<ul>\n <li>30 minutes limit per session</li>\n <li>Limit of 5 sessions per IP</li>\n <li>1 shared CPU core</li>\n <li>256MB of dedicated memory</li>\n <li>5GB of dedicated disk space</li>\n <li>IPv6 only network connectivty with limited connectivity (whitelist)</li>\n</ul>"
}
stgraber@castiana:~/data/code/lxc/lxd-demo-server (master)$ curl http://lxd-demo01.srv.mtl:8080/1.0/start?terms=cdc4b35091fec84631f4d3d4fb626f34c4acb815fa2df7af17a51cecc888d5a1 -s | jq .
{
"expiry": 1458315906,
"fqdn": "tryit-coalier.lxd",
"id": "7bac8884-c432-48c2-a030-401b6405f899",
"ip": "2607:f2c0:f00f:2770:216:3eff:fecb:d1da",
"password": "waterlocked",
"status": 0,
"username": "uncognized"
}
stgraber@castiana:~/data/code/lxc/lxd-demo-server (master)$ curl http://lxd-demo01.srv.mtl:8080/1.0/info?id=7bac8884-c432-48c2-a030-401b6405f899 -s | jq .
{
"expiry": 1458315906,
"fqdn": "tryit-coalier.lxd",
"id": "7bac8884-c432-48c2-a030-401b6405f899",
"ip": "2607:f2c0:f00f:2770:216:3eff:fecb:d1da",
"password": "waterlocked",
"status": 0,
"username": "uncognized"
}
In this example I query the server status, then the terms, I get the current version of the terms which I then pass to /start (confirming I've read them), a container is created for me that I could connect to and I then use /info to get that same information again just from the container id.
*****My config file
*** $ lxc list
** i contain container named ''u1'' but while curling i get the following error ***_curl http://localhost:8080/1.0/info ) *_\ Container not found I want to know the mistake i did and how to write the config file?