mirror of
https://github.com/portainer/portainer.git
synced 2025-07-21 14:29:40 +02:00
feat(edge-compute): add specific edge endpoint checkin interval (#3855)
* feat(endpoint): send custom checkin interval * feat(endpoint): update edge checkin interval * feat(endpoint): save checkin interval * feat(endpoints): create endpoint with checkin interval * feat(endpoints): change tooltip * fix(edge-compute): fix typos Co-authored-by: Anthony Lapenna <anthony.lapenna@portainer.io> * fix(endpoints): show default interval * fix(endpoint): rename checkin property Co-authored-by: Anthony Lapenna <anthony.lapenna@portainer.io>
This commit is contained in:
parent
766ced7cb1
commit
9f4631bb6d
11 changed files with 183 additions and 39 deletions
|
@ -30,6 +30,7 @@ type endpointCreatePayload struct {
|
|||
TLSCertFile []byte
|
||||
TLSKeyFile []byte
|
||||
TagIDs []portainer.TagID
|
||||
EdgeCheckinInterval int
|
||||
}
|
||||
|
||||
func (payload *endpointCreatePayload) Validate(r *http.Request) error {
|
||||
|
@ -102,6 +103,9 @@ func (payload *endpointCreatePayload) Validate(r *http.Request) error {
|
|||
publicURL, _ := request.RetrieveMultiPartFormValue(r, "PublicURL", true)
|
||||
payload.PublicURL = publicURL
|
||||
|
||||
checkinInterval, _ := request.RetrieveNumericMultiPartFormValue(r, "CheckinInterval", true)
|
||||
payload.EdgeCheckinInterval = checkinInterval
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
@ -193,13 +197,14 @@ func (handler *Handler) createEdgeAgentEndpoint(payload *endpointCreatePayload)
|
|||
TLSConfig: portainer.TLSConfiguration{
|
||||
TLS: false,
|
||||
},
|
||||
AuthorizedUsers: []portainer.UserID{},
|
||||
AuthorizedTeams: []portainer.TeamID{},
|
||||
Extensions: []portainer.EndpointExtension{},
|
||||
TagIDs: payload.TagIDs,
|
||||
Status: portainer.EndpointStatusUp,
|
||||
Snapshots: []portainer.Snapshot{},
|
||||
EdgeKey: edgeKey,
|
||||
AuthorizedUsers: []portainer.UserID{},
|
||||
AuthorizedTeams: []portainer.TeamID{},
|
||||
Extensions: []portainer.EndpointExtension{},
|
||||
TagIDs: payload.TagIDs,
|
||||
Status: portainer.EndpointStatusUp,
|
||||
Snapshots: []portainer.Snapshot{},
|
||||
EdgeKey: edgeKey,
|
||||
EdgeCheckinInterval: payload.EdgeCheckinInterval,
|
||||
}
|
||||
|
||||
err = handler.saveEndpointAndUpdateAuthorizations(endpoint)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue