Instances
Get current instance details
Returns the details of the current logged in instance, using CRN from the request header.
Berechtigung
Um diese Methode aufrufen zu können, muss Ihnen mindestens eine IAM-Zugriffsrolle zugewiesen sein, die die folgenden Aktionen einschließt. Sie können Ihren Zugriff prüfen durch Aufrufen von Users > User > Access
quantum-computing.instance.read
Protokollierung
Der Aufruf dieser Methode generiert die folgenden Überwachungsereignisse.
quantum-computing.instance.read
Eingabe
Informationen |
|---|
| Dieser Endpunkt akzeptiert keine Eingaben. |
Wenn sich Ihre Instanz in der Region „eu-de“ befindet, verwenden Sie stattdessen diesen Link: URL: https://eu-de.quantum.cloud.ibm.com/api/v1/instance
curl -X GET \
'https://quantum.cloud.ibm.com/api/v1/instance' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer YOUR-TOKEN' \
-H 'Service-CRN: YOUR-SERVICE-CRN' \
-H 'IBM-API-Version: 2024-01-01' Wenn sich Ihre Instanz in der Region „eu-de“ befindet, verwenden Sie stattdessen diesen Link: URL: https://eu-de.quantum.cloud.ibm.com/api/v1/instance
import requests
response = requests.request(
"GET",
"https://quantum.cloud.ibm.com/api/v1/instance",
headers={
"Accept": "application/json",
"IBM-API-Version": "2024-01-01",
"Authorization": "Bearer YOUR-TOKEN",
"Service-CRN": "YOUR-SERVICE-CRN"
},
)
print(response.json())Ausgabe
Statuscode | Beschreibung |
|---|---|
| 200 | OK |
| 401 | Unauthorized |
| 403 | Forbidden |
| 404 | Not Found |
{
"backends": [
"ibm_backend"
],
"instance_limit": 60.7,
"instance_limit_seconds": "61",
"plan_id": "flex-plan-id-1",
"usage_allocation_seconds": "200"
}{
"type": "object",
"description": "Instance",
"properties": {
"backends": {
"type": "array",
"description": "List of backend systems or clusters associated with the service instance",
"items": {
"type": "string",
"pattern": "^.*$",
"minLength": 1,
"maxLength": 128,
"nullable": false
},
"minItems": 0,
"maxItems": 100
},
"instance_limit": {
"type": "number",
"format": "double",
"description": "Represents the instance limits in seconds; will be replaced by instance_limit_seconds",
"deprecated": true
},
"instance_limit_seconds": {
"type": "string",
"description": "Specifies the maximum number of resources time that can run on this instance"
},
"plan_id": {
"type": "string",
"description": "Identifier for the service plan associated with the instance as defined in Global Catalog",
"pattern": "^.*$",
"minLength": 1,
"maxLength": 128
},
"usage_allocation_seconds": {
"type": "string",
"description": "The maximum sum of allowable usage allocation on the instance."
}
}
}Get instance configuration
Deprecated: use Resource Controller to manage instance configuration. See /docs/guides/access-instances-platform-apis. Returns the configuration for the specified instance e.g. instance limit in seconds, using CRN from the request header.
Berechtigung
Um diese Methode aufrufen zu können, muss Ihnen mindestens eine IAM-Zugriffsrolle zugewiesen sein, die die folgenden Aktionen einschließt. Sie können Ihren Zugriff prüfen durch Aufrufen von Users > User > Access
quantum-computing.instance.configuration.read
Protokollierung
Der Aufruf dieser Methode generiert die folgenden Überwachungsereignisse.
quantum-computing.instance.configuration.read
Eingabe
Informationen |
|---|
| Dieser Endpunkt akzeptiert keine Eingaben. |
Wenn sich Ihre Instanz in der Region „eu-de“ befindet, verwenden Sie stattdessen diesen Link: URL: https://eu-de.quantum.cloud.ibm.com/api/v1/instances/configuration
curl -X GET \
'https://quantum.cloud.ibm.com/api/v1/instances/configuration' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer YOUR-TOKEN' \
-H 'Service-CRN: YOUR-SERVICE-CRN' \
-H 'IBM-API-Version: 2024-01-01' Wenn sich Ihre Instanz in der Region „eu-de“ befindet, verwenden Sie stattdessen diesen Link: URL: https://eu-de.quantum.cloud.ibm.com/api/v1/instances/configuration
import requests
response = requests.request(
"GET",
"https://quantum.cloud.ibm.com/api/v1/instances/configuration",
headers={
"Accept": "application/json",
"IBM-API-Version": "2024-01-01",
"Authorization": "Bearer YOUR-TOKEN",
"Service-CRN": "YOUR-SERVICE-CRN"
},
)
print(response.json())Ausgabe
Statuscode | Beschreibung |
|---|---|
| 200 | OK |
| 401 | Unauthorized |
| 403 | Forbidden |
| 404 | Not Found |
{
"instance_limit": 123456
}{
"type": "object",
"description": "Instance configuration",
"properties": {
"instance_limit": {
"type": "number",
"format": "double",
"description": "Instance usage limit in seconds"
}
}
}Update instance configuration
Deprecated: use Resource Controller to manage instance configuration. See /docs/guides/access-instances-platform-apis. Update the configuration for the specified instance e.g. instance limit in seconds, using CRN from context params of the request.
Berechtigung
Um diese Methode aufrufen zu können, muss Ihnen mindestens eine IAM-Zugriffsrolle zugewiesen sein, die die folgenden Aktionen einschließt. Sie können Ihren Zugriff prüfen durch Aufrufen von Users > User > Access
quantum-computing.instance.configuration.update
Protokollierung
Der Aufruf dieser Methode generiert die folgenden Überwachungsereignisse.
quantum-computing.instance.configuration.update
Eingabe
Name, Typ | Beschreibung |
|---|---|
instance_limit integer | This field can be null or an integer. Use null to reset/remove the instance limit. Mindestwert: 1Maximalwert: 2147483647 |
Wenn sich Ihre Instanz in der Region „eu-de“ befindet, verwenden Sie stattdessen diesen Link: URL: https://eu-de.quantum.cloud.ibm.com/api/v1/instances/configuration
curl -X PUT \
'https://quantum.cloud.ibm.com/api/v1/instances/configuration' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer YOUR-TOKEN' \
-H 'Service-CRN: YOUR-SERVICE-CRN' \
-H 'IBM-API-Version: 2024-01-01' Wenn sich Ihre Instanz in der Region „eu-de“ befindet, verwenden Sie stattdessen diesen Link: URL: https://eu-de.quantum.cloud.ibm.com/api/v1/instances/configuration
import requests
response = requests.request(
"PUT",
"https://quantum.cloud.ibm.com/api/v1/instances/configuration",
headers={
"Accept": "application/json",
"IBM-API-Version": "2024-01-01",
"Authorization": "Bearer YOUR-TOKEN",
"Service-CRN": "YOUR-SERVICE-CRN"
},
)
print(response.json())Ausgabe
Statuscode | Beschreibung |
|---|---|
| 204 | OK |
| 400 | Bad Request |
| 401 | Unauthorized |
| 403 | Forbidden |
| 404 | Not Found |
| 409 | Usage exceeds instance limit |
Get instance usage
Get instance usage
Berechtigung
Um diese Methode aufrufen zu können, muss Ihnen mindestens eine IAM-Zugriffsrolle zugewiesen sein, die die folgenden Aktionen einschließt. Sie können Ihren Zugriff prüfen durch Aufrufen von Users > User > Access
quantum-computing.instance-usage.read
Protokollierung
Der Aufruf dieser Methode generiert die folgenden Überwachungsereignisse.
quantum-computing.instance-usage.read
Eingabe
Informationen |
|---|
| Dieser Endpunkt akzeptiert keine Eingaben. |
Wenn sich Ihre Instanz in der Region „eu-de“ befindet, verwenden Sie stattdessen diesen Link: URL: https://eu-de.quantum.cloud.ibm.com/api/v1/instances/usage
curl -X GET \
'https://quantum.cloud.ibm.com/api/v1/instances/usage' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer YOUR-TOKEN' \
-H 'Service-CRN: YOUR-SERVICE-CRN' \
-H 'IBM-API-Version: 2024-01-01' Wenn sich Ihre Instanz in der Region „eu-de“ befindet, verwenden Sie stattdessen diesen Link: URL: https://eu-de.quantum.cloud.ibm.com/api/v1/instances/usage
import requests
response = requests.request(
"GET",
"https://quantum.cloud.ibm.com/api/v1/instances/usage",
headers={
"Accept": "application/json",
"IBM-API-Version": "2024-01-01",
"Authorization": "Bearer YOUR-TOKEN",
"Service-CRN": "YOUR-SERVICE-CRN"
},
)
print(response.json())Ausgabe
Statuscode | Beschreibung |
|---|---|
| 200 | |
| 401 | Unauthorized |
{
"instance_id": "example",
"plan_id": "example",
"usage_period": {
"start_time": "example",
"end_time": "example"
},
"usage_consumed_seconds": 12,
"usage_consumed_ru": 0.2,
"usage_limit_seconds": 60,
"usage_limit_ru": 1,
"usage_allocation_seconds": 120,
"usage_allocation_ru": 2,
"usage_limit_reached": true,
"time_available_at": "2024-01-01T00:00:00.000Z"
}{
"type": "object",
"properties": {
"instance_id": {
"type": "string"
},
"plan_id": {
"type": "string"
},
"usage_period": {
"description": "Start and end time of the usage period",
"allOf": [
{
"type": "object",
"properties": {
"start_time": {
"format": "date-time",
"type": "string",
"description": "The start time of the usage"
},
"end_time": {
"format": "date-time",
"type": "string",
"description": "The end time of the usage"
}
}
}
]
},
"usage_consumed_seconds": {
"type": "number",
"example": 12,
"description": "Usage consumed in the current usage period"
},
"usage_consumed_ru": {
"type": "number",
"example": 0.2,
"format": "float",
"description": "Usage consumed in the current usage period in resource units"
},
"usage_limit_seconds": {
"type": "number",
"example": 60,
"description": "The usage limit in seconds during the usage period"
},
"usage_limit_ru": {
"type": "number",
"example": 1,
"format": "float",
"description": "The usage limit in resource units during the usage period"
},
"usage_allocation_seconds": {
"type": "number",
"example": 120,
"description": "The seconds that are allocated for the instance during the usage period"
},
"usage_allocation_ru": {
"type": "number",
"example": 2,
"format": "float",
"description": "The resource units that are allocated for the instance during the usage period"
},
"usage_limit_reached": {
"type": "boolean",
"example": false,
"description": "true if the usage limit is reached. false if not reached. undefined if usage limits do not apply to this instance."
},
"time_available_at": {
"format": "date-time",
"type": "string",
"description": "The earliest datetime at which usage will fall below the instance limit due to old usage rolling out of the 28-day window. Only present when the instance-level limit is reached on a rolling window plan.",
"example": "2024-01-01T00:00:00.000Z",
"minLength": 20,
"maxLength": 29
}
},
"required": [
"instance_id",
"plan_id",
"usage_consumed_seconds",
"usage_consumed_ru"
]
}