Files
moby/client/swarm_unlock.go
Austin Vazquez 612342198c client: refactor swarm api functions to wrap params/responses
Co-authored-by: Claude <noreply@anthropic.com>
Signed-off-by: Austin Vazquez <austin.vazquez@docker.com>
2025-10-21 10:17:04 -05:00

26 lines
621 B
Go

package client
import (
"context"
"github.com/moby/moby/api/types/swarm"
)
// SwarmUnlockOptions specifies options for unlocking a swarm.
type SwarmUnlockOptions struct {
Key string
}
// SwarmUnlockResult represents the result of unlocking a swarm.
type SwarmUnlockResult struct{}
// SwarmUnlock unlocks locked swarm.
func (cli *Client) SwarmUnlock(ctx context.Context, options SwarmUnlockOptions) (SwarmUnlockResult, error) {
req := &swarm.UnlockRequest{
UnlockKey: options.Key,
}
resp, err := cli.post(ctx, "/swarm/unlock", nil, req, nil)
defer ensureReaderClosed(resp)
return SwarmUnlockResult{}, err
}