Implement GET /v3/processes/:guid/process_instances and embed=process_instances #4796
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Implement GET /v3/processes/:guid/process_instances
This endpoint returns information for all process instances (= actual LRPs) for the given process. Per process instance the following information is shown: index, state, since.
The data is retrieved from Diego via the endpoint
/v1/actual_lrps/list_by_process_guids.The
InstancesStatsReporterprocesses this data as follows:DOWNstateAdditional changes:
BbsInstancesClient:handle_diego_errorsneeds check forResourceNotFoundonly when callingdesired_lrp_by_process_guid. The other methods return an empty list.BuildpackPresenter,ProcessPresenter: remove useless methodImplement embed=process_instances
Process instances can be embedded into process resources; the parameter
embed=process_instancesis available for the following API endpoints:GET /v3/processes/:guid?embed=process_instancesGET /v3/apps/:guid/processes/:type?embed=process_instancesGET /v3/processes?embed=process_instancesGET /v3/apps/:guid/processes?embed=process_instancesA new
ProcessShowMessagehas been introduced;ProcessesListMessagehas been extended. Both messages allow theembedkey that is checked with theEmbedParamValidator.The process output is enhanced by the
EmbedProcessInstancesDecoratorthat fetches the required information from Diego and adds a fieldprocess_instancesto the resource.Process resources now also contain a link to
process_instances.API docs have been extended with the new process instances pseudo-resource and a description of the
embedparameter.Fixes #3594.
I have reviewed the contributing guide
I have viewed, signed, and submitted the Contributor License Agreement
I have made this pull request to the
mainbranchI have run all the unit tests using
bundle exec rakeI have run CF Acceptance Tests