gcore 0.10.0__py3-none-any.whl → 0.11.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of gcore might be problematic. Click here for more details.
- gcore/_base_client.py +3 -3
- gcore/_client.py +18 -0
- gcore/_compat.py +48 -48
- gcore/_models.py +41 -41
- gcore/_types.py +35 -1
- gcore/_utils/__init__.py +9 -2
- gcore/_utils/_compat.py +45 -0
- gcore/_utils/_datetime_parse.py +136 -0
- gcore/_utils/_transform.py +11 -1
- gcore/_utils/_typing.py +6 -1
- gcore/_utils/_utils.py +0 -1
- gcore/_version.py +1 -1
- gcore/resources/__init__.py +28 -0
- gcore/resources/cloud/__init__.py +14 -0
- gcore/resources/cloud/audit_logs.py +3 -3
- gcore/resources/cloud/baremetal/images.py +3 -4
- gcore/resources/cloud/baremetal/servers.py +16 -4
- gcore/resources/cloud/cloud.py +32 -0
- gcore/resources/cloud/cost_reports.py +24 -16
- gcore/resources/cloud/file_shares/access_rules.py +2 -2
- gcore/resources/cloud/file_shares/file_shares.py +30 -14
- gcore/resources/cloud/floating_ips.py +196 -4
- gcore/resources/cloud/gpu_baremetal_clusters/flavors.py +1 -1
- gcore/resources/cloud/gpu_baremetal_clusters/gpu_baremetal_clusters.py +166 -190
- gcore/resources/cloud/gpu_baremetal_clusters/servers.py +268 -12
- gcore/resources/cloud/inference/__init__.py +14 -14
- gcore/resources/cloud/inference/applications/__init__.py +47 -0
- gcore/resources/cloud/inference/applications/applications.py +134 -0
- gcore/resources/cloud/inference/applications/deployments.py +649 -0
- gcore/resources/cloud/inference/applications/templates.py +238 -0
- gcore/resources/cloud/inference/deployments/deployments.py +41 -22
- gcore/resources/cloud/inference/inference.py +32 -32
- gcore/resources/cloud/inference/registry_credentials.py +8 -9
- gcore/resources/cloud/instances/images.py +4 -4
- gcore/resources/cloud/instances/instances.py +254 -4
- gcore/resources/cloud/instances/interfaces.py +544 -0
- gcore/resources/cloud/k8s/__init__.py +47 -0
- gcore/resources/cloud/k8s/clusters/__init__.py +47 -0
- gcore/resources/cloud/k8s/clusters/clusters.py +1391 -0
- gcore/resources/cloud/k8s/clusters/nodes.py +291 -0
- gcore/resources/cloud/k8s/clusters/pools/__init__.py +33 -0
- gcore/resources/cloud/k8s/clusters/pools/nodes.py +303 -0
- gcore/resources/cloud/k8s/clusters/pools/pools.py +870 -0
- gcore/resources/cloud/k8s/flavors.py +209 -0
- gcore/resources/cloud/k8s/k8s.py +233 -0
- gcore/resources/cloud/load_balancers/l7_policies/l7_policies.py +11 -12
- gcore/resources/cloud/load_balancers/l7_policies/rules.py +9 -10
- gcore/resources/cloud/load_balancers/listeners.py +18 -18
- gcore/resources/cloud/load_balancers/load_balancers.py +4 -4
- gcore/resources/cloud/load_balancers/pools/health_monitors.py +18 -6
- gcore/resources/cloud/load_balancers/pools/members.py +32 -2
- gcore/resources/cloud/load_balancers/pools/pools.py +32 -8
- gcore/resources/cloud/networks/networks.py +192 -4
- gcore/resources/cloud/networks/subnets.py +140 -8
- gcore/resources/cloud/reserved_fixed_ips/vip.py +5 -7
- gcore/resources/cloud/security_groups/security_groups.py +6 -6
- gcore/resources/cloud/tasks.py +46 -46
- gcore/resources/cloud/users/role_assignments.py +5 -4
- gcore/resources/cloud/volumes.py +4 -4
- gcore/resources/dns/__init__.py +75 -0
- gcore/resources/dns/dns.py +374 -0
- gcore/resources/dns/locations.py +288 -0
- gcore/resources/dns/metrics.py +214 -0
- gcore/resources/dns/pickers/__init__.py +33 -0
- gcore/resources/dns/pickers/pickers.py +167 -0
- gcore/resources/dns/pickers/presets.py +135 -0
- gcore/resources/dns/zones/__init__.py +47 -0
- gcore/resources/{cloud/inference/models.py → dns/zones/dnssec.py} +80 -122
- gcore/resources/dns/zones/rrsets.py +1005 -0
- gcore/resources/dns/zones/zones.py +1493 -0
- gcore/resources/storage/__init__.py +75 -0
- gcore/resources/storage/buckets/__init__.py +61 -0
- gcore/resources/storage/buckets/buckets.py +470 -0
- gcore/resources/storage/buckets/cors.py +265 -0
- gcore/resources/storage/buckets/lifecycle.py +276 -0
- gcore/resources/storage/buckets/policy.py +345 -0
- gcore/resources/storage/credentials.py +221 -0
- gcore/resources/storage/locations.py +190 -0
- gcore/resources/storage/statistics.py +364 -0
- gcore/resources/storage/storage.py +1042 -0
- gcore/resources/streaming/ai_tasks.py +56 -70
- gcore/resources/streaming/playlists.py +18 -18
- gcore/resources/streaming/quality_sets.py +8 -8
- gcore/resources/streaming/statistics.py +4 -122
- gcore/resources/streaming/streams/overlays.py +6 -6
- gcore/resources/streaming/streams/streams.py +40 -64
- gcore/resources/streaming/videos/subtitles.py +32 -30
- gcore/resources/streaming/videos/videos.py +78 -72
- gcore/resources/waap/domains/advanced_rules.py +2 -2
- gcore/resources/waap/domains/api_paths.py +13 -13
- gcore/resources/waap/domains/custom_rules.py +2 -2
- gcore/resources/waap/domains/domains.py +4 -4
- gcore/resources/waap/domains/firewall_rules.py +2 -2
- gcore/resources/waap/domains/insight_silences.py +6 -6
- gcore/resources/waap/domains/insights.py +7 -7
- gcore/resources/waap/domains/statistics.py +47 -47
- gcore/types/cloud/__init__.py +2 -4
- gcore/types/cloud/audit_log_list_params.py +2 -1
- gcore/types/cloud/baremetal/image_list_params.py +3 -2
- gcore/types/cloud/baremetal/server_create_params.py +8 -6
- gcore/types/cloud/baremetal/server_list_params.py +3 -2
- gcore/types/cloud/baremetal/server_rebuild_params.py +2 -0
- gcore/types/cloud/cost_report_get_aggregated_monthly_params.py +35 -31
- gcore/types/cloud/cost_report_get_aggregated_params.py +26 -25
- gcore/types/cloud/cost_report_get_detailed_params.py +26 -25
- gcore/types/cloud/ddos_profile.py +13 -7
- gcore/types/cloud/ddos_profile_field.py +21 -8
- gcore/types/cloud/ddos_profile_option_list.py +7 -6
- gcore/types/cloud/ddos_profile_status.py +2 -2
- gcore/types/cloud/ddos_profile_template.py +7 -3
- gcore/types/cloud/ddos_profile_template_field.py +12 -3
- gcore/types/cloud/file_share.py +2 -2
- gcore/types/cloud/file_share_create_params.py +12 -6
- gcore/types/cloud/floating_ip_list_params.py +3 -2
- gcore/types/cloud/gpu_baremetal_cluster.py +101 -74
- gcore/types/cloud/gpu_baremetal_cluster_create_params.py +76 -93
- gcore/types/cloud/gpu_baremetal_cluster_delete_params.py +17 -10
- gcore/types/cloud/gpu_baremetal_cluster_list_params.py +14 -3
- gcore/types/cloud/gpu_baremetal_cluster_rebuild_params.py +4 -2
- gcore/types/cloud/gpu_baremetal_clusters/__init__.py +6 -0
- gcore/types/cloud/gpu_baremetal_clusters/gpu_baremetal_cluster_server.py +74 -0
- gcore/types/cloud/{gpu_baremetal_cluster_server.py → gpu_baremetal_clusters/gpu_baremetal_cluster_server_v1.py} +10 -10
- gcore/types/cloud/gpu_baremetal_clusters/gpu_baremetal_cluster_server_v1_list.py +16 -0
- gcore/types/cloud/{gpu_baremetal_flavor.py → gpu_baremetal_clusters/gpu_baremetal_flavor.py} +1 -1
- gcore/types/cloud/{gpu_baremetal_flavor_list.py → gpu_baremetal_clusters/gpu_baremetal_flavor_list.py} +1 -1
- gcore/types/cloud/gpu_baremetal_clusters/server_list_params.py +75 -0
- gcore/types/cloud/inference/__init__.py +0 -5
- gcore/types/cloud/inference/applications/__init__.py +12 -0
- gcore/types/cloud/inference/applications/deployment_create_params.py +68 -0
- gcore/types/cloud/inference/applications/deployment_patch_params.py +62 -0
- gcore/types/cloud/inference/applications/inference_application_deployment.py +111 -0
- gcore/types/cloud/inference/applications/inference_application_deployment_list.py +16 -0
- gcore/types/cloud/inference/applications/inference_application_template.py +94 -0
- gcore/types/cloud/inference/applications/inference_application_template_list.py +16 -0
- gcore/types/cloud/inference/deployment_create_params.py +7 -6
- gcore/types/cloud/inference/deployment_update_params.py +7 -6
- gcore/types/cloud/instance_assign_security_group_params.py +4 -2
- gcore/types/cloud/instance_list_params.py +3 -2
- gcore/types/cloud/instance_unassign_security_group_params.py +4 -2
- gcore/types/cloud/instances/image_list_params.py +3 -2
- gcore/types/cloud/k8s/__init__.py +13 -0
- gcore/types/cloud/k8s/cluster_create_params.py +299 -0
- gcore/types/cloud/k8s/cluster_delete_params.py +16 -0
- gcore/types/cloud/k8s/cluster_update_params.py +203 -0
- gcore/types/cloud/k8s/cluster_upgrade_params.py +16 -0
- gcore/types/cloud/k8s/clusters/__init__.py +10 -0
- gcore/types/cloud/k8s/clusters/k8s_cluster_pool.py +66 -0
- gcore/types/cloud/k8s/clusters/k8s_cluster_pool_list.py +16 -0
- gcore/types/cloud/k8s/clusters/node_list_params.py +16 -0
- gcore/types/cloud/k8s/clusters/pool_create_params.py +53 -0
- gcore/types/cloud/k8s/clusters/pool_resize_params.py +18 -0
- gcore/types/cloud/k8s/clusters/pool_update_params.py +34 -0
- gcore/types/cloud/k8s/clusters/pools/__init__.py +5 -0
- gcore/types/cloud/k8s/clusters/pools/node_list_params.py +18 -0
- gcore/types/cloud/k8s/flavor_list_params.py +19 -0
- gcore/types/cloud/k8s/k8s_cluster.py +209 -0
- gcore/types/cloud/k8s/k8s_cluster_certificate.py +13 -0
- gcore/types/cloud/k8s/k8s_cluster_kubeconfig.py +19 -0
- gcore/types/cloud/k8s/k8s_cluster_list.py +16 -0
- gcore/types/cloud/k8s_cluster_version.py +10 -0
- gcore/types/cloud/{gpu_baremetal_cluster_server_list.py → k8s_cluster_version_list.py} +4 -4
- gcore/types/cloud/load_balancer_create_params.py +23 -4
- gcore/types/cloud/load_balancer_list_params.py +3 -2
- gcore/types/cloud/load_balancers/l7_policies/rule_create_params.py +3 -2
- gcore/types/cloud/load_balancers/l7_policies/rule_replace_params.py +3 -2
- gcore/types/cloud/load_balancers/l7_policy_create_params.py +3 -2
- gcore/types/cloud/load_balancers/l7_policy_replace_params.py +3 -2
- gcore/types/cloud/load_balancers/listener_create_params.py +4 -3
- gcore/types/cloud/load_balancers/listener_update_params.py +5 -3
- gcore/types/cloud/load_balancers/pool_create_params.py +19 -1
- gcore/types/cloud/load_balancers/pool_update_params.py +19 -1
- gcore/types/cloud/load_balancers/pools/member_add_params.py +19 -1
- gcore/types/cloud/member.py +19 -1
- gcore/types/cloud/network_list_params.py +3 -2
- gcore/types/cloud/networks/subnet_create_params.py +3 -2
- gcore/types/cloud/networks/subnet_list_params.py +3 -2
- gcore/types/cloud/networks/subnet_update_params.py +3 -2
- gcore/types/cloud/project.py +9 -9
- gcore/types/cloud/reserved_fixed_ips/vip_replace_connected_ports_params.py +3 -2
- gcore/types/cloud/reserved_fixed_ips/vip_update_connected_ports_params.py +3 -2
- gcore/types/cloud/security_group_create_params.py +4 -2
- gcore/types/cloud/security_group_list_params.py +3 -2
- gcore/types/cloud/task_id_list.py +8 -1
- gcore/types/cloud/task_list_params.py +23 -23
- gcore/types/cloud/usage_report_get_params.py +26 -25
- gcore/types/cloud/users/role_assignment.py +2 -1
- gcore/types/cloud/users/role_assignment_create_params.py +4 -2
- gcore/types/cloud/users/role_assignment_update_params.py +4 -2
- gcore/types/cloud/volume_list_params.py +3 -2
- gcore/types/dns/__init__.py +31 -0
- gcore/types/dns/dns_get_account_overview_response.py +21 -0
- gcore/types/dns/dns_label_name.py +13 -0
- gcore/types/dns/dns_location_translations.py +11 -0
- gcore/types/dns/dns_lookup_params.py +15 -0
- gcore/types/dns/dns_lookup_response.py +21 -0
- gcore/types/dns/dns_name_server.py +17 -0
- gcore/types/dns/location_list_continents_response.py +10 -0
- gcore/types/dns/location_list_countries_response.py +10 -0
- gcore/types/dns/location_list_regions_response.py +10 -0
- gcore/types/dns/location_list_response.py +16 -0
- gcore/types/dns/metric_list_params.py +24 -0
- gcore/types/dns/metric_list_response.py +7 -0
- gcore/types/dns/picker_list_response.py +10 -0
- gcore/types/dns/pickers/__init__.py +5 -0
- gcore/types/dns/pickers/preset_list_response.py +10 -0
- gcore/types/dns/zone_check_delegation_status_response.py +20 -0
- gcore/types/dns/zone_create_params.py +59 -0
- gcore/types/dns/zone_create_response.py +13 -0
- gcore/types/dns/zone_export_response.py +11 -0
- gcore/types/dns/zone_get_response.py +106 -0
- gcore/types/dns/zone_get_statistics_params.py +43 -0
- gcore/types/dns/zone_get_statistics_response.py +19 -0
- gcore/types/dns/zone_import_params.py +32 -0
- gcore/types/dns/zone_import_response.py +26 -0
- gcore/types/dns/zone_list_params.py +57 -0
- gcore/types/dns/zone_list_response.py +105 -0
- gcore/types/dns/zone_replace_params.py +61 -0
- gcore/types/dns/zones/__init__.py +15 -0
- gcore/types/dns/zones/dns_failover_log.py +19 -0
- gcore/types/dns/zones/dns_output_rrset.py +123 -0
- gcore/types/dns/zones/dnssec_get_response.py +38 -0
- gcore/types/dns/zones/dnssec_update_params.py +11 -0
- gcore/types/dns/zones/dnssec_update_response.py +38 -0
- gcore/types/dns/zones/rrset_create_params.py +82 -0
- gcore/types/dns/zones/rrset_get_failover_logs_params.py +21 -0
- gcore/types/dns/zones/rrset_get_failover_logs_response.py +15 -0
- gcore/types/dns/zones/rrset_list_params.py +21 -0
- gcore/types/dns/zones/rrset_list_response.py +14 -0
- gcore/types/dns/zones/rrset_replace_params.py +82 -0
- gcore/types/security/client_profile.py +1 -1
- gcore/types/security/profile_create_params.py +2 -2
- gcore/types/security/profile_recreate_params.py +2 -2
- gcore/types/security/profile_replace_params.py +2 -2
- gcore/types/storage/__init__.py +21 -0
- gcore/types/storage/bucket.py +15 -0
- gcore/types/storage/bucket_list_params.py +15 -0
- gcore/types/storage/buckets/__init__.py +9 -0
- gcore/types/storage/buckets/bucket_cors.py +18 -0
- gcore/types/storage/buckets/bucket_policy.py +7 -0
- gcore/types/storage/buckets/cor_create_params.py +17 -0
- gcore/types/storage/buckets/lifecycle_create_params.py +18 -0
- gcore/types/storage/buckets/policy_get_response.py +7 -0
- gcore/types/storage/credential_recreate_params.py +36 -0
- gcore/types/storage/location.py +24 -0
- gcore/types/storage/location_list_params.py +13 -0
- gcore/types/storage/statistic_get_usage_aggregated_params.py +24 -0
- gcore/types/storage/statistic_get_usage_series_params.py +38 -0
- gcore/types/storage/statistic_get_usage_series_response.py +12 -0
- gcore/types/storage/storage.py +101 -0
- gcore/types/storage/storage_create_params.py +44 -0
- gcore/types/storage/storage_list_params.py +39 -0
- gcore/types/storage/storage_restore_params.py +11 -0
- gcore/types/storage/storage_update_params.py +18 -0
- gcore/types/storage/usage_series.py +201 -0
- gcore/types/storage/usage_total.py +54 -0
- gcore/types/streaming/__init__.py +0 -4
- gcore/types/streaming/ai_contentmoderation_hardnudity.py +1 -1
- gcore/types/streaming/ai_contentmoderation_nsfw.py +1 -1
- gcore/types/streaming/ai_contentmoderation_softnudity.py +1 -1
- gcore/types/streaming/ai_contentmoderation_sport.py +1 -1
- gcore/types/streaming/ai_task.py +1 -5
- gcore/types/streaming/ai_task_create_params.py +2 -2
- gcore/types/streaming/ai_task_get_response.py +0 -46
- gcore/types/streaming/clip.py +2 -1
- gcore/types/streaming/create_video_param.py +13 -12
- gcore/types/streaming/max_stream_series.py +5 -5
- gcore/types/streaming/playlist.py +1 -1
- gcore/types/streaming/playlist_create_params.py +1 -1
- gcore/types/streaming/playlist_update_params.py +1 -1
- gcore/types/streaming/playlist_video.py +13 -12
- gcore/types/streaming/storage_series.py +5 -5
- gcore/types/streaming/stream.py +86 -49
- gcore/types/streaming/stream_create_clip_params.py +2 -1
- gcore/types/streaming/stream_create_params.py +9 -23
- gcore/types/streaming/stream_series.py +5 -5
- gcore/types/streaming/stream_update_params.py +9 -23
- gcore/types/streaming/video.py +53 -42
- gcore/types/streaming/video_update_params.py +13 -12
- gcore/types/streaming/vod_statistics_series.py +5 -5
- gcore/types/streaming/vod_total_stream_duration_series.py +3 -3
- gcore/types/waap/domain_list_params.py +1 -1
- gcore/types/waap/domain_update_params.py +1 -1
- gcore/types/waap/domains/advanced_rule_create_params.py +7 -4
- gcore/types/waap/domains/advanced_rule_update_params.py +6 -3
- gcore/types/waap/domains/api_path_create_params.py +4 -3
- gcore/types/waap/domains/api_path_list_params.py +3 -1
- gcore/types/waap/domains/api_path_update_params.py +5 -4
- gcore/types/waap/domains/custom_rule_create_params.py +13 -14
- gcore/types/waap/domains/custom_rule_update_params.py +12 -13
- gcore/types/waap/domains/firewall_rule_create_params.py +3 -2
- gcore/types/waap/domains/firewall_rule_update_params.py +2 -1
- gcore/types/waap/domains/insight_list_params.py +4 -2
- gcore/types/waap/domains/insight_replace_params.py +1 -1
- gcore/types/waap/domains/insight_silence_list_params.py +5 -3
- gcore/types/waap/domains/setting_update_params.py +3 -2
- gcore/types/waap/domains/statistic_get_ddos_info_params.py +6 -9
- gcore/types/waap/domains/statistic_get_events_aggregated_params.py +9 -10
- gcore/types/waap/domains/statistic_get_requests_series_params.py +8 -9
- gcore/types/waap/domains/statistic_get_traffic_series_params.py +6 -9
- gcore/types/waap/domains/waap_advanced_rule.py +3 -2
- gcore/types/waap/domains/waap_api_path.py +4 -4
- gcore/types/waap/domains/waap_api_scan_result.py +2 -2
- gcore/types/waap/domains/waap_custom_rule.py +4 -7
- gcore/types/waap/domains/waap_firewall_rule.py +3 -2
- gcore/types/waap/domains/waap_insight.py +1 -1
- gcore/types/waap/domains/waap_request_details.py +5 -4
- gcore/types/waap/waap_ip_ddos_info_model.py +3 -3
- gcore/types/waap/waap_rule_set.py +1 -1
- {gcore-0.10.0.dist-info → gcore-0.11.0.dist-info}/METADATA +7 -2
- {gcore-0.10.0.dist-info → gcore-0.11.0.dist-info}/RECORD +312 -192
- gcore/types/cloud/inference/inference_model.py +0 -65
- gcore/types/cloud/inference/inference_registry_credentials_create.py +0 -22
- gcore/types/cloud/inference/model_list_params.py +0 -21
- gcore/types/streaming/ai_contentmoderation_casm.py +0 -39
- gcore/types/streaming/ai_contentmoderation_weapon.py +0 -39
- gcore/types/streaming/meet_series.py +0 -23
- gcore/types/streaming/statistic_get_meet_series_params.py +0 -20
- {gcore-0.10.0.dist-info → gcore-0.11.0.dist-info}/WHEEL +0 -0
- {gcore-0.10.0.dist-info → gcore-0.11.0.dist-info}/licenses/LICENSE +0 -0
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
|
-
from typing import
|
|
5
|
+
from typing import Iterable, Optional
|
|
6
6
|
|
|
7
7
|
import httpx
|
|
8
8
|
|
|
9
|
-
from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven
|
|
9
|
+
from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven, SequenceNotStr
|
|
10
10
|
from ...._utils import maybe_transform, async_maybe_transform
|
|
11
11
|
from ...._compat import cached_property
|
|
12
12
|
from ...._resource import SyncAPIResource, AsyncAPIResource
|
|
@@ -61,11 +61,11 @@ class ListenersResource(SyncAPIResource):
|
|
|
61
61
|
name: str,
|
|
62
62
|
protocol: LbListenerProtocol,
|
|
63
63
|
protocol_port: int,
|
|
64
|
-
allowed_cidrs: Optional[
|
|
64
|
+
allowed_cidrs: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN,
|
|
65
65
|
connection_limit: int | NotGiven = NOT_GIVEN,
|
|
66
66
|
insert_x_forwarded: bool | NotGiven = NOT_GIVEN,
|
|
67
67
|
secret_id: str | NotGiven = NOT_GIVEN,
|
|
68
|
-
sni_secret_id:
|
|
68
|
+
sni_secret_id: SequenceNotStr[str] | NotGiven = NOT_GIVEN,
|
|
69
69
|
timeout_client_data: Optional[int] | NotGiven = NOT_GIVEN,
|
|
70
70
|
timeout_member_connect: Optional[int] | NotGiven = NOT_GIVEN,
|
|
71
71
|
timeout_member_data: Optional[int] | NotGiven = NOT_GIVEN,
|
|
@@ -158,11 +158,11 @@ class ListenersResource(SyncAPIResource):
|
|
|
158
158
|
*,
|
|
159
159
|
project_id: int | None = None,
|
|
160
160
|
region_id: int | None = None,
|
|
161
|
-
allowed_cidrs: Optional[
|
|
161
|
+
allowed_cidrs: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN,
|
|
162
162
|
connection_limit: int | NotGiven = NOT_GIVEN,
|
|
163
163
|
name: str | NotGiven = NOT_GIVEN,
|
|
164
164
|
secret_id: Optional[str] | NotGiven = NOT_GIVEN,
|
|
165
|
-
sni_secret_id: Optional[
|
|
165
|
+
sni_secret_id: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN,
|
|
166
166
|
timeout_client_data: Optional[int] | NotGiven = NOT_GIVEN,
|
|
167
167
|
timeout_member_connect: Optional[int] | NotGiven = NOT_GIVEN,
|
|
168
168
|
timeout_member_data: Optional[int] | NotGiven = NOT_GIVEN,
|
|
@@ -402,11 +402,11 @@ class ListenersResource(SyncAPIResource):
|
|
|
402
402
|
name: str,
|
|
403
403
|
protocol: LbListenerProtocol,
|
|
404
404
|
protocol_port: int,
|
|
405
|
-
allowed_cidrs: Optional[
|
|
405
|
+
allowed_cidrs: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN,
|
|
406
406
|
connection_limit: int | NotGiven = NOT_GIVEN,
|
|
407
407
|
insert_x_forwarded: bool | NotGiven = NOT_GIVEN,
|
|
408
408
|
secret_id: str | NotGiven = NOT_GIVEN,
|
|
409
|
-
sni_secret_id:
|
|
409
|
+
sni_secret_id: SequenceNotStr[str] | NotGiven = NOT_GIVEN,
|
|
410
410
|
timeout_client_data: Optional[int] | NotGiven = NOT_GIVEN,
|
|
411
411
|
timeout_member_connect: Optional[int] | NotGiven = NOT_GIVEN,
|
|
412
412
|
timeout_member_data: Optional[int] | NotGiven = NOT_GIVEN,
|
|
@@ -501,11 +501,11 @@ class ListenersResource(SyncAPIResource):
|
|
|
501
501
|
*,
|
|
502
502
|
project_id: int | None = None,
|
|
503
503
|
region_id: int | None = None,
|
|
504
|
-
allowed_cidrs: Optional[
|
|
504
|
+
allowed_cidrs: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN,
|
|
505
505
|
connection_limit: int | NotGiven = NOT_GIVEN,
|
|
506
506
|
name: str | NotGiven = NOT_GIVEN,
|
|
507
507
|
secret_id: Optional[str] | NotGiven = NOT_GIVEN,
|
|
508
|
-
sni_secret_id: Optional[
|
|
508
|
+
sni_secret_id: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN,
|
|
509
509
|
timeout_client_data: Optional[int] | NotGiven = NOT_GIVEN,
|
|
510
510
|
timeout_member_connect: Optional[int] | NotGiven = NOT_GIVEN,
|
|
511
511
|
timeout_member_data: Optional[int] | NotGiven = NOT_GIVEN,
|
|
@@ -584,11 +584,11 @@ class AsyncListenersResource(AsyncAPIResource):
|
|
|
584
584
|
name: str,
|
|
585
585
|
protocol: LbListenerProtocol,
|
|
586
586
|
protocol_port: int,
|
|
587
|
-
allowed_cidrs: Optional[
|
|
587
|
+
allowed_cidrs: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN,
|
|
588
588
|
connection_limit: int | NotGiven = NOT_GIVEN,
|
|
589
589
|
insert_x_forwarded: bool | NotGiven = NOT_GIVEN,
|
|
590
590
|
secret_id: str | NotGiven = NOT_GIVEN,
|
|
591
|
-
sni_secret_id:
|
|
591
|
+
sni_secret_id: SequenceNotStr[str] | NotGiven = NOT_GIVEN,
|
|
592
592
|
timeout_client_data: Optional[int] | NotGiven = NOT_GIVEN,
|
|
593
593
|
timeout_member_connect: Optional[int] | NotGiven = NOT_GIVEN,
|
|
594
594
|
timeout_member_data: Optional[int] | NotGiven = NOT_GIVEN,
|
|
@@ -681,11 +681,11 @@ class AsyncListenersResource(AsyncAPIResource):
|
|
|
681
681
|
*,
|
|
682
682
|
project_id: int | None = None,
|
|
683
683
|
region_id: int | None = None,
|
|
684
|
-
allowed_cidrs: Optional[
|
|
684
|
+
allowed_cidrs: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN,
|
|
685
685
|
connection_limit: int | NotGiven = NOT_GIVEN,
|
|
686
686
|
name: str | NotGiven = NOT_GIVEN,
|
|
687
687
|
secret_id: Optional[str] | NotGiven = NOT_GIVEN,
|
|
688
|
-
sni_secret_id: Optional[
|
|
688
|
+
sni_secret_id: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN,
|
|
689
689
|
timeout_client_data: Optional[int] | NotGiven = NOT_GIVEN,
|
|
690
690
|
timeout_member_connect: Optional[int] | NotGiven = NOT_GIVEN,
|
|
691
691
|
timeout_member_data: Optional[int] | NotGiven = NOT_GIVEN,
|
|
@@ -925,11 +925,11 @@ class AsyncListenersResource(AsyncAPIResource):
|
|
|
925
925
|
name: str,
|
|
926
926
|
protocol: LbListenerProtocol,
|
|
927
927
|
protocol_port: int,
|
|
928
|
-
allowed_cidrs: Optional[
|
|
928
|
+
allowed_cidrs: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN,
|
|
929
929
|
connection_limit: int | NotGiven = NOT_GIVEN,
|
|
930
930
|
insert_x_forwarded: bool | NotGiven = NOT_GIVEN,
|
|
931
931
|
secret_id: str | NotGiven = NOT_GIVEN,
|
|
932
|
-
sni_secret_id:
|
|
932
|
+
sni_secret_id: SequenceNotStr[str] | NotGiven = NOT_GIVEN,
|
|
933
933
|
timeout_client_data: Optional[int] | NotGiven = NOT_GIVEN,
|
|
934
934
|
timeout_member_connect: Optional[int] | NotGiven = NOT_GIVEN,
|
|
935
935
|
timeout_member_data: Optional[int] | NotGiven = NOT_GIVEN,
|
|
@@ -1024,11 +1024,11 @@ class AsyncListenersResource(AsyncAPIResource):
|
|
|
1024
1024
|
*,
|
|
1025
1025
|
project_id: int | None = None,
|
|
1026
1026
|
region_id: int | None = None,
|
|
1027
|
-
allowed_cidrs: Optional[
|
|
1027
|
+
allowed_cidrs: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN,
|
|
1028
1028
|
connection_limit: int | NotGiven = NOT_GIVEN,
|
|
1029
1029
|
name: str | NotGiven = NOT_GIVEN,
|
|
1030
1030
|
secret_id: Optional[str] | NotGiven = NOT_GIVEN,
|
|
1031
|
-
sni_secret_id: Optional[
|
|
1031
|
+
sni_secret_id: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN,
|
|
1032
1032
|
timeout_client_data: Optional[int] | NotGiven = NOT_GIVEN,
|
|
1033
1033
|
timeout_member_connect: Optional[int] | NotGiven = NOT_GIVEN,
|
|
1034
1034
|
timeout_member_data: Optional[int] | NotGiven = NOT_GIVEN,
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
|
-
from typing import Dict,
|
|
5
|
+
from typing import Dict, Iterable, Optional
|
|
6
6
|
|
|
7
7
|
import httpx
|
|
8
8
|
|
|
@@ -30,7 +30,7 @@ from .statuses import (
|
|
|
30
30
|
StatusesResourceWithStreamingResponse,
|
|
31
31
|
AsyncStatusesResourceWithStreamingResponse,
|
|
32
32
|
)
|
|
33
|
-
from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven
|
|
33
|
+
from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven, SequenceNotStr
|
|
34
34
|
from ...._utils import maybe_transform, async_maybe_transform
|
|
35
35
|
from .listeners import (
|
|
36
36
|
ListenersResource,
|
|
@@ -325,7 +325,7 @@ class LoadBalancersResource(SyncAPIResource):
|
|
|
325
325
|
offset: int | NotGiven = NOT_GIVEN,
|
|
326
326
|
order_by: str | NotGiven = NOT_GIVEN,
|
|
327
327
|
show_stats: bool | NotGiven = NOT_GIVEN,
|
|
328
|
-
tag_key:
|
|
328
|
+
tag_key: SequenceNotStr[str] | NotGiven = NOT_GIVEN,
|
|
329
329
|
tag_key_value: str | NotGiven = NOT_GIVEN,
|
|
330
330
|
with_ddos: bool | NotGiven = NOT_GIVEN,
|
|
331
331
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
@@ -1008,7 +1008,7 @@ class AsyncLoadBalancersResource(AsyncAPIResource):
|
|
|
1008
1008
|
offset: int | NotGiven = NOT_GIVEN,
|
|
1009
1009
|
order_by: str | NotGiven = NOT_GIVEN,
|
|
1010
1010
|
show_stats: bool | NotGiven = NOT_GIVEN,
|
|
1011
|
-
tag_key:
|
|
1011
|
+
tag_key: SequenceNotStr[str] | NotGiven = NOT_GIVEN,
|
|
1012
1012
|
tag_key_value: str | NotGiven = NOT_GIVEN,
|
|
1013
1013
|
with_ddos: bool | NotGiven = NOT_GIVEN,
|
|
1014
1014
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
@@ -68,7 +68,10 @@ class HealthMonitorsResource(SyncAPIResource):
|
|
|
68
68
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
69
69
|
) -> TaskIDList:
|
|
70
70
|
"""
|
|
71
|
-
|
|
71
|
+
Creates a health monitor for a load balancer pool to automatically check the
|
|
72
|
+
health status of pool members. The health monitor performs periodic checks on
|
|
73
|
+
pool members and removes unhealthy members from rotation, ensuring only healthy
|
|
74
|
+
servers receive traffic.
|
|
72
75
|
|
|
73
76
|
Args:
|
|
74
77
|
project_id: Project ID
|
|
@@ -145,8 +148,11 @@ class HealthMonitorsResource(SyncAPIResource):
|
|
|
145
148
|
extra_body: Body | None = None,
|
|
146
149
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
147
150
|
) -> None:
|
|
148
|
-
"""
|
|
149
|
-
|
|
151
|
+
"""Removes the health monitor from a load balancer pool.
|
|
152
|
+
|
|
153
|
+
After deletion, the pool
|
|
154
|
+
will no longer perform automatic health checks on its members, and all members
|
|
155
|
+
will remain in rotation regardless of their actual health status.
|
|
150
156
|
|
|
151
157
|
Args:
|
|
152
158
|
project_id: Project ID
|
|
@@ -221,7 +227,10 @@ class AsyncHealthMonitorsResource(AsyncAPIResource):
|
|
|
221
227
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
222
228
|
) -> TaskIDList:
|
|
223
229
|
"""
|
|
224
|
-
|
|
230
|
+
Creates a health monitor for a load balancer pool to automatically check the
|
|
231
|
+
health status of pool members. The health monitor performs periodic checks on
|
|
232
|
+
pool members and removes unhealthy members from rotation, ensuring only healthy
|
|
233
|
+
servers receive traffic.
|
|
225
234
|
|
|
226
235
|
Args:
|
|
227
236
|
project_id: Project ID
|
|
@@ -298,8 +307,11 @@ class AsyncHealthMonitorsResource(AsyncAPIResource):
|
|
|
298
307
|
extra_body: Body | None = None,
|
|
299
308
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
300
309
|
) -> None:
|
|
301
|
-
"""
|
|
302
|
-
|
|
310
|
+
"""Removes the health monitor from a load balancer pool.
|
|
311
|
+
|
|
312
|
+
After deletion, the pool
|
|
313
|
+
will no longer perform automatic health checks on its members, and all members
|
|
314
|
+
will remain in rotation regardless of their actual health status.
|
|
303
315
|
|
|
304
316
|
Args:
|
|
305
317
|
project_id: Project ID
|
|
@@ -99,7 +99,22 @@ class MembersResource(SyncAPIResource):
|
|
|
99
99
|
subnet_id: `subnet_id` in which `address` is present. Either `subnet_id` or `instance_id`
|
|
100
100
|
should be provided
|
|
101
101
|
|
|
102
|
-
weight: Member weight. Valid values are 0 < `weight` <= 256, defaults to 1.
|
|
102
|
+
weight: Member weight. Valid values are 0 < `weight` <= 256, defaults to 1. Controls
|
|
103
|
+
traffic distribution based on the pool's load balancing algorithm:
|
|
104
|
+
|
|
105
|
+
- `ROUND_ROBIN`: Distributes connections to each member in turn according to
|
|
106
|
+
weights. Higher weight = more turns in the cycle. Example: weights 3 vs 1 =
|
|
107
|
+
~75% vs ~25% of requests.
|
|
108
|
+
- `LEAST_CONNECTIONS`: Sends new connections to the member with fewest active
|
|
109
|
+
connections, performing round-robin within groups of the same normalized load.
|
|
110
|
+
Higher weight = allowed to hold more simultaneous connections before being
|
|
111
|
+
considered 'more loaded'. Example: weights 2 vs 1 means 20 vs 10 active
|
|
112
|
+
connections is treated as balanced.
|
|
113
|
+
- `SOURCE_IP`: Routes clients consistently to the same member by hashing client
|
|
114
|
+
source IP; hash result is modulo total weight of running members. Higher
|
|
115
|
+
weight = more hash buckets, so more client IPs map to that member. Example:
|
|
116
|
+
weights 2 vs 1 = roughly two-thirds of distinct client IPs map to the
|
|
117
|
+
higher-weight member.
|
|
103
118
|
|
|
104
119
|
extra_headers: Send extra headers
|
|
105
120
|
|
|
@@ -264,7 +279,22 @@ class AsyncMembersResource(AsyncAPIResource):
|
|
|
264
279
|
subnet_id: `subnet_id` in which `address` is present. Either `subnet_id` or `instance_id`
|
|
265
280
|
should be provided
|
|
266
281
|
|
|
267
|
-
weight: Member weight. Valid values are 0 < `weight` <= 256, defaults to 1.
|
|
282
|
+
weight: Member weight. Valid values are 0 < `weight` <= 256, defaults to 1. Controls
|
|
283
|
+
traffic distribution based on the pool's load balancing algorithm:
|
|
284
|
+
|
|
285
|
+
- `ROUND_ROBIN`: Distributes connections to each member in turn according to
|
|
286
|
+
weights. Higher weight = more turns in the cycle. Example: weights 3 vs 1 =
|
|
287
|
+
~75% vs ~25% of requests.
|
|
288
|
+
- `LEAST_CONNECTIONS`: Sends new connections to the member with fewest active
|
|
289
|
+
connections, performing round-robin within groups of the same normalized load.
|
|
290
|
+
Higher weight = allowed to hold more simultaneous connections before being
|
|
291
|
+
considered 'more loaded'. Example: weights 2 vs 1 means 20 vs 10 active
|
|
292
|
+
connections is treated as balanced.
|
|
293
|
+
- `SOURCE_IP`: Routes clients consistently to the same member by hashing client
|
|
294
|
+
source IP; hash result is modulo total weight of running members. Higher
|
|
295
|
+
weight = more hash buckets, so more client IPs map to that member. Example:
|
|
296
|
+
weights 2 vs 1 = roughly two-thirds of distinct client IPs map to the
|
|
297
|
+
higher-weight member.
|
|
268
298
|
|
|
269
299
|
extra_headers: Send extra headers
|
|
270
300
|
|
|
@@ -199,9 +199,21 @@ class PoolsResource(SyncAPIResource):
|
|
|
199
199
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
200
200
|
) -> TaskIDList:
|
|
201
201
|
"""
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
202
|
+
Updates the specified load balancer pool with the provided changes.
|
|
203
|
+
**Behavior:**
|
|
204
|
+
|
|
205
|
+
- Simple fields (strings, numbers, booleans) will be updated if provided
|
|
206
|
+
- Complex objects (nested structures like members, health monitors, etc.) must
|
|
207
|
+
be specified completely - partial updates are not supported for these objects
|
|
208
|
+
- Undefined fields will remain unchanged
|
|
209
|
+
- If no change is detected for a specific field compared to the current pool
|
|
210
|
+
state, that field will be skipped
|
|
211
|
+
- If no changes are detected at all across all fields, no task will be created
|
|
212
|
+
and an empty task list will be returned **Examples of complex objects that
|
|
213
|
+
require full specification:**
|
|
214
|
+
- Pool members: All member properties must be provided when updating members
|
|
215
|
+
- Health monitors: Complete health monitor configuration must be specified
|
|
216
|
+
- Session persistence: Full session persistence settings must be included
|
|
205
217
|
|
|
206
218
|
Args:
|
|
207
219
|
project_id: Project ID
|
|
@@ -250,7 +262,7 @@ class PoolsResource(SyncAPIResource):
|
|
|
250
262
|
if not pool_id:
|
|
251
263
|
raise ValueError(f"Expected a non-empty value for `pool_id` but received {pool_id!r}")
|
|
252
264
|
return self._patch(
|
|
253
|
-
f"/cloud/
|
|
265
|
+
f"/cloud/v2/lbpools/{project_id}/{region_id}/{pool_id}",
|
|
254
266
|
body=maybe_transform(
|
|
255
267
|
{
|
|
256
268
|
"ca_secret_id": ca_secret_id,
|
|
@@ -745,9 +757,21 @@ class AsyncPoolsResource(AsyncAPIResource):
|
|
|
745
757
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
746
758
|
) -> TaskIDList:
|
|
747
759
|
"""
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
760
|
+
Updates the specified load balancer pool with the provided changes.
|
|
761
|
+
**Behavior:**
|
|
762
|
+
|
|
763
|
+
- Simple fields (strings, numbers, booleans) will be updated if provided
|
|
764
|
+
- Complex objects (nested structures like members, health monitors, etc.) must
|
|
765
|
+
be specified completely - partial updates are not supported for these objects
|
|
766
|
+
- Undefined fields will remain unchanged
|
|
767
|
+
- If no change is detected for a specific field compared to the current pool
|
|
768
|
+
state, that field will be skipped
|
|
769
|
+
- If no changes are detected at all across all fields, no task will be created
|
|
770
|
+
and an empty task list will be returned **Examples of complex objects that
|
|
771
|
+
require full specification:**
|
|
772
|
+
- Pool members: All member properties must be provided when updating members
|
|
773
|
+
- Health monitors: Complete health monitor configuration must be specified
|
|
774
|
+
- Session persistence: Full session persistence settings must be included
|
|
751
775
|
|
|
752
776
|
Args:
|
|
753
777
|
project_id: Project ID
|
|
@@ -796,7 +820,7 @@ class AsyncPoolsResource(AsyncAPIResource):
|
|
|
796
820
|
if not pool_id:
|
|
797
821
|
raise ValueError(f"Expected a non-empty value for `pool_id` but received {pool_id!r}")
|
|
798
822
|
return await self._patch(
|
|
799
|
-
f"/cloud/
|
|
823
|
+
f"/cloud/v2/lbpools/{project_id}/{region_id}/{pool_id}",
|
|
800
824
|
body=await async_maybe_transform(
|
|
801
825
|
{
|
|
802
826
|
"ca_secret_id": ca_secret_id,
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
|
-
from typing import Dict,
|
|
5
|
+
from typing import Dict, Optional
|
|
6
6
|
from typing_extensions import Literal
|
|
7
7
|
|
|
8
8
|
import httpx
|
|
@@ -23,7 +23,7 @@ from .subnets import (
|
|
|
23
23
|
SubnetsResourceWithStreamingResponse,
|
|
24
24
|
AsyncSubnetsResourceWithStreamingResponse,
|
|
25
25
|
)
|
|
26
|
-
from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven
|
|
26
|
+
from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven, SequenceNotStr
|
|
27
27
|
from ...._utils import maybe_transform, async_maybe_transform
|
|
28
28
|
from ...._compat import cached_property
|
|
29
29
|
from ...._resource import SyncAPIResource, AsyncAPIResource
|
|
@@ -136,6 +136,56 @@ class NetworksResource(SyncAPIResource):
|
|
|
136
136
|
cast_to=TaskIDList,
|
|
137
137
|
)
|
|
138
138
|
|
|
139
|
+
def create_and_poll(
|
|
140
|
+
self,
|
|
141
|
+
*,
|
|
142
|
+
project_id: int | None = None,
|
|
143
|
+
region_id: int | None = None,
|
|
144
|
+
name: str,
|
|
145
|
+
create_router: bool | NotGiven = NOT_GIVEN,
|
|
146
|
+
tags: Dict[str, str] | NotGiven = NOT_GIVEN,
|
|
147
|
+
type: Literal["vlan", "vxlan"] | NotGiven = NOT_GIVEN,
|
|
148
|
+
polling_interval_seconds: int | NotGiven = NOT_GIVEN,
|
|
149
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
150
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
151
|
+
extra_headers: Headers | None = None,
|
|
152
|
+
extra_query: Query | None = None,
|
|
153
|
+
extra_body: Body | None = None,
|
|
154
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
155
|
+
) -> Network:
|
|
156
|
+
"""Create network and poll for the result."""
|
|
157
|
+
response = self.create(
|
|
158
|
+
project_id=project_id,
|
|
159
|
+
region_id=region_id,
|
|
160
|
+
name=name,
|
|
161
|
+
create_router=create_router,
|
|
162
|
+
tags=tags,
|
|
163
|
+
type=type,
|
|
164
|
+
extra_headers=extra_headers,
|
|
165
|
+
extra_query=extra_query,
|
|
166
|
+
extra_body=extra_body,
|
|
167
|
+
timeout=timeout,
|
|
168
|
+
)
|
|
169
|
+
if not response.tasks or len(response.tasks) != 1:
|
|
170
|
+
raise ValueError(f"Expected exactly one task to be created")
|
|
171
|
+
task = self._client.cloud.tasks.poll(
|
|
172
|
+
task_id=response.tasks[0],
|
|
173
|
+
extra_headers=extra_headers,
|
|
174
|
+
polling_interval_seconds=polling_interval_seconds,
|
|
175
|
+
)
|
|
176
|
+
if (
|
|
177
|
+
not task.created_resources
|
|
178
|
+
or not task.created_resources.networks
|
|
179
|
+
or len(task.created_resources.networks) != 1
|
|
180
|
+
):
|
|
181
|
+
raise ValueError(f"Expected exactly one resource to be created in a task")
|
|
182
|
+
return self.get(
|
|
183
|
+
network_id=task.created_resources.networks[0],
|
|
184
|
+
project_id=project_id,
|
|
185
|
+
region_id=region_id,
|
|
186
|
+
extra_headers=extra_headers,
|
|
187
|
+
)
|
|
188
|
+
|
|
139
189
|
def update(
|
|
140
190
|
self,
|
|
141
191
|
network_id: str,
|
|
@@ -224,7 +274,7 @@ class NetworksResource(SyncAPIResource):
|
|
|
224
274
|
name: str | NotGiven = NOT_GIVEN,
|
|
225
275
|
offset: int | NotGiven = NOT_GIVEN,
|
|
226
276
|
order_by: Literal["created_at.asc", "created_at.desc", "name.asc", "name.desc"] | NotGiven = NOT_GIVEN,
|
|
227
|
-
tag_key:
|
|
277
|
+
tag_key: SequenceNotStr[str] | NotGiven = NOT_GIVEN,
|
|
228
278
|
tag_key_value: str | NotGiven = NOT_GIVEN,
|
|
229
279
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
230
280
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
@@ -335,6 +385,38 @@ class NetworksResource(SyncAPIResource):
|
|
|
335
385
|
cast_to=TaskIDList,
|
|
336
386
|
)
|
|
337
387
|
|
|
388
|
+
def delete_and_poll(
|
|
389
|
+
self,
|
|
390
|
+
network_id: str,
|
|
391
|
+
*,
|
|
392
|
+
project_id: int | None = None,
|
|
393
|
+
region_id: int | None = None,
|
|
394
|
+
polling_interval_seconds: int | NotGiven = NOT_GIVEN,
|
|
395
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
396
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
397
|
+
extra_headers: Headers | None = None,
|
|
398
|
+
extra_query: Query | None = None,
|
|
399
|
+
extra_body: Body | None = None,
|
|
400
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
401
|
+
) -> None:
|
|
402
|
+
"""Delete network and poll for the result."""
|
|
403
|
+
response = self.delete(
|
|
404
|
+
network_id=network_id,
|
|
405
|
+
project_id=project_id,
|
|
406
|
+
region_id=region_id,
|
|
407
|
+
extra_headers=extra_headers,
|
|
408
|
+
extra_query=extra_query,
|
|
409
|
+
extra_body=extra_body,
|
|
410
|
+
timeout=timeout,
|
|
411
|
+
)
|
|
412
|
+
if not response.tasks:
|
|
413
|
+
raise ValueError("Expected at least one task to be created")
|
|
414
|
+
self._client.cloud.tasks.poll(
|
|
415
|
+
task_id=response.tasks[0],
|
|
416
|
+
extra_headers=extra_headers,
|
|
417
|
+
polling_interval_seconds=polling_interval_seconds,
|
|
418
|
+
)
|
|
419
|
+
|
|
338
420
|
def get(
|
|
339
421
|
self,
|
|
340
422
|
network_id: str,
|
|
@@ -474,6 +556,56 @@ class AsyncNetworksResource(AsyncAPIResource):
|
|
|
474
556
|
cast_to=TaskIDList,
|
|
475
557
|
)
|
|
476
558
|
|
|
559
|
+
async def create_and_poll(
|
|
560
|
+
self,
|
|
561
|
+
*,
|
|
562
|
+
project_id: int | None = None,
|
|
563
|
+
region_id: int | None = None,
|
|
564
|
+
name: str,
|
|
565
|
+
create_router: bool | NotGiven = NOT_GIVEN,
|
|
566
|
+
tags: Dict[str, str] | NotGiven = NOT_GIVEN,
|
|
567
|
+
type: Literal["vlan", "vxlan"] | NotGiven = NOT_GIVEN,
|
|
568
|
+
polling_interval_seconds: int | NotGiven = NOT_GIVEN,
|
|
569
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
570
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
571
|
+
extra_headers: Headers | None = None,
|
|
572
|
+
extra_query: Query | None = None,
|
|
573
|
+
extra_body: Body | None = None,
|
|
574
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
575
|
+
) -> Network:
|
|
576
|
+
"""Create network and poll for the result."""
|
|
577
|
+
response = await self.create(
|
|
578
|
+
project_id=project_id,
|
|
579
|
+
region_id=region_id,
|
|
580
|
+
name=name,
|
|
581
|
+
create_router=create_router,
|
|
582
|
+
tags=tags,
|
|
583
|
+
type=type,
|
|
584
|
+
extra_headers=extra_headers,
|
|
585
|
+
extra_query=extra_query,
|
|
586
|
+
extra_body=extra_body,
|
|
587
|
+
timeout=timeout,
|
|
588
|
+
)
|
|
589
|
+
if not response.tasks or len(response.tasks) != 1:
|
|
590
|
+
raise ValueError(f"Expected exactly one task to be created")
|
|
591
|
+
task = await self._client.cloud.tasks.poll(
|
|
592
|
+
task_id=response.tasks[0],
|
|
593
|
+
extra_headers=extra_headers,
|
|
594
|
+
polling_interval_seconds=polling_interval_seconds,
|
|
595
|
+
)
|
|
596
|
+
if (
|
|
597
|
+
not task.created_resources
|
|
598
|
+
or not task.created_resources.networks
|
|
599
|
+
or len(task.created_resources.networks) != 1
|
|
600
|
+
):
|
|
601
|
+
raise ValueError(f"Expected exactly one resource to be created in a task")
|
|
602
|
+
return await self.get(
|
|
603
|
+
network_id=task.created_resources.networks[0],
|
|
604
|
+
project_id=project_id,
|
|
605
|
+
region_id=region_id,
|
|
606
|
+
extra_headers=extra_headers,
|
|
607
|
+
)
|
|
608
|
+
|
|
477
609
|
async def update(
|
|
478
610
|
self,
|
|
479
611
|
network_id: str,
|
|
@@ -562,7 +694,7 @@ class AsyncNetworksResource(AsyncAPIResource):
|
|
|
562
694
|
name: str | NotGiven = NOT_GIVEN,
|
|
563
695
|
offset: int | NotGiven = NOT_GIVEN,
|
|
564
696
|
order_by: Literal["created_at.asc", "created_at.desc", "name.asc", "name.desc"] | NotGiven = NOT_GIVEN,
|
|
565
|
-
tag_key:
|
|
697
|
+
tag_key: SequenceNotStr[str] | NotGiven = NOT_GIVEN,
|
|
566
698
|
tag_key_value: str | NotGiven = NOT_GIVEN,
|
|
567
699
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
568
700
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
@@ -673,6 +805,38 @@ class AsyncNetworksResource(AsyncAPIResource):
|
|
|
673
805
|
cast_to=TaskIDList,
|
|
674
806
|
)
|
|
675
807
|
|
|
808
|
+
async def delete_and_poll(
|
|
809
|
+
self,
|
|
810
|
+
network_id: str,
|
|
811
|
+
*,
|
|
812
|
+
project_id: int | None = None,
|
|
813
|
+
region_id: int | None = None,
|
|
814
|
+
polling_interval_seconds: int | NotGiven = NOT_GIVEN,
|
|
815
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
816
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
817
|
+
extra_headers: Headers | None = None,
|
|
818
|
+
extra_query: Query | None = None,
|
|
819
|
+
extra_body: Body | None = None,
|
|
820
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
821
|
+
) -> None:
|
|
822
|
+
"""Delete network and poll for the result."""
|
|
823
|
+
response = await self.delete(
|
|
824
|
+
network_id=network_id,
|
|
825
|
+
project_id=project_id,
|
|
826
|
+
region_id=region_id,
|
|
827
|
+
extra_headers=extra_headers,
|
|
828
|
+
extra_query=extra_query,
|
|
829
|
+
extra_body=extra_body,
|
|
830
|
+
timeout=timeout,
|
|
831
|
+
)
|
|
832
|
+
if not response.tasks:
|
|
833
|
+
raise ValueError("Expected at least one task to be created")
|
|
834
|
+
await self._client.cloud.tasks.poll(
|
|
835
|
+
task_id=response.tasks[0],
|
|
836
|
+
extra_headers=extra_headers,
|
|
837
|
+
polling_interval_seconds=polling_interval_seconds,
|
|
838
|
+
)
|
|
839
|
+
|
|
676
840
|
async def get(
|
|
677
841
|
self,
|
|
678
842
|
network_id: str,
|
|
@@ -726,6 +890,9 @@ class NetworksResourceWithRawResponse:
|
|
|
726
890
|
self.create = to_raw_response_wrapper(
|
|
727
891
|
networks.create,
|
|
728
892
|
)
|
|
893
|
+
self.create_and_poll = to_raw_response_wrapper(
|
|
894
|
+
networks.create_and_poll,
|
|
895
|
+
)
|
|
729
896
|
self.update = to_raw_response_wrapper(
|
|
730
897
|
networks.update,
|
|
731
898
|
)
|
|
@@ -735,6 +902,9 @@ class NetworksResourceWithRawResponse:
|
|
|
735
902
|
self.delete = to_raw_response_wrapper(
|
|
736
903
|
networks.delete,
|
|
737
904
|
)
|
|
905
|
+
self.delete_and_poll = to_raw_response_wrapper(
|
|
906
|
+
networks.delete_and_poll,
|
|
907
|
+
)
|
|
738
908
|
self.get = to_raw_response_wrapper(
|
|
739
909
|
networks.get,
|
|
740
910
|
)
|
|
@@ -755,6 +925,9 @@ class AsyncNetworksResourceWithRawResponse:
|
|
|
755
925
|
self.create = async_to_raw_response_wrapper(
|
|
756
926
|
networks.create,
|
|
757
927
|
)
|
|
928
|
+
self.create_and_poll = async_to_raw_response_wrapper(
|
|
929
|
+
networks.create_and_poll,
|
|
930
|
+
)
|
|
758
931
|
self.update = async_to_raw_response_wrapper(
|
|
759
932
|
networks.update,
|
|
760
933
|
)
|
|
@@ -764,6 +937,9 @@ class AsyncNetworksResourceWithRawResponse:
|
|
|
764
937
|
self.delete = async_to_raw_response_wrapper(
|
|
765
938
|
networks.delete,
|
|
766
939
|
)
|
|
940
|
+
self.delete_and_poll = async_to_raw_response_wrapper(
|
|
941
|
+
networks.delete_and_poll,
|
|
942
|
+
)
|
|
767
943
|
self.get = async_to_raw_response_wrapper(
|
|
768
944
|
networks.get,
|
|
769
945
|
)
|
|
@@ -784,6 +960,9 @@ class NetworksResourceWithStreamingResponse:
|
|
|
784
960
|
self.create = to_streamed_response_wrapper(
|
|
785
961
|
networks.create,
|
|
786
962
|
)
|
|
963
|
+
self.create_and_poll = to_streamed_response_wrapper(
|
|
964
|
+
networks.create_and_poll,
|
|
965
|
+
)
|
|
787
966
|
self.update = to_streamed_response_wrapper(
|
|
788
967
|
networks.update,
|
|
789
968
|
)
|
|
@@ -793,6 +972,9 @@ class NetworksResourceWithStreamingResponse:
|
|
|
793
972
|
self.delete = to_streamed_response_wrapper(
|
|
794
973
|
networks.delete,
|
|
795
974
|
)
|
|
975
|
+
self.delete_and_poll = to_streamed_response_wrapper(
|
|
976
|
+
networks.delete_and_poll,
|
|
977
|
+
)
|
|
796
978
|
self.get = to_streamed_response_wrapper(
|
|
797
979
|
networks.get,
|
|
798
980
|
)
|
|
@@ -813,6 +995,9 @@ class AsyncNetworksResourceWithStreamingResponse:
|
|
|
813
995
|
self.create = async_to_streamed_response_wrapper(
|
|
814
996
|
networks.create,
|
|
815
997
|
)
|
|
998
|
+
self.create_and_poll = async_to_streamed_response_wrapper(
|
|
999
|
+
networks.create_and_poll,
|
|
1000
|
+
)
|
|
816
1001
|
self.update = async_to_streamed_response_wrapper(
|
|
817
1002
|
networks.update,
|
|
818
1003
|
)
|
|
@@ -822,6 +1007,9 @@ class AsyncNetworksResourceWithStreamingResponse:
|
|
|
822
1007
|
self.delete = async_to_streamed_response_wrapper(
|
|
823
1008
|
networks.delete,
|
|
824
1009
|
)
|
|
1010
|
+
self.delete_and_poll = async_to_streamed_response_wrapper(
|
|
1011
|
+
networks.delete_and_poll,
|
|
1012
|
+
)
|
|
825
1013
|
self.get = async_to_streamed_response_wrapper(
|
|
826
1014
|
networks.get,
|
|
827
1015
|
)
|