<commit_before>const Zabbix = require('../index');

const whiteSpaceCount = 2;
const zabbix = new Zabbix(
  'http://127.0.0.1:8080/api_jsonrpc.php',
  'Admin',
  'zabbix'
);

zabbix.login()
  .then(() => zabbix.createHost({
    'host': 'zabbix-agent1',
    'groups': [{'groupid': '2'}],
    'interfaces': [
      {
        'dns': 'zabbix-agent1',
        'ip': '',
        'main': 1,
        'port': '10050',
        'type': 1,
        'useip': 0
      }
    ],
    'templates': [{'templateid': '10001'}],
    'inventory_mode': 1
  }))
  .then((value) => console.log(JSON.stringify(value, null, whiteSpaceCount)))
  .catch((reason) =>
    console.log(JSON.stringify(reason, null, whiteSpaceCount))
  );
<commit_msg>replace createHost method with request<commit_after>const Zabbix = require('../index');

const whiteSpaceCount = 2;
const zabbix = new Zabbix(
  'http://127.0.0.1:8080/api_jsonrpc.php',
  'Admin',
  'zabbix'
);

zabbix.login()
  .then(() => zabbix.request('host.create', {
    'host': 'zabbix-agent1',
    'groups': [{'groupid': '2'}],
    'interfaces': [
      {
        'dns': 'zabbix-agent1',
        'ip': '',
        'main': 1,
        'port': '10050',
        'type': 1,
        'useip': 0
      }
    ],
    'templates': [{'templateid': '10001'}],
    'inventory_mode': 1
  }))
  .then((value) => console.log(JSON.stringify(value, null, whiteSpaceCount)))
  .catch((reason) =>
    console.log(JSON.stringify(reason, null, whiteSpaceCount))
  );

{'fraction_non_alphanumeric': 0.2140422631220177, 'fraction_numerical': 0.038173142467621, 'mean_word_length': 2.853018372703412, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6236638', 'n_tokens_mistral': 582, 'n_tokens_neox': 547, 'n_words': 96}