This repository was archived by the owner on Dec 24, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Initial reference implementation #14
Draft
cilki
wants to merge
4
commits into
oshi:master
Choose a base branch
from
cilki:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from 1 commit
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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": [ | ||
| "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" | ||
| ] | ||
| } | ||
| ] | ||
| } | ||
| ] | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have an
extensionfield 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
incompatiblefield 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
WindowsXPclasses for example (which would be a nightmare).There was a problem hiding this comment.
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.