Skip to content

Commit

Permalink
Add snmp communities
Browse files Browse the repository at this point in the history
  • Loading branch information
danischm committed Sep 13, 2023
1 parent 54d1cba commit aa1b170
Show file tree
Hide file tree
Showing 12 changed files with 542 additions and 98 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
- Add support for leaf-lists to `iosxr_gnmi` resource
- Add `port` and `operator` attributes to `iosxr_logging_vrf` resource and data source
- Add `iosxr_router_hsrp_interface_address_family_ipv6_group_v2` resource and data source
- Add `route_reflector_client` to `iosxr_router_bgp_neighbor_address_family` and `iosxr_router_bgp_neighbor_group` resource and data source
- Add `route_reflector_client` attribute to `iosxr_router_bgp_neighbor_address_family` and `iosxr_router_bgp_neighbor_group` resource and data source
- Add `communities` attributes to `iosxr_snmp_server` resource and data source

## 0.2.5

Expand Down
16 changes: 16 additions & 0 deletions docs/data-sources/snmp_server.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ data "iosxr_snmp_server" "example" {
- `bgp_bgp4_mib_updown` (Boolean) Enable CISCO-BGP4-MIB v2 up/down traps
- `bgp_cbgp2_updown` (Boolean) Enable CISCO-BGP4-MIB v2 up/down traps
- `bridgemib` (Boolean) Enable SNMP Trap for Bridge MIB
- `communities` (Attributes List) The UNENCRYPTED (cleartext) community string (see [below for nested schema](#nestedatt--communities))
- `config` (Boolean) Enable SNMP config traps
- `contact` (String) Text for mib Object sysContact
- `copy_complete` (Boolean) Enable CISCO-CONFIG-COPY-MIB ccCopyCompletion traps
Expand Down Expand Up @@ -73,6 +74,21 @@ data "iosxr_snmp_server" "example" {
- `traps_snmp_linkup` (Boolean) Enable SNMPv2-MIB linkUp traps
- `users` (Attributes List) Name of the user (see [below for nested schema](#nestedatt--users))

<a id="nestedatt--communities"></a>
### Nested Schema for `communities`

Read-Only:

- `community` (String) The UNENCRYPTED (cleartext) community string
- `ipv4` (String) Type of Access-list
- `ipv6` (String) Type of Access-list
- `ro` (Boolean) Read-only community
- `rw` (Boolean) Read-write community
- `sdrowner` (Boolean) SDR Owner permissions for MIB Objects
- `systemowner` (Boolean) System Owner permissions for MIB objects
- `view` (String) Restrict this community to a named view


<a id="nestedatt--groups"></a>
### Nested Schema for `groups`

Expand Down
3 changes: 2 additions & 1 deletion docs/guides/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ description: |-
- Add support for leaf-lists to `iosxr_gnmi` resource
- Add `port` and `operator` attributes to `iosxr_logging_vrf` resource and data source
- Add `iosxr_router_hsrp_interface_address_family_ipv6_group_v2` resource and data source
- Add `route_reflector_client` to `iosxr_router_bgp_neighbor_address_family` and `iosxr_router_bgp_neighbor_group` resource and data source
- Add `route_reflector_client` attribute to `iosxr_router_bgp_neighbor_address_family` and `iosxr_router_bgp_neighbor_group` resource and data source
- Add `communities` attributes to `iosxr_snmp_server` resource and data source

## 0.2.5

Expand Down
31 changes: 31 additions & 0 deletions docs/resources/snmp_server.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,18 @@ resource "iosxr_snmp_server" "example" {
v3_ipv6 = "ACL2"
}
]
communities = [
{
community = "COMMUNITY1"
view = "VIEW1"
ro = true
rw = false
sdrowner = false
systemowner = true
ipv4 = "ACL1"
ipv6 = "ACL2"
}
]
}
```

Expand All @@ -70,6 +82,7 @@ resource "iosxr_snmp_server" "example" {
- `bgp_bgp4_mib_updown` (Boolean) Enable CISCO-BGP4-MIB v2 up/down traps
- `bgp_cbgp2_updown` (Boolean) Enable CISCO-BGP4-MIB v2 up/down traps
- `bridgemib` (Boolean) Enable SNMP Trap for Bridge MIB
- `communities` (Attributes List) The UNENCRYPTED (cleartext) community string (see [below for nested schema](#nestedatt--communities))
- `config` (Boolean) Enable SNMP config traps
- `contact` (String) Text for mib Object sysContact
- `copy_complete` (Boolean) Enable CISCO-CONFIG-COPY-MIB ccCopyCompletion traps
Expand Down Expand Up @@ -157,6 +170,24 @@ resource "iosxr_snmp_server" "example" {

- `id` (String) The path of the object.

<a id="nestedatt--communities"></a>
### Nested Schema for `communities`

Required:

- `community` (String) The UNENCRYPTED (cleartext) community string

Optional:

- `ipv4` (String) Type of Access-list
- `ipv6` (String) Type of Access-list
- `ro` (Boolean) Read-only community
- `rw` (Boolean) Read-write community
- `sdrowner` (Boolean) SDR Owner permissions for MIB Objects
- `systemowner` (Boolean) System Owner permissions for MIB objects
- `view` (String) Restrict this community to a named view


<a id="nestedatt--groups"></a>
### Nested Schema for `groups`

Expand Down
12 changes: 12 additions & 0 deletions examples/resources/iosxr_snmp_server/resource.tf
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,16 @@ resource "iosxr_snmp_server" "example" {
v3_ipv6 = "ACL2"
}
]
communities = [
{
community = "COMMUNITY1"
view = "VIEW1"
ro = true
rw = false
sdrowner = false
systemowner = true
ipv4 = "ACL1"
ipv6 = "ACL2"
}
]
}
22 changes: 22 additions & 0 deletions gen/definitions/snmp_server.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -161,3 +161,25 @@ attributes:
example: ACL1
- yang_name: v3/ipv6
example: ACL2
- yang_name: community/unencrypted/unencrypted-string
tf_name: communities
type: List
attributes:
- yang_name: community-string
tf_name: community
id: true
example: COMMUNITY1
- yang_name: view
example: VIEW1
- yang_name: ro
example: true
- yang_name: rw
example: false
- yang_name: sdrowner
example: false
- yang_name: systemowner
example: true
- yang_name: ipv4
example: ACL1
- yang_name: ipv6
example: ACL2
40 changes: 40 additions & 0 deletions internal/provider/data_source_iosxr_snmp_server.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 18 additions & 0 deletions internal/provider/data_source_iosxr_snmp_server_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit aa1b170

Please sign in to comment.