-
Notifications
You must be signed in to change notification settings - Fork 48
[Interface] Implement IGMP Version Support in Terraform Provider #322
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
ChristopherJHart
wants to merge
5
commits into
CiscoDevNet:main
from
ChristopherJHart:feat/add-ip-igmp-version
Closed
Changes from 1 commit
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
1d547cb
feat: add IP IGMP version configuration for interfaces
ChristopherJHart 85299cc
Merge branch 'main' into feat/add-ip-igmp-version
ChristopherJHart 3d727a1
refactor(igmp): limit enumerable interface values per feedback, restr…
ChristopherJHart aaa46e6
refactor(igmp): re-generate code after limiting interface enumerable …
ChristopherJHart 57a13c0
Merge branch 'main' into feat/add-ip-igmp-version
ChristopherJHart File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| --- | ||
| # generated by https://github.com/hashicorp/terraform-plugin-docs | ||
| page_title: "iosxe_interface_igmp Data Source - terraform-provider-iosxe" | ||
| subcategory: "Multicast" | ||
| description: |- | ||
| This data source can read the Interface IGMP configuration. | ||
| --- | ||
|
|
||
| # iosxe_interface_igmp (Data Source) | ||
|
|
||
| This data source can read the Interface IGMP configuration. | ||
|
|
||
| ## Example Usage | ||
|
|
||
| ```terraform | ||
| data "iosxe_interface_igmp" "example" { | ||
| type = "Loopback" | ||
| name = "100" | ||
| } | ||
| ``` | ||
|
|
||
| <!-- schema generated by tfplugindocs --> | ||
| ## Schema | ||
|
|
||
| ### Required | ||
|
|
||
| - `name` (String) | ||
| - `type` (String) Interface type | ||
|
|
||
| ### Optional | ||
|
|
||
| - `device` (String) A device name from the provider configuration. | ||
|
|
||
| ### Read-Only | ||
|
|
||
| - `id` (String) The path of the retrieved object. | ||
| - `version` (Number) IGMP version |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| --- | ||
| # generated by https://github.com/hashicorp/terraform-plugin-docs | ||
| page_title: "iosxe_interface_igmp Resource - terraform-provider-iosxe" | ||
| subcategory: "Multicast" | ||
| description: |- | ||
| This resource can manage the Interface IGMP configuration. | ||
| --- | ||
|
|
||
| # iosxe_interface_igmp (Resource) | ||
|
|
||
| This resource can manage the Interface IGMP configuration. | ||
|
|
||
| ## Example Usage | ||
|
|
||
| ```terraform | ||
| resource "iosxe_interface_igmp" "example" { | ||
| type = "Loopback" | ||
| name = "100" | ||
| version = 3 | ||
| } | ||
| ``` | ||
|
|
||
| <!-- schema generated by tfplugindocs --> | ||
| ## Schema | ||
|
|
||
| ### Required | ||
|
|
||
| - `name` (String) | ||
| - `type` (String) Interface type | ||
| - Choices: `FastEthernet`, `GigabitEthernet`, `TwoGigabitEthernet`, `FiveGigabitEthernet`, `TenGigabitEthernet`, `TwentyFiveGigE`, `FortyGigabitEthernet`, `HundredGigE`, `AppGigabitEthernet`, `Loopback`, `Vlan`, `Port-channel`, `Port-channel-subinterface/Port-channel`, `Tunnel`, `Virtual-Template`, `VirtualPortGroup`, `Vif`, `Multilink`, `Cellular`, `BDI` | ||
|
|
||
| ### Optional | ||
|
|
||
| - `device` (String) A device name from the provider configuration. | ||
| - `version` (Number) IGMP version | ||
| - Range: `1`-`3` | ||
| - Default value: `2` | ||
|
|
||
| ### Read-Only | ||
|
|
||
| - `id` (String) The path of the object. | ||
|
|
||
| ## Import | ||
|
|
||
| Import is supported using the following syntax: | ||
|
|
||
| The [`terraform import` command](https://developer.hashicorp.com/terraform/cli/commands/import) can be used, for example: | ||
|
|
||
| ```shell | ||
| terraform import iosxe_interface_igmp.example "<type>,<name>" | ||
| ``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| data "iosxe_interface_igmp" "example" { | ||
| type = "Loopback" | ||
| name = "100" | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| terraform import iosxe_interface_igmp.example "<type>,<name>" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| resource "iosxe_interface_igmp" "example" { | ||
| type = "Loopback" | ||
| name = "100" | ||
| version = 3 | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| --- | ||
| name: Interface IGMP | ||
| path: Cisco-IOS-XE-native:native/interface/%s=%v/ip/Cisco-IOS-XE-igmp:igmp | ||
| augment_path: Cisco-IOS-XE-native:native/interface/GigabitEthernet=%v/ip/Cisco-IOS-XE-igmp:igmp | ||
| no_delete: true | ||
| doc_category: Multicast | ||
| attributes: | ||
| - yang_name: type | ||
| tf_name: type | ||
| description: Interface type | ||
| type: String | ||
| reference: true | ||
| enum_values: | ||
ChristopherJHart marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| - FastEthernet | ||
| - GigabitEthernet | ||
| - TwoGigabitEthernet | ||
| - FiveGigabitEthernet | ||
| - TenGigabitEthernet | ||
| - TwentyFiveGigE | ||
| - FortyGigabitEthernet | ||
| - HundredGigE | ||
| - AppGigabitEthernet | ||
| - Loopback | ||
| - Vlan | ||
| - Port-channel | ||
| - Port-channel-subinterface/Port-channel | ||
| - Tunnel | ||
| - Virtual-Template | ||
| - VirtualPortGroup | ||
| - Vif | ||
| - Multilink | ||
| - Cellular | ||
| - BDI | ||
| example: Loopback | ||
| - yang_name: name | ||
| example: 100 | ||
| - yang_name: version | ||
| description: IGMP version | ||
| default_value: 2 | ||
| example: 3 | ||
|
|
||
| test_prerequisites: | ||
| - path: Cisco-IOS-XE-native:native/interface/Loopback=100 | ||
| attributes: | ||
| - name: name | ||
| value: 100 | ||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
83 changes: 83 additions & 0 deletions
83
internal/provider/data_source_iosxe_interface_igmp_test.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we expect a lot more attributes to be added here in the future? Otherwise it might not be worth creating a new resource and instead just add the version attribute to the existing
iosxe_interface_*resources and data sources.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would say that yes, there's quite a few more interface-specific IGMP attributes that could be added in the future. Judging by the CLI options alone:
In my opinion deriving from experience, there's quite a few of these options that are relatively popular and would likely be implemented into the provider eventually.