Bug #1800
closed
Not possible to create unmanaged host via API
Added by Tomas Karasek over 12 years ago.
Updated about 12 years ago.
Description
even though I send
'{"host": {"operatingsystem_id": 21, "managed": false, "name": "ip188000.domain.ch", "ip": "188.142.144.17", "hostgroup_id": 53, "mac": "00:17:3e:00:4e:4b", "architecture_id": 1, "build": "0", "ptable_id": 1}}'
host is created as managed
Would be cool if the logic reflected the managed:false item.
With the proposed patch from mailing list this is good and you can add hosts specifying the hostname and group only.
the patch from the mailing list by Ohad
diff --git a/app/controllers/hosts_controller.rb b/app/controllers/hosts_controller.rb
index 2de8015..7fe9852 100644
--- a/app/controllers/hosts_controller.rb
+++ b/app/controllers/hosts_controller.rb
@@ -84,7 +84,7 @@ class HostsController < ApplicationController
def create
@host = Host.new(params[:host])
- @host.managed = true
+ @host.managed = true if params[:host][:managed].nil?
forward_request_url
if @host.save
Hi,
Do you plan to merge this patch?
- Target version set to 1.1
- Target version changed from 1.1 to Bug scrub
- Assignee set to Joseph Magen
- Status changed from New to Assigned
- Status changed from Assigned to Closed
- Status changed from Closed to Ready For Testing
I'm going to mark this issue closed so we can get accurate numbers for how many issues got closed. Is this fix now included in the API v1 branch?
- Status changed from Ready For Testing to Closed
Also available in: Atom
PDF