Skip to content
This repository was archived by the owner on Dec 24, 2023. It is now read-only.
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
925 changes: 925 additions & 0 deletions reference/definitions-full.json

Large diffs are not rendered by default.

396 changes: 396 additions & 0 deletions reference/definitions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,396 @@
[
{
"name": "hardware.Nic",
"root": true,
"desc": "A network interface",
"attributes": [
{
"name": "name",
"type": "String",
"constant": true,
"desc": "The interface's name"
},
{
"name": "description",
"type": "String",
"constant": true,
"desc": "The interface's description"
},
{
"name": "mtu",
"type": "Integer",
"desc": "The maximum transmission unit"
},
{
"name": "mac",
"type": "String",
"desc": null
},
{
"name": "virtual",
"type": "Boolean",
"desc": null
},
{
"name": "ipv4",
"type": "String[]",
"desc": "The interface's IPv4 addresses"
},
{
"name": "ipv6",
"type": "String[]",
"desc": "The interface's IPv6 addresses"
},
{
"name": "broadcast",
"type": "String",
"desc": null
},
{
"name": "netmask",
"type": "String",
"desc": "The interface's subnet mask"
},
{
"name": "read_bytes",
"type": "Long",
"desc": "The number of bytes read from the interface"
},
{
"name": "write_bytes",
"type": "Long",
"desc": "The number of bytes written to the interface"
},
{
"name": "read_packets",
"type": "Long",
"desc": "The number of packets read from the interface"
},
{
"name": "write_packets",
"type": "Long",
"desc": "The number of packets written to the interface"
},
{
"name": "read_errors",
"type": "Long",
"desc": "The number of read errors"
},
{
"name": "write_errors",
"type": "Long",
"desc": "The number of write errors"
},
{
"name": "read_drops",
"type": "Long",
"desc": "The number of read drops"
},
{
"name": "write_drops",
"type": "Long",
"desc": "The number of write drops"
},
{
"name": "write_collisions",
"type": "Long",
"desc": "The number of write collisions"
},
{
"name": "link_speed",
"type": "Long",
"desc": "The interface's maximum speed in bytes"
},
{
"name": "default_gateway",
"type": "Boolean",
"desc": null
},
{
"name": "flag_up",
"type": "Boolean",
"desc": null
},
{
"name": "flag_running",
"type": "Boolean",
"desc": null
},
{
"name": "flag_loopback",
"type": "Boolean",
"desc": null
},
{
"name": "flag_multicast",
"type": "Boolean",
"desc": null
},
{
"name": "luid",
"type": "Long",
"desc": "The interface's locally unique identifier",
"compatible": [
"windows"
]
},
{
"name": "guid",
"type": "String",
"desc": "The interface's globally unique identifier",
"compatible": [
"windows"
]
},
{
"name": "paused",
"type": "Boolean",
"desc": "Whether the interface is in a paused state",
"compatible": [
"windows"
]
},
{
"name": "lowPower",
"type": "Boolean",
"desc": "Whether the interface is in a low-power state",
"compatible": [
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need a finer grain measure of compatibility, even within operating systems. For example, the "Up Time" counter on early versions of Windows is 32-bit and rolls over at ~49 days. Other attributes are only possible with add-on extensions or elevated permissions, etc.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have an extension field that encodes an attribute's requirement of external add-ons, but I don't do anything with it in the drivers yet.

I removed permissions requirements from the spec because it's an implementation detail and makes more sense to declare it as an annotation on the method that requires permissions.

The problem with the incompatible field that we came up with in the initial YAML spec is that it pushes the attribute down into platform-specific territory. I'll add a follow up comment with a possible solution for this that I came up with.

As for the uptime example, you're saying that maybe the attribute should be compatible only on later Windows? I'm not sure how this could be done without arbitrating WindowsXP classes for example (which would be a nightmare).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's less a compatibility than a "document the results" thing. I'm just recalling there are many places in the Javadocs where I'm commenting about what you can and can't get on various OS's.

"windows"
]
}
]
},
{
"name": "hardware.Disk",
"root": true,
"desc": "A storage device",
"attributes": [
{
"name": "name",
"type": "String",
"constant": true,
"desc": null
},
{
"name": "model",
"type": "String",
"constant": true,
"desc": null
},
{
"name": "serial",
"type": "String",
"constant": true,
"desc": null
},
{
"name": "size",
"type": "Long",
"desc": "The disk's total size in bytes"
},
{
"name": "reads",
"type": "Long",
"desc": null
},
{
"name": "read_bytes",
"type": "Long",
"desc": null
},
{
"name": "writes",
"type": "Long",
"desc": null
},
{
"name": "write_bytes",
"type": "Long",
"desc": null
},
{
"name": "queue_length",
"type": "Long",
"desc": null
},
{
"name": "transfer_time",
"type": "Long",
"desc": null
},
{
"name": "model_family",
"type": "String",
"extension": "smartmontools",
"desc": null
},
{
"name": "firmware_version",
"type": "String",
"extension": "smartmontools",
"desc": null
},
{
"name": "rotation_rate",
"type": "Long",
"extension": "smartmontools",
"desc": null
},
{
"name": "read_error_rate",
"type": "Long",
"extension": "smartmontools",
"desc": null
},
{
"name": "spin_up_time",
"type": "Long",
"extension": "smartmontools",
"desc": null
},
{
"name": "start_stop_cycles",
"type": "Long",
"extension": "smartmontools",
"desc": null
},
{
"name": "reallocated_sectors",
"type": "Long",
"extension": "smartmontools",
"desc": null
},
{
"name": "seek_error_rate",
"type": "Long",
"extension": "smartmontools",
"desc": null
},
{
"name": "power_on_time",
"type": "Long",
"extension": "smartmontools",
"desc": null
},
{
"name": "spin_retries",
"type": "Long",
"extension": "smartmontools",
"desc": null
},
{
"name": "calibration_retries",
"type": "Long",
"extension": "smartmontools",
"desc": null
},
{
"name": "power_cycles",
"type": "Long",
"extension": "smartmontools",
"desc": null
},
{
"name": "poweroff_retracts",
"type": "Long",
"extension": "smartmontools",
"desc": null
},
{
"name": "load_cycles",
"type": "Long",
"extension": "smartmontools",
"desc": null
},
{
"name": "temperature",
"type": "Long",
"extension": "smartmontools",
"desc": null
},
{
"name": "reallocated_events",
"type": "Long",
"extension": "smartmontools",
"desc": null
},
{
"name": "current_pending_sector",
"type": "Long",
"extension": "smartmontools",
"desc": null
},
{
"name": "offline_uncorrectable",
"type": "Long",
"extension": "smartmontools",
"desc": null
},
{
"name": "crc_errors",
"type": "Long",
"extension": "smartmontools",
"desc": null
},
{
"name": "multizone_error_rate",
"type": "Long",
"extension": "smartmontools",
"desc": null
}
]
},
{
"name": "hardware.Firmware",
"root": true,
"singular": true,
"desc": "The system's firmware",
"attributes": [
{
"name": "name",
"type": "String",
"constant": true,
"desc": null
},
{
"name": "manufacturer",
"type": "String",
"constant": true,
"desc": "The BIOS manufacturer title"
},
{
"name": "description",
"type": "String",
"constant": true,
"desc": "The BIOS description"
},
{
"name": "version",
"type": "String",
"constant": true,
"desc": "The BIOS version number"
},
{
"name": "revision",
"type": "String",
"constant": true,
"desc": "The BIOS revision number"
},
{
"name": "release_date",
"type": "String",
"constant": true,
"desc": "The BIOS release date"
},
{
"name": "uefi",
"type": "Boolean",
"constant": true,
"desc": "Whether the BIOS supports UEFI mode",
"compatible": [
"linux"
]
}
]
}
]
Loading