Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file modified azure-monitor/azure/monitor/__init__.py
100755 → 100644
Empty file.
14 changes: 10 additions & 4 deletions azure-monitor/azure/monitor/models/__init__.py
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,19 @@
from .metric_availability import MetricAvailability
from .metric_definition import MetricDefinition
from .metric_value import MetricValue
from .metadata_value import MetadataValue
from .time_series_element import TimeSeriesElement
from .metric import Metric
from .response import Response
from .usage_metric_paged import UsageMetricPaged
from .localizable_string_paged import LocalizableStringPaged
from .event_data_paged import EventDataPaged
from .localizable_string_paged import LocalizableStringPaged
from .metric_definition_paged import MetricDefinitionPaged
from .metric_paged import MetricPaged
from .monitor_client_enums import (
EventLevel,
Unit,
AggregationType,
ResultType,
)

__all__ = [
Expand All @@ -40,13 +43,16 @@
'MetricAvailability',
'MetricDefinition',
'MetricValue',
'MetadataValue',
'TimeSeriesElement',
'Metric',
'Response',
'UsageMetricPaged',
'LocalizableStringPaged',
'EventDataPaged',
'LocalizableStringPaged',
'MetricDefinitionPaged',
'MetricPaged',
'EventLevel',
'Unit',
'AggregationType',
'ResultType',
]
Empty file modified azure-monitor/azure/monitor/models/error_response.py
100755 → 100644
Empty file.
Empty file modified azure-monitor/azure/monitor/models/event_data.py
100755 → 100644
Empty file.
2 changes: 1 addition & 1 deletion azure-monitor/azure/monitor/models/event_data_paged.py
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

class EventDataPaged(Paged):
"""
A paging container for iterating over a list of EventData object
A paging container for iterating over a list of :class:`EventData <azure.monitor.models.EventData>` object
"""

_attribute_map = {
Expand Down
Empty file modified azure-monitor/azure/monitor/models/http_request_info.py
100755 → 100644
Empty file.
Empty file modified azure-monitor/azure/monitor/models/localizable_string.py
100755 → 100644
Empty file.
2 changes: 1 addition & 1 deletion azure-monitor/azure/monitor/models/localizable_string_paged.py
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

class LocalizableStringPaged(Paged):
"""
A paging container for iterating over a list of LocalizableString object
A paging container for iterating over a list of :class:`LocalizableString <azure.monitor.models.LocalizableString>` object
"""

_attribute_map = {
Expand Down
32 changes: 32 additions & 0 deletions azure-monitor/azure/monitor/models/metadata_value.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from msrest.serialization import Model


class MetadataValue(Model):
"""Represents a metric metadata value.

:param name: the name of the metadata.
:type name: :class:`LocalizableString
<azure.monitor.models.LocalizableString>`
:param value: the value of the metadata.
:type value: str
"""

_attribute_map = {
'name': {'key': 'name', 'type': 'LocalizableString'},
'value': {'key': 'value', 'type': 'str'},
}

def __init__(self, name=None, value=None):
self.name = name
self.value = value
21 changes: 12 additions & 9 deletions azure-monitor/azure/monitor/models/metric.py
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@


class Metric(Model):
"""A set of metric values in a time range.
"""The result data of a query.

:param id: the id, resourceId, of the metric.
:param id: the metric Id.
:type id: str
:param type: the resource type of the metric resource.
:type type: str
Expand All @@ -27,28 +27,31 @@ class Metric(Model):
'Bytes', 'Seconds', 'CountPerSecond', 'BytesPerSecond', 'Percent',
'MilliSeconds'
:type unit: str or :class:`Unit <azure.monitor.models.Unit>`
:param data: Array of data points representing the metric values.
:type data: list of :class:`MetricValue
<azure.monitor.models.MetricValue>`
:param timeseries: the time series returned when a data query is
performed.
:type timeseries: list of :class:`TimeSeriesElement
<azure.monitor.models.TimeSeriesElement>`
"""

_validation = {
'id': {'required': True},
'type': {'required': True},
'name': {'required': True},
'unit': {'required': True},
'data': {'required': True},
'timeseries': {'required': True},
}

_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'},
'name': {'key': 'name', 'type': 'LocalizableString'},
'unit': {'key': 'unit', 'type': 'Unit'},
'data': {'key': 'data', 'type': '[MetricValue]'},
'timeseries': {'key': 'timeseries', 'type': '[TimeSeriesElement]'},
}

def __init__(self, name, unit, data, id=None, type=None):
def __init__(self, id, type, name, unit, timeseries):
self.id = id
self.type = type
self.name = name
self.unit = unit
self.data = data
self.timeseries = timeseries
Empty file modified azure-monitor/azure/monitor/models/metric_availability.py
100755 → 100644
Empty file.
13 changes: 12 additions & 1 deletion azure-monitor/azure/monitor/models/metric_definition.py
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
class MetricDefinition(Model):
"""Metric definition class specifies the metadata for a metric.

:param is_dimension_required: Flag to indicate whether the dimension is
required.
:type is_dimension_required: bool
:param resource_id: the resource identifier of the resource that emitted
the metric.
:type resource_id: str
Expand All @@ -37,21 +40,29 @@ class MetricDefinition(Model):
<azure.monitor.models.MetricAvailability>`
:param id: the resource identifier of the metric definition.
:type id: str
:param dimensions: the name and the display name of the dimension, i.e. it
is a localizable string.
:type dimensions: list of :class:`LocalizableString
<azure.monitor.models.LocalizableString>`
"""

_attribute_map = {
'is_dimension_required': {'key': 'isDimensionRequired', 'type': 'bool'},
'resource_id': {'key': 'resourceId', 'type': 'str'},
'name': {'key': 'name', 'type': 'LocalizableString'},
'unit': {'key': 'unit', 'type': 'Unit'},
'primary_aggregation_type': {'key': 'primaryAggregationType', 'type': 'AggregationType'},
'metric_availabilities': {'key': 'metricAvailabilities', 'type': '[MetricAvailability]'},
'id': {'key': 'id', 'type': 'str'},
'dimensions': {'key': 'dimensions', 'type': '[LocalizableString]'},
}

def __init__(self, resource_id=None, name=None, unit=None, primary_aggregation_type=None, metric_availabilities=None, id=None):
def __init__(self, is_dimension_required=None, resource_id=None, name=None, unit=None, primary_aggregation_type=None, metric_availabilities=None, id=None, dimensions=None):
self.is_dimension_required = is_dimension_required
self.resource_id = resource_id
self.name = name
self.unit = unit
self.primary_aggregation_type = primary_aggregation_type
self.metric_availabilities = metric_availabilities
self.id = id
self.dimensions = dimensions
2 changes: 1 addition & 1 deletion azure-monitor/azure/monitor/models/metric_definition_paged.py
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

class MetricDefinitionPaged(Paged):
"""
A paging container for iterating over a list of MetricDefinition object
A paging container for iterating over a list of :class:`MetricDefinition <azure.monitor.models.MetricDefinition>` object
"""

_attribute_map = {
Expand Down
27 changes: 0 additions & 27 deletions azure-monitor/azure/monitor/models/metric_paged.py

This file was deleted.

Empty file modified azure-monitor/azure/monitor/models/metric_value.py
100755 → 100644
Empty file.
6 changes: 6 additions & 0 deletions azure-monitor/azure/monitor/models/monitor_client_enums.py
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,9 @@ class AggregationType(Enum):
minimum = "Minimum"
maximum = "Maximum"
total = "Total"


class ResultType(Enum):

data = "Data"
metadata = "Metadata"
52 changes: 52 additions & 0 deletions azure-monitor/azure/monitor/models/response.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from msrest.serialization import Model


class Response(Model):
"""The response to a metrics query.

:param cost: The integer value representing the cost of the query, for
data case.
:type cost: float
:param timespan: The timespan for which the data was retrieved. Its value
consists of two datatimes concatenated, separated by '/'. This may be
adjusted in the future and returned back from what was originally
requested.
:type timespan: str
:param interval: The interval (window size) for which the metric data was
returned in. This may be adjusted in the future and returned back from
what was originally requested. This is not present if a metadata request
was made.
:type interval: timedelta
:param value: the value of the collection.
:type value: list of :class:`Metric <azure.monitor.models.Metric>`
"""

_validation = {
'cost': {'minimum': 0},
'timespan': {'required': True},
'value': {'required': True},
}

_attribute_map = {
'cost': {'key': 'cost', 'type': 'float'},
'timespan': {'key': 'timespan', 'type': 'str'},
'interval': {'key': 'interval', 'type': 'duration'},
'value': {'key': 'value', 'type': '[Metric]'},
}

def __init__(self, timespan, value, cost=None, interval=None):
self.cost = cost
self.timespan = timespan
self.interval = interval
self.value = value
Empty file modified azure-monitor/azure/monitor/models/sender_authorization.py
100755 → 100644
Empty file.
36 changes: 36 additions & 0 deletions azure-monitor/azure/monitor/models/time_series_element.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from msrest.serialization import Model


class TimeSeriesElement(Model):
"""A time series result type. The discriminator value is always TimeSeries in
this case.

:param metadatavalues: the metadata values returned if $filter was
specified in the call.
:type metadatavalues: list of :class:`MetadataValue
<azure.monitor.models.MetadataValue>`
:param data: An array of data points representing the metric values. This
is only returned if a result type of data is specified.
:type data: list of :class:`MetricValue
<azure.monitor.models.MetricValue>`
"""

_attribute_map = {
'metadatavalues': {'key': 'metadatavalues', 'type': '[MetadataValue]'},
'data': {'key': 'data', 'type': '[MetricValue]'},
}

def __init__(self, metadatavalues=None, data=None):
self.metadatavalues = metadatavalues
self.data = data
Empty file modified azure-monitor/azure/monitor/models/usage_metric.py
100755 → 100644
Empty file.
2 changes: 1 addition & 1 deletion azure-monitor/azure/monitor/models/usage_metric_paged.py
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

class UsageMetricPaged(Paged):
"""
A paging container for iterating over a list of UsageMetric object
A paging container for iterating over a list of :class:`UsageMetric <azure.monitor.models.UsageMetric>` object
"""

_attribute_map = {
Expand Down
12 changes: 6 additions & 6 deletions azure-monitor/azure/monitor/monitor_client.py
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
from msrestazure import AzureConfiguration
from .version import VERSION
from .operations.usage_metrics_operations import UsageMetricsOperations
from .operations.event_categories_operations import EventCategoriesOperations
from .operations.activity_logs_operations import ActivityLogsOperations
from .operations.event_categories_operations import EventCategoriesOperations
from .operations.tenant_activity_logs_operations import TenantActivityLogsOperations
from .operations.metric_definitions_operations import MetricDefinitionsOperations
from .operations.metrics_operations import MetricsOperations
Expand Down Expand Up @@ -57,17 +57,17 @@ def __init__(


class MonitorClient(object):
"""Composite Swagger for Monitor Client
"""Monitor Client

:ivar config: Configuration for client.
:vartype config: MonitorClientConfiguration

:ivar usage_metrics: UsageMetrics operations
:vartype usage_metrics: azure.monitor.operations.UsageMetricsOperations
:ivar event_categories: EventCategories operations
:vartype event_categories: azure.monitor.operations.EventCategoriesOperations
:ivar activity_logs: ActivityLogs operations
:vartype activity_logs: azure.monitor.operations.ActivityLogsOperations
:ivar event_categories: EventCategories operations
:vartype event_categories: azure.monitor.operations.EventCategoriesOperations
:ivar tenant_activity_logs: TenantActivityLogs operations
:vartype tenant_activity_logs: azure.monitor.operations.TenantActivityLogsOperations
:ivar metric_definitions: MetricDefinitions operations
Expand Down Expand Up @@ -95,10 +95,10 @@ def __init__(

self.usage_metrics = UsageMetricsOperations(
self._client, self.config, self._serialize, self._deserialize)
self.event_categories = EventCategoriesOperations(
self._client, self.config, self._serialize, self._deserialize)
self.activity_logs = ActivityLogsOperations(
self._client, self.config, self._serialize, self._deserialize)
self.event_categories = EventCategoriesOperations(
self._client, self.config, self._serialize, self._deserialize)
self.tenant_activity_logs = TenantActivityLogsOperations(
self._client, self.config, self._serialize, self._deserialize)
self.metric_definitions = MetricDefinitionsOperations(
Expand Down
4 changes: 2 additions & 2 deletions azure-monitor/azure/monitor/operations/__init__.py
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@
# --------------------------------------------------------------------------

from .usage_metrics_operations import UsageMetricsOperations
from .event_categories_operations import EventCategoriesOperations
from .activity_logs_operations import ActivityLogsOperations
from .event_categories_operations import EventCategoriesOperations
from .tenant_activity_logs_operations import TenantActivityLogsOperations
from .metric_definitions_operations import MetricDefinitionsOperations
from .metrics_operations import MetricsOperations

__all__ = [
'UsageMetricsOperations',
'EventCategoriesOperations',
'ActivityLogsOperations',
'EventCategoriesOperations',
'TenantActivityLogsOperations',
'MetricDefinitionsOperations',
'MetricsOperations',
Expand Down
Loading