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
|
@@ -2,12 +2,12 @@
|
|
|
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
|
|
9
9
|
|
|
10
|
-
from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven
|
|
10
|
+
from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven, SequenceNotStr
|
|
11
11
|
from ...._utils import maybe_transform, async_maybe_transform
|
|
12
12
|
from ...._compat import cached_property
|
|
13
13
|
from ...._resource import SyncAPIResource, AsyncAPIResource
|
|
@@ -136,7 +136,7 @@ class ImagesResource(SyncAPIResource):
|
|
|
136
136
|
region_id: int | None = None,
|
|
137
137
|
include_prices: bool | NotGiven = NOT_GIVEN,
|
|
138
138
|
private: str | NotGiven = NOT_GIVEN,
|
|
139
|
-
tag_key:
|
|
139
|
+
tag_key: SequenceNotStr[str] | NotGiven = NOT_GIVEN,
|
|
140
140
|
tag_key_value: str | NotGiven = NOT_GIVEN,
|
|
141
141
|
visibility: Literal["private", "public", "shared"] | NotGiven = NOT_GIVEN,
|
|
142
142
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
@@ -728,7 +728,7 @@ class AsyncImagesResource(AsyncAPIResource):
|
|
|
728
728
|
region_id: int | None = None,
|
|
729
729
|
include_prices: bool | NotGiven = NOT_GIVEN,
|
|
730
730
|
private: str | NotGiven = NOT_GIVEN,
|
|
731
|
-
tag_key:
|
|
731
|
+
tag_key: SequenceNotStr[str] | NotGiven = NOT_GIVEN,
|
|
732
732
|
tag_key_value: str | NotGiven = NOT_GIVEN,
|
|
733
733
|
visibility: Literal["private", "public", "shared"] | NotGiven = NOT_GIVEN,
|
|
734
734
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
|
-
from typing import Dict,
|
|
5
|
+
from typing import Dict, Union, Iterable, Optional
|
|
6
6
|
from datetime import datetime
|
|
7
7
|
from typing_extensions import Literal, overload
|
|
8
8
|
|
|
@@ -32,7 +32,7 @@ from .metrics import (
|
|
|
32
32
|
MetricsResourceWithStreamingResponse,
|
|
33
33
|
AsyncMetricsResourceWithStreamingResponse,
|
|
34
34
|
)
|
|
35
|
-
from ...._types import NOT_GIVEN, Body, Query, Headers, NoneType, NotGiven
|
|
35
|
+
from ...._types import NOT_GIVEN, Body, Query, Headers, NoneType, NotGiven, SequenceNotStr
|
|
36
36
|
from ...._utils import required_args, maybe_transform, async_maybe_transform
|
|
37
37
|
from ...._compat import cached_property
|
|
38
38
|
from .interfaces import (
|
|
@@ -417,7 +417,7 @@ class InstancesResource(SyncAPIResource):
|
|
|
417
417
|
]
|
|
418
418
|
| NotGiven = NOT_GIVEN,
|
|
419
419
|
tag_key_value: str | NotGiven = NOT_GIVEN,
|
|
420
|
-
tag_value:
|
|
420
|
+
tag_value: SequenceNotStr[str] | NotGiven = NOT_GIVEN,
|
|
421
421
|
type_ddos_profile: Literal["basic", "advanced"] | NotGiven = NOT_GIVEN,
|
|
422
422
|
uuid: str | NotGiven = NOT_GIVEN,
|
|
423
423
|
with_ddos: bool | NotGiven = NOT_GIVEN,
|
|
@@ -773,6 +773,125 @@ class InstancesResource(SyncAPIResource):
|
|
|
773
773
|
cast_to=TaskIDList,
|
|
774
774
|
)
|
|
775
775
|
|
|
776
|
+
@overload
|
|
777
|
+
def action_and_poll(
|
|
778
|
+
self,
|
|
779
|
+
instance_id: str,
|
|
780
|
+
*,
|
|
781
|
+
project_id: int | None = None,
|
|
782
|
+
region_id: int | None = None,
|
|
783
|
+
action: Literal["start"],
|
|
784
|
+
activate_profile: Optional[bool] | NotGiven = NOT_GIVEN,
|
|
785
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
786
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
787
|
+
extra_headers: Headers | None = None,
|
|
788
|
+
extra_query: Query | None = None,
|
|
789
|
+
extra_body: Body | None = None,
|
|
790
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
791
|
+
) -> Instance:
|
|
792
|
+
"""
|
|
793
|
+
The action can be one of: start, stop, reboot, powercycle, suspend or resume.
|
|
794
|
+
Suspend and resume are not available for bare metal instances.
|
|
795
|
+
|
|
796
|
+
Args:
|
|
797
|
+
action: Instance action name
|
|
798
|
+
|
|
799
|
+
activate_profile: Used on start instance to activate Advanced DDoS profile
|
|
800
|
+
|
|
801
|
+
extra_headers: Send extra headers
|
|
802
|
+
|
|
803
|
+
extra_query: Add additional query parameters to the request
|
|
804
|
+
|
|
805
|
+
extra_body: Add additional JSON properties to the request
|
|
806
|
+
|
|
807
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
808
|
+
"""
|
|
809
|
+
...
|
|
810
|
+
|
|
811
|
+
@overload
|
|
812
|
+
def action_and_poll(
|
|
813
|
+
self,
|
|
814
|
+
instance_id: str,
|
|
815
|
+
*,
|
|
816
|
+
project_id: int | None = None,
|
|
817
|
+
region_id: int | None = None,
|
|
818
|
+
action: Literal["reboot", "reboot_hard", "resume", "stop", "suspend"],
|
|
819
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
820
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
821
|
+
extra_headers: Headers | None = None,
|
|
822
|
+
extra_query: Query | None = None,
|
|
823
|
+
extra_body: Body | None = None,
|
|
824
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
825
|
+
) -> Instance:
|
|
826
|
+
"""
|
|
827
|
+
The action can be one of: start, stop, reboot, powercycle, suspend or resume.
|
|
828
|
+
Suspend and resume are not available for bare metal instances.
|
|
829
|
+
|
|
830
|
+
Args:
|
|
831
|
+
action: Instance action name
|
|
832
|
+
|
|
833
|
+
extra_headers: Send extra headers
|
|
834
|
+
|
|
835
|
+
extra_query: Add additional query parameters to the request
|
|
836
|
+
|
|
837
|
+
extra_body: Add additional JSON properties to the request
|
|
838
|
+
|
|
839
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
840
|
+
"""
|
|
841
|
+
...
|
|
842
|
+
|
|
843
|
+
@required_args(["action"])
|
|
844
|
+
def action_and_poll(
|
|
845
|
+
self,
|
|
846
|
+
instance_id: str,
|
|
847
|
+
*,
|
|
848
|
+
project_id: int | None = None,
|
|
849
|
+
region_id: int | None = None,
|
|
850
|
+
action: Literal["start", "reboot", "reboot_hard", "resume", "stop", "suspend"],
|
|
851
|
+
activate_profile: Optional[bool] | NotGiven = NOT_GIVEN,
|
|
852
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
853
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
854
|
+
extra_headers: Headers | None = None,
|
|
855
|
+
extra_query: Query | None = None,
|
|
856
|
+
extra_body: Body | None = None,
|
|
857
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
858
|
+
) -> Instance:
|
|
859
|
+
"""
|
|
860
|
+
Perform the action on the instance and poll for the result. Only the first task will be polled. If you need to poll more tasks, use the `tasks.poll` method.
|
|
861
|
+
"""
|
|
862
|
+
if project_id is None:
|
|
863
|
+
project_id = self._client._get_cloud_project_id_path_param()
|
|
864
|
+
if region_id is None:
|
|
865
|
+
region_id = self._client._get_cloud_region_id_path_param()
|
|
866
|
+
if not instance_id:
|
|
867
|
+
raise ValueError(f"Expected a non-empty value for `instance_id` but received {instance_id!r}")
|
|
868
|
+
response = self._post(
|
|
869
|
+
f"/cloud/v2/instances/{project_id}/{region_id}/{instance_id}/action",
|
|
870
|
+
body=maybe_transform(
|
|
871
|
+
{
|
|
872
|
+
"action": action,
|
|
873
|
+
"activate_profile": activate_profile,
|
|
874
|
+
},
|
|
875
|
+
instance_action_params.InstanceActionParams,
|
|
876
|
+
),
|
|
877
|
+
options=make_request_options(
|
|
878
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
879
|
+
),
|
|
880
|
+
cast_to=TaskIDList,
|
|
881
|
+
)
|
|
882
|
+
if not response.tasks:
|
|
883
|
+
raise ValueError("Expected at least one task to be created")
|
|
884
|
+
self._client.cloud.tasks.poll(
|
|
885
|
+
task_id=response.tasks[0],
|
|
886
|
+
extra_headers=extra_headers,
|
|
887
|
+
)
|
|
888
|
+
return self.get(
|
|
889
|
+
instance_id=instance_id,
|
|
890
|
+
project_id=project_id,
|
|
891
|
+
region_id=region_id,
|
|
892
|
+
extra_headers=extra_headers,
|
|
893
|
+
)
|
|
894
|
+
|
|
776
895
|
def add_to_placement_group(
|
|
777
896
|
self,
|
|
778
897
|
instance_id: str,
|
|
@@ -1667,7 +1786,7 @@ class AsyncInstancesResource(AsyncAPIResource):
|
|
|
1667
1786
|
]
|
|
1668
1787
|
| NotGiven = NOT_GIVEN,
|
|
1669
1788
|
tag_key_value: str | NotGiven = NOT_GIVEN,
|
|
1670
|
-
tag_value:
|
|
1789
|
+
tag_value: SequenceNotStr[str] | NotGiven = NOT_GIVEN,
|
|
1671
1790
|
type_ddos_profile: Literal["basic", "advanced"] | NotGiven = NOT_GIVEN,
|
|
1672
1791
|
uuid: str | NotGiven = NOT_GIVEN,
|
|
1673
1792
|
with_ddos: bool | NotGiven = NOT_GIVEN,
|
|
@@ -2023,6 +2142,125 @@ class AsyncInstancesResource(AsyncAPIResource):
|
|
|
2023
2142
|
cast_to=TaskIDList,
|
|
2024
2143
|
)
|
|
2025
2144
|
|
|
2145
|
+
@overload
|
|
2146
|
+
async def action_and_poll(
|
|
2147
|
+
self,
|
|
2148
|
+
instance_id: str,
|
|
2149
|
+
*,
|
|
2150
|
+
project_id: int | None = None,
|
|
2151
|
+
region_id: int | None = None,
|
|
2152
|
+
action: Literal["start"],
|
|
2153
|
+
activate_profile: Optional[bool] | NotGiven = NOT_GIVEN,
|
|
2154
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
2155
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
2156
|
+
extra_headers: Headers | None = None,
|
|
2157
|
+
extra_query: Query | None = None,
|
|
2158
|
+
extra_body: Body | None = None,
|
|
2159
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
2160
|
+
) -> Instance:
|
|
2161
|
+
"""
|
|
2162
|
+
The action can be one of: start, stop, reboot, powercycle, suspend or resume.
|
|
2163
|
+
Suspend and resume are not available for bare metal instances.
|
|
2164
|
+
|
|
2165
|
+
Args:
|
|
2166
|
+
action: Instance action name
|
|
2167
|
+
|
|
2168
|
+
activate_profile: Used on start instance to activate Advanced DDoS profile
|
|
2169
|
+
|
|
2170
|
+
extra_headers: Send extra headers
|
|
2171
|
+
|
|
2172
|
+
extra_query: Add additional query parameters to the request
|
|
2173
|
+
|
|
2174
|
+
extra_body: Add additional JSON properties to the request
|
|
2175
|
+
|
|
2176
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
2177
|
+
"""
|
|
2178
|
+
...
|
|
2179
|
+
|
|
2180
|
+
@overload
|
|
2181
|
+
async def action_and_poll(
|
|
2182
|
+
self,
|
|
2183
|
+
instance_id: str,
|
|
2184
|
+
*,
|
|
2185
|
+
project_id: int | None = None,
|
|
2186
|
+
region_id: int | None = None,
|
|
2187
|
+
action: Literal["reboot", "reboot_hard", "resume", "stop", "suspend"],
|
|
2188
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
2189
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
2190
|
+
extra_headers: Headers | None = None,
|
|
2191
|
+
extra_query: Query | None = None,
|
|
2192
|
+
extra_body: Body | None = None,
|
|
2193
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
2194
|
+
) -> Instance:
|
|
2195
|
+
"""
|
|
2196
|
+
The action can be one of: start, stop, reboot, powercycle, suspend or resume.
|
|
2197
|
+
Suspend and resume are not available for bare metal instances.
|
|
2198
|
+
|
|
2199
|
+
Args:
|
|
2200
|
+
action: Instance action name
|
|
2201
|
+
|
|
2202
|
+
extra_headers: Send extra headers
|
|
2203
|
+
|
|
2204
|
+
extra_query: Add additional query parameters to the request
|
|
2205
|
+
|
|
2206
|
+
extra_body: Add additional JSON properties to the request
|
|
2207
|
+
|
|
2208
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
2209
|
+
"""
|
|
2210
|
+
...
|
|
2211
|
+
|
|
2212
|
+
@required_args(["action"])
|
|
2213
|
+
async def action_and_poll(
|
|
2214
|
+
self,
|
|
2215
|
+
instance_id: str,
|
|
2216
|
+
*,
|
|
2217
|
+
project_id: int | None = None,
|
|
2218
|
+
region_id: int | None = None,
|
|
2219
|
+
action: Literal["start", "reboot", "reboot_hard", "resume", "stop", "suspend"],
|
|
2220
|
+
activate_profile: Optional[bool] | NotGiven = NOT_GIVEN,
|
|
2221
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
2222
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
2223
|
+
extra_headers: Headers | None = None,
|
|
2224
|
+
extra_query: Query | None = None,
|
|
2225
|
+
extra_body: Body | None = None,
|
|
2226
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
2227
|
+
) -> Instance:
|
|
2228
|
+
"""
|
|
2229
|
+
Perform the action on the instance and poll for the result. Only the first task will be polled. If you need to poll more tasks, use the `tasks.poll` method.
|
|
2230
|
+
"""
|
|
2231
|
+
if project_id is None:
|
|
2232
|
+
project_id = self._client._get_cloud_project_id_path_param()
|
|
2233
|
+
if region_id is None:
|
|
2234
|
+
region_id = self._client._get_cloud_region_id_path_param()
|
|
2235
|
+
if not instance_id:
|
|
2236
|
+
raise ValueError(f"Expected a non-empty value for `instance_id` but received {instance_id!r}")
|
|
2237
|
+
response = await self._post(
|
|
2238
|
+
f"/cloud/v2/instances/{project_id}/{region_id}/{instance_id}/action",
|
|
2239
|
+
body=await async_maybe_transform(
|
|
2240
|
+
{
|
|
2241
|
+
"action": action,
|
|
2242
|
+
"activate_profile": activate_profile,
|
|
2243
|
+
},
|
|
2244
|
+
instance_action_params.InstanceActionParams,
|
|
2245
|
+
),
|
|
2246
|
+
options=make_request_options(
|
|
2247
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
2248
|
+
),
|
|
2249
|
+
cast_to=TaskIDList,
|
|
2250
|
+
)
|
|
2251
|
+
if not response.tasks:
|
|
2252
|
+
raise ValueError("Expected at least one task to be created")
|
|
2253
|
+
await self._client.cloud.tasks.poll(
|
|
2254
|
+
task_id=response.tasks[0],
|
|
2255
|
+
extra_headers=extra_headers,
|
|
2256
|
+
)
|
|
2257
|
+
return await self.get(
|
|
2258
|
+
instance_id=instance_id,
|
|
2259
|
+
project_id=project_id,
|
|
2260
|
+
region_id=region_id,
|
|
2261
|
+
extra_headers=extra_headers,
|
|
2262
|
+
)
|
|
2263
|
+
|
|
2026
2264
|
async def add_to_placement_group(
|
|
2027
2265
|
self,
|
|
2028
2266
|
instance_id: str,
|
|
@@ -2591,6 +2829,9 @@ class InstancesResourceWithRawResponse:
|
|
|
2591
2829
|
self.action = to_raw_response_wrapper(
|
|
2592
2830
|
instances.action,
|
|
2593
2831
|
)
|
|
2832
|
+
self.action_and_poll = to_raw_response_wrapper(
|
|
2833
|
+
instances.action_and_poll,
|
|
2834
|
+
)
|
|
2594
2835
|
self.add_to_placement_group = to_raw_response_wrapper(
|
|
2595
2836
|
instances.add_to_placement_group,
|
|
2596
2837
|
)
|
|
@@ -2655,6 +2896,9 @@ class AsyncInstancesResourceWithRawResponse:
|
|
|
2655
2896
|
self.action = async_to_raw_response_wrapper(
|
|
2656
2897
|
instances.action,
|
|
2657
2898
|
)
|
|
2899
|
+
self.action_and_poll = async_to_raw_response_wrapper(
|
|
2900
|
+
instances.action_and_poll,
|
|
2901
|
+
)
|
|
2658
2902
|
self.add_to_placement_group = async_to_raw_response_wrapper(
|
|
2659
2903
|
instances.add_to_placement_group,
|
|
2660
2904
|
)
|
|
@@ -2719,6 +2963,9 @@ class InstancesResourceWithStreamingResponse:
|
|
|
2719
2963
|
self.action = to_streamed_response_wrapper(
|
|
2720
2964
|
instances.action,
|
|
2721
2965
|
)
|
|
2966
|
+
self.action_and_poll = to_streamed_response_wrapper(
|
|
2967
|
+
instances.action_and_poll,
|
|
2968
|
+
)
|
|
2722
2969
|
self.add_to_placement_group = to_streamed_response_wrapper(
|
|
2723
2970
|
instances.add_to_placement_group,
|
|
2724
2971
|
)
|
|
@@ -2783,6 +3030,9 @@ class AsyncInstancesResourceWithStreamingResponse:
|
|
|
2783
3030
|
self.action = async_to_streamed_response_wrapper(
|
|
2784
3031
|
instances.action,
|
|
2785
3032
|
)
|
|
3033
|
+
self.action_and_poll = async_to_streamed_response_wrapper(
|
|
3034
|
+
instances.action_and_poll,
|
|
3035
|
+
)
|
|
2786
3036
|
self.add_to_placement_group = async_to_streamed_response_wrapper(
|
|
2787
3037
|
instances.add_to_placement_group,
|
|
2788
3038
|
)
|