@@ -97,6 +97,83 @@ public string DefaultStorageAccountKey
97
97
set { parameters . DefaultStorageAccountKey = value ; }
98
98
}
99
99
100
+ [ Parameter ( ValueFromPipeline = true ,
101
+ HelpMessage = "The HDInsight cluster configuration to use when creating the new cluster." ) ]
102
+ public AzureHDInsightConfig Config
103
+ {
104
+ get
105
+ {
106
+ var result = new AzureHDInsightConfig
107
+ {
108
+ ClusterType = parameters . ClusterType ,
109
+ DefaultStorageAccountName = parameters . DefaultStorageAccountName ,
110
+ DefaultStorageAccountKey = parameters . DefaultStorageAccountKey ,
111
+ WorkerNodeSize = parameters . WorkerNodeSize ,
112
+ HeadNodeSize = parameters . HeadNodeSize ,
113
+ ZookeeperNodeSize = parameters . ZookeeperNodeSize ,
114
+ HiveMetastore = HiveMetastore ,
115
+ OozieMetastore = OozieMetastore ,
116
+ ObjectId = ObjectId ,
117
+ AADTenantId = AadTenantId ,
118
+ CertificateFilePath = CertificateFilePath ,
119
+ CertificatePassword = CertificatePassword
120
+ } ;
121
+ foreach (
122
+ var storageAccount in
123
+ parameters . AdditionalStorageAccounts . Where (
124
+ storageAccount => ! result . AdditionalStorageAccounts . ContainsKey ( storageAccount . Key ) ) )
125
+ {
126
+ result . AdditionalStorageAccounts . Add ( storageAccount . Key , storageAccount . Value ) ;
127
+ }
128
+ foreach ( var val in parameters . Configurations . Where ( val => ! result . Configurations . ContainsKey ( val . Key ) ) )
129
+ {
130
+ result . Configurations . Add ( val . Key , DictionaryToHashtable ( val . Value ) ) ;
131
+ }
132
+ foreach ( var action in parameters . ScriptActions . Where ( action => ! result . ScriptActions . ContainsKey ( action . Key ) ) )
133
+ {
134
+ result . ScriptActions . Add ( action . Key , action . Value . Select ( a => new AzureHDInsightScriptAction ( a ) ) . ToList ( ) ) ;
135
+ }
136
+ return result ;
137
+ }
138
+ set
139
+ {
140
+ parameters . ClusterType = value . ClusterType ;
141
+ if ( parameters . DefaultStorageAccountName == null )
142
+ {
143
+ parameters . DefaultStorageAccountName = value . DefaultStorageAccountName ;
144
+ }
145
+ if ( parameters . DefaultStorageAccountKey == null )
146
+ {
147
+ parameters . DefaultStorageAccountKey = value . DefaultStorageAccountKey ;
148
+ }
149
+ parameters . WorkerNodeSize = value . WorkerNodeSize ;
150
+ parameters . HeadNodeSize = value . HeadNodeSize ;
151
+ parameters . ZookeeperNodeSize = value . ZookeeperNodeSize ;
152
+ HiveMetastore = value . HiveMetastore ;
153
+ OozieMetastore = value . OozieMetastore ;
154
+ CertificateFilePath = value . CertificateFilePath ;
155
+ AadTenantId = value . AADTenantId ;
156
+ ObjectId = value . ObjectId ;
157
+ CertificatePassword = value . CertificatePassword ;
158
+
159
+ foreach (
160
+ var storageAccount in
161
+ value . AdditionalStorageAccounts . Where (
162
+ storageAccount => ! parameters . AdditionalStorageAccounts . ContainsKey ( storageAccount . Key ) ) )
163
+ {
164
+ parameters . AdditionalStorageAccounts . Add ( storageAccount . Key , storageAccount . Value ) ;
165
+ }
166
+ foreach ( var val in value . Configurations . Where ( val => ! parameters . Configurations . ContainsKey ( val . Key ) ) )
167
+ {
168
+ parameters . Configurations . Add ( val . Key , HashtableToDictionary ( val . Value ) ) ;
169
+ }
170
+ foreach ( var action in value . ScriptActions . Where ( action => ! parameters . ScriptActions . ContainsKey ( action . Key ) ) )
171
+ {
172
+ parameters . ScriptActions . Add ( action . Key , action . Value . Select ( a => a . GetScriptActionFromPSModel ( ) ) . ToList ( ) ) ;
173
+ }
174
+ }
175
+ }
176
+
100
177
[ Parameter ( HelpMessage = "Gets or sets the database to store the metadata for Oozie." ) ]
101
178
public AzureHDInsightMetastore OozieMetastore { get ; set ; }
102
179
@@ -203,76 +280,6 @@ public DateTime RdpAccessExpiry
203
280
[ Parameter ( HelpMessage = "Gets or sets the Service Principal AAD Tenant Id for accessing Azure Data Lake." , ParameterSetName = "ServicePrincipal" ) ]
204
281
public Guid AadTenantId { get ; set ; }
205
282
206
- [ Parameter ( ValueFromPipeline = true ,
207
- HelpMessage = "The HDInsight cluster configuration to use when creating the new cluster." ) ]
208
- public AzureHDInsightConfig Config {
209
- get
210
- {
211
- var result = new AzureHDInsightConfig
212
- {
213
- ClusterType = parameters . ClusterType ,
214
- DefaultStorageAccountName = parameters . DefaultStorageAccountName ,
215
- DefaultStorageAccountKey = parameters . DefaultStorageAccountKey ,
216
- WorkerNodeSize = parameters . WorkerNodeSize ,
217
- HeadNodeSize = parameters . HeadNodeSize ,
218
- ZookeeperNodeSize = parameters . ZookeeperNodeSize ,
219
- HiveMetastore = HiveMetastore ,
220
- OozieMetastore = OozieMetastore ,
221
- ObjectId = ObjectId ,
222
- AADTenantId = AadTenantId ,
223
- CertificateFilePath = CertificateFilePath ,
224
- CertificatePassword = CertificatePassword
225
- } ;
226
- foreach (
227
- var storageAccount in
228
- parameters . AdditionalStorageAccounts . Where (
229
- storageAccount => ! result . AdditionalStorageAccounts . ContainsKey ( storageAccount . Key ) ) )
230
- {
231
- result . AdditionalStorageAccounts . Add ( storageAccount . Key , storageAccount . Value ) ;
232
- }
233
- foreach ( var val in parameters . Configurations . Where ( val => ! result . Configurations . ContainsKey ( val . Key ) ) )
234
- {
235
- result . Configurations . Add ( val . Key , DictionaryToHashtable ( val . Value ) ) ;
236
- }
237
- foreach ( var action in parameters . ScriptActions . Where ( action => ! result . ScriptActions . ContainsKey ( action . Key ) ) )
238
- {
239
- result . ScriptActions . Add ( action . Key , action . Value . Select ( a => new AzureHDInsightScriptAction ( a ) ) . ToList ( ) ) ;
240
- }
241
- return result ;
242
- }
243
- set
244
- {
245
- parameters . ClusterType = value . ClusterType ;
246
- parameters . DefaultStorageAccountName = value . DefaultStorageAccountName ;
247
- parameters . DefaultStorageAccountKey = value . DefaultStorageAccountKey ;
248
- parameters . WorkerNodeSize = value . WorkerNodeSize ;
249
- parameters . HeadNodeSize = value . HeadNodeSize ;
250
- parameters . ZookeeperNodeSize = value . ZookeeperNodeSize ;
251
- HiveMetastore = value . HiveMetastore ;
252
- OozieMetastore = value . OozieMetastore ;
253
- CertificateFilePath = value . CertificateFilePath ;
254
- AadTenantId = value . AADTenantId ;
255
- ObjectId = value . ObjectId ;
256
- CertificatePassword = value . CertificatePassword ;
257
-
258
- foreach (
259
- var storageAccount in
260
- value . AdditionalStorageAccounts . Where (
261
- storageAccount => ! parameters . AdditionalStorageAccounts . ContainsKey ( storageAccount . Key ) ) )
262
- {
263
- parameters . AdditionalStorageAccounts . Add ( storageAccount . Key , storageAccount . Value ) ;
264
- }
265
- foreach ( var val in value . Configurations . Where ( val => ! parameters . Configurations . ContainsKey ( val . Key ) ) )
266
- {
267
- parameters . Configurations . Add ( val . Key , HashtableToDictionary ( val . Value ) ) ;
268
- }
269
- foreach ( var action in value . ScriptActions . Where ( action => ! parameters . ScriptActions . ContainsKey ( action . Key ) ) )
270
- {
271
- parameters . ScriptActions . Add ( action . Key , action . Value . Select ( a => a . GetScriptActionFromPSModel ( ) ) . ToList ( ) ) ;
272
- }
273
- }
274
- }
275
-
276
283
#endregion
277
284
278
285
@@ -336,9 +343,9 @@ var storageAccount in
336
343
}
337
344
if ( CertificateFilePath != null && CertificatePassword != null )
338
345
{
339
- Microsoft . Azure . Management . HDInsight . Models . ServicePrincipal servicePrincipal =
340
- new Microsoft . Azure . Management . HDInsight . Models . ServicePrincipal (
341
- GetApplicationId ( ) , GetTenantId ( AadTenantId ) , File . ReadAllBytes ( CertificateFilePath ) , CertificatePassword ) ;
346
+ var servicePrincipal = new Management . HDInsight . Models . ServicePrincipal (
347
+ GetApplicationId ( ) , GetTenantId ( AadTenantId ) , File . ReadAllBytes ( CertificateFilePath ) ,
348
+ CertificatePassword ) ;
342
349
parameters . Principal = servicePrincipal ;
343
350
}
344
351
0 commit comments