gcore 0.8.0__py3-none-any.whl → 0.10.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 +4 -1
- gcore/_client.py +9 -0
- gcore/_files.py +4 -4
- gcore/_version.py +1 -1
- gcore/resources/__init__.py +14 -0
- gcore/resources/cloud/cost_reports.py +24 -0
- gcore/resources/cloud/load_balancers/pools/health_monitors.py +8 -4
- gcore/resources/cloud/load_balancers/pools/members.py +2 -2
- gcore/resources/cloud/quotas/requests.py +7 -15
- gcore/resources/fastedge/binaries.py +81 -1
- gcore/resources/security/__init__.py +75 -0
- gcore/resources/security/bgp_announces.py +308 -0
- gcore/resources/security/events.py +234 -0
- gcore/resources/security/profile_templates.py +143 -0
- gcore/resources/security/profiles.py +661 -0
- gcore/resources/security/security.py +198 -0
- 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 +5 -8
- 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 +15 -17
- gcore/resources/waap/domains/custom_rules.py +5 -8
- gcore/resources/waap/domains/domains.py +120 -64
- gcore/resources/waap/domains/firewall_rules.py +3 -5
- gcore/resources/waap/domains/insight_silences.py +28 -5
- gcore/resources/waap/domains/insights.py +36 -10
- gcore/resources/waap/domains/{analytics/analytics.py → statistics.py} +514 -213
- 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/cost_report_get_aggregated_monthly_params.py +3 -0
- gcore/types/cloud/cost_report_get_aggregated_params.py +3 -0
- gcore/types/cloud/cost_report_get_detailed_params.py +3 -0
- gcore/types/cloud/gpu_baremetal_flavor.py +16 -0
- gcore/types/cloud/health_monitor.py +6 -0
- gcore/types/cloud/load_balancer_create_params.py +8 -3
- gcore/types/cloud/load_balancers/pool_create_params.py +8 -3
- gcore/types/cloud/load_balancers/pool_update_params.py +8 -3
- gcore/types/cloud/load_balancers/pools/health_monitor_create_params.py +7 -2
- gcore/types/cloud/load_balancers/pools/member_add_params.py +1 -1
- gcore/types/cloud/quotas/request_list_params.py +2 -2
- gcore/types/cloud/region.py +6 -6
- gcore/types/fastedge/__init__.py +1 -0
- gcore/types/fastedge/binary_create_params.py +11 -0
- gcore/types/security/__init__.py +18 -0
- gcore/types/security/bgp_announce_list_params.py +18 -0
- gcore/types/security/bgp_announce_list_response.py +10 -0
- gcore/types/security/bgp_announce_toggle_params.py +16 -0
- gcore/types/security/client_announce.py +15 -0
- gcore/types/security/client_profile.py +56 -0
- gcore/types/security/client_profile_template.py +43 -0
- gcore/types/security/client_view.py +29 -0
- gcore/types/security/event_list_params.py +38 -0
- gcore/types/security/profile_create_params.py +24 -0
- gcore/types/security/profile_list_params.py +17 -0
- gcore/types/security/profile_list_response.py +10 -0
- gcore/types/security/profile_recreate_params.py +24 -0
- gcore/types/security/profile_replace_params.py +24 -0
- gcore/types/security/profile_template_list_response.py +10 -0
- 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 +1 -3
- gcore/types/waap/domains/__init__.py +28 -18
- gcore/types/waap/domains/advanced_rule_list_params.py +1 -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_group_list_response.py → api_path_group_list.py} +2 -2
- gcore/types/waap/domains/custom_rule_list_params.py +1 -3
- gcore/types/waap/domains/insight_list_params.py +16 -6
- gcore/types/waap/domains/insight_replace_params.py +2 -4
- gcore/types/waap/domains/insight_silence_list_params.py +13 -4
- gcore/types/waap/domains/{analytics_list_ddos_attacks_params.py → statistic_get_ddos_attacks_params.py} +2 -2
- gcore/types/waap/domains/{analytics_list_ddos_info_params.py → statistic_get_ddos_info_params.py} +2 -2
- gcore/types/waap/domains/{analytics_get_event_statistics_params.py → statistic_get_events_aggregated_params.py} +2 -2
- gcore/types/waap/domains/{analytics/request_list_params.py → statistic_get_requests_series_params.py} +27 -5
- gcore/types/waap/domains/{analytics_list_event_traffic_params.py → statistic_get_traffic_series_params.py} +4 -5
- gcore/types/waap/domains/statistic_get_traffic_series_response.py +10 -0
- gcore/types/waap/{waap_advanced_rule.py → domains/waap_advanced_rule.py} +1 -1
- 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} +2 -2
- gcore/types/waap/domains/{api_discovery/scan_result_get_response.py → waap_api_scan_result.py} +3 -3
- 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} +1 -1
- 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} +1 -1
- gcore/types/waap/{waap_insight.py → domains/waap_insight.py} +3 -3
- gcore/types/waap/{waap_insight_silence.py → domains/waap_insight_silence.py} +1 -1
- gcore/types/waap/domains/waap_request_details.py +185 -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_rule_set.py +26 -3
- gcore/types/waap/waap_summary_domain.py +2 -2
- {gcore-0.8.0.dist-info → gcore-0.10.0.dist-info}/METADATA +1 -1
- {gcore-0.8.0.dist-info → gcore-0.10.0.dist-info}/RECORD +117 -134
- gcore/resources/waap/domains/analytics/__init__.py +0 -33
- 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/waap/domains/analytics/__init__.py +0 -5
- 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.8.0.dist-info → gcore-0.10.0.dist-info}/WHEEL +0 -0
- {gcore-0.8.0.dist-info → gcore-0.10.0.dist-info}/licenses/LICENSE +0 -0
|
@@ -8,67 +8,181 @@ from typing_extensions import Literal
|
|
|
8
8
|
|
|
9
9
|
import httpx
|
|
10
10
|
|
|
11
|
-
from
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
RequestsResourceWithStreamingResponse,
|
|
17
|
-
AsyncRequestsResourceWithStreamingResponse,
|
|
18
|
-
)
|
|
19
|
-
from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven
|
|
20
|
-
from ....._utils import maybe_transform, async_maybe_transform
|
|
21
|
-
from ....._compat import cached_property
|
|
22
|
-
from ....._resource import SyncAPIResource, AsyncAPIResource
|
|
23
|
-
from ....._response import (
|
|
11
|
+
from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven
|
|
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 (
|
|
24
16
|
to_raw_response_wrapper,
|
|
25
17
|
to_streamed_response_wrapper,
|
|
26
18
|
async_to_raw_response_wrapper,
|
|
27
19
|
async_to_streamed_response_wrapper,
|
|
28
20
|
)
|
|
29
|
-
from
|
|
30
|
-
from
|
|
31
|
-
from
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
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,
|
|
37
29
|
)
|
|
38
|
-
from
|
|
39
|
-
from
|
|
40
|
-
from
|
|
41
|
-
from
|
|
42
|
-
from
|
|
43
|
-
|
|
44
|
-
__all__ = ["AnalyticsResource", "AsyncAnalyticsResource"]
|
|
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
|
|
45
36
|
|
|
37
|
+
__all__ = ["StatisticsResource", "AsyncStatisticsResource"]
|
|
46
38
|
|
|
47
|
-
class AnalyticsResource(SyncAPIResource):
|
|
48
|
-
@cached_property
|
|
49
|
-
def requests(self) -> RequestsResource:
|
|
50
|
-
return RequestsResource(self._client)
|
|
51
39
|
|
|
40
|
+
class StatisticsResource(SyncAPIResource):
|
|
52
41
|
@cached_property
|
|
53
|
-
def with_raw_response(self) ->
|
|
42
|
+
def with_raw_response(self) -> StatisticsResourceWithRawResponse:
|
|
54
43
|
"""
|
|
55
44
|
This property can be used as a prefix for any HTTP method call to return
|
|
56
45
|
the raw response object instead of the parsed content.
|
|
57
46
|
|
|
58
47
|
For more information, see https://www.github.com/G-Core/gcore-python#accessing-raw-response-data-eg-headers
|
|
59
48
|
"""
|
|
60
|
-
return
|
|
49
|
+
return StatisticsResourceWithRawResponse(self)
|
|
61
50
|
|
|
62
51
|
@cached_property
|
|
63
|
-
def with_streaming_response(self) ->
|
|
52
|
+
def with_streaming_response(self) -> StatisticsResourceWithStreamingResponse:
|
|
64
53
|
"""
|
|
65
54
|
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
66
55
|
|
|
67
56
|
For more information, see https://www.github.com/G-Core/gcore-python#with_streaming_response
|
|
68
57
|
"""
|
|
69
|
-
return
|
|
58
|
+
return StatisticsResourceWithStreamingResponse(self)
|
|
70
59
|
|
|
71
|
-
def
|
|
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: Union[str, datetime],
|
|
128
|
+
end: Union[str, datetime] | 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 traffic starting from a specified date in ISO 8601 format
|
|
147
|
+
|
|
148
|
+
end: Filter traffic up to a specified end date in ISO 8601 format. If not provided,
|
|
149
|
+
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(
|
|
72
186
|
self,
|
|
73
187
|
domain_id: int,
|
|
74
188
|
*,
|
|
@@ -128,43 +242,32 @@ class AnalyticsResource(SyncAPIResource):
|
|
|
128
242
|
"reference_id": reference_id,
|
|
129
243
|
"result": result,
|
|
130
244
|
},
|
|
131
|
-
|
|
245
|
+
statistic_get_events_aggregated_params.StatisticGetEventsAggregatedParams,
|
|
132
246
|
),
|
|
133
247
|
),
|
|
134
248
|
cast_to=WaapEventStatistics,
|
|
135
249
|
)
|
|
136
250
|
|
|
137
|
-
def
|
|
251
|
+
def get_request_details(
|
|
138
252
|
self,
|
|
139
|
-
|
|
253
|
+
request_id: str,
|
|
140
254
|
*,
|
|
141
|
-
|
|
142
|
-
limit: int | NotGiven = NOT_GIVEN,
|
|
143
|
-
offset: int | NotGiven = NOT_GIVEN,
|
|
144
|
-
ordering: Literal["start_time", "-start_time", "end_time", "-end_time"] | NotGiven = NOT_GIVEN,
|
|
145
|
-
start_time: Union[str, datetime, None] | NotGiven = NOT_GIVEN,
|
|
255
|
+
domain_id: int,
|
|
146
256
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
147
257
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
148
258
|
extra_headers: Headers | None = None,
|
|
149
259
|
extra_query: Query | None = None,
|
|
150
260
|
extra_body: Body | None = None,
|
|
151
261
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
152
|
-
) ->
|
|
262
|
+
) -> WaapRequestDetails:
|
|
153
263
|
"""
|
|
154
|
-
|
|
264
|
+
Retrieves all the available information for a request that matches a given
|
|
265
|
+
request id
|
|
155
266
|
|
|
156
267
|
Args:
|
|
157
268
|
domain_id: The domain ID
|
|
158
269
|
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
limit: Number of items to return
|
|
162
|
-
|
|
163
|
-
offset: Number of items to skip
|
|
164
|
-
|
|
165
|
-
ordering: Sort the response by given field.
|
|
166
|
-
|
|
167
|
-
start_time: Filter attacks starting from a specified date in ISO 8601 format
|
|
270
|
+
request_id: The request ID
|
|
168
271
|
|
|
169
272
|
extra_headers: Send extra headers
|
|
170
273
|
|
|
@@ -174,61 +277,94 @@ class AnalyticsResource(SyncAPIResource):
|
|
|
174
277
|
|
|
175
278
|
timeout: Override the client-level default timeout for this request, in seconds
|
|
176
279
|
"""
|
|
177
|
-
|
|
178
|
-
f"
|
|
179
|
-
|
|
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",
|
|
180
284
|
options=make_request_options(
|
|
181
|
-
extra_headers=extra_headers,
|
|
182
|
-
extra_query=extra_query,
|
|
183
|
-
extra_body=extra_body,
|
|
184
|
-
timeout=timeout,
|
|
185
|
-
query=maybe_transform(
|
|
186
|
-
{
|
|
187
|
-
"end_time": end_time,
|
|
188
|
-
"limit": limit,
|
|
189
|
-
"offset": offset,
|
|
190
|
-
"ordering": ordering,
|
|
191
|
-
"start_time": start_time,
|
|
192
|
-
},
|
|
193
|
-
analytics_list_ddos_attacks_params.AnalyticsListDDOSAttacksParams,
|
|
194
|
-
),
|
|
285
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
195
286
|
),
|
|
196
|
-
|
|
287
|
+
cast_to=WaapRequestDetails,
|
|
197
288
|
)
|
|
198
289
|
|
|
199
|
-
def
|
|
290
|
+
def get_requests_series(
|
|
200
291
|
self,
|
|
201
292
|
domain_id: int,
|
|
202
293
|
*,
|
|
203
|
-
group_by: Literal["URL", "User-Agent", "IP"],
|
|
204
294
|
start: Union[str, datetime],
|
|
295
|
+
actions: List[Literal["allow", "block", "captcha", "handshake"]] | NotGiven = NOT_GIVEN,
|
|
296
|
+
countries: List[str] | NotGiven = NOT_GIVEN,
|
|
205
297
|
end: Union[str, datetime] | NotGiven = NOT_GIVEN,
|
|
298
|
+
ip: str | NotGiven = NOT_GIVEN,
|
|
206
299
|
limit: int | NotGiven = NOT_GIVEN,
|
|
207
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,
|
|
208
330
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
209
331
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
210
332
|
extra_headers: Headers | None = None,
|
|
211
333
|
extra_query: Query | None = None,
|
|
212
334
|
extra_body: Body | None = None,
|
|
213
335
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
214
|
-
) -> SyncOffsetPage[
|
|
336
|
+
) -> SyncOffsetPage[WaapRequestSummary]:
|
|
215
337
|
"""
|
|
216
|
-
|
|
338
|
+
Retrieve a domain's requests data.
|
|
217
339
|
|
|
218
340
|
Args:
|
|
219
341
|
domain_id: The domain ID
|
|
220
342
|
|
|
221
|
-
group_by: The identity of the requests to group by
|
|
222
|
-
|
|
223
343
|
start: Filter traffic starting from a specified date in ISO 8601 format
|
|
224
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
|
+
|
|
225
349
|
end: Filter traffic up to a specified end date in ISO 8601 format. If not provided,
|
|
226
350
|
defaults to the current date and time.
|
|
227
351
|
|
|
352
|
+
ip: Filter the response by IP.
|
|
353
|
+
|
|
228
354
|
limit: Number of items to return
|
|
229
355
|
|
|
230
356
|
offset: Number of items to skip
|
|
231
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
|
+
|
|
232
368
|
extra_headers: Send extra headers
|
|
233
369
|
|
|
234
370
|
extra_query: Add additional query parameters to the request
|
|
@@ -238,8 +374,8 @@ class AnalyticsResource(SyncAPIResource):
|
|
|
238
374
|
timeout: Override the client-level default timeout for this request, in seconds
|
|
239
375
|
"""
|
|
240
376
|
return self._get_api_list(
|
|
241
|
-
f"/waap/v1/domains/{domain_id}/
|
|
242
|
-
page=SyncOffsetPage[
|
|
377
|
+
f"/waap/v1/domains/{domain_id}/requests",
|
|
378
|
+
page=SyncOffsetPage[WaapRequestSummary],
|
|
243
379
|
options=make_request_options(
|
|
244
380
|
extra_headers=extra_headers,
|
|
245
381
|
extra_query=extra_query,
|
|
@@ -247,23 +383,30 @@ class AnalyticsResource(SyncAPIResource):
|
|
|
247
383
|
timeout=timeout,
|
|
248
384
|
query=maybe_transform(
|
|
249
385
|
{
|
|
250
|
-
"group_by": group_by,
|
|
251
386
|
"start": start,
|
|
387
|
+
"actions": actions,
|
|
388
|
+
"countries": countries,
|
|
252
389
|
"end": end,
|
|
390
|
+
"ip": ip,
|
|
253
391
|
"limit": limit,
|
|
254
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,
|
|
255
398
|
},
|
|
256
|
-
|
|
399
|
+
statistic_get_requests_series_params.StatisticGetRequestsSeriesParams,
|
|
257
400
|
),
|
|
258
401
|
),
|
|
259
|
-
model=
|
|
402
|
+
model=WaapRequestSummary,
|
|
260
403
|
)
|
|
261
404
|
|
|
262
|
-
def
|
|
405
|
+
def get_traffic_series(
|
|
263
406
|
self,
|
|
264
407
|
domain_id: int,
|
|
265
408
|
*,
|
|
266
|
-
resolution:
|
|
409
|
+
resolution: Literal["daily", "hourly", "minutely"],
|
|
267
410
|
start: Union[str, datetime],
|
|
268
411
|
end: Union[str, datetime] | NotGiven = NOT_GIVEN,
|
|
269
412
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
@@ -272,7 +415,7 @@ class AnalyticsResource(SyncAPIResource):
|
|
|
272
415
|
extra_query: Query | None = None,
|
|
273
416
|
extra_body: Body | None = None,
|
|
274
417
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
275
|
-
) ->
|
|
418
|
+
) -> StatisticGetTrafficSeriesResponse:
|
|
276
419
|
"""
|
|
277
420
|
Retrieves a comprehensive report on a domain's traffic statistics based on
|
|
278
421
|
Clickhouse. The report includes details such as API requests, blocked events,
|
|
@@ -309,38 +452,159 @@ class AnalyticsResource(SyncAPIResource):
|
|
|
309
452
|
"start": start,
|
|
310
453
|
"end": end,
|
|
311
454
|
},
|
|
312
|
-
|
|
455
|
+
statistic_get_traffic_series_params.StatisticGetTrafficSeriesParams,
|
|
313
456
|
),
|
|
314
457
|
),
|
|
315
|
-
cast_to=
|
|
458
|
+
cast_to=StatisticGetTrafficSeriesResponse,
|
|
316
459
|
)
|
|
317
460
|
|
|
318
461
|
|
|
319
|
-
class
|
|
462
|
+
class AsyncStatisticsResource(AsyncAPIResource):
|
|
320
463
|
@cached_property
|
|
321
|
-
def
|
|
322
|
-
return AsyncRequestsResource(self._client)
|
|
323
|
-
|
|
324
|
-
@cached_property
|
|
325
|
-
def with_raw_response(self) -> AsyncAnalyticsResourceWithRawResponse:
|
|
464
|
+
def with_raw_response(self) -> AsyncStatisticsResourceWithRawResponse:
|
|
326
465
|
"""
|
|
327
466
|
This property can be used as a prefix for any HTTP method call to return
|
|
328
467
|
the raw response object instead of the parsed content.
|
|
329
468
|
|
|
330
469
|
For more information, see https://www.github.com/G-Core/gcore-python#accessing-raw-response-data-eg-headers
|
|
331
470
|
"""
|
|
332
|
-
return
|
|
471
|
+
return AsyncStatisticsResourceWithRawResponse(self)
|
|
333
472
|
|
|
334
473
|
@cached_property
|
|
335
|
-
def with_streaming_response(self) ->
|
|
474
|
+
def with_streaming_response(self) -> AsyncStatisticsResourceWithStreamingResponse:
|
|
336
475
|
"""
|
|
337
476
|
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
338
477
|
|
|
339
478
|
For more information, see https://www.github.com/G-Core/gcore-python#with_streaming_response
|
|
340
479
|
"""
|
|
341
|
-
return
|
|
480
|
+
return AsyncStatisticsResourceWithStreamingResponse(self)
|
|
342
481
|
|
|
343
|
-
|
|
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: Union[str, datetime],
|
|
550
|
+
end: Union[str, datetime] | 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 traffic starting from a specified date in ISO 8601 format
|
|
569
|
+
|
|
570
|
+
end: Filter traffic up to a specified end date in ISO 8601 format. If not provided,
|
|
571
|
+
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(
|
|
344
608
|
self,
|
|
345
609
|
domain_id: int,
|
|
346
610
|
*,
|
|
@@ -400,43 +664,32 @@ class AsyncAnalyticsResource(AsyncAPIResource):
|
|
|
400
664
|
"reference_id": reference_id,
|
|
401
665
|
"result": result,
|
|
402
666
|
},
|
|
403
|
-
|
|
667
|
+
statistic_get_events_aggregated_params.StatisticGetEventsAggregatedParams,
|
|
404
668
|
),
|
|
405
669
|
),
|
|
406
670
|
cast_to=WaapEventStatistics,
|
|
407
671
|
)
|
|
408
672
|
|
|
409
|
-
def
|
|
673
|
+
async def get_request_details(
|
|
410
674
|
self,
|
|
411
|
-
|
|
675
|
+
request_id: str,
|
|
412
676
|
*,
|
|
413
|
-
|
|
414
|
-
limit: int | NotGiven = NOT_GIVEN,
|
|
415
|
-
offset: int | NotGiven = NOT_GIVEN,
|
|
416
|
-
ordering: Literal["start_time", "-start_time", "end_time", "-end_time"] | NotGiven = NOT_GIVEN,
|
|
417
|
-
start_time: Union[str, datetime, None] | NotGiven = NOT_GIVEN,
|
|
677
|
+
domain_id: int,
|
|
418
678
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
419
679
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
420
680
|
extra_headers: Headers | None = None,
|
|
421
681
|
extra_query: Query | None = None,
|
|
422
682
|
extra_body: Body | None = None,
|
|
423
683
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
424
|
-
) ->
|
|
684
|
+
) -> WaapRequestDetails:
|
|
425
685
|
"""
|
|
426
|
-
|
|
686
|
+
Retrieves all the available information for a request that matches a given
|
|
687
|
+
request id
|
|
427
688
|
|
|
428
689
|
Args:
|
|
429
690
|
domain_id: The domain ID
|
|
430
691
|
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
limit: Number of items to return
|
|
434
|
-
|
|
435
|
-
offset: Number of items to skip
|
|
436
|
-
|
|
437
|
-
ordering: Sort the response by given field.
|
|
438
|
-
|
|
439
|
-
start_time: Filter attacks starting from a specified date in ISO 8601 format
|
|
692
|
+
request_id: The request ID
|
|
440
693
|
|
|
441
694
|
extra_headers: Send extra headers
|
|
442
695
|
|
|
@@ -446,61 +699,94 @@ class AsyncAnalyticsResource(AsyncAPIResource):
|
|
|
446
699
|
|
|
447
700
|
timeout: Override the client-level default timeout for this request, in seconds
|
|
448
701
|
"""
|
|
449
|
-
|
|
450
|
-
f"
|
|
451
|
-
|
|
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",
|
|
452
706
|
options=make_request_options(
|
|
453
|
-
extra_headers=extra_headers,
|
|
454
|
-
extra_query=extra_query,
|
|
455
|
-
extra_body=extra_body,
|
|
456
|
-
timeout=timeout,
|
|
457
|
-
query=maybe_transform(
|
|
458
|
-
{
|
|
459
|
-
"end_time": end_time,
|
|
460
|
-
"limit": limit,
|
|
461
|
-
"offset": offset,
|
|
462
|
-
"ordering": ordering,
|
|
463
|
-
"start_time": start_time,
|
|
464
|
-
},
|
|
465
|
-
analytics_list_ddos_attacks_params.AnalyticsListDDOSAttacksParams,
|
|
466
|
-
),
|
|
707
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
467
708
|
),
|
|
468
|
-
|
|
709
|
+
cast_to=WaapRequestDetails,
|
|
469
710
|
)
|
|
470
711
|
|
|
471
|
-
def
|
|
712
|
+
def get_requests_series(
|
|
472
713
|
self,
|
|
473
714
|
domain_id: int,
|
|
474
715
|
*,
|
|
475
|
-
group_by: Literal["URL", "User-Agent", "IP"],
|
|
476
716
|
start: Union[str, datetime],
|
|
717
|
+
actions: List[Literal["allow", "block", "captcha", "handshake"]] | NotGiven = NOT_GIVEN,
|
|
718
|
+
countries: List[str] | NotGiven = NOT_GIVEN,
|
|
477
719
|
end: Union[str, datetime] | NotGiven = NOT_GIVEN,
|
|
720
|
+
ip: str | NotGiven = NOT_GIVEN,
|
|
478
721
|
limit: int | NotGiven = NOT_GIVEN,
|
|
479
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,
|
|
480
752
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
481
753
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
482
754
|
extra_headers: Headers | None = None,
|
|
483
755
|
extra_query: Query | None = None,
|
|
484
756
|
extra_body: Body | None = None,
|
|
485
757
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
486
|
-
) -> AsyncPaginator[
|
|
758
|
+
) -> AsyncPaginator[WaapRequestSummary, AsyncOffsetPage[WaapRequestSummary]]:
|
|
487
759
|
"""
|
|
488
|
-
|
|
760
|
+
Retrieve a domain's requests data.
|
|
489
761
|
|
|
490
762
|
Args:
|
|
491
763
|
domain_id: The domain ID
|
|
492
764
|
|
|
493
|
-
group_by: The identity of the requests to group by
|
|
494
|
-
|
|
495
765
|
start: Filter traffic starting from a specified date in ISO 8601 format
|
|
496
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
|
+
|
|
497
771
|
end: Filter traffic up to a specified end date in ISO 8601 format. If not provided,
|
|
498
772
|
defaults to the current date and time.
|
|
499
773
|
|
|
774
|
+
ip: Filter the response by IP.
|
|
775
|
+
|
|
500
776
|
limit: Number of items to return
|
|
501
777
|
|
|
502
778
|
offset: Number of items to skip
|
|
503
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
|
+
|
|
504
790
|
extra_headers: Send extra headers
|
|
505
791
|
|
|
506
792
|
extra_query: Add additional query parameters to the request
|
|
@@ -510,8 +796,8 @@ class AsyncAnalyticsResource(AsyncAPIResource):
|
|
|
510
796
|
timeout: Override the client-level default timeout for this request, in seconds
|
|
511
797
|
"""
|
|
512
798
|
return self._get_api_list(
|
|
513
|
-
f"/waap/v1/domains/{domain_id}/
|
|
514
|
-
page=AsyncOffsetPage[
|
|
799
|
+
f"/waap/v1/domains/{domain_id}/requests",
|
|
800
|
+
page=AsyncOffsetPage[WaapRequestSummary],
|
|
515
801
|
options=make_request_options(
|
|
516
802
|
extra_headers=extra_headers,
|
|
517
803
|
extra_query=extra_query,
|
|
@@ -519,23 +805,30 @@ class AsyncAnalyticsResource(AsyncAPIResource):
|
|
|
519
805
|
timeout=timeout,
|
|
520
806
|
query=maybe_transform(
|
|
521
807
|
{
|
|
522
|
-
"group_by": group_by,
|
|
523
808
|
"start": start,
|
|
809
|
+
"actions": actions,
|
|
810
|
+
"countries": countries,
|
|
524
811
|
"end": end,
|
|
812
|
+
"ip": ip,
|
|
525
813
|
"limit": limit,
|
|
526
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,
|
|
527
820
|
},
|
|
528
|
-
|
|
821
|
+
statistic_get_requests_series_params.StatisticGetRequestsSeriesParams,
|
|
529
822
|
),
|
|
530
823
|
),
|
|
531
|
-
model=
|
|
824
|
+
model=WaapRequestSummary,
|
|
532
825
|
)
|
|
533
826
|
|
|
534
|
-
async def
|
|
827
|
+
async def get_traffic_series(
|
|
535
828
|
self,
|
|
536
829
|
domain_id: int,
|
|
537
830
|
*,
|
|
538
|
-
resolution:
|
|
831
|
+
resolution: Literal["daily", "hourly", "minutely"],
|
|
539
832
|
start: Union[str, datetime],
|
|
540
833
|
end: Union[str, datetime] | NotGiven = NOT_GIVEN,
|
|
541
834
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
@@ -544,7 +837,7 @@ class AsyncAnalyticsResource(AsyncAPIResource):
|
|
|
544
837
|
extra_query: Query | None = None,
|
|
545
838
|
extra_body: Body | None = None,
|
|
546
839
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
547
|
-
) ->
|
|
840
|
+
) -> StatisticGetTrafficSeriesResponse:
|
|
548
841
|
"""
|
|
549
842
|
Retrieves a comprehensive report on a domain's traffic statistics based on
|
|
550
843
|
Clickhouse. The report includes details such as API requests, blocked events,
|
|
@@ -581,96 +874,104 @@ class AsyncAnalyticsResource(AsyncAPIResource):
|
|
|
581
874
|
"start": start,
|
|
582
875
|
"end": end,
|
|
583
876
|
},
|
|
584
|
-
|
|
877
|
+
statistic_get_traffic_series_params.StatisticGetTrafficSeriesParams,
|
|
585
878
|
),
|
|
586
879
|
),
|
|
587
|
-
cast_to=
|
|
880
|
+
cast_to=StatisticGetTrafficSeriesResponse,
|
|
588
881
|
)
|
|
589
882
|
|
|
590
883
|
|
|
591
|
-
class
|
|
592
|
-
def __init__(self,
|
|
593
|
-
self.
|
|
884
|
+
class StatisticsResourceWithRawResponse:
|
|
885
|
+
def __init__(self, statistics: StatisticsResource) -> None:
|
|
886
|
+
self._statistics = statistics
|
|
594
887
|
|
|
595
|
-
self.
|
|
596
|
-
|
|
888
|
+
self.get_ddos_attacks = to_raw_response_wrapper(
|
|
889
|
+
statistics.get_ddos_attacks,
|
|
597
890
|
)
|
|
598
|
-
self.
|
|
599
|
-
|
|
891
|
+
self.get_ddos_info = to_raw_response_wrapper(
|
|
892
|
+
statistics.get_ddos_info,
|
|
600
893
|
)
|
|
601
|
-
self.
|
|
602
|
-
|
|
894
|
+
self.get_events_aggregated = to_raw_response_wrapper(
|
|
895
|
+
statistics.get_events_aggregated,
|
|
603
896
|
)
|
|
604
|
-
self.
|
|
605
|
-
|
|
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,
|
|
606
905
|
)
|
|
607
|
-
|
|
608
|
-
@cached_property
|
|
609
|
-
def requests(self) -> RequestsResourceWithRawResponse:
|
|
610
|
-
return RequestsResourceWithRawResponse(self._analytics.requests)
|
|
611
906
|
|
|
612
907
|
|
|
613
|
-
class
|
|
614
|
-
def __init__(self,
|
|
615
|
-
self.
|
|
908
|
+
class AsyncStatisticsResourceWithRawResponse:
|
|
909
|
+
def __init__(self, statistics: AsyncStatisticsResource) -> None:
|
|
910
|
+
self._statistics = statistics
|
|
616
911
|
|
|
617
|
-
self.
|
|
618
|
-
|
|
912
|
+
self.get_ddos_attacks = async_to_raw_response_wrapper(
|
|
913
|
+
statistics.get_ddos_attacks,
|
|
619
914
|
)
|
|
620
|
-
self.
|
|
621
|
-
|
|
915
|
+
self.get_ddos_info = async_to_raw_response_wrapper(
|
|
916
|
+
statistics.get_ddos_info,
|
|
622
917
|
)
|
|
623
|
-
self.
|
|
624
|
-
|
|
918
|
+
self.get_events_aggregated = async_to_raw_response_wrapper(
|
|
919
|
+
statistics.get_events_aggregated,
|
|
625
920
|
)
|
|
626
|
-
self.
|
|
627
|
-
|
|
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,
|
|
628
929
|
)
|
|
629
|
-
|
|
630
|
-
@cached_property
|
|
631
|
-
def requests(self) -> AsyncRequestsResourceWithRawResponse:
|
|
632
|
-
return AsyncRequestsResourceWithRawResponse(self._analytics.requests)
|
|
633
930
|
|
|
634
931
|
|
|
635
|
-
class
|
|
636
|
-
def __init__(self,
|
|
637
|
-
self.
|
|
932
|
+
class StatisticsResourceWithStreamingResponse:
|
|
933
|
+
def __init__(self, statistics: StatisticsResource) -> None:
|
|
934
|
+
self._statistics = statistics
|
|
638
935
|
|
|
639
|
-
self.
|
|
640
|
-
|
|
936
|
+
self.get_ddos_attacks = to_streamed_response_wrapper(
|
|
937
|
+
statistics.get_ddos_attacks,
|
|
641
938
|
)
|
|
642
|
-
self.
|
|
643
|
-
|
|
939
|
+
self.get_ddos_info = to_streamed_response_wrapper(
|
|
940
|
+
statistics.get_ddos_info,
|
|
644
941
|
)
|
|
645
|
-
self.
|
|
646
|
-
|
|
942
|
+
self.get_events_aggregated = to_streamed_response_wrapper(
|
|
943
|
+
statistics.get_events_aggregated,
|
|
647
944
|
)
|
|
648
|
-
self.
|
|
649
|
-
|
|
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,
|
|
650
953
|
)
|
|
651
|
-
|
|
652
|
-
@cached_property
|
|
653
|
-
def requests(self) -> RequestsResourceWithStreamingResponse:
|
|
654
|
-
return RequestsResourceWithStreamingResponse(self._analytics.requests)
|
|
655
954
|
|
|
656
955
|
|
|
657
|
-
class
|
|
658
|
-
def __init__(self,
|
|
659
|
-
self.
|
|
956
|
+
class AsyncStatisticsResourceWithStreamingResponse:
|
|
957
|
+
def __init__(self, statistics: AsyncStatisticsResource) -> None:
|
|
958
|
+
self._statistics = statistics
|
|
660
959
|
|
|
661
|
-
self.
|
|
662
|
-
|
|
960
|
+
self.get_ddos_attacks = async_to_streamed_response_wrapper(
|
|
961
|
+
statistics.get_ddos_attacks,
|
|
663
962
|
)
|
|
664
|
-
self.
|
|
665
|
-
|
|
963
|
+
self.get_ddos_info = async_to_streamed_response_wrapper(
|
|
964
|
+
statistics.get_ddos_info,
|
|
666
965
|
)
|
|
667
|
-
self.
|
|
668
|
-
|
|
966
|
+
self.get_events_aggregated = async_to_streamed_response_wrapper(
|
|
967
|
+
statistics.get_events_aggregated,
|
|
669
968
|
)
|
|
670
|
-
self.
|
|
671
|
-
|
|
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,
|
|
672
977
|
)
|
|
673
|
-
|
|
674
|
-
@cached_property
|
|
675
|
-
def requests(self) -> AsyncRequestsResourceWithStreamingResponse:
|
|
676
|
-
return AsyncRequestsResourceWithStreamingResponse(self._analytics.requests)
|