Skip to content

Instantly share code, notes, and snippets.

@pccowboy
Last active December 30, 2015 22:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pccowboy/7892378 to your computer and use it in GitHub Desktop.
Save pccowboy/7892378 to your computer and use it in GitHub Desktop.
root@:/var/lib/tftpboot# curl -X PUT -d '{ "build": true }' -H "Accept: version=2,application/json" http://foreman.someone.com/api/hosts/rtbdserv-v02-22b.btrll.com -u USER:PASS -s
{"host":{"build":false,"installed_at":"2013-12-10T13:14:54Z","subnet_id":29,"comment":null,"last_compile":null,"operatingsystem_id":2,"puppet_status":251666433,"domain_id":1,"id":1100,"ip":"165.254.30.86","last_freshcheck":null,"root_pass":"","compute_resource_id":null,"hostgroup_id":11,"image_id":null,"medium_id":3,"owner_id":null,"certname":"rtbdserv-v02-22b.someone.com","enabled":true,"environment_id":1,"serial":null,"last_report":"2013-12-10T15:02:01Z","architecture_id":1,"created_at":"2013-12-09T19:54:01Z","managed":true,"puppet_ca_proxy_id":1,"disk":null,"image_file":"","model_id":2,"name":"rtbdserv-v02-22b.btrll.com","owner_type":null,"source_file_id":null,"updated_at":"2013-12-10T15:05:39Z","use_image":null,"location_id":null,"mac":"00:25:90:c9:c8:7a","ptable_id":10,"uuid":null,"organization_id":null,"puppet_proxy_id":null}}
@pccowboy
Copy link
Author

  • About to connect() to foreman.someone.com port 80 (#0)
  • Trying 50.17.16.50... connected
  • Server auth using Basic with user 'user'

    PUT /api/hosts/rtbdserv-v02-22b.someone.com HTTP/1.1
    Authorization: Basic ZHN3aWZ0OjZ0aGZsMDBy
    User-Agent: curl/7.22.0 (x86_64-pc-linux-gnu) libcurl/7.22.0 OpenSSL/1.0.1 zlib/1.2.3.4 libidn/1.23 librtmp/2.3
    Host: foreman.someone.com
    Accept: version=2,application/json
    Content-Length: 17
    Content-Type: application/x-www-form-urlencoded

  • upload completely sent off: 17out of 17 bytes
    < HTTP/1.1 200 OK
    < Date: Tue, 10 Dec 2013 15:25:39 GMT
    < Server: Apache/2.2.22 (Ubuntu)
    < X-Powered-By: Phusion Passenger (mod_rails/mod_rack) 3.0.19
    < X-UA-Compatible: IE=Edge,chrome=1
    < Foreman_api_version: 1
    < Foreman_version: 1.3.1
    < X-Rack-Cache: invalidate, pass
    < X-Runtime: 0.516266
    < Cache-Control: max-age=0, private, must-revalidate
    < X-Request-Id: a64e6379dba0e22809d2c432027e0c5a
    < ETag: "88f213616a7daec3376230cafc3afdbf"
    < Status: 200
    < Content-Length: 876
    < Content-Type: application/json; charset=utf-8
    <
  • Connection #0 to host foreman.btrll.com left intact
  • Closing connection #0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment