azure.monitor.operations module

class azure.monitor.operations.UsageMetricsOperations(client, config, serializer, deserializer)[source]

Bases: object

UsageMetricsOperations operations.

Parameters:
  • client – Client for service requests.
  • config – Configuration of service client.
  • serializer – An object model serializer.
  • deserializer – An objec model deserializer.
list(resource_uri, api_version, filter=None, custom_headers=None, raw=False, **operation_config)[source]

The List operation lists the usage metrics for the resource.<br>**WARNING**: This operation will be deprecated in the next release.

Parameters:
  • resource_uri (str) – The identifier of the resource.
  • api_version (str) – Client Api Version. NOTE: This is not a client property, it must be explicit in the call and there is no default value.
  • filter (str) – The filter to apply on the operation.<br>**WARNING**: $filter not documented since the operation will be deprecated in the next release.
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Return type:

UsageMetricPaged

Raises:

ErrorResponseException

class azure.monitor.operations.EventCategoriesOperations(client, config, serializer, deserializer)[source]

Bases: object

EventCategoriesOperations operations.

Parameters:
  • client – Client for service requests.
  • config – Configuration of service client.
  • serializer – An object model serializer.
  • deserializer – An objec model deserializer.
Variables:

api_version – Client Api Version. Constant value: “2015-04-01”.

list(custom_headers=None, raw=False, **operation_config)[source]

Get the list of available event categories supported in the Activity Logs Service.<br>The current list includes the following: Aministrative, Security, ServiceHealth, Alert, Recommendation, Policy.

Parameters:
Return type:

LocalizableStringPaged

Raises:

ErrorResponseException

class azure.monitor.operations.ActivityLogsOperations(client, config, serializer, deserializer)[source]

Bases: object

ActivityLogsOperations operations.

Parameters:
  • client – Client for service requests.
  • config – Configuration of service client.
  • serializer – An object model serializer.
  • deserializer – An objec model deserializer.
Variables:

api_version – Client Api Version. Constant value: “2015-04-01”.

list(filter=None, select=None, custom_headers=None, raw=False, **operation_config)[source]

Provides the list of records from the activity logs.

Parameters:
  • filter (str) – Reduces the set of data collected.<br>The $filter argument is very restricted and allows only the following patterns.<br>- List events for a resource group: $filter=eventTimestamp ge ‘2014-07-16T04:36:37.6407898Z’ and eventTimestamp le ‘2014-07-20T04:36:37.6407898Z’ and resourceGroupName eq ‘resourceGroupName’.<br>- List events for resource: $filter=eventTimestamp ge ‘2014-07-16T04:36:37.6407898Z’ and eventTimestamp le ‘2014-07-20T04:36:37.6407898Z’ and resourceUri eq ‘resourceURI’.<br>- List events for a subscription in a time range: $filter=eventTimestamp ge ‘2014-07-16T04:36:37.6407898Z’ and eventTimestamp le ‘2014-07-20T04:36:37.6407898Z’.<br>- List events for a resource provider: $filter=eventTimestamp ge ‘2014-07-16T04:36:37.6407898Z’ and eventTimestamp le ‘2014-07-20T04:36:37.6407898Z’ and resourceProvider eq ‘resourceProviderName’.<br>- List events for a correlation Id: $filter=eventTimestamp ge ‘2014-07-16T04:36:37.6407898Z’ and eventTimestamp le ‘2014-07-20T04:36:37.6407898Z’ and correlationId eq ‘correlationID’.<br><br>**NOTE**: No other syntax is allowed.
  • select (str) – Used to fetch events with only the given properties.<br>The $select argument is a comma separated list of property names to be returned. Possible values are: authorization, claims, correlationId, description, eventDataId, eventName, eventTimestamp, httpRequest, level, operationId, operationName, properties, resourceGroupName, resourceProviderName, resourceId, status, submissionTimestamp, subStatus, subscriptionId
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Return type:

EventDataPaged

Raises:

ErrorResponseException

class azure.monitor.operations.TenantActivityLogsOperations(client, config, serializer, deserializer)[source]

Bases: object

TenantActivityLogsOperations operations.

Parameters:
  • client – Client for service requests.
  • config – Configuration of service client.
  • serializer – An object model serializer.
  • deserializer – An objec model deserializer.
Variables:

api_version – Client Api Version. Constant value: “2015-04-01”.

list(filter=None, select=None, custom_headers=None, raw=False, **operation_config)[source]

Gets the Activity Logs for the Tenant.<br>Everything that is applicable to the API to get the Activity Logs for the subscription is applicable to this API (the parameters, $filter, etc.).<br>One thing to point out here is that this API does not retrieve the logs at the individual subscription of the tenant but only surfaces the logs that were generated at the tenant level.

Parameters:
  • filter (str) – Reduces the set of data collected. <br>The $filter is very restricted and allows only the following patterns.<br>- List events for a resource group: $filter=eventTimestamp ge ‘<Start Time>’ and eventTimestamp le ‘<End Time>’ and eventChannels eq ‘Admin, Operation’ and resourceGroupName eq ‘<ResourceGroupName>’.<br>- List events for resource: $filter=eventTimestamp ge ‘<Start Time>’ and eventTimestamp le ‘<End Time>’ and eventChannels eq ‘Admin, Operation’ and resourceUri eq ‘<ResourceURI>’.<br>- List events for a subscription: $filter=eventTimestamp ge ‘<Start Time>’ and eventTimestamp le ‘<End Time>’ and eventChannels eq ‘Admin, Operation’.<br>- List evetns for a resource provider: $filter=eventTimestamp ge ‘<Start Time>’ and eventTimestamp le ‘<End Time>’ and eventChannels eq ‘Admin, Operation’ and resourceProvider eq ‘<ResourceProviderName>’.<br>- List events for a correlation Id: api-version=2014-04-01&$filter=eventTimestamp ge ‘2014-07-16T04:36:37.6407898Z’ and eventTimestamp le ‘2014-07-20T04:36:37.6407898Z’ and eventChannels eq ‘Admin, Operation’ and correlationId eq ‘<CorrelationID>’.<br>**NOTE**: No other syntax is allowed.
  • select (str) – Used to fetch events with only the given properties.<br>The $select argument is a comma separated list of property names to be returned. Possible values are: authorization, claims, correlationId, description, eventDataId, eventName, eventTimestamp, httpRequest, level, operationId, operationName, properties, resourceGroupName, resourceProviderName, resourceId, status, submissionTimestamp, subStatus, subscriptionId
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Return type:

EventDataPaged

Raises:

ErrorResponseException

class azure.monitor.operations.MetricDefinitionsOperations(client, config, serializer, deserializer)[source]

Bases: object

MetricDefinitionsOperations operations.

Parameters:
  • client – Client for service requests.
  • config – Configuration of service client.
  • serializer – An object model serializer.
  • deserializer – An objec model deserializer.
Variables:

api_version – Client Api Version. Constant value: “2016-03-01”.

list(resource_uri, filter=None, custom_headers=None, raw=False, **operation_config)[source]

Lists the metric definitions for the resource.

Parameters:
  • resource_uri (str) – The identifier of the resource.
  • filter (str) – Reduces the set of data collected by retrieving particular metric definitions from all the definitions available for the resource.<br>For example, to get just the definition for the ‘CPU percentage’ counter: $filter=name.value eq ‘Processor(_Total)% Processor Time’.<br>Multiple metrics can be retrieved by joining together ‘name eq <value>’ clauses separated by or logical operators.<br>**NOTE**: No other syntax is allowed.
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Return type:

MetricDefinitionPaged

Raises:

ErrorResponseException

class azure.monitor.operations.MetricsOperations(client, config, serializer, deserializer)[source]

Bases: object

MetricsOperations operations.

Parameters:
  • client – Client for service requests.
  • config – Configuration of service client.
  • serializer – An object model serializer.
  • deserializer – An objec model deserializer.
Variables:

api_version – Client Api Version. Constant value: “2016-09-01”.

list(resource_uri, filter=None, custom_headers=None, raw=False, **operation_config)[source]

Lists the metric values for a resource.

Parameters:
  • resource_uri (str) – The identifier of the resource.
  • filter (str) – Reduces the set of data collected.<br>The filter is optional. If present it must contain a list of metric names to retrieve of the form: (name.value eq ‘metricName’ [or name.value eq ‘metricName’ or ...]). Optionally, the filter can contain conditions for the following attributes aggregationType, startTime, endTime, and timeGrain of the form attributeName operator value. Where operator is one of ne, eq, gt, lt.<br>Several conditions can be combined with parentheses and logical operators, e.g: and, or.<br>Some example filter expressions are:<br>- $filter=(name.value eq ‘RunsSucceeded’) and aggregationType eq ‘Total’ and startTime eq 2016-02-20 and endTime eq 2016-02-21 and timeGrain eq duration’PT1M’,<br>- $filter=(name.value eq ‘RunsSucceeded’) and (aggregationType eq ‘Total’ or aggregationType eq ‘Average’) and startTime eq 2016-02-20 and endTime eq 2016-02-21 and timeGrain eq duration’PT1H’,<br>- $filter=(name.value eq ‘ActionsCompleted’ or name.value eq ‘RunsSucceeded’) and (aggregationType eq ‘Total’ or aggregationType eq ‘Average’) and startTime eq 2016-02-20 and endTime eq 2016-02-21 and timeGrain eq duration’PT1M’.<br><br>**NOTE**: When a metrics query comes in with multiple metrics, but with no aggregation types defined, the service will pick the Primary aggregation type of the first metrics to be used as the default aggregation type for all the metrics.
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Return type:

MetricPaged

Raises:

ErrorResponseException