Skip to content

Instantly share code, notes, and snippets.

@discreet
Created July 11, 2016 19:07
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 discreet/6f6624ae45496a498992ae5042ba08f8 to your computer and use it in GitHub Desktop.
Save discreet/6f6624ae45496a498992ae5042ba08f8 to your computer and use it in GitHub Desktop.
curl -k -X POST -H "Accept: application/json" \
-H "Accept: application/json" -H "Content-Type: application/json" \
-H "Cache-Control: no-cache" -u "username:password" \
-d '
{
"host": {
"name": "<instance_id>",
"organization_id": 4,
"location_id": 12,
"hostgroup_id": <hostgroup_id>,
"environment_id": <environment_id>,
"puppet_proxy_id": 2,
"puppet_ca_proxy_id": 5,
"operatingsystem_id": 13,
"enabled": true,
"managed": false,
"certname": "<instance_id>",
"comment": "<comment>",
"parameters": {
"param1": {
"name": "aws_account",
"value": "<aws account_id>"
}
}
}
}
' "https://foreman.domain.com/api/hosts"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment