Reply
New Contributor
Posts: 1
Registered: ‎03-02-2015

Problem with API REST V9 and private Key

Hi,

I try to add a host in my cloudera manager with API HTTP REST and curl but i want to use a private key authentification.

But what do i have to put in the privateKey parameter : link to the file, or the key directly ?
I tried both but none of them works, i get the same error.

I execute this : curl -X POST -u admin:admin http://master-test:7180/api/v9/cm/commands/hostInstall -H 'Content-Type: application/json' -d '{"hostNames": ["master-test", "node1-test", "node2-test"], "userName": "foo","privateKey":"/home/foo/.ssh/id_rsa","passphrase":"bar"}'

Api return : {
"id" : 198,
"name" : "GlobalHostInstall",
"startTime" : "2015-03-02T13:13:41.571Z",
"active" : true,
"children" : {
"items" : [ {
"id" : 200,
"name" : "HostInstall",
"startTime" : "2015-03-02T13:13:41.574Z",
"active" : true
}, {
"id" : 197,
"name" : "HostInstall",
"startTime" : "2015-03-02T13:13:41.571Z",
"active" : true
}, {
"id" : 199,
"name" : "HostInstall",
"startTime" : "2015-03-02T13:13:41.573Z",
"active" : true
} ]
}
}

Result data is : No provider available for Unknown key file

Thanks

Highlighted
Cloudera Employee
Posts: 289
Registered: ‎07-08-2013

Re: Problem with API REST V9 and private Key

For the JSON key "privateKey", the value needs to be the contents of your "/home/foo/.ssh/id_rsa"
Announcements