1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-25 00:09:40 +02:00

fix(swagger): fix swagger api docs endpoint(s) rename to environment(s) EE-1661 (#5629)

* fix swagger api docs endpoint(s) rename to environment(s)
This commit is contained in:
Richard Wei 2021-09-20 12:14:22 +12:00 committed by GitHub
parent d911c50f1b
commit dd808bb7bd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
111 changed files with 376 additions and 376 deletions

View file

@ -19,8 +19,8 @@ func NewService(dataStore portainer.DataStore) *Service {
}
}
// DefaultEndpointAuthorizationsForEndpointAdministratorRole returns the default endpoint authorizations
// associated to the endpoint administrator role.
// DefaultEndpointAuthorizationsForEndpointAdministratorRole returns the default environment(endpoint) authorizations
// associated to the environment(endpoint) administrator role.
func DefaultEndpointAuthorizationsForEndpointAdministratorRole() portainer.Authorizations {
return map[portainer.Authorization]bool{
portainer.OperationDockerContainerArchiveInfo: true,
@ -157,7 +157,7 @@ func DefaultEndpointAuthorizationsForEndpointAdministratorRole() portainer.Autho
}
}
// DefaultEndpointAuthorizationsForHelpDeskRole returns the default endpoint authorizations
// DefaultEndpointAuthorizationsForHelpDeskRole returns the default environment(endpoint) authorizations
// associated to the helpdesk role.
func DefaultEndpointAuthorizationsForHelpDeskRole(volumeBrowsingAuthorizations bool) portainer.Authorizations {
authorizations := map[portainer.Authorization]bool{
@ -216,7 +216,7 @@ func DefaultEndpointAuthorizationsForHelpDeskRole(volumeBrowsingAuthorizations b
return authorizations
}
// DefaultEndpointAuthorizationsForStandardUserRole returns the default endpoint authorizations
// DefaultEndpointAuthorizationsForStandardUserRole returns the default environment(endpoint) authorizations
// associated to the standard user role.
func DefaultEndpointAuthorizationsForStandardUserRole(volumeBrowsingAuthorizations bool) portainer.Authorizations {
authorizations := map[portainer.Authorization]bool{
@ -350,7 +350,7 @@ func DefaultEndpointAuthorizationsForStandardUserRole(volumeBrowsingAuthorizatio
return authorizations
}
// DefaultEndpointAuthorizationsForReadOnlyUserRole returns the default endpoint authorizations
// DefaultEndpointAuthorizationsForReadOnlyUserRole returns the default environment(endpoint) authorizations
// associated to the readonly user role.
func DefaultEndpointAuthorizationsForReadOnlyUserRole(volumeBrowsingAuthorizations bool) portainer.Authorizations {
authorizations := map[portainer.Authorization]bool{

View file

@ -5,7 +5,7 @@ import (
"github.com/portainer/portainer/api/internal/tag"
)
// EdgeGroupRelatedEndpoints returns a list of endpoints related to this Edge group
// EdgeGroupRelatedEndpoints returns a list of environments(endpoints) related to this Edge group
func EdgeGroupRelatedEndpoints(edgeGroup *portainer.EdgeGroup, endpoints []portainer.Endpoint, endpointGroups []portainer.EndpointGroup) []portainer.EndpointID {
if !edgeGroup.Dynamic {
return edgeGroup.Endpoints
@ -33,7 +33,7 @@ func EdgeGroupRelatedEndpoints(edgeGroup *portainer.EdgeGroup, endpoints []porta
return endpointIDs
}
// edgeGroupRelatedToEndpoint returns true is edgeGroup is associated with endpoint
// edgeGroupRelatedToEndpoint returns true is edgeGroup is associated with environment(endpoint)
func edgeGroupRelatedToEndpoint(edgeGroup *portainer.EdgeGroup, endpoint *portainer.Endpoint, endpointGroup *portainer.EndpointGroup) bool {
if !edgeGroup.Dynamic {
for _, endpointID := range edgeGroup.Endpoints {

View file

@ -2,7 +2,7 @@ package edge
import portainer "github.com/portainer/portainer/api"
// LoadEdgeJobs registers all edge jobs inside corresponding endpoint tunnel
// LoadEdgeJobs registers all edge jobs inside corresponding environment(endpoint) tunnel
func LoadEdgeJobs(dataStore portainer.DataStore, reverseTunnelService portainer.ReverseTunnelService) error {
edgeJobs, err := dataStore.EdgeJob().EdgeJobs()
if err != nil {

View file

@ -5,7 +5,7 @@ import (
"github.com/portainer/portainer/api"
)
// EdgeStackRelatedEndpoints returns a list of endpoints related to this Edge stack
// EdgeStackRelatedEndpoints returns a list of environments(endpoints) related to this Edge stack
func EdgeStackRelatedEndpoints(edgeGroupIDs []portainer.EdgeGroupID, endpoints []portainer.Endpoint, endpointGroups []portainer.EndpointGroup, edgeGroups []portainer.EdgeGroup) ([]portainer.EndpointID, error) {
edgeStackEndpoints := []portainer.EndpointID{}

View file

@ -2,7 +2,7 @@ package edge
import "github.com/portainer/portainer/api"
// EndpointRelatedEdgeStacks returns a list of Edge stacks related to this Endpoint
// EndpointRelatedEdgeStacks returns a list of Edge stacks related to this Environment(Endpoint)
func EndpointRelatedEdgeStacks(endpoint *portainer.Endpoint, endpointGroup *portainer.EndpointGroup, edgeGroups []portainer.EdgeGroup, edgeStacks []portainer.EdgeStack) []portainer.EdgeStackID {
relatedEdgeGroupsSet := map[portainer.EdgeGroupID]bool{}

View file

@ -6,19 +6,19 @@ import (
portainer "github.com/portainer/portainer/api"
)
// IsLocalEndpoint returns true if this is a local endpoint
// IsLocalEndpoint returns true if this is a local environment(endpoint)
func IsLocalEndpoint(endpoint *portainer.Endpoint) bool {
return strings.HasPrefix(endpoint.URL, "unix://") || strings.HasPrefix(endpoint.URL, "npipe://") || endpoint.Type == 5
}
// IsKubernetesEndpoint returns true if this is a kubernetes endpoint
// IsKubernetesEndpoint returns true if this is a kubernetes environment(endpoint)
func IsKubernetesEndpoint(endpoint *portainer.Endpoint) bool {
return endpoint.Type == portainer.KubernetesLocalEnvironment ||
endpoint.Type == portainer.AgentOnKubernetesEnvironment ||
endpoint.Type == portainer.EdgeAgentOnKubernetesEnvironment
}
// IsDockerEndpoint returns true if this is a docker endpoint
// IsDockerEndpoint returns true if this is a docker environment(endpoint)
func IsDockerEndpoint(endpoint *portainer.Endpoint) bool {
return endpoint.Type == portainer.DockerEnvironment ||
endpoint.Type == portainer.AgentOnDockerEnvironment ||

View file

@ -9,9 +9,9 @@ import (
portainer "github.com/portainer/portainer/api"
)
// Service repesents a service to manage endpoint snapshots.
// Service repesents a service to manage environment(endpoint) snapshots.
// It provides an interface to start background snapshots as well as
// specific Docker/Kubernetes endpoint snapshot methods.
// specific Docker/Kubernetes environment(endpoint) snapshot methods.
type Service struct {
dataStore portainer.DataStore
refreshSignal chan struct{}
@ -37,7 +37,7 @@ func NewService(snapshotInterval string, dataStore portainer.DataStore, dockerSn
}, nil
}
// Start will start a background routine to execute periodic snapshots of endpoints
// Start will start a background routine to execute periodic snapshots of environments(endpoints)
func (service *Service) Start() {
if service.refreshSignal != nil {
return
@ -72,8 +72,8 @@ func (service *Service) SetSnapshotInterval(snapshotInterval string) error {
return nil
}
// SupportDirectSnapshot checks whether an endpoint can be used to trigger a direct a snapshot.
// It is mostly true for all endpoints except Edge and Azure endpoints.
// SupportDirectSnapshot checks whether an environment(endpoint) can be used to trigger a direct a snapshot.
// It is mostly true for all environments(endpoints) except Edge and Azure environments(endpoints).
func SupportDirectSnapshot(endpoint *portainer.Endpoint) bool {
switch endpoint.Type {
case portainer.EdgeAgentOnDockerEnvironment, portainer.EdgeAgentOnKubernetesEnvironment, portainer.AzureEnvironment:
@ -82,8 +82,8 @@ func SupportDirectSnapshot(endpoint *portainer.Endpoint) bool {
return true
}
// SnapshotEndpoint will create a snapshot of the endpoint based on the endpoint type.
// If the snapshot is a success, it will be associated to the endpoint.
// SnapshotEndpoint will create a snapshot of the environment(endpoint) based on the environment(endpoint) type.
// If the snapshot is a success, it will be associated to the environment(endpoint).
func (service *Service) SnapshotEndpoint(endpoint *portainer.Endpoint) error {
switch endpoint.Type {
case portainer.AzureEnvironment:
@ -189,7 +189,7 @@ func (service *Service) snapshotEndpoints() error {
return nil
}
// FetchDockerID fetches info.Swarm.Cluster.ID if endpoint is swarm and info.ID otherwise
// FetchDockerID fetches info.Swarm.Cluster.ID if environment(endpoint) is swarm and info.ID otherwise
func FetchDockerID(snapshot portainer.DockerSnapshot) (string, error) {
info, done := snapshot.SnapshotRaw.Info.(map[string]interface{})
if !done {

View file

@ -233,7 +233,7 @@ func (s *stubEndpointService) GetNextIdentifier() int {
return len(s.endpoints)
}
// WithEndpoints option will instruct datastore to return provided endpoints
// WithEndpoints option will instruct datastore to return provided environments(endpoints)
func WithEndpoints(endpoints []portainer.Endpoint) datastoreOption {
return func(d *datastore) {
d.endpoint = &stubEndpointService{endpoints: endpoints}