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
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
"""
|
|
2
|
+
This file contains code from https://github.com/pydantic/pydantic/blob/main/pydantic/v1/datetime_parse.py
|
|
3
|
+
without the Pydantic v1 specific errors.
|
|
4
|
+
"""
|
|
5
|
+
|
|
6
|
+
from __future__ import annotations
|
|
7
|
+
|
|
8
|
+
import re
|
|
9
|
+
from typing import Dict, Union, Optional
|
|
10
|
+
from datetime import date, datetime, timezone, timedelta
|
|
11
|
+
|
|
12
|
+
from .._types import StrBytesIntFloat
|
|
13
|
+
|
|
14
|
+
date_expr = r"(?P<year>\d{4})-(?P<month>\d{1,2})-(?P<day>\d{1,2})"
|
|
15
|
+
time_expr = (
|
|
16
|
+
r"(?P<hour>\d{1,2}):(?P<minute>\d{1,2})"
|
|
17
|
+
r"(?::(?P<second>\d{1,2})(?:\.(?P<microsecond>\d{1,6})\d{0,6})?)?"
|
|
18
|
+
r"(?P<tzinfo>Z|[+-]\d{2}(?::?\d{2})?)?$"
|
|
19
|
+
)
|
|
20
|
+
|
|
21
|
+
date_re = re.compile(f"{date_expr}$")
|
|
22
|
+
datetime_re = re.compile(f"{date_expr}[T ]{time_expr}")
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
EPOCH = datetime(1970, 1, 1)
|
|
26
|
+
# if greater than this, the number is in ms, if less than or equal it's in seconds
|
|
27
|
+
# (in seconds this is 11th October 2603, in ms it's 20th August 1970)
|
|
28
|
+
MS_WATERSHED = int(2e10)
|
|
29
|
+
# slightly more than datetime.max in ns - (datetime.max - EPOCH).total_seconds() * 1e9
|
|
30
|
+
MAX_NUMBER = int(3e20)
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
def _get_numeric(value: StrBytesIntFloat, native_expected_type: str) -> Union[None, int, float]:
|
|
34
|
+
if isinstance(value, (int, float)):
|
|
35
|
+
return value
|
|
36
|
+
try:
|
|
37
|
+
return float(value)
|
|
38
|
+
except ValueError:
|
|
39
|
+
return None
|
|
40
|
+
except TypeError:
|
|
41
|
+
raise TypeError(f"invalid type; expected {native_expected_type}, string, bytes, int or float") from None
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
def _from_unix_seconds(seconds: Union[int, float]) -> datetime:
|
|
45
|
+
if seconds > MAX_NUMBER:
|
|
46
|
+
return datetime.max
|
|
47
|
+
elif seconds < -MAX_NUMBER:
|
|
48
|
+
return datetime.min
|
|
49
|
+
|
|
50
|
+
while abs(seconds) > MS_WATERSHED:
|
|
51
|
+
seconds /= 1000
|
|
52
|
+
dt = EPOCH + timedelta(seconds=seconds)
|
|
53
|
+
return dt.replace(tzinfo=timezone.utc)
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
def _parse_timezone(value: Optional[str]) -> Union[None, int, timezone]:
|
|
57
|
+
if value == "Z":
|
|
58
|
+
return timezone.utc
|
|
59
|
+
elif value is not None:
|
|
60
|
+
offset_mins = int(value[-2:]) if len(value) > 3 else 0
|
|
61
|
+
offset = 60 * int(value[1:3]) + offset_mins
|
|
62
|
+
if value[0] == "-":
|
|
63
|
+
offset = -offset
|
|
64
|
+
return timezone(timedelta(minutes=offset))
|
|
65
|
+
else:
|
|
66
|
+
return None
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
def parse_datetime(value: Union[datetime, StrBytesIntFloat]) -> datetime:
|
|
70
|
+
"""
|
|
71
|
+
Parse a datetime/int/float/string and return a datetime.datetime.
|
|
72
|
+
|
|
73
|
+
This function supports time zone offsets. When the input contains one,
|
|
74
|
+
the output uses a timezone with a fixed offset from UTC.
|
|
75
|
+
|
|
76
|
+
Raise ValueError if the input is well formatted but not a valid datetime.
|
|
77
|
+
Raise ValueError if the input isn't well formatted.
|
|
78
|
+
"""
|
|
79
|
+
if isinstance(value, datetime):
|
|
80
|
+
return value
|
|
81
|
+
|
|
82
|
+
number = _get_numeric(value, "datetime")
|
|
83
|
+
if number is not None:
|
|
84
|
+
return _from_unix_seconds(number)
|
|
85
|
+
|
|
86
|
+
if isinstance(value, bytes):
|
|
87
|
+
value = value.decode()
|
|
88
|
+
|
|
89
|
+
assert not isinstance(value, (float, int))
|
|
90
|
+
|
|
91
|
+
match = datetime_re.match(value)
|
|
92
|
+
if match is None:
|
|
93
|
+
raise ValueError("invalid datetime format")
|
|
94
|
+
|
|
95
|
+
kw = match.groupdict()
|
|
96
|
+
if kw["microsecond"]:
|
|
97
|
+
kw["microsecond"] = kw["microsecond"].ljust(6, "0")
|
|
98
|
+
|
|
99
|
+
tzinfo = _parse_timezone(kw.pop("tzinfo"))
|
|
100
|
+
kw_: Dict[str, Union[None, int, timezone]] = {k: int(v) for k, v in kw.items() if v is not None}
|
|
101
|
+
kw_["tzinfo"] = tzinfo
|
|
102
|
+
|
|
103
|
+
return datetime(**kw_) # type: ignore
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
def parse_date(value: Union[date, StrBytesIntFloat]) -> date:
|
|
107
|
+
"""
|
|
108
|
+
Parse a date/int/float/string and return a datetime.date.
|
|
109
|
+
|
|
110
|
+
Raise ValueError if the input is well formatted but not a valid date.
|
|
111
|
+
Raise ValueError if the input isn't well formatted.
|
|
112
|
+
"""
|
|
113
|
+
if isinstance(value, date):
|
|
114
|
+
if isinstance(value, datetime):
|
|
115
|
+
return value.date()
|
|
116
|
+
else:
|
|
117
|
+
return value
|
|
118
|
+
|
|
119
|
+
number = _get_numeric(value, "date")
|
|
120
|
+
if number is not None:
|
|
121
|
+
return _from_unix_seconds(number).date()
|
|
122
|
+
|
|
123
|
+
if isinstance(value, bytes):
|
|
124
|
+
value = value.decode()
|
|
125
|
+
|
|
126
|
+
assert not isinstance(value, (float, int))
|
|
127
|
+
match = date_re.match(value)
|
|
128
|
+
if match is None:
|
|
129
|
+
raise ValueError("invalid date format")
|
|
130
|
+
|
|
131
|
+
kw = {k: int(v) for k, v in match.groupdict().items()}
|
|
132
|
+
|
|
133
|
+
try:
|
|
134
|
+
return date(**kw)
|
|
135
|
+
except ValueError:
|
|
136
|
+
raise ValueError("invalid date format") from None
|
gcore/_utils/_transform.py
CHANGED
|
@@ -16,18 +16,20 @@ from ._utils import (
|
|
|
16
16
|
lru_cache,
|
|
17
17
|
is_mapping,
|
|
18
18
|
is_iterable,
|
|
19
|
+
is_sequence,
|
|
19
20
|
)
|
|
20
21
|
from .._files import is_base64_file_input
|
|
22
|
+
from ._compat import get_origin, is_typeddict
|
|
21
23
|
from ._typing import (
|
|
22
24
|
is_list_type,
|
|
23
25
|
is_union_type,
|
|
24
26
|
extract_type_arg,
|
|
25
27
|
is_iterable_type,
|
|
26
28
|
is_required_type,
|
|
29
|
+
is_sequence_type,
|
|
27
30
|
is_annotated_type,
|
|
28
31
|
strip_annotated_type,
|
|
29
32
|
)
|
|
30
|
-
from .._compat import get_origin, model_dump, is_typeddict
|
|
31
33
|
|
|
32
34
|
_T = TypeVar("_T")
|
|
33
35
|
|
|
@@ -167,6 +169,8 @@ def _transform_recursive(
|
|
|
167
169
|
|
|
168
170
|
Defaults to the same value as the `annotation` argument.
|
|
169
171
|
"""
|
|
172
|
+
from .._compat import model_dump
|
|
173
|
+
|
|
170
174
|
if inner_type is None:
|
|
171
175
|
inner_type = annotation
|
|
172
176
|
|
|
@@ -184,6 +188,8 @@ def _transform_recursive(
|
|
|
184
188
|
(is_list_type(stripped_type) and is_list(data))
|
|
185
189
|
# Iterable[T]
|
|
186
190
|
or (is_iterable_type(stripped_type) and is_iterable(data) and not isinstance(data, str))
|
|
191
|
+
# Sequence[T]
|
|
192
|
+
or (is_sequence_type(stripped_type) and is_sequence(data) and not isinstance(data, str))
|
|
187
193
|
):
|
|
188
194
|
# dicts are technically iterable, but it is an iterable on the keys of the dict and is not usually
|
|
189
195
|
# intended as an iterable, so we don't transform it.
|
|
@@ -329,6 +335,8 @@ async def _async_transform_recursive(
|
|
|
329
335
|
|
|
330
336
|
Defaults to the same value as the `annotation` argument.
|
|
331
337
|
"""
|
|
338
|
+
from .._compat import model_dump
|
|
339
|
+
|
|
332
340
|
if inner_type is None:
|
|
333
341
|
inner_type = annotation
|
|
334
342
|
|
|
@@ -346,6 +354,8 @@ async def _async_transform_recursive(
|
|
|
346
354
|
(is_list_type(stripped_type) and is_list(data))
|
|
347
355
|
# Iterable[T]
|
|
348
356
|
or (is_iterable_type(stripped_type) and is_iterable(data) and not isinstance(data, str))
|
|
357
|
+
# Sequence[T]
|
|
358
|
+
or (is_sequence_type(stripped_type) and is_sequence(data) and not isinstance(data, str))
|
|
349
359
|
):
|
|
350
360
|
# dicts are technically iterable, but it is an iterable on the keys of the dict and is not usually
|
|
351
361
|
# intended as an iterable, so we don't transform it.
|
gcore/_utils/_typing.py
CHANGED
|
@@ -15,7 +15,7 @@ from typing_extensions import (
|
|
|
15
15
|
|
|
16
16
|
from ._utils import lru_cache
|
|
17
17
|
from .._types import InheritsGeneric
|
|
18
|
-
from
|
|
18
|
+
from ._compat import is_union as _is_union
|
|
19
19
|
|
|
20
20
|
|
|
21
21
|
def is_annotated_type(typ: type) -> bool:
|
|
@@ -26,6 +26,11 @@ def is_list_type(typ: type) -> bool:
|
|
|
26
26
|
return (get_origin(typ) or typ) == list
|
|
27
27
|
|
|
28
28
|
|
|
29
|
+
def is_sequence_type(typ: type) -> bool:
|
|
30
|
+
origin = get_origin(typ) or typ
|
|
31
|
+
return origin == typing_extensions.Sequence or origin == typing.Sequence or origin == _c_abc.Sequence
|
|
32
|
+
|
|
33
|
+
|
|
29
34
|
def is_iterable_type(typ: type) -> bool:
|
|
30
35
|
"""If the given type is `typing.Iterable[T]`"""
|
|
31
36
|
origin = get_origin(typ) or typ
|
gcore/_utils/_utils.py
CHANGED
|
@@ -22,7 +22,6 @@ from typing_extensions import TypeGuard
|
|
|
22
22
|
import sniffio
|
|
23
23
|
|
|
24
24
|
from .._types import NotGiven, FileTypes, NotGivenOr, HeadersLike
|
|
25
|
-
from .._compat import parse_date as parse_date, parse_datetime as parse_datetime
|
|
26
25
|
|
|
27
26
|
_T = TypeVar("_T")
|
|
28
27
|
_TupleT = TypeVar("_TupleT", bound=Tuple[object, ...])
|
gcore/_version.py
CHANGED
gcore/resources/__init__.py
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
+
from .dns import (
|
|
4
|
+
DNSResource,
|
|
5
|
+
AsyncDNSResource,
|
|
6
|
+
DNSResourceWithRawResponse,
|
|
7
|
+
AsyncDNSResourceWithRawResponse,
|
|
8
|
+
DNSResourceWithStreamingResponse,
|
|
9
|
+
AsyncDNSResourceWithStreamingResponse,
|
|
10
|
+
)
|
|
3
11
|
from .iam import (
|
|
4
12
|
IamResource,
|
|
5
13
|
AsyncIamResource,
|
|
@@ -24,6 +32,14 @@ from .cloud import (
|
|
|
24
32
|
CloudResourceWithStreamingResponse,
|
|
25
33
|
AsyncCloudResourceWithStreamingResponse,
|
|
26
34
|
)
|
|
35
|
+
from .storage import (
|
|
36
|
+
StorageResource,
|
|
37
|
+
AsyncStorageResource,
|
|
38
|
+
StorageResourceWithRawResponse,
|
|
39
|
+
AsyncStorageResourceWithRawResponse,
|
|
40
|
+
StorageResourceWithStreamingResponse,
|
|
41
|
+
AsyncStorageResourceWithStreamingResponse,
|
|
42
|
+
)
|
|
27
43
|
from .fastedge import (
|
|
28
44
|
FastedgeResource,
|
|
29
45
|
AsyncFastedgeResource,
|
|
@@ -86,4 +102,16 @@ __all__ = [
|
|
|
86
102
|
"AsyncSecurityResourceWithRawResponse",
|
|
87
103
|
"SecurityResourceWithStreamingResponse",
|
|
88
104
|
"AsyncSecurityResourceWithStreamingResponse",
|
|
105
|
+
"DNSResource",
|
|
106
|
+
"AsyncDNSResource",
|
|
107
|
+
"DNSResourceWithRawResponse",
|
|
108
|
+
"AsyncDNSResourceWithRawResponse",
|
|
109
|
+
"DNSResourceWithStreamingResponse",
|
|
110
|
+
"AsyncDNSResourceWithStreamingResponse",
|
|
111
|
+
"StorageResource",
|
|
112
|
+
"AsyncStorageResource",
|
|
113
|
+
"StorageResourceWithRawResponse",
|
|
114
|
+
"AsyncStorageResourceWithRawResponse",
|
|
115
|
+
"StorageResourceWithStreamingResponse",
|
|
116
|
+
"AsyncStorageResourceWithStreamingResponse",
|
|
89
117
|
]
|
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
+
from .k8s import (
|
|
4
|
+
K8sResource,
|
|
5
|
+
AsyncK8sResource,
|
|
6
|
+
K8sResourceWithRawResponse,
|
|
7
|
+
AsyncK8sResourceWithRawResponse,
|
|
8
|
+
K8sResourceWithStreamingResponse,
|
|
9
|
+
AsyncK8sResourceWithStreamingResponse,
|
|
10
|
+
)
|
|
3
11
|
from .cloud import (
|
|
4
12
|
CloudResource,
|
|
5
13
|
AsyncCloudResource,
|
|
@@ -342,6 +350,12 @@ __all__ = [
|
|
|
342
350
|
"AsyncInstancesResourceWithRawResponse",
|
|
343
351
|
"InstancesResourceWithStreamingResponse",
|
|
344
352
|
"AsyncInstancesResourceWithStreamingResponse",
|
|
353
|
+
"K8sResource",
|
|
354
|
+
"AsyncK8sResource",
|
|
355
|
+
"K8sResourceWithRawResponse",
|
|
356
|
+
"AsyncK8sResourceWithRawResponse",
|
|
357
|
+
"K8sResourceWithStreamingResponse",
|
|
358
|
+
"AsyncK8sResourceWithStreamingResponse",
|
|
345
359
|
"AuditLogsResource",
|
|
346
360
|
"AsyncAuditLogsResource",
|
|
347
361
|
"AuditLogsResourceWithRawResponse",
|
|
@@ -8,7 +8,7 @@ from typing_extensions import Literal
|
|
|
8
8
|
|
|
9
9
|
import httpx
|
|
10
10
|
|
|
11
|
-
from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
|
|
11
|
+
from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven, SequenceNotStr
|
|
12
12
|
from ..._utils import maybe_transform
|
|
13
13
|
from ..._compat import cached_property
|
|
14
14
|
from ..._resource import SyncAPIResource, AsyncAPIResource
|
|
@@ -153,7 +153,7 @@ class AuditLogsResource(SyncAPIResource):
|
|
|
153
153
|
order_by: Literal["asc", "desc"] | NotGiven = NOT_GIVEN,
|
|
154
154
|
project_id: Iterable[int] | NotGiven = NOT_GIVEN,
|
|
155
155
|
region_id: Iterable[int] | NotGiven = NOT_GIVEN,
|
|
156
|
-
resource_id:
|
|
156
|
+
resource_id: SequenceNotStr[str] | NotGiven = NOT_GIVEN,
|
|
157
157
|
search_field: str | NotGiven = NOT_GIVEN,
|
|
158
158
|
sorting: Literal["asc", "desc"] | NotGiven = NOT_GIVEN,
|
|
159
159
|
to_timestamp: Union[str, datetime] | NotGiven = NOT_GIVEN,
|
|
@@ -362,7 +362,7 @@ class AsyncAuditLogsResource(AsyncAPIResource):
|
|
|
362
362
|
order_by: Literal["asc", "desc"] | NotGiven = NOT_GIVEN,
|
|
363
363
|
project_id: Iterable[int] | NotGiven = NOT_GIVEN,
|
|
364
364
|
region_id: Iterable[int] | NotGiven = NOT_GIVEN,
|
|
365
|
-
resource_id:
|
|
365
|
+
resource_id: SequenceNotStr[str] | NotGiven = NOT_GIVEN,
|
|
366
366
|
search_field: str | NotGiven = NOT_GIVEN,
|
|
367
367
|
sorting: Literal["asc", "desc"] | NotGiven = NOT_GIVEN,
|
|
368
368
|
to_timestamp: Union[str, datetime] | NotGiven = NOT_GIVEN,
|
|
@@ -2,12 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
|
-
from typing import List
|
|
6
5
|
from typing_extensions import Literal
|
|
7
6
|
|
|
8
7
|
import httpx
|
|
9
8
|
|
|
10
|
-
from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven
|
|
9
|
+
from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven, SequenceNotStr
|
|
11
10
|
from ...._utils import maybe_transform, async_maybe_transform
|
|
12
11
|
from ...._compat import cached_property
|
|
13
12
|
from ...._resource import SyncAPIResource, AsyncAPIResource
|
|
@@ -51,7 +50,7 @@ class ImagesResource(SyncAPIResource):
|
|
|
51
50
|
region_id: int | None = None,
|
|
52
51
|
include_prices: bool | NotGiven = NOT_GIVEN,
|
|
53
52
|
private: str | NotGiven = NOT_GIVEN,
|
|
54
|
-
tag_key:
|
|
53
|
+
tag_key: SequenceNotStr[str] | NotGiven = NOT_GIVEN,
|
|
55
54
|
tag_key_value: str | NotGiven = NOT_GIVEN,
|
|
56
55
|
visibility: Literal["private", "public", "shared"] | NotGiven = NOT_GIVEN,
|
|
57
56
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
@@ -139,7 +138,7 @@ class AsyncImagesResource(AsyncAPIResource):
|
|
|
139
138
|
region_id: int | None = None,
|
|
140
139
|
include_prices: bool | NotGiven = NOT_GIVEN,
|
|
141
140
|
private: str | NotGiven = NOT_GIVEN,
|
|
142
|
-
tag_key:
|
|
141
|
+
tag_key: SequenceNotStr[str] | NotGiven = NOT_GIVEN,
|
|
143
142
|
tag_key_value: str | NotGiven = NOT_GIVEN,
|
|
144
143
|
visibility: Literal["private", "public", "shared"] | NotGiven = NOT_GIVEN,
|
|
145
144
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
@@ -2,13 +2,13 @@
|
|
|
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
|
|
8
8
|
|
|
9
9
|
import httpx
|
|
10
10
|
|
|
11
|
-
from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven
|
|
11
|
+
from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven, SequenceNotStr
|
|
12
12
|
from ...._utils import maybe_transform, async_maybe_transform
|
|
13
13
|
from ...._compat import cached_property
|
|
14
14
|
from ...._resource import SyncAPIResource, AsyncAPIResource
|
|
@@ -206,7 +206,7 @@ class ServersResource(SyncAPIResource):
|
|
|
206
206
|
]
|
|
207
207
|
| NotGiven = NOT_GIVEN,
|
|
208
208
|
tag_key_value: str | NotGiven = NOT_GIVEN,
|
|
209
|
-
tag_value:
|
|
209
|
+
tag_value: SequenceNotStr[str] | NotGiven = NOT_GIVEN,
|
|
210
210
|
type_ddos_profile: Literal["basic", "advanced"] | NotGiven = NOT_GIVEN,
|
|
211
211
|
uuid: str | NotGiven = NOT_GIVEN,
|
|
212
212
|
with_ddos: bool | NotGiven = NOT_GIVEN,
|
|
@@ -350,6 +350,12 @@ class ServersResource(SyncAPIResource):
|
|
|
350
350
|
Rebuild a bare metal server with a new image while preserving its configuration.
|
|
351
351
|
|
|
352
352
|
Args:
|
|
353
|
+
project_id: Project ID
|
|
354
|
+
|
|
355
|
+
region_id: Region ID
|
|
356
|
+
|
|
357
|
+
server_id: Server ID
|
|
358
|
+
|
|
353
359
|
image_id: Image ID
|
|
354
360
|
|
|
355
361
|
user_data: String in base64 format. Must not be passed together with 'username' or
|
|
@@ -682,7 +688,7 @@ class AsyncServersResource(AsyncAPIResource):
|
|
|
682
688
|
]
|
|
683
689
|
| NotGiven = NOT_GIVEN,
|
|
684
690
|
tag_key_value: str | NotGiven = NOT_GIVEN,
|
|
685
|
-
tag_value:
|
|
691
|
+
tag_value: SequenceNotStr[str] | NotGiven = NOT_GIVEN,
|
|
686
692
|
type_ddos_profile: Literal["basic", "advanced"] | NotGiven = NOT_GIVEN,
|
|
687
693
|
uuid: str | NotGiven = NOT_GIVEN,
|
|
688
694
|
with_ddos: bool | NotGiven = NOT_GIVEN,
|
|
@@ -826,6 +832,12 @@ class AsyncServersResource(AsyncAPIResource):
|
|
|
826
832
|
Rebuild a bare metal server with a new image while preserving its configuration.
|
|
827
833
|
|
|
828
834
|
Args:
|
|
835
|
+
project_id: Project ID
|
|
836
|
+
|
|
837
|
+
region_id: Region ID
|
|
838
|
+
|
|
839
|
+
server_id: Server ID
|
|
840
|
+
|
|
829
841
|
image_id: Image ID
|
|
830
842
|
|
|
831
843
|
user_data: String in base64 format. Must not be passed together with 'username' or
|
gcore/resources/cloud/cloud.py
CHANGED
|
@@ -10,6 +10,14 @@ from .tasks import (
|
|
|
10
10
|
TasksResourceWithStreamingResponse,
|
|
11
11
|
AsyncTasksResourceWithStreamingResponse,
|
|
12
12
|
)
|
|
13
|
+
from .k8s.k8s import (
|
|
14
|
+
K8sResource,
|
|
15
|
+
AsyncK8sResource,
|
|
16
|
+
K8sResourceWithRawResponse,
|
|
17
|
+
AsyncK8sResourceWithRawResponse,
|
|
18
|
+
K8sResourceWithStreamingResponse,
|
|
19
|
+
AsyncK8sResourceWithStreamingResponse,
|
|
20
|
+
)
|
|
13
21
|
from .regions import (
|
|
14
22
|
RegionsResource,
|
|
15
23
|
AsyncRegionsResource,
|
|
@@ -297,6 +305,10 @@ class CloudResource(SyncAPIResource):
|
|
|
297
305
|
def instances(self) -> InstancesResource:
|
|
298
306
|
return InstancesResource(self._client)
|
|
299
307
|
|
|
308
|
+
@cached_property
|
|
309
|
+
def k8s(self) -> K8sResource:
|
|
310
|
+
return K8sResource(self._client)
|
|
311
|
+
|
|
300
312
|
@cached_property
|
|
301
313
|
def audit_logs(self) -> AuditLogsResource:
|
|
302
314
|
return AuditLogsResource(self._client)
|
|
@@ -418,6 +430,10 @@ class AsyncCloudResource(AsyncAPIResource):
|
|
|
418
430
|
def instances(self) -> AsyncInstancesResource:
|
|
419
431
|
return AsyncInstancesResource(self._client)
|
|
420
432
|
|
|
433
|
+
@cached_property
|
|
434
|
+
def k8s(self) -> AsyncK8sResource:
|
|
435
|
+
return AsyncK8sResource(self._client)
|
|
436
|
+
|
|
421
437
|
@cached_property
|
|
422
438
|
def audit_logs(self) -> AsyncAuditLogsResource:
|
|
423
439
|
return AsyncAuditLogsResource(self._client)
|
|
@@ -542,6 +558,10 @@ class CloudResourceWithRawResponse:
|
|
|
542
558
|
def instances(self) -> InstancesResourceWithRawResponse:
|
|
543
559
|
return InstancesResourceWithRawResponse(self._cloud.instances)
|
|
544
560
|
|
|
561
|
+
@cached_property
|
|
562
|
+
def k8s(self) -> K8sResourceWithRawResponse:
|
|
563
|
+
return K8sResourceWithRawResponse(self._cloud.k8s)
|
|
564
|
+
|
|
545
565
|
@cached_property
|
|
546
566
|
def audit_logs(self) -> AuditLogsResourceWithRawResponse:
|
|
547
567
|
return AuditLogsResourceWithRawResponse(self._cloud.audit_logs)
|
|
@@ -647,6 +667,10 @@ class AsyncCloudResourceWithRawResponse:
|
|
|
647
667
|
def instances(self) -> AsyncInstancesResourceWithRawResponse:
|
|
648
668
|
return AsyncInstancesResourceWithRawResponse(self._cloud.instances)
|
|
649
669
|
|
|
670
|
+
@cached_property
|
|
671
|
+
def k8s(self) -> AsyncK8sResourceWithRawResponse:
|
|
672
|
+
return AsyncK8sResourceWithRawResponse(self._cloud.k8s)
|
|
673
|
+
|
|
650
674
|
@cached_property
|
|
651
675
|
def audit_logs(self) -> AsyncAuditLogsResourceWithRawResponse:
|
|
652
676
|
return AsyncAuditLogsResourceWithRawResponse(self._cloud.audit_logs)
|
|
@@ -752,6 +776,10 @@ class CloudResourceWithStreamingResponse:
|
|
|
752
776
|
def instances(self) -> InstancesResourceWithStreamingResponse:
|
|
753
777
|
return InstancesResourceWithStreamingResponse(self._cloud.instances)
|
|
754
778
|
|
|
779
|
+
@cached_property
|
|
780
|
+
def k8s(self) -> K8sResourceWithStreamingResponse:
|
|
781
|
+
return K8sResourceWithStreamingResponse(self._cloud.k8s)
|
|
782
|
+
|
|
755
783
|
@cached_property
|
|
756
784
|
def audit_logs(self) -> AuditLogsResourceWithStreamingResponse:
|
|
757
785
|
return AuditLogsResourceWithStreamingResponse(self._cloud.audit_logs)
|
|
@@ -857,6 +885,10 @@ class AsyncCloudResourceWithStreamingResponse:
|
|
|
857
885
|
def instances(self) -> AsyncInstancesResourceWithStreamingResponse:
|
|
858
886
|
return AsyncInstancesResourceWithStreamingResponse(self._cloud.instances)
|
|
859
887
|
|
|
888
|
+
@cached_property
|
|
889
|
+
def k8s(self) -> AsyncK8sResourceWithStreamingResponse:
|
|
890
|
+
return AsyncK8sResourceWithStreamingResponse(self._cloud.k8s)
|
|
891
|
+
|
|
860
892
|
@cached_property
|
|
861
893
|
def audit_logs(self) -> AsyncAuditLogsResourceWithStreamingResponse:
|
|
862
894
|
return AsyncAuditLogsResourceWithStreamingResponse(self._cloud.audit_logs)
|
|
@@ -171,13 +171,13 @@ class CostReportsResource(SyncAPIResource):
|
|
|
171
171
|
def get_aggregated_monthly(
|
|
172
172
|
self,
|
|
173
173
|
*,
|
|
174
|
-
time_from: Union[str, datetime],
|
|
175
|
-
time_to: Union[str, datetime],
|
|
176
174
|
regions: Iterable[int] | NotGiven = NOT_GIVEN,
|
|
177
175
|
response_format: Literal["csv_totals", "json"] | NotGiven = NOT_GIVEN,
|
|
178
176
|
rounding: bool | NotGiven = NOT_GIVEN,
|
|
179
177
|
schema_filter: cost_report_get_aggregated_monthly_params.SchemaFilter | NotGiven = NOT_GIVEN,
|
|
180
178
|
tags: cost_report_get_aggregated_monthly_params.Tags | NotGiven = NOT_GIVEN,
|
|
179
|
+
time_from: Union[str, datetime] | NotGiven = NOT_GIVEN,
|
|
180
|
+
time_to: Union[str, datetime] | NotGiven = NOT_GIVEN,
|
|
181
181
|
types: List[
|
|
182
182
|
Literal[
|
|
183
183
|
"ai_cluster",
|
|
@@ -208,6 +208,7 @@ class CostReportsResource(SyncAPIResource):
|
|
|
208
208
|
]
|
|
209
209
|
]
|
|
210
210
|
| NotGiven = NOT_GIVEN,
|
|
211
|
+
year_month: str | NotGiven = NOT_GIVEN,
|
|
211
212
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
212
213
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
213
214
|
extra_headers: Headers | None = None,
|
|
@@ -227,10 +228,6 @@ class CostReportsResource(SyncAPIResource):
|
|
|
227
228
|
hours until the servers are back online and the missing data is filled in.
|
|
228
229
|
|
|
229
230
|
Args:
|
|
230
|
-
time_from: Beginning of the period: YYYY-mm
|
|
231
|
-
|
|
232
|
-
time_to: End of the period: YYYY-mm
|
|
233
|
-
|
|
234
231
|
regions: List of region IDs.
|
|
235
232
|
|
|
236
233
|
response_format: Format of the response (`csv_totals` or json).
|
|
@@ -241,8 +238,14 @@ class CostReportsResource(SyncAPIResource):
|
|
|
241
238
|
|
|
242
239
|
tags: Filter by tags
|
|
243
240
|
|
|
241
|
+
time_from: Deprecated. Use `year_month` instead. Beginning of the period: YYYY-mm
|
|
242
|
+
|
|
243
|
+
time_to: Deprecated. Use `year_month` instead. End of the period: YYYY-mm
|
|
244
|
+
|
|
244
245
|
types: List of resource types to be filtered in the report.
|
|
245
246
|
|
|
247
|
+
year_month: Year and month in the format YYYY-MM
|
|
248
|
+
|
|
246
249
|
extra_headers: Send extra headers
|
|
247
250
|
|
|
248
251
|
extra_query: Add additional query parameters to the request
|
|
@@ -255,14 +258,15 @@ class CostReportsResource(SyncAPIResource):
|
|
|
255
258
|
"/cloud/v1/reservation_cost_report/totals",
|
|
256
259
|
body=maybe_transform(
|
|
257
260
|
{
|
|
258
|
-
"time_from": time_from,
|
|
259
|
-
"time_to": time_to,
|
|
260
261
|
"regions": regions,
|
|
261
262
|
"response_format": response_format,
|
|
262
263
|
"rounding": rounding,
|
|
263
264
|
"schema_filter": schema_filter,
|
|
264
265
|
"tags": tags,
|
|
266
|
+
"time_from": time_from,
|
|
267
|
+
"time_to": time_to,
|
|
265
268
|
"types": types,
|
|
269
|
+
"year_month": year_month,
|
|
266
270
|
},
|
|
267
271
|
cost_report_get_aggregated_monthly_params.CostReportGetAggregatedMonthlyParams,
|
|
268
272
|
),
|
|
@@ -543,13 +547,13 @@ class AsyncCostReportsResource(AsyncAPIResource):
|
|
|
543
547
|
async def get_aggregated_monthly(
|
|
544
548
|
self,
|
|
545
549
|
*,
|
|
546
|
-
time_from: Union[str, datetime],
|
|
547
|
-
time_to: Union[str, datetime],
|
|
548
550
|
regions: Iterable[int] | NotGiven = NOT_GIVEN,
|
|
549
551
|
response_format: Literal["csv_totals", "json"] | NotGiven = NOT_GIVEN,
|
|
550
552
|
rounding: bool | NotGiven = NOT_GIVEN,
|
|
551
553
|
schema_filter: cost_report_get_aggregated_monthly_params.SchemaFilter | NotGiven = NOT_GIVEN,
|
|
552
554
|
tags: cost_report_get_aggregated_monthly_params.Tags | NotGiven = NOT_GIVEN,
|
|
555
|
+
time_from: Union[str, datetime] | NotGiven = NOT_GIVEN,
|
|
556
|
+
time_to: Union[str, datetime] | NotGiven = NOT_GIVEN,
|
|
553
557
|
types: List[
|
|
554
558
|
Literal[
|
|
555
559
|
"ai_cluster",
|
|
@@ -580,6 +584,7 @@ class AsyncCostReportsResource(AsyncAPIResource):
|
|
|
580
584
|
]
|
|
581
585
|
]
|
|
582
586
|
| NotGiven = NOT_GIVEN,
|
|
587
|
+
year_month: str | NotGiven = NOT_GIVEN,
|
|
583
588
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
584
589
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
585
590
|
extra_headers: Headers | None = None,
|
|
@@ -599,10 +604,6 @@ class AsyncCostReportsResource(AsyncAPIResource):
|
|
|
599
604
|
hours until the servers are back online and the missing data is filled in.
|
|
600
605
|
|
|
601
606
|
Args:
|
|
602
|
-
time_from: Beginning of the period: YYYY-mm
|
|
603
|
-
|
|
604
|
-
time_to: End of the period: YYYY-mm
|
|
605
|
-
|
|
606
607
|
regions: List of region IDs.
|
|
607
608
|
|
|
608
609
|
response_format: Format of the response (`csv_totals` or json).
|
|
@@ -613,8 +614,14 @@ class AsyncCostReportsResource(AsyncAPIResource):
|
|
|
613
614
|
|
|
614
615
|
tags: Filter by tags
|
|
615
616
|
|
|
617
|
+
time_from: Deprecated. Use `year_month` instead. Beginning of the period: YYYY-mm
|
|
618
|
+
|
|
619
|
+
time_to: Deprecated. Use `year_month` instead. End of the period: YYYY-mm
|
|
620
|
+
|
|
616
621
|
types: List of resource types to be filtered in the report.
|
|
617
622
|
|
|
623
|
+
year_month: Year and month in the format YYYY-MM
|
|
624
|
+
|
|
618
625
|
extra_headers: Send extra headers
|
|
619
626
|
|
|
620
627
|
extra_query: Add additional query parameters to the request
|
|
@@ -627,14 +634,15 @@ class AsyncCostReportsResource(AsyncAPIResource):
|
|
|
627
634
|
"/cloud/v1/reservation_cost_report/totals",
|
|
628
635
|
body=await async_maybe_transform(
|
|
629
636
|
{
|
|
630
|
-
"time_from": time_from,
|
|
631
|
-
"time_to": time_to,
|
|
632
637
|
"regions": regions,
|
|
633
638
|
"response_format": response_format,
|
|
634
639
|
"rounding": rounding,
|
|
635
640
|
"schema_filter": schema_filter,
|
|
636
641
|
"tags": tags,
|
|
642
|
+
"time_from": time_from,
|
|
643
|
+
"time_to": time_to,
|
|
637
644
|
"types": types,
|
|
645
|
+
"year_month": year_month,
|
|
638
646
|
},
|
|
639
647
|
cost_report_get_aggregated_monthly_params.CostReportGetAggregatedMonthlyParams,
|
|
640
648
|
),
|
|
@@ -116,7 +116,7 @@ class AccessRulesResource(SyncAPIResource):
|
|
|
116
116
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
117
117
|
) -> AccessRuleList:
|
|
118
118
|
"""
|
|
119
|
-
|
|
119
|
+
List file share access rules
|
|
120
120
|
|
|
121
121
|
Args:
|
|
122
122
|
project_id: Project ID
|
|
@@ -291,7 +291,7 @@ class AsyncAccessRulesResource(AsyncAPIResource):
|
|
|
291
291
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
292
292
|
) -> AccessRuleList:
|
|
293
293
|
"""
|
|
294
|
-
|
|
294
|
+
List file share access rules
|
|
295
295
|
|
|
296
296
|
Args:
|
|
297
297
|
project_id: Project ID
|