Class DashboardProps.Builder
java.lang.Object
software.amazon.awscdk.services.cloudwatch.DashboardProps.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<DashboardProps>
- Enclosing interface:
DashboardProps
@Stability(Stable)
public static final class DashboardProps.Builder
extends Object
implements software.amazon.jsii.Builder<DashboardProps>
A builder for
DashboardProps
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds the configured instance.dashboardName
(String dashboardName) Sets the value ofDashboardProps.getDashboardName()
defaultInterval
(Duration defaultInterval) Sets the value ofDashboardProps.getDefaultInterval()
Sets the value ofDashboardProps.getEnd()
periodOverride
(PeriodOverride periodOverride) Sets the value ofDashboardProps.getPeriodOverride()
Sets the value ofDashboardProps.getStart()
Sets the value ofDashboardProps.getVariables()
Sets the value ofDashboardProps.getWidgets()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
dashboardName
Sets the value ofDashboardProps.getDashboardName()
- Parameters:
dashboardName
- Name of the dashboard. If set, must only contain alphanumerics, dash (-) and underscore (_)- Returns:
this
-
defaultInterval
Sets the value ofDashboardProps.getDefaultInterval()
- Parameters:
defaultInterval
- Interval duration for metrics. You can specify defaultInterval with the relative time(eg. cdk.Duration.days(7)). Both propertiesdefaultInterval
andstart
cannot be set at once.- Returns:
this
-
end
Sets the value ofDashboardProps.getEnd()
- Parameters:
end
- The end of the time range to use for each widget on the dashboard when the dashboard loads. If you specify a value for end, you must also specify a value for start. Specify an absolute time in the ISO 8601 format. For example, 2018-12-17T06:00:00.000Z.- Returns:
this
-
periodOverride
Sets the value ofDashboardProps.getPeriodOverride()
- Parameters:
periodOverride
- Use this field to specify the period for the graphs when the dashboard loads. SpecifyingAuto
causes the period of all graphs on the dashboard to automatically adapt to the time range of the dashboard. SpecifyingInherit
ensures that the period set for each graph is always obeyed.- Returns:
this
-
start
Sets the value ofDashboardProps.getStart()
- Parameters:
start
- The start of the time range to use for each widget on the dashboard. You can specify start without specifying end to specify a relative time range that ends with the current time. In this case, the value of start must begin with -P, and you can use M, H, D, W and M as abbreviations for minutes, hours, days, weeks and months. For example, -PT8H shows the last 8 hours and -P3M shows the last three months. You can also use start along with an end field, to specify an absolute time range. When specifying an absolute time range, use the ISO 8601 format. For example, 2018-12-17T06:00:00.000Z.Both properties
defaultInterval
andstart
cannot be set at once.- Returns:
this
-
variables
Sets the value ofDashboardProps.getVariables()
- Parameters:
variables
- A list of dashboard variables.- Returns:
this
-
widgets
@Stability(Stable) public DashboardProps.Builder widgets(List<? extends List<? extends IWidget>> widgets) Sets the value ofDashboardProps.getWidgets()
- Parameters:
widgets
- Initial set of widgets on the dashboard. One array represents a row of widgets.- Returns:
this
-
build
Builds the configured instance.- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<DashboardProps>
- Returns:
- a new instance of
DashboardProps
- Throws:
NullPointerException
- if any required attribute was not provided
-