Skip to content

Commit a912fa4

Browse files
anvitha-jainlhercot
authored andcommitted
Updated with newer version of aci-go-client
1 parent 5c0471e commit a912fa4

19 files changed

+1438
-701
lines changed

aci/data_source_aci_vmmctrlrp.go

Lines changed: 25 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -9,127 +9,101 @@ import (
99

1010
func dataSourceAciVMMController() *schema.Resource {
1111
return &schema.Resource{
12-
13-
Read: dataSourceAciVMMControllerRead,
14-
12+
Read: dataSourceAciVMMControllerRead,
1513
SchemaVersion: 1,
16-
17-
Schema: AppendBaseAttrSchema(map[string]*schema.Schema{
18-
"vmm_domain_dn": &schema.Schema{
14+
Schema: AppendBaseAttrSchema(AppendNameAliasAttrSchema(map[string]*schema.Schema{
15+
"vmm_domain_dn": {
1916
Type: schema.TypeString,
2017
Required: true,
2118
},
22-
23-
"name": &schema.Schema{
24-
Type: schema.TypeString,
25-
Required: true,
26-
},
27-
28-
"annotation": &schema.Schema{
19+
"annotation": {
2920
Type: schema.TypeString,
3021
Optional: true,
3122
Computed: true,
3223
},
33-
34-
"dvs_version": &schema.Schema{
24+
"dvs_version": {
3525
Type: schema.TypeString,
3626
Optional: true,
3727
Computed: true,
3828
},
39-
40-
"host_or_ip": &schema.Schema{
29+
"host_or_ip": {
4130
Type: schema.TypeString,
4231
Optional: true,
4332
Computed: true,
4433
},
45-
46-
"inventory_trig_st": &schema.Schema{
34+
"inventory_trig_st": {
4735
Type: schema.TypeString,
4836
Optional: true,
4937
Computed: true,
5038
},
51-
52-
"mode": &schema.Schema{
39+
"mode": {
5340
Type: schema.TypeString,
5441
Optional: true,
5542
Computed: true,
5643
},
57-
58-
"msft_config_err_msg": &schema.Schema{
44+
"msft_config_err_msg": {
5945
Type: schema.TypeString,
6046
Optional: true,
6147
Computed: true,
6248
},
63-
64-
"msft_config_issues": &schema.Schema{
65-
Type: schema.TypeString,
49+
"msft_config_issues": {
50+
Type: schema.TypeList,
6651
Optional: true,
6752
Computed: true,
53+
Elem: &schema.Schema{
54+
Type: schema.TypeString,
55+
},
6856
},
69-
70-
"n1kv_stats_mode": &schema.Schema{
57+
"n1kv_stats_mode": {
7158
Type: schema.TypeString,
7259
Optional: true,
7360
Computed: true,
7461
},
75-
76-
"name_alias": &schema.Schema{
62+
"name": {
7763
Type: schema.TypeString,
78-
Optional: true,
79-
Computed: true,
64+
Required: true,
8065
},
81-
82-
"port": &schema.Schema{
66+
"port": {
8367
Type: schema.TypeString,
8468
Optional: true,
8569
Computed: true,
8670
},
87-
88-
"root_cont_name": &schema.Schema{
71+
"root_cont_name": {
8972
Type: schema.TypeString,
9073
Optional: true,
9174
Computed: true,
9275
},
93-
94-
"scope": &schema.Schema{
76+
"scope": {
9577
Type: schema.TypeString,
9678
Optional: true,
9779
Computed: true,
9880
},
99-
100-
"seq_num": &schema.Schema{
81+
"seq_num": {
10182
Type: schema.TypeString,
10283
Optional: true,
10384
Computed: true,
10485
},
105-
106-
"stats_mode": &schema.Schema{
86+
"stats_mode": {
10787
Type: schema.TypeString,
10888
Optional: true,
10989
Computed: true,
11090
},
111-
112-
"vxlan_depl_pref": &schema.Schema{
91+
"vxlan_depl_pref": {
11392
Type: schema.TypeString,
11493
Optional: true,
11594
Computed: true,
11695
},
117-
}),
96+
})),
11897
}
11998
}
12099

121100
func dataSourceAciVMMControllerRead(d *schema.ResourceData, m interface{}) error {
122101
aciClient := m.(*client.Client)
123-
124102
name := d.Get("name").(string)
125-
126-
rn := fmt.Sprintf("ctrlr-%s", name)
127103
VMMDomainDn := d.Get("vmm_domain_dn").(string)
128-
104+
rn := fmt.Sprintf("ctrlr-%s", name)
129105
dn := fmt.Sprintf("%s/%s", VMMDomainDn, rn)
130-
131106
vmmCtrlrP, err := getRemoteVMMController(aciClient, dn)
132-
133107
if err != nil {
134108
return err
135109
}

aci/data_source_aci_vmmusraccp.go

Lines changed: 14 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,86 +1,51 @@
11
package aci
22

3-
43
import (
54
"fmt"
5+
66
"github.com/ciscoecosystem/aci-go-client/client"
77
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
88
)
99

1010
func dataSourceAciVMMCredential() *schema.Resource {
1111
return &schema.Resource{
12-
13-
Read: dataSourceAciVMMCredentialRead,
14-
12+
Read: dataSourceAciVMMCredentialRead,
1513
SchemaVersion: 1,
16-
17-
Schema: AppendBaseAttrSchema(map[string]*schema.Schema{
18-
"vmm_domain_dn": &schema.Schema{
14+
Schema: AppendBaseAttrSchema(AppendNameAliasAttrSchema(map[string]*schema.Schema{
15+
"vmm_domain_dn": {
1916
Type: schema.TypeString,
2017
Required: true,
2118
},
22-
23-
24-
"name": &schema.Schema{
25-
Type: schema.TypeString,
26-
Required: true,
27-
},
28-
29-
30-
31-
32-
"annotation": &schema.Schema{
19+
"annotation": {
3320
Type: schema.TypeString,
3421
Optional: true,
3522
Computed: true,
3623
},
37-
38-
39-
40-
"name_alias": &schema.Schema{
24+
"name": {
4125
Type: schema.TypeString,
42-
Optional: true,
43-
Computed: true,
26+
Required: true,
4427
},
45-
46-
47-
48-
"pwd": &schema.Schema{
28+
"pwd": {
4929
Type: schema.TypeString,
5030
Optional: true,
5131
Computed: true,
5232
},
53-
54-
55-
56-
"usr": &schema.Schema{
33+
"usr": {
5734
Type: schema.TypeString,
5835
Optional: true,
5936
Computed: true,
6037
},
61-
62-
63-
}),
64-
}
38+
})),
39+
}
6540
}
6641

67-
68-
6942
func dataSourceAciVMMCredentialRead(d *schema.ResourceData, m interface{}) error {
7043
aciClient := m.(*client.Client)
71-
7244
name := d.Get("name").(string)
73-
74-
75-
rn := fmt.Sprintf("usracc-%s",name)
76-
VMMDomainDn := d.Get("vmm_domain_dn").(string)
77-
78-
dn := fmt.Sprintf("%s/%s",VMMDomainDn,rn)
79-
80-
81-
45+
VMMDomainDn := d.Get("vmm_domain_dn").(string)
46+
rn := fmt.Sprintf("usracc-%s", name)
47+
dn := fmt.Sprintf("%s/%s", VMMDomainDn, rn)
8248
vmmUsrAccP, err := getRemoteVMMCredential(aciClient, dn)
83-
8449
if err != nil {
8550
return err
8651
}

aci/data_source_aci_vmmvswitchpolicycont.go

Lines changed: 6 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -9,42 +9,28 @@ import (
99

1010
func dataSourceAciVSwitchPolicyGroup() *schema.Resource {
1111
return &schema.Resource{
12-
13-
Read: dataSourceAciVSwitchPolicyGroupRead,
14-
12+
Read: dataSourceAciVSwitchPolicyGroupRead,
1513
SchemaVersion: 1,
16-
17-
Schema: AppendBaseAttrSchema(map[string]*schema.Schema{
18-
"vmm_domain_dn": &schema.Schema{
14+
Schema: AppendBaseAttrSchema(AppendNameAliasAttrSchema(map[string]*schema.Schema{
15+
"vmm_domain_dn": {
1916
Type: schema.TypeString,
2017
Required: true,
2118
},
22-
23-
"annotation": &schema.Schema{
19+
"annotation": {
2420
Type: schema.TypeString,
2521
Optional: true,
2622
Computed: true,
2723
},
28-
29-
"name_alias": &schema.Schema{
30-
Type: schema.TypeString,
31-
Optional: true,
32-
Computed: true,
33-
},
34-
}),
24+
})),
3525
}
3626
}
3727

3828
func dataSourceAciVSwitchPolicyGroupRead(d *schema.ResourceData, m interface{}) error {
3929
aciClient := m.(*client.Client)
40-
41-
rn := fmt.Sprintf("vswitchpolcont")
4230
VMMDomainDn := d.Get("vmm_domain_dn").(string)
43-
31+
rn := fmt.Sprintf("vswitchpolcont")
4432
dn := fmt.Sprintf("%s/%s", VMMDomainDn, rn)
45-
4633
vmmVSwitchPolicyCont, err := getRemoteVSwitchPolicyGroup(aciClient, dn)
47-
4834
if err != nil {
4935
return err
5036
}

0 commit comments

Comments
 (0)