Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Node name templates #175

Merged
merged 16 commits into from Apr 29, 2020
Merged

Conversation

justparking
Copy link
Contributor

This allows for dynamic node naming using conventional dollar-sign substitution (i.e. $NAME or ${NAME WITH SYMBOLS}) with several useful resolution techniques.

By example, the first node created could be:
Nodel Recipes Sync for $HOSTNAME ${http port} (${os.name}, ${mac})

This would expand out to be:
Nodel Recipes Sync for MYCOMPUTER 8085 (Windows 10, fc:f8:ae:3e:5f:17)

I envisage name templates to be quite convenient when used with Computer and Application nodes.

Resolution steps in order tried:

  1. if the node's signal/event is present¹, use its value (e.g. extracted device serial numbers could be used)
  2. hostname¹ returns the hostname as provided by the environment²
  3. IP, IP Address or IP Addresses (¹) return the IP addresses of bound interfaces
  4. MAC, MAC Address or MAC Addresses (¹) return the MAC addresses² of bound interfaces
  5. HTTP Port¹ returns the HTTP port of the Nodel host
  6. Version¹ returns the version of the Nodel host
  7. Hosting Rule¹ returns the hosting rule(s) of the Nodel host
  8. try against Nodel Diagnostics values (case insensitive, see link)
  9. try against system environment variables³ (see link)
  10. try against Java platform system properties⁴ (see link)

    ¹ case-and-symbol insensitive
    ² result is case matched according to name, e.g. MAC returns AA:BB:.., mac returns aa:bb...
    ³ on Windows, lookup is case-insensitive. Others likely case-sensitive.
    ⁴ likely case-sensitive

@justparking justparking added enhancement feature request proposal A feature or update proposal where feedback is sought. labels Apr 24, 2020
@justparking justparking requested a review from scroix April 24, 2020 04:32
@justparking justparking self-assigned this Apr 24, 2020
@justparking
Copy link
Contributor Author

@justparking justparking merged commit cd1de6c into museumsvictoria:master Apr 29, 2020
@scroix
Copy link
Member

scroix commented May 1, 2020

I missed this review before you submitted, sorry.

But I tried it out this morning and I only had a mild success.

These are based off your above example.
Nodel Recipes Sync for $HOSTNAME ${http port} (${os.name}, ${mac})

no-luck

Windows 10 1909
feat_nameTemplates-2.2.1-rev425

@justparking justparking deleted the feat_nameTemplates branch April 6, 2021 03:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement feature request proposal A feature or update proposal where feedback is sought.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants