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,785 @@
|
|
|
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 Optional
|
|
6
|
+
from typing_extensions import Literal
|
|
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.gpu_image import GPUImage
|
|
22
|
+
from ....types.cloud.task_id_list import TaskIDList
|
|
23
|
+
from ....types.cloud.gpu_image_list import GPUImageList
|
|
24
|
+
from ....types.cloud.tag_update_map_param import TagUpdateMapParam
|
|
25
|
+
from ....types.cloud.gpu_baremetal_clusters import image_upload_params
|
|
26
|
+
|
|
27
|
+
__all__ = ["ImagesResource", "AsyncImagesResource"]
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
class ImagesResource(SyncAPIResource):
|
|
31
|
+
@cached_property
|
|
32
|
+
def with_raw_response(self) -> ImagesResourceWithRawResponse:
|
|
33
|
+
"""
|
|
34
|
+
This property can be used as a prefix for any HTTP method call to return
|
|
35
|
+
the raw response object instead of the parsed content.
|
|
36
|
+
|
|
37
|
+
For more information, see https://www.github.com/G-Core/gcore-python#accessing-raw-response-data-eg-headers
|
|
38
|
+
"""
|
|
39
|
+
return ImagesResourceWithRawResponse(self)
|
|
40
|
+
|
|
41
|
+
@cached_property
|
|
42
|
+
def with_streaming_response(self) -> ImagesResourceWithStreamingResponse:
|
|
43
|
+
"""
|
|
44
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
45
|
+
|
|
46
|
+
For more information, see https://www.github.com/G-Core/gcore-python#with_streaming_response
|
|
47
|
+
"""
|
|
48
|
+
return ImagesResourceWithStreamingResponse(self)
|
|
49
|
+
|
|
50
|
+
def list(
|
|
51
|
+
self,
|
|
52
|
+
*,
|
|
53
|
+
project_id: int | None = None,
|
|
54
|
+
region_id: int | None = None,
|
|
55
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
56
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
57
|
+
extra_headers: Headers | None = None,
|
|
58
|
+
extra_query: Query | None = None,
|
|
59
|
+
extra_body: Body | None = None,
|
|
60
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
61
|
+
) -> GPUImageList:
|
|
62
|
+
"""
|
|
63
|
+
List bare metal GPU images
|
|
64
|
+
|
|
65
|
+
Args:
|
|
66
|
+
project_id: Project ID
|
|
67
|
+
|
|
68
|
+
region_id: Region ID
|
|
69
|
+
|
|
70
|
+
extra_headers: Send extra headers
|
|
71
|
+
|
|
72
|
+
extra_query: Add additional query parameters to the request
|
|
73
|
+
|
|
74
|
+
extra_body: Add additional JSON properties to the request
|
|
75
|
+
|
|
76
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
77
|
+
"""
|
|
78
|
+
if project_id is None:
|
|
79
|
+
project_id = self._client._get_cloud_project_id_path_param()
|
|
80
|
+
if region_id is None:
|
|
81
|
+
region_id = self._client._get_cloud_region_id_path_param()
|
|
82
|
+
return self._get(
|
|
83
|
+
f"/cloud/v3/gpu/baremetal/{project_id}/{region_id}/images",
|
|
84
|
+
options=make_request_options(
|
|
85
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
86
|
+
),
|
|
87
|
+
cast_to=GPUImageList,
|
|
88
|
+
)
|
|
89
|
+
|
|
90
|
+
def delete(
|
|
91
|
+
self,
|
|
92
|
+
image_id: str,
|
|
93
|
+
*,
|
|
94
|
+
project_id: int | None = None,
|
|
95
|
+
region_id: int | None = None,
|
|
96
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
97
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
98
|
+
extra_headers: Headers | None = None,
|
|
99
|
+
extra_query: Query | None = None,
|
|
100
|
+
extra_body: Body | None = None,
|
|
101
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
102
|
+
) -> TaskIDList:
|
|
103
|
+
"""
|
|
104
|
+
Delete bare metal GPU image by ID
|
|
105
|
+
|
|
106
|
+
Args:
|
|
107
|
+
project_id: Project ID
|
|
108
|
+
|
|
109
|
+
region_id: Region ID
|
|
110
|
+
|
|
111
|
+
image_id: Image ID
|
|
112
|
+
|
|
113
|
+
extra_headers: Send extra headers
|
|
114
|
+
|
|
115
|
+
extra_query: Add additional query parameters to the request
|
|
116
|
+
|
|
117
|
+
extra_body: Add additional JSON properties to the request
|
|
118
|
+
|
|
119
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
120
|
+
"""
|
|
121
|
+
if project_id is None:
|
|
122
|
+
project_id = self._client._get_cloud_project_id_path_param()
|
|
123
|
+
if region_id is None:
|
|
124
|
+
region_id = self._client._get_cloud_region_id_path_param()
|
|
125
|
+
if not image_id:
|
|
126
|
+
raise ValueError(f"Expected a non-empty value for `image_id` but received {image_id!r}")
|
|
127
|
+
return self._delete(
|
|
128
|
+
f"/cloud/v3/gpu/baremetal/{project_id}/{region_id}/images/{image_id}",
|
|
129
|
+
options=make_request_options(
|
|
130
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
131
|
+
),
|
|
132
|
+
cast_to=TaskIDList,
|
|
133
|
+
)
|
|
134
|
+
|
|
135
|
+
def delete_and_poll(
|
|
136
|
+
self,
|
|
137
|
+
image_id: str,
|
|
138
|
+
*,
|
|
139
|
+
project_id: int | None = None,
|
|
140
|
+
region_id: int | None = None,
|
|
141
|
+
polling_interval_seconds: int | NotGiven = NOT_GIVEN,
|
|
142
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
143
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
144
|
+
extra_headers: Headers | None = None,
|
|
145
|
+
extra_query: Query | None = None,
|
|
146
|
+
extra_body: Body | None = None,
|
|
147
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
148
|
+
) -> None:
|
|
149
|
+
"""
|
|
150
|
+
Delete a bare metal GPU image and wait for the deletion to complete.
|
|
151
|
+
"""
|
|
152
|
+
response = self.delete(
|
|
153
|
+
image_id=image_id,
|
|
154
|
+
project_id=project_id,
|
|
155
|
+
region_id=region_id,
|
|
156
|
+
extra_headers=extra_headers,
|
|
157
|
+
extra_query=extra_query,
|
|
158
|
+
extra_body=extra_body,
|
|
159
|
+
timeout=timeout,
|
|
160
|
+
)
|
|
161
|
+
if not response.tasks or len(response.tasks) != 1:
|
|
162
|
+
raise ValueError(f"Expected exactly one task to be created")
|
|
163
|
+
self._client.cloud.tasks.poll(
|
|
164
|
+
response.tasks[0],
|
|
165
|
+
extra_headers=extra_headers,
|
|
166
|
+
extra_query=extra_query,
|
|
167
|
+
extra_body=extra_body,
|
|
168
|
+
polling_interval_seconds=polling_interval_seconds,
|
|
169
|
+
)
|
|
170
|
+
|
|
171
|
+
def get(
|
|
172
|
+
self,
|
|
173
|
+
image_id: str,
|
|
174
|
+
*,
|
|
175
|
+
project_id: int | None = None,
|
|
176
|
+
region_id: int | None = None,
|
|
177
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
178
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
179
|
+
extra_headers: Headers | None = None,
|
|
180
|
+
extra_query: Query | None = None,
|
|
181
|
+
extra_body: Body | None = None,
|
|
182
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
183
|
+
) -> GPUImage:
|
|
184
|
+
"""
|
|
185
|
+
Get bare metal GPU image by ID
|
|
186
|
+
|
|
187
|
+
Args:
|
|
188
|
+
project_id: Project ID
|
|
189
|
+
|
|
190
|
+
region_id: Region ID
|
|
191
|
+
|
|
192
|
+
image_id: Image ID
|
|
193
|
+
|
|
194
|
+
extra_headers: Send extra headers
|
|
195
|
+
|
|
196
|
+
extra_query: Add additional query parameters to the request
|
|
197
|
+
|
|
198
|
+
extra_body: Add additional JSON properties to the request
|
|
199
|
+
|
|
200
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
201
|
+
"""
|
|
202
|
+
if project_id is None:
|
|
203
|
+
project_id = self._client._get_cloud_project_id_path_param()
|
|
204
|
+
if region_id is None:
|
|
205
|
+
region_id = self._client._get_cloud_region_id_path_param()
|
|
206
|
+
if not image_id:
|
|
207
|
+
raise ValueError(f"Expected a non-empty value for `image_id` but received {image_id!r}")
|
|
208
|
+
return self._get(
|
|
209
|
+
f"/cloud/v3/gpu/baremetal/{project_id}/{region_id}/images/{image_id}",
|
|
210
|
+
options=make_request_options(
|
|
211
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
212
|
+
),
|
|
213
|
+
cast_to=GPUImage,
|
|
214
|
+
)
|
|
215
|
+
|
|
216
|
+
def upload(
|
|
217
|
+
self,
|
|
218
|
+
*,
|
|
219
|
+
project_id: int | None = None,
|
|
220
|
+
region_id: int | None = None,
|
|
221
|
+
name: str,
|
|
222
|
+
url: str,
|
|
223
|
+
architecture: Optional[Literal["aarch64", "x86_64"]] | NotGiven = NOT_GIVEN,
|
|
224
|
+
cow_format: bool | NotGiven = NOT_GIVEN,
|
|
225
|
+
hw_firmware_type: Optional[Literal["bios", "uefi"]] | NotGiven = NOT_GIVEN,
|
|
226
|
+
os_distro: Optional[str] | NotGiven = NOT_GIVEN,
|
|
227
|
+
os_type: Optional[Literal["linux", "windows"]] | NotGiven = NOT_GIVEN,
|
|
228
|
+
os_version: Optional[str] | NotGiven = NOT_GIVEN,
|
|
229
|
+
ssh_key: Literal["allow", "deny", "required"] | NotGiven = NOT_GIVEN,
|
|
230
|
+
tags: TagUpdateMapParam | NotGiven = NOT_GIVEN,
|
|
231
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
232
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
233
|
+
extra_headers: Headers | None = None,
|
|
234
|
+
extra_query: Query | None = None,
|
|
235
|
+
extra_body: Body | None = None,
|
|
236
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
237
|
+
) -> TaskIDList:
|
|
238
|
+
"""
|
|
239
|
+
Upload new bare metal GPU image
|
|
240
|
+
|
|
241
|
+
Args:
|
|
242
|
+
project_id: Project ID
|
|
243
|
+
|
|
244
|
+
region_id: Region ID
|
|
245
|
+
|
|
246
|
+
name: Image name
|
|
247
|
+
|
|
248
|
+
url: Image URL
|
|
249
|
+
|
|
250
|
+
architecture: Image architecture type: aarch64, x86_64
|
|
251
|
+
|
|
252
|
+
cow_format: When True, image cannot be deleted unless all volumes, created from it, are
|
|
253
|
+
deleted.
|
|
254
|
+
|
|
255
|
+
hw_firmware_type: Specifies the type of firmware with which to boot the guest.
|
|
256
|
+
|
|
257
|
+
os_distro: OS Distribution, i.e. Debian, CentOS, Ubuntu, CoreOS etc.
|
|
258
|
+
|
|
259
|
+
os_type: The operating system installed on the image. Linux by default
|
|
260
|
+
|
|
261
|
+
os_version: OS version, i.e. 19.04 (for Ubuntu) or 9.4 for Debian
|
|
262
|
+
|
|
263
|
+
ssh_key: Permission to use a ssh key in instances
|
|
264
|
+
|
|
265
|
+
tags: Key-value tags to associate with the resource. A tag is a key-value pair that
|
|
266
|
+
can be associated with a resource, enabling efficient filtering and grouping for
|
|
267
|
+
better organization and management. Some tags are read-only and cannot be
|
|
268
|
+
modified by the user. Tags are also integrated with cost reports, allowing cost
|
|
269
|
+
data to be filtered based on tag keys or values.
|
|
270
|
+
|
|
271
|
+
extra_headers: Send extra headers
|
|
272
|
+
|
|
273
|
+
extra_query: Add additional query parameters to the request
|
|
274
|
+
|
|
275
|
+
extra_body: Add additional JSON properties to the request
|
|
276
|
+
|
|
277
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
278
|
+
"""
|
|
279
|
+
if project_id is None:
|
|
280
|
+
project_id = self._client._get_cloud_project_id_path_param()
|
|
281
|
+
if region_id is None:
|
|
282
|
+
region_id = self._client._get_cloud_region_id_path_param()
|
|
283
|
+
return self._post(
|
|
284
|
+
f"/cloud/v3/gpu/baremetal/{project_id}/{region_id}/images",
|
|
285
|
+
body=maybe_transform(
|
|
286
|
+
{
|
|
287
|
+
"name": name,
|
|
288
|
+
"url": url,
|
|
289
|
+
"architecture": architecture,
|
|
290
|
+
"cow_format": cow_format,
|
|
291
|
+
"hw_firmware_type": hw_firmware_type,
|
|
292
|
+
"os_distro": os_distro,
|
|
293
|
+
"os_type": os_type,
|
|
294
|
+
"os_version": os_version,
|
|
295
|
+
"ssh_key": ssh_key,
|
|
296
|
+
"tags": tags,
|
|
297
|
+
},
|
|
298
|
+
image_upload_params.ImageUploadParams,
|
|
299
|
+
),
|
|
300
|
+
options=make_request_options(
|
|
301
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
302
|
+
),
|
|
303
|
+
cast_to=TaskIDList,
|
|
304
|
+
)
|
|
305
|
+
|
|
306
|
+
def upload_and_poll(
|
|
307
|
+
self,
|
|
308
|
+
*,
|
|
309
|
+
project_id: int | None = None,
|
|
310
|
+
region_id: int | None = None,
|
|
311
|
+
name: str,
|
|
312
|
+
url: str,
|
|
313
|
+
architecture: Optional[Literal["aarch64", "x86_64"]] | NotGiven = NOT_GIVEN,
|
|
314
|
+
cow_format: bool | NotGiven = NOT_GIVEN,
|
|
315
|
+
hw_firmware_type: Optional[Literal["bios", "uefi"]] | NotGiven = NOT_GIVEN,
|
|
316
|
+
os_distro: Optional[str] | NotGiven = NOT_GIVEN,
|
|
317
|
+
os_type: Optional[Literal["linux", "windows"]] | NotGiven = NOT_GIVEN,
|
|
318
|
+
os_version: Optional[str] | NotGiven = NOT_GIVEN,
|
|
319
|
+
ssh_key: Literal["allow", "deny", "required"] | NotGiven = NOT_GIVEN,
|
|
320
|
+
tags: TagUpdateMapParam | NotGiven = NOT_GIVEN,
|
|
321
|
+
polling_interval_seconds: int | NotGiven = NOT_GIVEN,
|
|
322
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
323
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
324
|
+
extra_headers: Headers | None = None,
|
|
325
|
+
extra_query: Query | None = None,
|
|
326
|
+
extra_body: Body | None = None,
|
|
327
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
328
|
+
) -> GPUImage:
|
|
329
|
+
"""
|
|
330
|
+
Upload a new bare metal GPU image and wait for the upload to complete.
|
|
331
|
+
"""
|
|
332
|
+
response = self.upload(
|
|
333
|
+
project_id=project_id,
|
|
334
|
+
region_id=region_id,
|
|
335
|
+
name=name,
|
|
336
|
+
url=url,
|
|
337
|
+
architecture=architecture,
|
|
338
|
+
cow_format=cow_format,
|
|
339
|
+
hw_firmware_type=hw_firmware_type,
|
|
340
|
+
os_distro=os_distro,
|
|
341
|
+
os_type=os_type,
|
|
342
|
+
os_version=os_version,
|
|
343
|
+
ssh_key=ssh_key,
|
|
344
|
+
tags=tags,
|
|
345
|
+
extra_headers=extra_headers,
|
|
346
|
+
extra_query=extra_query,
|
|
347
|
+
extra_body=extra_body,
|
|
348
|
+
timeout=timeout,
|
|
349
|
+
)
|
|
350
|
+
if not response.tasks or len(response.tasks) != 1:
|
|
351
|
+
raise ValueError(f"Expected exactly one task to be created")
|
|
352
|
+
task = self._client.cloud.tasks.poll(
|
|
353
|
+
response.tasks[0],
|
|
354
|
+
extra_headers=extra_headers,
|
|
355
|
+
extra_query=extra_query,
|
|
356
|
+
extra_body=extra_body,
|
|
357
|
+
polling_interval_seconds=polling_interval_seconds,
|
|
358
|
+
)
|
|
359
|
+
if not task.created_resources or not task.created_resources.images:
|
|
360
|
+
raise ValueError("No image was created")
|
|
361
|
+
image_id = task.created_resources.images[0]
|
|
362
|
+
return self.get(
|
|
363
|
+
image_id=image_id,
|
|
364
|
+
project_id=project_id,
|
|
365
|
+
region_id=region_id,
|
|
366
|
+
extra_headers=extra_headers,
|
|
367
|
+
extra_query=extra_query,
|
|
368
|
+
extra_body=extra_body,
|
|
369
|
+
timeout=timeout,
|
|
370
|
+
)
|
|
371
|
+
|
|
372
|
+
|
|
373
|
+
class AsyncImagesResource(AsyncAPIResource):
|
|
374
|
+
@cached_property
|
|
375
|
+
def with_raw_response(self) -> AsyncImagesResourceWithRawResponse:
|
|
376
|
+
"""
|
|
377
|
+
This property can be used as a prefix for any HTTP method call to return
|
|
378
|
+
the raw response object instead of the parsed content.
|
|
379
|
+
|
|
380
|
+
For more information, see https://www.github.com/G-Core/gcore-python#accessing-raw-response-data-eg-headers
|
|
381
|
+
"""
|
|
382
|
+
return AsyncImagesResourceWithRawResponse(self)
|
|
383
|
+
|
|
384
|
+
@cached_property
|
|
385
|
+
def with_streaming_response(self) -> AsyncImagesResourceWithStreamingResponse:
|
|
386
|
+
"""
|
|
387
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
388
|
+
|
|
389
|
+
For more information, see https://www.github.com/G-Core/gcore-python#with_streaming_response
|
|
390
|
+
"""
|
|
391
|
+
return AsyncImagesResourceWithStreamingResponse(self)
|
|
392
|
+
|
|
393
|
+
async def list(
|
|
394
|
+
self,
|
|
395
|
+
*,
|
|
396
|
+
project_id: int | None = None,
|
|
397
|
+
region_id: int | None = None,
|
|
398
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
399
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
400
|
+
extra_headers: Headers | None = None,
|
|
401
|
+
extra_query: Query | None = None,
|
|
402
|
+
extra_body: Body | None = None,
|
|
403
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
404
|
+
) -> GPUImageList:
|
|
405
|
+
"""
|
|
406
|
+
List bare metal GPU images
|
|
407
|
+
|
|
408
|
+
Args:
|
|
409
|
+
project_id: Project ID
|
|
410
|
+
|
|
411
|
+
region_id: Region ID
|
|
412
|
+
|
|
413
|
+
extra_headers: Send extra headers
|
|
414
|
+
|
|
415
|
+
extra_query: Add additional query parameters to the request
|
|
416
|
+
|
|
417
|
+
extra_body: Add additional JSON properties to the request
|
|
418
|
+
|
|
419
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
420
|
+
"""
|
|
421
|
+
if project_id is None:
|
|
422
|
+
project_id = self._client._get_cloud_project_id_path_param()
|
|
423
|
+
if region_id is None:
|
|
424
|
+
region_id = self._client._get_cloud_region_id_path_param()
|
|
425
|
+
return await self._get(
|
|
426
|
+
f"/cloud/v3/gpu/baremetal/{project_id}/{region_id}/images",
|
|
427
|
+
options=make_request_options(
|
|
428
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
429
|
+
),
|
|
430
|
+
cast_to=GPUImageList,
|
|
431
|
+
)
|
|
432
|
+
|
|
433
|
+
async def delete(
|
|
434
|
+
self,
|
|
435
|
+
image_id: str,
|
|
436
|
+
*,
|
|
437
|
+
project_id: int | None = None,
|
|
438
|
+
region_id: int | None = None,
|
|
439
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
440
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
441
|
+
extra_headers: Headers | None = None,
|
|
442
|
+
extra_query: Query | None = None,
|
|
443
|
+
extra_body: Body | None = None,
|
|
444
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
445
|
+
) -> TaskIDList:
|
|
446
|
+
"""
|
|
447
|
+
Delete bare metal GPU image by ID
|
|
448
|
+
|
|
449
|
+
Args:
|
|
450
|
+
project_id: Project ID
|
|
451
|
+
|
|
452
|
+
region_id: Region ID
|
|
453
|
+
|
|
454
|
+
image_id: Image ID
|
|
455
|
+
|
|
456
|
+
extra_headers: Send extra headers
|
|
457
|
+
|
|
458
|
+
extra_query: Add additional query parameters to the request
|
|
459
|
+
|
|
460
|
+
extra_body: Add additional JSON properties to the request
|
|
461
|
+
|
|
462
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
463
|
+
"""
|
|
464
|
+
if project_id is None:
|
|
465
|
+
project_id = self._client._get_cloud_project_id_path_param()
|
|
466
|
+
if region_id is None:
|
|
467
|
+
region_id = self._client._get_cloud_region_id_path_param()
|
|
468
|
+
if not image_id:
|
|
469
|
+
raise ValueError(f"Expected a non-empty value for `image_id` but received {image_id!r}")
|
|
470
|
+
return await self._delete(
|
|
471
|
+
f"/cloud/v3/gpu/baremetal/{project_id}/{region_id}/images/{image_id}",
|
|
472
|
+
options=make_request_options(
|
|
473
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
474
|
+
),
|
|
475
|
+
cast_to=TaskIDList,
|
|
476
|
+
)
|
|
477
|
+
|
|
478
|
+
async def delete_and_poll(
|
|
479
|
+
self,
|
|
480
|
+
image_id: str,
|
|
481
|
+
*,
|
|
482
|
+
project_id: int | None = None,
|
|
483
|
+
region_id: int | None = None,
|
|
484
|
+
polling_interval_seconds: int | NotGiven = NOT_GIVEN,
|
|
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
|
+
) -> None:
|
|
492
|
+
"""
|
|
493
|
+
Delete a bare metal GPU image and wait for the deletion to complete.
|
|
494
|
+
"""
|
|
495
|
+
response = await self.delete(
|
|
496
|
+
image_id=image_id,
|
|
497
|
+
project_id=project_id,
|
|
498
|
+
region_id=region_id,
|
|
499
|
+
extra_headers=extra_headers,
|
|
500
|
+
extra_query=extra_query,
|
|
501
|
+
extra_body=extra_body,
|
|
502
|
+
timeout=timeout,
|
|
503
|
+
)
|
|
504
|
+
if not response.tasks or len(response.tasks) != 1:
|
|
505
|
+
raise ValueError(f"Expected exactly one task to be created")
|
|
506
|
+
await self._client.cloud.tasks.poll(
|
|
507
|
+
response.tasks[0],
|
|
508
|
+
extra_headers=extra_headers,
|
|
509
|
+
extra_query=extra_query,
|
|
510
|
+
extra_body=extra_body,
|
|
511
|
+
polling_interval_seconds=polling_interval_seconds,
|
|
512
|
+
)
|
|
513
|
+
|
|
514
|
+
async def get(
|
|
515
|
+
self,
|
|
516
|
+
image_id: str,
|
|
517
|
+
*,
|
|
518
|
+
project_id: int | None = None,
|
|
519
|
+
region_id: int | None = None,
|
|
520
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
521
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
522
|
+
extra_headers: Headers | None = None,
|
|
523
|
+
extra_query: Query | None = None,
|
|
524
|
+
extra_body: Body | None = None,
|
|
525
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
526
|
+
) -> GPUImage:
|
|
527
|
+
"""
|
|
528
|
+
Get bare metal GPU image by ID
|
|
529
|
+
|
|
530
|
+
Args:
|
|
531
|
+
project_id: Project ID
|
|
532
|
+
|
|
533
|
+
region_id: Region ID
|
|
534
|
+
|
|
535
|
+
image_id: Image ID
|
|
536
|
+
|
|
537
|
+
extra_headers: Send extra headers
|
|
538
|
+
|
|
539
|
+
extra_query: Add additional query parameters to the request
|
|
540
|
+
|
|
541
|
+
extra_body: Add additional JSON properties to the request
|
|
542
|
+
|
|
543
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
544
|
+
"""
|
|
545
|
+
if project_id is None:
|
|
546
|
+
project_id = self._client._get_cloud_project_id_path_param()
|
|
547
|
+
if region_id is None:
|
|
548
|
+
region_id = self._client._get_cloud_region_id_path_param()
|
|
549
|
+
if not image_id:
|
|
550
|
+
raise ValueError(f"Expected a non-empty value for `image_id` but received {image_id!r}")
|
|
551
|
+
return await self._get(
|
|
552
|
+
f"/cloud/v3/gpu/baremetal/{project_id}/{region_id}/images/{image_id}",
|
|
553
|
+
options=make_request_options(
|
|
554
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
555
|
+
),
|
|
556
|
+
cast_to=GPUImage,
|
|
557
|
+
)
|
|
558
|
+
|
|
559
|
+
async def upload(
|
|
560
|
+
self,
|
|
561
|
+
*,
|
|
562
|
+
project_id: int | None = None,
|
|
563
|
+
region_id: int | None = None,
|
|
564
|
+
name: str,
|
|
565
|
+
url: str,
|
|
566
|
+
architecture: Optional[Literal["aarch64", "x86_64"]] | NotGiven = NOT_GIVEN,
|
|
567
|
+
cow_format: bool | NotGiven = NOT_GIVEN,
|
|
568
|
+
hw_firmware_type: Optional[Literal["bios", "uefi"]] | NotGiven = NOT_GIVEN,
|
|
569
|
+
os_distro: Optional[str] | NotGiven = NOT_GIVEN,
|
|
570
|
+
os_type: Optional[Literal["linux", "windows"]] | NotGiven = NOT_GIVEN,
|
|
571
|
+
os_version: Optional[str] | NotGiven = NOT_GIVEN,
|
|
572
|
+
ssh_key: Literal["allow", "deny", "required"] | NotGiven = NOT_GIVEN,
|
|
573
|
+
tags: TagUpdateMapParam | NotGiven = NOT_GIVEN,
|
|
574
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
575
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
576
|
+
extra_headers: Headers | None = None,
|
|
577
|
+
extra_query: Query | None = None,
|
|
578
|
+
extra_body: Body | None = None,
|
|
579
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
580
|
+
) -> TaskIDList:
|
|
581
|
+
"""
|
|
582
|
+
Upload new bare metal GPU image
|
|
583
|
+
|
|
584
|
+
Args:
|
|
585
|
+
project_id: Project ID
|
|
586
|
+
|
|
587
|
+
region_id: Region ID
|
|
588
|
+
|
|
589
|
+
name: Image name
|
|
590
|
+
|
|
591
|
+
url: Image URL
|
|
592
|
+
|
|
593
|
+
architecture: Image architecture type: aarch64, x86_64
|
|
594
|
+
|
|
595
|
+
cow_format: When True, image cannot be deleted unless all volumes, created from it, are
|
|
596
|
+
deleted.
|
|
597
|
+
|
|
598
|
+
hw_firmware_type: Specifies the type of firmware with which to boot the guest.
|
|
599
|
+
|
|
600
|
+
os_distro: OS Distribution, i.e. Debian, CentOS, Ubuntu, CoreOS etc.
|
|
601
|
+
|
|
602
|
+
os_type: The operating system installed on the image. Linux by default
|
|
603
|
+
|
|
604
|
+
os_version: OS version, i.e. 19.04 (for Ubuntu) or 9.4 for Debian
|
|
605
|
+
|
|
606
|
+
ssh_key: Permission to use a ssh key in instances
|
|
607
|
+
|
|
608
|
+
tags: Key-value tags to associate with the resource. A tag is a key-value pair that
|
|
609
|
+
can be associated with a resource, enabling efficient filtering and grouping for
|
|
610
|
+
better organization and management. Some tags are read-only and cannot be
|
|
611
|
+
modified by the user. Tags are also integrated with cost reports, allowing cost
|
|
612
|
+
data to be filtered based on tag keys or values.
|
|
613
|
+
|
|
614
|
+
extra_headers: Send extra headers
|
|
615
|
+
|
|
616
|
+
extra_query: Add additional query parameters to the request
|
|
617
|
+
|
|
618
|
+
extra_body: Add additional JSON properties to the request
|
|
619
|
+
|
|
620
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
621
|
+
"""
|
|
622
|
+
if project_id is None:
|
|
623
|
+
project_id = self._client._get_cloud_project_id_path_param()
|
|
624
|
+
if region_id is None:
|
|
625
|
+
region_id = self._client._get_cloud_region_id_path_param()
|
|
626
|
+
return await self._post(
|
|
627
|
+
f"/cloud/v3/gpu/baremetal/{project_id}/{region_id}/images",
|
|
628
|
+
body=await async_maybe_transform(
|
|
629
|
+
{
|
|
630
|
+
"name": name,
|
|
631
|
+
"url": url,
|
|
632
|
+
"architecture": architecture,
|
|
633
|
+
"cow_format": cow_format,
|
|
634
|
+
"hw_firmware_type": hw_firmware_type,
|
|
635
|
+
"os_distro": os_distro,
|
|
636
|
+
"os_type": os_type,
|
|
637
|
+
"os_version": os_version,
|
|
638
|
+
"ssh_key": ssh_key,
|
|
639
|
+
"tags": tags,
|
|
640
|
+
},
|
|
641
|
+
image_upload_params.ImageUploadParams,
|
|
642
|
+
),
|
|
643
|
+
options=make_request_options(
|
|
644
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
645
|
+
),
|
|
646
|
+
cast_to=TaskIDList,
|
|
647
|
+
)
|
|
648
|
+
|
|
649
|
+
async def upload_and_poll(
|
|
650
|
+
self,
|
|
651
|
+
*,
|
|
652
|
+
project_id: int | None = None,
|
|
653
|
+
region_id: int | None = None,
|
|
654
|
+
name: str,
|
|
655
|
+
url: str,
|
|
656
|
+
architecture: Optional[Literal["aarch64", "x86_64"]] | NotGiven = NOT_GIVEN,
|
|
657
|
+
cow_format: bool | NotGiven = NOT_GIVEN,
|
|
658
|
+
hw_firmware_type: Optional[Literal["bios", "uefi"]] | NotGiven = NOT_GIVEN,
|
|
659
|
+
os_distro: Optional[str] | NotGiven = NOT_GIVEN,
|
|
660
|
+
os_type: Optional[Literal["linux", "windows"]] | NotGiven = NOT_GIVEN,
|
|
661
|
+
os_version: Optional[str] | NotGiven = NOT_GIVEN,
|
|
662
|
+
ssh_key: Literal["allow", "deny", "required"] | NotGiven = NOT_GIVEN,
|
|
663
|
+
tags: TagUpdateMapParam | NotGiven = NOT_GIVEN,
|
|
664
|
+
polling_interval_seconds: int | NotGiven = NOT_GIVEN,
|
|
665
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
666
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
667
|
+
extra_headers: Headers | None = None,
|
|
668
|
+
extra_query: Query | None = None,
|
|
669
|
+
extra_body: Body | None = None,
|
|
670
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
671
|
+
) -> GPUImage:
|
|
672
|
+
"""
|
|
673
|
+
Upload a new bare metal GPU image and wait for the upload to complete.
|
|
674
|
+
"""
|
|
675
|
+
response = await self.upload(
|
|
676
|
+
project_id=project_id,
|
|
677
|
+
region_id=region_id,
|
|
678
|
+
name=name,
|
|
679
|
+
url=url,
|
|
680
|
+
architecture=architecture,
|
|
681
|
+
cow_format=cow_format,
|
|
682
|
+
hw_firmware_type=hw_firmware_type,
|
|
683
|
+
os_distro=os_distro,
|
|
684
|
+
os_type=os_type,
|
|
685
|
+
os_version=os_version,
|
|
686
|
+
ssh_key=ssh_key,
|
|
687
|
+
tags=tags,
|
|
688
|
+
extra_headers=extra_headers,
|
|
689
|
+
extra_query=extra_query,
|
|
690
|
+
extra_body=extra_body,
|
|
691
|
+
timeout=timeout,
|
|
692
|
+
)
|
|
693
|
+
if not response.tasks or len(response.tasks) != 1:
|
|
694
|
+
raise ValueError(f"Expected exactly one task to be created")
|
|
695
|
+
task = await self._client.cloud.tasks.poll(
|
|
696
|
+
response.tasks[0],
|
|
697
|
+
extra_headers=extra_headers,
|
|
698
|
+
extra_query=extra_query,
|
|
699
|
+
extra_body=extra_body,
|
|
700
|
+
polling_interval_seconds=polling_interval_seconds,
|
|
701
|
+
)
|
|
702
|
+
if not task.created_resources or not task.created_resources.images:
|
|
703
|
+
raise ValueError("No image was created")
|
|
704
|
+
image_id = task.created_resources.images[0]
|
|
705
|
+
return await self.get(
|
|
706
|
+
image_id=image_id,
|
|
707
|
+
project_id=project_id,
|
|
708
|
+
region_id=region_id,
|
|
709
|
+
extra_headers=extra_headers,
|
|
710
|
+
extra_query=extra_query,
|
|
711
|
+
extra_body=extra_body,
|
|
712
|
+
timeout=timeout,
|
|
713
|
+
)
|
|
714
|
+
|
|
715
|
+
|
|
716
|
+
class ImagesResourceWithRawResponse:
|
|
717
|
+
def __init__(self, images: ImagesResource) -> None:
|
|
718
|
+
self._images = images
|
|
719
|
+
|
|
720
|
+
self.list = to_raw_response_wrapper(
|
|
721
|
+
images.list,
|
|
722
|
+
)
|
|
723
|
+
self.delete = to_raw_response_wrapper(
|
|
724
|
+
images.delete,
|
|
725
|
+
)
|
|
726
|
+
self.get = to_raw_response_wrapper(
|
|
727
|
+
images.get,
|
|
728
|
+
)
|
|
729
|
+
self.upload = to_raw_response_wrapper(
|
|
730
|
+
images.upload,
|
|
731
|
+
)
|
|
732
|
+
|
|
733
|
+
|
|
734
|
+
class AsyncImagesResourceWithRawResponse:
|
|
735
|
+
def __init__(self, images: AsyncImagesResource) -> None:
|
|
736
|
+
self._images = images
|
|
737
|
+
|
|
738
|
+
self.list = async_to_raw_response_wrapper(
|
|
739
|
+
images.list,
|
|
740
|
+
)
|
|
741
|
+
self.delete = async_to_raw_response_wrapper(
|
|
742
|
+
images.delete,
|
|
743
|
+
)
|
|
744
|
+
self.get = async_to_raw_response_wrapper(
|
|
745
|
+
images.get,
|
|
746
|
+
)
|
|
747
|
+
self.upload = async_to_raw_response_wrapper(
|
|
748
|
+
images.upload,
|
|
749
|
+
)
|
|
750
|
+
|
|
751
|
+
|
|
752
|
+
class ImagesResourceWithStreamingResponse:
|
|
753
|
+
def __init__(self, images: ImagesResource) -> None:
|
|
754
|
+
self._images = images
|
|
755
|
+
|
|
756
|
+
self.list = to_streamed_response_wrapper(
|
|
757
|
+
images.list,
|
|
758
|
+
)
|
|
759
|
+
self.delete = to_streamed_response_wrapper(
|
|
760
|
+
images.delete,
|
|
761
|
+
)
|
|
762
|
+
self.get = to_streamed_response_wrapper(
|
|
763
|
+
images.get,
|
|
764
|
+
)
|
|
765
|
+
self.upload = to_streamed_response_wrapper(
|
|
766
|
+
images.upload,
|
|
767
|
+
)
|
|
768
|
+
|
|
769
|
+
|
|
770
|
+
class AsyncImagesResourceWithStreamingResponse:
|
|
771
|
+
def __init__(self, images: AsyncImagesResource) -> None:
|
|
772
|
+
self._images = images
|
|
773
|
+
|
|
774
|
+
self.list = async_to_streamed_response_wrapper(
|
|
775
|
+
images.list,
|
|
776
|
+
)
|
|
777
|
+
self.delete = async_to_streamed_response_wrapper(
|
|
778
|
+
images.delete,
|
|
779
|
+
)
|
|
780
|
+
self.get = async_to_streamed_response_wrapper(
|
|
781
|
+
images.get,
|
|
782
|
+
)
|
|
783
|
+
self.upload = async_to_streamed_response_wrapper(
|
|
784
|
+
images.upload,
|
|
785
|
+
)
|