gcore 0.9.0__py3-none-any.whl → 0.11.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of gcore might be problematic. Click here for more details.
- gcore/_base_client.py +3 -3
- gcore/_client.py +18 -0
- gcore/_compat.py +48 -48
- gcore/_models.py +41 -41
- gcore/_types.py +35 -1
- gcore/_utils/__init__.py +9 -2
- gcore/_utils/_compat.py +45 -0
- gcore/_utils/_datetime_parse.py +136 -0
- gcore/_utils/_transform.py +11 -1
- gcore/_utils/_typing.py +6 -1
- gcore/_utils/_utils.py +0 -1
- gcore/_version.py +1 -1
- gcore/resources/__init__.py +28 -0
- gcore/resources/cloud/__init__.py +14 -0
- gcore/resources/cloud/audit_logs.py +3 -3
- gcore/resources/cloud/baremetal/images.py +3 -4
- gcore/resources/cloud/baremetal/servers.py +16 -4
- gcore/resources/cloud/cloud.py +32 -0
- gcore/resources/cloud/cost_reports.py +24 -16
- gcore/resources/cloud/file_shares/access_rules.py +2 -2
- gcore/resources/cloud/file_shares/file_shares.py +30 -14
- gcore/resources/cloud/floating_ips.py +196 -4
- gcore/resources/cloud/gpu_baremetal_clusters/flavors.py +1 -1
- gcore/resources/cloud/gpu_baremetal_clusters/gpu_baremetal_clusters.py +166 -190
- gcore/resources/cloud/gpu_baremetal_clusters/servers.py +268 -12
- gcore/resources/cloud/inference/__init__.py +14 -14
- gcore/resources/cloud/inference/applications/__init__.py +47 -0
- gcore/resources/cloud/inference/applications/applications.py +134 -0
- gcore/resources/cloud/inference/applications/deployments.py +649 -0
- gcore/resources/cloud/inference/applications/templates.py +238 -0
- gcore/resources/cloud/inference/deployments/deployments.py +41 -22
- gcore/resources/cloud/inference/inference.py +32 -32
- gcore/resources/cloud/inference/registry_credentials.py +8 -9
- gcore/resources/cloud/instances/images.py +4 -4
- gcore/resources/cloud/instances/instances.py +254 -4
- gcore/resources/cloud/instances/interfaces.py +544 -0
- gcore/resources/cloud/k8s/__init__.py +47 -0
- gcore/resources/cloud/k8s/clusters/__init__.py +47 -0
- gcore/resources/cloud/k8s/clusters/clusters.py +1391 -0
- gcore/resources/cloud/k8s/clusters/nodes.py +291 -0
- gcore/resources/cloud/k8s/clusters/pools/__init__.py +33 -0
- gcore/resources/cloud/k8s/clusters/pools/nodes.py +303 -0
- gcore/resources/cloud/k8s/clusters/pools/pools.py +870 -0
- gcore/resources/cloud/k8s/flavors.py +209 -0
- gcore/resources/cloud/k8s/k8s.py +233 -0
- gcore/resources/cloud/load_balancers/l7_policies/l7_policies.py +11 -12
- gcore/resources/cloud/load_balancers/l7_policies/rules.py +9 -10
- gcore/resources/cloud/load_balancers/listeners.py +18 -18
- gcore/resources/cloud/load_balancers/load_balancers.py +4 -4
- gcore/resources/cloud/load_balancers/pools/health_monitors.py +26 -10
- gcore/resources/cloud/load_balancers/pools/members.py +34 -4
- gcore/resources/cloud/load_balancers/pools/pools.py +32 -8
- gcore/resources/cloud/networks/networks.py +192 -4
- gcore/resources/cloud/networks/subnets.py +140 -8
- gcore/resources/cloud/reserved_fixed_ips/vip.py +5 -7
- gcore/resources/cloud/security_groups/security_groups.py +6 -6
- gcore/resources/cloud/tasks.py +46 -46
- gcore/resources/cloud/users/role_assignments.py +5 -4
- gcore/resources/cloud/volumes.py +4 -4
- gcore/resources/dns/__init__.py +75 -0
- gcore/resources/dns/dns.py +374 -0
- gcore/resources/dns/locations.py +288 -0
- gcore/resources/dns/metrics.py +214 -0
- gcore/resources/dns/pickers/__init__.py +33 -0
- gcore/resources/dns/pickers/pickers.py +167 -0
- gcore/resources/dns/pickers/presets.py +135 -0
- gcore/resources/dns/zones/__init__.py +47 -0
- gcore/resources/{cloud/inference/models.py → dns/zones/dnssec.py} +80 -122
- gcore/resources/dns/zones/rrsets.py +1005 -0
- gcore/resources/dns/zones/zones.py +1493 -0
- gcore/resources/security/bgp_announces.py +15 -15
- gcore/resources/storage/__init__.py +75 -0
- gcore/resources/storage/buckets/__init__.py +61 -0
- gcore/resources/storage/buckets/buckets.py +470 -0
- gcore/resources/storage/buckets/cors.py +265 -0
- gcore/resources/storage/buckets/lifecycle.py +276 -0
- gcore/resources/storage/buckets/policy.py +345 -0
- gcore/resources/storage/credentials.py +221 -0
- gcore/resources/storage/locations.py +190 -0
- gcore/resources/storage/statistics.py +364 -0
- gcore/resources/storage/storage.py +1042 -0
- gcore/resources/streaming/ai_tasks.py +56 -70
- gcore/resources/streaming/playlists.py +18 -18
- gcore/resources/streaming/quality_sets.py +8 -8
- gcore/resources/streaming/statistics.py +4 -122
- gcore/resources/streaming/streams/overlays.py +6 -6
- gcore/resources/streaming/streams/streams.py +40 -64
- gcore/resources/streaming/videos/subtitles.py +32 -30
- gcore/resources/streaming/videos/videos.py +78 -72
- gcore/resources/waap/__init__.py +14 -0
- gcore/resources/waap/custom_page_sets.py +40 -34
- gcore/resources/waap/domains/__init__.py +14 -28
- gcore/resources/waap/domains/advanced_rules.py +7 -10
- gcore/resources/waap/domains/{api_discovery/api_discovery.py → api_discovery.py} +292 -59
- gcore/resources/waap/domains/api_path_groups.py +5 -5
- gcore/resources/waap/domains/api_paths.py +28 -30
- gcore/resources/waap/domains/custom_rules.py +7 -10
- gcore/resources/waap/domains/domains.py +124 -68
- gcore/resources/waap/domains/firewall_rules.py +5 -7
- gcore/resources/waap/domains/insight_silences.py +34 -11
- gcore/resources/waap/domains/insights.py +43 -17
- gcore/resources/waap/domains/statistics.py +977 -0
- gcore/resources/waap/insights.py +233 -0
- gcore/resources/waap/ip_info/__init__.py +33 -0
- gcore/resources/waap/{ip_info.py → ip_info/ip_info.py} +149 -235
- gcore/resources/waap/ip_info/metrics.py +203 -0
- gcore/resources/waap/waap.py +40 -8
- 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/health_monitor.py +6 -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/{waap/domains/analytics → cloud/k8s/clusters/pools}/__init__.py +1 -1
- 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 +31 -7
- 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 +27 -4
- gcore/types/cloud/load_balancers/pool_update_params.py +27 -4
- gcore/types/cloud/load_balancers/pools/health_monitor_create_params.py +7 -2
- gcore/types/cloud/load_balancers/pools/member_add_params.py +20 -2
- 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/region.py +0 -3
- 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/__init__.py +1 -1
- gcore/types/security/{bgp_announce_change_params.py → bgp_announce_toggle_params.py} +2 -2
- 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/__init__.py +6 -54
- gcore/types/waap/custom_page_set_create_params.py +121 -14
- gcore/types/waap/custom_page_set_preview_params.py +11 -4
- gcore/types/waap/custom_page_set_update_params.py +122 -15
- gcore/types/waap/domain_list_params.py +2 -4
- gcore/types/waap/domain_update_params.py +1 -1
- gcore/types/waap/domains/__init__.py +28 -18
- gcore/types/waap/domains/advanced_rule_create_params.py +7 -4
- gcore/types/waap/domains/advanced_rule_list_params.py +1 -3
- gcore/types/waap/domains/advanced_rule_update_params.py +6 -3
- gcore/types/waap/domains/{api_discovery/scan_result_list_params.py → api_discovery_list_scan_results_params.py} +2 -2
- gcore/types/waap/domains/api_path_create_params.py +4 -3
- gcore/types/waap/domains/{api_path_group_list_response.py → api_path_group_list.py} +2 -2
- 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_list_params.py +1 -3
- 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 +19 -7
- gcore/types/waap/domains/insight_replace_params.py +3 -5
- gcore/types/waap/domains/insight_silence_list_params.py +17 -6
- gcore/types/waap/domains/setting_update_params.py +3 -2
- gcore/types/waap/domains/{analytics_list_ddos_attacks_params.py → statistic_get_ddos_attacks_params.py} +2 -2
- gcore/types/waap/domains/statistic_get_ddos_info_params.py +28 -0
- gcore/types/waap/domains/statistic_get_events_aggregated_params.py +33 -0
- gcore/types/waap/domains/statistic_get_requests_series_params.py +74 -0
- gcore/types/waap/domains/statistic_get_traffic_series_params.py +22 -0
- gcore/types/waap/domains/statistic_get_traffic_series_response.py +10 -0
- gcore/types/waap/{waap_advanced_rule.py → domains/waap_advanced_rule.py} +4 -3
- gcore/types/waap/domains/{api_discovery_get_settings_response.py → waap_api_discovery_settings.py} +2 -2
- gcore/types/waap/domains/{api_path_get_response.py → waap_api_path.py} +6 -6
- gcore/types/waap/domains/{api_discovery/scan_result_get_response.py → waap_api_scan_result.py} +5 -5
- gcore/types/waap/{waap_blocked_statistics.py → domains/waap_blocked_statistics.py} +1 -1
- gcore/types/waap/{waap_count_statistics.py → domains/waap_count_statistics.py} +1 -1
- gcore/types/waap/{waap_custom_rule.py → domains/waap_custom_rule.py} +5 -8
- gcore/types/waap/{waap_ddos_attack.py → domains/waap_ddos_attack.py} +1 -1
- gcore/types/waap/{waap_ddos_info.py → domains/waap_ddos_info.py} +1 -1
- gcore/types/waap/{waap_event_statistics.py → domains/waap_event_statistics.py} +1 -1
- gcore/types/waap/{waap_firewall_rule.py → domains/waap_firewall_rule.py} +4 -3
- gcore/types/waap/{waap_insight.py → domains/waap_insight.py} +4 -4
- gcore/types/waap/{waap_insight_silence.py → domains/waap_insight_silence.py} +1 -1
- gcore/types/waap/domains/waap_request_details.py +186 -0
- gcore/types/waap/{waap_request_summary.py → domains/waap_request_summary.py} +1 -1
- gcore/types/waap/domains/{api_discovery_scan_openapi_response.py → waap_task_id.py} +2 -2
- gcore/types/waap/{waap_traffic_metrics.py → domains/waap_traffic_metrics.py} +1 -1
- gcore/types/waap/insight_list_types_params.py +28 -0
- gcore/types/waap/ip_info/__init__.py +6 -0
- gcore/types/waap/{ip_info_get_counts_params.py → ip_info/metric_list_params.py} +2 -2
- gcore/types/waap/{waap_ip_info_counts.py → ip_info/waap_ip_info_counts.py} +1 -1
- gcore/types/waap/{ip_info_get_params.py → ip_info_get_ip_info_params.py} +2 -2
- gcore/types/waap/{waap_ip_info.py → ip_info_get_ip_info_response.py} +2 -2
- gcore/types/waap/ip_info_get_top_urls_response.py +12 -3
- gcore/types/waap/{ip_info_get_top_sessions_params.py → ip_info_get_top_user_sessions_params.py} +2 -2
- gcore/types/waap/{ip_info_get_top_sessions_response.py → ip_info_get_top_user_sessions_response.py} +2 -2
- gcore/types/waap/waap_custom_page_set.py +113 -13
- gcore/types/waap/waap_detailed_domain.py +2 -2
- gcore/types/waap/waap_insight_type.py +33 -0
- gcore/types/waap/waap_ip_ddos_info_model.py +3 -3
- gcore/types/waap/waap_rule_set.py +26 -3
- gcore/types/waap/waap_summary_domain.py +2 -2
- {gcore-0.9.0.dist-info → gcore-0.11.0.dist-info}/METADATA +7 -2
- {gcore-0.9.0.dist-info → gcore-0.11.0.dist-info}/RECORD +362 -281
- gcore/resources/waap/domains/analytics/__init__.py +0 -33
- gcore/resources/waap/domains/analytics/analytics.py +0 -676
- gcore/resources/waap/domains/analytics/requests.py +0 -378
- gcore/resources/waap/domains/api_discovery/__init__.py +0 -33
- gcore/resources/waap/domains/api_discovery/scan_results.py +0 -352
- gcore/resources/waap/domains/policies.py +0 -173
- 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/types/waap/domains/analytics/request_list_params.py +0 -53
- gcore/types/waap/domains/analytics_get_event_statistics_params.py +0 -34
- gcore/types/waap/domains/analytics_list_ddos_info_params.py +0 -31
- gcore/types/waap/domains/analytics_list_event_traffic_params.py +0 -26
- gcore/types/waap/domains/analytics_list_event_traffic_response.py +0 -10
- gcore/types/waap/domains/api_discovery/__init__.py +0 -7
- gcore/types/waap/domains/api_discovery/scan_result_list_response.py +0 -29
- gcore/types/waap/domains/api_discovery_update_settings_response.py +0 -36
- gcore/types/waap/domains/api_discovery_upload_openapi_response.py +0 -10
- gcore/types/waap/domains/api_path_create_response.py +0 -50
- gcore/types/waap/domains/api_path_list_response.py +0 -50
- gcore/types/waap/waap_block_csrf_page_data.py +0 -28
- gcore/types/waap/waap_block_csrf_page_data_param.py +0 -28
- gcore/types/waap/waap_block_page_data.py +0 -28
- gcore/types/waap/waap_block_page_data_param.py +0 -28
- gcore/types/waap/waap_captcha_page_data.py +0 -31
- gcore/types/waap/waap_captcha_page_data_param.py +0 -31
- gcore/types/waap/waap_common_tag.py +0 -16
- gcore/types/waap/waap_cookie_disabled_page_data.py +0 -18
- gcore/types/waap/waap_cookie_disabled_page_data_param.py +0 -18
- gcore/types/waap/waap_customer_rule_state.py +0 -7
- gcore/types/waap/waap_domain_policy.py +0 -29
- gcore/types/waap/waap_domain_status.py +0 -7
- gcore/types/waap/waap_handshake_page_data.py +0 -25
- gcore/types/waap/waap_handshake_page_data_param.py +0 -25
- gcore/types/waap/waap_insight_silence_sort_by.py +0 -9
- gcore/types/waap/waap_insight_sort_by.py +0 -20
- gcore/types/waap/waap_insight_status.py +0 -7
- gcore/types/waap/waap_javascript_disabled_page_data.py +0 -18
- gcore/types/waap/waap_javascript_disabled_page_data_param.py +0 -18
- gcore/types/waap/waap_network_details.py +0 -17
- gcore/types/waap/waap_page_type.py +0 -9
- gcore/types/waap/waap_paginated_custom_page_set.py +0 -22
- gcore/types/waap/waap_paginated_ddos_attack.py +0 -22
- gcore/types/waap/waap_paginated_ddos_info.py +0 -22
- gcore/types/waap/waap_paginated_request_summary.py +0 -22
- gcore/types/waap/waap_pattern_matched_tag.py +0 -37
- gcore/types/waap/waap_policy_action.py +0 -7
- gcore/types/waap/waap_request_details.py +0 -92
- gcore/types/waap/waap_request_organization.py +0 -13
- gcore/types/waap/waap_resolution.py +0 -7
- gcore/types/waap/waap_rule_action_type.py +0 -7
- gcore/types/waap/waap_top_url.py +0 -13
- gcore/types/waap/waap_traffic_type.py +0 -28
- gcore/types/waap/waap_user_agent_details.py +0 -40
- {gcore-0.9.0.dist-info → gcore-0.11.0.dist-info}/WHEEL +0 -0
- {gcore-0.9.0.dist-info → gcore-0.11.0.dist-info}/licenses/LICENSE +0 -0
|
@@ -0,0 +1,1391 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from typing import Dict, Iterable, Optional
|
|
6
|
+
|
|
7
|
+
import httpx
|
|
8
|
+
|
|
9
|
+
from .nodes import (
|
|
10
|
+
NodesResource,
|
|
11
|
+
AsyncNodesResource,
|
|
12
|
+
NodesResourceWithRawResponse,
|
|
13
|
+
AsyncNodesResourceWithRawResponse,
|
|
14
|
+
NodesResourceWithStreamingResponse,
|
|
15
|
+
AsyncNodesResourceWithStreamingResponse,
|
|
16
|
+
)
|
|
17
|
+
from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven
|
|
18
|
+
from ....._utils import maybe_transform, async_maybe_transform
|
|
19
|
+
from ....._compat import cached_property
|
|
20
|
+
from .pools.pools import (
|
|
21
|
+
PoolsResource,
|
|
22
|
+
AsyncPoolsResource,
|
|
23
|
+
PoolsResourceWithRawResponse,
|
|
24
|
+
AsyncPoolsResourceWithRawResponse,
|
|
25
|
+
PoolsResourceWithStreamingResponse,
|
|
26
|
+
AsyncPoolsResourceWithStreamingResponse,
|
|
27
|
+
)
|
|
28
|
+
from ....._resource import SyncAPIResource, AsyncAPIResource
|
|
29
|
+
from ....._response import (
|
|
30
|
+
to_raw_response_wrapper,
|
|
31
|
+
to_streamed_response_wrapper,
|
|
32
|
+
async_to_raw_response_wrapper,
|
|
33
|
+
async_to_streamed_response_wrapper,
|
|
34
|
+
)
|
|
35
|
+
from ....._base_client import make_request_options
|
|
36
|
+
from .....types.cloud.k8s import (
|
|
37
|
+
cluster_create_params,
|
|
38
|
+
cluster_delete_params,
|
|
39
|
+
cluster_update_params,
|
|
40
|
+
cluster_upgrade_params,
|
|
41
|
+
)
|
|
42
|
+
from .....types.cloud.task_id_list import TaskIDList
|
|
43
|
+
from .....types.cloud.k8s.k8s_cluster import K8sCluster
|
|
44
|
+
from .....types.cloud.k8s.k8s_cluster_list import K8sClusterList
|
|
45
|
+
from .....types.cloud.k8s_cluster_version_list import K8sClusterVersionList
|
|
46
|
+
from .....types.cloud.k8s.k8s_cluster_kubeconfig import K8sClusterKubeconfig
|
|
47
|
+
from .....types.cloud.k8s.k8s_cluster_certificate import K8sClusterCertificate
|
|
48
|
+
|
|
49
|
+
__all__ = ["ClustersResource", "AsyncClustersResource"]
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
class ClustersResource(SyncAPIResource):
|
|
53
|
+
@cached_property
|
|
54
|
+
def nodes(self) -> NodesResource:
|
|
55
|
+
return NodesResource(self._client)
|
|
56
|
+
|
|
57
|
+
@cached_property
|
|
58
|
+
def pools(self) -> PoolsResource:
|
|
59
|
+
return PoolsResource(self._client)
|
|
60
|
+
|
|
61
|
+
@cached_property
|
|
62
|
+
def with_raw_response(self) -> ClustersResourceWithRawResponse:
|
|
63
|
+
"""
|
|
64
|
+
This property can be used as a prefix for any HTTP method call to return
|
|
65
|
+
the raw response object instead of the parsed content.
|
|
66
|
+
|
|
67
|
+
For more information, see https://www.github.com/G-Core/gcore-python#accessing-raw-response-data-eg-headers
|
|
68
|
+
"""
|
|
69
|
+
return ClustersResourceWithRawResponse(self)
|
|
70
|
+
|
|
71
|
+
@cached_property
|
|
72
|
+
def with_streaming_response(self) -> ClustersResourceWithStreamingResponse:
|
|
73
|
+
"""
|
|
74
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
75
|
+
|
|
76
|
+
For more information, see https://www.github.com/G-Core/gcore-python#with_streaming_response
|
|
77
|
+
"""
|
|
78
|
+
return ClustersResourceWithStreamingResponse(self)
|
|
79
|
+
|
|
80
|
+
def create(
|
|
81
|
+
self,
|
|
82
|
+
*,
|
|
83
|
+
project_id: int | None = None,
|
|
84
|
+
region_id: int | None = None,
|
|
85
|
+
keypair: str,
|
|
86
|
+
name: str,
|
|
87
|
+
pools: Iterable[cluster_create_params.Pool],
|
|
88
|
+
version: str,
|
|
89
|
+
authentication: Optional[cluster_create_params.Authentication] | NotGiven = NOT_GIVEN,
|
|
90
|
+
autoscaler_config: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN,
|
|
91
|
+
cni: Optional[cluster_create_params.Cni] | NotGiven = NOT_GIVEN,
|
|
92
|
+
csi: cluster_create_params.Csi | NotGiven = NOT_GIVEN,
|
|
93
|
+
ddos_profile: Optional[cluster_create_params.DDOSProfile] | NotGiven = NOT_GIVEN,
|
|
94
|
+
fixed_network: Optional[str] | NotGiven = NOT_GIVEN,
|
|
95
|
+
fixed_subnet: Optional[str] | NotGiven = NOT_GIVEN,
|
|
96
|
+
is_ipv6: Optional[bool] | NotGiven = NOT_GIVEN,
|
|
97
|
+
logging: Optional[cluster_create_params.Logging] | NotGiven = NOT_GIVEN,
|
|
98
|
+
pods_ip_pool: Optional[str] | NotGiven = NOT_GIVEN,
|
|
99
|
+
pods_ipv6_pool: Optional[str] | NotGiven = NOT_GIVEN,
|
|
100
|
+
services_ip_pool: Optional[str] | NotGiven = NOT_GIVEN,
|
|
101
|
+
services_ipv6_pool: Optional[str] | NotGiven = NOT_GIVEN,
|
|
102
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
103
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
104
|
+
extra_headers: Headers | None = None,
|
|
105
|
+
extra_query: Query | None = None,
|
|
106
|
+
extra_body: Body | None = None,
|
|
107
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
108
|
+
) -> TaskIDList:
|
|
109
|
+
"""
|
|
110
|
+
Create k8s cluster
|
|
111
|
+
|
|
112
|
+
Args:
|
|
113
|
+
keypair: The keypair of the cluster
|
|
114
|
+
|
|
115
|
+
name: The name of the cluster
|
|
116
|
+
|
|
117
|
+
pools: The pools of the cluster
|
|
118
|
+
|
|
119
|
+
version: The version of the k8s cluster
|
|
120
|
+
|
|
121
|
+
authentication: Authentication settings
|
|
122
|
+
|
|
123
|
+
autoscaler_config: Cluster autoscaler configuration. It allows you to override the default
|
|
124
|
+
cluster-autoscaler parameters provided by the platform with your preferred
|
|
125
|
+
values. Supported parameters (in alphabetical order):
|
|
126
|
+
|
|
127
|
+
- balance-similar-node-groups (boolean: true/false) - Detect similar node groups
|
|
128
|
+
and balance the number of nodes between them.
|
|
129
|
+
- expander (string: random, most-pods, least-waste, price, priority, grpc) -
|
|
130
|
+
Type of node group expander to be used in scale up. Specifying multiple values
|
|
131
|
+
separated by commas will call the expanders in succession until there is only
|
|
132
|
+
one option remaining.
|
|
133
|
+
- expendable-pods-priority-cutoff (float) - Pods with priority below cutoff will
|
|
134
|
+
be expendable. They can be killed without any consideration during scale down
|
|
135
|
+
and they don't cause scale up. Pods with null priority (PodPriority disabled)
|
|
136
|
+
are non expendable.
|
|
137
|
+
- ignore-daemonsets-utilization (boolean: true/false) - Should CA ignore
|
|
138
|
+
DaemonSet pods when calculating resource utilization for scaling down.
|
|
139
|
+
- max-empty-bulk-delete (integer) - Maximum number of empty nodes that can be
|
|
140
|
+
deleted at the same time.
|
|
141
|
+
- max-graceful-termination-sec (integer) - Maximum number of seconds CA waits
|
|
142
|
+
for pod termination when trying to scale down a node.
|
|
143
|
+
- max-node-provision-time (duration: e.g., '15m') - The default maximum time CA
|
|
144
|
+
waits for node to be provisioned - the value can be overridden per node group.
|
|
145
|
+
- max-total-unready-percentage (float) - Maximum percentage of unready nodes in
|
|
146
|
+
the cluster. After this is exceeded, CA halts operations.
|
|
147
|
+
- new-pod-scale-up-delay (duration: e.g., '10s') - Pods less than this old will
|
|
148
|
+
not be considered for scale-up. Can be increased for individual pods through
|
|
149
|
+
annotation.
|
|
150
|
+
- ok-total-unready-count (integer) - Number of allowed unready nodes,
|
|
151
|
+
irrespective of max-total-unready-percentage.
|
|
152
|
+
- scale-down-delay-after-add (duration: e.g., '10m') - How long after scale up
|
|
153
|
+
that scale down evaluation resumes.
|
|
154
|
+
- scale-down-delay-after-delete (duration: e.g., '10s') - How long after node
|
|
155
|
+
deletion that scale down evaluation resumes.
|
|
156
|
+
- scale-down-delay-after-failure (duration: e.g., '3m') - How long after scale
|
|
157
|
+
down failure that scale down evaluation resumes.
|
|
158
|
+
- scale-down-enabled (boolean: true/false) - Should CA scale down the cluster.
|
|
159
|
+
- scale-down-unneeded-time (duration: e.g., '10m') - How long a node should be
|
|
160
|
+
unneeded before it is eligible for scale down.
|
|
161
|
+
- scale-down-unready-time (duration: e.g., '20m') - How long an unready node
|
|
162
|
+
should be unneeded before it is eligible for scale down.
|
|
163
|
+
- scale-down-utilization-threshold (float) - The maximum value between the sum
|
|
164
|
+
of cpu requests and sum of memory requests of all pods running on the node
|
|
165
|
+
divided by node's corresponding allocatable resource, below which a node can
|
|
166
|
+
be considered for scale down.
|
|
167
|
+
- scan-interval (duration: e.g., '10s') - How often cluster is reevaluated for
|
|
168
|
+
scale up or down.
|
|
169
|
+
- skip-nodes-with-custom-controller-pods (boolean: true/false) - If true cluster
|
|
170
|
+
autoscaler will never delete nodes with pods owned by custom controllers.
|
|
171
|
+
- skip-nodes-with-local-storage (boolean: true/false) - If true cluster
|
|
172
|
+
autoscaler will never delete nodes with pods with local storage, e.g. EmptyDir
|
|
173
|
+
or HostPath.
|
|
174
|
+
- skip-nodes-with-system-pods (boolean: true/false) - If true cluster autoscaler
|
|
175
|
+
will never delete nodes with pods from kube-system (except for DaemonSet or
|
|
176
|
+
mirror pods).
|
|
177
|
+
|
|
178
|
+
cni: Cluster CNI settings
|
|
179
|
+
|
|
180
|
+
csi: Container Storage Interface (CSI) driver settings
|
|
181
|
+
|
|
182
|
+
ddos_profile: Advanced DDoS Protection profile
|
|
183
|
+
|
|
184
|
+
fixed_network: The network of the cluster
|
|
185
|
+
|
|
186
|
+
fixed_subnet: The subnet of the cluster
|
|
187
|
+
|
|
188
|
+
is_ipv6: Enable public v6 address
|
|
189
|
+
|
|
190
|
+
logging: Logging configuration
|
|
191
|
+
|
|
192
|
+
pods_ip_pool: The IP pool for the pods
|
|
193
|
+
|
|
194
|
+
pods_ipv6_pool: The IPv6 pool for the pods
|
|
195
|
+
|
|
196
|
+
services_ip_pool: The IP pool for the services
|
|
197
|
+
|
|
198
|
+
services_ipv6_pool: The IPv6 pool for the services
|
|
199
|
+
|
|
200
|
+
extra_headers: Send extra headers
|
|
201
|
+
|
|
202
|
+
extra_query: Add additional query parameters to the request
|
|
203
|
+
|
|
204
|
+
extra_body: Add additional JSON properties to the request
|
|
205
|
+
|
|
206
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
207
|
+
"""
|
|
208
|
+
if project_id is None:
|
|
209
|
+
project_id = self._client._get_cloud_project_id_path_param()
|
|
210
|
+
if region_id is None:
|
|
211
|
+
region_id = self._client._get_cloud_region_id_path_param()
|
|
212
|
+
return self._post(
|
|
213
|
+
f"/cloud/v2/k8s/clusters/{project_id}/{region_id}",
|
|
214
|
+
body=maybe_transform(
|
|
215
|
+
{
|
|
216
|
+
"keypair": keypair,
|
|
217
|
+
"name": name,
|
|
218
|
+
"pools": pools,
|
|
219
|
+
"version": version,
|
|
220
|
+
"authentication": authentication,
|
|
221
|
+
"autoscaler_config": autoscaler_config,
|
|
222
|
+
"cni": cni,
|
|
223
|
+
"csi": csi,
|
|
224
|
+
"ddos_profile": ddos_profile,
|
|
225
|
+
"fixed_network": fixed_network,
|
|
226
|
+
"fixed_subnet": fixed_subnet,
|
|
227
|
+
"is_ipv6": is_ipv6,
|
|
228
|
+
"logging": logging,
|
|
229
|
+
"pods_ip_pool": pods_ip_pool,
|
|
230
|
+
"pods_ipv6_pool": pods_ipv6_pool,
|
|
231
|
+
"services_ip_pool": services_ip_pool,
|
|
232
|
+
"services_ipv6_pool": services_ipv6_pool,
|
|
233
|
+
},
|
|
234
|
+
cluster_create_params.ClusterCreateParams,
|
|
235
|
+
),
|
|
236
|
+
options=make_request_options(
|
|
237
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
238
|
+
),
|
|
239
|
+
cast_to=TaskIDList,
|
|
240
|
+
)
|
|
241
|
+
|
|
242
|
+
def update(
|
|
243
|
+
self,
|
|
244
|
+
cluster_name: str,
|
|
245
|
+
*,
|
|
246
|
+
project_id: int | None = None,
|
|
247
|
+
region_id: int | None = None,
|
|
248
|
+
authentication: Optional[cluster_update_params.Authentication] | NotGiven = NOT_GIVEN,
|
|
249
|
+
autoscaler_config: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN,
|
|
250
|
+
cni: Optional[cluster_update_params.Cni] | NotGiven = NOT_GIVEN,
|
|
251
|
+
ddos_profile: Optional[cluster_update_params.DDOSProfile] | NotGiven = NOT_GIVEN,
|
|
252
|
+
logging: Optional[cluster_update_params.Logging] | NotGiven = NOT_GIVEN,
|
|
253
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
254
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
255
|
+
extra_headers: Headers | None = None,
|
|
256
|
+
extra_query: Query | None = None,
|
|
257
|
+
extra_body: Body | None = None,
|
|
258
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
259
|
+
) -> TaskIDList:
|
|
260
|
+
"""
|
|
261
|
+
Update k8s cluster
|
|
262
|
+
|
|
263
|
+
Args:
|
|
264
|
+
authentication: Authentication settings
|
|
265
|
+
|
|
266
|
+
autoscaler_config: Cluster autoscaler configuration. It allows you to override the default
|
|
267
|
+
cluster-autoscaler parameters provided by the platform with your preferred
|
|
268
|
+
values. Supported parameters (in alphabetical order):
|
|
269
|
+
|
|
270
|
+
- balance-similar-node-groups (boolean: true/false) - Detect similar node groups
|
|
271
|
+
and balance the number of nodes between them.
|
|
272
|
+
- expander (string: random, most-pods, least-waste, price, priority, grpc) -
|
|
273
|
+
Type of node group expander to be used in scale up. Specifying multiple values
|
|
274
|
+
separated by commas will call the expanders in succession until there is only
|
|
275
|
+
one option remaining.
|
|
276
|
+
- expendable-pods-priority-cutoff (float) - Pods with priority below cutoff will
|
|
277
|
+
be expendable. They can be killed without any consideration during scale down
|
|
278
|
+
and they don't cause scale up. Pods with null priority (PodPriority disabled)
|
|
279
|
+
are non expendable.
|
|
280
|
+
- ignore-daemonsets-utilization (boolean: true/false) - Should CA ignore
|
|
281
|
+
DaemonSet pods when calculating resource utilization for scaling down.
|
|
282
|
+
- max-empty-bulk-delete (integer) - Maximum number of empty nodes that can be
|
|
283
|
+
deleted at the same time.
|
|
284
|
+
- max-graceful-termination-sec (integer) - Maximum number of seconds CA waits
|
|
285
|
+
for pod termination when trying to scale down a node.
|
|
286
|
+
- max-node-provision-time (duration: e.g., '15m') - The default maximum time CA
|
|
287
|
+
waits for node to be provisioned - the value can be overridden per node group.
|
|
288
|
+
- max-total-unready-percentage (float) - Maximum percentage of unready nodes in
|
|
289
|
+
the cluster. After this is exceeded, CA halts operations.
|
|
290
|
+
- new-pod-scale-up-delay (duration: e.g., '10s') - Pods less than this old will
|
|
291
|
+
not be considered for scale-up. Can be increased for individual pods through
|
|
292
|
+
annotation.
|
|
293
|
+
- ok-total-unready-count (integer) - Number of allowed unready nodes,
|
|
294
|
+
irrespective of max-total-unready-percentage.
|
|
295
|
+
- scale-down-delay-after-add (duration: e.g., '10m') - How long after scale up
|
|
296
|
+
that scale down evaluation resumes.
|
|
297
|
+
- scale-down-delay-after-delete (duration: e.g., '10s') - How long after node
|
|
298
|
+
deletion that scale down evaluation resumes.
|
|
299
|
+
- scale-down-delay-after-failure (duration: e.g., '3m') - How long after scale
|
|
300
|
+
down failure that scale down evaluation resumes.
|
|
301
|
+
- scale-down-enabled (boolean: true/false) - Should CA scale down the cluster.
|
|
302
|
+
- scale-down-unneeded-time (duration: e.g., '10m') - How long a node should be
|
|
303
|
+
unneeded before it is eligible for scale down.
|
|
304
|
+
- scale-down-unready-time (duration: e.g., '20m') - How long an unready node
|
|
305
|
+
should be unneeded before it is eligible for scale down.
|
|
306
|
+
- scale-down-utilization-threshold (float) - The maximum value between the sum
|
|
307
|
+
of cpu requests and sum of memory requests of all pods running on the node
|
|
308
|
+
divided by node's corresponding allocatable resource, below which a node can
|
|
309
|
+
be considered for scale down.
|
|
310
|
+
- scan-interval (duration: e.g., '10s') - How often cluster is reevaluated for
|
|
311
|
+
scale up or down.
|
|
312
|
+
- skip-nodes-with-custom-controller-pods (boolean: true/false) - If true cluster
|
|
313
|
+
autoscaler will never delete nodes with pods owned by custom controllers.
|
|
314
|
+
- skip-nodes-with-local-storage (boolean: true/false) - If true cluster
|
|
315
|
+
autoscaler will never delete nodes with pods with local storage, e.g. EmptyDir
|
|
316
|
+
or HostPath.
|
|
317
|
+
- skip-nodes-with-system-pods (boolean: true/false) - If true cluster autoscaler
|
|
318
|
+
will never delete nodes with pods from kube-system (except for DaemonSet or
|
|
319
|
+
mirror pods).
|
|
320
|
+
|
|
321
|
+
cni: Cluster CNI settings
|
|
322
|
+
|
|
323
|
+
ddos_profile: Advanced DDoS Protection profile
|
|
324
|
+
|
|
325
|
+
logging: Logging configuration
|
|
326
|
+
|
|
327
|
+
extra_headers: Send extra headers
|
|
328
|
+
|
|
329
|
+
extra_query: Add additional query parameters to the request
|
|
330
|
+
|
|
331
|
+
extra_body: Add additional JSON properties to the request
|
|
332
|
+
|
|
333
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
334
|
+
"""
|
|
335
|
+
if project_id is None:
|
|
336
|
+
project_id = self._client._get_cloud_project_id_path_param()
|
|
337
|
+
if region_id is None:
|
|
338
|
+
region_id = self._client._get_cloud_region_id_path_param()
|
|
339
|
+
if not cluster_name:
|
|
340
|
+
raise ValueError(f"Expected a non-empty value for `cluster_name` but received {cluster_name!r}")
|
|
341
|
+
return self._patch(
|
|
342
|
+
f"/cloud/v2/k8s/clusters/{project_id}/{region_id}/{cluster_name}",
|
|
343
|
+
body=maybe_transform(
|
|
344
|
+
{
|
|
345
|
+
"authentication": authentication,
|
|
346
|
+
"autoscaler_config": autoscaler_config,
|
|
347
|
+
"cni": cni,
|
|
348
|
+
"ddos_profile": ddos_profile,
|
|
349
|
+
"logging": logging,
|
|
350
|
+
},
|
|
351
|
+
cluster_update_params.ClusterUpdateParams,
|
|
352
|
+
),
|
|
353
|
+
options=make_request_options(
|
|
354
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
355
|
+
),
|
|
356
|
+
cast_to=TaskIDList,
|
|
357
|
+
)
|
|
358
|
+
|
|
359
|
+
def list(
|
|
360
|
+
self,
|
|
361
|
+
*,
|
|
362
|
+
project_id: int | None = None,
|
|
363
|
+
region_id: int | None = None,
|
|
364
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
365
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
366
|
+
extra_headers: Headers | None = None,
|
|
367
|
+
extra_query: Query | None = None,
|
|
368
|
+
extra_body: Body | None = None,
|
|
369
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
370
|
+
) -> K8sClusterList:
|
|
371
|
+
"""
|
|
372
|
+
List k8s clusters
|
|
373
|
+
|
|
374
|
+
Args:
|
|
375
|
+
extra_headers: Send extra headers
|
|
376
|
+
|
|
377
|
+
extra_query: Add additional query parameters to the request
|
|
378
|
+
|
|
379
|
+
extra_body: Add additional JSON properties to the request
|
|
380
|
+
|
|
381
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
382
|
+
"""
|
|
383
|
+
if project_id is None:
|
|
384
|
+
project_id = self._client._get_cloud_project_id_path_param()
|
|
385
|
+
if region_id is None:
|
|
386
|
+
region_id = self._client._get_cloud_region_id_path_param()
|
|
387
|
+
return self._get(
|
|
388
|
+
f"/cloud/v2/k8s/clusters/{project_id}/{region_id}",
|
|
389
|
+
options=make_request_options(
|
|
390
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
391
|
+
),
|
|
392
|
+
cast_to=K8sClusterList,
|
|
393
|
+
)
|
|
394
|
+
|
|
395
|
+
def delete(
|
|
396
|
+
self,
|
|
397
|
+
cluster_name: str,
|
|
398
|
+
*,
|
|
399
|
+
project_id: int | None = None,
|
|
400
|
+
region_id: int | None = None,
|
|
401
|
+
volumes: str | NotGiven = NOT_GIVEN,
|
|
402
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
403
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
404
|
+
extra_headers: Headers | None = None,
|
|
405
|
+
extra_query: Query | None = None,
|
|
406
|
+
extra_body: Body | None = None,
|
|
407
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
408
|
+
) -> TaskIDList:
|
|
409
|
+
"""
|
|
410
|
+
Delete k8s cluster
|
|
411
|
+
|
|
412
|
+
Args:
|
|
413
|
+
volumes: Comma separated list of volume IDs to be deleted with the cluster
|
|
414
|
+
|
|
415
|
+
extra_headers: Send extra headers
|
|
416
|
+
|
|
417
|
+
extra_query: Add additional query parameters to the request
|
|
418
|
+
|
|
419
|
+
extra_body: Add additional JSON properties to the request
|
|
420
|
+
|
|
421
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
422
|
+
"""
|
|
423
|
+
if project_id is None:
|
|
424
|
+
project_id = self._client._get_cloud_project_id_path_param()
|
|
425
|
+
if region_id is None:
|
|
426
|
+
region_id = self._client._get_cloud_region_id_path_param()
|
|
427
|
+
if not cluster_name:
|
|
428
|
+
raise ValueError(f"Expected a non-empty value for `cluster_name` but received {cluster_name!r}")
|
|
429
|
+
return self._delete(
|
|
430
|
+
f"/cloud/v2/k8s/clusters/{project_id}/{region_id}/{cluster_name}",
|
|
431
|
+
options=make_request_options(
|
|
432
|
+
extra_headers=extra_headers,
|
|
433
|
+
extra_query=extra_query,
|
|
434
|
+
extra_body=extra_body,
|
|
435
|
+
timeout=timeout,
|
|
436
|
+
query=maybe_transform({"volumes": volumes}, cluster_delete_params.ClusterDeleteParams),
|
|
437
|
+
),
|
|
438
|
+
cast_to=TaskIDList,
|
|
439
|
+
)
|
|
440
|
+
|
|
441
|
+
def get(
|
|
442
|
+
self,
|
|
443
|
+
cluster_name: str,
|
|
444
|
+
*,
|
|
445
|
+
project_id: int | None = None,
|
|
446
|
+
region_id: int | None = None,
|
|
447
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
448
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
449
|
+
extra_headers: Headers | None = None,
|
|
450
|
+
extra_query: Query | None = None,
|
|
451
|
+
extra_body: Body | None = None,
|
|
452
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
453
|
+
) -> K8sCluster:
|
|
454
|
+
"""
|
|
455
|
+
Get k8s cluster
|
|
456
|
+
|
|
457
|
+
Args:
|
|
458
|
+
extra_headers: Send extra headers
|
|
459
|
+
|
|
460
|
+
extra_query: Add additional query parameters to the request
|
|
461
|
+
|
|
462
|
+
extra_body: Add additional JSON properties to the request
|
|
463
|
+
|
|
464
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
465
|
+
"""
|
|
466
|
+
if project_id is None:
|
|
467
|
+
project_id = self._client._get_cloud_project_id_path_param()
|
|
468
|
+
if region_id is None:
|
|
469
|
+
region_id = self._client._get_cloud_region_id_path_param()
|
|
470
|
+
if not cluster_name:
|
|
471
|
+
raise ValueError(f"Expected a non-empty value for `cluster_name` but received {cluster_name!r}")
|
|
472
|
+
return self._get(
|
|
473
|
+
f"/cloud/v2/k8s/clusters/{project_id}/{region_id}/{cluster_name}",
|
|
474
|
+
options=make_request_options(
|
|
475
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
476
|
+
),
|
|
477
|
+
cast_to=K8sCluster,
|
|
478
|
+
)
|
|
479
|
+
|
|
480
|
+
def get_certificate(
|
|
481
|
+
self,
|
|
482
|
+
cluster_name: str,
|
|
483
|
+
*,
|
|
484
|
+
project_id: int | None = None,
|
|
485
|
+
region_id: int | None = None,
|
|
486
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
487
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
488
|
+
extra_headers: Headers | None = None,
|
|
489
|
+
extra_query: Query | None = None,
|
|
490
|
+
extra_body: Body | None = None,
|
|
491
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
492
|
+
) -> K8sClusterCertificate:
|
|
493
|
+
"""
|
|
494
|
+
Get k8s cluster CA certificate
|
|
495
|
+
|
|
496
|
+
Args:
|
|
497
|
+
extra_headers: Send extra headers
|
|
498
|
+
|
|
499
|
+
extra_query: Add additional query parameters to the request
|
|
500
|
+
|
|
501
|
+
extra_body: Add additional JSON properties to the request
|
|
502
|
+
|
|
503
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
504
|
+
"""
|
|
505
|
+
if project_id is None:
|
|
506
|
+
project_id = self._client._get_cloud_project_id_path_param()
|
|
507
|
+
if region_id is None:
|
|
508
|
+
region_id = self._client._get_cloud_region_id_path_param()
|
|
509
|
+
if not cluster_name:
|
|
510
|
+
raise ValueError(f"Expected a non-empty value for `cluster_name` but received {cluster_name!r}")
|
|
511
|
+
return self._get(
|
|
512
|
+
f"/cloud/v2/k8s/clusters/{project_id}/{region_id}/{cluster_name}/certificates",
|
|
513
|
+
options=make_request_options(
|
|
514
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
515
|
+
),
|
|
516
|
+
cast_to=K8sClusterCertificate,
|
|
517
|
+
)
|
|
518
|
+
|
|
519
|
+
def get_kubeconfig(
|
|
520
|
+
self,
|
|
521
|
+
cluster_name: str,
|
|
522
|
+
*,
|
|
523
|
+
project_id: int | None = None,
|
|
524
|
+
region_id: int | None = None,
|
|
525
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
526
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
527
|
+
extra_headers: Headers | None = None,
|
|
528
|
+
extra_query: Query | None = None,
|
|
529
|
+
extra_body: Body | None = None,
|
|
530
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
531
|
+
) -> K8sClusterKubeconfig:
|
|
532
|
+
"""
|
|
533
|
+
Get k8s cluster kubeconfig
|
|
534
|
+
|
|
535
|
+
Args:
|
|
536
|
+
extra_headers: Send extra headers
|
|
537
|
+
|
|
538
|
+
extra_query: Add additional query parameters to the request
|
|
539
|
+
|
|
540
|
+
extra_body: Add additional JSON properties to the request
|
|
541
|
+
|
|
542
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
543
|
+
"""
|
|
544
|
+
if project_id is None:
|
|
545
|
+
project_id = self._client._get_cloud_project_id_path_param()
|
|
546
|
+
if region_id is None:
|
|
547
|
+
region_id = self._client._get_cloud_region_id_path_param()
|
|
548
|
+
if not cluster_name:
|
|
549
|
+
raise ValueError(f"Expected a non-empty value for `cluster_name` but received {cluster_name!r}")
|
|
550
|
+
return self._get(
|
|
551
|
+
f"/cloud/v2/k8s/clusters/{project_id}/{region_id}/{cluster_name}/config",
|
|
552
|
+
options=make_request_options(
|
|
553
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
554
|
+
),
|
|
555
|
+
cast_to=K8sClusterKubeconfig,
|
|
556
|
+
)
|
|
557
|
+
|
|
558
|
+
def list_versions_for_upgrade(
|
|
559
|
+
self,
|
|
560
|
+
cluster_name: str,
|
|
561
|
+
*,
|
|
562
|
+
project_id: int | None = None,
|
|
563
|
+
region_id: int | None = None,
|
|
564
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
565
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
566
|
+
extra_headers: Headers | None = None,
|
|
567
|
+
extra_query: Query | None = None,
|
|
568
|
+
extra_body: Body | None = None,
|
|
569
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
570
|
+
) -> K8sClusterVersionList:
|
|
571
|
+
"""
|
|
572
|
+
List available k8s cluster versions for upgrade
|
|
573
|
+
|
|
574
|
+
Args:
|
|
575
|
+
extra_headers: Send extra headers
|
|
576
|
+
|
|
577
|
+
extra_query: Add additional query parameters to the request
|
|
578
|
+
|
|
579
|
+
extra_body: Add additional JSON properties to the request
|
|
580
|
+
|
|
581
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
582
|
+
"""
|
|
583
|
+
if project_id is None:
|
|
584
|
+
project_id = self._client._get_cloud_project_id_path_param()
|
|
585
|
+
if region_id is None:
|
|
586
|
+
region_id = self._client._get_cloud_region_id_path_param()
|
|
587
|
+
if not cluster_name:
|
|
588
|
+
raise ValueError(f"Expected a non-empty value for `cluster_name` but received {cluster_name!r}")
|
|
589
|
+
return self._get(
|
|
590
|
+
f"/cloud/v2/k8s/clusters/{project_id}/{region_id}/{cluster_name}/upgrade_versions",
|
|
591
|
+
options=make_request_options(
|
|
592
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
593
|
+
),
|
|
594
|
+
cast_to=K8sClusterVersionList,
|
|
595
|
+
)
|
|
596
|
+
|
|
597
|
+
def upgrade(
|
|
598
|
+
self,
|
|
599
|
+
cluster_name: str,
|
|
600
|
+
*,
|
|
601
|
+
project_id: int | None = None,
|
|
602
|
+
region_id: int | None = None,
|
|
603
|
+
version: str,
|
|
604
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
605
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
606
|
+
extra_headers: Headers | None = None,
|
|
607
|
+
extra_query: Query | None = None,
|
|
608
|
+
extra_body: Body | None = None,
|
|
609
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
610
|
+
) -> TaskIDList:
|
|
611
|
+
"""
|
|
612
|
+
Upgrade k8s cluster
|
|
613
|
+
|
|
614
|
+
Args:
|
|
615
|
+
version: Target k8s cluster version
|
|
616
|
+
|
|
617
|
+
extra_headers: Send extra headers
|
|
618
|
+
|
|
619
|
+
extra_query: Add additional query parameters to the request
|
|
620
|
+
|
|
621
|
+
extra_body: Add additional JSON properties to the request
|
|
622
|
+
|
|
623
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
624
|
+
"""
|
|
625
|
+
if project_id is None:
|
|
626
|
+
project_id = self._client._get_cloud_project_id_path_param()
|
|
627
|
+
if region_id is None:
|
|
628
|
+
region_id = self._client._get_cloud_region_id_path_param()
|
|
629
|
+
if not cluster_name:
|
|
630
|
+
raise ValueError(f"Expected a non-empty value for `cluster_name` but received {cluster_name!r}")
|
|
631
|
+
return self._post(
|
|
632
|
+
f"/cloud/v2/k8s/clusters/{project_id}/{region_id}/{cluster_name}/upgrade",
|
|
633
|
+
body=maybe_transform({"version": version}, cluster_upgrade_params.ClusterUpgradeParams),
|
|
634
|
+
options=make_request_options(
|
|
635
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
636
|
+
),
|
|
637
|
+
cast_to=TaskIDList,
|
|
638
|
+
)
|
|
639
|
+
|
|
640
|
+
|
|
641
|
+
class AsyncClustersResource(AsyncAPIResource):
|
|
642
|
+
@cached_property
|
|
643
|
+
def nodes(self) -> AsyncNodesResource:
|
|
644
|
+
return AsyncNodesResource(self._client)
|
|
645
|
+
|
|
646
|
+
@cached_property
|
|
647
|
+
def pools(self) -> AsyncPoolsResource:
|
|
648
|
+
return AsyncPoolsResource(self._client)
|
|
649
|
+
|
|
650
|
+
@cached_property
|
|
651
|
+
def with_raw_response(self) -> AsyncClustersResourceWithRawResponse:
|
|
652
|
+
"""
|
|
653
|
+
This property can be used as a prefix for any HTTP method call to return
|
|
654
|
+
the raw response object instead of the parsed content.
|
|
655
|
+
|
|
656
|
+
For more information, see https://www.github.com/G-Core/gcore-python#accessing-raw-response-data-eg-headers
|
|
657
|
+
"""
|
|
658
|
+
return AsyncClustersResourceWithRawResponse(self)
|
|
659
|
+
|
|
660
|
+
@cached_property
|
|
661
|
+
def with_streaming_response(self) -> AsyncClustersResourceWithStreamingResponse:
|
|
662
|
+
"""
|
|
663
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
664
|
+
|
|
665
|
+
For more information, see https://www.github.com/G-Core/gcore-python#with_streaming_response
|
|
666
|
+
"""
|
|
667
|
+
return AsyncClustersResourceWithStreamingResponse(self)
|
|
668
|
+
|
|
669
|
+
async def create(
|
|
670
|
+
self,
|
|
671
|
+
*,
|
|
672
|
+
project_id: int | None = None,
|
|
673
|
+
region_id: int | None = None,
|
|
674
|
+
keypair: str,
|
|
675
|
+
name: str,
|
|
676
|
+
pools: Iterable[cluster_create_params.Pool],
|
|
677
|
+
version: str,
|
|
678
|
+
authentication: Optional[cluster_create_params.Authentication] | NotGiven = NOT_GIVEN,
|
|
679
|
+
autoscaler_config: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN,
|
|
680
|
+
cni: Optional[cluster_create_params.Cni] | NotGiven = NOT_GIVEN,
|
|
681
|
+
csi: cluster_create_params.Csi | NotGiven = NOT_GIVEN,
|
|
682
|
+
ddos_profile: Optional[cluster_create_params.DDOSProfile] | NotGiven = NOT_GIVEN,
|
|
683
|
+
fixed_network: Optional[str] | NotGiven = NOT_GIVEN,
|
|
684
|
+
fixed_subnet: Optional[str] | NotGiven = NOT_GIVEN,
|
|
685
|
+
is_ipv6: Optional[bool] | NotGiven = NOT_GIVEN,
|
|
686
|
+
logging: Optional[cluster_create_params.Logging] | NotGiven = NOT_GIVEN,
|
|
687
|
+
pods_ip_pool: Optional[str] | NotGiven = NOT_GIVEN,
|
|
688
|
+
pods_ipv6_pool: Optional[str] | NotGiven = NOT_GIVEN,
|
|
689
|
+
services_ip_pool: Optional[str] | NotGiven = NOT_GIVEN,
|
|
690
|
+
services_ipv6_pool: Optional[str] | NotGiven = NOT_GIVEN,
|
|
691
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
692
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
693
|
+
extra_headers: Headers | None = None,
|
|
694
|
+
extra_query: Query | None = None,
|
|
695
|
+
extra_body: Body | None = None,
|
|
696
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
697
|
+
) -> TaskIDList:
|
|
698
|
+
"""
|
|
699
|
+
Create k8s cluster
|
|
700
|
+
|
|
701
|
+
Args:
|
|
702
|
+
keypair: The keypair of the cluster
|
|
703
|
+
|
|
704
|
+
name: The name of the cluster
|
|
705
|
+
|
|
706
|
+
pools: The pools of the cluster
|
|
707
|
+
|
|
708
|
+
version: The version of the k8s cluster
|
|
709
|
+
|
|
710
|
+
authentication: Authentication settings
|
|
711
|
+
|
|
712
|
+
autoscaler_config: Cluster autoscaler configuration. It allows you to override the default
|
|
713
|
+
cluster-autoscaler parameters provided by the platform with your preferred
|
|
714
|
+
values. Supported parameters (in alphabetical order):
|
|
715
|
+
|
|
716
|
+
- balance-similar-node-groups (boolean: true/false) - Detect similar node groups
|
|
717
|
+
and balance the number of nodes between them.
|
|
718
|
+
- expander (string: random, most-pods, least-waste, price, priority, grpc) -
|
|
719
|
+
Type of node group expander to be used in scale up. Specifying multiple values
|
|
720
|
+
separated by commas will call the expanders in succession until there is only
|
|
721
|
+
one option remaining.
|
|
722
|
+
- expendable-pods-priority-cutoff (float) - Pods with priority below cutoff will
|
|
723
|
+
be expendable. They can be killed without any consideration during scale down
|
|
724
|
+
and they don't cause scale up. Pods with null priority (PodPriority disabled)
|
|
725
|
+
are non expendable.
|
|
726
|
+
- ignore-daemonsets-utilization (boolean: true/false) - Should CA ignore
|
|
727
|
+
DaemonSet pods when calculating resource utilization for scaling down.
|
|
728
|
+
- max-empty-bulk-delete (integer) - Maximum number of empty nodes that can be
|
|
729
|
+
deleted at the same time.
|
|
730
|
+
- max-graceful-termination-sec (integer) - Maximum number of seconds CA waits
|
|
731
|
+
for pod termination when trying to scale down a node.
|
|
732
|
+
- max-node-provision-time (duration: e.g., '15m') - The default maximum time CA
|
|
733
|
+
waits for node to be provisioned - the value can be overridden per node group.
|
|
734
|
+
- max-total-unready-percentage (float) - Maximum percentage of unready nodes in
|
|
735
|
+
the cluster. After this is exceeded, CA halts operations.
|
|
736
|
+
- new-pod-scale-up-delay (duration: e.g., '10s') - Pods less than this old will
|
|
737
|
+
not be considered for scale-up. Can be increased for individual pods through
|
|
738
|
+
annotation.
|
|
739
|
+
- ok-total-unready-count (integer) - Number of allowed unready nodes,
|
|
740
|
+
irrespective of max-total-unready-percentage.
|
|
741
|
+
- scale-down-delay-after-add (duration: e.g., '10m') - How long after scale up
|
|
742
|
+
that scale down evaluation resumes.
|
|
743
|
+
- scale-down-delay-after-delete (duration: e.g., '10s') - How long after node
|
|
744
|
+
deletion that scale down evaluation resumes.
|
|
745
|
+
- scale-down-delay-after-failure (duration: e.g., '3m') - How long after scale
|
|
746
|
+
down failure that scale down evaluation resumes.
|
|
747
|
+
- scale-down-enabled (boolean: true/false) - Should CA scale down the cluster.
|
|
748
|
+
- scale-down-unneeded-time (duration: e.g., '10m') - How long a node should be
|
|
749
|
+
unneeded before it is eligible for scale down.
|
|
750
|
+
- scale-down-unready-time (duration: e.g., '20m') - How long an unready node
|
|
751
|
+
should be unneeded before it is eligible for scale down.
|
|
752
|
+
- scale-down-utilization-threshold (float) - The maximum value between the sum
|
|
753
|
+
of cpu requests and sum of memory requests of all pods running on the node
|
|
754
|
+
divided by node's corresponding allocatable resource, below which a node can
|
|
755
|
+
be considered for scale down.
|
|
756
|
+
- scan-interval (duration: e.g., '10s') - How often cluster is reevaluated for
|
|
757
|
+
scale up or down.
|
|
758
|
+
- skip-nodes-with-custom-controller-pods (boolean: true/false) - If true cluster
|
|
759
|
+
autoscaler will never delete nodes with pods owned by custom controllers.
|
|
760
|
+
- skip-nodes-with-local-storage (boolean: true/false) - If true cluster
|
|
761
|
+
autoscaler will never delete nodes with pods with local storage, e.g. EmptyDir
|
|
762
|
+
or HostPath.
|
|
763
|
+
- skip-nodes-with-system-pods (boolean: true/false) - If true cluster autoscaler
|
|
764
|
+
will never delete nodes with pods from kube-system (except for DaemonSet or
|
|
765
|
+
mirror pods).
|
|
766
|
+
|
|
767
|
+
cni: Cluster CNI settings
|
|
768
|
+
|
|
769
|
+
csi: Container Storage Interface (CSI) driver settings
|
|
770
|
+
|
|
771
|
+
ddos_profile: Advanced DDoS Protection profile
|
|
772
|
+
|
|
773
|
+
fixed_network: The network of the cluster
|
|
774
|
+
|
|
775
|
+
fixed_subnet: The subnet of the cluster
|
|
776
|
+
|
|
777
|
+
is_ipv6: Enable public v6 address
|
|
778
|
+
|
|
779
|
+
logging: Logging configuration
|
|
780
|
+
|
|
781
|
+
pods_ip_pool: The IP pool for the pods
|
|
782
|
+
|
|
783
|
+
pods_ipv6_pool: The IPv6 pool for the pods
|
|
784
|
+
|
|
785
|
+
services_ip_pool: The IP pool for the services
|
|
786
|
+
|
|
787
|
+
services_ipv6_pool: The IPv6 pool for the services
|
|
788
|
+
|
|
789
|
+
extra_headers: Send extra headers
|
|
790
|
+
|
|
791
|
+
extra_query: Add additional query parameters to the request
|
|
792
|
+
|
|
793
|
+
extra_body: Add additional JSON properties to the request
|
|
794
|
+
|
|
795
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
796
|
+
"""
|
|
797
|
+
if project_id is None:
|
|
798
|
+
project_id = self._client._get_cloud_project_id_path_param()
|
|
799
|
+
if region_id is None:
|
|
800
|
+
region_id = self._client._get_cloud_region_id_path_param()
|
|
801
|
+
return await self._post(
|
|
802
|
+
f"/cloud/v2/k8s/clusters/{project_id}/{region_id}",
|
|
803
|
+
body=await async_maybe_transform(
|
|
804
|
+
{
|
|
805
|
+
"keypair": keypair,
|
|
806
|
+
"name": name,
|
|
807
|
+
"pools": pools,
|
|
808
|
+
"version": version,
|
|
809
|
+
"authentication": authentication,
|
|
810
|
+
"autoscaler_config": autoscaler_config,
|
|
811
|
+
"cni": cni,
|
|
812
|
+
"csi": csi,
|
|
813
|
+
"ddos_profile": ddos_profile,
|
|
814
|
+
"fixed_network": fixed_network,
|
|
815
|
+
"fixed_subnet": fixed_subnet,
|
|
816
|
+
"is_ipv6": is_ipv6,
|
|
817
|
+
"logging": logging,
|
|
818
|
+
"pods_ip_pool": pods_ip_pool,
|
|
819
|
+
"pods_ipv6_pool": pods_ipv6_pool,
|
|
820
|
+
"services_ip_pool": services_ip_pool,
|
|
821
|
+
"services_ipv6_pool": services_ipv6_pool,
|
|
822
|
+
},
|
|
823
|
+
cluster_create_params.ClusterCreateParams,
|
|
824
|
+
),
|
|
825
|
+
options=make_request_options(
|
|
826
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
827
|
+
),
|
|
828
|
+
cast_to=TaskIDList,
|
|
829
|
+
)
|
|
830
|
+
|
|
831
|
+
async def update(
|
|
832
|
+
self,
|
|
833
|
+
cluster_name: str,
|
|
834
|
+
*,
|
|
835
|
+
project_id: int | None = None,
|
|
836
|
+
region_id: int | None = None,
|
|
837
|
+
authentication: Optional[cluster_update_params.Authentication] | NotGiven = NOT_GIVEN,
|
|
838
|
+
autoscaler_config: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN,
|
|
839
|
+
cni: Optional[cluster_update_params.Cni] | NotGiven = NOT_GIVEN,
|
|
840
|
+
ddos_profile: Optional[cluster_update_params.DDOSProfile] | NotGiven = NOT_GIVEN,
|
|
841
|
+
logging: Optional[cluster_update_params.Logging] | NotGiven = NOT_GIVEN,
|
|
842
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
843
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
844
|
+
extra_headers: Headers | None = None,
|
|
845
|
+
extra_query: Query | None = None,
|
|
846
|
+
extra_body: Body | None = None,
|
|
847
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
848
|
+
) -> TaskIDList:
|
|
849
|
+
"""
|
|
850
|
+
Update k8s cluster
|
|
851
|
+
|
|
852
|
+
Args:
|
|
853
|
+
authentication: Authentication settings
|
|
854
|
+
|
|
855
|
+
autoscaler_config: Cluster autoscaler configuration. It allows you to override the default
|
|
856
|
+
cluster-autoscaler parameters provided by the platform with your preferred
|
|
857
|
+
values. Supported parameters (in alphabetical order):
|
|
858
|
+
|
|
859
|
+
- balance-similar-node-groups (boolean: true/false) - Detect similar node groups
|
|
860
|
+
and balance the number of nodes between them.
|
|
861
|
+
- expander (string: random, most-pods, least-waste, price, priority, grpc) -
|
|
862
|
+
Type of node group expander to be used in scale up. Specifying multiple values
|
|
863
|
+
separated by commas will call the expanders in succession until there is only
|
|
864
|
+
one option remaining.
|
|
865
|
+
- expendable-pods-priority-cutoff (float) - Pods with priority below cutoff will
|
|
866
|
+
be expendable. They can be killed without any consideration during scale down
|
|
867
|
+
and they don't cause scale up. Pods with null priority (PodPriority disabled)
|
|
868
|
+
are non expendable.
|
|
869
|
+
- ignore-daemonsets-utilization (boolean: true/false) - Should CA ignore
|
|
870
|
+
DaemonSet pods when calculating resource utilization for scaling down.
|
|
871
|
+
- max-empty-bulk-delete (integer) - Maximum number of empty nodes that can be
|
|
872
|
+
deleted at the same time.
|
|
873
|
+
- max-graceful-termination-sec (integer) - Maximum number of seconds CA waits
|
|
874
|
+
for pod termination when trying to scale down a node.
|
|
875
|
+
- max-node-provision-time (duration: e.g., '15m') - The default maximum time CA
|
|
876
|
+
waits for node to be provisioned - the value can be overridden per node group.
|
|
877
|
+
- max-total-unready-percentage (float) - Maximum percentage of unready nodes in
|
|
878
|
+
the cluster. After this is exceeded, CA halts operations.
|
|
879
|
+
- new-pod-scale-up-delay (duration: e.g., '10s') - Pods less than this old will
|
|
880
|
+
not be considered for scale-up. Can be increased for individual pods through
|
|
881
|
+
annotation.
|
|
882
|
+
- ok-total-unready-count (integer) - Number of allowed unready nodes,
|
|
883
|
+
irrespective of max-total-unready-percentage.
|
|
884
|
+
- scale-down-delay-after-add (duration: e.g., '10m') - How long after scale up
|
|
885
|
+
that scale down evaluation resumes.
|
|
886
|
+
- scale-down-delay-after-delete (duration: e.g., '10s') - How long after node
|
|
887
|
+
deletion that scale down evaluation resumes.
|
|
888
|
+
- scale-down-delay-after-failure (duration: e.g., '3m') - How long after scale
|
|
889
|
+
down failure that scale down evaluation resumes.
|
|
890
|
+
- scale-down-enabled (boolean: true/false) - Should CA scale down the cluster.
|
|
891
|
+
- scale-down-unneeded-time (duration: e.g., '10m') - How long a node should be
|
|
892
|
+
unneeded before it is eligible for scale down.
|
|
893
|
+
- scale-down-unready-time (duration: e.g., '20m') - How long an unready node
|
|
894
|
+
should be unneeded before it is eligible for scale down.
|
|
895
|
+
- scale-down-utilization-threshold (float) - The maximum value between the sum
|
|
896
|
+
of cpu requests and sum of memory requests of all pods running on the node
|
|
897
|
+
divided by node's corresponding allocatable resource, below which a node can
|
|
898
|
+
be considered for scale down.
|
|
899
|
+
- scan-interval (duration: e.g., '10s') - How often cluster is reevaluated for
|
|
900
|
+
scale up or down.
|
|
901
|
+
- skip-nodes-with-custom-controller-pods (boolean: true/false) - If true cluster
|
|
902
|
+
autoscaler will never delete nodes with pods owned by custom controllers.
|
|
903
|
+
- skip-nodes-with-local-storage (boolean: true/false) - If true cluster
|
|
904
|
+
autoscaler will never delete nodes with pods with local storage, e.g. EmptyDir
|
|
905
|
+
or HostPath.
|
|
906
|
+
- skip-nodes-with-system-pods (boolean: true/false) - If true cluster autoscaler
|
|
907
|
+
will never delete nodes with pods from kube-system (except for DaemonSet or
|
|
908
|
+
mirror pods).
|
|
909
|
+
|
|
910
|
+
cni: Cluster CNI settings
|
|
911
|
+
|
|
912
|
+
ddos_profile: Advanced DDoS Protection profile
|
|
913
|
+
|
|
914
|
+
logging: Logging configuration
|
|
915
|
+
|
|
916
|
+
extra_headers: Send extra headers
|
|
917
|
+
|
|
918
|
+
extra_query: Add additional query parameters to the request
|
|
919
|
+
|
|
920
|
+
extra_body: Add additional JSON properties to the request
|
|
921
|
+
|
|
922
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
923
|
+
"""
|
|
924
|
+
if project_id is None:
|
|
925
|
+
project_id = self._client._get_cloud_project_id_path_param()
|
|
926
|
+
if region_id is None:
|
|
927
|
+
region_id = self._client._get_cloud_region_id_path_param()
|
|
928
|
+
if not cluster_name:
|
|
929
|
+
raise ValueError(f"Expected a non-empty value for `cluster_name` but received {cluster_name!r}")
|
|
930
|
+
return await self._patch(
|
|
931
|
+
f"/cloud/v2/k8s/clusters/{project_id}/{region_id}/{cluster_name}",
|
|
932
|
+
body=await async_maybe_transform(
|
|
933
|
+
{
|
|
934
|
+
"authentication": authentication,
|
|
935
|
+
"autoscaler_config": autoscaler_config,
|
|
936
|
+
"cni": cni,
|
|
937
|
+
"ddos_profile": ddos_profile,
|
|
938
|
+
"logging": logging,
|
|
939
|
+
},
|
|
940
|
+
cluster_update_params.ClusterUpdateParams,
|
|
941
|
+
),
|
|
942
|
+
options=make_request_options(
|
|
943
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
944
|
+
),
|
|
945
|
+
cast_to=TaskIDList,
|
|
946
|
+
)
|
|
947
|
+
|
|
948
|
+
async def list(
|
|
949
|
+
self,
|
|
950
|
+
*,
|
|
951
|
+
project_id: int | None = None,
|
|
952
|
+
region_id: int | None = None,
|
|
953
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
954
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
955
|
+
extra_headers: Headers | None = None,
|
|
956
|
+
extra_query: Query | None = None,
|
|
957
|
+
extra_body: Body | None = None,
|
|
958
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
959
|
+
) -> K8sClusterList:
|
|
960
|
+
"""
|
|
961
|
+
List k8s clusters
|
|
962
|
+
|
|
963
|
+
Args:
|
|
964
|
+
extra_headers: Send extra headers
|
|
965
|
+
|
|
966
|
+
extra_query: Add additional query parameters to the request
|
|
967
|
+
|
|
968
|
+
extra_body: Add additional JSON properties to the request
|
|
969
|
+
|
|
970
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
971
|
+
"""
|
|
972
|
+
if project_id is None:
|
|
973
|
+
project_id = self._client._get_cloud_project_id_path_param()
|
|
974
|
+
if region_id is None:
|
|
975
|
+
region_id = self._client._get_cloud_region_id_path_param()
|
|
976
|
+
return await self._get(
|
|
977
|
+
f"/cloud/v2/k8s/clusters/{project_id}/{region_id}",
|
|
978
|
+
options=make_request_options(
|
|
979
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
980
|
+
),
|
|
981
|
+
cast_to=K8sClusterList,
|
|
982
|
+
)
|
|
983
|
+
|
|
984
|
+
async def delete(
|
|
985
|
+
self,
|
|
986
|
+
cluster_name: str,
|
|
987
|
+
*,
|
|
988
|
+
project_id: int | None = None,
|
|
989
|
+
region_id: int | None = None,
|
|
990
|
+
volumes: str | NotGiven = NOT_GIVEN,
|
|
991
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
992
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
993
|
+
extra_headers: Headers | None = None,
|
|
994
|
+
extra_query: Query | None = None,
|
|
995
|
+
extra_body: Body | None = None,
|
|
996
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
997
|
+
) -> TaskIDList:
|
|
998
|
+
"""
|
|
999
|
+
Delete k8s cluster
|
|
1000
|
+
|
|
1001
|
+
Args:
|
|
1002
|
+
volumes: Comma separated list of volume IDs to be deleted with the cluster
|
|
1003
|
+
|
|
1004
|
+
extra_headers: Send extra headers
|
|
1005
|
+
|
|
1006
|
+
extra_query: Add additional query parameters to the request
|
|
1007
|
+
|
|
1008
|
+
extra_body: Add additional JSON properties to the request
|
|
1009
|
+
|
|
1010
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
1011
|
+
"""
|
|
1012
|
+
if project_id is None:
|
|
1013
|
+
project_id = self._client._get_cloud_project_id_path_param()
|
|
1014
|
+
if region_id is None:
|
|
1015
|
+
region_id = self._client._get_cloud_region_id_path_param()
|
|
1016
|
+
if not cluster_name:
|
|
1017
|
+
raise ValueError(f"Expected a non-empty value for `cluster_name` but received {cluster_name!r}")
|
|
1018
|
+
return await self._delete(
|
|
1019
|
+
f"/cloud/v2/k8s/clusters/{project_id}/{region_id}/{cluster_name}",
|
|
1020
|
+
options=make_request_options(
|
|
1021
|
+
extra_headers=extra_headers,
|
|
1022
|
+
extra_query=extra_query,
|
|
1023
|
+
extra_body=extra_body,
|
|
1024
|
+
timeout=timeout,
|
|
1025
|
+
query=await async_maybe_transform({"volumes": volumes}, cluster_delete_params.ClusterDeleteParams),
|
|
1026
|
+
),
|
|
1027
|
+
cast_to=TaskIDList,
|
|
1028
|
+
)
|
|
1029
|
+
|
|
1030
|
+
async def get(
|
|
1031
|
+
self,
|
|
1032
|
+
cluster_name: str,
|
|
1033
|
+
*,
|
|
1034
|
+
project_id: int | None = None,
|
|
1035
|
+
region_id: int | None = None,
|
|
1036
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
1037
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
1038
|
+
extra_headers: Headers | None = None,
|
|
1039
|
+
extra_query: Query | None = None,
|
|
1040
|
+
extra_body: Body | None = None,
|
|
1041
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
1042
|
+
) -> K8sCluster:
|
|
1043
|
+
"""
|
|
1044
|
+
Get k8s cluster
|
|
1045
|
+
|
|
1046
|
+
Args:
|
|
1047
|
+
extra_headers: Send extra headers
|
|
1048
|
+
|
|
1049
|
+
extra_query: Add additional query parameters to the request
|
|
1050
|
+
|
|
1051
|
+
extra_body: Add additional JSON properties to the request
|
|
1052
|
+
|
|
1053
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
1054
|
+
"""
|
|
1055
|
+
if project_id is None:
|
|
1056
|
+
project_id = self._client._get_cloud_project_id_path_param()
|
|
1057
|
+
if region_id is None:
|
|
1058
|
+
region_id = self._client._get_cloud_region_id_path_param()
|
|
1059
|
+
if not cluster_name:
|
|
1060
|
+
raise ValueError(f"Expected a non-empty value for `cluster_name` but received {cluster_name!r}")
|
|
1061
|
+
return await self._get(
|
|
1062
|
+
f"/cloud/v2/k8s/clusters/{project_id}/{region_id}/{cluster_name}",
|
|
1063
|
+
options=make_request_options(
|
|
1064
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
1065
|
+
),
|
|
1066
|
+
cast_to=K8sCluster,
|
|
1067
|
+
)
|
|
1068
|
+
|
|
1069
|
+
async def get_certificate(
|
|
1070
|
+
self,
|
|
1071
|
+
cluster_name: str,
|
|
1072
|
+
*,
|
|
1073
|
+
project_id: int | None = None,
|
|
1074
|
+
region_id: int | None = None,
|
|
1075
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
1076
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
1077
|
+
extra_headers: Headers | None = None,
|
|
1078
|
+
extra_query: Query | None = None,
|
|
1079
|
+
extra_body: Body | None = None,
|
|
1080
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
1081
|
+
) -> K8sClusterCertificate:
|
|
1082
|
+
"""
|
|
1083
|
+
Get k8s cluster CA certificate
|
|
1084
|
+
|
|
1085
|
+
Args:
|
|
1086
|
+
extra_headers: Send extra headers
|
|
1087
|
+
|
|
1088
|
+
extra_query: Add additional query parameters to the request
|
|
1089
|
+
|
|
1090
|
+
extra_body: Add additional JSON properties to the request
|
|
1091
|
+
|
|
1092
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
1093
|
+
"""
|
|
1094
|
+
if project_id is None:
|
|
1095
|
+
project_id = self._client._get_cloud_project_id_path_param()
|
|
1096
|
+
if region_id is None:
|
|
1097
|
+
region_id = self._client._get_cloud_region_id_path_param()
|
|
1098
|
+
if not cluster_name:
|
|
1099
|
+
raise ValueError(f"Expected a non-empty value for `cluster_name` but received {cluster_name!r}")
|
|
1100
|
+
return await self._get(
|
|
1101
|
+
f"/cloud/v2/k8s/clusters/{project_id}/{region_id}/{cluster_name}/certificates",
|
|
1102
|
+
options=make_request_options(
|
|
1103
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
1104
|
+
),
|
|
1105
|
+
cast_to=K8sClusterCertificate,
|
|
1106
|
+
)
|
|
1107
|
+
|
|
1108
|
+
async def get_kubeconfig(
|
|
1109
|
+
self,
|
|
1110
|
+
cluster_name: str,
|
|
1111
|
+
*,
|
|
1112
|
+
project_id: int | None = None,
|
|
1113
|
+
region_id: int | None = None,
|
|
1114
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
1115
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
1116
|
+
extra_headers: Headers | None = None,
|
|
1117
|
+
extra_query: Query | None = None,
|
|
1118
|
+
extra_body: Body | None = None,
|
|
1119
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
1120
|
+
) -> K8sClusterKubeconfig:
|
|
1121
|
+
"""
|
|
1122
|
+
Get k8s cluster kubeconfig
|
|
1123
|
+
|
|
1124
|
+
Args:
|
|
1125
|
+
extra_headers: Send extra headers
|
|
1126
|
+
|
|
1127
|
+
extra_query: Add additional query parameters to the request
|
|
1128
|
+
|
|
1129
|
+
extra_body: Add additional JSON properties to the request
|
|
1130
|
+
|
|
1131
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
1132
|
+
"""
|
|
1133
|
+
if project_id is None:
|
|
1134
|
+
project_id = self._client._get_cloud_project_id_path_param()
|
|
1135
|
+
if region_id is None:
|
|
1136
|
+
region_id = self._client._get_cloud_region_id_path_param()
|
|
1137
|
+
if not cluster_name:
|
|
1138
|
+
raise ValueError(f"Expected a non-empty value for `cluster_name` but received {cluster_name!r}")
|
|
1139
|
+
return await self._get(
|
|
1140
|
+
f"/cloud/v2/k8s/clusters/{project_id}/{region_id}/{cluster_name}/config",
|
|
1141
|
+
options=make_request_options(
|
|
1142
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
1143
|
+
),
|
|
1144
|
+
cast_to=K8sClusterKubeconfig,
|
|
1145
|
+
)
|
|
1146
|
+
|
|
1147
|
+
async def list_versions_for_upgrade(
|
|
1148
|
+
self,
|
|
1149
|
+
cluster_name: str,
|
|
1150
|
+
*,
|
|
1151
|
+
project_id: int | None = None,
|
|
1152
|
+
region_id: int | None = None,
|
|
1153
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
1154
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
1155
|
+
extra_headers: Headers | None = None,
|
|
1156
|
+
extra_query: Query | None = None,
|
|
1157
|
+
extra_body: Body | None = None,
|
|
1158
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
1159
|
+
) -> K8sClusterVersionList:
|
|
1160
|
+
"""
|
|
1161
|
+
List available k8s cluster versions for upgrade
|
|
1162
|
+
|
|
1163
|
+
Args:
|
|
1164
|
+
extra_headers: Send extra headers
|
|
1165
|
+
|
|
1166
|
+
extra_query: Add additional query parameters to the request
|
|
1167
|
+
|
|
1168
|
+
extra_body: Add additional JSON properties to the request
|
|
1169
|
+
|
|
1170
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
1171
|
+
"""
|
|
1172
|
+
if project_id is None:
|
|
1173
|
+
project_id = self._client._get_cloud_project_id_path_param()
|
|
1174
|
+
if region_id is None:
|
|
1175
|
+
region_id = self._client._get_cloud_region_id_path_param()
|
|
1176
|
+
if not cluster_name:
|
|
1177
|
+
raise ValueError(f"Expected a non-empty value for `cluster_name` but received {cluster_name!r}")
|
|
1178
|
+
return await self._get(
|
|
1179
|
+
f"/cloud/v2/k8s/clusters/{project_id}/{region_id}/{cluster_name}/upgrade_versions",
|
|
1180
|
+
options=make_request_options(
|
|
1181
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
1182
|
+
),
|
|
1183
|
+
cast_to=K8sClusterVersionList,
|
|
1184
|
+
)
|
|
1185
|
+
|
|
1186
|
+
async def upgrade(
|
|
1187
|
+
self,
|
|
1188
|
+
cluster_name: str,
|
|
1189
|
+
*,
|
|
1190
|
+
project_id: int | None = None,
|
|
1191
|
+
region_id: int | None = None,
|
|
1192
|
+
version: str,
|
|
1193
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
1194
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
1195
|
+
extra_headers: Headers | None = None,
|
|
1196
|
+
extra_query: Query | None = None,
|
|
1197
|
+
extra_body: Body | None = None,
|
|
1198
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
1199
|
+
) -> TaskIDList:
|
|
1200
|
+
"""
|
|
1201
|
+
Upgrade k8s cluster
|
|
1202
|
+
|
|
1203
|
+
Args:
|
|
1204
|
+
version: Target k8s cluster version
|
|
1205
|
+
|
|
1206
|
+
extra_headers: Send extra headers
|
|
1207
|
+
|
|
1208
|
+
extra_query: Add additional query parameters to the request
|
|
1209
|
+
|
|
1210
|
+
extra_body: Add additional JSON properties to the request
|
|
1211
|
+
|
|
1212
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
1213
|
+
"""
|
|
1214
|
+
if project_id is None:
|
|
1215
|
+
project_id = self._client._get_cloud_project_id_path_param()
|
|
1216
|
+
if region_id is None:
|
|
1217
|
+
region_id = self._client._get_cloud_region_id_path_param()
|
|
1218
|
+
if not cluster_name:
|
|
1219
|
+
raise ValueError(f"Expected a non-empty value for `cluster_name` but received {cluster_name!r}")
|
|
1220
|
+
return await self._post(
|
|
1221
|
+
f"/cloud/v2/k8s/clusters/{project_id}/{region_id}/{cluster_name}/upgrade",
|
|
1222
|
+
body=await async_maybe_transform({"version": version}, cluster_upgrade_params.ClusterUpgradeParams),
|
|
1223
|
+
options=make_request_options(
|
|
1224
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
1225
|
+
),
|
|
1226
|
+
cast_to=TaskIDList,
|
|
1227
|
+
)
|
|
1228
|
+
|
|
1229
|
+
|
|
1230
|
+
class ClustersResourceWithRawResponse:
|
|
1231
|
+
def __init__(self, clusters: ClustersResource) -> None:
|
|
1232
|
+
self._clusters = clusters
|
|
1233
|
+
|
|
1234
|
+
self.create = to_raw_response_wrapper(
|
|
1235
|
+
clusters.create,
|
|
1236
|
+
)
|
|
1237
|
+
self.update = to_raw_response_wrapper(
|
|
1238
|
+
clusters.update,
|
|
1239
|
+
)
|
|
1240
|
+
self.list = to_raw_response_wrapper(
|
|
1241
|
+
clusters.list,
|
|
1242
|
+
)
|
|
1243
|
+
self.delete = to_raw_response_wrapper(
|
|
1244
|
+
clusters.delete,
|
|
1245
|
+
)
|
|
1246
|
+
self.get = to_raw_response_wrapper(
|
|
1247
|
+
clusters.get,
|
|
1248
|
+
)
|
|
1249
|
+
self.get_certificate = to_raw_response_wrapper(
|
|
1250
|
+
clusters.get_certificate,
|
|
1251
|
+
)
|
|
1252
|
+
self.get_kubeconfig = to_raw_response_wrapper(
|
|
1253
|
+
clusters.get_kubeconfig,
|
|
1254
|
+
)
|
|
1255
|
+
self.list_versions_for_upgrade = to_raw_response_wrapper(
|
|
1256
|
+
clusters.list_versions_for_upgrade,
|
|
1257
|
+
)
|
|
1258
|
+
self.upgrade = to_raw_response_wrapper(
|
|
1259
|
+
clusters.upgrade,
|
|
1260
|
+
)
|
|
1261
|
+
|
|
1262
|
+
@cached_property
|
|
1263
|
+
def nodes(self) -> NodesResourceWithRawResponse:
|
|
1264
|
+
return NodesResourceWithRawResponse(self._clusters.nodes)
|
|
1265
|
+
|
|
1266
|
+
@cached_property
|
|
1267
|
+
def pools(self) -> PoolsResourceWithRawResponse:
|
|
1268
|
+
return PoolsResourceWithRawResponse(self._clusters.pools)
|
|
1269
|
+
|
|
1270
|
+
|
|
1271
|
+
class AsyncClustersResourceWithRawResponse:
|
|
1272
|
+
def __init__(self, clusters: AsyncClustersResource) -> None:
|
|
1273
|
+
self._clusters = clusters
|
|
1274
|
+
|
|
1275
|
+
self.create = async_to_raw_response_wrapper(
|
|
1276
|
+
clusters.create,
|
|
1277
|
+
)
|
|
1278
|
+
self.update = async_to_raw_response_wrapper(
|
|
1279
|
+
clusters.update,
|
|
1280
|
+
)
|
|
1281
|
+
self.list = async_to_raw_response_wrapper(
|
|
1282
|
+
clusters.list,
|
|
1283
|
+
)
|
|
1284
|
+
self.delete = async_to_raw_response_wrapper(
|
|
1285
|
+
clusters.delete,
|
|
1286
|
+
)
|
|
1287
|
+
self.get = async_to_raw_response_wrapper(
|
|
1288
|
+
clusters.get,
|
|
1289
|
+
)
|
|
1290
|
+
self.get_certificate = async_to_raw_response_wrapper(
|
|
1291
|
+
clusters.get_certificate,
|
|
1292
|
+
)
|
|
1293
|
+
self.get_kubeconfig = async_to_raw_response_wrapper(
|
|
1294
|
+
clusters.get_kubeconfig,
|
|
1295
|
+
)
|
|
1296
|
+
self.list_versions_for_upgrade = async_to_raw_response_wrapper(
|
|
1297
|
+
clusters.list_versions_for_upgrade,
|
|
1298
|
+
)
|
|
1299
|
+
self.upgrade = async_to_raw_response_wrapper(
|
|
1300
|
+
clusters.upgrade,
|
|
1301
|
+
)
|
|
1302
|
+
|
|
1303
|
+
@cached_property
|
|
1304
|
+
def nodes(self) -> AsyncNodesResourceWithRawResponse:
|
|
1305
|
+
return AsyncNodesResourceWithRawResponse(self._clusters.nodes)
|
|
1306
|
+
|
|
1307
|
+
@cached_property
|
|
1308
|
+
def pools(self) -> AsyncPoolsResourceWithRawResponse:
|
|
1309
|
+
return AsyncPoolsResourceWithRawResponse(self._clusters.pools)
|
|
1310
|
+
|
|
1311
|
+
|
|
1312
|
+
class ClustersResourceWithStreamingResponse:
|
|
1313
|
+
def __init__(self, clusters: ClustersResource) -> None:
|
|
1314
|
+
self._clusters = clusters
|
|
1315
|
+
|
|
1316
|
+
self.create = to_streamed_response_wrapper(
|
|
1317
|
+
clusters.create,
|
|
1318
|
+
)
|
|
1319
|
+
self.update = to_streamed_response_wrapper(
|
|
1320
|
+
clusters.update,
|
|
1321
|
+
)
|
|
1322
|
+
self.list = to_streamed_response_wrapper(
|
|
1323
|
+
clusters.list,
|
|
1324
|
+
)
|
|
1325
|
+
self.delete = to_streamed_response_wrapper(
|
|
1326
|
+
clusters.delete,
|
|
1327
|
+
)
|
|
1328
|
+
self.get = to_streamed_response_wrapper(
|
|
1329
|
+
clusters.get,
|
|
1330
|
+
)
|
|
1331
|
+
self.get_certificate = to_streamed_response_wrapper(
|
|
1332
|
+
clusters.get_certificate,
|
|
1333
|
+
)
|
|
1334
|
+
self.get_kubeconfig = to_streamed_response_wrapper(
|
|
1335
|
+
clusters.get_kubeconfig,
|
|
1336
|
+
)
|
|
1337
|
+
self.list_versions_for_upgrade = to_streamed_response_wrapper(
|
|
1338
|
+
clusters.list_versions_for_upgrade,
|
|
1339
|
+
)
|
|
1340
|
+
self.upgrade = to_streamed_response_wrapper(
|
|
1341
|
+
clusters.upgrade,
|
|
1342
|
+
)
|
|
1343
|
+
|
|
1344
|
+
@cached_property
|
|
1345
|
+
def nodes(self) -> NodesResourceWithStreamingResponse:
|
|
1346
|
+
return NodesResourceWithStreamingResponse(self._clusters.nodes)
|
|
1347
|
+
|
|
1348
|
+
@cached_property
|
|
1349
|
+
def pools(self) -> PoolsResourceWithStreamingResponse:
|
|
1350
|
+
return PoolsResourceWithStreamingResponse(self._clusters.pools)
|
|
1351
|
+
|
|
1352
|
+
|
|
1353
|
+
class AsyncClustersResourceWithStreamingResponse:
|
|
1354
|
+
def __init__(self, clusters: AsyncClustersResource) -> None:
|
|
1355
|
+
self._clusters = clusters
|
|
1356
|
+
|
|
1357
|
+
self.create = async_to_streamed_response_wrapper(
|
|
1358
|
+
clusters.create,
|
|
1359
|
+
)
|
|
1360
|
+
self.update = async_to_streamed_response_wrapper(
|
|
1361
|
+
clusters.update,
|
|
1362
|
+
)
|
|
1363
|
+
self.list = async_to_streamed_response_wrapper(
|
|
1364
|
+
clusters.list,
|
|
1365
|
+
)
|
|
1366
|
+
self.delete = async_to_streamed_response_wrapper(
|
|
1367
|
+
clusters.delete,
|
|
1368
|
+
)
|
|
1369
|
+
self.get = async_to_streamed_response_wrapper(
|
|
1370
|
+
clusters.get,
|
|
1371
|
+
)
|
|
1372
|
+
self.get_certificate = async_to_streamed_response_wrapper(
|
|
1373
|
+
clusters.get_certificate,
|
|
1374
|
+
)
|
|
1375
|
+
self.get_kubeconfig = async_to_streamed_response_wrapper(
|
|
1376
|
+
clusters.get_kubeconfig,
|
|
1377
|
+
)
|
|
1378
|
+
self.list_versions_for_upgrade = async_to_streamed_response_wrapper(
|
|
1379
|
+
clusters.list_versions_for_upgrade,
|
|
1380
|
+
)
|
|
1381
|
+
self.upgrade = async_to_streamed_response_wrapper(
|
|
1382
|
+
clusters.upgrade,
|
|
1383
|
+
)
|
|
1384
|
+
|
|
1385
|
+
@cached_property
|
|
1386
|
+
def nodes(self) -> AsyncNodesResourceWithStreamingResponse:
|
|
1387
|
+
return AsyncNodesResourceWithStreamingResponse(self._clusters.nodes)
|
|
1388
|
+
|
|
1389
|
+
@cached_property
|
|
1390
|
+
def pools(self) -> AsyncPoolsResourceWithStreamingResponse:
|
|
1391
|
+
return AsyncPoolsResourceWithStreamingResponse(self._clusters.pools)
|