create_dashboard¶
- DashboardsApi.create_dashboard(role_id, create_dashboard_request, content_type=None, _request_timeout=None, _request_auth=None, _content_type=None, _headers=None, _host_index=0)¶
Create a dashboard
Registers a new dashboard with metadata and optional widgets. A valid role_id with dashboards.fullaccess is required. On success the creator is granted AccessType owner, and the response includes DashboardId (UUID), CustomUrlPath ({CurrentSlug}-{CustomId}, for example SalesOverview-3c4d5e6f), and a success Message. DashboardId is generated server-side when omitted from the body. This Lambda maps InvalidInputException to HTTP 422, UnauthorizedUserException (resource ACL) to HTTP 401, RequestValidationError to HTTP 400, and unhandled/GenericFailure to HTTP 500. Widgets may be omitted (defaults to an empty list). QuickSight widgets must include Configuration.QuicksightDashboardId.Value set to an existing QuickSight dashboard ID (else DASH-1007 / DASH-1006). Insights widgets validate caller access to Configuration.ResourcesList.Value entries. Not idempotent: each successful call creates a new dashboard.
- Parameters:
role_id (str) – Amorphic role ID used to authorize the request. Must be a role the authenticated user belongs to with dashboards.fullaccess. (required)
create_dashboard_request (CreateDashboardRequest) – (required)
content_type (str) – Must be application/json.
_request_timeout (int, tuple(int, int), optional) – timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts.
_request_auth (dict, optional) – set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request.
_content_type (str, Optional) – force content-type for the request.
_headers (dict, optional) – set to override the headers for a single request; this effectively ignores the headers in the spec for a single request.
_host_index (int, optional) – set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request.
- Return type:
- Returns:
Returns the result object.
Request and Response Examples¶
HTTP: POST /dashboards
Parameter examples¶
Name |
In |
Example |
|---|---|---|
|
header |
|
|
header |
|
Request¶
Request / response example
{
"DashboardName": "Sales Overview",
"DashboardDescription": "Monthly sales KPIs",
"Keywords": [
"sales",
"kpi"
],
"Widgets": [
{
"RefId": "qs-widget-1",
"Version": "1",
"WidgetServiceCategory": "quicksight",
"Configuration": {
"QuicksightDashboardId": {
"Value": "11111111-2222-3333-4444-555555555555"
}
}
}
]
}
Success (HTTP 200)¶
Dashboard created. Message is “Dashboard registration completed successfully.” Body includes DashboardId and CustomUrlPath.
Request / response example
{
"Message": "Dashboard registration completed successfully.",
"DashboardId": "b1e6c2a0-9f4d-4c7a-8f2e-1a2b3c4d5e6f",
"CustomUrlPath": "SalesOverview-3c4d5e6f"
}
Errors¶
Documented error codes: IPV-1008, IPV-1036, IPV-1041, IPV-1062, AUTH-1001, DASH-1007, DASH-1006, AUTH-1012, AUTH-1030, IPV-1002, IPV-1045, GE-1004.
HTTP 400
RequestValidationError (Pydantic) for body/header constraints. Body is {“Message”: “<CODE> - <text>”}. Codes include IPV-1008, IPV-1036, IPV-1041, IPV-1062 and related IPV-* validation codes.
Missing role_id header
{
"Message": "AUTH-1001 - Missing role information in event header"
}
QuickSight widget missing dashboard ID
{
"Message": "DASH-1007 - Quicksight Dashboard ID is a mandatory field for the QuickSight widget"
}
QuickSight dashboard not available
{
"Message": "DASH-1006 - Quicksight dashboard 11111111-2222-3333-4444-555555555555 is unavailable"
}
Required DashboardName missing
{
"Message": "IPV-1008 - Invalid request body, missing key(s) - DashboardName"
}
HTTP 401
Insufficient access to insights widget resources. Body is {“Message”: “AUTH-1012 - …”}.
HTTP 422
InvalidInputException. Codes include AUTH-1001, AUTH-1030 (missing dashboards.fullaccess), DASH-1006/1007, IPV-1002, IPV-1045 (insights ResourcesList), and related II codes.
Missing role_id header
{
"Message": "AUTH-1001 - Missing role information in event header"
}
QuickSight widget missing dashboard ID
{
"Message": "DASH-1007 - Quicksight Dashboard ID is a mandatory field for the QuickSight widget"
}
QuickSight dashboard not available
{
"Message": "DASH-1006 - Quicksight dashboard 11111111-2222-3333-4444-555555555555 is unavailable"
}
HTTP 500
Backend/generic failure. Body is {“Message”: “<CODE> - <text>”}.
Unexpected backend failure
{
"Message": "GE-1004 - Unexpected error - <exception text>"
}