Skip to content

Commit

Permalink
Implement Nfs Export
Browse files Browse the repository at this point in the history
Set openapi integer field as int64
Add NFS Export resource and AT
Improve resource helper for Nullable String and Nil field
  • Loading branch information
P-Cao committed Aug 7, 2023
1 parent e980cac commit f3327bb
Show file tree
Hide file tree
Showing 14 changed files with 1,991 additions and 39 deletions.
2 changes: 1 addition & 1 deletion client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func NewClient(endpoint string,
// NewOpenAPIClient returns the OpenApi Client.
func NewOpenAPIClient(ctx context.Context, endpoint string, insecure bool, user string, pass string) (*powerscale.APIClient, error) {
// Setup a User-Agent for your API client (replace the provider name for yours):
userAgent := "terraform-powermax-provider/1.0.0"
userAgent := "terraform-powerscale-provider/1.0.0"
jar, err := cookiejar.New(nil)
if err != nil {
tflog.Error(ctx, "Got error while creating cookie jar")
Expand Down
310 changes: 310 additions & 0 deletions docs/resources/nfs_export.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/resources/smb_share.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ Import is supported using the following syntax:
# limitations under the License.

# The command is
# terraform import powermax_host.example_share <name>
# terraform import powerscale_smb_share.example_share <name>
# Example:
terraform import powerscale_smb_share.example_share example_share
# after running this command, populate the name field in the config file to start managing this resource
Expand Down
20 changes: 20 additions & 0 deletions examples/resources/powerscale_nfs_export/import.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Copyright (c) 2023 Dell Inc., or its subsidiaries. All Rights Reserved.

# Licensed under the Mozilla Public License Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at

# http://mozilla.org/MPL/2.0/


# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# The command is
# terraform import powerscale_nfs_export.example_export <name>
# Example:
terraform import powerscale_nfs_export.example_export example_export
# after running this command, populate the name field in the config file to start managing this resource
36 changes: 36 additions & 0 deletions examples/resources/powerscale_nfs_export/provider.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*
Copyright (c) 2023 Dell Inc., or its subsidiaries. All Rights Reserved.
Licensed under the Mozilla Public License Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://mozilla.org/MPL/2.0/
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
terraform {
required_providers {
powerscale = {
source = "registry.terraform.io/dell/powerscale"
}
}
}

provider "powerscale" {
username = var.username
password = var.password
endpoint = var.endpoint
insecure = var.insecure
group = var.group
volume_path = var.volume_path
volume_path_permissions = var.volume_path_permissions
ignore_unresolvable_hosts = var.ignore_unresolvable_hosts
auth_type = var.auth_type
verbose_logging = var.verbose_logging
}
22 changes: 22 additions & 0 deletions examples/resources/powerscale_nfs_export/resource.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/*
Copyright (c) 2023 Dell Inc., or its subsidiaries. All Rights Reserved.
Licensed under the Mozilla Public License Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://mozilla.org/MPL/2.0/
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
resource "powerscale_nfs_export" "example_export" {
paths = ["/ifs/example_export"]
force = true
block_size = 4096
name_max_size = 127
}
2 changes: 1 addition & 1 deletion examples/resources/powerscale_smb_share/import.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# limitations under the License.

# The command is
# terraform import powermax_host.example_share <name>
# terraform import powerscale_smb_share.example_share <name>
# Example:
terraform import powerscale_smb_share.example_share example_share
# after running this command, populate the name field in the config file to start managing this resource
Loading

0 comments on commit f3327bb

Please sign in to comment.