fix(code): revert omitempty optimization EE-6269 (#10548)

pull/10550/head
andres-portainer 2023-10-27 17:33:04 -03:00 committed by GitHub
parent f10356641a
commit 247f358b94
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 205 additions and 123 deletions

View File

@ -27,7 +27,9 @@
], ],
"endpoints": [ "endpoints": [
{ {
"Agent": {}, "Agent": {
"Version": ""
},
"AuthorizedTeams": null, "AuthorizedTeams": null,
"AuthorizedUsers": null, "AuthorizedUsers": null,
"AzureCredentials": { "AzureCredentials": {
@ -36,36 +38,62 @@
"TenantID": "" "TenantID": ""
}, },
"ComposeSyntaxMaxVersion": "", "ComposeSyntaxMaxVersion": "",
"Edge": {}, "Edge": {
"AsyncMode": false,
"CommandInterval": 0,
"PingInterval": 0,
"SnapshotInterval": 0
},
"EdgeCheckinInterval": 0, "EdgeCheckinInterval": 0,
"EdgeKey": "",
"Gpus": [], "Gpus": [],
"GroupId": 1, "GroupId": 1,
"Heartbeat": false,
"Id": 1, "Id": 1,
"Kubernetes": { "Kubernetes": {
"Configuration": { "Configuration": {
"AllowNoneIngressClass": false,
"EnableResourceOverCommit": false,
"IngressAvailabilityPerNamespace": true, "IngressAvailabilityPerNamespace": true,
"IngressClasses": null, "IngressClasses": null,
"StorageClasses": null "ResourceOverCommitPercentage": 0,
"RestrictDefaultNamespace": false,
"StorageClasses": null,
"UseLoadBalancer": false,
"UseServerMetrics": false
},
"Flags": {
"IsServerIngressClassDetected": false,
"IsServerMetricsDetected": false,
"IsServerStorageDetected": false
}, },
"Flags": {},
"Snapshots": [] "Snapshots": []
}, },
"LastCheckInDate": 0,
"Name": "local", "Name": "local",
"PostInitMigrations": { "PostInitMigrations": {
"MigrateGPUs": true, "MigrateGPUs": true,
"MigrateIngresses": true "MigrateIngresses": true
}, },
"PublicURL": "",
"QueryDate": 0,
"SecuritySettings": { "SecuritySettings": {
"allowBindMountsForRegularUsers": true, "allowBindMountsForRegularUsers": true,
"allowContainerCapabilitiesForRegularUsers": true, "allowContainerCapabilitiesForRegularUsers": true,
"allowDeviceMappingForRegularUsers": true, "allowDeviceMappingForRegularUsers": true,
"allowHostNamespaceForRegularUsers": true, "allowHostNamespaceForRegularUsers": true,
"allowPrivilegedModeForRegularUsers": true, "allowPrivilegedModeForRegularUsers": true,
"allowStackManagementForRegularUsers": true "allowStackManagementForRegularUsers": true,
"allowSysctlSettingForRegularUsers": false,
"allowVolumeBrowserForRegularUsers": false,
"enableHostManagementFeatures": false
}, },
"Snapshots": [], "Snapshots": [],
"Status": 1, "Status": 1,
"TLSConfig": {}, "TLSConfig": {
"TLS": false,
"TLSSkipVerify": false
},
"TagIds": [], "TagIds": [],
"Tags": null, "Tags": null,
"TeamAccessPolicies": {}, "TeamAccessPolicies": {},
@ -79,6 +107,7 @@
"Authentication": true, "Authentication": true,
"AuthorizedTeams": null, "AuthorizedTeams": null,
"AuthorizedUsers": null, "AuthorizedUsers": null,
"BaseURL": "",
"Ecr": { "Ecr": {
"Region": "" "Region": ""
}, },
@ -121,28 +150,34 @@
"UserAccesses": [] "UserAccesses": []
}, },
{ {
"AdministratorsOnly": false,
"Id": 3, "Id": 3,
"Public": true, "Public": true,
"ResourceId": "1_alpine", "ResourceId": "1_alpine",
"SubResourceIds": [], "SubResourceIds": [],
"System": false,
"TeamAccesses": [], "TeamAccesses": [],
"Type": 6, "Type": 6,
"UserAccesses": [] "UserAccesses": []
}, },
{ {
"AdministratorsOnly": false,
"Id": 4, "Id": 4,
"Public": true, "Public": true,
"ResourceId": "1_redis", "ResourceId": "1_redis",
"SubResourceIds": [], "SubResourceIds": [],
"System": false,
"TeamAccesses": [], "TeamAccesses": [],
"Type": 6, "Type": 6,
"UserAccesses": [] "UserAccesses": []
}, },
{ {
"AdministratorsOnly": false,
"Id": 5, "Id": 5,
"Public": false, "Public": false,
"ResourceId": "1_nginx", "ResourceId": "1_nginx",
"SubResourceIds": [], "SubResourceIds": [],
"System": false,
"TeamAccesses": [ "TeamAccesses": [
{ {
"AccessLevel": 1, "AccessLevel": 1,
@ -538,6 +573,7 @@
} }
], ],
"settings": { "settings": {
"AgentSecret": "",
"AllowBindMountsForRegularUsers": true, "AllowBindMountsForRegularUsers": true,
"AllowContainerCapabilitiesForRegularUsers": true, "AllowContainerCapabilitiesForRegularUsers": true,
"AllowDeviceMappingForRegularUsers": true, "AllowDeviceMappingForRegularUsers": true,
@ -553,9 +589,14 @@
"SnapshotInterval": 0 "SnapshotInterval": 0
}, },
"EdgeAgentCheckinInterval": 5, "EdgeAgentCheckinInterval": 5,
"EdgePortainerUrl": "",
"EnableEdgeComputeFeatures": false,
"EnableTelemetry": true, "EnableTelemetry": true,
"EnforceEdgeID": false,
"FeatureFlagSettings": null, "FeatureFlagSettings": null,
"GlobalDeploymentOptions": {}, "GlobalDeploymentOptions": {
"hideStacksFunctionality": false
},
"HelmRepositoryURL": "https://charts.bitnami.com/bitnami", "HelmRepositoryURL": "https://charts.bitnami.com/bitnami",
"InternalAuthSettings": { "InternalAuthSettings": {
"RequiredPasswordLength": 12 "RequiredPasswordLength": 12
@ -568,7 +609,8 @@
"GroupSearchSettings": [ "GroupSearchSettings": [
{ {
"GroupAttribute": "", "GroupAttribute": "",
"GroupBaseDN": "" "GroupBaseDN": "",
"GroupFilter": ""
} }
], ],
"ReaderDN": "", "ReaderDN": "",
@ -579,9 +621,14 @@
"UserNameAttribute": "" "UserNameAttribute": ""
} }
], ],
"TLSConfig": {}, "StartTLS": false,
"TLSConfig": {
"TLS": false,
"TLSSkipVerify": false
},
"URL": "" "URL": ""
}, },
"LogoURL": "",
"OAuthSettings": { "OAuthSettings": {
"AccessTokenURI": "", "AccessTokenURI": "",
"AuthorizationURI": "", "AuthorizationURI": "",
@ -596,8 +643,10 @@
"Scopes": "", "Scopes": "",
"UserIdentifier": "" "UserIdentifier": ""
}, },
"ShowKomposeBuildOption": false,
"SnapshotInterval": "5m", "SnapshotInterval": "5m",
"TemplatesURL": "https://raw.githubusercontent.com/portainer/templates/master/templates-2.0.json", "TemplatesURL": "https://raw.githubusercontent.com/portainer/templates/master/templates-2.0.json",
"TrustOnFirstConnect": false,
"UserSessionTimeout": "8h", "UserSessionTimeout": "8h",
"fdoConfiguration": { "fdoConfiguration": {
"enabled": false, "enabled": false,
@ -736,23 +785,34 @@
"UnhealthyContainerCount": 0, "UnhealthyContainerCount": 0,
"VolumeCount": 10 "VolumeCount": 10
}, },
"EndpointId": 1 "EndpointId": 1,
"Kubernetes": null
} }
], ],
"ssl": { "ssl": {
"httpEnabled": true "certPath": "",
"httpEnabled": true,
"keyPath": "",
"selfSigned": false
}, },
"stacks": [ "stacks": [
{ {
"AdditionalFiles": null, "AdditionalFiles": null,
"AutoUpdate": null,
"CreatedBy": "", "CreatedBy": "",
"CreationDate": 0, "CreationDate": 0,
"EndpointId": 1, "EndpointId": 1,
"EntryPoint": "docker/alpine37-compose.yml", "EntryPoint": "docker/alpine37-compose.yml",
"Env": [], "Env": [],
"FromAppTemplate": false,
"GitConfig": null,
"Id": 2, "Id": 2,
"IsComposeFormat": false,
"Name": "alpine", "Name": "alpine",
"Namespace": "",
"Option": null,
"ProjectPath": "/home/prabhat/portainer/data/ce1.25/compose/2", "ProjectPath": "/home/prabhat/portainer/data/ce1.25/compose/2",
"ResourceControl": null,
"Status": 1, "Status": 1,
"SwarmId": "s3fd604zdba7z13tbq2x6lyue", "SwarmId": "s3fd604zdba7z13tbq2x6lyue",
"Type": 1, "Type": 1,
@ -761,30 +821,46 @@
}, },
{ {
"AdditionalFiles": null, "AdditionalFiles": null,
"AutoUpdate": null,
"CreatedBy": "", "CreatedBy": "",
"CreationDate": 0, "CreationDate": 0,
"EndpointId": 1, "EndpointId": 1,
"EntryPoint": "docker-compose.yml", "EntryPoint": "docker-compose.yml",
"Env": [], "Env": [],
"FromAppTemplate": false,
"GitConfig": null,
"Id": 5, "Id": 5,
"IsComposeFormat": false,
"Name": "redis", "Name": "redis",
"Namespace": "",
"Option": null,
"ProjectPath": "/home/prabhat/portainer/data/ce1.25/compose/5", "ProjectPath": "/home/prabhat/portainer/data/ce1.25/compose/5",
"ResourceControl": null,
"Status": 1, "Status": 1,
"SwarmId": "",
"Type": 2, "Type": 2,
"UpdateDate": 0, "UpdateDate": 0,
"UpdatedBy": "" "UpdatedBy": ""
}, },
{ {
"AdditionalFiles": null, "AdditionalFiles": null,
"AutoUpdate": null,
"CreatedBy": "", "CreatedBy": "",
"CreationDate": 0, "CreationDate": 0,
"EndpointId": 1, "EndpointId": 1,
"EntryPoint": "docker-compose.yml", "EntryPoint": "docker-compose.yml",
"Env": [], "Env": [],
"FromAppTemplate": false,
"GitConfig": null,
"Id": 6, "Id": 6,
"IsComposeFormat": false,
"Name": "nginx", "Name": "nginx",
"Namespace": "",
"Option": null,
"ProjectPath": "/home/prabhat/portainer/data/ce1.25/compose/6", "ProjectPath": "/home/prabhat/portainer/data/ce1.25/compose/6",
"ResourceControl": null,
"Status": 1, "Status": 1,
"SwarmId": "",
"Type": 2, "Type": 2,
"UpdateDate": 0, "UpdateDate": 0,
"UpdatedBy": "" "UpdatedBy": ""
@ -796,7 +872,9 @@
"Name": "hello" "Name": "hello"
} }
], ],
"tunnel_server": {}, "tunnel_server": {
"PrivateKeySeed": ""
},
"users": [ "users": [
{ {
"EndpointAuthorizations": null, "EndpointAuthorizations": null,
@ -821,7 +899,9 @@
"PortainerUserRevokeToken": true "PortainerUserRevokeToken": true
}, },
"Role": 1, "Role": 1,
"ThemeSettings": {}, "ThemeSettings": {
"color": ""
},
"TokenIssueAt": 0, "TokenIssueAt": 0,
"Username": "admin" "Username": "admin"
}, },
@ -848,7 +928,9 @@
"PortainerUserRevokeToken": true "PortainerUserRevokeToken": true
}, },
"Role": 1, "Role": 1,
"ThemeSettings": {}, "ThemeSettings": {
"color": ""
},
"TokenIssueAt": 0, "TokenIssueAt": 0,
"Username": "prabhat" "Username": "prabhat"
} }

View File

@ -28,13 +28,13 @@ func Test_EndpointList_AgentVersion(t *testing.T) {
GroupID: 1, GroupID: 1,
Type: portainer.AgentOnDockerEnvironment, Type: portainer.AgentOnDockerEnvironment,
Agent: struct { Agent: struct {
Version string `json:"Version,omitempty" example:"1.0.0"` Version string `example:"1.0.0"`
}{ }{
Version: "1.0.0", Version: "1.0.0",
}, },
} }
version2Endpoint := portainer.Endpoint{ID: 2, GroupID: 1, Type: portainer.AgentOnDockerEnvironment, Agent: struct { version2Endpoint := portainer.Endpoint{ID: 2, GroupID: 1, Type: portainer.AgentOnDockerEnvironment, Agent: struct {
Version string `json:"Version,omitempty" example:"1.0.0"` Version string `example:"1.0.0"`
}{Version: "2.0.0"}} }{Version: "2.0.0"}}
noVersionEndpoint := portainer.Endpoint{ID: 3, Type: portainer.AgentOnDockerEnvironment, GroupID: 1} noVersionEndpoint := portainer.Endpoint{ID: 3, Type: portainer.AgentOnDockerEnvironment, GroupID: 1}
notAgentEnvironments := portainer.Endpoint{ID: 4, Type: portainer.DockerEnvironment, GroupID: 1} notAgentEnvironments := portainer.Endpoint{ID: 4, Type: portainer.DockerEnvironment, GroupID: 1}

View File

@ -22,12 +22,12 @@ func Test_Filter_AgentVersion(t *testing.T) {
version1Endpoint := portainer.Endpoint{ID: 1, GroupID: 1, version1Endpoint := portainer.Endpoint{ID: 1, GroupID: 1,
Type: portainer.AgentOnDockerEnvironment, Type: portainer.AgentOnDockerEnvironment,
Agent: struct { Agent: struct {
Version string `json:"Version,omitempty" example:"1.0.0"` Version string `example:"1.0.0"`
}{Version: "1.0.0"}} }{Version: "1.0.0"}}
version2Endpoint := portainer.Endpoint{ID: 2, GroupID: 1, version2Endpoint := portainer.Endpoint{ID: 2, GroupID: 1,
Type: portainer.AgentOnDockerEnvironment, Type: portainer.AgentOnDockerEnvironment,
Agent: struct { Agent: struct {
Version string `json:"Version,omitempty" example:"1.0.0"` Version string `example:"1.0.0"`
}{Version: "2.0.0"}} }{Version: "2.0.0"}}
noVersionEndpoint := portainer.Endpoint{ID: 3, GroupID: 1, noVersionEndpoint := portainer.Endpoint{ID: 3, GroupID: 1,
Type: portainer.AgentOnDockerEnvironment, Type: portainer.AgentOnDockerEnvironment,

View File

@ -171,7 +171,7 @@ type (
// User identifier who created this template // User identifier who created this template
CreatedByUserID UserID `json:"CreatedByUserId" example:"3"` CreatedByUserID UserID `json:"CreatedByUserId" example:"3"`
// A note that will be displayed in the UI. Supports HTML content // 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"` Note string `json:"Note" example:"This is my <b>custom</b> template"`
// Platform associated to the template. // Platform associated to the template.
// Valid values are: 1 - 'linux', 2 - 'windows' // Valid values are: 1 - 'linux', 2 - 'windows'
Platform CustomTemplatePlatform `json:"Platform" example:"1" enums:"1,2"` Platform CustomTemplatePlatform `json:"Platform" example:"1" enums:"1,2"`
@ -182,11 +182,11 @@ type (
// * 2 - compose // * 2 - compose
// * 3 - kubernetes // * 3 - kubernetes
Type StackType `json:"Type" example:"1" enums:"1,2,3"` Type StackType `json:"Type" example:"1" enums:"1,2,3"`
ResourceControl *ResourceControl `json:"ResourceControl,omitempty"` ResourceControl *ResourceControl `json:"ResourceControl"`
Variables []CustomTemplateVariableDefinition Variables []CustomTemplateVariableDefinition
GitConfig *gittypes.RepoConfig `json:"GitConfig,omitempty"` GitConfig *gittypes.RepoConfig `json:"GitConfig"`
// IsComposeFormat indicates if the Kubernetes template is created from a Docker Compose file // IsComposeFormat indicates if the Kubernetes template is created from a Docker Compose file
IsComposeFormat bool `json:"IsComposeFormat,omitempty" example:"false"` IsComposeFormat bool `example:"false"`
} }
// CustomTemplateID represents a custom template identifier // CustomTemplateID represents a custom template identifier
@ -249,10 +249,10 @@ type (
// EdgeGroup Identifier // EdgeGroup Identifier
ID EdgeGroupID `json:"Id" example:"1"` ID EdgeGroupID `json:"Id" example:"1"`
Name string `json:"Name"` Name string `json:"Name"`
Dynamic bool `json:"Dynamic,omitempty"` Dynamic bool `json:"Dynamic"`
TagIDs []TagID `json:"TagIds"` TagIDs []TagID `json:"TagIds"`
Endpoints []EndpointID `json:"Endpoints"` Endpoints []EndpointID `json:"Endpoints"`
PartialMatch bool `json:"PartialMatch,omitempty"` PartialMatch bool `json:"PartialMatch"`
} }
// EdgeGroupID represents an Edge group identifier // EdgeGroupID represents an Edge group identifier
@ -268,7 +268,7 @@ type (
EdgeGroups []EdgeGroupID `json:"EdgeGroups"` EdgeGroups []EdgeGroupID `json:"EdgeGroups"`
Name string `json:"Name"` Name string `json:"Name"`
ScriptPath string `json:"ScriptPath"` ScriptPath string `json:"ScriptPath"`
Recurring bool `json:"Recurring,omitempty"` Recurring bool `json:"Recurring"`
Version int `json:"Version"` Version int `json:"Version"`
// Field used for log collection of Endpoints belonging to EdgeGroups // Field used for log collection of Endpoints belonging to EdgeGroups
@ -278,7 +278,7 @@ type (
// EdgeJobEndpointMeta represents a meta data object for an Edge job and Environment(Endpoint) relation // EdgeJobEndpointMeta represents a meta data object for an Edge job and Environment(Endpoint) relation
EdgeJobEndpointMeta struct { EdgeJobEndpointMeta struct {
LogsStatus EdgeJobLogsStatus LogsStatus EdgeJobLogsStatus
CollectLogs bool `json:"CollectLogs,omitempty"` CollectLogs bool
} }
// EdgeJobID represents an Edge job identifier // EdgeJobID represents an Edge job identifier
@ -325,7 +325,7 @@ type (
ManifestPath string ManifestPath string
DeploymentType EdgeStackDeploymentType DeploymentType EdgeStackDeploymentType
// Uses the manifest's namespaces instead of the default one // Uses the manifest's namespaces instead of the default one
UseManifestNamespaces bool `json:"UseManifestNamespaces,omitempty"` UseManifestNamespaces bool
// Deprecated // Deprecated
Prune bool `json:"Prune,omitempty"` Prune bool `json:"Prune,omitempty"`
@ -392,11 +392,11 @@ type (
// 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). // 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).
Type EndpointType `json:"Type" example:"1"` Type EndpointType `json:"Type" example:"1"`
// URL or IP address of the Docker host associated to this environment(endpoint) // URL or IP address of the Docker host associated to this environment(endpoint)
URL string `json:"URL,omitempty" example:"docker.mydomain.tld:2375"` URL string `json:"URL" example:"docker.mydomain.tld:2375"`
// Environment(Endpoint) group identifier // Environment(Endpoint) group identifier
GroupID EndpointGroupID `json:"GroupId" example:"1"` GroupID EndpointGroupID `json:"GroupId" example:"1"`
// URL or IP address where exposed containers will be reachable // URL or IP address where exposed containers will be reachable
PublicURL string `json:"PublicURL,omitempty" example:"docker.mydomain.tld:2375"` PublicURL string `json:"PublicURL" example:"docker.mydomain.tld:2375"`
Gpus []Pair `json:"Gpus"` Gpus []Pair `json:"Gpus"`
TLSConfig TLSConfiguration `json:"TLSConfig"` TLSConfig TLSConfiguration `json:"TLSConfig"`
AzureCredentials AzureCredentials `json:"AzureCredentials,omitempty"` AzureCredentials AzureCredentials `json:"AzureCredentials,omitempty"`
@ -413,7 +413,7 @@ type (
// The identifier of the edge agent associated with this environment(endpoint) // The identifier of the edge agent associated with this environment(endpoint)
EdgeID string `json:"EdgeID,omitempty"` EdgeID string `json:"EdgeID,omitempty"`
// The key which is used to map the agent to Portainer // The key which is used to map the agent to Portainer
EdgeKey string `json:"EdgeKey,omitempty"` EdgeKey string `json:"EdgeKey"`
// The check in interval for edge agent (in seconds) // The check in interval for edge agent (in seconds)
EdgeCheckinInterval int `json:"EdgeCheckinInterval" example:"5"` EdgeCheckinInterval int `json:"EdgeCheckinInterval" example:"5"`
// Associated Kubernetes data // Associated Kubernetes data
@ -425,11 +425,11 @@ type (
// The identifier of the AMT Device associated with this environment(endpoint) // The identifier of the AMT Device associated with this environment(endpoint)
AMTDeviceGUID string `json:"AMTDeviceGUID,omitempty" example:"4c4c4544-004b-3910-8037-b6c04f504633"` AMTDeviceGUID string `json:"AMTDeviceGUID,omitempty" example:"4c4c4544-004b-3910-8037-b6c04f504633"`
// LastCheckInDate mark last check-in date on checkin // LastCheckInDate mark last check-in date on checkin
LastCheckInDate int64 `json:"LastCheckInDate,omitempty"` LastCheckInDate int64
// QueryDate of each query with the endpoints list // QueryDate of each query with the endpoints list
QueryDate int64 `json:"QueryDate,omitempty"` QueryDate int64
// Heartbeat indicates the heartbeat status of an edge environment // Heartbeat indicates the heartbeat status of an edge environment
Heartbeat bool `json:"Heartbeat,omitempty" example:"true"` Heartbeat bool `json:"Heartbeat" example:"true"`
// Whether the device has been trusted or not by the user // Whether the device has been trusted or not by the user
UserTrusted bool `json:"UserTrusted,omitempty"` UserTrusted bool `json:"UserTrusted,omitempty"`
@ -440,7 +440,7 @@ type (
Edge EnvironmentEdgeSettings Edge EnvironmentEdgeSettings
Agent struct { Agent struct {
Version string `json:"Version,omitempty" example:"1.0.0"` Version string `example:"1.0.0"`
} }
EnableGPUManagement bool `json:"EnableGPUManagement,omitempty"` EnableGPUManagement bool `json:"EnableGPUManagement,omitempty"`
@ -465,13 +465,13 @@ type (
EnvironmentEdgeSettings struct { EnvironmentEdgeSettings struct {
// Whether the device has been started in edge async mode // Whether the device has been started in edge async mode
AsyncMode bool `json:"AsyncMode,omitempty"` AsyncMode bool
// The ping interval for edge agent - used in edge async mode [seconds] // The ping interval for edge agent - used in edge async mode [seconds]
PingInterval int `json:"PingInterval,omitempty" example:"60"` PingInterval int `json:"PingInterval" example:"60"`
// The snapshot interval for edge agent - used in edge async mode [seconds] // The snapshot interval for edge agent - used in edge async mode [seconds]
SnapshotInterval int `json:"SnapshotInterval,omitempty" example:"60"` SnapshotInterval int `json:"SnapshotInterval" example:"60"`
// The command list interval for edge agent - used in edge async mode [seconds] // The command list interval for edge agent - used in edge async mode [seconds]
CommandInterval int `json:"CommandInterval,omitempty" example:"60"` CommandInterval int `json:"CommandInterval" example:"60"`
} }
// EndpointAuthorizations represents the authorizations associated to a set of environments(endpoints) // EndpointAuthorizations represents the authorizations associated to a set of environments(endpoints)
@ -486,7 +486,7 @@ type (
// Environment(Endpoint) group name // Environment(Endpoint) group name
Name string `json:"Name" example:"my-environment-group"` Name string `json:"Name" example:"my-environment-group"`
// Description associated to the environment(endpoint) group // Description associated to the environment(endpoint) group
Description string `json:"Description,omitempty" example:"Environment(Endpoint) group description"` Description string `json:"Description" example:"Environment(Endpoint) group description"`
UserAccessPolicies UserAccessPolicies `json:"UserAccessPolicies"` UserAccessPolicies UserAccessPolicies `json:"UserAccessPolicies"`
TeamAccessPolicies TeamAccessPolicies `json:"TeamAccessPolicies"` TeamAccessPolicies TeamAccessPolicies `json:"TeamAccessPolicies"`
// List of tags associated to this environment(endpoint) group // List of tags associated to this environment(endpoint) group
@ -519,23 +519,23 @@ type (
// EndpointSecuritySettings represents settings for an environment(endpoint) // EndpointSecuritySettings represents settings for an environment(endpoint)
EndpointSecuritySettings struct { EndpointSecuritySettings struct {
// Whether non-administrator should be able to use bind mounts when creating containers // Whether non-administrator should be able to use bind mounts when creating containers
AllowBindMountsForRegularUsers bool `json:"allowBindMountsForRegularUsers,omitempty" example:"false"` AllowBindMountsForRegularUsers bool `json:"allowBindMountsForRegularUsers" example:"false"`
// Whether non-administrator should be able to use privileged mode when creating containers // Whether non-administrator should be able to use privileged mode when creating containers
AllowPrivilegedModeForRegularUsers bool `json:"allowPrivilegedModeForRegularUsers,omitempty" example:"false"` AllowPrivilegedModeForRegularUsers bool `json:"allowPrivilegedModeForRegularUsers" example:"false"`
// Whether non-administrator should be able to browse volumes // Whether non-administrator should be able to browse volumes
AllowVolumeBrowserForRegularUsers bool `json:"allowVolumeBrowserForRegularUsers,omitempty" example:"true"` AllowVolumeBrowserForRegularUsers bool `json:"allowVolumeBrowserForRegularUsers" example:"true"`
// Whether non-administrator should be able to use the host pid // Whether non-administrator should be able to use the host pid
AllowHostNamespaceForRegularUsers bool `json:"allowHostNamespaceForRegularUsers,omitempty" example:"true"` AllowHostNamespaceForRegularUsers bool `json:"allowHostNamespaceForRegularUsers" example:"true"`
// Whether non-administrator should be able to use device mapping // Whether non-administrator should be able to use device mapping
AllowDeviceMappingForRegularUsers bool `json:"allowDeviceMappingForRegularUsers,omitempty" example:"true"` AllowDeviceMappingForRegularUsers bool `json:"allowDeviceMappingForRegularUsers" example:"true"`
// Whether non-administrator should be able to manage stacks // Whether non-administrator should be able to manage stacks
AllowStackManagementForRegularUsers bool `json:"allowStackManagementForRegularUsers,omitempty" example:"true"` AllowStackManagementForRegularUsers bool `json:"allowStackManagementForRegularUsers" example:"true"`
// Whether non-administrator should be able to use container capabilities // Whether non-administrator should be able to use container capabilities
AllowContainerCapabilitiesForRegularUsers bool `json:"allowContainerCapabilitiesForRegularUsers,omitempty" example:"true"` AllowContainerCapabilitiesForRegularUsers bool `json:"allowContainerCapabilitiesForRegularUsers" example:"true"`
// Whether non-administrator should be able to use sysctl settings // Whether non-administrator should be able to use sysctl settings
AllowSysctlSettingForRegularUsers bool `json:"allowSysctlSettingForRegularUsers,omitempty" example:"true"` AllowSysctlSettingForRegularUsers bool `json:"allowSysctlSettingForRegularUsers" example:"true"`
// Whether host management features are enabled // Whether host management features are enabled
EnableHostManagementFeatures bool `json:"enableHostManagementFeatures,omitempty" example:"true"` EnableHostManagementFeatures bool `json:"enableHostManagementFeatures" example:"true"`
} }
// EndpointType represents the type of an environment(endpoint) // EndpointType represents the type of an environment(endpoint)
@ -549,15 +549,15 @@ type (
// EndpointPostInitMigrations // EndpointPostInitMigrations
EndpointPostInitMigrations struct { EndpointPostInitMigrations struct {
MigrateIngresses bool `json:"MigrateIngresses,omitempty"` MigrateIngresses bool `json:"MigrateIngresses"`
MigrateGPUs bool `json:"MigrateGPUs,omitempty"` MigrateGPUs bool `json:"MigrateGPUs"`
} }
// Extension represents a deprecated Portainer extension // Extension represents a deprecated Portainer extension
Extension struct { Extension struct {
// Extension Identifier // Extension Identifier
ID ExtensionID `json:"Id" example:"1"` ID ExtensionID `json:"Id" example:"1"`
Enabled bool `json:"Enabled,omitempty"` Enabled bool `json:"Enabled"`
Name string `json:"Name,omitempty"` Name string `json:"Name,omitempty"`
ShortDescription string `json:"ShortDescription,omitempty"` ShortDescription string `json:"ShortDescription,omitempty"`
Description string `json:"Description,omitempty"` Description string `json:"Description,omitempty"`
@ -611,13 +611,13 @@ type (
JobType int JobType int
K8sNamespaceInfo struct { K8sNamespaceInfo struct {
IsSystem bool `json:"IsSystem,omitempty"` IsSystem bool `json:"IsSystem"`
IsDefault bool `json:"IsDefault,omitempty"` IsDefault bool `json:"IsDefault"`
} }
K8sNodeLimits struct { K8sNodeLimits struct {
CPU int64 `json:"CPU,omitempty"` CPU int64 `json:"CPU"`
Memory int64 `json:"Memory,omitempty"` Memory int64 `json:"Memory"`
} }
K8sNodesLimits map[string]*K8sNodeLimits K8sNodesLimits map[string]*K8sNodeLimits
@ -637,9 +637,9 @@ type (
// KubernetesFlags are used to detect if we need to run initial cluster // KubernetesFlags are used to detect if we need to run initial cluster
// detection again. // detection again.
KubernetesFlags struct { KubernetesFlags struct {
IsServerMetricsDetected bool `json:"IsServerMetricsDetected,omitempty"` IsServerMetricsDetected bool `json:"IsServerMetricsDetected"`
IsServerIngressClassDetected bool `json:"IsServerIngressClassDetected,omitempty"` IsServerIngressClassDetected bool `json:"IsServerIngressClassDetected"`
IsServerStorageDetected bool `json:"IsServerStorageDetected,omitempty"` IsServerStorageDetected bool `json:"IsServerStorageDetected"`
} }
// KubernetesSnapshot represents a snapshot of a specific Kubernetes environment(endpoint) at a specific time // KubernetesSnapshot represents a snapshot of a specific Kubernetes environment(endpoint) at a specific time
@ -653,15 +653,15 @@ type (
// KubernetesConfiguration represents the configuration of a Kubernetes environment(endpoint) // KubernetesConfiguration represents the configuration of a Kubernetes environment(endpoint)
KubernetesConfiguration struct { KubernetesConfiguration struct {
UseLoadBalancer bool `json:"UseLoadBalancer,omitempty"` UseLoadBalancer bool `json:"UseLoadBalancer"`
UseServerMetrics bool `json:"UseServerMetrics,omitempty"` UseServerMetrics bool `json:"UseServerMetrics"`
EnableResourceOverCommit bool `json:"EnableResourceOverCommit,omitempty"` EnableResourceOverCommit bool `json:"EnableResourceOverCommit"`
ResourceOverCommitPercentage int `json:"ResourceOverCommitPercentage,omitempty"` ResourceOverCommitPercentage int `json:"ResourceOverCommitPercentage"`
StorageClasses []KubernetesStorageClassConfig `json:"StorageClasses"` StorageClasses []KubernetesStorageClassConfig `json:"StorageClasses"`
IngressClasses []KubernetesIngressClassConfig `json:"IngressClasses"` IngressClasses []KubernetesIngressClassConfig `json:"IngressClasses"`
RestrictDefaultNamespace bool `json:"RestrictDefaultNamespace,omitempty"` RestrictDefaultNamespace bool `json:"RestrictDefaultNamespace"`
IngressAvailabilityPerNamespace bool `json:"IngressAvailabilityPerNamespace,omitempty"` IngressAvailabilityPerNamespace bool `json:"IngressAvailabilityPerNamespace"`
AllowNoneIngressClass bool `json:"AllowNoneIngressClass,omitempty"` AllowNoneIngressClass bool `json:"AllowNoneIngressClass"`
} }
// KubernetesStorageClassConfig represents a Kubernetes Storage Class configuration // KubernetesStorageClassConfig represents a Kubernetes Storage Class configuration
@ -669,14 +669,14 @@ type (
Name string `json:"Name"` Name string `json:"Name"`
AccessModes []string `json:"AccessModes"` AccessModes []string `json:"AccessModes"`
Provisioner string `json:"Provisioner"` Provisioner string `json:"Provisioner"`
AllowVolumeExpansion bool `json:"AllowVolumeExpansion,omitempty"` AllowVolumeExpansion bool `json:"AllowVolumeExpansion"`
} }
// KubernetesIngressClassConfig represents a Kubernetes Ingress Class configuration // KubernetesIngressClassConfig represents a Kubernetes Ingress Class configuration
KubernetesIngressClassConfig struct { KubernetesIngressClassConfig struct {
Name string `json:"Name"` Name string `json:"Name"`
Type string `json:"Type"` Type string `json:"Type"`
GloballyBlocked bool `json:"Blocked,omitempty"` GloballyBlocked bool `json:"Blocked"`
BlockedNamespaces []string `json:"BlockedNamespaces"` BlockedNamespaces []string `json:"BlockedNamespaces"`
} }
@ -690,7 +690,7 @@ type (
// InternalAuthSettings represents settings used for the default 'internal' authentication // InternalAuthSettings represents settings used for the default 'internal' authentication
InternalAuthSettings struct { InternalAuthSettings struct {
RequiredPasswordLength int `json:"RequiredPasswordLength,omitempty"` RequiredPasswordLength int
} }
// LDAPGroupSearchSettings represents settings used to search for groups in a LDAP server // LDAPGroupSearchSettings represents settings used to search for groups in a LDAP server
@ -698,7 +698,7 @@ type (
// The distinguished name of the element from which the LDAP server will search for groups // 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"` GroupBaseDN string `json:"GroupBaseDN" example:"dc=ldap,dc=domain,dc=tld"`
// The LDAP search filter used to select group elements, optional // The LDAP search filter used to select group elements, optional
GroupFilter string `json:"GroupFilter,omitempty" example:"(objectClass=account"` GroupFilter string `json:"GroupFilter" example:"(objectClass=account"`
// LDAP attribute which denotes the group membership // LDAP attribute which denotes the group membership
GroupAttribute string `json:"GroupAttribute" example:"member"` GroupAttribute string `json:"GroupAttribute" example:"member"`
} }
@ -716,7 +716,7 @@ type (
// LDAPSettings represents the settings used to connect to a LDAP server // LDAPSettings represents the settings used to connect to a LDAP server
LDAPSettings struct { LDAPSettings struct {
// Enable this option if the server is configured for Anonymous access. When enabled, ReaderDN and Password will not be used // Enable this option if the server is configured for Anonymous access. When enabled, ReaderDN and Password will not be used
AnonymousMode bool `json:"AnonymousMode,omitempty" example:"true" validate:"validate_bool"` AnonymousMode bool `json:"AnonymousMode" example:"true" validate:"validate_bool"`
// Account that will be used to search for users // Account that will be used to search for users
ReaderDN string `json:"ReaderDN" example:"cn=readonly-account,dc=ldap,dc=domain,dc=tld" validate:"required_if=AnonymousMode false"` ReaderDN string `json:"ReaderDN" example:"cn=readonly-account,dc=ldap,dc=domain,dc=tld" validate:"required_if=AnonymousMode false"`
// Password of the account that will be used to search users // Password of the account that will be used to search users
@ -725,11 +725,11 @@ type (
URL string `json:"URL" example:"myldap.domain.tld:389" validate:"hostname_port"` URL string `json:"URL" example:"myldap.domain.tld:389" validate:"hostname_port"`
TLSConfig TLSConfiguration `json:"TLSConfig"` TLSConfig TLSConfiguration `json:"TLSConfig"`
// Whether LDAP connection should use StartTLS // Whether LDAP connection should use StartTLS
StartTLS bool `json:"StartTLS,omitempty" example:"true"` StartTLS bool `json:"StartTLS" example:"true"`
SearchSettings []LDAPSearchSettings `json:"SearchSettings"` SearchSettings []LDAPSearchSettings `json:"SearchSettings"`
GroupSearchSettings []LDAPGroupSearchSettings `json:"GroupSearchSettings"` GroupSearchSettings []LDAPGroupSearchSettings `json:"GroupSearchSettings"`
// Automatically provision users and assign them to matching LDAP group names // Automatically provision users and assign them to matching LDAP group names
AutoCreateUsers bool `json:"AutoCreateUsers,omitempty" example:"true"` AutoCreateUsers bool `json:"AutoCreateUsers" example:"true"`
} }
// LDAPUser represents a LDAP user // LDAPUser represents a LDAP user
@ -769,7 +769,7 @@ type (
// Pair defines a key/value string pair // Pair defines a key/value string pair
Pair struct { Pair struct {
Name string `json:"name" example:"name"` Name string `json:"name" example:"name"`
Value string `json:"value,omitempty" example:"value"` Value string `json:"value" example:"value"`
} }
// Registry represents a Docker registry with all the info required // Registry represents a Docker registry with all the info required
@ -782,13 +782,13 @@ type (
// Registry Name // Registry Name
Name string `json:"Name" example:"my-registry"` Name string `json:"Name" example:"my-registry"`
// URL or IP address of the Docker registry // URL or IP address of the Docker registry
URL string `json:"URL,omitempty" example:"registry.mydomain.tld:2375"` URL string `json:"URL" example:"registry.mydomain.tld:2375"`
// Base URL, introduced for ProGet registry // Base URL, introduced for ProGet registry
BaseURL string `json:"BaseURL,omitempty" example:"registry.mydomain.tld:2375"` BaseURL string `json:"BaseURL" example:"registry.mydomain.tld:2375"`
// Is authentication against this registry enabled // Is authentication against this registry enabled
Authentication bool `json:"Authentication,omitempty" example:"true"` Authentication bool `json:"Authentication" example:"true"`
// Username or AccessKeyID used to authenticate against this registry // Username or AccessKeyID used to authenticate against this registry
Username string `json:"Username,omitempty" example:"registry user"` Username string `json:"Username" example:"registry user"`
// Password or SecretAccessKey used to authenticate against this registry // Password or SecretAccessKey used to authenticate against this registry
Password string `json:"Password,omitempty" example:"registry_password"` Password string `json:"Password,omitempty" example:"registry_password"`
ManagementConfiguration *RegistryManagementConfiguration `json:"ManagementConfiguration"` ManagementConfiguration *RegistryManagementConfiguration `json:"ManagementConfiguration"`
@ -828,9 +828,9 @@ type (
// the registry API via the registry management extension. // the registry API via the registry management extension.
RegistryManagementConfiguration struct { RegistryManagementConfiguration struct {
Type RegistryType `json:"Type"` Type RegistryType `json:"Type"`
Authentication bool `json:"Authentication,omitempty"` Authentication bool `json:"Authentication"`
Username string `json:"Username,omitempty"` Username string `json:"Username"`
Password string `json:"Password,omitempty"` Password string `json:"Password"`
TLSConfig TLSConfiguration `json:"TLSConfig"` TLSConfig TLSConfiguration `json:"TLSConfig"`
Ecr EcrData `json:"Ecr"` Ecr EcrData `json:"Ecr"`
AccessToken string `json:"AccessToken,omitempty"` AccessToken string `json:"AccessToken,omitempty"`
@ -860,8 +860,8 @@ type (
// Permit access to the associated resource to any user // Permit access to the associated resource to any user
Public bool `json:"Public" example:"true"` Public bool `json:"Public" example:"true"`
// Permit access to resource only to admins // Permit access to resource only to admins
AdministratorsOnly bool `json:"AdministratorsOnly,omitempty" example:"true"` AdministratorsOnly bool `json:"AdministratorsOnly" example:"true"`
System bool `json:"System,omitempty"` System bool `json:"System"`
// Deprecated fields // Deprecated fields
// Deprecated in DBVersion == 2 // Deprecated in DBVersion == 2
@ -883,10 +883,10 @@ type (
// Role name // Role name
Name string `json:"Name" example:"HelpDesk"` Name string `json:"Name" example:"HelpDesk"`
// Role description // Role description
Description string `json:"Description,omitempty" example:"Read-only access of all resources in an environment(endpoint)"` Description string `json:"Description" example:"Read-only access of all resources in an environment(endpoint)"`
// Authorizations associated to a role // Authorizations associated to a role
Authorizations Authorizations `json:"Authorizations"` Authorizations Authorizations `json:"Authorizations"`
Priority int `json:"Priority,omitempty"` Priority int `json:"Priority"`
} }
// RoleID represents a role identifier // RoleID represents a role identifier
@ -899,7 +899,7 @@ type (
APIKey struct { APIKey struct {
ID APIKeyID `json:"id" example:"1"` ID APIKeyID `json:"id" example:"1"`
UserID UserID `json:"userId" example:"1"` UserID UserID `json:"userId" example:"1"`
Description string `json:"description,omitempty" example:"portainer-api-key"` Description string `json:"description" example:"portainer-api-key"`
Prefix string `json:"prefix"` // API key identifier (7 char prefix) Prefix string `json:"prefix"` // API key identifier (7 char prefix)
DateCreated int64 `json:"dateCreated"` // Unix timestamp (UTC) when the API key was created 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 LastUsed int64 `json:"lastUsed"` // Unix timestamp (UTC) when the API key was last used
@ -916,10 +916,10 @@ type (
ID ScheduleID `json:"Id" example:"1"` ID ScheduleID `json:"Id" example:"1"`
Name string Name string
CronExpression string CronExpression string
Recurring bool `json:"Recurring,omitempty"` Recurring bool
Created int64 Created int64
JobType JobType JobType JobType
EdgeSchedule *EdgeSchedule `json:"EdgeSchedule,omitempty"` EdgeSchedule *EdgeSchedule
} }
// ScheduleID represents a schedule identifier. // ScheduleID represents a schedule identifier.
@ -931,18 +931,18 @@ type (
Endpoints []EndpointID Endpoints []EndpointID
Image string Image string
ScriptPath string ScriptPath string
RetryCount int `json:"RetryCount,omitempty"` RetryCount int
RetryInterval int `json:"RetryInterval,omitempty"` RetryInterval int
} }
GlobalDeploymentOptions struct { GlobalDeploymentOptions struct {
HideStacksFunctionality bool `json:"hideStacksFunctionality,omitempty" example:"false"` HideStacksFunctionality bool `json:"hideStacksFunctionality" example:"false"`
} }
// Settings represents the application settings // Settings represents the application settings
Settings struct { Settings struct {
// 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 // 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,omitempty" example:"https://mycompany.mydomain.tld/logo.png"` 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 // A list of label name & value that will be used to hide containers when querying containers
BlackListedLabels []Pair `json:"BlackListedLabels"` BlackListedLabels []Pair `json:"BlackListedLabels"`
// Active authentication method for the Portainer instance. Valid values are: 1 for internal, 2 for LDAP, or 3 for oauth // Active authentication method for the Portainer instance. Valid values are: 1 for internal, 2 for LDAP, or 3 for oauth
@ -962,27 +962,27 @@ type (
// The default check in interval for edge agent (in seconds) // The default check in interval for edge agent (in seconds)
EdgeAgentCheckinInterval int `json:"EdgeAgentCheckinInterval" example:"5"` EdgeAgentCheckinInterval int `json:"EdgeAgentCheckinInterval" example:"5"`
// Show the Kompose build option (discontinued in 2.18) // Show the Kompose build option (discontinued in 2.18)
ShowKomposeBuildOption bool `json:"ShowKomposeBuildOption,omitempty" example:"false"` ShowKomposeBuildOption bool `json:"ShowKomposeBuildOption" example:"false"`
// Whether edge compute features are enabled // Whether edge compute features are enabled
EnableEdgeComputeFeatures bool `json:"EnableEdgeComputeFeatures,omitempty"` EnableEdgeComputeFeatures bool `json:"EnableEdgeComputeFeatures"`
// The duration of a user session // The duration of a user session
UserSessionTimeout string `json:"UserSessionTimeout" example:"5m"` UserSessionTimeout string `json:"UserSessionTimeout" example:"5m"`
// The expiry of a Kubeconfig // The expiry of a Kubeconfig
KubeconfigExpiry string `json:"KubeconfigExpiry" example:"24h"` KubeconfigExpiry string `json:"KubeconfigExpiry" example:"24h"`
// Whether telemetry is enabled // Whether telemetry is enabled
EnableTelemetry bool `json:"EnableTelemetry,omitempty" example:"false"` EnableTelemetry bool `json:"EnableTelemetry" example:"false"`
// Helm repository URL, defaults to "https://charts.bitnami.com/bitnami" // Helm repository URL, defaults to "https://charts.bitnami.com/bitnami"
HelmRepositoryURL string `json:"HelmRepositoryURL" example:"https://charts.bitnami.com/bitnami"` HelmRepositoryURL string `json:"HelmRepositoryURL" example:"https://charts.bitnami.com/bitnami"`
// KubectlImage, defaults to portainer/kubectl-shell // KubectlImage, defaults to portainer/kubectl-shell
KubectlShellImage string `json:"KubectlShellImage" example:"portainer/kubectl-shell"` KubectlShellImage string `json:"KubectlShellImage" example:"portainer/kubectl-shell"`
// TrustOnFirstConnect makes Portainer accepting edge agent connection by default // TrustOnFirstConnect makes Portainer accepting edge agent connection by default
TrustOnFirstConnect bool `json:"TrustOnFirstConnect,omitempty" example:"false"` TrustOnFirstConnect bool `json:"TrustOnFirstConnect" example:"false"`
// EnforceEdgeID makes Portainer store the Edge ID instead of accepting anyone // EnforceEdgeID makes Portainer store the Edge ID instead of accepting anyone
EnforceEdgeID bool `json:"EnforceEdgeID,omitempty" example:"false"` EnforceEdgeID bool `json:"EnforceEdgeID" example:"false"`
// Container environment parameter AGENT_SECRET // Container environment parameter AGENT_SECRET
AgentSecret string `json:"AgentSecret,omitempty"` AgentSecret string `json:"AgentSecret"`
// EdgePortainerURL is the URL that is exposed to edge agents // EdgePortainerURL is the URL that is exposed to edge agents
EdgePortainerURL string `json:"EdgePortainerUrl,omitempty"` EdgePortainerURL string `json:"EdgePortainerUrl"`
Edge struct { Edge struct {
// The command list interval for edge agent - used in edge async mode (in seconds) // The command list interval for edge agent - used in edge async mode (in seconds)
@ -1021,10 +1021,10 @@ type (
// SSLSettings represents a pair of SSL certificate and key // SSLSettings represents a pair of SSL certificate and key
SSLSettings struct { SSLSettings struct {
CertPath string `json:"certPath,omitempty"` CertPath string `json:"certPath"`
KeyPath string `json:"keyPath,omitempty"` KeyPath string `json:"keyPath"`
SelfSigned bool `json:"selfSigned,omitempty"` SelfSigned bool `json:"selfSigned"`
HTTPEnabled bool `json:"httpEnabled,omitempty"` HTTPEnabled bool `json:"httpEnabled"`
} }
// Stack represents a Docker stack created via docker stack deploy // Stack represents a Docker stack created via docker stack deploy
@ -1038,13 +1038,13 @@ type (
// Environment(Endpoint) identifier. Reference the environment(endpoint) that will be used for deployment // Environment(Endpoint) identifier. Reference the environment(endpoint) that will be used for deployment
EndpointID EndpointID `json:"EndpointId" example:"1"` EndpointID EndpointID `json:"EndpointId" example:"1"`
// Cluster identifier of the Swarm cluster where the stack is deployed // Cluster identifier of the Swarm cluster where the stack is deployed
SwarmID string `json:"SwarmId,omitempty" example:"jpofkc0i9uo9wtx1zesuk649w"` SwarmID string `json:"SwarmId" example:"jpofkc0i9uo9wtx1zesuk649w"`
// Path to the Stack file // Path to the Stack file
EntryPoint string `json:"EntryPoint" example:"docker-compose.yml"` EntryPoint string `json:"EntryPoint" example:"docker-compose.yml"`
// A list of environment(endpoint) variables used during stack deployment // A list of environment(endpoint) variables used during stack deployment
Env []Pair `json:"Env"` Env []Pair `json:"Env"`
// //
ResourceControl *ResourceControl `json:"ResourceControl,omitempty"` ResourceControl *ResourceControl `json:"ResourceControl"`
// Stack status (1 - active, 2 - inactive) // Stack status (1 - active, 2 - inactive)
Status StackStatus `json:"Status" example:"1"` Status StackStatus `json:"Status" example:"1"`
// Path on disk to the repository hosting the Stack file // Path on disk to the repository hosting the Stack file
@ -1060,23 +1060,23 @@ type (
// Only applies when deploying stack with multiple files // Only applies when deploying stack with multiple files
AdditionalFiles []string `json:"AdditionalFiles"` AdditionalFiles []string `json:"AdditionalFiles"`
// The GitOps update settings of a git stack // The GitOps update settings of a git stack
AutoUpdate *AutoUpdateSettings `json:"AutoUpdate,omitempty"` AutoUpdate *AutoUpdateSettings `json:"AutoUpdate"`
// The stack deployment option // The stack deployment option
Option *StackOption `json:"Option,omitempty"` Option *StackOption `json:"Option"`
// The git config of this stack // The git config of this stack
GitConfig *gittypes.RepoConfig `json:"GitConfig,omitempty"` GitConfig *gittypes.RepoConfig
// Whether the stack is from a app template // Whether the stack is from a app template
FromAppTemplate bool `json:"FromAppTemplate,omitempty" example:"false"` FromAppTemplate bool `example:"false"`
// Kubernetes namespace if stack is a kube application // Kubernetes namespace if stack is a kube application
Namespace string `json:"Namespace,omitempty" example:"default"` Namespace string `example:"default"`
// IsComposeFormat indicates if the Kubernetes stack is created from a Docker Compose file // IsComposeFormat indicates if the Kubernetes stack is created from a Docker Compose file
IsComposeFormat bool `json:"IsComposeFormat,omitempty" example:"false"` IsComposeFormat bool `example:"false"`
} }
// StackOption represents the options for stack deployment // StackOption represents the options for stack deployment
StackOption struct { StackOption struct {
// Prune services that are no longer referenced // Prune services that are no longer referenced
Prune bool `json:"Prune,omitempty" example:"false"` Prune bool `example:"false"`
} }
// StackID represents a stack identifier (it must be composed of Name + "_" + SwarmID to create a unique identifier) // StackID represents a stack identifier (it must be composed of Name + "_" + SwarmID to create a unique identifier)
@ -1159,9 +1159,9 @@ type (
// Title of the template // Title of the template
Title string `json:"title" example:"Nginx"` Title string `json:"title" example:"Nginx"`
// Description of the template // Description of the template
Description string `json:"description,omitempty" example:"High performance web server"` Description string `json:"description" example:"High performance web server"`
// Whether the template should be available to administrators only // Whether the template should be available to administrators only
AdministratorOnly bool `json:"administrator_only,omitempty" example:"true"` AdministratorOnly bool `json:"administrator_only" example:"true"`
// Mandatory container fields // Mandatory container fields
// Image associated to a container template. Mandatory for a container template // Image associated to a container template. Mandatory for a container template
@ -1237,7 +1237,7 @@ type (
// A value that will be associated to the choice // A value that will be associated to the choice
Value string `json:"value" example:"value"` Value string `json:"value" example:"value"`
// Will set this choice as the default choice // Will set this choice as the default choice
Default bool `json:"default,omitempty" example:"false"` Default bool `json:"default" example:"false"`
} }
// TemplateID represents a template identifier // TemplateID represents a template identifier
@ -1267,9 +1267,9 @@ type (
// TLSConfiguration represents a TLS configuration // TLSConfiguration represents a TLS configuration
TLSConfiguration struct { TLSConfiguration struct {
// Use TLS // Use TLS
TLS bool `json:"TLS,omitempty" example:"true"` TLS bool `json:"TLS" example:"true"`
// Skip the verification of the server TLS certificate // Skip the verification of the server TLS certificate
TLSSkipVerify bool `json:"TLSSkipVerify,omitempty" example:"false"` TLSSkipVerify bool `json:"TLSSkipVerify" example:"false"`
// Path to the TLS CA certificate file // Path to the TLS CA certificate file
TLSCACertPath string `json:"TLSCACert,omitempty" example:"/data/tls/ca.pem"` TLSCACertPath string `json:"TLSCACert,omitempty" example:"/data/tls/ca.pem"`
// Path to the TLS client certificate file // Path to the TLS client certificate file
@ -1287,7 +1287,7 @@ type (
ID UserID ID UserID
Username string Username string
Role UserRole Role UserRole
ForceChangePassword bool `json:"ForceChangePassword,omitempty"` ForceChangePassword bool
Token string Token string
} }
@ -1302,7 +1302,7 @@ type (
// TunnelServerInfo represents information associated to the tunnel server // TunnelServerInfo represents information associated to the tunnel server
TunnelServerInfo struct { TunnelServerInfo struct {
PrivateKeySeed string `json:"PrivateKeySeed,omitempty"` PrivateKeySeed string `json:"PrivateKeySeed"`
} }
// User represents a user account // User represents a user account
@ -1345,7 +1345,7 @@ type (
// UserThemeSettings represents the theme settings for a user // UserThemeSettings represents the theme settings for a user
UserThemeSettings struct { UserThemeSettings struct {
// Color represents the color theme of the UI // Color represents the color theme of the UI
Color string `json:"color,omitempty" example:"dark" enums:"dark,light,highcontrast,auto"` Color string `json:"color" example:"dark" enums:"dark,light,highcontrast,auto"`
} }
// Webhook represents a url webhook that can be used to update a service // Webhook represents a url webhook that can be used to update a service
@ -1368,8 +1368,8 @@ type (
Snapshot struct { Snapshot struct {
EndpointID EndpointID `json:"EndpointId"` EndpointID EndpointID `json:"EndpointId"`
Docker *DockerSnapshot `json:"Docker,omitempty"` Docker *DockerSnapshot `json:"Docker"`
Kubernetes *KubernetesSnapshot `json:"Kubernetes,omitempty"` Kubernetes *KubernetesSnapshot `json:"Kubernetes"`
} }
// CLIService represents a service for managing CLI // CLIService represents a service for managing CLI

View File

@ -9,8 +9,8 @@ import { FormValues } from './types';
export function validationSchema(): SchemaOf<FormValues> { export function validationSchema(): SchemaOf<FormValues> {
return object() return object()
.shape({ .shape({
EnableEdgeComputeFeatures: boolean().default(false), EnableEdgeComputeFeatures: boolean().required('This field is required.'),
EnforceEdgeID: boolean().default(false), EnforceEdgeID: boolean().required('This field is required.'),
}) })
.concat( .concat(
isBE isBE