Hello,

I am the author of the jenkins_api_client project:
https://github.com/arangamani/jenkins_api_client

I used to be able to create a dump slave using some hack I had in
http://www.arangamani.net/jenkins_api_client/JenkinsApi/Client/Node.html#create_dump_slave-instance_methodwhich
simply posts some JSON data to the “/computer/doCreateItem” endpoint
and it used to work fine until we had the private key file as an option.
Now that it got changed to use the new Credentials interface, it doesn’t
work anymore. I can specify the credential ID in the JSON but I couldn’t
get the credentials to work using the API.

After some hacking, I could get the credential to create using a POST of
the following JSON data to “/credentials/configSumbit”

post_params = {
          "name" => "testcred",
          "description" => "test cred description",
          "json" => {
            "domainCredentials" => {
              "domain" => {
                "name" => "",
                "description" => "",
              },
              "credentials" => {
                "scope" => "GLOBAL",
                "id" => "",
                "username" => "root",
                "description" => "root users credential",
                "privateKeySource" => {
                  "value" => "0",
                  "privateKey" => "blah blah blah",
                  "stapler-class" =>
"com.cloudbees.jenkins.plugins.sshcredentials.impl.BasicSSHUserPrivateKey$DirectEntryPrivateKeySource"
                },
                "passphrase" => "",
                "stapler-class" =>
"com.cloudbees.jenkins.plugins.sshcredentials.impl.BasicSSHUserPrivateKey",
                "kind" =>
"com.cloudbees.jenkins.plugins.sshcredentials.impl.BasicSSHUserPrivateKey"
              }
            }
          }.to_json
        }

But there doesn’t seem to be a way for me to obtain the ID of the created
credential so I can’t automate this process.

Is there support for the new credentials interface in the Remote Access
API? If not will this be added in the future?

Thanks,
Kannan.

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to