gcore 0.2.0__py3-none-any.whl → 0.3.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.

Files changed (258) hide show
  1. gcore/_base_client.py +22 -2
  2. gcore/_models.py +2 -0
  3. gcore/_types.py +2 -0
  4. gcore/_version.py +1 -1
  5. gcore/resources/cloud/baremetal/flavors.py +2 -2
  6. gcore/resources/cloud/baremetal/images.py +2 -2
  7. gcore/resources/cloud/baremetal/servers.py +46 -52
  8. gcore/resources/cloud/floating_ips.py +4 -4
  9. gcore/resources/cloud/gpu_baremetal_clusters/gpu_baremetal_clusters.py +8 -8
  10. gcore/resources/cloud/gpu_baremetal_clusters/images.py +2 -2
  11. gcore/resources/cloud/gpu_baremetal_clusters/servers.py +4 -4
  12. gcore/resources/cloud/inference/deployments/deployments.py +6 -6
  13. gcore/resources/cloud/instances/flavors.py +2 -2
  14. gcore/resources/cloud/instances/images.py +2 -2
  15. gcore/resources/cloud/instances/instances.py +62 -70
  16. gcore/resources/cloud/instances/interfaces.py +4 -4
  17. gcore/resources/cloud/load_balancers/flavors.py +2 -2
  18. gcore/resources/cloud/load_balancers/l7_policies/l7_policies.py +20 -20
  19. gcore/resources/cloud/load_balancers/listeners.py +14 -14
  20. gcore/resources/cloud/load_balancers/load_balancers.py +28 -24
  21. gcore/resources/cloud/load_balancers/pools/members.py +6 -6
  22. gcore/resources/cloud/networks/networks.py +4 -4
  23. gcore/resources/cloud/networks/subnets.py +6 -6
  24. gcore/resources/cloud/registries/registries.py +6 -10
  25. gcore/resources/cloud/registries/users.py +4 -10
  26. gcore/resources/cloud/reserved_fixed_ips/reserved_fixed_ips.py +10 -10
  27. gcore/resources/cloud/security_groups/security_groups.py +2 -2
  28. gcore/resources/cloud/ssh_keys.py +2 -2
  29. gcore/resources/cloud/tasks.py +98 -90
  30. gcore/resources/cloud/users/role_assignments.py +4 -4
  31. gcore/resources/cloud/volumes.py +18 -18
  32. gcore/resources/waap/__init__.py +98 -0
  33. gcore/resources/waap/advanced_rules.py +135 -0
  34. gcore/resources/waap/clients.py +135 -0
  35. gcore/resources/waap/custom_page_sets.py +805 -0
  36. gcore/resources/waap/domains/__init__.py +140 -0
  37. gcore/resources/waap/domains/advanced_rules.py +876 -0
  38. gcore/resources/waap/domains/analytics/__init__.py +33 -0
  39. gcore/resources/waap/domains/analytics/analytics.py +676 -0
  40. gcore/resources/waap/domains/analytics/requests.py +378 -0
  41. gcore/resources/waap/domains/api_discovery/__init__.py +33 -0
  42. gcore/resources/waap/domains/api_discovery/api_discovery.py +530 -0
  43. gcore/resources/waap/domains/api_discovery/scan_results.py +352 -0
  44. gcore/resources/waap/domains/api_path_groups.py +163 -0
  45. gcore/resources/waap/domains/api_paths.py +771 -0
  46. gcore/resources/waap/domains/custom_rules.py +889 -0
  47. gcore/resources/waap/domains/domains.py +399 -0
  48. gcore/resources/waap/domains/firewall_rules.py +884 -0
  49. gcore/resources/waap/domains/insight_silences.py +689 -0
  50. gcore/resources/waap/domains/insights.py +425 -0
  51. gcore/resources/waap/domains/policies.py +173 -0
  52. gcore/resources/waap/domains/settings.py +5 -5
  53. gcore/resources/waap/ip_info.py +1017 -0
  54. gcore/resources/waap/organizations.py +217 -0
  55. gcore/resources/waap/statistics.py +225 -0
  56. gcore/resources/waap/tags.py +233 -0
  57. gcore/resources/waap/waap.py +289 -0
  58. gcore/types/cloud/allowed_address_pairs.py +2 -2
  59. gcore/types/cloud/baremetal/baremetal_server.py +1 -1
  60. gcore/types/cloud/baremetal/image_list_params.py +1 -1
  61. gcore/types/cloud/baremetal/server_create_params.py +9 -9
  62. gcore/types/cloud/baremetal/server_list_params.py +8 -8
  63. gcore/types/cloud/baremetal/server_rebuild_params.py +1 -1
  64. gcore/types/cloud/baremetal_flavor.py +3 -3
  65. gcore/types/cloud/container_probe_config.py +1 -1
  66. gcore/types/cloud/container_probe_config_create_param.py +1 -1
  67. gcore/types/cloud/container_scale_triggers.py +2 -2
  68. gcore/types/cloud/floating_ip_detailed.py +1 -1
  69. gcore/types/cloud/floating_ip_list_params.py +2 -2
  70. gcore/types/cloud/gpu_baremetal_cluster.py +1 -1
  71. gcore/types/cloud/gpu_baremetal_cluster_create_params.py +2 -2
  72. gcore/types/cloud/gpu_baremetal_cluster_delete_params.py +1 -1
  73. gcore/types/cloud/gpu_baremetal_cluster_rebuild_params.py +1 -1
  74. gcore/types/cloud/gpu_baremetal_cluster_server.py +1 -1
  75. gcore/types/cloud/gpu_baremetal_clusters/image_upload_params.py +1 -1
  76. gcore/types/cloud/gpu_baremetal_clusters/server_attach_interface_params.py +10 -10
  77. gcore/types/cloud/gpu_baremetal_flavor.py +3 -3
  78. gcore/types/cloud/image.py +1 -1
  79. gcore/types/cloud/inference/deployment_create_params.py +4 -4
  80. gcore/types/cloud/inference/deployment_update_params.py +6 -6
  81. gcore/types/cloud/inference/inference.py +2 -4
  82. gcore/types/cloud/instance.py +1 -1
  83. gcore/types/cloud/instance_create_params.py +8 -10
  84. gcore/types/cloud/instance_list_params.py +8 -8
  85. gcore/types/cloud/instances/flavor_list_suitable_params.py +4 -1
  86. gcore/types/cloud/instances/image_list_params.py +1 -1
  87. gcore/types/cloud/instances/instance_flavor.py +3 -3
  88. gcore/types/cloud/instances/interface_attach_params.py +10 -10
  89. gcore/types/cloud/load_balancer_create_params.py +17 -15
  90. gcore/types/cloud/load_balancer_flavor_detail.py +3 -3
  91. gcore/types/cloud/load_balancer_l7_policy.py +5 -5
  92. gcore/types/cloud/load_balancer_list_params.py +5 -5
  93. gcore/types/cloud/load_balancer_listener_detail.py +4 -4
  94. gcore/types/cloud/load_balancers/l7_policy_create_params.py +5 -5
  95. gcore/types/cloud/load_balancers/l7_policy_replace_params.py +5 -5
  96. gcore/types/cloud/load_balancers/listener_create_params.py +4 -4
  97. gcore/types/cloud/load_balancers/listener_update_params.py +3 -3
  98. gcore/types/cloud/load_balancers/pool_create_params.py +4 -4
  99. gcore/types/cloud/load_balancers/pool_update_params.py +4 -4
  100. gcore/types/cloud/load_balancers/pools/member_add_params.py +3 -3
  101. gcore/types/cloud/member.py +2 -2
  102. gcore/types/cloud/network.py +2 -2
  103. gcore/types/cloud/network_details.py +2 -2
  104. gcore/types/cloud/network_list_params.py +2 -2
  105. gcore/types/cloud/networks/subnet_create_params.py +1 -1
  106. gcore/types/cloud/networks/subnet_list_params.py +2 -2
  107. gcore/types/cloud/region.py +4 -4
  108. gcore/types/cloud/registries/user_create_multiple_params.py +3 -5
  109. gcore/types/cloud/registries/user_create_params.py +3 -5
  110. gcore/types/cloud/registry_create_params.py +3 -5
  111. gcore/types/cloud/reserved_fixed_ip_create_params.py +2 -2
  112. gcore/types/cloud/reserved_fixed_ip_list_params.py +3 -3
  113. gcore/types/cloud/security_group_list_params.py +1 -1
  114. gcore/types/cloud/session_persistence.py +1 -1
  115. gcore/types/cloud/ssh_key_created.py +3 -6
  116. gcore/types/cloud/task.py +1 -1
  117. gcore/types/cloud/task_list_params.py +49 -45
  118. gcore/types/cloud/users/role_assignment_create_params.py +1 -1
  119. gcore/types/cloud/users/role_assignment_update_params.py +1 -1
  120. gcore/types/cloud/volume_create_params.py +6 -6
  121. gcore/types/cloud/volume_list_params.py +3 -3
  122. gcore/types/waap/__init__.py +98 -2
  123. gcore/types/waap/client_me_response.py +34 -0
  124. gcore/types/waap/custom_page_set_create_params.py +35 -0
  125. gcore/types/waap/custom_page_set_list_params.py +25 -0
  126. gcore/types/waap/custom_page_set_preview_params.py +34 -0
  127. gcore/types/waap/custom_page_set_update_params.py +35 -0
  128. gcore/types/waap/domain_list_rule_sets_response.py +10 -0
  129. gcore/types/waap/domains/__init__.py +42 -0
  130. gcore/types/waap/domains/advanced_rule_create_params.py +80 -0
  131. gcore/types/waap/domains/advanced_rule_list_params.py +58 -0
  132. gcore/types/waap/domains/advanced_rule_update_params.py +83 -0
  133. gcore/types/waap/domains/analytics/__init__.py +5 -0
  134. gcore/types/waap/domains/analytics/request_list_params.py +53 -0
  135. gcore/types/waap/domains/analytics_get_event_statistics_params.py +34 -0
  136. gcore/types/waap/domains/analytics_list_ddos_attacks_params.py +28 -0
  137. gcore/types/waap/domains/analytics_list_ddos_info_params.py +31 -0
  138. gcore/types/waap/domains/analytics_list_event_traffic_params.py +26 -0
  139. gcore/types/waap/domains/analytics_list_event_traffic_response.py +10 -0
  140. gcore/types/waap/domains/api_discovery/__init__.py +7 -0
  141. gcore/types/waap/domains/api_discovery/scan_result_get_response.py +29 -0
  142. gcore/types/waap/domains/api_discovery/scan_result_list_params.py +41 -0
  143. gcore/types/waap/domains/api_discovery/scan_result_list_response.py +29 -0
  144. gcore/types/waap/domains/api_discovery_get_settings_response.py +36 -0
  145. gcore/types/waap/domains/api_discovery_scan_openapi_response.py +10 -0
  146. gcore/types/waap/domains/api_discovery_update_settings_params.py +34 -0
  147. gcore/types/waap/domains/api_discovery_update_settings_response.py +36 -0
  148. gcore/types/waap/domains/api_discovery_upload_openapi_params.py +19 -0
  149. gcore/types/waap/domains/api_discovery_upload_openapi_response.py +10 -0
  150. gcore/types/waap/domains/api_path_create_params.py +31 -0
  151. gcore/types/waap/domains/api_path_create_response.py +50 -0
  152. gcore/types/waap/domains/api_path_get_response.py +50 -0
  153. gcore/types/waap/domains/api_path_group_list_response.py +12 -0
  154. gcore/types/waap/domains/api_path_list_params.py +62 -0
  155. gcore/types/waap/domains/api_path_list_response.py +50 -0
  156. gcore/types/waap/domains/api_path_update_params.py +29 -0
  157. gcore/types/waap/domains/custom_rule_create_params.py +368 -0
  158. gcore/types/waap/domains/custom_rule_delete_multiple_params.py +13 -0
  159. gcore/types/waap/domains/custom_rule_list_params.py +35 -0
  160. gcore/types/waap/domains/custom_rule_update_params.py +371 -0
  161. gcore/types/waap/domains/firewall_rule_create_params.py +75 -0
  162. gcore/types/waap/domains/firewall_rule_delete_multiple_params.py +13 -0
  163. gcore/types/waap/domains/firewall_rule_list_params.py +33 -0
  164. gcore/types/waap/domains/firewall_rule_update_params.py +78 -0
  165. gcore/types/waap/domains/insight_list_params.py +34 -0
  166. gcore/types/waap/domains/insight_replace_params.py +17 -0
  167. gcore/types/waap/domains/insight_silence_create_params.py +28 -0
  168. gcore/types/waap/domains/insight_silence_list_params.py +33 -0
  169. gcore/types/waap/domains/insight_silence_update_params.py +28 -0
  170. gcore/types/waap/domains/setting_update_params.py +7 -0
  171. gcore/types/waap/ip_info_get_attack_time_series_params.py +12 -0
  172. gcore/types/waap/ip_info_get_attack_time_series_response.py +10 -0
  173. gcore/types/waap/ip_info_get_blocked_requests_params.py +15 -0
  174. gcore/types/waap/ip_info_get_blocked_requests_response.py +10 -0
  175. gcore/types/waap/ip_info_get_counts_params.py +19 -0
  176. gcore/types/waap/ip_info_get_ddos_attack_series_params.py +12 -0
  177. gcore/types/waap/ip_info_get_params.py +12 -0
  178. gcore/types/waap/ip_info_get_top_sessions_params.py +15 -0
  179. gcore/types/waap/ip_info_get_top_sessions_response.py +10 -0
  180. gcore/types/waap/ip_info_get_top_urls_params.py +15 -0
  181. gcore/types/waap/ip_info_get_top_urls_response.py +10 -0
  182. gcore/types/waap/ip_info_get_top_user_agents_params.py +15 -0
  183. gcore/types/waap/ip_info_get_top_user_agents_response.py +10 -0
  184. gcore/types/waap/ip_info_list_attacked_countries_params.py +12 -0
  185. gcore/types/waap/ip_info_list_attacked_countries_response.py +10 -0
  186. gcore/types/waap/organization_list_params.py +22 -0
  187. gcore/types/waap/statistic_get_usage_series_params.py +25 -0
  188. gcore/types/waap/tag_list_params.py +28 -0
  189. gcore/types/waap/waap_advanced_rule.py +83 -0
  190. gcore/types/waap/waap_advanced_rule_descriptor.py +49 -0
  191. gcore/types/waap/waap_advanced_rule_descriptor_list.py +15 -0
  192. gcore/types/waap/waap_block_csrf_page_data.py +28 -0
  193. gcore/types/waap/waap_block_csrf_page_data_param.py +28 -0
  194. gcore/types/waap/waap_block_page_data.py +28 -0
  195. gcore/types/waap/waap_block_page_data_param.py +28 -0
  196. gcore/types/waap/waap_blocked_statistics.py +36 -0
  197. gcore/types/waap/waap_captcha_page_data.py +31 -0
  198. gcore/types/waap/waap_captcha_page_data_param.py +31 -0
  199. gcore/types/waap/waap_common_tag.py +16 -0
  200. gcore/types/waap/waap_cookie_disabled_page_data.py +18 -0
  201. gcore/types/waap/waap_cookie_disabled_page_data_param.py +18 -0
  202. gcore/types/waap/waap_count_statistics.py +36 -0
  203. gcore/types/waap/waap_custom_page_preview.py +10 -0
  204. gcore/types/waap/waap_custom_page_set.py +36 -0
  205. gcore/types/waap/waap_custom_rule.py +373 -0
  206. gcore/types/waap/waap_customer_rule_state.py +7 -0
  207. gcore/types/waap/waap_ddos_attack.py +16 -0
  208. gcore/types/waap/waap_ddos_info.py +17 -0
  209. gcore/types/waap/{waap_api_urls.py → waap_domain_api_settings.py} +9 -2
  210. gcore/types/waap/waap_domain_policy.py +29 -0
  211. gcore/types/waap/{waap_domain_settings.py → waap_domain_settings_model.py} +4 -4
  212. gcore/types/waap/waap_event_statistics.py +15 -0
  213. gcore/types/waap/waap_firewall_rule.py +78 -0
  214. gcore/types/waap/waap_get_account_overview_response.py +34 -0
  215. gcore/types/waap/waap_handshake_page_data.py +25 -0
  216. gcore/types/waap/waap_handshake_page_data_param.py +25 -0
  217. gcore/types/waap/waap_insight.py +38 -0
  218. gcore/types/waap/waap_insight_silence.py +28 -0
  219. gcore/types/waap/waap_insight_silence_sort_by.py +9 -0
  220. gcore/types/waap/waap_insight_sort_by.py +20 -0
  221. gcore/types/waap/waap_insight_status.py +7 -0
  222. gcore/types/waap/waap_ip_country_attack.py +16 -0
  223. gcore/types/waap/waap_ip_ddos_info_model.py +23 -0
  224. gcore/types/waap/waap_ip_info.py +57 -0
  225. gcore/types/waap/waap_ip_info_counts.py +16 -0
  226. gcore/types/waap/waap_javascript_disabled_page_data.py +18 -0
  227. gcore/types/waap/waap_javascript_disabled_page_data_param.py +18 -0
  228. gcore/types/waap/waap_network_details.py +17 -0
  229. gcore/types/waap/waap_organization.py +13 -0
  230. gcore/types/waap/waap_page_type.py +9 -0
  231. gcore/types/waap/waap_paginated_custom_page_set.py +22 -0
  232. gcore/types/waap/waap_paginated_ddos_attack.py +22 -0
  233. gcore/types/waap/waap_paginated_ddos_info.py +22 -0
  234. gcore/types/waap/waap_paginated_request_summary.py +22 -0
  235. gcore/types/waap/waap_pattern_matched_tag.py +37 -0
  236. gcore/types/waap/waap_policy_action.py +7 -0
  237. gcore/types/waap/waap_policy_mode.py +10 -0
  238. gcore/types/waap/waap_request_details.py +92 -0
  239. gcore/types/waap/waap_request_organization.py +13 -0
  240. gcore/types/waap/waap_request_summary.py +59 -0
  241. gcore/types/waap/waap_resolution.py +7 -0
  242. gcore/types/waap/waap_rule_action_type.py +7 -0
  243. gcore/types/waap/waap_rule_blocked_requests.py +16 -0
  244. gcore/types/waap/waap_rule_set.py +41 -0
  245. gcore/types/waap/waap_statistic_item.py +18 -0
  246. gcore/types/waap/waap_statistics_series.py +16 -0
  247. gcore/types/waap/waap_tag.py +16 -0
  248. gcore/types/waap/waap_time_series_attack.py +23 -0
  249. gcore/types/waap/waap_top_session.py +24 -0
  250. gcore/types/waap/waap_top_url.py +13 -0
  251. gcore/types/waap/waap_top_user_agent.py +13 -0
  252. gcore/types/waap/waap_traffic_metrics.py +68 -0
  253. gcore/types/waap/waap_traffic_type.py +28 -0
  254. gcore/types/waap/waap_user_agent_details.py +40 -0
  255. {gcore-0.2.0.dist-info → gcore-0.3.0.dist-info}/METADATA +1 -1
  256. {gcore-0.2.0.dist-info → gcore-0.3.0.dist-info}/RECORD +258 -109
  257. {gcore-0.2.0.dist-info → gcore-0.3.0.dist-info}/WHEEL +0 -0
  258. {gcore-0.2.0.dist-info → gcore-0.3.0.dist-info}/licenses/LICENSE +0 -0
@@ -0,0 +1,530 @@
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
+
7
+ import httpx
8
+
9
+ from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven
10
+ from ....._utils import maybe_transform, async_maybe_transform
11
+ from ....._compat import cached_property
12
+ from .scan_results import (
13
+ ScanResultsResource,
14
+ AsyncScanResultsResource,
15
+ ScanResultsResourceWithRawResponse,
16
+ AsyncScanResultsResourceWithRawResponse,
17
+ ScanResultsResourceWithStreamingResponse,
18
+ AsyncScanResultsResourceWithStreamingResponse,
19
+ )
20
+ from ....._resource import SyncAPIResource, AsyncAPIResource
21
+ from ....._response import (
22
+ to_raw_response_wrapper,
23
+ to_streamed_response_wrapper,
24
+ async_to_raw_response_wrapper,
25
+ async_to_streamed_response_wrapper,
26
+ )
27
+ from ....._base_client import make_request_options
28
+ from .....types.waap.domains import api_discovery_upload_openapi_params, api_discovery_update_settings_params
29
+ from .....types.waap.domains.api_discovery_get_settings_response import APIDiscoveryGetSettingsResponse
30
+ from .....types.waap.domains.api_discovery_scan_openapi_response import APIDiscoveryScanOpenAPIResponse
31
+ from .....types.waap.domains.api_discovery_upload_openapi_response import APIDiscoveryUploadOpenAPIResponse
32
+ from .....types.waap.domains.api_discovery_update_settings_response import APIDiscoveryUpdateSettingsResponse
33
+
34
+ __all__ = ["APIDiscoveryResource", "AsyncAPIDiscoveryResource"]
35
+
36
+
37
+ class APIDiscoveryResource(SyncAPIResource):
38
+ @cached_property
39
+ def scan_results(self) -> ScanResultsResource:
40
+ return ScanResultsResource(self._client)
41
+
42
+ @cached_property
43
+ def with_raw_response(self) -> APIDiscoveryResourceWithRawResponse:
44
+ """
45
+ This property can be used as a prefix for any HTTP method call to return
46
+ the raw response object instead of the parsed content.
47
+
48
+ For more information, see https://www.github.com/G-Core/gcore-python#accessing-raw-response-data-eg-headers
49
+ """
50
+ return APIDiscoveryResourceWithRawResponse(self)
51
+
52
+ @cached_property
53
+ def with_streaming_response(self) -> APIDiscoveryResourceWithStreamingResponse:
54
+ """
55
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
56
+
57
+ For more information, see https://www.github.com/G-Core/gcore-python#with_streaming_response
58
+ """
59
+ return APIDiscoveryResourceWithStreamingResponse(self)
60
+
61
+ def get_settings(
62
+ self,
63
+ domain_id: int,
64
+ *,
65
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
66
+ # The extra values given here take precedence over values defined on the client or passed to this method.
67
+ extra_headers: Headers | None = None,
68
+ extra_query: Query | None = None,
69
+ extra_body: Body | None = None,
70
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
71
+ ) -> APIDiscoveryGetSettingsResponse:
72
+ """
73
+ Retrieve the API discovery settings for a domain
74
+
75
+ Args:
76
+ domain_id: The domain ID
77
+
78
+ extra_headers: Send extra headers
79
+
80
+ extra_query: Add additional query parameters to the request
81
+
82
+ extra_body: Add additional JSON properties to the request
83
+
84
+ timeout: Override the client-level default timeout for this request, in seconds
85
+ """
86
+ return self._get(
87
+ f"/waap/v1/domains/{domain_id}/api-discovery/settings",
88
+ options=make_request_options(
89
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
90
+ ),
91
+ cast_to=APIDiscoveryGetSettingsResponse,
92
+ )
93
+
94
+ def scan_openapi(
95
+ self,
96
+ domain_id: int,
97
+ *,
98
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
99
+ # The extra values given here take precedence over values defined on the client or passed to this method.
100
+ extra_headers: Headers | None = None,
101
+ extra_query: Query | None = None,
102
+ extra_body: Body | None = None,
103
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
104
+ ) -> APIDiscoveryScanOpenAPIResponse:
105
+ """Scan an API description file hosted online.
106
+
107
+ The file must be in YAML or JSON
108
+ format and adhere to the OpenAPI specification. The location of the API
109
+ description file should be specified in the API discovery settings.
110
+
111
+ Args:
112
+ domain_id: The domain ID
113
+
114
+ extra_headers: Send extra headers
115
+
116
+ extra_query: Add additional query parameters to the request
117
+
118
+ extra_body: Add additional JSON properties to the request
119
+
120
+ timeout: Override the client-level default timeout for this request, in seconds
121
+ """
122
+ return self._post(
123
+ f"/waap/v1/domains/{domain_id}/api-discovery/scan",
124
+ options=make_request_options(
125
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
126
+ ),
127
+ cast_to=APIDiscoveryScanOpenAPIResponse,
128
+ )
129
+
130
+ def update_settings(
131
+ self,
132
+ domain_id: int,
133
+ *,
134
+ description_file_location: Optional[str] | NotGiven = NOT_GIVEN,
135
+ description_file_scan_enabled: Optional[bool] | NotGiven = NOT_GIVEN,
136
+ description_file_scan_interval_hours: Optional[int] | NotGiven = NOT_GIVEN,
137
+ traffic_scan_enabled: Optional[bool] | NotGiven = NOT_GIVEN,
138
+ traffic_scan_interval_hours: Optional[int] | NotGiven = NOT_GIVEN,
139
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
140
+ # The extra values given here take precedence over values defined on the client or passed to this method.
141
+ extra_headers: Headers | None = None,
142
+ extra_query: Query | None = None,
143
+ extra_body: Body | None = None,
144
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
145
+ ) -> APIDiscoveryUpdateSettingsResponse:
146
+ """
147
+ Update the API discovery settings for a domain
148
+
149
+ Args:
150
+ domain_id: The domain ID
151
+
152
+ description_file_location: The URL of the API description file. This will be periodically scanned if
153
+ `descriptionFileScanEnabled` is enabled. Supported formats are YAML and JSON,
154
+ and it must adhere to OpenAPI versions 2, 3, or 3.1.
155
+
156
+ description_file_scan_enabled: Indicates if periodic scan of the description file is enabled
157
+
158
+ description_file_scan_interval_hours: The interval in hours for scanning the description file
159
+
160
+ traffic_scan_enabled: Indicates if traffic scan is enabled
161
+
162
+ traffic_scan_interval_hours: The interval in hours for scanning the traffic
163
+
164
+ extra_headers: Send extra headers
165
+
166
+ extra_query: Add additional query parameters to the request
167
+
168
+ extra_body: Add additional JSON properties to the request
169
+
170
+ timeout: Override the client-level default timeout for this request, in seconds
171
+ """
172
+ return self._patch(
173
+ f"/waap/v1/domains/{domain_id}/api-discovery/settings",
174
+ body=maybe_transform(
175
+ {
176
+ "description_file_location": description_file_location,
177
+ "description_file_scan_enabled": description_file_scan_enabled,
178
+ "description_file_scan_interval_hours": description_file_scan_interval_hours,
179
+ "traffic_scan_enabled": traffic_scan_enabled,
180
+ "traffic_scan_interval_hours": traffic_scan_interval_hours,
181
+ },
182
+ api_discovery_update_settings_params.APIDiscoveryUpdateSettingsParams,
183
+ ),
184
+ options=make_request_options(
185
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
186
+ ),
187
+ cast_to=APIDiscoveryUpdateSettingsResponse,
188
+ )
189
+
190
+ def upload_openapi(
191
+ self,
192
+ domain_id: int,
193
+ *,
194
+ file_data: str,
195
+ file_name: str,
196
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
197
+ # The extra values given here take precedence over values defined on the client or passed to this method.
198
+ extra_headers: Headers | None = None,
199
+ extra_query: Query | None = None,
200
+ extra_body: Body | None = None,
201
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
202
+ ) -> APIDiscoveryUploadOpenAPIResponse:
203
+ """
204
+ An API description file must adhere to the OpenAPI specification and be written
205
+ in YAML or JSON format. The file name should be provided as the value for the
206
+ `file_name` parameter. The contents of the file must be base64 encoded and
207
+ supplied as the value for the `file_data` parameter.
208
+
209
+ Args:
210
+ domain_id: The domain ID
211
+
212
+ file_data: Base64 representation of the description file. Supported formats are YAML and
213
+ JSON, and it must adhere to OpenAPI versions 2, 3, or 3.1.
214
+
215
+ file_name: The name of the file
216
+
217
+ extra_headers: Send extra headers
218
+
219
+ extra_query: Add additional query parameters to the request
220
+
221
+ extra_body: Add additional JSON properties to the request
222
+
223
+ timeout: Override the client-level default timeout for this request, in seconds
224
+ """
225
+ return self._post(
226
+ f"/waap/v1/domains/{domain_id}/api-discovery/upload",
227
+ body=maybe_transform(
228
+ {
229
+ "file_data": file_data,
230
+ "file_name": file_name,
231
+ },
232
+ api_discovery_upload_openapi_params.APIDiscoveryUploadOpenAPIParams,
233
+ ),
234
+ options=make_request_options(
235
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
236
+ ),
237
+ cast_to=APIDiscoveryUploadOpenAPIResponse,
238
+ )
239
+
240
+
241
+ class AsyncAPIDiscoveryResource(AsyncAPIResource):
242
+ @cached_property
243
+ def scan_results(self) -> AsyncScanResultsResource:
244
+ return AsyncScanResultsResource(self._client)
245
+
246
+ @cached_property
247
+ def with_raw_response(self) -> AsyncAPIDiscoveryResourceWithRawResponse:
248
+ """
249
+ This property can be used as a prefix for any HTTP method call to return
250
+ the raw response object instead of the parsed content.
251
+
252
+ For more information, see https://www.github.com/G-Core/gcore-python#accessing-raw-response-data-eg-headers
253
+ """
254
+ return AsyncAPIDiscoveryResourceWithRawResponse(self)
255
+
256
+ @cached_property
257
+ def with_streaming_response(self) -> AsyncAPIDiscoveryResourceWithStreamingResponse:
258
+ """
259
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
260
+
261
+ For more information, see https://www.github.com/G-Core/gcore-python#with_streaming_response
262
+ """
263
+ return AsyncAPIDiscoveryResourceWithStreamingResponse(self)
264
+
265
+ async def get_settings(
266
+ self,
267
+ domain_id: int,
268
+ *,
269
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
270
+ # The extra values given here take precedence over values defined on the client or passed to this method.
271
+ extra_headers: Headers | None = None,
272
+ extra_query: Query | None = None,
273
+ extra_body: Body | None = None,
274
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
275
+ ) -> APIDiscoveryGetSettingsResponse:
276
+ """
277
+ Retrieve the API discovery settings for a domain
278
+
279
+ Args:
280
+ domain_id: The domain ID
281
+
282
+ extra_headers: Send extra headers
283
+
284
+ extra_query: Add additional query parameters to the request
285
+
286
+ extra_body: Add additional JSON properties to the request
287
+
288
+ timeout: Override the client-level default timeout for this request, in seconds
289
+ """
290
+ return await self._get(
291
+ f"/waap/v1/domains/{domain_id}/api-discovery/settings",
292
+ options=make_request_options(
293
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
294
+ ),
295
+ cast_to=APIDiscoveryGetSettingsResponse,
296
+ )
297
+
298
+ async def scan_openapi(
299
+ self,
300
+ domain_id: int,
301
+ *,
302
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
303
+ # The extra values given here take precedence over values defined on the client or passed to this method.
304
+ extra_headers: Headers | None = None,
305
+ extra_query: Query | None = None,
306
+ extra_body: Body | None = None,
307
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
308
+ ) -> APIDiscoveryScanOpenAPIResponse:
309
+ """Scan an API description file hosted online.
310
+
311
+ The file must be in YAML or JSON
312
+ format and adhere to the OpenAPI specification. The location of the API
313
+ description file should be specified in the API discovery settings.
314
+
315
+ Args:
316
+ domain_id: The domain ID
317
+
318
+ extra_headers: Send extra headers
319
+
320
+ extra_query: Add additional query parameters to the request
321
+
322
+ extra_body: Add additional JSON properties to the request
323
+
324
+ timeout: Override the client-level default timeout for this request, in seconds
325
+ """
326
+ return await self._post(
327
+ f"/waap/v1/domains/{domain_id}/api-discovery/scan",
328
+ options=make_request_options(
329
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
330
+ ),
331
+ cast_to=APIDiscoveryScanOpenAPIResponse,
332
+ )
333
+
334
+ async def update_settings(
335
+ self,
336
+ domain_id: int,
337
+ *,
338
+ description_file_location: Optional[str] | NotGiven = NOT_GIVEN,
339
+ description_file_scan_enabled: Optional[bool] | NotGiven = NOT_GIVEN,
340
+ description_file_scan_interval_hours: Optional[int] | NotGiven = NOT_GIVEN,
341
+ traffic_scan_enabled: Optional[bool] | NotGiven = NOT_GIVEN,
342
+ traffic_scan_interval_hours: Optional[int] | NotGiven = NOT_GIVEN,
343
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
344
+ # The extra values given here take precedence over values defined on the client or passed to this method.
345
+ extra_headers: Headers | None = None,
346
+ extra_query: Query | None = None,
347
+ extra_body: Body | None = None,
348
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
349
+ ) -> APIDiscoveryUpdateSettingsResponse:
350
+ """
351
+ Update the API discovery settings for a domain
352
+
353
+ Args:
354
+ domain_id: The domain ID
355
+
356
+ description_file_location: The URL of the API description file. This will be periodically scanned if
357
+ `descriptionFileScanEnabled` is enabled. Supported formats are YAML and JSON,
358
+ and it must adhere to OpenAPI versions 2, 3, or 3.1.
359
+
360
+ description_file_scan_enabled: Indicates if periodic scan of the description file is enabled
361
+
362
+ description_file_scan_interval_hours: The interval in hours for scanning the description file
363
+
364
+ traffic_scan_enabled: Indicates if traffic scan is enabled
365
+
366
+ traffic_scan_interval_hours: The interval in hours for scanning the traffic
367
+
368
+ extra_headers: Send extra headers
369
+
370
+ extra_query: Add additional query parameters to the request
371
+
372
+ extra_body: Add additional JSON properties to the request
373
+
374
+ timeout: Override the client-level default timeout for this request, in seconds
375
+ """
376
+ return await self._patch(
377
+ f"/waap/v1/domains/{domain_id}/api-discovery/settings",
378
+ body=await async_maybe_transform(
379
+ {
380
+ "description_file_location": description_file_location,
381
+ "description_file_scan_enabled": description_file_scan_enabled,
382
+ "description_file_scan_interval_hours": description_file_scan_interval_hours,
383
+ "traffic_scan_enabled": traffic_scan_enabled,
384
+ "traffic_scan_interval_hours": traffic_scan_interval_hours,
385
+ },
386
+ api_discovery_update_settings_params.APIDiscoveryUpdateSettingsParams,
387
+ ),
388
+ options=make_request_options(
389
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
390
+ ),
391
+ cast_to=APIDiscoveryUpdateSettingsResponse,
392
+ )
393
+
394
+ async def upload_openapi(
395
+ self,
396
+ domain_id: int,
397
+ *,
398
+ file_data: str,
399
+ file_name: str,
400
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
401
+ # The extra values given here take precedence over values defined on the client or passed to this method.
402
+ extra_headers: Headers | None = None,
403
+ extra_query: Query | None = None,
404
+ extra_body: Body | None = None,
405
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
406
+ ) -> APIDiscoveryUploadOpenAPIResponse:
407
+ """
408
+ An API description file must adhere to the OpenAPI specification and be written
409
+ in YAML or JSON format. The file name should be provided as the value for the
410
+ `file_name` parameter. The contents of the file must be base64 encoded and
411
+ supplied as the value for the `file_data` parameter.
412
+
413
+ Args:
414
+ domain_id: The domain ID
415
+
416
+ file_data: Base64 representation of the description file. Supported formats are YAML and
417
+ JSON, and it must adhere to OpenAPI versions 2, 3, or 3.1.
418
+
419
+ file_name: The name of the file
420
+
421
+ extra_headers: Send extra headers
422
+
423
+ extra_query: Add additional query parameters to the request
424
+
425
+ extra_body: Add additional JSON properties to the request
426
+
427
+ timeout: Override the client-level default timeout for this request, in seconds
428
+ """
429
+ return await self._post(
430
+ f"/waap/v1/domains/{domain_id}/api-discovery/upload",
431
+ body=await async_maybe_transform(
432
+ {
433
+ "file_data": file_data,
434
+ "file_name": file_name,
435
+ },
436
+ api_discovery_upload_openapi_params.APIDiscoveryUploadOpenAPIParams,
437
+ ),
438
+ options=make_request_options(
439
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
440
+ ),
441
+ cast_to=APIDiscoveryUploadOpenAPIResponse,
442
+ )
443
+
444
+
445
+ class APIDiscoveryResourceWithRawResponse:
446
+ def __init__(self, api_discovery: APIDiscoveryResource) -> None:
447
+ self._api_discovery = api_discovery
448
+
449
+ self.get_settings = to_raw_response_wrapper(
450
+ api_discovery.get_settings,
451
+ )
452
+ self.scan_openapi = to_raw_response_wrapper(
453
+ api_discovery.scan_openapi,
454
+ )
455
+ self.update_settings = to_raw_response_wrapper(
456
+ api_discovery.update_settings,
457
+ )
458
+ self.upload_openapi = to_raw_response_wrapper(
459
+ api_discovery.upload_openapi,
460
+ )
461
+
462
+ @cached_property
463
+ def scan_results(self) -> ScanResultsResourceWithRawResponse:
464
+ return ScanResultsResourceWithRawResponse(self._api_discovery.scan_results)
465
+
466
+
467
+ class AsyncAPIDiscoveryResourceWithRawResponse:
468
+ def __init__(self, api_discovery: AsyncAPIDiscoveryResource) -> None:
469
+ self._api_discovery = api_discovery
470
+
471
+ self.get_settings = async_to_raw_response_wrapper(
472
+ api_discovery.get_settings,
473
+ )
474
+ self.scan_openapi = async_to_raw_response_wrapper(
475
+ api_discovery.scan_openapi,
476
+ )
477
+ self.update_settings = async_to_raw_response_wrapper(
478
+ api_discovery.update_settings,
479
+ )
480
+ self.upload_openapi = async_to_raw_response_wrapper(
481
+ api_discovery.upload_openapi,
482
+ )
483
+
484
+ @cached_property
485
+ def scan_results(self) -> AsyncScanResultsResourceWithRawResponse:
486
+ return AsyncScanResultsResourceWithRawResponse(self._api_discovery.scan_results)
487
+
488
+
489
+ class APIDiscoveryResourceWithStreamingResponse:
490
+ def __init__(self, api_discovery: APIDiscoveryResource) -> None:
491
+ self._api_discovery = api_discovery
492
+
493
+ self.get_settings = to_streamed_response_wrapper(
494
+ api_discovery.get_settings,
495
+ )
496
+ self.scan_openapi = to_streamed_response_wrapper(
497
+ api_discovery.scan_openapi,
498
+ )
499
+ self.update_settings = to_streamed_response_wrapper(
500
+ api_discovery.update_settings,
501
+ )
502
+ self.upload_openapi = to_streamed_response_wrapper(
503
+ api_discovery.upload_openapi,
504
+ )
505
+
506
+ @cached_property
507
+ def scan_results(self) -> ScanResultsResourceWithStreamingResponse:
508
+ return ScanResultsResourceWithStreamingResponse(self._api_discovery.scan_results)
509
+
510
+
511
+ class AsyncAPIDiscoveryResourceWithStreamingResponse:
512
+ def __init__(self, api_discovery: AsyncAPIDiscoveryResource) -> None:
513
+ self._api_discovery = api_discovery
514
+
515
+ self.get_settings = async_to_streamed_response_wrapper(
516
+ api_discovery.get_settings,
517
+ )
518
+ self.scan_openapi = async_to_streamed_response_wrapper(
519
+ api_discovery.scan_openapi,
520
+ )
521
+ self.update_settings = async_to_streamed_response_wrapper(
522
+ api_discovery.update_settings,
523
+ )
524
+ self.upload_openapi = async_to_streamed_response_wrapper(
525
+ api_discovery.upload_openapi,
526
+ )
527
+
528
+ @cached_property
529
+ def scan_results(self) -> AsyncScanResultsResourceWithStreamingResponse:
530
+ return AsyncScanResultsResourceWithStreamingResponse(self._api_discovery.scan_results)