Class: ForemanNetbox::SyncHost::SyncVirtualMachine::Create

Inherits:
Object
  • Object
show all
Includes:
Concerns::AssignTags, Interactor
Defined in:
app/interactors/foreman_netbox/sync_host/sync_virtual_machine/create.rb

Instance Method Summary collapse

Methods included from Concerns::AssignTags

#assign_tags_to, #default_tag_ids

Instance Method Details

#callObject



14
15
16
17
18
19
# File 'app/interactors/foreman_netbox/sync_host/sync_virtual_machine/create.rb', line 14

def call
  context.virtual_machine = ForemanNetbox::API.client::Virtualization::VirtualMachine.new(params).save
rescue NetboxClientRuby::LocalError, NetboxClientRuby::ClientError, NetboxClientRuby::RemoteError => e
  ::Foreman::Logging.logger('foreman_netbox/import').error("#{self.class} error #{e}: #{e.backtrace}")
  context.fail!(error: "#{self.class}: #{e}")
end