Support Questions

Find answers, ask questions, and share your expertise

API + how to capture the local repo by API

how to capture the local repo "Base URL" by API


we try the following , but this not include the URL PATH

#  curl -H "X-Requested-By: ambari" -X GET -u admin:admin  http://master02:8080/api/v1/stacks/HDP/versions/2.6/repository_versions
  "href" : "http://master02:8080/api/v1/stacks/HDP/versions/2.6/repository_versions",
  "items" : [
      "href" : "http://master02:8080/api/v1/stacks/HDP/versions/2.6/repository_versions/1",
      "RepositoryVersions" : {
        "id" : 1,
        "stack_name" : "HDP",
        "stack_version" : "2.6"


@Michael Bronson

First, create the repo.json and hdputils-repo.json files, these are real cluster setup REST API I have used on AWS. Make sure that base URL once typed in the browser you can see both the HDP and HDP_Utils files. As usual, have these files where you are running the API from.

Setup Internal repo via REST API.


curl -H "X-Requested-By: ambari" -X PUT -u admin:admin -d @repo.json 

Contents of the repo.json

{ "Repositories" : { "base_url" : "", "verify_base_url" : true } }


curl -H "X-Requested-By: ambari" -X PUT -u admin:admin -d @hdputils-repo.json 

Contents of the hdputils-repo.json

{ "Repositories" : { "base_url" : "", "verify_base_url" : true } }

Hope that give you a clear indication

@Geoffrey sorry if my question not clearly , but we not want to create..update the repo on ambari , what we want is to print the current repo from the ambari by API


@Geoffrey , if printing the current repo by API as described in ambai GUI is not able , then at least how we can identify the API that you described here , performed successfully ?

"curl -H "X-Requested-By: ambari"-X PUT -u admin:admin -d @repo.json"