/** * The list of dimensions associated with the metric. * * @param dimensions the list of dimensions associated with the metric * * @return this {@code ListAlarmsForMetric} object */ public ListAlarmsForMetric dimensions(Set<Dimension> dimensions) { for (Dimension dimension : checkNotNull(dimensions, "dimensions")) { dimension(dimension); } return this; }
Statistics statistic = Statistics.AVERAGE; Unit unit = Unit.COUNT; Multimap<String, String> formParameters = new ListAlarmsForMetric() .dimensions(dimensions) .metricName(metricName) .namespace(namespace) .period(period) .statistic(statistic) .unit(unit) .buildFormParameters(); int dimensionIndex = 1;
ListAlarmsForMetric dafmo = new ListAlarmsForMetric() .metricName(metricName) .namespace(namespace); success = retry(new Predicate<ListAlarmsForMetric>() { public boolean apply(ListAlarmsForMetric options) {
public void testEmptyOptions() throws Exception { Multimap<String, String> formParameters = new ListAlarmsForMetric().buildFormParameters(); assertFalse(formParameters.containsKey("Dimensions.member.1.Name")); assertFalse(formParameters.containsKey("Dimensions.member.1.Value")); assertFalse(formParameters.containsKey("MetricName")); assertFalse(formParameters.containsKey("Namespace")); assertFalse(formParameters.containsKey("Period")); assertFalse(formParameters.containsKey("Statistic")); assertFalse(formParameters.containsKey("Unit")); }
Statistics statistic = Statistics.AVERAGE; Unit unit = Unit.COUNT; Multimap<String, String> formParameters = new ListAlarmsForMetric() .dimensions(dimensions) .metricName(metricName) .namespace(namespace) .period(period) .statistic(statistic) .unit(unit) .buildFormParameters(); int dimensionIndex = 1;
ListAlarmsForMetric dafmo = new ListAlarmsForMetric() .metricName(metricName) .namespace(namespace); success = retry(new Predicate<ListAlarmsForMetric>() { public boolean apply(ListAlarmsForMetric options) {
public void testEmptyOptions() throws Exception { Multimap<String, String> formParameters = new ListAlarmsForMetric().buildFormParameters(); assertFalse(formParameters.containsKey("Dimensions.member.1.Name")); assertFalse(formParameters.containsKey("Dimensions.member.1.Value")); assertFalse(formParameters.containsKey("MetricName")); assertFalse(formParameters.containsKey("Namespace")); assertFalse(formParameters.containsKey("Period")); assertFalse(formParameters.containsKey("Statistic")); assertFalse(formParameters.containsKey("Unit")); }
.listForMetric(new ListAlarmsForMetric() .dimensions(ImmutableSet.of( new Dimension("TestDimensionName1", "TestDimensionValue1"), "TestDimensionValue2") )) .metricName(metricName) .namespace(namespace) .period(period) .statistic(statistics) .unit(unit) ).toString());
/** * The list of dimensions associated with the metric. * * @param dimensions the list of dimensions associated with the metric * * @return this {@code ListAlarmsForMetric} object */ public ListAlarmsForMetric dimensions(Set<Dimension> dimensions) { for (Dimension dimension : checkNotNull(dimensions, "dimensions")) { dimension(dimension); } return this; }
.listForMetric(new ListAlarmsForMetric() .dimensions(ImmutableSet.of( new Dimension("TestDimensionName1", "TestDimensionValue1"), "TestDimensionValue2") )) .metricName(metricName) .namespace(namespace) .period(period) .statistic(statistics) .unit(unit) ).toString());
/** * The list of dimensions associated with the metric. * * @param dimensions the list of dimensions associated with the metric * * @return this {@code ListAlarmsForMetric} object */ public ListAlarmsForMetric dimensions(Set<Dimension> dimensions) { for (Dimension dimension : checkNotNull(dimensions, "dimensions")) { dimension(dimension); } return this; }
/** * The list of dimensions associated with the metric. * * @param dimensions the list of dimensions associated with the metric * * @return this {@code ListAlarmsForMetric} object */ public ListAlarmsForMetric dimensions(Set<Dimension> dimensions) { for (Dimension dimension : checkNotNull(dimensions, "dimensions")) { dimension(dimension); } return this; }
/** * The list of dimensions associated with the metric. * * @param dimensions the list of dimensions associated with the metric * * @return this {@code ListAlarmsForMetric} object */ public ListAlarmsForMetric dimensions(Set<Dimension> dimensions) { for (Dimension dimension : checkNotNull(dimensions, "dimensions")) { dimension(dimension); } return this; }
/** * The list of dimensions associated with the metric. * * @param dimensions the list of dimensions associated with the metric * * @return this {@code ListAlarmsForMetric} object */ public ListAlarmsForMetric dimensions(Set<Dimension> dimensions) { for (Dimension dimension : checkNotNull(dimensions, "dimensions")) { dimension(dimension); } return this; }