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

Signed-off-by: Austin Vazquez <austin.vazquez@docker.com>
This commit is contained in:
Austin Vazquez
2025-11-05 10:00:05 -06:00
parent 689776a4fa
commit fabdccbe10
15 changed files with 87 additions and 116 deletions

View File

@@ -2061,8 +2061,10 @@ definitions:
ImagesDiskUsage:
type: "object"
x-go-name: "DiskUsage"
x-go-package: "github.com/moby/moby/api/types/image"
description: |
ImagesDiskUsage represents system data usage for image resources.
represents system data usage for image resources.
properties:
ActiveImages:
description: |
@@ -2097,8 +2099,6 @@ definitions:
x-nullable: true
x-go-type:
type: Summary
import:
package: github.com/moby/moby/api/types/image
AuthConfig:
type: "object"
@@ -2244,8 +2244,10 @@ definitions:
VolumesDiskUsage:
type: "object"
x-go-name: "DiskUsage"
x-go-package: "github.com/moby/moby/api/types/volume"
description: |
VolumesDiskUsage represents system data usage for volume resources.
represents system data usage for volume resources.
properties:
ActiveVolumes:
description: |
@@ -2280,8 +2282,6 @@ definitions:
x-nullable: true
x-go-type:
type: Volume
import:
package: github.com/moby/moby/api/types/volume
VolumeCreateRequest:
description: "Volume configuration"
@@ -2858,8 +2858,10 @@ definitions:
BuildCacheDiskUsage:
type: "object"
x-go-name: "DiskUsage"
x-go-package: "github.com/moby/moby/api/types/build"
description: |
BuildCacheDiskUsage represents system data usage for build cache resources.
represents system data usage for build cache resources.
properties:
ActiveBuildCacheRecords:
description: |
@@ -2894,8 +2896,6 @@ definitions:
x-nullable: true
x-go-type:
type: CacheRecord
import:
package: github.com/moby/moby/api/types/build
ImageID:
type: "object"
@@ -5582,8 +5582,10 @@ definitions:
ContainersDiskUsage:
type: "object"
x-go-name: "DiskUsage"
x-go-package: "github.com/moby/moby/api/types/container"
description: |
ContainersDiskUsage provides system data usage information for container resources.
represents system data usage information for container resources.
properties:
ActiveContainers:
description: |
@@ -5618,8 +5620,6 @@ definitions:
x-nullable: true
x-go-type:
type: Summary
import:
package: github.com/moby/moby/api/types/container
Driver:
description: "Driver represents a driver (network, logging, secrets)."

View File

@@ -2061,8 +2061,10 @@ definitions:
ImagesDiskUsage:
type: "object"
x-go-name: "DiskUsage"
x-go-package: "github.com/moby/moby/api/types/image"
description: |
ImagesDiskUsage represents system data usage for image resources.
represents system data usage for image resources.
properties:
ActiveImages:
description: |
@@ -2097,8 +2099,6 @@ definitions:
x-nullable: true
x-go-type:
type: Summary
import:
package: github.com/moby/moby/api/types/image
AuthConfig:
type: "object"
@@ -2244,8 +2244,10 @@ definitions:
VolumesDiskUsage:
type: "object"
x-go-name: "DiskUsage"
x-go-package: "github.com/moby/moby/api/types/volume"
description: |
VolumesDiskUsage represents system data usage for volume resources.
represents system data usage for volume resources.
properties:
ActiveVolumes:
description: |
@@ -2280,8 +2282,6 @@ definitions:
x-nullable: true
x-go-type:
type: Volume
import:
package: github.com/moby/moby/api/types/volume
VolumeCreateRequest:
description: "Volume configuration"
@@ -2858,8 +2858,10 @@ definitions:
BuildCacheDiskUsage:
type: "object"
x-go-name: "DiskUsage"
x-go-package: "github.com/moby/moby/api/types/build"
description: |
BuildCacheDiskUsage represents system data usage for build cache resources.
represents system data usage for build cache resources.
properties:
ActiveBuildCacheRecords:
description: |
@@ -2894,8 +2896,6 @@ definitions:
x-nullable: true
x-go-type:
type: CacheRecord
import:
package: github.com/moby/moby/api/types/build
ImageID:
type: "object"
@@ -5582,8 +5582,10 @@ definitions:
ContainersDiskUsage:
type: "object"
x-go-name: "DiskUsage"
x-go-package: "github.com/moby/moby/api/types/container"
description: |
ContainersDiskUsage provides system data usage information for container resources.
represents system data usage information for container resources.
properties:
ActiveContainers:
description: |
@@ -5618,8 +5620,6 @@ definitions:
x-nullable: true
x-go-type:
type: Summary
import:
package: github.com/moby/moby/api/types/container
Driver:
description: "Driver represents a driver (network, logging, secrets)."

View File

@@ -1,18 +1,14 @@
// Code generated by go-swagger; DO NOT EDIT.
package system
package build
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"github.com/moby/moby/api/types/build"
)
// BuildCacheDiskUsage BuildCacheDiskUsage represents system data usage for build cache resources.
// DiskUsage represents system data usage for build cache resources.
//
// swagger:model BuildCacheDiskUsage
type BuildCacheDiskUsage struct {
// swagger:model DiskUsage
type DiskUsage struct {
// Count of active build cache records.
//
@@ -21,7 +17,7 @@ type BuildCacheDiskUsage struct {
// List of build cache records.
//
Items []*build.CacheRecord `json:"Items,omitempty"`
Items []*CacheRecord `json:"Items,omitempty"`
// Disk space that can be reclaimed by removing inactive build cache records.
//

View File

@@ -1,18 +1,14 @@
// Code generated by go-swagger; DO NOT EDIT.
package system
package container
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"github.com/moby/moby/api/types/container"
)
// ContainersDiskUsage ContainersDiskUsage provides system data usage information for container resources.
// DiskUsage represents system data usage information for container resources.
//
// swagger:model ContainersDiskUsage
type ContainersDiskUsage struct {
// swagger:model DiskUsage
type DiskUsage struct {
// Count of active containers.
//
@@ -21,7 +17,7 @@ type ContainersDiskUsage struct {
// List of container summaries.
//
Items []*container.Summary `json:"Items,omitempty"`
Items []*Summary `json:"Items,omitempty"`
// Disk space that can be reclaimed by removing inactive containers.
//

View File

@@ -1,18 +1,14 @@
// Code generated by go-swagger; DO NOT EDIT.
package system
package image
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"github.com/moby/moby/api/types/image"
)
// ImagesDiskUsage ImagesDiskUsage represents system data usage for image resources.
// DiskUsage represents system data usage for image resources.
//
// swagger:model ImagesDiskUsage
type ImagesDiskUsage struct {
// swagger:model DiskUsage
type DiskUsage struct {
// Count of active images.
//
@@ -21,7 +17,7 @@ type ImagesDiskUsage struct {
// List of image summaries.
//
Items []*image.Summary `json:"Items,omitempty"`
Items []*Summary `json:"Items,omitempty"`
// Disk space that can be reclaimed by removing unused images.
//

View File

@@ -26,10 +26,10 @@ const (
type DiskUsage struct {
LegacyDiskUsage
ImageUsage *ImagesDiskUsage `json:"ImageUsage,omitempty"`
ContainerUsage *ContainersDiskUsage `json:"ContainerUsage,omitempty"`
VolumeUsage *VolumesDiskUsage `json:"VolumeUsage,omitempty"`
BuildCacheUsage *BuildCacheDiskUsage `json:"BuildCacheUsage,omitempty"`
ImageUsage *image.DiskUsage `json:"ImageUsage,omitempty"`
ContainerUsage *container.DiskUsage `json:"ContainerUsage,omitempty"`
VolumeUsage *volume.DiskUsage `json:"VolumeUsage,omitempty"`
BuildCacheUsage *build.DiskUsage `json:"BuildCacheUsage,omitempty"`
}
type LegacyDiskUsage struct {

View File

@@ -1,18 +1,14 @@
// Code generated by go-swagger; DO NOT EDIT.
package system
package volume
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"github.com/moby/moby/api/types/volume"
)
// VolumesDiskUsage VolumesDiskUsage represents system data usage for volume resources.
// DiskUsage represents system data usage for volume resources.
//
// swagger:model VolumesDiskUsage
type VolumesDiskUsage struct {
// swagger:model DiskUsage
type DiskUsage struct {
// Count of active volumes.
//
@@ -21,7 +17,7 @@ type VolumesDiskUsage struct {
// List of volumes.
//
Items []*volume.Volume `json:"Items,omitempty"`
Items []*Volume `json:"Items,omitempty"`
// Disk space that can be reclaimed by removing inactive volumes.
//