github.com/ferranbt/nomad@v0.9.3-0.20190607002617-85c449b7667c/plugins/device/cmd/example/README.md (about)

     1  This package provides an example implementation of a device plugin for
     2  reference.
     3  
     4  # Behavior
     5  
     6  The example device plugin models files within a specified directory as devices. The plugin will periodically scan the directory for changes and will expose them via the streaming Fingerprint RPC. Device health is set to unhealthy if the file has a specific filemode permission as described by the config `unhealthy_perm`. Further statistics are also collected on the detected devices.
     7  
     8  # Config
     9  
    10  The configuration should be passed via an HCL file that begins with a top level `config` stanza:
    11  
    12  ```
    13  config {
    14    dir = "/my/path/to/scan"
    15    list_period = "1s"
    16    unhealthy_perm = "-rw-rw-rw-"
    17  }
    18  ```
    19  
    20  The valid configuration options are:
    21  
    22  * `dir` (`string`: `"."`): The directory to scan for files that will represent fake devices.
    23  * `list_period` (`string`: `"5s"`): The interval to scan the directory for changes.
    24  * `unhealthy_perm` (`string`: `"-rwxrwxrwx"`): The file mode permission that if set on a detected file will casue the device to be considered unhealthy.