gcore 0.1.0a2__py3-none-any.whl → 0.3.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of gcore might be problematic. Click here for more details.
- gcore/__init__.py +5 -0
- gcore/_base_client.py +22 -2
- gcore/_client.py +9 -0
- gcore/_models.py +2 -0
- gcore/_types.py +2 -0
- gcore/_utils/_proxy.py +4 -1
- gcore/_utils/_resources_proxy.py +24 -0
- gcore/_version.py +1 -1
- gcore/resources/__init__.py +14 -0
- gcore/resources/cloud/baremetal/flavors.py +2 -2
- gcore/resources/cloud/baremetal/images.py +2 -2
- gcore/resources/cloud/baremetal/servers.py +280 -52
- gcore/resources/cloud/billing_reservations.py +24 -0
- gcore/resources/cloud/file_shares/file_shares.py +16 -0
- gcore/resources/cloud/floating_ips.py +4 -4
- gcore/resources/cloud/gpu_baremetal_clusters/gpu_baremetal_clusters.py +358 -8
- gcore/resources/cloud/gpu_baremetal_clusters/images.py +206 -2
- gcore/resources/cloud/gpu_baremetal_clusters/servers.py +84 -4
- gcore/resources/cloud/inference/deployments/deployments.py +328 -10
- gcore/resources/cloud/instances/flavors.py +2 -2
- gcore/resources/cloud/instances/images.py +318 -2
- gcore/resources/cloud/instances/instances.py +534 -70
- gcore/resources/cloud/instances/interfaces.py +4 -4
- gcore/resources/cloud/load_balancers/flavors.py +2 -2
- gcore/resources/cloud/load_balancers/l7_policies/l7_policies.py +302 -20
- gcore/resources/cloud/load_balancers/l7_policies/rules.py +326 -0
- gcore/resources/cloud/load_balancers/listeners.py +385 -20
- gcore/resources/cloud/load_balancers/load_balancers.py +392 -24
- gcore/resources/cloud/load_balancers/pools/health_monitors.py +24 -0
- gcore/resources/cloud/load_balancers/pools/members.py +34 -6
- gcore/resources/cloud/load_balancers/pools/pools.py +388 -8
- gcore/resources/cloud/networks/networks.py +72 -16
- gcore/resources/cloud/networks/subnets.py +6 -6
- gcore/resources/cloud/registries/registries.py +6 -10
- gcore/resources/cloud/registries/users.py +4 -10
- gcore/resources/cloud/reserved_fixed_ips/reserved_fixed_ips.py +10 -10
- gcore/resources/cloud/secrets.py +56 -11
- gcore/resources/cloud/security_groups/security_groups.py +2 -2
- gcore/resources/cloud/ssh_keys.py +2 -2
- gcore/resources/cloud/tasks.py +203 -184
- gcore/resources/cloud/users/role_assignments.py +4 -4
- gcore/resources/cloud/volumes.py +18 -18
- gcore/resources/waap/__init__.py +131 -0
- gcore/resources/waap/advanced_rules.py +135 -0
- gcore/resources/waap/clients.py +135 -0
- gcore/resources/waap/custom_page_sets.py +805 -0
- gcore/resources/waap/domains/__init__.py +173 -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 +914 -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 +271 -0
- 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 +391 -0
- gcore/types/cloud/__init__.py +1 -0
- gcore/types/cloud/allowed_address_pairs.py +2 -2
- gcore/types/cloud/baremetal/baremetal_server.py +1 -1
- gcore/types/cloud/baremetal/image_list_params.py +1 -1
- gcore/types/cloud/baremetal/server_create_params.py +9 -9
- gcore/types/cloud/baremetal/server_list_params.py +8 -8
- gcore/types/cloud/baremetal/server_rebuild_params.py +1 -1
- gcore/types/cloud/baremetal_flavor.py +3 -3
- gcore/types/cloud/billing_reservation_list_params.py +5 -0
- gcore/types/cloud/container_probe_config.py +1 -1
- gcore/types/cloud/container_probe_config_create_param.py +2 -3
- gcore/types/cloud/container_scale_triggers.py +2 -2
- gcore/types/cloud/file_share.py +3 -0
- gcore/types/cloud/file_share_list_params.py +7 -1
- gcore/types/cloud/floating_ip_detailed.py +1 -1
- gcore/types/cloud/floating_ip_list_params.py +2 -2
- gcore/types/cloud/gpu_baremetal_cluster.py +1 -1
- gcore/types/cloud/gpu_baremetal_cluster_create_params.py +21 -1
- 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 +1 -1
- 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/image.py +1 -1
- gcore/types/cloud/inference/deployment_create_params.py +4 -4
- gcore/types/cloud/inference/deployment_update_params.py +206 -9
- gcore/types/cloud/inference/inference.py +5 -5
- gcore/types/cloud/instance.py +1 -1
- gcore/types/cloud/instance_create_params.py +8 -10
- gcore/types/cloud/instance_list_params.py +8 -8
- gcore/types/cloud/instances/flavor_list_suitable_params.py +4 -1
- gcore/types/cloud/instances/image_list_params.py +1 -1
- 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 +17 -15
- 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 -5
- gcore/types/cloud/load_balancer_listener_detail.py +17 -17
- gcore/types/cloud/load_balancer_pool.py +13 -13
- gcore/types/cloud/load_balancer_pool_list.py +99 -4
- 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 +6 -4
- gcore/types/cloud/load_balancers/listener_get_params.py +3 -1
- gcore/types/cloud/load_balancers/listener_list_params.py +4 -2
- gcore/types/cloud/load_balancers/listener_update_params.py +5 -3
- gcore/types/cloud/load_balancers/pool_create_params.py +6 -4
- gcore/types/cloud/load_balancers/pool_list_params.py +5 -6
- gcore/types/cloud/load_balancers/pool_update_params.py +6 -4
- gcore/types/cloud/load_balancers/pools/health_monitor_create_params.py +2 -0
- gcore/types/cloud/load_balancers/pools/member_add_params.py +5 -3
- gcore/types/cloud/member.py +2 -2
- gcore/types/cloud/network.py +22 -22
- gcore/types/cloud/network_create_params.py +2 -0
- gcore/types/cloud/network_details.py +25 -24
- gcore/types/cloud/network_list_params.py +15 -10
- gcore/types/cloud/network_update_params.py +2 -0
- gcore/types/cloud/networks/subnet_create_params.py +1 -1
- gcore/types/cloud/networks/subnet_list_params.py +2 -2
- gcore/types/cloud/quota_get_all_response.py +18 -0
- gcore/types/cloud/quota_get_by_region_response.py +18 -0
- gcore/types/cloud/quotas/request_create_params.py +9 -0
- gcore/types/cloud/quotas/request_get_response.py +9 -0
- gcore/types/cloud/quotas/request_list_response.py +9 -0
- gcore/types/cloud/region.py +4 -4
- gcore/types/cloud/registries/user_create_multiple_params.py +3 -5
- gcore/types/cloud/registries/user_create_params.py +3 -5
- 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/secret_list_params.py +24 -0
- gcore/types/cloud/security_group_list_params.py +1 -1
- gcore/types/cloud/session_persistence.py +1 -1
- gcore/types/cloud/ssh_key_created.py +3 -6
- gcore/types/cloud/task.py +1 -4
- gcore/types/cloud/task_list_params.py +56 -46
- 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 -3
- gcore/types/waap/__init__.py +108 -0
- gcore/types/waap/client_me_response.py +34 -0
- 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_params.py +30 -0
- gcore/types/waap/domain_list_rule_sets_response.py +10 -0
- gcore/types/waap/domain_update_params.py +12 -0
- gcore/types/waap/domains/__init__.py +47 -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 +368 -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 +371 -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 +48 -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 +373 -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_detailed_domain.py +37 -0
- gcore/types/waap/waap_domain_api_settings.py +22 -0
- gcore/types/waap/waap_domain_ddos_settings.py +31 -0
- gcore/types/waap/waap_domain_policy.py +29 -0
- gcore/types/waap/waap_domain_settings_model.py +15 -0
- gcore/types/waap/waap_domain_status.py +7 -0
- 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_summary_domain.py +26 -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.1.0a2.dist-info → gcore-0.3.0.dist-info}/METADATA +3 -3
- {gcore-0.1.0a2.dist-info → gcore-0.3.0.dist-info}/RECORD +293 -126
- {gcore-0.1.0a2.dist-info → gcore-0.3.0.dist-info}/WHEEL +0 -0
- {gcore-0.1.0a2.dist-info → gcore-0.3.0.dist-info}/licenses/LICENSE +0 -0
|
@@ -217,7 +217,7 @@ class InterfacesResource(SyncAPIResource):
|
|
|
217
217
|
|
|
218
218
|
security_groups: List of security group IDs
|
|
219
219
|
|
|
220
|
-
type: Must be 'any_subnet'
|
|
220
|
+
type: Must be '`any_subnet`'
|
|
221
221
|
|
|
222
222
|
extra_headers: Send extra headers
|
|
223
223
|
|
|
@@ -264,7 +264,7 @@ class InterfacesResource(SyncAPIResource):
|
|
|
264
264
|
|
|
265
265
|
security_groups: List of security group IDs
|
|
266
266
|
|
|
267
|
-
type: Must be 'reserved_fixed_ip'. Union tag
|
|
267
|
+
type: Must be '`reserved_fixed_ip`'. Union tag
|
|
268
268
|
|
|
269
269
|
extra_headers: Send extra headers
|
|
270
270
|
|
|
@@ -573,7 +573,7 @@ class AsyncInterfacesResource(AsyncAPIResource):
|
|
|
573
573
|
|
|
574
574
|
security_groups: List of security group IDs
|
|
575
575
|
|
|
576
|
-
type: Must be 'any_subnet'
|
|
576
|
+
type: Must be '`any_subnet`'
|
|
577
577
|
|
|
578
578
|
extra_headers: Send extra headers
|
|
579
579
|
|
|
@@ -620,7 +620,7 @@ class AsyncInterfacesResource(AsyncAPIResource):
|
|
|
620
620
|
|
|
621
621
|
security_groups: List of security group IDs
|
|
622
622
|
|
|
623
|
-
type: Must be 'reserved_fixed_ip'. Union tag
|
|
623
|
+
type: Must be '`reserved_fixed_ip`'. Union tag
|
|
624
624
|
|
|
625
625
|
extra_headers: Send extra headers
|
|
626
626
|
|
|
@@ -56,7 +56,7 @@ class FlavorsResource(SyncAPIResource):
|
|
|
56
56
|
) -> LoadBalancerFlavorList:
|
|
57
57
|
"""Retrieve a list of load balancer flavors.
|
|
58
58
|
|
|
59
|
-
When the include_prices query
|
|
59
|
+
When the `include_prices` query
|
|
60
60
|
parameter is specified, the list shows prices. A client in trial mode gets all
|
|
61
61
|
price values as 0. If you get Pricing Error contact the support
|
|
62
62
|
|
|
@@ -123,7 +123,7 @@ class AsyncFlavorsResource(AsyncAPIResource):
|
|
|
123
123
|
) -> LoadBalancerFlavorList:
|
|
124
124
|
"""Retrieve a list of load balancer flavors.
|
|
125
125
|
|
|
126
|
-
When the include_prices query
|
|
126
|
+
When the `include_prices` query
|
|
127
127
|
parameter is specified, the list shows prices. A client in trial mode gets all
|
|
128
128
|
price values as 0. If you get Pricing Error contact the support
|
|
129
129
|
|
|
@@ -92,17 +92,17 @@ class L7PoliciesResource(SyncAPIResource):
|
|
|
92
92
|
position: The position of this policy on the listener. Positions start at 1.
|
|
93
93
|
|
|
94
94
|
redirect_http_code: Requests matching this policy will be redirected to the specified URL or Prefix
|
|
95
|
-
URL with the HTTP response code. Valid if action is REDIRECT_TO_URL or
|
|
96
|
-
REDIRECT_PREFIX
|
|
95
|
+
URL with the HTTP response code. Valid if action is `REDIRECT_TO_URL` or
|
|
96
|
+
`REDIRECT_PREFIX`. Valid options are 301, 302, 303, 307, or 308. Default is 302.
|
|
97
97
|
|
|
98
98
|
redirect_pool_id: Requests matching this policy will be redirected to the pool withthis ID. Only
|
|
99
|
-
valid if action is REDIRECT_TO_POOL
|
|
99
|
+
valid if action is `REDIRECT_TO_POOL`.
|
|
100
100
|
|
|
101
101
|
redirect_prefix: Requests matching this policy will be redirected to this Prefix URL. Only valid
|
|
102
|
-
if action is REDIRECT_PREFIX
|
|
102
|
+
if action is `REDIRECT_PREFIX`.
|
|
103
103
|
|
|
104
104
|
redirect_url: Requests matching this policy will be redirected to this URL. Only valid if
|
|
105
|
-
action is REDIRECT_TO_URL
|
|
105
|
+
action is `REDIRECT_TO_URL`.
|
|
106
106
|
|
|
107
107
|
tags: A list of simple strings assigned to the resource.
|
|
108
108
|
|
|
@@ -286,17 +286,17 @@ class L7PoliciesResource(SyncAPIResource):
|
|
|
286
286
|
position: The position of this policy on the listener. Positions start at 1.
|
|
287
287
|
|
|
288
288
|
redirect_http_code: Requests matching this policy will be redirected to the specified URL or Prefix
|
|
289
|
-
URL with the HTTP response code. Valid if action is REDIRECT_TO_URL or
|
|
290
|
-
REDIRECT_PREFIX
|
|
289
|
+
URL with the HTTP response code. Valid if action is `REDIRECT_TO_URL` or
|
|
290
|
+
`REDIRECT_PREFIX`. Valid options are 301, 302, 303, 307, or 308. Default is 302.
|
|
291
291
|
|
|
292
292
|
redirect_pool_id: Requests matching this policy will be redirected to the pool with this ID. Only
|
|
293
|
-
valid if action is REDIRECT_TO_POOL
|
|
293
|
+
valid if action is `REDIRECT_TO_POOL`.
|
|
294
294
|
|
|
295
295
|
redirect_prefix: Requests matching this policy will be redirected to this Prefix URL. Only valid
|
|
296
|
-
if action is REDIRECT_PREFIX
|
|
296
|
+
if action is `REDIRECT_PREFIX`.
|
|
297
297
|
|
|
298
298
|
redirect_url: Requests matching this policy will be redirected to this URL. Only valid if
|
|
299
|
-
action is REDIRECT_TO_URL
|
|
299
|
+
action is `REDIRECT_TO_URL`.
|
|
300
300
|
|
|
301
301
|
tags: A list of simple strings assigned to the resource.
|
|
302
302
|
|
|
@@ -335,6 +335,147 @@ class L7PoliciesResource(SyncAPIResource):
|
|
|
335
335
|
cast_to=TaskIDList,
|
|
336
336
|
)
|
|
337
337
|
|
|
338
|
+
def create_and_poll(
|
|
339
|
+
self,
|
|
340
|
+
*,
|
|
341
|
+
project_id: int | None = None,
|
|
342
|
+
region_id: int | None = None,
|
|
343
|
+
action: Literal["REDIRECT_PREFIX", "REDIRECT_TO_POOL", "REDIRECT_TO_URL", "REJECT"],
|
|
344
|
+
listener_id: str,
|
|
345
|
+
name: str | NotGiven = NOT_GIVEN,
|
|
346
|
+
position: int | NotGiven = NOT_GIVEN,
|
|
347
|
+
redirect_http_code: int | NotGiven = NOT_GIVEN,
|
|
348
|
+
redirect_pool_id: str | NotGiven = NOT_GIVEN,
|
|
349
|
+
redirect_prefix: str | NotGiven = NOT_GIVEN,
|
|
350
|
+
redirect_url: str | NotGiven = NOT_GIVEN,
|
|
351
|
+
tags: List[str] | NotGiven = NOT_GIVEN,
|
|
352
|
+
polling_interval_seconds: int | NotGiven = NOT_GIVEN,
|
|
353
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
354
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
355
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
356
|
+
extra_headers: Headers | None = None,
|
|
357
|
+
extra_query: Query | None = None,
|
|
358
|
+
extra_body: Body | None = None,
|
|
359
|
+
) -> LoadBalancerL7Policy:
|
|
360
|
+
response = self.create(
|
|
361
|
+
project_id=project_id,
|
|
362
|
+
region_id=region_id,
|
|
363
|
+
action=action,
|
|
364
|
+
listener_id=listener_id,
|
|
365
|
+
name=name,
|
|
366
|
+
position=position,
|
|
367
|
+
redirect_http_code=redirect_http_code,
|
|
368
|
+
redirect_pool_id=redirect_pool_id,
|
|
369
|
+
redirect_prefix=redirect_prefix,
|
|
370
|
+
redirect_url=redirect_url,
|
|
371
|
+
tags=tags,
|
|
372
|
+
extra_headers=extra_headers,
|
|
373
|
+
extra_query=extra_query,
|
|
374
|
+
extra_body=extra_body,
|
|
375
|
+
timeout=timeout,
|
|
376
|
+
)
|
|
377
|
+
if not response.tasks or len(response.tasks) != 1:
|
|
378
|
+
raise ValueError(f"Expected exactly one task to be created")
|
|
379
|
+
task = self._client.cloud.tasks.poll(
|
|
380
|
+
task_id=response.tasks[0],
|
|
381
|
+
extra_headers=extra_headers,
|
|
382
|
+
polling_interval_seconds=polling_interval_seconds,
|
|
383
|
+
)
|
|
384
|
+
if not task.created_resources or not task.created_resources.l7polices or len(task.created_resources.l7polices) != 1:
|
|
385
|
+
raise ValueError(f"Expected exactly one resource to be created in a task")
|
|
386
|
+
return self.get(
|
|
387
|
+
l7policy_id=task.created_resources.l7polices[0],
|
|
388
|
+
project_id=project_id,
|
|
389
|
+
region_id=region_id,
|
|
390
|
+
extra_headers=extra_headers,
|
|
391
|
+
timeout=timeout,
|
|
392
|
+
)
|
|
393
|
+
|
|
394
|
+
def delete_and_poll(
|
|
395
|
+
self,
|
|
396
|
+
l7policy_id: str,
|
|
397
|
+
*,
|
|
398
|
+
project_id: int | None = None,
|
|
399
|
+
region_id: int | None = None,
|
|
400
|
+
polling_interval_seconds: int | NotGiven = NOT_GIVEN,
|
|
401
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
402
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
403
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
404
|
+
extra_headers: Headers | None = None,
|
|
405
|
+
extra_query: Query | None = None,
|
|
406
|
+
extra_body: Body | None = None,
|
|
407
|
+
) -> None:
|
|
408
|
+
response = self.delete(
|
|
409
|
+
l7policy_id=l7policy_id,
|
|
410
|
+
project_id=project_id,
|
|
411
|
+
region_id=region_id,
|
|
412
|
+
extra_headers=extra_headers,
|
|
413
|
+
extra_query=extra_query,
|
|
414
|
+
extra_body=extra_body,
|
|
415
|
+
timeout=timeout,
|
|
416
|
+
)
|
|
417
|
+
if not response.tasks or len(response.tasks) != 1:
|
|
418
|
+
raise ValueError(f"Expected exactly one task to be created")
|
|
419
|
+
self._client.cloud.tasks.poll(
|
|
420
|
+
task_id=response.tasks[0],
|
|
421
|
+
extra_headers=extra_headers,
|
|
422
|
+
polling_interval_seconds=polling_interval_seconds,
|
|
423
|
+
)
|
|
424
|
+
|
|
425
|
+
def replace_and_poll(
|
|
426
|
+
self,
|
|
427
|
+
l7policy_id: str,
|
|
428
|
+
*,
|
|
429
|
+
project_id: int | None = None,
|
|
430
|
+
region_id: int | None = None,
|
|
431
|
+
action: Literal["REDIRECT_PREFIX", "REDIRECT_TO_POOL", "REDIRECT_TO_URL", "REJECT"],
|
|
432
|
+
name: str | NotGiven = NOT_GIVEN,
|
|
433
|
+
position: int | NotGiven = NOT_GIVEN,
|
|
434
|
+
redirect_http_code: int | NotGiven = NOT_GIVEN,
|
|
435
|
+
redirect_pool_id: str | NotGiven = NOT_GIVEN,
|
|
436
|
+
redirect_prefix: str | NotGiven = NOT_GIVEN,
|
|
437
|
+
redirect_url: str | NotGiven = NOT_GIVEN,
|
|
438
|
+
tags: List[str] | NotGiven = NOT_GIVEN,
|
|
439
|
+
polling_interval_seconds: int | NotGiven = NOT_GIVEN,
|
|
440
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
441
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
442
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
443
|
+
extra_headers: Headers | None = None,
|
|
444
|
+
extra_query: Query | None = None,
|
|
445
|
+
extra_body: Body | None = None,
|
|
446
|
+
) -> LoadBalancerL7Policy:
|
|
447
|
+
response = self.replace(
|
|
448
|
+
l7policy_id=l7policy_id,
|
|
449
|
+
project_id=project_id,
|
|
450
|
+
region_id=region_id,
|
|
451
|
+
action=action,
|
|
452
|
+
name=name,
|
|
453
|
+
position=position,
|
|
454
|
+
redirect_http_code=redirect_http_code,
|
|
455
|
+
redirect_pool_id=redirect_pool_id,
|
|
456
|
+
redirect_prefix=redirect_prefix,
|
|
457
|
+
redirect_url=redirect_url,
|
|
458
|
+
tags=tags,
|
|
459
|
+
extra_headers=extra_headers,
|
|
460
|
+
extra_query=extra_query,
|
|
461
|
+
extra_body=extra_body,
|
|
462
|
+
timeout=timeout,
|
|
463
|
+
)
|
|
464
|
+
if not response.tasks or len(response.tasks) != 1:
|
|
465
|
+
raise ValueError(f"Expected exactly one task to be created")
|
|
466
|
+
self._client.cloud.tasks.poll(
|
|
467
|
+
task_id=response.tasks[0],
|
|
468
|
+
extra_headers=extra_headers,
|
|
469
|
+
polling_interval_seconds=polling_interval_seconds,
|
|
470
|
+
)
|
|
471
|
+
return self.get(
|
|
472
|
+
l7policy_id=l7policy_id,
|
|
473
|
+
project_id=project_id,
|
|
474
|
+
region_id=region_id,
|
|
475
|
+
extra_headers=extra_headers,
|
|
476
|
+
timeout=timeout,
|
|
477
|
+
)
|
|
478
|
+
|
|
338
479
|
|
|
339
480
|
class AsyncL7PoliciesResource(AsyncAPIResource):
|
|
340
481
|
@cached_property
|
|
@@ -394,17 +535,17 @@ class AsyncL7PoliciesResource(AsyncAPIResource):
|
|
|
394
535
|
position: The position of this policy on the listener. Positions start at 1.
|
|
395
536
|
|
|
396
537
|
redirect_http_code: Requests matching this policy will be redirected to the specified URL or Prefix
|
|
397
|
-
URL with the HTTP response code. Valid if action is REDIRECT_TO_URL or
|
|
398
|
-
REDIRECT_PREFIX
|
|
538
|
+
URL with the HTTP response code. Valid if action is `REDIRECT_TO_URL` or
|
|
539
|
+
`REDIRECT_PREFIX`. Valid options are 301, 302, 303, 307, or 308. Default is 302.
|
|
399
540
|
|
|
400
541
|
redirect_pool_id: Requests matching this policy will be redirected to the pool withthis ID. Only
|
|
401
|
-
valid if action is REDIRECT_TO_POOL
|
|
542
|
+
valid if action is `REDIRECT_TO_POOL`.
|
|
402
543
|
|
|
403
544
|
redirect_prefix: Requests matching this policy will be redirected to this Prefix URL. Only valid
|
|
404
|
-
if action is REDIRECT_PREFIX
|
|
545
|
+
if action is `REDIRECT_PREFIX`.
|
|
405
546
|
|
|
406
547
|
redirect_url: Requests matching this policy will be redirected to this URL. Only valid if
|
|
407
|
-
action is REDIRECT_TO_URL
|
|
548
|
+
action is `REDIRECT_TO_URL`.
|
|
408
549
|
|
|
409
550
|
tags: A list of simple strings assigned to the resource.
|
|
410
551
|
|
|
@@ -588,17 +729,17 @@ class AsyncL7PoliciesResource(AsyncAPIResource):
|
|
|
588
729
|
position: The position of this policy on the listener. Positions start at 1.
|
|
589
730
|
|
|
590
731
|
redirect_http_code: Requests matching this policy will be redirected to the specified URL or Prefix
|
|
591
|
-
URL with the HTTP response code. Valid if action is REDIRECT_TO_URL or
|
|
592
|
-
REDIRECT_PREFIX
|
|
732
|
+
URL with the HTTP response code. Valid if action is `REDIRECT_TO_URL` or
|
|
733
|
+
`REDIRECT_PREFIX`. Valid options are 301, 302, 303, 307, or 308. Default is 302.
|
|
593
734
|
|
|
594
735
|
redirect_pool_id: Requests matching this policy will be redirected to the pool with this ID. Only
|
|
595
|
-
valid if action is REDIRECT_TO_POOL
|
|
736
|
+
valid if action is `REDIRECT_TO_POOL`.
|
|
596
737
|
|
|
597
738
|
redirect_prefix: Requests matching this policy will be redirected to this Prefix URL. Only valid
|
|
598
|
-
if action is REDIRECT_PREFIX
|
|
739
|
+
if action is `REDIRECT_PREFIX`.
|
|
599
740
|
|
|
600
741
|
redirect_url: Requests matching this policy will be redirected to this URL. Only valid if
|
|
601
|
-
action is REDIRECT_TO_URL
|
|
742
|
+
action is `REDIRECT_TO_URL`.
|
|
602
743
|
|
|
603
744
|
tags: A list of simple strings assigned to the resource.
|
|
604
745
|
|
|
@@ -637,6 +778,147 @@ class AsyncL7PoliciesResource(AsyncAPIResource):
|
|
|
637
778
|
cast_to=TaskIDList,
|
|
638
779
|
)
|
|
639
780
|
|
|
781
|
+
async def create_and_poll(
|
|
782
|
+
self,
|
|
783
|
+
*,
|
|
784
|
+
project_id: int | None = None,
|
|
785
|
+
region_id: int | None = None,
|
|
786
|
+
action: Literal["REDIRECT_PREFIX", "REDIRECT_TO_POOL", "REDIRECT_TO_URL", "REJECT"],
|
|
787
|
+
listener_id: str,
|
|
788
|
+
name: str | NotGiven = NOT_GIVEN,
|
|
789
|
+
position: int | NotGiven = NOT_GIVEN,
|
|
790
|
+
redirect_http_code: int | NotGiven = NOT_GIVEN,
|
|
791
|
+
redirect_pool_id: str | NotGiven = NOT_GIVEN,
|
|
792
|
+
redirect_prefix: str | NotGiven = NOT_GIVEN,
|
|
793
|
+
redirect_url: str | NotGiven = NOT_GIVEN,
|
|
794
|
+
tags: List[str] | NotGiven = NOT_GIVEN,
|
|
795
|
+
polling_interval_seconds: int | NotGiven = NOT_GIVEN,
|
|
796
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
797
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
798
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
799
|
+
extra_headers: Headers | None = None,
|
|
800
|
+
extra_query: Query | None = None,
|
|
801
|
+
extra_body: Body | None = None,
|
|
802
|
+
) -> LoadBalancerL7Policy:
|
|
803
|
+
response = await self.create(
|
|
804
|
+
project_id=project_id,
|
|
805
|
+
region_id=region_id,
|
|
806
|
+
action=action,
|
|
807
|
+
listener_id=listener_id,
|
|
808
|
+
name=name,
|
|
809
|
+
position=position,
|
|
810
|
+
redirect_http_code=redirect_http_code,
|
|
811
|
+
redirect_pool_id=redirect_pool_id,
|
|
812
|
+
redirect_prefix=redirect_prefix,
|
|
813
|
+
redirect_url=redirect_url,
|
|
814
|
+
tags=tags,
|
|
815
|
+
extra_headers=extra_headers,
|
|
816
|
+
extra_query=extra_query,
|
|
817
|
+
extra_body=extra_body,
|
|
818
|
+
timeout=timeout,
|
|
819
|
+
)
|
|
820
|
+
if not response.tasks or len(response.tasks) != 1:
|
|
821
|
+
raise ValueError(f"Expected exactly one task to be created")
|
|
822
|
+
task = await self._client.cloud.tasks.poll(
|
|
823
|
+
task_id=response.tasks[0],
|
|
824
|
+
extra_headers=extra_headers,
|
|
825
|
+
polling_interval_seconds=polling_interval_seconds,
|
|
826
|
+
)
|
|
827
|
+
if not task.created_resources or not task.created_resources.l7polices or len(task.created_resources.l7polices) != 1:
|
|
828
|
+
raise ValueError(f"Expected exactly one resource to be created in a task")
|
|
829
|
+
return await self.get(
|
|
830
|
+
l7policy_id=task.created_resources.l7polices[0],
|
|
831
|
+
project_id=project_id,
|
|
832
|
+
region_id=region_id,
|
|
833
|
+
extra_headers=extra_headers,
|
|
834
|
+
timeout=timeout,
|
|
835
|
+
)
|
|
836
|
+
|
|
837
|
+
async def delete_and_poll(
|
|
838
|
+
self,
|
|
839
|
+
l7policy_id: str,
|
|
840
|
+
*,
|
|
841
|
+
project_id: int | None = None,
|
|
842
|
+
region_id: int | None = None,
|
|
843
|
+
polling_interval_seconds: int | NotGiven = NOT_GIVEN,
|
|
844
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
845
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
846
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
847
|
+
extra_headers: Headers | None = None,
|
|
848
|
+
extra_query: Query | None = None,
|
|
849
|
+
extra_body: Body | None = None,
|
|
850
|
+
) -> None:
|
|
851
|
+
response = await self.delete(
|
|
852
|
+
l7policy_id=l7policy_id,
|
|
853
|
+
project_id=project_id,
|
|
854
|
+
region_id=region_id,
|
|
855
|
+
extra_headers=extra_headers,
|
|
856
|
+
extra_query=extra_query,
|
|
857
|
+
extra_body=extra_body,
|
|
858
|
+
timeout=timeout,
|
|
859
|
+
)
|
|
860
|
+
if not response.tasks or len(response.tasks) != 1:
|
|
861
|
+
raise ValueError(f"Expected exactly one task to be created")
|
|
862
|
+
await self._client.cloud.tasks.poll(
|
|
863
|
+
task_id=response.tasks[0],
|
|
864
|
+
extra_headers=extra_headers,
|
|
865
|
+
polling_interval_seconds=polling_interval_seconds,
|
|
866
|
+
)
|
|
867
|
+
|
|
868
|
+
async def replace_and_poll(
|
|
869
|
+
self,
|
|
870
|
+
l7policy_id: str,
|
|
871
|
+
*,
|
|
872
|
+
project_id: int | None = None,
|
|
873
|
+
region_id: int | None = None,
|
|
874
|
+
action: Literal["REDIRECT_PREFIX", "REDIRECT_TO_POOL", "REDIRECT_TO_URL", "REJECT"],
|
|
875
|
+
name: str | NotGiven = NOT_GIVEN,
|
|
876
|
+
position: int | NotGiven = NOT_GIVEN,
|
|
877
|
+
redirect_http_code: int | NotGiven = NOT_GIVEN,
|
|
878
|
+
redirect_pool_id: str | NotGiven = NOT_GIVEN,
|
|
879
|
+
redirect_prefix: str | NotGiven = NOT_GIVEN,
|
|
880
|
+
redirect_url: str | NotGiven = NOT_GIVEN,
|
|
881
|
+
tags: List[str] | NotGiven = NOT_GIVEN,
|
|
882
|
+
polling_interval_seconds: int | NotGiven = NOT_GIVEN,
|
|
883
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
884
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
885
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
886
|
+
extra_headers: Headers | None = None,
|
|
887
|
+
extra_query: Query | None = None,
|
|
888
|
+
extra_body: Body | None = None,
|
|
889
|
+
) -> LoadBalancerL7Policy:
|
|
890
|
+
response = await self.replace(
|
|
891
|
+
l7policy_id=l7policy_id,
|
|
892
|
+
project_id=project_id,
|
|
893
|
+
region_id=region_id,
|
|
894
|
+
action=action,
|
|
895
|
+
name=name,
|
|
896
|
+
position=position,
|
|
897
|
+
redirect_http_code=redirect_http_code,
|
|
898
|
+
redirect_pool_id=redirect_pool_id,
|
|
899
|
+
redirect_prefix=redirect_prefix,
|
|
900
|
+
redirect_url=redirect_url,
|
|
901
|
+
tags=tags,
|
|
902
|
+
extra_headers=extra_headers,
|
|
903
|
+
extra_query=extra_query,
|
|
904
|
+
extra_body=extra_body,
|
|
905
|
+
timeout=timeout,
|
|
906
|
+
)
|
|
907
|
+
if not response.tasks or len(response.tasks) != 1:
|
|
908
|
+
raise ValueError(f"Expected exactly one task to be created")
|
|
909
|
+
await self._client.cloud.tasks.poll(
|
|
910
|
+
task_id=response.tasks[0],
|
|
911
|
+
extra_headers=extra_headers,
|
|
912
|
+
polling_interval_seconds=polling_interval_seconds,
|
|
913
|
+
)
|
|
914
|
+
return await self.get(
|
|
915
|
+
l7policy_id=l7policy_id,
|
|
916
|
+
project_id=project_id,
|
|
917
|
+
region_id=region_id,
|
|
918
|
+
extra_headers=extra_headers,
|
|
919
|
+
timeout=timeout,
|
|
920
|
+
)
|
|
921
|
+
|
|
640
922
|
|
|
641
923
|
class L7PoliciesResourceWithRawResponse:
|
|
642
924
|
def __init__(self, l7_policies: L7PoliciesResource) -> None:
|