Project

General

Profile

Actions

Bug #1800

closed

Not possible to create unmanaged host via API

Added by Tomas Karasek over 11 years ago. Updated over 11 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Host creation
Target version:
Difficulty:
trivial
Triaged:
Fixed in Releases:
Found in Releases:

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.

Actions #1

Updated by Steve Traylen over 11 years ago

With the proposed patch from mailing list this is good and you can add hosts specifying the hostname and group only.

Actions #2

Updated by Tomas Karasek over 11 years ago

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

Actions #3

Updated by Nacho Barrientos over 11 years ago

Hi,

Do you plan to merge this patch?

Actions #4

Updated by Ohad Levy over 11 years ago

  • Target version set to 1.1
Actions #5

Updated by Greg Sutcliffe over 11 years ago

  • Target version changed from 1.1 to Bug scrub
Actions #6

Updated by Joseph Magen over 11 years ago

  • Assignee set to Joseph Magen
Actions #7

Updated by Joseph Magen over 11 years ago

  • Status changed from New to Assigned
Actions #8

Updated by Joseph Magen over 11 years ago

  • Status changed from Assigned to Closed
Actions #9

Updated by Joseph Magen over 11 years ago

  • Status changed from Closed to Ready For Testing
Actions #10

Updated by Sam Kottler over 11 years ago

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?

Actions #11

Updated by Sam Kottler over 11 years ago

  • Status changed from Ready For Testing to Closed
Actions

Also available in: Atom PDF