Workloads
List hub workloads
List hub workloads
Query Parameters
Name, Type | Description |
---|---|
sort string | Field to sort the workloads by Possible values: createdAt Default value: createdAt |
order string | Order to sort the workloads by Possible values: asc desc Default value: desc |
limit number | Number of workloads to return at a time Default value: 10 |
previous string | Cursor to previous workloads result page |
next string | Cursor to next workloads result page |
instance Required string | Instance of jobs and sessions. It can be a hub, a hub/group or a hub/group/project. Mandatory. |
backend string | Backend name |
search string | Optional search string, used to filter workloads by id or tags |
status string[] | Status type to filter workloads by. It can be pending, in_progress, failed, completed or canceled. |
mode string | Workload mode: job, session or batch |
createdAfter string | Filter jobs and session created after this date |
createdBefore string | Filter jobs and session created before this date |
tags string[] | Optional array of tags for the workloads |
userId string | User id to filter workloads by user. |
HTTP Response Status Codes
Status code | Description |
---|---|
200 | |
401 | Unauthorized |
Code samples
curl -X GET \
https://api.quantum-computing.ibm.com/runtime/workloads/admin \
-H 'Authorization: Bearer YOUR-TOKEN' \
-H 'Accept: application/json'
import requests
response = requests.request(
"GET",
"https://api.quantum-computing.ibm.com/runtime/workloads/admin",
headers={
"Accept": "application/json",
"Authorization": "Bearer YOUR_API_TOKEN_HERE"
},
)
print(response.json())
Responses
{
"workloads": [
{
"id": "ch8b1ok4k9li68vm059r",
"created": "2024-07-04T16:13:56.562Z",
"ended": "2024-07-04T16:13:56.562Z",
"backend": "ibm_seattle",
"instance": "ibmq/open/main",
"user_id": "65f0478ed32a1891af0a8d31",
"accepting_jobs": true,
"mode": "job",
"status": "in_progress",
"status_reason": "Error occurred for job circuit-runner_ckodgbs1fc4b8ufrjsd0_d35e_2. Stale payload, retry maximum reached.",
"tags": [
"test-job",
"foo",
"bar"
],
"usage_seconds": 1,
"estimated_running_time_seconds": 123,
"estimated_start_time_seconds": 123
}
],
"count": 5,
"limit": 5,
"previous": "example",
"next": "example"
}
{
"type": "object",
"properties": {
"workloads": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "Workload id (job and session id)",
"example": "ch8b1ok4k9li68vm059r"
},
"created": {
"type": "string",
"description": "Creation date",
"example": "2024-07-04T16:13:56.562Z"
},
"ended": {
"type": "string",
"description": "End date",
"example": "2024-07-04T16:13:56.562Z"
},
"backend": {
"type": "string",
"description": "Backend name",
"example": "ibm_seattle"
},
"instance": {
"type": "string",
"description": "Instance as hub/group/project",
"example": "ibmq/open/main"
},
"user_id": {
"type": "string",
"description": "User id",
"example": "65f0478ed32a1891af0a8d31"
},
"accepting_jobs": {
"type": "number",
"description": "true if the session accepts jobs, false otherwise. Only for sessions, null for jobs",
"example": true,
"nullable": true
},
"mode": {
"type": "string",
"description": "Workload mode: job, session or batch",
"example": "job",
"enum": [
"job",
"session",
"batch"
]
},
"status": {
"type": "string",
"description": "State for the workload.",
"example": "in_progress",
"enum": [
"completed",
"canceled",
"failed",
"pending",
"in_progress",
"unknown"
]
},
"status_reason": {
"type": "string",
"description": "Jobs only, status reason for the job",
"example": "Error occurred for job circuit-runner_ckodgbs1fc4b8ufrjsd0_d35e_2. Stale payload, retry maximum reached."
},
"tags": {
"description": "Tags for the jobs",
"example": [
"test-job",
"foo",
"bar"
],
"type": "array",
"items": {
"type": "string"
}
},
"usage_seconds": {
"type": "number",
"description": "Usage in seconds. Can be null for ongoing workloads.",
"example": 1
},
"estimated_running_time_seconds": {
"type": "number",
"description": "Estimated running time in seconds. Only for jobs, null for sessions",
"example": 123,
"nullable": true
},
"estimated_start_time_seconds": {
"type": "number",
"description": "Estimated start time in seconds. Only for jobs, null for sessions",
"example": 123
}
},
"required": [
"id",
"created",
"backend",
"instance",
"user_id",
"mode",
"status"
]
}
},
"count": {
"type": "number",
"example": 5
},
"limit": {
"type": "number",
"example": 5
},
"previous": {
"type": "string",
"example": 0
},
"next": {
"type": "string",
"example": 0
}
},
"required": [
"workloads",
"count",
"limit"
]
}
List user workloads
List user workloads
Query Parameters
Name, Type | Description |
---|---|
sort string | Field to sort the workloads by Possible values: createdAt Default value: createdAt |
order string | Order to sort the workloads by Possible values: asc desc Default value: desc |
limit number | Number of workloads to return at a time Default value: 10 |
previous string | Cursor to previous workloads result page |
next string | Cursor to next workloads result page |
instance string | Instance of jobs and sessions. It must be a hub/group/project and the user must be collaborator. |
backend string | Backend name |
search string | Optional search string, used to filter workloads by id or tags |
status string[] | Status type to filter workloads by. It can be pending, in_progress, failed, completed or canceled. |
mode string | Workload mode: job, session or batch |
createdAfter string | Filter jobs and session created after this date |
createdBefore string | Filter jobs and session created before this date |
tags string[] | Optional array of tags for the workloads |
HTTP Response Status Codes
Status code | Description |
---|---|
200 | |
401 | Unauthorized |
Code samples
curl -X GET \
https://api.quantum-computing.ibm.com/runtime/workloads/me \
-H 'Authorization: Bearer YOUR-TOKEN' \
-H 'Accept: application/json'
import requests
response = requests.request(
"GET",
"https://api.quantum-computing.ibm.com/runtime/workloads/me",
headers={
"Accept": "application/json",
"Authorization": "Bearer YOUR_API_TOKEN_HERE"
},
)
print(response.json())
Responses
{
"workloads": [
{
"id": "ch8b1ok4k9li68vm059r",
"created": "2024-07-04T16:13:56.562Z",
"ended": "2024-07-04T16:13:56.562Z",
"backend": "ibm_seattle",
"instance": "ibmq/open/main",
"user_id": "65f0478ed32a1891af0a8d31",
"accepting_jobs": true,
"mode": "job",
"status": "in_progress",
"status_reason": "Error occurred for job circuit-runner_ckodgbs1fc4b8ufrjsd0_d35e_2. Stale payload, retry maximum reached.",
"tags": [
"test-job",
"foo",
"bar"
],
"usage_seconds": 1,
"estimated_running_time_seconds": 123,
"estimated_start_time_seconds": 123
}
],
"count": 5,
"limit": 5,
"previous": "example",
"next": "example"
}
{
"type": "object",
"properties": {
"workloads": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "Workload id (job and session id)",
"example": "ch8b1ok4k9li68vm059r"
},
"created": {
"type": "string",
"description": "Creation date",
"example": "2024-07-04T16:13:56.562Z"
},
"ended": {
"type": "string",
"description": "End date",
"example": "2024-07-04T16:13:56.562Z"
},
"backend": {
"type": "string",
"description": "Backend name",
"example": "ibm_seattle"
},
"instance": {
"type": "string",
"description": "Instance as hub/group/project",
"example": "ibmq/open/main"
},
"user_id": {
"type": "string",
"description": "User id",
"example": "65f0478ed32a1891af0a8d31"
},
"accepting_jobs": {
"type": "number",
"description": "true if the session accepts jobs, false otherwise. Only for sessions, null for jobs",
"example": true,
"nullable": true
},
"mode": {
"type": "string",
"description": "Workload mode: job, session or batch",
"example": "job",
"enum": [
"job",
"session",
"batch"
]
},
"status": {
"type": "string",
"description": "State for the workload.",
"example": "in_progress",
"enum": [
"completed",
"canceled",
"failed",
"pending",
"in_progress",
"unknown"
]
},
"status_reason": {
"type": "string",
"description": "Jobs only, status reason for the job",
"example": "Error occurred for job circuit-runner_ckodgbs1fc4b8ufrjsd0_d35e_2. Stale payload, retry maximum reached."
},
"tags": {
"description": "Tags for the jobs",
"example": [
"test-job",
"foo",
"bar"
],
"type": "array",
"items": {
"type": "string"
}
},
"usage_seconds": {
"type": "number",
"description": "Usage in seconds. Can be null for ongoing workloads.",
"example": 1
},
"estimated_running_time_seconds": {
"type": "number",
"description": "Estimated running time in seconds. Only for jobs, null for sessions",
"example": 123,
"nullable": true
},
"estimated_start_time_seconds": {
"type": "number",
"description": "Estimated start time in seconds. Only for jobs, null for sessions",
"example": 123
}
},
"required": [
"id",
"created",
"backend",
"instance",
"user_id",
"mode",
"status"
]
}
},
"count": {
"type": "number",
"example": 5
},
"limit": {
"type": "number",
"example": 5
},
"previous": {
"type": "string",
"example": 0
},
"next": {
"type": "string",
"example": 0
}
},
"required": [
"workloads",
"count",
"limit"
]
}