gcore 0.9.0__py3-none-any.whl → 0.11.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of gcore might be problematic. Click here for more details.
- gcore/_base_client.py +3 -3
- gcore/_client.py +18 -0
- gcore/_compat.py +48 -48
- gcore/_models.py +41 -41
- gcore/_types.py +35 -1
- gcore/_utils/__init__.py +9 -2
- gcore/_utils/_compat.py +45 -0
- gcore/_utils/_datetime_parse.py +136 -0
- gcore/_utils/_transform.py +11 -1
- gcore/_utils/_typing.py +6 -1
- gcore/_utils/_utils.py +0 -1
- gcore/_version.py +1 -1
- gcore/resources/__init__.py +28 -0
- gcore/resources/cloud/__init__.py +14 -0
- gcore/resources/cloud/audit_logs.py +3 -3
- gcore/resources/cloud/baremetal/images.py +3 -4
- gcore/resources/cloud/baremetal/servers.py +16 -4
- gcore/resources/cloud/cloud.py +32 -0
- gcore/resources/cloud/cost_reports.py +24 -16
- gcore/resources/cloud/file_shares/access_rules.py +2 -2
- gcore/resources/cloud/file_shares/file_shares.py +30 -14
- gcore/resources/cloud/floating_ips.py +196 -4
- gcore/resources/cloud/gpu_baremetal_clusters/flavors.py +1 -1
- gcore/resources/cloud/gpu_baremetal_clusters/gpu_baremetal_clusters.py +166 -190
- gcore/resources/cloud/gpu_baremetal_clusters/servers.py +268 -12
- gcore/resources/cloud/inference/__init__.py +14 -14
- gcore/resources/cloud/inference/applications/__init__.py +47 -0
- gcore/resources/cloud/inference/applications/applications.py +134 -0
- gcore/resources/cloud/inference/applications/deployments.py +649 -0
- gcore/resources/cloud/inference/applications/templates.py +238 -0
- gcore/resources/cloud/inference/deployments/deployments.py +41 -22
- gcore/resources/cloud/inference/inference.py +32 -32
- gcore/resources/cloud/inference/registry_credentials.py +8 -9
- gcore/resources/cloud/instances/images.py +4 -4
- gcore/resources/cloud/instances/instances.py +254 -4
- gcore/resources/cloud/instances/interfaces.py +544 -0
- gcore/resources/cloud/k8s/__init__.py +47 -0
- gcore/resources/cloud/k8s/clusters/__init__.py +47 -0
- gcore/resources/cloud/k8s/clusters/clusters.py +1391 -0
- gcore/resources/cloud/k8s/clusters/nodes.py +291 -0
- gcore/resources/cloud/k8s/clusters/pools/__init__.py +33 -0
- gcore/resources/cloud/k8s/clusters/pools/nodes.py +303 -0
- gcore/resources/cloud/k8s/clusters/pools/pools.py +870 -0
- gcore/resources/cloud/k8s/flavors.py +209 -0
- gcore/resources/cloud/k8s/k8s.py +233 -0
- gcore/resources/cloud/load_balancers/l7_policies/l7_policies.py +11 -12
- gcore/resources/cloud/load_balancers/l7_policies/rules.py +9 -10
- gcore/resources/cloud/load_balancers/listeners.py +18 -18
- gcore/resources/cloud/load_balancers/load_balancers.py +4 -4
- gcore/resources/cloud/load_balancers/pools/health_monitors.py +26 -10
- gcore/resources/cloud/load_balancers/pools/members.py +34 -4
- gcore/resources/cloud/load_balancers/pools/pools.py +32 -8
- gcore/resources/cloud/networks/networks.py +192 -4
- gcore/resources/cloud/networks/subnets.py +140 -8
- gcore/resources/cloud/reserved_fixed_ips/vip.py +5 -7
- gcore/resources/cloud/security_groups/security_groups.py +6 -6
- gcore/resources/cloud/tasks.py +46 -46
- gcore/resources/cloud/users/role_assignments.py +5 -4
- gcore/resources/cloud/volumes.py +4 -4
- gcore/resources/dns/__init__.py +75 -0
- gcore/resources/dns/dns.py +374 -0
- gcore/resources/dns/locations.py +288 -0
- gcore/resources/dns/metrics.py +214 -0
- gcore/resources/dns/pickers/__init__.py +33 -0
- gcore/resources/dns/pickers/pickers.py +167 -0
- gcore/resources/dns/pickers/presets.py +135 -0
- gcore/resources/dns/zones/__init__.py +47 -0
- gcore/resources/{cloud/inference/models.py → dns/zones/dnssec.py} +80 -122
- gcore/resources/dns/zones/rrsets.py +1005 -0
- gcore/resources/dns/zones/zones.py +1493 -0
- gcore/resources/security/bgp_announces.py +15 -15
- gcore/resources/storage/__init__.py +75 -0
- gcore/resources/storage/buckets/__init__.py +61 -0
- gcore/resources/storage/buckets/buckets.py +470 -0
- gcore/resources/storage/buckets/cors.py +265 -0
- gcore/resources/storage/buckets/lifecycle.py +276 -0
- gcore/resources/storage/buckets/policy.py +345 -0
- gcore/resources/storage/credentials.py +221 -0
- gcore/resources/storage/locations.py +190 -0
- gcore/resources/storage/statistics.py +364 -0
- gcore/resources/storage/storage.py +1042 -0
- gcore/resources/streaming/ai_tasks.py +56 -70
- gcore/resources/streaming/playlists.py +18 -18
- gcore/resources/streaming/quality_sets.py +8 -8
- gcore/resources/streaming/statistics.py +4 -122
- gcore/resources/streaming/streams/overlays.py +6 -6
- gcore/resources/streaming/streams/streams.py +40 -64
- gcore/resources/streaming/videos/subtitles.py +32 -30
- gcore/resources/streaming/videos/videos.py +78 -72
- gcore/resources/waap/__init__.py +14 -0
- gcore/resources/waap/custom_page_sets.py +40 -34
- gcore/resources/waap/domains/__init__.py +14 -28
- gcore/resources/waap/domains/advanced_rules.py +7 -10
- gcore/resources/waap/domains/{api_discovery/api_discovery.py → api_discovery.py} +292 -59
- gcore/resources/waap/domains/api_path_groups.py +5 -5
- gcore/resources/waap/domains/api_paths.py +28 -30
- gcore/resources/waap/domains/custom_rules.py +7 -10
- gcore/resources/waap/domains/domains.py +124 -68
- gcore/resources/waap/domains/firewall_rules.py +5 -7
- gcore/resources/waap/domains/insight_silences.py +34 -11
- gcore/resources/waap/domains/insights.py +43 -17
- gcore/resources/waap/domains/statistics.py +977 -0
- gcore/resources/waap/insights.py +233 -0
- gcore/resources/waap/ip_info/__init__.py +33 -0
- gcore/resources/waap/{ip_info.py → ip_info/ip_info.py} +149 -235
- gcore/resources/waap/ip_info/metrics.py +203 -0
- gcore/resources/waap/waap.py +40 -8
- gcore/types/cloud/__init__.py +2 -4
- gcore/types/cloud/audit_log_list_params.py +2 -1
- gcore/types/cloud/baremetal/image_list_params.py +3 -2
- gcore/types/cloud/baremetal/server_create_params.py +8 -6
- gcore/types/cloud/baremetal/server_list_params.py +3 -2
- gcore/types/cloud/baremetal/server_rebuild_params.py +2 -0
- gcore/types/cloud/cost_report_get_aggregated_monthly_params.py +35 -31
- gcore/types/cloud/cost_report_get_aggregated_params.py +26 -25
- gcore/types/cloud/cost_report_get_detailed_params.py +26 -25
- gcore/types/cloud/ddos_profile.py +13 -7
- gcore/types/cloud/ddos_profile_field.py +21 -8
- gcore/types/cloud/ddos_profile_option_list.py +7 -6
- gcore/types/cloud/ddos_profile_status.py +2 -2
- gcore/types/cloud/ddos_profile_template.py +7 -3
- gcore/types/cloud/ddos_profile_template_field.py +12 -3
- gcore/types/cloud/file_share.py +2 -2
- gcore/types/cloud/file_share_create_params.py +12 -6
- gcore/types/cloud/floating_ip_list_params.py +3 -2
- gcore/types/cloud/gpu_baremetal_cluster.py +101 -74
- gcore/types/cloud/gpu_baremetal_cluster_create_params.py +76 -93
- gcore/types/cloud/gpu_baremetal_cluster_delete_params.py +17 -10
- gcore/types/cloud/gpu_baremetal_cluster_list_params.py +14 -3
- gcore/types/cloud/gpu_baremetal_cluster_rebuild_params.py +4 -2
- gcore/types/cloud/gpu_baremetal_clusters/__init__.py +6 -0
- gcore/types/cloud/gpu_baremetal_clusters/gpu_baremetal_cluster_server.py +74 -0
- gcore/types/cloud/{gpu_baremetal_cluster_server.py → gpu_baremetal_clusters/gpu_baremetal_cluster_server_v1.py} +10 -10
- gcore/types/cloud/gpu_baremetal_clusters/gpu_baremetal_cluster_server_v1_list.py +16 -0
- gcore/types/cloud/{gpu_baremetal_flavor.py → gpu_baremetal_clusters/gpu_baremetal_flavor.py} +1 -1
- gcore/types/cloud/{gpu_baremetal_flavor_list.py → gpu_baremetal_clusters/gpu_baremetal_flavor_list.py} +1 -1
- gcore/types/cloud/gpu_baremetal_clusters/server_list_params.py +75 -0
- gcore/types/cloud/health_monitor.py +6 -0
- gcore/types/cloud/inference/__init__.py +0 -5
- gcore/types/cloud/inference/applications/__init__.py +12 -0
- gcore/types/cloud/inference/applications/deployment_create_params.py +68 -0
- gcore/types/cloud/inference/applications/deployment_patch_params.py +62 -0
- gcore/types/cloud/inference/applications/inference_application_deployment.py +111 -0
- gcore/types/cloud/inference/applications/inference_application_deployment_list.py +16 -0
- gcore/types/cloud/inference/applications/inference_application_template.py +94 -0
- gcore/types/cloud/inference/applications/inference_application_template_list.py +16 -0
- gcore/types/cloud/inference/deployment_create_params.py +7 -6
- gcore/types/cloud/inference/deployment_update_params.py +7 -6
- gcore/types/cloud/instance_assign_security_group_params.py +4 -2
- gcore/types/cloud/instance_list_params.py +3 -2
- gcore/types/cloud/instance_unassign_security_group_params.py +4 -2
- gcore/types/cloud/instances/image_list_params.py +3 -2
- gcore/types/cloud/k8s/__init__.py +13 -0
- gcore/types/cloud/k8s/cluster_create_params.py +299 -0
- gcore/types/cloud/k8s/cluster_delete_params.py +16 -0
- gcore/types/cloud/k8s/cluster_update_params.py +203 -0
- gcore/types/cloud/k8s/cluster_upgrade_params.py +16 -0
- gcore/types/cloud/k8s/clusters/__init__.py +10 -0
- gcore/types/cloud/k8s/clusters/k8s_cluster_pool.py +66 -0
- gcore/types/cloud/k8s/clusters/k8s_cluster_pool_list.py +16 -0
- gcore/types/cloud/k8s/clusters/node_list_params.py +16 -0
- gcore/types/cloud/k8s/clusters/pool_create_params.py +53 -0
- gcore/types/cloud/k8s/clusters/pool_resize_params.py +18 -0
- gcore/types/cloud/k8s/clusters/pool_update_params.py +34 -0
- gcore/types/{waap/domains/analytics → cloud/k8s/clusters/pools}/__init__.py +1 -1
- gcore/types/cloud/k8s/clusters/pools/node_list_params.py +18 -0
- gcore/types/cloud/k8s/flavor_list_params.py +19 -0
- gcore/types/cloud/k8s/k8s_cluster.py +209 -0
- gcore/types/cloud/k8s/k8s_cluster_certificate.py +13 -0
- gcore/types/cloud/k8s/k8s_cluster_kubeconfig.py +19 -0
- gcore/types/cloud/k8s/k8s_cluster_list.py +16 -0
- gcore/types/cloud/k8s_cluster_version.py +10 -0
- gcore/types/cloud/{gpu_baremetal_cluster_server_list.py → k8s_cluster_version_list.py} +4 -4
- gcore/types/cloud/load_balancer_create_params.py +31 -7
- gcore/types/cloud/load_balancer_list_params.py +3 -2
- gcore/types/cloud/load_balancers/l7_policies/rule_create_params.py +3 -2
- gcore/types/cloud/load_balancers/l7_policies/rule_replace_params.py +3 -2
- gcore/types/cloud/load_balancers/l7_policy_create_params.py +3 -2
- gcore/types/cloud/load_balancers/l7_policy_replace_params.py +3 -2
- gcore/types/cloud/load_balancers/listener_create_params.py +4 -3
- gcore/types/cloud/load_balancers/listener_update_params.py +5 -3
- gcore/types/cloud/load_balancers/pool_create_params.py +27 -4
- gcore/types/cloud/load_balancers/pool_update_params.py +27 -4
- gcore/types/cloud/load_balancers/pools/health_monitor_create_params.py +7 -2
- gcore/types/cloud/load_balancers/pools/member_add_params.py +20 -2
- gcore/types/cloud/member.py +19 -1
- gcore/types/cloud/network_list_params.py +3 -2
- gcore/types/cloud/networks/subnet_create_params.py +3 -2
- gcore/types/cloud/networks/subnet_list_params.py +3 -2
- gcore/types/cloud/networks/subnet_update_params.py +3 -2
- gcore/types/cloud/project.py +9 -9
- gcore/types/cloud/region.py +0 -3
- gcore/types/cloud/reserved_fixed_ips/vip_replace_connected_ports_params.py +3 -2
- gcore/types/cloud/reserved_fixed_ips/vip_update_connected_ports_params.py +3 -2
- gcore/types/cloud/security_group_create_params.py +4 -2
- gcore/types/cloud/security_group_list_params.py +3 -2
- gcore/types/cloud/task_id_list.py +8 -1
- gcore/types/cloud/task_list_params.py +23 -23
- gcore/types/cloud/usage_report_get_params.py +26 -25
- gcore/types/cloud/users/role_assignment.py +2 -1
- gcore/types/cloud/users/role_assignment_create_params.py +4 -2
- gcore/types/cloud/users/role_assignment_update_params.py +4 -2
- gcore/types/cloud/volume_list_params.py +3 -2
- gcore/types/dns/__init__.py +31 -0
- gcore/types/dns/dns_get_account_overview_response.py +21 -0
- gcore/types/dns/dns_label_name.py +13 -0
- gcore/types/dns/dns_location_translations.py +11 -0
- gcore/types/dns/dns_lookup_params.py +15 -0
- gcore/types/dns/dns_lookup_response.py +21 -0
- gcore/types/dns/dns_name_server.py +17 -0
- gcore/types/dns/location_list_continents_response.py +10 -0
- gcore/types/dns/location_list_countries_response.py +10 -0
- gcore/types/dns/location_list_regions_response.py +10 -0
- gcore/types/dns/location_list_response.py +16 -0
- gcore/types/dns/metric_list_params.py +24 -0
- gcore/types/dns/metric_list_response.py +7 -0
- gcore/types/dns/picker_list_response.py +10 -0
- gcore/types/dns/pickers/__init__.py +5 -0
- gcore/types/dns/pickers/preset_list_response.py +10 -0
- gcore/types/dns/zone_check_delegation_status_response.py +20 -0
- gcore/types/dns/zone_create_params.py +59 -0
- gcore/types/dns/zone_create_response.py +13 -0
- gcore/types/dns/zone_export_response.py +11 -0
- gcore/types/dns/zone_get_response.py +106 -0
- gcore/types/dns/zone_get_statistics_params.py +43 -0
- gcore/types/dns/zone_get_statistics_response.py +19 -0
- gcore/types/dns/zone_import_params.py +32 -0
- gcore/types/dns/zone_import_response.py +26 -0
- gcore/types/dns/zone_list_params.py +57 -0
- gcore/types/dns/zone_list_response.py +105 -0
- gcore/types/dns/zone_replace_params.py +61 -0
- gcore/types/dns/zones/__init__.py +15 -0
- gcore/types/dns/zones/dns_failover_log.py +19 -0
- gcore/types/dns/zones/dns_output_rrset.py +123 -0
- gcore/types/dns/zones/dnssec_get_response.py +38 -0
- gcore/types/dns/zones/dnssec_update_params.py +11 -0
- gcore/types/dns/zones/dnssec_update_response.py +38 -0
- gcore/types/dns/zones/rrset_create_params.py +82 -0
- gcore/types/dns/zones/rrset_get_failover_logs_params.py +21 -0
- gcore/types/dns/zones/rrset_get_failover_logs_response.py +15 -0
- gcore/types/dns/zones/rrset_list_params.py +21 -0
- gcore/types/dns/zones/rrset_list_response.py +14 -0
- gcore/types/dns/zones/rrset_replace_params.py +82 -0
- gcore/types/security/__init__.py +1 -1
- gcore/types/security/{bgp_announce_change_params.py → bgp_announce_toggle_params.py} +2 -2
- gcore/types/security/client_profile.py +1 -1
- gcore/types/security/profile_create_params.py +2 -2
- gcore/types/security/profile_recreate_params.py +2 -2
- gcore/types/security/profile_replace_params.py +2 -2
- gcore/types/storage/__init__.py +21 -0
- gcore/types/storage/bucket.py +15 -0
- gcore/types/storage/bucket_list_params.py +15 -0
- gcore/types/storage/buckets/__init__.py +9 -0
- gcore/types/storage/buckets/bucket_cors.py +18 -0
- gcore/types/storage/buckets/bucket_policy.py +7 -0
- gcore/types/storage/buckets/cor_create_params.py +17 -0
- gcore/types/storage/buckets/lifecycle_create_params.py +18 -0
- gcore/types/storage/buckets/policy_get_response.py +7 -0
- gcore/types/storage/credential_recreate_params.py +36 -0
- gcore/types/storage/location.py +24 -0
- gcore/types/storage/location_list_params.py +13 -0
- gcore/types/storage/statistic_get_usage_aggregated_params.py +24 -0
- gcore/types/storage/statistic_get_usage_series_params.py +38 -0
- gcore/types/storage/statistic_get_usage_series_response.py +12 -0
- gcore/types/storage/storage.py +101 -0
- gcore/types/storage/storage_create_params.py +44 -0
- gcore/types/storage/storage_list_params.py +39 -0
- gcore/types/storage/storage_restore_params.py +11 -0
- gcore/types/storage/storage_update_params.py +18 -0
- gcore/types/storage/usage_series.py +201 -0
- gcore/types/storage/usage_total.py +54 -0
- gcore/types/streaming/__init__.py +0 -4
- gcore/types/streaming/ai_contentmoderation_hardnudity.py +1 -1
- gcore/types/streaming/ai_contentmoderation_nsfw.py +1 -1
- gcore/types/streaming/ai_contentmoderation_softnudity.py +1 -1
- gcore/types/streaming/ai_contentmoderation_sport.py +1 -1
- gcore/types/streaming/ai_task.py +1 -5
- gcore/types/streaming/ai_task_create_params.py +2 -2
- gcore/types/streaming/ai_task_get_response.py +0 -46
- gcore/types/streaming/clip.py +2 -1
- gcore/types/streaming/create_video_param.py +13 -12
- gcore/types/streaming/max_stream_series.py +5 -5
- gcore/types/streaming/playlist.py +1 -1
- gcore/types/streaming/playlist_create_params.py +1 -1
- gcore/types/streaming/playlist_update_params.py +1 -1
- gcore/types/streaming/playlist_video.py +13 -12
- gcore/types/streaming/storage_series.py +5 -5
- gcore/types/streaming/stream.py +86 -49
- gcore/types/streaming/stream_create_clip_params.py +2 -1
- gcore/types/streaming/stream_create_params.py +9 -23
- gcore/types/streaming/stream_series.py +5 -5
- gcore/types/streaming/stream_update_params.py +9 -23
- gcore/types/streaming/video.py +53 -42
- gcore/types/streaming/video_update_params.py +13 -12
- gcore/types/streaming/vod_statistics_series.py +5 -5
- gcore/types/streaming/vod_total_stream_duration_series.py +3 -3
- gcore/types/waap/__init__.py +6 -54
- gcore/types/waap/custom_page_set_create_params.py +121 -14
- gcore/types/waap/custom_page_set_preview_params.py +11 -4
- gcore/types/waap/custom_page_set_update_params.py +122 -15
- gcore/types/waap/domain_list_params.py +2 -4
- gcore/types/waap/domain_update_params.py +1 -1
- gcore/types/waap/domains/__init__.py +28 -18
- gcore/types/waap/domains/advanced_rule_create_params.py +7 -4
- gcore/types/waap/domains/advanced_rule_list_params.py +1 -3
- gcore/types/waap/domains/advanced_rule_update_params.py +6 -3
- gcore/types/waap/domains/{api_discovery/scan_result_list_params.py → api_discovery_list_scan_results_params.py} +2 -2
- gcore/types/waap/domains/api_path_create_params.py +4 -3
- gcore/types/waap/domains/{api_path_group_list_response.py → api_path_group_list.py} +2 -2
- gcore/types/waap/domains/api_path_list_params.py +3 -1
- gcore/types/waap/domains/api_path_update_params.py +5 -4
- gcore/types/waap/domains/custom_rule_create_params.py +13 -14
- gcore/types/waap/domains/custom_rule_list_params.py +1 -3
- gcore/types/waap/domains/custom_rule_update_params.py +12 -13
- gcore/types/waap/domains/firewall_rule_create_params.py +3 -2
- gcore/types/waap/domains/firewall_rule_update_params.py +2 -1
- gcore/types/waap/domains/insight_list_params.py +19 -7
- gcore/types/waap/domains/insight_replace_params.py +3 -5
- gcore/types/waap/domains/insight_silence_list_params.py +17 -6
- gcore/types/waap/domains/setting_update_params.py +3 -2
- gcore/types/waap/domains/{analytics_list_ddos_attacks_params.py → statistic_get_ddos_attacks_params.py} +2 -2
- gcore/types/waap/domains/statistic_get_ddos_info_params.py +28 -0
- gcore/types/waap/domains/statistic_get_events_aggregated_params.py +33 -0
- gcore/types/waap/domains/statistic_get_requests_series_params.py +74 -0
- gcore/types/waap/domains/statistic_get_traffic_series_params.py +22 -0
- gcore/types/waap/domains/statistic_get_traffic_series_response.py +10 -0
- gcore/types/waap/{waap_advanced_rule.py → domains/waap_advanced_rule.py} +4 -3
- gcore/types/waap/domains/{api_discovery_get_settings_response.py → waap_api_discovery_settings.py} +2 -2
- gcore/types/waap/domains/{api_path_get_response.py → waap_api_path.py} +6 -6
- gcore/types/waap/domains/{api_discovery/scan_result_get_response.py → waap_api_scan_result.py} +5 -5
- gcore/types/waap/{waap_blocked_statistics.py → domains/waap_blocked_statistics.py} +1 -1
- gcore/types/waap/{waap_count_statistics.py → domains/waap_count_statistics.py} +1 -1
- gcore/types/waap/{waap_custom_rule.py → domains/waap_custom_rule.py} +5 -8
- gcore/types/waap/{waap_ddos_attack.py → domains/waap_ddos_attack.py} +1 -1
- gcore/types/waap/{waap_ddos_info.py → domains/waap_ddos_info.py} +1 -1
- gcore/types/waap/{waap_event_statistics.py → domains/waap_event_statistics.py} +1 -1
- gcore/types/waap/{waap_firewall_rule.py → domains/waap_firewall_rule.py} +4 -3
- gcore/types/waap/{waap_insight.py → domains/waap_insight.py} +4 -4
- gcore/types/waap/{waap_insight_silence.py → domains/waap_insight_silence.py} +1 -1
- gcore/types/waap/domains/waap_request_details.py +186 -0
- gcore/types/waap/{waap_request_summary.py → domains/waap_request_summary.py} +1 -1
- gcore/types/waap/domains/{api_discovery_scan_openapi_response.py → waap_task_id.py} +2 -2
- gcore/types/waap/{waap_traffic_metrics.py → domains/waap_traffic_metrics.py} +1 -1
- gcore/types/waap/insight_list_types_params.py +28 -0
- gcore/types/waap/ip_info/__init__.py +6 -0
- gcore/types/waap/{ip_info_get_counts_params.py → ip_info/metric_list_params.py} +2 -2
- gcore/types/waap/{waap_ip_info_counts.py → ip_info/waap_ip_info_counts.py} +1 -1
- gcore/types/waap/{ip_info_get_params.py → ip_info_get_ip_info_params.py} +2 -2
- gcore/types/waap/{waap_ip_info.py → ip_info_get_ip_info_response.py} +2 -2
- gcore/types/waap/ip_info_get_top_urls_response.py +12 -3
- gcore/types/waap/{ip_info_get_top_sessions_params.py → ip_info_get_top_user_sessions_params.py} +2 -2
- gcore/types/waap/{ip_info_get_top_sessions_response.py → ip_info_get_top_user_sessions_response.py} +2 -2
- gcore/types/waap/waap_custom_page_set.py +113 -13
- gcore/types/waap/waap_detailed_domain.py +2 -2
- gcore/types/waap/waap_insight_type.py +33 -0
- gcore/types/waap/waap_ip_ddos_info_model.py +3 -3
- gcore/types/waap/waap_rule_set.py +26 -3
- gcore/types/waap/waap_summary_domain.py +2 -2
- {gcore-0.9.0.dist-info → gcore-0.11.0.dist-info}/METADATA +7 -2
- {gcore-0.9.0.dist-info → gcore-0.11.0.dist-info}/RECORD +362 -281
- gcore/resources/waap/domains/analytics/__init__.py +0 -33
- gcore/resources/waap/domains/analytics/analytics.py +0 -676
- gcore/resources/waap/domains/analytics/requests.py +0 -378
- gcore/resources/waap/domains/api_discovery/__init__.py +0 -33
- gcore/resources/waap/domains/api_discovery/scan_results.py +0 -352
- gcore/resources/waap/domains/policies.py +0 -173
- gcore/types/cloud/inference/inference_model.py +0 -65
- gcore/types/cloud/inference/inference_registry_credentials_create.py +0 -22
- gcore/types/cloud/inference/model_list_params.py +0 -21
- gcore/types/streaming/ai_contentmoderation_casm.py +0 -39
- gcore/types/streaming/ai_contentmoderation_weapon.py +0 -39
- gcore/types/streaming/meet_series.py +0 -23
- gcore/types/streaming/statistic_get_meet_series_params.py +0 -20
- gcore/types/waap/domains/analytics/request_list_params.py +0 -53
- gcore/types/waap/domains/analytics_get_event_statistics_params.py +0 -34
- gcore/types/waap/domains/analytics_list_ddos_info_params.py +0 -31
- gcore/types/waap/domains/analytics_list_event_traffic_params.py +0 -26
- gcore/types/waap/domains/analytics_list_event_traffic_response.py +0 -10
- gcore/types/waap/domains/api_discovery/__init__.py +0 -7
- gcore/types/waap/domains/api_discovery/scan_result_list_response.py +0 -29
- gcore/types/waap/domains/api_discovery_update_settings_response.py +0 -36
- gcore/types/waap/domains/api_discovery_upload_openapi_response.py +0 -10
- gcore/types/waap/domains/api_path_create_response.py +0 -50
- gcore/types/waap/domains/api_path_list_response.py +0 -50
- gcore/types/waap/waap_block_csrf_page_data.py +0 -28
- gcore/types/waap/waap_block_csrf_page_data_param.py +0 -28
- gcore/types/waap/waap_block_page_data.py +0 -28
- gcore/types/waap/waap_block_page_data_param.py +0 -28
- gcore/types/waap/waap_captcha_page_data.py +0 -31
- gcore/types/waap/waap_captcha_page_data_param.py +0 -31
- gcore/types/waap/waap_common_tag.py +0 -16
- gcore/types/waap/waap_cookie_disabled_page_data.py +0 -18
- gcore/types/waap/waap_cookie_disabled_page_data_param.py +0 -18
- gcore/types/waap/waap_customer_rule_state.py +0 -7
- gcore/types/waap/waap_domain_policy.py +0 -29
- gcore/types/waap/waap_domain_status.py +0 -7
- gcore/types/waap/waap_handshake_page_data.py +0 -25
- gcore/types/waap/waap_handshake_page_data_param.py +0 -25
- gcore/types/waap/waap_insight_silence_sort_by.py +0 -9
- gcore/types/waap/waap_insight_sort_by.py +0 -20
- gcore/types/waap/waap_insight_status.py +0 -7
- gcore/types/waap/waap_javascript_disabled_page_data.py +0 -18
- gcore/types/waap/waap_javascript_disabled_page_data_param.py +0 -18
- gcore/types/waap/waap_network_details.py +0 -17
- gcore/types/waap/waap_page_type.py +0 -9
- gcore/types/waap/waap_paginated_custom_page_set.py +0 -22
- gcore/types/waap/waap_paginated_ddos_attack.py +0 -22
- gcore/types/waap/waap_paginated_ddos_info.py +0 -22
- gcore/types/waap/waap_paginated_request_summary.py +0 -22
- gcore/types/waap/waap_pattern_matched_tag.py +0 -37
- gcore/types/waap/waap_policy_action.py +0 -7
- gcore/types/waap/waap_request_details.py +0 -92
- gcore/types/waap/waap_request_organization.py +0 -13
- gcore/types/waap/waap_resolution.py +0 -7
- gcore/types/waap/waap_rule_action_type.py +0 -7
- gcore/types/waap/waap_top_url.py +0 -13
- gcore/types/waap/waap_traffic_type.py +0 -28
- gcore/types/waap/waap_user_agent_details.py +0 -40
- {gcore-0.9.0.dist-info → gcore-0.11.0.dist-info}/WHEEL +0 -0
- {gcore-0.9.0.dist-info → gcore-0.11.0.dist-info}/licenses/LICENSE +0 -0
|
@@ -0,0 +1,977 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from typing import List, Union, Optional
|
|
6
|
+
from datetime import datetime
|
|
7
|
+
from typing_extensions import Literal
|
|
8
|
+
|
|
9
|
+
import httpx
|
|
10
|
+
|
|
11
|
+
from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven, SequenceNotStr
|
|
12
|
+
from ...._utils import maybe_transform, async_maybe_transform
|
|
13
|
+
from ...._compat import cached_property
|
|
14
|
+
from ...._resource import SyncAPIResource, AsyncAPIResource
|
|
15
|
+
from ...._response import (
|
|
16
|
+
to_raw_response_wrapper,
|
|
17
|
+
to_streamed_response_wrapper,
|
|
18
|
+
async_to_raw_response_wrapper,
|
|
19
|
+
async_to_streamed_response_wrapper,
|
|
20
|
+
)
|
|
21
|
+
from ....pagination import SyncOffsetPage, AsyncOffsetPage
|
|
22
|
+
from ...._base_client import AsyncPaginator, make_request_options
|
|
23
|
+
from ....types.waap.domains import (
|
|
24
|
+
statistic_get_ddos_info_params,
|
|
25
|
+
statistic_get_ddos_attacks_params,
|
|
26
|
+
statistic_get_traffic_series_params,
|
|
27
|
+
statistic_get_requests_series_params,
|
|
28
|
+
statistic_get_events_aggregated_params,
|
|
29
|
+
)
|
|
30
|
+
from ....types.waap.domains.waap_ddos_info import WaapDDOSInfo
|
|
31
|
+
from ....types.waap.domains.waap_ddos_attack import WaapDDOSAttack
|
|
32
|
+
from ....types.waap.domains.waap_request_details import WaapRequestDetails
|
|
33
|
+
from ....types.waap.domains.waap_request_summary import WaapRequestSummary
|
|
34
|
+
from ....types.waap.domains.waap_event_statistics import WaapEventStatistics
|
|
35
|
+
from ....types.waap.domains.statistic_get_traffic_series_response import StatisticGetTrafficSeriesResponse
|
|
36
|
+
|
|
37
|
+
__all__ = ["StatisticsResource", "AsyncStatisticsResource"]
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
class StatisticsResource(SyncAPIResource):
|
|
41
|
+
@cached_property
|
|
42
|
+
def with_raw_response(self) -> StatisticsResourceWithRawResponse:
|
|
43
|
+
"""
|
|
44
|
+
This property can be used as a prefix for any HTTP method call to return
|
|
45
|
+
the raw response object instead of the parsed content.
|
|
46
|
+
|
|
47
|
+
For more information, see https://www.github.com/G-Core/gcore-python#accessing-raw-response-data-eg-headers
|
|
48
|
+
"""
|
|
49
|
+
return StatisticsResourceWithRawResponse(self)
|
|
50
|
+
|
|
51
|
+
@cached_property
|
|
52
|
+
def with_streaming_response(self) -> StatisticsResourceWithStreamingResponse:
|
|
53
|
+
"""
|
|
54
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
55
|
+
|
|
56
|
+
For more information, see https://www.github.com/G-Core/gcore-python#with_streaming_response
|
|
57
|
+
"""
|
|
58
|
+
return StatisticsResourceWithStreamingResponse(self)
|
|
59
|
+
|
|
60
|
+
def get_ddos_attacks(
|
|
61
|
+
self,
|
|
62
|
+
domain_id: int,
|
|
63
|
+
*,
|
|
64
|
+
end_time: Union[str, datetime, None] | NotGiven = NOT_GIVEN,
|
|
65
|
+
limit: int | NotGiven = NOT_GIVEN,
|
|
66
|
+
offset: int | NotGiven = NOT_GIVEN,
|
|
67
|
+
ordering: Literal["start_time", "-start_time", "end_time", "-end_time"] | NotGiven = NOT_GIVEN,
|
|
68
|
+
start_time: Union[str, datetime, None] | NotGiven = NOT_GIVEN,
|
|
69
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
70
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
71
|
+
extra_headers: Headers | None = None,
|
|
72
|
+
extra_query: Query | None = None,
|
|
73
|
+
extra_body: Body | None = None,
|
|
74
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
75
|
+
) -> SyncOffsetPage[WaapDDOSAttack]:
|
|
76
|
+
"""
|
|
77
|
+
Retrieve a domain's DDoS attacks
|
|
78
|
+
|
|
79
|
+
Args:
|
|
80
|
+
domain_id: The domain ID
|
|
81
|
+
|
|
82
|
+
end_time: Filter attacks up to a specified end date in ISO 8601 format
|
|
83
|
+
|
|
84
|
+
limit: Number of items to return
|
|
85
|
+
|
|
86
|
+
offset: Number of items to skip
|
|
87
|
+
|
|
88
|
+
ordering: Sort the response by given field.
|
|
89
|
+
|
|
90
|
+
start_time: Filter attacks starting from a specified date in ISO 8601 format
|
|
91
|
+
|
|
92
|
+
extra_headers: Send extra headers
|
|
93
|
+
|
|
94
|
+
extra_query: Add additional query parameters to the request
|
|
95
|
+
|
|
96
|
+
extra_body: Add additional JSON properties to the request
|
|
97
|
+
|
|
98
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
99
|
+
"""
|
|
100
|
+
return self._get_api_list(
|
|
101
|
+
f"/waap/v1/domains/{domain_id}/ddos-attacks",
|
|
102
|
+
page=SyncOffsetPage[WaapDDOSAttack],
|
|
103
|
+
options=make_request_options(
|
|
104
|
+
extra_headers=extra_headers,
|
|
105
|
+
extra_query=extra_query,
|
|
106
|
+
extra_body=extra_body,
|
|
107
|
+
timeout=timeout,
|
|
108
|
+
query=maybe_transform(
|
|
109
|
+
{
|
|
110
|
+
"end_time": end_time,
|
|
111
|
+
"limit": limit,
|
|
112
|
+
"offset": offset,
|
|
113
|
+
"ordering": ordering,
|
|
114
|
+
"start_time": start_time,
|
|
115
|
+
},
|
|
116
|
+
statistic_get_ddos_attacks_params.StatisticGetDDOSAttacksParams,
|
|
117
|
+
),
|
|
118
|
+
),
|
|
119
|
+
model=WaapDDOSAttack,
|
|
120
|
+
)
|
|
121
|
+
|
|
122
|
+
def get_ddos_info(
|
|
123
|
+
self,
|
|
124
|
+
domain_id: int,
|
|
125
|
+
*,
|
|
126
|
+
group_by: Literal["URL", "User-Agent", "IP"],
|
|
127
|
+
start: str,
|
|
128
|
+
end: Optional[str] | NotGiven = NOT_GIVEN,
|
|
129
|
+
limit: int | NotGiven = NOT_GIVEN,
|
|
130
|
+
offset: int | NotGiven = NOT_GIVEN,
|
|
131
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
132
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
133
|
+
extra_headers: Headers | None = None,
|
|
134
|
+
extra_query: Query | None = None,
|
|
135
|
+
extra_body: Body | None = None,
|
|
136
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
137
|
+
) -> SyncOffsetPage[WaapDDOSInfo]:
|
|
138
|
+
"""
|
|
139
|
+
Returns the top DDoS counts grouped by URL, User-Agent or IP
|
|
140
|
+
|
|
141
|
+
Args:
|
|
142
|
+
domain_id: The domain ID
|
|
143
|
+
|
|
144
|
+
group_by: The identity of the requests to group by
|
|
145
|
+
|
|
146
|
+
start: Filter data items starting from a specified date in ISO 8601 format
|
|
147
|
+
|
|
148
|
+
end: Filter data items up to a specified end date in ISO 8601 format. If not
|
|
149
|
+
provided, defaults to the current date and time.
|
|
150
|
+
|
|
151
|
+
limit: Number of items to return
|
|
152
|
+
|
|
153
|
+
offset: Number of items to skip
|
|
154
|
+
|
|
155
|
+
extra_headers: Send extra headers
|
|
156
|
+
|
|
157
|
+
extra_query: Add additional query parameters to the request
|
|
158
|
+
|
|
159
|
+
extra_body: Add additional JSON properties to the request
|
|
160
|
+
|
|
161
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
162
|
+
"""
|
|
163
|
+
return self._get_api_list(
|
|
164
|
+
f"/waap/v1/domains/{domain_id}/ddos-info",
|
|
165
|
+
page=SyncOffsetPage[WaapDDOSInfo],
|
|
166
|
+
options=make_request_options(
|
|
167
|
+
extra_headers=extra_headers,
|
|
168
|
+
extra_query=extra_query,
|
|
169
|
+
extra_body=extra_body,
|
|
170
|
+
timeout=timeout,
|
|
171
|
+
query=maybe_transform(
|
|
172
|
+
{
|
|
173
|
+
"group_by": group_by,
|
|
174
|
+
"start": start,
|
|
175
|
+
"end": end,
|
|
176
|
+
"limit": limit,
|
|
177
|
+
"offset": offset,
|
|
178
|
+
},
|
|
179
|
+
statistic_get_ddos_info_params.StatisticGetDDOSInfoParams,
|
|
180
|
+
),
|
|
181
|
+
),
|
|
182
|
+
model=WaapDDOSInfo,
|
|
183
|
+
)
|
|
184
|
+
|
|
185
|
+
def get_events_aggregated(
|
|
186
|
+
self,
|
|
187
|
+
domain_id: int,
|
|
188
|
+
*,
|
|
189
|
+
start: str,
|
|
190
|
+
action: Optional[List[Literal["block", "captcha", "handshake", "monitor"]]] | NotGiven = NOT_GIVEN,
|
|
191
|
+
end: Optional[str] | NotGiven = NOT_GIVEN,
|
|
192
|
+
ip: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN,
|
|
193
|
+
reference_id: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN,
|
|
194
|
+
result: Optional[List[Literal["passed", "blocked", "monitored", "allowed"]]] | NotGiven = NOT_GIVEN,
|
|
195
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
196
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
197
|
+
extra_headers: Headers | None = None,
|
|
198
|
+
extra_query: Query | None = None,
|
|
199
|
+
extra_body: Body | None = None,
|
|
200
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
201
|
+
) -> WaapEventStatistics:
|
|
202
|
+
"""
|
|
203
|
+
Retrieve an domain's event statistics
|
|
204
|
+
|
|
205
|
+
Args:
|
|
206
|
+
domain_id: The domain ID
|
|
207
|
+
|
|
208
|
+
start: Filter data items starting from a specified date in ISO 8601 format
|
|
209
|
+
|
|
210
|
+
action: A list of action names to filter on.
|
|
211
|
+
|
|
212
|
+
end: Filter data items up to a specified end date in ISO 8601 format. If not
|
|
213
|
+
provided, defaults to the current date and time.
|
|
214
|
+
|
|
215
|
+
ip: A list of IPs to filter event statistics.
|
|
216
|
+
|
|
217
|
+
reference_id: A list of reference IDs to filter event statistics.
|
|
218
|
+
|
|
219
|
+
result: A list of results to filter event statistics.
|
|
220
|
+
|
|
221
|
+
extra_headers: Send extra headers
|
|
222
|
+
|
|
223
|
+
extra_query: Add additional query parameters to the request
|
|
224
|
+
|
|
225
|
+
extra_body: Add additional JSON properties to the request
|
|
226
|
+
|
|
227
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
228
|
+
"""
|
|
229
|
+
return self._get(
|
|
230
|
+
f"/waap/v1/domains/{domain_id}/stats",
|
|
231
|
+
options=make_request_options(
|
|
232
|
+
extra_headers=extra_headers,
|
|
233
|
+
extra_query=extra_query,
|
|
234
|
+
extra_body=extra_body,
|
|
235
|
+
timeout=timeout,
|
|
236
|
+
query=maybe_transform(
|
|
237
|
+
{
|
|
238
|
+
"start": start,
|
|
239
|
+
"action": action,
|
|
240
|
+
"end": end,
|
|
241
|
+
"ip": ip,
|
|
242
|
+
"reference_id": reference_id,
|
|
243
|
+
"result": result,
|
|
244
|
+
},
|
|
245
|
+
statistic_get_events_aggregated_params.StatisticGetEventsAggregatedParams,
|
|
246
|
+
),
|
|
247
|
+
),
|
|
248
|
+
cast_to=WaapEventStatistics,
|
|
249
|
+
)
|
|
250
|
+
|
|
251
|
+
def get_request_details(
|
|
252
|
+
self,
|
|
253
|
+
request_id: str,
|
|
254
|
+
*,
|
|
255
|
+
domain_id: int,
|
|
256
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
257
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
258
|
+
extra_headers: Headers | None = None,
|
|
259
|
+
extra_query: Query | None = None,
|
|
260
|
+
extra_body: Body | None = None,
|
|
261
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
262
|
+
) -> WaapRequestDetails:
|
|
263
|
+
"""
|
|
264
|
+
Retrieves all the available information for a request that matches a given
|
|
265
|
+
request id
|
|
266
|
+
|
|
267
|
+
Args:
|
|
268
|
+
domain_id: The domain ID
|
|
269
|
+
|
|
270
|
+
request_id: The request ID
|
|
271
|
+
|
|
272
|
+
extra_headers: Send extra headers
|
|
273
|
+
|
|
274
|
+
extra_query: Add additional query parameters to the request
|
|
275
|
+
|
|
276
|
+
extra_body: Add additional JSON properties to the request
|
|
277
|
+
|
|
278
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
279
|
+
"""
|
|
280
|
+
if not request_id:
|
|
281
|
+
raise ValueError(f"Expected a non-empty value for `request_id` but received {request_id!r}")
|
|
282
|
+
return self._get(
|
|
283
|
+
f"/waap/v1/domains/{domain_id}/requests/{request_id}/details",
|
|
284
|
+
options=make_request_options(
|
|
285
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
286
|
+
),
|
|
287
|
+
cast_to=WaapRequestDetails,
|
|
288
|
+
)
|
|
289
|
+
|
|
290
|
+
def get_requests_series(
|
|
291
|
+
self,
|
|
292
|
+
domain_id: int,
|
|
293
|
+
*,
|
|
294
|
+
start: str,
|
|
295
|
+
actions: List[Literal["allow", "block", "captcha", "handshake"]] | NotGiven = NOT_GIVEN,
|
|
296
|
+
countries: SequenceNotStr[str] | NotGiven = NOT_GIVEN,
|
|
297
|
+
end: Optional[str] | NotGiven = NOT_GIVEN,
|
|
298
|
+
ip: str | NotGiven = NOT_GIVEN,
|
|
299
|
+
limit: int | NotGiven = NOT_GIVEN,
|
|
300
|
+
offset: int | NotGiven = NOT_GIVEN,
|
|
301
|
+
ordering: str | NotGiven = NOT_GIVEN,
|
|
302
|
+
reference_id: str | NotGiven = NOT_GIVEN,
|
|
303
|
+
security_rule_name: str | NotGiven = NOT_GIVEN,
|
|
304
|
+
status_code: int | NotGiven = NOT_GIVEN,
|
|
305
|
+
traffic_types: List[
|
|
306
|
+
Literal[
|
|
307
|
+
"policy_allowed",
|
|
308
|
+
"policy_blocked",
|
|
309
|
+
"custom_rule_allowed",
|
|
310
|
+
"custom_blocked",
|
|
311
|
+
"legit_requests",
|
|
312
|
+
"sanctioned",
|
|
313
|
+
"dynamic",
|
|
314
|
+
"api",
|
|
315
|
+
"static",
|
|
316
|
+
"ajax",
|
|
317
|
+
"redirects",
|
|
318
|
+
"monitor",
|
|
319
|
+
"err_40x",
|
|
320
|
+
"err_50x",
|
|
321
|
+
"passed_to_origin",
|
|
322
|
+
"timeout",
|
|
323
|
+
"other",
|
|
324
|
+
"ddos",
|
|
325
|
+
"legit",
|
|
326
|
+
"monitored",
|
|
327
|
+
]
|
|
328
|
+
]
|
|
329
|
+
| NotGiven = NOT_GIVEN,
|
|
330
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
331
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
332
|
+
extra_headers: Headers | None = None,
|
|
333
|
+
extra_query: Query | None = None,
|
|
334
|
+
extra_body: Body | None = None,
|
|
335
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
336
|
+
) -> SyncOffsetPage[WaapRequestSummary]:
|
|
337
|
+
"""
|
|
338
|
+
Retrieve a domain's requests data.
|
|
339
|
+
|
|
340
|
+
Args:
|
|
341
|
+
domain_id: The domain ID
|
|
342
|
+
|
|
343
|
+
start: Filter data items starting from a specified date in ISO 8601 format
|
|
344
|
+
|
|
345
|
+
actions: Filter the response by actions.
|
|
346
|
+
|
|
347
|
+
countries: Filter the response by country codes in ISO 3166-1 alpha-2 format.
|
|
348
|
+
|
|
349
|
+
end: Filter data items up to a specified end date in ISO 8601 format. If not
|
|
350
|
+
provided, defaults to the current date and time.
|
|
351
|
+
|
|
352
|
+
ip: Filter the response by IP.
|
|
353
|
+
|
|
354
|
+
limit: Number of items to return
|
|
355
|
+
|
|
356
|
+
offset: Number of items to skip
|
|
357
|
+
|
|
358
|
+
ordering: Sort the response by given field.
|
|
359
|
+
|
|
360
|
+
reference_id: Filter the response by reference ID.
|
|
361
|
+
|
|
362
|
+
security_rule_name: Filter the response by security rule name.
|
|
363
|
+
|
|
364
|
+
status_code: Filter the response by response code.
|
|
365
|
+
|
|
366
|
+
traffic_types: Filter the response by traffic types.
|
|
367
|
+
|
|
368
|
+
extra_headers: Send extra headers
|
|
369
|
+
|
|
370
|
+
extra_query: Add additional query parameters to the request
|
|
371
|
+
|
|
372
|
+
extra_body: Add additional JSON properties to the request
|
|
373
|
+
|
|
374
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
375
|
+
"""
|
|
376
|
+
return self._get_api_list(
|
|
377
|
+
f"/waap/v1/domains/{domain_id}/requests",
|
|
378
|
+
page=SyncOffsetPage[WaapRequestSummary],
|
|
379
|
+
options=make_request_options(
|
|
380
|
+
extra_headers=extra_headers,
|
|
381
|
+
extra_query=extra_query,
|
|
382
|
+
extra_body=extra_body,
|
|
383
|
+
timeout=timeout,
|
|
384
|
+
query=maybe_transform(
|
|
385
|
+
{
|
|
386
|
+
"start": start,
|
|
387
|
+
"actions": actions,
|
|
388
|
+
"countries": countries,
|
|
389
|
+
"end": end,
|
|
390
|
+
"ip": ip,
|
|
391
|
+
"limit": limit,
|
|
392
|
+
"offset": offset,
|
|
393
|
+
"ordering": ordering,
|
|
394
|
+
"reference_id": reference_id,
|
|
395
|
+
"security_rule_name": security_rule_name,
|
|
396
|
+
"status_code": status_code,
|
|
397
|
+
"traffic_types": traffic_types,
|
|
398
|
+
},
|
|
399
|
+
statistic_get_requests_series_params.StatisticGetRequestsSeriesParams,
|
|
400
|
+
),
|
|
401
|
+
),
|
|
402
|
+
model=WaapRequestSummary,
|
|
403
|
+
)
|
|
404
|
+
|
|
405
|
+
def get_traffic_series(
|
|
406
|
+
self,
|
|
407
|
+
domain_id: int,
|
|
408
|
+
*,
|
|
409
|
+
resolution: Literal["daily", "hourly", "minutely"],
|
|
410
|
+
start: str,
|
|
411
|
+
end: Optional[str] | NotGiven = NOT_GIVEN,
|
|
412
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
413
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
414
|
+
extra_headers: Headers | None = None,
|
|
415
|
+
extra_query: Query | None = None,
|
|
416
|
+
extra_body: Body | None = None,
|
|
417
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
418
|
+
) -> StatisticGetTrafficSeriesResponse:
|
|
419
|
+
"""
|
|
420
|
+
Retrieves a comprehensive report on a domain's traffic statistics based on
|
|
421
|
+
Clickhouse. The report includes details such as API requests, blocked events,
|
|
422
|
+
error counts, and many more traffic-related metrics.
|
|
423
|
+
|
|
424
|
+
Args:
|
|
425
|
+
domain_id: The domain ID
|
|
426
|
+
|
|
427
|
+
resolution: Specifies the granularity of the result data.
|
|
428
|
+
|
|
429
|
+
start: Filter data items starting from a specified date in ISO 8601 format
|
|
430
|
+
|
|
431
|
+
end: Filter data items up to a specified end date in ISO 8601 format. If not
|
|
432
|
+
provided, defaults to the current date and time.
|
|
433
|
+
|
|
434
|
+
extra_headers: Send extra headers
|
|
435
|
+
|
|
436
|
+
extra_query: Add additional query parameters to the request
|
|
437
|
+
|
|
438
|
+
extra_body: Add additional JSON properties to the request
|
|
439
|
+
|
|
440
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
441
|
+
"""
|
|
442
|
+
return self._get(
|
|
443
|
+
f"/waap/v1/domains/{domain_id}/traffic",
|
|
444
|
+
options=make_request_options(
|
|
445
|
+
extra_headers=extra_headers,
|
|
446
|
+
extra_query=extra_query,
|
|
447
|
+
extra_body=extra_body,
|
|
448
|
+
timeout=timeout,
|
|
449
|
+
query=maybe_transform(
|
|
450
|
+
{
|
|
451
|
+
"resolution": resolution,
|
|
452
|
+
"start": start,
|
|
453
|
+
"end": end,
|
|
454
|
+
},
|
|
455
|
+
statistic_get_traffic_series_params.StatisticGetTrafficSeriesParams,
|
|
456
|
+
),
|
|
457
|
+
),
|
|
458
|
+
cast_to=StatisticGetTrafficSeriesResponse,
|
|
459
|
+
)
|
|
460
|
+
|
|
461
|
+
|
|
462
|
+
class AsyncStatisticsResource(AsyncAPIResource):
|
|
463
|
+
@cached_property
|
|
464
|
+
def with_raw_response(self) -> AsyncStatisticsResourceWithRawResponse:
|
|
465
|
+
"""
|
|
466
|
+
This property can be used as a prefix for any HTTP method call to return
|
|
467
|
+
the raw response object instead of the parsed content.
|
|
468
|
+
|
|
469
|
+
For more information, see https://www.github.com/G-Core/gcore-python#accessing-raw-response-data-eg-headers
|
|
470
|
+
"""
|
|
471
|
+
return AsyncStatisticsResourceWithRawResponse(self)
|
|
472
|
+
|
|
473
|
+
@cached_property
|
|
474
|
+
def with_streaming_response(self) -> AsyncStatisticsResourceWithStreamingResponse:
|
|
475
|
+
"""
|
|
476
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
477
|
+
|
|
478
|
+
For more information, see https://www.github.com/G-Core/gcore-python#with_streaming_response
|
|
479
|
+
"""
|
|
480
|
+
return AsyncStatisticsResourceWithStreamingResponse(self)
|
|
481
|
+
|
|
482
|
+
def get_ddos_attacks(
|
|
483
|
+
self,
|
|
484
|
+
domain_id: int,
|
|
485
|
+
*,
|
|
486
|
+
end_time: Union[str, datetime, None] | NotGiven = NOT_GIVEN,
|
|
487
|
+
limit: int | NotGiven = NOT_GIVEN,
|
|
488
|
+
offset: int | NotGiven = NOT_GIVEN,
|
|
489
|
+
ordering: Literal["start_time", "-start_time", "end_time", "-end_time"] | NotGiven = NOT_GIVEN,
|
|
490
|
+
start_time: Union[str, datetime, None] | NotGiven = NOT_GIVEN,
|
|
491
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
492
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
493
|
+
extra_headers: Headers | None = None,
|
|
494
|
+
extra_query: Query | None = None,
|
|
495
|
+
extra_body: Body | None = None,
|
|
496
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
497
|
+
) -> AsyncPaginator[WaapDDOSAttack, AsyncOffsetPage[WaapDDOSAttack]]:
|
|
498
|
+
"""
|
|
499
|
+
Retrieve a domain's DDoS attacks
|
|
500
|
+
|
|
501
|
+
Args:
|
|
502
|
+
domain_id: The domain ID
|
|
503
|
+
|
|
504
|
+
end_time: Filter attacks up to a specified end date in ISO 8601 format
|
|
505
|
+
|
|
506
|
+
limit: Number of items to return
|
|
507
|
+
|
|
508
|
+
offset: Number of items to skip
|
|
509
|
+
|
|
510
|
+
ordering: Sort the response by given field.
|
|
511
|
+
|
|
512
|
+
start_time: Filter attacks starting from a specified date in ISO 8601 format
|
|
513
|
+
|
|
514
|
+
extra_headers: Send extra headers
|
|
515
|
+
|
|
516
|
+
extra_query: Add additional query parameters to the request
|
|
517
|
+
|
|
518
|
+
extra_body: Add additional JSON properties to the request
|
|
519
|
+
|
|
520
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
521
|
+
"""
|
|
522
|
+
return self._get_api_list(
|
|
523
|
+
f"/waap/v1/domains/{domain_id}/ddos-attacks",
|
|
524
|
+
page=AsyncOffsetPage[WaapDDOSAttack],
|
|
525
|
+
options=make_request_options(
|
|
526
|
+
extra_headers=extra_headers,
|
|
527
|
+
extra_query=extra_query,
|
|
528
|
+
extra_body=extra_body,
|
|
529
|
+
timeout=timeout,
|
|
530
|
+
query=maybe_transform(
|
|
531
|
+
{
|
|
532
|
+
"end_time": end_time,
|
|
533
|
+
"limit": limit,
|
|
534
|
+
"offset": offset,
|
|
535
|
+
"ordering": ordering,
|
|
536
|
+
"start_time": start_time,
|
|
537
|
+
},
|
|
538
|
+
statistic_get_ddos_attacks_params.StatisticGetDDOSAttacksParams,
|
|
539
|
+
),
|
|
540
|
+
),
|
|
541
|
+
model=WaapDDOSAttack,
|
|
542
|
+
)
|
|
543
|
+
|
|
544
|
+
def get_ddos_info(
|
|
545
|
+
self,
|
|
546
|
+
domain_id: int,
|
|
547
|
+
*,
|
|
548
|
+
group_by: Literal["URL", "User-Agent", "IP"],
|
|
549
|
+
start: str,
|
|
550
|
+
end: Optional[str] | NotGiven = NOT_GIVEN,
|
|
551
|
+
limit: int | NotGiven = NOT_GIVEN,
|
|
552
|
+
offset: int | NotGiven = NOT_GIVEN,
|
|
553
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
554
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
555
|
+
extra_headers: Headers | None = None,
|
|
556
|
+
extra_query: Query | None = None,
|
|
557
|
+
extra_body: Body | None = None,
|
|
558
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
559
|
+
) -> AsyncPaginator[WaapDDOSInfo, AsyncOffsetPage[WaapDDOSInfo]]:
|
|
560
|
+
"""
|
|
561
|
+
Returns the top DDoS counts grouped by URL, User-Agent or IP
|
|
562
|
+
|
|
563
|
+
Args:
|
|
564
|
+
domain_id: The domain ID
|
|
565
|
+
|
|
566
|
+
group_by: The identity of the requests to group by
|
|
567
|
+
|
|
568
|
+
start: Filter data items starting from a specified date in ISO 8601 format
|
|
569
|
+
|
|
570
|
+
end: Filter data items up to a specified end date in ISO 8601 format. If not
|
|
571
|
+
provided, defaults to the current date and time.
|
|
572
|
+
|
|
573
|
+
limit: Number of items to return
|
|
574
|
+
|
|
575
|
+
offset: Number of items to skip
|
|
576
|
+
|
|
577
|
+
extra_headers: Send extra headers
|
|
578
|
+
|
|
579
|
+
extra_query: Add additional query parameters to the request
|
|
580
|
+
|
|
581
|
+
extra_body: Add additional JSON properties to the request
|
|
582
|
+
|
|
583
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
584
|
+
"""
|
|
585
|
+
return self._get_api_list(
|
|
586
|
+
f"/waap/v1/domains/{domain_id}/ddos-info",
|
|
587
|
+
page=AsyncOffsetPage[WaapDDOSInfo],
|
|
588
|
+
options=make_request_options(
|
|
589
|
+
extra_headers=extra_headers,
|
|
590
|
+
extra_query=extra_query,
|
|
591
|
+
extra_body=extra_body,
|
|
592
|
+
timeout=timeout,
|
|
593
|
+
query=maybe_transform(
|
|
594
|
+
{
|
|
595
|
+
"group_by": group_by,
|
|
596
|
+
"start": start,
|
|
597
|
+
"end": end,
|
|
598
|
+
"limit": limit,
|
|
599
|
+
"offset": offset,
|
|
600
|
+
},
|
|
601
|
+
statistic_get_ddos_info_params.StatisticGetDDOSInfoParams,
|
|
602
|
+
),
|
|
603
|
+
),
|
|
604
|
+
model=WaapDDOSInfo,
|
|
605
|
+
)
|
|
606
|
+
|
|
607
|
+
async def get_events_aggregated(
|
|
608
|
+
self,
|
|
609
|
+
domain_id: int,
|
|
610
|
+
*,
|
|
611
|
+
start: str,
|
|
612
|
+
action: Optional[List[Literal["block", "captcha", "handshake", "monitor"]]] | NotGiven = NOT_GIVEN,
|
|
613
|
+
end: Optional[str] | NotGiven = NOT_GIVEN,
|
|
614
|
+
ip: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN,
|
|
615
|
+
reference_id: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN,
|
|
616
|
+
result: Optional[List[Literal["passed", "blocked", "monitored", "allowed"]]] | NotGiven = NOT_GIVEN,
|
|
617
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
618
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
619
|
+
extra_headers: Headers | None = None,
|
|
620
|
+
extra_query: Query | None = None,
|
|
621
|
+
extra_body: Body | None = None,
|
|
622
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
623
|
+
) -> WaapEventStatistics:
|
|
624
|
+
"""
|
|
625
|
+
Retrieve an domain's event statistics
|
|
626
|
+
|
|
627
|
+
Args:
|
|
628
|
+
domain_id: The domain ID
|
|
629
|
+
|
|
630
|
+
start: Filter data items starting from a specified date in ISO 8601 format
|
|
631
|
+
|
|
632
|
+
action: A list of action names to filter on.
|
|
633
|
+
|
|
634
|
+
end: Filter data items up to a specified end date in ISO 8601 format. If not
|
|
635
|
+
provided, defaults to the current date and time.
|
|
636
|
+
|
|
637
|
+
ip: A list of IPs to filter event statistics.
|
|
638
|
+
|
|
639
|
+
reference_id: A list of reference IDs to filter event statistics.
|
|
640
|
+
|
|
641
|
+
result: A list of results to filter event statistics.
|
|
642
|
+
|
|
643
|
+
extra_headers: Send extra headers
|
|
644
|
+
|
|
645
|
+
extra_query: Add additional query parameters to the request
|
|
646
|
+
|
|
647
|
+
extra_body: Add additional JSON properties to the request
|
|
648
|
+
|
|
649
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
650
|
+
"""
|
|
651
|
+
return await self._get(
|
|
652
|
+
f"/waap/v1/domains/{domain_id}/stats",
|
|
653
|
+
options=make_request_options(
|
|
654
|
+
extra_headers=extra_headers,
|
|
655
|
+
extra_query=extra_query,
|
|
656
|
+
extra_body=extra_body,
|
|
657
|
+
timeout=timeout,
|
|
658
|
+
query=await async_maybe_transform(
|
|
659
|
+
{
|
|
660
|
+
"start": start,
|
|
661
|
+
"action": action,
|
|
662
|
+
"end": end,
|
|
663
|
+
"ip": ip,
|
|
664
|
+
"reference_id": reference_id,
|
|
665
|
+
"result": result,
|
|
666
|
+
},
|
|
667
|
+
statistic_get_events_aggregated_params.StatisticGetEventsAggregatedParams,
|
|
668
|
+
),
|
|
669
|
+
),
|
|
670
|
+
cast_to=WaapEventStatistics,
|
|
671
|
+
)
|
|
672
|
+
|
|
673
|
+
async def get_request_details(
|
|
674
|
+
self,
|
|
675
|
+
request_id: str,
|
|
676
|
+
*,
|
|
677
|
+
domain_id: int,
|
|
678
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
679
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
680
|
+
extra_headers: Headers | None = None,
|
|
681
|
+
extra_query: Query | None = None,
|
|
682
|
+
extra_body: Body | None = None,
|
|
683
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
684
|
+
) -> WaapRequestDetails:
|
|
685
|
+
"""
|
|
686
|
+
Retrieves all the available information for a request that matches a given
|
|
687
|
+
request id
|
|
688
|
+
|
|
689
|
+
Args:
|
|
690
|
+
domain_id: The domain ID
|
|
691
|
+
|
|
692
|
+
request_id: The request ID
|
|
693
|
+
|
|
694
|
+
extra_headers: Send extra headers
|
|
695
|
+
|
|
696
|
+
extra_query: Add additional query parameters to the request
|
|
697
|
+
|
|
698
|
+
extra_body: Add additional JSON properties to the request
|
|
699
|
+
|
|
700
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
701
|
+
"""
|
|
702
|
+
if not request_id:
|
|
703
|
+
raise ValueError(f"Expected a non-empty value for `request_id` but received {request_id!r}")
|
|
704
|
+
return await self._get(
|
|
705
|
+
f"/waap/v1/domains/{domain_id}/requests/{request_id}/details",
|
|
706
|
+
options=make_request_options(
|
|
707
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
708
|
+
),
|
|
709
|
+
cast_to=WaapRequestDetails,
|
|
710
|
+
)
|
|
711
|
+
|
|
712
|
+
def get_requests_series(
|
|
713
|
+
self,
|
|
714
|
+
domain_id: int,
|
|
715
|
+
*,
|
|
716
|
+
start: str,
|
|
717
|
+
actions: List[Literal["allow", "block", "captcha", "handshake"]] | NotGiven = NOT_GIVEN,
|
|
718
|
+
countries: SequenceNotStr[str] | NotGiven = NOT_GIVEN,
|
|
719
|
+
end: Optional[str] | NotGiven = NOT_GIVEN,
|
|
720
|
+
ip: str | NotGiven = NOT_GIVEN,
|
|
721
|
+
limit: int | NotGiven = NOT_GIVEN,
|
|
722
|
+
offset: int | NotGiven = NOT_GIVEN,
|
|
723
|
+
ordering: str | NotGiven = NOT_GIVEN,
|
|
724
|
+
reference_id: str | NotGiven = NOT_GIVEN,
|
|
725
|
+
security_rule_name: str | NotGiven = NOT_GIVEN,
|
|
726
|
+
status_code: int | NotGiven = NOT_GIVEN,
|
|
727
|
+
traffic_types: List[
|
|
728
|
+
Literal[
|
|
729
|
+
"policy_allowed",
|
|
730
|
+
"policy_blocked",
|
|
731
|
+
"custom_rule_allowed",
|
|
732
|
+
"custom_blocked",
|
|
733
|
+
"legit_requests",
|
|
734
|
+
"sanctioned",
|
|
735
|
+
"dynamic",
|
|
736
|
+
"api",
|
|
737
|
+
"static",
|
|
738
|
+
"ajax",
|
|
739
|
+
"redirects",
|
|
740
|
+
"monitor",
|
|
741
|
+
"err_40x",
|
|
742
|
+
"err_50x",
|
|
743
|
+
"passed_to_origin",
|
|
744
|
+
"timeout",
|
|
745
|
+
"other",
|
|
746
|
+
"ddos",
|
|
747
|
+
"legit",
|
|
748
|
+
"monitored",
|
|
749
|
+
]
|
|
750
|
+
]
|
|
751
|
+
| NotGiven = NOT_GIVEN,
|
|
752
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
753
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
754
|
+
extra_headers: Headers | None = None,
|
|
755
|
+
extra_query: Query | None = None,
|
|
756
|
+
extra_body: Body | None = None,
|
|
757
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
758
|
+
) -> AsyncPaginator[WaapRequestSummary, AsyncOffsetPage[WaapRequestSummary]]:
|
|
759
|
+
"""
|
|
760
|
+
Retrieve a domain's requests data.
|
|
761
|
+
|
|
762
|
+
Args:
|
|
763
|
+
domain_id: The domain ID
|
|
764
|
+
|
|
765
|
+
start: Filter data items starting from a specified date in ISO 8601 format
|
|
766
|
+
|
|
767
|
+
actions: Filter the response by actions.
|
|
768
|
+
|
|
769
|
+
countries: Filter the response by country codes in ISO 3166-1 alpha-2 format.
|
|
770
|
+
|
|
771
|
+
end: Filter data items up to a specified end date in ISO 8601 format. If not
|
|
772
|
+
provided, defaults to the current date and time.
|
|
773
|
+
|
|
774
|
+
ip: Filter the response by IP.
|
|
775
|
+
|
|
776
|
+
limit: Number of items to return
|
|
777
|
+
|
|
778
|
+
offset: Number of items to skip
|
|
779
|
+
|
|
780
|
+
ordering: Sort the response by given field.
|
|
781
|
+
|
|
782
|
+
reference_id: Filter the response by reference ID.
|
|
783
|
+
|
|
784
|
+
security_rule_name: Filter the response by security rule name.
|
|
785
|
+
|
|
786
|
+
status_code: Filter the response by response code.
|
|
787
|
+
|
|
788
|
+
traffic_types: Filter the response by traffic types.
|
|
789
|
+
|
|
790
|
+
extra_headers: Send extra headers
|
|
791
|
+
|
|
792
|
+
extra_query: Add additional query parameters to the request
|
|
793
|
+
|
|
794
|
+
extra_body: Add additional JSON properties to the request
|
|
795
|
+
|
|
796
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
797
|
+
"""
|
|
798
|
+
return self._get_api_list(
|
|
799
|
+
f"/waap/v1/domains/{domain_id}/requests",
|
|
800
|
+
page=AsyncOffsetPage[WaapRequestSummary],
|
|
801
|
+
options=make_request_options(
|
|
802
|
+
extra_headers=extra_headers,
|
|
803
|
+
extra_query=extra_query,
|
|
804
|
+
extra_body=extra_body,
|
|
805
|
+
timeout=timeout,
|
|
806
|
+
query=maybe_transform(
|
|
807
|
+
{
|
|
808
|
+
"start": start,
|
|
809
|
+
"actions": actions,
|
|
810
|
+
"countries": countries,
|
|
811
|
+
"end": end,
|
|
812
|
+
"ip": ip,
|
|
813
|
+
"limit": limit,
|
|
814
|
+
"offset": offset,
|
|
815
|
+
"ordering": ordering,
|
|
816
|
+
"reference_id": reference_id,
|
|
817
|
+
"security_rule_name": security_rule_name,
|
|
818
|
+
"status_code": status_code,
|
|
819
|
+
"traffic_types": traffic_types,
|
|
820
|
+
},
|
|
821
|
+
statistic_get_requests_series_params.StatisticGetRequestsSeriesParams,
|
|
822
|
+
),
|
|
823
|
+
),
|
|
824
|
+
model=WaapRequestSummary,
|
|
825
|
+
)
|
|
826
|
+
|
|
827
|
+
async def get_traffic_series(
|
|
828
|
+
self,
|
|
829
|
+
domain_id: int,
|
|
830
|
+
*,
|
|
831
|
+
resolution: Literal["daily", "hourly", "minutely"],
|
|
832
|
+
start: str,
|
|
833
|
+
end: Optional[str] | NotGiven = NOT_GIVEN,
|
|
834
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
835
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
836
|
+
extra_headers: Headers | None = None,
|
|
837
|
+
extra_query: Query | None = None,
|
|
838
|
+
extra_body: Body | None = None,
|
|
839
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
840
|
+
) -> StatisticGetTrafficSeriesResponse:
|
|
841
|
+
"""
|
|
842
|
+
Retrieves a comprehensive report on a domain's traffic statistics based on
|
|
843
|
+
Clickhouse. The report includes details such as API requests, blocked events,
|
|
844
|
+
error counts, and many more traffic-related metrics.
|
|
845
|
+
|
|
846
|
+
Args:
|
|
847
|
+
domain_id: The domain ID
|
|
848
|
+
|
|
849
|
+
resolution: Specifies the granularity of the result data.
|
|
850
|
+
|
|
851
|
+
start: Filter data items starting from a specified date in ISO 8601 format
|
|
852
|
+
|
|
853
|
+
end: Filter data items up to a specified end date in ISO 8601 format. If not
|
|
854
|
+
provided, defaults to the current date and time.
|
|
855
|
+
|
|
856
|
+
extra_headers: Send extra headers
|
|
857
|
+
|
|
858
|
+
extra_query: Add additional query parameters to the request
|
|
859
|
+
|
|
860
|
+
extra_body: Add additional JSON properties to the request
|
|
861
|
+
|
|
862
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
863
|
+
"""
|
|
864
|
+
return await self._get(
|
|
865
|
+
f"/waap/v1/domains/{domain_id}/traffic",
|
|
866
|
+
options=make_request_options(
|
|
867
|
+
extra_headers=extra_headers,
|
|
868
|
+
extra_query=extra_query,
|
|
869
|
+
extra_body=extra_body,
|
|
870
|
+
timeout=timeout,
|
|
871
|
+
query=await async_maybe_transform(
|
|
872
|
+
{
|
|
873
|
+
"resolution": resolution,
|
|
874
|
+
"start": start,
|
|
875
|
+
"end": end,
|
|
876
|
+
},
|
|
877
|
+
statistic_get_traffic_series_params.StatisticGetTrafficSeriesParams,
|
|
878
|
+
),
|
|
879
|
+
),
|
|
880
|
+
cast_to=StatisticGetTrafficSeriesResponse,
|
|
881
|
+
)
|
|
882
|
+
|
|
883
|
+
|
|
884
|
+
class StatisticsResourceWithRawResponse:
|
|
885
|
+
def __init__(self, statistics: StatisticsResource) -> None:
|
|
886
|
+
self._statistics = statistics
|
|
887
|
+
|
|
888
|
+
self.get_ddos_attacks = to_raw_response_wrapper(
|
|
889
|
+
statistics.get_ddos_attacks,
|
|
890
|
+
)
|
|
891
|
+
self.get_ddos_info = to_raw_response_wrapper(
|
|
892
|
+
statistics.get_ddos_info,
|
|
893
|
+
)
|
|
894
|
+
self.get_events_aggregated = to_raw_response_wrapper(
|
|
895
|
+
statistics.get_events_aggregated,
|
|
896
|
+
)
|
|
897
|
+
self.get_request_details = to_raw_response_wrapper(
|
|
898
|
+
statistics.get_request_details,
|
|
899
|
+
)
|
|
900
|
+
self.get_requests_series = to_raw_response_wrapper(
|
|
901
|
+
statistics.get_requests_series,
|
|
902
|
+
)
|
|
903
|
+
self.get_traffic_series = to_raw_response_wrapper(
|
|
904
|
+
statistics.get_traffic_series,
|
|
905
|
+
)
|
|
906
|
+
|
|
907
|
+
|
|
908
|
+
class AsyncStatisticsResourceWithRawResponse:
|
|
909
|
+
def __init__(self, statistics: AsyncStatisticsResource) -> None:
|
|
910
|
+
self._statistics = statistics
|
|
911
|
+
|
|
912
|
+
self.get_ddos_attacks = async_to_raw_response_wrapper(
|
|
913
|
+
statistics.get_ddos_attacks,
|
|
914
|
+
)
|
|
915
|
+
self.get_ddos_info = async_to_raw_response_wrapper(
|
|
916
|
+
statistics.get_ddos_info,
|
|
917
|
+
)
|
|
918
|
+
self.get_events_aggregated = async_to_raw_response_wrapper(
|
|
919
|
+
statistics.get_events_aggregated,
|
|
920
|
+
)
|
|
921
|
+
self.get_request_details = async_to_raw_response_wrapper(
|
|
922
|
+
statistics.get_request_details,
|
|
923
|
+
)
|
|
924
|
+
self.get_requests_series = async_to_raw_response_wrapper(
|
|
925
|
+
statistics.get_requests_series,
|
|
926
|
+
)
|
|
927
|
+
self.get_traffic_series = async_to_raw_response_wrapper(
|
|
928
|
+
statistics.get_traffic_series,
|
|
929
|
+
)
|
|
930
|
+
|
|
931
|
+
|
|
932
|
+
class StatisticsResourceWithStreamingResponse:
|
|
933
|
+
def __init__(self, statistics: StatisticsResource) -> None:
|
|
934
|
+
self._statistics = statistics
|
|
935
|
+
|
|
936
|
+
self.get_ddos_attacks = to_streamed_response_wrapper(
|
|
937
|
+
statistics.get_ddos_attacks,
|
|
938
|
+
)
|
|
939
|
+
self.get_ddos_info = to_streamed_response_wrapper(
|
|
940
|
+
statistics.get_ddos_info,
|
|
941
|
+
)
|
|
942
|
+
self.get_events_aggregated = to_streamed_response_wrapper(
|
|
943
|
+
statistics.get_events_aggregated,
|
|
944
|
+
)
|
|
945
|
+
self.get_request_details = to_streamed_response_wrapper(
|
|
946
|
+
statistics.get_request_details,
|
|
947
|
+
)
|
|
948
|
+
self.get_requests_series = to_streamed_response_wrapper(
|
|
949
|
+
statistics.get_requests_series,
|
|
950
|
+
)
|
|
951
|
+
self.get_traffic_series = to_streamed_response_wrapper(
|
|
952
|
+
statistics.get_traffic_series,
|
|
953
|
+
)
|
|
954
|
+
|
|
955
|
+
|
|
956
|
+
class AsyncStatisticsResourceWithStreamingResponse:
|
|
957
|
+
def __init__(self, statistics: AsyncStatisticsResource) -> None:
|
|
958
|
+
self._statistics = statistics
|
|
959
|
+
|
|
960
|
+
self.get_ddos_attacks = async_to_streamed_response_wrapper(
|
|
961
|
+
statistics.get_ddos_attacks,
|
|
962
|
+
)
|
|
963
|
+
self.get_ddos_info = async_to_streamed_response_wrapper(
|
|
964
|
+
statistics.get_ddos_info,
|
|
965
|
+
)
|
|
966
|
+
self.get_events_aggregated = async_to_streamed_response_wrapper(
|
|
967
|
+
statistics.get_events_aggregated,
|
|
968
|
+
)
|
|
969
|
+
self.get_request_details = async_to_streamed_response_wrapper(
|
|
970
|
+
statistics.get_request_details,
|
|
971
|
+
)
|
|
972
|
+
self.get_requests_series = async_to_streamed_response_wrapper(
|
|
973
|
+
statistics.get_requests_series,
|
|
974
|
+
)
|
|
975
|
+
self.get_traffic_series = async_to_streamed_response_wrapper(
|
|
976
|
+
statistics.get_traffic_series,
|
|
977
|
+
)
|