Skip to content

Commit

Permalink
Adds new -type and -uplink flags to register command (#61)
Browse files Browse the repository at this point in the history
This allows Autojoin clients to specify these v2.Registration fields and pass
them to the Autojoin API as part of the registration process.
  • Loading branch information
nkinkade authored Nov 28, 2024
1 parent 1928e10 commit 380ac06
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cmd/register/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ var (
iata = flagx.StringFile{}
ipv4 = flagx.StringFile{}
ipv6 = flagx.StringFile{}
machineType = flag.String("type", "", "The type of machine: physical or virtual")
uplink = flag.String("uplink", "", "The speed of the uplink e.g., 1g, 10g, etc.")
interval = flag.Duration("interval.expected", 1*time.Hour, "Expected registration interval")
intervalMin = flag.Duration("interval.min", 55*time.Minute, "Minimum registration interval")
intervalMax = flag.Duration("interval.max", 65*time.Minute, "Maximum registration interval")
Expand Down Expand Up @@ -127,6 +129,8 @@ func register() {
q.Add("iata", iata.Value)
q.Add("ipv4", ipv4.Value)
q.Add("ipv6", ipv6.Value)
q.Add("type", *machineType)
q.Add("uplink", *uplink)
q.Add("probability", siteProb.Value)
for _, port := range ports {
q.Add("ports", port)
Expand Down

0 comments on commit 380ac06

Please sign in to comment.