Skip to content

Commit aa1b170

Browse files
committed
Add snmp communities
1 parent 54d1cba commit aa1b170

File tree

12 files changed

+542
-98
lines changed

12 files changed

+542
-98
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
- Add support for leaf-lists to `iosxr_gnmi` resource
55
- Add `port` and `operator` attributes to `iosxr_logging_vrf` resource and data source
66
- Add `iosxr_router_hsrp_interface_address_family_ipv6_group_v2` resource and data source
7-
- Add `route_reflector_client` to `iosxr_router_bgp_neighbor_address_family` and `iosxr_router_bgp_neighbor_group` resource and data source
7+
- Add `route_reflector_client` attribute to `iosxr_router_bgp_neighbor_address_family` and `iosxr_router_bgp_neighbor_group` resource and data source
8+
- Add `communities` attributes to `iosxr_snmp_server` resource and data source
89

910
## 0.2.5
1011

docs/data-sources/snmp_server.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ data "iosxr_snmp_server" "example" {
3030
- `bgp_bgp4_mib_updown` (Boolean) Enable CISCO-BGP4-MIB v2 up/down traps
3131
- `bgp_cbgp2_updown` (Boolean) Enable CISCO-BGP4-MIB v2 up/down traps
3232
- `bridgemib` (Boolean) Enable SNMP Trap for Bridge MIB
33+
- `communities` (Attributes List) The UNENCRYPTED (cleartext) community string (see [below for nested schema](#nestedatt--communities))
3334
- `config` (Boolean) Enable SNMP config traps
3435
- `contact` (String) Text for mib Object sysContact
3536
- `copy_complete` (Boolean) Enable CISCO-CONFIG-COPY-MIB ccCopyCompletion traps
@@ -73,6 +74,21 @@ data "iosxr_snmp_server" "example" {
7374
- `traps_snmp_linkup` (Boolean) Enable SNMPv2-MIB linkUp traps
7475
- `users` (Attributes List) Name of the user (see [below for nested schema](#nestedatt--users))
7576

77+
<a id="nestedatt--communities"></a>
78+
### Nested Schema for `communities`
79+
80+
Read-Only:
81+
82+
- `community` (String) The UNENCRYPTED (cleartext) community string
83+
- `ipv4` (String) Type of Access-list
84+
- `ipv6` (String) Type of Access-list
85+
- `ro` (Boolean) Read-only community
86+
- `rw` (Boolean) Read-write community
87+
- `sdrowner` (Boolean) SDR Owner permissions for MIB Objects
88+
- `systemowner` (Boolean) System Owner permissions for MIB objects
89+
- `view` (String) Restrict this community to a named view
90+
91+
7692
<a id="nestedatt--groups"></a>
7793
### Nested Schema for `groups`
7894

docs/guides/changelog.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ description: |-
1313
- Add support for leaf-lists to `iosxr_gnmi` resource
1414
- Add `port` and `operator` attributes to `iosxr_logging_vrf` resource and data source
1515
- Add `iosxr_router_hsrp_interface_address_family_ipv6_group_v2` resource and data source
16-
- Add `route_reflector_client` to `iosxr_router_bgp_neighbor_address_family` and `iosxr_router_bgp_neighbor_group` resource and data source
16+
- Add `route_reflector_client` attribute to `iosxr_router_bgp_neighbor_address_family` and `iosxr_router_bgp_neighbor_group` resource and data source
17+
- Add `communities` attributes to `iosxr_snmp_server` resource and data source
1718

1819
## 0.2.5
1920

docs/resources/snmp_server.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,18 @@ resource "iosxr_snmp_server" "example" {
5858
v3_ipv6 = "ACL2"
5959
}
6060
]
61+
communities = [
62+
{
63+
community = "COMMUNITY1"
64+
view = "VIEW1"
65+
ro = true
66+
rw = false
67+
sdrowner = false
68+
systemowner = true
69+
ipv4 = "ACL1"
70+
ipv6 = "ACL2"
71+
}
72+
]
6173
}
6274
```
6375

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

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

173+
<a id="nestedatt--communities"></a>
174+
### Nested Schema for `communities`
175+
176+
Required:
177+
178+
- `community` (String) The UNENCRYPTED (cleartext) community string
179+
180+
Optional:
181+
182+
- `ipv4` (String) Type of Access-list
183+
- `ipv6` (String) Type of Access-list
184+
- `ro` (Boolean) Read-only community
185+
- `rw` (Boolean) Read-write community
186+
- `sdrowner` (Boolean) SDR Owner permissions for MIB Objects
187+
- `systemowner` (Boolean) System Owner permissions for MIB objects
188+
- `view` (String) Restrict this community to a named view
189+
190+
160191
<a id="nestedatt--groups"></a>
161192
### Nested Schema for `groups`
162193

examples/resources/iosxr_snmp_server/resource.tf

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,16 @@ resource "iosxr_snmp_server" "example" {
4343
v3_ipv6 = "ACL2"
4444
}
4545
]
46+
communities = [
47+
{
48+
community = "COMMUNITY1"
49+
view = "VIEW1"
50+
ro = true
51+
rw = false
52+
sdrowner = false
53+
systemowner = true
54+
ipv4 = "ACL1"
55+
ipv6 = "ACL2"
56+
}
57+
]
4658
}

gen/definitions/snmp_server.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,3 +161,25 @@ attributes:
161161
example: ACL1
162162
- yang_name: v3/ipv6
163163
example: ACL2
164+
- yang_name: community/unencrypted/unencrypted-string
165+
tf_name: communities
166+
type: List
167+
attributes:
168+
- yang_name: community-string
169+
tf_name: community
170+
id: true
171+
example: COMMUNITY1
172+
- yang_name: view
173+
example: VIEW1
174+
- yang_name: ro
175+
example: true
176+
- yang_name: rw
177+
example: false
178+
- yang_name: sdrowner
179+
example: false
180+
- yang_name: systemowner
181+
example: true
182+
- yang_name: ipv4
183+
example: ACL1
184+
- yang_name: ipv6
185+
example: ACL2

internal/provider/data_source_iosxr_snmp_server.go

Lines changed: 40 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

internal/provider/data_source_iosxr_snmp_server_test.go

Lines changed: 18 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)