Skip to content

Commit 32f6c35

Browse files
qzxlhercot
authored andcommitted
Expand fabricpath to include support for vPC
1 parent 474f611 commit 32f6c35

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

aci/data_source_aci_fabricpathep.go

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@ func dataSourceAciFabricPathEndpoint() *schema.Resource {
1616
SchemaVersion: 1,
1717

1818
Schema: AppendBaseAttrSchema(map[string]*schema.Schema{
19+
"vpc": &schema.Schema{
20+
Type: schema.TypeBool,
21+
Optional: true,
22+
Default: false,
23+
},
24+
1925
"pod_id": &schema.Schema{
2026
Type: schema.TypeString,
2127
Required: true,
@@ -62,11 +68,18 @@ func setFabricPathEndpointAttributes(fabricPathEp *models.FabricPathEndpoint, d
6268
func dataSourceAciFabricPathEndpointRead(d *schema.ResourceData, m interface{}) error {
6369
aciClient := m.(*client.Client)
6470

71+
vpc := d.Get("vpc").(bool)
6572
name := d.Get("name").(string)
6673
podID := d.Get("pod_id").(string)
6774
nodeID := d.Get("node_id").(string)
6875

69-
pDN := fmt.Sprintf("topology/pod-%s/paths-%s", podID, nodeID)
76+
var pDN string
77+
78+
if vpc {
79+
pDN = fmt.Sprintf("topology/pod-%s/protpaths-%s", podID, nodeID)
80+
} else {
81+
pDN = fmt.Sprintf("topology/pod-%s/paths-%s", podID, nodeID)
82+
}
7083

7184
rn := fmt.Sprintf("pathep-[%s]", name)
7285

website/docs/d/fabric_path_ep.html.markdown

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,20 @@ data "aci_fabric_path_ep" "example" {
1919
name = "eth1/7"
2020
}
2121
22+
data "aci_fabric_path_ep" "vpc_example" {
23+
vpc = true
24+
pod_id = "1"
25+
node_id = "101-102"
26+
name = aci_leaf_access_bundle_policy_group.example.name
27+
}
28+
2229
```
2330

2431
## Argument Reference ##
2532
* `pod_id` - (Required) pod ID for Object fabric path endpoint.
2633
* `node_id` - (Required) node ID for Object fabric path endpoint.
2734
* `name` - (Required) name of Object fabric path endpoint.
35+
* `vpc` - (Optional) Boolean, set to true if path is for a vPC interface
2836

2937

3038

0 commit comments

Comments
 (0)