Ask Your Question
0

trouble getting list of nodes via PE 3.7 Rest API

asked 2014-12-15 15:38:43 -0500

Red Cricket gravatar image

updated 2014-12-15 17:42:29 -0500

Hi,

I am trying out the PE 3.7 Rest API and I am unfamiliar with curl. I think I need to execute this ...

# /usr/bin/curl -X GET \
> --cacert /etc/puppetlabs/puppet/ssl/certs/ca.pem \
> --cert /etc/puppetlabs/puppet/ssl/certs/puppetmaster-1.example.com.pem \
> --key /etc/puppetlabs/puppet/ssl/private_keys/puppetmaster-1.example.com.pem 
> --insecure https://puppetmaster-1:443/v1/nodes

... but this results in this timeout response:

curl: (56) Received HTTP code 504 from proxy after CONNECT

What am I doing wrong here?

Update: I am using proxy since I am in a lab environment so I found I can connect now if I do this ...

# unset no_proxy
# unset http_proxy
# unset https_proxy

... but I still do not get a list of nodes. So I added -v to my curl command so now I am getting this:

    /usr/bin/curl -v -X GET --cacert /etc/puppetlabs/puppet/ssl/certs/ca.pem --cert /etc/puppetlabs/puppet/ssl/certs/puppetmaster-1.example.com.pem --key /etc/puppetlabs/puppet/ssl/private_keys/puppetmaster-1.example.com.pem --insecure https://puppetmaster-1:443/v2/nodes
    * About to connect() to puppetmaster-1 port 443 (#0)
    *   Trying 10.29.120.143... connected
    * Connected to puppetmaster-1 (10.29.120.143) port 443 (#0)
    * Initializing NSS with certpath: sql:/etc/pki/nssdb
    * warning: ignoring value of ssl.verifyhost
    * skipping SSL peer certificate verification
    * SSL connection using TLS_DHE_RSA_WITH_AES_256_CBC_SHA
    * Server certificate:
    *       subject: CN=puppetmaster-1.example.com
    *       start date: Dec 14 20:36:42 2014 GMT
    *       expire date: Dec 14 20:36:42 2019 GMT
    *       common name: puppetmaster-1.example.com
    *       issuer: CN=Puppet CA generated on puppetmaster-1.example.com at 2014-12-15 12:...
    > GET /v2/nodes HTTP/1.1
    > User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.14.3.0 zlib/1.2.3 libidn/1.18 libssh2/1.4.2
    > Host: puppetmaster-1
    > Accept: */*
    >
    < HTTP/1.1 303 See Other
    < Date: Mon, 15 Dec 2014 23:08:41 GMT
    < Server: Jetty(9.1.z-SNAPSHOT)
    < Location: /auth/login?redirect=%2Fv2%2Fnodes
    < Content-Length: 0
    < Connection: close
    <
    * Closing connection #0
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2014-12-16 21:10:05 -0500

GregLarkin gravatar image

updated 2014-12-23 00:31:22 -0500

Definitely check out this page for information about how to form the API requests, authentication and the proper URLs to use. That should solve the issue you're encountering above.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2014-12-15 15:38:43 -0500

Seen: 469 times

Last updated: Dec 23 '14