gcore 0.1.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of gcore might be problematic. Click here for more details.
- gcore/__init__.py +89 -0
- gcore/_base_client.py +1943 -0
- gcore/_client.py +493 -0
- gcore/_compat.py +219 -0
- gcore/_constants.py +16 -0
- gcore/_exceptions.py +108 -0
- gcore/_files.py +123 -0
- gcore/_models.py +803 -0
- gcore/_qs.py +150 -0
- gcore/_resource.py +43 -0
- gcore/_response.py +830 -0
- gcore/_streaming.py +333 -0
- gcore/_types.py +217 -0
- gcore/_utils/__init__.py +57 -0
- gcore/_utils/_logs.py +25 -0
- gcore/_utils/_proxy.py +65 -0
- gcore/_utils/_reflection.py +42 -0
- gcore/_utils/_resources_proxy.py +24 -0
- gcore/_utils/_streams.py +12 -0
- gcore/_utils/_sync.py +86 -0
- gcore/_utils/_transform.py +447 -0
- gcore/_utils/_typing.py +151 -0
- gcore/_utils/_utils.py +422 -0
- gcore/_version.py +4 -0
- gcore/lib/.keep +4 -0
- gcore/lib/polling.py +19 -0
- gcore/pagination.py +70 -0
- gcore/py.typed +0 -0
- gcore/resources/__init__.py +33 -0
- gcore/resources/cloud/__init__.py +327 -0
- gcore/resources/cloud/baremetal/__init__.py +61 -0
- gcore/resources/cloud/baremetal/baremetal.py +166 -0
- gcore/resources/cloud/baremetal/flavors.py +371 -0
- gcore/resources/cloud/baremetal/images.py +238 -0
- gcore/resources/cloud/baremetal/servers.py +1042 -0
- gcore/resources/cloud/billing_reservations.py +386 -0
- gcore/resources/cloud/cloud.py +774 -0
- gcore/resources/cloud/file_shares/__init__.py +33 -0
- gcore/resources/cloud/file_shares/access_rules.py +434 -0
- gcore/resources/cloud/file_shares/file_shares.py +994 -0
- gcore/resources/cloud/floating_ips.py +765 -0
- gcore/resources/cloud/gpu_baremetal_clusters/__init__.py +75 -0
- gcore/resources/cloud/gpu_baremetal_clusters/flavors.py +211 -0
- gcore/resources/cloud/gpu_baremetal_clusters/gpu_baremetal_clusters.py +1493 -0
- gcore/resources/cloud/gpu_baremetal_clusters/images.py +785 -0
- gcore/resources/cloud/gpu_baremetal_clusters/interfaces.py +175 -0
- gcore/resources/cloud/gpu_baremetal_clusters/servers.py +1178 -0
- gcore/resources/cloud/inference/__init__.py +89 -0
- gcore/resources/cloud/inference/deployments/__init__.py +33 -0
- gcore/resources/cloud/inference/deployments/deployments.py +1493 -0
- gcore/resources/cloud/inference/deployments/logs.py +235 -0
- gcore/resources/cloud/inference/flavors.py +280 -0
- gcore/resources/cloud/inference/inference.py +295 -0
- gcore/resources/cloud/inference/models.py +289 -0
- gcore/resources/cloud/inference/registry_credentials.py +649 -0
- gcore/resources/cloud/inference/secrets.py +629 -0
- gcore/resources/cloud/instances/__init__.py +75 -0
- gcore/resources/cloud/instances/flavors.py +449 -0
- gcore/resources/cloud/instances/images.py +1297 -0
- gcore/resources/cloud/instances/instances.py +2821 -0
- gcore/resources/cloud/instances/interfaces.py +797 -0
- gcore/resources/cloud/instances/metrics.py +217 -0
- gcore/resources/cloud/ip_ranges.py +135 -0
- gcore/resources/cloud/load_balancers/__init__.py +103 -0
- gcore/resources/cloud/load_balancers/flavors.py +193 -0
- gcore/resources/cloud/load_balancers/l7_policies/__init__.py +33 -0
- gcore/resources/cloud/load_balancers/l7_policies/l7_policies.py +1020 -0
- gcore/resources/cloud/load_balancers/l7_policies/rules.py +1036 -0
- gcore/resources/cloud/load_balancers/listeners.py +1089 -0
- gcore/resources/cloud/load_balancers/load_balancers.py +1583 -0
- gcore/resources/cloud/load_balancers/metrics.py +205 -0
- gcore/resources/cloud/load_balancers/pools/__init__.py +47 -0
- gcore/resources/cloud/load_balancers/pools/health_monitors.py +352 -0
- gcore/resources/cloud/load_balancers/pools/members.py +353 -0
- gcore/resources/cloud/load_balancers/pools/pools.py +1190 -0
- gcore/resources/cloud/load_balancers/statuses.py +260 -0
- gcore/resources/cloud/networks/__init__.py +47 -0
- gcore/resources/cloud/networks/networks.py +771 -0
- gcore/resources/cloud/networks/routers.py +875 -0
- gcore/resources/cloud/networks/subnets.py +865 -0
- gcore/resources/cloud/placement_groups.py +465 -0
- gcore/resources/cloud/projects.py +608 -0
- gcore/resources/cloud/quotas/__init__.py +33 -0
- gcore/resources/cloud/quotas/quotas.py +335 -0
- gcore/resources/cloud/quotas/requests.py +482 -0
- gcore/resources/cloud/regions.py +328 -0
- gcore/resources/cloud/registries/__init__.py +75 -0
- gcore/resources/cloud/registries/artifacts.py +277 -0
- gcore/resources/cloud/registries/registries.py +688 -0
- gcore/resources/cloud/registries/repositories.py +265 -0
- gcore/resources/cloud/registries/tags.py +190 -0
- gcore/resources/cloud/registries/users.py +701 -0
- gcore/resources/cloud/reserved_fixed_ips/__init__.py +33 -0
- gcore/resources/cloud/reserved_fixed_ips/reserved_fixed_ips.py +965 -0
- gcore/resources/cloud/reserved_fixed_ips/vip.py +577 -0
- gcore/resources/cloud/secrets.py +797 -0
- gcore/resources/cloud/security_groups/__init__.py +33 -0
- gcore/resources/cloud/security_groups/rules.py +626 -0
- gcore/resources/cloud/security_groups/security_groups.py +863 -0
- gcore/resources/cloud/ssh_keys.py +635 -0
- gcore/resources/cloud/tasks.py +700 -0
- gcore/resources/cloud/users/__init__.py +33 -0
- gcore/resources/cloud/users/role_assignments.py +533 -0
- gcore/resources/cloud/users/users.py +102 -0
- gcore/resources/cloud/volumes.py +1710 -0
- gcore/resources/waap/__init__.py +33 -0
- gcore/resources/waap/domains/__init__.py +33 -0
- gcore/resources/waap/domains/domains.py +515 -0
- gcore/resources/waap/domains/settings.py +271 -0
- gcore/resources/waap/waap.py +102 -0
- gcore/types/__init__.py +3 -0
- gcore/types/cloud/__init__.py +199 -0
- gcore/types/cloud/allowed_address_pairs.py +15 -0
- gcore/types/cloud/aws_iam_data.py +13 -0
- gcore/types/cloud/aws_iam_data_param.py +15 -0
- gcore/types/cloud/baremetal/__init__.py +13 -0
- gcore/types/cloud/baremetal/baremetal_fixed_address.py +30 -0
- gcore/types/cloud/baremetal/baremetal_floating_address.py +15 -0
- gcore/types/cloud/baremetal/baremetal_server.py +178 -0
- gcore/types/cloud/baremetal/flavor_list_params.py +35 -0
- gcore/types/cloud/baremetal/flavor_list_suitable_params.py +22 -0
- gcore/types/cloud/baremetal/image_list_params.py +33 -0
- gcore/types/cloud/baremetal/server_create_params.py +370 -0
- gcore/types/cloud/baremetal/server_list_params.py +114 -0
- gcore/types/cloud/baremetal/server_rebuild_params.py +23 -0
- gcore/types/cloud/baremetal_flavor.py +58 -0
- gcore/types/cloud/baremetal_flavor_list.py +16 -0
- gcore/types/cloud/billing_reservation.py +153 -0
- gcore/types/cloud/billing_reservation_list_params.py +59 -0
- gcore/types/cloud/blackhole_port.py +66 -0
- gcore/types/cloud/capacity.py +13 -0
- gcore/types/cloud/console.py +18 -0
- gcore/types/cloud/container_probe.py +36 -0
- gcore/types/cloud/container_probe_config.py +16 -0
- gcore/types/cloud/container_probe_config_create_param.py +18 -0
- gcore/types/cloud/container_probe_create_param.py +38 -0
- gcore/types/cloud/container_probe_exec.py +12 -0
- gcore/types/cloud/container_probe_exec_create_param.py +13 -0
- gcore/types/cloud/container_probe_http_get.py +26 -0
- gcore/types/cloud/container_probe_http_get_create_param.py +25 -0
- gcore/types/cloud/container_probe_tcp_socket.py +10 -0
- gcore/types/cloud/container_probe_tcp_socket_create_param.py +12 -0
- gcore/types/cloud/container_scale.py +25 -0
- gcore/types/cloud/container_scale_trigger_rate.py +13 -0
- gcore/types/cloud/container_scale_trigger_sqs.py +33 -0
- gcore/types/cloud/container_scale_trigger_threshold.py +10 -0
- gcore/types/cloud/container_scale_triggers.py +36 -0
- gcore/types/cloud/ddos_profile.py +33 -0
- gcore/types/cloud/ddos_profile_field.py +31 -0
- gcore/types/cloud/ddos_profile_option_list.py +15 -0
- gcore/types/cloud/ddos_profile_status.py +13 -0
- gcore/types/cloud/ddos_profile_template.py +18 -0
- gcore/types/cloud/ddos_profile_template_field.py +23 -0
- gcore/types/cloud/deploy_status.py +13 -0
- gcore/types/cloud/file_share.py +111 -0
- gcore/types/cloud/file_share_create_params.py +104 -0
- gcore/types/cloud/file_share_list_params.py +24 -0
- gcore/types/cloud/file_share_resize_params.py +18 -0
- gcore/types/cloud/file_share_update_params.py +18 -0
- gcore/types/cloud/file_shares/__init__.py +7 -0
- gcore/types/cloud/file_shares/access_rule.py +21 -0
- gcore/types/cloud/file_shares/access_rule_create_params.py +21 -0
- gcore/types/cloud/file_shares/access_rule_list.py +16 -0
- gcore/types/cloud/fixed_address.py +38 -0
- gcore/types/cloud/fixed_address_short.py +24 -0
- gcore/types/cloud/flavor_hardware_description.py +27 -0
- gcore/types/cloud/floating_address.py +15 -0
- gcore/types/cloud/floating_ip.py +77 -0
- gcore/types/cloud/floating_ip_assign_params.py +20 -0
- gcore/types/cloud/floating_ip_create_params.py +40 -0
- gcore/types/cloud/floating_ip_detailed.py +222 -0
- gcore/types/cloud/floating_ip_list_params.py +35 -0
- gcore/types/cloud/floating_ip_status.py +7 -0
- gcore/types/cloud/gpu_baremetal_cluster.py +116 -0
- gcore/types/cloud/gpu_baremetal_cluster_create_params.py +155 -0
- gcore/types/cloud/gpu_baremetal_cluster_delete_params.py +28 -0
- gcore/types/cloud/gpu_baremetal_cluster_list_params.py +19 -0
- gcore/types/cloud/gpu_baremetal_cluster_rebuild_params.py +26 -0
- gcore/types/cloud/gpu_baremetal_cluster_resize_params.py +16 -0
- gcore/types/cloud/gpu_baremetal_cluster_server.py +200 -0
- gcore/types/cloud/gpu_baremetal_cluster_server_list.py +16 -0
- gcore/types/cloud/gpu_baremetal_clusters/__init__.py +9 -0
- gcore/types/cloud/gpu_baremetal_clusters/flavor_list_params.py +21 -0
- gcore/types/cloud/gpu_baremetal_clusters/image_upload_params.py +58 -0
- gcore/types/cloud/gpu_baremetal_clusters/server_attach_interface_params.py +253 -0
- gcore/types/cloud/gpu_baremetal_clusters/server_delete_params.py +21 -0
- gcore/types/cloud/gpu_baremetal_clusters/server_detach_interface_params.py +19 -0
- gcore/types/cloud/gpu_baremetal_flavor.py +133 -0
- gcore/types/cloud/gpu_baremetal_flavor_list.py +16 -0
- gcore/types/cloud/gpu_image.py +70 -0
- gcore/types/cloud/gpu_image_list.py +16 -0
- gcore/types/cloud/health_monitor.py +48 -0
- gcore/types/cloud/health_monitor_status.py +22 -0
- gcore/types/cloud/http_method.py +7 -0
- gcore/types/cloud/image.py +100 -0
- gcore/types/cloud/image_list.py +16 -0
- gcore/types/cloud/inference/__init__.py +25 -0
- gcore/types/cloud/inference/container.py +26 -0
- gcore/types/cloud/inference/deployment_create_params.py +222 -0
- gcore/types/cloud/inference/deployment_list_params.py +21 -0
- gcore/types/cloud/inference/deployment_update_params.py +215 -0
- gcore/types/cloud/inference/deployments/__init__.py +5 -0
- gcore/types/cloud/inference/deployments/log_list_params.py +28 -0
- gcore/types/cloud/inference/flavor_list_params.py +18 -0
- gcore/types/cloud/inference/inference.py +95 -0
- gcore/types/cloud/inference/inference_apikey_secret.py +15 -0
- gcore/types/cloud/inference/inference_flavor.py +34 -0
- gcore/types/cloud/inference/inference_log.py +21 -0
- gcore/types/cloud/inference/inference_registry_credential.py +19 -0
- gcore/types/cloud/inference/inference_registry_credential_full.py +22 -0
- gcore/types/cloud/inference/inference_secret.py +17 -0
- gcore/types/cloud/inference/mlcatalog_model_card.py +65 -0
- gcore/types/cloud/inference/mlcatalog_order_by_choices.py +7 -0
- gcore/types/cloud/inference/model_list_params.py +23 -0
- gcore/types/cloud/inference/registry_credential_create_params.py +24 -0
- gcore/types/cloud/inference/registry_credential_list_params.py +21 -0
- gcore/types/cloud/inference/registry_credential_replace_params.py +21 -0
- gcore/types/cloud/inference/secret_create_params.py +23 -0
- gcore/types/cloud/inference/secret_list_params.py +21 -0
- gcore/types/cloud/inference/secret_replace_params.py +20 -0
- gcore/types/cloud/inference_probes.py +19 -0
- gcore/types/cloud/ingress_opts_out.py +16 -0
- gcore/types/cloud/ingress_opts_param.py +18 -0
- gcore/types/cloud/instance.py +296 -0
- gcore/types/cloud/instance_action_params.py +32 -0
- gcore/types/cloud/instance_add_to_placement_group_params.py +16 -0
- gcore/types/cloud/instance_assign_security_group_params.py +28 -0
- gcore/types/cloud/instance_create_params.py +622 -0
- gcore/types/cloud/instance_delete_params.py +33 -0
- gcore/types/cloud/instance_get_console_params.py +16 -0
- gcore/types/cloud/instance_interface.py +40 -0
- gcore/types/cloud/instance_isolation.py +12 -0
- gcore/types/cloud/instance_list.py +16 -0
- gcore/types/cloud/instance_list_params.py +146 -0
- gcore/types/cloud/instance_metrics_time_unit.py +7 -0
- gcore/types/cloud/instance_resize_params.py +16 -0
- gcore/types/cloud/instance_unassign_security_group_params.py +28 -0
- gcore/types/cloud/instance_update_params.py +18 -0
- gcore/types/cloud/instances/__init__.py +19 -0
- gcore/types/cloud/instances/flavor_list_for_resize_params.py +16 -0
- gcore/types/cloud/instances/flavor_list_params.py +25 -0
- gcore/types/cloud/instances/flavor_list_suitable_params.py +56 -0
- gcore/types/cloud/instances/image_create_from_volume_params.py +53 -0
- gcore/types/cloud/instances/image_get_params.py +16 -0
- gcore/types/cloud/instances/image_list_params.py +33 -0
- gcore/types/cloud/instances/image_update_params.py +43 -0
- gcore/types/cloud/instances/image_upload_params.py +62 -0
- gcore/types/cloud/instances/instance_flavor.py +49 -0
- gcore/types/cloud/instances/instance_flavor_list.py +16 -0
- gcore/types/cloud/instances/interface_attach_params.py +253 -0
- gcore/types/cloud/instances/interface_detach_params.py +19 -0
- gcore/types/cloud/instances/metric_list_params.py +23 -0
- gcore/types/cloud/instances/metrics.py +52 -0
- gcore/types/cloud/instances/metrics_list.py +16 -0
- gcore/types/cloud/interface_ip_family.py +7 -0
- gcore/types/cloud/ip_assignment.py +13 -0
- gcore/types/cloud/ip_ranges.py +12 -0
- gcore/types/cloud/ip_version.py +7 -0
- gcore/types/cloud/laas_index_retention_policy.py +12 -0
- gcore/types/cloud/laas_index_retention_policy_param.py +13 -0
- gcore/types/cloud/lb_algorithm.py +7 -0
- gcore/types/cloud/lb_health_monitor_type.py +7 -0
- gcore/types/cloud/lb_listener_protocol.py +7 -0
- gcore/types/cloud/lb_pool_protocol.py +7 -0
- gcore/types/cloud/lb_session_persistence_type.py +7 -0
- gcore/types/cloud/listener_status.py +27 -0
- gcore/types/cloud/load_balancer.py +144 -0
- gcore/types/cloud/load_balancer_create_params.py +327 -0
- gcore/types/cloud/load_balancer_failover_params.py +16 -0
- gcore/types/cloud/load_balancer_flavor_detail.py +40 -0
- gcore/types/cloud/load_balancer_flavor_list.py +16 -0
- gcore/types/cloud/load_balancer_get_params.py +19 -0
- gcore/types/cloud/load_balancer_instance_role.py +7 -0
- gcore/types/cloud/load_balancer_l7_policy.py +86 -0
- gcore/types/cloud/load_balancer_l7_policy_list.py +16 -0
- gcore/types/cloud/load_balancer_l7_rule.py +72 -0
- gcore/types/cloud/load_balancer_l7_rule_list.py +16 -0
- gcore/types/cloud/load_balancer_list_params.py +53 -0
- gcore/types/cloud/load_balancer_listener_detail.py +97 -0
- gcore/types/cloud/load_balancer_listener_list.py +16 -0
- gcore/types/cloud/load_balancer_member_connectivity.py +7 -0
- gcore/types/cloud/load_balancer_metrics.py +32 -0
- gcore/types/cloud/load_balancer_metrics_list.py +16 -0
- gcore/types/cloud/load_balancer_operating_status.py +7 -0
- gcore/types/cloud/load_balancer_pool.py +87 -0
- gcore/types/cloud/load_balancer_pool_list.py +16 -0
- gcore/types/cloud/load_balancer_resize_params.py +16 -0
- gcore/types/cloud/load_balancer_statistics.py +22 -0
- gcore/types/cloud/load_balancer_status.py +38 -0
- gcore/types/cloud/load_balancer_status_list.py +16 -0
- gcore/types/cloud/load_balancer_update_params.py +43 -0
- gcore/types/cloud/load_balancers/__init__.py +15 -0
- gcore/types/cloud/load_balancers/flavor_list_params.py +16 -0
- gcore/types/cloud/load_balancers/l7_policies/__init__.py +6 -0
- gcore/types/cloud/load_balancers/l7_policies/rule_create_params.py +50 -0
- gcore/types/cloud/load_balancers/l7_policies/rule_replace_params.py +43 -0
- gcore/types/cloud/load_balancers/l7_policy_create_params.py +54 -0
- gcore/types/cloud/load_balancers/l7_policy_replace_params.py +51 -0
- gcore/types/cloud/load_balancers/listener_create_params.py +72 -0
- gcore/types/cloud/load_balancers/listener_get_params.py +16 -0
- gcore/types/cloud/load_balancers/listener_list_params.py +19 -0
- gcore/types/cloud/load_balancers/listener_update_params.py +55 -0
- gcore/types/cloud/load_balancers/metric_list_params.py +21 -0
- gcore/types/cloud/load_balancers/pool_create_params.py +141 -0
- gcore/types/cloud/load_balancers/pool_list_params.py +25 -0
- gcore/types/cloud/load_balancers/pool_update_params.py +139 -0
- gcore/types/cloud/load_balancers/pools/__init__.py +6 -0
- gcore/types/cloud/load_balancers/pools/health_monitor_create_params.py +49 -0
- gcore/types/cloud/load_balancers/pools/member_add_params.py +44 -0
- gcore/types/cloud/logging.py +22 -0
- gcore/types/cloud/member.py +47 -0
- gcore/types/cloud/member_status.py +24 -0
- gcore/types/cloud/network.py +79 -0
- gcore/types/cloud/network_create_params.py +36 -0
- gcore/types/cloud/network_details.py +80 -0
- gcore/types/cloud/network_interface.py +78 -0
- gcore/types/cloud/network_interface_list.py +16 -0
- gcore/types/cloud/network_list_params.py +41 -0
- gcore/types/cloud/network_update_params.py +18 -0
- gcore/types/cloud/networks/__init__.py +14 -0
- gcore/types/cloud/networks/router.py +83 -0
- gcore/types/cloud/networks/router_attach_subnet_params.py +24 -0
- gcore/types/cloud/networks/router_create_params.py +75 -0
- gcore/types/cloud/networks/router_detach_subnet_params.py +16 -0
- gcore/types/cloud/networks/router_list.py +16 -0
- gcore/types/cloud/networks/router_list_params.py +19 -0
- gcore/types/cloud/networks/router_update_params.py +45 -0
- gcore/types/cloud/networks/subnet_create_params.py +82 -0
- gcore/types/cloud/networks/subnet_list_params.py +58 -0
- gcore/types/cloud/networks/subnet_update_params.py +47 -0
- gcore/types/cloud/placement_group.py +41 -0
- gcore/types/cloud/placement_group_create_params.py +19 -0
- gcore/types/cloud/placement_group_list.py +16 -0
- gcore/types/cloud/pool_status.py +31 -0
- gcore/types/cloud/project.py +47 -0
- gcore/types/cloud/project_create_params.py +22 -0
- gcore/types/cloud/project_list_params.py +27 -0
- gcore/types/cloud/project_replace_params.py +18 -0
- gcore/types/cloud/provisioning_status.py +9 -0
- gcore/types/cloud/quota_get_all_response.py +340 -0
- gcore/types/cloud/quota_get_by_region_response.py +288 -0
- gcore/types/cloud/quota_get_global_response.py +51 -0
- gcore/types/cloud/quotas/__init__.py +8 -0
- gcore/types/cloud/quotas/request_create_params.py +193 -0
- gcore/types/cloud/quotas/request_get_response.py +205 -0
- gcore/types/cloud/quotas/request_list_params.py +22 -0
- gcore/types/cloud/quotas/request_list_response.py +205 -0
- gcore/types/cloud/region.py +101 -0
- gcore/types/cloud/region_capacity.py +16 -0
- gcore/types/cloud/region_capacity_list.py +16 -0
- gcore/types/cloud/region_get_params.py +18 -0
- gcore/types/cloud/region_list_params.py +31 -0
- gcore/types/cloud/registries/__init__.py +14 -0
- gcore/types/cloud/registries/registry_artifact.py +35 -0
- gcore/types/cloud/registries/registry_artifact_list.py +16 -0
- gcore/types/cloud/registries/registry_repository.py +30 -0
- gcore/types/cloud/registries/registry_repository_list.py +16 -0
- gcore/types/cloud/registries/registry_user.py +28 -0
- gcore/types/cloud/registries/registry_user_created.py +31 -0
- gcore/types/cloud/registries/registry_user_list.py +16 -0
- gcore/types/cloud/registries/user_create_multiple_params.py +36 -0
- gcore/types/cloud/registries/user_create_params.py +30 -0
- gcore/types/cloud/registries/user_update_params.py +21 -0
- gcore/types/cloud/registry.py +33 -0
- gcore/types/cloud/registry_create_params.py +24 -0
- gcore/types/cloud/registry_list.py +16 -0
- gcore/types/cloud/registry_resize_params.py +16 -0
- gcore/types/cloud/registry_tag.py +27 -0
- gcore/types/cloud/reserved_fixed_ip.py +98 -0
- gcore/types/cloud/reserved_fixed_ip_create_params.py +107 -0
- gcore/types/cloud/reserved_fixed_ip_list_params.py +47 -0
- gcore/types/cloud/reserved_fixed_ips/__init__.py +12 -0
- gcore/types/cloud/reserved_fixed_ips/candidate_port.py +26 -0
- gcore/types/cloud/reserved_fixed_ips/candidate_port_list.py +16 -0
- gcore/types/cloud/reserved_fixed_ips/connected_port.py +26 -0
- gcore/types/cloud/reserved_fixed_ips/connected_port_list.py +16 -0
- gcore/types/cloud/reserved_fixed_ips/ip_with_subnet.py +17 -0
- gcore/types/cloud/reserved_fixed_ips/vip_replace_connected_ports_params.py +17 -0
- gcore/types/cloud/reserved_fixed_ips/vip_toggle_params.py +16 -0
- gcore/types/cloud/reserved_fixed_ips/vip_update_connected_ports_params.py +17 -0
- gcore/types/cloud/route.py +16 -0
- gcore/types/cloud/secret.py +64 -0
- gcore/types/cloud/secret_create_params.py +66 -0
- gcore/types/cloud/secret_list_response.py +16 -0
- gcore/types/cloud/secret_upload_tls_certificate_params.py +39 -0
- gcore/types/cloud/security_group.py +45 -0
- gcore/types/cloud/security_group_copy_params.py +16 -0
- gcore/types/cloud/security_group_create_params.py +94 -0
- gcore/types/cloud/security_group_list_params.py +30 -0
- gcore/types/cloud/security_group_rule.py +83 -0
- gcore/types/cloud/security_group_update_params.py +83 -0
- gcore/types/cloud/security_groups/__init__.py +6 -0
- gcore/types/cloud/security_groups/rule_create_params.py +65 -0
- gcore/types/cloud/security_groups/rule_replace_params.py +72 -0
- gcore/types/cloud/session_persistence.py +22 -0
- gcore/types/cloud/ssh_key.py +39 -0
- gcore/types/cloud/ssh_key_create_params.py +31 -0
- gcore/types/cloud/ssh_key_created.py +53 -0
- gcore/types/cloud/ssh_key_list_params.py +21 -0
- gcore/types/cloud/ssh_key_update_params.py +15 -0
- gcore/types/cloud/subnet.py +87 -0
- gcore/types/cloud/tag.py +16 -0
- gcore/types/cloud/tag_update_map_param.py +10 -0
- gcore/types/cloud/task.py +191 -0
- gcore/types/cloud/task_acknowledge_all_params.py +16 -0
- gcore/types/cloud/task_id_list.py +12 -0
- gcore/types/cloud/task_list_params.py +104 -0
- gcore/types/cloud/users/__init__.py +9 -0
- gcore/types/cloud/users/role_assignment.py +33 -0
- gcore/types/cloud/users/role_assignment_create_params.py +22 -0
- gcore/types/cloud/users/role_assignment_list_params.py +25 -0
- gcore/types/cloud/users/role_assignment_update_delete.py +10 -0
- gcore/types/cloud/users/role_assignment_update_params.py +22 -0
- gcore/types/cloud/volume.py +141 -0
- gcore/types/cloud/volume_attach_to_instance_params.py +21 -0
- gcore/types/cloud/volume_change_type_params.py +18 -0
- gcore/types/cloud/volume_create_params.py +176 -0
- gcore/types/cloud/volume_delete_params.py +18 -0
- gcore/types/cloud/volume_detach_from_instance_params.py +18 -0
- gcore/types/cloud/volume_list_params.py +56 -0
- gcore/types/cloud/volume_resize_params.py +18 -0
- gcore/types/cloud/volume_update_params.py +18 -0
- gcore/types/waap/__init__.py +12 -0
- gcore/types/waap/domain_list_params.py +30 -0
- gcore/types/waap/domain_update_params.py +12 -0
- gcore/types/waap/domains/__init__.py +5 -0
- gcore/types/waap/domains/setting_update_params.py +41 -0
- gcore/types/waap/waap_api_urls.py +15 -0
- gcore/types/waap/waap_detailed_domain.py +37 -0
- gcore/types/waap/waap_domain_ddos_settings.py +31 -0
- gcore/types/waap/waap_domain_settings.py +15 -0
- gcore/types/waap/waap_domain_status.py +7 -0
- gcore/types/waap/waap_summary_domain.py +26 -0
- gcore-0.1.0.dist-info/METADATA +482 -0
- gcore-0.1.0.dist-info/RECORD +437 -0
- gcore-0.1.0.dist-info/WHEEL +4 -0
- gcore-0.1.0.dist-info/licenses/LICENSE +201 -0
|
@@ -0,0 +1,1493 @@
|
|
|
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 List, Iterable, Optional
|
|
6
|
+
|
|
7
|
+
import httpx
|
|
8
|
+
|
|
9
|
+
from .images import (
|
|
10
|
+
ImagesResource,
|
|
11
|
+
AsyncImagesResource,
|
|
12
|
+
ImagesResourceWithRawResponse,
|
|
13
|
+
AsyncImagesResourceWithRawResponse,
|
|
14
|
+
ImagesResourceWithStreamingResponse,
|
|
15
|
+
AsyncImagesResourceWithStreamingResponse,
|
|
16
|
+
)
|
|
17
|
+
from .flavors import (
|
|
18
|
+
FlavorsResource,
|
|
19
|
+
AsyncFlavorsResource,
|
|
20
|
+
FlavorsResourceWithRawResponse,
|
|
21
|
+
AsyncFlavorsResourceWithRawResponse,
|
|
22
|
+
FlavorsResourceWithStreamingResponse,
|
|
23
|
+
AsyncFlavorsResourceWithStreamingResponse,
|
|
24
|
+
)
|
|
25
|
+
from .servers import (
|
|
26
|
+
ServersResource,
|
|
27
|
+
AsyncServersResource,
|
|
28
|
+
ServersResourceWithRawResponse,
|
|
29
|
+
AsyncServersResourceWithRawResponse,
|
|
30
|
+
ServersResourceWithStreamingResponse,
|
|
31
|
+
AsyncServersResourceWithStreamingResponse,
|
|
32
|
+
)
|
|
33
|
+
from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven
|
|
34
|
+
from ...._utils import maybe_transform, async_maybe_transform
|
|
35
|
+
from ...._compat import cached_property
|
|
36
|
+
from .interfaces import (
|
|
37
|
+
InterfacesResource,
|
|
38
|
+
AsyncInterfacesResource,
|
|
39
|
+
InterfacesResourceWithRawResponse,
|
|
40
|
+
AsyncInterfacesResourceWithRawResponse,
|
|
41
|
+
InterfacesResourceWithStreamingResponse,
|
|
42
|
+
AsyncInterfacesResourceWithStreamingResponse,
|
|
43
|
+
)
|
|
44
|
+
from ...._resource import SyncAPIResource, AsyncAPIResource
|
|
45
|
+
from ...._response import (
|
|
46
|
+
to_raw_response_wrapper,
|
|
47
|
+
to_streamed_response_wrapper,
|
|
48
|
+
async_to_raw_response_wrapper,
|
|
49
|
+
async_to_streamed_response_wrapper,
|
|
50
|
+
)
|
|
51
|
+
from ....pagination import SyncOffsetPage, AsyncOffsetPage
|
|
52
|
+
from ....types.cloud import (
|
|
53
|
+
gpu_baremetal_cluster_list_params,
|
|
54
|
+
gpu_baremetal_cluster_create_params,
|
|
55
|
+
gpu_baremetal_cluster_delete_params,
|
|
56
|
+
gpu_baremetal_cluster_resize_params,
|
|
57
|
+
gpu_baremetal_cluster_rebuild_params,
|
|
58
|
+
)
|
|
59
|
+
from ...._base_client import AsyncPaginator, make_request_options
|
|
60
|
+
from ....types.cloud.task_id_list import TaskIDList
|
|
61
|
+
from ....types.cloud.tag_update_map_param import TagUpdateMapParam
|
|
62
|
+
from ....types.cloud.gpu_baremetal_cluster import GPUBaremetalCluster
|
|
63
|
+
from ....types.cloud.gpu_baremetal_cluster_server_list import GPUBaremetalClusterServerList
|
|
64
|
+
|
|
65
|
+
__all__ = ["GPUBaremetalClustersResource", "AsyncGPUBaremetalClustersResource"]
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
class GPUBaremetalClustersResource(SyncAPIResource):
|
|
69
|
+
@cached_property
|
|
70
|
+
def interfaces(self) -> InterfacesResource:
|
|
71
|
+
return InterfacesResource(self._client)
|
|
72
|
+
|
|
73
|
+
@cached_property
|
|
74
|
+
def servers(self) -> ServersResource:
|
|
75
|
+
return ServersResource(self._client)
|
|
76
|
+
|
|
77
|
+
@cached_property
|
|
78
|
+
def flavors(self) -> FlavorsResource:
|
|
79
|
+
return FlavorsResource(self._client)
|
|
80
|
+
|
|
81
|
+
@cached_property
|
|
82
|
+
def images(self) -> ImagesResource:
|
|
83
|
+
return ImagesResource(self._client)
|
|
84
|
+
|
|
85
|
+
@cached_property
|
|
86
|
+
def with_raw_response(self) -> GPUBaremetalClustersResourceWithRawResponse:
|
|
87
|
+
"""
|
|
88
|
+
This property can be used as a prefix for any HTTP method call to return
|
|
89
|
+
the raw response object instead of the parsed content.
|
|
90
|
+
|
|
91
|
+
For more information, see https://www.github.com/G-Core/gcore-python#accessing-raw-response-data-eg-headers
|
|
92
|
+
"""
|
|
93
|
+
return GPUBaremetalClustersResourceWithRawResponse(self)
|
|
94
|
+
|
|
95
|
+
@cached_property
|
|
96
|
+
def with_streaming_response(self) -> GPUBaremetalClustersResourceWithStreamingResponse:
|
|
97
|
+
"""
|
|
98
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
99
|
+
|
|
100
|
+
For more information, see https://www.github.com/G-Core/gcore-python#with_streaming_response
|
|
101
|
+
"""
|
|
102
|
+
return GPUBaremetalClustersResourceWithStreamingResponse(self)
|
|
103
|
+
|
|
104
|
+
def create(
|
|
105
|
+
self,
|
|
106
|
+
*,
|
|
107
|
+
project_id: int | None = None,
|
|
108
|
+
region_id: int | None = None,
|
|
109
|
+
flavor: str,
|
|
110
|
+
image_id: str,
|
|
111
|
+
interfaces: Iterable[gpu_baremetal_cluster_create_params.Interface],
|
|
112
|
+
name: str,
|
|
113
|
+
instances_count: int | NotGiven = NOT_GIVEN,
|
|
114
|
+
password: str | NotGiven = NOT_GIVEN,
|
|
115
|
+
ssh_key_name: str | NotGiven = NOT_GIVEN,
|
|
116
|
+
tags: TagUpdateMapParam | NotGiven = NOT_GIVEN,
|
|
117
|
+
user_data: str | NotGiven = NOT_GIVEN,
|
|
118
|
+
username: str | NotGiven = NOT_GIVEN,
|
|
119
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
120
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
121
|
+
extra_headers: Headers | None = None,
|
|
122
|
+
extra_query: Query | None = None,
|
|
123
|
+
extra_body: Body | None = None,
|
|
124
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
125
|
+
) -> TaskIDList:
|
|
126
|
+
"""
|
|
127
|
+
Create bare metal GPU cluster
|
|
128
|
+
|
|
129
|
+
Args:
|
|
130
|
+
flavor: Flavor name
|
|
131
|
+
|
|
132
|
+
image_id: Image ID
|
|
133
|
+
|
|
134
|
+
interfaces: A list of network interfaces for the server. You can create one or more
|
|
135
|
+
interfaces - private, public, or both.
|
|
136
|
+
|
|
137
|
+
name: GPU Cluster name
|
|
138
|
+
|
|
139
|
+
instances_count: Number of servers to create
|
|
140
|
+
|
|
141
|
+
password: A password for a bare metal server. This parameter is used to set a password for
|
|
142
|
+
the "Admin" user on a Windows instance, a default user or a new user on a Linux
|
|
143
|
+
instance
|
|
144
|
+
|
|
145
|
+
ssh_key_name: Specifies the name of the SSH keypair, created via the
|
|
146
|
+
<a href="#operation/SSHKeyCollectionViewSet.post">/v1/ssh_keys endpoint</a>.
|
|
147
|
+
|
|
148
|
+
tags: Key-value tags to associate with the resource. A tag is a key-value pair that
|
|
149
|
+
can be associated with a resource, enabling efficient filtering and grouping for
|
|
150
|
+
better organization and management. Some tags are read-only and cannot be
|
|
151
|
+
modified by the user. Tags are also integrated with cost reports, allowing cost
|
|
152
|
+
data to be filtered based on tag keys or values.
|
|
153
|
+
|
|
154
|
+
user_data: String in base64 format. Must not be passed together with 'username' or
|
|
155
|
+
'password'. Examples of the user_data:
|
|
156
|
+
https://cloudinit.readthedocs.io/en/latest/topics/examples.html
|
|
157
|
+
|
|
158
|
+
username: A name of a new user in the Linux instance. It may be passed with a 'password'
|
|
159
|
+
parameter
|
|
160
|
+
|
|
161
|
+
extra_headers: Send extra headers
|
|
162
|
+
|
|
163
|
+
extra_query: Add additional query parameters to the request
|
|
164
|
+
|
|
165
|
+
extra_body: Add additional JSON properties to the request
|
|
166
|
+
|
|
167
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
168
|
+
"""
|
|
169
|
+
if project_id is None:
|
|
170
|
+
project_id = self._client._get_cloud_project_id_path_param()
|
|
171
|
+
if region_id is None:
|
|
172
|
+
region_id = self._client._get_cloud_region_id_path_param()
|
|
173
|
+
return self._post(
|
|
174
|
+
f"/cloud/v1/ai/clusters/gpu/{project_id}/{region_id}",
|
|
175
|
+
body=maybe_transform(
|
|
176
|
+
{
|
|
177
|
+
"flavor": flavor,
|
|
178
|
+
"image_id": image_id,
|
|
179
|
+
"interfaces": interfaces,
|
|
180
|
+
"name": name,
|
|
181
|
+
"instances_count": instances_count,
|
|
182
|
+
"password": password,
|
|
183
|
+
"ssh_key_name": ssh_key_name,
|
|
184
|
+
"tags": tags,
|
|
185
|
+
"user_data": user_data,
|
|
186
|
+
"username": username,
|
|
187
|
+
},
|
|
188
|
+
gpu_baremetal_cluster_create_params.GPUBaremetalClusterCreateParams,
|
|
189
|
+
),
|
|
190
|
+
options=make_request_options(
|
|
191
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
192
|
+
),
|
|
193
|
+
cast_to=TaskIDList,
|
|
194
|
+
)
|
|
195
|
+
|
|
196
|
+
def list(
|
|
197
|
+
self,
|
|
198
|
+
*,
|
|
199
|
+
project_id: int | None = None,
|
|
200
|
+
region_id: int | None = None,
|
|
201
|
+
limit: int | NotGiven = NOT_GIVEN,
|
|
202
|
+
offset: int | NotGiven = NOT_GIVEN,
|
|
203
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
204
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
205
|
+
extra_headers: Headers | None = None,
|
|
206
|
+
extra_query: Query | None = None,
|
|
207
|
+
extra_body: Body | None = None,
|
|
208
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
209
|
+
) -> SyncOffsetPage[GPUBaremetalCluster]:
|
|
210
|
+
"""
|
|
211
|
+
List bare metal GPU clusters
|
|
212
|
+
|
|
213
|
+
Args:
|
|
214
|
+
limit: Limit the number of returned clusters
|
|
215
|
+
|
|
216
|
+
offset: Offset value is used to exclude the first set of records from the result
|
|
217
|
+
|
|
218
|
+
extra_headers: Send extra headers
|
|
219
|
+
|
|
220
|
+
extra_query: Add additional query parameters to the request
|
|
221
|
+
|
|
222
|
+
extra_body: Add additional JSON properties to the request
|
|
223
|
+
|
|
224
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
225
|
+
"""
|
|
226
|
+
if project_id is None:
|
|
227
|
+
project_id = self._client._get_cloud_project_id_path_param()
|
|
228
|
+
if region_id is None:
|
|
229
|
+
region_id = self._client._get_cloud_region_id_path_param()
|
|
230
|
+
return self._get_api_list(
|
|
231
|
+
f"/cloud/v2/ai/clusters/{project_id}/{region_id}",
|
|
232
|
+
page=SyncOffsetPage[GPUBaremetalCluster],
|
|
233
|
+
options=make_request_options(
|
|
234
|
+
extra_headers=extra_headers,
|
|
235
|
+
extra_query=extra_query,
|
|
236
|
+
extra_body=extra_body,
|
|
237
|
+
timeout=timeout,
|
|
238
|
+
query=maybe_transform(
|
|
239
|
+
{
|
|
240
|
+
"limit": limit,
|
|
241
|
+
"offset": offset,
|
|
242
|
+
},
|
|
243
|
+
gpu_baremetal_cluster_list_params.GPUBaremetalClusterListParams,
|
|
244
|
+
),
|
|
245
|
+
),
|
|
246
|
+
model=GPUBaremetalCluster,
|
|
247
|
+
)
|
|
248
|
+
|
|
249
|
+
def delete(
|
|
250
|
+
self,
|
|
251
|
+
cluster_id: str,
|
|
252
|
+
*,
|
|
253
|
+
project_id: int | None = None,
|
|
254
|
+
region_id: int | None = None,
|
|
255
|
+
delete_floatings: bool | NotGiven = NOT_GIVEN,
|
|
256
|
+
floatings: str | NotGiven = NOT_GIVEN,
|
|
257
|
+
reserved_fixed_ips: str | NotGiven = NOT_GIVEN,
|
|
258
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
259
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
260
|
+
extra_headers: Headers | None = None,
|
|
261
|
+
extra_query: Query | None = None,
|
|
262
|
+
extra_body: Body | None = None,
|
|
263
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
264
|
+
) -> TaskIDList:
|
|
265
|
+
"""
|
|
266
|
+
Delete bare metal GPU cluster
|
|
267
|
+
|
|
268
|
+
Args:
|
|
269
|
+
delete_floatings: True if it is required to delete floating IPs assigned to the servers. Can't be
|
|
270
|
+
used with floatings.
|
|
271
|
+
|
|
272
|
+
floatings: Comma separated list of floating ids that should be deleted. Can't be used with
|
|
273
|
+
delete_floatings.
|
|
274
|
+
|
|
275
|
+
reserved_fixed_ips: Comma separated list of port IDs to be deleted with the servers
|
|
276
|
+
|
|
277
|
+
extra_headers: Send extra headers
|
|
278
|
+
|
|
279
|
+
extra_query: Add additional query parameters to the request
|
|
280
|
+
|
|
281
|
+
extra_body: Add additional JSON properties to the request
|
|
282
|
+
|
|
283
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
284
|
+
"""
|
|
285
|
+
if project_id is None:
|
|
286
|
+
project_id = self._client._get_cloud_project_id_path_param()
|
|
287
|
+
if region_id is None:
|
|
288
|
+
region_id = self._client._get_cloud_region_id_path_param()
|
|
289
|
+
if not cluster_id:
|
|
290
|
+
raise ValueError(f"Expected a non-empty value for `cluster_id` but received {cluster_id!r}")
|
|
291
|
+
return self._delete(
|
|
292
|
+
f"/cloud/v2/ai/clusters/{project_id}/{region_id}/{cluster_id}",
|
|
293
|
+
options=make_request_options(
|
|
294
|
+
extra_headers=extra_headers,
|
|
295
|
+
extra_query=extra_query,
|
|
296
|
+
extra_body=extra_body,
|
|
297
|
+
timeout=timeout,
|
|
298
|
+
query=maybe_transform(
|
|
299
|
+
{
|
|
300
|
+
"delete_floatings": delete_floatings,
|
|
301
|
+
"floatings": floatings,
|
|
302
|
+
"reserved_fixed_ips": reserved_fixed_ips,
|
|
303
|
+
},
|
|
304
|
+
gpu_baremetal_cluster_delete_params.GPUBaremetalClusterDeleteParams,
|
|
305
|
+
),
|
|
306
|
+
),
|
|
307
|
+
cast_to=TaskIDList,
|
|
308
|
+
)
|
|
309
|
+
|
|
310
|
+
def get(
|
|
311
|
+
self,
|
|
312
|
+
cluster_id: str,
|
|
313
|
+
*,
|
|
314
|
+
project_id: int | None = None,
|
|
315
|
+
region_id: int | None = None,
|
|
316
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
317
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
318
|
+
extra_headers: Headers | None = None,
|
|
319
|
+
extra_query: Query | None = None,
|
|
320
|
+
extra_body: Body | None = None,
|
|
321
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
322
|
+
) -> GPUBaremetalCluster:
|
|
323
|
+
"""
|
|
324
|
+
Get bare metal GPU cluster
|
|
325
|
+
|
|
326
|
+
Args:
|
|
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_id:
|
|
340
|
+
raise ValueError(f"Expected a non-empty value for `cluster_id` but received {cluster_id!r}")
|
|
341
|
+
return self._get(
|
|
342
|
+
f"/cloud/v2/ai/clusters/{project_id}/{region_id}/{cluster_id}",
|
|
343
|
+
options=make_request_options(
|
|
344
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
345
|
+
),
|
|
346
|
+
cast_to=GPUBaremetalCluster,
|
|
347
|
+
)
|
|
348
|
+
|
|
349
|
+
def powercycle_all_servers(
|
|
350
|
+
self,
|
|
351
|
+
cluster_id: str,
|
|
352
|
+
*,
|
|
353
|
+
project_id: int | None = None,
|
|
354
|
+
region_id: int | None = None,
|
|
355
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
356
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
357
|
+
extra_headers: Headers | None = None,
|
|
358
|
+
extra_query: Query | None = None,
|
|
359
|
+
extra_body: Body | None = None,
|
|
360
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
361
|
+
) -> GPUBaremetalClusterServerList:
|
|
362
|
+
"""
|
|
363
|
+
Stops and then starts all cluster servers, effectively performing a hard reboot.
|
|
364
|
+
|
|
365
|
+
Args:
|
|
366
|
+
extra_headers: Send extra headers
|
|
367
|
+
|
|
368
|
+
extra_query: Add additional query parameters to the request
|
|
369
|
+
|
|
370
|
+
extra_body: Add additional JSON properties to the request
|
|
371
|
+
|
|
372
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
373
|
+
"""
|
|
374
|
+
if project_id is None:
|
|
375
|
+
project_id = self._client._get_cloud_project_id_path_param()
|
|
376
|
+
if region_id is None:
|
|
377
|
+
region_id = self._client._get_cloud_region_id_path_param()
|
|
378
|
+
if not cluster_id:
|
|
379
|
+
raise ValueError(f"Expected a non-empty value for `cluster_id` but received {cluster_id!r}")
|
|
380
|
+
return self._post(
|
|
381
|
+
f"/cloud/v2/ai/clusters/{project_id}/{region_id}/{cluster_id}/powercycle",
|
|
382
|
+
options=make_request_options(
|
|
383
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
384
|
+
),
|
|
385
|
+
cast_to=GPUBaremetalClusterServerList,
|
|
386
|
+
)
|
|
387
|
+
|
|
388
|
+
def reboot_all_servers(
|
|
389
|
+
self,
|
|
390
|
+
cluster_id: str,
|
|
391
|
+
*,
|
|
392
|
+
project_id: int | None = None,
|
|
393
|
+
region_id: int | None = None,
|
|
394
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
395
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
396
|
+
extra_headers: Headers | None = None,
|
|
397
|
+
extra_query: Query | None = None,
|
|
398
|
+
extra_body: Body | None = None,
|
|
399
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
400
|
+
) -> GPUBaremetalClusterServerList:
|
|
401
|
+
"""
|
|
402
|
+
Reboot all bare metal GPU cluster servers
|
|
403
|
+
|
|
404
|
+
Args:
|
|
405
|
+
extra_headers: Send extra headers
|
|
406
|
+
|
|
407
|
+
extra_query: Add additional query parameters to the request
|
|
408
|
+
|
|
409
|
+
extra_body: Add additional JSON properties to the request
|
|
410
|
+
|
|
411
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
412
|
+
"""
|
|
413
|
+
if project_id is None:
|
|
414
|
+
project_id = self._client._get_cloud_project_id_path_param()
|
|
415
|
+
if region_id is None:
|
|
416
|
+
region_id = self._client._get_cloud_region_id_path_param()
|
|
417
|
+
if not cluster_id:
|
|
418
|
+
raise ValueError(f"Expected a non-empty value for `cluster_id` but received {cluster_id!r}")
|
|
419
|
+
return self._post(
|
|
420
|
+
f"/cloud/v2/ai/clusters/{project_id}/{region_id}/{cluster_id}/reboot",
|
|
421
|
+
options=make_request_options(
|
|
422
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
423
|
+
),
|
|
424
|
+
cast_to=GPUBaremetalClusterServerList,
|
|
425
|
+
)
|
|
426
|
+
|
|
427
|
+
def rebuild(
|
|
428
|
+
self,
|
|
429
|
+
cluster_id: str,
|
|
430
|
+
*,
|
|
431
|
+
project_id: int | None = None,
|
|
432
|
+
region_id: int | None = None,
|
|
433
|
+
nodes: List[str],
|
|
434
|
+
image_id: Optional[str] | NotGiven = NOT_GIVEN,
|
|
435
|
+
user_data: Optional[str] | NotGiven = NOT_GIVEN,
|
|
436
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
437
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
438
|
+
extra_headers: Headers | None = None,
|
|
439
|
+
extra_query: Query | None = None,
|
|
440
|
+
extra_body: Body | None = None,
|
|
441
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
442
|
+
) -> TaskIDList:
|
|
443
|
+
"""
|
|
444
|
+
All cluster nodes must be specified to update the cluster image.
|
|
445
|
+
|
|
446
|
+
Args:
|
|
447
|
+
nodes: List of nodes uuids to be rebuild
|
|
448
|
+
|
|
449
|
+
image_id: AI GPU image ID
|
|
450
|
+
|
|
451
|
+
user_data:
|
|
452
|
+
String in base64 format.Examples of the user_data:
|
|
453
|
+
https://cloudinit.readthedocs.io/en/latest/topics/examples.html
|
|
454
|
+
|
|
455
|
+
extra_headers: Send extra headers
|
|
456
|
+
|
|
457
|
+
extra_query: Add additional query parameters to the request
|
|
458
|
+
|
|
459
|
+
extra_body: Add additional JSON properties to the request
|
|
460
|
+
|
|
461
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
462
|
+
"""
|
|
463
|
+
if project_id is None:
|
|
464
|
+
project_id = self._client._get_cloud_project_id_path_param()
|
|
465
|
+
if region_id is None:
|
|
466
|
+
region_id = self._client._get_cloud_region_id_path_param()
|
|
467
|
+
if not cluster_id:
|
|
468
|
+
raise ValueError(f"Expected a non-empty value for `cluster_id` but received {cluster_id!r}")
|
|
469
|
+
return self._post(
|
|
470
|
+
f"/cloud/v1/ai/clusters/gpu/{project_id}/{region_id}/{cluster_id}/rebuild",
|
|
471
|
+
body=maybe_transform(
|
|
472
|
+
{
|
|
473
|
+
"nodes": nodes,
|
|
474
|
+
"image_id": image_id,
|
|
475
|
+
"user_data": user_data,
|
|
476
|
+
},
|
|
477
|
+
gpu_baremetal_cluster_rebuild_params.GPUBaremetalClusterRebuildParams,
|
|
478
|
+
),
|
|
479
|
+
options=make_request_options(
|
|
480
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
481
|
+
),
|
|
482
|
+
cast_to=TaskIDList,
|
|
483
|
+
)
|
|
484
|
+
|
|
485
|
+
def resize(
|
|
486
|
+
self,
|
|
487
|
+
cluster_id: str,
|
|
488
|
+
*,
|
|
489
|
+
project_id: int | None = None,
|
|
490
|
+
region_id: int | None = None,
|
|
491
|
+
instances_count: int,
|
|
492
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
493
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
494
|
+
extra_headers: Headers | None = None,
|
|
495
|
+
extra_query: Query | None = None,
|
|
496
|
+
extra_body: Body | None = None,
|
|
497
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
498
|
+
) -> TaskIDList:
|
|
499
|
+
"""
|
|
500
|
+
Resize bare metal GPU cluster
|
|
501
|
+
|
|
502
|
+
Args:
|
|
503
|
+
instances_count: Resized (total) number of instances
|
|
504
|
+
|
|
505
|
+
extra_headers: Send extra headers
|
|
506
|
+
|
|
507
|
+
extra_query: Add additional query parameters to the request
|
|
508
|
+
|
|
509
|
+
extra_body: Add additional JSON properties to the request
|
|
510
|
+
|
|
511
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
512
|
+
"""
|
|
513
|
+
if project_id is None:
|
|
514
|
+
project_id = self._client._get_cloud_project_id_path_param()
|
|
515
|
+
if region_id is None:
|
|
516
|
+
region_id = self._client._get_cloud_region_id_path_param()
|
|
517
|
+
if not cluster_id:
|
|
518
|
+
raise ValueError(f"Expected a non-empty value for `cluster_id` but received {cluster_id!r}")
|
|
519
|
+
return self._post(
|
|
520
|
+
f"/cloud/v1/ai/clusters/gpu/{project_id}/{region_id}/{cluster_id}/resize",
|
|
521
|
+
body=maybe_transform(
|
|
522
|
+
{"instances_count": instances_count},
|
|
523
|
+
gpu_baremetal_cluster_resize_params.GPUBaremetalClusterResizeParams,
|
|
524
|
+
),
|
|
525
|
+
options=make_request_options(
|
|
526
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
527
|
+
),
|
|
528
|
+
cast_to=TaskIDList,
|
|
529
|
+
)
|
|
530
|
+
|
|
531
|
+
def create_and_poll(
|
|
532
|
+
self,
|
|
533
|
+
*,
|
|
534
|
+
project_id: int | None = None,
|
|
535
|
+
region_id: int | None = None,
|
|
536
|
+
flavor: str,
|
|
537
|
+
image_id: str,
|
|
538
|
+
interfaces: Iterable[gpu_baremetal_cluster_create_params.Interface],
|
|
539
|
+
name: str,
|
|
540
|
+
instances_count: int | NotGiven = NOT_GIVEN,
|
|
541
|
+
ssh_key_name: str | NotGiven = NOT_GIVEN,
|
|
542
|
+
tags: TagUpdateMapParam | NotGiven = NOT_GIVEN,
|
|
543
|
+
polling_interval_seconds: int | NotGiven = NOT_GIVEN,
|
|
544
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
545
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
546
|
+
extra_headers: Headers | None = None,
|
|
547
|
+
extra_query: Query | None = None,
|
|
548
|
+
extra_body: Body | None = None,
|
|
549
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
550
|
+
) -> GPUBaremetalCluster:
|
|
551
|
+
"""
|
|
552
|
+
Create a bare metal GPU cluster and wait for it to be ready.
|
|
553
|
+
"""
|
|
554
|
+
response = self.create(
|
|
555
|
+
project_id=project_id,
|
|
556
|
+
region_id=region_id,
|
|
557
|
+
flavor=flavor,
|
|
558
|
+
image_id=image_id,
|
|
559
|
+
interfaces=interfaces,
|
|
560
|
+
name=name,
|
|
561
|
+
instances_count=instances_count,
|
|
562
|
+
ssh_key_name=ssh_key_name,
|
|
563
|
+
tags=tags,
|
|
564
|
+
extra_headers=extra_headers,
|
|
565
|
+
extra_query=extra_query,
|
|
566
|
+
extra_body=extra_body,
|
|
567
|
+
timeout=timeout,
|
|
568
|
+
)
|
|
569
|
+
if not response.tasks or len(response.tasks) != 1:
|
|
570
|
+
raise ValueError(f"Expected exactly one task to be created")
|
|
571
|
+
task = self._client.cloud.tasks.poll(
|
|
572
|
+
response.tasks[0],
|
|
573
|
+
extra_headers=extra_headers,
|
|
574
|
+
extra_query=extra_query,
|
|
575
|
+
extra_body=extra_body,
|
|
576
|
+
polling_interval_seconds=polling_interval_seconds,
|
|
577
|
+
)
|
|
578
|
+
if not task.created_resources or not task.created_resources.ai_clusters:
|
|
579
|
+
raise ValueError("No cluster was created")
|
|
580
|
+
cluster_id = task.created_resources.ai_clusters[0]
|
|
581
|
+
return self.get(
|
|
582
|
+
cluster_id=cluster_id,
|
|
583
|
+
project_id=project_id,
|
|
584
|
+
region_id=region_id,
|
|
585
|
+
extra_headers=extra_headers,
|
|
586
|
+
extra_query=extra_query,
|
|
587
|
+
extra_body=extra_body,
|
|
588
|
+
timeout=timeout,
|
|
589
|
+
)
|
|
590
|
+
|
|
591
|
+
def rebuild_and_poll(
|
|
592
|
+
self,
|
|
593
|
+
cluster_id: str,
|
|
594
|
+
*,
|
|
595
|
+
project_id: int | None = None,
|
|
596
|
+
region_id: int | None = None,
|
|
597
|
+
nodes: List[str],
|
|
598
|
+
image_id: Optional[str] | NotGiven = NOT_GIVEN,
|
|
599
|
+
user_data: Optional[str] | NotGiven = NOT_GIVEN,
|
|
600
|
+
polling_interval_seconds: int | NotGiven = NOT_GIVEN,
|
|
601
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
602
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
603
|
+
extra_headers: Headers | None = None,
|
|
604
|
+
extra_query: Query | None = None,
|
|
605
|
+
extra_body: Body | None = None,
|
|
606
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
607
|
+
) -> GPUBaremetalCluster:
|
|
608
|
+
"""
|
|
609
|
+
Rebuild a bare metal GPU cluster and wait for it to be ready.
|
|
610
|
+
"""
|
|
611
|
+
response = self.rebuild(
|
|
612
|
+
cluster_id=cluster_id,
|
|
613
|
+
project_id=project_id,
|
|
614
|
+
region_id=region_id,
|
|
615
|
+
nodes=nodes,
|
|
616
|
+
image_id=image_id,
|
|
617
|
+
user_data=user_data,
|
|
618
|
+
extra_headers=extra_headers,
|
|
619
|
+
extra_query=extra_query,
|
|
620
|
+
extra_body=extra_body,
|
|
621
|
+
timeout=timeout,
|
|
622
|
+
)
|
|
623
|
+
if not response.tasks or len(response.tasks) != 1:
|
|
624
|
+
raise ValueError(f"Expected exactly one task to be created")
|
|
625
|
+
self._client.cloud.tasks.poll(
|
|
626
|
+
response.tasks[0],
|
|
627
|
+
extra_headers=extra_headers,
|
|
628
|
+
extra_query=extra_query,
|
|
629
|
+
extra_body=extra_body,
|
|
630
|
+
polling_interval_seconds=polling_interval_seconds,
|
|
631
|
+
)
|
|
632
|
+
return self.get(
|
|
633
|
+
cluster_id=cluster_id,
|
|
634
|
+
project_id=project_id,
|
|
635
|
+
region_id=region_id,
|
|
636
|
+
extra_headers=extra_headers,
|
|
637
|
+
extra_query=extra_query,
|
|
638
|
+
extra_body=extra_body,
|
|
639
|
+
timeout=timeout,
|
|
640
|
+
)
|
|
641
|
+
|
|
642
|
+
def resize_and_poll(
|
|
643
|
+
self,
|
|
644
|
+
cluster_id: str,
|
|
645
|
+
*,
|
|
646
|
+
project_id: int | None = None,
|
|
647
|
+
region_id: int | None = None,
|
|
648
|
+
instances_count: int,
|
|
649
|
+
polling_interval_seconds: int | NotGiven = NOT_GIVEN,
|
|
650
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
651
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
652
|
+
extra_headers: Headers | None = None,
|
|
653
|
+
extra_query: Query | None = None,
|
|
654
|
+
extra_body: Body | None = None,
|
|
655
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
656
|
+
) -> GPUBaremetalCluster:
|
|
657
|
+
"""
|
|
658
|
+
Resize a bare metal GPU cluster and wait for it to be ready.
|
|
659
|
+
"""
|
|
660
|
+
response = self.resize(
|
|
661
|
+
cluster_id=cluster_id,
|
|
662
|
+
project_id=project_id,
|
|
663
|
+
region_id=region_id,
|
|
664
|
+
instances_count=instances_count,
|
|
665
|
+
extra_headers=extra_headers,
|
|
666
|
+
extra_query=extra_query,
|
|
667
|
+
extra_body=extra_body,
|
|
668
|
+
timeout=timeout,
|
|
669
|
+
)
|
|
670
|
+
if not response.tasks or len(response.tasks) != 1:
|
|
671
|
+
raise ValueError(f"Expected exactly one task to be created")
|
|
672
|
+
self._client.cloud.tasks.poll(
|
|
673
|
+
response.tasks[0],
|
|
674
|
+
extra_headers=extra_headers,
|
|
675
|
+
extra_query=extra_query,
|
|
676
|
+
extra_body=extra_body,
|
|
677
|
+
polling_interval_seconds=polling_interval_seconds,
|
|
678
|
+
)
|
|
679
|
+
return self.get(
|
|
680
|
+
cluster_id=cluster_id,
|
|
681
|
+
project_id=project_id,
|
|
682
|
+
region_id=region_id,
|
|
683
|
+
extra_headers=extra_headers,
|
|
684
|
+
extra_query=extra_query,
|
|
685
|
+
extra_body=extra_body,
|
|
686
|
+
timeout=timeout,
|
|
687
|
+
)
|
|
688
|
+
|
|
689
|
+
|
|
690
|
+
class AsyncGPUBaremetalClustersResource(AsyncAPIResource):
|
|
691
|
+
@cached_property
|
|
692
|
+
def interfaces(self) -> AsyncInterfacesResource:
|
|
693
|
+
return AsyncInterfacesResource(self._client)
|
|
694
|
+
|
|
695
|
+
@cached_property
|
|
696
|
+
def servers(self) -> AsyncServersResource:
|
|
697
|
+
return AsyncServersResource(self._client)
|
|
698
|
+
|
|
699
|
+
@cached_property
|
|
700
|
+
def flavors(self) -> AsyncFlavorsResource:
|
|
701
|
+
return AsyncFlavorsResource(self._client)
|
|
702
|
+
|
|
703
|
+
@cached_property
|
|
704
|
+
def images(self) -> AsyncImagesResource:
|
|
705
|
+
return AsyncImagesResource(self._client)
|
|
706
|
+
|
|
707
|
+
@cached_property
|
|
708
|
+
def with_raw_response(self) -> AsyncGPUBaremetalClustersResourceWithRawResponse:
|
|
709
|
+
"""
|
|
710
|
+
This property can be used as a prefix for any HTTP method call to return
|
|
711
|
+
the raw response object instead of the parsed content.
|
|
712
|
+
|
|
713
|
+
For more information, see https://www.github.com/G-Core/gcore-python#accessing-raw-response-data-eg-headers
|
|
714
|
+
"""
|
|
715
|
+
return AsyncGPUBaremetalClustersResourceWithRawResponse(self)
|
|
716
|
+
|
|
717
|
+
@cached_property
|
|
718
|
+
def with_streaming_response(self) -> AsyncGPUBaremetalClustersResourceWithStreamingResponse:
|
|
719
|
+
"""
|
|
720
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
721
|
+
|
|
722
|
+
For more information, see https://www.github.com/G-Core/gcore-python#with_streaming_response
|
|
723
|
+
"""
|
|
724
|
+
return AsyncGPUBaremetalClustersResourceWithStreamingResponse(self)
|
|
725
|
+
|
|
726
|
+
async def create(
|
|
727
|
+
self,
|
|
728
|
+
*,
|
|
729
|
+
project_id: int | None = None,
|
|
730
|
+
region_id: int | None = None,
|
|
731
|
+
flavor: str,
|
|
732
|
+
image_id: str,
|
|
733
|
+
interfaces: Iterable[gpu_baremetal_cluster_create_params.Interface],
|
|
734
|
+
name: str,
|
|
735
|
+
instances_count: int | NotGiven = NOT_GIVEN,
|
|
736
|
+
password: str | NotGiven = NOT_GIVEN,
|
|
737
|
+
ssh_key_name: str | NotGiven = NOT_GIVEN,
|
|
738
|
+
tags: TagUpdateMapParam | NotGiven = NOT_GIVEN,
|
|
739
|
+
user_data: str | NotGiven = NOT_GIVEN,
|
|
740
|
+
username: str | NotGiven = NOT_GIVEN,
|
|
741
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
742
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
743
|
+
extra_headers: Headers | None = None,
|
|
744
|
+
extra_query: Query | None = None,
|
|
745
|
+
extra_body: Body | None = None,
|
|
746
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
747
|
+
) -> TaskIDList:
|
|
748
|
+
"""
|
|
749
|
+
Create bare metal GPU cluster
|
|
750
|
+
|
|
751
|
+
Args:
|
|
752
|
+
flavor: Flavor name
|
|
753
|
+
|
|
754
|
+
image_id: Image ID
|
|
755
|
+
|
|
756
|
+
interfaces: A list of network interfaces for the server. You can create one or more
|
|
757
|
+
interfaces - private, public, or both.
|
|
758
|
+
|
|
759
|
+
name: GPU Cluster name
|
|
760
|
+
|
|
761
|
+
instances_count: Number of servers to create
|
|
762
|
+
|
|
763
|
+
password: A password for a bare metal server. This parameter is used to set a password for
|
|
764
|
+
the "Admin" user on a Windows instance, a default user or a new user on a Linux
|
|
765
|
+
instance
|
|
766
|
+
|
|
767
|
+
ssh_key_name: Specifies the name of the SSH keypair, created via the
|
|
768
|
+
<a href="#operation/SSHKeyCollectionViewSet.post">/v1/ssh_keys endpoint</a>.
|
|
769
|
+
|
|
770
|
+
tags: Key-value tags to associate with the resource. A tag is a key-value pair that
|
|
771
|
+
can be associated with a resource, enabling efficient filtering and grouping for
|
|
772
|
+
better organization and management. Some tags are read-only and cannot be
|
|
773
|
+
modified by the user. Tags are also integrated with cost reports, allowing cost
|
|
774
|
+
data to be filtered based on tag keys or values.
|
|
775
|
+
|
|
776
|
+
user_data: String in base64 format. Must not be passed together with 'username' or
|
|
777
|
+
'password'. Examples of the user_data:
|
|
778
|
+
https://cloudinit.readthedocs.io/en/latest/topics/examples.html
|
|
779
|
+
|
|
780
|
+
username: A name of a new user in the Linux instance. It may be passed with a 'password'
|
|
781
|
+
parameter
|
|
782
|
+
|
|
783
|
+
extra_headers: Send extra headers
|
|
784
|
+
|
|
785
|
+
extra_query: Add additional query parameters to the request
|
|
786
|
+
|
|
787
|
+
extra_body: Add additional JSON properties to the request
|
|
788
|
+
|
|
789
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
790
|
+
"""
|
|
791
|
+
if project_id is None:
|
|
792
|
+
project_id = self._client._get_cloud_project_id_path_param()
|
|
793
|
+
if region_id is None:
|
|
794
|
+
region_id = self._client._get_cloud_region_id_path_param()
|
|
795
|
+
return await self._post(
|
|
796
|
+
f"/cloud/v1/ai/clusters/gpu/{project_id}/{region_id}",
|
|
797
|
+
body=await async_maybe_transform(
|
|
798
|
+
{
|
|
799
|
+
"flavor": flavor,
|
|
800
|
+
"image_id": image_id,
|
|
801
|
+
"interfaces": interfaces,
|
|
802
|
+
"name": name,
|
|
803
|
+
"instances_count": instances_count,
|
|
804
|
+
"password": password,
|
|
805
|
+
"ssh_key_name": ssh_key_name,
|
|
806
|
+
"tags": tags,
|
|
807
|
+
"user_data": user_data,
|
|
808
|
+
"username": username,
|
|
809
|
+
},
|
|
810
|
+
gpu_baremetal_cluster_create_params.GPUBaremetalClusterCreateParams,
|
|
811
|
+
),
|
|
812
|
+
options=make_request_options(
|
|
813
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
814
|
+
),
|
|
815
|
+
cast_to=TaskIDList,
|
|
816
|
+
)
|
|
817
|
+
|
|
818
|
+
def list(
|
|
819
|
+
self,
|
|
820
|
+
*,
|
|
821
|
+
project_id: int | None = None,
|
|
822
|
+
region_id: int | None = None,
|
|
823
|
+
limit: int | NotGiven = NOT_GIVEN,
|
|
824
|
+
offset: int | NotGiven = NOT_GIVEN,
|
|
825
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
826
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
827
|
+
extra_headers: Headers | None = None,
|
|
828
|
+
extra_query: Query | None = None,
|
|
829
|
+
extra_body: Body | None = None,
|
|
830
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
831
|
+
) -> AsyncPaginator[GPUBaremetalCluster, AsyncOffsetPage[GPUBaremetalCluster]]:
|
|
832
|
+
"""
|
|
833
|
+
List bare metal GPU clusters
|
|
834
|
+
|
|
835
|
+
Args:
|
|
836
|
+
limit: Limit the number of returned clusters
|
|
837
|
+
|
|
838
|
+
offset: Offset value is used to exclude the first set of records from the result
|
|
839
|
+
|
|
840
|
+
extra_headers: Send extra headers
|
|
841
|
+
|
|
842
|
+
extra_query: Add additional query parameters to the request
|
|
843
|
+
|
|
844
|
+
extra_body: Add additional JSON properties to the request
|
|
845
|
+
|
|
846
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
847
|
+
"""
|
|
848
|
+
if project_id is None:
|
|
849
|
+
project_id = self._client._get_cloud_project_id_path_param()
|
|
850
|
+
if region_id is None:
|
|
851
|
+
region_id = self._client._get_cloud_region_id_path_param()
|
|
852
|
+
return self._get_api_list(
|
|
853
|
+
f"/cloud/v2/ai/clusters/{project_id}/{region_id}",
|
|
854
|
+
page=AsyncOffsetPage[GPUBaremetalCluster],
|
|
855
|
+
options=make_request_options(
|
|
856
|
+
extra_headers=extra_headers,
|
|
857
|
+
extra_query=extra_query,
|
|
858
|
+
extra_body=extra_body,
|
|
859
|
+
timeout=timeout,
|
|
860
|
+
query=maybe_transform(
|
|
861
|
+
{
|
|
862
|
+
"limit": limit,
|
|
863
|
+
"offset": offset,
|
|
864
|
+
},
|
|
865
|
+
gpu_baremetal_cluster_list_params.GPUBaremetalClusterListParams,
|
|
866
|
+
),
|
|
867
|
+
),
|
|
868
|
+
model=GPUBaremetalCluster,
|
|
869
|
+
)
|
|
870
|
+
|
|
871
|
+
async def delete(
|
|
872
|
+
self,
|
|
873
|
+
cluster_id: str,
|
|
874
|
+
*,
|
|
875
|
+
project_id: int | None = None,
|
|
876
|
+
region_id: int | None = None,
|
|
877
|
+
delete_floatings: bool | NotGiven = NOT_GIVEN,
|
|
878
|
+
floatings: str | NotGiven = NOT_GIVEN,
|
|
879
|
+
reserved_fixed_ips: str | NotGiven = NOT_GIVEN,
|
|
880
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
881
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
882
|
+
extra_headers: Headers | None = None,
|
|
883
|
+
extra_query: Query | None = None,
|
|
884
|
+
extra_body: Body | None = None,
|
|
885
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
886
|
+
) -> TaskIDList:
|
|
887
|
+
"""
|
|
888
|
+
Delete bare metal GPU cluster
|
|
889
|
+
|
|
890
|
+
Args:
|
|
891
|
+
delete_floatings: True if it is required to delete floating IPs assigned to the servers. Can't be
|
|
892
|
+
used with floatings.
|
|
893
|
+
|
|
894
|
+
floatings: Comma separated list of floating ids that should be deleted. Can't be used with
|
|
895
|
+
delete_floatings.
|
|
896
|
+
|
|
897
|
+
reserved_fixed_ips: Comma separated list of port IDs to be deleted with the servers
|
|
898
|
+
|
|
899
|
+
extra_headers: Send extra headers
|
|
900
|
+
|
|
901
|
+
extra_query: Add additional query parameters to the request
|
|
902
|
+
|
|
903
|
+
extra_body: Add additional JSON properties to the request
|
|
904
|
+
|
|
905
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
906
|
+
"""
|
|
907
|
+
if project_id is None:
|
|
908
|
+
project_id = self._client._get_cloud_project_id_path_param()
|
|
909
|
+
if region_id is None:
|
|
910
|
+
region_id = self._client._get_cloud_region_id_path_param()
|
|
911
|
+
if not cluster_id:
|
|
912
|
+
raise ValueError(f"Expected a non-empty value for `cluster_id` but received {cluster_id!r}")
|
|
913
|
+
return await self._delete(
|
|
914
|
+
f"/cloud/v2/ai/clusters/{project_id}/{region_id}/{cluster_id}",
|
|
915
|
+
options=make_request_options(
|
|
916
|
+
extra_headers=extra_headers,
|
|
917
|
+
extra_query=extra_query,
|
|
918
|
+
extra_body=extra_body,
|
|
919
|
+
timeout=timeout,
|
|
920
|
+
query=await async_maybe_transform(
|
|
921
|
+
{
|
|
922
|
+
"delete_floatings": delete_floatings,
|
|
923
|
+
"floatings": floatings,
|
|
924
|
+
"reserved_fixed_ips": reserved_fixed_ips,
|
|
925
|
+
},
|
|
926
|
+
gpu_baremetal_cluster_delete_params.GPUBaremetalClusterDeleteParams,
|
|
927
|
+
),
|
|
928
|
+
),
|
|
929
|
+
cast_to=TaskIDList,
|
|
930
|
+
)
|
|
931
|
+
|
|
932
|
+
async def get(
|
|
933
|
+
self,
|
|
934
|
+
cluster_id: str,
|
|
935
|
+
*,
|
|
936
|
+
project_id: int | None = None,
|
|
937
|
+
region_id: int | None = None,
|
|
938
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
939
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
940
|
+
extra_headers: Headers | None = None,
|
|
941
|
+
extra_query: Query | None = None,
|
|
942
|
+
extra_body: Body | None = None,
|
|
943
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
944
|
+
) -> GPUBaremetalCluster:
|
|
945
|
+
"""
|
|
946
|
+
Get bare metal GPU cluster
|
|
947
|
+
|
|
948
|
+
Args:
|
|
949
|
+
extra_headers: Send extra headers
|
|
950
|
+
|
|
951
|
+
extra_query: Add additional query parameters to the request
|
|
952
|
+
|
|
953
|
+
extra_body: Add additional JSON properties to the request
|
|
954
|
+
|
|
955
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
956
|
+
"""
|
|
957
|
+
if project_id is None:
|
|
958
|
+
project_id = self._client._get_cloud_project_id_path_param()
|
|
959
|
+
if region_id is None:
|
|
960
|
+
region_id = self._client._get_cloud_region_id_path_param()
|
|
961
|
+
if not cluster_id:
|
|
962
|
+
raise ValueError(f"Expected a non-empty value for `cluster_id` but received {cluster_id!r}")
|
|
963
|
+
return await self._get(
|
|
964
|
+
f"/cloud/v2/ai/clusters/{project_id}/{region_id}/{cluster_id}",
|
|
965
|
+
options=make_request_options(
|
|
966
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
967
|
+
),
|
|
968
|
+
cast_to=GPUBaremetalCluster,
|
|
969
|
+
)
|
|
970
|
+
|
|
971
|
+
async def powercycle_all_servers(
|
|
972
|
+
self,
|
|
973
|
+
cluster_id: str,
|
|
974
|
+
*,
|
|
975
|
+
project_id: int | None = None,
|
|
976
|
+
region_id: int | None = None,
|
|
977
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
978
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
979
|
+
extra_headers: Headers | None = None,
|
|
980
|
+
extra_query: Query | None = None,
|
|
981
|
+
extra_body: Body | None = None,
|
|
982
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
983
|
+
) -> GPUBaremetalClusterServerList:
|
|
984
|
+
"""
|
|
985
|
+
Stops and then starts all cluster servers, effectively performing a hard reboot.
|
|
986
|
+
|
|
987
|
+
Args:
|
|
988
|
+
extra_headers: Send extra headers
|
|
989
|
+
|
|
990
|
+
extra_query: Add additional query parameters to the request
|
|
991
|
+
|
|
992
|
+
extra_body: Add additional JSON properties to the request
|
|
993
|
+
|
|
994
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
995
|
+
"""
|
|
996
|
+
if project_id is None:
|
|
997
|
+
project_id = self._client._get_cloud_project_id_path_param()
|
|
998
|
+
if region_id is None:
|
|
999
|
+
region_id = self._client._get_cloud_region_id_path_param()
|
|
1000
|
+
if not cluster_id:
|
|
1001
|
+
raise ValueError(f"Expected a non-empty value for `cluster_id` but received {cluster_id!r}")
|
|
1002
|
+
return await self._post(
|
|
1003
|
+
f"/cloud/v2/ai/clusters/{project_id}/{region_id}/{cluster_id}/powercycle",
|
|
1004
|
+
options=make_request_options(
|
|
1005
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
1006
|
+
),
|
|
1007
|
+
cast_to=GPUBaremetalClusterServerList,
|
|
1008
|
+
)
|
|
1009
|
+
|
|
1010
|
+
async def reboot_all_servers(
|
|
1011
|
+
self,
|
|
1012
|
+
cluster_id: str,
|
|
1013
|
+
*,
|
|
1014
|
+
project_id: int | None = None,
|
|
1015
|
+
region_id: int | None = None,
|
|
1016
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
1017
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
1018
|
+
extra_headers: Headers | None = None,
|
|
1019
|
+
extra_query: Query | None = None,
|
|
1020
|
+
extra_body: Body | None = None,
|
|
1021
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
1022
|
+
) -> GPUBaremetalClusterServerList:
|
|
1023
|
+
"""
|
|
1024
|
+
Reboot all bare metal GPU cluster servers
|
|
1025
|
+
|
|
1026
|
+
Args:
|
|
1027
|
+
extra_headers: Send extra headers
|
|
1028
|
+
|
|
1029
|
+
extra_query: Add additional query parameters to the request
|
|
1030
|
+
|
|
1031
|
+
extra_body: Add additional JSON properties to the request
|
|
1032
|
+
|
|
1033
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
1034
|
+
"""
|
|
1035
|
+
if project_id is None:
|
|
1036
|
+
project_id = self._client._get_cloud_project_id_path_param()
|
|
1037
|
+
if region_id is None:
|
|
1038
|
+
region_id = self._client._get_cloud_region_id_path_param()
|
|
1039
|
+
if not cluster_id:
|
|
1040
|
+
raise ValueError(f"Expected a non-empty value for `cluster_id` but received {cluster_id!r}")
|
|
1041
|
+
return await self._post(
|
|
1042
|
+
f"/cloud/v2/ai/clusters/{project_id}/{region_id}/{cluster_id}/reboot",
|
|
1043
|
+
options=make_request_options(
|
|
1044
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
1045
|
+
),
|
|
1046
|
+
cast_to=GPUBaremetalClusterServerList,
|
|
1047
|
+
)
|
|
1048
|
+
|
|
1049
|
+
async def rebuild(
|
|
1050
|
+
self,
|
|
1051
|
+
cluster_id: str,
|
|
1052
|
+
*,
|
|
1053
|
+
project_id: int | None = None,
|
|
1054
|
+
region_id: int | None = None,
|
|
1055
|
+
nodes: List[str],
|
|
1056
|
+
image_id: Optional[str] | NotGiven = NOT_GIVEN,
|
|
1057
|
+
user_data: Optional[str] | NotGiven = NOT_GIVEN,
|
|
1058
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
1059
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
1060
|
+
extra_headers: Headers | None = None,
|
|
1061
|
+
extra_query: Query | None = None,
|
|
1062
|
+
extra_body: Body | None = None,
|
|
1063
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
1064
|
+
) -> TaskIDList:
|
|
1065
|
+
"""
|
|
1066
|
+
All cluster nodes must be specified to update the cluster image.
|
|
1067
|
+
|
|
1068
|
+
Args:
|
|
1069
|
+
nodes: List of nodes uuids to be rebuild
|
|
1070
|
+
|
|
1071
|
+
image_id: AI GPU image ID
|
|
1072
|
+
|
|
1073
|
+
user_data:
|
|
1074
|
+
String in base64 format.Examples of the user_data:
|
|
1075
|
+
https://cloudinit.readthedocs.io/en/latest/topics/examples.html
|
|
1076
|
+
|
|
1077
|
+
extra_headers: Send extra headers
|
|
1078
|
+
|
|
1079
|
+
extra_query: Add additional query parameters to the request
|
|
1080
|
+
|
|
1081
|
+
extra_body: Add additional JSON properties to the request
|
|
1082
|
+
|
|
1083
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
1084
|
+
"""
|
|
1085
|
+
if project_id is None:
|
|
1086
|
+
project_id = self._client._get_cloud_project_id_path_param()
|
|
1087
|
+
if region_id is None:
|
|
1088
|
+
region_id = self._client._get_cloud_region_id_path_param()
|
|
1089
|
+
if not cluster_id:
|
|
1090
|
+
raise ValueError(f"Expected a non-empty value for `cluster_id` but received {cluster_id!r}")
|
|
1091
|
+
return await self._post(
|
|
1092
|
+
f"/cloud/v1/ai/clusters/gpu/{project_id}/{region_id}/{cluster_id}/rebuild",
|
|
1093
|
+
body=await async_maybe_transform(
|
|
1094
|
+
{
|
|
1095
|
+
"nodes": nodes,
|
|
1096
|
+
"image_id": image_id,
|
|
1097
|
+
"user_data": user_data,
|
|
1098
|
+
},
|
|
1099
|
+
gpu_baremetal_cluster_rebuild_params.GPUBaremetalClusterRebuildParams,
|
|
1100
|
+
),
|
|
1101
|
+
options=make_request_options(
|
|
1102
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
1103
|
+
),
|
|
1104
|
+
cast_to=TaskIDList,
|
|
1105
|
+
)
|
|
1106
|
+
|
|
1107
|
+
async def resize(
|
|
1108
|
+
self,
|
|
1109
|
+
cluster_id: str,
|
|
1110
|
+
*,
|
|
1111
|
+
project_id: int | None = None,
|
|
1112
|
+
region_id: int | None = None,
|
|
1113
|
+
instances_count: int,
|
|
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
|
+
) -> TaskIDList:
|
|
1121
|
+
"""
|
|
1122
|
+
Resize bare metal GPU cluster
|
|
1123
|
+
|
|
1124
|
+
Args:
|
|
1125
|
+
instances_count: Resized (total) number of instances
|
|
1126
|
+
|
|
1127
|
+
extra_headers: Send extra headers
|
|
1128
|
+
|
|
1129
|
+
extra_query: Add additional query parameters to the request
|
|
1130
|
+
|
|
1131
|
+
extra_body: Add additional JSON properties to the request
|
|
1132
|
+
|
|
1133
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
1134
|
+
"""
|
|
1135
|
+
if project_id is None:
|
|
1136
|
+
project_id = self._client._get_cloud_project_id_path_param()
|
|
1137
|
+
if region_id is None:
|
|
1138
|
+
region_id = self._client._get_cloud_region_id_path_param()
|
|
1139
|
+
if not cluster_id:
|
|
1140
|
+
raise ValueError(f"Expected a non-empty value for `cluster_id` but received {cluster_id!r}")
|
|
1141
|
+
return await self._post(
|
|
1142
|
+
f"/cloud/v1/ai/clusters/gpu/{project_id}/{region_id}/{cluster_id}/resize",
|
|
1143
|
+
body=await async_maybe_transform(
|
|
1144
|
+
{"instances_count": instances_count},
|
|
1145
|
+
gpu_baremetal_cluster_resize_params.GPUBaremetalClusterResizeParams,
|
|
1146
|
+
),
|
|
1147
|
+
options=make_request_options(
|
|
1148
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
1149
|
+
),
|
|
1150
|
+
cast_to=TaskIDList,
|
|
1151
|
+
)
|
|
1152
|
+
|
|
1153
|
+
async def create_and_poll(
|
|
1154
|
+
self,
|
|
1155
|
+
*,
|
|
1156
|
+
project_id: int | None = None,
|
|
1157
|
+
region_id: int | None = None,
|
|
1158
|
+
flavor: str,
|
|
1159
|
+
image_id: str,
|
|
1160
|
+
interfaces: Iterable[gpu_baremetal_cluster_create_params.Interface],
|
|
1161
|
+
name: str,
|
|
1162
|
+
instances_count: int | NotGiven = NOT_GIVEN,
|
|
1163
|
+
ssh_key_name: str | NotGiven = NOT_GIVEN,
|
|
1164
|
+
tags: TagUpdateMapParam | NotGiven = NOT_GIVEN,
|
|
1165
|
+
polling_interval_seconds: int | NotGiven = NOT_GIVEN,
|
|
1166
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
1167
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
1168
|
+
extra_headers: Headers | None = None,
|
|
1169
|
+
extra_query: Query | None = None,
|
|
1170
|
+
extra_body: Body | None = None,
|
|
1171
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
1172
|
+
) -> GPUBaremetalCluster:
|
|
1173
|
+
"""
|
|
1174
|
+
Create a bare metal GPU cluster and wait for it to be ready.
|
|
1175
|
+
"""
|
|
1176
|
+
response = await self.create(
|
|
1177
|
+
project_id=project_id,
|
|
1178
|
+
region_id=region_id,
|
|
1179
|
+
flavor=flavor,
|
|
1180
|
+
image_id=image_id,
|
|
1181
|
+
interfaces=interfaces,
|
|
1182
|
+
name=name,
|
|
1183
|
+
instances_count=instances_count,
|
|
1184
|
+
ssh_key_name=ssh_key_name,
|
|
1185
|
+
tags=tags,
|
|
1186
|
+
extra_headers=extra_headers,
|
|
1187
|
+
extra_query=extra_query,
|
|
1188
|
+
extra_body=extra_body,
|
|
1189
|
+
timeout=timeout,
|
|
1190
|
+
)
|
|
1191
|
+
if not response.tasks or len(response.tasks) != 1:
|
|
1192
|
+
raise ValueError(f"Expected exactly one task to be created")
|
|
1193
|
+
task = await self._client.cloud.tasks.poll(
|
|
1194
|
+
response.tasks[0],
|
|
1195
|
+
extra_headers=extra_headers,
|
|
1196
|
+
extra_query=extra_query,
|
|
1197
|
+
extra_body=extra_body,
|
|
1198
|
+
polling_interval_seconds=polling_interval_seconds,
|
|
1199
|
+
)
|
|
1200
|
+
if not task.created_resources or not task.created_resources.ai_clusters:
|
|
1201
|
+
raise ValueError("No cluster was created")
|
|
1202
|
+
cluster_id = task.created_resources.ai_clusters[0]
|
|
1203
|
+
return await self.get(
|
|
1204
|
+
cluster_id=cluster_id,
|
|
1205
|
+
project_id=project_id,
|
|
1206
|
+
region_id=region_id,
|
|
1207
|
+
extra_headers=extra_headers,
|
|
1208
|
+
extra_query=extra_query,
|
|
1209
|
+
extra_body=extra_body,
|
|
1210
|
+
timeout=timeout,
|
|
1211
|
+
)
|
|
1212
|
+
|
|
1213
|
+
async def rebuild_and_poll(
|
|
1214
|
+
self,
|
|
1215
|
+
cluster_id: str,
|
|
1216
|
+
*,
|
|
1217
|
+
project_id: int | None = None,
|
|
1218
|
+
region_id: int | None = None,
|
|
1219
|
+
nodes: List[str],
|
|
1220
|
+
image_id: Optional[str] | NotGiven = NOT_GIVEN,
|
|
1221
|
+
user_data: Optional[str] | NotGiven = NOT_GIVEN,
|
|
1222
|
+
polling_interval_seconds: int | NotGiven = NOT_GIVEN,
|
|
1223
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
1224
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
1225
|
+
extra_headers: Headers | None = None,
|
|
1226
|
+
extra_query: Query | None = None,
|
|
1227
|
+
extra_body: Body | None = None,
|
|
1228
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
1229
|
+
) -> GPUBaremetalCluster:
|
|
1230
|
+
"""
|
|
1231
|
+
Rebuild a bare metal GPU cluster and wait for it to be ready.
|
|
1232
|
+
"""
|
|
1233
|
+
response = await self.rebuild(
|
|
1234
|
+
cluster_id=cluster_id,
|
|
1235
|
+
project_id=project_id,
|
|
1236
|
+
region_id=region_id,
|
|
1237
|
+
nodes=nodes,
|
|
1238
|
+
image_id=image_id,
|
|
1239
|
+
user_data=user_data,
|
|
1240
|
+
extra_headers=extra_headers,
|
|
1241
|
+
extra_query=extra_query,
|
|
1242
|
+
extra_body=extra_body,
|
|
1243
|
+
timeout=timeout,
|
|
1244
|
+
)
|
|
1245
|
+
if not response.tasks or len(response.tasks) != 1:
|
|
1246
|
+
raise ValueError(f"Expected exactly one task to be created")
|
|
1247
|
+
await self._client.cloud.tasks.poll(
|
|
1248
|
+
response.tasks[0],
|
|
1249
|
+
extra_headers=extra_headers,
|
|
1250
|
+
extra_query=extra_query,
|
|
1251
|
+
extra_body=extra_body,
|
|
1252
|
+
polling_interval_seconds=polling_interval_seconds,
|
|
1253
|
+
)
|
|
1254
|
+
return await self.get(
|
|
1255
|
+
cluster_id=cluster_id,
|
|
1256
|
+
project_id=project_id,
|
|
1257
|
+
region_id=region_id,
|
|
1258
|
+
extra_headers=extra_headers,
|
|
1259
|
+
extra_query=extra_query,
|
|
1260
|
+
extra_body=extra_body,
|
|
1261
|
+
timeout=timeout,
|
|
1262
|
+
)
|
|
1263
|
+
|
|
1264
|
+
async def resize_and_poll(
|
|
1265
|
+
self,
|
|
1266
|
+
cluster_id: str,
|
|
1267
|
+
*,
|
|
1268
|
+
project_id: int | None = None,
|
|
1269
|
+
region_id: int | None = None,
|
|
1270
|
+
instances_count: int,
|
|
1271
|
+
polling_interval_seconds: int | NotGiven = NOT_GIVEN,
|
|
1272
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
1273
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
1274
|
+
extra_headers: Headers | None = None,
|
|
1275
|
+
extra_query: Query | None = None,
|
|
1276
|
+
extra_body: Body | None = None,
|
|
1277
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
1278
|
+
) -> GPUBaremetalCluster:
|
|
1279
|
+
"""
|
|
1280
|
+
Resize a bare metal GPU cluster and wait for it to be ready.
|
|
1281
|
+
"""
|
|
1282
|
+
response = await self.resize(
|
|
1283
|
+
cluster_id=cluster_id,
|
|
1284
|
+
project_id=project_id,
|
|
1285
|
+
region_id=region_id,
|
|
1286
|
+
instances_count=instances_count,
|
|
1287
|
+
extra_headers=extra_headers,
|
|
1288
|
+
extra_query=extra_query,
|
|
1289
|
+
extra_body=extra_body,
|
|
1290
|
+
timeout=timeout,
|
|
1291
|
+
)
|
|
1292
|
+
if not response.tasks or len(response.tasks) != 1:
|
|
1293
|
+
raise ValueError(f"Expected exactly one task to be created")
|
|
1294
|
+
await self._client.cloud.tasks.poll(
|
|
1295
|
+
response.tasks[0],
|
|
1296
|
+
extra_headers=extra_headers,
|
|
1297
|
+
extra_query=extra_query,
|
|
1298
|
+
extra_body=extra_body,
|
|
1299
|
+
polling_interval_seconds=polling_interval_seconds,
|
|
1300
|
+
)
|
|
1301
|
+
return await self.get(
|
|
1302
|
+
cluster_id=cluster_id,
|
|
1303
|
+
project_id=project_id,
|
|
1304
|
+
region_id=region_id,
|
|
1305
|
+
extra_headers=extra_headers,
|
|
1306
|
+
extra_query=extra_query,
|
|
1307
|
+
extra_body=extra_body,
|
|
1308
|
+
timeout=timeout,
|
|
1309
|
+
)
|
|
1310
|
+
|
|
1311
|
+
|
|
1312
|
+
class GPUBaremetalClustersResourceWithRawResponse:
|
|
1313
|
+
def __init__(self, gpu_baremetal_clusters: GPUBaremetalClustersResource) -> None:
|
|
1314
|
+
self._gpu_baremetal_clusters = gpu_baremetal_clusters
|
|
1315
|
+
|
|
1316
|
+
self.create = to_raw_response_wrapper(
|
|
1317
|
+
gpu_baremetal_clusters.create,
|
|
1318
|
+
)
|
|
1319
|
+
self.list = to_raw_response_wrapper(
|
|
1320
|
+
gpu_baremetal_clusters.list,
|
|
1321
|
+
)
|
|
1322
|
+
self.delete = to_raw_response_wrapper(
|
|
1323
|
+
gpu_baremetal_clusters.delete,
|
|
1324
|
+
)
|
|
1325
|
+
self.get = to_raw_response_wrapper(
|
|
1326
|
+
gpu_baremetal_clusters.get,
|
|
1327
|
+
)
|
|
1328
|
+
self.powercycle_all_servers = to_raw_response_wrapper(
|
|
1329
|
+
gpu_baremetal_clusters.powercycle_all_servers,
|
|
1330
|
+
)
|
|
1331
|
+
self.reboot_all_servers = to_raw_response_wrapper(
|
|
1332
|
+
gpu_baremetal_clusters.reboot_all_servers,
|
|
1333
|
+
)
|
|
1334
|
+
self.rebuild = to_raw_response_wrapper(
|
|
1335
|
+
gpu_baremetal_clusters.rebuild,
|
|
1336
|
+
)
|
|
1337
|
+
self.resize = to_raw_response_wrapper(
|
|
1338
|
+
gpu_baremetal_clusters.resize,
|
|
1339
|
+
)
|
|
1340
|
+
|
|
1341
|
+
@cached_property
|
|
1342
|
+
def interfaces(self) -> InterfacesResourceWithRawResponse:
|
|
1343
|
+
return InterfacesResourceWithRawResponse(self._gpu_baremetal_clusters.interfaces)
|
|
1344
|
+
|
|
1345
|
+
@cached_property
|
|
1346
|
+
def servers(self) -> ServersResourceWithRawResponse:
|
|
1347
|
+
return ServersResourceWithRawResponse(self._gpu_baremetal_clusters.servers)
|
|
1348
|
+
|
|
1349
|
+
@cached_property
|
|
1350
|
+
def flavors(self) -> FlavorsResourceWithRawResponse:
|
|
1351
|
+
return FlavorsResourceWithRawResponse(self._gpu_baremetal_clusters.flavors)
|
|
1352
|
+
|
|
1353
|
+
@cached_property
|
|
1354
|
+
def images(self) -> ImagesResourceWithRawResponse:
|
|
1355
|
+
return ImagesResourceWithRawResponse(self._gpu_baremetal_clusters.images)
|
|
1356
|
+
|
|
1357
|
+
|
|
1358
|
+
class AsyncGPUBaremetalClustersResourceWithRawResponse:
|
|
1359
|
+
def __init__(self, gpu_baremetal_clusters: AsyncGPUBaremetalClustersResource) -> None:
|
|
1360
|
+
self._gpu_baremetal_clusters = gpu_baremetal_clusters
|
|
1361
|
+
|
|
1362
|
+
self.create = async_to_raw_response_wrapper(
|
|
1363
|
+
gpu_baremetal_clusters.create,
|
|
1364
|
+
)
|
|
1365
|
+
self.list = async_to_raw_response_wrapper(
|
|
1366
|
+
gpu_baremetal_clusters.list,
|
|
1367
|
+
)
|
|
1368
|
+
self.delete = async_to_raw_response_wrapper(
|
|
1369
|
+
gpu_baremetal_clusters.delete,
|
|
1370
|
+
)
|
|
1371
|
+
self.get = async_to_raw_response_wrapper(
|
|
1372
|
+
gpu_baremetal_clusters.get,
|
|
1373
|
+
)
|
|
1374
|
+
self.powercycle_all_servers = async_to_raw_response_wrapper(
|
|
1375
|
+
gpu_baremetal_clusters.powercycle_all_servers,
|
|
1376
|
+
)
|
|
1377
|
+
self.reboot_all_servers = async_to_raw_response_wrapper(
|
|
1378
|
+
gpu_baremetal_clusters.reboot_all_servers,
|
|
1379
|
+
)
|
|
1380
|
+
self.rebuild = async_to_raw_response_wrapper(
|
|
1381
|
+
gpu_baremetal_clusters.rebuild,
|
|
1382
|
+
)
|
|
1383
|
+
self.resize = async_to_raw_response_wrapper(
|
|
1384
|
+
gpu_baremetal_clusters.resize,
|
|
1385
|
+
)
|
|
1386
|
+
|
|
1387
|
+
@cached_property
|
|
1388
|
+
def interfaces(self) -> AsyncInterfacesResourceWithRawResponse:
|
|
1389
|
+
return AsyncInterfacesResourceWithRawResponse(self._gpu_baremetal_clusters.interfaces)
|
|
1390
|
+
|
|
1391
|
+
@cached_property
|
|
1392
|
+
def servers(self) -> AsyncServersResourceWithRawResponse:
|
|
1393
|
+
return AsyncServersResourceWithRawResponse(self._gpu_baremetal_clusters.servers)
|
|
1394
|
+
|
|
1395
|
+
@cached_property
|
|
1396
|
+
def flavors(self) -> AsyncFlavorsResourceWithRawResponse:
|
|
1397
|
+
return AsyncFlavorsResourceWithRawResponse(self._gpu_baremetal_clusters.flavors)
|
|
1398
|
+
|
|
1399
|
+
@cached_property
|
|
1400
|
+
def images(self) -> AsyncImagesResourceWithRawResponse:
|
|
1401
|
+
return AsyncImagesResourceWithRawResponse(self._gpu_baremetal_clusters.images)
|
|
1402
|
+
|
|
1403
|
+
|
|
1404
|
+
class GPUBaremetalClustersResourceWithStreamingResponse:
|
|
1405
|
+
def __init__(self, gpu_baremetal_clusters: GPUBaremetalClustersResource) -> None:
|
|
1406
|
+
self._gpu_baremetal_clusters = gpu_baremetal_clusters
|
|
1407
|
+
|
|
1408
|
+
self.create = to_streamed_response_wrapper(
|
|
1409
|
+
gpu_baremetal_clusters.create,
|
|
1410
|
+
)
|
|
1411
|
+
self.list = to_streamed_response_wrapper(
|
|
1412
|
+
gpu_baremetal_clusters.list,
|
|
1413
|
+
)
|
|
1414
|
+
self.delete = to_streamed_response_wrapper(
|
|
1415
|
+
gpu_baremetal_clusters.delete,
|
|
1416
|
+
)
|
|
1417
|
+
self.get = to_streamed_response_wrapper(
|
|
1418
|
+
gpu_baremetal_clusters.get,
|
|
1419
|
+
)
|
|
1420
|
+
self.powercycle_all_servers = to_streamed_response_wrapper(
|
|
1421
|
+
gpu_baremetal_clusters.powercycle_all_servers,
|
|
1422
|
+
)
|
|
1423
|
+
self.reboot_all_servers = to_streamed_response_wrapper(
|
|
1424
|
+
gpu_baremetal_clusters.reboot_all_servers,
|
|
1425
|
+
)
|
|
1426
|
+
self.rebuild = to_streamed_response_wrapper(
|
|
1427
|
+
gpu_baremetal_clusters.rebuild,
|
|
1428
|
+
)
|
|
1429
|
+
self.resize = to_streamed_response_wrapper(
|
|
1430
|
+
gpu_baremetal_clusters.resize,
|
|
1431
|
+
)
|
|
1432
|
+
|
|
1433
|
+
@cached_property
|
|
1434
|
+
def interfaces(self) -> InterfacesResourceWithStreamingResponse:
|
|
1435
|
+
return InterfacesResourceWithStreamingResponse(self._gpu_baremetal_clusters.interfaces)
|
|
1436
|
+
|
|
1437
|
+
@cached_property
|
|
1438
|
+
def servers(self) -> ServersResourceWithStreamingResponse:
|
|
1439
|
+
return ServersResourceWithStreamingResponse(self._gpu_baremetal_clusters.servers)
|
|
1440
|
+
|
|
1441
|
+
@cached_property
|
|
1442
|
+
def flavors(self) -> FlavorsResourceWithStreamingResponse:
|
|
1443
|
+
return FlavorsResourceWithStreamingResponse(self._gpu_baremetal_clusters.flavors)
|
|
1444
|
+
|
|
1445
|
+
@cached_property
|
|
1446
|
+
def images(self) -> ImagesResourceWithStreamingResponse:
|
|
1447
|
+
return ImagesResourceWithStreamingResponse(self._gpu_baremetal_clusters.images)
|
|
1448
|
+
|
|
1449
|
+
|
|
1450
|
+
class AsyncGPUBaremetalClustersResourceWithStreamingResponse:
|
|
1451
|
+
def __init__(self, gpu_baremetal_clusters: AsyncGPUBaremetalClustersResource) -> None:
|
|
1452
|
+
self._gpu_baremetal_clusters = gpu_baremetal_clusters
|
|
1453
|
+
|
|
1454
|
+
self.create = async_to_streamed_response_wrapper(
|
|
1455
|
+
gpu_baremetal_clusters.create,
|
|
1456
|
+
)
|
|
1457
|
+
self.list = async_to_streamed_response_wrapper(
|
|
1458
|
+
gpu_baremetal_clusters.list,
|
|
1459
|
+
)
|
|
1460
|
+
self.delete = async_to_streamed_response_wrapper(
|
|
1461
|
+
gpu_baremetal_clusters.delete,
|
|
1462
|
+
)
|
|
1463
|
+
self.get = async_to_streamed_response_wrapper(
|
|
1464
|
+
gpu_baremetal_clusters.get,
|
|
1465
|
+
)
|
|
1466
|
+
self.powercycle_all_servers = async_to_streamed_response_wrapper(
|
|
1467
|
+
gpu_baremetal_clusters.powercycle_all_servers,
|
|
1468
|
+
)
|
|
1469
|
+
self.reboot_all_servers = async_to_streamed_response_wrapper(
|
|
1470
|
+
gpu_baremetal_clusters.reboot_all_servers,
|
|
1471
|
+
)
|
|
1472
|
+
self.rebuild = async_to_streamed_response_wrapper(
|
|
1473
|
+
gpu_baremetal_clusters.rebuild,
|
|
1474
|
+
)
|
|
1475
|
+
self.resize = async_to_streamed_response_wrapper(
|
|
1476
|
+
gpu_baremetal_clusters.resize,
|
|
1477
|
+
)
|
|
1478
|
+
|
|
1479
|
+
@cached_property
|
|
1480
|
+
def interfaces(self) -> AsyncInterfacesResourceWithStreamingResponse:
|
|
1481
|
+
return AsyncInterfacesResourceWithStreamingResponse(self._gpu_baremetal_clusters.interfaces)
|
|
1482
|
+
|
|
1483
|
+
@cached_property
|
|
1484
|
+
def servers(self) -> AsyncServersResourceWithStreamingResponse:
|
|
1485
|
+
return AsyncServersResourceWithStreamingResponse(self._gpu_baremetal_clusters.servers)
|
|
1486
|
+
|
|
1487
|
+
@cached_property
|
|
1488
|
+
def flavors(self) -> AsyncFlavorsResourceWithStreamingResponse:
|
|
1489
|
+
return AsyncFlavorsResourceWithStreamingResponse(self._gpu_baremetal_clusters.flavors)
|
|
1490
|
+
|
|
1491
|
+
@cached_property
|
|
1492
|
+
def images(self) -> AsyncImagesResourceWithStreamingResponse:
|
|
1493
|
+
return AsyncImagesResourceWithStreamingResponse(self._gpu_baremetal_clusters.images)
|