All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.microsoft.azure.management.monitor.MetricDefinition Maven / Gradle / Ivy

Go to download

This package contains Microsoft Azure Monitor SDK. This package has been deprecated. A replacement package com.azure.resourcemanager:azure-resourcemanager-monitor is available as of 31-March-2022. We strongly encourage you to upgrade to continue receiving updates. See Migration Guide https://aka.ms/java-track2-migration-guide for guidance on upgrading. Refer to our deprecation policy https://azure.github.io/azure-sdk/policies_support.html for more details.

There is a newer version: 1.41.4
Show newest version
/**
 * 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.
 */
@LangDefinition(ContainerName = "/Microsoft.Azure.Management.Monitor.Fluent")
public interface MetricDefinition extends
        HasManager,
        HasInner {

    /**
     * Get the resourceId value.
     *
     * @return the resourceId value
     */
    @LangMethodDefinition(AsType = LangMethodDefinition.LangMethodType.Property)
    String resourceId();

    /**
     * Get the name value.
     *
     * @return the name value
     */
    @LangMethodDefinition(AsType = LangMethodDefinition.LangMethodType.Property)
    LocalizableString name();

    /**
     * Get the namespace value.
     *
     * @return the namespace value
     */
    @LangMethodDefinition(AsType = LangMethodDefinition.LangMethodType.Property)
    String namespace();

    /**
     * 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.
     *
     * @return the list of dimension values.
     */
    @LangMethodDefinition(AsType = LangMethodDefinition.LangMethodType.Property)
    List dimensions();

    /**
     * the collection of what aggregation types are supported.
     *
     * @return the list of supported aggregation type values.
     */
    @LangMethodDefinition(AsType = LangMethodDefinition.LangMethodType.Property)
    List supportedAggregationTypes();

    /**
     * Get the unit value.
     *
     * @return the unit value
     */
    @LangMethodDefinition(AsType = LangMethodDefinition.LangMethodType.Property)
    Unit unit();

    /**
     * Get the primaryAggregationType value.
     *
     * @return the primaryAggregationType value
     */
    @LangMethodDefinition(AsType = LangMethodDefinition.LangMethodType.Property)
    AggregationType primaryAggregationType();

    /**
     * Get the metricAvailabilities value.
     *
     * @return the metricAvailabilities value
     */
    @LangMethodDefinition(AsType = LangMethodDefinition.LangMethodType.Property)
    List metricAvailabilities();

    /**
     * Get the id value.
     *
     * @return the id value
     */
    @LangMethodDefinition(AsType = LangMethodDefinition.LangMethodType.Property)
    String id();

    /**
     * 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.
     */
    interface MetricsQueryDefinition extends
            MetricsQueryDefinitionStages.WithMetricStartTimeFilter,
            MetricsQueryDefinitionStages.WithMetricEndFilter,
            MetricsQueryDefinitionStages.WithMetricsQueryExecute {
    }

    /**
     * Grouping of Metric query stages.
     */
    interface MetricsQueryDefinitionStages {

        /**
         * The stage of a Metric query allowing to specify start time filter.
         */
        interface WithMetricStartTimeFilter {
            /**
             * 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.
         */
        interface WithMetricEndFilter {
            /**
             * 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.
         */
        interface WithMetricsQueryExecute {
            /**
             * 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.
             *
             * @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 ‘*’**.
             *
             * @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'
             *
             * @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.
             * @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.
             *
             * @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.
             *
             * @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.
             *
             * @return Metric collection received after query execution.
             */
            @Method
            MetricCollection execute();

            /**
             * Executes the query.
             *
             * @return a representation of the deferred computation of Metric collection query call
             */
            @Method
            Observable executeAsync();
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy