Instances
Get current instance details
Returns the details of the current logged in instance, using CRN from the request header.
Code samples
GET
/v1/instancecurl -X GET \
/api/v1/instance \
-H 'Authorization: Bearer YOUR-TOKEN' \
-H 'Accept: application/json'
import requests
response = requests.request(
"GET",
"/api/v1/instance",
headers={
"Accept": "application/json",
"Authorization": "Bearer YOUR_API_TOKEN_HERE"
},
)
print(response.json())
Responses
{
"qctrl_enabled": true
}
{
"type": "object",
"description": "Instance",
"properties": {
"qctrl_enabled": {
"type": "boolean",
"description": "Says whether instance is configured to run jobs using Q-Ctrl channel strategy",
"deprecated": true
}
}
}
Get instance configuration
Returns the configuration for the specified instance e.g. instance limit in seconds, using CRN from the request header.
Code samples
GET
/v1/instances/configurationcurl -X GET \
/api/v1/instances/configuration \
-H 'Authorization: Bearer YOUR-TOKEN' \
-H 'Accept: application/json'
import requests
response = requests.request(
"GET",
"/api/v1/instances/configuration",
headers={
"Accept": "application/json",
"Authorization": "Bearer YOUR_API_TOKEN_HERE"
},
)
print(response.json())
Responses
{
"instance_limit": 123456
}
{
"type": "object",
"description": "Instance configuration",
"properties": {
"instance_limit": {
"type": "number",
"format": "double",
"description": "Instance usage limit in seconds"
}
}
}
Update instance configuration
Update the configuration for the specified instance e.g. instance limit in seconds, using CRN from context params of the request.
HTTP Response Status Codes
Status code | Description |
---|---|
204 | OK |
400 | Bad Request |
401 | Unauthorized |
403 | Forbidden |
404 | Not Found |
409 | Usage exceeds instance limit |
Code samples
PUT
/v1/instances/configurationcurl -X PUT \
/api/v1/instances/configuration \
-H 'Authorization: Bearer YOUR-TOKEN' \
-H 'Accept: application/json'
import requests
response = requests.request(
"PUT",
"/api/v1/instances/configuration",
headers={
"Accept": "application/json",
"Authorization": "Bearer YOUR_API_TOKEN_HERE"
},
)
print(response.json())
Responses
OK
OK
Get instance usage (all time usage)
Returns the usage value in seconds for the specified instance, using CRN from context params of the request.
HTTP Response Status Codes
Status code | Description |
---|---|
200 | OK |
401 | Unauthorized |
403 | Forbidden |
404 | Not Found |
500 | Internal error |
Code samples
GET
/v1/instances/usagecurl -X GET \
/api/v1/instances/usage \
-H 'Authorization: Bearer YOUR-TOKEN' \
-H 'Accept: application/json'
import requests
response = requests.request(
"GET",
"/api/v1/instances/usage",
headers={
"Accept": "application/json",
"Authorization": "Bearer YOUR_API_TOKEN_HERE"
},
)
print(response.json())
Responses
{
"bss": {
"seconds": 123
},
"usage": {
"quantum_seconds": 123,
"seconds": 123
}
}
{
"type": "object",
"description": "Instance usage metrics including total classical and quantum execution times.",
"properties": {
"bss": {
"type": "object",
"description": "Contains information about instance usage metrics",
"properties": {
"seconds": {
"type": "integer",
"description": "Total billed time for the instance - quantum seconds only."
}
},
"required": [
"seconds"
]
},
"usage": {
"type": "object",
"description": "Contains information about job usage metrics",
"properties": {
"quantum_seconds": {
"type": "integer",
"format": "int64",
"description": "Total quantum seconds used by the instance"
},
"seconds": {
"type": "integer",
"description": "Total billed time for the instance - quantum seconds only."
}
}
}
},
"required": [
"bss"
]
}
Was this page helpful?
Report a bug or request content on GitHub.