Create Evaluation Dashboard
Create a dashboard bound to exactly one evaluation or evaluation group.
The request must set exactly one of evaluation_id or evaluation_group_id
(enforced as XOR) — supplying both or neither is rejected, and the referenced
evaluation or group must already exist in the caller’s account or the call fails
with a not-found error. If template_dashboard_id is provided, the new dashboard
copies that template’s widget_order and synchronously computes a result for each
of those widgets against the new dashboard’s evaluation data before returning. Any
widget_order supplied is validated to contain only existing, non-duplicate widget
IDs. The dashboard is created and returned immediately; individual widgets are added
afterward through the widget sub-endpoints.
Create Evaluation Dashboard
import os
from scale_gp_beta import SGPClient
client = SGPClient(
api_key=os.environ.get("SGP_API_KEY"), # This is the default and can be omitted
)
evaluation_dashboard = client.evaluation_dashboards.create(
name="x",
)
print(evaluation_dashboard.id){
"id": "id",
"account_id": "account_id",
"created_at": "2019-12-27T18:11:19.117Z",
"created_by": {
"id": "id",
"type": "user",
"object": "identity"
},
"name": "name",
"tags": [
"string"
],
"updated_at": "2019-12-27T18:11:19.117Z",
"archived_at": "2019-12-27T18:11:19.117Z",
"description": "description",
"error_message": "error_message",
"evaluation_group_id": "evaluation_group_id",
"evaluation_id": "evaluation_id",
"object": "evaluation_dashboard",
"widget_order": [
"string"
],
"widget_results": [
{
"id": "id",
"account_id": "account_id",
"computation_status": "pending",
"created_at": "2019-12-27T18:11:19.117Z",
"widget_id": "widget_id",
"computation_job_id": "computation_job_id",
"computed_at": "2019-12-27T18:11:19.117Z",
"computed_result": {
"foo": "bar"
},
"error_message": "error_message",
"evaluation_group_id": "evaluation_group_id",
"evaluation_id": "evaluation_id",
"object": "evaluation_dashboard_widget_result",
"widget": {
"id": "id",
"account_id": "account_id",
"created_at": "2019-12-27T18:11:19.117Z",
"title": "title",
"type": "bar",
"archived_at": "2019-12-27T18:11:19.117Z",
"config": {
"foo": "bar"
},
"object": "evaluation_dashboard_widget",
"query": {
"select": [
{
"expression": {
"column": "column",
"source": "source",
"type": "COLUMN"
},
"alias": "alias"
}
],
"evaluation_ids": [
"string"
],
"filter": {
"conditions": [
{
"column": "column",
"operator": "=",
"source": "source",
"value": "string"
}
],
"logicalOperators": [
"AND"
]
},
"groupBy": [
"string"
],
"latest_only": true,
"limit": 1,
"orderBy": [
{
"column": "column",
"direction": "ASC",
"source": "source"
}
]
}
}
}
],
"widgets": [
{
"id": "id",
"account_id": "account_id",
"created_at": "2019-12-27T18:11:19.117Z",
"title": "title",
"type": "bar",
"archived_at": "2019-12-27T18:11:19.117Z",
"config": {
"foo": "bar"
},
"object": "evaluation_dashboard_widget",
"query": {
"select": [
{
"expression": {
"column": "column",
"source": "source",
"type": "COLUMN"
},
"alias": "alias"
}
],
"evaluation_ids": [
"string"
],
"filter": {
"conditions": [
{
"column": "column",
"operator": "=",
"source": "source",
"value": "string"
}
],
"logicalOperators": [
"AND"
]
},
"groupBy": [
"string"
],
"latest_only": true,
"limit": 1,
"orderBy": [
{
"column": "column",
"direction": "ASC",
"source": "source"
}
]
}
}
]
}Returns Examples
{
"id": "id",
"account_id": "account_id",
"created_at": "2019-12-27T18:11:19.117Z",
"created_by": {
"id": "id",
"type": "user",
"object": "identity"
},
"name": "name",
"tags": [
"string"
],
"updated_at": "2019-12-27T18:11:19.117Z",
"archived_at": "2019-12-27T18:11:19.117Z",
"description": "description",
"error_message": "error_message",
"evaluation_group_id": "evaluation_group_id",
"evaluation_id": "evaluation_id",
"object": "evaluation_dashboard",
"widget_order": [
"string"
],
"widget_results": [
{
"id": "id",
"account_id": "account_id",
"computation_status": "pending",
"created_at": "2019-12-27T18:11:19.117Z",
"widget_id": "widget_id",
"computation_job_id": "computation_job_id",
"computed_at": "2019-12-27T18:11:19.117Z",
"computed_result": {
"foo": "bar"
},
"error_message": "error_message",
"evaluation_group_id": "evaluation_group_id",
"evaluation_id": "evaluation_id",
"object": "evaluation_dashboard_widget_result",
"widget": {
"id": "id",
"account_id": "account_id",
"created_at": "2019-12-27T18:11:19.117Z",
"title": "title",
"type": "bar",
"archived_at": "2019-12-27T18:11:19.117Z",
"config": {
"foo": "bar"
},
"object": "evaluation_dashboard_widget",
"query": {
"select": [
{
"expression": {
"column": "column",
"source": "source",
"type": "COLUMN"
},
"alias": "alias"
}
],
"evaluation_ids": [
"string"
],
"filter": {
"conditions": [
{
"column": "column",
"operator": "=",
"source": "source",
"value": "string"
}
],
"logicalOperators": [
"AND"
]
},
"groupBy": [
"string"
],
"latest_only": true,
"limit": 1,
"orderBy": [
{
"column": "column",
"direction": "ASC",
"source": "source"
}
]
}
}
}
],
"widgets": [
{
"id": "id",
"account_id": "account_id",
"created_at": "2019-12-27T18:11:19.117Z",
"title": "title",
"type": "bar",
"archived_at": "2019-12-27T18:11:19.117Z",
"config": {
"foo": "bar"
},
"object": "evaluation_dashboard_widget",
"query": {
"select": [
{
"expression": {
"column": "column",
"source": "source",
"type": "COLUMN"
},
"alias": "alias"
}
],
"evaluation_ids": [
"string"
],
"filter": {
"conditions": [
{
"column": "column",
"operator": "=",
"source": "source",
"value": "string"
}
],
"logicalOperators": [
"AND"
]
},
"groupBy": [
"string"
],
"latest_only": true,
"limit": 1,
"orderBy": [
{
"column": "column",
"direction": "ASC",
"source": "source"
}
]
}
}
]
}