Browse code

api/types: move disk usage structs to per type packages

Signed-off-by: Austin Vazquez <austin.vazquez@docker.com>

Austin Vazquez authored on 2025/11/06 01:00:05
Showing 23 changed files
... ...
@@ -2061,8 +2061,10 @@ definitions:
2061 2061
 
2062 2062
   ImagesDiskUsage:
2063 2063
     type: "object"
2064
+    x-go-name: "DiskUsage"
2065
+    x-go-package: "github.com/moby/moby/api/types/image"
2064 2066
     description: |
2065
-      ImagesDiskUsage represents system data usage for image resources.
2067
+      represents system data usage for image resources.
2066 2068
     properties:
2067 2069
       ActiveImages:
2068 2070
         description: |
... ...
@@ -2097,8 +2099,6 @@ definitions:
2097 2097
           x-nullable: true
2098 2098
           x-go-type:
2099 2099
             type: Summary
2100
-            import:
2101
-              package: github.com/moby/moby/api/types/image
2102 2100
 
2103 2101
   AuthConfig:
2104 2102
     type: "object"
... ...
@@ -2244,8 +2244,10 @@ definitions:
2244 2244
 
2245 2245
   VolumesDiskUsage:
2246 2246
     type: "object"
2247
+    x-go-name: "DiskUsage"
2248
+    x-go-package: "github.com/moby/moby/api/types/volume"
2247 2249
     description: |
2248
-      VolumesDiskUsage represents system data usage for volume resources.
2250
+      represents system data usage for volume resources.
2249 2251
     properties:
2250 2252
       ActiveVolumes:
2251 2253
         description: |
... ...
@@ -2280,8 +2282,6 @@ definitions:
2280 2280
           x-nullable: true
2281 2281
           x-go-type:
2282 2282
             type: Volume
2283
-            import:
2284
-              package: github.com/moby/moby/api/types/volume
2285 2283
 
2286 2284
   VolumeCreateRequest:
2287 2285
     description: "Volume configuration"
... ...
@@ -2858,8 +2858,10 @@ definitions:
2858 2858
 
2859 2859
   BuildCacheDiskUsage:
2860 2860
     type: "object"
2861
+    x-go-name: "DiskUsage"
2862
+    x-go-package: "github.com/moby/moby/api/types/build"
2861 2863
     description: |
2862
-      BuildCacheDiskUsage represents system data usage for build cache resources.
2864
+      represents system data usage for build cache resources.
2863 2865
     properties:
2864 2866
       ActiveBuildCacheRecords:
2865 2867
         description: |
... ...
@@ -2894,8 +2896,6 @@ definitions:
2894 2894
           x-nullable: true
2895 2895
           x-go-type:
2896 2896
             type: CacheRecord
2897
-            import:
2898
-              package: github.com/moby/moby/api/types/build
2899 2897
 
2900 2898
   ImageID:
2901 2899
     type: "object"
... ...
@@ -5582,8 +5582,10 @@ definitions:
5582 5582
 
5583 5583
   ContainersDiskUsage:
5584 5584
     type: "object"
5585
+    x-go-name: "DiskUsage"
5586
+    x-go-package: "github.com/moby/moby/api/types/container"
5585 5587
     description: |
5586
-      ContainersDiskUsage provides system data usage information for container resources.
5588
+      represents system data usage information for container resources.
5587 5589
     properties:
5588 5590
       ActiveContainers:
5589 5591
         description: |
... ...
@@ -5618,8 +5620,6 @@ definitions:
5618 5618
           x-nullable: true
5619 5619
           x-go-type:
5620 5620
             type: Summary
5621
-            import:
5622
-              package: github.com/moby/moby/api/types/container
5623 5621
 
5624 5622
   Driver:
5625 5623
     description: "Driver represents a driver (network, logging, secrets)."
... ...
@@ -2061,8 +2061,10 @@ definitions:
2061 2061
 
2062 2062
   ImagesDiskUsage:
2063 2063
     type: "object"
2064
+    x-go-name: "DiskUsage"
2065
+    x-go-package: "github.com/moby/moby/api/types/image"
2064 2066
     description: |
2065
-      ImagesDiskUsage represents system data usage for image resources.
2067
+      represents system data usage for image resources.
2066 2068
     properties:
2067 2069
       ActiveImages:
2068 2070
         description: |
... ...
@@ -2097,8 +2099,6 @@ definitions:
2097 2097
           x-nullable: true
2098 2098
           x-go-type:
2099 2099
             type: Summary
2100
-            import:
2101
-              package: github.com/moby/moby/api/types/image
2102 2100
 
2103 2101
   AuthConfig:
2104 2102
     type: "object"
... ...
@@ -2244,8 +2244,10 @@ definitions:
2244 2244
 
2245 2245
   VolumesDiskUsage:
2246 2246
     type: "object"
2247
+    x-go-name: "DiskUsage"
2248
+    x-go-package: "github.com/moby/moby/api/types/volume"
2247 2249
     description: |
2248
-      VolumesDiskUsage represents system data usage for volume resources.
2250
+      represents system data usage for volume resources.
2249 2251
     properties:
2250 2252
       ActiveVolumes:
2251 2253
         description: |
... ...
@@ -2280,8 +2282,6 @@ definitions:
2280 2280
           x-nullable: true
2281 2281
           x-go-type:
2282 2282
             type: Volume
2283
-            import:
2284
-              package: github.com/moby/moby/api/types/volume
2285 2283
 
2286 2284
   VolumeCreateRequest:
2287 2285
     description: "Volume configuration"
... ...
@@ -2858,8 +2858,10 @@ definitions:
2858 2858
 
2859 2859
   BuildCacheDiskUsage:
2860 2860
     type: "object"
2861
+    x-go-name: "DiskUsage"
2862
+    x-go-package: "github.com/moby/moby/api/types/build"
2861 2863
     description: |
2862
-      BuildCacheDiskUsage represents system data usage for build cache resources.
2864
+      represents system data usage for build cache resources.
2863 2865
     properties:
2864 2866
       ActiveBuildCacheRecords:
2865 2867
         description: |
... ...
@@ -2894,8 +2896,6 @@ definitions:
2894 2894
           x-nullable: true
2895 2895
           x-go-type:
2896 2896
             type: CacheRecord
2897
-            import:
2898
-              package: github.com/moby/moby/api/types/build
2899 2897
 
2900 2898
   ImageID:
2901 2899
     type: "object"
... ...
@@ -5582,8 +5582,10 @@ definitions:
5582 5582
 
5583 5583
   ContainersDiskUsage:
5584 5584
     type: "object"
5585
+    x-go-name: "DiskUsage"
5586
+    x-go-package: "github.com/moby/moby/api/types/container"
5585 5587
     description: |
5586
-      ContainersDiskUsage provides system data usage information for container resources.
5588
+      represents system data usage information for container resources.
5587 5589
     properties:
5588 5590
       ActiveContainers:
5589 5591
         description: |
... ...
@@ -5618,8 +5620,6 @@ definitions:
5618 5618
           x-nullable: true
5619 5619
           x-go-type:
5620 5620
             type: Summary
5621
-            import:
5622
-              package: github.com/moby/moby/api/types/container
5623 5621
 
5624 5622
   Driver:
5625 5623
     description: "Driver represents a driver (network, logging, secrets)."
5626 5624
new file mode 100644
... ...
@@ -0,0 +1,36 @@
0
+// Code generated by go-swagger; DO NOT EDIT.
1
+
2
+package build
3
+
4
+// This file was generated by the swagger tool.
5
+// Editing this file might prove futile when you re-run the swagger generate command
6
+
7
+// DiskUsage represents system data usage for build cache resources.
8
+//
9
+// swagger:model DiskUsage
10
+type DiskUsage struct {
11
+
12
+	// Count of active build cache records.
13
+	//
14
+	// Example: 1
15
+	ActiveBuildCacheRecords int64 `json:"ActiveBuildCacheRecords,omitempty"`
16
+
17
+	// List of build cache records.
18
+	//
19
+	Items []*CacheRecord `json:"Items,omitempty"`
20
+
21
+	// Disk space that can be reclaimed by removing inactive build cache records.
22
+	//
23
+	// Example: 12345678
24
+	Reclaimable int64 `json:"Reclaimable,omitempty"`
25
+
26
+	// Count of all build cache records.
27
+	//
28
+	// Example: 4
29
+	TotalBuildCacheRecords int64 `json:"TotalBuildCacheRecords,omitempty"`
30
+
31
+	// Disk space in use by build cache records.
32
+	//
33
+	// Example: 98765432
34
+	TotalSize int64 `json:"TotalSize,omitempty"`
35
+}
0 36
new file mode 100644
... ...
@@ -0,0 +1,36 @@
0
+// Code generated by go-swagger; DO NOT EDIT.
1
+
2
+package container
3
+
4
+// This file was generated by the swagger tool.
5
+// Editing this file might prove futile when you re-run the swagger generate command
6
+
7
+// DiskUsage represents system data usage information for container resources.
8
+//
9
+// swagger:model DiskUsage
10
+type DiskUsage struct {
11
+
12
+	// Count of active containers.
13
+	//
14
+	// Example: 1
15
+	ActiveContainers int64 `json:"ActiveContainers,omitempty"`
16
+
17
+	// List of container summaries.
18
+	//
19
+	Items []*Summary `json:"Items,omitempty"`
20
+
21
+	// Disk space that can be reclaimed by removing inactive containers.
22
+	//
23
+	// Example: 12345678
24
+	Reclaimable int64 `json:"Reclaimable,omitempty"`
25
+
26
+	// Count of all containers.
27
+	//
28
+	// Example: 4
29
+	TotalContainers int64 `json:"TotalContainers,omitempty"`
30
+
31
+	// Disk space in use by containers.
32
+	//
33
+	// Example: 98765432
34
+	TotalSize int64 `json:"TotalSize,omitempty"`
35
+}
0 36
new file mode 100644
... ...
@@ -0,0 +1,36 @@
0
+// Code generated by go-swagger; DO NOT EDIT.
1
+
2
+package image
3
+
4
+// This file was generated by the swagger tool.
5
+// Editing this file might prove futile when you re-run the swagger generate command
6
+
7
+// DiskUsage represents system data usage for image resources.
8
+//
9
+// swagger:model DiskUsage
10
+type DiskUsage struct {
11
+
12
+	// Count of active images.
13
+	//
14
+	// Example: 1
15
+	ActiveImages int64 `json:"ActiveImages,omitempty"`
16
+
17
+	// List of image summaries.
18
+	//
19
+	Items []*Summary `json:"Items,omitempty"`
20
+
21
+	// Disk space that can be reclaimed by removing unused images.
22
+	//
23
+	// Example: 12345678
24
+	Reclaimable int64 `json:"Reclaimable,omitempty"`
25
+
26
+	// Count of all images.
27
+	//
28
+	// Example: 4
29
+	TotalImages int64 `json:"TotalImages,omitempty"`
30
+
31
+	// Disk space in use by images.
32
+	//
33
+	// Example: 98765432
34
+	TotalSize int64 `json:"TotalSize,omitempty"`
35
+}
0 36
deleted file mode 100644
... ...
@@ -1,40 +0,0 @@
1
-// Code generated by go-swagger; DO NOT EDIT.
2
-
3
-package system
4
-
5
-// This file was generated by the swagger tool.
6
-// Editing this file might prove futile when you re-run the swagger generate command
7
-
8
-import (
9
-	"github.com/moby/moby/api/types/build"
10
-)
11
-
12
-// BuildCacheDiskUsage BuildCacheDiskUsage represents system data usage for build cache resources.
13
-//
14
-// swagger:model BuildCacheDiskUsage
15
-type BuildCacheDiskUsage struct {
16
-
17
-	// Count of active build cache records.
18
-	//
19
-	// Example: 1
20
-	ActiveBuildCacheRecords int64 `json:"ActiveBuildCacheRecords,omitempty"`
21
-
22
-	// List of build cache records.
23
-	//
24
-	Items []*build.CacheRecord `json:"Items,omitempty"`
25
-
26
-	// Disk space that can be reclaimed by removing inactive build cache records.
27
-	//
28
-	// Example: 12345678
29
-	Reclaimable int64 `json:"Reclaimable,omitempty"`
30
-
31
-	// Count of all build cache records.
32
-	//
33
-	// Example: 4
34
-	TotalBuildCacheRecords int64 `json:"TotalBuildCacheRecords,omitempty"`
35
-
36
-	// Disk space in use by build cache records.
37
-	//
38
-	// Example: 98765432
39
-	TotalSize int64 `json:"TotalSize,omitempty"`
40
-}
41 1
deleted file mode 100644
... ...
@@ -1,40 +0,0 @@
1
-// Code generated by go-swagger; DO NOT EDIT.
2
-
3
-package system
4
-
5
-// This file was generated by the swagger tool.
6
-// Editing this file might prove futile when you re-run the swagger generate command
7
-
8
-import (
9
-	"github.com/moby/moby/api/types/container"
10
-)
11
-
12
-// ContainersDiskUsage ContainersDiskUsage provides system data usage information for container resources.
13
-//
14
-// swagger:model ContainersDiskUsage
15
-type ContainersDiskUsage struct {
16
-
17
-	// Count of active containers.
18
-	//
19
-	// Example: 1
20
-	ActiveContainers int64 `json:"ActiveContainers,omitempty"`
21
-
22
-	// List of container summaries.
23
-	//
24
-	Items []*container.Summary `json:"Items,omitempty"`
25
-
26
-	// Disk space that can be reclaimed by removing inactive containers.
27
-	//
28
-	// Example: 12345678
29
-	Reclaimable int64 `json:"Reclaimable,omitempty"`
30
-
31
-	// Count of all containers.
32
-	//
33
-	// Example: 4
34
-	TotalContainers int64 `json:"TotalContainers,omitempty"`
35
-
36
-	// Disk space in use by containers.
37
-	//
38
-	// Example: 98765432
39
-	TotalSize int64 `json:"TotalSize,omitempty"`
40
-}
... ...
@@ -26,10 +26,10 @@ const (
26 26
 type DiskUsage struct {
27 27
 	LegacyDiskUsage
28 28
 
29
-	ImageUsage      *ImagesDiskUsage     `json:"ImageUsage,omitempty"`
30
-	ContainerUsage  *ContainersDiskUsage `json:"ContainerUsage,omitempty"`
31
-	VolumeUsage     *VolumesDiskUsage    `json:"VolumeUsage,omitempty"`
32
-	BuildCacheUsage *BuildCacheDiskUsage `json:"BuildCacheUsage,omitempty"`
29
+	ImageUsage      *image.DiskUsage     `json:"ImageUsage,omitempty"`
30
+	ContainerUsage  *container.DiskUsage `json:"ContainerUsage,omitempty"`
31
+	VolumeUsage     *volume.DiskUsage    `json:"VolumeUsage,omitempty"`
32
+	BuildCacheUsage *build.DiskUsage     `json:"BuildCacheUsage,omitempty"`
33 33
 }
34 34
 
35 35
 type LegacyDiskUsage struct {
36 36
deleted file mode 100644
... ...
@@ -1,40 +0,0 @@
1
-// Code generated by go-swagger; DO NOT EDIT.
2
-
3
-package system
4
-
5
-// This file was generated by the swagger tool.
6
-// Editing this file might prove futile when you re-run the swagger generate command
7
-
8
-import (
9
-	"github.com/moby/moby/api/types/image"
10
-)
11
-
12
-// ImagesDiskUsage ImagesDiskUsage represents system data usage for image resources.
13
-//
14
-// swagger:model ImagesDiskUsage
15
-type ImagesDiskUsage struct {
16
-
17
-	// Count of active images.
18
-	//
19
-	// Example: 1
20
-	ActiveImages int64 `json:"ActiveImages,omitempty"`
21
-
22
-	// List of image summaries.
23
-	//
24
-	Items []*image.Summary `json:"Items,omitempty"`
25
-
26
-	// Disk space that can be reclaimed by removing unused images.
27
-	//
28
-	// Example: 12345678
29
-	Reclaimable int64 `json:"Reclaimable,omitempty"`
30
-
31
-	// Count of all images.
32
-	//
33
-	// Example: 4
34
-	TotalImages int64 `json:"TotalImages,omitempty"`
35
-
36
-	// Disk space in use by images.
37
-	//
38
-	// Example: 98765432
39
-	TotalSize int64 `json:"TotalSize,omitempty"`
40
-}
41 1
deleted file mode 100644
... ...
@@ -1,40 +0,0 @@
1
-// Code generated by go-swagger; DO NOT EDIT.
2
-
3
-package system
4
-
5
-// This file was generated by the swagger tool.
6
-// Editing this file might prove futile when you re-run the swagger generate command
7
-
8
-import (
9
-	"github.com/moby/moby/api/types/volume"
10
-)
11
-
12
-// VolumesDiskUsage VolumesDiskUsage represents system data usage for volume resources.
13
-//
14
-// swagger:model VolumesDiskUsage
15
-type VolumesDiskUsage struct {
16
-
17
-	// Count of active volumes.
18
-	//
19
-	// Example: 1
20
-	ActiveVolumes int64 `json:"ActiveVolumes,omitempty"`
21
-
22
-	// List of volumes.
23
-	//
24
-	Items []*volume.Volume `json:"Items,omitempty"`
25
-
26
-	// Disk space that can be reclaimed by removing inactive volumes.
27
-	//
28
-	// Example: 12345678
29
-	Reclaimable int64 `json:"Reclaimable,omitempty"`
30
-
31
-	// Disk space in use by volumes.
32
-	//
33
-	// Example: 98765432
34
-	TotalSize int64 `json:"TotalSize,omitempty"`
35
-
36
-	// Count of all volumes.
37
-	//
38
-	// Example: 4
39
-	TotalVolumes int64 `json:"TotalVolumes,omitempty"`
40
-}
41 1
new file mode 100644
... ...
@@ -0,0 +1,36 @@
0
+// Code generated by go-swagger; DO NOT EDIT.
1
+
2
+package volume
3
+
4
+// This file was generated by the swagger tool.
5
+// Editing this file might prove futile when you re-run the swagger generate command
6
+
7
+// DiskUsage represents system data usage for volume resources.
8
+//
9
+// swagger:model DiskUsage
10
+type DiskUsage struct {
11
+
12
+	// Count of active volumes.
13
+	//
14
+	// Example: 1
15
+	ActiveVolumes int64 `json:"ActiveVolumes,omitempty"`
16
+
17
+	// List of volumes.
18
+	//
19
+	Items []*Volume `json:"Items,omitempty"`
20
+
21
+	// Disk space that can be reclaimed by removing inactive volumes.
22
+	//
23
+	// Example: 12345678
24
+	Reclaimable int64 `json:"Reclaimable,omitempty"`
25
+
26
+	// Disk space in use by volumes.
27
+	//
28
+	// Example: 98765432
29
+	TotalSize int64 `json:"TotalSize,omitempty"`
30
+
31
+	// Count of all volumes.
32
+	//
33
+	// Example: 4
34
+	TotalVolumes int64 `json:"TotalVolumes,omitempty"`
35
+}
... ...
@@ -28,7 +28,7 @@ func TestDiskUsage(t *testing.T) {
28 28
 		}
29 29
 
30 30
 		return mockJSONResponse(http.StatusOK, nil, system.DiskUsage{
31
-			ImageUsage: &system.ImagesDiskUsage{
31
+			ImageUsage: &image.DiskUsage{
32 32
 				ActiveImages: 0,
33 33
 				TotalImages:  0,
34 34
 				Reclaimable:  0,
... ...
@@ -13,10 +13,13 @@ import (
13 13
 	"github.com/moby/moby/api/pkg/authconfig"
14 14
 	"github.com/moby/moby/api/types"
15 15
 	buildtypes "github.com/moby/moby/api/types/build"
16
+	"github.com/moby/moby/api/types/container"
16 17
 	"github.com/moby/moby/api/types/events"
18
+	"github.com/moby/moby/api/types/image"
17 19
 	"github.com/moby/moby/api/types/registry"
18 20
 	"github.com/moby/moby/api/types/swarm"
19 21
 	"github.com/moby/moby/api/types/system"
22
+	"github.com/moby/moby/api/types/volume"
20 23
 	"github.com/moby/moby/v2/daemon/internal/compat"
21 24
 	"github.com/moby/moby/v2/daemon/internal/filters"
22 25
 	"github.com/moby/moby/v2/daemon/internal/timestamp"
... ...
@@ -216,7 +219,7 @@ func (s *systemRouter) getDiskUsage(ctx context.Context, w http.ResponseWriter,
216 216
 
217 217
 	var v system.DiskUsage
218 218
 	if systemDiskUsage != nil && systemDiskUsage.Images != nil {
219
-		v.ImageUsage = &system.ImagesDiskUsage{
219
+		v.ImageUsage = &image.DiskUsage{
220 220
 			ActiveImages: systemDiskUsage.Images.ActiveCount,
221 221
 			Reclaimable:  systemDiskUsage.Images.Reclaimable,
222 222
 			TotalImages:  systemDiskUsage.Images.TotalCount,
... ...
@@ -231,7 +234,7 @@ func (s *systemRouter) getDiskUsage(ctx context.Context, w http.ResponseWriter,
231 231
 		}
232 232
 	}
233 233
 	if systemDiskUsage != nil && systemDiskUsage.Containers != nil {
234
-		v.ContainerUsage = &system.ContainersDiskUsage{
234
+		v.ContainerUsage = &container.DiskUsage{
235 235
 			ActiveContainers: systemDiskUsage.Containers.ActiveCount,
236 236
 			Reclaimable:      systemDiskUsage.Containers.Reclaimable,
237 237
 			TotalContainers:  systemDiskUsage.Containers.TotalCount,
... ...
@@ -245,7 +248,7 @@ func (s *systemRouter) getDiskUsage(ctx context.Context, w http.ResponseWriter,
245 245
 		}
246 246
 	}
247 247
 	if systemDiskUsage != nil && systemDiskUsage.Volumes != nil {
248
-		v.VolumeUsage = &system.VolumesDiskUsage{
248
+		v.VolumeUsage = &volume.DiskUsage{
249 249
 			ActiveVolumes: systemDiskUsage.Volumes.ActiveCount,
250 250
 			TotalSize:     systemDiskUsage.Volumes.TotalSize,
251 251
 			Reclaimable:   systemDiskUsage.Volumes.Reclaimable,
... ...
@@ -259,7 +262,7 @@ func (s *systemRouter) getDiskUsage(ctx context.Context, w http.ResponseWriter,
259 259
 		}
260 260
 	}
261 261
 	if getBuildCache {
262
-		v.BuildCacheUsage = &system.BuildCacheDiskUsage{
262
+		v.BuildCacheUsage = &buildtypes.DiskUsage{
263 263
 			TotalBuildCacheRecords: int64(len(buildCache)),
264 264
 		}
265 265
 
... ...
@@ -37,6 +37,10 @@ generate_operation() {
37 37
 
38 38
 #region -------- Models --------
39 39
 
40
+generate_model types/build <<- 'EOT'
41
+	BuildCacheDiskUsage
42
+EOT
43
+
40 44
 generate_model types/common <<- 'EOT'
41 45
 	ErrorResponse
42 46
 	IDResponse
... ...
@@ -49,12 +53,14 @@ generate_model types/container <<- 'EOT'
49 49
 	ContainerUpdateResponse
50 50
 	ContainerWaitExitError
51 51
 	ContainerWaitResponse
52
+	ContainersDiskUsage
52 53
 	FilesystemChange
53 54
 	PortSummary
54 55
 EOT
55 56
 
56 57
 generate_model types/image <<- 'EOT'
57 58
 	ImageDeleteResponseItem
59
+	ImagesDiskUsage
58 60
 EOT
59 61
 #	ImageSummary
60 62
 # TODO: Restore when go-swagger is updated
... ...
@@ -95,13 +101,6 @@ generate_model types/storage <<- 'EOT'
95 95
 	Storage
96 96
 EOT
97 97
 
98
-generate_model types/system <<- 'EOT'
99
-	BuildCacheDiskUsage
100
-	ContainersDiskUsage
101
-	ImagesDiskUsage
102
-	VolumesDiskUsage
103
-EOT
104
-
105 98
 generate_model types/swarm <<- 'EOT'
106 99
 	ServiceCreateResponse
107 100
 	ServiceUpdateResponse
... ...
@@ -111,6 +110,7 @@ generate_model types/volume <<- 'EOT'
111 111
 	Volume
112 112
 	VolumeCreateRequest
113 113
 	VolumeListResponse
114
+	VolumesDiskUsage
114 115
 EOT
115 116
 
116 117
 #endregion
117 118
new file mode 100644
... ...
@@ -0,0 +1,36 @@
0
+// Code generated by go-swagger; DO NOT EDIT.
1
+
2
+package build
3
+
4
+// This file was generated by the swagger tool.
5
+// Editing this file might prove futile when you re-run the swagger generate command
6
+
7
+// DiskUsage represents system data usage for build cache resources.
8
+//
9
+// swagger:model DiskUsage
10
+type DiskUsage struct {
11
+
12
+	// Count of active build cache records.
13
+	//
14
+	// Example: 1
15
+	ActiveBuildCacheRecords int64 `json:"ActiveBuildCacheRecords,omitempty"`
16
+
17
+	// List of build cache records.
18
+	//
19
+	Items []*CacheRecord `json:"Items,omitempty"`
20
+
21
+	// Disk space that can be reclaimed by removing inactive build cache records.
22
+	//
23
+	// Example: 12345678
24
+	Reclaimable int64 `json:"Reclaimable,omitempty"`
25
+
26
+	// Count of all build cache records.
27
+	//
28
+	// Example: 4
29
+	TotalBuildCacheRecords int64 `json:"TotalBuildCacheRecords,omitempty"`
30
+
31
+	// Disk space in use by build cache records.
32
+	//
33
+	// Example: 98765432
34
+	TotalSize int64 `json:"TotalSize,omitempty"`
35
+}
0 36
new file mode 100644
... ...
@@ -0,0 +1,36 @@
0
+// Code generated by go-swagger; DO NOT EDIT.
1
+
2
+package container
3
+
4
+// This file was generated by the swagger tool.
5
+// Editing this file might prove futile when you re-run the swagger generate command
6
+
7
+// DiskUsage represents system data usage information for container resources.
8
+//
9
+// swagger:model DiskUsage
10
+type DiskUsage struct {
11
+
12
+	// Count of active containers.
13
+	//
14
+	// Example: 1
15
+	ActiveContainers int64 `json:"ActiveContainers,omitempty"`
16
+
17
+	// List of container summaries.
18
+	//
19
+	Items []*Summary `json:"Items,omitempty"`
20
+
21
+	// Disk space that can be reclaimed by removing inactive containers.
22
+	//
23
+	// Example: 12345678
24
+	Reclaimable int64 `json:"Reclaimable,omitempty"`
25
+
26
+	// Count of all containers.
27
+	//
28
+	// Example: 4
29
+	TotalContainers int64 `json:"TotalContainers,omitempty"`
30
+
31
+	// Disk space in use by containers.
32
+	//
33
+	// Example: 98765432
34
+	TotalSize int64 `json:"TotalSize,omitempty"`
35
+}
0 36
new file mode 100644
... ...
@@ -0,0 +1,36 @@
0
+// Code generated by go-swagger; DO NOT EDIT.
1
+
2
+package image
3
+
4
+// This file was generated by the swagger tool.
5
+// Editing this file might prove futile when you re-run the swagger generate command
6
+
7
+// DiskUsage represents system data usage for image resources.
8
+//
9
+// swagger:model DiskUsage
10
+type DiskUsage struct {
11
+
12
+	// Count of active images.
13
+	//
14
+	// Example: 1
15
+	ActiveImages int64 `json:"ActiveImages,omitempty"`
16
+
17
+	// List of image summaries.
18
+	//
19
+	Items []*Summary `json:"Items,omitempty"`
20
+
21
+	// Disk space that can be reclaimed by removing unused images.
22
+	//
23
+	// Example: 12345678
24
+	Reclaimable int64 `json:"Reclaimable,omitempty"`
25
+
26
+	// Count of all images.
27
+	//
28
+	// Example: 4
29
+	TotalImages int64 `json:"TotalImages,omitempty"`
30
+
31
+	// Disk space in use by images.
32
+	//
33
+	// Example: 98765432
34
+	TotalSize int64 `json:"TotalSize,omitempty"`
35
+}
0 36
deleted file mode 100644
... ...
@@ -1,40 +0,0 @@
1
-// Code generated by go-swagger; DO NOT EDIT.
2
-
3
-package system
4
-
5
-// This file was generated by the swagger tool.
6
-// Editing this file might prove futile when you re-run the swagger generate command
7
-
8
-import (
9
-	"github.com/moby/moby/api/types/build"
10
-)
11
-
12
-// BuildCacheDiskUsage BuildCacheDiskUsage represents system data usage for build cache resources.
13
-//
14
-// swagger:model BuildCacheDiskUsage
15
-type BuildCacheDiskUsage struct {
16
-
17
-	// Count of active build cache records.
18
-	//
19
-	// Example: 1
20
-	ActiveBuildCacheRecords int64 `json:"ActiveBuildCacheRecords,omitempty"`
21
-
22
-	// List of build cache records.
23
-	//
24
-	Items []*build.CacheRecord `json:"Items,omitempty"`
25
-
26
-	// Disk space that can be reclaimed by removing inactive build cache records.
27
-	//
28
-	// Example: 12345678
29
-	Reclaimable int64 `json:"Reclaimable,omitempty"`
30
-
31
-	// Count of all build cache records.
32
-	//
33
-	// Example: 4
34
-	TotalBuildCacheRecords int64 `json:"TotalBuildCacheRecords,omitempty"`
35
-
36
-	// Disk space in use by build cache records.
37
-	//
38
-	// Example: 98765432
39
-	TotalSize int64 `json:"TotalSize,omitempty"`
40
-}
41 1
deleted file mode 100644
... ...
@@ -1,40 +0,0 @@
1
-// Code generated by go-swagger; DO NOT EDIT.
2
-
3
-package system
4
-
5
-// This file was generated by the swagger tool.
6
-// Editing this file might prove futile when you re-run the swagger generate command
7
-
8
-import (
9
-	"github.com/moby/moby/api/types/container"
10
-)
11
-
12
-// ContainersDiskUsage ContainersDiskUsage provides system data usage information for container resources.
13
-//
14
-// swagger:model ContainersDiskUsage
15
-type ContainersDiskUsage struct {
16
-
17
-	// Count of active containers.
18
-	//
19
-	// Example: 1
20
-	ActiveContainers int64 `json:"ActiveContainers,omitempty"`
21
-
22
-	// List of container summaries.
23
-	//
24
-	Items []*container.Summary `json:"Items,omitempty"`
25
-
26
-	// Disk space that can be reclaimed by removing inactive containers.
27
-	//
28
-	// Example: 12345678
29
-	Reclaimable int64 `json:"Reclaimable,omitempty"`
30
-
31
-	// Count of all containers.
32
-	//
33
-	// Example: 4
34
-	TotalContainers int64 `json:"TotalContainers,omitempty"`
35
-
36
-	// Disk space in use by containers.
37
-	//
38
-	// Example: 98765432
39
-	TotalSize int64 `json:"TotalSize,omitempty"`
40
-}
... ...
@@ -26,10 +26,10 @@ const (
26 26
 type DiskUsage struct {
27 27
 	LegacyDiskUsage
28 28
 
29
-	ImageUsage      *ImagesDiskUsage     `json:"ImageUsage,omitempty"`
30
-	ContainerUsage  *ContainersDiskUsage `json:"ContainerUsage,omitempty"`
31
-	VolumeUsage     *VolumesDiskUsage    `json:"VolumeUsage,omitempty"`
32
-	BuildCacheUsage *BuildCacheDiskUsage `json:"BuildCacheUsage,omitempty"`
29
+	ImageUsage      *image.DiskUsage     `json:"ImageUsage,omitempty"`
30
+	ContainerUsage  *container.DiskUsage `json:"ContainerUsage,omitempty"`
31
+	VolumeUsage     *volume.DiskUsage    `json:"VolumeUsage,omitempty"`
32
+	BuildCacheUsage *build.DiskUsage     `json:"BuildCacheUsage,omitempty"`
33 33
 }
34 34
 
35 35
 type LegacyDiskUsage struct {
36 36
deleted file mode 100644
... ...
@@ -1,40 +0,0 @@
1
-// Code generated by go-swagger; DO NOT EDIT.
2
-
3
-package system
4
-
5
-// This file was generated by the swagger tool.
6
-// Editing this file might prove futile when you re-run the swagger generate command
7
-
8
-import (
9
-	"github.com/moby/moby/api/types/image"
10
-)
11
-
12
-// ImagesDiskUsage ImagesDiskUsage represents system data usage for image resources.
13
-//
14
-// swagger:model ImagesDiskUsage
15
-type ImagesDiskUsage struct {
16
-
17
-	// Count of active images.
18
-	//
19
-	// Example: 1
20
-	ActiveImages int64 `json:"ActiveImages,omitempty"`
21
-
22
-	// List of image summaries.
23
-	//
24
-	Items []*image.Summary `json:"Items,omitempty"`
25
-
26
-	// Disk space that can be reclaimed by removing unused images.
27
-	//
28
-	// Example: 12345678
29
-	Reclaimable int64 `json:"Reclaimable,omitempty"`
30
-
31
-	// Count of all images.
32
-	//
33
-	// Example: 4
34
-	TotalImages int64 `json:"TotalImages,omitempty"`
35
-
36
-	// Disk space in use by images.
37
-	//
38
-	// Example: 98765432
39
-	TotalSize int64 `json:"TotalSize,omitempty"`
40
-}
41 1
deleted file mode 100644
... ...
@@ -1,40 +0,0 @@
1
-// Code generated by go-swagger; DO NOT EDIT.
2
-
3
-package system
4
-
5
-// This file was generated by the swagger tool.
6
-// Editing this file might prove futile when you re-run the swagger generate command
7
-
8
-import (
9
-	"github.com/moby/moby/api/types/volume"
10
-)
11
-
12
-// VolumesDiskUsage VolumesDiskUsage represents system data usage for volume resources.
13
-//
14
-// swagger:model VolumesDiskUsage
15
-type VolumesDiskUsage struct {
16
-
17
-	// Count of active volumes.
18
-	//
19
-	// Example: 1
20
-	ActiveVolumes int64 `json:"ActiveVolumes,omitempty"`
21
-
22
-	// List of volumes.
23
-	//
24
-	Items []*volume.Volume `json:"Items,omitempty"`
25
-
26
-	// Disk space that can be reclaimed by removing inactive volumes.
27
-	//
28
-	// Example: 12345678
29
-	Reclaimable int64 `json:"Reclaimable,omitempty"`
30
-
31
-	// Disk space in use by volumes.
32
-	//
33
-	// Example: 98765432
34
-	TotalSize int64 `json:"TotalSize,omitempty"`
35
-
36
-	// Count of all volumes.
37
-	//
38
-	// Example: 4
39
-	TotalVolumes int64 `json:"TotalVolumes,omitempty"`
40
-}
41 1
new file mode 100644
... ...
@@ -0,0 +1,36 @@
0
+// Code generated by go-swagger; DO NOT EDIT.
1
+
2
+package volume
3
+
4
+// This file was generated by the swagger tool.
5
+// Editing this file might prove futile when you re-run the swagger generate command
6
+
7
+// DiskUsage represents system data usage for volume resources.
8
+//
9
+// swagger:model DiskUsage
10
+type DiskUsage struct {
11
+
12
+	// Count of active volumes.
13
+	//
14
+	// Example: 1
15
+	ActiveVolumes int64 `json:"ActiveVolumes,omitempty"`
16
+
17
+	// List of volumes.
18
+	//
19
+	Items []*Volume `json:"Items,omitempty"`
20
+
21
+	// Disk space that can be reclaimed by removing inactive volumes.
22
+	//
23
+	// Example: 12345678
24
+	Reclaimable int64 `json:"Reclaimable,omitempty"`
25
+
26
+	// Disk space in use by volumes.
27
+	//
28
+	// Example: 98765432
29
+	TotalSize int64 `json:"TotalSize,omitempty"`
30
+
31
+	// Count of all volumes.
32
+	//
33
+	// Example: 4
34
+	TotalVolumes int64 `json:"TotalVolumes,omitempty"`
35
+}