You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
portainer/api/http/handler/endpointedge/endpointedge_status_inspect.go

343 lines
11 KiB

package endpointedge
feat(edge): introduce support for Edge agent (#3031) * feat(edge): fix webconsole and agent deployment command * feat(edge): display agent features when connected to IoT endpoint * feat(edge): add -e CAP_HOST_MANAGEMENT=1 to agent command * feat(edge): add -v /:/host and --name portainer_agent_iot to agent command * style(endpoint-creation): refactor IoT agent to Edge agent * refactor(api): rename AgentIoTEnvironment to AgentEdgeEnvironment * refactor(api): rename AgentIoTEnvironment to AgentEdgeEnvironment * feat(endpoint-creation): update Edge agent deployment instructions * feat(edge): wip edge * feat(edge): refactor key creation * feat(edge): update deployment instructions * feat(home): update Edge agent endpoint item * feat(edge): support dynamic ports * feat(edge): support sleep/wake and snapshots * feat(edge): support offline mode * feat(edge): host job support for Edge endpoints * feat(edge): introduce STANDBY state * feat(edge): update Edge agent deployment command * feat(edge): introduce EDGE_ID support * feat(edge): update default inactivity interval to 5min * feat(edge): reload Edge schedules after restart * fix(edge): fix execution of endpoint job against an Edge endpoint * fix(edge): fix minor issues with scheduling UI/UX * feat(edge): introduce EdgeSchedule version management * feat(edge): switch back to REQUIRED state from ACTIVE on error * refactor(edge): remove comment * feat(edge): updated tunnel status management * feat(edge): fix flickering UI when accessing Edge endpoint from home view * feat(edge): remove STANDBY status * fix(edge): fix an issue with console and Swarm endpoint * fix(edge): fix an issue with stack deployment * fix(edge): reset timer when applying active status * feat(edge): add background ping for Edge endpoints * fix(edge): fix infinite loading loop after Edge endpoint connection failure * fix(home): fix an issue with merge * feat(api): remove SnapshotRaw from EndpointList response * feat(api): add pagination for EndpointList operation * feat(api): rename last_id query parameter to start * feat(api): implement filter for EndpointList operation * fix(edge): prevent a pointer issue after removing an active Edge endpoint * feat(home): front - endpoint backend pagination (#2990) * feat(home): endpoint pagination with backend * feat(api): remove default limit value * fix(endpoints): fix a minor issue with column span * fix(endpointgroup-create): fix an issue with endpoint group creation * feat(app): minor loading optimizations * refactor(api): small refactor of EndpointList operation * fix(home): fix minor loading text display issue * refactor(api): document bolt services functions * feat(home): minor optimization * fix(api): replace seek with index scanning for EndpointPaginated * fix(api): fix invalid starting index issue * fix(api): first implementation of working filter * fix(home): endpoints list keeps backend pagination when it needs to * fix(api): endpoint pagination doesn't drop the first item on pages >=2 anymore * fix(home): UI flickering on page/filter load/change * feat(auth): login spinner * feat(api): support searching in associated endpoint group data * refactor(api): remove unused API endpoint * refactor(api): remove comment * refactor(api): refactor proxy manager * feat(api): declare EndpointList params as optional * feat(api): support groupID filter on endpoints route * feat(api): add new API operations endpointGroupAddEndpoint and endpointGroupDeleteEndpoint * feat(edge): new icon for Edge agent endpoint * fix(edge): fix missing exec quick action * fix(edge): add loading indicator when connecting to Edge endpoint * feat(edge): disable service webhooks for Edge endpoints * feat(endpoints): backend pagination for endpoints view (#3004) * feat(edge): dynamic loading for stack migration feature * feat(edge): wordwrap edge key * feat(endpoint-groups): backend pagination support for create and edit * feat(endpoint-groups): debounce on filter for create/edit views * feat(endpoint-groups): filter assigned on create view * (endpoint-groups): unassigned endpoints edit view * refactor(endpoint-groups): code clean * feat(endpoint-groups): remove message for Unassigned group * refactor(websocket): minor refactor associated to Edge agent * feat(endpoint-group): enable backend pagination (#3017) * feat(api): support groupID filter on endpoints route * feat(api): add new API operations endpointGroupAddEndpoint and endpointGroupDeleteEndpoint * feat(endpoint-groups): backend pagination support for create and edit * feat(endpoint-groups): debounce on filter for create/edit views * feat(endpoint-groups): filter assigned on create view * (endpoint-groups): unassigned endpoints edit view * refactor(endpoint-groups): code clean * feat(endpoint-groups): remove message for Unassigned group * refactor(api): endpoint group endpoint association refactor * refactor(api): rename files and remove comments * refactor(api): remove usage of utils * refactor(api): optional parameters * Merge branch 'feat-endpoint-backend-pagination' into edge # Conflicts: # api/bolt/endpoint/endpoint.go # api/http/handler/endpointgroups/endpointgroup_update.go # api/http/handler/endpointgroups/handler.go # api/http/handler/endpoints/endpoint_list.go # app/portainer/services/api/endpointService.js * fix(api): fix default tunnel server credentials * feat(api): update endpointListOperation behavior and parameters * fix(api): fix interface declaration * feat(edge): support configurable Edge agent checkin interval * feat(edge): support dynamic tunnel credentials * feat(edge): update Edge agent deployment commands * style(edge): update Edge agent settings text * refactor(edge): remove unused credentials management methods * feat(edge): associate a remote addr to tunnel credentials * style(edge): update Edge endpoint icon * feat(edge): support encrypted tunnel credentials * fix(edge): fix invalid pointer cast * feat(bolt): decode endpoints with jsoniter * feat(edge): persist reverse tunnel keyseed * refactor(edge): minor refactor * feat(edge): update chisel library usage * refactor(endpoint): use controller function * feat(api): database migration to DBVersion 19 * refactor(api): refactor AddSchedule function * refactor(schedules): remove comment * refactor(api): remove comment * refactor(api): remove comment * feat(api): tunnel manager now only manage Edge endpoints * refactor(api): clean-up and clarification of the Edge service * refactor(api): clean-up and clarification of the Edge service * fix(api): fix an issue with Edge agent snapshots * refactor(api): add missing comments * refactor(api): update constant description * style(home): remove loading text on error * feat(endpoint): remove 15s timeout for ping request * style(home): display information about associated Edge endpoints * feat(home): redirect to endpoint details on click on unassociated Edge endpoint * feat(settings): remove 60s Edge poll frequency option
5 years ago
import (
"bytes"
"cmp"
feat(edge-compute): move host jobs to edge (#3840) * feat(endpoints): create an associated endpoints selector * feat(schedules): remove edge specific explanations * refactor(schedule): replace multi-endpoint-selector * refactor(schedule): move controller to single file * refactor(endpoints): remove multi-endpoint-selector * feat(edge): rename host jobs to edge jobs * feat(edge-jobs): remove edge warning * refactor(edge-jobs): move schedule pages to edge * refactor(edge-jobs): mv views to edgeJobs * refactor(edge-jobs): rename edge jobs * refactor(edge-jobs): move services to edge * refactor(edge-jobs): move tasks datatable * fix(edge-jobs): fix import * fix(edge-jobs): use right services * feat(settings): adjust host management description * feat(edge-jobs): introduce interfaces and types * feat(edge-jobs): implement bolt service * refactor(edge-jobs): replace schedule routes * refactor(edge-job): replace Schedule service * refactor(edge-jobs): remove job_script_exec * refactor(host): remove jobs table * feat(edge-jobs): replace schedule * feat(edge-jobs): load file on inspect * fix(edge-job): parse cron correctly * feat(edge-jobs): show tasks * feat(host): rename tooltip * refactor(host): remove old components * refactor(main): remove schedule types * refactor(snapshot): replace job service with snapshot service * refactor(jobs): remove jobs form and datatable * feat(edge-jobs): create db migration * fix(main): start snapshot service with correct interval * feat(settings): change host tooltip * feat(edge-jobs): load endpoints * fix(edge-job): disable form submit when form is invalid * refactor(edge-compute): use const * refactor(edge-jobs): use generic controller * refactor(edge-jobs): replace $scope with controllerAs * refactor(edge-jobs): replace routes with components * refactor(edge-jobs): replace functions with classes * refactor(edge-jobs): use async/await * refactor(edge-jobs): rename functions * feat(edge-jobs): introduce beta panel * feat(edge-jobs): allow single character names * fix(snapshot): run snapshot in coroutine * feat(edge-jobs): add logs status * feat(filesystem): add edge job logs methods * feat(edge-jobs): intoduce edge jobs tasks api * feat(edge-jobs): remove schedule task model * fix(fs): build edge job task file path * fix(edge-jobs): update task meta * fix(edge-jobs): return a list of endpoints * feat(edge-jobs): update logs from agent * feat(edge-jobs): collect logs * feat(edge-jobs): rename url * feat(edge-jobs): refresh to same tab * feat(edge-jobs): remove old info * refactor(edge-jobs): rename script path json * fix(edge-job): save file before adding job * feat(edge-job): show retrieving logs label * feat(edge-job): replace cron with 5 places * refactor(edge-jobs): replace tasks with results * feat(edge-jobs): add auto refresh until logs are collected * feat(edge-jobs): fix column size * feat(edge-job): display editor * feat(edge-job): add name validation * feat(edge-job): set default time for 1 hour from now * feat(edge-job): add validation for cron format * feat(edge-job): add a note about timezone * fix(edge-job): replace regex * fix(edge-job): check for every minute cron * style(edge-jobs): add reference for cron regex * refactor(edge-jobs): rename migration name * refactor(edge-job): rename edge job response * refactor(snapshot): rename snapshot endpoint method * refactor(edge-jobs): move tasks handler to edgejobs * feat(security): introduce a middleware for edge compute operations * feat(edge-job): use edge compute middleware * feat(edge-groups): filter http actions based on edge setting * fix(security): return from edge bouncer if failed * feat(edge-stacks): filter http actions based on edge setting * feat(edge-groups): show error when failed to load groups * refactor(db): remove edge-jobs migration * refactor(migrator): remove unused dependency Co-authored-by: Anthony Lapenna <lapenna.anthony@gmail.com>
4 years ago
"encoding/base64"
"errors"
"fmt"
"hash/fnv"
"io"
feat(edge): introduce support for Edge agent (#3031) * feat(edge): fix webconsole and agent deployment command * feat(edge): display agent features when connected to IoT endpoint * feat(edge): add -e CAP_HOST_MANAGEMENT=1 to agent command * feat(edge): add -v /:/host and --name portainer_agent_iot to agent command * style(endpoint-creation): refactor IoT agent to Edge agent * refactor(api): rename AgentIoTEnvironment to AgentEdgeEnvironment * refactor(api): rename AgentIoTEnvironment to AgentEdgeEnvironment * feat(endpoint-creation): update Edge agent deployment instructions * feat(edge): wip edge * feat(edge): refactor key creation * feat(edge): update deployment instructions * feat(home): update Edge agent endpoint item * feat(edge): support dynamic ports * feat(edge): support sleep/wake and snapshots * feat(edge): support offline mode * feat(edge): host job support for Edge endpoints * feat(edge): introduce STANDBY state * feat(edge): update Edge agent deployment command * feat(edge): introduce EDGE_ID support * feat(edge): update default inactivity interval to 5min * feat(edge): reload Edge schedules after restart * fix(edge): fix execution of endpoint job against an Edge endpoint * fix(edge): fix minor issues with scheduling UI/UX * feat(edge): introduce EdgeSchedule version management * feat(edge): switch back to REQUIRED state from ACTIVE on error * refactor(edge): remove comment * feat(edge): updated tunnel status management * feat(edge): fix flickering UI when accessing Edge endpoint from home view * feat(edge): remove STANDBY status * fix(edge): fix an issue with console and Swarm endpoint * fix(edge): fix an issue with stack deployment * fix(edge): reset timer when applying active status * feat(edge): add background ping for Edge endpoints * fix(edge): fix infinite loading loop after Edge endpoint connection failure * fix(home): fix an issue with merge * feat(api): remove SnapshotRaw from EndpointList response * feat(api): add pagination for EndpointList operation * feat(api): rename last_id query parameter to start * feat(api): implement filter for EndpointList operation * fix(edge): prevent a pointer issue after removing an active Edge endpoint * feat(home): front - endpoint backend pagination (#2990) * feat(home): endpoint pagination with backend * feat(api): remove default limit value * fix(endpoints): fix a minor issue with column span * fix(endpointgroup-create): fix an issue with endpoint group creation * feat(app): minor loading optimizations * refactor(api): small refactor of EndpointList operation * fix(home): fix minor loading text display issue * refactor(api): document bolt services functions * feat(home): minor optimization * fix(api): replace seek with index scanning for EndpointPaginated * fix(api): fix invalid starting index issue * fix(api): first implementation of working filter * fix(home): endpoints list keeps backend pagination when it needs to * fix(api): endpoint pagination doesn't drop the first item on pages >=2 anymore * fix(home): UI flickering on page/filter load/change * feat(auth): login spinner * feat(api): support searching in associated endpoint group data * refactor(api): remove unused API endpoint * refactor(api): remove comment * refactor(api): refactor proxy manager * feat(api): declare EndpointList params as optional * feat(api): support groupID filter on endpoints route * feat(api): add new API operations endpointGroupAddEndpoint and endpointGroupDeleteEndpoint * feat(edge): new icon for Edge agent endpoint * fix(edge): fix missing exec quick action * fix(edge): add loading indicator when connecting to Edge endpoint * feat(edge): disable service webhooks for Edge endpoints * feat(endpoints): backend pagination for endpoints view (#3004) * feat(edge): dynamic loading for stack migration feature * feat(edge): wordwrap edge key * feat(endpoint-groups): backend pagination support for create and edit * feat(endpoint-groups): debounce on filter for create/edit views * feat(endpoint-groups): filter assigned on create view * (endpoint-groups): unassigned endpoints edit view * refactor(endpoint-groups): code clean * feat(endpoint-groups): remove message for Unassigned group * refactor(websocket): minor refactor associated to Edge agent * feat(endpoint-group): enable backend pagination (#3017) * feat(api): support groupID filter on endpoints route * feat(api): add new API operations endpointGroupAddEndpoint and endpointGroupDeleteEndpoint * feat(endpoint-groups): backend pagination support for create and edit * feat(endpoint-groups): debounce on filter for create/edit views * feat(endpoint-groups): filter assigned on create view * (endpoint-groups): unassigned endpoints edit view * refactor(endpoint-groups): code clean * feat(endpoint-groups): remove message for Unassigned group * refactor(api): endpoint group endpoint association refactor * refactor(api): rename files and remove comments * refactor(api): remove usage of utils * refactor(api): optional parameters * Merge branch 'feat-endpoint-backend-pagination' into edge # Conflicts: # api/bolt/endpoint/endpoint.go # api/http/handler/endpointgroups/endpointgroup_update.go # api/http/handler/endpointgroups/handler.go # api/http/handler/endpoints/endpoint_list.go # app/portainer/services/api/endpointService.js * fix(api): fix default tunnel server credentials * feat(api): update endpointListOperation behavior and parameters * fix(api): fix interface declaration * feat(edge): support configurable Edge agent checkin interval * feat(edge): support dynamic tunnel credentials * feat(edge): update Edge agent deployment commands * style(edge): update Edge agent settings text * refactor(edge): remove unused credentials management methods * feat(edge): associate a remote addr to tunnel credentials * style(edge): update Edge endpoint icon * feat(edge): support encrypted tunnel credentials * fix(edge): fix invalid pointer cast * feat(bolt): decode endpoints with jsoniter * feat(edge): persist reverse tunnel keyseed * refactor(edge): minor refactor * feat(edge): update chisel library usage * refactor(endpoint): use controller function * feat(api): database migration to DBVersion 19 * refactor(api): refactor AddSchedule function * refactor(schedules): remove comment * refactor(api): remove comment * refactor(api): remove comment * feat(api): tunnel manager now only manage Edge endpoints * refactor(api): clean-up and clarification of the Edge service * refactor(api): clean-up and clarification of the Edge service * fix(api): fix an issue with Edge agent snapshots * refactor(api): add missing comments * refactor(api): update constant description * style(home): remove loading text on error * feat(endpoint): remove 15s timeout for ping request * style(home): display information about associated Edge endpoints * feat(home): redirect to endpoint details on click on unassociated Edge endpoint * feat(settings): remove 60s Edge poll frequency option
5 years ago
"net/http"
"net/http/httptest"
"strconv"
"strings"
"time"
feat(edge): introduce support for Edge agent (#3031) * feat(edge): fix webconsole and agent deployment command * feat(edge): display agent features when connected to IoT endpoint * feat(edge): add -e CAP_HOST_MANAGEMENT=1 to agent command * feat(edge): add -v /:/host and --name portainer_agent_iot to agent command * style(endpoint-creation): refactor IoT agent to Edge agent * refactor(api): rename AgentIoTEnvironment to AgentEdgeEnvironment * refactor(api): rename AgentIoTEnvironment to AgentEdgeEnvironment * feat(endpoint-creation): update Edge agent deployment instructions * feat(edge): wip edge * feat(edge): refactor key creation * feat(edge): update deployment instructions * feat(home): update Edge agent endpoint item * feat(edge): support dynamic ports * feat(edge): support sleep/wake and snapshots * feat(edge): support offline mode * feat(edge): host job support for Edge endpoints * feat(edge): introduce STANDBY state * feat(edge): update Edge agent deployment command * feat(edge): introduce EDGE_ID support * feat(edge): update default inactivity interval to 5min * feat(edge): reload Edge schedules after restart * fix(edge): fix execution of endpoint job against an Edge endpoint * fix(edge): fix minor issues with scheduling UI/UX * feat(edge): introduce EdgeSchedule version management * feat(edge): switch back to REQUIRED state from ACTIVE on error * refactor(edge): remove comment * feat(edge): updated tunnel status management * feat(edge): fix flickering UI when accessing Edge endpoint from home view * feat(edge): remove STANDBY status * fix(edge): fix an issue with console and Swarm endpoint * fix(edge): fix an issue with stack deployment * fix(edge): reset timer when applying active status * feat(edge): add background ping for Edge endpoints * fix(edge): fix infinite loading loop after Edge endpoint connection failure * fix(home): fix an issue with merge * feat(api): remove SnapshotRaw from EndpointList response * feat(api): add pagination for EndpointList operation * feat(api): rename last_id query parameter to start * feat(api): implement filter for EndpointList operation * fix(edge): prevent a pointer issue after removing an active Edge endpoint * feat(home): front - endpoint backend pagination (#2990) * feat(home): endpoint pagination with backend * feat(api): remove default limit value * fix(endpoints): fix a minor issue with column span * fix(endpointgroup-create): fix an issue with endpoint group creation * feat(app): minor loading optimizations * refactor(api): small refactor of EndpointList operation * fix(home): fix minor loading text display issue * refactor(api): document bolt services functions * feat(home): minor optimization * fix(api): replace seek with index scanning for EndpointPaginated * fix(api): fix invalid starting index issue * fix(api): first implementation of working filter * fix(home): endpoints list keeps backend pagination when it needs to * fix(api): endpoint pagination doesn't drop the first item on pages >=2 anymore * fix(home): UI flickering on page/filter load/change * feat(auth): login spinner * feat(api): support searching in associated endpoint group data * refactor(api): remove unused API endpoint * refactor(api): remove comment * refactor(api): refactor proxy manager * feat(api): declare EndpointList params as optional * feat(api): support groupID filter on endpoints route * feat(api): add new API operations endpointGroupAddEndpoint and endpointGroupDeleteEndpoint * feat(edge): new icon for Edge agent endpoint * fix(edge): fix missing exec quick action * fix(edge): add loading indicator when connecting to Edge endpoint * feat(edge): disable service webhooks for Edge endpoints * feat(endpoints): backend pagination for endpoints view (#3004) * feat(edge): dynamic loading for stack migration feature * feat(edge): wordwrap edge key * feat(endpoint-groups): backend pagination support for create and edit * feat(endpoint-groups): debounce on filter for create/edit views * feat(endpoint-groups): filter assigned on create view * (endpoint-groups): unassigned endpoints edit view * refactor(endpoint-groups): code clean * feat(endpoint-groups): remove message for Unassigned group * refactor(websocket): minor refactor associated to Edge agent * feat(endpoint-group): enable backend pagination (#3017) * feat(api): support groupID filter on endpoints route * feat(api): add new API operations endpointGroupAddEndpoint and endpointGroupDeleteEndpoint * feat(endpoint-groups): backend pagination support for create and edit * feat(endpoint-groups): debounce on filter for create/edit views * feat(endpoint-groups): filter assigned on create view * (endpoint-groups): unassigned endpoints edit view * refactor(endpoint-groups): code clean * feat(endpoint-groups): remove message for Unassigned group * refactor(api): endpoint group endpoint association refactor * refactor(api): rename files and remove comments * refactor(api): remove usage of utils * refactor(api): optional parameters * Merge branch 'feat-endpoint-backend-pagination' into edge # Conflicts: # api/bolt/endpoint/endpoint.go # api/http/handler/endpointgroups/endpointgroup_update.go # api/http/handler/endpointgroups/handler.go # api/http/handler/endpoints/endpoint_list.go # app/portainer/services/api/endpointService.js * fix(api): fix default tunnel server credentials * feat(api): update endpointListOperation behavior and parameters * fix(api): fix interface declaration * feat(edge): support configurable Edge agent checkin interval * feat(edge): support dynamic tunnel credentials * feat(edge): update Edge agent deployment commands * style(edge): update Edge agent settings text * refactor(edge): remove unused credentials management methods * feat(edge): associate a remote addr to tunnel credentials * style(edge): update Edge endpoint icon * feat(edge): support encrypted tunnel credentials * fix(edge): fix invalid pointer cast * feat(bolt): decode endpoints with jsoniter * feat(edge): persist reverse tunnel keyseed * refactor(edge): minor refactor * feat(edge): update chisel library usage * refactor(endpoint): use controller function * feat(api): database migration to DBVersion 19 * refactor(api): refactor AddSchedule function * refactor(schedules): remove comment * refactor(api): remove comment * refactor(api): remove comment * feat(api): tunnel manager now only manage Edge endpoints * refactor(api): clean-up and clarification of the Edge service * refactor(api): clean-up and clarification of the Edge service * fix(api): fix an issue with Edge agent snapshots * refactor(api): add missing comments * refactor(api): update constant description * style(home): remove loading text on error * feat(endpoint): remove 15s timeout for ping request * style(home): display information about associated Edge endpoints * feat(home): redirect to endpoint details on click on unassociated Edge endpoint * feat(settings): remove 60s Edge poll frequency option
5 years ago
docs(api): document apis with swagger (#4678) * feat(api): introduce swagger * feat(api): anottate api * chore(api): tag endpoints * chore(api): remove tags * chore(api): add docs for oauth auth * chore(api): document create endpoint api * chore(api): document endpoint inspect and list * chore(api): document endpoint update and snapshots * docs(endpointgroups): document groups api * docs(auth): document auth api * chore(build): introduce a yarn script to build api docs * docs(api): document auth * docs(customtemplates): document customtemplates api * docs(tags): document api * docs(api): document the use of token * docs(dockerhub): document dockerhub api * docs(edgegroups): document edgegroups api * docs(edgejobs): document api * docs(edgestacks): doc api * docs(http/upload): add security * docs(api): document edge templates * docs(edge): document edge jobs * docs(endpointgroups): change description * docs(endpoints): document missing apis * docs(motd): doc api * docs(registries): doc api * docs(resourcecontrol): api doc * docs(role): add swagger docs * docs(settings): add swagger docs * docs(api/status): add swagger docs * docs(api/teammembership): add swagger docs * docs(api/teams): add swagger docs * docs(api/templates): add swagger docs * docs(api/users): add swagger docs * docs(api/webhooks): add swagger docs * docs(api/webscokets): add swagger docs * docs(api/stacks): swagger * docs(api): fix missing apis * docs(swagger): regen * chore(build): remove docs from build * docs(api): update tags * docs(api): document tags * docs(api): add description * docs(api): rename jwt token * docs(api): add info about types * docs(api): document types * docs(api): update request types annotation * docs(api): doc registry and resource control * chore(docs): add snippet * docs(api): add description to role * docs(api): add types for settings * docs(status): add types * style(swagger): remove documented code * docs(http/upload): update docs with types * docs(http/tags): add types * docs(api/custom_templates): add types * docs(api/teammembership): add types * docs(http/teams): add types * docs(http/stacks): add types * docs(edge): add types to edgestack * docs(http/teammembership): remove double returns * docs(api/user): add types * docs(http): fixes to make file built * chore(snippets): add scope to swagger snippet * chore(deps): install swag * chore(swagger): remove handler * docs(api): add description * docs(api): ignore docs folder * docs(api): add contributing guidelines * docs(api): cleanup handler * chore(deps): require swaggo * fix(auth): fix typo * fix(docs): make http ids pascal case * feat(edge): add ids to http handlers * fix(docs): add ids * fix(docs): show correct api version * chore(deps): remove swaggo dependency * chore(docs): add install script for swag
4 years ago
portainer "github.com/portainer/portainer/api"
"github.com/portainer/portainer/api/dataservices"
"github.com/portainer/portainer/api/internal/edge"
"github.com/portainer/portainer/api/internal/edge/cache"
httperror "github.com/portainer/portainer/pkg/libhttp/error"
"github.com/portainer/portainer/pkg/libhttp/request"
"github.com/portainer/portainer/pkg/libhttp/response"
"github.com/rs/zerolog/log"
feat(edge): introduce support for Edge agent (#3031) * feat(edge): fix webconsole and agent deployment command * feat(edge): display agent features when connected to IoT endpoint * feat(edge): add -e CAP_HOST_MANAGEMENT=1 to agent command * feat(edge): add -v /:/host and --name portainer_agent_iot to agent command * style(endpoint-creation): refactor IoT agent to Edge agent * refactor(api): rename AgentIoTEnvironment to AgentEdgeEnvironment * refactor(api): rename AgentIoTEnvironment to AgentEdgeEnvironment * feat(endpoint-creation): update Edge agent deployment instructions * feat(edge): wip edge * feat(edge): refactor key creation * feat(edge): update deployment instructions * feat(home): update Edge agent endpoint item * feat(edge): support dynamic ports * feat(edge): support sleep/wake and snapshots * feat(edge): support offline mode * feat(edge): host job support for Edge endpoints * feat(edge): introduce STANDBY state * feat(edge): update Edge agent deployment command * feat(edge): introduce EDGE_ID support * feat(edge): update default inactivity interval to 5min * feat(edge): reload Edge schedules after restart * fix(edge): fix execution of endpoint job against an Edge endpoint * fix(edge): fix minor issues with scheduling UI/UX * feat(edge): introduce EdgeSchedule version management * feat(edge): switch back to REQUIRED state from ACTIVE on error * refactor(edge): remove comment * feat(edge): updated tunnel status management * feat(edge): fix flickering UI when accessing Edge endpoint from home view * feat(edge): remove STANDBY status * fix(edge): fix an issue with console and Swarm endpoint * fix(edge): fix an issue with stack deployment * fix(edge): reset timer when applying active status * feat(edge): add background ping for Edge endpoints * fix(edge): fix infinite loading loop after Edge endpoint connection failure * fix(home): fix an issue with merge * feat(api): remove SnapshotRaw from EndpointList response * feat(api): add pagination for EndpointList operation * feat(api): rename last_id query parameter to start * feat(api): implement filter for EndpointList operation * fix(edge): prevent a pointer issue after removing an active Edge endpoint * feat(home): front - endpoint backend pagination (#2990) * feat(home): endpoint pagination with backend * feat(api): remove default limit value * fix(endpoints): fix a minor issue with column span * fix(endpointgroup-create): fix an issue with endpoint group creation * feat(app): minor loading optimizations * refactor(api): small refactor of EndpointList operation * fix(home): fix minor loading text display issue * refactor(api): document bolt services functions * feat(home): minor optimization * fix(api): replace seek with index scanning for EndpointPaginated * fix(api): fix invalid starting index issue * fix(api): first implementation of working filter * fix(home): endpoints list keeps backend pagination when it needs to * fix(api): endpoint pagination doesn't drop the first item on pages >=2 anymore * fix(home): UI flickering on page/filter load/change * feat(auth): login spinner * feat(api): support searching in associated endpoint group data * refactor(api): remove unused API endpoint * refactor(api): remove comment * refactor(api): refactor proxy manager * feat(api): declare EndpointList params as optional * feat(api): support groupID filter on endpoints route * feat(api): add new API operations endpointGroupAddEndpoint and endpointGroupDeleteEndpoint * feat(edge): new icon for Edge agent endpoint * fix(edge): fix missing exec quick action * fix(edge): add loading indicator when connecting to Edge endpoint * feat(edge): disable service webhooks for Edge endpoints * feat(endpoints): backend pagination for endpoints view (#3004) * feat(edge): dynamic loading for stack migration feature * feat(edge): wordwrap edge key * feat(endpoint-groups): backend pagination support for create and edit * feat(endpoint-groups): debounce on filter for create/edit views * feat(endpoint-groups): filter assigned on create view * (endpoint-groups): unassigned endpoints edit view * refactor(endpoint-groups): code clean * feat(endpoint-groups): remove message for Unassigned group * refactor(websocket): minor refactor associated to Edge agent * feat(endpoint-group): enable backend pagination (#3017) * feat(api): support groupID filter on endpoints route * feat(api): add new API operations endpointGroupAddEndpoint and endpointGroupDeleteEndpoint * feat(endpoint-groups): backend pagination support for create and edit * feat(endpoint-groups): debounce on filter for create/edit views * feat(endpoint-groups): filter assigned on create view * (endpoint-groups): unassigned endpoints edit view * refactor(endpoint-groups): code clean * feat(endpoint-groups): remove message for Unassigned group * refactor(api): endpoint group endpoint association refactor * refactor(api): rename files and remove comments * refactor(api): remove usage of utils * refactor(api): optional parameters * Merge branch 'feat-endpoint-backend-pagination' into edge # Conflicts: # api/bolt/endpoint/endpoint.go # api/http/handler/endpointgroups/endpointgroup_update.go # api/http/handler/endpointgroups/handler.go # api/http/handler/endpoints/endpoint_list.go # app/portainer/services/api/endpointService.js * fix(api): fix default tunnel server credentials * feat(api): update endpointListOperation behavior and parameters * fix(api): fix interface declaration * feat(edge): support configurable Edge agent checkin interval * feat(edge): support dynamic tunnel credentials * feat(edge): update Edge agent deployment commands * style(edge): update Edge agent settings text * refactor(edge): remove unused credentials management methods * feat(edge): associate a remote addr to tunnel credentials * style(edge): update Edge endpoint icon * feat(edge): support encrypted tunnel credentials * fix(edge): fix invalid pointer cast * feat(bolt): decode endpoints with jsoniter * feat(edge): persist reverse tunnel keyseed * refactor(edge): minor refactor * feat(edge): update chisel library usage * refactor(endpoint): use controller function * feat(api): database migration to DBVersion 19 * refactor(api): refactor AddSchedule function * refactor(schedules): remove comment * refactor(api): remove comment * refactor(api): remove comment * feat(api): tunnel manager now only manage Edge endpoints * refactor(api): clean-up and clarification of the Edge service * refactor(api): clean-up and clarification of the Edge service * fix(api): fix an issue with Edge agent snapshots * refactor(api): add missing comments * refactor(api): update constant description * style(home): remove loading text on error * feat(endpoint): remove 15s timeout for ping request * style(home): display information about associated Edge endpoints * feat(home): redirect to endpoint details on click on unassociated Edge endpoint * feat(settings): remove 60s Edge poll frequency option
5 years ago
)
feat(edge-compute): add support for Edge stacks (#3827) * feat(api): introduce Edge group API (#3639) * feat(edge-groups): add object definition and service definition * feat(edge-groups): implement bolt layer * feat(edge-groups): bind service to server * feat(edge-group): add edge-group create http handler * feat(edge-groups): add list method to edge group handler * feat(edge-group): add inspect http handler * feat(edge-groups): add delete edge-group handler * feat(edge-groups): add update group handler * style(db): order by alphabetical order * fix(edge-groups): rewrite http error messages Co-Authored-By: Anthony Lapenna <anthony.lapenna@portainer.io> * fix(main): order by alphabetical order * refactor(edge-group): relocate fetch group * fix(edge-group): reset tagids/endpoints if dynamic * refactor(server): order by alphabetical order * refactor(server): order by alphabetical order Co-authored-by: Anthony Lapenna <anthony.lapenna@portainer.io> * Introduce a new setting to enable Edge compute features (#3654) * feat(edge-compute): add edge compute setting * feat(edge-compute): add edge compute group to sidebar * fix(settings): rename settings form group * fix(settings): align form control * Edge group associated endpoints (#3659) * chore(version): bump version number * chore(version): bump version number * feat(endpoints): filter by endpoint type (#3646) * refactor(tags): migrate tags to have association objects * refactor(tags): refactor tag management (#3628) * refactor(tags): replace tags with tag ids * refactor(tags): revert tags to be strings and add tagids * refactor(tags): enable search by tag in home view * refactor(tags): show endpoint tags * refactor(endpoints): expect tagIds on create payload * refactor(endpoints): expect tagIds on update payload * refactor(endpoints): replace TagIds to TagIDs * refactor(endpoints): set endpoint group to get TagIDs * refactor(endpoints): refactor tag-selector to receive tag-ids * refactor(endpoints): show tags in multi-endpoint-selector * chore(tags): revert reformat * refactor(endpoints): remove unneeded bind * refactor(endpoints): change param tags to tagids in endpoint create * refactor(endpoints): remove console.log * refactor(tags): remove deleted tag from endpoint and endpoint group * fix(endpoints): show loading label while loading tags * chore(go): remove obsolete import labels * chore(db): add db version comment * fix(db): add tag service to migrator * refactor(db): add error checks in migrator * style(db): sort props in alphabetical order * style(tags): fix typo Co-Authored-By: Anthony Lapenna <anthony.lapenna@portainer.io> * refactor(endpoints): replace tagsMap with tag string representation * refactor(tags): rewrite tag delete to be more readable * refactor(home): rearange code to match former style * refactor(tags): guard against missing model in tag-selector * refactor(tags): rename vars in tag_delete * refactor(tags): allow any authenticated user to fetch tag list * refactor(endpoints): replace controller function with class * refactor(endpoints): replace function with helper * refactor(endpoints): replace controller with class * refactor(tags): revert tags-selector to use 1 way bindings * refactor(endpoints): load empty tag array instead of nil * refactor(endpoints): revert default tag ids * refactor(endpoints): use function in place * refactor(tags): use lodash * style(tags): use parens in arrow functions * fix(tags): remove tag from tag model Co-authored-by: Anthony Lapenna <anthony.lapenna@portainer.io> * refactor(tags): create tag association when creating tag * refactor(tags): delete tag association when deleting tag * refactor(db): handle error in tag association create * feat(endpoint-group): update tag assoc when creating endpoint group * feat(endpoint-group): update tag association when updating group * feat(endpoint-groups): remove group from tag associations * feat(endpoints): associate endpoint with tag on create * feat(endpoints): edit tag association when updating endpoint * fix(tags): fix merge problems * refactor(tags): remove tag association resource * fix(db): use regular tags map * style(tags): reorder props and imports * refactor(endpoint-groups): replace tag-association with tag * feat(edge-group): get associated endpoints when fetching * refactor(tags): refactor algo to update endpoint and group tags * refactor(edge-group): rename variable * refactor(tags): move calc of tags to remove to global function * fix(tags): update tag after adding association Co-authored-by: Anthony Lapenna <lapenna.anthony@gmail.com> Co-authored-by: Anthony Lapenna <anthony.lapenna@portainer.io> * fix(edge-groups): associate groups only with edge endpoints (#3667) * fix(edge-groups): check endpoint type when adding to edge-group * fix(edge-groups): return only edge endpoints for dynamic groups * fix(edge-compute): load edge compute setting on public setting (#3665) * Edge group list (#3644) * feat(edge-groups): add edge module * feat(edge-groups): add edge-group service * feat(edge-group): add groups list view * feat(edge-groups): add link to groups in the sidebar * feat(edge-group): show endpoints count and group type * feat(edge-group): enable removal of edge groups * refactor(edge-groups): replace datatable controller with class * refactor(edge-groups): replace function with class * fix(edge-groups): sort items by endpoints count and group type * refactor(edge-groups): use generic datatable-header component * feat(app): add trace for ui router * fix(edge-compute): add ng injection to onEnter guard * fix(edge-compute): add ng injection to onEnter guard * style(edge-compute): remove space * refactor(edge-compute): import angular * fix(app): remove ui router trace * refactor(product): revert app.js * fix(edge-compute): remove admin guard from edge routes * fix(edge-groups): change label of empty datatable Co-Authored-By: Anthony Lapenna <anthony.lapenna@portainer.io> * refactor(edge-groups): rename service * fix(edge-groups): replace icon in sidebar Co-Authored-By: Anthony Lapenna <anthony.lapenna@portainer.io> * refactor(edge-groups): remove datatable controller * refactor(edge-groups): move datatable icon to binding * refactor(edge-groups): use vanilla datatable header * refactor(datatable): remove datatable header Co-authored-by: Anthony Lapenna <anthony.lapenna@portainer.io> * refactor(edge): rename edge group to Edge group * feat(edge-groups): edge group creation view (#3671) * feat(edge-groups): add create group view * feat(edge-groups): allow to choose group type * feat(edge-groups): implement create service handler * feat(edge-group): filter by edge endpoints * refactor(edge-groups): rename to camel case * refactor(edge-groups): replace controller with class * feat(endpoints): filter endpoints by type * refactor(edge-groups): remove comments and unneccesary async keyword * refactor(edge-group): use $async service * fix(edge-groups): replace view title Co-Authored-By: Anthony Lapenna <anthony.lapenna@portainer.io> * fix(edge-groups): change icon Co-Authored-By: Anthony Lapenna <anthony.lapenna@portainer.io> * fix(edge-groups): change icon Co-Authored-By: Anthony Lapenna <anthony.lapenna@portainer.io> * refactor(edge-groups): remove obsolete function * feat(edge-groups): add empty list messages * feat(edge-group): add description to group types * refactor(edge-groups): add finally block * feat(endpoints): search server in multi-endpoint-selector Co-authored-by: Anthony Lapenna <anthony.lapenna@portainer.io> * feat(edge-group) edit view (#3672) * feat(edge-groups): add edit group view * refactor(edge-group): replace edit controller with class * refactor(edge-groups): remove async keyword * refactor(edge-groups): use $async service * refactor(edge-group): remove unnecessary functions * fix(endpoints): group by groups in endpoint-selector * feat(edge-groups): minor UI update * fix(edge-groups): provide defaults for edge group (#3682) * feat(edge-stacks): add basic views and sidebar link (#3689) * feat(edge-stacks): add mock routes * feat(edge-stacks): add link to stacks on sidebar * feat(edge-stacks): add edge stacks view * feat(edge-stacks): add create view * feat(edge-stacks): add edit view * fix(edge-stacks): use class in controller * feat(edge-stacks): add edge-stacks api (#3688) * feat(edge-stack): add edge stack types * feat(edge-stacks): add edge stack service interface * feat(edge-stacks): implement store * feat(edge-stacks): bind service to datastore * feat(edge-stacks): bind service to server * feat(edge-stack): create basic api * feat(edge-stack): create stack api * feat(edge-stacks): update api * refacotor(edge-stack): rename files * feat(edge-stack): update endpoint status * style(edge-stacks): remove comments * feat(edge-stacks): use edge stacks folder for files * fix(edge-stacks): replace bucket name Co-Authored-By: Anthony Lapenna <anthony.lapenna@portainer.io> * fix(edge-stacks): replace unmarshal function Co-Authored-By: Anthony Lapenna <anthony.lapenna@portainer.io> * fix(edge-stacks): replace edge stacks path Co-Authored-By: Anthony Lapenna <anthony.lapenna@portainer.io> Co-authored-by: Anthony Lapenna <anthony.lapenna@portainer.io> * chore(git): merge develop to edge compute (#3692) * feat(support): make support type dynamic (#3621) * chore(version): bump version number * chore(version): bump version number * feat(endpoints): filter by endpoint type (#3646) * chore(assets): double UI image resolutions for HiDPI displays (#3648) Fixes #3069 Prevents users seeing blurry logos and other images when using a hidpi display (like scaled 4k, or a Retina display). These images have been recreated manually with 2x the original resolution but should resemble the originals as much as possible. They have also been run through pngcrush for compression. * fix(services): enforce minimum replica count of 0 (#3653) * fix(services): enforce minimum replica count of 0 Fixes #3652 Prevents replica count from being set below zero and causing an error. * fix(services): enforce replica count is an integer Prevents users entering decimals in the replica count * refactor(tags): refactor tag management (#3628) * refactor(tags): replace tags with tag ids * refactor(tags): revert tags to be strings and add tagids * refactor(tags): enable search by tag in home view * refactor(tags): show endpoint tags * refactor(endpoints): expect tagIds on create payload * refactor(endpoints): expect tagIds on update payload * refactor(endpoints): replace TagIds to TagIDs * refactor(endpoints): set endpoint group to get TagIDs * refactor(endpoints): refactor tag-selector to receive tag-ids * refactor(endpoints): show tags in multi-endpoint-selector * chore(tags): revert reformat * refactor(endpoints): remove unneeded bind * refactor(endpoints): change param tags to tagids in endpoint create * refactor(endpoints): remove console.log * refactor(tags): remove deleted tag from endpoint and endpoint group * fix(endpoints): show loading label while loading tags * chore(go): remove obsolete import labels * chore(db): add db version comment * fix(db): add tag service to migrator * refactor(db): add error checks in migrator * style(db): sort props in alphabetical order * style(tags): fix typo Co-Authored-By: Anthony Lapenna <anthony.lapenna@portainer.io> * refactor(endpoints): replace tagsMap with tag string representation * refactor(tags): rewrite tag delete to be more readable * refactor(home): rearange code to match former style * refactor(tags): guard against missing model in tag-selector * refactor(tags): rename vars in tag_delete * refactor(tags): allow any authenticated user to fetch tag list * refactor(endpoints): replace controller function with class * refactor(endpoints): replace function with helper * refactor(endpoints): replace controller with class * refactor(tags): revert tags-selector to use 1 way bindings * refactor(endpoints): load empty tag array instead of nil * refactor(endpoints): revert default tag ids * refactor(endpoints): use function in place * refactor(tags): use lodash * style(tags): use parens in arrow functions * fix(tags): remove tag from tag model Co-authored-by: Anthony Lapenna <anthony.lapenna@portainer.io> * chore(yarn): change start:client to start webpack dev server (#3595) * chore(yarn): change start:client to start webpack dev server * Update package.json Co-authored-by: Anthony Lapenna <anthony.lapenna@portainer.io> * create tag from tag selector (#3640) * feat(tags): add button to save tag when doesn't exist * feat(endpoints): allow the creating of tags in endpoint edit * feat(groups): allow user to create tags in create group * feat(groups): allow user to create tags in edit group * feat(endpoint): allow user to create tags from endpoint create * feat(tags): allow the creation of a new tag from dropdown * feat(tag): replace "add" with "create" * feat(tags): show tags input when not tags * feat(tags): hide create message when not allowed * refactor(tags): replace component controller with class * refactor(tags): replace native methods with lodash * refactor(tags): remove unused onChangeTags function * refactor(tags): remove on-change binding * style(tags): remove white space * refactor(endpoint-groups): move controller to separate file * fix(groups): allow admin to create tag in group form * refactor(endpoints): wrap async function with try catch and $async * style(tags): wrap arrow function args with parenthesis * refactor(endpoints): return $async functions * refactor(tags): throw error in the format Notification expects * chore(yarn): add start:client script back (#3691) * feat(endpoints): filter by ids and/or tag ids (#3690) * feat(endpoints): add filter by tagIds * refactor(endpoints): change endpoints service to query by tagIds * fix(endpoints): filter by tags * feat(endpoints): filter by endpoint groups tags * feat(endpoints): filter by ids Co-authored-by: itsconquest <william.conquest@portainer.io> Co-authored-by: Anthony Lapenna <lapenna.anthony@gmail.com> Co-authored-by: Ben Brooks <ben@bbrks.me> Co-authored-by: Anthony Lapenna <anthony.lapenna@portainer.io> * Chore merge develop to edge compute (#3702) * feat(support): make support type dynamic (#3621) * chore(version): bump version number * chore(version): bump version number * feat(endpoints): filter by endpoint type (#3646) * chore(assets): double UI image resolutions for HiDPI displays (#3648) Fixes #3069 Prevents users seeing blurry logos and other images when using a hidpi display (like scaled 4k, or a Retina display). These images have been recreated manually with 2x the original resolution but should resemble the originals as much as possible. They have also been run through pngcrush for compression. * fix(services): enforce minimum replica count of 0 (#3653) * fix(services): enforce minimum replica count of 0 Fixes #3652 Prevents replica count from being set below zero and causing an error. * fix(services): enforce replica count is an integer Prevents users entering decimals in the replica count * refactor(tags): refactor tag management (#3628) * refactor(tags): replace tags with tag ids * refactor(tags): revert tags to be strings and add tagids * refactor(tags): enable search by tag in home view * refactor(tags): show endpoint tags * refactor(endpoints): expect tagIds on create payload * refactor(endpoints): expect tagIds on update payload * refactor(endpoints): replace TagIds to TagIDs * refactor(endpoints): set endpoint group to get TagIDs * refactor(endpoints): refactor tag-selector to receive tag-ids * refactor(endpoints): show tags in multi-endpoint-selector * chore(tags): revert reformat * refactor(endpoints): remove unneeded bind * refactor(endpoints): change param tags to tagids in endpoint create * refactor(endpoints): remove console.log * refactor(tags): remove deleted tag from endpoint and endpoint group * fix(endpoints): show loading label while loading tags * chore(go): remove obsolete import labels * chore(db): add db version comment * fix(db): add tag service to migrator * refactor(db): add error checks in migrator * style(db): sort props in alphabetical order * style(tags): fix typo Co-Authored-By: Anthony Lapenna <anthony.lapenna@portainer.io> * refactor(endpoints): replace tagsMap with tag string representation * refactor(tags): rewrite tag delete to be more readable * refactor(home): rearange code to match former style * refactor(tags): guard against missing model in tag-selector * refactor(tags): rename vars in tag_delete * refactor(tags): allow any authenticated user to fetch tag list * refactor(endpoints): replace controller function with class * refactor(endpoints): replace function with helper * refactor(endpoints): replace controller with class * refactor(tags): revert tags-selector to use 1 way bindings * refactor(endpoints): load empty tag array instead of nil * refactor(endpoints): revert default tag ids * refactor(endpoints): use function in place * refactor(tags): use lodash * style(tags): use parens in arrow functions * fix(tags): remove tag from tag model Co-authored-by: Anthony Lapenna <anthony.lapenna@portainer.io> * chore(yarn): change start:client to start webpack dev server (#3595) * chore(yarn): change start:client to start webpack dev server * Update package.json Co-authored-by: Anthony Lapenna <anthony.lapenna@portainer.io> * create tag from tag selector (#3640) * feat(tags): add button to save tag when doesn't exist * feat(endpoints): allow the creating of tags in endpoint edit * feat(groups): allow user to create tags in create group * feat(groups): allow user to create tags in edit group * feat(endpoint): allow user to create tags from endpoint create * feat(tags): allow the creation of a new tag from dropdown * feat(tag): replace "add" with "create" * feat(tags): show tags input when not tags * feat(tags): hide create message when not allowed * refactor(tags): replace component controller with class * refactor(tags): replace native methods with lodash * refactor(tags): remove unused onChangeTags function * refactor(tags): remove on-change binding * style(tags): remove white space * refactor(endpoint-groups): move controller to separate file * fix(groups): allow admin to create tag in group form * refactor(endpoints): wrap async function with try catch and $async * style(tags): wrap arrow function args with parenthesis * refactor(endpoints): return $async functions * refactor(tags): throw error in the format Notification expects * chore(yarn): add start:client script back (#3691) * feat(endpoints): filter by ids and/or tag ids (#3690) * feat(endpoints): add filter by tagIds * refactor(endpoints): change endpoints service to query by tagIds * fix(endpoints): filter by tags * feat(endpoints): filter by endpoint groups tags * feat(endpoints): filter by ids * refactor(project): sort portainer types and interface definitions (#3694) * refactor(portainer): sort types * style(portainer): add comment about role service * refactor(portainer): sort interface types * refactor(portainer): sort enums * Update README.md * Update README.md * Update README.md * chore(project): add prettier for code format (#3645) * chore(project): install prettier and lint-staged * chore(project): apply prettier to html too * chore(project): git ignore eslintcache * chore(project): add a comment about format script * chore(prettier): update printWidth * chore(prettier): remove useTabs option * chore(prettier): add HTML validation * refactor(prettier): fix closing tags * feat(prettier): define angular parser for html templates * style(prettier): run prettier on codebase Co-authored-by: Anthony Lapenna <lapenna.anthony@gmail.com> * chore(prettier): run format on client codebase Co-authored-by: itsconquest <william.conquest@portainer.io> Co-authored-by: Anthony Lapenna <lapenna.anthony@gmail.com> Co-authored-by: Ben Brooks <ben@bbrks.me> Co-authored-by: Anthony Lapenna <anthony.lapenna@portainer.io> Co-authored-by: Neil Cresswell <neil@cresswell.net.nz> * feat(edge-stacks): create basic edge stack service (#3704) Co-authored-by: Anthony Lapenna <anthony.lapenna@portainer.io> * feat(edge-groups): Provide a switch to use AND or OR for tags (#3695) * feat(edge-groups): add switch to form * feat(project): add property to EdgeGroup * feat(edge-groups): save mustHaveAllTags * feat(edge-groups): fetch associated endpoints (AND and OR) * feat(edge-groups): add AND selector * feat(edge-groups): default to AND * fix(edge-groups): rewrite selector options Co-Authored-By: Anthony Lapenna <anthony.lapenna@portainer.io> * refactor(endpoints): move margin to schedule form * fix(edge-groups): move the selector to top of group * refactor(edge-groups): replace partialMatch property Co-authored-by: Anthony Lapenna <anthony.lapenna@portainer.io> * feat(edge-stacks): add Edge stack creation view (#3705) * feat(edge-stacks): basic creation view * feat(edge-stacks): add group selector * feat(edge-stack): create edge stack * fix(code-editor): apply digest cycle after editor is changed * style(project): reformat constants file * feat(edge-stacks): add a note about missing edge groups * fix(edge-stacks): add groups when creating stack from file * feat(edge-groups): add associated endpoints table (#3710) * feat(edge-groups): load associated endpoints * feat(endpoints): add option to filter endpoint by partial match tags * feat(edge-groups): query endpoints by PartialMatch * feat(edge-groups): reload endpoints when form changes * feat(edge-groups): remove columns * feat(edge-group): remove url column * refactor(edge-group): remove props * feat(edge-stacks): add list view (#3713) * feat(edge-stacks): basic datatable * feat(edge-stacks): remove stack * refactor(edge-stacks): convert to class * refactor(edge-stacks): replace id with stackId * feat(edge-stacks) edit edge stack view (#3716) * feat(edge-stack): load file content * feat(edge-stack): edit view * feat(edge-stack): enable update stack * refactor(edge-stacks): move form to component * feat(edge-stacks): add endpoints status * feat(edge-stacks): minor UI update Co-authored-by: Anthony Lapenna <lapenna.anthony@gmail.com> * feat(edge-groups) prevent deletion of edge group used by an edge stack (#3722) * feat(edge-groups): show if group belonges to edge stack * feat(edge-group): protect deletion of used edge group * feat(edge-groups): diable selection of used group * feat(edge-groups): add inuse tag (#3739) * feat(edge-groups): add inuse tag * Update app/edge/components/groups-datatable/groupsDatatable.html Co-authored-by: Anthony Lapenna <anthony.lapenna@portainer.io> * feat(edge-stack): update stack version when stack file is changed (#3746) * feat(edge-stack): update version when stack file is changed * refactor(edge-stacks): move update of version to clientside * feat(edge-groups): replace Edge group endpoint selector (#3738) * feat(edge-groups): replace selector * feat(edge-group): add selector in edit form * feat(edge-groups): show tags in endpoint selector * feat(edge-groups): show the endpoint group name * fix(edge-group): remove element from associated endpoints * feat(edge-groups): add group column * feat(edge-groups): move endpoints to other column * fix(groups): disable sort * refactor(endpoints): toggle backend pagination as a property * fix(endpoints): show group name in group-association-table * feat(endpoints): truncate table columns * fix(endpoints): update group association table colspan * fix(endpoint-groups): show dash when no tags Co-authored-by: Anthony Lapenna <lapenna.anthony@gmail.com> * feat(edge-stacks): add api for edge to query stack config (#3748) * refactor(http): move edge validation to bouncer * feat(edge-stacks): add api for edge to query stack config * style(edge-stack): remove parentheses * Update api/http/security/bouncer.go * refactor(edge-stacks): move config inspect to endpoints handler * refactor(endpoints): move stack inspect to edge handler * style(security): fix typo Co-Authored-By: Anthony Lapenna <anthony.lapenna@portainer.io> * refactor(endpoints): rename file Co-authored-by: Anthony Lapenna <anthony.lapenna@portainer.io> * feat(edge-groups): add dynamic group endpoints table (#3780) * fix(edge-stacks): update version when updating stack files (#3778) * feat(edgestacks): change status permission to edge enpoints * feat(edge-compute): add stack info to edge status inspect (#3764) * feat(edge-compute): create helper functions * feat(endpoints): add relation object and service * feat(db): create endpoint relation migration * feat(endpoints): create relation when creating endpoint * feat(endpoints): update relation when updating endpoint * feat(endpoints): delete relation when deleting endpoint * feat(endpoint): add stack status to endpoint_status * feat(edge-stacks): connect new edge stack to endpoint * refactor(edgestack): return errors.New * refactor(edgestacks): return error * refactor(edgegroup): endpoint can be related only if edge endpoint * feat(endpoints): update relation only when tags or groups were changd * refactor(tags): change tags functions to set functions * refactor(edgestack): return a list of endpoints for a list of edgegroups * feat(edgestacks): update relation when updating stack * feat(edgestacks): remove relations when deleting edge stack * feat(edgegroup): update related endpoints * feat(endpoint-group): update endpoints relations on create * feat(endpointgroup): add relatd stacks to endpoint when added to group * feat(endpoint-groups): update relation when group is changed * feat(endpointgroup): when deleting group, update its endpoints relations * feat(tags): update related endpoints when deleting tag * refactor(edge-compute): use pointers * refactor(endpointgroup): handle unassociated endpoint * fix(edgestack): show correct stack status * fix(endpoint): remove deleted endpoint from related tags * feat(edge-stacks): change acknowledged status color to blue (#3810) * feat(edge-compute): provide stack name to edge endpoint (#3809) * feat(edge-groups): when no tags selected show empty list of endpoints (#3811) * feat(edge-groups): when no tags selected show empty list of endpoints * fix(edge-group): change empty associated endpoint text * fix(edge-compute): add missing relations updates (#3817) * fix(endpoint): remove deleted endpoint from edge group * fix(tags): remove deleted tag from edge group * fix(endpoint): remove deleted endpoint from edge stack * fix(edge-groups): remove clearing of edgeGroup fields * fix(edge-groups): show dynamic edge groups without tags * fix(edge-compute): use sequential delete in resources (#3818) * fix(endpoints): delete endpoints on by one * fix(tags): remove tags one by one * fix(groups): remove endpoint groups one by one * fix(edge-stacks): remove stack one by one * fix(edge-groups): remove edge group one by one * fix(edge-stacks): add link to root in breadcrumbs * style(edge): add empty line after errors * refactor(tags): remove old function * refactor(endpoints): revert changes to multi-endpoint-selector * feat(edge-stacks): support Edge stack templates (#3812) * feat(edge-compute): fetch templates from url * feat(edge-stacks): fetch edge templates * feat(edge-stacks): choose template and save * feat(edge-stacks): add placeholder to templates select * feat(edge-templates): show info * fix(edge-stacks): fix typo * feat(edge-templates): replace template url * feat(edge-compute): use custom url if available * fix(edge-stacks): show error message when failing * feat(edge-compute): show description in template * feat(edge-templates): change access to route * style(edge-compute): change EdgeTemplatesURL description Co-authored-by: Anthony Lapenna <anthony.lapenna@portainer.io> Co-authored-by: Anthony Lapenna <anthony.lapenna@portainer.io> Co-authored-by: Anthony Lapenna <anthony.lapenna@portainer.io> Co-authored-by: Anthony Lapenna <lapenna.anthony@gmail.com> Co-authored-by: itsconquest <william.conquest@portainer.io> Co-authored-by: Ben Brooks <ben@bbrks.me> Co-authored-by: Neil Cresswell <neil@cresswell.net.nz>
5 years ago
type stackStatusResponse struct {
docs(api): document apis with swagger (#4678) * feat(api): introduce swagger * feat(api): anottate api * chore(api): tag endpoints * chore(api): remove tags * chore(api): add docs for oauth auth * chore(api): document create endpoint api * chore(api): document endpoint inspect and list * chore(api): document endpoint update and snapshots * docs(endpointgroups): document groups api * docs(auth): document auth api * chore(build): introduce a yarn script to build api docs * docs(api): document auth * docs(customtemplates): document customtemplates api * docs(tags): document api * docs(api): document the use of token * docs(dockerhub): document dockerhub api * docs(edgegroups): document edgegroups api * docs(edgejobs): document api * docs(edgestacks): doc api * docs(http/upload): add security * docs(api): document edge templates * docs(edge): document edge jobs * docs(endpointgroups): change description * docs(endpoints): document missing apis * docs(motd): doc api * docs(registries): doc api * docs(resourcecontrol): api doc * docs(role): add swagger docs * docs(settings): add swagger docs * docs(api/status): add swagger docs * docs(api/teammembership): add swagger docs * docs(api/teams): add swagger docs * docs(api/templates): add swagger docs * docs(api/users): add swagger docs * docs(api/webhooks): add swagger docs * docs(api/webscokets): add swagger docs * docs(api/stacks): swagger * docs(api): fix missing apis * docs(swagger): regen * chore(build): remove docs from build * docs(api): update tags * docs(api): document tags * docs(api): add description * docs(api): rename jwt token * docs(api): add info about types * docs(api): document types * docs(api): update request types annotation * docs(api): doc registry and resource control * chore(docs): add snippet * docs(api): add description to role * docs(api): add types for settings * docs(status): add types * style(swagger): remove documented code * docs(http/upload): update docs with types * docs(http/tags): add types * docs(api/custom_templates): add types * docs(api/teammembership): add types * docs(http/teams): add types * docs(http/stacks): add types * docs(edge): add types to edgestack * docs(http/teammembership): remove double returns * docs(api/user): add types * docs(http): fixes to make file built * chore(snippets): add scope to swagger snippet * chore(deps): install swag * chore(swagger): remove handler * docs(api): add description * docs(api): ignore docs folder * docs(api): add contributing guidelines * docs(api): cleanup handler * chore(deps): require swaggo * fix(auth): fix typo * fix(docs): make http ids pascal case * feat(edge): add ids to http handlers * fix(docs): add ids * fix(docs): show correct api version * chore(deps): remove swaggo dependency * chore(docs): add install script for swag
4 years ago
// EdgeStack Identifier
ID portainer.EdgeStackID `example:"1"`
// Version of this stack
Version int `example:"3"`
feat(edge-compute): add support for Edge stacks (#3827) * feat(api): introduce Edge group API (#3639) * feat(edge-groups): add object definition and service definition * feat(edge-groups): implement bolt layer * feat(edge-groups): bind service to server * feat(edge-group): add edge-group create http handler * feat(edge-groups): add list method to edge group handler * feat(edge-group): add inspect http handler * feat(edge-groups): add delete edge-group handler * feat(edge-groups): add update group handler * style(db): order by alphabetical order * fix(edge-groups): rewrite http error messages Co-Authored-By: Anthony Lapenna <anthony.lapenna@portainer.io> * fix(main): order by alphabetical order * refactor(edge-group): relocate fetch group * fix(edge-group): reset tagids/endpoints if dynamic * refactor(server): order by alphabetical order * refactor(server): order by alphabetical order Co-authored-by: Anthony Lapenna <anthony.lapenna@portainer.io> * Introduce a new setting to enable Edge compute features (#3654) * feat(edge-compute): add edge compute setting * feat(edge-compute): add edge compute group to sidebar * fix(settings): rename settings form group * fix(settings): align form control * Edge group associated endpoints (#3659) * chore(version): bump version number * chore(version): bump version number * feat(endpoints): filter by endpoint type (#3646) * refactor(tags): migrate tags to have association objects * refactor(tags): refactor tag management (#3628) * refactor(tags): replace tags with tag ids * refactor(tags): revert tags to be strings and add tagids * refactor(tags): enable search by tag in home view * refactor(tags): show endpoint tags * refactor(endpoints): expect tagIds on create payload * refactor(endpoints): expect tagIds on update payload * refactor(endpoints): replace TagIds to TagIDs * refactor(endpoints): set endpoint group to get TagIDs * refactor(endpoints): refactor tag-selector to receive tag-ids * refactor(endpoints): show tags in multi-endpoint-selector * chore(tags): revert reformat * refactor(endpoints): remove unneeded bind * refactor(endpoints): change param tags to tagids in endpoint create * refactor(endpoints): remove console.log * refactor(tags): remove deleted tag from endpoint and endpoint group * fix(endpoints): show loading label while loading tags * chore(go): remove obsolete import labels * chore(db): add db version comment * fix(db): add tag service to migrator * refactor(db): add error checks in migrator * style(db): sort props in alphabetical order * style(tags): fix typo Co-Authored-By: Anthony Lapenna <anthony.lapenna@portainer.io> * refactor(endpoints): replace tagsMap with tag string representation * refactor(tags): rewrite tag delete to be more readable * refactor(home): rearange code to match former style * refactor(tags): guard against missing model in tag-selector * refactor(tags): rename vars in tag_delete * refactor(tags): allow any authenticated user to fetch tag list * refactor(endpoints): replace controller function with class * refactor(endpoints): replace function with helper * refactor(endpoints): replace controller with class * refactor(tags): revert tags-selector to use 1 way bindings * refactor(endpoints): load empty tag array instead of nil * refactor(endpoints): revert default tag ids * refactor(endpoints): use function in place * refactor(tags): use lodash * style(tags): use parens in arrow functions * fix(tags): remove tag from tag model Co-authored-by: Anthony Lapenna <anthony.lapenna@portainer.io> * refactor(tags): create tag association when creating tag * refactor(tags): delete tag association when deleting tag * refactor(db): handle error in tag association create * feat(endpoint-group): update tag assoc when creating endpoint group * feat(endpoint-group): update tag association when updating group * feat(endpoint-groups): remove group from tag associations * feat(endpoints): associate endpoint with tag on create * feat(endpoints): edit tag association when updating endpoint * fix(tags): fix merge problems * refactor(tags): remove tag association resource * fix(db): use regular tags map * style(tags): reorder props and imports * refactor(endpoint-groups): replace tag-association with tag * feat(edge-group): get associated endpoints when fetching * refactor(tags): refactor algo to update endpoint and group tags * refactor(edge-group): rename variable * refactor(tags): move calc of tags to remove to global function * fix(tags): update tag after adding association Co-authored-by: Anthony Lapenna <lapenna.anthony@gmail.com> Co-authored-by: Anthony Lapenna <anthony.lapenna@portainer.io> * fix(edge-groups): associate groups only with edge endpoints (#3667) * fix(edge-groups): check endpoint type when adding to edge-group * fix(edge-groups): return only edge endpoints for dynamic groups * fix(edge-compute): load edge compute setting on public setting (#3665) * Edge group list (#3644) * feat(edge-groups): add edge module * feat(edge-groups): add edge-group service * feat(edge-group): add groups list view * feat(edge-groups): add link to groups in the sidebar * feat(edge-group): show endpoints count and group type * feat(edge-group): enable removal of edge groups * refactor(edge-groups): replace datatable controller with class * refactor(edge-groups): replace function with class * fix(edge-groups): sort items by endpoints count and group type * refactor(edge-groups): use generic datatable-header component * feat(app): add trace for ui router * fix(edge-compute): add ng injection to onEnter guard * fix(edge-compute): add ng injection to onEnter guard * style(edge-compute): remove space * refactor(edge-compute): import angular * fix(app): remove ui router trace * refactor(product): revert app.js * fix(edge-compute): remove admin guard from edge routes * fix(edge-groups): change label of empty datatable Co-Authored-By: Anthony Lapenna <anthony.lapenna@portainer.io> * refactor(edge-groups): rename service * fix(edge-groups): replace icon in sidebar Co-Authored-By: Anthony Lapenna <anthony.lapenna@portainer.io> * refactor(edge-groups): remove datatable controller * refactor(edge-groups): move datatable icon to binding * refactor(edge-groups): use vanilla datatable header * refactor(datatable): remove datatable header Co-authored-by: Anthony Lapenna <anthony.lapenna@portainer.io> * refactor(edge): rename edge group to Edge group * feat(edge-groups): edge group creation view (#3671) * feat(edge-groups): add create group view * feat(edge-groups): allow to choose group type * feat(edge-groups): implement create service handler * feat(edge-group): filter by edge endpoints * refactor(edge-groups): rename to camel case * refactor(edge-groups): replace controller with class * feat(endpoints): filter endpoints by type * refactor(edge-groups): remove comments and unneccesary async keyword * refactor(edge-group): use $async service * fix(edge-groups): replace view title Co-Authored-By: Anthony Lapenna <anthony.lapenna@portainer.io> * fix(edge-groups): change icon Co-Authored-By: Anthony Lapenna <anthony.lapenna@portainer.io> * fix(edge-groups): change icon Co-Authored-By: Anthony Lapenna <anthony.lapenna@portainer.io> * refactor(edge-groups): remove obsolete function * feat(edge-groups): add empty list messages * feat(edge-group): add description to group types * refactor(edge-groups): add finally block * feat(endpoints): search server in multi-endpoint-selector Co-authored-by: Anthony Lapenna <anthony.lapenna@portainer.io> * feat(edge-group) edit view (#3672) * feat(edge-groups): add edit group view * refactor(edge-group): replace edit controller with class * refactor(edge-groups): remove async keyword * refactor(edge-groups): use $async service * refactor(edge-group): remove unnecessary functions * fix(endpoints): group by groups in endpoint-selector * feat(edge-groups): minor UI update * fix(edge-groups): provide defaults for edge group (#3682) * feat(edge-stacks): add basic views and sidebar link (#3689) * feat(edge-stacks): add mock routes * feat(edge-stacks): add link to stacks on sidebar * feat(edge-stacks): add edge stacks view * feat(edge-stacks): add create view * feat(edge-stacks): add edit view * fix(edge-stacks): use class in controller * feat(edge-stacks): add edge-stacks api (#3688) * feat(edge-stack): add edge stack types * feat(edge-stacks): add edge stack service interface * feat(edge-stacks): implement store * feat(edge-stacks): bind service to datastore * feat(edge-stacks): bind service to server * feat(edge-stack): create basic api * feat(edge-stack): create stack api * feat(edge-stacks): update api * refacotor(edge-stack): rename files * feat(edge-stack): update endpoint status * style(edge-stacks): remove comments * feat(edge-stacks): use edge stacks folder for files * fix(edge-stacks): replace bucket name Co-Authored-By: Anthony Lapenna <anthony.lapenna@portainer.io> * fix(edge-stacks): replace unmarshal function Co-Authored-By: Anthony Lapenna <anthony.lapenna@portainer.io> * fix(edge-stacks): replace edge stacks path Co-Authored-By: Anthony Lapenna <anthony.lapenna@portainer.io> Co-authored-by: Anthony Lapenna <anthony.lapenna@portainer.io> * chore(git): merge develop to edge compute (#3692) * feat(support): make support type dynamic (#3621) * chore(version): bump version number * chore(version): bump version number * feat(endpoints): filter by endpoint type (#3646) * chore(assets): double UI image resolutions for HiDPI displays (#3648) Fixes #3069 Prevents users seeing blurry logos and other images when using a hidpi display (like scaled 4k, or a Retina display). These images have been recreated manually with 2x the original resolution but should resemble the originals as much as possible. They have also been run through pngcrush for compression. * fix(services): enforce minimum replica count of 0 (#3653) * fix(services): enforce minimum replica count of 0 Fixes #3652 Prevents replica count from being set below zero and causing an error. * fix(services): enforce replica count is an integer Prevents users entering decimals in the replica count * refactor(tags): refactor tag management (#3628) * refactor(tags): replace tags with tag ids * refactor(tags): revert tags to be strings and add tagids * refactor(tags): enable search by tag in home view * refactor(tags): show endpoint tags * refactor(endpoints): expect tagIds on create payload * refactor(endpoints): expect tagIds on update payload * refactor(endpoints): replace TagIds to TagIDs * refactor(endpoints): set endpoint group to get TagIDs * refactor(endpoints): refactor tag-selector to receive tag-ids * refactor(endpoints): show tags in multi-endpoint-selector * chore(tags): revert reformat * refactor(endpoints): remove unneeded bind * refactor(endpoints): change param tags to tagids in endpoint create * refactor(endpoints): remove console.log * refactor(tags): remove deleted tag from endpoint and endpoint group * fix(endpoints): show loading label while loading tags * chore(go): remove obsolete import labels * chore(db): add db version comment * fix(db): add tag service to migrator * refactor(db): add error checks in migrator * style(db): sort props in alphabetical order * style(tags): fix typo Co-Authored-By: Anthony Lapenna <anthony.lapenna@portainer.io> * refactor(endpoints): replace tagsMap with tag string representation * refactor(tags): rewrite tag delete to be more readable * refactor(home): rearange code to match former style * refactor(tags): guard against missing model in tag-selector * refactor(tags): rename vars in tag_delete * refactor(tags): allow any authenticated user to fetch tag list * refactor(endpoints): replace controller function with class * refactor(endpoints): replace function with helper * refactor(endpoints): replace controller with class * refactor(tags): revert tags-selector to use 1 way bindings * refactor(endpoints): load empty tag array instead of nil * refactor(endpoints): revert default tag ids * refactor(endpoints): use function in place * refactor(tags): use lodash * style(tags): use parens in arrow functions * fix(tags): remove tag from tag model Co-authored-by: Anthony Lapenna <anthony.lapenna@portainer.io> * chore(yarn): change start:client to start webpack dev server (#3595) * chore(yarn): change start:client to start webpack dev server * Update package.json Co-authored-by: Anthony Lapenna <anthony.lapenna@portainer.io> * create tag from tag selector (#3640) * feat(tags): add button to save tag when doesn't exist * feat(endpoints): allow the creating of tags in endpoint edit * feat(groups): allow user to create tags in create group * feat(groups): allow user to create tags in edit group * feat(endpoint): allow user to create tags from endpoint create * feat(tags): allow the creation of a new tag from dropdown * feat(tag): replace "add" with "create" * feat(tags): show tags input when not tags * feat(tags): hide create message when not allowed * refactor(tags): replace component controller with class * refactor(tags): replace native methods with lodash * refactor(tags): remove unused onChangeTags function * refactor(tags): remove on-change binding * style(tags): remove white space * refactor(endpoint-groups): move controller to separate file * fix(groups): allow admin to create tag in group form * refactor(endpoints): wrap async function with try catch and $async * style(tags): wrap arrow function args with parenthesis * refactor(endpoints): return $async functions * refactor(tags): throw error in the format Notification expects * chore(yarn): add start:client script back (#3691) * feat(endpoints): filter by ids and/or tag ids (#3690) * feat(endpoints): add filter by tagIds * refactor(endpoints): change endpoints service to query by tagIds * fix(endpoints): filter by tags * feat(endpoints): filter by endpoint groups tags * feat(endpoints): filter by ids Co-authored-by: itsconquest <william.conquest@portainer.io> Co-authored-by: Anthony Lapenna <lapenna.anthony@gmail.com> Co-authored-by: Ben Brooks <ben@bbrks.me> Co-authored-by: Anthony Lapenna <anthony.lapenna@portainer.io> * Chore merge develop to edge compute (#3702) * feat(support): make support type dynamic (#3621) * chore(version): bump version number * chore(version): bump version number * feat(endpoints): filter by endpoint type (#3646) * chore(assets): double UI image resolutions for HiDPI displays (#3648) Fixes #3069 Prevents users seeing blurry logos and other images when using a hidpi display (like scaled 4k, or a Retina display). These images have been recreated manually with 2x the original resolution but should resemble the originals as much as possible. They have also been run through pngcrush for compression. * fix(services): enforce minimum replica count of 0 (#3653) * fix(services): enforce minimum replica count of 0 Fixes #3652 Prevents replica count from being set below zero and causing an error. * fix(services): enforce replica count is an integer Prevents users entering decimals in the replica count * refactor(tags): refactor tag management (#3628) * refactor(tags): replace tags with tag ids * refactor(tags): revert tags to be strings and add tagids * refactor(tags): enable search by tag in home view * refactor(tags): show endpoint tags * refactor(endpoints): expect tagIds on create payload * refactor(endpoints): expect tagIds on update payload * refactor(endpoints): replace TagIds to TagIDs * refactor(endpoints): set endpoint group to get TagIDs * refactor(endpoints): refactor tag-selector to receive tag-ids * refactor(endpoints): show tags in multi-endpoint-selector * chore(tags): revert reformat * refactor(endpoints): remove unneeded bind * refactor(endpoints): change param tags to tagids in endpoint create * refactor(endpoints): remove console.log * refactor(tags): remove deleted tag from endpoint and endpoint group * fix(endpoints): show loading label while loading tags * chore(go): remove obsolete import labels * chore(db): add db version comment * fix(db): add tag service to migrator * refactor(db): add error checks in migrator * style(db): sort props in alphabetical order * style(tags): fix typo Co-Authored-By: Anthony Lapenna <anthony.lapenna@portainer.io> * refactor(endpoints): replace tagsMap with tag string representation * refactor(tags): rewrite tag delete to be more readable * refactor(home): rearange code to match former style * refactor(tags): guard against missing model in tag-selector * refactor(tags): rename vars in tag_delete * refactor(tags): allow any authenticated user to fetch tag list * refactor(endpoints): replace controller function with class * refactor(endpoints): replace function with helper * refactor(endpoints): replace controller with class * refactor(tags): revert tags-selector to use 1 way bindings * refactor(endpoints): load empty tag array instead of nil * refactor(endpoints): revert default tag ids * refactor(endpoints): use function in place * refactor(tags): use lodash * style(tags): use parens in arrow functions * fix(tags): remove tag from tag model Co-authored-by: Anthony Lapenna <anthony.lapenna@portainer.io> * chore(yarn): change start:client to start webpack dev server (#3595) * chore(yarn): change start:client to start webpack dev server * Update package.json Co-authored-by: Anthony Lapenna <anthony.lapenna@portainer.io> * create tag from tag selector (#3640) * feat(tags): add button to save tag when doesn't exist * feat(endpoints): allow the creating of tags in endpoint edit * feat(groups): allow user to create tags in create group * feat(groups): allow user to create tags in edit group * feat(endpoint): allow user to create tags from endpoint create * feat(tags): allow the creation of a new tag from dropdown * feat(tag): replace "add" with "create" * feat(tags): show tags input when not tags * feat(tags): hide create message when not allowed * refactor(tags): replace component controller with class * refactor(tags): replace native methods with lodash * refactor(tags): remove unused onChangeTags function * refactor(tags): remove on-change binding * style(tags): remove white space * refactor(endpoint-groups): move controller to separate file * fix(groups): allow admin to create tag in group form * refactor(endpoints): wrap async function with try catch and $async * style(tags): wrap arrow function args with parenthesis * refactor(endpoints): return $async functions * refactor(tags): throw error in the format Notification expects * chore(yarn): add start:client script back (#3691) * feat(endpoints): filter by ids and/or tag ids (#3690) * feat(endpoints): add filter by tagIds * refactor(endpoints): change endpoints service to query by tagIds * fix(endpoints): filter by tags * feat(endpoints): filter by endpoint groups tags * feat(endpoints): filter by ids * refactor(project): sort portainer types and interface definitions (#3694) * refactor(portainer): sort types * style(portainer): add comment about role service * refactor(portainer): sort interface types * refactor(portainer): sort enums * Update README.md * Update README.md * Update README.md * chore(project): add prettier for code format (#3645) * chore(project): install prettier and lint-staged * chore(project): apply prettier to html too * chore(project): git ignore eslintcache * chore(project): add a comment about format script * chore(prettier): update printWidth * chore(prettier): remove useTabs option * chore(prettier): add HTML validation * refactor(prettier): fix closing tags * feat(prettier): define angular parser for html templates * style(prettier): run prettier on codebase Co-authored-by: Anthony Lapenna <lapenna.anthony@gmail.com> * chore(prettier): run format on client codebase Co-authored-by: itsconquest <william.conquest@portainer.io> Co-authored-by: Anthony Lapenna <lapenna.anthony@gmail.com> Co-authored-by: Ben Brooks <ben@bbrks.me> Co-authored-by: Anthony Lapenna <anthony.lapenna@portainer.io> Co-authored-by: Neil Cresswell <neil@cresswell.net.nz> * feat(edge-stacks): create basic edge stack service (#3704) Co-authored-by: Anthony Lapenna <anthony.lapenna@portainer.io> * feat(edge-groups): Provide a switch to use AND or OR for tags (#3695) * feat(edge-groups): add switch to form * feat(project): add property to EdgeGroup * feat(edge-groups): save mustHaveAllTags * feat(edge-groups): fetch associated endpoints (AND and OR) * feat(edge-groups): add AND selector * feat(edge-groups): default to AND * fix(edge-groups): rewrite selector options Co-Authored-By: Anthony Lapenna <anthony.lapenna@portainer.io> * refactor(endpoints): move margin to schedule form * fix(edge-groups): move the selector to top of group * refactor(edge-groups): replace partialMatch property Co-authored-by: Anthony Lapenna <anthony.lapenna@portainer.io> * feat(edge-stacks): add Edge stack creation view (#3705) * feat(edge-stacks): basic creation view * feat(edge-stacks): add group selector * feat(edge-stack): create edge stack * fix(code-editor): apply digest cycle after editor is changed * style(project): reformat constants file * feat(edge-stacks): add a note about missing edge groups * fix(edge-stacks): add groups when creating stack from file * feat(edge-groups): add associated endpoints table (#3710) * feat(edge-groups): load associated endpoints * feat(endpoints): add option to filter endpoint by partial match tags * feat(edge-groups): query endpoints by PartialMatch * feat(edge-groups): reload endpoints when form changes * feat(edge-groups): remove columns * feat(edge-group): remove url column * refactor(edge-group): remove props * feat(edge-stacks): add list view (#3713) * feat(edge-stacks): basic datatable * feat(edge-stacks): remove stack * refactor(edge-stacks): convert to class * refactor(edge-stacks): replace id with stackId * feat(edge-stacks) edit edge stack view (#3716) * feat(edge-stack): load file content * feat(edge-stack): edit view * feat(edge-stack): enable update stack * refactor(edge-stacks): move form to component * feat(edge-stacks): add endpoints status * feat(edge-stacks): minor UI update Co-authored-by: Anthony Lapenna <lapenna.anthony@gmail.com> * feat(edge-groups) prevent deletion of edge group used by an edge stack (#3722) * feat(edge-groups): show if group belonges to edge stack * feat(edge-group): protect deletion of used edge group * feat(edge-groups): diable selection of used group * feat(edge-groups): add inuse tag (#3739) * feat(edge-groups): add inuse tag * Update app/edge/components/groups-datatable/groupsDatatable.html Co-authored-by: Anthony Lapenna <anthony.lapenna@portainer.io> * feat(edge-stack): update stack version when stack file is changed (#3746) * feat(edge-stack): update version when stack file is changed * refactor(edge-stacks): move update of version to clientside * feat(edge-groups): replace Edge group endpoint selector (#3738) * feat(edge-groups): replace selector * feat(edge-group): add selector in edit form * feat(edge-groups): show tags in endpoint selector * feat(edge-groups): show the endpoint group name * fix(edge-group): remove element from associated endpoints * feat(edge-groups): add group column * feat(edge-groups): move endpoints to other column * fix(groups): disable sort * refactor(endpoints): toggle backend pagination as a property * fix(endpoints): show group name in group-association-table * feat(endpoints): truncate table columns * fix(endpoints): update group association table colspan * fix(endpoint-groups): show dash when no tags Co-authored-by: Anthony Lapenna <lapenna.anthony@gmail.com> * feat(edge-stacks): add api for edge to query stack config (#3748) * refactor(http): move edge validation to bouncer * feat(edge-stacks): add api for edge to query stack config * style(edge-stack): remove parentheses * Update api/http/security/bouncer.go * refactor(edge-stacks): move config inspect to endpoints handler * refactor(endpoints): move stack inspect to edge handler * style(security): fix typo Co-Authored-By: Anthony Lapenna <anthony.lapenna@portainer.io> * refactor(endpoints): rename file Co-authored-by: Anthony Lapenna <anthony.lapenna@portainer.io> * feat(edge-groups): add dynamic group endpoints table (#3780) * fix(edge-stacks): update version when updating stack files (#3778) * feat(edgestacks): change status permission to edge enpoints * feat(edge-compute): add stack info to edge status inspect (#3764) * feat(edge-compute): create helper functions * feat(endpoints): add relation object and service * feat(db): create endpoint relation migration * feat(endpoints): create relation when creating endpoint * feat(endpoints): update relation when updating endpoint * feat(endpoints): delete relation when deleting endpoint * feat(endpoint): add stack status to endpoint_status * feat(edge-stacks): connect new edge stack to endpoint * refactor(edgestack): return errors.New * refactor(edgestacks): return error * refactor(edgegroup): endpoint can be related only if edge endpoint * feat(endpoints): update relation only when tags or groups were changd * refactor(tags): change tags functions to set functions * refactor(edgestack): return a list of endpoints for a list of edgegroups * feat(edgestacks): update relation when updating stack * feat(edgestacks): remove relations when deleting edge stack * feat(edgegroup): update related endpoints * feat(endpoint-group): update endpoints relations on create * feat(endpointgroup): add relatd stacks to endpoint when added to group * feat(endpoint-groups): update relation when group is changed * feat(endpointgroup): when deleting group, update its endpoints relations * feat(tags): update related endpoints when deleting tag * refactor(edge-compute): use pointers * refactor(endpointgroup): handle unassociated endpoint * fix(edgestack): show correct stack status * fix(endpoint): remove deleted endpoint from related tags * feat(edge-stacks): change acknowledged status color to blue (#3810) * feat(edge-compute): provide stack name to edge endpoint (#3809) * feat(edge-groups): when no tags selected show empty list of endpoints (#3811) * feat(edge-groups): when no tags selected show empty list of endpoints * fix(edge-group): change empty associated endpoint text * fix(edge-compute): add missing relations updates (#3817) * fix(endpoint): remove deleted endpoint from edge group * fix(tags): remove deleted tag from edge group * fix(endpoint): remove deleted endpoint from edge stack * fix(edge-groups): remove clearing of edgeGroup fields * fix(edge-groups): show dynamic edge groups without tags * fix(edge-compute): use sequential delete in resources (#3818) * fix(endpoints): delete endpoints on by one * fix(tags): remove tags one by one * fix(groups): remove endpoint groups one by one * fix(edge-stacks): remove stack one by one * fix(edge-groups): remove edge group one by one * fix(edge-stacks): add link to root in breadcrumbs * style(edge): add empty line after errors * refactor(tags): remove old function * refactor(endpoints): revert changes to multi-endpoint-selector * feat(edge-stacks): support Edge stack templates (#3812) * feat(edge-compute): fetch templates from url * feat(edge-stacks): fetch edge templates * feat(edge-stacks): choose template and save * feat(edge-stacks): add placeholder to templates select * feat(edge-templates): show info * fix(edge-stacks): fix typo * feat(edge-templates): replace template url * feat(edge-compute): use custom url if available * fix(edge-stacks): show error message when failing * feat(edge-compute): show description in template * feat(edge-templates): change access to route * style(edge-compute): change EdgeTemplatesURL description Co-authored-by: Anthony Lapenna <anthony.lapenna@portainer.io> Co-authored-by: Anthony Lapenna <anthony.lapenna@portainer.io> Co-authored-by: Anthony Lapenna <anthony.lapenna@portainer.io> Co-authored-by: Anthony Lapenna <lapenna.anthony@gmail.com> Co-authored-by: itsconquest <william.conquest@portainer.io> Co-authored-by: Ben Brooks <ben@bbrks.me> Co-authored-by: Neil Cresswell <neil@cresswell.net.nz>
5 years ago
}
feat(edge-compute): move host jobs to edge (#3840) * feat(endpoints): create an associated endpoints selector * feat(schedules): remove edge specific explanations * refactor(schedule): replace multi-endpoint-selector * refactor(schedule): move controller to single file * refactor(endpoints): remove multi-endpoint-selector * feat(edge): rename host jobs to edge jobs * feat(edge-jobs): remove edge warning * refactor(edge-jobs): move schedule pages to edge * refactor(edge-jobs): mv views to edgeJobs * refactor(edge-jobs): rename edge jobs * refactor(edge-jobs): move services to edge * refactor(edge-jobs): move tasks datatable * fix(edge-jobs): fix import * fix(edge-jobs): use right services * feat(settings): adjust host management description * feat(edge-jobs): introduce interfaces and types * feat(edge-jobs): implement bolt service * refactor(edge-jobs): replace schedule routes * refactor(edge-job): replace Schedule service * refactor(edge-jobs): remove job_script_exec * refactor(host): remove jobs table * feat(edge-jobs): replace schedule * feat(edge-jobs): load file on inspect * fix(edge-job): parse cron correctly * feat(edge-jobs): show tasks * feat(host): rename tooltip * refactor(host): remove old components * refactor(main): remove schedule types * refactor(snapshot): replace job service with snapshot service * refactor(jobs): remove jobs form and datatable * feat(edge-jobs): create db migration * fix(main): start snapshot service with correct interval * feat(settings): change host tooltip * feat(edge-jobs): load endpoints * fix(edge-job): disable form submit when form is invalid * refactor(edge-compute): use const * refactor(edge-jobs): use generic controller * refactor(edge-jobs): replace $scope with controllerAs * refactor(edge-jobs): replace routes with components * refactor(edge-jobs): replace functions with classes * refactor(edge-jobs): use async/await * refactor(edge-jobs): rename functions * feat(edge-jobs): introduce beta panel * feat(edge-jobs): allow single character names * fix(snapshot): run snapshot in coroutine * feat(edge-jobs): add logs status * feat(filesystem): add edge job logs methods * feat(edge-jobs): intoduce edge jobs tasks api * feat(edge-jobs): remove schedule task model * fix(fs): build edge job task file path * fix(edge-jobs): update task meta * fix(edge-jobs): return a list of endpoints * feat(edge-jobs): update logs from agent * feat(edge-jobs): collect logs * feat(edge-jobs): rename url * feat(edge-jobs): refresh to same tab * feat(edge-jobs): remove old info * refactor(edge-jobs): rename script path json * fix(edge-job): save file before adding job * feat(edge-job): show retrieving logs label * feat(edge-job): replace cron with 5 places * refactor(edge-jobs): replace tasks with results * feat(edge-jobs): add auto refresh until logs are collected * feat(edge-jobs): fix column size * feat(edge-job): display editor * feat(edge-job): add name validation * feat(edge-job): set default time for 1 hour from now * feat(edge-job): add validation for cron format * feat(edge-job): add a note about timezone * fix(edge-job): replace regex * fix(edge-job): check for every minute cron * style(edge-jobs): add reference for cron regex * refactor(edge-jobs): rename migration name * refactor(edge-job): rename edge job response * refactor(snapshot): rename snapshot endpoint method * refactor(edge-jobs): move tasks handler to edgejobs * feat(security): introduce a middleware for edge compute operations * feat(edge-job): use edge compute middleware * feat(edge-groups): filter http actions based on edge setting * fix(security): return from edge bouncer if failed * feat(edge-stacks): filter http actions based on edge setting * feat(edge-groups): show error when failed to load groups * refactor(db): remove edge-jobs migration * refactor(migrator): remove unused dependency Co-authored-by: Anthony Lapenna <lapenna.anthony@gmail.com>
4 years ago
type edgeJobResponse struct {
docs(api): document apis with swagger (#4678) * feat(api): introduce swagger * feat(api): anottate api * chore(api): tag endpoints * chore(api): remove tags * chore(api): add docs for oauth auth * chore(api): document create endpoint api * chore(api): document endpoint inspect and list * chore(api): document endpoint update and snapshots * docs(endpointgroups): document groups api * docs(auth): document auth api * chore(build): introduce a yarn script to build api docs * docs(api): document auth * docs(customtemplates): document customtemplates api * docs(tags): document api * docs(api): document the use of token * docs(dockerhub): document dockerhub api * docs(edgegroups): document edgegroups api * docs(edgejobs): document api * docs(edgestacks): doc api * docs(http/upload): add security * docs(api): document edge templates * docs(edge): document edge jobs * docs(endpointgroups): change description * docs(endpoints): document missing apis * docs(motd): doc api * docs(registries): doc api * docs(resourcecontrol): api doc * docs(role): add swagger docs * docs(settings): add swagger docs * docs(api/status): add swagger docs * docs(api/teammembership): add swagger docs * docs(api/teams): add swagger docs * docs(api/templates): add swagger docs * docs(api/users): add swagger docs * docs(api/webhooks): add swagger docs * docs(api/webscokets): add swagger docs * docs(api/stacks): swagger * docs(api): fix missing apis * docs(swagger): regen * chore(build): remove docs from build * docs(api): update tags * docs(api): document tags * docs(api): add description * docs(api): rename jwt token * docs(api): add info about types * docs(api): document types * docs(api): update request types annotation * docs(api): doc registry and resource control * chore(docs): add snippet * docs(api): add description to role * docs(api): add types for settings * docs(status): add types * style(swagger): remove documented code * docs(http/upload): update docs with types * docs(http/tags): add types * docs(api/custom_templates): add types * docs(api/teammembership): add types * docs(http/teams): add types * docs(http/stacks): add types * docs(edge): add types to edgestack * docs(http/teammembership): remove double returns * docs(api/user): add types * docs(http): fixes to make file built * chore(snippets): add scope to swagger snippet * chore(deps): install swag * chore(swagger): remove handler * docs(api): add description * docs(api): ignore docs folder * docs(api): add contributing guidelines * docs(api): cleanup handler * chore(deps): require swaggo * fix(auth): fix typo * fix(docs): make http ids pascal case * feat(edge): add ids to http handlers * fix(docs): add ids * fix(docs): show correct api version * chore(deps): remove swaggo dependency * chore(docs): add install script for swag
4 years ago
// EdgeJob Identifier
ID portainer.EdgeJobID `json:"Id" example:"2"`
// Whether to collect logs
CollectLogs bool `json:"CollectLogs" example:"true"`
// A cron expression to schedule this job
CronExpression string `json:"CronExpression" example:"* * * * *"`
// Script to run
Script string `json:"Script" example:"echo hello"`
// Version of this EdgeJob
Version int `json:"Version" example:"2"`
feat(edge-compute): move host jobs to edge (#3840) * feat(endpoints): create an associated endpoints selector * feat(schedules): remove edge specific explanations * refactor(schedule): replace multi-endpoint-selector * refactor(schedule): move controller to single file * refactor(endpoints): remove multi-endpoint-selector * feat(edge): rename host jobs to edge jobs * feat(edge-jobs): remove edge warning * refactor(edge-jobs): move schedule pages to edge * refactor(edge-jobs): mv views to edgeJobs * refactor(edge-jobs): rename edge jobs * refactor(edge-jobs): move services to edge * refactor(edge-jobs): move tasks datatable * fix(edge-jobs): fix import * fix(edge-jobs): use right services * feat(settings): adjust host management description * feat(edge-jobs): introduce interfaces and types * feat(edge-jobs): implement bolt service * refactor(edge-jobs): replace schedule routes * refactor(edge-job): replace Schedule service * refactor(edge-jobs): remove job_script_exec * refactor(host): remove jobs table * feat(edge-jobs): replace schedule * feat(edge-jobs): load file on inspect * fix(edge-job): parse cron correctly * feat(edge-jobs): show tasks * feat(host): rename tooltip * refactor(host): remove old components * refactor(main): remove schedule types * refactor(snapshot): replace job service with snapshot service * refactor(jobs): remove jobs form and datatable * feat(edge-jobs): create db migration * fix(main): start snapshot service with correct interval * feat(settings): change host tooltip * feat(edge-jobs): load endpoints * fix(edge-job): disable form submit when form is invalid * refactor(edge-compute): use const * refactor(edge-jobs): use generic controller * refactor(edge-jobs): replace $scope with controllerAs * refactor(edge-jobs): replace routes with components * refactor(edge-jobs): replace functions with classes * refactor(edge-jobs): use async/await * refactor(edge-jobs): rename functions * feat(edge-jobs): introduce beta panel * feat(edge-jobs): allow single character names * fix(snapshot): run snapshot in coroutine * feat(edge-jobs): add logs status * feat(filesystem): add edge job logs methods * feat(edge-jobs): intoduce edge jobs tasks api * feat(edge-jobs): remove schedule task model * fix(fs): build edge job task file path * fix(edge-jobs): update task meta * fix(edge-jobs): return a list of endpoints * feat(edge-jobs): update logs from agent * feat(edge-jobs): collect logs * feat(edge-jobs): rename url * feat(edge-jobs): refresh to same tab * feat(edge-jobs): remove old info * refactor(edge-jobs): rename script path json * fix(edge-job): save file before adding job * feat(edge-job): show retrieving logs label * feat(edge-job): replace cron with 5 places * refactor(edge-jobs): replace tasks with results * feat(edge-jobs): add auto refresh until logs are collected * feat(edge-jobs): fix column size * feat(edge-job): display editor * feat(edge-job): add name validation * feat(edge-job): set default time for 1 hour from now * feat(edge-job): add validation for cron format * feat(edge-job): add a note about timezone * fix(edge-job): replace regex * fix(edge-job): check for every minute cron * style(edge-jobs): add reference for cron regex * refactor(edge-jobs): rename migration name * refactor(edge-job): rename edge job response * refactor(snapshot): rename snapshot endpoint method * refactor(edge-jobs): move tasks handler to edgejobs * feat(security): introduce a middleware for edge compute operations * feat(edge-job): use edge compute middleware * feat(edge-groups): filter http actions based on edge setting * fix(security): return from edge bouncer if failed * feat(edge-stacks): filter http actions based on edge setting * feat(edge-groups): show error when failed to load groups * refactor(db): remove edge-jobs migration * refactor(migrator): remove unused dependency Co-authored-by: Anthony Lapenna <lapenna.anthony@gmail.com>
4 years ago
}
type endpointEdgeStatusInspectResponse struct {
// Status represents the environment(endpoint) status
docs(api): document apis with swagger (#4678) * feat(api): introduce swagger * feat(api): anottate api * chore(api): tag endpoints * chore(api): remove tags * chore(api): add docs for oauth auth * chore(api): document create endpoint api * chore(api): document endpoint inspect and list * chore(api): document endpoint update and snapshots * docs(endpointgroups): document groups api * docs(auth): document auth api * chore(build): introduce a yarn script to build api docs * docs(api): document auth * docs(customtemplates): document customtemplates api * docs(tags): document api * docs(api): document the use of token * docs(dockerhub): document dockerhub api * docs(edgegroups): document edgegroups api * docs(edgejobs): document api * docs(edgestacks): doc api * docs(http/upload): add security * docs(api): document edge templates * docs(edge): document edge jobs * docs(endpointgroups): change description * docs(endpoints): document missing apis * docs(motd): doc api * docs(registries): doc api * docs(resourcecontrol): api doc * docs(role): add swagger docs * docs(settings): add swagger docs * docs(api/status): add swagger docs * docs(api/teammembership): add swagger docs * docs(api/teams): add swagger docs * docs(api/templates): add swagger docs * docs(api/users): add swagger docs * docs(api/webhooks): add swagger docs * docs(api/webscokets): add swagger docs * docs(api/stacks): swagger * docs(api): fix missing apis * docs(swagger): regen * chore(build): remove docs from build * docs(api): update tags * docs(api): document tags * docs(api): add description * docs(api): rename jwt token * docs(api): add info about types * docs(api): document types * docs(api): update request types annotation * docs(api): doc registry and resource control * chore(docs): add snippet * docs(api): add description to role * docs(api): add types for settings * docs(status): add types * style(swagger): remove documented code * docs(http/upload): update docs with types * docs(http/tags): add types * docs(api/custom_templates): add types * docs(api/teammembership): add types * docs(http/teams): add types * docs(http/stacks): add types * docs(edge): add types to edgestack * docs(http/teammembership): remove double returns * docs(api/user): add types * docs(http): fixes to make file built * chore(snippets): add scope to swagger snippet * chore(deps): install swag * chore(swagger): remove handler * docs(api): add description * docs(api): ignore docs folder * docs(api): add contributing guidelines * docs(api): cleanup handler * chore(deps): require swaggo * fix(auth): fix typo * fix(docs): make http ids pascal case * feat(edge): add ids to http handlers * fix(docs): add ids * fix(docs): show correct api version * chore(deps): remove swaggo dependency * chore(docs): add install script for swag
4 years ago
Status string `json:"status" example:"REQUIRED"`
// The tunnel port
Port int `json:"port" example:"8732"`
// List of requests for jobs to run on the environment(endpoint)
docs(api): document apis with swagger (#4678) * feat(api): introduce swagger * feat(api): anottate api * chore(api): tag endpoints * chore(api): remove tags * chore(api): add docs for oauth auth * chore(api): document create endpoint api * chore(api): document endpoint inspect and list * chore(api): document endpoint update and snapshots * docs(endpointgroups): document groups api * docs(auth): document auth api * chore(build): introduce a yarn script to build api docs * docs(api): document auth * docs(customtemplates): document customtemplates api * docs(tags): document api * docs(api): document the use of token * docs(dockerhub): document dockerhub api * docs(edgegroups): document edgegroups api * docs(edgejobs): document api * docs(edgestacks): doc api * docs(http/upload): add security * docs(api): document edge templates * docs(edge): document edge jobs * docs(endpointgroups): change description * docs(endpoints): document missing apis * docs(motd): doc api * docs(registries): doc api * docs(resourcecontrol): api doc * docs(role): add swagger docs * docs(settings): add swagger docs * docs(api/status): add swagger docs * docs(api/teammembership): add swagger docs * docs(api/teams): add swagger docs * docs(api/templates): add swagger docs * docs(api/users): add swagger docs * docs(api/webhooks): add swagger docs * docs(api/webscokets): add swagger docs * docs(api/stacks): swagger * docs(api): fix missing apis * docs(swagger): regen * chore(build): remove docs from build * docs(api): update tags * docs(api): document tags * docs(api): add description * docs(api): rename jwt token * docs(api): add info about types * docs(api): document types * docs(api): update request types annotation * docs(api): doc registry and resource control * chore(docs): add snippet * docs(api): add description to role * docs(api): add types for settings * docs(status): add types * style(swagger): remove documented code * docs(http/upload): update docs with types * docs(http/tags): add types * docs(api/custom_templates): add types * docs(api/teammembership): add types * docs(http/teams): add types * docs(http/stacks): add types * docs(edge): add types to edgestack * docs(http/teammembership): remove double returns * docs(api/user): add types * docs(http): fixes to make file built * chore(snippets): add scope to swagger snippet * chore(deps): install swag * chore(swagger): remove handler * docs(api): add description * docs(api): ignore docs folder * docs(api): add contributing guidelines * docs(api): cleanup handler * chore(deps): require swaggo * fix(auth): fix typo * fix(docs): make http ids pascal case * feat(edge): add ids to http handlers * fix(docs): add ids * fix(docs): show correct api version * chore(deps): remove swaggo dependency * chore(docs): add install script for swag
4 years ago
Schedules []edgeJobResponse `json:"schedules"`
// The current value of CheckinInterval
CheckinInterval int `json:"checkin" example:"5"`
//
Credentials string `json:"credentials"`
// List of stacks to be deployed on the environments(endpoints)
docs(api): document apis with swagger (#4678) * feat(api): introduce swagger * feat(api): anottate api * chore(api): tag endpoints * chore(api): remove tags * chore(api): add docs for oauth auth * chore(api): document create endpoint api * chore(api): document endpoint inspect and list * chore(api): document endpoint update and snapshots * docs(endpointgroups): document groups api * docs(auth): document auth api * chore(build): introduce a yarn script to build api docs * docs(api): document auth * docs(customtemplates): document customtemplates api * docs(tags): document api * docs(api): document the use of token * docs(dockerhub): document dockerhub api * docs(edgegroups): document edgegroups api * docs(edgejobs): document api * docs(edgestacks): doc api * docs(http/upload): add security * docs(api): document edge templates * docs(edge): document edge jobs * docs(endpointgroups): change description * docs(endpoints): document missing apis * docs(motd): doc api * docs(registries): doc api * docs(resourcecontrol): api doc * docs(role): add swagger docs * docs(settings): add swagger docs * docs(api/status): add swagger docs * docs(api/teammembership): add swagger docs * docs(api/teams): add swagger docs * docs(api/templates): add swagger docs * docs(api/users): add swagger docs * docs(api/webhooks): add swagger docs * docs(api/webscokets): add swagger docs * docs(api/stacks): swagger * docs(api): fix missing apis * docs(swagger): regen * chore(build): remove docs from build * docs(api): update tags * docs(api): document tags * docs(api): add description * docs(api): rename jwt token * docs(api): add info about types * docs(api): document types * docs(api): update request types annotation * docs(api): doc registry and resource control * chore(docs): add snippet * docs(api): add description to role * docs(api): add types for settings * docs(status): add types * style(swagger): remove documented code * docs(http/upload): update docs with types * docs(http/tags): add types * docs(api/custom_templates): add types * docs(api/teammembership): add types * docs(http/teams): add types * docs(http/stacks): add types * docs(edge): add types to edgestack * docs(http/teammembership): remove double returns * docs(api/user): add types * docs(http): fixes to make file built * chore(snippets): add scope to swagger snippet * chore(deps): install swag * chore(swagger): remove handler * docs(api): add description * docs(api): ignore docs folder * docs(api): add contributing guidelines * docs(api): cleanup handler * chore(deps): require swaggo * fix(auth): fix typo * fix(docs): make http ids pascal case * feat(edge): add ids to http handlers * fix(docs): add ids * fix(docs): show correct api version * chore(deps): remove swaggo dependency * chore(docs): add install script for swag
4 years ago
Stacks []stackStatusResponse `json:"stacks"`
feat(edge): introduce support for Edge agent (#3031) * feat(edge): fix webconsole and agent deployment command * feat(edge): display agent features when connected to IoT endpoint * feat(edge): add -e CAP_HOST_MANAGEMENT=1 to agent command * feat(edge): add -v /:/host and --name portainer_agent_iot to agent command * style(endpoint-creation): refactor IoT agent to Edge agent * refactor(api): rename AgentIoTEnvironment to AgentEdgeEnvironment * refactor(api): rename AgentIoTEnvironment to AgentEdgeEnvironment * feat(endpoint-creation): update Edge agent deployment instructions * feat(edge): wip edge * feat(edge): refactor key creation * feat(edge): update deployment instructions * feat(home): update Edge agent endpoint item * feat(edge): support dynamic ports * feat(edge): support sleep/wake and snapshots * feat(edge): support offline mode * feat(edge): host job support for Edge endpoints * feat(edge): introduce STANDBY state * feat(edge): update Edge agent deployment command * feat(edge): introduce EDGE_ID support * feat(edge): update default inactivity interval to 5min * feat(edge): reload Edge schedules after restart * fix(edge): fix execution of endpoint job against an Edge endpoint * fix(edge): fix minor issues with scheduling UI/UX * feat(edge): introduce EdgeSchedule version management * feat(edge): switch back to REQUIRED state from ACTIVE on error * refactor(edge): remove comment * feat(edge): updated tunnel status management * feat(edge): fix flickering UI when accessing Edge endpoint from home view * feat(edge): remove STANDBY status * fix(edge): fix an issue with console and Swarm endpoint * fix(edge): fix an issue with stack deployment * fix(edge): reset timer when applying active status * feat(edge): add background ping for Edge endpoints * fix(edge): fix infinite loading loop after Edge endpoint connection failure * fix(home): fix an issue with merge * feat(api): remove SnapshotRaw from EndpointList response * feat(api): add pagination for EndpointList operation * feat(api): rename last_id query parameter to start * feat(api): implement filter for EndpointList operation * fix(edge): prevent a pointer issue after removing an active Edge endpoint * feat(home): front - endpoint backend pagination (#2990) * feat(home): endpoint pagination with backend * feat(api): remove default limit value * fix(endpoints): fix a minor issue with column span * fix(endpointgroup-create): fix an issue with endpoint group creation * feat(app): minor loading optimizations * refactor(api): small refactor of EndpointList operation * fix(home): fix minor loading text display issue * refactor(api): document bolt services functions * feat(home): minor optimization * fix(api): replace seek with index scanning for EndpointPaginated * fix(api): fix invalid starting index issue * fix(api): first implementation of working filter * fix(home): endpoints list keeps backend pagination when it needs to * fix(api): endpoint pagination doesn't drop the first item on pages >=2 anymore * fix(home): UI flickering on page/filter load/change * feat(auth): login spinner * feat(api): support searching in associated endpoint group data * refactor(api): remove unused API endpoint * refactor(api): remove comment * refactor(api): refactor proxy manager * feat(api): declare EndpointList params as optional * feat(api): support groupID filter on endpoints route * feat(api): add new API operations endpointGroupAddEndpoint and endpointGroupDeleteEndpoint * feat(edge): new icon for Edge agent endpoint * fix(edge): fix missing exec quick action * fix(edge): add loading indicator when connecting to Edge endpoint * feat(edge): disable service webhooks for Edge endpoints * feat(endpoints): backend pagination for endpoints view (#3004) * feat(edge): dynamic loading for stack migration feature * feat(edge): wordwrap edge key * feat(endpoint-groups): backend pagination support for create and edit * feat(endpoint-groups): debounce on filter for create/edit views * feat(endpoint-groups): filter assigned on create view * (endpoint-groups): unassigned endpoints edit view * refactor(endpoint-groups): code clean * feat(endpoint-groups): remove message for Unassigned group * refactor(websocket): minor refactor associated to Edge agent * feat(endpoint-group): enable backend pagination (#3017) * feat(api): support groupID filter on endpoints route * feat(api): add new API operations endpointGroupAddEndpoint and endpointGroupDeleteEndpoint * feat(endpoint-groups): backend pagination support for create and edit * feat(endpoint-groups): debounce on filter for create/edit views * feat(endpoint-groups): filter assigned on create view * (endpoint-groups): unassigned endpoints edit view * refactor(endpoint-groups): code clean * feat(endpoint-groups): remove message for Unassigned group * refactor(api): endpoint group endpoint association refactor * refactor(api): rename files and remove comments * refactor(api): remove usage of utils * refactor(api): optional parameters * Merge branch 'feat-endpoint-backend-pagination' into edge # Conflicts: # api/bolt/endpoint/endpoint.go # api/http/handler/endpointgroups/endpointgroup_update.go # api/http/handler/endpointgroups/handler.go # api/http/handler/endpoints/endpoint_list.go # app/portainer/services/api/endpointService.js * fix(api): fix default tunnel server credentials * feat(api): update endpointListOperation behavior and parameters * fix(api): fix interface declaration * feat(edge): support configurable Edge agent checkin interval * feat(edge): support dynamic tunnel credentials * feat(edge): update Edge agent deployment commands * style(edge): update Edge agent settings text * refactor(edge): remove unused credentials management methods * feat(edge): associate a remote addr to tunnel credentials * style(edge): update Edge endpoint icon * feat(edge): support encrypted tunnel credentials * fix(edge): fix invalid pointer cast * feat(bolt): decode endpoints with jsoniter * feat(edge): persist reverse tunnel keyseed * refactor(edge): minor refactor * feat(edge): update chisel library usage * refactor(endpoint): use controller function * feat(api): database migration to DBVersion 19 * refactor(api): refactor AddSchedule function * refactor(schedules): remove comment * refactor(api): remove comment * refactor(api): remove comment * feat(api): tunnel manager now only manage Edge endpoints * refactor(api): clean-up and clarification of the Edge service * refactor(api): clean-up and clarification of the Edge service * fix(api): fix an issue with Edge agent snapshots * refactor(api): add missing comments * refactor(api): update constant description * style(home): remove loading text on error * feat(endpoint): remove 15s timeout for ping request * style(home): display information about associated Edge endpoints * feat(home): redirect to endpoint details on click on unassociated Edge endpoint * feat(settings): remove 60s Edge poll frequency option
5 years ago
}
// @id EndpointEdgeStatusInspect
// @summary Get environment(endpoint) status
// @description environment(endpoint) for edge agent to check status of environment(endpoint)
// @description **Access policy**: restricted only to Edge environments(endpoints)
docs(api): document apis with swagger (#4678) * feat(api): introduce swagger * feat(api): anottate api * chore(api): tag endpoints * chore(api): remove tags * chore(api): add docs for oauth auth * chore(api): document create endpoint api * chore(api): document endpoint inspect and list * chore(api): document endpoint update and snapshots * docs(endpointgroups): document groups api * docs(auth): document auth api * chore(build): introduce a yarn script to build api docs * docs(api): document auth * docs(customtemplates): document customtemplates api * docs(tags): document api * docs(api): document the use of token * docs(dockerhub): document dockerhub api * docs(edgegroups): document edgegroups api * docs(edgejobs): document api * docs(edgestacks): doc api * docs(http/upload): add security * docs(api): document edge templates * docs(edge): document edge jobs * docs(endpointgroups): change description * docs(endpoints): document missing apis * docs(motd): doc api * docs(registries): doc api * docs(resourcecontrol): api doc * docs(role): add swagger docs * docs(settings): add swagger docs * docs(api/status): add swagger docs * docs(api/teammembership): add swagger docs * docs(api/teams): add swagger docs * docs(api/templates): add swagger docs * docs(api/users): add swagger docs * docs(api/webhooks): add swagger docs * docs(api/webscokets): add swagger docs * docs(api/stacks): swagger * docs(api): fix missing apis * docs(swagger): regen * chore(build): remove docs from build * docs(api): update tags * docs(api): document tags * docs(api): add description * docs(api): rename jwt token * docs(api): add info about types * docs(api): document types * docs(api): update request types annotation * docs(api): doc registry and resource control * chore(docs): add snippet * docs(api): add description to role * docs(api): add types for settings * docs(status): add types * style(swagger): remove documented code * docs(http/upload): update docs with types * docs(http/tags): add types * docs(api/custom_templates): add types * docs(api/teammembership): add types * docs(http/teams): add types * docs(http/stacks): add types * docs(edge): add types to edgestack * docs(http/teammembership): remove double returns * docs(api/user): add types * docs(http): fixes to make file built * chore(snippets): add scope to swagger snippet * chore(deps): install swag * chore(swagger): remove handler * docs(api): add description * docs(api): ignore docs folder * docs(api): add contributing guidelines * docs(api): cleanup handler * chore(deps): require swaggo * fix(auth): fix typo * fix(docs): make http ids pascal case * feat(edge): add ids to http handlers * fix(docs): add ids * fix(docs): show correct api version * chore(deps): remove swaggo dependency * chore(docs): add install script for swag
4 years ago
// @tags endpoints
feat(api-key/backend): introducing support for api-key based auth EE-978 (#6079) * feat(access-token): Multi-auth middleware support EE-1891 (#5936) * AnyAuth middleware initial implementation with tests * using mux.MiddlewareFunc instead of custom definition * removed redundant comments * - ExtractBearerToken bouncer func made private - changed helm token handling functionality to use jwt service to convert token to jwt string - updated tests - fixed helm list broken test due to missing token in request context * rename mwCheckAuthentication -> mwCheckJWTAuthentication * - introduce initial api-key auth support using X-API-KEY header - added tests to validate x-api-key request header presence * updated core mwAuthenticatedUser middleware to support multiple auth paradigms * - simplified anyAuth middleware - enforcing authmiddleware to implement verificationFunc interface - created tests for middleware * simplify bouncer Co-authored-by: Dmitry Salakhov <to@dimasalakhov.com> * feat(api-key): user-access-token generation endpoint EE-1889 EE-1888 EE-1895 (#6012) * user-access-token generation endpoint * fix comment * - introduction of apikey service - seperation of repository from service logic - called in handler * fixed tests * - fixed api key prefix - added tests * added another test for digest matching * updated swagger spec for access token creation * api key response returns raw key and struct - easing testability * test for api key prefix length * added another TODO to middleware * - api-key prefix rune -> string (rune does not auto-encode when response sent back to client) - digest -> pointer as we want to allow nil values and omit digest in responses (when nil) * - updated apikey struct - updated apikey service to support all common operations - updated apikey repo - integration of apikey service into bouncer - added test for all apikey service functions - boilerplate code for apikey service integration * - user access token generation tests - apiKeyLookup updated to support query params - added api-key tests for query params - added api-key tests for apiKeyLookup * get and remove access token handlers * get and remove access token handler tests * - delete user deletes all associated api keys - tests for this functionality * removed redundant []byte cast * automatic api-key eviction set within cache for 1 hour * fixed bug with loop var using final value * fixed service comment * ignore bolt error responses * case-insensitive query param check * simplified query var assignment * - added GetAPIKey func to get by unique id - updated DeleteAPIKey func to not require user ID - updated tests * GenerateRandomKey helper func from github.com/gorilla/securecookie moved to codebase * json response casing for api-keys fixed * updating api-key will update the cache * updated golang LRU cache * using hashicorps golang-LRU cache for api keys * simplified jwt check in create user access token * fixed api-key update logic on cache miss * Prefix generated api-keys with `ptr_` (#6067) * prefix api-keys with 'ptr_' * updated apikey description * refactor Co-authored-by: Dmitry Salakhov <to@dimasalakhov.com> * helm list test refactor * fixed user delete test * reduce test nil pointer errors * using correct http 201 created status code for token creation; updated tests * fixed swagger doc user id path param for user access token based endpoints * added api-key security openapi spec to existing jwt secured endpoints (#6091) * fixed flaky test * apikey datecreated and lastused attrs converted to unix timestamp * feat(user): added access token datatable. (#6124) * feat(user): added access token datatable. * feat(tokens): only display lastUsed time when it is not the default date * Update app/portainer/views/account/accountController.js Co-authored-by: zees-dev <63374656+zees-dev@users.noreply.github.com> * Update app/portainer/views/account/accountController.js Co-authored-by: zees-dev <63374656+zees-dev@users.noreply.github.com> * Update app/portainer/views/account/accountController.js Co-authored-by: zees-dev <63374656+zees-dev@users.noreply.github.com> * Update app/portainer/components/datatables/access-tokens-datatable/accessTokensDatatableController.js Co-authored-by: zees-dev <63374656+zees-dev@users.noreply.github.com> * Update app/portainer/services/api/userService.js Co-authored-by: zees-dev <63374656+zees-dev@users.noreply.github.com> * feat(improvements): proposed datatable improvements to speed up dev time (#6138) * modal code update * updated datatable filenames, updated controller to be default class export * fix(access-token): code improvement. Co-authored-by: zees-dev <63374656+zees-dev@users.noreply.github.com> * feat(apikeys): create access token view initial implementation EE-1886 (#6129) * CopyButton implementation * Code component implementation * ToolTip component migration to another folder * TextTip component implementation - continued * form Heading component * Button component updated to be more dynamic * copybutton - small size * form control pass tip error * texttip small text * CreateAccessToken react feature initial implementation * create user access token angularjs view implementation * registration of CreateAccessToken component in AngularJS * user token generation API request moved to angular service, method passed down instead * consistent naming of access token operations; clustered similar code together * any user can add access token * create access token page routing * moved code component to the correct location * removed isadmin check as all functionality applicable to all users * create access token angular view moved up a level * fixed PR issues, updated PR * addressed PR issues/improvements * explicit hr for horizontal line * fixed merge conflict storybook build breaking * - apikey test - cache test * addressed testing issues: - description validations - remove token description link on table * fix(api-keys): user role change evicts user keys in cache EE-2113 (#6168) * user role change evicts user api keys in cache * EvictUserKeyCache -> InvalidateUserKeyCache * godoc for InvalidateUserKeyCache func * additional test line * disable add access token button after adding token to prevent spam Co-authored-by: Dmitry Salakhov <to@dimasalakhov.com> Co-authored-by: fhanportainer <79428273+fhanportainer@users.noreply.github.com>
3 years ago
// @security ApiKeyAuth
docs(api): document apis with swagger (#4678) * feat(api): introduce swagger * feat(api): anottate api * chore(api): tag endpoints * chore(api): remove tags * chore(api): add docs for oauth auth * chore(api): document create endpoint api * chore(api): document endpoint inspect and list * chore(api): document endpoint update and snapshots * docs(endpointgroups): document groups api * docs(auth): document auth api * chore(build): introduce a yarn script to build api docs * docs(api): document auth * docs(customtemplates): document customtemplates api * docs(tags): document api * docs(api): document the use of token * docs(dockerhub): document dockerhub api * docs(edgegroups): document edgegroups api * docs(edgejobs): document api * docs(edgestacks): doc api * docs(http/upload): add security * docs(api): document edge templates * docs(edge): document edge jobs * docs(endpointgroups): change description * docs(endpoints): document missing apis * docs(motd): doc api * docs(registries): doc api * docs(resourcecontrol): api doc * docs(role): add swagger docs * docs(settings): add swagger docs * docs(api/status): add swagger docs * docs(api/teammembership): add swagger docs * docs(api/teams): add swagger docs * docs(api/templates): add swagger docs * docs(api/users): add swagger docs * docs(api/webhooks): add swagger docs * docs(api/webscokets): add swagger docs * docs(api/stacks): swagger * docs(api): fix missing apis * docs(swagger): regen * chore(build): remove docs from build * docs(api): update tags * docs(api): document tags * docs(api): add description * docs(api): rename jwt token * docs(api): add info about types * docs(api): document types * docs(api): update request types annotation * docs(api): doc registry and resource control * chore(docs): add snippet * docs(api): add description to role * docs(api): add types for settings * docs(status): add types * style(swagger): remove documented code * docs(http/upload): update docs with types * docs(http/tags): add types * docs(api/custom_templates): add types * docs(api/teammembership): add types * docs(http/teams): add types * docs(http/stacks): add types * docs(edge): add types to edgestack * docs(http/teammembership): remove double returns * docs(api/user): add types * docs(http): fixes to make file built * chore(snippets): add scope to swagger snippet * chore(deps): install swag * chore(swagger): remove handler * docs(api): add description * docs(api): ignore docs folder * docs(api): add contributing guidelines * docs(api): cleanup handler * chore(deps): require swaggo * fix(auth): fix typo * fix(docs): make http ids pascal case * feat(edge): add ids to http handlers * fix(docs): add ids * fix(docs): show correct api version * chore(deps): remove swaggo dependency * chore(docs): add install script for swag
4 years ago
// @security jwt
// @param id path int true "Environment(Endpoint) identifier"
// @success 200 {object} endpointEdgeStatusInspectResponse "Success"
docs(api): document apis with swagger (#4678) * feat(api): introduce swagger * feat(api): anottate api * chore(api): tag endpoints * chore(api): remove tags * chore(api): add docs for oauth auth * chore(api): document create endpoint api * chore(api): document endpoint inspect and list * chore(api): document endpoint update and snapshots * docs(endpointgroups): document groups api * docs(auth): document auth api * chore(build): introduce a yarn script to build api docs * docs(api): document auth * docs(customtemplates): document customtemplates api * docs(tags): document api * docs(api): document the use of token * docs(dockerhub): document dockerhub api * docs(edgegroups): document edgegroups api * docs(edgejobs): document api * docs(edgestacks): doc api * docs(http/upload): add security * docs(api): document edge templates * docs(edge): document edge jobs * docs(endpointgroups): change description * docs(endpoints): document missing apis * docs(motd): doc api * docs(registries): doc api * docs(resourcecontrol): api doc * docs(role): add swagger docs * docs(settings): add swagger docs * docs(api/status): add swagger docs * docs(api/teammembership): add swagger docs * docs(api/teams): add swagger docs * docs(api/templates): add swagger docs * docs(api/users): add swagger docs * docs(api/webhooks): add swagger docs * docs(api/webscokets): add swagger docs * docs(api/stacks): swagger * docs(api): fix missing apis * docs(swagger): regen * chore(build): remove docs from build * docs(api): update tags * docs(api): document tags * docs(api): add description * docs(api): rename jwt token * docs(api): add info about types * docs(api): document types * docs(api): update request types annotation * docs(api): doc registry and resource control * chore(docs): add snippet * docs(api): add description to role * docs(api): add types for settings * docs(status): add types * style(swagger): remove documented code * docs(http/upload): update docs with types * docs(http/tags): add types * docs(api/custom_templates): add types * docs(api/teammembership): add types * docs(http/teams): add types * docs(http/stacks): add types * docs(edge): add types to edgestack * docs(http/teammembership): remove double returns * docs(api/user): add types * docs(http): fixes to make file built * chore(snippets): add scope to swagger snippet * chore(deps): install swag * chore(swagger): remove handler * docs(api): add description * docs(api): ignore docs folder * docs(api): add contributing guidelines * docs(api): cleanup handler * chore(deps): require swaggo * fix(auth): fix typo * fix(docs): make http ids pascal case * feat(edge): add ids to http handlers * fix(docs): add ids * fix(docs): show correct api version * chore(deps): remove swaggo dependency * chore(docs): add install script for swag
4 years ago
// @failure 400 "Invalid request"
// @failure 403 "Permission denied to access environment(endpoint)"
// @failure 404 "Environment(Endpoint) not found"
docs(api): document apis with swagger (#4678) * feat(api): introduce swagger * feat(api): anottate api * chore(api): tag endpoints * chore(api): remove tags * chore(api): add docs for oauth auth * chore(api): document create endpoint api * chore(api): document endpoint inspect and list * chore(api): document endpoint update and snapshots * docs(endpointgroups): document groups api * docs(auth): document auth api * chore(build): introduce a yarn script to build api docs * docs(api): document auth * docs(customtemplates): document customtemplates api * docs(tags): document api * docs(api): document the use of token * docs(dockerhub): document dockerhub api * docs(edgegroups): document edgegroups api * docs(edgejobs): document api * docs(edgestacks): doc api * docs(http/upload): add security * docs(api): document edge templates * docs(edge): document edge jobs * docs(endpointgroups): change description * docs(endpoints): document missing apis * docs(motd): doc api * docs(registries): doc api * docs(resourcecontrol): api doc * docs(role): add swagger docs * docs(settings): add swagger docs * docs(api/status): add swagger docs * docs(api/teammembership): add swagger docs * docs(api/teams): add swagger docs * docs(api/templates): add swagger docs * docs(api/users): add swagger docs * docs(api/webhooks): add swagger docs * docs(api/webscokets): add swagger docs * docs(api/stacks): swagger * docs(api): fix missing apis * docs(swagger): regen * chore(build): remove docs from build * docs(api): update tags * docs(api): document tags * docs(api): add description * docs(api): rename jwt token * docs(api): add info about types * docs(api): document types * docs(api): update request types annotation * docs(api): doc registry and resource control * chore(docs): add snippet * docs(api): add description to role * docs(api): add types for settings * docs(status): add types * style(swagger): remove documented code * docs(http/upload): update docs with types * docs(http/tags): add types * docs(api/custom_templates): add types * docs(api/teammembership): add types * docs(http/teams): add types * docs(http/stacks): add types * docs(edge): add types to edgestack * docs(http/teammembership): remove double returns * docs(api/user): add types * docs(http): fixes to make file built * chore(snippets): add scope to swagger snippet * chore(deps): install swag * chore(swagger): remove handler * docs(api): add description * docs(api): ignore docs folder * docs(api): add contributing guidelines * docs(api): cleanup handler * chore(deps): require swaggo * fix(auth): fix typo * fix(docs): make http ids pascal case * feat(edge): add ids to http handlers * fix(docs): add ids * fix(docs): show correct api version * chore(deps): remove swaggo dependency * chore(docs): add install script for swag
4 years ago
// @failure 500 "Server error"
// @router /endpoints/{id}/edge/status [get]
func (handler *Handler) endpointEdgeStatusInspect(w http.ResponseWriter, r *http.Request) *httperror.HandlerError {
endpointID, err := request.RetrieveNumericRouteVariableValue(r, "id")
feat(edge): introduce support for Edge agent (#3031) * feat(edge): fix webconsole and agent deployment command * feat(edge): display agent features when connected to IoT endpoint * feat(edge): add -e CAP_HOST_MANAGEMENT=1 to agent command * feat(edge): add -v /:/host and --name portainer_agent_iot to agent command * style(endpoint-creation): refactor IoT agent to Edge agent * refactor(api): rename AgentIoTEnvironment to AgentEdgeEnvironment * refactor(api): rename AgentIoTEnvironment to AgentEdgeEnvironment * feat(endpoint-creation): update Edge agent deployment instructions * feat(edge): wip edge * feat(edge): refactor key creation * feat(edge): update deployment instructions * feat(home): update Edge agent endpoint item * feat(edge): support dynamic ports * feat(edge): support sleep/wake and snapshots * feat(edge): support offline mode * feat(edge): host job support for Edge endpoints * feat(edge): introduce STANDBY state * feat(edge): update Edge agent deployment command * feat(edge): introduce EDGE_ID support * feat(edge): update default inactivity interval to 5min * feat(edge): reload Edge schedules after restart * fix(edge): fix execution of endpoint job against an Edge endpoint * fix(edge): fix minor issues with scheduling UI/UX * feat(edge): introduce EdgeSchedule version management * feat(edge): switch back to REQUIRED state from ACTIVE on error * refactor(edge): remove comment * feat(edge): updated tunnel status management * feat(edge): fix flickering UI when accessing Edge endpoint from home view * feat(edge): remove STANDBY status * fix(edge): fix an issue with console and Swarm endpoint * fix(edge): fix an issue with stack deployment * fix(edge): reset timer when applying active status * feat(edge): add background ping for Edge endpoints * fix(edge): fix infinite loading loop after Edge endpoint connection failure * fix(home): fix an issue with merge * feat(api): remove SnapshotRaw from EndpointList response * feat(api): add pagination for EndpointList operation * feat(api): rename last_id query parameter to start * feat(api): implement filter for EndpointList operation * fix(edge): prevent a pointer issue after removing an active Edge endpoint * feat(home): front - endpoint backend pagination (#2990) * feat(home): endpoint pagination with backend * feat(api): remove default limit value * fix(endpoints): fix a minor issue with column span * fix(endpointgroup-create): fix an issue with endpoint group creation * feat(app): minor loading optimizations * refactor(api): small refactor of EndpointList operation * fix(home): fix minor loading text display issue * refactor(api): document bolt services functions * feat(home): minor optimization * fix(api): replace seek with index scanning for EndpointPaginated * fix(api): fix invalid starting index issue * fix(api): first implementation of working filter * fix(home): endpoints list keeps backend pagination when it needs to * fix(api): endpoint pagination doesn't drop the first item on pages >=2 anymore * fix(home): UI flickering on page/filter load/change * feat(auth): login spinner * feat(api): support searching in associated endpoint group data * refactor(api): remove unused API endpoint * refactor(api): remove comment * refactor(api): refactor proxy manager * feat(api): declare EndpointList params as optional * feat(api): support groupID filter on endpoints route * feat(api): add new API operations endpointGroupAddEndpoint and endpointGroupDeleteEndpoint * feat(edge): new icon for Edge agent endpoint * fix(edge): fix missing exec quick action * fix(edge): add loading indicator when connecting to Edge endpoint * feat(edge): disable service webhooks for Edge endpoints * feat(endpoints): backend pagination for endpoints view (#3004) * feat(edge): dynamic loading for stack migration feature * feat(edge): wordwrap edge key * feat(endpoint-groups): backend pagination support for create and edit * feat(endpoint-groups): debounce on filter for create/edit views * feat(endpoint-groups): filter assigned on create view * (endpoint-groups): unassigned endpoints edit view * refactor(endpoint-groups): code clean * feat(endpoint-groups): remove message for Unassigned group * refactor(websocket): minor refactor associated to Edge agent * feat(endpoint-group): enable backend pagination (#3017) * feat(api): support groupID filter on endpoints route * feat(api): add new API operations endpointGroupAddEndpoint and endpointGroupDeleteEndpoint * feat(endpoint-groups): backend pagination support for create and edit * feat(endpoint-groups): debounce on filter for create/edit views * feat(endpoint-groups): filter assigned on create view * (endpoint-groups): unassigned endpoints edit view * refactor(endpoint-groups): code clean * feat(endpoint-groups): remove message for Unassigned group * refactor(api): endpoint group endpoint association refactor * refactor(api): rename files and remove comments * refactor(api): remove usage of utils * refactor(api): optional parameters * Merge branch 'feat-endpoint-backend-pagination' into edge # Conflicts: # api/bolt/endpoint/endpoint.go # api/http/handler/endpointgroups/endpointgroup_update.go # api/http/handler/endpointgroups/handler.go # api/http/handler/endpoints/endpoint_list.go # app/portainer/services/api/endpointService.js * fix(api): fix default tunnel server credentials * feat(api): update endpointListOperation behavior and parameters * fix(api): fix interface declaration * feat(edge): support configurable Edge agent checkin interval * feat(edge): support dynamic tunnel credentials * feat(edge): update Edge agent deployment commands * style(edge): update Edge agent settings text * refactor(edge): remove unused credentials management methods * feat(edge): associate a remote addr to tunnel credentials * style(edge): update Edge endpoint icon * feat(edge): support encrypted tunnel credentials * fix(edge): fix invalid pointer cast * feat(bolt): decode endpoints with jsoniter * feat(edge): persist reverse tunnel keyseed * refactor(edge): minor refactor * feat(edge): update chisel library usage * refactor(endpoint): use controller function * feat(api): database migration to DBVersion 19 * refactor(api): refactor AddSchedule function * refactor(schedules): remove comment * refactor(api): remove comment * refactor(api): remove comment * feat(api): tunnel manager now only manage Edge endpoints * refactor(api): clean-up and clarification of the Edge service * refactor(api): clean-up and clarification of the Edge service * fix(api): fix an issue with Edge agent snapshots * refactor(api): add missing comments * refactor(api): update constant description * style(home): remove loading text on error * feat(endpoint): remove 15s timeout for ping request * style(home): display information about associated Edge endpoints * feat(home): redirect to endpoint details on click on unassociated Edge endpoint * feat(settings): remove 60s Edge poll frequency option
5 years ago
if err != nil {
return httperror.BadRequest("Invalid environment identifier route variable", err)
}
if cachedResp := handler.respondFromCache(w, r, portainer.EndpointID(endpointID)); cachedResp {
return nil
}
if _, ok := handler.DataStore.Endpoint().Heartbeat(portainer.EndpointID(endpointID)); !ok {
// EE-5190
return httperror.Forbidden("Permission denied to access environment. The device has not been trusted yet", fmt.Errorf("unable to retrieve endpoint heartbeat. Environment ID: %d", endpointID))
}
endpoint, err := handler.DataStore.Endpoint().Endpoint(portainer.EndpointID(endpointID))
if err != nil {
// EE-5190
return httperror.Forbidden("Permission denied to access environment. The device has not been trusted yet", fmt.Errorf("unable to retrieve endpoint from database: %w. Environment ID: %d", err, endpointID))
feat(edge): introduce support for Edge agent (#3031) * feat(edge): fix webconsole and agent deployment command * feat(edge): display agent features when connected to IoT endpoint * feat(edge): add -e CAP_HOST_MANAGEMENT=1 to agent command * feat(edge): add -v /:/host and --name portainer_agent_iot to agent command * style(endpoint-creation): refactor IoT agent to Edge agent * refactor(api): rename AgentIoTEnvironment to AgentEdgeEnvironment * refactor(api): rename AgentIoTEnvironment to AgentEdgeEnvironment * feat(endpoint-creation): update Edge agent deployment instructions * feat(edge): wip edge * feat(edge): refactor key creation * feat(edge): update deployment instructions * feat(home): update Edge agent endpoint item * feat(edge): support dynamic ports * feat(edge): support sleep/wake and snapshots * feat(edge): support offline mode * feat(edge): host job support for Edge endpoints * feat(edge): introduce STANDBY state * feat(edge): update Edge agent deployment command * feat(edge): introduce EDGE_ID support * feat(edge): update default inactivity interval to 5min * feat(edge): reload Edge schedules after restart * fix(edge): fix execution of endpoint job against an Edge endpoint * fix(edge): fix minor issues with scheduling UI/UX * feat(edge): introduce EdgeSchedule version management * feat(edge): switch back to REQUIRED state from ACTIVE on error * refactor(edge): remove comment * feat(edge): updated tunnel status management * feat(edge): fix flickering UI when accessing Edge endpoint from home view * feat(edge): remove STANDBY status * fix(edge): fix an issue with console and Swarm endpoint * fix(edge): fix an issue with stack deployment * fix(edge): reset timer when applying active status * feat(edge): add background ping for Edge endpoints * fix(edge): fix infinite loading loop after Edge endpoint connection failure * fix(home): fix an issue with merge * feat(api): remove SnapshotRaw from EndpointList response * feat(api): add pagination for EndpointList operation * feat(api): rename last_id query parameter to start * feat(api): implement filter for EndpointList operation * fix(edge): prevent a pointer issue after removing an active Edge endpoint * feat(home): front - endpoint backend pagination (#2990) * feat(home): endpoint pagination with backend * feat(api): remove default limit value * fix(endpoints): fix a minor issue with column span * fix(endpointgroup-create): fix an issue with endpoint group creation * feat(app): minor loading optimizations * refactor(api): small refactor of EndpointList operation * fix(home): fix minor loading text display issue * refactor(api): document bolt services functions * feat(home): minor optimization * fix(api): replace seek with index scanning for EndpointPaginated * fix(api): fix invalid starting index issue * fix(api): first implementation of working filter * fix(home): endpoints list keeps backend pagination when it needs to * fix(api): endpoint pagination doesn't drop the first item on pages >=2 anymore * fix(home): UI flickering on page/filter load/change * feat(auth): login spinner * feat(api): support searching in associated endpoint group data * refactor(api): remove unused API endpoint * refactor(api): remove comment * refactor(api): refactor proxy manager * feat(api): declare EndpointList params as optional * feat(api): support groupID filter on endpoints route * feat(api): add new API operations endpointGroupAddEndpoint and endpointGroupDeleteEndpoint * feat(edge): new icon for Edge agent endpoint * fix(edge): fix missing exec quick action * fix(edge): add loading indicator when connecting to Edge endpoint * feat(edge): disable service webhooks for Edge endpoints * feat(endpoints): backend pagination for endpoints view (#3004) * feat(edge): dynamic loading for stack migration feature * feat(edge): wordwrap edge key * feat(endpoint-groups): backend pagination support for create and edit * feat(endpoint-groups): debounce on filter for create/edit views * feat(endpoint-groups): filter assigned on create view * (endpoint-groups): unassigned endpoints edit view * refactor(endpoint-groups): code clean * feat(endpoint-groups): remove message for Unassigned group * refactor(websocket): minor refactor associated to Edge agent * feat(endpoint-group): enable backend pagination (#3017) * feat(api): support groupID filter on endpoints route * feat(api): add new API operations endpointGroupAddEndpoint and endpointGroupDeleteEndpoint * feat(endpoint-groups): backend pagination support for create and edit * feat(endpoint-groups): debounce on filter for create/edit views * feat(endpoint-groups): filter assigned on create view * (endpoint-groups): unassigned endpoints edit view * refactor(endpoint-groups): code clean * feat(endpoint-groups): remove message for Unassigned group * refactor(api): endpoint group endpoint association refactor * refactor(api): rename files and remove comments * refactor(api): remove usage of utils * refactor(api): optional parameters * Merge branch 'feat-endpoint-backend-pagination' into edge # Conflicts: # api/bolt/endpoint/endpoint.go # api/http/handler/endpointgroups/endpointgroup_update.go # api/http/handler/endpointgroups/handler.go # api/http/handler/endpoints/endpoint_list.go # app/portainer/services/api/endpointService.js * fix(api): fix default tunnel server credentials * feat(api): update endpointListOperation behavior and parameters * fix(api): fix interface declaration * feat(edge): support configurable Edge agent checkin interval * feat(edge): support dynamic tunnel credentials * feat(edge): update Edge agent deployment commands * style(edge): update Edge agent settings text * refactor(edge): remove unused credentials management methods * feat(edge): associate a remote addr to tunnel credentials * style(edge): update Edge endpoint icon * feat(edge): support encrypted tunnel credentials * fix(edge): fix invalid pointer cast * feat(bolt): decode endpoints with jsoniter * feat(edge): persist reverse tunnel keyseed * refactor(edge): minor refactor * feat(edge): update chisel library usage * refactor(endpoint): use controller function * feat(api): database migration to DBVersion 19 * refactor(api): refactor AddSchedule function * refactor(schedules): remove comment * refactor(api): remove comment * refactor(api): remove comment * feat(api): tunnel manager now only manage Edge endpoints * refactor(api): clean-up and clarification of the Edge service * refactor(api): clean-up and clarification of the Edge service * fix(api): fix an issue with Edge agent snapshots * refactor(api): add missing comments * refactor(api): update constant description * style(home): remove loading text on error * feat(endpoint): remove 15s timeout for ping request * style(home): display information about associated Edge endpoints * feat(home): redirect to endpoint details on click on unassociated Edge endpoint * feat(settings): remove 60s Edge poll frequency option
5 years ago
}
firstConn := endpoint.LastCheckInDate == 0
if err := handler.requestBouncer.AuthorizedEdgeEndpointOperation(r, endpoint); err != nil {
return httperror.Forbidden("Permission denied to access environment. The device has not been trusted yet", fmt.Errorf("unauthorized Edge endpoint operation: %w. Environment name: %s", err, endpoint.Name))
feat(edge): introduce support for Edge agent (#3031) * feat(edge): fix webconsole and agent deployment command * feat(edge): display agent features when connected to IoT endpoint * feat(edge): add -e CAP_HOST_MANAGEMENT=1 to agent command * feat(edge): add -v /:/host and --name portainer_agent_iot to agent command * style(endpoint-creation): refactor IoT agent to Edge agent * refactor(api): rename AgentIoTEnvironment to AgentEdgeEnvironment * refactor(api): rename AgentIoTEnvironment to AgentEdgeEnvironment * feat(endpoint-creation): update Edge agent deployment instructions * feat(edge): wip edge * feat(edge): refactor key creation * feat(edge): update deployment instructions * feat(home): update Edge agent endpoint item * feat(edge): support dynamic ports * feat(edge): support sleep/wake and snapshots * feat(edge): support offline mode * feat(edge): host job support for Edge endpoints * feat(edge): introduce STANDBY state * feat(edge): update Edge agent deployment command * feat(edge): introduce EDGE_ID support * feat(edge): update default inactivity interval to 5min * feat(edge): reload Edge schedules after restart * fix(edge): fix execution of endpoint job against an Edge endpoint * fix(edge): fix minor issues with scheduling UI/UX * feat(edge): introduce EdgeSchedule version management * feat(edge): switch back to REQUIRED state from ACTIVE on error * refactor(edge): remove comment * feat(edge): updated tunnel status management * feat(edge): fix flickering UI when accessing Edge endpoint from home view * feat(edge): remove STANDBY status * fix(edge): fix an issue with console and Swarm endpoint * fix(edge): fix an issue with stack deployment * fix(edge): reset timer when applying active status * feat(edge): add background ping for Edge endpoints * fix(edge): fix infinite loading loop after Edge endpoint connection failure * fix(home): fix an issue with merge * feat(api): remove SnapshotRaw from EndpointList response * feat(api): add pagination for EndpointList operation * feat(api): rename last_id query parameter to start * feat(api): implement filter for EndpointList operation * fix(edge): prevent a pointer issue after removing an active Edge endpoint * feat(home): front - endpoint backend pagination (#2990) * feat(home): endpoint pagination with backend * feat(api): remove default limit value * fix(endpoints): fix a minor issue with column span * fix(endpointgroup-create): fix an issue with endpoint group creation * feat(app): minor loading optimizations * refactor(api): small refactor of EndpointList operation * fix(home): fix minor loading text display issue * refactor(api): document bolt services functions * feat(home): minor optimization * fix(api): replace seek with index scanning for EndpointPaginated * fix(api): fix invalid starting index issue * fix(api): first implementation of working filter * fix(home): endpoints list keeps backend pagination when it needs to * fix(api): endpoint pagination doesn't drop the first item on pages >=2 anymore * fix(home): UI flickering on page/filter load/change * feat(auth): login spinner * feat(api): support searching in associated endpoint group data * refactor(api): remove unused API endpoint * refactor(api): remove comment * refactor(api): refactor proxy manager * feat(api): declare EndpointList params as optional * feat(api): support groupID filter on endpoints route * feat(api): add new API operations endpointGroupAddEndpoint and endpointGroupDeleteEndpoint * feat(edge): new icon for Edge agent endpoint * fix(edge): fix missing exec quick action * fix(edge): add loading indicator when connecting to Edge endpoint * feat(edge): disable service webhooks for Edge endpoints * feat(endpoints): backend pagination for endpoints view (#3004) * feat(edge): dynamic loading for stack migration feature * feat(edge): wordwrap edge key * feat(endpoint-groups): backend pagination support for create and edit * feat(endpoint-groups): debounce on filter for create/edit views * feat(endpoint-groups): filter assigned on create view * (endpoint-groups): unassigned endpoints edit view * refactor(endpoint-groups): code clean * feat(endpoint-groups): remove message for Unassigned group * refactor(websocket): minor refactor associated to Edge agent * feat(endpoint-group): enable backend pagination (#3017) * feat(api): support groupID filter on endpoints route * feat(api): add new API operations endpointGroupAddEndpoint and endpointGroupDeleteEndpoint * feat(endpoint-groups): backend pagination support for create and edit * feat(endpoint-groups): debounce on filter for create/edit views * feat(endpoint-groups): filter assigned on create view * (endpoint-groups): unassigned endpoints edit view * refactor(endpoint-groups): code clean * feat(endpoint-groups): remove message for Unassigned group * refactor(api): endpoint group endpoint association refactor * refactor(api): rename files and remove comments * refactor(api): remove usage of utils * refactor(api): optional parameters * Merge branch 'feat-endpoint-backend-pagination' into edge # Conflicts: # api/bolt/endpoint/endpoint.go # api/http/handler/endpointgroups/endpointgroup_update.go # api/http/handler/endpointgroups/handler.go # api/http/handler/endpoints/endpoint_list.go # app/portainer/services/api/endpointService.js * fix(api): fix default tunnel server credentials * feat(api): update endpointListOperation behavior and parameters * fix(api): fix interface declaration * feat(edge): support configurable Edge agent checkin interval * feat(edge): support dynamic tunnel credentials * feat(edge): update Edge agent deployment commands * style(edge): update Edge agent settings text * refactor(edge): remove unused credentials management methods * feat(edge): associate a remote addr to tunnel credentials * style(edge): update Edge endpoint icon * feat(edge): support encrypted tunnel credentials * fix(edge): fix invalid pointer cast * feat(bolt): decode endpoints with jsoniter * feat(edge): persist reverse tunnel keyseed * refactor(edge): minor refactor * feat(edge): update chisel library usage * refactor(endpoint): use controller function * feat(api): database migration to DBVersion 19 * refactor(api): refactor AddSchedule function * refactor(schedules): remove comment * refactor(api): remove comment * refactor(api): remove comment * feat(api): tunnel manager now only manage Edge endpoints * refactor(api): clean-up and clarification of the Edge service * refactor(api): clean-up and clarification of the Edge service * fix(api): fix an issue with Edge agent snapshots * refactor(api): add missing comments * refactor(api): update constant description * style(home): remove loading text on error * feat(endpoint): remove 15s timeout for ping request * style(home): display information about associated Edge endpoints * feat(home): redirect to endpoint details on click on unassociated Edge endpoint * feat(settings): remove 60s Edge poll frequency option
5 years ago
}
handler.DataStore.Endpoint().UpdateHeartbeat(endpoint.ID)
if err := handler.requestBouncer.TrustedEdgeEnvironmentAccess(handler.DataStore, endpoint); err != nil {
return httperror.Forbidden("Permission denied to access environment. The device has not been trusted yet", fmt.Errorf("untrusted Edge environment access: %w. Environment name: %s", err, endpoint.Name))
}
var statusResponse *endpointEdgeStatusInspectResponse
if err := handler.DataStore.UpdateTx(func(tx dataservices.DataStoreTx) error {
statusResponse, err = handler.inspectStatus(tx, r, portainer.EndpointID(endpointID), firstConn)
return err
}); err != nil {
var httpErr *httperror.HandlerError
if errors.As(err, &httpErr) {
httpErr.Err = fmt.Errorf("edge polling error: %w. Environment name: %s", httpErr.Err, endpoint.Name)
return httpErr
}
return httperror.InternalServerError("Unexpected error", fmt.Errorf("edge polling error: %w. Environment name: %s", err, endpoint.Name))
}
return cacheResponse(w, endpoint.ID, *statusResponse)
}
func (handler *Handler) parseHeaders(r *http.Request, endpoint *portainer.Endpoint) error {
endpoint.EdgeID = cmp.Or(endpoint.EdgeID, r.Header.Get(portainer.PortainerAgentEdgeIDHeader))
agentPlatform, agentPlatformErr := parseAgentPlatform(r)
if agentPlatformErr != nil {
return httperror.BadRequest("agent platform header is not valid", agentPlatformErr)
}
endpoint.Type = agentPlatform
version := r.Header.Get(portainer.PortainerAgentHeader)
endpoint.Agent.Version = version
return nil
}
func (handler *Handler) inspectStatus(tx dataservices.DataStoreTx, r *http.Request, endpointID portainer.EndpointID, firstConn bool) (*endpointEdgeStatusInspectResponse, error) {
endpoint, err := tx.Endpoint().Endpoint(endpointID)
if err != nil {
return nil, err
}
if err := handler.parseHeaders(r, endpoint); err != nil {
return nil, err
}
feat(edge): introduce support for Edge agent (#3031) * feat(edge): fix webconsole and agent deployment command * feat(edge): display agent features when connected to IoT endpoint * feat(edge): add -e CAP_HOST_MANAGEMENT=1 to agent command * feat(edge): add -v /:/host and --name portainer_agent_iot to agent command * style(endpoint-creation): refactor IoT agent to Edge agent * refactor(api): rename AgentIoTEnvironment to AgentEdgeEnvironment * refactor(api): rename AgentIoTEnvironment to AgentEdgeEnvironment * feat(endpoint-creation): update Edge agent deployment instructions * feat(edge): wip edge * feat(edge): refactor key creation * feat(edge): update deployment instructions * feat(home): update Edge agent endpoint item * feat(edge): support dynamic ports * feat(edge): support sleep/wake and snapshots * feat(edge): support offline mode * feat(edge): host job support for Edge endpoints * feat(edge): introduce STANDBY state * feat(edge): update Edge agent deployment command * feat(edge): introduce EDGE_ID support * feat(edge): update default inactivity interval to 5min * feat(edge): reload Edge schedules after restart * fix(edge): fix execution of endpoint job against an Edge endpoint * fix(edge): fix minor issues with scheduling UI/UX * feat(edge): introduce EdgeSchedule version management * feat(edge): switch back to REQUIRED state from ACTIVE on error * refactor(edge): remove comment * feat(edge): updated tunnel status management * feat(edge): fix flickering UI when accessing Edge endpoint from home view * feat(edge): remove STANDBY status * fix(edge): fix an issue with console and Swarm endpoint * fix(edge): fix an issue with stack deployment * fix(edge): reset timer when applying active status * feat(edge): add background ping for Edge endpoints * fix(edge): fix infinite loading loop after Edge endpoint connection failure * fix(home): fix an issue with merge * feat(api): remove SnapshotRaw from EndpointList response * feat(api): add pagination for EndpointList operation * feat(api): rename last_id query parameter to start * feat(api): implement filter for EndpointList operation * fix(edge): prevent a pointer issue after removing an active Edge endpoint * feat(home): front - endpoint backend pagination (#2990) * feat(home): endpoint pagination with backend * feat(api): remove default limit value * fix(endpoints): fix a minor issue with column span * fix(endpointgroup-create): fix an issue with endpoint group creation * feat(app): minor loading optimizations * refactor(api): small refactor of EndpointList operation * fix(home): fix minor loading text display issue * refactor(api): document bolt services functions * feat(home): minor optimization * fix(api): replace seek with index scanning for EndpointPaginated * fix(api): fix invalid starting index issue * fix(api): first implementation of working filter * fix(home): endpoints list keeps backend pagination when it needs to * fix(api): endpoint pagination doesn't drop the first item on pages >=2 anymore * fix(home): UI flickering on page/filter load/change * feat(auth): login spinner * feat(api): support searching in associated endpoint group data * refactor(api): remove unused API endpoint * refactor(api): remove comment * refactor(api): refactor proxy manager * feat(api): declare EndpointList params as optional * feat(api): support groupID filter on endpoints route * feat(api): add new API operations endpointGroupAddEndpoint and endpointGroupDeleteEndpoint * feat(edge): new icon for Edge agent endpoint * fix(edge): fix missing exec quick action * fix(edge): add loading indicator when connecting to Edge endpoint * feat(edge): disable service webhooks for Edge endpoints * feat(endpoints): backend pagination for endpoints view (#3004) * feat(edge): dynamic loading for stack migration feature * feat(edge): wordwrap edge key * feat(endpoint-groups): backend pagination support for create and edit * feat(endpoint-groups): debounce on filter for create/edit views * feat(endpoint-groups): filter assigned on create view * (endpoint-groups): unassigned endpoints edit view * refactor(endpoint-groups): code clean * feat(endpoint-groups): remove message for Unassigned group * refactor(websocket): minor refactor associated to Edge agent * feat(endpoint-group): enable backend pagination (#3017) * feat(api): support groupID filter on endpoints route * feat(api): add new API operations endpointGroupAddEndpoint and endpointGroupDeleteEndpoint * feat(endpoint-groups): backend pagination support for create and edit * feat(endpoint-groups): debounce on filter for create/edit views * feat(endpoint-groups): filter assigned on create view * (endpoint-groups): unassigned endpoints edit view * refactor(endpoint-groups): code clean * feat(endpoint-groups): remove message for Unassigned group * refactor(api): endpoint group endpoint association refactor * refactor(api): rename files and remove comments * refactor(api): remove usage of utils * refactor(api): optional parameters * Merge branch 'feat-endpoint-backend-pagination' into edge # Conflicts: # api/bolt/endpoint/endpoint.go # api/http/handler/endpointgroups/endpointgroup_update.go # api/http/handler/endpointgroups/handler.go # api/http/handler/endpoints/endpoint_list.go # app/portainer/services/api/endpointService.js * fix(api): fix default tunnel server credentials * feat(api): update endpointListOperation behavior and parameters * fix(api): fix interface declaration * feat(edge): support configurable Edge agent checkin interval * feat(edge): support dynamic tunnel credentials * feat(edge): update Edge agent deployment commands * style(edge): update Edge agent settings text * refactor(edge): remove unused credentials management methods * feat(edge): associate a remote addr to tunnel credentials * style(edge): update Edge endpoint icon * feat(edge): support encrypted tunnel credentials * fix(edge): fix invalid pointer cast * feat(bolt): decode endpoints with jsoniter * feat(edge): persist reverse tunnel keyseed * refactor(edge): minor refactor * feat(edge): update chisel library usage * refactor(endpoint): use controller function * feat(api): database migration to DBVersion 19 * refactor(api): refactor AddSchedule function * refactor(schedules): remove comment * refactor(api): remove comment * refactor(api): remove comment * feat(api): tunnel manager now only manage Edge endpoints * refactor(api): clean-up and clarification of the Edge service * refactor(api): clean-up and clarification of the Edge service * fix(api): fix an issue with Edge agent snapshots * refactor(api): add missing comments * refactor(api): update constant description * style(home): remove loading text on error * feat(endpoint): remove 15s timeout for ping request * style(home): display information about associated Edge endpoints * feat(home): redirect to endpoint details on click on unassociated Edge endpoint * feat(settings): remove 60s Edge poll frequency option
5 years ago
// Take an initial snapshot
if firstConn {
if err := handler.ReverseTunnelService.Open(endpoint); err != nil {
log.Error().Err(err).Msg("could not open the tunnel")
}
}
endpoint.LastCheckInDate = time.Now().Unix()
if err := tx.Endpoint().UpdateEndpoint(endpoint.ID, endpoint); err != nil {
return nil, httperror.InternalServerError("Unable to persist environment changes inside the database", err)
}
tunnel := handler.ReverseTunnelService.Config(endpoint.ID)
statusResponse := endpointEdgeStatusInspectResponse{
Status: tunnel.Status,
Port: tunnel.Port,
CheckinInterval: edge.EffectiveCheckinInterval(tx, endpoint),
Credentials: tunnel.Credentials,
}
schedules, handlerErr := handler.buildSchedules(tx, endpoint.ID)
if handlerErr != nil {
return nil, handlerErr
}
statusResponse.Schedules = schedules
edgeStacksStatus, handlerErr := handler.buildEdgeStacks(tx, endpoint.ID)
if handlerErr != nil {
return nil, handlerErr
}
statusResponse.Stacks = edgeStacksStatus
return &statusResponse, nil
}
func parseAgentPlatform(r *http.Request) (portainer.EndpointType, error) {
agentPlatformHeader := r.Header.Get(portainer.HTTPResponseAgentPlatform)
if agentPlatformHeader == "" {
return 0, errors.New("agent platform header is missing")
}
agentPlatformNumber, err := strconv.Atoi(agentPlatformHeader)
if err != nil {
return 0, err
feat(edge): introduce support for Edge agent (#3031) * feat(edge): fix webconsole and agent deployment command * feat(edge): display agent features when connected to IoT endpoint * feat(edge): add -e CAP_HOST_MANAGEMENT=1 to agent command * feat(edge): add -v /:/host and --name portainer_agent_iot to agent command * style(endpoint-creation): refactor IoT agent to Edge agent * refactor(api): rename AgentIoTEnvironment to AgentEdgeEnvironment * refactor(api): rename AgentIoTEnvironment to AgentEdgeEnvironment * feat(endpoint-creation): update Edge agent deployment instructions * feat(edge): wip edge * feat(edge): refactor key creation * feat(edge): update deployment instructions * feat(home): update Edge agent endpoint item * feat(edge): support dynamic ports * feat(edge): support sleep/wake and snapshots * feat(edge): support offline mode * feat(edge): host job support for Edge endpoints * feat(edge): introduce STANDBY state * feat(edge): update Edge agent deployment command * feat(edge): introduce EDGE_ID support * feat(edge): update default inactivity interval to 5min * feat(edge): reload Edge schedules after restart * fix(edge): fix execution of endpoint job against an Edge endpoint * fix(edge): fix minor issues with scheduling UI/UX * feat(edge): introduce EdgeSchedule version management * feat(edge): switch back to REQUIRED state from ACTIVE on error * refactor(edge): remove comment * feat(edge): updated tunnel status management * feat(edge): fix flickering UI when accessing Edge endpoint from home view * feat(edge): remove STANDBY status * fix(edge): fix an issue with console and Swarm endpoint * fix(edge): fix an issue with stack deployment * fix(edge): reset timer when applying active status * feat(edge): add background ping for Edge endpoints * fix(edge): fix infinite loading loop after Edge endpoint connection failure * fix(home): fix an issue with merge * feat(api): remove SnapshotRaw from EndpointList response * feat(api): add pagination for EndpointList operation * feat(api): rename last_id query parameter to start * feat(api): implement filter for EndpointList operation * fix(edge): prevent a pointer issue after removing an active Edge endpoint * feat(home): front - endpoint backend pagination (#2990) * feat(home): endpoint pagination with backend * feat(api): remove default limit value * fix(endpoints): fix a minor issue with column span * fix(endpointgroup-create): fix an issue with endpoint group creation * feat(app): minor loading optimizations * refactor(api): small refactor of EndpointList operation * fix(home): fix minor loading text display issue * refactor(api): document bolt services functions * feat(home): minor optimization * fix(api): replace seek with index scanning for EndpointPaginated * fix(api): fix invalid starting index issue * fix(api): first implementation of working filter * fix(home): endpoints list keeps backend pagination when it needs to * fix(api): endpoint pagination doesn't drop the first item on pages >=2 anymore * fix(home): UI flickering on page/filter load/change * feat(auth): login spinner * feat(api): support searching in associated endpoint group data * refactor(api): remove unused API endpoint * refactor(api): remove comment * refactor(api): refactor proxy manager * feat(api): declare EndpointList params as optional * feat(api): support groupID filter on endpoints route * feat(api): add new API operations endpointGroupAddEndpoint and endpointGroupDeleteEndpoint * feat(edge): new icon for Edge agent endpoint * fix(edge): fix missing exec quick action * fix(edge): add loading indicator when connecting to Edge endpoint * feat(edge): disable service webhooks for Edge endpoints * feat(endpoints): backend pagination for endpoints view (#3004) * feat(edge): dynamic loading for stack migration feature * feat(edge): wordwrap edge key * feat(endpoint-groups): backend pagination support for create and edit * feat(endpoint-groups): debounce on filter for create/edit views * feat(endpoint-groups): filter assigned on create view * (endpoint-groups): unassigned endpoints edit view * refactor(endpoint-groups): code clean * feat(endpoint-groups): remove message for Unassigned group * refactor(websocket): minor refactor associated to Edge agent * feat(endpoint-group): enable backend pagination (#3017) * feat(api): support groupID filter on endpoints route * feat(api): add new API operations endpointGroupAddEndpoint and endpointGroupDeleteEndpoint * feat(endpoint-groups): backend pagination support for create and edit * feat(endpoint-groups): debounce on filter for create/edit views * feat(endpoint-groups): filter assigned on create view * (endpoint-groups): unassigned endpoints edit view * refactor(endpoint-groups): code clean * feat(endpoint-groups): remove message for Unassigned group * refactor(api): endpoint group endpoint association refactor * refactor(api): rename files and remove comments * refactor(api): remove usage of utils * refactor(api): optional parameters * Merge branch 'feat-endpoint-backend-pagination' into edge # Conflicts: # api/bolt/endpoint/endpoint.go # api/http/handler/endpointgroups/endpointgroup_update.go # api/http/handler/endpointgroups/handler.go # api/http/handler/endpoints/endpoint_list.go # app/portainer/services/api/endpointService.js * fix(api): fix default tunnel server credentials * feat(api): update endpointListOperation behavior and parameters * fix(api): fix interface declaration * feat(edge): support configurable Edge agent checkin interval * feat(edge): support dynamic tunnel credentials * feat(edge): update Edge agent deployment commands * style(edge): update Edge agent settings text * refactor(edge): remove unused credentials management methods * feat(edge): associate a remote addr to tunnel credentials * style(edge): update Edge endpoint icon * feat(edge): support encrypted tunnel credentials * fix(edge): fix invalid pointer cast * feat(bolt): decode endpoints with jsoniter * feat(edge): persist reverse tunnel keyseed * refactor(edge): minor refactor * feat(edge): update chisel library usage * refactor(endpoint): use controller function * feat(api): database migration to DBVersion 19 * refactor(api): refactor AddSchedule function * refactor(schedules): remove comment * refactor(api): remove comment * refactor(api): remove comment * feat(api): tunnel manager now only manage Edge endpoints * refactor(api): clean-up and clarification of the Edge service * refactor(api): clean-up and clarification of the Edge service * fix(api): fix an issue with Edge agent snapshots * refactor(api): add missing comments * refactor(api): update constant description * style(home): remove loading text on error * feat(endpoint): remove 15s timeout for ping request * style(home): display information about associated Edge endpoints * feat(home): redirect to endpoint details on click on unassociated Edge endpoint * feat(settings): remove 60s Edge poll frequency option
5 years ago
}
agentPlatform := portainer.AgentPlatform(agentPlatformNumber)
feat(edge): introduce support for Edge agent (#3031) * feat(edge): fix webconsole and agent deployment command * feat(edge): display agent features when connected to IoT endpoint * feat(edge): add -e CAP_HOST_MANAGEMENT=1 to agent command * feat(edge): add -v /:/host and --name portainer_agent_iot to agent command * style(endpoint-creation): refactor IoT agent to Edge agent * refactor(api): rename AgentIoTEnvironment to AgentEdgeEnvironment * refactor(api): rename AgentIoTEnvironment to AgentEdgeEnvironment * feat(endpoint-creation): update Edge agent deployment instructions * feat(edge): wip edge * feat(edge): refactor key creation * feat(edge): update deployment instructions * feat(home): update Edge agent endpoint item * feat(edge): support dynamic ports * feat(edge): support sleep/wake and snapshots * feat(edge): support offline mode * feat(edge): host job support for Edge endpoints * feat(edge): introduce STANDBY state * feat(edge): update Edge agent deployment command * feat(edge): introduce EDGE_ID support * feat(edge): update default inactivity interval to 5min * feat(edge): reload Edge schedules after restart * fix(edge): fix execution of endpoint job against an Edge endpoint * fix(edge): fix minor issues with scheduling UI/UX * feat(edge): introduce EdgeSchedule version management * feat(edge): switch back to REQUIRED state from ACTIVE on error * refactor(edge): remove comment * feat(edge): updated tunnel status management * feat(edge): fix flickering UI when accessing Edge endpoint from home view * feat(edge): remove STANDBY status * fix(edge): fix an issue with console and Swarm endpoint * fix(edge): fix an issue with stack deployment * fix(edge): reset timer when applying active status * feat(edge): add background ping for Edge endpoints * fix(edge): fix infinite loading loop after Edge endpoint connection failure * fix(home): fix an issue with merge * feat(api): remove SnapshotRaw from EndpointList response * feat(api): add pagination for EndpointList operation * feat(api): rename last_id query parameter to start * feat(api): implement filter for EndpointList operation * fix(edge): prevent a pointer issue after removing an active Edge endpoint * feat(home): front - endpoint backend pagination (#2990) * feat(home): endpoint pagination with backend * feat(api): remove default limit value * fix(endpoints): fix a minor issue with column span * fix(endpointgroup-create): fix an issue with endpoint group creation * feat(app): minor loading optimizations * refactor(api): small refactor of EndpointList operation * fix(home): fix minor loading text display issue * refactor(api): document bolt services functions * feat(home): minor optimization * fix(api): replace seek with index scanning for EndpointPaginated * fix(api): fix invalid starting index issue * fix(api): first implementation of working filter * fix(home): endpoints list keeps backend pagination when it needs to * fix(api): endpoint pagination doesn't drop the first item on pages >=2 anymore * fix(home): UI flickering on page/filter load/change * feat(auth): login spinner * feat(api): support searching in associated endpoint group data * refactor(api): remove unused API endpoint * refactor(api): remove comment * refactor(api): refactor proxy manager * feat(api): declare EndpointList params as optional * feat(api): support groupID filter on endpoints route * feat(api): add new API operations endpointGroupAddEndpoint and endpointGroupDeleteEndpoint * feat(edge): new icon for Edge agent endpoint * fix(edge): fix missing exec quick action * fix(edge): add loading indicator when connecting to Edge endpoint * feat(edge): disable service webhooks for Edge endpoints * feat(endpoints): backend pagination for endpoints view (#3004) * feat(edge): dynamic loading for stack migration feature * feat(edge): wordwrap edge key * feat(endpoint-groups): backend pagination support for create and edit * feat(endpoint-groups): debounce on filter for create/edit views * feat(endpoint-groups): filter assigned on create view * (endpoint-groups): unassigned endpoints edit view * refactor(endpoint-groups): code clean * feat(endpoint-groups): remove message for Unassigned group * refactor(websocket): minor refactor associated to Edge agent * feat(endpoint-group): enable backend pagination (#3017) * feat(api): support groupID filter on endpoints route * feat(api): add new API operations endpointGroupAddEndpoint and endpointGroupDeleteEndpoint * feat(endpoint-groups): backend pagination support for create and edit * feat(endpoint-groups): debounce on filter for create/edit views * feat(endpoint-groups): filter assigned on create view * (endpoint-groups): unassigned endpoints edit view * refactor(endpoint-groups): code clean * feat(endpoint-groups): remove message for Unassigned group * refactor(api): endpoint group endpoint association refactor * refactor(api): rename files and remove comments * refactor(api): remove usage of utils * refactor(api): optional parameters * Merge branch 'feat-endpoint-backend-pagination' into edge # Conflicts: # api/bolt/endpoint/endpoint.go # api/http/handler/endpointgroups/endpointgroup_update.go # api/http/handler/endpointgroups/handler.go # api/http/handler/endpoints/endpoint_list.go # app/portainer/services/api/endpointService.js * fix(api): fix default tunnel server credentials * feat(api): update endpointListOperation behavior and parameters * fix(api): fix interface declaration * feat(edge): support configurable Edge agent checkin interval * feat(edge): support dynamic tunnel credentials * feat(edge): update Edge agent deployment commands * style(edge): update Edge agent settings text * refactor(edge): remove unused credentials management methods * feat(edge): associate a remote addr to tunnel credentials * style(edge): update Edge endpoint icon * feat(edge): support encrypted tunnel credentials * fix(edge): fix invalid pointer cast * feat(bolt): decode endpoints with jsoniter * feat(edge): persist reverse tunnel keyseed * refactor(edge): minor refactor * feat(edge): update chisel library usage * refactor(endpoint): use controller function * feat(api): database migration to DBVersion 19 * refactor(api): refactor AddSchedule function * refactor(schedules): remove comment * refactor(api): remove comment * refactor(api): remove comment * feat(api): tunnel manager now only manage Edge endpoints * refactor(api): clean-up and clarification of the Edge service * refactor(api): clean-up and clarification of the Edge service * fix(api): fix an issue with Edge agent snapshots * refactor(api): add missing comments * refactor(api): update constant description * style(home): remove loading text on error * feat(endpoint): remove 15s timeout for ping request * style(home): display information about associated Edge endpoints * feat(home): redirect to endpoint details on click on unassociated Edge endpoint * feat(settings): remove 60s Edge poll frequency option
5 years ago
switch agentPlatform {
case portainer.AgentPlatformDocker:
return portainer.EdgeAgentOnDockerEnvironment, nil
case portainer.AgentPlatformKubernetes:
return portainer.EdgeAgentOnKubernetesEnvironment, nil
default:
return 0, fmt.Errorf("agent platform %v is not valid", agentPlatform)
}
}
func (handler *Handler) buildSchedules(tx dataservices.DataStoreTx, endpointID portainer.EndpointID) ([]edgeJobResponse, *httperror.HandlerError) {
feat(edge-compute): move host jobs to edge (#3840) * feat(endpoints): create an associated endpoints selector * feat(schedules): remove edge specific explanations * refactor(schedule): replace multi-endpoint-selector * refactor(schedule): move controller to single file * refactor(endpoints): remove multi-endpoint-selector * feat(edge): rename host jobs to edge jobs * feat(edge-jobs): remove edge warning * refactor(edge-jobs): move schedule pages to edge * refactor(edge-jobs): mv views to edgeJobs * refactor(edge-jobs): rename edge jobs * refactor(edge-jobs): move services to edge * refactor(edge-jobs): move tasks datatable * fix(edge-jobs): fix import * fix(edge-jobs): use right services * feat(settings): adjust host management description * feat(edge-jobs): introduce interfaces and types * feat(edge-jobs): implement bolt service * refactor(edge-jobs): replace schedule routes * refactor(edge-job): replace Schedule service * refactor(edge-jobs): remove job_script_exec * refactor(host): remove jobs table * feat(edge-jobs): replace schedule * feat(edge-jobs): load file on inspect * fix(edge-job): parse cron correctly * feat(edge-jobs): show tasks * feat(host): rename tooltip * refactor(host): remove old components * refactor(main): remove schedule types * refactor(snapshot): replace job service with snapshot service * refactor(jobs): remove jobs form and datatable * feat(edge-jobs): create db migration * fix(main): start snapshot service with correct interval * feat(settings): change host tooltip * feat(edge-jobs): load endpoints * fix(edge-job): disable form submit when form is invalid * refactor(edge-compute): use const * refactor(edge-jobs): use generic controller * refactor(edge-jobs): replace $scope with controllerAs * refactor(edge-jobs): replace routes with components * refactor(edge-jobs): replace functions with classes * refactor(edge-jobs): use async/await * refactor(edge-jobs): rename functions * feat(edge-jobs): introduce beta panel * feat(edge-jobs): allow single character names * fix(snapshot): run snapshot in coroutine * feat(edge-jobs): add logs status * feat(filesystem): add edge job logs methods * feat(edge-jobs): intoduce edge jobs tasks api * feat(edge-jobs): remove schedule task model * fix(fs): build edge job task file path * fix(edge-jobs): update task meta * fix(edge-jobs): return a list of endpoints * feat(edge-jobs): update logs from agent * feat(edge-jobs): collect logs * feat(edge-jobs): rename url * feat(edge-jobs): refresh to same tab * feat(edge-jobs): remove old info * refactor(edge-jobs): rename script path json * fix(edge-job): save file before adding job * feat(edge-job): show retrieving logs label * feat(edge-job): replace cron with 5 places * refactor(edge-jobs): replace tasks with results * feat(edge-jobs): add auto refresh until logs are collected * feat(edge-jobs): fix column size * feat(edge-job): display editor * feat(edge-job): add name validation * feat(edge-job): set default time for 1 hour from now * feat(edge-job): add validation for cron format * feat(edge-job): add a note about timezone * fix(edge-job): replace regex * fix(edge-job): check for every minute cron * style(edge-jobs): add reference for cron regex * refactor(edge-jobs): rename migration name * refactor(edge-job): rename edge job response * refactor(snapshot): rename snapshot endpoint method * refactor(edge-jobs): move tasks handler to edgejobs * feat(security): introduce a middleware for edge compute operations * feat(edge-job): use edge compute middleware * feat(edge-groups): filter http actions based on edge setting * fix(security): return from edge bouncer if failed * feat(edge-stacks): filter http actions based on edge setting * feat(edge-groups): show error when failed to load groups * refactor(db): remove edge-jobs migration * refactor(migrator): remove unused dependency Co-authored-by: Anthony Lapenna <lapenna.anthony@gmail.com>
4 years ago
schedules := []edgeJobResponse{}
edgeJobs, err := tx.EdgeJob().ReadAll()
if err != nil {
return nil, httperror.InternalServerError("Unable to retrieve Edge Jobs", err)
}
for _, job := range edgeJobs {
_, endpointHasJob := job.Endpoints[endpointID]
if !endpointHasJob {
for _, edgeGroupID := range job.EdgeGroups {
member, _, err := edge.EndpointInEdgeGroup(tx, endpointID, edgeGroupID)
if err != nil {
return nil, httperror.InternalServerError("Unable to retrieve relations", err)
} else if member {
endpointHasJob = true
break
}
}
}
if !endpointHasJob {
continue
}
var collectLogs bool
if _, ok := job.GroupLogsCollection[endpointID]; ok {
collectLogs = job.GroupLogsCollection[endpointID].CollectLogs
} else {
collectLogs = job.Endpoints[endpointID].CollectLogs
}
feat(edge-compute): move host jobs to edge (#3840) * feat(endpoints): create an associated endpoints selector * feat(schedules): remove edge specific explanations * refactor(schedule): replace multi-endpoint-selector * refactor(schedule): move controller to single file * refactor(endpoints): remove multi-endpoint-selector * feat(edge): rename host jobs to edge jobs * feat(edge-jobs): remove edge warning * refactor(edge-jobs): move schedule pages to edge * refactor(edge-jobs): mv views to edgeJobs * refactor(edge-jobs): rename edge jobs * refactor(edge-jobs): move services to edge * refactor(edge-jobs): move tasks datatable * fix(edge-jobs): fix import * fix(edge-jobs): use right services * feat(settings): adjust host management description * feat(edge-jobs): introduce interfaces and types * feat(edge-jobs): implement bolt service * refactor(edge-jobs): replace schedule routes * refactor(edge-job): replace Schedule service * refactor(edge-jobs): remove job_script_exec * refactor(host): remove jobs table * feat(edge-jobs): replace schedule * feat(edge-jobs): load file on inspect * fix(edge-job): parse cron correctly * feat(edge-jobs): show tasks * feat(host): rename tooltip * refactor(host): remove old components * refactor(main): remove schedule types * refactor(snapshot): replace job service with snapshot service * refactor(jobs): remove jobs form and datatable * feat(edge-jobs): create db migration * fix(main): start snapshot service with correct interval * feat(settings): change host tooltip * feat(edge-jobs): load endpoints * fix(edge-job): disable form submit when form is invalid * refactor(edge-compute): use const * refactor(edge-jobs): use generic controller * refactor(edge-jobs): replace $scope with controllerAs * refactor(edge-jobs): replace routes with components * refactor(edge-jobs): replace functions with classes * refactor(edge-jobs): use async/await * refactor(edge-jobs): rename functions * feat(edge-jobs): introduce beta panel * feat(edge-jobs): allow single character names * fix(snapshot): run snapshot in coroutine * feat(edge-jobs): add logs status * feat(filesystem): add edge job logs methods * feat(edge-jobs): intoduce edge jobs tasks api * feat(edge-jobs): remove schedule task model * fix(fs): build edge job task file path * fix(edge-jobs): update task meta * fix(edge-jobs): return a list of endpoints * feat(edge-jobs): update logs from agent * feat(edge-jobs): collect logs * feat(edge-jobs): rename url * feat(edge-jobs): refresh to same tab * feat(edge-jobs): remove old info * refactor(edge-jobs): rename script path json * fix(edge-job): save file before adding job * feat(edge-job): show retrieving logs label * feat(edge-job): replace cron with 5 places * refactor(edge-jobs): replace tasks with results * feat(edge-jobs): add auto refresh until logs are collected * feat(edge-jobs): fix column size * feat(edge-job): display editor * feat(edge-job): add name validation * feat(edge-job): set default time for 1 hour from now * feat(edge-job): add validation for cron format * feat(edge-job): add a note about timezone * fix(edge-job): replace regex * fix(edge-job): check for every minute cron * style(edge-jobs): add reference for cron regex * refactor(edge-jobs): rename migration name * refactor(edge-job): rename edge job response * refactor(snapshot): rename snapshot endpoint method * refactor(edge-jobs): move tasks handler to edgejobs * feat(security): introduce a middleware for edge compute operations * feat(edge-job): use edge compute middleware * feat(edge-groups): filter http actions based on edge setting * fix(security): return from edge bouncer if failed * feat(edge-stacks): filter http actions based on edge setting * feat(edge-groups): show error when failed to load groups * refactor(db): remove edge-jobs migration * refactor(migrator): remove unused dependency Co-authored-by: Anthony Lapenna <lapenna.anthony@gmail.com>
4 years ago
schedule := edgeJobResponse{
ID: job.ID,
CronExpression: job.CronExpression,
CollectLogs: collectLogs,
feat(edge-compute): move host jobs to edge (#3840) * feat(endpoints): create an associated endpoints selector * feat(schedules): remove edge specific explanations * refactor(schedule): replace multi-endpoint-selector * refactor(schedule): move controller to single file * refactor(endpoints): remove multi-endpoint-selector * feat(edge): rename host jobs to edge jobs * feat(edge-jobs): remove edge warning * refactor(edge-jobs): move schedule pages to edge * refactor(edge-jobs): mv views to edgeJobs * refactor(edge-jobs): rename edge jobs * refactor(edge-jobs): move services to edge * refactor(edge-jobs): move tasks datatable * fix(edge-jobs): fix import * fix(edge-jobs): use right services * feat(settings): adjust host management description * feat(edge-jobs): introduce interfaces and types * feat(edge-jobs): implement bolt service * refactor(edge-jobs): replace schedule routes * refactor(edge-job): replace Schedule service * refactor(edge-jobs): remove job_script_exec * refactor(host): remove jobs table * feat(edge-jobs): replace schedule * feat(edge-jobs): load file on inspect * fix(edge-job): parse cron correctly * feat(edge-jobs): show tasks * feat(host): rename tooltip * refactor(host): remove old components * refactor(main): remove schedule types * refactor(snapshot): replace job service with snapshot service * refactor(jobs): remove jobs form and datatable * feat(edge-jobs): create db migration * fix(main): start snapshot service with correct interval * feat(settings): change host tooltip * feat(edge-jobs): load endpoints * fix(edge-job): disable form submit when form is invalid * refactor(edge-compute): use const * refactor(edge-jobs): use generic controller * refactor(edge-jobs): replace $scope with controllerAs * refactor(edge-jobs): replace routes with components * refactor(edge-jobs): replace functions with classes * refactor(edge-jobs): use async/await * refactor(edge-jobs): rename functions * feat(edge-jobs): introduce beta panel * feat(edge-jobs): allow single character names * fix(snapshot): run snapshot in coroutine * feat(edge-jobs): add logs status * feat(filesystem): add edge job logs methods * feat(edge-jobs): intoduce edge jobs tasks api * feat(edge-jobs): remove schedule task model * fix(fs): build edge job task file path * fix(edge-jobs): update task meta * fix(edge-jobs): return a list of endpoints * feat(edge-jobs): update logs from agent * feat(edge-jobs): collect logs * feat(edge-jobs): rename url * feat(edge-jobs): refresh to same tab * feat(edge-jobs): remove old info * refactor(edge-jobs): rename script path json * fix(edge-job): save file before adding job * feat(edge-job): show retrieving logs label * feat(edge-job): replace cron with 5 places * refactor(edge-jobs): replace tasks with results * feat(edge-jobs): add auto refresh until logs are collected * feat(edge-jobs): fix column size * feat(edge-job): display editor * feat(edge-job): add name validation * feat(edge-job): set default time for 1 hour from now * feat(edge-job): add validation for cron format * feat(edge-job): add a note about timezone * fix(edge-job): replace regex * fix(edge-job): check for every minute cron * style(edge-jobs): add reference for cron regex * refactor(edge-jobs): rename migration name * refactor(edge-job): rename edge job response * refactor(snapshot): rename snapshot endpoint method * refactor(edge-jobs): move tasks handler to edgejobs * feat(security): introduce a middleware for edge compute operations * feat(edge-job): use edge compute middleware * feat(edge-groups): filter http actions based on edge setting * fix(security): return from edge bouncer if failed * feat(edge-stacks): filter http actions based on edge setting * feat(edge-groups): show error when failed to load groups * refactor(db): remove edge-jobs migration * refactor(migrator): remove unused dependency Co-authored-by: Anthony Lapenna <lapenna.anthony@gmail.com>
4 years ago
Version: job.Version,
}
file, err := handler.FileService.GetFileContent(job.ScriptPath, "")
feat(edge-compute): move host jobs to edge (#3840) * feat(endpoints): create an associated endpoints selector * feat(schedules): remove edge specific explanations * refactor(schedule): replace multi-endpoint-selector * refactor(schedule): move controller to single file * refactor(endpoints): remove multi-endpoint-selector * feat(edge): rename host jobs to edge jobs * feat(edge-jobs): remove edge warning * refactor(edge-jobs): move schedule pages to edge * refactor(edge-jobs): mv views to edgeJobs * refactor(edge-jobs): rename edge jobs * refactor(edge-jobs): move services to edge * refactor(edge-jobs): move tasks datatable * fix(edge-jobs): fix import * fix(edge-jobs): use right services * feat(settings): adjust host management description * feat(edge-jobs): introduce interfaces and types * feat(edge-jobs): implement bolt service * refactor(edge-jobs): replace schedule routes * refactor(edge-job): replace Schedule service * refactor(edge-jobs): remove job_script_exec * refactor(host): remove jobs table * feat(edge-jobs): replace schedule * feat(edge-jobs): load file on inspect * fix(edge-job): parse cron correctly * feat(edge-jobs): show tasks * feat(host): rename tooltip * refactor(host): remove old components * refactor(main): remove schedule types * refactor(snapshot): replace job service with snapshot service * refactor(jobs): remove jobs form and datatable * feat(edge-jobs): create db migration * fix(main): start snapshot service with correct interval * feat(settings): change host tooltip * feat(edge-jobs): load endpoints * fix(edge-job): disable form submit when form is invalid * refactor(edge-compute): use const * refactor(edge-jobs): use generic controller * refactor(edge-jobs): replace $scope with controllerAs * refactor(edge-jobs): replace routes with components * refactor(edge-jobs): replace functions with classes * refactor(edge-jobs): use async/await * refactor(edge-jobs): rename functions * feat(edge-jobs): introduce beta panel * feat(edge-jobs): allow single character names * fix(snapshot): run snapshot in coroutine * feat(edge-jobs): add logs status * feat(filesystem): add edge job logs methods * feat(edge-jobs): intoduce edge jobs tasks api * feat(edge-jobs): remove schedule task model * fix(fs): build edge job task file path * fix(edge-jobs): update task meta * fix(edge-jobs): return a list of endpoints * feat(edge-jobs): update logs from agent * feat(edge-jobs): collect logs * feat(edge-jobs): rename url * feat(edge-jobs): refresh to same tab * feat(edge-jobs): remove old info * refactor(edge-jobs): rename script path json * fix(edge-job): save file before adding job * feat(edge-job): show retrieving logs label * feat(edge-job): replace cron with 5 places * refactor(edge-jobs): replace tasks with results * feat(edge-jobs): add auto refresh until logs are collected * feat(edge-jobs): fix column size * feat(edge-job): display editor * feat(edge-job): add name validation * feat(edge-job): set default time for 1 hour from now * feat(edge-job): add validation for cron format * feat(edge-job): add a note about timezone * fix(edge-job): replace regex * fix(edge-job): check for every minute cron * style(edge-jobs): add reference for cron regex * refactor(edge-jobs): rename migration name * refactor(edge-job): rename edge job response * refactor(snapshot): rename snapshot endpoint method * refactor(edge-jobs): move tasks handler to edgejobs * feat(security): introduce a middleware for edge compute operations * feat(edge-job): use edge compute middleware * feat(edge-groups): filter http actions based on edge setting * fix(security): return from edge bouncer if failed * feat(edge-stacks): filter http actions based on edge setting * feat(edge-groups): show error when failed to load groups * refactor(db): remove edge-jobs migration * refactor(migrator): remove unused dependency Co-authored-by: Anthony Lapenna <lapenna.anthony@gmail.com>
4 years ago
if err != nil {
return nil, httperror.InternalServerError("Unable to retrieve Edge job script file", err)
feat(edge-compute): move host jobs to edge (#3840) * feat(endpoints): create an associated endpoints selector * feat(schedules): remove edge specific explanations * refactor(schedule): replace multi-endpoint-selector * refactor(schedule): move controller to single file * refactor(endpoints): remove multi-endpoint-selector * feat(edge): rename host jobs to edge jobs * feat(edge-jobs): remove edge warning * refactor(edge-jobs): move schedule pages to edge * refactor(edge-jobs): mv views to edgeJobs * refactor(edge-jobs): rename edge jobs * refactor(edge-jobs): move services to edge * refactor(edge-jobs): move tasks datatable * fix(edge-jobs): fix import * fix(edge-jobs): use right services * feat(settings): adjust host management description * feat(edge-jobs): introduce interfaces and types * feat(edge-jobs): implement bolt service * refactor(edge-jobs): replace schedule routes * refactor(edge-job): replace Schedule service * refactor(edge-jobs): remove job_script_exec * refactor(host): remove jobs table * feat(edge-jobs): replace schedule * feat(edge-jobs): load file on inspect * fix(edge-job): parse cron correctly * feat(edge-jobs): show tasks * feat(host): rename tooltip * refactor(host): remove old components * refactor(main): remove schedule types * refactor(snapshot): replace job service with snapshot service * refactor(jobs): remove jobs form and datatable * feat(edge-jobs): create db migration * fix(main): start snapshot service with correct interval * feat(settings): change host tooltip * feat(edge-jobs): load endpoints * fix(edge-job): disable form submit when form is invalid * refactor(edge-compute): use const * refactor(edge-jobs): use generic controller * refactor(edge-jobs): replace $scope with controllerAs * refactor(edge-jobs): replace routes with components * refactor(edge-jobs): replace functions with classes * refactor(edge-jobs): use async/await * refactor(edge-jobs): rename functions * feat(edge-jobs): introduce beta panel * feat(edge-jobs): allow single character names * fix(snapshot): run snapshot in coroutine * feat(edge-jobs): add logs status * feat(filesystem): add edge job logs methods * feat(edge-jobs): intoduce edge jobs tasks api * feat(edge-jobs): remove schedule task model * fix(fs): build edge job task file path * fix(edge-jobs): update task meta * fix(edge-jobs): return a list of endpoints * feat(edge-jobs): update logs from agent * feat(edge-jobs): collect logs * feat(edge-jobs): rename url * feat(edge-jobs): refresh to same tab * feat(edge-jobs): remove old info * refactor(edge-jobs): rename script path json * fix(edge-job): save file before adding job * feat(edge-job): show retrieving logs label * feat(edge-job): replace cron with 5 places * refactor(edge-jobs): replace tasks with results * feat(edge-jobs): add auto refresh until logs are collected * feat(edge-jobs): fix column size * feat(edge-job): display editor * feat(edge-job): add name validation * feat(edge-job): set default time for 1 hour from now * feat(edge-job): add validation for cron format * feat(edge-job): add a note about timezone * fix(edge-job): replace regex * fix(edge-job): check for every minute cron * style(edge-jobs): add reference for cron regex * refactor(edge-jobs): rename migration name * refactor(edge-job): rename edge job response * refactor(snapshot): rename snapshot endpoint method * refactor(edge-jobs): move tasks handler to edgejobs * feat(security): introduce a middleware for edge compute operations * feat(edge-job): use edge compute middleware * feat(edge-groups): filter http actions based on edge setting * fix(security): return from edge bouncer if failed * feat(edge-stacks): filter http actions based on edge setting * feat(edge-groups): show error when failed to load groups * refactor(db): remove edge-jobs migration * refactor(migrator): remove unused dependency Co-authored-by: Anthony Lapenna <lapenna.anthony@gmail.com>
4 years ago
}
schedule.Script = base64.RawStdEncoding.EncodeToString(file)
schedules = append(schedules, schedule)
}
return schedules, nil
}
feat(edge-compute): move host jobs to edge (#3840) * feat(endpoints): create an associated endpoints selector * feat(schedules): remove edge specific explanations * refactor(schedule): replace multi-endpoint-selector * refactor(schedule): move controller to single file * refactor(endpoints): remove multi-endpoint-selector * feat(edge): rename host jobs to edge jobs * feat(edge-jobs): remove edge warning * refactor(edge-jobs): move schedule pages to edge * refactor(edge-jobs): mv views to edgeJobs * refactor(edge-jobs): rename edge jobs * refactor(edge-jobs): move services to edge * refactor(edge-jobs): move tasks datatable * fix(edge-jobs): fix import * fix(edge-jobs): use right services * feat(settings): adjust host management description * feat(edge-jobs): introduce interfaces and types * feat(edge-jobs): implement bolt service * refactor(edge-jobs): replace schedule routes * refactor(edge-job): replace Schedule service * refactor(edge-jobs): remove job_script_exec * refactor(host): remove jobs table * feat(edge-jobs): replace schedule * feat(edge-jobs): load file on inspect * fix(edge-job): parse cron correctly * feat(edge-jobs): show tasks * feat(host): rename tooltip * refactor(host): remove old components * refactor(main): remove schedule types * refactor(snapshot): replace job service with snapshot service * refactor(jobs): remove jobs form and datatable * feat(edge-jobs): create db migration * fix(main): start snapshot service with correct interval * feat(settings): change host tooltip * feat(edge-jobs): load endpoints * fix(edge-job): disable form submit when form is invalid * refactor(edge-compute): use const * refactor(edge-jobs): use generic controller * refactor(edge-jobs): replace $scope with controllerAs * refactor(edge-jobs): replace routes with components * refactor(edge-jobs): replace functions with classes * refactor(edge-jobs): use async/await * refactor(edge-jobs): rename functions * feat(edge-jobs): introduce beta panel * feat(edge-jobs): allow single character names * fix(snapshot): run snapshot in coroutine * feat(edge-jobs): add logs status * feat(filesystem): add edge job logs methods * feat(edge-jobs): intoduce edge jobs tasks api * feat(edge-jobs): remove schedule task model * fix(fs): build edge job task file path * fix(edge-jobs): update task meta * fix(edge-jobs): return a list of endpoints * feat(edge-jobs): update logs from agent * feat(edge-jobs): collect logs * feat(edge-jobs): rename url * feat(edge-jobs): refresh to same tab * feat(edge-jobs): remove old info * refactor(edge-jobs): rename script path json * fix(edge-job): save file before adding job * feat(edge-job): show retrieving logs label * feat(edge-job): replace cron with 5 places * refactor(edge-jobs): replace tasks with results * feat(edge-jobs): add auto refresh until logs are collected * feat(edge-jobs): fix column size * feat(edge-job): display editor * feat(edge-job): add name validation * feat(edge-job): set default time for 1 hour from now * feat(edge-job): add validation for cron format * feat(edge-job): add a note about timezone * fix(edge-job): replace regex * fix(edge-job): check for every minute cron * style(edge-jobs): add reference for cron regex * refactor(edge-jobs): rename migration name * refactor(edge-job): rename edge job response * refactor(snapshot): rename snapshot endpoint method * refactor(edge-jobs): move tasks handler to edgejobs * feat(security): introduce a middleware for edge compute operations * feat(edge-job): use edge compute middleware * feat(edge-groups): filter http actions based on edge setting * fix(security): return from edge bouncer if failed * feat(edge-stacks): filter http actions based on edge setting * feat(edge-groups): show error when failed to load groups * refactor(db): remove edge-jobs migration * refactor(migrator): remove unused dependency Co-authored-by: Anthony Lapenna <lapenna.anthony@gmail.com>
4 years ago
func (handler *Handler) buildEdgeStacks(tx dataservices.DataStoreTx, endpointID portainer.EndpointID) ([]stackStatusResponse, *httperror.HandlerError) {
relation, err := tx.EndpointRelation().EndpointRelation(endpointID)
feat(edge-compute): add support for Edge stacks (#3827) * feat(api): introduce Edge group API (#3639) * feat(edge-groups): add object definition and service definition * feat(edge-groups): implement bolt layer * feat(edge-groups): bind service to server * feat(edge-group): add edge-group create http handler * feat(edge-groups): add list method to edge group handler * feat(edge-group): add inspect http handler * feat(edge-groups): add delete edge-group handler * feat(edge-groups): add update group handler * style(db): order by alphabetical order * fix(edge-groups): rewrite http error messages Co-Authored-By: Anthony Lapenna <anthony.lapenna@portainer.io> * fix(main): order by alphabetical order * refactor(edge-group): relocate fetch group * fix(edge-group): reset tagids/endpoints if dynamic * refactor(server): order by alphabetical order * refactor(server): order by alphabetical order Co-authored-by: Anthony Lapenna <anthony.lapenna@portainer.io> * Introduce a new setting to enable Edge compute features (#3654) * feat(edge-compute): add edge compute setting * feat(edge-compute): add edge compute group to sidebar * fix(settings): rename settings form group * fix(settings): align form control * Edge group associated endpoints (#3659) * chore(version): bump version number * chore(version): bump version number * feat(endpoints): filter by endpoint type (#3646) * refactor(tags): migrate tags to have association objects * refactor(tags): refactor tag management (#3628) * refactor(tags): replace tags with tag ids * refactor(tags): revert tags to be strings and add tagids * refactor(tags): enable search by tag in home view * refactor(tags): show endpoint tags * refactor(endpoints): expect tagIds on create payload * refactor(endpoints): expect tagIds on update payload * refactor(endpoints): replace TagIds to TagIDs * refactor(endpoints): set endpoint group to get TagIDs * refactor(endpoints): refactor tag-selector to receive tag-ids * refactor(endpoints): show tags in multi-endpoint-selector * chore(tags): revert reformat * refactor(endpoints): remove unneeded bind * refactor(endpoints): change param tags to tagids in endpoint create * refactor(endpoints): remove console.log * refactor(tags): remove deleted tag from endpoint and endpoint group * fix(endpoints): show loading label while loading tags * chore(go): remove obsolete import labels * chore(db): add db version comment * fix(db): add tag service to migrator * refactor(db): add error checks in migrator * style(db): sort props in alphabetical order * style(tags): fix typo Co-Authored-By: Anthony Lapenna <anthony.lapenna@portainer.io> * refactor(endpoints): replace tagsMap with tag string representation * refactor(tags): rewrite tag delete to be more readable * refactor(home): rearange code to match former style * refactor(tags): guard against missing model in tag-selector * refactor(tags): rename vars in tag_delete * refactor(tags): allow any authenticated user to fetch tag list * refactor(endpoints): replace controller function with class * refactor(endpoints): replace function with helper * refactor(endpoints): replace controller with class * refactor(tags): revert tags-selector to use 1 way bindings * refactor(endpoints): load empty tag array instead of nil * refactor(endpoints): revert default tag ids * refactor(endpoints): use function in place * refactor(tags): use lodash * style(tags): use parens in arrow functions * fix(tags): remove tag from tag model Co-authored-by: Anthony Lapenna <anthony.lapenna@portainer.io> * refactor(tags): create tag association when creating tag * refactor(tags): delete tag association when deleting tag * refactor(db): handle error in tag association create * feat(endpoint-group): update tag assoc when creating endpoint group * feat(endpoint-group): update tag association when updating group * feat(endpoint-groups): remove group from tag associations * feat(endpoints): associate endpoint with tag on create * feat(endpoints): edit tag association when updating endpoint * fix(tags): fix merge problems * refactor(tags): remove tag association resource * fix(db): use regular tags map * style(tags): reorder props and imports * refactor(endpoint-groups): replace tag-association with tag * feat(edge-group): get associated endpoints when fetching * refactor(tags): refactor algo to update endpoint and group tags * refactor(edge-group): rename variable * refactor(tags): move calc of tags to remove to global function * fix(tags): update tag after adding association Co-authored-by: Anthony Lapenna <lapenna.anthony@gmail.com> Co-authored-by: Anthony Lapenna <anthony.lapenna@portainer.io> * fix(edge-groups): associate groups only with edge endpoints (#3667) * fix(edge-groups): check endpoint type when adding to edge-group * fix(edge-groups): return only edge endpoints for dynamic groups * fix(edge-compute): load edge compute setting on public setting (#3665) * Edge group list (#3644) * feat(edge-groups): add edge module * feat(edge-groups): add edge-group service * feat(edge-group): add groups list view * feat(edge-groups): add link to groups in the sidebar * feat(edge-group): show endpoints count and group type * feat(edge-group): enable removal of edge groups * refactor(edge-groups): replace datatable controller with class * refactor(edge-groups): replace function with class * fix(edge-groups): sort items by endpoints count and group type * refactor(edge-groups): use generic datatable-header component * feat(app): add trace for ui router * fix(edge-compute): add ng injection to onEnter guard * fix(edge-compute): add ng injection to onEnter guard * style(edge-compute): remove space * refactor(edge-compute): import angular * fix(app): remove ui router trace * refactor(product): revert app.js * fix(edge-compute): remove admin guard from edge routes * fix(edge-groups): change label of empty datatable Co-Authored-By: Anthony Lapenna <anthony.lapenna@portainer.io> * refactor(edge-groups): rename service * fix(edge-groups): replace icon in sidebar Co-Authored-By: Anthony Lapenna <anthony.lapenna@portainer.io> * refactor(edge-groups): remove datatable controller * refactor(edge-groups): move datatable icon to binding * refactor(edge-groups): use vanilla datatable header * refactor(datatable): remove datatable header Co-authored-by: Anthony Lapenna <anthony.lapenna@portainer.io> * refactor(edge): rename edge group to Edge group * feat(edge-groups): edge group creation view (#3671) * feat(edge-groups): add create group view * feat(edge-groups): allow to choose group type * feat(edge-groups): implement create service handler * feat(edge-group): filter by edge endpoints * refactor(edge-groups): rename to camel case * refactor(edge-groups): replace controller with class * feat(endpoints): filter endpoints by type * refactor(edge-groups): remove comments and unneccesary async keyword * refactor(edge-group): use $async service * fix(edge-groups): replace view title Co-Authored-By: Anthony Lapenna <anthony.lapenna@portainer.io> * fix(edge-groups): change icon Co-Authored-By: Anthony Lapenna <anthony.lapenna@portainer.io> * fix(edge-groups): change icon Co-Authored-By: Anthony Lapenna <anthony.lapenna@portainer.io> * refactor(edge-groups): remove obsolete function * feat(edge-groups): add empty list messages * feat(edge-group): add description to group types * refactor(edge-groups): add finally block * feat(endpoints): search server in multi-endpoint-selector Co-authored-by: Anthony Lapenna <anthony.lapenna@portainer.io> * feat(edge-group) edit view (#3672) * feat(edge-groups): add edit group view * refactor(edge-group): replace edit controller with class * refactor(edge-groups): remove async keyword * refactor(edge-groups): use $async service * refactor(edge-group): remove unnecessary functions * fix(endpoints): group by groups in endpoint-selector * feat(edge-groups): minor UI update * fix(edge-groups): provide defaults for edge group (#3682) * feat(edge-stacks): add basic views and sidebar link (#3689) * feat(edge-stacks): add mock routes * feat(edge-stacks): add link to stacks on sidebar * feat(edge-stacks): add edge stacks view * feat(edge-stacks): add create view * feat(edge-stacks): add edit view * fix(edge-stacks): use class in controller * feat(edge-stacks): add edge-stacks api (#3688) * feat(edge-stack): add edge stack types * feat(edge-stacks): add edge stack service interface * feat(edge-stacks): implement store * feat(edge-stacks): bind service to datastore * feat(edge-stacks): bind service to server * feat(edge-stack): create basic api * feat(edge-stack): create stack api * feat(edge-stacks): update api * refacotor(edge-stack): rename files * feat(edge-stack): update endpoint status * style(edge-stacks): remove comments * feat(edge-stacks): use edge stacks folder for files * fix(edge-stacks): replace bucket name Co-Authored-By: Anthony Lapenna <anthony.lapenna@portainer.io> * fix(edge-stacks): replace unmarshal function Co-Authored-By: Anthony Lapenna <anthony.lapenna@portainer.io> * fix(edge-stacks): replace edge stacks path Co-Authored-By: Anthony Lapenna <anthony.lapenna@portainer.io> Co-authored-by: Anthony Lapenna <anthony.lapenna@portainer.io> * chore(git): merge develop to edge compute (#3692) * feat(support): make support type dynamic (#3621) * chore(version): bump version number * chore(version): bump version number * feat(endpoints): filter by endpoint type (#3646) * chore(assets): double UI image resolutions for HiDPI displays (#3648) Fixes #3069 Prevents users seeing blurry logos and other images when using a hidpi display (like scaled 4k, or a Retina display). These images have been recreated manually with 2x the original resolution but should resemble the originals as much as possible. They have also been run through pngcrush for compression. * fix(services): enforce minimum replica count of 0 (#3653) * fix(services): enforce minimum replica count of 0 Fixes #3652 Prevents replica count from being set below zero and causing an error. * fix(services): enforce replica count is an integer Prevents users entering decimals in the replica count * refactor(tags): refactor tag management (#3628) * refactor(tags): replace tags with tag ids * refactor(tags): revert tags to be strings and add tagids * refactor(tags): enable search by tag in home view * refactor(tags): show endpoint tags * refactor(endpoints): expect tagIds on create payload * refactor(endpoints): expect tagIds on update payload * refactor(endpoints): replace TagIds to TagIDs * refactor(endpoints): set endpoint group to get TagIDs * refactor(endpoints): refactor tag-selector to receive tag-ids * refactor(endpoints): show tags in multi-endpoint-selector * chore(tags): revert reformat * refactor(endpoints): remove unneeded bind * refactor(endpoints): change param tags to tagids in endpoint create * refactor(endpoints): remove console.log * refactor(tags): remove deleted tag from endpoint and endpoint group * fix(endpoints): show loading label while loading tags * chore(go): remove obsolete import labels * chore(db): add db version comment * fix(db): add tag service to migrator * refactor(db): add error checks in migrator * style(db): sort props in alphabetical order * style(tags): fix typo Co-Authored-By: Anthony Lapenna <anthony.lapenna@portainer.io> * refactor(endpoints): replace tagsMap with tag string representation * refactor(tags): rewrite tag delete to be more readable * refactor(home): rearange code to match former style * refactor(tags): guard against missing model in tag-selector * refactor(tags): rename vars in tag_delete * refactor(tags): allow any authenticated user to fetch tag list * refactor(endpoints): replace controller function with class * refactor(endpoints): replace function with helper * refactor(endpoints): replace controller with class * refactor(tags): revert tags-selector to use 1 way bindings * refactor(endpoints): load empty tag array instead of nil * refactor(endpoints): revert default tag ids * refactor(endpoints): use function in place * refactor(tags): use lodash * style(tags): use parens in arrow functions * fix(tags): remove tag from tag model Co-authored-by: Anthony Lapenna <anthony.lapenna@portainer.io> * chore(yarn): change start:client to start webpack dev server (#3595) * chore(yarn): change start:client to start webpack dev server * Update package.json Co-authored-by: Anthony Lapenna <anthony.lapenna@portainer.io> * create tag from tag selector (#3640) * feat(tags): add button to save tag when doesn't exist * feat(endpoints): allow the creating of tags in endpoint edit * feat(groups): allow user to create tags in create group * feat(groups): allow user to create tags in edit group * feat(endpoint): allow user to create tags from endpoint create * feat(tags): allow the creation of a new tag from dropdown * feat(tag): replace "add" with "create" * feat(tags): show tags input when not tags * feat(tags): hide create message when not allowed * refactor(tags): replace component controller with class * refactor(tags): replace native methods with lodash * refactor(tags): remove unused onChangeTags function * refactor(tags): remove on-change binding * style(tags): remove white space * refactor(endpoint-groups): move controller to separate file * fix(groups): allow admin to create tag in group form * refactor(endpoints): wrap async function with try catch and $async * style(tags): wrap arrow function args with parenthesis * refactor(endpoints): return $async functions * refactor(tags): throw error in the format Notification expects * chore(yarn): add start:client script back (#3691) * feat(endpoints): filter by ids and/or tag ids (#3690) * feat(endpoints): add filter by tagIds * refactor(endpoints): change endpoints service to query by tagIds * fix(endpoints): filter by tags * feat(endpoints): filter by endpoint groups tags * feat(endpoints): filter by ids Co-authored-by: itsconquest <william.conquest@portainer.io> Co-authored-by: Anthony Lapenna <lapenna.anthony@gmail.com> Co-authored-by: Ben Brooks <ben@bbrks.me> Co-authored-by: Anthony Lapenna <anthony.lapenna@portainer.io> * Chore merge develop to edge compute (#3702) * feat(support): make support type dynamic (#3621) * chore(version): bump version number * chore(version): bump version number * feat(endpoints): filter by endpoint type (#3646) * chore(assets): double UI image resolutions for HiDPI displays (#3648) Fixes #3069 Prevents users seeing blurry logos and other images when using a hidpi display (like scaled 4k, or a Retina display). These images have been recreated manually with 2x the original resolution but should resemble the originals as much as possible. They have also been run through pngcrush for compression. * fix(services): enforce minimum replica count of 0 (#3653) * fix(services): enforce minimum replica count of 0 Fixes #3652 Prevents replica count from being set below zero and causing an error. * fix(services): enforce replica count is an integer Prevents users entering decimals in the replica count * refactor(tags): refactor tag management (#3628) * refactor(tags): replace tags with tag ids * refactor(tags): revert tags to be strings and add tagids * refactor(tags): enable search by tag in home view * refactor(tags): show endpoint tags * refactor(endpoints): expect tagIds on create payload * refactor(endpoints): expect tagIds on update payload * refactor(endpoints): replace TagIds to TagIDs * refactor(endpoints): set endpoint group to get TagIDs * refactor(endpoints): refactor tag-selector to receive tag-ids * refactor(endpoints): show tags in multi-endpoint-selector * chore(tags): revert reformat * refactor(endpoints): remove unneeded bind * refactor(endpoints): change param tags to tagids in endpoint create * refactor(endpoints): remove console.log * refactor(tags): remove deleted tag from endpoint and endpoint group * fix(endpoints): show loading label while loading tags * chore(go): remove obsolete import labels * chore(db): add db version comment * fix(db): add tag service to migrator * refactor(db): add error checks in migrator * style(db): sort props in alphabetical order * style(tags): fix typo Co-Authored-By: Anthony Lapenna <anthony.lapenna@portainer.io> * refactor(endpoints): replace tagsMap with tag string representation * refactor(tags): rewrite tag delete to be more readable * refactor(home): rearange code to match former style * refactor(tags): guard against missing model in tag-selector * refactor(tags): rename vars in tag_delete * refactor(tags): allow any authenticated user to fetch tag list * refactor(endpoints): replace controller function with class * refactor(endpoints): replace function with helper * refactor(endpoints): replace controller with class * refactor(tags): revert tags-selector to use 1 way bindings * refactor(endpoints): load empty tag array instead of nil * refactor(endpoints): revert default tag ids * refactor(endpoints): use function in place * refactor(tags): use lodash * style(tags): use parens in arrow functions * fix(tags): remove tag from tag model Co-authored-by: Anthony Lapenna <anthony.lapenna@portainer.io> * chore(yarn): change start:client to start webpack dev server (#3595) * chore(yarn): change start:client to start webpack dev server * Update package.json Co-authored-by: Anthony Lapenna <anthony.lapenna@portainer.io> * create tag from tag selector (#3640) * feat(tags): add button to save tag when doesn't exist * feat(endpoints): allow the creating of tags in endpoint edit * feat(groups): allow user to create tags in create group * feat(groups): allow user to create tags in edit group * feat(endpoint): allow user to create tags from endpoint create * feat(tags): allow the creation of a new tag from dropdown * feat(tag): replace "add" with "create" * feat(tags): show tags input when not tags * feat(tags): hide create message when not allowed * refactor(tags): replace component controller with class * refactor(tags): replace native methods with lodash * refactor(tags): remove unused onChangeTags function * refactor(tags): remove on-change binding * style(tags): remove white space * refactor(endpoint-groups): move controller to separate file * fix(groups): allow admin to create tag in group form * refactor(endpoints): wrap async function with try catch and $async * style(tags): wrap arrow function args with parenthesis * refactor(endpoints): return $async functions * refactor(tags): throw error in the format Notification expects * chore(yarn): add start:client script back (#3691) * feat(endpoints): filter by ids and/or tag ids (#3690) * feat(endpoints): add filter by tagIds * refactor(endpoints): change endpoints service to query by tagIds * fix(endpoints): filter by tags * feat(endpoints): filter by endpoint groups tags * feat(endpoints): filter by ids * refactor(project): sort portainer types and interface definitions (#3694) * refactor(portainer): sort types * style(portainer): add comment about role service * refactor(portainer): sort interface types * refactor(portainer): sort enums * Update README.md * Update README.md * Update README.md * chore(project): add prettier for code format (#3645) * chore(project): install prettier and lint-staged * chore(project): apply prettier to html too * chore(project): git ignore eslintcache * chore(project): add a comment about format script * chore(prettier): update printWidth * chore(prettier): remove useTabs option * chore(prettier): add HTML validation * refactor(prettier): fix closing tags * feat(prettier): define angular parser for html templates * style(prettier): run prettier on codebase Co-authored-by: Anthony Lapenna <lapenna.anthony@gmail.com> * chore(prettier): run format on client codebase Co-authored-by: itsconquest <william.conquest@portainer.io> Co-authored-by: Anthony Lapenna <lapenna.anthony@gmail.com> Co-authored-by: Ben Brooks <ben@bbrks.me> Co-authored-by: Anthony Lapenna <anthony.lapenna@portainer.io> Co-authored-by: Neil Cresswell <neil@cresswell.net.nz> * feat(edge-stacks): create basic edge stack service (#3704) Co-authored-by: Anthony Lapenna <anthony.lapenna@portainer.io> * feat(edge-groups): Provide a switch to use AND or OR for tags (#3695) * feat(edge-groups): add switch to form * feat(project): add property to EdgeGroup * feat(edge-groups): save mustHaveAllTags * feat(edge-groups): fetch associated endpoints (AND and OR) * feat(edge-groups): add AND selector * feat(edge-groups): default to AND * fix(edge-groups): rewrite selector options Co-Authored-By: Anthony Lapenna <anthony.lapenna@portainer.io> * refactor(endpoints): move margin to schedule form * fix(edge-groups): move the selector to top of group * refactor(edge-groups): replace partialMatch property Co-authored-by: Anthony Lapenna <anthony.lapenna@portainer.io> * feat(edge-stacks): add Edge stack creation view (#3705) * feat(edge-stacks): basic creation view * feat(edge-stacks): add group selector * feat(edge-stack): create edge stack * fix(code-editor): apply digest cycle after editor is changed * style(project): reformat constants file * feat(edge-stacks): add a note about missing edge groups * fix(edge-stacks): add groups when creating stack from file * feat(edge-groups): add associated endpoints table (#3710) * feat(edge-groups): load associated endpoints * feat(endpoints): add option to filter endpoint by partial match tags * feat(edge-groups): query endpoints by PartialMatch * feat(edge-groups): reload endpoints when form changes * feat(edge-groups): remove columns * feat(edge-group): remove url column * refactor(edge-group): remove props * feat(edge-stacks): add list view (#3713) * feat(edge-stacks): basic datatable * feat(edge-stacks): remove stack * refactor(edge-stacks): convert to class * refactor(edge-stacks): replace id with stackId * feat(edge-stacks) edit edge stack view (#3716) * feat(edge-stack): load file content * feat(edge-stack): edit view * feat(edge-stack): enable update stack * refactor(edge-stacks): move form to component * feat(edge-stacks): add endpoints status * feat(edge-stacks): minor UI update Co-authored-by: Anthony Lapenna <lapenna.anthony@gmail.com> * feat(edge-groups) prevent deletion of edge group used by an edge stack (#3722) * feat(edge-groups): show if group belonges to edge stack * feat(edge-group): protect deletion of used edge group * feat(edge-groups): diable selection of used group * feat(edge-groups): add inuse tag (#3739) * feat(edge-groups): add inuse tag * Update app/edge/components/groups-datatable/groupsDatatable.html Co-authored-by: Anthony Lapenna <anthony.lapenna@portainer.io> * feat(edge-stack): update stack version when stack file is changed (#3746) * feat(edge-stack): update version when stack file is changed * refactor(edge-stacks): move update of version to clientside * feat(edge-groups): replace Edge group endpoint selector (#3738) * feat(edge-groups): replace selector * feat(edge-group): add selector in edit form * feat(edge-groups): show tags in endpoint selector * feat(edge-groups): show the endpoint group name * fix(edge-group): remove element from associated endpoints * feat(edge-groups): add group column * feat(edge-groups): move endpoints to other column * fix(groups): disable sort * refactor(endpoints): toggle backend pagination as a property * fix(endpoints): show group name in group-association-table * feat(endpoints): truncate table columns * fix(endpoints): update group association table colspan * fix(endpoint-groups): show dash when no tags Co-authored-by: Anthony Lapenna <lapenna.anthony@gmail.com> * feat(edge-stacks): add api for edge to query stack config (#3748) * refactor(http): move edge validation to bouncer * feat(edge-stacks): add api for edge to query stack config * style(edge-stack): remove parentheses * Update api/http/security/bouncer.go * refactor(edge-stacks): move config inspect to endpoints handler * refactor(endpoints): move stack inspect to edge handler * style(security): fix typo Co-Authored-By: Anthony Lapenna <anthony.lapenna@portainer.io> * refactor(endpoints): rename file Co-authored-by: Anthony Lapenna <anthony.lapenna@portainer.io> * feat(edge-groups): add dynamic group endpoints table (#3780) * fix(edge-stacks): update version when updating stack files (#3778) * feat(edgestacks): change status permission to edge enpoints * feat(edge-compute): add stack info to edge status inspect (#3764) * feat(edge-compute): create helper functions * feat(endpoints): add relation object and service * feat(db): create endpoint relation migration * feat(endpoints): create relation when creating endpoint * feat(endpoints): update relation when updating endpoint * feat(endpoints): delete relation when deleting endpoint * feat(endpoint): add stack status to endpoint_status * feat(edge-stacks): connect new edge stack to endpoint * refactor(edgestack): return errors.New * refactor(edgestacks): return error * refactor(edgegroup): endpoint can be related only if edge endpoint * feat(endpoints): update relation only when tags or groups were changd * refactor(tags): change tags functions to set functions * refactor(edgestack): return a list of endpoints for a list of edgegroups * feat(edgestacks): update relation when updating stack * feat(edgestacks): remove relations when deleting edge stack * feat(edgegroup): update related endpoints * feat(endpoint-group): update endpoints relations on create * feat(endpointgroup): add relatd stacks to endpoint when added to group * feat(endpoint-groups): update relation when group is changed * feat(endpointgroup): when deleting group, update its endpoints relations * feat(tags): update related endpoints when deleting tag * refactor(edge-compute): use pointers * refactor(endpointgroup): handle unassociated endpoint * fix(edgestack): show correct stack status * fix(endpoint): remove deleted endpoint from related tags * feat(edge-stacks): change acknowledged status color to blue (#3810) * feat(edge-compute): provide stack name to edge endpoint (#3809) * feat(edge-groups): when no tags selected show empty list of endpoints (#3811) * feat(edge-groups): when no tags selected show empty list of endpoints * fix(edge-group): change empty associated endpoint text * fix(edge-compute): add missing relations updates (#3817) * fix(endpoint): remove deleted endpoint from edge group * fix(tags): remove deleted tag from edge group * fix(endpoint): remove deleted endpoint from edge stack * fix(edge-groups): remove clearing of edgeGroup fields * fix(edge-groups): show dynamic edge groups without tags * fix(edge-compute): use sequential delete in resources (#3818) * fix(endpoints): delete endpoints on by one * fix(tags): remove tags one by one * fix(groups): remove endpoint groups one by one * fix(edge-stacks): remove stack one by one * fix(edge-groups): remove edge group one by one * fix(edge-stacks): add link to root in breadcrumbs * style(edge): add empty line after errors * refactor(tags): remove old function * refactor(endpoints): revert changes to multi-endpoint-selector * feat(edge-stacks): support Edge stack templates (#3812) * feat(edge-compute): fetch templates from url * feat(edge-stacks): fetch edge templates * feat(edge-stacks): choose template and save * feat(edge-stacks): add placeholder to templates select * feat(edge-templates): show info * fix(edge-stacks): fix typo * feat(edge-templates): replace template url * feat(edge-compute): use custom url if available * fix(edge-stacks): show error message when failing * feat(edge-compute): show description in template * feat(edge-templates): change access to route * style(edge-compute): change EdgeTemplatesURL description Co-authored-by: Anthony Lapenna <anthony.lapenna@portainer.io> Co-authored-by: Anthony Lapenna <anthony.lapenna@portainer.io> Co-authored-by: Anthony Lapenna <anthony.lapenna@portainer.io> Co-authored-by: Anthony Lapenna <lapenna.anthony@gmail.com> Co-authored-by: itsconquest <william.conquest@portainer.io> Co-authored-by: Ben Brooks <ben@bbrks.me> Co-authored-by: Neil Cresswell <neil@cresswell.net.nz>
5 years ago
if err != nil {
return nil, httperror.InternalServerError("Unable to retrieve relation object from the database", err)
feat(edge-compute): add support for Edge stacks (#3827) * feat(api): introduce Edge group API (#3639) * feat(edge-groups): add object definition and service definition * feat(edge-groups): implement bolt layer * feat(edge-groups): bind service to server * feat(edge-group): add edge-group create http handler * feat(edge-groups): add list method to edge group handler * feat(edge-group): add inspect http handler * feat(edge-groups): add delete edge-group handler * feat(edge-groups): add update group handler * style(db): order by alphabetical order * fix(edge-groups): rewrite http error messages Co-Authored-By: Anthony Lapenna <anthony.lapenna@portainer.io> * fix(main): order by alphabetical order * refactor(edge-group): relocate fetch group * fix(edge-group): reset tagids/endpoints if dynamic * refactor(server): order by alphabetical order * refactor(server): order by alphabetical order Co-authored-by: Anthony Lapenna <anthony.lapenna@portainer.io> * Introduce a new setting to enable Edge compute features (#3654) * feat(edge-compute): add edge compute setting * feat(edge-compute): add edge compute group to sidebar * fix(settings): rename settings form group * fix(settings): align form control * Edge group associated endpoints (#3659) * chore(version): bump version number * chore(version): bump version number * feat(endpoints): filter by endpoint type (#3646) * refactor(tags): migrate tags to have association objects * refactor(tags): refactor tag management (#3628) * refactor(tags): replace tags with tag ids * refactor(tags): revert tags to be strings and add tagids * refactor(tags): enable search by tag in home view * refactor(tags): show endpoint tags * refactor(endpoints): expect tagIds on create payload * refactor(endpoints): expect tagIds on update payload * refactor(endpoints): replace TagIds to TagIDs * refactor(endpoints): set endpoint group to get TagIDs * refactor(endpoints): refactor tag-selector to receive tag-ids * refactor(endpoints): show tags in multi-endpoint-selector * chore(tags): revert reformat * refactor(endpoints): remove unneeded bind * refactor(endpoints): change param tags to tagids in endpoint create * refactor(endpoints): remove console.log * refactor(tags): remove deleted tag from endpoint and endpoint group * fix(endpoints): show loading label while loading tags * chore(go): remove obsolete import labels * chore(db): add db version comment * fix(db): add tag service to migrator * refactor(db): add error checks in migrator * style(db): sort props in alphabetical order * style(tags): fix typo Co-Authored-By: Anthony Lapenna <anthony.lapenna@portainer.io> * refactor(endpoints): replace tagsMap with tag string representation * refactor(tags): rewrite tag delete to be more readable * refactor(home): rearange code to match former style * refactor(tags): guard against missing model in tag-selector * refactor(tags): rename vars in tag_delete * refactor(tags): allow any authenticated user to fetch tag list * refactor(endpoints): replace controller function with class * refactor(endpoints): replace function with helper * refactor(endpoints): replace controller with class * refactor(tags): revert tags-selector to use 1 way bindings * refactor(endpoints): load empty tag array instead of nil * refactor(endpoints): revert default tag ids * refactor(endpoints): use function in place * refactor(tags): use lodash * style(tags): use parens in arrow functions * fix(tags): remove tag from tag model Co-authored-by: Anthony Lapenna <anthony.lapenna@portainer.io> * refactor(tags): create tag association when creating tag * refactor(tags): delete tag association when deleting tag * refactor(db): handle error in tag association create * feat(endpoint-group): update tag assoc when creating endpoint group * feat(endpoint-group): update tag association when updating group * feat(endpoint-groups): remove group from tag associations * feat(endpoints): associate endpoint with tag on create * feat(endpoints): edit tag association when updating endpoint * fix(tags): fix merge problems * refactor(tags): remove tag association resource * fix(db): use regular tags map * style(tags): reorder props and imports * refactor(endpoint-groups): replace tag-association with tag * feat(edge-group): get associated endpoints when fetching * refactor(tags): refactor algo to update endpoint and group tags * refactor(edge-group): rename variable * refactor(tags): move calc of tags to remove to global function * fix(tags): update tag after adding association Co-authored-by: Anthony Lapenna <lapenna.anthony@gmail.com> Co-authored-by: Anthony Lapenna <anthony.lapenna@portainer.io> * fix(edge-groups): associate groups only with edge endpoints (#3667) * fix(edge-groups): check endpoint type when adding to edge-group * fix(edge-groups): return only edge endpoints for dynamic groups * fix(edge-compute): load edge compute setting on public setting (#3665) * Edge group list (#3644) * feat(edge-groups): add edge module * feat(edge-groups): add edge-group service * feat(edge-group): add groups list view * feat(edge-groups): add link to groups in the sidebar * feat(edge-group): show endpoints count and group type * feat(edge-group): enable removal of edge groups * refactor(edge-groups): replace datatable controller with class * refactor(edge-groups): replace function with class * fix(edge-groups): sort items by endpoints count and group type * refactor(edge-groups): use generic datatable-header component * feat(app): add trace for ui router * fix(edge-compute): add ng injection to onEnter guard * fix(edge-compute): add ng injection to onEnter guard * style(edge-compute): remove space * refactor(edge-compute): import angular * fix(app): remove ui router trace * refactor(product): revert app.js * fix(edge-compute): remove admin guard from edge routes * fix(edge-groups): change label of empty datatable Co-Authored-By: Anthony Lapenna <anthony.lapenna@portainer.io> * refactor(edge-groups): rename service * fix(edge-groups): replace icon in sidebar Co-Authored-By: Anthony Lapenna <anthony.lapenna@portainer.io> * refactor(edge-groups): remove datatable controller * refactor(edge-groups): move datatable icon to binding * refactor(edge-groups): use vanilla datatable header * refactor(datatable): remove datatable header Co-authored-by: Anthony Lapenna <anthony.lapenna@portainer.io> * refactor(edge): rename edge group to Edge group * feat(edge-groups): edge group creation view (#3671) * feat(edge-groups): add create group view * feat(edge-groups): allow to choose group type * feat(edge-groups): implement create service handler * feat(edge-group): filter by edge endpoints * refactor(edge-groups): rename to camel case * refactor(edge-groups): replace controller with class * feat(endpoints): filter endpoints by type * refactor(edge-groups): remove comments and unneccesary async keyword * refactor(edge-group): use $async service * fix(edge-groups): replace view title Co-Authored-By: Anthony Lapenna <anthony.lapenna@portainer.io> * fix(edge-groups): change icon Co-Authored-By: Anthony Lapenna <anthony.lapenna@portainer.io> * fix(edge-groups): change icon Co-Authored-By: Anthony Lapenna <anthony.lapenna@portainer.io> * refactor(edge-groups): remove obsolete function * feat(edge-groups): add empty list messages * feat(edge-group): add description to group types * refactor(edge-groups): add finally block * feat(endpoints): search server in multi-endpoint-selector Co-authored-by: Anthony Lapenna <anthony.lapenna@portainer.io> * feat(edge-group) edit view (#3672) * feat(edge-groups): add edit group view * refactor(edge-group): replace edit controller with class * refactor(edge-groups): remove async keyword * refactor(edge-groups): use $async service * refactor(edge-group): remove unnecessary functions * fix(endpoints): group by groups in endpoint-selector * feat(edge-groups): minor UI update * fix(edge-groups): provide defaults for edge group (#3682) * feat(edge-stacks): add basic views and sidebar link (#3689) * feat(edge-stacks): add mock routes * feat(edge-stacks): add link to stacks on sidebar * feat(edge-stacks): add edge stacks view * feat(edge-stacks): add create view * feat(edge-stacks): add edit view * fix(edge-stacks): use class in controller * feat(edge-stacks): add edge-stacks api (#3688) * feat(edge-stack): add edge stack types * feat(edge-stacks): add edge stack service interface * feat(edge-stacks): implement store * feat(edge-stacks): bind service to datastore * feat(edge-stacks): bind service to server * feat(edge-stack): create basic api * feat(edge-stack): create stack api * feat(edge-stacks): update api * refacotor(edge-stack): rename files * feat(edge-stack): update endpoint status * style(edge-stacks): remove comments * feat(edge-stacks): use edge stacks folder for files * fix(edge-stacks): replace bucket name Co-Authored-By: Anthony Lapenna <anthony.lapenna@portainer.io> * fix(edge-stacks): replace unmarshal function Co-Authored-By: Anthony Lapenna <anthony.lapenna@portainer.io> * fix(edge-stacks): replace edge stacks path Co-Authored-By: Anthony Lapenna <anthony.lapenna@portainer.io> Co-authored-by: Anthony Lapenna <anthony.lapenna@portainer.io> * chore(git): merge develop to edge compute (#3692) * feat(support): make support type dynamic (#3621) * chore(version): bump version number * chore(version): bump version number * feat(endpoints): filter by endpoint type (#3646) * chore(assets): double UI image resolutions for HiDPI displays (#3648) Fixes #3069 Prevents users seeing blurry logos and other images when using a hidpi display (like scaled 4k, or a Retina display). These images have been recreated manually with 2x the original resolution but should resemble the originals as much as possible. They have also been run through pngcrush for compression. * fix(services): enforce minimum replica count of 0 (#3653) * fix(services): enforce minimum replica count of 0 Fixes #3652 Prevents replica count from being set below zero and causing an error. * fix(services): enforce replica count is an integer Prevents users entering decimals in the replica count * refactor(tags): refactor tag management (#3628) * refactor(tags): replace tags with tag ids * refactor(tags): revert tags to be strings and add tagids * refactor(tags): enable search by tag in home view * refactor(tags): show endpoint tags * refactor(endpoints): expect tagIds on create payload * refactor(endpoints): expect tagIds on update payload * refactor(endpoints): replace TagIds to TagIDs * refactor(endpoints): set endpoint group to get TagIDs * refactor(endpoints): refactor tag-selector to receive tag-ids * refactor(endpoints): show tags in multi-endpoint-selector * chore(tags): revert reformat * refactor(endpoints): remove unneeded bind * refactor(endpoints): change param tags to tagids in endpoint create * refactor(endpoints): remove console.log * refactor(tags): remove deleted tag from endpoint and endpoint group * fix(endpoints): show loading label while loading tags * chore(go): remove obsolete import labels * chore(db): add db version comment * fix(db): add tag service to migrator * refactor(db): add error checks in migrator * style(db): sort props in alphabetical order * style(tags): fix typo Co-Authored-By: Anthony Lapenna <anthony.lapenna@portainer.io> * refactor(endpoints): replace tagsMap with tag string representation * refactor(tags): rewrite tag delete to be more readable * refactor(home): rearange code to match former style * refactor(tags): guard against missing model in tag-selector * refactor(tags): rename vars in tag_delete * refactor(tags): allow any authenticated user to fetch tag list * refactor(endpoints): replace controller function with class * refactor(endpoints): replace function with helper * refactor(endpoints): replace controller with class * refactor(tags): revert tags-selector to use 1 way bindings * refactor(endpoints): load empty tag array instead of nil * refactor(endpoints): revert default tag ids * refactor(endpoints): use function in place * refactor(tags): use lodash * style(tags): use parens in arrow functions * fix(tags): remove tag from tag model Co-authored-by: Anthony Lapenna <anthony.lapenna@portainer.io> * chore(yarn): change start:client to start webpack dev server (#3595) * chore(yarn): change start:client to start webpack dev server * Update package.json Co-authored-by: Anthony Lapenna <anthony.lapenna@portainer.io> * create tag from tag selector (#3640) * feat(tags): add button to save tag when doesn't exist * feat(endpoints): allow the creating of tags in endpoint edit * feat(groups): allow user to create tags in create group * feat(groups): allow user to create tags in edit group * feat(endpoint): allow user to create tags from endpoint create * feat(tags): allow the creation of a new tag from dropdown * feat(tag): replace "add" with "create" * feat(tags): show tags input when not tags * feat(tags): hide create message when not allowed * refactor(tags): replace component controller with class * refactor(tags): replace native methods with lodash * refactor(tags): remove unused onChangeTags function * refactor(tags): remove on-change binding * style(tags): remove white space * refactor(endpoint-groups): move controller to separate file * fix(groups): allow admin to create tag in group form * refactor(endpoints): wrap async function with try catch and $async * style(tags): wrap arrow function args with parenthesis * refactor(endpoints): return $async functions * refactor(tags): throw error in the format Notification expects * chore(yarn): add start:client script back (#3691) * feat(endpoints): filter by ids and/or tag ids (#3690) * feat(endpoints): add filter by tagIds * refactor(endpoints): change endpoints service to query by tagIds * fix(endpoints): filter by tags * feat(endpoints): filter by endpoint groups tags * feat(endpoints): filter by ids Co-authored-by: itsconquest <william.conquest@portainer.io> Co-authored-by: Anthony Lapenna <lapenna.anthony@gmail.com> Co-authored-by: Ben Brooks <ben@bbrks.me> Co-authored-by: Anthony Lapenna <anthony.lapenna@portainer.io> * Chore merge develop to edge compute (#3702) * feat(support): make support type dynamic (#3621) * chore(version): bump version number * chore(version): bump version number * feat(endpoints): filter by endpoint type (#3646) * chore(assets): double UI image resolutions for HiDPI displays (#3648) Fixes #3069 Prevents users seeing blurry logos and other images when using a hidpi display (like scaled 4k, or a Retina display). These images have been recreated manually with 2x the original resolution but should resemble the originals as much as possible. They have also been run through pngcrush for compression. * fix(services): enforce minimum replica count of 0 (#3653) * fix(services): enforce minimum replica count of 0 Fixes #3652 Prevents replica count from being set below zero and causing an error. * fix(services): enforce replica count is an integer Prevents users entering decimals in the replica count * refactor(tags): refactor tag management (#3628) * refactor(tags): replace tags with tag ids * refactor(tags): revert tags to be strings and add tagids * refactor(tags): enable search by tag in home view * refactor(tags): show endpoint tags * refactor(endpoints): expect tagIds on create payload * refactor(endpoints): expect tagIds on update payload * refactor(endpoints): replace TagIds to TagIDs * refactor(endpoints): set endpoint group to get TagIDs * refactor(endpoints): refactor tag-selector to receive tag-ids * refactor(endpoints): show tags in multi-endpoint-selector * chore(tags): revert reformat * refactor(endpoints): remove unneeded bind * refactor(endpoints): change param tags to tagids in endpoint create * refactor(endpoints): remove console.log * refactor(tags): remove deleted tag from endpoint and endpoint group * fix(endpoints): show loading label while loading tags * chore(go): remove obsolete import labels * chore(db): add db version comment * fix(db): add tag service to migrator * refactor(db): add error checks in migrator * style(db): sort props in alphabetical order * style(tags): fix typo Co-Authored-By: Anthony Lapenna <anthony.lapenna@portainer.io> * refactor(endpoints): replace tagsMap with tag string representation * refactor(tags): rewrite tag delete to be more readable * refactor(home): rearange code to match former style * refactor(tags): guard against missing model in tag-selector * refactor(tags): rename vars in tag_delete * refactor(tags): allow any authenticated user to fetch tag list * refactor(endpoints): replace controller function with class * refactor(endpoints): replace function with helper * refactor(endpoints): replace controller with class * refactor(tags): revert tags-selector to use 1 way bindings * refactor(endpoints): load empty tag array instead of nil * refactor(endpoints): revert default tag ids * refactor(endpoints): use function in place * refactor(tags): use lodash * style(tags): use parens in arrow functions * fix(tags): remove tag from tag model Co-authored-by: Anthony Lapenna <anthony.lapenna@portainer.io> * chore(yarn): change start:client to start webpack dev server (#3595) * chore(yarn): change start:client to start webpack dev server * Update package.json Co-authored-by: Anthony Lapenna <anthony.lapenna@portainer.io> * create tag from tag selector (#3640) * feat(tags): add button to save tag when doesn't exist * feat(endpoints): allow the creating of tags in endpoint edit * feat(groups): allow user to create tags in create group * feat(groups): allow user to create tags in edit group * feat(endpoint): allow user to create tags from endpoint create * feat(tags): allow the creation of a new tag from dropdown * feat(tag): replace "add" with "create" * feat(tags): show tags input when not tags * feat(tags): hide create message when not allowed * refactor(tags): replace component controller with class * refactor(tags): replace native methods with lodash * refactor(tags): remove unused onChangeTags function * refactor(tags): remove on-change binding * style(tags): remove white space * refactor(endpoint-groups): move controller to separate file * fix(groups): allow admin to create tag in group form * refactor(endpoints): wrap async function with try catch and $async * style(tags): wrap arrow function args with parenthesis * refactor(endpoints): return $async functions * refactor(tags): throw error in the format Notification expects * chore(yarn): add start:client script back (#3691) * feat(endpoints): filter by ids and/or tag ids (#3690) * feat(endpoints): add filter by tagIds * refactor(endpoints): change endpoints service to query by tagIds * fix(endpoints): filter by tags * feat(endpoints): filter by endpoint groups tags * feat(endpoints): filter by ids * refactor(project): sort portainer types and interface definitions (#3694) * refactor(portainer): sort types * style(portainer): add comment about role service * refactor(portainer): sort interface types * refactor(portainer): sort enums * Update README.md * Update README.md * Update README.md * chore(project): add prettier for code format (#3645) * chore(project): install prettier and lint-staged * chore(project): apply prettier to html too * chore(project): git ignore eslintcache * chore(project): add a comment about format script * chore(prettier): update printWidth * chore(prettier): remove useTabs option * chore(prettier): add HTML validation * refactor(prettier): fix closing tags * feat(prettier): define angular parser for html templates * style(prettier): run prettier on codebase Co-authored-by: Anthony Lapenna <lapenna.anthony@gmail.com> * chore(prettier): run format on client codebase Co-authored-by: itsconquest <william.conquest@portainer.io> Co-authored-by: Anthony Lapenna <lapenna.anthony@gmail.com> Co-authored-by: Ben Brooks <ben@bbrks.me> Co-authored-by: Anthony Lapenna <anthony.lapenna@portainer.io> Co-authored-by: Neil Cresswell <neil@cresswell.net.nz> * feat(edge-stacks): create basic edge stack service (#3704) Co-authored-by: Anthony Lapenna <anthony.lapenna@portainer.io> * feat(edge-groups): Provide a switch to use AND or OR for tags (#3695) * feat(edge-groups): add switch to form * feat(project): add property to EdgeGroup * feat(edge-groups): save mustHaveAllTags * feat(edge-groups): fetch associated endpoints (AND and OR) * feat(edge-groups): add AND selector * feat(edge-groups): default to AND * fix(edge-groups): rewrite selector options Co-Authored-By: Anthony Lapenna <anthony.lapenna@portainer.io> * refactor(endpoints): move margin to schedule form * fix(edge-groups): move the selector to top of group * refactor(edge-groups): replace partialMatch property Co-authored-by: Anthony Lapenna <anthony.lapenna@portainer.io> * feat(edge-stacks): add Edge stack creation view (#3705) * feat(edge-stacks): basic creation view * feat(edge-stacks): add group selector * feat(edge-stack): create edge stack * fix(code-editor): apply digest cycle after editor is changed * style(project): reformat constants file * feat(edge-stacks): add a note about missing edge groups * fix(edge-stacks): add groups when creating stack from file * feat(edge-groups): add associated endpoints table (#3710) * feat(edge-groups): load associated endpoints * feat(endpoints): add option to filter endpoint by partial match tags * feat(edge-groups): query endpoints by PartialMatch * feat(edge-groups): reload endpoints when form changes * feat(edge-groups): remove columns * feat(edge-group): remove url column * refactor(edge-group): remove props * feat(edge-stacks): add list view (#3713) * feat(edge-stacks): basic datatable * feat(edge-stacks): remove stack * refactor(edge-stacks): convert to class * refactor(edge-stacks): replace id with stackId * feat(edge-stacks) edit edge stack view (#3716) * feat(edge-stack): load file content * feat(edge-stack): edit view * feat(edge-stack): enable update stack * refactor(edge-stacks): move form to component * feat(edge-stacks): add endpoints status * feat(edge-stacks): minor UI update Co-authored-by: Anthony Lapenna <lapenna.anthony@gmail.com> * feat(edge-groups) prevent deletion of edge group used by an edge stack (#3722) * feat(edge-groups): show if group belonges to edge stack * feat(edge-group): protect deletion of used edge group * feat(edge-groups): diable selection of used group * feat(edge-groups): add inuse tag (#3739) * feat(edge-groups): add inuse tag * Update app/edge/components/groups-datatable/groupsDatatable.html Co-authored-by: Anthony Lapenna <anthony.lapenna@portainer.io> * feat(edge-stack): update stack version when stack file is changed (#3746) * feat(edge-stack): update version when stack file is changed * refactor(edge-stacks): move update of version to clientside * feat(edge-groups): replace Edge group endpoint selector (#3738) * feat(edge-groups): replace selector * feat(edge-group): add selector in edit form * feat(edge-groups): show tags in endpoint selector * feat(edge-groups): show the endpoint group name * fix(edge-group): remove element from associated endpoints * feat(edge-groups): add group column * feat(edge-groups): move endpoints to other column * fix(groups): disable sort * refactor(endpoints): toggle backend pagination as a property * fix(endpoints): show group name in group-association-table * feat(endpoints): truncate table columns * fix(endpoints): update group association table colspan * fix(endpoint-groups): show dash when no tags Co-authored-by: Anthony Lapenna <lapenna.anthony@gmail.com> * feat(edge-stacks): add api for edge to query stack config (#3748) * refactor(http): move edge validation to bouncer * feat(edge-stacks): add api for edge to query stack config * style(edge-stack): remove parentheses * Update api/http/security/bouncer.go * refactor(edge-stacks): move config inspect to endpoints handler * refactor(endpoints): move stack inspect to edge handler * style(security): fix typo Co-Authored-By: Anthony Lapenna <anthony.lapenna@portainer.io> * refactor(endpoints): rename file Co-authored-by: Anthony Lapenna <anthony.lapenna@portainer.io> * feat(edge-groups): add dynamic group endpoints table (#3780) * fix(edge-stacks): update version when updating stack files (#3778) * feat(edgestacks): change status permission to edge enpoints * feat(edge-compute): add stack info to edge status inspect (#3764) * feat(edge-compute): create helper functions * feat(endpoints): add relation object and service * feat(db): create endpoint relation migration * feat(endpoints): create relation when creating endpoint * feat(endpoints): update relation when updating endpoint * feat(endpoints): delete relation when deleting endpoint * feat(endpoint): add stack status to endpoint_status * feat(edge-stacks): connect new edge stack to endpoint * refactor(edgestack): return errors.New * refactor(edgestacks): return error * refactor(edgegroup): endpoint can be related only if edge endpoint * feat(endpoints): update relation only when tags or groups were changd * refactor(tags): change tags functions to set functions * refactor(edgestack): return a list of endpoints for a list of edgegroups * feat(edgestacks): update relation when updating stack * feat(edgestacks): remove relations when deleting edge stack * feat(edgegroup): update related endpoints * feat(endpoint-group): update endpoints relations on create * feat(endpointgroup): add relatd stacks to endpoint when added to group * feat(endpoint-groups): update relation when group is changed * feat(endpointgroup): when deleting group, update its endpoints relations * feat(tags): update related endpoints when deleting tag * refactor(edge-compute): use pointers * refactor(endpointgroup): handle unassociated endpoint * fix(edgestack): show correct stack status * fix(endpoint): remove deleted endpoint from related tags * feat(edge-stacks): change acknowledged status color to blue (#3810) * feat(edge-compute): provide stack name to edge endpoint (#3809) * feat(edge-groups): when no tags selected show empty list of endpoints (#3811) * feat(edge-groups): when no tags selected show empty list of endpoints * fix(edge-group): change empty associated endpoint text * fix(edge-compute): add missing relations updates (#3817) * fix(endpoint): remove deleted endpoint from edge group * fix(tags): remove deleted tag from edge group * fix(endpoint): remove deleted endpoint from edge stack * fix(edge-groups): remove clearing of edgeGroup fields * fix(edge-groups): show dynamic edge groups without tags * fix(edge-compute): use sequential delete in resources (#3818) * fix(endpoints): delete endpoints on by one * fix(tags): remove tags one by one * fix(groups): remove endpoint groups one by one * fix(edge-stacks): remove stack one by one * fix(edge-groups): remove edge group one by one * fix(edge-stacks): add link to root in breadcrumbs * style(edge): add empty line after errors * refactor(tags): remove old function * refactor(endpoints): revert changes to multi-endpoint-selector * feat(edge-stacks): support Edge stack templates (#3812) * feat(edge-compute): fetch templates from url * feat(edge-stacks): fetch edge templates * feat(edge-stacks): choose template and save * feat(edge-stacks): add placeholder to templates select * feat(edge-templates): show info * fix(edge-stacks): fix typo * feat(edge-templates): replace template url * feat(edge-compute): use custom url if available * fix(edge-stacks): show error message when failing * feat(edge-compute): show description in template * feat(edge-templates): change access to route * style(edge-compute): change EdgeTemplatesURL description Co-authored-by: Anthony Lapenna <anthony.lapenna@portainer.io> Co-authored-by: Anthony Lapenna <anthony.lapenna@portainer.io> Co-authored-by: Anthony Lapenna <anthony.lapenna@portainer.io> Co-authored-by: Anthony Lapenna <lapenna.anthony@gmail.com> Co-authored-by: itsconquest <william.conquest@portainer.io> Co-authored-by: Ben Brooks <ben@bbrks.me> Co-authored-by: Neil Cresswell <neil@cresswell.net.nz>
5 years ago
}
edgeStacksStatus := []stackStatusResponse{}
for stackID := range relation.EdgeStacks {
version, ok := tx.EdgeStack().EdgeStackVersion(stackID)
if !ok {
return nil, httperror.InternalServerError("Unable to retrieve edge stack from the database", err)
feat(edge-compute): add support for Edge stacks (#3827) * feat(api): introduce Edge group API (#3639) * feat(edge-groups): add object definition and service definition * feat(edge-groups): implement bolt layer * feat(edge-groups): bind service to server * feat(edge-group): add edge-group create http handler * feat(edge-groups): add list method to edge group handler * feat(edge-group): add inspect http handler * feat(edge-groups): add delete edge-group handler * feat(edge-groups): add update group handler * style(db): order by alphabetical order * fix(edge-groups): rewrite http error messages Co-Authored-By: Anthony Lapenna <anthony.lapenna@portainer.io> * fix(main): order by alphabetical order * refactor(edge-group): relocate fetch group * fix(edge-group): reset tagids/endpoints if dynamic * refactor(server): order by alphabetical order * refactor(server): order by alphabetical order Co-authored-by: Anthony Lapenna <anthony.lapenna@portainer.io> * Introduce a new setting to enable Edge compute features (#3654) * feat(edge-compute): add edge compute setting * feat(edge-compute): add edge compute group to sidebar * fix(settings): rename settings form group * fix(settings): align form control * Edge group associated endpoints (#3659) * chore(version): bump version number * chore(version): bump version number * feat(endpoints): filter by endpoint type (#3646) * refactor(tags): migrate tags to have association objects * refactor(tags): refactor tag management (#3628) * refactor(tags): replace tags with tag ids * refactor(tags): revert tags to be strings and add tagids * refactor(tags): enable search by tag in home view * refactor(tags): show endpoint tags * refactor(endpoints): expect tagIds on create payload * refactor(endpoints): expect tagIds on update payload * refactor(endpoints): replace TagIds to TagIDs * refactor(endpoints): set endpoint group to get TagIDs * refactor(endpoints): refactor tag-selector to receive tag-ids * refactor(endpoints): show tags in multi-endpoint-selector * chore(tags): revert reformat * refactor(endpoints): remove unneeded bind * refactor(endpoints): change param tags to tagids in endpoint create * refactor(endpoints): remove console.log * refactor(tags): remove deleted tag from endpoint and endpoint group * fix(endpoints): show loading label while loading tags * chore(go): remove obsolete import labels * chore(db): add db version comment * fix(db): add tag service to migrator * refactor(db): add error checks in migrator * style(db): sort props in alphabetical order * style(tags): fix typo Co-Authored-By: Anthony Lapenna <anthony.lapenna@portainer.io> * refactor(endpoints): replace tagsMap with tag string representation * refactor(tags): rewrite tag delete to be more readable * refactor(home): rearange code to match former style * refactor(tags): guard against missing model in tag-selector * refactor(tags): rename vars in tag_delete * refactor(tags): allow any authenticated user to fetch tag list * refactor(endpoints): replace controller function with class * refactor(endpoints): replace function with helper * refactor(endpoints): replace controller with class * refactor(tags): revert tags-selector to use 1 way bindings * refactor(endpoints): load empty tag array instead of nil * refactor(endpoints): revert default tag ids * refactor(endpoints): use function in place * refactor(tags): use lodash * style(tags): use parens in arrow functions * fix(tags): remove tag from tag model Co-authored-by: Anthony Lapenna <anthony.lapenna@portainer.io> * refactor(tags): create tag association when creating tag * refactor(tags): delete tag association when deleting tag * refactor(db): handle error in tag association create * feat(endpoint-group): update tag assoc when creating endpoint group * feat(endpoint-group): update tag association when updating group * feat(endpoint-groups): remove group from tag associations * feat(endpoints): associate endpoint with tag on create * feat(endpoints): edit tag association when updating endpoint * fix(tags): fix merge problems * refactor(tags): remove tag association resource * fix(db): use regular tags map * style(tags): reorder props and imports * refactor(endpoint-groups): replace tag-association with tag * feat(edge-group): get associated endpoints when fetching * refactor(tags): refactor algo to update endpoint and group tags * refactor(edge-group): rename variable * refactor(tags): move calc of tags to remove to global function * fix(tags): update tag after adding association Co-authored-by: Anthony Lapenna <lapenna.anthony@gmail.com> Co-authored-by: Anthony Lapenna <anthony.lapenna@portainer.io> * fix(edge-groups): associate groups only with edge endpoints (#3667) * fix(edge-groups): check endpoint type when adding to edge-group * fix(edge-groups): return only edge endpoints for dynamic groups * fix(edge-compute): load edge compute setting on public setting (#3665) * Edge group list (#3644) * feat(edge-groups): add edge module * feat(edge-groups): add edge-group service * feat(edge-group): add groups list view * feat(edge-groups): add link to groups in the sidebar * feat(edge-group): show endpoints count and group type * feat(edge-group): enable removal of edge groups * refactor(edge-groups): replace datatable controller with class * refactor(edge-groups): replace function with class * fix(edge-groups): sort items by endpoints count and group type * refactor(edge-groups): use generic datatable-header component * feat(app): add trace for ui router * fix(edge-compute): add ng injection to onEnter guard * fix(edge-compute): add ng injection to onEnter guard * style(edge-compute): remove space * refactor(edge-compute): import angular * fix(app): remove ui router trace * refactor(product): revert app.js * fix(edge-compute): remove admin guard from edge routes * fix(edge-groups): change label of empty datatable Co-Authored-By: Anthony Lapenna <anthony.lapenna@portainer.io> * refactor(edge-groups): rename service * fix(edge-groups): replace icon in sidebar Co-Authored-By: Anthony Lapenna <anthony.lapenna@portainer.io> * refactor(edge-groups): remove datatable controller * refactor(edge-groups): move datatable icon to binding * refactor(edge-groups): use vanilla datatable header * refactor(datatable): remove datatable header Co-authored-by: Anthony Lapenna <anthony.lapenna@portainer.io> * refactor(edge): rename edge group to Edge group * feat(edge-groups): edge group creation view (#3671) * feat(edge-groups): add create group view * feat(edge-groups): allow to choose group type * feat(edge-groups): implement create service handler * feat(edge-group): filter by edge endpoints * refactor(edge-groups): rename to camel case * refactor(edge-groups): replace controller with class * feat(endpoints): filter endpoints by type * refactor(edge-groups): remove comments and unneccesary async keyword * refactor(edge-group): use $async service * fix(edge-groups): replace view title Co-Authored-By: Anthony Lapenna <anthony.lapenna@portainer.io> * fix(edge-groups): change icon Co-Authored-By: Anthony Lapenna <anthony.lapenna@portainer.io> * fix(edge-groups): change icon Co-Authored-By: Anthony Lapenna <anthony.lapenna@portainer.io> * refactor(edge-groups): remove obsolete function * feat(edge-groups): add empty list messages * feat(edge-group): add description to group types * refactor(edge-groups): add finally block * feat(endpoints): search server in multi-endpoint-selector Co-authored-by: Anthony Lapenna <anthony.lapenna@portainer.io> * feat(edge-group) edit view (#3672) * feat(edge-groups): add edit group view * refactor(edge-group): replace edit controller with class * refactor(edge-groups): remove async keyword * refactor(edge-groups): use $async service * refactor(edge-group): remove unnecessary functions * fix(endpoints): group by groups in endpoint-selector * feat(edge-groups): minor UI update * fix(edge-groups): provide defaults for edge group (#3682) * feat(edge-stacks): add basic views and sidebar link (#3689) * feat(edge-stacks): add mock routes * feat(edge-stacks): add link to stacks on sidebar * feat(edge-stacks): add edge stacks view * feat(edge-stacks): add create view * feat(edge-stacks): add edit view * fix(edge-stacks): use class in controller * feat(edge-stacks): add edge-stacks api (#3688) * feat(edge-stack): add edge stack types * feat(edge-stacks): add edge stack service interface * feat(edge-stacks): implement store * feat(edge-stacks): bind service to datastore * feat(edge-stacks): bind service to server * feat(edge-stack): create basic api * feat(edge-stack): create stack api * feat(edge-stacks): update api * refacotor(edge-stack): rename files * feat(edge-stack): update endpoint status * style(edge-stacks): remove comments * feat(edge-stacks): use edge stacks folder for files * fix(edge-stacks): replace bucket name Co-Authored-By: Anthony Lapenna <anthony.lapenna@portainer.io> * fix(edge-stacks): replace unmarshal function Co-Authored-By: Anthony Lapenna <anthony.lapenna@portainer.io> * fix(edge-stacks): replace edge stacks path Co-Authored-By: Anthony Lapenna <anthony.lapenna@portainer.io> Co-authored-by: Anthony Lapenna <anthony.lapenna@portainer.io> * chore(git): merge develop to edge compute (#3692) * feat(support): make support type dynamic (#3621) * chore(version): bump version number * chore(version): bump version number * feat(endpoints): filter by endpoint type (#3646) * chore(assets): double UI image resolutions for HiDPI displays (#3648) Fixes #3069 Prevents users seeing blurry logos and other images when using a hidpi display (like scaled 4k, or a Retina display). These images have been recreated manually with 2x the original resolution but should resemble the originals as much as possible. They have also been run through pngcrush for compression. * fix(services): enforce minimum replica count of 0 (#3653) * fix(services): enforce minimum replica count of 0 Fixes #3652 Prevents replica count from being set below zero and causing an error. * fix(services): enforce replica count is an integer Prevents users entering decimals in the replica count * refactor(tags): refactor tag management (#3628) * refactor(tags): replace tags with tag ids * refactor(tags): revert tags to be strings and add tagids * refactor(tags): enable search by tag in home view * refactor(tags): show endpoint tags * refactor(endpoints): expect tagIds on create payload * refactor(endpoints): expect tagIds on update payload * refactor(endpoints): replace TagIds to TagIDs * refactor(endpoints): set endpoint group to get TagIDs * refactor(endpoints): refactor tag-selector to receive tag-ids * refactor(endpoints): show tags in multi-endpoint-selector * chore(tags): revert reformat * refactor(endpoints): remove unneeded bind * refactor(endpoints): change param tags to tagids in endpoint create * refactor(endpoints): remove console.log * refactor(tags): remove deleted tag from endpoint and endpoint group * fix(endpoints): show loading label while loading tags * chore(go): remove obsolete import labels * chore(db): add db version comment * fix(db): add tag service to migrator * refactor(db): add error checks in migrator * style(db): sort props in alphabetical order * style(tags): fix typo Co-Authored-By: Anthony Lapenna <anthony.lapenna@portainer.io> * refactor(endpoints): replace tagsMap with tag string representation * refactor(tags): rewrite tag delete to be more readable * refactor(home): rearange code to match former style * refactor(tags): guard against missing model in tag-selector * refactor(tags): rename vars in tag_delete * refactor(tags): allow any authenticated user to fetch tag list * refactor(endpoints): replace controller function with class * refactor(endpoints): replace function with helper * refactor(endpoints): replace controller with class * refactor(tags): revert tags-selector to use 1 way bindings * refactor(endpoints): load empty tag array instead of nil * refactor(endpoints): revert default tag ids * refactor(endpoints): use function in place * refactor(tags): use lodash * style(tags): use parens in arrow functions * fix(tags): remove tag from tag model Co-authored-by: Anthony Lapenna <anthony.lapenna@portainer.io> * chore(yarn): change start:client to start webpack dev server (#3595) * chore(yarn): change start:client to start webpack dev server * Update package.json Co-authored-by: Anthony Lapenna <anthony.lapenna@portainer.io> * create tag from tag selector (#3640) * feat(tags): add button to save tag when doesn't exist * feat(endpoints): allow the creating of tags in endpoint edit * feat(groups): allow user to create tags in create group * feat(groups): allow user to create tags in edit group * feat(endpoint): allow user to create tags from endpoint create * feat(tags): allow the creation of a new tag from dropdown * feat(tag): replace "add" with "create" * feat(tags): show tags input when not tags * feat(tags): hide create message when not allowed * refactor(tags): replace component controller with class * refactor(tags): replace native methods with lodash * refactor(tags): remove unused onChangeTags function * refactor(tags): remove on-change binding * style(tags): remove white space * refactor(endpoint-groups): move controller to separate file * fix(groups): allow admin to create tag in group form * refactor(endpoints): wrap async function with try catch and $async * style(tags): wrap arrow function args with parenthesis * refactor(endpoints): return $async functions * refactor(tags): throw error in the format Notification expects * chore(yarn): add start:client script back (#3691) * feat(endpoints): filter by ids and/or tag ids (#3690) * feat(endpoints): add filter by tagIds * refactor(endpoints): change endpoints service to query by tagIds * fix(endpoints): filter by tags * feat(endpoints): filter by endpoint groups tags * feat(endpoints): filter by ids Co-authored-by: itsconquest <william.conquest@portainer.io> Co-authored-by: Anthony Lapenna <lapenna.anthony@gmail.com> Co-authored-by: Ben Brooks <ben@bbrks.me> Co-authored-by: Anthony Lapenna <anthony.lapenna@portainer.io> * Chore merge develop to edge compute (#3702) * feat(support): make support type dynamic (#3621) * chore(version): bump version number * chore(version): bump version number * feat(endpoints): filter by endpoint type (#3646) * chore(assets): double UI image resolutions for HiDPI displays (#3648) Fixes #3069 Prevents users seeing blurry logos and other images when using a hidpi display (like scaled 4k, or a Retina display). These images have been recreated manually with 2x the original resolution but should resemble the originals as much as possible. They have also been run through pngcrush for compression. * fix(services): enforce minimum replica count of 0 (#3653) * fix(services): enforce minimum replica count of 0 Fixes #3652 Prevents replica count from being set below zero and causing an error. * fix(services): enforce replica count is an integer Prevents users entering decimals in the replica count * refactor(tags): refactor tag management (#3628) * refactor(tags): replace tags with tag ids * refactor(tags): revert tags to be strings and add tagids * refactor(tags): enable search by tag in home view * refactor(tags): show endpoint tags * refactor(endpoints): expect tagIds on create payload * refactor(endpoints): expect tagIds on update payload * refactor(endpoints): replace TagIds to TagIDs * refactor(endpoints): set endpoint group to get TagIDs * refactor(endpoints): refactor tag-selector to receive tag-ids * refactor(endpoints): show tags in multi-endpoint-selector * chore(tags): revert reformat * refactor(endpoints): remove unneeded bind * refactor(endpoints): change param tags to tagids in endpoint create * refactor(endpoints): remove console.log * refactor(tags): remove deleted tag from endpoint and endpoint group * fix(endpoints): show loading label while loading tags * chore(go): remove obsolete import labels * chore(db): add db version comment * fix(db): add tag service to migrator * refactor(db): add error checks in migrator * style(db): sort props in alphabetical order * style(tags): fix typo Co-Authored-By: Anthony Lapenna <anthony.lapenna@portainer.io> * refactor(endpoints): replace tagsMap with tag string representation * refactor(tags): rewrite tag delete to be more readable * refactor(home): rearange code to match former style * refactor(tags): guard against missing model in tag-selector * refactor(tags): rename vars in tag_delete * refactor(tags): allow any authenticated user to fetch tag list * refactor(endpoints): replace controller function with class * refactor(endpoints): replace function with helper * refactor(endpoints): replace controller with class * refactor(tags): revert tags-selector to use 1 way bindings * refactor(endpoints): load empty tag array instead of nil * refactor(endpoints): revert default tag ids * refactor(endpoints): use function in place * refactor(tags): use lodash * style(tags): use parens in arrow functions * fix(tags): remove tag from tag model Co-authored-by: Anthony Lapenna <anthony.lapenna@portainer.io> * chore(yarn): change start:client to start webpack dev server (#3595) * chore(yarn): change start:client to start webpack dev server * Update package.json Co-authored-by: Anthony Lapenna <anthony.lapenna@portainer.io> * create tag from tag selector (#3640) * feat(tags): add button to save tag when doesn't exist * feat(endpoints): allow the creating of tags in endpoint edit * feat(groups): allow user to create tags in create group * feat(groups): allow user to create tags in edit group * feat(endpoint): allow user to create tags from endpoint create * feat(tags): allow the creation of a new tag from dropdown * feat(tag): replace "add" with "create" * feat(tags): show tags input when not tags * feat(tags): hide create message when not allowed * refactor(tags): replace component controller with class * refactor(tags): replace native methods with lodash * refactor(tags): remove unused onChangeTags function * refactor(tags): remove on-change binding * style(tags): remove white space * refactor(endpoint-groups): move controller to separate file * fix(groups): allow admin to create tag in group form * refactor(endpoints): wrap async function with try catch and $async * style(tags): wrap arrow function args with parenthesis * refactor(endpoints): return $async functions * refactor(tags): throw error in the format Notification expects * chore(yarn): add start:client script back (#3691) * feat(endpoints): filter by ids and/or tag ids (#3690) * feat(endpoints): add filter by tagIds * refactor(endpoints): change endpoints service to query by tagIds * fix(endpoints): filter by tags * feat(endpoints): filter by endpoint groups tags * feat(endpoints): filter by ids * refactor(project): sort portainer types and interface definitions (#3694) * refactor(portainer): sort types * style(portainer): add comment about role service * refactor(portainer): sort interface types * refactor(portainer): sort enums * Update README.md * Update README.md * Update README.md * chore(project): add prettier for code format (#3645) * chore(project): install prettier and lint-staged * chore(project): apply prettier to html too * chore(project): git ignore eslintcache * chore(project): add a comment about format script * chore(prettier): update printWidth * chore(prettier): remove useTabs option * chore(prettier): add HTML validation * refactor(prettier): fix closing tags * feat(prettier): define angular parser for html templates * style(prettier): run prettier on codebase Co-authored-by: Anthony Lapenna <lapenna.anthony@gmail.com> * chore(prettier): run format on client codebase Co-authored-by: itsconquest <william.conquest@portainer.io> Co-authored-by: Anthony Lapenna <lapenna.anthony@gmail.com> Co-authored-by: Ben Brooks <ben@bbrks.me> Co-authored-by: Anthony Lapenna <anthony.lapenna@portainer.io> Co-authored-by: Neil Cresswell <neil@cresswell.net.nz> * feat(edge-stacks): create basic edge stack service (#3704) Co-authored-by: Anthony Lapenna <anthony.lapenna@portainer.io> * feat(edge-groups): Provide a switch to use AND or OR for tags (#3695) * feat(edge-groups): add switch to form * feat(project): add property to EdgeGroup * feat(edge-groups): save mustHaveAllTags * feat(edge-groups): fetch associated endpoints (AND and OR) * feat(edge-groups): add AND selector * feat(edge-groups): default to AND * fix(edge-groups): rewrite selector options Co-Authored-By: Anthony Lapenna <anthony.lapenna@portainer.io> * refactor(endpoints): move margin to schedule form * fix(edge-groups): move the selector to top of group * refactor(edge-groups): replace partialMatch property Co-authored-by: Anthony Lapenna <anthony.lapenna@portainer.io> * feat(edge-stacks): add Edge stack creation view (#3705) * feat(edge-stacks): basic creation view * feat(edge-stacks): add group selector * feat(edge-stack): create edge stack * fix(code-editor): apply digest cycle after editor is changed * style(project): reformat constants file * feat(edge-stacks): add a note about missing edge groups * fix(edge-stacks): add groups when creating stack from file * feat(edge-groups): add associated endpoints table (#3710) * feat(edge-groups): load associated endpoints * feat(endpoints): add option to filter endpoint by partial match tags * feat(edge-groups): query endpoints by PartialMatch * feat(edge-groups): reload endpoints when form changes * feat(edge-groups): remove columns * feat(edge-group): remove url column * refactor(edge-group): remove props * feat(edge-stacks): add list view (#3713) * feat(edge-stacks): basic datatable * feat(edge-stacks): remove stack * refactor(edge-stacks): convert to class * refactor(edge-stacks): replace id with stackId * feat(edge-stacks) edit edge stack view (#3716) * feat(edge-stack): load file content * feat(edge-stack): edit view * feat(edge-stack): enable update stack * refactor(edge-stacks): move form to component * feat(edge-stacks): add endpoints status * feat(edge-stacks): minor UI update Co-authored-by: Anthony Lapenna <lapenna.anthony@gmail.com> * feat(edge-groups) prevent deletion of edge group used by an edge stack (#3722) * feat(edge-groups): show if group belonges to edge stack * feat(edge-group): protect deletion of used edge group * feat(edge-groups): diable selection of used group * feat(edge-groups): add inuse tag (#3739) * feat(edge-groups): add inuse tag * Update app/edge/components/groups-datatable/groupsDatatable.html Co-authored-by: Anthony Lapenna <anthony.lapenna@portainer.io> * feat(edge-stack): update stack version when stack file is changed (#3746) * feat(edge-stack): update version when stack file is changed * refactor(edge-stacks): move update of version to clientside * feat(edge-groups): replace Edge group endpoint selector (#3738) * feat(edge-groups): replace selector * feat(edge-group): add selector in edit form * feat(edge-groups): show tags in endpoint selector * feat(edge-groups): show the endpoint group name * fix(edge-group): remove element from associated endpoints * feat(edge-groups): add group column * feat(edge-groups): move endpoints to other column * fix(groups): disable sort * refactor(endpoints): toggle backend pagination as a property * fix(endpoints): show group name in group-association-table * feat(endpoints): truncate table columns * fix(endpoints): update group association table colspan * fix(endpoint-groups): show dash when no tags Co-authored-by: Anthony Lapenna <lapenna.anthony@gmail.com> * feat(edge-stacks): add api for edge to query stack config (#3748) * refactor(http): move edge validation to bouncer * feat(edge-stacks): add api for edge to query stack config * style(edge-stack): remove parentheses * Update api/http/security/bouncer.go * refactor(edge-stacks): move config inspect to endpoints handler * refactor(endpoints): move stack inspect to edge handler * style(security): fix typo Co-Authored-By: Anthony Lapenna <anthony.lapenna@portainer.io> * refactor(endpoints): rename file Co-authored-by: Anthony Lapenna <anthony.lapenna@portainer.io> * feat(edge-groups): add dynamic group endpoints table (#3780) * fix(edge-stacks): update version when updating stack files (#3778) * feat(edgestacks): change status permission to edge enpoints * feat(edge-compute): add stack info to edge status inspect (#3764) * feat(edge-compute): create helper functions * feat(endpoints): add relation object and service * feat(db): create endpoint relation migration * feat(endpoints): create relation when creating endpoint * feat(endpoints): update relation when updating endpoint * feat(endpoints): delete relation when deleting endpoint * feat(endpoint): add stack status to endpoint_status * feat(edge-stacks): connect new edge stack to endpoint * refactor(edgestack): return errors.New * refactor(edgestacks): return error * refactor(edgegroup): endpoint can be related only if edge endpoint * feat(endpoints): update relation only when tags or groups were changd * refactor(tags): change tags functions to set functions * refactor(edgestack): return a list of endpoints for a list of edgegroups * feat(edgestacks): update relation when updating stack * feat(edgestacks): remove relations when deleting edge stack * feat(edgegroup): update related endpoints * feat(endpoint-group): update endpoints relations on create * feat(endpointgroup): add relatd stacks to endpoint when added to group * feat(endpoint-groups): update relation when group is changed * feat(endpointgroup): when deleting group, update its endpoints relations * feat(tags): update related endpoints when deleting tag * refactor(edge-compute): use pointers * refactor(endpointgroup): handle unassociated endpoint * fix(edgestack): show correct stack status * fix(endpoint): remove deleted endpoint from related tags * feat(edge-stacks): change acknowledged status color to blue (#3810) * feat(edge-compute): provide stack name to edge endpoint (#3809) * feat(edge-groups): when no tags selected show empty list of endpoints (#3811) * feat(edge-groups): when no tags selected show empty list of endpoints * fix(edge-group): change empty associated endpoint text * fix(edge-compute): add missing relations updates (#3817) * fix(endpoint): remove deleted endpoint from edge group * fix(tags): remove deleted tag from edge group * fix(endpoint): remove deleted endpoint from edge stack * fix(edge-groups): remove clearing of edgeGroup fields * fix(edge-groups): show dynamic edge groups without tags * fix(edge-compute): use sequential delete in resources (#3818) * fix(endpoints): delete endpoints on by one * fix(tags): remove tags one by one * fix(groups): remove endpoint groups one by one * fix(edge-stacks): remove stack one by one * fix(edge-groups): remove edge group one by one * fix(edge-stacks): add link to root in breadcrumbs * style(edge): add empty line after errors * refactor(tags): remove old function * refactor(endpoints): revert changes to multi-endpoint-selector * feat(edge-stacks): support Edge stack templates (#3812) * feat(edge-compute): fetch templates from url * feat(edge-stacks): fetch edge templates * feat(edge-stacks): choose template and save * feat(edge-stacks): add placeholder to templates select * feat(edge-templates): show info * fix(edge-stacks): fix typo * feat(edge-templates): replace template url * feat(edge-compute): use custom url if available * fix(edge-stacks): show error message when failing * feat(edge-compute): show description in template * feat(edge-templates): change access to route * style(edge-compute): change EdgeTemplatesURL description Co-authored-by: Anthony Lapenna <anthony.lapenna@portainer.io> Co-authored-by: Anthony Lapenna <anthony.lapenna@portainer.io> Co-authored-by: Anthony Lapenna <anthony.lapenna@portainer.io> Co-authored-by: Anthony Lapenna <lapenna.anthony@gmail.com> Co-authored-by: itsconquest <william.conquest@portainer.io> Co-authored-by: Ben Brooks <ben@bbrks.me> Co-authored-by: Neil Cresswell <neil@cresswell.net.nz>
5 years ago
}
stackStatus := stackStatusResponse{
ID: stackID,
Version: version,
feat(edge-compute): add support for Edge stacks (#3827) * feat(api): introduce Edge group API (#3639) * feat(edge-groups): add object definition and service definition * feat(edge-groups): implement bolt layer * feat(edge-groups): bind service to server * feat(edge-group): add edge-group create http handler * feat(edge-groups): add list method to edge group handler * feat(edge-group): add inspect http handler * feat(edge-groups): add delete edge-group handler * feat(edge-groups): add update group handler * style(db): order by alphabetical order * fix(edge-groups): rewrite http error messages Co-Authored-By: Anthony Lapenna <anthony.lapenna@portainer.io> * fix(main): order by alphabetical order * refactor(edge-group): relocate fetch group * fix(edge-group): reset tagids/endpoints if dynamic * refactor(server): order by alphabetical order * refactor(server): order by alphabetical order Co-authored-by: Anthony Lapenna <anthony.lapenna@portainer.io> * Introduce a new setting to enable Edge compute features (#3654) * feat(edge-compute): add edge compute setting * feat(edge-compute): add edge compute group to sidebar * fix(settings): rename settings form group * fix(settings): align form control * Edge group associated endpoints (#3659) * chore(version): bump version number * chore(version): bump version number * feat(endpoints): filter by endpoint type (#3646) * refactor(tags): migrate tags to have association objects * refactor(tags): refactor tag management (#3628) * refactor(tags): replace tags with tag ids * refactor(tags): revert tags to be strings and add tagids * refactor(tags): enable search by tag in home view * refactor(tags): show endpoint tags * refactor(endpoints): expect tagIds on create payload * refactor(endpoints): expect tagIds on update payload * refactor(endpoints): replace TagIds to TagIDs * refactor(endpoints): set endpoint group to get TagIDs * refactor(endpoints): refactor tag-selector to receive tag-ids * refactor(endpoints): show tags in multi-endpoint-selector * chore(tags): revert reformat * refactor(endpoints): remove unneeded bind * refactor(endpoints): change param tags to tagids in endpoint create * refactor(endpoints): remove console.log * refactor(tags): remove deleted tag from endpoint and endpoint group * fix(endpoints): show loading label while loading tags * chore(go): remove obsolete import labels * chore(db): add db version comment * fix(db): add tag service to migrator * refactor(db): add error checks in migrator * style(db): sort props in alphabetical order * style(tags): fix typo Co-Authored-By: Anthony Lapenna <anthony.lapenna@portainer.io> * refactor(endpoints): replace tagsMap with tag string representation * refactor(tags): rewrite tag delete to be more readable * refactor(home): rearange code to match former style * refactor(tags): guard against missing model in tag-selector * refactor(tags): rename vars in tag_delete * refactor(tags): allow any authenticated user to fetch tag list * refactor(endpoints): replace controller function with class * refactor(endpoints): replace function with helper * refactor(endpoints): replace controller with class * refactor(tags): revert tags-selector to use 1 way bindings * refactor(endpoints): load empty tag array instead of nil * refactor(endpoints): revert default tag ids * refactor(endpoints): use function in place * refactor(tags): use lodash * style(tags): use parens in arrow functions * fix(tags): remove tag from tag model Co-authored-by: Anthony Lapenna <anthony.lapenna@portainer.io> * refactor(tags): create tag association when creating tag * refactor(tags): delete tag association when deleting tag * refactor(db): handle error in tag association create * feat(endpoint-group): update tag assoc when creating endpoint group * feat(endpoint-group): update tag association when updating group * feat(endpoint-groups): remove group from tag associations * feat(endpoints): associate endpoint with tag on create * feat(endpoints): edit tag association when updating endpoint * fix(tags): fix merge problems * refactor(tags): remove tag association resource * fix(db): use regular tags map * style(tags): reorder props and imports * refactor(endpoint-groups): replace tag-association with tag * feat(edge-group): get associated endpoints when fetching * refactor(tags): refactor algo to update endpoint and group tags * refactor(edge-group): rename variable * refactor(tags): move calc of tags to remove to global function * fix(tags): update tag after adding association Co-authored-by: Anthony Lapenna <lapenna.anthony@gmail.com> Co-authored-by: Anthony Lapenna <anthony.lapenna@portainer.io> * fix(edge-groups): associate groups only with edge endpoints (#3667) * fix(edge-groups): check endpoint type when adding to edge-group * fix(edge-groups): return only edge endpoints for dynamic groups * fix(edge-compute): load edge compute setting on public setting (#3665) * Edge group list (#3644) * feat(edge-groups): add edge module * feat(edge-groups): add edge-group service * feat(edge-group): add groups list view * feat(edge-groups): add link to groups in the sidebar * feat(edge-group): show endpoints count and group type * feat(edge-group): enable removal of edge groups * refactor(edge-groups): replace datatable controller with class * refactor(edge-groups): replace function with class * fix(edge-groups): sort items by endpoints count and group type * refactor(edge-groups): use generic datatable-header component * feat(app): add trace for ui router * fix(edge-compute): add ng injection to onEnter guard * fix(edge-compute): add ng injection to onEnter guard * style(edge-compute): remove space * refactor(edge-compute): import angular * fix(app): remove ui router trace * refactor(product): revert app.js * fix(edge-compute): remove admin guard from edge routes * fix(edge-groups): change label of empty datatable Co-Authored-By: Anthony Lapenna <anthony.lapenna@portainer.io> * refactor(edge-groups): rename service * fix(edge-groups): replace icon in sidebar Co-Authored-By: Anthony Lapenna <anthony.lapenna@portainer.io> * refactor(edge-groups): remove datatable controller * refactor(edge-groups): move datatable icon to binding * refactor(edge-groups): use vanilla datatable header * refactor(datatable): remove datatable header Co-authored-by: Anthony Lapenna <anthony.lapenna@portainer.io> * refactor(edge): rename edge group to Edge group * feat(edge-groups): edge group creation view (#3671) * feat(edge-groups): add create group view * feat(edge-groups): allow to choose group type * feat(edge-groups): implement create service handler * feat(edge-group): filter by edge endpoints * refactor(edge-groups): rename to camel case * refactor(edge-groups): replace controller with class * feat(endpoints): filter endpoints by type * refactor(edge-groups): remove comments and unneccesary async keyword * refactor(edge-group): use $async service * fix(edge-groups): replace view title Co-Authored-By: Anthony Lapenna <anthony.lapenna@portainer.io> * fix(edge-groups): change icon Co-Authored-By: Anthony Lapenna <anthony.lapenna@portainer.io> * fix(edge-groups): change icon Co-Authored-By: Anthony Lapenna <anthony.lapenna@portainer.io> * refactor(edge-groups): remove obsolete function * feat(edge-groups): add empty list messages * feat(edge-group): add description to group types * refactor(edge-groups): add finally block * feat(endpoints): search server in multi-endpoint-selector Co-authored-by: Anthony Lapenna <anthony.lapenna@portainer.io> * feat(edge-group) edit view (#3672) * feat(edge-groups): add edit group view * refactor(edge-group): replace edit controller with class * refactor(edge-groups): remove async keyword * refactor(edge-groups): use $async service * refactor(edge-group): remove unnecessary functions * fix(endpoints): group by groups in endpoint-selector * feat(edge-groups): minor UI update * fix(edge-groups): provide defaults for edge group (#3682) * feat(edge-stacks): add basic views and sidebar link (#3689) * feat(edge-stacks): add mock routes * feat(edge-stacks): add link to stacks on sidebar * feat(edge-stacks): add edge stacks view * feat(edge-stacks): add create view * feat(edge-stacks): add edit view * fix(edge-stacks): use class in controller * feat(edge-stacks): add edge-stacks api (#3688) * feat(edge-stack): add edge stack types * feat(edge-stacks): add edge stack service interface * feat(edge-stacks): implement store * feat(edge-stacks): bind service to datastore * feat(edge-stacks): bind service to server * feat(edge-stack): create basic api * feat(edge-stack): create stack api * feat(edge-stacks): update api * refacotor(edge-stack): rename files * feat(edge-stack): update endpoint status * style(edge-stacks): remove comments * feat(edge-stacks): use edge stacks folder for files * fix(edge-stacks): replace bucket name Co-Authored-By: Anthony Lapenna <anthony.lapenna@portainer.io> * fix(edge-stacks): replace unmarshal function Co-Authored-By: Anthony Lapenna <anthony.lapenna@portainer.io> * fix(edge-stacks): replace edge stacks path Co-Authored-By: Anthony Lapenna <anthony.lapenna@portainer.io> Co-authored-by: Anthony Lapenna <anthony.lapenna@portainer.io> * chore(git): merge develop to edge compute (#3692) * feat(support): make support type dynamic (#3621) * chore(version): bump version number * chore(version): bump version number * feat(endpoints): filter by endpoint type (#3646) * chore(assets): double UI image resolutions for HiDPI displays (#3648) Fixes #3069 Prevents users seeing blurry logos and other images when using a hidpi display (like scaled 4k, or a Retina display). These images have been recreated manually with 2x the original resolution but should resemble the originals as much as possible. They have also been run through pngcrush for compression. * fix(services): enforce minimum replica count of 0 (#3653) * fix(services): enforce minimum replica count of 0 Fixes #3652 Prevents replica count from being set below zero and causing an error. * fix(services): enforce replica count is an integer Prevents users entering decimals in the replica count * refactor(tags): refactor tag management (#3628) * refactor(tags): replace tags with tag ids * refactor(tags): revert tags to be strings and add tagids * refactor(tags): enable search by tag in home view * refactor(tags): show endpoint tags * refactor(endpoints): expect tagIds on create payload * refactor(endpoints): expect tagIds on update payload * refactor(endpoints): replace TagIds to TagIDs * refactor(endpoints): set endpoint group to get TagIDs * refactor(endpoints): refactor tag-selector to receive tag-ids * refactor(endpoints): show tags in multi-endpoint-selector * chore(tags): revert reformat * refactor(endpoints): remove unneeded bind * refactor(endpoints): change param tags to tagids in endpoint create * refactor(endpoints): remove console.log * refactor(tags): remove deleted tag from endpoint and endpoint group * fix(endpoints): show loading label while loading tags * chore(go): remove obsolete import labels * chore(db): add db version comment * fix(db): add tag service to migrator * refactor(db): add error checks in migrator * style(db): sort props in alphabetical order * style(tags): fix typo Co-Authored-By: Anthony Lapenna <anthony.lapenna@portainer.io> * refactor(endpoints): replace tagsMap with tag string representation * refactor(tags): rewrite tag delete to be more readable * refactor(home): rearange code to match former style * refactor(tags): guard against missing model in tag-selector * refactor(tags): rename vars in tag_delete * refactor(tags): allow any authenticated user to fetch tag list * refactor(endpoints): replace controller function with class * refactor(endpoints): replace function with helper * refactor(endpoints): replace controller with class * refactor(tags): revert tags-selector to use 1 way bindings * refactor(endpoints): load empty tag array instead of nil * refactor(endpoints): revert default tag ids * refactor(endpoints): use function in place * refactor(tags): use lodash * style(tags): use parens in arrow functions * fix(tags): remove tag from tag model Co-authored-by: Anthony Lapenna <anthony.lapenna@portainer.io> * chore(yarn): change start:client to start webpack dev server (#3595) * chore(yarn): change start:client to start webpack dev server * Update package.json Co-authored-by: Anthony Lapenna <anthony.lapenna@portainer.io> * create tag from tag selector (#3640) * feat(tags): add button to save tag when doesn't exist * feat(endpoints): allow the creating of tags in endpoint edit * feat(groups): allow user to create tags in create group * feat(groups): allow user to create tags in edit group * feat(endpoint): allow user to create tags from endpoint create * feat(tags): allow the creation of a new tag from dropdown * feat(tag): replace "add" with "create" * feat(tags): show tags input when not tags * feat(tags): hide create message when not allowed * refactor(tags): replace component controller with class * refactor(tags): replace native methods with lodash * refactor(tags): remove unused onChangeTags function * refactor(tags): remove on-change binding * style(tags): remove white space * refactor(endpoint-groups): move controller to separate file * fix(groups): allow admin to create tag in group form * refactor(endpoints): wrap async function with try catch and $async * style(tags): wrap arrow function args with parenthesis * refactor(endpoints): return $async functions * refactor(tags): throw error in the format Notification expects * chore(yarn): add start:client script back (#3691) * feat(endpoints): filter by ids and/or tag ids (#3690) * feat(endpoints): add filter by tagIds * refactor(endpoints): change endpoints service to query by tagIds * fix(endpoints): filter by tags * feat(endpoints): filter by endpoint groups tags * feat(endpoints): filter by ids Co-authored-by: itsconquest <william.conquest@portainer.io> Co-authored-by: Anthony Lapenna <lapenna.anthony@gmail.com> Co-authored-by: Ben Brooks <ben@bbrks.me> Co-authored-by: Anthony Lapenna <anthony.lapenna@portainer.io> * Chore merge develop to edge compute (#3702) * feat(support): make support type dynamic (#3621) * chore(version): bump version number * chore(version): bump version number * feat(endpoints): filter by endpoint type (#3646) * chore(assets): double UI image resolutions for HiDPI displays (#3648) Fixes #3069 Prevents users seeing blurry logos and other images when using a hidpi display (like scaled 4k, or a Retina display). These images have been recreated manually with 2x the original resolution but should resemble the originals as much as possible. They have also been run through pngcrush for compression. * fix(services): enforce minimum replica count of 0 (#3653) * fix(services): enforce minimum replica count of 0 Fixes #3652 Prevents replica count from being set below zero and causing an error. * fix(services): enforce replica count is an integer Prevents users entering decimals in the replica count * refactor(tags): refactor tag management (#3628) * refactor(tags): replace tags with tag ids * refactor(tags): revert tags to be strings and add tagids * refactor(tags): enable search by tag in home view * refactor(tags): show endpoint tags * refactor(endpoints): expect tagIds on create payload * refactor(endpoints): expect tagIds on update payload * refactor(endpoints): replace TagIds to TagIDs * refactor(endpoints): set endpoint group to get TagIDs * refactor(endpoints): refactor tag-selector to receive tag-ids * refactor(endpoints): show tags in multi-endpoint-selector * chore(tags): revert reformat * refactor(endpoints): remove unneeded bind * refactor(endpoints): change param tags to tagids in endpoint create * refactor(endpoints): remove console.log * refactor(tags): remove deleted tag from endpoint and endpoint group * fix(endpoints): show loading label while loading tags * chore(go): remove obsolete import labels * chore(db): add db version comment * fix(db): add tag service to migrator * refactor(db): add error checks in migrator * style(db): sort props in alphabetical order * style(tags): fix typo Co-Authored-By: Anthony Lapenna <anthony.lapenna@portainer.io> * refactor(endpoints): replace tagsMap with tag string representation * refactor(tags): rewrite tag delete to be more readable * refactor(home): rearange code to match former style * refactor(tags): guard against missing model in tag-selector * refactor(tags): rename vars in tag_delete * refactor(tags): allow any authenticated user to fetch tag list * refactor(endpoints): replace controller function with class * refactor(endpoints): replace function with helper * refactor(endpoints): replace controller with class * refactor(tags): revert tags-selector to use 1 way bindings * refactor(endpoints): load empty tag array instead of nil * refactor(endpoints): revert default tag ids * refactor(endpoints): use function in place * refactor(tags): use lodash * style(tags): use parens in arrow functions * fix(tags): remove tag from tag model Co-authored-by: Anthony Lapenna <anthony.lapenna@portainer.io> * chore(yarn): change start:client to start webpack dev server (#3595) * chore(yarn): change start:client to start webpack dev server * Update package.json Co-authored-by: Anthony Lapenna <anthony.lapenna@portainer.io> * create tag from tag selector (#3640) * feat(tags): add button to save tag when doesn't exist * feat(endpoints): allow the creating of tags in endpoint edit * feat(groups): allow user to create tags in create group * feat(groups): allow user to create tags in edit group * feat(endpoint): allow user to create tags from endpoint create * feat(tags): allow the creation of a new tag from dropdown * feat(tag): replace "add" with "create" * feat(tags): show tags input when not tags * feat(tags): hide create message when not allowed * refactor(tags): replace component controller with class * refactor(tags): replace native methods with lodash * refactor(tags): remove unused onChangeTags function * refactor(tags): remove on-change binding * style(tags): remove white space * refactor(endpoint-groups): move controller to separate file * fix(groups): allow admin to create tag in group form * refactor(endpoints): wrap async function with try catch and $async * style(tags): wrap arrow function args with parenthesis * refactor(endpoints): return $async functions * refactor(tags): throw error in the format Notification expects * chore(yarn): add start:client script back (#3691) * feat(endpoints): filter by ids and/or tag ids (#3690) * feat(endpoints): add filter by tagIds * refactor(endpoints): change endpoints service to query by tagIds * fix(endpoints): filter by tags * feat(endpoints): filter by endpoint groups tags * feat(endpoints): filter by ids * refactor(project): sort portainer types and interface definitions (#3694) * refactor(portainer): sort types * style(portainer): add comment about role service * refactor(portainer): sort interface types * refactor(portainer): sort enums * Update README.md * Update README.md * Update README.md * chore(project): add prettier for code format (#3645) * chore(project): install prettier and lint-staged * chore(project): apply prettier to html too * chore(project): git ignore eslintcache * chore(project): add a comment about format script * chore(prettier): update printWidth * chore(prettier): remove useTabs option * chore(prettier): add HTML validation * refactor(prettier): fix closing tags * feat(prettier): define angular parser for html templates * style(prettier): run prettier on codebase Co-authored-by: Anthony Lapenna <lapenna.anthony@gmail.com> * chore(prettier): run format on client codebase Co-authored-by: itsconquest <william.conquest@portainer.io> Co-authored-by: Anthony Lapenna <lapenna.anthony@gmail.com> Co-authored-by: Ben Brooks <ben@bbrks.me> Co-authored-by: Anthony Lapenna <anthony.lapenna@portainer.io> Co-authored-by: Neil Cresswell <neil@cresswell.net.nz> * feat(edge-stacks): create basic edge stack service (#3704) Co-authored-by: Anthony Lapenna <anthony.lapenna@portainer.io> * feat(edge-groups): Provide a switch to use AND or OR for tags (#3695) * feat(edge-groups): add switch to form * feat(project): add property to EdgeGroup * feat(edge-groups): save mustHaveAllTags * feat(edge-groups): fetch associated endpoints (AND and OR) * feat(edge-groups): add AND selector * feat(edge-groups): default to AND * fix(edge-groups): rewrite selector options Co-Authored-By: Anthony Lapenna <anthony.lapenna@portainer.io> * refactor(endpoints): move margin to schedule form * fix(edge-groups): move the selector to top of group * refactor(edge-groups): replace partialMatch property Co-authored-by: Anthony Lapenna <anthony.lapenna@portainer.io> * feat(edge-stacks): add Edge stack creation view (#3705) * feat(edge-stacks): basic creation view * feat(edge-stacks): add group selector * feat(edge-stack): create edge stack * fix(code-editor): apply digest cycle after editor is changed * style(project): reformat constants file * feat(edge-stacks): add a note about missing edge groups * fix(edge-stacks): add groups when creating stack from file * feat(edge-groups): add associated endpoints table (#3710) * feat(edge-groups): load associated endpoints * feat(endpoints): add option to filter endpoint by partial match tags * feat(edge-groups): query endpoints by PartialMatch * feat(edge-groups): reload endpoints when form changes * feat(edge-groups): remove columns * feat(edge-group): remove url column * refactor(edge-group): remove props * feat(edge-stacks): add list view (#3713) * feat(edge-stacks): basic datatable * feat(edge-stacks): remove stack * refactor(edge-stacks): convert to class * refactor(edge-stacks): replace id with stackId * feat(edge-stacks) edit edge stack view (#3716) * feat(edge-stack): load file content * feat(edge-stack): edit view * feat(edge-stack): enable update stack * refactor(edge-stacks): move form to component * feat(edge-stacks): add endpoints status * feat(edge-stacks): minor UI update Co-authored-by: Anthony Lapenna <lapenna.anthony@gmail.com> * feat(edge-groups) prevent deletion of edge group used by an edge stack (#3722) * feat(edge-groups): show if group belonges to edge stack * feat(edge-group): protect deletion of used edge group * feat(edge-groups): diable selection of used group * feat(edge-groups): add inuse tag (#3739) * feat(edge-groups): add inuse tag * Update app/edge/components/groups-datatable/groupsDatatable.html Co-authored-by: Anthony Lapenna <anthony.lapenna@portainer.io> * feat(edge-stack): update stack version when stack file is changed (#3746) * feat(edge-stack): update version when stack file is changed * refactor(edge-stacks): move update of version to clientside * feat(edge-groups): replace Edge group endpoint selector (#3738) * feat(edge-groups): replace selector * feat(edge-group): add selector in edit form * feat(edge-groups): show tags in endpoint selector * feat(edge-groups): show the endpoint group name * fix(edge-group): remove element from associated endpoints * feat(edge-groups): add group column * feat(edge-groups): move endpoints to other column * fix(groups): disable sort * refactor(endpoints): toggle backend pagination as a property * fix(endpoints): show group name in group-association-table * feat(endpoints): truncate table columns * fix(endpoints): update group association table colspan * fix(endpoint-groups): show dash when no tags Co-authored-by: Anthony Lapenna <lapenna.anthony@gmail.com> * feat(edge-stacks): add api for edge to query stack config (#3748) * refactor(http): move edge validation to bouncer * feat(edge-stacks): add api for edge to query stack config * style(edge-stack): remove parentheses * Update api/http/security/bouncer.go * refactor(edge-stacks): move config inspect to endpoints handler * refactor(endpoints): move stack inspect to edge handler * style(security): fix typo Co-Authored-By: Anthony Lapenna <anthony.lapenna@portainer.io> * refactor(endpoints): rename file Co-authored-by: Anthony Lapenna <anthony.lapenna@portainer.io> * feat(edge-groups): add dynamic group endpoints table (#3780) * fix(edge-stacks): update version when updating stack files (#3778) * feat(edgestacks): change status permission to edge enpoints * feat(edge-compute): add stack info to edge status inspect (#3764) * feat(edge-compute): create helper functions * feat(endpoints): add relation object and service * feat(db): create endpoint relation migration * feat(endpoints): create relation when creating endpoint * feat(endpoints): update relation when updating endpoint * feat(endpoints): delete relation when deleting endpoint * feat(endpoint): add stack status to endpoint_status * feat(edge-stacks): connect new edge stack to endpoint * refactor(edgestack): return errors.New * refactor(edgestacks): return error * refactor(edgegroup): endpoint can be related only if edge endpoint * feat(endpoints): update relation only when tags or groups were changd * refactor(tags): change tags functions to set functions * refactor(edgestack): return a list of endpoints for a list of edgegroups * feat(edgestacks): update relation when updating stack * feat(edgestacks): remove relations when deleting edge stack * feat(edgegroup): update related endpoints * feat(endpoint-group): update endpoints relations on create * feat(endpointgroup): add relatd stacks to endpoint when added to group * feat(endpoint-groups): update relation when group is changed * feat(endpointgroup): when deleting group, update its endpoints relations * feat(tags): update related endpoints when deleting tag * refactor(edge-compute): use pointers * refactor(endpointgroup): handle unassociated endpoint * fix(edgestack): show correct stack status * fix(endpoint): remove deleted endpoint from related tags * feat(edge-stacks): change acknowledged status color to blue (#3810) * feat(edge-compute): provide stack name to edge endpoint (#3809) * feat(edge-groups): when no tags selected show empty list of endpoints (#3811) * feat(edge-groups): when no tags selected show empty list of endpoints * fix(edge-group): change empty associated endpoint text * fix(edge-compute): add missing relations updates (#3817) * fix(endpoint): remove deleted endpoint from edge group * fix(tags): remove deleted tag from edge group * fix(endpoint): remove deleted endpoint from edge stack * fix(edge-groups): remove clearing of edgeGroup fields * fix(edge-groups): show dynamic edge groups without tags * fix(edge-compute): use sequential delete in resources (#3818) * fix(endpoints): delete endpoints on by one * fix(tags): remove tags one by one * fix(groups): remove endpoint groups one by one * fix(edge-stacks): remove stack one by one * fix(edge-groups): remove edge group one by one * fix(edge-stacks): add link to root in breadcrumbs * style(edge): add empty line after errors * refactor(tags): remove old function * refactor(endpoints): revert changes to multi-endpoint-selector * feat(edge-stacks): support Edge stack templates (#3812) * feat(edge-compute): fetch templates from url * feat(edge-stacks): fetch edge templates * feat(edge-stacks): choose template and save * feat(edge-stacks): add placeholder to templates select * feat(edge-templates): show info * fix(edge-stacks): fix typo * feat(edge-templates): replace template url * feat(edge-compute): use custom url if available * fix(edge-stacks): show error message when failing * feat(edge-compute): show description in template * feat(edge-templates): change access to route * style(edge-compute): change EdgeTemplatesURL description Co-authored-by: Anthony Lapenna <anthony.lapenna@portainer.io> Co-authored-by: Anthony Lapenna <anthony.lapenna@portainer.io> Co-authored-by: Anthony Lapenna <anthony.lapenna@portainer.io> Co-authored-by: Anthony Lapenna <lapenna.anthony@gmail.com> Co-authored-by: itsconquest <william.conquest@portainer.io> Co-authored-by: Ben Brooks <ben@bbrks.me> Co-authored-by: Neil Cresswell <neil@cresswell.net.nz>
5 years ago
}
edgeStacksStatus = append(edgeStacksStatus, stackStatus)
}
return edgeStacksStatus, nil
feat(edge): introduce support for Edge agent (#3031) * feat(edge): fix webconsole and agent deployment command * feat(edge): display agent features when connected to IoT endpoint * feat(edge): add -e CAP_HOST_MANAGEMENT=1 to agent command * feat(edge): add -v /:/host and --name portainer_agent_iot to agent command * style(endpoint-creation): refactor IoT agent to Edge agent * refactor(api): rename AgentIoTEnvironment to AgentEdgeEnvironment * refactor(api): rename AgentIoTEnvironment to AgentEdgeEnvironment * feat(endpoint-creation): update Edge agent deployment instructions * feat(edge): wip edge * feat(edge): refactor key creation * feat(edge): update deployment instructions * feat(home): update Edge agent endpoint item * feat(edge): support dynamic ports * feat(edge): support sleep/wake and snapshots * feat(edge): support offline mode * feat(edge): host job support for Edge endpoints * feat(edge): introduce STANDBY state * feat(edge): update Edge agent deployment command * feat(edge): introduce EDGE_ID support * feat(edge): update default inactivity interval to 5min * feat(edge): reload Edge schedules after restart * fix(edge): fix execution of endpoint job against an Edge endpoint * fix(edge): fix minor issues with scheduling UI/UX * feat(edge): introduce EdgeSchedule version management * feat(edge): switch back to REQUIRED state from ACTIVE on error * refactor(edge): remove comment * feat(edge): updated tunnel status management * feat(edge): fix flickering UI when accessing Edge endpoint from home view * feat(edge): remove STANDBY status * fix(edge): fix an issue with console and Swarm endpoint * fix(edge): fix an issue with stack deployment * fix(edge): reset timer when applying active status * feat(edge): add background ping for Edge endpoints * fix(edge): fix infinite loading loop after Edge endpoint connection failure * fix(home): fix an issue with merge * feat(api): remove SnapshotRaw from EndpointList response * feat(api): add pagination for EndpointList operation * feat(api): rename last_id query parameter to start * feat(api): implement filter for EndpointList operation * fix(edge): prevent a pointer issue after removing an active Edge endpoint * feat(home): front - endpoint backend pagination (#2990) * feat(home): endpoint pagination with backend * feat(api): remove default limit value * fix(endpoints): fix a minor issue with column span * fix(endpointgroup-create): fix an issue with endpoint group creation * feat(app): minor loading optimizations * refactor(api): small refactor of EndpointList operation * fix(home): fix minor loading text display issue * refactor(api): document bolt services functions * feat(home): minor optimization * fix(api): replace seek with index scanning for EndpointPaginated * fix(api): fix invalid starting index issue * fix(api): first implementation of working filter * fix(home): endpoints list keeps backend pagination when it needs to * fix(api): endpoint pagination doesn't drop the first item on pages >=2 anymore * fix(home): UI flickering on page/filter load/change * feat(auth): login spinner * feat(api): support searching in associated endpoint group data * refactor(api): remove unused API endpoint * refactor(api): remove comment * refactor(api): refactor proxy manager * feat(api): declare EndpointList params as optional * feat(api): support groupID filter on endpoints route * feat(api): add new API operations endpointGroupAddEndpoint and endpointGroupDeleteEndpoint * feat(edge): new icon for Edge agent endpoint * fix(edge): fix missing exec quick action * fix(edge): add loading indicator when connecting to Edge endpoint * feat(edge): disable service webhooks for Edge endpoints * feat(endpoints): backend pagination for endpoints view (#3004) * feat(edge): dynamic loading for stack migration feature * feat(edge): wordwrap edge key * feat(endpoint-groups): backend pagination support for create and edit * feat(endpoint-groups): debounce on filter for create/edit views * feat(endpoint-groups): filter assigned on create view * (endpoint-groups): unassigned endpoints edit view * refactor(endpoint-groups): code clean * feat(endpoint-groups): remove message for Unassigned group * refactor(websocket): minor refactor associated to Edge agent * feat(endpoint-group): enable backend pagination (#3017) * feat(api): support groupID filter on endpoints route * feat(api): add new API operations endpointGroupAddEndpoint and endpointGroupDeleteEndpoint * feat(endpoint-groups): backend pagination support for create and edit * feat(endpoint-groups): debounce on filter for create/edit views * feat(endpoint-groups): filter assigned on create view * (endpoint-groups): unassigned endpoints edit view * refactor(endpoint-groups): code clean * feat(endpoint-groups): remove message for Unassigned group * refactor(api): endpoint group endpoint association refactor * refactor(api): rename files and remove comments * refactor(api): remove usage of utils * refactor(api): optional parameters * Merge branch 'feat-endpoint-backend-pagination' into edge # Conflicts: # api/bolt/endpoint/endpoint.go # api/http/handler/endpointgroups/endpointgroup_update.go # api/http/handler/endpointgroups/handler.go # api/http/handler/endpoints/endpoint_list.go # app/portainer/services/api/endpointService.js * fix(api): fix default tunnel server credentials * feat(api): update endpointListOperation behavior and parameters * fix(api): fix interface declaration * feat(edge): support configurable Edge agent checkin interval * feat(edge): support dynamic tunnel credentials * feat(edge): update Edge agent deployment commands * style(edge): update Edge agent settings text * refactor(edge): remove unused credentials management methods * feat(edge): associate a remote addr to tunnel credentials * style(edge): update Edge endpoint icon * feat(edge): support encrypted tunnel credentials * fix(edge): fix invalid pointer cast * feat(bolt): decode endpoints with jsoniter * feat(edge): persist reverse tunnel keyseed * refactor(edge): minor refactor * feat(edge): update chisel library usage * refactor(endpoint): use controller function * feat(api): database migration to DBVersion 19 * refactor(api): refactor AddSchedule function * refactor(schedules): remove comment * refactor(api): remove comment * refactor(api): remove comment * feat(api): tunnel manager now only manage Edge endpoints * refactor(api): clean-up and clarification of the Edge service * refactor(api): clean-up and clarification of the Edge service * fix(api): fix an issue with Edge agent snapshots * refactor(api): add missing comments * refactor(api): update constant description * style(home): remove loading text on error * feat(endpoint): remove 15s timeout for ping request * style(home): display information about associated Edge endpoints * feat(home): redirect to endpoint details on click on unassociated Edge endpoint * feat(settings): remove 60s Edge poll frequency option
5 years ago
}
func cacheResponse(w http.ResponseWriter, endpointID portainer.EndpointID, statusResponse endpointEdgeStatusInspectResponse) *httperror.HandlerError {
rr := httptest.NewRecorder()
if err := response.JSON(rr, statusResponse); err != nil {
return err
}
h := fnv.New32a()
h.Write(rr.Body.Bytes())
etag := strconv.FormatUint(uint64(h.Sum32()), 16)
cache.Set(endpointID, []byte(etag))
resp := rr.Result()
for k, vs := range resp.Header {
for _, v := range vs {
w.Header().Add(k, v)
}
}
w.Header().Set("ETag", etag)
io.Copy(w, resp.Body)
return nil
}
func (handler *Handler) respondFromCache(w http.ResponseWriter, r *http.Request, endpointID portainer.EndpointID) bool {
inmHeader := r.Header.Get("If-None-Match")
etags := strings.Split(inmHeader, ",")
if len(inmHeader) == 0 || etags[0] == "" {
return false
}
cachedETag, ok := cache.Get(endpointID)
if !ok {
return false
}
for _, etag := range etags {
if !bytes.Equal([]byte(etag), cachedETag) {
continue
}
handler.DataStore.Endpoint().UpdateHeartbeat(endpointID)
w.Header().Set("ETag", etag)
w.WriteHeader(http.StatusNotModified)
return true
}
return false
}