// GetApplicationSummaryByNameAndSpace returns an application with process and
// instance stats.
332641
func (actor Actor) GetApplicationSummaryByNameAndSpace(appName string, spaceGUID string, withObfuscatedValues bool, routeActor RouteActor) (ApplicationSummary, Warnings, error) {
	app, allWarnings, err := actor.GetApplicationByNameAndSpace(appName, spaceGUID)
	if err != nil {
		return ApplicationSummary{}, allWarnings, err
	}

	processSummaries, processWarnings, err := actor.getProcessSummariesForApp(app.GUID, withObfuscatedValues)
	allWarnings = append(allWarnings, processWarnings...)
	if err != nil {
		return ApplicationSummary{}, allWarnings, err
	}

	droplet, warnings, err := actor.GetCurrentDropletByApplication(app.GUID)
	allWarnings = append(allWarnings, warnings...)
	if err != nil {
		if _, ok := err.(actionerror.DropletNotFoundError); !ok {
			return ApplicationSummary{}, allWarnings, err
		}
	}

	var appRoutes v2action.Routes
	if routeActor != nil {
		routes, warnings, err := routeActor.GetApplicationRoutes(app.GUID)
		allWarnings = append(allWarnings, Warnings(warnings)...)
		if err != nil {
			if _, ok := err.(ccerror.ResourceNotFoundError); !ok {
				return ApplicationSummary{}, allWarnings, err
			}
		}
		appRoutes = routes
	}

	summary := ApplicationSummary{
		Application:      app,
		ProcessSummaries: processSummaries,
		CurrentDroplet:   droplet,
		Routes:           appRoutes,
	}
	return summary, allWarnings, nil
}
915444
func (s *applicationLister) Applications(namespace string) ApplicationNamespaceLister {
	return applicationNamespaceLister{indexer: s.indexer, namespace: namespace}
}
161043
func (client *Client) GetApplications(query ...Query) ([]Application, Warnings, error) {
	request, err := client.newHTTPRequest(requestOptions{
		RequestName: internal.GetApplicationsRequest,
		Query:       query,
	})
	if err != nil {
		return nil, nil, err
	}

	var fullAppsList []Application
	warnings, err := client.paginate(request, Application{}, func(item interface{}) error {
		if app, ok := item.(Application); ok {
			fullAppsList = append(fullAppsList, app)
		} else {
			return ccerror.UnknownObjectInListError{
				Expected:   Application{},
				Unexpected: item,
			}
		}
		return nil
	})

	return fullAppsList, warnings, err
}
140122
func (p *Page) GetSummary() string {
	if p == nil || p.Summary == nil {
		return ""
	}
	return *p.Summary
}
326774
func (up *tenantURLProvider) GetEnvironmentMapping() map[string]string {
	result := make(map[string]string)
	// Exclude internal namespaces where the user cannot deploy applications

	// Deployments API will receive requests by environment name (e.g. "run", "stage").
	// These names correspond to the "type" attribute in Namespaces.
	for envNS, attr := range up.namespaces {
		envName := attr.Type
		if envName == nil || len(*envName) == 0 {
			log.Error(nil, map[string]interface{}{
				"namespace": envNS,
			}, "namespace has no type")
		} else {
			result[*envName] = envNS
		}
	}
	return result
}
1051193
func (t *Template) GetAllAWSAppMeshMeshResources() map[string]*resources.AWSAppMeshMesh {
	results := map[string]*resources.AWSAppMeshMesh{}
	for name, untyped := range t.Resources {
		switch resource := untyped.(type) {
		case *resources.AWSAppMeshMesh:
			results[name] = resource
		}
	}
	return results
}
550475
func (a *Account) FindApplication(appID string) (app Application, err error) {
	err = a.get(a.auth.WithScope(scope.App(appID)), fmt.Sprintf("/api/v2/applications/%s", appID), &app)
	return app, err
}
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
}
217896
func (actor Actor) ApplyApplicationManifest(parser ManifestParser, spaceGUID string) (Warnings, error) {
	var allWarnings Warnings

	for _, appName := range parser.AppNames() {
		rawManifest, err := parser.RawAppManifest(appName)
		if err != nil {
			return allWarnings, err
		}

		app, getAppWarnings, err := actor.GetApplicationByNameAndSpace(appName, spaceGUID)

		allWarnings = append(allWarnings, getAppWarnings...)
		if err != nil {
			return allWarnings, err
		}

		applyManifestWarnings, err := actor.SetApplicationManifest(app.GUID, rawManifest)
		allWarnings = append(allWarnings, applyManifestWarnings...)
		if err != nil {
			return allWarnings, err
		}
	}

	return allWarnings, nil
}
31409
func (t *Template) GetAllAWSKinesisAnalyticsApplicationResources() map[string]*resources.AWSKinesisAnalyticsApplication {
	results := map[string]*resources.AWSKinesisAnalyticsApplication{}
	for name, untyped := range t.Resources {
		switch resource := untyped.(type) {
		case *resources.AWSKinesisAnalyticsApplication:
			results[name] = resource
		}
	}
	return results
}
790230
func (actor Actor) GetApplicationByNameAndSpace(name string, spaceGUID string) (Application, Warnings, error) {
	app, warnings, err := actor.CloudControllerClient.GetApplications(
		ccv2.Filter{
			Type:     constant.NameFilter,
			Operator: constant.EqualOperator,
			Values:   []string{name},
		},
		ccv2.Filter{
			Type:     constant.SpaceGUIDFilter,
			Operator: constant.EqualOperator,
			Values:   []string{spaceGUID},
		},
	)

	if err != nil {
		return Application{}, Warnings(warnings), err
	}

	if len(app) == 0 {
		return Application{}, Warnings(warnings), actionerror.ApplicationNotFoundError{
			Name: name,
		}
	}

	return Application(app[0]), Warnings(warnings), nil
}
11659
func (c *Client) GetNamespaces() ([]services.Namespace, error) {
	out, err := c.Get(c.Endpoint("namespaces"), url.Values{})
	if err != nil {
		return nil, trace.Wrap(err)
	}
	var re []services.Namespace
	if err := utils.FastUnmarshal(out.Bytes(), &re); err != nil {
		return nil, trace.Wrap(err)
	}
	return re, nil
}
468186
func GetSummary(query map[string]string, lastModifiedSince string) (*Summary, string, error) {
	summary := new(Summary)

	if lastModified, err := executeRequest("summary", query, lastModifiedSince, &summary); err != nil {
		return nil, "", err
	} else {
		return summary, lastModified, nil
	}
}
418341
func (api *API) ApplicationGetByHostIdAndName(hostId, name string) (res *Application, err error) {
	apps, err := api.ApplicationsGet(Params{"hostids": hostId, "filter": map[string]string{"name": name}})
	if err != nil {
		return
	}

	if len(apps) == 1 {
		res = &apps[0]
	} else {
		e := ExpectedOneResult(len(apps))
		err = &e
	}
	return
}
670273
func getAppPath(bundleID string) (string, error) {
	var stdout bytes.Buffer

	cmd := exec.Command("mdfind", "kMDItemCFBundleIdentifier ==", bundleID)
	cmd.Stdout = &stdout
	if err := cmd.Run(); err != nil {
		return "", err
	}

	pathOutput := strings.TrimSpace(stdout.String())
	if pathOutput == "" {
		if fi, err := os.Stat("/Applications/Parallels Desktop.app"); err == nil {
			if fi.IsDir() {
				return "/Applications/Parallels Desktop.app", nil
			}
		}

		return "", fmt.Errorf(
			"Could not detect Parallels Desktop! Make sure it is properly installed.")
	}

	return pathOutput, nil
}
1134686
func getSummary(c context.Context, host string, project string, id int64) (*model.BuildSummary, error) {
	client, err := buildbucketClient(c, host, auth.AsProject, auth.WithProject(project))
	if err != nil {
		return nil, err
	}
	b, err := client.GetBuild(c, &buildbucketpb.GetBuildRequest{
		Id:     id,
		Fields: summaryBuildMask,
	})
	if err != nil {
		return nil, err
	}
	buildAddress := fmt.Sprintf("%d", b.Id)
	if b.Number != 0 {
		buildAddress = fmt.Sprintf("luci.%s.%s/%s/%d", b.Builder.Project, b.Builder.Bucket, b.Builder.Builder, b.Number)
	}

	// Note: The parent for buildbucket build summaries is currently a fake entity.
	// In the future, builds can be cached here, but we currently don't do that.
	buildKey := datastore.MakeKey(c, "buildbucket.Build", fmt.Sprintf("%s:%s", host, buildAddress))
	swarming := b.GetInfra().GetSwarming()

	bs := &model.BuildSummary{
		ProjectID:  b.Builder.Project,
		BuildKey:   buildKey,
		BuilderID:  BuilderID{*b.Builder}.String(),
		BuildID:    "buildbucket/" + buildAddress,
		BuildSet:   protoutil.BuildSets(b),
		ContextURI: []string{fmt.Sprintf("buildbucket://%s/build/%d", host, id)},
		Created:    mustTimestamp(b.CreateTime),
		Summary: model.Summary{
			Start:  mustTimestamp(b.StartTime),
			End:    mustTimestamp(b.EndTime),
			Status: statusMap[b.Status],
		},
		Version:      mustTimestamp(b.UpdateTime).UnixNano(),
		Experimental: b.GetInput().GetExperimental(),
	}
	if task := swarming.GetTaskId(); task != "" {
		bs.ContextURI = append(
			bs.ContextURI,
			fmt.Sprintf("swarming://%s/task/%s", swarming.GetHostname(), swarming.GetTaskId()))
	}
	return bs, nil
}
625655
func (obj *Doc) GetAppProperties(ctx context.Context) (*NxAppProperties, error) {
	result := &struct {
		Prop *NxAppProperties	`json:"qProp"`
	} {}
	err := obj.rpc(ctx, "GetAppProperties", result)
	return result.Prop, err 
}