Pylxd

From UVOO Tech Wiki
Revision as of 15:46, 24 March 2020 by Busk (talk | contribs) (Created page with "# Snippets ## Get IP addresses on container ``` #!usr/bin/env python3 from pylxd import Client client = Client() for p in client.containers.all(): print(p.name, p.state().net...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Snippets

Get IP addresses on container

#!usr/bin/env python3
from pylxd import Client
client = Client()
for p in client.containers.all(): print(p.name, p.state().network['eth0']['addresses'][0]['address'])