(apps []resources.Application)
| 145 | } |
| 146 | |
| 147 | func (actor Actor) getProcessSummariesForApps(apps []resources.Application) (map[string]ProcessSummaries, Warnings, error) { |
| 148 | processSummariesByAppGUID := make(map[string]ProcessSummaries) |
| 149 | var allWarnings Warnings |
| 150 | var processes []resources.Process |
| 151 | |
| 152 | warnings, err := batcher.RequestByGUID(toAppGUIDs(apps), func(guids []string) (ccv3.Warnings, error) { |
| 153 | batch, warnings, err := actor.CloudControllerClient.GetProcesses(ccv3.Query{ |
| 154 | Key: ccv3.AppGUIDFilter, Values: guids, |
| 155 | }) |
| 156 | processes = append(processes, batch...) |
| 157 | return warnings, err |
| 158 | }) |
| 159 | allWarnings = append(allWarnings, warnings...) |
| 160 | if err != nil { |
| 161 | return nil, allWarnings, err |
| 162 | } |
| 163 | |
| 164 | for _, process := range processes { |
| 165 | instances, warnings, err := actor.CloudControllerClient.GetProcessInstances(process.GUID) |
| 166 | allWarnings = append(allWarnings, Warnings(warnings)...) |
| 167 | |
| 168 | if err != nil { |
| 169 | switch err.(type) { |
| 170 | case ccerror.ProcessNotFoundError, ccerror.InstanceNotFoundError: |
| 171 | continue |
| 172 | default: |
| 173 | return nil, allWarnings, err |
| 174 | } |
| 175 | } |
| 176 | |
| 177 | var instanceDetails []ProcessInstance |
| 178 | for _, instance := range instances { |
| 179 | instanceDetails = append(instanceDetails, ProcessInstance(instance)) |
| 180 | } |
| 181 | |
| 182 | processSummary := ProcessSummary{ |
| 183 | Process: resources.Process(process), |
| 184 | InstanceDetails: instanceDetails, |
| 185 | } |
| 186 | |
| 187 | processSummariesByAppGUID[process.AppGUID] = append(processSummariesByAppGUID[process.AppGUID], processSummary) |
| 188 | } |
| 189 | |
| 190 | return processSummariesByAppGUID, allWarnings, nil |
| 191 | } |
| 192 | |
| 193 | func (actor Actor) getProcessSummariesForSpace(spaceGUID string) (map[string]ProcessSummaries, Warnings, error) { |
| 194 | processSummariesByAppGUID := make(map[string]ProcessSummaries) |
no test coverage detected