createDashboard method
May throw InternalFailureException.
May throw InvalidRequestException.
May throw LimitExceededException.
May throw ResourceNotFoundException.
May throw ThrottlingException.
Parameter dashboardDefinition :
The dashboard definition specified in a JSON literal.
- IoT SiteWise Monitor (Classic) see Create dashboards (CLI)
- IoT SiteWise Monitor (AI-aware) see Create dashboards (CLI)
Parameter dashboardName :
A friendly name for the dashboard.
Parameter projectId :
The ID of the project in which to create the dashboard.
Parameter clientToken :
A unique case-sensitive identifier that you can provide to ensure the
idempotency of the request. Don't reuse this client token if a new
idempotent request is required.
Parameter dashboardDescription :
A description for the dashboard.
Parameter tags :
A list of key-value pairs that contain metadata for the dashboard. For
more information, see Tagging
your IoT SiteWise resources in the IoT SiteWise User Guide.
Implementation
Future<CreateDashboardResponse> createDashboard({
required String dashboardDefinition,
required String dashboardName,
required String projectId,
String? clientToken,
String? dashboardDescription,
Map<String, String>? tags,
}) async {
final $payload = <String, dynamic>{
'dashboardDefinition': dashboardDefinition,
'dashboardName': dashboardName,
'projectId': projectId,
'clientToken': clientToken ?? _s.generateIdempotencyToken(),
if (dashboardDescription != null)
'dashboardDescription': dashboardDescription,
if (tags != null) 'tags': tags,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri: '/dashboards',
hostPrefix: 'monitor.',
exceptionFnMap: _exceptionFns,
);
return CreateDashboardResponse.fromJson(response);
}