Rename PortainerClient.GetEndpoints() to EndpointList()

This commit is contained in:
Juan Carlos Mejías Rodríguez 2019-08-26 01:15:44 -04:00
parent 53b13b1c76
commit 0adb18bc8a
4 changed files with 6 additions and 6 deletions

View File

@ -35,7 +35,7 @@ type PortainerClient interface {
Auth() (token string, err error)
// Get endpoints
GetEndpoints() ([]portainer.Endpoint, error)
EndpointList() ([]portainer.Endpoint, error)
// Get endpoint groups
GetEndpointGroups() ([]portainer.EndpointGroup, error)
@ -221,7 +221,7 @@ func (n *portainerClientImp) Auth() (token string, err error) {
return
}
func (n *portainerClientImp) GetEndpoints() (endpoints []portainer.Endpoint, err error) {
func (n *portainerClientImp) EndpointList() (endpoints []portainer.Endpoint, err error) {
err = n.doJSONWithToken("endpoints", http.MethodGet, http.Header{}, nil, &endpoints)
return
}

View File

@ -30,7 +30,7 @@ var endpointListCmd = &cobra.Command{
common.CheckError(err)
logrus.Debug("Getting endpoints")
endpoints, err := client.GetEndpoints()
endpoints, err := client.EndpointList()
common.CheckError(err)
switch viper.GetString("endpoint.list.format") {

View File

@ -33,7 +33,7 @@ var stackListCmd = &cobra.Command{
portainerClient, err := common.GetClient()
common.CheckError(err)
endpoints, endpointsRetrievalErr := portainerClient.GetEndpoints()
endpoints, endpointsRetrievalErr := portainerClient.EndpointList()
common.CheckError(endpointsRetrievalErr)
var endpointSwarmClusterID string

View File

@ -38,7 +38,7 @@ func GetDefaultEndpoint() (endpoint portainer.Endpoint, err error) {
}
logrus.Debug("Getting endpoints")
endpoints, err := portainerClient.GetEndpoints()
endpoints, err := portainerClient.EndpointList()
if err != nil {
return
}
@ -85,7 +85,7 @@ func GetEndpointByName(name string) (endpoint portainer.Endpoint, err error) {
return
}
endpoints, err := portainerClient.GetEndpoints()
endpoints, err := portainerClient.EndpointList()
if err != nil {
return
}