Skip to content

Instantly share code, notes, and snippets.

@jaytaylor
Created March 4, 2018 22:56
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jaytaylor/56a9989c9e974960200ea1be64396b03 to your computer and use it in GitHub Desktop.
Save jaytaylor/56a9989c9e974960200ea1be64396b03 to your computer and use it in GitHub Desktop.
HOWTO: Curl the LXD unix.socket file.

It is possible to use curl to query the LXD unix.socket directly:

curl --unix-socket /var/lib/lxd/unix.socket http:/1.0/containers | jq .

Example output:

{
  "type": "sync",
  "status": "Success",
  "status_code": 200,
  "operation": "",
  "error_code": 0,
  "error": "",
  "metadata": [
    "/1.0/containers/base",
    "/1.0/containers/jay-test-99",
    "/1.0/containers/jays-awesome-container-2"
  ]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment