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
|
@@ -0,0 +1,661 @@
|
|
|
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 Iterable, Optional
|
|
6
|
+
|
|
7
|
+
import httpx
|
|
8
|
+
|
|
9
|
+
from ..._types import NOT_GIVEN, Body, Query, Headers, NoneType, NotGiven
|
|
10
|
+
from ..._utils import maybe_transform, async_maybe_transform
|
|
11
|
+
from ..._compat import cached_property
|
|
12
|
+
from ..._resource import SyncAPIResource, AsyncAPIResource
|
|
13
|
+
from ..._response import (
|
|
14
|
+
to_raw_response_wrapper,
|
|
15
|
+
to_streamed_response_wrapper,
|
|
16
|
+
async_to_raw_response_wrapper,
|
|
17
|
+
async_to_streamed_response_wrapper,
|
|
18
|
+
)
|
|
19
|
+
from ..._base_client import make_request_options
|
|
20
|
+
from ...types.security import (
|
|
21
|
+
profile_list_params,
|
|
22
|
+
profile_create_params,
|
|
23
|
+
profile_replace_params,
|
|
24
|
+
profile_recreate_params,
|
|
25
|
+
)
|
|
26
|
+
from ...types.security.client_profile import ClientProfile
|
|
27
|
+
from ...types.security.profile_list_response import ProfileListResponse
|
|
28
|
+
|
|
29
|
+
__all__ = ["ProfilesResource", "AsyncProfilesResource"]
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
class ProfilesResource(SyncAPIResource):
|
|
33
|
+
@cached_property
|
|
34
|
+
def with_raw_response(self) -> ProfilesResourceWithRawResponse:
|
|
35
|
+
"""
|
|
36
|
+
This property can be used as a prefix for any HTTP method call to return
|
|
37
|
+
the raw response object instead of the parsed content.
|
|
38
|
+
|
|
39
|
+
For more information, see https://www.github.com/G-Core/gcore-python#accessing-raw-response-data-eg-headers
|
|
40
|
+
"""
|
|
41
|
+
return ProfilesResourceWithRawResponse(self)
|
|
42
|
+
|
|
43
|
+
@cached_property
|
|
44
|
+
def with_streaming_response(self) -> ProfilesResourceWithStreamingResponse:
|
|
45
|
+
"""
|
|
46
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
47
|
+
|
|
48
|
+
For more information, see https://www.github.com/G-Core/gcore-python#with_streaming_response
|
|
49
|
+
"""
|
|
50
|
+
return ProfilesResourceWithStreamingResponse(self)
|
|
51
|
+
|
|
52
|
+
def create(
|
|
53
|
+
self,
|
|
54
|
+
*,
|
|
55
|
+
fields: Iterable[profile_create_params.Field],
|
|
56
|
+
profile_template: int,
|
|
57
|
+
ip_address: Optional[str] | NotGiven = NOT_GIVEN,
|
|
58
|
+
site: str | NotGiven = NOT_GIVEN,
|
|
59
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
60
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
61
|
+
extra_headers: Headers | None = None,
|
|
62
|
+
extra_query: Query | None = None,
|
|
63
|
+
extra_body: Body | None = None,
|
|
64
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
65
|
+
) -> ClientProfile:
|
|
66
|
+
"""Create protection profile.
|
|
67
|
+
|
|
68
|
+
Protection is enabled at the same time as profile is
|
|
69
|
+
created
|
|
70
|
+
|
|
71
|
+
Args:
|
|
72
|
+
extra_headers: Send extra headers
|
|
73
|
+
|
|
74
|
+
extra_query: Add additional query parameters to the request
|
|
75
|
+
|
|
76
|
+
extra_body: Add additional JSON properties to the request
|
|
77
|
+
|
|
78
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
79
|
+
"""
|
|
80
|
+
return self._post(
|
|
81
|
+
"/security/iaas/v2/profiles",
|
|
82
|
+
body=maybe_transform(
|
|
83
|
+
{
|
|
84
|
+
"fields": fields,
|
|
85
|
+
"profile_template": profile_template,
|
|
86
|
+
"ip_address": ip_address,
|
|
87
|
+
"site": site,
|
|
88
|
+
},
|
|
89
|
+
profile_create_params.ProfileCreateParams,
|
|
90
|
+
),
|
|
91
|
+
options=make_request_options(
|
|
92
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
93
|
+
),
|
|
94
|
+
cast_to=ClientProfile,
|
|
95
|
+
)
|
|
96
|
+
|
|
97
|
+
def list(
|
|
98
|
+
self,
|
|
99
|
+
*,
|
|
100
|
+
exclude_empty_address: bool | NotGiven = NOT_GIVEN,
|
|
101
|
+
include_deleted: bool | NotGiven = NOT_GIVEN,
|
|
102
|
+
ip_address: str | NotGiven = NOT_GIVEN,
|
|
103
|
+
site: str | NotGiven = NOT_GIVEN,
|
|
104
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
105
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
106
|
+
extra_headers: Headers | None = None,
|
|
107
|
+
extra_query: Query | None = None,
|
|
108
|
+
extra_body: Body | None = None,
|
|
109
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
110
|
+
) -> ProfileListResponse:
|
|
111
|
+
"""Get list of protection profiles.
|
|
112
|
+
|
|
113
|
+
Client receives only profiles created by him
|
|
114
|
+
|
|
115
|
+
Args:
|
|
116
|
+
extra_headers: Send extra headers
|
|
117
|
+
|
|
118
|
+
extra_query: Add additional query parameters to the request
|
|
119
|
+
|
|
120
|
+
extra_body: Add additional JSON properties to the request
|
|
121
|
+
|
|
122
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
123
|
+
"""
|
|
124
|
+
return self._get(
|
|
125
|
+
"/security/iaas/v2/profiles",
|
|
126
|
+
options=make_request_options(
|
|
127
|
+
extra_headers=extra_headers,
|
|
128
|
+
extra_query=extra_query,
|
|
129
|
+
extra_body=extra_body,
|
|
130
|
+
timeout=timeout,
|
|
131
|
+
query=maybe_transform(
|
|
132
|
+
{
|
|
133
|
+
"exclude_empty_address": exclude_empty_address,
|
|
134
|
+
"include_deleted": include_deleted,
|
|
135
|
+
"ip_address": ip_address,
|
|
136
|
+
"site": site,
|
|
137
|
+
},
|
|
138
|
+
profile_list_params.ProfileListParams,
|
|
139
|
+
),
|
|
140
|
+
),
|
|
141
|
+
cast_to=ProfileListResponse,
|
|
142
|
+
)
|
|
143
|
+
|
|
144
|
+
def delete(
|
|
145
|
+
self,
|
|
146
|
+
id: int,
|
|
147
|
+
*,
|
|
148
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
149
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
150
|
+
extra_headers: Headers | None = None,
|
|
151
|
+
extra_query: Query | None = None,
|
|
152
|
+
extra_body: Body | None = None,
|
|
153
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
154
|
+
) -> None:
|
|
155
|
+
"""Delete protection profile.
|
|
156
|
+
|
|
157
|
+
Protection is disabled at the same time as profile is
|
|
158
|
+
deleted
|
|
159
|
+
|
|
160
|
+
Args:
|
|
161
|
+
extra_headers: Send extra headers
|
|
162
|
+
|
|
163
|
+
extra_query: Add additional query parameters to the request
|
|
164
|
+
|
|
165
|
+
extra_body: Add additional JSON properties to the request
|
|
166
|
+
|
|
167
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
168
|
+
"""
|
|
169
|
+
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
|
170
|
+
return self._delete(
|
|
171
|
+
f"/security/iaas/v2/profiles/{id}",
|
|
172
|
+
options=make_request_options(
|
|
173
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
174
|
+
),
|
|
175
|
+
cast_to=NoneType,
|
|
176
|
+
)
|
|
177
|
+
|
|
178
|
+
def get(
|
|
179
|
+
self,
|
|
180
|
+
id: int,
|
|
181
|
+
*,
|
|
182
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
183
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
184
|
+
extra_headers: Headers | None = None,
|
|
185
|
+
extra_query: Query | None = None,
|
|
186
|
+
extra_body: Body | None = None,
|
|
187
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
188
|
+
) -> ClientProfile:
|
|
189
|
+
"""
|
|
190
|
+
Get profile by id
|
|
191
|
+
|
|
192
|
+
Args:
|
|
193
|
+
extra_headers: Send extra headers
|
|
194
|
+
|
|
195
|
+
extra_query: Add additional query parameters to the request
|
|
196
|
+
|
|
197
|
+
extra_body: Add additional JSON properties to the request
|
|
198
|
+
|
|
199
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
200
|
+
"""
|
|
201
|
+
return self._get(
|
|
202
|
+
f"/security/iaas/v2/profiles/{id}",
|
|
203
|
+
options=make_request_options(
|
|
204
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
205
|
+
),
|
|
206
|
+
cast_to=ClientProfile,
|
|
207
|
+
)
|
|
208
|
+
|
|
209
|
+
def recreate(
|
|
210
|
+
self,
|
|
211
|
+
id: int,
|
|
212
|
+
*,
|
|
213
|
+
fields: Iterable[profile_recreate_params.Field],
|
|
214
|
+
profile_template: int,
|
|
215
|
+
ip_address: Optional[str] | NotGiven = NOT_GIVEN,
|
|
216
|
+
site: str | NotGiven = NOT_GIVEN,
|
|
217
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
218
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
219
|
+
extra_headers: Headers | None = None,
|
|
220
|
+
extra_query: Query | None = None,
|
|
221
|
+
extra_body: Body | None = None,
|
|
222
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
223
|
+
) -> ClientProfile:
|
|
224
|
+
"""
|
|
225
|
+
Recreate profile with another profile template (for other cases use detail API)
|
|
226
|
+
|
|
227
|
+
Args:
|
|
228
|
+
extra_headers: Send extra headers
|
|
229
|
+
|
|
230
|
+
extra_query: Add additional query parameters to the request
|
|
231
|
+
|
|
232
|
+
extra_body: Add additional JSON properties to the request
|
|
233
|
+
|
|
234
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
235
|
+
"""
|
|
236
|
+
return self._put(
|
|
237
|
+
f"/security/iaas/v2/profiles/{id}/recreate",
|
|
238
|
+
body=maybe_transform(
|
|
239
|
+
{
|
|
240
|
+
"fields": fields,
|
|
241
|
+
"profile_template": profile_template,
|
|
242
|
+
"ip_address": ip_address,
|
|
243
|
+
"site": site,
|
|
244
|
+
},
|
|
245
|
+
profile_recreate_params.ProfileRecreateParams,
|
|
246
|
+
),
|
|
247
|
+
options=make_request_options(
|
|
248
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
249
|
+
),
|
|
250
|
+
cast_to=ClientProfile,
|
|
251
|
+
)
|
|
252
|
+
|
|
253
|
+
def replace(
|
|
254
|
+
self,
|
|
255
|
+
id: int,
|
|
256
|
+
*,
|
|
257
|
+
fields: Iterable[profile_replace_params.Field],
|
|
258
|
+
profile_template: int,
|
|
259
|
+
ip_address: Optional[str] | NotGiven = NOT_GIVEN,
|
|
260
|
+
site: str | NotGiven = NOT_GIVEN,
|
|
261
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
262
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
263
|
+
extra_headers: Headers | None = None,
|
|
264
|
+
extra_query: Query | None = None,
|
|
265
|
+
extra_body: Body | None = None,
|
|
266
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
267
|
+
) -> ClientProfile:
|
|
268
|
+
"""Update profile.
|
|
269
|
+
|
|
270
|
+
Protection policies are updated at the same time as profile
|
|
271
|
+
updated
|
|
272
|
+
|
|
273
|
+
Args:
|
|
274
|
+
extra_headers: Send extra headers
|
|
275
|
+
|
|
276
|
+
extra_query: Add additional query parameters to the request
|
|
277
|
+
|
|
278
|
+
extra_body: Add additional JSON properties to the request
|
|
279
|
+
|
|
280
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
281
|
+
"""
|
|
282
|
+
return self._put(
|
|
283
|
+
f"/security/iaas/v2/profiles/{id}",
|
|
284
|
+
body=maybe_transform(
|
|
285
|
+
{
|
|
286
|
+
"fields": fields,
|
|
287
|
+
"profile_template": profile_template,
|
|
288
|
+
"ip_address": ip_address,
|
|
289
|
+
"site": site,
|
|
290
|
+
},
|
|
291
|
+
profile_replace_params.ProfileReplaceParams,
|
|
292
|
+
),
|
|
293
|
+
options=make_request_options(
|
|
294
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
295
|
+
),
|
|
296
|
+
cast_to=ClientProfile,
|
|
297
|
+
)
|
|
298
|
+
|
|
299
|
+
|
|
300
|
+
class AsyncProfilesResource(AsyncAPIResource):
|
|
301
|
+
@cached_property
|
|
302
|
+
def with_raw_response(self) -> AsyncProfilesResourceWithRawResponse:
|
|
303
|
+
"""
|
|
304
|
+
This property can be used as a prefix for any HTTP method call to return
|
|
305
|
+
the raw response object instead of the parsed content.
|
|
306
|
+
|
|
307
|
+
For more information, see https://www.github.com/G-Core/gcore-python#accessing-raw-response-data-eg-headers
|
|
308
|
+
"""
|
|
309
|
+
return AsyncProfilesResourceWithRawResponse(self)
|
|
310
|
+
|
|
311
|
+
@cached_property
|
|
312
|
+
def with_streaming_response(self) -> AsyncProfilesResourceWithStreamingResponse:
|
|
313
|
+
"""
|
|
314
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
315
|
+
|
|
316
|
+
For more information, see https://www.github.com/G-Core/gcore-python#with_streaming_response
|
|
317
|
+
"""
|
|
318
|
+
return AsyncProfilesResourceWithStreamingResponse(self)
|
|
319
|
+
|
|
320
|
+
async def create(
|
|
321
|
+
self,
|
|
322
|
+
*,
|
|
323
|
+
fields: Iterable[profile_create_params.Field],
|
|
324
|
+
profile_template: int,
|
|
325
|
+
ip_address: Optional[str] | NotGiven = NOT_GIVEN,
|
|
326
|
+
site: str | NotGiven = NOT_GIVEN,
|
|
327
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
328
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
329
|
+
extra_headers: Headers | None = None,
|
|
330
|
+
extra_query: Query | None = None,
|
|
331
|
+
extra_body: Body | None = None,
|
|
332
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
333
|
+
) -> ClientProfile:
|
|
334
|
+
"""Create protection profile.
|
|
335
|
+
|
|
336
|
+
Protection is enabled at the same time as profile is
|
|
337
|
+
created
|
|
338
|
+
|
|
339
|
+
Args:
|
|
340
|
+
extra_headers: Send extra headers
|
|
341
|
+
|
|
342
|
+
extra_query: Add additional query parameters to the request
|
|
343
|
+
|
|
344
|
+
extra_body: Add additional JSON properties to the request
|
|
345
|
+
|
|
346
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
347
|
+
"""
|
|
348
|
+
return await self._post(
|
|
349
|
+
"/security/iaas/v2/profiles",
|
|
350
|
+
body=await async_maybe_transform(
|
|
351
|
+
{
|
|
352
|
+
"fields": fields,
|
|
353
|
+
"profile_template": profile_template,
|
|
354
|
+
"ip_address": ip_address,
|
|
355
|
+
"site": site,
|
|
356
|
+
},
|
|
357
|
+
profile_create_params.ProfileCreateParams,
|
|
358
|
+
),
|
|
359
|
+
options=make_request_options(
|
|
360
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
361
|
+
),
|
|
362
|
+
cast_to=ClientProfile,
|
|
363
|
+
)
|
|
364
|
+
|
|
365
|
+
async def list(
|
|
366
|
+
self,
|
|
367
|
+
*,
|
|
368
|
+
exclude_empty_address: bool | NotGiven = NOT_GIVEN,
|
|
369
|
+
include_deleted: bool | NotGiven = NOT_GIVEN,
|
|
370
|
+
ip_address: str | NotGiven = NOT_GIVEN,
|
|
371
|
+
site: str | NotGiven = NOT_GIVEN,
|
|
372
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
373
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
374
|
+
extra_headers: Headers | None = None,
|
|
375
|
+
extra_query: Query | None = None,
|
|
376
|
+
extra_body: Body | None = None,
|
|
377
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
378
|
+
) -> ProfileListResponse:
|
|
379
|
+
"""Get list of protection profiles.
|
|
380
|
+
|
|
381
|
+
Client receives only profiles created by him
|
|
382
|
+
|
|
383
|
+
Args:
|
|
384
|
+
extra_headers: Send extra headers
|
|
385
|
+
|
|
386
|
+
extra_query: Add additional query parameters to the request
|
|
387
|
+
|
|
388
|
+
extra_body: Add additional JSON properties to the request
|
|
389
|
+
|
|
390
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
391
|
+
"""
|
|
392
|
+
return await self._get(
|
|
393
|
+
"/security/iaas/v2/profiles",
|
|
394
|
+
options=make_request_options(
|
|
395
|
+
extra_headers=extra_headers,
|
|
396
|
+
extra_query=extra_query,
|
|
397
|
+
extra_body=extra_body,
|
|
398
|
+
timeout=timeout,
|
|
399
|
+
query=await async_maybe_transform(
|
|
400
|
+
{
|
|
401
|
+
"exclude_empty_address": exclude_empty_address,
|
|
402
|
+
"include_deleted": include_deleted,
|
|
403
|
+
"ip_address": ip_address,
|
|
404
|
+
"site": site,
|
|
405
|
+
},
|
|
406
|
+
profile_list_params.ProfileListParams,
|
|
407
|
+
),
|
|
408
|
+
),
|
|
409
|
+
cast_to=ProfileListResponse,
|
|
410
|
+
)
|
|
411
|
+
|
|
412
|
+
async def delete(
|
|
413
|
+
self,
|
|
414
|
+
id: int,
|
|
415
|
+
*,
|
|
416
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
417
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
418
|
+
extra_headers: Headers | None = None,
|
|
419
|
+
extra_query: Query | None = None,
|
|
420
|
+
extra_body: Body | None = None,
|
|
421
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
422
|
+
) -> None:
|
|
423
|
+
"""Delete protection profile.
|
|
424
|
+
|
|
425
|
+
Protection is disabled at the same time as profile is
|
|
426
|
+
deleted
|
|
427
|
+
|
|
428
|
+
Args:
|
|
429
|
+
extra_headers: Send extra headers
|
|
430
|
+
|
|
431
|
+
extra_query: Add additional query parameters to the request
|
|
432
|
+
|
|
433
|
+
extra_body: Add additional JSON properties to the request
|
|
434
|
+
|
|
435
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
436
|
+
"""
|
|
437
|
+
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
|
438
|
+
return await self._delete(
|
|
439
|
+
f"/security/iaas/v2/profiles/{id}",
|
|
440
|
+
options=make_request_options(
|
|
441
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
442
|
+
),
|
|
443
|
+
cast_to=NoneType,
|
|
444
|
+
)
|
|
445
|
+
|
|
446
|
+
async def get(
|
|
447
|
+
self,
|
|
448
|
+
id: int,
|
|
449
|
+
*,
|
|
450
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
451
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
452
|
+
extra_headers: Headers | None = None,
|
|
453
|
+
extra_query: Query | None = None,
|
|
454
|
+
extra_body: Body | None = None,
|
|
455
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
456
|
+
) -> ClientProfile:
|
|
457
|
+
"""
|
|
458
|
+
Get profile by id
|
|
459
|
+
|
|
460
|
+
Args:
|
|
461
|
+
extra_headers: Send extra headers
|
|
462
|
+
|
|
463
|
+
extra_query: Add additional query parameters to the request
|
|
464
|
+
|
|
465
|
+
extra_body: Add additional JSON properties to the request
|
|
466
|
+
|
|
467
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
468
|
+
"""
|
|
469
|
+
return await self._get(
|
|
470
|
+
f"/security/iaas/v2/profiles/{id}",
|
|
471
|
+
options=make_request_options(
|
|
472
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
473
|
+
),
|
|
474
|
+
cast_to=ClientProfile,
|
|
475
|
+
)
|
|
476
|
+
|
|
477
|
+
async def recreate(
|
|
478
|
+
self,
|
|
479
|
+
id: int,
|
|
480
|
+
*,
|
|
481
|
+
fields: Iterable[profile_recreate_params.Field],
|
|
482
|
+
profile_template: int,
|
|
483
|
+
ip_address: Optional[str] | NotGiven = NOT_GIVEN,
|
|
484
|
+
site: str | NotGiven = NOT_GIVEN,
|
|
485
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
486
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
487
|
+
extra_headers: Headers | None = None,
|
|
488
|
+
extra_query: Query | None = None,
|
|
489
|
+
extra_body: Body | None = None,
|
|
490
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
491
|
+
) -> ClientProfile:
|
|
492
|
+
"""
|
|
493
|
+
Recreate profile with another profile template (for other cases use detail API)
|
|
494
|
+
|
|
495
|
+
Args:
|
|
496
|
+
extra_headers: Send extra headers
|
|
497
|
+
|
|
498
|
+
extra_query: Add additional query parameters to the request
|
|
499
|
+
|
|
500
|
+
extra_body: Add additional JSON properties to the request
|
|
501
|
+
|
|
502
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
503
|
+
"""
|
|
504
|
+
return await self._put(
|
|
505
|
+
f"/security/iaas/v2/profiles/{id}/recreate",
|
|
506
|
+
body=await async_maybe_transform(
|
|
507
|
+
{
|
|
508
|
+
"fields": fields,
|
|
509
|
+
"profile_template": profile_template,
|
|
510
|
+
"ip_address": ip_address,
|
|
511
|
+
"site": site,
|
|
512
|
+
},
|
|
513
|
+
profile_recreate_params.ProfileRecreateParams,
|
|
514
|
+
),
|
|
515
|
+
options=make_request_options(
|
|
516
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
517
|
+
),
|
|
518
|
+
cast_to=ClientProfile,
|
|
519
|
+
)
|
|
520
|
+
|
|
521
|
+
async def replace(
|
|
522
|
+
self,
|
|
523
|
+
id: int,
|
|
524
|
+
*,
|
|
525
|
+
fields: Iterable[profile_replace_params.Field],
|
|
526
|
+
profile_template: int,
|
|
527
|
+
ip_address: Optional[str] | NotGiven = NOT_GIVEN,
|
|
528
|
+
site: str | NotGiven = NOT_GIVEN,
|
|
529
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
530
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
531
|
+
extra_headers: Headers | None = None,
|
|
532
|
+
extra_query: Query | None = None,
|
|
533
|
+
extra_body: Body | None = None,
|
|
534
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
535
|
+
) -> ClientProfile:
|
|
536
|
+
"""Update profile.
|
|
537
|
+
|
|
538
|
+
Protection policies are updated at the same time as profile
|
|
539
|
+
updated
|
|
540
|
+
|
|
541
|
+
Args:
|
|
542
|
+
extra_headers: Send extra headers
|
|
543
|
+
|
|
544
|
+
extra_query: Add additional query parameters to the request
|
|
545
|
+
|
|
546
|
+
extra_body: Add additional JSON properties to the request
|
|
547
|
+
|
|
548
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
549
|
+
"""
|
|
550
|
+
return await self._put(
|
|
551
|
+
f"/security/iaas/v2/profiles/{id}",
|
|
552
|
+
body=await async_maybe_transform(
|
|
553
|
+
{
|
|
554
|
+
"fields": fields,
|
|
555
|
+
"profile_template": profile_template,
|
|
556
|
+
"ip_address": ip_address,
|
|
557
|
+
"site": site,
|
|
558
|
+
},
|
|
559
|
+
profile_replace_params.ProfileReplaceParams,
|
|
560
|
+
),
|
|
561
|
+
options=make_request_options(
|
|
562
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
563
|
+
),
|
|
564
|
+
cast_to=ClientProfile,
|
|
565
|
+
)
|
|
566
|
+
|
|
567
|
+
|
|
568
|
+
class ProfilesResourceWithRawResponse:
|
|
569
|
+
def __init__(self, profiles: ProfilesResource) -> None:
|
|
570
|
+
self._profiles = profiles
|
|
571
|
+
|
|
572
|
+
self.create = to_raw_response_wrapper(
|
|
573
|
+
profiles.create,
|
|
574
|
+
)
|
|
575
|
+
self.list = to_raw_response_wrapper(
|
|
576
|
+
profiles.list,
|
|
577
|
+
)
|
|
578
|
+
self.delete = to_raw_response_wrapper(
|
|
579
|
+
profiles.delete,
|
|
580
|
+
)
|
|
581
|
+
self.get = to_raw_response_wrapper(
|
|
582
|
+
profiles.get,
|
|
583
|
+
)
|
|
584
|
+
self.recreate = to_raw_response_wrapper(
|
|
585
|
+
profiles.recreate,
|
|
586
|
+
)
|
|
587
|
+
self.replace = to_raw_response_wrapper(
|
|
588
|
+
profiles.replace,
|
|
589
|
+
)
|
|
590
|
+
|
|
591
|
+
|
|
592
|
+
class AsyncProfilesResourceWithRawResponse:
|
|
593
|
+
def __init__(self, profiles: AsyncProfilesResource) -> None:
|
|
594
|
+
self._profiles = profiles
|
|
595
|
+
|
|
596
|
+
self.create = async_to_raw_response_wrapper(
|
|
597
|
+
profiles.create,
|
|
598
|
+
)
|
|
599
|
+
self.list = async_to_raw_response_wrapper(
|
|
600
|
+
profiles.list,
|
|
601
|
+
)
|
|
602
|
+
self.delete = async_to_raw_response_wrapper(
|
|
603
|
+
profiles.delete,
|
|
604
|
+
)
|
|
605
|
+
self.get = async_to_raw_response_wrapper(
|
|
606
|
+
profiles.get,
|
|
607
|
+
)
|
|
608
|
+
self.recreate = async_to_raw_response_wrapper(
|
|
609
|
+
profiles.recreate,
|
|
610
|
+
)
|
|
611
|
+
self.replace = async_to_raw_response_wrapper(
|
|
612
|
+
profiles.replace,
|
|
613
|
+
)
|
|
614
|
+
|
|
615
|
+
|
|
616
|
+
class ProfilesResourceWithStreamingResponse:
|
|
617
|
+
def __init__(self, profiles: ProfilesResource) -> None:
|
|
618
|
+
self._profiles = profiles
|
|
619
|
+
|
|
620
|
+
self.create = to_streamed_response_wrapper(
|
|
621
|
+
profiles.create,
|
|
622
|
+
)
|
|
623
|
+
self.list = to_streamed_response_wrapper(
|
|
624
|
+
profiles.list,
|
|
625
|
+
)
|
|
626
|
+
self.delete = to_streamed_response_wrapper(
|
|
627
|
+
profiles.delete,
|
|
628
|
+
)
|
|
629
|
+
self.get = to_streamed_response_wrapper(
|
|
630
|
+
profiles.get,
|
|
631
|
+
)
|
|
632
|
+
self.recreate = to_streamed_response_wrapper(
|
|
633
|
+
profiles.recreate,
|
|
634
|
+
)
|
|
635
|
+
self.replace = to_streamed_response_wrapper(
|
|
636
|
+
profiles.replace,
|
|
637
|
+
)
|
|
638
|
+
|
|
639
|
+
|
|
640
|
+
class AsyncProfilesResourceWithStreamingResponse:
|
|
641
|
+
def __init__(self, profiles: AsyncProfilesResource) -> None:
|
|
642
|
+
self._profiles = profiles
|
|
643
|
+
|
|
644
|
+
self.create = async_to_streamed_response_wrapper(
|
|
645
|
+
profiles.create,
|
|
646
|
+
)
|
|
647
|
+
self.list = async_to_streamed_response_wrapper(
|
|
648
|
+
profiles.list,
|
|
649
|
+
)
|
|
650
|
+
self.delete = async_to_streamed_response_wrapper(
|
|
651
|
+
profiles.delete,
|
|
652
|
+
)
|
|
653
|
+
self.get = async_to_streamed_response_wrapper(
|
|
654
|
+
profiles.get,
|
|
655
|
+
)
|
|
656
|
+
self.recreate = async_to_streamed_response_wrapper(
|
|
657
|
+
profiles.recreate,
|
|
658
|
+
)
|
|
659
|
+
self.replace = async_to_streamed_response_wrapper(
|
|
660
|
+
profiles.replace,
|
|
661
|
+
)
|