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.

Problem with API REST V9 and private Key

Problem with API REST V9 and private Key

New Contributor

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

1 REPLY 1
Highlighted

Re: Problem with API REST V9 and private Key

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