From 32497734221f529846415ad34c1979fed8e98c5c Mon Sep 17 00:00:00 2001 From: Mike Crute Date: Sat, 21 May 2022 19:31:43 -0700 Subject: echo: add netbox-based IP filter --- echo/netbox/model.go | 74 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 echo/netbox/model.go (limited to 'echo/netbox/model.go') diff --git a/echo/netbox/model.go b/echo/netbox/model.go new file mode 100644 index 0000000..78f2ca6 --- /dev/null +++ b/echo/netbox/model.go @@ -0,0 +1,74 @@ +package netbox + +type LabeledInt struct { + Value int `json:"value"` + Label string `json:"label"` +} + +type LabeledString struct { + Value string `json:"value"` + Label string `json:"label"` +} + +type Role struct { + ID int `json:"ID"` + Url string `json:"url"` + Display string `json:"display"` + Name string `json:"name"` + Slug string `json:"slub"` +} + +type Tag struct { + ID int `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + Name string `json:"name"` + Slug string `json:"slug"` + Color string `json:"color"` +} + +type SiteList struct { + Count int `json:"count"` + Next string `json:"next"` + Previous string `json:"previous"` + Results []*Site `json:"results"` +} + +type Site struct { + ID int `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + Name string `json:"name"` + Slug string `json:"slug"` + Facility string `json:"facility"` + Description string `json:"description"` + Timezone string `json:"time_zone"` + ASN int `json:"asn"` + Status LabeledString `json:"status"` +} + +type PrefixList struct { + Count int `json:"count"` + Next string `json:"next"` + Previous string `json:"previous"` + Results []*Prefix `json:"results"` +} + +type Prefix struct { + ID int `json:"ID"` + Url string `json:"url"` + Display string `json:"display"` + Prefix string `json:"prefix"` + IsPool bool `json:"is_pool"` + Description string `json:"description"` + Created string `json:"created"` + LastUpdated string `json:"last_updated"` + Children int `json:"children"` + Depth int `json:"_depth"` + Family LabeledInt `json:"family"` + Status LabeledString `json:"status"` + Site *Site `json:"site"` + Role *Role `json:"role"` + Tags []*Tag `json:"tags"` + CustomFields map[string]interface{} `json:"custom_fields"` +} -- cgit v1.2.3