2016-12-18 05:21:29 +00:00
package portainer
2020-05-20 05:23:15 +00:00
import (
2021-08-05 03:02:06 +00:00
"context"
2020-07-05 23:21:03 +00:00
"io"
2020-05-20 05:23:15 +00:00
"time"
2021-06-15 21:11:35 +00:00
2022-05-31 10:03:10 +00:00
"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/volume"
2021-06-15 21:11:35 +00:00
gittypes "github.com/portainer/portainer/api/git/types"
2022-11-13 19:33:57 +00:00
models "github.com/portainer/portainer/api/http/models/kubernetes"
2023-02-09 04:17:46 +00:00
"github.com/portainer/portainer/pkg/featureflags"
2021-08-05 03:02:06 +00:00
v1 "k8s.io/api/core/v1"
2020-05-20 05:23:15 +00:00
)
2019-07-25 22:38:07 +00:00
2016-12-18 05:21:29 +00:00
type (
2020-04-08 21:26:11 +00:00
// AccessPolicy represent a policy that can be associated to a user or team
AccessPolicy struct {
2021-02-23 03:21:39 +00:00
// Role identifier. Reference the role that will be associated to this access policy
RoleID RoleID ` json:"RoleId" example:"1" `
2020-04-08 21:26:11 +00:00
}
2020-08-04 00:44:17 +00:00
// AgentPlatform represents a platform type for an Agent
AgentPlatform int
2020-04-08 21:26:11 +00:00
// AuthenticationMethod represents the authentication method used to authenticate a user
AuthenticationMethod int
// Authorization represents an authorization associated to an operation
Authorization string
// Authorizations represents a set of authorizations associated to a role
Authorizations map [ Authorization ] bool
2023-03-02 15:07:50 +00:00
//AutoUpdateSettings represents the git auto sync config for stack deployment
AutoUpdateSettings struct {
// Auto update interval
Interval string ` example:"1m30s" `
// A UUID generated from client
Webhook string ` example:"05de31a2-79fa-4644-9c12-faa67e5c49f0" `
// Autoupdate job id
JobID string ` example:"15" `
// Force update ignores repo changes
ForceUpdate bool ` example:"false" `
// Pull latest image
ForcePullImage bool ` example:"false" `
}
2020-04-08 21:26:11 +00:00
// AzureCredentials represents the credentials used to connect to an Azure
2021-09-20 00:14:22 +00:00
// environment(endpoint).
2020-04-08 21:26:11 +00:00
AzureCredentials struct {
2021-02-23 03:21:39 +00:00
// Azure application ID
ApplicationID string ` json:"ApplicationID" example:"eag7cdo9-o09l-9i83-9dO9-f0b23oe78db4" `
// Azure tenant ID
TenantID string ` json:"TenantID" example:"34ddc78d-4fel-2358-8cc1-df84c8o839f5" `
// Azure authentication key
AuthenticationKey string ` json:"AuthenticationKey" example:"cOrXoK/1D35w8YQ8nH1/8ZGwzz45JIYD5jxHKXEQknk=" `
2016-12-18 05:21:29 +00:00
}
2021-11-29 13:06:50 +00:00
// OpenAMTConfiguration represents the credentials and configurations used to connect to an OpenAMT MPS server
OpenAMTConfiguration struct {
2022-01-23 19:48:04 +00:00
Enabled bool ` json:"enabled" `
MPSServer string ` json:"mpsServer" `
MPSUser string ` json:"mpsUser" `
MPSPassword string ` json:"mpsPassword" `
MPSToken string ` json:"mpsToken" ` // retrieved from API
CertFileName string ` json:"certFileName" `
CertFileContent string ` json:"certFileContent" `
CertFilePassword string ` json:"certFilePassword" `
DomainName string ` json:"domainName" `
2021-11-29 13:06:50 +00:00
}
2022-01-23 19:48:04 +00:00
// OpenAMTDeviceInformation represents an AMT managed device information
OpenAMTDeviceInformation struct {
GUID string ` json:"guid" `
HostName string ` json:"hostname" `
ConnectionStatus bool ` json:"connectionStatus" `
PowerState PowerState ` json:"powerState" `
EnabledFeatures * OpenAMTDeviceEnabledFeatures ` json:"features" `
2021-11-29 13:06:50 +00:00
}
2022-01-23 19:48:04 +00:00
// OpenAMTDeviceEnabledFeatures represents an AMT managed device features information
OpenAMTDeviceEnabledFeatures struct {
Redirection bool ` json:"redirection" `
KVM bool ` json:"KVM" `
SOL bool ` json:"SOL" `
IDER bool ` json:"IDER" `
UserConsent string ` json:"userConsent" `
2021-11-29 13:06:50 +00:00
}
2022-01-23 19:48:04 +00:00
// PowerState represents an AMT managed device power state
PowerState int
FDOConfiguration struct {
Enabled bool ` json:"enabled" `
OwnerURL string ` json:"ownerURL" `
OwnerUsername string ` json:"ownerUsername" `
OwnerPassword string ` json:"ownerPassword" `
}
// FDOProfileID represents a fdo profile id
FDOProfileID int
FDOProfile struct {
ID FDOProfileID ` json:"id" `
Name string ` json:"name" `
FilePath string ` json:"filePath" `
NumberDevices int ` json:"numberDevices" `
DateCreated int64 ` json:"dateCreated" `
2021-11-29 13:06:50 +00:00
}
2018-08-21 18:40:42 +00:00
// CLIFlags represents the available flags on the CLI
2016-12-18 05:21:29 +00:00
CLIFlags struct {
2020-06-16 07:55:45 +00:00
Addr * string
2021-08-10 04:59:47 +00:00
AddrHTTPS * string
2020-06-16 07:55:45 +00:00
TunnelAddr * string
TunnelPort * string
AdminPassword * string
AdminPasswordFile * string
Assets * string
Data * string
2023-02-09 04:17:46 +00:00
FeatureFlags * [ ] string
2022-05-22 05:34:09 +00:00
DemoEnvironment * bool
2020-06-16 07:55:45 +00:00
EnableEdgeComputeFeatures * bool
EndpointURL * string
Labels * [ ] Pair
Logo * string
NoAnalytics * bool
Templates * string
TLS * bool
TLSSkipVerify * bool
TLSCacert * string
TLSCert * string
TLSKey * string
2021-08-10 04:59:47 +00:00
HTTPDisabled * bool
2021-12-14 00:40:44 +00:00
HTTPEnabled * bool
2020-06-16 07:55:45 +00:00
SSL * bool
SSLCert * string
SSLKey * string
2021-09-27 00:52:50 +00:00
Rollback * bool
2020-06-16 07:55:45 +00:00
SnapshotInterval * string
2021-12-03 01:34:45 +00:00
BaseURL * string
2022-01-17 22:25:29 +00:00
InitialMmapSize * int
MaxBatchSize * int
MaxBatchDelay * time . Duration
2022-01-17 03:40:02 +00:00
SecretKeyName * string
2022-09-16 16:18:44 +00:00
LogLevel * string
2022-10-20 14:33:54 +00:00
LogMode * string
2017-06-01 08:14:55 +00:00
}
2022-05-31 10:00:47 +00:00
// CustomTemplateVariableDefinition
CustomTemplateVariableDefinition struct {
Name string ` json:"name" example:"MY_VAR" `
Label string ` json:"label" example:"My Variable" `
DefaultValue string ` json:"defaultValue" example:"default value" `
Description string ` json:"description" example:"Description" `
}
2020-07-06 23:18:39 +00:00
// CustomTemplate represents a custom template
CustomTemplate struct {
2021-02-23 03:21:39 +00:00
// CustomTemplate Identifier
ID CustomTemplateID ` json:"Id" example:"1" `
// Title of the template
Title string ` json:"Title" example:"Nginx" `
// Description of the template
Description string ` json:"Description" example:"High performance web server" `
// Path on disk to the repository hosting the Stack file
ProjectPath string ` json:"ProjectPath" example:"/data/custom_template/3" `
// Path to the Stack file
EntryPoint string ` json:"EntryPoint" example:"docker-compose.yml" `
// User identifier who created this template
CreatedByUserID UserID ` json:"CreatedByUserId" example:"3" `
// A note that will be displayed in the UI. Supports HTML content
Note string ` json:"Note" example:"This is my <b>custom</b> template" `
// Platform associated to the template.
// Valid values are: 1 - 'linux', 2 - 'windows'
Platform CustomTemplatePlatform ` json:"Platform" example:"1" enums:"1,2" `
// URL of the template's logo
Logo string ` json:"Logo" example:"https://cloudinovasi.id/assets/img/logos/nginx.png" `
2023-05-04 14:31:06 +00:00
// Type of created stack:
// * 1 - swarm
// * 2 - compose
// * 3 - kubernetes
Type StackType ` json:"Type" example:"1" enums:"1,2,3" `
2021-02-23 03:21:39 +00:00
ResourceControl * ResourceControl ` json:"ResourceControl" `
2022-05-31 10:00:47 +00:00
Variables [ ] CustomTemplateVariableDefinition
2023-04-04 00:44:42 +00:00
GitConfig * gittypes . RepoConfig ` json:"GitConfig" `
// IsComposeFormat indicates if the Kubernetes template is created from a Docker Compose file
IsComposeFormat bool ` example:"false" `
2020-07-06 23:18:39 +00:00
}
// CustomTemplateID represents a custom template identifier
CustomTemplateID int
// CustomTemplatePlatform represents a custom template platform
CustomTemplatePlatform int
2020-04-08 21:26:11 +00:00
// DockerHub represents all the required information to connect and use the
// Docker Hub
DockerHub struct {
2021-02-23 03:21:39 +00:00
// Is authentication against DockerHub enabled
Authentication bool ` json:"Authentication" example:"true" `
// Username used to authenticate against the DockerHub
Username string ` json:"Username" example:"user" `
// Password used to authenticate against the DockerHub
Password string ` json:"Password,omitempty" example:"passwd" `
2018-12-30 16:02:22 +00:00
}
2021-09-20 00:14:22 +00:00
// DockerSnapshot represents a snapshot of a specific Docker environment(endpoint) at a specific time
2020-07-05 23:21:03 +00:00
DockerSnapshot struct {
Time int64 ` json:"Time" `
DockerVersion string ` json:"DockerVersion" `
Swarm bool ` json:"Swarm" `
TotalCPU int ` json:"TotalCPU" `
TotalMemory int64 ` json:"TotalMemory" `
RunningContainerCount int ` json:"RunningContainerCount" `
StoppedContainerCount int ` json:"StoppedContainerCount" `
HealthyContainerCount int ` json:"HealthyContainerCount" `
UnhealthyContainerCount int ` json:"UnhealthyContainerCount" `
VolumeCount int ` json:"VolumeCount" `
ImageCount int ` json:"ImageCount" `
ServiceCount int ` json:"ServiceCount" `
StackCount int ` json:"StackCount" `
SnapshotRaw DockerSnapshotRaw ` json:"DockerSnapshotRaw" `
2021-12-01 00:18:57 +00:00
NodeCount int ` json:"NodeCount" `
2022-07-17 23:02:14 +00:00
GpuUseAll bool ` json:"GpuUseAll" `
GpuUseList [ ] string ` json:"GpuUseList" `
2020-07-05 23:21:03 +00:00
}
2023-03-01 16:33:40 +00:00
// DockerContainerSnapshot is an extent of Docker's Container struct
// It contains some information of Docker's ContainerJSON struct
DockerContainerSnapshot struct {
types . Container
2023-03-23 16:30:32 +00:00
Env [ ] string ` json:"Env,omitempty" ` // EE-5240
2023-03-01 16:33:40 +00:00
}
2022-05-31 10:03:10 +00:00
2023-03-01 16:33:40 +00:00
// DockerSnapshotRaw represents all the information related to a snapshot as returned by the Docker API
2020-07-05 23:21:03 +00:00
DockerSnapshotRaw struct {
2023-03-01 16:33:40 +00:00
Containers [ ] DockerContainerSnapshot ` json:"Containers" swaggerignore:"true" `
Volumes volume . VolumeListOKBody ` json:"Volumes" swaggerignore:"true" `
Networks [ ] types . NetworkResource ` json:"Networks" swaggerignore:"true" `
Images [ ] types . ImageSummary ` json:"Images" swaggerignore:"true" `
Info types . Info ` json:"Info" swaggerignore:"true" `
Version types . Version ` json:"Version" swaggerignore:"true" `
2020-07-05 23:21:03 +00:00
}
2020-05-14 02:14:28 +00:00
// EdgeGroup represents an Edge group
EdgeGroup struct {
2021-02-23 03:21:39 +00:00
// EdgeGroup Identifier
ID EdgeGroupID ` json:"Id" example:"1" `
2020-05-14 02:14:28 +00:00
Name string ` json:"Name" `
Dynamic bool ` json:"Dynamic" `
TagIDs [ ] TagID ` json:"TagIds" `
2021-09-21 05:41:27 +00:00
Endpoints [ ] EndpointID ` json:"Endpoints" `
2020-05-14 02:14:28 +00:00
PartialMatch bool ` json:"PartialMatch" `
}
// EdgeGroupID represents an Edge group identifier
EdgeGroupID int
2021-09-20 00:14:22 +00:00
// EdgeJob represents a job that can run on Edge environments(endpoints).
2020-06-25 03:25:51 +00:00
EdgeJob struct {
2021-02-23 03:21:39 +00:00
// EdgeJob Identifier
ID EdgeJobID ` json:"Id" example:"1" `
2020-06-25 03:25:51 +00:00
Created int64 ` json:"Created" `
CronExpression string ` json:"CronExpression" `
2021-09-21 05:41:27 +00:00
Endpoints map [ EndpointID ] EdgeJobEndpointMeta ` json:"Endpoints" `
2022-12-19 21:54:51 +00:00
EdgeGroups [ ] EdgeGroupID ` json:"EdgeGroups" `
2020-06-25 03:25:51 +00:00
Name string ` json:"Name" `
ScriptPath string ` json:"ScriptPath" `
Recurring bool ` json:"Recurring" `
Version int ` json:"Version" `
2022-12-19 21:54:51 +00:00
// Field used for log collection of Endpoints belonging to EdgeGroups
GroupLogsCollection map [ EndpointID ] EdgeJobEndpointMeta
2020-06-25 03:25:51 +00:00
}
2021-09-20 00:14:22 +00:00
// EdgeJobEndpointMeta represents a meta data object for an Edge job and Environment(Endpoint) relation
2020-06-25 03:25:51 +00:00
EdgeJobEndpointMeta struct {
LogsStatus EdgeJobLogsStatus
CollectLogs bool
}
// EdgeJobID represents an Edge job identifier
EdgeJobID int
// EdgeJobLogsStatus represent status of logs collection job
EdgeJobLogsStatus int
2021-09-20 00:14:22 +00:00
// EdgeSchedule represents a scheduled job that can run on Edge environments(endpoints).
2022-09-13 13:56:38 +00:00
//
// Deprecated: in favor of EdgeJob
2020-04-08 21:26:11 +00:00
EdgeSchedule struct {
2021-02-23 03:21:39 +00:00
// EdgeSchedule Identifier
ID ScheduleID ` json:"Id" example:"1" `
2020-04-08 21:26:11 +00:00
CronExpression string ` json:"CronExpression" `
Script string ` json:"Script" `
Version int ` json:"Version" `
2021-09-21 05:41:27 +00:00
Endpoints [ ] EndpointID ` json:"Endpoints" `
2020-04-08 21:26:11 +00:00
}
2020-05-14 02:14:28 +00:00
//EdgeStack represents an edge stack
EdgeStack struct {
2021-02-23 03:21:39 +00:00
// EdgeStack Identifier
2021-09-09 08:38:34 +00:00
ID EdgeStackID ` json:"Id" example:"1" `
Name string ` json:"Name" `
Status map [ EndpointID ] EdgeStackStatus ` json:"Status" `
CreationDate int64 ` json:"CreationDate" `
EdgeGroups [ ] EdgeGroupID ` json:"EdgeGroups" `
ProjectPath string ` json:"ProjectPath" `
EntryPoint string ` json:"EntryPoint" `
Version int ` json:"Version" `
2022-12-21 00:18:51 +00:00
NumDeployments int ` json:"NumDeployments" `
2021-09-09 08:38:34 +00:00
ManifestPath string
DeploymentType EdgeStackDeploymentType
2022-12-13 20:56:47 +00:00
// Uses the manifest's namespaces instead of the default one
UseManifestNamespaces bool
2021-09-09 08:38:34 +00:00
// Deprecated
Prune bool ` json:"Prune" `
2020-05-14 02:14:28 +00:00
}
2021-09-09 08:38:34 +00:00
EdgeStackDeploymentType int
2020-05-14 02:14:28 +00:00
//EdgeStackID represents an edge stack id
EdgeStackID int
2022-12-21 00:18:51 +00:00
EdgeStackStatusDetails struct {
Pending bool
Ok bool
Error bool
Acknowledged bool
Remove bool
RemoteUpdateSuccess bool
ImagesPulled bool
}
2020-05-14 02:14:28 +00:00
//EdgeStackStatus represents an edge stack status
EdgeStackStatus struct {
2022-12-21 00:18:51 +00:00
Details EdgeStackStatusDetails ` json:"Details" `
Error string ` json:"Error" `
EndpointID EndpointID ` json:"EndpointID" `
// Deprecated
Type EdgeStackStatusType ` json:"Type" `
2020-05-14 02:14:28 +00:00
}
//EdgeStackStatusType represents an edge stack status type
EdgeStackStatusType int
2021-09-20 00:14:22 +00:00
// Environment(Endpoint) represents a Docker environment(endpoint) with all the info required
2020-04-08 21:26:11 +00:00
// to connect to it
Endpoint struct {
2021-09-20 00:14:22 +00:00
// Environment(Endpoint) Identifier
2021-02-23 03:21:39 +00:00
ID EndpointID ` json:"Id" example:"1" `
2021-09-20 00:14:22 +00:00
// Environment(Endpoint) name
Name string ` json:"Name" example:"my-environment" `
// Environment(Endpoint) environment(endpoint) type. 1 for a Docker environment(endpoint), 2 for an agent on Docker environment(endpoint) or 3 for an Azure environment(endpoint).
2021-02-23 03:21:39 +00:00
Type EndpointType ` json:"Type" example:"1" `
2021-09-20 00:14:22 +00:00
// URL or IP address of the Docker host associated to this environment(endpoint)
2021-02-23 03:21:39 +00:00
URL string ` json:"URL" example:"docker.mydomain.tld:2375" `
2021-09-20 00:14:22 +00:00
// Environment(Endpoint) group identifier
2021-02-23 03:21:39 +00:00
GroupID EndpointGroupID ` json:"GroupId" example:"1" `
// URL or IP address where exposed containers will be reachable
2022-02-08 16:47:11 +00:00
PublicURL string ` json:"PublicURL" example:"docker.mydomain.tld:2375" `
2022-07-17 23:02:14 +00:00
Gpus [ ] Pair ` json:"Gpus" `
2022-02-08 16:47:11 +00:00
TLSConfig TLSConfiguration ` json:"TLSConfig" `
2022-11-16 17:55:08 +00:00
AzureCredentials AzureCredentials ` json:"AzureCredentials,omitempty" `
2021-09-20 00:14:22 +00:00
// List of tag identifiers to which this environment(endpoint) is associated
2021-02-23 03:21:39 +00:00
TagIDs [ ] TagID ` json:"TagIds" `
2021-09-20 00:14:22 +00:00
// The status of the environment(endpoint) (1 - up, 2 - down)
2021-02-23 03:21:39 +00:00
Status EndpointStatus ` json:"Status" example:"1" `
// List of snapshots
2022-11-16 17:55:08 +00:00
Snapshots [ ] DockerSnapshot ` json:"Snapshots" `
2021-09-20 00:14:22 +00:00
// List of user identifiers authorized to connect to this environment(endpoint)
2021-02-23 03:21:39 +00:00
UserAccessPolicies UserAccessPolicies ` json:"UserAccessPolicies" `
2021-09-20 00:14:22 +00:00
// List of team identifiers authorized to connect to this environment(endpoint)
2022-11-16 17:55:08 +00:00
TeamAccessPolicies TeamAccessPolicies ` json:"TeamAccessPolicies" `
2021-09-20 00:14:22 +00:00
// The identifier of the edge agent associated with this environment(endpoint)
2022-11-16 17:55:08 +00:00
EdgeID string ` json:"EdgeID,omitempty" `
2021-02-23 03:21:39 +00:00
// The key which is used to map the agent to Portainer
2022-11-16 17:55:08 +00:00
EdgeKey string ` json:"EdgeKey" `
2021-02-23 03:21:39 +00:00
// The check in interval for edge agent (in seconds)
EdgeCheckinInterval int ` json:"EdgeCheckinInterval" example:"5" `
// Associated Kubernetes data
2022-11-16 17:55:08 +00:00
Kubernetes KubernetesData ` json:"Kubernetes" `
2021-02-23 03:21:39 +00:00
// Maximum version of docker-compose
ComposeSyntaxMaxVersion string ` json:"ComposeSyntaxMaxVersion" example:"3.8" `
2021-09-20 00:14:22 +00:00
// Environment(Endpoint) specific security settings
2021-02-23 03:21:39 +00:00
SecuritySettings EndpointSecuritySettings
2022-01-23 19:48:04 +00:00
// The identifier of the AMT Device associated with this environment(endpoint)
AMTDeviceGUID string ` json:"AMTDeviceGUID,omitempty" example:"4c4c4544-004b-3910-8037-b6c04f504633" `
2021-03-01 00:43:47 +00:00
// LastCheckInDate mark last check-in date on checkin
LastCheckInDate int64
2022-03-14 01:53:23 +00:00
// QueryDate of each query with the endpoints list
QueryDate int64
2023-04-05 21:09:22 +00:00
// Heartbeat indicates the heartbeat status of an edge environment
Heartbeat bool ` json:"Heartbeat" example:"true" `
2023-03-28 06:19:22 +00:00
2022-01-23 19:48:04 +00:00
// Whether the device has been trusted or not by the user
UserTrusted bool
2020-06-04 05:35:09 +00:00
2022-11-01 22:17:32 +00:00
// Whether we need to run any "post init migrations".
PostInitMigrations EndpointPostInitMigrations ` json:"PostInitMigrations" `
2023-03-01 18:33:05 +00:00
Edge EnvironmentEdgeSettings
2022-06-26 05:38:23 +00:00
2022-08-11 04:32:12 +00:00
Agent struct {
Version string ` example:"1.0.0" `
}
2023-03-03 01:47:10 +00:00
EnableGPUManagement bool ` json:"EnableGPUManagement" `
2020-04-08 21:26:11 +00:00
// Deprecated fields
// Deprecated in DBVersion == 4
TLS bool ` json:"TLS,omitempty" `
2017-08-10 08:35:23 +00:00
TLSCACertPath string ` json:"TLSCACert,omitempty" `
TLSCertPath string ` json:"TLSCert,omitempty" `
TLSKeyPath string ` json:"TLSKey,omitempty" `
2020-04-08 21:26:11 +00:00
// Deprecated in DBVersion == 18
AuthorizedUsers [ ] UserID ` json:"AuthorizedUsers" `
AuthorizedTeams [ ] TeamID ` json:"AuthorizedTeams" `
// Deprecated in DBVersion == 22
Tags [ ] string ` json:"Tags" `
2023-03-28 06:19:22 +00:00
// Deprecated v2.18
IsEdgeDevice bool
2017-08-10 08:35:23 +00:00
}
2023-03-01 18:33:05 +00:00
EnvironmentEdgeSettings struct {
// Whether the device has been started in edge async mode
AsyncMode bool
// The ping interval for edge agent - used in edge async mode [seconds]
PingInterval int ` json:"PingInterval" example:"60" `
// The snapshot interval for edge agent - used in edge async mode [seconds]
SnapshotInterval int ` json:"SnapshotInterval" example:"60" `
// The command list interval for edge agent - used in edge async mode [seconds]
CommandInterval int ` json:"CommandInterval" example:"60" `
}
2021-09-20 00:14:22 +00:00
// EndpointAuthorizations represents the authorizations associated to a set of environments(endpoints)
2020-04-08 21:26:11 +00:00
EndpointAuthorizations map [ EndpointID ] Authorizations
2021-09-20 00:14:22 +00:00
// EndpointGroup represents a group of environments(endpoints)
2020-04-08 21:26:11 +00:00
EndpointGroup struct {
2021-09-20 00:14:22 +00:00
// Environment(Endpoint) group Identifier
2021-02-23 03:21:39 +00:00
ID EndpointGroupID ` json:"Id" example:"1" `
2021-09-20 00:14:22 +00:00
// Environment(Endpoint) group name
Name string ` json:"Name" example:"my-environment-group" `
// Description associated to the environment(endpoint) group
Description string ` json:"Description" example:"Environment(Endpoint) group description" `
2022-11-16 17:55:08 +00:00
UserAccessPolicies UserAccessPolicies ` json:"UserAccessPolicies" `
TeamAccessPolicies TeamAccessPolicies ` json:"TeamAccessPolicies" `
2021-09-20 00:14:22 +00:00
// List of tags associated to this environment(endpoint) group
2021-02-23 03:21:39 +00:00
TagIDs [ ] TagID ` json:"TagIds" `
2018-07-11 08:39:20 +00:00
2018-05-28 14:40:59 +00:00
// Deprecated fields
2020-04-08 21:26:11 +00:00
Labels [ ] Pair ` json:"Labels" `
2016-12-18 05:21:29 +00:00
2020-04-08 21:26:11 +00:00
// Deprecated in DBVersion == 18
AuthorizedUsers [ ] UserID ` json:"AuthorizedUsers" `
AuthorizedTeams [ ] TeamID ` json:"AuthorizedTeams" `
// Deprecated in DBVersion == 22
Tags [ ] string ` json:"Tags" `
2016-12-18 05:21:29 +00:00
}
2021-09-20 00:14:22 +00:00
// EndpointGroupID represents an environment(endpoint) group identifier
2020-04-08 21:26:11 +00:00
EndpointGroupID int
2017-03-12 16:24:15 +00:00
2021-09-20 00:14:22 +00:00
// EndpointID represents an environment(endpoint) identifier
2020-04-08 21:26:11 +00:00
EndpointID int
2017-03-12 16:24:15 +00:00
2021-09-20 00:14:22 +00:00
// EndpointStatus represents the status of an environment(endpoint)
2020-04-08 21:26:11 +00:00
EndpointStatus int
2017-08-10 08:35:23 +00:00
2021-09-20 00:14:22 +00:00
// EndpointSyncJob represents a scheduled job that synchronize environments(endpoints) based on an external file
2020-05-18 08:29:37 +00:00
// Deprecated
2020-04-08 21:26:11 +00:00
EndpointSyncJob struct { }
2017-05-23 18:56:10 +00:00
2021-09-20 00:14:22 +00:00
// EndpointSecuritySettings represents settings for an environment(endpoint)
2021-02-09 08:09:06 +00:00
EndpointSecuritySettings struct {
2021-02-23 03:21:39 +00:00
// Whether non-administrator should be able to use bind mounts when creating containers
2021-03-22 19:58:11 +00:00
AllowBindMountsForRegularUsers bool ` json:"allowBindMountsForRegularUsers" example:"false" `
2021-02-23 03:21:39 +00:00
// Whether non-administrator should be able to use privileged mode when creating containers
2021-03-22 19:58:11 +00:00
AllowPrivilegedModeForRegularUsers bool ` json:"allowPrivilegedModeForRegularUsers" example:"false" `
2021-02-23 03:21:39 +00:00
// Whether non-administrator should be able to browse volumes
2021-03-22 19:58:11 +00:00
AllowVolumeBrowserForRegularUsers bool ` json:"allowVolumeBrowserForRegularUsers" example:"true" `
2021-02-23 03:21:39 +00:00
// Whether non-administrator should be able to use the host pid
2021-03-22 19:58:11 +00:00
AllowHostNamespaceForRegularUsers bool ` json:"allowHostNamespaceForRegularUsers" example:"true" `
2021-02-23 03:21:39 +00:00
// Whether non-administrator should be able to use device mapping
2021-03-22 19:58:11 +00:00
AllowDeviceMappingForRegularUsers bool ` json:"allowDeviceMappingForRegularUsers" example:"true" `
2021-02-23 03:21:39 +00:00
// Whether non-administrator should be able to manage stacks
2021-03-22 19:58:11 +00:00
AllowStackManagementForRegularUsers bool ` json:"allowStackManagementForRegularUsers" example:"true" `
2021-02-23 03:21:39 +00:00
// Whether non-administrator should be able to use container capabilities
2021-03-22 19:58:11 +00:00
AllowContainerCapabilitiesForRegularUsers bool ` json:"allowContainerCapabilitiesForRegularUsers" example:"true" `
2021-04-12 07:40:45 +00:00
// Whether non-administrator should be able to use sysctl settings
2021-05-12 00:29:35 +00:00
AllowSysctlSettingForRegularUsers bool ` json:"allowSysctlSettingForRegularUsers" example:"true" `
2021-02-23 03:21:39 +00:00
// Whether host management features are enabled
2021-03-22 19:58:11 +00:00
EnableHostManagementFeatures bool ` json:"enableHostManagementFeatures" example:"true" `
2021-02-09 08:09:06 +00:00
}
2021-09-20 00:14:22 +00:00
// EndpointType represents the type of an environment(endpoint)
2020-04-08 21:26:11 +00:00
EndpointType int
2017-05-23 18:56:10 +00:00
2021-09-20 00:14:22 +00:00
// EndpointRelation represents a environment(endpoint) relation object
2020-05-14 02:14:28 +00:00
EndpointRelation struct {
EndpointID EndpointID
EdgeStacks map [ EdgeStackID ] bool
}
2022-11-01 22:17:32 +00:00
// EndpointPostInitMigrations
EndpointPostInitMigrations struct {
MigrateIngresses bool ` json:"MigrateIngresses" `
2023-03-03 01:47:10 +00:00
MigrateGPUs bool ` json:"MigrateGPUs" `
2022-11-01 22:17:32 +00:00
}
2020-08-11 05:41:37 +00:00
// Extension represents a deprecated Portainer extension
2020-04-08 21:26:11 +00:00
Extension struct {
2021-02-23 03:21:39 +00:00
// Extension Identifier
ID ExtensionID ` json:"Id" example:"1" `
2020-04-08 21:26:11 +00:00
Enabled bool ` json:"Enabled" `
Name string ` json:"Name,omitempty" `
ShortDescription string ` json:"ShortDescription,omitempty" `
Description string ` json:"Description,omitempty" `
DescriptionURL string ` json:"DescriptionURL,omitempty" `
Price string ` json:"Price,omitempty" `
PriceDescription string ` json:"PriceDescription,omitempty" `
Deal bool ` json:"Deal,omitempty" `
Available bool ` json:"Available,omitempty" `
License LicenseInformation ` json:"License,omitempty" `
Version string ` json:"Version" `
UpdateAvailable bool ` json:"UpdateAvailable" `
ShopURL string ` json:"ShopURL,omitempty" `
Images [ ] string ` json:"Images,omitempty" `
Logo string ` json:"Logo,omitempty" `
2017-05-23 18:56:10 +00:00
}
2020-04-08 21:26:11 +00:00
// ExtensionID represents a extension identifier
ExtensionID int
2017-05-23 18:56:10 +00:00
2020-04-08 21:26:11 +00:00
// GitlabRegistryData represents data required for gitlab registry to work
GitlabRegistryData struct {
ProjectID int ` json:"ProjectId" `
InstanceURL string ` json:"InstanceURL" `
ProjectPath string ` json:"ProjectPath" `
}
2017-05-23 18:56:10 +00:00
feat(helm/templates): helm app templates EE-943 (#5449)
* feat(helm): add helm chart backport to ce EE-1409 (#5425)
* EE-1311 Helm Chart Backport from EE
* backport to ce
Co-authored-by: Matt Hook <hookenz@gmail.com>
* feat(helm): list and configure helm chart (#5431)
* backport and tidyup code
* --amend
* using rocket icon for charts
* helm chart bugfix - clear category button
* added matomo analytics for helm chart install
* fix web editor exit warning without changes
* editor modified exit bugfix
* fixed notifications typo
* updated helm template text
* helper text to convey slow helm templates load
Co-authored-by: zees-dev <dev.786zshan@gmail.com>
* removing redundant time-consuming api call by using prop attribute
* feat(helm) helm chart backport from ee EE-1311 (#5436)
* Add missing defaultHelmRepoUrl and mock testing
* Backport EE-1477
* Backport updates to helm tests from EE
* add https by default changes and ssl to tls renaming from EE
* Port install integration test. Disabled by default to pass CI checks
* merged changes from EE for the integration test
* kube proxy whitelist updated to support internal helm install command
Co-authored-by: zees-dev <dev.786zshan@gmail.com>
* Pull in all changes from tech review in EE-943
* added helm to sidebar after rebase, sync CE with EE
* bugfix: kubectl shell not opening - bearer token bug
* tidy go modules & remove yarn-error.log
* removed redundant handler (not used) - to match EE
* resolved merge conflicts, updated code
* feat(helm/views): helm release and application views EE-1236 (#5529)
* feat(helm): add helm chart backport to ce EE-1409 (#5425)
* EE-1311 Helm Chart Backport from EE
* backport to ce
Co-authored-by: Matt Hook <hookenz@gmail.com>
* Pull in all changes from tech review in EE-943
* added helm to sidebar after rebase, sync CE with EE
* removed redundant handler (not used) - to match EE
* feat(helm) display helm charts - backend EE-1236
* copy over components for new applications view EE-1236
* Add new applications datatable component
* Add more migrated files
* removed test not applicable to CE
* baclkported EE app data table code to CE
* removed redundant helm repo url
* resolved conflicts, updated code
* using endpoint middleware
* PR review fixes
* using constants, openapi updated
Co-authored-by: Richard Wei <54336863+WaysonWei@users.noreply.github.com>
Co-authored-by: zees-dev <dev.786zshan@gmail.com>
* fixed test conflicts, go linted
* feat(helm/templates-add): helm templates add repo for user support EE-1278 (#5514)
* feat(helm): add helm chart backport to ce EE-1409 (#5425)
* EE-1311 Helm Chart Backport from EE
* backport to ce
Co-authored-by: Matt Hook <hookenz@gmail.com>
* feat(helm) helm chart backport from ee EE-1311 (#5436)
* Add missing defaultHelmRepoUrl and mock testing
* Backport EE-1477
* Backport updates to helm tests from EE
* add https by default changes and ssl to tls renaming from EE
* Port install integration test. Disabled by default to pass CI checks
* merged changes from EE for the integration test
* kube proxy whitelist updated to support internal helm install command
Co-authored-by: zees-dev <dev.786zshan@gmail.com>
* Pull in all changes from tech review in EE-943
* feat(helm): add helm chart backport to ce EE-1409 (#5425)
* EE-1311 Helm Chart Backport from EE
* backport to ce
Co-authored-by: Matt Hook <hookenz@gmail.com>
* Pull in all changes from tech review in EE-943
* added helm to sidebar after rebase, sync CE with EE
* backport EE-1278, squashed, diffed, updated
* helm install openapi spec update
* resolved conflicts, updated code
* - matching ee codebase at 0afe57034449ee0e9f333d92c252a13995a93019
- helm install using endpoint middleware
- remove trailing slash from added/persisted helm repo urls
* feat(helm) use libhelm url validator and improved path assembly EE-1554 (#5561)
* feat(helm/userrepos) fix getting global repo for ordinary users EE-1562 (#5567)
* feat(helm/userrepos) fix getting global repo for ordinary users EE-1562
* post review changes and further backported changes from EE
* resolved conflicts, updated code
* fixed helm_install handler unit test
* user cannot add existing repo if suffix is '/' (#5571)
* feat(helm/docs) fix broken swagger docs EE-1278 (#5572)
* Fix swagger docs
* minor correction
* fix(helm): migrating code from user handler to helm handler (#5573)
* - migrated user_helm_repos to helm endpoint handler
- migrated api operations from user factory/service to helm factory/service
- passing endpointId into helm service/factory as endpoint provider is deprecated
* upgrade libhelm to hide secrets
Co-authored-by: Matt Hook <hookenz@gmail.com>
* removed duplicate file - due to merge conflict
* dependency injection in helm factory
Co-authored-by: Richard Wei <54336863+WaysonWei@users.noreply.github.com>
Co-authored-by: Matt Hook <hookenz@gmail.com>
* kubernetes.templates -> kubernetes.templates.helm name conflict fix
* Validate the URL added as a public helm repo (#5579)
* fix(helm): helm app deletion fix EE-1581 (#5582)
* updated helm lib to show correct error on uninstall failure
* passing down helm app namespace on deletion
* fix(k8s): EE-1591 non-admin users cannot deploy charts containing secrets (#5590)
Co-authored-by: Simon Meng <simon.meng@portainer.io>
* fix(helm): helm epic bugfixes EE-1582 EE-1593 (#5585)
* - trim trailing slash and lowercase before persisting helm repo
- browser helm templates url /kubernetes/templates/templates -> /kubernetes/templates/helm
- fix publish url
- fix helm repo add refresh
- semi-fix k8s app expansion
* Tidy up swagger documentation related to helm. Make json consistent
* fixed helm release page for non-default namespaces
* k8s app view table expansion bugfix
* EE-1593: publish url load balancer fallback
Co-authored-by: Matt Hook <hookenz@gmail.com>
* k8s app list fix for charts with deployments containing multiple pods - which use the same label (#5599)
* fix(kubernetes): app list view fix for secrets with long keys or values EE-1600 (#5600)
* k8s app secrets key value text overflow ellipses
* wrapping key value pairs instead of ellipses
* fix(helm): helm apps bundling issue across different namespaces EE-1619 (#5602)
* helm apps bundling issue across different namespaces
* - code comments and indentation to ease reading
- moved namespace calc out of loop
* feat(helm/test) disable slow helm search test by default EE-1599 (#5598)
* skip helm_repo_search as it's an integration test
* switch to portainer built in integration test checker
* make module order match EE
* don't print test struct out when skipping integration test
Co-authored-by: Richard Wei <54336863+WaysonWei@users.noreply.github.com>
Co-authored-by: Matt Hook <hookenz@gmail.com>
Co-authored-by: cong meng <mcpacino@gmail.com>
Co-authored-by: Simon Meng <simon.meng@portainer.io>
2021-09-10 02:06:57 +00:00
HelmUserRepositoryID int
// HelmUserRepositories stores a Helm repository URL for the given user
HelmUserRepository struct {
// Membership Identifier
ID HelmUserRepositoryID ` json:"Id" example:"1" `
// User identifier
UserID UserID ` json:"UserId" example:"1" `
// Helm repository URL
URL string ` json:"URL" example:"https://charts.bitnami.com/bitnami" `
}
2021-03-12 23:47:35 +00:00
// QuayRegistryData represents data required for Quay registry to work
QuayRegistryData struct {
2021-04-06 10:08:43 +00:00
UseOrganisation bool ` json:"UseOrganisation" `
OrganisationName string ` json:"OrganisationName" `
2021-03-12 23:47:35 +00:00
}
2021-12-01 00:18:57 +00:00
// EcrData represents data required for ECR registry
EcrData struct {
Region string ` json:"Region" example:"ap-southeast-2" `
}
2020-04-08 21:26:11 +00:00
// JobType represents a job type
JobType int
2022-09-21 04:49:42 +00:00
K8sNamespaceInfo struct {
IsSystem bool ` json:"IsSystem" `
IsDefault bool ` json:"IsDefault" `
}
2021-08-31 21:08:01 +00:00
K8sNodeLimits struct {
CPU int64 ` json:"CPU" `
Memory int64 ` json:"Memory" `
}
K8sNodesLimits map [ string ] * K8sNodeLimits
2021-06-16 08:15:29 +00:00
K8sNamespaceAccessPolicy struct {
UserAccessPolicies UserAccessPolicies ` json:"UserAccessPolicies" `
TeamAccessPolicies TeamAccessPolicies ` json:"TeamAccessPolicies" `
}
2021-09-20 00:14:22 +00:00
// KubernetesData contains all the Kubernetes related environment(endpoint) information
2020-07-05 23:21:03 +00:00
KubernetesData struct {
Snapshots [ ] KubernetesSnapshot ` json:"Snapshots" `
Configuration KubernetesConfiguration ` json:"Configuration" `
2023-01-23 20:05:15 +00:00
Flags KubernetesFlags ` json:"Flags" `
}
2023-03-16 02:39:26 +00:00
// KubernetesFlags are used to detect if we need to run initial cluster
// detection again.
2023-01-23 20:05:15 +00:00
KubernetesFlags struct {
2023-03-16 02:39:26 +00:00
IsServerMetricsDetected bool ` json:"IsServerMetricsDetected" `
IsServerIngressClassDetected bool ` json:"IsServerIngressClassDetected" `
IsServerStorageDetected bool ` json:"IsServerStorageDetected" `
2020-07-05 23:21:03 +00:00
}
2021-09-20 00:14:22 +00:00
// KubernetesSnapshot represents a snapshot of a specific Kubernetes environment(endpoint) at a specific time
2020-07-05 23:21:03 +00:00
KubernetesSnapshot struct {
Time int64 ` json:"Time" `
KubernetesVersion string ` json:"KubernetesVersion" `
NodeCount int ` json:"NodeCount" `
TotalCPU int64 ` json:"TotalCPU" `
TotalMemory int64 ` json:"TotalMemory" `
}
2021-09-20 00:14:22 +00:00
// KubernetesConfiguration represents the configuration of a Kubernetes environment(endpoint)
2020-07-05 23:21:03 +00:00
KubernetesConfiguration struct {
2022-09-26 19:43:24 +00:00
UseLoadBalancer bool ` json:"UseLoadBalancer" `
UseServerMetrics bool ` json:"UseServerMetrics" `
EnableResourceOverCommit bool ` json:"EnableResourceOverCommit" `
ResourceOverCommitPercentage int ` json:"ResourceOverCommitPercentage" `
StorageClasses [ ] KubernetesStorageClassConfig ` json:"StorageClasses" `
IngressClasses [ ] KubernetesIngressClassConfig ` json:"IngressClasses" `
RestrictDefaultNamespace bool ` json:"RestrictDefaultNamespace" `
IngressAvailabilityPerNamespace bool ` json:"IngressAvailabilityPerNamespace" `
2022-10-24 20:41:30 +00:00
AllowNoneIngressClass bool ` json:"AllowNoneIngressClass" `
2020-07-05 23:21:03 +00:00
}
// KubernetesStorageClassConfig represents a Kubernetes Storage Class configuration
KubernetesStorageClassConfig struct {
2020-08-07 04:40:24 +00:00
Name string ` json:"Name" `
AccessModes [ ] string ` json:"AccessModes" `
Provisioner string ` json:"Provisioner" `
AllowVolumeExpansion bool ` json:"AllowVolumeExpansion" `
2020-07-05 23:21:03 +00:00
}
2020-08-20 00:51:14 +00:00
// KubernetesIngressClassConfig represents a Kubernetes Ingress Class configuration
KubernetesIngressClassConfig struct {
2022-09-21 04:49:42 +00:00
Name string ` json:"Name" `
Type string ` json:"Type" `
2022-09-26 19:43:24 +00:00
GloballyBlocked bool ` json:"Blocked" `
2022-09-21 04:49:42 +00:00
BlockedNamespaces [ ] string ` json:"BlockedNamespaces" `
2020-08-20 00:51:14 +00:00
}
2021-08-05 03:02:06 +00:00
// KubernetesShellPod represents a Kubectl Shell details to facilitate pod exec functionality
KubernetesShellPod struct {
Namespace string
PodName string
ContainerName string
ShellExecCommand string
}
2022-06-03 04:00:13 +00:00
// InternalAuthSettings represents settings used for the default 'internal' authentication
InternalAuthSettings struct {
RequiredPasswordLength int
}
2020-04-08 21:26:11 +00:00
// LDAPGroupSearchSettings represents settings used to search for groups in a LDAP server
LDAPGroupSearchSettings struct {
2021-02-23 03:21:39 +00:00
// The distinguished name of the element from which the LDAP server will search for groups
GroupBaseDN string ` json:"GroupBaseDN" example:"dc=ldap,dc=domain,dc=tld" `
// The LDAP search filter used to select group elements, optional
GroupFilter string ` json:"GroupFilter" example:"(objectClass=account" `
// LDAP attribute which denotes the group membership
GroupAttribute string ` json:"GroupAttribute" example:"member" `
2016-12-18 05:21:29 +00:00
}
2020-04-08 21:26:11 +00:00
// LDAPSearchSettings represents settings used to search for users in a LDAP server
LDAPSearchSettings struct {
2021-02-23 03:21:39 +00:00
// The distinguished name of the element from which the LDAP server will search for users
BaseDN string ` json:"BaseDN" example:"dc=ldap,dc=domain,dc=tld" `
// Optional LDAP search filter used to select user elements
Filter string ` json:"Filter" example:"(objectClass=account)" `
// LDAP attribute which denotes the username
UserNameAttribute string ` json:"UserNameAttribute" example:"uid" `
2020-04-08 21:26:11 +00:00
}
2017-10-15 17:24:40 +00:00
2020-04-08 21:26:11 +00:00
// LDAPSettings represents the settings used to connect to a LDAP server
LDAPSettings struct {
2021-02-23 03:21:39 +00:00
// Enable this option if the server is configured for Anonymous access. When enabled, ReaderDN and Password will not be used
2022-04-14 04:25:13 +00:00
AnonymousMode bool ` json:"AnonymousMode" example:"true" validate:"validate_bool" `
2021-02-23 03:21:39 +00:00
// Account that will be used to search for users
2022-04-14 04:25:13 +00:00
ReaderDN string ` json:"ReaderDN" example:"cn=readonly-account,dc=ldap,dc=domain,dc=tld" validate:"required_if=AnonymousMode false" `
2021-02-23 03:21:39 +00:00
// Password of the account that will be used to search users
2022-04-14 04:25:13 +00:00
Password string ` json:"Password,omitempty" example:"readonly-password" validate:"required_if=AnonymousMode false" `
2021-02-23 03:21:39 +00:00
// URL or IP address of the LDAP server
2022-04-14 04:25:13 +00:00
URL string ` json:"URL" example:"myldap.domain.tld:389" validate:"hostname_port" `
2021-02-23 03:21:39 +00:00
TLSConfig TLSConfiguration ` json:"TLSConfig" `
// Whether LDAP connection should use StartTLS
StartTLS bool ` json:"StartTLS" example:"true" `
2020-04-08 21:26:11 +00:00
SearchSettings [ ] LDAPSearchSettings ` json:"SearchSettings" `
GroupSearchSettings [ ] LDAPGroupSearchSettings ` json:"GroupSearchSettings" `
2021-02-23 03:21:39 +00:00
// Automatically provision users and assign them to matching LDAP group names
AutoCreateUsers bool ` json:"AutoCreateUsers" example:"true" `
2020-04-08 21:26:11 +00:00
}
2018-06-11 13:13:19 +00:00
2021-10-06 06:24:26 +00:00
// LDAPUser represents a LDAP user
LDAPUser struct {
Name string
Groups [ ] string
}
2020-04-08 21:26:11 +00:00
// LicenseInformation represents information about an extension license
LicenseInformation struct {
LicenseKey string ` json:"LicenseKey,omitempty" `
Company string ` json:"Company,omitempty" `
Expiration string ` json:"Expiration,omitempty" `
Valid bool ` json:"Valid,omitempty" `
2017-10-15 17:24:40 +00:00
}
2020-04-08 21:26:11 +00:00
// MembershipRole represents the role of a user within a team
MembershipRole int
2017-06-20 11:00:32 +00:00
2020-04-08 21:26:11 +00:00
// OAuthSettings represents the settings used to authorize with an authorization server
OAuthSettings struct {
ClientID string ` json:"ClientID" `
ClientSecret string ` json:"ClientSecret,omitempty" `
AccessTokenURI string ` json:"AccessTokenURI" `
AuthorizationURI string ` json:"AuthorizationURI" `
ResourceURI string ` json:"ResourceURI" `
RedirectURI string ` json:"RedirectURI" `
UserIdentifier string ` json:"UserIdentifier" `
Scopes string ` json:"Scopes" `
OAuthAutoCreateUsers bool ` json:"OAuthAutoCreateUsers" `
DefaultTeamID TeamID ` json:"DefaultTeamID" `
2021-06-10 22:09:04 +00:00
SSO bool ` json:"SSO" `
LogoutURI string ` json:"LogoutURI" `
2021-11-15 21:45:20 +00:00
KubeSecretKey [ ] byte ` json:"KubeSecretKey" `
2020-04-08 21:26:11 +00:00
}
2018-12-09 03:49:27 +00:00
2020-04-08 21:26:11 +00:00
// Pair defines a key/value string pair
Pair struct {
2021-02-23 03:21:39 +00:00
Name string ` json:"name" example:"name" `
Value string ` json:"value" example:"value" `
2019-11-12 03:28:31 +00:00
}
2017-06-20 11:00:32 +00:00
// Registry represents a Docker registry with all the info required
2018-08-21 18:40:42 +00:00
// to connect to it
2017-06-20 11:00:32 +00:00
Registry struct {
2021-02-23 03:21:39 +00:00
// Registry Identifier
ID RegistryID ` json:"Id" example:"1" `
2021-12-01 00:18:57 +00:00
// Registry Type (1 - Quay, 2 - Azure, 3 - Custom, 4 - Gitlab, 5 - ProGet, 6 - DockerHub, 7 - ECR)
Type RegistryType ` json:"Type" enums:"1,2,3,4,5,6,7" `
2021-02-23 03:21:39 +00:00
// Registry Name
Name string ` json:"Name" example:"my-registry" `
// URL or IP address of the Docker registry
URL string ` json:"URL" example:"registry.mydomain.tld:2375" `
2021-07-01 02:57:15 +00:00
// Base URL, introduced for ProGet registry
BaseURL string ` json:"BaseURL" example:"registry.mydomain.tld:2375" `
2021-02-23 03:21:39 +00:00
// Is authentication against this registry enabled
Authentication bool ` json:"Authentication" example:"true" `
2021-12-01 00:18:57 +00:00
// Username or AccessKeyID used to authenticate against this registry
2021-02-23 03:21:39 +00:00
Username string ` json:"Username" example:"registry user" `
2021-12-01 00:18:57 +00:00
// Password or SecretAccessKey used to authenticate against this registry
2021-02-23 03:21:39 +00:00
Password string ` json:"Password,omitempty" example:"registry_password" `
2018-12-09 03:49:27 +00:00
ManagementConfiguration * RegistryManagementConfiguration ` json:"ManagementConfiguration" `
2019-11-12 03:28:31 +00:00
Gitlab GitlabRegistryData ` json:"Gitlab" `
2021-03-12 23:47:35 +00:00
Quay QuayRegistryData ` json:"Quay" `
2021-12-14 00:40:44 +00:00
Ecr EcrData ` json:"Ecr" `
2021-07-14 09:15:21 +00:00
RegistryAccesses RegistryAccesses ` json:"RegistryAccesses" `
2019-05-24 06:04:58 +00:00
// Deprecated fields
2021-07-14 09:15:21 +00:00
// Deprecated in DBVersion == 31
UserAccessPolicies UserAccessPolicies ` json:"UserAccessPolicies" `
// Deprecated in DBVersion == 31
TeamAccessPolicies TeamAccessPolicies ` json:"TeamAccessPolicies" `
2019-05-24 06:04:58 +00:00
// Deprecated in DBVersion == 18
AuthorizedUsers [ ] UserID ` json:"AuthorizedUsers" `
2021-07-14 09:15:21 +00:00
// Deprecated in DBVersion == 18
2019-05-24 06:04:58 +00:00
AuthorizedTeams [ ] TeamID ` json:"AuthorizedTeams" `
2021-12-01 00:18:57 +00:00
// Stores temporary access token
AccessToken string ` json:"AccessToken,omitempty" `
AccessTokenExpiry int64 ` json:"AccessTokenExpiry,omitempty" `
2018-12-09 03:49:27 +00:00
}
2021-07-14 09:15:21 +00:00
RegistryAccesses map [ EndpointID ] RegistryAccessPolicies
RegistryAccessPolicies struct {
UserAccessPolicies UserAccessPolicies ` json:"UserAccessPolicies" `
TeamAccessPolicies TeamAccessPolicies ` json:"TeamAccessPolicies" `
Namespaces [ ] string ` json:"Namespaces" `
}
2020-04-08 21:26:11 +00:00
// RegistryID represents a registry identifier
RegistryID int
2018-12-09 03:49:27 +00:00
// RegistryManagementConfiguration represents a configuration that can be used to query
// the registry API via the registry management extension.
RegistryManagementConfiguration struct {
2021-12-01 00:18:57 +00:00
Type RegistryType ` json:"Type" `
Authentication bool ` json:"Authentication" `
Username string ` json:"Username" `
Password string ` json:"Password" `
TLSConfig TLSConfiguration ` json:"TLSConfig" `
Ecr EcrData ` json:"Ecr" `
AccessToken string ` json:"AccessToken,omitempty" `
AccessTokenExpiry int64 ` json:"AccessTokenExpiry,omitempty" `
2017-06-20 11:00:32 +00:00
}
2020-04-08 21:26:11 +00:00
// RegistryType represents a type of registry
RegistryType int
2016-12-25 20:34:02 +00:00
2020-04-08 21:26:11 +00:00
// ResourceAccessLevel represents the level of control associated to a resource
ResourceAccessLevel int
2018-05-06 07:15:57 +00:00
2020-04-08 21:26:11 +00:00
// ResourceControl represent a reference to a Docker resource with specific access controls
ResourceControl struct {
2021-02-23 03:21:39 +00:00
// ResourceControl Identifier
ID ResourceControlID ` json:"Id" example:"1" `
// Docker resource identifier on which access control will be applied.\
// In the case of a resource control applied to a stack, use the stack name as identifier
ResourceID string ` json:"ResourceId" example:"617c5f22bb9b023d6daab7cba43a57576f83492867bc767d1c59416b065e5f08" `
// List of Docker resources that will inherit this access control
SubResourceIDs [ ] string ` json:"SubResourceIds" example:"617c5f22bb9b023d6daab7cba43a57576f83492867bc767d1c59416b065e5f08" `
// Type of Docker resource. Valid values are: 1- container, 2 -service
// 3 - volume, 4 - secret, 5 - stack, 6 - config or 7 - custom template
Type ResourceControlType ` json:"Type" example:"1" `
2022-11-16 17:55:08 +00:00
UserAccesses [ ] UserResourceAccess ` json:"UserAccesses" `
TeamAccesses [ ] TeamResourceAccess ` json:"TeamAccesses" `
2021-02-23 03:21:39 +00:00
// Permit access to the associated resource to any user
Public bool ` json:"Public" example:"true" `
// Permit access to resource only to admins
AdministratorsOnly bool ` json:"AdministratorsOnly" example:"true" `
2022-11-16 17:55:08 +00:00
System bool ` json:"System" `
2018-07-11 08:39:20 +00:00
2017-09-14 06:08:37 +00:00
// Deprecated fields
2020-04-08 21:26:11 +00:00
// Deprecated in DBVersion == 2
OwnerID UserID ` json:"OwnerId,omitempty" `
AccessLevel ResourceAccessLevel ` json:"AccessLevel,omitempty" `
2019-05-24 06:04:58 +00:00
}
2020-04-08 21:26:11 +00:00
// ResourceControlID represents a resource control identifier
ResourceControlID int
2019-05-24 06:04:58 +00:00
2020-04-08 21:26:11 +00:00
// ResourceControlType represents the type of resource associated to the resource control (volume, container, service...)
ResourceControlType int
2019-05-24 06:04:58 +00:00
// Role represents a set of authorizations that can be associated to a user or
// to a team.
Role struct {
2021-02-23 03:21:39 +00:00
// Role Identifier
ID RoleID ` json:"Id" example:"1" `
// Role name
Name string ` json:"Name" example:"HelpDesk" `
// Role description
2021-09-20 00:14:22 +00:00
Description string ` json:"Description" example:"Read-only access of all resources in an environment(endpoint)" `
2021-02-23 03:21:39 +00:00
// Authorizations associated to a role
2019-05-24 06:04:58 +00:00
Authorizations Authorizations ` json:"Authorizations" `
2019-11-18 08:22:47 +00:00
Priority int ` json:"Priority" `
2019-05-24 06:04:58 +00:00
}
2020-04-08 21:26:11 +00:00
// RoleID represents a role identifier
RoleID int
2018-11-06 09:49:48 +00:00
2021-11-30 02:31:16 +00:00
// APIKeyID represents an API key identifier
APIKeyID int
// APIKey represents an API key
APIKey struct {
ID APIKeyID ` json:"id" example:"1" `
UserID UserID ` json:"userId" example:"1" `
Description string ` json:"description" example:"portainer-api-key" `
Prefix string ` json:"prefix" ` // API key identifier (7 char prefix)
DateCreated int64 ` json:"dateCreated" ` // Unix timestamp (UTC) when the API key was created
LastUsed int64 ` json:"lastUsed" ` // Unix timestamp (UTC) when the API key was last used
Digest [ ] byte ` json:"digest,omitempty" ` // Digest represents SHA256 hash of the raw API key
}
2018-11-06 09:49:48 +00:00
// Schedule represents a scheduled job.
// It only contains a pointer to one of the JobRunner implementations
2018-12-06 19:53:23 +00:00
// based on the JobType.
// NOTE: The Recurring option is only used by ScriptExecutionJob at the moment
2020-06-25 03:25:51 +00:00
// Deprecated in favor of EdgeJob
2018-11-05 20:58:15 +00:00
Schedule struct {
2021-02-23 03:21:39 +00:00
// Schedule Identifier
ID ScheduleID ` json:"Id" example:"1" `
2020-06-25 03:25:51 +00:00
Name string
CronExpression string
Recurring bool
Created int64
JobType JobType
EdgeSchedule * EdgeSchedule
2018-11-05 20:58:15 +00:00
}
2020-04-08 21:26:11 +00:00
// ScheduleID represents a schedule identifier.
2020-06-25 03:25:51 +00:00
// Deprecated in favor of EdgeJob
2020-04-08 21:26:11 +00:00
ScheduleID int
2018-09-03 10:08:03 +00:00
2020-04-08 21:26:11 +00:00
// ScriptExecutionJob represents a scheduled job that can execute a script via a privileged container
ScriptExecutionJob struct {
Endpoints [ ] EndpointID
Image string
ScriptPath string
RetryCount int
RetryInterval int
2018-09-03 10:08:03 +00:00
}
2020-04-08 21:26:11 +00:00
// Settings represents the application settings
Settings struct {
2021-02-23 03:21:39 +00:00
// URL to a logo that will be displayed on the login page as well as on top of the sidebar. Will use default Portainer logo when value is empty string
LogoURL string ` json:"LogoURL" example:"https://mycompany.mydomain.tld/logo.png" `
// A list of label name & value that will be used to hide containers when querying containers
BlackListedLabels [ ] Pair ` json:"BlackListedLabels" `
// Active authentication method for the Portainer instance. Valid values are: 1 for internal, 2 for LDAP, or 3 for oauth
2023-02-12 22:28:32 +00:00
AuthenticationMethod AuthenticationMethod ` json:"AuthenticationMethod" example:"1" `
InternalAuthSettings InternalAuthSettings ` json:"InternalAuthSettings" `
LDAPSettings LDAPSettings ` json:"LDAPSettings" `
OAuthSettings OAuthSettings ` json:"OAuthSettings" `
OpenAMTConfiguration OpenAMTConfiguration ` json:"openAMTConfiguration" `
FDOConfiguration FDOConfiguration ` json:"fdoConfiguration" `
FeatureFlagSettings map [ featureflags . Feature ] bool ` json:"FeatureFlagSettings" `
2021-09-20 00:14:22 +00:00
// The interval in which environment(endpoint) snapshots are created
2021-02-23 03:21:39 +00:00
SnapshotInterval string ` json:"SnapshotInterval" example:"5m" `
// URL to the templates that will be displayed in the UI when navigating to App Templates
TemplatesURL string ` json:"TemplatesURL" example:"https://raw.githubusercontent.com/portainer/templates/master/templates.json" `
// The default check in interval for edge agent (in seconds)
EdgeAgentCheckinInterval int ` json:"EdgeAgentCheckinInterval" example:"5" `
2022-12-01 00:46:23 +00:00
// Show the Kompose build option (discontinued in 2.18)
ShowKomposeBuildOption bool ` json:"ShowKomposeBuildOption" example:"false" `
2021-02-23 03:21:39 +00:00
// Whether edge compute features are enabled
2022-11-16 17:55:08 +00:00
EnableEdgeComputeFeatures bool ` json:"EnableEdgeComputeFeatures" `
2021-02-23 03:21:39 +00:00
// The duration of a user session
UserSessionTimeout string ` json:"UserSessionTimeout" example:"5m" `
2021-08-31 21:23:21 +00:00
// The expiry of a Kubeconfig
KubeconfigExpiry string ` json:"KubeconfigExpiry" example:"24h" `
2021-02-23 03:21:39 +00:00
// Whether telemetry is enabled
EnableTelemetry bool ` json:"EnableTelemetry" example:"false" `
feat(helm/templates): helm app templates EE-943 (#5449)
* feat(helm): add helm chart backport to ce EE-1409 (#5425)
* EE-1311 Helm Chart Backport from EE
* backport to ce
Co-authored-by: Matt Hook <hookenz@gmail.com>
* feat(helm): list and configure helm chart (#5431)
* backport and tidyup code
* --amend
* using rocket icon for charts
* helm chart bugfix - clear category button
* added matomo analytics for helm chart install
* fix web editor exit warning without changes
* editor modified exit bugfix
* fixed notifications typo
* updated helm template text
* helper text to convey slow helm templates load
Co-authored-by: zees-dev <dev.786zshan@gmail.com>
* removing redundant time-consuming api call by using prop attribute
* feat(helm) helm chart backport from ee EE-1311 (#5436)
* Add missing defaultHelmRepoUrl and mock testing
* Backport EE-1477
* Backport updates to helm tests from EE
* add https by default changes and ssl to tls renaming from EE
* Port install integration test. Disabled by default to pass CI checks
* merged changes from EE for the integration test
* kube proxy whitelist updated to support internal helm install command
Co-authored-by: zees-dev <dev.786zshan@gmail.com>
* Pull in all changes from tech review in EE-943
* added helm to sidebar after rebase, sync CE with EE
* bugfix: kubectl shell not opening - bearer token bug
* tidy go modules & remove yarn-error.log
* removed redundant handler (not used) - to match EE
* resolved merge conflicts, updated code
* feat(helm/views): helm release and application views EE-1236 (#5529)
* feat(helm): add helm chart backport to ce EE-1409 (#5425)
* EE-1311 Helm Chart Backport from EE
* backport to ce
Co-authored-by: Matt Hook <hookenz@gmail.com>
* Pull in all changes from tech review in EE-943
* added helm to sidebar after rebase, sync CE with EE
* removed redundant handler (not used) - to match EE
* feat(helm) display helm charts - backend EE-1236
* copy over components for new applications view EE-1236
* Add new applications datatable component
* Add more migrated files
* removed test not applicable to CE
* baclkported EE app data table code to CE
* removed redundant helm repo url
* resolved conflicts, updated code
* using endpoint middleware
* PR review fixes
* using constants, openapi updated
Co-authored-by: Richard Wei <54336863+WaysonWei@users.noreply.github.com>
Co-authored-by: zees-dev <dev.786zshan@gmail.com>
* fixed test conflicts, go linted
* feat(helm/templates-add): helm templates add repo for user support EE-1278 (#5514)
* feat(helm): add helm chart backport to ce EE-1409 (#5425)
* EE-1311 Helm Chart Backport from EE
* backport to ce
Co-authored-by: Matt Hook <hookenz@gmail.com>
* feat(helm) helm chart backport from ee EE-1311 (#5436)
* Add missing defaultHelmRepoUrl and mock testing
* Backport EE-1477
* Backport updates to helm tests from EE
* add https by default changes and ssl to tls renaming from EE
* Port install integration test. Disabled by default to pass CI checks
* merged changes from EE for the integration test
* kube proxy whitelist updated to support internal helm install command
Co-authored-by: zees-dev <dev.786zshan@gmail.com>
* Pull in all changes from tech review in EE-943
* feat(helm): add helm chart backport to ce EE-1409 (#5425)
* EE-1311 Helm Chart Backport from EE
* backport to ce
Co-authored-by: Matt Hook <hookenz@gmail.com>
* Pull in all changes from tech review in EE-943
* added helm to sidebar after rebase, sync CE with EE
* backport EE-1278, squashed, diffed, updated
* helm install openapi spec update
* resolved conflicts, updated code
* - matching ee codebase at 0afe57034449ee0e9f333d92c252a13995a93019
- helm install using endpoint middleware
- remove trailing slash from added/persisted helm repo urls
* feat(helm) use libhelm url validator and improved path assembly EE-1554 (#5561)
* feat(helm/userrepos) fix getting global repo for ordinary users EE-1562 (#5567)
* feat(helm/userrepos) fix getting global repo for ordinary users EE-1562
* post review changes and further backported changes from EE
* resolved conflicts, updated code
* fixed helm_install handler unit test
* user cannot add existing repo if suffix is '/' (#5571)
* feat(helm/docs) fix broken swagger docs EE-1278 (#5572)
* Fix swagger docs
* minor correction
* fix(helm): migrating code from user handler to helm handler (#5573)
* - migrated user_helm_repos to helm endpoint handler
- migrated api operations from user factory/service to helm factory/service
- passing endpointId into helm service/factory as endpoint provider is deprecated
* upgrade libhelm to hide secrets
Co-authored-by: Matt Hook <hookenz@gmail.com>
* removed duplicate file - due to merge conflict
* dependency injection in helm factory
Co-authored-by: Richard Wei <54336863+WaysonWei@users.noreply.github.com>
Co-authored-by: Matt Hook <hookenz@gmail.com>
* kubernetes.templates -> kubernetes.templates.helm name conflict fix
* Validate the URL added as a public helm repo (#5579)
* fix(helm): helm app deletion fix EE-1581 (#5582)
* updated helm lib to show correct error on uninstall failure
* passing down helm app namespace on deletion
* fix(k8s): EE-1591 non-admin users cannot deploy charts containing secrets (#5590)
Co-authored-by: Simon Meng <simon.meng@portainer.io>
* fix(helm): helm epic bugfixes EE-1582 EE-1593 (#5585)
* - trim trailing slash and lowercase before persisting helm repo
- browser helm templates url /kubernetes/templates/templates -> /kubernetes/templates/helm
- fix publish url
- fix helm repo add refresh
- semi-fix k8s app expansion
* Tidy up swagger documentation related to helm. Make json consistent
* fixed helm release page for non-default namespaces
* k8s app view table expansion bugfix
* EE-1593: publish url load balancer fallback
Co-authored-by: Matt Hook <hookenz@gmail.com>
* k8s app list fix for charts with deployments containing multiple pods - which use the same label (#5599)
* fix(kubernetes): app list view fix for secrets with long keys or values EE-1600 (#5600)
* k8s app secrets key value text overflow ellipses
* wrapping key value pairs instead of ellipses
* fix(helm): helm apps bundling issue across different namespaces EE-1619 (#5602)
* helm apps bundling issue across different namespaces
* - code comments and indentation to ease reading
- moved namespace calc out of loop
* feat(helm/test) disable slow helm search test by default EE-1599 (#5598)
* skip helm_repo_search as it's an integration test
* switch to portainer built in integration test checker
* make module order match EE
* don't print test struct out when skipping integration test
Co-authored-by: Richard Wei <54336863+WaysonWei@users.noreply.github.com>
Co-authored-by: Matt Hook <hookenz@gmail.com>
Co-authored-by: cong meng <mcpacino@gmail.com>
Co-authored-by: Simon Meng <simon.meng@portainer.io>
2021-09-10 02:06:57 +00:00
// Helm repository URL, defaults to "https://charts.bitnami.com/bitnami"
HelmRepositoryURL string ` json:"HelmRepositoryURL" example:"https://charts.bitnami.com/bitnami" `
2021-09-28 22:39:45 +00:00
// KubectlImage, defaults to portainer/kubectl-shell
KubectlShellImage string ` json:"KubectlShellImage" example:"portainer/kubectl-shell" `
2022-04-19 18:43:36 +00:00
// TrustOnFirstConnect makes Portainer accepting edge agent connection by default
TrustOnFirstConnect bool ` json:"TrustOnFirstConnect" example:"false" `
2022-01-23 19:48:04 +00:00
// EnforceEdgeID makes Portainer store the Edge ID instead of accepting anyone
EnforceEdgeID bool ` json:"EnforceEdgeID" example:"false" `
2022-04-12 10:45:58 +00:00
// Container environment parameter AGENT_SECRET
AgentSecret string ` json:"AgentSecret" `
2022-04-14 10:14:23 +00:00
// EdgePortainerURL is the URL that is exposed to edge agents
EdgePortainerURL string ` json:"EdgePortainerUrl" `
2020-04-08 21:26:11 +00:00
2022-06-26 05:38:23 +00:00
Edge struct {
// The command list interval for edge agent - used in edge async mode (in seconds)
CommandInterval int ` json:"CommandInterval" example:"5" `
// The ping interval for edge agent - used in edge async mode (in seconds)
PingInterval int ` json:"PingInterval" example:"5" `
// The snapshot interval for edge agent - used in edge async mode (in seconds)
SnapshotInterval int ` json:"SnapshotInterval" example:"5" `
2023-03-01 18:33:05 +00:00
// Deprecated 2.18
2022-06-26 05:38:23 +00:00
AsyncMode bool
}
2020-04-08 21:26:11 +00:00
// Deprecated fields
DisplayDonationHeader bool
DisplayExternalContributors bool
2021-02-09 08:09:06 +00:00
// Deprecated fields v26
EnableHostManagementFeatures bool ` json:"EnableHostManagementFeatures" `
AllowVolumeBrowserForRegularUsers bool ` json:"AllowVolumeBrowserForRegularUsers" `
AllowBindMountsForRegularUsers bool ` json:"AllowBindMountsForRegularUsers" `
AllowPrivilegedModeForRegularUsers bool ` json:"AllowPrivilegedModeForRegularUsers" `
AllowHostNamespaceForRegularUsers bool ` json:"AllowHostNamespaceForRegularUsers" `
AllowStackManagementForRegularUsers bool ` json:"AllowStackManagementForRegularUsers" `
AllowDeviceMappingForRegularUsers bool ` json:"AllowDeviceMappingForRegularUsers" `
AllowContainerCapabilitiesForRegularUsers bool ` json:"AllowContainerCapabilitiesForRegularUsers" `
2018-05-28 14:40:33 +00:00
}
2021-09-20 00:14:22 +00:00
// SnapshotJob represents a scheduled job that can create environment(endpoint) snapshots
2020-07-05 23:21:03 +00:00
SnapshotJob struct { }
2018-07-11 08:39:20 +00:00
2021-02-22 22:14:52 +00:00
// SoftwareEdition represents an edition of Portainer
SoftwareEdition int
2021-08-10 04:59:47 +00:00
// SSLSettings represents a pair of SSL certificate and key
SSLSettings struct {
CertPath string ` json:"certPath" `
KeyPath string ` json:"keyPath" `
SelfSigned bool ` json:"selfSigned" `
HTTPEnabled bool ` json:"httpEnabled" `
}
2020-04-08 21:26:11 +00:00
// Stack represents a Docker stack created via docker stack deploy
Stack struct {
2021-02-23 03:21:39 +00:00
// Stack Identifier
ID StackID ` json:"Id" example:"1" `
// Stack name
Name string ` json:"Name" example:"myStack" `
// Stack type. 1 for a Swarm stack, 2 for a Compose stack
Type StackType ` json:"Type" example:"2" `
2021-09-20 00:14:22 +00:00
// Environment(Endpoint) identifier. Reference the environment(endpoint) that will be used for deployment
2021-02-23 03:21:39 +00:00
EndpointID EndpointID ` json:"EndpointId" example:"1" `
// Cluster identifier of the Swarm cluster where the stack is deployed
SwarmID string ` json:"SwarmId" example:"jpofkc0i9uo9wtx1zesuk649w" `
// Path to the Stack file
EntryPoint string ` json:"EntryPoint" example:"docker-compose.yml" `
2021-09-20 00:14:22 +00:00
// A list of environment(endpoint) variables used during stack deployment
2022-11-16 17:55:08 +00:00
Env [ ] Pair ` json:"Env" `
2021-02-23 03:21:39 +00:00
//
2022-11-16 17:55:08 +00:00
ResourceControl * ResourceControl ` json:"ResourceControl" `
2021-02-23 03:21:39 +00:00
// Stack status (1 - active, 2 - inactive)
Status StackStatus ` json:"Status" example:"1" `
// Path on disk to the repository hosting the Stack file
ProjectPath string ` example:"/data/compose/myStack_jpofkc0i9uo9wtx1zesuk649w" `
// The date in unix time when stack was created
CreationDate int64 ` example:"1587399600" `
// The username which created this stack
CreatedBy string ` example:"admin" `
// The date in unix time when stack was last updated
UpdateDate int64 ` example:"1587399600" `
// The username which last updated this stack
UpdatedBy string ` example:"bob" `
2021-08-17 01:12:07 +00:00
// Only applies when deploying stack with multiple files
AdditionalFiles [ ] string ` json:"AdditionalFiles" `
// The auto update settings of a git stack
2023-03-02 15:07:50 +00:00
AutoUpdate * AutoUpdateSettings ` json:"AutoUpdate" `
2022-07-03 23:39:03 +00:00
// The stack deployment option
Option * StackOption ` json:"Option" `
2021-06-15 21:11:35 +00:00
// The git config of this stack
GitConfig * gittypes . RepoConfig
2021-12-07 11:46:58 +00:00
// Whether the stack is from a app template
FromAppTemplate bool ` example:"false" `
2021-09-07 00:37:26 +00:00
// Kubernetes namespace if stack is a kube application
Namespace string ` example:"default" `
// IsComposeFormat indicates if the Kubernetes stack is created from a Docker Compose file
IsComposeFormat bool ` example:"false" `
2020-04-08 21:26:11 +00:00
}
2018-06-15 07:18:25 +00:00
2022-07-03 23:39:03 +00:00
// StackOption represents the options for stack deployment
StackOption struct {
// Prune services that are no longer referenced
Prune bool ` example:"false" `
}
2020-04-08 21:26:11 +00:00
// StackID represents a stack identifier (it must be composed of Name + "_" + SwarmID to create a unique identifier)
StackID int
2019-05-24 06:04:58 +00:00
2020-08-03 22:18:53 +00:00
// StackStatus represent a status for a stack
StackStatus int
2020-04-08 21:26:11 +00:00
// StackType represents the type of the stack (compose v2, stack deploy v3)
StackType int
2020-03-29 09:54:14 +00:00
2020-04-08 21:26:11 +00:00
// Status represents the application status
Status struct {
2021-02-23 03:21:39 +00:00
// Portainer API version
Version string ` json:"Version" example:"2.0.0" `
2021-08-10 22:45:53 +00:00
// Server Instance ID
InstanceID string ` example:"299ab403-70a8-4c05-92f7-bf7a994d50df" `
2018-04-26 16:08:46 +00:00
}
2020-04-08 21:26:11 +00:00
// Tag represents a tag that can be associated to a resource
Tag struct {
2021-02-23 03:21:39 +00:00
// Tag identifier
ID TagID ` example:"1" `
// Tag name
Name string ` json:"Name" example:"org/acme" `
2021-09-20 00:14:22 +00:00
// A set of environment(endpoint) ids that have this tag
2021-02-23 03:21:39 +00:00
Endpoints map [ EndpointID ] bool ` json:"Endpoints" `
2021-09-20 00:14:22 +00:00
// A set of environment(endpoint) group ids that have this tag
2020-05-14 02:14:28 +00:00
EndpointGroups map [ EndpointGroupID ] bool ` json:"EndpointGroups" `
2018-02-23 02:10:26 +00:00
}
2020-04-08 21:26:11 +00:00
// TagID represents a tag identifier
TagID int
2017-05-23 18:56:10 +00:00
2020-04-08 21:26:11 +00:00
// Team represents a list of user accounts
Team struct {
2021-02-23 03:21:39 +00:00
// Team Identifier
ID TeamID ` json:"Id" example:"1" `
// Team name
Name string ` json:"Name" example:"developers" `
2017-03-12 16:24:15 +00:00
}
2020-04-08 21:26:11 +00:00
// TeamAccessPolicies represent the association of an access policy and a team
TeamAccessPolicies map [ TeamID ] AccessPolicy
2017-03-12 16:24:15 +00:00
2020-04-08 21:26:11 +00:00
// TeamID represents a team identifier
TeamID int
// TeamMembership represents a membership association between a user and a team
TeamMembership struct {
2021-02-23 03:21:39 +00:00
// Membership Identifier
ID TeamMembershipID ` json:"Id" example:"1" `
// User identifier
UserID UserID ` json:"UserID" example:"1" `
// Team identifier
TeamID TeamID ` json:"TeamID" example:"1" `
// Team role (1 for team leader and 2 for team member)
Role MembershipRole ` json:"Role" example:"1" `
2017-05-23 18:56:10 +00:00
}
2020-04-08 21:26:11 +00:00
// TeamMembershipID represents a team membership identifier
TeamMembershipID int
2018-08-21 18:40:42 +00:00
// TeamResourceAccess represents the level of control on a resource for a specific team
2017-05-23 18:56:10 +00:00
TeamResourceAccess struct {
TeamID TeamID ` json:"TeamId" `
AccessLevel ResourceAccessLevel ` json:"AccessLevel" `
}
2020-04-15 05:49:34 +00:00
// Template represents an application template that can be used as an App Template
// or an Edge template
2018-07-03 18:31:02 +00:00
Template struct {
// Mandatory container/stack fields
2021-02-23 03:21:39 +00:00
// Template Identifier
ID TemplateID ` json:"Id" example:"1" `
// Template type. Valid values are: 1 (container), 2 (Swarm stack) or 3 (Compose stack)
Type TemplateType ` json:"type" example:"1" `
// Title of the template
Title string ` json:"title" example:"Nginx" `
// Description of the template
Description string ` json:"description" example:"High performance web server" `
// Whether the template should be available to administrators only
AdministratorOnly bool ` json:"administrator_only" example:"true" `
2018-07-03 18:31:02 +00:00
// Mandatory container fields
2021-02-23 03:21:39 +00:00
// Image associated to a container template. Mandatory for a container template
Image string ` json:"image" example:"nginx:latest" `
2018-07-03 18:31:02 +00:00
// Mandatory stack fields
Repository TemplateRepository ` json:"repository" `
2020-04-15 05:49:34 +00:00
// Mandatory Edge stack fields
2021-02-23 03:21:39 +00:00
// Stack file used for this template
2020-05-14 02:14:28 +00:00
StackFile string ` json:"stackFile" `
2018-07-03 18:31:02 +00:00
// Optional stack/container fields
2021-02-23 03:21:39 +00:00
// Default name for the stack/container to be used on deployment
Name string ` json:"name,omitempty" example:"mystackname" `
// URL of the template's logo
Logo string ` json:"logo,omitempty" example:"https://cloudinovasi.id/assets/img/logos/nginx.png" `
2021-09-20 00:14:22 +00:00
// A list of environment(endpoint) variables used during the template deployment
2021-02-23 03:21:39 +00:00
Env [ ] TemplateEnv ` json:"env,omitempty" `
// A note that will be displayed in the UI. Supports HTML content
Note string ` json:"note,omitempty" example:"This is my <b>custom</b> template" `
// Platform associated to the template.
// Valid values are: 'linux', 'windows' or leave empty for multi-platform
Platform string ` json:"platform,omitempty" example:"linux" `
// A list of categories associated to the template
Categories [ ] string ` json:"categories,omitempty" example:"database" `
2018-07-03 18:31:02 +00:00
// Optional container fields
2021-02-23 03:21:39 +00:00
// The URL of a registry associated to the image for a container template
Registry string ` json:"registry,omitempty" example:"quay.io" `
// The command that will be executed in a container template
Command string ` json:"command,omitempty" example:"ls -lah" `
2021-09-20 00:14:22 +00:00
// Name of a network that will be used on container deployment if it exists inside the environment(endpoint)
2021-02-23 03:21:39 +00:00
Network string ` json:"network,omitempty" example:"mynet" `
// A list of volumes used during the container template deployment
Volumes [ ] TemplateVolume ` json:"volumes,omitempty" `
// A list of ports exposed by the container
Ports [ ] string ` json:"ports,omitempty" example:"8080:80/tcp" `
// Container labels
2022-11-16 17:55:08 +00:00
Labels [ ] Pair ` json:"labels,omitempty" `
2021-02-23 03:21:39 +00:00
// Whether the container should be started in privileged mode
Privileged bool ` json:"privileged,omitempty" example:"true" `
// Whether the container should be started in
// interactive mode (-i -t equivalent on the CLI)
Interactive bool ` json:"interactive,omitempty" example:"true" `
// Container restart policy
RestartPolicy string ` json:"restart_policy,omitempty" example:"on-failure" `
// Container hostname
Hostname string ` json:"hostname,omitempty" example:"mycontainer" `
2018-07-03 18:31:02 +00:00
}
2021-09-20 00:14:22 +00:00
// TemplateEnv represents a template environment(endpoint) variable configuration
2018-07-03 18:31:02 +00:00
TemplateEnv struct {
2021-09-20 00:14:22 +00:00
// name of the environment(endpoint) variable
2021-02-23 03:21:39 +00:00
Name string ` json:"name" example:"MYSQL_ROOT_PASSWORD" `
// Text for the label that will be generated in the UI
Label string ` json:"label,omitempty" example:"Root password" `
// Content of the tooltip that will be generated in the UI
Description string ` json:"description,omitempty" example:"MySQL root account password" `
// Default value that will be set for the variable
Default string ` json:"default,omitempty" example:"default_value" `
// If set to true, will not generate any input for this variable in the UI
Preset bool ` json:"preset,omitempty" example:"false" `
// A list of name/value that will be used to generate a dropdown in the UI
Select [ ] TemplateEnvSelect ` json:"select,omitempty" `
2018-07-03 18:31:02 +00:00
}
2020-04-08 21:26:11 +00:00
// TemplateEnvSelect represents text/value pair that will be displayed as a choice for the
// template user
TemplateEnvSelect struct {
2021-02-23 03:21:39 +00:00
// Some text that will displayed as a choice
Text string ` json:"text" example:"text value" `
// A value that will be associated to the choice
Value string ` json:"value" example:"value" `
// Will set this choice as the default choice
Default bool ` json:"default" example:"false" `
2018-07-03 18:31:02 +00:00
}
2020-04-08 21:26:11 +00:00
// TemplateID represents a template identifier
TemplateID int
2018-08-21 18:40:42 +00:00
// TemplateRepository represents the git repository configuration for a template
2018-07-03 18:31:02 +00:00
TemplateRepository struct {
2021-02-23 03:21:39 +00:00
// URL of a git repository used to deploy a stack template. Mandatory for a Swarm/Compose stack template
URL string ` json:"url" example:"https://github.com/portainer/portainer-compose" `
// Path to the stack file inside the git repository
StackFile string ` json:"stackfile" example:"./subfolder/docker-compose.yml" `
2018-07-03 18:31:02 +00:00
}
2020-04-08 21:26:11 +00:00
// TemplateType represents the type of a template
TemplateType int
// TemplateVolume represents a template volume configuration
TemplateVolume struct {
2021-02-23 03:21:39 +00:00
// Path inside the container
Container string ` json:"container" example:"/data" `
// Path on the host
Bind string ` json:"bind,omitempty" example:"/tmp" `
// Whether the volume used should be readonly
ReadOnly bool ` json:"readonly,omitempty" example:"true" `
2018-07-03 18:31:02 +00:00
}
2020-04-08 21:26:11 +00:00
// TLSConfiguration represents a TLS configuration
TLSConfiguration struct {
2021-02-23 03:21:39 +00:00
// Use TLS
TLS bool ` json:"TLS" example:"true" `
// Skip the verification of the server TLS certificate
TLSSkipVerify bool ` json:"TLSSkipVerify" example:"false" `
// Path to the TLS CA certificate file
TLSCACertPath string ` json:"TLSCACert,omitempty" example:"/data/tls/ca.pem" `
// Path to the TLS client certificate file
TLSCertPath string ` json:"TLSCert,omitempty" example:"/data/tls/cert.pem" `
// Path to the TLS client key file
TLSKeyPath string ` json:"TLSKey,omitempty" example:"/data/tls/key.pem" `
2020-04-08 21:26:11 +00:00
}
2017-03-12 16:24:15 +00:00
2021-09-20 00:14:22 +00:00
// TLSFileType represents a type of TLS file required to connect to a Docker environment(endpoint).
2018-08-21 18:40:42 +00:00
// It can be either a TLS CA file, a TLS certificate file or a TLS key file
2016-12-25 20:34:02 +00:00
TLSFileType int
2020-04-08 21:26:11 +00:00
// TokenData represents the data embedded in a JWT token
TokenData struct {
2022-04-14 01:45:54 +00:00
ID UserID
Username string
Role UserRole
ForceChangePassword bool
2018-12-09 03:49:27 +00:00
}
2019-07-25 22:38:07 +00:00
// TunnelDetails represents information associated to a tunnel
TunnelDetails struct {
Status string
LastActivity time . Time
Port int
2020-06-25 03:25:51 +00:00
Jobs [ ] EdgeJob
2019-07-25 22:38:07 +00:00
Credentials string
}
// TunnelServerInfo represents information associated to the tunnel server
TunnelServerInfo struct {
PrivateKeySeed string ` json:"PrivateKeySeed" `
}
2020-04-08 21:26:11 +00:00
// User represents a user account
User struct {
2021-02-23 03:21:39 +00:00
// User Identifier
ID UserID ` json:"Id" example:"1" `
Username string ` json:"Username" example:"bob" `
2021-09-27 04:00:04 +00:00
Password string ` json:"Password,omitempty" swaggerignore:"true" `
2021-02-23 03:21:39 +00:00
// User role (1 for administrator account and 2 for regular account)
2023-02-19 04:17:50 +00:00
Role UserRole ` json:"Role" example:"1" `
TokenIssueAt int64 ` json:"TokenIssueAt" example:"1" `
ThemeSettings UserThemeSettings
2020-08-11 05:41:37 +00:00
// Deprecated fields
2023-02-19 04:17:50 +00:00
// Deprecated
UserTheme string ` example:"dark" `
2020-08-11 05:41:37 +00:00
// Deprecated in DBVersion == 25
2023-02-19 04:17:50 +00:00
PortainerAuthorizations Authorizations
// Deprecated in DBVersion == 25
EndpointAuthorizations EndpointAuthorizations
2016-12-18 05:21:29 +00:00
}
2020-04-08 21:26:11 +00:00
// UserAccessPolicies represent the association of an access policy and a user
UserAccessPolicies map [ UserID ] AccessPolicy
2016-12-18 05:21:29 +00:00
2020-04-08 21:26:11 +00:00
// UserID represents a user identifier
UserID int
// UserResourceAccess represents the level of control on a resource for a specific user
UserResourceAccess struct {
UserID UserID ` json:"UserId" `
AccessLevel ResourceAccessLevel ` json:"AccessLevel" `
2016-12-18 05:21:29 +00:00
}
2020-04-08 21:26:11 +00:00
// UserRole represents the role of a user. It can be either an administrator
// or a regular user
UserRole int
2023-02-19 04:17:50 +00:00
// UserThemeSettings represents the theme settings for a user
UserThemeSettings struct {
// Color represents the color theme of the UI
Color string ` json:"color" example:"dark" enums:"dark,light,highcontrast,auto" `
}
2020-04-08 21:26:11 +00:00
// Webhook represents a url webhook that can be used to update a service
Webhook struct {
2021-02-23 03:21:39 +00:00
// Webhook Identifier
ID WebhookID ` json:"Id" example:"1" `
2020-04-08 21:26:11 +00:00
Token string ` json:"Token" `
ResourceID string ` json:"ResourceId" `
EndpointID EndpointID ` json:"EndpointId" `
2021-12-06 20:11:44 +00:00
RegistryID RegistryID ` json:"RegistryId" `
2020-04-08 21:26:11 +00:00
WebhookType WebhookType ` json:"Type" `
2016-12-18 05:21:29 +00:00
}
2020-04-08 21:26:11 +00:00
// WebhookID represents a webhook identifier.
WebhookID int
// WebhookType represents the type of resource a webhook is related to
WebhookType int
2022-09-22 20:05:10 +00:00
Snapshot struct {
EndpointID EndpointID ` json:"EndpointId" `
Docker * DockerSnapshot ` json:"Docker" `
Kubernetes * KubernetesSnapshot ` json:"Kubernetes" `
}
2020-07-05 23:21:03 +00:00
// CLIService represents a service for managing CLI
CLIService interface {
ParseFlags ( version string ) ( * CLIFlags , error )
ValidateFlags ( flags * CLIFlags ) error
}
2020-04-08 21:26:11 +00:00
// ComposeStackManager represents a service to manage Compose stacks
ComposeStackManager interface {
2021-01-25 19:16:53 +00:00
ComposeSyntaxMaxVersion ( ) string
2021-03-14 19:08:31 +00:00
NormalizeStackName ( name string ) string
2022-01-16 21:20:45 +00:00
Up ( ctx context . Context , stack * Stack , endpoint * Endpoint , forceRereate bool ) error
2021-09-06 07:58:26 +00:00
Down ( ctx context . Context , stack * Stack , endpoint * Endpoint ) error
2022-09-15 04:57:26 +00:00
Pull ( ctx context . Context , stack * Stack , endpoint * Endpoint ) error
2019-05-24 06:04:58 +00:00
}
2020-04-08 21:26:11 +00:00
// CryptoService represents a service for encrypting/hashing data
CryptoService interface {
Hash ( data string ) ( string , error )
CompareHashAndData ( hash string , data string ) error
2017-05-23 18:56:10 +00:00
}
2020-04-08 21:26:11 +00:00
// DigitalSignatureService represents a service to manage digital signatures
DigitalSignatureService interface {
ParseKeyPair ( private , public [ ] byte ) error
GenerateKeyPair ( ) ( [ ] byte , [ ] byte , error )
EncodedPublicKey ( ) string
PEMHeaders ( ) ( string , string )
CreateSignature ( message string ) ( string , error )
}
2021-09-20 00:14:22 +00:00
// DockerSnapshotter represents a service used to create Docker environment(endpoint) snapshots
2020-07-05 23:21:03 +00:00
DockerSnapshotter interface {
CreateSnapshot ( endpoint * Endpoint ) ( * DockerSnapshot , error )
}
2018-08-21 18:40:42 +00:00
// FileService represents a service for managing files
2016-12-25 20:34:02 +00:00
FileService interface {
2021-09-06 07:58:26 +00:00
GetDockerConfigPath ( ) string
2021-11-01 11:01:03 +00:00
GetFileContent ( trustedRootPath , filePath string ) ( [ ] byte , error )
2021-09-27 00:52:50 +00:00
Copy ( fromFilePath string , toFilePath string , deleteIfExists bool ) error
2018-06-18 10:07:56 +00:00
Rename ( oldPath , newPath string ) error
2017-10-15 17:24:40 +00:00
RemoveDirectory ( directoryPath string ) error
2018-06-11 13:13:19 +00:00
StoreTLSFileFromBytes ( folder string , fileType TLSFileType , data [ ] byte ) ( string , error )
2017-08-10 08:35:23 +00:00
GetPathForTLSFile ( folder string , fileType TLSFileType ) ( string , error )
2017-09-14 06:08:37 +00:00
DeleteTLSFile ( folder string , fileType TLSFileType ) error
2017-08-10 08:35:23 +00:00
DeleteTLSFiles ( folder string ) error
2017-10-15 17:24:40 +00:00
GetStackProjectPath ( stackIdentifier string ) string
2018-06-11 13:13:19 +00:00
StoreStackFileFromBytes ( stackIdentifier , fileName string , data [ ] byte ) ( string , error )
2022-09-07 08:50:59 +00:00
UpdateStoreStackFileFromBytes ( stackIdentifier , fileName string , data [ ] byte ) ( string , error )
RemoveStackFileBackup ( stackIdentifier , fileName string ) error
RollbackStackFile ( stackIdentifier , fileName string ) error
2020-05-14 02:14:28 +00:00
GetEdgeStackProjectPath ( edgeStackIdentifier string ) string
StoreEdgeStackFileFromBytes ( edgeStackIdentifier , fileName string , data [ ] byte ) ( string , error )
2018-12-09 03:49:27 +00:00
StoreRegistryManagementFileFromBytes ( folder , fileName string , data [ ] byte ) ( string , error )
2018-05-06 07:15:57 +00:00
KeyPairFilesExist ( ) ( bool , error )
StoreKeyPair ( private , public [ ] byte , privatePEMHeader , publicPEMHeader string ) error
LoadKeyPair ( ) ( [ ] byte , [ ] byte , error )
WriteJSONToFile ( path string , content interface { } ) error
2018-06-19 11:15:10 +00:00
FileExists ( path string ) ( bool , error )
2020-06-25 03:25:51 +00:00
StoreEdgeJobFileFromBytes ( identifier string , data [ ] byte ) ( string , error )
GetEdgeJobFolder ( identifier string ) string
ClearEdgeJobTaskLogs ( edgeJobID , taskID string ) error
GetEdgeJobTaskLogFileContent ( edgeJobID , taskID string ) ( string , error )
StoreEdgeJobTaskLogFileFromBytes ( edgeJobID , taskID string , data [ ] byte ) error
2018-12-09 03:49:27 +00:00
GetBinaryFolder ( ) string
2020-07-06 23:18:39 +00:00
StoreCustomTemplateFileFromBytes ( identifier , fileName string , data [ ] byte ) ( string , error )
GetCustomTemplateProjectPath ( identifier string ) string
GetTemporaryPath ( ) ( string , error )
2021-04-06 10:08:43 +00:00
GetDatastorePath ( ) string
2021-08-10 04:59:47 +00:00
GetDefaultSSLCertsPath ( ) ( string , string )
StoreSSLCertPair ( cert , key [ ] byte ) ( string , string , error )
CopySSLCertPair ( certPath , keyPath string ) ( string , string , error )
2022-04-07 14:32:00 +00:00
CopySSLCACert ( caCertPath string ) ( string , error )
2022-01-23 19:48:04 +00:00
StoreFDOProfileFileFromBytes ( fdoProfileIdentifier string , data [ ] byte ) ( string , error )
2022-12-15 20:21:58 +00:00
StoreMTLSCertificates ( cert , caCert , key [ ] byte ) ( string , string , string , error )
2017-10-15 17:24:40 +00:00
}
2018-08-21 18:40:42 +00:00
// GitService represents a service for managing Git
2017-10-15 17:24:40 +00:00
GitService interface {
2023-04-03 06:19:17 +00:00
CloneRepository ( destination string , repositoryURL , referenceName , username , password string , tlsSkipVerify bool ) error
LatestCommitID ( repositoryURL , referenceName , username , password string , tlsSkipVerify bool ) ( string , error )
ListRefs ( repositoryURL , username , password string , hardRefresh bool , tlsSkipVerify bool ) ( [ ] string , error )
ListFiles ( repositoryURL , referenceName , username , password string , hardRefresh bool , includeExts [ ] string , tlsSkipVerify bool ) ( [ ] string , error )
2016-12-25 20:34:02 +00:00
}
2017-02-06 05:29:34 +00:00
2021-11-29 13:06:50 +00:00
// OpenAMTService represents a service for managing OpenAMT
OpenAMTService interface {
2022-01-23 19:48:04 +00:00
Configure ( configuration OpenAMTConfiguration ) error
DeviceInformation ( configuration OpenAMTConfiguration , deviceGUID string ) ( * OpenAMTDeviceInformation , error )
EnableDeviceFeatures ( configuration OpenAMTConfiguration , deviceGUID string , features OpenAMTDeviceEnabledFeatures ) ( string , error )
ExecuteDeviceAction ( configuration OpenAMTConfiguration , deviceGUID string , action string ) error
2021-11-29 13:06:50 +00:00
}
2021-09-20 00:14:22 +00:00
// KubeClient represents a service used to query a Kubernetes environment(endpoint)
2020-07-05 23:21:03 +00:00
KubeClient interface {
2021-07-23 05:10:46 +00:00
SetupUserServiceAccount ( userID int , teamIDs [ ] int , restrictDefaultNamespace bool ) error
2022-12-07 02:53:06 +00:00
IsRBACEnabled ( ) ( bool , error )
2021-08-30 22:07:50 +00:00
GetServiceAccount ( tokendata * TokenData ) ( * v1 . ServiceAccount , error )
2020-08-04 04:01:15 +00:00
GetServiceAccountBearerToken ( userID int ) ( string , error )
2021-09-28 22:39:45 +00:00
CreateUserShellPod ( ctx context . Context , serviceAccountName , shellPodImage string ) ( * KubernetesShellPod , error )
2021-09-03 01:11:11 +00:00
StartExecProcess ( token string , useAdminToken bool , namespace , podName , containerName string , command [ ] string , stdin io . Reader , stdout io . Writer , errChan chan error )
2022-09-21 04:49:42 +00:00
2022-09-26 19:43:24 +00:00
HasStackName ( namespace string , stackName string ) ( bool , error )
NamespaceAccessPoliciesDeleteNamespace ( namespace string ) error
CreateNamespace ( info models . K8sNamespaceDetails ) error
UpdateNamespace ( info models . K8sNamespaceDetails ) error
2022-09-21 04:49:42 +00:00
GetNamespaces ( ) ( map [ string ] K8sNamespaceInfo , error )
2022-10-27 03:14:54 +00:00
GetNamespace ( string ) ( K8sNamespaceInfo , error )
2022-09-21 04:49:42 +00:00
DeleteNamespace ( namespace string ) error
GetConfigMapsAndSecrets ( namespace string ) ( [ ] models . K8sConfigMapOrSecret , error )
2022-10-17 21:46:27 +00:00
GetIngressControllers ( ) ( models . K8sIngressControllers , error )
2022-12-16 03:03:40 +00:00
GetMetrics ( ) ( models . K8sMetrics , error )
GetStorage ( ) ( [ ] KubernetesStorageClassConfig , error )
2022-12-20 03:46:51 +00:00
CreateIngress ( namespace string , info models . K8sIngressInfo , owner string ) error
2022-09-21 04:49:42 +00:00
UpdateIngress ( namespace string , info models . K8sIngressInfo ) error
GetIngresses ( namespace string ) ( [ ] models . K8sIngressInfo , error )
DeleteIngresses ( reqs models . K8sIngressDeleteRequests ) error
CreateService ( namespace string , service models . K8sServiceInfo ) error
UpdateService ( namespace string , service models . K8sServiceInfo ) error
2023-03-02 19:45:19 +00:00
GetServices ( namespace string , lookupApplications bool ) ( [ ] models . K8sServiceInfo , error )
2022-09-21 04:49:42 +00:00
DeleteServices ( reqs models . K8sServiceDeleteRequests ) error
2021-08-31 21:08:01 +00:00
GetNodesLimits ( ) ( K8sNodesLimits , error )
2021-06-16 08:15:29 +00:00
GetNamespaceAccessPolicies ( ) ( map [ string ] K8sNamespaceAccessPolicy , error )
UpdateNamespaceAccessPolicies ( accessPolicies map [ string ] K8sNamespaceAccessPolicy ) error
2021-07-14 09:15:21 +00:00
DeleteRegistrySecret ( registry * Registry , namespace string ) error
CreateRegistrySecret ( registry * Registry , namespace string ) error
IsRegistrySecret ( namespace , secretName string ) ( bool , error )
2021-08-26 14:00:59 +00:00
ToggleSystemState ( namespace string , isSystem bool ) error
2020-07-05 23:21:03 +00:00
}
2021-09-20 00:14:22 +00:00
// KubernetesDeployer represents a service to deploy a manifest inside a Kubernetes environment(endpoint)
2020-07-05 23:21:03 +00:00
KubernetesDeployer interface {
2021-09-29 23:58:10 +00:00
Deploy ( userID UserID , endpoint * Endpoint , manifestFiles [ ] string , namespace string ) ( string , error )
Remove ( userID UserID , endpoint * Endpoint , manifestFiles [ ] string , namespace string ) ( string , error )
2021-09-02 05:28:51 +00:00
ConvertCompose ( data [ ] byte ) ( [ ] byte , error )
2020-07-05 23:21:03 +00:00
}
2021-09-20 00:14:22 +00:00
// KubernetesSnapshotter represents a service used to create Kubernetes environment(endpoint) snapshots
2020-07-05 23:21:03 +00:00
KubernetesSnapshotter interface {
CreateSnapshot ( endpoint * Endpoint ) ( * KubernetesSnapshot , error )
}
2018-08-21 18:40:42 +00:00
// LDAPService represents a service used to authenticate users against a LDAP/AD
2017-08-10 08:35:23 +00:00
LDAPService interface {
AuthenticateUser ( username , password string , settings * LDAPSettings ) error
TestConnectivity ( settings * LDAPSettings ) error
2018-07-23 04:57:38 +00:00
GetUserGroups ( username string , settings * LDAPSettings ) ( [ ] string , error )
2021-10-06 06:24:26 +00:00
SearchGroups ( settings * LDAPSettings ) ( [ ] LDAPUser , error )
SearchUsers ( settings * LDAPSettings ) ( [ ] string , error )
2017-08-10 08:35:23 +00:00
}
2017-10-15 17:24:40 +00:00
2020-08-05 08:36:46 +00:00
// OAuthService represents a service used to authenticate users using OAuth
OAuthService interface {
2021-08-05 12:54:38 +00:00
Authenticate ( code string , configuration * OAuthSettings ) ( string , error )
2020-08-05 08:36:46 +00:00
}
2021-03-01 00:43:47 +00:00
// ReverseTunnelService represents a service used to manage reverse tunnel connections.
2020-04-08 21:26:11 +00:00
ReverseTunnelService interface {
2020-07-05 23:21:03 +00:00
StartTunnelServer ( addr , port string , snapshotService SnapshotService ) error
2021-04-06 10:08:43 +00:00
StopTunnelServer ( ) error
2020-04-08 21:26:11 +00:00
GenerateEdgeKey ( url , host string , endpointIdentifier int ) string
SetTunnelStatusToActive ( endpointID EndpointID )
SetTunnelStatusToRequired ( endpointID EndpointID ) error
SetTunnelStatusToIdle ( endpointID EndpointID )
2021-09-21 01:12:31 +00:00
KeepTunnelAlive ( endpointID EndpointID , ctx context . Context , maxKeepAlive time . Duration )
2022-03-02 16:51:22 +00:00
GetTunnelDetails ( endpointID EndpointID ) TunnelDetails
GetActiveTunnel ( endpoint * Endpoint ) ( TunnelDetails , error )
2023-01-26 14:32:11 +00:00
AddEdgeJob ( endpoint * Endpoint , edgeJob * EdgeJob )
2020-06-25 03:25:51 +00:00
RemoveEdgeJob ( edgeJobID EdgeJobID )
2022-12-19 21:54:51 +00:00
RemoveEdgeJobFromEndpoint ( endpointID EndpointID , edgeJobID EdgeJobID )
2020-04-08 21:26:11 +00:00
}
// Server defines the interface to serve the API
Server interface {
Start ( ) error
}
2021-09-20 00:14:22 +00:00
// SnapshotService represents a service for managing environment(endpoint) snapshots
2020-07-05 23:21:03 +00:00
SnapshotService interface {
Start ( )
SetSnapshotInterval ( snapshotInterval string ) error
SnapshotEndpoint ( endpoint * Endpoint ) error
2022-09-22 20:05:10 +00:00
FillSnapshotData ( endpoint * Endpoint ) error
2020-07-05 23:21:03 +00:00
}
2018-08-21 18:40:42 +00:00
// SwarmStackManager represents a service to manage Swarm stacks
2018-06-11 13:13:19 +00:00
SwarmStackManager interface {
2021-10-15 05:13:20 +00:00
Login ( registries [ ] Registry , endpoint * Endpoint ) error
2017-10-26 12:22:09 +00:00
Logout ( endpoint * Endpoint ) error
2022-09-15 04:57:26 +00:00
Deploy ( stack * Stack , prune bool , pullImage bool , endpoint * Endpoint ) error
2017-10-15 17:24:40 +00:00
Remove ( stack * Stack , endpoint * Endpoint ) error
2021-07-22 21:53:42 +00:00
NormalizeStackName ( name string ) string
2017-10-15 17:24:40 +00:00
}
2016-12-18 05:21:29 +00:00
)
const (
2018-08-21 18:40:42 +00:00
// APIVersion is the version number of the Portainer API
2023-03-08 00:24:59 +00:00
APIVersion = "2.19.0"
2022-11-18 00:18:09 +00:00
// Edition is what this edition of Portainer is called
Edition = PortainerCE
2021-01-25 19:16:53 +00:00
// ComposeSyntaxMaxVersion is a maximum supported version of the docker compose syntax
ComposeSyntaxMaxVersion = "3.9"
2018-12-11 20:46:05 +00:00
// AssetsServerURL represents the URL of the Portainer asset server
AssetsServerURL = "https://portainer-io-assets.sfo2.digitaloceanspaces.com"
2018-08-21 18:40:42 +00:00
// MessageOfTheDayURL represents the URL where Portainer MOTD message can be retrieved
2019-06-02 06:16:43 +00:00
MessageOfTheDayURL = AssetsServerURL + "/motd.json"
2019-09-25 20:38:11 +00:00
// VersionCheckURL represents the URL used to retrieve the latest version of Portainer
VersionCheckURL = "https://api.github.com/repos/portainer/portainer/releases/latest"
2018-05-06 07:15:57 +00:00
// PortainerAgentHeader represents the name of the header available in any agent response
PortainerAgentHeader = "Portainer-Agent"
2019-07-25 22:38:07 +00:00
// PortainerAgentEdgeIDHeader represent the name of the header containing the Edge ID associated to an agent/agent cluster
PortainerAgentEdgeIDHeader = "X-PortainerAgent-EdgeID"
2020-08-04 00:44:17 +00:00
// HTTPResponseAgentPlatform represents the name of the header containing the Agent platform
HTTPResponseAgentPlatform = "Portainer-Agent-Platform"
2018-08-21 18:40:42 +00:00
// PortainerAgentTargetHeader represent the name of the header containing the target node name
2018-05-06 07:15:57 +00:00
PortainerAgentTargetHeader = "X-PortainerAgent-Target"
// PortainerAgentSignatureHeader represent the name of the header containing the digital signature
PortainerAgentSignatureHeader = "X-PortainerAgent-Signature"
// PortainerAgentPublicKeyHeader represent the name of the header containing the public key
PortainerAgentPublicKeyHeader = "X-PortainerAgent-PublicKey"
2020-07-05 23:21:03 +00:00
// PortainerAgentKubernetesSATokenHeader represent the name of the header containing a Kubernetes SA token
PortainerAgentKubernetesSATokenHeader = "X-PortainerAgent-SA-Token"
2018-05-06 07:15:57 +00:00
// PortainerAgentSignatureMessage represents the message used to create a digital signature
// to be used when communicating with an agent
PortainerAgentSignatureMessage = "Portainer-App"
2022-01-28 12:28:34 +00:00
// DefaultSnapshotInterval represents the default interval between each environment snapshot job
DefaultSnapshotInterval = "5m"
2019-07-25 22:38:07 +00:00
// DefaultEdgeAgentCheckinIntervalInSeconds represents the default interval (in seconds) used by Edge agents to checkin with the Portainer instance
DefaultEdgeAgentCheckinIntervalInSeconds = 5
2020-04-15 05:49:34 +00:00
// DefaultTemplatesURL represents the URL to the official templates supported by Portainer
DefaultTemplatesURL = "https://raw.githubusercontent.com/portainer/templates/master/templates-2.0.json"
feat(helm/templates): helm app templates EE-943 (#5449)
* feat(helm): add helm chart backport to ce EE-1409 (#5425)
* EE-1311 Helm Chart Backport from EE
* backport to ce
Co-authored-by: Matt Hook <hookenz@gmail.com>
* feat(helm): list and configure helm chart (#5431)
* backport and tidyup code
* --amend
* using rocket icon for charts
* helm chart bugfix - clear category button
* added matomo analytics for helm chart install
* fix web editor exit warning without changes
* editor modified exit bugfix
* fixed notifications typo
* updated helm template text
* helper text to convey slow helm templates load
Co-authored-by: zees-dev <dev.786zshan@gmail.com>
* removing redundant time-consuming api call by using prop attribute
* feat(helm) helm chart backport from ee EE-1311 (#5436)
* Add missing defaultHelmRepoUrl and mock testing
* Backport EE-1477
* Backport updates to helm tests from EE
* add https by default changes and ssl to tls renaming from EE
* Port install integration test. Disabled by default to pass CI checks
* merged changes from EE for the integration test
* kube proxy whitelist updated to support internal helm install command
Co-authored-by: zees-dev <dev.786zshan@gmail.com>
* Pull in all changes from tech review in EE-943
* added helm to sidebar after rebase, sync CE with EE
* bugfix: kubectl shell not opening - bearer token bug
* tidy go modules & remove yarn-error.log
* removed redundant handler (not used) - to match EE
* resolved merge conflicts, updated code
* feat(helm/views): helm release and application views EE-1236 (#5529)
* feat(helm): add helm chart backport to ce EE-1409 (#5425)
* EE-1311 Helm Chart Backport from EE
* backport to ce
Co-authored-by: Matt Hook <hookenz@gmail.com>
* Pull in all changes from tech review in EE-943
* added helm to sidebar after rebase, sync CE with EE
* removed redundant handler (not used) - to match EE
* feat(helm) display helm charts - backend EE-1236
* copy over components for new applications view EE-1236
* Add new applications datatable component
* Add more migrated files
* removed test not applicable to CE
* baclkported EE app data table code to CE
* removed redundant helm repo url
* resolved conflicts, updated code
* using endpoint middleware
* PR review fixes
* using constants, openapi updated
Co-authored-by: Richard Wei <54336863+WaysonWei@users.noreply.github.com>
Co-authored-by: zees-dev <dev.786zshan@gmail.com>
* fixed test conflicts, go linted
* feat(helm/templates-add): helm templates add repo for user support EE-1278 (#5514)
* feat(helm): add helm chart backport to ce EE-1409 (#5425)
* EE-1311 Helm Chart Backport from EE
* backport to ce
Co-authored-by: Matt Hook <hookenz@gmail.com>
* feat(helm) helm chart backport from ee EE-1311 (#5436)
* Add missing defaultHelmRepoUrl and mock testing
* Backport EE-1477
* Backport updates to helm tests from EE
* add https by default changes and ssl to tls renaming from EE
* Port install integration test. Disabled by default to pass CI checks
* merged changes from EE for the integration test
* kube proxy whitelist updated to support internal helm install command
Co-authored-by: zees-dev <dev.786zshan@gmail.com>
* Pull in all changes from tech review in EE-943
* feat(helm): add helm chart backport to ce EE-1409 (#5425)
* EE-1311 Helm Chart Backport from EE
* backport to ce
Co-authored-by: Matt Hook <hookenz@gmail.com>
* Pull in all changes from tech review in EE-943
* added helm to sidebar after rebase, sync CE with EE
* backport EE-1278, squashed, diffed, updated
* helm install openapi spec update
* resolved conflicts, updated code
* - matching ee codebase at 0afe57034449ee0e9f333d92c252a13995a93019
- helm install using endpoint middleware
- remove trailing slash from added/persisted helm repo urls
* feat(helm) use libhelm url validator and improved path assembly EE-1554 (#5561)
* feat(helm/userrepos) fix getting global repo for ordinary users EE-1562 (#5567)
* feat(helm/userrepos) fix getting global repo for ordinary users EE-1562
* post review changes and further backported changes from EE
* resolved conflicts, updated code
* fixed helm_install handler unit test
* user cannot add existing repo if suffix is '/' (#5571)
* feat(helm/docs) fix broken swagger docs EE-1278 (#5572)
* Fix swagger docs
* minor correction
* fix(helm): migrating code from user handler to helm handler (#5573)
* - migrated user_helm_repos to helm endpoint handler
- migrated api operations from user factory/service to helm factory/service
- passing endpointId into helm service/factory as endpoint provider is deprecated
* upgrade libhelm to hide secrets
Co-authored-by: Matt Hook <hookenz@gmail.com>
* removed duplicate file - due to merge conflict
* dependency injection in helm factory
Co-authored-by: Richard Wei <54336863+WaysonWei@users.noreply.github.com>
Co-authored-by: Matt Hook <hookenz@gmail.com>
* kubernetes.templates -> kubernetes.templates.helm name conflict fix
* Validate the URL added as a public helm repo (#5579)
* fix(helm): helm app deletion fix EE-1581 (#5582)
* updated helm lib to show correct error on uninstall failure
* passing down helm app namespace on deletion
* fix(k8s): EE-1591 non-admin users cannot deploy charts containing secrets (#5590)
Co-authored-by: Simon Meng <simon.meng@portainer.io>
* fix(helm): helm epic bugfixes EE-1582 EE-1593 (#5585)
* - trim trailing slash and lowercase before persisting helm repo
- browser helm templates url /kubernetes/templates/templates -> /kubernetes/templates/helm
- fix publish url
- fix helm repo add refresh
- semi-fix k8s app expansion
* Tidy up swagger documentation related to helm. Make json consistent
* fixed helm release page for non-default namespaces
* k8s app view table expansion bugfix
* EE-1593: publish url load balancer fallback
Co-authored-by: Matt Hook <hookenz@gmail.com>
* k8s app list fix for charts with deployments containing multiple pods - which use the same label (#5599)
* fix(kubernetes): app list view fix for secrets with long keys or values EE-1600 (#5600)
* k8s app secrets key value text overflow ellipses
* wrapping key value pairs instead of ellipses
* fix(helm): helm apps bundling issue across different namespaces EE-1619 (#5602)
* helm apps bundling issue across different namespaces
* - code comments and indentation to ease reading
- moved namespace calc out of loop
* feat(helm/test) disable slow helm search test by default EE-1599 (#5598)
* skip helm_repo_search as it's an integration test
* switch to portainer built in integration test checker
* make module order match EE
* don't print test struct out when skipping integration test
Co-authored-by: Richard Wei <54336863+WaysonWei@users.noreply.github.com>
Co-authored-by: Matt Hook <hookenz@gmail.com>
Co-authored-by: cong meng <mcpacino@gmail.com>
Co-authored-by: Simon Meng <simon.meng@portainer.io>
2021-09-10 02:06:57 +00:00
// DefaultHelmrepositoryURL represents the URL to the official templates supported by Bitnami
DefaultHelmRepositoryURL = "https://charts.bitnami.com/bitnami"
2020-06-09 09:55:36 +00:00
// DefaultUserSessionTimeout represents the default timeout after which the user session is cleared
DefaultUserSessionTimeout = "8h"
2021-08-31 21:23:21 +00:00
// DefaultUserSessionTimeout represents the default timeout after which the user session is cleared
DefaultKubeconfigExpiry = "0"
2021-09-28 22:39:45 +00:00
// DefaultKubectlShellImage represents the default image and tag for the kubectl shell
DefaultKubectlShellImage = "portainer/kubectl-shell"
2021-09-21 01:12:31 +00:00
// WebSocketKeepAlive web socket keep alive for edge environments
WebSocketKeepAlive = 1 * time . Hour
2016-12-18 05:21:29 +00:00
)
2016-12-25 20:34:02 +00:00
2023-02-12 22:28:32 +00:00
// List of supported features
2023-04-10 18:59:34 +00:00
const (
FeatureFdo = "fdo"
FeatureNoTx = "noTx"
)
2023-03-07 16:45:39 +00:00
var SupportedFeatureFlags = [ ] featureflags . Feature {
2023-04-10 18:59:34 +00:00
FeatureFdo ,
FeatureNoTx ,
2023-03-07 16:45:39 +00:00
}
2021-11-11 18:49:50 +00:00
2016-12-25 20:34:02 +00:00
const (
2020-04-08 21:26:11 +00:00
_ AuthenticationMethod = iota
// AuthenticationInternal represents the internal authentication method (authentication against Portainer API)
AuthenticationInternal
// AuthenticationLDAP represents the LDAP authentication method (authentication against a LDAP server)
AuthenticationLDAP
//AuthenticationOAuth represents the OAuth authentication method (authentication against a authorization server)
AuthenticationOAuth
)
2020-08-04 00:44:17 +00:00
const (
_ AgentPlatform = iota
// AgentPlatformDocker represent the Docker platform (Standalone/Swarm)
AgentPlatformDocker
// AgentPlatformKubernetes represent the Kubernetes platform
AgentPlatformKubernetes
)
2020-06-25 03:25:51 +00:00
const (
_ EdgeJobLogsStatus = iota
// EdgeJobLogsStatusIdle represents an idle log collection job
EdgeJobLogsStatusIdle
// EdgeJobLogsStatusPending represents a pending log collection job
EdgeJobLogsStatusPending
// EdgeJobLogsStatusCollected represents a completed log collection job
EdgeJobLogsStatusCollected
)
2020-07-06 23:18:39 +00:00
const (
_ CustomTemplatePlatform = iota
// CustomTemplatePlatformLinux represents a custom template for linux
CustomTemplatePlatformLinux
// CustomTemplatePlatformWindows represents a custom template for windows
CustomTemplatePlatformWindows
)
2021-09-09 08:38:34 +00:00
const (
// EdgeStackDeploymentCompose represent an edge stack deployed using a compose file
EdgeStackDeploymentCompose EdgeStackDeploymentType = iota
// EdgeStackDeploymentKubernetes represent an edge stack deployed using a kubernetes manifest file
EdgeStackDeploymentKubernetes
)
2020-05-14 02:14:28 +00:00
const (
2022-12-21 00:18:51 +00:00
// EdgeStackStatusPending represents a pending edge stack
EdgeStackStatusPending EdgeStackStatusType = iota
//EdgeStackStatusOk represents a successfully deployed edge stack
EdgeStackStatusOk
//EdgeStackStatusError represents an edge environment(endpoint) which failed to deploy its edge stack
EdgeStackStatusError
//EdgeStackStatusAcknowledged represents an acknowledged edge stack
EdgeStackStatusAcknowledged
//EdgeStackStatusRemove represents a removed edge stack (status isn't persisted)
EdgeStackStatusRemove
// StatusRemoteUpdateSuccess represents a successfully updated edge stack
EdgeStackStatusRemoteUpdateSuccess
// EdgeStackStatusImagesPulled represents a successfully images-pulling
EdgeStackStatusImagesPulled
2020-05-14 02:14:28 +00:00
)
2020-04-08 21:26:11 +00:00
const (
_ EndpointStatus = iota
2021-09-20 00:14:22 +00:00
// EndpointStatusUp is used to represent an available environment(endpoint)
2020-04-08 21:26:11 +00:00
EndpointStatusUp
2021-09-20 00:14:22 +00:00
// EndpointStatusDown is used to represent an unavailable environment(endpoint)
2020-04-08 21:26:11 +00:00
EndpointStatusDown
)
const (
_ EndpointType = iota
2021-09-20 00:14:22 +00:00
// DockerEnvironment represents an environment(endpoint) connected to a Docker environment(endpoint)
2020-04-08 21:26:11 +00:00
DockerEnvironment
2021-09-20 00:14:22 +00:00
// AgentOnDockerEnvironment represents an environment(endpoint) connected to a Portainer agent deployed on a Docker environment(endpoint)
2020-04-08 21:26:11 +00:00
AgentOnDockerEnvironment
2021-09-20 00:14:22 +00:00
// AzureEnvironment represents an environment(endpoint) connected to an Azure environment(endpoint)
2020-04-08 21:26:11 +00:00
AzureEnvironment
2021-09-20 00:14:22 +00:00
// EdgeAgentOnDockerEnvironment represents an environment(endpoint) connected to an Edge agent deployed on a Docker environment(endpoint)
2020-07-05 23:21:03 +00:00
EdgeAgentOnDockerEnvironment
2021-09-20 00:14:22 +00:00
// KubernetesLocalEnvironment represents an environment(endpoint) connected to a local Kubernetes environment(endpoint)
2020-07-05 23:21:03 +00:00
KubernetesLocalEnvironment
2021-09-20 00:14:22 +00:00
// AgentOnKubernetesEnvironment represents an environment(endpoint) connected to a Portainer agent deployed on a Kubernetes environment(endpoint)
2020-07-05 23:21:03 +00:00
AgentOnKubernetesEnvironment
2021-09-20 00:14:22 +00:00
// EdgeAgentOnKubernetesEnvironment represents an environment(endpoint) connected to an Edge agent deployed on a Kubernetes environment(endpoint)
2020-07-05 23:21:03 +00:00
EdgeAgentOnKubernetesEnvironment
2020-04-08 21:26:11 +00:00
)
const (
_ JobType = iota
2021-09-20 00:14:22 +00:00
// SnapshotJobType is a system job used to create environment(endpoint) snapshots
2020-06-25 03:25:51 +00:00
SnapshotJobType = 2
2016-12-25 20:34:02 +00:00
)
2017-03-12 16:24:15 +00:00
2017-05-23 18:56:10 +00:00
const (
_ MembershipRole = iota
// TeamLeader represents a leader role inside a team
TeamLeader
// TeamMember represents a member role inside a team
TeamMember
)
2021-02-22 22:14:52 +00:00
const (
_ SoftwareEdition = iota
// PortainerCE represents the community edition of Portainer
PortainerCE
// PortainerBE represents the business edition of Portainer
PortainerBE
// PortainerEE represents the business edition of Portainer
PortainerEE
)
2017-03-12 16:24:15 +00:00
const (
2020-04-08 21:26:11 +00:00
_ RegistryType = iota
// QuayRegistry represents a Quay.io registry
QuayRegistry
// AzureRegistry represents an ACR registry
AzureRegistry
// CustomRegistry represents a custom registry
CustomRegistry
// GitlabRegistry represents a gitlab registry
GitlabRegistry
2021-07-01 02:57:15 +00:00
// ProGetRegistry represents a proget registry
ProGetRegistry
2021-07-14 09:15:21 +00:00
// DockerHubRegistry represents a dockerhub registry
DockerHubRegistry
2021-12-01 00:18:57 +00:00
// EcrRegistry represents an ECR registry
EcrRegistry
2017-08-10 08:35:23 +00:00
)
2017-05-23 18:56:10 +00:00
const (
_ ResourceAccessLevel = iota
// ReadWriteAccessLevel represents an access level with read-write permissions on a resource
ReadWriteAccessLevel
)
2017-03-12 16:24:15 +00:00
const (
_ ResourceControlType = iota
2017-05-23 18:56:10 +00:00
// ContainerResourceControl represents a resource control associated to a Docker container
2017-03-12 16:24:15 +00:00
ContainerResourceControl
2017-05-23 18:56:10 +00:00
// ServiceResourceControl represents a resource control associated to a Docker service
2017-03-12 16:24:15 +00:00
ServiceResourceControl
2017-05-23 18:56:10 +00:00
// VolumeResourceControl represents a resource control associated to a Docker volume
2017-03-12 16:24:15 +00:00
VolumeResourceControl
2017-09-19 14:58:30 +00:00
// NetworkResourceControl represents a resource control associated to a Docker network
NetworkResourceControl
2017-09-19 15:10:15 +00:00
// SecretResourceControl represents a resource control associated to a Docker secret
SecretResourceControl
2017-10-15 17:24:40 +00:00
// StackResourceControl represents a resource control associated to a stack composed of Docker services
StackResourceControl
2017-11-06 08:47:31 +00:00
// ConfigResourceControl represents a resource control associated to a Docker config
ConfigResourceControl
2021-02-23 03:21:39 +00:00
// CustomTemplateResourceControl represents a resource control associated to a custom template
2020-07-06 23:18:39 +00:00
CustomTemplateResourceControl
2021-03-29 21:58:56 +00:00
// ContainerGroupResourceControl represents a resource control associated to an Azure container group
ContainerGroupResourceControl
2017-03-12 16:24:15 +00:00
)
2018-02-23 02:10:26 +00:00
2018-06-11 13:13:19 +00:00
const (
_ StackType = iota
// DockerSwarmStack represents a stack managed via docker stack
DockerSwarmStack
// DockerComposeStack represents a stack managed via docker-compose
DockerComposeStack
2020-07-05 23:21:03 +00:00
// KubernetesStack represents a stack managed via kubectl
KubernetesStack
2018-06-11 13:13:19 +00:00
)
2018-07-03 18:31:02 +00:00
2020-08-03 22:18:53 +00:00
// StackStatus represents a status for a stack
const (
_ StackStatus = iota
StackStatusActive
StackStatusInactive
)
2018-07-03 18:31:02 +00:00
const (
_ TemplateType = iota
// ContainerTemplate represents a container template
ContainerTemplate
// SwarmStackTemplate represents a template used to deploy a Swarm stack
SwarmStackTemplate
// ComposeStackTemplate represents a template used to deploy a Compose stack
ComposeStackTemplate
2020-05-14 02:14:28 +00:00
// EdgeStackTemplate represents a template used to deploy an Edge stack
EdgeStackTemplate
2018-07-03 18:31:02 +00:00
)
2018-07-11 08:39:20 +00:00
const (
2020-04-08 21:26:11 +00:00
// TLSFileCA represents a TLS CA certificate file
TLSFileCA TLSFileType = iota
// TLSFileCert represents a TLS certificate file
TLSFileCert
// TLSFileKey represents a TLS key file
TLSFileKey
2018-12-09 03:49:27 +00:00
)
2018-11-06 09:49:48 +00:00
const (
2020-04-08 21:26:11 +00:00
_ UserRole = iota
// AdministratorRole represents an administrator user role
AdministratorRole
// StandardUserRole represents a regular user role
StandardUserRole
2018-11-06 09:49:48 +00:00
)
2018-12-09 03:49:27 +00:00
const (
2020-04-08 21:26:11 +00:00
_ WebhookType = iota
// ServiceWebhook is a webhook for restarting a docker service
ServiceWebhook
2018-12-09 03:49:27 +00:00
)
2019-05-24 06:04:58 +00:00
2019-07-25 22:38:07 +00:00
const (
2021-09-20 00:14:22 +00:00
// EdgeAgentIdle represents an idle state for a tunnel connected to an Edge environment(endpoint).
2019-07-25 22:38:07 +00:00
EdgeAgentIdle string = "IDLE"
2021-09-20 00:14:22 +00:00
// EdgeAgentManagementRequired represents a required state for a tunnel connected to an Edge environment(endpoint)
2019-07-25 22:38:07 +00:00
EdgeAgentManagementRequired string = "REQUIRED"
2021-09-20 00:14:22 +00:00
// EdgeAgentActive represents an active state for a tunnel connected to an Edge environment(endpoint)
2019-07-25 22:38:07 +00:00
EdgeAgentActive string = "ACTIVE"
)
2021-03-01 00:43:47 +00:00
// represents an authorization type
2019-05-24 06:04:58 +00:00
const (
OperationDockerContainerArchiveInfo Authorization = "DockerContainerArchiveInfo"
OperationDockerContainerList Authorization = "DockerContainerList"
OperationDockerContainerExport Authorization = "DockerContainerExport"
OperationDockerContainerChanges Authorization = "DockerContainerChanges"
OperationDockerContainerInspect Authorization = "DockerContainerInspect"
OperationDockerContainerTop Authorization = "DockerContainerTop"
OperationDockerContainerLogs Authorization = "DockerContainerLogs"
OperationDockerContainerStats Authorization = "DockerContainerStats"
OperationDockerContainerAttachWebsocket Authorization = "DockerContainerAttachWebsocket"
OperationDockerContainerArchive Authorization = "DockerContainerArchive"
OperationDockerContainerCreate Authorization = "DockerContainerCreate"
OperationDockerContainerPrune Authorization = "DockerContainerPrune"
OperationDockerContainerKill Authorization = "DockerContainerKill"
OperationDockerContainerPause Authorization = "DockerContainerPause"
OperationDockerContainerUnpause Authorization = "DockerContainerUnpause"
OperationDockerContainerRestart Authorization = "DockerContainerRestart"
OperationDockerContainerStart Authorization = "DockerContainerStart"
OperationDockerContainerStop Authorization = "DockerContainerStop"
OperationDockerContainerWait Authorization = "DockerContainerWait"
OperationDockerContainerResize Authorization = "DockerContainerResize"
OperationDockerContainerAttach Authorization = "DockerContainerAttach"
OperationDockerContainerExec Authorization = "DockerContainerExec"
OperationDockerContainerRename Authorization = "DockerContainerRename"
OperationDockerContainerUpdate Authorization = "DockerContainerUpdate"
OperationDockerContainerPutContainerArchive Authorization = "DockerContainerPutContainerArchive"
OperationDockerContainerDelete Authorization = "DockerContainerDelete"
OperationDockerImageList Authorization = "DockerImageList"
OperationDockerImageSearch Authorization = "DockerImageSearch"
OperationDockerImageGetAll Authorization = "DockerImageGetAll"
OperationDockerImageGet Authorization = "DockerImageGet"
OperationDockerImageHistory Authorization = "DockerImageHistory"
OperationDockerImageInspect Authorization = "DockerImageInspect"
OperationDockerImageLoad Authorization = "DockerImageLoad"
OperationDockerImageCreate Authorization = "DockerImageCreate"
OperationDockerImagePrune Authorization = "DockerImagePrune"
OperationDockerImagePush Authorization = "DockerImagePush"
OperationDockerImageTag Authorization = "DockerImageTag"
OperationDockerImageDelete Authorization = "DockerImageDelete"
OperationDockerImageCommit Authorization = "DockerImageCommit"
OperationDockerImageBuild Authorization = "DockerImageBuild"
OperationDockerNetworkList Authorization = "DockerNetworkList"
OperationDockerNetworkInspect Authorization = "DockerNetworkInspect"
OperationDockerNetworkCreate Authorization = "DockerNetworkCreate"
OperationDockerNetworkConnect Authorization = "DockerNetworkConnect"
OperationDockerNetworkDisconnect Authorization = "DockerNetworkDisconnect"
OperationDockerNetworkPrune Authorization = "DockerNetworkPrune"
OperationDockerNetworkDelete Authorization = "DockerNetworkDelete"
OperationDockerVolumeList Authorization = "DockerVolumeList"
OperationDockerVolumeInspect Authorization = "DockerVolumeInspect"
OperationDockerVolumeCreate Authorization = "DockerVolumeCreate"
OperationDockerVolumePrune Authorization = "DockerVolumePrune"
OperationDockerVolumeDelete Authorization = "DockerVolumeDelete"
OperationDockerExecInspect Authorization = "DockerExecInspect"
OperationDockerExecStart Authorization = "DockerExecStart"
OperationDockerExecResize Authorization = "DockerExecResize"
OperationDockerSwarmInspect Authorization = "DockerSwarmInspect"
OperationDockerSwarmUnlockKey Authorization = "DockerSwarmUnlockKey"
OperationDockerSwarmInit Authorization = "DockerSwarmInit"
OperationDockerSwarmJoin Authorization = "DockerSwarmJoin"
OperationDockerSwarmLeave Authorization = "DockerSwarmLeave"
OperationDockerSwarmUpdate Authorization = "DockerSwarmUpdate"
OperationDockerSwarmUnlock Authorization = "DockerSwarmUnlock"
OperationDockerNodeList Authorization = "DockerNodeList"
OperationDockerNodeInspect Authorization = "DockerNodeInspect"
OperationDockerNodeUpdate Authorization = "DockerNodeUpdate"
OperationDockerNodeDelete Authorization = "DockerNodeDelete"
OperationDockerServiceList Authorization = "DockerServiceList"
OperationDockerServiceInspect Authorization = "DockerServiceInspect"
OperationDockerServiceLogs Authorization = "DockerServiceLogs"
OperationDockerServiceCreate Authorization = "DockerServiceCreate"
OperationDockerServiceUpdate Authorization = "DockerServiceUpdate"
OperationDockerServiceDelete Authorization = "DockerServiceDelete"
OperationDockerSecretList Authorization = "DockerSecretList"
OperationDockerSecretInspect Authorization = "DockerSecretInspect"
OperationDockerSecretCreate Authorization = "DockerSecretCreate"
OperationDockerSecretUpdate Authorization = "DockerSecretUpdate"
OperationDockerSecretDelete Authorization = "DockerSecretDelete"
OperationDockerConfigList Authorization = "DockerConfigList"
OperationDockerConfigInspect Authorization = "DockerConfigInspect"
OperationDockerConfigCreate Authorization = "DockerConfigCreate"
OperationDockerConfigUpdate Authorization = "DockerConfigUpdate"
OperationDockerConfigDelete Authorization = "DockerConfigDelete"
OperationDockerTaskList Authorization = "DockerTaskList"
OperationDockerTaskInspect Authorization = "DockerTaskInspect"
OperationDockerTaskLogs Authorization = "DockerTaskLogs"
OperationDockerPluginList Authorization = "DockerPluginList"
OperationDockerPluginPrivileges Authorization = "DockerPluginPrivileges"
OperationDockerPluginInspect Authorization = "DockerPluginInspect"
OperationDockerPluginPull Authorization = "DockerPluginPull"
OperationDockerPluginCreate Authorization = "DockerPluginCreate"
OperationDockerPluginEnable Authorization = "DockerPluginEnable"
OperationDockerPluginDisable Authorization = "DockerPluginDisable"
OperationDockerPluginPush Authorization = "DockerPluginPush"
OperationDockerPluginUpgrade Authorization = "DockerPluginUpgrade"
OperationDockerPluginSet Authorization = "DockerPluginSet"
OperationDockerPluginDelete Authorization = "DockerPluginDelete"
OperationDockerSessionStart Authorization = "DockerSessionStart"
OperationDockerDistributionInspect Authorization = "DockerDistributionInspect"
OperationDockerBuildPrune Authorization = "DockerBuildPrune"
OperationDockerBuildCancel Authorization = "DockerBuildCancel"
OperationDockerPing Authorization = "DockerPing"
OperationDockerInfo Authorization = "DockerInfo"
OperationDockerEvents Authorization = "DockerEvents"
OperationDockerSystem Authorization = "DockerSystem"
OperationDockerVersion Authorization = "DockerVersion"
OperationDockerAgentPing Authorization = "DockerAgentPing"
OperationDockerAgentList Authorization = "DockerAgentList"
OperationDockerAgentHostInfo Authorization = "DockerAgentHostInfo"
OperationDockerAgentBrowseDelete Authorization = "DockerAgentBrowseDelete"
OperationDockerAgentBrowseGet Authorization = "DockerAgentBrowseGet"
OperationDockerAgentBrowseList Authorization = "DockerAgentBrowseList"
OperationDockerAgentBrowsePut Authorization = "DockerAgentBrowsePut"
OperationDockerAgentBrowseRename Authorization = "DockerAgentBrowseRename"
2022-02-08 16:47:11 +00:00
OperationPortainerDockerHubInspect Authorization = "PortainerDockerHubInspect"
OperationPortainerDockerHubUpdate Authorization = "PortainerDockerHubUpdate"
OperationPortainerEndpointGroupCreate Authorization = "PortainerEndpointGroupCreate"
OperationPortainerEndpointGroupList Authorization = "PortainerEndpointGroupList"
OperationPortainerEndpointGroupDelete Authorization = "PortainerEndpointGroupDelete"
OperationPortainerEndpointGroupInspect Authorization = "PortainerEndpointGroupInspect"
OperationPortainerEndpointGroupUpdate Authorization = "PortainerEndpointGroupEdit"
OperationPortainerEndpointGroupAccess Authorization = "PortainerEndpointGroupAccess "
OperationPortainerEndpointList Authorization = "PortainerEndpointList"
OperationPortainerEndpointInspect Authorization = "PortainerEndpointInspect"
OperationPortainerEndpointCreate Authorization = "PortainerEndpointCreate"
OperationPortainerEndpointJob Authorization = "PortainerEndpointJob"
OperationPortainerEndpointSnapshots Authorization = "PortainerEndpointSnapshots"
OperationPortainerEndpointSnapshot Authorization = "PortainerEndpointSnapshot"
OperationPortainerEndpointUpdate Authorization = "PortainerEndpointUpdate"
OperationPortainerEndpointUpdateAccess Authorization = "PortainerEndpointUpdateAccess"
OperationPortainerEndpointDelete Authorization = "PortainerEndpointDelete"
OperationPortainerExtensionList Authorization = "PortainerExtensionList"
OperationPortainerExtensionInspect Authorization = "PortainerExtensionInspect"
OperationPortainerExtensionCreate Authorization = "PortainerExtensionCreate"
OperationPortainerExtensionUpdate Authorization = "PortainerExtensionUpdate"
OperationPortainerExtensionDelete Authorization = "PortainerExtensionDelete"
OperationPortainerMOTD Authorization = "PortainerMOTD"
OperationPortainerRegistryList Authorization = "PortainerRegistryList"
OperationPortainerRegistryInspect Authorization = "PortainerRegistryInspect"
OperationPortainerRegistryCreate Authorization = "PortainerRegistryCreate"
OperationPortainerRegistryConfigure Authorization = "PortainerRegistryConfigure"
OperationPortainerRegistryUpdate Authorization = "PortainerRegistryUpdate"
OperationPortainerRegistryUpdateAccess Authorization = "PortainerRegistryUpdateAccess"
OperationPortainerRegistryDelete Authorization = "PortainerRegistryDelete"
OperationPortainerResourceControlCreate Authorization = "PortainerResourceControlCreate"
OperationPortainerResourceControlUpdate Authorization = "PortainerResourceControlUpdate"
OperationPortainerResourceControlDelete Authorization = "PortainerResourceControlDelete"
OperationPortainerRoleList Authorization = "PortainerRoleList"
OperationPortainerRoleInspect Authorization = "PortainerRoleInspect"
OperationPortainerRoleCreate Authorization = "PortainerRoleCreate"
OperationPortainerRoleUpdate Authorization = "PortainerRoleUpdate"
OperationPortainerRoleDelete Authorization = "PortainerRoleDelete"
OperationPortainerScheduleList Authorization = "PortainerScheduleList"
OperationPortainerScheduleInspect Authorization = "PortainerScheduleInspect"
OperationPortainerScheduleFile Authorization = "PortainerScheduleFile"
OperationPortainerScheduleTasks Authorization = "PortainerScheduleTasks"
OperationPortainerScheduleCreate Authorization = "PortainerScheduleCreate"
OperationPortainerScheduleUpdate Authorization = "PortainerScheduleUpdate"
OperationPortainerScheduleDelete Authorization = "PortainerScheduleDelete"
OperationPortainerSettingsInspect Authorization = "PortainerSettingsInspect"
OperationPortainerSettingsUpdate Authorization = "PortainerSettingsUpdate"
OperationPortainerSettingsLDAPCheck Authorization = "PortainerSettingsLDAPCheck"
OperationPortainerStackList Authorization = "PortainerStackList"
OperationPortainerStackInspect Authorization = "PortainerStackInspect"
OperationPortainerStackFile Authorization = "PortainerStackFile"
OperationPortainerStackCreate Authorization = "PortainerStackCreate"
OperationPortainerStackMigrate Authorization = "PortainerStackMigrate"
OperationPortainerStackUpdate Authorization = "PortainerStackUpdate"
OperationPortainerStackDelete Authorization = "PortainerStackDelete"
OperationPortainerTagList Authorization = "PortainerTagList"
OperationPortainerTagCreate Authorization = "PortainerTagCreate"
OperationPortainerTagDelete Authorization = "PortainerTagDelete"
OperationPortainerTeamMembershipList Authorization = "PortainerTeamMembershipList"
OperationPortainerTeamMembershipCreate Authorization = "PortainerTeamMembershipCreate"
OperationPortainerTeamMembershipUpdate Authorization = "PortainerTeamMembershipUpdate"
OperationPortainerTeamMembershipDelete Authorization = "PortainerTeamMembershipDelete"
OperationPortainerTeamList Authorization = "PortainerTeamList"
OperationPortainerTeamInspect Authorization = "PortainerTeamInspect"
OperationPortainerTeamMemberships Authorization = "PortainerTeamMemberships"
OperationPortainerTeamCreate Authorization = "PortainerTeamCreate"
OperationPortainerTeamUpdate Authorization = "PortainerTeamUpdate"
OperationPortainerTeamDelete Authorization = "PortainerTeamDelete"
OperationPortainerTemplateList Authorization = "PortainerTemplateList"
OperationPortainerTemplateInspect Authorization = "PortainerTemplateInspect"
OperationPortainerTemplateCreate Authorization = "PortainerTemplateCreate"
OperationPortainerTemplateUpdate Authorization = "PortainerTemplateUpdate"
OperationPortainerTemplateDelete Authorization = "PortainerTemplateDelete"
OperationPortainerUploadTLS Authorization = "PortainerUploadTLS"
OperationPortainerUserList Authorization = "PortainerUserList"
OperationPortainerUserInspect Authorization = "PortainerUserInspect"
OperationPortainerUserMemberships Authorization = "PortainerUserMemberships"
OperationPortainerUserCreate Authorization = "PortainerUserCreate"
2022-04-05 21:07:51 +00:00
OperationPortainerUserListToken Authorization = "PortainerUserListToken"
OperationPortainerUserCreateToken Authorization = "PortainerUserCreateToken"
OperationPortainerUserRevokeToken Authorization = "PortainerUserRevokeToken"
2022-02-08 16:47:11 +00:00
OperationPortainerUserUpdate Authorization = "PortainerUserUpdate"
OperationPortainerUserUpdatePassword Authorization = "PortainerUserUpdatePassword"
OperationPortainerUserDelete Authorization = "PortainerUserDelete"
OperationPortainerWebsocketExec Authorization = "PortainerWebsocketExec"
OperationPortainerWebhookList Authorization = "PortainerWebhookList"
OperationPortainerWebhookCreate Authorization = "PortainerWebhookCreate"
OperationPortainerWebhookDelete Authorization = "PortainerWebhookDelete"
2019-05-26 22:41:12 +00:00
2019-05-24 06:04:58 +00:00
OperationDockerUndefined Authorization = "DockerUndefined"
OperationDockerAgentUndefined Authorization = "DockerAgentUndefined"
OperationPortainerUndefined Authorization = "PortainerUndefined"
EndpointResourcesAccess Authorization = "EndpointResourcesAccess"
2022-02-08 16:47:11 +00:00
// Deprecated operations
OperationPortainerEndpointExtensionAdd Authorization = "PortainerEndpointExtensionAdd"
OperationPortainerEndpointExtensionRemove Authorization = "PortainerEndpointExtensionRemove"
OperationIntegrationStoridgeAdmin Authorization = "IntegrationStoridgeAdmin"
2019-05-24 06:04:58 +00:00
)
2021-03-29 21:58:56 +00:00
const (
AzurePathContainerGroups = "/subscriptions/*/providers/Microsoft.ContainerInstance/containerGroups"
AzurePathContainerGroup = "/subscriptions/*/resourceGroups/*/providers/Microsoft.ContainerInstance/containerGroups/*"
)