-
Notifications
You must be signed in to change notification settings - Fork 796
/
models.go
534 lines (497 loc) · 18.6 KB
/
models.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
package hdinsight
// Copyright (c) Microsoft and contributors. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
import (
"encoding/json"
"github.com/Azure/go-autorest/autorest"
)
// The package's fully qualified name.
const fqdn = "github.com/Azure/azure-sdk-for-go/services/preview/hdinsight/2018-11-01-preview/hdinsight"
// ApplicationState enumerates the values for application state.
type ApplicationState string
const (
// ACCEPTED ...
ACCEPTED ApplicationState = "ACCEPTED"
// FAILED ...
FAILED ApplicationState = "FAILED"
// FINISHED ...
FINISHED ApplicationState = "FINISHED"
// FINISHING ...
FINISHING ApplicationState = "FINISHING"
// KILLED ...
KILLED ApplicationState = "KILLED"
// NEW ...
NEW ApplicationState = "NEW"
// NEWSAVING ...
NEWSAVING ApplicationState = "NEW_SAVING"
// RUNNING ...
RUNNING ApplicationState = "RUNNING"
// SUBMITTED ...
SUBMITTED ApplicationState = "SUBMITTED"
)
// PossibleApplicationStateValues returns an array of possible values for the ApplicationState const type.
func PossibleApplicationStateValues() []ApplicationState {
return []ApplicationState{ACCEPTED, FAILED, FINISHED, FINISHING, KILLED, NEW, NEWSAVING, RUNNING, SUBMITTED}
}
// SessionJobKind enumerates the values for session job kind.
type SessionJobKind string
const (
// Pyspark ...
Pyspark SessionJobKind = "pyspark"
// Spark ...
Spark SessionJobKind = "spark"
// Sparkr ...
Sparkr SessionJobKind = "sparkr"
// SQL ...
SQL SessionJobKind = "sql"
)
// PossibleSessionJobKindValues returns an array of possible values for the SessionJobKind const type.
func PossibleSessionJobKindValues() []SessionJobKind {
return []SessionJobKind{Pyspark, Spark, Sparkr, SQL}
}
// AppState the State of the application.
type AppState struct {
autorest.Response `json:"-"`
// State - The State of the application. Possible values include: 'NEW', 'NEWSAVING', 'SUBMITTED', 'ACCEPTED', 'RUNNING', 'FINISHED', 'FINISHING', 'FAILED', 'KILLED'
State ApplicationState `json:"state,omitempty"`
}
// JobDetailRootJSONObject the object containing the job details.
type JobDetailRootJSONObject struct {
autorest.Response `json:"-"`
// Callback - The callback URL, if any.
Callback interface{} `json:"callback,omitempty"`
// Completed - The string representing completed status, for example 'done'.
Completed *string `json:"completed,omitempty"`
// ExitValue - The job's exit value.
ExitValue *int32 `json:"exitValue,omitempty"`
// ID - The job ID.
ID *string `json:"id,omitempty"`
// Msg - The message returned.
Msg interface{} `json:"msg,omitempty"`
// ParentID - The parent job ID.
ParentID *string `json:"parentId,omitempty"`
// PercentComplete - The job completion percentage, for example '75% complete'.
PercentComplete *string `json:"percentComplete,omitempty"`
// Profile - The object containing the job profile information.
Profile *Profile `json:"profile,omitempty"`
// Status - The object containing the job status information.
Status *Status `json:"status,omitempty"`
// User - The user name of the job creator.
User *string `json:"user,omitempty"`
// Userargs - The arguments passed in by the user.
Userargs *Userargs `json:"userargs,omitempty"`
}
// JobID the object with the Job ID.
type JobID struct {
// ID - The job number.
ID *int64 `json:"id,omitempty"`
// JtIdentifier - The jobTracker identifier.
JtIdentifier *string `json:"jtIdentifier,omitempty"`
}
// JobListJSONObject the List Job operation response.
type JobListJSONObject struct {
// Detail - The detail of the job.
Detail *JobDetailRootJSONObject `json:"detail,omitempty"`
// ID - The Id of the job.
ID *string `json:"id,omitempty"`
}
// JobOperationsErrorResponse describes the format of Error response.
type JobOperationsErrorResponse struct {
// Error - Error message indicating why the operation failed.
Error *string `json:"error,omitempty"`
}
// JobSubmissionJSONResponse the job submission json response.
type JobSubmissionJSONResponse struct {
autorest.Response `json:"-"`
// ID - The Id of the created job.
ID *string `json:"id,omitempty"`
}
// ListJobListJSONObject ...
type ListJobListJSONObject struct {
autorest.Response `json:"-"`
Value *[]JobListJSONObject `json:"value,omitempty"`
}
// Profile the object containing the job profile information.
type Profile struct {
// JobFile - The job configuration file.
JobFile *string `json:"jobFile,omitempty"`
// JobID - The full ID of the job.
JobID *string `json:"jobId,omitempty"`
// JobName - The user-specified job name.
JobName *string `json:"jobName,omitempty"`
// QueueName - The name of the queue to which the job is submitted.
QueueName *string `json:"queueName,omitempty"`
// URL - The link to the web-ui for details of the job.
URL *string `json:"url,omitempty"`
// User - The userid of the person who submitted the job.
User *string `json:"user,omitempty"`
}
// SparkBatchJob ...
type SparkBatchJob struct {
autorest.Response `json:"-"`
ID *int32 `json:"id,omitempty"`
AppID *string `json:"appId,omitempty"`
AppInfo map[string]*string `json:"appInfo"`
State *string `json:"state,omitempty"`
LogLines *[]string `json:"log,omitempty"`
}
// MarshalJSON is the custom marshaler for SparkBatchJob.
func (sbj SparkBatchJob) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if sbj.ID != nil {
objectMap["id"] = sbj.ID
}
if sbj.AppID != nil {
objectMap["appId"] = sbj.AppID
}
if sbj.AppInfo != nil {
objectMap["appInfo"] = sbj.AppInfo
}
if sbj.State != nil {
objectMap["state"] = sbj.State
}
if sbj.LogLines != nil {
objectMap["log"] = sbj.LogLines
}
return json.Marshal(objectMap)
}
// SparkBatchJobCollection ...
type SparkBatchJobCollection struct {
autorest.Response `json:"-"`
From *int32 `json:"from,omitempty"`
Total *int32 `json:"total,omitempty"`
Sessions *[]SparkBatchJob `json:"sessions,omitempty"`
}
// SparkBatchJobRequest ...
type SparkBatchJobRequest struct {
File *string `json:"file,omitempty"`
ProxyUser *string `json:"proxyUser,omitempty"`
ClassName *string `json:"className,omitempty"`
Arguments *[]string `json:"args,omitempty"`
Jars *[]string `json:"jars,omitempty"`
PythonFiles *[]string `json:"pyFiles,omitempty"`
Files *[]string `json:"files,omitempty"`
DriverMemory *string `json:"driverMemory,omitempty"`
DriverCores *int32 `json:"driverCores,omitempty"`
ExecutorMemory *string `json:"executorMemory,omitempty"`
ExecutorCores *int32 `json:"executorCores,omitempty"`
ExecutorCount *int32 `json:"numExecutors,omitempty"`
Archives *[]string `json:"archives,omitempty"`
Queue *string `json:"queue,omitempty"`
Name *string `json:"name,omitempty"`
Configuration map[string]*string `json:"conf"`
}
// MarshalJSON is the custom marshaler for SparkBatchJobRequest.
func (sbjr SparkBatchJobRequest) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if sbjr.File != nil {
objectMap["file"] = sbjr.File
}
if sbjr.ProxyUser != nil {
objectMap["proxyUser"] = sbjr.ProxyUser
}
if sbjr.ClassName != nil {
objectMap["className"] = sbjr.ClassName
}
if sbjr.Arguments != nil {
objectMap["args"] = sbjr.Arguments
}
if sbjr.Jars != nil {
objectMap["jars"] = sbjr.Jars
}
if sbjr.PythonFiles != nil {
objectMap["pyFiles"] = sbjr.PythonFiles
}
if sbjr.Files != nil {
objectMap["files"] = sbjr.Files
}
if sbjr.DriverMemory != nil {
objectMap["driverMemory"] = sbjr.DriverMemory
}
if sbjr.DriverCores != nil {
objectMap["driverCores"] = sbjr.DriverCores
}
if sbjr.ExecutorMemory != nil {
objectMap["executorMemory"] = sbjr.ExecutorMemory
}
if sbjr.ExecutorCores != nil {
objectMap["executorCores"] = sbjr.ExecutorCores
}
if sbjr.ExecutorCount != nil {
objectMap["numExecutors"] = sbjr.ExecutorCount
}
if sbjr.Archives != nil {
objectMap["archives"] = sbjr.Archives
}
if sbjr.Queue != nil {
objectMap["queue"] = sbjr.Queue
}
if sbjr.Name != nil {
objectMap["name"] = sbjr.Name
}
if sbjr.Configuration != nil {
objectMap["conf"] = sbjr.Configuration
}
return json.Marshal(objectMap)
}
// SparkJobDeletedResult ...
type SparkJobDeletedResult struct {
autorest.Response `json:"-"`
DeletedMessage *string `json:"msg,omitempty"`
}
// SparkJobLog ...
type SparkJobLog struct {
autorest.Response `json:"-"`
ID *int32 `json:"id,omitempty"`
From *int32 `json:"from,omitempty"`
Size *int32 `json:"size,omitempty"`
Total *int64 `json:"total,omitempty"`
LogLines *[]string `json:"log,omitempty"`
}
// SparkJobState ...
type SparkJobState struct {
autorest.Response `json:"-"`
ID *int32 `json:"id,omitempty"`
State *string `json:"state,omitempty"`
}
// SparkSessionCollection ...
type SparkSessionCollection struct {
autorest.Response `json:"-"`
From *int32 `json:"from,omitempty"`
Total *int32 `json:"total,omitempty"`
Sessions *[]SparkSessionJob `json:"sessions,omitempty"`
}
// SparkSessionJob ...
type SparkSessionJob struct {
autorest.Response `json:"-"`
ID *int32 `json:"id,omitempty"`
AppID *string `json:"appId,omitempty"`
Owner *string `json:"owner,omitempty"`
ProxyUser *string `json:"proxyUser,omitempty"`
Kind *string `json:"kind,omitempty"`
LogLines *[]string `json:"log,omitempty"`
State *string `json:"state,omitempty"`
AppInfo map[string]*string `json:"appInfo"`
}
// MarshalJSON is the custom marshaler for SparkSessionJob.
func (ssj SparkSessionJob) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if ssj.ID != nil {
objectMap["id"] = ssj.ID
}
if ssj.AppID != nil {
objectMap["appId"] = ssj.AppID
}
if ssj.Owner != nil {
objectMap["owner"] = ssj.Owner
}
if ssj.ProxyUser != nil {
objectMap["proxyUser"] = ssj.ProxyUser
}
if ssj.Kind != nil {
objectMap["kind"] = ssj.Kind
}
if ssj.LogLines != nil {
objectMap["log"] = ssj.LogLines
}
if ssj.State != nil {
objectMap["state"] = ssj.State
}
if ssj.AppInfo != nil {
objectMap["appInfo"] = ssj.AppInfo
}
return json.Marshal(objectMap)
}
// SparkSessionJobRequest ...
type SparkSessionJobRequest struct {
// Kind - Possible values include: 'Spark', 'Pyspark', 'Sparkr', 'SQL'
Kind SessionJobKind `json:"kind,omitempty"`
ProxyUser *string `json:"proxyUser,omitempty"`
Jars *[]string `json:"jars,omitempty"`
PythonFiles *[]string `json:"pyFiles,omitempty"`
Files *[]string `json:"files,omitempty"`
DriverMemory *string `json:"driverMemory,omitempty"`
DriverCores *int32 `json:"driverCores,omitempty"`
ExecutorMemory *string `json:"executorMemory,omitempty"`
ExecutorCores *int32 `json:"executorCores,omitempty"`
ExecutorCount *int32 `json:"numExecutors,omitempty"`
Archives *[]string `json:"archives,omitempty"`
Queue *string `json:"queue,omitempty"`
Name *string `json:"name,omitempty"`
Configuration map[string]*string `json:"conf"`
HeartbeatTimeoutInSecond *int32 `json:"heartbeatTimeoutInSecond,omitempty"`
}
// MarshalJSON is the custom marshaler for SparkSessionJobRequest.
func (ssjr SparkSessionJobRequest) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if ssjr.Kind != "" {
objectMap["kind"] = ssjr.Kind
}
if ssjr.ProxyUser != nil {
objectMap["proxyUser"] = ssjr.ProxyUser
}
if ssjr.Jars != nil {
objectMap["jars"] = ssjr.Jars
}
if ssjr.PythonFiles != nil {
objectMap["pyFiles"] = ssjr.PythonFiles
}
if ssjr.Files != nil {
objectMap["files"] = ssjr.Files
}
if ssjr.DriverMemory != nil {
objectMap["driverMemory"] = ssjr.DriverMemory
}
if ssjr.DriverCores != nil {
objectMap["driverCores"] = ssjr.DriverCores
}
if ssjr.ExecutorMemory != nil {
objectMap["executorMemory"] = ssjr.ExecutorMemory
}
if ssjr.ExecutorCores != nil {
objectMap["executorCores"] = ssjr.ExecutorCores
}
if ssjr.ExecutorCount != nil {
objectMap["numExecutors"] = ssjr.ExecutorCount
}
if ssjr.Archives != nil {
objectMap["archives"] = ssjr.Archives
}
if ssjr.Queue != nil {
objectMap["queue"] = ssjr.Queue
}
if ssjr.Name != nil {
objectMap["name"] = ssjr.Name
}
if ssjr.Configuration != nil {
objectMap["conf"] = ssjr.Configuration
}
if ssjr.HeartbeatTimeoutInSecond != nil {
objectMap["heartbeatTimeoutInSecond"] = ssjr.HeartbeatTimeoutInSecond
}
return json.Marshal(objectMap)
}
// SparkStatement ...
type SparkStatement struct {
autorest.Response `json:"-"`
ID *int32 `json:"id,omitempty"`
Code *string `json:"code,omitempty"`
State *string `json:"state,omitempty"`
Output *SparkStatementOutput `json:"output,omitempty"`
Progress *float64 `json:"progress,omitempty"`
}
// SparkStatementCancellationResult ...
type SparkStatementCancellationResult struct {
autorest.Response `json:"-"`
CancelMessage *string `json:"msg,omitempty"`
}
// SparkStatementCollection ...
type SparkStatementCollection struct {
autorest.Response `json:"-"`
Statements *[]SparkStatement `json:"statements,omitempty"`
}
// SparkStatementOutput ...
type SparkStatementOutput struct {
Status *string `json:"status,omitempty"`
ExecutionCount *int32 `json:"execution_count,omitempty"`
Data interface{} `json:"data,omitempty"`
}
// SparkStatementRequest ...
type SparkStatementRequest struct {
Code *string `json:"code,omitempty"`
Kind *string `json:"kind,omitempty"`
}
// Status gets or sets the object containing the job status information.
type Status struct {
// CleanupProgress - The progress made on the cleanup.
CleanupProgress *float64 `json:"cleanupProgress,omitempty"`
// FailureInfo - The information about any failures that have occurred.
FailureInfo *string `json:"failureInfo,omitempty"`
// FinishTime - The time at which the job completed. It is an integer in milliseconds, as a Unix timestamp relative to 1/1/1970 00:00:00.
FinishTime *int64 `json:"finishTime,omitempty"`
// HistoryFile - The history file of the job.
HistoryFile *string `json:"historyFile,omitempty"`
// JobACLs - The ACLs of the job.
JobACLs interface{} `json:"jobACLs,omitempty"`
// JobComplete - Whether or not the job has completed.
JobComplete *bool `json:"jobComplete,omitempty"`
// JobFile - The job configuration file.
JobFile *string `json:"jobFile,omitempty"`
// JobID - The full ID of the job.
JobID *string `json:"jobId,omitempty"`
// JobName - The user-specified job name.
JobName *string `json:"jobName,omitempty"`
// JobPriority - The priority of the job.
JobPriority *string `json:"jobPriority,omitempty"`
// MapProgress - The progress made on the maps.
MapProgress *float64 `json:"mapProgress,omitempty"`
// NeededMem - The amount of memory needed for the job.
NeededMem *int64 `json:"neededMem,omitempty"`
// NumReservedSlots - The number of slots reserved.
NumReservedSlots *int32 `json:"numReservedSlots,omitempty"`
// NumUsedSlots - The number of slots used for the job.
NumUsedSlots *int32 `json:"numUsedSlots,omitempty"`
// Priority - The priority of the job.
Priority *string `json:"priority,omitempty"`
// Queue - The job queue name.
Queue *string `json:"queue,omitempty"`
// ReduceProgress - The progress made on the reduces.
ReduceProgress *float64 `json:"reduceProgress,omitempty"`
// ReservedMem - The amount of memory reserved for the job.
ReservedMem *int64 `json:"reservedMem,omitempty"`
// Retired - Whether or not the job has been retired.
Retired *bool `json:"retired,omitempty"`
// RunState - The current state of the job.
RunState *int32 `json:"runState,omitempty"`
// SchedulingInfo - The information about the scheduling of the job.
SchedulingInfo *string `json:"schedulingInfo,omitempty"`
// SetupProgress - The progress made on the setup.
SetupProgress *float64 `json:"setupProgress,omitempty"`
// StartTime - The time at which the job started. It is an integer in milliseconds, as a Unix timestamp relative to 1/1/1970 00:00:00.
StartTime *int64 `json:"startTime,omitempty"`
// State - The state of the job.
State *string `json:"state,omitempty"`
// TrackingURL - The link to the web-ui for details of the job.
TrackingURL *string `json:"trackingUrl,omitempty"`
// Uber - Whether job running in uber mode.
Uber *bool `json:"uber,omitempty"`
// UsedMem - The amount of memory used by the job.
UsedMem *int64 `json:"usedMem,omitempty"`
// Username - The userid of the person who submitted the job.
Username *string `json:"username,omitempty"`
}
// Userargs gets or sets the object containing the user arguments.
type Userargs struct {
// Arg - READ-ONLY; The list of args defined by the user.
Arg *[]string `json:"arg,omitempty"`
// Callback - The callback URL, if any.
Callback interface{} `json:"callback,omitempty"`
// Define - READ-ONLY; The define properties defined by the user.
Define *[]string `json:"define,omitempty"`
// Enablelog - Whether or not the user enabled logs.
Enablelog *string `json:"enablelog,omitempty"`
// Execute - The query defined by the user.
Execute *string `json:"execute,omitempty"`
// File - The query file provided by the user.
File interface{} `json:"file,omitempty"`
// Files - The files defined by the user.
Files interface{} `json:"files,omitempty"`
// Jar - The JAR file provided by the user.
Jar *string `json:"jar,omitempty"`
// Statusdir - The status directory defined by the user.
Statusdir interface{} `json:"statusdir,omitempty"`
}