github.com/mook-as/cf-cli@v7.0.0-beta.28.0.20200120190804-b91c115fae48+incompatible/actor/v3action/process.go (about)

     1  package v3action
     2  
     3  import (
     4  	"code.cloudfoundry.org/cli/actor/actionerror"
     5  	"code.cloudfoundry.org/cli/api/cloudcontroller/ccerror"
     6  	"code.cloudfoundry.org/cli/api/cloudcontroller/ccv3"
     7  )
     8  
     9  // Process represents a V3 actor process.
    10  type Process ccv3.Process
    11  
    12  func (actor Actor) ScaleProcessByApplication(appGUID string, process Process) (Warnings, error) {
    13  	_, warnings, err := actor.CloudControllerClient.CreateApplicationProcessScale(appGUID, ccv3.Process(process))
    14  	allWarnings := Warnings(warnings)
    15  	if err != nil {
    16  		if _, ok := err.(ccerror.ProcessNotFoundError); ok {
    17  			return allWarnings, actionerror.ProcessNotFoundError{ProcessType: process.Type}
    18  		}
    19  		return allWarnings, err
    20  	}
    21  
    22  	return allWarnings, nil
    23  }