Support Questions
Find answers, ask questions, and share your expertise

how to configure the ambari local repositorues by ambari api

how to configure the ambari local repositorues by ambari api

It’s my pleasure to be , and I hope to learn from the great hortonworks site

We are using ambary cluster with hdp version – 2.6.4

And now we want to configure the repositories in mabari by api in order to upgrade the cluster to version hdp – 2.6.5

So instead to configure the repo manual we create the following API

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

while the json file is:

# more repo.json
  "Repositories": {
    "repo_name": "HDP-",
    "base_url": "",
    "verify_base_url": true

But when we run the :

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

its passed without any output

but when we access the ambary , we not see the repo - HDP-

we also runs the API with trace

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

* About to connect() to port 8080 (#0)

* Connected to  port 8080 (#0)
* Server auth using Basic with user 'admin'
> PUT /api/v1/stacks/HDP/versions/2.6/operating_systems/redhat7/repositories/HDP-2.6 HTTP/1.1
> Authorization: Basic YWRtaW46YWRtaW4=
> User-Agent: curl/7.29.0
> Host:
> Accept: */*
> X-Requested-By: ambari
> Content-Length: 158
> Content-Type: application/x-www-form-urlencoded
* upload completely sent off: 158 out of 158 bytes
< HTTP/1.1 200 OK
< X-Frame-Options: DENY
< X-XSS-Protection: 1; mode=block
< X-Content-Type-Options: nosniff
< Cache-Control: no-store
< Pragma: no-cache
< Set-Cookie: AMBARISESSIONID=cj6u81acs0ij6v0hjuc7mius;Path=/;HttpOnly
< Expires: Thu, 01 Jan 1970 00:00:00 GMT
< User: admin
< Content-Type: text/plain
< Content-Length: 0
* Connection #0 to host left intact

I will appreciate to get help , and understand where we are wrong here