Project

General

Profile

26926_hammer_api_curl_build.txt

output by toggling build status via curl/API - Will Foster, 05/31/2019 03:52 PM

 
1
[root@foreman ~]# curl -vvv -X PUT -s -k -u admin:XXXXXXXXXXXX -H "Accept: application/json" -H "Content-Type: application/json" -d '{ "host" : { "build" : "true" } }' https://`hostname`/api/v2/hosts/480
2
* About to connect() to foreman.rdu2.scalelab.redhat.com port 443 (#0)
3
*   Trying 10.1.32.3...
4
* Connected to foreman.rdu2.scalelab.redhat.com (10.1.32.3) port 443 (#0)
5
* Initializing NSS with certpath: sql:/etc/pki/nssdb
6
* skipping SSL peer certificate verification
7
* NSS: client certificate not found (nickname not specified)
8
* SSL connection using TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
9
* Server certificate:
10
*       subject: CN=foreman.rdu2.scalelab.redhat.com
11
*       start date: Oct 02 15:15:27 2018 GMT
12
*       expire date: Oct 02 15:15:27 2023 GMT
13
*       common name: foreman.rdu2.scalelab.redhat.com
14
*       issuer: CN=Puppet CA: foreman.rdu2.scalelab.redhat.com
15
* Server auth using Basic with user 'admin'
16
> PUT /api/v2/hosts/480 HTTP/1.1
17
> Authorization: Basic YWRtaW46b1NCSlQ4Y2pxaE5HbnEyWQ==
18
> User-Agent: curl/7.29.0
19
> Host: foreman.rdu2.scalelab.redhat.com
20
> Accept: application/json
21
> Content-Type: application/json
22
> Content-Length: 33
23
>
24
* upload completely sent off: 33 out of 33 bytes
25
< HTTP/1.1 200 OK
26
< Date: Fri, 31 May 2019 15:47:30 GMT
27
< Server: Apache/2.4.6 (CentOS)
28
< Foreman_version: 1.19.1
29
< Foreman_api_version: 2
30
< Apipie-Checksum: 168c3600e744d9af1db2f53be93f02db2a338009
31
< Cache-Control: max-age=0, private, must-revalidate
32
< X-Request-Id: 8a4b2f61-3b49-4ade-b799-12687621312f
33
< X-Runtime: 1.148231
34
< Content-Security-Policy: default-src 'self'; child-src 'self'; connect-src 'self' ws: wss:; img-src 'self' data: *.gravatar.com; script-src 'unsafe-eval' 'unsafe-inline' 'self'; style-src 'unsafe-inline' 'self'
35
< Strict-Transport-Security: max-age=631139040; includeSubdomains
36
< X-Content-Type-Options: nosniff
37
< X-Download-Options: noopen
38
< X-Frame-Options: sameorigin
39
< X-Permitted-Cross-Domain-Policies: none
40
< X-XSS-Protection: 1; mode=block
41
< X-Powered-By: Phusion Passenger 4.0.53
42
< Set-Cookie: request_method=PUT; path=/; secure; HttpOnly; SameSite=Lax
43
< Set-Cookie: _session_id=aa0be005603e87bcfdc02fdf3765ae2f; path=/; secure; HttpOnly; SameSite=Lax
44
< ETag: W/"9d09911cc9efe8ac0196cf148cb4dc61"
45
< Status: 200 OK
46
< Vary: Accept-Encoding
47
< Transfer-Encoding: chunked
48
< Content-Type: application/json; charset=utf-8
49
<
50
{"ip":"10.1.42.202","ip6":"","environment_id":1,"environment_name":"production","last_report":null,"mac":"b8:ca:3a:63:87:b0","realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":1,"domain_name":"rdu2.scalelab.redhat.com","architecture_id":1,"architecture_name":"x86_64","operatingsystem_id":2,"operatingsystem_name":"RHEL 7","subnet_id":4,"subnet_name":"rdu2_mgmt3","subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":107,"ptable_name":"generic-rhel7","medium_id":11,"medium_name":"RHEL Local","pxe_loader":"PXELinux BIOS","build":true,"comment":"","disk":"","installed_at":null,"model_id":null,"hostgroup_id":2,"owner_id":4,"owner_name":"Admin User","owner_type":"User","enabled":true,"managed":true,"use_image":null,"image_file":"","uuid":null,"compute_resource_id":null,"compute_resource_name":null,"compute_profile_id":null,"compute_profile_name":null,"capabilities":["build"],"provision_method":"build","certname":"f21-h18-000-r620.rdu2.scalelab.redhat.com","image_id":null,"image_name":null,"created_at":"2019-03-12 18:58:02 UTC","updated_at":"2019-05-31 15:47:31 UTC","last_compile":null,"global_status":0,"global_status_label":"OK","puppet_status":0,"model_name":null,"build_status":1,"build_status_label":"Pending installation","name":"f21-h18-000-r620.rdu2.scalelab.redhat.com","id":480,"puppet_proxy_id":null,"puppet_proxy_name":null,"puppet_ca_proxy_id":null,"puppet_ca_proxy_name":null,"puppet_proxy":null,"puppet_ca_proxy":null,"hostgroup_name":"Production","hostgroup_title":"Production","parameters":[{"priority":70,"created_at":"2019-05-31 15:33:50 UTC","updated_at":"2019-05-31 15:33:50 UTC","id":1169,"name":"broken_state","value":"true"}],"all_parameters":[{"priority":70,"created_at":"2019-05-31 15:33:50 UTC","updated_at":"2019-05-31 15:33:50 UTC","id":1169,"name":"broken_state","value":"true"}],"interfaces":[{"id":830,"name":"f21-h18-000-r620.rdu2.scalelab.redhat.com","ip":"10.1.42.202","ip6":"","mac":"b8:ca:3a:63:87:b0","mtu":1500,"fqdn":"f21-h18-000-r620.rdu2.scalel* Connection #0 to host foreman.rdu2.scalelab.redhat.com left intact  
51
ab.redhat.com","identifier":"em1","primary":true,"provision":true,"type":"interface"},{"id":831,"name":"mgmt-f21-h18-000-r620.rdu2.scalelab.redhat.com","ip":"10.1.42.49","ip6":"","mac":"e0:db:55:12:db:06","mtu":1500,"fqdn":"mgmt-f21-h18-000-r620.rdu2.scalelab.redhat.com","identifier":"mgmt","primary":false,"provision":false,"type":"interface"}],"puppetclasses":[],"config_groups":[],"all_puppetclasses":[],"permissions":{"view_hosts":true,"create_hosts":true,"edit_hosts":true,"destroy_hosts":true,"build_hosts":true,"power_hosts":true,"console_hosts":true,"ipmi_boot_hosts":true,"puppe
52
trun_hosts":true}}