diff --git a/client/client.go b/client/client.go index 1027ca9..746a92f 100644 --- a/client/client.go +++ b/client/client.go @@ -38,7 +38,7 @@ type PortainerClient interface { EndpointList() ([]portainer.Endpoint, error) // Get endpoint groups - GetEndpointGroups() ([]portainer.EndpointGroup, error) + EndpointGroupList() ([]portainer.EndpointGroup, error) // Get stacks, optionally filtered by swarmId and endpointId GetStacks(swarmID string, endpointID portainer.EndpointID) ([]portainer.Stack, error) @@ -226,7 +226,7 @@ func (n *portainerClientImp) EndpointList() (endpoints []portainer.Endpoint, err return } -func (n *portainerClientImp) GetEndpointGroups() (endpointGroups []portainer.EndpointGroup, err error) { +func (n *portainerClientImp) EndpointGroupList() (endpointGroups []portainer.EndpointGroup, err error) { err = n.doJSONWithToken("endpoint_groups", http.MethodGet, http.Header{}, nil, &endpointGroups) return } diff --git a/cmd/endpointGroupList.go b/cmd/endpointGroupList.go index b3f094d..953c90e 100644 --- a/cmd/endpointGroupList.go +++ b/cmd/endpointGroupList.go @@ -30,7 +30,7 @@ var endpointGroupListCmd = &cobra.Command{ common.CheckError(err) logrus.Debug("Getting endpoint groups") - endpointGroups, err := client.GetEndpointGroups() + endpointGroups, err := client.EndpointGroupList() common.CheckError(err) switch viper.GetString("endpoint.group.list.format") { diff --git a/common/utils.go b/common/utils.go index b733869..81f272a 100644 --- a/common/utils.go +++ b/common/utils.go @@ -107,7 +107,7 @@ func GetEndpointGroupByName(name string) (endpointGroup portainer.EndpointGroup, return } - endpointGroups, err := portainerClient.GetEndpointGroups() + endpointGroups, err := portainerClient.EndpointGroupList() if err != nil { return }