Docker-py: API for docker-inspect

Created on 14 Sep 2017  路  4Comments  路  Source: docker/docker-py

Currently, there doesn't seem to be any way to access the information returned by docker-inspect via docker-py. This makes using docker-py for testing containers difficult, as there's no good way to inspect things like the exit codes that are in the inspect json.

kinquestion

All 4 comments

Brilliant, I'd missed that. Since it directly mimics part of the docker CLI, is there a reason it's not in the high-level API?

@treuherz You can access the inspect data using the attrs attribute on all model objects (e.g. https://docker-py.readthedocs.io/en/stable/networks.html#docker.models.networks.Network.attrs)

Great, hadn't caught that before. Does this #1375 not still make that unreliable, though?

EDIT: I see Container has a reload() method for that purpose. Documentation on attrs is pretty lacking, though. Thanks for pointing it out.

Was this page helpful?
0 / 5 - 0 ratings