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,1187 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from typing import Dict, List, Iterable, Optional
|
|
6
|
+
|
|
7
|
+
import httpx
|
|
8
|
+
|
|
9
|
+
from .logs import (
|
|
10
|
+
LogsResource,
|
|
11
|
+
AsyncLogsResource,
|
|
12
|
+
LogsResourceWithRawResponse,
|
|
13
|
+
AsyncLogsResourceWithRawResponse,
|
|
14
|
+
LogsResourceWithStreamingResponse,
|
|
15
|
+
AsyncLogsResourceWithStreamingResponse,
|
|
16
|
+
)
|
|
17
|
+
from ....._types import NOT_GIVEN, Body, Query, Headers, NoneType, NotGiven
|
|
18
|
+
from ....._utils import maybe_transform, async_maybe_transform
|
|
19
|
+
from ....._compat import cached_property
|
|
20
|
+
from ....._resource import SyncAPIResource, AsyncAPIResource
|
|
21
|
+
from ....._response import (
|
|
22
|
+
to_raw_response_wrapper,
|
|
23
|
+
to_streamed_response_wrapper,
|
|
24
|
+
async_to_raw_response_wrapper,
|
|
25
|
+
async_to_streamed_response_wrapper,
|
|
26
|
+
)
|
|
27
|
+
from .....pagination import SyncOffsetPage, AsyncOffsetPage
|
|
28
|
+
from ....._base_client import AsyncPaginator, make_request_options
|
|
29
|
+
from .....types.cloud.inference import deployment_list_params, deployment_create_params, deployment_update_params
|
|
30
|
+
from .....types.cloud.task_id_list import TaskIDList
|
|
31
|
+
from .....types.cloud.ingress_opts_param import IngressOptsParam
|
|
32
|
+
from .....types.cloud.inference.inference import Inference
|
|
33
|
+
from .....types.cloud.inference.inference_apikey_secret import InferenceApikeySecret
|
|
34
|
+
|
|
35
|
+
__all__ = ["DeploymentsResource", "AsyncDeploymentsResource"]
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
class DeploymentsResource(SyncAPIResource):
|
|
39
|
+
@cached_property
|
|
40
|
+
def logs(self) -> LogsResource:
|
|
41
|
+
return LogsResource(self._client)
|
|
42
|
+
|
|
43
|
+
@cached_property
|
|
44
|
+
def with_raw_response(self) -> DeploymentsResourceWithRawResponse:
|
|
45
|
+
"""
|
|
46
|
+
This property can be used as a prefix for any HTTP method call to return
|
|
47
|
+
the raw response object instead of the parsed content.
|
|
48
|
+
|
|
49
|
+
For more information, see https://www.github.com/G-Core/gcore-python#accessing-raw-response-data-eg-headers
|
|
50
|
+
"""
|
|
51
|
+
return DeploymentsResourceWithRawResponse(self)
|
|
52
|
+
|
|
53
|
+
@cached_property
|
|
54
|
+
def with_streaming_response(self) -> DeploymentsResourceWithStreamingResponse:
|
|
55
|
+
"""
|
|
56
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
57
|
+
|
|
58
|
+
For more information, see https://www.github.com/G-Core/gcore-python#with_streaming_response
|
|
59
|
+
"""
|
|
60
|
+
return DeploymentsResourceWithStreamingResponse(self)
|
|
61
|
+
|
|
62
|
+
def create(
|
|
63
|
+
self,
|
|
64
|
+
*,
|
|
65
|
+
project_id: int | None = None,
|
|
66
|
+
containers: Iterable[deployment_create_params.Container],
|
|
67
|
+
flavor_name: str,
|
|
68
|
+
image: str,
|
|
69
|
+
listening_port: int,
|
|
70
|
+
name: str,
|
|
71
|
+
auth_enabled: bool | NotGiven = NOT_GIVEN,
|
|
72
|
+
command: Optional[List[str]] | NotGiven = NOT_GIVEN,
|
|
73
|
+
credentials_name: Optional[str] | NotGiven = NOT_GIVEN,
|
|
74
|
+
description: Optional[str] | NotGiven = NOT_GIVEN,
|
|
75
|
+
envs: Dict[str, str] | NotGiven = NOT_GIVEN,
|
|
76
|
+
ingress_opts: Optional[IngressOptsParam] | NotGiven = NOT_GIVEN,
|
|
77
|
+
logging: Optional[deployment_create_params.Logging] | NotGiven = NOT_GIVEN,
|
|
78
|
+
probes: Optional[deployment_create_params.Probes] | NotGiven = NOT_GIVEN,
|
|
79
|
+
api_timeout: Optional[int] | NotGiven = NOT_GIVEN,
|
|
80
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
81
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
82
|
+
extra_headers: Headers | None = None,
|
|
83
|
+
extra_query: Query | None = None,
|
|
84
|
+
extra_body: Body | None = None,
|
|
85
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
86
|
+
) -> TaskIDList:
|
|
87
|
+
"""
|
|
88
|
+
Create inference deployment
|
|
89
|
+
|
|
90
|
+
Args:
|
|
91
|
+
project_id: Project ID
|
|
92
|
+
|
|
93
|
+
containers: List of containers for the inference instance.
|
|
94
|
+
|
|
95
|
+
flavor_name: Flavor name for the inference instance.
|
|
96
|
+
|
|
97
|
+
image: Docker image for the inference instance. This field should contain the image
|
|
98
|
+
name and tag in the format 'name:tag', e.g., 'nginx:latest'. It defaults to
|
|
99
|
+
Docker Hub as the image registry, but any accessible Docker image URL can be
|
|
100
|
+
specified.
|
|
101
|
+
|
|
102
|
+
listening_port: Listening port for the inference instance.
|
|
103
|
+
|
|
104
|
+
name: Inference instance name.
|
|
105
|
+
|
|
106
|
+
auth_enabled: Set to `true` to enable API key authentication for the inference instance.
|
|
107
|
+
`"Authorization": "Bearer *****"` or `"X-Api-Key": "*****"` header is required
|
|
108
|
+
for the requests to the instance if enabled
|
|
109
|
+
|
|
110
|
+
command: Command to be executed when running a container from an image.
|
|
111
|
+
|
|
112
|
+
credentials_name: Registry credentials name
|
|
113
|
+
|
|
114
|
+
description: Inference instance description.
|
|
115
|
+
|
|
116
|
+
envs: Environment variables for the inference instance.
|
|
117
|
+
|
|
118
|
+
ingress_opts: Ingress options for the inference instance
|
|
119
|
+
|
|
120
|
+
logging: Logging configuration for the inference instance
|
|
121
|
+
|
|
122
|
+
probes: Probes configured for all containers of the inference instance. If probes are
|
|
123
|
+
not provided, and the image_name is from a the Model Catalog registry, the
|
|
124
|
+
default probes will be used.
|
|
125
|
+
|
|
126
|
+
api_timeout: Specifies the duration in seconds without any requests after which the
|
|
127
|
+
containers will be downscaled to their minimum scale value as defined by
|
|
128
|
+
`scale.min`. If set, this helps in optimizing resource usage by reducing the
|
|
129
|
+
number of container instances during periods of inactivity. The default value
|
|
130
|
+
when the parameter is not set is 120.
|
|
131
|
+
|
|
132
|
+
extra_headers: Send extra headers
|
|
133
|
+
|
|
134
|
+
extra_query: Add additional query parameters to the request
|
|
135
|
+
|
|
136
|
+
extra_body: Add additional JSON properties to the request
|
|
137
|
+
|
|
138
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
139
|
+
"""
|
|
140
|
+
if project_id is None:
|
|
141
|
+
project_id = self._client._get_cloud_project_id_path_param()
|
|
142
|
+
return self._post(
|
|
143
|
+
f"/cloud/v3/inference/{project_id}/deployments",
|
|
144
|
+
body=maybe_transform(
|
|
145
|
+
{
|
|
146
|
+
"containers": containers,
|
|
147
|
+
"flavor_name": flavor_name,
|
|
148
|
+
"image": image,
|
|
149
|
+
"listening_port": listening_port,
|
|
150
|
+
"name": name,
|
|
151
|
+
"auth_enabled": auth_enabled,
|
|
152
|
+
"command": command,
|
|
153
|
+
"credentials_name": credentials_name,
|
|
154
|
+
"description": description,
|
|
155
|
+
"envs": envs,
|
|
156
|
+
"ingress_opts": ingress_opts,
|
|
157
|
+
"logging": logging,
|
|
158
|
+
"probes": probes,
|
|
159
|
+
"api_timeout": api_timeout,
|
|
160
|
+
},
|
|
161
|
+
deployment_create_params.DeploymentCreateParams,
|
|
162
|
+
),
|
|
163
|
+
options=make_request_options(
|
|
164
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
165
|
+
),
|
|
166
|
+
cast_to=TaskIDList,
|
|
167
|
+
)
|
|
168
|
+
|
|
169
|
+
def update(
|
|
170
|
+
self,
|
|
171
|
+
deployment_name: str,
|
|
172
|
+
*,
|
|
173
|
+
project_id: int | None = None,
|
|
174
|
+
auth_enabled: Optional[bool] | NotGiven = NOT_GIVEN,
|
|
175
|
+
command: Optional[List[str]] | NotGiven = NOT_GIVEN,
|
|
176
|
+
containers: Optional[Iterable[deployment_update_params.Container]] | NotGiven = NOT_GIVEN,
|
|
177
|
+
credentials_name: Optional[str] | NotGiven = NOT_GIVEN,
|
|
178
|
+
description: Optional[str] | NotGiven = NOT_GIVEN,
|
|
179
|
+
envs: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN,
|
|
180
|
+
flavor_name: Optional[str] | NotGiven = NOT_GIVEN,
|
|
181
|
+
image: Optional[str] | NotGiven = NOT_GIVEN,
|
|
182
|
+
ingress_opts: Optional[IngressOptsParam] | NotGiven = NOT_GIVEN,
|
|
183
|
+
listening_port: Optional[int] | NotGiven = NOT_GIVEN,
|
|
184
|
+
logging: Optional[deployment_update_params.Logging] | NotGiven = NOT_GIVEN,
|
|
185
|
+
probes: Optional[deployment_update_params.Probes] | NotGiven = NOT_GIVEN,
|
|
186
|
+
api_timeout: Optional[int] | NotGiven = NOT_GIVEN,
|
|
187
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
188
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
189
|
+
extra_headers: Headers | None = None,
|
|
190
|
+
extra_query: Query | None = None,
|
|
191
|
+
extra_body: Body | None = None,
|
|
192
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
193
|
+
) -> TaskIDList:
|
|
194
|
+
"""
|
|
195
|
+
Update inference deployment
|
|
196
|
+
|
|
197
|
+
Args:
|
|
198
|
+
project_id: Project ID
|
|
199
|
+
|
|
200
|
+
deployment_name: Inference instance name.
|
|
201
|
+
|
|
202
|
+
auth_enabled: Set to `true` to enable API key authentication for the inference instance.
|
|
203
|
+
`"Authorization": "Bearer *****"` or `"X-Api-Key": "*****"` header is required
|
|
204
|
+
for the requests to the instance if enabled
|
|
205
|
+
|
|
206
|
+
command: Command to be executed when running a container from an image.
|
|
207
|
+
|
|
208
|
+
containers: List of containers for the inference instance.
|
|
209
|
+
|
|
210
|
+
credentials_name: Registry credentials name
|
|
211
|
+
|
|
212
|
+
description: Inference instance description.
|
|
213
|
+
|
|
214
|
+
envs: Environment variables for the inference instance.
|
|
215
|
+
|
|
216
|
+
flavor_name: Flavor name for the inference instance.
|
|
217
|
+
|
|
218
|
+
image: Docker image for the inference instance. This field should contain the image
|
|
219
|
+
name and tag in the format 'name:tag', e.g., 'nginx:latest'. It defaults to
|
|
220
|
+
Docker Hub as the image registry, but any accessible Docker image URL can be
|
|
221
|
+
specified.
|
|
222
|
+
|
|
223
|
+
ingress_opts: Ingress options for the inference instance
|
|
224
|
+
|
|
225
|
+
listening_port: Listening port for the inference instance.
|
|
226
|
+
|
|
227
|
+
logging: Logging configuration for the inference instance
|
|
228
|
+
|
|
229
|
+
probes: Probes configured for all containers of the inference instance.
|
|
230
|
+
|
|
231
|
+
api_timeout: Specifies the duration in seconds without any requests after which the
|
|
232
|
+
containers will be downscaled to their minimum scale value as defined by
|
|
233
|
+
`scale.min`. If set, this helps in optimizing resource usage by reducing the
|
|
234
|
+
number of container instances during periods of inactivity. The default value
|
|
235
|
+
when the parameter is not set is 120.
|
|
236
|
+
|
|
237
|
+
extra_headers: Send extra headers
|
|
238
|
+
|
|
239
|
+
extra_query: Add additional query parameters to the request
|
|
240
|
+
|
|
241
|
+
extra_body: Add additional JSON properties to the request
|
|
242
|
+
|
|
243
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
244
|
+
"""
|
|
245
|
+
if project_id is None:
|
|
246
|
+
project_id = self._client._get_cloud_project_id_path_param()
|
|
247
|
+
if not deployment_name:
|
|
248
|
+
raise ValueError(f"Expected a non-empty value for `deployment_name` but received {deployment_name!r}")
|
|
249
|
+
return self._patch(
|
|
250
|
+
f"/cloud/v3/inference/{project_id}/deployments/{deployment_name}",
|
|
251
|
+
body=maybe_transform(
|
|
252
|
+
{
|
|
253
|
+
"auth_enabled": auth_enabled,
|
|
254
|
+
"command": command,
|
|
255
|
+
"containers": containers,
|
|
256
|
+
"credentials_name": credentials_name,
|
|
257
|
+
"description": description,
|
|
258
|
+
"envs": envs,
|
|
259
|
+
"flavor_name": flavor_name,
|
|
260
|
+
"image": image,
|
|
261
|
+
"ingress_opts": ingress_opts,
|
|
262
|
+
"listening_port": listening_port,
|
|
263
|
+
"logging": logging,
|
|
264
|
+
"probes": probes,
|
|
265
|
+
"api_timeout": api_timeout,
|
|
266
|
+
},
|
|
267
|
+
deployment_update_params.DeploymentUpdateParams,
|
|
268
|
+
),
|
|
269
|
+
options=make_request_options(
|
|
270
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
271
|
+
),
|
|
272
|
+
cast_to=TaskIDList,
|
|
273
|
+
)
|
|
274
|
+
|
|
275
|
+
def list(
|
|
276
|
+
self,
|
|
277
|
+
*,
|
|
278
|
+
project_id: int | None = None,
|
|
279
|
+
limit: int | NotGiven = NOT_GIVEN,
|
|
280
|
+
offset: int | NotGiven = NOT_GIVEN,
|
|
281
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
282
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
283
|
+
extra_headers: Headers | None = None,
|
|
284
|
+
extra_query: Query | None = None,
|
|
285
|
+
extra_body: Body | None = None,
|
|
286
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
287
|
+
) -> SyncOffsetPage[Inference]:
|
|
288
|
+
"""List inference deployments
|
|
289
|
+
|
|
290
|
+
Args:
|
|
291
|
+
project_id: Project ID
|
|
292
|
+
|
|
293
|
+
limit: Optional.
|
|
294
|
+
|
|
295
|
+
Limit the number of returned items
|
|
296
|
+
|
|
297
|
+
offset: Optional. Offset value is used to exclude the first set of records from the
|
|
298
|
+
result
|
|
299
|
+
|
|
300
|
+
extra_headers: Send extra headers
|
|
301
|
+
|
|
302
|
+
extra_query: Add additional query parameters to the request
|
|
303
|
+
|
|
304
|
+
extra_body: Add additional JSON properties to the request
|
|
305
|
+
|
|
306
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
307
|
+
"""
|
|
308
|
+
if project_id is None:
|
|
309
|
+
project_id = self._client._get_cloud_project_id_path_param()
|
|
310
|
+
return self._get_api_list(
|
|
311
|
+
f"/cloud/v3/inference/{project_id}/deployments",
|
|
312
|
+
page=SyncOffsetPage[Inference],
|
|
313
|
+
options=make_request_options(
|
|
314
|
+
extra_headers=extra_headers,
|
|
315
|
+
extra_query=extra_query,
|
|
316
|
+
extra_body=extra_body,
|
|
317
|
+
timeout=timeout,
|
|
318
|
+
query=maybe_transform(
|
|
319
|
+
{
|
|
320
|
+
"limit": limit,
|
|
321
|
+
"offset": offset,
|
|
322
|
+
},
|
|
323
|
+
deployment_list_params.DeploymentListParams,
|
|
324
|
+
),
|
|
325
|
+
),
|
|
326
|
+
model=Inference,
|
|
327
|
+
)
|
|
328
|
+
|
|
329
|
+
def delete(
|
|
330
|
+
self,
|
|
331
|
+
deployment_name: str,
|
|
332
|
+
*,
|
|
333
|
+
project_id: int | None = None,
|
|
334
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
335
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
336
|
+
extra_headers: Headers | None = None,
|
|
337
|
+
extra_query: Query | None = None,
|
|
338
|
+
extra_body: Body | None = None,
|
|
339
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
340
|
+
) -> TaskIDList:
|
|
341
|
+
"""
|
|
342
|
+
Delete inference deployment
|
|
343
|
+
|
|
344
|
+
Args:
|
|
345
|
+
project_id: Project ID
|
|
346
|
+
|
|
347
|
+
deployment_name: Inference instance name.
|
|
348
|
+
|
|
349
|
+
extra_headers: Send extra headers
|
|
350
|
+
|
|
351
|
+
extra_query: Add additional query parameters to the request
|
|
352
|
+
|
|
353
|
+
extra_body: Add additional JSON properties to the request
|
|
354
|
+
|
|
355
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
356
|
+
"""
|
|
357
|
+
if project_id is None:
|
|
358
|
+
project_id = self._client._get_cloud_project_id_path_param()
|
|
359
|
+
if not deployment_name:
|
|
360
|
+
raise ValueError(f"Expected a non-empty value for `deployment_name` but received {deployment_name!r}")
|
|
361
|
+
return self._delete(
|
|
362
|
+
f"/cloud/v3/inference/{project_id}/deployments/{deployment_name}",
|
|
363
|
+
options=make_request_options(
|
|
364
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
365
|
+
),
|
|
366
|
+
cast_to=TaskIDList,
|
|
367
|
+
)
|
|
368
|
+
|
|
369
|
+
def get(
|
|
370
|
+
self,
|
|
371
|
+
deployment_name: str,
|
|
372
|
+
*,
|
|
373
|
+
project_id: int | None = None,
|
|
374
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
375
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
376
|
+
extra_headers: Headers | None = None,
|
|
377
|
+
extra_query: Query | None = None,
|
|
378
|
+
extra_body: Body | None = None,
|
|
379
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
380
|
+
) -> Inference:
|
|
381
|
+
"""
|
|
382
|
+
Get inference deployment
|
|
383
|
+
|
|
384
|
+
Args:
|
|
385
|
+
project_id: Project ID
|
|
386
|
+
|
|
387
|
+
deployment_name: Inference instance name.
|
|
388
|
+
|
|
389
|
+
extra_headers: Send extra headers
|
|
390
|
+
|
|
391
|
+
extra_query: Add additional query parameters to the request
|
|
392
|
+
|
|
393
|
+
extra_body: Add additional JSON properties to the request
|
|
394
|
+
|
|
395
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
396
|
+
"""
|
|
397
|
+
if project_id is None:
|
|
398
|
+
project_id = self._client._get_cloud_project_id_path_param()
|
|
399
|
+
if not deployment_name:
|
|
400
|
+
raise ValueError(f"Expected a non-empty value for `deployment_name` but received {deployment_name!r}")
|
|
401
|
+
return self._get(
|
|
402
|
+
f"/cloud/v3/inference/{project_id}/deployments/{deployment_name}",
|
|
403
|
+
options=make_request_options(
|
|
404
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
405
|
+
),
|
|
406
|
+
cast_to=Inference,
|
|
407
|
+
)
|
|
408
|
+
|
|
409
|
+
def get_api_key(
|
|
410
|
+
self,
|
|
411
|
+
deployment_name: str,
|
|
412
|
+
*,
|
|
413
|
+
project_id: int | None = None,
|
|
414
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
415
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
416
|
+
extra_headers: Headers | None = None,
|
|
417
|
+
extra_query: Query | None = None,
|
|
418
|
+
extra_body: Body | None = None,
|
|
419
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
420
|
+
) -> InferenceApikeySecret:
|
|
421
|
+
"""
|
|
422
|
+
Get inference deployment API key
|
|
423
|
+
|
|
424
|
+
Args:
|
|
425
|
+
project_id: Project ID
|
|
426
|
+
|
|
427
|
+
deployment_name: Inference instance name.
|
|
428
|
+
|
|
429
|
+
extra_headers: Send extra headers
|
|
430
|
+
|
|
431
|
+
extra_query: Add additional query parameters to the request
|
|
432
|
+
|
|
433
|
+
extra_body: Add additional JSON properties to the request
|
|
434
|
+
|
|
435
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
436
|
+
"""
|
|
437
|
+
if project_id is None:
|
|
438
|
+
project_id = self._client._get_cloud_project_id_path_param()
|
|
439
|
+
if not deployment_name:
|
|
440
|
+
raise ValueError(f"Expected a non-empty value for `deployment_name` but received {deployment_name!r}")
|
|
441
|
+
return self._get(
|
|
442
|
+
f"/cloud/v3/inference/{project_id}/deployments/{deployment_name}/apikey",
|
|
443
|
+
options=make_request_options(
|
|
444
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
445
|
+
),
|
|
446
|
+
cast_to=InferenceApikeySecret,
|
|
447
|
+
)
|
|
448
|
+
|
|
449
|
+
def start(
|
|
450
|
+
self,
|
|
451
|
+
deployment_name: str,
|
|
452
|
+
*,
|
|
453
|
+
project_id: int | None = None,
|
|
454
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
455
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
456
|
+
extra_headers: Headers | None = None,
|
|
457
|
+
extra_query: Query | None = None,
|
|
458
|
+
extra_body: Body | None = None,
|
|
459
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
460
|
+
) -> None:
|
|
461
|
+
"""
|
|
462
|
+
This operation initializes an inference deployment after it was stopped, making
|
|
463
|
+
it available to handle inference requests again. The instance will launch with
|
|
464
|
+
the **minimum** number of replicas defined in the scaling settings.
|
|
465
|
+
|
|
466
|
+
- If the minimum replicas are set to **0**, the instance will initially start
|
|
467
|
+
with **0** replicas.
|
|
468
|
+
- It will automatically scale up when it receives requests or SQS messages,
|
|
469
|
+
according to the configured scaling rules.
|
|
470
|
+
|
|
471
|
+
Args:
|
|
472
|
+
project_id: Project ID
|
|
473
|
+
|
|
474
|
+
deployment_name: Inference instance name.
|
|
475
|
+
|
|
476
|
+
extra_headers: Send extra headers
|
|
477
|
+
|
|
478
|
+
extra_query: Add additional query parameters to the request
|
|
479
|
+
|
|
480
|
+
extra_body: Add additional JSON properties to the request
|
|
481
|
+
|
|
482
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
483
|
+
"""
|
|
484
|
+
if project_id is None:
|
|
485
|
+
project_id = self._client._get_cloud_project_id_path_param()
|
|
486
|
+
if not deployment_name:
|
|
487
|
+
raise ValueError(f"Expected a non-empty value for `deployment_name` but received {deployment_name!r}")
|
|
488
|
+
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
|
489
|
+
return self._post(
|
|
490
|
+
f"/cloud/v3/inference/{project_id}/deployments/{deployment_name}/start",
|
|
491
|
+
options=make_request_options(
|
|
492
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
493
|
+
),
|
|
494
|
+
cast_to=NoneType,
|
|
495
|
+
)
|
|
496
|
+
|
|
497
|
+
def stop(
|
|
498
|
+
self,
|
|
499
|
+
deployment_name: str,
|
|
500
|
+
*,
|
|
501
|
+
project_id: int | None = None,
|
|
502
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
503
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
504
|
+
extra_headers: Headers | None = None,
|
|
505
|
+
extra_query: Query | None = None,
|
|
506
|
+
extra_body: Body | None = None,
|
|
507
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
508
|
+
) -> None:
|
|
509
|
+
"""
|
|
510
|
+
This operation shuts down an inference deployment, making it unavailable for
|
|
511
|
+
handling requests. The deployment will scale down to **0** replicas, overriding
|
|
512
|
+
any minimum replica settings.
|
|
513
|
+
|
|
514
|
+
- Once stopped, the deployment will **not** process any inference requests or
|
|
515
|
+
SQS messages.
|
|
516
|
+
- It will **not** restart automatically and must be started manually.
|
|
517
|
+
- While stopped, the deployment will **not** incur any charges.
|
|
518
|
+
|
|
519
|
+
Args:
|
|
520
|
+
project_id: Project ID
|
|
521
|
+
|
|
522
|
+
deployment_name: Inference instance name.
|
|
523
|
+
|
|
524
|
+
extra_headers: Send extra headers
|
|
525
|
+
|
|
526
|
+
extra_query: Add additional query parameters to the request
|
|
527
|
+
|
|
528
|
+
extra_body: Add additional JSON properties to the request
|
|
529
|
+
|
|
530
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
531
|
+
"""
|
|
532
|
+
if project_id is None:
|
|
533
|
+
project_id = self._client._get_cloud_project_id_path_param()
|
|
534
|
+
if not deployment_name:
|
|
535
|
+
raise ValueError(f"Expected a non-empty value for `deployment_name` but received {deployment_name!r}")
|
|
536
|
+
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
|
537
|
+
return self._post(
|
|
538
|
+
f"/cloud/v3/inference/{project_id}/deployments/{deployment_name}/stop",
|
|
539
|
+
options=make_request_options(
|
|
540
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
541
|
+
),
|
|
542
|
+
cast_to=NoneType,
|
|
543
|
+
)
|
|
544
|
+
|
|
545
|
+
|
|
546
|
+
class AsyncDeploymentsResource(AsyncAPIResource):
|
|
547
|
+
@cached_property
|
|
548
|
+
def logs(self) -> AsyncLogsResource:
|
|
549
|
+
return AsyncLogsResource(self._client)
|
|
550
|
+
|
|
551
|
+
@cached_property
|
|
552
|
+
def with_raw_response(self) -> AsyncDeploymentsResourceWithRawResponse:
|
|
553
|
+
"""
|
|
554
|
+
This property can be used as a prefix for any HTTP method call to return
|
|
555
|
+
the raw response object instead of the parsed content.
|
|
556
|
+
|
|
557
|
+
For more information, see https://www.github.com/G-Core/gcore-python#accessing-raw-response-data-eg-headers
|
|
558
|
+
"""
|
|
559
|
+
return AsyncDeploymentsResourceWithRawResponse(self)
|
|
560
|
+
|
|
561
|
+
@cached_property
|
|
562
|
+
def with_streaming_response(self) -> AsyncDeploymentsResourceWithStreamingResponse:
|
|
563
|
+
"""
|
|
564
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
565
|
+
|
|
566
|
+
For more information, see https://www.github.com/G-Core/gcore-python#with_streaming_response
|
|
567
|
+
"""
|
|
568
|
+
return AsyncDeploymentsResourceWithStreamingResponse(self)
|
|
569
|
+
|
|
570
|
+
async def create(
|
|
571
|
+
self,
|
|
572
|
+
*,
|
|
573
|
+
project_id: int | None = None,
|
|
574
|
+
containers: Iterable[deployment_create_params.Container],
|
|
575
|
+
flavor_name: str,
|
|
576
|
+
image: str,
|
|
577
|
+
listening_port: int,
|
|
578
|
+
name: str,
|
|
579
|
+
auth_enabled: bool | NotGiven = NOT_GIVEN,
|
|
580
|
+
command: Optional[List[str]] | NotGiven = NOT_GIVEN,
|
|
581
|
+
credentials_name: Optional[str] | NotGiven = NOT_GIVEN,
|
|
582
|
+
description: Optional[str] | NotGiven = NOT_GIVEN,
|
|
583
|
+
envs: Dict[str, str] | NotGiven = NOT_GIVEN,
|
|
584
|
+
ingress_opts: Optional[IngressOptsParam] | NotGiven = NOT_GIVEN,
|
|
585
|
+
logging: Optional[deployment_create_params.Logging] | NotGiven = NOT_GIVEN,
|
|
586
|
+
probes: Optional[deployment_create_params.Probes] | NotGiven = NOT_GIVEN,
|
|
587
|
+
api_timeout: Optional[int] | NotGiven = NOT_GIVEN,
|
|
588
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
589
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
590
|
+
extra_headers: Headers | None = None,
|
|
591
|
+
extra_query: Query | None = None,
|
|
592
|
+
extra_body: Body | None = None,
|
|
593
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
594
|
+
) -> TaskIDList:
|
|
595
|
+
"""
|
|
596
|
+
Create inference deployment
|
|
597
|
+
|
|
598
|
+
Args:
|
|
599
|
+
project_id: Project ID
|
|
600
|
+
|
|
601
|
+
containers: List of containers for the inference instance.
|
|
602
|
+
|
|
603
|
+
flavor_name: Flavor name for the inference instance.
|
|
604
|
+
|
|
605
|
+
image: Docker image for the inference instance. This field should contain the image
|
|
606
|
+
name and tag in the format 'name:tag', e.g., 'nginx:latest'. It defaults to
|
|
607
|
+
Docker Hub as the image registry, but any accessible Docker image URL can be
|
|
608
|
+
specified.
|
|
609
|
+
|
|
610
|
+
listening_port: Listening port for the inference instance.
|
|
611
|
+
|
|
612
|
+
name: Inference instance name.
|
|
613
|
+
|
|
614
|
+
auth_enabled: Set to `true` to enable API key authentication for the inference instance.
|
|
615
|
+
`"Authorization": "Bearer *****"` or `"X-Api-Key": "*****"` header is required
|
|
616
|
+
for the requests to the instance if enabled
|
|
617
|
+
|
|
618
|
+
command: Command to be executed when running a container from an image.
|
|
619
|
+
|
|
620
|
+
credentials_name: Registry credentials name
|
|
621
|
+
|
|
622
|
+
description: Inference instance description.
|
|
623
|
+
|
|
624
|
+
envs: Environment variables for the inference instance.
|
|
625
|
+
|
|
626
|
+
ingress_opts: Ingress options for the inference instance
|
|
627
|
+
|
|
628
|
+
logging: Logging configuration for the inference instance
|
|
629
|
+
|
|
630
|
+
probes: Probes configured for all containers of the inference instance. If probes are
|
|
631
|
+
not provided, and the image_name is from a the Model Catalog registry, the
|
|
632
|
+
default probes will be used.
|
|
633
|
+
|
|
634
|
+
api_timeout: Specifies the duration in seconds without any requests after which the
|
|
635
|
+
containers will be downscaled to their minimum scale value as defined by
|
|
636
|
+
`scale.min`. If set, this helps in optimizing resource usage by reducing the
|
|
637
|
+
number of container instances during periods of inactivity. The default value
|
|
638
|
+
when the parameter is not set is 120.
|
|
639
|
+
|
|
640
|
+
extra_headers: Send extra headers
|
|
641
|
+
|
|
642
|
+
extra_query: Add additional query parameters to the request
|
|
643
|
+
|
|
644
|
+
extra_body: Add additional JSON properties to the request
|
|
645
|
+
|
|
646
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
647
|
+
"""
|
|
648
|
+
if project_id is None:
|
|
649
|
+
project_id = self._client._get_cloud_project_id_path_param()
|
|
650
|
+
return await self._post(
|
|
651
|
+
f"/cloud/v3/inference/{project_id}/deployments",
|
|
652
|
+
body=await async_maybe_transform(
|
|
653
|
+
{
|
|
654
|
+
"containers": containers,
|
|
655
|
+
"flavor_name": flavor_name,
|
|
656
|
+
"image": image,
|
|
657
|
+
"listening_port": listening_port,
|
|
658
|
+
"name": name,
|
|
659
|
+
"auth_enabled": auth_enabled,
|
|
660
|
+
"command": command,
|
|
661
|
+
"credentials_name": credentials_name,
|
|
662
|
+
"description": description,
|
|
663
|
+
"envs": envs,
|
|
664
|
+
"ingress_opts": ingress_opts,
|
|
665
|
+
"logging": logging,
|
|
666
|
+
"probes": probes,
|
|
667
|
+
"api_timeout": api_timeout,
|
|
668
|
+
},
|
|
669
|
+
deployment_create_params.DeploymentCreateParams,
|
|
670
|
+
),
|
|
671
|
+
options=make_request_options(
|
|
672
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
673
|
+
),
|
|
674
|
+
cast_to=TaskIDList,
|
|
675
|
+
)
|
|
676
|
+
|
|
677
|
+
async def update(
|
|
678
|
+
self,
|
|
679
|
+
deployment_name: str,
|
|
680
|
+
*,
|
|
681
|
+
project_id: int | None = None,
|
|
682
|
+
auth_enabled: Optional[bool] | NotGiven = NOT_GIVEN,
|
|
683
|
+
command: Optional[List[str]] | NotGiven = NOT_GIVEN,
|
|
684
|
+
containers: Optional[Iterable[deployment_update_params.Container]] | NotGiven = NOT_GIVEN,
|
|
685
|
+
credentials_name: Optional[str] | NotGiven = NOT_GIVEN,
|
|
686
|
+
description: Optional[str] | NotGiven = NOT_GIVEN,
|
|
687
|
+
envs: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN,
|
|
688
|
+
flavor_name: Optional[str] | NotGiven = NOT_GIVEN,
|
|
689
|
+
image: Optional[str] | NotGiven = NOT_GIVEN,
|
|
690
|
+
ingress_opts: Optional[IngressOptsParam] | NotGiven = NOT_GIVEN,
|
|
691
|
+
listening_port: Optional[int] | NotGiven = NOT_GIVEN,
|
|
692
|
+
logging: Optional[deployment_update_params.Logging] | NotGiven = NOT_GIVEN,
|
|
693
|
+
probes: Optional[deployment_update_params.Probes] | NotGiven = NOT_GIVEN,
|
|
694
|
+
api_timeout: Optional[int] | NotGiven = NOT_GIVEN,
|
|
695
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
696
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
697
|
+
extra_headers: Headers | None = None,
|
|
698
|
+
extra_query: Query | None = None,
|
|
699
|
+
extra_body: Body | None = None,
|
|
700
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
701
|
+
) -> TaskIDList:
|
|
702
|
+
"""
|
|
703
|
+
Update inference deployment
|
|
704
|
+
|
|
705
|
+
Args:
|
|
706
|
+
project_id: Project ID
|
|
707
|
+
|
|
708
|
+
deployment_name: Inference instance name.
|
|
709
|
+
|
|
710
|
+
auth_enabled: Set to `true` to enable API key authentication for the inference instance.
|
|
711
|
+
`"Authorization": "Bearer *****"` or `"X-Api-Key": "*****"` header is required
|
|
712
|
+
for the requests to the instance if enabled
|
|
713
|
+
|
|
714
|
+
command: Command to be executed when running a container from an image.
|
|
715
|
+
|
|
716
|
+
containers: List of containers for the inference instance.
|
|
717
|
+
|
|
718
|
+
credentials_name: Registry credentials name
|
|
719
|
+
|
|
720
|
+
description: Inference instance description.
|
|
721
|
+
|
|
722
|
+
envs: Environment variables for the inference instance.
|
|
723
|
+
|
|
724
|
+
flavor_name: Flavor name for the inference instance.
|
|
725
|
+
|
|
726
|
+
image: Docker image for the inference instance. This field should contain the image
|
|
727
|
+
name and tag in the format 'name:tag', e.g., 'nginx:latest'. It defaults to
|
|
728
|
+
Docker Hub as the image registry, but any accessible Docker image URL can be
|
|
729
|
+
specified.
|
|
730
|
+
|
|
731
|
+
ingress_opts: Ingress options for the inference instance
|
|
732
|
+
|
|
733
|
+
listening_port: Listening port for the inference instance.
|
|
734
|
+
|
|
735
|
+
logging: Logging configuration for the inference instance
|
|
736
|
+
|
|
737
|
+
probes: Probes configured for all containers of the inference instance.
|
|
738
|
+
|
|
739
|
+
api_timeout: Specifies the duration in seconds without any requests after which the
|
|
740
|
+
containers will be downscaled to their minimum scale value as defined by
|
|
741
|
+
`scale.min`. If set, this helps in optimizing resource usage by reducing the
|
|
742
|
+
number of container instances during periods of inactivity. The default value
|
|
743
|
+
when the parameter is not set is 120.
|
|
744
|
+
|
|
745
|
+
extra_headers: Send extra headers
|
|
746
|
+
|
|
747
|
+
extra_query: Add additional query parameters to the request
|
|
748
|
+
|
|
749
|
+
extra_body: Add additional JSON properties to the request
|
|
750
|
+
|
|
751
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
752
|
+
"""
|
|
753
|
+
if project_id is None:
|
|
754
|
+
project_id = self._client._get_cloud_project_id_path_param()
|
|
755
|
+
if not deployment_name:
|
|
756
|
+
raise ValueError(f"Expected a non-empty value for `deployment_name` but received {deployment_name!r}")
|
|
757
|
+
return await self._patch(
|
|
758
|
+
f"/cloud/v3/inference/{project_id}/deployments/{deployment_name}",
|
|
759
|
+
body=await async_maybe_transform(
|
|
760
|
+
{
|
|
761
|
+
"auth_enabled": auth_enabled,
|
|
762
|
+
"command": command,
|
|
763
|
+
"containers": containers,
|
|
764
|
+
"credentials_name": credentials_name,
|
|
765
|
+
"description": description,
|
|
766
|
+
"envs": envs,
|
|
767
|
+
"flavor_name": flavor_name,
|
|
768
|
+
"image": image,
|
|
769
|
+
"ingress_opts": ingress_opts,
|
|
770
|
+
"listening_port": listening_port,
|
|
771
|
+
"logging": logging,
|
|
772
|
+
"probes": probes,
|
|
773
|
+
"api_timeout": api_timeout,
|
|
774
|
+
},
|
|
775
|
+
deployment_update_params.DeploymentUpdateParams,
|
|
776
|
+
),
|
|
777
|
+
options=make_request_options(
|
|
778
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
779
|
+
),
|
|
780
|
+
cast_to=TaskIDList,
|
|
781
|
+
)
|
|
782
|
+
|
|
783
|
+
def list(
|
|
784
|
+
self,
|
|
785
|
+
*,
|
|
786
|
+
project_id: int | None = None,
|
|
787
|
+
limit: int | NotGiven = NOT_GIVEN,
|
|
788
|
+
offset: int | NotGiven = NOT_GIVEN,
|
|
789
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
790
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
791
|
+
extra_headers: Headers | None = None,
|
|
792
|
+
extra_query: Query | None = None,
|
|
793
|
+
extra_body: Body | None = None,
|
|
794
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
795
|
+
) -> AsyncPaginator[Inference, AsyncOffsetPage[Inference]]:
|
|
796
|
+
"""List inference deployments
|
|
797
|
+
|
|
798
|
+
Args:
|
|
799
|
+
project_id: Project ID
|
|
800
|
+
|
|
801
|
+
limit: Optional.
|
|
802
|
+
|
|
803
|
+
Limit the number of returned items
|
|
804
|
+
|
|
805
|
+
offset: Optional. Offset value is used to exclude the first set of records from the
|
|
806
|
+
result
|
|
807
|
+
|
|
808
|
+
extra_headers: Send extra headers
|
|
809
|
+
|
|
810
|
+
extra_query: Add additional query parameters to the request
|
|
811
|
+
|
|
812
|
+
extra_body: Add additional JSON properties to the request
|
|
813
|
+
|
|
814
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
815
|
+
"""
|
|
816
|
+
if project_id is None:
|
|
817
|
+
project_id = self._client._get_cloud_project_id_path_param()
|
|
818
|
+
return self._get_api_list(
|
|
819
|
+
f"/cloud/v3/inference/{project_id}/deployments",
|
|
820
|
+
page=AsyncOffsetPage[Inference],
|
|
821
|
+
options=make_request_options(
|
|
822
|
+
extra_headers=extra_headers,
|
|
823
|
+
extra_query=extra_query,
|
|
824
|
+
extra_body=extra_body,
|
|
825
|
+
timeout=timeout,
|
|
826
|
+
query=maybe_transform(
|
|
827
|
+
{
|
|
828
|
+
"limit": limit,
|
|
829
|
+
"offset": offset,
|
|
830
|
+
},
|
|
831
|
+
deployment_list_params.DeploymentListParams,
|
|
832
|
+
),
|
|
833
|
+
),
|
|
834
|
+
model=Inference,
|
|
835
|
+
)
|
|
836
|
+
|
|
837
|
+
async def delete(
|
|
838
|
+
self,
|
|
839
|
+
deployment_name: str,
|
|
840
|
+
*,
|
|
841
|
+
project_id: int | None = None,
|
|
842
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
843
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
844
|
+
extra_headers: Headers | None = None,
|
|
845
|
+
extra_query: Query | None = None,
|
|
846
|
+
extra_body: Body | None = None,
|
|
847
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
848
|
+
) -> TaskIDList:
|
|
849
|
+
"""
|
|
850
|
+
Delete inference deployment
|
|
851
|
+
|
|
852
|
+
Args:
|
|
853
|
+
project_id: Project ID
|
|
854
|
+
|
|
855
|
+
deployment_name: Inference instance name.
|
|
856
|
+
|
|
857
|
+
extra_headers: Send extra headers
|
|
858
|
+
|
|
859
|
+
extra_query: Add additional query parameters to the request
|
|
860
|
+
|
|
861
|
+
extra_body: Add additional JSON properties to the request
|
|
862
|
+
|
|
863
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
864
|
+
"""
|
|
865
|
+
if project_id is None:
|
|
866
|
+
project_id = self._client._get_cloud_project_id_path_param()
|
|
867
|
+
if not deployment_name:
|
|
868
|
+
raise ValueError(f"Expected a non-empty value for `deployment_name` but received {deployment_name!r}")
|
|
869
|
+
return await self._delete(
|
|
870
|
+
f"/cloud/v3/inference/{project_id}/deployments/{deployment_name}",
|
|
871
|
+
options=make_request_options(
|
|
872
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
873
|
+
),
|
|
874
|
+
cast_to=TaskIDList,
|
|
875
|
+
)
|
|
876
|
+
|
|
877
|
+
async def get(
|
|
878
|
+
self,
|
|
879
|
+
deployment_name: str,
|
|
880
|
+
*,
|
|
881
|
+
project_id: int | None = None,
|
|
882
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
883
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
884
|
+
extra_headers: Headers | None = None,
|
|
885
|
+
extra_query: Query | None = None,
|
|
886
|
+
extra_body: Body | None = None,
|
|
887
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
888
|
+
) -> Inference:
|
|
889
|
+
"""
|
|
890
|
+
Get inference deployment
|
|
891
|
+
|
|
892
|
+
Args:
|
|
893
|
+
project_id: Project ID
|
|
894
|
+
|
|
895
|
+
deployment_name: Inference instance name.
|
|
896
|
+
|
|
897
|
+
extra_headers: Send extra headers
|
|
898
|
+
|
|
899
|
+
extra_query: Add additional query parameters to the request
|
|
900
|
+
|
|
901
|
+
extra_body: Add additional JSON properties to the request
|
|
902
|
+
|
|
903
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
904
|
+
"""
|
|
905
|
+
if project_id is None:
|
|
906
|
+
project_id = self._client._get_cloud_project_id_path_param()
|
|
907
|
+
if not deployment_name:
|
|
908
|
+
raise ValueError(f"Expected a non-empty value for `deployment_name` but received {deployment_name!r}")
|
|
909
|
+
return await self._get(
|
|
910
|
+
f"/cloud/v3/inference/{project_id}/deployments/{deployment_name}",
|
|
911
|
+
options=make_request_options(
|
|
912
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
913
|
+
),
|
|
914
|
+
cast_to=Inference,
|
|
915
|
+
)
|
|
916
|
+
|
|
917
|
+
async def get_api_key(
|
|
918
|
+
self,
|
|
919
|
+
deployment_name: str,
|
|
920
|
+
*,
|
|
921
|
+
project_id: int | None = None,
|
|
922
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
923
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
924
|
+
extra_headers: Headers | None = None,
|
|
925
|
+
extra_query: Query | None = None,
|
|
926
|
+
extra_body: Body | None = None,
|
|
927
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
928
|
+
) -> InferenceApikeySecret:
|
|
929
|
+
"""
|
|
930
|
+
Get inference deployment API key
|
|
931
|
+
|
|
932
|
+
Args:
|
|
933
|
+
project_id: Project ID
|
|
934
|
+
|
|
935
|
+
deployment_name: Inference instance name.
|
|
936
|
+
|
|
937
|
+
extra_headers: Send extra headers
|
|
938
|
+
|
|
939
|
+
extra_query: Add additional query parameters to the request
|
|
940
|
+
|
|
941
|
+
extra_body: Add additional JSON properties to the request
|
|
942
|
+
|
|
943
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
944
|
+
"""
|
|
945
|
+
if project_id is None:
|
|
946
|
+
project_id = self._client._get_cloud_project_id_path_param()
|
|
947
|
+
if not deployment_name:
|
|
948
|
+
raise ValueError(f"Expected a non-empty value for `deployment_name` but received {deployment_name!r}")
|
|
949
|
+
return await self._get(
|
|
950
|
+
f"/cloud/v3/inference/{project_id}/deployments/{deployment_name}/apikey",
|
|
951
|
+
options=make_request_options(
|
|
952
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
953
|
+
),
|
|
954
|
+
cast_to=InferenceApikeySecret,
|
|
955
|
+
)
|
|
956
|
+
|
|
957
|
+
async def start(
|
|
958
|
+
self,
|
|
959
|
+
deployment_name: str,
|
|
960
|
+
*,
|
|
961
|
+
project_id: int | None = None,
|
|
962
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
963
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
964
|
+
extra_headers: Headers | None = None,
|
|
965
|
+
extra_query: Query | None = None,
|
|
966
|
+
extra_body: Body | None = None,
|
|
967
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
968
|
+
) -> None:
|
|
969
|
+
"""
|
|
970
|
+
This operation initializes an inference deployment after it was stopped, making
|
|
971
|
+
it available to handle inference requests again. The instance will launch with
|
|
972
|
+
the **minimum** number of replicas defined in the scaling settings.
|
|
973
|
+
|
|
974
|
+
- If the minimum replicas are set to **0**, the instance will initially start
|
|
975
|
+
with **0** replicas.
|
|
976
|
+
- It will automatically scale up when it receives requests or SQS messages,
|
|
977
|
+
according to the configured scaling rules.
|
|
978
|
+
|
|
979
|
+
Args:
|
|
980
|
+
project_id: Project ID
|
|
981
|
+
|
|
982
|
+
deployment_name: Inference instance name.
|
|
983
|
+
|
|
984
|
+
extra_headers: Send extra headers
|
|
985
|
+
|
|
986
|
+
extra_query: Add additional query parameters to the request
|
|
987
|
+
|
|
988
|
+
extra_body: Add additional JSON properties to the request
|
|
989
|
+
|
|
990
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
991
|
+
"""
|
|
992
|
+
if project_id is None:
|
|
993
|
+
project_id = self._client._get_cloud_project_id_path_param()
|
|
994
|
+
if not deployment_name:
|
|
995
|
+
raise ValueError(f"Expected a non-empty value for `deployment_name` but received {deployment_name!r}")
|
|
996
|
+
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
|
997
|
+
return await self._post(
|
|
998
|
+
f"/cloud/v3/inference/{project_id}/deployments/{deployment_name}/start",
|
|
999
|
+
options=make_request_options(
|
|
1000
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
1001
|
+
),
|
|
1002
|
+
cast_to=NoneType,
|
|
1003
|
+
)
|
|
1004
|
+
|
|
1005
|
+
async def stop(
|
|
1006
|
+
self,
|
|
1007
|
+
deployment_name: str,
|
|
1008
|
+
*,
|
|
1009
|
+
project_id: int | None = None,
|
|
1010
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
1011
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
1012
|
+
extra_headers: Headers | None = None,
|
|
1013
|
+
extra_query: Query | None = None,
|
|
1014
|
+
extra_body: Body | None = None,
|
|
1015
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
1016
|
+
) -> None:
|
|
1017
|
+
"""
|
|
1018
|
+
This operation shuts down an inference deployment, making it unavailable for
|
|
1019
|
+
handling requests. The deployment will scale down to **0** replicas, overriding
|
|
1020
|
+
any minimum replica settings.
|
|
1021
|
+
|
|
1022
|
+
- Once stopped, the deployment will **not** process any inference requests or
|
|
1023
|
+
SQS messages.
|
|
1024
|
+
- It will **not** restart automatically and must be started manually.
|
|
1025
|
+
- While stopped, the deployment will **not** incur any charges.
|
|
1026
|
+
|
|
1027
|
+
Args:
|
|
1028
|
+
project_id: Project ID
|
|
1029
|
+
|
|
1030
|
+
deployment_name: Inference instance name.
|
|
1031
|
+
|
|
1032
|
+
extra_headers: Send extra headers
|
|
1033
|
+
|
|
1034
|
+
extra_query: Add additional query parameters to the request
|
|
1035
|
+
|
|
1036
|
+
extra_body: Add additional JSON properties to the request
|
|
1037
|
+
|
|
1038
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
1039
|
+
"""
|
|
1040
|
+
if project_id is None:
|
|
1041
|
+
project_id = self._client._get_cloud_project_id_path_param()
|
|
1042
|
+
if not deployment_name:
|
|
1043
|
+
raise ValueError(f"Expected a non-empty value for `deployment_name` but received {deployment_name!r}")
|
|
1044
|
+
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
|
1045
|
+
return await self._post(
|
|
1046
|
+
f"/cloud/v3/inference/{project_id}/deployments/{deployment_name}/stop",
|
|
1047
|
+
options=make_request_options(
|
|
1048
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
1049
|
+
),
|
|
1050
|
+
cast_to=NoneType,
|
|
1051
|
+
)
|
|
1052
|
+
|
|
1053
|
+
|
|
1054
|
+
class DeploymentsResourceWithRawResponse:
|
|
1055
|
+
def __init__(self, deployments: DeploymentsResource) -> None:
|
|
1056
|
+
self._deployments = deployments
|
|
1057
|
+
|
|
1058
|
+
self.create = to_raw_response_wrapper(
|
|
1059
|
+
deployments.create,
|
|
1060
|
+
)
|
|
1061
|
+
self.update = to_raw_response_wrapper(
|
|
1062
|
+
deployments.update,
|
|
1063
|
+
)
|
|
1064
|
+
self.list = to_raw_response_wrapper(
|
|
1065
|
+
deployments.list,
|
|
1066
|
+
)
|
|
1067
|
+
self.delete = to_raw_response_wrapper(
|
|
1068
|
+
deployments.delete,
|
|
1069
|
+
)
|
|
1070
|
+
self.get = to_raw_response_wrapper(
|
|
1071
|
+
deployments.get,
|
|
1072
|
+
)
|
|
1073
|
+
self.get_api_key = to_raw_response_wrapper(
|
|
1074
|
+
deployments.get_api_key,
|
|
1075
|
+
)
|
|
1076
|
+
self.start = to_raw_response_wrapper(
|
|
1077
|
+
deployments.start,
|
|
1078
|
+
)
|
|
1079
|
+
self.stop = to_raw_response_wrapper(
|
|
1080
|
+
deployments.stop,
|
|
1081
|
+
)
|
|
1082
|
+
|
|
1083
|
+
@cached_property
|
|
1084
|
+
def logs(self) -> LogsResourceWithRawResponse:
|
|
1085
|
+
return LogsResourceWithRawResponse(self._deployments.logs)
|
|
1086
|
+
|
|
1087
|
+
|
|
1088
|
+
class AsyncDeploymentsResourceWithRawResponse:
|
|
1089
|
+
def __init__(self, deployments: AsyncDeploymentsResource) -> None:
|
|
1090
|
+
self._deployments = deployments
|
|
1091
|
+
|
|
1092
|
+
self.create = async_to_raw_response_wrapper(
|
|
1093
|
+
deployments.create,
|
|
1094
|
+
)
|
|
1095
|
+
self.update = async_to_raw_response_wrapper(
|
|
1096
|
+
deployments.update,
|
|
1097
|
+
)
|
|
1098
|
+
self.list = async_to_raw_response_wrapper(
|
|
1099
|
+
deployments.list,
|
|
1100
|
+
)
|
|
1101
|
+
self.delete = async_to_raw_response_wrapper(
|
|
1102
|
+
deployments.delete,
|
|
1103
|
+
)
|
|
1104
|
+
self.get = async_to_raw_response_wrapper(
|
|
1105
|
+
deployments.get,
|
|
1106
|
+
)
|
|
1107
|
+
self.get_api_key = async_to_raw_response_wrapper(
|
|
1108
|
+
deployments.get_api_key,
|
|
1109
|
+
)
|
|
1110
|
+
self.start = async_to_raw_response_wrapper(
|
|
1111
|
+
deployments.start,
|
|
1112
|
+
)
|
|
1113
|
+
self.stop = async_to_raw_response_wrapper(
|
|
1114
|
+
deployments.stop,
|
|
1115
|
+
)
|
|
1116
|
+
|
|
1117
|
+
@cached_property
|
|
1118
|
+
def logs(self) -> AsyncLogsResourceWithRawResponse:
|
|
1119
|
+
return AsyncLogsResourceWithRawResponse(self._deployments.logs)
|
|
1120
|
+
|
|
1121
|
+
|
|
1122
|
+
class DeploymentsResourceWithStreamingResponse:
|
|
1123
|
+
def __init__(self, deployments: DeploymentsResource) -> None:
|
|
1124
|
+
self._deployments = deployments
|
|
1125
|
+
|
|
1126
|
+
self.create = to_streamed_response_wrapper(
|
|
1127
|
+
deployments.create,
|
|
1128
|
+
)
|
|
1129
|
+
self.update = to_streamed_response_wrapper(
|
|
1130
|
+
deployments.update,
|
|
1131
|
+
)
|
|
1132
|
+
self.list = to_streamed_response_wrapper(
|
|
1133
|
+
deployments.list,
|
|
1134
|
+
)
|
|
1135
|
+
self.delete = to_streamed_response_wrapper(
|
|
1136
|
+
deployments.delete,
|
|
1137
|
+
)
|
|
1138
|
+
self.get = to_streamed_response_wrapper(
|
|
1139
|
+
deployments.get,
|
|
1140
|
+
)
|
|
1141
|
+
self.get_api_key = to_streamed_response_wrapper(
|
|
1142
|
+
deployments.get_api_key,
|
|
1143
|
+
)
|
|
1144
|
+
self.start = to_streamed_response_wrapper(
|
|
1145
|
+
deployments.start,
|
|
1146
|
+
)
|
|
1147
|
+
self.stop = to_streamed_response_wrapper(
|
|
1148
|
+
deployments.stop,
|
|
1149
|
+
)
|
|
1150
|
+
|
|
1151
|
+
@cached_property
|
|
1152
|
+
def logs(self) -> LogsResourceWithStreamingResponse:
|
|
1153
|
+
return LogsResourceWithStreamingResponse(self._deployments.logs)
|
|
1154
|
+
|
|
1155
|
+
|
|
1156
|
+
class AsyncDeploymentsResourceWithStreamingResponse:
|
|
1157
|
+
def __init__(self, deployments: AsyncDeploymentsResource) -> None:
|
|
1158
|
+
self._deployments = deployments
|
|
1159
|
+
|
|
1160
|
+
self.create = async_to_streamed_response_wrapper(
|
|
1161
|
+
deployments.create,
|
|
1162
|
+
)
|
|
1163
|
+
self.update = async_to_streamed_response_wrapper(
|
|
1164
|
+
deployments.update,
|
|
1165
|
+
)
|
|
1166
|
+
self.list = async_to_streamed_response_wrapper(
|
|
1167
|
+
deployments.list,
|
|
1168
|
+
)
|
|
1169
|
+
self.delete = async_to_streamed_response_wrapper(
|
|
1170
|
+
deployments.delete,
|
|
1171
|
+
)
|
|
1172
|
+
self.get = async_to_streamed_response_wrapper(
|
|
1173
|
+
deployments.get,
|
|
1174
|
+
)
|
|
1175
|
+
self.get_api_key = async_to_streamed_response_wrapper(
|
|
1176
|
+
deployments.get_api_key,
|
|
1177
|
+
)
|
|
1178
|
+
self.start = async_to_streamed_response_wrapper(
|
|
1179
|
+
deployments.start,
|
|
1180
|
+
)
|
|
1181
|
+
self.stop = async_to_streamed_response_wrapper(
|
|
1182
|
+
deployments.stop,
|
|
1183
|
+
)
|
|
1184
|
+
|
|
1185
|
+
@cached_property
|
|
1186
|
+
def logs(self) -> AsyncLogsResourceWithStreamingResponse:
|
|
1187
|
+
return AsyncLogsResourceWithStreamingResponse(self._deployments.logs)
|