/* eslint-disable @typescript-eslint/naming-convention */

const inventoryCpu = {
  architecture: 'x86_64',
  count: 8,
  flags: [
    'fpu',
    'vme',
    'de',
    'pse',
    'tsc',
    'msr',
    'pae',
    'mce',
    'cx8',
    'apic',
    'sep',
    'mtrr',
    'pge',
    'mca',
    'cmov',
    'pat',
    'pse36',
    'clflush',
    'mmx',
    'fxsr',
    'sse',
    'sse2',
    'ss',
    'syscall',
    'nx',
    'pdpe1gb',
    'rdtscp',
    'lm',
    'constant_tsc',
    'rep_good',
    'nopl',
    'xtopology',
    'cpuid',
    'tsc_known_freq',
    'pni',
    'pclmulqdq',
    'vmx',
    'ssse3',
    'fma',
    'cx16',
    'pdcm',
    'pcid',
    'sse4_1',
    'sse4_2',
    'x2apic',
    'movbe',
    'popcnt',
    'tsc_deadline_timer',
    'aes',
    'xsave',
    'avx',
    'f16c',
    'rdrand',
    'hypervisor',
    'lahf_lm',
    'abm',
    '3dnowprefetch',
    'cpuid_fault',
    'invpcid_single',
    'pti',
    'ssbd',
    'ibrs',
    'ibpb',
    'stibp',
    'tpr_shadow',
    'vnmi',
    'flexpriority',
    'ept',
    'vpid',
    'ept_ad',
    'fsgsbase',
    'tsc_adjust',
    'bmi1',
    'hle',
    'avx2',
    'smep',
    'bmi2',
    'erms',
    'invpcid',
    'rtm',
    'mpx',
    'rdseed',
    'adx',
    'smap',
    'clflushopt',
    'xsaveopt',
    'xsavec',
    'xgetbv1',
    'xsaves',
    'arat',
    'umip',
    'md_clear',
    'arch_capabilities',
  ],
  frequency: 3792,
  model_name: 'Intel Core Processor (Skylake, IBRS)',
};

const getHostInventory = (name = 'localhost') => ({
  bmc_address: '0.0.0.0',
  bmc_v6address: '::/0',
  boot: {
    current_boot_mode: 'bios',
  },
  cpu: inventoryCpu,
  disks: [
    {
      drive_type: 'HDD',
      hctl: '0:0:0:0',
      id: '/dev/sda',
      installation_eligibility: {
        eligible: true,
        not_eligible_reasons: null,
      },
      model: 'QEMU_HARDDISK',
      name: 'sda',
      path: '/dev/sda',
      serial: 'QM00001',
      size_bytes: 12884901888,
      smart:
        '{"json_format_version":[1,0],"smartctl":{"version":[7,1],"svn_revision":"5049","platform_info":"x86_64-linux-4.18.0-305.19.1.el8_4.x86_64","build_info":"(local build)","argv":["smartctl","--all","--json=c","/dev/sda"],"exit_status":0},"device":{"name":"/dev/sda","info_name":"/dev/sda [SAT]","type":"sat","protocol":"ATA"},"model_name":"QEMU HARDDISK","serial_number":"QM00001","firmware_version":"2.5+","user_capacity":{"blocks":25165824,"bytes":12884901888},"logical_block_size":512,"physical_block_size":512,"in_smartctl_database":false,"ata_version":{"string":"ATA/ATAPI-7, ATA/ATAPI-5 published, ANSI NCITS 340-2000","major_value":240,"minor_value":22},"local_time":{"time_t":1650381380,"asctime":"Tue Apr 19 15:16:20 2022 UTC"},"smart_status":{"passed":true},"ata_smart_data":{"offline_data_collection":{"status":{"value":130,"string":"was completed without error","passed":true},"completion_seconds":288},"self_test":{"status":{"value":0,"string":"completed without error","passed":true},"polling_minutes":{"short":2,"extended":54}},"capabilities":{"values":[25,3],"exec_offline_immediate_supported":true,"offline_is_aborted_upon_new_cmd":false,"offline_surface_scan_supported":true,"self_tests_supported":true,"conveyance_self_test_supported":false,"selective_self_test_supported":false,"attribute_autosave_enabled":true,"error_logging_supported":true,"gp_logging_supported":false}},"ata_smart_attributes":{"revision":1,"table":[{"id":1,"name":"Raw_Read_Error_Rate","value":100,"worst":100,"thresh":6,"when_failed":"","flags":{"value":3,"string":"PO---- ","prefailure":true,"updated_online":true,"performance":false,"error_rate":false,"event_count":false,"auto_keep":false},"raw":{"value":0,"string":"0"}},{"id":3,"name":"Spin_Up_Time","value":100,"worst":100,"thresh":0,"when_failed":"","flags":{"value":3,"string":"PO---- ","prefailure":true,"updated_online":true,"performance":false,"error_rate":false,"event_count":false,"auto_keep":false},"raw":{"value":16,"string":"16"}},{"id":4,"name":"Start_Stop_Count","value":100,"worst":100,"thresh":20,"when_failed":"","flags":{"value":2,"string":"-O---- ","prefailure":false,"updated_online":true,"performance":false,"error_rate":false,"event_count":false,"auto_keep":false},"raw":{"value":100,"string":"100"}},{"id":5,"name":"Reallocated_Sector_Ct","value":100,"worst":100,"thresh":36,"when_failed":"","flags":{"value":3,"string":"PO---- ","prefailure":true,"updated_online":true,"performance":false,"error_rate":false,"event_count":false,"auto_keep":false},"raw":{"value":0,"string":"0"}},{"id":9,"name":"Power_On_Hours","value":100,"worst":100,"thresh":0,"when_failed":"","flags":{"value":3,"string":"PO---- ","prefailure":true,"updated_online":true,"performance":false,"error_rate":false,"event_count":false,"auto_keep":false},"raw":{"value":1,"string":"1"}},{"id":12,"name":"Power_Cycle_Count","value":100,"worst":100,"thresh":0,"when_failed":"","flags":{"value":3,"string":"PO---- ","prefailure":true,"updated_online":true,"performance":false,"error_rate":false,"event_count":false,"auto_keep":false},"raw":{"value":0,"string":"0"}},{"id":190,"name":"Airflow_Temperature_Cel","value":69,"worst":69,"thresh":50,"when_failed":"","flags":{"value":3,"string":"PO---- ","prefailure":true,"updated_online":true,"performance":false,"error_rate":false,"event_count":false,"auto_keep":false},"raw":{"value":522125343,"string":"31 (Min/Max 31/31)"}}]},"power_on_time":{"hours":1},"power_cycle_count":0,"temperature":{"current":31},"ata_smart_error_log":{"summary":{"revision":1,"count":0}},"ata_smart_self_test_log":{"standard":{"revision":1,"count":0}}}',
      vendor: 'ATA',
    },
    {
      bootable: true,
      drive_type: 'ODD',
      hctl: '0:0:1:0',
      id: '/dev/sr0',
      installation_eligibility: {
        not_eligible_reasons: [
          'Disk is removable',
          'Disk is too small (disk only has 1.0 GB, but 10 GB are required)',
          'Drive type is ODD, it must be one of HDD, SSD.',
        ],
      },
      is_installation_media: true,
      model: 'QEMU_DVD-ROM',
      name: 'sr0',
      path: '/dev/sr0',
      removable: true,
      serial: 'QM00002',
      size_bytes: 1034944512,
      smart:
        '{"json_format_version":[1,0],"smartctl":{"version":[7,1],"svn_revision":"5049","platform_info":"x86_64-linux-4.18.0-305.19.1.el8_4.x86_64","build_info":"(local build)","argv":["smartctl","--all","--json=c","/dev/sr0"],"exit_status":4},"device":{"name":"/dev/sr0","info_name":"/dev/sr0","type":"scsi","protocol":"SCSI"},"vendor":"QEMU","product":"QEMU DVD-ROM","model_name":"QEMU QEMU DVD-ROM","revision":"2.5+","scsi_version":"SPC-3","device_type":{"scsi_value":5,"name":"CD/DVD"},"local_time":{"time_t":1650381380,"asctime":"Tue Apr 19 15:16:20 2022 UTC"},"temperature":{"current":0,"drive_trip":0}}',
      vendor: 'QEMU',
    },
  ],
  gpus: [
    {
      address: '0000:00:02.0',
    },
  ],
  hostname: name,
  interfaces: [
    {
      flags: ['up', 'broadcast', 'multicast'],
      has_carrier: true,
      ipv4_addresses: ['192.168.122.5/24'],
      ipv6_addresses: [],
      mac_address: '52:54:00:18:c1:e7',
      mtu: 1500,
      name: 'ens3',
      product: '0x100e',
      speed_mbps: 1000,
      vendor: '0x8086',
    },
  ],
  memory: {
    physical_bytes: 35651584000,
    physical_bytes_method: 'dmidecode',
    usable_bytes: 34984595456,
  },
  routes: [
    {
      destination: '0.0.0.0',
      family: 2,
      gateway: '192.168.122.1',
      interface: 'ens3',
    },
    {
      destination: '10.88.0.0',
      family: 2,
      interface: 'cni-podman0',
    },
    {
      destination: '192.168.122.0',
      family: 2,
      interface: 'ens3',
    },
    {
      destination: '::1',
      family: 10,
      interface: 'lo',
    },
    {
      destination: 'fe80::',
      family: 10,
      interface: 'ens3',
    },
    {
      destination: 'fe80::',
      family: 10,
      interface: 'cni-podman0',
    },
  ],
  system_vendor: {
    manufacturer: 'Red Hat',
    product_name: 'KVM',
    virtual: true,
  },
  timestamp: 1650381380,
  tpm_version: 'none',
});

export { getHostInventory, inventoryCpu };
