Skip to content

Commit

Permalink
Merge pull request #220 from Juniper/task/98
Browse files Browse the repository at this point in the history
Fixed issue # 98 - made sure any comments are < 76 chars
  • Loading branch information
bwJuniper authored Jul 26, 2023
2 parents 5eacef8 + 5604039 commit 1c537cd
Show file tree
Hide file tree
Showing 44 changed files with 232 additions and 192 deletions.
4 changes: 2 additions & 2 deletions docs/data-sources/agent_profile.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ At least one optional attribute is required.
## Example Usage

```terraform
# The following example grabs the ID numbers of all agent profiles, uses those
# IDs to grab the details of each agent profile, and then
# The following example grabs the ID numbers of all agent profiles, uses
# those IDs to grab the details of each agent profile, and then
data "apstra_agent_profiles" "all" {}
Expand Down
7 changes: 4 additions & 3 deletions docs/data-sources/agent_profiles.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@ This data source returns the ID numbers of all Agent Profiles.
## Example Usage

```terraform
# The following example grabs the ID numbers of all agent profiles, uses those
# IDs to grab the details of each agent profile, and then outputs the names of
# all Agent Profiles which lack a complete set of credentials.
# The following example grabs the ID numbers of all agent profiles,
# uses those IDs to grab the details of each agent profile, and then
# outputs the names of all Agent Profiles which lack a complete
# set of credentials.
data "apstra_agent_profiles" "all" {}
Expand Down
2 changes: 1 addition & 1 deletion docs/data-sources/agents.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ This data source returns the IDs of Managed Device Agents. All of the `filters`
## Example Usage

```terraform
# This example returns the IDs of all Off-Box Agents responsible for Systems in
# This example returns the IDs of all OffBox Agents responsible for Systems
# with management IP addresses in the 192.168.100.0/24 subnet.
data "apstra_agents" "agents" {
Expand Down
7 changes: 4 additions & 3 deletions docs/data-sources/asn_pool.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ At least one optional attribute is required. It is incumbent upon the user to en
## Example Usage

```terraform
# The following example shows outputting a report of free space across all ASN resource pools:
# The following example shows outputting a report of free space across all
# ASN resource pools:
data "apstra_asn_pools" "all" {}
Expand All @@ -31,7 +32,7 @@ output "asn_report" {
}}
}
################################################################################
############################################################################
# The output object above will produce something like the following:
#
# asn_report = {
Expand All @@ -52,7 +53,7 @@ output "asn_report" {
# "name" = "leaf"
# }
# }
################################################################################
############################################################################
```

<!-- schema generated by tfplugindocs -->
Expand Down
7 changes: 4 additions & 3 deletions docs/data-sources/blueprint_deployment.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,16 @@ This data source returns the deployment status of a Blueprint.

```terraform
# This example uses the 'apstra_blueprints' and 'apstra_blueprint_deployment'
# data sources to output a report comparing the staging and active blueprints.
# data sources to output a report comparing the staging and active
# blueprints.
# First, get a list of all blueprint IDs
data "apstra_blueprints" "blueprint_ids" {
reference_design = "datacenter"
}
# Next, use the 'one()' function to assert that only one blueprint exists, and
# pull the commit info for that blueprint.
# Next, use the 'one()' function to assert that only one blueprint exists,
# and pull the commit info for that blueprint.
data "apstra_blueprint_deployment" "time_voyager" {
blueprint_id = one(data.apstra_blueprints.blueprint_ids.ids)
}
Expand Down
33 changes: 17 additions & 16 deletions docs/data-sources/interface_map.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,29 +15,30 @@ At least one optional attribute is required. It is incumbent upon the user to en
## Example Usage

```terraform
# This example reports on un-mapped interfaces found in various interface maps.
# These are cases where a particular switch model has more interfaces than are
# required for the fabric role to which it might be assigned (using a 48 port
# switch where the design only requires 12 ports, etc...)
# Grab a list of interesting Interface Map IDs. In this case we're interested
# only in interface maps which link hardware to the "AOS-7x10-Leaf" Logical
# Device design element.
# This example reports on un-mapped interfaces found in various interface
# maps. These are cases where a particular switch model has more interfaces
# than are required for the fabric role to which it might be assigned (using
# a 48 port switch where the design only requires 12 ports, etc...)
# Grab a list of interesting Interface Map IDs. In this case we're
# interested only in interface maps which link hardware to the
# "AOS-7x10-Leaf" Logical Device design element.
data "apstra_interface_maps" "imaps" {
logical_device_id = "AOS-7x10-Leaf"
}
# Loop over the matching Interface Map IDs and grab the full details of those
# objects so that we can inspect them further.
# Loop over the matching Interface Map IDs and grab the full details of
# those objects so that we can inspect them further.
data "apstra_interface_map" "details" {
for_each = data.apstra_interface_maps.imaps.ids
id = each.key
}
# Report stage: Loop over Interface Map objects, and then the interface mappings
# found inside. Filter the mappings for instances where the logical device panel
# and port are null (un-mapped). Output map (dictionary) where the key is
# Interface Map ID, and the value is the count of un-mapped interfaces.
# Report stage: Loop over Interface Map objects, and then the interface
# mappings found inside. Filter the mappings for instances where the
# logical device panel and port are null (un-mapped). Output map
# (dictionary) where the key is Interface Map ID, and the value is the count
# of un-mapped interfaces.
output "unmapped_interface_count" {
value = {
for i in data.apstra_interface_map.details : i.id => length(
Expand All @@ -48,7 +49,7 @@ output "unmapped_interface_count" {
}
}
################################################################################
############################################################################
# The output looks like this:
#
# unmapped_interface_count = {
Expand All @@ -58,7 +59,7 @@ output "unmapped_interface_count" {
# "Juniper_vQFX__AOS-7x10-Leaf" = 5
# "VS_SONiC_BUZZNIK_PLUS__AOS-7x10-Leaf" = 49
# }
################################################################################
############################################################################
```

<!-- schema generated by tfplugindocs -->
Expand Down
31 changes: 16 additions & 15 deletions docs/data-sources/interface_maps.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,29 +12,30 @@ This data source returns the ID numbers of Interface Maps.
## Example Usage

```terraform
# This example reports on un-mapped interfaces found in various interface maps.
# These are cases where a particular switch model has more interfaces than are
# required for the fabric role to which it might be assigned (using a 48 port
# switch where the design only requires 12 ports, etc...)
# This example reports on un-mapped interfaces found in various interface
# maps. These are cases where a particular switch model has more interfaces
# than are required for the fabric role to which it might be assigned (using
# a 48 port switch where the design only requires 12 ports, etc...)
# Grab a list of interesting Interface Map IDs. In this case we're interested
# only in interface maps which link hardware to the "AOS-7x10-Leaf" Logical
# Device design element.
# Grab a list of interesting Interface Map IDs. In this case we're
# interested only in interface maps which link hardware to the
# "AOS-7x10-Leaf" Logical Device design element.
data "apstra_interface_maps" "imaps" {
logical_device_id = "AOS-7x10-Leaf"
}
# Loop over the matching Interface Map IDs and grab the full details of those
# objects so that we can inspect them further.
# Loop over the matching Interface Map IDs and grab the full details of
# those objects so that we can inspect them further.
data "apstra_interface_map" "details" {
for_each = data.apstra_interface_maps.imaps.ids
id = each.key
}
# Report stage: Loop over Interface Map objects, and then the interface mappings
# found inside. Filter the mappings for instances where the logical device panel
# and port are null (un-mapped). Output map (dictionary) where the key is
# Interface Map ID, and the value is the count of un-mapped interfaces.
# Report stage: Loop over Interface Map objects, and then the interface
# mappings found inside. Filter the mappings for instances where the logical
# device panel and port are null (un-mapped). Output map (dictionary) where
# the key is Interface Map ID, and the value is the count of un-mapped
# interfaces.
output "unmapped_interface_count" {
value = {
for i in data.apstra_interface_map.details : i.id => length(
Expand All @@ -45,7 +46,7 @@ output "unmapped_interface_count" {
}
}
################################################################################
############################################################################
# The output looks like this:
#
# unmapped_interface_count = {
Expand All @@ -55,7 +56,7 @@ output "unmapped_interface_count" {
# "Juniper_vQFX__AOS-7x10-Leaf" = 5
# "VS_SONiC_BUZZNIK_PLUS__AOS-7x10-Leaf" = 49
# }
################################################################################
############################################################################
```

<!-- schema generated by tfplugindocs -->
Expand Down
8 changes: 4 additions & 4 deletions docs/data-sources/ipv4_pool.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ At least one optional attribute is required. It is incumbent upon the user to en
## Example Usage

```terraform
# The following example shows outputting a report of free space across all IPv4
# resource pools using `apstra_ip4_pools` (to collect pool IDs) and
# The following example shows outputting a report of free space across all
# IPv4 resource pools using `apstra_ip4_pools` (to collect pool IDs) and
# `apstra_ip4_pool` to query for pool details
# List all pool IDs
Expand All @@ -36,7 +36,7 @@ output "ipv4_pool_report" {
}}
}
################################################################################
############################################################################
# The output object above will produce something like the following:
#
# ipv4_pool_report = {
Expand Down Expand Up @@ -66,7 +66,7 @@ output "ipv4_pool_report" {
# }
# }
#
################################################################################
############################################################################
```

<!-- schema generated by tfplugindocs -->
Expand Down
8 changes: 4 additions & 4 deletions docs/data-sources/ipv4_pools.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ This data source returns the ID numbers of all IPv4 Pools
## Example Usage

```terraform
# The following example shows outputting a report of free space across all IPv4
# resource pools using `apstra_ip4_pools` (to collect pool IDs) and
# The following example shows outputting a report of free space across all
# IPv4 resource pools using `apstra_ip4_pools` (to collect pool IDs) and
# `apstra_ip4_pool` to query for pool details
# List all pool IDs
Expand All @@ -33,7 +33,7 @@ output "ipv4_pool_report" {
}}
}
################################################################################
############################################################################
# The output object above will produce something like the following:
#
# ipv4_pool_report = {
Expand Down Expand Up @@ -63,7 +63,7 @@ output "ipv4_pool_report" {
# }
# }
#
################################################################################
############################################################################
```

<!-- schema generated by tfplugindocs -->
Expand Down
8 changes: 4 additions & 4 deletions docs/data-sources/ipv6_pool.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ At least one optional attribute is required. It is incumbent upon the user to en
## Example Usage

```terraform
# The following example shows outputting a report of free space across all IPv6
# resource pools using `apstra_ip4_pools` (to collect pool IDs) and
# The following example shows outputting a report of free space across all
# IPv6 resource pools using `apstra_ip4_pools` (to collect pool IDs) and
# `apstra_ip4_pool` to query for pool details
# List all pool IDs
Expand All @@ -36,7 +36,7 @@ output "ipv6_pool_report" {
}}
}
################################################################################
############################################################################
# The output object above will produce something like the following:
#
# ipv6_pool_report = {
Expand All @@ -46,7 +46,7 @@ output "ipv6_pool_report" {
# }
# }
#
################################################################################
############################################################################
```

<!-- schema generated by tfplugindocs -->
Expand Down
8 changes: 4 additions & 4 deletions docs/data-sources/ipv6_pools.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ This data source returns the ID numbers of all IPv6 Pools
## Example Usage

```terraform
# The following example shows outputting a report of free space across all IPv6
# resource pools using `apstra_ip4_pools` (to collect pool IDs) and
# The following example shows outputting a report of free space across all
# IPv6 resource pools using `apstra_ip4_pools` (to collect pool IDs) and
# `apstra_ip4_pool` to query for pool details
# List all pool IDs
Expand All @@ -33,7 +33,7 @@ output "ipv6_pool_report" {
}}
}
################################################################################
############################################################################
# The output object above will produce something like the following:
#
# ipv6_pool_report = {
Expand All @@ -43,7 +43,7 @@ output "ipv6_pool_report" {
# }
# }
#
################################################################################
############################################################################
```

<!-- schema generated by tfplugindocs -->
Expand Down
10 changes: 5 additions & 5 deletions docs/data-sources/logical_device.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ At least one optional attribute is required. It is incumbent upon the user to en
## Example Usage

```terraform
# The following example shows how a module might accept a Logical Device's name
# as an input variable and then use it to retrieve the Logical Device ID when
# provisioning a Rack Type.
# The following example shows how a module might accept a Logical Device's
# name as an input variable and then use it to retrieve the Logical Device
# ID when provisioning a Rack Type.
# module input variable has the Logical Device name
variable "logical_device_name" {
Expand All @@ -26,8 +26,8 @@ variable "logical_device_name" {
}
# Data lookup using the Logical Device name. Name collisions are possible,
# will produce an error. Apstra permits name collisions for many object types.
# It's probably best to avoid creating them.
# will produce an error. Apstra permits name collisions for many object
# types. It's probably best to avoid creating them.
data "apstra_logical_device" "selected" {
name = var.logical_device_name
}
Expand Down
10 changes: 6 additions & 4 deletions docs/data-sources/property_set.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,14 @@ At least one optional attribute is required.
## Example Usage

```terraform
# The following example shows outputting a report of all the Apstra Property Sets.
# The following example shows outputting a report of all the
#Apstra Property Sets.
# List all Apstra Property Set Ids
data "apstra_property_sets" "all" {}
# Loop over Property Set IDs, creating an instance of `apstra_property_set` for each.
# Loop over Property Set IDs, creating an instance of `apstra_property_set`
# for each.
data "apstra_property_set" "each_ps" {
# for_each = toset(data.apstra_property_sets.all.ids)
//for_each = ["foo", "bar"]
Expand All @@ -36,7 +38,7 @@ output "apstra_property_set_report" {
keys = v.keys
} }
}
################################################################################
############################################################################
# The output object above will produce something like the following:
# apstra_property_set_report = {
# "0a2f4768-7312-4512-b544-f17de1dc155a" = {
Expand Down Expand Up @@ -68,7 +70,7 @@ output "apstra_property_set_report" {
# "name" = "MUST_SNMP_D42"
# }
# }
################################################################################
############################################################################
```

<!-- schema generated by tfplugindocs -->
Expand Down
Loading

0 comments on commit 1c537cd

Please sign in to comment.