Files
portainer/api/stacks/stackbuilders/stack_payload.go
T
2026-06-15 18:49:26 +03:00

55 lines
2.1 KiB
Go

package stackbuilders
import (
portainer "github.com/portainer/portainer/api"
)
// StackPayload contains all the fields for creating a stack with all kinds of methods
type StackPayload struct {
// Name of the stack
Name string `example:"myStack" validate:"required"`
// Swarm cluster identifier
SwarmID string `example:"jpofkc0i9uo9wtx1zesuk649w" validate:"required"`
// Stack file data
StackFileContent []byte
Webhook string
// A list of environment(endpoint) variables used during stack deployment
Env []portainer.Pair
// Optional GitOps update configuration
AutoUpdate *portainer.AutoUpdateSettings
// Whether the stack is from a app template
FromAppTemplate bool `example:"false"`
// Kubernetes stack name
StackName string
// Kubernetes stack namespace
Namespace string
// Path to the k8s Stack file. Used by k8s git repository method
ManifestFile string
// URL to the k8s Stack file. Used by k8s git repository method
ManifestURL string
// Path to the Stack file inside the Git repository
ComposeFile string `example:"docker-compose.yml" default:"docker-compose.yml"`
// Applicable when deploying with multiple stack files
AdditionalFiles []string `example:"[nz.compose.yml, uat.compose.yml]"`
// Git repository configuration of a stack
RepositoryConfigPayload
}
type RepositoryConfigPayload struct {
// SourceID references an existing Source.
// When non-zero, only ReferenceName is still applied.
SourceID portainer.SourceID
// URL of a Git repository hosting the Stack file
URL string `example:"https://github.com/openfaas/faas"`
// Reference name of a Git repository hosting the Stack file
ReferenceName string `example:"refs/heads/master"`
// Use basic authentication to clone the Git repository
Authentication bool `example:"true"`
// Username used in basic authentication. Required when RepositoryAuthentication is true
Username string `example:"myGitUsername"`
// Password used in basic authentication. Required when RepositoryAuthentication is true
Password string `example:"myGitPassword"`
// TLSSkipVerify skips SSL verification when cloning the Git repository
TLSSkipVerify bool `example:"false"`
}