Analytics
Get analytics filters
Get analytics filters
Autorização
Para chamar esse método, deve-se ter sido designado a uma ou mais funções de acesso do IAM que incluam as ações a seguir. É possível verificar seu acesso indo para Users > User > Access
quantum-computing.account-analytics-filters.read
Auditoria
A chamada desse método gera os seguintes eventos de auditoria.
quantum-computing.account-analytics-filters.read
Entrada
Nome, Tipo | Descrição |
|---|---|
instance string[] | Exemplo: "crn:v1:staging:public:quantum-computing:region:a/account:instance::" |
Se sua instância estiver na região eu-de, use este link: URL: https://eu-de.quantum.cloud.ibm.com/api/v1/analytics/filters
curl -X GET \
'https://quantum.cloud.ibm.com/api/v1/analytics/filters' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer YOUR-TOKEN' \
-H 'Service-CRN: YOUR-SERVICE-CRN' \
-H 'IBM-API-Version: 2024-01-01' Se sua instância estiver na região eu-de, use este link: URL: https://eu-de.quantum.cloud.ibm.com/api/v1/analytics/filters
import requests
response = requests.request(
"GET",
"https://quantum.cloud.ibm.com/api/v1/analytics/filters",
headers={
"Accept": "application/json",
"IBM-API-Version": "2024-01-01",
"Authorization": "Bearer YOUR-TOKEN",
"Service-CRN": "YOUR-SERVICE-CRN"
},
)
print(response.json())Saída
Código de status | Descrição |
|---|---|
| 200 | |
| 401 | Unauthorized |
| 403 | Forbidden |
| 404 | Not found |
| 500 | Internal server error |
{
"backends": [
{
"name": "simulator"
}
],
"instances": [
{
"id": "crn:v1:staging:public:quantum-computing:region:a/account:",
"deleted": true
}
],
"users": [
{
"id": "123"
}
],
"plans": [
{
"name": "premium"
}
],
"subscriptions": [
{
"id": "7f666d17-7893-47d8-bf9d-2b2389fc4dfc",
"name": "premium"
}
]
}{
"type": "object",
"properties": {
"backends": {
"type": "array",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string",
"example": "simulator"
}
},
"required": [
"name"
]
}
},
"instances": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"example": "crn:v1:staging:public:quantum-computing:region:a/account:"
},
"deleted": {
"type": "boolean"
}
},
"required": [
"id",
"deleted"
]
}
},
"users": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"example": "123"
}
},
"required": [
"id"
]
}
},
"plans": {
"type": "array",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string",
"example": "premium"
}
},
"required": [
"name"
]
}
},
"subscriptions": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"example": "7f666d17-7893-47d8-bf9d-2b2389fc4dfc"
},
"name": {
"type": "string",
"example": "premium"
}
},
"required": [
"id",
"name"
]
}
}
},
"required": [
"backends",
"instances",
"users",
"plans",
"subscriptions"
]
}Get usage analytics
Get usage analytics
Autorização
Para chamar esse método, deve-se ter sido designado a uma ou mais funções de acesso do IAM que incluam as ações a seguir. É possível verificar seu acesso indo para Users > User > Access
quantum-computing.account-analytics-usage.read
Auditoria
A chamada desse método gera os seguintes eventos de auditoria.
quantum-computing.account-analytics-usage.read
Entrada
Nome, Tipo | Descrição |
|---|---|
instance string[] | Exemplo: "crn:v1:staging:public:quantum-computing:region:a/account:instance::" |
interval_start string | Exemplo: "2024-01-01T00:00:00.000Z" |
interval_end string | Exemplo: "2024-01-01T00:00:00.000Z" |
backend string[] | Quantum backends to filter by. Note: functions have no backend association and are omitted when this filter is active. Exemplo: "ibm_tenerife" |
user_id string[] | Exemplo: "123" |
simulators boolean | Include simulators Valor Padrão: true |
plan string[] | Exemplo: "premium" |
subscription_id string[] | The subscription ID whose analytics are being requested. Could be a single ID or an array of IDs. Exemplo: ["91b2c828-2952-4f05-aed8-bedf92c6c480"] |
function_name string[] | Function names to filter by. Jobs and sessions with no function association are excluded when this filter is active. Exemplo: ["sampler"] |
Se sua instância estiver na região eu-de, use este link: URL: https://eu-de.quantum.cloud.ibm.com/api/v1/analytics/usage
curl -X GET \
'https://quantum.cloud.ibm.com/api/v1/analytics/usage' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer YOUR-TOKEN' \
-H 'Service-CRN: YOUR-SERVICE-CRN' \
-H 'IBM-API-Version: 2024-01-01' Se sua instância estiver na região eu-de, use este link: URL: https://eu-de.quantum.cloud.ibm.com/api/v1/analytics/usage
import requests
response = requests.request(
"GET",
"https://quantum.cloud.ibm.com/api/v1/analytics/usage",
headers={
"Accept": "application/json",
"IBM-API-Version": "2024-01-01",
"Authorization": "Bearer YOUR-TOKEN",
"Service-CRN": "YOUR-SERVICE-CRN"
},
)
print(response.json())Saída
Código de status | Descrição |
|---|---|
| 200 | |
| 401 | Unauthorized |
| 403 | Forbidden |
| 404 | Not found |
| 500 | Internal server error |
{
"usage": 10,
"usage_ru": 0.0002,
"jobs": 10,
"sessions": 10,
"sessions_usage": 10,
"sessions_usage_ru": 0.0002,
"avg_sessions_usage": 10,
"avg_sessions_usage_ru": 0.0002,
"max_sessions_usage": 10,
"max_sessions_usage_ru": 0.0002,
"batch_sessions": 10,
"batch_sessions_usage": 10,
"batch_sessions_usage_ru": 0.0002,
"avg_batch_sessions_usage": 10,
"avg_batch_sessions_usage_ru": 0.0002,
"max_batch_sessions_usage": 10,
"max_batch_sessions_usage_ru": 0.0002,
"dedicated_sessions": 10,
"dedicated_sessions_usage": 10,
"dedicated_sessions_usage_ru": 0.0002,
"avg_dedicated_sessions_usage": 10,
"avg_dedicated_sessions_usage_ru": 0.0002,
"max_dedicated_sessions_usage": 10,
"max_dedicated_sessions_usage_ru": 0.0002,
"individual_jobs": 10,
"individual_jobs_usage": 10,
"individual_jobs_usage_ru": 0.0002,
"avg_individual_jobs_usage": 10,
"avg_individual_jobs_usage_ru": 0.0002,
"max_individual_jobs_usage": 10,
"max_individual_jobs_usage_ru": 0.0002,
"queue_time": 10,
"avg_queue_time": 10,
"max_queue_time": 10,
"functions": 10,
"functions_usage_ru": 0.0002,
"avg_functions_usage_ru": 0.0002,
"max_functions_usage_ru": 0.0002,
"functions_quantum_usage_ms": 10,
"functions_quantum_usage_ru": 0.0002,
"functions_classical_usage_ru": 0.0002,
"functions_license_cost_ru": 0.0002
}{
"type": "object",
"properties": {
"usage": {
"type": "number",
"example": 10,
"description": "Total usage (in milliseconds). Sum of sessions, individual jobs, and functions quantum usage."
},
"usage_ru": {
"type": "number",
"example": 0.0002,
"format": "float",
"description": "Total usage (in resource units). Sum of sessions, individual jobs, and total functions usage (quantum, classical, and license cost)."
},
"jobs": {
"type": "number",
"example": 10,
"description": "Total number of jobs"
},
"sessions": {
"type": "number",
"example": 10,
"description": "Total number of sessions"
},
"sessions_usage": {
"type": "number",
"example": 10,
"description": "Total sessions usage (in milliseconds)"
},
"sessions_usage_ru": {
"type": "number",
"example": 0.0002,
"format": "float",
"description": "Total sessions usage (in resource units)"
},
"avg_sessions_usage": {
"type": "number",
"example": 10,
"description": "Average sessions usage (in milliseconds)"
},
"avg_sessions_usage_ru": {
"type": "number",
"example": 0.0002,
"format": "float",
"description": "Average sessions usage (in resource units)"
},
"max_sessions_usage": {
"type": "number",
"example": 10,
"description": "Max sessions usage (in milliseconds)"
},
"max_sessions_usage_ru": {
"type": "number",
"example": 0.0002,
"format": "float",
"description": "Max sessions usage (in resource units)"
},
"batch_sessions": {
"type": "number",
"example": 10,
"description": "Total number of batch sessions"
},
"batch_sessions_usage": {
"type": "number",
"example": 10,
"description": "Total batch sessions usage (in milliseconds)"
},
"batch_sessions_usage_ru": {
"type": "number",
"example": 0.0002,
"format": "float",
"description": "Total batch sessions usage (in resource units)"
},
"avg_batch_sessions_usage": {
"type": "number",
"example": 10,
"description": "Average batch sessions usage (in milliseconds)"
},
"avg_batch_sessions_usage_ru": {
"type": "number",
"example": 0.0002,
"format": "float",
"description": "Average batch sessions usage (in resource units)"
},
"max_batch_sessions_usage": {
"type": "number",
"example": 10,
"description": "Max batch sessions usage (in milliseconds)"
},
"max_batch_sessions_usage_ru": {
"type": "number",
"example": 0.0002,
"format": "float",
"description": "Max batch sessions usage (in resource units)"
},
"dedicated_sessions": {
"type": "number",
"example": 10,
"description": "Total number of dedicated sessions"
},
"dedicated_sessions_usage": {
"type": "number",
"example": 10,
"description": "Total dedicated sessions usage (in milliseconds)"
},
"dedicated_sessions_usage_ru": {
"type": "number",
"example": 0.0002,
"format": "float",
"description": "Total dedicated sessions usage (in resource units)"
},
"avg_dedicated_sessions_usage": {
"type": "number",
"example": 10,
"description": "Average dedicated sessions usage (in milliseconds)"
},
"avg_dedicated_sessions_usage_ru": {
"type": "number",
"example": 0.0002,
"format": "float",
"description": "Average dedicated sessions usage (in resource units)"
},
"max_dedicated_sessions_usage": {
"type": "number",
"example": 10,
"description": "Max dedicated sessions usage (in milliseconds)"
},
"max_dedicated_sessions_usage_ru": {
"type": "number",
"example": 0.0002,
"format": "float",
"description": "Max dedicated sessions usage (in resource units)"
},
"individual_jobs": {
"type": "number",
"example": 10,
"description": "Total number of individual jobs"
},
"individual_jobs_usage": {
"type": "number",
"example": 10,
"description": "Total individual jobs usage (in milliseconds)"
},
"individual_jobs_usage_ru": {
"type": "number",
"example": 0.0002,
"format": "float",
"description": "Total individual jobs usage (in resource units)"
},
"avg_individual_jobs_usage": {
"type": "number",
"example": 10,
"description": "Average individual jobs usage (in milliseconds)"
},
"avg_individual_jobs_usage_ru": {
"type": "number",
"example": 0.0002,
"format": "float",
"description": "Average individual jobs usage (in resource units)"
},
"max_individual_jobs_usage": {
"type": "number",
"example": 10,
"description": "Max individual jobs usage (in milliseconds)"
},
"max_individual_jobs_usage_ru": {
"type": "number",
"example": 0.0002,
"format": "float",
"description": "Max individual jobs usage (in resource units)"
},
"queue_time": {
"type": "number",
"example": 10,
"description": "Total queue time (in milliseconds)"
},
"avg_queue_time": {
"type": "number",
"example": 10,
"description": "Average queue time (in milliseconds)"
},
"max_queue_time": {
"type": "number",
"example": 10,
"description": "Max queue time (in milliseconds)"
},
"functions": {
"type": "number",
"example": 10,
"description": "Total number of functions. Omitted when the backend filter is specified, as functions usage is not associated with any specific backend, or when functions workload is not requested."
},
"functions_usage_ru": {
"type": "number",
"example": 0.0002,
"format": "float",
"description": "Total functions usage (in resource units). Omitted when the backend filter is specified, as functions usage is not associated with any specific backend, or when functions workload is not requested."
},
"avg_functions_usage_ru": {
"type": "number",
"example": 0.0002,
"format": "float",
"description": "Average functions usage (in resource units). Omitted when the backend filter is specified, as functions usage is not associated with any specific backend, or when functions workload is not requested."
},
"max_functions_usage_ru": {
"type": "number",
"example": 0.0002,
"format": "float",
"description": "Max functions usage (in resource units). Omitted when the backend filter is specified, as functions usage is not associated with any specific backend, or when functions workload is not requested."
},
"functions_quantum_usage_ms": {
"type": "number",
"example": 10,
"description": "Functions total quantum usage (in milliseconds). Omitted when the backend filter is specified, as functions usage is not associated with any specific backend, or when functions workload is not requested."
},
"functions_quantum_usage_ru": {
"type": "number",
"example": 0.0002,
"format": "float",
"description": "Functions total quantum usage (in resource units). Omitted when the backend filter is specified, as functions usage is not associated with any specific backend, or when functions workload is not requested."
},
"functions_classical_usage_ru": {
"type": "number",
"example": 0.0002,
"format": "float",
"description": "Functions total classical usage (in resource units). Omitted when the backend filter is specified, as functions usage is not associated with any specific backend, or when functions workload is not requested."
},
"functions_license_cost_ru": {
"type": "number",
"example": 0.0002,
"format": "float",
"description": "Functions total license cost (in resource units). Omitted when the backend filter is specified, as functions usage is not associated with any specific backend, or when functions workload is not requested."
}
},
"required": [
"usage",
"usage_ru",
"jobs",
"sessions",
"sessions_usage",
"sessions_usage_ru",
"avg_sessions_usage",
"avg_sessions_usage_ru",
"max_sessions_usage",
"max_sessions_usage_ru",
"batch_sessions",
"batch_sessions_usage",
"batch_sessions_usage_ru",
"avg_batch_sessions_usage",
"avg_batch_sessions_usage_ru",
"max_batch_sessions_usage",
"max_batch_sessions_usage_ru",
"dedicated_sessions",
"dedicated_sessions_usage",
"dedicated_sessions_usage_ru",
"avg_dedicated_sessions_usage",
"avg_dedicated_sessions_usage_ru",
"max_dedicated_sessions_usage",
"max_dedicated_sessions_usage_ru",
"individual_jobs",
"individual_jobs_usage",
"individual_jobs_usage_ru",
"avg_individual_jobs_usage",
"avg_individual_jobs_usage_ru",
"max_individual_jobs_usage",
"max_individual_jobs_usage_ru",
"queue_time",
"avg_queue_time",
"max_queue_time"
]
}Get usage analytics grouped
Get usage analytics grouped
Autorização
Para chamar esse método, deve-se ter sido designado a uma ou mais funções de acesso do IAM que incluam as ações a seguir. É possível verificar seu acesso indo para Users > User > Access
quantum-computing.account-analytics-usage.read
Auditoria
A chamada desse método gera os seguintes eventos de auditoria.
quantum-computing.account-analytics-usage.read
Entrada
Nome, Tipo | Descrição |
|---|---|
group_by Necessário string | key to group usage by Valores possíveis: instancebackenduser_idplansubscription_idfunction_nameExemplo: "instance" |
instance string[] | Exemplo: "crn:v1:staging:public:quantum-computing:region:a/account:instance::" |
interval_start string | start date Exemplo: "2024-01-01T00:00:00.000Z" |
interval_end string | end date Exemplo: "2024-01-01T00:00:00.000Z" |
backend string[] | backend to filter by Exemplo: "ibm_tenerife" |
user_id string[] | Exemplo: "123" |
simulators boolean | Include simulators Valor Padrão: true |
plan string[] | Exemplo: "premium" |
subscription_id string[] | The subscription ID whose analytics are being requested. Could be a single ID or an array of IDs. Exemplo: ["91b2c828-2952-4f05-aed8-bedf92c6c480"] |
function_name string[] | Function names to filter by. Jobs and sessions with no function association are excluded when this filter is active. Exemplo: ["sampler"] |
Se sua instância estiver na região eu-de, use este link: URL: https://eu-de.quantum.cloud.ibm.com/api/v1/analytics/usage_grouped
curl -X GET \
'https://quantum.cloud.ibm.com/api/v1/analytics/usage_grouped' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer YOUR-TOKEN' \
-H 'Service-CRN: YOUR-SERVICE-CRN' \
-H 'IBM-API-Version: 2024-01-01' Se sua instância estiver na região eu-de, use este link: URL: https://eu-de.quantum.cloud.ibm.com/api/v1/analytics/usage_grouped
import requests
response = requests.request(
"GET",
"https://quantum.cloud.ibm.com/api/v1/analytics/usage_grouped",
headers={
"Accept": "application/json",
"IBM-API-Version": "2024-01-01",
"Authorization": "Bearer YOUR-TOKEN",
"Service-CRN": "YOUR-SERVICE-CRN"
},
)
print(response.json())Saída
Código de status | Descrição |
|---|---|
| 200 | |
| 401 | Unauthorized |
| 403 | Forbidden |
| 404 | Not found |
| 500 | Internal server error |
{
"data": [
{
"key": "ibm-q/main/open",
"usage": 10,
"usage_ru": 0.0002,
"jobs": 10,
"sessions": 10,
"sessions_usage": 10,
"sessions_usage_ru": 0.0002,
"avg_sessions_usage": 10,
"avg_sessions_usage_ru": 0.0002,
"max_sessions_usage": 10,
"max_sessions_usage_ru": 0.0002,
"batch_sessions": 10,
"batch_sessions_usage": 10,
"batch_sessions_usage_ru": 0.0002,
"avg_batch_sessions_usage": 10,
"avg_batch_sessions_usage_ru": 0.0002,
"max_batch_sessions_usage": 10,
"max_batch_sessions_usage_ru": 0.0002,
"dedicated_sessions": 10,
"dedicated_sessions_usage": 10,
"dedicated_sessions_usage_ru": 0.0002,
"avg_dedicated_sessions_usage": 10,
"avg_dedicated_sessions_usage_ru": 0.0002,
"max_dedicated_sessions_usage": 10,
"max_dedicated_sessions_usage_ru": 0.0002,
"individual_jobs": 10,
"individual_jobs_usage": 10,
"individual_jobs_usage_ru": 0.0002,
"avg_individual_jobs_usage": 10,
"avg_individual_jobs_usage_ru": 0.0002,
"max_individual_jobs_usage": 10,
"max_individual_jobs_usage_ru": 0.0002,
"queue_time": 10,
"avg_queue_time": 10,
"max_queue_time": 10,
"functions": 10,
"functions_usage_ru": 0.0002,
"avg_functions_usage_ru": 0.0002,
"max_functions_usage_ru": 0.0002,
"functions_quantum_usage_ms": 10,
"functions_quantum_usage_ru": 0.0002,
"functions_classical_usage_ru": 0.0002,
"functions_license_cost_ru": 0.0002
}
]
}{
"type": "object",
"properties": {
"data": {
"description": "Data",
"type": "array",
"items": {
"type": "object",
"properties": {
"key": {
"type": "string",
"example": "ibm-q/main/open",
"description": "Grouping key",
"nullable": true
},
"usage": {
"type": "number",
"example": 10,
"description": "Total usage (in milliseconds)"
},
"usage_ru": {
"type": "number",
"example": 0.0002,
"format": "float",
"description": "Total usage (in resource units)"
},
"jobs": {
"type": "number",
"example": 10,
"description": "Total number of jobs"
},
"sessions": {
"type": "number",
"example": 10,
"description": "Total number of sessions"
},
"sessions_usage": {
"type": "number",
"example": 10,
"description": "Total sessions usage (in milliseconds)"
},
"sessions_usage_ru": {
"type": "number",
"example": 0.0002,
"format": "float",
"description": "Total sessions usage (in resource units)"
},
"avg_sessions_usage": {
"type": "number",
"example": 10,
"description": "Average sessions usage (in milliseconds)"
},
"avg_sessions_usage_ru": {
"type": "number",
"example": 0.0002,
"format": "float",
"description": "Average sessions usage (in resource units)"
},
"max_sessions_usage": {
"type": "number",
"example": 10,
"description": "Max sessions usage (in milliseconds)"
},
"max_sessions_usage_ru": {
"type": "number",
"example": 0.0002,
"format": "float",
"description": "Max sessions usage (in resource units)"
},
"batch_sessions": {
"type": "number",
"example": 10,
"description": "Total number of batch sessions"
},
"batch_sessions_usage": {
"type": "number",
"example": 10,
"description": "Total batch sessions usage (in milliseconds)"
},
"batch_sessions_usage_ru": {
"type": "number",
"example": 0.0002,
"format": "float",
"description": "Total batch sessions usage (in resource units)"
},
"avg_batch_sessions_usage": {
"type": "number",
"example": 10,
"description": "Average batch sessions usage (in milliseconds)"
},
"avg_batch_sessions_usage_ru": {
"type": "number",
"example": 0.0002,
"format": "float",
"description": "Average batch sessions usage (in resource units)"
},
"max_batch_sessions_usage": {
"type": "number",
"example": 10,
"description": "Max batch sessions usage (in milliseconds)"
},
"max_batch_sessions_usage_ru": {
"type": "number",
"example": 0.0002,
"format": "float",
"description": "Max batch sessions usage (in resource units)"
},
"dedicated_sessions": {
"type": "number",
"example": 10,
"description": "Total number of dedicated sessions"
},
"dedicated_sessions_usage": {
"type": "number",
"example": 10,
"description": "Total dedicated sessions usage (in milliseconds)"
},
"dedicated_sessions_usage_ru": {
"type": "number",
"example": 0.0002,
"format": "float",
"description": "Total dedicated sessions usage (in resource units)"
},
"avg_dedicated_sessions_usage": {
"type": "number",
"example": 10,
"description": "Average dedicated sessions usage (in milliseconds)"
},
"avg_dedicated_sessions_usage_ru": {
"type": "number",
"example": 0.0002,
"format": "float",
"description": "Average dedicated sessions usage (in resource units)"
},
"max_dedicated_sessions_usage": {
"type": "number",
"example": 10,
"description": "Max dedicated sessions usage (in milliseconds)"
},
"max_dedicated_sessions_usage_ru": {
"type": "number",
"example": 0.0002,
"format": "float",
"description": "Max dedicated sessions usage (in resource units)"
},
"individual_jobs": {
"type": "number",
"example": 10,
"description": "Total number of individual jobs"
},
"individual_jobs_usage": {
"type": "number",
"example": 10,
"description": "Total individual jobs usage (in milliseconds)"
},
"individual_jobs_usage_ru": {
"type": "number",
"example": 0.0002,
"format": "float",
"description": "Total individual jobs usage (in resource units)"
},
"avg_individual_jobs_usage": {
"type": "number",
"example": 10,
"description": "Average individual jobs usage (in milliseconds)"
},
"avg_individual_jobs_usage_ru": {
"type": "number",
"example": 0.0002,
"format": "float",
"description": "Average individual jobs usage (in resource units)"
},
"max_individual_jobs_usage": {
"type": "number",
"example": 10,
"description": "Max individual jobs usage (in milliseconds)"
},
"max_individual_jobs_usage_ru": {
"type": "number",
"example": 0.0002,
"format": "float",
"description": "Max individual jobs usage (in resource units)"
},
"queue_time": {
"type": "number",
"example": 10,
"description": "Total queue time (in milliseconds)"
},
"avg_queue_time": {
"type": "number",
"example": 10,
"description": "Average queue time (in milliseconds)"
},
"max_queue_time": {
"type": "number",
"example": 10,
"description": "Max queue time (in milliseconds)"
},
"functions": {
"type": "number",
"example": 10,
"description": "Total number of functions. Omitted when the backend filter is specified, as functions usage is not associated with any specific backend, or when functions workload is not requested."
},
"functions_usage_ru": {
"type": "number",
"example": 0.0002,
"format": "float",
"description": "Total functions usage (in resource units). Omitted when the backend filter is specified, as functions usage is not associated with any specific backend, or when functions workload is not requested."
},
"avg_functions_usage_ru": {
"type": "number",
"example": 0.0002,
"format": "float",
"description": "Average functions usage (in resource units). Omitted when the backend filter is specified, as functions usage is not associated with any specific backend, or when functions workload is not requested."
},
"max_functions_usage_ru": {
"type": "number",
"example": 0.0002,
"format": "float",
"description": "Max functions usage (in resource units). Omitted when the backend filter is specified, as functions usage is not associated with any specific backend, or when functions workload is not requested."
},
"functions_quantum_usage_ms": {
"type": "number",
"example": 10,
"description": "Functions total quantum usage (in milliseconds). Omitted when the backend filter is specified, as functions usage is not associated with any specific backend, or when functions workload is not requested."
},
"functions_quantum_usage_ru": {
"type": "number",
"example": 0.0002,
"format": "float",
"description": "Functions total quantum usage (in resource units). Omitted when the backend filter is specified, as functions usage is not associated with any specific backend, or when functions workload is not requested."
},
"functions_classical_usage_ru": {
"type": "number",
"example": 0.0002,
"format": "float",
"description": "Functions total classical usage (in resource units). Omitted when the backend filter is specified, as functions usage is not associated with any specific backend, or when functions workload is not requested."
},
"functions_license_cost_ru": {
"type": "number",
"example": 0.0002,
"format": "float",
"description": "Functions total license cost (in resource units). Omitted when the backend filter is specified, as functions usage is not associated with any specific backend, or when functions workload is not requested."
}
},
"required": [
"key",
"usage",
"usage_ru",
"jobs",
"sessions",
"sessions_usage",
"sessions_usage_ru",
"avg_sessions_usage",
"avg_sessions_usage_ru",
"max_sessions_usage",
"max_sessions_usage_ru",
"batch_sessions",
"batch_sessions_usage",
"batch_sessions_usage_ru",
"avg_batch_sessions_usage",
"avg_batch_sessions_usage_ru",
"max_batch_sessions_usage",
"max_batch_sessions_usage_ru",
"dedicated_sessions",
"dedicated_sessions_usage",
"dedicated_sessions_usage_ru",
"avg_dedicated_sessions_usage",
"avg_dedicated_sessions_usage_ru",
"max_dedicated_sessions_usage",
"max_dedicated_sessions_usage_ru",
"individual_jobs",
"individual_jobs_usage",
"individual_jobs_usage_ru",
"avg_individual_jobs_usage",
"avg_individual_jobs_usage_ru",
"max_individual_jobs_usage",
"max_individual_jobs_usage_ru",
"queue_time",
"avg_queue_time",
"max_queue_time"
]
}
}
},
"required": [
"data"
]
}Get usage analytics grouped by date
Get usage analytics grouped by date
Autorização
Para chamar esse método, deve-se ter sido designado a uma ou mais funções de acesso do IAM que incluam as ações a seguir. É possível verificar seu acesso indo para Users > User > Access
quantum-computing.account-analytics-usage.read
Auditoria
A chamada desse método gera os seguintes eventos de auditoria.
quantum-computing.account-analytics-usage.read
Entrada
Nome, Tipo | Descrição |
|---|---|
group_by Necessário string | key to group usage by Valores possíveis: instancefunction_nameExemplo: "instance" |
instance string[] | Exemplo: "crn:v1:staging:public:quantum-computing:region:a/account:instance::" |
interval_start string | Exemplo: "2024-01-01T00:00:00.000Z" |
interval_end string | Exemplo: "2024-01-01T00:00:00.000Z" |
backend string[] | Exemplo: "ibm_tenerife" |
user_id string[] | Exemplo: "123" |
simulators boolean | Include simulators Valor Padrão: true |
plan string[] | Exemplo: "premium" |
subscription_id string[] | The subscription ID whose analytics are being requested. Could be a single ID or an array of IDs. Exemplo: ["91b2c828-2952-4f05-aed8-bedf92c6c480"] |
function_name string[] | Function names to filter by. Jobs and sessions with no function association are excluded when this filter is active. Exemplo: ["sampler"] |
Se sua instância estiver na região eu-de, use este link: URL: https://eu-de.quantum.cloud.ibm.com/api/v1/analytics/usage_grouped_by_date
curl -X GET \
'https://quantum.cloud.ibm.com/api/v1/analytics/usage_grouped_by_date' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer YOUR-TOKEN' \
-H 'Service-CRN: YOUR-SERVICE-CRN' \
-H 'IBM-API-Version: 2024-01-01' Se sua instância estiver na região eu-de, use este link: URL: https://eu-de.quantum.cloud.ibm.com/api/v1/analytics/usage_grouped_by_date
import requests
response = requests.request(
"GET",
"https://quantum.cloud.ibm.com/api/v1/analytics/usage_grouped_by_date",
headers={
"Accept": "application/json",
"IBM-API-Version": "2024-01-01",
"Authorization": "Bearer YOUR-TOKEN",
"Service-CRN": "YOUR-SERVICE-CRN"
},
)
print(response.json())Saída
Código de status | Descrição |
|---|---|
| 200 | |
| 400 | Bad request |
| 401 | Unauthorized |
| 403 | Forbidden |
| 404 | Not found |
| 500 | Internal server error |
{
"interval_start": "2024-01-01T00:00:00.000Z",
"interval_end": "2024-01-01T00:00:00.000Z",
"data": [
{
"key": "ibm-q/open/main",
"interval_start": "2024-01-01T00:00:00.000Z",
"interval_end": "2024-01-01T00:00:00.000Z",
"usage": 10,
"usage_ru": 0.0002,
"jobs": 10,
"sessions": 10,
"sessions_usage": 10,
"sessions_usage_ru": 0.0002,
"avg_sessions_usage": 10,
"avg_sessions_usage_ru": 0.0002,
"max_sessions_usage": 10,
"max_sessions_usage_ru": 0.0002,
"batch_sessions": 10,
"batch_sessions_usage": 10,
"batch_sessions_usage_ru": 0.0002,
"avg_batch_sessions_usage": 10,
"avg_batch_sessions_usage_ru": 0.0002,
"max_batch_sessions_usage": 10,
"max_batch_sessions_usage_ru": 0.0002,
"dedicated_sessions": 10,
"dedicated_sessions_usage": 10,
"dedicated_sessions_usage_ru": 0.0002,
"avg_dedicated_sessions_usage": 10,
"avg_dedicated_sessions_usage_ru": 0.0002,
"max_dedicated_sessions_usage": 10,
"max_dedicated_sessions_usage_ru": 0.0002,
"individual_jobs": 10,
"individual_jobs_usage": 10,
"individual_jobs_usage_ru": 0.0002,
"avg_individual_jobs_usage": 10,
"avg_individual_jobs_usage_ru": 0.0002,
"max_individual_jobs_usage": 10,
"max_individual_jobs_usage_ru": 0.0002,
"queue_time": 10,
"avg_queue_time": 10,
"max_queue_time": 10,
"functions": 10,
"functions_usage_ru": 0.0002,
"avg_functions_usage_ru": 0.0002,
"max_functions_usage_ru": 0.0002,
"functions_quantum_usage_ms": 10,
"functions_quantum_usage_ru": 0.0002,
"functions_classical_usage_ru": 0.0002,
"functions_license_cost_ru": 0.0002
}
]
}{
"type": "object",
"properties": {
"interval_start": {
"type": "string",
"example": "2024-01-01T00:00:00.000Z",
"description": "Interval start"
},
"interval_end": {
"type": "string",
"example": "2024-01-01T00:00:00.000Z",
"description": "Interval end"
},
"data": {
"description": "Results",
"type": "array",
"items": {
"type": "object",
"properties": {
"key": {
"type": "string",
"example": "ibm-q/open/main",
"description": "Group key. Depends on the groupBy query params."
},
"interval_start": {
"type": "string",
"example": "2024-01-01T00:00:00.000Z",
"description": "Interval start"
},
"interval_end": {
"type": "string",
"example": "2024-01-01T00:00:00.000Z",
"description": "Interval end"
},
"usage": {
"type": "number",
"example": 10,
"description": "Total usage (in milliseconds)"
},
"usage_ru": {
"type": "number",
"example": 0.0002,
"format": "float",
"description": "Total usage (in resource units)"
},
"jobs": {
"type": "number",
"example": 10,
"description": "Total number of jobs"
},
"sessions": {
"type": "number",
"example": 10,
"description": "Total number of sessions"
},
"sessions_usage": {
"type": "number",
"example": 10,
"description": "Total sessions usage (in milliseconds)"
},
"sessions_usage_ru": {
"type": "number",
"example": 0.0002,
"format": "float",
"description": "Total sessions usage (in resource units)"
},
"avg_sessions_usage": {
"type": "number",
"example": 10,
"description": "Average sessions usage (in milliseconds)"
},
"avg_sessions_usage_ru": {
"type": "number",
"example": 0.0002,
"format": "float",
"description": "Average sessions usage (in resource units)"
},
"max_sessions_usage": {
"type": "number",
"example": 10,
"description": "Max sessions usage (in milliseconds)"
},
"max_sessions_usage_ru": {
"type": "number",
"example": 0.0002,
"format": "float",
"description": "Max sessions usage (in resource units)"
},
"batch_sessions": {
"type": "number",
"example": 10,
"description": "Total number of batch sessions"
},
"batch_sessions_usage": {
"type": "number",
"example": 10,
"description": "Total batch sessions usage (in milliseconds)"
},
"batch_sessions_usage_ru": {
"type": "number",
"example": 0.0002,
"format": "float",
"description": "Total batch sessions usage (in resource units)"
},
"avg_batch_sessions_usage": {
"type": "number",
"example": 10,
"description": "Average batch sessions usage (in milliseconds)"
},
"avg_batch_sessions_usage_ru": {
"type": "number",
"example": 0.0002,
"format": "float",
"description": "Average batch sessions usage (in resource units)"
},
"max_batch_sessions_usage": {
"type": "number",
"example": 10,
"description": "Max batch sessions usage (in milliseconds)"
},
"max_batch_sessions_usage_ru": {
"type": "number",
"example": 0.0002,
"format": "float",
"description": "Max batch sessions usage (in resource units)"
},
"dedicated_sessions": {
"type": "number",
"example": 10,
"description": "Total number of dedicated sessions"
},
"dedicated_sessions_usage": {
"type": "number",
"example": 10,
"description": "Total dedicated sessions usage (in milliseconds)"
},
"dedicated_sessions_usage_ru": {
"type": "number",
"example": 0.0002,
"format": "float",
"description": "Total dedicated sessions usage (in resource units)"
},
"avg_dedicated_sessions_usage": {
"type": "number",
"example": 10,
"description": "Average dedicated sessions usage (in milliseconds)"
},
"avg_dedicated_sessions_usage_ru": {
"type": "number",
"example": 0.0002,
"format": "float",
"description": "Average dedicated sessions usage (in resource units)"
},
"max_dedicated_sessions_usage": {
"type": "number",
"example": 10,
"description": "Max dedicated sessions usage (in milliseconds)"
},
"max_dedicated_sessions_usage_ru": {
"type": "number",
"example": 0.0002,
"format": "float",
"description": "Max dedicated sessions usage (in resource units)"
},
"individual_jobs": {
"type": "number",
"example": 10,
"description": "Total number of individual jobs"
},
"individual_jobs_usage": {
"type": "number",
"example": 10,
"description": "Total individual jobs usage (in milliseconds)"
},
"individual_jobs_usage_ru": {
"type": "number",
"example": 0.0002,
"format": "float",
"description": "Total individual jobs usage (in resource units)"
},
"avg_individual_jobs_usage": {
"type": "number",
"example": 10,
"description": "Average individual jobs usage (in milliseconds)"
},
"avg_individual_jobs_usage_ru": {
"type": "number",
"example": 0.0002,
"format": "float",
"description": "Average individual jobs usage (in resource units)"
},
"max_individual_jobs_usage": {
"type": "number",
"example": 10,
"description": "Max individual jobs usage (in milliseconds)"
},
"max_individual_jobs_usage_ru": {
"type": "number",
"example": 0.0002,
"format": "float",
"description": "Max individual jobs usage (in resource units)"
},
"queue_time": {
"type": "number",
"example": 10,
"description": "Total queue time (in milliseconds)"
},
"avg_queue_time": {
"type": "number",
"example": 10,
"description": "Average queue time (in milliseconds)"
},
"max_queue_time": {
"type": "number",
"example": 10,
"description": "Max queue time (in milliseconds)"
},
"functions": {
"type": "number",
"example": 10,
"description": "Total number of functions. Omitted when the backend filter is specified, as functions usage is not associated with any specific backend, or when functions workload is not requested."
},
"functions_usage_ru": {
"type": "number",
"example": 0.0002,
"format": "float",
"description": "Total functions usage (in resource units). Omitted when the backend filter is specified, as functions usage is not associated with any specific backend, or when functions workload is not requested."
},
"avg_functions_usage_ru": {
"type": "number",
"example": 0.0002,
"format": "float",
"description": "Average functions usage (in resource units). Omitted when the backend filter is specified, as functions usage is not associated with any specific backend, or when functions workload is not requested."
},
"max_functions_usage_ru": {
"type": "number",
"example": 0.0002,
"format": "float",
"description": "Max functions usage (in resource units). Omitted when the backend filter is specified, as functions usage is not associated with any specific backend, or when functions workload is not requested."
},
"functions_quantum_usage_ms": {
"type": "number",
"example": 10,
"description": "Functions total quantum usage (in milliseconds). Omitted when the backend filter is specified, as functions usage is not associated with any specific backend, or when functions workload is not requested."
},
"functions_quantum_usage_ru": {
"type": "number",
"example": 0.0002,
"format": "float",
"description": "Functions total quantum usage (in resource units). Omitted when the backend filter is specified, as functions usage is not associated with any specific backend, or when functions workload is not requested."
},
"functions_classical_usage_ru": {
"type": "number",
"example": 0.0002,
"format": "float",
"description": "Functions total classical usage (in resource units). Omitted when the backend filter is specified, as functions usage is not associated with any specific backend, or when functions workload is not requested."
},
"functions_license_cost_ru": {
"type": "number",
"example": 0.0002,
"format": "float",
"description": "Functions total license cost (in resource units). Omitted when the backend filter is specified, as functions usage is not associated with any specific backend, or when functions workload is not requested."
}
},
"required": [
"key",
"interval_start",
"interval_end",
"usage",
"usage_ru",
"jobs",
"sessions",
"sessions_usage",
"sessions_usage_ru",
"avg_sessions_usage",
"avg_sessions_usage_ru",
"max_sessions_usage",
"max_sessions_usage_ru",
"batch_sessions",
"batch_sessions_usage",
"batch_sessions_usage_ru",
"avg_batch_sessions_usage",
"avg_batch_sessions_usage_ru",
"max_batch_sessions_usage",
"max_batch_sessions_usage_ru",
"dedicated_sessions",
"dedicated_sessions_usage",
"dedicated_sessions_usage_ru",
"avg_dedicated_sessions_usage",
"avg_dedicated_sessions_usage_ru",
"max_dedicated_sessions_usage",
"max_dedicated_sessions_usage_ru",
"individual_jobs",
"individual_jobs_usage",
"individual_jobs_usage_ru",
"avg_individual_jobs_usage",
"avg_individual_jobs_usage_ru",
"max_individual_jobs_usage",
"max_individual_jobs_usage_ru",
"queue_time",
"avg_queue_time",
"max_queue_time"
]
}
}
},
"required": [
"interval_start",
"interval_end",
"data"
]
}