cloudflare/cloudflare-typescript
Publicmirrored from https://github.com/cloudflare/cloudflare-typescriptAvailable
src/resources/alerting/policies.ts
1127lines · modecode
| 1 | // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. |
| 2 | |
| 3 | import { APIResource } from '../../resource'; |
| 4 | import { isRequestOptions } from '../../core'; |
| 5 | import * as Core from '../../core'; |
| 6 | import { SinglePage } from '../../pagination'; |
| 7 | |
| 8 | export class Policies extends APIResource { |
| 9 | /** |
| 10 | * Creates a new Notification policy. |
| 11 | * |
| 12 | * @example |
| 13 | * ```ts |
| 14 | * const policy = await client.alerting.policies.create({ |
| 15 | * account_id: '023e105f4ecef8ad9ca31a8372d0c353', |
| 16 | * alert_type: 'universal_ssl_event_type', |
| 17 | * enabled: true, |
| 18 | * mechanisms: {}, |
| 19 | * name: 'SSL Notification Event Policy', |
| 20 | * }); |
| 21 | * ``` |
| 22 | */ |
| 23 | create(params: PolicyCreateParams, options?: Core.RequestOptions): Core.APIPromise<PolicyCreateResponse> { |
| 24 | const { account_id = this._client.accountId, ...body } = params; |
| 25 | return ( |
| 26 | this._client.post(`/accounts/${account_id}/alerting/v3/policies`, { |
| 27 | body, |
| 28 | ...options, |
| 29 | }) as Core.APIPromise<{ result: PolicyCreateResponse }> |
| 30 | )._thenUnwrap((obj) => obj.result); |
| 31 | } |
| 32 | |
| 33 | /** |
| 34 | * Update a Notification policy. |
| 35 | * |
| 36 | * @example |
| 37 | * ```ts |
| 38 | * const policy = await client.alerting.policies.update( |
| 39 | * '0da2b59ef118439d8097bdfb215203c9', |
| 40 | * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, |
| 41 | * ); |
| 42 | * ``` |
| 43 | */ |
| 44 | update( |
| 45 | policyId: string, |
| 46 | params: PolicyUpdateParams, |
| 47 | options?: Core.RequestOptions, |
| 48 | ): Core.APIPromise<PolicyUpdateResponse> { |
| 49 | const { account_id = this._client.accountId, ...body } = params; |
| 50 | return ( |
| 51 | this._client.put(`/accounts/${account_id}/alerting/v3/policies/${policyId}`, { |
| 52 | body, |
| 53 | ...options, |
| 54 | }) as Core.APIPromise<{ result: PolicyUpdateResponse }> |
| 55 | )._thenUnwrap((obj) => obj.result); |
| 56 | } |
| 57 | |
| 58 | /** |
| 59 | * Get a list of all Notification policies. |
| 60 | * |
| 61 | * @example |
| 62 | * ```ts |
| 63 | * // Automatically fetches more pages as needed. |
| 64 | * for await (const policy of client.alerting.policies.list({ |
| 65 | * account_id: '023e105f4ecef8ad9ca31a8372d0c353', |
| 66 | * })) { |
| 67 | * // ... |
| 68 | * } |
| 69 | * ``` |
| 70 | */ |
| 71 | list( |
| 72 | params?: PolicyListParams, |
| 73 | options?: Core.RequestOptions, |
| 74 | ): Core.PagePromise<PoliciesSinglePage, Policy>; |
| 75 | list(options?: Core.RequestOptions): Core.PagePromise<PoliciesSinglePage, Policy>; |
| 76 | list( |
| 77 | params: PolicyListParams | Core.RequestOptions = {}, |
| 78 | options?: Core.RequestOptions, |
| 79 | ): Core.PagePromise<PoliciesSinglePage, Policy> { |
| 80 | if (isRequestOptions(params)) { |
| 81 | return this.list({}, params); |
| 82 | } |
| 83 | const { account_id = this._client.accountId } = params; |
| 84 | return this._client.getAPIList( |
| 85 | `/accounts/${account_id}/alerting/v3/policies`, |
| 86 | PoliciesSinglePage, |
| 87 | options, |
| 88 | ); |
| 89 | } |
| 90 | |
| 91 | /** |
| 92 | * Delete a Notification policy. |
| 93 | * |
| 94 | * @example |
| 95 | * ```ts |
| 96 | * const policy = await client.alerting.policies.delete( |
| 97 | * '0da2b59ef118439d8097bdfb215203c9', |
| 98 | * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, |
| 99 | * ); |
| 100 | * ``` |
| 101 | */ |
| 102 | delete( |
| 103 | policyId: string, |
| 104 | params?: PolicyDeleteParams, |
| 105 | options?: Core.RequestOptions, |
| 106 | ): Core.APIPromise<PolicyDeleteResponse>; |
| 107 | delete(policyId: string, options?: Core.RequestOptions): Core.APIPromise<PolicyDeleteResponse>; |
| 108 | delete( |
| 109 | policyId: string, |
| 110 | params: PolicyDeleteParams | Core.RequestOptions = {}, |
| 111 | options?: Core.RequestOptions, |
| 112 | ): Core.APIPromise<PolicyDeleteResponse> { |
| 113 | if (isRequestOptions(params)) { |
| 114 | return this.delete(policyId, {}, params); |
| 115 | } |
| 116 | const { account_id = this._client.accountId } = params; |
| 117 | return this._client.delete(`/accounts/${account_id}/alerting/v3/policies/${policyId}`, options); |
| 118 | } |
| 119 | |
| 120 | /** |
| 121 | * Get details for a single policy. |
| 122 | * |
| 123 | * @example |
| 124 | * ```ts |
| 125 | * const policy = await client.alerting.policies.get( |
| 126 | * '0da2b59ef118439d8097bdfb215203c9', |
| 127 | * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, |
| 128 | * ); |
| 129 | * ``` |
| 130 | */ |
| 131 | get(policyId: string, params?: PolicyGetParams, options?: Core.RequestOptions): Core.APIPromise<Policy>; |
| 132 | get(policyId: string, options?: Core.RequestOptions): Core.APIPromise<Policy>; |
| 133 | get( |
| 134 | policyId: string, |
| 135 | params: PolicyGetParams | Core.RequestOptions = {}, |
| 136 | options?: Core.RequestOptions, |
| 137 | ): Core.APIPromise<Policy> { |
| 138 | if (isRequestOptions(params)) { |
| 139 | return this.get(policyId, {}, params); |
| 140 | } |
| 141 | const { account_id = this._client.accountId } = params; |
| 142 | return ( |
| 143 | this._client.get( |
| 144 | `/accounts/${account_id}/alerting/v3/policies/${policyId}`, |
| 145 | options, |
| 146 | ) as Core.APIPromise<{ result: Policy }> |
| 147 | )._thenUnwrap((obj) => obj.result); |
| 148 | } |
| 149 | } |
| 150 | |
| 151 | export class PoliciesSinglePage extends SinglePage<Policy> {} |
| 152 | |
| 153 | /** |
| 154 | * List of IDs that will be used when dispatching a notification. IDs for email |
| 155 | * type will be the email address. |
| 156 | */ |
| 157 | export interface Mechanism { |
| 158 | email?: Array<Mechanism.Email>; |
| 159 | |
| 160 | pagerduty?: Array<Mechanism.Pagerduty>; |
| 161 | |
| 162 | webhooks?: Array<Mechanism.Webhook>; |
| 163 | } |
| 164 | |
| 165 | export namespace Mechanism { |
| 166 | export interface Email { |
| 167 | /** |
| 168 | * The email address |
| 169 | */ |
| 170 | id?: string; |
| 171 | } |
| 172 | |
| 173 | export interface Pagerduty { |
| 174 | /** |
| 175 | * UUID |
| 176 | */ |
| 177 | id?: string; |
| 178 | } |
| 179 | |
| 180 | export interface Webhook { |
| 181 | /** |
| 182 | * UUID |
| 183 | */ |
| 184 | id?: string; |
| 185 | } |
| 186 | } |
| 187 | |
| 188 | /** |
| 189 | * List of IDs that will be used when dispatching a notification. IDs for email |
| 190 | * type will be the email address. |
| 191 | */ |
| 192 | export interface MechanismParam { |
| 193 | email?: Array<MechanismParam.Email>; |
| 194 | |
| 195 | pagerduty?: Array<MechanismParam.Pagerduty>; |
| 196 | |
| 197 | webhooks?: Array<MechanismParam.Webhook>; |
| 198 | } |
| 199 | |
| 200 | export namespace MechanismParam { |
| 201 | export interface Email { |
| 202 | /** |
| 203 | * The email address |
| 204 | */ |
| 205 | id?: string; |
| 206 | } |
| 207 | |
| 208 | export interface Pagerduty { |
| 209 | /** |
| 210 | * UUID |
| 211 | */ |
| 212 | id?: string; |
| 213 | } |
| 214 | |
| 215 | export interface Webhook { |
| 216 | /** |
| 217 | * UUID |
| 218 | */ |
| 219 | id?: string; |
| 220 | } |
| 221 | } |
| 222 | |
| 223 | export interface Policy { |
| 224 | /** |
| 225 | * The unique identifier of a notification policy |
| 226 | */ |
| 227 | id?: string; |
| 228 | |
| 229 | /** |
| 230 | * Optional specification of how often to re-alert from the same incident, not |
| 231 | * support on all alert types. |
| 232 | */ |
| 233 | alert_interval?: string; |
| 234 | |
| 235 | /** |
| 236 | * Refers to which event will trigger a Notification dispatch. You can use the |
| 237 | * endpoint to get available alert types which then will give you a list of |
| 238 | * possible values. |
| 239 | */ |
| 240 | alert_type?: |
| 241 | | 'abuse_report_alert' |
| 242 | | 'access_custom_certificate_expiration_type' |
| 243 | | 'advanced_ddos_attack_l4_alert' |
| 244 | | 'advanced_ddos_attack_l7_alert' |
| 245 | | 'advanced_http_alert_error' |
| 246 | | 'bgp_hijack_notification' |
| 247 | | 'billing_usage_alert' |
| 248 | | 'block_notification_block_removed' |
| 249 | | 'block_notification_new_block' |
| 250 | | 'block_notification_review_rejected' |
| 251 | | 'bot_traffic_basic_alert' |
| 252 | | 'brand_protection_alert' |
| 253 | | 'brand_protection_digest' |
| 254 | | 'clickhouse_alert_fw_anomaly' |
| 255 | | 'clickhouse_alert_fw_ent_anomaly' |
| 256 | | 'cloudforce_one_request_notification' |
| 257 | | 'cni_maintenance_notification' |
| 258 | | 'custom_analytics' |
| 259 | | 'custom_bot_detection_alert' |
| 260 | | 'custom_ssl_certificate_event_type' |
| 261 | | 'dedicated_ssl_certificate_event_type' |
| 262 | | 'device_connectivity_anomaly_alert' |
| 263 | | 'dos_attack_l4' |
| 264 | | 'dos_attack_l7' |
| 265 | | 'expiring_service_token_alert' |
| 266 | | 'failing_logpush_job_disabled_alert' |
| 267 | | 'fbm_auto_advertisement' |
| 268 | | 'fbm_dosd_attack' |
| 269 | | 'fbm_volumetric_attack' |
| 270 | | 'health_check_status_notification' |
| 271 | | 'hostname_aop_custom_certificate_expiration_type' |
| 272 | | 'http_alert_edge_error' |
| 273 | | 'http_alert_origin_error' |
| 274 | | 'image_notification' |
| 275 | | 'image_resizing_notification' |
| 276 | | 'incident_alert' |
| 277 | | 'load_balancing_health_alert' |
| 278 | | 'load_balancing_pool_enablement_alert' |
| 279 | | 'logo_match_alert' |
| 280 | | 'magic_tunnel_health_check_event' |
| 281 | | 'magic_wan_tunnel_health' |
| 282 | | 'maintenance_event_notification' |
| 283 | | 'mtls_certificate_store_certificate_expiration_type' |
| 284 | | 'pages_event_alert' |
| 285 | | 'radar_notification' |
| 286 | | 'real_origin_monitoring' |
| 287 | | 'scriptmonitor_alert_new_code_change_detections' |
| 288 | | 'scriptmonitor_alert_new_hosts' |
| 289 | | 'scriptmonitor_alert_new_malicious_hosts' |
| 290 | | 'scriptmonitor_alert_new_malicious_scripts' |
| 291 | | 'scriptmonitor_alert_new_malicious_url' |
| 292 | | 'scriptmonitor_alert_new_max_length_resource_url' |
| 293 | | 'scriptmonitor_alert_new_resources' |
| 294 | | 'secondary_dns_all_primaries_failing' |
| 295 | | 'secondary_dns_primaries_failing' |
| 296 | | 'secondary_dns_warning' |
| 297 | | 'secondary_dns_zone_successfully_updated' |
| 298 | | 'secondary_dns_zone_validation_warning' |
| 299 | | 'security_insights_alert' |
| 300 | | 'sentinel_alert' |
| 301 | | 'stream_live_notifications' |
| 302 | | 'synthetic_test_latency_alert' |
| 303 | | 'synthetic_test_low_availability_alert' |
| 304 | | 'traffic_anomalies_alert' |
| 305 | | 'tunnel_health_event' |
| 306 | | 'tunnel_update_event' |
| 307 | | 'universal_ssl_event_type' |
| 308 | | 'web_analytics_metrics_update' |
| 309 | | 'zone_aop_custom_certificate_expiration_type'; |
| 310 | |
| 311 | created?: string; |
| 312 | |
| 313 | /** |
| 314 | * Optional description for the Notification policy. |
| 315 | */ |
| 316 | description?: string; |
| 317 | |
| 318 | /** |
| 319 | * Whether or not the Notification policy is enabled. |
| 320 | */ |
| 321 | enabled?: boolean; |
| 322 | |
| 323 | /** |
| 324 | * Optional filters that allow you to be alerted only on a subset of events for |
| 325 | * that alert type based on some criteria. This is only available for select alert |
| 326 | * types. See alert type documentation for more details. |
| 327 | */ |
| 328 | filters?: PolicyFilter; |
| 329 | |
| 330 | /** |
| 331 | * List of IDs that will be used when dispatching a notification. IDs for email |
| 332 | * type will be the email address. |
| 333 | */ |
| 334 | mechanisms?: Mechanism; |
| 335 | |
| 336 | modified?: string; |
| 337 | |
| 338 | /** |
| 339 | * Name of the policy. |
| 340 | */ |
| 341 | name?: string; |
| 342 | } |
| 343 | |
| 344 | /** |
| 345 | * Optional filters that allow you to be alerted only on a subset of events for |
| 346 | * that alert type based on some criteria. This is only available for select alert |
| 347 | * types. See alert type documentation for more details. |
| 348 | */ |
| 349 | export interface PolicyFilter { |
| 350 | /** |
| 351 | * Usage depends on specific alert type |
| 352 | */ |
| 353 | actions?: Array<string>; |
| 354 | |
| 355 | /** |
| 356 | * Used for configuring radar_notification |
| 357 | */ |
| 358 | affected_asns?: Array<string>; |
| 359 | |
| 360 | /** |
| 361 | * Used for configuring incident_alert |
| 362 | */ |
| 363 | affected_components?: Array<string>; |
| 364 | |
| 365 | /** |
| 366 | * Used for configuring radar_notification |
| 367 | */ |
| 368 | affected_locations?: Array<string>; |
| 369 | |
| 370 | /** |
| 371 | * Used for configuring maintenance_event_notification |
| 372 | */ |
| 373 | airport_code?: Array<string>; |
| 374 | |
| 375 | /** |
| 376 | * Usage depends on specific alert type |
| 377 | */ |
| 378 | alert_trigger_preferences?: Array<string>; |
| 379 | |
| 380 | /** |
| 381 | * Usage depends on specific alert type |
| 382 | */ |
| 383 | alert_trigger_preferences_value?: Array<string>; |
| 384 | |
| 385 | /** |
| 386 | * Used for configuring load_balancing_pool_enablement_alert |
| 387 | */ |
| 388 | enabled?: Array<string>; |
| 389 | |
| 390 | /** |
| 391 | * Used for configuring pages_event_alert |
| 392 | */ |
| 393 | environment?: Array<string>; |
| 394 | |
| 395 | /** |
| 396 | * Used for configuring pages_event_alert |
| 397 | */ |
| 398 | event?: Array<string>; |
| 399 | |
| 400 | /** |
| 401 | * Used for configuring load_balancing_health_alert |
| 402 | */ |
| 403 | event_source?: Array<string>; |
| 404 | |
| 405 | /** |
| 406 | * Usage depends on specific alert type |
| 407 | */ |
| 408 | event_type?: Array<string>; |
| 409 | |
| 410 | /** |
| 411 | * Usage depends on specific alert type |
| 412 | */ |
| 413 | group_by?: Array<string>; |
| 414 | |
| 415 | /** |
| 416 | * Used for configuring health_check_status_notification |
| 417 | */ |
| 418 | health_check_id?: Array<string>; |
| 419 | |
| 420 | /** |
| 421 | * Used for configuring incident_alert |
| 422 | */ |
| 423 | incident_impact?: Array< |
| 424 | 'INCIDENT_IMPACT_NONE' | 'INCIDENT_IMPACT_MINOR' | 'INCIDENT_IMPACT_MAJOR' | 'INCIDENT_IMPACT_CRITICAL' |
| 425 | >; |
| 426 | |
| 427 | /** |
| 428 | * Used for configuring stream_live_notifications |
| 429 | */ |
| 430 | input_id?: Array<string>; |
| 431 | |
| 432 | /** |
| 433 | * Used for configuring security_insights_alert |
| 434 | */ |
| 435 | insight_class?: Array<string>; |
| 436 | |
| 437 | /** |
| 438 | * Used for configuring billing_usage_alert |
| 439 | */ |
| 440 | limit?: Array<string>; |
| 441 | |
| 442 | /** |
| 443 | * Used for configuring logo_match_alert |
| 444 | */ |
| 445 | logo_tag?: Array<string>; |
| 446 | |
| 447 | /** |
| 448 | * Used for configuring advanced_ddos_attack_l4_alert |
| 449 | */ |
| 450 | megabits_per_second?: Array<string>; |
| 451 | |
| 452 | /** |
| 453 | * Used for configuring load_balancing_health_alert |
| 454 | */ |
| 455 | new_health?: Array<string>; |
| 456 | |
| 457 | /** |
| 458 | * Used for configuring tunnel_health_event |
| 459 | */ |
| 460 | new_status?: Array<string>; |
| 461 | |
| 462 | /** |
| 463 | * Used for configuring advanced_ddos_attack_l4_alert |
| 464 | */ |
| 465 | packets_per_second?: Array<string>; |
| 466 | |
| 467 | /** |
| 468 | * Usage depends on specific alert type |
| 469 | */ |
| 470 | pool_id?: Array<string>; |
| 471 | |
| 472 | /** |
| 473 | * Usage depends on specific alert type |
| 474 | */ |
| 475 | pop_names?: Array<string>; |
| 476 | |
| 477 | /** |
| 478 | * Used for configuring billing_usage_alert |
| 479 | */ |
| 480 | product?: Array<string>; |
| 481 | |
| 482 | /** |
| 483 | * Used for configuring pages_event_alert |
| 484 | */ |
| 485 | project_id?: Array<string>; |
| 486 | |
| 487 | /** |
| 488 | * Used for configuring advanced_ddos_attack_l4_alert |
| 489 | */ |
| 490 | protocol?: Array<string>; |
| 491 | |
| 492 | /** |
| 493 | * Usage depends on specific alert type |
| 494 | */ |
| 495 | query_tag?: Array<string>; |
| 496 | |
| 497 | /** |
| 498 | * Used for configuring advanced_ddos_attack_l7_alert |
| 499 | */ |
| 500 | requests_per_second?: Array<string>; |
| 501 | |
| 502 | /** |
| 503 | * Usage depends on specific alert type |
| 504 | */ |
| 505 | selectors?: Array<string>; |
| 506 | |
| 507 | /** |
| 508 | * Used for configuring clickhouse_alert_fw_ent_anomaly |
| 509 | */ |
| 510 | services?: Array<string>; |
| 511 | |
| 512 | /** |
| 513 | * Usage depends on specific alert type |
| 514 | */ |
| 515 | slo?: Array<string>; |
| 516 | |
| 517 | /** |
| 518 | * Used for configuring health_check_status_notification |
| 519 | */ |
| 520 | status?: Array<string>; |
| 521 | |
| 522 | /** |
| 523 | * Used for configuring advanced_ddos_attack_l7_alert |
| 524 | */ |
| 525 | target_hostname?: Array<string>; |
| 526 | |
| 527 | /** |
| 528 | * Used for configuring advanced_ddos_attack_l4_alert |
| 529 | */ |
| 530 | target_ip?: Array<string>; |
| 531 | |
| 532 | /** |
| 533 | * Used for configuring advanced_ddos_attack_l7_alert |
| 534 | */ |
| 535 | target_zone_name?: Array<string>; |
| 536 | |
| 537 | /** |
| 538 | * Used for configuring traffic_anomalies_alert |
| 539 | */ |
| 540 | traffic_exclusions?: Array<'security_events'>; |
| 541 | |
| 542 | /** |
| 543 | * Used for configuring tunnel_health_event |
| 544 | */ |
| 545 | tunnel_id?: Array<string>; |
| 546 | |
| 547 | /** |
| 548 | * Usage depends on specific alert type |
| 549 | */ |
| 550 | tunnel_name?: Array<string>; |
| 551 | |
| 552 | /** |
| 553 | * Usage depends on specific alert type |
| 554 | */ |
| 555 | type?: Array<string>; |
| 556 | |
| 557 | /** |
| 558 | * Usage depends on specific alert type |
| 559 | */ |
| 560 | where?: Array<string>; |
| 561 | |
| 562 | /** |
| 563 | * Usage depends on specific alert type |
| 564 | */ |
| 565 | zones?: Array<string>; |
| 566 | } |
| 567 | |
| 568 | /** |
| 569 | * Optional filters that allow you to be alerted only on a subset of events for |
| 570 | * that alert type based on some criteria. This is only available for select alert |
| 571 | * types. See alert type documentation for more details. |
| 572 | */ |
| 573 | export interface PolicyFilterParam { |
| 574 | /** |
| 575 | * Usage depends on specific alert type |
| 576 | */ |
| 577 | actions?: Array<string>; |
| 578 | |
| 579 | /** |
| 580 | * Used for configuring radar_notification |
| 581 | */ |
| 582 | affected_asns?: Array<string>; |
| 583 | |
| 584 | /** |
| 585 | * Used for configuring incident_alert |
| 586 | */ |
| 587 | affected_components?: Array<string>; |
| 588 | |
| 589 | /** |
| 590 | * Used for configuring radar_notification |
| 591 | */ |
| 592 | affected_locations?: Array<string>; |
| 593 | |
| 594 | /** |
| 595 | * Used for configuring maintenance_event_notification |
| 596 | */ |
| 597 | airport_code?: Array<string>; |
| 598 | |
| 599 | /** |
| 600 | * Usage depends on specific alert type |
| 601 | */ |
| 602 | alert_trigger_preferences?: Array<string>; |
| 603 | |
| 604 | /** |
| 605 | * Usage depends on specific alert type |
| 606 | */ |
| 607 | alert_trigger_preferences_value?: Array<string>; |
| 608 | |
| 609 | /** |
| 610 | * Used for configuring load_balancing_pool_enablement_alert |
| 611 | */ |
| 612 | enabled?: Array<string>; |
| 613 | |
| 614 | /** |
| 615 | * Used for configuring pages_event_alert |
| 616 | */ |
| 617 | environment?: Array<string>; |
| 618 | |
| 619 | /** |
| 620 | * Used for configuring pages_event_alert |
| 621 | */ |
| 622 | event?: Array<string>; |
| 623 | |
| 624 | /** |
| 625 | * Used for configuring load_balancing_health_alert |
| 626 | */ |
| 627 | event_source?: Array<string>; |
| 628 | |
| 629 | /** |
| 630 | * Usage depends on specific alert type |
| 631 | */ |
| 632 | event_type?: Array<string>; |
| 633 | |
| 634 | /** |
| 635 | * Usage depends on specific alert type |
| 636 | */ |
| 637 | group_by?: Array<string>; |
| 638 | |
| 639 | /** |
| 640 | * Used for configuring health_check_status_notification |
| 641 | */ |
| 642 | health_check_id?: Array<string>; |
| 643 | |
| 644 | /** |
| 645 | * Used for configuring incident_alert |
| 646 | */ |
| 647 | incident_impact?: Array< |
| 648 | 'INCIDENT_IMPACT_NONE' | 'INCIDENT_IMPACT_MINOR' | 'INCIDENT_IMPACT_MAJOR' | 'INCIDENT_IMPACT_CRITICAL' |
| 649 | >; |
| 650 | |
| 651 | /** |
| 652 | * Used for configuring stream_live_notifications |
| 653 | */ |
| 654 | input_id?: Array<string>; |
| 655 | |
| 656 | /** |
| 657 | * Used for configuring security_insights_alert |
| 658 | */ |
| 659 | insight_class?: Array<string>; |
| 660 | |
| 661 | /** |
| 662 | * Used for configuring billing_usage_alert |
| 663 | */ |
| 664 | limit?: Array<string>; |
| 665 | |
| 666 | /** |
| 667 | * Used for configuring logo_match_alert |
| 668 | */ |
| 669 | logo_tag?: Array<string>; |
| 670 | |
| 671 | /** |
| 672 | * Used for configuring advanced_ddos_attack_l4_alert |
| 673 | */ |
| 674 | megabits_per_second?: Array<string>; |
| 675 | |
| 676 | /** |
| 677 | * Used for configuring load_balancing_health_alert |
| 678 | */ |
| 679 | new_health?: Array<string>; |
| 680 | |
| 681 | /** |
| 682 | * Used for configuring tunnel_health_event |
| 683 | */ |
| 684 | new_status?: Array<string>; |
| 685 | |
| 686 | /** |
| 687 | * Used for configuring advanced_ddos_attack_l4_alert |
| 688 | */ |
| 689 | packets_per_second?: Array<string>; |
| 690 | |
| 691 | /** |
| 692 | * Usage depends on specific alert type |
| 693 | */ |
| 694 | pool_id?: Array<string>; |
| 695 | |
| 696 | /** |
| 697 | * Usage depends on specific alert type |
| 698 | */ |
| 699 | pop_names?: Array<string>; |
| 700 | |
| 701 | /** |
| 702 | * Used for configuring billing_usage_alert |
| 703 | */ |
| 704 | product?: Array<string>; |
| 705 | |
| 706 | /** |
| 707 | * Used for configuring pages_event_alert |
| 708 | */ |
| 709 | project_id?: Array<string>; |
| 710 | |
| 711 | /** |
| 712 | * Used for configuring advanced_ddos_attack_l4_alert |
| 713 | */ |
| 714 | protocol?: Array<string>; |
| 715 | |
| 716 | /** |
| 717 | * Usage depends on specific alert type |
| 718 | */ |
| 719 | query_tag?: Array<string>; |
| 720 | |
| 721 | /** |
| 722 | * Used for configuring advanced_ddos_attack_l7_alert |
| 723 | */ |
| 724 | requests_per_second?: Array<string>; |
| 725 | |
| 726 | /** |
| 727 | * Usage depends on specific alert type |
| 728 | */ |
| 729 | selectors?: Array<string>; |
| 730 | |
| 731 | /** |
| 732 | * Used for configuring clickhouse_alert_fw_ent_anomaly |
| 733 | */ |
| 734 | services?: Array<string>; |
| 735 | |
| 736 | /** |
| 737 | * Usage depends on specific alert type |
| 738 | */ |
| 739 | slo?: Array<string>; |
| 740 | |
| 741 | /** |
| 742 | * Used for configuring health_check_status_notification |
| 743 | */ |
| 744 | status?: Array<string>; |
| 745 | |
| 746 | /** |
| 747 | * Used for configuring advanced_ddos_attack_l7_alert |
| 748 | */ |
| 749 | target_hostname?: Array<string>; |
| 750 | |
| 751 | /** |
| 752 | * Used for configuring advanced_ddos_attack_l4_alert |
| 753 | */ |
| 754 | target_ip?: Array<string>; |
| 755 | |
| 756 | /** |
| 757 | * Used for configuring advanced_ddos_attack_l7_alert |
| 758 | */ |
| 759 | target_zone_name?: Array<string>; |
| 760 | |
| 761 | /** |
| 762 | * Used for configuring traffic_anomalies_alert |
| 763 | */ |
| 764 | traffic_exclusions?: Array<'security_events'>; |
| 765 | |
| 766 | /** |
| 767 | * Used for configuring tunnel_health_event |
| 768 | */ |
| 769 | tunnel_id?: Array<string>; |
| 770 | |
| 771 | /** |
| 772 | * Usage depends on specific alert type |
| 773 | */ |
| 774 | tunnel_name?: Array<string>; |
| 775 | |
| 776 | /** |
| 777 | * Usage depends on specific alert type |
| 778 | */ |
| 779 | type?: Array<string>; |
| 780 | |
| 781 | /** |
| 782 | * Usage depends on specific alert type |
| 783 | */ |
| 784 | where?: Array<string>; |
| 785 | |
| 786 | /** |
| 787 | * Usage depends on specific alert type |
| 788 | */ |
| 789 | zones?: Array<string>; |
| 790 | } |
| 791 | |
| 792 | export interface PolicyCreateResponse { |
| 793 | /** |
| 794 | * UUID |
| 795 | */ |
| 796 | id?: string; |
| 797 | } |
| 798 | |
| 799 | export interface PolicyUpdateResponse { |
| 800 | /** |
| 801 | * UUID |
| 802 | */ |
| 803 | id?: string; |
| 804 | } |
| 805 | |
| 806 | export interface PolicyDeleteResponse { |
| 807 | errors: Array<PolicyDeleteResponse.Error>; |
| 808 | |
| 809 | messages: Array<PolicyDeleteResponse.Message>; |
| 810 | |
| 811 | /** |
| 812 | * Whether the API call was successful |
| 813 | */ |
| 814 | success: true; |
| 815 | |
| 816 | result_info?: PolicyDeleteResponse.ResultInfo; |
| 817 | } |
| 818 | |
| 819 | export namespace PolicyDeleteResponse { |
| 820 | export interface Error { |
| 821 | message: string; |
| 822 | |
| 823 | code?: number; |
| 824 | } |
| 825 | |
| 826 | export interface Message { |
| 827 | message: string; |
| 828 | |
| 829 | code?: number; |
| 830 | } |
| 831 | |
| 832 | export interface ResultInfo { |
| 833 | /** |
| 834 | * Total number of results for the requested service |
| 835 | */ |
| 836 | count?: number; |
| 837 | |
| 838 | /** |
| 839 | * Current page within paginated list of results |
| 840 | */ |
| 841 | page?: number; |
| 842 | |
| 843 | /** |
| 844 | * Number of results per page of results |
| 845 | */ |
| 846 | per_page?: number; |
| 847 | |
| 848 | /** |
| 849 | * Total results available without any search parameters |
| 850 | */ |
| 851 | total_count?: number; |
| 852 | } |
| 853 | } |
| 854 | |
| 855 | export interface PolicyCreateParams { |
| 856 | /** |
| 857 | * Path param: The account id |
| 858 | */ |
| 859 | account_id?: string; |
| 860 | |
| 861 | /** |
| 862 | * Body param: Refers to which event will trigger a Notification dispatch. You can |
| 863 | * use the endpoint to get available alert types which then will give you a list of |
| 864 | * possible values. |
| 865 | */ |
| 866 | alert_type: |
| 867 | | 'abuse_report_alert' |
| 868 | | 'access_custom_certificate_expiration_type' |
| 869 | | 'advanced_ddos_attack_l4_alert' |
| 870 | | 'advanced_ddos_attack_l7_alert' |
| 871 | | 'advanced_http_alert_error' |
| 872 | | 'bgp_hijack_notification' |
| 873 | | 'billing_usage_alert' |
| 874 | | 'block_notification_block_removed' |
| 875 | | 'block_notification_new_block' |
| 876 | | 'block_notification_review_rejected' |
| 877 | | 'bot_traffic_basic_alert' |
| 878 | | 'brand_protection_alert' |
| 879 | | 'brand_protection_digest' |
| 880 | | 'clickhouse_alert_fw_anomaly' |
| 881 | | 'clickhouse_alert_fw_ent_anomaly' |
| 882 | | 'cloudforce_one_request_notification' |
| 883 | | 'cni_maintenance_notification' |
| 884 | | 'custom_analytics' |
| 885 | | 'custom_bot_detection_alert' |
| 886 | | 'custom_ssl_certificate_event_type' |
| 887 | | 'dedicated_ssl_certificate_event_type' |
| 888 | | 'device_connectivity_anomaly_alert' |
| 889 | | 'dos_attack_l4' |
| 890 | | 'dos_attack_l7' |
| 891 | | 'expiring_service_token_alert' |
| 892 | | 'failing_logpush_job_disabled_alert' |
| 893 | | 'fbm_auto_advertisement' |
| 894 | | 'fbm_dosd_attack' |
| 895 | | 'fbm_volumetric_attack' |
| 896 | | 'health_check_status_notification' |
| 897 | | 'hostname_aop_custom_certificate_expiration_type' |
| 898 | | 'http_alert_edge_error' |
| 899 | | 'http_alert_origin_error' |
| 900 | | 'image_notification' |
| 901 | | 'image_resizing_notification' |
| 902 | | 'incident_alert' |
| 903 | | 'load_balancing_health_alert' |
| 904 | | 'load_balancing_pool_enablement_alert' |
| 905 | | 'logo_match_alert' |
| 906 | | 'magic_tunnel_health_check_event' |
| 907 | | 'magic_wan_tunnel_health' |
| 908 | | 'maintenance_event_notification' |
| 909 | | 'mtls_certificate_store_certificate_expiration_type' |
| 910 | | 'pages_event_alert' |
| 911 | | 'radar_notification' |
| 912 | | 'real_origin_monitoring' |
| 913 | | 'scriptmonitor_alert_new_code_change_detections' |
| 914 | | 'scriptmonitor_alert_new_hosts' |
| 915 | | 'scriptmonitor_alert_new_malicious_hosts' |
| 916 | | 'scriptmonitor_alert_new_malicious_scripts' |
| 917 | | 'scriptmonitor_alert_new_malicious_url' |
| 918 | | 'scriptmonitor_alert_new_max_length_resource_url' |
| 919 | | 'scriptmonitor_alert_new_resources' |
| 920 | | 'secondary_dns_all_primaries_failing' |
| 921 | | 'secondary_dns_primaries_failing' |
| 922 | | 'secondary_dns_warning' |
| 923 | | 'secondary_dns_zone_successfully_updated' |
| 924 | | 'secondary_dns_zone_validation_warning' |
| 925 | | 'security_insights_alert' |
| 926 | | 'sentinel_alert' |
| 927 | | 'stream_live_notifications' |
| 928 | | 'synthetic_test_latency_alert' |
| 929 | | 'synthetic_test_low_availability_alert' |
| 930 | | 'traffic_anomalies_alert' |
| 931 | | 'tunnel_health_event' |
| 932 | | 'tunnel_update_event' |
| 933 | | 'universal_ssl_event_type' |
| 934 | | 'web_analytics_metrics_update' |
| 935 | | 'zone_aop_custom_certificate_expiration_type'; |
| 936 | |
| 937 | /** |
| 938 | * Body param: Whether or not the Notification policy is enabled. |
| 939 | */ |
| 940 | enabled: boolean; |
| 941 | |
| 942 | /** |
| 943 | * Body param: List of IDs that will be used when dispatching a notification. IDs |
| 944 | * for email type will be the email address. |
| 945 | */ |
| 946 | mechanisms: MechanismParam; |
| 947 | |
| 948 | /** |
| 949 | * Body param: Name of the policy. |
| 950 | */ |
| 951 | name: string; |
| 952 | |
| 953 | /** |
| 954 | * Body param: Optional specification of how often to re-alert from the same |
| 955 | * incident, not support on all alert types. |
| 956 | */ |
| 957 | alert_interval?: string; |
| 958 | |
| 959 | /** |
| 960 | * Body param: Optional description for the Notification policy. |
| 961 | */ |
| 962 | description?: string; |
| 963 | |
| 964 | /** |
| 965 | * Body param: Optional filters that allow you to be alerted only on a subset of |
| 966 | * events for that alert type based on some criteria. This is only available for |
| 967 | * select alert types. See alert type documentation for more details. |
| 968 | */ |
| 969 | filters?: PolicyFilterParam; |
| 970 | } |
| 971 | |
| 972 | export interface PolicyUpdateParams { |
| 973 | /** |
| 974 | * Path param: The account id |
| 975 | */ |
| 976 | account_id?: string; |
| 977 | |
| 978 | /** |
| 979 | * Body param: Optional specification of how often to re-alert from the same |
| 980 | * incident, not support on all alert types. |
| 981 | */ |
| 982 | alert_interval?: string; |
| 983 | |
| 984 | /** |
| 985 | * Body param: Refers to which event will trigger a Notification dispatch. You can |
| 986 | * use the endpoint to get available alert types which then will give you a list of |
| 987 | * possible values. |
| 988 | */ |
| 989 | alert_type?: |
| 990 | | 'abuse_report_alert' |
| 991 | | 'access_custom_certificate_expiration_type' |
| 992 | | 'advanced_ddos_attack_l4_alert' |
| 993 | | 'advanced_ddos_attack_l7_alert' |
| 994 | | 'advanced_http_alert_error' |
| 995 | | 'bgp_hijack_notification' |
| 996 | | 'billing_usage_alert' |
| 997 | | 'block_notification_block_removed' |
| 998 | | 'block_notification_new_block' |
| 999 | | 'block_notification_review_rejected' |
| 1000 | | 'bot_traffic_basic_alert' |
| 1001 | | 'brand_protection_alert' |
| 1002 | | 'brand_protection_digest' |
| 1003 | | 'clickhouse_alert_fw_anomaly' |
| 1004 | | 'clickhouse_alert_fw_ent_anomaly' |
| 1005 | | 'cloudforce_one_request_notification' |
| 1006 | | 'cni_maintenance_notification' |
| 1007 | | 'custom_analytics' |
| 1008 | | 'custom_bot_detection_alert' |
| 1009 | | 'custom_ssl_certificate_event_type' |
| 1010 | | 'dedicated_ssl_certificate_event_type' |
| 1011 | | 'device_connectivity_anomaly_alert' |
| 1012 | | 'dos_attack_l4' |
| 1013 | | 'dos_attack_l7' |
| 1014 | | 'expiring_service_token_alert' |
| 1015 | | 'failing_logpush_job_disabled_alert' |
| 1016 | | 'fbm_auto_advertisement' |
| 1017 | | 'fbm_dosd_attack' |
| 1018 | | 'fbm_volumetric_attack' |
| 1019 | | 'health_check_status_notification' |
| 1020 | | 'hostname_aop_custom_certificate_expiration_type' |
| 1021 | | 'http_alert_edge_error' |
| 1022 | | 'http_alert_origin_error' |
| 1023 | | 'image_notification' |
| 1024 | | 'image_resizing_notification' |
| 1025 | | 'incident_alert' |
| 1026 | | 'load_balancing_health_alert' |
| 1027 | | 'load_balancing_pool_enablement_alert' |
| 1028 | | 'logo_match_alert' |
| 1029 | | 'magic_tunnel_health_check_event' |
| 1030 | | 'magic_wan_tunnel_health' |
| 1031 | | 'maintenance_event_notification' |
| 1032 | | 'mtls_certificate_store_certificate_expiration_type' |
| 1033 | | 'pages_event_alert' |
| 1034 | | 'radar_notification' |
| 1035 | | 'real_origin_monitoring' |
| 1036 | | 'scriptmonitor_alert_new_code_change_detections' |
| 1037 | | 'scriptmonitor_alert_new_hosts' |
| 1038 | | 'scriptmonitor_alert_new_malicious_hosts' |
| 1039 | | 'scriptmonitor_alert_new_malicious_scripts' |
| 1040 | | 'scriptmonitor_alert_new_malicious_url' |
| 1041 | | 'scriptmonitor_alert_new_max_length_resource_url' |
| 1042 | | 'scriptmonitor_alert_new_resources' |
| 1043 | | 'secondary_dns_all_primaries_failing' |
| 1044 | | 'secondary_dns_primaries_failing' |
| 1045 | | 'secondary_dns_warning' |
| 1046 | | 'secondary_dns_zone_successfully_updated' |
| 1047 | | 'secondary_dns_zone_validation_warning' |
| 1048 | | 'security_insights_alert' |
| 1049 | | 'sentinel_alert' |
| 1050 | | 'stream_live_notifications' |
| 1051 | | 'synthetic_test_latency_alert' |
| 1052 | | 'synthetic_test_low_availability_alert' |
| 1053 | | 'traffic_anomalies_alert' |
| 1054 | | 'tunnel_health_event' |
| 1055 | | 'tunnel_update_event' |
| 1056 | | 'universal_ssl_event_type' |
| 1057 | | 'web_analytics_metrics_update' |
| 1058 | | 'zone_aop_custom_certificate_expiration_type'; |
| 1059 | |
| 1060 | /** |
| 1061 | * Body param: Optional description for the Notification policy. |
| 1062 | */ |
| 1063 | description?: string; |
| 1064 | |
| 1065 | /** |
| 1066 | * Body param: Whether or not the Notification policy is enabled. |
| 1067 | */ |
| 1068 | enabled?: boolean; |
| 1069 | |
| 1070 | /** |
| 1071 | * Body param: Optional filters that allow you to be alerted only on a subset of |
| 1072 | * events for that alert type based on some criteria. This is only available for |
| 1073 | * select alert types. See alert type documentation for more details. |
| 1074 | */ |
| 1075 | filters?: PolicyFilterParam; |
| 1076 | |
| 1077 | /** |
| 1078 | * Body param: List of IDs that will be used when dispatching a notification. IDs |
| 1079 | * for email type will be the email address. |
| 1080 | */ |
| 1081 | mechanisms?: MechanismParam; |
| 1082 | |
| 1083 | /** |
| 1084 | * Body param: Name of the policy. |
| 1085 | */ |
| 1086 | name?: string; |
| 1087 | } |
| 1088 | |
| 1089 | export interface PolicyListParams { |
| 1090 | /** |
| 1091 | * The account id |
| 1092 | */ |
| 1093 | account_id?: string; |
| 1094 | } |
| 1095 | |
| 1096 | export interface PolicyDeleteParams { |
| 1097 | /** |
| 1098 | * The account id |
| 1099 | */ |
| 1100 | account_id?: string; |
| 1101 | } |
| 1102 | |
| 1103 | export interface PolicyGetParams { |
| 1104 | /** |
| 1105 | * The account id |
| 1106 | */ |
| 1107 | account_id?: string; |
| 1108 | } |
| 1109 | |
| 1110 | Policies.PoliciesSinglePage = PoliciesSinglePage; |
| 1111 | |
| 1112 | export declare namespace Policies { |
| 1113 | export { |
| 1114 | type Mechanism as Mechanism, |
| 1115 | type Policy as Policy, |
| 1116 | type PolicyFilter as PolicyFilter, |
| 1117 | type PolicyCreateResponse as PolicyCreateResponse, |
| 1118 | type PolicyUpdateResponse as PolicyUpdateResponse, |
| 1119 | type PolicyDeleteResponse as PolicyDeleteResponse, |
| 1120 | PoliciesSinglePage as PoliciesSinglePage, |
| 1121 | type PolicyCreateParams as PolicyCreateParams, |
| 1122 | type PolicyUpdateParams as PolicyUpdateParams, |
| 1123 | type PolicyListParams as PolicyListParams, |
| 1124 | type PolicyDeleteParams as PolicyDeleteParams, |
| 1125 | type PolicyGetParams as PolicyGetParams, |
| 1126 | }; |
| 1127 | } |
| 1128 | |