You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Additional query filters, parallel queries and changelog query added
- region_name, tenant and tag properties added to the query filter
- device_site, device_region and device_tags properties added to the version output
- use_changelog option added
- parallel_queries option added
- initial_lookback parameter added
- golang version updated to 1.25.7
Copy file name to clipboardExpand all lines: README.md
+52-4Lines changed: 52 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,8 +6,8 @@ A concourse resource to trigger from netbox
6
6
This resource is built using a Dockerfile that uses a multi-stage build process. The first stage builds the Go application, and the second stage creates a minimal container image using distroless. The following optional build arguments are available:
7
7
8
8
-`BUILDER_NAME`: The name of the Go builder image (default: `golang`)
9
-
-`BUILDER_VERSION`: The version of the Go builder image (default: `1.24.4-bookworm`)
10
-
-`BASE_NAME`: The base image for the final container (default: `gcr.io/distroless/static-debian12`)
9
+
-`BUILDER_VERSION`: The version of the Go builder image (default: `1.25.0-bookworm`)
10
+
-`BASE_NAME`: The base image for the final container (default: `gcr.io/distroless/static-debian13`)
11
11
-`BASE_VERSION`: The version of the base image (default: `latest`) (`nonroot` is not possible because Concourse [requires root permissions to run the resource](https://github.com/concourse/concourse/issues/403))
12
12
13
13
The following build arguments are mandatory:
@@ -32,7 +32,50 @@ This resource is designed to be used in a Concourse CI pipeline. It can be confi
32
32
33
33
### Configuration
34
34
35
-
The `source.url` parameter is mandatory. All fields in the `source.filter` section and the `source.token` are optional. Fields with brackets `[]` can contain multiple values. `source.filter.device_name` and `source.filter.interface_name` are using a `case-insensitive contains` filter. The `source.filter.get_config_context` parameter can be set to `true` to include the device's config context in the output. Because of the current limitation in the go-netbox library the config context is gathered with every query, but only included in the output if this parameter is set to `true`.
35
+
#### Source Parameters
36
+
37
+
| Parameter | Default | Description |
38
+
|-----------|---------|-------------|
39
+
|`url`|*(none)*| The URL of the NetBox instance (mandatory) |
40
+
|`token`|*(none)*| The API token for authentication |
41
+
|`parallel_queries`|`1`| Number of parallel queries to NetBox. Can speed up the check process, but be careful not to overload your NetBox instance |
42
+
|`use_changelog`|`false`| Use the NetBox changelog to determine which devices have interface changes. More efficient than querying all devices, but it may miss changes without a changelog entry |
43
+
|`initial_lookback`|*(epoch 0)*| Initial lookback timeframe for the first check (when no version exists) using Go duration format (e.g., `168h` for 7 days, `720h30m` for 30 days 30 minutes, `8760h` for 1 year). Supports: `h` (hours), `m` (minutes), `s` (seconds), and combinations like `1h30m45s`. If not specified, defaults to Unix epoch (1970-01-01) returning all matching objects |
44
+
45
+
> **Warning:** When `use_changelog` is enabled with filters like `tenant`, `site_name`, or `region_name`, performance may be significantly slower than the classic query. The changelog API fetches all change events globally and filters afterward, while the classic query applies filters directly at the API level. Use `use_changelog: false` (default) for better performance when filtering by tenant or other device attributes.
46
+
47
+
#### Filter Parameters
48
+
49
+
All filter parameters are optional and can be used in combination to narrow down the devices and interfaces that trigger the resource. If no filters are provided, all devices and their interfaces will be considered.
50
+
51
+
| Parameter | Default | Description |
52
+
|-----------|---------|-------------|
53
+
|`filter.site_name`|`[]`| Filter devices by site name(s) |
54
+
|`filter.region_name`|`[]`| Filter devices by region name(s) |
55
+
|`filter.tenant`|`[]`| Filter devices by tenant slug(s) (e.g., `my-tenant`) |
56
+
|`filter.tag`|`[]`| Filter devices by tag slug(s) |
57
+
|`filter.role`|`[]`| Filter devices by role slug(s) |
58
+
|`filter.device_id`|`[]`| Filter devices by device ID(s) |
59
+
|`filter.device_name`|`[]`| Filter devices by name (case-insensitive contains) |
60
+
|`filter.device_type`|`[]`| Filter devices by device type(s) |
61
+
|`filter.device_status`|`[]`| Filter devices by status (e.g., `active`, `planned`) |
62
+
|`filter.get_config_context`|`false`| Include the device's config context in the output |
63
+
64
+
#### Server Interface Filter Parameters
65
+
66
+
Additional filters can be applied to the server interfaces of the devices. These filters will be applied after filtering the devices, so they will only affect the interfaces of the already filtered devices.
67
+
68
+
| Parameter | Default | Description |
69
+
|-----------|---------|-------------|
70
+
|`filter.server_interface.interface_id`|`[]`| Filter interfaces by interface ID(s) |
71
+
|`filter.server_interface.interface_name`|`[]`| Filter interfaces by name (case-insensitive contains) |
72
+
|`filter.server_interface.enabled`|*(none)*| Filter interfaces by enabled state |
73
+
|`filter.server_interface.mgmt_only`|*(none)*| Filter interfaces by management-only flag |
74
+
|`filter.server_interface.connected`|*(none)*| Filter interfaces by connected state |
75
+
|`filter.server_interface.cabled`|*(none)*| Filter interfaces by cabled state |
76
+
|`filter.server_interface.type`|`[]`| Filter interfaces by type(s) (e.g., `virtual`, `1000base-t`) |
77
+
78
+
#### Example Configuration
36
79
37
80
This is an example of how to configure the resource in a Concourse pipeline:
0 commit comments