Skip to content

Commit 4795c95

Browse files
committed
Updating schema descrption fields. Updated schema key names
1 parent ce53188 commit 4795c95

File tree

1 file changed

+60
-48
lines changed

1 file changed

+60
-48
lines changed

cloudstack/resource_cloudstack_configuration.go

Lines changed: 60 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -38,53 +38,65 @@ func resourceCloudStackConfiguration() *schema.Resource {
3838

3939
Schema: map[string]*schema.Schema{
4040
"name": {
41-
Type: schema.TypeString,
42-
Required: true,
41+
Description: "configuration by name",
42+
Type: schema.TypeString,
43+
Required: true,
4344
},
44-
"accountid": {
45-
Type: schema.TypeString,
46-
Optional: true,
45+
"account_id": {
46+
Description: "the ID of the Account to update the parameter value for corresponding account",
47+
Type: schema.TypeString,
48+
Optional: true,
4749
},
48-
"clusterid": {
49-
Type: schema.TypeString,
50-
Optional: true,
50+
"cluster_id": {
51+
Description: "the ID of the Cluster to update the parameter value for corresponding cluster",
52+
Type: schema.TypeString,
53+
Optional: true,
5154
},
52-
"domainid": {
53-
Type: schema.TypeString,
54-
Optional: true,
55+
"domain_id": {
56+
Description: "the ID of the Domain to update the parameter value for corresponding domain",
57+
Type: schema.TypeString,
58+
Optional: true,
5559
},
56-
"imagestoreuuid": {
57-
Type: schema.TypeString,
58-
Optional: true,
60+
"image_store_uuid": {
61+
Description: "the ID of the Image Store to update the parameter value for corresponding image store",
62+
Type: schema.TypeString,
63+
Optional: true,
5964
},
60-
"storeid": {
61-
Type: schema.TypeString,
62-
Optional: true,
65+
"store_id": {
66+
Description: "the ID of the Storage pool to update the parameter value for corresponding storage pool",
67+
Type: schema.TypeString,
68+
Optional: true,
6369
},
6470
"value": {
65-
Type: schema.TypeString,
66-
Optional: true,
71+
Description: "the value of the configuration",
72+
Type: schema.TypeString,
73+
Optional: true,
6774
},
68-
"zoneid": {
69-
Type: schema.TypeString,
70-
Optional: true,
75+
"zone_id": {
76+
Description: "the ID of the Zone to update the parameter value for corresponding zone",
77+
Type: schema.TypeString,
78+
Optional: true,
7179
},
7280
// computed
7381
"category": {
74-
Type: schema.TypeString,
75-
Computed: true,
82+
Description: "configurations by category",
83+
Type: schema.TypeString,
84+
Computed: true,
7685
},
7786
"description": {
78-
Type: schema.TypeString,
79-
Computed: true,
87+
Description: "the description of the configuration",
88+
Type: schema.TypeString,
89+
Computed: true,
8090
},
8191
"is_dynamic": {
82-
Type: schema.TypeBool,
83-
Computed: true,
92+
Description: "true if the configuration is dynamic",
93+
Type: schema.TypeBool,
94+
Computed: true,
8495
},
8596
"scope": {
86-
Type: schema.TypeString,
87-
Computed: true,
97+
Description: "scope(zone/cluster/pool/account) of the parameter that needs to be updated",
98+
Type: schema.TypeString,
99+
Computed: true,
88100
},
89101
},
90102
}
@@ -98,25 +110,25 @@ func resourceCloudStackConfigurationRead(d *schema.ResourceData, meta interface{
98110
p.SetName(d.Id())
99111

100112
// optional
101-
if v, ok := d.GetOk("accountid"); ok {
113+
if v, ok := d.GetOk("account_id"); ok {
102114
p.SetAccountid(v.(string))
103115
}
104116
if v, ok := d.GetOk("category"); ok {
105117
p.SetCategory(v.(string))
106118
}
107-
if v, ok := d.GetOk("clusterid"); ok {
119+
if v, ok := d.GetOk("cluster_id"); ok {
108120
p.SetClusterid(v.(string))
109121
}
110-
if v, ok := d.GetOk("domainid"); ok {
122+
if v, ok := d.GetOk("domain_id"); ok {
111123
p.SetDomainid(v.(string))
112124
}
113-
if v, ok := d.GetOk("imagestoreuuid"); ok {
125+
if v, ok := d.GetOk("image_store_uuid"); ok {
114126
p.SetImagestoreuuid(v.(string))
115127
}
116-
if v, ok := d.GetOk("storeid"); ok {
128+
if v, ok := d.GetOk("store_id"); ok {
117129
p.SetStorageid(v.(string))
118130
}
119-
if v, ok := d.GetOk("zoneid"); ok {
131+
if v, ok := d.GetOk("zone_id"); ok {
120132
p.SetZoneid(v.(string))
121133
}
122134

@@ -162,25 +174,25 @@ func resourceCloudStackConfigurationUpdate(d *schema.ResourceData, meta interfac
162174
p := cs.Configuration.NewUpdateConfigurationParams(d.Id())
163175

164176
// Optional
165-
if v, ok := d.GetOk("accountid"); ok {
177+
if v, ok := d.GetOk("account_id"); ok {
166178
p.SetAccountid(v.(string))
167179
}
168-
if v, ok := d.GetOk("clusterid"); ok {
180+
if v, ok := d.GetOk("cluster_id"); ok {
169181
p.SetClusterid(v.(string))
170182
}
171-
if v, ok := d.GetOk("domainid"); ok {
183+
if v, ok := d.GetOk("domain_id"); ok {
172184
p.SetDomainid(v.(string))
173185
}
174-
if v, ok := d.GetOk("imagestoreuuid"); ok {
186+
if v, ok := d.GetOk("image_store_uuid"); ok {
175187
p.SetImagestoreuuid(v.(string))
176188
}
177-
if v, ok := d.GetOk("storeid"); ok {
189+
if v, ok := d.GetOk("store_id"); ok {
178190
p.SetStorageid(v.(string))
179191
}
180192
if v, ok := d.GetOk("value"); ok {
181193
p.SetValue(v.(string))
182194
}
183-
if v, ok := d.GetOk("zoneid"); ok {
195+
if v, ok := d.GetOk("zone_id"); ok {
184196
p.SetZoneid(v.(string))
185197
}
186198

@@ -199,22 +211,22 @@ func resourceCloudStackConfigurationDelete(d *schema.ResourceData, meta interfac
199211
p := cs.Configuration.NewResetConfigurationParams(d.Id())
200212

201213
// Optional
202-
if v, ok := d.GetOk("accountid"); ok {
214+
if v, ok := d.GetOk("account_id"); ok {
203215
p.SetAccountid(v.(string))
204216
}
205-
if v, ok := d.GetOk("clusterid"); ok {
217+
if v, ok := d.GetOk("cluster_id"); ok {
206218
p.SetClusterid(v.(string))
207219
}
208-
if v, ok := d.GetOk("domainid"); ok {
220+
if v, ok := d.GetOk("domain_id"); ok {
209221
p.SetDomainid(v.(string))
210222
}
211-
if v, ok := d.GetOk("imagestoreuuid"); ok {
223+
if v, ok := d.GetOk("image_store_uuid"); ok {
212224
p.SetImagestoreid(v.(string))
213225
}
214-
if v, ok := d.GetOk("storeid"); ok {
226+
if v, ok := d.GetOk("store_id"); ok {
215227
p.SetStorageid(v.(string))
216228
}
217-
if v, ok := d.GetOk("zoneid"); ok {
229+
if v, ok := d.GetOk("zone_id"); ok {
218230
p.SetZoneid(v.(string))
219231
}
220232

0 commit comments

Comments
 (0)