gcore 0.12.0__py3-none-any.whl → 0.14.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 +3 -1
- gcore/_base_client.py +9 -9
- gcore/_client.py +25 -10
- gcore/_models.py +10 -4
- gcore/_qs.py +7 -7
- gcore/_types.py +18 -11
- gcore/_utils/_transform.py +2 -2
- gcore/_utils/_utils.py +4 -4
- gcore/_version.py +1 -1
- gcore/pagination.py +137 -0
- gcore/resources/__init__.py +14 -0
- gcore/resources/cdn/__init__.py +201 -0
- gcore/resources/cdn/audit_log.py +406 -0
- gcore/resources/cdn/cdn.py +957 -0
- gcore/resources/cdn/certificates.py +1062 -0
- gcore/resources/cdn/ip_ranges.py +224 -0
- gcore/resources/cdn/logs/__init__.py +33 -0
- gcore/resources/cdn/logs/logs.py +1424 -0
- gcore/resources/cdn/logs/settings.py +1081 -0
- gcore/resources/cdn/logs_uploader/__init__.py +61 -0
- gcore/resources/cdn/logs_uploader/configs.py +868 -0
- gcore/resources/cdn/logs_uploader/logs_uploader.py +166 -0
- gcore/resources/cdn/logs_uploader/policies.py +1060 -0
- gcore/resources/cdn/logs_uploader/targets.py +811 -0
- gcore/resources/cdn/metrics.py +419 -0
- gcore/resources/cdn/network_capacity.py +139 -0
- gcore/resources/cdn/origin_groups.py +1496 -0
- gcore/resources/cdn/resources/__init__.py +47 -0
- gcore/resources/cdn/resources/resources.py +2060 -0
- gcore/resources/cdn/resources/rules.py +1027 -0
- gcore/resources/cdn/resources/shield.py +259 -0
- gcore/resources/cdn/rule_templates.py +883 -0
- gcore/resources/cdn/shields.py +139 -0
- gcore/resources/cdn/statistics.py +1408 -0
- gcore/resources/cdn/trusted_ca_certificates.py +592 -0
- gcore/resources/cloud/audit_logs.py +33 -29
- gcore/resources/cloud/baremetal/flavors.py +21 -17
- gcore/resources/cloud/baremetal/images.py +19 -15
- gcore/resources/cloud/baremetal/servers.py +141 -119
- gcore/resources/cloud/billing_reservations.py +41 -33
- gcore/resources/cloud/cloud.py +24 -0
- gcore/resources/cloud/cost_reports.py +149 -119
- gcore/resources/cloud/file_shares/access_rules.py +25 -13
- gcore/resources/cloud/file_shares/file_shares.py +107 -71
- gcore/resources/cloud/floating_ips.py +270 -52
- gcore/resources/cloud/gpu_baremetal_clusters/flavors.py +13 -9
- gcore/resources/cloud/gpu_baremetal_clusters/gpu_baremetal_clusters.py +275 -65
- gcore/resources/cloud/gpu_baremetal_clusters/images.py +69 -53
- gcore/resources/cloud/gpu_baremetal_clusters/interfaces.py +9 -5
- gcore/resources/cloud/gpu_baremetal_clusters/servers.py +151 -127
- gcore/resources/cloud/inference/api_keys.py +51 -31
- gcore/resources/cloud/inference/applications/deployments.py +49 -31
- gcore/resources/cloud/inference/applications/templates.py +17 -9
- gcore/resources/cloud/inference/deployments/deployments.py +171 -139
- gcore/resources/cloud/inference/deployments/logs.py +17 -13
- gcore/resources/cloud/inference/flavors.py +21 -13
- gcore/resources/cloud/inference/inference.py +9 -5
- gcore/resources/cloud/inference/registry_credentials.py +45 -25
- gcore/resources/cloud/inference/secrets.py +45 -25
- gcore/resources/cloud/instances/flavors.py +17 -13
- gcore/resources/cloud/instances/images.py +153 -129
- gcore/resources/cloud/instances/instances.py +287 -213
- gcore/resources/cloud/instances/interfaces.py +165 -161
- gcore/resources/cloud/instances/metrics.py +9 -5
- gcore/resources/cloud/ip_ranges.py +25 -15
- gcore/resources/cloud/k8s/clusters/clusters.py +151 -87
- gcore/resources/cloud/k8s/clusters/nodes.py +19 -11
- gcore/resources/cloud/k8s/clusters/pools/nodes.py +19 -11
- gcore/resources/cloud/k8s/clusters/pools/pools.py +83 -59
- gcore/resources/cloud/k8s/flavors.py +13 -9
- gcore/resources/cloud/k8s/k8s.py +9 -5
- gcore/resources/cloud/load_balancers/flavors.py +11 -7
- gcore/resources/cloud/load_balancers/l7_policies/l7_policies.py +103 -83
- gcore/resources/cloud/load_balancers/l7_policies/rules.py +77 -57
- gcore/resources/cloud/load_balancers/listeners.py +125 -105
- gcore/resources/cloud/load_balancers/load_balancers.py +155 -123
- gcore/resources/cloud/load_balancers/metrics.py +9 -5
- gcore/resources/cloud/load_balancers/pools/health_monitors.py +25 -17
- gcore/resources/cloud/load_balancers/pools/members.py +31 -23
- gcore/resources/cloud/load_balancers/pools/pools.py +155 -129
- gcore/resources/cloud/load_balancers/statuses.py +17 -9
- gcore/resources/cloud/networks/networks.py +79 -55
- gcore/resources/cloud/networks/routers.py +75 -47
- gcore/resources/cloud/networks/subnets.py +105 -81
- gcore/resources/cloud/placement_groups.py +33 -17
- gcore/resources/cloud/projects.py +53 -41
- gcore/resources/cloud/quotas/quotas.py +25 -13
- gcore/resources/cloud/quotas/requests.py +41 -25
- gcore/resources/cloud/regions.py +25 -23
- gcore/resources/cloud/registries/artifacts.py +17 -9
- gcore/resources/cloud/registries/registries.py +55 -29
- gcore/resources/cloud/registries/repositories.py +17 -9
- gcore/resources/cloud/registries/tags.py +9 -5
- gcore/resources/cloud/registries/users.py +65 -35
- gcore/resources/cloud/reserved_fixed_ips/reserved_fixed_ips.py +123 -107
- gcore/resources/cloud/reserved_fixed_ips/vip.py +45 -25
- gcore/resources/cloud/secrets.py +43 -27
- gcore/resources/cloud/security_groups/rules.py +55 -43
- gcore/resources/cloud/security_groups/security_groups.py +79 -47
- gcore/resources/cloud/ssh_keys.py +51 -31
- gcore/resources/cloud/tasks.py +57 -45
- gcore/resources/cloud/usage_reports.py +27 -23
- gcore/resources/cloud/users/role_assignments.py +49 -33
- gcore/resources/cloud/volumes.py +237 -201
- gcore/resources/dns/dns.py +17 -13
- gcore/resources/dns/locations.py +29 -17
- gcore/resources/dns/metrics.py +13 -9
- gcore/resources/dns/pickers/pickers.py +5 -5
- gcore/resources/dns/pickers/presets.py +9 -5
- gcore/resources/dns/zones/dnssec.py +19 -11
- gcore/resources/dns/zones/rrsets.py +149 -91
- gcore/resources/dns/zones/zones.py +247 -189
- gcore/resources/fastedge/apps/apps.py +105 -89
- gcore/resources/fastedge/apps/logs.py +25 -21
- gcore/resources/fastedge/binaries.py +33 -17
- gcore/resources/fastedge/fastedge.py +5 -5
- gcore/resources/fastedge/kv_stores.py +43 -31
- gcore/resources/fastedge/secrets.py +69 -45
- gcore/resources/fastedge/statistics.py +25 -17
- gcore/resources/fastedge/templates.py +59 -39
- gcore/resources/iam/api_tokens.py +43 -27
- gcore/resources/iam/iam.py +5 -5
- gcore/resources/iam/users.py +97 -65
- gcore/resources/security/bgp_announces.py +27 -19
- gcore/resources/security/events.py +23 -19
- gcore/resources/security/profile_templates.py +9 -5
- gcore/resources/security/profiles.py +69 -45
- gcore/resources/storage/buckets/buckets.py +37 -25
- gcore/resources/storage/buckets/cors.py +19 -11
- gcore/resources/storage/buckets/lifecycle.py +19 -11
- gcore/resources/storage/buckets/policy.py +25 -13
- gcore/resources/storage/credentials.py +19 -15
- gcore/resources/storage/locations.py +13 -9
- gcore/resources/storage/statistics.py +39 -31
- gcore/resources/storage/storage.py +105 -69
- gcore/resources/streaming/ai_tasks.py +307 -197
- gcore/resources/streaming/broadcasts.py +63 -35
- gcore/resources/streaming/directories.py +65 -39
- gcore/resources/streaming/players.py +47 -31
- gcore/resources/streaming/playlists.py +189 -123
- gcore/resources/streaming/quality_sets.py +69 -39
- gcore/resources/streaming/restreams.py +47 -27
- gcore/resources/streaming/statistics.py +613 -407
- gcore/resources/streaming/streams/overlays.py +107 -67
- gcore/resources/streaming/streams/streams.py +403 -263
- gcore/resources/streaming/videos/subtitles.py +131 -75
- gcore/resources/streaming/videos/videos.py +429 -279
- gcore/resources/waap/advanced_rules.py +9 -5
- gcore/resources/waap/custom_page_sets.py +99 -75
- gcore/resources/waap/domains/advanced_rules.py +157 -99
- gcore/resources/waap/domains/api_discovery.py +71 -47
- gcore/resources/waap/domains/api_path_groups.py +9 -5
- gcore/resources/waap/domains/api_paths.py +79 -83
- gcore/resources/waap/domains/custom_rules.py +89 -59
- gcore/resources/waap/domains/domains.py +59 -41
- gcore/resources/waap/domains/firewall_rules.py +83 -55
- gcore/resources/waap/domains/insight_silences.py +59 -39
- gcore/resources/waap/domains/insights.py +39 -27
- gcore/resources/waap/domains/settings.py +21 -13
- gcore/resources/waap/domains/statistics.py +99 -75
- gcore/resources/waap/insights.py +23 -21
- gcore/resources/waap/ip_info/ip_info.py +70 -38
- gcore/resources/waap/ip_info/metrics.py +11 -7
- gcore/resources/waap/organizations.py +17 -13
- gcore/resources/waap/statistics.py +9 -5
- gcore/resources/waap/tags.py +17 -17
- gcore/resources/waap/waap.py +5 -5
- gcore/types/cdn/__init__.py +80 -0
- gcore/types/cdn/audit_log_list_params.py +73 -0
- gcore/types/cdn/ca_certificate.py +53 -0
- gcore/types/cdn/ca_certificate_list.py +10 -0
- gcore/types/cdn/cdn_account.py +86 -0
- gcore/types/cdn/cdn_account_limits.py +27 -0
- gcore/types/cdn/cdn_audit_log_entry.py +66 -0
- gcore/types/cdn/cdn_available_features.py +46 -0
- gcore/types/cdn/cdn_list_purge_statuses_params.py +67 -0
- gcore/types/cdn/cdn_log_entry.py +70 -0
- gcore/types/cdn/cdn_metrics.py +22 -0
- gcore/types/cdn/cdn_metrics_groups.py +13 -0
- gcore/types/cdn/cdn_metrics_values.py +19 -0
- gcore/types/cdn/cdn_resource.py +1977 -0
- gcore/types/cdn/cdn_resource_list.py +10 -0
- gcore/types/cdn/cdn_update_account_params.py +15 -0
- gcore/types/cdn/certificate_create_params.py +51 -0
- gcore/types/cdn/certificate_get_status_params.py +14 -0
- gcore/types/cdn/certificate_list_params.py +29 -0
- gcore/types/cdn/certificate_replace_params.py +39 -0
- gcore/types/cdn/log_download_params.py +279 -0
- gcore/types/cdn/log_list_params.py +273 -0
- gcore/types/cdn/logs/__init__.py +7 -0
- gcore/types/cdn/logs/log_settings.py +172 -0
- gcore/types/cdn/logs/setting_create_params.py +200 -0
- gcore/types/cdn/logs/setting_update_params.py +200 -0
- gcore/types/cdn/logs_aggregated_stats.py +23 -0
- gcore/types/cdn/logs_uploader/__init__.py +23 -0
- gcore/types/cdn/logs_uploader/config_create_params.py +32 -0
- gcore/types/cdn/logs_uploader/config_list_params.py +16 -0
- gcore/types/cdn/logs_uploader/config_replace_params.py +32 -0
- gcore/types/cdn/logs_uploader/config_update_params.py +32 -0
- gcore/types/cdn/logs_uploader/logs_uploader_config.py +51 -0
- gcore/types/cdn/logs_uploader/logs_uploader_config_list.py +10 -0
- gcore/types/cdn/logs_uploader/logs_uploader_policy.py +73 -0
- gcore/types/cdn/logs_uploader/logs_uploader_policy_list.py +10 -0
- gcore/types/cdn/logs_uploader/logs_uploader_target.py +236 -0
- gcore/types/cdn/logs_uploader/logs_uploader_target_list.py +10 -0
- gcore/types/cdn/logs_uploader/policy_create_params.py +61 -0
- gcore/types/cdn/logs_uploader/policy_list_fields_response.py +8 -0
- gcore/types/cdn/logs_uploader/policy_list_params.py +16 -0
- gcore/types/cdn/logs_uploader/policy_replace_params.py +61 -0
- gcore/types/cdn/logs_uploader/policy_update_params.py +61 -0
- gcore/types/cdn/logs_uploader/target_create_params.py +249 -0
- gcore/types/cdn/logs_uploader/target_list_params.py +16 -0
- gcore/types/cdn/logs_uploader/target_replace_params.py +249 -0
- gcore/types/cdn/logs_uploader/target_update_params.py +249 -0
- gcore/types/cdn/logs_uploader_validation.py +23 -0
- gcore/types/cdn/metric_list_params.py +168 -0
- gcore/types/cdn/network_capacity.py +22 -0
- gcore/types/cdn/origin_group_create_params.py +184 -0
- gcore/types/cdn/origin_group_list_params.py +24 -0
- gcore/types/cdn/origin_group_replace_params.py +190 -0
- gcore/types/cdn/origin_group_update_params.py +190 -0
- gcore/types/cdn/origin_groups.py +212 -0
- gcore/types/cdn/origin_groups_list.py +10 -0
- gcore/types/cdn/public_ip_list.py +15 -0
- gcore/types/cdn/public_network_list.py +15 -0
- gcore/types/cdn/purge_status.py +55 -0
- gcore/types/cdn/resource_aggregated_stats.py +80 -0
- gcore/types/cdn/resource_create_params.py +1825 -0
- gcore/types/cdn/resource_list_params.py +107 -0
- gcore/types/cdn/resource_prefetch_params.py +17 -0
- gcore/types/cdn/resource_purge_params.py +71 -0
- gcore/types/cdn/resource_replace_params.py +1803 -0
- gcore/types/cdn/resource_update_params.py +1794 -0
- gcore/types/cdn/resource_usage_stats.py +111 -0
- gcore/types/cdn/resources/__init__.py +11 -0
- gcore/types/cdn/resources/cdn_resource_rule.py +1695 -0
- gcore/types/cdn/resources/origin_shielding.py +15 -0
- gcore/types/cdn/resources/rule_create_params.py +1652 -0
- gcore/types/cdn/resources/rule_list_response.py +10 -0
- gcore/types/cdn/resources/rule_replace_params.py +1654 -0
- gcore/types/cdn/resources/rule_update_params.py +1654 -0
- gcore/types/cdn/resources/shield_replace_params.py +16 -0
- gcore/types/cdn/rule_template.py +1666 -0
- gcore/types/cdn/rule_template_create_params.py +1636 -0
- gcore/types/cdn/rule_template_list.py +10 -0
- gcore/types/cdn/rule_template_replace_params.py +1636 -0
- gcore/types/cdn/rule_template_update_params.py +1636 -0
- gcore/types/cdn/shield_aggregated_stats.py +23 -0
- gcore/types/cdn/shield_list_response.py +25 -0
- gcore/types/cdn/ssl_detail.py +62 -0
- gcore/types/cdn/ssl_detail_list.py +10 -0
- gcore/types/cdn/ssl_request_status.py +135 -0
- gcore/types/cdn/statistic_get_logs_usage_aggregated_params.py +42 -0
- gcore/types/cdn/statistic_get_logs_usage_series_params.py +35 -0
- gcore/types/cdn/statistic_get_resource_usage_aggregated_params.py +151 -0
- gcore/types/cdn/statistic_get_resource_usage_series_params.py +131 -0
- gcore/types/cdn/statistic_get_shield_usage_aggregated_params.py +42 -0
- gcore/types/cdn/statistic_get_shield_usage_series_params.py +25 -0
- gcore/types/cdn/trusted_ca_certificate_create_params.py +23 -0
- gcore/types/cdn/trusted_ca_certificate_list_params.py +29 -0
- gcore/types/cdn/trusted_ca_certificate_replace_params.py +15 -0
- gcore/types/cdn/usage_series_stats.py +31 -0
- gcore/types/cloud/__init__.py +2 -0
- gcore/types/cloud/file_share.py +4 -0
- gcore/types/cloud/file_share_create_params.py +20 -0
- gcore/types/cloud/file_share_update_params.py +40 -3
- gcore/types/cloud/floating_ip.py +1 -1
- gcore/types/cloud/floating_ip_detailed.py +1 -1
- gcore/types/cloud/floating_ip_update_params.py +43 -0
- gcore/types/cloud/gpu_baremetal_cluster_action_params.py +46 -0
- gcore/types/cloud/inference/inference_deployment.py +3 -1
- gcore/types/cloud/instance_create_params.py +3 -1
- gcore/types/cloud/k8s/cluster_create_params.py +46 -4
- gcore/types/cloud/k8s/cluster_update_params.py +60 -6
- gcore/types/cloud/k8s/clusters/pool_update_params.py +1 -1
- gcore/types/cloud/k8s/k8s_cluster.py +40 -3
- gcore/types/cloud/load_balancer_update_params.py +3 -1
- gcore/types/cloud/network_update_params.py +3 -1
- gcore/types/cloud/networks/subnet_update_params.py +3 -1
- gcore/types/cloud/registries/user_create_multiple_params.py +5 -3
- gcore/types/cloud/registries/user_create_params.py +5 -3
- gcore/types/cloud/registry_create_params.py +5 -3
- gcore/types/cloud/security_group_update_params.py +3 -1
- gcore/types/cloud/ssh_key_created.py +6 -3
- gcore/types/cloud/volume_update_params.py +3 -1
- gcore/types/dns/zone_get_statistics_params.py +12 -9
- gcore/types/dns/zone_get_statistics_response.py +3 -1
- gcore/types/dns/zone_import_params.py +21 -15
- gcore/types/dns/zones/dns_output_rrset.py +7 -3
- gcore/types/iam/account_overview.py +7 -2
- gcore/types/iam/user.py +7 -2
- gcore/types/iam/user_detailed.py +7 -2
- gcore/types/iam/user_invite_params.py +4 -1
- gcore/types/iam/user_update.py +7 -2
- gcore/types/iam/user_update_params.py +7 -2
- gcore/types/streaming/ai_contentmoderation_hardnudity.py +6 -4
- gcore/types/streaming/ai_contentmoderation_nsfw.py +6 -4
- gcore/types/streaming/ai_contentmoderation_softnudity.py +6 -4
- gcore/types/streaming/ai_contentmoderation_sport.py +6 -4
- gcore/types/streaming/ai_task.py +20 -11
- gcore/types/streaming/ai_task_create_params.py +20 -11
- gcore/types/streaming/ai_task_get_response.py +5 -4
- gcore/types/streaming/ai_task_list_params.py +11 -5
- gcore/types/streaming/clip.py +33 -22
- gcore/types/streaming/create_video_param.py +75 -43
- gcore/types/streaming/playlist.py +7 -5
- gcore/types/streaming/playlist_create_params.py +7 -5
- gcore/types/streaming/playlist_update_params.py +7 -5
- gcore/types/streaming/playlist_video.py +75 -43
- gcore/types/streaming/statistic_get_unique_viewers_cdn_params.py +7 -4
- gcore/types/streaming/stream.py +207 -136
- gcore/types/streaming/stream_create_clip_params.py +33 -22
- gcore/types/streaming/stream_create_params.py +41 -24
- gcore/types/streaming/stream_update_params.py +41 -24
- gcore/types/streaming/video.py +138 -76
- gcore/types/streaming/video_list_params.py +4 -2
- gcore/types/streaming/video_update_params.py +75 -43
- gcore/types/waap/__init__.py +2 -1
- gcore/types/waap/domain_update_params.py +2 -2
- gcore/types/waap/domains/advanced_rule_create_params.py +26 -18
- gcore/types/waap/domains/advanced_rule_list_params.py +10 -7
- gcore/types/waap/domains/advanced_rule_update_params.py +22 -17
- gcore/types/waap/domains/api_path_create_params.py +0 -3
- gcore/types/waap/domains/api_path_update_params.py +1 -3
- gcore/types/waap/domains/custom_rule_create_params.py +36 -35
- gcore/types/waap/domains/custom_rule_update_params.py +31 -33
- gcore/types/waap/domains/firewall_rule_create_params.py +6 -6
- gcore/types/waap/domains/firewall_rule_update_params.py +5 -5
- gcore/types/waap/domains/waap_advanced_rule.py +17 -9
- gcore/types/waap/domains/waap_custom_rule.py +5 -2
- gcore/types/waap/domains/waap_firewall_rule.py +1 -1
- gcore/types/waap/domains/waap_insight.py +1 -1
- gcore/types/waap/insight_list_types_params.py +1 -1
- gcore/types/waap/ip_info_get_top_urls_response.py +3 -12
- gcore/types/waap/{ip_info_get_ip_info_response.py → waap_ip_info.py} +2 -2
- gcore/types/waap/waap_top_url.py +13 -0
- {gcore-0.12.0.dist-info → gcore-0.14.0.dist-info}/METADATA +1 -1
- {gcore-0.12.0.dist-info → gcore-0.14.0.dist-info}/RECORD +340 -218
- {gcore-0.12.0.dist-info → gcore-0.14.0.dist-info}/WHEEL +0 -0
- {gcore-0.12.0.dist-info → gcore-0.14.0.dist-info}/licenses/LICENSE +0 -0
|
@@ -7,7 +7,7 @@ from typing_extensions import Literal
|
|
|
7
7
|
|
|
8
8
|
import httpx
|
|
9
9
|
|
|
10
|
-
from ...._types import
|
|
10
|
+
from ...._types import Body, Omit, Query, Headers, NoneType, NotGiven, omit, not_given
|
|
11
11
|
from ...._utils import maybe_transform, async_maybe_transform
|
|
12
12
|
from ...._compat import cached_property
|
|
13
13
|
from ...._resource import SyncAPIResource, AsyncAPIResource
|
|
@@ -53,14 +53,14 @@ class AdvancedRulesResource(SyncAPIResource):
|
|
|
53
53
|
enabled: bool,
|
|
54
54
|
name: str,
|
|
55
55
|
source: str,
|
|
56
|
-
description:
|
|
57
|
-
phase: Optional[Literal["access", "header_filter", "body_filter"]] |
|
|
56
|
+
description: str | Omit = omit,
|
|
57
|
+
phase: Optional[Literal["access", "header_filter", "body_filter"]] | Omit = omit,
|
|
58
58
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
59
59
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
60
60
|
extra_headers: Headers | None = None,
|
|
61
61
|
extra_query: Query | None = None,
|
|
62
62
|
extra_body: Body | None = None,
|
|
63
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
63
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
64
64
|
) -> WaapAdvancedRule:
|
|
65
65
|
"""
|
|
66
66
|
Create an advanced rule
|
|
@@ -68,7 +68,8 @@ class AdvancedRulesResource(SyncAPIResource):
|
|
|
68
68
|
Args:
|
|
69
69
|
domain_id: The domain ID
|
|
70
70
|
|
|
71
|
-
action: The action that the rule takes when triggered
|
|
71
|
+
action: The action that the rule takes when triggered. Only one action can be set per
|
|
72
|
+
rule.
|
|
72
73
|
|
|
73
74
|
enabled: Whether or not the rule is enabled
|
|
74
75
|
|
|
@@ -76,17 +77,23 @@ class AdvancedRulesResource(SyncAPIResource):
|
|
|
76
77
|
|
|
77
78
|
source: A CEL syntax expression that contains the rule's conditions. Allowed objects
|
|
78
79
|
are: request, whois, session, response, tags, `user_defined_tags`, `user_agent`,
|
|
79
|
-
`client_data`.
|
|
80
|
+
`client_data`.
|
|
81
|
+
|
|
82
|
+
More info can be found here:
|
|
80
83
|
https://gcore.com/docs/waap/waap-rules/advanced-rules
|
|
81
84
|
|
|
82
85
|
description: The description assigned to the rule
|
|
83
86
|
|
|
84
|
-
phase: The WAAP request/response phase for applying the rule. Default is "access".
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
87
|
+
phase: The WAAP request/response phase for applying the rule. Default is "access".
|
|
88
|
+
|
|
89
|
+
The "access" phase is responsible for modifying the request before it is sent to
|
|
90
|
+
the origin server.
|
|
91
|
+
|
|
92
|
+
The "`header_filter`" phase is responsible for modifying the HTTP headers of a
|
|
93
|
+
response before they are sent back to the client.
|
|
94
|
+
|
|
95
|
+
The "`body_filter`" phase is responsible for modifying the body of a response
|
|
96
|
+
before it is sent back to the client.
|
|
90
97
|
|
|
91
98
|
extra_headers: Send extra headers
|
|
92
99
|
|
|
@@ -97,7 +104,9 @@ class AdvancedRulesResource(SyncAPIResource):
|
|
|
97
104
|
timeout: Override the client-level default timeout for this request, in seconds
|
|
98
105
|
"""
|
|
99
106
|
return self._post(
|
|
100
|
-
f"/waap/v1/domains/{domain_id}/advanced-rules"
|
|
107
|
+
f"/waap/v1/domains/{domain_id}/advanced-rules"
|
|
108
|
+
if self._client._base_url_overridden
|
|
109
|
+
else f"https://api.gcore.com//waap/v1/domains/{domain_id}/advanced-rules",
|
|
101
110
|
body=maybe_transform(
|
|
102
111
|
{
|
|
103
112
|
"action": action,
|
|
@@ -120,18 +129,18 @@ class AdvancedRulesResource(SyncAPIResource):
|
|
|
120
129
|
rule_id: int,
|
|
121
130
|
*,
|
|
122
131
|
domain_id: int,
|
|
123
|
-
action: Optional[advanced_rule_update_params.Action] |
|
|
124
|
-
description: Optional[str] |
|
|
125
|
-
enabled: Optional[bool] |
|
|
126
|
-
name: Optional[str] |
|
|
127
|
-
phase: Optional[Literal["access", "header_filter", "body_filter"]] |
|
|
128
|
-
source: Optional[str] |
|
|
132
|
+
action: Optional[advanced_rule_update_params.Action] | Omit = omit,
|
|
133
|
+
description: Optional[str] | Omit = omit,
|
|
134
|
+
enabled: Optional[bool] | Omit = omit,
|
|
135
|
+
name: Optional[str] | Omit = omit,
|
|
136
|
+
phase: Optional[Literal["access", "header_filter", "body_filter"]] | Omit = omit,
|
|
137
|
+
source: Optional[str] | Omit = omit,
|
|
129
138
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
130
139
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
131
140
|
extra_headers: Headers | None = None,
|
|
132
141
|
extra_query: Query | None = None,
|
|
133
142
|
extra_body: Body | None = None,
|
|
134
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
143
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
135
144
|
) -> None:
|
|
136
145
|
"""
|
|
137
146
|
Only properties present in the request will be updated
|
|
@@ -141,7 +150,7 @@ class AdvancedRulesResource(SyncAPIResource):
|
|
|
141
150
|
|
|
142
151
|
rule_id: The advanced rule ID
|
|
143
152
|
|
|
144
|
-
action: The action that a WAAP rule takes when triggered
|
|
153
|
+
action: The action that a WAAP rule takes when triggered.
|
|
145
154
|
|
|
146
155
|
description: The description assigned to the rule
|
|
147
156
|
|
|
@@ -149,16 +158,22 @@ class AdvancedRulesResource(SyncAPIResource):
|
|
|
149
158
|
|
|
150
159
|
name: The name assigned to the rule
|
|
151
160
|
|
|
152
|
-
phase: The WAAP request/response phase for applying the rule.
|
|
153
|
-
|
|
161
|
+
phase: The WAAP request/response phase for applying the rule.
|
|
162
|
+
|
|
163
|
+
The "access" phase is responsible for modifying the request before it is sent to
|
|
164
|
+
the origin server.
|
|
165
|
+
|
|
154
166
|
The "`header_filter`" phase is responsible for modifying the HTTP headers of a
|
|
155
|
-
response before they are sent back to the client.
|
|
156
|
-
|
|
157
|
-
|
|
167
|
+
response before they are sent back to the client.
|
|
168
|
+
|
|
169
|
+
The "`body_filter`" phase is responsible for modifying the body of a response
|
|
170
|
+
before it is sent back to the client.
|
|
158
171
|
|
|
159
172
|
source: A CEL syntax expression that contains the rule's conditions. Allowed objects
|
|
160
173
|
are: request, whois, session, response, tags, `user_defined_tags`, `user_agent`,
|
|
161
|
-
`client_data`.
|
|
174
|
+
`client_data`.
|
|
175
|
+
|
|
176
|
+
More info can be found here:
|
|
162
177
|
https://gcore.com/docs/waap/waap-rules/advanced-rules
|
|
163
178
|
|
|
164
179
|
extra_headers: Send extra headers
|
|
@@ -171,7 +186,9 @@ class AdvancedRulesResource(SyncAPIResource):
|
|
|
171
186
|
"""
|
|
172
187
|
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
|
173
188
|
return self._patch(
|
|
174
|
-
f"/waap/v1/domains/{domain_id}/advanced-rules/{rule_id}"
|
|
189
|
+
f"/waap/v1/domains/{domain_id}/advanced-rules/{rule_id}"
|
|
190
|
+
if self._client._base_url_overridden
|
|
191
|
+
else f"https://api.gcore.com//waap/v1/domains/{domain_id}/advanced-rules/{rule_id}",
|
|
175
192
|
body=maybe_transform(
|
|
176
193
|
{
|
|
177
194
|
"action": action,
|
|
@@ -193,12 +210,12 @@ class AdvancedRulesResource(SyncAPIResource):
|
|
|
193
210
|
self,
|
|
194
211
|
domain_id: int,
|
|
195
212
|
*,
|
|
196
|
-
action: Literal["allow", "block", "captcha", "handshake", "monitor", "tag"] |
|
|
197
|
-
description: str |
|
|
198
|
-
enabled: bool |
|
|
199
|
-
limit: int |
|
|
200
|
-
name: str |
|
|
201
|
-
offset: int |
|
|
213
|
+
action: Literal["allow", "block", "captcha", "handshake", "monitor", "tag"] | Omit = omit,
|
|
214
|
+
description: str | Omit = omit,
|
|
215
|
+
enabled: bool | Omit = omit,
|
|
216
|
+
limit: int | Omit = omit,
|
|
217
|
+
name: str | Omit = omit,
|
|
218
|
+
offset: int | Omit = omit,
|
|
202
219
|
ordering: Optional[
|
|
203
220
|
Literal[
|
|
204
221
|
"id",
|
|
@@ -215,14 +232,14 @@ class AdvancedRulesResource(SyncAPIResource):
|
|
|
215
232
|
"-phase",
|
|
216
233
|
]
|
|
217
234
|
]
|
|
218
|
-
|
|
|
219
|
-
phase: Literal["access", "header_filter", "body_filter"] |
|
|
235
|
+
| Omit = omit,
|
|
236
|
+
phase: Literal["access", "header_filter", "body_filter"] | Omit = omit,
|
|
220
237
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
221
238
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
222
239
|
extra_headers: Headers | None = None,
|
|
223
240
|
extra_query: Query | None = None,
|
|
224
241
|
extra_body: Body | None = None,
|
|
225
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
242
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
226
243
|
) -> SyncOffsetPage[WaapAdvancedRule]:
|
|
227
244
|
"""
|
|
228
245
|
Retrieve a list of advanced rules assigned to a domain, offering filter,
|
|
@@ -245,12 +262,16 @@ class AdvancedRulesResource(SyncAPIResource):
|
|
|
245
262
|
|
|
246
263
|
ordering: Determine the field to order results by
|
|
247
264
|
|
|
248
|
-
phase: Filter rules based on the WAAP request/response phase for applying the rule.
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
265
|
+
phase: Filter rules based on the WAAP request/response phase for applying the rule.
|
|
266
|
+
|
|
267
|
+
The "access" phase is responsible for modifying the request before it is sent to
|
|
268
|
+
the origin server.
|
|
269
|
+
|
|
270
|
+
The "`header_filter`" phase is responsible for modifying the HTTP headers of a
|
|
271
|
+
response before they are sent back to the client.
|
|
272
|
+
|
|
273
|
+
The "`body_filter`" phase is responsible for modifying the body of a response
|
|
274
|
+
before it is sent back to the client.
|
|
254
275
|
|
|
255
276
|
extra_headers: Send extra headers
|
|
256
277
|
|
|
@@ -261,7 +282,9 @@ class AdvancedRulesResource(SyncAPIResource):
|
|
|
261
282
|
timeout: Override the client-level default timeout for this request, in seconds
|
|
262
283
|
"""
|
|
263
284
|
return self._get_api_list(
|
|
264
|
-
f"/waap/v1/domains/{domain_id}/advanced-rules"
|
|
285
|
+
f"/waap/v1/domains/{domain_id}/advanced-rules"
|
|
286
|
+
if self._client._base_url_overridden
|
|
287
|
+
else f"https://api.gcore.com//waap/v1/domains/{domain_id}/advanced-rules",
|
|
265
288
|
page=SyncOffsetPage[WaapAdvancedRule],
|
|
266
289
|
options=make_request_options(
|
|
267
290
|
extra_headers=extra_headers,
|
|
@@ -295,7 +318,7 @@ class AdvancedRulesResource(SyncAPIResource):
|
|
|
295
318
|
extra_headers: Headers | None = None,
|
|
296
319
|
extra_query: Query | None = None,
|
|
297
320
|
extra_body: Body | None = None,
|
|
298
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
321
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
299
322
|
) -> None:
|
|
300
323
|
"""
|
|
301
324
|
Delete an advanced rule
|
|
@@ -315,7 +338,9 @@ class AdvancedRulesResource(SyncAPIResource):
|
|
|
315
338
|
"""
|
|
316
339
|
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
|
317
340
|
return self._delete(
|
|
318
|
-
f"/waap/v1/domains/{domain_id}/advanced-rules/{rule_id}"
|
|
341
|
+
f"/waap/v1/domains/{domain_id}/advanced-rules/{rule_id}"
|
|
342
|
+
if self._client._base_url_overridden
|
|
343
|
+
else f"https://api.gcore.com//waap/v1/domains/{domain_id}/advanced-rules/{rule_id}",
|
|
319
344
|
options=make_request_options(
|
|
320
345
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
321
346
|
),
|
|
@@ -332,7 +357,7 @@ class AdvancedRulesResource(SyncAPIResource):
|
|
|
332
357
|
extra_headers: Headers | None = None,
|
|
333
358
|
extra_query: Query | None = None,
|
|
334
359
|
extra_body: Body | None = None,
|
|
335
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
360
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
336
361
|
) -> WaapAdvancedRule:
|
|
337
362
|
"""
|
|
338
363
|
Retrieve a specific advanced rule assigned to a domain
|
|
@@ -351,7 +376,9 @@ class AdvancedRulesResource(SyncAPIResource):
|
|
|
351
376
|
timeout: Override the client-level default timeout for this request, in seconds
|
|
352
377
|
"""
|
|
353
378
|
return self._get(
|
|
354
|
-
f"/waap/v1/domains/{domain_id}/advanced-rules/{rule_id}"
|
|
379
|
+
f"/waap/v1/domains/{domain_id}/advanced-rules/{rule_id}"
|
|
380
|
+
if self._client._base_url_overridden
|
|
381
|
+
else f"https://api.gcore.com//waap/v1/domains/{domain_id}/advanced-rules/{rule_id}",
|
|
355
382
|
options=make_request_options(
|
|
356
383
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
357
384
|
),
|
|
@@ -369,7 +396,7 @@ class AdvancedRulesResource(SyncAPIResource):
|
|
|
369
396
|
extra_headers: Headers | None = None,
|
|
370
397
|
extra_query: Query | None = None,
|
|
371
398
|
extra_body: Body | None = None,
|
|
372
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
399
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
373
400
|
) -> None:
|
|
374
401
|
"""
|
|
375
402
|
Toggle an advanced rule
|
|
@@ -393,7 +420,9 @@ class AdvancedRulesResource(SyncAPIResource):
|
|
|
393
420
|
raise ValueError(f"Expected a non-empty value for `action` but received {action!r}")
|
|
394
421
|
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
|
395
422
|
return self._patch(
|
|
396
|
-
f"/waap/v1/domains/{domain_id}/advanced-rules/{rule_id}/{action}"
|
|
423
|
+
f"/waap/v1/domains/{domain_id}/advanced-rules/{rule_id}/{action}"
|
|
424
|
+
if self._client._base_url_overridden
|
|
425
|
+
else f"https://api.gcore.com//waap/v1/domains/{domain_id}/advanced-rules/{rule_id}/{action}",
|
|
397
426
|
options=make_request_options(
|
|
398
427
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
399
428
|
),
|
|
@@ -429,14 +458,14 @@ class AsyncAdvancedRulesResource(AsyncAPIResource):
|
|
|
429
458
|
enabled: bool,
|
|
430
459
|
name: str,
|
|
431
460
|
source: str,
|
|
432
|
-
description:
|
|
433
|
-
phase: Optional[Literal["access", "header_filter", "body_filter"]] |
|
|
461
|
+
description: str | Omit = omit,
|
|
462
|
+
phase: Optional[Literal["access", "header_filter", "body_filter"]] | Omit = omit,
|
|
434
463
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
435
464
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
436
465
|
extra_headers: Headers | None = None,
|
|
437
466
|
extra_query: Query | None = None,
|
|
438
467
|
extra_body: Body | None = None,
|
|
439
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
468
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
440
469
|
) -> WaapAdvancedRule:
|
|
441
470
|
"""
|
|
442
471
|
Create an advanced rule
|
|
@@ -444,7 +473,8 @@ class AsyncAdvancedRulesResource(AsyncAPIResource):
|
|
|
444
473
|
Args:
|
|
445
474
|
domain_id: The domain ID
|
|
446
475
|
|
|
447
|
-
action: The action that the rule takes when triggered
|
|
476
|
+
action: The action that the rule takes when triggered. Only one action can be set per
|
|
477
|
+
rule.
|
|
448
478
|
|
|
449
479
|
enabled: Whether or not the rule is enabled
|
|
450
480
|
|
|
@@ -452,17 +482,23 @@ class AsyncAdvancedRulesResource(AsyncAPIResource):
|
|
|
452
482
|
|
|
453
483
|
source: A CEL syntax expression that contains the rule's conditions. Allowed objects
|
|
454
484
|
are: request, whois, session, response, tags, `user_defined_tags`, `user_agent`,
|
|
455
|
-
`client_data`.
|
|
485
|
+
`client_data`.
|
|
486
|
+
|
|
487
|
+
More info can be found here:
|
|
456
488
|
https://gcore.com/docs/waap/waap-rules/advanced-rules
|
|
457
489
|
|
|
458
490
|
description: The description assigned to the rule
|
|
459
491
|
|
|
460
|
-
phase: The WAAP request/response phase for applying the rule. Default is "access".
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
492
|
+
phase: The WAAP request/response phase for applying the rule. Default is "access".
|
|
493
|
+
|
|
494
|
+
The "access" phase is responsible for modifying the request before it is sent to
|
|
495
|
+
the origin server.
|
|
496
|
+
|
|
497
|
+
The "`header_filter`" phase is responsible for modifying the HTTP headers of a
|
|
498
|
+
response before they are sent back to the client.
|
|
499
|
+
|
|
500
|
+
The "`body_filter`" phase is responsible for modifying the body of a response
|
|
501
|
+
before it is sent back to the client.
|
|
466
502
|
|
|
467
503
|
extra_headers: Send extra headers
|
|
468
504
|
|
|
@@ -473,7 +509,9 @@ class AsyncAdvancedRulesResource(AsyncAPIResource):
|
|
|
473
509
|
timeout: Override the client-level default timeout for this request, in seconds
|
|
474
510
|
"""
|
|
475
511
|
return await self._post(
|
|
476
|
-
f"/waap/v1/domains/{domain_id}/advanced-rules"
|
|
512
|
+
f"/waap/v1/domains/{domain_id}/advanced-rules"
|
|
513
|
+
if self._client._base_url_overridden
|
|
514
|
+
else f"https://api.gcore.com//waap/v1/domains/{domain_id}/advanced-rules",
|
|
477
515
|
body=await async_maybe_transform(
|
|
478
516
|
{
|
|
479
517
|
"action": action,
|
|
@@ -496,18 +534,18 @@ class AsyncAdvancedRulesResource(AsyncAPIResource):
|
|
|
496
534
|
rule_id: int,
|
|
497
535
|
*,
|
|
498
536
|
domain_id: int,
|
|
499
|
-
action: Optional[advanced_rule_update_params.Action] |
|
|
500
|
-
description: Optional[str] |
|
|
501
|
-
enabled: Optional[bool] |
|
|
502
|
-
name: Optional[str] |
|
|
503
|
-
phase: Optional[Literal["access", "header_filter", "body_filter"]] |
|
|
504
|
-
source: Optional[str] |
|
|
537
|
+
action: Optional[advanced_rule_update_params.Action] | Omit = omit,
|
|
538
|
+
description: Optional[str] | Omit = omit,
|
|
539
|
+
enabled: Optional[bool] | Omit = omit,
|
|
540
|
+
name: Optional[str] | Omit = omit,
|
|
541
|
+
phase: Optional[Literal["access", "header_filter", "body_filter"]] | Omit = omit,
|
|
542
|
+
source: Optional[str] | Omit = omit,
|
|
505
543
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
506
544
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
507
545
|
extra_headers: Headers | None = None,
|
|
508
546
|
extra_query: Query | None = None,
|
|
509
547
|
extra_body: Body | None = None,
|
|
510
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
548
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
511
549
|
) -> None:
|
|
512
550
|
"""
|
|
513
551
|
Only properties present in the request will be updated
|
|
@@ -517,7 +555,7 @@ class AsyncAdvancedRulesResource(AsyncAPIResource):
|
|
|
517
555
|
|
|
518
556
|
rule_id: The advanced rule ID
|
|
519
557
|
|
|
520
|
-
action: The action that a WAAP rule takes when triggered
|
|
558
|
+
action: The action that a WAAP rule takes when triggered.
|
|
521
559
|
|
|
522
560
|
description: The description assigned to the rule
|
|
523
561
|
|
|
@@ -525,16 +563,22 @@ class AsyncAdvancedRulesResource(AsyncAPIResource):
|
|
|
525
563
|
|
|
526
564
|
name: The name assigned to the rule
|
|
527
565
|
|
|
528
|
-
phase: The WAAP request/response phase for applying the rule.
|
|
529
|
-
|
|
566
|
+
phase: The WAAP request/response phase for applying the rule.
|
|
567
|
+
|
|
568
|
+
The "access" phase is responsible for modifying the request before it is sent to
|
|
569
|
+
the origin server.
|
|
570
|
+
|
|
530
571
|
The "`header_filter`" phase is responsible for modifying the HTTP headers of a
|
|
531
|
-
response before they are sent back to the client.
|
|
532
|
-
|
|
533
|
-
|
|
572
|
+
response before they are sent back to the client.
|
|
573
|
+
|
|
574
|
+
The "`body_filter`" phase is responsible for modifying the body of a response
|
|
575
|
+
before it is sent back to the client.
|
|
534
576
|
|
|
535
577
|
source: A CEL syntax expression that contains the rule's conditions. Allowed objects
|
|
536
578
|
are: request, whois, session, response, tags, `user_defined_tags`, `user_agent`,
|
|
537
|
-
`client_data`.
|
|
579
|
+
`client_data`.
|
|
580
|
+
|
|
581
|
+
More info can be found here:
|
|
538
582
|
https://gcore.com/docs/waap/waap-rules/advanced-rules
|
|
539
583
|
|
|
540
584
|
extra_headers: Send extra headers
|
|
@@ -547,7 +591,9 @@ class AsyncAdvancedRulesResource(AsyncAPIResource):
|
|
|
547
591
|
"""
|
|
548
592
|
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
|
549
593
|
return await self._patch(
|
|
550
|
-
f"/waap/v1/domains/{domain_id}/advanced-rules/{rule_id}"
|
|
594
|
+
f"/waap/v1/domains/{domain_id}/advanced-rules/{rule_id}"
|
|
595
|
+
if self._client._base_url_overridden
|
|
596
|
+
else f"https://api.gcore.com//waap/v1/domains/{domain_id}/advanced-rules/{rule_id}",
|
|
551
597
|
body=await async_maybe_transform(
|
|
552
598
|
{
|
|
553
599
|
"action": action,
|
|
@@ -569,12 +615,12 @@ class AsyncAdvancedRulesResource(AsyncAPIResource):
|
|
|
569
615
|
self,
|
|
570
616
|
domain_id: int,
|
|
571
617
|
*,
|
|
572
|
-
action: Literal["allow", "block", "captcha", "handshake", "monitor", "tag"] |
|
|
573
|
-
description: str |
|
|
574
|
-
enabled: bool |
|
|
575
|
-
limit: int |
|
|
576
|
-
name: str |
|
|
577
|
-
offset: int |
|
|
618
|
+
action: Literal["allow", "block", "captcha", "handshake", "monitor", "tag"] | Omit = omit,
|
|
619
|
+
description: str | Omit = omit,
|
|
620
|
+
enabled: bool | Omit = omit,
|
|
621
|
+
limit: int | Omit = omit,
|
|
622
|
+
name: str | Omit = omit,
|
|
623
|
+
offset: int | Omit = omit,
|
|
578
624
|
ordering: Optional[
|
|
579
625
|
Literal[
|
|
580
626
|
"id",
|
|
@@ -591,14 +637,14 @@ class AsyncAdvancedRulesResource(AsyncAPIResource):
|
|
|
591
637
|
"-phase",
|
|
592
638
|
]
|
|
593
639
|
]
|
|
594
|
-
|
|
|
595
|
-
phase: Literal["access", "header_filter", "body_filter"] |
|
|
640
|
+
| Omit = omit,
|
|
641
|
+
phase: Literal["access", "header_filter", "body_filter"] | Omit = omit,
|
|
596
642
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
597
643
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
598
644
|
extra_headers: Headers | None = None,
|
|
599
645
|
extra_query: Query | None = None,
|
|
600
646
|
extra_body: Body | None = None,
|
|
601
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
647
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
602
648
|
) -> AsyncPaginator[WaapAdvancedRule, AsyncOffsetPage[WaapAdvancedRule]]:
|
|
603
649
|
"""
|
|
604
650
|
Retrieve a list of advanced rules assigned to a domain, offering filter,
|
|
@@ -621,12 +667,16 @@ class AsyncAdvancedRulesResource(AsyncAPIResource):
|
|
|
621
667
|
|
|
622
668
|
ordering: Determine the field to order results by
|
|
623
669
|
|
|
624
|
-
phase: Filter rules based on the WAAP request/response phase for applying the rule.
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
670
|
+
phase: Filter rules based on the WAAP request/response phase for applying the rule.
|
|
671
|
+
|
|
672
|
+
The "access" phase is responsible for modifying the request before it is sent to
|
|
673
|
+
the origin server.
|
|
674
|
+
|
|
675
|
+
The "`header_filter`" phase is responsible for modifying the HTTP headers of a
|
|
676
|
+
response before they are sent back to the client.
|
|
677
|
+
|
|
678
|
+
The "`body_filter`" phase is responsible for modifying the body of a response
|
|
679
|
+
before it is sent back to the client.
|
|
630
680
|
|
|
631
681
|
extra_headers: Send extra headers
|
|
632
682
|
|
|
@@ -637,7 +687,9 @@ class AsyncAdvancedRulesResource(AsyncAPIResource):
|
|
|
637
687
|
timeout: Override the client-level default timeout for this request, in seconds
|
|
638
688
|
"""
|
|
639
689
|
return self._get_api_list(
|
|
640
|
-
f"/waap/v1/domains/{domain_id}/advanced-rules"
|
|
690
|
+
f"/waap/v1/domains/{domain_id}/advanced-rules"
|
|
691
|
+
if self._client._base_url_overridden
|
|
692
|
+
else f"https://api.gcore.com//waap/v1/domains/{domain_id}/advanced-rules",
|
|
641
693
|
page=AsyncOffsetPage[WaapAdvancedRule],
|
|
642
694
|
options=make_request_options(
|
|
643
695
|
extra_headers=extra_headers,
|
|
@@ -671,7 +723,7 @@ class AsyncAdvancedRulesResource(AsyncAPIResource):
|
|
|
671
723
|
extra_headers: Headers | None = None,
|
|
672
724
|
extra_query: Query | None = None,
|
|
673
725
|
extra_body: Body | None = None,
|
|
674
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
726
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
675
727
|
) -> None:
|
|
676
728
|
"""
|
|
677
729
|
Delete an advanced rule
|
|
@@ -691,7 +743,9 @@ class AsyncAdvancedRulesResource(AsyncAPIResource):
|
|
|
691
743
|
"""
|
|
692
744
|
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
|
693
745
|
return await self._delete(
|
|
694
|
-
f"/waap/v1/domains/{domain_id}/advanced-rules/{rule_id}"
|
|
746
|
+
f"/waap/v1/domains/{domain_id}/advanced-rules/{rule_id}"
|
|
747
|
+
if self._client._base_url_overridden
|
|
748
|
+
else f"https://api.gcore.com//waap/v1/domains/{domain_id}/advanced-rules/{rule_id}",
|
|
695
749
|
options=make_request_options(
|
|
696
750
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
697
751
|
),
|
|
@@ -708,7 +762,7 @@ class AsyncAdvancedRulesResource(AsyncAPIResource):
|
|
|
708
762
|
extra_headers: Headers | None = None,
|
|
709
763
|
extra_query: Query | None = None,
|
|
710
764
|
extra_body: Body | None = None,
|
|
711
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
765
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
712
766
|
) -> WaapAdvancedRule:
|
|
713
767
|
"""
|
|
714
768
|
Retrieve a specific advanced rule assigned to a domain
|
|
@@ -727,7 +781,9 @@ class AsyncAdvancedRulesResource(AsyncAPIResource):
|
|
|
727
781
|
timeout: Override the client-level default timeout for this request, in seconds
|
|
728
782
|
"""
|
|
729
783
|
return await self._get(
|
|
730
|
-
f"/waap/v1/domains/{domain_id}/advanced-rules/{rule_id}"
|
|
784
|
+
f"/waap/v1/domains/{domain_id}/advanced-rules/{rule_id}"
|
|
785
|
+
if self._client._base_url_overridden
|
|
786
|
+
else f"https://api.gcore.com//waap/v1/domains/{domain_id}/advanced-rules/{rule_id}",
|
|
731
787
|
options=make_request_options(
|
|
732
788
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
733
789
|
),
|
|
@@ -745,7 +801,7 @@ class AsyncAdvancedRulesResource(AsyncAPIResource):
|
|
|
745
801
|
extra_headers: Headers | None = None,
|
|
746
802
|
extra_query: Query | None = None,
|
|
747
803
|
extra_body: Body | None = None,
|
|
748
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
804
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
749
805
|
) -> None:
|
|
750
806
|
"""
|
|
751
807
|
Toggle an advanced rule
|
|
@@ -769,7 +825,9 @@ class AsyncAdvancedRulesResource(AsyncAPIResource):
|
|
|
769
825
|
raise ValueError(f"Expected a non-empty value for `action` but received {action!r}")
|
|
770
826
|
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
|
771
827
|
return await self._patch(
|
|
772
|
-
f"/waap/v1/domains/{domain_id}/advanced-rules/{rule_id}/{action}"
|
|
828
|
+
f"/waap/v1/domains/{domain_id}/advanced-rules/{rule_id}/{action}"
|
|
829
|
+
if self._client._base_url_overridden
|
|
830
|
+
else f"https://api.gcore.com//waap/v1/domains/{domain_id}/advanced-rules/{rule_id}/{action}",
|
|
773
831
|
options=make_request_options(
|
|
774
832
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
775
833
|
),
|