Skip to content
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

Renamed networking folders. #288

Closed
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# 1.2.0 ()

BREAKING CHANGES:
* **Rename Resource:** `netapp-ontap_networking_ip_interface` is now renamed to `netapp-ontap_networking_ip_interfaces`
* **Rename Resource:** `netapp-ontap_networking_ip_route` is now renamed to `netapp-ontap_networking_ip_routes`

FEATURES:
* **provider**: add `aws_lambda` option. ([#262](https://github.com/NetApp/terraform-provider-netapp-ontap/issues/262))
* **New Data Source:** `netapp-ontap_volumes_files` ([#8](https://github.com/NetApp/terraform-provider-netapp-ontap/issues/8))
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "netapp-ontap_networking_ip_interface Data Source - terraform-provider-netapp-ontap"
page_title: "netapp-ontap_network_ip_interface Data Source - terraform-provider-netapp-ontap"
subcategory: "Networking"
description: |-
Retrieves the details of IP interface of SVMs.
Expand All @@ -12,7 +12,7 @@ Retrieves the details of IP interface of SVMs.

## Example Usage
```terraform
data "netapp-ontap_networking_ip_interface" "ip_interface" {
data "netapp-ontap_network_ip_interface" "ip_interface" {
# required to know which system to interface with
cx_profile_name = "cluster4"
name = "cluster_mgmt"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "netapp-ontap_netapp-ontap_networking_ip_interfaces Data Source - terraform-provider-netapp-ontap"
page_title: "netapp-ontap_netapp-ontap_network_ip_interfaces Data Source - terraform-provider-netapp-ontap"
subcategory: "Networking"
description: |-
Retrieves the details of IP interfaces of SVMs.
Expand All @@ -12,7 +12,7 @@ Retrieves the details of IP interfaces of SVMs.

## Example Usage
```terraform
data "netapp-ontap_networking_ip_interfaces" "ip_interfaces" {
data "netapp-ontap_network_ip_interfaces" "ip_interfaces" {
# required to know which system to interface with
cx_profile_name = "cluster4"
filter = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "netapp-ontap_networking_ip_route Data Source - terraform-provider-netapp-ontap"
page_title: "netapp-ontap_network_ip_route Data Source - terraform-provider-netapp-ontap"
subcategory: "Networking"
description: |-
Retrieves the IP route of SVMs.
Expand All @@ -12,7 +12,7 @@ Retrieves the IP route of SVMs.

## Example Usage
```terraform
data "netapp-ontap_networking_ip_route" "networking_ip_route" {
data "netapp-ontap_network_ip_route" "network_ip_route" {
# required to know which system to interface with
cx_profile_name = "cluster4"
destination = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "netapp-ontap_networking_ip_routes Data Source - terraform-provider-netapp-ontap"
page_title: "netapp-ontap_network_ip_routes Data Source - terraform-provider-netapp-ontap"
subcategory: "Networking"
description: |-
Retrieves the IP routes of SVMs.
Expand All @@ -12,7 +12,7 @@ Retrieves the IP routes of SVMs.

## Example Usage
```terraform
data "netapp-ontap_networking_ip_routes" "networking_ip_routes" {
data "netapp-ontap_network_ip_routes" "network_ip_routes" {
# required to know which system to interface with
cx_profile_name = "cluster4"
gateway = "10.10.10.254"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "ONTAP: IP Interface"
page_title: "ONTAP: IP Interfaces"
subcategory: "Networking"
description: |-
IPInterface resource
IPInterfaces resource
---

# Resource IP Interface
# Resource IP Interfaces

Create/Update/Delete an IPInterface resource
Create/Update/Delete network IP Interfaces resource

### Related ONTAP commands
```commandline
Expand All @@ -24,7 +24,7 @@ Create/Update/Delete an IPInterface resource
## Example Usage

```terraform
resource "netapp-ontap_networking_ip_interface" "example" {
resource "netapp-ontap_network_ip_interfaces" "example" {
cx_profile_name = "cluster4"
name = "test-interface"
svm_name = "carchi-test"
Expand Down Expand Up @@ -80,7 +80,7 @@ Import require a unique ID composed of the interface name, svm_name and cx_profi
### Terraform Import
For example
```shell
terraform import netapp-ontap_networking_ip_interface.example if1,svm1,cluster4
terraform import netapp-ontap_network_ip_interfaces.example if1,svm1,cluster4
```

!> The terraform import CLI command can only import resources into the state. Importing via the CLI does not generate configuration. If you want to generate the accompanying configuration for imported resources, use the import block instead.
wenjun666 marked this conversation as resolved.
Show resolved Hide resolved
Expand All @@ -91,7 +91,7 @@ This requires Terraform 1.5 or higher, and will auto create the configuration fo
First create the block
```terraform
import {
to = netapp-ontap_networking_ip_interface.if_import
to = netapp-ontap_network_ip_interfaces.if_import
id = "if1,svm1,cluster4"
}
```
Expand All @@ -104,7 +104,7 @@ This will generate a file called generated.tf, which will contain the configurat
# __generated__ by Terraform
# Please review these resources and move them into your main configuration files.
# __generated__ by Terraform from "if1,svm1,cluster4"
resource "netapp-ontap_networking_ip_interface" "if1_import" {
resource "netapp-ontap_network_ip_interfaces" "if1_import" {
cx_profile_name = "cluster4"
name = "if1"
svm_name = "svm1"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "ONTAP: IP Route"
page_title: "ONTAP: IP Routes"
subcategory: "Networking"
description: |-
Route resource
Routes resource
---

# Resource IP Route
# Resource IP Routes

Create/Delete an IP Route resource
Create/Delete network IP Routes resource

### Related ONTAP commands
```commandline
Expand All @@ -23,7 +23,7 @@ Create/Delete an IP Route resource
## Example Usage

```terraform
resource "netapp-ontap_networking_ip_route" "networking_ip_route" {
resource "netapp-ontap_network_ip_routes" "network_ip_route" {
# required to know which system to interface with
cx_profile_name = "cluster4"
svm_name = "ansibleSVM"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
data "netapp-ontap_networking_ip_interface" "ip_interface" {
data "netapp-ontap_network_ip_interface" "ip_interface" {
# required to know which system to interface with
cx_profile_name = "cluster4"
name = "cluster_mgmt"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
data "netapp-ontap_networking_ip_interfaces" "ip_interfaces" {
data "netapp-ontap_network_ip_interfaces" "ip_interfaces" {
# required to know which system to interface with
cx_profile_name = "cluster4"
filter = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
data "netapp-ontap_networking_ip_route" "networking_ip_route" {
data "netapp-ontap_network_ip_route" "network_ip_route" {
# required to know which system to interface with
cx_profile_name = "cluster4"
destination = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
data "netapp-ontap_networking_ip_routes" "networking_ip_routes" {
data "netapp-ontap_network_ip_routes" "networking_ip_routes" {
# required to know which system to interface with
cx_profile_name = "cluster4"
gateway = "10.10.10.254"
Expand Down
2 changes: 1 addition & 1 deletion examples/resources/netapp-ontap_ip_interface/resource.tf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
resource "netapp-ontap_networking_ip_interface" "ip_interface" {
resource "netapp-ontap_network_ip_interfaces" "ip_interface" {
# required to know which system to interface with
cx_profile_name = "cluster4"
name = "testme"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
resource "netapp-ontap_networking_ip_route" "networking_ip_route" {
resource "netapp-ontap_network_ip_routes" "network_ip_route" {
# required to know which system to interface with
cx_profile_name = "cluster4"
svm_name = "ansibleSVM"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ package networking
import (
"context"
"fmt"
"github.com/netapp/terraform-provider-netapp-ontap/internal/provider/connection"
"strconv"

"github.com/netapp/terraform-provider-netapp-ontap/internal/provider/connection"

"github.com/hashicorp/terraform-plugin-framework/datasource"
"github.com/hashicorp/terraform-plugin-framework/datasource/schema"
"github.com/hashicorp/terraform-plugin-framework/types"
Expand All @@ -21,7 +22,7 @@ var _ datasource.DataSource = &IPInterfaceDataSource{}
func NewIPInterfaceDataSource() datasource.DataSource {
return &IPInterfaceDataSource{
config: connection.ResourceOrDataSourceConfig{
Name: "networking_ip_interface",
Name: "network_ip_interface",
},
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ package networking
import (
"context"
"fmt"
"github.com/netapp/terraform-provider-netapp-ontap/internal/provider/connection"
"strconv"

"github.com/netapp/terraform-provider-netapp-ontap/internal/provider/connection"

"github.com/hashicorp/terraform-plugin-framework/datasource"
"github.com/hashicorp/terraform-plugin-framework/datasource/schema"
"github.com/hashicorp/terraform-plugin-framework/types"
Expand All @@ -21,7 +22,7 @@ var _ datasource.DataSource = &IPInterfacesDataSource{}
func NewIPInterfacesDataSource() datasource.DataSource {
return &IPInterfacesDataSource{
config: connection.ResourceOrDataSourceConfig{
Name: "networking_ip_interfaces",
Name: "network_ip_interfaces",
},
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,60 +2,61 @@ package networking_test

import (
"fmt"
ntest "github.com/netapp/terraform-provider-netapp-ontap/internal/provider"
"os"
"regexp"
"testing"

ntest "github.com/netapp/terraform-provider-netapp-ontap/internal/provider"

"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
)

func TestAccNetworkingIpInterfaceResource(t *testing.T) {
func TestAccNetworkIpInterfacesResource(t *testing.T) {
resource.Test(t, resource.TestCase{
PreCheck: func() { ntest.TestAccPreCheck(t) },
ProtoV6ProviderFactories: ntest.TestAccProtoV6ProviderFactories,
Steps: []resource.TestStep{
// non-existant SVM return code 2621462. Must happen before create/read
{
Config: testAccNetworkingIPInterfaceResourceConfig("non-existant", "10.10.10.10", "ontap_cluster_1-01"),
Config: testAccNetworkIPInterfaceResourceConfig("non-existant", "10.10.10.10", "ontap_cluster_1-01"),
ExpectError: regexp.MustCompile("2621462"),
},
// non-existant home node
{
Config: testAccNetworkingIPInterfaceResourceConfig("svm0", "10.10.10.10", "non-existant_home_node"),
Config: testAccNetworkIPInterfaceResourceConfig("svm0", "10.10.10.10", "non-existant_home_node"),
ExpectError: regexp.MustCompile("393271"),
},
// Create and Read
{
Config: testAccNetworkingIPInterfaceResourceConfig("svm0", "10.10.10.10", "ontap_cluster_1-01"),
Config: testAccNetworkIPInterfaceResourceConfig("svm0", "10.10.10.10", "ontap_cluster_1-01"),
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttr("netapp-ontap_networking_ip_interface.example", "name", "test-interface"),
resource.TestCheckResourceAttr("netapp-ontap_networking_ip_interface.example", "svm_name", "svm0"),
resource.TestCheckResourceAttr("netapp-ontap_network_ip_interfaces.example", "name", "test-interface"),
resource.TestCheckResourceAttr("netapp-ontap_network_ip_interfaces.example", "svm_name", "svm0"),
),
},
// Update and Read
{
Config: testAccNetworkingIPInterfaceResourceConfig("svm0", "10.10.10.20", "ontap_cluster_1-01"),
Config: testAccNetworkIPInterfaceResourceConfig("svm0", "10.10.10.20", "ontap_cluster_1-01"),
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttr("netapp-ontap_networking_ip_interface.example", "name", "test-interface"),
resource.TestCheckResourceAttr("netapp-ontap_networking_ip_interface.example", "ip.address", "10.10.10.20"),
resource.TestCheckResourceAttr("netapp-ontap_network_ip_interfaces.example", "name", "test-interface"),
resource.TestCheckResourceAttr("netapp-ontap_network_ip_interfaces.example", "ip.address", "10.10.10.20"),
),
},
// Test importing a resource
{
ResourceName: "netapp-ontap_networking_ip_interface.example",
ResourceName: "netapp-ontap_network_ip_interfaces.example",
ImportState: true,
ImportStateId: fmt.Sprintf("%s,%s,%s", "test-interface", "svm0", "cluster4"),
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttr("netapp-ontap_networking_ip_interface.example", "name", "test-interface"),
resource.TestCheckResourceAttr("netapp-ontap_networking_ip_interface.example", "ip.address", "10.10.10.20"),
resource.TestCheckResourceAttr("netapp-ontap_network_ip_interfaces.example", "name", "test-interface"),
resource.TestCheckResourceAttr("netapp-ontap_network_ip_interfaces.example", "ip.address", "10.10.10.20"),
),
},
},
})
}

func testAccNetworkingIPInterfaceResourceConfig(svmName, address, homeNode string) string {
func testAccNetworkIPInterfaceResourceConfig(svmName, address, homeNode string) string {
host := os.Getenv("TF_ACC_NETAPP_HOST")
admin := os.Getenv("TF_ACC_NETAPP_USER")
password := os.Getenv("TF_ACC_NETAPP_PASS")
Expand All @@ -76,7 +77,7 @@ provider "netapp-ontap" {
]
}

resource "netapp-ontap_networking_ip_interface" "example" {
resource "netapp-ontap_network_ip_interfaces" "example" {
cx_profile_name = "cluster4"
name = "test-interface"
svm_name = "%s"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ package networking
import (
"context"
"fmt"
"github.com/netapp/terraform-provider-netapp-ontap/internal/provider/connection"
"strconv"
"strings"

"github.com/netapp/terraform-provider-netapp-ontap/internal/provider/connection"

"github.com/hashicorp/terraform-plugin-framework/path"
"github.com/hashicorp/terraform-plugin-framework/resource"
"github.com/hashicorp/terraform-plugin-framework/resource/schema"
Expand All @@ -23,10 +24,10 @@ var _ resource.Resource = &IPInterfaceResource{}
var _ resource.ResourceWithImportState = &IPInterfaceResource{}

// NewIPInterfaceResource is a helper function to simplify the provider implementation.
func NewIPInterfaceResource() resource.Resource {
func NewIPInterfacesResource() resource.Resource {
return &IPInterfaceResource{
config: connection.ResourceOrDataSourceConfig{
Name: "networking_ip_interface",
Name: "network_ip_interfaces",
},
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package networking
import (
"context"
"fmt"

"github.com/netapp/terraform-provider-netapp-ontap/internal/provider/connection"

"github.com/hashicorp/terraform-plugin-framework/datasource"
Expand All @@ -20,7 +21,7 @@ var _ datasource.DataSource = &IPRouteDataSource{}
func NewIPRouteDataSource() datasource.DataSource {
return &IPRouteDataSource{
config: connection.ResourceOrDataSourceConfig{
Name: "networking_ip_route",
Name: "network_ip_route",
},
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package networking
import (
"context"
"fmt"

"github.com/netapp/terraform-provider-netapp-ontap/internal/provider/connection"

"github.com/hashicorp/terraform-plugin-framework/datasource"
Expand All @@ -20,7 +21,7 @@ var _ datasource.DataSource = &IPRoutesDataSource{}
func NewIPRoutesDataSource() datasource.DataSource {
return &IPRoutesDataSource{
config: connection.ResourceOrDataSourceConfig{
Name: "networking_ip_routes",
Name: "network_ip_routes",
},
}
}
Expand Down
Loading
Loading