-
Notifications
You must be signed in to change notification settings - Fork 1.7k
/
job.go
468 lines (432 loc) · 21.8 KB
/
job.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
package presenters
import (
"time"
"github.com/lib/pq"
uuid "github.com/satori/go.uuid"
"gopkg.in/guregu/null.v4"
"github.com/smartcontractkit/chainlink/core/assets"
clnull "github.com/smartcontractkit/chainlink/core/null"
"github.com/smartcontractkit/chainlink/core/services/job"
"github.com/smartcontractkit/chainlink/core/services/keystore/keys/ethkey"
"github.com/smartcontractkit/chainlink/core/services/pipeline"
"github.com/smartcontractkit/chainlink/core/services/relay"
"github.com/smartcontractkit/chainlink/core/services/signatures/secp256k1"
"github.com/smartcontractkit/chainlink/core/store/models"
"github.com/smartcontractkit/chainlink/core/utils"
)
// JobSpecType defines the the the spec type of the job
type JobSpecType string
func (t JobSpecType) String() string {
return string(t)
}
const (
DirectRequestJobSpec JobSpecType = "directrequest"
FluxMonitorJobSpec JobSpecType = "fluxmonitor"
OffChainReportingJobSpec JobSpecType = "offchainreporting"
KeeperJobSpec JobSpecType = "keeper"
CronJobSpec JobSpecType = "cron"
VRFJobSpec JobSpecType = "vrf"
WebhookJobSpec JobSpecType = "webhook"
BlockhashStoreJobSpec JobSpecType = "blockhashstore"
BootstrapJobSpec JobSpecType = "bootstrap"
)
// DirectRequestSpec defines the spec details of a DirectRequest Job
type DirectRequestSpec struct {
ContractAddress ethkey.EIP55Address `json:"contractAddress"`
MinIncomingConfirmations clnull.Uint32 `json:"minIncomingConfirmations"`
MinIncomingConfirmationsEnv bool `json:"minIncomingConfirmationsEnv,omitempty"`
MinContractPayment *assets.Link `json:"minContractPaymentLinkJuels"`
Requesters models.AddressCollection `json:"requesters"`
Initiator string `json:"initiator"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
EVMChainID *utils.Big `json:"evmChainID"`
}
// NewDirectRequestSpec initializes a new DirectRequestSpec from a
// job.DirectRequestSpec
func NewDirectRequestSpec(spec *job.DirectRequestSpec) *DirectRequestSpec {
return &DirectRequestSpec{
ContractAddress: spec.ContractAddress,
MinIncomingConfirmations: spec.MinIncomingConfirmations,
MinIncomingConfirmationsEnv: spec.MinIncomingConfirmationsEnv,
MinContractPayment: spec.MinContractPayment,
Requesters: spec.Requesters,
// This is hardcoded to runlog. When we support other initiators, we need
// to change this
Initiator: "runlog",
CreatedAt: spec.CreatedAt,
UpdatedAt: spec.UpdatedAt,
EVMChainID: spec.EVMChainID,
}
}
// FluxMonitorSpec defines the spec details of a FluxMonitor Job
type FluxMonitorSpec struct {
ContractAddress ethkey.EIP55Address `json:"contractAddress"`
Threshold float32 `json:"threshold"`
AbsoluteThreshold float32 `json:"absoluteThreshold"`
PollTimerPeriod string `json:"pollTimerPeriod"`
PollTimerDisabled bool `json:"pollTimerDisabled"`
IdleTimerPeriod string `json:"idleTimerPeriod"`
IdleTimerDisabled bool `json:"idleTimerDisabled"`
DrumbeatEnabled bool `json:"drumbeatEnabled"`
DrumbeatSchedule *string `json:"drumbeatSchedule"`
DrumbeatRandomDelay *string `json:"drumbeatRandomDelay"`
MinPayment *assets.Link `json:"minPayment"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
EVMChainID *utils.Big `json:"evmChainID"`
}
// NewFluxMonitorSpec initializes a new DirectFluxMonitorSpec from a
// job.FluxMonitorSpec
func NewFluxMonitorSpec(spec *job.FluxMonitorSpec) *FluxMonitorSpec {
var drumbeatSchedulePtr *string
if spec.DrumbeatEnabled {
drumbeatSchedulePtr = &spec.DrumbeatSchedule
}
var drumbeatRandomDelayPtr *string
if spec.DrumbeatRandomDelay > 0 {
drumbeatRandomDelay := spec.DrumbeatRandomDelay.String()
drumbeatRandomDelayPtr = &drumbeatRandomDelay
}
return &FluxMonitorSpec{
ContractAddress: spec.ContractAddress,
Threshold: float32(spec.Threshold),
AbsoluteThreshold: float32(spec.AbsoluteThreshold),
PollTimerPeriod: spec.PollTimerPeriod.String(),
PollTimerDisabled: spec.PollTimerDisabled,
IdleTimerPeriod: spec.IdleTimerPeriod.String(),
IdleTimerDisabled: spec.IdleTimerDisabled,
DrumbeatEnabled: spec.DrumbeatEnabled,
DrumbeatSchedule: drumbeatSchedulePtr,
DrumbeatRandomDelay: drumbeatRandomDelayPtr,
MinPayment: spec.MinPayment,
CreatedAt: spec.CreatedAt,
UpdatedAt: spec.UpdatedAt,
EVMChainID: spec.EVMChainID,
}
}
// OffChainReportingSpec defines the spec details of a OffChainReporting Job
type OffChainReportingSpec struct {
ContractAddress ethkey.EIP55Address `json:"contractAddress"`
P2PBootstrapPeers pq.StringArray `json:"p2pBootstrapPeers"`
P2PV2Bootstrappers pq.StringArray `json:"p2pv2Bootstrappers"`
IsBootstrapPeer bool `json:"isBootstrapPeer"`
EncryptedOCRKeyBundleID *models.Sha256Hash `json:"keyBundleID"`
TransmitterAddress *ethkey.EIP55Address `json:"transmitterAddress"`
ObservationTimeout models.Interval `json:"observationTimeout"`
ObservationTimeoutEnv bool `json:"observationTimeoutEnv,omitempty"`
BlockchainTimeout models.Interval `json:"blockchainTimeout"`
BlockchainTimeoutEnv bool `json:"blockchainTimeoutEnv,omitempty"`
ContractConfigTrackerSubscribeInterval models.Interval `json:"contractConfigTrackerSubscribeInterval"`
ContractConfigTrackerSubscribeIntervalEnv bool `json:"contractConfigTrackerSubscribeIntervalEnv,omitempty"`
ContractConfigTrackerPollInterval models.Interval `json:"contractConfigTrackerPollInterval"`
ContractConfigTrackerPollIntervalEnv bool `json:"contractConfigTrackerPollIntervalEnv,omitempty"`
ContractConfigConfirmations uint16 `json:"contractConfigConfirmations"`
ContractConfigConfirmationsEnv bool `json:"contractConfigConfirmationsEnv,omitempty"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
EVMChainID *utils.Big `json:"evmChainID"`
DatabaseTimeout *models.Interval `json:"databaseTimeout"`
DatabaseTimeoutEnv bool `json:"databaseTimeoutEnv,omitempty"`
ObservationGracePeriod *models.Interval `json:"observationGracePeriod"`
ObservationGracePeriodEnv bool `json:"observationGracePeriodEnv,omitempty"`
ContractTransmitterTransmitTimeout *models.Interval `json:"contractTransmitterTransmitTimeout"`
ContractTransmitterTransmitTimeoutEnv bool `json:"contractTransmitterTransmitTimeoutEnv,omitempty"`
}
// NewOffChainReportingSpec initializes a new OffChainReportingSpec from a
// job.OCROracleSpec
func NewOffChainReportingSpec(spec *job.OCROracleSpec) *OffChainReportingSpec {
return &OffChainReportingSpec{
ContractAddress: spec.ContractAddress,
P2PBootstrapPeers: spec.P2PBootstrapPeers,
P2PV2Bootstrappers: spec.P2PV2Bootstrappers,
IsBootstrapPeer: spec.IsBootstrapPeer,
EncryptedOCRKeyBundleID: spec.EncryptedOCRKeyBundleID,
TransmitterAddress: spec.TransmitterAddress,
ObservationTimeout: spec.ObservationTimeout,
ObservationTimeoutEnv: spec.ObservationTimeoutEnv,
BlockchainTimeout: spec.BlockchainTimeout,
BlockchainTimeoutEnv: spec.BlockchainTimeoutEnv,
ContractConfigTrackerSubscribeInterval: spec.ContractConfigTrackerSubscribeInterval,
ContractConfigTrackerSubscribeIntervalEnv: spec.ContractConfigTrackerSubscribeIntervalEnv,
ContractConfigTrackerPollInterval: spec.ContractConfigTrackerPollInterval,
ContractConfigTrackerPollIntervalEnv: spec.ContractConfigTrackerPollIntervalEnv,
ContractConfigConfirmations: spec.ContractConfigConfirmations,
ContractConfigConfirmationsEnv: spec.ContractConfigConfirmationsEnv,
CreatedAt: spec.CreatedAt,
UpdatedAt: spec.UpdatedAt,
EVMChainID: spec.EVMChainID,
DatabaseTimeout: spec.DatabaseTimeout,
DatabaseTimeoutEnv: spec.DatabaseTimeoutEnv,
ObservationGracePeriod: spec.ObservationGracePeriod,
ObservationGracePeriodEnv: spec.ObservationGracePeriodEnv,
ContractTransmitterTransmitTimeout: spec.ContractTransmitterTransmitTimeout,
ContractTransmitterTransmitTimeoutEnv: spec.ContractTransmitterTransmitTimeoutEnv,
}
}
// OffChainReporting2Spec defines the spec details of a OffChainReporting2 Job
type OffChainReporting2Spec struct {
ContractID string `json:"contractID"`
Relay relay.Network `json:"relay"`
RelayConfig map[string]interface{} `json:"relayConfig"`
P2PV2Bootstrappers pq.StringArray `json:"p2pv2Bootstrappers"`
OCRKeyBundleID null.String `json:"ocrKeyBundleID"`
TransmitterID null.String `json:"transmitterID"`
ObservationTimeout models.Interval `json:"observationTimeout"`
BlockchainTimeout models.Interval `json:"blockchainTimeout"`
ContractConfigTrackerPollInterval models.Interval `json:"contractConfigTrackerPollInterval"`
ContractConfigConfirmations uint16 `json:"contractConfigConfirmations"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
}
// NewOffChainReporting2Spec initializes a new OffChainReportingSpec from a
// job.OCR2OracleSpec
func NewOffChainReporting2Spec(spec *job.OCR2OracleSpec) *OffChainReporting2Spec {
return &OffChainReporting2Spec{
ContractID: spec.ContractID,
Relay: spec.Relay,
RelayConfig: spec.RelayConfig,
P2PV2Bootstrappers: spec.P2PV2Bootstrappers,
OCRKeyBundleID: spec.OCRKeyBundleID,
TransmitterID: spec.TransmitterID,
BlockchainTimeout: spec.BlockchainTimeout,
ContractConfigTrackerPollInterval: spec.ContractConfigTrackerPollInterval,
ContractConfigConfirmations: spec.ContractConfigConfirmations,
CreatedAt: spec.CreatedAt,
UpdatedAt: spec.UpdatedAt,
}
}
// PipelineSpec defines the spec details of the pipeline
type PipelineSpec struct {
ID int32 `json:"id"`
JobID int32 `json:"jobID"`
DotDAGSource string `json:"dotDagSource"`
}
// NewPipelineSpec generates a new PipelineSpec from a pipeline.Spec
func NewPipelineSpec(spec *pipeline.Spec) PipelineSpec {
return PipelineSpec{
ID: spec.ID,
JobID: spec.JobID,
DotDAGSource: spec.DotDagSource,
}
}
// KeeperSpec defines the spec details of a Keeper Job
type KeeperSpec struct {
ContractAddress ethkey.EIP55Address `json:"contractAddress"`
FromAddress ethkey.EIP55Address `json:"fromAddress"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
EVMChainID *utils.Big `json:"evmChainID"`
}
// NewKeeperSpec generates a new KeeperSpec from a job.KeeperSpec
func NewKeeperSpec(spec *job.KeeperSpec) *KeeperSpec {
return &KeeperSpec{
ContractAddress: spec.ContractAddress,
FromAddress: spec.FromAddress,
CreatedAt: spec.CreatedAt,
UpdatedAt: spec.UpdatedAt,
EVMChainID: spec.EVMChainID,
}
}
// WebhookSpec defines the spec details of a Webhook Job
type WebhookSpec struct {
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
}
// NewWebhookSpec generates a new WebhookSpec from a job.WebhookSpec
func NewWebhookSpec(spec *job.WebhookSpec) *WebhookSpec {
return &WebhookSpec{
CreatedAt: spec.CreatedAt,
UpdatedAt: spec.UpdatedAt,
}
}
// CronSpec defines the spec details of a Cron Job
type CronSpec struct {
CronSchedule string `json:"schedule" tom:"schedule"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
}
// NewCronSpec generates a new CronSpec from a job.CronSpec
func NewCronSpec(spec *job.CronSpec) *CronSpec {
return &CronSpec{
CronSchedule: spec.CronSchedule,
CreatedAt: spec.CreatedAt,
UpdatedAt: spec.UpdatedAt,
}
}
type VRFSpec struct {
BatchCoordinatorAddress *ethkey.EIP55Address `json:"batchCoordinatorAddress"`
BatchFulfillmentEnabled bool `json:"batchFulfillmentEnabled"`
BatchFulfillmentGasMultiplier float64 `json:"batchFulfillmentGasMultiplier"`
CoordinatorAddress ethkey.EIP55Address `json:"coordinatorAddress"`
PublicKey secp256k1.PublicKey `json:"publicKey"`
FromAddresses []ethkey.EIP55Address `json:"fromAddresses"`
PollPeriod models.Duration `json:"pollPeriod"`
MinIncomingConfirmations uint32 `json:"confirmations"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
EVMChainID *utils.Big `json:"evmChainID"`
ChunkSize uint32 `json:"chunkSize"`
RequestTimeout models.Duration `json:"requestTimeout"`
BackoffInitialDelay models.Duration `json:"backoffInitialDelay"`
BackoffMaxDelay models.Duration `json:"backoffMaxDelay"`
GasLanePrice *assets.Wei `json:"gasLanePrice"`
}
func NewVRFSpec(spec *job.VRFSpec) *VRFSpec {
return &VRFSpec{
BatchCoordinatorAddress: spec.BatchCoordinatorAddress,
BatchFulfillmentEnabled: spec.BatchFulfillmentEnabled,
CoordinatorAddress: spec.CoordinatorAddress,
PublicKey: spec.PublicKey,
FromAddresses: spec.FromAddresses,
PollPeriod: models.MustMakeDuration(spec.PollPeriod),
MinIncomingConfirmations: spec.MinIncomingConfirmations,
CreatedAt: spec.CreatedAt,
UpdatedAt: spec.UpdatedAt,
EVMChainID: spec.EVMChainID,
ChunkSize: spec.ChunkSize,
RequestTimeout: models.MustMakeDuration(spec.RequestTimeout),
BackoffInitialDelay: models.MustMakeDuration(spec.BackoffInitialDelay),
BackoffMaxDelay: models.MustMakeDuration(spec.BackoffMaxDelay),
GasLanePrice: spec.GasLanePrice,
}
}
// BlockhashStoreSpec defines the job parameters for a blockhash store feeder job.
type BlockhashStoreSpec struct {
CoordinatorV1Address *ethkey.EIP55Address `json:"coordinatorV1Address"`
CoordinatorV2Address *ethkey.EIP55Address `json:"coordinatorV2Address"`
WaitBlocks int32 `json:"waitBlocks"`
LookbackBlocks int32 `json:"lookbackBlocks"`
BlockhashStoreAddress ethkey.EIP55Address `json:"blockhashStoreAddress"`
PollPeriod time.Duration `json:"pollPeriod"`
RunTimeout time.Duration `json:"runTimeout"`
EVMChainID *utils.Big `json:"evmChainID"`
FromAddresses []ethkey.EIP55Address `json:"fromAddresses"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
}
// NewBlockhashStoreSpec creates a new BlockhashStoreSpec for the given parameters.
func NewBlockhashStoreSpec(spec *job.BlockhashStoreSpec) *BlockhashStoreSpec {
return &BlockhashStoreSpec{
CoordinatorV1Address: spec.CoordinatorV1Address,
CoordinatorV2Address: spec.CoordinatorV2Address,
WaitBlocks: spec.WaitBlocks,
LookbackBlocks: spec.LookbackBlocks,
BlockhashStoreAddress: spec.BlockhashStoreAddress,
PollPeriod: spec.PollPeriod,
RunTimeout: spec.RunTimeout,
EVMChainID: spec.EVMChainID,
FromAddresses: spec.FromAddresses,
}
}
// BootstrapSpec defines the spec details of a BootstrapSpec Job
type BootstrapSpec struct {
ContractID string `json:"contractID"`
Relay relay.Network `json:"relay"`
RelayConfig map[string]interface{} `json:"relayConfig"`
BlockchainTimeout models.Interval `json:"blockchainTimeout"`
ContractConfigTrackerSubscribeInterval models.Interval `json:"contractConfigTrackerSubscribeInterval"`
ContractConfigTrackerPollInterval models.Interval `json:"contractConfigTrackerPollInterval"`
ContractConfigConfirmations uint16 `json:"contractConfigConfirmations"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
}
// NewBootstrapSpec initializes a new BootstrapSpec from a job.BootstrapSpec
func NewBootstrapSpec(spec *job.BootstrapSpec) *BootstrapSpec {
return &BootstrapSpec{
ContractID: spec.ContractID,
Relay: spec.Relay,
RelayConfig: spec.RelayConfig,
BlockchainTimeout: spec.BlockchainTimeout,
ContractConfigTrackerPollInterval: spec.ContractConfigTrackerPollInterval,
ContractConfigConfirmations: spec.ContractConfigConfirmations,
CreatedAt: spec.CreatedAt,
UpdatedAt: spec.UpdatedAt,
}
}
// JobError represents errors on the job
type JobError struct {
ID int64 `json:"id"`
Description string `json:"description"`
Occurrences uint `json:"occurrences"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
}
func NewJobError(e job.SpecError) JobError {
return JobError{
ID: e.ID,
Description: e.Description,
Occurrences: e.Occurrences,
CreatedAt: e.CreatedAt,
UpdatedAt: e.UpdatedAt,
}
}
// JobResource represents a JobResource
type JobResource struct {
JAID
Name string `json:"name"`
Type JobSpecType `json:"type"`
SchemaVersion uint32 `json:"schemaVersion"`
GasLimit clnull.Uint32 `json:"gasLimit"`
ForwardingAllowed bool `json:"forwardingAllowed"`
MaxTaskDuration models.Interval `json:"maxTaskDuration"`
ExternalJobID uuid.UUID `json:"externalJobID"`
DirectRequestSpec *DirectRequestSpec `json:"directRequestSpec"`
FluxMonitorSpec *FluxMonitorSpec `json:"fluxMonitorSpec"`
CronSpec *CronSpec `json:"cronSpec"`
OffChainReportingSpec *OffChainReportingSpec `json:"offChainReportingOracleSpec"`
OffChainReporting2Spec *OffChainReporting2Spec `json:"offChainReporting2OracleSpec"`
KeeperSpec *KeeperSpec `json:"keeperSpec"`
VRFSpec *VRFSpec `json:"vrfSpec"`
WebhookSpec *WebhookSpec `json:"webhookSpec"`
BlockhashStoreSpec *BlockhashStoreSpec `json:"blockhashStoreSpec"`
BootstrapSpec *BootstrapSpec `json:"bootstrapSpec"`
PipelineSpec PipelineSpec `json:"pipelineSpec"`
Errors []JobError `json:"errors"`
}
// NewJobResource initializes a new JSONAPI job resource
func NewJobResource(j job.Job) *JobResource {
resource := &JobResource{
JAID: NewJAIDInt32(j.ID),
Name: j.Name.ValueOrZero(),
Type: JobSpecType(j.Type),
SchemaVersion: j.SchemaVersion,
GasLimit: j.GasLimit,
ForwardingAllowed: j.ForwardingAllowed,
MaxTaskDuration: j.MaxTaskDuration,
PipelineSpec: NewPipelineSpec(j.PipelineSpec),
ExternalJobID: j.ExternalJobID,
}
switch j.Type {
case job.DirectRequest:
resource.DirectRequestSpec = NewDirectRequestSpec(j.DirectRequestSpec)
case job.FluxMonitor:
resource.FluxMonitorSpec = NewFluxMonitorSpec(j.FluxMonitorSpec)
case job.Cron:
resource.CronSpec = NewCronSpec(j.CronSpec)
case job.OffchainReporting:
resource.OffChainReportingSpec = NewOffChainReportingSpec(j.OCROracleSpec)
case job.OffchainReporting2:
resource.OffChainReporting2Spec = NewOffChainReporting2Spec(j.OCR2OracleSpec)
case job.Keeper:
resource.KeeperSpec = NewKeeperSpec(j.KeeperSpec)
case job.VRF:
resource.VRFSpec = NewVRFSpec(j.VRFSpec)
case job.Webhook:
resource.WebhookSpec = NewWebhookSpec(j.WebhookSpec)
case job.BlockhashStore:
resource.BlockhashStoreSpec = NewBlockhashStoreSpec(j.BlockhashStoreSpec)
case job.Bootstrap:
resource.BootstrapSpec = NewBootstrapSpec(j.BootstrapSpec)
}
jes := []JobError{}
for _, e := range j.JobSpecErrors {
jes = append(jes, NewJobError((e)))
}
resource.Errors = jes
return resource
}
// GetName implements the api2go EntityNamer interface
func (r JobResource) GetName() string {
return "jobs"
}