MCPcopy Index your code
hub / github.com/cloudfoundry/cli / UpdateProcessByTypeAndApplication

Method UpdateProcessByTypeAndApplication

actor/v7action/process.go:39–62  ·  view source on GitHub ↗
(processType string, appGUID string, updatedProcess resources.Process)

Source from the content-addressed store, hash-verified

37}
38
39func (actor Actor) UpdateProcessByTypeAndApplication(processType string, appGUID string, updatedProcess resources.Process) (Warnings, error) {
40 if updatedProcess.HealthCheckType != constant.HTTP {
41 if updatedProcess.HealthCheckEndpoint != constant.ProcessHealthCheckEndpointDefault && updatedProcess.HealthCheckEndpoint != "" {
42 return nil, actionerror.HTTPHealthCheckInvalidError{}
43 }
44
45 updatedProcess.HealthCheckEndpoint = ""
46 }
47
48 process, warnings, err := actor.GetProcessByTypeAndApplication(processType, appGUID)
49 allWarnings := warnings
50 if err != nil {
51 return allWarnings, err
52 }
53
54 updatedProcess.GUID = process.GUID
55 _, updateWarnings, err := actor.CloudControllerClient.UpdateProcess(resources.Process(updatedProcess))
56 allWarnings = append(allWarnings, Warnings(updateWarnings)...)
57 if err != nil {
58 return allWarnings, err
59 }
60
61 return allWarnings, nil
62}

Implementers 1

FakeActorcommand/v7/v7fakes/fake_actor.go

Calls 4

ProcessStruct · 0.92
WarningsTypeAlias · 0.70
UpdateProcessMethod · 0.65

Tested by

no test coverage detected