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)
// 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
}

View File

@ -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") {

View File

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