Interface DashboardSlugBuilder
-
public interface DashboardSlugBuilderInterface ofDashboardSlugBuilder- Author:
- Yutian Wu (wyutian@vmware.com)
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Stringbuild()Build the dashboard slug.StringbuildAndEscape()Build and escape the dashboard slug to be used in the dashboard url.DashboardSlugBuildersetCompare(String compare)Sets the comparison option for the entire dashboard.DashboardSlugBuildersetDynamicDashboardVariable(String name, String value)Sets the value of a list dashboard variable in the dashboard.DashboardSlugBuildersetEnd(long endMillis)Set the end millis.DashboardSlugBuildersetEnd(org.joda.time.ReadableInstant instant)Set the end millis.DashboardSlugBuildersetListDashboardVariable(String name, String selected)Sets the value of a list dashboard variable in the dashboard.DashboardSlugBuildersetLiveRefresh(boolean enableLiveRefresh)Set the flag whether we want to turn on live refresh (default is off, so used it when you want to turn on live refresh).DashboardSlugBuildersetSimpleDashboardVariable(String name, String value)Sets the value of a simple dashboard variable in the dashboard.DashboardSlugBuildersetStart(long startMillis)Set the start millis.DashboardSlugBuildersetStart(org.joda.time.ReadableInstant instant)Set the start instant.DashboardSlugBuildersetWindowSize(String windowSize)Set the live refresh window size, this value needs to be provided if live refresh is turned on or default is `2h`.
-
-
-
Method Detail
-
setStart
DashboardSlugBuilder setStart(long startMillis)
Set the start millis. *Notice* IfsetLiveRefresh(boolean)is not called and liveliness is not set to False, the start time will be changed after accessing using the url, because liveliness will always start from the latest time.- Parameters:
startMillis- Start millis.- Returns:
- The builder.
-
setStart
DashboardSlugBuilder setStart(org.joda.time.ReadableInstant instant)
Set the start instant. *Notice* IfsetLiveRefresh(boolean)is not called and liveliness is not set to False, the start time will be changed after accessing using the url, because liveliness will always start from the latest time.- Parameters:
instant- The start instant.- Returns:
- The builder.
-
setEnd
DashboardSlugBuilder setEnd(long endMillis)
Set the end millis. *Notice* IfsetLiveRefresh(boolean)is not called and liveliness is not set to False, the end time will only be used to calculate the duration, because liveliness will always start from the latest time.- Parameters:
endMillis- End millis.- Returns:
- The builder.
-
setEnd
DashboardSlugBuilder setEnd(org.joda.time.ReadableInstant instant)
Set the end millis. *Notice* IfsetLiveRefresh(boolean)is not called and liveliness is not set to False, the end time will only be used to calculate the duration, because liveliness will always start from the latest time.- Parameters:
instant- The end instant.- Returns:
- The builder.
-
setLiveRefresh
DashboardSlugBuilder setLiveRefresh(boolean enableLiveRefresh)
Set the flag whether we want to turn on live refresh (default is off, so used it when you want to turn on live refresh).- Parameters:
enableLiveRefresh- Whether we want to turn on live refresh- Returns:
- The builder.
-
setWindowSize
DashboardSlugBuilder setWindowSize(String windowSize)
Set the live refresh window size, this value needs to be provided if live refresh is turned on or default is `2h`.- Parameters:
windowSize- The window size.- Returns:
- The builder.
-
setCompare
DashboardSlugBuilder setCompare(String compare)
Sets the comparison option for the entire dashboard. Valid values are determined by the FE. Possible values include: "1d", "1w", "1m". Defaults to null.- Parameters:
compare- Comparison option to set for the dashboard.- Returns:
- The builder.
-
setSimpleDashboardVariable
DashboardSlugBuilder setSimpleDashboardVariable(String name, String value)
Sets the value of a simple dashboard variable in the dashboard. Because a simple dashboard variable is used as a constant in Wavefront's dashboard, you hardly need to use this method.There are three caveats when using this method:
1. The name is the variable name you defined when you create a dashboard variable, not its display name. You can get the name of the variable by hovering your cursor over your dashboard variable display name.
2. This is not a place to define a new dashboard variable. Instead, it is a place to assign a value to the existing variable.
3. Slug builder won't check whether the value is valid or not. If the value does not match the original value defined in the dashboard, our frontend will use the value, leading to the charts loading issue.
- Parameters:
name- Name of the dashboard variable (Not label)value- Value of the variable. If it is null, it will use the default one.- Returns:
- The builder.
-
setListDashboardVariable
DashboardSlugBuilder setListDashboardVariable(String name, String selected)
Sets the value of a list dashboard variable in the dashboard.There are three caveats when using this method:
1. The name is the variable name you defined when you create a dashboard variable, not its display name. You can get the name of the variable by hovering your cursor over your dashboard variable display name.
2. This is not a place to define a new dashboard variable. Instead, it is a place to assign a value to the existing variable.
3. Slug builder won't check whether the value is valid or not. If the value is not defined in the original list of values, our frontend redirects you to the dashboard using the default value for this variable.
- Parameters:
name- Name of the dashboard variable (Not label).selected- The selected value from the list of values. If it is null, it will use the default one.- Returns:
- The builder.
-
setDynamicDashboardVariable
DashboardSlugBuilder setDynamicDashboardVariable(String name, String value)
Sets the value of a list dashboard variable in the dashboard.There are three caveats when using this method:
1. The name is the variable name you defined when you create a dashboard variable, not its display name. You can get the name of the variable by hovering your cursor over your dashboard variable display name.
2. This is not a place to define a new dashboard variable. Instead, it is a place to assign a value to the existing variable.
3. Slug builder won't check whether the value is valid or not. If the value is not returned in the original query defined for this dynamic variable, our frontend redirects you to the dashboard with the default value of the dashboard variable.
- Parameters:
name- Name of the dashboard variable (Not label).value- Value of the dashboard variable. If it is null, it will use the default one.- Returns:
- The builder.
-
build
String build()
Build the dashboard slug.- Returns:
- The dashboard slug.
-
buildAndEscape
String buildAndEscape()
Build and escape the dashboard slug to be used in the dashboard url.
-
-