gcore 0.13.0__py3-none-any.whl → 0.14.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of gcore might be problematic. Click here for more details.
- gcore/__init__.py +3 -1
- gcore/_base_client.py +9 -9
- gcore/_client.py +25 -10
- gcore/_models.py +10 -4
- gcore/_qs.py +7 -7
- gcore/_types.py +18 -11
- gcore/_utils/_transform.py +2 -2
- gcore/_utils/_utils.py +4 -4
- gcore/_version.py +1 -1
- gcore/pagination.py +137 -0
- gcore/resources/__init__.py +14 -0
- gcore/resources/cdn/__init__.py +201 -0
- gcore/resources/cdn/audit_log.py +406 -0
- gcore/resources/cdn/cdn.py +957 -0
- gcore/resources/cdn/certificates.py +1062 -0
- gcore/resources/cdn/ip_ranges.py +224 -0
- gcore/resources/cdn/logs/__init__.py +33 -0
- gcore/resources/cdn/logs/logs.py +1424 -0
- gcore/resources/cdn/logs/settings.py +1081 -0
- gcore/resources/cdn/logs_uploader/__init__.py +61 -0
- gcore/resources/cdn/logs_uploader/configs.py +868 -0
- gcore/resources/cdn/logs_uploader/logs_uploader.py +166 -0
- gcore/resources/cdn/logs_uploader/policies.py +1060 -0
- gcore/resources/cdn/logs_uploader/targets.py +811 -0
- gcore/resources/cdn/metrics.py +419 -0
- gcore/resources/cdn/network_capacity.py +139 -0
- gcore/resources/cdn/origin_groups.py +1496 -0
- gcore/resources/cdn/resources/__init__.py +47 -0
- gcore/resources/cdn/resources/resources.py +2060 -0
- gcore/resources/cdn/resources/rules.py +1027 -0
- gcore/resources/cdn/resources/shield.py +259 -0
- gcore/resources/cdn/rule_templates.py +883 -0
- gcore/resources/cdn/shields.py +139 -0
- gcore/resources/cdn/statistics.py +1408 -0
- gcore/resources/cdn/trusted_ca_certificates.py +592 -0
- gcore/resources/cloud/audit_logs.py +33 -29
- gcore/resources/cloud/baremetal/flavors.py +21 -17
- gcore/resources/cloud/baremetal/images.py +19 -15
- gcore/resources/cloud/baremetal/servers.py +141 -119
- gcore/resources/cloud/billing_reservations.py +41 -33
- gcore/resources/cloud/cloud.py +24 -0
- gcore/resources/cloud/cost_reports.py +149 -119
- gcore/resources/cloud/file_shares/access_rules.py +25 -13
- gcore/resources/cloud/file_shares/file_shares.py +107 -71
- gcore/resources/cloud/floating_ips.py +101 -59
- gcore/resources/cloud/gpu_baremetal_clusters/flavors.py +13 -9
- gcore/resources/cloud/gpu_baremetal_clusters/gpu_baremetal_clusters.py +275 -65
- gcore/resources/cloud/gpu_baremetal_clusters/images.py +69 -53
- gcore/resources/cloud/gpu_baremetal_clusters/interfaces.py +9 -5
- gcore/resources/cloud/gpu_baremetal_clusters/servers.py +151 -127
- gcore/resources/cloud/inference/api_keys.py +51 -31
- gcore/resources/cloud/inference/applications/deployments.py +49 -31
- gcore/resources/cloud/inference/applications/templates.py +17 -9
- gcore/resources/cloud/inference/deployments/deployments.py +171 -139
- gcore/resources/cloud/inference/deployments/logs.py +17 -13
- gcore/resources/cloud/inference/flavors.py +21 -13
- gcore/resources/cloud/inference/inference.py +9 -5
- gcore/resources/cloud/inference/registry_credentials.py +45 -25
- gcore/resources/cloud/inference/secrets.py +45 -25
- gcore/resources/cloud/instances/flavors.py +17 -13
- gcore/resources/cloud/instances/images.py +153 -129
- gcore/resources/cloud/instances/instances.py +287 -213
- gcore/resources/cloud/instances/interfaces.py +165 -161
- gcore/resources/cloud/instances/metrics.py +9 -5
- gcore/resources/cloud/ip_ranges.py +25 -15
- gcore/resources/cloud/k8s/clusters/clusters.py +151 -87
- gcore/resources/cloud/k8s/clusters/nodes.py +19 -11
- gcore/resources/cloud/k8s/clusters/pools/nodes.py +19 -11
- gcore/resources/cloud/k8s/clusters/pools/pools.py +83 -59
- gcore/resources/cloud/k8s/flavors.py +13 -9
- gcore/resources/cloud/k8s/k8s.py +9 -5
- gcore/resources/cloud/load_balancers/flavors.py +11 -7
- gcore/resources/cloud/load_balancers/l7_policies/l7_policies.py +103 -83
- gcore/resources/cloud/load_balancers/l7_policies/rules.py +77 -57
- gcore/resources/cloud/load_balancers/listeners.py +125 -105
- gcore/resources/cloud/load_balancers/load_balancers.py +155 -123
- gcore/resources/cloud/load_balancers/metrics.py +9 -5
- gcore/resources/cloud/load_balancers/pools/health_monitors.py +25 -17
- gcore/resources/cloud/load_balancers/pools/members.py +31 -23
- gcore/resources/cloud/load_balancers/pools/pools.py +155 -129
- gcore/resources/cloud/load_balancers/statuses.py +17 -9
- gcore/resources/cloud/networks/networks.py +79 -55
- gcore/resources/cloud/networks/routers.py +75 -47
- gcore/resources/cloud/networks/subnets.py +105 -81
- gcore/resources/cloud/placement_groups.py +33 -17
- gcore/resources/cloud/projects.py +53 -41
- gcore/resources/cloud/quotas/quotas.py +25 -13
- gcore/resources/cloud/quotas/requests.py +41 -25
- gcore/resources/cloud/regions.py +25 -23
- gcore/resources/cloud/registries/artifacts.py +17 -9
- gcore/resources/cloud/registries/registries.py +55 -29
- gcore/resources/cloud/registries/repositories.py +17 -9
- gcore/resources/cloud/registries/tags.py +9 -5
- gcore/resources/cloud/registries/users.py +65 -35
- gcore/resources/cloud/reserved_fixed_ips/reserved_fixed_ips.py +123 -107
- gcore/resources/cloud/reserved_fixed_ips/vip.py +45 -25
- gcore/resources/cloud/secrets.py +43 -27
- gcore/resources/cloud/security_groups/rules.py +55 -43
- gcore/resources/cloud/security_groups/security_groups.py +79 -47
- gcore/resources/cloud/ssh_keys.py +51 -31
- gcore/resources/cloud/tasks.py +57 -45
- gcore/resources/cloud/usage_reports.py +27 -23
- gcore/resources/cloud/users/role_assignments.py +49 -33
- gcore/resources/cloud/volumes.py +237 -201
- gcore/resources/dns/dns.py +17 -13
- gcore/resources/dns/locations.py +29 -17
- gcore/resources/dns/metrics.py +13 -9
- gcore/resources/dns/pickers/pickers.py +5 -5
- gcore/resources/dns/pickers/presets.py +9 -5
- gcore/resources/dns/zones/dnssec.py +19 -11
- gcore/resources/dns/zones/rrsets.py +149 -91
- gcore/resources/dns/zones/zones.py +245 -187
- gcore/resources/fastedge/apps/apps.py +105 -89
- gcore/resources/fastedge/apps/logs.py +25 -21
- gcore/resources/fastedge/binaries.py +33 -17
- gcore/resources/fastedge/fastedge.py +5 -5
- gcore/resources/fastedge/kv_stores.py +43 -31
- gcore/resources/fastedge/secrets.py +69 -45
- gcore/resources/fastedge/statistics.py +25 -17
- gcore/resources/fastedge/templates.py +59 -39
- gcore/resources/iam/api_tokens.py +43 -27
- gcore/resources/iam/iam.py +5 -5
- gcore/resources/iam/users.py +97 -65
- gcore/resources/security/bgp_announces.py +27 -19
- gcore/resources/security/events.py +23 -19
- gcore/resources/security/profile_templates.py +9 -5
- gcore/resources/security/profiles.py +69 -45
- gcore/resources/storage/buckets/buckets.py +37 -25
- gcore/resources/storage/buckets/cors.py +19 -11
- gcore/resources/storage/buckets/lifecycle.py +19 -11
- gcore/resources/storage/buckets/policy.py +25 -13
- gcore/resources/storage/credentials.py +19 -15
- gcore/resources/storage/locations.py +13 -9
- gcore/resources/storage/statistics.py +39 -31
- gcore/resources/storage/storage.py +105 -69
- gcore/resources/streaming/ai_tasks.py +307 -197
- gcore/resources/streaming/broadcasts.py +63 -35
- gcore/resources/streaming/directories.py +65 -39
- gcore/resources/streaming/players.py +47 -31
- gcore/resources/streaming/playlists.py +189 -123
- gcore/resources/streaming/quality_sets.py +69 -39
- gcore/resources/streaming/restreams.py +47 -27
- gcore/resources/streaming/statistics.py +613 -407
- gcore/resources/streaming/streams/overlays.py +107 -67
- gcore/resources/streaming/streams/streams.py +403 -263
- gcore/resources/streaming/videos/subtitles.py +131 -75
- gcore/resources/streaming/videos/videos.py +429 -279
- gcore/resources/waap/advanced_rules.py +9 -5
- gcore/resources/waap/custom_page_sets.py +99 -75
- gcore/resources/waap/domains/advanced_rules.py +157 -99
- gcore/resources/waap/domains/api_discovery.py +71 -47
- gcore/resources/waap/domains/api_path_groups.py +9 -5
- gcore/resources/waap/domains/api_paths.py +79 -83
- gcore/resources/waap/domains/custom_rules.py +89 -59
- gcore/resources/waap/domains/domains.py +59 -41
- gcore/resources/waap/domains/firewall_rules.py +83 -55
- gcore/resources/waap/domains/insight_silences.py +59 -39
- gcore/resources/waap/domains/insights.py +39 -27
- gcore/resources/waap/domains/settings.py +21 -13
- gcore/resources/waap/domains/statistics.py +99 -75
- gcore/resources/waap/insights.py +23 -21
- gcore/resources/waap/ip_info/ip_info.py +65 -33
- gcore/resources/waap/ip_info/metrics.py +11 -7
- gcore/resources/waap/organizations.py +17 -13
- gcore/resources/waap/statistics.py +9 -5
- gcore/resources/waap/tags.py +17 -17
- gcore/resources/waap/waap.py +5 -5
- gcore/types/cdn/__init__.py +80 -0
- gcore/types/cdn/audit_log_list_params.py +73 -0
- gcore/types/cdn/ca_certificate.py +53 -0
- gcore/types/cdn/ca_certificate_list.py +10 -0
- gcore/types/cdn/cdn_account.py +86 -0
- gcore/types/cdn/cdn_account_limits.py +27 -0
- gcore/types/cdn/cdn_audit_log_entry.py +66 -0
- gcore/types/cdn/cdn_available_features.py +46 -0
- gcore/types/cdn/cdn_list_purge_statuses_params.py +67 -0
- gcore/types/cdn/cdn_log_entry.py +70 -0
- gcore/types/cdn/cdn_metrics.py +22 -0
- gcore/types/cdn/cdn_metrics_groups.py +13 -0
- gcore/types/cdn/cdn_metrics_values.py +19 -0
- gcore/types/cdn/cdn_resource.py +1977 -0
- gcore/types/cdn/cdn_resource_list.py +10 -0
- gcore/types/cdn/cdn_update_account_params.py +15 -0
- gcore/types/cdn/certificate_create_params.py +51 -0
- gcore/types/cdn/certificate_get_status_params.py +14 -0
- gcore/types/cdn/certificate_list_params.py +29 -0
- gcore/types/cdn/certificate_replace_params.py +39 -0
- gcore/types/cdn/log_download_params.py +279 -0
- gcore/types/cdn/log_list_params.py +273 -0
- gcore/types/cdn/logs/__init__.py +7 -0
- gcore/types/cdn/logs/log_settings.py +172 -0
- gcore/types/cdn/logs/setting_create_params.py +200 -0
- gcore/types/cdn/logs/setting_update_params.py +200 -0
- gcore/types/cdn/logs_aggregated_stats.py +23 -0
- gcore/types/cdn/logs_uploader/__init__.py +23 -0
- gcore/types/cdn/logs_uploader/config_create_params.py +32 -0
- gcore/types/cdn/logs_uploader/config_list_params.py +16 -0
- gcore/types/cdn/logs_uploader/config_replace_params.py +32 -0
- gcore/types/cdn/logs_uploader/config_update_params.py +32 -0
- gcore/types/cdn/logs_uploader/logs_uploader_config.py +51 -0
- gcore/types/cdn/logs_uploader/logs_uploader_config_list.py +10 -0
- gcore/types/cdn/logs_uploader/logs_uploader_policy.py +73 -0
- gcore/types/cdn/logs_uploader/logs_uploader_policy_list.py +10 -0
- gcore/types/cdn/logs_uploader/logs_uploader_target.py +236 -0
- gcore/types/cdn/logs_uploader/logs_uploader_target_list.py +10 -0
- gcore/types/cdn/logs_uploader/policy_create_params.py +61 -0
- gcore/types/cdn/logs_uploader/policy_list_fields_response.py +8 -0
- gcore/types/cdn/logs_uploader/policy_list_params.py +16 -0
- gcore/types/cdn/logs_uploader/policy_replace_params.py +61 -0
- gcore/types/cdn/logs_uploader/policy_update_params.py +61 -0
- gcore/types/cdn/logs_uploader/target_create_params.py +249 -0
- gcore/types/cdn/logs_uploader/target_list_params.py +16 -0
- gcore/types/cdn/logs_uploader/target_replace_params.py +249 -0
- gcore/types/cdn/logs_uploader/target_update_params.py +249 -0
- gcore/types/cdn/logs_uploader_validation.py +23 -0
- gcore/types/cdn/metric_list_params.py +168 -0
- gcore/types/cdn/network_capacity.py +22 -0
- gcore/types/cdn/origin_group_create_params.py +184 -0
- gcore/types/cdn/origin_group_list_params.py +24 -0
- gcore/types/cdn/origin_group_replace_params.py +190 -0
- gcore/types/cdn/origin_group_update_params.py +190 -0
- gcore/types/cdn/origin_groups.py +212 -0
- gcore/types/cdn/origin_groups_list.py +10 -0
- gcore/types/cdn/public_ip_list.py +15 -0
- gcore/types/cdn/public_network_list.py +15 -0
- gcore/types/cdn/purge_status.py +55 -0
- gcore/types/cdn/resource_aggregated_stats.py +80 -0
- gcore/types/cdn/resource_create_params.py +1825 -0
- gcore/types/cdn/resource_list_params.py +107 -0
- gcore/types/cdn/resource_prefetch_params.py +17 -0
- gcore/types/cdn/resource_purge_params.py +71 -0
- gcore/types/cdn/resource_replace_params.py +1803 -0
- gcore/types/cdn/resource_update_params.py +1794 -0
- gcore/types/cdn/resource_usage_stats.py +111 -0
- gcore/types/cdn/resources/__init__.py +11 -0
- gcore/types/cdn/resources/cdn_resource_rule.py +1695 -0
- gcore/types/cdn/resources/origin_shielding.py +15 -0
- gcore/types/cdn/resources/rule_create_params.py +1652 -0
- gcore/types/cdn/resources/rule_list_response.py +10 -0
- gcore/types/cdn/resources/rule_replace_params.py +1654 -0
- gcore/types/cdn/resources/rule_update_params.py +1654 -0
- gcore/types/cdn/resources/shield_replace_params.py +16 -0
- gcore/types/cdn/rule_template.py +1666 -0
- gcore/types/cdn/rule_template_create_params.py +1636 -0
- gcore/types/cdn/rule_template_list.py +10 -0
- gcore/types/cdn/rule_template_replace_params.py +1636 -0
- gcore/types/cdn/rule_template_update_params.py +1636 -0
- gcore/types/cdn/shield_aggregated_stats.py +23 -0
- gcore/types/cdn/shield_list_response.py +25 -0
- gcore/types/cdn/ssl_detail.py +62 -0
- gcore/types/cdn/ssl_detail_list.py +10 -0
- gcore/types/cdn/ssl_request_status.py +135 -0
- gcore/types/cdn/statistic_get_logs_usage_aggregated_params.py +42 -0
- gcore/types/cdn/statistic_get_logs_usage_series_params.py +35 -0
- gcore/types/cdn/statistic_get_resource_usage_aggregated_params.py +151 -0
- gcore/types/cdn/statistic_get_resource_usage_series_params.py +131 -0
- gcore/types/cdn/statistic_get_shield_usage_aggregated_params.py +42 -0
- gcore/types/cdn/statistic_get_shield_usage_series_params.py +25 -0
- gcore/types/cdn/trusted_ca_certificate_create_params.py +23 -0
- gcore/types/cdn/trusted_ca_certificate_list_params.py +29 -0
- gcore/types/cdn/trusted_ca_certificate_replace_params.py +15 -0
- gcore/types/cdn/usage_series_stats.py +31 -0
- gcore/types/cloud/__init__.py +1 -0
- gcore/types/cloud/file_share.py +4 -0
- gcore/types/cloud/file_share_create_params.py +20 -0
- gcore/types/cloud/file_share_update_params.py +40 -3
- gcore/types/cloud/floating_ip_update_params.py +3 -1
- gcore/types/cloud/gpu_baremetal_cluster_action_params.py +46 -0
- gcore/types/cloud/inference/inference_deployment.py +3 -1
- gcore/types/cloud/instance_create_params.py +3 -1
- gcore/types/cloud/k8s/cluster_create_params.py +46 -4
- gcore/types/cloud/k8s/cluster_update_params.py +60 -6
- gcore/types/cloud/k8s/clusters/pool_update_params.py +1 -1
- gcore/types/cloud/k8s/k8s_cluster.py +40 -3
- gcore/types/cloud/load_balancer_update_params.py +3 -1
- gcore/types/cloud/network_update_params.py +3 -1
- gcore/types/cloud/networks/subnet_update_params.py +3 -1
- gcore/types/cloud/registries/user_create_multiple_params.py +5 -3
- gcore/types/cloud/registries/user_create_params.py +5 -3
- gcore/types/cloud/registry_create_params.py +5 -3
- gcore/types/cloud/security_group_update_params.py +3 -1
- gcore/types/cloud/ssh_key_created.py +6 -3
- gcore/types/cloud/volume_update_params.py +3 -1
- gcore/types/dns/zone_get_statistics_params.py +12 -9
- gcore/types/dns/zone_get_statistics_response.py +3 -1
- gcore/types/dns/zone_import_params.py +21 -15
- gcore/types/dns/zones/dns_output_rrset.py +7 -3
- gcore/types/iam/account_overview.py +7 -2
- gcore/types/iam/user.py +7 -2
- gcore/types/iam/user_detailed.py +7 -2
- gcore/types/iam/user_invite_params.py +4 -1
- gcore/types/iam/user_update.py +7 -2
- gcore/types/iam/user_update_params.py +7 -2
- gcore/types/streaming/ai_contentmoderation_hardnudity.py +6 -4
- gcore/types/streaming/ai_contentmoderation_nsfw.py +6 -4
- gcore/types/streaming/ai_contentmoderation_softnudity.py +6 -4
- gcore/types/streaming/ai_contentmoderation_sport.py +6 -4
- gcore/types/streaming/ai_task.py +20 -11
- gcore/types/streaming/ai_task_create_params.py +20 -11
- gcore/types/streaming/ai_task_get_response.py +5 -4
- gcore/types/streaming/ai_task_list_params.py +11 -5
- gcore/types/streaming/clip.py +33 -22
- gcore/types/streaming/create_video_param.py +75 -43
- gcore/types/streaming/playlist.py +7 -5
- gcore/types/streaming/playlist_create_params.py +7 -5
- gcore/types/streaming/playlist_update_params.py +7 -5
- gcore/types/streaming/playlist_video.py +75 -43
- gcore/types/streaming/statistic_get_unique_viewers_cdn_params.py +7 -4
- gcore/types/streaming/stream.py +207 -136
- gcore/types/streaming/stream_create_clip_params.py +33 -22
- gcore/types/streaming/stream_create_params.py +41 -24
- gcore/types/streaming/stream_update_params.py +41 -24
- gcore/types/streaming/video.py +138 -76
- gcore/types/streaming/video_list_params.py +4 -2
- gcore/types/streaming/video_update_params.py +75 -43
- gcore/types/waap/domain_update_params.py +2 -2
- gcore/types/waap/domains/advanced_rule_create_params.py +26 -18
- gcore/types/waap/domains/advanced_rule_list_params.py +10 -7
- gcore/types/waap/domains/advanced_rule_update_params.py +22 -17
- gcore/types/waap/domains/api_path_create_params.py +0 -3
- gcore/types/waap/domains/api_path_update_params.py +1 -3
- gcore/types/waap/domains/custom_rule_create_params.py +36 -35
- gcore/types/waap/domains/custom_rule_update_params.py +31 -33
- gcore/types/waap/domains/firewall_rule_create_params.py +6 -6
- gcore/types/waap/domains/firewall_rule_update_params.py +5 -5
- gcore/types/waap/domains/waap_advanced_rule.py +17 -9
- gcore/types/waap/domains/waap_custom_rule.py +5 -2
- gcore/types/waap/domains/waap_firewall_rule.py +1 -1
- gcore/types/waap/domains/waap_insight.py +1 -1
- gcore/types/waap/insight_list_types_params.py +1 -1
- {gcore-0.13.0.dist-info → gcore-0.14.0.dist-info}/METADATA +1 -1
- {gcore-0.13.0.dist-info → gcore-0.14.0.dist-info}/RECORD +334 -214
- {gcore-0.13.0.dist-info → gcore-0.14.0.dist-info}/WHEEL +0 -0
- {gcore-0.13.0.dist-info → gcore-0.14.0.dist-info}/licenses/LICENSE +0 -0
gcore/resources/cloud/volumes.py
CHANGED
|
@@ -7,7 +7,7 @@ from typing_extensions import Literal, overload
|
|
|
7
7
|
|
|
8
8
|
import httpx
|
|
9
9
|
|
|
10
|
-
from ..._types import NOT_GIVEN, Body, Query, Headers, NoneType, NotGiven, SequenceNotStr
|
|
10
|
+
from ..._types import NOT_GIVEN, Body, Omit, Query, Headers, NoneType, NotGiven, SequenceNotStr, omit, not_given
|
|
11
11
|
from ..._utils import required_args, maybe_transform, async_maybe_transform
|
|
12
12
|
from ..._compat import cached_property
|
|
13
13
|
from ..._resource import SyncAPIResource, AsyncAPIResource
|
|
@@ -66,18 +66,17 @@ class VolumesResource(SyncAPIResource):
|
|
|
66
66
|
name: str,
|
|
67
67
|
size: int,
|
|
68
68
|
source: Literal["image"],
|
|
69
|
-
attachment_tag: str |
|
|
70
|
-
instance_id_to_attach_to: str |
|
|
71
|
-
lifecycle_policy_ids: Iterable[int] |
|
|
72
|
-
tags: TagUpdateMapParam |
|
|
73
|
-
type_name: Literal["cold", "ssd_hiiops", "ssd_local", "ssd_lowlatency", "standard", "ultra"]
|
|
74
|
-
| NotGiven = NOT_GIVEN,
|
|
69
|
+
attachment_tag: str | Omit = omit,
|
|
70
|
+
instance_id_to_attach_to: str | Omit = omit,
|
|
71
|
+
lifecycle_policy_ids: Iterable[int] | Omit = omit,
|
|
72
|
+
tags: TagUpdateMapParam | Omit = omit,
|
|
73
|
+
type_name: Literal["cold", "ssd_hiiops", "ssd_local", "ssd_lowlatency", "standard", "ultra"] | Omit = omit,
|
|
75
74
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
76
75
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
77
76
|
extra_headers: Headers | None = None,
|
|
78
77
|
extra_query: Query | None = None,
|
|
79
78
|
extra_body: Body | None = None,
|
|
80
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
79
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
81
80
|
) -> TaskIDList:
|
|
82
81
|
"""Create a new volume in the project and region.
|
|
83
82
|
|
|
@@ -134,19 +133,18 @@ class VolumesResource(SyncAPIResource):
|
|
|
134
133
|
name: str,
|
|
135
134
|
snapshot_id: str,
|
|
136
135
|
source: Literal["snapshot"],
|
|
137
|
-
attachment_tag: str |
|
|
138
|
-
instance_id_to_attach_to: str |
|
|
139
|
-
lifecycle_policy_ids: Iterable[int] |
|
|
140
|
-
size: int |
|
|
141
|
-
tags: TagUpdateMapParam |
|
|
142
|
-
type_name: Literal["cold", "ssd_hiiops", "ssd_local", "ssd_lowlatency", "standard", "ultra"]
|
|
143
|
-
| NotGiven = NOT_GIVEN,
|
|
136
|
+
attachment_tag: str | Omit = omit,
|
|
137
|
+
instance_id_to_attach_to: str | Omit = omit,
|
|
138
|
+
lifecycle_policy_ids: Iterable[int] | Omit = omit,
|
|
139
|
+
size: int | Omit = omit,
|
|
140
|
+
tags: TagUpdateMapParam | Omit = omit,
|
|
141
|
+
type_name: Literal["cold", "ssd_hiiops", "ssd_local", "ssd_lowlatency", "standard", "ultra"] | Omit = omit,
|
|
144
142
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
145
143
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
146
144
|
extra_headers: Headers | None = None,
|
|
147
145
|
extra_query: Query | None = None,
|
|
148
146
|
extra_body: Body | None = None,
|
|
149
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
147
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
150
148
|
) -> TaskIDList:
|
|
151
149
|
"""Create a new volume in the project and region.
|
|
152
150
|
|
|
@@ -204,18 +202,17 @@ class VolumesResource(SyncAPIResource):
|
|
|
204
202
|
name: str,
|
|
205
203
|
size: int,
|
|
206
204
|
source: Literal["new-volume"],
|
|
207
|
-
attachment_tag: str |
|
|
208
|
-
instance_id_to_attach_to: str |
|
|
209
|
-
lifecycle_policy_ids: Iterable[int] |
|
|
210
|
-
tags: TagUpdateMapParam |
|
|
211
|
-
type_name: Literal["cold", "ssd_hiiops", "ssd_local", "ssd_lowlatency", "standard", "ultra"]
|
|
212
|
-
| NotGiven = NOT_GIVEN,
|
|
205
|
+
attachment_tag: str | Omit = omit,
|
|
206
|
+
instance_id_to_attach_to: str | Omit = omit,
|
|
207
|
+
lifecycle_policy_ids: Iterable[int] | Omit = omit,
|
|
208
|
+
tags: TagUpdateMapParam | Omit = omit,
|
|
209
|
+
type_name: Literal["cold", "ssd_hiiops", "ssd_local", "ssd_lowlatency", "standard", "ultra"] | Omit = omit,
|
|
213
210
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
214
211
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
215
212
|
extra_headers: Headers | None = None,
|
|
216
213
|
extra_query: Query | None = None,
|
|
217
214
|
extra_body: Body | None = None,
|
|
218
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
215
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
219
216
|
) -> TaskIDList:
|
|
220
217
|
"""Create a new volume in the project and region.
|
|
221
218
|
|
|
@@ -269,30 +266,31 @@ class VolumesResource(SyncAPIResource):
|
|
|
269
266
|
*,
|
|
270
267
|
project_id: int | None = None,
|
|
271
268
|
region_id: int | None = None,
|
|
272
|
-
image_id: str |
|
|
269
|
+
image_id: str | Omit = omit,
|
|
273
270
|
name: str,
|
|
274
|
-
size: int |
|
|
271
|
+
size: int | Omit = omit,
|
|
275
272
|
source: Literal["image"] | Literal["snapshot"] | Literal["new-volume"],
|
|
276
|
-
attachment_tag: str |
|
|
277
|
-
instance_id_to_attach_to: str |
|
|
278
|
-
lifecycle_policy_ids: Iterable[int] |
|
|
279
|
-
tags: TagUpdateMapParam |
|
|
280
|
-
type_name: Literal["cold", "ssd_hiiops", "ssd_local", "ssd_lowlatency", "standard", "ultra"]
|
|
281
|
-
|
|
|
282
|
-
snapshot_id: str | NotGiven = NOT_GIVEN,
|
|
273
|
+
attachment_tag: str | Omit = omit,
|
|
274
|
+
instance_id_to_attach_to: str | Omit = omit,
|
|
275
|
+
lifecycle_policy_ids: Iterable[int] | Omit = omit,
|
|
276
|
+
tags: TagUpdateMapParam | Omit = omit,
|
|
277
|
+
type_name: Literal["cold", "ssd_hiiops", "ssd_local", "ssd_lowlatency", "standard", "ultra"] | Omit = omit,
|
|
278
|
+
snapshot_id: str | Omit = omit,
|
|
283
279
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
284
280
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
285
281
|
extra_headers: Headers | None = None,
|
|
286
282
|
extra_query: Query | None = None,
|
|
287
283
|
extra_body: Body | None = None,
|
|
288
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
284
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
289
285
|
) -> TaskIDList:
|
|
290
286
|
if project_id is None:
|
|
291
287
|
project_id = self._client._get_cloud_project_id_path_param()
|
|
292
288
|
if region_id is None:
|
|
293
289
|
region_id = self._client._get_cloud_region_id_path_param()
|
|
294
290
|
return self._post(
|
|
295
|
-
f"/cloud/v1/volumes/{project_id}/{region_id}"
|
|
291
|
+
f"/cloud/v1/volumes/{project_id}/{region_id}"
|
|
292
|
+
if self._client._base_url_overridden
|
|
293
|
+
else f"https://api.gcore.com//cloud/v1/volumes/{project_id}/{region_id}",
|
|
296
294
|
body=maybe_transform(
|
|
297
295
|
{
|
|
298
296
|
"image_id": image_id,
|
|
@@ -320,14 +318,14 @@ class VolumesResource(SyncAPIResource):
|
|
|
320
318
|
*,
|
|
321
319
|
project_id: int | None = None,
|
|
322
320
|
region_id: int | None = None,
|
|
323
|
-
name: str |
|
|
324
|
-
tags: Optional[TagUpdateMapParam] |
|
|
321
|
+
name: str | Omit = omit,
|
|
322
|
+
tags: Optional[TagUpdateMapParam] | Omit = omit,
|
|
325
323
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
326
324
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
327
325
|
extra_headers: Headers | None = None,
|
|
328
326
|
extra_query: Query | None = None,
|
|
329
327
|
extra_body: Body | None = None,
|
|
330
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
328
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
331
329
|
) -> Volume:
|
|
332
330
|
"""
|
|
333
331
|
Rename a volume or update tags
|
|
@@ -344,7 +342,9 @@ class VolumesResource(SyncAPIResource):
|
|
|
344
342
|
tags: Update key-value tags using JSON Merge Patch semantics (RFC 7386). Provide
|
|
345
343
|
key-value pairs to add or update tags. Set tag values to `null` to remove tags.
|
|
346
344
|
Unspecified tags remain unchanged. Read-only tags are always preserved and
|
|
347
|
-
cannot be modified.
|
|
345
|
+
cannot be modified.
|
|
346
|
+
|
|
347
|
+
**Examples:**
|
|
348
348
|
|
|
349
349
|
- **Add/update tags:**
|
|
350
350
|
`{'tags': {'environment': 'production', 'team': 'backend'}}` adds new tags or
|
|
@@ -376,7 +376,9 @@ class VolumesResource(SyncAPIResource):
|
|
|
376
376
|
if not volume_id:
|
|
377
377
|
raise ValueError(f"Expected a non-empty value for `volume_id` but received {volume_id!r}")
|
|
378
378
|
return self._patch(
|
|
379
|
-
f"/cloud/v1/volumes/{project_id}/{region_id}/{volume_id}"
|
|
379
|
+
f"/cloud/v1/volumes/{project_id}/{region_id}/{volume_id}"
|
|
380
|
+
if self._client._base_url_overridden
|
|
381
|
+
else f"https://api.gcore.com//cloud/v1/volumes/{project_id}/{region_id}/{volume_id}",
|
|
380
382
|
body=maybe_transform(
|
|
381
383
|
{
|
|
382
384
|
"name": name,
|
|
@@ -395,22 +397,22 @@ class VolumesResource(SyncAPIResource):
|
|
|
395
397
|
*,
|
|
396
398
|
project_id: int | None = None,
|
|
397
399
|
region_id: int | None = None,
|
|
398
|
-
bootable: bool |
|
|
399
|
-
cluster_id: str |
|
|
400
|
-
has_attachments: bool |
|
|
401
|
-
id_part: str |
|
|
402
|
-
instance_id: str |
|
|
403
|
-
limit: int |
|
|
404
|
-
name_part: str |
|
|
405
|
-
offset: int |
|
|
406
|
-
tag_key: SequenceNotStr[str] |
|
|
407
|
-
tag_key_value: str |
|
|
400
|
+
bootable: bool | Omit = omit,
|
|
401
|
+
cluster_id: str | Omit = omit,
|
|
402
|
+
has_attachments: bool | Omit = omit,
|
|
403
|
+
id_part: str | Omit = omit,
|
|
404
|
+
instance_id: str | Omit = omit,
|
|
405
|
+
limit: int | Omit = omit,
|
|
406
|
+
name_part: str | Omit = omit,
|
|
407
|
+
offset: int | Omit = omit,
|
|
408
|
+
tag_key: SequenceNotStr[str] | Omit = omit,
|
|
409
|
+
tag_key_value: str | Omit = omit,
|
|
408
410
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
409
411
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
410
412
|
extra_headers: Headers | None = None,
|
|
411
413
|
extra_query: Query | None = None,
|
|
412
414
|
extra_body: Body | None = None,
|
|
413
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
415
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
414
416
|
) -> SyncOffsetPage[Volume]:
|
|
415
417
|
"""Retrieve a list of volumes in the project and region.
|
|
416
418
|
|
|
@@ -458,7 +460,9 @@ class VolumesResource(SyncAPIResource):
|
|
|
458
460
|
if region_id is None:
|
|
459
461
|
region_id = self._client._get_cloud_region_id_path_param()
|
|
460
462
|
return self._get_api_list(
|
|
461
|
-
f"/cloud/v1/volumes/{project_id}/{region_id}"
|
|
463
|
+
f"/cloud/v1/volumes/{project_id}/{region_id}"
|
|
464
|
+
if self._client._base_url_overridden
|
|
465
|
+
else f"https://api.gcore.com//cloud/v1/volumes/{project_id}/{region_id}",
|
|
462
466
|
page=SyncOffsetPage[Volume],
|
|
463
467
|
options=make_request_options(
|
|
464
468
|
extra_headers=extra_headers,
|
|
@@ -490,13 +494,13 @@ class VolumesResource(SyncAPIResource):
|
|
|
490
494
|
*,
|
|
491
495
|
project_id: int | None = None,
|
|
492
496
|
region_id: int | None = None,
|
|
493
|
-
snapshots: str |
|
|
497
|
+
snapshots: str | Omit = omit,
|
|
494
498
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
495
499
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
496
500
|
extra_headers: Headers | None = None,
|
|
497
501
|
extra_query: Query | None = None,
|
|
498
502
|
extra_body: Body | None = None,
|
|
499
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
503
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
500
504
|
) -> TaskIDList:
|
|
501
505
|
"""Delete a volume and all its snapshots.
|
|
502
506
|
|
|
@@ -527,7 +531,9 @@ class VolumesResource(SyncAPIResource):
|
|
|
527
531
|
if not volume_id:
|
|
528
532
|
raise ValueError(f"Expected a non-empty value for `volume_id` but received {volume_id!r}")
|
|
529
533
|
return self._delete(
|
|
530
|
-
f"/cloud/v1/volumes/{project_id}/{region_id}/{volume_id}"
|
|
534
|
+
f"/cloud/v1/volumes/{project_id}/{region_id}/{volume_id}"
|
|
535
|
+
if self._client._base_url_overridden
|
|
536
|
+
else f"https://api.gcore.com//cloud/v1/volumes/{project_id}/{region_id}/{volume_id}",
|
|
531
537
|
options=make_request_options(
|
|
532
538
|
extra_headers=extra_headers,
|
|
533
539
|
extra_query=extra_query,
|
|
@@ -545,13 +551,13 @@ class VolumesResource(SyncAPIResource):
|
|
|
545
551
|
project_id: int | None = None,
|
|
546
552
|
region_id: int | None = None,
|
|
547
553
|
instance_id: str,
|
|
548
|
-
attachment_tag: str |
|
|
554
|
+
attachment_tag: str | Omit = omit,
|
|
549
555
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
550
556
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
551
557
|
extra_headers: Headers | None = None,
|
|
552
558
|
extra_query: Query | None = None,
|
|
553
559
|
extra_body: Body | None = None,
|
|
554
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
560
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
555
561
|
) -> TaskIDList:
|
|
556
562
|
"""Attach the volume to instance.
|
|
557
563
|
|
|
@@ -584,7 +590,9 @@ class VolumesResource(SyncAPIResource):
|
|
|
584
590
|
if not volume_id:
|
|
585
591
|
raise ValueError(f"Expected a non-empty value for `volume_id` but received {volume_id!r}")
|
|
586
592
|
return self._post(
|
|
587
|
-
f"/cloud/v2/volumes/{project_id}/{region_id}/{volume_id}/attach"
|
|
593
|
+
f"/cloud/v2/volumes/{project_id}/{region_id}/{volume_id}/attach"
|
|
594
|
+
if self._client._base_url_overridden
|
|
595
|
+
else f"https://api.gcore.com//cloud/v2/volumes/{project_id}/{region_id}/{volume_id}/attach",
|
|
588
596
|
body=maybe_transform(
|
|
589
597
|
{
|
|
590
598
|
"instance_id": instance_id,
|
|
@@ -610,7 +618,7 @@ class VolumesResource(SyncAPIResource):
|
|
|
610
618
|
extra_headers: Headers | None = None,
|
|
611
619
|
extra_query: Query | None = None,
|
|
612
620
|
extra_body: Body | None = None,
|
|
613
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
621
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
614
622
|
) -> Volume:
|
|
615
623
|
"""Change the type of a volume.
|
|
616
624
|
|
|
@@ -641,7 +649,9 @@ class VolumesResource(SyncAPIResource):
|
|
|
641
649
|
if not volume_id:
|
|
642
650
|
raise ValueError(f"Expected a non-empty value for `volume_id` but received {volume_id!r}")
|
|
643
651
|
return self._post(
|
|
644
|
-
f"/cloud/v1/volumes/{project_id}/{region_id}/{volume_id}/retype"
|
|
652
|
+
f"/cloud/v1/volumes/{project_id}/{region_id}/{volume_id}/retype"
|
|
653
|
+
if self._client._base_url_overridden
|
|
654
|
+
else f"https://api.gcore.com//cloud/v1/volumes/{project_id}/{region_id}/{volume_id}/retype",
|
|
645
655
|
body=maybe_transform({"volume_type": volume_type}, volume_change_type_params.VolumeChangeTypeParams),
|
|
646
656
|
options=make_request_options(
|
|
647
657
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
@@ -661,7 +671,7 @@ class VolumesResource(SyncAPIResource):
|
|
|
661
671
|
extra_headers: Headers | None = None,
|
|
662
672
|
extra_query: Query | None = None,
|
|
663
673
|
extra_body: Body | None = None,
|
|
664
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
674
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
665
675
|
) -> TaskIDList:
|
|
666
676
|
"""
|
|
667
677
|
Detach the volume from instance
|
|
@@ -690,7 +700,9 @@ class VolumesResource(SyncAPIResource):
|
|
|
690
700
|
if not volume_id:
|
|
691
701
|
raise ValueError(f"Expected a non-empty value for `volume_id` but received {volume_id!r}")
|
|
692
702
|
return self._post(
|
|
693
|
-
f"/cloud/v2/volumes/{project_id}/{region_id}/{volume_id}/detach"
|
|
703
|
+
f"/cloud/v2/volumes/{project_id}/{region_id}/{volume_id}/detach"
|
|
704
|
+
if self._client._base_url_overridden
|
|
705
|
+
else f"https://api.gcore.com//cloud/v2/volumes/{project_id}/{region_id}/{volume_id}/detach",
|
|
694
706
|
body=maybe_transform(
|
|
695
707
|
{"instance_id": instance_id}, volume_detach_from_instance_params.VolumeDetachFromInstanceParams
|
|
696
708
|
),
|
|
@@ -711,7 +723,7 @@ class VolumesResource(SyncAPIResource):
|
|
|
711
723
|
extra_headers: Headers | None = None,
|
|
712
724
|
extra_query: Query | None = None,
|
|
713
725
|
extra_body: Body | None = None,
|
|
714
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
726
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
715
727
|
) -> Volume:
|
|
716
728
|
"""
|
|
717
729
|
Retrieve detailed information about a specific volume.
|
|
@@ -738,7 +750,9 @@ class VolumesResource(SyncAPIResource):
|
|
|
738
750
|
if not volume_id:
|
|
739
751
|
raise ValueError(f"Expected a non-empty value for `volume_id` but received {volume_id!r}")
|
|
740
752
|
return self._get(
|
|
741
|
-
f"/cloud/v1/volumes/{project_id}/{region_id}/{volume_id}"
|
|
753
|
+
f"/cloud/v1/volumes/{project_id}/{region_id}/{volume_id}"
|
|
754
|
+
if self._client._base_url_overridden
|
|
755
|
+
else f"https://api.gcore.com//cloud/v1/volumes/{project_id}/{region_id}/{volume_id}",
|
|
742
756
|
options=make_request_options(
|
|
743
757
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
744
758
|
),
|
|
@@ -757,7 +771,7 @@ class VolumesResource(SyncAPIResource):
|
|
|
757
771
|
extra_headers: Headers | None = None,
|
|
758
772
|
extra_query: Query | None = None,
|
|
759
773
|
extra_body: Body | None = None,
|
|
760
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
774
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
761
775
|
) -> TaskIDList:
|
|
762
776
|
"""Increase the size of a volume.
|
|
763
777
|
|
|
@@ -788,7 +802,9 @@ class VolumesResource(SyncAPIResource):
|
|
|
788
802
|
if not volume_id:
|
|
789
803
|
raise ValueError(f"Expected a non-empty value for `volume_id` but received {volume_id!r}")
|
|
790
804
|
return self._post(
|
|
791
|
-
f"/cloud/v1/volumes/{project_id}/{region_id}/{volume_id}/extend"
|
|
805
|
+
f"/cloud/v1/volumes/{project_id}/{region_id}/{volume_id}/extend"
|
|
806
|
+
if self._client._base_url_overridden
|
|
807
|
+
else f"https://api.gcore.com//cloud/v1/volumes/{project_id}/{region_id}/{volume_id}/extend",
|
|
792
808
|
body=maybe_transform({"size": size}, volume_resize_params.VolumeResizeParams),
|
|
793
809
|
options=make_request_options(
|
|
794
810
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
@@ -807,7 +823,7 @@ class VolumesResource(SyncAPIResource):
|
|
|
807
823
|
extra_headers: Headers | None = None,
|
|
808
824
|
extra_query: Query | None = None,
|
|
809
825
|
extra_body: Body | None = None,
|
|
810
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
826
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
811
827
|
) -> None:
|
|
812
828
|
"""Revert a volume to its last snapshot.
|
|
813
829
|
|
|
@@ -837,7 +853,9 @@ class VolumesResource(SyncAPIResource):
|
|
|
837
853
|
raise ValueError(f"Expected a non-empty value for `volume_id` but received {volume_id!r}")
|
|
838
854
|
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
|
839
855
|
return self._post(
|
|
840
|
-
f"/cloud/v1/volumes/{project_id}/{region_id}/{volume_id}/revert"
|
|
856
|
+
f"/cloud/v1/volumes/{project_id}/{region_id}/{volume_id}/revert"
|
|
857
|
+
if self._client._base_url_overridden
|
|
858
|
+
else f"https://api.gcore.com//cloud/v1/volumes/{project_id}/{region_id}/{volume_id}/revert",
|
|
841
859
|
options=make_request_options(
|
|
842
860
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
843
861
|
),
|
|
@@ -854,13 +872,13 @@ class VolumesResource(SyncAPIResource):
|
|
|
854
872
|
name: str,
|
|
855
873
|
size: int,
|
|
856
874
|
source: Literal["image"],
|
|
857
|
-
attachment_tag: str |
|
|
858
|
-
instance_id_to_attach_to: str |
|
|
859
|
-
lifecycle_policy_ids: Iterable[int] |
|
|
860
|
-
tags: TagUpdateMapParam |
|
|
875
|
+
attachment_tag: str | Omit = omit,
|
|
876
|
+
instance_id_to_attach_to: str | Omit = omit,
|
|
877
|
+
lifecycle_policy_ids: Iterable[int] | Omit = omit,
|
|
878
|
+
tags: TagUpdateMapParam | Omit = omit,
|
|
861
879
|
type_name: Literal["cold", "ssd_hiiops", "ssd_local", "ssd_lowlatency", "standard", "ultra"]
|
|
862
|
-
|
|
|
863
|
-
polling_interval_seconds: int |
|
|
880
|
+
| Omit = omit,
|
|
881
|
+
polling_interval_seconds: int | Omit = omit,
|
|
864
882
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
865
883
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
866
884
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
@@ -923,14 +941,14 @@ class VolumesResource(SyncAPIResource):
|
|
|
923
941
|
name: str,
|
|
924
942
|
snapshot_id: str,
|
|
925
943
|
source: Literal["snapshot"],
|
|
926
|
-
attachment_tag: str |
|
|
927
|
-
instance_id_to_attach_to: str |
|
|
928
|
-
lifecycle_policy_ids: Iterable[int] |
|
|
929
|
-
size: int |
|
|
930
|
-
tags: TagUpdateMapParam |
|
|
944
|
+
attachment_tag: str | Omit = omit,
|
|
945
|
+
instance_id_to_attach_to: str | Omit = omit,
|
|
946
|
+
lifecycle_policy_ids: Iterable[int] | Omit = omit,
|
|
947
|
+
size: int | Omit = omit,
|
|
948
|
+
tags: TagUpdateMapParam | Omit = omit,
|
|
931
949
|
type_name: Literal["cold", "ssd_hiiops", "ssd_local", "ssd_lowlatency", "standard", "ultra"]
|
|
932
|
-
|
|
|
933
|
-
polling_interval_seconds: int |
|
|
950
|
+
| Omit = omit,
|
|
951
|
+
polling_interval_seconds: int | Omit = omit,
|
|
934
952
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
935
953
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
936
954
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
@@ -994,13 +1012,13 @@ class VolumesResource(SyncAPIResource):
|
|
|
994
1012
|
name: str,
|
|
995
1013
|
size: int,
|
|
996
1014
|
source: Literal["new-volume"],
|
|
997
|
-
attachment_tag: str |
|
|
998
|
-
instance_id_to_attach_to: str |
|
|
999
|
-
lifecycle_policy_ids: Iterable[int] |
|
|
1000
|
-
tags: TagUpdateMapParam |
|
|
1015
|
+
attachment_tag: str | Omit = omit,
|
|
1016
|
+
instance_id_to_attach_to: str | Omit = omit,
|
|
1017
|
+
lifecycle_policy_ids: Iterable[int] | Omit = omit,
|
|
1018
|
+
tags: TagUpdateMapParam | Omit = omit,
|
|
1001
1019
|
type_name: Literal["cold", "ssd_hiiops", "ssd_local", "ssd_lowlatency", "standard", "ultra"]
|
|
1002
|
-
|
|
|
1003
|
-
polling_interval_seconds: int |
|
|
1020
|
+
| Omit = omit,
|
|
1021
|
+
polling_interval_seconds: int | Omit = omit,
|
|
1004
1022
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
1005
1023
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
1006
1024
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
@@ -1060,18 +1078,18 @@ class VolumesResource(SyncAPIResource):
|
|
|
1060
1078
|
*,
|
|
1061
1079
|
project_id: int | None = None,
|
|
1062
1080
|
region_id: int | None = None,
|
|
1063
|
-
image_id: str |
|
|
1081
|
+
image_id: str | Omit = omit,
|
|
1064
1082
|
name: str,
|
|
1065
|
-
size: int |
|
|
1083
|
+
size: int | Omit = omit,
|
|
1066
1084
|
source: Literal["image"] | Literal["snapshot"] | Literal["new-volume"],
|
|
1067
|
-
attachment_tag: str |
|
|
1068
|
-
instance_id_to_attach_to: str |
|
|
1069
|
-
lifecycle_policy_ids: Iterable[int] |
|
|
1070
|
-
tags: TagUpdateMapParam |
|
|
1085
|
+
attachment_tag: str | Omit = omit,
|
|
1086
|
+
instance_id_to_attach_to: str | Omit = omit,
|
|
1087
|
+
lifecycle_policy_ids: Iterable[int] | Omit = omit,
|
|
1088
|
+
tags: TagUpdateMapParam | Omit = omit,
|
|
1071
1089
|
type_name: Literal["cold", "ssd_hiiops", "ssd_local", "ssd_lowlatency", "standard", "ultra"]
|
|
1072
|
-
|
|
|
1073
|
-
snapshot_id: str |
|
|
1074
|
-
polling_interval_seconds: int |
|
|
1090
|
+
| Omit = omit,
|
|
1091
|
+
snapshot_id: str | Omit = omit,
|
|
1092
|
+
polling_interval_seconds: int | Omit = omit,
|
|
1075
1093
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
1076
1094
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
1077
1095
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
@@ -1124,8 +1142,8 @@ class VolumesResource(SyncAPIResource):
|
|
|
1124
1142
|
*,
|
|
1125
1143
|
project_id: int | None = None,
|
|
1126
1144
|
region_id: int | None = None,
|
|
1127
|
-
snapshots: str |
|
|
1128
|
-
polling_interval_seconds: int |
|
|
1145
|
+
snapshots: str | Omit = omit,
|
|
1146
|
+
polling_interval_seconds: int | Omit = omit,
|
|
1129
1147
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
1130
1148
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
1131
1149
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
@@ -1159,8 +1177,8 @@ class VolumesResource(SyncAPIResource):
|
|
|
1159
1177
|
project_id: int | None = None,
|
|
1160
1178
|
region_id: int | None = None,
|
|
1161
1179
|
instance_id: str,
|
|
1162
|
-
attachment_tag: str |
|
|
1163
|
-
polling_interval_seconds: int |
|
|
1180
|
+
attachment_tag: str | Omit = omit,
|
|
1181
|
+
polling_interval_seconds: int | Omit = omit,
|
|
1164
1182
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
1165
1183
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
1166
1184
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
@@ -1195,7 +1213,7 @@ class VolumesResource(SyncAPIResource):
|
|
|
1195
1213
|
project_id: int | None = None,
|
|
1196
1214
|
region_id: int | None = None,
|
|
1197
1215
|
instance_id: str,
|
|
1198
|
-
polling_interval_seconds: int |
|
|
1216
|
+
polling_interval_seconds: int | Omit = omit,
|
|
1199
1217
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
1200
1218
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
1201
1219
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
@@ -1229,7 +1247,7 @@ class VolumesResource(SyncAPIResource):
|
|
|
1229
1247
|
project_id: int | None = None,
|
|
1230
1248
|
region_id: int | None = None,
|
|
1231
1249
|
size: int,
|
|
1232
|
-
polling_interval_seconds: int |
|
|
1250
|
+
polling_interval_seconds: int | Omit = omit,
|
|
1233
1251
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
1234
1252
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
1235
1253
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
@@ -1296,18 +1314,17 @@ class AsyncVolumesResource(AsyncAPIResource):
|
|
|
1296
1314
|
name: str,
|
|
1297
1315
|
size: int,
|
|
1298
1316
|
source: Literal["image"],
|
|
1299
|
-
attachment_tag: str |
|
|
1300
|
-
instance_id_to_attach_to: str |
|
|
1301
|
-
lifecycle_policy_ids: Iterable[int] |
|
|
1302
|
-
tags: TagUpdateMapParam |
|
|
1303
|
-
type_name: Literal["cold", "ssd_hiiops", "ssd_local", "ssd_lowlatency", "standard", "ultra"]
|
|
1304
|
-
| NotGiven = NOT_GIVEN,
|
|
1317
|
+
attachment_tag: str | Omit = omit,
|
|
1318
|
+
instance_id_to_attach_to: str | Omit = omit,
|
|
1319
|
+
lifecycle_policy_ids: Iterable[int] | Omit = omit,
|
|
1320
|
+
tags: TagUpdateMapParam | Omit = omit,
|
|
1321
|
+
type_name: Literal["cold", "ssd_hiiops", "ssd_local", "ssd_lowlatency", "standard", "ultra"] | Omit = omit,
|
|
1305
1322
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
1306
1323
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
1307
1324
|
extra_headers: Headers | None = None,
|
|
1308
1325
|
extra_query: Query | None = None,
|
|
1309
1326
|
extra_body: Body | None = None,
|
|
1310
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
1327
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
1311
1328
|
) -> TaskIDList:
|
|
1312
1329
|
"""Create a new volume in the project and region.
|
|
1313
1330
|
|
|
@@ -1364,19 +1381,18 @@ class AsyncVolumesResource(AsyncAPIResource):
|
|
|
1364
1381
|
name: str,
|
|
1365
1382
|
snapshot_id: str,
|
|
1366
1383
|
source: Literal["snapshot"],
|
|
1367
|
-
attachment_tag: str |
|
|
1368
|
-
instance_id_to_attach_to: str |
|
|
1369
|
-
lifecycle_policy_ids: Iterable[int] |
|
|
1370
|
-
size: int |
|
|
1371
|
-
tags: TagUpdateMapParam |
|
|
1372
|
-
type_name: Literal["cold", "ssd_hiiops", "ssd_local", "ssd_lowlatency", "standard", "ultra"]
|
|
1373
|
-
| NotGiven = NOT_GIVEN,
|
|
1384
|
+
attachment_tag: str | Omit = omit,
|
|
1385
|
+
instance_id_to_attach_to: str | Omit = omit,
|
|
1386
|
+
lifecycle_policy_ids: Iterable[int] | Omit = omit,
|
|
1387
|
+
size: int | Omit = omit,
|
|
1388
|
+
tags: TagUpdateMapParam | Omit = omit,
|
|
1389
|
+
type_name: Literal["cold", "ssd_hiiops", "ssd_local", "ssd_lowlatency", "standard", "ultra"] | Omit = omit,
|
|
1374
1390
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
1375
1391
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
1376
1392
|
extra_headers: Headers | None = None,
|
|
1377
1393
|
extra_query: Query | None = None,
|
|
1378
1394
|
extra_body: Body | None = None,
|
|
1379
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
1395
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
1380
1396
|
) -> TaskIDList:
|
|
1381
1397
|
"""Create a new volume in the project and region.
|
|
1382
1398
|
|
|
@@ -1434,18 +1450,17 @@ class AsyncVolumesResource(AsyncAPIResource):
|
|
|
1434
1450
|
name: str,
|
|
1435
1451
|
size: int,
|
|
1436
1452
|
source: Literal["new-volume"],
|
|
1437
|
-
attachment_tag: str |
|
|
1438
|
-
instance_id_to_attach_to: str |
|
|
1439
|
-
lifecycle_policy_ids: Iterable[int] |
|
|
1440
|
-
tags: TagUpdateMapParam |
|
|
1441
|
-
type_name: Literal["cold", "ssd_hiiops", "ssd_local", "ssd_lowlatency", "standard", "ultra"]
|
|
1442
|
-
| NotGiven = NOT_GIVEN,
|
|
1453
|
+
attachment_tag: str | Omit = omit,
|
|
1454
|
+
instance_id_to_attach_to: str | Omit = omit,
|
|
1455
|
+
lifecycle_policy_ids: Iterable[int] | Omit = omit,
|
|
1456
|
+
tags: TagUpdateMapParam | Omit = omit,
|
|
1457
|
+
type_name: Literal["cold", "ssd_hiiops", "ssd_local", "ssd_lowlatency", "standard", "ultra"] | Omit = omit,
|
|
1443
1458
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
1444
1459
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
1445
1460
|
extra_headers: Headers | None = None,
|
|
1446
1461
|
extra_query: Query | None = None,
|
|
1447
1462
|
extra_body: Body | None = None,
|
|
1448
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
1463
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
1449
1464
|
) -> TaskIDList:
|
|
1450
1465
|
"""Create a new volume in the project and region.
|
|
1451
1466
|
|
|
@@ -1499,30 +1514,31 @@ class AsyncVolumesResource(AsyncAPIResource):
|
|
|
1499
1514
|
*,
|
|
1500
1515
|
project_id: int | None = None,
|
|
1501
1516
|
region_id: int | None = None,
|
|
1502
|
-
image_id: str |
|
|
1517
|
+
image_id: str | Omit = omit,
|
|
1503
1518
|
name: str,
|
|
1504
|
-
size: int |
|
|
1519
|
+
size: int | Omit = omit,
|
|
1505
1520
|
source: Literal["image"] | Literal["snapshot"] | Literal["new-volume"],
|
|
1506
|
-
attachment_tag: str |
|
|
1507
|
-
instance_id_to_attach_to: str |
|
|
1508
|
-
lifecycle_policy_ids: Iterable[int] |
|
|
1509
|
-
tags: TagUpdateMapParam |
|
|
1510
|
-
type_name: Literal["cold", "ssd_hiiops", "ssd_local", "ssd_lowlatency", "standard", "ultra"]
|
|
1511
|
-
|
|
|
1512
|
-
snapshot_id: str | NotGiven = NOT_GIVEN,
|
|
1521
|
+
attachment_tag: str | Omit = omit,
|
|
1522
|
+
instance_id_to_attach_to: str | Omit = omit,
|
|
1523
|
+
lifecycle_policy_ids: Iterable[int] | Omit = omit,
|
|
1524
|
+
tags: TagUpdateMapParam | Omit = omit,
|
|
1525
|
+
type_name: Literal["cold", "ssd_hiiops", "ssd_local", "ssd_lowlatency", "standard", "ultra"] | Omit = omit,
|
|
1526
|
+
snapshot_id: str | Omit = omit,
|
|
1513
1527
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
1514
1528
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
1515
1529
|
extra_headers: Headers | None = None,
|
|
1516
1530
|
extra_query: Query | None = None,
|
|
1517
1531
|
extra_body: Body | None = None,
|
|
1518
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
1532
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
1519
1533
|
) -> TaskIDList:
|
|
1520
1534
|
if project_id is None:
|
|
1521
1535
|
project_id = self._client._get_cloud_project_id_path_param()
|
|
1522
1536
|
if region_id is None:
|
|
1523
1537
|
region_id = self._client._get_cloud_region_id_path_param()
|
|
1524
1538
|
return await self._post(
|
|
1525
|
-
f"/cloud/v1/volumes/{project_id}/{region_id}"
|
|
1539
|
+
f"/cloud/v1/volumes/{project_id}/{region_id}"
|
|
1540
|
+
if self._client._base_url_overridden
|
|
1541
|
+
else f"https://api.gcore.com//cloud/v1/volumes/{project_id}/{region_id}",
|
|
1526
1542
|
body=await async_maybe_transform(
|
|
1527
1543
|
{
|
|
1528
1544
|
"image_id": image_id,
|
|
@@ -1550,14 +1566,14 @@ class AsyncVolumesResource(AsyncAPIResource):
|
|
|
1550
1566
|
*,
|
|
1551
1567
|
project_id: int | None = None,
|
|
1552
1568
|
region_id: int | None = None,
|
|
1553
|
-
name: str |
|
|
1554
|
-
tags: Optional[TagUpdateMapParam] |
|
|
1569
|
+
name: str | Omit = omit,
|
|
1570
|
+
tags: Optional[TagUpdateMapParam] | Omit = omit,
|
|
1555
1571
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
1556
1572
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
1557
1573
|
extra_headers: Headers | None = None,
|
|
1558
1574
|
extra_query: Query | None = None,
|
|
1559
1575
|
extra_body: Body | None = None,
|
|
1560
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
1576
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
1561
1577
|
) -> Volume:
|
|
1562
1578
|
"""
|
|
1563
1579
|
Rename a volume or update tags
|
|
@@ -1574,7 +1590,9 @@ class AsyncVolumesResource(AsyncAPIResource):
|
|
|
1574
1590
|
tags: Update key-value tags using JSON Merge Patch semantics (RFC 7386). Provide
|
|
1575
1591
|
key-value pairs to add or update tags. Set tag values to `null` to remove tags.
|
|
1576
1592
|
Unspecified tags remain unchanged. Read-only tags are always preserved and
|
|
1577
|
-
cannot be modified.
|
|
1593
|
+
cannot be modified.
|
|
1594
|
+
|
|
1595
|
+
**Examples:**
|
|
1578
1596
|
|
|
1579
1597
|
- **Add/update tags:**
|
|
1580
1598
|
`{'tags': {'environment': 'production', 'team': 'backend'}}` adds new tags or
|
|
@@ -1606,7 +1624,9 @@ class AsyncVolumesResource(AsyncAPIResource):
|
|
|
1606
1624
|
if not volume_id:
|
|
1607
1625
|
raise ValueError(f"Expected a non-empty value for `volume_id` but received {volume_id!r}")
|
|
1608
1626
|
return await self._patch(
|
|
1609
|
-
f"/cloud/v1/volumes/{project_id}/{region_id}/{volume_id}"
|
|
1627
|
+
f"/cloud/v1/volumes/{project_id}/{region_id}/{volume_id}"
|
|
1628
|
+
if self._client._base_url_overridden
|
|
1629
|
+
else f"https://api.gcore.com//cloud/v1/volumes/{project_id}/{region_id}/{volume_id}",
|
|
1610
1630
|
body=await async_maybe_transform(
|
|
1611
1631
|
{
|
|
1612
1632
|
"name": name,
|
|
@@ -1625,22 +1645,22 @@ class AsyncVolumesResource(AsyncAPIResource):
|
|
|
1625
1645
|
*,
|
|
1626
1646
|
project_id: int | None = None,
|
|
1627
1647
|
region_id: int | None = None,
|
|
1628
|
-
bootable: bool |
|
|
1629
|
-
cluster_id: str |
|
|
1630
|
-
has_attachments: bool |
|
|
1631
|
-
id_part: str |
|
|
1632
|
-
instance_id: str |
|
|
1633
|
-
limit: int |
|
|
1634
|
-
name_part: str |
|
|
1635
|
-
offset: int |
|
|
1636
|
-
tag_key: SequenceNotStr[str] |
|
|
1637
|
-
tag_key_value: str |
|
|
1648
|
+
bootable: bool | Omit = omit,
|
|
1649
|
+
cluster_id: str | Omit = omit,
|
|
1650
|
+
has_attachments: bool | Omit = omit,
|
|
1651
|
+
id_part: str | Omit = omit,
|
|
1652
|
+
instance_id: str | Omit = omit,
|
|
1653
|
+
limit: int | Omit = omit,
|
|
1654
|
+
name_part: str | Omit = omit,
|
|
1655
|
+
offset: int | Omit = omit,
|
|
1656
|
+
tag_key: SequenceNotStr[str] | Omit = omit,
|
|
1657
|
+
tag_key_value: str | Omit = omit,
|
|
1638
1658
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
1639
1659
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
1640
1660
|
extra_headers: Headers | None = None,
|
|
1641
1661
|
extra_query: Query | None = None,
|
|
1642
1662
|
extra_body: Body | None = None,
|
|
1643
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
1663
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
1644
1664
|
) -> AsyncPaginator[Volume, AsyncOffsetPage[Volume]]:
|
|
1645
1665
|
"""Retrieve a list of volumes in the project and region.
|
|
1646
1666
|
|
|
@@ -1688,7 +1708,9 @@ class AsyncVolumesResource(AsyncAPIResource):
|
|
|
1688
1708
|
if region_id is None:
|
|
1689
1709
|
region_id = self._client._get_cloud_region_id_path_param()
|
|
1690
1710
|
return self._get_api_list(
|
|
1691
|
-
f"/cloud/v1/volumes/{project_id}/{region_id}"
|
|
1711
|
+
f"/cloud/v1/volumes/{project_id}/{region_id}"
|
|
1712
|
+
if self._client._base_url_overridden
|
|
1713
|
+
else f"https://api.gcore.com//cloud/v1/volumes/{project_id}/{region_id}",
|
|
1692
1714
|
page=AsyncOffsetPage[Volume],
|
|
1693
1715
|
options=make_request_options(
|
|
1694
1716
|
extra_headers=extra_headers,
|
|
@@ -1720,13 +1742,13 @@ class AsyncVolumesResource(AsyncAPIResource):
|
|
|
1720
1742
|
*,
|
|
1721
1743
|
project_id: int | None = None,
|
|
1722
1744
|
region_id: int | None = None,
|
|
1723
|
-
snapshots: str |
|
|
1745
|
+
snapshots: str | Omit = omit,
|
|
1724
1746
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
1725
1747
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
1726
1748
|
extra_headers: Headers | None = None,
|
|
1727
1749
|
extra_query: Query | None = None,
|
|
1728
1750
|
extra_body: Body | None = None,
|
|
1729
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
1751
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
1730
1752
|
) -> TaskIDList:
|
|
1731
1753
|
"""Delete a volume and all its snapshots.
|
|
1732
1754
|
|
|
@@ -1757,7 +1779,9 @@ class AsyncVolumesResource(AsyncAPIResource):
|
|
|
1757
1779
|
if not volume_id:
|
|
1758
1780
|
raise ValueError(f"Expected a non-empty value for `volume_id` but received {volume_id!r}")
|
|
1759
1781
|
return await self._delete(
|
|
1760
|
-
f"/cloud/v1/volumes/{project_id}/{region_id}/{volume_id}"
|
|
1782
|
+
f"/cloud/v1/volumes/{project_id}/{region_id}/{volume_id}"
|
|
1783
|
+
if self._client._base_url_overridden
|
|
1784
|
+
else f"https://api.gcore.com//cloud/v1/volumes/{project_id}/{region_id}/{volume_id}",
|
|
1761
1785
|
options=make_request_options(
|
|
1762
1786
|
extra_headers=extra_headers,
|
|
1763
1787
|
extra_query=extra_query,
|
|
@@ -1775,13 +1799,13 @@ class AsyncVolumesResource(AsyncAPIResource):
|
|
|
1775
1799
|
project_id: int | None = None,
|
|
1776
1800
|
region_id: int | None = None,
|
|
1777
1801
|
instance_id: str,
|
|
1778
|
-
attachment_tag: str |
|
|
1802
|
+
attachment_tag: str | Omit = omit,
|
|
1779
1803
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
1780
1804
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
1781
1805
|
extra_headers: Headers | None = None,
|
|
1782
1806
|
extra_query: Query | None = None,
|
|
1783
1807
|
extra_body: Body | None = None,
|
|
1784
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
1808
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
1785
1809
|
) -> TaskIDList:
|
|
1786
1810
|
"""Attach the volume to instance.
|
|
1787
1811
|
|
|
@@ -1814,7 +1838,9 @@ class AsyncVolumesResource(AsyncAPIResource):
|
|
|
1814
1838
|
if not volume_id:
|
|
1815
1839
|
raise ValueError(f"Expected a non-empty value for `volume_id` but received {volume_id!r}")
|
|
1816
1840
|
return await self._post(
|
|
1817
|
-
f"/cloud/v2/volumes/{project_id}/{region_id}/{volume_id}/attach"
|
|
1841
|
+
f"/cloud/v2/volumes/{project_id}/{region_id}/{volume_id}/attach"
|
|
1842
|
+
if self._client._base_url_overridden
|
|
1843
|
+
else f"https://api.gcore.com//cloud/v2/volumes/{project_id}/{region_id}/{volume_id}/attach",
|
|
1818
1844
|
body=await async_maybe_transform(
|
|
1819
1845
|
{
|
|
1820
1846
|
"instance_id": instance_id,
|
|
@@ -1840,7 +1866,7 @@ class AsyncVolumesResource(AsyncAPIResource):
|
|
|
1840
1866
|
extra_headers: Headers | None = None,
|
|
1841
1867
|
extra_query: Query | None = None,
|
|
1842
1868
|
extra_body: Body | None = None,
|
|
1843
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
1869
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
1844
1870
|
) -> Volume:
|
|
1845
1871
|
"""Change the type of a volume.
|
|
1846
1872
|
|
|
@@ -1871,7 +1897,9 @@ class AsyncVolumesResource(AsyncAPIResource):
|
|
|
1871
1897
|
if not volume_id:
|
|
1872
1898
|
raise ValueError(f"Expected a non-empty value for `volume_id` but received {volume_id!r}")
|
|
1873
1899
|
return await self._post(
|
|
1874
|
-
f"/cloud/v1/volumes/{project_id}/{region_id}/{volume_id}/retype"
|
|
1900
|
+
f"/cloud/v1/volumes/{project_id}/{region_id}/{volume_id}/retype"
|
|
1901
|
+
if self._client._base_url_overridden
|
|
1902
|
+
else f"https://api.gcore.com//cloud/v1/volumes/{project_id}/{region_id}/{volume_id}/retype",
|
|
1875
1903
|
body=await async_maybe_transform(
|
|
1876
1904
|
{"volume_type": volume_type}, volume_change_type_params.VolumeChangeTypeParams
|
|
1877
1905
|
),
|
|
@@ -1893,7 +1921,7 @@ class AsyncVolumesResource(AsyncAPIResource):
|
|
|
1893
1921
|
extra_headers: Headers | None = None,
|
|
1894
1922
|
extra_query: Query | None = None,
|
|
1895
1923
|
extra_body: Body | None = None,
|
|
1896
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
1924
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
1897
1925
|
) -> TaskIDList:
|
|
1898
1926
|
"""
|
|
1899
1927
|
Detach the volume from instance
|
|
@@ -1922,7 +1950,9 @@ class AsyncVolumesResource(AsyncAPIResource):
|
|
|
1922
1950
|
if not volume_id:
|
|
1923
1951
|
raise ValueError(f"Expected a non-empty value for `volume_id` but received {volume_id!r}")
|
|
1924
1952
|
return await self._post(
|
|
1925
|
-
f"/cloud/v2/volumes/{project_id}/{region_id}/{volume_id}/detach"
|
|
1953
|
+
f"/cloud/v2/volumes/{project_id}/{region_id}/{volume_id}/detach"
|
|
1954
|
+
if self._client._base_url_overridden
|
|
1955
|
+
else f"https://api.gcore.com//cloud/v2/volumes/{project_id}/{region_id}/{volume_id}/detach",
|
|
1926
1956
|
body=await async_maybe_transform(
|
|
1927
1957
|
{"instance_id": instance_id}, volume_detach_from_instance_params.VolumeDetachFromInstanceParams
|
|
1928
1958
|
),
|
|
@@ -1943,7 +1973,7 @@ class AsyncVolumesResource(AsyncAPIResource):
|
|
|
1943
1973
|
extra_headers: Headers | None = None,
|
|
1944
1974
|
extra_query: Query | None = None,
|
|
1945
1975
|
extra_body: Body | None = None,
|
|
1946
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
1976
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
1947
1977
|
) -> Volume:
|
|
1948
1978
|
"""
|
|
1949
1979
|
Retrieve detailed information about a specific volume.
|
|
@@ -1970,7 +2000,9 @@ class AsyncVolumesResource(AsyncAPIResource):
|
|
|
1970
2000
|
if not volume_id:
|
|
1971
2001
|
raise ValueError(f"Expected a non-empty value for `volume_id` but received {volume_id!r}")
|
|
1972
2002
|
return await self._get(
|
|
1973
|
-
f"/cloud/v1/volumes/{project_id}/{region_id}/{volume_id}"
|
|
2003
|
+
f"/cloud/v1/volumes/{project_id}/{region_id}/{volume_id}"
|
|
2004
|
+
if self._client._base_url_overridden
|
|
2005
|
+
else f"https://api.gcore.com//cloud/v1/volumes/{project_id}/{region_id}/{volume_id}",
|
|
1974
2006
|
options=make_request_options(
|
|
1975
2007
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
1976
2008
|
),
|
|
@@ -1989,7 +2021,7 @@ class AsyncVolumesResource(AsyncAPIResource):
|
|
|
1989
2021
|
extra_headers: Headers | None = None,
|
|
1990
2022
|
extra_query: Query | None = None,
|
|
1991
2023
|
extra_body: Body | None = None,
|
|
1992
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
2024
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
1993
2025
|
) -> TaskIDList:
|
|
1994
2026
|
"""Increase the size of a volume.
|
|
1995
2027
|
|
|
@@ -2020,7 +2052,9 @@ class AsyncVolumesResource(AsyncAPIResource):
|
|
|
2020
2052
|
if not volume_id:
|
|
2021
2053
|
raise ValueError(f"Expected a non-empty value for `volume_id` but received {volume_id!r}")
|
|
2022
2054
|
return await self._post(
|
|
2023
|
-
f"/cloud/v1/volumes/{project_id}/{region_id}/{volume_id}/extend"
|
|
2055
|
+
f"/cloud/v1/volumes/{project_id}/{region_id}/{volume_id}/extend"
|
|
2056
|
+
if self._client._base_url_overridden
|
|
2057
|
+
else f"https://api.gcore.com//cloud/v1/volumes/{project_id}/{region_id}/{volume_id}/extend",
|
|
2024
2058
|
body=await async_maybe_transform({"size": size}, volume_resize_params.VolumeResizeParams),
|
|
2025
2059
|
options=make_request_options(
|
|
2026
2060
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
@@ -2039,7 +2073,7 @@ class AsyncVolumesResource(AsyncAPIResource):
|
|
|
2039
2073
|
extra_headers: Headers | None = None,
|
|
2040
2074
|
extra_query: Query | None = None,
|
|
2041
2075
|
extra_body: Body | None = None,
|
|
2042
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
2076
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
2043
2077
|
) -> None:
|
|
2044
2078
|
"""Revert a volume to its last snapshot.
|
|
2045
2079
|
|
|
@@ -2069,7 +2103,9 @@ class AsyncVolumesResource(AsyncAPIResource):
|
|
|
2069
2103
|
raise ValueError(f"Expected a non-empty value for `volume_id` but received {volume_id!r}")
|
|
2070
2104
|
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
|
2071
2105
|
return await self._post(
|
|
2072
|
-
f"/cloud/v1/volumes/{project_id}/{region_id}/{volume_id}/revert"
|
|
2106
|
+
f"/cloud/v1/volumes/{project_id}/{region_id}/{volume_id}/revert"
|
|
2107
|
+
if self._client._base_url_overridden
|
|
2108
|
+
else f"https://api.gcore.com//cloud/v1/volumes/{project_id}/{region_id}/{volume_id}/revert",
|
|
2073
2109
|
options=make_request_options(
|
|
2074
2110
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
2075
2111
|
),
|
|
@@ -2086,13 +2122,13 @@ class AsyncVolumesResource(AsyncAPIResource):
|
|
|
2086
2122
|
name: str,
|
|
2087
2123
|
size: int,
|
|
2088
2124
|
source: Literal["image"],
|
|
2089
|
-
attachment_tag: str |
|
|
2090
|
-
instance_id_to_attach_to: str |
|
|
2091
|
-
lifecycle_policy_ids: Iterable[int] |
|
|
2092
|
-
tags: TagUpdateMapParam |
|
|
2125
|
+
attachment_tag: str | Omit = omit,
|
|
2126
|
+
instance_id_to_attach_to: str | Omit = omit,
|
|
2127
|
+
lifecycle_policy_ids: Iterable[int] | Omit = omit,
|
|
2128
|
+
tags: TagUpdateMapParam | Omit = omit,
|
|
2093
2129
|
type_name: Literal["cold", "ssd_hiiops", "ssd_local", "ssd_lowlatency", "standard", "ultra"]
|
|
2094
|
-
|
|
|
2095
|
-
polling_interval_seconds: int |
|
|
2130
|
+
| Omit = omit,
|
|
2131
|
+
polling_interval_seconds: int | Omit = omit,
|
|
2096
2132
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
2097
2133
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
2098
2134
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
@@ -2155,14 +2191,14 @@ class AsyncVolumesResource(AsyncAPIResource):
|
|
|
2155
2191
|
name: str,
|
|
2156
2192
|
snapshot_id: str,
|
|
2157
2193
|
source: Literal["snapshot"],
|
|
2158
|
-
attachment_tag: str |
|
|
2159
|
-
instance_id_to_attach_to: str |
|
|
2160
|
-
lifecycle_policy_ids: Iterable[int] |
|
|
2161
|
-
size: int |
|
|
2162
|
-
tags: TagUpdateMapParam |
|
|
2194
|
+
attachment_tag: str | Omit = omit,
|
|
2195
|
+
instance_id_to_attach_to: str | Omit = omit,
|
|
2196
|
+
lifecycle_policy_ids: Iterable[int] | Omit = omit,
|
|
2197
|
+
size: int | Omit = omit,
|
|
2198
|
+
tags: TagUpdateMapParam | Omit = omit,
|
|
2163
2199
|
type_name: Literal["cold", "ssd_hiiops", "ssd_local", "ssd_lowlatency", "standard", "ultra"]
|
|
2164
|
-
|
|
|
2165
|
-
polling_interval_seconds: int |
|
|
2200
|
+
| Omit = omit,
|
|
2201
|
+
polling_interval_seconds: int | Omit = omit,
|
|
2166
2202
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
2167
2203
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
2168
2204
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
@@ -2226,13 +2262,13 @@ class AsyncVolumesResource(AsyncAPIResource):
|
|
|
2226
2262
|
name: str,
|
|
2227
2263
|
size: int,
|
|
2228
2264
|
source: Literal["new-volume"],
|
|
2229
|
-
attachment_tag: str |
|
|
2230
|
-
instance_id_to_attach_to: str |
|
|
2231
|
-
lifecycle_policy_ids: Iterable[int] |
|
|
2232
|
-
tags: TagUpdateMapParam |
|
|
2265
|
+
attachment_tag: str | Omit = omit,
|
|
2266
|
+
instance_id_to_attach_to: str | Omit = omit,
|
|
2267
|
+
lifecycle_policy_ids: Iterable[int] | Omit = omit,
|
|
2268
|
+
tags: TagUpdateMapParam | Omit = omit,
|
|
2233
2269
|
type_name: Literal["cold", "ssd_hiiops", "ssd_local", "ssd_lowlatency", "standard", "ultra"]
|
|
2234
|
-
|
|
|
2235
|
-
polling_interval_seconds: int |
|
|
2270
|
+
| Omit = omit,
|
|
2271
|
+
polling_interval_seconds: int | Omit = omit,
|
|
2236
2272
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
2237
2273
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
2238
2274
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
@@ -2292,18 +2328,18 @@ class AsyncVolumesResource(AsyncAPIResource):
|
|
|
2292
2328
|
*,
|
|
2293
2329
|
project_id: int | None = None,
|
|
2294
2330
|
region_id: int | None = None,
|
|
2295
|
-
image_id: str |
|
|
2331
|
+
image_id: str | Omit = omit,
|
|
2296
2332
|
name: str,
|
|
2297
|
-
size: int |
|
|
2333
|
+
size: int | Omit = omit,
|
|
2298
2334
|
source: Literal["image"] | Literal["snapshot"] | Literal["new-volume"],
|
|
2299
|
-
attachment_tag: str |
|
|
2300
|
-
instance_id_to_attach_to: str |
|
|
2301
|
-
lifecycle_policy_ids: Iterable[int] |
|
|
2302
|
-
tags: TagUpdateMapParam |
|
|
2335
|
+
attachment_tag: str | Omit = omit,
|
|
2336
|
+
instance_id_to_attach_to: str | Omit = omit,
|
|
2337
|
+
lifecycle_policy_ids: Iterable[int] | Omit = omit,
|
|
2338
|
+
tags: TagUpdateMapParam | Omit = omit,
|
|
2303
2339
|
type_name: Literal["cold", "ssd_hiiops", "ssd_local", "ssd_lowlatency", "standard", "ultra"]
|
|
2304
|
-
|
|
|
2305
|
-
snapshot_id: str |
|
|
2306
|
-
polling_interval_seconds: int |
|
|
2340
|
+
| Omit = omit,
|
|
2341
|
+
snapshot_id: str | Omit = omit,
|
|
2342
|
+
polling_interval_seconds: int | Omit = omit,
|
|
2307
2343
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
2308
2344
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
2309
2345
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
@@ -2356,8 +2392,8 @@ class AsyncVolumesResource(AsyncAPIResource):
|
|
|
2356
2392
|
*,
|
|
2357
2393
|
project_id: int | None = None,
|
|
2358
2394
|
region_id: int | None = None,
|
|
2359
|
-
snapshots: str |
|
|
2360
|
-
polling_interval_seconds: int |
|
|
2395
|
+
snapshots: str | Omit = omit,
|
|
2396
|
+
polling_interval_seconds: int | Omit = omit,
|
|
2361
2397
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
2362
2398
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
2363
2399
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
@@ -2391,8 +2427,8 @@ class AsyncVolumesResource(AsyncAPIResource):
|
|
|
2391
2427
|
project_id: int | None = None,
|
|
2392
2428
|
region_id: int | None = None,
|
|
2393
2429
|
instance_id: str,
|
|
2394
|
-
attachment_tag: str |
|
|
2395
|
-
polling_interval_seconds: int |
|
|
2430
|
+
attachment_tag: str | Omit = omit,
|
|
2431
|
+
polling_interval_seconds: int | Omit = omit,
|
|
2396
2432
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
2397
2433
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
2398
2434
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
@@ -2427,7 +2463,7 @@ class AsyncVolumesResource(AsyncAPIResource):
|
|
|
2427
2463
|
project_id: int | None = None,
|
|
2428
2464
|
region_id: int | None = None,
|
|
2429
2465
|
instance_id: str,
|
|
2430
|
-
polling_interval_seconds: int |
|
|
2466
|
+
polling_interval_seconds: int | Omit = omit,
|
|
2431
2467
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
2432
2468
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
2433
2469
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
@@ -2461,7 +2497,7 @@ class AsyncVolumesResource(AsyncAPIResource):
|
|
|
2461
2497
|
project_id: int | None = None,
|
|
2462
2498
|
region_id: int | None = None,
|
|
2463
2499
|
size: int,
|
|
2464
|
-
polling_interval_seconds: int |
|
|
2500
|
+
polling_interval_seconds: int | Omit = omit,
|
|
2465
2501
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
2466
2502
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
2467
2503
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|