mirror of
https://github.com/moby/moby.git
synced 2026-08-03 22:51:03 +00:00
Add support for Names and ID in stats format
This adds support to display names or id of container instead of what was provided in the request. This keeps the default behavior (`docker stats byname` will display `byname` in the `CONTAINER` colmun and `docker stats byid` will display the id in the `CONTAINER` column) but adds two new format directive. Signed-off-by: Vincent Demeester <vincent@sbr.pm>
This commit is contained in:
@@ -170,6 +170,9 @@ type Stats struct {
|
||||
type StatsJSON struct {
|
||||
Stats
|
||||
|
||||
Name string `json:"name,omitempty"`
|
||||
ID string `json:"id,omitempty"`
|
||||
|
||||
// Networks request version >=1.21
|
||||
Networks map[string]NetworkStats `json:"networks,omitempty"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user