gcore 0.9.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/_version.py +1 -1
- gcore/resources/cloud/load_balancers/pools/health_monitors.py +8 -4
- gcore/resources/cloud/load_balancers/pools/members.py +2 -2
- gcore/resources/security/bgp_announces.py +15 -15
- 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/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/region.py +0 -3
- gcore/types/security/__init__.py +1 -1
- gcore/types/security/{bgp_announce_change_params.py → bgp_announce_toggle_params.py} +2 -2
- 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.9.0.dist-info → gcore-0.10.0.dist-info}/METADATA +1 -1
- {gcore-0.9.0.dist-info → gcore-0.10.0.dist-info}/RECORD +85 -124
- 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.9.0.dist-info → gcore-0.10.0.dist-info}/WHEEL +0 -0
- {gcore-0.9.0.dist-info → gcore-0.10.0.dist-info}/licenses/LICENSE +0 -0
|
@@ -1,352 +0,0 @@
|
|
|
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 Optional
|
|
6
|
-
from typing_extensions import Literal
|
|
7
|
-
|
|
8
|
-
import httpx
|
|
9
|
-
|
|
10
|
-
from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven
|
|
11
|
-
from ....._utils import maybe_transform
|
|
12
|
-
from ....._compat import cached_property
|
|
13
|
-
from ....._resource import SyncAPIResource, AsyncAPIResource
|
|
14
|
-
from ....._response import (
|
|
15
|
-
to_raw_response_wrapper,
|
|
16
|
-
to_streamed_response_wrapper,
|
|
17
|
-
async_to_raw_response_wrapper,
|
|
18
|
-
async_to_streamed_response_wrapper,
|
|
19
|
-
)
|
|
20
|
-
from .....pagination import SyncOffsetPage, AsyncOffsetPage
|
|
21
|
-
from ....._base_client import AsyncPaginator, make_request_options
|
|
22
|
-
from .....types.waap.domains.api_discovery import scan_result_list_params
|
|
23
|
-
from .....types.waap.domains.api_discovery.scan_result_get_response import ScanResultGetResponse
|
|
24
|
-
from .....types.waap.domains.api_discovery.scan_result_list_response import ScanResultListResponse
|
|
25
|
-
|
|
26
|
-
__all__ = ["ScanResultsResource", "AsyncScanResultsResource"]
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
class ScanResultsResource(SyncAPIResource):
|
|
30
|
-
@cached_property
|
|
31
|
-
def with_raw_response(self) -> ScanResultsResourceWithRawResponse:
|
|
32
|
-
"""
|
|
33
|
-
This property can be used as a prefix for any HTTP method call to return
|
|
34
|
-
the raw response object instead of the parsed content.
|
|
35
|
-
|
|
36
|
-
For more information, see https://www.github.com/G-Core/gcore-python#accessing-raw-response-data-eg-headers
|
|
37
|
-
"""
|
|
38
|
-
return ScanResultsResourceWithRawResponse(self)
|
|
39
|
-
|
|
40
|
-
@cached_property
|
|
41
|
-
def with_streaming_response(self) -> ScanResultsResourceWithStreamingResponse:
|
|
42
|
-
"""
|
|
43
|
-
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
44
|
-
|
|
45
|
-
For more information, see https://www.github.com/G-Core/gcore-python#with_streaming_response
|
|
46
|
-
"""
|
|
47
|
-
return ScanResultsResourceWithStreamingResponse(self)
|
|
48
|
-
|
|
49
|
-
def list(
|
|
50
|
-
self,
|
|
51
|
-
domain_id: int,
|
|
52
|
-
*,
|
|
53
|
-
limit: int | NotGiven = NOT_GIVEN,
|
|
54
|
-
message: Optional[str] | NotGiven = NOT_GIVEN,
|
|
55
|
-
offset: int | NotGiven = NOT_GIVEN,
|
|
56
|
-
ordering: Literal[
|
|
57
|
-
"id",
|
|
58
|
-
"type",
|
|
59
|
-
"start_time",
|
|
60
|
-
"end_time",
|
|
61
|
-
"status",
|
|
62
|
-
"message",
|
|
63
|
-
"-id",
|
|
64
|
-
"-type",
|
|
65
|
-
"-start_time",
|
|
66
|
-
"-end_time",
|
|
67
|
-
"-status",
|
|
68
|
-
"-message",
|
|
69
|
-
]
|
|
70
|
-
| NotGiven = NOT_GIVEN,
|
|
71
|
-
status: Optional[Literal["SUCCESS", "FAILURE", "IN_PROGRESS"]] | NotGiven = NOT_GIVEN,
|
|
72
|
-
type: Optional[Literal["TRAFFIC_SCAN", "API_DESCRIPTION_FILE_SCAN"]] | NotGiven = NOT_GIVEN,
|
|
73
|
-
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
74
|
-
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
75
|
-
extra_headers: Headers | None = None,
|
|
76
|
-
extra_query: Query | None = None,
|
|
77
|
-
extra_body: Body | None = None,
|
|
78
|
-
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
79
|
-
) -> SyncOffsetPage[ScanResultListResponse]:
|
|
80
|
-
"""
|
|
81
|
-
Get Scan Results
|
|
82
|
-
|
|
83
|
-
Args:
|
|
84
|
-
domain_id: The domain ID
|
|
85
|
-
|
|
86
|
-
limit: Number of items to return
|
|
87
|
-
|
|
88
|
-
message: Filter by the message of the scan. Supports '\\**' as a wildcard character
|
|
89
|
-
|
|
90
|
-
offset: Number of items to skip
|
|
91
|
-
|
|
92
|
-
ordering: Sort the response by given field.
|
|
93
|
-
|
|
94
|
-
status: The different statuses a task result can have
|
|
95
|
-
|
|
96
|
-
type: The different types of scans that can be performed
|
|
97
|
-
|
|
98
|
-
extra_headers: Send extra headers
|
|
99
|
-
|
|
100
|
-
extra_query: Add additional query parameters to the request
|
|
101
|
-
|
|
102
|
-
extra_body: Add additional JSON properties to the request
|
|
103
|
-
|
|
104
|
-
timeout: Override the client-level default timeout for this request, in seconds
|
|
105
|
-
"""
|
|
106
|
-
return self._get_api_list(
|
|
107
|
-
f"/waap/v1/domains/{domain_id}/api-discovery/scan-results",
|
|
108
|
-
page=SyncOffsetPage[ScanResultListResponse],
|
|
109
|
-
options=make_request_options(
|
|
110
|
-
extra_headers=extra_headers,
|
|
111
|
-
extra_query=extra_query,
|
|
112
|
-
extra_body=extra_body,
|
|
113
|
-
timeout=timeout,
|
|
114
|
-
query=maybe_transform(
|
|
115
|
-
{
|
|
116
|
-
"limit": limit,
|
|
117
|
-
"message": message,
|
|
118
|
-
"offset": offset,
|
|
119
|
-
"ordering": ordering,
|
|
120
|
-
"status": status,
|
|
121
|
-
"type": type,
|
|
122
|
-
},
|
|
123
|
-
scan_result_list_params.ScanResultListParams,
|
|
124
|
-
),
|
|
125
|
-
),
|
|
126
|
-
model=ScanResultListResponse,
|
|
127
|
-
)
|
|
128
|
-
|
|
129
|
-
def get(
|
|
130
|
-
self,
|
|
131
|
-
scan_id: str,
|
|
132
|
-
*,
|
|
133
|
-
domain_id: int,
|
|
134
|
-
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
135
|
-
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
136
|
-
extra_headers: Headers | None = None,
|
|
137
|
-
extra_query: Query | None = None,
|
|
138
|
-
extra_body: Body | None = None,
|
|
139
|
-
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
140
|
-
) -> ScanResultGetResponse:
|
|
141
|
-
"""
|
|
142
|
-
Get Scan Result
|
|
143
|
-
|
|
144
|
-
Args:
|
|
145
|
-
domain_id: The domain ID
|
|
146
|
-
|
|
147
|
-
scan_id: The scan ID
|
|
148
|
-
|
|
149
|
-
extra_headers: Send extra headers
|
|
150
|
-
|
|
151
|
-
extra_query: Add additional query parameters to the request
|
|
152
|
-
|
|
153
|
-
extra_body: Add additional JSON properties to the request
|
|
154
|
-
|
|
155
|
-
timeout: Override the client-level default timeout for this request, in seconds
|
|
156
|
-
"""
|
|
157
|
-
if not scan_id:
|
|
158
|
-
raise ValueError(f"Expected a non-empty value for `scan_id` but received {scan_id!r}")
|
|
159
|
-
return self._get(
|
|
160
|
-
f"/waap/v1/domains/{domain_id}/api-discovery/scan-results/{scan_id}",
|
|
161
|
-
options=make_request_options(
|
|
162
|
-
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
163
|
-
),
|
|
164
|
-
cast_to=ScanResultGetResponse,
|
|
165
|
-
)
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
class AsyncScanResultsResource(AsyncAPIResource):
|
|
169
|
-
@cached_property
|
|
170
|
-
def with_raw_response(self) -> AsyncScanResultsResourceWithRawResponse:
|
|
171
|
-
"""
|
|
172
|
-
This property can be used as a prefix for any HTTP method call to return
|
|
173
|
-
the raw response object instead of the parsed content.
|
|
174
|
-
|
|
175
|
-
For more information, see https://www.github.com/G-Core/gcore-python#accessing-raw-response-data-eg-headers
|
|
176
|
-
"""
|
|
177
|
-
return AsyncScanResultsResourceWithRawResponse(self)
|
|
178
|
-
|
|
179
|
-
@cached_property
|
|
180
|
-
def with_streaming_response(self) -> AsyncScanResultsResourceWithStreamingResponse:
|
|
181
|
-
"""
|
|
182
|
-
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
183
|
-
|
|
184
|
-
For more information, see https://www.github.com/G-Core/gcore-python#with_streaming_response
|
|
185
|
-
"""
|
|
186
|
-
return AsyncScanResultsResourceWithStreamingResponse(self)
|
|
187
|
-
|
|
188
|
-
def list(
|
|
189
|
-
self,
|
|
190
|
-
domain_id: int,
|
|
191
|
-
*,
|
|
192
|
-
limit: int | NotGiven = NOT_GIVEN,
|
|
193
|
-
message: Optional[str] | NotGiven = NOT_GIVEN,
|
|
194
|
-
offset: int | NotGiven = NOT_GIVEN,
|
|
195
|
-
ordering: Literal[
|
|
196
|
-
"id",
|
|
197
|
-
"type",
|
|
198
|
-
"start_time",
|
|
199
|
-
"end_time",
|
|
200
|
-
"status",
|
|
201
|
-
"message",
|
|
202
|
-
"-id",
|
|
203
|
-
"-type",
|
|
204
|
-
"-start_time",
|
|
205
|
-
"-end_time",
|
|
206
|
-
"-status",
|
|
207
|
-
"-message",
|
|
208
|
-
]
|
|
209
|
-
| NotGiven = NOT_GIVEN,
|
|
210
|
-
status: Optional[Literal["SUCCESS", "FAILURE", "IN_PROGRESS"]] | NotGiven = NOT_GIVEN,
|
|
211
|
-
type: Optional[Literal["TRAFFIC_SCAN", "API_DESCRIPTION_FILE_SCAN"]] | NotGiven = NOT_GIVEN,
|
|
212
|
-
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
213
|
-
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
214
|
-
extra_headers: Headers | None = None,
|
|
215
|
-
extra_query: Query | None = None,
|
|
216
|
-
extra_body: Body | None = None,
|
|
217
|
-
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
218
|
-
) -> AsyncPaginator[ScanResultListResponse, AsyncOffsetPage[ScanResultListResponse]]:
|
|
219
|
-
"""
|
|
220
|
-
Get Scan Results
|
|
221
|
-
|
|
222
|
-
Args:
|
|
223
|
-
domain_id: The domain ID
|
|
224
|
-
|
|
225
|
-
limit: Number of items to return
|
|
226
|
-
|
|
227
|
-
message: Filter by the message of the scan. Supports '\\**' as a wildcard character
|
|
228
|
-
|
|
229
|
-
offset: Number of items to skip
|
|
230
|
-
|
|
231
|
-
ordering: Sort the response by given field.
|
|
232
|
-
|
|
233
|
-
status: The different statuses a task result can have
|
|
234
|
-
|
|
235
|
-
type: The different types of scans that can be performed
|
|
236
|
-
|
|
237
|
-
extra_headers: Send extra headers
|
|
238
|
-
|
|
239
|
-
extra_query: Add additional query parameters to the request
|
|
240
|
-
|
|
241
|
-
extra_body: Add additional JSON properties to the request
|
|
242
|
-
|
|
243
|
-
timeout: Override the client-level default timeout for this request, in seconds
|
|
244
|
-
"""
|
|
245
|
-
return self._get_api_list(
|
|
246
|
-
f"/waap/v1/domains/{domain_id}/api-discovery/scan-results",
|
|
247
|
-
page=AsyncOffsetPage[ScanResultListResponse],
|
|
248
|
-
options=make_request_options(
|
|
249
|
-
extra_headers=extra_headers,
|
|
250
|
-
extra_query=extra_query,
|
|
251
|
-
extra_body=extra_body,
|
|
252
|
-
timeout=timeout,
|
|
253
|
-
query=maybe_transform(
|
|
254
|
-
{
|
|
255
|
-
"limit": limit,
|
|
256
|
-
"message": message,
|
|
257
|
-
"offset": offset,
|
|
258
|
-
"ordering": ordering,
|
|
259
|
-
"status": status,
|
|
260
|
-
"type": type,
|
|
261
|
-
},
|
|
262
|
-
scan_result_list_params.ScanResultListParams,
|
|
263
|
-
),
|
|
264
|
-
),
|
|
265
|
-
model=ScanResultListResponse,
|
|
266
|
-
)
|
|
267
|
-
|
|
268
|
-
async def get(
|
|
269
|
-
self,
|
|
270
|
-
scan_id: str,
|
|
271
|
-
*,
|
|
272
|
-
domain_id: int,
|
|
273
|
-
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
274
|
-
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
275
|
-
extra_headers: Headers | None = None,
|
|
276
|
-
extra_query: Query | None = None,
|
|
277
|
-
extra_body: Body | None = None,
|
|
278
|
-
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
279
|
-
) -> ScanResultGetResponse:
|
|
280
|
-
"""
|
|
281
|
-
Get Scan Result
|
|
282
|
-
|
|
283
|
-
Args:
|
|
284
|
-
domain_id: The domain ID
|
|
285
|
-
|
|
286
|
-
scan_id: The scan ID
|
|
287
|
-
|
|
288
|
-
extra_headers: Send extra headers
|
|
289
|
-
|
|
290
|
-
extra_query: Add additional query parameters to the request
|
|
291
|
-
|
|
292
|
-
extra_body: Add additional JSON properties to the request
|
|
293
|
-
|
|
294
|
-
timeout: Override the client-level default timeout for this request, in seconds
|
|
295
|
-
"""
|
|
296
|
-
if not scan_id:
|
|
297
|
-
raise ValueError(f"Expected a non-empty value for `scan_id` but received {scan_id!r}")
|
|
298
|
-
return await self._get(
|
|
299
|
-
f"/waap/v1/domains/{domain_id}/api-discovery/scan-results/{scan_id}",
|
|
300
|
-
options=make_request_options(
|
|
301
|
-
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
302
|
-
),
|
|
303
|
-
cast_to=ScanResultGetResponse,
|
|
304
|
-
)
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
class ScanResultsResourceWithRawResponse:
|
|
308
|
-
def __init__(self, scan_results: ScanResultsResource) -> None:
|
|
309
|
-
self._scan_results = scan_results
|
|
310
|
-
|
|
311
|
-
self.list = to_raw_response_wrapper(
|
|
312
|
-
scan_results.list,
|
|
313
|
-
)
|
|
314
|
-
self.get = to_raw_response_wrapper(
|
|
315
|
-
scan_results.get,
|
|
316
|
-
)
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
class AsyncScanResultsResourceWithRawResponse:
|
|
320
|
-
def __init__(self, scan_results: AsyncScanResultsResource) -> None:
|
|
321
|
-
self._scan_results = scan_results
|
|
322
|
-
|
|
323
|
-
self.list = async_to_raw_response_wrapper(
|
|
324
|
-
scan_results.list,
|
|
325
|
-
)
|
|
326
|
-
self.get = async_to_raw_response_wrapper(
|
|
327
|
-
scan_results.get,
|
|
328
|
-
)
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
class ScanResultsResourceWithStreamingResponse:
|
|
332
|
-
def __init__(self, scan_results: ScanResultsResource) -> None:
|
|
333
|
-
self._scan_results = scan_results
|
|
334
|
-
|
|
335
|
-
self.list = to_streamed_response_wrapper(
|
|
336
|
-
scan_results.list,
|
|
337
|
-
)
|
|
338
|
-
self.get = to_streamed_response_wrapper(
|
|
339
|
-
scan_results.get,
|
|
340
|
-
)
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
class AsyncScanResultsResourceWithStreamingResponse:
|
|
344
|
-
def __init__(self, scan_results: AsyncScanResultsResource) -> None:
|
|
345
|
-
self._scan_results = scan_results
|
|
346
|
-
|
|
347
|
-
self.list = async_to_streamed_response_wrapper(
|
|
348
|
-
scan_results.list,
|
|
349
|
-
)
|
|
350
|
-
self.get = async_to_streamed_response_wrapper(
|
|
351
|
-
scan_results.get,
|
|
352
|
-
)
|
|
@@ -1,173 +0,0 @@
|
|
|
1
|
-
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
-
|
|
3
|
-
from __future__ import annotations
|
|
4
|
-
|
|
5
|
-
import httpx
|
|
6
|
-
|
|
7
|
-
from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven
|
|
8
|
-
from ...._compat import cached_property
|
|
9
|
-
from ...._resource import SyncAPIResource, AsyncAPIResource
|
|
10
|
-
from ...._response import (
|
|
11
|
-
to_raw_response_wrapper,
|
|
12
|
-
to_streamed_response_wrapper,
|
|
13
|
-
async_to_raw_response_wrapper,
|
|
14
|
-
async_to_streamed_response_wrapper,
|
|
15
|
-
)
|
|
16
|
-
from ...._base_client import make_request_options
|
|
17
|
-
from ....types.waap.waap_policy_mode import WaapPolicyMode
|
|
18
|
-
|
|
19
|
-
__all__ = ["PoliciesResource", "AsyncPoliciesResource"]
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
class PoliciesResource(SyncAPIResource):
|
|
23
|
-
@cached_property
|
|
24
|
-
def with_raw_response(self) -> PoliciesResourceWithRawResponse:
|
|
25
|
-
"""
|
|
26
|
-
This property can be used as a prefix for any HTTP method call to return
|
|
27
|
-
the raw response object instead of the parsed content.
|
|
28
|
-
|
|
29
|
-
For more information, see https://www.github.com/G-Core/gcore-python#accessing-raw-response-data-eg-headers
|
|
30
|
-
"""
|
|
31
|
-
return PoliciesResourceWithRawResponse(self)
|
|
32
|
-
|
|
33
|
-
@cached_property
|
|
34
|
-
def with_streaming_response(self) -> PoliciesResourceWithStreamingResponse:
|
|
35
|
-
"""
|
|
36
|
-
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
37
|
-
|
|
38
|
-
For more information, see https://www.github.com/G-Core/gcore-python#with_streaming_response
|
|
39
|
-
"""
|
|
40
|
-
return PoliciesResourceWithStreamingResponse(self)
|
|
41
|
-
|
|
42
|
-
def toggle(
|
|
43
|
-
self,
|
|
44
|
-
policy_id: str,
|
|
45
|
-
*,
|
|
46
|
-
domain_id: int,
|
|
47
|
-
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
48
|
-
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
49
|
-
extra_headers: Headers | None = None,
|
|
50
|
-
extra_query: Query | None = None,
|
|
51
|
-
extra_body: Body | None = None,
|
|
52
|
-
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
53
|
-
) -> WaapPolicyMode:
|
|
54
|
-
"""
|
|
55
|
-
Modify the activation state of a policy associated with a domain
|
|
56
|
-
|
|
57
|
-
Args:
|
|
58
|
-
domain_id: The domain ID
|
|
59
|
-
|
|
60
|
-
policy_id: The ID of the policy to toggle
|
|
61
|
-
|
|
62
|
-
extra_headers: Send extra headers
|
|
63
|
-
|
|
64
|
-
extra_query: Add additional query parameters to the request
|
|
65
|
-
|
|
66
|
-
extra_body: Add additional JSON properties to the request
|
|
67
|
-
|
|
68
|
-
timeout: Override the client-level default timeout for this request, in seconds
|
|
69
|
-
"""
|
|
70
|
-
if not policy_id:
|
|
71
|
-
raise ValueError(f"Expected a non-empty value for `policy_id` but received {policy_id!r}")
|
|
72
|
-
return self._patch(
|
|
73
|
-
f"/waap/v1/domains/{domain_id}/policies/{policy_id}/toggle",
|
|
74
|
-
options=make_request_options(
|
|
75
|
-
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
76
|
-
),
|
|
77
|
-
cast_to=WaapPolicyMode,
|
|
78
|
-
)
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
class AsyncPoliciesResource(AsyncAPIResource):
|
|
82
|
-
@cached_property
|
|
83
|
-
def with_raw_response(self) -> AsyncPoliciesResourceWithRawResponse:
|
|
84
|
-
"""
|
|
85
|
-
This property can be used as a prefix for any HTTP method call to return
|
|
86
|
-
the raw response object instead of the parsed content.
|
|
87
|
-
|
|
88
|
-
For more information, see https://www.github.com/G-Core/gcore-python#accessing-raw-response-data-eg-headers
|
|
89
|
-
"""
|
|
90
|
-
return AsyncPoliciesResourceWithRawResponse(self)
|
|
91
|
-
|
|
92
|
-
@cached_property
|
|
93
|
-
def with_streaming_response(self) -> AsyncPoliciesResourceWithStreamingResponse:
|
|
94
|
-
"""
|
|
95
|
-
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
96
|
-
|
|
97
|
-
For more information, see https://www.github.com/G-Core/gcore-python#with_streaming_response
|
|
98
|
-
"""
|
|
99
|
-
return AsyncPoliciesResourceWithStreamingResponse(self)
|
|
100
|
-
|
|
101
|
-
async def toggle(
|
|
102
|
-
self,
|
|
103
|
-
policy_id: str,
|
|
104
|
-
*,
|
|
105
|
-
domain_id: int,
|
|
106
|
-
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
107
|
-
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
108
|
-
extra_headers: Headers | None = None,
|
|
109
|
-
extra_query: Query | None = None,
|
|
110
|
-
extra_body: Body | None = None,
|
|
111
|
-
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
112
|
-
) -> WaapPolicyMode:
|
|
113
|
-
"""
|
|
114
|
-
Modify the activation state of a policy associated with a domain
|
|
115
|
-
|
|
116
|
-
Args:
|
|
117
|
-
domain_id: The domain ID
|
|
118
|
-
|
|
119
|
-
policy_id: The ID of the policy to toggle
|
|
120
|
-
|
|
121
|
-
extra_headers: Send extra headers
|
|
122
|
-
|
|
123
|
-
extra_query: Add additional query parameters to the request
|
|
124
|
-
|
|
125
|
-
extra_body: Add additional JSON properties to the request
|
|
126
|
-
|
|
127
|
-
timeout: Override the client-level default timeout for this request, in seconds
|
|
128
|
-
"""
|
|
129
|
-
if not policy_id:
|
|
130
|
-
raise ValueError(f"Expected a non-empty value for `policy_id` but received {policy_id!r}")
|
|
131
|
-
return await self._patch(
|
|
132
|
-
f"/waap/v1/domains/{domain_id}/policies/{policy_id}/toggle",
|
|
133
|
-
options=make_request_options(
|
|
134
|
-
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
135
|
-
),
|
|
136
|
-
cast_to=WaapPolicyMode,
|
|
137
|
-
)
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
class PoliciesResourceWithRawResponse:
|
|
141
|
-
def __init__(self, policies: PoliciesResource) -> None:
|
|
142
|
-
self._policies = policies
|
|
143
|
-
|
|
144
|
-
self.toggle = to_raw_response_wrapper(
|
|
145
|
-
policies.toggle,
|
|
146
|
-
)
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
class AsyncPoliciesResourceWithRawResponse:
|
|
150
|
-
def __init__(self, policies: AsyncPoliciesResource) -> None:
|
|
151
|
-
self._policies = policies
|
|
152
|
-
|
|
153
|
-
self.toggle = async_to_raw_response_wrapper(
|
|
154
|
-
policies.toggle,
|
|
155
|
-
)
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
class PoliciesResourceWithStreamingResponse:
|
|
159
|
-
def __init__(self, policies: PoliciesResource) -> None:
|
|
160
|
-
self._policies = policies
|
|
161
|
-
|
|
162
|
-
self.toggle = to_streamed_response_wrapper(
|
|
163
|
-
policies.toggle,
|
|
164
|
-
)
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
class AsyncPoliciesResourceWithStreamingResponse:
|
|
168
|
-
def __init__(self, policies: AsyncPoliciesResource) -> None:
|
|
169
|
-
self._policies = policies
|
|
170
|
-
|
|
171
|
-
self.toggle = async_to_streamed_response_wrapper(
|
|
172
|
-
policies.toggle,
|
|
173
|
-
)
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
-
|
|
3
|
-
from typing import List
|
|
4
|
-
from typing_extensions import TypeAlias
|
|
5
|
-
|
|
6
|
-
from ..waap_traffic_metrics import WaapTrafficMetrics
|
|
7
|
-
|
|
8
|
-
__all__ = ["AnalyticsListEventTrafficResponse"]
|
|
9
|
-
|
|
10
|
-
AnalyticsListEventTrafficResponse: TypeAlias = List[WaapTrafficMetrics]
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
-
|
|
3
|
-
from __future__ import annotations
|
|
4
|
-
|
|
5
|
-
from .scan_result_list_params import ScanResultListParams as ScanResultListParams
|
|
6
|
-
from .scan_result_get_response import ScanResultGetResponse as ScanResultGetResponse
|
|
7
|
-
from .scan_result_list_response import ScanResultListResponse as ScanResultListResponse
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
-
|
|
3
|
-
from typing import Optional
|
|
4
|
-
from datetime import datetime
|
|
5
|
-
from typing_extensions import Literal
|
|
6
|
-
|
|
7
|
-
from ....._models import BaseModel
|
|
8
|
-
|
|
9
|
-
__all__ = ["ScanResultListResponse"]
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
class ScanResultListResponse(BaseModel):
|
|
13
|
-
id: str
|
|
14
|
-
"""The scan ID"""
|
|
15
|
-
|
|
16
|
-
end_time: Optional[datetime] = None
|
|
17
|
-
"""The date and time the scan ended"""
|
|
18
|
-
|
|
19
|
-
message: str
|
|
20
|
-
"""The message associated with the scan"""
|
|
21
|
-
|
|
22
|
-
start_time: datetime
|
|
23
|
-
"""The date and time the scan started"""
|
|
24
|
-
|
|
25
|
-
status: Literal["SUCCESS", "FAILURE", "IN_PROGRESS"]
|
|
26
|
-
"""The different statuses a task result can have"""
|
|
27
|
-
|
|
28
|
-
type: Literal["TRAFFIC_SCAN", "API_DESCRIPTION_FILE_SCAN"]
|
|
29
|
-
"""The different types of scans that can be performed"""
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
-
|
|
3
|
-
from typing import Optional
|
|
4
|
-
|
|
5
|
-
from pydantic import Field as FieldInfo
|
|
6
|
-
|
|
7
|
-
from ...._models import BaseModel
|
|
8
|
-
|
|
9
|
-
__all__ = ["APIDiscoveryUpdateSettingsResponse"]
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
class APIDiscoveryUpdateSettingsResponse(BaseModel):
|
|
13
|
-
description_file_location: Optional[str] = FieldInfo(alias="descriptionFileLocation", default=None)
|
|
14
|
-
"""The URL of the API description file.
|
|
15
|
-
|
|
16
|
-
This will be periodically scanned if `descriptionFileScanEnabled` is enabled.
|
|
17
|
-
Supported formats are YAML and JSON, and it must adhere to OpenAPI versions 2,
|
|
18
|
-
3, or 3.1.
|
|
19
|
-
"""
|
|
20
|
-
|
|
21
|
-
description_file_scan_enabled: Optional[bool] = FieldInfo(alias="descriptionFileScanEnabled", default=None)
|
|
22
|
-
"""Indicates if periodic scan of the description file is enabled"""
|
|
23
|
-
|
|
24
|
-
description_file_scan_interval_hours: Optional[int] = FieldInfo(
|
|
25
|
-
alias="descriptionFileScanIntervalHours", default=None
|
|
26
|
-
)
|
|
27
|
-
"""The interval in hours for scanning the description file"""
|
|
28
|
-
|
|
29
|
-
traffic_scan_enabled: Optional[bool] = FieldInfo(alias="trafficScanEnabled", default=None)
|
|
30
|
-
"""Indicates if traffic scan is enabled.
|
|
31
|
-
|
|
32
|
-
Traffic scan is used to discover undocumented APIs
|
|
33
|
-
"""
|
|
34
|
-
|
|
35
|
-
traffic_scan_interval_hours: Optional[int] = FieldInfo(alias="trafficScanIntervalHours", default=None)
|
|
36
|
-
"""The interval in hours for scanning the traffic"""
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
-
|
|
3
|
-
from ...._models import BaseModel
|
|
4
|
-
|
|
5
|
-
__all__ = ["APIDiscoveryUploadOpenAPIResponse"]
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
class APIDiscoveryUploadOpenAPIResponse(BaseModel):
|
|
9
|
-
id: str
|
|
10
|
-
"""The task ID"""
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
-
|
|
3
|
-
from typing import List
|
|
4
|
-
from datetime import datetime
|
|
5
|
-
from typing_extensions import Literal
|
|
6
|
-
|
|
7
|
-
from ...._models import BaseModel
|
|
8
|
-
|
|
9
|
-
__all__ = ["APIPathCreateResponse"]
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
class APIPathCreateResponse(BaseModel):
|
|
13
|
-
id: str
|
|
14
|
-
"""The path ID"""
|
|
15
|
-
|
|
16
|
-
api_groups: List[str]
|
|
17
|
-
"""An array of api groups associated with the API path"""
|
|
18
|
-
|
|
19
|
-
api_version: str
|
|
20
|
-
"""The API version"""
|
|
21
|
-
|
|
22
|
-
first_detected: datetime
|
|
23
|
-
"""The date and time in ISO 8601 format the API path was first detected."""
|
|
24
|
-
|
|
25
|
-
http_scheme: Literal["HTTP", "HTTPS"]
|
|
26
|
-
"""The different HTTP schemes an API path can have"""
|
|
27
|
-
|
|
28
|
-
last_detected: datetime
|
|
29
|
-
"""The date and time in ISO 8601 format the API path was last detected."""
|
|
30
|
-
|
|
31
|
-
method: Literal["GET", "POST", "PUT", "PATCH", "DELETE", "TRACE", "HEAD", "OPTIONS"]
|
|
32
|
-
"""The different methods an API path can have"""
|
|
33
|
-
|
|
34
|
-
path: str
|
|
35
|
-
"""
|
|
36
|
-
The API path, locations that are saved for resource IDs will be put in curly
|
|
37
|
-
brackets
|
|
38
|
-
"""
|
|
39
|
-
|
|
40
|
-
request_count: int
|
|
41
|
-
"""The number of requests for this path in the last 24 hours"""
|
|
42
|
-
|
|
43
|
-
source: Literal["API_DESCRIPTION_FILE", "TRAFFIC_SCAN", "USER_DEFINED"]
|
|
44
|
-
"""The different sources an API path can have"""
|
|
45
|
-
|
|
46
|
-
status: Literal["CONFIRMED_API", "POTENTIAL_API", "NOT_API", "DELISTED_API"]
|
|
47
|
-
"""The different statuses an API path can have"""
|
|
48
|
-
|
|
49
|
-
tags: List[str]
|
|
50
|
-
"""An array of tags associated with the API path"""
|