Query Tanzu Hub GraphQL endpoint for each application and the associated Spring Boot version
search cancel

Query Tanzu Hub GraphQL endpoint for each application and the associated Spring Boot version

book

Article ID: 436719

calendar_today

Updated On:

Products

VMware Tanzu Platform - Hub

Issue/Introduction

This KB provides a query that can be used to identify all applications running on a foundation attached to Tanzu Hub and correlates the associated Spring Boot version with each app identified.

Environment

Tanzu Hub 10.3+

Resolution

Gain access to Tanzu Hub GraphQL API

Use How to access Tanzu Hub GraphQL API via Altair to access the builtin Altair client in Tanzu Hub.

 

Run the following Query to applications and Spring Boot versions:

query GetSpringVersionsResolved {
  entityQuery {
    queryEntities(
      entityType: ["Tanzu.Spring.Instance", "Tanzu.Spring.AppReplica", "Tanzu.Spring.Application"],
      first: 100
    ) {
      entities {
        entityId
        entityName
        entityType
       
        typedEntity {
          # 1. Check the Instance (returns String)
          ... on Entity_Tanzu_Spring_Instance_Type {
            instanceProps: properties {
              bootVersion: info_spring_boot_version
            }
          }
         
          # 2. Check the AppReplica (returns [String])
          ... on Entity_Tanzu_Spring_AppReplica_Type {
            replicaProps: properties {
              bootVersions: info_spring_boot_version
            }
          }
         
          # 3. Check the Logical Application (returns [String])
          ... on Entity_Tanzu_Spring_Application_Type {
            appProps: properties {
              bootVersions: info_spring_boot_version
            }
          }
        }
      }
    }
  }
}