Support Questions

Find answers, ask questions, and share your expertise

REST-URL to get the relevant information about the connectet remote Cluster

avatar
Contributor

Hi,

i have add two Ambari-Clusters in the remote configuration of another Ambari-Server. To manage these Clusters I write for my own an Ambari-View. To get the relevant Information I use the Ambari-REST-API. For the local-CLuster I know the username, Password and the domainname of the Cluster. But for the remote Cluster I dont want to manage this Information twice. Can I get this Information with the rest-API? I have admin-Privileges on the main-Ambari-Server.

Best Regards

Dominik

1 ACCEPTED SOLUTION

avatar
Master Mentor

@Dominik Ludwig

Please correct me uf my understanding regarding your query is not right.

.

We can register the remotecluster using ambari API as following, by passign the remote cluster credentials:

# curl -H "X-Requested-By: ambari" -u admin:admin  -X POST -d '{"ClusterInfo":{"name":"erie21","url":"http://mainremote.example.com:8080/api/v1/clusters/MainCluster","username":"admin","password":"admin"}}' http://standaloneambari.example.com:8080/api/v1/remoteclusters/RemoteClusterNameA


.

- However once the remote cluster is registered, it is not possible to see the password of remote cluster using the ambari APIs. You can only update the credentials using -X PUT method and the Put data as mentioned in the above API call.

curl -H "X-Requested-By: ambari" -u admin:admin -X GET http://standaloneambari.example.com:8080/api/v1/remoteclusters/RemoteClusterNameA

In the response of the above command we will not see the password only the username will be visible.

.

View solution in original post

1 REPLY 1

avatar
Master Mentor

@Dominik Ludwig

Please correct me uf my understanding regarding your query is not right.

.

We can register the remotecluster using ambari API as following, by passign the remote cluster credentials:

# curl -H "X-Requested-By: ambari" -u admin:admin  -X POST -d '{"ClusterInfo":{"name":"erie21","url":"http://mainremote.example.com:8080/api/v1/clusters/MainCluster","username":"admin","password":"admin"}}' http://standaloneambari.example.com:8080/api/v1/remoteclusters/RemoteClusterNameA


.

- However once the remote cluster is registered, it is not possible to see the password of remote cluster using the ambari APIs. You can only update the credentials using -X PUT method and the Put data as mentioned in the above API call.

curl -H "X-Requested-By: ambari" -u admin:admin -X GET http://standaloneambari.example.com:8080/api/v1/remoteclusters/RemoteClusterNameA

In the response of the above command we will not see the password only the username will be visible.

.