Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Ambari rest API to get full version of HDP (2.4.x.x)

Ambari rest API to get full version of HDP (2.4.x.x)

Expert Contributor

Is there an Ambari Rest API to get the full version, including minor version e.g.: 2.4.x.x, currently I have able to get the high level stack version as 2.4 but nor with minor versions included.

3 REPLIES 3

Re: Ambari rest API to get full version of HDP (2.4.x.x)

Super Mentor

@nyakkanti

Please try the following API call, In the response you will find "component_version" (It should show "2.4.2.0")

http://AMBARI_HOST:8080/api/v1/services/AMBARI/components/AMBARI_SERVER?fields=RootServiceComponents...

.

Re: Ambari rest API to get full version of HDP (2.4.x.x)

Expert Contributor
@Jay SenSharma

The above url provides details pertaning to Ambari, doesn't provide HDP version.

Re: Ambari rest API to get full version of HDP (2.4.x.x)

Super Mentor

@nyakkanti

Previous one was to get the ambari version detail.

For HDP version detail you can try the following:

http://AMBARI_HOST:8080/api/v1/clusters/<CLUSTER_NAME>/stack_versions/51/repository_versions/154?fie...

.

Here you will need to replace the stack_versions to point to your latest stack. Please see: https://github.com/apache/ambari/blob/trunk/ambari-server/docs/api/v1/stack-version-resources.md

It should show something like:

{
  href: "http://erie1.example.com:8080/api/v1/clusters/ErieCluster/stack_versions/51/repository_versions/154?fields=RepositoryVersions/repository_version",
  RepositoryVersions: {
    id: 154,
    repository_version: "2.5.3.0-37",
    stack_name: "HDP",
    stack_version: "2.5"
  }
}

.

Don't have an account?
Coming from Hortonworks? Activate your account here