Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds a Python sample to return the status of a running job #7

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion v1.0/SERVERLESS/custom-apis/using-your-api-copy.md
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ running your api via **/run** runs the code asynchronously, here's a sample resp
```Text cURL
curl https://api.runpod.ai/v2/<your-api-id>/status/<your-status-id>
```
```python
```python Start a job and return a status
# this requires the installation of runpod-python
# with `pip install runpod-python` beforehand

Expand All @@ -186,6 +186,18 @@ run_request = endpoint.run(

print(run_request.status())
```
```python Get the status of a running job
# Prerequisite: Install runpod-python using `pip install runpod-python`
import runpod

runpod.api_key = "xxxxxxxxxxxxxxxxxxxxxx" # Replace with your API key
client = runpod.endpoint.runner.RunPodClient()


job = runpod.endpoint.Job(endpoint_id="your_endpoint_id", job_id="your_job_id", client=client)

print(job.status())
```
<!-- dprint-ignore-end -->

**sample response (for job in progress)**
Expand Down
Loading