Class: Ruzbx::Api::Host
Overview
Instance Attribute Summary
Attributes inherited from Item
Class Method Summary collapse
-
.create(opts, &block) ⇒ Object
rubocop:disable Metrics/MethodLength.
Methods inherited from Item
Constructor Details
This class inherits a constructor from Ruzbx::Api::Item
Class Method Details
.create(opts, &block) ⇒ Object
rubocop:disable Metrics/MethodLength
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/ruzbx/api/host.rb', line 9 def self.create(opts, &block) entity = Entity.build do rpc_method 'host.create' data params: { host: opts[:name], interfaces: [{ type: 1, main: 1, useip: 1, ip: opts[:ip], dns: '', port: '10050' }], groups: opts[:groups], tags: [{ tag: 'creator', value: 'bot' }], templates: opts[:templates], macros: [] } instance_eval(&block) if block_given? end new(entity.commit) end |