Merge pull request #50794 from austinvazquez/move-swarm-option-types-to-client

api/types/swarm: move swarm option types to client
This commit is contained in:
Sebastiaan van Stijn
2025-08-26 18:44:02 +02:00
committed by GitHub
81 changed files with 461 additions and 380 deletions

View File

@@ -2,8 +2,6 @@ package swarm
import (
"os"
"github.com/moby/moby/api/types/filters"
)
// Config represents a config.
@@ -55,8 +53,3 @@ type ConfigCreateResponse struct {
// ID is the id of the created config.
ID string
}
// ConfigListOptions holds parameters to list configs
type ConfigListOptions struct {
Filters filters.Args
}

View File

@@ -1,7 +1,5 @@
package swarm
import "github.com/moby/moby/api/types/filters"
// Node represents a node.
type Node struct {
ID string
@@ -139,13 +137,3 @@ const (
type Topology struct {
Segments map[string]string `json:",omitempty"`
}
// NodeListOptions holds parameters to list nodes with.
type NodeListOptions struct {
Filters filters.Args
}
// NodeRemoveOptions holds parameters to remove nodes with.
type NodeRemoveOptions struct {
Force bool
}

View File

@@ -2,8 +2,6 @@ package swarm
import (
"time"
"github.com/moby/moby/api/types/filters"
)
// Service represents a service.
@@ -205,68 +203,8 @@ type JobStatus struct {
LastExecution time.Time `json:",omitempty"`
}
// ServiceCreateOptions contains the options to use when creating a service.
type ServiceCreateOptions struct {
// EncodedRegistryAuth is the encoded registry authorization credentials to
// use when updating the service.
//
// This field follows the format of the X-Registry-Auth header.
EncodedRegistryAuth string
// QueryRegistry indicates whether the service update requires
// contacting a registry. A registry may be contacted to retrieve
// the image digest and manifest, which in turn can be used to update
// platform or other information about the service.
QueryRegistry bool
}
// Values for RegistryAuthFrom in ServiceUpdateOptions
const (
RegistryAuthFromSpec = "spec"
RegistryAuthFromPreviousSpec = "previous-spec"
)
// ServiceUpdateOptions contains the options to be used for updating services.
type ServiceUpdateOptions struct {
// EncodedRegistryAuth is the encoded registry authorization credentials to
// use when updating the service.
//
// This field follows the format of the X-Registry-Auth header.
EncodedRegistryAuth string
// TODO(stevvooe): Consider moving the version parameter of ServiceUpdate
// into this field. While it does open API users up to racy writes, most
// users may not need that level of consistency in practice.
// RegistryAuthFrom specifies where to find the registry authorization
// credentials if they are not given in EncodedRegistryAuth. Valid
// values are "spec" and "previous-spec".
RegistryAuthFrom string
// Rollback indicates whether a server-side rollback should be
// performed. When this is set, the provided spec will be ignored.
// The valid values are "previous" and "none". An empty value is the
// same as "none".
Rollback string
// QueryRegistry indicates whether the service update requires
// contacting a registry. A registry may be contacted to retrieve
// the image digest and manifest, which in turn can be used to update
// platform or other information about the service.
QueryRegistry bool
}
// ServiceListOptions holds parameters to list services with.
type ServiceListOptions struct {
Filters filters.Args
// Status indicates whether the server should include the service task
// count of running and desired tasks.
Status bool
}
// ServiceInspectOptions holds parameters related to the "service inspect"
// operation.
type ServiceInspectOptions struct {
InsertDefaults bool
}

View File

@@ -229,13 +229,6 @@ type Peer struct {
Addr string
}
// UpdateFlags contains flags for SwarmUpdate.
type UpdateFlags struct {
RotateWorkerToken bool
RotateManagerToken bool
RotateManagerUnlockKey bool
}
// UnlockKeyResponse contains the response for Engine API:
// GET /swarm/unlockkey
type UnlockKeyResponse struct {

View File

@@ -2,8 +2,6 @@ package swarm
import (
"time"
"github.com/moby/moby/api/types/filters"
)
// TaskState represents the state of a task.
@@ -223,8 +221,3 @@ type VolumeAttachment struct {
// in the ContainerSpec, that this volume fulfills.
Target string `json:",omitempty"`
}
// TaskListOptions holds parameters to list tasks with.
type TaskListOptions struct {
Filters filters.Args
}