package service
import "github.com/docker/cli/cli/command/service"
Index ¶
- func AppendServiceStatus(ctx context.Context, c client.APIClient, services []swarm.Service) ([]swarm.Service, error)
- func CompletionFn(dockerCLI completion.APIClientProvider) completion.ValidArgsFn
- func InspectFormatWrite(ctx formatter.Context, refs []string, getRef, getNetwork inspect.GetRefFunc) error
- func ListFormatWrite(ctx formatter.Context, services []swarm.Service) error
- func NewFormat(source string) formatter.Format
- func NewListFormat(source string, quiet bool) formatter.Format
- func NewServiceCommand(dockerCli command.Cli) *cobra.Command
- func ParseConfigs(ctx context.Context, apiClient client.ConfigAPIClient, requestedConfigs []*swarmtypes.ConfigReference) ([]*swarmtypes.ConfigReference, error)
- func ParseGenericResources(value []string) ([]swarm.GenericResource, error)
- func ParseSecrets(ctx context.Context, apiClient client.SecretAPIClient, requestedSecrets []*swarmtypes.SecretReference) ([]*swarmtypes.SecretReference, error)
- func ValidateSingleGenericResource(val string) (string, error)
- func WaitOnService(ctx context.Context, dockerCli command.Cli, serviceID string, quiet bool) error
- type ShlexOpt
- func (s *ShlexOpt) Set(value string) error
- func (s *ShlexOpt) String() string
- func (*ShlexOpt) Type() string
- func (s *ShlexOpt) Value() []string
- type Uint64Opt
Functions ¶
func AppendServiceStatus ¶
func AppendServiceStatus(ctx context.Context, c client.APIClient, services []swarm.Service) ([]swarm.Service, error)
AppendServiceStatus propagates the ServiceStatus field for "services".
If API version v1.41 or up is used, this information is already set by the daemon. On older API versions, we need to do some extra requests to get that information. Theoretically, this function can be skipped based on API version, however, some of our unit tests don't set the API version, and there may be other situations where the client uses the "default" version. To take these situations into account, we do a quick check for services that don't have ServiceStatus set, and perform a lookup for those.
func CompletionFn ¶
func CompletionFn(dockerCLI completion.APIClientProvider) completion.ValidArgsFn
CompletionFn offers completion for swarm service names and optional IDs. By default, only names are returned. Set DOCKER_COMPLETION_SHOW_SERVICE_IDS=yes to also complete IDs.
func InspectFormatWrite ¶
func InspectFormatWrite(ctx formatter.Context, refs []string, getRef, getNetwork inspect.GetRefFunc) error
InspectFormatWrite renders the context for a list of services
func ListFormatWrite ¶
ListFormatWrite writes the context
func NewFormat ¶
NewFormat returns a Format for rendering using a Context
func NewListFormat ¶
NewListFormat returns a Format for rendering using a service Context
func NewServiceCommand ¶
NewServiceCommand returns a cobra command for `service` subcommands
func ParseConfigs ¶
func ParseConfigs(ctx context.Context, apiClient client.ConfigAPIClient, requestedConfigs []*swarmtypes.ConfigReference) ([]*swarmtypes.ConfigReference, error)
ParseConfigs retrieves the configs from the requested names and converts them to config references to use with the spec
func ParseGenericResources ¶
func ParseGenericResources(value []string) ([]swarm.GenericResource, error)
ParseGenericResources parses an array of Generic resourceResources Requesting Named Generic Resources for a service is not supported this is filtered here.
func ParseSecrets ¶
func ParseSecrets(ctx context.Context, apiClient client.SecretAPIClient, requestedSecrets []*swarmtypes.SecretReference) ([]*swarmtypes.SecretReference, error)
ParseSecrets retrieves the secrets with the requested names and fills secret IDs into the secret references.
func ValidateSingleGenericResource ¶
ValidateSingleGenericResource validates that a single entry in the generic resource list is valid. i.e 'GPU=UID1' is valid however 'GPU:UID1' or 'UID1' isn't
func WaitOnService ¶
WaitOnService waits for the service to converge. It outputs a progress bar, if appropriate based on the CLI flags.
Types ¶
type ShlexOpt ¶
type ShlexOpt []string
ShlexOpt is a flag Value which parses a string as a list of shell words
func (*ShlexOpt) Set ¶
Set the value
func (*ShlexOpt) String ¶
func (*ShlexOpt) Type ¶
Type returns the type of the value
func (*ShlexOpt) Value ¶
Value returns the value as a string slice
type Uint64Opt ¶
type Uint64Opt struct {
// contains filtered or unexported fields
}
Uint64Opt represents a uint64.
func (*Uint64Opt) Set ¶
Set a new value on the option
func (*Uint64Opt) String ¶
String returns a string repr of this option
func (*Uint64Opt) Type ¶
Type returns the type of this option, which will be displayed in `--help` output
func (*Uint64Opt) Value ¶
Value returns the uint64
Source Files ¶
cmd.go create.go formatter.go generic_resource_opts.go helpers.go inspect.go list.go logs.go opts.go parse.go ps.go remove.go rollback.go scale.go trust.go update.go
Directories ¶
Path | Synopsis |
---|---|
cli/command/service/progress |
- Version
- v28.0.1+incompatible
- Published
- Feb 25, 2025
- Platform
- windows/amd64
- Imports
- 51 packages
- Last checked
- 9 hours ago –
Tools for package owners.