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