// Convert a list of api Services into a list of gomarathon Applications
519562
func (c *MarathonConverter) convertToApps(services []*api.Service) []*gomarathon.Application {
	apps := make([]*gomarathon.Application, len(services))
	for i := range services {
		apps[i] = c.convertToApp(services[i])
	}

	return apps
}
569415
func (ds *resourcesUnitDataStore) ListResources() (resource.ApplicationResources, error) {
	return ds.resources.ListResources(ds.unit.ApplicationName())
}
541194
func (r *AppversionService) List() *AppversionListCall {
	c := &AppversionListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
	return c
}
994826
func (a *ActionAPI) ListRunning(arg params.Entities) (params.ActionsByReceivers, error) {
	if err := a.checkCanRead(); err != nil {
		return params.ActionsByReceivers{}, errors.Trace(err)
	}

	return a.internalList(arg, runningActions)
}
454403
func (l *externalMetricsResourceLister) ListAPIResources() []metav1.APIResource {
	metrics := l.provider.ListAllExternalMetrics()
	resources := make([]metav1.APIResource, len(metrics))

	for i, metric := range metrics {
		resources[i] = metav1.APIResource{
			Name:       metric.Metric,
			Namespaced: true,
			Kind:       "ExternalMetricValueList",
			Verbs:      metav1.Verbs{"get"},
		}
	}

	return resources
}
59583
func (client *Client) ListRunstatusServices(ctx context.Context, page RunstatusPage) ([]RunstatusService, error) {
	if page.ServicesURL == "" {
		return nil, fmt.Errorf("empty Services URL for %#v", page)
	}

	results := make([]RunstatusService, 0)

	var err error
	client.PaginateRunstatusServices(ctx, page, func(service *RunstatusService, e error) bool {
		if e != nil {
			err = e
			return false
		}

		results = append(results, *service)
		return true
	})

	return results, err
}
28039
func (r *marathonClient) KillApplicationTasks(id string, opts *KillApplicationTasksOpts) (*Tasks, error) {
	path := fmt.Sprintf("%s/%s/tasks", marathonAPIApps, trimRootPath(id))
	path, err := addOptions(path, opts)
	if err != nil {
		return nil, err
	}

	tasks := new(Tasks)
	if err := r.apiDelete(path, nil, tasks); err != nil {
		return nil, err
	}

	return tasks, nil
}
443113
func ListServices() ([]string, error) {
	fullCommand := strings.Fields(ListCommand())
	services, err := utils.RunCommand(fullCommand[0], fullCommand[1:]...)
	if err != nil {
		return []string{}, errors.Trace(err)
	}
	return strings.Split(services, "\n"), nil
}
912790
func (v *GenerateServiceRequest) GetServices() (o map[ServiceID]*Service) {
	if v != nil {
		o = v.Services
	}
	return
}
30852
func (m *marathonAdapter) GetServices() ([]*api.Service, *api.Error) {
	var apiErr *api.Error

	response, err := m.client.ListApps()
	if err != nil {
		apiErr = api.NewError(http.StatusNotFound, err.Error())
		return nil, apiErr
	}
	return m.conv.convertToServices(response.Apps), apiErr
}
1325833
func Convert_v1beta2_DeploymentList_To_apps_DeploymentList(in *v1beta2.DeploymentList, out *apps.DeploymentList, s conversion.Scope) error {
	return autoConvert_v1beta2_DeploymentList_To_apps_DeploymentList(in, out, s)
}
1042889
func (r *marathonClient) ListApplications(v url.Values) ([]string, error) {
	applications, err := r.Applications(v)
	if err != nil {
		return nil, err
	}
	var list []string
	for _, application := range applications.Apps {
		list = append(list, application.ID)
	}

	return list, nil
}
1259003
func ServiceSearch(args filters.Args) (services []swarm.Service, err error) { // nolint: gocyclo
	err = mgr.Do(func(ctx context.Context, cli *client.Client) (err error) {
		opts := types.ServiceListOptions{Filters: args}
		services, err = cli.ServiceList(ctx, opts)
		return
	})
	return
}
308518
func (m *marathonAdapter) CreateServices(services []*api.Service) ([]*api.Service, *api.Error) {
	var apiErr *api.Error

	myGroup := m.deployer.BuildDeploymentGroup(services, m.client)
	status := m.deployer.DeployGroup(myGroup, DEPLOY_TIMEOUT)

	switch status.code {
	case FAIL:
		apiErr = api.NewError(http.StatusConflict, "Group deployment failed.")
	case TIMEOUT:
		apiErr = api.NewError(http.StatusInternalServerError, "Group deployment timed out.")
	}

	return services, apiErr
}
767101
func GetRunningTasks(t *testing.T, c client.ServiceAPIClient, serviceID string) []swarmtypes.Task {
	t.Helper()

	tasks, err := c.TaskList(context.Background(), types.TaskListOptions{
		Filters: filters.NewArgs(
			filters.Arg("service", serviceID),
			filters.Arg("desired-state", "running"),
		),
	})

	assert.NilError(t, err)
	return tasks
}
583547
func (d *DockerDiscovery) Services() []service.Service {
	d.RLock()
	defer d.RUnlock()

	svcList := make([]service.Service, len(d.services))

	for i, svc := range d.services {
		svcList[i] = *svc
	}

	return svcList
}
138754
func (m *Manager) Services() []string {
	s := make([]string, 0, len(m.services))
	for name := range m.services {
		s = append(s, name)
	}
	return s
}