render 1.0.1__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.
- render/__init__.py +98 -0
- render/client/__init__.py +119 -0
- render/client/client.py +110 -0
- render/client/errors.py +39 -0
- render/client/sse.py +90 -0
- render/client/sse_sync.py +20 -0
- render/client/tests/__init__.py +0 -0
- render/client/tests/test_client.py +379 -0
- render/client/tests/test_method_parity.py +118 -0
- render/client/tests/test_render.py +52 -0
- render/client/tests/test_sse.py +67 -0
- render/client/tests/test_util.py +303 -0
- render/client/tests/test_util_sync.py +73 -0
- render/client/tests/test_workflows_sync.py +313 -0
- render/client/types.py +52 -0
- render/client/util.py +285 -0
- render/client/util_sync.py +83 -0
- render/client/workflows.py +363 -0
- render/client/workflows_sync.py +298 -0
- render/experimental/__init__.py +37 -0
- render/experimental/experimental.py +93 -0
- render/experimental/experimental_sync.py +78 -0
- render/experimental/key_value/__init__.py +33 -0
- render/experimental/key_value/api.py +243 -0
- render/experimental/key_value/compare.py +83 -0
- render/experimental/key_value/provider.py +285 -0
- render/experimental/key_value/tests/__init__.py +0 -0
- render/experimental/key_value/tests/test_api.py +371 -0
- render/experimental/key_value/tests/test_compare.py +136 -0
- render/experimental/key_value/tests/test_provider.py +1016 -0
- render/experimental/key_value/types.py +130 -0
- render/experimental/key_value/utils.py +11 -0
- render/experimental/object/__init__.py +38 -0
- render/experimental/object/api.py +250 -0
- render/experimental/object/api_sync.py +250 -0
- render/experimental/object/client.py +545 -0
- render/experimental/object/client_sync.py +547 -0
- render/experimental/object/e2e_helpers.py +78 -0
- render/experimental/object/tests/__init__.py +0 -0
- render/experimental/object/tests/test_client.py +228 -0
- render/experimental/object/tests/test_e2e.py +125 -0
- render/experimental/object/types.py +87 -0
- render/experimental/sandbox/__init__.py +31 -0
- render/experimental/sandbox/_tar.py +278 -0
- render/experimental/sandbox/api.py +518 -0
- render/experimental/sandbox/api_sync.py +514 -0
- render/experimental/sandbox/client.py +168 -0
- render/experimental/sandbox/client_sync.py +170 -0
- render/experimental/sandbox/errors.py +37 -0
- render/experimental/sandbox/files.py +378 -0
- render/experimental/sandbox/tests/__init__.py +0 -0
- render/experimental/sandbox/tests/test_client.py +802 -0
- render/experimental/sandbox/tests/test_download.py +728 -0
- render/experimental/sandbox/tests/test_e2e.py +252 -0
- render/experimental/sandbox/tests/test_tar.py +153 -0
- render/experimental/sandbox/tests/test_types.py +57 -0
- render/experimental/sandbox/types.py +46 -0
- render/public_api/__init__.py +8 -0
- render/public_api/api/__init__.py +1 -0
- render/public_api/api/artifact_sources/__init__.py +1 -0
- render/public_api/api/artifact_sources/add_or_update_artifact_source_secret_file.py +252 -0
- render/public_api/api/artifact_sources/create_artifact_source.py +243 -0
- render/public_api/api/artifact_sources/delete_artifact_source.py +188 -0
- render/public_api/api/artifact_sources/delete_artifact_source_env_var.py +223 -0
- render/public_api/api/artifact_sources/delete_artifact_source_secret_file.py +223 -0
- render/public_api/api/artifact_sources/get_artifact_source.py +185 -0
- render/public_api/api/artifact_sources/get_env_vars_for_artifact_source.py +241 -0
- render/public_api/api/artifact_sources/link_artifact_source_to_env_group.py +215 -0
- render/public_api/api/artifact_sources/list_artifact_sources.py +338 -0
- render/public_api/api/artifact_sources/list_artifacts_in_artifact_source.py +241 -0
- render/public_api/api/artifact_sources/list_secret_files_for_artifact_source.py +241 -0
- render/public_api/api/artifact_sources/retrieve_artifact_source_env_var.py +225 -0
- render/public_api/api/artifact_sources/retrieve_artifact_source_secret_file.py +225 -0
- render/public_api/api/artifact_sources/unlink_artifact_source_from_env_group.py +209 -0
- render/public_api/api/artifact_sources/update_artifact_source.py +244 -0
- render/public_api/api/artifact_sources/update_artifact_source_env_var.py +257 -0
- render/public_api/api/artifact_sources/update_env_vars_for_artifact_source.py +245 -0
- render/public_api/api/artifact_sources/update_secret_files_for_artifact_source.py +255 -0
- render/public_api/api/audit_logs/__init__.py +1 -0
- render/public_api/api/audit_logs/list_organization_audit_logs.py +303 -0
- render/public_api/api/audit_logs/list_owner_audit_logs.py +303 -0
- render/public_api/api/blueprints/__init__.py +1 -0
- render/public_api/api/blueprints/disconnect_blueprint.py +210 -0
- render/public_api/api/blueprints/list_blueprint_syncs.py +241 -0
- render/public_api/api/blueprints/list_blueprints.py +251 -0
- render/public_api/api/blueprints/retrieve_blueprint.py +200 -0
- render/public_api/api/blueprints/update_blueprint.py +222 -0
- render/public_api/api/blueprints/validate_blueprint.py +217 -0
- render/public_api/api/custom_domains/__init__.py +1 -0
- render/public_api/api/custom_domains/create_custom_domain.py +242 -0
- render/public_api/api/custom_domains/delete_custom_domain.py +216 -0
- render/public_api/api/custom_domains/list_custom_domains.py +346 -0
- render/public_api/api/custom_domains/refresh_custom_domain.py +216 -0
- render/public_api/api/custom_domains/retrieve_custom_domain.py +218 -0
- render/public_api/api/dedicated_i_ps/__init__.py +1 -0
- render/public_api/api/dedicated_i_ps/create_dedicated_ip.py +234 -0
- render/public_api/api/dedicated_i_ps/delete_dedicated_ip.py +198 -0
- render/public_api/api/dedicated_i_ps/list_dedicated_ips.py +223 -0
- render/public_api/api/dedicated_i_ps/retrieve_dedicated_ip.py +200 -0
- render/public_api/api/dedicated_i_ps/update_dedicated_ip.py +244 -0
- render/public_api/api/deploys/__init__.py +1 -0
- render/public_api/api/deploys/cancel_deploy.py +216 -0
- render/public_api/api/deploys/create_deploy.py +231 -0
- render/public_api/api/deploys/list_deploys.py +377 -0
- render/public_api/api/deploys/retrieve_deploy.py +213 -0
- render/public_api/api/deploys/rollback_deploy.py +241 -0
- render/public_api/api/disks/__init__.py +1 -0
- render/public_api/api/disks/add_disk.py +222 -0
- render/public_api/api/disks/delete_disk.py +210 -0
- render/public_api/api/disks/list_disks.py +381 -0
- render/public_api/api/disks/list_snapshots.py +214 -0
- render/public_api/api/disks/restore_snapshot.py +255 -0
- render/public_api/api/disks/retrieve_disk.py +200 -0
- render/public_api/api/disks/update_disk.py +243 -0
- render/public_api/api/environment_groups/__init__.py +1 -0
- render/public_api/api/environment_groups/create_env_group.py +199 -0
- render/public_api/api/environment_groups/delete_env_group.py +192 -0
- render/public_api/api/environment_groups/delete_env_group_env_var.py +201 -0
- render/public_api/api/environment_groups/delete_env_group_secret_file.py +201 -0
- render/public_api/api/environment_groups/link_service_to_env_group.py +211 -0
- render/public_api/api/environment_groups/list_env_groups.py +352 -0
- render/public_api/api/environment_groups/retrieve_env_group.py +190 -0
- render/public_api/api/environment_groups/retrieve_env_group_env_var.py +203 -0
- render/public_api/api/environment_groups/retrieve_env_group_secret_file.py +203 -0
- render/public_api/api/environment_groups/unlink_service_from_env_group.py +209 -0
- render/public_api/api/environment_groups/update_env_group.py +212 -0
- render/public_api/api/environment_groups/update_env_group_env_var.py +230 -0
- render/public_api/api/environment_groups/update_env_group_secret_file.py +225 -0
- render/public_api/api/events/__init__.py +1 -0
- render/public_api/api/events/retrieve_event.py +205 -0
- render/public_api/api/key_value/__init__.py +1 -0
- render/public_api/api/key_value/create_key_value.py +199 -0
- render/public_api/api/key_value/delete_key_value.py +188 -0
- render/public_api/api/key_value/list_key_value.py +380 -0
- render/public_api/api/key_value/resume_key_value.py +203 -0
- render/public_api/api/key_value/retrieve_key_value.py +190 -0
- render/public_api/api/key_value/retrieve_key_value_connection_info.py +194 -0
- render/public_api/api/key_value/suspend_key_value.py +203 -0
- render/public_api/api/key_value/update_key_value.py +221 -0
- render/public_api/api/logs/__init__.py +1 -0
- render/public_api/api/logs/delete_owner_log_stream.py +188 -0
- render/public_api/api/logs/delete_resource_log_stream.py +192 -0
- render/public_api/api/logs/get_owner_log_stream.py +205 -0
- render/public_api/api/logs/get_resource_log_stream.py +209 -0
- render/public_api/api/logs/list_logs.py +535 -0
- render/public_api/api/logs/list_logs_values.py +527 -0
- render/public_api/api/logs/list_resource_log_streams.py +317 -0
- render/public_api/api/logs/subscribe_logs.py +527 -0
- render/public_api/api/logs/update_owner_log_stream.py +231 -0
- render/public_api/api/logs/update_resource_log_stream.py +231 -0
- render/public_api/api/maintenance/__init__.py +1 -0
- render/public_api/api/maintenance/list_maintenance.py +249 -0
- render/public_api/api/maintenance/retrieve_maintenance.py +190 -0
- render/public_api/api/maintenance/trigger_maintenance.py +212 -0
- render/public_api/api/maintenance/update_maintenance.py +222 -0
- render/public_api/api/metrics/__init__.py +1 -0
- render/public_api/api/metrics/delete_owner_metrics_stream.py +172 -0
- render/public_api/api/metrics/get_active_connections.py +237 -0
- render/public_api/api/metrics/get_bandwidth.py +237 -0
- render/public_api/api/metrics/get_bandwidth_sources.py +250 -0
- render/public_api/api/metrics/get_cpu.py +287 -0
- render/public_api/api/metrics/get_cpu_limit.py +267 -0
- render/public_api/api/metrics/get_cpu_target.py +267 -0
- render/public_api/api/metrics/get_disk_capacity.py +252 -0
- render/public_api/api/metrics/get_disk_usage.py +252 -0
- render/public_api/api/metrics/get_http_latency.py +297 -0
- render/public_api/api/metrics/get_http_requests.py +302 -0
- render/public_api/api/metrics/get_instance_count.py +252 -0
- render/public_api/api/metrics/get_memory.py +267 -0
- render/public_api/api/metrics/get_memory_limit.py +267 -0
- render/public_api/api/metrics/get_memory_target.py +267 -0
- render/public_api/api/metrics/get_owner_metrics_stream.py +174 -0
- render/public_api/api/metrics/get_replication_lag.py +237 -0
- render/public_api/api/metrics/get_task_runs_completed.py +281 -0
- render/public_api/api/metrics/get_task_runs_queued.py +237 -0
- render/public_api/api/metrics/list_application_filter_values.py +254 -0
- render/public_api/api/metrics/list_http_filter_values.py +282 -0
- render/public_api/api/metrics/list_path_filter_values.py +289 -0
- render/public_api/api/metrics/upsert_owner_metrics_stream.py +192 -0
- render/public_api/api/notification_settings/__init__.py +1 -0
- render/public_api/api/notification_settings/list_notification_overrides.py +255 -0
- render/public_api/api/notification_settings/patch_owner_notification_settings.py +207 -0
- render/public_api/api/notification_settings/patch_service_notification_overrides.py +207 -0
- render/public_api/api/notification_settings/retrieve_owner_notification_settings.py +193 -0
- render/public_api/api/notification_settings/retrieve_service_notification_overrides.py +193 -0
- render/public_api/api/object_storage/__init__.py +1 -0
- render/public_api/api/object_storage/delete_object.py +215 -0
- render/public_api/api/object_storage/get_object.py +221 -0
- render/public_api/api/object_storage/list_objects.py +240 -0
- render/public_api/api/object_storage/put_object.py +248 -0
- render/public_api/api/one_off_jobs/__init__.py +1 -0
- render/public_api/api/one_off_jobs/cancel_job.py +203 -0
- render/public_api/api/one_off_jobs/list_job.py +367 -0
- render/public_api/api/one_off_jobs/post_job.py +216 -0
- render/public_api/api/one_off_jobs/retrieve_job.py +203 -0
- render/public_api/api/postgres/__init__.py +1 -0
- render/public_api/api/postgres/create_postgres.py +199 -0
- render/public_api/api/postgres/create_postgres_export.py +207 -0
- render/public_api/api/postgres/create_postgres_user.py +229 -0
- render/public_api/api/postgres/delete_postgres.py +192 -0
- render/public_api/api/postgres/delete_postgres_user.py +201 -0
- render/public_api/api/postgres/failover_postgres.py +207 -0
- render/public_api/api/postgres/list_available_postgres_parameter_overrides.py +190 -0
- render/public_api/api/postgres/list_postgres.py +418 -0
- render/public_api/api/postgres/list_postgres_export.py +199 -0
- render/public_api/api/postgres/list_postgres_parameter_overrides.py +190 -0
- render/public_api/api/postgres/list_postgres_processes.py +190 -0
- render/public_api/api/postgres/list_postgres_sizes.py +190 -0
- render/public_api/api/postgres/list_postgres_table_scans.py +190 -0
- render/public_api/api/postgres/list_postgres_top_queries.py +194 -0
- render/public_api/api/postgres/list_postgres_users.py +195 -0
- render/public_api/api/postgres/promote_postgres.py +203 -0
- render/public_api/api/postgres/recover_postgres.py +231 -0
- render/public_api/api/postgres/restart_postgres.py +203 -0
- render/public_api/api/postgres/resume_postgres.py +203 -0
- render/public_api/api/postgres/retrieve_postgres.py +190 -0
- render/public_api/api/postgres/retrieve_postgres_connection_info.py +194 -0
- render/public_api/api/postgres/retrieve_postgres_recovery_info.py +194 -0
- render/public_api/api/postgres/setup_postgres_replication.py +231 -0
- render/public_api/api/postgres/suspend_postgres.py +203 -0
- render/public_api/api/postgres/update_postgres.py +217 -0
- render/public_api/api/postgres/update_postgres_parameter_overrides.py +217 -0
- render/public_api/api/projects_environments/__init__.py +1 -0
- render/public_api/api/projects_environments/add_resources_to_environment.py +212 -0
- render/public_api/api/projects_environments/create_environment.py +199 -0
- render/public_api/api/projects_environments/create_project.py +199 -0
- render/public_api/api/projects_environments/delete_environment.py +216 -0
- render/public_api/api/projects_environments/delete_project.py +216 -0
- render/public_api/api/projects_environments/list_environments.py +369 -0
- render/public_api/api/projects_environments/list_projects.py +329 -0
- render/public_api/api/projects_environments/remove_resources_from_environment.py +211 -0
- render/public_api/api/projects_environments/retrieve_environment.py +190 -0
- render/public_api/api/projects_environments/retrieve_project.py +190 -0
- render/public_api/api/projects_environments/update_environment.py +212 -0
- render/public_api/api/projects_environments/update_project.py +224 -0
- render/public_api/api/redis_deprecated/__init__.py +1 -0
- render/public_api/api/redis_deprecated/create_redis.py +199 -0
- render/public_api/api/redis_deprecated/delete_redis.py +188 -0
- render/public_api/api/redis_deprecated/list_redis.py +384 -0
- render/public_api/api/redis_deprecated/resume_redis.py +203 -0
- render/public_api/api/redis_deprecated/retrieve_redis.py +190 -0
- render/public_api/api/redis_deprecated/retrieve_redis_connection_info.py +194 -0
- render/public_api/api/redis_deprecated/suspend_redis.py +203 -0
- render/public_api/api/redis_deprecated/update_redis.py +217 -0
- render/public_api/api/registry_credentials/__init__.py +1 -0
- render/public_api/api/registry_credentials/create_registry_credential.py +209 -0
- render/public_api/api/registry_credentials/delete_registry_credential.py +198 -0
- render/public_api/api/registry_credentials/list_registry_credentials.py +370 -0
- render/public_api/api/registry_credentials/retrieve_registry_credential.py +200 -0
- render/public_api/api/registry_credentials/update_registry_credential.py +241 -0
- render/public_api/api/sandboxes/__init__.py +1 -0
- render/public_api/api/sandboxes/connect_sandbox_files.py +281 -0
- render/public_api/api/sandboxes/connect_sandbox_run.py +271 -0
- render/public_api/api/sandboxes/create_sandbox.py +199 -0
- render/public_api/api/sandboxes/list_sandbox_files.py +244 -0
- render/public_api/api/sandboxes/list_sandbox_groups.py +216 -0
- render/public_api/api/sandboxes/list_sandboxes.py +269 -0
- render/public_api/api/sandboxes/retrieve_sandbox.py +211 -0
- render/public_api/api/sandboxes/retrieve_sandbox_execution.py +224 -0
- render/public_api/api/sandboxes/stream_sandbox_logs.py +274 -0
- render/public_api/api/sandboxes/terminate_sandbox.py +217 -0
- render/public_api/api/sandboxes/update_sandbox_exec.py +258 -0
- render/public_api/api/services/__init__.py +1 -0
- render/public_api/api/services/add_or_update_secret_file.py +252 -0
- render/public_api/api/services/autoscale_service.py +230 -0
- render/public_api/api/services/create_ephemeral_shell.py +217 -0
- render/public_api/api/services/create_service.py +204 -0
- render/public_api/api/services/delete_autoscaling_config.py +198 -0
- render/public_api/api/services/delete_env_var.py +223 -0
- render/public_api/api/services/delete_secret_file.py +223 -0
- render/public_api/api/services/delete_service.py +198 -0
- render/public_api/api/services/get_env_vars_for_service.py +241 -0
- render/public_api/api/services/list_events.py +288 -0
- render/public_api/api/services/list_instances.py +190 -0
- render/public_api/api/services/list_secret_files_for_service.py +241 -0
- render/public_api/api/services/list_services.py +439 -0
- render/public_api/api/services/preview_service.py +227 -0
- render/public_api/api/services/purge_cache.py +203 -0
- render/public_api/api/services/restart_service.py +211 -0
- render/public_api/api/services/resume_service.py +203 -0
- render/public_api/api/services/retrieve_env_var.py +225 -0
- render/public_api/api/services/retrieve_secret_file.py +225 -0
- render/public_api/api/services/retrieve_service.py +190 -0
- render/public_api/api/services/retrieve_service_outbound_ips.py +207 -0
- render/public_api/api/services/scale_service.py +237 -0
- render/public_api/api/services/suspend_service.py +203 -0
- render/public_api/api/services/update_env_var.py +257 -0
- render/public_api/api/services/update_env_vars_for_service.py +241 -0
- render/public_api/api/services/update_secret_files_for_service.py +255 -0
- render/public_api/api/services/update_service.py +227 -0
- render/public_api/api/services_cron_jobs/__init__.py +1 -0
- render/public_api/api/services_cron_jobs/cancel_cron_job_run.py +183 -0
- render/public_api/api/services_cron_jobs/run_cron_job.py +185 -0
- render/public_api/api/services_headers/__init__.py +1 -0
- render/public_api/api/services_headers/add_headers.py +222 -0
- render/public_api/api/services_headers/delete_header.py +211 -0
- render/public_api/api/services_headers/list_headers.py +302 -0
- render/public_api/api/services_headers/update_headers.py +243 -0
- render/public_api/api/services_routes/__init__.py +1 -0
- render/public_api/api/services_routes/add_route.py +227 -0
- render/public_api/api/services_routes/delete_route.py +211 -0
- render/public_api/api/services_routes/list_routes.py +306 -0
- render/public_api/api/services_routes/patch_route.py +259 -0
- render/public_api/api/services_routes/put_routes.py +259 -0
- render/public_api/api/users/__init__.py +1 -0
- render/public_api/api/users/get_user.py +161 -0
- render/public_api/api/webhooks/__init__.py +1 -0
- render/public_api/api/webhooks/create_webhook.py +199 -0
- render/public_api/api/webhooks/delete_webhook.py +183 -0
- render/public_api/api/webhooks/list_webhook_events.py +268 -0
- render/public_api/api/webhooks/list_webhooks.py +237 -0
- render/public_api/api/webhooks/retrieve_webhook.py +185 -0
- render/public_api/api/webhooks/update_webhook.py +212 -0
- render/public_api/api/workflow_tasks_beta/__init__.py +1 -0
- render/public_api/api/workflow_tasks_beta/cancel_task_run.py +188 -0
- render/public_api/api/workflow_tasks_beta/create_task.py +204 -0
- render/public_api/api/workflow_tasks_beta/get_task.py +190 -0
- render/public_api/api/workflow_tasks_beta/get_task_run.py +190 -0
- render/public_api/api/workflow_tasks_beta/list_task_runs.py +317 -0
- render/public_api/api/workflow_tasks_beta/list_tasks.py +298 -0
- render/public_api/api/workflow_tasks_beta/stream_task_runs_events.py +230 -0
- render/public_api/api/workflows_beta/__init__.py +1 -0
- render/public_api/api/workflows_beta/create_workflow.py +199 -0
- render/public_api/api/workflows_beta/create_workflow_version.py +197 -0
- render/public_api/api/workflows_beta/delete_workflow.py +188 -0
- render/public_api/api/workflows_beta/get_workflow.py +190 -0
- render/public_api/api/workflows_beta/get_workflow_version.py +190 -0
- render/public_api/api/workflows_beta/list_workflow_versions.py +275 -0
- render/public_api/api/workflows_beta/list_workflows.py +298 -0
- render/public_api/api/workflows_beta/update_workflow.py +212 -0
- render/public_api/api/workspaces/__init__.py +1 -0
- render/public_api/api/workspaces/list_owners.py +255 -0
- render/public_api/api/workspaces/remove_workspace_member.py +206 -0
- render/public_api/api/workspaces/retrieve_owner.py +207 -0
- render/public_api/api/workspaces/retrieve_owner_members.py +200 -0
- render/public_api/api/workspaces/update_workspace_member.py +235 -0
- render/public_api/client.py +268 -0
- render/public_api/errors.py +16 -0
- render/public_api/models/__init__.py +861 -0
- render/public_api/models/add_headers_response_201.py +72 -0
- render/public_api/models/add_or_update_artifact_source_secret_file_body.py +59 -0
- render/public_api/models/add_or_update_secret_file_body.py +59 -0
- render/public_api/models/artifact.py +145 -0
- render/public_api/models/artifact_fetch_failed.py +67 -0
- render/public_api/models/artifact_source.py +162 -0
- render/public_api/models/artifact_source_changed.py +70 -0
- render/public_api/models/artifact_source_git.py +167 -0
- render/public_api/models/artifact_source_git_region.py +12 -0
- render/public_api/models/artifact_source_git_runtime.py +14 -0
- render/public_api/models/artifact_source_image.py +78 -0
- render/public_api/models/artifact_source_patch_git.py +175 -0
- render/public_api/models/artifact_source_patch_git_region.py +12 -0
- render/public_api/models/artifact_source_patch_git_runtime.py +14 -0
- render/public_api/models/artifact_source_patch_image.py +71 -0
- render/public_api/models/artifact_source_patch_input.py +101 -0
- render/public_api/models/artifact_source_post_input.py +213 -0
- render/public_api/models/artifact_source_service_link.py +67 -0
- render/public_api/models/artifact_source_with_cursor.py +73 -0
- render/public_api/models/audit_log.py +113 -0
- render/public_api/models/audit_log_actor.py +80 -0
- render/public_api/models/audit_log_actor_type.py +10 -0
- render/public_api/models/audit_log_event.py +87 -0
- render/public_api/models/audit_log_metadata.py +49 -0
- render/public_api/models/audit_log_status.py +9 -0
- render/public_api/models/audit_log_with_cursor.py +73 -0
- render/public_api/models/auto_deploy.py +9 -0
- render/public_api/models/auto_deploy_disabled.py +79 -0
- render/public_api/models/auto_deploy_enabled.py +68 -0
- render/public_api/models/auto_deploy_trigger.py +10 -0
- render/public_api/models/autoscaling_config.py +89 -0
- render/public_api/models/autoscaling_config_changed.py +83 -0
- render/public_api/models/autoscaling_criteria.py +73 -0
- render/public_api/models/autoscaling_criteria_percentage.py +68 -0
- render/public_api/models/autoscaling_ended.py +67 -0
- render/public_api/models/autoscaling_started.py +105 -0
- render/public_api/models/background_worker_details.py +256 -0
- render/public_api/models/background_worker_details_patch.py +184 -0
- render/public_api/models/background_worker_details_post.py +266 -0
- render/public_api/models/blueprint.py +128 -0
- render/public_api/models/blueprint_detail.py +150 -0
- render/public_api/models/blueprint_patch.py +77 -0
- render/public_api/models/blueprint_with_cursor.py +74 -0
- render/public_api/models/branch_deleted.py +67 -0
- render/public_api/models/build.py +148 -0
- render/public_api/models/build_config.py +96 -0
- render/public_api/models/build_deploy_end_reason.py +122 -0
- render/public_api/models/build_deploy_end_reason_id.py +59 -0
- render/public_api/models/build_deploy_trigger.py +150 -0
- render/public_api/models/build_ended.py +91 -0
- render/public_api/models/build_filter.py +67 -0
- render/public_api/models/build_plan.py +9 -0
- render/public_api/models/build_runtime.py +14 -0
- render/public_api/models/build_started.py +73 -0
- render/public_api/models/build_status.py +13 -0
- render/public_api/models/cache.py +61 -0
- render/public_api/models/cache_profile.py +10 -0
- render/public_api/models/cidr_block_and_description.py +67 -0
- render/public_api/models/commit_ignored.py +67 -0
- render/public_api/models/commit_ref.py +59 -0
- render/public_api/models/connect_sandbox_files_operation.py +9 -0
- render/public_api/models/connect_sandbox_run_operation.py +9 -0
- render/public_api/models/create_custom_domain_body.py +59 -0
- render/public_api/models/create_deploy_body.py +130 -0
- render/public_api/models/create_deploy_body_clear_cache.py +9 -0
- render/public_api/models/create_ephemeral_shell_body.py +69 -0
- render/public_api/models/create_ephemeral_shell_response_201.py +59 -0
- render/public_api/models/create_registry_credential_body.py +93 -0
- render/public_api/models/create_version.py +70 -0
- render/public_api/models/credential_create_input.py +59 -0
- render/public_api/models/cron_job_details.py +163 -0
- render/public_api/models/cron_job_details_patch.py +138 -0
- render/public_api/models/cron_job_details_post.py +172 -0
- render/public_api/models/cron_job_run.py +123 -0
- render/public_api/models/cron_job_run_ended.py +110 -0
- render/public_api/models/cron_job_run_started.py +59 -0
- render/public_api/models/cron_job_run_status.py +11 -0
- render/public_api/models/custom_domain.py +135 -0
- render/public_api/models/custom_domain_domain_type.py +9 -0
- render/public_api/models/custom_domain_server.py +68 -0
- render/public_api/models/custom_domain_verification_status.py +9 -0
- render/public_api/models/custom_domain_with_cursor.py +73 -0
- render/public_api/models/database_role.py +9 -0
- render/public_api/models/database_status.py +18 -0
- render/public_api/models/dedicated_ip.py +146 -0
- render/public_api/models/dedicated_ip_status.py +14 -0
- render/public_api/models/dedicated_ippatch.py +81 -0
- render/public_api/models/dedicated_ippost.py +100 -0
- render/public_api/models/deploy.py +211 -0
- render/public_api/models/deploy_commit.py +86 -0
- render/public_api/models/deploy_ended.py +102 -0
- render/public_api/models/deploy_image.py +78 -0
- render/public_api/models/deploy_mode.py +9 -0
- render/public_api/models/deploy_started.py +85 -0
- render/public_api/models/deploy_status.py +18 -0
- render/public_api/models/deploy_trigger.py +17 -0
- render/public_api/models/deploy_with_cursor.py +81 -0
- render/public_api/models/disk.py +83 -0
- render/public_api/models/disk_created.py +67 -0
- render/public_api/models/disk_deleted.py +59 -0
- render/public_api/models/disk_details.py +112 -0
- render/public_api/models/disk_patch.py +77 -0
- render/public_api/models/disk_post.py +83 -0
- render/public_api/models/disk_snapshot.py +88 -0
- render/public_api/models/disk_updated.py +75 -0
- render/public_api/models/disk_with_cursor.py +73 -0
- render/public_api/models/docker_details.py +108 -0
- render/public_api/models/docker_details_patch.py +86 -0
- render/public_api/models/docker_details_post.py +86 -0
- render/public_api/models/edge_cache_disabled.py +65 -0
- render/public_api/models/edge_cache_enabled.py +65 -0
- render/public_api/models/edge_cache_purged.py +65 -0
- render/public_api/models/edge_cache_trigger.py +91 -0
- render/public_api/models/env_group.py +162 -0
- render/public_api/models/env_group_link.py +77 -0
- render/public_api/models/env_group_meta.py +126 -0
- render/public_api/models/env_group_patch_input.py +59 -0
- render/public_api/models/env_group_post_input.py +161 -0
- render/public_api/models/env_var.py +67 -0
- render/public_api/models/env_var_generate_value.py +59 -0
- render/public_api/models/env_var_key_generate_value.py +68 -0
- render/public_api/models/env_var_key_value.py +67 -0
- render/public_api/models/env_var_value.py +59 -0
- render/public_api/models/env_var_with_cursor.py +73 -0
- render/public_api/models/environment.py +152 -0
- render/public_api/models/environment_patch_input.py +112 -0
- render/public_api/models/environment_post_input.py +122 -0
- render/public_api/models/environment_resources_post_input.py +59 -0
- render/public_api/models/environment_with_cursor.py +74 -0
- render/public_api/models/error.py +79 -0
- render/public_api/models/error_code.py +10 -0
- render/public_api/models/event.py +1122 -0
- render/public_api/models/event_status.py +10 -0
- render/public_api/models/event_type.py +74 -0
- render/public_api/models/execution.py +144 -0
- render/public_api/models/execution_operation.py +11 -0
- render/public_api/models/execution_type.py +9 -0
- render/public_api/models/failure_reason.py +138 -0
- render/public_api/models/filter_application_values_collection_item.py +78 -0
- render/public_api/models/filter_application_values_collection_item_filter.py +8 -0
- render/public_api/models/filter_http_values_collection_item.py +78 -0
- render/public_api/models/filter_http_values_collection_item_filter.py +9 -0
- render/public_api/models/get_bandwidth_sources_response_200.py +75 -0
- render/public_api/models/get_bandwidth_sources_response_200_data_item.py +101 -0
- render/public_api/models/get_bandwidth_sources_response_200_data_item_labels.py +78 -0
- render/public_api/models/get_bandwidth_sources_response_200_data_item_labels_traffic_source.py +12 -0
- render/public_api/models/get_bandwidth_sources_response_200_data_item_values_item.py +68 -0
- render/public_api/models/get_cpu_aggregation_method.py +10 -0
- render/public_api/models/get_http_requests_aggregate_by.py +9 -0
- render/public_api/models/get_object_output.py +71 -0
- render/public_api/models/get_task_runs_completed_aggregate_by.py +8 -0
- render/public_api/models/get_task_runs_completed_state.py +9 -0
- render/public_api/models/header.py +83 -0
- render/public_api/models/header_input.py +76 -0
- render/public_api/models/header_with_cursor.py +73 -0
- render/public_api/models/image.py +80 -0
- render/public_api/models/image_pull_failed.py +67 -0
- render/public_api/models/initial_deploy_hook_ended.py +59 -0
- render/public_api/models/initial_deploy_hook_started.py +59 -0
- render/public_api/models/instance_count_changed.py +67 -0
- render/public_api/models/instance_type_changed.py +67 -0
- render/public_api/models/internal_routing.py +8 -0
- render/public_api/models/job.py +144 -0
- render/public_api/models/job_run_ended.py +92 -0
- render/public_api/models/job_status.py +12 -0
- render/public_api/models/job_with_cursor.py +73 -0
- render/public_api/models/key_value.py +182 -0
- render/public_api/models/key_value_available.py +44 -0
- render/public_api/models/key_value_config_restart.py +67 -0
- render/public_api/models/key_value_connection_info.py +76 -0
- render/public_api/models/key_value_detail.py +192 -0
- render/public_api/models/key_value_options.py +79 -0
- render/public_api/models/key_value_patch_input.py +138 -0
- render/public_api/models/key_value_plan.py +13 -0
- render/public_api/models/key_value_post_input.py +166 -0
- render/public_api/models/key_value_unhealthy.py +44 -0
- render/public_api/models/key_value_with_cursor.py +73 -0
- render/public_api/models/label.py +68 -0
- render/public_api/models/list_custom_domains_domain_type.py +9 -0
- render/public_api/models/list_custom_domains_verification_status.py +9 -0
- render/public_api/models/list_logs_response_200.py +102 -0
- render/public_api/models/list_logs_values_label.py +13 -0
- render/public_api/models/list_objects_response.py +92 -0
- render/public_api/models/list_postgres_suspended_item.py +9 -0
- render/public_api/models/list_postgres_users_response_200_item.py +86 -0
- render/public_api/models/list_routes_type_item.py +9 -0
- render/public_api/models/list_services_suspended_item.py +9 -0
- render/public_api/models/log.py +100 -0
- render/public_api/models/log_direction.py +9 -0
- render/public_api/models/log_label.py +70 -0
- render/public_api/models/log_label_name.py +22 -0
- render/public_api/models/log_stream_owner_update.py +80 -0
- render/public_api/models/log_stream_preview_setting.py +9 -0
- render/public_api/models/log_stream_resource_update.py +80 -0
- render/public_api/models/log_stream_setting.py +9 -0
- render/public_api/models/maintenance_ended.py +44 -0
- render/public_api/models/maintenance_mode.py +68 -0
- render/public_api/models/maintenance_mode_enabled.py +59 -0
- render/public_api/models/maintenance_mode_uri_updated.py +67 -0
- render/public_api/models/maintenance_run.py +105 -0
- render/public_api/models/maintenance_run_patch.py +69 -0
- render/public_api/models/maintenance_run_with_resource.py +114 -0
- render/public_api/models/maintenance_started.py +65 -0
- render/public_api/models/maintenance_state.py +13 -0
- render/public_api/models/maintenance_trigger.py +91 -0
- render/public_api/models/maxmemory_policy.py +15 -0
- render/public_api/models/metrics_stream.py +77 -0
- render/public_api/models/metrics_stream_input.py +86 -0
- render/public_api/models/native_environment_details.py +78 -0
- render/public_api/models/native_environment_details_patch.py +68 -0
- render/public_api/models/native_environment_details_post.py +68 -0
- render/public_api/models/notification_override.py +78 -0
- render/public_api/models/notification_override_with_cursor.py +73 -0
- render/public_api/models/notification_service_override.py +78 -0
- render/public_api/models/notification_service_override_patch.py +84 -0
- render/public_api/models/notification_setting.py +93 -0
- render/public_api/models/notification_setting_patch.py +85 -0
- render/public_api/models/notify_override.py +11 -0
- render/public_api/models/notify_preview_override.py +10 -0
- render/public_api/models/notify_setting.py +10 -0
- render/public_api/models/notify_setting_v2.py +10 -0
- render/public_api/models/object_metadata.py +77 -0
- render/public_api/models/object_with_cursor.py +73 -0
- render/public_api/models/oom_killed.py +59 -0
- render/public_api/models/otel_provider_type.py +16 -0
- render/public_api/models/outbound_ips.py +81 -0
- render/public_api/models/outbound_ips_type.py +9 -0
- render/public_api/models/owner.py +121 -0
- render/public_api/models/owner_log_stream_setting.py +86 -0
- render/public_api/models/owner_type.py +9 -0
- render/public_api/models/owner_with_cursor.py +81 -0
- render/public_api/models/paid_plan.py +13 -0
- render/public_api/models/patch_route_response_200.py +72 -0
- render/public_api/models/persistence_mode.py +10 -0
- render/public_api/models/pipeline_minutes_exhausted.py +73 -0
- render/public_api/models/plan.py +22 -0
- render/public_api/models/post_job_body.py +70 -0
- render/public_api/models/postgres.py +300 -0
- render/public_api/models/postgres_available.py +44 -0
- render/public_api/models/postgres_available_parameter_override.py +106 -0
- render/public_api/models/postgres_available_parameter_overrides_result.py +75 -0
- render/public_api/models/postgres_backup_completed.py +44 -0
- render/public_api/models/postgres_backup_failed.py +44 -0
- render/public_api/models/postgres_backup_started.py +44 -0
- render/public_api/models/postgres_cluster_leader_changed.py +59 -0
- render/public_api/models/postgres_connection_info.py +103 -0
- render/public_api/models/postgres_connection_pool_changed.py +91 -0
- render/public_api/models/postgres_connection_pool_enabled_changed.py +83 -0
- render/public_api/models/postgres_created.py +72 -0
- render/public_api/models/postgres_detail.py +336 -0
- render/public_api/models/postgres_detail_suspended.py +9 -0
- render/public_api/models/postgres_disk_size_changed.py +91 -0
- render/public_api/models/postgres_export.py +80 -0
- render/public_api/models/postgres_ha_status_changed.py +67 -0
- render/public_api/models/postgres_parameter_overrides.py +44 -0
- render/public_api/models/postgres_parameter_overrides_wrapper.py +65 -0
- render/public_api/models/postgres_patch_input.py +199 -0
- render/public_api/models/postgres_pitr_checkpoint_completed.py +44 -0
- render/public_api/models/postgres_pitr_checkpoint_failed.py +44 -0
- render/public_api/models/postgres_pitr_checkpoint_started.py +44 -0
- render/public_api/models/postgres_plans.py +35 -0
- render/public_api/models/postgres_post_input.py +254 -0
- render/public_api/models/postgres_process.py +185 -0
- render/public_api/models/postgres_processes_result.py +73 -0
- render/public_api/models/postgres_put_parameter_overrides_result.py +82 -0
- render/public_api/models/postgres_query_statistic.py +222 -0
- render/public_api/models/postgres_read_replica_stale.py +44 -0
- render/public_api/models/postgres_read_replicas_changed.py +67 -0
- render/public_api/models/postgres_replication_setup_input.py +96 -0
- render/public_api/models/postgres_restarted.py +72 -0
- render/public_api/models/postgres_size.py +96 -0
- render/public_api/models/postgres_sizes_result.py +73 -0
- render/public_api/models/postgres_suspended.py +9 -0
- render/public_api/models/postgres_table_scan.py +87 -0
- render/public_api/models/postgres_table_scans_result.py +73 -0
- render/public_api/models/postgres_top_queries_result.py +73 -0
- render/public_api/models/postgres_unavailable.py +44 -0
- render/public_api/models/postgres_upgrade_failed.py +67 -0
- render/public_api/models/postgres_upgrade_started.py +91 -0
- render/public_api/models/postgres_upgrade_succeeded.py +67 -0
- render/public_api/models/postgres_version.py +15 -0
- render/public_api/models/postgres_with_cursor.py +73 -0
- render/public_api/models/pre_deploy_ended.py +99 -0
- render/public_api/models/pre_deploy_started.py +67 -0
- render/public_api/models/preview_input.py +94 -0
- render/public_api/models/previews.py +67 -0
- render/public_api/models/previews_generation.py +10 -0
- render/public_api/models/private_service_details.py +282 -0
- render/public_api/models/private_service_details_patch.py +184 -0
- render/public_api/models/private_service_details_post.py +266 -0
- render/public_api/models/project.py +108 -0
- render/public_api/models/project_patch_input.py +60 -0
- render/public_api/models/project_post_environment_input.py +114 -0
- render/public_api/models/project_post_input.py +89 -0
- render/public_api/models/project_with_cursor.py +73 -0
- render/public_api/models/protected_status.py +9 -0
- render/public_api/models/pull_request_previews_enabled.py +9 -0
- render/public_api/models/put_object_input.py +59 -0
- render/public_api/models/put_object_output.py +79 -0
- render/public_api/models/read_replica.py +91 -0
- render/public_api/models/read_replica_input.py +83 -0
- render/public_api/models/recovery_info.py +80 -0
- render/public_api/models/recovery_info_recovery_status.py +10 -0
- render/public_api/models/recovery_input.py +114 -0
- render/public_api/models/redis.py +182 -0
- render/public_api/models/redis_connection_info.py +76 -0
- render/public_api/models/redis_detail.py +192 -0
- render/public_api/models/redis_options.py +79 -0
- render/public_api/models/redis_patch_input.py +138 -0
- render/public_api/models/redis_plan.py +13 -0
- render/public_api/models/redis_post_input.py +166 -0
- render/public_api/models/redis_with_cursor.py +73 -0
- render/public_api/models/region.py +12 -0
- render/public_api/models/registry_credential.py +95 -0
- render/public_api/models/registry_credential_registry.py +12 -0
- render/public_api/models/registry_credential_summary.py +67 -0
- render/public_api/models/render_subdomain_policy.py +9 -0
- render/public_api/models/resource.py +67 -0
- render/public_api/models/resource_log_stream_setting.py +87 -0
- render/public_api/models/resource_ref.py +77 -0
- render/public_api/models/resource_ref_type.py +17 -0
- render/public_api/models/rollback_deploy_body.py +59 -0
- render/public_api/models/route.py +93 -0
- render/public_api/models/route_patch.py +60 -0
- render/public_api/models/route_post.py +88 -0
- render/public_api/models/route_put.py +77 -0
- render/public_api/models/route_type.py +9 -0
- render/public_api/models/route_with_cursor.py +73 -0
- render/public_api/models/run_task.py +96 -0
- render/public_api/models/runtime.py +12 -0
- render/public_api/models/sandbox.py +149 -0
- render/public_api/models/sandbox_connect_request.py +62 -0
- render/public_api/models/sandbox_connect_response.py +98 -0
- render/public_api/models/sandbox_directory_listing.py +82 -0
- render/public_api/models/sandbox_exec_update_request.py +60 -0
- render/public_api/models/sandbox_exec_update_response.py +130 -0
- render/public_api/models/sandbox_file_entry.py +98 -0
- render/public_api/models/sandbox_file_entry_type.py +10 -0
- render/public_api/models/sandbox_group.py +141 -0
- render/public_api/models/sandbox_group_with_cursor.py +74 -0
- render/public_api/models/sandbox_network_policy.py +61 -0
- render/public_api/models/sandbox_network_policy_default.py +9 -0
- render/public_api/models/sandbox_plan.py +10 -0
- render/public_api/models/sandbox_post.py +138 -0
- render/public_api/models/sandbox_post_env.py +44 -0
- render/public_api/models/sandbox_status.py +13 -0
- render/public_api/models/sandbox_with_cursor.py +74 -0
- render/public_api/models/scale_service_body.py +59 -0
- render/public_api/models/schemas_build_filter.py +70 -0
- render/public_api/models/schemas_image.py +96 -0
- render/public_api/models/schemas_user.py +68 -0
- render/public_api/models/secret_file.py +67 -0
- render/public_api/models/secret_file_input.py +67 -0
- render/public_api/models/secret_file_with_cursor.py +73 -0
- render/public_api/models/server_available.py +44 -0
- render/public_api/models/server_failed.py +81 -0
- render/public_api/models/server_hardware_failure.py +44 -0
- render/public_api/models/server_port.py +69 -0
- render/public_api/models/server_port_protocol.py +9 -0
- render/public_api/models/server_restarted.py +66 -0
- render/public_api/models/service_disk.py +78 -0
- render/public_api/models/service_env.py +15 -0
- render/public_api/models/service_event.py +770 -0
- render/public_api/models/service_event_type.py +48 -0
- render/public_api/models/service_event_with_cursor.py +66 -0
- render/public_api/models/service_instance.py +69 -0
- render/public_api/models/service_patch.py +273 -0
- render/public_api/models/service_post.py +357 -0
- render/public_api/models/service_resumed.py +44 -0
- render/public_api/models/service_runtime.py +15 -0
- render/public_api/models/service_suspended.py +44 -0
- render/public_api/models/service_type.py +12 -0
- render/public_api/models/service_type_short.py +12 -0
- render/public_api/models/setup_postgres_replication_response_201.py +44 -0
- render/public_api/models/snapshot_restore_post.py +72 -0
- render/public_api/models/static_site_details.py +183 -0
- render/public_api/models/static_site_details_patch.py +147 -0
- render/public_api/models/static_site_details_post.py +189 -0
- render/public_api/models/status.py +12 -0
- render/public_api/models/stream_sandbox_logs_accept.py +8 -0
- render/public_api/models/stream_task_runs_events_accept.py +8 -0
- render/public_api/models/suspender_added.py +83 -0
- render/public_api/models/suspender_removed.py +83 -0
- render/public_api/models/suspender_type.py +14 -0
- render/public_api/models/sync.py +118 -0
- render/public_api/models/sync_state.py +12 -0
- render/public_api/models/sync_with_cursor.py +74 -0
- render/public_api/models/task.py +97 -0
- render/public_api/models/task_attempt.py +121 -0
- render/public_api/models/task_attempt_details.py +141 -0
- render/public_api/models/task_data_type_1.py +44 -0
- render/public_api/models/task_run.py +168 -0
- render/public_api/models/task_run_details.py +216 -0
- render/public_api/models/task_run_status.py +14 -0
- render/public_api/models/task_run_with_cursor.py +73 -0
- render/public_api/models/task_with_cursor.py +73 -0
- render/public_api/models/team_member.py +102 -0
- render/public_api/models/team_member_role.py +12 -0
- render/public_api/models/team_member_status.py +9 -0
- render/public_api/models/time_series.py +100 -0
- render/public_api/models/time_series_value.py +70 -0
- render/public_api/models/update_env_group_secret_file_body.py +59 -0
- render/public_api/models/update_registry_credential_body.py +85 -0
- render/public_api/models/update_workspace_member_body.py +61 -0
- render/public_api/models/user.py +67 -0
- render/public_api/models/validate_blueprint_request.py +84 -0
- render/public_api/models/validate_blueprint_response.py +105 -0
- render/public_api/models/validation_error.py +88 -0
- render/public_api/models/validation_plan_summary.py +107 -0
- render/public_api/models/web_service_details.py +385 -0
- render/public_api/models/web_service_details_patch.py +270 -0
- render/public_api/models/web_service_details_post.py +354 -0
- render/public_api/models/webhook.py +110 -0
- render/public_api/models/webhook_event.py +115 -0
- render/public_api/models/webhook_event_with_cursor.py +73 -0
- render/public_api/models/webhook_patch_input.py +98 -0
- render/public_api/models/webhook_post_input.py +102 -0
- render/public_api/models/webhook_with_cursor.py +73 -0
- render/public_api/models/workflow.py +163 -0
- render/public_api/models/workflow_create.py +169 -0
- render/public_api/models/workflow_update.py +109 -0
- render/public_api/models/workflow_version.py +95 -0
- render/public_api/models/workflow_version_status.py +13 -0
- render/public_api/models/workflow_version_with_cursor.py +73 -0
- render/public_api/models/workflow_with_cursor.py +73 -0
- render/public_api/models/zero_downtime_redeploy_ended.py +44 -0
- render/public_api/models/zero_downtime_redeploy_started.py +59 -0
- render/public_api/py.typed +1 -0
- render/public_api/types.py +54 -0
- render/py.typed +0 -0
- render/render.py +81 -0
- render/render_async.py +80 -0
- render/version.py +27 -0
- render/workflows/__init__.py +25 -0
- render/workflows/_callback_models.py +194 -0
- render/workflows/_uds_http.py +128 -0
- render/workflows/app.py +263 -0
- render/workflows/cli.py +62 -0
- render/workflows/client.py +354 -0
- render/workflows/context.py +75 -0
- render/workflows/executor.py +86 -0
- render/workflows/runner.py +174 -0
- render/workflows/task.py +348 -0
- render/workflows/tests/__init__.py +0 -0
- render/workflows/tests/test_app.py +343 -0
- render/workflows/tests/test_cli.py +134 -0
- render/workflows/tests/test_client.py +59 -0
- render/workflows/tests/test_context.py +118 -0
- render/workflows/tests/test_end_to_end.py +307 -0
- render/workflows/tests/test_executor.py +221 -0
- render/workflows/tests/test_lazy_imports.py +100 -0
- render/workflows/tests/test_registration.py +293 -0
- render/workflows/tests/test_translate_errors.py +126 -0
- render/workflows/tests/test_uds_http.py +199 -0
- render/workflows/tests/test_version.py +15 -0
- render-1.0.1.dist-info/METADATA +382 -0
- render-1.0.1.dist-info/RECORD +799 -0
- render-1.0.1.dist-info/WHEEL +4 -0
- render-1.0.1.dist-info/entry_points.txt +2 -0
- render-1.0.1.dist-info/licenses/LICENSE +201 -0
|
@@ -0,0 +1,363 @@
|
|
|
1
|
+
"""Workflows service
|
|
2
|
+
|
|
3
|
+
This module provides the WorkflowsService class for workflow-related API operations.
|
|
4
|
+
"""
|
|
5
|
+
|
|
6
|
+
from collections.abc import AsyncIterator
|
|
7
|
+
from typing import TYPE_CHECKING, Any
|
|
8
|
+
|
|
9
|
+
import httpx
|
|
10
|
+
|
|
11
|
+
from render.client.errors import RenderError, TaskRunError
|
|
12
|
+
from render.client.sse import parse_stream
|
|
13
|
+
from render.client.types import (
|
|
14
|
+
ListTaskRunsParams,
|
|
15
|
+
TaskData,
|
|
16
|
+
TaskRun,
|
|
17
|
+
TaskRunDetails,
|
|
18
|
+
TaskRunStatusValues,
|
|
19
|
+
TaskSlug,
|
|
20
|
+
)
|
|
21
|
+
from render.client.util import (
|
|
22
|
+
handle_http_error,
|
|
23
|
+
handle_http_errors,
|
|
24
|
+
handle_httpx_exception,
|
|
25
|
+
retry_with_backoff,
|
|
26
|
+
)
|
|
27
|
+
from render.public_api.api.workflow_tasks_beta import (
|
|
28
|
+
cancel_task_run,
|
|
29
|
+
create_task,
|
|
30
|
+
get_task_run,
|
|
31
|
+
list_task_runs,
|
|
32
|
+
)
|
|
33
|
+
from render.public_api.api.workflow_tasks_beta.stream_task_runs_events import (
|
|
34
|
+
_get_kwargs,
|
|
35
|
+
)
|
|
36
|
+
from render.public_api.models.error import Error
|
|
37
|
+
from render.public_api.models.run_task import RunTask
|
|
38
|
+
from render.public_api.models.task_data_type_1 import TaskDataType1
|
|
39
|
+
from render.public_api.models.task_run_with_cursor import TaskRunWithCursor
|
|
40
|
+
from render.public_api.types import UNSET, Response
|
|
41
|
+
from render.version import get_user_agent
|
|
42
|
+
|
|
43
|
+
if TYPE_CHECKING:
|
|
44
|
+
from render.client.client import Client
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
class AwaitableTaskRun:
|
|
48
|
+
"""TaskRun with awaitable functionality for waiting on completion.
|
|
49
|
+
|
|
50
|
+
This class wraps a TaskRun and makes it awaitable, so you can use:
|
|
51
|
+
`result = await task_run`
|
|
52
|
+
"""
|
|
53
|
+
|
|
54
|
+
def __init__(self, task_run: TaskRun, workflows_service: "WorkflowsService"):
|
|
55
|
+
self.task_run = task_run
|
|
56
|
+
self.workflows_service = workflows_service
|
|
57
|
+
self._details: TaskRunDetails | None = None
|
|
58
|
+
|
|
59
|
+
@property
|
|
60
|
+
def id(self) -> str:
|
|
61
|
+
"""Get the task run ID."""
|
|
62
|
+
return self.task_run.id
|
|
63
|
+
|
|
64
|
+
@property
|
|
65
|
+
def status(self) -> str:
|
|
66
|
+
"""Get the current task run status."""
|
|
67
|
+
return self.task_run.status.value
|
|
68
|
+
|
|
69
|
+
def is_terminal_status(self) -> bool:
|
|
70
|
+
"""Check if the task run is in a terminal state."""
|
|
71
|
+
return self.status in (
|
|
72
|
+
TaskRunStatusValues.COMPLETED,
|
|
73
|
+
TaskRunStatusValues.SUCCEEDED,
|
|
74
|
+
TaskRunStatusValues.FAILED,
|
|
75
|
+
TaskRunStatusValues.CANCELED,
|
|
76
|
+
)
|
|
77
|
+
|
|
78
|
+
def __await__(self):
|
|
79
|
+
"""Make AwaitableTaskRun awaitable directly."""
|
|
80
|
+
return self._wait_for_completion().__await__()
|
|
81
|
+
|
|
82
|
+
async def _wait_for_completion(self) -> TaskRunDetails:
|
|
83
|
+
"""Internal method to wait for task completion.
|
|
84
|
+
|
|
85
|
+
Returns:
|
|
86
|
+
TaskRunDetails: The final task run details
|
|
87
|
+
|
|
88
|
+
Raises:
|
|
89
|
+
RenderError: If the task run completed with no event
|
|
90
|
+
TaskRunError: If the task run fails with an error
|
|
91
|
+
ClientError: For 4xx client errors when polling task status
|
|
92
|
+
ServerError: For 5xx server errors and network failures
|
|
93
|
+
TimeoutError: If requests time out while polling
|
|
94
|
+
"""
|
|
95
|
+
# If already completed, get current details and return
|
|
96
|
+
if self.is_terminal_status():
|
|
97
|
+
self._details = await self.workflows_service.get_task_run(self.id)
|
|
98
|
+
return self._details
|
|
99
|
+
|
|
100
|
+
return await retry_with_backoff(
|
|
101
|
+
self._task_run_completed_with_sse,
|
|
102
|
+
max_retries=5,
|
|
103
|
+
poll_interval=1.0,
|
|
104
|
+
backoff_factor=2.0,
|
|
105
|
+
exempted_exceptions=(TaskRunError,),
|
|
106
|
+
)
|
|
107
|
+
|
|
108
|
+
async def _task_run_completed_with_sse(self) -> TaskRunDetails:
|
|
109
|
+
async for event in self.workflows_service.task_run_events([self.id]):
|
|
110
|
+
if event and event.id == self.id:
|
|
111
|
+
# Update our internal state
|
|
112
|
+
self._details = event
|
|
113
|
+
|
|
114
|
+
if event.error:
|
|
115
|
+
raise TaskRunError(event.error)
|
|
116
|
+
|
|
117
|
+
return event
|
|
118
|
+
|
|
119
|
+
raise RenderError("Task run completed with no event")
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
class WorkflowsService:
|
|
123
|
+
"""Service for workflow-related API operations.
|
|
124
|
+
|
|
125
|
+
This class provides methods for running tasks, getting task run details,
|
|
126
|
+
canceling tasks, and listing task runs.
|
|
127
|
+
"""
|
|
128
|
+
|
|
129
|
+
def __init__(self, client: "Client"):
|
|
130
|
+
self.client = client
|
|
131
|
+
|
|
132
|
+
async def task_run_events(
|
|
133
|
+
self,
|
|
134
|
+
task_run_ids: list[str],
|
|
135
|
+
) -> AsyncIterator[TaskRunDetails]:
|
|
136
|
+
"""Stream task run events via SSE.
|
|
137
|
+
|
|
138
|
+
Args:
|
|
139
|
+
task_run_ids: List of task run IDs to stream events for
|
|
140
|
+
|
|
141
|
+
Yields:
|
|
142
|
+
TaskRunDetails: Task run event updates
|
|
143
|
+
|
|
144
|
+
Raises:
|
|
145
|
+
TimeoutError: For timeout-related errors
|
|
146
|
+
ClientError: For other client-side errors
|
|
147
|
+
ServerError: For connection errors that might indicate server issues
|
|
148
|
+
"""
|
|
149
|
+
kwargs = _get_kwargs(task_run_ids=task_run_ids)
|
|
150
|
+
|
|
151
|
+
timeout = httpx.Timeout(
|
|
152
|
+
connect=5.0, write=5.0, read=None, pool=None
|
|
153
|
+
) # These can be long lived
|
|
154
|
+
async with httpx.AsyncClient(timeout=timeout) as http_client:
|
|
155
|
+
headers = kwargs.get("headers", {})
|
|
156
|
+
headers.update(
|
|
157
|
+
{
|
|
158
|
+
"Accept": "text/event-stream",
|
|
159
|
+
"Cache-Control": "no-cache",
|
|
160
|
+
"User-Agent": get_user_agent(),
|
|
161
|
+
}
|
|
162
|
+
)
|
|
163
|
+
if self.client.token:
|
|
164
|
+
headers["Authorization"] = f"Bearer {self.client.token}"
|
|
165
|
+
|
|
166
|
+
url = f"{self.client.internal._base_url}{kwargs['url']}"
|
|
167
|
+
|
|
168
|
+
try:
|
|
169
|
+
async with http_client.stream(
|
|
170
|
+
method=kwargs["method"],
|
|
171
|
+
url=url,
|
|
172
|
+
params=kwargs.get("params", {}),
|
|
173
|
+
headers=headers,
|
|
174
|
+
) as response:
|
|
175
|
+
handle_http_error(response, "SSE stream")
|
|
176
|
+
|
|
177
|
+
async for event in parse_stream(response.aiter_bytes()):
|
|
178
|
+
yield event
|
|
179
|
+
|
|
180
|
+
except httpx.RequestError as e:
|
|
181
|
+
handle_httpx_exception(e, "SSE connection")
|
|
182
|
+
|
|
183
|
+
async def start_task(
|
|
184
|
+
self,
|
|
185
|
+
task_slug: TaskSlug,
|
|
186
|
+
input_data: TaskData,
|
|
187
|
+
) -> AwaitableTaskRun:
|
|
188
|
+
"""Start a task and return an awaitable task run without waiting for completion.
|
|
189
|
+
|
|
190
|
+
The returned AwaitableTaskRun provides the task run ID immediately.
|
|
191
|
+
To wait for the result, await it:
|
|
192
|
+
|
|
193
|
+
task_run = await workflows.start_task("my-workflow/task", [42])
|
|
194
|
+
print(task_run.id) # available immediately
|
|
195
|
+
result = await task_run # opens connection, waits for completion
|
|
196
|
+
|
|
197
|
+
For fire-and-forget, simply discard the task run.
|
|
198
|
+
|
|
199
|
+
This corresponds to POST /task-runs in the API.
|
|
200
|
+
|
|
201
|
+
Args:
|
|
202
|
+
task_slug: The task slug (workflow-slug/task-name)
|
|
203
|
+
input_data: The input data for the task. Can be either:
|
|
204
|
+
- A list for positional arguments: [arg1, arg2, arg3]
|
|
205
|
+
- A dict for named parameters: {"param1": value1, "param2": value2}
|
|
206
|
+
|
|
207
|
+
Returns:
|
|
208
|
+
AwaitableTaskRun: A task run that can be awaited for the result
|
|
209
|
+
|
|
210
|
+
Raises:
|
|
211
|
+
ClientError: For 4xx client errors (invalid task, malformed input, etc.)
|
|
212
|
+
ServerError: For 5xx server errors and network failures
|
|
213
|
+
TimeoutError: If the request times out
|
|
214
|
+
"""
|
|
215
|
+
response = (await self._create_task_api_call(task_slug, input_data)).parsed
|
|
216
|
+
|
|
217
|
+
return AwaitableTaskRun(response, self)
|
|
218
|
+
|
|
219
|
+
async def run_task(
|
|
220
|
+
self,
|
|
221
|
+
task_slug: TaskSlug,
|
|
222
|
+
input_data: TaskData,
|
|
223
|
+
) -> TaskRunDetails:
|
|
224
|
+
"""Start a task and wait for it to complete, returning the result.
|
|
225
|
+
|
|
226
|
+
This is a convenience wrapper around start_task() that additionally
|
|
227
|
+
waits for the task to complete.
|
|
228
|
+
|
|
229
|
+
Args:
|
|
230
|
+
task_slug: The task slug (workflow-slug/task-name)
|
|
231
|
+
input_data: The input data for the task. Can be either:
|
|
232
|
+
- A list for positional arguments: [arg1, arg2, arg3]
|
|
233
|
+
- A dict for named parameters: {"param1": value1, "param2": value2}
|
|
234
|
+
|
|
235
|
+
Returns:
|
|
236
|
+
TaskRunDetails: The completed task run details
|
|
237
|
+
|
|
238
|
+
Raises:
|
|
239
|
+
ClientError: For 4xx client errors (invalid task, malformed input, etc.)
|
|
240
|
+
ServerError: For 5xx server errors and network failures
|
|
241
|
+
TimeoutError: If the request times out
|
|
242
|
+
TaskRunError: If the task run fails with an error
|
|
243
|
+
"""
|
|
244
|
+
task_run = await self.start_task(task_slug, input_data)
|
|
245
|
+
return await task_run
|
|
246
|
+
|
|
247
|
+
@handle_http_errors("create task")
|
|
248
|
+
async def _create_task_api_call(
|
|
249
|
+
self, task_slug: TaskSlug, input_data: TaskData
|
|
250
|
+
) -> Response[Error | TaskRun]:
|
|
251
|
+
"""Internal method to make the create task API call."""
|
|
252
|
+
# Convert dict to TaskDataType1 for named parameters
|
|
253
|
+
task_data_input: TaskDataType1 | list[Any]
|
|
254
|
+
if isinstance(input_data, dict):
|
|
255
|
+
task_data_input = TaskDataType1.from_dict(input_data)
|
|
256
|
+
else:
|
|
257
|
+
task_data_input = input_data
|
|
258
|
+
|
|
259
|
+
# Create the request body
|
|
260
|
+
run_task = RunTask(
|
|
261
|
+
task=task_slug,
|
|
262
|
+
input_=task_data_input,
|
|
263
|
+
)
|
|
264
|
+
|
|
265
|
+
# Make the API call
|
|
266
|
+
return await create_task.asyncio_detailed(
|
|
267
|
+
client=self.client.internal,
|
|
268
|
+
body=run_task,
|
|
269
|
+
)
|
|
270
|
+
|
|
271
|
+
async def get_task_run(self, task_run_id: str) -> TaskRunDetails:
|
|
272
|
+
"""Get details about a specific task run.
|
|
273
|
+
|
|
274
|
+
This corresponds to GET /task-runs/{taskRunId} in the API.
|
|
275
|
+
|
|
276
|
+
Args:
|
|
277
|
+
task_run_id: The ID of the task run to retrieve
|
|
278
|
+
|
|
279
|
+
Returns:
|
|
280
|
+
TaskRunDetails: The task run details
|
|
281
|
+
|
|
282
|
+
Raises:
|
|
283
|
+
ClientError: For 4xx client errors (task not found, invalid ID, etc.)
|
|
284
|
+
ServerError: For 5xx server errors and network failures
|
|
285
|
+
TimeoutError: If the request times out
|
|
286
|
+
"""
|
|
287
|
+
return (await self._get_task_run_api_call(task_run_id)).parsed
|
|
288
|
+
|
|
289
|
+
@handle_http_errors("get task run")
|
|
290
|
+
async def _get_task_run_api_call(
|
|
291
|
+
self, task_run_id: str
|
|
292
|
+
) -> Response[Error | TaskRunDetails]:
|
|
293
|
+
"""Internal method to make the get task run API call."""
|
|
294
|
+
return await get_task_run.asyncio_detailed(
|
|
295
|
+
client=self.client.internal,
|
|
296
|
+
task_run_id=task_run_id,
|
|
297
|
+
)
|
|
298
|
+
|
|
299
|
+
async def cancel_task_run(self, task_run_id: str) -> None:
|
|
300
|
+
"""Cancel a running task.
|
|
301
|
+
|
|
302
|
+
This corresponds to DELETE /task-runs/{taskRunId} in the API.
|
|
303
|
+
|
|
304
|
+
Args:
|
|
305
|
+
task_run_id: The ID of the task run to cancel
|
|
306
|
+
|
|
307
|
+
Raises:
|
|
308
|
+
ClientError: For 4xx client errors (task not found, already completed, etc.)
|
|
309
|
+
ServerError: For 5xx server errors and network failures
|
|
310
|
+
TimeoutError: If the request times out
|
|
311
|
+
"""
|
|
312
|
+
await self._cancel_task_run_api_call(task_run_id)
|
|
313
|
+
|
|
314
|
+
# cancel_task_run returns None on success (204 status)
|
|
315
|
+
# Error objects will be handled by the decorator
|
|
316
|
+
|
|
317
|
+
@handle_http_errors("cancel task run")
|
|
318
|
+
async def _cancel_task_run_api_call(
|
|
319
|
+
self, task_run_id: str
|
|
320
|
+
) -> Response[Any | Error]:
|
|
321
|
+
"""Internal method to make the cancel task run API call."""
|
|
322
|
+
return await cancel_task_run.asyncio_detailed(
|
|
323
|
+
client=self.client.internal,
|
|
324
|
+
task_run_id=task_run_id,
|
|
325
|
+
)
|
|
326
|
+
|
|
327
|
+
async def list_task_runs(
|
|
328
|
+
self,
|
|
329
|
+
params: ListTaskRunsParams | None = None,
|
|
330
|
+
) -> list[TaskRunWithCursor]:
|
|
331
|
+
"""List task runs with optional filtering.
|
|
332
|
+
|
|
333
|
+
This corresponds to GET /task-runs in the API.
|
|
334
|
+
|
|
335
|
+
Args:
|
|
336
|
+
params: Optional parameters for filtering the results
|
|
337
|
+
|
|
338
|
+
Returns:
|
|
339
|
+
list[TaskRunWithCursor]: List of task runs with cursor info
|
|
340
|
+
|
|
341
|
+
Raises:
|
|
342
|
+
ClientError: For 4xx client errors (invalid parameters, unauthorized, etc.)
|
|
343
|
+
ServerError: For 5xx server errors and network failures
|
|
344
|
+
TimeoutError: If the request times out
|
|
345
|
+
"""
|
|
346
|
+
return (await self._list_task_runs_api_call(params)).parsed
|
|
347
|
+
|
|
348
|
+
@handle_http_errors("list task runs")
|
|
349
|
+
async def _list_task_runs_api_call(
|
|
350
|
+
self, params: ListTaskRunsParams | None = None
|
|
351
|
+
) -> Response[Error | list[TaskRunWithCursor]]:
|
|
352
|
+
"""Internal method to make the list task runs API call."""
|
|
353
|
+
# Convert params to API parameters
|
|
354
|
+
limit = params.limit if params and params.limit is not None else UNSET
|
|
355
|
+
cursor = params.cursor if params and params.cursor is not None else UNSET
|
|
356
|
+
owner_id = params.owner_id if params and params.owner_id is not None else UNSET
|
|
357
|
+
|
|
358
|
+
return await list_task_runs.asyncio_detailed(
|
|
359
|
+
client=self.client.internal,
|
|
360
|
+
limit=limit,
|
|
361
|
+
cursor=cursor,
|
|
362
|
+
owner_id=owner_id,
|
|
363
|
+
)
|
|
@@ -0,0 +1,298 @@
|
|
|
1
|
+
"""Synchronous Workflows service.
|
|
2
|
+
|
|
3
|
+
This module provides the SyncWorkflowsService class for workflow-related API operations.
|
|
4
|
+
All methods are synchronous (blocking).
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
from collections.abc import Iterator
|
|
8
|
+
from typing import TYPE_CHECKING, Any
|
|
9
|
+
|
|
10
|
+
import httpx
|
|
11
|
+
|
|
12
|
+
from render.client.errors import RenderError, TaskRunError
|
|
13
|
+
from render.client.sse_sync import parse_stream
|
|
14
|
+
from render.client.types import (
|
|
15
|
+
ListTaskRunsParams,
|
|
16
|
+
TaskData,
|
|
17
|
+
TaskRun,
|
|
18
|
+
TaskRunDetails,
|
|
19
|
+
TaskRunStatusValues,
|
|
20
|
+
TaskSlug,
|
|
21
|
+
)
|
|
22
|
+
from render.client.util import handle_http_error, handle_httpx_exception
|
|
23
|
+
from render.client.util_sync import handle_http_errors, retry_with_backoff
|
|
24
|
+
from render.public_api.api.workflow_tasks_beta import (
|
|
25
|
+
cancel_task_run,
|
|
26
|
+
create_task,
|
|
27
|
+
get_task_run,
|
|
28
|
+
list_task_runs,
|
|
29
|
+
)
|
|
30
|
+
from render.public_api.api.workflow_tasks_beta.stream_task_runs_events import (
|
|
31
|
+
_get_kwargs,
|
|
32
|
+
)
|
|
33
|
+
from render.public_api.models.error import Error
|
|
34
|
+
from render.public_api.models.run_task import RunTask
|
|
35
|
+
from render.public_api.models.task_data_type_1 import TaskDataType1
|
|
36
|
+
from render.public_api.models.task_run_with_cursor import TaskRunWithCursor
|
|
37
|
+
from render.public_api.types import UNSET, Response
|
|
38
|
+
from render.version import get_user_agent
|
|
39
|
+
|
|
40
|
+
if TYPE_CHECKING:
|
|
41
|
+
from render.client.client import Client
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
class SyncWorkflowsService:
|
|
45
|
+
"""Synchronous service for workflow-related API operations.
|
|
46
|
+
|
|
47
|
+
This class provides methods for running tasks, getting task run details,
|
|
48
|
+
canceling tasks, and listing task runs. All methods are synchronous (blocking).
|
|
49
|
+
"""
|
|
50
|
+
|
|
51
|
+
def __init__(self, client: "Client"):
|
|
52
|
+
self.client = client
|
|
53
|
+
|
|
54
|
+
def task_run_events(
|
|
55
|
+
self,
|
|
56
|
+
task_run_ids: list[str],
|
|
57
|
+
) -> Iterator[TaskRunDetails]:
|
|
58
|
+
"""Stream task run events via SSE.
|
|
59
|
+
|
|
60
|
+
Args:
|
|
61
|
+
task_run_ids: List of task run IDs to stream events for
|
|
62
|
+
|
|
63
|
+
Yields:
|
|
64
|
+
TaskRunDetails: Task run event updates
|
|
65
|
+
|
|
66
|
+
Raises:
|
|
67
|
+
TimeoutError: For timeout-related errors
|
|
68
|
+
ClientError: For other client-side errors
|
|
69
|
+
ServerError: For connection errors that might indicate server issues
|
|
70
|
+
"""
|
|
71
|
+
kwargs = _get_kwargs(task_run_ids=task_run_ids)
|
|
72
|
+
|
|
73
|
+
timeout = httpx.Timeout(
|
|
74
|
+
connect=5.0, write=5.0, read=None, pool=None
|
|
75
|
+
) # These can be long lived
|
|
76
|
+
with httpx.Client(timeout=timeout) as http_client:
|
|
77
|
+
headers = kwargs.get("headers", {})
|
|
78
|
+
headers.update(
|
|
79
|
+
{
|
|
80
|
+
"Accept": "text/event-stream",
|
|
81
|
+
"Cache-Control": "no-cache",
|
|
82
|
+
"User-Agent": get_user_agent(),
|
|
83
|
+
}
|
|
84
|
+
)
|
|
85
|
+
if self.client.token:
|
|
86
|
+
headers["Authorization"] = f"Bearer {self.client.token}"
|
|
87
|
+
|
|
88
|
+
url = f"{self.client.internal._base_url}{kwargs['url']}"
|
|
89
|
+
|
|
90
|
+
try:
|
|
91
|
+
with http_client.stream(
|
|
92
|
+
method=kwargs["method"],
|
|
93
|
+
url=url,
|
|
94
|
+
params=kwargs.get("params", {}),
|
|
95
|
+
headers=headers,
|
|
96
|
+
) as response:
|
|
97
|
+
handle_http_error(response, "SSE stream")
|
|
98
|
+
|
|
99
|
+
yield from parse_stream(response.iter_bytes())
|
|
100
|
+
|
|
101
|
+
except httpx.RequestError as e:
|
|
102
|
+
handle_httpx_exception(e, "SSE connection")
|
|
103
|
+
|
|
104
|
+
def start_task(
|
|
105
|
+
self,
|
|
106
|
+
task_slug: TaskSlug,
|
|
107
|
+
input_data: TaskData,
|
|
108
|
+
) -> TaskRun:
|
|
109
|
+
"""Start a task and return the task run without waiting for completion.
|
|
110
|
+
|
|
111
|
+
The returned TaskRun provides the task run ID immediately.
|
|
112
|
+
To wait for the result, call run_task() instead, or poll with get_task_run().
|
|
113
|
+
|
|
114
|
+
This corresponds to POST /task-runs in the API.
|
|
115
|
+
|
|
116
|
+
Args:
|
|
117
|
+
task_slug: The task slug (workflow-slug/task-name)
|
|
118
|
+
input_data: The input data for the task. Can be either:
|
|
119
|
+
- A list for positional arguments: [arg1, arg2, arg3]
|
|
120
|
+
- A dict for named parameters: {"param1": value1, "param2": value2}
|
|
121
|
+
|
|
122
|
+
Returns:
|
|
123
|
+
TaskRun: The created task run
|
|
124
|
+
|
|
125
|
+
Raises:
|
|
126
|
+
ClientError: For 4xx client errors (invalid task, malformed input, etc.)
|
|
127
|
+
ServerError: For 5xx server errors and network failures
|
|
128
|
+
TimeoutError: If the request times out
|
|
129
|
+
"""
|
|
130
|
+
return self._create_task_api_call(task_slug, input_data).parsed
|
|
131
|
+
|
|
132
|
+
def run_task(
|
|
133
|
+
self,
|
|
134
|
+
task_slug: TaskSlug,
|
|
135
|
+
input_data: TaskData,
|
|
136
|
+
) -> TaskRunDetails:
|
|
137
|
+
"""Start a task and wait for it to complete, returning the result.
|
|
138
|
+
|
|
139
|
+
This corresponds to POST /task-runs in the API.
|
|
140
|
+
|
|
141
|
+
Args:
|
|
142
|
+
task_slug: The task slug (workflow-slug/task-name)
|
|
143
|
+
input_data: The input data for the task. Can be either:
|
|
144
|
+
- A list for positional arguments: [arg1, arg2, arg3]
|
|
145
|
+
- A dict for named parameters: {"param1": value1, "param2": value2}
|
|
146
|
+
|
|
147
|
+
Returns:
|
|
148
|
+
TaskRunDetails: The completed task run details
|
|
149
|
+
|
|
150
|
+
Raises:
|
|
151
|
+
ClientError: For 4xx client errors (invalid task, malformed input, etc.)
|
|
152
|
+
ServerError: For 5xx server errors and network failures
|
|
153
|
+
TimeoutError: If the request times out
|
|
154
|
+
TaskRunError: If the task run fails with an error
|
|
155
|
+
"""
|
|
156
|
+
task_run = self.start_task(task_slug, input_data)
|
|
157
|
+
|
|
158
|
+
# If already in a terminal state, just get the details
|
|
159
|
+
status = task_run.status.value
|
|
160
|
+
if status in (
|
|
161
|
+
TaskRunStatusValues.COMPLETED,
|
|
162
|
+
TaskRunStatusValues.FAILED,
|
|
163
|
+
TaskRunStatusValues.CANCELED,
|
|
164
|
+
):
|
|
165
|
+
return self.get_task_run(task_run.id)
|
|
166
|
+
|
|
167
|
+
return retry_with_backoff(
|
|
168
|
+
lambda: self._task_run_completed_with_sse(task_run.id),
|
|
169
|
+
max_retries=5,
|
|
170
|
+
poll_interval=1.0,
|
|
171
|
+
backoff_factor=2.0,
|
|
172
|
+
exempted_exceptions=(TaskRunError,),
|
|
173
|
+
)
|
|
174
|
+
|
|
175
|
+
def _task_run_completed_with_sse(self, task_run_id: str) -> TaskRunDetails:
|
|
176
|
+
for event in self.task_run_events([task_run_id]):
|
|
177
|
+
if event and event.id == task_run_id:
|
|
178
|
+
if event.error:
|
|
179
|
+
raise TaskRunError(event.error)
|
|
180
|
+
return event
|
|
181
|
+
|
|
182
|
+
raise RenderError("Task run completed with no event")
|
|
183
|
+
|
|
184
|
+
@handle_http_errors("create task")
|
|
185
|
+
def _create_task_api_call(
|
|
186
|
+
self, task_slug: TaskSlug, input_data: TaskData
|
|
187
|
+
) -> Response[Error | TaskRun]:
|
|
188
|
+
"""Internal method to make the create task API call."""
|
|
189
|
+
# Convert dict to TaskDataType1 for named parameters
|
|
190
|
+
task_data_input: TaskDataType1 | list[Any]
|
|
191
|
+
if isinstance(input_data, dict):
|
|
192
|
+
task_data_input = TaskDataType1.from_dict(input_data)
|
|
193
|
+
else:
|
|
194
|
+
task_data_input = input_data
|
|
195
|
+
|
|
196
|
+
# Create the request body
|
|
197
|
+
run_task = RunTask(
|
|
198
|
+
task=task_slug,
|
|
199
|
+
input_=task_data_input,
|
|
200
|
+
)
|
|
201
|
+
|
|
202
|
+
# Make the API call
|
|
203
|
+
return create_task.sync_detailed(
|
|
204
|
+
client=self.client.internal,
|
|
205
|
+
body=run_task,
|
|
206
|
+
)
|
|
207
|
+
|
|
208
|
+
def get_task_run(self, task_run_id: str) -> TaskRunDetails:
|
|
209
|
+
"""Get details about a specific task run.
|
|
210
|
+
|
|
211
|
+
This corresponds to GET /task-runs/{taskRunId} in the API.
|
|
212
|
+
|
|
213
|
+
Args:
|
|
214
|
+
task_run_id: The ID of the task run to retrieve
|
|
215
|
+
|
|
216
|
+
Returns:
|
|
217
|
+
TaskRunDetails: The task run details
|
|
218
|
+
|
|
219
|
+
Raises:
|
|
220
|
+
ClientError: For 4xx client errors (task not found, invalid ID, etc.)
|
|
221
|
+
ServerError: For 5xx server errors and network failures
|
|
222
|
+
TimeoutError: If the request times out
|
|
223
|
+
"""
|
|
224
|
+
return self._get_task_run_api_call(task_run_id).parsed
|
|
225
|
+
|
|
226
|
+
@handle_http_errors("get task run")
|
|
227
|
+
def _get_task_run_api_call(
|
|
228
|
+
self, task_run_id: str
|
|
229
|
+
) -> Response[Error | TaskRunDetails]:
|
|
230
|
+
"""Internal method to make the get task run API call."""
|
|
231
|
+
return get_task_run.sync_detailed(
|
|
232
|
+
client=self.client.internal,
|
|
233
|
+
task_run_id=task_run_id,
|
|
234
|
+
)
|
|
235
|
+
|
|
236
|
+
def cancel_task_run(self, task_run_id: str) -> None:
|
|
237
|
+
"""Cancel a running task.
|
|
238
|
+
|
|
239
|
+
This corresponds to DELETE /task-runs/{taskRunId} in the API.
|
|
240
|
+
|
|
241
|
+
Args:
|
|
242
|
+
task_run_id: The ID of the task run to cancel
|
|
243
|
+
|
|
244
|
+
Raises:
|
|
245
|
+
ClientError: For 4xx client errors (task not found, already completed, etc.)
|
|
246
|
+
ServerError: For 5xx server errors and network failures
|
|
247
|
+
TimeoutError: If the request times out
|
|
248
|
+
"""
|
|
249
|
+
self._cancel_task_run_api_call(task_run_id)
|
|
250
|
+
|
|
251
|
+
# cancel_task_run returns None on success (204 status)
|
|
252
|
+
# Error objects will be handled by the decorator
|
|
253
|
+
|
|
254
|
+
@handle_http_errors("cancel task run")
|
|
255
|
+
def _cancel_task_run_api_call(self, task_run_id: str) -> Response[Any | Error]:
|
|
256
|
+
"""Internal method to make the cancel task run API call."""
|
|
257
|
+
return cancel_task_run.sync_detailed(
|
|
258
|
+
client=self.client.internal,
|
|
259
|
+
task_run_id=task_run_id,
|
|
260
|
+
)
|
|
261
|
+
|
|
262
|
+
def list_task_runs(
|
|
263
|
+
self,
|
|
264
|
+
params: ListTaskRunsParams | None = None,
|
|
265
|
+
) -> list[TaskRunWithCursor]:
|
|
266
|
+
"""List task runs with optional filtering.
|
|
267
|
+
|
|
268
|
+
This corresponds to GET /task-runs in the API.
|
|
269
|
+
|
|
270
|
+
Args:
|
|
271
|
+
params: Optional parameters for filtering the results
|
|
272
|
+
|
|
273
|
+
Returns:
|
|
274
|
+
list[TaskRunWithCursor]: List of task runs with cursor info
|
|
275
|
+
|
|
276
|
+
Raises:
|
|
277
|
+
ClientError: For 4xx client errors (invalid parameters, unauthorized, etc.)
|
|
278
|
+
ServerError: For 5xx server errors and network failures
|
|
279
|
+
TimeoutError: If the request times out
|
|
280
|
+
"""
|
|
281
|
+
return self._list_task_runs_api_call(params).parsed
|
|
282
|
+
|
|
283
|
+
@handle_http_errors("list task runs")
|
|
284
|
+
def _list_task_runs_api_call(
|
|
285
|
+
self, params: ListTaskRunsParams | None = None
|
|
286
|
+
) -> Response[Error | list[TaskRunWithCursor]]:
|
|
287
|
+
"""Internal method to make the list task runs API call."""
|
|
288
|
+
# Convert params to API parameters
|
|
289
|
+
limit = params.limit if params and params.limit is not None else UNSET
|
|
290
|
+
cursor = params.cursor if params and params.cursor is not None else UNSET
|
|
291
|
+
owner_id = params.owner_id if params and params.owner_id is not None else UNSET
|
|
292
|
+
|
|
293
|
+
return list_task_runs.sync_detailed(
|
|
294
|
+
client=self.client.internal,
|
|
295
|
+
limit=limit,
|
|
296
|
+
cursor=cursor,
|
|
297
|
+
owner_id=owner_id,
|
|
298
|
+
)
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"""Experimental API exports."""
|
|
2
|
+
|
|
3
|
+
from render.experimental.experimental import ExperimentalService, StorageService
|
|
4
|
+
from render.experimental.experimental_sync import (
|
|
5
|
+
SyncExperimentalService,
|
|
6
|
+
SyncStorageService,
|
|
7
|
+
)
|
|
8
|
+
from render.experimental.object import (
|
|
9
|
+
DownloadResponse,
|
|
10
|
+
ObjectApi,
|
|
11
|
+
ObjectClient,
|
|
12
|
+
ObjectData,
|
|
13
|
+
OwnerID,
|
|
14
|
+
PutObjectResult,
|
|
15
|
+
Region,
|
|
16
|
+
ScopedObjectClient,
|
|
17
|
+
UploadResponse,
|
|
18
|
+
)
|
|
19
|
+
|
|
20
|
+
__all__ = [
|
|
21
|
+
# Experimental Service
|
|
22
|
+
"ExperimentalService",
|
|
23
|
+
"StorageService",
|
|
24
|
+
"SyncExperimentalService",
|
|
25
|
+
"SyncStorageService",
|
|
26
|
+
# Object API classes
|
|
27
|
+
"ObjectApi",
|
|
28
|
+
"ObjectClient",
|
|
29
|
+
"ScopedObjectClient",
|
|
30
|
+
# Object types
|
|
31
|
+
"DownloadResponse",
|
|
32
|
+
"ObjectData",
|
|
33
|
+
"OwnerID",
|
|
34
|
+
"PutObjectResult",
|
|
35
|
+
"Region",
|
|
36
|
+
"UploadResponse",
|
|
37
|
+
]
|