Skip to content

Commit

Permalink
Adding support for resource for storagepool tier (#265)
Browse files Browse the repository at this point in the history
* Adding support for resource for storagepool tier

* Adding support for resource for storagepool tier

* Adding support for resource for storagepool tier
  • Loading branch information
trisha-dell authored Dec 3, 2024
1 parent ab3b2bc commit 66bb009
Show file tree
Hide file tree
Showing 12 changed files with 913 additions and 3 deletions.
112 changes: 112 additions & 0 deletions docs/resources/storagepool_tier.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
---
# Copyright (c) 2024 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.

title: "powerscale_storagepool_tier resource"
linkTitle: "powerscale_storagepool_tier"
page_title: "powerscale_storagepool_tier Resource - terraform-provider-powerscale"
subcategory: ""
description: |-
This resource is used to manage the storagepool tier entity of PowerScale Array. We can Create, Update and Delete the storagepool tiers using this resource. We can also import an existing storagepool tier from PowerScale array.
---

# powerscale_storagepool_tier (Resource)

This resource is used to manage the storagepool tier entity of PowerScale Array. We can Create, Update and Delete the storagepool tiers using this resource. We can also import an existing storagepool tier from PowerScale array.


## Example Usage

```terraform
/*
Copyright (c) 2024 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.
*/
# Available actions: Create, Update, Delete and Import.
# After `terraform apply` of this example file will create the storage pool tier on the PowerScale array with the attributes set in the config.
# For update, name, children, transfer_limit_pct and transfer_limit_state are supported. transfer_limit_pct and transfer_limit_state are mutually exclusive
resource "powerscale_storagepool_tier" "example" {
# Required field both for creating and updating
name = "Sample_terraform_tier_7"
# Optional parameters
children = [
"x410_34tb_1.6tb-ssd_64gb"
]
transfer_limit_pct = 40
}
```

<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `name` (String) Specifies the storagepool tier name.

### Optional

- `children` (List of String) An optional parameter which adds new nodepools to the storagepool tier.
- `transfer_limit_pct` (Number) Stop moving files to this tier when this limit is met
- `transfer_limit_state` (String) How the transfer limit value is being applied

### Read-Only

- `id` (Number) Specifies a string which represents the unique identifier of storagepool tier
- `lnns` (List of Number) The nodes that are part of this tier.

Unless specified otherwise, all fields of this resource can be updated.

## Import

Import is supported using the following syntax:

```shell
# Copyright (c) 2024 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_storagepool_tier.example id_of_storagepool_tier
# Example:
terraform import powerscale_storagepool_tier.example "tier"
# after running this command, populate parameters in the config file to start managing this resource.
# Note: running "terraform show" after importing shows the current config/state of the resource.
```
21 changes: 21 additions & 0 deletions examples/resources/powerscale_storagepool_tier/import.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Copyright (c) 2024 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_storagepool_tier.example id_of_storagepool_tier
# Example:
terraform import powerscale_storagepool_tier.example "tier"
# after running this command, populate parameters in the config file to start managing this resource.
# Note: running "terraform show" after importing shows the current config/state of the resource.
30 changes: 30 additions & 0 deletions examples/resources/powerscale_storagepool_tier/provider.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*
Copyright (c) 2024 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
}
31 changes: 31 additions & 0 deletions examples/resources/powerscale_storagepool_tier/resource.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/*
Copyright (c) 2024 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.
*/

# Available actions: Create, Update, Delete and Import.
# After `terraform apply` of this example file will create the storage pool tier on the PowerScale array with the attributes set in the config.
# For update, name, children, transfer_limit_pct and transfer_limit_state are supported. transfer_limit_pct and transfer_limit_state are mutually exclusive

resource "powerscale_storagepool_tier" "example" {
# Required field both for creating and updating
name = "Sample_terraform_tier_7"

# Optional parameters
children = [
"x410_34tb_1.6tb-ssd_64gb"
]
transfer_limit_pct = 40
}
9 changes: 6 additions & 3 deletions goClientZip/PowerScale_API_9.5.0.json
Original file line number Diff line number Diff line change
Expand Up @@ -41815,7 +41815,8 @@
"description": "Stop moving files to this tier when this limit is met",
"maximum": 100,
"minimum": 0,
"type": "integer"
"type": "float",
"format": "float64"
},
"transfer_limit_state": {
"description": "How the transfer limit value is being applied",
Expand Down Expand Up @@ -41871,7 +41872,8 @@
"description": "Stop moving files to this tier when this limit is met",
"maximum": 100,
"minimum": 0,
"type": "integer"
"type": "float",
"format": "float64"
},
"transfer_limit_state": {
"description": "How the transfer limit value is being applied",
Expand Down Expand Up @@ -41914,7 +41916,8 @@
"description": "Stop moving files to this tier when this limit is met",
"maximum": 100,
"minimum": 0,
"type": "integer"
"type": "float",
"format": "float64"
},
"transfer_limit_state": {
"description": "How the transfer limit value is being applied",
Expand Down
Binary file modified goClientZip/powerscale-go-client.zip
Binary file not shown.
12 changes: 12 additions & 0 deletions powerscale/constants/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -496,4 +496,16 @@ const (

// ReadSyncIQReplicationJobErrorMessage specifies error details occurred while reading SyncIQ jobs.
ReadSyncIQReplicationJobErrorMessage = "Could not read SyncIQ jobs "

// ReadStoragepoolTierErrorMsg specifies error details occurred while reading Storage pool tiers.
ReadStoragepoolTierErrorMsg = "Could not read storagepool tier "

// CreateStoragepoolTierErrorMsg specifies error details occurred while creating Storage pool tiers.
CreateStoragepoolTierErrorMsg = "Could not create storagepool tier "

// UpdateStoragepoolTierErrorMsg specifies error details occurred while updating Storage pool Tier settings.
UpdateStoragepoolTierErrorMsg = "Could not update storagepool tier settings "

// DeleteStoragepoolTierErrorMsg specifies error details occurred while deleting Storage pool Tier.
DeleteStoragepoolTierErrorMsg = "Could not delete storagepool tier "
)
Loading

0 comments on commit 66bb009

Please sign in to comment.