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.

how to configure the ambari local repositorues by ambari api

Highlighted

how to configure the ambari local repositorues by ambari api

New Contributor

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 http://testbox.gm.com:8080/api/v1/stacks/HDP/versions/2.6/operating_systems/redhat7/repositories/HDP... -d @repo.json



while the json file is:


# more repo.json
{
  "Repositories": {
    "repo_name": "HDP-2.6.5.0",
    "base_url": "http://testbox.gm.com/HDP/centos7/2.6.5.0-292",
    "verify_base_url": true
  }
}



But when we run the :


curl -H "X-Requested-By: ambari" -X PUT -u admin:admin http://testbox.gm.com:8080/api/v1/stacks/HDP/versions/2.6/operating_systems/redhat7/repositories/HDP... -d @repo.json


its passed without any output

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



we also runs the API with trace


curl -H "X-Requested-By: ambari" -X PUT -u admin:admin http://testbox.gm.com:8080/api/v1/stacks/HDP/versions/2.6/operating_systems/redhat7/repositories/HDP... -d @repo.json

* About to connect() to testbox.gm.com port 8080 (#0)

* Connected to testbox.gm.com  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: testbox.gm.com:8080
> 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 testbox.gm.com left intact



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