Move types.Volumes optional fields under a new type

This allows us to hide those fields when they are not filled.

Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
Upstream-commit: d36952749d7db1a7dac40f7ddf3ed485f23b33fc
Component: engine
This commit is contained in:
Kenfe-Mickael Laventure
2016-10-11 11:49:26 -07:00
parent 2ab4700a6d
commit 3dd231fb94
5 changed files with 21 additions and 19 deletions

View File

@ -433,6 +433,12 @@ type MountPoint struct {
Propagation mount.Propagation
}
// VolumeUsageData holds information regarding the volume usage
type VolumeUsageData struct {
Size int64 // Size holds how much disk space is used by the (local driver only). Sets to -1 if not provided.
RefCount int // RefCount holds the number of containers having this volume attached to them. Sets to -1 if not provided.
}
// Volume represents the configuration of a volume for the remote API
type Volume struct {
Name string // Name is the name of the volume
@ -441,8 +447,7 @@ type Volume struct {
Status map[string]interface{} `json:",omitempty"` // Status provides low-level status information about the volume
Labels map[string]string // Labels is metadata specific to the volume
Scope string // Scope describes the level at which the volume exists (e.g. `global` for cluster-wide or `local` for machine level)
Size int64 // Size holds how much disk space is used by the (local driver only). Sets to -1 if not provided.
RefCount int // RefCount holds the number of containers having this volume attached to them. Sets to -1 if not provided.
UsageData *VolumeUsageData `json:",omitempty"`
}
// VolumesListResponse contains the response for the remote API: