-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
565 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,117 @@ | ||
--- | ||
# 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. | ||
|
||
title: "powerscale_network_rule data source" | ||
linkTitle: "powerscale_network_rule" | ||
page_title: "powerscale_network_rule Data Source - terraform-provider-powerscale" | ||
subcategory: "" | ||
description: |- | ||
This datasource is used to query the existing network rules from PowerScale array. The information fetched from this datasource can be used for getting the details or for further processing in resource block. | ||
--- | ||
|
||
# powerscale_network_rule (Data Source) | ||
|
||
This datasource is used to query the existing network rules from PowerScale array. The information fetched from this datasource can be used for getting the details or for further processing in resource block. | ||
|
||
## Example Usage | ||
|
||
```terraform | ||
/* | ||
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. | ||
*/ | ||
# This Terraform DataSource is used to query the details of existing network rules from PowerScale array. | ||
# Returns a list of PowerScale network rules based on names and query parameters specified in the filter block. | ||
data "powerscale_network_rule" "test" { | ||
filter { | ||
# Optional query parameters | ||
# Note: the following filters will be applied with AND logic | ||
names = ["rule0"] | ||
# Optional | ||
groupnet = "groupnet0" | ||
subnet = "subnet0" | ||
pool = "pool0" | ||
} | ||
} | ||
# Output value of above block by executing 'terraform output' command | ||
# You can use the the fetched information by the variable data.powerscale_network_rule.test | ||
output "powerscale_network_rule" { | ||
value = data.powerscale_network_rule.test | ||
} | ||
# Returns all PowerScale network rules on PowerScale array | ||
data "powerscale_network_rule" "all" { | ||
} | ||
# Output value of above block by executing 'terraform output' command | ||
# You can use the the fetched information by the variable data.powerscale_network_rule.all | ||
output "powerscale_network_rule_data_all" { | ||
value = data.powerscale_network_rule.all | ||
} | ||
``` | ||
|
||
<!-- schema generated by tfplugindocs --> | ||
## Schema | ||
|
||
### Optional | ||
|
||
- `filter` (Block, Optional) (see [below for nested schema](#nestedblock--filter)) | ||
|
||
### Read-Only | ||
|
||
- `id` (String) Unique identifier of the network rule. | ||
- `network_rules` (Attributes List) List of Network Rules. (see [below for nested schema](#nestedatt--network_rules)) | ||
|
||
<a id="nestedblock--filter"></a> | ||
### Nested Schema for `filter` | ||
|
||
Optional: | ||
|
||
- `groupnet` (String) If specified, only rules for this groupnet will be returned. | ||
- `names` (Set of String) Filter network rules by names. | ||
- `pool` (String) If specified, only rules for this pool will be returned. | ||
- `subnet` (String) If specified, only rules for this subnet will be returned. | ||
|
||
|
||
<a id="nestedatt--network_rules"></a> | ||
### Nested Schema for `network_rules` | ||
|
||
Read-Only: | ||
|
||
- `description` (String) Description for the provisioning rule. | ||
- `groupnet` (String) Name of the groupnet this rule belongs to | ||
- `id` (String) Unique rule ID. | ||
- `iface` (String) Interface name the provisioning rule applies to. | ||
- `name` (String) Name of the provisioning rule. | ||
- `node_type` (String) Node type the provisioning rule applies to. | ||
- `pool` (String) Name of the pool this rule belongs to. | ||
- `subnet` (String) Name of the subnet this rule belongs to. |
48 changes: 48 additions & 0 deletions
48
examples/data-sources/powerscale_network_rule/data-source.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/* | ||
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. | ||
*/ | ||
|
||
# This Terraform DataSource is used to query the details of existing network rules from PowerScale array. | ||
|
||
# Returns a list of PowerScale network rules based on names and query parameters specified in the filter block. | ||
data "powerscale_network_rule" "test" { | ||
filter { | ||
# Optional query parameters | ||
# Note: the following filters will be applied with AND logic | ||
names = ["rule0"] | ||
|
||
# Optional | ||
groupnet = "groupnet0" | ||
subnet = "subnet0" | ||
pool = "pool0" | ||
} | ||
} | ||
|
||
# Output value of above block by executing 'terraform output' command | ||
# You can use the the fetched information by the variable data.powerscale_network_rule.test | ||
output "powerscale_network_rule" { | ||
value = data.powerscale_network_rule.test | ||
} | ||
|
||
# Returns all PowerScale network rules on PowerScale array | ||
data "powerscale_network_rule" "all" { | ||
} | ||
|
||
# Output value of above block by executing 'terraform output' command | ||
# You can use the the fetched information by the variable data.powerscale_network_rule.all | ||
output "powerscale_network_rule_data_all" { | ||
value = data.powerscale_network_rule.all | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/* | ||
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 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.