Skip to content

Commit 2105ca2

Browse files
S5 dev (#360)
sprint5 resources are added
1 parent 41f09d9 commit 2105ca2

File tree

112 files changed

+8337
-688
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

112 files changed

+8337
-688
lines changed

aci/data_source_aci_bfdifp.go

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
package aci
2+
3+
import (
4+
"fmt"
5+
6+
"github.com/ciscoecosystem/aci-go-client/client"
7+
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
8+
)
9+
10+
func dataSourceAciBFDInterfaceProfile() *schema.Resource {
11+
return &schema.Resource{
12+
13+
Read: dataSourceAciBFDInterfaceProfileRead,
14+
15+
SchemaVersion: 1,
16+
17+
Schema: AppendBaseAttrSchema(map[string]*schema.Schema{
18+
"logical_interface_profile_dn": &schema.Schema{
19+
Type: schema.TypeString,
20+
Required: true,
21+
},
22+
23+
"annotation": &schema.Schema{
24+
Type: schema.TypeString,
25+
Optional: true,
26+
Computed: true,
27+
},
28+
29+
"key": &schema.Schema{
30+
Type: schema.TypeString,
31+
Optional: true,
32+
Computed: true,
33+
},
34+
35+
"key_id": &schema.Schema{
36+
Type: schema.TypeString,
37+
Optional: true,
38+
Computed: true,
39+
},
40+
41+
"name_alias": &schema.Schema{
42+
Type: schema.TypeString,
43+
Optional: true,
44+
Computed: true,
45+
},
46+
47+
"interface_profile_type": &schema.Schema{
48+
Type: schema.TypeString,
49+
Optional: true,
50+
Computed: true,
51+
},
52+
}),
53+
}
54+
}
55+
56+
func dataSourceAciBFDInterfaceProfileRead(d *schema.ResourceData, m interface{}) error {
57+
aciClient := m.(*client.Client)
58+
59+
rn := fmt.Sprintf("bfdIfP")
60+
LogicalInterfaceProfileDn := d.Get("logical_interface_profile_dn").(string)
61+
62+
dn := fmt.Sprintf("%s/%s", LogicalInterfaceProfileDn, rn)
63+
64+
bfdIfP, err := getRemoteBFDInterfaceProfile(aciClient, dn)
65+
66+
if err != nil {
67+
return err
68+
}
69+
70+
d.SetId(dn)
71+
setBFDInterfaceProfileAttributes(bfdIfP, d)
72+
return nil
73+
}

aci/data_source_aci_bgpprotp.go

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
package aci
2+
3+
import (
4+
"fmt"
5+
"github.com/ciscoecosystem/aci-go-client/client"
6+
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
7+
)
8+
9+
func dataSourceAciL3outBGPProtocolProfile() *schema.Resource {
10+
return &schema.Resource{
11+
12+
Read: dataSourceAciL3outBGPProtocolProfileRead,
13+
14+
SchemaVersion: 1,
15+
16+
Schema: AppendBaseAttrSchema(map[string]*schema.Schema{
17+
"logical_node_profile_dn": &schema.Schema{
18+
Type: schema.TypeString,
19+
Required: true,
20+
},
21+
22+
"annotation": &schema.Schema{
23+
Type: schema.TypeString,
24+
Optional: true,
25+
Computed: true,
26+
},
27+
28+
"name_alias": &schema.Schema{
29+
Type: schema.TypeString,
30+
Optional: true,
31+
Computed: true,
32+
},
33+
}),
34+
}
35+
}
36+
37+
func dataSourceAciL3outBGPProtocolProfileRead(d *schema.ResourceData, m interface{}) error {
38+
aciClient := m.(*client.Client)
39+
40+
rn := fmt.Sprintf("protp")
41+
LogicalNodeProfileDn := d.Get("logical_node_profile_dn").(string)
42+
43+
dn := fmt.Sprintf("%s/%s", LogicalNodeProfileDn, rn)
44+
45+
bgpProtP, err := getRemoteL3outBGPProtocolProfile(aciClient, dn)
46+
47+
if err != nil {
48+
return err
49+
}
50+
d.SetId(dn)
51+
setL3outBGPProtocolProfileAttributes(bgpProtP, d)
52+
return nil
53+
}

aci/data_source_aci_hsrpsecvip.go

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
package aci
2+
3+
import (
4+
"fmt"
5+
6+
"github.com/ciscoecosystem/aci-go-client/client"
7+
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
8+
)
9+
10+
func dataSourceAciL3outHSRPSecondaryVIP() *schema.Resource {
11+
return &schema.Resource{
12+
13+
Read: dataSourceAciL3outHSRPSecondaryVIPRead,
14+
15+
SchemaVersion: 1,
16+
17+
Schema: AppendBaseAttrSchema(map[string]*schema.Schema{
18+
"l3out_hsrp_interface_group_dn": &schema.Schema{
19+
Type: schema.TypeString,
20+
Required: true,
21+
},
22+
23+
"ip": &schema.Schema{
24+
Type: schema.TypeString,
25+
Required: true,
26+
},
27+
28+
"annotation": &schema.Schema{
29+
Type: schema.TypeString,
30+
Optional: true,
31+
Computed: true,
32+
},
33+
34+
"config_issues": &schema.Schema{
35+
Type: schema.TypeString,
36+
Optional: true,
37+
Computed: true,
38+
},
39+
40+
"name_alias": &schema.Schema{
41+
Type: schema.TypeString,
42+
Optional: true,
43+
Computed: true,
44+
},
45+
}),
46+
}
47+
}
48+
49+
func dataSourceAciL3outHSRPSecondaryVIPRead(d *schema.ResourceData, m interface{}) error {
50+
aciClient := m.(*client.Client)
51+
52+
ip := d.Get("ip").(string)
53+
54+
rn := fmt.Sprintf("hsrpSecVip-[%s]", ip)
55+
HSRPGroupProfileDn := d.Get("l3out_hsrp_interface_group_dn").(string)
56+
57+
dn := fmt.Sprintf("%s/%s", HSRPGroupProfileDn, rn)
58+
59+
hsrpSecVip, err := getRemoteL3outHSRPSecondaryVIP(aciClient, dn)
60+
61+
if err != nil {
62+
return err
63+
}
64+
d.SetId(dn)
65+
setL3outHSRPSecondaryVIPAttributes(hsrpSecVip, d)
66+
return nil
67+
}

aci/data_source_aci_ipnexthopp.go

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
package aci
2+
3+
import (
4+
"fmt"
5+
6+
"github.com/ciscoecosystem/aci-go-client/client"
7+
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
8+
)
9+
10+
func dataSourceAciL3outStaticRouteNextHop() *schema.Resource {
11+
return &schema.Resource{
12+
13+
Read: dataSourceAciL3outStaticRouteNextHopRead,
14+
15+
SchemaVersion: 1,
16+
17+
Schema: AppendBaseAttrSchema(map[string]*schema.Schema{
18+
"static_route_dn": &schema.Schema{
19+
Type: schema.TypeString,
20+
Required: true,
21+
},
22+
23+
"nh_addr": &schema.Schema{
24+
Type: schema.TypeString,
25+
Required: true,
26+
},
27+
28+
"annotation": &schema.Schema{
29+
Type: schema.TypeString,
30+
Optional: true,
31+
Computed: true,
32+
},
33+
34+
"name_alias": &schema.Schema{
35+
Type: schema.TypeString,
36+
Optional: true,
37+
Computed: true,
38+
},
39+
40+
"pref": &schema.Schema{
41+
Type: schema.TypeString,
42+
Optional: true,
43+
Computed: true,
44+
},
45+
46+
"nexthop_profile_type": &schema.Schema{
47+
Type: schema.TypeString,
48+
Optional: true,
49+
Computed: true,
50+
},
51+
}),
52+
}
53+
}
54+
55+
func dataSourceAciL3outStaticRouteNextHopRead(d *schema.ResourceData, m interface{}) error {
56+
aciClient := m.(*client.Client)
57+
58+
nhAddr := d.Get("nh_addr").(string)
59+
60+
rn := fmt.Sprintf("nh-[%s]", nhAddr)
61+
StaticRouteDn := d.Get("static_route_dn").(string)
62+
63+
dn := fmt.Sprintf("%s/%s", StaticRouteDn, rn)
64+
65+
ipNexthopP, err := getRemoteL3outStaticRouteNextHop(aciClient, dn)
66+
67+
if err != nil {
68+
return err
69+
}
70+
d.SetId(dn)
71+
setL3outStaticRouteNextHopAttributes(ipNexthopP, d)
72+
return nil
73+
}

aci/data_source_aci_iproutep.go

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
package aci
2+
3+
import (
4+
"fmt"
5+
6+
"github.com/ciscoecosystem/aci-go-client/client"
7+
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
8+
)
9+
10+
func dataSourceAciL3outStaticRoute() *schema.Resource {
11+
return &schema.Resource{
12+
13+
Read: dataSourceAciL3outStaticRouteRead,
14+
15+
SchemaVersion: 1,
16+
17+
Schema: AppendBaseAttrSchema(map[string]*schema.Schema{
18+
"fabric_node_dn": &schema.Schema{
19+
Type: schema.TypeString,
20+
Required: true,
21+
},
22+
23+
"ip": &schema.Schema{
24+
Type: schema.TypeString,
25+
Required: true,
26+
},
27+
28+
"aggregate": &schema.Schema{
29+
Type: schema.TypeString,
30+
Optional: true,
31+
Computed: true,
32+
},
33+
34+
"annotation": &schema.Schema{
35+
Type: schema.TypeString,
36+
Optional: true,
37+
Computed: true,
38+
},
39+
40+
"name_alias": &schema.Schema{
41+
Type: schema.TypeString,
42+
Optional: true,
43+
Computed: true,
44+
},
45+
46+
"pref": &schema.Schema{
47+
Type: schema.TypeString,
48+
Optional: true,
49+
Computed: true,
50+
},
51+
52+
"rt_ctrl": &schema.Schema{
53+
Type: schema.TypeString,
54+
Optional: true,
55+
Computed: true,
56+
},
57+
}),
58+
}
59+
}
60+
61+
func dataSourceAciL3outStaticRouteRead(d *schema.ResourceData, m interface{}) error {
62+
aciClient := m.(*client.Client)
63+
64+
ip := d.Get("ip").(string)
65+
66+
rn := fmt.Sprintf("rt-[%s]", ip)
67+
FabricNodeDn := d.Get("fabric_node_dn").(string)
68+
69+
dn := fmt.Sprintf("%s/%s", FabricNodeDn, rn)
70+
71+
ipRouteP, err := getRemoteL3outStaticRoute(aciClient, dn)
72+
73+
if err != nil {
74+
return err
75+
}
76+
d.SetId(dn)
77+
setL3outStaticRouteAttributes(ipRouteP, d)
78+
return nil
79+
}

0 commit comments

Comments
 (0)