Rename PortainerClient.GetStacks() to StackList()

This commit is contained in:
Juan Carlos Mejías Rodríguez 2019-08-26 01:17:41 -04:00
parent 623788b624
commit 87ba553153
3 changed files with 6 additions and 6 deletions

View File

@ -41,7 +41,7 @@ type PortainerClient interface {
EndpointGroupList() ([]portainer.EndpointGroup, error)
// Get stacks, optionally filtered by swarmId and endpointId
GetStacks(swarmID string, endpointID portainer.EndpointID) ([]portainer.Stack, error)
StackList(swarmID string, endpointID portainer.EndpointID) ([]portainer.Stack, error)
// Create swarm stack
CreateSwarmStack(stackName string, environmentVariables []portainer.Pair, stackFileContent string, swarmClusterID string, endpointID portainer.EndpointID) (stack portainer.Stack, err error)
@ -231,7 +231,7 @@ func (n *portainerClientImp) EndpointGroupList() (endpointGroups []portainer.End
return
}
func (n *portainerClientImp) GetStacks(swarmID string, endpointID portainer.EndpointID) (stacks []portainer.Stack, err error) {
func (n *portainerClientImp) StackList(swarmID string, endpointID portainer.EndpointID) (stacks []portainer.Stack, err error) {
filter := StackListFilter{
SwarmID: swarmID,
EndpointID: endpointID,

View File

@ -53,14 +53,14 @@ var stackListCmd = &cobra.Command{
logrus.WithFields(logrus.Fields{
"endpoint": endpoint.Name,
}).Debug("Getting stacks")
stacks, err = portainerClient.GetStacks(endpointSwarmClusterID, endpoint.ID)
stacks, err = portainerClient.StackList(endpointSwarmClusterID, endpoint.ID)
common.CheckError(err)
} else if selectionErr == common.ErrStackClusterNotFound {
// It's not a swarm cluster
logrus.WithFields(logrus.Fields{
"endpoint": endpoint.Name,
}).Debug("Getting stacks")
stacks, err = portainerClient.GetStacks("", endpoint.ID)
stacks, err = portainerClient.StackList("", endpoint.ID)
common.CheckError(err)
} else {
// Something else happened
@ -68,7 +68,7 @@ var stackListCmd = &cobra.Command{
}
} else {
logrus.Debug("Getting stacks")
stacks, err = portainerClient.GetStacks("", 0)
stacks, err = portainerClient.StackList("", 0)
common.CheckError(err)
}

View File

@ -63,7 +63,7 @@ func GetStackByName(name string, swarmID string, endpointID portainer.EndpointID
return
}
stacks, err := portainerClient.GetStacks(swarmID, endpointID)
stacks, err := portainerClient.StackList(swarmID, endpointID)
if err != nil {
return
}