gcore 0.2.0__py3-none-any.whl → 0.4.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/__init__.py +2 -1
- gcore/_base_client.py +44 -2
- gcore/_client.py +9 -0
- gcore/_models.py +2 -0
- gcore/_types.py +2 -0
- gcore/_version.py +1 -1
- gcore/pagination.py +61 -1
- gcore/resources/__init__.py +14 -0
- gcore/resources/cloud/baremetal/flavors.py +11 -137
- gcore/resources/cloud/baremetal/images.py +10 -12
- gcore/resources/cloud/baremetal/servers.py +75 -78
- gcore/resources/cloud/billing_reservations.py +2 -2
- gcore/resources/cloud/file_shares/file_shares.py +7 -8
- gcore/resources/cloud/floating_ips.py +9 -14
- gcore/resources/cloud/gpu_baremetal_clusters/gpu_baremetal_clusters.py +39 -28
- gcore/resources/cloud/gpu_baremetal_clusters/images.py +11 -12
- gcore/resources/cloud/gpu_baremetal_clusters/interfaces.py +2 -2
- gcore/resources/cloud/gpu_baremetal_clusters/servers.py +12 -8
- gcore/resources/cloud/inference/deployments/deployments.py +16 -8
- gcore/resources/cloud/inference/registry_credentials.py +2 -2
- gcore/resources/cloud/inference/secrets.py +8 -8
- gcore/resources/cloud/instances/flavors.py +9 -233
- gcore/resources/cloud/instances/images.py +47 -37
- gcore/resources/cloud/instances/instances.py +107 -100
- gcore/resources/cloud/instances/interfaces.py +6 -6
- gcore/resources/cloud/ip_ranges.py +34 -2
- gcore/resources/cloud/load_balancers/flavors.py +2 -2
- gcore/resources/cloud/load_balancers/l7_policies/l7_policies.py +30 -22
- gcore/resources/cloud/load_balancers/listeners.py +31 -22
- gcore/resources/cloud/load_balancers/load_balancers.py +99 -43
- gcore/resources/cloud/load_balancers/metrics.py +2 -2
- gcore/resources/cloud/load_balancers/pools/health_monitors.py +2 -2
- gcore/resources/cloud/load_balancers/pools/members.py +12 -8
- gcore/resources/cloud/networks/networks.py +83 -19
- gcore/resources/cloud/networks/routers.py +18 -18
- gcore/resources/cloud/networks/subnets.py +55 -15
- gcore/resources/cloud/projects.py +38 -24
- gcore/resources/cloud/quotas/quotas.py +6 -6
- gcore/resources/cloud/quotas/requests.py +8 -8
- gcore/resources/cloud/registries/artifacts.py +4 -4
- gcore/resources/cloud/registries/registries.py +14 -20
- gcore/resources/cloud/registries/repositories.py +4 -4
- gcore/resources/cloud/registries/tags.py +2 -2
- gcore/resources/cloud/registries/users.py +25 -32
- gcore/resources/cloud/reserved_fixed_ips/reserved_fixed_ips.py +26 -26
- gcore/resources/cloud/reserved_fixed_ips/vip.py +10 -10
- gcore/resources/cloud/security_groups/rules.py +6 -6
- gcore/resources/cloud/security_groups/security_groups.py +70 -31
- gcore/resources/cloud/ssh_keys.py +2 -2
- gcore/resources/cloud/tasks.py +102 -94
- gcore/resources/cloud/users/role_assignments.py +16 -18
- gcore/resources/cloud/volumes.py +155 -65
- gcore/resources/iam/__init__.py +47 -0
- gcore/resources/iam/api_tokens.py +521 -0
- gcore/resources/iam/iam.py +199 -0
- gcore/resources/iam/users.py +642 -0
- gcore/resources/waap/__init__.py +84 -0
- gcore/resources/waap/advanced_rules.py +135 -0
- gcore/resources/waap/custom_page_sets.py +805 -0
- gcore/resources/waap/domains/__init__.py +140 -0
- gcore/resources/waap/domains/advanced_rules.py +876 -0
- gcore/resources/waap/domains/analytics/__init__.py +33 -0
- gcore/resources/waap/domains/analytics/analytics.py +676 -0
- gcore/resources/waap/domains/analytics/requests.py +378 -0
- gcore/resources/waap/domains/api_discovery/__init__.py +33 -0
- gcore/resources/waap/domains/api_discovery/api_discovery.py +530 -0
- gcore/resources/waap/domains/api_discovery/scan_results.py +352 -0
- gcore/resources/waap/domains/api_path_groups.py +163 -0
- gcore/resources/waap/domains/api_paths.py +771 -0
- gcore/resources/waap/domains/custom_rules.py +889 -0
- gcore/resources/waap/domains/domains.py +399 -0
- gcore/resources/waap/domains/firewall_rules.py +884 -0
- gcore/resources/waap/domains/insight_silences.py +689 -0
- gcore/resources/waap/domains/insights.py +425 -0
- gcore/resources/waap/domains/policies.py +173 -0
- gcore/resources/waap/domains/settings.py +5 -5
- gcore/resources/waap/ip_info.py +1017 -0
- gcore/resources/waap/organizations.py +217 -0
- gcore/resources/waap/statistics.py +225 -0
- gcore/resources/waap/tags.py +233 -0
- gcore/resources/waap/waap.py +257 -0
- gcore/types/cloud/allowed_address_pairs.py +2 -2
- gcore/types/cloud/baremetal/__init__.py +0 -1
- gcore/types/cloud/baremetal/baremetal_server.py +1 -1
- gcore/types/cloud/baremetal/image_list_params.py +1 -5
- gcore/types/cloud/baremetal/server_create_params.py +13 -17
- gcore/types/cloud/baremetal/server_list_params.py +8 -12
- gcore/types/cloud/baremetal/server_rebuild_params.py +1 -1
- gcore/types/cloud/baremetal_flavor.py +3 -3
- gcore/types/cloud/container_probe_config.py +1 -1
- gcore/types/cloud/container_probe_config_create_param.py +1 -1
- gcore/types/cloud/container_scale_triggers.py +2 -2
- gcore/types/cloud/ddos_profile.py +9 -3
- gcore/types/cloud/file_share_create_params.py +3 -5
- gcore/types/cloud/floating_ip_create_params.py +2 -4
- gcore/types/cloud/floating_ip_detailed.py +1 -1
- gcore/types/cloud/floating_ip_list_params.py +2 -6
- gcore/types/cloud/gpu_baremetal_cluster.py +1 -1
- gcore/types/cloud/gpu_baremetal_cluster_create_params.py +4 -5
- gcore/types/cloud/gpu_baremetal_cluster_delete_params.py +1 -1
- gcore/types/cloud/gpu_baremetal_cluster_rebuild_params.py +1 -1
- gcore/types/cloud/gpu_baremetal_cluster_server.py +1 -1
- gcore/types/cloud/gpu_baremetal_clusters/image_upload_params.py +3 -5
- gcore/types/cloud/gpu_baremetal_clusters/server_attach_interface_params.py +10 -10
- gcore/types/cloud/gpu_baremetal_flavor.py +3 -3
- gcore/types/cloud/health_monitor.py +6 -1
- gcore/types/cloud/image.py +1 -1
- gcore/types/cloud/inference/deployment_create_params.py +4 -4
- gcore/types/cloud/inference/deployment_update_params.py +6 -6
- gcore/types/cloud/inference/inference.py +2 -4
- gcore/types/cloud/instance.py +1 -1
- gcore/types/cloud/instance_create_params.py +15 -18
- gcore/types/cloud/instance_list_params.py +8 -12
- gcore/types/cloud/instances/__init__.py +0 -2
- gcore/types/cloud/instances/image_create_from_volume_params.py +2 -4
- gcore/types/cloud/instances/image_list_params.py +1 -5
- gcore/types/cloud/instances/image_upload_params.py +2 -4
- gcore/types/cloud/instances/instance_flavor.py +3 -3
- gcore/types/cloud/instances/interface_attach_params.py +10 -10
- gcore/types/cloud/load_balancer_create_params.py +25 -19
- gcore/types/cloud/load_balancer_flavor_detail.py +3 -3
- gcore/types/cloud/load_balancer_l7_policy.py +5 -5
- gcore/types/cloud/load_balancer_list_params.py +5 -9
- gcore/types/cloud/load_balancer_listener_detail.py +4 -4
- gcore/types/cloud/load_balancer_update_params.py +24 -0
- gcore/types/cloud/load_balancers/l7_policy_create_params.py +5 -5
- gcore/types/cloud/load_balancers/l7_policy_replace_params.py +5 -5
- gcore/types/cloud/load_balancers/listener_create_params.py +4 -4
- gcore/types/cloud/load_balancers/listener_update_params.py +3 -3
- gcore/types/cloud/load_balancers/pool_create_params.py +10 -5
- gcore/types/cloud/load_balancers/pool_update_params.py +10 -5
- gcore/types/cloud/load_balancers/pools/member_add_params.py +9 -4
- gcore/types/cloud/member.py +8 -3
- gcore/types/cloud/network.py +2 -2
- gcore/types/cloud/network_create_params.py +2 -3
- gcore/types/cloud/network_details.py +2 -2
- gcore/types/cloud/network_list_params.py +5 -6
- gcore/types/cloud/network_update_params.py +28 -2
- gcore/types/cloud/networks/router_list_params.py +2 -2
- gcore/types/cloud/networks/subnet_create_params.py +3 -4
- gcore/types/cloud/networks/subnet_list_params.py +2 -6
- gcore/types/cloud/networks/subnet_update_params.py +25 -0
- gcore/types/cloud/region.py +4 -4
- gcore/types/cloud/registries/__init__.py +1 -0
- gcore/types/cloud/registries/user_create_multiple_params.py +3 -5
- gcore/types/cloud/registries/user_create_params.py +3 -5
- gcore/types/cloud/registries/user_refresh_secret_response.py +31 -0
- gcore/types/cloud/registry_create_params.py +3 -5
- gcore/types/cloud/reserved_fixed_ip_create_params.py +2 -2
- gcore/types/cloud/reserved_fixed_ip_list_params.py +3 -3
- gcore/types/cloud/security_group_list_params.py +3 -7
- gcore/types/cloud/security_group_update_params.py +25 -0
- gcore/types/cloud/session_persistence.py +1 -1
- gcore/types/cloud/ssh_key_created.py +3 -6
- gcore/types/cloud/tag_update_map_param.py +2 -2
- gcore/types/cloud/task.py +1 -1
- gcore/types/cloud/task_list_params.py +49 -45
- gcore/types/cloud/users/role_assignment_create_params.py +1 -1
- gcore/types/cloud/users/role_assignment_update_params.py +1 -1
- gcore/types/cloud/volume_create_params.py +6 -6
- gcore/types/cloud/volume_list_params.py +3 -7
- gcore/types/cloud/volume_update_params.py +29 -3
- gcore/types/iam/__init__.py +17 -0
- gcore/types/iam/account_overview.py +488 -0
- gcore/types/iam/api_token.py +78 -0
- gcore/types/iam/api_token_create.py +15 -0
- gcore/types/iam/api_token_create_params.py +42 -0
- gcore/types/iam/api_token_list.py +81 -0
- gcore/types/iam/api_token_list_params.py +41 -0
- gcore/types/iam/user.py +86 -0
- gcore/types/iam/user_detailed.py +104 -0
- gcore/types/iam/user_invite.py +15 -0
- gcore/types/iam/user_invite_params.py +37 -0
- gcore/types/iam/user_list_params.py +15 -0
- gcore/types/iam/user_update.py +104 -0
- gcore/types/iam/user_update_params.py +52 -0
- gcore/types/waap/__init__.py +97 -2
- gcore/types/waap/custom_page_set_create_params.py +35 -0
- gcore/types/waap/custom_page_set_list_params.py +25 -0
- gcore/types/waap/custom_page_set_preview_params.py +34 -0
- gcore/types/waap/custom_page_set_update_params.py +35 -0
- gcore/types/waap/domain_list_rule_sets_response.py +10 -0
- gcore/types/waap/domains/__init__.py +42 -0
- gcore/types/waap/domains/advanced_rule_create_params.py +80 -0
- gcore/types/waap/domains/advanced_rule_list_params.py +58 -0
- gcore/types/waap/domains/advanced_rule_update_params.py +83 -0
- gcore/types/waap/domains/analytics/__init__.py +5 -0
- gcore/types/waap/domains/analytics/request_list_params.py +53 -0
- gcore/types/waap/domains/analytics_get_event_statistics_params.py +34 -0
- gcore/types/waap/domains/analytics_list_ddos_attacks_params.py +28 -0
- gcore/types/waap/domains/analytics_list_ddos_info_params.py +31 -0
- gcore/types/waap/domains/analytics_list_event_traffic_params.py +26 -0
- gcore/types/waap/domains/analytics_list_event_traffic_response.py +10 -0
- gcore/types/waap/domains/api_discovery/__init__.py +7 -0
- gcore/types/waap/domains/api_discovery/scan_result_get_response.py +29 -0
- gcore/types/waap/domains/api_discovery/scan_result_list_params.py +41 -0
- gcore/types/waap/domains/api_discovery/scan_result_list_response.py +29 -0
- gcore/types/waap/domains/api_discovery_get_settings_response.py +36 -0
- gcore/types/waap/domains/api_discovery_scan_openapi_response.py +10 -0
- gcore/types/waap/domains/api_discovery_update_settings_params.py +34 -0
- gcore/types/waap/domains/api_discovery_update_settings_response.py +36 -0
- gcore/types/waap/domains/api_discovery_upload_openapi_params.py +19 -0
- gcore/types/waap/domains/api_discovery_upload_openapi_response.py +10 -0
- gcore/types/waap/domains/api_path_create_params.py +31 -0
- gcore/types/waap/domains/api_path_create_response.py +50 -0
- gcore/types/waap/domains/api_path_get_response.py +50 -0
- gcore/types/waap/domains/api_path_group_list_response.py +12 -0
- gcore/types/waap/domains/api_path_list_params.py +62 -0
- gcore/types/waap/domains/api_path_list_response.py +50 -0
- gcore/types/waap/domains/api_path_update_params.py +29 -0
- gcore/types/waap/domains/custom_rule_create_params.py +372 -0
- gcore/types/waap/domains/custom_rule_delete_multiple_params.py +13 -0
- gcore/types/waap/domains/custom_rule_list_params.py +35 -0
- gcore/types/waap/domains/custom_rule_update_params.py +375 -0
- gcore/types/waap/domains/firewall_rule_create_params.py +75 -0
- gcore/types/waap/domains/firewall_rule_delete_multiple_params.py +13 -0
- gcore/types/waap/domains/firewall_rule_list_params.py +33 -0
- gcore/types/waap/domains/firewall_rule_update_params.py +78 -0
- gcore/types/waap/domains/insight_list_params.py +34 -0
- gcore/types/waap/domains/insight_replace_params.py +17 -0
- gcore/types/waap/domains/insight_silence_create_params.py +28 -0
- gcore/types/waap/domains/insight_silence_list_params.py +33 -0
- gcore/types/waap/domains/insight_silence_update_params.py +28 -0
- gcore/types/waap/domains/setting_update_params.py +7 -0
- gcore/types/waap/ip_info_get_attack_time_series_params.py +12 -0
- gcore/types/waap/ip_info_get_attack_time_series_response.py +10 -0
- gcore/types/waap/ip_info_get_blocked_requests_params.py +15 -0
- gcore/types/waap/ip_info_get_blocked_requests_response.py +10 -0
- gcore/types/waap/ip_info_get_counts_params.py +19 -0
- gcore/types/waap/ip_info_get_ddos_attack_series_params.py +12 -0
- gcore/types/waap/ip_info_get_params.py +12 -0
- gcore/types/waap/ip_info_get_top_sessions_params.py +15 -0
- gcore/types/waap/ip_info_get_top_sessions_response.py +10 -0
- gcore/types/waap/ip_info_get_top_urls_params.py +15 -0
- gcore/types/waap/ip_info_get_top_urls_response.py +10 -0
- gcore/types/waap/ip_info_get_top_user_agents_params.py +15 -0
- gcore/types/waap/ip_info_get_top_user_agents_response.py +10 -0
- gcore/types/waap/ip_info_list_attacked_countries_params.py +12 -0
- gcore/types/waap/ip_info_list_attacked_countries_response.py +10 -0
- gcore/types/waap/organization_list_params.py +22 -0
- gcore/types/waap/statistic_get_usage_series_params.py +25 -0
- gcore/types/waap/tag_list_params.py +28 -0
- gcore/types/waap/waap_advanced_rule.py +83 -0
- gcore/types/waap/waap_advanced_rule_descriptor.py +49 -0
- gcore/types/waap/waap_advanced_rule_descriptor_list.py +15 -0
- gcore/types/waap/waap_block_csrf_page_data.py +28 -0
- gcore/types/waap/waap_block_csrf_page_data_param.py +28 -0
- gcore/types/waap/waap_block_page_data.py +28 -0
- gcore/types/waap/waap_block_page_data_param.py +28 -0
- gcore/types/waap/waap_blocked_statistics.py +36 -0
- gcore/types/waap/waap_captcha_page_data.py +31 -0
- gcore/types/waap/waap_captcha_page_data_param.py +31 -0
- gcore/types/waap/waap_common_tag.py +16 -0
- gcore/types/waap/waap_cookie_disabled_page_data.py +18 -0
- gcore/types/waap/waap_cookie_disabled_page_data_param.py +18 -0
- gcore/types/waap/waap_count_statistics.py +36 -0
- gcore/types/waap/waap_custom_page_preview.py +10 -0
- gcore/types/waap/waap_custom_page_set.py +36 -0
- gcore/types/waap/waap_custom_rule.py +377 -0
- gcore/types/waap/waap_customer_rule_state.py +7 -0
- gcore/types/waap/waap_ddos_attack.py +16 -0
- gcore/types/waap/waap_ddos_info.py +17 -0
- gcore/types/waap/{waap_api_urls.py → waap_domain_api_settings.py} +9 -2
- gcore/types/waap/waap_domain_policy.py +29 -0
- gcore/types/waap/{waap_domain_settings.py → waap_domain_settings_model.py} +4 -4
- gcore/types/waap/waap_event_statistics.py +15 -0
- gcore/types/waap/waap_firewall_rule.py +78 -0
- gcore/types/waap/waap_get_account_overview_response.py +34 -0
- gcore/types/waap/waap_handshake_page_data.py +25 -0
- gcore/types/waap/waap_handshake_page_data_param.py +25 -0
- gcore/types/waap/waap_insight.py +38 -0
- gcore/types/waap/waap_insight_silence.py +28 -0
- gcore/types/waap/waap_insight_silence_sort_by.py +9 -0
- gcore/types/waap/waap_insight_sort_by.py +20 -0
- gcore/types/waap/waap_insight_status.py +7 -0
- gcore/types/waap/waap_ip_country_attack.py +16 -0
- gcore/types/waap/waap_ip_ddos_info_model.py +23 -0
- gcore/types/waap/waap_ip_info.py +57 -0
- gcore/types/waap/waap_ip_info_counts.py +16 -0
- gcore/types/waap/waap_javascript_disabled_page_data.py +18 -0
- gcore/types/waap/waap_javascript_disabled_page_data_param.py +18 -0
- gcore/types/waap/waap_network_details.py +17 -0
- gcore/types/waap/waap_organization.py +13 -0
- gcore/types/waap/waap_page_type.py +9 -0
- gcore/types/waap/waap_paginated_custom_page_set.py +22 -0
- gcore/types/waap/waap_paginated_ddos_attack.py +22 -0
- gcore/types/waap/waap_paginated_ddos_info.py +22 -0
- gcore/types/waap/waap_paginated_request_summary.py +22 -0
- gcore/types/waap/waap_pattern_matched_tag.py +37 -0
- gcore/types/waap/waap_policy_action.py +7 -0
- gcore/types/waap/waap_policy_mode.py +10 -0
- gcore/types/waap/waap_request_details.py +92 -0
- gcore/types/waap/waap_request_organization.py +13 -0
- gcore/types/waap/waap_request_summary.py +59 -0
- gcore/types/waap/waap_resolution.py +7 -0
- gcore/types/waap/waap_rule_action_type.py +7 -0
- gcore/types/waap/waap_rule_blocked_requests.py +16 -0
- gcore/types/waap/waap_rule_set.py +41 -0
- gcore/types/waap/waap_statistic_item.py +18 -0
- gcore/types/waap/waap_statistics_series.py +16 -0
- gcore/types/waap/waap_tag.py +16 -0
- gcore/types/waap/waap_time_series_attack.py +23 -0
- gcore/types/waap/waap_top_session.py +24 -0
- gcore/types/waap/waap_top_url.py +13 -0
- gcore/types/waap/waap_top_user_agent.py +13 -0
- gcore/types/waap/waap_traffic_metrics.py +68 -0
- gcore/types/waap/waap_traffic_type.py +28 -0
- gcore/types/waap/waap_user_agent_details.py +40 -0
- {gcore-0.2.0.dist-info → gcore-0.4.0.dist-info}/METADATA +40 -3
- {gcore-0.2.0.dist-info → gcore-0.4.0.dist-info}/RECORD +312 -149
- gcore/types/cloud/baremetal/flavor_list_suitable_params.py +0 -22
- gcore/types/cloud/instances/flavor_list_for_resize_params.py +0 -16
- gcore/types/cloud/instances/flavor_list_suitable_params.py +0 -56
- {gcore-0.2.0.dist-info → gcore-0.4.0.dist-info}/WHEEL +0 -0
- {gcore-0.2.0.dist-info → gcore-0.4.0.dist-info}/licenses/LICENSE +0 -0
|
@@ -0,0 +1,884 @@
|
|
|
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
|
+
from typing_extensions import Literal
|
|
7
|
+
|
|
8
|
+
import httpx
|
|
9
|
+
|
|
10
|
+
from ...._types import NOT_GIVEN, Body, Query, Headers, NoneType, NotGiven
|
|
11
|
+
from ...._utils import maybe_transform, async_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 ....types.waap import WaapCustomerRuleState
|
|
22
|
+
from ...._base_client import AsyncPaginator, make_request_options
|
|
23
|
+
from ....types.waap.domains import (
|
|
24
|
+
firewall_rule_list_params,
|
|
25
|
+
firewall_rule_create_params,
|
|
26
|
+
firewall_rule_update_params,
|
|
27
|
+
firewall_rule_delete_multiple_params,
|
|
28
|
+
)
|
|
29
|
+
from ....types.waap.waap_firewall_rule import WaapFirewallRule
|
|
30
|
+
from ....types.waap.waap_customer_rule_state import WaapCustomerRuleState
|
|
31
|
+
|
|
32
|
+
__all__ = ["FirewallRulesResource", "AsyncFirewallRulesResource"]
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
class FirewallRulesResource(SyncAPIResource):
|
|
36
|
+
@cached_property
|
|
37
|
+
def with_raw_response(self) -> FirewallRulesResourceWithRawResponse:
|
|
38
|
+
"""
|
|
39
|
+
This property can be used as a prefix for any HTTP method call to return
|
|
40
|
+
the raw response object instead of the parsed content.
|
|
41
|
+
|
|
42
|
+
For more information, see https://www.github.com/G-Core/gcore-python#accessing-raw-response-data-eg-headers
|
|
43
|
+
"""
|
|
44
|
+
return FirewallRulesResourceWithRawResponse(self)
|
|
45
|
+
|
|
46
|
+
@cached_property
|
|
47
|
+
def with_streaming_response(self) -> FirewallRulesResourceWithStreamingResponse:
|
|
48
|
+
"""
|
|
49
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
50
|
+
|
|
51
|
+
For more information, see https://www.github.com/G-Core/gcore-python#with_streaming_response
|
|
52
|
+
"""
|
|
53
|
+
return FirewallRulesResourceWithStreamingResponse(self)
|
|
54
|
+
|
|
55
|
+
def create(
|
|
56
|
+
self,
|
|
57
|
+
domain_id: int,
|
|
58
|
+
*,
|
|
59
|
+
action: firewall_rule_create_params.Action,
|
|
60
|
+
conditions: Iterable[firewall_rule_create_params.Condition],
|
|
61
|
+
enabled: bool,
|
|
62
|
+
name: str,
|
|
63
|
+
description: Optional[str] | NotGiven = NOT_GIVEN,
|
|
64
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
65
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
66
|
+
extra_headers: Headers | None = None,
|
|
67
|
+
extra_query: Query | None = None,
|
|
68
|
+
extra_body: Body | None = None,
|
|
69
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
70
|
+
) -> WaapFirewallRule:
|
|
71
|
+
"""
|
|
72
|
+
Create a firewall rule
|
|
73
|
+
|
|
74
|
+
Args:
|
|
75
|
+
domain_id: The domain ID
|
|
76
|
+
|
|
77
|
+
action: The action that a firewall rule takes when triggered
|
|
78
|
+
|
|
79
|
+
conditions: The condition required for the WAAP engine to trigger the rule.
|
|
80
|
+
|
|
81
|
+
enabled: Whether or not the rule is enabled
|
|
82
|
+
|
|
83
|
+
name: The name assigned to the rule
|
|
84
|
+
|
|
85
|
+
description: The description assigned to the rule
|
|
86
|
+
|
|
87
|
+
extra_headers: Send extra headers
|
|
88
|
+
|
|
89
|
+
extra_query: Add additional query parameters to the request
|
|
90
|
+
|
|
91
|
+
extra_body: Add additional JSON properties to the request
|
|
92
|
+
|
|
93
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
94
|
+
"""
|
|
95
|
+
return self._post(
|
|
96
|
+
f"/waap/v1/domains/{domain_id}/firewall-rules",
|
|
97
|
+
body=maybe_transform(
|
|
98
|
+
{
|
|
99
|
+
"action": action,
|
|
100
|
+
"conditions": conditions,
|
|
101
|
+
"enabled": enabled,
|
|
102
|
+
"name": name,
|
|
103
|
+
"description": description,
|
|
104
|
+
},
|
|
105
|
+
firewall_rule_create_params.FirewallRuleCreateParams,
|
|
106
|
+
),
|
|
107
|
+
options=make_request_options(
|
|
108
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
109
|
+
),
|
|
110
|
+
cast_to=WaapFirewallRule,
|
|
111
|
+
)
|
|
112
|
+
|
|
113
|
+
def update(
|
|
114
|
+
self,
|
|
115
|
+
rule_id: int,
|
|
116
|
+
*,
|
|
117
|
+
domain_id: int,
|
|
118
|
+
action: Optional[firewall_rule_update_params.Action] | NotGiven = NOT_GIVEN,
|
|
119
|
+
conditions: Optional[Iterable[firewall_rule_update_params.Condition]] | NotGiven = NOT_GIVEN,
|
|
120
|
+
description: Optional[str] | NotGiven = NOT_GIVEN,
|
|
121
|
+
enabled: Optional[bool] | NotGiven = NOT_GIVEN,
|
|
122
|
+
name: Optional[str] | NotGiven = NOT_GIVEN,
|
|
123
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
124
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
125
|
+
extra_headers: Headers | None = None,
|
|
126
|
+
extra_query: Query | None = None,
|
|
127
|
+
extra_body: Body | None = None,
|
|
128
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
129
|
+
) -> None:
|
|
130
|
+
"""
|
|
131
|
+
Only properties present in the request will be updated
|
|
132
|
+
|
|
133
|
+
Args:
|
|
134
|
+
domain_id: The domain ID
|
|
135
|
+
|
|
136
|
+
rule_id: The firewall rule ID
|
|
137
|
+
|
|
138
|
+
action: The action that a firewall rule takes when triggered
|
|
139
|
+
|
|
140
|
+
conditions: The condition required for the WAAP engine to trigger the rule.
|
|
141
|
+
|
|
142
|
+
description: The description assigned to the rule
|
|
143
|
+
|
|
144
|
+
enabled: Whether or not the rule is enabled
|
|
145
|
+
|
|
146
|
+
name: The name assigned to the rule
|
|
147
|
+
|
|
148
|
+
extra_headers: Send extra headers
|
|
149
|
+
|
|
150
|
+
extra_query: Add additional query parameters to the request
|
|
151
|
+
|
|
152
|
+
extra_body: Add additional JSON properties to the request
|
|
153
|
+
|
|
154
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
155
|
+
"""
|
|
156
|
+
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
|
157
|
+
return self._patch(
|
|
158
|
+
f"/waap/v1/domains/{domain_id}/firewall-rules/{rule_id}",
|
|
159
|
+
body=maybe_transform(
|
|
160
|
+
{
|
|
161
|
+
"action": action,
|
|
162
|
+
"conditions": conditions,
|
|
163
|
+
"description": description,
|
|
164
|
+
"enabled": enabled,
|
|
165
|
+
"name": name,
|
|
166
|
+
},
|
|
167
|
+
firewall_rule_update_params.FirewallRuleUpdateParams,
|
|
168
|
+
),
|
|
169
|
+
options=make_request_options(
|
|
170
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
171
|
+
),
|
|
172
|
+
cast_to=NoneType,
|
|
173
|
+
)
|
|
174
|
+
|
|
175
|
+
def list(
|
|
176
|
+
self,
|
|
177
|
+
domain_id: int,
|
|
178
|
+
*,
|
|
179
|
+
action: Literal["allow", "block"] | NotGiven = NOT_GIVEN,
|
|
180
|
+
description: str | NotGiven = NOT_GIVEN,
|
|
181
|
+
enabled: bool | NotGiven = NOT_GIVEN,
|
|
182
|
+
limit: int | NotGiven = NOT_GIVEN,
|
|
183
|
+
name: str | NotGiven = NOT_GIVEN,
|
|
184
|
+
offset: int | NotGiven = NOT_GIVEN,
|
|
185
|
+
ordering: Optional[
|
|
186
|
+
Literal[
|
|
187
|
+
"id", "name", "description", "enabled", "action", "-id", "-name", "-description", "-enabled", "-action"
|
|
188
|
+
]
|
|
189
|
+
]
|
|
190
|
+
| NotGiven = NOT_GIVEN,
|
|
191
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
192
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
193
|
+
extra_headers: Headers | None = None,
|
|
194
|
+
extra_query: Query | None = None,
|
|
195
|
+
extra_body: Body | None = None,
|
|
196
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
197
|
+
) -> SyncOffsetPage[WaapFirewallRule]:
|
|
198
|
+
"""
|
|
199
|
+
Extracts a list of firewall rules assigned to a domain, offering filter,
|
|
200
|
+
ordering, and pagination capabilities
|
|
201
|
+
|
|
202
|
+
Args:
|
|
203
|
+
domain_id: The domain ID
|
|
204
|
+
|
|
205
|
+
action: Filter to refine results by specific firewall actions
|
|
206
|
+
|
|
207
|
+
description: Filter rules based on their description. Supports '\\**' as a wildcard character.
|
|
208
|
+
|
|
209
|
+
enabled: Filter rules based on their active status
|
|
210
|
+
|
|
211
|
+
limit: Number of items to return
|
|
212
|
+
|
|
213
|
+
name: Filter rules based on their name. Supports '\\**' as a wildcard character.
|
|
214
|
+
|
|
215
|
+
offset: Number of items to skip
|
|
216
|
+
|
|
217
|
+
ordering: Determine the field to order results by
|
|
218
|
+
|
|
219
|
+
extra_headers: Send extra headers
|
|
220
|
+
|
|
221
|
+
extra_query: Add additional query parameters to the request
|
|
222
|
+
|
|
223
|
+
extra_body: Add additional JSON properties to the request
|
|
224
|
+
|
|
225
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
226
|
+
"""
|
|
227
|
+
return self._get_api_list(
|
|
228
|
+
f"/waap/v1/domains/{domain_id}/firewall-rules",
|
|
229
|
+
page=SyncOffsetPage[WaapFirewallRule],
|
|
230
|
+
options=make_request_options(
|
|
231
|
+
extra_headers=extra_headers,
|
|
232
|
+
extra_query=extra_query,
|
|
233
|
+
extra_body=extra_body,
|
|
234
|
+
timeout=timeout,
|
|
235
|
+
query=maybe_transform(
|
|
236
|
+
{
|
|
237
|
+
"action": action,
|
|
238
|
+
"description": description,
|
|
239
|
+
"enabled": enabled,
|
|
240
|
+
"limit": limit,
|
|
241
|
+
"name": name,
|
|
242
|
+
"offset": offset,
|
|
243
|
+
"ordering": ordering,
|
|
244
|
+
},
|
|
245
|
+
firewall_rule_list_params.FirewallRuleListParams,
|
|
246
|
+
),
|
|
247
|
+
),
|
|
248
|
+
model=WaapFirewallRule,
|
|
249
|
+
)
|
|
250
|
+
|
|
251
|
+
def delete(
|
|
252
|
+
self,
|
|
253
|
+
rule_id: int,
|
|
254
|
+
*,
|
|
255
|
+
domain_id: int,
|
|
256
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
257
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
258
|
+
extra_headers: Headers | None = None,
|
|
259
|
+
extra_query: Query | None = None,
|
|
260
|
+
extra_body: Body | None = None,
|
|
261
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
262
|
+
) -> None:
|
|
263
|
+
"""
|
|
264
|
+
Delete a firewall rule
|
|
265
|
+
|
|
266
|
+
Args:
|
|
267
|
+
domain_id: The domain ID
|
|
268
|
+
|
|
269
|
+
rule_id: The firewall rule ID
|
|
270
|
+
|
|
271
|
+
extra_headers: Send extra headers
|
|
272
|
+
|
|
273
|
+
extra_query: Add additional query parameters to the request
|
|
274
|
+
|
|
275
|
+
extra_body: Add additional JSON properties to the request
|
|
276
|
+
|
|
277
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
278
|
+
"""
|
|
279
|
+
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
|
280
|
+
return self._delete(
|
|
281
|
+
f"/waap/v1/domains/{domain_id}/firewall-rules/{rule_id}",
|
|
282
|
+
options=make_request_options(
|
|
283
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
284
|
+
),
|
|
285
|
+
cast_to=NoneType,
|
|
286
|
+
)
|
|
287
|
+
|
|
288
|
+
def delete_multiple(
|
|
289
|
+
self,
|
|
290
|
+
domain_id: int,
|
|
291
|
+
*,
|
|
292
|
+
rule_ids: Iterable[int],
|
|
293
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
294
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
295
|
+
extra_headers: Headers | None = None,
|
|
296
|
+
extra_query: Query | None = None,
|
|
297
|
+
extra_body: Body | None = None,
|
|
298
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
299
|
+
) -> None:
|
|
300
|
+
"""
|
|
301
|
+
Delete multiple WAAP rules
|
|
302
|
+
|
|
303
|
+
Args:
|
|
304
|
+
domain_id: The domain ID
|
|
305
|
+
|
|
306
|
+
rule_ids: The IDs of the rules to delete
|
|
307
|
+
|
|
308
|
+
extra_headers: Send extra headers
|
|
309
|
+
|
|
310
|
+
extra_query: Add additional query parameters to the request
|
|
311
|
+
|
|
312
|
+
extra_body: Add additional JSON properties to the request
|
|
313
|
+
|
|
314
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
315
|
+
"""
|
|
316
|
+
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
|
317
|
+
return self._post(
|
|
318
|
+
f"/waap/v1/domains/{domain_id}/firewall-rules/bulk_delete",
|
|
319
|
+
body=maybe_transform(
|
|
320
|
+
{"rule_ids": rule_ids}, firewall_rule_delete_multiple_params.FirewallRuleDeleteMultipleParams
|
|
321
|
+
),
|
|
322
|
+
options=make_request_options(
|
|
323
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
324
|
+
),
|
|
325
|
+
cast_to=NoneType,
|
|
326
|
+
)
|
|
327
|
+
|
|
328
|
+
def get(
|
|
329
|
+
self,
|
|
330
|
+
rule_id: int,
|
|
331
|
+
*,
|
|
332
|
+
domain_id: int,
|
|
333
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
334
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
335
|
+
extra_headers: Headers | None = None,
|
|
336
|
+
extra_query: Query | None = None,
|
|
337
|
+
extra_body: Body | None = None,
|
|
338
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
339
|
+
) -> WaapFirewallRule:
|
|
340
|
+
"""
|
|
341
|
+
Extracts a specific firewall rule assigned to a domain
|
|
342
|
+
|
|
343
|
+
Args:
|
|
344
|
+
domain_id: The domain ID
|
|
345
|
+
|
|
346
|
+
rule_id: The firewall rule ID
|
|
347
|
+
|
|
348
|
+
extra_headers: Send extra headers
|
|
349
|
+
|
|
350
|
+
extra_query: Add additional query parameters to the request
|
|
351
|
+
|
|
352
|
+
extra_body: Add additional JSON properties to the request
|
|
353
|
+
|
|
354
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
355
|
+
"""
|
|
356
|
+
return self._get(
|
|
357
|
+
f"/waap/v1/domains/{domain_id}/firewall-rules/{rule_id}",
|
|
358
|
+
options=make_request_options(
|
|
359
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
360
|
+
),
|
|
361
|
+
cast_to=WaapFirewallRule,
|
|
362
|
+
)
|
|
363
|
+
|
|
364
|
+
def toggle(
|
|
365
|
+
self,
|
|
366
|
+
action: WaapCustomerRuleState,
|
|
367
|
+
*,
|
|
368
|
+
domain_id: int,
|
|
369
|
+
rule_id: int,
|
|
370
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
371
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
372
|
+
extra_headers: Headers | None = None,
|
|
373
|
+
extra_query: Query | None = None,
|
|
374
|
+
extra_body: Body | None = None,
|
|
375
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
376
|
+
) -> None:
|
|
377
|
+
"""
|
|
378
|
+
Toggle a firewall rule
|
|
379
|
+
|
|
380
|
+
Args:
|
|
381
|
+
domain_id: The domain ID
|
|
382
|
+
|
|
383
|
+
rule_id: The firewall rule ID
|
|
384
|
+
|
|
385
|
+
action: Enable or disable a firewall rule
|
|
386
|
+
|
|
387
|
+
extra_headers: Send extra headers
|
|
388
|
+
|
|
389
|
+
extra_query: Add additional query parameters to the request
|
|
390
|
+
|
|
391
|
+
extra_body: Add additional JSON properties to the request
|
|
392
|
+
|
|
393
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
394
|
+
"""
|
|
395
|
+
if not action:
|
|
396
|
+
raise ValueError(f"Expected a non-empty value for `action` but received {action!r}")
|
|
397
|
+
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
|
398
|
+
return self._patch(
|
|
399
|
+
f"/waap/v1/domains/{domain_id}/firewall-rules/{rule_id}/{action}",
|
|
400
|
+
options=make_request_options(
|
|
401
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
402
|
+
),
|
|
403
|
+
cast_to=NoneType,
|
|
404
|
+
)
|
|
405
|
+
|
|
406
|
+
|
|
407
|
+
class AsyncFirewallRulesResource(AsyncAPIResource):
|
|
408
|
+
@cached_property
|
|
409
|
+
def with_raw_response(self) -> AsyncFirewallRulesResourceWithRawResponse:
|
|
410
|
+
"""
|
|
411
|
+
This property can be used as a prefix for any HTTP method call to return
|
|
412
|
+
the raw response object instead of the parsed content.
|
|
413
|
+
|
|
414
|
+
For more information, see https://www.github.com/G-Core/gcore-python#accessing-raw-response-data-eg-headers
|
|
415
|
+
"""
|
|
416
|
+
return AsyncFirewallRulesResourceWithRawResponse(self)
|
|
417
|
+
|
|
418
|
+
@cached_property
|
|
419
|
+
def with_streaming_response(self) -> AsyncFirewallRulesResourceWithStreamingResponse:
|
|
420
|
+
"""
|
|
421
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
422
|
+
|
|
423
|
+
For more information, see https://www.github.com/G-Core/gcore-python#with_streaming_response
|
|
424
|
+
"""
|
|
425
|
+
return AsyncFirewallRulesResourceWithStreamingResponse(self)
|
|
426
|
+
|
|
427
|
+
async def create(
|
|
428
|
+
self,
|
|
429
|
+
domain_id: int,
|
|
430
|
+
*,
|
|
431
|
+
action: firewall_rule_create_params.Action,
|
|
432
|
+
conditions: Iterable[firewall_rule_create_params.Condition],
|
|
433
|
+
enabled: bool,
|
|
434
|
+
name: str,
|
|
435
|
+
description: Optional[str] | NotGiven = NOT_GIVEN,
|
|
436
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
437
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
438
|
+
extra_headers: Headers | None = None,
|
|
439
|
+
extra_query: Query | None = None,
|
|
440
|
+
extra_body: Body | None = None,
|
|
441
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
442
|
+
) -> WaapFirewallRule:
|
|
443
|
+
"""
|
|
444
|
+
Create a firewall rule
|
|
445
|
+
|
|
446
|
+
Args:
|
|
447
|
+
domain_id: The domain ID
|
|
448
|
+
|
|
449
|
+
action: The action that a firewall rule takes when triggered
|
|
450
|
+
|
|
451
|
+
conditions: The condition required for the WAAP engine to trigger the rule.
|
|
452
|
+
|
|
453
|
+
enabled: Whether or not the rule is enabled
|
|
454
|
+
|
|
455
|
+
name: The name assigned to the rule
|
|
456
|
+
|
|
457
|
+
description: The description assigned to the rule
|
|
458
|
+
|
|
459
|
+
extra_headers: Send extra headers
|
|
460
|
+
|
|
461
|
+
extra_query: Add additional query parameters to the request
|
|
462
|
+
|
|
463
|
+
extra_body: Add additional JSON properties to the request
|
|
464
|
+
|
|
465
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
466
|
+
"""
|
|
467
|
+
return await self._post(
|
|
468
|
+
f"/waap/v1/domains/{domain_id}/firewall-rules",
|
|
469
|
+
body=await async_maybe_transform(
|
|
470
|
+
{
|
|
471
|
+
"action": action,
|
|
472
|
+
"conditions": conditions,
|
|
473
|
+
"enabled": enabled,
|
|
474
|
+
"name": name,
|
|
475
|
+
"description": description,
|
|
476
|
+
},
|
|
477
|
+
firewall_rule_create_params.FirewallRuleCreateParams,
|
|
478
|
+
),
|
|
479
|
+
options=make_request_options(
|
|
480
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
481
|
+
),
|
|
482
|
+
cast_to=WaapFirewallRule,
|
|
483
|
+
)
|
|
484
|
+
|
|
485
|
+
async def update(
|
|
486
|
+
self,
|
|
487
|
+
rule_id: int,
|
|
488
|
+
*,
|
|
489
|
+
domain_id: int,
|
|
490
|
+
action: Optional[firewall_rule_update_params.Action] | NotGiven = NOT_GIVEN,
|
|
491
|
+
conditions: Optional[Iterable[firewall_rule_update_params.Condition]] | NotGiven = NOT_GIVEN,
|
|
492
|
+
description: Optional[str] | NotGiven = NOT_GIVEN,
|
|
493
|
+
enabled: Optional[bool] | NotGiven = NOT_GIVEN,
|
|
494
|
+
name: Optional[str] | NotGiven = NOT_GIVEN,
|
|
495
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
496
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
497
|
+
extra_headers: Headers | None = None,
|
|
498
|
+
extra_query: Query | None = None,
|
|
499
|
+
extra_body: Body | None = None,
|
|
500
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
501
|
+
) -> None:
|
|
502
|
+
"""
|
|
503
|
+
Only properties present in the request will be updated
|
|
504
|
+
|
|
505
|
+
Args:
|
|
506
|
+
domain_id: The domain ID
|
|
507
|
+
|
|
508
|
+
rule_id: The firewall rule ID
|
|
509
|
+
|
|
510
|
+
action: The action that a firewall rule takes when triggered
|
|
511
|
+
|
|
512
|
+
conditions: The condition required for the WAAP engine to trigger the rule.
|
|
513
|
+
|
|
514
|
+
description: The description assigned to the rule
|
|
515
|
+
|
|
516
|
+
enabled: Whether or not the rule is enabled
|
|
517
|
+
|
|
518
|
+
name: The name assigned to the rule
|
|
519
|
+
|
|
520
|
+
extra_headers: Send extra headers
|
|
521
|
+
|
|
522
|
+
extra_query: Add additional query parameters to the request
|
|
523
|
+
|
|
524
|
+
extra_body: Add additional JSON properties to the request
|
|
525
|
+
|
|
526
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
527
|
+
"""
|
|
528
|
+
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
|
529
|
+
return await self._patch(
|
|
530
|
+
f"/waap/v1/domains/{domain_id}/firewall-rules/{rule_id}",
|
|
531
|
+
body=await async_maybe_transform(
|
|
532
|
+
{
|
|
533
|
+
"action": action,
|
|
534
|
+
"conditions": conditions,
|
|
535
|
+
"description": description,
|
|
536
|
+
"enabled": enabled,
|
|
537
|
+
"name": name,
|
|
538
|
+
},
|
|
539
|
+
firewall_rule_update_params.FirewallRuleUpdateParams,
|
|
540
|
+
),
|
|
541
|
+
options=make_request_options(
|
|
542
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
543
|
+
),
|
|
544
|
+
cast_to=NoneType,
|
|
545
|
+
)
|
|
546
|
+
|
|
547
|
+
def list(
|
|
548
|
+
self,
|
|
549
|
+
domain_id: int,
|
|
550
|
+
*,
|
|
551
|
+
action: Literal["allow", "block"] | NotGiven = NOT_GIVEN,
|
|
552
|
+
description: str | NotGiven = NOT_GIVEN,
|
|
553
|
+
enabled: bool | NotGiven = NOT_GIVEN,
|
|
554
|
+
limit: int | NotGiven = NOT_GIVEN,
|
|
555
|
+
name: str | NotGiven = NOT_GIVEN,
|
|
556
|
+
offset: int | NotGiven = NOT_GIVEN,
|
|
557
|
+
ordering: Optional[
|
|
558
|
+
Literal[
|
|
559
|
+
"id", "name", "description", "enabled", "action", "-id", "-name", "-description", "-enabled", "-action"
|
|
560
|
+
]
|
|
561
|
+
]
|
|
562
|
+
| NotGiven = NOT_GIVEN,
|
|
563
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
564
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
565
|
+
extra_headers: Headers | None = None,
|
|
566
|
+
extra_query: Query | None = None,
|
|
567
|
+
extra_body: Body | None = None,
|
|
568
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
569
|
+
) -> AsyncPaginator[WaapFirewallRule, AsyncOffsetPage[WaapFirewallRule]]:
|
|
570
|
+
"""
|
|
571
|
+
Extracts a list of firewall rules assigned to a domain, offering filter,
|
|
572
|
+
ordering, and pagination capabilities
|
|
573
|
+
|
|
574
|
+
Args:
|
|
575
|
+
domain_id: The domain ID
|
|
576
|
+
|
|
577
|
+
action: Filter to refine results by specific firewall actions
|
|
578
|
+
|
|
579
|
+
description: Filter rules based on their description. Supports '\\**' as a wildcard character.
|
|
580
|
+
|
|
581
|
+
enabled: Filter rules based on their active status
|
|
582
|
+
|
|
583
|
+
limit: Number of items to return
|
|
584
|
+
|
|
585
|
+
name: Filter rules based on their name. Supports '\\**' as a wildcard character.
|
|
586
|
+
|
|
587
|
+
offset: Number of items to skip
|
|
588
|
+
|
|
589
|
+
ordering: Determine the field to order results by
|
|
590
|
+
|
|
591
|
+
extra_headers: Send extra headers
|
|
592
|
+
|
|
593
|
+
extra_query: Add additional query parameters to the request
|
|
594
|
+
|
|
595
|
+
extra_body: Add additional JSON properties to the request
|
|
596
|
+
|
|
597
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
598
|
+
"""
|
|
599
|
+
return self._get_api_list(
|
|
600
|
+
f"/waap/v1/domains/{domain_id}/firewall-rules",
|
|
601
|
+
page=AsyncOffsetPage[WaapFirewallRule],
|
|
602
|
+
options=make_request_options(
|
|
603
|
+
extra_headers=extra_headers,
|
|
604
|
+
extra_query=extra_query,
|
|
605
|
+
extra_body=extra_body,
|
|
606
|
+
timeout=timeout,
|
|
607
|
+
query=maybe_transform(
|
|
608
|
+
{
|
|
609
|
+
"action": action,
|
|
610
|
+
"description": description,
|
|
611
|
+
"enabled": enabled,
|
|
612
|
+
"limit": limit,
|
|
613
|
+
"name": name,
|
|
614
|
+
"offset": offset,
|
|
615
|
+
"ordering": ordering,
|
|
616
|
+
},
|
|
617
|
+
firewall_rule_list_params.FirewallRuleListParams,
|
|
618
|
+
),
|
|
619
|
+
),
|
|
620
|
+
model=WaapFirewallRule,
|
|
621
|
+
)
|
|
622
|
+
|
|
623
|
+
async def delete(
|
|
624
|
+
self,
|
|
625
|
+
rule_id: int,
|
|
626
|
+
*,
|
|
627
|
+
domain_id: int,
|
|
628
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
629
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
630
|
+
extra_headers: Headers | None = None,
|
|
631
|
+
extra_query: Query | None = None,
|
|
632
|
+
extra_body: Body | None = None,
|
|
633
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
634
|
+
) -> None:
|
|
635
|
+
"""
|
|
636
|
+
Delete a firewall rule
|
|
637
|
+
|
|
638
|
+
Args:
|
|
639
|
+
domain_id: The domain ID
|
|
640
|
+
|
|
641
|
+
rule_id: The firewall rule ID
|
|
642
|
+
|
|
643
|
+
extra_headers: Send extra headers
|
|
644
|
+
|
|
645
|
+
extra_query: Add additional query parameters to the request
|
|
646
|
+
|
|
647
|
+
extra_body: Add additional JSON properties to the request
|
|
648
|
+
|
|
649
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
650
|
+
"""
|
|
651
|
+
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
|
652
|
+
return await self._delete(
|
|
653
|
+
f"/waap/v1/domains/{domain_id}/firewall-rules/{rule_id}",
|
|
654
|
+
options=make_request_options(
|
|
655
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
656
|
+
),
|
|
657
|
+
cast_to=NoneType,
|
|
658
|
+
)
|
|
659
|
+
|
|
660
|
+
async def delete_multiple(
|
|
661
|
+
self,
|
|
662
|
+
domain_id: int,
|
|
663
|
+
*,
|
|
664
|
+
rule_ids: Iterable[int],
|
|
665
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
666
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
667
|
+
extra_headers: Headers | None = None,
|
|
668
|
+
extra_query: Query | None = None,
|
|
669
|
+
extra_body: Body | None = None,
|
|
670
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
671
|
+
) -> None:
|
|
672
|
+
"""
|
|
673
|
+
Delete multiple WAAP rules
|
|
674
|
+
|
|
675
|
+
Args:
|
|
676
|
+
domain_id: The domain ID
|
|
677
|
+
|
|
678
|
+
rule_ids: The IDs of the rules to delete
|
|
679
|
+
|
|
680
|
+
extra_headers: Send extra headers
|
|
681
|
+
|
|
682
|
+
extra_query: Add additional query parameters to the request
|
|
683
|
+
|
|
684
|
+
extra_body: Add additional JSON properties to the request
|
|
685
|
+
|
|
686
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
687
|
+
"""
|
|
688
|
+
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
|
689
|
+
return await self._post(
|
|
690
|
+
f"/waap/v1/domains/{domain_id}/firewall-rules/bulk_delete",
|
|
691
|
+
body=await async_maybe_transform(
|
|
692
|
+
{"rule_ids": rule_ids}, firewall_rule_delete_multiple_params.FirewallRuleDeleteMultipleParams
|
|
693
|
+
),
|
|
694
|
+
options=make_request_options(
|
|
695
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
696
|
+
),
|
|
697
|
+
cast_to=NoneType,
|
|
698
|
+
)
|
|
699
|
+
|
|
700
|
+
async def get(
|
|
701
|
+
self,
|
|
702
|
+
rule_id: int,
|
|
703
|
+
*,
|
|
704
|
+
domain_id: int,
|
|
705
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
706
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
707
|
+
extra_headers: Headers | None = None,
|
|
708
|
+
extra_query: Query | None = None,
|
|
709
|
+
extra_body: Body | None = None,
|
|
710
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
711
|
+
) -> WaapFirewallRule:
|
|
712
|
+
"""
|
|
713
|
+
Extracts a specific firewall rule assigned to a domain
|
|
714
|
+
|
|
715
|
+
Args:
|
|
716
|
+
domain_id: The domain ID
|
|
717
|
+
|
|
718
|
+
rule_id: The firewall rule ID
|
|
719
|
+
|
|
720
|
+
extra_headers: Send extra headers
|
|
721
|
+
|
|
722
|
+
extra_query: Add additional query parameters to the request
|
|
723
|
+
|
|
724
|
+
extra_body: Add additional JSON properties to the request
|
|
725
|
+
|
|
726
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
727
|
+
"""
|
|
728
|
+
return await self._get(
|
|
729
|
+
f"/waap/v1/domains/{domain_id}/firewall-rules/{rule_id}",
|
|
730
|
+
options=make_request_options(
|
|
731
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
732
|
+
),
|
|
733
|
+
cast_to=WaapFirewallRule,
|
|
734
|
+
)
|
|
735
|
+
|
|
736
|
+
async def toggle(
|
|
737
|
+
self,
|
|
738
|
+
action: WaapCustomerRuleState,
|
|
739
|
+
*,
|
|
740
|
+
domain_id: int,
|
|
741
|
+
rule_id: int,
|
|
742
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
743
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
744
|
+
extra_headers: Headers | None = None,
|
|
745
|
+
extra_query: Query | None = None,
|
|
746
|
+
extra_body: Body | None = None,
|
|
747
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
748
|
+
) -> None:
|
|
749
|
+
"""
|
|
750
|
+
Toggle a firewall rule
|
|
751
|
+
|
|
752
|
+
Args:
|
|
753
|
+
domain_id: The domain ID
|
|
754
|
+
|
|
755
|
+
rule_id: The firewall rule ID
|
|
756
|
+
|
|
757
|
+
action: Enable or disable a firewall rule
|
|
758
|
+
|
|
759
|
+
extra_headers: Send extra headers
|
|
760
|
+
|
|
761
|
+
extra_query: Add additional query parameters to the request
|
|
762
|
+
|
|
763
|
+
extra_body: Add additional JSON properties to the request
|
|
764
|
+
|
|
765
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
766
|
+
"""
|
|
767
|
+
if not action:
|
|
768
|
+
raise ValueError(f"Expected a non-empty value for `action` but received {action!r}")
|
|
769
|
+
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
|
770
|
+
return await self._patch(
|
|
771
|
+
f"/waap/v1/domains/{domain_id}/firewall-rules/{rule_id}/{action}",
|
|
772
|
+
options=make_request_options(
|
|
773
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
774
|
+
),
|
|
775
|
+
cast_to=NoneType,
|
|
776
|
+
)
|
|
777
|
+
|
|
778
|
+
|
|
779
|
+
class FirewallRulesResourceWithRawResponse:
|
|
780
|
+
def __init__(self, firewall_rules: FirewallRulesResource) -> None:
|
|
781
|
+
self._firewall_rules = firewall_rules
|
|
782
|
+
|
|
783
|
+
self.create = to_raw_response_wrapper(
|
|
784
|
+
firewall_rules.create,
|
|
785
|
+
)
|
|
786
|
+
self.update = to_raw_response_wrapper(
|
|
787
|
+
firewall_rules.update,
|
|
788
|
+
)
|
|
789
|
+
self.list = to_raw_response_wrapper(
|
|
790
|
+
firewall_rules.list,
|
|
791
|
+
)
|
|
792
|
+
self.delete = to_raw_response_wrapper(
|
|
793
|
+
firewall_rules.delete,
|
|
794
|
+
)
|
|
795
|
+
self.delete_multiple = to_raw_response_wrapper(
|
|
796
|
+
firewall_rules.delete_multiple,
|
|
797
|
+
)
|
|
798
|
+
self.get = to_raw_response_wrapper(
|
|
799
|
+
firewall_rules.get,
|
|
800
|
+
)
|
|
801
|
+
self.toggle = to_raw_response_wrapper(
|
|
802
|
+
firewall_rules.toggle,
|
|
803
|
+
)
|
|
804
|
+
|
|
805
|
+
|
|
806
|
+
class AsyncFirewallRulesResourceWithRawResponse:
|
|
807
|
+
def __init__(self, firewall_rules: AsyncFirewallRulesResource) -> None:
|
|
808
|
+
self._firewall_rules = firewall_rules
|
|
809
|
+
|
|
810
|
+
self.create = async_to_raw_response_wrapper(
|
|
811
|
+
firewall_rules.create,
|
|
812
|
+
)
|
|
813
|
+
self.update = async_to_raw_response_wrapper(
|
|
814
|
+
firewall_rules.update,
|
|
815
|
+
)
|
|
816
|
+
self.list = async_to_raw_response_wrapper(
|
|
817
|
+
firewall_rules.list,
|
|
818
|
+
)
|
|
819
|
+
self.delete = async_to_raw_response_wrapper(
|
|
820
|
+
firewall_rules.delete,
|
|
821
|
+
)
|
|
822
|
+
self.delete_multiple = async_to_raw_response_wrapper(
|
|
823
|
+
firewall_rules.delete_multiple,
|
|
824
|
+
)
|
|
825
|
+
self.get = async_to_raw_response_wrapper(
|
|
826
|
+
firewall_rules.get,
|
|
827
|
+
)
|
|
828
|
+
self.toggle = async_to_raw_response_wrapper(
|
|
829
|
+
firewall_rules.toggle,
|
|
830
|
+
)
|
|
831
|
+
|
|
832
|
+
|
|
833
|
+
class FirewallRulesResourceWithStreamingResponse:
|
|
834
|
+
def __init__(self, firewall_rules: FirewallRulesResource) -> None:
|
|
835
|
+
self._firewall_rules = firewall_rules
|
|
836
|
+
|
|
837
|
+
self.create = to_streamed_response_wrapper(
|
|
838
|
+
firewall_rules.create,
|
|
839
|
+
)
|
|
840
|
+
self.update = to_streamed_response_wrapper(
|
|
841
|
+
firewall_rules.update,
|
|
842
|
+
)
|
|
843
|
+
self.list = to_streamed_response_wrapper(
|
|
844
|
+
firewall_rules.list,
|
|
845
|
+
)
|
|
846
|
+
self.delete = to_streamed_response_wrapper(
|
|
847
|
+
firewall_rules.delete,
|
|
848
|
+
)
|
|
849
|
+
self.delete_multiple = to_streamed_response_wrapper(
|
|
850
|
+
firewall_rules.delete_multiple,
|
|
851
|
+
)
|
|
852
|
+
self.get = to_streamed_response_wrapper(
|
|
853
|
+
firewall_rules.get,
|
|
854
|
+
)
|
|
855
|
+
self.toggle = to_streamed_response_wrapper(
|
|
856
|
+
firewall_rules.toggle,
|
|
857
|
+
)
|
|
858
|
+
|
|
859
|
+
|
|
860
|
+
class AsyncFirewallRulesResourceWithStreamingResponse:
|
|
861
|
+
def __init__(self, firewall_rules: AsyncFirewallRulesResource) -> None:
|
|
862
|
+
self._firewall_rules = firewall_rules
|
|
863
|
+
|
|
864
|
+
self.create = async_to_streamed_response_wrapper(
|
|
865
|
+
firewall_rules.create,
|
|
866
|
+
)
|
|
867
|
+
self.update = async_to_streamed_response_wrapper(
|
|
868
|
+
firewall_rules.update,
|
|
869
|
+
)
|
|
870
|
+
self.list = async_to_streamed_response_wrapper(
|
|
871
|
+
firewall_rules.list,
|
|
872
|
+
)
|
|
873
|
+
self.delete = async_to_streamed_response_wrapper(
|
|
874
|
+
firewall_rules.delete,
|
|
875
|
+
)
|
|
876
|
+
self.delete_multiple = async_to_streamed_response_wrapper(
|
|
877
|
+
firewall_rules.delete_multiple,
|
|
878
|
+
)
|
|
879
|
+
self.get = async_to_streamed_response_wrapper(
|
|
880
|
+
firewall_rules.get,
|
|
881
|
+
)
|
|
882
|
+
self.toggle = async_to_streamed_response_wrapper(
|
|
883
|
+
firewall_rules.toggle,
|
|
884
|
+
)
|