azure-mgmt-alertsmanagement/azure/mgmt/alertsmanagement/operations/alerts_operations.py
def get_summary(
            self, groupby, include_smart_groups_count=None, target_resource=None, target_resource_type=None, target_resource_group=None, monitor_service=None, monitor_condition=None, severity=None, alert_state=None, alert_rule=None, time_range=None, custom_time_range=None, custom_headers=None, raw=False, **operation_config):
        """Summary of alerts with the count each severity.

        :param groupby: This parameter allows the result set to be aggregated
         by input fields. For example, groupby=severity,alertstate. Possible
         values include: 'severity', 'alertState', 'monitorCondition',
         'monitorService', 'signalType', 'alertRule'
        :type groupby: str or
         ~azure.mgmt.alertsmanagement.models.AlertsSummaryGroupByFields
        :param include_smart_groups_count: Include count of the SmartGroups as
         part of the summary. Default value is 'false'.
        :type include_smart_groups_count: bool
        :param target_resource: Filter by target resource( which is full ARM
         ID) Default value is select all.
        :type target_resource: str
        :param target_resource_type: Filter by target resource type. Default
         value is select all.
        :type target_resource_type: str
        :param target_resource_group: Filter by target resource group name.
         Default value is select all.
        :type target_resource_group: str
        :param monitor_service: Filter by monitor service which is the source
         of the alert instance. Default value is select all. Possible values
         include: 'Application Insights', 'ActivityLog Administrative',
         'ActivityLog Security', 'ActivityLog Recommendation', 'ActivityLog
         Policy', 'ActivityLog Autoscale', 'Log Analytics', 'Nagios',
         'Platform', 'SCOM', 'ServiceHealth', 'SmartDetector', 'VM Insights',
         'Zabbix'
        :type monitor_service: str or
         ~azure.mgmt.alertsmanagement.models.MonitorService
        :param monitor_condition: Filter by monitor condition which is the
         state of the  monitor(alertRule) at monitor service. Default value is
         to select all. Possible values include: 'Fired', 'Resolved'
        :type monitor_condition: str or
         ~azure.mgmt.alertsmanagement.models.MonitorCondition
        :param severity: Filter by severity.  Defaut value is select all.
         Possible values include: 'Sev0', 'Sev1', 'Sev2', 'Sev3', 'Sev4'
        :type severity: str or ~azure.mgmt.alertsmanagement.models.Severity
        :param alert_state: Filter by state of the alert instance. Default
         value is to select all. Possible values include: 'New',
         'Acknowledged', 'Closed'
        :type alert_state: str or
         ~azure.mgmt.alertsmanagement.models.AlertState
        :param alert_rule: Filter by alert rule(monitor) which fired alert
         instance.  Default value is to select all.
        :type alert_rule: str
        :param time_range: Filter by time range by below listed values.
         Default value is 1 day. Possible values include: '1h', '1d', '7d',
         '30d'
        :type time_range: str or ~azure.mgmt.alertsmanagement.models.TimeRange
        :param custom_time_range: Filter by custom time range in the format
         <start-time>/<end-time>  where time is in (ISO-8601 format)'.
         Permissible values is within 30 days from  query time. Either
         timeRange or customTimeRange could be used but not both. Default is
         none.
        :type custom_time_range: str
        :param dict custom_headers: headers that will be added to the request
        :param bool raw: returns the direct response alongside the
         deserialized response
        :param operation_config: :ref:`Operation configuration
         overrides<msrest:optionsforoperations>`.
        :return: AlertsSummary or ClientRawResponse if raw=true
        :rtype: ~azure.mgmt.alertsmanagement.models.AlertsSummary or
         ~msrest.pipeline.ClientRawResponse
        :raises:
         :class:`ErrorResponseException<azure.mgmt.alertsmanagement.models.ErrorResponseException>`
        """
        # Construct URL
        url = self.get_summary.metadata['url']
        path_format_arguments = {
            'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str')
        }
        url = self._client.format_url(url, **path_format_arguments)

        # Construct parameters
        query_parameters = {}
        query_parameters['groupby'] = self._serialize.query("groupby", groupby, 'str')
        if include_smart_groups_count is not None:
            query_parameters['includeSmartGroupsCount'] = self._serialize.query("include_smart_groups_count", include_smart_groups_count, 'bool')
        if target_resource is not None:
            query_parameters['targetResource'] = self._serialize.query("target_resource", target_resource, 'str')
        if target_resource_type is not None:
            query_parameters['targetResourceType'] = self._serialize.query("target_resource_type", target_resource_type, 'str')
        if target_resource_group is not None:
            query_parameters['targetResourceGroup'] = self._serialize.query("target_resource_group", target_resource_group, 'str')
        if monitor_service is not None:
            query_parameters['monitorService'] = self._serialize.query("monitor_service", monitor_service, 'str')
        if monitor_condition is not None:
            query_parameters['monitorCondition'] = self._serialize.query("monitor_condition", monitor_condition, 'str')
        if severity is not None:
            query_parameters['severity'] = self._serialize.query("severity", severity, 'str')
        if alert_state is not None:
            query_parameters['alertState'] = self._serialize.query("alert_state", alert_state, 'str')
        if alert_rule is not None:
            query_parameters['alertRule'] = self._serialize.query("alert_rule", alert_rule, 'str')
        if time_range is not None:
            query_parameters['timeRange'] = self._serialize.query("time_range", time_range, 'str')
        if custom_time_range is not None:
            query_parameters['customTimeRange'] = self._serialize.query("custom_time_range", custom_time_range, 'str')
        query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')

        # Construct headers
        header_parameters = {}
        header_parameters['Accept'] = 'application/json'
        if self.config.generate_client_request_id:
            header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
        if custom_headers:
            header_parameters.update(custom_headers)
        if self.config.accept_language is not None:
            header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')

        # Construct and send request
        request = self._client.get(url, query_parameters, header_parameters)
        response = self._client.send(request, stream=False, **operation_config)

        if response.status_code not in [200]:
            raise models.ErrorResponseException(self._deserialize, response)

        deserialized = None

        if response.status_code == 200:
            deserialized = self._deserialize('AlertsSummary', response)

        if raw:
            client_raw_response = ClientRawResponse(deserialized, response)
            return client_raw_response

        return deserialized
def get_summary(
            self, groupby, include_smart_groups_count=None, target_resource=None, target_resource_type=None, target_resource_group=None, monitor_service=None, monitor_condition=None, severity=None, alert_state=None, alert_rule=None, time_range=None, custom_time_range=None, custom_headers=None, raw=False, **operation_config):
        """Summary of alerts with the count each severity.

        :param groupby: This parameter allows the result set to be aggregated
         by input fields. For example, groupby=severity,alertstate. Possible
         values include: 'severity', 'alertState', 'monitorCondition',
         'monitorService', 'signalType', 'alertRule'
        :type groupby: str or
         ~azure.mgmt.alertsmanagement.models.AlertsSummaryGroupByFields
        :param include_smart_groups_count: Include count of the SmartGroups as
         part of the summary. Default value is 'false'.
        :type include_smart_groups_count: bool
        :param target_resource: Filter by target resource( which is full ARM
         ID) Default value is select all.
        :type target_resource: str
        :param target_resource_type: Filter by target resource type. Default
         value is select all.
        :type target_resource_type: str
        :param target_resource_group: Filter by target resource group name.
         Default value is select all.
        :type target_resource_group: str
        :param monitor_service: Filter by monitor service which is the source
         of the alert instance. Default value is select all. Possible values
         include: 'Application Insights', 'ActivityLog Administrative',
         'ActivityLog Security', 'ActivityLog Recommendation', 'ActivityLog
         Policy', 'ActivityLog Autoscale', 'Log Analytics', 'Nagios',
         'Platform', 'SCOM', 'ServiceHealth', 'SmartDetector', 'VM Insights',
         'Zabbix'
        :type monitor_service: str or
         ~azure.mgmt.alertsmanagement.models.MonitorService
        :param monitor_condition: Filter by monitor condition which is the
         state of the  monitor(alertRule) at monitor service. Default value is
         to select all. Possible values include: 'Fired', 'Resolved'
        :type monitor_condition: str or
         ~azure.mgmt.alertsmanagement.models.MonitorCondition
        :param severity: Filter by severity.  Defaut value is select all.
         Possible values include: 'Sev0', 'Sev1', 'Sev2', 'Sev3', 'Sev4'
        :type severity: str or ~azure.mgmt.alertsmanagement.models.Severity
        :param alert_state: Filter by state of the alert instance. Default
         value is to select all. Possible values include: 'New',
         'Acknowledged', 'Closed'
        :type alert_state: str or
         ~azure.mgmt.alertsmanagement.models.AlertState
        :param alert_rule: Filter by alert rule(monitor) which fired alert
         instance.  Default value is to select all.
        :type alert_rule: str
        :param time_range: Filter by time range by below listed values.
         Default value is 1 day. Possible values include: '1h', '1d', '7d',
         '30d'
        :type time_range: str or ~azure.mgmt.alertsmanagement.models.TimeRange
        :param custom_time_range: Filter by custom time range in the format
         <start-time>/<end-time>  where time is in (ISO-8601 format)'.
         Permissible values is within 30 days from  query time. Either
         timeRange or customTimeRange could be used but not both. Default is
         none.
        :type custom_time_range: str
        :param dict custom_headers: headers that will be added to the request
        :param bool raw: returns the direct response alongside the
         deserialized response
        :param operation_config: :ref:`Operation configuration
         overrides<msrest:optionsforoperations>`.
        :return: AlertsSummary or ClientRawResponse if raw=true
        :rtype: ~azure.mgmt.alertsmanagement.models.AlertsSummary or
         ~msrest.pipeline.ClientRawResponse
        :raises:
         :class:`ErrorResponseException<azure.mgmt.alertsmanagement.models.ErrorResponseException>`
        """
        # Construct URL
        url = self.get_summary.metadata['url']
        path_format_arguments = {
            'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str')
        }
        url = self._client.format_url(url, **path_format_arguments)

        # Construct parameters
        query_parameters = {}
        query_parameters['groupby'] = self._serialize.query("groupby", groupby, 'str')
        if include_smart_groups_count is not None:
            query_parameters['includeSmartGroupsCount'] = self._serialize.query("include_smart_groups_count", include_smart_groups_count, 'bool')
        if target_resource is not None:
            query_parameters['targetResource'] = self._serialize.query("target_resource", target_resource, 'str')
        if target_resource_type is not None:
            query_parameters['targetResourceType'] = self._serialize.query("target_resource_type", target_resource_type, 'str')
        if target_resource_group is not None:
            query_parameters['targetResourceGroup'] = self._serialize.query("target_resource_group", target_resource_group, 'str')
        if monitor_service is not None:
            query_parameters['monitorService'] = self._serialize.query("monitor_service", monitor_service, 'str')
        if monitor_condition is not None:
            query_parameters['monitorCondition'] = self._serialize.query("monitor_condition", monitor_condition, 'str')
        if severity is not None:
            query_parameters['severity'] = self._serialize.query("severity", severity, 'str')
        if alert_state is not None:
            query_parameters['alertState'] = self._serialize.query("alert_state", alert_state, 'str')
        if alert_rule is not None:
            query_parameters['alertRule'] = self._serialize.query("alert_rule", alert_rule, 'str')
        if time_range is not None:
            query_parameters['timeRange'] = self._serialize.query("time_range", time_range, 'str')
        if custom_time_range is not None:
            query_parameters['customTimeRange'] = self._serialize.query("custom_time_range", custom_time_range, 'str')
        query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')

        # Construct headers
        header_parameters = {}
        header_parameters['Accept'] = 'application/json'
        if self.config.generate_client_request_id:
            header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
        if custom_headers:
            header_parameters.update(custom_headers)
        if self.config.accept_language is not None:
            header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')

        # Construct and send request
        request = self._client.get(url, query_parameters, header_parameters)
        response = self._client.send(request, stream=False, **operation_config)

        if response.status_code not in [200]:
            raise models.ErrorResponseException(self._deserialize, response)

        deserialized = None

        if response.status_code == 200:
            deserialized = self._deserialize('AlertsSummary', response)

        if raw:
            client_raw_response = ClientRawResponse(deserialized, response)
            return client_raw_response

        return deserialized
def get_summary ( self , groupby , include_smart_groups_count = None , target_resource = None , target_resource_type = None , target_resource_group = None , monitor_service = None , monitor_condition = None , severity = None , alert_state = None , alert_rule = None , time_range = None , custom_time_range = None , custom_headers = None , raw = False , * * operation_config ) : # Construct URL url = self . get_summary . metadata [ 'url' ] path_format_arguments = { 'subscriptionId' : self . _serialize . url ( "self.config.subscription_id" , self . config . subscription_id , 'str' ) } url = self . _client . format_url ( url , * * path_format_arguments ) # Construct parameters query_parameters = { } query_parameters [ 'groupby' ] = self . _serialize . query ( "groupby" , groupby , 'str' ) if include_smart_groups_count is not None : query_parameters [ 'includeSmartGroupsCount' ] = self . _serialize . query ( "include_smart_groups_count" , include_smart_groups_count , 'bool' ) if target_resource is not None : query_parameters [ 'targetResource' ] = self . _serialize . query ( "target_resource" , target_resource , 'str' ) if target_resource_type is not None : query_parameters [ 'targetResourceType' ] = self . _serialize . query ( "target_resource_type" , target_resource_type , 'str' ) if target_resource_group is not None : query_parameters [ 'targetResourceGroup' ] = self . _serialize . query ( "target_resource_group" , target_resource_group , 'str' ) if monitor_service is not None : query_parameters [ 'monitorService' ] = self . _serialize . query ( "monitor_service" , monitor_service , 'str' ) if monitor_condition is not None : query_parameters [ 'monitorCondition' ] = self . _serialize . query ( "monitor_condition" , monitor_condition , 'str' ) if severity is not None : query_parameters [ 'severity' ] = self . _serialize . query ( "severity" , severity , 'str' ) if alert_state is not None : query_parameters [ 'alertState' ] = self . _serialize . query ( "alert_state" , alert_state , 'str' ) if alert_rule is not None : query_parameters [ 'alertRule' ] = self . _serialize . query ( "alert_rule" , alert_rule , 'str' ) if time_range is not None : query_parameters [ 'timeRange' ] = self . _serialize . query ( "time_range" , time_range , 'str' ) if custom_time_range is not None : query_parameters [ 'customTimeRange' ] = self . _serialize . query ( "custom_time_range" , custom_time_range , 'str' ) query_parameters [ 'api-version' ] = self . _serialize . query ( "self.api_version" , self . api_version , 'str' ) # Construct headers header_parameters = { } header_parameters [ 'Accept' ] = 'application/json' if self . config . generate_client_request_id : header_parameters [ 'x-ms-client-request-id' ] = str ( uuid . uuid1 ( ) ) if custom_headers : header_parameters . update ( custom_headers ) if self . config . accept_language is not None : header_parameters [ 'accept-language' ] = self . _serialize . header ( "self.config.accept_language" , self . config . accept_language , 'str' ) # Construct and send request request = self . _client . get ( url , query_parameters , header_parameters ) response = self . _client . send ( request , stream = False , * * operation_config ) if response . status_code not in [ 200 ] : raise models . ErrorResponseException ( self . _deserialize , response ) deserialized = None if response . status_code == 200 : deserialized = self . _deserialize ( 'AlertsSummary' , response ) if raw : client_raw_response = ClientRawResponse ( deserialized , response ) return client_raw_response return deserialized
Summary of alerts with the count each severity.

        :param groupby: This parameter allows the result set to be aggregated
         by input fields. For example, groupby=severity,alertstate. Possible
         values include: 'severity', 'alertState', 'monitorCondition',
         'monitorService', 'signalType', 'alertRule'
        :type groupby: str or
         ~azure.mgmt.alertsmanagement.models.AlertsSummaryGroupByFields
        :param include_smart_groups_count: Include count of the SmartGroups as
         part of the summary. Default value is 'false'.
        :type include_smart_groups_count: bool
        :param target_resource: Filter by target resource( which is full ARM
         ID) Default value is select all.
        :type target_resource: str
        :param target_resource_type: Filter by target resource type. Default
         value is select all.
        :type target_resource_type: str
        :param target_resource_group: Filter by target resource group name.
         Default value is select all.
        :type target_resource_group: str
        :param monitor_service: Filter by monitor service which is the source
         of the alert instance. Default value is select all. Possible values
         include: 'Application Insights', 'ActivityLog Administrative',
         'ActivityLog Security', 'ActivityLog Recommendation', 'ActivityLog
         Policy', 'ActivityLog Autoscale', 'Log Analytics', 'Nagios',
         'Platform', 'SCOM', 'ServiceHealth', 'SmartDetector', 'VM Insights',
         'Zabbix'
        :type monitor_service: str or
         ~azure.mgmt.alertsmanagement.models.MonitorService
        :param monitor_condition: Filter by monitor condition which is the
         state of the  monitor(alertRule) at monitor service. Default value is
         to select all. Possible values include: 'Fired', 'Resolved'
        :type monitor_condition: str or
         ~azure.mgmt.alertsmanagement.models.MonitorCondition
        :param severity: Filter by severity.  Defaut value is select all.
         Possible values include: 'Sev0', 'Sev1', 'Sev2', 'Sev3', 'Sev4'
        :type severity: str or ~azure.mgmt.alertsmanagement.models.Severity
        :param alert_state: Filter by state of the alert instance. Default
         value is to select all. Possible values include: 'New',
         'Acknowledged', 'Closed'
        :type alert_state: str or
         ~azure.mgmt.alertsmanagement.models.AlertState
        :param alert_rule: Filter by alert rule(monitor) which fired alert
         instance.  Default value is to select all.
        :type alert_rule: str
        :param time_range: Filter by time range by below listed values.
         Default value is 1 day. Possible values include: '1h', '1d', '7d',
         '30d'
        :type time_range: str or ~azure.mgmt.alertsmanagement.models.TimeRange
        :param custom_time_range: Filter by custom time range in the format
         <start-time>/<end-time>  where time is in (ISO-8601 format)'.
         Permissible values is within 30 days from  query time. Either
         timeRange or customTimeRange could be used but not both. Default is
         none.
        :type custom_time_range: str
        :param dict custom_headers: headers that will be added to the request
        :param bool raw: returns the direct response alongside the
         deserialized response
        :param operation_config: :ref:`Operation configuration
         overrides<msrest:optionsforoperations>`.
        :return: AlertsSummary or ClientRawResponse if raw=true
        :rtype: ~azure.mgmt.alertsmanagement.models.AlertsSummary or
         ~msrest.pipeline.ClientRawResponse
        :raises:
         :class:`ErrorResponseException<azure.mgmt.alertsmanagement.models.ErrorResponseException>`
Summary of alerts with the count each severity .