/
zz_workflow_types.go
executable file
·474 lines (363 loc) · 21.3 KB
/
zz_workflow_types.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
// SPDX-FileCopyrightText: 2023 The Crossplane Authors <https://crossplane.io>
//
// SPDX-License-Identifier: Apache-2.0
/*
Copyright 2024 Upbound Inc.
*/
// Code generated by upjet. DO NOT EDIT.
package v1alpha1
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime/schema"
v1 "github.com/crossplane/crossplane-runtime/apis/common/v1"
)
type ConfigurationInitParameters struct {
// An NRQL query to run
// enrichment's NRQL query
Query *string `json:"query,omitempty" tf:"query,omitempty"`
}
type ConfigurationObservation struct {
// An NRQL query to run
// enrichment's NRQL query
Query *string `json:"query,omitempty" tf:"query,omitempty"`
}
type ConfigurationParameters struct {
// An NRQL query to run
// enrichment's NRQL query
// +kubebuilder:validation:Optional
Query *string `json:"query" tf:"query,omitempty"`
}
type DestinationInitParameters struct {
// Id of a notification_channel to use for notifications. Please note that you have to use a
// notification channel, not an alert_channel.
// (Required) Destination's channel id.
// +crossplane:generate:reference:type=github.com/crossplane-contrib/crossplane-provider-newrelic/apis/alert/v1alpha1.Channel
ChannelID *string `json:"channelId,omitempty" tf:"channel_id,omitempty"`
// Reference to a Channel in alert to populate channelId.
// +kubebuilder:validation:Optional
ChannelIDRef *v1.Reference `json:"channelIdRef,omitempty" tf:"-"`
// Selector for a Channel in alert to populate channelId.
// +kubebuilder:validation:Optional
ChannelIDSelector *v1.Selector `json:"channelIdSelector,omitempty" tf:"-"`
// Issue events to notify on. The value is a list of possible issue events. See Notification Triggers below for details.
// List of triggers to notify about in this destination configuration.
NotificationTriggers []*string `json:"notificationTriggers,omitempty" tf:"notification_triggers,omitempty"`
}
type DestinationObservation struct {
// Id of a notification_channel to use for notifications. Please note that you have to use a
// notification channel, not an alert_channel.
// (Required) Destination's channel id.
ChannelID *string `json:"channelId,omitempty" tf:"channel_id,omitempty"`
// The name of the workflow.
// (Required) Destination's name.
Name *string `json:"name,omitempty" tf:"name,omitempty"`
// Issue events to notify on. The value is a list of possible issue events. See Notification Triggers below for details.
// List of triggers to notify about in this destination configuration.
NotificationTriggers []*string `json:"notificationTriggers,omitempty" tf:"notification_triggers,omitempty"`
// Type of the filter. Please just set this field to FILTER. The field is likely to be deprecated/removed in the near future.
// (Required) The type of the destination. One of: (EMAIL, EVENT_BRIDGE, PAGERDUTY_ACCOUNT_INTEGRATION, PAGERDUTY_SERVICE_INTEGRATION, SERVICE_NOW, WEBHOOK, MOBILE_PUSH, SLACK, JIRA).
Type *string `json:"type,omitempty" tf:"type,omitempty"`
}
type DestinationParameters struct {
// Id of a notification_channel to use for notifications. Please note that you have to use a
// notification channel, not an alert_channel.
// (Required) Destination's channel id.
// +crossplane:generate:reference:type=github.com/crossplane-contrib/crossplane-provider-newrelic/apis/alert/v1alpha1.Channel
// +kubebuilder:validation:Optional
ChannelID *string `json:"channelId,omitempty" tf:"channel_id,omitempty"`
// Reference to a Channel in alert to populate channelId.
// +kubebuilder:validation:Optional
ChannelIDRef *v1.Reference `json:"channelIdRef,omitempty" tf:"-"`
// Selector for a Channel in alert to populate channelId.
// +kubebuilder:validation:Optional
ChannelIDSelector *v1.Selector `json:"channelIdSelector,omitempty" tf:"-"`
// Issue events to notify on. The value is a list of possible issue events. See Notification Triggers below for details.
// List of triggers to notify about in this destination configuration.
// +kubebuilder:validation:Optional
NotificationTriggers []*string `json:"notificationTriggers,omitempty" tf:"notification_triggers,omitempty"`
}
type EnrichmentsInitParameters struct {
// a wrapper block
// (Required) Nrql type Enrichments.
Nrql []NrqlInitParameters `json:"nrql,omitempty" tf:"nrql,omitempty"`
}
type EnrichmentsObservation struct {
// a wrapper block
// (Required) Nrql type Enrichments.
Nrql []NrqlObservation `json:"nrql,omitempty" tf:"nrql,omitempty"`
}
type EnrichmentsParameters struct {
// a wrapper block
// (Required) Nrql type Enrichments.
// +kubebuilder:validation:Optional
Nrql []NrqlParameters `json:"nrql" tf:"nrql,omitempty"`
}
type IssuesFilterInitParameters struct {
// The name of the filter. It can't be empty.
// (Required) Filter's name.
Name *string `json:"name,omitempty" tf:"name,omitempty"`
// A condition an issue event should satisfy to be processed by the workflow
Predicate []PredicateInitParameters `json:"predicate,omitempty" tf:"predicate,omitempty"`
// Type of the filter. Please just set this field to FILTER. The field is likely to be deprecated/removed in the near future.
// (Required) The type of the filter. One of: (FILTER, VIEW).
Type *string `json:"type,omitempty" tf:"type,omitempty"`
}
type IssuesFilterObservation struct {
// The ID of the workflow.
// filter id.
FilterID *string `json:"filterId,omitempty" tf:"filter_id,omitempty"`
// The name of the filter. It can't be empty.
// (Required) Filter's name.
Name *string `json:"name,omitempty" tf:"name,omitempty"`
// A condition an issue event should satisfy to be processed by the workflow
Predicate []PredicateObservation `json:"predicate,omitempty" tf:"predicate,omitempty"`
// Type of the filter. Please just set this field to FILTER. The field is likely to be deprecated/removed in the near future.
// (Required) The type of the filter. One of: (FILTER, VIEW).
Type *string `json:"type,omitempty" tf:"type,omitempty"`
}
type IssuesFilterParameters struct {
// The name of the filter. It can't be empty.
// (Required) Filter's name.
// +kubebuilder:validation:Optional
Name *string `json:"name" tf:"name,omitempty"`
// A condition an issue event should satisfy to be processed by the workflow
// +kubebuilder:validation:Optional
Predicate []PredicateParameters `json:"predicate,omitempty" tf:"predicate,omitempty"`
// Type of the filter. Please just set this field to FILTER. The field is likely to be deprecated/removed in the near future.
// (Required) The type of the filter. One of: (FILTER, VIEW).
// +kubebuilder:validation:Optional
Type *string `json:"type" tf:"type,omitempty"`
}
type NrqlInitParameters struct {
// Another wrapper block
// A set of key-value pairs to represent a enrichment configuration.
Configuration []ConfigurationInitParameters `json:"configuration,omitempty" tf:"configuration,omitempty"`
// The name of the workflow.
// (Required) Enrichment's name.
Name *string `json:"name,omitempty" tf:"name,omitempty"`
}
type NrqlObservation struct {
// Determines the New Relic account in which the workflow is created. Defaults to the account defined in the provider section.
// The account id of the enrichment.
AccountID *float64 `json:"accountId,omitempty" tf:"account_id,omitempty"`
// Another wrapper block
// A set of key-value pairs to represent a enrichment configuration.
Configuration []ConfigurationObservation `json:"configuration,omitempty" tf:"configuration,omitempty"`
// The ID of the workflow.
// Enrichment's id.
EnrichmentID *string `json:"enrichmentId,omitempty" tf:"enrichment_id,omitempty"`
// The name of the workflow.
// (Required) Enrichment's name.
Name *string `json:"name,omitempty" tf:"name,omitempty"`
// Type of the filter. Please just set this field to FILTER. The field is likely to be deprecated/removed in the near future.
// The type of the enrichment. One of: (NRQL).
Type *string `json:"type,omitempty" tf:"type,omitempty"`
}
type NrqlParameters struct {
// Another wrapper block
// A set of key-value pairs to represent a enrichment configuration.
// +kubebuilder:validation:Optional
Configuration []ConfigurationParameters `json:"configuration" tf:"configuration,omitempty"`
// The name of the workflow.
// (Required) Enrichment's name.
// +kubebuilder:validation:Optional
Name *string `json:"name" tf:"name,omitempty"`
}
type PredicateInitParameters struct {
// Issue event attribute to check
// (Required) predicate's attribute.
Attribute *string `json:"attribute,omitempty" tf:"attribute,omitempty"`
// An operator to use to compare the attribute with the provided values, see supported operators below
// The type of the operator. One of: (CONTAINS, DOES_NOT_CONTAIN, DOES_NOT_EQUAL, DOES_NOT_EXACTLY_MATCH, ENDS_WITH, EQUAL, EXACTLY_MATCHES, GREATER_OR_EQUAL, GREATER_THAN, IS, IS_NOT, LESS_OR_EQUAL, LESS_THAN, STARTS_WITH).
Operator *string `json:"operator,omitempty" tf:"operator,omitempty"`
// The attribute must match any of the values in this list
// List of predicate values.
Values []*string `json:"values,omitempty" tf:"values,omitempty"`
}
type PredicateObservation struct {
// Issue event attribute to check
// (Required) predicate's attribute.
Attribute *string `json:"attribute,omitempty" tf:"attribute,omitempty"`
// An operator to use to compare the attribute with the provided values, see supported operators below
// The type of the operator. One of: (CONTAINS, DOES_NOT_CONTAIN, DOES_NOT_EQUAL, DOES_NOT_EXACTLY_MATCH, ENDS_WITH, EQUAL, EXACTLY_MATCHES, GREATER_OR_EQUAL, GREATER_THAN, IS, IS_NOT, LESS_OR_EQUAL, LESS_THAN, STARTS_WITH).
Operator *string `json:"operator,omitempty" tf:"operator,omitempty"`
// The attribute must match any of the values in this list
// List of predicate values.
Values []*string `json:"values,omitempty" tf:"values,omitempty"`
}
type PredicateParameters struct {
// Issue event attribute to check
// (Required) predicate's attribute.
// +kubebuilder:validation:Optional
Attribute *string `json:"attribute" tf:"attribute,omitempty"`
// An operator to use to compare the attribute with the provided values, see supported operators below
// The type of the operator. One of: (CONTAINS, DOES_NOT_CONTAIN, DOES_NOT_EQUAL, DOES_NOT_EXACTLY_MATCH, ENDS_WITH, EQUAL, EXACTLY_MATCHES, GREATER_OR_EQUAL, GREATER_THAN, IS, IS_NOT, LESS_OR_EQUAL, LESS_THAN, STARTS_WITH).
// +kubebuilder:validation:Optional
Operator *string `json:"operator" tf:"operator,omitempty"`
// The attribute must match any of the values in this list
// List of predicate values.
// +kubebuilder:validation:Optional
Values []*string `json:"values" tf:"values,omitempty"`
}
type WorkflowInitParameters struct {
// Determines the New Relic account in which the workflow is created. Defaults to the account defined in the provider section.
// The account id of the workflow.
AccountID *float64 `json:"accountId,omitempty" tf:"account_id,omitempty"`
// Notification configuration. See Nested destination blocks below for details.
// Workflow's destination configuration.
Destination []DestinationInitParameters `json:"destination,omitempty" tf:"destination,omitempty"`
// DEPRECATED Whether destinations are enabled. Please use enabled instead:
// these two are different flags, but they are functionally identical. Defaults to true.
// Indicates whether the destinations are enabled.
DestinationsEnabled *bool `json:"destinationsEnabled,omitempty" tf:"destinations_enabled,omitempty"`
// Whether workflow is enabled. Defaults to true.
// Indicates whether the workflow is enabled.
Enabled *bool `json:"enabled,omitempty" tf:"enabled,omitempty"`
// Workflow's enrichments. See Nested enrichments blocks below for details.
// Enrichments can give additional context on alert notifications by adding NRQL query results to them.
Enrichments []EnrichmentsInitParameters `json:"enrichments,omitempty" tf:"enrichments,omitempty"`
// Whether enrichments are enabled. Defaults to true.
// Indicates whether the enrichments are enabled.
EnrichmentsEnabled *bool `json:"enrichmentsEnabled,omitempty" tf:"enrichments_enabled,omitempty"`
// A filter used to identify issues handled by this workflow. See Nested issues_filter blocks below for details.
IssuesFilter []IssuesFilterInitParameters `json:"issuesFilter,omitempty" tf:"issues_filter,omitempty"`
// How to handle muted issues. See Muting Rules below for details.
// The type of the muting rule handling. One of: (NOTIFY_ALL_ISSUES, DONT_NOTIFY_FULLY_MUTED_ISSUES, DONT_NOTIFY_FULLY_OR_PARTIALLY_MUTED_ISSUES).
MutingRulesHandling *string `json:"mutingRulesHandling,omitempty" tf:"muting_rules_handling,omitempty"`
// The name of the workflow.
// (Required) The name of the workflow.
Name *string `json:"name,omitempty" tf:"name,omitempty"`
}
type WorkflowObservation struct {
// Determines the New Relic account in which the workflow is created. Defaults to the account defined in the provider section.
// The account id of the workflow.
AccountID *float64 `json:"accountId,omitempty" tf:"account_id,omitempty"`
// Notification configuration. See Nested destination blocks below for details.
// Workflow's destination configuration.
Destination []DestinationObservation `json:"destination,omitempty" tf:"destination,omitempty"`
// DEPRECATED Whether destinations are enabled. Please use enabled instead:
// these two are different flags, but they are functionally identical. Defaults to true.
// Indicates whether the destinations are enabled.
DestinationsEnabled *bool `json:"destinationsEnabled,omitempty" tf:"destinations_enabled,omitempty"`
// Whether workflow is enabled. Defaults to true.
// Indicates whether the workflow is enabled.
Enabled *bool `json:"enabled,omitempty" tf:"enabled,omitempty"`
// Workflow's enrichments. See Nested enrichments blocks below for details.
// Enrichments can give additional context on alert notifications by adding NRQL query results to them.
Enrichments []EnrichmentsObservation `json:"enrichments,omitempty" tf:"enrichments,omitempty"`
// Whether enrichments are enabled. Defaults to true.
// Indicates whether the enrichments are enabled.
EnrichmentsEnabled *bool `json:"enrichmentsEnabled,omitempty" tf:"enrichments_enabled,omitempty"`
// The ID of the workflow.
// Workflow entity GUID
GUID *string `json:"guid,omitempty" tf:"guid,omitempty"`
// The ID of the workflow.
ID *string `json:"id,omitempty" tf:"id,omitempty"`
// A filter used to identify issues handled by this workflow. See Nested issues_filter blocks below for details.
IssuesFilter []IssuesFilterObservation `json:"issuesFilter,omitempty" tf:"issues_filter,omitempty"`
// The last time notification was sent for this workflow.
LastRun *string `json:"lastRun,omitempty" tf:"last_run,omitempty"`
// How to handle muted issues. See Muting Rules below for details.
// The type of the muting rule handling. One of: (NOTIFY_ALL_ISSUES, DONT_NOTIFY_FULLY_MUTED_ISSUES, DONT_NOTIFY_FULLY_OR_PARTIALLY_MUTED_ISSUES).
MutingRulesHandling *string `json:"mutingRulesHandling,omitempty" tf:"muting_rules_handling,omitempty"`
// The name of the workflow.
// (Required) The name of the workflow.
Name *string `json:"name,omitempty" tf:"name,omitempty"`
// The ID of the workflow.
// The id of the workflow.
WorkflowID *string `json:"workflowId,omitempty" tf:"workflow_id,omitempty"`
}
type WorkflowParameters struct {
// Determines the New Relic account in which the workflow is created. Defaults to the account defined in the provider section.
// The account id of the workflow.
// +kubebuilder:validation:Optional
AccountID *float64 `json:"accountId,omitempty" tf:"account_id,omitempty"`
// Notification configuration. See Nested destination blocks below for details.
// Workflow's destination configuration.
// +kubebuilder:validation:Optional
Destination []DestinationParameters `json:"destination,omitempty" tf:"destination,omitempty"`
// DEPRECATED Whether destinations are enabled. Please use enabled instead:
// these two are different flags, but they are functionally identical. Defaults to true.
// Indicates whether the destinations are enabled.
// +kubebuilder:validation:Optional
DestinationsEnabled *bool `json:"destinationsEnabled,omitempty" tf:"destinations_enabled,omitempty"`
// Whether workflow is enabled. Defaults to true.
// Indicates whether the workflow is enabled.
// +kubebuilder:validation:Optional
Enabled *bool `json:"enabled,omitempty" tf:"enabled,omitempty"`
// Workflow's enrichments. See Nested enrichments blocks below for details.
// Enrichments can give additional context on alert notifications by adding NRQL query results to them.
// +kubebuilder:validation:Optional
Enrichments []EnrichmentsParameters `json:"enrichments,omitempty" tf:"enrichments,omitempty"`
// Whether enrichments are enabled. Defaults to true.
// Indicates whether the enrichments are enabled.
// +kubebuilder:validation:Optional
EnrichmentsEnabled *bool `json:"enrichmentsEnabled,omitempty" tf:"enrichments_enabled,omitempty"`
// A filter used to identify issues handled by this workflow. See Nested issues_filter blocks below for details.
// +kubebuilder:validation:Optional
IssuesFilter []IssuesFilterParameters `json:"issuesFilter,omitempty" tf:"issues_filter,omitempty"`
// How to handle muted issues. See Muting Rules below for details.
// The type of the muting rule handling. One of: (NOTIFY_ALL_ISSUES, DONT_NOTIFY_FULLY_MUTED_ISSUES, DONT_NOTIFY_FULLY_OR_PARTIALLY_MUTED_ISSUES).
// +kubebuilder:validation:Optional
MutingRulesHandling *string `json:"mutingRulesHandling,omitempty" tf:"muting_rules_handling,omitempty"`
// The name of the workflow.
// (Required) The name of the workflow.
// +kubebuilder:validation:Optional
Name *string `json:"name,omitempty" tf:"name,omitempty"`
}
// WorkflowSpec defines the desired state of Workflow
type WorkflowSpec struct {
v1.ResourceSpec `json:",inline"`
ForProvider WorkflowParameters `json:"forProvider"`
// THIS IS A BETA FIELD. It will be honored
// unless the Management Policies feature flag is disabled.
// InitProvider holds the same fields as ForProvider, with the exception
// of Identifier and other resource reference fields. The fields that are
// in InitProvider are merged into ForProvider when the resource is created.
// The same fields are also added to the terraform ignore_changes hook, to
// avoid updating them after creation. This is useful for fields that are
// required on creation, but we do not desire to update them after creation,
// for example because of an external controller is managing them, like an
// autoscaler.
InitProvider WorkflowInitParameters `json:"initProvider,omitempty"`
}
// WorkflowStatus defines the observed state of Workflow.
type WorkflowStatus struct {
v1.ResourceStatus `json:",inline"`
AtProvider WorkflowObservation `json:"atProvider,omitempty"`
}
// +kubebuilder:object:root=true
// Workflow is the Schema for the Workflows API. Create and manage a workflow in New Relic.
// +kubebuilder:printcolumn:name="READY",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status"
// +kubebuilder:printcolumn:name="SYNCED",type="string",JSONPath=".status.conditions[?(@.type=='Synced')].status"
// +kubebuilder:printcolumn:name="EXTERNAL-NAME",type="string",JSONPath=".metadata.annotations.crossplane\\.io/external-name"
// +kubebuilder:printcolumn:name="AGE",type="date",JSONPath=".metadata.creationTimestamp"
// +kubebuilder:subresource:status
// +kubebuilder:resource:scope=Cluster,categories={crossplane,managed,newrelic}
type Workflow struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
// +kubebuilder:validation:XValidation:rule="!('*' in self.managementPolicies || 'Create' in self.managementPolicies || 'Update' in self.managementPolicies) || has(self.forProvider.destination) || (has(self.initProvider) && has(self.initProvider.destination))",message="spec.forProvider.destination is a required parameter"
// +kubebuilder:validation:XValidation:rule="!('*' in self.managementPolicies || 'Create' in self.managementPolicies || 'Update' in self.managementPolicies) || has(self.forProvider.issuesFilter) || (has(self.initProvider) && has(self.initProvider.issuesFilter))",message="spec.forProvider.issuesFilter is a required parameter"
// +kubebuilder:validation:XValidation:rule="!('*' in self.managementPolicies || 'Create' in self.managementPolicies || 'Update' in self.managementPolicies) || has(self.forProvider.mutingRulesHandling) || (has(self.initProvider) && has(self.initProvider.mutingRulesHandling))",message="spec.forProvider.mutingRulesHandling is a required parameter"
// +kubebuilder:validation:XValidation:rule="!('*' in self.managementPolicies || 'Create' in self.managementPolicies || 'Update' in self.managementPolicies) || has(self.forProvider.name) || (has(self.initProvider) && has(self.initProvider.name))",message="spec.forProvider.name is a required parameter"
Spec WorkflowSpec `json:"spec"`
Status WorkflowStatus `json:"status,omitempty"`
}
// +kubebuilder:object:root=true
// WorkflowList contains a list of Workflows
type WorkflowList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []Workflow `json:"items"`
}
// Repository type metadata.
var (
Workflow_Kind = "Workflow"
Workflow_GroupKind = schema.GroupKind{Group: CRDGroup, Kind: Workflow_Kind}.String()
Workflow_KindAPIVersion = Workflow_Kind + "." + CRDGroupVersion.String()
Workflow_GroupVersionKind = CRDGroupVersion.WithKind(Workflow_Kind)
)
func init() {
SchemeBuilder.Register(&Workflow{}, &WorkflowList{})
}