gcore 0.1.0a1__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 +84 -0
- gcore/_base_client.py +1943 -0
- gcore/_client.py +484 -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 +62 -0
- gcore/_utils/_reflection.py +42 -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 +19 -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 +808 -0
- gcore/resources/cloud/billing_reservations.py +362 -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 +1143 -0
- gcore/resources/cloud/gpu_baremetal_clusters/images.py +581 -0
- gcore/resources/cloud/gpu_baremetal_clusters/interfaces.py +175 -0
- gcore/resources/cloud/gpu_baremetal_clusters/servers.py +1098 -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 +1187 -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 +987 -0
- gcore/resources/cloud/instances/instances.py +2349 -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 +738 -0
- gcore/resources/cloud/load_balancers/l7_policies/rules.py +722 -0
- gcore/resources/cloud/load_balancers/listeners.py +788 -0
- gcore/resources/cloud/load_balancers/load_balancers.py +1237 -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 +872 -0
- gcore/resources/cloud/load_balancers/statuses.py +260 -0
- gcore/resources/cloud/networks/__init__.py +47 -0
- gcore/resources/cloud/networks/networks.py +715 -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 +699 -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/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 +54 -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 +135 -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 +34 -0
- gcore/types/cloud/network_details.py +79 -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 +36 -0
- gcore/types/cloud/network_update_params.py +16 -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-0.1.0a1.dist-info/METADATA +485 -0
- gcore-0.1.0a1.dist-info/RECORD +420 -0
- gcore-0.1.0a1.dist-info/WHEEL +4 -0
- gcore-0.1.0a1.dist-info/licenses/LICENSE +201 -0
|
@@ -0,0 +1,987 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from typing import List, 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.image import Image
|
|
22
|
+
from ....types.cloud.instances import (
|
|
23
|
+
image_get_params,
|
|
24
|
+
image_list_params,
|
|
25
|
+
image_update_params,
|
|
26
|
+
image_upload_params,
|
|
27
|
+
image_create_from_volume_params,
|
|
28
|
+
)
|
|
29
|
+
from ....types.cloud.image_list import ImageList
|
|
30
|
+
from ....types.cloud.task_id_list import TaskIDList
|
|
31
|
+
from ....types.cloud.tag_update_map_param import TagUpdateMapParam
|
|
32
|
+
|
|
33
|
+
__all__ = ["ImagesResource", "AsyncImagesResource"]
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
class ImagesResource(SyncAPIResource):
|
|
37
|
+
@cached_property
|
|
38
|
+
def with_raw_response(self) -> ImagesResourceWithRawResponse:
|
|
39
|
+
"""
|
|
40
|
+
This property can be used as a prefix for any HTTP method call to return
|
|
41
|
+
the raw response object instead of the parsed content.
|
|
42
|
+
|
|
43
|
+
For more information, see https://www.github.com/G-Core/gcore-python#accessing-raw-response-data-eg-headers
|
|
44
|
+
"""
|
|
45
|
+
return ImagesResourceWithRawResponse(self)
|
|
46
|
+
|
|
47
|
+
@cached_property
|
|
48
|
+
def with_streaming_response(self) -> ImagesResourceWithStreamingResponse:
|
|
49
|
+
"""
|
|
50
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
51
|
+
|
|
52
|
+
For more information, see https://www.github.com/G-Core/gcore-python#with_streaming_response
|
|
53
|
+
"""
|
|
54
|
+
return ImagesResourceWithStreamingResponse(self)
|
|
55
|
+
|
|
56
|
+
def update(
|
|
57
|
+
self,
|
|
58
|
+
image_id: str,
|
|
59
|
+
*,
|
|
60
|
+
project_id: int | None = None,
|
|
61
|
+
region_id: int | None = None,
|
|
62
|
+
hw_firmware_type: Literal["bios", "uefi"] | NotGiven = NOT_GIVEN,
|
|
63
|
+
hw_machine_type: Literal["pc", "q35"] | NotGiven = NOT_GIVEN,
|
|
64
|
+
is_baremetal: bool | NotGiven = NOT_GIVEN,
|
|
65
|
+
name: str | NotGiven = NOT_GIVEN,
|
|
66
|
+
os_type: Literal["linux", "windows"] | NotGiven = NOT_GIVEN,
|
|
67
|
+
ssh_key: Literal["allow", "deny", "required"] | NotGiven = NOT_GIVEN,
|
|
68
|
+
tags: TagUpdateMapParam | NotGiven = NOT_GIVEN,
|
|
69
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
70
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
71
|
+
extra_headers: Headers | None = None,
|
|
72
|
+
extra_query: Query | None = None,
|
|
73
|
+
extra_body: Body | None = None,
|
|
74
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
75
|
+
) -> Image:
|
|
76
|
+
"""
|
|
77
|
+
Update image fields
|
|
78
|
+
|
|
79
|
+
Args:
|
|
80
|
+
hw_firmware_type: Specifies the type of firmware with which to boot the guest.
|
|
81
|
+
|
|
82
|
+
hw_machine_type: A virtual chipset type.
|
|
83
|
+
|
|
84
|
+
is_baremetal: Set to true if the image will be used by bare metal servers.
|
|
85
|
+
|
|
86
|
+
name: Image display name
|
|
87
|
+
|
|
88
|
+
os_type: The operating system installed on the image.
|
|
89
|
+
|
|
90
|
+
ssh_key: Whether the image supports SSH key or not
|
|
91
|
+
|
|
92
|
+
tags: Key-value tags to associate with the resource. A tag is a key-value pair that
|
|
93
|
+
can be associated with a resource, enabling efficient filtering and grouping for
|
|
94
|
+
better organization and management. Some tags are read-only and cannot be
|
|
95
|
+
modified by the user. Tags are also integrated with cost reports, allowing cost
|
|
96
|
+
data to be filtered based on tag keys or values.
|
|
97
|
+
|
|
98
|
+
extra_headers: Send extra headers
|
|
99
|
+
|
|
100
|
+
extra_query: Add additional query parameters to the request
|
|
101
|
+
|
|
102
|
+
extra_body: Add additional JSON properties to the request
|
|
103
|
+
|
|
104
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
105
|
+
"""
|
|
106
|
+
if project_id is None:
|
|
107
|
+
project_id = self._client._get_cloud_project_id_path_param()
|
|
108
|
+
if region_id is None:
|
|
109
|
+
region_id = self._client._get_cloud_region_id_path_param()
|
|
110
|
+
if not image_id:
|
|
111
|
+
raise ValueError(f"Expected a non-empty value for `image_id` but received {image_id!r}")
|
|
112
|
+
return self._patch(
|
|
113
|
+
f"/cloud/v1/images/{project_id}/{region_id}/{image_id}",
|
|
114
|
+
body=maybe_transform(
|
|
115
|
+
{
|
|
116
|
+
"hw_firmware_type": hw_firmware_type,
|
|
117
|
+
"hw_machine_type": hw_machine_type,
|
|
118
|
+
"is_baremetal": is_baremetal,
|
|
119
|
+
"name": name,
|
|
120
|
+
"os_type": os_type,
|
|
121
|
+
"ssh_key": ssh_key,
|
|
122
|
+
"tags": tags,
|
|
123
|
+
},
|
|
124
|
+
image_update_params.ImageUpdateParams,
|
|
125
|
+
),
|
|
126
|
+
options=make_request_options(
|
|
127
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
128
|
+
),
|
|
129
|
+
cast_to=Image,
|
|
130
|
+
)
|
|
131
|
+
|
|
132
|
+
def list(
|
|
133
|
+
self,
|
|
134
|
+
*,
|
|
135
|
+
project_id: int | None = None,
|
|
136
|
+
region_id: int | None = None,
|
|
137
|
+
include_prices: bool | NotGiven = NOT_GIVEN,
|
|
138
|
+
private: str | NotGiven = NOT_GIVEN,
|
|
139
|
+
tag_key: List[str] | NotGiven = NOT_GIVEN,
|
|
140
|
+
tag_key_value: str | NotGiven = NOT_GIVEN,
|
|
141
|
+
visibility: Literal["private", "public", "shared"] | 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
|
+
) -> ImageList:
|
|
149
|
+
"""Retrieve an available images list.
|
|
150
|
+
|
|
151
|
+
Returned entities owned by the project and
|
|
152
|
+
public OR shared with the client
|
|
153
|
+
|
|
154
|
+
Args:
|
|
155
|
+
include_prices: Show price
|
|
156
|
+
|
|
157
|
+
private: Any value to show private images
|
|
158
|
+
|
|
159
|
+
tag_key: Filter by tag keys.
|
|
160
|
+
|
|
161
|
+
tag_key_value: Filter by tag key-value pairs. Must be a valid JSON string. 'curl -G
|
|
162
|
+
--data-urlencode 'tag_key_value={"key": "value"}' --url
|
|
163
|
+
'http://localhost:1111/v1/images/1/1'"
|
|
164
|
+
|
|
165
|
+
visibility: Image visibility. Globally visible images are public
|
|
166
|
+
|
|
167
|
+
extra_headers: Send extra headers
|
|
168
|
+
|
|
169
|
+
extra_query: Add additional query parameters to the request
|
|
170
|
+
|
|
171
|
+
extra_body: Add additional JSON properties to the request
|
|
172
|
+
|
|
173
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
174
|
+
"""
|
|
175
|
+
if project_id is None:
|
|
176
|
+
project_id = self._client._get_cloud_project_id_path_param()
|
|
177
|
+
if region_id is None:
|
|
178
|
+
region_id = self._client._get_cloud_region_id_path_param()
|
|
179
|
+
return self._get(
|
|
180
|
+
f"/cloud/v1/images/{project_id}/{region_id}",
|
|
181
|
+
options=make_request_options(
|
|
182
|
+
extra_headers=extra_headers,
|
|
183
|
+
extra_query=extra_query,
|
|
184
|
+
extra_body=extra_body,
|
|
185
|
+
timeout=timeout,
|
|
186
|
+
query=maybe_transform(
|
|
187
|
+
{
|
|
188
|
+
"include_prices": include_prices,
|
|
189
|
+
"private": private,
|
|
190
|
+
"tag_key": tag_key,
|
|
191
|
+
"tag_key_value": tag_key_value,
|
|
192
|
+
"visibility": visibility,
|
|
193
|
+
},
|
|
194
|
+
image_list_params.ImageListParams,
|
|
195
|
+
),
|
|
196
|
+
),
|
|
197
|
+
cast_to=ImageList,
|
|
198
|
+
)
|
|
199
|
+
|
|
200
|
+
def delete(
|
|
201
|
+
self,
|
|
202
|
+
image_id: str,
|
|
203
|
+
*,
|
|
204
|
+
project_id: int | None = None,
|
|
205
|
+
region_id: int | None = None,
|
|
206
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
207
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
208
|
+
extra_headers: Headers | None = None,
|
|
209
|
+
extra_query: Query | None = None,
|
|
210
|
+
extra_body: Body | None = None,
|
|
211
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
212
|
+
) -> TaskIDList:
|
|
213
|
+
"""
|
|
214
|
+
Delete the image
|
|
215
|
+
|
|
216
|
+
Args:
|
|
217
|
+
extra_headers: Send extra headers
|
|
218
|
+
|
|
219
|
+
extra_query: Add additional query parameters to the request
|
|
220
|
+
|
|
221
|
+
extra_body: Add additional JSON properties to the request
|
|
222
|
+
|
|
223
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
224
|
+
"""
|
|
225
|
+
if project_id is None:
|
|
226
|
+
project_id = self._client._get_cloud_project_id_path_param()
|
|
227
|
+
if region_id is None:
|
|
228
|
+
region_id = self._client._get_cloud_region_id_path_param()
|
|
229
|
+
if not image_id:
|
|
230
|
+
raise ValueError(f"Expected a non-empty value for `image_id` but received {image_id!r}")
|
|
231
|
+
return self._delete(
|
|
232
|
+
f"/cloud/v1/images/{project_id}/{region_id}/{image_id}",
|
|
233
|
+
options=make_request_options(
|
|
234
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
235
|
+
),
|
|
236
|
+
cast_to=TaskIDList,
|
|
237
|
+
)
|
|
238
|
+
|
|
239
|
+
def create_from_volume(
|
|
240
|
+
self,
|
|
241
|
+
*,
|
|
242
|
+
project_id: int | None = None,
|
|
243
|
+
region_id: int | None = None,
|
|
244
|
+
name: str,
|
|
245
|
+
volume_id: str,
|
|
246
|
+
architecture: Literal["aarch64", "x86_64"] | NotGiven = NOT_GIVEN,
|
|
247
|
+
hw_firmware_type: Optional[Literal["bios", "uefi"]] | NotGiven = NOT_GIVEN,
|
|
248
|
+
hw_machine_type: Optional[Literal["pc", "q35"]] | NotGiven = NOT_GIVEN,
|
|
249
|
+
is_baremetal: bool | NotGiven = NOT_GIVEN,
|
|
250
|
+
os_type: Literal["linux", "windows"] | NotGiven = NOT_GIVEN,
|
|
251
|
+
source: Literal["volume"] | NotGiven = NOT_GIVEN,
|
|
252
|
+
ssh_key: Literal["allow", "deny", "required"] | NotGiven = NOT_GIVEN,
|
|
253
|
+
tags: TagUpdateMapParam | NotGiven = NOT_GIVEN,
|
|
254
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
255
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
256
|
+
extra_headers: Headers | None = None,
|
|
257
|
+
extra_query: Query | None = None,
|
|
258
|
+
extra_body: Body | None = None,
|
|
259
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
260
|
+
) -> TaskIDList:
|
|
261
|
+
"""
|
|
262
|
+
Create image from volume
|
|
263
|
+
|
|
264
|
+
Args:
|
|
265
|
+
name: Image name
|
|
266
|
+
|
|
267
|
+
volume_id: Required if source is volume. Volume id
|
|
268
|
+
|
|
269
|
+
architecture: Image CPU architecture type: `aarch64`, `x86_64`
|
|
270
|
+
|
|
271
|
+
hw_firmware_type: Specifies the type of firmware with which to boot the guest.
|
|
272
|
+
|
|
273
|
+
hw_machine_type: A virtual chipset type.
|
|
274
|
+
|
|
275
|
+
is_baremetal: Set to true if the image will be used by bare metal servers. Defaults to false.
|
|
276
|
+
|
|
277
|
+
os_type: The operating system installed on the image.
|
|
278
|
+
|
|
279
|
+
source: Image source
|
|
280
|
+
|
|
281
|
+
ssh_key: Whether the image supports SSH key or not
|
|
282
|
+
|
|
283
|
+
tags: Key-value tags to associate with the resource. A tag is a key-value pair that
|
|
284
|
+
can be associated with a resource, enabling efficient filtering and grouping for
|
|
285
|
+
better organization and management. Some tags are read-only and cannot be
|
|
286
|
+
modified by the user. Tags are also integrated with cost reports, allowing cost
|
|
287
|
+
data to be filtered based on tag keys or values.
|
|
288
|
+
|
|
289
|
+
extra_headers: Send extra headers
|
|
290
|
+
|
|
291
|
+
extra_query: Add additional query parameters to the request
|
|
292
|
+
|
|
293
|
+
extra_body: Add additional JSON properties to the request
|
|
294
|
+
|
|
295
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
296
|
+
"""
|
|
297
|
+
if project_id is None:
|
|
298
|
+
project_id = self._client._get_cloud_project_id_path_param()
|
|
299
|
+
if region_id is None:
|
|
300
|
+
region_id = self._client._get_cloud_region_id_path_param()
|
|
301
|
+
return self._post(
|
|
302
|
+
f"/cloud/v1/images/{project_id}/{region_id}",
|
|
303
|
+
body=maybe_transform(
|
|
304
|
+
{
|
|
305
|
+
"name": name,
|
|
306
|
+
"volume_id": volume_id,
|
|
307
|
+
"architecture": architecture,
|
|
308
|
+
"hw_firmware_type": hw_firmware_type,
|
|
309
|
+
"hw_machine_type": hw_machine_type,
|
|
310
|
+
"is_baremetal": is_baremetal,
|
|
311
|
+
"os_type": os_type,
|
|
312
|
+
"source": source,
|
|
313
|
+
"ssh_key": ssh_key,
|
|
314
|
+
"tags": tags,
|
|
315
|
+
},
|
|
316
|
+
image_create_from_volume_params.ImageCreateFromVolumeParams,
|
|
317
|
+
),
|
|
318
|
+
options=make_request_options(
|
|
319
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
320
|
+
),
|
|
321
|
+
cast_to=TaskIDList,
|
|
322
|
+
)
|
|
323
|
+
|
|
324
|
+
def get(
|
|
325
|
+
self,
|
|
326
|
+
image_id: str,
|
|
327
|
+
*,
|
|
328
|
+
project_id: int | None = None,
|
|
329
|
+
region_id: int | None = None,
|
|
330
|
+
include_prices: bool | NotGiven = NOT_GIVEN,
|
|
331
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
332
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
333
|
+
extra_headers: Headers | None = None,
|
|
334
|
+
extra_query: Query | None = None,
|
|
335
|
+
extra_body: Body | None = None,
|
|
336
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
337
|
+
) -> Image:
|
|
338
|
+
"""
|
|
339
|
+
Get image
|
|
340
|
+
|
|
341
|
+
Args:
|
|
342
|
+
include_prices: Show price
|
|
343
|
+
|
|
344
|
+
extra_headers: Send extra headers
|
|
345
|
+
|
|
346
|
+
extra_query: Add additional query parameters to the request
|
|
347
|
+
|
|
348
|
+
extra_body: Add additional JSON properties to the request
|
|
349
|
+
|
|
350
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
351
|
+
"""
|
|
352
|
+
if project_id is None:
|
|
353
|
+
project_id = self._client._get_cloud_project_id_path_param()
|
|
354
|
+
if region_id is None:
|
|
355
|
+
region_id = self._client._get_cloud_region_id_path_param()
|
|
356
|
+
if not image_id:
|
|
357
|
+
raise ValueError(f"Expected a non-empty value for `image_id` but received {image_id!r}")
|
|
358
|
+
return self._get(
|
|
359
|
+
f"/cloud/v1/images/{project_id}/{region_id}/{image_id}",
|
|
360
|
+
options=make_request_options(
|
|
361
|
+
extra_headers=extra_headers,
|
|
362
|
+
extra_query=extra_query,
|
|
363
|
+
extra_body=extra_body,
|
|
364
|
+
timeout=timeout,
|
|
365
|
+
query=maybe_transform({"include_prices": include_prices}, image_get_params.ImageGetParams),
|
|
366
|
+
),
|
|
367
|
+
cast_to=Image,
|
|
368
|
+
)
|
|
369
|
+
|
|
370
|
+
def upload(
|
|
371
|
+
self,
|
|
372
|
+
*,
|
|
373
|
+
project_id: int | None = None,
|
|
374
|
+
region_id: int | None = None,
|
|
375
|
+
name: str,
|
|
376
|
+
url: str,
|
|
377
|
+
architecture: Literal["aarch64", "x86_64"] | NotGiven = NOT_GIVEN,
|
|
378
|
+
cow_format: bool | NotGiven = NOT_GIVEN,
|
|
379
|
+
hw_firmware_type: Optional[Literal["bios", "uefi"]] | NotGiven = NOT_GIVEN,
|
|
380
|
+
hw_machine_type: Optional[Literal["pc", "q35"]] | NotGiven = NOT_GIVEN,
|
|
381
|
+
is_baremetal: bool | NotGiven = NOT_GIVEN,
|
|
382
|
+
os_distro: Optional[str] | NotGiven = NOT_GIVEN,
|
|
383
|
+
os_type: Literal["linux", "windows"] | NotGiven = NOT_GIVEN,
|
|
384
|
+
os_version: Optional[str] | NotGiven = NOT_GIVEN,
|
|
385
|
+
ssh_key: Literal["allow", "deny", "required"] | NotGiven = NOT_GIVEN,
|
|
386
|
+
tags: TagUpdateMapParam | NotGiven = NOT_GIVEN,
|
|
387
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
388
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
389
|
+
extra_headers: Headers | None = None,
|
|
390
|
+
extra_query: Query | None = None,
|
|
391
|
+
extra_body: Body | None = None,
|
|
392
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
393
|
+
) -> TaskIDList:
|
|
394
|
+
"""
|
|
395
|
+
Upload image
|
|
396
|
+
|
|
397
|
+
Args:
|
|
398
|
+
name: Image name
|
|
399
|
+
|
|
400
|
+
url: URL
|
|
401
|
+
|
|
402
|
+
architecture: Image CPU architecture type: `aarch64`, `x86_64`
|
|
403
|
+
|
|
404
|
+
cow_format: When True, image cannot be deleted unless all volumes, created from it, are
|
|
405
|
+
deleted.
|
|
406
|
+
|
|
407
|
+
hw_firmware_type: Specifies the type of firmware with which to boot the guest.
|
|
408
|
+
|
|
409
|
+
hw_machine_type: A virtual chipset type.
|
|
410
|
+
|
|
411
|
+
is_baremetal: Set to true if the image will be used by bare metal servers. Defaults to false.
|
|
412
|
+
|
|
413
|
+
os_distro: OS Distribution, i.e. Debian, CentOS, Ubuntu, CoreOS etc.
|
|
414
|
+
|
|
415
|
+
os_type: The operating system installed on the image.
|
|
416
|
+
|
|
417
|
+
os_version: OS version, i.e. 22.04 (for Ubuntu) or 9.4 for Debian
|
|
418
|
+
|
|
419
|
+
ssh_key: Whether the image supports SSH key or not
|
|
420
|
+
|
|
421
|
+
tags: Key-value tags to associate with the resource. A tag is a key-value pair that
|
|
422
|
+
can be associated with a resource, enabling efficient filtering and grouping for
|
|
423
|
+
better organization and management. Some tags are read-only and cannot be
|
|
424
|
+
modified by the user. Tags are also integrated with cost reports, allowing cost
|
|
425
|
+
data to be filtered based on tag keys or values.
|
|
426
|
+
|
|
427
|
+
extra_headers: Send extra headers
|
|
428
|
+
|
|
429
|
+
extra_query: Add additional query parameters to the request
|
|
430
|
+
|
|
431
|
+
extra_body: Add additional JSON properties to the request
|
|
432
|
+
|
|
433
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
434
|
+
"""
|
|
435
|
+
if project_id is None:
|
|
436
|
+
project_id = self._client._get_cloud_project_id_path_param()
|
|
437
|
+
if region_id is None:
|
|
438
|
+
region_id = self._client._get_cloud_region_id_path_param()
|
|
439
|
+
return self._post(
|
|
440
|
+
f"/cloud/v1/downloadimage/{project_id}/{region_id}",
|
|
441
|
+
body=maybe_transform(
|
|
442
|
+
{
|
|
443
|
+
"name": name,
|
|
444
|
+
"url": url,
|
|
445
|
+
"architecture": architecture,
|
|
446
|
+
"cow_format": cow_format,
|
|
447
|
+
"hw_firmware_type": hw_firmware_type,
|
|
448
|
+
"hw_machine_type": hw_machine_type,
|
|
449
|
+
"is_baremetal": is_baremetal,
|
|
450
|
+
"os_distro": os_distro,
|
|
451
|
+
"os_type": os_type,
|
|
452
|
+
"os_version": os_version,
|
|
453
|
+
"ssh_key": ssh_key,
|
|
454
|
+
"tags": tags,
|
|
455
|
+
},
|
|
456
|
+
image_upload_params.ImageUploadParams,
|
|
457
|
+
),
|
|
458
|
+
options=make_request_options(
|
|
459
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
460
|
+
),
|
|
461
|
+
cast_to=TaskIDList,
|
|
462
|
+
)
|
|
463
|
+
|
|
464
|
+
|
|
465
|
+
class AsyncImagesResource(AsyncAPIResource):
|
|
466
|
+
@cached_property
|
|
467
|
+
def with_raw_response(self) -> AsyncImagesResourceWithRawResponse:
|
|
468
|
+
"""
|
|
469
|
+
This property can be used as a prefix for any HTTP method call to return
|
|
470
|
+
the raw response object instead of the parsed content.
|
|
471
|
+
|
|
472
|
+
For more information, see https://www.github.com/G-Core/gcore-python#accessing-raw-response-data-eg-headers
|
|
473
|
+
"""
|
|
474
|
+
return AsyncImagesResourceWithRawResponse(self)
|
|
475
|
+
|
|
476
|
+
@cached_property
|
|
477
|
+
def with_streaming_response(self) -> AsyncImagesResourceWithStreamingResponse:
|
|
478
|
+
"""
|
|
479
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
480
|
+
|
|
481
|
+
For more information, see https://www.github.com/G-Core/gcore-python#with_streaming_response
|
|
482
|
+
"""
|
|
483
|
+
return AsyncImagesResourceWithStreamingResponse(self)
|
|
484
|
+
|
|
485
|
+
async def update(
|
|
486
|
+
self,
|
|
487
|
+
image_id: str,
|
|
488
|
+
*,
|
|
489
|
+
project_id: int | None = None,
|
|
490
|
+
region_id: int | None = None,
|
|
491
|
+
hw_firmware_type: Literal["bios", "uefi"] | NotGiven = NOT_GIVEN,
|
|
492
|
+
hw_machine_type: Literal["pc", "q35"] | NotGiven = NOT_GIVEN,
|
|
493
|
+
is_baremetal: bool | NotGiven = NOT_GIVEN,
|
|
494
|
+
name: str | NotGiven = NOT_GIVEN,
|
|
495
|
+
os_type: Literal["linux", "windows"] | NotGiven = NOT_GIVEN,
|
|
496
|
+
ssh_key: Literal["allow", "deny", "required"] | NotGiven = NOT_GIVEN,
|
|
497
|
+
tags: TagUpdateMapParam | NotGiven = NOT_GIVEN,
|
|
498
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
499
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
500
|
+
extra_headers: Headers | None = None,
|
|
501
|
+
extra_query: Query | None = None,
|
|
502
|
+
extra_body: Body | None = None,
|
|
503
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
504
|
+
) -> Image:
|
|
505
|
+
"""
|
|
506
|
+
Update image fields
|
|
507
|
+
|
|
508
|
+
Args:
|
|
509
|
+
hw_firmware_type: Specifies the type of firmware with which to boot the guest.
|
|
510
|
+
|
|
511
|
+
hw_machine_type: A virtual chipset type.
|
|
512
|
+
|
|
513
|
+
is_baremetal: Set to true if the image will be used by bare metal servers.
|
|
514
|
+
|
|
515
|
+
name: Image display name
|
|
516
|
+
|
|
517
|
+
os_type: The operating system installed on the image.
|
|
518
|
+
|
|
519
|
+
ssh_key: Whether the image supports SSH key or not
|
|
520
|
+
|
|
521
|
+
tags: Key-value tags to associate with the resource. A tag is a key-value pair that
|
|
522
|
+
can be associated with a resource, enabling efficient filtering and grouping for
|
|
523
|
+
better organization and management. Some tags are read-only and cannot be
|
|
524
|
+
modified by the user. Tags are also integrated with cost reports, allowing cost
|
|
525
|
+
data to be filtered based on tag keys or values.
|
|
526
|
+
|
|
527
|
+
extra_headers: Send extra headers
|
|
528
|
+
|
|
529
|
+
extra_query: Add additional query parameters to the request
|
|
530
|
+
|
|
531
|
+
extra_body: Add additional JSON properties to the request
|
|
532
|
+
|
|
533
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
534
|
+
"""
|
|
535
|
+
if project_id is None:
|
|
536
|
+
project_id = self._client._get_cloud_project_id_path_param()
|
|
537
|
+
if region_id is None:
|
|
538
|
+
region_id = self._client._get_cloud_region_id_path_param()
|
|
539
|
+
if not image_id:
|
|
540
|
+
raise ValueError(f"Expected a non-empty value for `image_id` but received {image_id!r}")
|
|
541
|
+
return await self._patch(
|
|
542
|
+
f"/cloud/v1/images/{project_id}/{region_id}/{image_id}",
|
|
543
|
+
body=await async_maybe_transform(
|
|
544
|
+
{
|
|
545
|
+
"hw_firmware_type": hw_firmware_type,
|
|
546
|
+
"hw_machine_type": hw_machine_type,
|
|
547
|
+
"is_baremetal": is_baremetal,
|
|
548
|
+
"name": name,
|
|
549
|
+
"os_type": os_type,
|
|
550
|
+
"ssh_key": ssh_key,
|
|
551
|
+
"tags": tags,
|
|
552
|
+
},
|
|
553
|
+
image_update_params.ImageUpdateParams,
|
|
554
|
+
),
|
|
555
|
+
options=make_request_options(
|
|
556
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
557
|
+
),
|
|
558
|
+
cast_to=Image,
|
|
559
|
+
)
|
|
560
|
+
|
|
561
|
+
async def list(
|
|
562
|
+
self,
|
|
563
|
+
*,
|
|
564
|
+
project_id: int | None = None,
|
|
565
|
+
region_id: int | None = None,
|
|
566
|
+
include_prices: bool | NotGiven = NOT_GIVEN,
|
|
567
|
+
private: str | NotGiven = NOT_GIVEN,
|
|
568
|
+
tag_key: List[str] | NotGiven = NOT_GIVEN,
|
|
569
|
+
tag_key_value: str | NotGiven = NOT_GIVEN,
|
|
570
|
+
visibility: Literal["private", "public", "shared"] | NotGiven = NOT_GIVEN,
|
|
571
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
572
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
573
|
+
extra_headers: Headers | None = None,
|
|
574
|
+
extra_query: Query | None = None,
|
|
575
|
+
extra_body: Body | None = None,
|
|
576
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
577
|
+
) -> ImageList:
|
|
578
|
+
"""Retrieve an available images list.
|
|
579
|
+
|
|
580
|
+
Returned entities owned by the project and
|
|
581
|
+
public OR shared with the client
|
|
582
|
+
|
|
583
|
+
Args:
|
|
584
|
+
include_prices: Show price
|
|
585
|
+
|
|
586
|
+
private: Any value to show private images
|
|
587
|
+
|
|
588
|
+
tag_key: Filter by tag keys.
|
|
589
|
+
|
|
590
|
+
tag_key_value: Filter by tag key-value pairs. Must be a valid JSON string. 'curl -G
|
|
591
|
+
--data-urlencode 'tag_key_value={"key": "value"}' --url
|
|
592
|
+
'http://localhost:1111/v1/images/1/1'"
|
|
593
|
+
|
|
594
|
+
visibility: Image visibility. Globally visible images are public
|
|
595
|
+
|
|
596
|
+
extra_headers: Send extra headers
|
|
597
|
+
|
|
598
|
+
extra_query: Add additional query parameters to the request
|
|
599
|
+
|
|
600
|
+
extra_body: Add additional JSON properties to the request
|
|
601
|
+
|
|
602
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
603
|
+
"""
|
|
604
|
+
if project_id is None:
|
|
605
|
+
project_id = self._client._get_cloud_project_id_path_param()
|
|
606
|
+
if region_id is None:
|
|
607
|
+
region_id = self._client._get_cloud_region_id_path_param()
|
|
608
|
+
return await self._get(
|
|
609
|
+
f"/cloud/v1/images/{project_id}/{region_id}",
|
|
610
|
+
options=make_request_options(
|
|
611
|
+
extra_headers=extra_headers,
|
|
612
|
+
extra_query=extra_query,
|
|
613
|
+
extra_body=extra_body,
|
|
614
|
+
timeout=timeout,
|
|
615
|
+
query=await async_maybe_transform(
|
|
616
|
+
{
|
|
617
|
+
"include_prices": include_prices,
|
|
618
|
+
"private": private,
|
|
619
|
+
"tag_key": tag_key,
|
|
620
|
+
"tag_key_value": tag_key_value,
|
|
621
|
+
"visibility": visibility,
|
|
622
|
+
},
|
|
623
|
+
image_list_params.ImageListParams,
|
|
624
|
+
),
|
|
625
|
+
),
|
|
626
|
+
cast_to=ImageList,
|
|
627
|
+
)
|
|
628
|
+
|
|
629
|
+
async def delete(
|
|
630
|
+
self,
|
|
631
|
+
image_id: str,
|
|
632
|
+
*,
|
|
633
|
+
project_id: int | None = None,
|
|
634
|
+
region_id: int | None = None,
|
|
635
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
636
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
637
|
+
extra_headers: Headers | None = None,
|
|
638
|
+
extra_query: Query | None = None,
|
|
639
|
+
extra_body: Body | None = None,
|
|
640
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
641
|
+
) -> TaskIDList:
|
|
642
|
+
"""
|
|
643
|
+
Delete the image
|
|
644
|
+
|
|
645
|
+
Args:
|
|
646
|
+
extra_headers: Send extra headers
|
|
647
|
+
|
|
648
|
+
extra_query: Add additional query parameters to the request
|
|
649
|
+
|
|
650
|
+
extra_body: Add additional JSON properties to the request
|
|
651
|
+
|
|
652
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
653
|
+
"""
|
|
654
|
+
if project_id is None:
|
|
655
|
+
project_id = self._client._get_cloud_project_id_path_param()
|
|
656
|
+
if region_id is None:
|
|
657
|
+
region_id = self._client._get_cloud_region_id_path_param()
|
|
658
|
+
if not image_id:
|
|
659
|
+
raise ValueError(f"Expected a non-empty value for `image_id` but received {image_id!r}")
|
|
660
|
+
return await self._delete(
|
|
661
|
+
f"/cloud/v1/images/{project_id}/{region_id}/{image_id}",
|
|
662
|
+
options=make_request_options(
|
|
663
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
664
|
+
),
|
|
665
|
+
cast_to=TaskIDList,
|
|
666
|
+
)
|
|
667
|
+
|
|
668
|
+
async def create_from_volume(
|
|
669
|
+
self,
|
|
670
|
+
*,
|
|
671
|
+
project_id: int | None = None,
|
|
672
|
+
region_id: int | None = None,
|
|
673
|
+
name: str,
|
|
674
|
+
volume_id: str,
|
|
675
|
+
architecture: Literal["aarch64", "x86_64"] | NotGiven = NOT_GIVEN,
|
|
676
|
+
hw_firmware_type: Optional[Literal["bios", "uefi"]] | NotGiven = NOT_GIVEN,
|
|
677
|
+
hw_machine_type: Optional[Literal["pc", "q35"]] | NotGiven = NOT_GIVEN,
|
|
678
|
+
is_baremetal: bool | NotGiven = NOT_GIVEN,
|
|
679
|
+
os_type: Literal["linux", "windows"] | NotGiven = NOT_GIVEN,
|
|
680
|
+
source: Literal["volume"] | NotGiven = NOT_GIVEN,
|
|
681
|
+
ssh_key: Literal["allow", "deny", "required"] | NotGiven = NOT_GIVEN,
|
|
682
|
+
tags: TagUpdateMapParam | NotGiven = NOT_GIVEN,
|
|
683
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
684
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
685
|
+
extra_headers: Headers | None = None,
|
|
686
|
+
extra_query: Query | None = None,
|
|
687
|
+
extra_body: Body | None = None,
|
|
688
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
689
|
+
) -> TaskIDList:
|
|
690
|
+
"""
|
|
691
|
+
Create image from volume
|
|
692
|
+
|
|
693
|
+
Args:
|
|
694
|
+
name: Image name
|
|
695
|
+
|
|
696
|
+
volume_id: Required if source is volume. Volume id
|
|
697
|
+
|
|
698
|
+
architecture: Image CPU architecture type: `aarch64`, `x86_64`
|
|
699
|
+
|
|
700
|
+
hw_firmware_type: Specifies the type of firmware with which to boot the guest.
|
|
701
|
+
|
|
702
|
+
hw_machine_type: A virtual chipset type.
|
|
703
|
+
|
|
704
|
+
is_baremetal: Set to true if the image will be used by bare metal servers. Defaults to false.
|
|
705
|
+
|
|
706
|
+
os_type: The operating system installed on the image.
|
|
707
|
+
|
|
708
|
+
source: Image source
|
|
709
|
+
|
|
710
|
+
ssh_key: Whether the image supports SSH key or not
|
|
711
|
+
|
|
712
|
+
tags: Key-value tags to associate with the resource. A tag is a key-value pair that
|
|
713
|
+
can be associated with a resource, enabling efficient filtering and grouping for
|
|
714
|
+
better organization and management. Some tags are read-only and cannot be
|
|
715
|
+
modified by the user. Tags are also integrated with cost reports, allowing cost
|
|
716
|
+
data to be filtered based on tag keys or values.
|
|
717
|
+
|
|
718
|
+
extra_headers: Send extra headers
|
|
719
|
+
|
|
720
|
+
extra_query: Add additional query parameters to the request
|
|
721
|
+
|
|
722
|
+
extra_body: Add additional JSON properties to the request
|
|
723
|
+
|
|
724
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
725
|
+
"""
|
|
726
|
+
if project_id is None:
|
|
727
|
+
project_id = self._client._get_cloud_project_id_path_param()
|
|
728
|
+
if region_id is None:
|
|
729
|
+
region_id = self._client._get_cloud_region_id_path_param()
|
|
730
|
+
return await self._post(
|
|
731
|
+
f"/cloud/v1/images/{project_id}/{region_id}",
|
|
732
|
+
body=await async_maybe_transform(
|
|
733
|
+
{
|
|
734
|
+
"name": name,
|
|
735
|
+
"volume_id": volume_id,
|
|
736
|
+
"architecture": architecture,
|
|
737
|
+
"hw_firmware_type": hw_firmware_type,
|
|
738
|
+
"hw_machine_type": hw_machine_type,
|
|
739
|
+
"is_baremetal": is_baremetal,
|
|
740
|
+
"os_type": os_type,
|
|
741
|
+
"source": source,
|
|
742
|
+
"ssh_key": ssh_key,
|
|
743
|
+
"tags": tags,
|
|
744
|
+
},
|
|
745
|
+
image_create_from_volume_params.ImageCreateFromVolumeParams,
|
|
746
|
+
),
|
|
747
|
+
options=make_request_options(
|
|
748
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
749
|
+
),
|
|
750
|
+
cast_to=TaskIDList,
|
|
751
|
+
)
|
|
752
|
+
|
|
753
|
+
async def get(
|
|
754
|
+
self,
|
|
755
|
+
image_id: str,
|
|
756
|
+
*,
|
|
757
|
+
project_id: int | None = None,
|
|
758
|
+
region_id: int | None = None,
|
|
759
|
+
include_prices: bool | NotGiven = NOT_GIVEN,
|
|
760
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
761
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
762
|
+
extra_headers: Headers | None = None,
|
|
763
|
+
extra_query: Query | None = None,
|
|
764
|
+
extra_body: Body | None = None,
|
|
765
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
766
|
+
) -> Image:
|
|
767
|
+
"""
|
|
768
|
+
Get image
|
|
769
|
+
|
|
770
|
+
Args:
|
|
771
|
+
include_prices: Show price
|
|
772
|
+
|
|
773
|
+
extra_headers: Send extra headers
|
|
774
|
+
|
|
775
|
+
extra_query: Add additional query parameters to the request
|
|
776
|
+
|
|
777
|
+
extra_body: Add additional JSON properties to the request
|
|
778
|
+
|
|
779
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
780
|
+
"""
|
|
781
|
+
if project_id is None:
|
|
782
|
+
project_id = self._client._get_cloud_project_id_path_param()
|
|
783
|
+
if region_id is None:
|
|
784
|
+
region_id = self._client._get_cloud_region_id_path_param()
|
|
785
|
+
if not image_id:
|
|
786
|
+
raise ValueError(f"Expected a non-empty value for `image_id` but received {image_id!r}")
|
|
787
|
+
return await self._get(
|
|
788
|
+
f"/cloud/v1/images/{project_id}/{region_id}/{image_id}",
|
|
789
|
+
options=make_request_options(
|
|
790
|
+
extra_headers=extra_headers,
|
|
791
|
+
extra_query=extra_query,
|
|
792
|
+
extra_body=extra_body,
|
|
793
|
+
timeout=timeout,
|
|
794
|
+
query=await async_maybe_transform({"include_prices": include_prices}, image_get_params.ImageGetParams),
|
|
795
|
+
),
|
|
796
|
+
cast_to=Image,
|
|
797
|
+
)
|
|
798
|
+
|
|
799
|
+
async def upload(
|
|
800
|
+
self,
|
|
801
|
+
*,
|
|
802
|
+
project_id: int | None = None,
|
|
803
|
+
region_id: int | None = None,
|
|
804
|
+
name: str,
|
|
805
|
+
url: str,
|
|
806
|
+
architecture: Literal["aarch64", "x86_64"] | NotGiven = NOT_GIVEN,
|
|
807
|
+
cow_format: bool | NotGiven = NOT_GIVEN,
|
|
808
|
+
hw_firmware_type: Optional[Literal["bios", "uefi"]] | NotGiven = NOT_GIVEN,
|
|
809
|
+
hw_machine_type: Optional[Literal["pc", "q35"]] | NotGiven = NOT_GIVEN,
|
|
810
|
+
is_baremetal: bool | NotGiven = NOT_GIVEN,
|
|
811
|
+
os_distro: Optional[str] | NotGiven = NOT_GIVEN,
|
|
812
|
+
os_type: Literal["linux", "windows"] | NotGiven = NOT_GIVEN,
|
|
813
|
+
os_version: Optional[str] | NotGiven = NOT_GIVEN,
|
|
814
|
+
ssh_key: Literal["allow", "deny", "required"] | NotGiven = NOT_GIVEN,
|
|
815
|
+
tags: TagUpdateMapParam | NotGiven = NOT_GIVEN,
|
|
816
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
817
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
818
|
+
extra_headers: Headers | None = None,
|
|
819
|
+
extra_query: Query | None = None,
|
|
820
|
+
extra_body: Body | None = None,
|
|
821
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
822
|
+
) -> TaskIDList:
|
|
823
|
+
"""
|
|
824
|
+
Upload image
|
|
825
|
+
|
|
826
|
+
Args:
|
|
827
|
+
name: Image name
|
|
828
|
+
|
|
829
|
+
url: URL
|
|
830
|
+
|
|
831
|
+
architecture: Image CPU architecture type: `aarch64`, `x86_64`
|
|
832
|
+
|
|
833
|
+
cow_format: When True, image cannot be deleted unless all volumes, created from it, are
|
|
834
|
+
deleted.
|
|
835
|
+
|
|
836
|
+
hw_firmware_type: Specifies the type of firmware with which to boot the guest.
|
|
837
|
+
|
|
838
|
+
hw_machine_type: A virtual chipset type.
|
|
839
|
+
|
|
840
|
+
is_baremetal: Set to true if the image will be used by bare metal servers. Defaults to false.
|
|
841
|
+
|
|
842
|
+
os_distro: OS Distribution, i.e. Debian, CentOS, Ubuntu, CoreOS etc.
|
|
843
|
+
|
|
844
|
+
os_type: The operating system installed on the image.
|
|
845
|
+
|
|
846
|
+
os_version: OS version, i.e. 22.04 (for Ubuntu) or 9.4 for Debian
|
|
847
|
+
|
|
848
|
+
ssh_key: Whether the image supports SSH key or not
|
|
849
|
+
|
|
850
|
+
tags: Key-value tags to associate with the resource. A tag is a key-value pair that
|
|
851
|
+
can be associated with a resource, enabling efficient filtering and grouping for
|
|
852
|
+
better organization and management. Some tags are read-only and cannot be
|
|
853
|
+
modified by the user. Tags are also integrated with cost reports, allowing cost
|
|
854
|
+
data to be filtered based on tag keys or values.
|
|
855
|
+
|
|
856
|
+
extra_headers: Send extra headers
|
|
857
|
+
|
|
858
|
+
extra_query: Add additional query parameters to the request
|
|
859
|
+
|
|
860
|
+
extra_body: Add additional JSON properties to the request
|
|
861
|
+
|
|
862
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
863
|
+
"""
|
|
864
|
+
if project_id is None:
|
|
865
|
+
project_id = self._client._get_cloud_project_id_path_param()
|
|
866
|
+
if region_id is None:
|
|
867
|
+
region_id = self._client._get_cloud_region_id_path_param()
|
|
868
|
+
return await self._post(
|
|
869
|
+
f"/cloud/v1/downloadimage/{project_id}/{region_id}",
|
|
870
|
+
body=await async_maybe_transform(
|
|
871
|
+
{
|
|
872
|
+
"name": name,
|
|
873
|
+
"url": url,
|
|
874
|
+
"architecture": architecture,
|
|
875
|
+
"cow_format": cow_format,
|
|
876
|
+
"hw_firmware_type": hw_firmware_type,
|
|
877
|
+
"hw_machine_type": hw_machine_type,
|
|
878
|
+
"is_baremetal": is_baremetal,
|
|
879
|
+
"os_distro": os_distro,
|
|
880
|
+
"os_type": os_type,
|
|
881
|
+
"os_version": os_version,
|
|
882
|
+
"ssh_key": ssh_key,
|
|
883
|
+
"tags": tags,
|
|
884
|
+
},
|
|
885
|
+
image_upload_params.ImageUploadParams,
|
|
886
|
+
),
|
|
887
|
+
options=make_request_options(
|
|
888
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
889
|
+
),
|
|
890
|
+
cast_to=TaskIDList,
|
|
891
|
+
)
|
|
892
|
+
|
|
893
|
+
|
|
894
|
+
class ImagesResourceWithRawResponse:
|
|
895
|
+
def __init__(self, images: ImagesResource) -> None:
|
|
896
|
+
self._images = images
|
|
897
|
+
|
|
898
|
+
self.update = to_raw_response_wrapper(
|
|
899
|
+
images.update,
|
|
900
|
+
)
|
|
901
|
+
self.list = to_raw_response_wrapper(
|
|
902
|
+
images.list,
|
|
903
|
+
)
|
|
904
|
+
self.delete = to_raw_response_wrapper(
|
|
905
|
+
images.delete,
|
|
906
|
+
)
|
|
907
|
+
self.create_from_volume = to_raw_response_wrapper(
|
|
908
|
+
images.create_from_volume,
|
|
909
|
+
)
|
|
910
|
+
self.get = to_raw_response_wrapper(
|
|
911
|
+
images.get,
|
|
912
|
+
)
|
|
913
|
+
self.upload = to_raw_response_wrapper(
|
|
914
|
+
images.upload,
|
|
915
|
+
)
|
|
916
|
+
|
|
917
|
+
|
|
918
|
+
class AsyncImagesResourceWithRawResponse:
|
|
919
|
+
def __init__(self, images: AsyncImagesResource) -> None:
|
|
920
|
+
self._images = images
|
|
921
|
+
|
|
922
|
+
self.update = async_to_raw_response_wrapper(
|
|
923
|
+
images.update,
|
|
924
|
+
)
|
|
925
|
+
self.list = async_to_raw_response_wrapper(
|
|
926
|
+
images.list,
|
|
927
|
+
)
|
|
928
|
+
self.delete = async_to_raw_response_wrapper(
|
|
929
|
+
images.delete,
|
|
930
|
+
)
|
|
931
|
+
self.create_from_volume = async_to_raw_response_wrapper(
|
|
932
|
+
images.create_from_volume,
|
|
933
|
+
)
|
|
934
|
+
self.get = async_to_raw_response_wrapper(
|
|
935
|
+
images.get,
|
|
936
|
+
)
|
|
937
|
+
self.upload = async_to_raw_response_wrapper(
|
|
938
|
+
images.upload,
|
|
939
|
+
)
|
|
940
|
+
|
|
941
|
+
|
|
942
|
+
class ImagesResourceWithStreamingResponse:
|
|
943
|
+
def __init__(self, images: ImagesResource) -> None:
|
|
944
|
+
self._images = images
|
|
945
|
+
|
|
946
|
+
self.update = to_streamed_response_wrapper(
|
|
947
|
+
images.update,
|
|
948
|
+
)
|
|
949
|
+
self.list = to_streamed_response_wrapper(
|
|
950
|
+
images.list,
|
|
951
|
+
)
|
|
952
|
+
self.delete = to_streamed_response_wrapper(
|
|
953
|
+
images.delete,
|
|
954
|
+
)
|
|
955
|
+
self.create_from_volume = to_streamed_response_wrapper(
|
|
956
|
+
images.create_from_volume,
|
|
957
|
+
)
|
|
958
|
+
self.get = to_streamed_response_wrapper(
|
|
959
|
+
images.get,
|
|
960
|
+
)
|
|
961
|
+
self.upload = to_streamed_response_wrapper(
|
|
962
|
+
images.upload,
|
|
963
|
+
)
|
|
964
|
+
|
|
965
|
+
|
|
966
|
+
class AsyncImagesResourceWithStreamingResponse:
|
|
967
|
+
def __init__(self, images: AsyncImagesResource) -> None:
|
|
968
|
+
self._images = images
|
|
969
|
+
|
|
970
|
+
self.update = async_to_streamed_response_wrapper(
|
|
971
|
+
images.update,
|
|
972
|
+
)
|
|
973
|
+
self.list = async_to_streamed_response_wrapper(
|
|
974
|
+
images.list,
|
|
975
|
+
)
|
|
976
|
+
self.delete = async_to_streamed_response_wrapper(
|
|
977
|
+
images.delete,
|
|
978
|
+
)
|
|
979
|
+
self.create_from_volume = async_to_streamed_response_wrapper(
|
|
980
|
+
images.create_from_volume,
|
|
981
|
+
)
|
|
982
|
+
self.get = async_to_streamed_response_wrapper(
|
|
983
|
+
images.get,
|
|
984
|
+
)
|
|
985
|
+
self.upload = async_to_streamed_response_wrapper(
|
|
986
|
+
images.upload,
|
|
987
|
+
)
|