Skip to content

Commit

Permalink
[minor_change] Migration of the data source aci_system into plugin fr…
Browse files Browse the repository at this point in the history
…amework
  • Loading branch information
shrsr authored and lhercot committed Sep 6, 2024
1 parent 3b34aed commit 9465913
Show file tree
Hide file tree
Showing 13 changed files with 1,015 additions and 547 deletions.
411 changes: 0 additions & 411 deletions aci/data_source_aci_topsystem.go

This file was deleted.

1 change: 0 additions & 1 deletion aci/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,6 @@ func Provider() *schema.Provider {
"aci_l2_outside": dataSourceAciL2Outside(),
"aci_node_mgmt_epg": dataSourceAciNodeManagementEPg(),
"aci_connection": dataSourceAciConnection(),
"aci_system": dataSourceAciSystem(),
"aci_l3out_bgp_external_policy": dataSourceAciL3outBgpExternalPolicy(),
"aci_l3out_ospf_external_policy": dataSourceAciL3outOspfExternalPolicy(),
"aci_l3out_path_attachment": dataSourceAciL3outPathAttachment(),
Expand Down
131 changes: 75 additions & 56 deletions docs/data-sources/system.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,69 +7,88 @@ description: |-
Data source for ACI System
---

# aci_system
# aci_system #

Data source for ACI System

## Example Usage
## API Information ##

* Class: [topSystem](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/topSystem/overview)

* Supported in ACI versions: 1.0(1e) and later.

* Distinguished Name Formats:
- `topology/pod-{id}/node-{id}/sys`

## GUI Information ##

* Location: `Generic`

## Example Usage ##

```hcl
data "aci_system" "example" {
pod_id = "1"
pod_id = "1"
system_id = "1"
}
```

## Argument Reference

- `system_id` - (Required) Unique system ID.
- `pod_id` - (Required) POD Idenitfier.

## Attribute Reference

- `id` - Attribute id set to the Dn of the system.
- `address` - (Optional) The IP address of the system.
- `etep_addr` - (Optional) The External TEP IP address of this PoD.
- `name_alias` - (Optional) Name alias of the system.
- `node_type`- (Optional) Role of this system.
- `remote_network_id`- (Optional) Remote Network ID.
- `remote_node` - (Optional) Remote system.
- `rldirect_mode` - (Optional) Remote Leaf Direct Mode.
- `role` - (Optional) The system role type.
- `server_type` - (Optional) Type of server.
- `bootstrap_state` - (Optional) Bootstrap state of this system.
- `child_action` - (Optional) Delete or ignore. For internal use only.
- `config_issues` - (Optional) Bitmask representation of the configuration issues found during the endpoint group deployment.
- `control_plane_mtu` - (Optional) MTU for control plane (SUP-originated) packets.
- `current_time` - (Optional) The current time on this system.
- `enforce_subnet_check` - (Optional) Enforce subnet check on all VRFs.
- `fabric_domain` - (Optional) Fabric domain of this node.
- `fabric_id` - (Optional) The latest system health score. Use the navigation bar at the top right of the table to select which health level to view.
- `fabric_mac` - (Optional) MAC address of fabric.
- `inb_mgmt_addr` - (Optional) The in-band management IPv4 address.
- `inb_mgmt_addr6` - (Optional) In-band management IPv6 address.
- `inb_mgmt_addr6_mask` - (Optional) In-band management IPv6 address Mask.
- `inb_mgmt_addr_mask` - (Optional) In-band management IP address Mask.
- `inb_mgmt_addr_gateway` - (Optional) In-band management IP Gateway.
- `inb_mgmt_addr_gateway6` - (Optional) In-band management IPv6 Gateway.
- `last_reset_reason`- (Optional) Last reset reason for this system.
- `lc_own` - (Optional) A value that indicates how this object was created. For internal use only.
- `mod_ts` - (Optional) The time when this object was last modified.
- `mode` - (Optional) Specifies if this system is configured in standalone mode or HA pair.
- `mon_pol_dn` - (Optional) The monitoring policy attached to this observable object.
- `name` - (Optional) The system name.
- `oob_mgmt_addr` - (Optional) The out-of-band management IPv4 address.
- `oob_mgmt_addr6` - (Optional) The out-of-band management IPv6 address.
- `oob_mgmt_addr6_mask` - (Optional) The out-of-band management IPv6 address Mask.
- `oob_mgmt_addr_mask` - (Optional) The out-of-band management IP address Mask.
- `oob_mgmt_gateway` - (Optional) Out-of-band management IP Gateway.
- `oob_mgmt_gateway6` - (Optional) Out-of-band management IPv6 Gateway
- `rl_oper_pod_id` - (Optional) Operational POD Idenitfier for RL Pod Redundancy.
- `rl_routable_mode` - (Optional) Is Remote-Leaf Routable.
- `serial` - (Optional) Serial Number of the system.
- `state` - (Optional) Operational state of this system.
- `system_uptime` - (Optional) The time (in seconds) since the system was booted.
- `tep_pool` - (Optional) Tep-Pool for this system
- `unicast_xr_ep_learn_disable` - (Optional) Disable xrLeanrs.
- `version` - (Optional) The version of the compatibility catalog.
- `virtual_mode` - (Optional) Virtual mode of system.
## Schema ##

### Required ###

* `system_id` (id) - (string) The identifier of the system object.
* `pod_id` (podId) - (string) The pod identifier.

### Read-Only ###

* `id` - (string) The distinguished name (DN) of the system object.
* `address` (address) - (string) The IP address of the system.
* `bootstrap_state` (bootstrapState) - (string) Bootstrap state of this system.
* `cluster_time_diff` (clusterTimeDiff) - (string) Difference in cluster time from local time for this system.
* `control_plane_mtu` (controlPlaneMTU) - (string) MTU for control plane (SUP-originated) packets.
* `current_time` (currentTime) - (string) The current time on this system.
* `enforce_subnet_check` (enforceSubnetCheck) - (string) Enforce subnet check on all VRFs.
* `external_tep_address` (etepAddr) - (string) The external TEP IP address of this pod.
* `fabric_domain` (fabricDomain) - (string) Fabric domain of this node.
* `fabric_id` (fabricId) - (string) The latest system health score.
* `fabric_mac` (fabricMAC) - (string) The MAC address of the fabric.
* `inband_management_address` (inbMgmtAddr) - (string) The In-band management IPv4 address.
* `inband_management_address_ipv6` (inbMgmtAddr6) - (string) The In-band management IPv6 address.
* `inband_management_address_mask_ipv6` (inbMgmtAddr6Mask) - (string) The In-band management IPv6 address subnet mask.
* `inband_management_address_mask` (inbMgmtAddrMask) - (string) The In-band management IPv4 address subnet mask.
* `inband_management_gateway` (inbMgmtGateway) - (string) The In-band management IPv4 gateway address.
* `inband_management_gateway_ipv6` (inbMgmtGateway6) - (string) The In-band management IPv6 gateway address.
* `last_reboot_time` (lastRebootTime) - (string) The last reboot time for this system.
* `last_reset_reason` (lastResetReason) - (string) The last reset reason for this system.
* `mod_ts` (modTs) - (string) The time when this object was last modified.
* `mode` (mode) - (string) Specifies if this system is configured in standalone mode or HA pair.
* `monitoring_policy_dn` (monPolDn) - (string) The monitoring policy attached to this observable object.
* `name` (name) - (string) The name of the system object.
* `name_alias` (nameAlias) - (string) The name alias of the system object.
* `node_type` (nodeType) - (string) The role of this system.
* `out_of_band_management_address` (oobMgmtAddr) - (string) The Out-of-band management IPv4 address.
* `out_of_band_management_address_ipv6` (oobMgmtAddr6) - (string) The Out-of-band management IPv6 address.
* `out_of_band_management_address_mask_ipv6` (oobMgmtAddr6Mask) - (string) The Out-of-band management IPv6 address subnet mask.
* `out_of_band_management_address_mask` (oobMgmtAddrMask) - (string) The Out-of-band management IPv4 address subnet mask.
* `out_of_band_management_gateway` (oobMgmtGateway) - (string) The Out-of-band management IPv4 gateway address.
* `out_of_band_management_gateway_ipv6` (oobMgmtGateway6) - (string) The Out-of-band management IPv6 gateway address.
* `remote_network_id` (remoteNetworkId) - (string) The remote network ID.
* `remote_node` (remoteNode) - (string) The remote system.
* `remote_leaf_auto_mode` (rlAutoMode) - (string) The remote leaf auto mode.
* `remote_leaf_group_id` (rlGroupId) - (string) The remote leaf site identifier.
* `remote_leaf_operational_pod_id` (rlOperPodId) - (string) The operational pod identifier for RL pod redundancy.
* `remote_leaf_routable_mode` (rlRoutableMode) - (string) Indicates whether the remote leaf is using a routable TEP IP address.
* `remote_leaf_direct_mode` (rldirectMode) - (string) The remote leaf direct mode.
* `role` (role) - (string) The system role type.
* `serial` (serial) - (string) The serial number of the system.
* `server_type` (serverType) - (string) DHCP server type.
* `site_id` (siteId) - (string) The site identifier.
* `state` (state) - (string) The operational state of this system.
* `system_uptime` (systemUpTime) - (string) The time (in seconds) since the system was booted.
* `tep_pool` (tepPool) - (string) The pool of TEP IP addresses allocated for this system.
* `unicast_xr_endpoint_learn_disable` (unicastXrEpLearnDisable) - (string) Indicates whether the learning of unicast endpoints for external routing is disabled.
* `version` (version) - (string) The version for this system.
* `virtual_mode` (virtualMode) - (string) The virtual mode of this system.
5 changes: 5 additions & 0 deletions examples/data-sources/aci_system/data-source.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@

data "aci_system" "example" {
pod_id = "1"
system_id = "1"
}
14 changes: 14 additions & 0 deletions examples/data-sources/aci_system/provider.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
terraform {
required_providers {
aci = {
source = "ciscodevnet/aci"
}
}
}

provider "aci" {
username = ""
password = ""
url = ""
insecure = true
}
5 changes: 5 additions & 0 deletions gen/definitions/classes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -615,3 +615,8 @@ l3extRsLblToProfile:
- "uni/tn-{name}/out-{name}/conslbl-{name}/rslblToProfile-[{tDn}]-{direction}"
resource_notes:
- "This resource should not be used in combination with the `l3out_consumer_label` nested attributes of other resources for the same object. Doing so will result in unexpected behaviour."

topSystem:
sub_category: "Fabric Inventory"
dn_formats:
- "topology/pod-{id}/node-{id}/sys"
115 changes: 115 additions & 0 deletions gen/definitions/properties.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1034,3 +1034,118 @@ l3extRsLblToProfile:
properties:
name: "rt_ctrl_profile_1"
static: true

topSystem:
overwrites:
id: "system_id"
podId: "pod_id"
etep_addr: "external_tep_address"
inb_mgmt_addr: "inband_management_address"
inb_mgmt_addr6: "inband_management_address_ipv6"
inb_mgmt_addr6_mask: "inband_management_address_mask_ipv6"
inb_mgmt_addr_mask: "inband_management_address_mask"
inb_mgmt_gateway: "inband_management_gateway"
inb_mgmt_gateway6: "inband_management_gateway_ipv6"
oob_mgmt_addr: "out_of_band_management_address"
oob_mgmt_addr6: "out_of_band_management_address_ipv6"
oob_mgmt_addr6_mask: "out_of_band_management_address_mask_ipv6"
oob_mgmt_addr_mask: "out_of_band_management_address_mask"
oob_mgmt_gateway: "out_of_band_management_gateway"
oob_mgmt_gateway6: "out_of_band_management_gateway_ipv6"
rl_auto_mode: "remote_leaf_auto_mode"
rl_group_id: "remote_leaf_group_id"
rl_oper_pod_id: "remote_leaf_operational_pod_id"
rl_routable_mode: "remote_leaf_routable_mode"
rldirect_mode: "remote_leaf_direct_mode"
mon_pol_dn: "monitoring_policy_dn"
system_up_time: "system_uptime"
unicast_xr_ep_learn_disable: "unicast_xr_endpoint_learn_disable"
datasource_required:
- "system_id"
- "pod_id"
read_only_properties:
- "address"
- "bootstrapState"
- "clusterTimeDiff"
- "controlPlaneMTU"
- "currentTime"
- "enforceSubnetCheck"
- "etepAddr"
- "fabricDomain"
- "fabricId"
- "fabricMAC"
- "inbMgmtAddr"
- "inbMgmtAddr6"
- "inbMgmtAddr6Mask"
- "inbMgmtAddrMask"
- "inbMgmtGateway"
- "inbMgmtGateway6"
- "lastRebootTime"
- "lastResetReason"
- "modTs"
- "mode"
- "monPolDn"
- "name"
- "nameAlias"
- "nodeType"
- "oobMgmtAddr"
- "oobMgmtAddr6"
- "oobMgmtAddr6Mask"
- "oobMgmtAddrMask"
- "oobMgmtGateway"
- "oobMgmtGateway6"
- "remoteNetworkId"
- "remoteNode"
- "rlAutoMode"
- "rlGroupId"
- "rlOperPodId"
- "rlRoutableMode"
- "rldirectMode"
- "role"
- "serial"
- "serverType"
- "siteId"
- "state"
- "systemUpTime"
- "tepPool"
- "unicastXrEpLearnDisable"
- "version"
- "virtualMode"
documentation:
id: "The identifier of the system object."
podId: "The pod identifier."
etepAddr: "The external TEP IP address of this pod."
fabricId: "The latest system health score."
fabricMAC: "The MAC address of the fabric."
inbMgmtAddr: "The In-band management IPv4 address."
inbMgmtAddr6: "The In-band management IPv6 address."
inbMgmtAddr6Mask: "The In-band management IPv6 address subnet mask."
inbMgmtAddrMask: "The In-band management IPv4 address subnet mask."
inbMgmtGateway: "The In-band management IPv4 gateway address."
inbMgmtGateway6: "The In-band management IPv6 gateway address."
lastRebootTime: "The last reboot time for this system."
lastResetReason: "The last reset reason for this system."
name: "The name of the system object."
nameAlias: "The name alias of the system object."
nodeType: "The role of this system."
oobMgmtAddr: "The Out-of-band management IPv4 address."
oobMgmtAddr6: "The Out-of-band management IPv6 address."
oobMgmtAddr6Mask: "The Out-of-band management IPv6 address subnet mask."
oobMgmtAddrMask: "The Out-of-band management IPv4 address subnet mask."
oobMgmtGateway: "The Out-of-band management IPv4 gateway address."
oobMgmtGateway6: "The Out-of-band management IPv6 gateway address."
remoteNetworkId: "The remote network ID."
remoteNode: "The remote system."
rlAutoMode: "The remote leaf auto mode."
rlGroupId: "The remote leaf site identifier."
rlOperPodId: "The operational pod identifier for RL pod redundancy."
rlRoutableMode: "Indicates whether the remote leaf is using a routable TEP IP address."
rldirectMode: "The remote leaf direct mode."
serial: "The serial number of the system."
serverType: "DHCP server type."
siteId: "The site identifier."
state: "The operational state of this system."
tepPool: "The pool of TEP IP addresses allocated for this system."
unicastXrEpLearnDisable: "Indicates whether the learning of unicast endpoints for external routing is disabled."
version: "The version for this system."
virtualMode: "The virtual mode of this system."
7 changes: 3 additions & 4 deletions gen/generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -587,17 +587,16 @@ func migrateLegacyDocumentation() {
// Container function to clean all directories properly
func cleanDirectories() {
cleanDirectory(docsPath, []string{"resources", "data-sources"})
cleanDirectory(providerPath, []string{"provider_test.go", "utils.go", "test_constants.go", "resource_aci_rest_managed.go", "resource_aci_rest_managed_test.go", "data_source_aci_rest_managed.go", "data_source_aci_rest_managed_test.go", "annotation_unsupported.go"})
cleanDirectory(providerPath, []string{"provider_test.go", "utils.go", "test_constants.go", "resource_aci_rest_managed.go", "resource_aci_rest_managed_test.go", "data_source_aci_rest_managed.go", "data_source_aci_rest_managed_test.go", "annotation_unsupported.go", "data_source_aci_system.go", "data_source_aci_system_test.go"})
cleanDirectory(resourcesDocsPath, []string{})
cleanDirectory(datasourcesDocsPath, []string{})
cleanDirectory(datasourcesDocsPath, []string{"system.md"})
cleanDirectory(testVarsPath, []string{})

// The *ExamplesPath directories are removed and recreated to ensure all previously rendered files are removed
// The provider example file is not removed because it contains static provider configuration
os.RemoveAll(resourcesExamplesPath)
os.Mkdir(resourcesExamplesPath, 0755)
os.RemoveAll(datasourcesExamplesPath)
os.Mkdir(datasourcesExamplesPath, 0755)
cleanDirectory(datasourcesExamplesPath, []string{"aci_system"})

// Migrate legacy documentation directory ( /website/docs ) format ( .html.markdown ) to new documentation directory ( /docs ) and format ( .md )
migrateLegacyDocumentation()
Expand Down
1 change: 1 addition & 0 deletions gen/templates/provider.go.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ func (p *AciProvider) DataSources(ctx context.Context) []func() datasource.DataS
{{- end }}
{{- end }}
NewAciRestManagedDataSource,
NewTopSystemDataSource,
}
}

Expand Down
Loading

0 comments on commit 9465913

Please sign in to comment.