Skip to content
Merged
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# 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 .alerts_management_client import AlertsManagementClient
from .version import VERSION

__all__ = ['AlertsManagementClient']

__version__ = VERSION

Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
# 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.service_client import SDKClient
from msrest import Serializer, Deserializer
from msrestazure import AzureConfiguration
from .version import VERSION
from .operations.operations import Operations
from .operations.alerts_operations import AlertsOperations
from .operations.smart_groups_operations import SmartGroupsOperations
from . import models


class AlertsManagementClientConfiguration(AzureConfiguration):
"""Configuration for AlertsManagementClient
Note that all parameters used to create this instance are saved as instance
attributes.

:param credentials: Credentials needed for the client to connect to Azure.
:type credentials: :mod:`A msrestazure Credentials
object<msrestazure.azure_active_directory>`
:param scope: scope here is resourceId for which alert is created.
:type scope: str
:param subscription_id: Subscription credentials which uniquely identify
Microsoft Azure subscription. The subscription ID forms part of the URI
for every service call.
:type subscription_id: str
:param str base_url: Service URL
"""

def __init__(
self, credentials, scope, subscription_id, base_url=None):

if credentials is None:
raise ValueError("Parameter 'credentials' must not be None.")
if scope is None:
raise ValueError("Parameter 'scope' must not be None.")
if subscription_id is None:
raise ValueError("Parameter 'subscription_id' must not be None.")
if not base_url:
base_url = 'https://management.azure.com'

super(AlertsManagementClientConfiguration, self).__init__(base_url)

self.add_user_agent('azure-mgmt-alertsmanagement/{}'.format(VERSION))
self.add_user_agent('Azure-SDK-For-Python')

self.credentials = credentials
self.scope = scope
self.subscription_id = subscription_id


class AlertsManagementClient(SDKClient):
"""AlertsManagement Client

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

:ivar operations: Operations operations
:vartype operations: azure.mgmt.alertsmanagement.operations.Operations
:ivar alerts: Alerts operations
:vartype alerts: azure.mgmt.alertsmanagement.operations.AlertsOperations
:ivar smart_groups: SmartGroups operations
:vartype smart_groups: azure.mgmt.alertsmanagement.operations.SmartGroupsOperations

:param credentials: Credentials needed for the client to connect to Azure.
:type credentials: :mod:`A msrestazure Credentials
object<msrestazure.azure_active_directory>`
:param scope: scope here is resourceId for which alert is created.
:type scope: str
:param subscription_id: Subscription credentials which uniquely identify
Microsoft Azure subscription. The subscription ID forms part of the URI
for every service call.
:type subscription_id: str
:param str base_url: Service URL
"""

def __init__(
self, credentials, scope, subscription_id, base_url=None):

self.config = AlertsManagementClientConfiguration(credentials, scope, subscription_id, base_url)
super(AlertsManagementClient, self).__init__(self.config.credentials, self.config)

client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
self.api_version = '2019-03-01'
self._serialize = Serializer(client_models)
self._deserialize = Deserializer(client_models)

self.operations = Operations(
self._client, self.config, self._serialize, self._deserialize)
self.alerts = AlertsOperations(
self._client, self.config, self._serialize, self._deserialize)
self.smart_groups = SmartGroupsOperations(
self._client, self.config, self._serialize, self._deserialize)
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
# 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.
# --------------------------------------------------------------------------

try:
from .operation_display_py3 import OperationDisplay
from .operation_py3 import Operation
from .proxy_resource_py3 import ProxyResource
from .essentials_py3 import Essentials
from .alert_properties_py3 import AlertProperties
from .alert_py3 import Alert
from .alert_modification_item_py3 import AlertModificationItem
from .alert_modification_properties_py3 import AlertModificationProperties
from .alert_modification_py3 import AlertModification
from .smart_group_modification_item_py3 import SmartGroupModificationItem
from .smart_group_modification_properties_py3 import SmartGroupModificationProperties
from .smart_group_modification_py3 import SmartGroupModification
from .alerts_summary_group_item_py3 import AlertsSummaryGroupItem
from .alerts_summary_group_py3 import AlertsSummaryGroup
from .alerts_summary_py3 import AlertsSummary
from .smart_group_aggregated_property_py3 import SmartGroupAggregatedProperty
from .smart_group_py3 import SmartGroup
from .smart_groups_list_py3 import SmartGroupsList
except (SyntaxError, ImportError):
from .operation_display import OperationDisplay
from .operation import Operation
from .proxy_resource import ProxyResource
from .essentials import Essentials
from .alert_properties import AlertProperties
from .alert import Alert
from .alert_modification_item import AlertModificationItem
from .alert_modification_properties import AlertModificationProperties
from .alert_modification import AlertModification
from .smart_group_modification_item import SmartGroupModificationItem
from .smart_group_modification_properties import SmartGroupModificationProperties
from .smart_group_modification import SmartGroupModification
from .alerts_summary_group_item import AlertsSummaryGroupItem
from .alerts_summary_group import AlertsSummaryGroup
from .alerts_summary import AlertsSummary
from .smart_group_aggregated_property import SmartGroupAggregatedProperty
from .smart_group import SmartGroup
from .smart_groups_list import SmartGroupsList
from .operation_paged import OperationPaged
from .alert_paged import AlertPaged
from .alerts_management_client_enums import (
Severity,
SignalType,
AlertState,
MonitorCondition,
MonitorService,
AlertModificationEvent,
SmartGroupModificationEvent,
State,
TimeRange,
AlertsSortByFields,
AlertsSummaryGroupByFields,
SmartGroupsSortByFields,
)

__all__ = [
'OperationDisplay',
'Operation',
'ProxyResource',
'Essentials',
'AlertProperties',
'Alert',
'AlertModificationItem',
'AlertModificationProperties',
'AlertModification',
'SmartGroupModificationItem',
'SmartGroupModificationProperties',
'SmartGroupModification',
'AlertsSummaryGroupItem',
'AlertsSummaryGroup',
'AlertsSummary',
'SmartGroupAggregatedProperty',
'SmartGroup',
'SmartGroupsList',
'OperationPaged',
'AlertPaged',
'Severity',
'SignalType',
'AlertState',
'MonitorCondition',
'MonitorService',
'AlertModificationEvent',
'SmartGroupModificationEvent',
'State',
'TimeRange',
'AlertsSortByFields',
'AlertsSummaryGroupByFields',
'SmartGroupsSortByFields',
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# 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 .proxy_resource import ProxyResource


class Alert(ProxyResource):
"""An alert created in alert management service.

Variables are only populated by the server, and will be ignored when
sending a request.

:ivar id: Azure resource Id
:vartype id: str
:ivar type: Azure resource type
:vartype type: str
:ivar name: Azure resource name
:vartype name: str
:param properties:
:type properties: ~azure.mgmt.alertsmanagement.models.AlertProperties
"""

_validation = {
'id': {'readonly': True},
'type': {'readonly': True},
'name': {'readonly': True},
}

_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'},
'name': {'key': 'name', 'type': 'str'},
'properties': {'key': 'properties', 'type': 'AlertProperties'},
}

def __init__(self, **kwargs):
super(Alert, self).__init__(**kwargs)
self.properties = kwargs.get('properties', None)
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# 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 .proxy_resource import ProxyResource


class AlertModification(ProxyResource):
"""Alert Modification details.

Variables are only populated by the server, and will be ignored when
sending a request.

:ivar id: Azure resource Id
:vartype id: str
:ivar type: Azure resource type
:vartype type: str
:ivar name: Azure resource name
:vartype name: str
:param properties:
:type properties:
~azure.mgmt.alertsmanagement.models.AlertModificationProperties
"""

_validation = {
'id': {'readonly': True},
'type': {'readonly': True},
'name': {'readonly': True},
}

_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'},
'name': {'key': 'name', 'type': 'str'},
'properties': {'key': 'properties', 'type': 'AlertModificationProperties'},
}

def __init__(self, **kwargs):
super(AlertModification, self).__init__(**kwargs)
self.properties = kwargs.get('properties', None)
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# 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 AlertModificationItem(Model):
"""Alert modification item.

:param modification_event: Reason for the modification. Possible values
include: 'AlertCreated', 'StateChange', 'MonitorConditionChange'
:type modification_event: str or
~azure.mgmt.alertsmanagement.models.AlertModificationEvent
:param old_value: Old value
:type old_value: str
:param new_value: New value
:type new_value: str
:param modified_at: Modified date and time
:type modified_at: str
:param modified_by: Modified user details (Principal client name)
:type modified_by: str
:param comments: Modification comments
:type comments: str
:param description: Description of the modification
:type description: str
"""

_attribute_map = {
'modification_event': {'key': 'modificationEvent', 'type': 'AlertModificationEvent'},
'old_value': {'key': 'oldValue', 'type': 'str'},
'new_value': {'key': 'newValue', 'type': 'str'},
'modified_at': {'key': 'modifiedAt', 'type': 'str'},
'modified_by': {'key': 'modifiedBy', 'type': 'str'},
'comments': {'key': 'comments', 'type': 'str'},
'description': {'key': 'description', 'type': 'str'},
}

def __init__(self, **kwargs):
super(AlertModificationItem, self).__init__(**kwargs)
self.modification_event = kwargs.get('modification_event', None)
self.old_value = kwargs.get('old_value', None)
self.new_value = kwargs.get('new_value', None)
self.modified_at = kwargs.get('modified_at', None)
self.modified_by = kwargs.get('modified_by', None)
self.comments = kwargs.get('comments', None)
self.description = kwargs.get('description', None)
Loading