Skip to content

Commit

Permalink
Merge pull request #276 from NetApp/76-new-resource-storageqospolicies
Browse files Browse the repository at this point in the history
new resource qos policies
  • Loading branch information
suhasbshekar committed Aug 29, 2024
2 parents 66968a8 + bca70e2 commit 916b101
Show file tree
Hide file tree
Showing 22 changed files with 1,743 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

FEATURES:
* **New Data Source:** `netapp-ontap_volumes_files` ([#8](https://github.com/NetApp/terraform-provider-netapp-ontap/issues/8))
* **New Data Source:** `netapp-ontap_qos_policy` ([#77](https://github.com/NetApp/terraform-provider-netapp-ontap/issues/77))
* **New Data Source:** `netapp-ontap_qos_policies` ([#77](https://github.com/NetApp/terraform-provider-netapp-ontap/issues/77))
* **New Data Source:** `netapp-ontap_quota_rules` ([#135](https://github.com/NetApp/terraform-provider-netapp-ontap/issues/135))
* **New Data Source:** `netapp-ontap_quota_rule` ([#135](https://github.com/NetApp/terraform-provider-netapp-ontap/issues/135))
* **New Data Source:** `netapp-ontap_security_role` ([#139](https://github.com/NetApp/terraform-provider-netapp-ontap/issues/139))
Expand All @@ -11,6 +13,7 @@ FEATURES:
* **New Resource:** `netapp-ontap_volume_efficiency_policies` ([#80](https://github.com/NetApp/terraform-provider-netapp-ontap/issues/80))
* **New Resource:** `netapp-ontap_quota_rules` ([#136](https://github.com/NetApp/terraform-provider-netapp-ontap/issues/136))
* **New Resource:** `netapp-ontap_volumes_files` ([#5](https://github.com/NetApp/terraform-provider-netapp-ontap/issues/5))
* **New Resource:** `netapp-ontap_qos_policies` ([#76](https://github.com/NetApp/terraform-provider-netapp-ontap/issues/76))

ENHANCEMENTS:
* **netapp-ontap_lun**: added `size_unit` option. ([#227](https://github.com/NetApp/terraform-provider-netapp-ontap/issues/227))
Expand Down
97 changes: 97 additions & 0 deletions docs/data-sources/storage_qos_policies_data_source.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "netapp-ontap_qos_policies Data Source - terraform-provider-netapp-ontap"
subcategory: "Storage"
description: |-
QOSPolicies data source
---

# netapp-ontap_qos_policies (Data Source)

QOSPolicies data source

## Example Usage

```terraform
data "netapp-ontap_qos_policies" "qos_policies" {
# required to know which system to interface with
cx_profile_name = "cluster1"
filter = {
svm_name = "terraform"
name = "test2"
}
}
```

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

### Required

- `cx_profile_name` (String) Connection profile name

### Optional

- `filter` (Attributes) (see [below for nested schema](#nestedatt--filter))

### Read-Only

- `qos_policies` (Attributes List) (see [below for nested schema](#nestedatt--qos_policies))

<a id="nestedatt--filter"></a>
### Nested Schema for `filter`

Optional:

- `name` (String) QOSPolicy name
- `svm_name` (String) QOSPolicy svm name


<a id="nestedatt--qos_policies"></a>
### Nested Schema for `qos_policies`

Required:

- `cx_profile_name` (String) Connection profile name
- `name` (String) QOSPolicy name
- `svm_name` (String) QOSPolicy svm name

Optional:

- `adaptive` (Attributes) Adaptive QoS policy (see [below for nested schema](#nestedatt--qos_policies--adaptive))
- `scope` (String) QoS policy scope

Read-Only:

- `fixed` (Attributes) Fixed QoS policy (see [below for nested schema](#nestedatt--qos_policies--fixed))
- `id` (String) QOSPolicies UUID

<a id="nestedatt--qos_policies--adaptive"></a>
### Nested Schema for `qos_policies.adaptive`

Required:

- `peak_iops` (Number) Peak IOPS

Optional:

- `absolute_min_iops` (Number) Absolute minimum IOPS

Read-Only:

- `block_size` (String) Block size
- `expected_iops` (Number) Expected IOPS
- `expected_iops_allocation` (String) Expected IOPS allocation
- `peak_iops_allocation` (String) Peak IOPS allocation


<a id="nestedatt--qos_policies--fixed"></a>
### Nested Schema for `qos_policies.fixed`

Read-Only:

- `capacity_shared` (Boolean) Capacity shared
- `max_throughput_iops` (Number) Maximum throughput in IOPS
- `max_throughput_mbps` (Number) Maximum throughput in MBPS
- `min_throughput_iops` (Number) Minimum throughput in IOPS
- `min_throughput_mbps` (Number) Minimum throughput in MBPS
71 changes: 71 additions & 0 deletions docs/data-sources/storage_qos_policy_data_source.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "netapp-ontap_qos_policy Data Source - terraform-provider-netapp-ontap"
subcategory: "Storage"
description: |-
QOSPolicy data source
---

# netapp-ontap_qos_policy (Data Source)

QOSPolicy data source

## Example Usage

```terraform
data "netapp-ontap_qos_policy" "qos_policy" {
# required to know which system to interface with
cx_profile_name = "cluster1"
name = "test"
svm_name = "terraform"
}
```

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

### Required

- `cx_profile_name` (String) Connection profile name
- `name` (String) QOSPolicy name
- `svm_name` (String) QOSPolicy svm name

### Optional

- `adaptive` (Attributes) Adaptive QoS policy (see [below for nested schema](#nestedatt--adaptive))
- `scope` (String) QoS policy scope

### Read-Only

- `fixed` (Attributes) Fixed QoS policy (see [below for nested schema](#nestedatt--fixed))
- `id` (String) QOSPolicies UUID

<a id="nestedatt--adaptive"></a>
### Nested Schema for `adaptive`

Required:

- `peak_iops` (Number) Peak IOPS

Optional:

- `absolute_min_iops` (Number) Absolute minimum IOPS

Read-Only:

- `block_size` (String) Block size
- `expected_iops` (Number) Expected IOPS
- `expected_iops_allocation` (String) Expected IOPS allocation
- `peak_iops_allocation` (String) Peak IOPS allocation


<a id="nestedatt--fixed"></a>
### Nested Schema for `fixed`

Read-Only:

- `capacity_shared` (Boolean) Capacity shared
- `max_throughput_iops` (Number) Maximum throughput in IOPS
- `max_throughput_mbps` (Number) Maximum throughput in MBPS
- `min_throughput_iops` (Number) Minimum throughput in IOPS
- `min_throughput_mbps` (Number) Minimum throughput in MBPS
140 changes: 140 additions & 0 deletions docs/resources/storage_qos_policies_resource.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "netapp-ontap_qos_policies Resource - terraform-provider-netapp-ontap"
subcategory: "Storage"
description: |-
QOSPolicies resource
---

# netapp-ontap_qos_policies (Resource)

Create/Modify/Delete a QOSPolicies resource

### Related ONTAP commands
```commandline
* qos policy-group create
* qos policy-group modify
* qos policy-group delete
* qos adaptive-policy-group create
* qos adaptive-policy-group modify
* qos adaptive-policy-group delete
```

## Example Usage

```terraform
resource "netapp-ontap_qos_policies" "qos_policies" {
# required to know which system to interface with
cx_profile_name = "cluster1"
name = "terraform2"
svm_name = "terraform"
fixed = {
max_throughput_iops = 1
}
}
```

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

### Required

- `cx_profile_name` (String) Connection profile name
- `name` (String) QOSPolicies name
- `svm_name` (String) QOSPolicies svm name

### Optional

- `adaptive` (Attributes) Adaptive QoS policy (see [below for nested schema](#nestedatt--adaptive))
- `fixed` (Attributes) Fixed QoS policy (see [below for nested schema](#nestedatt--fixed))
- `scope` (String) QoS policy scope

### Read-Only

- `id` (String) QOSPolicies UUID

<a id="nestedatt--adaptive"></a>
### Nested Schema for `adaptive`

Required:

- `expected_iops` (Number) Expected IOPS
- `peak_iops` (Number) Peak IOPS

Optional:

- `absolute_min_iops` (Number) Absolute minimum IOPS
- `block_size` (String) Block size
- `expected_iops_allocation` (String) Expected IOPS allocation
- `peak_iops_allocation` (String) Peak IOPS allocation


<a id="nestedatt--fixed"></a>
### Nested Schema for `fixed`

Optional:

- `capacity_shared` (Boolean) Capacity shared
- `max_throughput_iops` (Number) Maximum throughput in IOPS
- `max_throughput_mbps` (Number) Maximum throughput in MBPS
- `min_throughput_iops` (Number) Minimum throughput in IOPS
- `min_throughput_mbps` (Number) Minimum throughput in MBPS

## Import
This Resource supports import, which allows you to import existing qos policies into the state of this resoruce.
Import require a unique ID composed of the name, svm name and cx_profile_name, separated by a comma.

id = `name`, `svm_name`, `cx_profile_name`

### Terraform Import

For example
```shell
terraform import netapp-ontap_qos_policies.example name,svm,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.

### Terraform Import Block
This requires Terraform 1.5 or higher, and will auto create the configuration for you

First create the block
```terraform
import {
to = netapp-ontap_qos_policies.qos_policies
id = "name,svm,cluster4"
}
```
Next run, this will auto create the configuration for you
```shell
terraform plan -generate-config-out=generated.tf
```
This will generate a file called generated.tf, which will contain the configuration for the imported resource
```terraform
# __generated__ by Terraform
# Please review these resources and move them into your main configuration files.
# __generated__ by Terraform from "vol,svm,tree,test,cluster4"
resource "netapp-ontap_qos_policies" "qos_policies" {
cx_profile_name = "cluster4"
id = "abcd"
adaptive = {
absolute_min_iops = 0
block_size = ""
expected_iops = 0
expected_iops_allocation = ""
peak_iops = 0
peak_iops_allocation = ""
}
fixed = {
capacity_shared = true
max_throughput_iops = 0
max_throughput_mbps = 0
min_throughput_iops = 0
min_throughput_mbps = 0
}
name = "test"
scope = "svm"
svm_name = "terraform"
}
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
data "netapp-ontap_qos_policies" "qos_policies" {
# required to know which system to interface with
cx_profile_name = "cluster1"
filter = {
svm_name = "terraform"
name = "test2"
}
}
6 changes: 6 additions & 0 deletions examples/data-sources/netapp-ontap_qos_policy/data-source.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
data "netapp-ontap_qos_policy" "qos_policy" {
# required to know which system to interface with
cx_profile_name = "cluster1"
name = "test"
svm_name = "terraform"
}
1 change: 1 addition & 0 deletions examples/data-sources/netapp-ontap_qos_policy/provider.tf
1 change: 1 addition & 0 deletions examples/data-sources/netapp-ontap_qos_policy/variables.tf
1 change: 1 addition & 0 deletions examples/resources/netapp-ontap_qos_policies/provider.tf
9 changes: 9 additions & 0 deletions examples/resources/netapp-ontap_qos_policies/resource.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
resource "netapp-ontap_qos_policies" "qos_policies" {
# required to know which system to interface with
cx_profile_name = "cluster1"
name = "terraform2"
svm_name = "terraform"
fixed = {
max_throughput_iops = 1
}
}
1 change: 1 addition & 0 deletions examples/resources/netapp-ontap_qos_policies/variables.tf
Loading

0 comments on commit 916b101

Please sign in to comment.