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