Skip to content

Modern Docker Management, Designed for Everyone

4.5 KB
Raw Blame
package swarm

import "time"

type StackSummary struct {
	// ID is the unique identifier for the stack (uses namespace).
	//
	// Required: true
	ID string `json:"id"`

	// Name is the stack name.
	//
	// Required: true
	Name string `json:"name"`

	// Namespace is the stack namespace label value.
	//
	// Required: true
	Namespace string `json:"namespace"`

	// Services is the number of services in the stack.
	//
	// Required: true
	Services int `json:"services"`

	// CreatedAt is the earliest service creation time in the stack.
	//
	// Required: true
	CreatedAt time.Time `json:"createdAt"`

	// UpdatedAt is the latest service update time in the stack.
	//
	// Required: true
	UpdatedAt time.Time `json:"updatedAt"`
}

type StackInspect struct {
	// Name is the stack name.
	//
	// Required: true
	Name string `json:"name"`

	// Namespace is the stack namespace label value.
	//
	// Required: true
	Namespace string `json:"namespace"`

	// Services is the number of services in the stack.
	//
	// Required: true
	Services int `json:"services"`

	// CreatedAt is the earliest service creation time in the stack.
	//
	// Required: true
	CreatedAt time.Time `json:"createdAt"`

	// UpdatedAt is the latest service update time in the stack.
	//
	// Required: true
	UpdatedAt time.Time `json:"updatedAt"`
}

type StackRenderConfigRequest struct {
	// Name is the stack name (namespace).
	//
	// Required: true
	Name string `json:"name"`

	// ComposeContent is the Docker Compose YAML content.
	//
	// Required: true
	ComposeContent string `json:"composeContent"`

	// OverrideContent is the optional Docker Compose override YAML content merged
	// on top of ComposeContent, mirroring `docker compose` override files.
	//
	// Required: false
	OverrideContent string `json:"overrideContent,omitempty"`

	// EnvContent is the optional environment file content.
	//
	// Required: false
	EnvContent string `json:"envContent,omitempty"`
}

type StackRenderConfigResponse struct {
	// Name is the stack name.
	//
	// Required: true
	Name string `json:"name"`

	// RenderedCompose is the normalized compose config output.
	//
	// Required: true
	RenderedCompose string `json:"renderedCompose"`

	// Services contains the final stack-scoped service names.
	//
	// Required: true
	Services []string `json:"services"`

	// Networks contains the final resolved network names, including stack
	// namespacing for non-external resources.
	//
	// Required: true
	Networks []string `json:"networks"`

	// Volumes contains the final resolved volume names, including stack
	// namespacing for non-external resources.
	//
	// Required: true
	Volumes []string `json:"volumes"`

	// Configs contains the final content-addressed or external config names.
	//
	// Required: true
	Configs []string `json:"configs"`

	// Secrets contains the final content-addressed or external secret names.
	//
	// Required: true
	Secrets []string `json:"secrets"`

	// Warnings contains non-fatal warnings.
	//
	// Required: false
	Warnings []string `json:"warnings,omitempty"`
}

type StackSource struct {
	// Name is the stack name.
	//
	// Required: true
	Name string `json:"name"`

	// ComposeContent is the original Docker Compose YAML content used for deployment.
	//
	// Required: true
	ComposeContent string `json:"composeContent"`

	// OverrideContent is the optional Docker Compose override content merged on top
	// of ComposeContent at deploy, mirroring `docker compose` override files.
	//
	// Required: false
	OverrideContent string `json:"overrideContent,omitempty"`

	// EnvContent is the optional original environment file content used for deployment.
	//
	// Required: false
	EnvContent string `json:"envContent,omitempty"`

	// Files is an optional list of additional files synced with the stack.
	//
	// Required: false
	Files []SyncFile `json:"files,omitempty"`
}

type StackSourceUpdateRequest struct {
	// ComposeContent is the Docker Compose YAML content to persist for the stack.
	//
	// Required: true
	ComposeContent string `json:"composeContent"`

	// OverrideContent is the optional Docker Compose override content to persist
	// for the stack, merged on top of ComposeContent at deploy.
	//
	// Required: false
	OverrideContent string `json:"overrideContent,omitempty"`

	// EnvContent is the optional environment file content to persist for the stack.
	//
	// Required: false
	EnvContent string `json:"envContent,omitempty"`

	// Files is an optional list of additional files to persist for the stack.
	//
	// Required: false
	Files []SyncFile `json:"files,omitempty"`
}