1
0
mirror of https://gitlab.com/psuapp/psu.git synced 2024-08-30 18:12:34 +00:00

Rename PortainerClient.GetEndpointGroups() to EndpointGroupList()

This commit is contained in:
Juan Carlos Mejías Rodríguez 2019-08-26 01:16:40 -04:00
parent 0adb18bc8a
commit 623788b624
3 changed files with 4 additions and 4 deletions

View File

@ -38,7 +38,7 @@ type PortainerClient interface {
EndpointList() ([]portainer.Endpoint, error) EndpointList() ([]portainer.Endpoint, error)
// Get endpoint groups // Get endpoint groups
GetEndpointGroups() ([]portainer.EndpointGroup, error) EndpointGroupList() ([]portainer.EndpointGroup, error)
// Get stacks, optionally filtered by swarmId and endpointId // Get stacks, optionally filtered by swarmId and endpointId
GetStacks(swarmID string, endpointID portainer.EndpointID) ([]portainer.Stack, error) GetStacks(swarmID string, endpointID portainer.EndpointID) ([]portainer.Stack, error)
@ -226,7 +226,7 @@ func (n *portainerClientImp) EndpointList() (endpoints []portainer.Endpoint, err
return 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) err = n.doJSONWithToken("endpoint_groups", http.MethodGet, http.Header{}, nil, &endpointGroups)
return return
} }

View File

@ -30,7 +30,7 @@ var endpointGroupListCmd = &cobra.Command{
common.CheckError(err) common.CheckError(err)
logrus.Debug("Getting endpoint groups") logrus.Debug("Getting endpoint groups")
endpointGroups, err := client.GetEndpointGroups() endpointGroups, err := client.EndpointGroupList()
common.CheckError(err) common.CheckError(err)
switch viper.GetString("endpoint.group.list.format") { switch viper.GetString("endpoint.group.list.format") {

View File

@ -107,7 +107,7 @@ func GetEndpointGroupByName(name string) (endpointGroup portainer.EndpointGroup,
return return
} }
endpointGroups, err := portainerClient.GetEndpointGroups() endpointGroups, err := portainerClient.EndpointGroupList()
if err != nil { if err != nil {
return return
} }