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,1178 @@
|
|
|
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 Iterable
|
|
6
|
+
from typing_extensions import Literal, overload
|
|
7
|
+
|
|
8
|
+
import httpx
|
|
9
|
+
|
|
10
|
+
from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven
|
|
11
|
+
from ...._utils import maybe_transform, async_maybe_transform
|
|
12
|
+
from ...._compat import cached_property
|
|
13
|
+
from ...._resource import SyncAPIResource, AsyncAPIResource
|
|
14
|
+
from ...._response import (
|
|
15
|
+
to_raw_response_wrapper,
|
|
16
|
+
to_streamed_response_wrapper,
|
|
17
|
+
async_to_raw_response_wrapper,
|
|
18
|
+
async_to_streamed_response_wrapper,
|
|
19
|
+
)
|
|
20
|
+
from ...._base_client import make_request_options
|
|
21
|
+
from ....types.cloud.console import Console
|
|
22
|
+
from ....types.cloud.task_id_list import TaskIDList
|
|
23
|
+
from ....types.cloud.gpu_baremetal_clusters import (
|
|
24
|
+
server_delete_params,
|
|
25
|
+
server_attach_interface_params,
|
|
26
|
+
server_detach_interface_params,
|
|
27
|
+
)
|
|
28
|
+
from ....types.cloud.gpu_baremetal_cluster_server import GPUBaremetalClusterServer
|
|
29
|
+
|
|
30
|
+
__all__ = ["ServersResource", "AsyncServersResource"]
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
class ServersResource(SyncAPIResource):
|
|
34
|
+
@cached_property
|
|
35
|
+
def with_raw_response(self) -> ServersResourceWithRawResponse:
|
|
36
|
+
"""
|
|
37
|
+
This property can be used as a prefix for any HTTP method call to return
|
|
38
|
+
the raw response object instead of the parsed content.
|
|
39
|
+
|
|
40
|
+
For more information, see https://www.github.com/G-Core/gcore-python#accessing-raw-response-data-eg-headers
|
|
41
|
+
"""
|
|
42
|
+
return ServersResourceWithRawResponse(self)
|
|
43
|
+
|
|
44
|
+
@cached_property
|
|
45
|
+
def with_streaming_response(self) -> ServersResourceWithStreamingResponse:
|
|
46
|
+
"""
|
|
47
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
48
|
+
|
|
49
|
+
For more information, see https://www.github.com/G-Core/gcore-python#with_streaming_response
|
|
50
|
+
"""
|
|
51
|
+
return ServersResourceWithStreamingResponse(self)
|
|
52
|
+
|
|
53
|
+
def delete(
|
|
54
|
+
self,
|
|
55
|
+
instance_id: str,
|
|
56
|
+
*,
|
|
57
|
+
project_id: int | None = None,
|
|
58
|
+
region_id: int | None = None,
|
|
59
|
+
cluster_id: str,
|
|
60
|
+
delete_floatings: bool | NotGiven = NOT_GIVEN,
|
|
61
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
62
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
63
|
+
extra_headers: Headers | None = None,
|
|
64
|
+
extra_query: Query | None = None,
|
|
65
|
+
extra_body: Body | None = None,
|
|
66
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
67
|
+
) -> TaskIDList:
|
|
68
|
+
"""
|
|
69
|
+
Delete bare metal GPU server from cluster
|
|
70
|
+
|
|
71
|
+
Args:
|
|
72
|
+
delete_floatings: Set False if you do not want to delete assigned floating IPs. By default, it's
|
|
73
|
+
True.
|
|
74
|
+
|
|
75
|
+
extra_headers: Send extra headers
|
|
76
|
+
|
|
77
|
+
extra_query: Add additional query parameters to the request
|
|
78
|
+
|
|
79
|
+
extra_body: Add additional JSON properties to the request
|
|
80
|
+
|
|
81
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
82
|
+
"""
|
|
83
|
+
if project_id is None:
|
|
84
|
+
project_id = self._client._get_cloud_project_id_path_param()
|
|
85
|
+
if region_id is None:
|
|
86
|
+
region_id = self._client._get_cloud_region_id_path_param()
|
|
87
|
+
if not cluster_id:
|
|
88
|
+
raise ValueError(f"Expected a non-empty value for `cluster_id` but received {cluster_id!r}")
|
|
89
|
+
if not instance_id:
|
|
90
|
+
raise ValueError(f"Expected a non-empty value for `instance_id` but received {instance_id!r}")
|
|
91
|
+
return self._delete(
|
|
92
|
+
f"/cloud/v1/ai/clusters/gpu/{project_id}/{region_id}/{cluster_id}/node/{instance_id}",
|
|
93
|
+
options=make_request_options(
|
|
94
|
+
extra_headers=extra_headers,
|
|
95
|
+
extra_query=extra_query,
|
|
96
|
+
extra_body=extra_body,
|
|
97
|
+
timeout=timeout,
|
|
98
|
+
query=maybe_transform({"delete_floatings": delete_floatings}, server_delete_params.ServerDeleteParams),
|
|
99
|
+
),
|
|
100
|
+
cast_to=TaskIDList,
|
|
101
|
+
)
|
|
102
|
+
|
|
103
|
+
def delete_and_poll(
|
|
104
|
+
self,
|
|
105
|
+
instance_id: str,
|
|
106
|
+
*,
|
|
107
|
+
project_id: int | None = None,
|
|
108
|
+
region_id: int | None = None,
|
|
109
|
+
cluster_id: str,
|
|
110
|
+
delete_floatings: bool | NotGiven = NOT_GIVEN,
|
|
111
|
+
polling_interval_seconds: int | NotGiven = NOT_GIVEN,
|
|
112
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
113
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
114
|
+
extra_headers: Headers | None = None,
|
|
115
|
+
extra_query: Query | None = None,
|
|
116
|
+
extra_body: Body | None = None,
|
|
117
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
118
|
+
) -> None:
|
|
119
|
+
"""
|
|
120
|
+
Delete a bare metal GPU server from cluster and wait for the deletion to complete.
|
|
121
|
+
"""
|
|
122
|
+
response = self.delete(
|
|
123
|
+
instance_id=instance_id,
|
|
124
|
+
project_id=project_id,
|
|
125
|
+
region_id=region_id,
|
|
126
|
+
cluster_id=cluster_id,
|
|
127
|
+
delete_floatings=delete_floatings,
|
|
128
|
+
extra_headers=extra_headers,
|
|
129
|
+
extra_query=extra_query,
|
|
130
|
+
extra_body=extra_body,
|
|
131
|
+
timeout=timeout,
|
|
132
|
+
)
|
|
133
|
+
if not response.tasks or len(response.tasks) != 1:
|
|
134
|
+
raise ValueError(f"Expected exactly one task to be created")
|
|
135
|
+
self._client.cloud.tasks.poll(
|
|
136
|
+
response.tasks[0],
|
|
137
|
+
extra_headers=extra_headers,
|
|
138
|
+
extra_query=extra_query,
|
|
139
|
+
extra_body=extra_body,
|
|
140
|
+
polling_interval_seconds=polling_interval_seconds,
|
|
141
|
+
)
|
|
142
|
+
|
|
143
|
+
@overload
|
|
144
|
+
def attach_interface(
|
|
145
|
+
self,
|
|
146
|
+
instance_id: str,
|
|
147
|
+
*,
|
|
148
|
+
project_id: int | None = None,
|
|
149
|
+
region_id: int | None = None,
|
|
150
|
+
ddos_profile: server_attach_interface_params.NewInterfaceExternalExtendSchemaWithDDOSDDOSProfile
|
|
151
|
+
| NotGiven = NOT_GIVEN,
|
|
152
|
+
interface_name: str | NotGiven = NOT_GIVEN,
|
|
153
|
+
ip_family: Literal["dual", "ipv4", "ipv6"] | NotGiven = NOT_GIVEN,
|
|
154
|
+
port_group: int | NotGiven = NOT_GIVEN,
|
|
155
|
+
security_groups: Iterable[server_attach_interface_params.NewInterfaceExternalExtendSchemaWithDDOSSecurityGroup]
|
|
156
|
+
| NotGiven = NOT_GIVEN,
|
|
157
|
+
type: str | NotGiven = NOT_GIVEN,
|
|
158
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
159
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
160
|
+
extra_headers: Headers | None = None,
|
|
161
|
+
extra_query: Query | None = None,
|
|
162
|
+
extra_body: Body | None = None,
|
|
163
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
164
|
+
) -> TaskIDList:
|
|
165
|
+
"""
|
|
166
|
+
Attach interface to bare metal GPU cluster server
|
|
167
|
+
|
|
168
|
+
Args:
|
|
169
|
+
ddos_profile: Advanced DDoS protection.
|
|
170
|
+
|
|
171
|
+
interface_name: Interface name
|
|
172
|
+
|
|
173
|
+
ip_family: Which subnets should be selected: IPv4, IPv6 or use dual stack.
|
|
174
|
+
|
|
175
|
+
port_group: Each group will be added to the separate trunk.
|
|
176
|
+
|
|
177
|
+
security_groups: List of security group IDs
|
|
178
|
+
|
|
179
|
+
type: Must be 'external'. Union tag
|
|
180
|
+
|
|
181
|
+
extra_headers: Send extra headers
|
|
182
|
+
|
|
183
|
+
extra_query: Add additional query parameters to the request
|
|
184
|
+
|
|
185
|
+
extra_body: Add additional JSON properties to the request
|
|
186
|
+
|
|
187
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
188
|
+
"""
|
|
189
|
+
...
|
|
190
|
+
|
|
191
|
+
@overload
|
|
192
|
+
def attach_interface(
|
|
193
|
+
self,
|
|
194
|
+
instance_id: str,
|
|
195
|
+
*,
|
|
196
|
+
project_id: int | None = None,
|
|
197
|
+
region_id: int | None = None,
|
|
198
|
+
subnet_id: str,
|
|
199
|
+
ddos_profile: server_attach_interface_params.NewInterfaceSpecificSubnetSchemaDDOSProfile | NotGiven = NOT_GIVEN,
|
|
200
|
+
interface_name: str | NotGiven = NOT_GIVEN,
|
|
201
|
+
port_group: int | NotGiven = NOT_GIVEN,
|
|
202
|
+
security_groups: Iterable[server_attach_interface_params.NewInterfaceSpecificSubnetSchemaSecurityGroup]
|
|
203
|
+
| NotGiven = NOT_GIVEN,
|
|
204
|
+
type: str | NotGiven = NOT_GIVEN,
|
|
205
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
206
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
207
|
+
extra_headers: Headers | None = None,
|
|
208
|
+
extra_query: Query | None = None,
|
|
209
|
+
extra_body: Body | None = None,
|
|
210
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
211
|
+
) -> TaskIDList:
|
|
212
|
+
"""
|
|
213
|
+
Attach interface to bare metal GPU cluster server
|
|
214
|
+
|
|
215
|
+
Args:
|
|
216
|
+
subnet_id: Port will get an IP address from this subnet
|
|
217
|
+
|
|
218
|
+
ddos_profile: Advanced DDoS protection.
|
|
219
|
+
|
|
220
|
+
interface_name: Interface name
|
|
221
|
+
|
|
222
|
+
port_group: Each group will be added to the separate trunk.
|
|
223
|
+
|
|
224
|
+
security_groups: List of security group IDs
|
|
225
|
+
|
|
226
|
+
type: Must be 'subnet'
|
|
227
|
+
|
|
228
|
+
extra_headers: Send extra headers
|
|
229
|
+
|
|
230
|
+
extra_query: Add additional query parameters to the request
|
|
231
|
+
|
|
232
|
+
extra_body: Add additional JSON properties to the request
|
|
233
|
+
|
|
234
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
235
|
+
"""
|
|
236
|
+
...
|
|
237
|
+
|
|
238
|
+
@overload
|
|
239
|
+
def attach_interface(
|
|
240
|
+
self,
|
|
241
|
+
instance_id: str,
|
|
242
|
+
*,
|
|
243
|
+
project_id: int | None = None,
|
|
244
|
+
region_id: int | None = None,
|
|
245
|
+
network_id: str,
|
|
246
|
+
ddos_profile: server_attach_interface_params.NewInterfaceAnySubnetSchemaDDOSProfile | NotGiven = NOT_GIVEN,
|
|
247
|
+
interface_name: str | NotGiven = NOT_GIVEN,
|
|
248
|
+
ip_family: Literal["dual", "ipv4", "ipv6"] | NotGiven = NOT_GIVEN,
|
|
249
|
+
port_group: int | NotGiven = NOT_GIVEN,
|
|
250
|
+
security_groups: Iterable[server_attach_interface_params.NewInterfaceAnySubnetSchemaSecurityGroup]
|
|
251
|
+
| NotGiven = NOT_GIVEN,
|
|
252
|
+
type: str | 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
|
+
Attach interface to bare metal GPU cluster server
|
|
262
|
+
|
|
263
|
+
Args:
|
|
264
|
+
network_id: Port will get an IP address in this network subnet
|
|
265
|
+
|
|
266
|
+
ddos_profile: Advanced DDoS protection.
|
|
267
|
+
|
|
268
|
+
interface_name: Interface name
|
|
269
|
+
|
|
270
|
+
ip_family: Which subnets should be selected: IPv4, IPv6 or use dual stack.
|
|
271
|
+
|
|
272
|
+
port_group: Each group will be added to the separate trunk.
|
|
273
|
+
|
|
274
|
+
security_groups: List of security group IDs
|
|
275
|
+
|
|
276
|
+
type: Must be 'any_subnet'
|
|
277
|
+
|
|
278
|
+
extra_headers: Send extra headers
|
|
279
|
+
|
|
280
|
+
extra_query: Add additional query parameters to the request
|
|
281
|
+
|
|
282
|
+
extra_body: Add additional JSON properties to the request
|
|
283
|
+
|
|
284
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
285
|
+
"""
|
|
286
|
+
...
|
|
287
|
+
|
|
288
|
+
@overload
|
|
289
|
+
def attach_interface(
|
|
290
|
+
self,
|
|
291
|
+
instance_id: str,
|
|
292
|
+
*,
|
|
293
|
+
project_id: int | None = None,
|
|
294
|
+
region_id: int | None = None,
|
|
295
|
+
port_id: str,
|
|
296
|
+
ddos_profile: server_attach_interface_params.NewInterfaceReservedFixedIPSchemaDDOSProfile
|
|
297
|
+
| NotGiven = NOT_GIVEN,
|
|
298
|
+
interface_name: str | NotGiven = NOT_GIVEN,
|
|
299
|
+
port_group: int | NotGiven = NOT_GIVEN,
|
|
300
|
+
security_groups: Iterable[server_attach_interface_params.NewInterfaceReservedFixedIPSchemaSecurityGroup]
|
|
301
|
+
| NotGiven = NOT_GIVEN,
|
|
302
|
+
type: str | NotGiven = NOT_GIVEN,
|
|
303
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
304
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
305
|
+
extra_headers: Headers | None = None,
|
|
306
|
+
extra_query: Query | None = None,
|
|
307
|
+
extra_body: Body | None = None,
|
|
308
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
309
|
+
) -> TaskIDList:
|
|
310
|
+
"""
|
|
311
|
+
Attach interface to bare metal GPU cluster server
|
|
312
|
+
|
|
313
|
+
Args:
|
|
314
|
+
port_id: Port ID
|
|
315
|
+
|
|
316
|
+
ddos_profile: Advanced DDoS protection.
|
|
317
|
+
|
|
318
|
+
interface_name: Interface name
|
|
319
|
+
|
|
320
|
+
port_group: Each group will be added to the separate trunk.
|
|
321
|
+
|
|
322
|
+
security_groups: List of security group IDs
|
|
323
|
+
|
|
324
|
+
type: Must be 'reserved_fixed_ip'. Union tag
|
|
325
|
+
|
|
326
|
+
extra_headers: Send extra headers
|
|
327
|
+
|
|
328
|
+
extra_query: Add additional query parameters to the request
|
|
329
|
+
|
|
330
|
+
extra_body: Add additional JSON properties to the request
|
|
331
|
+
|
|
332
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
333
|
+
"""
|
|
334
|
+
...
|
|
335
|
+
|
|
336
|
+
def attach_interface(
|
|
337
|
+
self,
|
|
338
|
+
instance_id: str,
|
|
339
|
+
*,
|
|
340
|
+
project_id: int | None = None,
|
|
341
|
+
region_id: int | None = None,
|
|
342
|
+
ddos_profile: server_attach_interface_params.NewInterfaceExternalExtendSchemaWithDDOSDDOSProfile
|
|
343
|
+
| NotGiven = NOT_GIVEN,
|
|
344
|
+
interface_name: str | NotGiven = NOT_GIVEN,
|
|
345
|
+
ip_family: Literal["dual", "ipv4", "ipv6"] | NotGiven = NOT_GIVEN,
|
|
346
|
+
port_group: int | NotGiven = NOT_GIVEN,
|
|
347
|
+
security_groups: Iterable[server_attach_interface_params.NewInterfaceExternalExtendSchemaWithDDOSSecurityGroup]
|
|
348
|
+
| NotGiven = NOT_GIVEN,
|
|
349
|
+
type: str | NotGiven = NOT_GIVEN,
|
|
350
|
+
subnet_id: str | NotGiven = NOT_GIVEN,
|
|
351
|
+
network_id: str | NotGiven = NOT_GIVEN,
|
|
352
|
+
port_id: str | NotGiven = NOT_GIVEN,
|
|
353
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
354
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
355
|
+
extra_headers: Headers | None = None,
|
|
356
|
+
extra_query: Query | None = None,
|
|
357
|
+
extra_body: Body | None = None,
|
|
358
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
359
|
+
) -> TaskIDList:
|
|
360
|
+
if project_id is None:
|
|
361
|
+
project_id = self._client._get_cloud_project_id_path_param()
|
|
362
|
+
if region_id is None:
|
|
363
|
+
region_id = self._client._get_cloud_region_id_path_param()
|
|
364
|
+
if not instance_id:
|
|
365
|
+
raise ValueError(f"Expected a non-empty value for `instance_id` but received {instance_id!r}")
|
|
366
|
+
return self._post(
|
|
367
|
+
f"/cloud/v1/ai/clusters/{project_id}/{region_id}/{instance_id}/attach_interface",
|
|
368
|
+
body=maybe_transform(
|
|
369
|
+
{
|
|
370
|
+
"ddos_profile": ddos_profile,
|
|
371
|
+
"interface_name": interface_name,
|
|
372
|
+
"ip_family": ip_family,
|
|
373
|
+
"port_group": port_group,
|
|
374
|
+
"security_groups": security_groups,
|
|
375
|
+
"type": type,
|
|
376
|
+
"subnet_id": subnet_id,
|
|
377
|
+
"network_id": network_id,
|
|
378
|
+
"port_id": port_id,
|
|
379
|
+
},
|
|
380
|
+
server_attach_interface_params.ServerAttachInterfaceParams,
|
|
381
|
+
),
|
|
382
|
+
options=make_request_options(
|
|
383
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
384
|
+
),
|
|
385
|
+
cast_to=TaskIDList,
|
|
386
|
+
)
|
|
387
|
+
|
|
388
|
+
def detach_interface(
|
|
389
|
+
self,
|
|
390
|
+
instance_id: str,
|
|
391
|
+
*,
|
|
392
|
+
project_id: int | None = None,
|
|
393
|
+
region_id: int | None = None,
|
|
394
|
+
ip_address: str,
|
|
395
|
+
port_id: str,
|
|
396
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
397
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
398
|
+
extra_headers: Headers | None = None,
|
|
399
|
+
extra_query: Query | None = None,
|
|
400
|
+
extra_body: Body | None = None,
|
|
401
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
402
|
+
) -> TaskIDList:
|
|
403
|
+
"""
|
|
404
|
+
Detach interface from bare metal GPU cluster server
|
|
405
|
+
|
|
406
|
+
Args:
|
|
407
|
+
ip_address: IP address
|
|
408
|
+
|
|
409
|
+
port_id: ID of the port
|
|
410
|
+
|
|
411
|
+
extra_headers: Send extra headers
|
|
412
|
+
|
|
413
|
+
extra_query: Add additional query parameters to the request
|
|
414
|
+
|
|
415
|
+
extra_body: Add additional JSON properties to the request
|
|
416
|
+
|
|
417
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
418
|
+
"""
|
|
419
|
+
if project_id is None:
|
|
420
|
+
project_id = self._client._get_cloud_project_id_path_param()
|
|
421
|
+
if region_id is None:
|
|
422
|
+
region_id = self._client._get_cloud_region_id_path_param()
|
|
423
|
+
if not instance_id:
|
|
424
|
+
raise ValueError(f"Expected a non-empty value for `instance_id` but received {instance_id!r}")
|
|
425
|
+
return self._post(
|
|
426
|
+
f"/cloud/v1/ai/clusters/{project_id}/{region_id}/{instance_id}/detach_interface",
|
|
427
|
+
body=maybe_transform(
|
|
428
|
+
{
|
|
429
|
+
"ip_address": ip_address,
|
|
430
|
+
"port_id": port_id,
|
|
431
|
+
},
|
|
432
|
+
server_detach_interface_params.ServerDetachInterfaceParams,
|
|
433
|
+
),
|
|
434
|
+
options=make_request_options(
|
|
435
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
436
|
+
),
|
|
437
|
+
cast_to=TaskIDList,
|
|
438
|
+
)
|
|
439
|
+
|
|
440
|
+
def get_console(
|
|
441
|
+
self,
|
|
442
|
+
instance_id: str,
|
|
443
|
+
*,
|
|
444
|
+
project_id: int | None = None,
|
|
445
|
+
region_id: int | None = None,
|
|
446
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
447
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
448
|
+
extra_headers: Headers | None = None,
|
|
449
|
+
extra_query: Query | None = None,
|
|
450
|
+
extra_body: Body | None = None,
|
|
451
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
452
|
+
) -> Console:
|
|
453
|
+
"""
|
|
454
|
+
Get bare metal GPU cluster server console URL
|
|
455
|
+
|
|
456
|
+
Args:
|
|
457
|
+
extra_headers: Send extra headers
|
|
458
|
+
|
|
459
|
+
extra_query: Add additional query parameters to the request
|
|
460
|
+
|
|
461
|
+
extra_body: Add additional JSON properties to the request
|
|
462
|
+
|
|
463
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
464
|
+
"""
|
|
465
|
+
if project_id is None:
|
|
466
|
+
project_id = self._client._get_cloud_project_id_path_param()
|
|
467
|
+
if region_id is None:
|
|
468
|
+
region_id = self._client._get_cloud_region_id_path_param()
|
|
469
|
+
if not instance_id:
|
|
470
|
+
raise ValueError(f"Expected a non-empty value for `instance_id` but received {instance_id!r}")
|
|
471
|
+
return self._get(
|
|
472
|
+
f"/cloud/v1/ai/clusters/{project_id}/{region_id}/{instance_id}/get_console",
|
|
473
|
+
options=make_request_options(
|
|
474
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
475
|
+
),
|
|
476
|
+
cast_to=Console,
|
|
477
|
+
)
|
|
478
|
+
|
|
479
|
+
def powercycle(
|
|
480
|
+
self,
|
|
481
|
+
instance_id: str,
|
|
482
|
+
*,
|
|
483
|
+
project_id: int | None = None,
|
|
484
|
+
region_id: int | None = None,
|
|
485
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
486
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
487
|
+
extra_headers: Headers | None = None,
|
|
488
|
+
extra_query: Query | None = None,
|
|
489
|
+
extra_body: Body | None = None,
|
|
490
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
491
|
+
) -> GPUBaremetalClusterServer:
|
|
492
|
+
"""
|
|
493
|
+
Stops and then starts the server, effectively performing a hard reboot.
|
|
494
|
+
|
|
495
|
+
Args:
|
|
496
|
+
extra_headers: Send extra headers
|
|
497
|
+
|
|
498
|
+
extra_query: Add additional query parameters to the request
|
|
499
|
+
|
|
500
|
+
extra_body: Add additional JSON properties to the request
|
|
501
|
+
|
|
502
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
503
|
+
"""
|
|
504
|
+
if project_id is None:
|
|
505
|
+
project_id = self._client._get_cloud_project_id_path_param()
|
|
506
|
+
if region_id is None:
|
|
507
|
+
region_id = self._client._get_cloud_region_id_path_param()
|
|
508
|
+
if not instance_id:
|
|
509
|
+
raise ValueError(f"Expected a non-empty value for `instance_id` but received {instance_id!r}")
|
|
510
|
+
return self._post(
|
|
511
|
+
f"/cloud/v1/ai/clusters/{project_id}/{region_id}/{instance_id}/powercycle",
|
|
512
|
+
options=make_request_options(
|
|
513
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
514
|
+
),
|
|
515
|
+
cast_to=GPUBaremetalClusterServer,
|
|
516
|
+
)
|
|
517
|
+
|
|
518
|
+
def reboot(
|
|
519
|
+
self,
|
|
520
|
+
instance_id: str,
|
|
521
|
+
*,
|
|
522
|
+
project_id: int | None = None,
|
|
523
|
+
region_id: int | None = None,
|
|
524
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
525
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
526
|
+
extra_headers: Headers | None = None,
|
|
527
|
+
extra_query: Query | None = None,
|
|
528
|
+
extra_body: Body | None = None,
|
|
529
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
530
|
+
) -> GPUBaremetalClusterServer:
|
|
531
|
+
"""
|
|
532
|
+
Reboot one bare metal GPU cluster server
|
|
533
|
+
|
|
534
|
+
Args:
|
|
535
|
+
extra_headers: Send extra headers
|
|
536
|
+
|
|
537
|
+
extra_query: Add additional query parameters to the request
|
|
538
|
+
|
|
539
|
+
extra_body: Add additional JSON properties to the request
|
|
540
|
+
|
|
541
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
542
|
+
"""
|
|
543
|
+
if project_id is None:
|
|
544
|
+
project_id = self._client._get_cloud_project_id_path_param()
|
|
545
|
+
if region_id is None:
|
|
546
|
+
region_id = self._client._get_cloud_region_id_path_param()
|
|
547
|
+
if not instance_id:
|
|
548
|
+
raise ValueError(f"Expected a non-empty value for `instance_id` but received {instance_id!r}")
|
|
549
|
+
return self._post(
|
|
550
|
+
f"/cloud/v1/ai/clusters/{project_id}/{region_id}/{instance_id}/reboot",
|
|
551
|
+
options=make_request_options(
|
|
552
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
553
|
+
),
|
|
554
|
+
cast_to=GPUBaremetalClusterServer,
|
|
555
|
+
)
|
|
556
|
+
|
|
557
|
+
|
|
558
|
+
class AsyncServersResource(AsyncAPIResource):
|
|
559
|
+
@cached_property
|
|
560
|
+
def with_raw_response(self) -> AsyncServersResourceWithRawResponse:
|
|
561
|
+
"""
|
|
562
|
+
This property can be used as a prefix for any HTTP method call to return
|
|
563
|
+
the raw response object instead of the parsed content.
|
|
564
|
+
|
|
565
|
+
For more information, see https://www.github.com/G-Core/gcore-python#accessing-raw-response-data-eg-headers
|
|
566
|
+
"""
|
|
567
|
+
return AsyncServersResourceWithRawResponse(self)
|
|
568
|
+
|
|
569
|
+
@cached_property
|
|
570
|
+
def with_streaming_response(self) -> AsyncServersResourceWithStreamingResponse:
|
|
571
|
+
"""
|
|
572
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
573
|
+
|
|
574
|
+
For more information, see https://www.github.com/G-Core/gcore-python#with_streaming_response
|
|
575
|
+
"""
|
|
576
|
+
return AsyncServersResourceWithStreamingResponse(self)
|
|
577
|
+
|
|
578
|
+
async def delete(
|
|
579
|
+
self,
|
|
580
|
+
instance_id: str,
|
|
581
|
+
*,
|
|
582
|
+
project_id: int | None = None,
|
|
583
|
+
region_id: int | None = None,
|
|
584
|
+
cluster_id: str,
|
|
585
|
+
delete_floatings: bool | NotGiven = NOT_GIVEN,
|
|
586
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
587
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
588
|
+
extra_headers: Headers | None = None,
|
|
589
|
+
extra_query: Query | None = None,
|
|
590
|
+
extra_body: Body | None = None,
|
|
591
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
592
|
+
) -> TaskIDList:
|
|
593
|
+
"""
|
|
594
|
+
Delete bare metal GPU server from cluster
|
|
595
|
+
|
|
596
|
+
Args:
|
|
597
|
+
delete_floatings: Set False if you do not want to delete assigned floating IPs. By default, it's
|
|
598
|
+
True.
|
|
599
|
+
|
|
600
|
+
extra_headers: Send extra headers
|
|
601
|
+
|
|
602
|
+
extra_query: Add additional query parameters to the request
|
|
603
|
+
|
|
604
|
+
extra_body: Add additional JSON properties to the request
|
|
605
|
+
|
|
606
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
607
|
+
"""
|
|
608
|
+
if project_id is None:
|
|
609
|
+
project_id = self._client._get_cloud_project_id_path_param()
|
|
610
|
+
if region_id is None:
|
|
611
|
+
region_id = self._client._get_cloud_region_id_path_param()
|
|
612
|
+
if not cluster_id:
|
|
613
|
+
raise ValueError(f"Expected a non-empty value for `cluster_id` but received {cluster_id!r}")
|
|
614
|
+
if not instance_id:
|
|
615
|
+
raise ValueError(f"Expected a non-empty value for `instance_id` but received {instance_id!r}")
|
|
616
|
+
return await self._delete(
|
|
617
|
+
f"/cloud/v1/ai/clusters/gpu/{project_id}/{region_id}/{cluster_id}/node/{instance_id}",
|
|
618
|
+
options=make_request_options(
|
|
619
|
+
extra_headers=extra_headers,
|
|
620
|
+
extra_query=extra_query,
|
|
621
|
+
extra_body=extra_body,
|
|
622
|
+
timeout=timeout,
|
|
623
|
+
query=await async_maybe_transform(
|
|
624
|
+
{"delete_floatings": delete_floatings}, server_delete_params.ServerDeleteParams
|
|
625
|
+
),
|
|
626
|
+
),
|
|
627
|
+
cast_to=TaskIDList,
|
|
628
|
+
)
|
|
629
|
+
|
|
630
|
+
async def delete_and_poll(
|
|
631
|
+
self,
|
|
632
|
+
instance_id: str,
|
|
633
|
+
*,
|
|
634
|
+
project_id: int | None = None,
|
|
635
|
+
region_id: int | None = None,
|
|
636
|
+
cluster_id: str,
|
|
637
|
+
delete_floatings: bool | NotGiven = NOT_GIVEN,
|
|
638
|
+
polling_interval_seconds: int | NotGiven = NOT_GIVEN,
|
|
639
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
640
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
641
|
+
extra_headers: Headers | None = None,
|
|
642
|
+
extra_query: Query | None = None,
|
|
643
|
+
extra_body: Body | None = None,
|
|
644
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
645
|
+
) -> None:
|
|
646
|
+
"""
|
|
647
|
+
Delete a bare metal GPU server from cluster and wait for the deletion to complete.
|
|
648
|
+
"""
|
|
649
|
+
response = await self.delete(
|
|
650
|
+
instance_id=instance_id,
|
|
651
|
+
project_id=project_id,
|
|
652
|
+
region_id=region_id,
|
|
653
|
+
cluster_id=cluster_id,
|
|
654
|
+
delete_floatings=delete_floatings,
|
|
655
|
+
extra_headers=extra_headers,
|
|
656
|
+
extra_query=extra_query,
|
|
657
|
+
extra_body=extra_body,
|
|
658
|
+
timeout=timeout,
|
|
659
|
+
)
|
|
660
|
+
if not response.tasks or len(response.tasks) != 1:
|
|
661
|
+
raise ValueError(f"Expected exactly one task to be created")
|
|
662
|
+
await self._client.cloud.tasks.poll(
|
|
663
|
+
response.tasks[0],
|
|
664
|
+
extra_headers=extra_headers,
|
|
665
|
+
extra_query=extra_query,
|
|
666
|
+
extra_body=extra_body,
|
|
667
|
+
polling_interval_seconds=polling_interval_seconds,
|
|
668
|
+
)
|
|
669
|
+
|
|
670
|
+
@overload
|
|
671
|
+
async def attach_interface(
|
|
672
|
+
self,
|
|
673
|
+
instance_id: str,
|
|
674
|
+
*,
|
|
675
|
+
project_id: int | None = None,
|
|
676
|
+
region_id: int | None = None,
|
|
677
|
+
ddos_profile: server_attach_interface_params.NewInterfaceExternalExtendSchemaWithDDOSDDOSProfile
|
|
678
|
+
| NotGiven = NOT_GIVEN,
|
|
679
|
+
interface_name: str | NotGiven = NOT_GIVEN,
|
|
680
|
+
ip_family: Literal["dual", "ipv4", "ipv6"] | NotGiven = NOT_GIVEN,
|
|
681
|
+
port_group: int | NotGiven = NOT_GIVEN,
|
|
682
|
+
security_groups: Iterable[server_attach_interface_params.NewInterfaceExternalExtendSchemaWithDDOSSecurityGroup]
|
|
683
|
+
| NotGiven = NOT_GIVEN,
|
|
684
|
+
type: str | NotGiven = NOT_GIVEN,
|
|
685
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
686
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
687
|
+
extra_headers: Headers | None = None,
|
|
688
|
+
extra_query: Query | None = None,
|
|
689
|
+
extra_body: Body | None = None,
|
|
690
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
691
|
+
) -> TaskIDList:
|
|
692
|
+
"""
|
|
693
|
+
Attach interface to bare metal GPU cluster server
|
|
694
|
+
|
|
695
|
+
Args:
|
|
696
|
+
ddos_profile: Advanced DDoS protection.
|
|
697
|
+
|
|
698
|
+
interface_name: Interface name
|
|
699
|
+
|
|
700
|
+
ip_family: Which subnets should be selected: IPv4, IPv6 or use dual stack.
|
|
701
|
+
|
|
702
|
+
port_group: Each group will be added to the separate trunk.
|
|
703
|
+
|
|
704
|
+
security_groups: List of security group IDs
|
|
705
|
+
|
|
706
|
+
type: Must be 'external'. Union tag
|
|
707
|
+
|
|
708
|
+
extra_headers: Send extra headers
|
|
709
|
+
|
|
710
|
+
extra_query: Add additional query parameters to the request
|
|
711
|
+
|
|
712
|
+
extra_body: Add additional JSON properties to the request
|
|
713
|
+
|
|
714
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
715
|
+
"""
|
|
716
|
+
...
|
|
717
|
+
|
|
718
|
+
@overload
|
|
719
|
+
async def attach_interface(
|
|
720
|
+
self,
|
|
721
|
+
instance_id: str,
|
|
722
|
+
*,
|
|
723
|
+
project_id: int | None = None,
|
|
724
|
+
region_id: int | None = None,
|
|
725
|
+
subnet_id: str,
|
|
726
|
+
ddos_profile: server_attach_interface_params.NewInterfaceSpecificSubnetSchemaDDOSProfile | NotGiven = NOT_GIVEN,
|
|
727
|
+
interface_name: str | NotGiven = NOT_GIVEN,
|
|
728
|
+
port_group: int | NotGiven = NOT_GIVEN,
|
|
729
|
+
security_groups: Iterable[server_attach_interface_params.NewInterfaceSpecificSubnetSchemaSecurityGroup]
|
|
730
|
+
| NotGiven = NOT_GIVEN,
|
|
731
|
+
type: str | NotGiven = NOT_GIVEN,
|
|
732
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
733
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
734
|
+
extra_headers: Headers | None = None,
|
|
735
|
+
extra_query: Query | None = None,
|
|
736
|
+
extra_body: Body | None = None,
|
|
737
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
738
|
+
) -> TaskIDList:
|
|
739
|
+
"""
|
|
740
|
+
Attach interface to bare metal GPU cluster server
|
|
741
|
+
|
|
742
|
+
Args:
|
|
743
|
+
subnet_id: Port will get an IP address from this subnet
|
|
744
|
+
|
|
745
|
+
ddos_profile: Advanced DDoS protection.
|
|
746
|
+
|
|
747
|
+
interface_name: Interface name
|
|
748
|
+
|
|
749
|
+
port_group: Each group will be added to the separate trunk.
|
|
750
|
+
|
|
751
|
+
security_groups: List of security group IDs
|
|
752
|
+
|
|
753
|
+
type: Must be 'subnet'
|
|
754
|
+
|
|
755
|
+
extra_headers: Send extra headers
|
|
756
|
+
|
|
757
|
+
extra_query: Add additional query parameters to the request
|
|
758
|
+
|
|
759
|
+
extra_body: Add additional JSON properties to the request
|
|
760
|
+
|
|
761
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
762
|
+
"""
|
|
763
|
+
...
|
|
764
|
+
|
|
765
|
+
@overload
|
|
766
|
+
async def attach_interface(
|
|
767
|
+
self,
|
|
768
|
+
instance_id: str,
|
|
769
|
+
*,
|
|
770
|
+
project_id: int | None = None,
|
|
771
|
+
region_id: int | None = None,
|
|
772
|
+
network_id: str,
|
|
773
|
+
ddos_profile: server_attach_interface_params.NewInterfaceAnySubnetSchemaDDOSProfile | NotGiven = NOT_GIVEN,
|
|
774
|
+
interface_name: str | NotGiven = NOT_GIVEN,
|
|
775
|
+
ip_family: Literal["dual", "ipv4", "ipv6"] | NotGiven = NOT_GIVEN,
|
|
776
|
+
port_group: int | NotGiven = NOT_GIVEN,
|
|
777
|
+
security_groups: Iterable[server_attach_interface_params.NewInterfaceAnySubnetSchemaSecurityGroup]
|
|
778
|
+
| NotGiven = NOT_GIVEN,
|
|
779
|
+
type: str | NotGiven = NOT_GIVEN,
|
|
780
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
781
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
782
|
+
extra_headers: Headers | None = None,
|
|
783
|
+
extra_query: Query | None = None,
|
|
784
|
+
extra_body: Body | None = None,
|
|
785
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
786
|
+
) -> TaskIDList:
|
|
787
|
+
"""
|
|
788
|
+
Attach interface to bare metal GPU cluster server
|
|
789
|
+
|
|
790
|
+
Args:
|
|
791
|
+
network_id: Port will get an IP address in this network subnet
|
|
792
|
+
|
|
793
|
+
ddos_profile: Advanced DDoS protection.
|
|
794
|
+
|
|
795
|
+
interface_name: Interface name
|
|
796
|
+
|
|
797
|
+
ip_family: Which subnets should be selected: IPv4, IPv6 or use dual stack.
|
|
798
|
+
|
|
799
|
+
port_group: Each group will be added to the separate trunk.
|
|
800
|
+
|
|
801
|
+
security_groups: List of security group IDs
|
|
802
|
+
|
|
803
|
+
type: Must be 'any_subnet'
|
|
804
|
+
|
|
805
|
+
extra_headers: Send extra headers
|
|
806
|
+
|
|
807
|
+
extra_query: Add additional query parameters to the request
|
|
808
|
+
|
|
809
|
+
extra_body: Add additional JSON properties to the request
|
|
810
|
+
|
|
811
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
812
|
+
"""
|
|
813
|
+
...
|
|
814
|
+
|
|
815
|
+
@overload
|
|
816
|
+
async def attach_interface(
|
|
817
|
+
self,
|
|
818
|
+
instance_id: str,
|
|
819
|
+
*,
|
|
820
|
+
project_id: int | None = None,
|
|
821
|
+
region_id: int | None = None,
|
|
822
|
+
port_id: str,
|
|
823
|
+
ddos_profile: server_attach_interface_params.NewInterfaceReservedFixedIPSchemaDDOSProfile
|
|
824
|
+
| NotGiven = NOT_GIVEN,
|
|
825
|
+
interface_name: str | NotGiven = NOT_GIVEN,
|
|
826
|
+
port_group: int | NotGiven = NOT_GIVEN,
|
|
827
|
+
security_groups: Iterable[server_attach_interface_params.NewInterfaceReservedFixedIPSchemaSecurityGroup]
|
|
828
|
+
| NotGiven = NOT_GIVEN,
|
|
829
|
+
type: str | NotGiven = NOT_GIVEN,
|
|
830
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
831
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
832
|
+
extra_headers: Headers | None = None,
|
|
833
|
+
extra_query: Query | None = None,
|
|
834
|
+
extra_body: Body | None = None,
|
|
835
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
836
|
+
) -> TaskIDList:
|
|
837
|
+
"""
|
|
838
|
+
Attach interface to bare metal GPU cluster server
|
|
839
|
+
|
|
840
|
+
Args:
|
|
841
|
+
port_id: Port ID
|
|
842
|
+
|
|
843
|
+
ddos_profile: Advanced DDoS protection.
|
|
844
|
+
|
|
845
|
+
interface_name: Interface name
|
|
846
|
+
|
|
847
|
+
port_group: Each group will be added to the separate trunk.
|
|
848
|
+
|
|
849
|
+
security_groups: List of security group IDs
|
|
850
|
+
|
|
851
|
+
type: Must be 'reserved_fixed_ip'. Union tag
|
|
852
|
+
|
|
853
|
+
extra_headers: Send extra headers
|
|
854
|
+
|
|
855
|
+
extra_query: Add additional query parameters to the request
|
|
856
|
+
|
|
857
|
+
extra_body: Add additional JSON properties to the request
|
|
858
|
+
|
|
859
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
860
|
+
"""
|
|
861
|
+
...
|
|
862
|
+
|
|
863
|
+
async def attach_interface(
|
|
864
|
+
self,
|
|
865
|
+
instance_id: str,
|
|
866
|
+
*,
|
|
867
|
+
project_id: int | None = None,
|
|
868
|
+
region_id: int | None = None,
|
|
869
|
+
ddos_profile: server_attach_interface_params.NewInterfaceExternalExtendSchemaWithDDOSDDOSProfile
|
|
870
|
+
| NotGiven = NOT_GIVEN,
|
|
871
|
+
interface_name: str | NotGiven = NOT_GIVEN,
|
|
872
|
+
ip_family: Literal["dual", "ipv4", "ipv6"] | NotGiven = NOT_GIVEN,
|
|
873
|
+
port_group: int | NotGiven = NOT_GIVEN,
|
|
874
|
+
security_groups: Iterable[server_attach_interface_params.NewInterfaceExternalExtendSchemaWithDDOSSecurityGroup]
|
|
875
|
+
| NotGiven = NOT_GIVEN,
|
|
876
|
+
type: str | NotGiven = NOT_GIVEN,
|
|
877
|
+
subnet_id: str | NotGiven = NOT_GIVEN,
|
|
878
|
+
network_id: str | NotGiven = NOT_GIVEN,
|
|
879
|
+
port_id: 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
|
+
if project_id is None:
|
|
888
|
+
project_id = self._client._get_cloud_project_id_path_param()
|
|
889
|
+
if region_id is None:
|
|
890
|
+
region_id = self._client._get_cloud_region_id_path_param()
|
|
891
|
+
if not instance_id:
|
|
892
|
+
raise ValueError(f"Expected a non-empty value for `instance_id` but received {instance_id!r}")
|
|
893
|
+
return await self._post(
|
|
894
|
+
f"/cloud/v1/ai/clusters/{project_id}/{region_id}/{instance_id}/attach_interface",
|
|
895
|
+
body=await async_maybe_transform(
|
|
896
|
+
{
|
|
897
|
+
"ddos_profile": ddos_profile,
|
|
898
|
+
"interface_name": interface_name,
|
|
899
|
+
"ip_family": ip_family,
|
|
900
|
+
"port_group": port_group,
|
|
901
|
+
"security_groups": security_groups,
|
|
902
|
+
"type": type,
|
|
903
|
+
"subnet_id": subnet_id,
|
|
904
|
+
"network_id": network_id,
|
|
905
|
+
"port_id": port_id,
|
|
906
|
+
},
|
|
907
|
+
server_attach_interface_params.ServerAttachInterfaceParams,
|
|
908
|
+
),
|
|
909
|
+
options=make_request_options(
|
|
910
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
911
|
+
),
|
|
912
|
+
cast_to=TaskIDList,
|
|
913
|
+
)
|
|
914
|
+
|
|
915
|
+
async def detach_interface(
|
|
916
|
+
self,
|
|
917
|
+
instance_id: str,
|
|
918
|
+
*,
|
|
919
|
+
project_id: int | None = None,
|
|
920
|
+
region_id: int | None = None,
|
|
921
|
+
ip_address: str,
|
|
922
|
+
port_id: str,
|
|
923
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
924
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
925
|
+
extra_headers: Headers | None = None,
|
|
926
|
+
extra_query: Query | None = None,
|
|
927
|
+
extra_body: Body | None = None,
|
|
928
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
929
|
+
) -> TaskIDList:
|
|
930
|
+
"""
|
|
931
|
+
Detach interface from bare metal GPU cluster server
|
|
932
|
+
|
|
933
|
+
Args:
|
|
934
|
+
ip_address: IP address
|
|
935
|
+
|
|
936
|
+
port_id: ID of the port
|
|
937
|
+
|
|
938
|
+
extra_headers: Send extra headers
|
|
939
|
+
|
|
940
|
+
extra_query: Add additional query parameters to the request
|
|
941
|
+
|
|
942
|
+
extra_body: Add additional JSON properties to the request
|
|
943
|
+
|
|
944
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
945
|
+
"""
|
|
946
|
+
if project_id is None:
|
|
947
|
+
project_id = self._client._get_cloud_project_id_path_param()
|
|
948
|
+
if region_id is None:
|
|
949
|
+
region_id = self._client._get_cloud_region_id_path_param()
|
|
950
|
+
if not instance_id:
|
|
951
|
+
raise ValueError(f"Expected a non-empty value for `instance_id` but received {instance_id!r}")
|
|
952
|
+
return await self._post(
|
|
953
|
+
f"/cloud/v1/ai/clusters/{project_id}/{region_id}/{instance_id}/detach_interface",
|
|
954
|
+
body=await async_maybe_transform(
|
|
955
|
+
{
|
|
956
|
+
"ip_address": ip_address,
|
|
957
|
+
"port_id": port_id,
|
|
958
|
+
},
|
|
959
|
+
server_detach_interface_params.ServerDetachInterfaceParams,
|
|
960
|
+
),
|
|
961
|
+
options=make_request_options(
|
|
962
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
963
|
+
),
|
|
964
|
+
cast_to=TaskIDList,
|
|
965
|
+
)
|
|
966
|
+
|
|
967
|
+
async def get_console(
|
|
968
|
+
self,
|
|
969
|
+
instance_id: str,
|
|
970
|
+
*,
|
|
971
|
+
project_id: int | None = None,
|
|
972
|
+
region_id: int | None = None,
|
|
973
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
974
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
975
|
+
extra_headers: Headers | None = None,
|
|
976
|
+
extra_query: Query | None = None,
|
|
977
|
+
extra_body: Body | None = None,
|
|
978
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
979
|
+
) -> Console:
|
|
980
|
+
"""
|
|
981
|
+
Get bare metal GPU cluster server console URL
|
|
982
|
+
|
|
983
|
+
Args:
|
|
984
|
+
extra_headers: Send extra headers
|
|
985
|
+
|
|
986
|
+
extra_query: Add additional query parameters to the request
|
|
987
|
+
|
|
988
|
+
extra_body: Add additional JSON properties to the request
|
|
989
|
+
|
|
990
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
991
|
+
"""
|
|
992
|
+
if project_id is None:
|
|
993
|
+
project_id = self._client._get_cloud_project_id_path_param()
|
|
994
|
+
if region_id is None:
|
|
995
|
+
region_id = self._client._get_cloud_region_id_path_param()
|
|
996
|
+
if not instance_id:
|
|
997
|
+
raise ValueError(f"Expected a non-empty value for `instance_id` but received {instance_id!r}")
|
|
998
|
+
return await self._get(
|
|
999
|
+
f"/cloud/v1/ai/clusters/{project_id}/{region_id}/{instance_id}/get_console",
|
|
1000
|
+
options=make_request_options(
|
|
1001
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
1002
|
+
),
|
|
1003
|
+
cast_to=Console,
|
|
1004
|
+
)
|
|
1005
|
+
|
|
1006
|
+
async def powercycle(
|
|
1007
|
+
self,
|
|
1008
|
+
instance_id: str,
|
|
1009
|
+
*,
|
|
1010
|
+
project_id: int | None = None,
|
|
1011
|
+
region_id: int | None = None,
|
|
1012
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
1013
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
1014
|
+
extra_headers: Headers | None = None,
|
|
1015
|
+
extra_query: Query | None = None,
|
|
1016
|
+
extra_body: Body | None = None,
|
|
1017
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
1018
|
+
) -> GPUBaremetalClusterServer:
|
|
1019
|
+
"""
|
|
1020
|
+
Stops and then starts the server, effectively performing a hard reboot.
|
|
1021
|
+
|
|
1022
|
+
Args:
|
|
1023
|
+
extra_headers: Send extra headers
|
|
1024
|
+
|
|
1025
|
+
extra_query: Add additional query parameters to the request
|
|
1026
|
+
|
|
1027
|
+
extra_body: Add additional JSON properties to the request
|
|
1028
|
+
|
|
1029
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
1030
|
+
"""
|
|
1031
|
+
if project_id is None:
|
|
1032
|
+
project_id = self._client._get_cloud_project_id_path_param()
|
|
1033
|
+
if region_id is None:
|
|
1034
|
+
region_id = self._client._get_cloud_region_id_path_param()
|
|
1035
|
+
if not instance_id:
|
|
1036
|
+
raise ValueError(f"Expected a non-empty value for `instance_id` but received {instance_id!r}")
|
|
1037
|
+
return await self._post(
|
|
1038
|
+
f"/cloud/v1/ai/clusters/{project_id}/{region_id}/{instance_id}/powercycle",
|
|
1039
|
+
options=make_request_options(
|
|
1040
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
1041
|
+
),
|
|
1042
|
+
cast_to=GPUBaremetalClusterServer,
|
|
1043
|
+
)
|
|
1044
|
+
|
|
1045
|
+
async def reboot(
|
|
1046
|
+
self,
|
|
1047
|
+
instance_id: str,
|
|
1048
|
+
*,
|
|
1049
|
+
project_id: int | None = None,
|
|
1050
|
+
region_id: int | None = None,
|
|
1051
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
1052
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
1053
|
+
extra_headers: Headers | None = None,
|
|
1054
|
+
extra_query: Query | None = None,
|
|
1055
|
+
extra_body: Body | None = None,
|
|
1056
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
1057
|
+
) -> GPUBaremetalClusterServer:
|
|
1058
|
+
"""
|
|
1059
|
+
Reboot one bare metal GPU cluster server
|
|
1060
|
+
|
|
1061
|
+
Args:
|
|
1062
|
+
extra_headers: Send extra headers
|
|
1063
|
+
|
|
1064
|
+
extra_query: Add additional query parameters to the request
|
|
1065
|
+
|
|
1066
|
+
extra_body: Add additional JSON properties to the request
|
|
1067
|
+
|
|
1068
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
1069
|
+
"""
|
|
1070
|
+
if project_id is None:
|
|
1071
|
+
project_id = self._client._get_cloud_project_id_path_param()
|
|
1072
|
+
if region_id is None:
|
|
1073
|
+
region_id = self._client._get_cloud_region_id_path_param()
|
|
1074
|
+
if not instance_id:
|
|
1075
|
+
raise ValueError(f"Expected a non-empty value for `instance_id` but received {instance_id!r}")
|
|
1076
|
+
return await self._post(
|
|
1077
|
+
f"/cloud/v1/ai/clusters/{project_id}/{region_id}/{instance_id}/reboot",
|
|
1078
|
+
options=make_request_options(
|
|
1079
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
1080
|
+
),
|
|
1081
|
+
cast_to=GPUBaremetalClusterServer,
|
|
1082
|
+
)
|
|
1083
|
+
|
|
1084
|
+
|
|
1085
|
+
class ServersResourceWithRawResponse:
|
|
1086
|
+
def __init__(self, servers: ServersResource) -> None:
|
|
1087
|
+
self._servers = servers
|
|
1088
|
+
|
|
1089
|
+
self.delete = to_raw_response_wrapper(
|
|
1090
|
+
servers.delete,
|
|
1091
|
+
)
|
|
1092
|
+
self.attach_interface = to_raw_response_wrapper(
|
|
1093
|
+
servers.attach_interface,
|
|
1094
|
+
)
|
|
1095
|
+
self.detach_interface = to_raw_response_wrapper(
|
|
1096
|
+
servers.detach_interface,
|
|
1097
|
+
)
|
|
1098
|
+
self.get_console = to_raw_response_wrapper(
|
|
1099
|
+
servers.get_console,
|
|
1100
|
+
)
|
|
1101
|
+
self.powercycle = to_raw_response_wrapper(
|
|
1102
|
+
servers.powercycle,
|
|
1103
|
+
)
|
|
1104
|
+
self.reboot = to_raw_response_wrapper(
|
|
1105
|
+
servers.reboot,
|
|
1106
|
+
)
|
|
1107
|
+
|
|
1108
|
+
|
|
1109
|
+
class AsyncServersResourceWithRawResponse:
|
|
1110
|
+
def __init__(self, servers: AsyncServersResource) -> None:
|
|
1111
|
+
self._servers = servers
|
|
1112
|
+
|
|
1113
|
+
self.delete = async_to_raw_response_wrapper(
|
|
1114
|
+
servers.delete,
|
|
1115
|
+
)
|
|
1116
|
+
self.attach_interface = async_to_raw_response_wrapper(
|
|
1117
|
+
servers.attach_interface,
|
|
1118
|
+
)
|
|
1119
|
+
self.detach_interface = async_to_raw_response_wrapper(
|
|
1120
|
+
servers.detach_interface,
|
|
1121
|
+
)
|
|
1122
|
+
self.get_console = async_to_raw_response_wrapper(
|
|
1123
|
+
servers.get_console,
|
|
1124
|
+
)
|
|
1125
|
+
self.powercycle = async_to_raw_response_wrapper(
|
|
1126
|
+
servers.powercycle,
|
|
1127
|
+
)
|
|
1128
|
+
self.reboot = async_to_raw_response_wrapper(
|
|
1129
|
+
servers.reboot,
|
|
1130
|
+
)
|
|
1131
|
+
|
|
1132
|
+
|
|
1133
|
+
class ServersResourceWithStreamingResponse:
|
|
1134
|
+
def __init__(self, servers: ServersResource) -> None:
|
|
1135
|
+
self._servers = servers
|
|
1136
|
+
|
|
1137
|
+
self.delete = to_streamed_response_wrapper(
|
|
1138
|
+
servers.delete,
|
|
1139
|
+
)
|
|
1140
|
+
self.attach_interface = to_streamed_response_wrapper(
|
|
1141
|
+
servers.attach_interface,
|
|
1142
|
+
)
|
|
1143
|
+
self.detach_interface = to_streamed_response_wrapper(
|
|
1144
|
+
servers.detach_interface,
|
|
1145
|
+
)
|
|
1146
|
+
self.get_console = to_streamed_response_wrapper(
|
|
1147
|
+
servers.get_console,
|
|
1148
|
+
)
|
|
1149
|
+
self.powercycle = to_streamed_response_wrapper(
|
|
1150
|
+
servers.powercycle,
|
|
1151
|
+
)
|
|
1152
|
+
self.reboot = to_streamed_response_wrapper(
|
|
1153
|
+
servers.reboot,
|
|
1154
|
+
)
|
|
1155
|
+
|
|
1156
|
+
|
|
1157
|
+
class AsyncServersResourceWithStreamingResponse:
|
|
1158
|
+
def __init__(self, servers: AsyncServersResource) -> None:
|
|
1159
|
+
self._servers = servers
|
|
1160
|
+
|
|
1161
|
+
self.delete = async_to_streamed_response_wrapper(
|
|
1162
|
+
servers.delete,
|
|
1163
|
+
)
|
|
1164
|
+
self.attach_interface = async_to_streamed_response_wrapper(
|
|
1165
|
+
servers.attach_interface,
|
|
1166
|
+
)
|
|
1167
|
+
self.detach_interface = async_to_streamed_response_wrapper(
|
|
1168
|
+
servers.detach_interface,
|
|
1169
|
+
)
|
|
1170
|
+
self.get_console = async_to_streamed_response_wrapper(
|
|
1171
|
+
servers.get_console,
|
|
1172
|
+
)
|
|
1173
|
+
self.powercycle = async_to_streamed_response_wrapper(
|
|
1174
|
+
servers.powercycle,
|
|
1175
|
+
)
|
|
1176
|
+
self.reboot = async_to_streamed_response_wrapper(
|
|
1177
|
+
servers.reboot,
|
|
1178
|
+
)
|