pulumi-newrelic 5.22.0__py3-none-any.whl → 5.58.0a1763707205__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of pulumi-newrelic might be problematic. Click here for more details.

Files changed (92) hide show
  1. pulumi_newrelic/__init__.py +28 -1
  2. pulumi_newrelic/_inputs.py +10385 -2976
  3. pulumi_newrelic/_utilities.py +50 -10
  4. pulumi_newrelic/account_management.py +48 -42
  5. pulumi_newrelic/alert_channel.py +165 -175
  6. pulumi_newrelic/alert_condition.py +307 -319
  7. pulumi_newrelic/alert_muting_rule.py +193 -140
  8. pulumi_newrelic/alert_policy.py +121 -117
  9. pulumi_newrelic/alert_policy_channel.py +89 -79
  10. pulumi_newrelic/api_access_key.py +195 -193
  11. pulumi_newrelic/browser_application.py +120 -114
  12. pulumi_newrelic/cloud/__init__.py +3 -1
  13. pulumi_newrelic/cloud/_inputs.py +4267 -2714
  14. pulumi_newrelic/cloud/aws_govcloud_integrations.py +206 -196
  15. pulumi_newrelic/cloud/aws_govcloud_link_account.py +143 -228
  16. pulumi_newrelic/cloud/aws_integrations.py +510 -1490
  17. pulumi_newrelic/cloud/aws_link_account.py +80 -76
  18. pulumi_newrelic/cloud/azure_integrations.py +673 -587
  19. pulumi_newrelic/cloud/azure_link_account.py +121 -117
  20. pulumi_newrelic/cloud/gcp_integrations.py +428 -408
  21. pulumi_newrelic/cloud/gcp_link_account.py +65 -61
  22. pulumi_newrelic/cloud/oci_link_account.py +926 -0
  23. pulumi_newrelic/cloud/outputs.py +1678 -2321
  24. pulumi_newrelic/config/__init__.py +2 -1
  25. pulumi_newrelic/config/__init__.pyi +8 -3
  26. pulumi_newrelic/config/vars.py +22 -17
  27. pulumi_newrelic/data_partition_rule.py +119 -117
  28. pulumi_newrelic/entity_tags.py +111 -53
  29. pulumi_newrelic/events_to_metrics_rule.py +106 -102
  30. pulumi_newrelic/get_account.py +41 -33
  31. pulumi_newrelic/get_alert_channel.py +73 -28
  32. pulumi_newrelic/get_alert_policy.py +82 -33
  33. pulumi_newrelic/get_application.py +51 -43
  34. pulumi_newrelic/get_authentication_domain.py +27 -23
  35. pulumi_newrelic/get_cloud_account.py +43 -35
  36. pulumi_newrelic/get_entity.py +126 -183
  37. pulumi_newrelic/get_group.py +76 -31
  38. pulumi_newrelic/get_key_transaction.py +117 -42
  39. pulumi_newrelic/get_notification_destination.py +75 -38
  40. pulumi_newrelic/get_obfuscation_expression.py +47 -39
  41. pulumi_newrelic/get_service_level_alert_helper.py +189 -171
  42. pulumi_newrelic/get_test_grok_pattern.py +47 -36
  43. pulumi_newrelic/get_user.py +39 -31
  44. pulumi_newrelic/group.py +59 -199
  45. pulumi_newrelic/infra_alert_condition.py +399 -405
  46. pulumi_newrelic/insights/__init__.py +2 -1
  47. pulumi_newrelic/insights/_inputs.py +71 -28
  48. pulumi_newrelic/insights/event.py +54 -52
  49. pulumi_newrelic/insights/outputs.py +28 -23
  50. pulumi_newrelic/key_transaction.py +465 -0
  51. pulumi_newrelic/log_parsing_rule.py +159 -157
  52. pulumi_newrelic/monitor_downtime.py +311 -331
  53. pulumi_newrelic/notification_channel.py +534 -464
  54. pulumi_newrelic/notification_destination.py +238 -141
  55. pulumi_newrelic/nrql_alert_condition.py +820 -614
  56. pulumi_newrelic/nrql_drop_rule.py +113 -151
  57. pulumi_newrelic/obfuscation_expression.py +80 -76
  58. pulumi_newrelic/obfuscation_rule.py +115 -109
  59. pulumi_newrelic/one_dashboard.py +110 -104
  60. pulumi_newrelic/one_dashboard_json.py +69 -63
  61. pulumi_newrelic/one_dashboard_raw.py +212 -206
  62. pulumi_newrelic/outputs.py +4936 -2234
  63. pulumi_newrelic/pipeline_cloud_rule.py +335 -0
  64. pulumi_newrelic/plugins/__init__.py +2 -1
  65. pulumi_newrelic/plugins/_inputs.py +519 -89
  66. pulumi_newrelic/plugins/application_settings.py +463 -187
  67. pulumi_newrelic/plugins/outputs.py +336 -74
  68. pulumi_newrelic/plugins/workload.py +313 -189
  69. pulumi_newrelic/provider.py +156 -142
  70. pulumi_newrelic/pulumi-plugin.json +2 -1
  71. pulumi_newrelic/service_level.py +263 -263
  72. pulumi_newrelic/synthetics/__init__.py +2 -1
  73. pulumi_newrelic/synthetics/_inputs.py +265 -108
  74. pulumi_newrelic/synthetics/alert_condition.py +170 -180
  75. pulumi_newrelic/synthetics/broken_links_monitor.py +297 -249
  76. pulumi_newrelic/synthetics/cert_check_monitor.py +306 -258
  77. pulumi_newrelic/synthetics/get_private_location.py +51 -47
  78. pulumi_newrelic/synthetics/get_secure_credential.py +39 -31
  79. pulumi_newrelic/synthetics/monitor.py +658 -460
  80. pulumi_newrelic/synthetics/multi_location_alert_condition.py +211 -205
  81. pulumi_newrelic/synthetics/outputs.py +92 -87
  82. pulumi_newrelic/synthetics/private_location.py +118 -112
  83. pulumi_newrelic/synthetics/script_monitor.py +613 -373
  84. pulumi_newrelic/synthetics/secure_credential.py +97 -95
  85. pulumi_newrelic/synthetics/step_monitor.py +445 -275
  86. pulumi_newrelic/user.py +84 -80
  87. pulumi_newrelic/workflow.py +336 -322
  88. {pulumi_newrelic-5.22.0.dist-info → pulumi_newrelic-5.58.0a1763707205.dist-info}/METADATA +7 -6
  89. pulumi_newrelic-5.58.0a1763707205.dist-info/RECORD +92 -0
  90. {pulumi_newrelic-5.22.0.dist-info → pulumi_newrelic-5.58.0a1763707205.dist-info}/WHEEL +1 -1
  91. pulumi_newrelic-5.22.0.dist-info/RECORD +0 -89
  92. {pulumi_newrelic-5.22.0.dist-info → pulumi_newrelic-5.58.0a1763707205.dist-info}/top_level.txt +0 -0
@@ -1,12 +1,17 @@
1
1
  # coding=utf-8
2
- # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
2
+ # *** WARNING: this file was generated by pulumi-language-python. ***
3
3
  # *** Do not edit by hand unless you're certain you know what you are doing! ***
4
4
 
5
- import copy
5
+ import builtins as _builtins
6
6
  import warnings
7
+ import sys
7
8
  import pulumi
8
9
  import pulumi.runtime
9
10
  from typing import Any, Mapping, Optional, Sequence, Union, overload
11
+ if sys.version_info >= (3, 11):
12
+ from typing import NotRequired, TypedDict, TypeAlias
13
+ else:
14
+ from typing_extensions import NotRequired, TypedDict, TypeAlias
10
15
  from . import _utilities
11
16
 
12
17
  __all__ = [
@@ -59,76 +64,76 @@ class GetServiceLevelAlertHelperResult:
59
64
  raise TypeError("Expected argument 'tolerated_budget_consumption' to be a float")
60
65
  pulumi.set(__self__, "tolerated_budget_consumption", tolerated_budget_consumption)
61
66
 
62
- @property
67
+ @_builtins.property
63
68
  @pulumi.getter(name="alertType")
64
- def alert_type(self) -> str:
69
+ def alert_type(self) -> _builtins.str:
65
70
  return pulumi.get(self, "alert_type")
66
71
 
67
- @property
72
+ @_builtins.property
68
73
  @pulumi.getter(name="customEvaluationPeriod")
69
- def custom_evaluation_period(self) -> Optional[int]:
74
+ def custom_evaluation_period(self) -> Optional[_builtins.int]:
70
75
  return pulumi.get(self, "custom_evaluation_period")
71
76
 
72
- @property
77
+ @_builtins.property
73
78
  @pulumi.getter(name="customToleratedBudgetConsumption")
74
- def custom_tolerated_budget_consumption(self) -> Optional[float]:
79
+ def custom_tolerated_budget_consumption(self) -> Optional[_builtins.float]:
75
80
  return pulumi.get(self, "custom_tolerated_budget_consumption")
76
81
 
77
- @property
82
+ @_builtins.property
78
83
  @pulumi.getter(name="evaluationPeriod")
79
- def evaluation_period(self) -> int:
84
+ def evaluation_period(self) -> _builtins.int:
80
85
  """
81
86
  (Computed) For non `custom` alert_type, this is the recommended for that type of alert. For `custom` alert_type it has the same value as `custom_evaluation_period`.
82
87
  """
83
88
  return pulumi.get(self, "evaluation_period")
84
89
 
85
- @property
90
+ @_builtins.property
86
91
  @pulumi.getter
87
- def id(self) -> str:
92
+ def id(self) -> _builtins.str:
88
93
  """
89
94
  The provider-assigned unique ID for this managed resource.
90
95
  """
91
96
  return pulumi.get(self, "id")
92
97
 
93
- @property
98
+ @_builtins.property
94
99
  @pulumi.getter(name="isBadEvents")
95
- def is_bad_events(self) -> Optional[bool]:
100
+ def is_bad_events(self) -> Optional[_builtins.bool]:
96
101
  return pulumi.get(self, "is_bad_events")
97
102
 
98
- @property
103
+ @_builtins.property
99
104
  @pulumi.getter
100
- def nrql(self) -> str:
105
+ def nrql(self) -> _builtins.str:
101
106
  """
102
107
  (Computed) The nrql query for the selected type of alert.
103
108
  """
104
109
  return pulumi.get(self, "nrql")
105
110
 
106
- @property
111
+ @_builtins.property
107
112
  @pulumi.getter(name="sliGuid")
108
- def sli_guid(self) -> str:
113
+ def sli_guid(self) -> _builtins.str:
109
114
  return pulumi.get(self, "sli_guid")
110
115
 
111
- @property
116
+ @_builtins.property
112
117
  @pulumi.getter(name="sloPeriod")
113
- def slo_period(self) -> int:
118
+ def slo_period(self) -> _builtins.int:
114
119
  return pulumi.get(self, "slo_period")
115
120
 
116
- @property
121
+ @_builtins.property
117
122
  @pulumi.getter(name="sloTarget")
118
- def slo_target(self) -> float:
123
+ def slo_target(self) -> _builtins.float:
119
124
  return pulumi.get(self, "slo_target")
120
125
 
121
- @property
126
+ @_builtins.property
122
127
  @pulumi.getter
123
- def threshold(self) -> float:
128
+ def threshold(self) -> _builtins.float:
124
129
  """
125
130
  (Computed) The computed threshold given the provided arguments.
126
131
  """
127
132
  return pulumi.get(self, "threshold")
128
133
 
129
- @property
134
+ @_builtins.property
130
135
  @pulumi.getter(name="toleratedBudgetConsumption")
131
- def tolerated_budget_consumption(self) -> float:
136
+ def tolerated_budget_consumption(self) -> _builtins.float:
132
137
  """
133
138
  (Computed) For non `custom` alert_type, this is the recommended for that type of alert. For `custom` alert_type it has the same value as `custom_tolerated_budget_consumption`.
134
139
  """
@@ -155,13 +160,13 @@ class AwaitableGetServiceLevelAlertHelperResult(GetServiceLevelAlertHelperResult
155
160
  tolerated_budget_consumption=self.tolerated_budget_consumption)
156
161
 
157
162
 
158
- def get_service_level_alert_helper(alert_type: Optional[str] = None,
159
- custom_evaluation_period: Optional[int] = None,
160
- custom_tolerated_budget_consumption: Optional[float] = None,
161
- is_bad_events: Optional[bool] = None,
162
- sli_guid: Optional[str] = None,
163
- slo_period: Optional[int] = None,
164
- slo_target: Optional[float] = None,
163
+ def get_service_level_alert_helper(alert_type: Optional[_builtins.str] = None,
164
+ custom_evaluation_period: Optional[_builtins.int] = None,
165
+ custom_tolerated_budget_consumption: Optional[_builtins.float] = None,
166
+ is_bad_events: Optional[_builtins.bool] = None,
167
+ sli_guid: Optional[_builtins.str] = None,
168
+ slo_period: Optional[_builtins.int] = None,
169
+ slo_target: Optional[_builtins.float] = None,
165
170
  opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetServiceLevelAlertHelperResult:
166
171
  """
167
172
  Use this data source to obtain the necessary fields to set up alerts on your service levels. It can be used for a `custom` alert_type in order to set up an alert with custom tolerated budget consumption and custom evaluation period or for recommended ones like `fast_burn` or `slow_burn`. For more information check [the documentation](https://docs.newrelic.com/docs/service-level-management/alerts-slm/).
@@ -170,7 +175,6 @@ def get_service_level_alert_helper(alert_type: Optional[str] = None,
170
175
 
171
176
  Firstly set up your service level objective, we recommend using local variables for the `target` and `time_window.rolling.count`, as they are also necessary for the helper.
172
177
 
173
- <!--Start PulumiCodeChooser -->
174
178
  ```python
175
179
  import pulumi
176
180
  import pulumi_newrelic as newrelic
@@ -179,113 +183,111 @@ def get_service_level_alert_helper(alert_type: Optional[str] = None,
179
183
  foo_period = 28
180
184
  foo = newrelic.ServiceLevel("foo",
181
185
  guid="MXxBUE18QVBQTElDQVRJT058MQ",
186
+ name="Latency",
182
187
  description="Proportion of requests that are served faster than a threshold.",
183
- events=newrelic.ServiceLevelEventsArgs(
184
- account_id=12345678,
185
- valid_events=newrelic.ServiceLevelEventsValidEventsArgs(
186
- from_="Transaction",
187
- where="appName = 'Example application' AND (transactionType='Web')",
188
- ),
189
- bad_events=newrelic.ServiceLevelEventsBadEventsArgs(
190
- from_="Transaction",
191
- where="appName = 'Example application' AND (transactionType= 'Web') AND duration > 0.1",
192
- ),
193
- ),
194
- objective=newrelic.ServiceLevelObjectiveArgs(
195
- target=foo_target,
196
- time_window=newrelic.ServiceLevelObjectiveTimeWindowArgs(
197
- rolling=newrelic.ServiceLevelObjectiveTimeWindowRollingArgs(
198
- count=foo_period,
199
- unit="DAY",
200
- ),
201
- ),
202
- ))
188
+ events={
189
+ "account_id": "12345678",
190
+ "valid_events": {
191
+ "from_": "Transaction",
192
+ "where": "appName = 'Example application' AND (transactionType='Web')",
193
+ },
194
+ "bad_events": {
195
+ "from_": "Transaction",
196
+ "where": "appName = 'Example application' AND (transactionType= 'Web') AND duration > 0.1",
197
+ },
198
+ },
199
+ objective={
200
+ "target": foo_target,
201
+ "time_window": {
202
+ "rolling": {
203
+ "count": foo_period,
204
+ "unit": "DAY",
205
+ },
206
+ },
207
+ })
203
208
  ```
204
- <!--End PulumiCodeChooser -->
205
209
  Then use the helper to obtain the necessary fields to set up an alert on that Service Level.
206
210
  Note that the Service Level was set up using bad events, that's why `is_bad_events` is set to `true`.
207
211
  If the Service Level was configured with good events that would be unnecessary as the field defaults to `false`.
208
212
 
209
213
  Here is an example of a `slow_burn` alert.
210
214
 
211
- <!--Start PulumiCodeChooser -->
212
215
  ```python
213
216
  import pulumi
214
217
  import pulumi_newrelic as newrelic
215
218
 
216
219
  foo_slow_burn = newrelic.get_service_level_alert_helper(alert_type="slow_burn",
217
- sli_guid=newrelic_service_level["foo"]["sli_guid"],
218
- slo_target=local["foo_target"],
219
- slo_period=local["foo_period"],
220
+ sli_guid=foo["sliGuid"],
221
+ slo_target=foo_target,
222
+ slo_period=foo_period,
220
223
  is_bad_events=True)
221
- your_condition = newrelic.NrqlAlertCondition("yourCondition",
222
- account_id=12345678,
223
- policy_id=67890,
224
+ your_condition = newrelic.NrqlAlertCondition("your_condition",
225
+ account_id="12345678",
226
+ policy_id="67890",
224
227
  type="static",
228
+ name="Slow burn alert",
225
229
  enabled=True,
226
230
  violation_time_limit_seconds=259200,
227
- nrql=newrelic.NrqlAlertConditionNrqlArgs(
228
- query=foo_slow_burn.nrql,
229
- ),
230
- critical=newrelic.NrqlAlertConditionCriticalArgs(
231
- operator="above_or_equals",
232
- threshold=foo_slow_burn.threshold,
233
- threshold_duration=900,
234
- threshold_occurrences="at_least_once",
235
- ),
231
+ nrql={
232
+ "query": foo_slow_burn.nrql,
233
+ },
234
+ critical={
235
+ "operator": "above_or_equals",
236
+ "threshold": foo_slow_burn.threshold,
237
+ "threshold_duration": 900,
238
+ "threshold_occurrences": "at_least_once",
239
+ },
236
240
  fill_option="none",
237
241
  aggregation_window=foo_slow_burn.evaluation_period,
238
242
  aggregation_method="event_flow",
239
243
  aggregation_delay="120",
240
244
  slide_by=900)
241
245
  ```
242
- <!--End PulumiCodeChooser -->
243
246
 
244
247
  Here is an example of a custom alert:
245
248
 
246
- <!--Start PulumiCodeChooser -->
247
249
  ```python
248
250
  import pulumi
249
251
  import pulumi_newrelic as newrelic
250
252
 
251
253
  foo_custom = newrelic.get_service_level_alert_helper(alert_type="custom",
252
- sli_guid=newrelic_service_level["foo"]["sli_guid"],
253
- slo_target=local["foo_target"],
254
- slo_period=local["foo_period"],
254
+ sli_guid=foo["sliGuid"],
255
+ slo_target=foo_target,
256
+ slo_period=foo_period,
255
257
  custom_tolerated_budget_consumption=4,
256
258
  custom_evaluation_period=5400,
257
259
  is_bad_events=True)
258
- your_condition = newrelic.NrqlAlertCondition("yourCondition",
259
- account_id=12345678,
260
- policy_id=67890,
260
+ your_condition = newrelic.NrqlAlertCondition("your_condition",
261
+ account_id="12345678",
262
+ policy_id="67890",
261
263
  type="static",
264
+ name="Custom burn alert",
262
265
  enabled=True,
263
266
  violation_time_limit_seconds=259200,
264
- nrql=newrelic.NrqlAlertConditionNrqlArgs(
265
- query=foo_custom.nrql,
266
- ),
267
- critical=newrelic.NrqlAlertConditionCriticalArgs(
268
- operator="above_or_equals",
269
- threshold=foo_custom.threshold,
270
- threshold_duration=900,
271
- threshold_occurrences="at_least_once",
272
- ),
267
+ nrql={
268
+ "query": foo_custom.nrql,
269
+ },
270
+ critical={
271
+ "operator": "above_or_equals",
272
+ "threshold": foo_custom.threshold,
273
+ "threshold_duration": 900,
274
+ "threshold_occurrences": "at_least_once",
275
+ },
273
276
  fill_option="none",
274
277
  aggregation_window=foo_custom.evaluation_period,
275
278
  aggregation_method="event_flow",
276
279
  aggregation_delay="120",
277
280
  slide_by=60)
278
281
  ```
279
- <!--End PulumiCodeChooser -->
280
282
 
281
283
 
282
- :param str alert_type: The type of alert we want to set. Valid values are:
283
- :param int custom_evaluation_period: Aggregation window taken into consideration in seconds. Mandatory if `alert_type` is `custom`.
284
- :param float custom_tolerated_budget_consumption: How much budget you tolerate to consume during the custom evaluation period, valid values between `0` and `100`. Mandatory if `alert_type` is `custom`.
285
- :param bool is_bad_events: If the SLI is defined using bad events. Defaults to `false`
286
- :param str sli_guid: The guid of the sli we want to set the alert on.
287
- :param int slo_period: The time window of the Service Level Objective in days. Valid values are `1`, `7` and `28`.
288
- :param float slo_target: The target of the Service Level Objective, valid values between `0` and `100`.
284
+ :param _builtins.str alert_type: The type of alert we want to set. Valid values are:
285
+ :param _builtins.int custom_evaluation_period: Aggregation window taken into consideration in seconds. Mandatory if `alert_type` is `custom`.
286
+ :param _builtins.float custom_tolerated_budget_consumption: How much budget you tolerate to consume during the custom evaluation period, valid values between `0` and `100`. Mandatory if `alert_type` is `custom`.
287
+ :param _builtins.bool is_bad_events: If the SLI is defined using bad events. Defaults to `false`
288
+ :param _builtins.str sli_guid: The guid of the sli we want to set the alert on.
289
+ :param _builtins.int slo_period: The time window of the Service Level Objective in days. Valid values are `1`, `7` and `28`.
290
+ :param _builtins.float slo_target: The target of the Service Level Objective, valid values between `0` and `100`.
289
291
  """
290
292
  __args__ = dict()
291
293
  __args__['alertType'] = alert_type
@@ -311,17 +313,14 @@ def get_service_level_alert_helper(alert_type: Optional[str] = None,
311
313
  slo_target=pulumi.get(__ret__, 'slo_target'),
312
314
  threshold=pulumi.get(__ret__, 'threshold'),
313
315
  tolerated_budget_consumption=pulumi.get(__ret__, 'tolerated_budget_consumption'))
314
-
315
-
316
- @_utilities.lift_output_func(get_service_level_alert_helper)
317
- def get_service_level_alert_helper_output(alert_type: Optional[pulumi.Input[str]] = None,
318
- custom_evaluation_period: Optional[pulumi.Input[Optional[int]]] = None,
319
- custom_tolerated_budget_consumption: Optional[pulumi.Input[Optional[float]]] = None,
320
- is_bad_events: Optional[pulumi.Input[Optional[bool]]] = None,
321
- sli_guid: Optional[pulumi.Input[str]] = None,
322
- slo_period: Optional[pulumi.Input[int]] = None,
323
- slo_target: Optional[pulumi.Input[float]] = None,
324
- opts: Optional[pulumi.InvokeOptions] = None) -> pulumi.Output[GetServiceLevelAlertHelperResult]:
316
+ def get_service_level_alert_helper_output(alert_type: Optional[pulumi.Input[_builtins.str]] = None,
317
+ custom_evaluation_period: Optional[pulumi.Input[Optional[_builtins.int]]] = None,
318
+ custom_tolerated_budget_consumption: Optional[pulumi.Input[Optional[_builtins.float]]] = None,
319
+ is_bad_events: Optional[pulumi.Input[Optional[_builtins.bool]]] = None,
320
+ sli_guid: Optional[pulumi.Input[_builtins.str]] = None,
321
+ slo_period: Optional[pulumi.Input[_builtins.int]] = None,
322
+ slo_target: Optional[pulumi.Input[_builtins.float]] = None,
323
+ opts: Optional[Union[pulumi.InvokeOptions, pulumi.InvokeOutputOptions]] = None) -> pulumi.Output[GetServiceLevelAlertHelperResult]:
325
324
  """
326
325
  Use this data source to obtain the necessary fields to set up alerts on your service levels. It can be used for a `custom` alert_type in order to set up an alert with custom tolerated budget consumption and custom evaluation period or for recommended ones like `fast_burn` or `slow_burn`. For more information check [the documentation](https://docs.newrelic.com/docs/service-level-management/alerts-slm/).
327
326
 
@@ -329,7 +328,6 @@ def get_service_level_alert_helper_output(alert_type: Optional[pulumi.Input[str]
329
328
 
330
329
  Firstly set up your service level objective, we recommend using local variables for the `target` and `time_window.rolling.count`, as they are also necessary for the helper.
331
330
 
332
- <!--Start PulumiCodeChooser -->
333
331
  ```python
334
332
  import pulumi
335
333
  import pulumi_newrelic as newrelic
@@ -338,112 +336,132 @@ def get_service_level_alert_helper_output(alert_type: Optional[pulumi.Input[str]
338
336
  foo_period = 28
339
337
  foo = newrelic.ServiceLevel("foo",
340
338
  guid="MXxBUE18QVBQTElDQVRJT058MQ",
339
+ name="Latency",
341
340
  description="Proportion of requests that are served faster than a threshold.",
342
- events=newrelic.ServiceLevelEventsArgs(
343
- account_id=12345678,
344
- valid_events=newrelic.ServiceLevelEventsValidEventsArgs(
345
- from_="Transaction",
346
- where="appName = 'Example application' AND (transactionType='Web')",
347
- ),
348
- bad_events=newrelic.ServiceLevelEventsBadEventsArgs(
349
- from_="Transaction",
350
- where="appName = 'Example application' AND (transactionType= 'Web') AND duration > 0.1",
351
- ),
352
- ),
353
- objective=newrelic.ServiceLevelObjectiveArgs(
354
- target=foo_target,
355
- time_window=newrelic.ServiceLevelObjectiveTimeWindowArgs(
356
- rolling=newrelic.ServiceLevelObjectiveTimeWindowRollingArgs(
357
- count=foo_period,
358
- unit="DAY",
359
- ),
360
- ),
361
- ))
341
+ events={
342
+ "account_id": "12345678",
343
+ "valid_events": {
344
+ "from_": "Transaction",
345
+ "where": "appName = 'Example application' AND (transactionType='Web')",
346
+ },
347
+ "bad_events": {
348
+ "from_": "Transaction",
349
+ "where": "appName = 'Example application' AND (transactionType= 'Web') AND duration > 0.1",
350
+ },
351
+ },
352
+ objective={
353
+ "target": foo_target,
354
+ "time_window": {
355
+ "rolling": {
356
+ "count": foo_period,
357
+ "unit": "DAY",
358
+ },
359
+ },
360
+ })
362
361
  ```
363
- <!--End PulumiCodeChooser -->
364
362
  Then use the helper to obtain the necessary fields to set up an alert on that Service Level.
365
363
  Note that the Service Level was set up using bad events, that's why `is_bad_events` is set to `true`.
366
364
  If the Service Level was configured with good events that would be unnecessary as the field defaults to `false`.
367
365
 
368
366
  Here is an example of a `slow_burn` alert.
369
367
 
370
- <!--Start PulumiCodeChooser -->
371
368
  ```python
372
369
  import pulumi
373
370
  import pulumi_newrelic as newrelic
374
371
 
375
372
  foo_slow_burn = newrelic.get_service_level_alert_helper(alert_type="slow_burn",
376
- sli_guid=newrelic_service_level["foo"]["sli_guid"],
377
- slo_target=local["foo_target"],
378
- slo_period=local["foo_period"],
373
+ sli_guid=foo["sliGuid"],
374
+ slo_target=foo_target,
375
+ slo_period=foo_period,
379
376
  is_bad_events=True)
380
- your_condition = newrelic.NrqlAlertCondition("yourCondition",
381
- account_id=12345678,
382
- policy_id=67890,
377
+ your_condition = newrelic.NrqlAlertCondition("your_condition",
378
+ account_id="12345678",
379
+ policy_id="67890",
383
380
  type="static",
381
+ name="Slow burn alert",
384
382
  enabled=True,
385
383
  violation_time_limit_seconds=259200,
386
- nrql=newrelic.NrqlAlertConditionNrqlArgs(
387
- query=foo_slow_burn.nrql,
388
- ),
389
- critical=newrelic.NrqlAlertConditionCriticalArgs(
390
- operator="above_or_equals",
391
- threshold=foo_slow_burn.threshold,
392
- threshold_duration=900,
393
- threshold_occurrences="at_least_once",
394
- ),
384
+ nrql={
385
+ "query": foo_slow_burn.nrql,
386
+ },
387
+ critical={
388
+ "operator": "above_or_equals",
389
+ "threshold": foo_slow_burn.threshold,
390
+ "threshold_duration": 900,
391
+ "threshold_occurrences": "at_least_once",
392
+ },
395
393
  fill_option="none",
396
394
  aggregation_window=foo_slow_burn.evaluation_period,
397
395
  aggregation_method="event_flow",
398
396
  aggregation_delay="120",
399
397
  slide_by=900)
400
398
  ```
401
- <!--End PulumiCodeChooser -->
402
399
 
403
400
  Here is an example of a custom alert:
404
401
 
405
- <!--Start PulumiCodeChooser -->
406
402
  ```python
407
403
  import pulumi
408
404
  import pulumi_newrelic as newrelic
409
405
 
410
406
  foo_custom = newrelic.get_service_level_alert_helper(alert_type="custom",
411
- sli_guid=newrelic_service_level["foo"]["sli_guid"],
412
- slo_target=local["foo_target"],
413
- slo_period=local["foo_period"],
407
+ sli_guid=foo["sliGuid"],
408
+ slo_target=foo_target,
409
+ slo_period=foo_period,
414
410
  custom_tolerated_budget_consumption=4,
415
411
  custom_evaluation_period=5400,
416
412
  is_bad_events=True)
417
- your_condition = newrelic.NrqlAlertCondition("yourCondition",
418
- account_id=12345678,
419
- policy_id=67890,
413
+ your_condition = newrelic.NrqlAlertCondition("your_condition",
414
+ account_id="12345678",
415
+ policy_id="67890",
420
416
  type="static",
417
+ name="Custom burn alert",
421
418
  enabled=True,
422
419
  violation_time_limit_seconds=259200,
423
- nrql=newrelic.NrqlAlertConditionNrqlArgs(
424
- query=foo_custom.nrql,
425
- ),
426
- critical=newrelic.NrqlAlertConditionCriticalArgs(
427
- operator="above_or_equals",
428
- threshold=foo_custom.threshold,
429
- threshold_duration=900,
430
- threshold_occurrences="at_least_once",
431
- ),
420
+ nrql={
421
+ "query": foo_custom.nrql,
422
+ },
423
+ critical={
424
+ "operator": "above_or_equals",
425
+ "threshold": foo_custom.threshold,
426
+ "threshold_duration": 900,
427
+ "threshold_occurrences": "at_least_once",
428
+ },
432
429
  fill_option="none",
433
430
  aggregation_window=foo_custom.evaluation_period,
434
431
  aggregation_method="event_flow",
435
432
  aggregation_delay="120",
436
433
  slide_by=60)
437
434
  ```
438
- <!--End PulumiCodeChooser -->
439
435
 
440
436
 
441
- :param str alert_type: The type of alert we want to set. Valid values are:
442
- :param int custom_evaluation_period: Aggregation window taken into consideration in seconds. Mandatory if `alert_type` is `custom`.
443
- :param float custom_tolerated_budget_consumption: How much budget you tolerate to consume during the custom evaluation period, valid values between `0` and `100`. Mandatory if `alert_type` is `custom`.
444
- :param bool is_bad_events: If the SLI is defined using bad events. Defaults to `false`
445
- :param str sli_guid: The guid of the sli we want to set the alert on.
446
- :param int slo_period: The time window of the Service Level Objective in days. Valid values are `1`, `7` and `28`.
447
- :param float slo_target: The target of the Service Level Objective, valid values between `0` and `100`.
437
+ :param _builtins.str alert_type: The type of alert we want to set. Valid values are:
438
+ :param _builtins.int custom_evaluation_period: Aggregation window taken into consideration in seconds. Mandatory if `alert_type` is `custom`.
439
+ :param _builtins.float custom_tolerated_budget_consumption: How much budget you tolerate to consume during the custom evaluation period, valid values between `0` and `100`. Mandatory if `alert_type` is `custom`.
440
+ :param _builtins.bool is_bad_events: If the SLI is defined using bad events. Defaults to `false`
441
+ :param _builtins.str sli_guid: The guid of the sli we want to set the alert on.
442
+ :param _builtins.int slo_period: The time window of the Service Level Objective in days. Valid values are `1`, `7` and `28`.
443
+ :param _builtins.float slo_target: The target of the Service Level Objective, valid values between `0` and `100`.
448
444
  """
449
- ...
445
+ __args__ = dict()
446
+ __args__['alertType'] = alert_type
447
+ __args__['customEvaluationPeriod'] = custom_evaluation_period
448
+ __args__['customToleratedBudgetConsumption'] = custom_tolerated_budget_consumption
449
+ __args__['isBadEvents'] = is_bad_events
450
+ __args__['sliGuid'] = sli_guid
451
+ __args__['sloPeriod'] = slo_period
452
+ __args__['sloTarget'] = slo_target
453
+ opts = pulumi.InvokeOutputOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
454
+ __ret__ = pulumi.runtime.invoke_output('newrelic:index/getServiceLevelAlertHelper:getServiceLevelAlertHelper', __args__, opts=opts, typ=GetServiceLevelAlertHelperResult)
455
+ return __ret__.apply(lambda __response__: GetServiceLevelAlertHelperResult(
456
+ alert_type=pulumi.get(__response__, 'alert_type'),
457
+ custom_evaluation_period=pulumi.get(__response__, 'custom_evaluation_period'),
458
+ custom_tolerated_budget_consumption=pulumi.get(__response__, 'custom_tolerated_budget_consumption'),
459
+ evaluation_period=pulumi.get(__response__, 'evaluation_period'),
460
+ id=pulumi.get(__response__, 'id'),
461
+ is_bad_events=pulumi.get(__response__, 'is_bad_events'),
462
+ nrql=pulumi.get(__response__, 'nrql'),
463
+ sli_guid=pulumi.get(__response__, 'sli_guid'),
464
+ slo_period=pulumi.get(__response__, 'slo_period'),
465
+ slo_target=pulumi.get(__response__, 'slo_target'),
466
+ threshold=pulumi.get(__response__, 'threshold'),
467
+ tolerated_budget_consumption=pulumi.get(__response__, 'tolerated_budget_consumption')))