王子1986
王子1986

Reputation: 3599

how to check running application's buildpack In cloudfoundry

How to check running application's buildpack In cloudfoundry?

I have many buildpacks deployed, is it possible to check used buildpacks on running application?

Upvotes: 3

Views: 6970

Answers (5)

Abhijeet
Abhijeet

Reputation: 8771

Two|Three Stepped Process worked for Cloud Foundry api version: 2.141.0:

  1. Retrieve the GUID of the application using cf app <app_name> --guid - API Doc
  2. Get App summary using above GUID cf curl /v2/apps/:APP-GUID/summary - API Doc
  3. Search for "buildpack" in result, should be there - something like this enter image description here

If "buildpack" not found then follow instructions post from @Smile - Adding here for easier read.

  1. Search for "detected_buildpack_guid" in above result, e.g. enter image description here
  2. Retrieve Buildpack information using above GUID cf curl /v2/buildpacks/:guid - API Doc, then search for filename in results, e.g., enter image description here

Note: Make sure to login into Cloud Foundry from terminal before executing these commands.

Upvotes: 5

akshay
akshay

Reputation: 1

This can be fetched from the below V3 APIs.

  1. Get the list of Application GUIDs:

    cf curl '/v3/apps'
    
  2. Get the relevant buildpacks and its version:

    cf curl /v3/apps/AppGUID/droplets/current
    

Upvotes: 0

Smile
Smile

Reputation: 4088

In addition to Abhijeet's answer, in case you get buildpack attribute as null or empty, you can get the buildpack guid from detected_buildpack_guid attribute and call buildback API like

cf curl /v2/buildpacks/:BUILDPACK-GUID

Upvotes: 1

王子1986
王子1986

Reputation: 3599

In recent released cloud foundry, it is showing buid packs beside your application.

Upvotes: 1

K.AJ
K.AJ

Reputation: 1292

You can do it multiple ways..

You can install buildpack-usage cf cli plugin. You can find it here or here

The other option is to do $> cf curl "/v2/apps"

Check out Cloud Foundry API

Give it a try. Let me know if you have any questions.

Upvotes: 4

Related Questions