cloud_controller_ng icon indicating copy to clipboard operation
cloud_controller_ng copied to clipboard

No application summary in v3 API

Open IvanBorislavovDimitrov opened this issue 4 years ago • 6 comments

Issue

Missing application summary in v3 API

Context

Hello folks,

We're migrating from v2 to v3 API and our code depends on the application summary resource in several places since everything about the application is required in certain scenarios and it is the fastest and also an elegant way to get the full information about an application with only 1 call (https://apidocs.cloudfoundry.org/15.2.0/apps/get_app_summary.html). If we try to gather this information by using the v3 API and executing separate calls for everything required like env, service instances, routes, domains, buildpacks, packages, etc. it gets much slower and generates quite a lot of calls which may easily result in exceeding the rate limits for some users. Is there a way to achieve the result returned from v2/app/GUID/summary by using the v3 API somehow? I've checked the "include" parameter but it only supports: 'space', 'org', 'space.organization', which unfortunately is not enough. I've also noticed the "fields" parameters for service but it is only supported for: service instances, shared spaces, service offerings, and service plans. Is it possible for this parameter to be integrated with the apps? Is there a way to bring back the application summary response as it very optimal in certain cases?

Thanks and best regards, Ivan

Steps to Reproduce

Try to get the full information about an application with as few calls as possible (preferably 1).

Expected result

Similar response as in the v2/apps/GUID/summary

Current result

No way to get similar full information about an application

Possible Fix

Probably the parameters "fields" may work for apps and may include more resources or "includes" may include more parameters. Or implementing a similar resource like the v2 apps summary?

IvanBorislavovDimitrov avatar Dec 07 '20 15:12 IvanBorislavovDimitrov

We have created an issue in Pivotal Tracker to manage this:

https://www.pivotaltracker.com/story/show/176036916

The labels on this github issue will be updated when the story is started.

cf-gitbot avatar Dec 07 '20 15:12 cf-gitbot

It is unlikely that we will add an application summary endpoint on v3. That said, we are interested in letting clients build their own summary endpoints using tools like the include parameter.

What resources would you like to include on applications?

Gerg avatar Dec 07 '20 19:12 Gerg

Hi, Gerg

Thanks for the fast reply! I would like to include the following resources: -> routes, as well as their respective domain, will be really useful -> application's process(es) which contains information about: command, application's instances, memory, disk, health-check -> application's process(es) statistics so we can calculate the running instances -> application's package -> application's environment -> application's services (service name, service plan, last operation) -> information if ssh is enabled These resources would be really helpful if they could be included via the "include" parameter.

Thanks and regards, Ivan

IvanBorislavovDimitrov avatar Dec 08 '20 10:12 IvanBorislavovDimitrov

@Gerg any update on this one? I am also looking for getting the app->service dependencies, and other than bound app count (via usage summary) I am not able to find any way to find what service instances are used by app apps.

mvadu avatar May 10 '21 19:05 mvadu

Is there any updates about this topic? I am still looking how I can get described application entities by @IvanBorislavovDimitrov using include parameter.

theghost5800 avatar Feb 24 '22 09:02 theghost5800

I had some exchange with @boyan-velinov, @theghost5800 and @IvanBorislavovDimitrov and propose the following v3 extensions for GET /v3/apps/:guid :

  1. include route, domain, process info to GET /v3/apps/:guid using "include"
  2. add environment_variables, ssh_enabled info to GET /v3/apps/:guid (unclear if via "include" or "fields" - both concepts don't match exactly, topic for discussion in CAPI Open Office Hour)
  3. add currentDroplet as "include" (looks like this info is needed and not package info, what if there is no current droplet yet?)

I'm hesitating to add:

  • process stats - requires a call to log-cache = expensive, deserves an extra API call in my eyes
  • service bindings/instances - is an own "universe" with includes and fields, you can get service bindings + instance info for an app with GET /v3/service_credential_bindings?app_guids=:guid&include=service-instance

Future optimisation could be to support "fields" in addition to includes. This avoids e.g. fetching of metadata and labels for the included objects.

stephanme avatar Jul 13 '22 15:07 stephanme