Skip to content

Commit

Permalink
add old name support to Snapmirror
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Archibald authored and Chris Archibald committed Oct 14, 2024
1 parent 381c3e5 commit 371e03d
Show file tree
Hide file tree
Showing 9 changed files with 602 additions and 4 deletions.
6 changes: 6 additions & 0 deletions internal/provider/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,8 @@ func (p *ONTAPProvider) Resources(ctx context.Context) []func() resource.Resourc
protocols.NewProtocolsSanIgroupResourceAlias,
protocols.NewProtocolsSanLunMapResourceAlias,
security.NewSecurityAccountResourceAlias,
snapmirror.NewSnapmirrorPolicyResourceAlias,
snapmirror.NewSnapmirrorResourceAlias,
}
}

Expand Down Expand Up @@ -393,6 +395,10 @@ func (p *ONTAPProvider) DataSources(ctx context.Context) []func() datasource.Dat
protocols.NewProtocolsSanLunMapsDataSourceAlias,
security.NewSecurityAccountDataSourceAlias,
security.NewSecurityAccountsDataSourceAlias,
snapmirror.NewSnapmirrorDataSourceAlias,
snapmirror.NewSnapmirrorPoliciesDataSourceAlias,
snapmirror.NewSnapmirrorPolicyDataSourceAlias,
snapmirror.NewSnapmirrorsDataSourceAlias,
}
}

Expand Down
10 changes: 10 additions & 0 deletions internal/provider/snapmirror/snapmirror_data_source.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package snapmirror
import (
"context"
"fmt"

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

"github.com/hashicorp/terraform-plugin-framework/datasource"
Expand All @@ -25,6 +26,15 @@ func NewSnapmirrorDataSource() datasource.DataSource {
}
}

// NewSnapmirrorDataSourceAlias is a helper function to simplify the provider implementation.
func NewSnapmirrorDataSourceAlias() datasource.DataSource {
return &SnapmirrorDataSource{
config: connection.ResourceOrDataSourceConfig{
Name: "snapmirror_data_source",
},
}
}

// SnapmirrorDataSource defines the data source implementation.
type SnapmirrorDataSource struct {
config connection.ResourceOrDataSourceConfig
Expand Down
12 changes: 11 additions & 1 deletion internal/provider/snapmirror/snapmirror_policies_data_source.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ package snapmirror
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 @@ -26,6 +27,15 @@ func NewSnapmirrorPoliciesDataSource() datasource.DataSource {
}
}

// NewSnapmirrorPoliciesDataSourceAlias is a helper function to simplify the provider implementation.
func NewSnapmirrorPoliciesDataSourceAlias() datasource.DataSource {
return &SnapmirrorPoliciesDataSource{
config: connection.ResourceOrDataSourceConfig{
Name: "snapmirror_policies_data_source",
},
}
}

// SnapmirrorPoliciesDataSource defines the data source implementation.
type SnapmirrorPoliciesDataSource struct {
config connection.ResourceOrDataSourceConfig
Expand Down
12 changes: 11 additions & 1 deletion internal/provider/snapmirror/snapmirror_policy_data_source.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ package snapmirror
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 @@ -26,6 +27,15 @@ func NewSnapmirrorPolicyDataSource() datasource.DataSource {
}
}

// NewSnapmirrorPolicyDataSourceAlias is a helper function to simplify the provider implementation.
func NewSnapmirrorPolicyDataSourceAlias() datasource.DataSource {
return &SnapmirrorPolicyDataSource{
config: connection.ResourceOrDataSourceConfig{
Name: "snapmirror_policy_data_source",
},
}
}

// SnapmirrorPolicyDataSource defines the data source implementation.
type SnapmirrorPolicyDataSource struct {
config connection.ResourceOrDataSourceConfig
Expand Down
12 changes: 11 additions & 1 deletion internal/provider/snapmirror/snapmirror_policy_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ package snapmirror
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-validators/boolvalidator"
"github.com/hashicorp/terraform-plugin-framework-validators/stringvalidator"
"github.com/hashicorp/terraform-plugin-framework/resource/schema/booldefault"
Expand Down Expand Up @@ -38,6 +39,15 @@ func NewSnapmirrorPolicyResource() resource.Resource {
}
}

// NewSnapmirrorPolicyResourceAlias is a helper function to simplify the provider implementation.
func NewSnapmirrorPolicyResourceAlias() resource.Resource {
return &SnapmirrorPolicyResource{
config: connection.ResourceOrDataSourceConfig{
Name: "snapmirror_policy_resource",
},
}
}

// SnapmirrorPolicyResource defines the resource implementation.
type SnapmirrorPolicyResource struct {
config connection.ResourceOrDataSourceConfig
Expand Down
Loading

0 comments on commit 371e03d

Please sign in to comment.