Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the MIT License. See License.txt in the project root for
license information.
/**
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*/
package com.microsoft.azure.management.monitor;
import com.microsoft.azure.management.apigeneration.LangDefinition;
import com.microsoft.azure.management.apigeneration.LangMethodDefinition;
import com.microsoft.azure.management.apigeneration.Method;
import com.microsoft.azure.management.monitor.implementation.MetricDefinitionInner;
import com.microsoft.azure.management.monitor.implementation.MonitorManager;
import com.microsoft.azure.management.resources.fluentcore.arm.models.HasManager;
import com.microsoft.azure.management.resources.fluentcore.model.HasInner;
import org.joda.time.DateTime;
import org.joda.time.Period;
import rx.Observable;
import java.util.List;
The Azure metric definition entries are of type MetricDefinition.
/**
* The Azure metric definition entries are of type MetricDefinition.
*/
@LangDefinition(ContainerName = "/Microsoft.Azure.Management.Monitor.Fluent")
public interface MetricDefinition extends
HasManager<MonitorManager>,
HasInner<MetricDefinitionInner> {
Get the resourceId value.
Returns: the resourceId value
/**
* Get the resourceId value.
*
* @return the resourceId value
*/
@LangMethodDefinition(AsType = LangMethodDefinition.LangMethodType.Property)
String resourceId();
Get the name value.
Returns: the name value
/**
* Get the name value.
*
* @return the name value
*/
@LangMethodDefinition(AsType = LangMethodDefinition.LangMethodType.Property)
LocalizableString name();
Get the namespace value.
Returns: the namespace value
/**
* Get the namespace value.
*
* @return the namespace value
*/
@LangMethodDefinition(AsType = LangMethodDefinition.LangMethodType.Property)
String namespace();
Get the isDimensionRequired value.
Returns: the isDimensionRequired value
/**
* Get the isDimensionRequired value.
*
* @return the isDimensionRequired value
*/
@LangMethodDefinition(AsType = LangMethodDefinition.LangMethodType.Property)
boolean isDimensionRequired();
the name and the display name of the dimension, i.e. it is a localizable
string.
Returns: the list of dimension values.
/**
* the name and the display name of the dimension, i.e. it is a localizable
* string.
*
* @return the list of dimension values.
*/
@LangMethodDefinition(AsType = LangMethodDefinition.LangMethodType.Property)
List<LocalizableString> dimensions();
the collection of what aggregation types are supported.
Returns: the list of supported aggregation type values.
/**
* the collection of what aggregation types are supported.
*
* @return the list of supported aggregation type values.
*/
@LangMethodDefinition(AsType = LangMethodDefinition.LangMethodType.Property)
List<AggregationType> supportedAggregationTypes();
Get the unit value.
Returns: the unit value
/**
* Get the unit value.
*
* @return the unit value
*/
@LangMethodDefinition(AsType = LangMethodDefinition.LangMethodType.Property)
Unit unit();
Get the primaryAggregationType value.
Returns: the primaryAggregationType value
/**
* Get the primaryAggregationType value.
*
* @return the primaryAggregationType value
*/
@LangMethodDefinition(AsType = LangMethodDefinition.LangMethodType.Property)
AggregationType primaryAggregationType();
Get the metricAvailabilities value.
Returns: the metricAvailabilities value
/**
* Get the metricAvailabilities value.
*
* @return the metricAvailabilities value
*/
@LangMethodDefinition(AsType = LangMethodDefinition.LangMethodType.Property)
List<MetricAvailability> metricAvailabilities();
Get the id value.
Returns: the id value
/**
* Get the id value.
*
* @return the id value
*/
@LangMethodDefinition(AsType = LangMethodDefinition.LangMethodType.Property)
String id();
Begins a definition for a new resource Metric query.
Returns: the stage of start time filter definition.
/**
* Begins a definition for a new resource Metric query.
*
* @return the stage of start time filter definition.
*/
@Method
MetricsQueryDefinitionStages.WithMetricStartTimeFilter defineQuery();
The entirety of a Metrics query definition.
/**
* The entirety of a Metrics query definition.
*/
interface MetricsQueryDefinition extends
MetricsQueryDefinitionStages.WithMetricStartTimeFilter,
MetricsQueryDefinitionStages.WithMetricEndFilter,
MetricsQueryDefinitionStages.WithMetricsQueryExecute {
}
Grouping of Metric query stages.
/**
* Grouping of Metric query stages.
*/
interface MetricsQueryDefinitionStages {
The stage of a Metric query allowing to specify start time filter.
/**
* The stage of a Metric query allowing to specify start time filter.
*/
interface WithMetricStartTimeFilter {
Sets the start time for Metric query filter.
Params: - startTime – specifies start time of cut off filter.
Returns: the stage of end time filter definition.
/**
* Sets the start time for Metric query filter.
*
* @param startTime specifies start time of cut off filter.
* @return the stage of end time filter definition.
*/
WithMetricEndFilter startingFrom(DateTime startTime);
}
The stage of a Metric query allowing to specify end time filter.
/**
* The stage of a Metric query allowing to specify end time filter.
*/
interface WithMetricEndFilter {
Sets the end time for Metric query filter.
Params: - endTime – specifies end time of cut off filter.
Returns: the stage of optional query parameter definition and query execution.
/**
* Sets the end time for Metric query filter.
*
* @param endTime specifies end time of cut off filter.
* @return the stage of optional query parameter definition and query execution.
*/
WithMetricsQueryExecute endsBefore(DateTime endTime);
}
The stage of a Metric query allowing to specify optional filters and execute the query.
/**
* The stage of a Metric query allowing to specify optional filters and execute the query.
*/
interface WithMetricsQueryExecute {
Sets the list of aggregation types to retrieve.
Params: - aggregation – The list of aggregation types (comma separated) to retrieve.
Returns: the stage of optional query parameter definition and query execution.
/**
* Sets the list of aggregation types to retrieve.
*
* @param aggregation The list of aggregation types (comma separated) to retrieve.
* @return the stage of optional query parameter definition and query execution.
*/
WithMetricsQueryExecute withAggregation(String aggregation);
Sets the interval of the query.
Params: - interval – The interval of the query.
Returns: the stage of optional query parameter definition and query execution.
/**
* Sets the interval of the query.
*
* @param interval The interval of the query.
* @return the stage of optional query parameter definition and query execution.
*/
WithMetricsQueryExecute withInterval(Period interval);
Sets the **$filter** that is used to reduce the set of metric data returned.
<br>Example:<br>
Metric contains metadata A, B and C.<br>
- Return all time series of C where A = a1 and B = b1 or b2<br>
**$filter=A eq ‘a1’ and B eq ‘b1’ or B eq ‘b2’ and C eq ‘*’**<br>
- Invalid variant:<br>
**$filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘*’ or B = ‘b2’**<br>
This is invalid because the logical or operator cannot separate two different metadata names.<br>
- Return all time series where A = a1, B = b1 and C = c1:<br>
**$filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘c1’**<br>
- Return all time series where A = a1<br>
**$filter=A eq ‘a1’ and B eq ‘*’ and C eq ‘*’**.
Params: - odataFilter – the **$filter** to reduce the set of the returned metric data.
Returns: the stage of optional query parameter definition and query execution.
/**
* Sets the **$filter** that is used to reduce the set of metric data returned.
* <br>Example:<br>
* Metric contains metadata A, B and C.<br>
*
* - Return all time series of C where A = a1 and B = b1 or b2<br>
* **$filter=A eq ‘a1’ and B eq ‘b1’ or B eq ‘b2’ and C eq ‘*’**<br>
*
* - Invalid variant:<br>
* **$filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘*’ or B = ‘b2’**<br>
* This is invalid because the logical or operator cannot separate two different metadata names.<br>
*
* - Return all time series where A = a1, B = b1 and C = c1:<br>
* **$filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘c1’**<br>
*
* - Return all time series where A = a1<br>
* **$filter=A eq ‘a1’ and B eq ‘*’ and C eq ‘*’**.
*
* @param odataFilter the **$filter** to reduce the set of the returned metric data.
* @return the stage of optional query parameter definition and query execution.
*/
WithMetricsQueryExecute withOdataFilter(String odataFilter);
Reduces the set of data collected. The syntax allowed depends on the operation. See the operation's description for details. Possible values include: 'Data', 'Metadata'
Params: - resultType – the type of metric to retrieve.
Returns: the stage of optional query parameter definition and query execution.
/**
* Reduces the set of data collected. The syntax allowed depends on the operation. See the operation's description for details. Possible values include: 'Data', 'Metadata'
*
* @param resultType the type of metric to retrieve.
* @return the stage of optional query parameter definition and query execution.
*/
WithMetricsQueryExecute withResultType(ResultType resultType);
Sets the maximum number of records to retrieve.
Valid only if $filter is specified.
Defaults to 10.
Params: - top – the maximum number of records to retrieve.
Returns: the stage of optional query parameter definition and query execution.
/**
* Sets the maximum number of records to retrieve.
* Valid only if $filter is specified.
* Defaults to 10.
* @param top the maximum number of records to retrieve.
* @return the stage of optional query parameter definition and query execution.
*/
WithMetricsQueryExecute selectTop(int top);
Sets the aggregation to use for sorting results and the direction of the sort.
Only one order can be specified.
Examples: sum asc.
Params: - orderBy – the aggregation to use for sorting results and the direction of the sort.
Returns: the stage of optional query parameter definition and query execution.
/**
* Sets the aggregation to use for sorting results and the direction of the sort.
* Only one order can be specified.
* Examples: sum asc.
*
* @param orderBy the aggregation to use for sorting results and the direction of the sort.
* @return the stage of optional query parameter definition and query execution.
*/
WithMetricsQueryExecute orderBy(String orderBy);
Filters Metrics for a given namespace.
Params: - namespaceName – Metric namespace to query metric definitions for.
Returns: the stage of optional query parameter definition and query execution.
/**
* Filters Metrics for a given namespace.
*
* @param namespaceName Metric namespace to query metric definitions for.
* @return the stage of optional query parameter definition and query execution.
*/
WithMetricsQueryExecute filterByNamespace(String namespaceName);
Executes the query.
Returns: Metric collection received after query execution.
/**
* Executes the query.
*
* @return Metric collection received after query execution.
*/
@Method
MetricCollection execute();
Executes the query.
Returns: a representation of the deferred computation of Metric collection query call
/**
* Executes the query.
*
* @return a representation of the deferred computation of Metric collection query call
*/
@Method
Observable<MetricCollection> executeAsync();
}
}
}