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