azure.monitor.models module

class azure.monitor.models.LocalizableString(value, localized_value=None)[source]

Bases: msrest.serialization.Model

The localizable string class.

Parameters:
  • value (str) – the invariant value.
  • localized_value (str) – the locale specific value.
class azure.monitor.models.UsageMetric(name=None, current_value=None, id=None, limit=None, unit=None, next_reset_time=None, quota_period=None)[source]

Bases: msrest.serialization.Model

Usage Metric data.

Parameters:
  • name (LocalizableString) – the usage metric name and display name.
  • current_value (float) – the current value for the usage metric.
  • id (str) – the id for the usage metric.
  • limit (float) – the quota limit the usage metric.
  • unit (str) – the unit for the usage metric.
  • next_reset_time (datetime) – the next reset time for the current value.
  • quota_period (timedelta) – the amount of time it takes to reset the value.
class azure.monitor.models.ErrorResponse(code=None, message=None)[source]

Bases: msrest.serialization.Model

Describes the format of Error response.

Parameters:
  • code (str) – Error code
  • message (str) – Error message indicating why the operation failed.
exception azure.monitor.models.ErrorResponseException(deserialize, response, *args)[source]

Bases: msrest.exceptions.HttpOperationError

Server responsed with exception of type: ‘ErrorResponse’.

Parameters:
  • deserialize – A deserializer
  • response – Server response to be deserialized.
class azure.monitor.models.SenderAuthorization(action=None, role=None, scope=None)[source]

Bases: msrest.serialization.Model

the authorization used by the user who has performed the operation that led to this event. This captures the RBAC properties of the event. These usually include the ‘action’, ‘role’ and the ‘scope’.

Parameters:
  • action (str) – the permissible actions. For instance: microsoft.support/supporttickets/write
  • role (str) – the role of the user. For instance: Subscription Admin
  • scope (str) – the scope.
class azure.monitor.models.HttpRequestInfo(client_request_id=None, client_ip_address=None, method=None, uri=None)[source]

Bases: msrest.serialization.Model

The Http request info.

Parameters:
  • client_request_id (str) – the client request id.
  • client_ip_address (str) – the client Ip Address
  • method (str) – the Http request method.
  • uri (str) – the Uri.
class azure.monitor.models.EventData(level, event_timestamp, submission_timestamp, authorization=None, claims=None, caller=None, description=None, id=None, event_data_id=None, correlation_id=None, event_name=None, category=None, http_request=None, resource_group_name=None, resource_provider_name=None, resource_id=None, resource_type=None, operation_id=None, operation_name=None, properties=None, status=None, sub_status=None, subscription_id=None, tenant_id=None)[source]

Bases: msrest.serialization.Model

The Azure event log entries are of type EventData.

Parameters:
  • authorization (SenderAuthorization) –
  • claims (dict) – key value pairs to identify ARM permissions.
  • caller (str) – the email address of the user who has performed the operation, the UPN claim or SPN claim based on availability.
  • description (str) – the description of the event.
  • id (str) – the Id of this event as required by ARM for RBAC. It contains the EventDataID and a timestamp information.
  • event_data_id (str) – the event data Id. This is a unique identifier for an event.
  • correlation_id (str) – the correlation Id, usually a GUID in the string format. The correlation Id is shared among the events that belong to the same uber operation.
  • event_name (LocalizableString) – the event name. This value should not be confused with OperationName. For practical purposes, OperationName might be more appealing to end users.
  • category (LocalizableString) – the event category.
  • http_request (HttpRequestInfo) – the HTTP request info. Usually includes the ‘clientRequestId’, ‘clientIpAddress’ (IP address of the user who initiated the event) and ‘method’ (HTTP method e.g. PUT).
  • level (str or EventLevel) – the event level. Possible values include: ‘Critical’, ‘Error’, ‘Warning’, ‘Informational’, ‘Verbose’
  • resource_group_name (str) – the resource group name of the impacted resource.
  • resource_provider_name (LocalizableString) – the resource provider name of the impacted resource.
  • resource_id (str) – the resource uri that uniquely identifies the resource that caused this event.
  • resource_type (LocalizableString) – the resource type
  • operation_id (str) – It is usually a GUID shared among the events corresponding to single operation. This value should not be confused with EventName.
  • operation_name (LocalizableString) – the operation name.
  • properties (dict) – the set of <Key, Value> pairs (usually a Dictionary<String, String>) that includes details about the event.
  • status (LocalizableString) – a string describing the status of the operation. Some typical values are: Started, In progress, Succeeded, Failed, Resolved.
  • sub_status (LocalizableString) – the event sub status. Most of the time, when included, this captures the HTTP status code of the REST call. Common values are: OK (HTTP Status Code: 200), Created (HTTP Status Code: 201), Accepted (HTTP Status Code: 202), No Content (HTTP Status Code: 204), Bad Request(HTTP Status Code: 400), Not Found (HTTP Status Code: 404), Conflict (HTTP Status Code: 409), Internal Server Error (HTTP Status Code: 500), Service Unavailable (HTTP Status Code:503), Gateway Timeout (HTTP Status Code: 504)
  • event_timestamp (datetime) – the timestamp of when the event was generated by the Azure service processing the request corresponding the event. It in ISO 8601 format.
  • submission_timestamp (datetime) – the timestamp of when the event became available for querying via this API. It is in ISO 8601 format. This value should not be confused eventTimestamp. As there might be a delay between the occurence time of the event, and the time that the event is submitted to the Azure logging infrastructure.
  • subscription_id (str) – the Azure subscription Id usually a GUID.
  • tenant_id (str) – the Azure tenant Id
class azure.monitor.models.MetricAvailability(time_grain=None, retention=None)[source]

Bases: msrest.serialization.Model

Metric availability specifies the time grain (aggregation interval or frequency) and the retention period for that time grain.

Parameters:
  • time_grain (timedelta) – the time grain specifies the aggregation interval for the metric. Expressed as a duration ‘PT1M’, ‘P1D’, etc.
  • retention (timedelta) – the retention period for the metric at the specified timegrain. Expressed as a duration ‘PT1M’, ‘P1D’, etc.
class azure.monitor.models.MetricDefinition(resource_id=None, name=None, unit=None, primary_aggregation_type=None, metric_availabilities=None, id=None)[source]

Bases: msrest.serialization.Model

Metric definition class specifies the metadata for a metric.

Parameters:
  • resource_id (str) – the resource identifier of the resource that emitted the metric.
  • name (LocalizableString) – the name and the display name of the metric, i.e. it is a localizable string.
  • unit (str or Unit) – the unit of the metric. Possible values include: ‘Count’, ‘Bytes’, ‘Seconds’, ‘CountPerSecond’, ‘BytesPerSecond’, ‘Percent’, ‘MilliSeconds’
  • primary_aggregation_type (str or AggregationType) – the primary aggregation type value defining how to use the values for display. Possible values include: ‘None’, ‘Average’, ‘Count’, ‘Minimum’, ‘Maximum’, ‘Total’
  • metric_availabilities (list of MetricAvailability) – the collection of what aggregation intervals are available to be queried.
  • id (str) – the resource identifier of the metric definition.
class azure.monitor.models.MetricValue(time_stamp, average=None, minimum=None, maximum=None, total=None, count=None)[source]

Bases: msrest.serialization.Model

Represents a metric value.

Parameters:
  • time_stamp (datetime) – the timestamp for the metric value in ISO 8601 format.
  • average (float) – the average value in the time range.
  • minimum (float) – the least value in the time range.
  • maximum (float) – the greatest value in the time range.
  • total (float) – the sum of all of the values in the time range.
  • count (long) – the number of samples in the time range. Can be used to determine the number of values that contributed to the average value.
class azure.monitor.models.Metric(name, unit, data, id=None, type=None)[source]

Bases: msrest.serialization.Model

A set of metric values in a time range.

Parameters:
  • id (str) – the id, resourceId, of the metric.
  • type (str) – the resource type of the metric resource.
  • name (LocalizableString) – the name and the display name of the metric, i.e. it is localizable string.
  • unit (str or Unit) – the unit of the metric. Possible values include: ‘Count’, ‘Bytes’, ‘Seconds’, ‘CountPerSecond’, ‘BytesPerSecond’, ‘Percent’, ‘MilliSeconds’
  • data (list of MetricValue) – Array of data points representing the metric values.
class azure.monitor.models.UsageMetricPaged(*args, **kwargs)[source]

Bases: msrest.paging.Paged

A paging container for iterating over a list of UsageMetric object

class azure.monitor.models.LocalizableStringPaged(*args, **kwargs)[source]

Bases: msrest.paging.Paged

A paging container for iterating over a list of LocalizableString object

class azure.monitor.models.EventDataPaged(*args, **kwargs)[source]

Bases: msrest.paging.Paged

A paging container for iterating over a list of EventData object

class azure.monitor.models.MetricDefinitionPaged(*args, **kwargs)[source]

Bases: msrest.paging.Paged

A paging container for iterating over a list of MetricDefinition object

class azure.monitor.models.MetricPaged(*args, **kwargs)[source]

Bases: msrest.paging.Paged

A paging container for iterating over a list of Metric object

class azure.monitor.models.EventLevel[source]

Bases: enum.Enum

critical = 'Critical'
error = 'Error'
informational = 'Informational'
verbose = 'Verbose'
warning = 'Warning'
class azure.monitor.models.Unit[source]

Bases: enum.Enum

bytes = 'Bytes'
bytes_per_second = 'BytesPerSecond'
count = 'Count'
count_per_second = 'CountPerSecond'
milli_seconds = 'MilliSeconds'
percent = 'Percent'
seconds = 'Seconds'
class azure.monitor.models.AggregationType[source]

Bases: enum.Enum

average = 'Average'
count = 'Count'
maximum = 'Maximum'
minimum = 'Minimum'
none = 'None'
total = 'Total'