gcore 0.10.0__py3-none-any.whl → 0.12.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/reserved_fixed_ips.py +608 -0
- 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 +1125 -223
- 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 +1046 -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.12.0.dist-info}/METADATA +7 -2
- {gcore-0.10.0.dist-info → gcore-0.12.0.dist-info}/RECORD +313 -193
- 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.12.0.dist-info}/WHEEL +0 -0
- {gcore-0.10.0.dist-info → gcore-0.12.0.dist-info}/licenses/LICENSE +0 -0
|
@@ -455,6 +455,298 @@ class ReservedFixedIPsResource(SyncAPIResource):
|
|
|
455
455
|
cast_to=ReservedFixedIP,
|
|
456
456
|
)
|
|
457
457
|
|
|
458
|
+
@overload
|
|
459
|
+
def create_and_poll(
|
|
460
|
+
self,
|
|
461
|
+
*,
|
|
462
|
+
project_id: int | None = None,
|
|
463
|
+
region_id: int | None = None,
|
|
464
|
+
type: Literal["external"],
|
|
465
|
+
ip_family: Optional[InterfaceIPFamily] | NotGiven = NOT_GIVEN,
|
|
466
|
+
is_vip: bool | NotGiven = NOT_GIVEN,
|
|
467
|
+
polling_interval_seconds: int | NotGiven = NOT_GIVEN,
|
|
468
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
469
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
470
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
471
|
+
extra_headers: Headers | None = None,
|
|
472
|
+
extra_query: Query | None = None,
|
|
473
|
+
extra_body: Body | None = None,
|
|
474
|
+
) -> ReservedFixedIP:
|
|
475
|
+
"""
|
|
476
|
+
Create a new reserved fixed IP with the specified configuration and poll for the result. Only the first task will be polled. If you need to poll more tasks, use the `tasks.poll` method.
|
|
477
|
+
|
|
478
|
+
Args:
|
|
479
|
+
type: Must be 'external'
|
|
480
|
+
|
|
481
|
+
ip_family: Which subnets should be selected: IPv4, IPv6 or use dual stack.
|
|
482
|
+
|
|
483
|
+
is_vip: If reserved fixed IP is a VIP
|
|
484
|
+
|
|
485
|
+
extra_headers: Send extra headers
|
|
486
|
+
|
|
487
|
+
extra_query: Add additional query parameters to the request
|
|
488
|
+
|
|
489
|
+
extra_body: Add additional JSON properties to the request
|
|
490
|
+
|
|
491
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
492
|
+
"""
|
|
493
|
+
...
|
|
494
|
+
|
|
495
|
+
@overload
|
|
496
|
+
def create_and_poll(
|
|
497
|
+
self,
|
|
498
|
+
*,
|
|
499
|
+
project_id: int | None = None,
|
|
500
|
+
region_id: int | None = None,
|
|
501
|
+
subnet_id: str,
|
|
502
|
+
type: Literal["subnet"],
|
|
503
|
+
is_vip: bool | NotGiven = NOT_GIVEN,
|
|
504
|
+
polling_interval_seconds: int | NotGiven = NOT_GIVEN,
|
|
505
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
506
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
507
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
508
|
+
extra_headers: Headers | None = None,
|
|
509
|
+
extra_query: Query | None = None,
|
|
510
|
+
extra_body: Body | None = None,
|
|
511
|
+
) -> ReservedFixedIP:
|
|
512
|
+
"""
|
|
513
|
+
Create a new reserved fixed IP with the specified configuration and poll for the result. Only the first task will be polled. If you need to poll more tasks, use the `tasks.poll` method.
|
|
514
|
+
|
|
515
|
+
Args:
|
|
516
|
+
subnet_id: Reserved fixed IP will be allocated in this subnet
|
|
517
|
+
|
|
518
|
+
type: Must be 'subnet'.
|
|
519
|
+
|
|
520
|
+
is_vip: If reserved fixed IP is a VIP
|
|
521
|
+
|
|
522
|
+
extra_headers: Send extra headers
|
|
523
|
+
|
|
524
|
+
extra_query: Add additional query parameters to the request
|
|
525
|
+
|
|
526
|
+
extra_body: Add additional JSON properties to the request
|
|
527
|
+
|
|
528
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
529
|
+
"""
|
|
530
|
+
...
|
|
531
|
+
|
|
532
|
+
@overload
|
|
533
|
+
def create_and_poll(
|
|
534
|
+
self,
|
|
535
|
+
*,
|
|
536
|
+
project_id: int | None = None,
|
|
537
|
+
region_id: int | None = None,
|
|
538
|
+
network_id: str,
|
|
539
|
+
type: Literal["any_subnet"],
|
|
540
|
+
ip_family: Optional[InterfaceIPFamily] | NotGiven = NOT_GIVEN,
|
|
541
|
+
is_vip: bool | NotGiven = NOT_GIVEN,
|
|
542
|
+
polling_interval_seconds: int | NotGiven = NOT_GIVEN,
|
|
543
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
544
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
545
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
546
|
+
extra_headers: Headers | None = None,
|
|
547
|
+
extra_query: Query | None = None,
|
|
548
|
+
extra_body: Body | None = None,
|
|
549
|
+
) -> ReservedFixedIP:
|
|
550
|
+
"""
|
|
551
|
+
Create a new reserved fixed IP with the specified configuration and poll for the result. Only the first task will be polled. If you need to poll more tasks, use the `tasks.poll` method.
|
|
552
|
+
|
|
553
|
+
Args:
|
|
554
|
+
network_id: Reserved fixed IP will be allocated in a subnet of this network
|
|
555
|
+
|
|
556
|
+
type: Must be '`any_subnet`'.
|
|
557
|
+
|
|
558
|
+
ip_family: Which subnets should be selected: IPv4, IPv6 or use dual stack.
|
|
559
|
+
|
|
560
|
+
is_vip: If reserved fixed IP is a VIP
|
|
561
|
+
|
|
562
|
+
extra_headers: Send extra headers
|
|
563
|
+
|
|
564
|
+
extra_query: Add additional query parameters to the request
|
|
565
|
+
|
|
566
|
+
extra_body: Add additional JSON properties to the request
|
|
567
|
+
|
|
568
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
569
|
+
"""
|
|
570
|
+
...
|
|
571
|
+
|
|
572
|
+
@overload
|
|
573
|
+
def create_and_poll(
|
|
574
|
+
self,
|
|
575
|
+
*,
|
|
576
|
+
project_id: int | None = None,
|
|
577
|
+
region_id: int | None = None,
|
|
578
|
+
ip_address: str,
|
|
579
|
+
network_id: str,
|
|
580
|
+
type: Literal["ip_address"],
|
|
581
|
+
is_vip: bool | NotGiven = NOT_GIVEN,
|
|
582
|
+
polling_interval_seconds: int | NotGiven = NOT_GIVEN,
|
|
583
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
584
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
585
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
586
|
+
extra_headers: Headers | None = None,
|
|
587
|
+
extra_query: Query | None = None,
|
|
588
|
+
extra_body: Body | None = None,
|
|
589
|
+
) -> ReservedFixedIP:
|
|
590
|
+
"""
|
|
591
|
+
Create a new reserved fixed IP with the specified configuration and poll for the result. Only the first task will be polled. If you need to poll more tasks, use the `tasks.poll` method.
|
|
592
|
+
|
|
593
|
+
Args:
|
|
594
|
+
ip_address: Reserved fixed IP will be allocated the given IP address
|
|
595
|
+
|
|
596
|
+
network_id: Reserved fixed IP will be allocated in a subnet of this network
|
|
597
|
+
|
|
598
|
+
type: Must be '`ip_address`'.
|
|
599
|
+
|
|
600
|
+
is_vip: If reserved fixed IP is a VIP
|
|
601
|
+
|
|
602
|
+
extra_headers: Send extra headers
|
|
603
|
+
|
|
604
|
+
extra_query: Add additional query parameters to the request
|
|
605
|
+
|
|
606
|
+
extra_body: Add additional JSON properties to the request
|
|
607
|
+
|
|
608
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
609
|
+
"""
|
|
610
|
+
...
|
|
611
|
+
|
|
612
|
+
@overload
|
|
613
|
+
def create_and_poll(
|
|
614
|
+
self,
|
|
615
|
+
*,
|
|
616
|
+
project_id: int | None = None,
|
|
617
|
+
region_id: int | None = None,
|
|
618
|
+
port_id: str,
|
|
619
|
+
type: Literal["port"],
|
|
620
|
+
polling_interval_seconds: int | NotGiven = NOT_GIVEN,
|
|
621
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
622
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
623
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
624
|
+
extra_headers: Headers | None = None,
|
|
625
|
+
extra_query: Query | None = None,
|
|
626
|
+
extra_body: Body | None = None,
|
|
627
|
+
) -> ReservedFixedIP:
|
|
628
|
+
"""
|
|
629
|
+
Create a new reserved fixed IP with the specified configuration and poll for the result. Only the first task will be polled. If you need to poll more tasks, use the `tasks.poll` method.
|
|
630
|
+
|
|
631
|
+
Args:
|
|
632
|
+
port_id: Port ID to make a reserved fixed IP (for example, `vip_port_id` of the Load
|
|
633
|
+
Balancer entity).
|
|
634
|
+
|
|
635
|
+
type: Must be 'port'.
|
|
636
|
+
|
|
637
|
+
extra_headers: Send extra headers
|
|
638
|
+
|
|
639
|
+
extra_query: Add additional query parameters to the request
|
|
640
|
+
|
|
641
|
+
extra_body: Add additional JSON properties to the request
|
|
642
|
+
|
|
643
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
644
|
+
"""
|
|
645
|
+
...
|
|
646
|
+
|
|
647
|
+
@required_args(
|
|
648
|
+
["type"],
|
|
649
|
+
["subnet_id", "type"],
|
|
650
|
+
["network_id", "type"],
|
|
651
|
+
["ip_address", "network_id", "type"],
|
|
652
|
+
["port_id", "type"],
|
|
653
|
+
)
|
|
654
|
+
def create_and_poll(
|
|
655
|
+
self,
|
|
656
|
+
*,
|
|
657
|
+
project_id: int | None = None,
|
|
658
|
+
region_id: int | None = None,
|
|
659
|
+
type: Literal["external"] | Literal["subnet"] | Literal["any_subnet"] | Literal["ip_address"] | Literal["port"],
|
|
660
|
+
ip_family: Optional[InterfaceIPFamily] | NotGiven = NOT_GIVEN,
|
|
661
|
+
is_vip: bool | NotGiven = NOT_GIVEN,
|
|
662
|
+
subnet_id: str | NotGiven = NOT_GIVEN,
|
|
663
|
+
network_id: str | NotGiven = NOT_GIVEN,
|
|
664
|
+
ip_address: str | NotGiven = NOT_GIVEN,
|
|
665
|
+
port_id: str | NotGiven = NOT_GIVEN,
|
|
666
|
+
polling_interval_seconds: int | NotGiven = NOT_GIVEN,
|
|
667
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
668
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
669
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
670
|
+
extra_headers: Headers | None = None,
|
|
671
|
+
extra_query: Query | None = None,
|
|
672
|
+
extra_body: Body | None = None,
|
|
673
|
+
) -> ReservedFixedIP:
|
|
674
|
+
"""
|
|
675
|
+
Create a new reserved fixed IP with the specified configuration and poll for the result. Only the first task will be polled. If you need to poll more tasks, use the `tasks.poll` method.
|
|
676
|
+
"""
|
|
677
|
+
response: TaskIDList = self.create( # type: ignore
|
|
678
|
+
project_id=project_id,
|
|
679
|
+
region_id=region_id,
|
|
680
|
+
type=type,
|
|
681
|
+
ip_family=ip_family,
|
|
682
|
+
is_vip=is_vip,
|
|
683
|
+
subnet_id=subnet_id,
|
|
684
|
+
network_id=network_id,
|
|
685
|
+
ip_address=ip_address,
|
|
686
|
+
port_id=port_id,
|
|
687
|
+
extra_headers=extra_headers,
|
|
688
|
+
extra_query=extra_query,
|
|
689
|
+
extra_body=extra_body,
|
|
690
|
+
timeout=timeout,
|
|
691
|
+
)
|
|
692
|
+
if not response.tasks: # type: ignore
|
|
693
|
+
raise ValueError("Expected at least one task to be created")
|
|
694
|
+
task = self._client.cloud.tasks.poll(
|
|
695
|
+
task_id=response.tasks[0], # type: ignore
|
|
696
|
+
extra_headers=extra_headers,
|
|
697
|
+
polling_interval_seconds=polling_interval_seconds,
|
|
698
|
+
)
|
|
699
|
+
if (
|
|
700
|
+
task.created_resources is None
|
|
701
|
+
or task.created_resources.ports is None
|
|
702
|
+
or len(task.created_resources.ports) != 1
|
|
703
|
+
):
|
|
704
|
+
raise ValueError("Task completed but created_resources or ports is missing or invalid")
|
|
705
|
+
created_port_id = task.created_resources.ports[0]
|
|
706
|
+
return self.get(
|
|
707
|
+
port_id=created_port_id,
|
|
708
|
+
project_id=project_id,
|
|
709
|
+
region_id=region_id,
|
|
710
|
+
extra_headers=extra_headers,
|
|
711
|
+
extra_query=extra_query,
|
|
712
|
+
extra_body=extra_body,
|
|
713
|
+
timeout=timeout,
|
|
714
|
+
)
|
|
715
|
+
|
|
716
|
+
def delete_and_poll(
|
|
717
|
+
self,
|
|
718
|
+
port_id: str,
|
|
719
|
+
*,
|
|
720
|
+
project_id: int | None = None,
|
|
721
|
+
region_id: int | None = None,
|
|
722
|
+
polling_interval_seconds: int | NotGiven = NOT_GIVEN,
|
|
723
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
724
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
725
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
726
|
+
extra_headers: Headers | None = None,
|
|
727
|
+
extra_query: Query | None = None,
|
|
728
|
+
extra_body: Body | None = None,
|
|
729
|
+
) -> None:
|
|
730
|
+
"""
|
|
731
|
+
Delete a specific reserved fixed IP and all its associated resources and poll for the result. Only the first task will be polled. If you need to poll more tasks, use the `tasks.poll` method.
|
|
732
|
+
"""
|
|
733
|
+
response = self.delete(
|
|
734
|
+
port_id=port_id,
|
|
735
|
+
project_id=project_id,
|
|
736
|
+
region_id=region_id,
|
|
737
|
+
extra_headers=extra_headers,
|
|
738
|
+
extra_query=extra_query,
|
|
739
|
+
extra_body=extra_body,
|
|
740
|
+
timeout=timeout,
|
|
741
|
+
)
|
|
742
|
+
if not response.tasks:
|
|
743
|
+
raise ValueError("Expected at least one task to be created")
|
|
744
|
+
self._client.cloud.tasks.poll(
|
|
745
|
+
task_id=response.tasks[0],
|
|
746
|
+
extra_headers=extra_headers,
|
|
747
|
+
polling_interval_seconds=polling_interval_seconds,
|
|
748
|
+
)
|
|
749
|
+
|
|
458
750
|
|
|
459
751
|
class AsyncReservedFixedIPsResource(AsyncAPIResource):
|
|
460
752
|
@cached_property
|
|
@@ -876,6 +1168,298 @@ class AsyncReservedFixedIPsResource(AsyncAPIResource):
|
|
|
876
1168
|
cast_to=ReservedFixedIP,
|
|
877
1169
|
)
|
|
878
1170
|
|
|
1171
|
+
@overload
|
|
1172
|
+
async def create_and_poll(
|
|
1173
|
+
self,
|
|
1174
|
+
*,
|
|
1175
|
+
project_id: int | None = None,
|
|
1176
|
+
region_id: int | None = None,
|
|
1177
|
+
type: Literal["external"],
|
|
1178
|
+
ip_family: Optional[InterfaceIPFamily] | NotGiven = NOT_GIVEN,
|
|
1179
|
+
is_vip: bool | NotGiven = NOT_GIVEN,
|
|
1180
|
+
polling_interval_seconds: int | NotGiven = NOT_GIVEN,
|
|
1181
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
1182
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
1183
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
1184
|
+
extra_headers: Headers | None = None,
|
|
1185
|
+
extra_query: Query | None = None,
|
|
1186
|
+
extra_body: Body | None = None,
|
|
1187
|
+
) -> ReservedFixedIP:
|
|
1188
|
+
"""
|
|
1189
|
+
Create a new reserved fixed IP with the specified configuration and poll for the result. Only the first task will be polled. If you need to poll more tasks, use the `tasks.poll` method.
|
|
1190
|
+
|
|
1191
|
+
Args:
|
|
1192
|
+
type: Must be 'external'
|
|
1193
|
+
|
|
1194
|
+
ip_family: Which subnets should be selected: IPv4, IPv6 or use dual stack.
|
|
1195
|
+
|
|
1196
|
+
is_vip: If reserved fixed IP is a VIP
|
|
1197
|
+
|
|
1198
|
+
extra_headers: Send extra headers
|
|
1199
|
+
|
|
1200
|
+
extra_query: Add additional query parameters to the request
|
|
1201
|
+
|
|
1202
|
+
extra_body: Add additional JSON properties to the request
|
|
1203
|
+
|
|
1204
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
1205
|
+
"""
|
|
1206
|
+
...
|
|
1207
|
+
|
|
1208
|
+
@overload
|
|
1209
|
+
async def create_and_poll(
|
|
1210
|
+
self,
|
|
1211
|
+
*,
|
|
1212
|
+
project_id: int | None = None,
|
|
1213
|
+
region_id: int | None = None,
|
|
1214
|
+
subnet_id: str,
|
|
1215
|
+
type: Literal["subnet"],
|
|
1216
|
+
is_vip: bool | NotGiven = NOT_GIVEN,
|
|
1217
|
+
polling_interval_seconds: int | NotGiven = NOT_GIVEN,
|
|
1218
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
1219
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
1220
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
1221
|
+
extra_headers: Headers | None = None,
|
|
1222
|
+
extra_query: Query | None = None,
|
|
1223
|
+
extra_body: Body | None = None,
|
|
1224
|
+
) -> ReservedFixedIP:
|
|
1225
|
+
"""
|
|
1226
|
+
Create a new reserved fixed IP with the specified configuration and poll for the result. Only the first task will be polled. If you need to poll more tasks, use the `tasks.poll` method.
|
|
1227
|
+
|
|
1228
|
+
Args:
|
|
1229
|
+
subnet_id: Reserved fixed IP will be allocated in this subnet
|
|
1230
|
+
|
|
1231
|
+
type: Must be 'subnet'.
|
|
1232
|
+
|
|
1233
|
+
is_vip: If reserved fixed IP is a VIP
|
|
1234
|
+
|
|
1235
|
+
extra_headers: Send extra headers
|
|
1236
|
+
|
|
1237
|
+
extra_query: Add additional query parameters to the request
|
|
1238
|
+
|
|
1239
|
+
extra_body: Add additional JSON properties to the request
|
|
1240
|
+
|
|
1241
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
1242
|
+
"""
|
|
1243
|
+
...
|
|
1244
|
+
|
|
1245
|
+
@overload
|
|
1246
|
+
async def create_and_poll(
|
|
1247
|
+
self,
|
|
1248
|
+
*,
|
|
1249
|
+
project_id: int | None = None,
|
|
1250
|
+
region_id: int | None = None,
|
|
1251
|
+
network_id: str,
|
|
1252
|
+
type: Literal["any_subnet"],
|
|
1253
|
+
ip_family: Optional[InterfaceIPFamily] | NotGiven = NOT_GIVEN,
|
|
1254
|
+
is_vip: bool | NotGiven = NOT_GIVEN,
|
|
1255
|
+
polling_interval_seconds: int | NotGiven = NOT_GIVEN,
|
|
1256
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
1257
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
1258
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
1259
|
+
extra_headers: Headers | None = None,
|
|
1260
|
+
extra_query: Query | None = None,
|
|
1261
|
+
extra_body: Body | None = None,
|
|
1262
|
+
) -> ReservedFixedIP:
|
|
1263
|
+
"""
|
|
1264
|
+
Create a new reserved fixed IP with the specified configuration and poll for the result. Only the first task will be polled. If you need to poll more tasks, use the `tasks.poll` method.
|
|
1265
|
+
|
|
1266
|
+
Args:
|
|
1267
|
+
network_id: Reserved fixed IP will be allocated in a subnet of this network
|
|
1268
|
+
|
|
1269
|
+
type: Must be '`any_subnet`'.
|
|
1270
|
+
|
|
1271
|
+
ip_family: Which subnets should be selected: IPv4, IPv6 or use dual stack.
|
|
1272
|
+
|
|
1273
|
+
is_vip: If reserved fixed IP is a VIP
|
|
1274
|
+
|
|
1275
|
+
extra_headers: Send extra headers
|
|
1276
|
+
|
|
1277
|
+
extra_query: Add additional query parameters to the request
|
|
1278
|
+
|
|
1279
|
+
extra_body: Add additional JSON properties to the request
|
|
1280
|
+
|
|
1281
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
1282
|
+
"""
|
|
1283
|
+
...
|
|
1284
|
+
|
|
1285
|
+
@overload
|
|
1286
|
+
async def create_and_poll(
|
|
1287
|
+
self,
|
|
1288
|
+
*,
|
|
1289
|
+
project_id: int | None = None,
|
|
1290
|
+
region_id: int | None = None,
|
|
1291
|
+
ip_address: str,
|
|
1292
|
+
network_id: str,
|
|
1293
|
+
type: Literal["ip_address"],
|
|
1294
|
+
is_vip: bool | NotGiven = NOT_GIVEN,
|
|
1295
|
+
polling_interval_seconds: int | NotGiven = NOT_GIVEN,
|
|
1296
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
1297
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
1298
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
1299
|
+
extra_headers: Headers | None = None,
|
|
1300
|
+
extra_query: Query | None = None,
|
|
1301
|
+
extra_body: Body | None = None,
|
|
1302
|
+
) -> ReservedFixedIP:
|
|
1303
|
+
"""
|
|
1304
|
+
Create a new reserved fixed IP with the specified configuration and poll for the result. Only the first task will be polled. If you need to poll more tasks, use the `tasks.poll` method.
|
|
1305
|
+
|
|
1306
|
+
Args:
|
|
1307
|
+
ip_address: Reserved fixed IP will be allocated the given IP address
|
|
1308
|
+
|
|
1309
|
+
network_id: Reserved fixed IP will be allocated in a subnet of this network
|
|
1310
|
+
|
|
1311
|
+
type: Must be '`ip_address`'.
|
|
1312
|
+
|
|
1313
|
+
is_vip: If reserved fixed IP is a VIP
|
|
1314
|
+
|
|
1315
|
+
extra_headers: Send extra headers
|
|
1316
|
+
|
|
1317
|
+
extra_query: Add additional query parameters to the request
|
|
1318
|
+
|
|
1319
|
+
extra_body: Add additional JSON properties to the request
|
|
1320
|
+
|
|
1321
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
1322
|
+
"""
|
|
1323
|
+
...
|
|
1324
|
+
|
|
1325
|
+
@overload
|
|
1326
|
+
async def create_and_poll(
|
|
1327
|
+
self,
|
|
1328
|
+
*,
|
|
1329
|
+
project_id: int | None = None,
|
|
1330
|
+
region_id: int | None = None,
|
|
1331
|
+
port_id: str,
|
|
1332
|
+
type: Literal["port"],
|
|
1333
|
+
polling_interval_seconds: int | NotGiven = NOT_GIVEN,
|
|
1334
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
1335
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
1336
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
1337
|
+
extra_headers: Headers | None = None,
|
|
1338
|
+
extra_query: Query | None = None,
|
|
1339
|
+
extra_body: Body | None = None,
|
|
1340
|
+
) -> ReservedFixedIP:
|
|
1341
|
+
"""
|
|
1342
|
+
Create a new reserved fixed IP with the specified configuration and poll for the result. Only the first task will be polled. If you need to poll more tasks, use the `tasks.poll` method.
|
|
1343
|
+
|
|
1344
|
+
Args:
|
|
1345
|
+
port_id: Port ID to make a reserved fixed IP (for example, `vip_port_id` of the Load
|
|
1346
|
+
Balancer entity).
|
|
1347
|
+
|
|
1348
|
+
type: Must be 'port'.
|
|
1349
|
+
|
|
1350
|
+
extra_headers: Send extra headers
|
|
1351
|
+
|
|
1352
|
+
extra_query: Add additional query parameters to the request
|
|
1353
|
+
|
|
1354
|
+
extra_body: Add additional JSON properties to the request
|
|
1355
|
+
|
|
1356
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
1357
|
+
"""
|
|
1358
|
+
...
|
|
1359
|
+
|
|
1360
|
+
@required_args(
|
|
1361
|
+
["type"],
|
|
1362
|
+
["subnet_id", "type"],
|
|
1363
|
+
["network_id", "type"],
|
|
1364
|
+
["ip_address", "network_id", "type"],
|
|
1365
|
+
["port_id", "type"],
|
|
1366
|
+
)
|
|
1367
|
+
async def create_and_poll(
|
|
1368
|
+
self,
|
|
1369
|
+
*,
|
|
1370
|
+
project_id: int | None = None,
|
|
1371
|
+
region_id: int | None = None,
|
|
1372
|
+
type: Literal["external"] | Literal["subnet"] | Literal["any_subnet"] | Literal["ip_address"] | Literal["port"],
|
|
1373
|
+
ip_family: Optional[InterfaceIPFamily] | NotGiven = NOT_GIVEN,
|
|
1374
|
+
is_vip: bool | NotGiven = NOT_GIVEN,
|
|
1375
|
+
subnet_id: str | NotGiven = NOT_GIVEN,
|
|
1376
|
+
network_id: str | NotGiven = NOT_GIVEN,
|
|
1377
|
+
ip_address: str | NotGiven = NOT_GIVEN,
|
|
1378
|
+
port_id: str | NotGiven = NOT_GIVEN,
|
|
1379
|
+
polling_interval_seconds: int | NotGiven = NOT_GIVEN,
|
|
1380
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
1381
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
1382
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
1383
|
+
extra_headers: Headers | None = None,
|
|
1384
|
+
extra_query: Query | None = None,
|
|
1385
|
+
extra_body: Body | None = None,
|
|
1386
|
+
) -> ReservedFixedIP:
|
|
1387
|
+
"""
|
|
1388
|
+
Create a new reserved fixed IP with the specified configuration and poll for the result. Only the first task will be polled. If you need to poll more tasks, use the `tasks.poll` method.
|
|
1389
|
+
"""
|
|
1390
|
+
response: TaskIDList = await self.create( # type: ignore
|
|
1391
|
+
project_id=project_id,
|
|
1392
|
+
region_id=region_id,
|
|
1393
|
+
type=type,
|
|
1394
|
+
ip_family=ip_family,
|
|
1395
|
+
is_vip=is_vip,
|
|
1396
|
+
subnet_id=subnet_id,
|
|
1397
|
+
network_id=network_id,
|
|
1398
|
+
ip_address=ip_address,
|
|
1399
|
+
port_id=port_id,
|
|
1400
|
+
extra_headers=extra_headers,
|
|
1401
|
+
extra_query=extra_query,
|
|
1402
|
+
extra_body=extra_body,
|
|
1403
|
+
timeout=timeout,
|
|
1404
|
+
)
|
|
1405
|
+
if not response.tasks: # type: ignore
|
|
1406
|
+
raise ValueError("Expected at least one task to be created")
|
|
1407
|
+
task = await self._client.cloud.tasks.poll(
|
|
1408
|
+
task_id=response.tasks[0], # type: ignore
|
|
1409
|
+
extra_headers=extra_headers,
|
|
1410
|
+
polling_interval_seconds=polling_interval_seconds,
|
|
1411
|
+
)
|
|
1412
|
+
if (
|
|
1413
|
+
task.created_resources is None
|
|
1414
|
+
or task.created_resources.ports is None
|
|
1415
|
+
or len(task.created_resources.ports) != 1
|
|
1416
|
+
):
|
|
1417
|
+
raise ValueError("Task completed but created_resources or ports is missing or invalid")
|
|
1418
|
+
created_port_id = task.created_resources.ports[0]
|
|
1419
|
+
return await self.get(
|
|
1420
|
+
port_id=created_port_id,
|
|
1421
|
+
project_id=project_id,
|
|
1422
|
+
region_id=region_id,
|
|
1423
|
+
extra_headers=extra_headers,
|
|
1424
|
+
extra_query=extra_query,
|
|
1425
|
+
extra_body=extra_body,
|
|
1426
|
+
timeout=timeout,
|
|
1427
|
+
)
|
|
1428
|
+
|
|
1429
|
+
async def delete_and_poll(
|
|
1430
|
+
self,
|
|
1431
|
+
port_id: str,
|
|
1432
|
+
*,
|
|
1433
|
+
project_id: int | None = None,
|
|
1434
|
+
region_id: int | None = None,
|
|
1435
|
+
polling_interval_seconds: int | NotGiven = NOT_GIVEN,
|
|
1436
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
1437
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
1438
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
1439
|
+
extra_headers: Headers | None = None,
|
|
1440
|
+
extra_query: Query | None = None,
|
|
1441
|
+
extra_body: Body | None = None,
|
|
1442
|
+
) -> None:
|
|
1443
|
+
"""
|
|
1444
|
+
Delete a specific reserved fixed IP and all its associated resources and poll for the result. Only the first task will be polled. If you need to poll more tasks, use the `tasks.poll` method.
|
|
1445
|
+
"""
|
|
1446
|
+
response = await self.delete(
|
|
1447
|
+
port_id=port_id,
|
|
1448
|
+
project_id=project_id,
|
|
1449
|
+
region_id=region_id,
|
|
1450
|
+
extra_headers=extra_headers,
|
|
1451
|
+
extra_query=extra_query,
|
|
1452
|
+
extra_body=extra_body,
|
|
1453
|
+
timeout=timeout,
|
|
1454
|
+
)
|
|
1455
|
+
if not response.tasks:
|
|
1456
|
+
raise ValueError("Expected at least one task to be created")
|
|
1457
|
+
await self._client.cloud.tasks.poll(
|
|
1458
|
+
task_id=response.tasks[0],
|
|
1459
|
+
extra_headers=extra_headers,
|
|
1460
|
+
polling_interval_seconds=polling_interval_seconds,
|
|
1461
|
+
)
|
|
1462
|
+
|
|
879
1463
|
|
|
880
1464
|
class ReservedFixedIPsResourceWithRawResponse:
|
|
881
1465
|
def __init__(self, reserved_fixed_ips: ReservedFixedIPsResource) -> None:
|
|
@@ -893,6 +1477,12 @@ class ReservedFixedIPsResourceWithRawResponse:
|
|
|
893
1477
|
self.get = to_raw_response_wrapper(
|
|
894
1478
|
reserved_fixed_ips.get,
|
|
895
1479
|
)
|
|
1480
|
+
self.create_and_poll = to_raw_response_wrapper(
|
|
1481
|
+
reserved_fixed_ips.create_and_poll,
|
|
1482
|
+
)
|
|
1483
|
+
self.delete_and_poll = to_raw_response_wrapper(
|
|
1484
|
+
reserved_fixed_ips.delete_and_poll,
|
|
1485
|
+
)
|
|
896
1486
|
|
|
897
1487
|
@cached_property
|
|
898
1488
|
def vip(self) -> VipResourceWithRawResponse:
|
|
@@ -915,6 +1505,12 @@ class AsyncReservedFixedIPsResourceWithRawResponse:
|
|
|
915
1505
|
self.get = async_to_raw_response_wrapper(
|
|
916
1506
|
reserved_fixed_ips.get,
|
|
917
1507
|
)
|
|
1508
|
+
self.create_and_poll = async_to_raw_response_wrapper(
|
|
1509
|
+
reserved_fixed_ips.create_and_poll,
|
|
1510
|
+
)
|
|
1511
|
+
self.delete_and_poll = async_to_raw_response_wrapper(
|
|
1512
|
+
reserved_fixed_ips.delete_and_poll,
|
|
1513
|
+
)
|
|
918
1514
|
|
|
919
1515
|
@cached_property
|
|
920
1516
|
def vip(self) -> AsyncVipResourceWithRawResponse:
|
|
@@ -937,6 +1533,12 @@ class ReservedFixedIPsResourceWithStreamingResponse:
|
|
|
937
1533
|
self.get = to_streamed_response_wrapper(
|
|
938
1534
|
reserved_fixed_ips.get,
|
|
939
1535
|
)
|
|
1536
|
+
self.create_and_poll = to_streamed_response_wrapper(
|
|
1537
|
+
reserved_fixed_ips.create_and_poll,
|
|
1538
|
+
)
|
|
1539
|
+
self.delete_and_poll = to_streamed_response_wrapper(
|
|
1540
|
+
reserved_fixed_ips.delete_and_poll,
|
|
1541
|
+
)
|
|
940
1542
|
|
|
941
1543
|
@cached_property
|
|
942
1544
|
def vip(self) -> VipResourceWithStreamingResponse:
|
|
@@ -959,6 +1561,12 @@ class AsyncReservedFixedIPsResourceWithStreamingResponse:
|
|
|
959
1561
|
self.get = async_to_streamed_response_wrapper(
|
|
960
1562
|
reserved_fixed_ips.get,
|
|
961
1563
|
)
|
|
1564
|
+
self.create_and_poll = async_to_streamed_response_wrapper(
|
|
1565
|
+
reserved_fixed_ips.create_and_poll,
|
|
1566
|
+
)
|
|
1567
|
+
self.delete_and_poll = async_to_streamed_response_wrapper(
|
|
1568
|
+
reserved_fixed_ips.delete_and_poll,
|
|
1569
|
+
)
|
|
962
1570
|
|
|
963
1571
|
@cached_property
|
|
964
1572
|
def vip(self) -> AsyncVipResourceWithStreamingResponse:
|
|
@@ -2,11 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
|
-
from typing import List
|
|
6
|
-
|
|
7
5
|
import httpx
|
|
8
6
|
|
|
9
|
-
from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven
|
|
7
|
+
from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven, SequenceNotStr
|
|
10
8
|
from ...._utils import maybe_transform, async_maybe_transform
|
|
11
9
|
from ...._compat import cached_property
|
|
12
10
|
from ...._resource import SyncAPIResource, AsyncAPIResource
|
|
@@ -133,7 +131,7 @@ class VipResource(SyncAPIResource):
|
|
|
133
131
|
*,
|
|
134
132
|
project_id: int | None = None,
|
|
135
133
|
region_id: int | None = None,
|
|
136
|
-
port_ids:
|
|
134
|
+
port_ids: SequenceNotStr[str] | NotGiven = NOT_GIVEN,
|
|
137
135
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
138
136
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
139
137
|
extra_headers: Headers | None = None,
|
|
@@ -221,7 +219,7 @@ class VipResource(SyncAPIResource):
|
|
|
221
219
|
*,
|
|
222
220
|
project_id: int | None = None,
|
|
223
221
|
region_id: int | None = None,
|
|
224
|
-
port_ids:
|
|
222
|
+
port_ids: SequenceNotStr[str] | NotGiven = NOT_GIVEN,
|
|
225
223
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
226
224
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
227
225
|
extra_headers: Headers | None = None,
|
|
@@ -365,7 +363,7 @@ class AsyncVipResource(AsyncAPIResource):
|
|
|
365
363
|
*,
|
|
366
364
|
project_id: int | None = None,
|
|
367
365
|
region_id: int | None = None,
|
|
368
|
-
port_ids:
|
|
366
|
+
port_ids: SequenceNotStr[str] | NotGiven = NOT_GIVEN,
|
|
369
367
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
370
368
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
371
369
|
extra_headers: Headers | None = None,
|
|
@@ -453,7 +451,7 @@ class AsyncVipResource(AsyncAPIResource):
|
|
|
453
451
|
*,
|
|
454
452
|
project_id: int | None = None,
|
|
455
453
|
region_id: int | None = None,
|
|
456
|
-
port_ids:
|
|
454
|
+
port_ids: SequenceNotStr[str] | NotGiven = NOT_GIVEN,
|
|
457
455
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
458
456
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
459
457
|
extra_headers: Headers | None = None,
|