@@ -38,53 +38,65 @@ func resourceCloudStackConfiguration() *schema.Resource {
38
38
39
39
Schema : map [string ]* schema.Schema {
40
40
"name" : {
41
- Type : schema .TypeString ,
42
- Required : true ,
41
+ Description : "configuration by name" ,
42
+ Type : schema .TypeString ,
43
+ Required : true ,
43
44
},
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 ,
47
49
},
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 ,
51
54
},
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 ,
55
59
},
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 ,
59
64
},
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 ,
63
69
},
64
70
"value" : {
65
- Type : schema .TypeString ,
66
- Optional : true ,
71
+ Description : "the value of the configuration" ,
72
+ Type : schema .TypeString ,
73
+ Optional : true ,
67
74
},
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 ,
71
79
},
72
80
// computed
73
81
"category" : {
74
- Type : schema .TypeString ,
75
- Computed : true ,
82
+ Description : "configurations by category" ,
83
+ Type : schema .TypeString ,
84
+ Computed : true ,
76
85
},
77
86
"description" : {
78
- Type : schema .TypeString ,
79
- Computed : true ,
87
+ Description : "the description of the configuration" ,
88
+ Type : schema .TypeString ,
89
+ Computed : true ,
80
90
},
81
91
"is_dynamic" : {
82
- Type : schema .TypeBool ,
83
- Computed : true ,
92
+ Description : "true if the configuration is dynamic" ,
93
+ Type : schema .TypeBool ,
94
+ Computed : true ,
84
95
},
85
96
"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 ,
88
100
},
89
101
},
90
102
}
@@ -98,25 +110,25 @@ func resourceCloudStackConfigurationRead(d *schema.ResourceData, meta interface{
98
110
p .SetName (d .Id ())
99
111
100
112
// optional
101
- if v , ok := d .GetOk ("accountid " ); ok {
113
+ if v , ok := d .GetOk ("account_id " ); ok {
102
114
p .SetAccountid (v .(string ))
103
115
}
104
116
if v , ok := d .GetOk ("category" ); ok {
105
117
p .SetCategory (v .(string ))
106
118
}
107
- if v , ok := d .GetOk ("clusterid " ); ok {
119
+ if v , ok := d .GetOk ("cluster_id " ); ok {
108
120
p .SetClusterid (v .(string ))
109
121
}
110
- if v , ok := d .GetOk ("domainid " ); ok {
122
+ if v , ok := d .GetOk ("domain_id " ); ok {
111
123
p .SetDomainid (v .(string ))
112
124
}
113
- if v , ok := d .GetOk ("imagestoreuuid " ); ok {
125
+ if v , ok := d .GetOk ("image_store_uuid " ); ok {
114
126
p .SetImagestoreuuid (v .(string ))
115
127
}
116
- if v , ok := d .GetOk ("storeid " ); ok {
128
+ if v , ok := d .GetOk ("store_id " ); ok {
117
129
p .SetStorageid (v .(string ))
118
130
}
119
- if v , ok := d .GetOk ("zoneid " ); ok {
131
+ if v , ok := d .GetOk ("zone_id " ); ok {
120
132
p .SetZoneid (v .(string ))
121
133
}
122
134
@@ -162,25 +174,25 @@ func resourceCloudStackConfigurationUpdate(d *schema.ResourceData, meta interfac
162
174
p := cs .Configuration .NewUpdateConfigurationParams (d .Id ())
163
175
164
176
// Optional
165
- if v , ok := d .GetOk ("accountid " ); ok {
177
+ if v , ok := d .GetOk ("account_id " ); ok {
166
178
p .SetAccountid (v .(string ))
167
179
}
168
- if v , ok := d .GetOk ("clusterid " ); ok {
180
+ if v , ok := d .GetOk ("cluster_id " ); ok {
169
181
p .SetClusterid (v .(string ))
170
182
}
171
- if v , ok := d .GetOk ("domainid " ); ok {
183
+ if v , ok := d .GetOk ("domain_id " ); ok {
172
184
p .SetDomainid (v .(string ))
173
185
}
174
- if v , ok := d .GetOk ("imagestoreuuid " ); ok {
186
+ if v , ok := d .GetOk ("image_store_uuid " ); ok {
175
187
p .SetImagestoreuuid (v .(string ))
176
188
}
177
- if v , ok := d .GetOk ("storeid " ); ok {
189
+ if v , ok := d .GetOk ("store_id " ); ok {
178
190
p .SetStorageid (v .(string ))
179
191
}
180
192
if v , ok := d .GetOk ("value" ); ok {
181
193
p .SetValue (v .(string ))
182
194
}
183
- if v , ok := d .GetOk ("zoneid " ); ok {
195
+ if v , ok := d .GetOk ("zone_id " ); ok {
184
196
p .SetZoneid (v .(string ))
185
197
}
186
198
@@ -199,22 +211,22 @@ func resourceCloudStackConfigurationDelete(d *schema.ResourceData, meta interfac
199
211
p := cs .Configuration .NewResetConfigurationParams (d .Id ())
200
212
201
213
// Optional
202
- if v , ok := d .GetOk ("accountid " ); ok {
214
+ if v , ok := d .GetOk ("account_id " ); ok {
203
215
p .SetAccountid (v .(string ))
204
216
}
205
- if v , ok := d .GetOk ("clusterid " ); ok {
217
+ if v , ok := d .GetOk ("cluster_id " ); ok {
206
218
p .SetClusterid (v .(string ))
207
219
}
208
- if v , ok := d .GetOk ("domainid " ); ok {
220
+ if v , ok := d .GetOk ("domain_id " ); ok {
209
221
p .SetDomainid (v .(string ))
210
222
}
211
- if v , ok := d .GetOk ("imagestoreuuid " ); ok {
223
+ if v , ok := d .GetOk ("image_store_uuid " ); ok {
212
224
p .SetImagestoreid (v .(string ))
213
225
}
214
- if v , ok := d .GetOk ("storeid " ); ok {
226
+ if v , ok := d .GetOk ("store_id " ); ok {
215
227
p .SetStorageid (v .(string ))
216
228
}
217
- if v , ok := d .GetOk ("zoneid " ); ok {
229
+ if v , ok := d .GetOk ("zone_id " ); ok {
218
230
p .SetZoneid (v .(string ))
219
231
}
220
232
0 commit comments