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.

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.
  • 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:

CloudError

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 Log Service. The current list includes the following: Aministrative, Security, ServiceHealth, Alert, Recommendation, Policy.

Parameters:
Return type:

LocalizableStringPaged

Raises:

CloudError

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 events. The $filter is very restricted and allows only the following patterns. - 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>’. - List events for resource: $filter=eventTimestamp ge ‘<Start Time>’ and eventTimestamp le ‘<End Time>’ and eventChannels eq ‘Admin, Operation’ and resourceUri eq ‘<ResourceURI>’. - List events for a subscription: $filter=eventTimestamp ge ‘<Start Time>’ and eventTimestamp le ‘<End Time>’ and eventChannels eq ‘Admin, Operation’. -List events for a resource provider: $filter=eventTimestamp ge ‘<Start Time>’ and eventTimestamp le ‘<End Time>’ and eventChannels eq ‘Admin, Operation’ and resourceProvider eq ‘<ResourceProviderName>’. - 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>’. No other syntax is allowed.

Parameters:
  • filter (str) – Reduces the set of data collected. The syntax allowed depends on the operation. See the operation’s description for details.
  • select (str) – Used to fetch events with only the given properties. The filter is a comma separated list of property names to be returned. Possible values are: authorization, channels, 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:

CloudError

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]

get the Activity Logs for the Tenant. Everything that is applicable to the API to get the Activity Log for the subscription is applicable to this API (the parameters, $filter, etc.). 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. The $filter is very restricted and allows only the following patterns. - 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>’. - List events for resource: $filter=eventTimestamp ge ‘<Start Time>’ and eventTimestamp le ‘<End Time>’ and eventChannels eq ‘Admin, Operation’ and resourceUri eq ‘<ResourceURI>’. - List events for a subscription: $filter=eventTimestamp ge ‘<Start Time>’ and eventTimestamp le ‘<End Time>’ and eventChannels eq ‘Admin, Operation’. - 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>’. - 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>’. No other syntax is allowed.

Parameters:
  • filter (str) – Reduces the set of data collected. The syntax allowed depends on the operation. See the operation’s description for details.
  • select (str) – Used to fetch events with only the given properties. The filter is a comma separated list of property names to be returned. Possible values are: authorization, channels, 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:

CloudError

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. The $filter parameter is optional, and can be used to only retrieve certain metric definitions. For example, get just the definition for the CPU percentage counter: $filter=name.value eq ‘Processor(_Total)% Processor Time’. This $filter is very restricted and allows only these ‘name eq <value>’ clauses separated by or operators. No other syntax is allowed.

Parameters:
  • resource_uri (str) – The identifier of the resource.
  • filter (str) – Reduces the set of data collected. The syntax allowed depends on the operation. See the operation’s description for details.
  • 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:

CloudError

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.<br>The $filter is used to reduce the set of metric data returned. Some common properties for this expression will be: name.value, aggregationType, startTime, endTime, timeGrain. The filter expression uses these properties with comparison operators (eg. eq, gt, lt) and multiple expressions can be combined with parentheses and ‘and/or’ operators.<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.

Parameters:
  • resource_uri (str) – The identifier of the resource.
  • filter (str) – Reduces the set of data collected. The syntax allowed depends on the operation. See the operation’s description for details.
  • 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:

CloudError